Handle FFI_GNUW64 on non-Windows systems (EFI)

This commit is contained in:
Anthony Green
2018-05-09 13:21:02 -04:00
parent 8206253fdf
commit b55baf0b50
+7 -7
View File
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
ffi64.c - Copyright (c) 2013 The Written Word, Inc. ffi64.c - Copyright (c) 2011, 2018 Anthony Green
Copyright (c) 2011 Anthony Green Copyright (c) 2013 The Written Word, Inc.
Copyright (c) 2008, 2010 Red Hat, Inc. Copyright (c) 2008, 2010 Red Hat, Inc.
Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de> Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de>
@@ -404,7 +404,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
ffi_type *rtype; ffi_type *rtype;
#ifndef __ILP32__ #ifndef __ILP32__
if (cif->abi == FFI_EFI64) if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
return ffi_prep_cif_machdep_efi64(cif); return ffi_prep_cif_machdep_efi64(cif);
#endif #endif
if (cif->abi != FFI_UNIX64) if (cif->abi != FFI_UNIX64)
@@ -677,7 +677,7 @@ void
ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{ {
#ifndef __ILP32__ #ifndef __ILP32__
if (cif->abi == FFI_EFI64) if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64)
{ {
ffi_call_efi64(cif, fn, rvalue, avalue); ffi_call_efi64(cif, fn, rvalue, avalue);
return; return;
@@ -697,7 +697,7 @@ ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
void **avalue, void *closure) void **avalue, void *closure)
{ {
#ifndef __ILP32__ #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); ffi_call_go_efi64(cif, fn, rvalue, avalue, closure);
return; return;
@@ -738,7 +738,7 @@ ffi_prep_closure_loc (ffi_closure* closure,
char *tramp = closure->tramp; char *tramp = closure->tramp;
#ifndef __ILP32__ #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); return ffi_prep_closure_loc_efi64(closure, cif, fun, user_data, codeloc);
#endif #endif
if (cif->abi != FFI_UNIX64) 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*)) void (*fun)(ffi_cif*, void*, void**, void*))
{ {
#ifndef __ILP32__ #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); return ffi_prep_go_closure_efi64(closure, cif, fun);
#endif #endif
if (cif->abi != FFI_UNIX64) if (cif->abi != FFI_UNIX64)