diff options
| author | 2018-07-31 06:33:38 -0400 | |
|---|---|---|
| committer | 2018-07-31 06:40:21 -0400 | |
| commit | e373027a73e84c04b28bbfb4fc837b4133b17d4f (patch) | |
| tree | 8c78e1e5921a492c00bcf28f74f3c61060dbdc01 /src/core/hle/service/pcie | |
| parent | Merge pull request #855 from bunnei/cubeb (diff) | |
| download | yuzu-e373027a73e84c04b28bbfb4fc837b4133b17d4f.tar.gz yuzu-e373027a73e84c04b28bbfb4fc837b4133b17d4f.tar.xz yuzu-e373027a73e84c04b28bbfb4fc837b4133b17d4f.zip | |
service: Add the pcie service
Adds the basic skeleton of the pcie service based off information on
Switch Brew.
Diffstat (limited to 'src/core/hle/service/pcie')
| -rw-r--r-- | src/core/hle/service/pcie/pcie.cpp | 64 | ||||
| -rw-r--r-- | src/core/hle/service/pcie/pcie.h | 15 |
2 files changed, 79 insertions, 0 deletions
diff --git a/src/core/hle/service/pcie/pcie.cpp b/src/core/hle/service/pcie/pcie.cpp new file mode 100644 index 000000000..39cf05eba --- /dev/null +++ b/src/core/hle/service/pcie/pcie.cpp | |||
| @@ -0,0 +1,64 @@ | |||
| 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/pcie/pcie.h" | ||
| 8 | #include "core/hle/service/service.h" | ||
| 9 | #include "core/hle/service/sm/sm.h" | ||
| 10 | |||
| 11 | namespace Service::PCIe { | ||
| 12 | |||
| 13 | class ISession final : public ServiceFramework<ISession> { | ||
| 14 | public: | ||
| 15 | explicit ISession() : ServiceFramework{"ISession"} { | ||
| 16 | // clang-format off | ||
| 17 | static const FunctionInfo functions[] = { | ||
| 18 | {0, nullptr, "QueryFunctions"}, | ||
| 19 | {1, nullptr, "AcquireFunction"}, | ||
| 20 | {2, nullptr, "ReleaseFunction"}, | ||
| 21 | {3, nullptr, "GetFunctionState"}, | ||
| 22 | {4, nullptr, "GetBarProfile"}, | ||
| 23 | {5, nullptr, "ReadConfig"}, | ||
| 24 | {6, nullptr, "WriteConfig"}, | ||
| 25 | {7, nullptr, "ReadBarRegion"}, | ||
| 26 | {8, nullptr, "WriteBarRegion"}, | ||
| 27 | {9, nullptr, "FindCapability"}, | ||
| 28 | {10, nullptr, "FindExtendedCapability"}, | ||
| 29 | {11, nullptr, "MapDma"}, | ||
| 30 | {12, nullptr, "UnmapDma"}, | ||
| 31 | {13, nullptr, "UnmapDmaBusAddress"}, | ||
| 32 | {14, nullptr, "GetDmaBusAddress"}, | ||
| 33 | {15, nullptr, "GetDmaBusAddressRange"}, | ||
| 34 | {16, nullptr, "SetDmaEnable"}, | ||
| 35 | {17, nullptr, "AcquireIrq"}, | ||
| 36 | {18, nullptr, "ReleaseIrq"}, | ||
| 37 | {19, nullptr, "SetIrqEnable"}, | ||
| 38 | {20, nullptr, "SetAspmEnable"}, | ||
| 39 | }; | ||
| 40 | // clang-format on | ||
| 41 | |||
| 42 | RegisterHandlers(functions); | ||
| 43 | } | ||
| 44 | }; | ||
| 45 | |||
| 46 | class PCIe final : public ServiceFramework<PCIe> { | ||
| 47 | public: | ||
| 48 | explicit PCIe() : ServiceFramework{"pcie"} { | ||
| 49 | // clang-format off | ||
| 50 | static const FunctionInfo functions[] = { | ||
| 51 | {0, nullptr, "RegisterClassDriver"}, | ||
| 52 | {1, nullptr, "QueryFunctionsUnregistered"}, | ||
| 53 | }; | ||
| 54 | // clang-format on | ||
| 55 | |||
| 56 | RegisterHandlers(functions); | ||
| 57 | } | ||
| 58 | }; | ||
| 59 | |||
| 60 | void InstallInterfaces(SM::ServiceManager& sm) { | ||
| 61 | std::make_shared<PCIe>()->InstallAsService(sm); | ||
| 62 | } | ||
| 63 | |||
| 64 | } // namespace Service::PCIe | ||
diff --git a/src/core/hle/service/pcie/pcie.h b/src/core/hle/service/pcie/pcie.h new file mode 100644 index 000000000..59c22ca45 --- /dev/null +++ b/src/core/hle/service/pcie/pcie.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::PCIe { | ||
| 12 | |||
| 13 | void InstallInterfaces(SM::ServiceManager& sm); | ||
| 14 | |||
| 15 | } // namespace Service::PCIe | ||