Ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a25176072e02db9254f0e0c84c805cd)
Data Structures | Macros | Functions
ffi.c File Reference
#include <stdio.h>
#include <ffi.h>
#include <ffi_common.h>
#include <stdlib.h>

Go to the source code of this file.

Data Structures

union  _d
 
struct  call_context
 
struct  arg_state
 

Macros

#define AARCH64_STACK_ALIGN   16
 
#define N_X_ARG_REG   8
 
#define N_V_ARG_REG   8
 
#define AARCH64_FFI_WITH_V   (1 << AARCH64_FFI_WITH_V_BIT)
 
#define FFI_INIT_TRAMPOLINE(TRAMP, FUN, CTX, FLAGS)
 

Functions

void ffi_call_SYSV (unsigned(*)(struct call_context *context, unsigned char *, extended_cif *), struct call_context *context, extended_cif *, size_t, void(*fn)(void))
 
void ffi_closure_SYSV (ffi_closure *)
 
ffi_status ffi_prep_cif_machdep (ffi_cif *cif)
 
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)
 
void FFI_HIDDEN ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context, void *stack)
 

Macro Definition Documentation

◆ AARCH64_FFI_WITH_V

#define AARCH64_FFI_WITH_V   (1 << AARCH64_FFI_WITH_V_BIT)

Definition at line 39 of file ffi.c.

◆ AARCH64_STACK_ALIGN

#define AARCH64_STACK_ALIGN   16

Definition at line 33 of file ffi.c.

◆ FFI_INIT_TRAMPOLINE

#define FFI_INIT_TRAMPOLINE (   TRAMP,
  FUN,
  CTX,
  FLAGS 
)
Value:
({unsigned char *__tramp = (unsigned char*)(TRAMP); \
UINT64 __fun = (UINT64)(FUN); \
UINT64 __ctx = (UINT64)(CTX); \
UINT64 __flags = (UINT64)(FLAGS); \
memcpy (__tramp, trampoline, sizeof (trampoline)); \
memcpy (__tramp + 12, &__fun, sizeof (__fun)); \
memcpy (__tramp + 20, &__ctx, sizeof (__ctx)); \
memcpy (__tramp + 28, &__flags, sizeof (__flags)); \
ffi_clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE); \
})
#define FFI_TRAMPOLINE_SIZE
Definition: ffitarget.h:45

Definition at line 915 of file ffi.c.

◆ N_V_ARG_REG

#define N_V_ARG_REG   8

Definition at line 37 of file ffi.c.

◆ N_X_ARG_REG

#define N_X_ARG_REG   8

Definition at line 36 of file ffi.c.

Function Documentation

◆ ffi_call()

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

◆ ffi_call_SYSV()

void ffi_call_SYSV ( unsigned(*)(struct call_context *context, unsigned char *, extended_cif *)  ,
struct call_context context,
extended_cif ,
size_t  ,
void(*)(void fn 
)

Referenced by ffi_call(), and ffi_raw_call().

◆ ffi_closure_SYSV()

void ffi_closure_SYSV ( ffi_closure *  )

Definition at line 420 of file ffi.c.

Referenced by ffi_prep_closure_loc(), and ffi_prep_closure_loc_sysv().

◆ ffi_closure_SYSV_inner()

void FFI_HIDDEN ffi_closure_SYSV_inner ( ffi_closure *  closure,
struct call_context context,
void stack 
)

Definition at line 964 of file ffi.c.

References alloca, i, and NULL.

Referenced by ffi_prep_closure_loc().

◆ ffi_prep_cif_machdep()

ffi_status ffi_prep_cif_machdep ( ffi_cif *  cif)

Definition at line 758 of file ffi.c.

Referenced by ffi_prep_cif_machdep_var().

◆ 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 928 of file ffi.c.

References ffi_closure_SYSV(), FFI_INIT_TRAMPOLINE, and FFI_SYSV.

Referenced by main().