Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/ia32/ia32_exception.S
Show All 34 Lines | |||||
* Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80) | * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80) | ||||
* | * | ||||
* This is a SDT_SYSIDT entry point (unlike the i386 port) so that we | * This is a SDT_SYSIDT entry point (unlike the i386 port) so that we | ||||
* can do a swapgs before enabling interrupts. This is critical because | * can do a swapgs before enabling interrupts. This is critical because | ||||
* if we took an interrupt before swapgs, the interrupt code would see | * if we took an interrupt before swapgs, the interrupt code would see | ||||
* that it originated in supervisor mode and skip the swapgs. | * that it originated in supervisor mode and skip the swapgs. | ||||
*/ | */ | ||||
SUPERALIGN_TEXT | SUPERALIGN_TEXT | ||||
IDTVEC(int0x80_syscall_pti) | |||||
PTI_UENTRY has_err=0 | |||||
jmp int0x80_syscall_common | |||||
SUPERALIGN_TEXT | |||||
IDTVEC(int0x80_syscall) | IDTVEC(int0x80_syscall) | ||||
swapgs | swapgs | ||||
int0x80_syscall_common: | |||||
pushq $2 /* sizeof "int 0x80" */ | pushq $2 /* sizeof "int 0x80" */ | ||||
subq $TF_ERR,%rsp /* skip over tf_trapno */ | subq $TF_ERR,%rsp /* skip over tf_trapno */ | ||||
movq %rdi,TF_RDI(%rsp) | movq %rdi,TF_RDI(%rsp) | ||||
movq PCPU(CURPCB),%rdi | movq PCPU(CURPCB),%rdi | ||||
andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) | andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) | ||||
movw %fs,TF_FS(%rsp) | movw %fs,TF_FS(%rsp) | ||||
movw %gs,TF_GS(%rsp) | movw %gs,TF_GS(%rsp) | ||||
movw %es,TF_ES(%rsp) | movw %es,TF_ES(%rsp) | ||||
Show All 23 Lines |