From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D6UjY-0003bm-G7 for qemu-devel@nongnu.org; Wed, 02 Mar 2005 09:21:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D6UjS-0003Ym-41 for qemu-devel@nongnu.org; Wed, 02 Mar 2005 09:21:47 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6UjR-0003Qb-Dw for qemu-devel@nongnu.org; Wed, 02 Mar 2005 09:21:45 -0500 Received: from [65.74.133.9] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1D6UM2-0003Tx-Cb for qemu-devel@nongnu.org; Wed, 02 Mar 2005 08:57:35 -0500 From: Paul Brook Date: Wed, 2 Mar 2005 13:57:28 +0000 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_IZcJC4R2PPRV1E9" Message-Id: <200503021357.28424.paul@codesourcery.com> Subject: [Qemu-devel] Remove extern inline 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 --Boundary-00=_IZcJC4R2PPRV1E9 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline "extern inline" is a particularly unintuitive bit of C syntax where the kernel and gcc developers disagreed on it's semantics. It was originally in the kernel used to guarantee that a particular routine is inlined. gcc not longer guarantees this, resulting in a compiler error if the routine is not inlined (eg. when compiling with -O0). The attached patch changes the arm fpa11 emulation code to use "static inline" instead of "extern inline". The comments indicate that the code does not rely on inlining for correct behaviour, so this change should be safe. Paul --Boundary-00=_IZcJC4R2PPRV1E9 Content-Type: text/x-diff; charset="us-ascii"; name="patch.qemu_fpa_inline" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.qemu_fpa_inline" ? target-arm/p ? target-arm/nwfpe/p Index: target-arm/nwfpe/ARM-gcc.h =================================================================== RCS file: /cvsroot/qemu/qemu/target-arm/nwfpe/ARM-gcc.h,v retrieving revision 1.1 diff -u -p -r1.1 ARM-gcc.h --- target-arm/nwfpe/ARM-gcc.h 16 Feb 2004 21:43:58 -0000 1.1 +++ target-arm/nwfpe/ARM-gcc.h 2 Mar 2005 13:48:58 -0000 @@ -68,7 +68,7 @@ a compiler does not support explicit inl to be `static'. ------------------------------------------------------------------------------- */ -#define INLINE extern __inline__ +#define INLINE static __inline__ /* For use as a GCC soft-float library we need some special function names. */ Index: target-arm/nwfpe/fpa11.inl =================================================================== RCS file: /cvsroot/qemu/qemu/target-arm/nwfpe/fpa11.inl,v retrieving revision 1.1 diff -u -p -r1.1 fpa11.inl --- target-arm/nwfpe/fpa11.inl 16 Feb 2004 21:43:58 -0000 1.1 +++ target-arm/nwfpe/fpa11.inl 2 Mar 2005 13:48:58 -0000 @@ -22,13 +22,13 @@ #include "fpa11.h" /* Read and write floating point status register */ -extern __inline__ unsigned int readFPSR(void) +INLINE unsigned int readFPSR(void) { FPA11 *fpa11 = GET_FPA11(); return(fpa11->fpsr); } -extern __inline__ void writeFPSR(FPSR reg) +INLINE void writeFPSR(FPSR reg) { FPA11 *fpa11 = GET_FPA11(); /* the sysid byte in the status register is readonly */ @@ -36,14 +36,14 @@ extern __inline__ void writeFPSR(FPSR re } /* Read and write floating point control register */ -extern __inline__ FPCR readFPCR(void) +INLINE FPCR readFPCR(void) { FPA11 *fpa11 = GET_FPA11(); /* clear SB, AB and DA bits before returning FPCR */ return(fpa11->fpcr & ~MASK_RFC); } -extern __inline__ void writeFPCR(FPCR reg) +INLINE void writeFPCR(FPCR reg) { FPA11 *fpa11 = GET_FPA11(); fpa11->fpcr &= ~MASK_WFC; /* clear SB, AB and DA bits */ --Boundary-00=_IZcJC4R2PPRV1E9--