void-packages/srcpkgs/qemu/patches/musl-ppc64-pt_regs.patch

17 lines
672 B
Diff
Raw Normal View History

On musl, the regs field in uc_mcontext is void * so it is necessary to
cast it. The sys/user.h include is to get access to definition of pt_regs.
--- accel/tcg/user-exec.c
+++ accel/tcg/user-exec.c
@@ -285,9 +285,10 @@ int cpu_signal_handler(int host_signum, void *pinfo,
* From Wine
*/
#ifdef linux
+#include <sys/user.h>
/* All Registers access - only for local access */
#define REG_sig(reg_name, context) \
- ((context)->uc_mcontext.regs->reg_name)
+ (((struct pt_regs *)(context)->uc_mcontext.regs)->reg_name)
/* Gpr Registers access */
#define GPR_sig(reg_num, context) REG_sig(gpr[reg_num], context)
/* Program counter */