PR target/81408
[official-gcc.git] / libffi / src / aarch64 / ffitarget.h
blob34200ad9325be0f06409c4f4cede9f5c7fca208e
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
25 #ifndef LIBFFI_H
26 #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
27 #endif
29 #ifndef LIBFFI_ASM
30 #ifdef __ILP32__
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;
35 #else
36 typedef unsigned long ffi_arg;
37 typedef signed long ffi_sarg;
38 #endif
40 typedef enum ffi_abi
42 FFI_FIRST_ABI = 0,
43 FFI_SYSV,
44 FFI_LAST_ABI,
45 FFI_DEFAULT_ABI = FFI_SYSV
46 } ffi_abi;
47 #endif
49 /* ---- Definitions for closures ----------------------------------------- */
51 #define FFI_CLOSURES 1
52 #if defined (__APPLE__)
53 #define FFI_TRAMPOLINE_SIZE 20
54 #define FFI_TRAMPOLINE_CLOSURE_OFFSET 16
55 #else
56 #define FFI_TRAMPOLINE_SIZE 24
57 #define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE
58 #endif
59 #define FFI_NATIVE_RAW_API 0
61 /* ---- Internal ---- */
63 #if defined (__APPLE__)
64 #define FFI_TARGET_SPECIFIC_VARIADIC
65 #define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs
66 #else
67 /* iOS reserves x18 for the system. Disable Go closures until
68 a new static chain is chosen. */
69 #define FFI_GO_CLOSURES 1
70 #endif
72 #define FFI_TARGET_HAS_COMPLEX_TYPE
74 #endif