aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libfsimage
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-11-22 10:10:29 +0000
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-11-22 10:10:29 +0000
commit47186797ce247ec18bcf8c95a7384972cd4aa0f3 (patch)
tree49d22b06d55774af73a95128cc4e09dc490ef6b7 /tools/libfsimage
parentd41363d448f3edb3d2a463cf3af50d55691dfbc2 (diff)
downloadxen-47186797ce247ec18bcf8c95a7384972cd4aa0f3.tar.gz
xen-47186797ce247ec18bcf8c95a7384972cd4aa0f3.tar.bz2
xen-47186797ce247ec18bcf8c95a7384972cd4aa0f3.zip
[POWERPC][LIBFS] Fix build breakage in log2 assembly.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Diffstat (limited to 'tools/libfsimage')
-rw-r--r--tools/libfsimage/ext2fs/fsys_ext2fs.c9
-rw-r--r--tools/libfsimage/reiserfs/fsys_reiserfs.c9
2 files changed, 16 insertions, 2 deletions
diff --git a/tools/libfsimage/ext2fs/fsys_ext2fs.c b/tools/libfsimage/ext2fs/fsys_ext2fs.c
index c4e4c863bd..c3749df222 100644
--- a/tools/libfsimage/ext2fs/fsys_ext2fs.c
+++ b/tools/libfsimage/ext2fs/fsys_ext2fs.c
@@ -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 --git a/tools/libfsimage/reiserfs/fsys_reiserfs.c b/tools/libfsimage/reiserfs/fsys_reiserfs.c
index 1f7b6759df..4b99149735 100644
--- a/tools/libfsimage/reiserfs/fsys_reiserfs.c
+++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c
@@ -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;
}