aboutsummaryrefslogtreecommitdiff
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorJuergen Lock <nox@jelal.kn-bremen.de>2010-02-19 19:29:25 +0100
committermalc <av1474@comtv.ru>2010-02-20 01:37:33 +0300
commit58d9b1e0edf41cf74639172207fb7e4f09ff84e4 (patch)
treeb0d85935564b52fcaab10a984a77c52eb7d73f79 /cpu-exec.c
parente4ee916d3f9a93df06bd498c92767c1558d59a0b (diff)
Add FreeBSD/ppc host ucontext definitions.
Submitted by: Andreas Tobler <andreast@fgznet.ch> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index ab6defca75..7d5b96aa3c 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -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;