From: Randolph C. <ta...@us...> - 2007-03-04 15:16:31
|
Update of /cvsroot/hppaqemu/hppaqemu In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv12958 Modified Files: Makefile.target configure cpu-all.h cpu-exec.c exec-all.h softmmu_header.h vl.c vl.h Log Message: beginning of hppa target support Index: vl.h =================================================================== RCS file: /cvsroot/hppaqemu/hppaqemu/vl.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** vl.h 23 Feb 2007 21:44:12 -0000 1.1.1.1 --- vl.h 4 Mar 2007 15:16:27 -0000 1.2 *************** *** 1090,1093 **** --- 1090,1096 ---- extern QEMUMachine shix_machine; + /* hppa.c */ + extern QEMUMachine hppa_machine; + #ifdef TARGET_PPC ppc_tb_t *cpu_ppc_tb_init (CPUState *env, uint32_t freq); Index: configure =================================================================== RCS file: /cvsroot/hppaqemu/hppaqemu/configure,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure 4 Mar 2007 15:03:22 -0000 1.2 --- configure 4 Mar 2007 15:16:26 -0000 1.3 *************** *** 419,423 **** # these targets are portable if [ "$softmmu" = "yes" ] ; then ! target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu" fi # the following are Linux specific --- 419,423 ---- # these targets are portable if [ "$softmmu" = "yes" ] ; then ! target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu hppa-softmmu" fi # the following are Linux specific *************** *** 808,811 **** --- 808,812 ---- [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes [ "$target_cpu" = "m68k" ] && target_bigendian=yes + [ "$target_cpu" = "hppa" ] && target_bigendian=yes target_softmmu="no" if expr $target : '.*-softmmu' > /dev/null ; then *************** *** 918,921 **** --- 919,927 ---- echo "#define TARGET_M68K 1" >> $config_h bflt="yes" + elif test "$target_cpu" = "hppa" ; then + echo "TARGET_ARCH=hppa" >> $config_mak + echo "#define TARGET_ARCH \"hppa\"" >> $config_h + echo "#define TARGET_HPPA 1" >> $config_h + bflt="yes" else echo "Unsupported target CPU" Index: softmmu_header.h =================================================================== RCS file: /cvsroot/hppaqemu/hppaqemu/softmmu_header.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** softmmu_header.h 23 Feb 2007 21:44:09 -0000 1.1.1.1 --- softmmu_header.h 4 Mar 2007 15:16:27 -0000 1.2 *************** *** 64,67 **** --- 64,69 ---- #elif defined (TARGET_SH4) #define CPU_MEM_INDEX ((env->sr & SR_MD) == 0) + #elif defined (TARGET_HPPA) + #define CPU_MEM_INDEX 0 /* FIXME */ #else #error unsupported CPU *************** *** 83,86 **** --- 85,90 ---- #elif defined (TARGET_SH4) #define CPU_MEM_INDEX ((env->sr & SR_MD) == 0) + #elif defined (TARGET_HPPA) + #define CPU_MEM_INDEX 0 /* FIXME */ #else #error unsupported CPU Index: vl.c =================================================================== RCS file: /cvsroot/hppaqemu/hppaqemu/vl.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** vl.c 23 Feb 2007 21:44:12 -0000 1.1.1.1 --- vl.c 4 Mar 2007 15:16:27 -0000 1.2 *************** *** 5320,5323 **** --- 5320,5335 ---- } + #elif defined(TARGET_HPPA) + + /* ??? Need to implement these. */ + void cpu_save(QEMUFile *f, void *opaque) + { + } + + int cpu_load(QEMUFile *f, void *opaque, int version_id) + { + return 0; + } + #else *************** *** 6369,6372 **** --- 6381,6386 ---- #elif defined(TARGET_SH4) qemu_register_machine(&shix_machine); + #elif defined(TARGET_HPPA) + qemu_register_machine(&hppa_machine); #else #error unsupported CPU Index: cpu-exec.c =================================================================== RCS file: /cvsroot/hppaqemu/hppaqemu/cpu-exec.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cpu-exec.c 4 Mar 2007 15:03:22 -0000 1.2 --- cpu-exec.c 4 Mar 2007 15:16:27 -0000 1.3 *************** *** 203,206 **** --- 203,210 ---- cs_base = 0; /* XXXXX */ pc = env->pc; + #elif defined(TARGET_HPPA) + flags = env->psw; + cs_base = 0; + pc = env->iaoq[0]; #else #error unsupported CPU *************** *** 325,328 **** --- 329,333 ---- #elif defined(TARGET_MIPS) #elif defined(TARGET_SH4) + #elif defined(TARGET_HPPA) /* XXXXX */ #else *************** *** 594,597 **** --- 599,604 ---- #elif defined(TARGET_SH4) cpu_dump_state(env, logfile, fprintf, 0); + #elif defined(TARGET_HPPA) + cpu_dump_state(env, logfile, fprintf, 0); #else #error unsupported target CPU *************** *** 794,797 **** --- 801,805 ---- #elif defined(TARGET_MIPS) #elif defined(TARGET_SH4) + #elif defined(TARGET_HPPA) /* XXXXX */ #else *************** *** 1180,1183 **** --- 1188,1227 ---- return 1; } + #elif defined(TARGET_HPPA) + static inline int handle_cpu_signal(unsigned long pc, unsigned long address, + int is_write, sigset_t *old_set, + void *puc) + { + TranslationBlock *tb; + int ret; + + if (cpu_single_env) + env = cpu_single_env; /* XXX: find a correct solution for multithread */ + #if defined(DEBUG_SIGNAL) + printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", + pc, address, is_write, *(unsigned long *)old_set); + #endif + /* XXX: locking issue */ + if (is_write && page_unprotect(h2g(address), pc, puc)) { + return 1; + } + /* see if it is an MMU fault */ + ret = cpu_hppa_handle_mmu_fault(env, address, is_write, 1, 0); + if (ret < 0) + return 0; /* not an MMU fault */ + if (ret == 0) + return 1; /* the MMU fault was handled without causing real CPU fault */ + /* now we have a real cpu fault */ + tb = tb_find_pc(pc); + if (tb) { + /* the PC is inside the translated code. It means that we have + a virtual CPU fault */ + cpu_restore_state(tb, env, pc, puc); + } + /* we restore the process signal mask as the sigreturn should + do it (XXX: use sigsetjmp) */ + sigprocmask(SIG_SETMASK, old_set, NULL); + cpu_loop_exit(); + } #else #error unsupported target CPU Index: Makefile.target =================================================================== RCS file: /cvsroot/hppaqemu/hppaqemu/Makefile.target,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.target 4 Mar 2007 15:03:22 -0000 1.2 --- Makefile.target 4 Mar 2007 15:16:26 -0000 1.3 *************** *** 415,418 **** --- 415,421 ---- VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o endif + ifeq ($(TARGET_BASE_ARCH), hppa) + VL_OBJS+= hppa.o + endif ifdef CONFIG_GDBSTUB VL_OBJS+=gdbstub.o Index: exec-all.h =================================================================== RCS file: /cvsroot/hppaqemu/hppaqemu/exec-all.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** exec-all.h 4 Mar 2007 15:03:23 -0000 1.2 --- exec-all.h 4 Mar 2007 15:16:27 -0000 1.3 *************** *** 619,622 **** --- 619,624 ---- #elif defined (TARGET_SH4) is_user = ((env->sr & SR_MD) == 0); + #elif defined (TARGET_HPPA) + is_user = ((env->iaoq[0] & 3) != 0); #else #error unimplemented CPU Index: cpu-all.h =================================================================== RCS file: /cvsroot/hppaqemu/hppaqemu/cpu-all.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cpu-all.h 4 Mar 2007 15:03:22 -0000 1.2 --- cpu-all.h 4 Mar 2007 15:16:27 -0000 1.3 *************** *** 747,750 **** --- 747,756 ---- #define cpu_signal_handler cpu_sh4_signal_handler + #elif defined(TARGET_HPPA) + #define CPUState CPUHPPAState + #define cpu_init cpu_hppa_init + #define cpu_exec cpu_hppa_exec + #define cpu_gen_code cpu_hppa_gen_code + #define cpu_signal_handler cpu_hppa_signal_handler #else |