summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-01-25 05:09:03 +0100
committerGitHub <noreply@github.com>2018-01-25 05:09:03 +0100
commit748c0de539674dc8ca4a5a8aadd2a61b0eabe652 (patch)
treeae56efe8654d3aa3a5e75ec04bd9dfdcc06023a9 /src/core/hle/service
parentaudout:u OpenAudioOut and IAudioOut (#138) (diff)
parentaudout_u: Various cleanups. (diff)
downloadyuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar
yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.gz
yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.bz2
yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.lz
yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.xz
yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.zst
yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/acc/acc_u0.cpp12
-rw-r--r--src/core/hle/service/am/applet_oe.cpp66
-rw-r--r--src/core/hle/service/apm/apm.cpp6
-rw-r--r--src/core/hle/service/audio/audout_u.cpp60
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp18
-rw-r--r--src/core/hle/service/hid/hid.cpp17
-rw-r--r--src/core/hle/service/lm/lm.cpp20
-rw-r--r--src/core/hle/service/nvdrv/interface.cpp10
-rw-r--r--src/core/hle/service/pctl/pctl_a.cpp2
-rw-r--r--src/core/hle/service/service.cpp2
-rw-r--r--src/core/hle/service/set/set.cpp2
-rw-r--r--src/core/hle/service/sm/controller.cpp20
-rw-r--r--src/core/hle/service/sm/sm.cpp7
-rw-r--r--src/core/hle/service/sockets/bsd_u.cpp8
-rw-r--r--src/core/hle/service/time/time.cpp61
-rw-r--r--src/core/hle/service/time/time.h7
-rw-r--r--src/core/hle/service/vi/vi.cpp36
-rw-r--r--src/core/hle/service/vi/vi_m.cpp3
18 files changed, 159 insertions, 198 deletions
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp
index 7f0192fd3..67f05aad4 100644
--- a/src/core/hle/service/acc/acc_u0.cpp
+++ b/src/core/hle/service/acc/acc_u0.cpp
@@ -22,7 +22,7 @@ private:
void GetBase(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
ProfileBase profile_base{};
- IPC::RequestBuilder rb{ctx, 16};
+ IPC::ResponseBuilder rb{ctx, 16};
rb.Push(RESULT_SUCCESS);
rb.PushRaw(profile_base);
}
@@ -40,7 +40,7 @@ public:
private:
void CheckAvailability(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
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) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push(true); // TODO: Check when this is supposed to return true and when not
}
void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IProfile>();
LOG_DEBUG(Service, "called");
@@ -62,12 +62,12 @@ void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) {
void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
void ACC_U0::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IManagerForApplication>();
LOG_DEBUG(Service, "called");
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
index 7d16b45f3..15b7701e0 100644
--- a/src/core/hle/service/am/applet_oe.cpp
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -25,14 +25,14 @@ public:
private:
void GetAppletResourceUserId(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 4};
+ IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push<u64>(0);
}
void AcquireForegroundRights(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
};
@@ -86,14 +86,14 @@ private:
};
auto flags = rp.PopRaw<FocusHandlingModeParams>();
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called");
}
void SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called");
@@ -104,7 +104,7 @@ private:
bool flag = rp.Pop<bool>();
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called flag=%u", static_cast<u32>(flag));
@@ -115,7 +115,7 @@ private:
bool flag = rp.Pop<bool>();
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called flag=%u", static_cast<u32>(flag));
@@ -128,21 +128,21 @@ private:
bool enabled = rp.Pop<bool>();
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called enabled=%u", static_cast<u32>(enabled));
}
void LockExit(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called");
}
void UnlockExit(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called");
@@ -154,7 +154,7 @@ private:
u64 display_id = nvflinger->OpenDisplay("Default");
u64 layer_id = nvflinger->CreateLayer(display_id);
- IPC::RequestBuilder rb{ctx, 4};
+ IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push(layer_id);
@@ -193,7 +193,7 @@ private:
void GetEventHandle(Kernel::HLERequestContext& ctx) {
event->Signal();
- IPC::RequestBuilder rb{ctx, 2, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(event);
@@ -201,7 +201,7 @@ private:
}
void ReceiveMessage(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(15);
@@ -209,7 +209,7 @@ private:
}
void GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u8>(FocusState::InFocus));
@@ -217,7 +217,7 @@ private:
}
void GetOperationMode(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u8>(OperationMode::Handheld));
@@ -225,7 +225,7 @@ private:
}
void GetPerformanceMode(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u32>(APM::PerformanceMode::Handheld));
@@ -250,7 +250,7 @@ private:
std::vector<u8> buffer;
void GetSize(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 4};
+ IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u64>(buffer.size()));
@@ -269,7 +269,7 @@ private:
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);
@@ -291,7 +291,7 @@ private:
std::vector<u8> buffer;
void Open(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<AM::IStorageAccessor>(buffer);
@@ -328,7 +328,7 @@ private:
std::vector<u8> buffer(data, data + sizeof(data));
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<AM::IStorage>(buffer);
@@ -343,34 +343,34 @@ private:
IPC::RequestParser rp{ctx};
u32 result = rp.Pop<u32>();
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called, result=0x%08X", result);
}
void GetDesiredLanguage(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 4};
+ IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push<u64>(SystemLanguage::English);
LOG_WARNING(Service, "(STUBBED) called");
}
void InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called");
}
void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service, "(STUBBED) called");
}
void NotifyRunning(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u8>(0); // Unknown, seems to be ignored by official processes
@@ -402,56 +402,56 @@ public:
private:
void GetAudioController(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IAudioController>();
LOG_DEBUG(Service, "called");
}
void GetDisplayController(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IDisplayController>();
LOG_DEBUG(Service, "called");
}
void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IDebugFunctions>();
LOG_DEBUG(Service, "called");
}
void GetWindowController(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IWindowController>();
LOG_DEBUG(Service, "called");
}
void GetSelfController(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ISelfController>(nvflinger);
LOG_DEBUG(Service, "called");
}
void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ICommonStateGetter>();
LOG_DEBUG(Service, "called");
}
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ILibraryAppletCreator>();
LOG_DEBUG(Service, "called");
}
void GetApplicationFunctions(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IApplicationFunctions>();
LOG_DEBUG(Service, "called");
@@ -461,7 +461,7 @@ private:
};
void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IApplicationProxy>(nvflinger);
LOG_DEBUG(Service, "called");
diff --git a/src/core/hle/service/apm/apm.cpp b/src/core/hle/service/apm/apm.cpp
index bf7e12288..c4b1723c5 100644
--- a/src/core/hle/service/apm/apm.cpp
+++ b/src/core/hle/service/apm/apm.cpp
@@ -30,7 +30,7 @@ private:
auto mode = static_cast<PerformanceMode>(rp.Pop<u32>());
u32 config = rp.Pop<u32>();
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
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>());
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // Performance configuration
@@ -58,7 +58,7 @@ APM::APM() : ServiceFramework("apm") {
}
void APM::OpenSession(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ISession>();
}
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index df04d636e..f56ba2ea1 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -23,7 +23,7 @@ constexpr u64 audio_ticks{static_cast<u64>(BASE_CLOCK_RATE / 500)};
class IAudioOut final : public ServiceFramework<IAudioOut> {
public:
- IAudioOut() : ServiceFramework("IAudioOut"), audio_out_state(Stopped) {
+ IAudioOut() : ServiceFramework("IAudioOut"), audio_out_state(AudioState::Stopped) {
static const FunctionInfo functions[] = {
{0x0, nullptr, "GetAudioOutState"},
{0x1, &IAudioOut::StartAudioOut, "StartAudioOut"},
@@ -58,29 +58,29 @@ private:
void StartAudioOut(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_Audio, "(STUBBED) called");
- // start audio
- audio_out_state = Started;
+ // Start audio
+ audio_out_state = AudioState::Started;
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
void StopAudioOut(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_Audio, "(STUBBED) called");
- // stop audio
- audio_out_state = Stopped;
+ // Stop audio
+ audio_out_state = AudioState::Stopped;
queue_keys.clear();
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
void RegisterBufferEvent(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_Audio, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(buffer_event);
}
@@ -89,11 +89,10 @@ private:
LOG_WARNING(Service_Audio, "(STUBBED) called");
IPC::RequestParser rp{ctx};
- u64 key = rp.Pop<u64>();
-
+ const u64 key{rp.Pop<u64>()};
queue_keys.insert(queue_keys.begin(), key);
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
@@ -102,11 +101,10 @@ private:
const auto& buffer = ctx.BufferDescriptorB()[0];
- // TODO(st4rk): this is how libtransistor currently implements the
- // GetReleasedAudioOutBuffer, it should return the key (a VAddr) to the APP and this address
+ // TODO(st4rk): This is how libtransistor currently implements the
+ // GetReleasedAudioOutBuffer, it should return the key (a VAddr) to the app and this address
// is used to know which buffer should be filled with data and send again to the service
// through AppendAudioOutBuffer. Check if this is the proper way to do it.
-
u64 key{0};
if (queue_keys.size()) {
@@ -116,7 +114,7 @@ private:
Memory::WriteBlock(buffer.Address(), &key, sizeof(u64));
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
// TODO(st4rk): This might be the total of released buffers, needs to be verified on
// hardware
@@ -124,8 +122,7 @@ private:
}
void UpdateAudioBuffersCallback() {
-
- if (audio_out_state != Started) {
+ if (audio_out_state != AudioState::Started) {
return;
}
@@ -136,7 +133,7 @@ private:
buffer_event->Signal();
}
- enum AudioState : u32 {
+ enum class AudioState : u32 {
Started,
Stopped,
};
@@ -148,10 +145,10 @@ private:
/// This is the evend handle used to check if the audio buffer was released
Kernel::SharedPtr<Kernel::Event> buffer_event;
- /// (st4rk): this is just a temporary workaround for the future implementation. Libtransistor
+ /// (st4rk): This is just a temporary workaround for the future implementation. Libtransistor
/// uses the key as an address in the App, so we need to return when the
/// GetReleasedAudioOutBuffer_1 is called, otherwise we'll run in problems, because
- /// libtransistor uses the key returned as an pointer;
+ /// libtransistor uses the key returned as an pointer.
std::vector<u64> queue_keys;
AudioState audio_out_state;
@@ -166,14 +163,12 @@ void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) {
Memory::WriteBlock(buffer.Address(), &audio_interface[0], audio_interface.size());
- IPC::RequestBuilder rb = rp.MakeBuilder(3, 0, 0, 0);
+ IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0);
rb.Push(RESULT_SUCCESS);
- // TODO(st4rk): we're currently returning only one audio interface
- // (stringlist size)
- // however, it's highly possible to have more than one interface (despite that
- // libtransistor
- // requires only one).
+ // TODO(st4rk): We're currently returning only one audio interface (stringlist size). However,
+ // it's highly possible to have more than one interface (despite that libtransistor requires
+ // only one).
rb.Push<u32>(1);
}
@@ -184,20 +179,13 @@ void AudOutU::OpenAudioOut(Kernel::HLERequestContext& ctx) {
audio_out_interface = std::make_shared<IAudioOut>();
}
- auto sessions = Kernel::ServerSession::CreateSessionPair(audio_out_interface->GetServiceName());
- auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
- auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
- audio_out_interface->ClientConnected(server);
- 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<u32>(sample_rate);
rb.Push<u32>(audio_channels);
rb.Push<u32>(static_cast<u32>(PcmFormat::Int16));
- // this field is unknown
- rb.Push<u32>(0);
- rb.PushMoveObjects(std::move(client));
+ rb.Push<u32>(0); // This field is unknown
+ rb.PushIpcInterface<Audio::IAudioOut>(audio_out_interface);
}
AudOutU::AudOutU() : ServiceFramework("audout:u") {
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index ef1915e5a..71b82393e 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -40,12 +40,12 @@ private:
// Error checking
ASSERT_MSG(length == descriptor.Size(), "unexpected size difference");
if (length < 0) {
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidLength));
return;
}
if (offset < 0) {
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidOffset));
return;
}
@@ -54,7 +54,7 @@ private:
std::vector<u8> output(length);
ResultVal<size_t> res = backend->Read(offset, length, output.data());
if (res.Failed()) {
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(res.Code());
return;
}
@@ -62,7 +62,7 @@ private:
// Write the data to memory
Memory::WriteBlock(descriptor.Address(), output.data(), descriptor.Size());
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
};
@@ -91,14 +91,14 @@ void FSP_SRV::TryLoadRomFS() {
void FSP_SRV::Initalize(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_FS, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_FS, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 4};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(5);
}
@@ -110,7 +110,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
if (!romfs) {
// TODO (bunnei): Find the right error code to use here
LOG_CRITICAL(Service_FS, "no file system interface available!");
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultCode(-1));
return;
}
@@ -119,12 +119,12 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
auto storage = romfs->OpenFile({}, {});
if (storage.Failed()) {
LOG_CRITICAL(Service_FS, "no storage interface available!");
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(storage.Code());
return;
}
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IStorage>(std::move(storage.Unwrap()));
}
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index ae60cc7b4..326e0a4ab 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -46,7 +46,7 @@ public:
private:
void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(shared_mem);
LOG_DEBUG(Service, "called");
@@ -169,19 +169,10 @@ private:
applet_resource = std::make_shared<IAppletResource>();
}
- // TODO(Subv): Verify if this should return the interface as a domain object when called
- // from within a domain.
-
- auto sessions = Kernel::ServerSession::CreateSessionPair(applet_resource->GetServiceName());
- auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
- auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
- applet_resource->ClientConnected(server);
-
- LOG_DEBUG(Service, "called, initialized IAppletResource -> session=%u",
- client->GetObjectId());
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushMoveObjects(std::move(client));
+ rb.PushIpcInterface<IAppletResource>(applet_resource);
+ LOG_DEBUG(Service, "called");
}
};
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index b505cdcaf..2843e0e40 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -65,7 +65,7 @@ private:
*/
void Log(Kernel::HLERequestContext& ctx) {
// This function only succeeds - Get that out of the way
- IPC::RequestBuilder rb{ctx, 1};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
// Read MessageHeader, despite not doing anything with it right now
@@ -130,7 +130,7 @@ private:
}
output += message;
- LOG_DEBUG(Debug_Emulated, "%s", output.c_str());
+ LOG_INFO(Debug_Emulated, "%s", output.c_str());
}
};
@@ -146,21 +146,11 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
* 0: ResultCode
*/
void LM::Initialize(Kernel::HLERequestContext& ctx) {
- // TODO(Subv): Verify if this should return the interface as a domain object when called from
- // within a domain.
-
- auto logger = std::make_shared<Logger>();
- auto sessions = Kernel::ServerSession::CreateSessionPair(logger->GetServiceName());
- auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
- auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
- logger->ClientConnected(server);
-
- LOG_DEBUG(Service_SM, "called, initialized logger -> session=%u", client->GetObjectId());
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushMoveObjects(std::move(client));
+ rb.PushIpcInterface<Logger>();
- LOG_INFO(Service_SM, "called");
+ LOG_DEBUG(Service, "called");
}
LM::LM() : ServiceFramework("lm") {
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp
index 0181d1b4f..85ecde6d2 100644
--- a/src/core/hle/service/nvdrv/interface.cpp
+++ b/src/core/hle/service/nvdrv/interface.cpp
@@ -18,7 +18,7 @@ void NVDRV::Open(Kernel::HLERequestContext& ctx) {
std::string device_name = Memory::ReadCString(buffer.Address(), buffer.Size());
u32 fd = nvdrv->Open(device_name);
- IPC::RequestBuilder rb{ctx, 4};
+ IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(fd);
rb.Push<u32>(0);
@@ -43,7 +43,7 @@ void NVDRV::Ioctl(Kernel::HLERequestContext& ctx) {
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(nv_result);
}
@@ -56,13 +56,13 @@ void NVDRV::Close(Kernel::HLERequestContext& ctx) {
auto result = nvdrv->Close(fd);
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(result);
}
void NVDRV::Initialize(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0);
}
@@ -72,7 +72,7 @@ void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) {
pid = rp.Pop<u64>();
LOG_INFO(Service, "called, pid=0x%lx", pid);
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0);
}
diff --git a/src/core/hle/service/pctl/pctl_a.cpp b/src/core/hle/service/pctl/pctl_a.cpp
index 7978aecb8..c808b764b 100644
--- a/src/core/hle/service/pctl/pctl_a.cpp
+++ b/src/core/hle/service/pctl/pctl_a.cpp
@@ -15,7 +15,7 @@ public:
};
void PCTL_A::GetService(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IParentalControlService>();
LOG_DEBUG(Service, "called");
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 1b8565351..294351b76 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -132,7 +132,7 @@ void ServiceFrameworkBase::InvokeRequest(Kernel::HLERequestContext& ctx) {
ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& context) {
switch (context.GetCommandType()) {
case IPC::CommandType::Close: {
- IPC::RequestBuilder rb{context, 1};
+ IPC::ResponseBuilder rb{context, 2};
rb.Push(RESULT_SUCCESS);
return ResultCode(ErrorModule::HIPC, ErrorDescription::RemoteProcessDead);
}
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index 3715acd74..e0e157fe1 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -19,7 +19,7 @@ void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) {
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(static_cast<u64>(lang_codes.size()));
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp
index 7b1c8ee37..a81ff9f49 100644
--- a/src/core/hle/service/sm/controller.cpp
+++ b/src/core/hle/service/sm/controller.cpp
@@ -4,30 +4,26 @@
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
-#include "core/hle/kernel/domain.h"
#include "core/hle/service/sm/controller.h"
namespace Service {
namespace SM {
void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) {
- auto domain = Kernel::Domain::CreateFromSession(*ctx.ServerSession()->parent).Unwrap();
+ ASSERT_MSG(!ctx.Session()->IsDomain(), "session is alread a domain");
+ ctx.Session()->ConvertToDomain();
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
- rb.Push(static_cast<u32>(domain->request_handlers.size()));
+ rb.Push<u32>(1); // Converted sessions start with 1 request handler
- LOG_DEBUG(Service, "called, domain=%d", domain->GetObjectId());
+ LOG_DEBUG(Service, "called, server_session=%d", ctx.Session()->GetObjectId());
}
void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
rb.Push(RESULT_SUCCESS);
- // TODO(Subv): Check if this is correct
- if (ctx.IsDomain())
- rb.PushMoveObjects(ctx.Domain());
- else
- rb.PushMoveObjects(ctx.ServerSession());
+ rb.PushMoveObjects(ctx.Session());
LOG_DEBUG(Service, "called");
}
@@ -39,7 +35,7 @@ void Controller::DuplicateSessionEx(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<u32>(0x500);
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index c4078f02f..73aa013e3 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -83,7 +83,7 @@ std::shared_ptr<ServiceManager> g_service_manager;
* 0: ResultCode
*/
void SM::Initialize(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 1};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_SM, "called");
}
@@ -99,7 +99,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
auto client_port = service_manager->GetServicePort(name);
if (client_port.Failed()) {
- IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0, 0);
+ IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(client_port.Code());
LOG_ERROR(Service_SM, "called service=%s -> error 0x%08X", name.c_str(),
client_port.Code().raw);
@@ -112,7 +112,8 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
if (session.Succeeded()) {
LOG_DEBUG(Service_SM, "called service=%s -> session=%u", name.c_str(),
(*session)->GetObjectId());
- IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 1, 0);
+ IPC::ResponseBuilder rb =
+ rp.MakeBuilder(2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles);
rb.Push(session.Code());
rb.PushMoveObjects(std::move(session).Unwrap());
}
diff --git a/src/core/hle/service/sockets/bsd_u.cpp b/src/core/hle/service/sockets/bsd_u.cpp
index a819acc96..4fd960bd8 100644
--- a/src/core/hle/service/sockets/bsd_u.cpp
+++ b/src/core/hle/service/sockets/bsd_u.cpp
@@ -11,7 +11,7 @@ namespace Sockets {
void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // bsd errno
@@ -28,7 +28,7 @@ void BSD_U::Socket(Kernel::HLERequestContext& ctx) {
u32 fd = next_fd++;
- IPC::RequestBuilder rb{ctx, 4};
+ IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(fd);
@@ -38,7 +38,7 @@ void BSD_U::Socket(Kernel::HLERequestContext& ctx) {
void BSD_U::Connect(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 4};
+ IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // ret
@@ -48,7 +48,7 @@ void BSD_U::Connect(Kernel::HLERequestContext& ctx) {
void BSD_U::SendTo(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 4};
+ IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // ret
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index 448ef8544..96ccee50d 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -19,7 +19,7 @@ public:
ISystemClock() : ServiceFramework("ISystemClock") {
static const FunctionInfo functions[] = {
{0, &ISystemClock::GetCurrentTime, "GetCurrentTime"},
- };
+ {2, &ISystemClock::GetSystemClockContext, "GetSystemClockContext"}};
RegisterHandlers(functions);
}
@@ -28,10 +28,18 @@ private:
const s64 time_since_epoch{std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::system_clock::now().time_since_epoch())
.count()};
- IPC::RequestBuilder rb{ctx, 4};
+ LOG_DEBUG(Service, "called");
+ IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push<u64>(time_since_epoch);
- LOG_DEBUG(Service, "called");
+ }
+
+ void GetSystemClockContext(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service, "(STUBBED) called");
+ SystemClockContext system_clock_ontext{};
+ IPC::ResponseBuilder rb{ctx, (sizeof(SystemClockContext) / 4) + 2};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushRaw(system_clock_ontext);
}
};
@@ -55,14 +63,14 @@ private:
void GetDeviceLocationName(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
LocationName location_name{};
- IPC::RequestBuilder rb{ctx, (sizeof(LocationName) / 4) + 2};
+ IPC::ResponseBuilder rb{ctx, (sizeof(LocationName) / 4) + 2};
rb.Push(RESULT_SUCCESS);
rb.PushRaw(location_name);
}
void GetTotalLocationNameCount(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 3};
+ IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0);
}
@@ -75,7 +83,7 @@ private:
CalendarTime calendar_time{2018, 1, 1, 0, 0, 0};
CalendarAdditionalInfo additional_info{};
- IPC::RequestBuilder rb{ctx, 10};
+ IPC::ResponseBuilder rb{ctx, 10};
rb.Push(RESULT_SUCCESS);
rb.PushRaw(calendar_time);
rb.PushRaw(additional_info);
@@ -83,49 +91,28 @@ private:
};
void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) {
- // TODO(Subv): Verify if this should return the interface as a domain object when called from
- // within a domain.
- auto system_clock = std::make_shared<ISystemClock>();
- auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName());
- auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
- auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
- system_clock->ClientConnected(server);
- LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u", client->GetObjectId());
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushMoveObjects(std::move(client));
+ rb.PushIpcInterface<ISystemClock>();
+ LOG_DEBUG(Service, "called");
}
void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) {
- // TODO(Subv): Verify if this should return the interface as a domain object when called from
- // within a domain.
- auto system_clock = std::make_shared<ISystemClock>();
- auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName());
- auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
- auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
- system_clock->ClientConnected(server);
- LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u", client->GetObjectId());
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushMoveObjects(std::move(client));
+ rb.PushIpcInterface<ISystemClock>();
+ LOG_DEBUG(Service, "called");
}
void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) {
- // TODO(Subv): Verify if this should return the interface as a domain object when called from
- // within a domain.
- auto steady_clock = std::make_shared<ISteadyClock>();
- auto sessions = Kernel::ServerSession::CreateSessionPair(steady_clock->GetServiceName());
- auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
- auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
- steady_clock->ClientConnected(server);
- LOG_DEBUG(Service, "called, initialized ISteadyClock -> session=%u", client->GetObjectId());
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushMoveObjects(std::move(client));
+ rb.PushIpcInterface<ISteadyClock>();
+ LOG_DEBUG(Service, "called");
}
void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) {
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ITimeZoneService>();
LOG_DEBUG(Service, "called");
diff --git a/src/core/hle/service/time/time.h b/src/core/hle/service/time/time.h
index 399f474d6..cd936a50c 100644
--- a/src/core/hle/service/time/time.h
+++ b/src/core/hle/service/time/time.h
@@ -33,6 +33,13 @@ struct CalendarAdditionalInfo {
static_assert(sizeof(CalendarAdditionalInfo) == 0x18,
"CalendarAdditionalInfo structure has incorrect size");
+// TODO(bunnei) RE this structure
+struct SystemClockContext {
+ INSERT_PADDING_BYTES(0x20);
+};
+static_assert(sizeof(SystemClockContext) == 0x20,
+ "SystemClockContext structure has incorrect size");
+
class Module final {
public:
class Interface : public ServiceFramework<Interface> {
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 6576f81db..3b993f36c 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -486,7 +486,7 @@ private:
}
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2};
+ IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
@@ -497,7 +497,7 @@ private:
u32 type = rp.Pop<u32>();
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);
}
@@ -511,7 +511,7 @@ private:
// TODO(Subv): Find out what this actually is.
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.PushCopyObjects(buffer_queue->GetNativeHandle());
}
@@ -537,7 +537,7 @@ private:
u64 layer_id = 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);
}
};
@@ -562,7 +562,7 @@ private:
IPC::RequestParser rp{ctx};
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);
}
@@ -576,7 +576,7 @@ private:
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(layer_id);
}
@@ -587,7 +587,7 @@ private:
u32 stack = rp.Pop<u32>();
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);
}
@@ -597,7 +597,7 @@ private:
void IApplicationDisplayService::GetRelayService(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IHOSBinderDriver>(nv_flinger);
}
@@ -605,7 +605,7 @@ void IApplicationDisplayService::GetRelayService(Kernel::HLERequestContext& ctx)
void IApplicationDisplayService::GetSystemDisplayService(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<ISystemDisplayService>();
}
@@ -613,7 +613,7 @@ void IApplicationDisplayService::GetSystemDisplayService(Kernel::HLERequestConte
void IApplicationDisplayService::GetManagerDisplayService(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IManagerDisplayService>(nv_flinger);
}
@@ -622,7 +622,7 @@ void IApplicationDisplayService::GetIndirectDisplayTransactionService(
Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
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");
- IPC::RequestBuilder rb = rp.MakeBuilder(4, 0, 0, 0);
+ IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
rb.Push(RESULT_SUCCESS);
rb.Push<u64>(nv_flinger->OpenDisplay(name));
}
@@ -647,7 +647,7 @@ void IApplicationDisplayService::CloseDisplay(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
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);
}
@@ -671,7 +671,7 @@ void IApplicationDisplayService::OpenLayer(Kernel::HLERequestContext& ctx) {
auto data = native_window.Serialize();
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<u64>(data.size());
}
@@ -694,7 +694,7 @@ void IApplicationDisplayService::CreateStrayLayer(Kernel::HLERequestContext& ctx
auto data = native_window.Serialize();
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(layer_id);
rb.Push<u64>(data.size());
@@ -706,7 +706,7 @@ void IApplicationDisplayService::DestroyStrayLayer(Kernel::HLERequestContext& ct
IPC::RequestParser rp{ctx};
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);
}
@@ -716,7 +716,7 @@ void IApplicationDisplayService::SetLayerScalingMode(Kernel::HLERequestContext&
u32 scaling_mode = rp.Pop<u32>();
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);
}
@@ -727,7 +727,7 @@ void IApplicationDisplayService::GetDisplayVsyncEvent(Kernel::HLERequestContext&
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.PushCopyObjects(vsync_event);
}
diff --git a/src/core/hle/service/vi/vi_m.cpp b/src/core/hle/service/vi/vi_m.cpp
index 20b24658e..bb440cadb 100644
--- a/src/core/hle/service/vi/vi_m.cpp
+++ b/src/core/hle/service/vi/vi_m.cpp
@@ -13,7 +13,8 @@ namespace VI {
void VI_M::GetDisplayService(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
- IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IApplicationDisplayService>(nv_flinger);
}