]> Git Repo - qemu.git/commitdiff
Add FreeBSD/ppc host ucontext definitions.
authorJuergen Lock <[email protected]>
Fri, 19 Feb 2010 18:29:25 +0000 (19:29 +0100)
committermalc <[email protected]>
Fri, 19 Feb 2010 22:37:33 +0000 (01:37 +0300)
Submitted by: Andreas Tobler <[email protected]>

Signed-off-by: Juergen Lock <[email protected]>
Signed-off-by: malc <[email protected]>
cpu-exec.c

index ab6defca75d43a76c83a37a5a7d6a694517f97a9..7d5b96aa3ccb3740b182392c6d350c52bf4f402b 100644 (file)
@@ -924,6 +924,20 @@ int cpu_signal_handler(int host_signum, void *pinfo,
 # define TRAP_sig(context)                     REG_sig(trap, context)
 #endif /* linux */
 
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <ucontext.h>
+# define IAR_sig(context)              ((context)->uc_mcontext.mc_srr0)
+# define MSR_sig(context)              ((context)->uc_mcontext.mc_srr1)
+# define CTR_sig(context)              ((context)->uc_mcontext.mc_ctr)
+# define XER_sig(context)              ((context)->uc_mcontext.mc_xer)
+# define LR_sig(context)               ((context)->uc_mcontext.mc_lr)
+# define CR_sig(context)               ((context)->uc_mcontext.mc_cr)
+/* Exception Registers access */
+# define DAR_sig(context)              ((context)->uc_mcontext.mc_dar)
+# define DSISR_sig(context)            ((context)->uc_mcontext.mc_dsisr)
+# define TRAP_sig(context)             ((context)->uc_mcontext.mc_exc)
+#endif /* __FreeBSD__|| __FreeBSD_kernel__ */
+
 #ifdef __APPLE__
 # include <sys/ucontext.h>
 typedef struct ucontext SIGCONTEXT;
@@ -953,7 +967,11 @@ int cpu_signal_handler(int host_signum, void *pinfo,
                        void *puc)
 {
     siginfo_t *info = pinfo;
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+    ucontext_t *uc = puc;
+#else
     struct ucontext *uc = puc;
+#endif
     unsigned long pc;
     int is_write;
 
This page took 0.02981 seconds and 4 git commands to generate.