tools/testing/selftests/riscv/hwprobe/hwprobe.h

Source file repositories/reference/linux-study-clean/tools/testing/selftests/riscv/hwprobe/hwprobe.h

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/riscv/hwprobe/hwprobe.h
Extension
.h
Size
724 bytes
Lines
26
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef SELFTEST_RISCV_HWPROBE_H
#define SELFTEST_RISCV_HWPROBE_H
#include <stddef.h>
#include <asm/hwprobe.h>

#if __BYTE_ORDER == __BIG_ENDIAN
# define le32_bswap(_x)				\
	((((_x) & 0x000000ffU) << 24) |		\
	 (((_x) & 0x0000ff00U) <<  8) |		\
	 (((_x) & 0x00ff0000U) >>  8) |		\
	 (((_x) & 0xff000000U) >> 24))
#else
# define le32_bswap(_x) (_x)
#endif

/*
 * Rather than relying on having a new enough libc to define this, just do it
 * ourselves.  This way we don't need to be coupled to a new-enough libc to
 * contain the call.
 */
long riscv_hwprobe(struct riscv_hwprobe *pairs, size_t pair_count,
		   size_t cpusetsize, unsigned long *cpus, unsigned int flags);

#endif

Annotation

Implementation Notes