Revision 48733d19 linux-user/main.c
b/linux-user/main.c | ||
---|---|---|
1601 | 1601 |
} |
1602 | 1602 |
#endif |
1603 | 1603 |
|
1604 |
#ifdef TARGET_CRIS |
|
1605 |
void cpu_loop (CPUState *env) |
|
1606 |
{ |
|
1607 |
int trapnr, ret; |
|
1608 |
target_siginfo_t info; |
|
1609 |
|
|
1610 |
while (1) { |
|
1611 |
trapnr = cpu_cris_exec (env); |
|
1612 |
switch (trapnr) { |
|
1613 |
case 0xaa: |
|
1614 |
{ |
|
1615 |
info.si_signo = SIGSEGV; |
|
1616 |
info.si_errno = 0; |
|
1617 |
/* XXX: check env->error_code */ |
|
1618 |
info.si_code = TARGET_SEGV_MAPERR; |
|
1619 |
info._sifields._sigfault._addr = env->debug1; |
|
1620 |
queue_signal(info.si_signo, &info); |
|
1621 |
} |
|
1622 |
break; |
|
1623 |
case EXCP_BREAK: |
|
1624 |
ret = do_syscall(env, |
|
1625 |
env->regs[9], |
|
1626 |
env->regs[10], |
|
1627 |
env->regs[11], |
|
1628 |
env->regs[12], |
|
1629 |
env->regs[13], |
|
1630 |
env->pregs[7], |
|
1631 |
env->pregs[11]); |
|
1632 |
env->regs[10] = ret; |
|
1633 |
env->pc += 2; |
|
1634 |
break; |
|
1635 |
case EXCP_DEBUG: |
|
1636 |
{ |
|
1637 |
int sig; |
|
1638 |
|
|
1639 |
sig = gdb_handlesig (env, TARGET_SIGTRAP); |
|
1640 |
if (sig) |
|
1641 |
{ |
|
1642 |
info.si_signo = sig; |
|
1643 |
info.si_errno = 0; |
|
1644 |
info.si_code = TARGET_TRAP_BRKPT; |
|
1645 |
queue_signal(info.si_signo, &info); |
|
1646 |
} |
|
1647 |
} |
|
1648 |
break; |
|
1649 |
default: |
|
1650 |
printf ("Unhandled trap: 0x%x\n", trapnr); |
|
1651 |
cpu_dump_state(env, stderr, fprintf, 0); |
|
1652 |
exit (1); |
|
1653 |
} |
|
1654 |
process_pending_signals (env); |
|
1655 |
} |
|
1656 |
} |
|
1657 |
#endif |
|
1658 |
|
|
1604 | 1659 |
#ifdef TARGET_M68K |
1605 | 1660 |
|
1606 | 1661 |
void cpu_loop(CPUM68KState *env) |
... | ... | |
2195 | 2250 |
env->pc = regs->pc; |
2196 | 2251 |
env->unique = regs->unique; |
2197 | 2252 |
} |
2253 |
#elif defined(TARGET_CRIS) |
|
2254 |
{ |
|
2255 |
env->regs[0] = regs->r0; |
|
2256 |
env->regs[1] = regs->r1; |
|
2257 |
env->regs[2] = regs->r2; |
|
2258 |
env->regs[3] = regs->r3; |
|
2259 |
env->regs[4] = regs->r4; |
|
2260 |
env->regs[5] = regs->r5; |
|
2261 |
env->regs[6] = regs->r6; |
|
2262 |
env->regs[7] = regs->r7; |
|
2263 |
env->regs[8] = regs->r8; |
|
2264 |
env->regs[9] = regs->r9; |
|
2265 |
env->regs[10] = regs->r10; |
|
2266 |
env->regs[11] = regs->r11; |
|
2267 |
env->regs[12] = regs->r12; |
|
2268 |
env->regs[13] = regs->r13; |
|
2269 |
env->regs[14] = info->start_stack; |
|
2270 |
env->regs[15] = regs->acr; |
|
2271 |
env->pc = regs->erp; |
|
2272 |
} |
|
2198 | 2273 |
#else |
2199 | 2274 |
#error unsupported target CPU |
2200 | 2275 |
#endif |
Also available in: Unified diff