diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/arm64/arm64/machdep.c | 18 | ||||
-rw-r--r-- | sys/arch/riscv64/riscv64/machdep.c | 5 |
2 files changed, 21 insertions, 2 deletions
diff --git a/sys/arch/arm64/arm64/machdep.c b/sys/arch/arm64/arm64/machdep.c index 69dc76ae9d2..fc1df710f67 100644 --- a/sys/arch/arm64/arm64/machdep.c +++ b/sys/arch/arm64/arm64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.85 2023/12/04 15:00:09 claudio Exp $ */ +/* $OpenBSD: machdep.c,v 1.86 2024/02/21 01:45:14 dlg Exp $ */ /* * Copyright (c) 2014 Patrick Wildt <patrick@blueri.se> * Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org> @@ -1053,6 +1053,22 @@ initarm(struct arm64_bootparams *abp) } } + /* Remove reserved memory. */ + node = fdt_find_node("/reserved-memory"); + if (node) { + for (node = fdt_child_node(node); node; + node = fdt_next_node(node)) { + char *no_map; + if (fdt_node_property(node, "no-map", &no_map) < 0) + continue; + if (fdt_get_reg(node, 0, ®)) + continue; + if (reg.size == 0) + continue; + memreg_remove(®); + } + } + /* Remove the initial 64MB block. */ reg.addr = memstart; reg.size = memend - memstart; diff --git a/sys/arch/riscv64/riscv64/machdep.c b/sys/arch/riscv64/riscv64/machdep.c index 7658ba0df54..1141cd27786 100644 --- a/sys/arch/riscv64/riscv64/machdep.c +++ b/sys/arch/riscv64/riscv64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.34 2024/01/23 19:51:10 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.35 2024/02/21 01:45:14 dlg Exp $ */ /* * Copyright (c) 2014 Patrick Wildt <patrick@blueri.se> @@ -792,6 +792,9 @@ initriscv(struct riscv_bootparams *rbp) if (node) { for (node = fdt_child_node(node); node; node = fdt_next_node(node)) { + char *no_map; + if (fdt_node_property(node, "no-map", &no_map) < 0) + continue; if (fdt_get_reg(node, 0, ®)) continue; if (reg.size == 0) |