Skip to content

Commit c322398

Browse files
authored
Merge pull request #133 from xiulipan/xtensaexc
xtensa: add exception handler for all exception
2 parents d696d8f + b02fe90 commit c322398

1 file changed

Lines changed: 68 additions & 8 deletions

File tree

src/arch/xtensa/init.c

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,84 @@ static void exception(void)
5454

5555
static void register_exceptions(void)
5656
{
57+
58+
/* 0 - 9 */
59+
_xtos_set_exception_handler(
60+
EXCCAUSE_ILLEGAL, (void *)&exception);
61+
_xtos_set_exception_handler(
62+
EXCCAUSE_SYSCALL, (void *)&exception);
63+
_xtos_set_exception_handler(
64+
EXCCAUSE_INSTR_ERROR, (void *)&exception);
65+
_xtos_set_exception_handler(
66+
EXCCAUSE_LOAD_STORE_ERROR, (void *)&exception);
67+
_xtos_set_exception_handler(
68+
EXCCAUSE_LEVEL1_INTERRUPT, (void *)&exception);
69+
_xtos_set_exception_handler(
70+
EXCCAUSE_ALLOCA, (void *)&exception);
71+
_xtos_set_exception_handler(
72+
EXCCAUSE_DIVIDE_BY_ZERO, (void *)&exception);
73+
_xtos_set_exception_handler(
74+
EXCCAUSE_SPECULATION, (void *)&exception);
75+
_xtos_set_exception_handler(
76+
EXCCAUSE_PRIVILEGED, (void *)&exception);
77+
_xtos_set_exception_handler(
78+
EXCCAUSE_UNALIGNED, (void *)&exception);
79+
80+
/* Reserved 10..11 */
81+
82+
_xtos_set_exception_handler(
83+
EXCCAUSE_INSTR_DATA_ERROR, (void *)&exception);
84+
_xtos_set_exception_handler(
85+
EXCCAUSE_LOAD_STORE_DATA_ERROR, (void *)&exception);
5786
_xtos_set_exception_handler(
58-
EXCCAUSE_ILLEGAL, (void*) &exception);
87+
EXCCAUSE_INSTR_ADDR_ERROR, (void *)&exception);
5988
_xtos_set_exception_handler(
60-
EXCCAUSE_SYSCALL, (void*) &exception);
89+
EXCCAUSE_LOAD_STORE_ADDR_ERROR, (void *)&exception);
6190
_xtos_set_exception_handler(
62-
EXCCAUSE_DIVIDE_BY_ZERO, (void*) &exception);
91+
EXCCAUSE_ITLB_MISS, (void *)&exception);
92+
_xtos_set_exception_handler(
93+
EXCCAUSE_ITLB_MULTIHIT, (void *)&exception);
94+
_xtos_set_exception_handler(
95+
EXCCAUSE_INSTR_RING, (void *)&exception);
96+
97+
/* Reserved 19 */
98+
99+
_xtos_set_exception_handler(
100+
EXCCAUSE_INSTR_PROHIBITED, (void *)&exception);
63101

102+
/* Reserved 21..23 */
103+
_xtos_set_exception_handler(
104+
EXCCAUSE_DTLB_MISS, (void *)&exception);
64105
_xtos_set_exception_handler(
65-
EXCCAUSE_INSTR_DATA_ERROR, (void*) &exception);
106+
EXCCAUSE_DTLB_MULTIHIT, (void *)&exception);
66107
_xtos_set_exception_handler(
67-
EXCCAUSE_INSTR_ADDR_ERROR, (void*) &exception);
108+
EXCCAUSE_LOAD_STORE_RING, (void *)&exception);
68109

110+
/* Reserved 27 */
69111
_xtos_set_exception_handler(
70-
EXCCAUSE_LOAD_STORE_ERROR, (void*) &exception);
112+
EXCCAUSE_LOAD_PROHIBITED, (void *)&exception);
113+
_xtos_set_exception_handler(
114+
EXCCAUSE_STORE_PROHIBITED, (void *)&exception);
115+
116+
/* Reserved 30..31 */
71117
_xtos_set_exception_handler(
72-
EXCCAUSE_LOAD_STORE_ADDR_ERROR, (void*) &exception);
118+
EXCCAUSE_CP0_DISABLED, (void *)&exception);
73119
_xtos_set_exception_handler(
74-
EXCCAUSE_LOAD_STORE_DATA_ERROR, (void*) &exception);
120+
EXCCAUSE_CP1_DISABLED, (void *)&exception);
121+
_xtos_set_exception_handler(
122+
EXCCAUSE_CP2_DISABLED, (void *)&exception);
123+
_xtos_set_exception_handler(
124+
EXCCAUSE_CP3_DISABLED, (void *)&exception);
125+
_xtos_set_exception_handler(
126+
EXCCAUSE_CP4_DISABLED, (void *)&exception);
127+
_xtos_set_exception_handler(
128+
EXCCAUSE_CP5_DISABLED, (void *)&exception);
129+
_xtos_set_exception_handler(
130+
EXCCAUSE_CP6_DISABLED, (void *)&exception);
131+
_xtos_set_exception_handler(
132+
EXCCAUSE_CP7_DISABLED, (void *)&exception);
133+
134+
/* Reserved 40..63 */
75135
}
76136

77137
/* do any architecture init here */

0 commit comments

Comments
 (0)