Mercurial > pub > dyncall > dyncall
view dyncall/dyncall_callvm_x64.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 | ad5f9803f52f |
children |
line wrap: on
line source
/* Package: dyncall Library: dyncall File: dyncall/dyncall_callvm_x64.h Description: License: Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, Tassilo Philipp <tphilipp@potion-studios.com> Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* dyncall callvm for x64 architecture SUPPORTED CALLING CONVENTIONS MS Windows x64 calling convention, AMD64 SystemV ABI REVISION 2007/12/11 initial */ #ifndef DYNCALL_CALLVM_X64_H #define DYNCALL_CALLVM_X64_H #include "dyncall_macros.h" #include "dyncall_callvm.h" #include "dyncall_vector.h" #if defined(DC_WINDOWS) typedef long long int64; /* llp64 */ #define numIntRegs 4 #define numFloatRegs 4 #define DCRegCount_x64 DCRegCount_x64_u #define DCRegData_x64 DCRegData_x64_u #elif defined(DC_UNIX) typedef long int64; /* lp64 */ #define numIntRegs 6 #define numFloatRegs 8 #define DCRegCount_x64 DCRegCount_x64_s #define DCRegData_x64 DCRegData_x64_s #else #error Unsupported OS. #endif typedef union { int i; int f; } DCRegCount_x64_u; typedef struct { int i; int f; } DCRegCount_x64_s; typedef union { int64 i[numIntRegs ]; double f[numFloatRegs]; } DCRegData_x64_u; typedef struct { int64 i[numIntRegs ]; double f[numFloatRegs]; } DCRegData_x64_s; typedef struct { DCCallVM mInterface; /* this CallVM interface */ DCpointer mpCallFunc; /* function to call */ DCint mAggrReturnReg; /* reg index for aggregate ret value (if hidden argument) */ #if defined(DC_WINDOWS) DCpointer mpAggrVecCopies; /* ptr to copies of aggrs passed via hidden ptr (end of vector) */ #endif DCRegCount_x64 mRegCount; /* number of int/sse registers used for parameter passing */ DCRegData_x64 mRegData; /* parameters to be passed via registers */ DCVecHead mVecHead; /* parameters to be pushed onto stack */ } DCCallVM_x64; #endif /* DYNCALL_CALLVM_X64_H */