summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/shared_memory.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-07-05 06:55:39 +0200
committerbunnei <bunneidev@gmail.com>2014-07-05 07:21:05 +0200
commite547128185c7bc1c2081d3ee25b6207f4d24509b (patch)
treee11e7eacfa9898ca828b883da2ca32d482a65c69 /src/core/hle/kernel/shared_memory.h
parentmem_map: Updated interface to expose template functions to other modules. (diff)
downloadyuzu-e547128185c7bc1c2081d3ee25b6207f4d24509b.tar
yuzu-e547128185c7bc1c2081d3ee25b6207f4d24509b.tar.gz
yuzu-e547128185c7bc1c2081d3ee25b6207f4d24509b.tar.bz2
yuzu-e547128185c7bc1c2081d3ee25b6207f4d24509b.tar.lz
yuzu-e547128185c7bc1c2081d3ee25b6207f4d24509b.tar.xz
yuzu-e547128185c7bc1c2081d3ee25b6207f4d24509b.tar.zst
yuzu-e547128185c7bc1c2081d3ee25b6207f4d24509b.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/shared_memory.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h
new file mode 100644
index 000000000..4e235f605
--- /dev/null
+++ b/src/core/hle/kernel/shared_memory.h
@@ -0,0 +1,38 @@
+// Copyright 2014 Citra Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "common/common_types.h"
+
+#include "core/hle/kernel/kernel.h"
+
+namespace Kernel {
+
+/**
+ * Creates a shared memory object
+ * @param name Optional name of shared memory object
+ * @return Handle of newly created shared memory object
+ */
+Handle CreateSharedMemory(const std::string& name="Unknown");
+
+/**
+ * Maps a shared memory block to an address in system memory
+ * @param handle Shared memory block handle
+ * @param address Address in system memory to map shared memory block to
+ * @param permissions Memory block map permissions (specified by SVC field)
+ * @param other_permissions Memory block map other permissions (specified by SVC field)
+ * @return Result of operation, 0 on success, otherwise error code
+ */
+Result MapSharedMemory(u32 handle, u32 address, u32 permissions, u32 other_permissions);
+
+/**
+ * Gets a pointer to the shared memory block
+ * @param handle Shared memory block handle
+ * @param offset Offset from the start of the shared memory block to get pointer
+ * @return Pointer to the shared memory block from the specified offset
+ */
+u8* GetSharedMemoryPointer(Handle handle, u32 offset);
+
+} // namespace