diff options
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 8 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.h | 13 | ||||
| -rw-r--r-- | src/core/hle/service/kernel_helpers.cpp | 64 | ||||
| -rw-r--r-- | src/core/hle/service/kernel_helpers.h | 35 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/nvdrv.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/nvdrv.h | 3 | ||||
| -rw-r--r-- | src/core/hle/service/service.h | 5 |
10 files changed, 146 insertions, 20 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c7b899131..5c99c00f5 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -517,6 +517,8 @@ add_library(core STATIC | |||
| 517 | hle/service/psc/psc.h | 517 | hle/service/psc/psc.h |
| 518 | hle/service/ptm/psm.cpp | 518 | hle/service/ptm/psm.cpp |
| 519 | hle/service/ptm/psm.h | 519 | hle/service/ptm/psm.h |
| 520 | hle/service/kernel_helpers.cpp | ||
| 521 | hle/service/kernel_helpers.h | ||
| 520 | hle/service/service.cpp | 522 | hle/service/service.cpp |
| 521 | hle/service/service.h | 523 | hle/service/service.h |
| 522 | hle/service/set/set.cpp | 524 | hle/service/set/set.cpp |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 6ce1360e3..95d4f9588 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include "core/hle/kernel/k_writable_event.h" | 18 | #include "core/hle/kernel/k_writable_event.h" |
| 19 | #include "core/hle/kernel/kernel.h" | 19 | #include "core/hle/kernel/kernel.h" |
| 20 | #include "core/hle/service/hid/controllers/npad.h" | 20 | #include "core/hle/service/hid/controllers/npad.h" |
| 21 | #include "core/hle/service/kernel_helpers.h" | ||
| 21 | 22 | ||
| 22 | namespace Service::HID { | 23 | namespace Service::HID { |
| 23 | constexpr s32 HID_JOYSTICK_MAX = 0x7fff; | 24 | constexpr s32 HID_JOYSTICK_MAX = 0x7fff; |
| @@ -147,7 +148,9 @@ bool Controller_NPad::IsDeviceHandleValid(const DeviceHandle& device_handle) { | |||
| 147 | device_handle.device_index < DeviceIndex::MaxDeviceIndex; | 148 | device_handle.device_index < DeviceIndex::MaxDeviceIndex; |
| 148 | } | 149 | } |
| 149 | 150 | ||
| 150 | Controller_NPad::Controller_NPad(Core::System& system_) : ControllerBase{system_} { | 151 | Controller_NPad::Controller_NPad(Core::System& system_, |
| 152 | KernelHelpers::ServiceContext& service_context_) | ||
| 153 | : ControllerBase{system_}, service_context{service_context_} { | ||
| 151 | latest_vibration_values.fill({DEFAULT_VIBRATION_VALUE, DEFAULT_VIBRATION_VALUE}); | 154 | latest_vibration_values.fill({DEFAULT_VIBRATION_VALUE, DEFAULT_VIBRATION_VALUE}); |
| 152 | } | 155 | } |
| 153 | 156 | ||
| @@ -253,8 +256,8 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) { | |||
| 253 | void Controller_NPad::OnInit() { | 256 | void Controller_NPad::OnInit() { |
| 254 | auto& kernel = system.Kernel(); | 257 | auto& kernel = system.Kernel(); |
| 255 | for (std::size_t i = 0; i < styleset_changed_events.size(); ++i) { | 258 | for (std::size_t i = 0; i < styleset_changed_events.size(); ++i) { |
| 256 | styleset_changed_events[i] = Kernel::KEvent::Create(kernel); | 259 | styleset_changed_events[i] = |
| 257 | styleset_changed_events[i]->Initialize(fmt::format("npad:NpadStyleSetChanged_{}", i)); | 260 | service_context.CreateEvent(fmt::format("npad:NpadStyleSetChanged_{}", i)); |
| 258 | } | 261 | } |
| 259 | 262 | ||
| 260 | if (!IsControllerActivated()) { | 263 | if (!IsControllerActivated()) { |
| @@ -344,8 +347,7 @@ void Controller_NPad::OnRelease() { | |||
| 344 | } | 347 | } |
| 345 | 348 | ||
| 346 | for (std::size_t i = 0; i < styleset_changed_events.size(); ++i) { | 349 | for (std::size_t i = 0; i < styleset_changed_events.size(); ++i) { |
| 347 | styleset_changed_events[i]->Close(); | 350 | service_context.CloseEvent(styleset_changed_events[i]); |
| 348 | styleset_changed_events[i] = nullptr; | ||
| 349 | } | 351 | } |
| 350 | } | 352 | } |
| 351 | 353 | ||
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 1409d82a2..4fcc6f93a 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h | |||
| @@ -20,6 +20,10 @@ class KEvent; | |||
| 20 | class KReadableEvent; | 20 | class KReadableEvent; |
| 21 | } // namespace Kernel | 21 | } // namespace Kernel |
| 22 | 22 | ||
| 23 | namespace Service::KernelHelpers { | ||
| 24 | class ServiceContext; | ||
| 25 | } | ||
| 26 | |||
| 23 | namespace Service::HID { | 27 | namespace Service::HID { |
| 24 | 28 | ||
| 25 | constexpr u32 NPAD_HANDHELD = 32; | 29 | constexpr u32 NPAD_HANDHELD = 32; |
| @@ -27,7 +31,8 @@ constexpr u32 NPAD_UNKNOWN = 16; // TODO(ogniK): What is this? | |||
| 27 | 31 | ||
| 28 | class Controller_NPad final : public ControllerBase { | 32 | class Controller_NPad final : public ControllerBase { |
| 29 | public: | 33 | public: |
| 30 | explicit Controller_NPad(Core::System& system_); | 34 | explicit Controller_NPad(Core::System& system_, |
| 35 | KernelHelpers::ServiceContext& service_context_); | ||
| 31 | ~Controller_NPad() override; | 36 | ~Controller_NPad() override; |
| 32 | 37 | ||
| 33 | // Called when the controller is initialized | 38 | // Called when the controller is initialized |
| @@ -566,6 +571,7 @@ private: | |||
| 566 | std::array<std::unique_ptr<Input::MotionDevice>, Settings::NativeMotion::NUM_MOTIONS_HID>, | 571 | std::array<std::unique_ptr<Input::MotionDevice>, Settings::NativeMotion::NUM_MOTIONS_HID>, |
| 567 | 10>; | 572 | 10>; |
| 568 | 573 | ||
| 574 | KernelHelpers::ServiceContext& service_context; | ||
| 569 | std::mutex mutex; | 575 | std::mutex mutex; |
| 570 | ButtonArray buttons; | 576 | ButtonArray buttons; |
| 571 | StickArray sticks; | 577 | StickArray sticks; |
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index d68b023d0..b8b80570d 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -46,8 +46,9 @@ constexpr auto pad_update_ns = std::chrono::nanoseconds{1000 * 1000}; // | |||
| 46 | constexpr auto motion_update_ns = std::chrono::nanoseconds{15 * 1000 * 1000}; // (15ms, 66.666Hz) | 46 | constexpr auto motion_update_ns = std::chrono::nanoseconds{15 * 1000 * 1000}; // (15ms, 66.666Hz) |
| 47 | constexpr std::size_t SHARED_MEMORY_SIZE = 0x40000; | 47 | constexpr std::size_t SHARED_MEMORY_SIZE = 0x40000; |
| 48 | 48 | ||
| 49 | IAppletResource::IAppletResource(Core::System& system_) | 49 | IAppletResource::IAppletResource(Core::System& system_, |
| 50 | : ServiceFramework{system_, "IAppletResource"} { | 50 | KernelHelpers::ServiceContext& service_context_) |
| 51 | : ServiceFramework{system_, "IAppletResource"}, service_context{service_context_} { | ||
| 51 | static const FunctionInfo functions[] = { | 52 | static const FunctionInfo functions[] = { |
| 52 | {0, &IAppletResource::GetSharedMemoryHandle, "GetSharedMemoryHandle"}, | 53 | {0, &IAppletResource::GetSharedMemoryHandle, "GetSharedMemoryHandle"}, |
| 53 | }; | 54 | }; |
| @@ -63,7 +64,7 @@ IAppletResource::IAppletResource(Core::System& system_) | |||
| 63 | MakeController<Controller_Stubbed>(HidController::CaptureButton); | 64 | MakeController<Controller_Stubbed>(HidController::CaptureButton); |
| 64 | MakeController<Controller_Stubbed>(HidController::InputDetector); | 65 | MakeController<Controller_Stubbed>(HidController::InputDetector); |
| 65 | MakeController<Controller_Stubbed>(HidController::UniquePad); | 66 | MakeController<Controller_Stubbed>(HidController::UniquePad); |
| 66 | MakeController<Controller_NPad>(HidController::NPad); | 67 | MakeControllerWithServiceContext<Controller_NPad>(HidController::NPad); |
| 67 | MakeController<Controller_Gesture>(HidController::Gesture); | 68 | MakeController<Controller_Gesture>(HidController::Gesture); |
| 68 | MakeController<Controller_ConsoleSixAxis>(HidController::ConsoleSixAxisSensor); | 69 | MakeController<Controller_ConsoleSixAxis>(HidController::ConsoleSixAxisSensor); |
| 69 | 70 | ||
| @@ -191,13 +192,14 @@ private: | |||
| 191 | 192 | ||
| 192 | std::shared_ptr<IAppletResource> Hid::GetAppletResource() { | 193 | std::shared_ptr<IAppletResource> Hid::GetAppletResource() { |
| 193 | if (applet_resource == nullptr) { | 194 | if (applet_resource == nullptr) { |
| 194 | applet_resource = std::make_shared<IAppletResource>(system); | 195 | applet_resource = std::make_shared<IAppletResource>(system, service_context); |
| 195 | } | 196 | } |
| 196 | 197 | ||
| 197 | return applet_resource; | 198 | return applet_resource; |
| 198 | } | 199 | } |
| 199 | 200 | ||
| 200 | Hid::Hid(Core::System& system_) : ServiceFramework{system_, "hid"} { | 201 | Hid::Hid(Core::System& system_) |
| 202 | : ServiceFramework{system_, "hid"}, service_context{system_, service_name} { | ||
| 201 | // clang-format off | 203 | // clang-format off |
| 202 | static const FunctionInfo functions[] = { | 204 | static const FunctionInfo functions[] = { |
| 203 | {0, &Hid::CreateAppletResource, "CreateAppletResource"}, | 205 | {0, &Hid::CreateAppletResource, "CreateAppletResource"}, |
| @@ -347,7 +349,7 @@ void Hid::CreateAppletResource(Kernel::HLERequestContext& ctx) { | |||
| 347 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); | 349 | LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); |
| 348 | 350 | ||
| 349 | if (applet_resource == nullptr) { | 351 | if (applet_resource == nullptr) { |
| 350 | applet_resource = std::make_shared<IAppletResource>(system); | 352 | applet_resource = std::make_shared<IAppletResource>(system, service_context); |
| 351 | } | 353 | } |
| 352 | 354 | ||
| 353 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 355 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index 83fc2ea1d..9c5c7f252 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <chrono> | 7 | #include <chrono> |
| 8 | 8 | ||
| 9 | #include "core/hle/service/hid/controllers/controller_base.h" | 9 | #include "core/hle/service/hid/controllers/controller_base.h" |
| 10 | #include "core/hle/service/kernel_helpers.h" | ||
| 10 | #include "core/hle/service/service.h" | 11 | #include "core/hle/service/service.h" |
| 11 | 12 | ||
| 12 | namespace Core::Timing { | 13 | namespace Core::Timing { |
| @@ -39,7 +40,8 @@ enum class HidController : std::size_t { | |||
| 39 | 40 | ||
| 40 | class IAppletResource final : public ServiceFramework<IAppletResource> { | 41 | class IAppletResource final : public ServiceFramework<IAppletResource> { |
| 41 | public: | 42 | public: |
| 42 | explicit IAppletResource(Core::System& system_); | 43 | explicit IAppletResource(Core::System& system_, |
| 44 | KernelHelpers::ServiceContext& service_context_); | ||
| 43 | ~IAppletResource() override; | 45 | ~IAppletResource() override; |
| 44 | 46 | ||
| 45 | void ActivateController(HidController controller); | 47 | void ActivateController(HidController controller); |
| @@ -60,11 +62,18 @@ private: | |||
| 60 | void MakeController(HidController controller) { | 62 | void MakeController(HidController controller) { |
| 61 | controllers[static_cast<std::size_t>(controller)] = std::make_unique<T>(system); | 63 | controllers[static_cast<std::size_t>(controller)] = std::make_unique<T>(system); |
| 62 | } | 64 | } |
| 65 | template <typename T> | ||
| 66 | void MakeControllerWithServiceContext(HidController controller) { | ||
| 67 | controllers[static_cast<std::size_t>(controller)] = | ||
| 68 | std::make_unique<T>(system, service_context); | ||
| 69 | } | ||
| 63 | 70 | ||
| 64 | void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx); | 71 | void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx); |
| 65 | void UpdateControllers(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); | 72 | void UpdateControllers(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); |
| 66 | void UpdateMotion(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); | 73 | void UpdateMotion(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); |
| 67 | 74 | ||
| 75 | KernelHelpers::ServiceContext& service_context; | ||
| 76 | |||
| 68 | std::shared_ptr<Core::Timing::EventType> pad_update_event; | 77 | std::shared_ptr<Core::Timing::EventType> pad_update_event; |
| 69 | std::shared_ptr<Core::Timing::EventType> motion_update_event; | 78 | std::shared_ptr<Core::Timing::EventType> motion_update_event; |
| 70 | 79 | ||
| @@ -176,6 +185,8 @@ private: | |||
| 176 | static_assert(sizeof(VibrationDeviceInfo) == 0x8, "VibrationDeviceInfo has incorrect size."); | 185 | static_assert(sizeof(VibrationDeviceInfo) == 0x8, "VibrationDeviceInfo has incorrect size."); |
| 177 | 186 | ||
| 178 | std::shared_ptr<IAppletResource> applet_resource; | 187 | std::shared_ptr<IAppletResource> applet_resource; |
| 188 | |||
| 189 | KernelHelpers::ServiceContext service_context; | ||
| 179 | }; | 190 | }; |
| 180 | 191 | ||
| 181 | /// Reload input devices. Used when input configuration changed | 192 | /// Reload input devices. Used when input configuration changed |
diff --git a/src/core/hle/service/kernel_helpers.cpp b/src/core/hle/service/kernel_helpers.cpp new file mode 100644 index 000000000..895294c9f --- /dev/null +++ b/src/core/hle/service/kernel_helpers.cpp | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | // Copyright 2021 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 | #include "core/core.h" | ||
| 8 | #include "core/hle/kernel/k_event.h" | ||
| 9 | #include "core/hle/kernel/k_process.h" | ||
| 10 | #include "core/hle/kernel/k_readable_event.h" | ||
| 11 | #include "core/hle/kernel/k_resource_limit.h" | ||
| 12 | #include "core/hle/kernel/k_scoped_resource_reservation.h" | ||
| 13 | #include "core/hle/kernel/k_writable_event.h" | ||
| 14 | #include "core/hle/service/kernel_helpers.h" | ||
| 15 | |||
| 16 | namespace Service::KernelHelpers { | ||
| 17 | |||
| 18 | ServiceContext::ServiceContext(Core::System& system_, std::string name_) | ||
| 19 | : kernel(system_.Kernel()) { | ||
| 20 | process = Kernel::KProcess::Create(kernel); | ||
| 21 | ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_), | ||
| 22 | Kernel::KProcess::ProcessType::Userland) | ||
| 23 | .IsSuccess()); | ||
| 24 | } | ||
| 25 | |||
| 26 | ServiceContext::~ServiceContext() { | ||
| 27 | process->Close(); | ||
| 28 | process = nullptr; | ||
| 29 | } | ||
| 30 | |||
| 31 | Kernel::KEvent* ServiceContext::CreateEvent(std::string&& name) { | ||
| 32 | // Reserve a new event from the process resource limit | ||
| 33 | Kernel::KScopedResourceReservation event_reservation(process, | ||
| 34 | Kernel::LimitableResource::Events); | ||
| 35 | if (!event_reservation.Succeeded()) { | ||
| 36 | LOG_CRITICAL(Service, "Resource limit reached!"); | ||
| 37 | return {}; | ||
| 38 | } | ||
| 39 | |||
| 40 | // Create a new event. | ||
| 41 | auto* event = Kernel::KEvent::Create(kernel); | ||
| 42 | if (!event) { | ||
| 43 | LOG_CRITICAL(Service, "Unable to create event!"); | ||
| 44 | return {}; | ||
| 45 | } | ||
| 46 | |||
| 47 | // Initialize the event. | ||
| 48 | event->Initialize(std::move(name)); | ||
| 49 | |||
| 50 | // Commit the thread reservation. | ||
| 51 | event_reservation.Commit(); | ||
| 52 | |||
| 53 | // Register the event. | ||
| 54 | Kernel::KEvent::Register(kernel, event); | ||
| 55 | |||
| 56 | return event; | ||
| 57 | } | ||
| 58 | |||
| 59 | void ServiceContext::CloseEvent(Kernel::KEvent* event) { | ||
| 60 | event->GetReadableEvent().Close(); | ||
| 61 | event->GetWritableEvent().Close(); | ||
| 62 | } | ||
| 63 | |||
| 64 | } // namespace Service::KernelHelpers | ||
diff --git a/src/core/hle/service/kernel_helpers.h b/src/core/hle/service/kernel_helpers.h new file mode 100644 index 000000000..4f3e95f67 --- /dev/null +++ b/src/core/hle/service/kernel_helpers.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | // Copyright 2021 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 | #include <string> | ||
| 8 | |||
| 9 | namespace Core { | ||
| 10 | class System; | ||
| 11 | } | ||
| 12 | |||
| 13 | namespace Kernel { | ||
| 14 | class KernelCore; | ||
| 15 | class KEvent; | ||
| 16 | class KProcess; | ||
| 17 | } // namespace Kernel | ||
| 18 | |||
| 19 | namespace Service::KernelHelpers { | ||
| 20 | |||
| 21 | class ServiceContext { | ||
| 22 | public: | ||
| 23 | ServiceContext(Core::System& system_, std::string name_); | ||
| 24 | ~ServiceContext(); | ||
| 25 | |||
| 26 | Kernel::KEvent* CreateEvent(std::string&& name); | ||
| 27 | |||
| 28 | void CloseEvent(Kernel::KEvent* event); | ||
| 29 | |||
| 30 | private: | ||
| 31 | Kernel::KernelCore& kernel; | ||
| 32 | Kernel::KProcess* process{}; | ||
| 33 | }; | ||
| 34 | |||
| 35 | } // namespace Service::KernelHelpers | ||
diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index 03992af5e..5600ea126 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp | |||
| @@ -39,11 +39,12 @@ void InstallInterfaces(SM::ServiceManager& service_manager, NVFlinger::NVFlinger | |||
| 39 | nvflinger.SetNVDrvInstance(module_); | 39 | nvflinger.SetNVDrvInstance(module_); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | Module::Module(Core::System& system) : syncpoint_manager{system.GPU()} { | 42 | Module::Module(Core::System& system) |
| 43 | : syncpoint_manager{system.GPU()}, service_context{system, "nvdrv"} { | ||
| 43 | auto& kernel = system.Kernel(); | 44 | auto& kernel = system.Kernel(); |
| 44 | for (u32 i = 0; i < MaxNvEvents; i++) { | 45 | for (u32 i = 0; i < MaxNvEvents; i++) { |
| 45 | events_interface.events[i].event = Kernel::KEvent::Create(kernel); | 46 | events_interface.events[i].event = |
| 46 | events_interface.events[i].event->Initialize(fmt::format("NVDRV::NvEvent_{}", i)); | 47 | service_context.CreateEvent(fmt::format("NVDRV::NvEvent_{}", i)); |
| 47 | events_interface.status[i] = EventState::Free; | 48 | events_interface.status[i] = EventState::Free; |
| 48 | events_interface.registered[i] = false; | 49 | events_interface.registered[i] = false; |
| 49 | } | 50 | } |
| @@ -65,8 +66,7 @@ Module::Module(Core::System& system) : syncpoint_manager{system.GPU()} { | |||
| 65 | 66 | ||
| 66 | Module::~Module() { | 67 | Module::~Module() { |
| 67 | for (u32 i = 0; i < MaxNvEvents; i++) { | 68 | for (u32 i = 0; i < MaxNvEvents; i++) { |
| 68 | events_interface.events[i].event->Close(); | 69 | service_context.CloseEvent(events_interface.events[i].event); |
| 69 | events_interface.events[i].event = nullptr; | ||
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | 72 | ||
diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h index a43ceb7ae..e2a1dde5b 100644 --- a/src/core/hle/service/nvdrv/nvdrv.h +++ b/src/core/hle/service/nvdrv/nvdrv.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <vector> | 9 | #include <vector> |
| 10 | 10 | ||
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "core/hle/service/kernel_helpers.h" | ||
| 12 | #include "core/hle/service/nvdrv/nvdata.h" | 13 | #include "core/hle/service/nvdrv/nvdata.h" |
| 13 | #include "core/hle/service/nvdrv/syncpoint_manager.h" | 14 | #include "core/hle/service/nvdrv/syncpoint_manager.h" |
| 14 | #include "core/hle/service/service.h" | 15 | #include "core/hle/service/service.h" |
| @@ -154,6 +155,8 @@ private: | |||
| 154 | std::unordered_map<std::string, std::shared_ptr<Devices::nvdevice>> devices; | 155 | std::unordered_map<std::string, std::shared_ptr<Devices::nvdevice>> devices; |
| 155 | 156 | ||
| 156 | EventInterface events_interface; | 157 | EventInterface events_interface; |
| 158 | |||
| 159 | KernelHelpers::ServiceContext service_context; | ||
| 157 | }; | 160 | }; |
| 158 | 161 | ||
| 159 | /// Registers all NVDRV services with the specified service manager. | 162 | /// Registers all NVDRV services with the specified service manager. |
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index e078ac176..632ce9252 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h | |||
| @@ -96,6 +96,9 @@ protected: | |||
| 96 | /// System context that the service operates under. | 96 | /// System context that the service operates under. |
| 97 | Core::System& system; | 97 | Core::System& system; |
| 98 | 98 | ||
| 99 | /// Identifier string used to connect to the service. | ||
| 100 | std::string service_name; | ||
| 101 | |||
| 99 | private: | 102 | private: |
| 100 | template <typename T> | 103 | template <typename T> |
| 101 | friend class ServiceFramework; | 104 | friend class ServiceFramework; |
| @@ -117,8 +120,6 @@ private: | |||
| 117 | void RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n); | 120 | void RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n); |
| 118 | void ReportUnimplementedFunction(Kernel::HLERequestContext& ctx, const FunctionInfoBase* info); | 121 | void ReportUnimplementedFunction(Kernel::HLERequestContext& ctx, const FunctionInfoBase* info); |
| 119 | 122 | ||
| 120 | /// Identifier string used to connect to the service. | ||
| 121 | std::string service_name; | ||
| 122 | /// Maximum number of concurrent sessions that this service can handle. | 123 | /// Maximum number of concurrent sessions that this service can handle. |
| 123 | u32 max_sessions; | 124 | u32 max_sessions; |
| 124 | 125 | ||