Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 Oops, forgot to commit this file.



details:   https://anonhg.NetBSD.org/src/rev/585f4260dee9
branches:  trunk
changeset: 472934:585f4260dee9
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed May 12 21:21:48 1999 +0000

description:
Oops, forgot to commit this file.

diffstat:

 sys/arch/i386/i386/process_machdep.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (58 lines):

diff -r 97c911577ed2 -r 585f4260dee9 sys/arch/i386/i386/process_machdep.c
--- a/sys/arch/i386/i386/process_machdep.c      Wed May 12 20:43:49 1999 +0000
+++ b/sys/arch/i386/i386/process_machdep.c      Wed May 12 21:21:48 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.29 1998/08/15 05:10:24 mycroft Exp $     */
+/*     $NetBSD: process_machdep.c,v 1.30 1999/05/12 21:21:48 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -70,6 +70,8 @@
 #include <sys/vnode.h>
 #include <sys/ptrace.h>
 
+#include <vm/vm.h>
+
 #include <machine/psl.h>
 #include <machine/reg.h>
 #include <machine/segments.h>
@@ -177,6 +179,7 @@
 {
        struct trapframe *tf = process_frame(p);
        struct pcb *pcb = &p->p_addr->u_pcb;
+       pmap_t pmap = p->p_vmspace->vm_map.pmap;
 
 #ifdef VM86
        if (tf->tf_eflags & PSL_VM) {
@@ -188,10 +191,10 @@
        } else
 #endif
        {
-#define        verr_ldt(slot)  (slot < pcb->pcb_ldt_len && \
-                        (pcb->pcb_ldt[slot].sd.sd_type & SDT_MEMRO) != 0 && \
-                        pcb->pcb_ldt[slot].sd.sd_dpl == SEL_UPL && \
-                        pcb->pcb_ldt[slot].sd.sd_p == 1)
+#define        verr_ldt(slot)  (slot < pmap->pm_ldt_len && \
+                        (pmap->pm_ldt[slot].sd.sd_type & SDT_MEMRO) != 0 && \
+                        pmap->pm_ldt[slot].sd.sd_dpl == SEL_UPL && \
+                        pmap->pm_ldt[slot].sd.sd_p == 1)
 #define        verr_gdt(slot)  (slot < NGDT && \
                         (gdt[slot].sd.sd_type & SDT_MEMRO) != 0 && \
                         gdt[slot].sd.sd_dpl == SEL_UPL && \
@@ -208,12 +211,16 @@
                    !USERMODE(regs->r_cs, regs->r_eflags))
                        return (EINVAL);
 
+               simple_lock(&pmap->pm_lock);
+
                if ((regs->r_gs != pcb->pcb_gs && \
                     !valid_sel(regs->r_gs) && !null_sel(regs->r_gs)) ||
                    (regs->r_fs != pcb->pcb_fs && \
                     !valid_sel(regs->r_fs) && !null_sel(regs->r_fs)))
                        return (EINVAL);
 
+               simple_unlock(&pmap->pm_lock);
+
                pcb->pcb_gs = regs->r_gs;
                pcb->pcb_fs = regs->r_fs;
                tf->tf_es = regs->r_es;



Home | Main Index | Thread Index | Old Index