summaryrefslogtreecommitdiff
path: root/sys/mips
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2017-08-30 19:21:11 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2017-08-30 19:21:11 +0000
commitb8b3a640005524ffe4f322d5b9c25633864f29a8 (patch)
tree89ff29e36d3a5ec4f7b0b5266aaa6313f28f84fb /sys/mips
parente896328044744ba1d41e9a9b3e9769c99094b2a4 (diff)
downloadsrc-test2-b8b3a640005524ffe4f322d5b9c25633864f29a8.tar.gz
src-test2-b8b3a640005524ffe4f322d5b9c25633864f29a8.zip
Notes
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/mips/pm_machdep.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/mips/mips/pm_machdep.c b/sys/mips/mips/pm_machdep.c
index aa6f59f8c457..7cada0304f4a 100644
--- a/sys/mips/mips/pm_machdep.c
+++ b/sys/mips/mips/pm_machdep.c
@@ -427,15 +427,12 @@ exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
* 0xffffffff80007f00 and the load is instead done from
* 0xffffffff7ffffff0.
*
- * To prevent this, we subtract 64K from the stack pointer here.
- *
- * For consistency, we should just always do this unless we're
- * running n64 programs. For now, since we don't support
- * COMPAT_FREEBSD32 on n64 kernels, we just do it unless we're
- * running n64 kernels.
+ * To prevent this, we subtract 64K from the stack pointer here
+ * for processes with 32-bit pointers.
*/
-#if !defined(__mips_n64)
- td->td_frame->sp -= 65536;
+#if defined(__mips_n32) || defined(__mips_n64)
+ if (!SV_PROC_FLAG(td->td_proc, SV_LP64))
+ td->td_frame->sp -= 65536;
#endif
td->td_frame->pc = imgp->entry_addr & ~3;