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.42 retrieving revision 1.43.4.10 diff -u -p -r1.42 -r1.43.4.10 --- src/sys/arch/i386/i386/locore.S 2006/07/08 20:30:00 1.42 +++ src/sys/arch/i386/i386/locore.S 2007/02/01 04:17:13 1.43.4.10 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.42 2006/07/08 20:30:00 christos Exp $ */ +/* $NetBSD: locore.S,v 1.43.4.10 2007/02/01 04:17:13 ad Exp $ */ /*- * Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc. @@ -215,16 +215,10 @@ start: movw $0x1234,0x472 # warm boot .align 4 .globl Multiboot_Header _C_LABEL(Multiboot_Header): -#define MULTIBOOT_HEADER_FLAGS (MULTIBOOT_HEADER_WANT_MEMORY | \ - MULTIBOOT_HEADER_HAS_ADDR) +#define MULTIBOOT_HEADER_FLAGS (MULTIBOOT_HEADER_WANT_MEMORY) .long MULTIBOOT_HEADER_MAGIC .long MULTIBOOT_HEADER_FLAGS .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) - .long RELOC(Multiboot_Header) - .long RELOC(start) - .long RELOC(_edata) - .long RELOC(_end) + MULTIBOOT_SYMTAB_SPACE - .long RELOC(start) 1: /* Check if we are being executed by a Multiboot-compliant boot @@ -232,10 +226,12 @@ _C_LABEL(Multiboot_Header): cmpl $MULTIBOOT_INFO_MAGIC,%eax jne 1f - /* Indeed, a multiboot-compliat boot loader executed us. We copy + /* + * Indeed, a multiboot-compliant boot loader executed us. We copy * the received Multiboot information structure into kernel's data * space to process it later -- after we are relocated. It will - * be safer to run complex C code than doing it at this point. */ + * be safer to run complex C code than doing it at this point. + */ pushl %ebx # Address of Multiboot information call _C_LABEL(multiboot_pre_reloc) addl $4,%esp @@ -724,6 +720,13 @@ NENTRY(lgdt) pushl %eax lret +NENTRY(x86_flush) + /* Reload code selector by doing intersegment return. */ + popl %eax + pushl $GSEL(GCODE_SEL, SEL_KPL) + pushl %eax + lret + /*****************************************************************************/ /* @@ -883,12 +886,10 @@ ENTRY(cpu_switch) xorl %esi,%esi sti idle_unlock: -#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) call _C_LABEL(sched_unlock_idle) -#endif /* Interrupts are okay again. */ pushl $IPL_NONE # spl0() - call _C_LABEL(Xspllower) # process pending interrupts + call _C_LABEL(spllower) # process pending interrupts addl $4,%esp jmp idle_start idle_zero: @@ -912,9 +913,7 @@ idle_start: idle_exit: movl $IPL_HIGH,CPUVAR(ILEVEL) # splhigh sti -#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) call _C_LABEL(sched_lock_idle) -#endif movl _C_LABEL(sched_whichqs),%ecx bsfl %ecx,%ebx jz idle_unlock @@ -1066,13 +1065,11 @@ switch_restored: movl $1,%ebx switch_return: -#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) call _C_LABEL(sched_unlock_idle) -#endif cmpl $0,CPUVAR(IPENDING) jz 3f pushl $IPL_NONE # spl0() - call _C_LABEL(Xspllower) # process pending interrupts + call _C_LABEL(spllower) # process pending interrupts addl $4,%esp 3: movl $IPL_HIGH,CPUVAR(ILEVEL) # splhigh() @@ -1159,8 +1156,6 @@ ENTRY(cpu_exit) movl CPUVAR(IDLE_PCB),%esi movl CPUVAR(IDLE_TSS_SEL),%edx #endif - /* In case we fault... */ - movl $0,CPUVAR(CURLWP) /* Restore the idle context. */ cli @@ -1191,19 +1186,14 @@ ENTRY(cpu_exit) /* Record new pcb. */ SET_CURPCB(%esi) + /* Now off the CPU. */ + movl $0,CPUVAR(CURLWP) + /* Interrupts are okay again. */ sti - /* - * Schedule the dead LWP's stack to be freed. - */ - pushl %edi - call _C_LABEL(lwp_exit2) - addl $4,%esp - /* Jump into cpu_switch() with the right state. */ xorl %esi,%esi - movl %esi,CPUVAR(CURLWP) jmp idle_start /*