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

#include <VirtualAddressSpace.h>

+ Inheritance diagram for VirtualAddressSpace:
+ Collaboration diagram for VirtualAddressSpace:

Classes

class  Stack
 

Public Member Functions

virtual void * expandHeap (ssize_t incr, size_t flags)
 
virtual bool isAddressValid (void *virtualAddress)=0
 
virtual bool isMapped (void *virtualAddress)=0
 
virtual bool map (physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)=0
 
virtual bool mapHuge (physical_uintptr_t physAddress, void *virtualAddress, size_t count, size_t flags)
 
virtual void getMapping (void *virtualAddress, physical_uintptr_t &physicalAddress, size_t &flags)=0
 
virtual void setFlags (void *virtualAddress, size_t newFlags)=0
 
virtual void unmap (void *virtualAddress)=0
 
virtual StackallocateStack ()=0
 
virtual StackallocateStack (size_t stackSz)
 
virtual void freeStack (Stack *pStack)=0
 
virtual VirtualAddressSpaceclone (bool copyOnWrite=true)=0
 
virtual void revertToKernelAddressSpace ()=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
 

Static Public Member Functions

static EXPORTED_PUBLIC VirtualAddressSpacegetKernelAddressSpace ()
 
static VirtualAddressSpacecreate ()
 

Public Attributes

void * m_Heap
 
void * m_HeapEnd
 

Static Public Attributes

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

 VirtualAddressSpace (void *Heap)
 

Private Member Functions

 VirtualAddressSpace ()
 
 VirtualAddressSpace (const VirtualAddressSpace &)
 
VirtualAddressSpaceoperator= (const VirtualAddressSpace &)
 
void rollbackHeapExpansion (void *virtualAddress, size_t pageCount)
 

Friends

class Debugger
 

Detailed Description

The VirtualAddressSpace encapsulates all the functionality of a virtual memory- management. This includes management of the mapping between physical and virtual memory, management of allocated physical memory pages and management of free/allocated virtual memory.

Note
If KERNEL_NEEDS_ADDRESS_SPACE_SWITCH is set defined to 1, you have to switch to the VirtualAddressSpace you want to change yourself before you call any of the following functions: expandHeap, isMapped, map, getMapping, setFlags, unmap

Definition at line 37 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Constructor & Destructor Documentation

virtual VirtualAddressSpace::~VirtualAddressSpace ( )
inlinevirtual

The destructor does nothing

Definition at line 171 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

VirtualAddressSpace::VirtualAddressSpace ( void *  Heap)
inlineprotected

The constructor does nothing

Definition at line 286 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

References operator=(), rollbackHeapExpansion(), and VirtualAddressSpace().

VirtualAddressSpace::VirtualAddressSpace ( )
private

The default constructor

Referenced by VirtualAddressSpace().

+ Here is the caller graph for this function:

VirtualAddressSpace::VirtualAddressSpace ( const VirtualAddressSpace )
private

The copy-constructor

Note
NOT implemented

Member Function Documentation

virtual Stack* VirtualAddressSpace::allocateStack ( )
pure virtual
virtual Stack* VirtualAddressSpace::allocateStack ( size_t  stackSz)
inlinevirtual
virtual VirtualAddressSpace* VirtualAddressSpace::clone ( bool  copyOnWrite = true)
pure virtual

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

Parameters
[in]copyOnWritewhether the new address space copies pages on write, or shares them with the parent address space.
Returns
pointer to the new VirtualAddressSpace

Implemented in X64VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by allocateStack(), X86GdtManager::initialiseDoubleFaultTss(), and Process::Process().

+ Here is the caller graph for this function:

VirtualAddressSpace * VirtualAddressSpace::create ( )
static

Create a new VirtualAddressSpace. Only the kernel is mapped into that virtual address space

Returns
pointer to the new VirtualAddressSpace, 0 otherwise

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

Referenced by allocateStack(), PPC32VirtualAddressSpace::clone(), HostedVirtualAddressSpace::clone(), X64VirtualAddressSpace::clone(), and X86VirtualAddressSpace::fromFlags().

+ Here is the caller graph for this function:

void * VirtualAddressSpace::expandHeap ( ssize_t  incr,
size_t  flags 
)
virtual

Expand the heap

