]> Git Repo - qemu.git/blobdiff - exec-all.h
Fix kernel loading
[qemu.git] / exec-all.h
index ade888ae3bc138c64f0f659ea57c4f6bb6560794..dc5a10d972ebb667af39838dd04030e9531d261a 100644 (file)
 #define tostring(s)    #s
 #endif
 
+#ifndef likely
 #if __GNUC__ < 3
 #define __builtin_expect(x, n) (x)
 #endif
 
+#define likely(x)   __builtin_expect(!!(x), 1)
+#define unlikely(x)   __builtin_expect(!!(x), 0)
+#endif
+
+#ifndef always_inline
+#if (__GNUC__ < 3) || defined(__APPLE__)
+#define always_inline inline
+#else
+#define always_inline __attribute__ (( always_inline )) inline
+#endif
+#endif
+
 #ifdef __i386__
 #define REGPARM(n) __attribute((regparm(n)))
 #else
@@ -68,7 +81,7 @@ typedef void (GenOpFunc)(void);
 typedef void (GenOpFunc1)(long);
 typedef void (GenOpFunc2)(long, long);
 typedef void (GenOpFunc3)(long, long, long);
-                   
+
 #if defined(TARGET_I386)
 
 void optimize_flags_init(void);
@@ -166,7 +179,7 @@ static inline int tlb_set_page(CPUState *env, target_ulong vaddr,
 typedef struct TranslationBlock {
     target_ulong pc;   /* simulated PC corresponding to this block (EIP + CS base) */
     target_ulong cs_base; /* CS base for this block */
-    unsigned int flags; /* flags defining in which context the code was generated */
+    uint64_t flags; /* flags defining in which context the code was generated */
     uint16_t size;      /* size of target code for this block (1 <=
                            size <= TARGET_PAGE_SIZE) */
     uint16_t cflags;    /* compile flags */
@@ -287,7 +300,7 @@ static inline void tb_add_jump(TranslationBlock *tb, int n,
     if (!tb->jmp_next[n]) {
         /* patch the native jump address */
         tb_set_jmp_target(tb, n, (unsigned long)tb_next->tc_ptr);
-       
+
         /* add in TB jmp circular list */
         tb->jmp_next[n] = tb_next->jmp_first;
         tb_next->jmp_first = (TranslationBlock *)((long)(tb) | (n));
@@ -398,7 +411,7 @@ static inline int testandset (int *p)
 static inline int testandset (int *p)
 {
     long int readval = 0;
-   
+
     __asm__ __volatile__ ("lock; cmpxchgl %2, %0"
                           : "+m" (*p), "+a" (readval)
                           : "r" (1)
@@ -409,7 +422,7 @@ static inline int testandset (int *p)
 static inline int testandset (int *p)
 {
     long int readval = 0;
-   
+
     __asm__ __volatile__ ("lock; cmpxchgl %2, %0"
                           : "+m" (*p), "+a" (readval)
                           : "r" (1)
@@ -464,7 +477,7 @@ static inline int testandset (int *spinlock)
     __asm__ __volatile__("swp %0, %1, [%2]"
                          : "=r"(ret)
                          : "0"(1), "r"(spinlock));
-   
+
     return ret;
 }
 #elif defined(__mc68000)
This page took 0.025925 seconds and 4 git commands to generate.