summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/pcie/pcie.cpp
blob: 39cf05eba2d465999c66f6b78f792fb8ecf51618 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#include <memory>

#include "core/hle/service/pcie/pcie.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"

namespace Service::PCIe {

class ISession final : public ServiceFramework<ISession> {
public:
    explicit ISession() : ServiceFramework{"ISession"} {
        // clang-format off
        static const FunctionInfo functions[] = {
            {0, nullptr, "QueryFunctions"},
            {1, nullptr, "AcquireFunction"},
            {2, nullptr, "ReleaseFunction"},
            {3, nullptr, "GetFunctionState"},
            {4, nullptr, "GetBarProfile"},
            {5, nullptr, "ReadConfig"},
            {6, nullptr, "WriteConfig"},
            {7, nullptr, "ReadBarRegion"},
            {8, nullptr, "WriteBarRegion"},
            {9, nullptr, "FindCapability"},
            {10, nullptr, "FindExtendedCapability"},
            {11, nullptr, "MapDma"},
            {12, nullptr, "UnmapDma"},
            {13, nullptr, "UnmapDmaBusAddress"},
            {14, nullptr, "GetDmaBusAddress"},
            {15, nullptr, "GetDmaBusAddressRange"},
            {16, nullptr, "SetDmaEnable"},
            {17, nullptr, "AcquireIrq"},
            {18, nullptr, "ReleaseIrq"},
            {19, nullptr, "SetIrqEnable"},
            {20, nullptr, "SetAspmEnable"},
        };
        // clang-format on

        RegisterHandlers(functions);
    }
};

class PCIe final : public ServiceFramework<PCIe> {
public:
    explicit PCIe() : ServiceFramework{"pcie"} {
        // clang-format off
        static const FunctionInfo functions[] = {
            {0, nullptr, "RegisterClassDriver"},
            {1, nullptr, "QueryFunctionsUnregistered"},
        };
        // clang-format on

        RegisterHandlers(functions);
    }
};

void InstallInterfaces(SM::ServiceManager& sm) {
    std::make_shared<PCIe>()->InstallAsService(sm);
}

} // namespace Service::PCIe