sparc ABI test fix.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 1996, 2003, 2004, 2007, 2008 Red Hat, Inc.
|
||||
ffi.c - Copyright (c) 2011 Anthony Green
|
||||
Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc.
|
||||
|
||||
SPARC Foreign Function Interface
|
||||
|
||||
@@ -485,7 +486,8 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
||||
#ifdef SPARC64
|
||||
/* Trampoline address is equal to the closure address. We take advantage
|
||||
of that to reduce the trampoline size by 8 bytes. */
|
||||
FFI_ASSERT (cif->abi == FFI_V9);
|
||||
if (cif->abi != FFI_V9)
|
||||
return FFI_BAD_ABI;
|
||||
fn = (unsigned long) ffi_closure_v9;
|
||||
tramp[0] = 0x83414000; /* rd %pc, %g1 */
|
||||
tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */
|
||||
@@ -494,7 +496,8 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
||||
*((unsigned long *) &tramp[4]) = fn;
|
||||
#else
|
||||
unsigned long ctx = (unsigned long) codeloc;
|
||||
FFI_ASSERT (cif->abi == FFI_V8);
|
||||
if (cif->abi != FFI_V8)
|
||||
return FFI_BAD_ABI;
|
||||
fn = (unsigned long) ffi_closure_v8;
|
||||
tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */
|
||||
tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */
|
||||
|
||||
Reference in New Issue
Block a user