Last change
on this file since 717 was
232,
checked in by alain, 12 years ago
|
Introducing the elementary tests for a TSAR mono-cluster
mono-processor platform with MMU using the vci_cc_vcache_v4
such as the "tsarv4_mono_mmu".
(assemby level tests written by Manuel Bouyer)
|
File size:
946 bytes
|
Line | |
---|
1 | /* |
---|
2 | * arithmetic overflow test: check that a add can generates an exception |
---|
3 | */ |
---|
4 | #include <registers.h> |
---|
5 | #include <misc.h> |
---|
6 | |
---|
7 | .text |
---|
8 | .globl _start |
---|
9 | _start: |
---|
10 | .set noreorder |
---|
11 | la k0, TTY_BASE |
---|
12 | la k1, EXIT_BASE |
---|
13 | la sp, 0x00400000 - 16 |
---|
14 | |
---|
15 | PRINT(startstr) |
---|
16 | |
---|
17 | /* reset cop0 status (keep BEV) */ |
---|
18 | lui a0, 0x0040; |
---|
19 | mtc0 a0, COP0_STATUS |
---|
20 | la a0, 0x7fffffff |
---|
21 | li a1, 0x02 |
---|
22 | add a0, a0, a1 |
---|
23 | EXIT(2) |
---|
24 | |
---|
25 | .globl excep |
---|
26 | excep: |
---|
27 | .set noreorder |
---|
28 | PRINT(statusstr) |
---|
29 | mfc0 a0, COP0_STATUS |
---|
30 | PRINTX |
---|
31 | |
---|
32 | PRINT(causestr) |
---|
33 | mfc0 a0, COP0_CAUSE |
---|
34 | PRINTX |
---|
35 | |
---|
36 | PRINT(pcstr) |
---|
37 | mfc0 a0, COP0_EXPC |
---|
38 | PRINTX |
---|
39 | |
---|
40 | PRINT(badvastr) |
---|
41 | mfc0 a0, COP_0_BADVADDR |
---|
42 | PRINTX |
---|
43 | PUTCHAR('\n') |
---|
44 | #we should end there |
---|
45 | EXIT(0) |
---|
46 | |
---|
47 | .rodata: |
---|
48 | statusstr: .ascii "status \0" |
---|
49 | causestr: .ascii " cause \0" |
---|
50 | pcstr: .ascii " pc \0" |
---|
51 | badvastr: .ascii " badva \0" |
---|
52 | startstr: .ascii "start\n\0" |
---|
53 | usrstr: .ascii "usrmode\n\0" |
---|
54 | |
---|
55 | .org EXCEP_ADDRESS - BOOT_ADDRESS |
---|
56 | .globl evect |
---|
57 | evect: |
---|
58 | j excep |
---|
59 | nop |
---|
60 | .data |
---|
61 | .word MAGIC1 |
---|
62 | testval: |
---|
63 | .word MAGIC2 |
---|
Note: See
TracBrowser
for help on using the repository browser.