ld: Move the .note.build-id section to near the start of the memory map.
[binutils-gdb.git] / sim / testsuite / bfin / c_seq_ac_raise_mv_ppop.S
blobf5fdd4a7467f42f2f95ac7556179cfae0cedfe51
1 //Original:/proj/frio/dv/testcases/core/c_seq_ac_raise_mv_ppop/c_seq_ac_raise_mv_ppop.dsp
2 // Spec Reference: sequencer stage AC  (raise + regmv + pushpopmultiple)
3 # mach: bfin
4 # sim: --environment operating
6 #include "test.h"
7 .include "testutils.inc"
8 start
10 include(std.inc)
11 include(selfcheck.inc)
12 include(gen_int.inc)
13 INIT_R_REGS(0);
14 INIT_P_REGS(0);
15 INIT_I_REGS(0);     // initialize the dsp address regs
16 INIT_M_REGS(0);
17 INIT_L_REGS(0);
18 INIT_B_REGS(0);
19 //CHECK_INIT(p5, 0xe0000000);
20 include(symtable.inc)
21 CHECK_INIT_DEF(p5);
23 #ifndef STACKSIZE
24 #define STACKSIZE 0x10
25 #endif
26 #ifndef EVT
27 #define EVT  0xFFE02000
28 #endif
29 #ifndef EVT15
30 #define EVT15  0xFFE0203C
31 #endif
32 #ifndef EVT_OVERRIDE
33 #define EVT_OVERRIDE 0xFFE02100
34 #endif
35 #ifndef ITABLE
36 #define ITABLE DATA_ADDR_1
37 #endif
39 GEN_INT_INIT(ITABLE) // set location for interrupt table
42 // Reset/Bootstrap Code
43 //   (Here we should set the processor operating modes, initialize registers,
46 BOOT:
48                               // in reset mode now
49 LD32_LABEL(sp, KSTACK);   // setup the stack pointer
50 FP = SP;        // and frame pointer
52 LD32(p0, EVT);      // Setup Event Vectors and Handlers
53 LD32_LABEL(r0, EHANDLE);  // Emulation Handler (Int0)
54     [ P0 ++ ] = R0;
56 LD32_LABEL(r0, RHANDLE);  // Reset Handler (Int1)
57     [ P0 ++ ] = R0;
59 LD32_LABEL(r0, NHANDLE);  // NMI Handler (Int2)
60     [ P0 ++ ] = R0;
62 LD32_LABEL(r0, XHANDLE);  // Exception Handler (Int3)
63     [ P0 ++ ] = R0;
65     [ P0 ++ ] = R0;        // IVT4 not used
67 LD32_LABEL(r0, HWHANDLE); // HW Error Handler (Int5)
68     [ P0 ++ ] = R0;
70 LD32_LABEL(r0, THANDLE);  // Timer Handler (Int6)
71     [ P0 ++ ] = R0;
73 LD32_LABEL(r0, I7HANDLE); // IVG7 Handler
74     [ P0 ++ ] = R0;
76 LD32_LABEL(r0, I8HANDLE); // IVG8 Handler
77     [ P0 ++ ] = R0;
79 LD32_LABEL(r0, I9HANDLE); // IVG9 Handler
80     [ P0 ++ ] = R0;
82 LD32_LABEL(r0, I10HANDLE);// IVG10 Handler
83     [ P0 ++ ] = R0;
85 LD32_LABEL(r0, I11HANDLE);// IVG11 Handler
86     [ P0 ++ ] = R0;
88 LD32_LABEL(r0, I12HANDLE);// IVG12 Handler
89     [ P0 ++ ] = R0;
91 LD32_LABEL(r0, I13HANDLE);// IVG13 Handler
92     [ P0 ++ ] = R0;
94 LD32_LABEL(r0, I14HANDLE);// IVG14 Handler
95     [ P0 ++ ] = R0;
97 LD32_LABEL(r0, I15HANDLE);// IVG15 Handler
98     [ P0 ++ ] = R0;
100 LD32(p0, EVT_OVERRIDE);
101     R0 = 0;
102     [ P0 ++ ] = R0;
103     R0 = -1;     // Change this to mask interrupts (*)
104     [ P0 ] = R0;   // IMASK
105 CSYNC;
107 DUMMY:
109     R0 = 0 (Z);
111 LT0 = r0;       // set loop counters to something deterministic
112 LB0 = r0;
113 LC0 = r0;
114 LT1 = r0;
115 LB1 = r0;
116 LC1 = r0;
118 ASTAT = r0;     // reset other internal regs
120 // The following code sets up the test for running in USER mode
122 LD32_LABEL(r0, STARTUSER);// One gets to user mode by doing a
123                         // ReturnFromInterrupt (RTI)
124 RETI = r0;      // We need to load the return address
126 // Comment the following line for a USER Mode test
128 JUMP    STARTSUP;   // jump to code start for SUPERVISOR mode
130 RTI;
132 STARTSUP:
133 LD32_LABEL(p1, BEGIN);
135 LD32(p0, EVT15);
136     [ P0 ] = P1;   // IVG15 (General) handler (Int 15) load with start
138 RAISE 15;   // after we RTI, INT 15 should be taken,& return to BEGIN in
139                 // SUPERVISOR MODE & go to different RAISE in supervisor mode
140                 // until the end of the test.
142 NOP;    // Workaround for Bug 217
143 RTI;
146 // The Main Program
148 STARTUSER:
149 LD32_LABEL(sp, USTACK);   // setup the stack pointer
150 FP = SP;            // set frame pointer
151 JUMP BEGIN;
153 //*********************************************************************
155 BEGIN:
157                 // COMMENT the following line for USER MODE tests
158     [ -- SP ] = RETI;  // enable interrupts in supervisor mode
160                 // **** YOUR CODE GOES HERE ****
164     // PUT YOUR TEST HERE!
165 // PUSH
166         R0 = 0x01;
167         R1 = 0x02;
168         R2 = 0x03;
169         R3 = 0x04;
170         R4 = 0x05;
171         R5 = 0x06;
172         R6 = 0x07;
173         R7 = 0x08;
174 LD32(p1, 0x12345678);
175 LD32(p2, 0x05612496);
176 LD32(p3, 0xab5fd490);
177 LD32(p4, 0xa581bd94);
180 RAISE 2;    // RTN
181     P1 = R1;
182     R2 = P1;
183         [ -- SP ] = ( R7:0 );
184         R1 = 0x12;
185         R2 = 0x13;
186         R3 = 0x14;
187         R4 = 0x15;
188         R5 = 0x16;
189         R6 = 0x17;
190         R7 = 0x18;
192 RAISE 5;    // RTI
193     P2 = R2;
194     R3 = P2;
196         [ -- SP ] = ( R7:1 );
198         R2 = 0x23;
199         R3 = 0x24;
200         R4 = 0x25;
201         R5 = 0x26;
202         R6 = 0x27;
203         R7 = 0x28;
205 RAISE 6;    // RTI
206     P3 = R3;
207     R4 = P3;
208         [ -- SP ] = ( R7:2 );
209 // POP
210         R0 = 0x00;
211         R1 = 0x00;
212         R2 = 0x00;
213         R3 = 0x00;
214         R4 = 0x00;
215         R5 = 0x00;
216         R6 = 0x00;
217         R7 = 0x00;
219 RAISE 7;    // RTI
220     P4 = R4;
221     R5 = P4;
222         ( R7:2 ) = [ SP ++ ];
226 CHECKREG(r0, 0x00000000);
227 CHECKREG(r1, 0x00000000);
228 CHECKREG(r2, 0x00000023);
229 CHECKREG(r3, 0x00000024);
230 CHECKREG(r4, 0x00000024);
231 CHECKREG(r5, 0x00000026);
232 CHECKREG(r6, 0x00000027);
233 CHECKREG(r7, 0x00000028);
235 RAISE 8;    // RTI
236     P1 = R1;
237     R5 = P1;
238         ( R7:1 ) = [ SP ++ ];
239 CHECKREG(r0, 0x00000000);
240 CHECKREG(r1, 0x00000012);
241 CHECKREG(r2, 0x00000013);
242 CHECKREG(r3, 0x00000013);
243 CHECKREG(r4, 0x00000015);
244 CHECKREG(r5, 0x00000016);
245 CHECKREG(r6, 0x00000017);
246 CHECKREG(r7, 0x00000018);
248 RAISE 9;    // RTI
249     P2 = R2;
250     R5 = P2;
251         ( R7:0 ) = [ SP ++ ];
253 CHECKREG(r0, 0x00000001);
254 CHECKREG(r1, 0x00000002);
255 CHECKREG(r2, 0x00000002);
256 CHECKREG(r3, 0x00000004);
257 CHECKREG(r4, 0x00000005);
258 CHECKREG(r5, 0x00000006);
259 CHECKREG(r6, 0x00000007);
260 CHECKREG(r7, 0x00000008);
261 R0 = I0;
262 R1 = I1;
263 R2 = I2;
264 R3 = I3;
265 CHECKREG(r0, 0x00000006);
266 CHECKREG(r1, 0x00000002);
267 CHECKREG(r2, 0x00000002);
268 CHECKREG(r3, 0x00000002);
271 END:
272 dbg_pass;            // End the test
274 //*********************************************************************
277 // Handlers for Events
280 EHANDLE:            // Emulation Handler 0
281 RTE;
283 RHANDLE:            // Reset Handler 1
284 RTI;
286 NHANDLE:            // NMI Handler 2
287     I0 += 2;
288 RTN;
290 XHANDLE:            // Exception Handler 3
291     R1 = 3;
292 RTX;
294 HWHANDLE:           // HW Error Handler 5
295     I1 += 2;
296 RTI;
298 THANDLE:            // Timer Handler 6
299     I2 += 2;
300 RTI;
302 I7HANDLE:           // IVG 7 Handler
303     I3 += 2;
304 RTI;
306 I8HANDLE:           // IVG 8 Handler
307     I0 += 2;
308 RTI;
310 I9HANDLE:           // IVG 9 Handler
311     I0 += 2;
312 RTI;
314 I10HANDLE:          // IVG 10 Handler
315     R7 = 10;
316 RTI;
318 I11HANDLE:          // IVG 11 Handler
319     I0 = R0;
320     I1 = R1;
321     I2 = R2;
322     I3 = R3;
323     M0 = R4;
324     R0 = 11;
325 RTI;
327 I12HANDLE:          // IVG 12 Handler
328     R1 = 12;
329 RTI;
331 I13HANDLE:          // IVG 13 Handler
332     R2 = 13;
333 RTI;
335 I14HANDLE:          // IVG 14 Handler
336     R3 = 14;
337 RTI;
339 I15HANDLE:          // IVG 15 Handler
340     R4 = 15;
341 RTI;
343 NOP;NOP;NOP;NOP;NOP;NOP;NOP; // needed for icache bug
346 // Data Segment
349 .data
350 DATA:
351     .space (0x10);
353 // Stack Segments (Both Kernel and User)
355     .space (STACKSIZE);
356 KSTACK:
358     .space (STACKSIZE);
359 USTACK: