Fix microblaze big-endian struct issue
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2013-02-08 Nathan Rossi <nathan.rossi@xilinx.com>
|
||||||
|
|
||||||
|
* src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of
|
||||||
|
small big-endian structures.
|
||||||
|
(ffi_prep_args): Ditto.
|
||||||
|
|
||||||
2013-02-07 Anthony Green <green@moxielogic.com>
|
2013-02-07 Anthony Green <green@moxielogic.com>
|
||||||
|
|
||||||
* src/sparc/v8.S (ffi_call_v8): Fix typo from last patch
|
* src/sparc/v8.S (ffi_call_v8): Fix typo from last patch
|
||||||
|
|||||||
@@ -119,16 +119,7 @@ void ffi_prep_args(void* stack, extended_cif* ecif)
|
|||||||
*/
|
*/
|
||||||
if (size < WORD_SIZE)
|
if (size < WORD_SIZE)
|
||||||
{
|
{
|
||||||
if (size == 1) {
|
memcpy (addr + (WORD_SIZE - size), value, size);
|
||||||
*(unsigned int *)addr =
|
|
||||||
(unsigned int)*(UINT8*)(value);
|
|
||||||
} else if (size == 2) {
|
|
||||||
*(unsigned int *)addr =
|
|
||||||
(unsigned int)*(UINT16*)(value);
|
|
||||||
} else {
|
|
||||||
*(unsigned int *)addr =
|
|
||||||
((unsigned int)*(UINT32*)(value)) >> 8;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -250,16 +241,7 @@ void ffi_closure_call_SYSV(void* register_args, void* stack_args,
|
|||||||
*/
|
*/
|
||||||
if (arg_types[i]->size < WORD_SIZE)
|
if (arg_types[i]->size < WORD_SIZE)
|
||||||
{
|
{
|
||||||
if (arg_types[i]->size == 1) {
|
memcpy (ptr, ptr + (WORD_SIZE - arg_types[i]->size), arg_types[i]->size);
|
||||||
*(unsigned int *)ptr =
|
|
||||||
((unsigned int)*(UINT32*)(ptr)) << 24;
|
|
||||||
} else if (arg_types[i]->size == 2) {
|
|
||||||
*(unsigned int *)ptr =
|
|
||||||
((unsigned int)*(UINT32*)(ptr)) << 16;
|
|
||||||
} else {
|
|
||||||
*(unsigned int *)ptr =
|
|
||||||
((unsigned int)*(UINT32*)(ptr)) << 8;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
avalue[i] = (void*)ptr;
|
avalue[i] = (void*)ptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user