20 #ifndef KERNEL_PROCESSOR_ARMV7_VIRTUALADDRESSSPACE_H 21 #define KERNEL_PROCESSOR_ARMV7_VIRTUALADDRESSSPACE_H 23 #include "pedigree/kernel/processor/VirtualAddressSpace.h" 24 #include "pedigree/kernel/processor/types.h" 33 #define USERSPACE_DYNAMIC_LINKER_LOCATION reinterpret_cast<void *>(0x1FA00000) 34 #define USERSPACE_VIRTUAL_START reinterpret_cast<void *>(0x1000) 35 #define USERSPACE_VIRTUAL_HEAP reinterpret_cast<void *>(0x20000000) 36 #define USERSPACE_RESERVED_START USERSPACE_DYNAMIC_LINKER_LOCATION 37 #define USERSPACE_VIRTUAL_STACK reinterpret_cast<void *>(0x3FE00000) 38 #define USERSPACE_PAGEDIR \ 39 reinterpret_cast<void *>(0x3FFFF000) 40 #define USERSPACE_PAGETABLES reinterpret_cast<void *>(0x3FE00000) 43 #define USERSPACE_VIRTUAL_STACK_SIZE 0x100000 44 #define KERNEL_SPACE_START reinterpret_cast<void *>(0x40000000) 45 #define KERNEL_VIRTUAL_HEAP reinterpret_cast<void *>(0x40000000) 46 #define KERNEL_VIRTUAL_HEAP_SIZE 0x20000000 47 #define KERNEL_VIRTUAL_MODULE_BASE reinterpret_cast<void *>(0x60000000) 48 #define KERNEL_VIRTUAL_MODULE_SIZE 0x400000 49 #define KERNEL_VIRTUAL_ADDRESS reinterpret_cast<void *>(0x80008000) 50 #define KERNEL_VIRTUAL_CACHE reinterpret_cast<void *>(0xA0000000) 51 #define KERNEL_VIRTUAL_CACHE_SIZE 0x10000000 52 #define KERNEL_VIRTUAL_MEMORYREGION_ADDRESS reinterpret_cast<void *>(0xB0000000) 53 #define KERNEL_VIRTUAL_EVENT_BASE reinterpret_cast<void *>(0xE0000000) 54 #define KERNEL_VIRTUAL_PAGESTACK_4GB reinterpret_cast<void *>(0xF0000000) 55 #define KERNEL_VIRTUAL_STACK reinterpret_cast<void *>(0xFEFFF000) 56 #define KERNEL_TEMP0 reinterpret_cast<void *>(0xFE000000) 57 #define KERNEL_TEMP1 reinterpret_cast<void *>(0xFE001000) 58 #define KERNEL_PAGEDIR \ 59 reinterpret_cast<void *>(0xFFFB0000) // 0xFFFF0000 is where we'll put the 61 #define KERNEL_PAGETABLES reinterpret_cast<void *>(0xFF000000) 62 #define KERNEL_VIRTUAL_MEMORYREGION_SIZE 0x30000000 63 #define KERNEL_STACK_SIZE 0x20000 82 virtual bool isMapped(
void *virtualAddress);
89 virtual void setFlags(
void *virtualAddress,
size_t newFlags);
90 virtual void unmap(
void *virtualAddress);
93 virtual void freeStack(
void *pStack);
111 physical_uintptr_t
physicalAddress,
void *virtualAddress,
size_t flags);
128 return reinterpret_cast<uintptr_t
>(KERNEL_SPACE_START);
134 return reinterpret_cast<uintptr_t
>(USERSPACE_VIRTUAL_START);
140 return reinterpret_cast<uintptr_t
>(USERSPACE_RESERVED_START);
152 return reinterpret_cast<uintptr_t
>(KERNEL_VIRTUAL_HEAP);
158 return reinterpret_cast<uintptr_t
>(KERNEL_VIRTUAL_HEAP) +
159 KERNEL_VIRTUAL_HEAP_SIZE;
165 return reinterpret_cast<uintptr_t
>(KERNEL_VIRTUAL_CACHE);
171 return reinterpret_cast<uintptr_t
>(KERNEL_VIRTUAL_CACHE) +
172 KERNEL_VIRTUAL_CACHE_SIZE;
178 return reinterpret_cast<uintptr_t
>(KERNEL_VIRTUAL_EVENT_BASE);
184 return reinterpret_cast<uintptr_t
>(KERNEL_VIRTUAL_MODULE_BASE);
190 return reinterpret_cast<uintptr_t
>(KERNEL_VIRTUAL_MODULE_BASE) +
191 KERNEL_VIRTUAL_MODULE_SIZE;
207 void *Heap, physical_uintptr_t PhysicalPageDirectory,
208 void *VirtualPageDirectory,
void *VirtualPageTables,
211 bool doIsMapped(
void *virtualAddress);
213 physical_uintptr_t
physicalAddress,
void *virtualAddress,
size_t flags);
215 void *virtualAddress, physical_uintptr_t &physicalAddress,
217 void doSetFlags(
void *virtualAddress,
size_t newFlags);
218 void doUnmap(
void *virtualAddress);
219 void *doAllocateStack(
size_t sSize);
228 void *Heap, physical_uintptr_t PhysicalPageDirectory,
229 void *VirtualPageDirectory,
void *VirtualPageTables);
253 uint32_t
toFlags(
size_t flags);
276 uint32_t ignore : 30;
286 uint32_t baseaddr : 22;
325 uint32_t ignore : 30;
389 virtual bool isMapped(
void *virtualAddress);
395 virtual void setFlags(
void *virtualAddress,
size_t newFlags);
396 virtual void unmap(
void *virtualAddress);
398 virtual bool initialiseKernelAddressSpace();
ArmV7VirtualAddressSpace & operator=(const ArmV7VirtualAddressSpace &)
virtual void unmap(void *virtualAddress)
size_t fromFlags(uint32_t Flags)
virtual VirtualAddressSpace * clone()
bool mapPageStructures(physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)
Vector< void * > m_freeStacks
uint32_t ns
= 0 for section, 1 for supersection
virtual void getMapping(void *virtualAddress, physical_uintptr_t &physicalAddress, size_t &flags)
virtual bool memIsInHeap(void *pMem)
virtual uintptr_t getKernelCacheStart() const
virtual uintptr_t getUserStart() const
static EXPORTED_PUBLIC VirtualAddressSpace & getKernelAddressSpace()
virtual void setFlags(void *virtualAddress, size_t newFlags)
virtual uintptr_t getKernelModulesEnd() const
virtual bool isMapped(void *virtualAddress)
virtual uintptr_t getKernelHeapStart() const
static VirtualAddressSpace * create()
ArmV7VirtualAddressSpace()
uintptr_t physicalAddress(physical_uintptr_t address) PURE
static ArmV7KernelVirtualAddressSpace m_Instance
bool doMap(physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)
virtual void * getEndOfHeap()
virtual uintptr_t getKernelStart() const
virtual uintptr_t getKernelHeapEnd() const
uint32_t imp
extended base address for supersection
void * m_VirtualPageDirectory
physical_uintptr_t m_PhysicalPageDirectory
virtual bool map(physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)
The exception was caused by a hardware task switch.
virtual uintptr_t getUserReservedStart() const
virtual uintptr_t getDynamicLinkerAddress() const
#define USERSPACE_DYNAMIC_LINKER_LOCATION
virtual uintptr_t getKernelModulesStart() const
virtual uintptr_t getKernelCacheEnd() const
bool getPageTableEntry(void *virtualAddress, uint32_t *&pageTableEntry)
virtual ~ArmV7VirtualAddressSpace()
virtual void revertToKernelAddressSpace()
uint32_t toFlags(size_t flags)
union ArmV7VirtualAddressSpace::FirstLevelDescriptor::@88 descriptor
virtual uintptr_t getKernelEventBlockStart() const
void * m_VirtualPageTables
virtual void * allocateStack()
virtual bool isAddressValid(void *virtualAddress)