hle: Eliminate need to specify command headers for IPC. (#6678)

This commit is contained in:
Steveice10
2023-07-14 17:32:59 -07:00
committed by GitHub
parent 0bedb28bdc
commit e043caac27
96 changed files with 2691 additions and 2707 deletions
+18 -18
View File
@@ -46,7 +46,7 @@ using CecOpenMode = Module::CecOpenMode;
using CecSystemInfoType = Module::CecSystemInfoType;
void Module::Interface::Open(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x01, 3, 2);
IPC::RequestParser rp(ctx);
const u32 ncch_program_id = rp.Pop<u32>();
const CecDataPathType path_type = rp.PopEnum<CecDataPathType>();
CecOpenMode open_mode;
@@ -129,7 +129,7 @@ void Module::Interface::Open(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::Read(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x02, 1, 2);
IPC::RequestParser rp(ctx);
const u32 write_buffer_size = rp.Pop<u32>();
auto& write_buffer = rp.PopMappedBuffer();
@@ -171,7 +171,7 @@ void Module::Interface::Read(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::ReadMessage(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x03, 4, 4);
IPC::RequestParser rp(ctx);
const u32 ncch_program_id = rp.Pop<u32>();
const bool is_outbox = rp.Pop<bool>();
const u32 message_id_size = rp.Pop<u32>();
@@ -240,7 +240,7 @@ void Module::Interface::ReadMessage(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::ReadMessageWithHMAC(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x04, 4, 6);
IPC::RequestParser rp(ctx);
const u32 ncch_program_id = rp.Pop<u32>();
const bool is_outbox = rp.Pop<bool>();
const u32 message_id_size = rp.Pop<u32>();
@@ -334,7 +334,7 @@ void Module::Interface::ReadMessageWithHMAC(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::Write(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x05, 1, 2);
IPC::RequestParser rp(ctx);
const u32 read_buffer_size = rp.Pop<u32>();
auto& read_buffer = rp.PopMappedBuffer();
@@ -382,7 +382,7 @@ void Module::Interface::Write(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::WriteMessage(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x06, 4, 4);
IPC::RequestParser rp(ctx);
const u32 ncch_program_id = rp.Pop<u32>();
const bool is_outbox = rp.Pop<bool>();
const u32 message_id_size = rp.Pop<u32>();
@@ -452,7 +452,7 @@ void Module::Interface::WriteMessage(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::WriteMessageWithHMAC(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x07, 4, 6);
IPC::RequestParser rp(ctx);
const u32 ncch_program_id = rp.Pop<u32>();
const bool is_outbox = rp.Pop<bool>();
const u32 message_id_size = rp.Pop<u32>();
@@ -540,7 +540,7 @@ void Module::Interface::WriteMessageWithHMAC(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::Delete(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x08, 4, 2);
IPC::RequestParser rp(ctx);
const u32 ncch_program_id = rp.Pop<u32>();
const CecDataPathType path_type = rp.PopEnum<CecDataPathType>();
const bool is_outbox = rp.Pop<bool>();
@@ -584,7 +584,7 @@ void Module::Interface::Delete(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::SetData(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x09, 3, 2);
IPC::RequestParser rp(ctx);
const u32 ncch_program_id = rp.Pop<u32>();
const u32 buffer_size = rp.Pop<u32>();
const u32 option = rp.Pop<u32>();
@@ -619,7 +619,7 @@ void Module::Interface::SetData(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::ReadData(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0A, 3, 4);
IPC::RequestParser rp(ctx);
const u32 dest_buffer_size = rp.Pop<u32>();
const CecSystemInfoType info_type = rp.PopEnum<CecSystemInfoType>();
const u32 param_buffer_size = rp.Pop<u32>();
@@ -658,7 +658,7 @@ void Module::Interface::ReadData(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::Start(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0B, 1, 0);
IPC::RequestParser rp(ctx);
const CecCommand command = rp.PopEnum<CecCommand>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@@ -668,7 +668,7 @@ void Module::Interface::Start(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::Stop(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0C, 1, 0);
IPC::RequestParser rp(ctx);
const CecCommand command = rp.PopEnum<CecCommand>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@@ -678,7 +678,7 @@ void Module::Interface::Stop(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::GetCecInfoBuffer(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0D, 2, 2);
IPC::RequestParser rp(ctx);
const u32 buffer_size = rp.Pop<u32>();
const u32 possible_info_type = rp.Pop<u32>();
auto& buffer = rp.PopMappedBuffer();
@@ -692,7 +692,7 @@ void Module::Interface::GetCecInfoBuffer(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::GetCecdState(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0E, 0, 0);
IPC::RequestParser rp(ctx);
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
rb.Push(RESULT_SUCCESS);
@@ -702,7 +702,7 @@ void Module::Interface::GetCecdState(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::GetCecInfoEventHandle(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0F, 0, 0);
IPC::RequestParser rp(ctx);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
rb.Push(RESULT_SUCCESS);
@@ -712,7 +712,7 @@ void Module::Interface::GetCecInfoEventHandle(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::GetChangeStateEventHandle(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x10, 0, 0);
IPC::RequestParser rp(ctx);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
rb.Push(RESULT_SUCCESS);
@@ -722,7 +722,7 @@ void Module::Interface::GetChangeStateEventHandle(Kernel::HLERequestContext& ctx
}
void Module::Interface::OpenAndWrite(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x11, 4, 4);
IPC::RequestParser rp(ctx);
const u32 buffer_size = rp.Pop<u32>();
const u32 ncch_program_id = rp.Pop<u32>();
const CecDataPathType path_type = rp.PopEnum<CecDataPathType>();
@@ -782,7 +782,7 @@ void Module::Interface::OpenAndWrite(Kernel::HLERequestContext& ctx) {
}
void Module::Interface::OpenAndRead(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x12, 4, 4);
IPC::RequestParser rp(ctx);
const u32 buffer_size = rp.Pop<u32>();
const u32 ncch_program_id = rp.Pop<u32>();
const CecDataPathType path_type = rp.PopEnum<CecDataPathType>();