Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMIu7-0005cM-FS for qemu-devel@nongnu.org; Tue, 05 Feb 2008 03:11:43 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMIu5-0005c2-1p for qemu-devel@nongnu.org; Tue, 05 Feb 2008 03:11:42 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMIu4-0005bz-Pi for qemu-devel@nongnu.org; Tue, 05 Feb 2008 03:11:40 -0500 Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JMIu3-0007eI-Oi for qemu-devel@nongnu.org; Tue, 05 Feb 2008 03:11:40 -0500 Received: from kassel160.server4you.de ([62.75.246.160] helo=csgraf.de) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JMIu1-0004gb-9p for qemu-devel@nongnu.org; Tue, 05 Feb 2008 03:11:37 -0500 Received: from [192.168.0.18] (visit.suse.de [195.135.221.17]) by csgraf.de (Postfix) with ESMTP id 174A75206 for ; Tue, 5 Feb 2008 09:11:36 +0100 (CET) Message-Id: <182699B6-EED3-4BAE-BA7E-52526F145DBE@csgraf.de> From: Alexander Graf Content-Type: multipart/mixed; boundary=Apple-Mail-6-553596366 Mime-Version: 1.0 (Apple Message framework v915) Date: Tue, 5 Feb 2008 09:11:35 +0100 Subject: [Qemu-devel] [PATCH 4/4] Mac OS X generic support v2 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --Apple-Mail-6-553596366 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit 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 --Apple-Mail-6-553596366 Content-Disposition: attachment; filename=qemu-mac-generic.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="qemu-mac-generic.patch" Content-Transfer-Encoding: 7bit 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; --Apple-Mail-6-553596366 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-6-553596366--