diff options
| author | ilnaz <[email protected]> | 2022-12-13 16:01:38 +0300 |
|---|---|---|
| committer | ilnaz <[email protected]> | 2022-12-13 16:01:38 +0300 |
| commit | f2bea70bea01921ec43846224d100f2c70dd5719 (patch) | |
| tree | eead917572063b63adc1c9a76284c8fbd10f25a3 /contrib/libs/liburing/src/syscall.h | |
| parent | 1ab9ee3dfe0ab4023a3a57bf55de31dff3eac908 (diff) | |
Add cross-link
Diffstat (limited to 'contrib/libs/liburing/src/syscall.h')
| -rw-r--r-- | contrib/libs/liburing/src/syscall.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/contrib/libs/liburing/src/syscall.h b/contrib/libs/liburing/src/syscall.h new file mode 100644 index 00000000000..4fa77e60ed3 --- /dev/null +++ b/contrib/libs/liburing/src/syscall.h @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: MIT */ +#ifndef LIBURING_SYSCALL_H +#define LIBURING_SYSCALL_H + +#include <errno.h> +#include <signal.h> +#include <stdint.h> +#include <unistd.h> +#include <stdbool.h> +#include <sys/mman.h> +#include <sys/syscall.h> +#include <sys/resource.h> +#include <liburing.h> + +/* + * Don't put this below the #include "arch/$arch/syscall.h", that + * file may need it. + */ +struct io_uring_params; + +static inline void *ERR_PTR(intptr_t n) +{ + return (void *) n; +} + +static inline int PTR_ERR(const void *ptr) +{ + return (int) (intptr_t) ptr; +} + +static inline bool IS_ERR(const void *ptr) +{ + return uring_unlikely((uintptr_t) ptr >= (uintptr_t) -4095UL); +} + +#if defined(__x86_64__) || defined(__i386__) +#include "arch/x86/syscall.h" +#elif defined(__aarch64__) +#include "arch/aarch64/syscall.h" +#else +/* + * We don't have native syscall wrappers + * for this arch. Must use libc! + */ +#ifdef CONFIG_NOLIBC + #error "This arch doesn't support building liburing without libc" +#endif +/* libc syscall wrappers. */ +#error #include "arch/generic/syscall.h" +#endif +#endif |
