Kernel: Add more infrastructure to support different memory layouts

This adds some structures necessary to support multiple memory regions
in the future. It also adds support for different system memory types
and the new linear heap mapping at 0x30000000.
This commit is contained in:
Yuri Kunde Schlesner 2015-08-05 21:26:52 -03:00
parent c39b52f974
commit 74d4bc0af1
10 changed files with 148 additions and 28 deletions

View file

@ -49,6 +49,7 @@ union ProcessFlags {
};
class ResourceLimit;
struct MemoryRegionInfo;
struct CodeSet final : public Object {
static SharedPtr<CodeSet> Create(std::string name, u64 program_id);
@ -135,11 +136,14 @@ public:
// The left/right bounds of the address space covered by heap_memory.
VAddr heap_start = 0, heap_end = 0;
std::shared_ptr<std::vector<u8>> linear_heap_memory;
MemoryRegionInfo* memory_region = nullptr;
/// Bitmask of the used TLS slots
std::bitset<300> used_tls_slots;
VAddr GetLinearHeapBase() const;
VAddr GetLinearHeapLimit() const;
ResultVal<VAddr> HeapAllocate(VAddr target, u32 size, VMAPermission perms);
ResultCode HeapFree(VAddr target, u32 size);