Parameters
[in]pageCountthe number of pages that should be allocated and mapped to the heap end
[in]flagsflags that describe which accesses should be allowed on the page
Returns
pointer to the beginning of the newly allocated/mapped heap, 0 otherwise
Note
Should this be m_HeapEnd - getPageSize?

Definition at line 27 of file VirtualAddressSpace.cc.

References PhysicalMemoryManager::allocatePage(), CopyOnWrite, ERROR, FATAL, PhysicalMemoryManager::freePage(), getDynamicStart(), getKernelHeapStart(), getKernelStart(), getMapping(), PhysicalMemoryManager::getPageSize(), PhysicalMemoryManager::instance(), isMapped(), m_HeapEnd, m_ZeroPage, map(), PhysicalMemoryManager::pin(), unmap(), WARNING, and Write.

virtual void VirtualAddressSpace::freeStack ( Stack pStack)
pure virtual

Frees a stack allocated with allocateStack.

Implemented in X64VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by allocateStack(), and Thread::cleanStateLevel().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getDynamicEnd ( ) const
inlinevirtual

Gets address of the end of the dynamic memory mapping area.

Reimplemented in X64VirtualAddressSpace, and HostedVirtualAddressSpace.

Definition at line 238 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Referenced by PosixSubsystem::invoke().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getDynamicLinkerAddress ( ) const
pure virtual

Gets address of the dynamic linker in the address space.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getDynamicStart ( ) const
inlinevirtual

Gets address of the start of the dynamic memory mapping area. This is an area in which memory mappings can be created for userspace applications. Systems that do not have room in the address space for this may return zero.

Reimplemented in X64VirtualAddressSpace, and HostedVirtualAddressSpace.

Definition at line 233 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Referenced by expandHeap(), Thread::getTlsBase(), PosixSubsystem::invoke(), and Thread::~Thread().

+ Here is the caller graph for this function:

virtual void* VirtualAddressSpace::getEndOfHeap ( )
pure virtual

Gets a pointer to the byte after the end of the heap.

Implemented in X64VirtualAddressSpace, HostedVirtualAddressSpace, ArmV7VirtualAddressSpace, and X86VirtualAddressSpace.

Referenced by X86VirtualAddressSpace::memIsInHeap(), HostedVirtualAddressSpace::memIsInHeap(), X64VirtualAddressSpace::memIsInHeap(), and setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getGlobalInfoBlock ( ) const
inlinevirtual

Gets address of the global info block location.

Reimplemented in X64VirtualAddressSpace.

Definition at line 244 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Referenced by PosixSyscallManager::syscall().

+ Here is the caller graph for this function:

VirtualAddressSpace & VirtualAddressSpace::getKernelAddressSpace ( )
static

Get the kernel virtual address space

Returns
reference to the kernel virtual address space

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

References Arm926EVirtualAddressSpace::m_KernelSpace.

Referenced by ArmV7PhysicalMemoryManager::allocateRegion(), PpcCommonPhysicalMemoryManager::allocateRegion(), ArmV7VirtualAddressSpace::allocateStack(), HostedVirtualAddressSpace::allocateStack(), Thread::allocateStackAtLevel(), Thread::cleanStateLevel(), MappingCommand::execute(), Bios::executeInterrupt(), CacheManager::executeRequest(), ArmV7PhysicalMemoryManager::PageStack::free(), HostedPhysicalMemoryManager::PageStack::free(), HostedVirtualAddressSpace::getMapping(), Event::getTrampoline(), ArmCommonProcessorInformation::getVirtualAddressSpace(), HostedProcessorInformation::getVirtualAddressSpace(), X86CommonProcessorInformation::getVirtualAddressSpace(), X86CommonPhysicalMemoryManager::initialisationDone(), X86CommonPhysicalMemoryManager::initialise64(), X86GdtManager::initialiseDoubleFaultTss(), ARMV7InterruptManager::initialiseProcessor(), MIPS32TlbManager::interrupt(), HostedVirtualAddressSpace::isMapped(), KernelElf::loadModule(), HostedVirtualAddressSpace::map(), X86CommonPhysicalMemoryManager::PageStack::maybeMap(), SlamCache::recovery(), HostedVirtualAddressSpace::revertToKernelAddressSpace(), HostedVirtualAddressSpace::setFlags(), Debugger::start(), HostedVirtualAddressSpace::switchAddressSpace(), PosixSyscallManager::syscall(), HostedVirtualAddressSpace::unmap(), PpcCommonPhysicalMemoryManager::unmapRegion(), HostedPhysicalMemoryManager::unmapRegion(), X86CommonPhysicalMemoryManager::unmapRegion(), SlamAllocator::wipe(), and X86VirtualAddressSpace::X86VirtualAddressSpace().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getKernelCacheEnd ( ) const
pure virtual

