00001 /* 00002 * PowerPC emulation definitions for qemu. 00003 * 00004 * Copyright (c) 2003-2007 Jocelyn Mayer 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA 00019 */ 00020 #if !defined (__PPC_H__) 00021 #define __PPC_H__ 00022 00023 #include "config.h" 00024 00025 #include "dyngen-exec.h" 00026 00027 #include "cpu.h" 00028 #include "exec-all.h" 00029 00030 /* Precise emulation is needed to correctly emulate exception flags */ 00031 #define USE_PRECISE_EMULATION 1 00032 00033 register struct CPUPPCState *env asm(AREG0); 00034 00035 #if !defined(CONFIG_USER_ONLY) 00036 #include "softmmu_exec.h" 00037 #endif /* !defined(CONFIG_USER_ONLY) */ 00038 00039 static always_inline void env_to_regs (void) 00040 { 00041 } 00042 00043 static always_inline void regs_to_env (void) 00044 { 00045 } 00046 00047 static always_inline int cpu_halted (CPUState *env) 00048 { 00049 if (!env->halted) 00050 return 0; 00051 if (msr_ee && (env->interrupt_request & CPU_INTERRUPT_HARD)) { 00052 env->halted = 0; 00053 return 0; 00054 } 00055 return EXCP_HALTED; 00056 } 00057 00058 #endif /* !defined (__PPC_H__) */