void *user_data,
void *codeloc)
{
- if (cif->abi != FFI_SYSV)
+ if (cif->abi != FFI_SYSV && cif->abi != FFI_WIN64)
return FFI_BAD_ABI;
void (*start)(void);
{
void (*start)(void);
- if (cif->abi != FFI_SYSV)
+ if (cif->abi != FFI_SYSV && cif->abi != FFI_WIN64)
return FFI_BAD_ABI;
if (cif->flags & AARCH64_FLAG_ARG_V)
void *stack, void *rvalue, void *struct_rvalue)
{
void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
- int i, h, nargs, flags;
+ int i, h, nargs, flags, isvariadic = 0;
struct arg_state state;
arg_init (&state);
+ flags = cif->flags;
+ if (flags & AARCH64_FLAG_VARARG)
+ {
+ isvariadic = 1;
+ flags &= ~AARCH64_FLAG_VARARG;
+ }
+
for (i = 0, nargs = cif->nargs; i < nargs; i++)
{
ffi_type *ty = cif->arg_types[i];
if (h)
{
n = 4 - (h & 3);
-#ifdef _WIN32 /* for handling armasm calling convention */
- if (cif->is_variadic)
+ if (cif->abi == FFI_WIN64 && isvariadic)
{
if (state.ngrn + n <= N_X_ARG_REG)
{
}
else
{
-#endif /* for handling armasm calling convention */
if (state.nsrn + n <= N_V_ARG_REG)
{
void *reg = &context->v[state.nsrn];
avalue[i] = allocate_to_stack(&state, stack,
ty->alignment, s);
}
-#ifdef _WIN32 /* for handling armasm calling convention */
}
-#endif /* for handling armasm calling convention */
}
else if (s > 16)
{
#endif
}
- flags = cif->flags;
if (flags & AARCH64_RET_IN_MEM)
rvalue = struct_rvalue;