1 # frv testcase to generate interrupt for st $GRk,@($GRi,$GRj)
3 .include "testutils.inc"
9 and_spr_immed -4081,tbr ; clear tbr.tt
11 inc_gr_immed 0x100,gr17 ; address of exception handler
16 set_gr_immed 0xdeadbeef,gr17
18 inc_gr_immed 2,sp ; out of alignment
20 test_spr_bits 1,0,1,isr ; mem_address_not_aligned is masked
21 sti gr17,@(sp,0) ; no exception
22 ldi @(sp,-2),gr18 ; stored at aligned address
23 test_gr_immed 0xdeadbeef,gr18
24 ldi @(sp,0),gr19 ; no exception
25 test_gr_immed 0xdeadbeef,gr19
27 and_spr_immed 0xfffffffe,isr ; turn off ISR.EMAM
29 bad1: sti gr17,@(sp,0) ; misaligned write in slot I1
35 set_gr_immed 0x10101010,gr10
37 bad3: ldu @(sp,gr21),gr10 ; misaligned read in slot I2
38 test_gr_immed 2,gr15 ; handler was called
39 test_gr_immed 0x10101010,gr10 ; gr10 not updated
40 test_gr_immed 1,gr21 ; gr21 not updated
42 test_gr_gr gr20,sp ; sp updated
50 ; handle interrupt on store
51 test_spr_immed 0x100,esfr1 ; esr8 is active
52 test_spr_gr epcr8,gr16
53 test_spr_bits 0x0001,0,0x1,esr8 ; esr8 is valid
54 test_spr_bits 0x003e,1,0xb,esr8 ; esr8.ec is set
55 test_spr_bits 0x0800,11,0x1,esr8 ; esr8.eav is set
57 test_spr_bits 0x01000,12,0x1,esr8 ; esr8.edv is set
58 test_spr_bits 0x1e000,13,0x3,esr8 ; esr8.edn is 3
59 test_spr_gr edr3,gr17 ; edr3 is set
62 ; handle interrupt on load
63 test_spr_immed 0x200,esfr1 ; esr9 is active
64 test_spr_gr epcr9,gr16
65 test_spr_bits 0x0001,0,0x1,esr9 ; esr9 is valid
66 test_spr_bits 0x003e,1,0xb,esr9 ; esr9.ec is set
67 test_spr_bits 0x0800,11,0x1,esr9 ; esr9.eav is set
69 test_spr_bits 0x1000,12,0x0,esr9 ; esr9.edv is not set