Fill in all exception and IRQ entries. Handle PIT, keyboard IRQs
This commit is contained in:
parent
a9a8c2b340
commit
f784e9a06a
1 changed files with 441 additions and 219 deletions
22
arch/x86_64/src/interrupt/syscall.rs
Normal file
22
arch/x86_64/src/interrupt/syscall.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#[naked]
|
||||
pub unsafe extern fn syscall() {
|
||||
extern {
|
||||
fn syscall(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) -> usize;
|
||||
}
|
||||
|
||||
let a;
|
||||
let b;
|
||||
let c;
|
||||
let d;
|
||||
let e;
|
||||
let f;
|
||||
asm!("" : "={rax}"(a), "={rbx}"(b), "={rcx}"(c), "={rdx}"(d), "={rsi}"(e), "={rdi}"(f)
|
||||
: : : "intel", "volatile");
|
||||
|
||||
let a = syscall(a, b, c, d, e, f);
|
||||
|
||||
asm!("" : : "{rax}"(a) : : "intel", "volatile");
|
||||
|
||||
// Pop scratch registers, error code, and return
|
||||
asm!("iretq" : : : : "intel", "volatile");
|
||||
}
|
||||
Loading…
Reference in a new issue