* VMTranslationMap::Map()/Protect(): Added "memoryType" parameter. Not

implemented for any architecture yet.
* vm_set_area_memory_type(): Call VMTranslationMap::ProtectArea() to change the
  memory type for the already mapped pages.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36574 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-05-01 21:33:12 +00:00
parent 3b0c1b5227
commit c1be1e0761
7 changed files with 49 additions and 26 deletions
+9 -6
View File
@@ -12,10 +12,11 @@
#include <kernel.h>
#include <lock.h>
#include <vm/VMArea.h>
struct kernel_args;
struct vm_page_reservation;
struct VMArea;
struct VMTranslationMap {
@@ -32,8 +33,8 @@ struct VMTranslationMap {
addr_t end) const = 0;
virtual status_t Map(addr_t virtualAddress,
addr_t physicalAddress,
uint32 attributes,
addr_t physicalAddress, uint32 attributes,
uint32 memoryType,
vm_page_reservation* reservation) = 0;
virtual status_t Unmap(addr_t start, addr_t end) = 0;
@@ -54,7 +55,7 @@ struct VMTranslationMap {
uint32* _flags) = 0;
virtual status_t Protect(addr_t base, addr_t top,
uint32 attributes) = 0;
uint32 attributes, uint32 memoryType) = 0;
status_t ProtectPage(VMArea* area, addr_t address,
uint32 attributes);
status_t ProtectArea(VMArea* area,
@@ -119,7 +120,8 @@ struct VMPhysicalPageMapper {
inline status_t
VMTranslationMap::ProtectPage(VMArea* area, addr_t address, uint32 attributes)
{
return Protect(address, address + B_PAGE_SIZE - 1, attributes);
return Protect(address, address + B_PAGE_SIZE - 1, attributes,
area->MemoryType());
}
@@ -127,7 +129,8 @@ VMTranslationMap::ProtectPage(VMArea* area, addr_t address, uint32 attributes)
inline status_t
VMTranslationMap::ProtectArea(VMArea* area, uint32 attributes)
{
return Protect(area->Base(), area->Base() + area->Size() - 1, attributes);
return Protect(area->Base(), area->Base() + area->Size() - 1, attributes,
area->MemoryType());
}