Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/arch/i386/i386 Pull up revision 1.2 (requested by s...



details:   https://anonhg.NetBSD.org/src/rev/c0af4b9f63d7
branches:  netbsd-1-5
changeset: 491920:c0af4b9f63d7
user:      he <he%NetBSD.org@localhost>
date:      Sun Jun 17 22:26:58 2001 +0000

description:
Pull up revision 1.2 (requested by sommerfeld):
  Add %fs/%gs to trap frame and save/restore them on trap/interupt/
  syscall entry from userspace.

  Remove special-case ``by hand'' validation of %fs/%gs register
  values s well as special handling of them in various signal
  handling paths.  Now, like %ds and %es, they are validated by
  the hardware on return to userland.

  This paves the way for the use of %fs for per-cpu data on multi-
  processor systems, and fixes an otherwise difficult-to-fix
  interaction between threads/clone(2) and USER_LDT.

diffstat:

 sys/arch/i386/i386/ipkdb_glue.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 3320d3684873 -r c0af4b9f63d7 sys/arch/i386/i386/ipkdb_glue.c
--- a/sys/arch/i386/i386/ipkdb_glue.c   Sun Jun 17 22:26:55 2001 +0000
+++ b/sys/arch/i386/i386/ipkdb_glue.c   Sun Jun 17 22:26:58 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipkdb_glue.c,v 1.1 2000/03/22 20:58:27 ws Exp $        */
+/*     $NetBSD: ipkdb_glue.c,v 1.1.6.1 2001/06/17 22:26:58 he Exp $    */
 
 /*
  * Copyright (C) 2000 Wolfgang Solfrank.
@@ -99,8 +99,8 @@
        ipkdbregs[SS] = 0x10;
        ipkdbregs[DS] = frame.tf_ds;
        ipkdbregs[ES] = frame.tf_es;
-       __asm ("movl %%fs,%0; movl %%gs,%1"
-              : "=r"(ipkdbregs[FS]), "=r"(ipkdbregs[GS]));
+       ipkdbregs[FS] = frame.tf_fs;
+       ipkdbregs[GS] = frame.tf_gs;
 
        switch ((ipkdb_mode = ipkdbcmds())) {
        case IPKDB_CMD_EXIT:
@@ -123,8 +123,8 @@
        frame.tf_cs = ipkdbregs[CS];
        frame.tf_ds = ipkdbregs[DS];
        frame.tf_es = ipkdbregs[ES];
-       __asm __volatile ("movl %0,%%fs; movl %1,%%gs"
-                         :: "r"(ipkdbregs[FS]), "r"(ipkdbregs[GS]));
+       frame.tf_fs = ipkdbregs[FS];
+       frame.tf_gs = ipkdbregs[GS];
 
        return 1;
 }



Home | Main Index | Thread Index | Old Index