Commit 2e03286b9ac5a27c32458a034f51deb3831dac77
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
Showing
4 changed files
with
12 additions
and
4 deletions
block-raw.c
@@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
62 | #define DEBUG_BLOCK | 62 | #define DEBUG_BLOCK |
63 | #if defined(DEBUG_BLOCK) && !defined(QEMU_TOOL) | 63 | #if defined(DEBUG_BLOCK) && !defined(QEMU_TOOL) |
64 | #define DEBUG_BLOCK_PRINT(formatCstr, args...) do { if (loglevel != 0) \ | 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 | #else | 66 | #else |
67 | #define DEBUG_BLOCK_PRINT(formatCstr, args...) | 67 | #define DEBUG_BLOCK_PRINT(formatCstr, args...) |
68 | #endif | 68 | #endif |
exec-all.h
@@ -28,12 +28,14 @@ | @@ -28,12 +28,14 @@ | ||
28 | #define tostring(s) #s | 28 | #define tostring(s) #s |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | +#ifndef likely | ||
31 | #if __GNUC__ < 3 | 32 | #if __GNUC__ < 3 |
32 | #define __builtin_expect(x, n) (x) | 33 | #define __builtin_expect(x, n) (x) |
33 | #endif | 34 | #endif |
34 | 35 | ||
35 | #define likely(x) __builtin_expect(!!(x), 1) | 36 | #define likely(x) __builtin_expect(!!(x), 1) |
36 | #define unlikely(x) __builtin_expect(!!(x), 0) | 37 | #define unlikely(x) __builtin_expect(!!(x), 0) |
38 | +#endif | ||
37 | 39 | ||
38 | #ifdef __i386__ | 40 | #ifdef __i386__ |
39 | #define REGPARM(n) __attribute((regparm(n))) | 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,9 +46,6 @@ void omap_badwidth_write32(void *opaque, target_phys_addr_t addr, | ||
46 | OMAP_32B_REG(addr); | 46 | OMAP_32B_REG(addr); |
47 | } | 47 | } |
48 | 48 | ||
49 | -#define likely | ||
50 | -#define unlikely | ||
51 | - | ||
52 | /* Interrupt Handlers */ | 49 | /* Interrupt Handlers */ |
53 | struct omap_intr_handler_s { | 50 | struct omap_intr_handler_s { |
54 | qemu_irq *pins; | 51 | qemu_irq *pins; |
vl.h
@@ -93,6 +93,15 @@ static inline char *realpath(const char *path, char *resolved_path) | @@ -93,6 +93,15 @@ static inline char *realpath(const char *path, char *resolved_path) | ||
93 | #define tostring(s) #s | 93 | #define tostring(s) #s |
94 | #endif | 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 | #ifndef MIN | 105 | #ifndef MIN |
97 | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) | 106 | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) |
98 | #endif | 107 | #endif |