mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
x86: Check for APIC presence only if DEV_ATPIC is defined
We only attempt to gracefully handle absence of an APIC if "device atpic" is defined in the kernel configuration. Suggested by: kib Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
254e4e5b77
commit
deca0138dc
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue