ia32_exception.S (ff265077cf2b2694aa0e7b701d30d853404a015a) | ia32_exception.S (bd50262f705c4fed70ea94d16a0f19b5f5497cf2) |
---|---|
1/*- 2 * Copyright (c) 2003 Peter Wemm 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 26 unchanged lines hidden (view full) --- 35 * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80) 36 * 37 * This is a SDT_SYSIDT entry point (unlike the i386 port) so that we 38 * can do a swapgs before enabling interrupts. This is critical because 39 * if we took an interrupt before swapgs, the interrupt code would see 40 * that it originated in supervisor mode and skip the swapgs. 41 */ 42 SUPERALIGN_TEXT | 1/*- 2 * Copyright (c) 2003 Peter Wemm 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 26 unchanged lines hidden (view full) --- 35 * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80) 36 * 37 * This is a SDT_SYSIDT entry point (unlike the i386 port) so that we 38 * can do a swapgs before enabling interrupts. This is critical because 39 * if we took an interrupt before swapgs, the interrupt code would see 40 * that it originated in supervisor mode and skip the swapgs. 41 */ 42 SUPERALIGN_TEXT |
43IDTVEC(int0x80_syscall_pti) 44 PTI_UENTRY has_err=0 45 jmp int0x80_syscall_common 46 SUPERALIGN_TEXT |
|
43IDTVEC(int0x80_syscall) 44 swapgs | 47IDTVEC(int0x80_syscall) 48 swapgs |
49int0x80_syscall_common: |
|
45 pushq $2 /* sizeof "int 0x80" */ 46 subq $TF_ERR,%rsp /* skip over tf_trapno */ 47 movq %rdi,TF_RDI(%rsp) 48 movq PCPU(CURPCB),%rdi 49 andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) | 50 pushq $2 /* sizeof "int 0x80" */ 51 subq $TF_ERR,%rsp /* skip over tf_trapno */ 52 movq %rdi,TF_RDI(%rsp) 53 movq PCPU(CURPCB),%rdi 54 andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) |
50 movw %fs,TF_FS(%rsp) 51 movw %gs,TF_GS(%rsp) 52 movw %es,TF_ES(%rsp) 53 movw %ds,TF_DS(%rsp) | 55 SAVE_SEGS |
54 sti 55 movq %rsi,TF_RSI(%rsp) 56 movq %rdx,TF_RDX(%rsp) 57 movq %rcx,TF_RCX(%rsp) 58 movq %r8,TF_R8(%rsp) 59 movq %r9,TF_R9(%rsp) 60 movq %rax,TF_RAX(%rsp) 61 movq %rbx,TF_RBX(%rsp) --- 14 unchanged lines hidden --- | 56 sti 57 movq %rsi,TF_RSI(%rsp) 58 movq %rdx,TF_RDX(%rsp) 59 movq %rcx,TF_RCX(%rsp) 60 movq %r8,TF_R8(%rsp) 61 movq %r9,TF_R9(%rsp) 62 movq %rax,TF_RAX(%rsp) 63 movq %rbx,TF_RBX(%rsp) --- 14 unchanged lines hidden --- |