Rev 238 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 238 | Rev 272 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (C) 2005 Jakub Vana |
2 | * Copyright (C) 2005 Jakub Vana |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
8 | * |
8 | * |
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * - Redistributions in binary form must reproduce the above copyright |
11 | * - Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
13 | * documentation and/or other materials provided with the distribution. |
14 | * - The name of the author may not be used to endorse or promote products |
14 | * - The name of the author may not be used to endorse or promote products |
15 | * derived from this software without specific prior written permission. |
15 | * derived from this software without specific prior written permission. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | * |
27 | * |
28 | */ |
28 | */ |
29 | 29 | ||
30 | 30 | ||
31 | #include <panic.h> |
31 | #include <panic.h> |
32 | #include <print.h> |
32 | #include <print.h> |
33 | #include <arch/types.h> |
33 | #include <arch/types.h> |
34 | #include <arch/asm.h> |
34 | #include <arch/asm.h> |
- | 35 | #include <symtab.h> |
|
35 | 36 | ||
36 | extern __u64 REG_DUMP; |
37 | extern __u64 REG_DUMP; |
37 | 38 | ||
38 | 39 | ||
39 | void general_exception(void); |
40 | void general_exception(void); |
40 | void general_exception(void) |
41 | void general_exception(void) |
41 | { |
42 | { |
42 | panic("\nGeneral Exception\n"); |
43 | panic("\nGeneral Exception\n"); |
43 | } |
44 | } |
44 | 45 | ||
45 | 46 | ||
46 | 47 | ||
47 | void break_instruction(void); |
48 | void break_instruction(void); |
48 | void break_instruction(void) |
49 | void break_instruction(void) |
49 | { |
50 | { |
50 | panic("\nBreak Instruction\n"); |
51 | panic("\nBreak Instruction\n"); |
51 | } |
52 | } |
52 | 53 | ||
53 | 54 | ||
54 | #define cr_dump(r) {__u64 val; get_control_register(r,val); printf("cr"#r":%Q\n",val);} |
55 | #define cr_dump(r) {__u64 val; get_control_register(r,val); printf("\ncr"#r":%Q",val);} |
55 | #define ar_dump(r) {__u64 val; get_aplication_register(r,val); printf("ar"#r":%Q\n",val);} |
56 | #define ar_dump(r) {__u64 val; get_aplication_register(r,val); printf("\nar"#r":%Q",val);} |
56 | 57 | ||
57 | void universal_handler(void); |
58 | void universal_handler(void); |
58 | void universal_handler(void) |
59 | void universal_handler(void) |
59 | { |
60 | { |
60 | __u64 vector,psr; |
61 | __u64 vector,psr,PC; |
61 | __u64 *p; |
62 | __u64 *p; |
62 | int i; |
63 | int i; |
- | 64 | char *sym; |
|
63 | 65 | ||
64 | 66 | ||
65 | get_shadow_register(16,vector); |
67 | get_shadow_register(16,vector); |
66 | 68 | ||
67 | 69 | ||
68 | p=®_DUMP; |
70 | p=®_DUMP; |
69 | 71 | ||
70 | for(i=0;i<128;i+=2) printf("gr%d:%Q\tgr%d:%Q\n",i,p[i],i+1,p[i+1]); |
72 | for(i=0;i<128;i+=2) printf("gr%d:%Q\tgr%d:%Q\n",i,p[i],i+1,p[i+1]); |
71 | 73 | ||
72 | 74 | ||
73 | cr_dump(0); |
75 | cr_dump(0); |
74 | cr_dump(1); |
76 | cr_dump(1); |
75 | cr_dump(2); |
77 | cr_dump(2); |
76 | cr_dump(8); |
78 | cr_dump(8); |
77 | cr_dump(16); |
79 | cr_dump(16); |
78 | cr_dump(17); |
80 | cr_dump(17); |
79 | cr_dump(19); |
81 | cr_dump(19);get_control_register(19,PC); if(sym=get_symtab_entry(PC)) printf("(%s)",sym); |
80 | cr_dump(20); |
82 | cr_dump(20);get_control_register(20,PC); if(sym=get_symtab_entry(PC)) printf("(%s)",sym); |
81 | cr_dump(21); |
83 | cr_dump(21); |
82 | cr_dump(22); |
84 | cr_dump(22);get_control_register(22,PC); if(sym=get_symtab_entry(PC)) printf("(%s)",sym); |
83 | cr_dump(23); |
85 | cr_dump(23); |
84 | cr_dump(24); |
86 | cr_dump(24); |
85 | cr_dump(25); |
87 | cr_dump(25); |
86 | cr_dump(64); |
88 | cr_dump(64); |
87 | cr_dump(65); |
89 | cr_dump(65); |
88 | cr_dump(66); |
90 | cr_dump(66); |
89 | cr_dump(67); |
91 | cr_dump(67); |
90 | cr_dump(68); |
92 | cr_dump(68); |
91 | cr_dump(69); |
93 | cr_dump(69); |
92 | cr_dump(70); |
94 | cr_dump(70); |
93 | cr_dump(71); |
95 | cr_dump(71); |
94 | cr_dump(72); |
96 | cr_dump(72); |
95 | cr_dump(73); |
97 | cr_dump(73); |
96 | cr_dump(74); |
98 | cr_dump(74); |
97 | cr_dump(80); |
99 | cr_dump(80); |
98 | cr_dump(81); |
100 | cr_dump(81); |
99 | 101 | ||
100 | ar_dump(0); |
102 | ar_dump(0); |
101 | ar_dump(1); |
103 | ar_dump(1); |
102 | ar_dump(2); |
104 | ar_dump(2); |
103 | ar_dump(3); |
105 | ar_dump(3); |
104 | ar_dump(4); |
106 | ar_dump(4); |
105 | ar_dump(5); |
107 | ar_dump(5); |
106 | ar_dump(6); |
108 | ar_dump(6); |
107 | ar_dump(7); |
109 | ar_dump(7); |
108 | ar_dump(16); |
110 | ar_dump(16); |
109 | ar_dump(17); |
111 | ar_dump(17); |
110 | ar_dump(18); |
112 | ar_dump(18); |
111 | ar_dump(19); |
113 | ar_dump(19); |
112 | ar_dump(21); |
114 | ar_dump(21); |
113 | ar_dump(24); |
115 | ar_dump(24); |
114 | ar_dump(25); |
116 | ar_dump(25); |
115 | ar_dump(26); |
117 | ar_dump(26); |
116 | ar_dump(27); |
118 | ar_dump(27); |
117 | ar_dump(28); |
119 | ar_dump(28); |
118 | ar_dump(29); |
120 | ar_dump(29); |
119 | ar_dump(30); |
121 | ar_dump(30); |
120 | ar_dump(32); |
122 | ar_dump(32); |
121 | ar_dump(36); |
123 | ar_dump(36); |
122 | ar_dump(40); |
124 | ar_dump(40); |
123 | ar_dump(44); |
125 | ar_dump(44); |
124 | ar_dump(64); |
126 | ar_dump(64); |
125 | ar_dump(65); |
127 | ar_dump(65); |
126 | ar_dump(66); |
128 | ar_dump(66); |
127 | 129 | ||
128 | get_psr(psr); |
130 | get_psr(psr); |
129 | 131 | ||
130 | printf("\nPSR:%Q\n",psr); |
132 | printf("\nPSR:%Q\n",psr); |
131 | 133 | ||
132 | panic("\nException:%Q\n",vector); |
134 | panic("\nException:%Q\n",vector); |
133 | } |
135 | } |
134 | 136 | ||
135 | 137 | ||
136 | 138 |