Ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5ad0e4688e963d9de019557c78feed9)
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
31enum {
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
52typedef union
53{
54 float f;
55 double d;
56} ffi_dblfl;
57
59void FFI_HIDDEN ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *,
60 void (*)(void));
61
63ffi_status FFI_HIDDEN ffi_prep_cif_sysv (ffi_cif *);
64int FFI_HIDDEN ffi_closure_helper_SYSV (ffi_closure *, void *, unsigned long *,
65 ffi_dblfl *, unsigned long *);
66
67void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long,
68 unsigned long *, void (*)(void));
70
72ffi_status FFI_HIDDEN ffi_prep_cif_linux64 (ffi_cif *);
73ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var (ffi_cif *, unsigned int,
74 unsigned int);
75void FFI_HIDDEN ffi_prep_args64 (extended_cif *, unsigned long *const);
76int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure *, void *,
77 unsigned long *, ffi_dblfl *);
ffi_abi
Definition: ffitarget.h:34
void FFI_HIDDEN ffi_prep_args64(extended_cif *, unsigned long *const)
int FFI_HIDDEN ffi_closure_helper_LINUX64(ffi_closure *, void *, unsigned long *, ffi_dblfl *)
void FFI_HIDDEN ffi_prep_types_sysv(ffi_abi)
ffi_status FFI_HIDDEN ffi_prep_cif_linux64(ffi_cif *)
void FFI_HIDDEN ffi_closure_SYSV(void)
Definition: ffi.c:53
ffi_status FFI_HIDDEN ffi_prep_cif_sysv(ffi_cif *)
Definition: ffi_sysv.c:290
void FFI_HIDDEN ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *, void(*)(void))
void FFI_HIDDEN ffi_closure_LINUX64(void)
void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long, unsigned long *, void(*)(void))
ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var(ffi_cif *, unsigned int, unsigned int)
@ FLAG_RETURNS_64BITS
Definition: ffi_powerpc.h:37
@ FLAG_ARG_NEEDS_COPY
Definition: ffi_powerpc.h:45
@ FLAG_RETVAL_REFERENCE
Definition: ffi_powerpc.h:49
@ FLAG_FP_ARGUMENTS
Definition: ffi_powerpc.h:47
@ FLAG_COMPAT
Definition: ffi_powerpc.h:42
@ FLAG_RETURNS_NOTHING
Definition: ffi_powerpc.h:35
@ FLAG_RETURNS_128BITS
Definition: ffi_powerpc.h:40
@ FLAG_RETURNS_FP
Definition: ffi_powerpc.h:36
@ FLAG_RETURNS_SMST
Definition: ffi_powerpc.h:34
@ FLAG_4_GPR_ARGUMENTS
Definition: ffi_powerpc.h:48
@ FLAG_ARG_NEEDS_PSAVE
Definition: ffi_powerpc.h:46
int FFI_HIDDEN ffi_closure_helper_SYSV(ffi_closure *, void *, unsigned long *, ffi_dblfl *, unsigned long *)
Definition: ffi_sysv.c:685
void FFI_HIDDEN ffi_prep_types_linux64(ffi_abi)
#define f
const UINT64 ffi_template_tramp_tile[] FFI_HIDDEN