Add support for IOCTL3 CtrlGpu calls missed in refactor

This commit is contained in:
Billy Laws 2021-10-01 20:57:59 +01:00
parent 02bcf98b8c
commit 4eff515c55
3 changed files with 15 additions and 6 deletions

View File

@ -7,12 +7,12 @@
#include "driver.h"
#include "devices/nvdevice.h"
#define NVRESULT(x) [&response, this](NvResult err) { \
if (err != NvResult::Success) \
state.logger->Debug("IOCTL Failed: {}", err); \
\
response.Push<NvResult>(err); \
return Result{}; \
#define NVRESULT(x) [&response, this](NvResult err) { \
if (err != NvResult::Success) \
state.logger->Debug("IOCTL Failed: 0x{:X}", err); \
\
response.Push<NvResult>(err); \
return Result{}; \
} (x)
namespace skyline::service::nvdrv {

View File

@ -77,5 +77,12 @@ namespace skyline::service::nvdrv::device::nvhost {
IOCTL_CASE_ARGS(OUT, SIZE(0x8), MAGIC(CtrlGpuMagic), FUNC(0x14),
GetActiveSlotMask, ARGS(Out<u32>, Out<u32>))
}))
INLINE_IOCTL_HANDLER_FUNC(Ioctl3, CtrlGpu, ({
INLINE_IOCTL_CASE_ARGS(INOUT, SIZE(0xB0), MAGIC(CtrlGpuMagic), FUNC(0x5),
GetCharacteristics3, ARGS(InOut<u64>, In<u64>, Out<GpuCharacteristics>))
INLINE_IOCTL_CASE_ARGS(INOUT, SIZE(0x18), MAGIC(CtrlGpuMagic), FUNC(0x6),
GetTpcMasks3, ARGS(In<u32>, Pad<u32, 3>, Out<u32>))
}))
#include <services/nvdrv/devices/deserialisation/macro_undef.inc>
}

View File

@ -118,5 +118,7 @@ namespace skyline::service::nvdrv::device::nvhost {
std::shared_ptr<type::KEvent> QueryEvent(u32 eventId) override;
PosixResult Ioctl(IoctlDescriptor cmd, span<u8> buffer) override;
PosixResult Ioctl3(IoctlDescriptor cmd, span<u8> buffer, span<u8> inlineBuffer) override;
};
}