summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/process.h
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-07-18 04:19:16 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-16 06:03:45 +0200
commitcdeeecf0807d0005356f30db0f7164c5891a9245 (patch)
treee32e6d673cdac358df0abd3d3ece13f37c1c28d5 /src/core/hle/kernel/process.h
parentMemory: Move PAGE_MASK and PAGE_BITS to memory.h (diff)
downloadyuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.gz
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.bz2
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.lz
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.xz
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.zst
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/process.h31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h
index 83d3aceae..567d5df18 100644
--- a/src/core/hle/kernel/process.h
+++ b/src/core/hle/kernel/process.h
@@ -15,6 +15,7 @@
#include "common/common_types.h"
#include "core/hle/kernel/kernel.h"
+#include "core/hle/kernel/vm_manager.h"
namespace Kernel {
@@ -48,7 +49,6 @@ union ProcessFlags {
};
class ResourceLimit;
-class VMManager;
struct CodeSet final : public Object {
static SharedPtr<CodeSet> Create(std::string name, u64 program_id);
@@ -108,10 +108,6 @@ public:
/// The id of this process
u32 process_id = next_process_id++;
- /// Bitmask of the used TLS slots
- std::bitset<300> used_tls_slots;
- std::unique_ptr<VMManager> address_space;
-
/**
* Parses a list of kernel capability descriptors (as found in the ExHeader) and applies them
* to this process.
@@ -123,6 +119,31 @@ public:
*/
void Run(s32 main_thread_priority, u32 stack_size);
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+ // Memory Management
+
+ VMManager vm_manager;
+
+ // Memory used to back the allocations in the regular heap. A single vector is used to cover
+ // the entire virtual address space extents that bound the allocations, including any holes.
+ // This makes deallocation and reallocation of holes fast and keeps process memory contiguous
+ // in the emulator address space, allowing Memory::GetPointer to be reasonably safe.
+ std::shared_ptr<std::vector<u8>> heap_memory;
+ // 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;
+
+ /// Bitmask of the used TLS slots
+ std::bitset<300> used_tls_slots;
+
+ ResultVal<VAddr> HeapAllocate(VAddr target, u32 size, VMAPermission perms);
+ ResultCode HeapFree(VAddr target, u32 size);
+
+ ResultVal<VAddr> LinearAllocate(VAddr target, u32 size, VMAPermission perms);
+ ResultCode LinearFree(VAddr target, u32 size);
+
private:
Process();
~Process() override;