Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/i386/i386/locore.S,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/i386/i386/locore.S,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.11 retrieving revision 1.20 diff -u -p -r1.11 -r1.20 --- src/sys/arch/i386/i386/locore.S 2003/06/26 16:47:15 1.11 +++ src/sys/arch/i386/i386/locore.S 2003/11/04 10:33:15 1.20 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.11 2003/06/26 16:47:15 drochner Exp $ */ +/* $NetBSD: locore.S,v 1.20 2003/11/04 10:33:15 dsl Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -51,11 +51,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -74,16 +70,17 @@ * @(#)locore.s 7.3 (Berkeley) 5/13/91 */ +#include "opt_compat_netbsd.h" +#include "opt_compat_oldboot.h" #include "opt_cputype.h" #include "opt_ddb.h" -#include "opt_ipkdb.h" -#include "opt_vm86.h" -#include "opt_user_ldt.h" #include "opt_dummy_nops.h" -#include "opt_compat_oldboot.h" -#include "opt_multiprocessor.h" +#include "opt_ipkdb.h" #include "opt_lockdebug.h" +#include "opt_multiprocessor.h" #include "opt_realmem.h" +#include "opt_user_ldt.h" +#include "opt_vm86.h" #include "npx.h" #include "assym.h" @@ -242,7 +239,7 @@ _C_LABEL(biosextmem): .long REALEXTMEM tmpstk: -#define _RELOC(x) ((x) - KERNBASE) +#define _RELOC(x) ((x) - KERNBASE_LOCORE) #define RELOC(x) _RELOC(_C_LABEL(x)) .text @@ -296,7 +293,7 @@ start: movw $0x1234,0x472 # warm boot movl 16(%esp),%eax testl %eax,%eax jz 1f - addl $KERNBASE,%eax + addl $KERNBASE_LOCORE,%eax 1: movl %eax,RELOC(esym) movl RELOC(biosextmem),%eax @@ -516,7 +513,7 @@ try586: /* Use the `cpuid' instruction. movl RELOC(esym),%eax testl %eax,%eax jz 1f - subl $KERNBASE,%eax + subl $KERNBASE_LOCORE,%eax movl %eax,%edi 1: #endif @@ -632,10 +629,10 @@ try586: /* Use the `cpuid' instruction. ret begin: - /* Now running relocated at KERNBASE. Remove double mapping. */ + /* Now running relocated at KERNBASE_LOCORE. Remove double mapping. */ movl _C_LABEL(nkpde),%ecx # for this many pde s, leal (PROC0PDIR+0*4)(%esi),%ebx # which is where temp maps! - addl $(KERNBASE), %ebx # now use relocated address + addl $(KERNBASE_LOCORE), %ebx # now use relocated address 1: movl $0,(%ebx) addl $4,%ebx # next pde loop 1b @@ -643,12 +640,12 @@ begin: /* Relocate atdevbase. */ movl _C_LABEL(nkpde),%edx shll $PGSHIFT,%edx - addl $(TABLESIZE+KERNBASE),%edx + addl $(TABLESIZE+KERNBASE_LOCORE),%edx addl %esi,%edx movl %edx,_C_LABEL(atdevbase) /* Set up bootstrap stack. */ - leal (PROC0STACK+KERNBASE)(%esi),%eax + leal (PROC0STACK+KERNBASE_LOCORE)(%esi),%eax movl %eax,_C_LABEL(proc0paddr) leal (USPACE-FRAMESIZE)(%eax),%esp movl %esi,PCB_CR3(%eax) # pcb->pcb_cr3 @@ -709,7 +706,7 @@ NENTRY(proc_trampoline) /* NOTREACHED */ /*****************************************************************************/ - +#ifdef COMPAT_16 /* * Signal trampoline; copied to top of user stack. */ @@ -722,12 +719,19 @@ NENTRY(sigcode) leal 12(%esp),%eax # get pointer to sigcontext movl %eax,4(%esp) # put it in the argument slot # fake return address already there +#if defined(SYS_compat_16___sigreturn14) + movl $SYS_compat_16___sigreturn14,%eax +#elif defined(SYS___sigreturn14) movl $SYS___sigreturn14,%eax +#else + #error "no sigreturn14 syscall" +#endif int $0x80 # enter kernel with args on stack movl $SYS_exit,%eax int $0x80 # exit if sigreturn fails .globl _C_LABEL(esigcode) _C_LABEL(esigcode): +#endif /*****************************************************************************/ @@ -1800,6 +1804,7 @@ idle_start: jz idle_loop idle_exit: movl $IPL_HIGH,CPUVAR(ILEVEL) # splhigh + sti #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) call _C_LABEL(sched_lock_idle) #endif @@ -1946,17 +1951,8 @@ switch_restored: */ movl CPUVAR(CURLWP),%edi movl L_PROC(%edi),%esi - cmpl $0,P_NRAS(%esi) - je 1f - movl L_MD_REGS(%edi),%ebx - movl TF_EIP(%ebx),%eax - pushl %eax - pushl %esi - call _C_LABEL(ras_lookup) - addl $8,%esp - cmpl $-1,%eax - je 1f - movl %eax,TF_EIP(%ebx) + cmpl $0,P_RASLIST(%esi) + jne 2f 1: movl $1,%ebx @@ -1976,6 +1972,18 @@ switch_return: popl %ebx ret +2: # check RAS list + movl L_MD_REGS(%edi),%ebx + movl TF_EIP(%ebx),%eax + pushl %eax + pushl %esi + call _C_LABEL(ras_lookup) + addl $8,%esp + cmpl $-1,%eax + je 1b + movl %eax,TF_EIP(%ebx) + jmp 1b + /* * void cpu_switchto(struct lwp *current, struct lwp *next) * Switch to the specified next LWP. @@ -2146,7 +2154,9 @@ syscall1: movl CPUVAR(CURLWP),%edx movl %esp,L_MD_REGS(%edx) # save pointer to frame movl L_PROC(%edx),%edx + pushl %esp call *P_MD_SYSCALL(%edx) # get pointer to syscall() function + addl $4,%esp 2: /* Check for ASTs on exit to user mode. */ cli CHECK_ASTPENDING(%eax) @@ -2155,7 +2165,9 @@ syscall1: CLEAR_ASTPENDING(%eax) sti /* Pushed T_ASTFLT into tf_trapno on entry. */ + pushl %esp call _C_LABEL(trap) + addl $4,%esp jmp 2b #ifndef DIAGNOSTIC 1: INTRFASTEXIT