The Pedigree Project  0.1
Public Member Functions | Private Member Functions | Static Private Attributes | Friends | List of all members
X86KernelVirtualAddressSpace Class Reference

#include <VirtualAddressSpace.h>

+ Inheritance diagram for X86KernelVirtualAddressSpace:
+ Collaboration diagram for X86KernelVirtualAddressSpace:

Public Member Functions

virtual bool isMapped (void *virtualAddress)
 
virtual bool map (physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)
 
virtual void getMapping (void *virtualAddress, physical_uintptr_t &physicalAddress, size_t &flags)
 
virtual void setFlags (void *virtualAddress, size_t newFlags)
 
virtual void unmap (void *virtualAddress)
 
virtual void * allocateStack ()
 
- Public Member Functions inherited from X86VirtualAddressSpace
virtual bool isAddressValid (void *virtualAddress)
 
virtual void * allocateStack (size_t stackSz)
 
virtual void freeStack (void *pStack)
 
virtual bool memIsInHeap (void *pMem)
 
virtual void * getEndOfHeap ()
 
virtual VirtualAddressSpaceclone ()
 
virtual void revertToKernelAddressSpace ()
 
bool mapPageStructures (physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)
 
virtual ~X86VirtualAddressSpace ()
 
virtual uintptr_t getKernelStart () const
 
virtual uintptr_t getUserStart () const
 
virtual uintptr_t getUserReservedStart () const
 
virtual uintptr_t getDynamicLinkerAddress () const
 
virtual uintptr_t getKernelHeapStart () const
 
virtual uintptr_t getKernelHeapEnd () const
 
- Public Member Functions inherited from VirtualAddressSpace
virtual void * expandHeap (ssize_t incr, size_t flags)
 
virtual bool mapHuge (physical_uintptr_t physAddress, void *virtualAddress, size_t count, size_t flags)
 
virtual void freeStack (Stack *pStack)=0
 
virtual VirtualAddressSpaceclone (bool copyOnWrite=true)=0
 
virtual ~VirtualAddressSpace ()
 
void setHeap (void *heap, void *heapEnd)
 
virtual bool memIsInKernelHeap (void *pMem)=0
 
virtual uintptr_t getKernelCacheStart () const =0
 
virtual uintptr_t getKernelCacheEnd () const =0
 
virtual uintptr_t getKernelEventBlockStart () const =0
 
virtual uintptr_t getKernelModulesStart () const =0
 
virtual uintptr_t getKernelModulesEnd () const =0
 
virtual uintptr_t getDynamicStart () const
 
virtual uintptr_t getDynamicEnd () const
 
virtual uintptr_t getGlobalInfoBlock () const
 

Private Member Functions

 X86KernelVirtualAddressSpace ()
 
 ~X86KernelVirtualAddressSpace ()
 
 X86KernelVirtualAddressSpace (const X86KernelVirtualAddressSpace &)
 
X86KernelVirtualAddressSpaceoperator= (const X86KernelVirtualAddressSpace &)
 

Static Private Attributes

static X86KernelVirtualAddressSpace m_Instance
 

Friends

class X86VirtualAddressSpace
 
VirtualAddressSpaceVirtualAddressSpace::getKernelAddressSpace ()
 

Additional Inherited Members

- Static Public Member Functions inherited from X86VirtualAddressSpace
static void initialise () INITIALISATION_ONLY
 
- Static Public Member Functions inherited from VirtualAddressSpace
static EXPORTED_PUBLIC VirtualAddressSpacegetKernelAddressSpace ()
 
static VirtualAddressSpacecreate ()
 
- Public Attributes inherited from VirtualAddressSpace
void * m_Heap
 
void * m_HeapEnd
 
- Static Public Attributes inherited from VirtualAddressSpace
static const size_t KernelMode = 0x01
 
static const size_t Write = 0x02
 
static const size_t Execute = 0x04
 
static const size_t WriteThrough = 0x08
 
static const size_t CacheDisable = 0x10
 
static const size_t CopyOnWrite = 0x20
 
static const size_t Swapped = 0x40
 
static const size_t MemoryCoherent = 0x80
 
static const size_t Guarded = 0x100
 
static const size_t Shared = 0x200
 
static const size_t WriteCombine = 0x400
 
static const size_t Accessed = 0x800
 
static const size_t Dirty = 0x1000
 
static const size_t ClearDirty = 0x2000
 
static physical_uintptr_t m_ZeroPage = 0
 
- Protected Member Functions inherited from X86VirtualAddressSpace
 X86VirtualAddressSpace (void *Heap, physical_uintptr_t PhysicalPageDirectory, void *VirtualPageDirectory, void *VirtualPageTables, void *VirtualStack) INITIALISATION_ONLY
 
bool doIsMapped (void *virtualAddress)
 
bool doMap (physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)
 
void doGetMapping (void *virtualAddress, physical_uintptr_t &physicalAddress, size_t &flags)
 
