koffi 2.3.8 → 2.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE.txt +22 -165
  3. package/README.md +2 -2
  4. package/doc/index.rst +2 -2
  5. package/doc/static/custom.css +18 -10
  6. package/package.json +3 -3
  7. package/src/cnoke/LICENSE.txt +22 -165
  8. package/src/cnoke/assets/FindCNoke.cmake +18 -10
  9. package/src/cnoke/assets/win_delay_hook.c +18 -10
  10. package/src/cnoke/cnoke.js +18 -10
  11. package/src/cnoke/package.json +1 -1
  12. package/src/cnoke/src/builder.js +18 -10
  13. package/src/cnoke/src/index.js +18 -10
  14. package/src/cnoke/src/tools.js +18 -10
  15. package/src/core/libcc/libcc.cc +20 -12
  16. package/src/core/libcc/libcc.hh +20 -12
  17. package/src/koffi/CMakeLists.txt +27 -19
  18. package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_linux_arm32hf/koffi.node +0 -0
  19. package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_linux_arm64/koffi.node +0 -0
  20. package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_linux_ia32/koffi.node +0 -0
  21. package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_linux_riscv64hf64/koffi.node +0 -0
  22. package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_openbsd_ia32/koffi.node +0 -0
  23. package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_openbsd_x64/koffi.node +0 -0
  24. package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_win32_arm64/koffi.node +0 -0
  25. package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_win32_ia32/koffi.node +0 -0
  26. package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_win32_x64/koffi.node +0 -0
  27. package/src/koffi/src/abi_arm32.cc +19 -11
  28. package/src/koffi/src/abi_arm32_asm.S +211 -0
  29. package/src/koffi/src/abi_arm64.cc +19 -11
  30. package/src/koffi/src/abi_arm64_asm.S +238 -0
  31. package/src/koffi/src/abi_arm64_asm.asm +207 -0
  32. package/src/koffi/src/abi_riscv64.cc +19 -11
  33. package/src/koffi/src/abi_riscv64_asm.S +239 -0
  34. package/src/koffi/src/abi_x64_sysv.cc +19 -11
  35. package/src/koffi/src/abi_x64_sysv_asm.S +272 -0
  36. package/src/koffi/src/abi_x64_win.cc +19 -11
  37. package/src/koffi/src/abi_x64_win_asm.asm +203 -0
  38. package/src/koffi/src/abi_x86.cc +19 -11
  39. package/src/koffi/src/abi_x86_asm.S +213 -0
  40. package/src/koffi/src/abi_x86_asm.asm +191 -0
  41. package/src/koffi/src/call.cc +18 -10
  42. package/src/koffi/src/call.hh +18 -10
  43. package/src/koffi/src/ffi.cc +18 -10
  44. package/src/koffi/src/ffi.hh +18 -10
  45. package/src/koffi/src/index.d.ts +22 -14
  46. package/src/koffi/src/index.js +18 -10
  47. package/src/koffi/src/parser.cc +18 -10
  48. package/src/koffi/src/parser.hh +18 -10
  49. package/src/koffi/src/{abi_arm64_fwd.asm → trampolines/armasm.inc} +18 -193
  50. package/src/koffi/src/{abi_arm64_fwd.S → trampolines/gnu.inc} +18 -226
  51. package/src/koffi/src/{abi_x86_fwd.asm → trampolines/masm32.inc} +1042 -1203
  52. package/src/koffi/src/{abi_x64_win_fwd.asm → trampolines/masm64.inc} +1042 -1215
  53. package/src/koffi/src/{abi_trampolines.inc → trampolines/prototypes.inc} +18 -10
  54. package/src/koffi/src/util.cc +18 -10
  55. package/src/koffi/src/util.hh +18 -10
  56. package/src/koffi/src/win32.hh +18 -10
  57. package/src/koffi/src/abi_arm32_fwd.S +0 -6344
  58. package/src/koffi/src/abi_riscv64_fwd.S +0 -6375
  59. package/src/koffi/src/abi_x64_sysv_fwd.S +0 -6410
  60. package/src/koffi/src/abi_x86_fwd.S +0 -6346
  61. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_darwin_arm64/koffi.node +0 -0
  62. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_darwin_x64/koffi.node +0 -0
  63. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_freebsd_arm64/koffi.node +0 -0
  64. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_freebsd_ia32/koffi.node +0 -0
  65. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_freebsd_x64/koffi.node +0 -0
  66. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_linux_x64/koffi.node +0 -0
  67. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_win32_arm64/koffi.exp +0 -0
  68. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_win32_arm64/koffi.lib +0 -0
  69. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_win32_ia32/koffi.exp +0 -0
  70. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_win32_ia32/koffi.lib +0 -0
  71. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_win32_x64/koffi.exp +0 -0
  72. /package/src/koffi/build/{2.3.8 → 2.3.9}/koffi_win32_x64/koffi.lib +0 -0
