diff options
author | cognet <cognet@FreeBSD.org> | 2013-08-10 00:31:49 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2013-08-10 00:31:49 +0000 |
commit | e5d07cf87956bafb941eedcd1e6d9c5517323319 (patch) | |
tree | 7f979167d1a579c19533510d372bde3daeda33c2 /sys/arm | |
parent | 340906f4262351183cf7c5b706d304261a6cac87 (diff) | |
download | FreeBSD-src-e5d07cf87956bafb941eedcd1e6d9c5517323319.zip FreeBSD-src-e5d07cf87956bafb941eedcd1e6d9c5517323319.tar.gz |
- The address lies in the bus space handle, not in the cookie
- Use the right address when calling kva_free()
(Is there any reason why the s3c2xx0 comes with its own version of bs_map/
bs_unmap ? It seems to be just the same as in bus_space_generic.c)
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/s3c2xx0/s3c2xx0_space.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arm/s3c2xx0/s3c2xx0_space.c b/sys/arm/s3c2xx0/s3c2xx0_space.c index ab72370..742d7f3 100644 --- a/sys/arm/s3c2xx0/s3c2xx0_space.c +++ b/sys/arm/s3c2xx0/s3c2xx0_space.c @@ -200,21 +200,21 @@ s3c2xx0_bs_map(void *t, bus_addr_t bpa, bus_size_t size, void s3c2xx0_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) { - vm_offset_t va, endva; + vm_offset_t va, endva, origva; - if (pmap_devmap_find_va((vm_offset_t)t, size) != NULL) { + if (pmap_devmap_find_va((vm_offset_t)h, size) != NULL) { /* Device was statically mapped; nothing to do. */ return; } - endva = round_page((vm_offset_t)t + size); - va = trunc_page((vm_offset_t)t); + endva = round_page((vm_offset_t)h + size); + origva = va = trunc_page((vm_offset_t)h); while (va < endva) { pmap_kremove(va); va += PAGE_SIZE; } - kva_free(va, endva - va); + kva_free(va, endva - origva); } int |