From jelal.kn-bremen.de!nox Fri Feb 19 19:29:25 2010 Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id o1JITPhK036562 for ; Fri, 19 Feb 2010 19:29:25 +0100 (CET) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id o1JITPSd036561 for av1474@comtv.ru; Fri, 19 Feb 2010 19:29:25 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Fri, 19 Feb 2010 19:29:25 +0100 To: malc Subject: [PATCH 2/3v2] Add FreeBSD/ppc host ucontext definitions. Message-ID: <20100219182925.GA36415@triton8.kn-bremen.de> References: <20100219182823.GA36398@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100219182823.GA36398@triton8.kn-bremen.de> User-Agent: Mutt/1.5.20 (2009-06-14) Submitted by: Andreas Tobler Signed-off-by: Juergen Lock --- a/cpu-exec.c +++ b/cpu-exec.c @@ -933,6 +933,20 @@ # define TRAP_sig(context) REG_sig(trap, context) #endif /* linux */ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#include +# 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 typedef struct ucontext SIGCONTEXT; @@ -962,7 +976,11 @@ 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;