1/*
2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef KERNEL_ARCH_M68K_PAGING_M68K_PHYSICAL_PAGE_MAPPER_LARGE_MEMORY_H
6#define KERNEL_ARCH_M68K_PAGING_M68K_PHYSICAL_PAGE_MAPPER_LARGE_MEMORY_H
7
8
9#include <OS.h>
10
11#include <util/DoublyLinkedList.h>
12
13
14class TranslationMapPhysicalPageMapper;
15class M68KPhysicalPageMapper;
16struct kernel_args;
17
18
19namespace M68KLargePhysicalPageMapper {
20
21
22struct PhysicalPageSlotPool;
23
24
25struct PhysicalPageSlot {
26	PhysicalPageSlot*			next;
27	PhysicalPageSlotPool*		pool;
28	addr_t						address;
29
30	inline	void				Map(phys_addr_t physicalAddress);
31};
32
33
34struct PhysicalPageSlotPool : DoublyLinkedListLinkImpl<PhysicalPageSlotPool> {
35
36	virtual						~PhysicalPageSlotPool();
37
38	inline	bool				IsEmpty() const;
39
40	inline	PhysicalPageSlot*	GetSlot();
41	inline	void				PutSlot(PhysicalPageSlot* slot);
42
43	virtual	status_t			AllocatePool(PhysicalPageSlotPool*& _pool) = 0;
44	virtual	void				Map(phys_addr_t physicalAddress,
45									addr_t virtualAddress) = 0;
46
47protected:
48			PhysicalPageSlot*	fSlots;
49};
50
51
52}
53
54
55status_t large_memory_physical_page_ops_init(kernel_args* args,
56	M68KLargePhysicalPageMapper::PhysicalPageSlotPool* initialPool,
57	M68KPhysicalPageMapper*& _pageMapper,
58	TranslationMapPhysicalPageMapper*& _kernelPageMapper);
59
60
61#endif	// KERNEL_ARCH_M68K_PAGING_M68K_PHYSICAL_PAGE_MAPPER_LARGE_MEMORY_H
62