Mercurial > pub > dyncall > dyncall
comparison dyncall/dyncall_callvm_x86.c @ 533:71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
* integration of aggregate-by-value (struct, union) support patch for x64 (win and sysv)
* windows/x64 asm additions to specify how stack unwinds (help for debuggers, exception handling, etc.)
* see Changelog for details
- new calling convention modes for thiscalls (platform agnostic, was specific before)
* new signature character for platform agnostic thiscalls ('*' / DC_SIGCHAR_CC_THISCALL)
- dcCallF(), dcVCallF(), dcArgF() and dcVArgF():
* added support for aggregates-by-value (wasn't part of patch)
* change that those functions don't implicitly call dcReset() anymore, which was unflexible (breaking change)
- added macros to feature test implementation for aggregate-by-value and syscall support
- changed libdyncall_s.lib and libdyncallback_s.lib order in callback test makefiles, as some toolchains are picky about order
- doc:
* man page updates to describe aggregate interface
* manual overview changes to highlight platforms with aggregate-by-value support
- test/plain: replaced tests w/ old/stale sctruct interface with new aggregate one
author | Tassilo Philipp |
---|---|
date | Thu, 21 Apr 2022 13:35:47 +0200 |
parents | ddfb9577a00e |
children | 5d999f5c13d1 |
comparison
equal
deleted
inserted
replaced
532:d4bf63ab9164 | 533:71c884e610f0 |
---|---|
176 , &dc_callvm_argLong_x86 | 176 , &dc_callvm_argLong_x86 |
177 , &dc_callvm_argLongLong_x86 | 177 , &dc_callvm_argLongLong_x86 |
178 , &dc_callvm_argFloat_x86 | 178 , &dc_callvm_argFloat_x86 |
179 , &dc_callvm_argDouble_x86 | 179 , &dc_callvm_argDouble_x86 |
180 , &dc_callvm_argPointer_x86 | 180 , &dc_callvm_argPointer_x86 |
181 , NULL /* argStruct */ | 181 , NULL /* argAggr */ |
182 , (DCvoidvmfunc*) &dc_callvm_call_x86_plan9 | 182 , (DCvoidvmfunc*) &dc_callvm_call_x86_plan9 |
183 , (DCboolvmfunc*) &dc_callvm_call_x86_plan9 | 183 , (DCboolvmfunc*) &dc_callvm_call_x86_plan9 |
184 , (DCcharvmfunc*) &dc_callvm_call_x86_plan9 | 184 , (DCcharvmfunc*) &dc_callvm_call_x86_plan9 |
185 , (DCshortvmfunc*) &dc_callvm_call_x86_plan9 | 185 , (DCshortvmfunc*) &dc_callvm_call_x86_plan9 |
186 , (DCintvmfunc*) &dc_callvm_call_x86_plan9 | 186 , (DCintvmfunc*) &dc_callvm_call_x86_plan9 |
187 , (DClongvmfunc*) &dc_callvm_call_x86_plan9 | 187 , (DClongvmfunc*) &dc_callvm_call_x86_plan9 |
188 , (DClonglongvmfunc*) &dc_callvm_call_x86_plan9_ll | 188 , (DClonglongvmfunc*) &dc_callvm_call_x86_plan9_ll |
189 , (DCfloatvmfunc*) &dc_callvm_call_x86_plan9 | 189 , (DCfloatvmfunc*) &dc_callvm_call_x86_plan9 |
190 , (DCdoublevmfunc*) &dc_callvm_call_x86_plan9 | 190 , (DCdoublevmfunc*) &dc_callvm_call_x86_plan9 |
191 , (DCpointervmfunc*) &dc_callvm_call_x86_plan9 | 191 , (DCpointervmfunc*) &dc_callvm_call_x86_plan9 |
192 , NULL /* callStruct */ | 192 , NULL /* callAggr */ |
193 , NULL /* beginAggr */ | |
193 }; | 194 }; |
194 | 195 |
195 | 196 |
196 #else | 197 #else |
197 | 198 |
216 , &dc_callvm_argLong_x86 | 217 , &dc_callvm_argLong_x86 |
217 , &dc_callvm_argLongLong_x86 | 218 , &dc_callvm_argLongLong_x86 |
218 , &dc_callvm_argFloat_x86 | 219 , &dc_callvm_argFloat_x86 |
219 , &dc_callvm_argDouble_x86 | 220 , &dc_callvm_argDouble_x86 |
220 , &dc_callvm_argPointer_x86 | 221 , &dc_callvm_argPointer_x86 |
221 , NULL /* argStruct */ | 222 , NULL /* argAggr */ |
222 , (DCvoidvmfunc*) &dc_callvm_call_x86_cdecl | 223 , (DCvoidvmfunc*) &dc_callvm_call_x86_cdecl |
223 , (DCboolvmfunc*) &dc_callvm_call_x86_cdecl | 224 , (DCboolvmfunc*) &dc_callvm_call_x86_cdecl |
224 , (DCcharvmfunc*) &dc_callvm_call_x86_cdecl | 225 , (DCcharvmfunc*) &dc_callvm_call_x86_cdecl |
225 , (DCshortvmfunc*) &dc_callvm_call_x86_cdecl | 226 , (DCshortvmfunc*) &dc_callvm_call_x86_cdecl |
226 , (DCintvmfunc*) &dc_callvm_call_x86_cdecl | 227 , (DCintvmfunc*) &dc_callvm_call_x86_cdecl |
227 , (DClongvmfunc*) &dc_callvm_call_x86_cdecl | 228 , (DClongvmfunc*) &dc_callvm_call_x86_cdecl |
228 , (DClonglongvmfunc*) &dc_callvm_call_x86_cdecl | 229 , (DClonglongvmfunc*) &dc_callvm_call_x86_cdecl |
229 , (DCfloatvmfunc*) &dc_callvm_call_x86_cdecl | 230 , (DCfloatvmfunc*) &dc_callvm_call_x86_cdecl |
230 , (DCdoublevmfunc*) &dc_callvm_call_x86_cdecl | 231 , (DCdoublevmfunc*) &dc_callvm_call_x86_cdecl |
231 , (DCpointervmfunc*) &dc_callvm_call_x86_cdecl | 232 , (DCpointervmfunc*) &dc_callvm_call_x86_cdecl |
232 , NULL /* callStruct */ | 233 , NULL /* callAggr */ |
234 , NULL /* beginAggr */ | |
233 }; | 235 }; |
234 | 236 |
235 | 237 |
236 | 238 |
237 /* --- stdcall -------------------------------------------------------------- */ | 239 /* --- stdcall -------------------------------------------------------------- */ |
258 , &dc_callvm_argLong_x86 | 260 , &dc_callvm_argLong_x86 |
259 , &dc_callvm_argLongLong_x86 | 261 , &dc_callvm_argLongLong_x86 |
260 , &dc_callvm_argFloat_x86 | 262 , &dc_callvm_argFloat_x86 |
261 , &dc_callvm_argDouble_x86 | 263 , &dc_callvm_argDouble_x86 |
262 , &dc_callvm_argPointer_x86 | 264 , &dc_callvm_argPointer_x86 |
263 , NULL /* argStruct */ | 265 , NULL /* argAggr */ |
264 , (DCvoidvmfunc*) &dc_callvm_call_x86_win32_std | 266 , (DCvoidvmfunc*) &dc_callvm_call_x86_win32_std |
265 , (DCboolvmfunc*) &dc_callvm_call_x86_win32_std | 267 , (DCboolvmfunc*) &dc_callvm_call_x86_win32_std |
266 , (DCcharvmfunc*) &dc_callvm_call_x86_win32_std | 268 , (DCcharvmfunc*) &dc_callvm_call_x86_win32_std |
267 , (DCshortvmfunc*) &dc_callvm_call_x86_win32_std | 269 , (DCshortvmfunc*) &dc_callvm_call_x86_win32_std |
268 , (DCintvmfunc*) &dc_callvm_call_x86_win32_std | 270 , (DCintvmfunc*) &dc_callvm_call_x86_win32_std |
269 , (DClongvmfunc*) &dc_callvm_call_x86_win32_std | 271 , (DClongvmfunc*) &dc_callvm_call_x86_win32_std |
270 , (DClonglongvmfunc*) &dc_callvm_call_x86_win32_std | 272 , (DClonglongvmfunc*) &dc_callvm_call_x86_win32_std |
271 , (DCfloatvmfunc*) &dc_callvm_call_x86_win32_std | 273 , (DCfloatvmfunc*) &dc_callvm_call_x86_win32_std |
272 , (DCdoublevmfunc*) &dc_callvm_call_x86_win32_std | 274 , (DCdoublevmfunc*) &dc_callvm_call_x86_win32_std |
273 , (DCpointervmfunc*) &dc_callvm_call_x86_win32_std | 275 , (DCpointervmfunc*) &dc_callvm_call_x86_win32_std |
274 , NULL /* callStruct */ | 276 , NULL /* callAggr */ |
277 , NULL /* beginAggr */ | |
275 }; | 278 }; |
276 | 279 |
277 | 280 |
278 /* --- fastcall common (ms/gnu) -------------------------------------------- */ | 281 /* --- fastcall common (ms/gnu) -------------------------------------------- */ |
279 | 282 |
363 , &dc_callvm_argLong_x86_win32_fast_ms | 366 , &dc_callvm_argLong_x86_win32_fast_ms |
364 , &dc_callvm_argLongLong_x86 | 367 , &dc_callvm_argLongLong_x86 |
365 , &dc_callvm_argFloat_x86 | 368 , &dc_callvm_argFloat_x86 |
366 , &dc_callvm_argDouble_x86 | 369 , &dc_callvm_argDouble_x86 |
367 , &dc_callvm_argPointer_x86_win32_fast_ms | 370 , &dc_callvm_argPointer_x86_win32_fast_ms |
368 , NULL /* argStruct */ | 371 , NULL /* argAggr */ |
369 , (DCvoidvmfunc*) &dc_callvm_call_x86_win32_fast | 372 , (DCvoidvmfunc*) &dc_callvm_call_x86_win32_fast |
370 , (DCboolvmfunc*) &dc_callvm_call_x86_win32_fast | 373 , (DCboolvmfunc*) &dc_callvm_call_x86_win32_fast |
371 , (DCcharvmfunc*) &dc_callvm_call_x86_win32_fast | 374 , (DCcharvmfunc*) &dc_callvm_call_x86_win32_fast |
372 , (DCshortvmfunc*) &dc_callvm_call_x86_win32_fast | 375 , (DCshortvmfunc*) &dc_callvm_call_x86_win32_fast |
373 , (DCintvmfunc*) &dc_callvm_call_x86_win32_fast | 376 , (DCintvmfunc*) &dc_callvm_call_x86_win32_fast |
374 , (DClongvmfunc*) &dc_callvm_call_x86_win32_fast | 377 , (DClongvmfunc*) &dc_callvm_call_x86_win32_fast |
375 , (DClonglongvmfunc*) &dc_callvm_call_x86_win32_fast | 378 , (DClonglongvmfunc*) &dc_callvm_call_x86_win32_fast |
376 , (DCfloatvmfunc*) &dc_callvm_call_x86_win32_fast | 379 , (DCfloatvmfunc*) &dc_callvm_call_x86_win32_fast |
377 , (DCdoublevmfunc*) &dc_callvm_call_x86_win32_fast | 380 , (DCdoublevmfunc*) &dc_callvm_call_x86_win32_fast |
378 , (DCpointervmfunc*) &dc_callvm_call_x86_win32_fast | 381 , (DCpointervmfunc*) &dc_callvm_call_x86_win32_fast |
379 , NULL /* callStruct */ | 382 , NULL /* callAggr */ |
383 , NULL /* beginAggr */ | |
380 }; | 384 }; |
381 | 385 |
382 | 386 |
383 /* --- gnu fastcall -------------------------------------------------------- */ | 387 /* --- gnu fastcall -------------------------------------------------------- */ |
384 | 388 |
457 , &dc_callvm_argLong_x86_win32_fast_gnu | 461 , &dc_callvm_argLong_x86_win32_fast_gnu |
458 , &dc_callvm_argLongLong_x86_win32_fast_gnu | 462 , &dc_callvm_argLongLong_x86_win32_fast_gnu |
459 , &dc_callvm_argFloat_x86 | 463 , &dc_callvm_argFloat_x86 |
460 , &dc_callvm_argDouble_x86 | 464 , &dc_callvm_argDouble_x86 |
461 , &dc_callvm_argPointer_x86_win32_fast_gnu | 465 , &dc_callvm_argPointer_x86_win32_fast_gnu |
462 , NULL /* argStruct */ | 466 , NULL /* argAggr */ |
463 , (DCvoidvmfunc*) &dc_callvm_call_x86_win32_fast | 467 , (DCvoidvmfunc*) &dc_callvm_call_x86_win32_fast |
464 , (DCboolvmfunc*) &dc_callvm_call_x86_win32_fast | 468 , (DCboolvmfunc*) &dc_callvm_call_x86_win32_fast |
465 , (DCcharvmfunc*) &dc_callvm_call_x86_win32_fast | 469 , (DCcharvmfunc*) &dc_callvm_call_x86_win32_fast |
466 , (DCshortvmfunc*) &dc_callvm_call_x86_win32_fast | 470 , (DCshortvmfunc*) &dc_callvm_call_x86_win32_fast |
467 , (DCintvmfunc*) &dc_callvm_call_x86_win32_fast | 471 , (DCintvmfunc*) &dc_callvm_call_x86_win32_fast |
468 , (DClongvmfunc*) &dc_callvm_call_x86_win32_fast | 472 , (DClongvmfunc*) &dc_callvm_call_x86_win32_fast |
469 , (DClonglongvmfunc*) &dc_callvm_call_x86_win32_fast | 473 , (DClonglongvmfunc*) &dc_callvm_call_x86_win32_fast |
470 , (DCfloatvmfunc*) &dc_callvm_call_x86_win32_fast | 474 , (DCfloatvmfunc*) &dc_callvm_call_x86_win32_fast |
471 , (DCdoublevmfunc*) &dc_callvm_call_x86_win32_fast | 475 , (DCdoublevmfunc*) &dc_callvm_call_x86_win32_fast |
472 , (DCpointervmfunc*) &dc_callvm_call_x86_win32_fast | 476 , (DCpointervmfunc*) &dc_callvm_call_x86_win32_fast |
473 , NULL /* callStruct */ | 477 , NULL /* callAggr */ |
478 , NULL /* beginAggr */ | |
474 }; | 479 }; |
475 | 480 |
476 | 481 |
477 /* --- this ms ------------------------------------------------------------- */ | 482 /* --- this ms ------------------------------------------------------------- */ |
478 | 483 |
498 , &dc_callvm_argLong_x86 | 503 , &dc_callvm_argLong_x86 |
499 , &dc_callvm_argLongLong_x86 | 504 , &dc_callvm_argLongLong_x86 |
500 , &dc_callvm_argFloat_x86 | 505 , &dc_callvm_argFloat_x86 |
501 , &dc_callvm_argDouble_x86 | 506 , &dc_callvm_argDouble_x86 |
502 , &dc_callvm_argPointer_x86 | 507 , &dc_callvm_argPointer_x86 |
503 , NULL /* argStruct */ | 508 , NULL /* argAggr */ |
504 , (DCvoidvmfunc*) &dc_callvm_call_x86_win32_this_ms | 509 , (DCvoidvmfunc*) &dc_callvm_call_x86_win32_this_ms |
505 , (DCboolvmfunc*) &dc_callvm_call_x86_win32_this_ms | 510 , (DCboolvmfunc*) &dc_callvm_call_x86_win32_this_ms |
506 , (DCcharvmfunc*) &dc_callvm_call_x86_win32_this_ms | 511 , (DCcharvmfunc*) &dc_callvm_call_x86_win32_this_ms |
507 , (DCshortvmfunc*) &dc_callvm_call_x86_win32_this_ms | 512 , (DCshortvmfunc*) &dc_callvm_call_x86_win32_this_ms |
508 , (DCintvmfunc*) &dc_callvm_call_x86_win32_this_ms | 513 , (DCintvmfunc*) &dc_callvm_call_x86_win32_this_ms |
509 , (DClongvmfunc*) &dc_callvm_call_x86_win32_this_ms | 514 , (DClongvmfunc*) &dc_callvm_call_x86_win32_this_ms |
510 , (DClonglongvmfunc*) &dc_callvm_call_x86_win32_this_ms | 515 , (DClonglongvmfunc*) &dc_callvm_call_x86_win32_this_ms |
511 , (DCfloatvmfunc*) &dc_callvm_call_x86_win32_this_ms | 516 , (DCfloatvmfunc*) &dc_callvm_call_x86_win32_this_ms |
512 , (DCdoublevmfunc*) &dc_callvm_call_x86_win32_this_ms | 517 , (DCdoublevmfunc*) &dc_callvm_call_x86_win32_this_ms |
513 , (DCpointervmfunc*) &dc_callvm_call_x86_win32_this_ms | 518 , (DCpointervmfunc*) &dc_callvm_call_x86_win32_this_ms |
514 , NULL /* callStruct */ | 519 , NULL /* callAggr */ |
520 , NULL /* beginAggr */ | |
515 }; | 521 }; |
516 | 522 |
517 /* --- syscall ------------------------------------------------------------- */ | 523 /* --- syscall ------------------------------------------------------------- */ |
518 | 524 |
519 /* call syscall */ | 525 /* call syscall */ |
542 , &dc_callvm_argLong_x86 | 548 , &dc_callvm_argLong_x86 |
543 , &dc_callvm_argLongLong_x86 | 549 , &dc_callvm_argLongLong_x86 |
544 , &dc_callvm_argFloat_x86 | 550 , &dc_callvm_argFloat_x86 |
545 , &dc_callvm_argDouble_x86 | 551 , &dc_callvm_argDouble_x86 |
546 , &dc_callvm_argPointer_x86 | 552 , &dc_callvm_argPointer_x86 |
547 , NULL /* argStruct */ | 553 , NULL /* argAggr */ |
548 , (DCvoidvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 554 , (DCvoidvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
549 , (DCboolvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 555 , (DCboolvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
550 , (DCcharvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 556 , (DCcharvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
551 , (DCshortvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 557 , (DCshortvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
552 , (DCintvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 558 , (DCintvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
553 , (DClongvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 559 , (DClongvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
554 , (DClonglongvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 560 , (DClonglongvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
555 , (DCfloatvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 561 , (DCfloatvmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
556 , (DCdoublevmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 562 , (DCdoublevmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
557 , (DCpointervmfunc*) &dc_callvm_call_x86_syscall_int80h_linux | 563 , (DCpointervmfunc*) &dc_callvm_call_x86_syscall_int80h_linux |
558 , NULL /* callStruct */ | 564 , NULL /* callAggr */ |
565 , NULL /* beginAggr */ | |
559 }; | 566 }; |
560 | 567 |
561 DCCallVM_vt gVT_x86_syscall_int80h_bsd = | 568 DCCallVM_vt gVT_x86_syscall_int80h_bsd = |
562 { | 569 { |
563 &dc_callvm_free_x86 | 570 &dc_callvm_free_x86 |
570 , &dc_callvm_argLong_x86 | 577 , &dc_callvm_argLong_x86 |
571 , &dc_callvm_argLongLong_x86 | 578 , &dc_callvm_argLongLong_x86 |
572 , &dc_callvm_argFloat_x86 | 579 , &dc_callvm_argFloat_x86 |
573 , &dc_callvm_argDouble_x86 | 580 , &dc_callvm_argDouble_x86 |
574 , &dc_callvm_argPointer_x86 | 581 , &dc_callvm_argPointer_x86 |
575 , NULL /* argStruct */ | 582 , NULL /* argAggr */ |
576 , (DCvoidvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 583 , (DCvoidvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
577 , (DCboolvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 584 , (DCboolvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
578 , (DCcharvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 585 , (DCcharvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
579 , (DCshortvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 586 , (DCshortvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
580 , (DCintvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 587 , (DCintvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
581 , (DClongvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 588 , (DClongvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
582 , (DClonglongvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 589 , (DClonglongvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
583 , (DCfloatvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 590 , (DCfloatvmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
584 , (DCdoublevmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 591 , (DCdoublevmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
585 , (DCpointervmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd | 592 , (DCpointervmfunc*) &dc_callvm_call_x86_syscall_int80h_bsd |
586 , NULL /* callStruct */ | 593 , NULL /* callAggr */ |
594 , NULL /* beginAggr */ | |
587 }; | 595 }; |
588 | 596 |
589 | 597 |
590 #endif | 598 #endif |
591 | 599 |