1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
kvisc/ka/sys/intr/common.k
2019-07-10 20:11:35 +02:00

44 lines
734 B
Plaintext

; The OS/K Team licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
TrapHandlers.prolog:
mov q[rbp-8], r11
mov q[rbp-16], r12
mov q[rbp-24], r13
sub rsp, rbp, 24
mov rdx, cr2
; nx0 = caller's cr2
mov ax0, r12
mov ax1, $cr2
iocall CPUDEV, RFS.LoadReg.slot
mov nx0, cr2
mov cr2, rdx
xor rdx, rdx
jmp rcx
TrapHandlers.epilog:
mov r13, q[rbp-24]
mov r12, q[rbp-16]
mov r11, q[rbp-8]
; TRAP return values: RAX-RDX
mov ax0, r12
mov ax1, $rax
mov ax2, rax
call RFS.StoreReg
mov ax1, $rdx
mov ax2, rdx
call RFS.StoreReg
mov ax0, r11
call IDT.DoneHandling
iret