From 2c474e8e25af9435e4e45793da728143b54eff9f Mon Sep 17 00:00:00 2001 From: husky Date: Thu, 20 Jul 2023 22:23:30 -0700 Subject: [PATCH] hotfix: invert OFW_TRUE match on call/call-method --- Cargo.toml | 2 +- src/lib.rs | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ee5677b..52b72a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ofw" description = "basic interfacing with OpenFirmware (former IEEE standard 1275)" -version = "0.2.0" +version = "0.2.1" edition = "2021" authors = ["Niko Chow-Stuart "] repository = "https://git.gaycatgirl.sex/voremicrocomputers/vap_os/ofw" diff --git a/src/lib.rs b/src/lib.rs index 32388aa..c03024e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -201,13 +201,16 @@ pub fn ofw_call(entry_fn: EntryFunction, service: NTSTR, num_args: i32, num_rets let result: bool; + // note: i cannot figure out why we must match against !OFW_TRUE instead of OFW_TRUE, + // i haven't found anything in either the ieee 1275 doc or the ppc extension saying that + // this is the case, but it is #[cfg(target_arch = "powerpc")] { - result = entry_fn(&mut generic_args as *mut _ as *mut Args) == OFW_TRUE; + result = entry_fn(&mut generic_args as *mut _ as *mut Args) != OFW_TRUE; } #[cfg(target_arch = "x86_64")] { - result = entry_fn(&mut generic_args as *mut _ as *mut Args) == OFW_TRUE; + result = entry_fn(&mut generic_args as *mut _ as *mut Args) != OFW_TRUE; } result @@ -259,11 +262,11 @@ pub fn ofw_call_method(entry_fn: EntryFunction, ihandle: IHandle, method: NTSTR, #[cfg(target_arch = "powerpc")] { - result = entry_fn(&mut call_method_args as *mut _ as *mut Args) == OFW_TRUE; + result = entry_fn(&mut call_method_args as *mut _ as *mut Args) != OFW_TRUE; } #[cfg(target_arch = "x86_64")] { - result = entry_fn(&mut call_method_args as *mut _ as *mut Args) == OFW_TRUE; + result = entry_fn(&mut call_method_args as *mut _ as *mut Args) != OFW_TRUE; } result