int cpu_x86_signal_handler(int host_signum, struct siginfo *info, 

                           void *puc)

{

    uint32_t *regs = (uint32_t *)(info + 1);

    void *sigmask = (regs + 20);

    unsigned long pc;

    int is_write;

    uint32_t insn;

    

    /* XXX: is there a standard glibc define ? */

    pc = regs[1];

    /* XXX: need kernel patch to get write flag faster */

    is_write = 0;

    insn = *(uint32_t *)pc;

    if ((insn >> 30) == 3) {

      switch((insn >> 19) & 0x3f) {

      case 0x05: // stb

      case 0x06: // sth

      case 0x04: // st

      case 0x07: // std

      case 0x24: // stf

      case 0x27: // stdf

      case 0x25: // stfsr

	is_write = 1;

	break;

      }

    }

    return handle_cpu_signal(pc, (unsigned long)info->si_addr, 

                             is_write, sigmask);

}

int cpu_x86_signal_handler(int host_signum, struct siginfo *info, 

                           void *puc)

{

    uint32_t *regs = (uint32_t *)(info + 1);

    void *sigmask = (regs + 20);

    unsigned long pc;

    int is_write;

    uint32_t insn;

    

    

    pc = regs[1];

    

    is_write = 0;

    insn = *(uint32_t *)pc;

    if ((insn >> 30) == 3) {

      switch((insn >> 19) & 0x3f) {

      case 0x05: 

      case 0x06: 

      case 0x04: 

      case 0x07: d

      case 0x24: f

      case 0x27: df

      case 0x25: fsr

	is_write = 1;

	break;

      }

    }

    return handle_cpu_signal(pc, (unsigned long)info->si_addr, 

                             is_write, sigmask);

}

int FUNC_0(int VAR_0, struct siginfo *VAR_1, 

                           void *VAR_2)

{

    uint32_t *regs = (uint32_t *)(VAR_1 + 1);

    void *VAR_3 = (regs + 20);

    unsigned long VAR_4;

    int VAR_5;

    uint32_t insn;

    

    

    VAR_4 = regs[1];

    

    VAR_5 = 0;

    insn = *(uint32_t *)VAR_4;

    if ((insn >> 30) == 3) {

      switch((insn >> 19) & 0x3f) {

      case 0x05: 

      case 0x06: 

      case 0x04: 

      case 0x07: d

      case 0x24: f

      case 0x27: df

      case 0x25: fsr

	VAR_5 = 1;

	break;

      }

    }

    return handle_cpu_signal(VAR_4, (unsigned long)VAR_1->si_addr, 

                             VAR_5, VAR_3);

}

int FUNC_0(int VAR_0, struct siginfo *VAR_1,
void *VAR_2)
{ uint32_t *regs = (uint32_t *)(VAR_1 + 1); void *VAR_3 = (regs + 20); unsigned long VAR_4; int VAR_5; uint32_t insn; VAR_4 = regs[1]; VAR_5 = 0; insn = *(uint32_t *)VAR_4; if ((insn >> 30) == 3) { switch((insn >> 19) & 0x3f) { case 0x05:
case 0x06:
case 0x04:
case 0x07: d
case 0x24: f
case 0x27: df
case 0x25: fsr
VAR_5 = 1; break; } } return handle_cpu_signal(VAR_4, (unsigned long)VAR_1->si_addr,
VAR_5, VAR_3); }