Skip to content

Commit

Permalink
selftests/powerpc: Adjust wild_bctr to build with old binutils
Browse files Browse the repository at this point in the history
Currently the selftest wild_bctr can fail to build when an old gcc is
used, notably on gcc using a binutils version <= 2.27, because the
assembler does not support the integer suffix UL.

This patch adjusts the wild_bctr test so the REG_POISON value is still
treated as an unsigned long for the shifts on compilation but the UL
suffix is absent on the stringification, so the inline asm code
generated has no UL suffixes.

Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com>
[mpe: Wrap long line]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Gustavo Romero authored and Michael Ellerman committed Nov 15, 2018
1 parent 66f93c5 commit b2fed34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/testing/selftests/powerpc/mm/wild_bctr.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ static int ok(void)
return 0;
}

#define REG_POISON 0x5a5aUL
#define POISONED_REG(n) ((REG_POISON << 48) | ((n) << 32) | (REG_POISON << 16) | (n))
#define REG_POISON 0x5a5a
#define POISONED_REG(n) ((((unsigned long)REG_POISON) << 48) | ((n) << 32) | \
(((unsigned long)REG_POISON) << 16) | (n))

static inline void poison_regs(void)
{
Expand Down

0 comments on commit b2fed34

Please sign in to comment.