diff options
| author | 2018-08-01 21:32:36 -0400 | |
|---|---|---|
| committer | 2018-08-01 21:32:36 -0400 | |
| commit | 200c95db8a816db0170b2fa27992fc719e434e05 (patch) | |
| tree | 24c4b73abf24a6106ce1f2a86da77f41736b6624 /src/core | |
| parent | Merge pull request #885 from greggameplayer/R32-Float (diff) | |
| parent | service: Add bpc and pcv services (diff) | |
| download | yuzu-200c95db8a816db0170b2fa27992fc719e434e05.tar.gz yuzu-200c95db8a816db0170b2fa27992fc719e434e05.tar.xz yuzu-200c95db8a816db0170b2fa27992fc719e434e05.zip | |
Merge pull request #887 from lioncash/pcv
service: Add bpc and pcv services
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/core/hle/service/bpc/bpc.cpp | 57 | ||||
| -rw-r--r-- | src/core/hle/service/bpc/bpc.h | 15 | ||||
| -rw-r--r-- | src/core/hle/service/pcv/pcv.cpp | 84 | ||||
| -rw-r--r-- | src/core/hle/service/pcv/pcv.h | 15 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 4 |
6 files changed, 179 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ccb0695e4..d325ea359 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 |
| @@ -247,6 +249,8 @@ add_library(core STATIC | |||
| 247 | hle/service/pctl/module.h | 249 | hle/service/pctl/module.h |
| 248 | hle/service/pctl/pctl.cpp | 250 | hle/service/pctl/pctl.cpp |
| 249 | hle/service/pctl/pctl.h | 251 | hle/service/pctl/pctl.h |
| 252 | hle/service/pcv/pcv.cpp | ||
| 253 | hle/service/pcv/pcv.h | ||
| 250 | hle/service/pm/pm.cpp | 254 | hle/service/pm/pm.cpp |
| 251 | hle/service/pm/pm.h | 255 | hle/service/pm/pm.h |
| 252 | hle/service/prepo/prepo.cpp | 256 | 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 | |||
| 11 | namespace Service::BPC { | ||
| 12 | |||
| 13 | class BPC final : public ServiceFramework<BPC> { | ||
| 14 | public: | ||
| 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 | |||
| 36 | class BPC_R final : public ServiceFramework<BPC_R> { | ||
| 37 | public: | ||
| 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 | |||
| 52 | void 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 | |||
| 7 | namespace Service::SM { | ||
| 8 | class ServiceManager; | ||
| 9 | } | ||
| 10 | |||
| 11 | namespace Service::BPC { | ||
| 12 | |||
| 13 | void InstallInterfaces(SM::ServiceManager& sm); | ||
| 14 | |||
| 15 | } // namespace Service::BPC | ||
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 | |||
| 11 | namespace Service::PCV { | ||
| 12 | |||
| 13 | class PCV final : public ServiceFramework<PCV> { | ||
| 14 | public: | ||
| 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 | |||
| 52 | class PCV_ARB final : public ServiceFramework<PCV_ARB> { | ||
| 53 | public: | ||
| 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 | |||
| 65 | class PCV_IMM final : public ServiceFramework<PCV_IMM> { | ||
| 66 | public: | ||
| 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 | |||
| 78 | void 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 | |||
| 7 | namespace Service::SM { | ||
| 8 | class ServiceManager; | ||
| 9 | } | ||
| 10 | |||
| 11 | namespace Service::PCV { | ||
| 12 | |||
| 13 | void 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 fccc4c461..747a2252e 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/erpt/erpt.h" | 27 | #include "core/hle/service/erpt/erpt.h" |
| @@ -47,6 +48,7 @@ | |||
| 47 | #include "core/hle/service/nvdrv/nvdrv.h" | 48 | #include "core/hle/service/nvdrv/nvdrv.h" |
| 48 | #include "core/hle/service/pcie/pcie.h" | 49 | #include "core/hle/service/pcie/pcie.h" |
| 49 | #include "core/hle/service/pctl/pctl.h" | 50 | #include "core/hle/service/pctl/pctl.h" |
| 51 | #include "core/hle/service/pcv/pcv.h" | ||
| 50 | #include "core/hle/service/pm/pm.h" | 52 | #include "core/hle/service/pm/pm.h" |
| 51 | #include "core/hle/service/prepo/prepo.h" | 53 | #include "core/hle/service/prepo/prepo.h" |
| 52 | #include "core/hle/service/service.h" | 54 | #include "core/hle/service/service.h" |
| @@ -204,6 +206,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) { | |||
| 204 | APM::InstallInterfaces(*sm); | 206 | APM::InstallInterfaces(*sm); |
| 205 | Audio::InstallInterfaces(*sm); | 207 | Audio::InstallInterfaces(*sm); |
| 206 | BCAT::InstallInterfaces(*sm); | 208 | BCAT::InstallInterfaces(*sm); |
| 209 | BPC::InstallInterfaces(*sm); | ||
| 207 | BtDrv::InstallInterfaces(*sm); | 210 | BtDrv::InstallInterfaces(*sm); |
| 208 | BTM::InstallInterfaces(*sm); | 211 | BTM::InstallInterfaces(*sm); |
| 209 | ERPT::InstallInterfaces(*sm); | 212 | ERPT::InstallInterfaces(*sm); |
| @@ -230,6 +233,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) { | |||
| 230 | Nvidia::InstallInterfaces(*sm); | 233 | Nvidia::InstallInterfaces(*sm); |
| 231 | PCIe::InstallInterfaces(*sm); | 234 | PCIe::InstallInterfaces(*sm); |
| 232 | PCTL::InstallInterfaces(*sm); | 235 | PCTL::InstallInterfaces(*sm); |
| 236 | PCV::InstallInterfaces(*sm); | ||
| 233 | PlayReport::InstallInterfaces(*sm); | 237 | PlayReport::InstallInterfaces(*sm); |
| 234 | PM::InstallInterfaces(*sm); | 238 | PM::InstallInterfaces(*sm); |
| 235 | Set::InstallInterfaces(*sm); | 239 | Set::InstallInterfaces(*sm); |