Compare commits

..

2 Commits

Author SHA1 Message Date
Melissa Goad
a9571a383d fixup 2018-04-19 04:01:43 -05:00
Melissa Goad
95691e1a8d Add RGB10_A2 texture formats 2018-04-19 03:29:29 -05:00
174 changed files with 1198 additions and 1152 deletions

View File

@@ -7,7 +7,7 @@ yuzu is an experimental open-source emulator for the Nintendo Switch from the cr
It is written in C++ with portability in mind, with builds actively maintained for Windows, Linux and macOS. The emulator is currently only useful for homebrew development and research purposes.
yuzu only emulates a subset of Switch hardware and therefore is generally only useful for running/debugging homebrew applications. At this time, yuzu cannot play any commercial games without major problems. yuzu can boot some games, to varying degrees of success, but does not implement any of the necessary GPU features to render 3D graphics.
yuzu only emulates a subset of Switch hardware and therefore is generally only useful for running/debugging homebrew applications. At this time, yuzu does not run any commercial Switch games. yuzu can boot some games, to varying degrees of success, but does not implement any of the necessary GPU features to render 3D graphics.
yuzu is licensed under the GPLv2 (or any later version). Refer to the license.txt file included.

View File

@@ -34,6 +34,7 @@ add_library(common STATIC
chunk_file.h
cityhash.cpp
cityhash.h
code_block.h
color.h
common_funcs.h
common_paths.h

85
src/common/code_block.h Normal file
View File

@@ -0,0 +1,85 @@
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#pragma once
#include <cstddef>
#include "common/common_types.h"
#include "common/memory_util.h"
// Everything that needs to generate code should inherit from this.
// You get memory management for free, plus, you can use all emitter functions without
// having to prefix them with gen-> or something similar.
// Example implementation:
// class JIT : public CodeBlock<ARMXEmitter> {}
template <class T>
class CodeBlock : public T, NonCopyable {
private:
// A privately used function to set the executable RAM space to something invalid.
// For debugging usefulness it should be used to set the RAM to a host specific breakpoint
// instruction
virtual void PoisonMemory() = 0;
protected:
u8* region;
size_t region_size;
public:
CodeBlock() : region(nullptr), region_size(0) {}
virtual ~CodeBlock() {
if (region)
FreeCodeSpace();
}
// Call this before you generate any code.
void AllocCodeSpace(int size) {
region_size = size;
region = (u8*)AllocateExecutableMemory(region_size);
T::SetCodePtr(region);
}
// Always clear code space with breakpoints, so that if someone accidentally executes
// uninitialized, it just breaks into the debugger.
void ClearCodeSpace() {
PoisonMemory();
ResetCodePtr();
}
// Call this when shutting down. Don't rely on the destructor, even though it'll do the job.
void FreeCodeSpace() {
#ifdef __SYMBIAN32__
ResetExecutableMemory(region);
#else
FreeMemoryPages(region, region_size);
#endif
region = nullptr;
region_size = 0;
}
bool IsInSpace(const u8* ptr) {
return (ptr >= region) && (ptr < (region + region_size));
}
// Cannot currently be undone. Will write protect the entire code region.
// Start over if you need to change the code (call FreeCodeSpace(), AllocCodeSpace()).
void WriteProtect() {
WriteProtectMemory(region, region_size, true);
}
void ResetCodePtr() {
T::SetCodePtr(region);
}
size_t GetSpaceLeft() const {
return region_size - (T::GetCodePtr() - region);
}
u8* GetBasePtr() {
return region;
}
size_t GetOffset(const u8* ptr) const {
return ptr - region;
}
};

View File

@@ -9,6 +9,8 @@
#endif
#include "common/common_types.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
/// Textually concatenates two tokens. The double-expansion is required by the C preprocessor.
#define CONCAT2(x, y) DO_CONCAT2(x, y)
#define DO_CONCAT2(x, y) x##y
@@ -72,6 +74,11 @@ inline u64 _rotr64(u64 x, unsigned int shift) {
#else // _MSC_VER
#if (_MSC_VER < 1900)
// Function Cross-Compatibility
#define snprintf _snprintf
#endif
// Locale Cross-Compatibility
#define locale_t _locale_t

View File

@@ -27,23 +27,29 @@
#include <array>
#include <cstdint>
using u8 = std::uint8_t; ///< 8-bit unsigned byte
using u16 = std::uint16_t; ///< 16-bit unsigned short
using u32 = std::uint32_t; ///< 32-bit unsigned word
using u64 = std::uint64_t; ///< 64-bit unsigned int
#ifdef _MSC_VER
#ifndef __func__
#define __func__ __FUNCTION__
#endif
#endif
using s8 = std::int8_t; ///< 8-bit signed byte
using s16 = std::int16_t; ///< 16-bit signed short
using s32 = std::int32_t; ///< 32-bit signed word
using s64 = std::int64_t; ///< 64-bit signed int
typedef std::uint8_t u8; ///< 8-bit unsigned byte
typedef std::uint16_t u16; ///< 16-bit unsigned short
typedef std::uint32_t u32; ///< 32-bit unsigned word
typedef std::uint64_t u64; ///< 64-bit unsigned int
using f32 = float; ///< 32-bit floating point
using f64 = double; ///< 64-bit floating point
typedef std::int8_t s8; ///< 8-bit signed byte
typedef std::int16_t s16; ///< 16-bit signed short
typedef std::int32_t s32; ///< 32-bit signed word
typedef std::int64_t s64; ///< 64-bit signed int
typedef float f32; ///< 32-bit floating point
typedef double f64; ///< 64-bit floating point
// TODO: It would be nice to eventually replace these with strong types that prevent accidental
// conversion between each other.
using VAddr = u64; ///< Represents a pointer in the userspace virtual address space.
using PAddr = u64; ///< Represents a pointer in the ARM11 physical address space.
typedef u64 VAddr; ///< Represents a pointer in the userspace virtual address space.
typedef u64 PAddr; ///< Represents a pointer in the ARM11 physical address space.
using u128 = std::array<std::uint64_t, 2>;
static_assert(sizeof(u128) == 16, "u128 must be 128 bits wide");

View File

@@ -17,6 +17,11 @@ inline bool IntervalsIntersect(unsigned start0, unsigned length0, unsigned start
return (std::max(start0, start1) < std::min(start0 + length0, start1 + length1));
}
template <typename T>
inline T Clamp(const T val, const T& min, const T& max) {
return std::max(min, std::min(max, val));
}
template <class T>
struct Rectangle {
T left;

View File

@@ -11,6 +11,25 @@
#include <thread>
#include "common/common_types.h"
// Support for C++11's thread_local keyword was surprisingly spotty in compilers until very
// recently. Fortunately, thread local variables have been well supported for compilers for a while,
// but with semantics supporting only POD types, so we can use a few defines to get some amount of
// backwards compat support.
// WARNING: This only works correctly with POD types.
#if defined(__clang__)
#if !__has_feature(cxx_thread_local)
#define thread_local __thread
#endif
#elif defined(__GNUC__)
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)
#define thread_local __thread
#endif
#elif defined(_MSC_VER)
#if _MSC_VER < 1900
#define thread_local __declspec(thread)
#endif
#endif
namespace Common {
int CurrentThreadId();

View File

@@ -55,6 +55,10 @@ public:
T x;
T y;
T* AsArray() {
return &x;
}
Vec2() = default;
Vec2(const T& _x, const T& _y) : x(_x), y(_y) {}
@@ -67,6 +71,11 @@ public:
return Vec2<T>(f, f);
}
void Write(T a[2]) {
a[0] = x;
a[1] = y;
}
Vec2<decltype(T{} + T{})> operator+(const Vec2& other) const {
return MakeVec(x + other.x, y + other.y);
}
@@ -196,6 +205,10 @@ public:
T y;
T z;
T* AsArray() {
return &x;
}
Vec3() = default;
Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {}
@@ -212,6 +225,12 @@ public:
return MakeVec(f, f, f);
}
void Write(T a[3]) {
a[0] = x;
a[1] = y;
a[2] = z;
}
Vec3<decltype(T{} + T{})> operator+(const Vec3& other) const {
return MakeVec(x + other.x, y + other.y, z + other.z);
}
@@ -397,6 +416,10 @@ public:
T z;
T w;
T* AsArray() {
return &x;
}
Vec4() = default;
Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {}
@@ -413,6 +436,13 @@ public:
return Vec4<T>(f, f, f, f);
}
void Write(T a[4]) {
a[0] = x;
a[1] = y;
a[2] = z;
a[3] = w;
}
Vec4<decltype(T{} + T{})> operator+(const Vec4& other) const {
return MakeVec(x + other.x, y + other.y, z + other.z, w + other.w);
}

