mirror of
https://github.com/XunilGroup/XunilOS.git
synced 2026-04-25 11:49:03 +02:00
relocations, add some more functions to libxunil, use include inside of tests instead of manually defining types and add basic libc header files. Move libxunil to the user folder, and add helloworld and doomgeneric as apps
33 lines
650 B
Rust
33 lines
650 B
Rust
#[inline(always)]
|
|
pub unsafe fn syscall0(num: usize) -> isize {
|
|
let ret: isize;
|
|
unsafe {
|
|
core::arch::asm!(
|
|
"int 0x80",
|
|
in("rax") num,
|
|
lateout("rax") ret,
|
|
options(nostack)
|
|
);
|
|
}
|
|
|
|
ret
|
|
}
|
|
|
|
#[inline(always)]
|
|
pub unsafe fn syscall3(num: usize, arg0: usize, arg1: usize, arg2: usize) -> isize {
|
|
let ret: isize;
|
|
unsafe {
|
|
core::arch::asm!(
|
|
"int 0x80",
|
|
in("rax") num,
|
|
in("rdi") arg0,
|
|
in("rsi") arg1,
|
|
in("rdx") arg2,
|
|
lateout("rax") ret,
|
|
options(nostack)
|
|
);
|
|
}
|
|
|
|
ret
|
|
}
|