AMD NOR flash device support (initial patch by Jocelyn Mayer)
[qemu] / dyngen.h
index e0e1f4a..fe0a936 100644 (file)
--- a/dyngen.h
+++ b/dyngen.h
  */
 
 int __op_param1, __op_param2, __op_param3;
-int __op_gen_label1, __op_gen_label2, __op_gen_label3;
+#ifdef __sparc__
+  void __op_gen_label1(){}
+  void __op_gen_label2(){}
+  void __op_gen_label3(){}
+#else
+  int __op_gen_label1, __op_gen_label2, __op_gen_label3;
+#endif
 int __op_jmp0, __op_jmp1, __op_jmp2, __op_jmp3;
 
 #ifdef __i386__
@@ -59,7 +65,7 @@ static void inline flush_icache_range(unsigned long start, unsigned long stop)
 {
     unsigned long p;
 
-    p = start & ~(MIN_CACHE_LINE_SIZE - 1);
+    start &= ~(MIN_CACHE_LINE_SIZE - 1);
     stop = (stop + MIN_CACHE_LINE_SIZE - 1) & ~(MIN_CACHE_LINE_SIZE - 1);
     
     for (p = start; p < stop; p += MIN_CACHE_LINE_SIZE) {
@@ -420,6 +426,9 @@ static inline void ia64_apply_fixes (uint8_t **gen_code_pp,
        }
        ia64_imm22(fixup->addr, (long) vp - gp);
     }
+    /* Keep code ptr aligned. */
+    if ((long) gen_code_ptr & 15)
+       gen_code_ptr += 8;
     *gen_code_pp = gen_code_ptr;
 }