ia64/xen-unstable

changeset 12542:60b60f75a221

[POWERPC][LIBFS] Fix build breakage in log2 assembly.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author kfraser@localhost.localdomain
date Wed Nov 22 10:10:29 2006 +0000 (2006-11-22)
parents 1d7d5d48fcdc
children a3c6479c87ef
files tools/libfsimage/ext2fs/fsys_ext2fs.c tools/libfsimage/reiserfs/fsys_reiserfs.c
line diff
     1.1 --- a/tools/libfsimage/ext2fs/fsys_ext2fs.c	Wed Nov 22 10:09:28 2006 +0000
     1.2 +++ b/tools/libfsimage/ext2fs/fsys_ext2fs.c	Wed Nov 22 10:10:29 2006 +0000
     1.3 @@ -278,12 +278,19 @@ ffz (unsigned long word)
     1.4  
     1.5  #elif defined(__powerpc__)
     1.6  
     1.7 +#ifdef __powerpc64__
     1.8 +#define PPC_CNTLZL "cntlzd"
     1.9 +#else
    1.10 +#define PPC_CNTLZL "cntlzw"
    1.11 +#endif
    1.12 +#define BITS_PER_LONG (sizeof(long) * 8)
    1.13 +
    1.14  static __inline__ int
    1.15  __ilog2(unsigned long x)
    1.16  {
    1.17    int lz;
    1.18  
    1.19 -  asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (x));
    1.20 +  asm (PPC_CNTLZL " %0,%1" : "=r" (lz) : "r" (x));
    1.21    return BITS_PER_LONG - 1 - lz;
    1.22  }
    1.23  
     2.1 --- a/tools/libfsimage/reiserfs/fsys_reiserfs.c	Wed Nov 22 10:09:28 2006 +0000
     2.2 +++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c	Wed Nov 22 10:10:29 2006 +0000
     2.3 @@ -403,12 +403,19 @@ grub_log2 (unsigned long word)
     2.4  
     2.5  #elif defined(__powerpc__)
     2.6  
     2.7 +#ifdef __powerpc64__
     2.8 +#define PPC_CNTLZL "cntlzd"
     2.9 +#else
    2.10 +#define PPC_CNTLZL "cntlzw"
    2.11 +#endif
    2.12 +#define BITS_PER_LONG (sizeof(long) * 8)
    2.13 +
    2.14  static __inline__ int
    2.15  __ilog2(unsigned long x)
    2.16  {
    2.17    int lz;
    2.18  
    2.19 -  asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (x));
    2.20 +  asm (PPC_CNTLZL " %0,%1" : "=r" (lz) : "r" (x));
    2.21    return BITS_PER_LONG - 1 - lz;
    2.22  }
    2.23