kvisc/ka/sys/intr/common.k

38 lines
659 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 rbp, rsp
sub rsp, rsp, 24
mov q[rbp-8], r13
mov q[rbp-16], r14
mov q[rbp-24], r15
; nx0 = caller's cr2
mov ax0, r14
mov ax1, $cr2
call RFS.LoadReg
mov r12, rax
mov rdx, zero
jmp rcx
TrapHandlers.epilog:
mov r15, q[rbp-24]
mov r14, q[rbp-16]
mov r13, q[rbp-8]
; TRAP return values: RAX-RDX
mov ax2, rax
call RFS.StoreReg, r14, $rax
mov ax2, rdx
call RFS.StoreReg, r14, $rdx
call IDT.DoneHandling, r13
iret