kernel: adjust formatting
This commit is contained in:
@@ -332,80 +332,80 @@ IRQ 223, 255
|
||||
|
||||
isr_common_stub:
|
||||
PUSH_REGS
|
||||
|
||||
|
||||
mov %rsp, %rdi
|
||||
call isr_dispatch
|
||||
|
||||
|
||||
POP_REGS
|
||||
add $16, %rsp
|
||||
iretq
|
||||
|
||||
|
||||
|
||||
.global irq_common_stub
|
||||
.type irq_common_stub, @function
|
||||
|
||||
irq_common_stub:
|
||||
PUSH_REGS
|
||||
|
||||
|
||||
mov %rsp, %rdi
|
||||
call irq_dispatch
|
||||
|
||||
|
||||
POP_REGS
|
||||
add $16, %rsp
|
||||
iretq
|
||||
|
||||
|
||||
|
||||
.global syscall_gate
|
||||
.type syscall_gate, @function
|
||||
|
||||
|
||||
.extern syscall_dispatch
|
||||
.type syscall_dispatch, @function
|
||||
|
||||
|
||||
syscall_gate:
|
||||
swapgs
|
||||
movq %rsp, %gs:20 # GS+20 = rsp2 in the current TSS block (user stack storage)
|
||||
movq %gs:4, %rsp # GS+4 = rsp0 in the current TSS block (per-thread kstack)
|
||||
|
||||
# start building a pf_cpu_context
|
||||
|
||||
# start building a ml_cpu_context
|
||||
pushq $0x1b
|
||||
pushq %gs:20
|
||||
push %r11
|
||||
push $0x23
|
||||
push %rcx
|
||||
|
||||
|
||||
pushq $0
|
||||
pushq $0x80
|
||||
|
||||
|
||||
PUSH_REGS
|
||||
|
||||
|
||||
mov %rsp, %rdi
|
||||
|
||||
|
||||
# switch back to user gs while in syscall_dispatch. Interrupts are enabled in syscall_dispatch,
|
||||
# and if the task gets pre-empted, the incoming task will expect %gs to have its usermode value.
|
||||
swapgs
|
||||
|
||||
|
||||
call syscall_dispatch
|
||||
|
||||
|
||||
POP_REGS
|
||||
|
||||
|
||||
add $16, %rsp
|
||||
pop %rcx
|
||||
add $8, %rsp
|
||||
pop %r11
|
||||
add $16, %rsp
|
||||
|
||||
|
||||
swapgs
|
||||
movq %gs:20, %rsp # GS+20 = rsp2 in the current TSS block
|
||||
swapgs
|
||||
|
||||
|
||||
# back to usermode
|
||||
sysretq
|
||||
|
||||
|
||||
|
||||
.global pf_faultptr
|
||||
.type pf_faultptr, @function
|
||||
pf_faultptr:
|
||||
mov %cr2, %rax
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user