aboutsummaryrefslogtreecommitdiff
path: root/ci-tests/snippy-tests/boot-code.s
blob: 9dfae537a70451c68c85440654e6e1493996b201 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.option norvc
.global _entry
.global fromhost
.global tohost
.text
_entry:
  la t0, exception_handler
  csrw mtvec, t0
  la t0, SNIPPY_ENTRY
  jalr t0
  j exit
exception_handler:
  csrr x10, mcause
# In case of breakpoint (Interrupt = 0, Exception code = 3) we finalize.
# Otherwise it's not the expected behavior and we go into an infinite loop.
  li x11, 3
  beq x10, x11, exit
  j infinite_loop
exit:
  li ra, 1
  la sp, tohost
  sw ra, 0(sp)
infinite_loop:
  j infinite_loop
.balign 64
tohost:
.8byte 0x0
fromhost:
.8byte 0x0