@@ -0,0 +1,238 @@
1
+ # Copyright 2023 Niels Martignène <niels.martignene@protonmail.com>
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ # this software and associated documentation files (the “Software”), to deal in
5
+ # the Software without restriction, including without limitation the rights to use,
6
+ # copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ # Software, and to permit persons to whom the Software is furnished to do so,
8
+ # subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
14
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ # OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ #ifdef __APPLE__
23
+ #define SYMBOL(Symbol) _ ## Symbol
24
+ #else
25
+ #define SYMBOL(Symbol) Symbol
26
+ #endif
27
+
28
+ # Forward
29
+ # ----------------------------
30
+
31
+ #ifdef __APPLE__
32
+ # Fix "arm64 function not 4-byte aligned" linker warnings
33
+ .p2align 2
34
+ #endif
35
+
36
+ # These three are the same, but they differ (in the C side) by their return type.
37
+ # Unlike the three next functions, these ones don't forward XMM argument registers.
38
+ .global SYMBOL(ForwardCallGG)
39
+ .global SYMBOL(ForwardCallF)
40
+ .global SYMBOL(ForwardCallDDDD)
41
+
42
+ # The X variants are slightly slower, and are used when XMM arguments must be forwarded.
43
+ .global SYMBOL(ForwardCallXGG)
44
+ .global SYMBOL(ForwardCallXF)
45
+ .global SYMBOL(ForwardCallXDDDD)
46
+
47
+ # Copy function pointer to r9, in order to save it through argument forwarding.
48
+ # Also make a copy of the SP to CallData::old_sp because the callback system might need it.
49
+ # Save RSP in r29 (non-volatile), and use carefully assembled stack provided by caller.
50
+ .macro prologue
51
+ .cfi_startproc
52
+ hint #34
53
+ stp x29, x30, [sp, -16]!
54
+ .cfi_def_cfa sp, 16
55
+ .cfi_offset 29, 16
56
+ .cfi_offset 30, 8
57
+ mov x29, sp
58
+ .cfi_def_cfa x29, 16
59
+ str x29, [x2, 0]
60
+ mov x9, x0
61
+ add sp, x1, #136
62
+ .endm
63
+
64
+ # Call native function.
65
+ # Once done, restore normal stack pointer and return.
66
+ # The return value is passed untouched through r0, r1, v0 and/or v1.
67
+ .macro epilogue
68
+ blr x9
69
+ mov sp, x29
70
+ .cfi_def_cfa sp, 16
71
+ ldp x29, x30, [sp], 16
72
+ .cfi_def_cfa sp, 0
73
+ .cfi_restore 30
74
+ .cfi_restore 29
75
+ ret
76
+ .cfi_endproc
77
+ .endm
78
+
79
+ # Prepare general purpose argument registers from array passed by caller.
80
+ .macro forward_gpr
81
+ ldr x8, [x1, 64]
82
+ ldp x6, x7, [x1, 48]
83
+ ldp x4, x5, [x1, 32]
84
+ ldp x2, x3, [x1, 16]
85
+ ldp x0, x1, [x1, 0]
86
+ .endm
87
+
88
+ # Prepare vector argument registers from array passed by caller.
89
+ .macro forward_vec
90
+ ldp d6, d7, [x1, 120]
91
+ ldp d4, d5, [x1, 104]
92
+ ldp d2, d3, [x1, 88]
93
+ ldp d0, d1, [x1, 72]
94
+ .endm
95
+
96
+ SYMBOL(ForwardCallGG):
97
+ prologue
98
+ forward_gpr
99
+ epilogue
100
+
101
+ SYMBOL(ForwardCallF):
102
+ prologue
103
+ forward_gpr
104
+ epilogue
105
+
106
+ SYMBOL(ForwardCallDDDD):
107
+ prologue
108
+ forward_gpr
109
+ epilogue
110
+
111
+ SYMBOL(ForwardCallXGG):
112
+ prologue
113
+ forward_vec
114
+ forward_gpr
115
+ epilogue
116
+
117
+ SYMBOL(ForwardCallXF):
118
+ prologue
119
+ forward_vec
120
+ forward_gpr
121
+ epilogue
122
+
123
+ SYMBOL(ForwardCallXDDDD):
124
+ prologue
125
+ forward_vec
126
+ forward_gpr
127
+ epilogue
128
+
129
+ # Callbacks
130
+ # ----------------------------
131
+
132
+ .global SYMBOL(RelayCallback)
133
+ .global SYMBOL(CallSwitchStack)
134
+
135
+ # First, make a copy of the GPR argument registers (x0 to x7).
136
+ # Then call the C function RelayCallback with the following arguments:
137
+ # static trampoline ID, a pointer to the saved GPR array, a pointer to the stack
138
+ # arguments of this call, and a pointer to a struct that will contain the result registers.
139
+ # After the call, simply load these registers from the output struct.
140
+ .macro trampoline id
141
+ .cfi_startproc
142
+ hint #34
143
+ stp x29, x30, [sp, -16]!
144
+ .cfi_def_cfa sp, 16
145
+ .cfi_offset 29, 16
146
+ .cfi_offset 30, 8
147
+ sub sp, sp, #192
148
+ .cfi_def_cfa sp, 208
149
+ stp x0, x1, [sp, 0]
150
+ stp x2, x3, [sp, 16]
151
+ stp x4, x5, [sp, 32]
152
+ stp x6, x7, [sp, 48]
153
+ str x8, [sp, 64]
154
+ mov x0, \id
155
+ mov x1, sp
156
+ add x2, sp, #208
157
+ add x3, sp, #136
158
+ bl SYMBOL(RelayCallback)
159
+ ldp x0, x1, [sp, 136]
160
+ add sp, sp, #192
161
+ .cfi_def_cfa sp, 16
162
+ ldp x29, x30, [sp], 16
163
+ .cfi_def_cfa sp, 0
164
+ .cfi_restore 30
165
+ .cfi_restore 29
166
+ ret
167
+ .cfi_endproc
168
+ .endm
169
+
170
+ # Same thing, but also forwards the floating-point argument registers and loads them at the end.
171
+ .macro trampoline_vec id
172
+ .cfi_startproc
173
+ hint #34
174
+ stp x29, x30, [sp, -16]!
175
+ .cfi_def_cfa sp, 16
176
+ .cfi_offset 29, 16
177
+ .cfi_offset 30, 8
178
+ sub sp, sp, #192
179
+ .cfi_def_cfa sp, 208
180
+ stp x0, x1, [sp, 0]
181
+ stp x2, x3, [sp, 16]
182
+ stp x4, x5, [sp, 32]
183
+ stp x6, x7, [sp, 48]
184
+ str x8, [sp, 64]
185
+ stp d0, d1, [sp, 72]
186
+ stp d2, d3, [sp, 88]
187
+ stp d4, d5, [sp, 104]
188
+ stp d6, d7, [sp, 120]
189
+ mov x0, \id
190
+ mov x1, sp
191
+ add x2, sp, #208
192
+ add x3, sp, #136
193
+ bl SYMBOL(RelayCallback)
194
+ ldp x0, x1, [sp, 136]
195
+ ldp d0, d1, [sp, 152]
196
+ ldp d2, d3, [sp, 168]
197
+ add sp, sp, #192
198
+ .cfi_def_cfa sp, 16
199
+ ldp x29, x30, [sp], 16
200
+ .cfi_def_cfa sp, 0
201
+ .cfi_restore 30
202
+ .cfi_restore 29
203
+ ret
204
+ .cfi_endproc
205
+ .endm
206
+
207
+ # When a callback is relayed, Koffi will call into Node.js and V8 to execute Javascript.
208
+ # The problem is that we're still running on the separate Koffi stack, and V8 will
209
+ # probably misdetect this as a "stack overflow". We have to restore the old
210
+ # stack pointer, call Node.js/V8 and go back to ours.
211
+ # The first three parameters (x0, x1, x2) are passed through untouched.
212
+ SYMBOL(CallSwitchStack):
213
+ .cfi_startproc
214
+ hint #34
215
+ stp x29, x30, [sp, -16]!
216
+ .cfi_def_cfa sp, 16
217
+ .cfi_offset 29, 16
218
+ .cfi_offset 30, 8
219
+ mov x29, sp
220
+ ldr x9, [x4, 0]
221
+ sub x9, sp, x9
222
+ and x9, x9, #-16
223
+ str x9, [x4, 8]
224
+ mov sp, x3
225
+ blr x5
226
+ mov sp, x29
227
+ .cfi_def_cfa sp, 16
228
+ ldp x29, x30, [sp], 16
229
+ .cfi_def_cfa sp, 0
230
+ .cfi_restore 30
231
+ .cfi_restore 29
232
+ ret
233
+ .cfi_endproc
234
+
235
+ # Trampolines
236
+ # ----------------------------
237
+
238
+ #include "trampolines/gnu.inc"
@@ -0,0 +1,207 @@
1
+ ; Copyright 2023 Niels Martignène <niels.martignene@protonmail.com>
2
+ ;
3
+ ; Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ ; this software and associated documentation files (the “Software”), to deal in
5
+ ; the Software without restriction, including without limitation the rights to use,
6
+ ; copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ ; Software, and to permit persons to whom the Software is furnished to do so,
8
+ ; subject to the following conditions:
9
+ ;
10
+ ; The above copyright notice and this permission notice shall be included in all
11
+ ; copies or substantial portions of the Software.
12
+ ;
13
+ ; THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
14
+ ; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ ; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ ; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ ; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ ; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ ; OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ AREA |.text|, CODE
23
+
24
+ ; Forward
25
+ ; ----------------------------
26
+
27
+ ; These three are the same, but they differ (in the C side) by their return type.
28
+ ; Unlike the three next functions, these ones don't forward XMM argument registers.
29
+ EXPORT ForwardCallGG
30
+ EXPORT ForwardCallF
31
+ EXPORT ForwardCallDDDD
32
+
33
+ ; The X variants are slightly slower, and are used when XMM arguments must be forwarded.
34
+ EXPORT ForwardCallXGG
35
+ EXPORT ForwardCallXF
36
+ EXPORT ForwardCallXDDDD
37
+
38
+ ; Copy function pointer to r9, in order to save it through argument forwarding.
39
+ ; Save RSP in r29 (non-volatile), and use carefully assembled stack provided by caller.
40
+ MACRO
41
+ prologue
42
+
43
+ stp x29, x30, [sp, -16]!
44
+ mov x29, sp
45
+ str x29, [x2, 0]
46
+ mov x9, x0
47
+ add sp, x1, #136
48
+ MEND
49
+
50
+ ; Call native function.
51
+ ; Once done, restore normal stack pointer and return.
52
+ ; The return value is passed untouched through r0, r1, v0 and/or v1.
53
+ MACRO
54
+ epilogue
55
+
56
+ blr x9
57
+ mov sp, x29
58
+ ldp x29, x30, [sp], 16
59
+ ret
60
+ MEND
61
+
62
+ ; Prepare general purpose argument registers from array passed by caller.
63
+ MACRO
64
+ forward_gpr
65
+
66
+ ldr x8, [x1, 64]
67
+ ldp x6, x7, [x1, 48]
68
+ ldp x4, x5, [x1, 32]
69
+ ldp x2, x3, [x1, 16]
70
+ ldp x0, x1, [x1, 0]
71
+ MEND
72
+
73
+ ; Prepare vector argument registers from array passed by caller.
74
+ MACRO
75
+ forward_vec
76
+
77
+ ldp d6, d7, [x1, 120]
78
+ ldp d4, d5, [x1, 104]
79
+ ldp d2, d3, [x1, 88]
80
+ ldp d0, d1, [x1, 72]
81
+ MEND
82
+
83
+ ForwardCallGG PROC
84
+ prologue
85
+ forward_gpr
86
+ epilogue
87
+ ENDP
88
+
89
+ ForwardCallF PROC
90
+ prologue
91
+ forward_gpr
92
+ epilogue
93
+ ENDP
94
+
95
+ ForwardCallDDDD PROC
96
+ prologue
97
+ forward_gpr
98
+ epilogue
99
+ ENDP
100
+
101
+ ForwardCallXGG PROC
102
+ prologue
103
+ forward_vec
104
+ forward_gpr
105
+ epilogue
106
+ ENDP
107
+
108
+ ForwardCallXF PROC
109
+ prologue
110
+ forward_vec
111
+ forward_gpr
112
+ epilogue
113
+ ENDP
114
+
115
+ ForwardCallXDDDD PROC
116
+ prologue
117
+ forward_vec
118
+ forward_gpr
119
+ epilogue
120
+ ENDP
121
+
122
+ ; Callbacks
123
+ ; ----------------------------
124
+
125
+ EXPORT RelayCallback
126
+ EXTERN RelayCallback
127
+ EXPORT CallSwitchStack
128
+
129
+ ; First, make a copy of the GPR argument registers (x0 to x7).
130
+ ; Then call the C function RelayCallback with the following arguments:
131
+ ; static trampoline ID, a pointer to the saved GPR array, a pointer to the stack
132
+ ; arguments of this call, and a pointer to a struct that will contain the result registers.
133
+ ; After the call, simply load these registers from the output struct.
134
+ MACRO
135
+ trampoline $ID
136
+
137
+ stp x29, x30, [sp, -16]!
138
+ sub sp, sp, #192
139
+ stp x0, x1, [sp, 0]
140
+ stp x2, x3, [sp, 16]
141
+ stp x4, x5, [sp, 32]
142
+ stp x6, x7, [sp, 48]
143
+ str x8, [sp, 64]
144
+ mov x0, $ID
145
+ mov x1, sp
146
+ add x2, sp, #208
147
+ add x3, sp, #136
148
+ bl RelayCallback
149
+ ldp x0, x1, [sp, 136]
150
+ add sp, sp, #192
151
+ ldp x29, x30, [sp], 16
152
+ ret
153
+ MEND
154
+
155
+ ; Same thing, but also forwards the floating-point argument registers and loads them at the end.
156
+ MACRO
157
+ trampoline_vec $ID
158
+
159
+ stp x29, x30, [sp, -16]!
160
+ sub sp, sp, #192
161
+ stp x0, x1, [sp, 0]
162
+ stp x2, x3, [sp, 16]
163
+ stp x4, x5, [sp, 32]
164
+ stp x6, x7, [sp, 48]
165
+ str x8, [sp, 64]
166
+ stp d0, d1, [sp, 72]
167
+ stp d2, d3, [sp, 88]
168
+ stp d4, d5, [sp, 104]
169
+ stp d6, d7, [sp, 120]
170
+ mov x0, $ID
171
+ mov x1, sp
172
+ add x2, sp, #208
173
+ add x3, sp, #136
174
+ bl RelayCallback
175
+ ldp x0, x1, [sp, 136]
176
+ ldp d0, d1, [sp, 152]
177
+ ldp d2, d3, [sp, 168]
178
+ add sp, sp, #192
179
+ ldp x29, x30, [sp], 16
180
+ ret
181
+ MEND
182
+
183
+ ; When a callback is relayed, Koffi will call into Node.js and V8 to execute Javascript.
184
+ ; The problem is that we're still running on the separate Koffi stack, and V8 will
185
+ ; probably misdetect this as a "stack overflow". We have to restore the old
186
+ ; stack pointer, call Node.js/V8 and go back to ours.
187
+ ; The first three parameters (x0, x1, x2) are passed through untouched.
188
+ CallSwitchStack PROC
189
+ stp x29, x30, [sp, -16]!
190
+ mov x29, sp
191
+ ldr x9, [x4, 0]
192
+ sub x9, sp, x9
193
+ and x9, x9, #-16
194
+ str x9, [x4, 8]
195
+ mov sp, x3
196
+ blr x5
197
+ mov sp, x29
198
+ ldp x29, x30, [sp], 16
199
+ ret
200
+ ENDP
201
+
202
+ ; Trampolines
203
+ ; ----------------------------
204
+
205
+ INCLUDE trampolines/armasm.inc
206
+
207
+ END
@@ -1,15 +1,23 @@
1
- // This program is free software: you can redistribute it and/or modify
2
- // it under the terms of the GNU Lesser General Public License as published by
3
- // the Free Software Foundation, either version 3 of the License, or
4
- // (at your option) any later version.
1
+ // Copyright 2023 Niels Martignène <niels.martignene@protonmail.com>
5
2
  //
