mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
it's a trap!
This commit is contained in:
parent
cc4b8724cd
commit
4d89b8656a
@ -2,23 +2,19 @@
|
||||
; See the LICENSE file in the project root for more information.
|
||||
|
||||
TrapHandlers.prolog:
|
||||
sub rsp, rbp, 56
|
||||
mov q[rbp-8], r10
|
||||
mov q[rbp-16], r11
|
||||
mov q[rbp-24], r12
|
||||
mov q[rbp-32], r13
|
||||
mov q[rbp-40], r14
|
||||
mov q[rbp-48], r15
|
||||
sub rsp, rbp, 32
|
||||
mov q[rbp-8], r11
|
||||
mov q[rbp-16], r12
|
||||
mov q[rbp-24], r13
|
||||
cmp q[rsp], r13
|
||||
crash.z
|
||||
|
||||
jmp rax ; go back
|
||||
|
||||
TrapHandlers.epilog:
|
||||
mov r10, q[rbp-8]
|
||||
mov r11, q[rbp-16]
|
||||
mov r12, q[rbp-24]
|
||||
mov r13, q[rbp-32]
|
||||
mov r14, q[rbp-40]
|
||||
mov r15, q[rbp-48]
|
||||
mov r11, q[rbp-8]
|
||||
mov r12, q[rbp-16]
|
||||
mov r13, q[rbp-24]
|
||||
|
||||
mov ax0, r11
|
||||
call IDT.DoneHandling
|
||||
|
10
vm/dv/CPUDEV
10
vm/dv/CPUDEV
@ -61,12 +61,12 @@ When called, a handler will receive the number of the E/I it is handling in R10,
|
||||
and its own RFRAME ID in R11. (in particular, if exception #25 happens and there are no
|
||||
handler for it, the handler #0 that will be called will receive '25' in R10, and '0' in R11).
|
||||
R11 is the value that must be passed to the 'initdone' iocall.
|
||||
The handler will also receive the previous RFRAME ID in R12, the previous RIP in R15 and the
|
||||
previous RPC in R14. R13's content is meaningful only to the processor.
|
||||
The handler will also receive the previous RFRAME ID in R12.
|
||||
R13 is also modified but its value is meaningful only to the processor.
|
||||
|
||||
To return from an E/I, *after* having called 'idtdone', the handler must simply restore
|
||||
R10-R15's values to what they were when the handler started executing, and then use
|
||||
the 'IRET' instruction.
|
||||
To return from an E/I, *after* having called 'idtdone' (using the value originally in R11),
|
||||
the handler must simply restore R12's and R13's values to what they were when the handler
|
||||
started executing, and then use the 'IRET' instruction.
|
||||
|
||||
Clearing the interrupt flag prevents (and queues) maskable hardware interrupts
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user