projects/linux·commit ee60c510

Merge tag 'nolibc-20260412-for-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc

ee60c510 · Linus Torvalds <[email protected]> · 2026-04-14 17:13:09 -07:00

Pull nolibc updates from Thomas Weißschuh:

 - Many new features and optimizations to printf()

 - Rename non-standard symbols to avoid collisions with application code

 - Support for byteswap.h, endian.h, err.h and asprintf()

 - 64-bit dev_t

 - Smaller cleanups and fixes to the code and build system

* tag 'nolibc-20260412-for-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc: (61 commits)
  selftests/nolibc: use gcc 15
  tools/nolibc: support UBSAN on gcc
  tools/nolibc: create __nolibc_no_sanitize_ubsan
  selftests/nolibc: don't skip tests for unimplemented syscalls anymore
  selftests/nolibc: explicitly handle ENOSYS from ptrace()
  tools/nolibc: add byteorder conversions
  tools/nolibc: add the _syscall() macro
  tools/nolibc: move the call to __sysret() into syscall()
  tools/nolibc: rename the internal macros used in syscall()
  selftests/nolibc: only use libgcc when really necessary
  selftests/nolibc: test the memory allocator
  tools/nolibc: check for overflow in calloc() without divisions
  tools/nolibc: add support for asprintf()
  tools/nolibc: use __builtin_offsetof()
  tools/nolibc: use makedev() in fstatat()
  tools/nolibc: handle all major and minor numbers in makedev() and friends
  tools/nolibc: make dev_t 64 bits wide
  tools/nolibc: move the logic of makedev() and friends into functions
  selftests/nolibc: add a test for stat().st_rdev
  selftests/nolibc: add some tests for makedev() and friends
  ...
Commit
ee60c510fb3468ec6fab98419218c4e7b37e2ca3
Parents
3203a08c · b070dc36

Merge commit. Changes below are compared with the first parent: 3203a08c.

Changes

55 files changed · +1453 −757

FileStatusAddDelContent
tools/include/nolibc/Makefilemodified+5−9View file
tools/include/nolibc/arch-arm.hmodified+7−7View file
tools/include/nolibc/arch-arm64.hmodified+7−7View file
tools/include/nolibc/arch-loongarch.hmodified+7−7View file
tools/include/nolibc/arch-m68k.hmodified+7−7View file
tools/include/nolibc/arch-mips.hmodified+21−12View file
tools/include/nolibc/arch-powerpc.hmodified+7−7View file
tools/include/nolibc/arch-riscv.hmodified+7−7View file
tools/include/nolibc/arch-s390.hmodified+17−17View file
tools/include/nolibc/arch-sh.hmodified+7−7View file
tools/include/nolibc/arch-sparc.hmodified+13−13View file
tools/include/nolibc/arch-x86.hmodified+34−34View file
tools/include/nolibc/byteswap.hadded+21−0View file
tools/include/nolibc/compiler.hmodified+20−1View file
tools/include/nolibc/crt.hmodified+27−4View file
tools/include/nolibc/dirent.hmodified+2−2View file
tools/include/nolibc/endian.hadded+32−0View file
tools/include/nolibc/err.hadded+87−0View file
tools/include/nolibc/errno.hmodified+4−0View file
tools/include/nolibc/fcntl.hmodified+6−6View file
tools/include/nolibc/nolibc.hmodified+8−5View file
tools/include/nolibc/poll.hmodified+4−4View file
tools/include/nolibc/sched.hmodified+6−6View file
tools/include/nolibc/signal.hmodified+1−1View file
tools/include/nolibc/stackprotector.hmodified+4−4View file
tools/include/nolibc/std.hmodified+1−1View file
tools/include/nolibc/stddef.hmodified+1−1View file
tools/include/nolibc/stdio.hmodified+437−128View file
tools/include/nolibc/stdlib.hmodified+85−90View file
tools/include/nolibc/sys.hmodified+144−144View file
tools/include/nolibc/sys/ioctl.hmodified+3−3View file
tools/include/nolibc/sys/mman.hmodified+12−12View file
tools/include/nolibc/sys/mount.hmodified+4−4View file
tools/include/nolibc/sys/prctl.hmodified+4−4View file
tools/include/nolibc/sys/ptrace.hmodified+3−3View file
tools/include/nolibc/sys/random.hmodified+3−3View file
tools/include/nolibc/sys/reboot.hmodified+3−3View file
tools/include/nolibc/sys/resource.hmodified+5−5View file
tools/include/nolibc/sys/select.hmodified+6−4View file
tools/include/nolibc/sys/stat.hmodified+7−10View file
tools/include/nolibc/sys/syscall.hmodified+6−5View file
tools/include/nolibc/sys/sysmacros.hmodified+21−4View file
tools/include/nolibc/sys/time.hmodified+4−4View file
tools/include/nolibc/sys/timerfd.hmodified+12−12View file
tools/include/nolibc/sys/uio.hmodified+6−6View file
tools/include/nolibc/sys/utsname.hmodified+3−3View file
tools/include/nolibc/sys/wait.hmodified+3−3View file
tools/include/nolibc/time.hmodified+34−34View file
tools/include/nolibc/unistd.hmodified+6−6View file
tools/testing/selftests/nolibc/Makefilemodified+2−2View file
tools/testing/selftests/nolibc/Makefile.includemodified+4−1View file
tools/testing/selftests/nolibc/Makefile.nolibcmodified+7−16View file
tools/testing/selftests/nolibc/nolibc-test-ignore-errno.cadded+6−0View file
tools/testing/selftests/nolibc/nolibc-test.cmodified+259−78View file
tools/testing/selftests/nolibc/run-tests.shmodified+1−1View file

