1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 06:52:22 +03:00

util-lib: support various ppc archs in personality logic

This commit is contained in:
Lennart Poettering 2016-02-22 15:50:35 +01:00
parent 6e5f1b5742
commit f2d1736c60

View File

@ -710,6 +710,37 @@ unsigned long personality_from_string(const char *p) {
if (architecture == ARCHITECTURE_S390) if (architecture == ARCHITECTURE_S390)
return PER_LINUX; return PER_LINUX;
#elif defined(__powerpc64__)
# if __BYTE_ORDER == __BIG_ENDIAN
if (architecture == ARCHITECTURE_PPC_LE)
return PER_LINUX32;
if (architecture == ARCHITECTURE_PPC64_LE)
return PER_LINUX;
# else
if (architecture == ARCHITECTURE_PPC)
return PER_LINUX32;
if (architecture == ARCHITECTURE_PPC64)
return PER_LINUX;
# endif
#elif defined(__powerpc__)
# if __BYTE_ORDER == __BIG_ENDIAN
if (architecture == ARCHITECTURE_PPC)
return PER_LINUX;
# else
if (architecture == ARCHITECTURE_PPC_LE)
return PER_LINUX;
# endif
#endif #endif
return PERSONALITY_INVALID; return PERSONALITY_INVALID;
@ -742,6 +773,34 @@ const char* personality_to_string(unsigned long p) {
if (p == PER_LINUX) if (p == PER_LINUX)
architecture = ARCHITECTURE_S390; architecture = ARCHITECTURE_S390;
#elif defined(__powerpc64__)
# if __BYTE_ORDER == __BIG_ENDIAN
if (p == PER_LINUX)
architecture = ARCHITECTURE_PPC64;
else if (p == PER_LINUX32)
architecture = ARCHITECTURE_PPC;
# else
if (p == PER_LINUX)
architecture = ARCHITECTURE_PPC64_LE;
else if (p == PER_LINUX32)
architecture = ARCHITECTURE_PPC_LE;
# endif
#elif defined(__powerpc__)
# if __BYTE_ORDER == __BIG_ENDIAN
if (p == PER_LINUX)
architecture = ARCHITECTURE_PPC;
# else
if (p == PER_LINUX)
architecture = ARCHITECTURE_PPC_LE;
# endif
#endif #endif
if (architecture < 0) if (architecture < 0)