mirror of
https://github.com/partic2/libffi
synced 2026-11-10 01:57:19 +00:00
Prefix ALIGN macros with FFI_
This commit is contained in:
+2
-2
@@ -93,7 +93,7 @@
|
||||
/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
|
||||
past a 2^align boundary. */
|
||||
#ifdef PROF
|
||||
#define EALIGN(name, alignt, words) \
|
||||
#define EFFI_ALIGN(name, alignt, words) \
|
||||
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
|
||||
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
|
||||
.align ALIGNARG(2); \
|
||||
@@ -104,7 +104,7 @@
|
||||
EALIGN_W_##words; \
|
||||
0:
|
||||
#else /* PROF */
|
||||
#define EALIGN(name, alignt, words) \
|
||||
#define EFFI_ALIGN(name, alignt, words) \
|
||||
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
|
||||
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
|
||||
.align ALIGNARG(alignt); \
|
||||
|
||||
+17
-17
@@ -255,7 +255,7 @@ ffi_prep_args (extended_cif *ecif, unsigned long *const stack)
|
||||
case FFI_TYPE_STRUCT:
|
||||
size_al = (*ptr)->size;
|
||||
#if defined(POWERPC_DARWIN64)
|
||||
next_arg = (unsigned long *)ALIGN((char *)next_arg, (*ptr)->alignment);
|
||||
next_arg = (unsigned long *)FFI_ALIGN((char *)next_arg, (*ptr)->alignment);
|
||||
darwin64_pass_struct_by_value (*ptr, (char *) *p_argv,
|
||||
(unsigned) size_al,
|
||||
(unsigned int *) &fparg_count,
|
||||
@@ -266,7 +266,7 @@ ffi_prep_args (extended_cif *ecif, unsigned long *const stack)
|
||||
/* If the first member of the struct is a double, then include enough
|
||||
padding in the struct size to align it to double-word. */
|
||||
if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE)
|
||||
size_al = ALIGN((*ptr)->size, 8);
|
||||
size_al = FFI_ALIGN((*ptr)->size, 8);
|
||||
|
||||
# if defined(POWERPC64)
|
||||
FFI_ASSERT (abi != FFI_DARWIN);
|
||||
@@ -352,7 +352,7 @@ darwin64_struct_size_exceeds_gprs_p (ffi_type *s, char *src, unsigned *nfpr)
|
||||
ffi_type *p = s->elements[i];
|
||||
/* Find the start of this item (0 for the first one). */
|
||||
if (i > 0)
|
||||
struct_offset = ALIGN(struct_offset, p->alignment);
|
||||
struct_offset = FFI_ALIGN(struct_offset, p->alignment);
|
||||
|
||||
item_base = src + struct_offset;
|
||||
|
||||
@@ -436,7 +436,7 @@ darwin64_pass_struct_floats (ffi_type *s, char *src,
|
||||
ffi_type *p = s->elements[i];
|
||||
/* Find the start of this item (0 for the first one). */
|
||||
if (i > 0)
|
||||
struct_offset = ALIGN(struct_offset, p->alignment);
|
||||
struct_offset = FFI_ALIGN(struct_offset, p->alignment);
|
||||
item_base = src + struct_offset;
|
||||
|
||||
switch (p->type)
|
||||
@@ -527,7 +527,7 @@ darwin64_struct_floats_to_mem (ffi_type *s, char *dest, double *fprs, unsigned *
|
||||
ffi_type *p = s->elements[i];
|
||||
/* Find the start of this item (0 for the first one). */
|
||||
if (i > 0)
|
||||
struct_offset = ALIGN(struct_offset, p->alignment);
|
||||
struct_offset = FFI_ALIGN(struct_offset, p->alignment);
|
||||
item_base = dest + struct_offset;
|
||||
|
||||
switch (p->type)
|
||||
@@ -604,10 +604,10 @@ darwin_adjust_aggregate_sizes (ffi_type *s)
|
||||
align = 4;
|
||||
#endif
|
||||
/* Pad, if necessary, before adding the current item. */
|
||||
s->size = ALIGN(s->size, align) + p->size;
|
||||
s->size = FFI_ALIGN(s->size, align) + p->size;
|
||||
}
|
||||
|
||||
s->size = ALIGN(s->size, s->alignment);
|
||||
s->size = FFI_ALIGN(s->size, s->alignment);
|
||||
|
||||
/* This should not be necessary on m64, but harmless. */
|
||||
if (s->elements[0]->type == FFI_TYPE_UINT64
|
||||
@@ -640,10 +640,10 @@ aix_adjust_aggregate_sizes (ffi_type *s)
|
||||
align = p->alignment;
|
||||
if (i != 0 && p->type == FFI_TYPE_DOUBLE)
|
||||
align = 4;
|
||||
s->size = ALIGN(s->size, align) + p->size;
|
||||
s->size = FFI_ALIGN(s->size, align) + p->size;
|
||||
}
|
||||
|
||||
s->size = ALIGN(s->size, s->alignment);
|
||||
s->size = FFI_ALIGN(s->size, s->alignment);
|
||||
|
||||
if (s->elements[0]->type == FFI_TYPE_UINT64
|
||||
|| s->elements[0]->type == FFI_TYPE_SINT64
|
||||
@@ -809,9 +809,9 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
||||
16-byte-aligned. */
|
||||
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
|
||||
#if defined (POWERPC64)
|
||||
intarg_count = ALIGN(intarg_count, 2);
|
||||
intarg_count = FFI_ALIGN(intarg_count, 2);
|
||||
#else
|
||||
intarg_count = ALIGN(intarg_count, 4);
|
||||
intarg_count = FFI_ALIGN(intarg_count, 4);
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
@@ -838,7 +838,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
||||
#if defined(POWERPC_DARWIN64)
|
||||
align_words = (*ptr)->alignment >> 3;
|
||||
if (align_words)
|
||||
intarg_count = ALIGN(intarg_count, align_words);
|
||||
intarg_count = FFI_ALIGN(intarg_count, align_words);
|
||||
/* Base size of the struct. */
|
||||
intarg_count += (size_al + 7) / 8;
|
||||
/* If 16 bytes then don't worry about floats. */
|
||||
@@ -848,11 +848,11 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
||||
#else
|
||||
align_words = (*ptr)->alignment >> 2;
|
||||
if (align_words)
|
||||
intarg_count = ALIGN(intarg_count, align_words);
|
||||
intarg_count = FFI_ALIGN(intarg_count, align_words);
|
||||
/* If the first member of the struct is a double, then align
|
||||
the struct to double-word.
|
||||
if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE)
|
||||
size_al = ALIGN((*ptr)->size, 8); */
|
||||
size_al = FFI_ALIGN((*ptr)->size, 8); */
|
||||
# ifdef POWERPC64
|
||||
intarg_count += (size_al + 7) / 8;
|
||||
# else
|
||||
@@ -897,7 +897,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
||||
bytes += NUM_GPR_ARG_REGISTERS * sizeof(long);
|
||||
|
||||
/* The stack space allocated needs to be a multiple of 16 bytes. */
|
||||
bytes = ALIGN(bytes, 16) ;
|
||||
bytes = FFI_ALIGN(bytes, 16) ;
|
||||
|
||||
cif->flags = flags;
|
||||
cif->bytes = bytes;
|
||||
@@ -1208,7 +1208,7 @@ ffi_closure_helper_DARWIN (ffi_closure *closure, void *rvalue,
|
||||
case FFI_TYPE_STRUCT:
|
||||
size_al = arg_types[i]->size;
|
||||
#if defined(POWERPC_DARWIN64)
|
||||
pgr = (unsigned long *)ALIGN((char *)pgr, arg_types[i]->alignment);
|
||||
pgr = (unsigned long *)FFI_ALIGN((char *)pgr, arg_types[i]->alignment);
|
||||
if (size_al < 3 || size_al == 4)
|
||||
{
|
||||
avalue[i] = ((char *)pgr)+8-size_al;
|
||||
@@ -1233,7 +1233,7 @@ ffi_closure_helper_DARWIN (ffi_closure *closure, void *rvalue,
|
||||
/* If the first member of the struct is a double, then align
|
||||
the struct to double-word. */
|
||||
if (arg_types[i]->elements[0]->type == FFI_TYPE_DOUBLE)
|
||||
size_al = ALIGN(arg_types[i]->size, 8);
|
||||
size_al = FFI_ALIGN(arg_types[i]->size, 8);
|
||||
# if defined(POWERPC64)
|
||||
FFI_ASSERT (cif->abi != FFI_DARWIN);
|
||||
avalue[i] = pgr;
|
||||
|
||||
@@ -219,7 +219,7 @@ ffi_prep_cif_linux64_core (ffi_cif *cif)
|
||||
align = 16;
|
||||
align = align / 8;
|
||||
if (align > 1)
|
||||
intarg_count = ALIGN (intarg_count, align);
|
||||
intarg_count = FFI_ALIGN (intarg_count, align);
|
||||
}
|
||||
intarg_count += ((*ptr)->size + 7) / 8;
|
||||
#if _CALL_ELF == 2
|
||||
@@ -536,7 +536,7 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
|
||||
if (align > 16)
|
||||
align = 16;
|
||||
if (align > 1)
|
||||
next_arg.p = ALIGN (next_arg.p, align);
|
||||
next_arg.p = FFI_ALIGN (next_arg.p, align);
|
||||
}
|
||||
#if _CALL_ELF == 2
|
||||
elt = discover_homogeneous_aggregate (*ptr, &elnum);
|
||||
@@ -794,7 +794,7 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
|
||||
if (align > 16)
|
||||
align = 16;
|
||||
if (align > 1)
|
||||
pst = (unsigned long *) ALIGN ((size_t) pst, align);
|
||||
pst = (unsigned long *) FFI_ALIGN ((size_t) pst, align);
|
||||
}
|
||||
elt = 0;
|
||||
#if _CALL_ELF == 2
|
||||
|
||||
Reference in New Issue
Block a user