summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mptable.c37
-rw-r--r--x86info.c1
2 files changed, 23 insertions, 15 deletions
diff --git a/mptable.c b/mptable.c
index f682eea..9c84e65 100644
--- a/mptable.c
+++ b/mptable.c
@@ -72,6 +72,7 @@ static int ncpu;
static int nbus;
static int napic;
static int nintr;
+static int silent;
typedef struct TABLE_ENTRY {
u8 type;
@@ -175,22 +176,25 @@ static void processorEntry(void)
/* count it */
++ncpu;
- printf("#\t%2d", (int) entry.apicID);
- printf("\t 0x%2x", (unsigned int) entry.apicVersion);
+ if (!silent) {
+ printf("#\t%2d", (int) entry.apicID);
+ printf("\t 0x%2x", (unsigned int) entry.apicVersion);
- printf("\t %s, %s",
- (entry.cpuFlags & PROCENTRY_FLAG_BP) ? "BSP" : "AP",
- (entry.cpuFlags & PROCENTRY_FLAG_EN) ? "usable" : "unusable");
+ printf("\t %s, %s",
+ (entry.cpuFlags & PROCENTRY_FLAG_BP) ? "BSP" : "AP",
+ (entry.cpuFlags & PROCENTRY_FLAG_EN) ? "usable" : "unusable");
- t = (int) entry.cpuSignature;
- family = (t >> 8) & 0xf;
- model = (t >> 4) & 0xf;
- if (family == 0xf) {
- family += (t >> 20) & 0xff;
- model += (t >> 12) & 0xf0;
+ t = (int) entry.cpuSignature;
+ family = (t >> 8) & 0xf;
+ model = (t >> 4) & 0xf;
+ if (family == 0xf) {
+ family += (t >> 20) & 0xff;
+ model += (t >> 12) & 0xf0;
+ }
+
+ printf("\t %d\t %d\t %d", family, model, t & 0xf);
+ printf("\t 0x%04x\n", entry.featureFlags);
}
- printf("\t %d\t %d\t %d", family, model, t & 0xf);
- printf("\t 0x%04x\n", entry.featureFlags);
}
@@ -227,7 +231,8 @@ static int MPConfigTableHeader(u32 pap)
nintr = 0;
/* process all the CPUs */
- printf("MP Table:\n#\tAPIC ID\tVersion\tState\t\tFamily\tModel\tStep\tFlags\n");
+ if (!silent)
+ printf("MP Table:\n#\tAPIC ID\tVersion\tState\t\tFamily\tModel\tStep\tFlags\n");
for (c = count; c; c--) {
if (readType() == 0)
processorEntry();
@@ -352,6 +357,8 @@ int enumerate_cpus(void)
vm_offset_t paddr;
mpfps_t mpfps;
+ silent = 1;
+
/* open physical memory for access to MP structures */
if ((pfd = open("/dev/mem", O_RDONLY)) < 0) {
fprintf(stderr, "enumerate_cpus(): /dev/mem: %s\n", strerror(errno));
@@ -379,6 +386,8 @@ void display_mptable()
vm_offset_t paddr;
mpfps_t mpfps;
+ silent = 0;
+
/* open physical memory for access to MP structures */
if ((pfd = open("/dev/mem", O_RDONLY)) < 0) {
fprintf(stderr, "%s(): /dev/mem: %s\n", __func__, strerror(errno));
diff --git a/x86info.c b/x86info.c
index e501b15..171b9f2 100644
--- a/x86info.c
+++ b/x86info.c
@@ -486,7 +486,6 @@ int main (int argc, char **argv)
if (show_mptable && user_is_root)
display_mptable();
-
/* Now we display the info we gathered */
cpu = firstcpu;