mirror of
https://github.com/PabloMK7/citra.git
synced 2025-10-11 20:10:03 +00:00
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:
parent
811303ea54
commit
5a7f615da1
132 changed files with 2807 additions and 2995 deletions
|
@ -130,21 +130,22 @@ void PLG_LDR::OnProcessExit(Kernel::Process& process, Kernel::KernelSystem& kern
|
|||
}
|
||||
|
||||
ResultVal<Kernel::Handle> PLG_LDR::GetMemoryChangedHandle(Kernel::KernelSystem& kernel) {
|
||||
if (plgldr_context.memory_changed_handle)
|
||||
if (plgldr_context.memory_changed_handle) {
|
||||
return plgldr_context.memory_changed_handle;
|
||||
}
|
||||
|
||||
std::shared_ptr<Kernel::Event> evt = kernel.CreateEvent(
|
||||
Kernel::ResetType::OneShot,
|
||||
fmt::format("event-{:08x}", Core::System::GetInstance().GetRunningCore().GetReg(14)));
|
||||
CASCADE_RESULT(plgldr_context.memory_changed_handle,
|
||||
kernel.GetCurrentProcess()->handle_table.Create(std::move(evt)));
|
||||
|
||||
R_TRY(kernel.GetCurrentProcess()->handle_table.Create(
|
||||
std::addressof(plgldr_context.memory_changed_handle), std::move(evt)));
|
||||
return plgldr_context.memory_changed_handle;
|
||||
}
|
||||
|
||||
void PLG_LDR::OnMemoryChanged(Kernel::Process& process, Kernel::KernelSystem& kernel) {
|
||||
if (!plgldr_context.plugin_loaded || !plgldr_context.memory_changed_handle)
|
||||
if (!plgldr_context.plugin_loaded || !plgldr_context.memory_changed_handle) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::shared_ptr<Kernel::Event> evt =
|
||||
kernel.GetCurrentProcess()->handle_table.Get<Kernel::Event>(
|
||||
|
@ -159,7 +160,7 @@ void PLG_LDR::IsEnabled(Kernel::HLERequestContext& ctx) {
|
|||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(plgldr_context.is_enabled);
|
||||
}
|
||||
|
||||
|
@ -173,7 +174,7 @@ void PLG_LDR::SetEnabled(Kernel::HLERequestContext& ctx) {
|
|||
Settings::values.plugin_loader_enabled.SetValue(enabled);
|
||||
}
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push((can_change) ? RESULT_SUCCESS : Kernel::ERR_NOT_AUTHORIZED);
|
||||
rb.Push((can_change) ? ResultSuccess : Kernel::ResultNotAuthorized);
|
||||
}
|
||||
|
||||
void PLG_LDR::SetLoadSettings(Kernel::HLERequestContext& ctx) {
|
||||
|
@ -197,7 +198,7 @@ void PLG_LDR::SetLoadSettings(Kernel::HLERequestContext& ctx) {
|
|||
std::min(sizeof(PluginLoaderContext::PluginLoadParameters::config), config.GetSize()));
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void PLG_LDR::DisplayErrorMessage(Kernel::HLERequestContext& ctx) {
|
||||
|
@ -219,14 +220,14 @@ void PLG_LDR::DisplayErrorMessage(Kernel::HLERequestContext& ctx) {
|
|||
std::string(title_data.data()), std::string(desc_data.data()));
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void PLG_LDR::GetPLGLDRVersion(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(plgldr_version.raw);
|
||||
}
|
||||
|
||||
|
@ -238,7 +239,7 @@ void PLG_LDR::GetArbiter(Kernel::HLERequestContext& ctx) {
|
|||
// signal the plgldr service thread when a event is ready. Instead we just send
|
||||
// an error and the 3GX plugin will take care of it.
|
||||
// (We never send any events anyways)
|
||||
rb.Push(Kernel::ERR_NOT_IMPLEMENTED);
|
||||
rb.Push(Kernel::ResultNotImplemented);
|
||||
}
|
||||
|
||||
void PLG_LDR::GetPluginPath(Kernel::HLERequestContext& ctx) {
|
||||
|
@ -259,7 +260,7 @@ void PLG_LDR::GetPluginPath(Kernel::HLERequestContext& ctx) {
|
|||
path.Write(plugin_path.c_str(), 0, std::min(path.GetSize(), plugin_path.length() + 1));
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushMappedBuffer(path);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue