summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic.cpp16
-rw-r--r--src/core/hle/service/pcie/pcie.cpp64
-rw-r--r--src/core/hle/service/pcie/pcie.h15
-rw-r--r--src/core/hle/service/service.cpp2
7 files changed, 92 insertions, 9 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 55de535c0..b8f7f473d 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -185,6 +185,7 @@ void FileBackend::Write(const Entry& entry) {
185 SUB(Service, NIFM) \ 185 SUB(Service, NIFM) \
186 SUB(Service, NS) \ 186 SUB(Service, NS) \
187 SUB(Service, NVDRV) \ 187 SUB(Service, NVDRV) \
188 SUB(Service, PCIE) \
188 SUB(Service, PCTL) \ 189 SUB(Service, PCTL) \
189 SUB(Service, PREPO) \ 190 SUB(Service, PREPO) \
190 SUB(Service, SET) \ 191 SUB(Service, SET) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index e8d98de99..e770f660b 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -72,6 +72,7 @@ enum class Class : ClassType {
72 Service_NIFM, ///< The NIFM (Network interface) service 72 Service_NIFM, ///< The NIFM (Network interface) service
73 Service_NS, ///< The NS services 73 Service_NS, ///< The NS services
74 Service_NVDRV, ///< The NVDRV (Nvidia driver) service 74 Service_NVDRV, ///< The NVDRV (Nvidia driver) service
75 Service_PCIE, ///< The PCIe service
75 Service_PCTL, ///< The PCTL (Parental control) service 76 Service_PCTL, ///< The PCTL (Parental control) service
76 Service_PREPO, ///< The PREPO (Play report) service 77 Service_PREPO, ///< The PREPO (Play report) service
77 Service_SET, ///< The SET (Settings) service 78 Service_SET, ///< The SET (Settings) service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 91abb0020..3a72d99e7 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -231,6 +231,8 @@ add_library(core STATIC
231 hle/service/nvflinger/buffer_queue.h 231 hle/service/nvflinger/buffer_queue.h
232 hle/service/nvflinger/nvflinger.cpp 232 hle/service/nvflinger/nvflinger.cpp
233 hle/service/nvflinger/nvflinger.h 233 hle/service/nvflinger/nvflinger.h
234 hle/service/pcie/pcie.cpp
235 hle/service/pcie/pcie.h
234 hle/service/pctl/module.cpp 236 hle/service/pctl/module.cpp
235 hle/service/pctl/module.h 237 hle/service/pctl/module.h
236 hle/service/pctl/pctl.cpp 238 hle/service/pctl/pctl.cpp
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp
index 57b8634b9..1d8c15d97 100644
--- a/src/core/arm/dynarmic/arm_dynarmic.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic.cpp
@@ -139,14 +139,12 @@ void ARM_Dynarmic::Step() {
139} 139}
140 140
141ARM_Dynarmic::ARM_Dynarmic(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, size_t core_index) 141ARM_Dynarmic::ARM_Dynarmic(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, size_t core_index)
142 : cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), 142 : cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), core_index{core_index},
143 jit(MakeJit()), exclusive_monitor{std::dynamic_pointer_cast<DynarmicExclusiveMonitor>( 143 exclusive_monitor{std::dynamic_pointer_cast<DynarmicExclusiveMonitor>(exclusive_monitor)} {
144 exclusive_monitor)}, 144 ThreadContext ctx;
145 core_index{core_index} {
146 ARM_Interface::ThreadContext ctx;
147 inner_unicorn.SaveContext(ctx); 145 inner_unicorn.SaveContext(ctx);
148 LoadContext(ctx);
149 PageTableChanged(); 146 PageTableChanged();
147 LoadContext(ctx);
150} 148}
151 149
152ARM_Dynarmic::~ARM_Dynarmic() = default; 150ARM_Dynarmic::~ARM_Dynarmic() = default;
@@ -205,7 +203,7 @@ u64 ARM_Dynarmic::GetTlsAddress() const {
205 return cb->tpidrro_el0; 203 return cb->tpidrro_el0;
206} 204}
207 205
208void ARM_Dynarmic::SetTlsAddress(u64 address) { 206void ARM_Dynarmic::SetTlsAddress(VAddr address) {
209 cb->tpidrro_el0 = address; 207 cb->tpidrro_el0 = address;
210} 208}
211 209
@@ -217,7 +215,7 @@ void ARM_Dynarmic::SetTPIDR_EL0(u64 value) {
217 cb->tpidr_el0 = value; 215 cb->tpidr_el0 = value;
218} 216}
219 217
220void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) { 218void ARM_Dynarmic::SaveContext(ThreadContext& ctx) {
221 ctx.cpu_registers = jit->GetRegisters(); 219 ctx.cpu_registers = jit->GetRegisters();
222 ctx.sp = jit->GetSP(); 220 ctx.sp = jit->GetSP();
223 ctx.pc = jit->GetPC(); 221 ctx.pc = jit->GetPC();
@@ -226,7 +224,7 @@ void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) {
226 ctx.fpscr = jit->GetFpcr(); 224 ctx.fpscr = jit->GetFpcr();
227} 225}
228 226
229void ARM_Dynarmic::LoadContext(const ARM_Interface::ThreadContext& ctx) { 227void ARM_Dynarmic::LoadContext(const ThreadContext& ctx) {
230 jit->SetRegisters(ctx.cpu_registers); 228 jit->SetRegisters(ctx.cpu_registers);
231 jit->SetSP(ctx.sp); 229 jit->SetSP(ctx.sp);
232 jit->SetPC(ctx.pc); 230 jit->SetPC(ctx.pc);
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
11namespace Service::PCIe {
12
13class ISession final : public ServiceFramework<ISession> {
14public:
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
46class PCIe final : public ServiceFramework<PCIe> {
47public:
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
60void 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
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::PCIe {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::PCIe
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 3cad64837..bbaf7f601 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -44,6 +44,7 @@
44#include "core/hle/service/nim/nim.h" 44#include "core/hle/service/nim/nim.h"
45#include "core/hle/service/ns/ns.h" 45#include "core/hle/service/ns/ns.h"
46#include "core/hle/service/nvdrv/nvdrv.h" 46#include "core/hle/service/nvdrv/nvdrv.h"
47#include "core/hle/service/pcie/pcie.h"
47#include "core/hle/service/pctl/pctl.h" 48#include "core/hle/service/pctl/pctl.h"
48#include "core/hle/service/pm/pm.h" 49#include "core/hle/service/pm/pm.h"
49#include "core/hle/service/prepo/prepo.h" 50#include "core/hle/service/prepo/prepo.h"
@@ -225,6 +226,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
225 NIM::InstallInterfaces(*sm); 226 NIM::InstallInterfaces(*sm);
226 NS::InstallInterfaces(*sm); 227 NS::InstallInterfaces(*sm);
227 Nvidia::InstallInterfaces(*sm); 228 Nvidia::InstallInterfaces(*sm);
229 PCIe::InstallInterfaces(*sm);
228 PCTL::InstallInterfaces(*sm); 230 PCTL::InstallInterfaces(*sm);
229 PlayReport::InstallInterfaces(*sm); 231 PlayReport::InstallInterfaces(*sm);
230 PM::InstallInterfaces(*sm); 232 PM::InstallInterfaces(*sm);