Only the first 600 diff lines are shown. Download the complete patch.

tools/include/nolibc/Makefile

View file
diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile
index 1958dda..7455097 100644
--- a/tools/include/nolibc/Makefile
+++ b/tools/include/nolibc/Makefile
@@ -17,19 +17,17 @@ endif
# it defaults to this nolibc directory.
OUTPUT ?= $(CURDIR)/
-ifeq ($(V),1)
-Q=
-else
-Q=@
-endif
-
-arch_files := arch.h $(wildcard arch-*.h)
+architectures := arm arm64 loongarch m68k mips powerpc riscv s390 sh sparc x86
+arch_files := arch.h $(addsuffix .h, $(addprefix arch-, $(architectures)))
all_files := \
+ byteswap.h \
compiler.h \
crt.h \
ctype.h \
dirent.h \
elf.h \
+ endian.h \
+ err.h \
errno.h \
fcntl.h \
getopt.h \
@@ -96,12 +94,10 @@ help:
# installs headers for all archs at once.
headers:
- $(Q)mkdir -p "$(OUTPUT)sysroot"
$(Q)mkdir -p "$(OUTPUT)sysroot/include"
$(Q)cp --parents $(arch_files) $(all_files) "$(OUTPUT)sysroot/include/"
headers_standalone: headers
- $(Q)$(MAKE) -C $(srctree) headers
$(Q)$(MAKE) -C $(srctree) headers_install INSTALL_HDR_PATH=$(OUTPUT)sysroot
CFLAGS_s390 := -m64

tools/include/nolibc/arch-arm.h

View file
diff --git a/tools/include/nolibc/arch-arm.h b/tools/include/nolibc/arch-arm.h
index 251c425..a4d3a77 100644
--- a/tools/include/nolibc/arch-arm.h
+++ b/tools/include/nolibc/arch-arm.h
@@ -50,7 +50,7 @@
#endif /* end THUMB */
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0"); \
@@ -67,7 +67,7 @@
_arg1; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
@@ -84,7 +84,7 @@
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
@@ -102,7 +102,7 @@
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
@@ -121,7 +121,7 @@
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
@@ -141,7 +141,7 @@
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
@@ -162,7 +162,7 @@
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \

