mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
Preliminary patch for Alpha Linux user mode emulation support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2600 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
86cc1ce083
commit
7a3148a955
4 changed files with 212 additions and 5 deletions
|
@ -1534,6 +1534,96 @@ void cpu_loop(CPUM68KState *env)
|
|||
}
|
||||
#endif /* TARGET_M68K */
|
||||
|
||||
#ifdef TARGET_ALPHA
|
||||
void cpu_loop (CPUState *env)
|
||||
{
|
||||
int trapnr, ret;
|
||||
target_siginfo_t info;
|
||||
|
||||
while (1) {
|
||||
trapnr = cpu_alpha_exec (env);
|
||||
|
||||
switch (trapnr) {
|
||||
case EXCP_RESET:
|
||||
fprintf(stderr, "Reset requested. Exit\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_MCHK:
|
||||
fprintf(stderr, "Machine check exception. Exit\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_ARITH:
|
||||
fprintf(stderr, "Arithmetic trap.\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_HW_INTERRUPT:
|
||||
fprintf(stderr, "External interrupt. Exit\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_DFAULT:
|
||||
fprintf(stderr, "MMU data fault\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_DTB_MISS_PAL:
|
||||
fprintf(stderr, "MMU data TLB miss in PALcode\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_ITB_MISS:
|
||||
fprintf(stderr, "MMU instruction TLB miss\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_ITB_ACV:
|
||||
fprintf(stderr, "MMU instruction access violation\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_DTB_MISS_NATIVE:
|
||||
fprintf(stderr, "MMU data TLB miss\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_UNALIGN:
|
||||
fprintf(stderr, "Unaligned access\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_OPCDEC:
|
||||
fprintf(stderr, "Invalid instruction\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_FEN:
|
||||
fprintf(stderr, "Floating-point not allowed\n");
|
||||
exit(1);
|
||||
break;
|
||||
case EXCP_CALL_PAL ... (EXCP_CALL_PALP - 1):
|
||||
fprintf(stderr, "Call to PALcode\n");
|
||||
call_pal(env, (trapnr >> 6) | 0x80);
|
||||
break;
|
||||
case EXCP_CALL_PALP ... (EXCP_CALL_PALE - 1):
|
||||
fprintf(stderr, "Priviledged call to PALcode\n");
|
||||
exit(1);
|
||||
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(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_ALPHA */
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
printf("qemu-" TARGET_ARCH " version " QEMU_VERSION ", Copyright (c) 2003-2007 Fabrice Bellard\n"
|
||||
|
@ -1877,6 +1967,18 @@ int main(int argc, char **argv)
|
|||
}
|
||||
env->pc = regs->pc;
|
||||
}
|
||||
#elif defined(TARGET_ALPHA)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < 28; i++) {
|
||||
env->ir[i] = ((target_ulong *)regs)[i];
|
||||
}
|
||||
env->ipr[IPR_USP] = regs->usp;
|
||||
env->ir[30] = regs->usp;
|
||||
env->pc = regs->pc;
|
||||
env->unique = regs->unique;
|
||||
}
|
||||
#else
|
||||
#error unsupported target CPU
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue