Last change
on this file since 520 was
520,
checked in by bouyer, 11 years ago
|
Re-add the tests; reverting previous which was done at the wrong level (sorry)
|
File size:
1.0 KB
|
Line | |
---|
1 | /* |
---|
2 | * Check that on return from exception the modified EPC is handled. |
---|
3 | * We use a load to an unaligned address to trigger the exception. |
---|
4 | */ |
---|
5 | #include <registers.h> |
---|
6 | #include <misc.h> |
---|
7 | |
---|
8 | .text |
---|
9 | .globl _start |
---|
10 | _start: |
---|
11 | .set noreorder |
---|
12 | la k0, TTY_BASE |
---|
13 | la k1, EXIT_BASE |
---|
14 | |
---|
15 | PRINT(startstr) |
---|
16 | |
---|
17 | /* reset cop0 status (keep BEV) */ |
---|
18 | lui a0, 0x0040; |
---|
19 | mtc0 a0, COP0_STATUS |
---|
20 | |
---|
21 | li a0, 1 |
---|
22 | lw a0, 0(a0) /* fault */ |
---|
23 | |
---|
24 | /* we shouldn't get there */ |
---|
25 | EXIT(1) |
---|
26 | |
---|
27 | .globl exret |
---|
28 | |
---|
29 | exret: |
---|
30 | PRINT(eretstr) |
---|
31 | EXIT(0) |
---|
32 | |
---|
33 | .globl excep |
---|
34 | excep: |
---|
35 | .set noreorder |
---|
36 | PRINT(statusstr) |
---|
37 | mfc0 a0, COP0_STATUS |
---|
38 | PRINTX |
---|
39 | |
---|
40 | PRINT(causestr) |
---|
41 | mfc0 a0, COP0_CAUSE |
---|
42 | PRINTX |
---|
43 | |
---|
44 | PRINT(pcstr) |
---|
45 | mfc0 a0, COP0_EXPC |
---|
46 | PRINTX |
---|
47 | |
---|
48 | PRINT(badvastr) |
---|
49 | mfc0 a0, COP_0_BADVADDR |
---|
50 | PRINTX |
---|
51 | |
---|
52 | PUTCHAR('\n') |
---|
53 | la a0, exret |
---|
54 | mtc0 a0, COP0_EXPC |
---|
55 | eret |
---|
56 | |
---|
57 | .rodata: |
---|
58 | statusstr: .ascii "status \0" |
---|
59 | causestr: .ascii " cause \0" |
---|
60 | pcstr: .ascii " pc \0" |
---|
61 | badvastr: .ascii " badva \0" |
---|
62 | startstr: .ascii "start\n\0" |
---|
63 | eretstr: .ascii "eret\n\0" |
---|
64 | |
---|
65 | .org EXCEP_ADDRESS - BOOT_ADDRESS |
---|
66 | .globl evect |
---|
67 | evect: |
---|
68 | j excep |
---|
69 | nop |
---|
70 | .data |
---|
71 | myvar: .word 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.