Gets address of the end of the kernel's cache region.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by CacheManager::executeRequest(), and setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getKernelCacheStart ( ) const
pure virtual

Gets address of the start of the kernel's cache region.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by CacheManager::executeRequest(), and setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getKernelEventBlockStart ( ) const
pure virtual

Gets address of the start of the kernel's event handling block.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by Event::getTrampoline(), and setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getKernelHeapEnd ( ) const
pure virtual

Gets address of the end of the kernel's heap region.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getKernelHeapStart ( ) const
pure virtual

Gets address of the start of the kernel's heap region.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by expandHeap(), and setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getKernelModulesEnd ( ) const
pure virtual

Gets address of the end of the kernel's module region.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by KernelElf::loadModule(), and setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getKernelModulesStart ( ) const
pure virtual

Gets address of the start of the kernel's module region.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by KernelElf::loadModule(), and setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getKernelStart ( ) const
pure virtual

Gets start address of the kernel in the address space.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by PosixSubsystem::checkAddress(), expandHeap(), and setHeap().

+ Here is the caller graph for this function:

virtual void VirtualAddressSpace::getMapping ( void *  virtualAddress,
physical_uintptr_t &  physicalAddress,
size_t &  flags 
)
pure 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

Implemented in ArmV7KernelVirtualAddressSpace, X86KernelVirtualAddressSpace, X64VirtualAddressSpace, MIPS32VirtualAddressSpace, HostedVirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, PPC32VirtualAddressSpace, and Arm926EVirtualAddressSpace.

Referenced by BusMasterIde::add(), Uhci::addTransferToTransaction(), Ohci::addTransferToTransaction(), PosixSubsystem::checkAddress(), PerProcessorScheduler::checkEventState(), MemoryMappedFile::compact(), Cache::evict(), MappingCommand::execute(), expandHeap(), HostedVirtualAddressSpace::freeStack(), X64VirtualAddressSpace::freeStack(), HostedVirtualAddressSpace::getMapping(), File::getPhysicalPage(), X86CommonPhysicalMemoryManager::initialisationDone(), Ipc::IpcMessage::IpcMessage(), AnonymousMemoryMap::remove(), MemoryMappedFile::remove(), rollbackHeapExpansion(), AnonymousMemoryMap::setPermissions(), MemoryMappedFile::setPermissions(), MemoryMappedFile::sync(), AnonymousMemoryMap::trap(), KernelElf::unloadModule(), HostedPhysicalMemoryManager::unmapRegion(), X86CommonPhysicalMemoryManager::unmapRegion(), and Thread::~Thread().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getUserReservedStart ( ) const
pure virtual

Gets start address of reserved areas of the userpace address space.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by PosixSubsystem::invoke(), and setHeap().

+ Here is the caller graph for this function:

virtual uintptr_t VirtualAddressSpace::getUserStart ( ) const
pure virtual

Gets start address of the region usable and cloneable for userspace.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, and HostedVirtualAddressSpace.

Referenced by PosixSubsystem::checkAddress(), PosixSubsystem::invoke(), and setHeap().

+ Here is the caller graph for this function:

virtual bool VirtualAddressSpace::isAddressValid ( void *  virtualAddress)
pure virtual

Is a particular virtual address valid?

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

Implemented in MIPS32VirtualAddressSpace, X64VirtualAddressSpace, HostedVirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, PPC32VirtualAddressSpace, and Arm926EVirtualAddressSpace.

virtual bool VirtualAddressSpace::isMapped ( void *  virtualAddress)
pure 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

Implemented in ArmV7KernelVirtualAddressSpace, X86KernelVirtualAddressSpace, MIPS32VirtualAddressSpace, X64VirtualAddressSpace, HostedVirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, PPC32VirtualAddressSpace, and Arm926EVirtualAddressSpace.

