1760
1771
queue_signal(env, info.si_signo, &info);
1762
1773
case POWERPC_EXCP_DECR: /* Decrementer exception */
1763
cpu_abort(env, "Decrementer interrupt while in user mode. "
1774
cpu_abort(cs, "Decrementer interrupt while in user mode. "
1766
1777
case POWERPC_EXCP_FIT: /* Fixed-interval timer interrupt */
1767
cpu_abort(env, "Fix interval timer interrupt while in user mode. "
1778
cpu_abort(cs, "Fix interval timer interrupt while in user mode. "
1770
1781
case POWERPC_EXCP_WDT: /* Watchdog timer interrupt */
1771
cpu_abort(env, "Watchdog timer interrupt while in user mode. "
1782
cpu_abort(cs, "Watchdog timer interrupt while in user mode. "
1774
1785
case POWERPC_EXCP_DTLB: /* Data TLB error */
1775
cpu_abort(env, "Data TLB exception while in user mode. "
1786
cpu_abort(cs, "Data TLB exception while in user mode. "
1778
1789
case POWERPC_EXCP_ITLB: /* Instruction TLB error */
1779
cpu_abort(env, "Instruction TLB exception while in user mode. "
1790
cpu_abort(cs, "Instruction TLB exception while in user mode. "
1782
1793
case POWERPC_EXCP_SPEU: /* SPE/embedded floating-point unavail. */
1788
1799
queue_signal(env, info.si_signo, &info);
1790
1801
case POWERPC_EXCP_EFPDI: /* Embedded floating-point data IRQ */
1791
cpu_abort(env, "Embedded floating-point data IRQ not handled\n");
1802
cpu_abort(cs, "Embedded floating-point data IRQ not handled\n");
1793
1804
case POWERPC_EXCP_EFPRI: /* Embedded floating-point round IRQ */
1794
cpu_abort(env, "Embedded floating-point round IRQ not handled\n");
1805
cpu_abort(cs, "Embedded floating-point round IRQ not handled\n");
1796
1807
case POWERPC_EXCP_EPERFM: /* Embedded performance monitor IRQ */
1797
cpu_abort(env, "Performance monitor exception not handled\n");
1808
cpu_abort(cs, "Performance monitor exception not handled\n");
1799
1810
case POWERPC_EXCP_DOORI: /* Embedded doorbell interrupt */
1800
cpu_abort(env, "Doorbell interrupt while in user mode. "
1811
cpu_abort(cs, "Doorbell interrupt while in user mode. "
1803
1814
case POWERPC_EXCP_DOORCI: /* Embedded doorbell critical interrupt */
1804
cpu_abort(env, "Doorbell critical interrupt while in user mode. "
1815
cpu_abort(cs, "Doorbell critical interrupt while in user mode. "
1807
1818
case POWERPC_EXCP_RESET: /* System reset exception */
1808
cpu_abort(env, "Reset interrupt while in user mode. "
1819
cpu_abort(cs, "Reset interrupt while in user mode. "
1811
1822
case POWERPC_EXCP_DSEG: /* Data segment exception */
1812
cpu_abort(env, "Data segment exception while in user mode. "
1823
cpu_abort(cs, "Data segment exception while in user mode. "
1815
1826
case POWERPC_EXCP_ISEG: /* Instruction segment exception */
1816
cpu_abort(env, "Instruction segment exception "
1827
cpu_abort(cs, "Instruction segment exception "
1817
1828
"while in user mode. Aborting\n");
1819
1830
/* PowerPC 64 with hypervisor mode support */
1820
1831
case POWERPC_EXCP_HDECR: /* Hypervisor decrementer exception */
1821
cpu_abort(env, "Hypervisor decrementer interrupt "
1832
cpu_abort(cs, "Hypervisor decrementer interrupt "
1822
1833
"while in user mode. Aborting\n");
1824
1835
case POWERPC_EXCP_TRACE: /* Trace exception */
1829
1840
/* PowerPC 64 with hypervisor mode support */
1830
1841
case POWERPC_EXCP_HDSI: /* Hypervisor data storage exception */
1831
cpu_abort(env, "Hypervisor data storage exception "
1842
cpu_abort(cs, "Hypervisor data storage exception "
1832
1843
"while in user mode. Aborting\n");
1834
1845
case POWERPC_EXCP_HISI: /* Hypervisor instruction storage excp */
1835
cpu_abort(env, "Hypervisor instruction storage exception "
1846
cpu_abort(cs, "Hypervisor instruction storage exception "
1836
1847
"while in user mode. Aborting\n");
1838
1849
case POWERPC_EXCP_HDSEG: /* Hypervisor data segment exception */
1839
cpu_abort(env, "Hypervisor data segment exception "
1850
cpu_abort(cs, "Hypervisor data segment exception "
1840
1851
"while in user mode. Aborting\n");
1842
1853
case POWERPC_EXCP_HISEG: /* Hypervisor instruction segment excp */
1843
cpu_abort(env, "Hypervisor instruction segment exception "
1854
cpu_abort(cs, "Hypervisor instruction segment exception "
1844
1855
"while in user mode. Aborting\n");
1846
1857
case POWERPC_EXCP_VPU: /* Vector unavailable exception */
1852
1863
queue_signal(env, info.si_signo, &info);
1854
1865
case POWERPC_EXCP_PIT: /* Programmable interval timer IRQ */
1855
cpu_abort(env, "Programmable interval timer interrupt "
1866
cpu_abort(cs, "Programmable interval timer interrupt "
1856
1867
"while in user mode. Aborting\n");
1858
1869
case POWERPC_EXCP_IO: /* IO error exception */
1859
cpu_abort(env, "IO error exception while in user mode. "
1870
cpu_abort(cs, "IO error exception while in user mode. "
1862
1873
case POWERPC_EXCP_RUNM: /* Run mode exception */
1863
cpu_abort(env, "Run mode exception while in user mode. "
1874
cpu_abort(cs, "Run mode exception while in user mode. "
1866
1877
case POWERPC_EXCP_EMUL: /* Emulation trap exception */
1867
cpu_abort(env, "Emulation trap exception not handled\n");
1878
cpu_abort(cs, "Emulation trap exception not handled\n");
1869
1880
case POWERPC_EXCP_IFTLB: /* Instruction fetch TLB error */
1870
cpu_abort(env, "Instruction fetch TLB exception "
1881
cpu_abort(cs, "Instruction fetch TLB exception "
1871
1882
"while in user-mode. Aborting");
1873
1884
case POWERPC_EXCP_DLTLB: /* Data load TLB miss */
1874
cpu_abort(env, "Data load TLB exception while in user-mode. "
1885
cpu_abort(cs, "Data load TLB exception while in user-mode. "
1877
1888
case POWERPC_EXCP_DSTLB: /* Data store TLB miss */
1878
cpu_abort(env, "Data store TLB exception while in user-mode. "
1889
cpu_abort(cs, "Data store TLB exception while in user-mode. "
1881
1892
case POWERPC_EXCP_FPA: /* Floating-point assist exception */
1882
cpu_abort(env, "Floating-point assist exception not handled\n");
1893
cpu_abort(cs, "Floating-point assist exception not handled\n");
1884
1895
case POWERPC_EXCP_IABR: /* Instruction address breakpoint */
1885
cpu_abort(env, "Instruction address breakpoint exception "
1896
cpu_abort(cs, "Instruction address breakpoint exception "
1886
1897
"not handled\n");
1888
1899
case POWERPC_EXCP_SMI: /* System management interrupt */
1889
cpu_abort(env, "System management interrupt while in user mode. "
1900
cpu_abort(cs, "System management interrupt while in user mode. "
1892
1903
case POWERPC_EXCP_THERM: /* Thermal interrupt */
1893
cpu_abort(env, "Thermal interrupt interrupt while in user mode. "
1904
cpu_abort(cs, "Thermal interrupt interrupt while in user mode. "
1896
1907
case POWERPC_EXCP_PERFM: /* Embedded performance monitor IRQ */
1897
cpu_abort(env, "Performance monitor exception not handled\n");
1908
cpu_abort(cs, "Performance monitor exception not handled\n");
1899
1910
case POWERPC_EXCP_VPUA: /* Vector assist exception */
1900
cpu_abort(env, "Vector assist exception not handled\n");
1911
cpu_abort(cs, "Vector assist exception not handled\n");
1902
1913
case POWERPC_EXCP_SOFTP: /* Soft patch exception */
1903
cpu_abort(env, "Soft patch exception not handled\n");
1914
cpu_abort(cs, "Soft patch exception not handled\n");
1905
1916
case POWERPC_EXCP_MAINT: /* Maintenance exception */
1906
cpu_abort(env, "Maintenance exception while in user mode. "
1917
cpu_abort(cs, "Maintenance exception while in user mode. "
1909
1920
case POWERPC_EXCP_STOP: /* stop translation */
3421
3436
CPUArchState *cpu_copy(CPUArchState *env)
3438
CPUState *cpu = ENV_GET_CPU(env);
3423
3439
CPUArchState *new_env = cpu_init(cpu_model);
3440
CPUState *new_cpu = ENV_GET_CPU(new_env);
3424
3441
#if defined(TARGET_HAS_ICE)
3425
3442
CPUBreakpoint *bp;
3426
3443
CPUWatchpoint *wp;
3429
3446
/* Reset non arch specific state */
3430
cpu_reset(ENV_GET_CPU(new_env));
3432
3449
memcpy(new_env, env, sizeof(CPUArchState));
3434
3451
/* Clone all break/watchpoints.
3435
3452
Note: Once we support ptrace with hw-debug register access, make sure
3436
3453
BP_CPU break/watchpoints are handled correctly on clone. */
3437
QTAILQ_INIT(&env->breakpoints);
3438
QTAILQ_INIT(&env->watchpoints);
3454
QTAILQ_INIT(&cpu->breakpoints);
3455
QTAILQ_INIT(&cpu->watchpoints);
3439
3456
#if defined(TARGET_HAS_ICE)
3440
QTAILQ_FOREACH(bp, &env->breakpoints, entry) {
3441
cpu_breakpoint_insert(new_env, bp->pc, bp->flags, NULL);
3457
QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
3458
cpu_breakpoint_insert(new_cpu, bp->pc, bp->flags, NULL);
3443
QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
3444
cpu_watchpoint_insert(new_env, wp->vaddr, (~wp->len_mask) + 1,
3460
QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
3461
cpu_watchpoint_insert(new_cpu, wp->vaddr, (~wp->len_mask) + 1,
3445
3462
wp->flags, NULL);
4005
4003
/* build Task State */
4006
4004
ts->info = info;
4007
4005
ts->bprm = &bprm;
4009
4007
task_settid(ts);
4011
execfd = get_execfd(envp);
4009
execfd = qemu_getauxval(AT_EXECFD);
4013
4011
execfd = open(filename, O_RDONLY);
4016
printf("Error while loading %s: %s\n", filename, strerror(-execfd));
4013
printf("Error while loading %s: %s\n", filename, strerror(errno));
4020
4018
ret = loader_exec(execfd, filename, target_argv, target_environ, regs,