svn commit: r193662 - head/sys/i386/include

Adrian Chadd adrian at FreeBSD.org
Sun Jun 7 22:52:49 UTC 2009


Author: adrian
Date: Sun Jun  7 22:52:48 2009
New Revision: 193662
URL: http://svn.freebsd.org/changeset/base/193662

Log:
  Decouple the i386 native and i386 Xen APIC definitions a little further.
  
  I'm experimenting locally with xen APIC emulation a bit and this
  makes it easier to migrate APIC entries between being bitmapped and
  not being bitmapped.

Modified:
  head/sys/i386/include/apicvar.h

Modified: head/sys/i386/include/apicvar.h
==============================================================================
--- head/sys/i386/include/apicvar.h	Sun Jun  7 22:52:19 2009	(r193661)
+++ head/sys/i386/include/apicvar.h	Sun Jun  7 22:52:48 2009	(r193662)
@@ -108,12 +108,13 @@
  */ 
 
 /* Interrupts for local APIC LVT entries other than the timer. */
+#ifdef XEN
+/* These are the Xen i386 APIC definitions */
 #define	APIC_LOCAL_INTS	240
 #define	APIC_ERROR_INT	APIC_LOCAL_INTS
 #define	APIC_THERMAL_INT (APIC_LOCAL_INTS + 1)
-
 #define	APIC_IPI_INTS	(APIC_LOCAL_INTS + 2)
-#ifdef XEN
+
 #define	IPI_RENDEZVOUS		(APIC_IPI_INTS)	/* Inter-CPU rendezvous. */
 #define	IPI_INVLTLB		(APIC_IPI_INTS + 1)	/* TLB Shootdown IPIs */
 #define	IPI_INVLPG		(APIC_IPI_INTS + 2)
@@ -123,7 +124,24 @@
 /* Vector to handle bitmap based IPIs */
 #define	IPI_BITMAP_VECTOR	(APIC_IPI_INTS + 6)
 
-#else
+/* IPIs handled by IPI_BITMAPED_VECTOR  (XXX ups is there a better place?) */
+#define	IPI_AST		0 	/* Generate software trap. */
+#define IPI_PREEMPT     1
+#define IPI_HARDCLOCK   2 
+#define IPI_STATCLOCK   3 
+#define IPI_PROFCLOCK   4 
+#define IPI_BITMAP_LAST IPI_PROFCLOCK
+#define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST)
+
+#define	IPI_STOP	(APIC_IPI_INTS + 7)	/* Stop CPU until restarted. */
+
+#else /* XEN */
+/* These are the normal i386 APIC definitions */
+#define	APIC_LOCAL_INTS	240
+#define	APIC_ERROR_INT	APIC_LOCAL_INTS
+#define	APIC_THERMAL_INT (APIC_LOCAL_INTS + 1)
+#define	APIC_IPI_INTS	(APIC_LOCAL_INTS + 2)
+
 #define	IPI_RENDEZVOUS	(APIC_IPI_INTS)		/* Inter-CPU rendezvous. */
 #define	IPI_INVLTLB	(APIC_IPI_INTS + 1)	/* TLB Shootdown IPIs */
 #define	IPI_INVLPG	(APIC_IPI_INTS + 2)
@@ -132,7 +150,6 @@
 #define	IPI_LAZYPMAP	(APIC_IPI_INTS + 5)	/* Lazy pmap release. */
 /* Vector to handle bitmap based IPIs */
 #define	IPI_BITMAP_VECTOR	(APIC_IPI_INTS + 6) 
-#endif
 
 /* IPIs handled by IPI_BITMAPED_VECTOR  (XXX ups is there a better place?) */
 #define	IPI_AST		0 	/* Generate software trap. */
@@ -144,6 +161,7 @@
 #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST)
 
 #define	IPI_STOP	(APIC_IPI_INTS + 7)	/* Stop CPU until restarted. */
+#endif /* XEN */
 
 /*
  * The spurious interrupt can share the priority class with the IPIs since


More information about the svn-src-all mailing list