From e65b5b259ed43b7da42d1014eb5dca5fdfa3e7ed Mon Sep 17 00:00:00 2001 From: mycroft Date: Mon, 18 Apr 1994 01:24:09 +0000 Subject: [PATCH] Restore the stack before the LDT. --- sys/arch/i386/i386/locore.s | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s index 40978a4e5d8b..d272b65e18d7 100644 --- a/sys/arch/i386/i386/locore.s +++ b/sys/arch/i386/i386/locore.s @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 - * $Id: locore.s,v 1.63 1994/04/08 22:03:09 mycroft Exp $ + * $Id: locore.s,v 1.64 1994/04/18 01:24:09 mycroft Exp $ */ /* @@ -1603,7 +1603,11 @@ swtch_exited: movl PCB_CR3(%esi),%ecx movl %ecx,%cr3 -#ifdef USER_LDT + /* Restore stack. */ + movl PCB_ESP(%esi),%esp + movl PCB_EBP(%esi),%ebp + +#ifdef USER_LDT cmpl $0,PCB_USERLDT(%esi) jnz 1f movl __default_ldt,%ecx @@ -1618,9 +1622,7 @@ swtch_exited: 2: #endif - /* Restore stack and segments. */ - movl PCB_ESP(%esi),%esp - movl PCB_EBP(%esi),%ebp + /* Restore segments. */ movl PCB_FS(%esi),%ecx movl %cx,%fs movl PCB_GS(%esi),%ecx @@ -1658,6 +1660,9 @@ ENTRY(swtch_exit) incl _cnt+V_SWTCH + /* In case we fault... */ + movl $0,_curproc + /* Restore proc0's context. */ cli movl P_ADDR(%ebx),%esi