summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-01-19 13:19:02 +0000
committerpeter <peter@FreeBSD.org>2001-01-19 13:19:02 +0000
commit0d5e4203646605af5d85b82fda8b6bbe855a0754 (patch)
treefbc91ed02313d3df875f43c3c5c7433b639d294c /sys/amd64
parente40f66ac0254285aa9181a7226cc6749db01c5e6 (diff)
downloadFreeBSD-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/amd64')
-rw-r--r--sys/amd64/amd64/cpu_switch.S10
-rw-r--r--sys/amd64/amd64/exception.S8
-rw-r--r--sys/amd64/amd64/exception.s8
-rw-r--r--sys/amd64/amd64/machdep.c4
-rw-r--r--sys/amd64/amd64/support.S30
-rw-r--r--sys/amd64/amd64/support.s30
-rw-r--r--sys/amd64/amd64/swtch.s10
-rw-r--r--sys/amd64/amd64/trap.c8
-rw-r--r--sys/amd64/amd64/vm_machdep.c8
9 files changed, 58 insertions, 58 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
OpenPOWER on IntegriCloud