Mercurial > pub > dyncall > dyncall
annotate 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 |
rev | line source |
---|---|
0 | 1 /* |
2 | |
3 Package: dyncall | |
4 Library: dyncall | |
5 File: dyncall/dyncall_callvm.h | |
6 Description: Common call vm binary interface. | |
7 License: | |
8 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
9 Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>, |
0 | 10 Tassilo Philipp <tphilipp@potion-studios.com> |
11 | |
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 | |
14 copyright notice and this permission notice appear in all copies. | |
15 | |
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
23 | |
24 */ | |
25 | |
26 | |
27 | |
28 #ifndef DYNCALL_CALLVM_H | |
29 #define DYNCALL_CALLVM_H | |
30 | |
31 #include "dyncall.h" | |
32 | |
33 /* --- callvm virtual function table --------------------------------------- */ | |
34 | |
35 /* NOTE: if something changes in DCCallVM_, update offset marks in dyncall_call_sparc.S */ | |
36 | |
37 typedef struct DCCallVM_vt_ DCCallVM_vt; | |
38 | |
39 struct DCCallVM_ | |
40 { | |
41 DCCallVM_vt* mVTpointer; | |
42 DCint mError; | |
43 }; | |
44 | |
45 struct DCCallVM_vt_ | |
46 { | |
47 void (*free) (DCCallVM* vm); | |
48 void (*reset) (DCCallVM* vm); | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
49 void (*mode) (DCCallVM* vm, DCint mode); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
50 void (*argBool) (DCCallVM* vm, DCbool B); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
51 void (*argChar) (DCCallVM* vm, DCchar c); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
52 void (*argShort) (DCCallVM* vm, DCshort s); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
53 void (*argInt) (DCCallVM* vm, DCint i); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
54 void (*argLong) (DCCallVM* vm, DClong l); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
55 void (*argLongLong) (DCCallVM* vm, DClonglong L); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
56 void (*argFloat) (DCCallVM* vm, DCfloat f); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
57 void (*argDouble) (DCCallVM* vm, DCdouble d); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
58 void (*argPointer) (DCCallVM* vm, DCpointer p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
59 void (*argAggr) (DCCallVM* vm, const DCaggr* ag, const void* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
60 void (*callVoid) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
61 DCbool (*callBool) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
62 DCchar (*callChar) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
63 DCshort (*callShort) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
64 DCint (*callInt) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
65 DClong (*callLong) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
66 DClonglong (*callLongLong) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
67 DCfloat (*callFloat) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
68 DCdouble (*callDouble) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
69 DCpointer (*callPointer) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
70 void (*callAggr) (DCCallVM* vm, DCpointer funcptr, const DCaggr* ag, DCpointer returnValue); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
71 void (*beginAggr) (DCCallVM* vm, const DCaggr* ag); |
0 | 72 }; |
73 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
74 typedef DCvoid (DCvoidvmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
75 typedef DCbool (DCboolvmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
76 typedef DCchar (DCcharvmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
77 typedef DCshort (DCshortvmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
78 typedef DCint (DCintvmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
79 typedef DClong (DClongvmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
80 typedef DClonglong (DClonglongvmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
81 typedef DCfloat (DCfloatvmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
82 typedef DCdouble (DCdoublevmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
83 typedef DCpointer (DCpointervmfunc) (DCCallVM* vm, DCpointer funcptr); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
84 typedef DCvoid (DCaggrvmfunc) (DCCallVM* vm, DCpointer funcptr, const DCaggr* ag, DCpointer returnValue); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
85 typedef DCvoid (DCbeginaggrvmfunc)(DCCallVM* vm, const DCaggr* ag); |
0 | 86 |
87 /* Common base functions for CallVM implementations. */ | |
88 | |
89 void dc_callvm_base_init(DCCallVM *pInstance, DCCallVM_vt* pVTable); | |
90 | |
91 #endif /* DYNCALL_CALLVM_H */ | |
92 |