* [Qemu-devel] [PATCH 4/4] Mac OS X generic support v2
@ 2008-02-05 8:11 Alexander Graf
0 siblings, 0 replies; only message in thread
From: Alexander Graf @ 2008-02-05 8:11 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 400 bytes --]
This patch implements Mac OS X specific parts that are necessary to
get i386 and x86_64 versions of qemu working. Since both hosts need
this patch, I seperated it from the architecture specific ones.
It does:
- not force always_inline
- only define [u]intXX types if they are not already defined
- nullify spin-functions using #define instead of inline function
- include osdep.h in host-utils
[-- Attachment #2: qemu-mac-generic.patch --]
[-- Type: application/octet-stream, Size: 1992 bytes --]
Index: host-utils.h
===================================================================
--- host-utils.h.orig 2007-12-18 02:58:05.000000000 +0100
+++ host-utils.h 2008-02-04 15:05:50.000000000 +0100
@@ -23,6 +23,8 @@
* THE SOFTWARE.
*/
+#include "osdep.h"
+
#if defined(__x86_64__)
#define __HAVE_FAST_MULU64__
static always_inline void mulu64 (uint64_t *plow, uint64_t *phigh,
Index: osdep.h
===================================================================
--- osdep.h.orig 2008-01-31 10:22:27.000000000 +0100
+++ osdep.h 2008-02-04 15:05:50.000000000 +0100
@@ -33,7 +33,9 @@
#define always_inline __attribute__ (( always_inline )) __inline__
#endif
#endif
+#if !defined(__APPLE__)
#define inline always_inline
+#endif
#ifdef __i386__
#define REGPARM __attribute((regparm(3)))
Index: fpu/softfloat.h
===================================================================
--- fpu/softfloat.h.orig 2007-11-25 19:40:20.000000000 +0100
+++ fpu/softfloat.h 2008-02-04 15:05:50.000000000 +0100
@@ -50,11 +50,17 @@
typedef uint8_t flag;
typedef uint8_t uint8;
typedef int8_t int8;
+#ifndef _UINT16
typedef int uint16;
+#endif
typedef int int16;
+#ifndef _UINT32
typedef unsigned int uint32;
+#endif
typedef signed int int32;
+#ifndef _UINT64
typedef uint64_t uint64;
+#endif
typedef int64_t int64;
/*----------------------------------------------------------------------------
Index: exec-all.h
===================================================================
--- exec-all.h.orig 2008-02-03 18:35:41.000000000 +0100
+++ exec-all.h 2008-02-04 15:05:50.000000000 +0100
@@ -448,6 +448,12 @@
return !testandset(lock);
}
#else
+/* On Darwin the compiler tries to be smart about spinlocking functions and replaces them itself */
+#ifdef __APPLE__
+#define spin_lock(x)
+#define spin_unlock(x)
+#define spin_trylock(x)
+#else
static inline void spin_lock(spinlock_t *lock)
{
}
@@ -461,6 +467,7 @@
return 1;
}
#endif
+#endif
extern spinlock_t tb_lock;
[-- Attachment #3: Type: text/plain, Size: 1 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-05 8:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-05 8:11 [Qemu-devel] [PATCH 4/4] Mac OS X generic support v2 Alexander Graf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).