Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

ffi_powerpc.h
Go to the documentation of this file.
1 /* -----------------------------------------------------------------------
2 ffi_powerpc.h - Copyright (C) 2013 IBM
3 Copyright (C) 2011 Anthony Green
4 Copyright (C) 2011 Kyle Moffett
5 Copyright (C) 2008 Red Hat, Inc
6 Copyright (C) 2007, 2008 Free Software Foundation, Inc
7 Copyright (c) 1998 Geoffrey Keating
8
9 PowerPC Foreign Function Interface
10
11 Permission is hereby granted, free of charge, to any person obtaining
12 a copy of this software and associated documentation files (the
13 ``Software''), to deal in the Software without restriction, including
14 without limitation the rights to use, copy, modify, merge, publish,
15 distribute, sublicense, and/or sell copies of the Software, and to
16 permit persons to whom the Software is furnished to do so, subject to
17 the following conditions:
18
19 The above copyright notice and this permission notice shall be included
20 in all copies or substantial portions of the Software.
21
22 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
26 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 OTHER DEALINGS IN THE SOFTWARE.
29 ----------------------------------------------------------------------- */
30
31 enum {
32 /* The assembly depends on these exact flags. */
33 /* These go in cr7 */
34 FLAG_RETURNS_SMST = 1 << (31-31), /* Used for FFI_SYSV small structs. */
35 FLAG_RETURNS_NOTHING = 1 << (31-30),
36 FLAG_RETURNS_FP = 1 << (31-29),
37 FLAG_RETURNS_64BITS = 1 << (31-28),
38
39 /* This goes in cr6 */
40 FLAG_RETURNS_128BITS = 1 << (31-27),
41
42 FLAG_COMPAT = 1 << (31- 8), /* Not used by assembly */
43
44 /* These go in cr1 */
45 FLAG_ARG_NEEDS_COPY = 1 << (31- 7), /* Used by sysv code */
46 FLAG_ARG_NEEDS_PSAVE = FLAG_ARG_NEEDS_COPY, /* Used by linux64 code */
47 FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
48 FLAG_4_GPR_ARGUMENTS = 1 << (31- 5),
49 FLAG_RETVAL_REFERENCE = 1 << (31- 4)
50 };
51
52 typedef union
53 {
54 float f;
55 double d;
56 } ffi_dblfl;
57
58 void FFI_HIDDEN ffi_closure_SYSV (void);
59 void FFI_HIDDEN ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *,
60 void (*)(void));
61
62 void FFI_HIDDEN ffi_prep_types_sysv (ffi_abi);
63 ffi_status FFI_HIDDEN ffi_prep_cif_sysv (ffi_cif *);
64 int FFI_HIDDEN ffi_closure_helper_SYSV (ffi_closure *, void *, unsigned long *,
65 ffi_dblfl *, unsigned long *);
66
67 void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long,
68 unsigned long *, void (*)(void));
69 void FFI_HIDDEN ffi_closure_LINUX64 (void);
70
71 void FFI_HIDDEN ffi_prep_types_linux64 (ffi_abi);
72 ffi_status FFI_HIDDEN ffi_prep_cif_linux64 (ffi_cif *);
73 ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var (ffi_cif *, unsigned int,
74 unsigned int);
75 void FFI_HIDDEN ffi_prep_args64 (extended_cif *, unsigned long *const);
76 int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure *, void *,
77 unsigned long *, ffi_dblfl *);
FLAG_RETURNS_128BITS
@ FLAG_RETURNS_128BITS
Definition: ffi_powerpc.h:40
ffi_closure_helper_LINUX64
int FFI_HIDDEN ffi_closure_helper_LINUX64(ffi_closure *, void *, unsigned long *, ffi_dblfl *)
FLAG_FP_ARGUMENTS
@ FLAG_FP_ARGUMENTS
Definition: ffi_powerpc.h:47
ffi_abi
ffi_abi
Definition: ffitarget.h:33
FFI_HIDDEN
const UINT64 ffi_template_tramp_tile[] FFI_HIDDEN
ffi_closure_SYSV
void FFI_HIDDEN ffi_closure_SYSV(void)
Definition: ffi.c:53
ffi_prep_cif_linux64_var
ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var(ffi_cif *, unsigned int, unsigned int)
ffi_prep_cif_sysv
ffi_status FFI_HIDDEN ffi_prep_cif_sysv(ffi_cif *)
Definition: ffi_sysv.c:290
FLAG_COMPAT
@ FLAG_COMPAT
Definition: ffi_powerpc.h:42
FLAG_ARG_NEEDS_COPY
@ FLAG_ARG_NEEDS_COPY
Definition: ffi_powerpc.h:45
extended_cif
Definition: ffi_common.h:86
ffi_closure_LINUX64
void FFI_HIDDEN ffi_closure_LINUX64(void)
f
#define f
ffi_closure_helper_SYSV
int FFI_HIDDEN ffi_closure_helper_SYSV(ffi_closure *, void *, unsigned long *, ffi_dblfl *, unsigned long *)
Definition: ffi_sysv.c:685
FLAG_ARG_NEEDS_PSAVE
@ FLAG_ARG_NEEDS_PSAVE
Definition: ffi_powerpc.h:46
FLAG_4_GPR_ARGUMENTS
@ FLAG_4_GPR_ARGUMENTS
Definition: ffi_powerpc.h:48
ffi_dblfl
Definition: ffi_darwin.c:1101
FLAG_RETURNS_SMST
@ FLAG_RETURNS_SMST
Definition: ffi_powerpc.h:34
ffi_prep_cif_linux64
ffi_status FFI_HIDDEN ffi_prep_cif_linux64(ffi_cif *)
ffi_prep_types_linux64
void FFI_HIDDEN ffi_prep_types_linux64(ffi_abi)
FLAG_RETVAL_REFERENCE
@ FLAG_RETVAL_REFERENCE
Definition: ffi_powerpc.h:49
ffi_call_LINUX64
void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long, unsigned long *, void(*)(void))
ffi_prep_types_sysv
void FFI_HIDDEN ffi_prep_types_sysv(ffi_abi)
FLAG_RETURNS_FP
@ FLAG_RETURNS_FP
Definition: ffi_powerpc.h:36
FLAG_RETURNS_NOTHING
@ FLAG_RETURNS_NOTHING
Definition: ffi_powerpc.h:35
FLAG_RETURNS_64BITS
@ FLAG_RETURNS_64BITS
Definition: ffi_powerpc.h:37
ffi_call_SYSV
void FFI_HIDDEN ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *, void(*)(void))
ffi_prep_args64
void FFI_HIDDEN ffi_prep_args64(extended_cif *, unsigned long *const)