diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2018-11-25 09:10:59 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-11-25 09:10:59 +0300 |
commit | 54a21b5c941c3c5eb7478a660b6a3119100b2c8d (patch) | |
tree | b42745c6bf2f738e569fa21cc4a75c9a9942e218 /tools | |
parent | ccda4af0f4b92f7b4c308d3acc262f4a7e3affad (diff) | |
parent | b2fed34a628df6118b5d4e13f49a33e15f704fa9 (diff) | |
download | linux-54a21b5c941c3c5eb7478a660b6a3119100b2c8d.tar.xz |
Merge branch 'fixes' into next
This contains a few must have fixes, like the stack alignment one.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/powerpc/mm/wild_bctr.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/testing/selftests/powerpc/mm/wild_bctr.c b/tools/testing/selftests/powerpc/mm/wild_bctr.c index 1b0e9e9a2ddc..f2fa101c5a6a 100644 --- a/tools/testing/selftests/powerpc/mm/wild_bctr.c +++ b/tools/testing/selftests/powerpc/mm/wild_bctr.c @@ -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) { @@ -105,6 +106,20 @@ static void dump_regs(void) } } +#ifdef _CALL_AIXDESC +struct opd { + unsigned long ip; + unsigned long toc; + unsigned long env; +}; +static struct opd bad_opd = { + .ip = BAD_NIP, +}; +#define BAD_FUNC (&bad_opd) +#else +#define BAD_FUNC BAD_NIP +#endif + int test_wild_bctr(void) { int (*func_ptr)(void); @@ -133,7 +148,7 @@ int test_wild_bctr(void) poison_regs(); - func_ptr = (int (*)(void))BAD_NIP; + func_ptr = (int (*)(void))BAD_FUNC; func_ptr(); FAIL_IF(1); /* we didn't segv? */ |