This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: libffi merge
Anthony Green wrote:
> Andrew Haley wrote:
>> Anthony Green wrote:
>>
>>> Andrew Haley wrote:
>>>
>>>> Andrew Haley wrote:
>>>>
>>>>
>>>>> libffi upstream and gcc libffi are out of sync.
>>>>>
>>>>> I'm doing a two-way merge. Please don't commit patches to either
>>>>> repo for
>>>>> the next few days.
>>>>>
>>>> Here is the first tranche of changes, being the merge from gcc to
>>>> libffi.
>>>>
>>
>>
>>> Thanks Andrew. This set of changes were already in libffi...
>>>
>>
>> Mostly, but the ChangeLog entries were missing.
libffi was missing one hunk of AOliva's big change.
Andrew.
Index: src/sh64/ffi.c
===================================================================
RCS file: /cvs/libffi/libffi/src/sh64/ffi.c,v
retrieving revision 1.5
diff -u -r1.5 ffi.c
--- src/sh64/ffi.c 3 Jun 2009 17:42:56 -0000 1.5
+++ src/sh64/ffi.c 4 Jun 2009 10:32:42 -0000
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2003, 2004, 2006 Kaz Kojima
+ ffi.c - Copyright (c) 2003, 2004, 2006, 2007 Kaz Kojima
Copyright (c) 2008 Anthony Green
SuperH SHmedia Foreign Function Interface
@@ -300,10 +300,11 @@
extern void __ic_invalidate (void *line);
ffi_status
-ffi_prep_closure (ffi_closure *closure,
- ffi_cif *cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data)
+ffi_prep_closure_loc (ffi_closure *closure,
+ ffi_cif *cif,
+ void (*fun)(ffi_cif*, void*, void**, void*),
+ void *user_data,
+ void *codeloc)
{
unsigned int *tramp;
@@ -327,8 +328,8 @@
tramp[2] = 0xcc000010 | (((UINT32) ffi_closure_SYSV) >> 16) << 10;
tramp[3] = 0xc8000010 | (((UINT32) ffi_closure_SYSV) & 0xffff) << 10;
tramp[4] = 0x6bf10600;
- tramp[5] = 0xcc000010 | (((UINT32) closure) >> 16) << 10;
- tramp[6] = 0xc8000010 | (((UINT32) closure) & 0xffff) << 10;
+ tramp[5] = 0xcc000010 | (((UINT32) codeloc) >> 16) << 10;
+ tramp[6] = 0xc8000010 | (((UINT32) codeloc) & 0xffff) << 10;
tramp[7] = 0x4401fff0;
closure->cif = cif;
@@ -336,7 +337,8 @@
closure->user_data = user_data;
/* Flush the icache. */
- asm volatile ("ocbwb %0,0; synco; icbi %0,0; synci" : : "r" (tramp));
+ asm volatile ("ocbwb %0,0; synco; icbi %1,0; synci" : : "r" (tramp),
+ "r"(codeloc));
return FFI_OK;
}