diff options
author | bunnei <ericbunnie@gmail.com> | 2014-05-08 03:04:55 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-05-08 03:04:55 +0200 |
commit | 72622a1b5a13083e1b4eda3d4584bfa2f04dc55c (patch) | |
tree | 1a230947b66fd7001c58f96a47f352532d64e4ec /src/core/hle/service/service.h | |
parent | added kernel memory to mem_map (diff) | |
download | yuzu-72622a1b5a13083e1b4eda3d4584bfa2f04dc55c.tar yuzu-72622a1b5a13083e1b4eda3d4584bfa2f04dc55c.tar.gz yuzu-72622a1b5a13083e1b4eda3d4584bfa2f04dc55c.tar.bz2 yuzu-72622a1b5a13083e1b4eda3d4584bfa2f04dc55c.tar.lz yuzu-72622a1b5a13083e1b4eda3d4584bfa2f04dc55c.tar.xz yuzu-72622a1b5a13083e1b4eda3d4584bfa2f04dc55c.tar.zst yuzu-72622a1b5a13083e1b4eda3d4584bfa2f04dc55c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/service.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index b79dc9458..b260a290a 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()) { |