aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/mem_map_funcs.cpp
diff options
context:
space:
mode:
authorGravatar bunnei <ericbunnie@gmail.com>2014-05-07 21:04:55 -0400
committerGravatar bunnei <ericbunnie@gmail.com>2014-05-07 21:04:55 -0400
commit72622a1b5a13083e1b4eda3d4584bfa2f04dc55c (patch)
tree1a230947b66fd7001c58f96a47f352532d64e4ec /src/core/mem_map_funcs.cpp
parentf23e99bb85e7644db78717741cc50f3cc3332aa9 (diff)
- removed HLE mem "hack" and replaced with kernel mem region
- added a helper function for getting command buffer for services - fixed bug where GSP DMA was incorrectly being done in DataSynchronizationBarrier (instead of gsp_TriggerCmdReqQueue)
Diffstat (limited to 'src/core/mem_map_funcs.cpp')
-rw-r--r--src/core/mem_map_funcs.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp
index 4812a8d2..8ab64771 100644
--- a/src/core/mem_map_funcs.cpp
+++ b/src/core/mem_map_funcs.cpp
@@ -48,11 +48,9 @@ inline void _Read(T &var, const u32 addr) {
const u32 vaddr = _VirtualAddress(addr);
- // Memory allocated for HLE use that can be addressed from the emulated application
- // The primary use of this is sharing a commandbuffer between the HLE OS (syscore) and the LLE
- // core running the user application (appcore)
- if (vaddr >= HLE::CMD_BUFFER_ADDR && vaddr < HLE::CMD_BUFFER_ADDR_END) {
- HLE::Read<T>(var, vaddr);
+ // Kernel memory command buffer
+ if (vaddr >= KERNEL_MEMORY_VADDR && vaddr < KERNEL_MEMORY_VADDR_END) {
+ var = *((const T*)&g_kernel_mem[vaddr & KERNEL_MEMORY_MASK]);
// Hardware I/O register reads
// 0x10XXXXXX- is physical address space, 0x1EXXXXXX is virtual address space
@@ -92,11 +90,9 @@ template <typename T>
inline void _Write(u32 addr, const T data) {
u32 vaddr = _VirtualAddress(addr);
- // Memory allocated for HLE use that can be addressed from the emulated application
- // The primary use of this is sharing a commandbuffer between the HLE OS (syscore) and the LLE
- // core running the user application (appcore)
- if (vaddr >= HLE::CMD_BUFFER_ADDR && vaddr < HLE::CMD_BUFFER_ADDR_END) {
- HLE::Write<T>(vaddr, data);
+ // Kernel memory command buffer
+ if (vaddr >= KERNEL_MEMORY_VADDR && vaddr < KERNEL_MEMORY_VADDR_END) {
+ *(T*)&g_kernel_mem[vaddr & KERNEL_MEMORY_MASK] = data;
// Hardware I/O register writes
// 0x10XXXXXX- is physical address space, 0x1EXXXXXX is virtual address space
@@ -140,8 +136,12 @@ inline void _Write(u32 addr, const T data) {
u8 *GetPointer(const u32 addr) {
const u32 vaddr = _VirtualAddress(addr);
+ // Kernel memory command buffer
+ if (vaddr >= KERNEL_MEMORY_VADDR && vaddr < KERNEL_MEMORY_VADDR_END) {
+ return g_kernel_mem + (vaddr & KERNEL_MEMORY_MASK);
+
// ExeFS:/.code is loaded here
- if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) {
+ } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) {
return g_exefs_code + (vaddr & EXEFS_CODE_MASK);
// FCRAM - GSP heap