diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2016-03-01 02:59:06 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2016-03-01 02:59:06 +0000 |
commit | 23e52c351253c7260d6757e98af0854e074ad60f (patch) | |
tree | e8575fccac6d1a46eeda88feb03f17cc451d00ee /sys/arm64 | |
parent | 68514f02c586d3b3b6c559d310a3d0c4379d819c (diff) | |
download | FreeBSD-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/arm64')
-rw-r--r-- | sys/arm64/arm64/nexus.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 94b9048..cdc5fc8 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -153,13 +153,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)) |