ld: Move the .note.build-id section to near the start of the memory map.
[binutils-gdb.git] / sim / testsuite / bfin / cec-system-call.S
blob6aaf3caca42ae7aed8bd43f52ace425d6c49da64
1 # Blackfin testcase for returning to the right place while bouncing between
2 # multiple CEC levels (like in a Linux system call)
3 # mach: bfin
4 # sim: --environment operating
6 #include "test.h"
7         .include "testutils.inc"
9         # This test keeps P5 as the base of the EVT table
11         .macro set_evt lvl:req, sym:req
12         loadsym R1, \sym;
13         [P5 + 4 * \lvl\()] = R1;
14         .endm
16         start
18         # First mark all EVTs as fails (they shouldn't be activated)
19         imm32 P5, EVT0;
20         P1 = P5;
21         loadsym R1, fail_lvl
22         imm32 P2, 16
23         LSETUP (1f, 1f) LC0 = P2;
24 1:      [P1++] = R1;
26         # The OS exception handler
27         set_evt 3, _evx;
28         # The OS system call handler
29         set_evt 15, _evt15;
31         # Lower ourselves to userspace
32         loadsym R1, _user;
33         loadsym R2, _next_user;
34         RETI = R1;
35         R7 = -1;
36         sti R7;
37         RTI;
39 _user:
40         EXCPT 0;
41 _next_user:
42         dbg_pass
44 _evx:
45         # RETX should be pointing to the right place
46         R1 = RETX;
47         CC = R1 == R2;
48         IF !CC JUMP fail_lvl;
50         # Lower ourselves to the system call handler
51         RAISE 15;
52         RTX;
54 _evt15:
55         # RETI should be pointing to the right place
56         R1 = RETI;
57         CC = R1 == R2;
58         IF !CC JUMP fail_lvl;
60         # Return to userspace now
61         RTI;
63 fail_lvl:
64         dbg_fail