Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/ia32/ia32_signal.c
Show First 20 Lines • Show All 529 Lines • ▼ Show 20 Lines | |||||
#ifdef DEBUG | #ifdef DEBUG | ||||
printf("process %ld has trashed its stack\n", (long)p->p_pid); | printf("process %ld has trashed its stack\n", (long)p->p_pid); | ||||
#endif | #endif | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
sigexit(td, SIGILL); | sigexit(td, SIGILL); | ||||
} | } | ||||
regs->tf_rsp = (uintptr_t)sfp; | regs->tf_rsp = (uintptr_t)sfp; | ||||
regs->tf_rip = p->p_sysent->sv_sigcode_base + | regs->tf_rip = PROC_SIGCODE(p) + | ||||
VDSO_FREEBSD4_IA32_SIGCODE_OFFSET - VDSO_IA32_SIGCODE_OFFSET; | VDSO_FREEBSD4_IA32_SIGCODE_OFFSET - VDSO_IA32_SIGCODE_OFFSET; | ||||
regs->tf_rflags &= ~(PSL_T | PSL_D); | regs->tf_rflags &= ~(PSL_T | PSL_D); | ||||
regs->tf_cs = _ucode32sel; | regs->tf_cs = _ucode32sel; | ||||
regs->tf_ss = _udatasel; | regs->tf_ss = _udatasel; | ||||
regs->tf_ds = _udatasel; | regs->tf_ds = _udatasel; | ||||
regs->tf_es = _udatasel; | regs->tf_es = _udatasel; | ||||
set_pcb_flags(td->td_pcb, PCB_FULL_IRET); | set_pcb_flags(td->td_pcb, PCB_FULL_IRET); | ||||
/* leave user %fs and %gs untouched */ | /* leave user %fs and %gs untouched */ | ||||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | #ifdef DEBUG | ||||
printf("process %ld has trashed its stack\n", (long)p->p_pid); | printf("process %ld has trashed its stack\n", (long)p->p_pid); | ||||
#endif | #endif | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
sigexit(td, SIGILL); | sigexit(td, SIGILL); | ||||
} | } | ||||
fpstate_drop(td); | fpstate_drop(td); | ||||
regs->tf_rsp = (uintptr_t)sfp; | regs->tf_rsp = (uintptr_t)sfp; | ||||
regs->tf_rip = p->p_sysent->sv_sigcode_base; | regs->tf_rip = PROC_SIGCODE(p); | ||||
regs->tf_rflags &= ~(PSL_T | PSL_D); | regs->tf_rflags &= ~(PSL_T | PSL_D); | ||||
regs->tf_cs = _ucode32sel; | regs->tf_cs = _ucode32sel; | ||||
regs->tf_ss = _udatasel; | regs->tf_ss = _udatasel; | ||||
regs->tf_ds = _udatasel; | regs->tf_ds = _udatasel; | ||||
regs->tf_es = _udatasel; | regs->tf_es = _udatasel; | ||||
set_pcb_flags(td->td_pcb, PCB_FULL_IRET); | set_pcb_flags(td->td_pcb, PCB_FULL_IRET); | ||||
/* XXXKIB leave user %fs and %gs untouched */ | /* XXXKIB leave user %fs and %gs untouched */ | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
▲ Show 20 Lines • Show All 283 Lines • Show Last 20 Lines |