tools/include/nolibc/arch-arm64.h

View file
diff --git a/tools/include/nolibc/arch-arm64.h b/tools/include/nolibc/arch-arm64.h
index 080a55a..28b3c75 100644
--- a/tools/include/nolibc/arch-arm64.h
+++ b/tools/include/nolibc/arch-arm64.h
@@ -22,7 +22,7 @@
* don't have to experience issues with register constraints.
*/
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0"); \
@@ -36,7 +36,7 @@
_arg1; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
@@ -51,7 +51,7 @@
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
@@ -67,7 +67,7 @@
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
@@ -84,7 +84,7 @@
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
@@ -102,7 +102,7 @@
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
@@ -121,7 +121,7 @@
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \

tools/include/nolibc/arch-loongarch.h

View file
diff --git a/tools/include/nolibc/arch-loongarch.h b/tools/include/nolibc/arch-loongarch.h
index c894176..86fb34b 100644
--- a/tools/include/nolibc/arch-loongarch.h
+++ b/tools/include/nolibc/arch-loongarch.h
@@ -24,7 +24,7 @@
#define _NOLIBC_SYSCALL_CLOBBERLIST \
"memory", "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", "$t8"
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0"); \
@@ -38,7 +38,7 @@
_arg1; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -52,7 +52,7 @@
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -68,7 +68,7 @@
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -85,7 +85,7 @@
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -103,7 +103,7 @@
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -122,7 +122,7 @@
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \

tools/include/nolibc/arch-m68k.h

View file
diff --git a/tools/include/nolibc/arch-m68k.h b/tools/include/nolibc/arch-m68k.h
index 2a4fbad..81d34c2 100644
--- a/tools/include/nolibc/arch-m68k.h
+++ b/tools/include/nolibc/arch-m68k.h
@@ -15,7 +15,7 @@
#define _NOLIBC_SYSCALL_CLOBBERLIST "memory"
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("d0") = (num); \
\
@@ -28,7 +28,7 @@
_num; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
@@ -42,7 +42,7 @@
_num; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
@@ -57,7 +57,7 @@
_num; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
@@ -73,7 +73,7 @@
_num; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
@@ -90,7 +90,7 @@
_num; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
@@ -108,7 +108,7 @@
_num; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \

tools/include/nolibc/arch-mips.h

View file
diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-mips.h
index a72506c..bb9d580 100644
--- a/tools/include/nolibc/arch-mips.h
+++ b/tools/include/nolibc/arch-mips.h
@@ -39,11 +39,19 @@
* - stack is 16-byte aligned
*/
+#if !defined(__mips_isa_rev) || __mips_isa_rev < 6
+#define _NOLIBC_SYSCALL_CLOBBER_HI_LO "hi", "lo"
+#else
+#define _NOLIBC_SYSCALL_CLOBBER_HI_LO "$0"
+#endif
+
#if defined(_ABIO32)
#define _NOLIBC_SYSCALL_CLOBBERLIST \
- "memory", "cc", "at", "v1", "hi", "lo", \
- "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"
+ "memory", "cc", "at", "v1", \
+ "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", \
+ _NOLIBC_SYSCALL_CLOBBER_HI_LO
+
#define _NOLIBC_SYSCALL_STACK_RESERVE "addiu $sp, $sp, -32\n"
#define _NOLIBC_SYSCALL_STACK_UNRESERVE "addiu $sp, $sp, 32\n"
@@ -52,14 +60,15 @@
/* binutils, GCC and clang disagree about register aliases, use numbers instead. */
#define _NOLIBC_SYSCALL_CLOBBERLIST \
"memory", "cc", "at", "v1", \
- "10", "11", "12", "13", "14", "15", "24", "25"
+ "10", "11", "12", "13", "14", "15", "24", "25", \
+ _NOLIBC_SYSCALL_CLOBBER_HI_LO
#define _NOLIBC_SYSCALL_STACK_RESERVE
#define _NOLIBC_SYSCALL_STACK_UNRESERVE
#endif /* _ABIO32 */
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg4 __asm__ ("a3"); \
@@ -75,7 +84,7 @@
_arg4 ? -_num : _num; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -93,7 +102,7 @@
_arg4 ? -_num : _num; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -112,7 +121,7 @@
_arg4 ? -_num : _num; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -132,7 +141,7 @@
_arg4 ? -_num : _num; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -154,7 +163,7 @@
#if defined(_ABIO32)
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -176,7 +185,7 @@
_arg4 ? -_num : _num; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -203,7 +212,7 @@
#else /* _ABIN32 || _ABI64 */
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("$4") = (long)(arg1); \
@@ -222,7 +231,7 @@
_arg4 ? -_num : _num; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("$4") = (long)(arg1); \