6
- // This program is distributed in the hope that it will be useful,
7
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
8
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
- // GNU Lesser General Public License for more details.
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ // this software and associated documentation files (the “Software”), to deal in
5
+ // the Software without restriction, including without limitation the rights to use,
6
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ // Software, and to permit persons to whom the Software is furnished to do so,
8
+ // subject to the following conditions:
10
9
  //
11
- // You should have received a copy of the GNU Lesser General Public License
12
- // along with this program. If not, see https://www.gnu.org/licenses/.
10
+ // The above copyright notice and this permission notice shall be included in all
11
+ // copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
14
+ // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ // OTHER DEALINGS IN THE SOFTWARE.
13
21
 
14
22
  #if __riscv_xlen == 64
15
23
 
@@ -62,7 +70,7 @@ extern "C" napi_value CallSwitchStack(Napi::Function *func, size_t argc, napi_va
62
70
  uint8_t *old_sp, Span<uint8_t> *new_stack,
63
71
  napi_value (*call)(Napi::Function *func, size_t argc, napi_value *argv));
64
72
 
65
- #include "abi_trampolines.inc"
73
+ #include "trampolines/prototypes.inc"
66
74
 
67
75
  static inline void ExpandPair(const uint8_t raw[16], int size1, int size2, uint64_t out_regs[2])
68
76
  {