summaryrefslogtreecommitdiff
path: root/src/core/hle/service/psc
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-01 21:59:22 -0400
committerGravatar Lioncash2018-08-01 23:31:27 -0400
commit5233040ab480f0d0ace929247646d9eba6e77f9f (patch)
tree69af92737db3933b51eff0972c41ccfb4cfb38a8 /src/core/hle/service/psc
parentMerge pull request #888 from lioncash/caps (diff)
downloadyuzu-5233040ab480f0d0ace929247646d9eba6e77f9f.tar.gz
yuzu-5233040ab480f0d0ace929247646d9eba6e77f9f.tar.xz
yuzu-5233040ab480f0d0ace929247646d9eba6e77f9f.zip
service: Add psc services
Adds the basic skeleton for the psc services based off the information provided by Switch Brew.
Diffstat (limited to 'src/core/hle/service/psc')
-rw-r--r--src/core/hle/service/psc/psc.cpp77
-rw-r--r--src/core/hle/service/psc/psc.h15
2 files changed, 92 insertions, 0 deletions
diff --git a/src/core/hle/service/psc/psc.cpp b/src/core/hle/service/psc/psc.cpp
new file mode 100644
index 000000000..bbad870a2
--- /dev/null
+++ b/src/core/hle/service/psc/psc.cpp
@@ -0,0 +1,77 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "common/logging/log.h"
8#include "core/hle/ipc_helpers.h"
9#include "core/hle/service/psc/psc.h"
10#include "core/hle/service/service.h"
11#include "core/hle/service/sm/sm.h"
12
13namespace Service::PSC {
14
15class PSC_C final : public ServiceFramework<PSC_C> {
16public:
17 explicit PSC_C() : ServiceFramework{"psc:c"} {
18 // clang-format off
19 static const FunctionInfo functions[] = {
20 {0, nullptr, "Unknown1"},
21 {1, nullptr, "Unknown2"},
22 {2, nullptr, "Unknown3"},
23 {3, nullptr, "Unknown4"},
24 {4, nullptr, "Unknown5"},
25 {5, nullptr, "Unknown6"},
26 {6, nullptr, "Unknown7"},
27 };
28 // clang-format on
29
30 RegisterHandlers(functions);
31 }
32};
33
34class IPmModule final : public ServiceFramework<IPmModule> {
35public:
36 explicit IPmModule() : ServiceFramework{"IPmModule"} {
37 // clang-format off
38 static const FunctionInfo functions[] = {
39 {0, nullptr, "Initialize"},
40 {1, nullptr, "GetRequest"},
41 {2, nullptr, "Acknowledge"},
42 {3, nullptr, "Unknown1"},
43 };
44 // clang-format on
45
46 RegisterHandlers(functions);
47 }
48};
49
50class PSC_M final : public ServiceFramework<PSC_M> {
51public:
52 explicit PSC_M() : ServiceFramework{"psc:m"} {
53 // clang-format off
54 static const FunctionInfo functions[] = {
55 {0, &PSC_M::GetPmModule, "GetPmModule"},
56 };
57 // clang-format on
58
59 RegisterHandlers(functions);
60 }
61
62private:
63 void GetPmModule(Kernel::HLERequestContext& ctx) {
64 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
65 rb.Push(RESULT_SUCCESS);
66 rb.PushIpcInterface<IPmModule>();
67
68 LOG_DEBUG(Service_PSC, "called");
69 }
70};
71
72void InstallInterfaces(SM::ServiceManager& sm) {
73 std::make_shared<PSC_C>()->InstallAsService(sm);
74 std::make_shared<PSC_M>()->InstallAsService(sm);
75}
76
77} // namespace Service::PSC
diff --git a/src/core/hle/service/psc/psc.h b/src/core/hle/service/psc/psc.h
new file mode 100644
index 000000000..5052eb02c
--- /dev/null
+++ b/src/core/hle/service/psc/psc.h
@@ -0,0 +1,15 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::PSC {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::PSC