summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-02-14 04:21:17 +0100
committerbunnei <bunneidev@gmail.com>2018-02-14 05:54:12 +0100
commitd42e77797e83a6c1ed7291e532041c781881e853 (patch)
treebe74bc0db8056fc1f3ac7e16d5c7ed64456accad /src
parentvi: Use ReadBuffer/WriteBuffer functions for TransactParcel. (diff)
downloadyuzu-d42e77797e83a6c1ed7291e532041c781881e853.tar
yuzu-d42e77797e83a6c1ed7291e532041c781881e853.tar.gz
yuzu-d42e77797e83a6c1ed7291e532041c781881e853.tar.bz2
yuzu-d42e77797e83a6c1ed7291e532041c781881e853.tar.lz
yuzu-d42e77797e83a6c1ed7291e532041c781881e853.tar.xz
yuzu-d42e77797e83a6c1ed7291e532041c781881e853.tar.zst
yuzu-d42e77797e83a6c1ed7291e532041c781881e853.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/nvdrv/interface.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp
index 367791da6..13d23291e 100644
--- a/src/core/hle/service/nvdrv/interface.cpp
+++ b/src/core/hle/service/nvdrv/interface.cpp
@@ -32,25 +32,13 @@ void NVDRV::Ioctl(Kernel::HLERequestContext& ctx) {
u32 fd = rp.Pop<u32>();
u32 command = rp.Pop<u32>();
+ std::vector<u8> output(ctx.GetWriteBufferSize());
+
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
- if (ctx.BufferDescriptorA()[0].Size() != 0) {
- auto input_buffer = ctx.BufferDescriptorA()[0];
- auto output_buffer = ctx.BufferDescriptorB()[0];
- std::vector<u8> input(input_buffer.Size());
- std::vector<u8> output(output_buffer.Size());
- Memory::ReadBlock(input_buffer.Address(), input.data(), input_buffer.Size());
- rb.Push(nvdrv->Ioctl(fd, command, input, output));
- Memory::WriteBlock(output_buffer.Address(), output.data(), output_buffer.Size());
- } else {
- auto input_buffer = ctx.BufferDescriptorX()[0];
- auto output_buffer = ctx.BufferDescriptorC()[0];
- std::vector<u8> input(input_buffer.size);
- std::vector<u8> output(output_buffer.size);
- Memory::ReadBlock(input_buffer.Address(), input.data(), input_buffer.size);
- rb.Push(nvdrv->Ioctl(fd, command, input, output));
- Memory::WriteBlock(output_buffer.Address(), output.data(), output_buffer.size);
- }
+ rb.Push(nvdrv->Ioctl(fd, command, ctx.ReadBuffer(), output));
+
+ ctx.WriteBuffer(output);
}
void NVDRV::Close(Kernel::HLERequestContext& ctx) {