mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
Merge branch 's390-next' of git://repo.or.cz/qemu/agraf
* 's390-next' of git://repo.or.cz/qemu/agraf: s390x: complain when allocating ram fails s390x: fix memory detection for guests > 64GB s390x: change mapping base to allow guests > 2GB s390x: Fix debugging for unknown sigp order codes s390x: build s390x by default s390x: remove compatibility cc field s390x: Adjust GDB stub s390x: translate engine for s390x CPU s390x: Adjust internal kvm code s390x: Implement opcode helpers s390x: helper functions for system emulation s390x: Shift variables in CPUState for memset(0) s390x: keep hint on virtio managing size s390x: make kvm exported functions conditional on kvm s390x: s390x-linux-user support tcg: extend max tcg opcodes when using 64-on-32bit s390x: fix smp support for kvm
This commit is contained in:
commit
05c8a1e423
24 changed files with 10064 additions and 81 deletions
|
@ -2683,6 +2683,80 @@ void cpu_loop (CPUState *env)
|
|||
}
|
||||
#endif /* TARGET_ALPHA */
|
||||
|
||||
#ifdef TARGET_S390X
|
||||
void cpu_loop(CPUS390XState *env)
|
||||
{
|
||||
int trapnr;
|
||||
target_siginfo_t info;
|
||||
|
||||
while (1) {
|
||||
trapnr = cpu_s390x_exec (env);
|
||||
|
||||
switch (trapnr) {
|
||||
case EXCP_INTERRUPT:
|
||||
/* just indicate that signals should be handled asap */
|
||||
break;
|
||||
case EXCP_DEBUG:
|
||||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
if (sig) {
|
||||
info.si_signo = sig;
|
||||
info.si_errno = 0;
|
||||
info.si_code = TARGET_TRAP_BRKPT;
|
||||
queue_signal(env, info.si_signo, &info);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXCP_SVC:
|
||||
{
|
||||
int n = env->int_svc_code;
|
||||
if (!n) {
|
||||
/* syscalls > 255 */
|
||||
n = env->regs[1];
|
||||
}
|
||||
env->psw.addr += env->int_svc_ilc;
|
||||
env->regs[2] = do_syscall(env, n,
|
||||
env->regs[2],
|
||||
env->regs[3],
|
||||
env->regs[4],
|
||||
env->regs[5],
|
||||
env->regs[6],
|
||||
env->regs[7]);
|
||||
}
|
||||
break;
|
||||
case EXCP_ADDR:
|
||||
{
|
||||
info.si_signo = SIGSEGV;
|
||||
info.si_errno = 0;
|
||||
/* XXX: check env->error_code */
|
||||
info.si_code = TARGET_SEGV_MAPERR;
|
||||
info._sifields._sigfault._addr = env->__excp_addr;
|
||||
queue_signal(env, info.si_signo, &info);
|
||||
}
|
||||
break;
|
||||
case EXCP_SPEC:
|
||||
{
|
||||
fprintf(stderr,"specification exception insn 0x%08x%04x\n", ldl(env->psw.addr), lduw(env->psw.addr + 4));
|
||||
info.si_signo = SIGILL;
|
||||
info.si_errno = 0;
|
||||
info.si_code = TARGET_ILL_ILLOPC;
|
||||
info._sifields._sigfault._addr = env->__excp_addr;
|
||||
queue_signal(env, info.si_signo, &info);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf ("Unhandled trap: 0x%x\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
exit (1);
|
||||
}
|
||||
process_pending_signals (env);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TARGET_S390X */
|
||||
|
||||
static void version(void)
|
||||
{
|
||||
printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION
|
||||
|
@ -3432,6 +3506,15 @@ int main(int argc, char **argv, char **envp)
|
|||
env->regs[15] = regs->acr;
|
||||
env->pc = regs->erp;
|
||||
}
|
||||
#elif defined(TARGET_S390X)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 16; i++) {
|
||||
env->regs[i] = regs->gprs[i];
|
||||
}
|
||||
env->psw.mask = regs->psw.mask;
|
||||
env->psw.addr = regs->psw.addr;
|
||||
}
|
||||
#else
|
||||
#error unsupported target CPU
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue