diff --git a/ipcdefs/loader.id b/ipcdefs/loader.id index 59ace6825..9b33214fc 100644 --- a/ipcdefs/loader.id +++ b/ipcdefs/loader.id @@ -1,4 +1,10 @@ +# A mishmash of Nintendo's loader and pm in a single disgusting service. +# +# Responsible for creating, loading, starting and waiting on processes. interface sunrise_libuser::ldr::ILoaderInterface is ldr:shel { + # Create, load and start the process `title_name` with the given args. + # Returns the process' pid. [0] launch_title(array title_name, array args) -> u64 pid; + # Wait for the process with the given pid, returning the exit status. [1] wait(u64 pid) -> u32 exit_status; } \ No newline at end of file diff --git a/kernel/src/event.rs b/kernel/src/event.rs index d631fb248..133aff679 100644 --- a/kernel/src/event.rs +++ b/kernel/src/event.rs @@ -168,7 +168,7 @@ impl ReadableEvent { /// - The event wasn't signaled. pub fn clear_signal(&self) -> Result<(), KernelError> { let oldstate = self.parent.state.swap(false, Ordering::SeqCst); - if oldstate == false { + if !oldstate { return Err(KernelError::InvalidState { backtrace: Backtrace::new() }) } Ok(()) @@ -210,7 +210,7 @@ impl WritableEvent { /// - The event wasn't signaled. pub fn clear_signal(&self) -> Result<(), KernelError> { let oldstate = self.parent.state.swap(false, Ordering::SeqCst); - if oldstate == false { + if !oldstate { return Err(KernelError::InvalidState { backtrace: Backtrace::new() }) } Ok(()) diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 8792da7ec..acf67bd9a 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -89,10 +89,9 @@ pub use crate::heap_allocator::rust_oom; static ALLOCATOR: heap_allocator::Allocator = heap_allocator::Allocator::new(); use crate::i386::stack; -use crate::paging::{PAGE_SIZE, MappingAccessRights}; +use crate::paging::PAGE_SIZE; use crate::mem::VirtualAddress; -use crate::process::{ProcessStruct, ThreadStruct}; -use sunrise_libkern::MemoryType; +use crate::process::ProcessStruct; use crate::cpu_locals::init_cpu_locals; use sunrise_libkern::process::*; diff --git a/loader/src/main.rs b/loader/src/main.rs index 0cb225e24..6b4ed258d 100644 --- a/loader/src/main.rs +++ b/loader/src/main.rs @@ -197,6 +197,7 @@ lazy_static! { }; } +/// Struct implementing the ldr:shel service. #[derive(Debug, Default)] struct LoaderIface;