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

#include <VirtualAddressSpace.h>

+ Inheritance diagram for Arm926EVirtualAddressSpace:
+ Collaboration diagram for Arm926EVirtualAddressSpace:

Classes

struct  CoarseTable
 
struct  FineTable
 
union  FirstLevelDescriptor_Coarse
 
union  FirstLevelDescriptor_Fault
 
union  FirstLevelDescriptor_Fine
 
union  FirstLevelDescriptor_Section
 
struct  SectionTable
 
struct  Translation
 

Public Member Functions

virtual bool isAddressValid (void *virtualAddress)
 
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 ()
 
virtual void freeStack (void *pStack)
 
bool mapPageStructures (physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)
 
virtual VirtualAddressSpaceclone ()
 
virtual void revertToKernelAddressSpace ()
 
- 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 StackallocateStack (size_t stackSz)
 
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 bool memIsInHeap (void *pMem)=0
 
virtual void * getEndOfHeap ()=0
 
virtual uintptr_t getKernelStart () const =0
 
virtual uintptr_t getUserStart () const =0
 
virtual uintptr_t getUserReservedStart () const =0
 
virtual uintptr_t getDynamicLinkerAddress () const =0
 
virtual uintptr_t getKernelHeapStart () const =0
 
virtual uintptr_t getKernelHeapEnd () const =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
 

Protected Member Functions

virtual ~Arm926EVirtualAddressSpace ()
 
- Protected Member Functions inherited from VirtualAddressSpace
 VirtualAddressSpace (void *Heap)
 

Private Member Functions

 Arm926EVirtualAddressSpace (void *Heap, physical_uintptr_t PhysicalPageDirectory, void *VirtualPageDirectory, void *VirtualPageTables)
 
 Arm926EVirtualAddressSpace ()
 
 Arm926EVirtualAddressSpace (const Arm926EVirtualAddressSpace &)
 
Arm926EVirtualAddressSpaceoperator= (const Arm926EVirtualAddressSpace &)
 
bool initialise ()
 
bool getPageTableEntry (void *virtualAddress, uint32_t *&pageTableEntry)
 
uint32_t toFlags (size_t flags)
 
size_t fromFlags (uint32_t Flags)
 

Private Attributes

struct Arm926EVirtualAddressSpace::Translation PACKED
 
struct Arm926EVirtualAddressSpace::SectionTable PACKED
 
struct Arm926EVirtualAddressSpace::CoarseTable PACKED
 
physical_uintptr_t m_PhysicalPageDirectory
 
void * m_VirtualPageDirectory
 
void * m_VirtualPageTables
 

Static Private Attributes

static Arm926EVirtualAddressSpace m_KernelSpace
 

Friends

class Processor
 
VirtualAddressSpaceVirtualAddressSpace::getKernelAddressSpace ()
 

Additional Inherited Members

- 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
 

Detailed Description

The Arm926EVirtualAddressSpace implements the VirtualAddressSpace class for the mip32 processor, which means it encompasses paging (KUSEG) and KSEG0, KSEG1, KSEG2.

Definition at line 32 of file kernel/core/processor/arm_926e/VirtualAddressSpace.h.

Constructor & Destructor Documentation

Arm926EVirtualAddressSpace::~Arm926EVirtualAddressSpace ( )
protectedvirtual

The destructor does nothing

Definition at line 47 of file arm_926e/VirtualAddressSpace.cc.

Referenced by revertToKernelAddressSpace().

+ Here is the caller graph for this function:

Arm926EVirtualAddressSpace::Arm926EVirtualAddressSpace ( void *  Heap,
physical_uintptr_t  PhysicalPageDirectory,
void *  VirtualPageDirectory,
void *  VirtualPageTables 
)
private

The constructor for already present paging structures

Parameters
[in]Heapvirtual address of the beginning of the heap
[in]PhysicalPageDirectoryphysical address of the page directory
[in]VirtualPageDirectoryvirtual address of the page directory
[in]VirtualPageTablesvirtual address of the page tables
Arm926EVirtualAddressSpace::Arm926EVirtualAddressSpace ( )
private

The default constructor

Note
NOT implemented

Definition at line 42 of file arm_926e/VirtualAddressSpace.cc.

Arm926EVirtualAddressSpace::Arm926EVirtualAddressSpace ( const Arm926EVirtualAddressSpace )
private

The copy-constructor

Note
NOT implemented

Member Function Documentation

void * Arm926EVirtualAddressSpace::allocateStack ( )
virtual

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

Implements VirtualAddressSpace.

Definition at line 87 of file arm_926e/VirtualAddressSpace.cc.

virtual VirtualAddressSpace* Arm926EVirtualAddressSpace::clone ( )
inlinevirtual

Clone this VirtualAddressSpace. That means that we copy-on-write-map the application image.

