ports/emulators/qemu-devel/files/extra-patch-bsd-user-arm-target_arch_thread.h
Juergen Lock b3f3b52f4a Four more bsd-user fixes, poudriere now builds more armv6 packages
and sparc64 dynamic exectuables get a little further:

- Fix crashes with long argv invocations. [1]
- Fix ARMv6 stack alignment in a new thread. [1]
- sparc64: sync ccr before changing carry flag.
- Writing to readonly page can cause trap 0xc on FreeBSD too.
- Bump PORTREVISION.

Submitted by:	sson [1]
2014-07-06 16:11:28 +00:00

15 lines
646 B
C

diff --git a/bsd-user/arm/target_arch_thread.h b/bsd-user/arm/target_arch_thread.h
index e69f612..ee4d67d 100644
--- a/bsd-user/arm/target_arch_thread.h
+++ b/bsd-user/arm/target_arch_thread.h
@@ -29,8 +29,8 @@ static inline void target_thread_set_upcall(CPUARMState *regs, abi_ulong entry,
* Make sure the stack is properly aligned.
* arm/include/param.h (STACKLIGN() macro)
*/
- sp = ((u_int)(stack_base + stack_size) & ~(8-1)) -
- sizeof(struct target_trapframe);
+ sp = (u_int)((stack_base + stack_size) -
+ sizeof(struct target_trapframe)) & ~0x7;
/* sp = stack base */
regs->regs[13] = sp;