View File

@@ -12,13 +12,10 @@
#include "core/core.h"
#include "core/core_timing.h"
#include "core/gdbstub/gdbstub.h"
#include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/process.h"
#include "core/hle/kernel/thread.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/controller.h"
#include "core/hle/service/sm/sm.h"
#include "core/hw/hw.h"
#include "core/loader/loader.h"
#include "core/memory_setup.h"
@@ -29,8 +26,6 @@ namespace Core {
/*static*/ System System::s_instance;
System::~System() = default;
System::ResultStatus System::RunLoop(bool tight_loop) {
status = ResultStatus::Success;
if (!cpu_core) {
@@ -172,12 +167,10 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
telemetry_session = std::make_unique<Core::TelemetrySession>();
service_manager = std::make_shared<Service::SM::ServiceManager>();
HW::Init();
Kernel::Init(system_mode);
scheduler = std::make_unique<Kernel::Scheduler>(cpu_core.get());
Service::Init(service_manager);
Service::Init();
GDBStub::Init();
if (!VideoCore::Init(emu_window)) {
@@ -207,26 +200,17 @@ void System::Shutdown() {
VideoCore::Shutdown();
GDBStub::Shutdown();
Service::Shutdown();
scheduler.reset();
scheduler = nullptr;
Kernel::Shutdown();
HW::Shutdown();
service_manager.reset();
telemetry_session.reset();
gpu_core.reset();
cpu_core.reset();
telemetry_session = nullptr;
gpu_core = nullptr;
cpu_core = nullptr;
CoreTiming::Shutdown();
app_loader.reset();
app_loader = nullptr;
LOG_DEBUG(Core, "Shutdown OK");
}
Service::SM::ServiceManager& System::ServiceManager() {
return *service_manager;
}
const Service::SM::ServiceManager& System::ServiceManager() const {
return *service_manager;
}
} // namespace Core

View File

@@ -19,16 +19,10 @@
class EmuWindow;
class ARM_Interface;
namespace Service::SM {
class ServiceManager;
}
namespace Core {
class System {
public:
~System();
/**
* Gets the instance of the System singleton class.
* @returns Reference to the instance of the System singleton class.
@@ -143,9 +137,6 @@ public:
return *app_loader;
}
Service::SM::ServiceManager& ServiceManager();
const Service::SM::ServiceManager& ServiceManager() const;
void SetGPUDebugContext(std::shared_ptr<Tegra::DebugContext> context) {
debug_context = std::move(context);
}
@@ -180,9 +171,6 @@ private:
/// When true, signals that a reschedule should happen
bool reschedule_pending{};
/// Service manager
std::shared_ptr<Service::SM::ServiceManager> service_manager;
/// Telemetry session for this emulation session
std::unique_ptr<Core::TelemetrySession> telemetry_session;

View File

@@ -183,7 +183,7 @@ bool Disk_Storage::SetSize(const u64 size) const {
return true;
}
Disk_Directory::Disk_Directory(const std::string& path) {
Disk_Directory::Disk_Directory(const std::string& path) : directory() {
unsigned size = FileUtil::ScanDirectoryTree(path, directory);
directory.size = size;
directory.isDirectory = true;

View File

@@ -43,7 +43,7 @@ protected:
class Disk_Storage : public StorageBackend {
public:
explicit Disk_Storage(std::shared_ptr<FileUtil::IOFile> file) : file(std::move(file)) {}
Disk_Storage(std::shared_ptr<FileUtil::IOFile> file) : file(std::move(file)) {}
ResultVal<size_t> Read(u64 offset, size_t length, u8* buffer) const override;
ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) const override;
@@ -60,7 +60,7 @@ private:
class Disk_Directory : public DirectoryBackend {
public:
explicit Disk_Directory(const std::string& path);
Disk_Directory(const std::string& path);
~Disk_Directory() override {
Close();
@@ -74,6 +74,7 @@ public:
}
protected:
u32 total_entries_in_directory;
FileUtil::FSTEntry directory;
// We need to remember the last entry we returned, so a subsequent call to Read will continue

View File

@@ -34,57 +34,57 @@ SharedPtr<ResourceLimit> ResourceLimit::GetForCategory(ResourceLimitCategory cat
}
}
s32 ResourceLimit::GetCurrentResourceValue(ResourceType resource) const {
s32 ResourceLimit::GetCurrentResourceValue(u32 resource) const {
switch (resource) {
case ResourceType::Commit:
case COMMIT:
return current_commit;
case ResourceType::Thread:
case THREAD:
return current_threads;
case ResourceType::Event:
case EVENT:
return current_events;
case ResourceType::Mutex:
case MUTEX:
return current_mutexes;
case ResourceType::Semaphore:
case SEMAPHORE:
return current_semaphores;
case ResourceType::Timer:
case TIMER:
return current_timers;
case ResourceType::SharedMemory:
case SHARED_MEMORY:
return current_shared_mems;
case ResourceType::AddressArbiter:
case ADDRESS_ARBITER:
return current_address_arbiters;
case ResourceType::CPUTime:
case CPU_TIME:
return current_cpu_time;
default:
LOG_ERROR(Kernel, "Unknown resource type=%08X", static_cast<u32>(resource));
LOG_ERROR(Kernel, "Unknown resource type=%08X", resource);
UNIMPLEMENTED();
return 0;
}
}
u32 ResourceLimit::GetMaxResourceValue(ResourceType resource) const {
u32 ResourceLimit::GetMaxResourceValue(u32 resource) const {
switch (resource) {
case ResourceType::Priority:
case PRIORITY:
return max_priority;
case ResourceType::Commit:
case COMMIT:
return max_commit;
case ResourceType::Thread:
case THREAD:
return max_threads;
case ResourceType::Event:
case EVENT:
return max_events;
case ResourceType::Mutex:
case MUTEX:
return max_mutexes;
case ResourceType::Semaphore:
case SEMAPHORE:
return max_semaphores;
case ResourceType::Timer:
case TIMER:
return max_timers;
case ResourceType::SharedMemory:
case SHARED_MEMORY:
return max_shared_mems;
case ResourceType::AddressArbiter:
case ADDRESS_ARBITER:
return max_address_arbiters;
case ResourceType::CPUTime:
case CPU_TIME:
return max_cpu_time;
default:
LOG_ERROR(Kernel, "Unknown resource type=%08X", static_cast<u32>(resource));
LOG_ERROR(Kernel, "Unknown resource type=%08X", resource);
UNIMPLEMENTED();
return 0;
}

View File

@@ -16,17 +16,17 @@ enum class ResourceLimitCategory : u8 {
OTHER = 3
};
enum class ResourceType {
Priority = 0,
Commit = 1,
Thread = 2,
Event = 3,
Mutex = 4,
Semaphore = 5,
Timer = 6,
SharedMemory = 7,
AddressArbiter = 8,
CPUTime = 9,
enum ResourceTypes {
PRIORITY = 0,
COMMIT = 1,
THREAD = 2,
EVENT = 3,
MUTEX = 4,
SEMAPHORE = 5,
TIMER = 6,
SHARED_MEMORY = 7,
ADDRESS_ARBITER = 8,
CPU_TIME = 9,
};
class ResourceLimit final : public Object {
@@ -60,14 +60,14 @@ public:
* @param resource Requested resource type
* @returns The current value of the resource type
*/
s32 GetCurrentResourceValue(ResourceType resource) const;
s32 GetCurrentResourceValue(u32 resource) const;
/**
* Gets the max value for the specified resource.
* @param resource Requested resource type
* @returns The max value of the resource type
*/
u32 GetMaxResourceValue(ResourceType resource) const;
u32 GetMaxResourceValue(u32 resource) const;
/// Name of resource limit object.
std::string name;

View File

@@ -4,7 +4,6 @@
#include <algorithm>
#include <cinttypes>
#include <iterator>
#include "common/logging/log.h"
#include "common/microprofile.h"
@@ -407,7 +406,7 @@ static ResultCode SetThreadPriority(Handle handle, u32 priority) {
// Note: The kernel uses the current process's resource limit instead of
// the one from the thread owner's resource limit.
SharedPtr<ResourceLimit>& resource_limit = Core::CurrentProcess()->resource_limit;
if (resource_limit->GetMaxResourceValue(ResourceType::Priority) > priority) {
if (resource_limit->GetMaxResourceValue(ResourceTypes::PRIORITY) > priority) {
return ERR_NOT_AUTHORIZED;
}
@@ -541,7 +540,7 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V
}
SharedPtr<ResourceLimit>& resource_limit = Core::CurrentProcess()->resource_limit;
if (resource_limit->GetMaxResourceValue(ResourceType::Priority) > priority) {
if (resource_limit->GetMaxResourceValue(ResourceTypes::PRIORITY) > priority) {
return ERR_NOT_AUTHORIZED;
}
@@ -947,7 +946,7 @@ static const FunctionDef SVC_Table[] = {
};
static const FunctionDef* GetSVCInfo(u32 func_num) {
if (func_num >= std::size(SVC_Table)) {
if (func_num >= ARRAY_SIZE(SVC_Table)) {
LOG_ERROR(Kernel_SVC, "unknown svc=0x%02X", func_num);
return nullptr;
}

View File

@@ -10,7 +10,8 @@
#include "core/hle/service/acc/acc_u0.h"
#include "core/hle/service/acc/acc_u1.h"
namespace Service::Account {
namespace Service {
namespace Account {
// TODO: RE this structure
struct UserData {
@@ -147,4 +148,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<ACC_U1>(module)->InstallAsService(service_manager);
}
} // namespace Service::Account
} // namespace Account
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/service/service.h"
namespace Service::Account {
namespace Service {
namespace Account {
class Module final {
public:
@@ -30,4 +31,5 @@ public:
/// Registers all ACC services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::Account
} // namespace Account
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/acc/acc_aa.h"
namespace Service::Account {
namespace Service {
namespace Account {
ACC_AA::ACC_AA(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:aa") {
static const FunctionInfo functions[] = {
@@ -17,4 +18,5 @@ ACC_AA::ACC_AA(std::shared_ptr<Module> module) : Module::Interface(std::move(mod
RegisterHandlers(functions);
}
} // namespace Service::Account
} // namespace Account
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/acc/acc.h"
namespace Service::Account {
namespace Service {
namespace Account {
class ACC_AA final : public Module::Interface {
public:
explicit ACC_AA(std::shared_ptr<Module> module);
};
} // namespace Service::Account
} // namespace Account
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/acc/acc_su.h"
namespace Service::Account {
namespace Service {
namespace Account {
ACC_SU::ACC_SU(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:su") {
static const FunctionInfo functions[] = {
@@ -50,4 +51,5 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module) : Module::Interface(std::move(mod
RegisterHandlers(functions);
}
} // namespace Service::Account
} // namespace Account
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/acc/acc_u0.h"
namespace Service::Account {
namespace Service {
namespace Account {
ACC_U0::ACC_U0(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:u0") {
static const FunctionInfo functions[] = {
@@ -30,4 +31,5 @@ ACC_U0::ACC_U0(std::shared_ptr<Module> module) : Module::Interface(std::move(mod
RegisterHandlers(functions);
}
} // namespace Service::Account
} // namespace Account
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/acc/acc.h"
namespace Service::Account {
namespace Service {
namespace Account {
class ACC_U0 final : public Module::Interface {
public:
explicit ACC_U0(std::shared_ptr<Module> module);
};
} // namespace Service::Account
} // namespace Account
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/acc/acc_u1.h"
namespace Service::Account {
namespace Service {
namespace Account {
ACC_U1::ACC_U1(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:u1") {
static const FunctionInfo functions[] = {
@@ -37,4 +38,5 @@ ACC_U1::ACC_U1(std::shared_ptr<Module> module) : Module::Interface(std::move(mod
RegisterHandlers(functions);
}
} // namespace Service::Account
} // namespace Account
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/acc/acc.h"
namespace Service::Account {
namespace Service {
namespace Account {
class ACC_U1 final : public Module::Interface {
public:
explicit ACC_U1(std::shared_ptr<Module> module);
};
} // namespace Service::Account
} // namespace Account
} // namespace Service

View File

@@ -14,7 +14,8 @@
#include "core/hle/service/nvflinger/nvflinger.h"
#include "core/settings.h"
namespace Service::AM {
namespace Service {
namespace AM {
IWindowController::IWindowController() : ServiceFramework("IWindowController") {
static const FunctionInfo functions[] = {
@@ -570,4 +571,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager,
std::make_shared<AppletOE>(nvflinger)->InstallAsService(service_manager);
}
} // namespace Service::AM
} // namespace AM
} // namespace Service

View File

@@ -8,7 +8,8 @@
#include "core/hle/service/am/applet_ae.h"
#include "core/hle/service/nvflinger/nvflinger.h"
namespace Service::AM {
namespace Service {
namespace AM {
class ILibraryAppletProxy final : public ServiceFramework<ILibraryAppletProxy> {
public:
@@ -108,4 +109,5 @@ AppletAE::AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
RegisterHandlers(functions);
}
} // namespace Service::AM
} // namespace AM
} // namespace Service

View File

@@ -8,7 +8,8 @@
#include "core/hle/service/am/applet_oe.h"
#include "core/hle/service/nvflinger/nvflinger.h"
namespace Service::AM {
namespace Service {
namespace AM {
class IApplicationProxy final : public ServiceFramework<IApplicationProxy> {
public:
@@ -103,4 +104,5 @@ AppletOE::AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
RegisterHandlers(functions);
}
} // namespace Service::AM
} // namespace AM
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/aoc/aoc_u.h"
namespace Service::AOC {
namespace Service {
namespace AOC {
AOC_U::AOC_U() : ServiceFramework("aoc:u") {
static const FunctionInfo functions[] = {
@@ -41,4 +42,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<AOC_U>()->InstallAsService(service_manager);
}
} // namespace Service::AOC
} // namespace AOC
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/service/service.h"
namespace Service::AOC {
namespace Service {
namespace AOC {
class AOC_U final : public ServiceFramework<AOC_U> {
public:
@@ -21,4 +22,5 @@ private:
/// Registers all AOC services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::AOC
} // namespace AOC
} // namespace Service

View File

@@ -7,7 +7,8 @@
#include "core/hle/service/apm/apm.h"
#include "core/hle/service/apm/interface.h"
namespace Service::APM {
namespace Service {
namespace APM {
void InstallInterfaces(SM::ServiceManager& service_manager) {
auto module_ = std::make_shared<Module>();
@@ -15,4 +16,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<APM>(module_, "apm:p")->InstallAsService(service_manager);
}
} // namespace Service::APM
} // namespace APM
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/service/service.h"
namespace Service::APM {
namespace Service {
namespace APM {
enum class PerformanceMode : u8 {
Handheld = 0,
@@ -22,4 +23,5 @@ public:
/// Registers all AM services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::APM
} // namespace APM
} // namespace Service

View File

@@ -7,7 +7,8 @@
#include "core/hle/service/apm/apm.h"
#include "core/hle/service/apm/interface.h"
namespace Service::APM {
namespace Service {
namespace APM {
class ISession final : public ServiceFramework<ISession> {
public:
@@ -61,4 +62,5 @@ void APM::OpenSession(Kernel::HLERequestContext& ctx) {
rb.PushIpcInterface<ISession>();
}
} // namespace Service::APM
} // namespace APM
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/service/service.h"
namespace Service::APM {
namespace Service {
namespace APM {
class APM final : public ServiceFramework<APM> {
public:
@@ -22,4 +23,5 @@ private:
/// Registers all AM services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::APM
} // namespace APM
} // namespace Service

View File

@@ -7,7 +7,8 @@
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/audin_u.h"
namespace Service::Audio {
namespace Service {
namespace Audio {
class IAudioIn final : public ServiceFramework<IAudioIn> {
public:
@@ -43,4 +44,5 @@ AudInU::AudInU() : ServiceFramework("audin:u") {
RegisterHandlers(functions);
}
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -10,7 +10,8 @@ namespace Kernel {
class HLERequestContext;
}
namespace Service::Audio {
namespace Service {
namespace Audio {
class AudInU final : public ServiceFramework<AudInU> {
public:
@@ -18,4 +19,5 @@ public:
~AudInU() = default;
};
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -9,7 +9,8 @@
#include "core/hle/service/audio/audren_u.h"
#include "core/hle/service/audio/codecctl.h"
namespace Service::Audio {
namespace Service {
namespace Audio {
void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<AudOutU>()->InstallAsService(service_manager);
@@ -19,4 +20,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<CodecCtl>()->InstallAsService(service_manager);
}
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -6,9 +6,11 @@
#include "core/hle/service/service.h"
namespace Service::Audio {
namespace Service {
namespace Audio {
/// Registers all Audio services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -10,7 +10,8 @@
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/audout_u.h"
namespace Service::Audio {
namespace Service {
namespace Audio {
/// Switch sample rate frequency
constexpr u32 sample_rate{48000};
@@ -203,4 +204,5 @@ AudOutU::AudOutU() : ServiceFramework("audout:u") {
RegisterHandlers(functions);
}
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -10,7 +10,8 @@ namespace Kernel {
class HLERequestContext;
}
namespace Service::Audio {
namespace Service {
namespace Audio {
class IAudioOut;
@@ -36,4 +37,5 @@ private:
};
};
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -7,7 +7,8 @@
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/audrec_u.h"
namespace Service::Audio {
namespace Service {
namespace Audio {
class IFinalOutputRecorder final : public ServiceFramework<IFinalOutputRecorder> {
public:
@@ -35,4 +36,5 @@ AudRecU::AudRecU() : ServiceFramework("audrec:u") {
RegisterHandlers(functions);
}
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -10,7 +10,8 @@ namespace Kernel {
class HLERequestContext;
}
namespace Service::Audio {
namespace Service {
namespace Audio {
class AudRecU final : public ServiceFramework<AudRecU> {
public:
@@ -18,4 +19,5 @@ public:
~AudRecU() = default;
};
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -9,7 +9,8 @@
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/audren_u.h"
namespace Service::Audio {
namespace Service {
namespace Audio {
/// TODO(bunnei): Find a proper value for the audio_ticks
constexpr u64 audio_ticks{static_cast<u64>(BASE_CLOCK_RATE / 200)};
@@ -271,4 +272,5 @@ void AudRenU::GetAudioDevice(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_Audio, "called");
}
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -10,7 +10,8 @@ namespace Kernel {
class HLERequestContext;
}
namespace Service::Audio {
namespace Service {
namespace Audio {
class AudRenU final : public ServiceFramework<AudRenU> {
public:
@@ -23,4 +24,5 @@ private:
void GetAudioDevice(Kernel::HLERequestContext& ctx);
};
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -7,7 +7,8 @@
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/codecctl.h"
namespace Service::Audio {
namespace Service {
namespace Audio {
CodecCtl::CodecCtl() : ServiceFramework("codecctl") {
static const FunctionInfo functions[] = {
@@ -28,4 +29,5 @@ CodecCtl::CodecCtl() : ServiceFramework("codecctl") {
RegisterHandlers(functions);
}
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -10,7 +10,8 @@ namespace Kernel {
class HLERequestContext;
}
namespace Service::Audio {
namespace Service {
namespace Audio {
class CodecCtl final : public ServiceFramework<CodecCtl> {
public:
@@ -18,4 +19,5 @@ public:
~CodecCtl() = default;
};
} // namespace Service::Audio
} // namespace Audio
} // namespace Service

View File

@@ -8,7 +8,8 @@
#include "core/hle/service/fatal/fatal_p.h"
#include "core/hle/service/fatal/fatal_u.h"
namespace Service::Fatal {
namespace Service {
namespace Fatal {
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
: ServiceFramework(name), module(std::move(module)) {}
@@ -33,4 +34,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<Fatal_U>(module)->InstallAsService(service_manager);
}
} // namespace Service::Fatal
} // namespace Fatal
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/service/service.h"
namespace Service::Fatal {
namespace Service {
namespace Fatal {
class Module final {
public:
@@ -24,4 +25,5 @@ public:
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::Fatal
} // namespace Fatal
} // namespace Service

View File

@@ -4,9 +4,11 @@
#include "core/hle/service/fatal/fatal_p.h"
namespace Service::Fatal {
namespace Service {
namespace Fatal {
Fatal_P::Fatal_P(std::shared_ptr<Module> module)
: Module::Interface(std::move(module), "fatal:p") {}
} // namespace Service::Fatal
} // namespace Fatal
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/fatal/fatal.h"
namespace Service::Fatal {
namespace Service {
namespace Fatal {
class Fatal_P final : public Module::Interface {
public:
explicit Fatal_P(std::shared_ptr<Module> module);
};
} // namespace Service::Fatal
} // namespace Fatal
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/fatal/fatal_u.h"
namespace Service::Fatal {
namespace Service {
namespace Fatal {
Fatal_U::Fatal_U(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "fatal:u") {
static const FunctionInfo functions[] = {
@@ -14,4 +15,5 @@ Fatal_U::Fatal_U(std::shared_ptr<Module> module) : Module::Interface(std::move(m
RegisterHandlers(functions);
}
} // namespace Service::Fatal
} // namespace Fatal
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/fatal/fatal.h"
namespace Service::Fatal {
namespace Service {
namespace Fatal {
class Fatal_U final : public Module::Interface {
public:
explicit Fatal_U(std::shared_ptr<Module> module);
};
} // namespace Service::Fatal
} // namespace Fatal
} // namespace Service

View File

@@ -10,7 +10,8 @@
#include "core/hle/service/filesystem/filesystem.h"
#include "core/hle/service/filesystem/fsp_srv.h"
namespace Service::FileSystem {
namespace Service {
namespace FileSystem {
/**
* Map of registered file systems, identified by type. Once an file system is registered here, it
@@ -74,4 +75,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<FSP_SRV>()->InstallAsService(service_manager);
}
} // namespace Service::FileSystem
} // namespace FileSystem
} // namespace Service

View File

@@ -14,7 +14,8 @@
#include "core/hle/service/filesystem/filesystem.h"
#include "core/hle/service/filesystem/fsp_srv.h"
namespace Service::FileSystem {
namespace Service {
namespace FileSystem {
class IStorage final : public ServiceFramework<IStorage> {
public:
@@ -572,4 +573,5 @@ void FSP_SRV::OpenRomStorage(Kernel::HLERequestContext& ctx) {
OpenDataStorageByCurrentProcess(ctx);
}
} // namespace Service::FileSystem
} // namespace FileSystem
} // namespace Service

View File

@@ -11,7 +11,8 @@ namespace FileSys {
class FileSystemBackend;
}
namespace Service::FileSystem {
namespace Service {
namespace FileSystem {
class FSP_SRV final : public ServiceFramework<FSP_SRV> {
public:
@@ -32,4 +33,5 @@ private:
std::unique_ptr<FileSys::FileSystemBackend> romfs;
};
} // namespace Service::FileSystem
} // namespace FileSystem
} // namespace Service

View File

@@ -8,7 +8,8 @@
#include "core/hle/service/friend/friend_a.h"
#include "core/hle/service/friend/friend_u.h"
namespace Service::Friend {
namespace Service {
namespace Friend {
void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2};
@@ -25,4 +26,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<Friend_U>(module)->InstallAsService(service_manager);
}
} // namespace Service::Friend
} // namespace Friend
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/service/service.h"
namespace Service::Friend {
namespace Service {
namespace Friend {
class Module final {
public:
@@ -24,4 +25,5 @@ public:
/// Registers all Friend services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::Friend
} // namespace Friend
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/friend/friend_a.h"
namespace Service::Friend {
namespace Service {
namespace Friend {
Friend_A::Friend_A(std::shared_ptr<Module> module)
: Module::Interface(std::move(module), "friend:a") {
@@ -15,4 +16,5 @@ Friend_A::Friend_A(std::shared_ptr<Module> module)
RegisterHandlers(functions);
}
} // namespace Service::Friend
} // namespace Friend
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/friend/friend.h"
namespace Service::Friend {
namespace Service {
namespace Friend {
class Friend_A final : public Module::Interface {
public:
explicit Friend_A(std::shared_ptr<Module> module);
};
} // namespace Service::Friend
} // namespace Friend
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/friend/friend_u.h"
namespace Service::Friend {
namespace Service {
namespace Friend {
Friend_U::Friend_U(std::shared_ptr<Module> module)
: Module::Interface(std::move(module), "friend:u") {
@@ -15,4 +16,5 @@ Friend_U::Friend_U(std::shared_ptr<Module> module)
RegisterHandlers(functions);
}
} // namespace Service::Friend
} // namespace Friend
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/friend/friend.h"
namespace Service::Friend {
namespace Service {
namespace Friend {
class Friend_U final : public Module::Interface {
public:
explicit Friend_U(std::shared_ptr<Module> module);
};
} // namespace Service::Friend
} // namespace Friend
} // namespace Service

View File

@@ -14,7 +14,8 @@
#include "core/hle/service/hid/hid.h"
#include "core/hle/service/service.h"
namespace Service::HID {
namespace Service {
namespace HID {
// Updating period for each HID device.
// TODO(shinyquagsire23): These need better values.
@@ -433,4 +434,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<Hid>()->InstallAsService(service_manager);
}
} // namespace Service::HID
} // namespace HID
} // namespace Service

View File

@@ -7,7 +7,8 @@
#include "core/hle/service/service.h"
#include "core/settings.h"
namespace Service::HID {
namespace Service {
namespace HID {
// Begin enums and output structs
@@ -336,4 +337,5 @@ void ReloadInputDevices();
/// Registers all HID services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::HID
} // namespace HID
} // namespace Service

View File

@@ -9,7 +9,8 @@
#include "core/hle/kernel/client_session.h"
#include "core/hle/service/lm/lm.h"
namespace Service::LM {
namespace Service {
namespace LM {
class Logger final : public ServiceFramework<Logger> {
public:
@@ -188,4 +189,5 @@ LM::LM() : ServiceFramework("lm") {
RegisterHandlers(functions);
}
} // namespace Service::LM
} // namespace LM
} // namespace Service

View File

@@ -8,7 +8,8 @@
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/service.h"
namespace Service::LM {
namespace Service {
namespace LM {
class LM final : public ServiceFramework<LM> {
public:
@@ -22,4 +23,5 @@ private:
/// Registers all LM services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::LM
} // namespace LM
} // namespace Service

View File

@@ -7,7 +7,8 @@
#include "core/hle/service/nfp/nfp.h"
#include "core/hle/service/nfp/nfp_user.h"
namespace Service::NFP {
namespace Service {
namespace NFP {
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
: ServiceFramework(name), module(std::move(module)) {}
@@ -23,4 +24,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<NFP_User>(module)->InstallAsService(service_manager);
}
} // namespace Service::NFP
} // namespace NFP
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/service/service.h"
namespace Service::NFP {
namespace Service {
namespace NFP {
class Module final {
public:
@@ -23,4 +24,5 @@ public:
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::NFP
} // namespace NFP
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/nfp/nfp_user.h"
namespace Service::NFP {
namespace Service {
namespace NFP {
NFP_User::NFP_User(std::shared_ptr<Module> module)
: Module::Interface(std::move(module), "nfp:user") {
@@ -14,4 +15,5 @@ NFP_User::NFP_User(std::shared_ptr<Module> module)
RegisterHandlers(functions);
}
} // namespace Service::NFP
} // namespace NFP
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/nfp/nfp.h"
namespace Service::NFP {
namespace Service {
namespace NFP {
class NFP_User final : public Module::Interface {
public:
explicit NFP_User(std::shared_ptr<Module> module);
};
} // namespace Service::NFP
} // namespace NFP
} // namespace Service

View File

@@ -9,7 +9,8 @@
#include "core/hle/service/nifm/nifm_s.h"
#include "core/hle/service/nifm/nifm_u.h"
namespace Service::NIFM {
namespace Service {
namespace NIFM {
class IScanRequest final : public ServiceFramework<IScanRequest> {
public:
@@ -207,4 +208,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<NIFM_U>(module)->InstallAsService(service_manager);
}
} // namespace Service::NIFM
} // namespace NIFM
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/service/service.h"
namespace Service::NIFM {
namespace Service {
namespace NIFM {
class Module final {
public:
@@ -24,4 +25,5 @@ public:
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::NIFM
} // namespace NIFM
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/nifm/nifm_a.h"
namespace Service::NIFM {
namespace Service {
namespace NIFM {
NIFM_A::NIFM_A(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:a") {
static const FunctionInfo functions[] = {
@@ -14,4 +15,5 @@ NIFM_A::NIFM_A(std::shared_ptr<Module> module) : Module::Interface(std::move(mod
RegisterHandlers(functions);
}
} // namespace Service::NIFM
} // namespace NIFM
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/nifm/nifm.h"
namespace Service::NIFM {
namespace Service {
namespace NIFM {
class NIFM_A final : public Module::Interface {
public:
explicit NIFM_A(std::shared_ptr<Module> module);
};
} // namespace Service::NIFM
} // namespace NIFM
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/nifm/nifm_s.h"
namespace Service::NIFM {
namespace Service {
namespace NIFM {
NIFM_S::NIFM_S(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:s") {
static const FunctionInfo functions[] = {
@@ -14,4 +15,5 @@ NIFM_S::NIFM_S(std::shared_ptr<Module> module) : Module::Interface(std::move(mod
RegisterHandlers(functions);
}
} // namespace Service::NIFM
} // namespace NIFM
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/nifm/nifm.h"
namespace Service::NIFM {
namespace Service {
namespace NIFM {
class NIFM_S final : public Module::Interface {
public:
explicit NIFM_S(std::shared_ptr<Module> module);
};
} // namespace Service::NIFM
} // namespace NIFM
} // namespace Service

View File

@@ -4,7 +4,8 @@
#include "core/hle/service/nifm/nifm_u.h"
namespace Service::NIFM {
namespace Service {
namespace NIFM {
NIFM_U::NIFM_U(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:u") {
static const FunctionInfo functions[] = {
@@ -14,4 +15,5 @@ NIFM_U::NIFM_U(std::shared_ptr<Module> module) : Module::Interface(std::move(mod
RegisterHandlers(functions);
}
} // namespace Service::NIFM
} // namespace NIFM
} // namespace Service

View File

@@ -6,11 +6,13 @@
#include "core/hle/service/nifm/nifm.h"
namespace Service::NIFM {
namespace Service {
namespace NIFM {
class NIFM_U final : public Module::Interface {
public:
explicit NIFM_U(std::shared_ptr<Module> module);
};
} // namespace Service::NIFM
} // namespace NIFM
} // namespace Service

View File

@@ -5,10 +5,12 @@
#include "core/hle/service/ns/ns.h"
#include "core/hle/service/ns/pl_u.h"
namespace Service::NS {
namespace Service {
namespace NS {
void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<PL_U>()->InstallAsService(service_manager);
}
} // namespace Service::NS
} // namespace NS
} // namespace Service

View File

@@ -6,9 +6,11 @@
#include "core/hle/service/service.h"
namespace Service::NS {
namespace Service {
namespace NS {
/// Registers all NS services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::NS
} // namespace NS
} // namespace Service

View File

@@ -8,7 +8,8 @@
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/ns/pl_u.h"
namespace Service::NS {
namespace Service {
namespace NS {
struct FontRegion {
u32 offset;
@@ -116,4 +117,5 @@ void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) {
rb.PushCopyObjects(shared_font_mem);
}
} // namespace Service::NS
} // namespace NS
} // namespace Service

View File

@@ -8,7 +8,8 @@
#include "core/hle/kernel/shared_memory.h"
#include "core/hle/service/service.h"
namespace Service::NS {
namespace Service {
namespace NS {
class PL_U final : public ServiceFramework<PL_U> {
public:
@@ -29,4 +30,5 @@ private:
std::shared_ptr<std::vector<u8>> shared_font;
};
} // namespace Service::NS
} // namespace NS
} // namespace Service

View File

@@ -9,7 +9,9 @@
#include "common/common_types.h"
#include "common/swap.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
/// Represents an abstract nvidia device node. It is to be subclassed by concrete device nodes to
/// implement the ioctl interface.
@@ -36,4 +38,6 @@ public:
virtual u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) = 0;
};
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -10,7 +10,9 @@
#include "video_core/renderer_base.h"
#include "video_core/video_core.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
u32 nvdisp_disp0::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
UNIMPLEMENTED();
@@ -33,4 +35,6 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u3
VideoCore::g_renderer->SwapBuffers(framebuffer);
}
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -10,7 +10,9 @@
#include "core/hle/service/nvdrv/devices/nvdevice.h"
#include "core/hle/service/nvflinger/buffer_queue.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
class nvmap;
@@ -29,4 +31,6 @@ private:
std::shared_ptr<nvmap> nvmap_dev;
};
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -9,7 +9,9 @@
#include "core/hle/service/nvdrv/devices/nvhost_as_gpu.h"
#include "core/hle/service/nvdrv/devices/nvmap.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
u32 nvhost_as_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%zx, output_size=0x%zx",
@@ -113,4 +115,6 @@ u32 nvhost_as_gpu::GetVARegions(const std::vector<u8>& input, std::vector<u8>& o
return 0;
}
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -11,7 +11,9 @@
#include "common/swap.h"
#include "core/hle/service/nvdrv/devices/nvdevice.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
class nvmap;
@@ -98,4 +100,6 @@ private:
std::shared_ptr<nvmap> nvmap_dev;
};
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -6,7 +6,9 @@
#include "common/logging/log.h"
#include "core/hle/service/nvdrv/devices/nvhost_ctrl.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%zx, output_size=0x%zx",
@@ -57,4 +59,6 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
return 0;
}
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -11,7 +11,9 @@
#include "common/common_types.h"
#include "core/hle/service/nvdrv/devices/nvdevice.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
class nvhost_ctrl final : public nvdevice {
public:
@@ -53,4 +55,6 @@ private:
u32 IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& output);
};
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -7,7 +7,9 @@
#include "common/logging/log.h"
#include "core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%zx, output_size=0x%zx",
@@ -120,4 +122,6 @@ u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>&
return 0;
}
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -9,7 +9,9 @@
#include "common/swap.h"
#include "core/hle/service/nvdrv/devices/nvdevice.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
class nvhost_ctrl_gpu final : public nvdevice {
public:
@@ -123,5 +125,6 @@ private:
u32 ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output);
u32 ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output);
};
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -9,7 +9,9 @@
#include "core/core.h"
#include "core/hle/service/nvdrv/devices/nvhost_gpu.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%zx, output_size=0x%zx",
@@ -140,4 +142,6 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp
return 0;
}
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -10,7 +10,9 @@
#include "common/swap.h"
#include "core/hle/service/nvdrv/devices/nvdevice.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
class nvmap;
constexpr u32 NVGPU_IOCTL_MAGIC('H');
@@ -137,4 +139,6 @@ private:
std::shared_ptr<nvmap> nvmap_dev;
};
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -9,7 +9,9 @@
#include "common/logging/log.h"
#include "core/hle/service/nvdrv/devices/nvmap.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
VAddr nvmap::GetObjectAddress(u32 handle) const {
auto object = GetObject(handle);
@@ -142,4 +144,6 @@ u32 nvmap::IocParam(const std::vector<u8>& input, std::vector<u8>& output) {
return 0;
}
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -12,7 +12,9 @@
#include "common/swap.h"
#include "core/hle/service/nvdrv/devices/nvdevice.h"
namespace Service::Nvidia::Devices {
namespace Service {
namespace Nvidia {
namespace Devices {
class nvmap final : public nvdevice {
public:
@@ -109,4 +111,6 @@ private:
u32 IocParam(const std::vector<u8>& input, std::vector<u8>& output);
};
} // namespace Service::Nvidia::Devices
} // namespace Devices
} // namespace Nvidia
} // namespace Service

View File

@@ -9,7 +9,8 @@
#include "core/hle/service/nvdrv/interface.h"
#include "core/hle/service/nvdrv/nvdrv.h"
namespace Service::Nvidia {
namespace Service {
namespace Nvidia {
void NVDRV::Open(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_NVDRV, "called");
@@ -110,4 +111,5 @@ NVDRV::NVDRV(std::shared_ptr<Module> nvdrv, const char* name)
query_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "NVDRV::query_event");
}
} // namespace Service::Nvidia
} // namespace Nvidia
} // namespace Service

View File

@@ -10,7 +10,8 @@
#include "core/hle/service/nvdrv/nvdrv.h"
#include "core/hle/service/service.h"
namespace Service::Nvidia {
namespace Service {
namespace Nvidia {
class NVDRV final : public ServiceFramework<NVDRV> {
public:
@@ -33,4 +34,5 @@ private:
Kernel::SharedPtr<Kernel::Event> query_event;
};
} // namespace Service::Nvidia
} // namespace Nvidia
} // namespace Service

View File

@@ -14,7 +14,8 @@
#include "core/hle/service/nvdrv/nvdrv.h"
#include "core/hle/service/nvdrv/nvmemp.h"
namespace Service::Nvidia {
namespace Service {
namespace Nvidia {
std::weak_ptr<Module> nvdrv;
@@ -68,4 +69,5 @@ ResultCode Module::Close(u32 fd) {
return RESULT_SUCCESS;
}
} // namespace Service::Nvidia
} // namespace Nvidia
} // namespace Service

View File

@@ -10,7 +10,8 @@
#include "common/common_types.h"
#include "core/hle/service/service.h"
namespace Service::Nvidia {
namespace Service {
namespace Nvidia {
namespace Devices {
class nvdevice;
@@ -60,4 +61,5 @@ void InstallInterfaces(SM::ServiceManager& service_manager);
extern std::weak_ptr<Module> nvdrv;
} // namespace Service::Nvidia
} // namespace Nvidia
} // namespace Service

View File

@@ -8,7 +8,8 @@
#include "core/hle/service/nvdrv/nvdrv.h"
#include "core/hle/service/nvdrv/nvmemp.h"
namespace Service::Nvidia {
namespace Service {
namespace Nvidia {
NVMEMP::NVMEMP() : ServiceFramework("nvmemp") {
static const FunctionInfo functions[] = {
@@ -26,4 +27,5 @@ void NVMEMP::Cmd1(Kernel::HLERequestContext& ctx) {
UNIMPLEMENTED();
}
} // namespace Service::Nvidia
} // namespace Nvidia
} // namespace Service

View File

@@ -6,7 +6,8 @@
#include "core/hle/service/service.h"
namespace Service::Nvidia {
namespace Service {
namespace Nvidia {
class NVMEMP final : public ServiceFramework<NVMEMP> {
public:
@@ -18,4 +19,5 @@ private:
void Cmd1(Kernel::HLERequestContext& ctx);
};
} // namespace Service::Nvidia
} // namespace Nvidia
} // namespace Service

Some files were not shown because too many files have changed in this diff Show More