aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-18 06:40:16 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-18 06:40:16 +0000
commitc9e1e2b0ac300d0c2abd6d1f38207b7749b40b49 (patch)
tree9b7dc854926e1d4023dc411a76165d2fe8e75081
parent1f487ee9b8e502c4153f10ce6aa99e1da33df9e9 (diff)
Fix Sparc64 host signal handling
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4484 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--cpu-exec.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 49b4995445..fe309c78d9 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -1297,14 +1297,19 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- uint32_t *regs = (uint32_t *)(info + 1);
- void *sigmask = (regs + 20);
- unsigned long pc;
int is_write;
uint32_t insn;
-
+#if !defined(__sparc_v9__) || defined(HOST_SOLARIS)
+ uint32_t *regs = (uint32_t *)(info + 1);
+ void *sigmask = (regs + 20);
/* XXX: is there a standard glibc define ? */
- pc = regs[1];
+ unsigned long pc = regs[1];
+#else
+ struct sigcontext *sc = puc;
+ unsigned long pc = sc->sigc_regs.tpc;
+ void *sigmask = (void *)sc->sigc_mask;
+#endif
+
/* XXX: need kernel patch to get write flag faster */
is_write = 0;
insn = *(uint32_t *)pc;