Mercurial > hg > CbC > CbC_gcc
comparison libffi/src/powerpc/ffi_powerpc.h @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
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_go_closure_sysv (void); | |
60 void FFI_HIDDEN ffi_call_SYSV(extended_cif *, void (*)(void), void *, | |
61 unsigned, void *, int); | |
62 | |
63 void FFI_HIDDEN ffi_prep_types_sysv (ffi_abi); | |
64 ffi_status FFI_HIDDEN ffi_prep_cif_sysv (ffi_cif *); | |
65 ffi_status FFI_HIDDEN ffi_prep_closure_loc_sysv (ffi_closure *, | |
66 ffi_cif *, | |
67 void (*) (ffi_cif *, void *, | |
68 void **, void *), | |
69 void *, void *); | |
70 int FFI_HIDDEN ffi_closure_helper_SYSV (ffi_cif *, | |
71 void (*) (ffi_cif *, void *, | |
72 void **, void *), | |
73 void *, void *, unsigned long *, | |
74 ffi_dblfl *, unsigned long *); | |
75 | |
76 void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, void (*) (void), void *, | |
77 unsigned long, void *, long); | |
78 void FFI_HIDDEN ffi_closure_LINUX64 (void); | |
79 void FFI_HIDDEN ffi_go_closure_linux64 (void); | |
80 | |
81 void FFI_HIDDEN ffi_prep_types_linux64 (ffi_abi); | |
82 ffi_status FFI_HIDDEN ffi_prep_cif_linux64 (ffi_cif *); | |
83 ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var (ffi_cif *, unsigned int, | |
84 unsigned int); | |
85 void FFI_HIDDEN ffi_prep_args64 (extended_cif *, unsigned long *const); | |
86 ffi_status FFI_HIDDEN ffi_prep_closure_loc_linux64 (ffi_closure *, ffi_cif *, | |
87 void (*) (ffi_cif *, void *, | |
88 void **, void *), | |
89 void *, void *); | |
90 int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_cif *, | |
91 void (*) (ffi_cif *, void *, | |
92 void **, void *), | |
93 void *, void *, | |
94 unsigned long *, ffi_dblfl *); |