[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/62] tcg-s390: Compute is_write in cpu_signal_hand
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 16/62] tcg-s390: Compute is_write in cpu_signal_handler. |
Date: |
Thu, 27 May 2010 13:45:58 -0700 |
Signed-off-by: Richard Henderson <address@hidden>
---
cpu-exec.c | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/cpu-exec.c b/cpu-exec.c
index c776605..026980a 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -1156,11 +1156,47 @@ int cpu_signal_handler(int host_signum, void *pinfo,
siginfo_t *info = pinfo;
struct ucontext *uc = puc;
unsigned long pc;
- int is_write;
+ uint16_t *pinsn;
+ int is_write = 0;
pc = uc->uc_mcontext.psw.addr;
- /* XXX: compute is_write */
- is_write = 0;
+
+ /* ??? On linux, the non-rt signal handler has 4 (!) arguments instead
+ of the normal 2 arguments. The 3rd argument contains the "int_code"
+ from the hardware which does in fact contain the is_write value.
+ The rt signal handler, as far as I can tell, does not give this value
+ at all. Not that we could get to it from here even if it were. */
+ /* ??? This is not even close to complete, since it ignores all
+ of the read-modify-write instructions. */
+ pinsn = (uint16_t *)pc;
+ switch (pinsn[0] >> 8) {
+ case 0x50: /* ST */
+ case 0x42: /* STC */
+ case 0x40: /* STH */
+ is_write = 1;
+ break;
+ case 0xc4: /* RIL format insns */
+ switch (pinsn[0] & 0xf) {
+ case 0xf: /* STRL */
+ case 0xb: /* STGRL */
+ case 0x7: /* STHRL */
+ is_write = 1;
+ }
+ break;
+ case 0xe3: /* RXY format insns */
+ switch (pinsn[2] & 0xff) {
+ case 0x50: /* STY */
+ case 0x24: /* STG */
+ case 0x72: /* STCY */
+ case 0x70: /* STHY */
+ case 0x8e: /* STPQ */
+ case 0x3f: /* STRVH */
+ case 0x3e: /* STRV */
+ case 0x2f: /* STRVG */
+ is_write = 1;
+ }
+ break;
+ }
return handle_cpu_signal(pc, (unsigned long)info->si_addr,
is_write, &uc->uc_sigmask, puc);
}
--
1.7.0.1
- [Qemu-devel] [PATCH 06/62] s390x: Avoid _llseek., (continued)
- [Qemu-devel] [PATCH 06/62] s390x: Avoid _llseek., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 05/62] tcg-s390: Move opcode defines to tcg-target.c., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 07/62] s390x: Don't use a linker script for user-only., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 08/62] tcg-s390: Avoid set-but-not-used werrors., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 09/62] tcg-s390: Mark R0 & R15 reserved., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 11/62] tcg-s390: Move tcg_out_mov up and use it throughout., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 12/62] tcg-s390: Eliminate the S constraint., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 10/62] tcg-s390: R6 is a function argument register, Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 14/62] tcg-s390: Define tcg_target_reg_names., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 13/62] tcg-s390: Add -m64 and -march to s390x compilation., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 16/62] tcg-s390: Compute is_write in cpu_signal_handler.,
Richard Henderson <=
- [Qemu-devel] [PATCH 19/62] tcg-s390: Fixup qemu_ld/st opcodes., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 18/62] tcg-s390: Use matching constraints., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 20/62] tcg-s390: Implement setcond., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 15/62] tcg-s390: Update disassembler from binutils head., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 17/62] tcg-s390: Reorganize instruction emission, Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 21/62] tcg-s390: Generalize the direct load/store emission., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 22/62] tcg-s390: Tidy branches., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 23/62] tcg-s390: Add tgen_calli., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 25/62] tcg-s390: Re-implement tcg_out_movi., Richard Henderson, 2010/05/27
- [Qemu-devel] [PATCH 24/62] tcg-s390: Implement div2., Richard Henderson, 2010/05/27