Referenced by BusMasterIde::add(), Uhci::addTransferToTransaction(), Ohci::addTransferToTransaction(), PosixSubsystem::checkAddress(), PerProcessorScheduler::checkEventState(), MemoryMappedFile::compact(), MappingCommand::execute(), Bios::executeInterrupt(), expandHeap(), HostedVirtualAddressSpace::freeStack(), X64VirtualAddressSpace::freeStack(), HostedVirtualAddressSpace::getMapping(), File::getPhysicalPage(), MemoryMappedFile::invalidate(), Ipc::IpcMessage::IpcMessage(), HostedVirtualAddressSpace::isMapped(), Elf::loadModule(), HostedVirtualAddressSpace::map(), Backtrace::performBpBacktrace(), AnonymousMemoryMap::remove(), MemoryMappedFile::remove(), HostedVirtualAddressSpace::revertToKernelAddressSpace(), HostedVirtualAddressSpace::setFlags(), AnonymousMemoryMap::setPermissions(), MemoryMappedFile::setPermissions(), HostedVirtualAddressSpace::switchAddressSpace(), MemoryMappedFile::sync(), AnonymousMemoryMap::trap(), MemoryMappedFile::trap(), KernelElf::unloadModule(), HostedVirtualAddressSpace::unmap(), HostedPhysicalMemoryManager::unmapRegion(), X86CommonPhysicalMemoryManager::unmapRegion(), and Thread::~Thread().

+ Here is the caller graph for this function:

virtual bool VirtualAddressSpace::map ( physical_uintptr_t  physicalAddress,
void *  virtualAddress,
size_t  flags 
)
pure 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

Implemented in ArmV7KernelVirtualAddressSpace, X86KernelVirtualAddressSpace, MIPS32VirtualAddressSpace, X64VirtualAddressSpace, HostedVirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, PPC32VirtualAddressSpace, and Arm926EVirtualAddressSpace.

Referenced by ArmV7PhysicalMemoryManager::allocateRegion(), HostedPhysicalMemoryManager::allocateRegion(), PpcCommonPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), PerProcessorScheduler::checkEventState(), HostedVirtualAddressSpace::doAllocateStack(), X64VirtualAddressSpace::doAllocateStack(), Bios::executeInterrupt(), expandHeap(), Thread::getTlsBase(), MemoryMappedFile::invalidate(), Elf::loadModule(), HostedVirtualAddressSpace::map(), mapHuge(), DynamicLinker::trap(), AnonymousMemoryMap::trap(), MemoryMappedFile::trap(), and X86VirtualAddressSpace::X86VirtualAddressSpace().

+ Here is the caller graph for this function:

bool VirtualAddressSpace::mapHuge ( physical_uintptr_t  physAddress,
void *  virtualAddress,
size_t  count,
size_t  flags 
)
virtual

Map a region of memory using the largest possible frame size. Where possible the largest page size should be used, degrading into smaller page sizes as needed (e.g. 1 GB, 2 MB, 4K) to reduce the overhead of the mapping on the system. Default implementation calls map() in a loop.

Returns
true if successful, false otherwise.

Reimplemented in X64VirtualAddressSpace.

Definition at line 170 of file VirtualAddressSpace.cc.

References PhysicalMemoryManager::getPageSize(), and map().

Referenced by X86CommonPhysicalMemoryManager::initialise64(), and X64VirtualAddressSpace::mapHuge().

+ Here is the caller graph for this function:

virtual bool VirtualAddressSpace::memIsInHeap ( void *  pMem)
pure virtual

Determines if a given point is within the virtual address space region dedicated to the kernel heap.

Implemented in X64VirtualAddressSpace, HostedVirtualAddressSpace, ArmV7VirtualAddressSpace, and X86VirtualAddressSpace.

Referenced by setHeap().

+ Here is the caller graph for this function:

virtual bool VirtualAddressSpace::memIsInKernelHeap ( void *  pMem)
pure virtual

Determines whether a given address is within the kernel's heap region.

Implemented in X64VirtualAddressSpace.

Referenced by setHeap().

+ Here is the caller graph for this function:

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

The copy-constructor

Note
Not implemented

Referenced by VirtualAddressSpace().

