#include "architecture.h"
-Architecture uname_architecture(void) {
+int uname_architecture(void) {
/* Return a sanitized enum identifying the architecture we are
* running on. This is based on uname(), and the user may
static const struct {
const char *machine;
- Architecture arch;
+ int arch;
} arch_map[] = {
#if defined(__x86_64__) || defined(__i386__)
{ "x86_64", ARCHITECTURE_X86_64 },
{ "armv8l", ARCHITECTURE_ARM },
{ "armv8b", ARCHITECTURE_ARM_BE },
#elif defined(__sh__) || defined(__sh64__)
- { "sh64", ARCHITECTURE_SH64 },
- { "sh", ARCHITECTURE_SH },
+ { "sh5", ARCHITECTURE_SH64 },
+ { "sh2", ARCHITECTURE_SH },
+ { "sh2a", ARCHITECTURE_SH },
+ { "sh3", ARCHITECTURE_SH },
+ { "sh4", ARCHITECTURE_SH },
+ { "sh4a", ARCHITECTURE_SH },
#elif defined(__m68k__)
{ "m68k", ARCHITECTURE_M68K },
#elif defined(__tilegx__)
{ "tilegx", ARCHITECTURE_TILEGX },
#elif defined(__cris__)
- { "cris", ARCHITECTURE_CRIS },
{ "crisv32", ARCHITECTURE_CRIS },
#else
#error "Please register your architecture here!"
#endif
};
- static Architecture cached = _ARCHITECTURE_INVALID;
+ static int cached = _ARCHITECTURE_INVALID;
struct utsname u;
unsigned i;
[ARCHITECTURE_SPARC] = "sparc",
[ARCHITECTURE_SPARC64] = "sparc64",
[ARCHITECTURE_MIPS] = "mips",
+ [ARCHITECTURE_MIPS_LE] = "mips-le",
[ARCHITECTURE_MIPS64] = "mips64",
+ [ARCHITECTURE_MIPS64_LE] = "mips64-le",
[ARCHITECTURE_ALPHA] = "alpha",
[ARCHITECTURE_ARM] = "arm",
[ARCHITECTURE_ARM_BE] = "arm-be",
[ARCHITECTURE_CRIS] = "cris",
};
-DEFINE_STRING_TABLE_LOOKUP(architecture, Architecture);
+DEFINE_STRING_TABLE_LOOKUP(architecture, int);