Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/stand/prekern Rename the entry points of the ...



details:   https://anonhg.NetBSD.org/src/rev/7e4e098b4870
branches:  trunk
changeset: 319311:7e4e098b4870
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri May 25 15:52:11 2018 +0000

description:
Rename the entry points of the prekern, rename the array and move it into
.rodata.

diffstat:

 sys/arch/amd64/stand/prekern/prekern.c |    6 +-
 sys/arch/amd64/stand/prekern/trap.S    |  134 ++++++++++++++++----------------
 2 files changed, 71 insertions(+), 69 deletions(-)

diffs (199 lines):

diff -r 805f96f5cb85 -r 7e4e098b4870 sys/arch/amd64/stand/prekern/prekern.c
--- a/sys/arch/amd64/stand/prekern/prekern.c    Fri May 25 15:48:00 2018 +0000
+++ b/sys/arch/amd64/stand/prekern/prekern.c    Fri May 25 15:52:11 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: prekern.c,v 1.7 2017/11/26 11:01:09 maxv Exp $ */
+/*     $NetBSD: prekern.c,v 1.8 2018/05/25 15:52:11 maxv Exp $ */
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -58,7 +58,7 @@
 
 #define IDTVEC(name) __CONCAT(X, name)
 typedef void (vector)(void);
-extern vector *IDTVEC(exceptions)[];
+extern vector *x86_exceptions[];
 
 void fatal(char *msg)
 {
@@ -211,7 +211,7 @@
 
        idt = (struct gate_descriptor *)&idtstore;
        for (i = 0; i < NCPUIDT; i++) {
-               setgate(&idt[i], IDTVEC(exceptions)[i], 0, SDT_SYS386IGT,
+               setgate(&idt[i], x86_exceptions[i], 0, SDT_SYS386IGT,
                    SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
        }
 
diff -r 805f96f5cb85 -r 7e4e098b4870 sys/arch/amd64/stand/prekern/trap.S
--- a/sys/arch/amd64/stand/prekern/trap.S       Fri May 25 15:48:00 2018 +0000
+++ b/sys/arch/amd64/stand/prekern/trap.S       Fri May 25 15:52:11 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.S,v 1.2 2017/12/22 07:37:27 maxv Exp $    */
+/*     $NetBSD: trap.S,v 1.3 2018/05/25 15:52:11 maxv Exp $    */
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -90,91 +90,72 @@
        ZTRAPENTRY(T_FPOPFLT)
 IDTVEC_END(trap09)
 
-IDTVEC(trap0a)
+IDTVEC(trap10)
        TRAPENTRY(T_TSSFLT)
-IDTVEC_END(trap0a)
-
-IDTVEC(trap0b)         /* #NP() Segment not present */
-       ZTRAPENTRY(T_SEGNPFLT)
-IDTVEC_END(trap0b)
-
-IDTVEC(trap0c)         /* #SS() Stack exception */
-       ZTRAPENTRY(T_STKFLT)
-IDTVEC_END(trap0c)
-
-IDTVEC(trap0d)         /* #GP() General protection */
-       ZTRAPENTRY(T_PROTFLT)
-IDTVEC_END(trap0d)
-
-IDTVEC(trap0e)
-       TRAPENTRY(T_PAGEFLT)
-IDTVEC_END(trap0e)
-
-IDTVEC(trap0f)
-       ZTRAPENTRY(T_ASTFLT)
-IDTVEC_END(trap0f)
-
-IDTVEC(trap10)
-       ZTRAPENTRY(T_ARITHTRAP)
 IDTVEC_END(trap10)
 
 IDTVEC(trap11)
-       TRAPENTRY(T_ALIGNFLT)
+       ZTRAPENTRY(T_SEGNPFLT)
 IDTVEC_END(trap11)
 
 IDTVEC(trap12)
-       ZTRAPENTRY(T_MCA)
+       ZTRAPENTRY(T_STKFLT)
 IDTVEC_END(trap12)
 
 IDTVEC(trap13)
-       ZTRAPENTRY(T_XMM)
+       ZTRAPENTRY(T_PROTFLT)
 IDTVEC_END(trap13)
 
 IDTVEC(trap14)
+       TRAPENTRY(T_PAGEFLT)
+IDTVEC_END(trap14)
+
 IDTVEC(trap15)
+       ZTRAPENTRY(T_ASTFLT)
+IDTVEC_END(trap15)
+
 IDTVEC(trap16)
+       ZTRAPENTRY(T_ARITHTRAP)
+IDTVEC_END(trap16)
+
 IDTVEC(trap17)
+       TRAPENTRY(T_ALIGNFLT)
+IDTVEC_END(trap17)
+
 IDTVEC(trap18)
+       ZTRAPENTRY(T_MCA)
+IDTVEC_END(trap18)
+
 IDTVEC(trap19)
-IDTVEC(trap1a)
-IDTVEC(trap1b)
-IDTVEC(trap1c)
-IDTVEC(trap1d)
-IDTVEC(trap1e)
-IDTVEC(trap1f)
+       ZTRAPENTRY(T_XMM)
+IDTVEC_END(trap19)
+
+IDTVEC(trap20)
+IDTVEC(trap21)
+IDTVEC(trap22)
+IDTVEC(trap23)
+IDTVEC(trap24)
+IDTVEC(trap25)
+IDTVEC(trap26)
+IDTVEC(trap27)
+IDTVEC(trap28)
+IDTVEC(trap29)
+IDTVEC(trap30)
+IDTVEC(trap31)
        /* 20 - 31 reserved for future exp */
        ZTRAPENTRY(T_RESERVED)
-IDTVEC_END(trap1f)
-IDTVEC_END(trap1e)
-IDTVEC_END(trap1d)
-IDTVEC_END(trap1c)
-IDTVEC_END(trap1b)
-IDTVEC_END(trap1a)
-IDTVEC_END(trap19)
-IDTVEC_END(trap18)
-IDTVEC_END(trap17)
-IDTVEC_END(trap16)
-IDTVEC_END(trap15)
-IDTVEC_END(trap14)
-
-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(Xtrap0a), _C_LABEL(Xtrap0b)
-       .quad   _C_LABEL(Xtrap0c), _C_LABEL(Xtrap0d)
-       .quad   _C_LABEL(Xtrap0e), _C_LABEL(Xtrap0f)
-       .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(Xtrap1a), _C_LABEL(Xtrap1b)
-       .quad   _C_LABEL(Xtrap1c), _C_LABEL(Xtrap1d)
-       .quad   _C_LABEL(Xtrap1e), _C_LABEL(Xtrap1f)
-IDTVEC_END(exceptions)
+IDTVEC_END(trap31)
+IDTVEC_END(trap30)
+IDTVEC_END(trap29)
+IDTVEC_END(trap28)
+IDTVEC_END(trap27)
+IDTVEC_END(trap26)
+IDTVEC_END(trap25)
+IDTVEC_END(trap24)
+IDTVEC_END(trap23)
+IDTVEC_END(trap22)
+IDTVEC_END(trap21)
+IDTVEC_END(trap20)
 
 /*
  * Arguments pushed on the stack:
@@ -191,3 +172,24 @@
        call    _C_LABEL(trap)
        /* NOTREACHED */
 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)



Home | Main Index | Thread Index | Old Index