Revision f57040be cpu-exec.c
b/cpu-exec.c | ||
---|---|---|
1197 | 1197 |
{ |
1198 | 1198 |
struct siginfo *info = pinfo; |
1199 | 1199 |
struct ucontext *uc = puc; |
1200 |
unsigned long pc; |
|
1201 |
int is_write; |
|
1200 |
unsigned long pc = uc->uc_mcontext.sc_iaoq[0]; |
|
1201 |
uint32_t insn = *(uint32_t *)pc; |
|
1202 |
int is_write = 0; |
|
1203 |
|
|
1204 |
/* XXX: need kernel patch to get write flag faster. */ |
|
1205 |
switch (insn >> 26) { |
|
1206 |
case 0x1a: /* STW */ |
|
1207 |
case 0x19: /* STH */ |
|
1208 |
case 0x18: /* STB */ |
|
1209 |
case 0x1b: /* STWM */ |
|
1210 |
is_write = 1; |
|
1211 |
break; |
|
1212 |
|
|
1213 |
case 0x09: /* CSTWX, FSTWX, FSTWS */ |
|
1214 |
case 0x0b: /* CSTDX, FSTDX, FSTDS */ |
|
1215 |
/* Distinguish from coprocessor load ... */ |
|
1216 |
is_write = (insn >> 9) & 1; |
|
1217 |
break; |
|
1218 |
|
|
1219 |
case 0x03: |
|
1220 |
switch ((insn >> 6) & 15) { |
|
1221 |
case 0xa: /* STWS */ |
|
1222 |
case 0x9: /* STHS */ |
|
1223 |
case 0x8: /* STBS */ |
|
1224 |
case 0xe: /* STWAS */ |
|
1225 |
case 0xc: /* STBYS */ |
|
1226 |
is_write = 1; |
|
1227 |
} |
|
1228 |
break; |
|
1229 |
} |
|
1202 | 1230 |
|
1203 |
pc = uc->uc_mcontext.sc_iaoq[0]; |
|
1204 |
/* FIXME: compute is_write */ |
|
1205 |
is_write = 0; |
|
1206 | 1231 |
return handle_cpu_signal(pc, (unsigned long)info->si_addr, |
1207 |
is_write, |
|
1208 |
&uc->uc_sigmask, puc); |
|
1232 |
is_write, &uc->uc_sigmask, puc); |
|
1209 | 1233 |
} |
1210 | 1234 |
|
1211 | 1235 |
#else |
Also available in: Unified diff