2009-06-04 Andrew Haley <aph@redhat.com>

* src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
        2007-03-07.
This commit is contained in:
aph
2009-06-04 10:45:51 +00:00
parent 944c95cf7a
commit 1a2f93a8b3
2 changed files with 15 additions and 8 deletions

View File

@@ -1,3 +1,8 @@
2009-06-04 Andrew Haley <aph@redhat.com>
* src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
2007-03-07.
2008-12-26 Timothy Wall <twall@users.sf.net>
* testsuite/libffi.call/cls_longdouble.c,

View File

@@ -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 ffi_closure_SYSV (void);
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 @@ ffi_prep_closure (ffi_closure *closure,
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 @@ ffi_prep_closure (ffi_closure *closure,
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;
}