mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-18 17:15:09 -04:00
Unify the regs that are saved by the kernel
This commit is contained in:
parent
545ed86680
commit
559ca93e8d
@ -224,14 +224,14 @@ void _fault_handler(interrupt::fault_regs regs){
|
|||||||
__asm__ __volatile__("hlt" : : );
|
__asm__ __volatile__("hlt" : : );
|
||||||
}
|
}
|
||||||
|
|
||||||
void _irq_handler(size_t code){
|
void _irq_handler(interrupt::syscall_regs regs){
|
||||||
//If there is an handler, call it
|
//If there is an handler, call it
|
||||||
if(irq_handlers[code]){
|
if(irq_handlers[regs.code]){
|
||||||
irq_handlers[code]();
|
irq_handlers[regs.code]();
|
||||||
}
|
}
|
||||||
|
|
||||||
//If the IRQ is on the slave controller, send EOI to it
|
//If the IRQ is on the slave controller, send EOI to it
|
||||||
if(code >= 8){
|
if(regs.code >= 8){
|
||||||
out_byte(0xA0, 0x20);
|
out_byte(0xA0, 0x20);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ void _irq_handler(size_t code){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _syscall_handler(interrupt::syscall_regs regs){
|
void _syscall_handler(interrupt::syscall_regs regs){
|
||||||
//If there is a handler call, it
|
//If there is a handler call it
|
||||||
if(syscall_handlers[regs.code]){
|
if(syscall_handlers[regs.code]){
|
||||||
syscall_handlers[regs.code](regs);
|
syscall_handlers[regs.code](regs);
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
_irq\number:
|
_irq\number:
|
||||||
cli
|
cli
|
||||||
|
|
||||||
push rdi
|
push \number
|
||||||
mov rdi, \number
|
|
||||||
|
|
||||||
jmp irq_common_handler
|
jmp irq_common_handler
|
||||||
.endm
|
.endm
|
||||||
@ -40,16 +39,17 @@ create_irq 15
|
|||||||
// Common handler
|
// Common handler
|
||||||
|
|
||||||
irq_common_handler:
|
irq_common_handler:
|
||||||
push rax
|
|
||||||
push rcx
|
|
||||||
push rdx
|
|
||||||
push rsi
|
|
||||||
push rdi
|
|
||||||
push r8
|
|
||||||
push r9
|
|
||||||
push r10
|
|
||||||
push r11
|
|
||||||
push r12
|
push r12
|
||||||
|
push r11
|
||||||
|
push r10
|
||||||
|
push r9
|
||||||
|
push r8
|
||||||
|
push rdi
|
||||||
|
push rsi
|
||||||
|
push rdx
|
||||||
|
push rcx
|
||||||
|
push rbx
|
||||||
|
push rax
|
||||||
|
|
||||||
restore_kernel_segments
|
restore_kernel_segments
|
||||||
|
|
||||||
@ -57,18 +57,19 @@ irq_common_handler:
|
|||||||
|
|
||||||
restore_user_segments
|
restore_user_segments
|
||||||
|
|
||||||
pop r12
|
|
||||||
pop r11
|
|
||||||
pop r10
|
|
||||||
pop r9
|
|
||||||
pop r8
|
|
||||||
pop rdi
|
|
||||||
pop rsi
|
|
||||||
pop rdx
|
|
||||||
pop rcx
|
|
||||||
pop rax
|
pop rax
|
||||||
|
pop rbx
|
||||||
|
pop rcx
|
||||||
|
pop rdx
|
||||||
|
pop rsi
|
||||||
|
pop rdi
|
||||||
|
pop r8
|
||||||
|
pop r9
|
||||||
|
pop r10
|
||||||
|
pop r11
|
||||||
|
pop r12
|
||||||
|
|
||||||
//Was pushed by the base handler code
|
//Was pushed by the base handler code
|
||||||
pop rdi
|
add rsp, 8
|
||||||
|
|
||||||
iretq // iret will clean the other automatically pushed stuff
|
iretq // iret will clean the other automatically pushed stuff
|
||||||
|
Loading…
x
Reference in New Issue
Block a user