Skip to content

Commit

Permalink
Fix N32 ABI issue for MIPS.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark H Weaver authored and atgreen committed Oct 26, 2013
1 parent d6716ab commit d3372c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2013-10-23 Mark H Weaver <mhw@netris.org>

* src/mips/ffi.c: Fix handling of uint32_t arguments on the
MIPS N32 ABI.

2013-10-13 Sandra Loosemore <sandra@codesourcery.com>

* README: Add Nios II to table of supported platforms.
Expand Down
7 changes: 7 additions & 0 deletions src/mips/ffi.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,14 @@ static void ffi_prep_args(char *stack,
break;

case FFI_TYPE_UINT32:
#ifdef FFI_MIPS_N32
/* The N32 ABI requires that 32-bit integers
be sign-extended to 64-bits, regardless of
whether they are signed or unsigned. */
*(ffi_arg *)argp = *(SINT32 *)(* p_argv);
#else
*(ffi_arg *)argp = *(UINT32 *)(* p_argv);
#endif
break;

/* This can only happen with 64bit slots. */
Expand Down

0 comments on commit d3372c5

Please sign in to comment.