pcv.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <memory>
  5. #include "core/hle/service/pcv/pcv.h"
  6. #include "core/hle/service/service.h"
  7. #include "core/hle/service/sm/sm.h"
  8. namespace Service::PCV {
  9. class PCV final : public ServiceFramework<PCV> {
  10. public:
  11. explicit PCV() : ServiceFramework{"pcv"} {
  12. // clang-format off
  13. static const FunctionInfo functions[] = {
  14. {0, nullptr, "SetPowerEnabled"},
  15. {1, nullptr, "SetClockEnabled"},
  16. {2, nullptr, "SetClockRate"},
  17. {3, nullptr, "GetClockRate"},
  18. {4, nullptr, "GetState"},
  19. {5, nullptr, "GetPossibleClockRates"},
  20. {6, nullptr, "SetMinVClockRate"},
  21. {7, nullptr, "SetReset"},
  22. {8, nullptr, "SetVoltageEnabled"},
  23. {9, nullptr, "GetVoltageEnabled"},
  24. {10, nullptr, "GetVoltageRange"},
  25. {11, nullptr, "SetVoltageValue"},
  26. {12, nullptr, "GetVoltageValue"},
  27. {13, nullptr, "GetTemperatureThresholds"},
  28. {14, nullptr, "SetTemperature"},
  29. {15, nullptr, "Initialize"},
  30. {16, nullptr, "IsInitialized"},
  31. {17, nullptr, "Finalize"},
  32. {18, nullptr, "PowerOn"},
  33. {19, nullptr, "PowerOff"},
  34. {20, nullptr, "ChangeVoltage"},
  35. {21, nullptr, "GetPowerClockInfoEvent"},
  36. {22, nullptr, "GetOscillatorClock"},
  37. {23, nullptr, "GetDvfsTable"},
  38. {24, nullptr, "GetModuleStateTable"},
  39. {25, nullptr, "GetPowerDomainStateTable"},
  40. {26, nullptr, "GetFuseInfo"},
  41. {27, nullptr, "GetDramId"},
  42. {28, nullptr, "IsPoweredOn"},
  43. {29, nullptr, "GetVoltage"},
  44. };
  45. // clang-format on
  46. RegisterHandlers(functions);
  47. }
  48. };
  49. class PCV_ARB final : public ServiceFramework<PCV_ARB> {
  50. public:
  51. explicit PCV_ARB() : ServiceFramework{"pcv:arb"} {
  52. // clang-format off
  53. static const FunctionInfo functions[] = {
  54. {0, nullptr, "ReleaseControl"},
  55. };
  56. // clang-format on
  57. RegisterHandlers(functions);
  58. }
  59. };
  60. class PCV_IMM final : public ServiceFramework<PCV_IMM> {
  61. public:
  62. explicit PCV_IMM() : ServiceFramework{"pcv:imm"} {
  63. // clang-format off
  64. static const FunctionInfo functions[] = {
  65. {0, nullptr, "SetClockRate"},
  66. };
  67. // clang-format on
  68. RegisterHandlers(functions);
  69. }
  70. };
  71. void InstallInterfaces(SM::ServiceManager& sm) {
  72. std::make_shared<PCV>()->InstallAsService(sm);
  73. std::make_shared<PCV_ARB>()->InstallAsService(sm);
  74. std::make_shared<PCV_IMM>()->InstallAsService(sm);
  75. }
  76. } // namespace Service::PCV