version 1.82, 2008/12/03 11:40:17 |
version 1.82.4.3, 2011/03/28 23:04:40 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 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 Manuel Bouyer. |
|
* 4. The name of the author may not be used to endorse or promote products |
|
* derived from this software without specific prior written permission. |
|
* |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
|
|
|
|
|
|
/*- |
/*- |
* Copyright (c) 1998, 2000, 2004, 2006, 2007 The NetBSD Foundation, Inc. |
* Copyright (c) 1998, 2000, 2004, 2006, 2007, 2009 The NetBSD Foundation, Inc. |
* All rights reserved. |
* All rights reserved. |
* |
* |
* This code is derived from software contributed to The NetBSD Foundation |
* This code is derived from software contributed to The NetBSD Foundation |
* by Charles M. Hannum. |
* by Charles M. Hannum, and by Andrew Doran. |
* |
* |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* modification, are permitted provided that the following conditions |
Line 138 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 133 __KERNEL_RCSID(0, "$NetBSD$"); |
|
|
|
#include "opt_compat_oldboot.h" |
#include "opt_compat_oldboot.h" |
#include "opt_ddb.h" |
#include "opt_ddb.h" |
|
#include "opt_modular.h" |
#include "opt_multiboot.h" |
#include "opt_multiboot.h" |
#include "opt_realmem.h" |
#include "opt_realmem.h" |
#include "opt_vm86.h" |
#include "opt_vm86.h" |
Line 172 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 168 __KERNEL_RCSID(0, "$NetBSD$"); |
|
* Xen guest identifier and loader selection |
* Xen guest identifier and loader selection |
*/ |
*/ |
.section __xen_guest |
.section __xen_guest |
#ifdef XEN3 |
|
.ascii "GUEST_OS=netbsd,GUEST_VER=3.0,XEN_VER=xen-3.0" |
.ascii "GUEST_OS=netbsd,GUEST_VER=3.0,XEN_VER=xen-3.0" |
#if defined(DOM0OPS) || !defined(XEN_COMPAT_030001) |
#if defined(DOM0OPS) || !defined(XEN_COMPAT_030001) |
.ascii ",VIRT_BASE=0xc0000000" /* KERNBASE */ |
.ascii ",VIRT_BASE=0xc0000000" /* KERNBASE */ |
Line 189 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 184 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#ifdef PAE |
#ifdef PAE |
.ascii ",PAE=yes[extended-cr3]" |
.ascii ",PAE=yes[extended-cr3]" |
#endif |
#endif |
#else /* !XEN3 */ |
|
.ascii "GUEST_OS=netbsd,GUEST_VER=2.0,XEN_VER=2.0" |
|
#endif /* XEN3 */ |
|
.ascii ",LOADER=generic" |
.ascii ",LOADER=generic" |
#if (NKSYMS || defined(DDB) || defined(MODULAR)) && !defined(SYMTAB_SPACE) |
#if (NKSYMS || defined(DDB) || defined(MODULAR)) && !defined(SYMTAB_SPACE) |
.ascii ",BSD_SYMTAB=yes" |
.ascii ",BSD_SYMTAB=yes" |
|
|
popfl |
popfl |
|
|
cld |
cld |
#ifdef XEN3 |
|
movl %esp, %ebx # save start of available space |
movl %esp, %ebx # save start of available space |
#else |
|
movl %esi,%ebx # save start_info pointer |
|
#endif |
|
movl $_RELOC(tmpstk),%esp # bootstrap stack end location |
movl $_RELOC(tmpstk),%esp # bootstrap stack end location |
|
|
/* Clear BSS first so that there are no surprises... */ |
/* Clear BSS first so that there are no surprises... */ |
|
|
addl $4,%esp |
addl $4,%esp |
call _C_LABEL(main) |
call _C_LABEL(main) |
|
|
#if defined(XEN3) && !defined(XEN_COMPAT_030001) |
#if defined(XEN) && !defined(XEN_COMPAT_030001) |
/* space for the hypercall call page */ |
/* space for the hypercall call page */ |
#define HYPERCALL_PAGE_OFFSET 0x1000 |
#define HYPERCALL_PAGE_OFFSET 0x1000 |
.org HYPERCALL_PAGE_OFFSET |
.org HYPERCALL_PAGE_OFFSET |
ENTRY(hypercall_page) |
ENTRY(hypercall_page) |
.skip 0x1000 |
.skip 0x1000 |
#endif /* defined(XEN3) && !defined(XEN_COMPAT_030001) */ |
#endif /* defined(XEN) && !defined(XEN_COMPAT_030001) */ |
|
|
/* |
/* |
* void lgdt_finish(void); |
* void lgdt_finish(void); |
Line 991 ENTRY(cpu_switchto) |
|
Line 979 ENTRY(cpu_switchto) |
|
/* Switch I/O bitmap */ |
/* Switch I/O bitmap */ |
movl PCB_IOMAP(%ebx),%eax |
movl PCB_IOMAP(%ebx),%eax |
orl %eax,%eax |
orl %eax,%eax |
jnz,pn .Lcopy_iobitmap |
jnz .Lcopy_iobitmap |
movl $(IOMAP_INVALOFF << 16),CPUVAR(IOBASE) |
movl $(IOMAP_INVALOFF << 16),CPUVAR(IOBASE) |
.Liobitmap_done: |
.Liobitmap_done: |
|
|
Line 1046 ENTRY(cpu_switchto) |
|
Line 1034 ENTRY(cpu_switchto) |
|
|
|
.Lcopy_iobitmap: |
.Lcopy_iobitmap: |
/* Copy I/O bitmap. */ |
/* Copy I/O bitmap. */ |
|
incl _C_LABEL(pmap_iobmp_evcnt)+EV_COUNT |
movl $(IOMAPSIZE/4),%ecx |
movl $(IOMAPSIZE/4),%ecx |
pushl %esi |
pushl %esi |
pushl %edi |
pushl %edi |
|
|
* Old call gate entry for syscall |
* Old call gate entry for syscall |
*/ |
*/ |
IDTVEC(osyscall) |
IDTVEC(osyscall) |
|
#ifndef XEN |
|
/* XXX we are in trouble! interrupts be off here. */ |
|
cli # must be first instruction |
|
#endif |
pushfl # set eflags in trap frame |
pushfl # set eflags in trap frame |
popl 8(%esp) |
popl 8(%esp) |
|
orl $PSL_I,(%esp) # re-enable ints on return to user |
pushl $7 # size of instruction for restart |
pushl $7 # size of instruction for restart |
jmp syscall1 |
jmp syscall1 |
IDTVEC_END(osyscall) |
IDTVEC_END(osyscall) |
Line 1094 IDTVEC(syscall) |
|
Line 1088 IDTVEC(syscall) |
|
syscall1: |
syscall1: |
pushl $T_ASTFLT # trap # for doing ASTs |
pushl $T_ASTFLT # trap # for doing ASTs |
INTRENTRY |
INTRENTRY |
|
STI(%eax) |
#ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
movl CPUVAR(ILEVEL),%ebx |
movl CPUVAR(ILEVEL),%ebx |
testl %ebx,%ebx |
testl %ebx,%ebx |
jz 1f |
jz 1f |
pushl $5f |
pushl $5f |
call _C_LABEL(printf) |
call _C_LABEL(panic) |
addl $4,%esp |
addl $4,%esp |
#ifdef DDB |
#ifdef DDB |
int $3 |
int $3 |
|
|
INTRFASTEXIT |
INTRFASTEXIT |
3: STI(%eax) |
3: STI(%eax) |
pushl $4f |
pushl $4f |
call _C_LABEL(printf) |
call _C_LABEL(panic) |
addl $4,%esp |
addl $4,%esp |
pushl $IPL_NONE |
pushl $IPL_NONE |
call _C_LABEL(spllower) |
call _C_LABEL(spllower) |
addl $4,%esp |
addl $4,%esp |
jmp .Lsyscall_checkast |
jmp .Lsyscall_checkast |
4: .asciz "WARNING: SPL NOT LOWERED ON SYSCALL EXIT\n" |
4: .asciz "SPL NOT LOWERED ON SYSCALL EXIT\n" |
5: .asciz "WARNING: SPL NOT ZERO ON SYSCALL ENTRY\n" |
5: .asciz "SPL NOT ZERO ON SYSCALL ENTRY\n" |
#endif /* DIAGNOSTIC */ |
#endif /* DIAGNOSTIC */ |
9: |
9: |
cmpl $0, CPUVAR(WANT_PMAPLOAD) |
cmpl $0, CPUVAR(WANT_PMAPLOAD) |
Line 1180 IDTVEC(svr4_fasttrap) |
|
Line 1175 IDTVEC(svr4_fasttrap) |
|
pushl $2 # size of instruction for restart |
pushl $2 # size of instruction for restart |
pushl $T_ASTFLT # trap # for doing ASTs |
pushl $T_ASTFLT # trap # for doing ASTs |
INTRENTRY |
INTRENTRY |
|
STI(%eax) |
pushl $RW_READER |
pushl $RW_READER |
pushl $_C_LABEL(svr4_fasttrap_lock) |
pushl $_C_LABEL(svr4_fasttrap_lock) |
call _C_LABEL(rw_enter) |
call _C_LABEL(rw_enter) |