2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
* src/x86/win32.S (_ffi_closure_STDCALL): New function.
(.eh_frame): Add FDE for it.
2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
* configure.ac: Also check if assembler supports pc-relative
relocs on X86_WIN32 targets.
* configure: Regenerate.
* src/x86/win32.S (ffi_prep_args): Declare extern, not global.
(_ffi_call_SYSV): Add missing function type symbol .def and
add EH markup labels.
(_ffi_call_STDCALL): Likewise.
(_ffi_closure_SYSV): Likewise.
(_ffi_closure_raw_SYSV): Likewise.
(.eh_frame): Add hand-crafted EH data.
2008-11-21 Eric Botcazou <ebotcazou@adacore.com>
* src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
signed/unsigned int8/16 return values.
* src/sparc/v8.S (ffi_call_v8): Likewise.
(ffi_closure_v8): Likewise.
2008-03-26 Kaz Kojima <kkojima@gcc.gnu.org>
* src/sh/sysv.S: Add .note.GNU-stack on Linux.
* src/sh64/sysv.S: Likewise.
2008-03-26 Daniel Jacobowitz <dan@debian.org>
* src/arm/sysv.S: Fix ARM comment marker.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 2003, 2004 Kaz Kojima
|
||||
ffi.c - Copyright (c) 2003, 2004, 2006 Kaz Kojima
|
||||
Copyright (c) 2008 Anthony Green
|
||||
|
||||
SuperH SHmedia Foreign Function Interface
|
||||
@@ -162,6 +162,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
|
||||
int n, m;
|
||||
int greg;
|
||||
int freg;
|
||||
int fpair = -1;
|
||||
|
||||
greg = (return_type (cif->rtype) == FFI_TYPE_STRUCT ? 1 : 0);
|
||||
freg = 0;
|
||||
@@ -177,7 +178,13 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
|
||||
cif->bytes += sizeof (UINT64) - sizeof (float);
|
||||
if (freg >= NFREGARG - 1)
|
||||
continue;
|
||||
freg++;
|
||||
if (fpair < 0)
|
||||
{
|
||||
fpair = freg;
|
||||
freg += 2;
|
||||
}
|
||||
else
|
||||
fpair = -1;
|
||||
cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++);
|
||||
break;
|
||||
|
||||
@@ -186,7 +193,6 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
|
||||
continue;
|
||||
if ((freg + 1) < NFREGARG)
|
||||
{
|
||||
freg = (freg + 1) & ~1;
|
||||
freg += 2;
|
||||
cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++);
|
||||
}
|
||||
@@ -352,6 +358,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue,
|
||||
int i, avn;
|
||||
int greg, freg;
|
||||
ffi_cif *cif;
|
||||
int fpair = -1;
|
||||
|
||||
cif = closure->cif;
|
||||
avalue = alloca (cif->nargs * sizeof (void *));
|
||||
@@ -360,7 +367,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue,
|
||||
returns the data directly to the caller. */
|
||||
if (return_type (cif->rtype) == FFI_TYPE_STRUCT)
|
||||
{
|
||||
rvalue = *pgr;
|
||||
rvalue = (UINT64 *) *pgr;
|
||||
greg = 1;
|
||||
}
|
||||
else
|
||||
@@ -404,11 +411,24 @@ ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue,
|
||||
if ((*p_arg)->type == FFI_TYPE_FLOAT)
|
||||
{
|
||||
if (freg < NFREGARG - 1)
|
||||
{
|
||||
if (fpair >= 0)
|
||||
{
|
||||
avalue[i] = (UINT32 *) pfr + fpair;
|
||||
fpair = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
avalue[i] = (UINT32 *) pfr + (1 ^ freg++);
|
||||
fpair = freg;
|
||||
avalue[i] = (UINT32 *) pfr + (1 ^ freg);
|
||||
#else
|
||||
avalue[i] = (UINT32 *) pfr + freg++;
|
||||
fpair = 1 ^ freg;
|
||||
avalue[i] = (UINT32 *) pfr + freg;
|
||||
#endif
|
||||
freg += 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
avalue[i] = pgr + greg;
|
||||
@@ -430,7 +450,6 @@ ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue,
|
||||
avalue[i] = pgr + greg;
|
||||
else
|
||||
{
|
||||
freg = (freg + 1) & ~1;
|
||||
avalue[i] = pfr + (freg >> 1);
|
||||
freg += 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user