pcie.cpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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() : ServiceFramework{"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. };
  36. // clang-format on
  37. RegisterHandlers(functions);
  38. }
  39. };
  40. class PCIe final : public ServiceFramework<PCIe> {
  41. public:
  42. explicit PCIe() : ServiceFramework{"pcie"} {
  43. // clang-format off
  44. static const FunctionInfo functions[] = {
  45. {0, nullptr, "RegisterClassDriver"},
  46. {1, nullptr, "QueryFunctionsUnregistered"},
  47. };
  48. // clang-format on
  49. RegisterHandlers(functions);
  50. }
  51. };
  52. void InstallInterfaces(SM::ServiceManager& sm) {
  53. std::make_shared<PCIe>()->InstallAsService(sm);
  54. }
  55. } // namespace Service::PCIe