This allows to check that the entire object falls into the direct map.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 51861 Build 48752: arc lint + arc unit
Event Timeline
I think it would be cleaner to have macro like PHYS_SZ_IN_DMAP(pa, sz) which would check for [pa, pa+sz) belonging to the DMAPed region.
Added the PHYS_SZ_IN_DMAP macro as requested.
Currently this is only added for arm64 and amd64, which are the platforms that use it.
I'm not sure what the policy is in this case, should I add the same macro for other archs to keep the interface consistent?
Only add the macro where needed.
sys/amd64/include/vmparam.h | ||
---|---|---|
247 | No, this is not what I mean. PHYS_SZ_IN_DMAP(pa, sz) should verify that [pa, ps+sz) is mapped by DMAP. |
sys/amd64/include/vmparam.h | ||
---|---|---|
248 | Should the check verify pa+sz-1 instead of pa+sz? Consider the last page in the DMAP, at the address x. If you want to check if the whole page belongs to DMAP-mapped region, you would check the x+PAGE_SIZE address, which lives in the next page not covered by DMAP. |
sys/amd64/include/vmparam.h | ||
---|---|---|
248 | Uh, yes I think it should, the check in PHYS_IN_DMAP uses strict inequality for (pa) < dmaplimit. |