hle: Rename RequestBuilder to ResponseBuilder.

This commit is contained in:
bunnei 2018-01-23 19:52:18 -05:00
parent f9dae99006
commit 1b1d399e5f
19 changed files with 129 additions and 128 deletions

View File

@ -54,18 +54,18 @@ public:
} }
}; };
class RequestBuilder : public RequestHelperBase { class ResponseBuilder : public RequestHelperBase {
public: public:
RequestBuilder(u32* command_buffer) : RequestHelperBase(command_buffer) {} ResponseBuilder(u32* command_buffer) : RequestHelperBase(command_buffer) {}
u32 normal_params_size; u32 normal_params_size;
u32 num_handles_to_copy; u32 num_handles_to_copy;
u32 num_objects_to_move; ///< Domain objects or move handles, context dependent u32 num_objects_to_move; ///< Domain objects or move handles, context dependent
std::ptrdiff_t datapayload_index; std::ptrdiff_t datapayload_index;
RequestBuilder(Kernel::HLERequestContext& context, u32 normal_params_size, ResponseBuilder(Kernel::HLERequestContext& context, u32 normal_params_size,
u32 num_handles_to_copy = 0, u32 num_objects_to_move = 0, u32 num_handles_to_copy = 0, u32 num_objects_to_move = 0,
bool always_move_handle = false) bool always_move_handles = false)
: RequestHelperBase(context), normal_params_size(normal_params_size), : RequestHelperBase(context), normal_params_size(normal_params_size),
num_handles_to_copy(num_handles_to_copy), num_objects_to_move(num_objects_to_move) { num_handles_to_copy(num_handles_to_copy), num_objects_to_move(num_objects_to_move) {
@ -83,7 +83,7 @@ public:
u32 num_handles_to_move{}; u32 num_handles_to_move{};
u32 num_domain_objects{}; u32 num_domain_objects{};
if (!context.Session()->IsDomain() || always_move_handle) { if (!context.Session()->IsDomain() || always_move_handles) {
num_handles_to_move = num_objects_to_move; num_handles_to_move = num_objects_to_move;
} else { } else {
num_domain_objects = num_objects_to_move; num_domain_objects = num_objects_to_move;
@ -154,7 +154,7 @@ public:
} }
// Validate on destruction, as there shouldn't be any case where we don't want it // Validate on destruction, as there shouldn't be any case where we don't want it
~RequestBuilder() { ~ResponseBuilder() {
ValidateHeader(); ValidateHeader();
} }
@ -182,52 +182,52 @@ public:
/// Push /// /// Push ///
template <> template <>
inline void RequestBuilder::Push(u32 value) { inline void ResponseBuilder::Push(u32 value) {
cmdbuf[index++] = value; cmdbuf[index++] = value;
} }
template <typename T> template <typename T>
void RequestBuilder::PushRaw(const T& value) { void ResponseBuilder::PushRaw(const T& value) {
std::memcpy(cmdbuf + index, &value, sizeof(T)); std::memcpy(cmdbuf + index, &value, sizeof(T));
index += (sizeof(T) + 3) / 4; // round up to word length index += (sizeof(T) + 3) / 4; // round up to word length
} }
template <> template <>
inline void RequestBuilder::Push(ResultCode value) { inline void ResponseBuilder::Push(ResultCode value) {
// Result codes are actually 64-bit in the IPC buffer, but only the high part is discarded. // Result codes are actually 64-bit in the IPC buffer, but only the high part is discarded.
Push(value.raw); Push(value.raw);
Push<u32>(0); Push<u32>(0);
} }
template <> template <>
inline void RequestBuilder::Push(u8 value) { inline void ResponseBuilder::Push(u8 value) {
PushRaw(value); PushRaw(value);
} }
template <> template <>
inline void RequestBuilder::Push(u16 value) { inline void ResponseBuilder::Push(u16 value) {
PushRaw(value); PushRaw(value);
} }
template <> template <>
inline void RequestBuilder::Push(u64 value) { inline void ResponseBuilder::Push(u64 value) {
Push(static_cast<u32>(value)); Push(static_cast<u32>(value));
Push(static_cast<u32>(value >> 32)); Push(static_cast<u32>(value >> 32));
} }
template <> template <>
inline void RequestBuilder::Push(bool value) { inline void ResponseBuilder::Push(bool value) {
Push(static_cast<u8>(value)); Push(static_cast<u8>(value));
} }
template <typename First, typename... Other> template <typename First, typename... Other>
void RequestBuilder::Push(const First& first_value, const Other&... other_values) { void ResponseBuilder::Push(const First& first_value, const Other&... other_values) {
Push(first_value); Push(first_value);
Push(other_values...); Push(other_values...);
} }
template <typename... O> template <typename... O>
inline void RequestBuilder::PushCopyObjects(Kernel::SharedPtr<O>... pointers) { inline void ResponseBuilder::PushCopyObjects(Kernel::SharedPtr<O>... pointers) {
auto objects = {pointers...}; auto objects = {pointers...};
for (auto& object : objects) { for (auto& object : objects) {
context->AddCopyObject(std::move(object)); context->AddCopyObject(std::move(object));
@ -235,7 +235,7 @@ inline void RequestBuilder::PushCopyObjects(Kernel::SharedPtr<O>... pointers) {
} }
template <typename... O> template <typename... O>
inline void RequestBuilder::PushMoveObjects(Kernel::SharedPtr<O>... pointers) { inline void ResponseBuilder::PushMoveObjects(Kernel::SharedPtr<O>... pointers) {
auto objects = {pointers...}; auto objects = {pointers...};
for (auto& object : objects) { for (auto& object : objects) {
context->AddMoveObject(std::move(object)); context->AddMoveObject(std::move(object));
@ -254,9 +254,10 @@ public:
Skip(CommandIdSize, false); Skip(CommandIdSize, false);
} }
RequestBuilder MakeBuilder(u32 normal_params_size, u32 num_handles_to_copy, ResponseBuilder MakeBuilder(u32 normal_params_size, u32 num_handles_to_copy,
u32 num_handles_to_move, bool validate_header = true) { u32 num_handles_to_move, bool always_move_handles = false) {
return {*context, normal_params_size, num_handles_to_copy, num_handles_to_move}; return {*context, normal_params_size, num_handles_to_copy, num_handles_to_move,
always_move_handles};
} }
template <typename T> template <typename T>

View File

@ -82,7 +82,7 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr<Thread> thread) {
domain_request_handlers[object_id - 1] = nullptr; domain_request_handlers[object_id - 1] = nullptr;
IPC::RequestBuilder rb{context, 2}; IPC::ResponseBuilder rb{context, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }

View File

@ -22,7 +22,7 @@ private:
void GetBase(Kernel::HLERequestContext& ctx) { void GetBase(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
ProfileBase profile_base{}; ProfileBase profile_base{};
IPC::RequestBuilder rb{ctx, 16}; IPC::ResponseBuilder rb{ctx, 16};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushRaw(profile_base); rb.PushRaw(profile_base);
} }
@ -40,7 +40,7 @@ public:
private: private:
void CheckAvailability(Kernel::HLERequestContext& ctx) { void CheckAvailability(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(true); // TODO: Check when this is supposed to return true and when not rb.Push(true); // TODO: Check when this is supposed to return true and when not
} }
@ -48,13 +48,13 @@ private:
void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) { void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(true); // TODO: Check when this is supposed to return true and when not rb.Push(true); // TODO: Check when this is supposed to return true and when not
} }
void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) { void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IProfile>(); rb.PushIpcInterface<IProfile>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
@ -62,12 +62,12 @@ void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) {
void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void ACC_U0::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) { void ACC_U0::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IManagerForApplication>(); rb.PushIpcInterface<IManagerForApplication>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");

View File

@ -25,14 +25,14 @@ public:
private: private:
void GetAppletResourceUserId(Kernel::HLERequestContext& ctx) { void GetAppletResourceUserId(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u64>(0); rb.Push<u64>(0);
} }
void AcquireForegroundRights(Kernel::HLERequestContext& ctx) { void AcquireForegroundRights(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
}; };
@ -86,14 +86,14 @@ private:
}; };
auto flags = rp.PopRaw<FocusHandlingModeParams>(); auto flags = rp.PopRaw<FocusHandlingModeParams>();
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
} }
void SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) { void SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
@ -104,7 +104,7 @@ private:
bool flag = rp.Pop<bool>(); bool flag = rp.Pop<bool>();
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called flag=%u", static_cast<u32>(flag)); LOG_WARNING(Service, "(STUBBED) called flag=%u", static_cast<u32>(flag));
@ -115,7 +115,7 @@ private:
bool flag = rp.Pop<bool>(); bool flag = rp.Pop<bool>();
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called flag=%u", static_cast<u32>(flag)); LOG_WARNING(Service, "(STUBBED) called flag=%u", static_cast<u32>(flag));
@ -128,21 +128,21 @@ private:
bool enabled = rp.Pop<bool>(); bool enabled = rp.Pop<bool>();
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called enabled=%u", static_cast<u32>(enabled)); LOG_WARNING(Service, "(STUBBED) called enabled=%u", static_cast<u32>(enabled));
} }
void LockExit(Kernel::HLERequestContext& ctx) { void LockExit(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
} }
void UnlockExit(Kernel::HLERequestContext& ctx) { void UnlockExit(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
@ -154,7 +154,7 @@ private:
u64 display_id = nvflinger->OpenDisplay("Default"); u64 display_id = nvflinger->OpenDisplay("Default");
u64 layer_id = nvflinger->CreateLayer(display_id); u64 layer_id = nvflinger->CreateLayer(display_id);
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(layer_id); rb.Push(layer_id);
@ -193,7 +193,7 @@ private:
void GetEventHandle(Kernel::HLERequestContext& ctx) { void GetEventHandle(Kernel::HLERequestContext& ctx) {
event->Signal(); event->Signal();
IPC::RequestBuilder rb{ctx, 2, 1}; IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(event); rb.PushCopyObjects(event);
@ -201,7 +201,7 @@ private:
} }
void ReceiveMessage(Kernel::HLERequestContext& ctx) { void ReceiveMessage(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(15); rb.Push<u32>(15);
@ -209,7 +209,7 @@ private:
} }
void GetCurrentFocusState(Kernel::HLERequestContext& ctx) { void GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u8>(FocusState::InFocus)); rb.Push(static_cast<u8>(FocusState::InFocus));
@ -217,7 +217,7 @@ private:
} }
void GetOperationMode(Kernel::HLERequestContext& ctx) { void GetOperationMode(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u8>(OperationMode::Handheld)); rb.Push(static_cast<u8>(OperationMode::Handheld));
@ -225,7 +225,7 @@ private:
} }
void GetPerformanceMode(Kernel::HLERequestContext& ctx) { void GetPerformanceMode(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u32>(APM::PerformanceMode::Handheld)); rb.Push(static_cast<u32>(APM::PerformanceMode::Handheld));
@ -250,7 +250,7 @@ private:
std::vector<u8> buffer; std::vector<u8> buffer;
void GetSize(Kernel::HLERequestContext& ctx) { void GetSize(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u64>(buffer.size())); rb.Push(static_cast<u64>(buffer.size()));
@ -269,7 +269,7 @@ private:
Memory::WriteBlock(output_buffer.Address(), buffer.data() + offset, output_buffer.Size()); Memory::WriteBlock(output_buffer.Address(), buffer.data() + offset, output_buffer.Size());
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -291,7 +291,7 @@ private:
std::vector<u8> buffer; std::vector<u8> buffer;
void Open(Kernel::HLERequestContext& ctx) { void Open(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<AM::IStorageAccessor>(buffer); rb.PushIpcInterface<AM::IStorageAccessor>(buffer);
@ -328,7 +328,7 @@ private:
std::vector<u8> buffer(data, data + sizeof(data)); std::vector<u8> buffer(data, data + sizeof(data));
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<AM::IStorage>(buffer); rb.PushIpcInterface<AM::IStorage>(buffer);
@ -343,34 +343,34 @@ private:
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u32 result = rp.Pop<u32>(); u32 result = rp.Pop<u32>();
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called, result=0x%08X", result); LOG_WARNING(Service, "(STUBBED) called, result=0x%08X", result);
} }
void GetDesiredLanguage(Kernel::HLERequestContext& ctx) { void GetDesiredLanguage(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u64>(SystemLanguage::English); rb.Push<u64>(SystemLanguage::English);
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
} }
void InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) { void InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
} }
void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) { void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
} }
void NotifyRunning(Kernel::HLERequestContext& ctx) { void NotifyRunning(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u8>(0); // Unknown, seems to be ignored by official processes rb.Push<u8>(0); // Unknown, seems to be ignored by official processes
@ -402,56 +402,56 @@ public:
private: private:
void GetAudioController(Kernel::HLERequestContext& ctx) { void GetAudioController(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IAudioController>(); rb.PushIpcInterface<IAudioController>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void GetDisplayController(Kernel::HLERequestContext& ctx) { void GetDisplayController(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IDisplayController>(); rb.PushIpcInterface<IDisplayController>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void GetDebugFunctions(Kernel::HLERequestContext& ctx) { void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IDebugFunctions>(); rb.PushIpcInterface<IDebugFunctions>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void GetWindowController(Kernel::HLERequestContext& ctx) { void GetWindowController(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IWindowController>(); rb.PushIpcInterface<IWindowController>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void GetSelfController(Kernel::HLERequestContext& ctx) { void GetSelfController(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ISelfController>(nvflinger); rb.PushIpcInterface<ISelfController>(nvflinger);
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void GetCommonStateGetter(Kernel::HLERequestContext& ctx) { void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ICommonStateGetter>(); rb.PushIpcInterface<ICommonStateGetter>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) { void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ILibraryAppletCreator>(); rb.PushIpcInterface<ILibraryAppletCreator>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void GetApplicationFunctions(Kernel::HLERequestContext& ctx) { void GetApplicationFunctions(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IApplicationFunctions>(); rb.PushIpcInterface<IApplicationFunctions>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
@ -461,7 +461,7 @@ private:
}; };
void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) { void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IApplicationProxy>(nvflinger); rb.PushIpcInterface<IApplicationProxy>(nvflinger);
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");

View File

@ -30,7 +30,7 @@ private:
auto mode = static_cast<PerformanceMode>(rp.Pop<u32>()); auto mode = static_cast<PerformanceMode>(rp.Pop<u32>());
u32 config = rp.Pop<u32>(); u32 config = rp.Pop<u32>();
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called mode=%u config=%u", static_cast<u32>(mode), config); LOG_WARNING(Service, "(STUBBED) called mode=%u config=%u", static_cast<u32>(mode), config);
@ -41,7 +41,7 @@ private:
auto mode = static_cast<PerformanceMode>(rp.Pop<u32>()); auto mode = static_cast<PerformanceMode>(rp.Pop<u32>());
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // Performance configuration rb.Push<u32>(0); // Performance configuration
@ -58,7 +58,7 @@ APM::APM() : ServiceFramework("apm") {
} }
void APM::OpenSession(Kernel::HLERequestContext& ctx) { void APM::OpenSession(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ISession>(); rb.PushIpcInterface<ISession>();
} }

View File

@ -61,7 +61,7 @@ private:
// start audio // start audio
audio_out_state = Started; audio_out_state = Started;
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -73,14 +73,14 @@ private:
queue_keys.clear(); queue_keys.clear();
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void RegisterBufferEvent(Kernel::HLERequestContext& ctx) { void RegisterBufferEvent(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_Audio, "(STUBBED) called"); LOG_WARNING(Service_Audio, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2, 1}; IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(buffer_event); rb.PushCopyObjects(buffer_event);
} }
@ -93,7 +93,7 @@ private:
queue_keys.insert(queue_keys.begin(), key); queue_keys.insert(queue_keys.begin(), key);
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -116,7 +116,7 @@ private:
Memory::WriteBlock(buffer.Address(), &key, sizeof(u64)); Memory::WriteBlock(buffer.Address(), &key, sizeof(u64));
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
// TODO(st4rk): This might be the total of released buffers, needs to be verified on // TODO(st4rk): This might be the total of released buffers, needs to be verified on
// hardware // hardware
@ -166,7 +166,7 @@ void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) {
Memory::WriteBlock(buffer.Address(), &audio_interface[0], audio_interface.size()); Memory::WriteBlock(buffer.Address(), &audio_interface[0], audio_interface.size());
IPC::RequestBuilder rb = rp.MakeBuilder(3, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
// TODO(st4rk): we're currently returning only one audio interface // TODO(st4rk): we're currently returning only one audio interface
@ -189,7 +189,7 @@ void AudOutU::OpenAudioOut(Kernel::HLERequestContext& ctx) {
auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions); auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
audio_out_interface->ClientConnected(server); audio_out_interface->ClientConnected(server);
LOG_DEBUG(Service, "called, initialized IAudioOut -> session=%u", client->GetObjectId()); LOG_DEBUG(Service, "called, initialized IAudioOut -> session=%u", client->GetObjectId());
IPC::RequestBuilder rb{ctx, 6, 0, 1}; IPC::ResponseBuilder rb{ctx, 6, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(sample_rate); rb.Push<u32>(sample_rate);

View File

@ -40,12 +40,12 @@ private:
// Error checking // Error checking
ASSERT_MSG(length == descriptor.Size(), "unexpected size difference"); ASSERT_MSG(length == descriptor.Size(), "unexpected size difference");
if (length < 0) { if (length < 0) {
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidLength)); rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidLength));
return; return;
} }
if (offset < 0) { if (offset < 0) {
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidOffset)); rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidOffset));
return; return;
} }
@ -54,7 +54,7 @@ private:
std::vector<u8> output(length); std::vector<u8> output(length);
ResultVal<size_t> res = backend->Read(offset, length, output.data()); ResultVal<size_t> res = backend->Read(offset, length, output.data());
if (res.Failed()) { if (res.Failed()) {
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(res.Code()); rb.Push(res.Code());
return; return;
} }
@ -62,7 +62,7 @@ private:
// Write the data to memory // Write the data to memory
Memory::WriteBlock(descriptor.Address(), output.data(), descriptor.Size()); Memory::WriteBlock(descriptor.Address(), output.data(), descriptor.Size());
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
}; };
@ -91,14 +91,14 @@ void FSP_SRV::TryLoadRomFS() {
void FSP_SRV::Initalize(Kernel::HLERequestContext& ctx) { void FSP_SRV::Initalize(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_FS, "(STUBBED) called"); LOG_WARNING(Service_FS, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_FS, "(STUBBED) called"); LOG_WARNING(Service_FS, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(5); rb.Push<u32>(5);
} }
@ -110,7 +110,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
if (!romfs) { if (!romfs) {
// TODO (bunnei): Find the right error code to use here // TODO (bunnei): Find the right error code to use here
LOG_CRITICAL(Service_FS, "no file system interface available!"); LOG_CRITICAL(Service_FS, "no file system interface available!");
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultCode(-1)); rb.Push(ResultCode(-1));
return; return;
} }
@ -119,12 +119,12 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
auto storage = romfs->OpenFile({}, {}); auto storage = romfs->OpenFile({}, {});
if (storage.Failed()) { if (storage.Failed()) {
LOG_CRITICAL(Service_FS, "no storage interface available!"); LOG_CRITICAL(Service_FS, "no storage interface available!");
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(storage.Code()); rb.Push(storage.Code());
return; return;
} }
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IStorage>(std::move(storage.Unwrap())); rb.PushIpcInterface<IStorage>(std::move(storage.Unwrap()));
} }

