Handle FFI_GNUW64 on non-Windows systems (EFI)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c
index e46974d..41d6acd 100644
--- a/src/x86/ffi64.c
+++ b/src/x86/ffi64.c
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
- ffi64.c - Copyright (c) 2013 The Written Word, Inc.
- Copyright (c) 2011 Anthony Green
+ ffi64.c - Copyright (c) 2011, 2018 Anthony Green
+ Copyright (c) 2013 The Written Word, Inc.
Copyright (c) 2008, 2010 Red Hat, Inc.
Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de>
@@ -404,7 +404,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
ffi_type *rtype;
#ifndef __ILP32__
- if (cif->abi == FFI_EFI64)
+ if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
return ffi_prep_cif_machdep_efi64(cif);
#endif
if (cif->abi != FFI_UNIX64)
@@ -677,7 +677,7 @@ void
ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{
#ifndef __ILP32__
- if (cif->abi == FFI_EFI64)
+ if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
{
ffi_call_efi64(cif, fn, rvalue, avalue);
return;
@@ -697,7 +697,7 @@ ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
void **avalue, void *closure)
{
#ifndef __ILP32__
- if (cif->abi == FFI_EFI64)
+ if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
{
ffi_call_go_efi64(cif, fn, rvalue, avalue, closure);
return;
@@ -738,7 +738,7 @@ ffi_prep_closure_loc (ffi_closure* closure,
char *tramp = closure->tramp;
#ifndef __ILP32__
- if (cif->abi == FFI_EFI64)
+ if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
return ffi_prep_closure_loc_efi64(closure, cif, fun, user_data, codeloc);
#endif
if (cif->abi != FFI_UNIX64)
@@ -866,7 +866,7 @@ ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif,
void (*fun)(ffi_cif*, void*, void**, void*))
{
#ifndef __ILP32__
- if (cif->abi == FFI_EFI64)
+ if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
return ffi_prep_go_closure_efi64(closure, cif, fun);
#endif
if (cif->abi != FFI_UNIX64)