| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: trap.c,v 1.35 2020/09/10 02:45:28 rin Exp $ */ | | 1 | /* $NetBSD: trap.c,v 1.36 2021/01/06 08:04:57 rin Exp $ */ |
2 | /*- | | 2 | /*- |
3 | * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. | | 3 | * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * | | 5 | * |
6 | * This code is derived from software contributed to The NetBSD Foundation | | 6 | * This code is derived from software contributed to The NetBSD Foundation |
7 | * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects | | 7 | * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects |
8 | * Agency and which was developed by Matt Thomas of 3am Software Foundry. | | 8 | * Agency and which was developed by Matt Thomas of 3am Software Foundry. |
9 | * | | 9 | * |
10 | * This material is based upon work supported by the Defense Advanced Research | | 10 | * This material is based upon work supported by the Defense Advanced Research |
11 | * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under | | 11 | * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under |
12 | * Contract No. N66001-09-C-2073. | | 12 | * Contract No. N66001-09-C-2073. |
13 | * Approved for Public Release, Distribution Unlimited | | 13 | * Approved for Public Release, Distribution Unlimited |
14 | * | | 14 | * |
| @@ -25,62 +25,60 @@ | | | @@ -25,62 +25,60 @@ |
25 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 25 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
26 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 26 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
27 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 27 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
28 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 28 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
34 | * POSSIBILITY OF SUCH DAMAGE. | | 34 | * POSSIBILITY OF SUCH DAMAGE. |
35 | */ | | 35 | */ |
36 | | | 36 | |
37 | #include <sys/cdefs.h> | | 37 | #include <sys/cdefs.h> |
38 | __KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.35 2020/09/10 02:45:28 rin Exp $"); | | 38 | __KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.36 2021/01/06 08:04:57 rin Exp $"); |
39 | | | 39 | |
40 | #ifdef _KERNEL_OPT | | 40 | #ifdef _KERNEL_OPT |
41 | #include "opt_altivec.h" | | 41 | #include "opt_altivec.h" |
42 | #include "opt_ddb.h" | | 42 | #include "opt_ddb.h" |
43 | #endif | | 43 | #endif |
44 | | | 44 | |
45 | #include <sys/param.h> | | 45 | #include <sys/param.h> |
46 | #include <sys/systm.h> | | | |
47 | #include <sys/siginfo.h> | | | |
48 | #include <sys/lwp.h> | | | |
49 | #include <sys/proc.h> | | | |
50 | #include <sys/cpu.h> | | 46 | #include <sys/cpu.h> |
51 | #include <sys/kauth.h> | | 47 | #include <sys/kauth.h> |
| | | 48 | #include <sys/lwp.h> |
| | | 49 | #include <sys/proc.h> |
52 | #include <sys/ras.h> | | 50 | #include <sys/ras.h> |
| | | 51 | #include <sys/siginfo.h> |
| | | 52 | #include <sys/systm.h> |
| | | 53 | |
| | | 54 | #include <ddb/ddb.h> |
53 | | | 55 | |
54 | #include <uvm/uvm_extern.h> | | 56 | #include <uvm/uvm_extern.h> |
55 | | | 57 | |
| | | 58 | #include <powerpc/altivec.h> /* use same interface for SPE */ |
| | | 59 | #include <powerpc/instr.h> |
56 | #include <powerpc/pcb.h> | | 60 | #include <powerpc/pcb.h> |
57 | #include <powerpc/userret.h> | | | |
58 | #include <powerpc/psl.h> | | 61 | #include <powerpc/psl.h> |
59 | #include <powerpc/instr.h> | | | |
60 | #include <powerpc/altivec.h> /* use same interface for SPE */ | | | |
61 | | | | |
62 | #include <powerpc/spr.h> | | 62 | #include <powerpc/spr.h> |
63 | #include <powerpc/booke/spr.h> | | 63 | #include <powerpc/trap.h> |
64 | #include <powerpc/booke/cpuvar.h> | | 64 | #include <powerpc/userret.h> |
65 | | | 65 | |
66 | #include <powerpc/fpu/fpu_extern.h> | | 66 | #include <powerpc/fpu/fpu_extern.h> |
67 | | | 67 | |
68 | #include <powerpc/db_machdep.h> | | 68 | #include <powerpc/booke/cpuvar.h> |
69 | #include <ddb/db_interface.h> | | | |
70 | | | | |
71 | #include <powerpc/trap.h> | | | |
72 | #include <powerpc/booke/trap.h> | | | |
73 | #include <powerpc/booke/pte.h> | | 69 | #include <powerpc/booke/pte.h> |
| | | 70 | #include <powerpc/booke/spr.h> |
| | | 71 | #include <powerpc/booke/trap.h> |
74 | | | 72 | |
75 | void trap(enum ppc_booke_exceptions, struct trapframe *); | | 73 | void trap(enum ppc_booke_exceptions, struct trapframe *); |
76 | | | 74 | |
77 | static const char trap_names[][8] = { | | 75 | static const char trap_names[][8] = { |
78 | [T_CRITIAL_INPUT] = "CRIT", | | 76 | [T_CRITIAL_INPUT] = "CRIT", |
79 | [T_EXTERNAL_INPUT] = "EXT", | | 77 | [T_EXTERNAL_INPUT] = "EXT", |
80 | [T_DECREMENTER] = "DECR", | | 78 | [T_DECREMENTER] = "DECR", |
81 | [T_FIXED_INTERVAL] = "FIT", | | 79 | [T_FIXED_INTERVAL] = "FIT", |
82 | [T_WATCHDOG] = "WDOG", | | 80 | [T_WATCHDOG] = "WDOG", |
83 | [T_SYSTEM_CALL] = "SC", | | 81 | [T_SYSTEM_CALL] = "SC", |
84 | [T_MACHINE_CHECK] = "MCHK", | | 82 | [T_MACHINE_CHECK] = "MCHK", |
85 | [T_DSI] = "DSI", | | 83 | [T_DSI] = "DSI", |
86 | [T_ISI] = "ISI", | | 84 | [T_ISI] = "ISI", |