Moved process exit to syscall helper.

Final call moved so syscall is private now.

Also cleans up the macro a fair bit.
This commit is contained in:
Drew Galbraith 2024-07-28 21:01:00 -07:00
parent c2f9f5388b
commit d4f60f4942
2 changed files with 14 additions and 13 deletions

View file

@ -50,18 +50,13 @@ macro_rules! debug {
macro_rules! define_entry {
() => {
#[no_mangle]
pub extern "C" fn _start(init_port: mammoth::zion::z_cap_t) -> ! {
extern "C" {
fn main() -> z_err_t;
}
mammoth::init::parse_init_port(init_port);
mammoth::mem::init_heap();
unsafe {
let err = main();
let req = mammoth::zion::ZProcessExitReq { code: err };
let _ = mammoth::syscall::syscall(mammoth::zion::kZionProcessExit, &req);
}
unreachable!()
pub extern "C" fn _start(init_port: $crate::zion::z_cap_t) -> ! {
$crate::init::parse_init_port(init_port);
$crate::mem::init_heap();
let resp = main();
$crate::syscall::process_exit(resp);
}
};
}