View File

@ -46,7 +46,7 @@ public:
private: private:
void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) { void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 1}; IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(shared_mem); rb.PushCopyObjects(shared_mem);
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
@ -169,7 +169,7 @@ private:
applet_resource = std::make_shared<IAppletResource>(); applet_resource = std::make_shared<IAppletResource>();
} }
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IAppletResource>(applet_resource); rb.PushIpcInterface<IAppletResource>(applet_resource);
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");

View File

@ -65,7 +65,7 @@ private:
*/ */
void Log(Kernel::HLERequestContext& ctx) { void Log(Kernel::HLERequestContext& ctx) {
// This function only succeeds - Get that out of the way // This function only succeeds - Get that out of the way
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
// Read MessageHeader, despite not doing anything with it right now // Read MessageHeader, despite not doing anything with it right now
@ -146,7 +146,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
* 0: ResultCode * 0: ResultCode
*/ */
void LM::Initialize(Kernel::HLERequestContext& ctx) { void LM::Initialize(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<Logger>(); rb.PushIpcInterface<Logger>();

View File

@ -18,7 +18,7 @@ void NVDRV::Open(Kernel::HLERequestContext& ctx) {
std::string device_name = Memory::ReadCString(buffer.Address(), buffer.Size()); std::string device_name = Memory::ReadCString(buffer.Address(), buffer.Size());
u32 fd = nvdrv->Open(device_name); u32 fd = nvdrv->Open(device_name);
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(fd); rb.Push<u32>(fd);
rb.Push<u32>(0); rb.Push<u32>(0);
@ -43,7 +43,7 @@ void NVDRV::Ioctl(Kernel::HLERequestContext& ctx) {
Memory::WriteBlock(output_buffer.Address(), output.data(), output_buffer.Size()); Memory::WriteBlock(output_buffer.Address(), output.data(), output_buffer.Size());
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(nv_result); rb.Push(nv_result);
} }
@ -56,13 +56,13 @@ void NVDRV::Close(Kernel::HLERequestContext& ctx) {
auto result = nvdrv->Close(fd); auto result = nvdrv->Close(fd);
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(result); rb.Push(result);
} }
void NVDRV::Initialize(Kernel::HLERequestContext& ctx) { void NVDRV::Initialize(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); rb.Push<u32>(0);
} }
@ -72,7 +72,7 @@ void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) {
pid = rp.Pop<u64>(); pid = rp.Pop<u64>();
LOG_INFO(Service, "called, pid=0x%lx", pid); LOG_INFO(Service, "called, pid=0x%lx", pid);
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); rb.Push<u32>(0);
} }

