1 /* 2 * Copyright 2010, Ingo Weinhold <ingo_weinhold@gmx.de>. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "GenericVMPhysicalPageMapper.h" 8 9 #include <Errors.h> 10 11 #include "generic_vm_physical_page_mapper.h" 12 #include "generic_vm_physical_page_ops.h" 13 14 15 GenericVMPhysicalPageMapper::GenericVMPhysicalPageMapper() 16 { 17 } 18 19 20 GenericVMPhysicalPageMapper::~GenericVMPhysicalPageMapper() 21 { 22 } 23 24 25 status_t 26 GenericVMPhysicalPageMapper::GetPage(phys_addr_t physicalAddress, 27 addr_t* _virtualAddress, void** _handle) 28 { 29 return generic_get_physical_page(physicalAddress, _virtualAddress, 0); 30 } 31 32 33 status_t 34 GenericVMPhysicalPageMapper::PutPage(addr_t virtualAddress, void* handle) 35 { 36 return generic_put_physical_page(virtualAddress); 37 } 38 39 40 status_t 41 GenericVMPhysicalPageMapper::GetPageCurrentCPU(phys_addr_t physicalAddress, 42 addr_t* _virtualAddress, void** _handle) 43 { 44 // TODO:... 45 return B_UNSUPPORTED; 46 } 47 48 49 status_t 50 GenericVMPhysicalPageMapper::PutPageCurrentCPU(addr_t virtualAddress, 51 void* _handle) 52 { 53 // TODO:... 54 return B_UNSUPPORTED; 55 } 56 57 58 status_t 59 GenericVMPhysicalPageMapper::GetPageDebug(phys_addr_t physicalAddress, 60 addr_t* _virtualAddress, void** _handle) 61 { 62 // TODO:... 63 return B_UNSUPPORTED; 64 } 65 66 67 status_t 68 GenericVMPhysicalPageMapper::PutPageDebug(addr_t virtualAddress, void* handle) 69 { 70 // TODO:... 71 return B_UNSUPPORTED; 72 } 73 74 75 status_t 76 GenericVMPhysicalPageMapper::MemsetPhysical(phys_addr_t address, int value, 77 phys_size_t length) 78 { 79 return generic_vm_memset_physical(address, value, length); 80 } 81 82 83 status_t 84 GenericVMPhysicalPageMapper::MemcpyFromPhysical(void* to, phys_addr_t from, 85 size_t length, bool user) 86 { 87 return generic_vm_memcpy_from_physical(to, from, length, user); 88 } 89 90 91 status_t 92 GenericVMPhysicalPageMapper::MemcpyToPhysical(phys_addr_t to, const void* from, 93 size_t length, bool user) 94 { 95 return generic_vm_memcpy_to_physical(to, from, length, user); 96 } 97 98 99 void 100 GenericVMPhysicalPageMapper::MemcpyPhysicalPage(phys_addr_t to, 101 phys_addr_t from) 102 { 103 generic_vm_memcpy_physical_page(to, from); 104 } 105