ppc: Implement arch_vm_translation_map_is_kernel_page_accessible()
This remedies "Current thread pointer [...] is an address we can't read from." on entering KDL. Closes ticket #6163. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38293 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -887,6 +887,20 @@ bool
|
|||||||
arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress,
|
arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress,
|
||||||
uint32 protection)
|
uint32 protection)
|
||||||
{
|
{
|
||||||
// TODO: Implement!
|
VMAddressSpace *addressSpace = VMAddressSpace::Kernel();
|
||||||
|
|
||||||
|
PPCVMTranslationMap* map = static_cast<PPCVMTranslationMap*>(
|
||||||
|
addressSpace->TranslationMap());
|
||||||
|
|
||||||
|
phys_addr_t physicalAddress;
|
||||||
|
uint32 flags;
|
||||||
|
if (map->Query(virtualAddress, &physicalAddress, &flags) != B_OK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if ((flags & PAGE_PRESENT) == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// present means kernel-readable, so check for writable
|
||||||
|
return (protection & B_KERNEL_WRITE_AREA) == 0
|
||||||
|
|| (flags & B_KERNEL_WRITE_AREA) != 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user