Mark `inline` function as `static` In c99 a function that is just `inline` needs an `extern` declaration somewhere so that the compiler knows where to generate the non inlined version of the function for linking. As this function has no `extern` declaration the compiler, depending on optimisation levels, may emit a call to the function instead of inline, which will result in a link time failure as none is generated.
diff --git a/libsel4vmm/src/processor/lapic.c b/libsel4vmm/src/processor/lapic.c index 1d673ff..03943af 100644 --- a/libsel4vmm/src/processor/lapic.c +++ b/libsel4vmm/src/processor/lapic.c
@@ -122,7 +122,7 @@ *((uint32_t *) (apic->regs + reg_off)) = val; } -inline uint32_t vmm_apic_get_reg(vmm_lapic_t *apic, int reg_off) +static inline uint32_t vmm_apic_get_reg(vmm_lapic_t *apic, int reg_off) { return *((uint32_t *) (apic->regs + reg_off)); } @@ -150,12 +150,12 @@ ((uint32_t *)bitmap)[vec >> 5] &= ~(1UL << (vec & 31)); } -inline int vmm_apic_sw_enabled(vmm_lapic_t *apic) +static inline int vmm_apic_sw_enabled(vmm_lapic_t *apic) { return vmm_apic_get_reg(apic, APIC_SPIV) & APIC_SPIV_APIC_ENABLED; } -inline int vmm_apic_hw_enabled(vmm_lapic_t *apic) +static inline int vmm_apic_hw_enabled(vmm_lapic_t *apic) { return apic->apic_base & MSR_IA32_APICBASE_ENABLE; }