Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174387251
D39810.id122283.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
D39810.id122283.diff
View Options
diff --git a/sys/riscv/include/cpu.h b/sys/riscv/include/cpu.h
--- a/sys/riscv/include/cpu.h
+++ b/sys/riscv/include/cpu.h
@@ -90,6 +90,7 @@
void cpu_reset(void) __dead2;
void fork_trampoline(void);
void identify_cpu(void);
+void printcpuinfo(void);
static __inline uint64_t
get_cyclecount(void)
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
@@ -365,6 +365,14 @@
void
identify_cpu(void)
+{
+ struct cpu_desc *desc = &cpu_desc[PCPU_GET(cpuid)];
+
+ identify_cpu_ids(desc);
+}
+
+void
+printcpuinfo(void)
{
struct cpu_desc *desc;
u_int cpu, hart;
@@ -373,8 +381,6 @@
hart = PCPU_GET(hart);
desc = &cpu_desc[cpu];
- identify_cpu_ids(desc);
-
/* Print details for boot CPU or if we want verbose output */
if (cpu == 0 || bootverbose) {
/* Summary line. */
diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c
--- a/sys/riscv/riscv/machdep.c
+++ b/sys/riscv/riscv/machdep.c
@@ -128,7 +128,7 @@
{
sbi_print_version();
- identify_cpu();
+ printcpuinfo();
printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)realmem),
ptoa((uintmax_t)realmem) / (1024 * 1024));
@@ -536,6 +536,11 @@
physmem_hardware_regions(mem_regions, mem_regions_sz);
#endif
+ /*
+ * Identify CPU/ISA features.
+ */
+ identify_cpu();
+
/* Do basic tuning, hz etc */
init_param1();
diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c
--- a/sys/riscv/riscv/mp_machdep.c
+++ b/sys/riscv/riscv/mp_machdep.c
@@ -255,6 +255,7 @@
* runtime chip identification.
*/
identify_cpu();
+ printcpuinfo();
/* Enable software interrupts */
riscv_unmask_ipi();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 3, 8:41 PM (5 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40151548
Default Alt Text
D39810.id122283.diff (1 KB)
Attached To
Mode
D39810: riscv: rework CPU identification [2/6]
Attached
Detach File
Event Timeline
Log In to Comment