hwprobe.h 724 B

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