qemu: per-arch cpu_has_work (Marcelo Tosatti)
[qemu] / target-m68k / exec.h
index 254f558..3a86b1f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  m68k execution defines
- * 
+ *
  *  Copyright (c) 2005-2006 CodeSourcery
  *  Written by Paul Brook
  *
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
  */
 #include "dyngen-exec.h"
 
@@ -37,15 +37,21 @@ static inline void regs_to_env(void)
 {
 }
 
-int cpu_m68k_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
-                              int is_user, int is_softmmu);
-
 #if !defined(CONFIG_USER_ONLY)
 #include "softmmu_exec.h"
 #endif
 
-void cpu_m68k_flush_flags(CPUM68KState *env, int cc_op);
-float64 helper_sub_cmpf64(CPUM68KState *env, float64 src0, float64 src1);
-void helper_movec(CPUM68KState *env, int reg, uint32_t val);
+static inline int cpu_has_work(CPUState *env)
+{
+    return (env->interrupt_request & (CPU_INTERRUPT_HARD));
+}
 
-void cpu_loop_exit(void);
+static inline int cpu_halted(CPUState *env) {
+    if (!env->halted)
+        return 0;
+    if (cpu_has_work(env)) {
+        env->halted = 0;
+        return 0;
+    }
+    return EXCP_HALTED;
+}