Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386 Implement cpu_wait(), and move the call to tss...



details:   https://anonhg.NetBSD.org/src/rev/773bd81e9533
branches:  trunk
changeset: 474789:773bd81e9533
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jul 20 22:25:18 1999 +0000

description:
Implement cpu_wait(), and move the call to tss_free() from switch_exit()
to cpu_wait(); tss_free() may block, and thus requires a valid context.

diffstat:

 sys/arch/i386/i386/locore.s     |   9 +++------
 sys/arch/i386/i386/vm_machdep.c |  16 +++++++++++++++-
 sys/arch/i386/include/cpu.h     |   3 +--
 3 files changed, 19 insertions(+), 9 deletions(-)

diffs (73 lines):

diff -r 68b35ad5c47b -r 773bd81e9533 sys/arch/i386/i386/locore.s
--- a/sys/arch/i386/i386/locore.s       Tue Jul 20 21:54:05 1999 +0000
+++ b/sys/arch/i386/i386/locore.s       Tue Jul 20 22:25:18 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.209 1999/06/17 00:12:11 thorpej Exp $     */
+/*     $NetBSD: locore.s,v 1.210 1999/07/20 22:25:18 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -2089,14 +2089,11 @@
        sti
 
        /*
-        * Nuke the TSS and schedule the dead process's
-        * vmspace and stack to be freed.
+        * Schedule the dead process's vmspace and stack to be freed.
         */
-       pushl   P_ADDR(%edi)            /* tss_free(p->p_addr) */
-       call    _C_LABEL(tss_free)
        pushl   %edi                    /* exit2(p) */
        call    _C_LABEL(exit2)
-       addl    $8,%esp
+       addl    $4,%esp
 
        /* Jump into cpu_switch() with the right state. */
        movl    %ebx,%esi
diff -r 68b35ad5c47b -r 773bd81e9533 sys/arch/i386/i386/vm_machdep.c
--- a/sys/arch/i386/i386/vm_machdep.c   Tue Jul 20 21:54:05 1999 +0000
+++ b/sys/arch/i386/i386/vm_machdep.c   Tue Jul 20 22:25:18 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.82 1999/07/08 18:05:28 thorpej Exp $  */
+/*     $NetBSD: vm_machdep.c,v 1.83 1999/07/20 22:25:19 thorpej Exp $  */
 
 /*-
  * Copyright (c) 1995 Charles M. Hannum.  All rights reserved.
@@ -216,6 +216,20 @@
 }
 
 /*
+ * cpu_wait is called from reaper() to let machine-dependent
+ * code free machine-dependent resources that couldn't be freed
+ * in cpu_exit().
+ */
+void
+cpu_wait(p)
+       struct proc *p;
+{
+
+       /* Nuke the TSS. */
+       tss_free(&p->p_addr->u_pcb);
+}
+
+/*
  * Dump the machine specific segment at the start of a core dump.
  */     
 struct md_core {
diff -r 68b35ad5c47b -r 773bd81e9533 sys/arch/i386/include/cpu.h
--- a/sys/arch/i386/include/cpu.h       Tue Jul 20 21:54:05 1999 +0000
+++ b/sys/arch/i386/include/cpu.h       Tue Jul 20 22:25:18 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.53 1999/04/01 00:37:50 thorpej Exp $ */
+/*     $NetBSD: cpu.h,v 1.54 1999/07/20 22:25:19 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -53,7 +53,6 @@
  * referenced in generic code
  */
 #define        cpu_swapin(p)                   /* nothing */
-#define        cpu_wait(p)                     /* nothing */
 
 /*
  * Arguments to hardclock, softclock and statclock



Home | Main Index | Thread Index | Old Index