From e31425df3877636c098ec7426ebd2067920715cb Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Mon, 24 Feb 2020 22:04:12 -0400 Subject: General: Recover Prometheus project from harddrive failure This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system. --- src/core/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 9292f3b0a..93f0c1d6c 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -64,7 +64,7 @@ public: * * @param process The process to use the page table of. */ - void SetCurrentPageTable(Kernel::Process& process); + void SetCurrentPageTable(Kernel::Process& process, u32 core_id); /** * Maps an allocated buffer onto a region of the emulated process address space. -- cgit v1.2.3 From cd1c38be8d15d3caf52f566a9e8dc20504c61068 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sat, 7 Mar 2020 18:59:42 -0400 Subject: ARM/Memory: Correct Exclusive Monitor and Implement Exclusive Memory Writes. --- src/core/memory.h | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'src/core/memory.h') 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 @@ -244,6 +244,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: -- cgit v1.2.3