diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2010-05-01 14:49:09 -0300 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-05-01 14:49:09 -0300 |
commit | d56ee056f76b81a34cedb4ce65c27512710cd16d (patch) | |
tree | a91799d4c1f5679b398e195aa9f628d55f3a7fd4 /cpu-exec.c | |
parent | 98aef6707ad0be30969835ff26f72398f472d860 (diff) | |
parent | 00a1555e0cff5d710ea63145b18e2915b84b58de (diff) |
Merge commit '00a1555e0cff5d710ea63145b18e2915b84b58de' into upstream-merge
* commit '00a1555e0cff5d710ea63145b18e2915b84b58de': (32 commits)
move around definitions in kvm.h that do not require CPUState
move targphys.h and hw/poison.h inclusion to cpu-common.h
move two variable declarations out of vl.c
move socket_init to qemu-sockets.c
Make virtio-pci building conditional again
target-mips: Fix one more format specifier for cpu_fprintf
target-i386: Fix variable in (disabled) debugging code
Debugcon: Fix debugging printf
target-i386: Fix compiler warning
remove TARGET_* defines from translate-all.c
e1000: fix build on Ubuntu with _FORTIFY_SOURCE
smc91c111: allow access to reserved register
smc91c111: mask register offset
baum: add destroy hook
target-arm: fix neon vmon/vmvn with modified immediate
fix function signature of qemu_chr_open_pty on !linux
Shrink tb_jmp_offset to two entries, the other two are never used.
tcg-hppa: Don't try to calls to non-constant addresses.
tcg-hppa: Fix in/out register overlap in add2/sub2.
tcg-hppa: Finish the port.
...
Conflicts:
kvm.h
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r-- | cpu-exec.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/cpu-exec.c b/cpu-exec.c index 9d47fbb51..a45200a48 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -1205,15 +1205,39 @@ int cpu_signal_handler(int host_signum, void *pinfo, { struct siginfo *info = pinfo; struct ucontext *uc = puc; - unsigned long pc; - int is_write; + unsigned long pc = uc->uc_mcontext.sc_iaoq[0]; + uint32_t insn = *(uint32_t *)pc; + int is_write = 0; + + /* XXX: need kernel patch to get write flag faster. */ + switch (insn >> 26) { + case 0x1a: /* STW */ + case 0x19: /* STH */ + case 0x18: /* STB */ + case 0x1b: /* STWM */ + is_write = 1; + break; + + case 0x09: /* CSTWX, FSTWX, FSTWS */ + case 0x0b: /* CSTDX, FSTDX, FSTDS */ + /* Distinguish from coprocessor load ... */ + is_write = (insn >> 9) & 1; + break; + + case 0x03: + switch ((insn >> 6) & 15) { + case 0xa: /* STWS */ + case 0x9: /* STHS */ + case 0x8: /* STBS */ + case 0xe: /* STWAS */ + case 0xc: /* STBYS */ + is_write = 1; + } + break; + } - pc = uc->uc_mcontext.sc_iaoq[0]; - /* FIXME: compute is_write */ - is_write = 0; return handle_cpu_signal(pc, (unsigned long)info->si_addr, - is_write, - &uc->uc_sigmask, puc); + is_write, &uc->uc_sigmask, puc); } #else |