void doSetFlags (void *virtualAddress, size_t newFlags)
 
void doUnmap (void *virtualAddress)
 
void * doAllocateStack (size_t sSize)
 
- Protected Member Functions inherited from VirtualAddressSpace
 VirtualAddressSpace (void *Heap)
 

Detailed Description

The kernel's VirtualAddressSpace on x86

Definition at line 240 of file kernel/core/processor/x86/VirtualAddressSpace.h.

Constructor & Destructor Documentation

X86KernelVirtualAddressSpace::X86KernelVirtualAddressSpace ( )
private

The constructor

Todo:
MAX_PROCESSORS here.

Definition at line 913 of file x86/VirtualAddressSpace.cc.

X86KernelVirtualAddressSpace::~X86KernelVirtualAddressSpace ( )
private

The destructor

Definition at line 927 of file x86/VirtualAddressSpace.cc.

X86KernelVirtualAddressSpace::X86KernelVirtualAddressSpace ( const X86KernelVirtualAddressSpace )
private

The copy-constructor

Note
NOT implemented (Singleton)

Member Function Documentation

void * X86KernelVirtualAddressSpace::allocateStack ( )
virtual

Allocates a single stack for a thread. Will use the default kernel thread size.

Reimplemented from X86VirtualAddressSpace.

Definition at line 907 of file x86/VirtualAddressSpace.cc.

void X86KernelVirtualAddressSpace::getMapping ( void *  virtualAddress,
physical_uintptr_t &  physicalAddress,
size_t &  flags 
)
virtual

Get the physical address and the flags associated with the specific virtual address.

Note
This function is only valid on memory that was mapped with VirtualAddressSpace::map() and that is still mapped or marked as swapped out.
Parameters
[in]virtualAddressthe address in the virtual address space
[out]flagsthe flags
[out]physicalAddressthe physical address

Reimplemented from X86VirtualAddressSpace.

Definition at line 893 of file x86/VirtualAddressSpace.cc.

bool X86KernelVirtualAddressSpace::isMapped ( void *  virtualAddress)
virtual

Checks whether a mapping the the specific virtual address exists. Pages marked as swapped out are not considered mapped.

Note
This function must be valid on all the valid addresses within the virtual address space.
Parameters
[in]virtualAddressthe virtual address
Returns
true, if a mapping exists, false otherwise

Reimplemented from X86VirtualAddressSpace.

Definition at line 884 of file x86/VirtualAddressSpace.cc.

bool X86KernelVirtualAddressSpace::map ( physical_uintptr_t  physicalAddress,
void *  virtualAddress,
size_t  flags 
)
virtual

Map a specific physical page (of size PhysicalMemoryManager::getPageSize()) at a specific location into the virtual address space.

Note
This function must also work on pages marked as swapped out.
Parameters
[in]physicalAddressthe address of the physical page that should be mapped into the virtual address space.
[in]virtualAddressthe virtual address at which the page apears within the virtual address space.
[in]flagsflags that describe which accesses should be allowed on the page.
Returns
true, if successfull, false otherwise

Reimplemented from X86VirtualAddressSpace.

Definition at line 888 of file x86/VirtualAddressSpace.cc.

X86KernelVirtualAddressSpace& X86KernelVirtualAddressSpace::operator= ( const X86KernelVirtualAddressSpace )
private

The assignment operator

Note
NOT implemented (Singleton)
void X86KernelVirtualAddressSpace::setFlags ( void *  virtualAddress,
size_t  newFlags 
)
virtual

Set the flags of the page at a specific virtual address.

Note
The page must have been mapped with VirtualAddressSpace::map() and the page must still be mapped or marked as swapped out.
Parameters
[in]virtualAddressthe virtual address
[in]newFlagsthe flags

Reimplemented from X86VirtualAddressSpace.

Definition at line 898 of file x86/VirtualAddressSpace.cc.

void X86KernelVirtualAddressSpace::unmap ( void *  virtualAddress)
virtual

Remove the page at the specific virtual address from the virtual address space.

Note
This function is only valid on memory that was mapped with VirtualAddressSpace::map() and that is still mapped or marked as swapped out.
Parameters
[in]virtualAddressthe virtual address

Reimplemented from X86VirtualAddressSpace.

Definition at line 903 of file x86/VirtualAddressSpace.cc.

Friends And Related Function Documentation

friend class X86VirtualAddressSpace
friend

X86VirtualAddressSpace needs access to m_Instance

Definition at line 243 of file kernel/core/processor/x86/VirtualAddressSpace.h.

Member Data Documentation

X86KernelVirtualAddressSpace X86KernelVirtualAddressSpace::m_Instance
staticprivate

The kernel virtual address space

Todo:
MAX_PROCESSORS

Definition at line 276 of file kernel/core/processor/x86/VirtualAddressSpace.h.


The documentation for this class was generated from the following files: