diff options
author | Benjamin Gray <bgray@linux.ibm.com> | 2023-04-06 14:33:16 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-04-20 13:21:45 +1000 |
commit | 6ff4dc25483f3f49d1db48af28d4c485fc77bd21 (patch) | |
tree | 5ec89621d6a955f58ca9d88b33ef0cf001ddaaed /tools/testing/selftests/powerpc/include | |
parent | c97b2fc6627e1c26a3a84633e135322918a1e592 (diff) |
selftests/powerpc: Allow bind_to_cpu() to automatically pick CPU
All current users of bind_to_cpu() don't care _which_ CPU they get, just
that they are bound to a single free one. So alter the interface to
1. Accept a BIND_CPU_ANY value that tells it to automatically
pick a CPU
2. Return the picked CPU
And convert all these users to bind_to_cpu(BIND_CPU_ANY).
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230406043320.125138-4-bgray@linux.ibm.com
Diffstat (limited to 'tools/testing/selftests/powerpc/include')
-rw-r--r-- | tools/testing/selftests/powerpc/include/utils.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/include/utils.h b/tools/testing/selftests/powerpc/include/utils.h index d3589e16a20f..44bfd48b93d6 100644 --- a/tools/testing/selftests/powerpc/include/utils.h +++ b/tools/testing/selftests/powerpc/include/utils.h @@ -31,6 +31,8 @@ int read_auxv(char *buf, ssize_t buf_size); void *find_auxv_entry(int type, char *auxv); void *get_auxv_entry(int type); +#define BIND_CPU_ANY (-1) + int pick_online_cpu(void); int bind_to_cpu(int cpu); |