source: trunk/softs/tests_cc_vcache/test_ri_delayslot/test.S @ 412

Last change on this file since 412 was 232, checked in by alain, 13 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: 1.2 KB
Line 
1/*
2 * reserved instruction exception test: check that a reserved instruction
3 * in a delay slot is properly handled
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        la      sp, 0x00400000 - 16
15
16        PRINT(startstr)
17
18        /* reset cop0 status (keep BEV) */
19        lui     a0, 0x0040;
20        mtc0    a0, COP0_STATUS
21        nop
22        nop
23        nop
24        j       exit
25        .word 0x60000000
26        nop
27        /* we should not get there, */
28        EXIT(2)
29        .globl exit
30exit:
31        move    a0, v0
32        PRINTX
33        PUTCHAR(' ')
34        move    a0, v1
35        PRINTX
36        PUTCHAR('\n')
37        /* we should get there */
38        EXIT(0)
39
40        .globl excep
41excep:
42        .set noreorder
43        PRINT(statusstr)
44        mfc0    a0, COP0_STATUS
45        PRINTX
46
47        PRINT(causestr)
48        mfc0    a0, COP0_CAUSE
49        PRINTX
50
51        PRINT(pcstr)
52        mfc0    a0, COP0_EXPC
53        PRINTX
54
55        PRINT(badvastr)
56        mfc0    a0, COP_0_BADVADDR
57        PRINTX
58        PUTCHAR('\n')
59        la      a0, exit
60        mtc0    a0, COP0_EXPC
61        li      v0, MAGIC1
62        li      v1, MAGIC2
63        li      a3, 1
64        eret
65        nop
66
67#we should not end there
68        EXIT(1)
69
70        .rodata:
71statusstr: .ascii "status \0"
72causestr: .ascii " cause \0"
73pcstr: .ascii " pc \0"
74badvastr: .ascii " badva \0"
75startstr: .ascii "start\n\0"
76usrstr: .ascii "usrmode\n\0"
77
78        .org EXCEP_ADDRESS - BOOT_ADDRESS
79        .globl evect
80evect:
81        j       excep
82        nop
83        .data
84        .word MAGIC1
85testval:
86        .word MAGIC2
Note: See TracBrowser for help on using the repository browser.