Skip to content

Commit

Permalink
Add isa_defs for MIPS
Browse files Browse the repository at this point in the history
GCC for MIPS only defines _LP64 when 64bit,
while no _ILP32 defined when 32bit.

Signed-off-by: YunQiang Su <syq@debian.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#4712
  • Loading branch information
wzssyqa authored and behlendorf committed May 31, 2016
1 parent b7faa7a commit 2493dca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/libefi/rdwr_efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ struct dk_map2 default_vtoc_map[NDKMAP] = {
#if defined(_SUNOS_VTOC_16)

#if defined(i386) || defined(__amd64) || defined(__arm) || \
defined(__powerpc) || defined(__sparc) || defined(__s390__)
defined(__powerpc) || defined(__sparc) || defined(__s390__) || \
defined(__mips__)
{ V_BOOT, V_UNMNT }, /* i - 8 */
{ V_ALTSCTR, 0 }, /* j - 9 */

Expand Down
23 changes: 22 additions & 1 deletion lib/libspl/include/sys/isa_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,28 @@ extern "C" {
#define _BIG_ENDIAN
#define _SUNOS_VTOC_16

#else /* Currently x86_64, i386, arm, powerpc, s390, and sparc are supported */
/* MIPS arch specific defines */
#elif defined(__mips__)

#if defined(__MIPSEB__)
#define _BIG_ENDIAN
#elif defined(__MIPSEL__)
#define _LITTLE_ENDIAN
#else
#error MIPS no endian specified
#endif

#ifndef _LP64
#define _ILP32
#endif

#define _SUNOS_VTOC_16

#else
/*
* Currently supported:
* x86_64, i386, arm, powerpc, s390, sparc, and mips
*/
#error "Unsupported ISA type"
#endif

Expand Down

0 comments on commit 2493dca

Please sign in to comment.