diff options
author | bunnei <bunneidev@gmail.com> | 2017-02-27 20:25:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-27 20:25:50 +0100 |
commit | 5e334af369f2255707131b8dd0094f9c3d27d851 (patch) | |
tree | 345e0a0704e98a55be2cbe956f4d78dacbda1b25 /src/core/hle/service/ir/ir_rst.cpp | |
parent | Fix log entry in timer::signal (#2600) (diff) | |
parent | IR: separate functions of each port to their own files (diff) | |
download | yuzu-5e334af369f2255707131b8dd0094f9c3d27d851.tar yuzu-5e334af369f2255707131b8dd0094f9c3d27d851.tar.gz yuzu-5e334af369f2255707131b8dd0094f9c3d27d851.tar.bz2 yuzu-5e334af369f2255707131b8dd0094f9c3d27d851.tar.lz yuzu-5e334af369f2255707131b8dd0094f9c3d27d851.tar.xz yuzu-5e334af369f2255707131b8dd0094f9c3d27d851.tar.zst yuzu-5e334af369f2255707131b8dd0094f9c3d27d851.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/ir/ir_rst.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/core/hle/service/ir/ir_rst.cpp b/src/core/hle/service/ir/ir_rst.cpp index 1f10ebd3d..3f1275c53 100644 --- a/src/core/hle/service/ir/ir_rst.cpp +++ b/src/core/hle/service/ir/ir_rst.cpp @@ -2,12 +2,34 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/event.h" +#include "core/hle/kernel/shared_memory.h" #include "core/hle/service/ir/ir.h" #include "core/hle/service/ir/ir_rst.h" namespace Service { namespace IR { +static Kernel::SharedPtr<Kernel::Event> handle_event; +static Kernel::SharedPtr<Kernel::SharedMemory> shared_memory; + +/** + * IR::GetHandles service function + * Outputs: + * 1 : Result of function, 0 on success, otherwise error code + * 2 : Translate header, used by the ARM11-kernel + * 3 : Shared memory handle + * 4 : Event handle + */ +static void GetHandles(Interface* self) { + u32* cmd_buff = Kernel::GetCommandBuffer(); + + cmd_buff[1] = RESULT_SUCCESS.raw; + cmd_buff[2] = 0x4000000; + cmd_buff[3] = Kernel::g_handle_table.Create(Service::IR::shared_memory).MoveFrom(); + cmd_buff[4] = Kernel::g_handle_table.Create(Service::IR::handle_event).MoveFrom(); +} + const Interface::FunctionInfo FunctionTable[] = { {0x00010000, GetHandles, "GetHandles"}, {0x00020080, nullptr, "Initialize"}, @@ -19,5 +41,20 @@ IR_RST_Interface::IR_RST_Interface() { Register(FunctionTable); } +void InitRST() { + using namespace Kernel; + + shared_memory = + SharedMemory::Create(nullptr, 0x1000, MemoryPermission::ReadWrite, + MemoryPermission::ReadWrite, 0, MemoryRegion::BASE, "IR:SharedMemory"); + + handle_event = Event::Create(ResetType::OneShot, "IR:HandleEvent"); +} + +void ShutdownRST() { + shared_memory = nullptr; + handle_event = nullptr; +} + } // namespace IR } // namespace Service |