Mercurial > pub > dyncall > dyncall
annotate dyncallback/dyncall_callback_riscv64.S @ 653:0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
- mark riscv64 as implemented in manual overview
author | Tassilo Philipp |
---|---|
date | Thu, 07 Mar 2024 17:42:13 +0100 (17 months ago) |
parents | |
children | b8969b7b4876 |
rev | line source |
---|---|
653
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
1 /* |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
2 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
3 Package: dyncall |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
4 Library: dyncallback |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
5 File: dyncallback/dyncall_callback_riscv64.S |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
6 Description: Callback Thunk - Implementation for RISCV64 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
7 License: |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
8 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
9 Copyright (c) 2023 Jun Jeon <yjeon@netflix.com> |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
10 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
11 Permission to use, copy, modify, and distribute this software for any |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
12 purpose with or without fee is hereby granted, provided that the above |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
13 copyright notice and this permission notice appear in all copies. |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
14 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
15 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
16 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
17 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
18 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
21 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
22 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
23 */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
24 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
25 /* struct DCCallback |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
26 type off size |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
27 ---------|------|------ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
28 DCThunk | 0 | 32 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
29 handler | 32 | 8 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
30 userdata | 40 | 8 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
31 */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
32 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
33 .align 4 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
34 .globl dcCallbackThunkEntry |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
35 dcCallbackThunkEntry: |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
36 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
37 /* called from dcbInitThunk() in dyncall_thunk_riscv64.c */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
38 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
39 /* input: |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
40 t5: DCCallback* pcb |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
41 a0..a7 ?? GP regs |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
42 fa0..fa7 ?? FP/SIMD regs |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
43 sp... ?? arguments on stack |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
44 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
45 locals: |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
46 type off size |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
47 ---------|------|------ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
48 Frame 0 16 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
49 DCArgs 16 144 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
50 DCValue 160 16 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
51 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
52 size 176 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
53 aligned 176 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
54 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
55 ra - ret addr |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
56 s0/fp - frame ptr |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
57 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
58 locals: |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
59 t0: orig sp |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
60 t1: DCArgs* args |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
61 */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
62 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
63 mv t0, sp |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
64 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
65 add sp, sp, -176 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
66 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
67 /* save ra and s0 */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
68 sd ra, 0(sp) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
69 sd s0, 8(sp) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
70 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
71 /* save frame ptr */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
72 mv s0, sp |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
73 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
74 add t1, s0, 16 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
75 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
76 /* just saving everything on stack, as defined in DCArgs in dyncall_args_riscv64.c */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
77 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
78 /* save regs */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
79 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
80 sd a0, 0(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
81 sd a1, 8(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
82 sd a2, 16(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
83 sd a3, 24(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
84 sd a4, 32(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
85 sd a5, 40(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
86 sd a6, 48(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
87 sd a7, 56(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
88 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
89 fsd fa0, 64(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
90 fsd fa1, 72(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
91 fsd fa2, 80(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
92 fsd fa3, 88(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
93 fsd fa4, 96(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
94 fsd fa5, 104(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
95 fsd fa6, 112(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
96 fsd fa7, 120(t1) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
97 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
98 sd t0, 128(t1) /* sp=sp */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
99 sd zero, 136(t1) /* i=f=0 */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
100 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
101 /* call handler/callback */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
102 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
103 mv a0, t5 /* DCCallback* pcb */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
104 add a1, s0, 16 /* DCArgs* args */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
105 add a2, s0, 160 /* DCValue* result */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
106 ld a3, 40(t5) /* void* userdata */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
107 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
108 ld t2, 32(t5) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
109 jalr ra, 0(t2) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
110 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
111 and t3, a0, 255 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
112 add t4, zero, 'f' /* single precition floats are sign extended on */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
113 beq t3, t4, .retf /* riscv with the D extension, handle specifically */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
114 add t4, zero, 'd' |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
115 beq t3, t4, .retd |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
116 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
117 .reti: |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
118 ld a0, 160(s0) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
119 j .ret |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
120 .retf: |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
121 flw fa0, 160(s0) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
122 j .ret |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
123 .retd: |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
124 fld fa0, 160(s0) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
125 .ret: |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
126 /* recover ra and s0 */ |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
127 ld ra, 0(sp) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
128 ld s0, 8(sp) |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
129 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
130 add sp, sp, 176 |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
131 ret |
0c8838766866
- riscv64 support for calls and callbacks (but lacking aggr and syscall support) - thanks Jun Jeon! :)
Tassilo Philipp
parents:
diff
changeset
|
132 |