Source-Changes-HG archive

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

[src/yamt-km]: src/sys/arch/xen/i386 We can't write directly to a gdt slot, w...



details:   https://anonhg.NetBSD.org/src/rev/58a8a1982e40
branches:  yamt-km
changeset: 573388:58a8a1982e40
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Mon Mar 21 16:51:15 2005 +0000

description:
We can't write directly to a gdt slot, we need to go though
xen_update_descriptor().

diffstat:

 sys/arch/xen/i386/gdt.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 8769ea67f2e9 -r 58a8a1982e40 sys/arch/xen/i386/gdt.c
--- a/sys/arch/xen/i386/gdt.c   Mon Mar 21 10:26:26 2005 +0000
+++ b/sys/arch/xen/i386/gdt.c   Mon Mar 21 16:51:15 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.c,v 1.1.14.2 2005/03/19 08:33:21 yamt Exp $        */
+/*     $NetBSD: gdt.c,v 1.1.14.3 2005/03/21 16:51:15 bouyer Exp $      */
 /*     NetBSD: gdt.c,v 1.32 2004/02/13 11:36:13 wiz Exp        */
 
 /*-
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.1.14.2 2005/03/19 08:33:21 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.1.14.3 2005/03/21 16:51:15 bouyer Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -351,12 +351,17 @@
 void
 gdt_put_slot1(int slot, int which)
 {
+       union descriptor d;
+       d.raw[0] = 0;
+       d.raw[1] = 0;
 
        gdt_lock();
        gdt_count[which]--;
 
-       gdt[slot].gd.gd_type = SDT_SYSNULL;
-       gdt[slot].gd.gd_selector = gdt_free[which];
+       d.gd.gd_type = SDT_SYSNULL;
+       d.gd.gd_selector = gdt_free[which];
+       xen_update_descriptor(&gdt[slot], &d);
+
        gdt_free[which] = slot;
 
        gdt_unlock();



Home | Main Index | Thread Index | Old Index