Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133341674
D40024.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40024.diff
View Options
diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c
--- a/sys/riscv/riscv/identcpu.c
+++ b/sys/riscv/riscv/identcpu.c
@@ -447,18 +447,30 @@
KASSERT(desc->isa_extensions != 0,
("Empty extension set for CPU %u, did parsing fail?", cpu));
- /* Print details for boot CPU or if we want verbose output */
- if (cpu == 0 || bootverbose) {
- /* Summary line. */
- printf("CPU %-3u: Vendor=%s Core=%s (Hart %u)\n", cpu,
- desc->cpu_mvendor_name, desc->cpu_march_name, hart);
+ /*
+ * Suppress the output of some fields in the common case of identical
+ * CPU features.
+ */
+#define SHOULD_PRINT(_field) \
+ (cpu == 0 || desc[0]._field != desc[-1]._field)
+ /* Always print summary line. */
+ printf("CPU %-3u: Vendor=%s Core=%s (Hart %u)\n", cpu,
+ desc->cpu_mvendor_name, desc->cpu_march_name, hart);
+
+ /* These values are global. */
+ if (cpu == 0)
printf(" marchid=%#lx, mimpid=%#lx\n", marchid, mimpid);
+
+ if (SHOULD_PRINT(mmu_caps)) {
printf(" MMU: %#b\n", desc->mmu_caps,
"\020"
"\01Sv39"
"\02Sv48"
"\03Sv57");
+ }
+
+ if (SHOULD_PRINT(isa_extensions)) {
printf(" ISA: %#b\n", desc->isa_extensions,
"\020"
"\01Atomic"
@@ -467,4 +479,6 @@
"\06Float"
"\15Mult/Div");
}
+
+#undef SHOULD_PRINT
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 26, 1:32 AM (2 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24204341
Default Alt Text
D40024.diff (1 KB)
Attached To
Mode
D40024: riscv: rework CPU identification [7/7]
Attached
Detach File
Event Timeline
Log In to Comment