aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include/cpu.h
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2000-11-30 05:23:49 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2000-11-30 05:23:49 +0000
commitd034d459daf039d21ff432e30dfb48c27ac4d09d (patch)
treef3cce8cb66940f910e5e0c8d18a553dea75cf9ac /sys/amd64/include/cpu.h
parent083e9ed543e19ff1706dc609b11ff50ca92f1028 (diff)
downloadsrc-d034d459daf039d21ff432e30dfb48c27ac4d09d.tar.gz
src-d034d459daf039d21ff432e30dfb48c27ac4d09d.zip
Don't use p->p_sigstk.ss_flags to keep state of whether the
process is on the alternate stack or not. For compatibility with sigstack(2) state is being updated if such is needed. We now determine whether the process is on the alternate stack by looking at its stack pointer. This allows a process to siglongjmp from a signal handler on the alternate stack to the place of the sigsetjmp on the normal stack. When maintaining state, this would have invalidated the state information and causing a subsequent signal to be delivered on the normal stack instead of the alternate stack. PR: 22286
Notes
Notes: svn path=/head/; revision=69379
Diffstat (limited to 'sys/amd64/include/cpu.h')
-rw-r--r--sys/amd64/include/cpu.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h
index 669af64c1b47..9293ba29b741 100644
--- a/sys/amd64/include/cpu.h
+++ b/sys/amd64/include/cpu.h
@@ -58,7 +58,8 @@
#define cpu_exec(p) /* nothing */
#define cpu_swapin(p) /* nothing */
-#define cpu_setstack(p, ap) ((p)->p_md.md_regs[SP] = (ap))
+#define cpu_getstack(p) ((p)->p_md.md_regs->tf_esp)
+#define cpu_setstack(p, ap) ((p)->p_md.md_regs->tf_esp = (ap))
#define CLKF_USERMODE(framep) \
((ISPL((framep)->cf_cs) == SEL_UPL) || (framep->cf_eflags & PSL_VM))