Skip to contentSkip to conversation

Add Xen interface header files

RFC PATCH Chuck Ebbert 1 participant 1 message Jul 18, 2006

lore
Share & tools
lore
#0 lore raw

In-Reply-To: <[email protected]>

include/xen/interface/arch-x86_32.h Thu Jun 08 19:24:13 2006 -0400

Quoted 9 lines · Chris Wright

Add Xen interface header files.

include/xen/interface/arch-x86_32.h Thu Jun 08 19:24:13 2006 -0400 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +3 -0
 
+#define FIRST_RESERVED_GDT_PAGE  14
+#define FIRST_RESERVED_GDT_BYTE  (FIRST_RESERVED_GDT_PAGE * 4096)
+#define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)

== 7168

include/xen/interface/arch-x86_32.h Thu Jun 08 19:24:13 2006 -0400

Quoted 12 lines
include/xen/interface/arch-x86_32.h Thu Jun 08 19:24:13 2006 -0400 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +12 -0
+
+/*
+ * These flat segments are in the Xen-private section of every GDT. Since these
+ * are also present in the initial GDT, many OSes will be able to avoid
+ * installing their own GDT.
+ */
+#define FLAT_RING1_CS 0xe019    /* GDT index 259 */
+#define FLAT_RING1_DS 0xe021    /* GDT index 260 */
+#define FLAT_RING1_SS 0xe021    /* GDT index 260 */
+#define FLAT_RING3_CS 0xe02b    /* GDT index 261 */
+#define FLAT_RING3_DS 0xe033    /* GDT index 262 */
+#define FLAT_RING3_SS 0xe033    /* GDT index 262 */

Umm, these definitions are magic hardcoded constants that really refer to indexes 7171 through 7174.

How about this instead?

+#define FLAT_RING1_CS (((FIRST_RESERVED_GDT_ENTRY + 3) << 3) | 1) +#define FLAT_RING1_DS (((FIRST_RESERVED_GDT_ENTRY + 4) << 3) | 1) +#define FLAT_RING1_SS FLAT_RING1_DS
+#define FLAT_RING3_CS (((FIRST_RESERVED_GDT_ENTRY + 5) << 3) | 3) +#define FLAT_RING3_DS (((FIRST_RESERVED_GDT_ENTRY + 6) << 3) | 3) +#define FLAT_RING3_SS FLAT_RING3_DS

Signature · 2 lines
Chuck
And did we tell you the name of the game, boy, we call it Riding the Gravy Train.