From bd7380ce6a377ca85cbcd3c82be8c07d52cb9f46 Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Mon, 18 Sep 2023 00:05:22 +0000 Subject: [PATCH] crates/examples: Improve hello world examples Signed-off-by: Nick Spinale --- crates/examples/microkit/hello/pds/hello/src/main.rs | 10 +++++++--- crates/examples/root-task/hello/src/main.rs | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/examples/microkit/hello/pds/hello/src/main.rs b/crates/examples/microkit/hello/pds/hello/src/main.rs index 5aaf8a4a5..c29cffe16 100644 --- a/crates/examples/microkit/hello/pds/hello/src/main.rs +++ b/crates/examples/microkit/hello/pds/hello/src/main.rs @@ -1,10 +1,14 @@ #![no_std] #![no_main] -use sel4_microkit::{debug_println, protection_domain, NullHandler}; +use sel4_microkit::{debug_println, protection_domain, Handler}; #[protection_domain] -fn init() -> NullHandler { +fn init() -> HandlerImpl { debug_println!("Hello, World!"); - NullHandler::new() + HandlerImpl } + +struct HandlerImpl; + +impl Handler for HandlerImpl {} diff --git a/crates/examples/root-task/hello/src/main.rs b/crates/examples/root-task/hello/src/main.rs index e50e77d03..a639ce1e0 100644 --- a/crates/examples/root-task/hello/src/main.rs +++ b/crates/examples/root-task/hello/src/main.rs @@ -5,10 +5,10 @@ use sel4_root_task::root_task; #[root_task] -fn main(_bootinfo: &sel4::BootInfo) -> sel4::Result { +fn main(_bootinfo: &sel4::BootInfo) -> ! { sel4::debug_println!("Hello, World!"); - sel4::BootInfo::init_thread_tcb().tcb_suspend()?; + sel4::BootInfo::init_thread_tcb().tcb_suspend().unwrap(); unreachable!() }