aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/cache-info.c2
-rw-r--r--tools/cpu-info.c33
2 files changed, 21 insertions, 14 deletions
diff --git a/tools/cache-info.c b/tools/cache-info.c
index cbe9e6e..a4ca3e8 100644
--- a/tools/cache-info.c
+++ b/tools/cache-info.c
@@ -5,7 +5,7 @@
void report_cache(
- uint32_t count, const struct cpuinfo_cache cache[restrict static 1],
+ uint32_t count, const struct cpuinfo_cache* cache,
uint32_t level, const char* nonunified_type)
{
const char* type = (cache->flags & CPUINFO_CACHE_UNIFIED) ? "unified" : nonunified_type;
diff --git a/tools/cpu-info.c b/tools/cpu-info.c
index 5d4002f..445b433 100644
--- a/tools/cpu-info.c
+++ b/tools/cpu-info.c
@@ -196,25 +196,32 @@ int main(int argc, char** argv) {
for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) {
const struct cpuinfo_core* core = cpuinfo_get_core(i);
if (core->processor_count == 1) {
- printf("\t%"PRIu32": 1 processor (%"PRIu32")\n", i, core->processor_start);
+ printf("\t%"PRIu32": 1 processor (%"PRIu32")", i, core->processor_start);
} else {
- printf("\t%"PRIu32": %"PRIu32" processors (%"PRIu32"-%"PRIu32")\n",
+ printf("\t%"PRIu32": %"PRIu32" processors (%"PRIu32"-%"PRIu32")",
i, core->processor_count, core->processor_start, core->processor_start + core->processor_count - 1);
}
+ const char* vendor_string = vendor_to_string(core->vendor);
+ const char* uarch_string = uarch_to_string(core->uarch);
+ if (vendor_string == NULL) {
+ printf(", vendor 0x%08"PRIx32" uarch 0x%08"PRIx32"\n",
+ (uint32_t) core->vendor, (uint32_t) core->uarch);
+ }
+ else if (uarch_string == NULL) {
+ printf(", %s uarch 0x%08"PRIx32"\n",
+ vendor_string, (uint32_t) core->uarch);
+ }
+ else {
+ printf(", %s %s\n", vendor_string, uarch_string);
+ }
}
printf("Logical processors:\n");
for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) {
const struct cpuinfo_processor* processor = cpuinfo_get_processor(i);
- const char* vendor_string = vendor_to_string(processor->core->vendor);
- const char* uarch_string = uarch_to_string(processor->core->uarch);
- if (vendor_string == NULL) {
- printf("\t%"PRIu32": vendor 0x%08"PRIx32" uarch 0x%08"PRIx32"\n",
- i, (uint32_t) processor->core->vendor, (uint32_t) processor->core->uarch);
- } else if (uarch_string == NULL) {
- printf("\t%"PRIu32": %s uarch 0x%08"PRIx32"\n",
- i, vendor_string, (uint32_t) processor->core->uarch);
- } else {
- printf("\t%"PRIu32": %s %s\n", i, vendor_string, uarch_string);
- }
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
+ printf("\t%"PRIu32": APIC ID 0x%08"PRIx32"\n", i, processor->apic_id);
+ #else
+ printf("\t%"PRIu32"\n", i);
+ #endif
}
}