summaryrefslogtreecommitdiffstats
path: root/src/zstd/contrib/linux-kernel/test/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'src/zstd/contrib/linux-kernel/test/include/linux')
-rw-r--r--src/zstd/contrib/linux-kernel/test/include/linux/compiler.h12
-rw-r--r--src/zstd/contrib/linux-kernel/test/include/linux/errno.h6
-rw-r--r--src/zstd/contrib/linux-kernel/test/include/linux/kernel.h16
-rw-r--r--src/zstd/contrib/linux-kernel/test/include/linux/math64.h11
-rw-r--r--src/zstd/contrib/linux-kernel/test/include/linux/module.h10
-rw-r--r--src/zstd/contrib/linux-kernel/test/include/linux/string.h1
-rw-r--r--src/zstd/contrib/linux-kernel/test/include/linux/types.h2
7 files changed, 58 insertions, 0 deletions
diff --git a/src/zstd/contrib/linux-kernel/test/include/linux/compiler.h b/src/zstd/contrib/linux-kernel/test/include/linux/compiler.h
new file mode 100644
index 000000000..4fb4f42e2
--- /dev/null
+++ b/src/zstd/contrib/linux-kernel/test/include/linux/compiler.h
@@ -0,0 +1,12 @@
+#ifndef LINUX_COMPILER_H_
+#define LINUX_COMPILER_H_
+
+#ifndef __always_inline
+# define __always_inline inline
+#endif
+
+#ifndef noinline
+# define noinline __attribute__((__noinline__))
+#endif
+
+#endif // LINUX_COMPILER_H_
diff --git a/src/zstd/contrib/linux-kernel/test/include/linux/errno.h b/src/zstd/contrib/linux-kernel/test/include/linux/errno.h
new file mode 100644
index 000000000..b9db08524
--- /dev/null
+++ b/src/zstd/contrib/linux-kernel/test/include/linux/errno.h
@@ -0,0 +1,6 @@
+#ifndef LINUX_ERRNO_H_
+#define LINUX_ERRNO_H_
+
+#define EINVAL 22
+
+#endif // LINUX_ERRNO_H_
diff --git a/src/zstd/contrib/linux-kernel/test/include/linux/kernel.h b/src/zstd/contrib/linux-kernel/test/include/linux/kernel.h
new file mode 100644
index 000000000..3ef2f7fe8
--- /dev/null
+++ b/src/zstd/contrib/linux-kernel/test/include/linux/kernel.h
@@ -0,0 +1,16 @@
+#ifndef LINUX_KERNEL_H_
+#define LINUX_KERNEL_H_
+
+#define ALIGN(x, a) ({ \
+ typeof(x) const __xe = (x); \
+ typeof(a) const __ae = (a); \
+ typeof(a) const __m = __ae - 1; \
+ typeof(x) const __r = __xe & __m; \
+ __xe + (__r ? (__ae - __r) : 0); \
+ })
+
+#define PTR_ALIGN(p, a) (typeof(p))ALIGN((unsigned long long)(p), (a))
+
+#define current Something that doesn't compile :)
+
+#endif // LINUX_KERNEL_H_
diff --git a/src/zstd/contrib/linux-kernel/test/include/linux/math64.h b/src/zstd/contrib/linux-kernel/test/include/linux/math64.h
new file mode 100644
index 000000000..3d0ae72d5
--- /dev/null
+++ b/src/zstd/contrib/linux-kernel/test/include/linux/math64.h
@@ -0,0 +1,11 @@
+#ifndef LINUX_MATH64_H
+#define LINUX_MATH64_H
+
+#include <stdint.h>
+
+static uint64_t div_u64(uint64_t n, uint32_t d)
+{
+ return n / d;
+}
+
+#endif
diff --git a/src/zstd/contrib/linux-kernel/test/include/linux/module.h b/src/zstd/contrib/linux-kernel/test/include/linux/module.h
new file mode 100644
index 000000000..ef514c349
--- /dev/null
+++ b/src/zstd/contrib/linux-kernel/test/include/linux/module.h
@@ -0,0 +1,10 @@
+#ifndef LINUX_MODULE_H_
+#define LINUX_MODULE_H_
+
+#define EXPORT_SYMBOL(symbol) \
+ void* __##symbol = symbol
+#define MODULE_LICENSE(license) static char const *const LICENSE = license
+#define MODULE_DESCRIPTION(description) \
+ static char const *const DESCRIPTION = description
+
+#endif // LINUX_MODULE_H_
diff --git a/src/zstd/contrib/linux-kernel/test/include/linux/string.h b/src/zstd/contrib/linux-kernel/test/include/linux/string.h
new file mode 100644
index 000000000..3b2f59002
--- /dev/null
+++ b/src/zstd/contrib/linux-kernel/test/include/linux/string.h
@@ -0,0 +1 @@
+#include <string.h>
diff --git a/src/zstd/contrib/linux-kernel/test/include/linux/types.h b/src/zstd/contrib/linux-kernel/test/include/linux/types.h
new file mode 100644
index 000000000..c2d4f4b72
--- /dev/null
+++ b/src/zstd/contrib/linux-kernel/test/include/linux/types.h
@@ -0,0 +1,2 @@
+#include <stddef.h>
+#include <stdint.h>