tools/include/nolibc/arch-powerpc.h

View file
diff --git a/tools/include/nolibc/arch-powerpc.h b/tools/include/nolibc/arch-powerpc.h
index e0c7e0b..ef87886 100644
--- a/tools/include/nolibc/arch-powerpc.h
+++ b/tools/include/nolibc/arch-powerpc.h
@@ -25,7 +25,7 @@
#define _NOLIBC_SYSCALL_CLOBBERLIST \
"memory", "cr0", "r12", "r11", "r10", "r9"
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
@@ -42,7 +42,7 @@
_ret; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
@@ -61,7 +61,7 @@
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
@@ -81,7 +81,7 @@
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
@@ -102,7 +102,7 @@
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
@@ -125,7 +125,7 @@
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
@@ -148,7 +148,7 @@
_ret; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \

tools/include/nolibc/arch-riscv.h

View file
diff --git a/tools/include/nolibc/arch-riscv.h b/tools/include/nolibc/arch-riscv.h
index 1c00cac..386ebb9 100644
--- a/tools/include/nolibc/arch-riscv.h
+++ b/tools/include/nolibc/arch-riscv.h
@@ -21,7 +21,7 @@
* so that we don't have to experience issues with register constraints.
*/
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0"); \
@@ -35,7 +35,7 @@
_arg1; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -49,7 +49,7 @@
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -65,7 +65,7 @@
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -82,7 +82,7 @@
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -100,7 +100,7 @@
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
@@ -119,7 +119,7 @@
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \

tools/include/nolibc/arch-s390.h

View file
diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s390.h
index 904281e..4e69123 100644
--- a/tools/include/nolibc/arch-s390.h
+++ b/tools/include/nolibc/arch-s390.h
@@ -28,7 +28,7 @@
*
*/
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("1") = (num); \
register long _rc __asm__ ("2"); \
@@ -42,7 +42,7 @@
_rc; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("1") = (num); \
register long _arg1 __asm__ ("2") = (long)(arg1); \
@@ -56,7 +56,7 @@
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("1") = (num); \
register long _arg1 __asm__ ("2") = (long)(arg1); \
@@ -71,7 +71,7 @@
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("1") = (num); \
register long _arg1 __asm__ ("2") = (long)(arg1); \

This diff is incomplete. Download the complete patch.

tools/include/nolibc/arch-sh.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/arch-sparc.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/arch-x86.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/byteswap.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/compiler.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/crt.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/dirent.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/endian.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/err.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/errno.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/fcntl.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/nolibc.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/poll.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sched.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/signal.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/stackprotector.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/std.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/stddef.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/stdio.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/stdlib.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/ioctl.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/mman.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/mount.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/prctl.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/ptrace.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/random.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/reboot.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/resource.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/select.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/stat.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/syscall.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/sysmacros.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/time.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/timerfd.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/uio.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/utsname.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/sys/wait.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/time.h

View file

This diff is incomplete. Download the complete patch.

tools/include/nolibc/unistd.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/nolibc/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/nolibc/Makefile.include

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/nolibc/Makefile.nolibc

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/nolibc/nolibc-test-ignore-errno.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/nolibc/nolibc-test.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/nolibc/run-tests.sh

View file

This diff is incomplete. Download the complete patch.