View File

@ -15,7 +15,7 @@ public:
}; };
void PCTL_A::GetService(Kernel::HLERequestContext& ctx) { void PCTL_A::GetService(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IParentalControlService>(); rb.PushIpcInterface<IParentalControlService>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");

View File

@ -132,7 +132,7 @@ void ServiceFrameworkBase::InvokeRequest(Kernel::HLERequestContext& ctx) {
ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& context) { ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& context) {
switch (context.GetCommandType()) { switch (context.GetCommandType()) {
case IPC::CommandType::Close: { case IPC::CommandType::Close: {
IPC::RequestBuilder rb{context, 2}; IPC::ResponseBuilder rb{context, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
return ResultCode(ErrorModule::HIPC, ErrorDescription::RemoteProcessDead); return ResultCode(ErrorModule::HIPC, ErrorDescription::RemoteProcessDead);
} }

View File

@ -19,7 +19,7 @@ void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) {
Memory::WriteBlock(output_buffer.Address(), lang_codes.data(), lang_codes.size()); Memory::WriteBlock(output_buffer.Address(), lang_codes.data(), lang_codes.size());
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u64>(lang_codes.size())); rb.Push(static_cast<u64>(lang_codes.size()));

View File

@ -13,7 +13,7 @@ void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) {
ASSERT_MSG(!ctx.Session()->IsDomain(), "session is alread a domain"); ASSERT_MSG(!ctx.Session()->IsDomain(), "session is alread a domain");
ctx.Session()->ConvertToDomain(); ctx.Session()->ConvertToDomain();
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(1); // Converted sessions start with 1 request handler rb.Push<u32>(1); // Converted sessions start with 1 request handler
@ -21,7 +21,7 @@ void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) {
} }
void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1, true}; IPC::ResponseBuilder rb{ctx, 2, 0, 1, true};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushMoveObjects(ctx.Session()); rb.PushMoveObjects(ctx.Session());
@ -35,7 +35,7 @@ void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) {
} }
void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0x500); rb.Push<u32>(0x500);

