Skip to content

Commit

Permalink
crates/examples: Improve hello world examples
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <nick@nickspinale.com>
  • Loading branch information
nspin committed Sep 18, 2023
1 parent 351f68e commit bd7380c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions crates/examples/microkit/hello/pds/hello/src/main.rs
Original file line number Diff line number Diff line change
@@ -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 {}
4 changes: 2 additions & 2 deletions crates/examples/root-task/hello/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!()
}

0 comments on commit bd7380c

Please sign in to comment.