summaryrefslogtreecommitdiffstats
path: root/src/core/memory.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-07 23:59:42 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:37 +0200
commitcd1c38be8d15d3caf52f566a9e8dc20504c61068 (patch)
tree2fed02ffd4f2151dfca14ddb33ef1939eaee2fba /src/core/memory.h
parentSVC: WaitSynchronization add Termination Pending Result. (diff)
downloadyuzu-cd1c38be8d15d3caf52f566a9e8dc20504c61068.tar
yuzu-cd1c38be8d15d3caf52f566a9e8dc20504c61068.tar.gz
yuzu-cd1c38be8d15d3caf52f566a9e8dc20504c61068.tar.bz2
yuzu-cd1c38be8d15d3caf52f566a9e8dc20504c61068.tar.lz
yuzu-cd1c38be8d15d3caf52f566a9e8dc20504c61068.tar.xz
yuzu-cd1c38be8d15d3caf52f566a9e8dc20504c61068.tar.zst
yuzu-cd1c38be8d15d3caf52f566a9e8dc20504c61068.zip
Diffstat (limited to 'src/core/memory.h')
-rw-r--r--src/core/memory.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/core/memory.h b/src/core/memory.h
index 93f0c1d6c..4a1cc63f4 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -245,6 +245,71 @@ public:
void Write64(VAddr addr, u64 data);
/**
+ * Writes a 8-bit unsigned integer to the given virtual address in
+ * the current process' address space if and only if the address contains
+ * the expected value. This operation is atomic.
+ *
+ * @param addr The virtual address to write the 8-bit unsigned integer to.
+ * @param data The 8-bit unsigned integer to write to the given virtual address.
+ * @param expected The 8-bit unsigned integer to check against the given virtual address.
+ *
+ * @post The memory range [addr, sizeof(data)) contains the given data value.
+ */
+ bool WriteExclusive8(VAddr addr, u8 data, u8 expected);
+
+ /**
+ * Writes a 16-bit unsigned integer to the given virtual address in
+ * the current process' address space if and only if the address contains
+ * the expected value. This operation is atomic.
+ *
+ * @param addr The virtual address to write the 16-bit unsigned integer to.
+ * @param data The 16-bit unsigned integer to write to the given virtual address.
+ * @param expected The 16-bit unsigned integer to check against the given virtual address.
+ *
+ * @post The memory range [addr, sizeof(data)) contains the given data value.
+ */
+ bool WriteExclusive16(VAddr addr, u16 data, u16 expected);
+
+ /**
+ * Writes a 32-bit unsigned integer to the given virtual address in
+ * the current process' address space if and only if the address contains
+ * the expected value. This operation is atomic.
+ *
+ * @param addr The virtual address to write the 32-bit unsigned integer to.
+ * @param data The 32-bit unsigned integer to write to the given virtual address.
+ * @param expected The 32-bit unsigned integer to check against the given virtual address.
+ *
+ * @post The memory range [addr, sizeof(data)) contains the given data value.
+ */
+ bool WriteExclusive32(VAddr addr, u32 data, u32 expected);
+
+ /**
+ * Writes a 64-bit unsigned integer to the given virtual address in
+ * the current process' address space if and only if the address contains
+ * the expected value. This operation is atomic.
+ *
+ * @param addr The virtual address to write the 64-bit unsigned integer to.
+ * @param data The 64-bit unsigned integer to write to the given virtual address.
+ * @param expected The 64-bit unsigned integer to check against the given virtual address.
+ *
+ * @post The memory range [addr, sizeof(data)) contains the given data value.
+ */
+ bool WriteExclusive64(VAddr addr, u64 data, u64 expected);
+
+ /**
+ * Writes a 128-bit unsigned integer to the given virtual address in
+ * the current process' address space if and only if the address contains
+ * the expected value. This operation is atomic.
+ *
+ * @param addr The virtual address to write the 128-bit unsigned integer to.
+ * @param data The 128-bit unsigned integer to write to the given virtual address.
+ * @param expected The 128-bit unsigned integer to check against the given virtual address.
+ *
+ * @post The memory range [addr, sizeof(data)) contains the given data value.
+ */
+ bool WriteExclusive128(VAddr addr, u128 data, u128 expected);
+
+ /**
* Reads a null-terminated string from the given virtual address.
* This function will continually read characters until either:
*