Fix build breakage in log2 assembly
PATCH 1/1 Fix build breakage in log2 assembly
# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1164148984 21600
# Node ID 7ad4645e7a54ce7ad64ec6fce30ac0f34d8d0fae # Parent 79015565d3487b1c4c0d4c630250d685ace81f07 [POWERPC][LIBFS] Fix build breakage in log2 assembly.
Signed-off-by Hollis Blanchard <[email protected]>
tools/libfsimage/ext2fs/fsys_ext2fs.c +8 -1
@@ -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; }
tools/libfsimage/reiserfs/fsys_reiserfs.c +8 -1
@@ -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; }