Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Change i386 to use x86/fpu.c instead of i386/isa/npx.c
details: https://anonhg.NetBSD.org/src/rev/8ae3a0237d1a
branches: trunk
changeset: 326685:8ae3a0237d1a
user: dsl <dsl%NetBSD.org@localhost>
date: Wed Feb 12 23:24:09 2014 +0000
description:
Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).
diffstat:
distrib/sets/lists/comp/md.i386 | 4 +-
sys/arch/amd64/amd64/cpufunc.S | 8 +-
sys/arch/i386/conf/files.i386 | 4 +-
sys/arch/i386/i386/autoconf.c | 6 +-
sys/arch/i386/i386/cpufunc.S | 22 +-
sys/arch/i386/i386/freebsd_machdep.c | 6 +-
sys/arch/i386/i386/i386_trap.S | 28 +-
sys/arch/i386/i386/ibcs2_machdep.c | 6 +-
sys/arch/i386/i386/trap.c | 60 +--
sys/arch/i386/include/Makefile | 3 +-
sys/arch/i386/include/freebsd_machdep.h | 3 +-
sys/arch/i386/include/npx.h | 17 -
sys/arch/i386/include/pcb.h | 4 +-
sys/arch/i386/isa/npx.c | 665 ------------------------------
sys/arch/x86/include/cpu.h | 16 +-
sys/arch/x86/include/cpu_extended_state.h | 8 +-
sys/arch/x86/include/cpufunc.h | 7 +-
sys/arch/x86/include/fpu.h | 22 +-
sys/arch/x86/x86/convert_xmm_s87.c | 6 +-
sys/arch/x86/x86/fpu.c | 104 +++-
sys/arch/x86/x86/procfs_machdep.c | 14 +-
sys/arch/xen/conf/files.xen | 7 +-
sys/arch/xen/x86/cpu.c | 8 +-
sys/arch/xen/x86/xen_ipi.c | 10 +-
24 files changed, 181 insertions(+), 857 deletions(-)
diffs (truncated from 1622 to 300 lines):
diff -r 178854fe416f -r 8ae3a0237d1a distrib/sets/lists/comp/md.i386
--- a/distrib/sets/lists/comp/md.i386 Wed Feb 12 23:04:43 2014 +0000
+++ b/distrib/sets/lists/comp/md.i386 Wed Feb 12 23:24:09 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.144 2014/02/11 22:48:25 dsl Exp $
+# $NetBSD: md.i386,v 1.145 2014/02/12 23:24:09 dsl Exp $
./usr/include/clang-3.0/avx2intrin.h comp-obsolete obsolete
./usr/include/clang-3.0/avxintrin.h comp-obsolete obsolete
./usr/include/clang-3.0/bmi2intrin.h comp-obsolete obsolete
@@ -259,7 +259,7 @@
./usr/include/i386/mtrr.h comp-c-include
./usr/include/i386/multiboot.h comp-c-include
./usr/include/i386/mutex.h comp-c-include
-./usr/include/i386/npx.h comp-c-include
+./usr/include/i386/npx.h comp-c-include obsolete
./usr/include/i386/param.h comp-c-include
./usr/include/i386/pcb.h comp-c-include
./usr/include/i386/pccons.h comp-obsolete obsolete
diff -r 178854fe416f -r 8ae3a0237d1a sys/arch/amd64/amd64/cpufunc.S
--- a/sys/arch/amd64/amd64/cpufunc.S Wed Feb 12 23:04:43 2014 +0000
+++ b/sys/arch/amd64/amd64/cpufunc.S Wed Feb 12 23:24:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufunc.S,v 1.24 2014/02/09 19:42:04 dsl Exp $ */
+/* $NetBSD: cpufunc.S,v 1.25 2014/02/12 23:24:09 dsl Exp $ */
/*-
* Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -441,6 +441,10 @@
fnstcw (%rdi)
ret
+ENTRY(fngetsw)
+ fnstsw %ax
+ ret
+
ENTRY(fnstsw)
fnstsw (%rdi)
ret
@@ -480,7 +484,7 @@
ENTRY(fldummy)
ffree %st(7)
- flds (%rdi)
+ fldz
ret
ENTRY(xsave)
diff -r 178854fe416f -r 8ae3a0237d1a sys/arch/i386/conf/files.i386
--- a/sys/arch/i386/conf/files.i386 Wed Feb 12 23:04:43 2014 +0000
+++ b/sys/arch/i386/conf/files.i386 Wed Feb 12 23:24:09 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.i386,v 1.373 2014/02/07 22:40:22 dsl Exp $
+# $NetBSD: files.i386,v 1.374 2014/02/12 23:24:09 dsl Exp $
#
# new style config file for i386 architecture
#
@@ -82,7 +82,7 @@
file arch/x86/x86/convert_xmm_s87.c
file arch/i386/i386/trap.c
file dev/cons.c
-file arch/i386/isa/npx.c
+file arch/x86/x86/fpu.c
file arch/i386/i386/mptramp.S multiprocessor
diff -r 178854fe416f -r 8ae3a0237d1a sys/arch/i386/i386/autoconf.c
--- a/sys/arch/i386/i386/autoconf.c Wed Feb 12 23:04:43 2014 +0000
+++ b/sys/arch/i386/i386/autoconf.c Wed Feb 12 23:24:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.99 2014/01/26 19:16:17 dsl Exp $ */
+/* $NetBSD: autoconf.c,v 1.100 2014/02/12 23:24:09 dsl Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.99 2014/01/26 19:16:17 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.100 2014/02/12 23:24:09 dsl Exp $");
#include "opt_compat_oldboot.h"
#include "opt_intrdebug.h"
@@ -64,7 +64,7 @@
#include <machine/intr.h>
#include <machine/pcb.h>
#include <machine/cpufunc.h>
-#include <machine/npx.h>
+#include <x86/fpu.h>
#include "ioapic.h"
#include "lapic.h"
diff -r 178854fe416f -r 8ae3a0237d1a sys/arch/i386/i386/cpufunc.S
--- a/sys/arch/i386/i386/cpufunc.S Wed Feb 12 23:04:43 2014 +0000
+++ b/sys/arch/i386/i386/cpufunc.S Wed Feb 12 23:24:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufunc.S,v 1.17 2011/09/24 21:24:52 jym Exp $ */
+/* $NetBSD: cpufunc.S,v 1.18 2014/02/12 23:24:09 dsl Exp $ */
/*-
* Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/errno.h>
#include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.17 2011/09/24 21:24:52 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.18 2014/02/12 23:24:09 dsl Exp $");
#include "opt_xen.h"
@@ -332,6 +332,11 @@
ret
END(fnstcw)
+ENTRY(fngetsw)
+ fnstsw %ax
+ ret
+END(fngetsw)
+
ENTRY(fnstsw)
movl 4(%esp), %eax
fnstsw (%eax)
@@ -384,10 +389,19 @@
ret
END(fxrstor)
-ENTRY(fldummy)
+ENTRY(x86_stmxcsr)
+ movl 4(%esp), %eax
+ stmxcsr (%eax)
+ ret
+
+ENTRY(x86_ldmxcsr)
movl 4(%esp), %eax
+ ldmxcsr (%eax)
+ ret
+
+ENTRY(fldummy)
ffree %st(7)
- flds (%eax)
+ fldz
ret
END(fldummy)
diff -r 178854fe416f -r 8ae3a0237d1a sys/arch/i386/i386/freebsd_machdep.c
--- a/sys/arch/i386/i386/freebsd_machdep.c Wed Feb 12 23:04:43 2014 +0000
+++ b/sys/arch/i386/i386/freebsd_machdep.c Wed Feb 12 23:24:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: freebsd_machdep.c,v 1.58 2014/01/19 14:30:37 dsl Exp $ */
+/* $NetBSD: freebsd_machdep.c,v 1.59 2014/02/12 23:24:09 dsl Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: freebsd_machdep.c,v 1.58 2014/01/19 14:30:37 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_machdep.c,v 1.59 2014/02/12 23:24:09 dsl Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@@ -46,7 +46,7 @@
#include <compat/sys/signal.h>
#include <machine/cpufunc.h>
-#include <machine/npx.h>
+#include <x86/fpu.h>
#include <machine/reg.h>
#include <machine/vm86.h>
#include <machine/vmparam.h>
diff -r 178854fe416f -r 8ae3a0237d1a sys/arch/i386/i386/i386_trap.S
--- a/sys/arch/i386/i386/i386_trap.S Wed Feb 12 23:04:43 2014 +0000
+++ b/sys/arch/i386/i386/i386_trap.S Wed Feb 12 23:24:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i386_trap.S,v 1.4 2014/02/04 21:09:23 dsl Exp $ */
+/* $NetBSD: i386_trap.S,v 1.5 2014/02/12 23:24:09 dsl Exp $ */
/*
* Copyright 2002 (c) Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
#if 0
#include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.4 2014/02/04 21:09:23 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.5 2014/02/12 23:24:09 dsl Exp $");
#endif
/*
@@ -162,7 +162,7 @@
#ifdef DIAGNOSTIC
movl CPUVAR(ILEVEL),%ebx
#endif
- pushl CPUVAR(SELF)
+ pushl %esp
call _C_LABEL(fpudna)
addl $4,%esp
jmp _C_LABEL(trapreturn)
@@ -231,30 +231,30 @@
* this is difficult for nested interrupts.
*/
pushl $0 # dummy error code
- pushl $T_ASTFLT
+ pushl $T_ARITHTRAP
+.Ldo_fputrap:
INTRENTRY
movl CPUVAR(ILEVEL),%ebx
- pushl %ebx
pushl %esp
- pushl $0 # dummy arg
addl $1,CPUVAR(NTRAP) # statistical info
adcl $0,CPUVAR(NTRAP)+4
- call _C_LABEL(npxintr)
- addl $12,%esp
+ call _C_LABEL(fputrap)
+ addl $4,%esp
jmp _C_LABEL(trapreturn)
IDTVEC_END(trap10)
IDTVEC(trap11)
TRAP(T_ALIGNFLT)
IDTVEC_END(trap11)
-#ifdef XEN
-IDTVEC(trap12)
-IDTVEC(trap13)
-#else
+
IDTVEC(trap12)
ZTRAP(T_MCA)
+IDTVEC_END(trap12)
IDTVEC(trap13)
- ZTRAP(T_XMM)
-#endif
+ pushl $0 # dummy error code
+ pushl $T_XMM
+ jmp .Ldo_fputrap
+IDTVEC_END(trap13)
+
IDTVEC(trap14)
IDTVEC(trap15)
IDTVEC(trap16)
diff -r 178854fe416f -r 8ae3a0237d1a sys/arch/i386/i386/ibcs2_machdep.c
--- a/sys/arch/i386/i386/ibcs2_machdep.c Wed Feb 12 23:04:43 2014 +0000
+++ b/sys/arch/i386/i386/ibcs2_machdep.c Wed Feb 12 23:24:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ibcs2_machdep.c,v 1.42 2014/01/19 14:30:37 dsl Exp $ */
+/* $NetBSD: ibcs2_machdep.c,v 1.43 2014/02/12 23:24:09 dsl Exp $ */
/*-
* Copyright (c) 1997, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_machdep.c,v 1.42 2014/01/19 14:30:37 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_machdep.c,v 1.43 2014/02/12 23:24:09 dsl Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@@ -47,7 +47,7 @@
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/psl.h>
-#include <machine/npx.h>
+#include <x86/fpu.h>
#include <machine/reg.h>
#include <machine/vmparam.h>
#include <machine/ibcs2_machdep.h>
diff -r 178854fe416f -r 8ae3a0237d1a sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Wed Feb 12 23:04:43 2014 +0000
+++ b/sys/arch/i386/i386/trap.c Wed Feb 12 23:24:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.270 2014/02/07 19:32:50 dsl Exp $ */
+/* $NetBSD: trap.c,v 1.271 2014/02/12 23:24:09 dsl Exp $ */
/*-
* Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.270 2014/02/07 19:32:50 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.271 2014/02/12 23:24:09 dsl Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -126,7 +126,6 @@
#endif
-static inline int xmm_si_code(struct lwp *);
void trap(struct trapframe *);
void trap_tss(struct i386tss *, int, int);
void trap_return_fault_return(struct trapframe *) __dead;
@@ -188,44 +187,6 @@
trap(&tf);
}
-static inline int
-xmm_si_code(struct lwp *l)
-{
Home |
Main Index |
Thread Index |
Old Index