This is needed when temporarily mapping a device, bus_space_unmap
needs the size to be passed in.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Why do you need this? I don't understand the description since OF_decode_addr() calls bus_space_map() internally.
That makes sense, thanks. Where are you planning to use this that you want to unmap it? The function is intended for use only in early boot (UART consoles in particular) where you don't ever want to unmap the result. The patch itself looks good to me.
I'm using it to replace calls to fdt_get_range and fdt_regsize.
I found the Amlogic clock driver may be asked to read a frequency register early in the boot. It then uses this to set the bus-frequency property on a node so the mmc driver can read it back when it attaches. To read this data it needs to map the registers, read, then can unmap them, but needs the size to unmap.
This does seem to be a work around for our lack of a clock management framework, but that would be even more work to implement.
Add your reply to Nathan to the commit message to make it easier to see at first glance the reasoning behind it.