summaryrefslogtreecommitdiffstats
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-10 07:29:34 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-10 07:29:34 +0000
commitd39bb24a0afd9c490b157ac11f710e6f5acc9fc4 (patch)
tree81e41acbbf6ecaad06ccf471cf3060c3cee00d1a /cpu-exec.c
parentd758525180e0efff8a59cfea11f5f8348014ff6a (diff)
downloadhqemu-d39bb24a0afd9c490b157ac11f710e6f5acc9fc4.zip
hqemu-d39bb24a0afd9c490b157ac11f710e6f5acc9fc4.tar.gz
BSD user: add support for OpenBSD/i386 host
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7065 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 0ce3f98..25ffb28 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -1165,17 +1165,28 @@ static inline int handle_cpu_signal(unsigned long pc, unsigned long address,
# define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->ss.eip))
# define TRAP_sig(context) ((context)->uc_mcontext->es.trapno)
# define ERROR_sig(context) ((context)->uc_mcontext->es.err)
+# define MASK_sig(context) ((context)->uc_sigmask)
+#elif defined(__OpenBSD__)
+# define EIP_sig(context) ((context)->sc_eip)
+# define TRAP_sig(context) ((context)->sc_trapno)
+# define ERROR_sig(context) ((context)->sc_err)
+# define MASK_sig(context) ((context)->sc_mask)
#else
# define EIP_sig(context) ((context)->uc_mcontext.gregs[REG_EIP])
# define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO])
# define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR])
+# define MASK_sig(context) ((context)->uc_sigmask)
#endif
int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
+#if defined(__OpenBSD__)
+ struct sigcontext *uc = puc;
+#else
struct ucontext *uc = puc;
+#endif
unsigned long pc;
int trapno;
@@ -1190,7 +1201,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
return handle_cpu_signal(pc, (unsigned long)info->si_addr,
trapno == 0xe ?
(ERROR_sig(uc) >> 1) & 1 : 0,
- &uc->uc_sigmask, puc);
+ &MASK_sig(uc), puc);
}
#elif defined(__x86_64__)
OpenPOWER on IntegriCloud