kernel: Update to use atmosphere macros and correct Result (#7242)

* kernel: Switch to atmosphere style macros

* code: Rename ResultCode to Result

* code: Result constants are lower case

* Address review comments

* core: Remove CASCADE_CODE

* R_TRY replaces completely

* core: Run clang format
This commit is contained in:
GPUCode
2023-12-31 19:01:40 +02:00
committed by GitHub
parent 811303ea54
commit 5a7f615da1
132 changed files with 2807 additions and 2995 deletions

View File

@ -126,8 +126,8 @@ void HLERequestContext::AddStaticBuffer(u8 buffer_id, std::vector<u8> data) {
static_buffers[buffer_id] = std::move(data);
}
ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(
const u32_le* src_cmdbuf, std::shared_ptr<Process> src_process_) {
Result HLERequestContext::PopulateFromIncomingCommandBuffer(const u32_le* src_cmdbuf,
std::shared_ptr<Process> src_process_) {
auto& src_process = *src_process_;
IPC::Header header{src_cmdbuf[0]};
@ -203,11 +203,11 @@ ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(
std::move(translated_cmdbuf));
}
return RESULT_SUCCESS;
return ResultSuccess;
}
ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf,
Process& dst_process) const {
Result HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf,
Process& dst_process) const {
IPC::Header header{cmd_buf[0]};
std::size_t untranslated_size = 1u + header.normal_params_size;
@ -239,7 +239,7 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf,
Handle handle = 0;
if (object != nullptr) {
// TODO(yuriks): Figure out the proper error handling for if this fails
handle = dst_process.handle_table.Create(object).Unwrap();
R_ASSERT(dst_process.handle_table.Create(std::addressof(handle), object));
}
dst_cmdbuf[i++] = handle;
}
@ -281,7 +281,7 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf,
std::move(translated_cmdbuf));
}
return RESULT_SUCCESS;
return ResultSuccess;
}
MappedBuffer& HLERequestContext::GetMappedBuffer(u32 id_from_cmdbuf) {