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.62 retrieving revision 1.69 diff -u -p -r1.62 -r1.69 --- src/sys/arch/i386/i386/locore.S 2008/01/11 20:00:14 1.62 +++ src/sys/arch/i386/i386/locore.S 2008/04/28 20:23:24 1.69 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.62 2008/01/11 20:00:14 bouyer Exp $ */ +/* $NetBSD: locore.S,v 1.69 2008/04/28 20:23:24 martin Exp $ */ /* * Copyright-o-rama! @@ -85,13 +85,6 @@ * 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 NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -141,7 +134,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.62 2008/01/11 20:00:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.69 2008/04/28 20:23:24 martin Exp $"); #include "opt_compat_oldboot.h" #include "opt_ddb.h" @@ -192,6 +185,9 @@ __KERNEL_RCSID(0, "$NetBSD: locore.S,v 1 .ascii ",HYPERCALL_PAGE=0x00000101" /* (???+HYPERCALL_PAGE_OFFSET)/PAGE_SIZE) */ #endif +#ifdef PAE + .ascii ",PAE=yes[extended-cr3]" +#endif #else /* !XEN3 */ .ascii "GUEST_OS=netbsd,GUEST_VER=2.0,XEN_VER=2.0" #endif /* XEN3 */ @@ -244,7 +240,7 @@ _C_LABEL(proc0uarea): .long 0 _C_LABEL(PDPpaddr): .long 0 # paddr of PDP, for libkvm _C_LABEL(tablesize): .long 0 - .space 1024 + .space 512 tmpstk: #ifndef XEN @@ -813,16 +809,16 @@ NENTRY(lgdt_finish) * NOTE: This function does not have a normal calling sequence! */ NENTRY(lwp_trampoline) - pushl %ebp + movl %ebp,%edi /* for .Lsyscall_checkast */ xorl %ebp,%ebp + pushl %edi pushl %eax call _C_LABEL(lwp_startup) addl $8,%esp pushl %ebx call *%esi addl $4,%esp - DO_DEFERRED_SWITCH - INTRFASTEXIT + jmp .Lsyscall_checkast /* NOTREACHED */ /* @@ -881,6 +877,21 @@ ENTRY(longjmp) ret /* + * void dumpsys(void) + * + * Mimic cpu_switchto() for postmortem debugging. + */ +ENTRY(dumpsys) + pushl %ebx # set up fake switchframe + pushl %esi # and save context + pushl %edi + movl %esp,_C_LABEL(dumppcb)+PCB_ESP + movl %ebp,_C_LABEL(dumppcb)+PCB_EBP + call _C_LABEL(dodumpsys) # dump! + addl $(3*4), %esp # unwind switchframe + ret + +/* * struct lwp *cpu_switchto(struct lwp *oldlwp, struct newlwp, * bool returning) * @@ -1052,14 +1063,7 @@ IDTVEC(syscall) syscall1: pushl $T_ASTFLT # trap # for doing ASTs INTRENTRY - #ifdef DIAGNOSTIC - cmpl $0, CPUVAR(WANT_PMAPLOAD) - jz 1f - pushl $6f - call _C_LABEL(printf) - addl $4, %esp -1: movl CPUVAR(ILEVEL),%ebx testl %ebx,%ebx jz 1f @@ -1071,26 +1075,18 @@ syscall1: #endif 1: #endif /* DIAGNOSTIC */ - movl CPUVAR(CURLWP),%edx - movl %esp,L_MD_REGS(%edx) # save pointer to frame - movl L_PROC(%edx),%edx + incl CPUVAR(NSYSCALL) # count it atomically + movl CPUVAR(CURLWP),%edi + movl L_PROC(%edi),%edx + movl %esp,L_MD_REGS(%edi) # save pointer to frame pushl %esp call *P_MD_SYSCALL(%edx) # get pointer to syscall() function addl $4,%esp .Lsyscall_checkast: /* Check for ASTs on exit to user mode. */ CLI(%eax) - CHECK_ASTPENDING(%eax) - je 1f - /* Always returning to user mode here. */ - CLEAR_ASTPENDING(%eax) - STI(%eax) - /* Pushed T_ASTFLT into tf_trapno on entry. */ - pushl %esp - call _C_LABEL(trap) - addl $4,%esp - jmp .Lsyscall_checkast /* re-check ASTs */ -1: CHECK_DEFERRED_SWITCH + movl L_MD_ASTPENDING(%edi), %eax + orl CPUVAR(WANT_PMAPLOAD), %eax jnz 9f #ifdef XEN STIC(%eax) @@ -1131,11 +1127,22 @@ syscall1: jmp .Lsyscall_checkast 4: .asciz "WARNING: SPL NOT LOWERED ON SYSCALL EXIT\n" 5: .asciz "WARNING: SPL NOT ZERO ON SYSCALL ENTRY\n" -6: .asciz "WARNING: WANT PMAPLOAD ON SYSCALL ENTRY\n" #endif /* DIAGNOSTIC */ -9: STI(%eax) +9: + cmpl $0, CPUVAR(WANT_PMAPLOAD) + jz 10f + STI(%eax) call _C_LABEL(pmap_load) jmp .Lsyscall_checkast /* re-check ASTs */ +10: + /* Always returning to user mode here. */ + movl $0, L_MD_ASTPENDING(%edi) + STI(%eax) + /* Pushed T_ASTFLT into tf_trapno on entry. */ + pushl %esp + call _C_LABEL(trap) + addl $4,%esp + jmp .Lsyscall_checkast /* re-check ASTs */ #if NNPX > 0 /*