diff options
Diffstat (limited to 'src/zstd/contrib/linux-kernel/test/include/linux')
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 00000000..7991b8b2 --- /dev/null +++ b/src/zstd/contrib/linux-kernel/test/include/linux/compiler.h @@ -0,0 +1,12 @@ +#ifndef LINUX_COMIPLER_H_ +#define LINUX_COMIPLER_H_ + +#ifndef __always_inline +# define __always_inline inline +#endif + +#ifndef noinline +# define noinline __attribute__((__noinline__)) +#endif + +#endif // LINUX_COMIPLER_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 00000000..b9db0852 --- /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 00000000..3ef2f7fe --- /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 00000000..3d0ae72d --- /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 00000000..ef514c34 --- /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 00000000..3b2f5900 --- /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 00000000..c2d4f4b7 --- /dev/null +++ b/src/zstd/contrib/linux-kernel/test/include/linux/types.h @@ -0,0 +1,2 @@ +#include <stddef.h> +#include <stdint.h> |