commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnumach/i386/i386 gdt.c


From: Roland McGrath
Subject: gnumach/i386/i386 gdt.c
Date: Thu, 03 Oct 2002 22:44:49 -0400

CVSROOT:        /cvsroot/hurd
Module name:    gnumach
Changes by:     Roland McGrath <address@hidden> 02/10/03 22:44:49

Modified files:
        i386/i386      : gdt.c 

Log message:
        2002-10-03  Roland McGrath  <address@hidden>
        
        * i386/i386/gdt.h (KERNEL_CS, KERNEL_DS, KERNEL_TSS, KERNEL_LDT):
        Values changed, new GDT layout not matching oskit base_gdt.h defaults.
        (BASE_KERNEL_CS, BASE_KERNEL_DS): New macros with to oskit's values.
        * oskit/x86/main.c (ktss): Variable moved to gdt.c.
        (main): Don't diddle the tss here.
        * i386/i386/gdt.c (gdt_init): Do it here instead.
        * oskit/x86/main.c (my_exit): Restore oskit's base_gdt.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnumach/gnumach/i386/i386/gdt.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gnumach/i386/i386/gdt.c
diff -u gnumach/i386/i386/gdt.c:1.2 gnumach/i386/i386/gdt.c:1.3
--- gnumach/i386/i386/gdt.c:1.2 Mon May 27 19:01:50 2002
+++ gnumach/i386/i386/gdt.c     Thu Oct  3 22:44:49 2002
@@ -39,6 +39,13 @@
 
 extern void etext();
 
+/* The BASE_TSS in OSKit has no I/O permission bitmap, but we want
+   one.  So we replace it with an extended TSS at link-time.  */
+#include <machine/tss.h>
+#include <machine/io_perm.h>
+static struct task_tss ktss;
+extern struct x86_tss base_tss __attribute__ ((alias ("ktss")));
+
 void
 gdt_init()
 {
@@ -59,6 +66,18 @@
        fill_gdt_descriptor(KERNEL_DS,
                            LINEAR_MIN_KERNEL_ADDRESS, 0xffffffff,
                            ACC_PL_K|ACC_DATA_W, SZ_32);
+
+       /* Copy the values to the slots used by oskit code.  */
+       gdt[sel_idx (BASE_KERNEL_CS)] = gdt[sel_idx (KERNEL_CS)];
+       gdt[sel_idx (BASE_KERNEL_DS)] = gdt[sel_idx (KERNEL_DS)];
+
+       /* Set up the KERNEL_TSS to include an I/O permission bitmap.  */
+       fill_gdt_descriptor(KERNEL_TSS,
+                           kvtolin(&ktss),
+                           sizeof(struct task_tss) - 1,
+                           ACC_PL_K|ACC_TSS, 0);
+       ktss.tss.io_bit_map_offset = IOPB_INVAL;
+       ktss.barrier = 0xFF;
 
 #if MULTIPROCESSOR
        /*




reply via email to

[Prev in Thread] Current Thread [Next in Thread]