summaryrefslogtreecommitdiffstats
path: root/isys/smp.c
diff options
context:
space:
mode:
authorKarsten Hopp <karsten@redhat.de>2001-06-20 13:15:44 +0000
committerKarsten Hopp <karsten@redhat.de>2001-06-20 13:15:44 +0000
commit6a81b8274f1259a1a03189de0ff8841ff1e1d96a (patch)
tree00c81e07d8bb4acee580c043bd29f63fca0c9ae5 /isys/smp.c
parent716d3e554119528a88cbaeb9ec8ffbe79e44ac1d (diff)
downloadanaconda-6a81b8274f1259a1a03189de0ff8841ff1e1d96a.tar.gz
anaconda-6a81b8274f1259a1a03189de0ff8841ff1e1d96a.tar.xz
anaconda-6a81b8274f1259a1a03189de0ff8841ff1e1d96a.zip
patches for s390
Diffstat (limited to 'isys/smp.c')
-rw-r--r--isys/smp.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/isys/smp.c b/isys/smp.c
index 3ece6cd15..a7e577d65 100644
--- a/isys/smp.c
+++ b/isys/smp.c
@@ -39,6 +39,31 @@ int alphaDetectSMP(void)
}
#endif /* __alpha__ */
+#if defined (__s390__) || defined (__s390x__)
+int s390DetectSMP(void)
+{
+ int issmp = 0;
+ FILE *f;
+
+ f = fopen("/proc/cpuinfo", "r");
+ if (f) {
+ char buff[1024];
+
+ while (fgets (buff, 1024, f) != NULL) {
+ if (!strncmp (buff, "# processors : ", 18)) {
+ if (strtoul (buff + 18, NULL, 0) > 1)
+ issmp = 1;
+ break;
+ }
+ }
+ fclose(f);
+ } else
+ return -1;
+
+ return issmp;
+}
+#endif /* __s390__ */
+
#ifdef __sparc__
int sparcDetectSMP(void)
{
@@ -460,6 +485,10 @@ int detectSMP(void)
return isSMP = alphaDetectSMP();
#elif __ia64__
return isSMP = 1;
+#elif __s390__
+ return isSMP = s390DetectSMP();
+#elif __s390x__
+ return isSMP = s390DetectSMP();
#else
#error unknown architecture
#endif