summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-02-13 23:16:19 -0500
committerGravatar bunnei2018-02-13 23:54:13 -0500
commit516a95721c5ec7ae2f09cb1e7c9757903523d09e (patch)
treeda87ccf3fbe378c9231ff935fd65018303c25040 /src
parentaudio: Use WriteBuffer instead of BufferDescriptorB. (diff)
downloadyuzu-516a95721c5ec7ae2f09cb1e7c9757903523d09e.tar.gz
yuzu-516a95721c5ec7ae2f09cb1e7c9757903523d09e.tar.xz
yuzu-516a95721c5ec7ae2f09cb1e7c9757903523d09e.zip
service: Remove remaining uses of BufferDescriptor*.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/acc/acc_u0.cpp3
-rw-r--r--src/core/hle/service/am/am.cpp6
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp4
-rw-r--r--src/core/hle/service/nvdrv/interface.cpp5
-rw-r--r--src/core/hle/service/set/set.cpp4
5 files changed, 8 insertions, 14 deletions
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp
index ee7d07aa7..7955f726b 100644
--- a/src/core/hle/service/acc/acc_u0.cpp
+++ b/src/core/hle/service/acc/acc_u0.cpp
@@ -66,8 +66,7 @@ void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) {
66 66
67void ACC_U0::ListAllUsers(Kernel::HLERequestContext& ctx) { 67void ACC_U0::ListAllUsers(Kernel::HLERequestContext& ctx) {
68 constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID}; 68 constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID};
69 const auto& output_buffer = ctx.BufferDescriptorC()[0]; 69 ctx.WriteBuffer(user_ids.data(), user_ids.size());
70 Memory::WriteBlock(output_buffer.Address(), user_ids.data(), user_ids.size());
71 IPC::ResponseBuilder rb{ctx, 2}; 70 IPC::ResponseBuilder rb{ctx, 2};
72 rb.Push(RESULT_SUCCESS); 71 rb.Push(RESULT_SUCCESS);
73 LOG_DEBUG(Service_ACC, "called"); 72 LOG_DEBUG(Service_ACC, "called");
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 07cea8717..402105ea0 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -306,11 +306,11 @@ private:
306 306
307 u64 offset = rp.Pop<u64>(); 307 u64 offset = rp.Pop<u64>();
308 308
309 const auto& output_buffer = ctx.BufferDescriptorC()[0]; 309 const size_t size{ctx.GetWriteBufferSize()};
310 310
311 ASSERT(offset + output_buffer.Size() <= buffer.size()); 311 ASSERT(offset + size <= buffer.size());
312 312
313 Memory::WriteBlock(output_buffer.Address(), buffer.data() + offset, output_buffer.Size()); 313 ctx.WriteBuffer(buffer.data() + offset, size);
314 314
315 IPC::ResponseBuilder rb{ctx, 2}; 315 IPC::ResponseBuilder rb{ctx, 2};
316 316
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index 34d4fd035..87a07e457 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -33,12 +33,10 @@ private:
33 IPC::RequestParser rp{ctx}; 33 IPC::RequestParser rp{ctx};
34 const s64 offset = rp.Pop<s64>(); 34 const s64 offset = rp.Pop<s64>();
35 const s64 length = rp.Pop<s64>(); 35 const s64 length = rp.Pop<s64>();
36 const auto& descriptor = ctx.BufferDescriptorB()[0];
37 36
38 LOG_DEBUG(Service_FS, "called, offset=0x%llx, length=0x%llx", offset, length); 37 LOG_DEBUG(Service_FS, "called, offset=0x%llx, length=0x%llx", offset, length);
39 38
40 // Error checking 39 // Error checking
41 ASSERT_MSG(length == descriptor.Size(), "unexpected size difference");
42 if (length < 0) { 40 if (length < 0) {
43 IPC::ResponseBuilder rb{ctx, 2}; 41 IPC::ResponseBuilder rb{ctx, 2};
44 rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidLength)); 42 rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidLength));
@@ -60,7 +58,7 @@ private:
60 } 58 }
61 59
62 // Write the data to memory 60 // Write the data to memory
63 Memory::WriteBlock(descriptor.Address(), output.data(), descriptor.Size()); 61 ctx.WriteBuffer(output);
64 62
65 IPC::ResponseBuilder rb{ctx, 2}; 63 IPC::ResponseBuilder rb{ctx, 2};
66 rb.Push(RESULT_SUCCESS); 64 rb.Push(RESULT_SUCCESS);
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp
index 13d23291e..1e50d218a 100644
--- a/src/core/hle/service/nvdrv/interface.cpp
+++ b/src/core/hle/service/nvdrv/interface.cpp
@@ -14,9 +14,8 @@ namespace Nvidia {
14void NVDRV::Open(Kernel::HLERequestContext& ctx) { 14void NVDRV::Open(Kernel::HLERequestContext& ctx) {
15 LOG_DEBUG(Service_NVDRV, "called"); 15 LOG_DEBUG(Service_NVDRV, "called");
16 16
17 auto buffer = ctx.BufferDescriptorA()[0]; 17 const auto& buffer = ctx.ReadBuffer();
18 18 std::string device_name(buffer.begin(), buffer.end());
19 std::string device_name = Memory::ReadCString(buffer.Address(), buffer.Size());
20 19
21 u32 fd = nvdrv->Open(device_name); 20 u32 fd = nvdrv->Open(device_name);
22 IPC::ResponseBuilder rb{ctx, 4}; 21 IPC::ResponseBuilder rb{ctx, 4};
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index 1062ba8b3..3001ee411 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -17,9 +17,7 @@ void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) {
17 u32 id = rp.Pop<u32>(); 17 u32 id = rp.Pop<u32>();
18 constexpr std::array<u8, 13> lang_codes{}; 18 constexpr std::array<u8, 13> lang_codes{};
19 19
20 const auto& output_buffer = ctx.BufferDescriptorC()[0]; 20 ctx.WriteBuffer(lang_codes.data(), lang_codes.size());
21
22 Memory::WriteBlock(output_buffer.Address(), lang_codes.data(), lang_codes.size());
23 21
24 IPC::ResponseBuilder rb{ctx, 2}; 22 IPC::ResponseBuilder rb{ctx, 2};
25 23