diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index ac3dfa4ca1d..1264eeaaf7b 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -932,9 +932,11 @@ native_lapic_enable_pmc(void) #ifdef HWPMC_HOOKS u_int32_t maxlvt; +#ifdef DEV_ATPIC /* Fail if the local APIC is not present. */ if (!x2apic_mode && lapic_map == NULL) return (0); +#endif /* Fail if the PMC LVT is not present. */ maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT; @@ -971,9 +973,11 @@ native_lapic_disable_pmc(void) #ifdef HWPMC_HOOKS u_int32_t maxlvt; +#ifdef DEV_ATPIC /* Fail if the local APIC is not present. */ if (!x2apic_mode && lapic_map == NULL) return; +#endif /* Fail if the PMC LVT is not present. */ maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT;