mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 08:37:17 -04:00
Cleanup assembly
This commit is contained in:
parent
559ca93e8d
commit
cff10164f3
@ -27,3 +27,30 @@
|
|||||||
mov gs, eax
|
mov gs, eax
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro save_context
|
||||||
|
push r12
|
||||||
|
push r11
|
||||||
|
push r10
|
||||||
|
push r9
|
||||||
|
push r8
|
||||||
|
push rdi
|
||||||
|
push rsi
|
||||||
|
push rdx
|
||||||
|
push rcx
|
||||||
|
push rbx
|
||||||
|
push rax
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro restore_context
|
||||||
|
pop rax
|
||||||
|
pop rbx
|
||||||
|
pop rcx
|
||||||
|
pop rdx
|
||||||
|
pop rsi
|
||||||
|
pop rdi
|
||||||
|
pop r8
|
||||||
|
pop r9
|
||||||
|
pop r10
|
||||||
|
pop r11
|
||||||
|
pop r12
|
||||||
|
.endm
|
||||||
|
@ -39,17 +39,7 @@ create_irq 15
|
|||||||
// Common handler
|
// Common handler
|
||||||
|
|
||||||
irq_common_handler:
|
irq_common_handler:
|
||||||
push r12
|
save_context
|
||||||
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,17 +47,7 @@ irq_common_handler:
|
|||||||
|
|
||||||
restore_user_segments
|
restore_user_segments
|
||||||
|
|
||||||
pop rax
|
restore_context
|
||||||
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
|
||||||
add rsp, 8
|
add rsp, 8
|
||||||
|
@ -33,17 +33,7 @@ create_syscall 8
|
|||||||
create_syscall 9
|
create_syscall 9
|
||||||
|
|
||||||
syscall_common_handler:
|
syscall_common_handler:
|
||||||
push r12
|
save_context
|
||||||
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
|
||||||
|
|
||||||
@ -51,17 +41,7 @@ syscall_common_handler:
|
|||||||
|
|
||||||
restore_user_segments
|
restore_user_segments
|
||||||
|
|
||||||
pop rax
|
restore_context
|
||||||
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
|
||||||
add rsp, 8
|
add rsp, 8
|
||||||
|
Loading…
x
Reference in New Issue
Block a user