Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157036602
D36980.id111770.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
D36980.id111770.diff
View Options
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
@@ -403,6 +403,20 @@
}
#ifdef FDT
+static boolean_t
+cpu_check_mmu(u_int id __unused, phandle_t node, u_int addr_size __unused,
+ pcell_t *reg __unused)
+{
+ char type[32];
+
+ /* Check if this hart supports MMU. */
+ if (OF_getprop(node, "mmu-type", (void *)type, sizeof(type)) == -1 ||
+ strncmp(type, "riscv,none", 10) == 0)
+ return (0);
+
+ return (1);
+}
+
static boolean_t
cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
{
@@ -413,8 +427,7 @@
int naps;
int error;
- /* Check if this hart supports MMU. */
- if (OF_getproplen(node, "mmu-type") < 0)
+ if (!cpu_check_mmu(id, node, addr_size, reg))
return (0);
KASSERT(id < MAXCPU, ("Too many CPUs"));
@@ -521,17 +534,6 @@
{
}
-static boolean_t
-cpu_check_mmu(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
-{
-
- /* Check if this hart supports MMU. */
- if (OF_getproplen(node, "mmu-type") < 0)
- return (0);
-
- return (1);
-}
-
void
cpu_mp_setmaxid(void)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 19, 1:54 AM (10 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33284211
Default Alt Text
D36980.id111770.diff (1 KB)
Attached To
Mode
D36980: riscv: reject CPUs with mmu-type "riscv,none"
Attached
Detach File
Event Timeline
Log In to Comment