Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64/amd64 Don't declare exceptions[] with IDTVEC, ...
details: https://anonhg.NetBSD.org/src/rev/5f056911c18f
branches: trunk
changeset: 358860:5f056911c18f
user: maxv <maxv%NetBSD.org@localhost>
date: Sat Jan 20 13:42:07 2018 +0000
description:
Don't declare exceptions[] with IDTVEC, it's an array, not a function.
Rename it to x86_exceptions[], and move it to .rodata.
diffstat:
sys/arch/amd64/amd64/amd64_trap.S | 44 ++++++++++++++++++++------------------
sys/arch/amd64/amd64/machdep.c | 10 ++++----
2 files changed, 28 insertions(+), 26 deletions(-)
diffs (114 lines):
diff -r 685938229daa -r 5f056911c18f sys/arch/amd64/amd64/amd64_trap.S
--- a/sys/arch/amd64/amd64/amd64_trap.S Sat Jan 20 08:45:28 2018 +0000
+++ b/sys/arch/amd64/amd64/amd64_trap.S Sat Jan 20 13:42:07 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amd64_trap.S,v 1.19 2018/01/20 08:30:53 maxv Exp $ */
+/* $NetBSD: amd64_trap.S,v 1.20 2018/01/20 13:42:07 maxv Exp $ */
/*
* Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
#if 0
#include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.19 2018/01/20 08:30:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.20 2018/01/20 13:42:07 maxv Exp $");
#endif
/*
@@ -360,25 +360,6 @@
IDTVEC_END(trap30)
IDTVEC_END(trap31)
-IDTVEC(exceptions)
- .quad _C_LABEL(Xtrap00), _C_LABEL(Xtrap01)
- .quad _C_LABEL(Xtrap02), _C_LABEL(Xtrap03)
- .quad _C_LABEL(Xtrap04), _C_LABEL(Xtrap05)
- .quad _C_LABEL(Xtrap06), _C_LABEL(Xtrap07)
- .quad _C_LABEL(Xtrap08), _C_LABEL(Xtrap09)
- .quad _C_LABEL(Xtrap10), _C_LABEL(Xtrap11)
- .quad _C_LABEL(Xtrap12), _C_LABEL(Xtrap13)
- .quad _C_LABEL(Xtrap14), _C_LABEL(Xtrap15)
- .quad _C_LABEL(Xtrap16), _C_LABEL(Xtrap17)
- .quad _C_LABEL(Xtrap18), _C_LABEL(Xtrap19)
- .quad _C_LABEL(Xtrap20), _C_LABEL(Xtrap21)
- .quad _C_LABEL(Xtrap22), _C_LABEL(Xtrap23)
- .quad _C_LABEL(Xtrap24), _C_LABEL(Xtrap25)
- .quad _C_LABEL(Xtrap26), _C_LABEL(Xtrap27)
- .quad _C_LABEL(Xtrap28), _C_LABEL(Xtrap29)
- .quad _C_LABEL(Xtrap30), _C_LABEL(Xtrap31)
-IDTVEC_END(exceptions)
-
IDTVEC(intrspurious)
ZTRAP_NJ(T_ASTFLT)
INTRENTRY
@@ -512,3 +493,24 @@
#endif
END(alltraps)
+ .section .rodata
+
+LABEL(x86_exceptions)
+ .quad _C_LABEL(Xtrap00), _C_LABEL(Xtrap01)
+ .quad _C_LABEL(Xtrap02), _C_LABEL(Xtrap03)
+ .quad _C_LABEL(Xtrap04), _C_LABEL(Xtrap05)
+ .quad _C_LABEL(Xtrap06), _C_LABEL(Xtrap07)
+ .quad _C_LABEL(Xtrap08), _C_LABEL(Xtrap09)
+ .quad _C_LABEL(Xtrap10), _C_LABEL(Xtrap11)
+ .quad _C_LABEL(Xtrap12), _C_LABEL(Xtrap13)
+ .quad _C_LABEL(Xtrap14), _C_LABEL(Xtrap15)
+ .quad _C_LABEL(Xtrap16), _C_LABEL(Xtrap17)
+ .quad _C_LABEL(Xtrap18), _C_LABEL(Xtrap19)
+ .quad _C_LABEL(Xtrap20), _C_LABEL(Xtrap21)
+ .quad _C_LABEL(Xtrap22), _C_LABEL(Xtrap23)
+ .quad _C_LABEL(Xtrap24), _C_LABEL(Xtrap25)
+ .quad _C_LABEL(Xtrap26), _C_LABEL(Xtrap27)
+ .quad _C_LABEL(Xtrap28), _C_LABEL(Xtrap29)
+ .quad _C_LABEL(Xtrap30), _C_LABEL(Xtrap31)
+END(x86_exceptions)
+
diff -r 685938229daa -r 5f056911c18f sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c Sat Jan 20 08:45:28 2018 +0000
+++ b/sys/arch/amd64/amd64/machdep.c Sat Jan 20 13:42:07 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.292 2018/01/20 07:43:28 maxv Exp $ */
+/* $NetBSD: machdep.c,v 1.293 2018/01/20 13:42:07 maxv Exp $ */
/*
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.292 2018/01/20 07:43:28 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.293 2018/01/20 13:42:07 maxv Exp $");
/* #define XENDEBUG_LOW */
@@ -1488,7 +1488,7 @@
extern vector IDTVEC(syscall);
extern vector IDTVEC(syscall32);
extern vector IDTVEC(osyscall);
-extern vector *IDTVEC(exceptions)[];
+extern vector *x86_exceptions[];
static void
init_x86_64_ksyms(void)
@@ -1777,7 +1777,7 @@
ist = 0;
break;
}
- setgate(&idt[x], IDTVEC(exceptions)[x], ist, SDT_SYS386IGT,
+ setgate(&idt[x], x86_exceptions[x], ist, SDT_SYS386IGT,
(x == 3 || x == 4) ? SEL_UPL : SEL_KPL,
GSEL(GCODE_SEL, SEL_KPL));
#else /* XEN */
@@ -1801,7 +1801,7 @@
xen_idt[xen_idt_idx].cs = GSEL(GCODE_SEL, SEL_KPL);
xen_idt[xen_idt_idx].address =
- (unsigned long)IDTVEC(exceptions)[x];
+ (unsigned long)x86_exceptions[x];
xen_idt_idx++;
#endif /* XEN */
}
Home |
Main Index |
Thread Index |
Old Index