Print this page
4806 define x2apic feature flag
4807 pcplusmp & apix should use x2apic feature flag
Reviewed by: Robert Mustacchi <rm@joyent.com>

@@ -20,10 +20,13 @@
  */
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2014 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ */
 
 #include <sys/cpuvar.h>
 #include <sys/psm.h>
 #include <sys/archsystm.h>
 #include <sys/apic.h>

@@ -92,11 +95,10 @@
  * APIC register ops related data sturctures and functions.
  */
 void apic_send_EOI();
 void apic_send_directed_EOI(uint32_t irq);
 
-#define X2APIC_CPUID_BIT        21
 #define X2APIC_ENABLE_BIT       10
 
 /*
  * Local APIC Implementation
  */

@@ -231,19 +233,14 @@
 }
 
 int
 apic_detect_x2apic(void)
 {
-        struct cpuid_regs cp;
-
         if (x2apic_enable == 0)
                 return (0);
 
-        cp.cp_eax = 1;
-        (void) __cpuid_insn(&cp);
-
-        return ((cp.cp_ecx & (0x1 << X2APIC_CPUID_BIT)) ? 1 : 0);
+        return (is_x86_feature(x86_featureset, X86FSET_X2APIC));
 }
 
 void
 apic_enable_x2apic(void)
 {