+ Here is the caller graph for this function:

virtual void VirtualAddressSpace::revertToKernelAddressSpace ( )
pure virtual

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'.

Implemented in X64VirtualAddressSpace, ArmV7VirtualAddressSpace, HostedVirtualAddressSpace, X86VirtualAddressSpace, Arm926EVirtualAddressSpace, and PPC32VirtualAddressSpace.

Referenced by allocateStack(), PosixSubsystem::invoke(), Process::~Process(), and X64VirtualAddressSpace::~X64VirtualAddressSpace().

+ Here is the caller graph for this function:

void VirtualAddressSpace::rollbackHeapExpansion ( void *  virtualAddress,
size_t  pageCount 
)
private

Reverts the heap expansion, that was begun with expandHeap

Parameters
[in]virtualAddresscurrent heap address
[in]pageCountnumber of mapped pages to unmap and free

Definition at line 148 of file VirtualAddressSpace.cc.

References PhysicalMemoryManager::freePage(), getMapping(), PhysicalMemoryManager::getPageSize(), PhysicalMemoryManager::instance(), physicalAddress(), and unmap().

Referenced by VirtualAddressSpace().

+ Here is the caller graph for this function:

virtual void VirtualAddressSpace::setFlags ( void *  virtualAddress,
size_t  newFlags 
)
pure 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

Implemented in ArmV7KernelVirtualAddressSpace, X86KernelVirtualAddressSpace, X64VirtualAddressSpace, MIPS32VirtualAddressSpace, HostedVirtualAddressSpace, ArmV7VirtualAddressSpace, X86VirtualAddressSpace, PPC32VirtualAddressSpace, and Arm926EVirtualAddressSpace.

Referenced by Elf::finaliseModule(), HostedVirtualAddressSpace::setFlags(), AnonymousMemoryMap::setPermissions(), and MemoryMappedFile::setPermissions().

+ Here is the caller graph for this function:

void VirtualAddressSpace::setHeap ( void *  heap,
void *  heapEnd 
)
inline
virtual void VirtualAddressSpace::unmap ( void *  virtualAddress)
pure virtual

Friends And Related Function Documentation

friend class Debugger
friend

Debugger can access our private members for statistics reporting.

Definition at line 41 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Member Data Documentation

const size_t VirtualAddressSpace::Accessed = 0x800
static
const size_t VirtualAddressSpace::CacheDisable = 0x10
static
const size_t VirtualAddressSpace::ClearDirty = 0x2000
static

Clear the dirty flag set by the above.

Definition at line 75 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Referenced by X86VirtualAddressSpace::toFlags(), and X64VirtualAddressSpace::toFlags().

const size_t VirtualAddressSpace::CopyOnWrite = 0x20
static
const size_t VirtualAddressSpace::Dirty = 0x1000
static
const size_t VirtualAddressSpace::Execute = 0x04
static
const size_t VirtualAddressSpace::Guarded = 0x100
static

If this flag is set, the page is guarded - only applicable to PPC

Definition at line 65 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Referenced by HashedPageTable::addMapping(), and HashedPageTable::initialise().

const size_t VirtualAddressSpace::KernelMode = 0x01
static

The page is only accessible from kernel-mode. If this flag is not set the page is also accessible from user-mode.

Definition at line 47 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Referenced by HashedPageTable::addMapping(), ArmV7VirtualAddressSpace::allocateStack(), Archive::Archive(), X86VirtualAddressSpace::beginCrossSpace(), PerProcessorScheduler::checkEventState(), PPC32VirtualAddressSpace::clone(), HostedVirtualAddressSpace::doAllocateStack(), X64VirtualAddressSpace::doAllocateStack(), Bios::executeInterrupt(), Elf::finaliseModule(), ArmV7PhysicalMemoryManager::PageStack::free(), X86VirtualAddressSpace::fromFlags(), ArmV7VirtualAddressSpace::fromFlags(), X64VirtualAddressSpace::fromFlags(), ArmV7KernelVirtualAddressSpace::getMapping(), UsbUlpi::initialise(), PPCVga::initialise(), MemoryPool::initialise(), GPTimer::initialise(), Prcm::initialise(), KernelElf::initialise(), X86CommonPhysicalMemoryManager::initialise64(), Ehci::initialiseController(), ARMV7InterruptManager::initialiseProcessor(), Elf::loadModule(), Device::Address::map(), HostedVirtualAddressSpace::map(), Cache::map(), X86VirtualAddressSpace::mapCrossSpace(), X86CommonPhysicalMemoryManager::PageStack::maybeMap(), X86Vga::moveCursor(), ArmBeagleSerial::setBase(), HashedPageTable::setDBAT(), HostedVirtualAddressSpace::setFlags(), HashedPageTable::setIBAT(), HostedVirtualAddressSpace::switchAddressSpace(), X86VirtualAddressSpace::toFlags(), ArmV7VirtualAddressSpace::toFlags(), X64VirtualAddressSpace::toFlags(), and X86VirtualAddressSpace::X86VirtualAddressSpace().

