summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-20 13:24:53 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-20 13:24:53 +0000
commit2e03286b9ac5a27c32458a034f51deb3831dac77 (patch)
tree311425319f84269e5bb4e4f7b08d231743addcfc
parenta50a6282d7d3b40a4c9aa64a174f2cae5dbb5472 (diff)
downloadhqemu-2e03286b9ac5a27c32458a034f51deb3831dac77.zip
hqemu-2e03286b9ac5a27c32458a034f51deb3831dac77.tar.gz
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
-rw-r--r--block-raw.c2
-rw-r--r--exec-all.h2
-rw-r--r--hw/omap.c3
-rw-r--r--vl.h9
4 files changed, 12 insertions, 4 deletions
diff --git a/block-raw.c b/block-raw.c
index 7c6f964..05f830a 100644
--- a/block-raw.c
+++ b/block-raw.c
@@ -62,7 +62,7 @@
#define DEBUG_BLOCK
#if defined(DEBUG_BLOCK) && !defined(QEMU_TOOL)
#define DEBUG_BLOCK_PRINT(formatCstr, args...) do { if (loglevel != 0) \
- { fprintf(stderr, formatCstr, ##args); fflush(stderr); } } while (0)
+ { fprintf(logfile, formatCstr, ##args); fflush(logfile); } } while (0)
#else
#define DEBUG_BLOCK_PRINT(formatCstr, args...)
#endif
diff --git a/exec-all.h b/exec-all.h
index 39cb536..ca59597 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -28,12 +28,14 @@
#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
#ifdef __i386__
#define REGPARM(n) __attribute((regparm(n)))
diff --git a/hw/omap.c b/hw/omap.c
index e56e663..ccd8f4e 100644
--- a/hw/omap.c
+++ b/hw/omap.c
@@ -46,9 +46,6 @@ void omap_badwidth_write32(void *opaque, target_phys_addr_t addr,
OMAP_32B_REG(addr);
}
-#define likely
-#define unlikely
-
/* Interrupt Handlers */
struct omap_intr_handler_s {
qemu_irq *pins;
diff --git a/vl.h b/vl.h
index 9e54180..d7e12ad 100644
--- a/vl.h
+++ b/vl.h
@@ -93,6 +93,15 @@ static inline char *realpath(const char *path, char *resolved_path)
#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 MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
OpenPOWER on IntegriCloud