mirror of
https://github.com/XunilGroup/libxunil.git
synced 2026-04-25 11:39:02 +02:00
Add a new keyboard module which handles the kbd_read syscall and add the
required headers and keycode constants to make it work.
This commit is contained in:
@@ -19,6 +19,7 @@ pub const UNLINK: usize = 87;
|
||||
pub const GETDENTS64: usize = 217;
|
||||
pub const CLOCK_GETTIME: usize = 228;
|
||||
pub const EXIT_GROUP: usize = 231;
|
||||
pub const KBD_READ: usize = 666;
|
||||
pub const SLEEP: usize = 909090; // zzz haha
|
||||
pub const DRAW_PIXEL: usize = 5555;
|
||||
pub const DRAW_BUFFER: usize = 7777;
|
||||
@@ -57,6 +58,24 @@ pub unsafe fn syscall1(num: usize, arg0: isize) -> isize {
|
||||
ret
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub unsafe fn syscall2(num: usize, arg0: isize, arg1: isize) -> isize {
|
||||
let ret: isize;
|
||||
unsafe {
|
||||
core::arch::asm!(
|
||||
"int 0x80",
|
||||
in("rax") num,
|
||||
in("rdi") arg0,
|
||||
in("rsi") arg1,
|
||||
lateout("rax") ret,
|
||||
clobber_abi("sysv64"),
|
||||
options(nostack)
|
||||
);
|
||||
}
|
||||
|
||||
ret
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub unsafe fn syscall3(num: usize, arg0: isize, arg1: isize, arg2: isize) -> isize {
|
||||
let ret: isize;
|
||||
|
||||
Reference in New Issue
Block a user