From dbff3d0a7217cd124141607b46a08325c3c916c2 Mon Sep 17 00:00:00 2001
From: Andreas Faerber <andreas.faerber@web.de>
Date: Sat, 12 Jun 2010 22:45:41 +0200
Subject: [PATCH] ppc: Implement arch_vm_translation_map_is_kernel_page_accessible
---
.../kernel/arch/ppc/arch_vm_translation_map.cpp | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp b/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp
index 7b42772..8cc25d9 100644
a
|
b
|
bool
|
927 | 927 | arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress, |
928 | 928 | uint32 protection) |
929 | 929 | { |
930 | | // TODO: Implement! |
931 | | return false; |
| 930 | VMAddressSpace *addressSpace = VMAddressSpace::Kernel(); |
| 931 | |
| 932 | PPCVMTranslationMap* map = static_cast<PPCVMTranslationMap*>( |
| 933 | addressSpace->TranslationMap()); |
| 934 | phys_addr_t physicalAddress; |
| 935 | uint32 flags; |
| 936 | if (map->Query(virtualAddress, &physicalAddress, &flags) != B_OK) |
| 937 | return false; |
| 938 | if ((flags & PAGE_PRESENT) == 0) |
| 939 | return false; |
| 940 | return (protection & B_KERNEL_WRITE_AREA) == 0 |
| 941 | || (flags & B_KERNEL_WRITE_AREA) != 0; |
932 | 942 | } |