mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
context: irq
This commit is contained in:
@@ -27,6 +27,7 @@ arch_context_switch:
|
|||||||
pop r15
|
pop r15
|
||||||
pop rdi
|
pop rdi
|
||||||
pop rsi
|
pop rsi
|
||||||
|
add rsp,8 ; remove irq
|
||||||
pop rbp
|
pop rbp
|
||||||
add rsp,8 ; remove error code
|
add rsp,8 ; remove error code
|
||||||
|
|
||||||
@@ -60,6 +61,7 @@ arch_context_saveandcall:
|
|||||||
push r11 ; return address
|
push r11 ; return address
|
||||||
sub rsp, 8 ; error code
|
sub rsp, 8 ; error code
|
||||||
push rbp
|
push rbp
|
||||||
|
sub rsp, 8 ; irq
|
||||||
push rsi
|
push rsi
|
||||||
push rdi
|
push rdi
|
||||||
push r15
|
push r15
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ isr_%+ i:
|
|||||||
|
|
||||||
push rbp ; this push is here to free a register
|
push rbp ; this push is here to free a register
|
||||||
mov rbp, i
|
mov rbp, i
|
||||||
|
|
||||||
jmp isr_common
|
jmp isr_common
|
||||||
%assign i i + 1
|
%assign i i + 1
|
||||||
%endrep
|
%endrep
|
||||||
@@ -21,6 +22,7 @@ isr_common:
|
|||||||
swapgs
|
swapgs
|
||||||
.notneeded1:
|
.notneeded1:
|
||||||
; push context
|
; push context
|
||||||
|
push rbp ; push irq num
|
||||||
push rsi
|
push rsi
|
||||||
push rdi
|
push rdi
|
||||||
push r15
|
push r15
|
||||||
@@ -80,6 +82,7 @@ isr_common:
|
|||||||
pop r15
|
pop r15
|
||||||
pop rdi
|
pop rdi
|
||||||
pop rsi
|
pop rsi
|
||||||
|
add rsp,8 ; remove irq
|
||||||
pop rbp
|
pop rbp
|
||||||
add rsp,8 ; remove error code
|
add rsp,8 ; remove error code
|
||||||
|
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ arch_syscall_entry:
|
|||||||
push qword rcx ; save return RIP
|
push qword rcx ; save return RIP
|
||||||
push qword 0 ; error
|
push qword 0 ; error
|
||||||
push rbp
|
push rbp
|
||||||
|
push qword 0 ; irq
|
||||||
push rsi
|
push rsi
|
||||||
push rdi
|
push rdi
|
||||||
push r15
|
push r15
|
||||||
@@ -315,6 +316,7 @@ arch_syscall_entry:
|
|||||||
pop r15
|
pop r15
|
||||||
pop rdi
|
pop rdi
|
||||||
pop rsi
|
pop rsi
|
||||||
|
add rsp, 8 ; remove irq
|
||||||
pop rbp
|
pop rbp
|
||||||
add rsp, 8 ; remove error code
|
add rsp, 8 ; remove error code
|
||||||
pop rcx
|
pop rcx
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ typedef struct {
|
|||||||
uint64_t r15;
|
uint64_t r15;
|
||||||
uint64_t rdi;
|
uint64_t rdi;
|
||||||
uint64_t rsi;
|
uint64_t rsi;
|
||||||
|
uint64_t irq;
|
||||||
uint64_t rbp;
|
uint64_t rbp;
|
||||||
uint64_t error;
|
uint64_t error;
|
||||||
uint64_t rip;
|
uint64_t rip;
|
||||||
@@ -67,6 +68,7 @@ typedef struct {
|
|||||||
#define CTX_IP(x) (x)->rip
|
#define CTX_IP(x) (x)->rip
|
||||||
#define CTX_RET(x) (x)->rax
|
#define CTX_RET(x) (x)->rax
|
||||||
#define CTX_ERRNO(x) (x)->rdx
|
#define CTX_ERRNO(x) (x)->rdx
|
||||||
|
#define CTX_TRAP_ADDR(x) (x)->cr2
|
||||||
#define CTX_ARG0(x) (x)->rdi
|
#define CTX_ARG0(x) (x)->rdi
|
||||||
#define CTX_ARG1(x) (x)->rsi
|
#define CTX_ARG1(x) (x)->rsi
|
||||||
#define CTX_ARG2(x) (x)->rdx
|
#define CTX_ARG2(x) (x)->rdx
|
||||||
|
|||||||
Reference in New Issue
Block a user