Commit 2e03286b9ac5a27c32458a034f51deb3831dac77

Authored by balrog
1 parent a50a6282

Make likely/unlikely accessible also in hw/.

Revert the logfile->stderr change.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3194 c046a42c-6fe2-441c-8c8c-71466251a162
block-raw.c
... ... @@ -62,7 +62,7 @@
62 62 #define DEBUG_BLOCK
63 63 #if defined(DEBUG_BLOCK) && !defined(QEMU_TOOL)
64 64 #define DEBUG_BLOCK_PRINT(formatCstr, args...) do { if (loglevel != 0) \
65   - { fprintf(stderr, formatCstr, ##args); fflush(stderr); } } while (0)
  65 + { fprintf(logfile, formatCstr, ##args); fflush(logfile); } } while (0)
66 66 #else
67 67 #define DEBUG_BLOCK_PRINT(formatCstr, args...)
68 68 #endif
... ...
exec-all.h
... ... @@ -28,12 +28,14 @@
28 28 #define tostring(s) #s
29 29 #endif
30 30  
  31 +#ifndef likely
31 32 #if __GNUC__ < 3
32 33 #define __builtin_expect(x, n) (x)
33 34 #endif
34 35  
35 36 #define likely(x) __builtin_expect(!!(x), 1)
36 37 #define unlikely(x) __builtin_expect(!!(x), 0)
  38 +#endif
37 39  
38 40 #ifdef __i386__
39 41 #define REGPARM(n) __attribute((regparm(n)))
... ...
hw/omap.c
... ... @@ -46,9 +46,6 @@ void omap_badwidth_write32(void *opaque, target_phys_addr_t addr,
46 46 OMAP_32B_REG(addr);
47 47 }
48 48  
49   -#define likely
50   -#define unlikely
51   -
52 49 /* Interrupt Handlers */
53 50 struct omap_intr_handler_s {
54 51 qemu_irq *pins;
... ...
... ... @@ -93,6 +93,15 @@ static inline char *realpath(const char *path, char *resolved_path)
93 93 #define tostring(s) #s
94 94 #endif
95 95  
  96 +#ifndef likely
  97 +#if __GNUC__ < 3
  98 +#define __builtin_expect(x, n) (x)
  99 +#endif
  100 +
  101 +#define likely(x) __builtin_expect(!!(x), 1)
  102 +#define unlikely(x) __builtin_expect(!!(x), 0)
  103 +#endif
  104 +
96 105 #ifndef MIN
97 106 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
98 107 #endif
... ...