yuzu-emu
/
yuzu
Archived
1
0
Fork 0

service: Remove remaining uses of BufferDescriptor*.

This commit is contained in:
bunnei 2018-02-13 23:16:19 -05:00
parent d6e52581ac
commit 516a95721c
5 changed files with 8 additions and 14 deletions

View File

@ -66,8 +66,7 @@ void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) {
void ACC_U0::ListAllUsers(Kernel::HLERequestContext& ctx) { void ACC_U0::ListAllUsers(Kernel::HLERequestContext& ctx) {
constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID}; constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID};
const auto& output_buffer = ctx.BufferDescriptorC()[0]; ctx.WriteBuffer(user_ids.data(), user_ids.size());
Memory::WriteBlock(output_buffer.Address(), user_ids.data(), user_ids.size());
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_ACC, "called"); LOG_DEBUG(Service_ACC, "called");

View File

@ -306,11 +306,11 @@ private:
u64 offset = rp.Pop<u64>(); u64 offset = rp.Pop<u64>();
const auto& output_buffer = ctx.BufferDescriptorC()[0]; const size_t size{ctx.GetWriteBufferSize()};
ASSERT(offset + output_buffer.Size() <= buffer.size()); ASSERT(offset + size <= buffer.size());
Memory::WriteBlock(output_buffer.Address(), buffer.data() + offset, output_buffer.Size()); ctx.WriteBuffer(buffer.data() + offset, size);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};

View File

@ -33,12 +33,10 @@ private:
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const s64 offset = rp.Pop<s64>(); const s64 offset = rp.Pop<s64>();
const s64 length = rp.Pop<s64>(); const s64 length = rp.Pop<s64>();
const auto& descriptor = ctx.BufferDescriptorB()[0];
LOG_DEBUG(Service_FS, "called, offset=0x%llx, length=0x%llx", offset, length); LOG_DEBUG(Service_FS, "called, offset=0x%llx, length=0x%llx", offset, length);
// Error checking // Error checking
ASSERT_MSG(length == descriptor.Size(), "unexpected size difference");
if (length < 0) { if (length < 0) {
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidLength)); rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidLength));
@ -60,7 +58,7 @@ private:
} }
// Write the data to memory // Write the data to memory
Memory::WriteBlock(descriptor.Address(), output.data(), descriptor.Size()); ctx.WriteBuffer(output);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);

View File

@ -14,9 +14,8 @@ namespace Nvidia {
void NVDRV::Open(Kernel::HLERequestContext& ctx) { void NVDRV::Open(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_NVDRV, "called"); LOG_DEBUG(Service_NVDRV, "called");
auto buffer = ctx.BufferDescriptorA()[0]; const auto& buffer = ctx.ReadBuffer();
std::string device_name(buffer.begin(), buffer.end());
std::string device_name = Memory::ReadCString(buffer.Address(), buffer.Size());
u32 fd = nvdrv->Open(device_name); u32 fd = nvdrv->Open(device_name);
IPC::ResponseBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};

View File

@ -17,9 +17,7 @@ void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) {
u32 id = rp.Pop<u32>(); u32 id = rp.Pop<u32>();
constexpr std::array<u8, 13> lang_codes{}; constexpr std::array<u8, 13> lang_codes{};
const auto& output_buffer = ctx.BufferDescriptorC()[0]; ctx.WriteBuffer(lang_codes.data(), lang_codes.size());
Memory::WriteBlock(output_buffer.Address(), lang_codes.data(), lang_codes.size());
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};