summaryrefslogtreecommitdiff
path: root/tools/include/linux
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2026-09-21 19:35:45 -0300
committerAlex Williamson <alex@shazbot.org>2026-09-28 14:10:48 -0600
commitbe0237a5f35df3518953075c375cc07fe09aef38 (patch)
tree090de8e821c124d9d69d12027d81c334ae501ff6 /tools/include/linux
parent5f8e94a75a11661184de9e2d8aaeca095554c6f7 (diff)
selftests: Add additional kernel functions to tools/include/
These are needed by the VFIO mlx5 selftest in the following patches, which includes some headers from mlx5 and also needs a few more MMIO-related features. - DECLARE_FLEX_ARRAY in new tools/include/linux/stddef.h (wraps existing __DECLARE_FLEX_ARRAY from uapi/linux/stddef.h) - dma_wmb/dma_rmb barriers: x86 uses compiler barrier (DMA-coherent), arm64 uses dmb oshst/oshld (outer-shareable for device visibility), generic fallback uses wmb/rmb - ioread32be/iowrite32be in tools/include/asm-generic/io.h for big-endian MMIO register access Assisted-by: Claude:claude-opus-4.6 Reviewed-by: David Matlack <dmatlack@google.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/5-v7-c6d30e8ce1e4+3dfa6-mlx5st_jgg@nvidia.com Signed-off-by: Alex Williamson <alex@shazbot.org>
Diffstat (limited to 'tools/include/linux')
-rw-r--r--tools/include/linux/stddef.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/include/linux/stddef.h b/tools/include/linux/stddef.h
new file mode 100644
index 000000000000..99182ea4a141
--- /dev/null
+++ b/tools/include/linux/stddef.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _TOOLS_LINUX_STDDEF_H
+#define _TOOLS_LINUX_STDDEF_H
+
+#include_next <linux/stddef.h>
+
+#define DECLARE_FLEX_ARRAY(TYPE, NAME) \
+ __DECLARE_FLEX_ARRAY(TYPE, NAME)
+
+#endif /* _TOOLS_LINUX_STDDEF_H */