version 1.78.2.3, 2009/04/28 07:34:08 |
version 1.79, 2008/11/11 14:40:18 |
|
|
|
|
|
|
/*- |
/*- |
* Copyright (c) 1998, 2000, 2004, 2006, 2007, 2009 The NetBSD Foundation, Inc. |
* Copyright (c) 1998, 2000, 2004, 2006, 2007 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, and by Andrew Doran. |
* by Charles M. Hannum. |
* |
* |
* 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 138 __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 194 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 193 __KERNEL_RCSID(0, "$NetBSD$"); |
|
.ascii "GUEST_OS=netbsd,GUEST_VER=2.0,XEN_VER=2.0" |
.ascii "GUEST_OS=netbsd,GUEST_VER=2.0,XEN_VER=2.0" |
#endif /* XEN3 */ |
#endif /* XEN3 */ |
.ascii ",LOADER=generic" |
.ascii ",LOADER=generic" |
#if (NKSYMS || defined(DDB) || defined(MODULAR)) && !defined(SYMTAB_SPACE) |
#if (NKSYMS || defined(DDB) || defined(LKM)) && !defined(SYMTAB_SPACE) |
.ascii ",BSD_SYMTAB=yes" |
.ascii ",BSD_SYMTAB=yes" |
#endif |
#endif |
.byte 0 |
.byte 0 |
Line 518 try586: /* Use the `cpuid' instruction. |
|
Line 517 try586: /* Use the `cpuid' instruction. |
|
/* Find end of kernel image. */ |
/* Find end of kernel image. */ |
movl $RELOC(end),%edi |
movl $RELOC(end),%edi |
|
|
#if (NKSYMS || defined(DDB) || defined(MODULAR)) && !defined(SYMTAB_SPACE) |
#if (NKSYMS || defined(DDB) || defined(LKM)) && !defined(SYMTAB_SPACE) |
/* Save the symbols (if loaded). */ |
/* Save the symbols (if loaded). */ |
movl RELOC(esym),%eax |
movl RELOC(esym),%eax |
testl %eax,%eax |
testl %eax,%eax |
Line 1047 ENTRY(cpu_switchto) |
|
Line 1046 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) |
cli # must be first instruction |
|
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 1098 IDTVEC(syscall) |
|
Line 1094 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(panic) |
call _C_LABEL(printf) |
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(panic) |
call _C_LABEL(printf) |
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 "SPL NOT LOWERED ON SYSCALL EXIT\n" |
4: .asciz "WARNING: SPL NOT LOWERED ON SYSCALL EXIT\n" |
5: .asciz "SPL NOT ZERO ON SYSCALL ENTRY\n" |
5: .asciz "WARNING: SPL NOT ZERO ON SYSCALL ENTRY\n" |
#endif /* DIAGNOSTIC */ |
#endif /* DIAGNOSTIC */ |
9: |
9: |
cmpl $0, CPUVAR(WANT_PMAPLOAD) |
cmpl $0, CPUVAR(WANT_PMAPLOAD) |
|
|
jmp .Lsyscall_checkast /* re-check ASTs */ |
jmp .Lsyscall_checkast /* re-check ASTs */ |
IDTVEC_END(syscall) |
IDTVEC_END(syscall) |
|
|
IDTVEC(svr4_fasttrap) |
|
pushl $2 # size of instruction for restart |
|
pushl $T_ASTFLT # trap # for doing ASTs |
|
INTRENTRY |
|
STI(%eax) |
|
pushl $RW_READER |
|
pushl $_C_LABEL(svr4_fasttrap_lock) |
|
call _C_LABEL(rw_enter) |
|
addl $8,%esp |
|
call *_C_LABEL(svr4_fasttrap_vec) |
|
pushl $_C_LABEL(svr4_fasttrap_lock) |
|
call _C_LABEL(rw_exit) |
|
addl $4,%esp |
|
2: /* Check for ASTs on exit to user mode. */ |
|
cli |
|
CHECK_ASTPENDING(%eax) |
|
je 1f |
|
/* Always returning to user mode here. */ |
|
CLEAR_ASTPENDING(%eax) |
|
sti |
|
/* Pushed T_ASTFLT into tf_trapno on entry. */ |
|
pushl %esp |
|
call _C_LABEL(trap) |
|
addl $4,%esp |
|
jmp 2b |
|
1: CHECK_DEFERRED_SWITCH |
|
jnz 9f |
|
INTRFASTEXIT |
|
9: sti |
|
call _C_LABEL(pmap_load) |
|
cli |
|
jmp 2b |
|
|
|
#if NNPX > 0 |
#if NNPX > 0 |
/* |
/* |
* Special interrupt handlers. Someday intr0-intr15 will be used to count |
* Special interrupt handlers. Someday intr0-intr15 will be used to count |
Line 1278 ENTRY(sse2_idlezero_page) |
|
Line 1240 ENTRY(sse2_idlezero_page) |
|
xorl %eax, %eax |
xorl %eax, %eax |
.align 16 |
.align 16 |
1: |
1: |
testl $RESCHED_KPREEMPT, CPUVAR(RESCHED) |
cmpl $0, CPUVAR(RESCHED) |
jnz 2f |
jnz 2f |
movnti %eax, 0(%edx) |
movnti %eax, 0(%edx) |
movnti %eax, 4(%edx) |
movnti %eax, 4(%edx) |