aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service/service.h
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/hle/service/service.h
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/hle/service/service.h')
-rw-r--r--src/core/hle/service/service.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index b79dc945..b260a290 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -10,6 +10,7 @@
#include "common/common.h"
#include "common/common_types.h"
+#include "core/mem_map.h"
#include "core/hle/syscall.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -22,6 +23,15 @@ typedef s32 NativeUID; ///< Native handle for a service
static const int kMaxPortSize = 0x08; ///< Maximum size of a port name (8 characters)
static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header
+/**
+ * Returns a pointer to the command buffer in kernel memory
+ * @param offset Optional offset into command buffer
+ * @return Pointer to command buffer
+ */
+inline static u32* GetCommandBuffer(const int offset=0) {
+ return (u32*)Memory::GetPointer(Memory::KERNEL_MEMORY_VADDR + kCommandHeaderOffset + offset);
+}
+
class Manager;
/// Interface to a CTROS service
@@ -81,7 +91,7 @@ public:
* @return Return result of svcSendSyncRequest passed back to user app
*/
Syscall::Result Sync() {
- u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + kCommandHeaderOffset);
+ u32* cmd_buff = GetCommandBuffer();
auto itr = m_functions.find(cmd_buff[0]);
if (itr == m_functions.end()) {