summaryrefslogtreecommitdiff
path: root/hscript/meta.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-07-22 18:27:33 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-07-22 18:27:33 -0500
commit21dff37461c8a7655b176b15f6dd7b55deac131f (patch)
tree7df5a3c98bf60fe1bdb0981d5b5d0cc3a7e0eb4c /hscript/meta.cc
parent427e8ea3ef15a61f25551ffb3aa55867d56d3330 (diff)
downloadhorizon-21dff37461c8a7655b176b15f6dd7b55deac131f.tar.gz
horizon-21dff37461c8a7655b176b15f6dd7b55deac131f.tar.bz2
horizon-21dff37461c8a7655b176b15f6dd7b55deac131f.tar.xz
horizon-21dff37461c8a7655b176b15f6dd7b55deac131f.zip
Add initial MIPS port, sans automatic partitioner
Help with the automatic partitioner by parties interested in the MIPS ports of Adélie (and/or Alpine and/or postmarketOS) would be very desirable. I'm only currently aware myself of how to partition SGI MIPS64 machines. My gut tells me we probably need the `subarch` system like for PPC64, but I am not sure how non-SGI MIPS64 machines need to be partitioned.
Diffstat (limited to 'hscript/meta.cc')
-rw-r--r--hscript/meta.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/hscript/meta.cc b/hscript/meta.cc
index d79f3f5..1227e60 100644
--- a/hscript/meta.cc
+++ b/hscript/meta.cc
@@ -722,6 +722,18 @@ const std::string my_arch(const Horizon::Script *script) {
return "pmmx";
# elif defined(__x86_64__)
return "x86_64";
+# elif defined(__mips64)
+# if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ return "mips64el";
+# else /* If byte order is not defined, default to big endian. */
+ return "mips64";
+# endif
+# elif defined(__mips__)
+# if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ return "mipsel";
+# else /* If byte order is not defined, default to big endian. */
+ return "mips";
+# endif
# else
# error Unknown architecture.
# endif
@@ -755,6 +767,10 @@ bool Bootloader::validate() const {
const static std::set<std::string> valid_x86 = {"grub-bios",
"grub-efi"};
return valid_x86.find(this->value()) != valid_x86.end();
+ } else if(arch == "mips64" || arch == "mips" ||
+ arch == "mips64el" || arch == "mipsel") {
+ const static std::set<std::string> valid_mips = {};
+ return valid_mips.find(this->value()) != valid_mips.end();
} else {
output_error(pos, "bootloader: unknown architecture", arch);
return false;