diff options
author | peter <peter@FreeBSD.org> | 2001-01-19 13:19:02 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-01-19 13:19:02 +0000 |
commit | 0d5e4203646605af5d85b82fda8b6bbe855a0754 (patch) | |
tree | fbc91ed02313d3df875f43c3c5c7433b639d294c /sys | |
parent | e40f66ac0254285aa9181a7226cc6749db01c5e6 (diff) | |
download | FreeBSD-src-0d5e4203646605af5d85b82fda8b6bbe855a0754.zip FreeBSD-src-0d5e4203646605af5d85b82fda8b6bbe855a0754.tar.gz |
Use #ifdef DEV_NPX from opt_npx.h instead of #if NNPX > 0 from npx.h
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/cpu_switch.S | 10 | ||||
-rw-r--r-- | sys/amd64/amd64/exception.S | 8 | ||||
-rw-r--r-- | sys/amd64/amd64/exception.s | 8 | ||||
-rw-r--r-- | sys/amd64/amd64/machdep.c | 4 | ||||
-rw-r--r-- | sys/amd64/amd64/support.S | 30 | ||||
-rw-r--r-- | sys/amd64/amd64/support.s | 30 | ||||
-rw-r--r-- | sys/amd64/amd64/swtch.s | 10 | ||||
-rw-r--r-- | sys/amd64/amd64/trap.c | 8 | ||||
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 8 | ||||
-rw-r--r-- | sys/conf/options.i386 | 3 | ||||
-rw-r--r-- | sys/conf/options.pc98 | 3 | ||||
-rw-r--r-- | sys/i386/i386/exception.s | 8 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 4 | ||||
-rw-r--r-- | sys/i386/i386/support.s | 30 | ||||
-rw-r--r-- | sys/i386/i386/swtch.s | 10 | ||||
-rw-r--r-- | sys/i386/i386/trap.c | 8 | ||||
-rw-r--r-- | sys/i386/i386/vm86bios.s | 4 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 8 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 8 | ||||
-rw-r--r-- | sys/pc98/i386/machdep.c | 8 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 8 |
21 files changed, 112 insertions, 106 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index 8d5cade..98bca90 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -36,7 +36,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include "opt_user_ldt.h" #include <sys/rtprio.h> @@ -140,7 +140,7 @@ ENTRY(cpu_switch) /* XXX FIXME: we should be saving the local APIC TPR */ #endif /* SMP */ -#if NNPX > 0 +#ifdef DEV_NPX /* have we used fp, and need a save? */ cmpl %ecx,PCPU(NPXPROC) jne 1f @@ -149,7 +149,7 @@ ENTRY(cpu_switch) call _npxsave /* do it in a big C function */ popl %eax 1: -#endif /* NNPX > 0 */ +#endif /* DEV_NPX */ /* save is done, now choose a new process */ sw1: @@ -358,7 +358,7 @@ ENTRY(savectx) movl %edi,PCB_EDI(%ecx) movl %gs,PCB_GS(%ecx) -#if NNPX > 0 +#ifdef DEV_NPX /* * If npxproc == NULL, then the npx h/w state is irrelevant and the * state had better already be in the pcb. This is true for forks @@ -391,7 +391,7 @@ ENTRY(savectx) pushl %eax call _bcopy addl $12,%esp -#endif /* NNPX > 0 */ +#endif /* DEV_NPX */ 1: ret diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 07f4a29..bc5e2e3 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -33,7 +33,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include <machine/asmacros.h> #include <sys/ipl.h> @@ -151,7 +151,7 @@ IDTVEC(rsvd) pushl $0; TRAP(T_RESERVED) IDTVEC(fpu) -#if NNPX > 0 +#ifdef DEV_NPX /* * Handle like an interrupt (except for accounting) so that we can * call npx_intr to clear the error. It would be better to handle @@ -182,9 +182,9 @@ IDTVEC(fpu) incb PCPU(INTR_NESTING_LEVEL) MEXITCOUNT jmp _doreti -#else /* NNPX > 0 */ +#else /* DEV_NPX */ pushl $0; TRAP(T_ARITHTRAP) -#endif /* NNPX > 0 */ +#endif /* DEV_NPX */ IDTVEC(align) TRAP(T_ALIGNFLT) diff --git a/sys/amd64/amd64/exception.s b/sys/amd64/amd64/exception.s index 07f4a29..bc5e2e3 100644 --- a/sys/amd64/amd64/exception.s +++ b/sys/amd64/amd64/exception.s @@ -33,7 +33,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include <machine/asmacros.h> #include <sys/ipl.h> @@ -151,7 +151,7 @@ IDTVEC(rsvd) pushl $0; TRAP(T_RESERVED) IDTVEC(fpu) -#if NNPX > 0 +#ifdef DEV_NPX /* * Handle like an interrupt (except for accounting) so that we can * call npx_intr to clear the error. It would be better to handle @@ -182,9 +182,9 @@ IDTVEC(fpu) incb PCPU(INTR_NESTING_LEVEL) MEXITCOUNT jmp _doreti -#else /* NNPX > 0 */ +#else /* DEV_NPX */ pushl $0; TRAP(T_ARITHTRAP) -#endif /* NNPX > 0 */ +#endif /* DEV_NPX */ IDTVEC(align) TRAP(T_ALIGNFLT) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 225ec00..466aef5 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -38,7 +38,6 @@ * $FreeBSD$ */ #include "apm.h" -#include "npx.h" #include "opt_atalk.h" #include "opt_compat.h" #include "opt_cpu.h" @@ -47,6 +46,7 @@ #include "opt_ipx.h" #include "opt_maxmem.h" #include "opt_msgbuf.h" +#include "opt_npx.h" #include "opt_perfmon.h" #include "opt_user_ldt.h" #include "opt_userconfig.h" @@ -1097,7 +1097,7 @@ setregs(p, entry, stack, ps_strings) */ load_cr0(rcr0() | CR0_MP | CR0_TS); -#if NNPX > 0 +#ifdef DEV_NPX /* Initialize the npx (if any) for the current process. */ npxinit(__INITIAL_NPXCW__); #endif diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 95154e6..91c7e62 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -33,7 +33,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include <machine/asmacros.h> #include <machine/cputypes.h> @@ -60,7 +60,7 @@ _copyout_vector: .globl _ovbcopy_vector _ovbcopy_vector: .long _generic_bcopy -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) kernel_fpu_lock: .byte 0xfe .space 3 @@ -191,7 +191,7 @@ do0: ret #endif -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_bzero) movl 4(%esp),%edx movl 8(%esp),%ecx @@ -331,7 +331,7 @@ intreg_i586_bzero: stosb popl %edi ret -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ ENTRY(i686_pagezero) pushl %edi @@ -483,7 +483,7 @@ ENTRY(generic_bcopy) cld ret -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_bcopy) pushl %esi pushl %edi @@ -619,7 +619,7 @@ small_i586_bcopy: popl %esi cld ret -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ /* * Note: memcpy does not support overlapping copies @@ -758,7 +758,7 @@ ENTRY(generic_copyout) /* bcopy(%esi, %edi, %ebx) */ movl %ebx,%ecx -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ALIGN_TEXT slow_copyout: #endif @@ -790,7 +790,7 @@ copyout_fault: movl $EFAULT,%eax ret -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_copyout) /* * Duplicated from generic_copyout. Could be done a bit better. @@ -842,7 +842,7 @@ ENTRY(i586_copyout) call _fastmove addl $4,%esp jmp done_copyout -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ /* * copyin(from_user, to_kernel, len) - MP SAFE @@ -869,7 +869,7 @@ ENTRY(generic_copyin) cmpl $VM_MAXUSER_ADDRESS,%edx ja copyin_fault -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ALIGN_TEXT slow_copyin: #endif @@ -883,7 +883,7 @@ slow_copyin: rep movsb -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ALIGN_TEXT done_copyin: #endif @@ -903,7 +903,7 @@ copyin_fault: movl $EFAULT,%eax ret -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_copyin) /* * Duplicated from generic_copyin. Could be done a bit better. @@ -936,9 +936,9 @@ ENTRY(i586_copyin) call _fastmove addl $8,%esp jmp done_copyin -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) /* fastmove(src, dst, len) src in %esi dst in %edi @@ -1124,7 +1124,7 @@ fastmove_tail_fault: movl $0,PCB_ONFAULT(%edx) movl $EFAULT,%eax ret -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ /* * fu{byte,sword,word} - MP SAFE diff --git a/sys/amd64/amd64/support.s b/sys/amd64/amd64/support.s index 95154e6..91c7e62 100644 --- a/sys/amd64/amd64/support.s +++ b/sys/amd64/amd64/support.s @@ -33,7 +33,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include <machine/asmacros.h> #include <machine/cputypes.h> @@ -60,7 +60,7 @@ _copyout_vector: .globl _ovbcopy_vector _ovbcopy_vector: .long _generic_bcopy -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) kernel_fpu_lock: .byte 0xfe .space 3 @@ -191,7 +191,7 @@ do0: ret #endif -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_bzero) movl 4(%esp),%edx movl 8(%esp),%ecx @@ -331,7 +331,7 @@ intreg_i586_bzero: stosb popl %edi ret -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ ENTRY(i686_pagezero) pushl %edi @@ -483,7 +483,7 @@ ENTRY(generic_bcopy) cld ret -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_bcopy) pushl %esi pushl %edi @@ -619,7 +619,7 @@ small_i586_bcopy: popl %esi cld ret -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ /* * Note: memcpy does not support overlapping copies @@ -758,7 +758,7 @@ ENTRY(generic_copyout) /* bcopy(%esi, %edi, %ebx) */ movl %ebx,%ecx -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ALIGN_TEXT slow_copyout: #endif @@ -790,7 +790,7 @@ copyout_fault: movl $EFAULT,%eax ret -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_copyout) /* * Duplicated from generic_copyout. Could be done a bit better. @@ -842,7 +842,7 @@ ENTRY(i586_copyout) call _fastmove addl $4,%esp jmp done_copyout -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ /* * copyin(from_user, to_kernel, len) - MP SAFE @@ -869,7 +869,7 @@ ENTRY(generic_copyin) cmpl $VM_MAXUSER_ADDRESS,%edx ja copyin_fault -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ALIGN_TEXT slow_copyin: #endif @@ -883,7 +883,7 @@ slow_copyin: rep movsb -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ALIGN_TEXT done_copyin: #endif @@ -903,7 +903,7 @@ copyin_fault: movl $EFAULT,%eax ret -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_copyin) /* * Duplicated from generic_copyin. Could be done a bit better. @@ -936,9 +936,9 @@ ENTRY(i586_copyin) call _fastmove addl $8,%esp jmp done_copyin -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) /* fastmove(src, dst, len) src in %esi dst in %edi @@ -1124,7 +1124,7 @@ fastmove_tail_fault: movl $0,PCB_ONFAULT(%edx) movl $EFAULT,%eax ret -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ /* * fu{byte,sword,word} - MP SAFE diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s index 8d5cade..98bca90 100644 --- a/sys/amd64/amd64/swtch.s +++ b/sys/amd64/amd64/swtch.s @@ -36,7 +36,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include "opt_user_ldt.h" #include <sys/rtprio.h> @@ -140,7 +140,7 @@ ENTRY(cpu_switch) /* XXX FIXME: we should be saving the local APIC TPR */ #endif /* SMP */ -#if NNPX > 0 +#ifdef DEV_NPX /* have we used fp, and need a save? */ cmpl %ecx,PCPU(NPXPROC) jne 1f @@ -149,7 +149,7 @@ ENTRY(cpu_switch) call _npxsave /* do it in a big C function */ popl %eax 1: -#endif /* NNPX > 0 */ +#endif /* DEV_NPX */ /* save is done, now choose a new process */ sw1: @@ -358,7 +358,7 @@ ENTRY(savectx) movl %edi,PCB_EDI(%ecx) movl %gs,PCB_GS(%ecx) -#if NNPX > 0 +#ifdef DEV_NPX /* * If npxproc == NULL, then the npx h/w state is irrelevant and the * state had better already be in the pcb. This is true for forks @@ -391,7 +391,7 @@ ENTRY(savectx) pushl %eax call _bcopy addl $12,%esp -#endif /* NNPX > 0 */ +#endif /* DEV_NPX */ 1: ret diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 959c64f..6ee3e6d 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -42,10 +42,11 @@ * 386 Trap and System call handling */ +#include "opt_clock.h" #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_ktrace.h" -#include "opt_clock.h" +#include "opt_npx.h" #include "opt_trap.h" #include <sys/param.h> @@ -98,7 +99,6 @@ #include <ddb/ddb.h> #include "isa.h" -#include "npx.h" #include <sys/sysctl.h> @@ -409,7 +409,7 @@ restart: break; case T_DNA: -#if NNPX > 0 +#ifdef DEV_NPX /* transparent fault (due to context switch "late") */ if (npxdna()) goto out; @@ -443,7 +443,7 @@ restart: goto out; case T_DNA: -#if NNPX > 0 +#ifdef DEV_NPX /* * The kernel is apparently using npx for copying. * XXX this should be fatal unless the kernel has diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 552967c..22625b2 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -41,7 +41,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include "opt_user_ldt.h" #ifdef PC98 #include "opt_pc98.h" @@ -141,7 +141,7 @@ cpu_fork(p1, p2, flags) return; } -#if NNPX > 0 +#ifdef DEV_NPX /* Ensure that p1's pcb is up to date. */ if (PCPU_GET(npxproc) == p1) npxsave(&p1->p_addr->u_pcb.pcb_savefpu); @@ -234,9 +234,9 @@ cpu_exit(p) { struct pcb *pcb = &p->p_addr->u_pcb; -#if NNPX > 0 +#ifdef DEV_NPX npxexit(p); -#endif /* NNPX */ +#endif if (pcb->pcb_ext != 0) { /* * XXX do we need to move the TSS off the allocated pages diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index dbf80db..5b63914 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -193,6 +193,9 @@ OLTR_NO_BULLSEYE_MAC opt_oltr.h # Defaults to NDGB*16. NDGBPORTS opt_dgb.h +# NPX options +DEV_NPX opt_npx.h + # ------------------------------- # EOF # ------------------------------- diff --git a/sys/conf/options.pc98 b/sys/conf/options.pc98 index e4f7438..43d5d82 100644 --- a/sys/conf/options.pc98 +++ b/sys/conf/options.pc98 @@ -196,6 +196,9 @@ EPSON_BOUNCEDMA opt_pc98.h EPSON_MEMWIN opt_pc98.h LINE30 opt_syscons.h +# NPX options +DEV_NPX opt_npx.h + # ------------------------------- # EOF # ------------------------------- diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 07f4a29..bc5e2e3 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -33,7 +33,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include <machine/asmacros.h> #include <sys/ipl.h> @@ -151,7 +151,7 @@ IDTVEC(rsvd) pushl $0; TRAP(T_RESERVED) IDTVEC(fpu) -#if NNPX > 0 +#ifdef DEV_NPX /* * Handle like an interrupt (except for accounting) so that we can * call npx_intr to clear the error. It would be better to handle @@ -182,9 +182,9 @@ IDTVEC(fpu) incb PCPU(INTR_NESTING_LEVEL) MEXITCOUNT jmp _doreti -#else /* NNPX > 0 */ +#else /* DEV_NPX */ pushl $0; TRAP(T_ARITHTRAP) -#endif /* NNPX > 0 */ +#endif /* DEV_NPX */ IDTVEC(align) TRAP(T_ALIGNFLT) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 225ec00..466aef5 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -38,7 +38,6 @@ * $FreeBSD$ */ #include "apm.h" -#include "npx.h" #include "opt_atalk.h" #include "opt_compat.h" #include "opt_cpu.h" @@ -47,6 +46,7 @@ #include "opt_ipx.h" #include "opt_maxmem.h" #include "opt_msgbuf.h" +#include "opt_npx.h" #include "opt_perfmon.h" #include "opt_user_ldt.h" #include "opt_userconfig.h" @@ -1097,7 +1097,7 @@ setregs(p, entry, stack, ps_strings) */ load_cr0(rcr0() | CR0_MP | CR0_TS); -#if NNPX > 0 +#ifdef DEV_NPX /* Initialize the npx (if any) for the current process. */ npxinit(__INITIAL_NPXCW__); #endif diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s index 95154e6..91c7e62 100644 --- a/sys/i386/i386/support.s +++ b/sys/i386/i386/support.s @@ -33,7 +33,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include <machine/asmacros.h> #include <machine/cputypes.h> @@ -60,7 +60,7 @@ _copyout_vector: .globl _ovbcopy_vector _ovbcopy_vector: .long _generic_bcopy -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) kernel_fpu_lock: .byte 0xfe .space 3 @@ -191,7 +191,7 @@ do0: ret #endif -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_bzero) movl 4(%esp),%edx movl 8(%esp),%ecx @@ -331,7 +331,7 @@ intreg_i586_bzero: stosb popl %edi ret -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ ENTRY(i686_pagezero) pushl %edi @@ -483,7 +483,7 @@ ENTRY(generic_bcopy) cld ret -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_bcopy) pushl %esi pushl %edi @@ -619,7 +619,7 @@ small_i586_bcopy: popl %esi cld ret -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ /* * Note: memcpy does not support overlapping copies @@ -758,7 +758,7 @@ ENTRY(generic_copyout) /* bcopy(%esi, %edi, %ebx) */ movl %ebx,%ecx -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ALIGN_TEXT slow_copyout: #endif @@ -790,7 +790,7 @@ copyout_fault: movl $EFAULT,%eax ret -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_copyout) /* * Duplicated from generic_copyout. Could be done a bit better. @@ -842,7 +842,7 @@ ENTRY(i586_copyout) call _fastmove addl $4,%esp jmp done_copyout -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ /* * copyin(from_user, to_kernel, len) - MP SAFE @@ -869,7 +869,7 @@ ENTRY(generic_copyin) cmpl $VM_MAXUSER_ADDRESS,%edx ja copyin_fault -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ALIGN_TEXT slow_copyin: #endif @@ -883,7 +883,7 @@ slow_copyin: rep movsb -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ALIGN_TEXT done_copyin: #endif @@ -903,7 +903,7 @@ copyin_fault: movl $EFAULT,%eax ret -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_copyin) /* * Duplicated from generic_copyin. Could be done a bit better. @@ -936,9 +936,9 @@ ENTRY(i586_copyin) call _fastmove addl $8,%esp jmp done_copyin -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ -#if defined(I586_CPU) && NNPX > 0 +#if defined(I586_CPU) && defined(DEV_NPX) /* fastmove(src, dst, len) src in %esi dst in %edi @@ -1124,7 +1124,7 @@ fastmove_tail_fault: movl $0,PCB_ONFAULT(%edx) movl $EFAULT,%eax ret -#endif /* I586_CPU && NNPX > 0 */ +#endif /* I586_CPU && defined(DEV_NPX) */ /* * fu{byte,sword,word} - MP SAFE diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s index 8d5cade..98bca90 100644 --- a/sys/i386/i386/swtch.s +++ b/sys/i386/i386/swtch.s @@ -36,7 +36,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include "opt_user_ldt.h" #include <sys/rtprio.h> @@ -140,7 +140,7 @@ ENTRY(cpu_switch) /* XXX FIXME: we should be saving the local APIC TPR */ #endif /* SMP */ -#if NNPX > 0 +#ifdef DEV_NPX /* have we used fp, and need a save? */ cmpl %ecx,PCPU(NPXPROC) jne 1f @@ -149,7 +149,7 @@ ENTRY(cpu_switch) call _npxsave /* do it in a big C function */ popl %eax 1: -#endif /* NNPX > 0 */ +#endif /* DEV_NPX */ /* save is done, now choose a new process */ sw1: @@ -358,7 +358,7 @@ ENTRY(savectx) movl %edi,PCB_EDI(%ecx) movl %gs,PCB_GS(%ecx) -#if NNPX > 0 +#ifdef DEV_NPX /* * If npxproc == NULL, then the npx h/w state is irrelevant and the * state had better already be in the pcb. This is true for forks @@ -391,7 +391,7 @@ ENTRY(savectx) pushl %eax call _bcopy addl $12,%esp -#endif /* NNPX > 0 */ +#endif /* DEV_NPX */ 1: ret diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 959c64f..6ee3e6d 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -42,10 +42,11 @@ * 386 Trap and System call handling */ +#include "opt_clock.h" #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_ktrace.h" -#include "opt_clock.h" +#include "opt_npx.h" #include "opt_trap.h" #include <sys/param.h> @@ -98,7 +99,6 @@ #include <ddb/ddb.h> #include "isa.h" -#include "npx.h" #include <sys/sysctl.h> @@ -409,7 +409,7 @@ restart: break; case T_DNA: -#if NNPX > 0 +#ifdef DEV_NPX /* transparent fault (due to context switch "late") */ if (npxdna()) goto out; @@ -443,7 +443,7 @@ restart: goto out; case T_DNA: -#if NNPX > 0 +#ifdef DEV_NPX /* * The kernel is apparently using npx for copying. * XXX this should be fatal unless the kernel has diff --git a/sys/i386/i386/vm86bios.s b/sys/i386/i386/vm86bios.s index 9bc322a..a71dd11 100644 --- a/sys/i386/i386/vm86bios.s +++ b/sys/i386/i386/vm86bios.s @@ -26,7 +26,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include <machine/asmacros.h> /* miscellaneous asm macros */ #include <machine/trap.h> @@ -64,7 +64,7 @@ ENTRY(vm86_bioscall) pushl %edi pushl %gs -#if NNPX > 0 +#ifdef DEV_NPX movl PCPU(CURPROC),%ecx cmpl %ecx,PCPU(NPXPROC) /* do we need to save fp? */ jne 1f diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 552967c..22625b2 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -41,7 +41,7 @@ * $FreeBSD$ */ -#include "npx.h" +#include "opt_npx.h" #include "opt_user_ldt.h" #ifdef PC98 #include "opt_pc98.h" @@ -141,7 +141,7 @@ cpu_fork(p1, p2, flags) return; } -#if NNPX > 0 +#ifdef DEV_NPX /* Ensure that p1's pcb is up to date. */ if (PCPU_GET(npxproc) == p1) npxsave(&p1->p_addr->u_pcb.pcb_savefpu); @@ -234,9 +234,9 @@ cpu_exit(p) { struct pcb *pcb = &p->p_addr->u_pcb; -#if NNPX > 0 +#ifdef DEV_NPX npxexit(p); -#endif /* NNPX */ +#endif if (pcb->pcb_ext != 0) { /* * XXX do we need to move the TSS off the allocated pages diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 959c64f..6ee3e6d 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -42,10 +42,11 @@ * 386 Trap and System call handling */ +#include "opt_clock.h" #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_ktrace.h" -#include "opt_clock.h" +#include "opt_npx.h" #include "opt_trap.h" #include <sys/param.h> @@ -98,7 +99,6 @@ #include <ddb/ddb.h> #include "isa.h" -#include "npx.h" #include <sys/sysctl.h> @@ -409,7 +409,7 @@ restart: break; case T_DNA: -#if NNPX > 0 +#ifdef DEV_NPX /* transparent fault (due to context switch "late") */ if (npxdna()) goto out; @@ -443,7 +443,7 @@ restart: goto out; case T_DNA: -#if NNPX > 0 +#ifdef DEV_NPX /* * The kernel is apparently using npx for copying. * XXX this should be fatal unless the kernel has diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index efe0efd..ce1260e 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -39,7 +39,6 @@ */ #include "apm.h" -#include "npx.h" #include "opt_atalk.h" #include "opt_compat.h" #include "opt_cpu.h" @@ -48,6 +47,7 @@ #include "opt_ipx.h" #include "opt_maxmem.h" #include "opt_msgbuf.h" +#include "opt_npx.h" #include "opt_perfmon.h" #include "opt_user_ldt.h" #include "opt_userconfig.h" @@ -1111,7 +1111,7 @@ setregs(p, entry, stack, ps_strings) */ load_cr0(rcr0() | CR0_MP | CR0_TS); -#if NNPX > 0 +#ifdef DEV_NPX /* Initialize the npx (if any) for the current process. */ npxinit(__INITIAL_NPXCW__); #endif @@ -1455,7 +1455,7 @@ getmemsize(int first) int pa_indx; int pg_n; int speculative_mprobe; -#if NNPX > 0 +#ifdef DEV_NPX int msize; #endif unsigned under16; @@ -1497,7 +1497,7 @@ getmemsize(int first) speculative_mprobe = FALSE; #endif -#if NNPX > 0 +#ifdef DEV_NPX if (resource_int_value("npx", 0, "msize", &msize) == 0) { if (msize != 0) { Maxmem = msize / 4; diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index efe0efd..ce1260e 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -39,7 +39,6 @@ */ #include "apm.h" -#include "npx.h" #include "opt_atalk.h" #include "opt_compat.h" #include "opt_cpu.h" @@ -48,6 +47,7 @@ #include "opt_ipx.h" #include "opt_maxmem.h" #include "opt_msgbuf.h" +#include "opt_npx.h" #include "opt_perfmon.h" #include "opt_user_ldt.h" #include "opt_userconfig.h" @@ -1111,7 +1111,7 @@ setregs(p, entry, stack, ps_strings) */ load_cr0(rcr0() | CR0_MP | CR0_TS); -#if NNPX > 0 +#ifdef DEV_NPX /* Initialize the npx (if any) for the current process. */ npxinit(__INITIAL_NPXCW__); #endif @@ -1455,7 +1455,7 @@ getmemsize(int first) int pa_indx; int pg_n; int speculative_mprobe; -#if NNPX > 0 +#ifdef DEV_NPX int msize; #endif unsigned under16; @@ -1497,7 +1497,7 @@ getmemsize(int first) speculative_mprobe = FALSE; #endif -#if NNPX > 0 +#ifdef DEV_NPX if (resource_int_value("npx", 0, "msize", &msize) == 0) { if (msize != 0) { Maxmem = msize / 4; |