* Added a level of indirection for the arch_vm_translation_map functions.
Introduced the interface X86PagingMethod which is used by those. ATM there's one implementing class, X86PagingMethod32Bit. * Made X86PagingStructures a base class, with one derived class, X86PagingStructures32Bit. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37050 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c411bbc095
commit
c6caf520ca
@ -40,6 +40,8 @@ KernelMergeObject kernel_arch_x86.o :
|
||||
x86_physical_page_mapper.cpp
|
||||
x86_physical_page_mapper_large_memory.cpp
|
||||
x86_syscalls.cpp
|
||||
X86PagingMethod.cpp
|
||||
X86PagingMethod32Bit.cpp
|
||||
|
||||
x86_apic.cpp
|
||||
x86_hpet.cpp
|
||||
|
12
src/system/kernel/arch/x86/X86PagingMethod.cpp
Normal file
12
src/system/kernel/arch/x86/X86PagingMethod.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include "X86PagingMethod.h"
|
||||
|
||||
|
||||
X86PagingMethod::~X86PagingMethod()
|
||||
{
|
||||
}
|
41
src/system/kernel/arch/x86/X86PagingMethod.h
Normal file
41
src/system/kernel/arch/x86/X86PagingMethod.h
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef KERNEL_ARCH_X86_X86_PAGING_METHOD_H
|
||||
#define KERNEL_ARCH_X86_X86_PAGING_METHOD_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
struct kernel_args;
|
||||
struct VMPhysicalPageMapper;
|
||||
struct VMTranslationMap;
|
||||
|
||||
|
||||
class X86PagingMethod {
|
||||
public:
|
||||
virtual ~X86PagingMethod();
|
||||
|
||||
virtual status_t Init(kernel_args* args,
|
||||
VMPhysicalPageMapper** _physicalPageMapper)
|
||||
= 0;
|
||||
virtual status_t InitPostArea(kernel_args* args) = 0;
|
||||
|
||||
virtual status_t CreateTranslationMap(bool kernel,
|
||||
VMTranslationMap** _map) = 0;
|
||||
|
||||
virtual status_t MapEarly(kernel_args* args,
|
||||
addr_t virtualAddress,
|
||||
phys_addr_t physicalAddress,
|
||||
uint8 attributes,
|
||||
phys_addr_t (*get_free_page)(kernel_args*))
|
||||
= 0;
|
||||
|
||||
virtual bool IsKernelPageAccessible(addr_t virtualAddress,
|
||||
uint32 protection) = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // KERNEL_ARCH_X86_X86_PAGING_METHOD_H
|
1503
src/system/kernel/arch/x86/X86PagingMethod32Bit.cpp
Normal file
1503
src/system/kernel/arch/x86/X86PagingMethod32Bit.cpp
Normal file
File diff suppressed because it is too large
Load Diff
46
src/system/kernel/arch/x86/X86PagingMethod32Bit.h
Normal file
46
src/system/kernel/arch/x86/X86PagingMethod32Bit.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef KERNEL_ARCH_X86_X86_PAGING_METHOD_32_BIT_H
|
||||
#define KERNEL_ARCH_X86_X86_PAGING_METHOD_32_BIT_H
|
||||
|
||||
|
||||
#include "x86_paging.h"
|
||||
#include "X86PagingMethod.h"
|
||||
|
||||
|
||||
struct X86PagingStructures32Bit : X86PagingStructures {
|
||||
X86PagingStructures32Bit();
|
||||
virtual ~X86PagingStructures32Bit();
|
||||
|
||||
virtual void Delete();
|
||||
};
|
||||
|
||||
|
||||
class X86PagingMethod32Bit : public X86PagingMethod {
|
||||
public:
|
||||
X86PagingMethod32Bit();
|
||||
virtual ~X86PagingMethod32Bit();
|
||||
|
||||
static X86PagingMethod* Create();
|
||||
|
||||
virtual status_t Init(kernel_args* args,
|
||||
VMPhysicalPageMapper** _physicalPageMapper);
|
||||
virtual status_t InitPostArea(kernel_args* args);
|
||||
|
||||
virtual status_t CreateTranslationMap(bool kernel,
|
||||
VMTranslationMap** _map);
|
||||
|
||||
virtual status_t MapEarly(kernel_args* args,
|
||||
addr_t virtualAddress,
|
||||
phys_addr_t physicalAddress,
|
||||
uint8 attributes,
|
||||
phys_addr_t (*get_free_page)(kernel_args*));
|
||||
|
||||
virtual bool IsKernelPageAccessible(addr_t virtualAddress,
|
||||
uint32 protection);
|
||||
};
|
||||
|
||||
|
||||
#endif // KERNEL_ARCH_X86_X86_PAGING_METHOD_32_BIT_H
|
File diff suppressed because it is too large
Load Diff
@ -74,7 +74,7 @@ struct X86PagingStructures : DeferredDeletable {
|
||||
inline void AddReference();
|
||||
inline void RemoveReference();
|
||||
|
||||
void Delete();
|
||||
virtual void Delete() = 0;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user