annotate libffi/src/aarch64/ffitarget.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 Permission is hereby granted, free of charge, to any person obtaining
kono
parents:
diff changeset
4 a copy of this software and associated documentation files (the
kono
parents:
diff changeset
5 ``Software''), to deal in the Software without restriction, including
kono
parents:
diff changeset
6 without limitation the rights to use, copy, modify, merge, publish,
kono
parents:
diff changeset
7 distribute, sublicense, and/or sell copies of the Software, and to
kono
parents:
diff changeset
8 permit persons to whom the Software is furnished to do so, subject to
kono
parents:
diff changeset
9 the following conditions:
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 The above copyright notice and this permission notice shall be
kono
parents:
diff changeset
12 included in all copies or substantial portions of the Software.
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
kono
parents:
diff changeset
15 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
kono
parents:
diff changeset
16 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
kono
parents:
diff changeset
17 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
kono
parents:
diff changeset
18 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
kono
parents:
diff changeset
19 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
kono
parents:
diff changeset
20 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 #ifndef LIBFFI_TARGET_H
kono
parents:
diff changeset
23 #define LIBFFI_TARGET_H
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 #ifndef LIBFFI_H
kono
parents:
diff changeset
26 #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
kono
parents:
diff changeset
27 #endif
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 #ifndef LIBFFI_ASM
kono
parents:
diff changeset
30 #ifdef __ILP32__
kono
parents:
diff changeset
31 #define FFI_SIZEOF_ARG 8
kono
parents:
diff changeset
32 #define FFI_SIZEOF_JAVA_RAW 4
kono
parents:
diff changeset
33 typedef unsigned long long ffi_arg;
kono
parents:
diff changeset
34 typedef signed long long ffi_sarg;
kono
parents:
diff changeset
35 #else
kono
parents:
diff changeset
36 typedef unsigned long ffi_arg;
kono
parents:
diff changeset
37 typedef signed long ffi_sarg;
kono
parents:
diff changeset
38 #endif
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 typedef enum ffi_abi
kono
parents:
diff changeset
41 {
kono
parents:
diff changeset
42 FFI_FIRST_ABI = 0,
kono
parents:
diff changeset
43 FFI_SYSV,
kono
parents:
diff changeset
44 FFI_LAST_ABI,
kono
parents:
diff changeset
45 FFI_DEFAULT_ABI = FFI_SYSV
kono
parents:
diff changeset
46 } ffi_abi;
kono
parents:
diff changeset
47 #endif
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 /* ---- Definitions for closures ----------------------------------------- */
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 #define FFI_CLOSURES 1
kono
parents:
diff changeset
52 #if defined (__APPLE__)
kono
parents:
diff changeset
53 #define FFI_TRAMPOLINE_SIZE 20
kono
parents:
diff changeset
54 #define FFI_TRAMPOLINE_CLOSURE_OFFSET 16
kono
parents:
diff changeset
55 #else
kono
parents:
diff changeset
56 #define FFI_TRAMPOLINE_SIZE 24
kono
parents:
diff changeset
57 #define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE
kono
parents:
diff changeset
58 #endif
kono
parents:
diff changeset
59 #define FFI_NATIVE_RAW_API 0
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 /* ---- Internal ---- */
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 #if defined (__APPLE__)
kono
parents:
diff changeset
64 #define FFI_TARGET_SPECIFIC_VARIADIC
kono
parents:
diff changeset
65 #define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs
kono
parents:
diff changeset
66 #else
kono
parents:
diff changeset
67 /* iOS reserves x18 for the system. Disable Go closures until
kono
parents:
diff changeset
68 a new static chain is chosen. */
kono
parents:
diff changeset
69 #define FFI_GO_CLOSURES 1
kono
parents:
diff changeset
70 #endif
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 #define FFI_TARGET_HAS_COMPLEX_TYPE
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 #endif