version 1.39.2.1, 2006/06/19 03:44:26 |
version 1.44.2.1, 2010/12/10 22:14:57 |
|
|
|
|
#include "npx.h" |
#include "npx.h" |
#include "assym.h" |
#include "assym.h" |
#include "apm.h" |
|
#include "lapic.h" |
#include "lapic.h" |
#include "ioapic.h" |
#include "ioapic.h" |
#include "ksyms.h" |
#include "ksyms.h" |
Line 216 start: movw $0x1234,0x472 # warm boot |
|
Line 215 start: movw $0x1234,0x472 # warm boot |
|
.align 4 |
.align 4 |
.globl Multiboot_Header |
.globl Multiboot_Header |
_C_LABEL(Multiboot_Header): |
_C_LABEL(Multiboot_Header): |
#define MULTIBOOT_HEADER_FLAGS (MULTIBOOT_HEADER_WANT_MEMORY | \ |
#define MULTIBOOT_HEADER_FLAGS (MULTIBOOT_HEADER_WANT_MEMORY) |
MULTIBOOT_HEADER_HAS_ADDR) |
|
.long MULTIBOOT_HEADER_MAGIC |
.long MULTIBOOT_HEADER_MAGIC |
.long MULTIBOOT_HEADER_FLAGS |
.long MULTIBOOT_HEADER_FLAGS |
.long -(MULTIBOOT_HEADER_MAGIC + 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: |
1: |
/* Check if we are being executed by a Multiboot-compliant boot |
/* Check if we are being executed by a Multiboot-compliant boot |
Line 233 _C_LABEL(Multiboot_Header): |
|
Line 226 _C_LABEL(Multiboot_Header): |
|
cmpl $MULTIBOOT_INFO_MAGIC,%eax |
cmpl $MULTIBOOT_INFO_MAGIC,%eax |
jne 1f |
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 |
* the received Multiboot information structure into kernel's data |
* space to process it later -- after we are relocated. It will |
* 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 |
pushl %ebx # Address of Multiboot information |
call _C_LABEL(multiboot_pre_reloc) |
call _C_LABEL(multiboot_pre_reloc) |
addl $4,%esp |
addl $4,%esp |
Line 247 _C_LABEL(Multiboot_Header): |
|
Line 242 _C_LABEL(Multiboot_Header): |
|
/* |
/* |
* At this point, we know that a NetBSD-specific boot loader |
* At this point, we know that a NetBSD-specific boot loader |
* booted this kernel. The stack carries the following parameters: |
* booted this kernel. The stack carries the following parameters: |
* (boothowto, [bootdev], bootinfo, esym, biosbasemem, biosextmem), |
* (boothowto, [bootdev], bootinfo, esym, biosextmem, biosbasemem), |
* 4 bytes each. |
* 4 bytes each. |
*/ |
*/ |
addl $4,%esp # Discard return address to boot loader |
addl $4,%esp # Discard return address to boot loader |
|
|
* we're running at splhigh(), but it's otherwise okay to take |
* we're running at splhigh(), but it's otherwise okay to take |
* interrupts here. |
* interrupts here. |
*/ |
*/ |
sti |
/*sti -- no it isn't! */ |
leal _C_LABEL(sched_qs)(,%ebx,8),%eax # select q |
leal _C_LABEL(sched_qs)(,%ebx,8),%eax # select q |
|
|
movl L_FORW(%eax),%edi # unlink from front of process q |
movl L_FORW(%eax),%edi # unlink from front of process q |
Line 1054 switch_restored: |
|
Line 1049 switch_restored: |
|
SET_CURPCB(%esi) |
SET_CURPCB(%esi) |
|
|
/* Interrupts are okay again. */ |
/* Interrupts are okay again. */ |
sti |
/*sti -- nope, not yet! */ |
|
|
/* |
/* |
* Check for restartable atomic sequences (RAS) |
* Check for restartable atomic sequences (RAS) |
|
|
#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) |
#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) |
call _C_LABEL(sched_unlock_idle) |
call _C_LABEL(sched_unlock_idle) |
#endif |
#endif |
|
sti /* NOW we can do this, after releasing sched_lock */ |
cmpl $0,CPUVAR(IPENDING) |
cmpl $0,CPUVAR(IPENDING) |
jz 3f |
jz 3f |
pushl $IPL_NONE # spl0() |
pushl $IPL_NONE # spl0() |
Line 1134 ENTRY(cpu_switchto) |
|
Line 1130 ENTRY(cpu_switchto) |
|
* We're running at splhigh(), but it's otherwise okay to take |
* We're running at splhigh(), but it's otherwise okay to take |
* interrupts here. |
* interrupts here. |
*/ |
*/ |
sti |
/*sti -- no it isn't! */ |
|
|
/* Jump into the middle of cpu_switch */ |
/* Jump into the middle of cpu_switch */ |
xorl %eax,%eax |
xorl %eax,%eax |