Definition at line 73 of file kernel/core/processor/arm_926e/VirtualAddressSpace.h.

size_t Arm926EVirtualAddressSpace::fromFlags ( uint32_t  Flags)
private

Convert processor's representation of the flags to the processor independant representation

Parameters
[in]Flagsthe processor specific flag representation
Returns
the proessor independant flag representation
void Arm926EVirtualAddressSpace::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

Implements VirtualAddressSpace.

Definition at line 72 of file arm_926e/VirtualAddressSpace.cc.

bool Arm926EVirtualAddressSpace::getPageTableEntry ( void *  virtualAddress,
uint32_t *&  pageTableEntry 
)
private

Get the page table entry, if it exists and check whether a page is mapped or marked as swapped out.

Parameters
[in]virtualAddressthe virtual address
[out]pageTableEntrypointer to the page table entry
Returns
true, if the page table is present and the page mapped or marked swapped out, false otherwise
bool Arm926EVirtualAddressSpace::initialise ( )
private

Initialises the kernel address space, called by Processor.

Definition at line 51 of file arm_926e/VirtualAddressSpace.cc.

bool Arm926EVirtualAddressSpace::isAddressValid ( void *  virtualAddress)
virtual

Is a particular virtual address valid?

Parameters
[in]virtualAddressthe virtual address to check
Returns
true, if the address is valid, false otherwise

Implements VirtualAddressSpace.

Definition at line 56 of file arm_926e/VirtualAddressSpace.cc.

bool Arm926EVirtualAddressSpace::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

Implements VirtualAddressSpace.

Definition at line 61 of file arm_926e/VirtualAddressSpace.cc.

bool Arm926EVirtualAddressSpace::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

Implements VirtualAddressSpace.

Definition at line 66 of file arm_926e/VirtualAddressSpace.cc.

bool Arm926EVirtualAddressSpace::mapPageStructures ( physical_uintptr_t  physicalAddress,
void *  virtualAddress,
size_t  flags 
)

Map the page table or the page frame if none is currently present

Note
This should only be used from the PhysicalMemoryManager
Parameters
[in]physicalAddressthe physical page that should be used as page table or page frame
[in]virtualAddressthe virtual address that should be checked for the existance of a page table and page frame
[in]flagsthe flags used for the mapping
Returns
true, if a page table/frame is already mapped for that address, false if the physicalAddress has been used as a page table or as a page frame.
Arm926EVirtualAddressSpace& Arm926EVirtualAddressSpace::operator= ( const Arm926EVirtualAddressSpace )
private

The copy-constructor

Note
Not implemented
virtual void Arm926EVirtualAddressSpace::revertToKernelAddressSpace ( )
inlinevirtual

Undo a clone() - this happens when an application is Exec()'d - we destroy all mappings not in the kernel address space so the space is 'clean'.

Implements VirtualAddressSpace.

Definition at line 81 of file kernel/core/processor/arm_926e/VirtualAddressSpace.h.

References ~Arm926EVirtualAddressSpace().

void Arm926EVirtualAddressSpace::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

Implements VirtualAddressSpace.

Definition at line 79 of file arm_926e/VirtualAddressSpace.cc.

uint32_t Arm926EVirtualAddressSpace::toFlags ( size_t  flags)
private

Convert the processor independant flags to the processor's representation of the flags

Parameters
[in]flagsthe processor independant flag representation
Returns
the proessor specific flag representation
void Arm926EVirtualAddressSpace::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

Implements VirtualAddressSpace.

Definition at line 83 of file arm_926e/VirtualAddressSpace.cc.

Friends And Related Function Documentation

friend class Processor
friend

Processor::switchAddressSpace() needs access to m_PhysicalPageDirectory

Definition at line 36 of file kernel/core/processor/arm_926e/VirtualAddressSpace.h.

Member Data Documentation

Arm926EVirtualAddressSpace Arm926EVirtualAddressSpace::m_KernelSpace
staticprivate

The kernel virtual address space

Definition at line 226 of file kernel/core/processor/arm_926e/VirtualAddressSpace.h.

Referenced by VirtualAddressSpace::getKernelAddressSpace().

physical_uintptr_t Arm926EVirtualAddressSpace::m_PhysicalPageDirectory
private

Physical address of the page directory

Definition at line 219 of file kernel/core/processor/arm_926e/VirtualAddressSpace.h.

void* Arm926EVirtualAddressSpace::m_VirtualPageDirectory
private

Virtual address of the page directory

Definition at line 221 of file kernel/core/processor/arm_926e/VirtualAddressSpace.h.

void* Arm926EVirtualAddressSpace::m_VirtualPageTables
private

Virtual address of the page tables

Definition at line 223 of file kernel/core/processor/arm_926e/VirtualAddressSpace.h.


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