WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] [POWERPC][LIBFS] Fix build breakage in log2 assembly

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] [POWERPC][LIBFS] Fix build breakage in log2 assembly
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Tue, 21 Nov 2006 16:43:26 -0500
Delivery-date: Tue, 21 Nov 2006 14:43:47 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Hollis Blanchard <hollisb@xxxxxxxxxx>
# Date 1164148984 21600
# Node ID 7ad4645e7a54ce7ad64ec6fce30ac0f34d8d0fae
# Parent  79015565d3487b1c4c0d4c630250d685ace81f07
[POWERPC][LIBFS] Fix build breakage in log2 assembly.
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>

diff -r 79015565d348 -r 7ad4645e7a54 tools/libfsimage/ext2fs/fsys_ext2fs.c
--- a/tools/libfsimage/ext2fs/fsys_ext2fs.c     Tue Nov 21 15:25:02 2006 -0600
+++ b/tools/libfsimage/ext2fs/fsys_ext2fs.c     Tue Nov 21 16:43:04 2006 -0600
@@ -278,12 +278,19 @@ ffz (unsigned long word)
 
 #elif defined(__powerpc__)
 
+#ifdef __powerpc64__
+#define PPC_CNTLZL "cntlzd"
+#else
+#define PPC_CNTLZL "cntlzw"
+#endif
+#define BITS_PER_LONG (sizeof(long) * 8)
+
 static __inline__ int
 __ilog2(unsigned long x)
 {
   int lz;
 
-  asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (x));
+  asm (PPC_CNTLZL " %0,%1" : "=r" (lz) : "r" (x));
   return BITS_PER_LONG - 1 - lz;
 }
 
diff -r 79015565d348 -r 7ad4645e7a54 tools/libfsimage/reiserfs/fsys_reiserfs.c
--- a/tools/libfsimage/reiserfs/fsys_reiserfs.c Tue Nov 21 15:25:02 2006 -0600
+++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c Tue Nov 21 16:43:04 2006 -0600
@@ -403,12 +403,19 @@ grub_log2 (unsigned long word)
 
 #elif defined(__powerpc__)
 
+#ifdef __powerpc64__
+#define PPC_CNTLZL "cntlzd"
+#else
+#define PPC_CNTLZL "cntlzw"
+#endif
+#define BITS_PER_LONG (sizeof(long) * 8)
+
 static __inline__ int
 __ilog2(unsigned long x)
 {
   int lz;
 
-  asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (x));
+  asm (PPC_CNTLZL " %0,%1" : "=r" (lz) : "r" (x));
   return BITS_PER_LONG - 1 - lz;
 }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] [POWERPC][LIBFS] Fix build breakage in log2 assembly, Hollis Blanchard <=