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 | 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
vl.h
... | ... | @@ -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 | ... | ... |