summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2015-09-24 12:47:22 +0200
committerHarald Hoyer <harald@redhat.com>2015-09-24 13:03:18 +0200
commit7517f51ef9921d3360453c8eec2c97256d320ceb (patch)
tree009119135965777511430a838e79b953c7c2840c /src/basic
parent2e396de8b2317fdd1cb2f5eb1df8dffd13bf1e80 (diff)
s390: add personality support
Introduce personality support for Linux on z Systems to run particular services with a 64-bit or 31-bit personality.
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/util.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index 18be0bfd5a..40a4b8fbec 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -5261,6 +5261,19 @@ unsigned long personality_from_string(const char *p) {
if (streq(p, "x86"))
return PER_LINUX;
+
+#elif defined(__s390x__)
+
+ if (streq(p, "s390"))
+ return PER_LINUX32;
+
+ if (streq(p, "s390x"))
+ return PER_LINUX;
+
+#elif defined(__s390__)
+
+ if (streq(p, "s390"))
+ return PER_LINUX;
#endif
return PERSONALITY_INVALID;
@@ -5280,6 +5293,20 @@ const char* personality_to_string(unsigned long p) {
if (p == PER_LINUX)
return "x86";
+
+#elif defined(__s390x__)
+
+ if (p == PER_LINUX)
+ return "s390x";
+
+ if (p == PER_LINUX32)
+ return "s390";
+
+#elif defined(__s390__)
+
+ if (p == PER_LINUX)
+ return "s390";
+
#endif
return NULL;