Mercurial > pub > dyncall > dyncall
comparison dyncall/dyncall_callvm.h @ 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 | f5577f6bf97a |
children |
comparison
equal
deleted
inserted
replaced
532:d4bf63ab9164 | 533:71c884e610f0 |
---|---|
4 Library: dyncall | 4 Library: dyncall |
5 File: dyncall/dyncall_callvm.h | 5 File: dyncall/dyncall_callvm.h |
6 Description: Common call vm binary interface. | 6 Description: Common call vm binary interface. |
7 License: | 7 License: |
8 | 8 |
9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, | 9 Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>, |
10 Tassilo Philipp <tphilipp@potion-studios.com> | 10 Tassilo Philipp <tphilipp@potion-studios.com> |
11 | 11 |
12 Permission to use, copy, modify, and distribute this software for any | 12 Permission to use, copy, modify, and distribute this software for any |
13 purpose with or without fee is hereby granted, provided that the above | 13 purpose with or without fee is hereby granted, provided that the above |
14 copyright notice and this permission notice appear in all copies. | 14 copyright notice and this permission notice appear in all copies. |
44 | 44 |
45 struct DCCallVM_vt_ | 45 struct DCCallVM_vt_ |
46 { | 46 { |
47 void (*free) (DCCallVM* vm); | 47 void (*free) (DCCallVM* vm); |
48 void (*reset) (DCCallVM* vm); | 48 void (*reset) (DCCallVM* vm); |
49 void (*mode) (DCCallVM* vm,DCint mode); | 49 void (*mode) (DCCallVM* vm, DCint mode); |
50 void (*argBool) (DCCallVM* vm,DCbool B); | 50 void (*argBool) (DCCallVM* vm, DCbool B); |
51 void (*argChar) (DCCallVM* vm,DCchar c); | 51 void (*argChar) (DCCallVM* vm, DCchar c); |
52 void (*argShort) (DCCallVM* vm,DCshort s); | 52 void (*argShort) (DCCallVM* vm, DCshort s); |
53 void (*argInt) (DCCallVM* vm,DCint i); | 53 void (*argInt) (DCCallVM* vm, DCint i); |
54 void (*argLong) (DCCallVM* vm,DClong l); | 54 void (*argLong) (DCCallVM* vm, DClong l); |
55 void (*argLongLong) (DCCallVM* vm,DClonglong L); | 55 void (*argLongLong) (DCCallVM* vm, DClonglong L); |
56 void (*argFloat) (DCCallVM* vm,DCfloat f); | 56 void (*argFloat) (DCCallVM* vm, DCfloat f); |
57 void (*argDouble) (DCCallVM* vm,DCdouble d); | 57 void (*argDouble) (DCCallVM* vm, DCdouble d); |
58 void (*argPointer) (DCCallVM* vm,DCpointer p); | 58 void (*argPointer) (DCCallVM* vm, DCpointer p); |
59 void (*argStruct) (DCCallVM* vm,DCstruct* s, DCpointer p); | 59 void (*argAggr) (DCCallVM* vm, const DCaggr* ag, const void* p); |
60 void (*callVoid) (DCCallVM* vm,DCpointer funcptr); | 60 void (*callVoid) (DCCallVM* vm, DCpointer funcptr); |
61 DCbool (*callBool) (DCCallVM* vm,DCpointer funcptr); | 61 DCbool (*callBool) (DCCallVM* vm, DCpointer funcptr); |
62 DCchar (*callChar) (DCCallVM* vm,DCpointer funcptr); | 62 DCchar (*callChar) (DCCallVM* vm, DCpointer funcptr); |
63 DCshort (*callShort) (DCCallVM* vm,DCpointer funcptr); | 63 DCshort (*callShort) (DCCallVM* vm, DCpointer funcptr); |
64 DCint (*callInt) (DCCallVM* vm,DCpointer funcptr); | 64 DCint (*callInt) (DCCallVM* vm, DCpointer funcptr); |
65 DClong (*callLong) (DCCallVM* vm,DCpointer funcptr); | 65 DClong (*callLong) (DCCallVM* vm, DCpointer funcptr); |
66 DClonglong (*callLongLong) (DCCallVM* vm,DCpointer funcptr); | 66 DClonglong (*callLongLong) (DCCallVM* vm, DCpointer funcptr); |
67 DCfloat (*callFloat) (DCCallVM* vm,DCpointer funcptr); | 67 DCfloat (*callFloat) (DCCallVM* vm, DCpointer funcptr); |
68 DCdouble (*callDouble) (DCCallVM* vm,DCpointer funcptr); | 68 DCdouble (*callDouble) (DCCallVM* vm, DCpointer funcptr); |
69 DCpointer (*callPointer) (DCCallVM* vm,DCpointer funcptr); | 69 DCpointer (*callPointer) (DCCallVM* vm, DCpointer funcptr); |
70 void (*callStruct) (DCCallVM* vm,DCpointer funcptr,DCstruct* s, DCpointer returnValue); | 70 void (*callAggr) (DCCallVM* vm, DCpointer funcptr, const DCaggr* ag, DCpointer returnValue); |
71 void (*beginAggr) (DCCallVM* vm, const DCaggr* ag); | |
71 }; | 72 }; |
72 | 73 |
73 typedef DCvoid (DCvoidvmfunc) (DCCallVM* vm,DCpointer funcptr); | 74 typedef DCvoid (DCvoidvmfunc) (DCCallVM* vm, DCpointer funcptr); |
74 typedef DCbool (DCboolvmfunc) (DCCallVM* vn,DCpointer funcptr); | 75 typedef DCbool (DCboolvmfunc) (DCCallVM* vm, DCpointer funcptr); |
75 typedef DCchar (DCcharvmfunc) (DCCallVM* vm,DCpointer funcptr); | 76 typedef DCchar (DCcharvmfunc) (DCCallVM* vm, DCpointer funcptr); |
76 typedef DCshort (DCshortvmfunc) (DCCallVM* vm,DCpointer funcptr); | 77 typedef DCshort (DCshortvmfunc) (DCCallVM* vm, DCpointer funcptr); |
77 typedef DCint (DCintvmfunc) (DCCallVM* vm,DCpointer funcptr); | 78 typedef DCint (DCintvmfunc) (DCCallVM* vm, DCpointer funcptr); |
78 typedef DClong (DClongvmfunc) (DCCallVM* vm,DCpointer funcptr); | 79 typedef DClong (DClongvmfunc) (DCCallVM* vm, DCpointer funcptr); |
79 typedef DClonglong (DClonglongvmfunc) (DCCallVM* vm,DCpointer funcptr); | 80 typedef DClonglong (DClonglongvmfunc) (DCCallVM* vm, DCpointer funcptr); |
80 typedef DCfloat (DCfloatvmfunc) (DCCallVM* vm,DCpointer funcptr); | 81 typedef DCfloat (DCfloatvmfunc) (DCCallVM* vm, DCpointer funcptr); |
81 typedef DCdouble (DCdoublevmfunc) (DCCallVM* vm,DCpointer funcptr); | 82 typedef DCdouble (DCdoublevmfunc) (DCCallVM* vm, DCpointer funcptr); |
82 typedef DCpointer (DCpointervmfunc) (DCCallVM* vm,DCpointer funcptr); | 83 typedef DCpointer (DCpointervmfunc) (DCCallVM* vm, DCpointer funcptr); |
84 typedef DCvoid (DCaggrvmfunc) (DCCallVM* vm, DCpointer funcptr, const DCaggr* ag, DCpointer returnValue); | |
85 typedef DCvoid (DCbeginaggrvmfunc)(DCCallVM* vm, const DCaggr* ag); | |
83 | 86 |
84 /* Common base functions for CallVM implementations. */ | 87 /* Common base functions for CallVM implementations. */ |
85 | 88 |
86 void dc_callvm_base_init(DCCallVM *pInstance, DCCallVM_vt* pVTable); | 89 void dc_callvm_base_init(DCCallVM *pInstance, DCCallVM_vt* pVTable); |
87 | 90 |