mirror of
https://github.com/PabloMK7/citra.git
synced 2025-10-11 20:10:03 +00:00
hle: Eliminate need to specify command headers for IPC. (#6678)
This commit is contained in:
parent
0bedb28bdc
commit
e043caac27
96 changed files with 2691 additions and 2707 deletions
|
@ -128,14 +128,14 @@ void IR_RST::UpdateCallback(std::uintptr_t user_data, s64 cycles_late) {
|
|||
}
|
||||
|
||||
void IR_RST::GetHandles(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx, 0x01, 0, 0);
|
||||
IPC::RequestParser rp(ctx);
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 3);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushMoveObjects(shared_memory, update_event);
|
||||
}
|
||||
|
||||
void IR_RST::Initialize(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx, 0x02, 2, 0);
|
||||
IPC::RequestParser rp(ctx);
|
||||
update_period = static_cast<int>(rp.Pop<u32>());
|
||||
raw_c_stick = rp.Pop<bool>();
|
||||
|
||||
|
@ -153,7 +153,7 @@ void IR_RST::Initialize(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void IR_RST::Shutdown(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx, 0x03, 0, 0);
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
system.CoreTiming().UnscheduleEvent(update_callback_id, 0);
|
||||
UnloadInputDevices();
|
||||
|
@ -181,10 +181,10 @@ IR_RST::IR_RST(Core::System& system) : ServiceFramework("ir:rst", 1), system(sys
|
|||
|
||||
static const FunctionInfo functions[] = {
|
||||
// clang-format off
|
||||
{IPC::MakeHeader(0x0001, 0, 0), &IR_RST::GetHandles, "GetHandles"},
|
||||
{IPC::MakeHeader(0x0002, 2, 0), &IR_RST::Initialize, "Initialize"},
|
||||
{IPC::MakeHeader(0x0003, 0, 0), &IR_RST::Shutdown, "Shutdown"},
|
||||
{IPC::MakeHeader(0x0009, 0, 0), nullptr, "WriteToTwoFields"},
|
||||
{0x0001, &IR_RST::GetHandles, "GetHandles"},
|
||||
{0x0002, &IR_RST::Initialize, "Initialize"},
|
||||
{0x0003, &IR_RST::Shutdown, "Shutdown"},
|
||||
{0x0009, nullptr, "WriteToTwoFields"},
|
||||
// clang-format on
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
|
|
|
@ -12,24 +12,24 @@ namespace Service::IR {
|
|||
IR_U::IR_U() : ServiceFramework("ir:u", 1) {
|
||||
static const FunctionInfo functions[] = {
|
||||
// clang-format off
|
||||
{IPC::MakeHeader(0x0001, 0, 0), nullptr, "Initialize"},
|
||||
{IPC::MakeHeader(0x0002, 0, 0), nullptr, "Shutdown"},
|
||||
{IPC::MakeHeader(0x0003, 1, 2), nullptr, "StartSendTransfer"},
|
||||
{IPC::MakeHeader(0x0004, 0, 0), nullptr, "WaitSendTransfer"},
|
||||
{IPC::MakeHeader(0x0005, 3, 2), nullptr, "StartRecvTransfer"},
|
||||
{IPC::MakeHeader(0x0006, 0, 0), nullptr, "WaitRecvTransfer"},
|
||||
{IPC::MakeHeader(0x0007, 2, 0), nullptr, "GetRecvTransferCount"},
|
||||
{IPC::MakeHeader(0x0008, 0, 0), nullptr, "GetSendState"},
|
||||
{IPC::MakeHeader(0x0009, 1, 0), nullptr, "SetBitRate"},
|
||||
{IPC::MakeHeader(0x000A, 0, 0), nullptr, "GetBitRate"},
|
||||
{IPC::MakeHeader(0x000B, 1, 0), nullptr, "SetIRLEDState"},
|
||||
{IPC::MakeHeader(0x000C, 0, 0), nullptr, "GetIRLEDRecvState"},
|
||||
{IPC::MakeHeader(0x000D, 0, 0), nullptr, "GetSendFinishedEvent"},
|
||||
{IPC::MakeHeader(0x000E, 0, 0), nullptr, "GetRecvFinishedEvent"},
|
||||
{IPC::MakeHeader(0x000F, 0, 0), nullptr, "GetTransferState"},
|
||||
{IPC::MakeHeader(0x0010, 0, 0), nullptr, "GetErrorStatus"},
|
||||
{IPC::MakeHeader(0x0011, 1, 0), nullptr, "SetSleepModeActive"},
|
||||
{IPC::MakeHeader(0x0012, 1, 0), nullptr, "SetSleepModeState"},
|
||||
{0x0001, nullptr, "Initialize"},
|
||||
{0x0002, nullptr, "Shutdown"},
|
||||
{0x0003, nullptr, "StartSendTransfer"},
|
||||
{0x0004, nullptr, "WaitSendTransfer"},
|
||||
{0x0005, nullptr, "StartRecvTransfer"},
|
||||
{0x0006, nullptr, "WaitRecvTransfer"},
|
||||
{0x0007, nullptr, "GetRecvTransferCount"},
|
||||
{0x0008, nullptr, "GetSendState"},
|
||||
{0x0009, nullptr, "SetBitRate"},
|
||||
{0x000A, nullptr, "GetBitRate"},
|
||||
{0x000B, nullptr, "SetIRLEDState"},
|
||||
{0x000C, nullptr, "GetIRLEDRecvState"},
|
||||
{0x000D, nullptr, "GetSendFinishedEvent"},
|
||||
{0x000E, nullptr, "GetRecvFinishedEvent"},
|
||||
{0x000F, nullptr, "GetTransferState"},
|
||||
{0x0010, nullptr, "GetErrorStatus"},
|
||||
{0x0011, nullptr, "SetSleepModeActive"},
|
||||
{0x0012, nullptr, "SetSleepModeState"},
|
||||
// clang-format on
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
|
|
|
@ -274,7 +274,7 @@ void IR_USER::PutToReceive(std::span<const u8> payload) {
|
|||
}
|
||||
|
||||
void IR_USER::InitializeIrNopShared(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx, 0x18, 6, 2);
|
||||
IPC::RequestParser rp(ctx);
|
||||
const u32 shared_buff_size = rp.Pop<u32>();
|
||||
const u32 recv_buff_size = rp.Pop<u32>();
|
||||
const u32 recv_buff_packet_count = rp.Pop<u32>();
|
||||
|
@ -304,7 +304,7 @@ void IR_USER::InitializeIrNopShared(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void IR_USER::RequireConnection(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx, 0x06, 1, 0);
|
||||
IPC::RequestParser rp(ctx);
|
||||
const u8 device_id = rp.Pop<u8>();
|
||||
|
||||
u8* shared_memory_ptr = shared_memory->GetPointer();
|
||||
|
@ -390,7 +390,7 @@ void IR_USER::FinalizeIrNop(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void IR_USER::SendIrNop(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx, 0x0D, 1, 2);
|
||||
IPC::RequestParser rp(ctx);
|
||||
const u32 size = rp.Pop<u32>();
|
||||
std::vector<u8> buffer = rp.PopStaticBuffer();
|
||||
ASSERT(size == buffer.size());
|
||||
|
@ -410,7 +410,7 @@ void IR_USER::SendIrNop(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void IR_USER::ReleaseReceivedData(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx, 0x19, 1, 0);
|
||||
IPC::RequestParser rp(ctx);
|
||||
u32 count = rp.Pop<u32>();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
|
@ -429,32 +429,32 @@ void IR_USER::ReleaseReceivedData(Kernel::HLERequestContext& ctx) {
|
|||
IR_USER::IR_USER(Core::System& system) : ServiceFramework("ir:USER", 1) {
|
||||
const FunctionInfo functions[] = {
|
||||
// clang-format off
|
||||
{IPC::MakeHeader(0x0001, 6, 2), nullptr, "InitializeIrNop"},
|
||||
{IPC::MakeHeader(0x0002, 0, 0), &IR_USER::FinalizeIrNop, "FinalizeIrNop"},
|
||||
{IPC::MakeHeader(0x0003, 0, 0), nullptr, "ClearReceiveBuffer"},
|
||||
{IPC::MakeHeader(0x0004, 0, 0), nullptr, "ClearSendBuffer"},
|
||||
{IPC::MakeHeader(0x0005, 3, 0), nullptr, "WaitConnection"},
|
||||
{IPC::MakeHeader(0x0006, 1, 0), &IR_USER::RequireConnection, "RequireConnection"},
|
||||
{IPC::MakeHeader(0x0007, 11, 0), nullptr, "AutoConnection"},
|
||||
{IPC::MakeHeader(0x0008, 0, 0), nullptr, "AnyConnection"},
|
||||
{IPC::MakeHeader(0x0009, 0, 0), &IR_USER::Disconnect, "Disconnect"},
|
||||
{IPC::MakeHeader(0x000A, 0, 0), &IR_USER::GetReceiveEvent, "GetReceiveEvent"},
|
||||
{IPC::MakeHeader(0x000B, 0, 0), &IR_USER::GetSendEvent, "GetSendEvent"},
|
||||
{IPC::MakeHeader(0x000C, 0, 0), &IR_USER::GetConnectionStatusEvent, "GetConnectionStatusEvent"},
|
||||
{IPC::MakeHeader(0x000D, 1, 2), &IR_USER::SendIrNop, "SendIrNop"},
|
||||
{IPC::MakeHeader(0x000E, 1, 2), nullptr, "SendIrNopLarge"},
|
||||
{IPC::MakeHeader(0x000F, 1, 0), nullptr, "ReceiveIrnop"},
|
||||
{IPC::MakeHeader(0x0010, 1, 2), nullptr, "ReceiveIrnopLarge"},
|
||||
{IPC::MakeHeader(0x0011, 1, 0), nullptr, "GetLatestReceiveErrorResult"},
|
||||
{IPC::MakeHeader(0x0012, 1, 0), nullptr, "GetLatestSendErrorResult"},
|
||||
{IPC::MakeHeader(0x0013, 0, 0), nullptr, "GetConnectionStatus"},
|
||||
{IPC::MakeHeader(0x0014, 0, 0), nullptr, "GetTryingToConnectStatus"},
|
||||
{IPC::MakeHeader(0x0015, 0, 0), nullptr, "GetReceiveSizeFreeAndUsed"},
|
||||
{IPC::MakeHeader(0x0016, 0, 0), nullptr, "GetSendSizeFreeAndUsed"},
|
||||
{IPC::MakeHeader(0x0017, 0, 0), nullptr, "GetConnectionRole"},
|
||||
{IPC::MakeHeader(0x0018, 6, 2), &IR_USER::InitializeIrNopShared, "InitializeIrNopShared"},
|
||||
{IPC::MakeHeader(0x0019, 1, 0), &IR_USER::ReleaseReceivedData, "ReleaseReceivedData"},
|
||||
{IPC::MakeHeader(0x001A, 1, 0), nullptr, "SetOwnMachineId"},
|
||||
{0x0001, nullptr, "InitializeIrNop"},
|
||||
{0x0002, &IR_USER::FinalizeIrNop, "FinalizeIrNop"},
|
||||
{0x0003, nullptr, "ClearReceiveBuffer"},
|
||||
{0x0004, nullptr, "ClearSendBuffer"},
|
||||
{0x0005, nullptr, "WaitConnection"},
|
||||
{0x0006, &IR_USER::RequireConnection, "RequireConnection"},
|
||||
{0x0007, nullptr, "AutoConnection"},
|
||||
{0x0008, nullptr, "AnyConnection"},
|
||||
{0x0009, &IR_USER::Disconnect, "Disconnect"},
|
||||
{0x000A, &IR_USER::GetReceiveEvent, "GetReceiveEvent"},
|
||||
{0x000B, &IR_USER::GetSendEvent, "GetSendEvent"},
|
||||
{0x000C, &IR_USER::GetConnectionStatusEvent, "GetConnectionStatusEvent"},
|
||||
{0x000D, &IR_USER::SendIrNop, "SendIrNop"},
|
||||
{0x000E, nullptr, "SendIrNopLarge"},
|
||||
{0x000F, nullptr, "ReceiveIrnop"},
|
||||
{0x0010, nullptr, "ReceiveIrnopLarge"},
|
||||
{0x0011, nullptr, "GetLatestReceiveErrorResult"},
|
||||
{0x0012, nullptr, "GetLatestSendErrorResult"},
|
||||
{0x0013, nullptr, "GetConnectionStatus"},
|
||||
{0x0014, nullptr, "GetTryingToConnectStatus"},
|
||||
{0x0015, nullptr, "GetReceiveSizeFreeAndUsed"},
|
||||
{0x0016, nullptr, "GetSendSizeFreeAndUsed"},
|
||||
{0x0017, nullptr, "GetConnectionRole"},
|
||||
{0x0018, &IR_USER::InitializeIrNopShared, "InitializeIrNopShared"},
|
||||
{0x0019, &IR_USER::ReleaseReceivedData, "ReleaseReceivedData"},
|
||||
{0x001A, nullptr, "SetOwnMachineId"},
|
||||
// clang-format on
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue