Ruby: ext/fiddle/libffi-3.2.1/src/powerpc/ffi_darwin.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Typedefs | Enumerations | Functions
ffi_darwin.c File Reference
`#include <ffi.h>`
`#include <ffi_common.h>`
`#include <stdlib.h>`

Go to the source code of this file.

## Data Structures
struct | aix_fd_struct
union | ffi_dblfl

## Macros
#define | MIN_LINE_SIZE 32

## Typedefs
typedef struct aix_fd_struct | aix_fd

## Enumerations
enum | { FLAG_RETURNS_128BITS = 1 << (31-31) , FLAG_RETURNS_NOTHING = 1 << (31-30) , FLAG_RETURNS_FP = 1 << (31-29) , FLAG_RETURNS_64BITS = 1 << (31-28) , FLAG_RETURNS_STRUCT = 1 << (31-27) , FLAG_ARG_NEEDS_COPY = 1 << (31- 7) , FLAG_FP_ARGUMENTS = 1 << (31- 6) , FLAG_4_GPR_ARGUMENTS = 1 << (31- 5) , FLAG_RETVAL_REFERENCE = 1 << (31- 4) }
enum | { NUM_GPR_ARG_REGISTERS = 8 , NUM_FPR_ARG_REGISTERS = 13 , LINKAGE_AREA_GPRS = 6 }
enum | { ASM_NEEDS_REGISTERS = 4 }

## Functions
void | ffi_closure_ASM (void)
void | ffi_prep_args (extended_cif *ecif, unsigned long *const stack)
ffi_status | ffi_prep_cif_machdep (ffi_cif *cif)
void | ffi_call_AIX (extended_cif *, long, unsigned, unsigned *, void(*fn)(void), void(*fn2)(void))
void | ffi_call_DARWIN (extended_cif *, long, unsigned, unsigned *, void(*fn)(void), void(*fn2)(void), ffi_type *)
void | ffi_call (ffi_cif *cif, void(*fn)(void), void *rvalue, void **avalue)
ffi_status | ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif, void(*fun)(ffi_cif *, void *, void **, void *), void *user_data, void *codeloc)
ffi_type * | ffi_closure_helper_DARWIN (ffi_closure *, void *, unsigned long *, ffi_dblfl *)

## Macro Definition Documentation

## ◆ MIN_LINE_SIZE

#define MIN_LINE_SIZE 32

## Typedef Documentation

## ◆ aix_fd

typedef struct aix_fd_struct aix_fd

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
FLAG_RETURNS_128BITS |
FLAG_RETURNS_NOTHING |
FLAG_RETURNS_FP |
FLAG_RETURNS_64BITS |
FLAG_RETURNS_STRUCT |
FLAG_ARG_NEEDS_COPY |
FLAG_FP_ARGUMENTS |
FLAG_4_GPR_ARGUMENTS |
FLAG_RETVAL_REFERENCE |

Definition at line 37 of file ffi_darwin.c.

## ◆ anonymous enum

anonymous enum

Enumerator
NUM_GPR_ARG_REGISTERS |
NUM_FPR_ARG_REGISTERS |
LINKAGE_AREA_GPRS |

Definition at line 57 of file ffi_darwin.c.

## ◆ anonymous enum

anonymous enum

Enumerator
ASM_NEEDS_REGISTERS |

Definition at line 63 of file ffi_darwin.c.

## Function Documentation

## ◆ ffi_call()

void ffi_call | ( | ffi_cif * | cif,
|  | void(*)(void) | fn,
|  | void * | rvalue,
|  | void ** | avalue
| ) |  |

Definition at line 915 of file ffi_darwin.c.

References alloca, extended_cif::avalue, extended_cif::cif, FFI_ASSERT, ffi_call_AIX(), ffi_call_DARWIN(), ffi_prep_args(), NULL, and extended_cif::rvalue.

## ◆ ffi_call_AIX()

void ffi_call_AIX | ( | extended_cif * | ,
|  | long | ,
|  | unsigned | ,
|  | unsigned * | ,
|  | void(*)(void) | fn,
|  | void(*)(void) | fn2
| ) |  |

Referenced by ffi_call().

## ◆ ffi_call_DARWIN()

void ffi_call_DARWIN | ( | extended_cif * | ,
|  | long | ,
|  | unsigned | ,
|  | unsigned * | ,
|  | void(*)(void) | fn,
|  | void(*)(void) | fn2,
|  | ffi_type * |
| ) |  |

Referenced by ffi_call().

## ◆ ffi_closure_ASM()

void ffi_closure_ASM | ( | void |  | ) |

Referenced by ffi_prep_closure_loc().

## ◆ ffi_closure_helper_DARWIN()

ffi_type * ffi_closure_helper_DARWIN | ( | ffi_closure * | closure,
|  | void * | rvalue,
|  | unsigned long * | pgr,
|  | ffi_dblfl * | pfr
| ) |  |

Definition at line 1119 of file ffi_darwin.c.

References ALIGN, alloca, ffi_dblfl::d, ffi_dblfl::f, FFI_ASSERT, FFI_TYPE_LONGDOUBLE, memcpy, and NUM_FPR_ARG_REGISTERS.

## ◆ ffi_prep_args()

void ffi_prep_args | ( | extended_cif * | ecif,
|  | unsigned long *const | stack
| ) |  |

Definition at line 106 of file ffi_darwin.c.

References ALIGN, ASM_NEEDS_REGISTERS, extended_cif::avalue, extended_cif::cif, FFI_ASSERT, FFI_TYPE_LONGDOUBLE, FLAG_FP_ARGUMENTS, FLAG_RETVAL_REFERENCE, LINKAGE_AREA_GPRS, long(), memcpy, NUM_FPR_ARG_REGISTERS, ptr, and extended_cif::rvalue.

Referenced by ffi_call().

## ◆ ffi_prep_cif_machdep()

ffi_status ffi_prep_cif_machdep | ( | ffi_cif * | cif | ) |

Definition at line 658 of file ffi_darwin.c.

References ALIGN, ASM_NEEDS_REGISTERS, FFI_TYPE_LONGDOUBLE, FLAG_FP_ARGUMENTS, FLAG_RETURNS_128BITS, FLAG_RETURNS_64BITS, FLAG_RETURNS_FP, FLAG_RETURNS_NOTHING, FLAG_RETURNS_STRUCT, FLAG_RETVAL_REFERENCE, LINKAGE_AREA_GPRS, long(), NUM_FPR_ARG_REGISTERS, NUM_GPR_ARG_REGISTERS, and ptr.

## ◆ ffi_prep_closure_loc()

ffi_status ffi_prep_closure_loc | ( | ffi_closure * | closure,
|  | ffi_cif * | cif,
|  | void(*)(ffi_cif *, void *, void **, void *) | fun,
|  | void * | user_data,
|  | void * | codeloc
| ) |  |

Definition at line 1004 of file ffi_darwin.c.

References aix_fd_struct::code_pointer, FFI_ASSERT, ffi_closure_ASM(), FFI_TRAMPOLINE_SIZE, long(), and aix_fd_struct::toc.