From: "=?utf-8?q?S=2E=C3=87a=C4=9Flar?= Onur" Subject: [PATCH] convert inline alloc_domheap_pages to static inline Date: Mon, 19 Mar 2007 02:10:03 +0200 Message-ID: <200703190210.08759.caglar@pardus.org.tr> Reply-To: caglar@pardus.org.tr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1949920252==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Developers List-Id: xen-devel@lists.xenproject.org --===============1949920252== Content-Type: multipart/signed; boundary="nextPart2549439.mqEkRDeYdg"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2549439.mqEkRDeYdg Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi; GCC manual says it is best to use static inline to guarantee compatibility,= =20 and with gcc-4.2.0 RC1 xen fails to compile like following; make[3]: Entering directory `/home/caglar/svn/xen-3.0.4-testing.hg/xen/comm= on' gcc -O2 -fomit-frame-pointer -m32 -march=3Di686 -DNDEBUG -std=3Dgnu99 -Wall= -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -nostd= inc -fno-builtin -fno-common -fno-strict-aliasing -iwithprefix=20 include -Werror -Wno-pointer-arith -pipe -I/home/caglar/svn/xen-3.0.4-testi= ng.hg/xen/include -I/home/caglar/svn/xen-3.0.4-testing.hg/xen/include/asm-x= 86/mach-generic -I/home/caglar/svn/xen-3.0.4-testing.hg/xen/include/asm-x86= /mach-default -msoft-float -fno-stack-protector -g -D__XEN__ -c=20 page_alloc.c -o page_alloc.o cc1: warnings being treated as errors page_alloc.c:744: warning: C99 inline functions are not supported; using GN= U89 page_alloc.c:744: warning: to disable this warning use -fgnu89-inline or th= e=20 gnu_inline function attribute *** 2 errors, 0 warnings make[3]: *** [page_alloc.o] Error 1 make[3]: Leaving directory `/home/caglar/svn/xen-3.0.4-testing.hg/xen/commo= n' make[2]: *** [/home/caglar/svn/xen-3.0.4-testing.hg/xen/common/built_in.o]= =20 Error 2 make[2]: Leaving directory=20 `/home/caglar/svn/xen-3.0.4-testing.hg/xen/arch/x86' make[1]: *** [/home/caglar/svn/xen-3.0.4-testing.hg/xen/xen] Error 2 make[1]: Leaving directory `/home/caglar/svn/xen-3.0.4-testing.hg/xen' make: *** [build] Error 2 This problem introduced by that [1] patch and as patch stated gcc changing = its=20 default behaviour.=20 =46ollowing patch (against xen-3.0.4-testing) converts inline=20 alloc_domheap_pages to static inline. Signed-off-by: S.=C3=87a=C4=9Flar Onur diff -r 3341afbb1953 xen/common/page_alloc.c =2D-- a/xen/common/page_alloc.c Thu Feb 15 11:34:58 2007 +0000 +++ b/xen/common/page_alloc.c Mon Mar 19 01:50:21 2007 +0200 @@ -739,12 +739,6 @@ struct page_info *__alloc_domheap_pages( return pg; } =20 =2Dinline struct page_info *alloc_domheap_pages( =2D struct domain *d, unsigned int order, unsigned int flags) =2D{ =2D return __alloc_domheap_pages(d, smp_processor_id(), order, flags); =2D} =2D void free_domheap_pages(struct page_info *pg, unsigned int order) { int i, drop_dom_ref; diff -r 3341afbb1953 xen/include/xen/mm.h =2D-- a/xen/include/xen/mm.h Thu Feb 15 11:34:58 2007 +0000 +++ b/xen/include/xen/mm.h Mon Mar 19 01:54:52 2007 +0200 @@ -32,6 +32,7 @@ #include #include #include +#include =20 struct domain; struct page_info; @@ -61,11 +62,14 @@ void free_xenheap_pages(void *v, unsigne =20 /* Domain suballocator. These functions are *not* interrupt-safe.*/ void init_domheap_pages(paddr_t ps, paddr_t pe); =2Dstruct page_info *alloc_domheap_pages( =2D struct domain *d, unsigned int order, unsigned int memflags); struct page_info *__alloc_domheap_pages( struct domain *d, unsigned int cpu, unsigned int order,=20 unsigned int memflags); +static inline struct page_info *alloc_domheap_pages( + struct domain *d, unsigned int order, unsigned int memflags) +{ + return __alloc_domheap_pages( d, smp_processor_id(), order, memflags ); +} void free_domheap_pages(struct page_info *pg, unsigned int order); unsigned long avail_domheap_pages(void); unsigned long avail_heap_pages(int zone, int node); [1] http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00702.html Cheers =2D-=20 S.=C3=87a=C4=9Flar Onur http://cekirdek.pardus.org.tr/~caglar/ Linux is like living in a teepee. No Windows, no Gates and an Apache in hou= se! --nextPart2549439.mqEkRDeYdg Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (GNU/Linux) iD8DBQBF/dTgy7E6i0LKo6YRAuRaAJ9q6AHJFOQ1B4mGnm9If8GehyIkzQCfQo4T g8ESvw2QXeoVu2TQRIwSE9w= =crd6 -----END PGP SIGNATURE----- --nextPart2549439.mqEkRDeYdg-- --===============1949920252== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1949920252==--