diff options
author | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-19 00:38:33 +0000 |
---|---|---|
committer | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-19 00:38:33 +0000 |
commit | df2542c737ea2f7148136b6525cd56f6fc276d69 (patch) | |
tree | 046723d926bcae0d37d696bc073f41f90bf2c999 | |
parent | 8a0ef21949d0606d1510da256ed7d4e9128c5d6d (diff) |
Avoid duplicated definitions: move common definitions from exec-all.h
and qemu-common.h to osdep.h.
Include this header in translate-op.c.
Make sure it's included first in darwin-user/qemu.h.
To avoid discarded inlining bug, define inline as always_inline and
always_inline as (( attribute (always_inline) )) __inline__.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3698 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | darwin-user/qemu.h | 4 | ||||
-rw-r--r-- | exec-all.h | 30 | ||||
-rw-r--r-- | osdep.h | 38 | ||||
-rw-r--r-- | qemu-common.h | 31 | ||||
-rw-r--r-- | translate-op.c | 1 |
5 files changed, 41 insertions, 63 deletions
diff --git a/darwin-user/qemu.h b/darwin-user/qemu.h index 4d7713b500..41b57f8511 100644 --- a/darwin-user/qemu.h +++ b/darwin-user/qemu.h @@ -1,13 +1,13 @@ #ifndef GEMU_H #define GEMU_H -#include "thunk.h" - #include <signal.h> #include <string.h> #include "cpu.h" +#include "thunk.h" + #include "gdbstub.h" typedef siginfo_t target_siginfo_t; diff --git a/exec-all.h b/exec-all.h index 4b4f265ef8..285da99b51 100644 --- a/exec-all.h +++ b/exec-all.h @@ -21,36 +21,6 @@ /* allow to see translation results - the slowdown should be negligible, so we leave it */ #define DEBUG_DISAS -#ifndef glue -#define xglue(x, y) x ## y -#define glue(x, y) xglue(x, y) -#define stringify(s) tostring(s) -#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 -#define REGPARM(n) -#endif - /* is_jmp field values */ #define DISAS_NEXT 0 /* next instruction can be analyzed */ #define DISAS_JUMP 1 /* only pc was modified dynamically */ @@ -3,6 +3,44 @@ #include <stdarg.h> +#ifndef glue +#define xglue(x, y) x ## y +#define glue(x, y) xglue(x, y) +#define stringify(s) tostring(s) +#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 +#ifndef MAX +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif + +#ifndef always_inline +#if (__GNUC__ < 3) || defined(__APPLE__) +#define always_inline inline +#else +#define always_inline __attribute__ (( always_inline )) __inline__ +#endif +#endif +#define inline always_inline + +#ifdef __i386__ +#define REGPARM(n) __attribute((regparm(n))) +#else +#define REGPARM(n) +#endif + #define qemu_printf printf void *qemu_malloc(size_t size); diff --git a/qemu-common.h b/qemu-common.h index 119d1bb326..2c955219da 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -62,37 +62,6 @@ static inline char *realpath(const char *path, char *resolved_path) #endif /* !defined(NEED_CPU_H) */ -#ifndef glue -#define xglue(x, y) x ## y -#define glue(x, y) xglue(x, y) -#define stringify(s) tostring(s) -#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 -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef always_inline -#if (__GNUC__ < 3) || defined(__APPLE__) -#define always_inline inline -#else -#define always_inline __attribute__ (( always_inline )) inline -#endif -#endif - /* bottom halves */ typedef struct QEMUBH QEMUBH; diff --git a/translate-op.c b/translate-op.c index b21a522506..8104e86f22 100644 --- a/translate-op.c +++ b/translate-op.c @@ -24,6 +24,7 @@ #include <inttypes.h> #include "config.h" +#include "osdep.h" enum { #define DEF(s, n, copy_size) INDEX_op_ ## s, |