diff options
author | David <25727384+ogniK5377@users.noreply.github.com> | 2018-01-21 23:59:50 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-01-21 23:59:50 +0100 |
commit | eeb3b5eed7645bee468b9d19325cb29877d62e82 (patch) | |
tree | f79ce7893a6d6c0a8eb3984edded9887660323ac /src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | |
parent | Merge pull request #128 from Subv/parcel_query (diff) | |
download | yuzu-eeb3b5eed7645bee468b9d19325cb29877d62e82.tar yuzu-eeb3b5eed7645bee468b9d19325cb29877d62e82.tar.gz yuzu-eeb3b5eed7645bee468b9d19325cb29877d62e82.tar.bz2 yuzu-eeb3b5eed7645bee468b9d19325cb29877d62e82.tar.lz yuzu-eeb3b5eed7645bee468b9d19325cb29877d62e82.tar.xz yuzu-eeb3b5eed7645bee468b9d19325cb29877d62e82.tar.zst yuzu-eeb3b5eed7645bee468b9d19325cb29877d62e82.zip |
Diffstat (limited to 'src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp new file mode 100644 index 000000000..2078f2187 --- /dev/null +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp @@ -0,0 +1,46 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/assert.h" +#include "common/logging/log.h" +#include "core/hle/service/nvdrv/devices/nvhost_ctrl.h" + +namespace Service { +namespace Nvidia { +namespace Devices { + +u32 nvhost_ctrl::ioctl(u32 command, const std::vector<u8>& input, std::vector<u8>& output) { + LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%lx, output_size=0x%lx", command, + input.size(), output.size()); + + switch (command) { + case IocGetConfigCommand: + return NvOsGetConfigU32(input, output); + } + UNIMPLEMENTED(); + return 0; +} + +u32 nvhost_ctrl::NvOsGetConfigU32(const std::vector<u8>& input, std::vector<u8>& output) { + IocGetConfigParams params; + std::memcpy(¶ms, input.data(), sizeof(params)); + LOG_DEBUG(Service_NVDRV, "called, setting=%s!%s", params.domain_str.data(), + params.param_str.data()); + + if (!strcmp(params.domain_str.data(), "nv")) { + if (!strcmp(params.param_str.data(), "NV_MEMORY_PROFILER")) { + params.config_str[0] = '1'; + } else { + UNIMPLEMENTED(); + } + } else { + UNIMPLEMENTED(); + } + std::memcpy(output.data(), ¶ms, sizeof(params)); + return 0; +} + +} // namespace Devices +} // namespace Nvidia +} // namespace Service |