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