Mercurial > pub > dyncall > dyncall
comparison dyncall/dyncall_callvm_x64.c @ 341:ab2d78e48ca2
- gen-masm
. fallback on clang if gcc not available
. consolidated use of redundant scripts
. regen of portasm based masm files
- minor symbol name changes for clarity/consistency
author | Tassilo Philipp |
---|---|
date | Sat, 04 Jan 2020 23:00:02 +0100 |
parents | 4f9f49fb82ce |
children | a2a42f477662 |
comparison
equal
deleted
inserted
replaced
340:6e33db95e724 | 341:ab2d78e48ca2 |
---|---|
190 | 190 |
191 | 191 |
192 /* --- syscall ------------------------------------------------------------- */ | 192 /* --- syscall ------------------------------------------------------------- */ |
193 | 193 |
194 #include <assert.h> | 194 #include <assert.h> |
195 void dc_callvm_call_x64_sys_syscall_sysv(DCCallVM* in_self, DCpointer target) | 195 void dc_callvm_call_x64_syscall_sysv(DCCallVM* in_self, DCpointer target) |
196 { | 196 { |
197 /* syscalls can have up to 6 args, required to be "Only values of class INTEGER or class MEMORY" (from */ | 197 /* syscalls can have up to 6 args, required to be "Only values of class INTEGER or class MEMORY" (from */ |
198 /* SysV manual), so we can use self->mRegData.i directly; verify this holds at least 6 values, though. */ | 198 /* SysV manual), so we can use self->mRegData.i directly; verify this holds at least 6 values, though. */ |
199 assert(numIntRegs >= 6); | 199 assert(numIntRegs >= 6); |
200 | 200 |
201 DCCallVM_x64* self = (DCCallVM_x64*)in_self; | 201 DCCallVM_x64* self = (DCCallVM_x64*)in_self; |
202 dcCall_x64_sys_syscall_sysv(self->mRegData.i, target); | 202 dcCall_x64_syscall_sysv(self->mRegData.i, target); |
203 } | 203 } |
204 | 204 |
205 DCCallVM_vt gVT_x64_sys_syscall_sysv = | 205 DCCallVM_vt gVT_x64_syscall_sysv = |
206 { | 206 { |
207 &dc_callvm_free_x64 | 207 &dc_callvm_free_x64 |
208 , &dc_callvm_reset_x64 | 208 , &dc_callvm_reset_x64 |
209 , &dc_callvm_mode_x64 | 209 , &dc_callvm_mode_x64 |
210 , &dc_callvm_argBool_x64 | 210 , &dc_callvm_argBool_x64 |
215 , &dc_callvm_argLongLong_x64 | 215 , &dc_callvm_argLongLong_x64 |
216 , &dc_callvm_argFloat_x64 | 216 , &dc_callvm_argFloat_x64 |
217 , &dc_callvm_argDouble_x64 | 217 , &dc_callvm_argDouble_x64 |
218 , &dc_callvm_argPointer_x64 | 218 , &dc_callvm_argPointer_x64 |
219 , NULL /* argStruct */ | 219 , NULL /* argStruct */ |
220 , (DCvoidvmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 220 , (DCvoidvmfunc*) &dc_callvm_call_x64_syscall_sysv |
221 , (DCboolvmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 221 , (DCboolvmfunc*) &dc_callvm_call_x64_syscall_sysv |
222 , (DCcharvmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 222 , (DCcharvmfunc*) &dc_callvm_call_x64_syscall_sysv |
223 , (DCshortvmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 223 , (DCshortvmfunc*) &dc_callvm_call_x64_syscall_sysv |
224 , (DCintvmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 224 , (DCintvmfunc*) &dc_callvm_call_x64_syscall_sysv |
225 , (DClongvmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 225 , (DClongvmfunc*) &dc_callvm_call_x64_syscall_sysv |
226 , (DClonglongvmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 226 , (DClonglongvmfunc*) &dc_callvm_call_x64_syscall_sysv |
227 , (DCfloatvmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 227 , (DCfloatvmfunc*) &dc_callvm_call_x64_syscall_sysv |
228 , (DCdoublevmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 228 , (DCdoublevmfunc*) &dc_callvm_call_x64_syscall_sysv |
229 , (DCpointervmfunc*) &dc_callvm_call_x64_sys_syscall_sysv | 229 , (DCpointervmfunc*) &dc_callvm_call_x64_syscall_sysv |
230 , NULL /* callStruct */ | 230 , NULL /* callStruct */ |
231 }; | 231 }; |
232 | 232 |
233 | 233 |
234 | 234 |
251 vt = &gVT_x64; | 251 vt = &gVT_x64; |
252 break; | 252 break; |
253 case DC_CALL_SYS_DEFAULT: | 253 case DC_CALL_SYS_DEFAULT: |
254 # if defined DC_UNIX | 254 # if defined DC_UNIX |
255 case DC_CALL_SYS_X64_SYSCALL_SYSV: | 255 case DC_CALL_SYS_X64_SYSCALL_SYSV: |
256 vt = &gVT_x64_sys_syscall_sysv; break; | 256 vt = &gVT_x64_syscall_sysv; break; |
257 # else | 257 # else |
258 self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE; return; | 258 self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE; return; |
259 # endif | 259 # endif |
260 default: | 260 default: |
261 self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE; | 261 self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE; |