extern void unix_syscall64(x86_saved_state_t *);
extern void *find_user_regs(thread_t);
-extern void x86_toggle_sysenter_arg_store(thread_t thread, boolean_t valid);
-extern boolean_t x86_sysenter_arg_store_isvalid(thread_t thread);
-
/* dynamically generated at build time based on syscalls.master */
extern const char *syscallnames[];
struct proc *p;
struct uthread *uthread;
x86_saved_state32_t *regs;
- boolean_t args_in_uthread;
boolean_t is_vfork;
assert(is_saved_state32(state));
code = regs->eax & I386_SYSCALL_NUMBER_MASK;
DEBUG_KPRINT_SYSCALL_UNIX("unix_syscall: code=%d(%s) eip=%u\n",
code, syscallnames[code >= NUM_SYSENT ? 63 : code], (uint32_t)regs->eip);
- args_in_uthread = ((regs->eax & I386_SYSCALL_ARG_BYTES_MASK) != 0) && x86_sysenter_arg_store_isvalid(thread);
params = (vm_offset_t) (regs->uesp + sizeof (int));
regs->efl &= ~(EFL_CF);
}
vt = (void *)uthread->uu_arg;
+ uthread->uu_ap = vt;
if (callp->sy_arg_bytes != 0) {
sy_munge_t *mungerp;
+ uint32_t nargs;
assert((unsigned) callp->sy_arg_bytes <= sizeof (uthread->uu_arg));
- if (!args_in_uthread)
- {
- uint32_t nargs;
- nargs = callp->sy_arg_bytes;
- error = copyin((user_addr_t) params, (char *) vt, nargs);
- if (error) {
- regs->eax = error;
- regs->efl |= EFL_CF;
- thread_exception_return();
- /* NOTREACHED */
- }
+ nargs = callp->sy_arg_bytes;
+ error = copyin((user_addr_t) params, (char *) vt, nargs);
+ if (error) {
+ regs->eax = error;
+ regs->efl |= EFL_CF;
+ thread_exception_return();
+ /* NOTREACHED */
}
if (__probable(code != 180)) {
* delay in order to mitigate the impact of this
* task on the normal operation of the system
*/
- throttle_lowpri_io(TRUE);
+ throttle_lowpri_io(1);
}
if (__probable(code != 180))
KERNEL_DEBUG_CONSTANT_IST(KDEBUG_TRACE,
uargp = (void *)(®s->rsi);
args_in_regs = 5;
}
+ uthread->uu_ap = uargp;
if (callp->sy_narg != 0) {
if (code != 180) {
/* NOTREACHED */
}
}
- /*
- * XXX Turn 64 bit unsafe calls into nosys()
- */
- if (__improbable(callp->sy_flags & UNSAFE_64BIT)) {
- callp = &sysent[63];
- goto unsafe;
- }
} else
KERNEL_DEBUG_CONSTANT_IST(KDEBUG_TRACE,
BSDDBG_CODE(DBG_BSD_EXCP_SC, code) | DBG_FUNC_START,
0, 0, 0, 0, 0);
-unsafe:
/*
* Delayed binding of thread credential to process credential, if we
* delay in order to mitigate the impact of this
* task on the normal operation of the system
*/
- throttle_lowpri_io(TRUE);
+ throttle_lowpri_io(1);
}
if (__probable(code != 180))
KERNEL_DEBUG_CONSTANT_IST(KDEBUG_TRACE,
* delay in order to mitigate the impact of this
* task on the normal operation of the system
*/
- throttle_lowpri_io(TRUE);
+ throttle_lowpri_io(1);
}
if (code != 180)
KERNEL_DEBUG_CONSTANT_IST(KDEBUG_TRACE,
/* NOTREACHED */
}
-void
-munge_wwwlww(
- __unused const void *in32,
- void *out64)
-{
- uint32_t *arg32;
- uint64_t *arg64;
-
- /* we convert in place in out64 */
- arg32 = (uint32_t *) out64;
- arg64 = (uint64_t *) out64;
-
- arg64[5] = arg32[6]; /* wwwlwW */
- arg64[4] = arg32[5]; /* wwwlWw */
- arg32[7] = arg32[4]; /* wwwLww (hi) */
- arg32[6] = arg32[3]; /* wwwLww (lo) */
- arg64[2] = arg32[2]; /* wwWlww */
- arg64[1] = arg32[1]; /* wWwlww */
- arg64[0] = arg32[0]; /* Wwwlww */
-}
-
-
-void
-munge_wwlwww(
- __unused const void *in32,
- void *out64)
-{
- uint32_t *arg32;
- uint64_t *arg64;
-
- /* we convert in place in out64 */
- arg32 = (uint32_t *) out64;
- arg64 = (uint64_t *) out64;
-
- arg64[5] = arg32[6]; /* wwlwwW */
- arg64[4] = arg32[5]; /* wwlwWw */
- arg64[3] = arg32[4]; /* wwlWww */
- arg32[5] = arg32[3]; /* wwLwww (hi) */
- arg32[4] = arg32[2]; /* wwLwww (lo) */
- arg64[1] = arg32[1]; /* wWlwww */
- arg64[0] = arg32[0]; /* Wwlwww */
-}
-