View File

@ -83,7 +83,7 @@ std::shared_ptr<ServiceManager> g_service_manager;
* 0: ResultCode * 0: ResultCode
*/ */
void SM::Initialize(Kernel::HLERequestContext& ctx) { void SM::Initialize(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_SM, "called"); LOG_DEBUG(Service_SM, "called");
} }
@ -99,7 +99,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
auto client_port = service_manager->GetServicePort(name); auto client_port = service_manager->GetServicePort(name);
if (client_port.Failed()) { if (client_port.Failed()) {
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(client_port.Code()); rb.Push(client_port.Code());
LOG_ERROR(Service_SM, "called service=%s -> error 0x%08X", name.c_str(), LOG_ERROR(Service_SM, "called service=%s -> error 0x%08X", name.c_str(),
client_port.Code().raw); client_port.Code().raw);
@ -112,7 +112,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
if (session.Succeeded()) { if (session.Succeeded()) {
LOG_DEBUG(Service_SM, "called service=%s -> session=%u", name.c_str(), LOG_DEBUG(Service_SM, "called service=%s -> session=%u", name.c_str(),
(*session)->GetObjectId()); (*session)->GetObjectId());
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 1, true); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 1, true);
rb.Push(session.Code()); rb.Push(session.Code());
rb.PushMoveObjects(std::move(session).Unwrap()); rb.PushMoveObjects(std::move(session).Unwrap());
} }

