2019-07-09 19:51:03 +02:00
|
|
|
; 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:
|
2019-07-17 22:25:50 +02:00
|
|
|
mov rbp, rsp
|
2019-07-09 19:51:03 +02:00
|
|
|
|
2019-07-10 17:17:45 +02:00
|
|
|
; nx0 = caller's cr2
|
2019-08-03 17:41:44 +02:00
|
|
|
call RFS.LoadReg, r14, $cr2
|
2019-07-10 20:11:35 +02:00
|
|
|
|
2019-07-24 16:52:26 +02:00
|
|
|
; we don't preserve the r12 we got
|
2019-07-22 13:18:13 +02:00
|
|
|
mov r12, rax
|
2019-07-17 22:25:50 +02:00
|
|
|
mov rdx, zero
|
2019-07-10 17:17:45 +02:00
|
|
|
|
2019-07-10 20:11:35 +02:00
|
|
|
jmp rcx
|
2019-07-09 19:51:03 +02:00
|
|
|
|
|
|
|
TrapHandlers.epilog:
|
|
|
|
|
2019-07-10 12:26:15 +02:00
|
|
|
; TRAP return values: RAX-RDX
|
|
|
|
|
|
|
|
mov ax2, rax
|
2019-07-22 13:18:13 +02:00
|
|
|
call RFS.StoreReg, r14, $rax
|
2019-07-10 12:28:20 +02:00
|
|
|
|
2019-07-10 12:26:15 +02:00
|
|
|
mov ax2, rdx
|
2019-07-22 13:18:13 +02:00
|
|
|
call RFS.StoreReg, r14, $rdx
|
2019-07-10 12:26:15 +02:00
|
|
|
|
2019-07-22 13:18:13 +02:00
|
|
|
call IDT.DoneHandling, r13
|
2019-07-10 20:11:35 +02:00
|
|
|
|
2019-07-09 19:51:03 +02:00
|
|
|
iret
|
|
|
|
|