ia32_syscall.c (937d37fc6c80b2171091fc773eb40bab53d84648) | ia32_syscall.c (bd50262f705c4fed70ea94d16a0f19b5f5497cf2) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-4-Clause 3 * 4 * Copyright (C) 1994, David Greenman 5 * Copyright (c) 1990, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 81 unchanged lines hidden (view full) --- 90#include <machine/sysarch.h> 91#include <machine/frame.h> 92#include <machine/md_var.h> 93#include <machine/pcb.h> 94#include <machine/cpufunc.h> 95 96#define IDTVEC(name) __CONCAT(X,name) 97 | 1/*- 2 * SPDX-License-Identifier: BSD-4-Clause 3 * 4 * Copyright (C) 1994, David Greenman 5 * Copyright (c) 1990, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 81 unchanged lines hidden (view full) --- 90#include <machine/sysarch.h> 91#include <machine/frame.h> 92#include <machine/md_var.h> 93#include <machine/pcb.h> 94#include <machine/cpufunc.h> 95 96#define IDTVEC(name) __CONCAT(X,name) 97 |
98extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(rsvd); | 98extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(int0x80_syscall_pti), 99 IDTVEC(rsvd), IDTVEC(rsvd_pti); |
99 100void ia32_syscall(struct trapframe *frame); /* Called from asm code */ 101 102void 103ia32_set_syscall_retval(struct thread *td, int error) 104{ 105 106 cpu_set_syscall_retval(td, error); --- 96 unchanged lines hidden (view full) --- 203 204 syscallret(td, error); 205} 206 207static void 208ia32_syscall_enable(void *dummy) 209{ 210 | 100 101void ia32_syscall(struct trapframe *frame); /* Called from asm code */ 102 103void 104ia32_set_syscall_retval(struct thread *td, int error) 105{ 106 107 cpu_set_syscall_retval(td, error); --- 96 unchanged lines hidden (view full) --- 204 205 syscallret(td, error); 206} 207 208static void 209ia32_syscall_enable(void *dummy) 210{ 211 |
211 setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYSIGT, SEL_UPL, 0); | 212 setidt(IDT_SYSCALL, pti ? &IDTVEC(int0x80_syscall_pti) : 213 &IDTVEC(int0x80_syscall), SDT_SYSIGT, SEL_UPL, 0); |
212} 213 214static void 215ia32_syscall_disable(void *dummy) 216{ 217 | 214} 215 216static void 217ia32_syscall_disable(void *dummy) 218{ 219 |
218 setidt(IDT_SYSCALL, &IDTVEC(rsvd), SDT_SYSIGT, SEL_KPL, 0); | 220 setidt(IDT_SYSCALL, pti ? &IDTVEC(rsvd_pti) : &IDTVEC(rsvd), 221 SDT_SYSIGT, SEL_KPL, 0); |
219} 220 221SYSINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_enable, NULL); 222SYSUNINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_disable, NULL); 223 224#ifdef COMPAT_43 225int 226setup_lcall_gate(void) --- 27 unchanged lines hidden --- | 222} 223 224SYSINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_enable, NULL); 225SYSUNINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_disable, NULL); 226 227#ifdef COMPAT_43 228int 229setup_lcall_gate(void) --- 27 unchanged lines hidden --- |