IR: Move The IR services to their own folder and implement "GetHandles"
parent
3fd2cc566b
commit
d6c9af600f
@ -0,0 +1,48 @@
|
|||||||
|
// Copyright 2015 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
#include "core/hle/service/ir/ir.h"
|
||||||
|
#include "core/hle/service/ir/ir_rst.h"
|
||||||
|
#include "core/hle/service/ir/ir_u.h"
|
||||||
|
#include "core/hle/service/ir/ir_user.h"
|
||||||
|
|
||||||
|
#include "core/hle/hle.h"
|
||||||
|
#include "core/hle/kernel/event.h"
|
||||||
|
#include "core/hle/kernel/shared_memory.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace IR {
|
||||||
|
|
||||||
|
static Kernel::SharedPtr<Kernel::Event> handle_event = nullptr;
|
||||||
|
static Kernel::SharedPtr<Kernel::SharedMemory> shared_memory = nullptr;
|
||||||
|
|
||||||
|
void GetHandles(Service::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();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Init() {
|
||||||
|
using namespace Kernel;
|
||||||
|
|
||||||
|
AddService(new IR_RST_Interface);
|
||||||
|
AddService(new IR_U_Interface);
|
||||||
|
AddService(new IR_User_Interface);
|
||||||
|
|
||||||
|
shared_memory = SharedMemory::Create("IR:SharedMemory");
|
||||||
|
|
||||||
|
// Create event handle(s)
|
||||||
|
handle_event = Event::Create(RESETTYPE_ONESHOT, "IR:HandleEvent");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Shutdown() {
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace IR
|
||||||
|
|
||||||
|
} // namespace Service
|
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright 2015 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/kernel/kernel.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace IR {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
void GetHandles(Interface* self);
|
||||||
|
|
||||||
|
/// Initialize IR service
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
/// Shutdown IR service
|
||||||
|
void Shutdown();
|
||||||
|
|
||||||
|
} // namespace IR
|
||||||
|
} // namespace Service
|
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright 2015 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "core/hle/hle.h"
|
||||||
|
#include "core/hle/service/ir/ir.h"
|
||||||
|
#include "core/hle/service/ir/ir_rst.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace IR {
|
||||||
|
|
||||||
|
const Interface::FunctionInfo FunctionTable[] = {
|
||||||
|
{0x00010000, GetHandles, "GetHandles"},
|
||||||
|
{0x00020080, nullptr, "Initialize"},
|
||||||
|
{0x00030000, nullptr, "Shutdown"},
|
||||||
|
{0x00090000, nullptr, "WriteToTwoFields"},
|
||||||
|
};
|
||||||
|
|
||||||
|
IR_RST_Interface::IR_RST_Interface() {
|
||||||
|
Register(FunctionTable);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace IR
|
||||||
|
} // namespace Service
|
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright 2015 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "core/hle/hle.h"
|
||||||
|
#include "core/hle/service/ir/ir.h"
|
||||||
|
#include "core/hle/service/ir/ir_user.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace IR {
|
||||||
|
|
||||||
|
const Interface::FunctionInfo FunctionTable[] = {
|
||||||
|
{0x00010182, nullptr, "InitializeIrNop"},
|
||||||
|
{0x00020000, nullptr, "FinalizeIrNop"},
|
||||||
|
{0x00030000, nullptr, "ClearReceiveBuffer"},
|
||||||
|
{0x00040000, nullptr, "ClearSendBuffer"},
|
||||||
|
{0x00060040, nullptr, "RequireConnection"},
|
||||||
|
{0x00090000, nullptr, "Disconnect"},
|
||||||
|
{0x000A0000, nullptr, "GetReceiveEvent"},
|
||||||
|
{0x000B0000, nullptr, "GetSendEvent"},
|
||||||
|
{0x000C0000, nullptr, "GetConnectionStatusEvent"},
|
||||||
|
{0x000D0042, nullptr, "SendIrNop"},
|
||||||
|
{0x000E0042, nullptr, "SendIrNopLarge"},
|
||||||
|
{0x00180182, nullptr, "InitializeIrNopShared"},
|
||||||
|
{0x00190040, nullptr, "ReleaseReceivedData"},
|
||||||
|
{0x001A0040, nullptr, "SetOwnMachineId"},
|
||||||
|
};
|
||||||
|
|
||||||
|
IR_User_Interface::IR_User_Interface() {
|
||||||
|
Register(FunctionTable);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace IR
|
||||||
|
} // namespace Service
|
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright 2015 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace IR {
|
||||||
|
|
||||||
|
class IR_User_Interface : public Service::Interface {
|
||||||
|
public:
|
||||||
|
IR_User_Interface();
|
||||||
|
|
||||||
|
std::string GetPortName() const override {
|
||||||
|
return "ir:USER";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace IR
|
||||||
|
} // namespace Service
|
@ -1,27 +0,0 @@
|
|||||||
// Copyright 2014 Citra Emulator Project
|
|
||||||
// Licensed under GPLv2 or any later version
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#include "core/hle/hle.h"
|
|
||||||
#include "core/hle/service/ir_rst.h"
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Namespace IR_RST
|
|
||||||
|
|
||||||
namespace IR_RST {
|
|
||||||
|
|
||||||
const Interface::FunctionInfo FunctionTable[] = {
|
|
||||||
{0x00010000, nullptr, "GetHandles"},
|
|
||||||
{0x00020080, nullptr, "Initialize"},
|
|
||||||
{0x00030000, nullptr, "Shutdown"},
|
|
||||||
{0x00090000, nullptr, "WriteToTwoFields"},
|
|
||||||
};
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Interface class
|
|
||||||
|
|
||||||
Interface::Interface() {
|
|
||||||
Register(FunctionTable);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
Loading…
Reference in New Issue