|
|
@ -2,7 +2,6 @@
|
|
|
|
// SPDX-FileCopyrightText: 2021 Skyline Team and Contributors
|
|
|
|
// SPDX-FileCopyrightText: 2021 Skyline Team and Contributors
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
|
|
|
|
#include <cinttypes>
|
|
|
|
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
#include "core/core.h"
|
|
|
|
#include "core/core.h"
|
|
|
|
#include "core/hle/kernel/k_event.h"
|
|
|
|
#include "core/hle/kernel/k_event.h"
|
|
|
@ -63,12 +62,12 @@ void NVDRV::Ioctl1(HLERequestContext& ctx) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Check device
|
|
|
|
// Check device
|
|
|
|
tmp_output.resize_destructive(ctx.GetWriteBufferSize(0));
|
|
|
|
output_buffer.resize_destructive(ctx.GetWriteBufferSize(0));
|
|
|
|
const auto input_buffer = ctx.ReadBuffer(0);
|
|
|
|
const auto input_buffer = ctx.ReadBuffer(0);
|
|
|
|
|
|
|
|
|
|
|
|
const auto nv_result = nvdrv->Ioctl1(fd, command, input_buffer, tmp_output);
|
|
|
|
const auto nv_result = nvdrv->Ioctl1(fd, command, input_buffer, output_buffer);
|
|
|
|
if (command.is_out != 0) {
|
|
|
|
if (command.is_out != 0) {
|
|
|
|
ctx.WriteBuffer(tmp_output);
|
|
|
|
ctx.WriteBuffer(output_buffer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
@ -90,12 +89,12 @@ void NVDRV::Ioctl2(HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
|
|
const auto input_buffer = ctx.ReadBuffer(0);
|
|
|
|
const auto input_buffer = ctx.ReadBuffer(0);
|
|
|
|
const auto input_inlined_buffer = ctx.ReadBuffer(1);
|
|
|
|
const auto input_inlined_buffer = ctx.ReadBuffer(1);
|
|
|
|
tmp_output.resize_destructive(ctx.GetWriteBufferSize(0));
|
|
|
|
output_buffer.resize_destructive(ctx.GetWriteBufferSize(0));
|
|
|
|
|
|
|
|
|
|
|
|
const auto nv_result =
|
|
|
|
const auto nv_result =
|
|
|
|
nvdrv->Ioctl2(fd, command, input_buffer, input_inlined_buffer, tmp_output);
|
|
|
|
nvdrv->Ioctl2(fd, command, input_buffer, input_inlined_buffer, output_buffer);
|
|
|
|
if (command.is_out != 0) {
|
|
|
|
if (command.is_out != 0) {
|
|
|
|
ctx.WriteBuffer(tmp_output);
|
|
|
|
ctx.WriteBuffer(output_buffer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
@ -116,12 +115,14 @@ void NVDRV::Ioctl3(HLERequestContext& ctx) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const auto input_buffer = ctx.ReadBuffer(0);
|
|
|
|
const auto input_buffer = ctx.ReadBuffer(0);
|
|
|
|
tmp_output.resize_destructive(ctx.GetWriteBufferSize(0));
|
|
|
|
output_buffer.resize_destructive(ctx.GetWriteBufferSize(0));
|
|
|
|
tmp_output_inline.resize_destructive(ctx.GetWriteBufferSize(1));
|
|
|
|
inline_output_buffer.resize_destructive(ctx.GetWriteBufferSize(1));
|
|
|
|
const auto nv_result = nvdrv->Ioctl3(fd, command, input_buffer, tmp_output, tmp_output_inline);
|
|
|
|
|
|
|
|
|
|
|
|
const auto nv_result =
|
|
|
|
|
|
|
|
nvdrv->Ioctl3(fd, command, input_buffer, output_buffer, inline_output_buffer);
|
|
|
|
if (command.is_out != 0) {
|
|
|
|
if (command.is_out != 0) {
|
|
|
|
ctx.WriteBuffer(tmp_output, 0);
|
|
|
|
ctx.WriteBuffer(output_buffer, 0);
|
|
|
|
ctx.WriteBuffer(tmp_output_inline, 1);
|
|
|
|
ctx.WriteBuffer(inline_output_buffer, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
|