summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/logging/backend.cpp2
-rw-r--r--src/common/logging/log.h2
-rw-r--r--src/core/CMakeLists.txt8
-rw-r--r--src/core/hle/service/bpc/bpc.cpp57
-rw-r--r--src/core/hle/service/bpc/bpc.h15
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp4
-rw-r--r--src/core/hle/service/filesystem/fsp_ldr.cpp24
-rw-r--r--src/core/hle/service/filesystem/fsp_ldr.h16
-rw-r--r--src/core/hle/service/filesystem/fsp_pr.cpp25
-rw-r--r--src/core/hle/service/filesystem/fsp_pr.h16
-rw-r--r--src/core/hle/service/lm/lm.cpp8
-rw-r--r--src/core/hle/service/pcv/pcv.cpp84
-rw-r--r--src/core/hle/service/pcv/pcv.h15
-rw-r--r--src/core/hle/service/service.cpp4
14 files changed, 276 insertions, 4 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 8f9cb4d7b..d6714587c 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -169,6 +169,7 @@ void FileBackend::Write(const Entry& entry) {
169 SUB(Service, AOC) \ 169 SUB(Service, AOC) \
170 SUB(Service, APM) \ 170 SUB(Service, APM) \
171 SUB(Service, BCAT) \ 171 SUB(Service, BCAT) \
172 SUB(Service, BPC) \
172 SUB(Service, BTM) \ 173 SUB(Service, BTM) \
173 SUB(Service, Capture) \ 174 SUB(Service, Capture) \
174 SUB(Service, Fatal) \ 175 SUB(Service, Fatal) \
@@ -189,6 +190,7 @@ void FileBackend::Write(const Entry& entry) {
189 SUB(Service, NVDRV) \ 190 SUB(Service, NVDRV) \
190 SUB(Service, PCIE) \ 191 SUB(Service, PCIE) \
191 SUB(Service, PCTL) \ 192 SUB(Service, PCTL) \
193 SUB(Service, PCV) \
192 SUB(Service, PREPO) \ 194 SUB(Service, PREPO) \
193 SUB(Service, SET) \ 195 SUB(Service, SET) \
194 SUB(Service, SM) \ 196 SUB(Service, SM) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 57552d49e..e96d817f4 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -56,6 +56,7 @@ enum class Class : ClassType {
56 Service_APM, ///< The APM (Performance) service 56 Service_APM, ///< The APM (Performance) service
57 Service_Audio, ///< The Audio (Audio control) service 57 Service_Audio, ///< The Audio (Audio control) service
58 Service_BCAT, ///< The BCAT service 58 Service_BCAT, ///< The BCAT service
59 Service_BPC, ///< The BPC service
59 Service_BTM, ///< The BTM service 60 Service_BTM, ///< The BTM service
60 Service_Capture, ///< The capture service 61 Service_Capture, ///< The capture service
61 Service_Fatal, ///< The Fatal service 62 Service_Fatal, ///< The Fatal service
@@ -76,6 +77,7 @@ enum class Class : ClassType {
76 Service_NVDRV, ///< The NVDRV (Nvidia driver) service 77 Service_NVDRV, ///< The NVDRV (Nvidia driver) service
77 Service_PCIE, ///< The PCIe service 78 Service_PCIE, ///< The PCIe service
78 Service_PCTL, ///< The PCTL (Parental control) service 79 Service_PCTL, ///< The PCTL (Parental control) service
80 Service_PCV, ///< The PCV (Parental control) service
79 Service_PREPO, ///< The PREPO (Play report) service 81 Service_PREPO, ///< The PREPO (Play report) service
80 Service_SET, ///< The SET (Settings) service 82 Service_SET, ///< The SET (Settings) service
81 Service_SM, ///< The SM (Service manager) service 83 Service_SM, ///< The SM (Service manager) service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 26626553e..3cc9160ca 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -154,6 +154,8 @@ add_library(core STATIC
154 hle/service/bcat/bcat.h 154 hle/service/bcat/bcat.h
155 hle/service/bcat/module.cpp 155 hle/service/bcat/module.cpp
156 hle/service/bcat/module.h 156 hle/service/bcat/module.h
157 hle/service/bpc/bpc.cpp
158 hle/service/bpc/bpc.h
157 hle/service/btdrv/btdrv.cpp 159 hle/service/btdrv/btdrv.cpp
158 hle/service/btdrv/btdrv.h 160 hle/service/btdrv/btdrv.h
159 hle/service/btm/btm.cpp 161 hle/service/btm/btm.cpp
@@ -174,6 +176,10 @@ add_library(core STATIC
174 hle/service/fatal/fatal_u.h 176 hle/service/fatal/fatal_u.h
175 hle/service/filesystem/filesystem.cpp 177 hle/service/filesystem/filesystem.cpp
176 hle/service/filesystem/filesystem.h 178 hle/service/filesystem/filesystem.h
179 hle/service/filesystem/fsp_ldr.cpp
180 hle/service/filesystem/fsp_ldr.h
181 hle/service/filesystem/fsp_pr.cpp
182 hle/service/filesystem/fsp_pr.h
177 hle/service/filesystem/fsp_srv.cpp 183 hle/service/filesystem/fsp_srv.cpp
178 hle/service/filesystem/fsp_srv.h 184 hle/service/filesystem/fsp_srv.h
179 hle/service/fgm/fgm.cpp 185 hle/service/fgm/fgm.cpp
@@ -249,6 +255,8 @@ add_library(core STATIC
249 hle/service/pctl/module.h 255 hle/service/pctl/module.h
250 hle/service/pctl/pctl.cpp 256 hle/service/pctl/pctl.cpp
251 hle/service/pctl/pctl.h 257 hle/service/pctl/pctl.h
258 hle/service/pcv/pcv.cpp
259 hle/service/pcv/pcv.h
252 hle/service/pm/pm.cpp 260 hle/service/pm/pm.cpp
253 hle/service/pm/pm.h 261 hle/service/pm/pm.h
254 hle/service/prepo/prepo.cpp 262 hle/service/prepo/prepo.cpp
diff --git a/src/core/hle/service/bpc/bpc.cpp b/src/core/hle/service/bpc/bpc.cpp
new file mode 100644
index 000000000..1c1ecdb60
--- /dev/null
+++ b/src/core/hle/service/bpc/bpc.cpp
@@ -0,0 +1,57 @@
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 "core/hle/service/bpc/bpc.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::BPC {
12
13class BPC final : public ServiceFramework<BPC> {
14public:
15 explicit BPC() : ServiceFramework{"bpc"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {0, nullptr, "ShutdownSystem"},
19 {1, nullptr, "RebootSystem"},
20 {2, nullptr, "GetWakeupReason"},
21 {3, nullptr, "GetShutdownReason"},
22 {4, nullptr, "GetAcOk"},
23 {5, nullptr, "GetBoardPowerControlEvent"},
24 {6, nullptr, "GetSleepButtonState"},
25 {7, nullptr, "GetPowerEvent"},
26 {8, nullptr, "Unknown1"},
27 {9, nullptr, "Unknown2"},
28 {10, nullptr, "Unknown3"},
29 };
30 // clang-format on
31
32 RegisterHandlers(functions);
33 }
34};
35
36class BPC_R final : public ServiceFramework<BPC_R> {
37public:
38 explicit BPC_R() : ServiceFramework{"bpc:r"} {
39 // clang-format off
40 static const FunctionInfo functions[] = {
41 {0, nullptr, "GetExternalRtcValue"},
42 {1, nullptr, "SetExternalRtcValue"},
43 {2, nullptr, "ReadExternalRtcResetFlag"},
44 {3, nullptr, "ClearExternalRtcResetFlag"},
45 };
46 // clang-format on
47
48 RegisterHandlers(functions);
49 }
50};
51
52void InstallInterfaces(SM::ServiceManager& sm) {
53 std::make_shared<BPC>()->InstallAsService(sm);
54 std::make_shared<BPC_R>()->InstallAsService(sm);
55}
56
57} // namespace Service::BPC
diff --git a/src/core/hle/service/bpc/bpc.h b/src/core/hle/service/bpc/bpc.h
new file mode 100644
index 000000000..eaa37be8d
--- /dev/null
+++ b/src/core/hle/service/bpc/bpc.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::BPC {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::BPC
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index fdd2fda18..e17d637e4 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -14,6 +14,8 @@
14#include "core/file_sys/vfs_offset.h" 14#include "core/file_sys/vfs_offset.h"
15#include "core/file_sys/vfs_real.h" 15#include "core/file_sys/vfs_real.h"
16#include "core/hle/service/filesystem/filesystem.h" 16#include "core/hle/service/filesystem/filesystem.h"
17#include "core/hle/service/filesystem/fsp_ldr.h"
18#include "core/hle/service/filesystem/fsp_pr.h"
17#include "core/hle/service/filesystem/fsp_srv.h" 19#include "core/hle/service/filesystem/fsp_srv.h"
18 20
19namespace Service::FileSystem { 21namespace Service::FileSystem {
@@ -298,6 +300,8 @@ void RegisterFileSystems() {
298 300
299void InstallInterfaces(SM::ServiceManager& service_manager) { 301void InstallInterfaces(SM::ServiceManager& service_manager) {
300 RegisterFileSystems(); 302 RegisterFileSystems();
303 std::make_shared<FSP_LDR>()->InstallAsService(service_manager);
304 std::make_shared<FSP_PR>()->InstallAsService(service_manager);
301 std::make_shared<FSP_SRV>()->InstallAsService(service_manager); 305 std::make_shared<FSP_SRV>()->InstallAsService(service_manager);
302} 306}
303 307
diff --git a/src/core/hle/service/filesystem/fsp_ldr.cpp b/src/core/hle/service/filesystem/fsp_ldr.cpp
new file mode 100644
index 000000000..ee6d4d055
--- /dev/null
+++ b/src/core/hle/service/filesystem/fsp_ldr.cpp
@@ -0,0 +1,24 @@
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
7#include "core/hle/service/filesystem/fsp_ldr.h"
8#include "core/hle/service/service.h"
9
10namespace Service::FileSystem {
11
12FSP_LDR::FSP_LDR() : ServiceFramework{"fsp:ldr"} {
13 // clang-format off
14 static const FunctionInfo functions[] = {
15 {0, nullptr, "OpenCodeFileSystem"},
16 {1, nullptr, "IsArchivedProgram"},
17 {2, nullptr, "SetCurrentProcess"},
18 };
19 // clang-format on
20
21 RegisterHandlers(functions);
22}
23
24} // namespace Service::FileSystem
diff --git a/src/core/hle/service/filesystem/fsp_ldr.h b/src/core/hle/service/filesystem/fsp_ldr.h
new file mode 100644
index 000000000..fa8e11b4c
--- /dev/null
+++ b/src/core/hle/service/filesystem/fsp_ldr.h
@@ -0,0 +1,16 @@
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
7#include "core/hle/service/service.h"
8
9namespace Service::FileSystem {
10
11class FSP_LDR final : public ServiceFramework<FSP_LDR> {
12public:
13 explicit FSP_LDR();
14};
15
16} // namespace Service::FileSystem
diff --git a/src/core/hle/service/filesystem/fsp_pr.cpp b/src/core/hle/service/filesystem/fsp_pr.cpp
new file mode 100644
index 000000000..0b51385ee
--- /dev/null
+++ b/src/core/hle/service/filesystem/fsp_pr.cpp
@@ -0,0 +1,25 @@
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
7#include "core/hle/service/filesystem/fsp_pr.h"
8#include "core/hle/service/service.h"
9
10namespace Service::FileSystem {
11
12FSP_PR::FSP_PR() : ServiceFramework{"fsp:pr"} {
13 // clang-format off
14 static const FunctionInfo functions[] = {
15 {0, nullptr, "RegisterProgram"},
16 {1, nullptr, "UnregisterProgram"},
17 {2, nullptr, "SetCurrentProcess"},
18 {256, nullptr, "SetEnabledProgramVerification"},
19 };
20 // clang-format on
21
22 RegisterHandlers(functions);
23}
24
25} // namespace Service::FileSystem
diff --git a/src/core/hle/service/filesystem/fsp_pr.h b/src/core/hle/service/filesystem/fsp_pr.h
new file mode 100644
index 000000000..62edcd08a
--- /dev/null
+++ b/src/core/hle/service/filesystem/fsp_pr.h
@@ -0,0 +1,16 @@
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
7#include "core/hle/service/service.h"
8
9namespace Service::FileSystem {
10
11class FSP_PR final : public ServiceFramework<FSP_PR> {
12public:
13 explicit FSP_PR();
14};
15
16} // namespace Service::FileSystem
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index b497376d7..2e99ddf51 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -13,11 +13,11 @@
13 13
14namespace Service::LM { 14namespace Service::LM {
15 15
16class Logger final : public ServiceFramework<Logger> { 16class ILogger final : public ServiceFramework<ILogger> {
17public: 17public:
18 Logger() : ServiceFramework("Logger") { 18 ILogger() : ServiceFramework("ILogger") {
19 static const FunctionInfo functions[] = { 19 static const FunctionInfo functions[] = {
20 {0x00000000, &Logger::Initialize, "Initialize"}, 20 {0x00000000, &ILogger::Initialize, "Initialize"},
21 {0x00000001, nullptr, "SetDestination"}, 21 {0x00000001, nullptr, "SetDestination"},
22 }; 22 };
23 RegisterHandlers(functions); 23 RegisterHandlers(functions);
@@ -182,7 +182,7 @@ public:
182 void OpenLogger(Kernel::HLERequestContext& ctx) { 182 void OpenLogger(Kernel::HLERequestContext& ctx) {
183 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 183 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
184 rb.Push(RESULT_SUCCESS); 184 rb.Push(RESULT_SUCCESS);
185 rb.PushIpcInterface<Logger>(); 185 rb.PushIpcInterface<ILogger>();
186 186
187 LOG_DEBUG(Service_LM, "called"); 187 LOG_DEBUG(Service_LM, "called");
188 } 188 }
diff --git a/src/core/hle/service/pcv/pcv.cpp b/src/core/hle/service/pcv/pcv.cpp
new file mode 100644
index 000000000..d6891a659
--- /dev/null
+++ b/src/core/hle/service/pcv/pcv.cpp
@@ -0,0 +1,84 @@
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 "core/hle/service/pcv/pcv.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::PCV {
12
13class PCV final : public ServiceFramework<PCV> {
14public:
15 explicit PCV() : ServiceFramework{"pcv"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {0, nullptr, "SetPowerEnabled"},
19 {1, nullptr, "SetClockEnabled"},
20 {2, nullptr, "SetClockRate"},
21 {3, nullptr, "GetClockRate"},
22 {4, nullptr, "GetState"},
23 {5, nullptr, "GetPossibleClockRates"},
24 {6, nullptr, "SetMinVClockRate"},
25 {7, nullptr, "SetReset"},
26 {8, nullptr, "SetVoltageEnabled"},
27 {9, nullptr, "GetVoltageEnabled"},
28 {10, nullptr, "GetVoltageRange"},
29 {11, nullptr, "SetVoltageValue"},
30 {12, nullptr, "GetVoltageValue"},
31 {13, nullptr, "GetTemperatureThresholds"},
32 {14, nullptr, "SetTemperature"},
33 {15, nullptr, "Initialize"},
34 {16, nullptr, "IsInitialized"},
35 {17, nullptr, "Finalize"},
36 {18, nullptr, "PowerOn"},
37 {19, nullptr, "PowerOff"},
38 {20, nullptr, "ChangeVoltage"},
39 {21, nullptr, "GetPowerClockInfoEvent"},
40 {22, nullptr, "GetOscillatorClock"},
41 {23, nullptr, "GetDvfsTable"},
42 {24, nullptr, "GetModuleStateTable"},
43 {25, nullptr, "GetPowerDomainStateTable"},
44 {26, nullptr, "GetFuseInfo"},
45 };
46 // clang-format on
47
48 RegisterHandlers(functions);
49 }
50};
51
52class PCV_ARB final : public ServiceFramework<PCV_ARB> {
53public:
54 explicit PCV_ARB() : ServiceFramework{"pcv:arb"} {
55 // clang-format off
56 static const FunctionInfo functions[] = {
57 {0, nullptr, "ReleaseControl"},
58 };
59 // clang-format on
60
61 RegisterHandlers(functions);
62 }
63};
64
65class PCV_IMM final : public ServiceFramework<PCV_IMM> {
66public:
67 explicit PCV_IMM() : ServiceFramework{"pcv:imm"} {
68 // clang-format off
69 static const FunctionInfo functions[] = {
70 {0, nullptr, "SetClockRate"},
71 };
72 // clang-format on
73
74 RegisterHandlers(functions);
75 }
76};
77
78void InstallInterfaces(SM::ServiceManager& sm) {
79 std::make_shared<PCV>()->InstallAsService(sm);
80 std::make_shared<PCV_ARB>()->InstallAsService(sm);
81 std::make_shared<PCV_IMM>()->InstallAsService(sm);
82}
83
84} // namespace Service::PCV
diff --git a/src/core/hle/service/pcv/pcv.h b/src/core/hle/service/pcv/pcv.h
new file mode 100644
index 000000000..219a893c3
--- /dev/null
+++ b/src/core/hle/service/pcv/pcv.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::PCV {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::PCV
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 4f3a8d96b..828666e9b 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -21,6 +21,7 @@
21#include "core/hle/service/apm/apm.h" 21#include "core/hle/service/apm/apm.h"
22#include "core/hle/service/audio/audio.h" 22#include "core/hle/service/audio/audio.h"
23#include "core/hle/service/bcat/bcat.h" 23#include "core/hle/service/bcat/bcat.h"
24#include "core/hle/service/bpc/bpc.h"
24#include "core/hle/service/btdrv/btdrv.h" 25#include "core/hle/service/btdrv/btdrv.h"
25#include "core/hle/service/btm/btm.h" 26#include "core/hle/service/btm/btm.h"
26#include "core/hle/service/caps/caps.h" 27#include "core/hle/service/caps/caps.h"
@@ -48,6 +49,7 @@
48#include "core/hle/service/nvdrv/nvdrv.h" 49#include "core/hle/service/nvdrv/nvdrv.h"
49#include "core/hle/service/pcie/pcie.h" 50#include "core/hle/service/pcie/pcie.h"
50#include "core/hle/service/pctl/pctl.h" 51#include "core/hle/service/pctl/pctl.h"
52#include "core/hle/service/pcv/pcv.h"
51#include "core/hle/service/pm/pm.h" 53#include "core/hle/service/pm/pm.h"
52#include "core/hle/service/prepo/prepo.h" 54#include "core/hle/service/prepo/prepo.h"
53#include "core/hle/service/service.h" 55#include "core/hle/service/service.h"
@@ -205,6 +207,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
205 APM::InstallInterfaces(*sm); 207 APM::InstallInterfaces(*sm);
206 Audio::InstallInterfaces(*sm); 208 Audio::InstallInterfaces(*sm);
207 BCAT::InstallInterfaces(*sm); 209 BCAT::InstallInterfaces(*sm);
210 BPC::InstallInterfaces(*sm);
208 BtDrv::InstallInterfaces(*sm); 211 BtDrv::InstallInterfaces(*sm);
209 BTM::InstallInterfaces(*sm); 212 BTM::InstallInterfaces(*sm);
210 Capture::InstallInterfaces(*sm); 213 Capture::InstallInterfaces(*sm);
@@ -232,6 +235,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
232 Nvidia::InstallInterfaces(*sm); 235 Nvidia::InstallInterfaces(*sm);
233 PCIe::InstallInterfaces(*sm); 236 PCIe::InstallInterfaces(*sm);
234 PCTL::InstallInterfaces(*sm); 237 PCTL::InstallInterfaces(*sm);
238 PCV::InstallInterfaces(*sm);
235 PlayReport::InstallInterfaces(*sm); 239 PlayReport::InstallInterfaces(*sm);
236 PM::InstallInterfaces(*sm); 240 PM::InstallInterfaces(*sm);
237 Set::InstallInterfaces(*sm); 241 Set::InstallInterfaces(*sm);