diff options
| author | 2018-02-13 22:21:17 -0500 | |
|---|---|---|
| committer | 2018-02-13 23:54:12 -0500 | |
| commit | d42e77797e83a6c1ed7291e532041c781881e853 (patch) | |
| tree | be74bc0db8056fc1f3ac7e16d5c7ed64456accad /src/core | |
| parent | vi: Use ReadBuffer/WriteBuffer functions for TransactParcel. (diff) | |
| download | yuzu-d42e77797e83a6c1ed7291e532041c781881e853.tar.gz yuzu-d42e77797e83a6c1ed7291e532041c781881e853.tar.xz yuzu-d42e77797e83a6c1ed7291e532041c781881e853.zip | |
nvdrv: Use ReadBuffer/WriteBuffer functions for Ioctl.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/nvdrv/interface.cpp | 22 |
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) { | |||
| 32 | u32 fd = rp.Pop<u32>(); | 32 | u32 fd = rp.Pop<u32>(); |
| 33 | u32 command = rp.Pop<u32>(); | 33 | u32 command = rp.Pop<u32>(); |
| 34 | 34 | ||
| 35 | std::vector<u8> output(ctx.GetWriteBufferSize()); | ||
| 36 | |||
| 35 | IPC::ResponseBuilder rb{ctx, 3}; | 37 | IPC::ResponseBuilder rb{ctx, 3}; |
| 36 | rb.Push(RESULT_SUCCESS); | 38 | rb.Push(RESULT_SUCCESS); |
| 37 | if (ctx.BufferDescriptorA()[0].Size() != 0) { | 39 | rb.Push(nvdrv->Ioctl(fd, command, ctx.ReadBuffer(), output)); |
| 38 | auto input_buffer = ctx.BufferDescriptorA()[0]; | 40 | |
| 39 | auto output_buffer = ctx.BufferDescriptorB()[0]; | 41 | ctx.WriteBuffer(output); |
| 40 | std::vector<u8> input(input_buffer.Size()); | ||
| 41 | std::vector<u8> output(output_buffer.Size()); | ||
| 42 | Memory::ReadBlock(input_buffer.Address(), input.data(), input_buffer.Size()); | ||
| 43 | rb.Push(nvdrv->Ioctl(fd, command, input, output)); | ||
| 44 | Memory::WriteBlock(output_buffer.Address(), output.data(), output_buffer.Size()); | ||
| 45 | } else { | ||
| 46 | auto input_buffer = ctx.BufferDescriptorX()[0]; | ||
| 47 | auto output_buffer = ctx.BufferDescriptorC()[0]; | ||
| 48 | std::vector<u8> input(input_buffer.size); | ||
| 49 | std::vector<u8> output(output_buffer.size); | ||
| 50 | Memory::ReadBlock(input_buffer.Address(), input.data(), input_buffer.size); | ||
| 51 | rb.Push(nvdrv->Ioctl(fd, command, input, output)); | ||
| 52 | Memory::WriteBlock(output_buffer.Address(), output.data(), output_buffer.size); | ||
| 53 | } | ||
| 54 | } | 42 | } |
| 55 | 43 | ||
| 56 | void NVDRV::Close(Kernel::HLERequestContext& ctx) { | 44 | void NVDRV::Close(Kernel::HLERequestContext& ctx) { |