summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunQiang Su <[email protected]>2016-05-28 20:33:15 +0800
committerBrian Behlendorf <[email protected]>2016-05-31 09:05:40 -0700
commit2493dca54e18b24bcd8b7ff5432f4dc51dddc472 (patch)
treea7c423256914d8f6a7637e2fd6fd2be5a238c55f
parentb7faa7aabd420b056c9b9cbf6ab8849130385dca (diff)
Add isa_defs for MIPS
GCC for MIPS only defines _LP64 when 64bit, while no _ILP32 defined when 32bit. Signed-off-by: YunQiang Su <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4712
-rw-r--r--lib/libefi/rdwr_efi.c3
-rw-r--r--lib/libspl/include/sys/isa_defs.h23
2 files changed, 24 insertions, 2 deletions
diff --git a/lib/libefi/rdwr_efi.c b/lib/libefi/rdwr_efi.c
index 67de216c0..7a7a4b4b7 100644
--- a/lib/libefi/rdwr_efi.c
+++ b/lib/libefi/rdwr_efi.c
@@ -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 */
diff --git a/lib/libspl/include/sys/isa_defs.h b/lib/libspl/include/sys/isa_defs.h
index 61f4cd96a..3bca5cf02 100644
--- a/lib/libspl/include/sys/isa_defs.h
+++ b/lib/libspl/include/sys/isa_defs.h
@@ -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