void* VirtualAddressSpace::m_Heap
void* VirtualAddressSpace::m_HeapEnd
physical_uintptr_t VirtualAddressSpace::m_ZeroPage = 0
static

Physical address of a zero page, always page-aligned.

Definition at line 254 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Referenced by expandHeap().

const size_t VirtualAddressSpace::MemoryCoherent = 0x80
static

If this flag is set, the page is memory coherent - only applicable to PPC

Definition at line 63 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Referenced by HashedPageTable::addMapping(), and HashedPageTable::initialise().

const size_t VirtualAddressSpace::Shared = 0x200
static
const size_t VirtualAddressSpace::Swapped = 0x40
static
const size_t VirtualAddressSpace::Write = 0x02
static

The page is writeable. If this flag is not set the page is read-only.

Definition at line 49 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.

Referenced by HashedPageTable::addMapping(), Elf::allocate(), ArmV7VirtualAddressSpace::allocateStack(), X86VirtualAddressSpace::beginCrossSpace(), PosixSubsystem::checkAddress(), PerProcessorScheduler::checkEventState(), PPC32VirtualAddressSpace::clone(), HostedVirtualAddressSpace::clone(), MemoryMappedFile::compact(), HostedVirtualAddressSpace::doAllocateStack(), X64VirtualAddressSpace::doAllocateStack(), Bios::executeInterrupt(), expandHeap(), Elf::finaliseModule(), ArmV7PhysicalMemoryManager::PageStack::free(), HostedPhysicalMemoryManager::PageStack::free(), X86VirtualAddressSpace::fromFlags(), ArmV7VirtualAddressSpace::fromFlags(), X64VirtualAddressSpace::fromFlags(), Thread::getTlsBase(), VbeFramebuffer::hwRedraw(), UsbUlpi::initialise(), HashedPageTable::initialise(), PPCVga::initialise(), MemoryPool::initialise(), GPTimer::initialise(), Prcm::initialise(), BusMasterIde::initialise(), KernelElf::initialise(), X86CommonPhysicalMemoryManager::initialise64(), Ehci::initialiseController(), ARMV7InterruptManager::initialiseProcessor(), PPC32VirtualAddressSpace::initialRoster(), DynamicLinker::initPlt(), Ipc::IpcMessage::IpcMessage(), CdiIrqHandler::irq(), Elf::loadModule(), Device::Address::map(), MIPS32VirtualAddressSpace::map(), Cache::map(), X86VirtualAddressSpace::mapCrossSpace(), X86CommonPhysicalMemoryManager::PageStack::maybeMap(), X86Vga::moveCursor(), VbeDisplay::newBuffer(), Nic3C90x::Nic3C90x(), MemoryMappedFile::remove(), ArmBeagleSerial::setBase(), AnonymousMemoryMap::setPermissions(), MemoryMappedFile::setPermissions(), Framebuffer::swCreateBuffer(), MemoryMappedFile::sync(), X86VirtualAddressSpace::toFlags(), HostedVirtualAddressSpace::toFlags(), ArmV7VirtualAddressSpace::toFlags(), X64VirtualAddressSpace::toFlags(), DynamicLinker::trap(), AnonymousMemoryMap::trap(), MemoryMappedFile::trap(), and X86VirtualAddressSpace::X86VirtualAddressSpace().

const size_t VirtualAddressSpace::WriteCombine = 0x400
static
const size_t VirtualAddressSpace::WriteThrough = 0x08
static

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