1 /* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
3 Permission is hereby granted, free of charge, to any person obtaining
4 a copy of this software and associated documentation files (the
5 ``Software''), to deal in the Software without restriction, including
6 without limitation the rights to use, copy, modify, merge, publish,
7 distribute, sublicense, and/or sell copies of the Software, and to
8 permit persons to whom the Software is furnished to do so, subject to
9 the following conditions:
11 The above copyright notice and this permission notice shall be
12 included in all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
15 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
22 #ifndef LIBFFI_TARGET_H
23 #define LIBFFI_TARGET_H
26 #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
31 #define FFI_SIZEOF_ARG 8
32 #define FFI_SIZEOF_JAVA_RAW 4
33 typedef unsigned long long ffi_arg
;
34 typedef signed long long ffi_sarg
;
36 #define FFI_SIZEOF_ARG 8
37 typedef unsigned long long ffi_arg
;
38 typedef signed long long ffi_sarg
;
40 typedef unsigned long ffi_arg
;
41 typedef signed long ffi_sarg
;
51 FFI_DEFAULT_ABI
= FFI_WIN64
53 FFI_DEFAULT_ABI
= FFI_SYSV
58 /* ---- Definitions for closures ----------------------------------------- */
60 #define FFI_CLOSURES 1
61 #define FFI_NATIVE_RAW_API 0
63 #if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE
66 #define FFI_TRAMPOLINE_SIZE 16
67 #define FFI_TRAMPOLINE_CLOSURE_OFFSET 16
69 #error "No trampoline table implementation"
73 #define FFI_TRAMPOLINE_SIZE 24
74 #define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE
78 #define FFI_EXTRA_CIF_FIELDS unsigned is_variadic
80 #define FFI_TARGET_SPECIFIC_VARIADIC
82 /* ---- Internal ---- */
84 #if defined (__APPLE__)
85 #define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs
86 #elif !defined(_WIN32)
87 /* iOS and Windows reserve x18 for the system. Disable Go closures until
88 a new static chain is chosen. */
89 #define FFI_GO_CLOSURES 1
93 /* No complex type on Windows */
94 #define FFI_TARGET_HAS_COMPLEX_TYPE