xref: /haiku/src/system/kernel/arch/generic/GenericVMPhysicalPageMapper.h (revision cbe0a0c436162d78cc3f92a305b64918c839d079)
1 /*
2  * Copyright 2010, Ingo Weinhold <ingo_weinhold@gmx.de>.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _KERNEL_GENERIC_VM_PHYSICAL_PAGE_MAPPER_CLASS_H
6 #define _KERNEL_GENERIC_VM_PHYSICAL_PAGE_MAPPER_CLASS_H
7 
8 
9 #include <vm/VMTranslationMap.h>
10 
11 
12 struct GenericVMPhysicalPageMapper : VMPhysicalPageMapper {
13 								GenericVMPhysicalPageMapper();
14 	virtual						~GenericVMPhysicalPageMapper();
15 
16 	virtual	status_t			GetPage(phys_addr_t physicalAddress,
17 									addr_t* _virtualAddress,
18 									void** _handle);
19 	virtual	status_t			PutPage(addr_t virtualAddress,
20 									void* handle);
21 
22 	virtual	status_t			GetPageCurrentCPU(
23 									phys_addr_t physicalAddress,
24 									addr_t* _virtualAddress,
25 									void** _handle);
26 	virtual	status_t			PutPageCurrentCPU(addr_t virtualAddress,
27 									void* _handle);
28 
29 	virtual	status_t			GetPageDebug(phys_addr_t physicalAddress,
30 									addr_t* _virtualAddress,
31 									void** _handle);
32 	virtual	status_t			PutPageDebug(addr_t virtualAddress,
33 									void* handle);
34 
35 	virtual	status_t			MemsetPhysical(phys_addr_t address, int value,
36 									phys_size_t length);
37 	virtual	status_t			MemcpyFromPhysical(void* to, phys_addr_t from,
38 									size_t length, bool user);
39 	virtual	status_t			MemcpyToPhysical(phys_addr_t to,
40 									const void* from, size_t length, bool user);
41 	virtual	void				MemcpyPhysicalPage(phys_addr_t to,
42 									phys_addr_t from);
43 };
44 
45 
46 #endif	// _KERNEL_GENERIC_VM_PHYSICAL_PAGE_MAPPER_CLASS_H
47