Browse Source
Merge pull request #55 from bunnei/subv-improvements
Merge pull request #55 from bunnei/subv-improvements
Improvements to IPC, AppletOE, APM, VI, SVCpull/15/merge
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 381 additions and 216 deletions
-
4src/core/CMakeLists.txt
-
22src/core/hle/ipc_helpers.h
-
8src/core/hle/kernel/hle_ipc.h
-
27src/core/hle/kernel/svc.cpp
-
1src/core/hle/kernel/svc.h
-
67src/core/hle/service/am/applet_oe.cpp
-
44src/core/hle/service/apm/apm.cpp
-
8src/core/hle/service/apm/apm.h
-
4src/core/hle/service/nvdrv/devices/nvdevice.h
-
4src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
-
4src/core/hle/service/nvdrv/devices/nvdisp_disp0.h
-
4src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
-
4src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h
-
4src/core/hle/service/nvdrv/devices/nvmap.cpp
-
4src/core/hle/service/nvdrv/devices/nvmap.h
-
41src/core/hle/service/nvdrv/interface.cpp
-
29src/core/hle/service/nvdrv/interface.h
-
47src/core/hle/service/nvdrv/nvdrv.cpp
-
124src/core/hle/service/nvdrv/nvdrv.h
-
51src/core/hle/service/nvdrv/nvdrv_a.h
-
2src/core/hle/service/service.cpp
-
85src/core/hle/service/vi/vi.cpp
-
9src/core/hle/service/vi/vi.h
@ -0,0 +1,29 @@ |
|||
// Copyright 2018 yuzu emulator team |
|||
// Licensed under GPLv2 or any later version |
|||
// Refer to the license.txt file included. |
|||
|
|||
#pragma once |
|||
|
|||
#include <memory> |
|||
#include <string> |
|||
#include "core/hle/service/nvdrv/nvdrv.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service { |
|||
namespace Nvidia { |
|||
|
|||
class NVDRV final : public ServiceFramework<NVDRV> { |
|||
public: |
|||
NVDRV(std::shared_ptr<Module> nvdrv, const char* name); |
|||
~NVDRV() = default; |
|||
|
|||
private: |
|||
void Open(Kernel::HLERequestContext& ctx); |
|||
void Ioctl(Kernel::HLERequestContext& ctx); |
|||
void Initialize(Kernel::HLERequestContext& ctx); |
|||
|
|||
std::shared_ptr<Module> nvdrv; |
|||
}; |
|||
|
|||
} // namespace Nvidia |
|||
} // namespace Service |
|||
@ -1,51 +0,0 @@ |
|||
// Copyright 2018 yuzu emulator team |
|||
// Licensed under GPLv2 or any later version |
|||
// Refer to the license.txt file included. |
|||
|
|||
#pragma once |
|||
|
|||
#include <memory> |
|||
#include <string> |
|||
#include "core/hle/service/nvdrv/nvdrv.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service { |
|||
namespace NVDRV { |
|||
|
|||
namespace Devices { |
|||
class nvdevice; |
|||
} |
|||
|
|||
class NVDRV_A final : public ServiceFramework<NVDRV_A> { |
|||
public: |
|||
NVDRV_A(); |
|||
~NVDRV_A() = default; |
|||
|
|||
/// Returns a pointer to one of the available devices, identified by its name. |
|||
template <typename T> |
|||
std::shared_ptr<T> GetDevice(std::string name) { |
|||
auto itr = devices.find(name); |
|||
if (itr == devices.end()) |
|||
return nullptr; |
|||
return std::static_pointer_cast<T>(itr->second); |
|||
} |
|||
|
|||
private: |
|||
void Open(Kernel::HLERequestContext& ctx); |
|||
void Ioctl(Kernel::HLERequestContext& ctx); |
|||
void Initialize(Kernel::HLERequestContext& ctx); |
|||
|
|||
/// Id to use for the next open file descriptor. |
|||
u32 next_fd = 1; |
|||
|
|||
/// Mapping of file descriptors to the devices they reference. |
|||
std::unordered_map<u32, std::shared_ptr<Devices::nvdevice>> open_files; |
|||
|
|||
/// Mapping of device node names to their implementation. |
|||
std::unordered_map<std::string, std::shared_ptr<Devices::nvdevice>> devices; |
|||
}; |
|||
|
|||
extern std::weak_ptr<NVDRV_A> nvdrv_a; |
|||
|
|||
} // namespace NVDRV |
|||
} // namespace Service |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue