pcie.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/pcie/pcie.h"
  6. #include "core/hle/service/service.h"
  7. #include "core/hle/service/sm/sm.h"
  8. namespace Service::PCIe {
  9. class ISession final : public ServiceFramework<ISession> {
  10. public:
  11. explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} {
  12. // clang-format off
  13. static const FunctionInfo functions[] = {
  14. {0, nullptr, "QueryFunctions"},
  15. {1, nullptr, "AcquireFunction"},
  16. {2, nullptr, "ReleaseFunction"},
  17. {3, nullptr, "GetFunctionState"},
  18. {4, nullptr, "GetBarProfile"},
  19. {5, nullptr, "ReadConfig"},
  20. {6, nullptr, "WriteConfig"},
  21. {7, nullptr, "ReadBarRegion"},
  22. {8, nullptr, "WriteBarRegion"},
  23. {9, nullptr, "FindCapability"},
  24. {10, nullptr, "FindExtendedCapability"},
  25. {11, nullptr, "MapDma"},
  26. {12, nullptr, "UnmapDma"},
  27. {13, nullptr, "UnmapDmaBusAddress"},
  28. {14, nullptr, "GetDmaBusAddress"},
  29. {15, nullptr, "GetDmaBusAddressRange"},
  30. {16, nullptr, "SetDmaEnable"},
  31. {17, nullptr, "AcquireIrq"},
  32. {18, nullptr, "ReleaseIrq"},
  33. {19, nullptr, "SetIrqEnable"},
  34. {20, nullptr, "SetAspmEnable"},
  35. {21, nullptr, "SetResetUponResumeEnable"},
  36. {22, nullptr, "Unknown22"},
  37. {23, nullptr, "Unknown23"},
  38. };
  39. // clang-format on
  40. RegisterHandlers(functions);
  41. }
  42. };
  43. class PCIe final : public ServiceFramework<PCIe> {
  44. public:
  45. explicit PCIe(Core::System& system_) : ServiceFramework{system_, "pcie"} {
  46. // clang-format off
  47. static const FunctionInfo functions[] = {
  48. {0, nullptr, "RegisterClassDriver"},
  49. {1, nullptr, "QueryFunctionsUnregistered"},
  50. };
  51. // clang-format on
  52. RegisterHandlers(functions);
  53. }
  54. };
  55. void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
  56. std::make_shared<PCIe>(system)->InstallAsService(sm);
  57. }
  58. } // namespace Service::PCIe