ia32_syscall.c (321343) | ia32_syscall.c (329462) |
---|---|
1/*- 2 * Copyright (C) 1994, David Greenman 3 * Copyright (c) 1990, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the University of Utah, and William Jolitz. 8 * --- 22 unchanged lines hidden (view full) --- 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 */ 37 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 1994, David Greenman 3 * Copyright (c) 1990, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the University of Utah, and William Jolitz. 8 * --- 22 unchanged lines hidden (view full) --- 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: stable/11/sys/amd64/ia32/ia32_syscall.c 321343 2017-07-21 18:06:57Z kib $"); | 39__FBSDID("$FreeBSD: stable/11/sys/amd64/ia32/ia32_syscall.c 329462 2018-02-17 18:00:01Z kib $"); |
40 41/* 42 * 386 Trap and System call handling 43 */ 44 45#include "opt_clock.h" 46#include "opt_compat.h" 47#include "opt_cpu.h" --- 40 unchanged lines hidden (view full) --- 88#include <machine/sysarch.h> 89#include <machine/frame.h> 90#include <machine/md_var.h> 91#include <machine/pcb.h> 92#include <machine/cpufunc.h> 93 94#define IDTVEC(name) __CONCAT(X,name) 95 | 40 41/* 42 * 386 Trap and System call handling 43 */ 44 45#include "opt_clock.h" 46#include "opt_compat.h" 47#include "opt_cpu.h" --- 40 unchanged lines hidden (view full) --- 88#include <machine/sysarch.h> 89#include <machine/frame.h> 90#include <machine/md_var.h> 91#include <machine/pcb.h> 92#include <machine/cpufunc.h> 93 94#define IDTVEC(name) __CONCAT(X,name) 95 |
96extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(rsvd); | 96extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(int0x80_syscall_pti), 97 IDTVEC(rsvd), IDTVEC(rsvd_pti); |
97 98void ia32_syscall(struct trapframe *frame); /* Called from asm code */ 99 100void 101ia32_set_syscall_retval(struct thread *td, int error) 102{ 103 104 cpu_set_syscall_retval(td, error); --- 96 unchanged lines hidden (view full) --- 201 202 syscallret(td, error); 203} 204 205static void 206ia32_syscall_enable(void *dummy) 207{ 208 | 98 99void ia32_syscall(struct trapframe *frame); /* Called from asm code */ 100 101void 102ia32_set_syscall_retval(struct thread *td, int error) 103{ 104 105 cpu_set_syscall_retval(td, error); --- 96 unchanged lines hidden (view full) --- 202 203 syscallret(td, error); 204} 205 206static void 207ia32_syscall_enable(void *dummy) 208{ 209 |
209 setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYSIGT, SEL_UPL, 0); | 210 setidt(IDT_SYSCALL, pti ? &IDTVEC(int0x80_syscall_pti) : 211 &IDTVEC(int0x80_syscall), SDT_SYSIGT, SEL_UPL, 0); |
210} 211 212static void 213ia32_syscall_disable(void *dummy) 214{ 215 | 212} 213 214static void 215ia32_syscall_disable(void *dummy) 216{ 217 |
216 setidt(IDT_SYSCALL, &IDTVEC(rsvd), SDT_SYSIGT, SEL_KPL, 0); | 218 setidt(IDT_SYSCALL, pti ? &IDTVEC(rsvd_pti) : &IDTVEC(rsvd), 219 SDT_SYSIGT, SEL_KPL, 0); |
217} 218 219SYSINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_enable, NULL); 220SYSUNINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_disable, NULL); 221 222#ifdef COMPAT_43 223int 224setup_lcall_gate(void) --- 27 unchanged lines hidden --- | 220} 221 222SYSINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_enable, NULL); 223SYSUNINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_disable, NULL); 224 225#ifdef COMPAT_43 226int 227setup_lcall_gate(void) --- 27 unchanged lines hidden --- |