|
The Pedigree Project 0.1
|
#include <VirtualAddressSpace.h>
Inheritance diagram for VirtualAddressSpace:
Collaboration diagram for VirtualAddressSpace:Classes | |
| struct | DetachedPage |
| struct | PageRemapRequest |
| class | PreparedPageRemap |
| struct | RemapRange |
| class | Stack |
Public Types | |
| enum class | ResidentCopyStatus { Success , Inaccessible , Unsupported } |
| enum class | RemapStatus { Success , InvalidRange , Unsupported , NoMemory , Retry } |
| using | RemapAdmission = bool(*)(void *context) |
Public Member Functions | |
| RawUserMemory & | rawUserMemory () |
| virtual size_t | runtimeMappingPages (uintptr_t, size_t) |
| MemoryLockAccount * | memoryLockAccount () const |
| void | setMemoryLockAccount (MemoryLockAccount *account) |
| UserMemoryPolicy * | userMemoryPolicy () const |
| void | setUserMemoryPolicy (UserMemoryPolicy *policy) |
| 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 | tryMapUserPage (physical_uintptr_t physical, void *address, size_t flags, size_t *committedTablePages=nullptr) |
| virtual bool | tryDetachUserPage (void *address, physical_uintptr_t expected) |
| virtual bool | mapHuge (physical_uintptr_t physAddress, void *virtualAddress, size_t count, size_t flags) |
| virtual bool | getMapping (void *virtualAddress, physical_uintptr_t &physicalAddress, size_t &flags)=0 |
| virtual bool | handleCopyOnWriteFault (void *virtualAddress, bool userMode)=0 |
| virtual ResidentCopyStatus | copyResidentUserPage (uintptr_t userAddress, void *kernelBuffer, size_t bytes, bool write) |
| virtual bool | tryWriteUser32 (uintptr_t address, uint32_t value) |
| virtual bool | tryReadUser32 (uintptr_t address, uint32_t &value) |
| virtual bool | tryReadUserPointer (uintptr_t address, uintptr_t &value) |
| virtual bool | tryCompareExchangeUser32 (uintptr_t address, uint32_t &expected, uint32_t desired, bool &exchanged) |
| virtual void | setFlags (void *virtualAddress, size_t newFlags)=0 |
| virtual MUST_USE_RESULT bool | trySetFlags (void *virtualAddress, size_t newFlags) |
| virtual void | unmap (void *virtualAddress)=0 |
| virtual bool | detachMapping (void *virtualAddress, physical_uintptr_t &physical, size_t &flags, size_t requiredFlags=0) |
| virtual RemapStatus | prepareRemap (const PageRemapRequest &request, UniquePointer< PreparedPageRemap > &plan) |
| virtual void | setRemapPreparationFailureForTest (ssize_t allocations) |
| virtual Stack * | allocateStack ()=0 |
| virtual Stack * | allocateStack (size_t stackSz) |
| virtual void | freeStack (Stack *pStack)=0 |
| virtual VirtualAddressSpace * | clone (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 | getKernelVirtualPagestack () const |
| virtual uintptr_t | getKernelVirtualPagestackAdd1 () const |
| virtual uintptr_t | getKernelVirtualPagestackAdd2 () const |
| virtual uintptr_t | getDynamicStart () const |
| virtual uintptr_t | getDynamicEnd () const |
| virtual uintptr_t | getGlobalInfoBlock () const |
Static Public Member Functions | |
| static EXPORTED_PUBLIC VirtualAddressSpace & | getKernelAddressSpace () |
| static VirtualAddressSpace * | create () |
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 | 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 const size_t | NoAccess = 0x4000 |
| static const size_t | WriteProtected = 0x8000 |
| static const size_t | Borrowed = 0x10000 |
| static const size_t | RuntimeMapping = 0x20000 |
| static constexpr size_t | MaximumRemapPages = 65536 |
| static physical_uintptr_t | m_ZeroPage = 0 |
Protected Member Functions | |
| bool | admitRawMemoryChange (const PreparedMemoryLock &plan, bool privileged, MemoryLockCharge &charge) const |
| void | commitRawMemoryChange (PreparedMemoryLock &plan, MemoryLockCharge charge) |
| bool | prepareZeroPage () |
| VirtualAddressSpace (void *Heap) | |
Protected Attributes | |
| uint64_t | m_HeapRegionId = 0 |
Private Member Functions | |
| VirtualAddressSpace () | |
| VirtualAddressSpace (const VirtualAddressSpace &) | |
| VirtualAddressSpace & | operator= (const VirtualAddressSpace &) |
| void | rollbackHeapExpansion (void *virtualAddress, size_t pageCount) |
Private Attributes | |
| RawUserMemory | m_RawUserMemory |
| MemoryLockAccount * | m_MemoryLockAccount = nullptr |
| UserMemoryPolicy * | m_UserMemoryPolicy = nullptr |
Friends | |
| class | Debugger |
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.
Definition at line 38 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
| using VirtualAddressSpace::RemapAdmission = bool (*)(void* context) |
Definition at line 273 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
strong |
Definition at line 254 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
strong |
Definition at line 174 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inlinevirtual |
The destructor does nothing
Definition at line 324 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inlineprotected |
The constructor does nothing
Definition at line 461 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
private |
The default constructor
|
private |
The copy-constructor
|
protected |
Definition at line 44 of file VirtualAddressSpace.cc.
|
pure virtual |
Allocates a single stack for a thread. Will use the default kernel thread size.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by allocateStack(), Thread::allocateStackAtLevel(), and PerProcessorScheduler::checkEventState().
Here is the caller graph for this function:
|
inlinevirtual |
Allocates a single stack of the given size for a thread.
Reimplemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Definition at line 299 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
References allocateStack().
|
pure virtual |
Clone this VirtualAddressSpace. That means that we copy-on-write-map the application * image. *
| [in] | copyOnWrite | whether the new address space copies pages on write, or shares them with the parent address space. |
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
|
protected |
Definition at line 64 of file VirtualAddressSpace.cc.
|
inlinevirtual |
One-page, no-fault copy with a resident nonpageable kernel buffer.
Reimplemented in X64VirtualAddressSpace.
Definition at line 177 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
static |
Create a new VirtualAddressSpace. Only the kernel is mapped into that virtual address space
Definition at line 43 of file arm64/VirtualAddressSpace.cc.
Referenced by HostedVirtualAddressSpace::clone(), and X64VirtualAddressSpace::clone().
Here is the caller graph for this function:
|
inlinevirtual |
Atomically snapshot and detach a resident mapping. A flags mismatch leaves the mapping intact, but still returns its physical address and flags.
Reimplemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Definition at line 247 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by MemoryMappedFile::compact(), HostedVirtualAddressSpace::detachMapping(), and rollbackHeapExpansion().
Here is the caller graph for this function:
|
virtual |
Expand the heap
| [in] | pageCount | the number of pages that should be allocated and mapped to the heap end |
| [in] | flags | flags that describe which accesses should be allowed on the page |
Definition at line 91 of file VirtualAddressSpace.cc.
References CopyOnWrite, PhysicalMemoryManager::freePage(), getDynamicStart(), getKernelStart(), PhysicalMemoryManager::getPageSize(), PhysicalMemoryManager::instance(), m_Heap, m_HeapEnd, m_ZeroPage, map(), PhysicalMemoryManager::pin(), rollbackHeapExpansion(), and Write.
|
pure virtual |
Frees a stack allocated with allocateStack.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by Thread::cleanStateLevel(), and Thread::notifySubsystemExit().
Here is the caller graph for this function:
|
inlinevirtual |
Gets address of the end of the dynamic memory mapping area.
Reimplemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Definition at line 402 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
pure virtual |
Gets address of the dynamic linker in the address space.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
|
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 HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Definition at line 398 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by expandHeap(), Thread::getTlsBase(), and Thread::~Thread().
Here is the caller graph for this function:
|
pure virtual |
Gets a pointer to the byte after the end of the heap.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
|
inlinevirtual |
Gets address of the global info block location.
Reimplemented in X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Definition at line 407 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
static |
Get the kernel virtual address space
Definition at line 39 of file arm64/VirtualAddressSpace.cc.
Referenced by Arm64PhysicalMemoryManager::allocateRegion(), Armv7PhysicalMemoryManager::allocateRegion(), Thread::allocateStackAtLevel(), Thread::cleanStateLevel(), Xhci::createTransaction(), MappingCommand::execute(), VirtioGpu::GpuFramebuffer::getPhysicalPage(), Event::getTrampoline(), HostedProcessorInformation::getVirtualAddressSpace(), X86CommonProcessorInformation::getVirtualAddressSpace(), HostedPhysicalMemoryManager::initialisationDone(), X86CommonPhysicalMemoryManager::initialisationDone(), X86CommonPhysicalMemoryManager::PageStack::initialise(), X86CommonPhysicalMemoryManager::initialise64(), KernelElf::loadModule(), X86CommonPhysicalMemoryManager::PageStack::maybeMap(), KernelElf::prepareRuntimeModules(), Debugger::start(), ProcessorBase::switchAddressSpace(), HostedPhysicalMemoryManager::unmapRegion(), X86CommonPhysicalMemoryManager::unmapRegion(), Arm64PhysicalMemoryManager::unmapRegion(), and Armv7PhysicalMemoryManager::unmapRegion().
Here is the caller graph for this function:
|
pure virtual |
Gets address of the end of the kernel's cache region.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
|
pure virtual |
Gets address of the start of the kernel's cache region.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
|
pure virtual |
Gets address of the start of the kernel's event handling block.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by Event::getTrampoline().
Here is the caller graph for this function:
|
pure virtual |
Gets address of the end of the kernel's heap region.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
|
pure virtual |
Gets address of the start of the kernel's heap region.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
|
pure virtual |
Gets address of the end of the kernel's module region.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by KernelElf::loadModule().
Here is the caller graph for this function:
|
pure virtual |
Gets address of the start of the kernel's module region.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by KernelElf::loadModule().
Here is the caller graph for this function:
|
pure virtual |
Gets start address of the kernel in the address space.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by PerProcessorScheduler::checkEventState(), and expandHeap().
Here is the caller graph for this function:
|
inlinevirtual |
Gets address of the physical page stack, if one exists.
Reimplemented in HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Definition at line 377 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by X86CommonPhysicalMemoryManager::PageStack::initialise().
Here is the caller graph for this function:
|
inlinevirtual |
Gets address of the first additional page stack, if one exists.
Reimplemented in X64VirtualAddressSpace.
Definition at line 382 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by X86CommonPhysicalMemoryManager::PageStack::initialise().
Here is the caller graph for this function:
|
inlinevirtual |
Gets address of the second additional page stack, if one exists.
Reimplemented in X64VirtualAddressSpace.
Definition at line 387 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by X86CommonPhysicalMemoryManager::PageStack::initialise().
Here is the caller graph for this function:
|
pure virtual |
Query the physical address and flags of a mapped or swapped-out page. Returns false without modifying the outputs when no mapping exists. The result does not pin the page; callers must protect its lifetime while using the returned physical address.
Implemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Referenced by BusMasterIde::add(), HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), Arm64PhysicalMemoryManager::allocateRegion(), Armv7PhysicalMemoryManager::allocateRegion(), PosixSubsystem::checkAddress(), PerProcessorScheduler::checkEventState(), Xhci::createTransaction(), MappingCommand::execute(), Cache::finishRetirement(), File::getPhysicalPage(), VirtioGpu::GpuFramebuffer::getPhysicalPage(), X86CommonPhysicalMemoryManager::initialisationDone(), MemoryMappedFile::remove(), AnonymousMemoryMap::setPermissions(), MemoryMappedFile::setPermissions(), AnonymousMemoryMap::supportsPageOut(), HostedPhysicalMemoryManager::unmapRegion(), X86CommonPhysicalMemoryManager::unmapRegion(), Arm64PhysicalMemoryManager::unmapRegion(), Armv7PhysicalMemoryManager::unmapRegion(), and Thread::~Thread().
Here is the caller graph for this function:
|
pure virtual |
Gets start address of reserved areas of the userpace address space.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by PosixSubsystem::prepareExecutable().
Here is the caller graph for this function:
|
pure virtual |
Gets start address of the region usable and cloneable for userspace.
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by PerProcessorScheduler::checkEventState(), and PosixSubsystem::prepareExecutable().
Here is the caller graph for this function:
|
pure virtual |
Resolve a write-protection fault on a copy-on-write mapping.
The replacement page is initialised before it becomes visible. Concurrent callers revalidate the mapping and treat an already-writable replacement as a successfully handled stale fault when the faulting privilege level may access it.
| [in] | userMode | true when the faulting access came from user mode. |
Implemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Referenced by HostedVirtualAddressSpace::handleCopyOnWriteFault(), and PageFaultHandler::interrupt().
Here is the caller graph for this function:
|
pure virtual |
Is a particular virtual address valid?
| [in] | virtualAddress | the virtual address to check |
Implemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Referenced by PerProcessorScheduler::checkEventState().
Here is the caller graph for this function:
|
pure virtual |
Checks whether a mapping the the specific virtual address exists. Pages marked as swapped out are not considered mapped; retained NoAccess pages are.
| [in] | virtualAddress | the virtual address |
Implemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Referenced by BusMasterIde::add(), PosixSubsystem::checkAddress(), PerProcessorScheduler::checkEventState(), HostedVirtualAddressSpace::clone(), MappingCommand::execute(), File::getPhysicalPage(), HostedPhysicalMemoryManager::initialisationDone(), HostedVirtualAddressSpace::isMapped(), Elf::loadModule(), X86CommonPhysicalMemoryManager::PageStack::maybeMap(), MemoryMappedFile::remove(), AnonymousMemoryMap::setPermissions(), MemoryMappedFile::setPermissions(), AnonymousMemoryMap::supportsPageOut(), HostedVirtualAddressSpace::switchAddressSpace(), AnonymousMemoryMap::trap(), MemoryMappedFile::trap(), HostedPhysicalMemoryManager::unmapRegion(), X86CommonPhysicalMemoryManager::unmapRegion(), and Thread::~Thread().
Here is the caller graph for this function:
|
pure virtual |
Map a specific physical page (of size PhysicalMemoryManager::getPageSize()) at a specific location into the virtual address space.
| [in] | physicalAddress | the address of the physical page that should be mapped into the virtual address space. |
| [in] | virtualAddress | the virtual address at which the page apears within the virtual address space. |
| [in] | flags | flags that describe which accesses should be allowed on the page. |
Implemented in HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), Arm64PhysicalMemoryManager::allocateRegion(), Armv7PhysicalMemoryManager::allocateRegion(), PerProcessorScheduler::checkEventState(), expandHeap(), Thread::getTlsBase(), Elf::loadModule(), HostedVirtualAddressSpace::map(), mapHuge(), X86CommonPhysicalMemoryManager::PageStack::maybeMap(), AnonymousMemoryMap::trap(), and MemoryMappedFile::trap().
Here is the caller graph for this function:
|
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.
Reimplemented in X64VirtualAddressSpace.
Definition at line 163 of file VirtualAddressSpace.cc.
References PhysicalMemoryManager::getPageSize(), and map().
Referenced by X86CommonPhysicalMemoryManager::initialise64(), and X64VirtualAddressSpace::mapHuge().
Here is the caller graph for this function:
|
pure virtual |
Determines if a given point is within the virtual address space region dedicated to the kernel heap.
Implemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
|
pure virtual |
Determines whether a given address is within the kernel's heap region.
Implemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
|
inline |
Definition at line 86 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
private |
The copy-constructor
|
inlinevirtual |
Preparation changes no live leaf or reservation; Retry changes neither.
Reimplemented in X64VirtualAddressSpace.
Definition at line 283 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
protected |
Definition at line 70 of file VirtualAddressSpace.cc.
|
inline |
Definition at line 80 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
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 HostedVirtualAddressSpace, X64VirtualAddressSpace, Arm64VirtualAddressSpace, and Armv7VirtualAddressSpace.
Referenced by PosixSubsystem::invoke(), and Process::~Process().
Here is the caller graph for this function:
|
private |
Reverts the heap expansion, that was begun with expandHeap
| [in] | virtualAddress | current heap address |
| [in] | pageCount | number of mapped pages to unmap and free |
Definition at line 153 of file VirtualAddressSpace.cc.
References detachMapping(), PhysicalMemoryManager::freePage(), PhysicalMemoryManager::getPageSize(), and PhysicalMemoryManager::instance().
Referenced by expandHeap().
Here is the caller graph for this function:
|
inlinevirtual |
Definition at line 83 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
pure virtual |
Set the flags of the page at a specific virtual address.
| [in] | virtualAddress | the virtual address |
| [in] | newFlags | the flags |
Implemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Referenced by Elf::finaliseModule(), HostedVirtualAddressSpace::setFlags(), AnonymousMemoryMap::setPermissions(), and MemoryMappedFile::setPermissions().
Here is the caller graph for this function:
|
inline |
Setter for the internal Heap and HeapEnd variables
Definition at line 327 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inline |
Definition at line 89 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inlinevirtual |
One-shot failure after the given number of successful preparation allocations.
Reimplemented in X64VirtualAddressSpace.
Definition at line 291 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inline |
Definition at line 95 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inlinevirtual |
A successful access may still report a failed comparison.
Reimplemented in HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Definition at line 211 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inlinevirtual |
Definition at line 142 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inlinevirtual |
Definition at line 134 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inlinevirtual |
Atomic, no-fault accesses through a resident userspace mapping.
Reimplemented in HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Definition at line 198 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inlinevirtual |
Definition at line 204 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
inlinevirtual |
Changes an existing mapping, returning false without publishing failed protection.
Reimplemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Definition at line 234 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by HostedVirtualAddressSpace::trySetFlags().
Here is the caller graph for this function:
|
inlinevirtual |
Stores one 32-bit value through a resident userspace mapping without switching into this address space. Implementations reject mappings that could fault or change backing storage while the write is in progress.
Reimplemented in HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Definition at line 191 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
pure virtual |
Remove the page at the specific virtual address from the virtual address space.
| [in] | virtualAddress | the virtual address |
Implemented in Arm64VirtualAddressSpace, Armv7VirtualAddressSpace, HostedVirtualAddressSpace, and X64VirtualAddressSpace.
Referenced by HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), Arm64PhysicalMemoryManager::allocateRegion(), Armv7PhysicalMemoryManager::allocateRegion(), Cache::finishRetirement(), X86CommonPhysicalMemoryManager::initialisationDone(), MemoryMappedFile::remove(), AnonymousMemoryMap::trap(), MemoryMappedFile::trap(), HostedVirtualAddressSpace::unmap(), HostedPhysicalMemoryManager::unmapRegion(), X86CommonPhysicalMemoryManager::unmapRegion(), Arm64PhysicalMemoryManager::unmapRegion(), Armv7PhysicalMemoryManager::unmapRegion(), and Thread::~Thread().
Here is the caller graph for this function:
|
inline |
Definition at line 92 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
friend |
Debugger can access our private members for statistics reporting.
Definition at line 41 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
static |
Whether the page has been accessed.
Definition at line 66 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by X64VirtualAddressSpace::fromFlags(), and X64VirtualAddressSpace::toFlags().
|
static |
The backing object, rather than this address space, owns the physical page.
Definition at line 76 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by HostedVirtualAddressSpace::clone(), X64VirtualAddressSpace::fromFlags(), Arm64VirtualAddressSpace::handleCopyOnWriteFault(), Armv7VirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::revertToKernelAddressSpace(), AnonymousMemoryMap::supportsPageOut(), X64VirtualAddressSpace::toFlags(), and MemoryMappedFile::trap().
|
static |
If this flag is set, the cache is disabled.
Definition at line 56 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by Arm64PhysicalMemoryManager::allocateRegion(), Armv7PhysicalMemoryManager::allocateRegion(), X64VirtualAddressSpace::fromFlags(), Device::Address::map(), X64VirtualAddressSpace::toFlags(), and MemoryMappedFile::trap().
|
static |
Clear the dirty flag set by the above.
Definition at line 70 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by X64VirtualAddressSpace::toFlags().
|
static |
If this flag is set, the page is copy-on-write
Definition at line 58 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by PosixSubsystem::checkAddress(), HostedVirtualAddressSpace::clone(), HostedVirtualAddressSpace::doAllocateStack(), X64VirtualAddressSpace::doAllocateStack(), expandHeap(), X64VirtualAddressSpace::fromFlags(), Arm64VirtualAddressSpace::handleCopyOnWriteFault(), Armv7VirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::handleCopyOnWriteFault(), AnonymousMemoryMap::supportsPageOut(), X64VirtualAddressSpace::toFlags(), and HostedVirtualAddressSpace::tryWriteUser32().
|
static |
Whether the page has been dirtied.
Definition at line 68 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by X64VirtualAddressSpace::fromFlags(), and X64VirtualAddressSpace::toFlags().
|
static |
The page is executable. If this flag is not set the page is not executable.
Definition at line 52 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by Elf::allocate(), PosixSubsystem::checkAddress(), Elf::finaliseModule(), X64VirtualAddressSpace::fromFlags(), Armv7VirtualAddressSpace::getMapping(), DynamicLinker::initPlt(), PosixSubsystem::invoke(), Event::isValidHandlerMapping(), HostedVirtualAddressSpace::toFlags(), X64VirtualAddressSpace::toFlags(), AnonymousMemoryMap::trap(), and MemoryMappedFile::trap().
|
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 Arm64PhysicalMemoryManager::allocateRegion(), Armv7PhysicalMemoryManager::allocateRegion(), Arm64VirtualAddressSpace::allocateStack(), Armv7VirtualAddressSpace::allocateStack(), Archive::Archive(), PosixSubsystem::checkAddress(), PerProcessorScheduler::checkEventState(), HostedVirtualAddressSpace::clone(), HostedVirtualAddressSpace::doAllocateStack(), X64VirtualAddressSpace::doAllocateStack(), Elf::finaliseModule(), X64VirtualAddressSpace::fromFlags(), Armv7VirtualAddressSpace::getMapping(), Arm64VirtualAddressSpace::handleCopyOnWriteFault(), Armv7VirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::handleCopyOnWriteFault(), HostedPhysicalMemoryManager::initialisationDone(), KernelElf::initialise(), MemoryPool::initialise(), X86CommonPhysicalMemoryManager::initialise64(), Event::isValidHandlerMapping(), Elf::loadModule(), HostedVirtualAddressSpace::map(), Arm64VirtualAddressSpace::map(), Armv7VirtualAddressSpace::map(), Device::Address::map(), Cache::map(), X86CommonPhysicalMemoryManager::PageStack::maybeMap(), KernelElf::prepareRuntimeModules(), HostedVirtualAddressSpace::setFlags(), AnonymousMemoryMap::supportsPageOut(), HostedVirtualAddressSpace::switchAddressSpace(), X64VirtualAddressSpace::toFlags(), and HostedVirtualAddressSpace::tryWriteUser32().
| void* VirtualAddressSpace::m_Heap |
Pointer to the beginning of the heap
Definition at line 412 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by HostedVirtualAddressSpace::clone(), X64VirtualAddressSpace::clone(), Arm64VirtualAddressSpace::clone(), Armv7VirtualAddressSpace::clone(), expandHeap(), X64VirtualAddressSpace::getEndOfHeap(), Arm64VirtualAddressSpace::memIsInHeap(), Armv7VirtualAddressSpace::memIsInHeap(), HostedVirtualAddressSpace::memIsInHeap(), X64VirtualAddressSpace::memIsInHeap(), X64VirtualAddressSpace::revertToKernelAddressSpace(), Arm64VirtualAddressSpace::revertToKernelAddressSpace(), Armv7VirtualAddressSpace::revertToKernelAddressSpace(), and setHeap().
| void* VirtualAddressSpace::m_HeapEnd |
Pointer to the current heap end
Definition at line 414 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by HostedVirtualAddressSpace::clone(), X64VirtualAddressSpace::clone(), Arm64VirtualAddressSpace::clone(), Armv7VirtualAddressSpace::clone(), expandHeap(), X64VirtualAddressSpace::getEndOfHeap(), Arm64VirtualAddressSpace::memIsInHeap(), Armv7VirtualAddressSpace::memIsInHeap(), X64VirtualAddressSpace::revertToKernelAddressSpace(), Arm64VirtualAddressSpace::revertToKernelAddressSpace(), Armv7VirtualAddressSpace::revertToKernelAddressSpace(), and setHeap().
|
protected |
Definition at line 458 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
private |
Definition at line 469 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
private |
Definition at line 468 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
private |
Definition at line 470 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
static |
Physical address of a zero page, always page-aligned.
Definition at line 416 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by expandHeap().
|
staticconstexpr |
Definition at line 255 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
|
static |
Retain the physical page while denying every access.
Definition at line 72 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by PosixSubsystem::checkAddress(), X64VirtualAddressSpace::fromFlags(), Arm64VirtualAddressSpace::handleCopyOnWriteFault(), Armv7VirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::handleCopyOnWriteFault(), AnonymousMemoryMap::supportsPageOut(), HostedVirtualAddressSpace::toFlags(), X64VirtualAddressSpace::toFlags(), and HostedVirtualAddressSpace::tryWriteUser32().
|
static |
Kernel-provided user ABI storage, permanently resident until owner retirement.
Definition at line 78 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by PerProcessorScheduler::checkEventState(), X64VirtualAddressSpace::fromFlags(), Thread::getTlsBase(), AnonymousMemoryMap::supportsPageOut(), and X64VirtualAddressSpace::toFlags().
|
static |
If this flag is set, the mapped physical page is shared.
Definition at line 62 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by HostedVirtualAddressSpace::clone(), X64VirtualAddressSpace::fromFlags(), Arm64VirtualAddressSpace::handleCopyOnWriteFault(), Armv7VirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::revertToKernelAddressSpace(), AnonymousMemoryMap::supportsPageOut(), X64VirtualAddressSpace::toFlags(), AnonymousMemoryMap::trap(), and MemoryMappedFile::trap().
|
static |
If this flag is set, the page is swapped out
Definition at line 60 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by X64VirtualAddressSpace::fromFlags(), Arm64VirtualAddressSpace::handleCopyOnWriteFault(), Armv7VirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::handleCopyOnWriteFault(), Armv7VirtualAddressSpace::isMapped(), HostedVirtualAddressSpace::revertToKernelAddressSpace(), HostedVirtualAddressSpace::toFlags(), X64VirtualAddressSpace::toFlags(), and HostedVirtualAddressSpace::tryWriteUser32().
|
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 Elf::allocate(), Arm64VirtualAddressSpace::allocateStack(), Armv7VirtualAddressSpace::allocateStack(), PosixSubsystem::checkAddress(), PerProcessorScheduler::checkEventState(), HostedVirtualAddressSpace::clone(), HostedVirtualAddressSpace::doAllocateStack(), X64VirtualAddressSpace::doAllocateStack(), expandHeap(), Elf::finaliseModule(), X64VirtualAddressSpace::fromFlags(), Armv7VirtualAddressSpace::getMapping(), Thread::getTlsBase(), Arm64VirtualAddressSpace::handleCopyOnWriteFault(), Armv7VirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::handleCopyOnWriteFault(), KernelElf::initialise(), BusMasterIde::initialise(), MemoryPool::initialise(), X86CommonPhysicalMemoryManager::initialise64(), DynamicLinker::initPlt(), Elf::loadModule(), Device::Address::map(), Cache::map(), X86CommonPhysicalMemoryManager::PageStack::maybeMap(), Nic3C90x::Nic3C90x(), KernelElf::prepareRuntimeModules(), MemoryMappedFile::setPermissions(), AnonymousMemoryMap::supportsPageOut(), Framebuffer::swCreateBuffer(), HostedVirtualAddressSpace::toFlags(), X64VirtualAddressSpace::toFlags(), MemoryMappedFile::trap(), and HostedVirtualAddressSpace::tryWriteUser32().
|
static |
If this flag is set, the cache strategy is write-combine.
Definition at line 64 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by X64VirtualAddressSpace::fromFlags(), Device::Address::map(), X64VirtualAddressSpace::toFlags(), and MemoryMappedFile::trap().
|
static |
A read-only protection must not be bypassed by resolving copy-on-write.
Definition at line 74 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by PosixSubsystem::checkAddress(), HostedVirtualAddressSpace::clone(), X64VirtualAddressSpace::fromFlags(), Arm64VirtualAddressSpace::handleCopyOnWriteFault(), Armv7VirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::handleCopyOnWriteFault(), HostedVirtualAddressSpace::toFlags(), X64VirtualAddressSpace::toFlags(), and HostedVirtualAddressSpace::tryWriteUser32().
|
static |
If this flag is set, the cache strategy is write-through.
Definition at line 54 of file include/pedigree/kernel/processor/VirtualAddressSpace.h.
Referenced by X64VirtualAddressSpace::fromFlags(), Device::Address::map(), X64VirtualAddressSpace::toFlags(), and MemoryMappedFile::trap().