X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Farchitecture.c;h=8e72e7a36a7e3adb3887b56dad4a8c8a53de6e1a;hb=d896ac2d2fbce41a0b11a0618a685adeaf18b8fe;hp=7dd049a36a513e435a35ab70deceda6ab813f5b1;hpb=9b3a0ba3e9e28382a1072bf0e2c07a3661432743;p=elogind.git diff --git a/src/shared/architecture.c b/src/shared/architecture.c index 7dd049a36..8e72e7a36 100644 --- a/src/shared/architecture.c +++ b/src/shared/architecture.c @@ -23,7 +23,7 @@ #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 @@ -35,13 +35,13 @@ Architecture uname_architecture(void) { * 1:1. Instead we try to clean it up and break down the * confusion on x86 and arm in particular. * - * We do not try to distuingish CPUs not CPU features, but + * We do not try to distinguish CPUs not CPU features, but * actual architectures, i.e. that have genuinely different * code. */ static const struct { const char *machine; - Architecture arch; + int arch; } arch_map[] = { #if defined(__x86_64__) || defined(__i386__) { "x86_64", ARCHITECTURE_X86_64 }, @@ -108,21 +108,24 @@ Architecture uname_architecture(void) { { "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; @@ -154,7 +157,9 @@ static const char *const architecture_table[_ARCHITECTURE_MAX] = { [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", @@ -167,4 +172,4 @@ static const char *const architecture_table[_ARCHITECTURE_MAX] = { [ARCHITECTURE_CRIS] = "cris", }; -DEFINE_STRING_TABLE_LOOKUP(architecture, Architecture); +DEFINE_STRING_TABLE_LOOKUP(architecture, int);