Device memory registration currently stops when /soc or its ranges
property is absent and only considers direct /soc children. Some
devicetrees place the interrupt controller at the root and the
selected UART below nested buses.
Register the exact translated range of the diagnostic UART and the
register ranges of root interrupt controllers. Use the hierarchical
translator when initializing GICv2 and GICv3 registers.
This keeps the translation change limited to the selected console
and interrupt controllers while preserving the existing behavior for
other devices.
Signed-off-by: Luiz Fernando Becher de Araujo <luiz.becher.araujo@gmail.com>
The existing MMIO helper only translates addresses through the /soc
ranges property. This does not handle devices below nested buses,
such as the UART in the devicetree used by the Meson boards.
Add an address translator that walks each ancestor bus and applies
its ranges property until reaching the CPU address space. Treat
empty ranges as an identity mapping and reject regions that cross a
range boundary.
Keep the existing helper’s behavior unchanged for other devices to
limit the scope of the behavioral change.
Add tests for nested buses, empty ranges, exact range boundaries,
and regions crossing a boundary.
Signed-off-by: Luiz Fernando Becher de Araujo <luiz.becher.araujo@gmail.com>
* Remove lots of unsafe code by initialising in the closure passed to
`call_once`
* Remove `NUMBER_OF_DOMAINS` as size can always be inferred from the
hashmap's len
* `syscall::sendfd`, now, when called with a `ContextHandle::FileTable` adds the fd to the filetable removing it from the calling process's filetable
* Files can now be added to, removed from another process, and can be duplicated using `ProcScheme::kcall`
* Files of another process with the flag O_CLOEXEC can now be closed by using `kcall`