This file contains definitions that are needed for the modules written in assembler, for example in case of KVM_TIMER_CNTVOFF
it generates a symbol with the same name which contains the offset of arch.timer.cntvoff
field from the beginning of the kvm
struct (using offsetof
macro: http://lxr.free-electrons.com/source/tools/include/linux/kernel.h#L15).
So, if you have this, you can use these symbols to access the structure fields in the asm like here: http://tomoyo.osdn.jp/cgi-bin/lxr/source/arch/arm/kvm/interrupts_head.S#L555
555 ldr r4, [vcpu, #VCPU_KVM]
556 ldr r2, [r4, #KVM_TIMER_ENABLED]
557 cmp r2, #0
558 beq 1f
559
560 ldr r2, [r4, #KVM_TIMER_CNTVOFF]
561 ldr r3, [r4, #(KVM_TIMER_CNTVOFF + 4)]
562 mcrr p15, 4, rr_lo_hi(r2, r3), c14 @ CNTVOFF
563
So, in r4, you have the address of struct kvm
instance and with
ldr r2, [r4, #KVM_TIMER_CNTVOFF]
you're accessing the field KVM_TIMER_CNTVOFF
.