use core::ffi::c_int;
pub fn sys_sched_yield() -> c_int {
#[cfg(feature = "multitask")]
axtask::yield_now();
#[cfg(not(feature = "multitask"))]
if cfg!(feature = "irq") {
axhal::arch::wait_for_irqs();
} else {
core::hint::spin_loop();
}
0
}
pub fn sys_getpid() -> c_int {
syscall_body!(sys_getpid,
#[cfg(feature = "multitask")]
{
Ok(axtask::current().id().as_u64() as c_int)
}
#[cfg(not(feature = "multitask"))]
{
Ok(2) }
)
}
pub fn sys_exit(exit_code: c_int) -> ! {
debug!("sys_exit <= {}", exit_code);
#[cfg(feature = "multitask")]
axtask::exit(exit_code);
#[cfg(not(feature = "multitask"))]
axhal::misc::terminate();
}