View File

@ -11,7 +11,7 @@ namespace Sockets {
void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) { void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // bsd errno rb.Push<u32>(0); // bsd errno
@ -28,7 +28,7 @@ void BSD_U::Socket(Kernel::HLERequestContext& ctx) {
u32 fd = next_fd++; u32 fd = next_fd++;
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(fd); rb.Push<u32>(fd);
@ -38,7 +38,7 @@ void BSD_U::Socket(Kernel::HLERequestContext& ctx) {
void BSD_U::Connect(Kernel::HLERequestContext& ctx) { void BSD_U::Connect(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // ret rb.Push<u32>(0); // ret
@ -48,7 +48,7 @@ void BSD_U::Connect(Kernel::HLERequestContext& ctx) {
void BSD_U::SendTo(Kernel::HLERequestContext& ctx) { void BSD_U::SendTo(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // ret rb.Push<u32>(0); // ret

View File

@ -28,7 +28,7 @@ private:
const s64 time_since_epoch{std::chrono::duration_cast<std::chrono::seconds>( const s64 time_since_epoch{std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::system_clock::now().time_since_epoch()) std::chrono::system_clock::now().time_since_epoch())
.count()}; .count()};
IPC::RequestBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u64>(time_since_epoch); rb.Push<u64>(time_since_epoch);
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
@ -55,14 +55,14 @@ private:
void GetDeviceLocationName(Kernel::HLERequestContext& ctx) { void GetDeviceLocationName(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
LocationName location_name{}; LocationName location_name{};
IPC::RequestBuilder rb{ctx, (sizeof(LocationName) / 4) + 2}; IPC::ResponseBuilder rb{ctx, (sizeof(LocationName) / 4) + 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushRaw(location_name); rb.PushRaw(location_name);
} }
void GetTotalLocationNameCount(Kernel::HLERequestContext& ctx) { void GetTotalLocationNameCount(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); rb.Push<u32>(0);
} }
@ -75,7 +75,7 @@ private:
CalendarTime calendar_time{2018, 1, 1, 0, 0, 0}; CalendarTime calendar_time{2018, 1, 1, 0, 0, 0};
CalendarAdditionalInfo additional_info{}; CalendarAdditionalInfo additional_info{};
IPC::RequestBuilder rb{ctx, 10}; IPC::ResponseBuilder rb{ctx, 10};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushRaw(calendar_time); rb.PushRaw(calendar_time);
rb.PushRaw(additional_info); rb.PushRaw(additional_info);
@ -83,28 +83,28 @@ private:
}; };
void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) { void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ISystemClock>(); rb.PushIpcInterface<ISystemClock>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ISystemClock>(); rb.PushIpcInterface<ISystemClock>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ISteadyClock>(); rb.PushIpcInterface<ISteadyClock>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");
} }
void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ITimeZoneService>(); rb.PushIpcInterface<ITimeZoneService>();
LOG_DEBUG(Service, "called"); LOG_DEBUG(Service, "called");

View File

@ -486,7 +486,7 @@ private:
} }
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -497,7 +497,7 @@ private:
u32 type = rp.Pop<u32>(); u32 type = rp.Pop<u32>();
LOG_WARNING(Service, "(STUBBED) called id=%u, addval=%08X, type=%08X", id, addval, type); LOG_WARNING(Service, "(STUBBED) called id=%u, addval=%08X, type=%08X", id, addval, type);
IPC::RequestBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -511,7 +511,7 @@ private:
// TODO(Subv): Find out what this actually is. // TODO(Subv): Find out what this actually is.
LOG_WARNING(Service, "(STUBBED) called id=%u, unknown=%08X", id, unknown); LOG_WARNING(Service, "(STUBBED) called id=%u, unknown=%08X", id, unknown);
IPC::RequestBuilder rb{ctx, 2, 1}; IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(buffer_queue->GetNativeHandle()); rb.PushCopyObjects(buffer_queue->GetNativeHandle());
} }
@ -537,7 +537,7 @@ private:
u64 layer_id = rp.Pop<u64>(); u64 layer_id = rp.Pop<u64>();
u64 z_value = rp.Pop<u64>(); u64 z_value = rp.Pop<u64>();
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
}; };
@ -562,7 +562,7 @@ private:
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u64 display = rp.Pop<u64>(); u64 display = rp.Pop<u64>();
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -576,7 +576,7 @@ private:
u64 layer_id = nv_flinger->CreateLayer(display); u64 layer_id = nv_flinger->CreateLayer(display);
IPC::RequestBuilder rb = rp.MakeBuilder(4, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(layer_id); rb.Push(layer_id);
} }
@ -587,7 +587,7 @@ private:
u32 stack = rp.Pop<u32>(); u32 stack = rp.Pop<u32>();
u64 layer_id = rp.Pop<u64>(); u64 layer_id = rp.Pop<u64>();
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -597,7 +597,7 @@ private:
void IApplicationDisplayService::GetRelayService(Kernel::HLERequestContext& ctx) { void IApplicationDisplayService::GetRelayService(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IHOSBinderDriver>(nv_flinger); rb.PushIpcInterface<IHOSBinderDriver>(nv_flinger);
} }
@ -605,7 +605,7 @@ void IApplicationDisplayService::GetRelayService(Kernel::HLERequestContext& ctx)
void IApplicationDisplayService::GetSystemDisplayService(Kernel::HLERequestContext& ctx) { void IApplicationDisplayService::GetSystemDisplayService(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ISystemDisplayService>(); rb.PushIpcInterface<ISystemDisplayService>();
} }
@ -613,7 +613,7 @@ void IApplicationDisplayService::GetSystemDisplayService(Kernel::HLERequestConte
void IApplicationDisplayService::GetManagerDisplayService(Kernel::HLERequestContext& ctx) { void IApplicationDisplayService::GetManagerDisplayService(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IManagerDisplayService>(nv_flinger); rb.PushIpcInterface<IManagerDisplayService>(nv_flinger);
} }
@ -622,7 +622,7 @@ void IApplicationDisplayService::GetIndirectDisplayTransactionService(
Kernel::HLERequestContext& ctx) { Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IHOSBinderDriver>(nv_flinger); rb.PushIpcInterface<IHOSBinderDriver>(nv_flinger);
} }
@ -637,7 +637,7 @@ void IApplicationDisplayService::OpenDisplay(Kernel::HLERequestContext& ctx) {
ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet"); ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet");
IPC::RequestBuilder rb = rp.MakeBuilder(4, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u64>(nv_flinger->OpenDisplay(name)); rb.Push<u64>(nv_flinger->OpenDisplay(name));
} }
@ -647,7 +647,7 @@ void IApplicationDisplayService::CloseDisplay(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u64 display_id = rp.Pop<u64>(); u64 display_id = rp.Pop<u64>();
IPC::RequestBuilder rb = rp.MakeBuilder(4, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -671,7 +671,7 @@ void IApplicationDisplayService::OpenLayer(Kernel::HLERequestContext& ctx) {
auto data = native_window.Serialize(); auto data = native_window.Serialize();
Memory::WriteBlock(buffer.Address(), data.data(), data.size()); Memory::WriteBlock(buffer.Address(), data.data(), data.size());
IPC::RequestBuilder rb = rp.MakeBuilder(4, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u64>(data.size()); rb.Push<u64>(data.size());
} }
@ -694,7 +694,7 @@ void IApplicationDisplayService::CreateStrayLayer(Kernel::HLERequestContext& ctx
auto data = native_window.Serialize(); auto data = native_window.Serialize();
Memory::WriteBlock(buffer.Address(), data.data(), data.size()); Memory::WriteBlock(buffer.Address(), data.data(), data.size());
IPC::RequestBuilder rb = rp.MakeBuilder(6, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(6, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(layer_id); rb.Push(layer_id);
rb.Push<u64>(data.size()); rb.Push<u64>(data.size());
@ -706,7 +706,7 @@ void IApplicationDisplayService::DestroyStrayLayer(Kernel::HLERequestContext& ct
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u64 layer_id = rp.Pop<u64>(); u64 layer_id = rp.Pop<u64>();
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -716,7 +716,7 @@ void IApplicationDisplayService::SetLayerScalingMode(Kernel::HLERequestContext&
u32 scaling_mode = rp.Pop<u32>(); u32 scaling_mode = rp.Pop<u32>();
u64 unknown = rp.Pop<u64>(); u64 unknown = rp.Pop<u64>();
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -727,7 +727,7 @@ void IApplicationDisplayService::GetDisplayVsyncEvent(Kernel::HLERequestContext&
auto vsync_event = nv_flinger->GetVsyncEvent(display_id); auto vsync_event = nv_flinger->GetVsyncEvent(display_id);
IPC::RequestBuilder rb = rp.MakeBuilder(2, 1, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 1, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(vsync_event); rb.PushCopyObjects(vsync_event);
} }

View File

@ -13,7 +13,7 @@ namespace VI {
void VI_M::GetDisplayService(Kernel::HLERequestContext& ctx) { void VI_M::GetDisplayService(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called"); LOG_WARNING(Service, "(STUBBED) called");
IPC::RequestBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IApplicationDisplayService>(nv_flinger); rb.PushIpcInterface<IApplicationDisplayService>(nv_flinger);
} }