summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/shared_memory.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2016-05-09 00:10:53 +0200
committerSubv <subv2112@gmail.com>2016-05-13 03:01:59 +0200
commitac2de12ed8a7cc2759e25325f388db92b3f356a6 (patch)
treef679398a60a1d330b6ac38bfffa051631f99d6e7 /src/core/hle/kernel/shared_memory.h
parentKernel: Account for automatically-allocated shared memories in the amount of used linear heap memory. (diff)
downloadyuzu-ac2de12ed8a7cc2759e25325f388db92b3f356a6.tar
yuzu-ac2de12ed8a7cc2759e25325f388db92b3f356a6.tar.gz
yuzu-ac2de12ed8a7cc2759e25325f388db92b3f356a6.tar.bz2
yuzu-ac2de12ed8a7cc2759e25325f388db92b3f356a6.tar.lz
yuzu-ac2de12ed8a7cc2759e25325f388db92b3f356a6.tar.xz
yuzu-ac2de12ed8a7cc2759e25325f388db92b3f356a6.tar.zst
yuzu-ac2de12ed8a7cc2759e25325f388db92b3f356a6.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/shared_memory.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h
index af145bef5..0c404a9f8 100644
--- a/src/core/hle/kernel/shared_memory.h
+++ b/src/core/hle/kernel/shared_memory.h
@@ -30,7 +30,7 @@ enum class MemoryPermission : u32 {
class SharedMemory final : public Object {
public:
/**
- * Creates a shared memory object
+ * Creates a shared memory object.
* @param owner_process Process that created this shared memory object.
* @param size Size of the memory block. Must be page-aligned.
* @param permissions Permission restrictions applied to the process which created the block.
@@ -42,6 +42,18 @@ public:
static SharedPtr<SharedMemory> Create(SharedPtr<Process> owner_process, u32 size, MemoryPermission permissions,
MemoryPermission other_permissions, VAddr address = 0, MemoryRegion region = MemoryRegion::BASE, std::string name = "Unknown");
+ /**
+ * Creates a shared memory object from a block of memory managed by an HLE applet.
+ * @param heap_block Heap block of the HLE applet.
+ * @param offset The offset into the heap block that the SharedMemory will map.
+ * @param size Size of the memory block. Must be page-aligned.
+ * @param permissions Permission restrictions applied to the process which created the block.
+ * @param other_permissions Permission restrictions applied to other processes mapping the block.
+ * @param name Optional object name, used for debugging purposes.
+ */
+ static SharedPtr<SharedMemory> CreateForApplet(std::shared_ptr<std::vector<u8>> heap_block, u32 offset, u32 size,
+ MemoryPermission permissions, MemoryPermission other_permissions, std::string name = "Unknown Applet");
+
std::string GetTypeName() const override { return "SharedMemory"; }
std::string GetName() const override { return name; }