1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef SELFTEST_RISCV_HWPROBE_H
3 #define SELFTEST_RISCV_HWPROBE_H
5 #include <asm/hwprobe.h>
7 #if __BYTE_ORDER == __BIG_ENDIAN
8 # define le32_bswap(_x) \
9 ((((_x) & 0x000000ffU) << 24) | \
10 (((_x) & 0x0000ff00U) << 8) | \
11 (((_x) & 0x00ff0000U) >> 8) | \
12 (((_x) & 0xff000000U) >> 24))
14 # define le32_bswap(_x) (_x)
18 * Rather than relying on having a new enough libc to define this, just do it
19 * ourselves. This way we don't need to be coupled to a new-enough libc to
22 long riscv_hwprobe(struct riscv_hwprobe
*pairs
, size_t pair_count
,
23 size_t cpusetsize
, unsigned long *cpus
, unsigned int flags
);