Skip to content

Commit 60103e4

Browse files
committed
3avirt: Make exception vector work
Reset s0 for offset calculation. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
1 parent 55bbc2f commit 60103e4

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Targets/Bonito3avirt/Bonito/start.S

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,34 +131,39 @@ ext_map_and_reboot:
131131
* Exception vectors here for rom, before we are up and running. Catch
132132
* whatever comes up before we have a fully fledged exception handler.
133133
*/
134-
.align 9 /* bfc00200 */
134+
.org 0x200 /* bfc00200 */
135+
move s0, zero
135136
la a0, v200_msg
136137
bal stringserial
137138
nop
138139
b exc_common
139140

140-
.align 7 /* bfc00280 */
141+
.org 0x280 /* bfc00280 */
142+
move s0, zero
141143
la a0, v280_msg
142144
bal stringserial
143145
nop
144146
b exc_common
145147

146148
/* Cache error */
147-
.align 8 /* bfc00300 */
149+
.org 0x300 /* bfc00300 */
150+
move s0, zero
148151
PRINTSTR("\r\nPANIC! Unexpected Cache Error exception! ")
149152
mfc0 a0, COP_0_CACHE_ERR
150153
bal hexserial
151154
nop
152155
b exc_common
153156

154157
/* General exception */
155-
.align 7 /* bfc00380 */
158+
.org 0x380 /* bfc00380 */
159+
move s0, zero
156160
la a0, v380_msg
157161
bal stringserial
158162
nop
159163
b exc_common
160164

161-
.align 8 /* bfc00400 */
165+
.org 0x400 /* bfc00400 */
166+
move s0, zero
162167
la a0, v400_msg
163168
bal stringserial
164169
nop
@@ -167,7 +172,7 @@ ext_map_and_reboot:
167172
nop
168173

169174
/* Debug exception */
170-
.align 7 /* bfc00480 */
175+
.org 0x480 /* bfc00480 */
171176
#include "exc_ejtag.S"
172177

173178
exc_common:

0 commit comments

Comments
 (0)