summaryrefslogtreecommitdiffstats
path: root/sys/riscv
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2016-03-01 02:59:06 +0000
committerjhibbits <jhibbits@FreeBSD.org>2016-03-01 02:59:06 +0000
commit23e52c351253c7260d6757e98af0854e074ad60f (patch)
treee8575fccac6d1a46eeda88feb03f17cc451d00ee /sys/riscv
parent68514f02c586d3b3b6c559d310a3d0c4379d819c (diff)
downloadFreeBSD-src-23e52c351253c7260d6757e98af0854e074ad60f.zip
FreeBSD-src-23e52c351253c7260d6757e98af0854e074ad60f.tar.gz
Correct the memory rman ranges to be to BUS_SPACE_MAXADDR
Summary: As part of the migration of rman_res_t to be typed to uintmax_t, memory ranges must be clamped appropriately for the bus, to prevent completely bogus addresses from being used. This is extracted from D4544. Reviewed By: cem Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5134
Diffstat (limited to 'sys/riscv')
-rw-r--r--sys/riscv/riscv/nexus.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c
index 8d862a1..a4ced76 100644
--- a/sys/riscv/riscv/nexus.c
+++ b/sys/riscv/riscv/nexus.c
@@ -143,13 +143,14 @@ nexus_attach(device_t dev)
{
mem_rman.rm_start = 0;
- mem_rman.rm_end = ~0ul;
+ mem_rman.rm_end = BUS_SPACE_MAXADDR;
mem_rman.rm_type = RMAN_ARRAY;
mem_rman.rm_descr = "I/O memory addresses";
- if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0))
+ if (rman_init(&mem_rman) ||
+ rman_manage_region(&mem_rman, 0, BUS_SPACE_MAXADDR))
panic("nexus_attach mem_rman");
irq_rman.rm_start = 0;
- irq_rman.rm_end = ~0ul;
+ irq_rman.rm_end = ~0;
irq_rman.rm_type = RMAN_ARRAY;
irq_rman.rm_descr = "Interrupts";
if (rman_init(&irq_rman) || rman_manage_region(&irq_rman, 0, ~0))
OpenPOWER on IntegriCloud