Commit 7022ec49 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

s390/sysinfo: add missing SYSIB 1.2.2 multithreading fields

Add missing multithreading fields of SYSIB 1.2.2 (Basic-Machine CPUs)
to the output of /proc/sysinfo.

Also use bitfields for SYSIB 2.2.2 to simplify the C code a bit.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 9236b4dd
...@@ -56,7 +56,12 @@ struct sysinfo_1_2_2 { ...@@ -56,7 +56,12 @@ struct sysinfo_1_2_2 {
char format; char format;
char reserved_0[1]; char reserved_0[1];
unsigned short acc_offset; unsigned short acc_offset;
char reserved_1[20]; unsigned char mt_installed :1;
unsigned char :2;
unsigned char mt_stid :5;
unsigned char :3;
unsigned char mt_gtid :5;
char reserved_1[18];
unsigned int nominal_cap; unsigned int nominal_cap;
unsigned int secondary_cap; unsigned int secondary_cap;
unsigned int capability; unsigned int capability;
...@@ -92,9 +97,13 @@ struct sysinfo_2_2_2 { ...@@ -92,9 +97,13 @@ struct sysinfo_2_2_2 {
char name[8]; char name[8];
unsigned int caf; unsigned int caf;
char reserved_2[8]; char reserved_2[8];
unsigned char mt_installed; unsigned char mt_installed :1;
unsigned char mt_general; unsigned char :2;
unsigned char mt_psmtid; unsigned char mt_stid :5;
unsigned char :3;
unsigned char mt_gtid :5;
unsigned char :3;
unsigned char mt_psmtid :5;
char reserved_3[5]; char reserved_3[5];
unsigned short cpus_dedicated; unsigned short cpus_dedicated;
unsigned short cpus_shared; unsigned short cpus_shared;
......
...@@ -144,6 +144,10 @@ static void stsi_1_2_2(struct seq_file *m, struct sysinfo_1_2_2 *info) ...@@ -144,6 +144,10 @@ static void stsi_1_2_2(struct seq_file *m, struct sysinfo_1_2_2 *info)
seq_printf(m, "CPUs Configured: %d\n", info->cpus_configured); seq_printf(m, "CPUs Configured: %d\n", info->cpus_configured);
seq_printf(m, "CPUs Standby: %d\n", info->cpus_standby); seq_printf(m, "CPUs Standby: %d\n", info->cpus_standby);
seq_printf(m, "CPUs Reserved: %d\n", info->cpus_reserved); seq_printf(m, "CPUs Reserved: %d\n", info->cpus_reserved);
if (info->mt_installed) {
seq_printf(m, "CPUs G-MTID: %d\n", info->mt_gtid);
seq_printf(m, "CPUs S-MTID: %d\n", info->mt_stid);
}
/* /*
* Sigh 2. According to the specification the alternate * Sigh 2. According to the specification the alternate
* capability field is a 32 bit floating point number * capability field is a 32 bit floating point number
...@@ -193,13 +197,10 @@ static void stsi_2_2_2(struct seq_file *m, struct sysinfo_2_2_2 *info) ...@@ -193,13 +197,10 @@ static void stsi_2_2_2(struct seq_file *m, struct sysinfo_2_2_2 *info)
seq_printf(m, "LPAR CPUs Reserved: %d\n", info->cpus_reserved); seq_printf(m, "LPAR CPUs Reserved: %d\n", info->cpus_reserved);
seq_printf(m, "LPAR CPUs Dedicated: %d\n", info->cpus_dedicated); seq_printf(m, "LPAR CPUs Dedicated: %d\n", info->cpus_dedicated);
seq_printf(m, "LPAR CPUs Shared: %d\n", info->cpus_shared); seq_printf(m, "LPAR CPUs Shared: %d\n", info->cpus_shared);
if (info->mt_installed & 0x80) { if (info->mt_installed) {
seq_printf(m, "LPAR CPUs G-MTID: %d\n", seq_printf(m, "LPAR CPUs G-MTID: %d\n", info->mt_gtid);
info->mt_general & 0x1f); seq_printf(m, "LPAR CPUs S-MTID: %d\n", info->mt_stid);
seq_printf(m, "LPAR CPUs S-MTID: %d\n", seq_printf(m, "LPAR CPUs PS-MTID: %d\n", info->mt_psmtid);
info->mt_installed & 0x1f);
seq_printf(m, "LPAR CPUs PS-MTID: %d\n",
info->mt_psmtid & 0x1f);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment