diff options
| author | Thomas Weißschuh <linux@weissschuh.net> | 2026-09-27 10:49:14 +0200 |
|---|---|---|
| committer | Thomas Weißschuh <linux@weissschuh.net> | 2026-09-27 11:32:06 +0200 |
| commit | ddcf77b0350b2eaca4ba2f9db7c4569045c0c46f (patch) | |
| tree | f5b8865766e64b53686d91d627aa5062ef513c21 /tools/include | |
| parent | 74136192e3f6f48670a0bccc7bdc5005b13d94f9 (diff) | |
tools/nolibc: move __NOLIBC_LLARGPART() to compiler.h
pread() and pwrite() support will require the usage of the macro from
the arch-*.h headers. sys.h can not be used from those.
Move the macro to a more generic header.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260927-nolibc-pread-v1-3-e9af6e47b37a@weissschuh.net
Diffstat (limited to 'tools/include')
| -rw-r--r-- | tools/include/nolibc/compiler.h | 9 | ||||
| -rw-r--r-- | tools/include/nolibc/sys.h | 10 |
2 files changed, 9 insertions, 10 deletions
diff --git a/tools/include/nolibc/compiler.h b/tools/include/nolibc/compiler.h index f2d7a81d0d7c..375c45ce81c8 100644 --- a/tools/include/nolibc/compiler.h +++ b/tools/include/nolibc/compiler.h @@ -90,4 +90,13 @@ # define __nolibc_no_sanitize_undefined #endif +/* + * Helper for 32-bit machines where a 64-bit syscall arg needs to be split into + * two 32-bit parts while making sure the order of the low/high parts are correct + * for the endianness: + * __NOLIBC_LLARGPART(x, 0), __NOLIBC_LLARGPART(x, 1) + */ +#define __NOLIBC_LLARGPART(_arg, _part) \ + (((union { long long ll; long l[2]; }) { .ll = _arg }).l[_part]) + #endif /* _NOLIBC_COMPILER_H */ diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 548f94d96ed2..7f06d27da612 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -71,16 +71,6 @@ static __inline__ int __nolibc_enosys(const char *syscall, ...) #endif -/* - * Helper for 32-bit machines where a 64-bit syscall arg needs to be split into - * two 32-bit parts while making sure the order of the low/high parts are correct - * for the endianness: - * __NOLIBC_LLARGPART(x, 0), __NOLIBC_LLARGPART(x, 1) - */ -#define __NOLIBC_LLARGPART(_arg, _part) \ - (((union { long long ll; long l[2]; }) { .ll = _arg }).l[_part]) - - /* Functions in this file only describe syscalls. They're declared static so * that the compiler usually decides to inline them while still being allowed * to pass a pointer to one of their instances. Each syscall exists in two |
