Any IO devices used directly by the kernel --- generally including the interrupt controller, one of the timer devices, and optionally a serial port for debugging --- must be mapped in the global address space. This implementation limits device mappings to one page; it may need to be extended to support multiple-page mappings.
>mapKernelDevice::(PAddr,PPtrWord)->Kernel()
...
...
@@ -805,8 +814,7 @@ If the current thread has no page directory, or if it has an invalid ASID, the h
>capPDBasePtr=pd})->checkPDNotInASIDMappd
>_->return()
>globalPD<-gets(armKSGlobalPD.ksArchState)
>doMachineOp$setCurrentPD$addrFromPPtrglobalPD
>)
>doMachineOp$setCurrentPD$addrFromPPtrglobalPD)
When cleaning the cache by user virtual address on ARM11, the active address space must be the one that contains the mappings being cleaned. The following function is used to temporarily switch to a given page directory and ASID, in order to clean the cache. It returns "True" if the address space was not the same as the current one, in which case the caller must switch back to the current address space once the cache is clean.