version 1.37.4.2, 2006/08/11 15:41:54 |
version 1.38, 2006/04/12 13:48:52 |
|
|
|
|
#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" |
|
|
.globl _C_LABEL(cpu) |
.globl _C_LABEL(cpu) |
.globl _C_LABEL(esym) |
.globl _C_LABEL(esym) |
.globl _C_LABEL(atdevbase) |
.globl _C_LABEL(atdevbase) |
.globl _C_LABEL(proc0uarea),_C_LABEL(PDPpaddr) |
.globl _C_LABEL(proc0paddr),_C_LABEL(PDPpaddr) |
.globl _C_LABEL(gdt) |
.globl _C_LABEL(gdt) |
#ifdef I586_CPU |
#ifdef I586_CPU |
.globl _C_LABEL(idt) |
.globl _C_LABEL(idt) |
Line 192 _C_LABEL(lapic_tpr): |
|
Line 193 _C_LABEL(lapic_tpr): |
|
_C_LABEL(cpu): .long 0 # are we 386, 386sx, or 486, |
_C_LABEL(cpu): .long 0 # are we 386, 386sx, or 486, |
# or Pentium, or.. |
# or Pentium, or.. |
_C_LABEL(atdevbase): .long 0 # location of start of iomem in virtual |
_C_LABEL(atdevbase): .long 0 # location of start of iomem in virtual |
_C_LABEL(proc0uarea): .long 0 |
_C_LABEL(proc0paddr): .long 0 |
_C_LABEL(PDPpaddr): .long 0 # paddr of PDP, for libkvm |
_C_LABEL(PDPpaddr): .long 0 # paddr of PDP, for libkvm |
|
|
.space 512 |
.space 512 |
Line 232 _C_LABEL(Multiboot_Header): |
|
Line 233 _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 248 _C_LABEL(Multiboot_Header): |
|
Line 247 _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, biosextmem, biosbasemem), |
* (boothowto, [bootdev], bootinfo, esym, biosbasemem, biosextmem), |
* 4 bytes each. |
* 4 bytes each. |
*/ |
*/ |
addl $4,%esp # Discard return address to boot loader |
addl $4,%esp # Discard return address to boot loader |
|
|
|
|
/* Set up bootstrap stack. */ |
/* Set up bootstrap stack. */ |
leal (PROC0STACK+KERNBASE)(%esi),%eax |
leal (PROC0STACK+KERNBASE)(%esi),%eax |
movl %eax,_C_LABEL(proc0uarea) |
movl %eax,_C_LABEL(proc0paddr) |
leal (KSTACK_SIZE-FRAMESIZE)(%eax),%esp |
leal (USPACE-FRAMESIZE)(%eax),%esp |
movl %esi,(KSTACK_SIZE+PCB_CR3)(%eax) # pcb->pcb_cr3 |
movl %esi,PCB_CR3(%eax) # pcb->pcb_cr3 |
xorl %ebp,%ebp # mark end of frames |
xorl %ebp,%ebp # mark end of frames |
|
|
#if defined(MULTIBOOT) |
#if defined(MULTIBOOT) |
Line 774 NENTRY(switch_error) |
|
Line 773 NENTRY(switch_error) |
|
|
|
/* |
/* |
* void cpu_switch(struct lwp *) |
* void cpu_switch(struct lwp *) |
* Find a runnable lwp and switch to it. Wait if necessary. If the new |
* Find a runnable process and switch to it. Wait if necessary. If the new |
* lwp is the same as the old one, we short-circuit the context save and |
* process is the same as the old one, we short-circuit the context save and |
* restore. |
* restore. |
* |
* |
* Note that the stack frame layout is known to "struct switchframe" |
* Note that the stack frame layout is known to "struct switchframe" |