In-Reply-To: <20060718091950.075712000@sous-sol.org>
On Tue, 18 Jul 2006 00:00:06 -0700, Chris Wright wrote:>
> Add Xen interface header files.
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/include/xen/interface/arch-x86_32.h Thu Jun 08 19:24:13 2006
-0400
> +#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
> +
> +/*
> + * 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
--
Chuck
And did we tell you the name of the game, boy, we call it Riding the Gravy
Train.