diff mbox series

[v5,06/14] tools/nolibc: arch-*.h: clean up multiple whitespaces

Message ID eb4c7a381cf856c9d8e7d679b28507a258cab26a.1687957589.git.falcon@tinylab.org (mailing list archive)
State New
Headers show
Series tools/nolibc: add a new syscall helper | expand

Commit Message

Zhangjin Wu June 28, 2023, 1:19 p.m. UTC
To align with Linux code style and let scripts/checkpatch.pl happy, the
multiple whitespaces in arch-<ARCH>.h files are cleaned up.

Most of them are modified by these commands automatically:

    $ sed -i -e '/#define my_syscall/,/})/{s/        /\t/g}' tools/include/nolibc/arch-*.h
    $ sed -i -e '/#define my_syscall/,/})/{s/ *\\$/\t\\/g}' tools/include/nolibc/arch-*.h

And checked with:

    $ grep '  *\\$' tools/include/nolibc/arch-*.h

Besides, more multiple whitespaces are cleaned up:

- convert "__asm__  volatile" to "__asm__ volatile"
- "foo _num  bar" should be "foo _num bar"

Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
 tools/include/nolibc/arch-aarch64.h   | 210 +++++++++++-----------
 tools/include/nolibc/arch-arm.h       | 240 +++++++++++++-------------
 tools/include/nolibc/arch-i386.h      | 226 ++++++++++++------------
 tools/include/nolibc/arch-loongarch.h | 222 ++++++++++++------------
 tools/include/nolibc/arch-mips.h      | 218 +++++++++++------------
 tools/include/nolibc/arch-riscv.h     | 208 +++++++++++-----------
 tools/include/nolibc/arch-s390.h      | 202 +++++++++++-----------
 tools/include/nolibc/arch-x86_64.h    | 222 ++++++++++++------------
 8 files changed, 874 insertions(+), 874 deletions(-)

Comments

Willy Tarreau July 2, 2023, 6:44 p.m. UTC | #1
Hi Zhangjin,

On Wed, Jun 28, 2023 at 09:19:33PM +0800, Zhangjin Wu wrote:
> To align with Linux code style and let scripts/checkpatch.pl happy, the
> multiple whitespaces in arch-<ARCH>.h files are cleaned up.
> 
> Most of them are modified by these commands automatically:
> 
>     $ sed -i -e '/#define my_syscall/,/})/{s/        /\t/g}' tools/include/nolibc/arch-*.h
>     $ sed -i -e '/#define my_syscall/,/})/{s/ *\\$/\t\\/g}' tools/include/nolibc/arch-*.h
> 
> And checked with:
> 
>     $ grep '  *\\$' tools/include/nolibc/arch-*.h

I'm surprised by this one, I never saw checkpatch complain here. For me,
putting a tab after a non-tab is an error. It makes the code harder to
edit and re-align, and diffs are harder to read on lines whose lengths
varies by +/-1 around a multiple of 8 as it makes the post-tab stuff
zigzag. You made me recheck the coding style file, and there's nothing
about alignment there, only about indent (and indent uses tabs here).
There are also other parts which use spaces for alignment (albeit not
that many), so unless there is a solid reason for changing that, I'd
rather not do it, as for me it's the exact opposite of a cleanup as it
will cause me quite some discomfort.

> Besides, more multiple whitespaces are cleaned up:
> 
> - convert "__asm__  volatile" to "__asm__ volatile"

I totally agree on this one, it's very likely the result of a mechanical
change.

> - "foo _num  bar" should be "foo _num bar"

In theory yes, except that for those where it appears it was only to
keep all declarations aligned given that this _num was shorter by one
char than all other local names. Especially when it comes to enumerating
register names, you definitely want to keep them aligned. It's sufficiently
difficult to avoid mistakes there, any help for visual check counts.

Willy
Zhangjin Wu July 3, 2023, 2:02 p.m. UTC | #2
Hi, Willy

> Hi Zhangjin,
> 
> On Wed, Jun 28, 2023 at 09:19:33PM +0800, Zhangjin Wu wrote:
> > To align with Linux code style and let scripts/checkpatch.pl happy, the
> > multiple whitespaces in arch-<ARCH>.h files are cleaned up.
> > 
> > Most of them are modified by these commands automatically:
> > 
> >     $ sed -i -e '/#define my_syscall/,/})/{s/        /\t/g}' tools/include/nolibc/arch-*.h
> >     $ sed -i -e '/#define my_syscall/,/})/{s/ *\\$/\t\\/g}' tools/include/nolibc/arch-*.h
> > 
> > And checked with:
> > 
> >     $ grep '  *\\$' tools/include/nolibc/arch-*.h
> 
> I'm surprised by this one, I never saw checkpatch complain here. For me,
> putting a tab after a non-tab is an error. It makes the code harder to
> edit and re-align, and diffs are harder to read on lines whose lengths
> varies by +/-1 around a multiple of 8 as it makes the post-tab stuff
> zigzag. You made me recheck the coding style file, and there's nothing
> about alignment there, only about indent (and indent uses tabs here).
> There are also other parts which use spaces for alignment (albeit not
> that many), so unless there is a solid reason for changing that, I'd
> rather not do it, as for me it's the exact opposite of a cleanup as it
> will cause me quite some discomfort.
>

Willy, it is not about alignment, just rechecked it, it is code indent
related:

    #32: FILE: tools/include/nolibc/arch-mips.h:160:
    +^I                                                                      \$
    
    ERROR: code indent should use tabs where possible
    #44: FILE: tools/include/nolibc/arch-mips.h:172:
    +^I          "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"  \$

The first one is here:

	register long _arg6 = (long)(arg6);                                   \
	<--     whitespaces                                                -->\
	__asm__  volatile (                                                   \

And the second one:

		: "memory", "cc", "at", "v1", "hi", "lo",                     \
	<-spaces->"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"  \

These two lines indent with "one tab + more than 8 whitespaces", the
other lines also have whitespaces code indent, but not more than 8, so,
not reported.

I have tried to replace whitespaces with tabs in the first one, but the first
one can not align with the other lines, so, the current modify method is
applied.

To only touch minimal lines, this may work (reserve the post-whitespaces):

    $ sed -i -e '/^\t*        /{s/        /\t/g}' tools/include/nolibc/arch-*.h

It will only fix up the lines the reported. The cleanup of the post-whitespaces
is not necessary and it does touch too many lines.

Sorry to disturb you with such cleanups, since I have seen the similar
reports when we added the arch-arm.h (for my_syscall6), because the code
style aligns with the others, so, I did touch it, but again encounter
the same issues with arch-mips.h and to avoid the future reports, I
checked the whole arch-xxx.h, and found more such reports, so, we
prepared such a patch.

To be honest, I do prefer post-tabs to whitespaces (less key press, less code
size ;-)), but as you pointed out, post-tabs have more side-effects, we
shouldn't touch them, Thanks.

> > Besides, more multiple whitespaces are cleaned up:
> > 
> > - convert "__asm__  volatile" to "__asm__ volatile"
> 
> I totally agree on this one, it's very likely the result of a mechanical
> change.

Ok, will split it to a standalone patch, one error report one patch.

> 
> > - "foo _num  bar" should be "foo _num bar"
> 
> In theory yes, except that for those where it appears it was only to
> keep all declarations aligned given that this _num was shorter by one
> char than all other local names. Especially when it comes to enumerating
> register names, you definitely want to keep them aligned. It's sufficiently
> difficult to avoid mistakes there, any help for visual check counts.
>

Agree, let's keep it as before.

Thanks,
Zhangjin

> Willy
diff mbox series

Patch

diff --git a/tools/include/nolibc/arch-aarch64.h b/tools/include/nolibc/arch-aarch64.h
index 11f294a406b7..e30056f996db 100644
--- a/tools/include/nolibc/arch-aarch64.h
+++ b/tools/include/nolibc/arch-aarch64.h
@@ -52,123 +52,123 @@  struct sys_stat_struct {
  */
 #define __ARCH_WANT_SYS_PSELECT6
 
-#define my_syscall0(num)                                                      \
-({                                                                            \
-	register long _num  __asm__ ("x8") = (num);                           \
-	register long _arg1 __asm__ ("x0");                                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"svc #0\n"                                                    \
-		: "=r"(_arg1)                                                 \
-		: "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall0(num)							\
+({										\
+	register long _num __asm__ ("x8") = (num);				\
+	register long _arg1 __asm__ ("x0");					\
+										\
+	__asm__ volatile (							\
+		"svc #0\n"							\
+		: "=r"(_arg1)							\
+		: "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall1(num, arg1)                                                \
-({                                                                            \
-	register long _num  __asm__ ("x8") = (num);                           \
-	register long _arg1 __asm__ ("x0") = (long)(arg1);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"svc #0\n"                                                    \
-		: "=r"(_arg1)                                                 \
-		: "r"(_arg1),                                                 \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall1(num, arg1)							\
+({										\
+	register long _num __asm__ ("x8")  = (num);				\
+	register long _arg1 __asm__ ("x0") = (long)(arg1);			\
+										\
+	__asm__ volatile (							\
+		"svc #0\n"							\
+		: "=r"(_arg1)							\
+		: "r"(_arg1),							\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall2(num, arg1, arg2)                                          \
-({                                                                            \
-	register long _num  __asm__ ("x8") = (num);                           \
-	register long _arg1 __asm__ ("x0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("x1") = (long)(arg2);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"svc #0\n"                                                    \
-		: "=r"(_arg1)                                                 \
-		: "r"(_arg1), "r"(_arg2),                                     \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall2(num, arg1, arg2)						\
+({										\
+	register long _num __asm__ ("x8")  = (num);				\
+	register long _arg1 __asm__ ("x0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("x1") = (long)(arg2);			\
+										\
+	__asm__ volatile (							\
+		"svc #0\n"							\
+		: "=r"(_arg1)							\
+		: "r"(_arg1), "r"(_arg2),					\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall3(num, arg1, arg2, arg3)                                    \
-({                                                                            \
-	register long _num  __asm__ ("x8") = (num);                           \
-	register long _arg1 __asm__ ("x0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("x1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("x2") = (long)(arg3);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"svc #0\n"                                                    \
-		: "=r"(_arg1)                                                 \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3),                         \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall3(num, arg1, arg2, arg3)					\
+({										\
+	register long _num __asm__ ("x8")  = (num);				\
+	register long _arg1 __asm__ ("x0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("x1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("x2") = (long)(arg3);			\
+										\
+	__asm__ volatile (							\
+		"svc #0\n"							\
+		: "=r"(_arg1)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3),				\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall4(num, arg1, arg2, arg3, arg4)                              \
-({                                                                            \
-	register long _num  __asm__ ("x8") = (num);                           \
-	register long _arg1 __asm__ ("x0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("x1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("x2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("x3") = (long)(arg4);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"svc #0\n"                                                    \
-		: "=r"(_arg1)                                                 \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4),             \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall4(num, arg1, arg2, arg3, arg4)				\
+({										\
+	register long _num __asm__ ("x8")  = (num);				\
+	register long _arg1 __asm__ ("x0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("x1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("x2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("x3") = (long)(arg4);			\
+										\
+	__asm__ volatile (							\
+		"svc #0\n"							\
+		: "=r"(_arg1)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4),		\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)                        \
-({                                                                            \
-	register long _num  __asm__ ("x8") = (num);                           \
-	register long _arg1 __asm__ ("x0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("x1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("x2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("x3") = (long)(arg4);                    \
-	register long _arg5 __asm__ ("x4") = (long)(arg5);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"svc #0\n"                                                    \
-		: "=r" (_arg1)                                                \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)				\
+({										\
+	register long _num __asm__ ("x8")  = (num);				\
+	register long _arg1 __asm__ ("x0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("x1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("x2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("x3") = (long)(arg4);			\
+	register long _arg5 __asm__ ("x4") = (long)(arg5);			\
+										\
+	__asm__ volatile (							\
+		"svc #0\n"							\
+		: "=r" (_arg1)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),	\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)                  \
-({                                                                            \
-	register long _num  __asm__ ("x8") = (num);                           \
-	register long _arg1 __asm__ ("x0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("x1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("x2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("x3") = (long)(arg4);                    \
-	register long _arg5 __asm__ ("x4") = (long)(arg5);                    \
-	register long _arg6 __asm__ ("x5") = (long)(arg6);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"svc #0\n"                                                    \
-		: "=r" (_arg1)                                                \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), \
-		  "r"(_arg6), "r"(_num)                                       \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)			\
+({										\
+	register long _num __asm__ ("x8")  = (num);				\
+	register long _arg1 __asm__ ("x0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("x1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("x2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("x3") = (long)(arg4);			\
+	register long _arg5 __asm__ ("x4") = (long)(arg5);			\
+	register long _arg6 __asm__ ("x5") = (long)(arg6);			\
+										\
+	__asm__ volatile (							\
+		"svc #0\n"							\
+		: "=r" (_arg1)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),	\
+		  "r"(_arg6), "r"(_num)						\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
 char **environ __attribute__((weak));
diff --git a/tools/include/nolibc/arch-arm.h b/tools/include/nolibc/arch-arm.h
index ca4c66987497..7a64290fc518 100644
--- a/tools/include/nolibc/arch-arm.h
+++ b/tools/include/nolibc/arch-arm.h
@@ -86,138 +86,138 @@  struct sys_stat_struct {
 
 #endif /* end THUMB */
 
-#define my_syscall0(num)                                                      \
-({                                                                            \
-	register long _num  __asm__(_NOLIBC_SYSCALL_REG) = (num);             \
-	register long _arg1 __asm__ ("r0");                                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		_NOLIBC_THUMB_SET_R7                                          \
-		"svc #0\n"                                                    \
-		_NOLIBC_THUMB_RESTORE_R7                                      \
-		: "=r"(_arg1), "=r"(_num)                                     \
-		: "r"(_arg1),                                                 \
-		  "r"(_num)                                                   \
-		: "memory", "cc", "lr"                                        \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall0(num)							\
+({										\
+	register long _num __asm__ (_NOLIBC_SYSCALL_REG) = (num);		\
+	register long _arg1 __asm__ ("r0");					\
+										\
+	__asm__ volatile (							\
+		_NOLIBC_THUMB_SET_R7						\
+		"svc #0\n"							\
+		_NOLIBC_THUMB_RESTORE_R7					\
+		: "=r"(_arg1), "=r"(_num)					\
+		: "r"(_arg1),							\
+		  "r"(_num)							\
+		: "memory", "cc", "lr"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall1(num, arg1)                                                \
-({                                                                            \
-	register long _num  __asm__(_NOLIBC_SYSCALL_REG) = (num);             \
-	register long _arg1 __asm__ ("r0") = (long)(arg1);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		_NOLIBC_THUMB_SET_R7                                          \
-		"svc #0\n"                                                    \
-		_NOLIBC_THUMB_RESTORE_R7                                      \
-		: "=r"(_arg1), "=r" (_num)                                    \
-		: "r"(_arg1),                                                 \
-		  "r"(_num)                                                   \
-		: "memory", "cc", "lr"                                        \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall1(num, arg1)							\
+({										\
+	register long _num __asm__ (_NOLIBC_SYSCALL_REG) = (num);		\
+	register long _arg1 __asm__ ("r0") = (long)(arg1);			\
+										\
+	__asm__ volatile (							\
+		_NOLIBC_THUMB_SET_R7						\
+		"svc #0\n"							\
+		_NOLIBC_THUMB_RESTORE_R7					\
+		: "=r"(_arg1), "=r" (_num)					\
+		: "r"(_arg1),							\
+		  "r"(_num)							\
+		: "memory", "cc", "lr"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall2(num, arg1, arg2)                                          \
-({                                                                            \
-	register long _num  __asm__(_NOLIBC_SYSCALL_REG) = (num);             \
-	register long _arg1 __asm__ ("r0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("r1") = (long)(arg2);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		_NOLIBC_THUMB_SET_R7                                          \
-		"svc #0\n"                                                    \
-		_NOLIBC_THUMB_RESTORE_R7                                      \
-		: "=r"(_arg1), "=r" (_num)                                    \
-		: "r"(_arg1), "r"(_arg2),                                     \
-		  "r"(_num)                                                   \
-		: "memory", "cc", "lr"                                        \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall2(num, arg1, arg2)						\
+({										\
+	register long _num __asm__ (_NOLIBC_SYSCALL_REG) = (num);		\
+	register long _arg1 __asm__ ("r0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("r1") = (long)(arg2);			\
+										\
+	__asm__ volatile (							\
+		_NOLIBC_THUMB_SET_R7						\
+		"svc #0\n"							\
+		_NOLIBC_THUMB_RESTORE_R7					\
+		: "=r"(_arg1), "=r" (_num)					\
+		: "r"(_arg1), "r"(_arg2),					\
+		  "r"(_num)							\
+		: "memory", "cc", "lr"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall3(num, arg1, arg2, arg3)                                    \
-({                                                                            \
-	register long _num  __asm__(_NOLIBC_SYSCALL_REG) = (num);             \
-	register long _arg1 __asm__ ("r0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("r1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("r2") = (long)(arg3);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		_NOLIBC_THUMB_SET_R7                                          \
-		"svc #0\n"                                                    \
-		_NOLIBC_THUMB_RESTORE_R7                                      \
-		: "=r"(_arg1), "=r" (_num)                                    \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3),                         \
-		  "r"(_num)                                                   \
-		: "memory", "cc", "lr"                                        \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall3(num, arg1, arg2, arg3)					\
+({										\
+	register long _num __asm__ (_NOLIBC_SYSCALL_REG) = (num);		\
+	register long _arg1 __asm__ ("r0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("r1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("r2") = (long)(arg3);			\
+										\
+	__asm__ volatile (							\
+		_NOLIBC_THUMB_SET_R7						\
+		"svc #0\n"							\
+		_NOLIBC_THUMB_RESTORE_R7					\
+		: "=r"(_arg1), "=r" (_num)					\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3),				\
+		  "r"(_num)							\
+		: "memory", "cc", "lr"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall4(num, arg1, arg2, arg3, arg4)                              \
-({                                                                            \
-	register long _num  __asm__(_NOLIBC_SYSCALL_REG) = (num);             \
-	register long _arg1 __asm__ ("r0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("r1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("r2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("r3") = (long)(arg4);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		_NOLIBC_THUMB_SET_R7                                          \
-		"svc #0\n"                                                    \
-		_NOLIBC_THUMB_RESTORE_R7                                      \
-		: "=r"(_arg1), "=r" (_num)                                    \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4),             \
-		  "r"(_num)                                                   \
-		: "memory", "cc", "lr"                                        \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall4(num, arg1, arg2, arg3, arg4)				\
+({										\
+	register long _num __asm__ (_NOLIBC_SYSCALL_REG) = (num);		\
+	register long _arg1 __asm__ ("r0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("r1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("r2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("r3") = (long)(arg4);			\
+										\
+	__asm__ volatile (							\
+		_NOLIBC_THUMB_SET_R7						\
+		"svc #0\n"							\
+		_NOLIBC_THUMB_RESTORE_R7					\
+		: "=r"(_arg1), "=r" (_num)					\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4),		\
+		  "r"(_num)							\
+		: "memory", "cc", "lr"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)                        \
-({                                                                            \
-	register long _num  __asm__(_NOLIBC_SYSCALL_REG) = (num);             \
-	register long _arg1 __asm__ ("r0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("r1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("r2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("r3") = (long)(arg4);                    \
-	register long _arg5 __asm__ ("r4") = (long)(arg5);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		_NOLIBC_THUMB_SET_R7                                          \
-		"svc #0\n"                                                    \
-		_NOLIBC_THUMB_RESTORE_R7                                      \
-		: "=r"(_arg1), "=r" (_num)                                    \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), \
-		  "r"(_num)                                                   \
-		: "memory", "cc", "lr"                                        \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)				\
+({										\
+	register long _num __asm__ (_NOLIBC_SYSCALL_REG) = (num);		\
+	register long _arg1 __asm__ ("r0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("r1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("r2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("r3") = (long)(arg4);			\
+	register long _arg5 __asm__ ("r4") = (long)(arg5);			\
+										\
+	__asm__ volatile (							\
+		_NOLIBC_THUMB_SET_R7						\
+		"svc #0\n"							\
+		_NOLIBC_THUMB_RESTORE_R7					\
+		: "=r"(_arg1), "=r" (_num)					\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),	\
+		  "r"(_num)							\
+		: "memory", "cc", "lr"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)                  \
-({                                                                            \
-	register long _num  __asm__(_NOLIBC_SYSCALL_REG) = (num);             \
-	register long _arg1 __asm__ ("r0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("r1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("r2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("r3") = (long)(arg4);                    \
-	register long _arg5 __asm__ ("r4") = (long)(arg5);                    \
-	register long _arg6 __asm__ ("r5") = (long)(arg6);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		_NOLIBC_THUMB_SET_R7                                          \
-		"svc #0\n"                                                    \
-		_NOLIBC_THUMB_RESTORE_R7                                      \
-		: "=r"(_arg1), "=r" (_num)                                    \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), \
-		  "r"(_arg6), "r"(_num)                                       \
-		: "memory", "cc", "lr"                                        \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)			\
+({										\
+	register long _num __asm__ (_NOLIBC_SYSCALL_REG) = (num);		\
+	register long _arg1 __asm__ ("r0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("r1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("r2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("r3") = (long)(arg4);			\
+	register long _arg5 __asm__ ("r4") = (long)(arg5);			\
+	register long _arg6 __asm__ ("r5") = (long)(arg6);			\
+										\
+	__asm__ volatile (							\
+		_NOLIBC_THUMB_SET_R7						\
+		"svc #0\n"							\
+		_NOLIBC_THUMB_RESTORE_R7					\
+		: "=r"(_arg1), "=r" (_num)					\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),	\
+		  "r"(_arg6), "r"(_num)						\
+		: "memory", "cc", "lr"						\
+	);									\
+	_arg1;									\
 })
 
 
diff --git a/tools/include/nolibc/arch-i386.h b/tools/include/nolibc/arch-i386.h
index 3d672d925e9e..c2e75ba91b6b 100644
--- a/tools/include/nolibc/arch-i386.h
+++ b/tools/include/nolibc/arch-i386.h
@@ -53,131 +53,131 @@  struct sys_stat_struct {
  */
 #define __ARCH_WANT_SYS_OLD_SELECT
 
-#define my_syscall0(num)                                                      \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num __asm__ ("eax") = (num);                           \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"int $0x80\n"                                                 \
-		: "=a" (_ret)                                                 \
-		: "0"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall0(num)							\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("eax") = (num);				\
+										\
+	__asm__ volatile (							\
+		"int $0x80\n"							\
+		: "=a" (_ret)							\
+		: "0"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall1(num, arg1)                                                \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num __asm__ ("eax") = (num);                           \
-	register long _arg1 __asm__ ("ebx") = (long)(arg1);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"int $0x80\n"                                                 \
-		: "=a" (_ret)                                                 \
-		: "r"(_arg1),                                                 \
-		  "0"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall1(num, arg1)							\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("eax")  = (num);				\
+	register long _arg1 __asm__ ("ebx") = (long)(arg1);			\
+										\
+	__asm__ volatile (							\
+		"int $0x80\n"							\
+		: "=a" (_ret)							\
+		: "r"(_arg1),							\
+		  "0"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall2(num, arg1, arg2)                                          \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num __asm__ ("eax") = (num);                           \
-	register long _arg1 __asm__ ("ebx") = (long)(arg1);                   \
-	register long _arg2 __asm__ ("ecx") = (long)(arg2);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"int $0x80\n"                                                 \
-		: "=a" (_ret)                                                 \
-		: "r"(_arg1), "r"(_arg2),                                     \
-		  "0"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall2(num, arg1, arg2)						\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("eax")  = (num);				\
+	register long _arg1 __asm__ ("ebx") = (long)(arg1);			\
+	register long _arg2 __asm__ ("ecx") = (long)(arg2);			\
+										\
+	__asm__ volatile (							\
+		"int $0x80\n"							\
+		: "=a" (_ret)							\
+		: "r"(_arg1), "r"(_arg2),					\
+		  "0"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall3(num, arg1, arg2, arg3)                                    \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num __asm__ ("eax") = (num);                           \
-	register long _arg1 __asm__ ("ebx") = (long)(arg1);                   \
-	register long _arg2 __asm__ ("ecx") = (long)(arg2);                   \
-	register long _arg3 __asm__ ("edx") = (long)(arg3);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"int $0x80\n"                                                 \
-		: "=a" (_ret)                                                 \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3),                         \
-		  "0"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall3(num, arg1, arg2, arg3)					\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("eax")  = (num);				\
+	register long _arg1 __asm__ ("ebx") = (long)(arg1);			\
+	register long _arg2 __asm__ ("ecx") = (long)(arg2);			\
+	register long _arg3 __asm__ ("edx") = (long)(arg3);			\
+										\
+	__asm__ volatile (							\
+		"int $0x80\n"							\
+		: "=a" (_ret)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3),				\
+		  "0"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall4(num, arg1, arg2, arg3, arg4)                              \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num __asm__ ("eax") = (num);                           \
-	register long _arg1 __asm__ ("ebx") = (long)(arg1);                   \
-	register long _arg2 __asm__ ("ecx") = (long)(arg2);                   \
-	register long _arg3 __asm__ ("edx") = (long)(arg3);                   \
-	register long _arg4 __asm__ ("esi") = (long)(arg4);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"int $0x80\n"                                                 \
-		: "=a" (_ret)                                                 \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4),             \
-		  "0"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall4(num, arg1, arg2, arg3, arg4)				\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("eax")  = (num);				\
+	register long _arg1 __asm__ ("ebx") = (long)(arg1);			\
+	register long _arg2 __asm__ ("ecx") = (long)(arg2);			\
+	register long _arg3 __asm__ ("edx") = (long)(arg3);			\
+	register long _arg4 __asm__ ("esi") = (long)(arg4);			\
+										\
+	__asm__ volatile (							\
+		"int $0x80\n"							\
+		: "=a" (_ret)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4),		\
+		  "0"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)                        \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num __asm__ ("eax") = (num);                           \
-	register long _arg1 __asm__ ("ebx") = (long)(arg1);                   \
-	register long _arg2 __asm__ ("ecx") = (long)(arg2);                   \
-	register long _arg3 __asm__ ("edx") = (long)(arg3);                   \
-	register long _arg4 __asm__ ("esi") = (long)(arg4);                   \
-	register long _arg5 __asm__ ("edi") = (long)(arg5);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"int $0x80\n"                                                 \
-		: "=a" (_ret)                                                 \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), \
-		  "0"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)				\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("eax")  = (num);				\
+	register long _arg1 __asm__ ("ebx") = (long)(arg1);			\
+	register long _arg2 __asm__ ("ecx") = (long)(arg2);			\
+	register long _arg3 __asm__ ("edx") = (long)(arg3);			\
+	register long _arg4 __asm__ ("esi") = (long)(arg4);			\
+	register long _arg5 __asm__ ("edi") = (long)(arg5);			\
+										\
+	__asm__ volatile (							\
+		"int $0x80\n"							\
+		: "=a" (_ret)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),	\
+		  "0"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)	\
-({								\
-	long _eax  = (long)(num);				\
-	long _arg6 = (long)(arg6); /* Always in memory */	\
-	__asm__ volatile (					\
-		"pushl	%[_arg6]\n\t"				\
-		"pushl	%%ebp\n\t"				\
-		"movl	4(%%esp),%%ebp\n\t"			\
-		"int	$0x80\n\t"				\
-		"popl	%%ebp\n\t"				\
-		"addl	$4,%%esp\n\t"				\
-		: "+a"(_eax)		/* %eax */		\
-		: "b"(arg1),		/* %ebx */		\
-		  "c"(arg2),		/* %ecx */		\
-		  "d"(arg3),		/* %edx */		\
-		  "S"(arg4),		/* %esi */		\
-		  "D"(arg5),		/* %edi */		\
-		  [_arg6]"m"(_arg6)	/* memory */		\
-		: "memory", "cc"				\
-	);							\
-	_eax;							\
+#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)		\
+({									\
+	long _eax  = (long)(num);					\
+	long _arg6 = (long)(arg6); /* Always in memory */		\
+	__asm__ volatile (						\
+		"pushl	%[_arg6]\n\t"					\
+		"pushl	%%ebp\n\t"					\
+		"movl	4(%%esp),%%ebp\n\t"				\
+		"int	$0x80\n\t"					\
+		"popl	%%ebp\n\t"					\
+		"addl	$4,%%esp\n\t"					\
+		: "+a"(_eax)		/* %eax */			\
+		: "b"(arg1),		/* %ebx */			\
+		  "c"(arg2),		/* %ecx */			\
+		  "d"(arg3),		/* %edx */			\
+		  "S"(arg4),		/* %esi */			\
+		  "D"(arg5),		/* %edi */			\
+		  [_arg6]"m"(_arg6)	/* memory */			\
+		: "memory", "cc"					\
+	);								\
+	_eax;								\
 })
 
 char **environ __attribute__((weak));
diff --git a/tools/include/nolibc/arch-loongarch.h b/tools/include/nolibc/arch-loongarch.h
index ad3f266e7093..292d6a58dc87 100644
--- a/tools/include/nolibc/arch-loongarch.h
+++ b/tools/include/nolibc/arch-loongarch.h
@@ -23,129 +23,129 @@ 
  */
 #define __ARCH_WANT_SYS_PSELECT6
 
-#define my_syscall0(num)                                                      \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0");                                   \
-									      \
-	__asm__  volatile (                                                   \
-		"syscall 0\n"                                                 \
-		: "=r"(_arg1)                                                 \
-		: "r"(_num)                                                   \
-		: "memory", "$t0", "$t1", "$t2", "$t3",                       \
-		  "$t4", "$t5", "$t6", "$t7", "$t8"                           \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall0(num)							\
+({										\
+	register long _num __asm__ ("a7") = (num);				\
+	register long _arg1 __asm__ ("a0");					\
+										\
+	__asm__ volatile (							\
+		"syscall 0\n"							\
+		: "=r"(_arg1)							\
+		: "r"(_num)							\
+		: "memory", "$t0", "$t1", "$t2", "$t3",				\
+		  "$t4", "$t5", "$t6", "$t7", "$t8"				\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall1(num, arg1)                                                \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);		      \
-									      \
-	__asm__  volatile (                                                   \
-		"syscall 0\n"                                                 \
-		: "+r"(_arg1)                                                 \
-		: "r"(_num)                                                   \
-		: "memory", "$t0", "$t1", "$t2", "$t3",                       \
-		  "$t4", "$t5", "$t6", "$t7", "$t8"                           \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall1(num, arg1)							\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+										\
+	__asm__ volatile (							\
+		"syscall 0\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_num)							\
+		: "memory", "$t0", "$t1", "$t2", "$t3",				\
+		  "$t4", "$t5", "$t6", "$t7", "$t8"				\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall2(num, arg1, arg2)                                          \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"syscall 0\n"                                                 \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2),                                                 \
-		  "r"(_num)                                                   \
-		: "memory", "$t0", "$t1", "$t2", "$t3",                       \
-		  "$t4", "$t5", "$t6", "$t7", "$t8"                           \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall2(num, arg1, arg2)						\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+										\
+	__asm__ volatile (							\
+		"syscall 0\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2),							\
+		  "r"(_num)							\
+		: "memory", "$t0", "$t1", "$t2", "$t3",				\
+		  "$t4", "$t5", "$t6", "$t7", "$t8"				\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall3(num, arg1, arg2, arg3)                                    \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"syscall 0\n"                                                 \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2), "r"(_arg3),                                     \
-		  "r"(_num)                                                   \
-		: "memory", "$t0", "$t1", "$t2", "$t3",                       \
-		  "$t4", "$t5", "$t6", "$t7", "$t8"                           \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall3(num, arg1, arg2, arg3)					\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+										\
+	__asm__ volatile (							\
+		"syscall 0\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2), "r"(_arg3),					\
+		  "r"(_num)							\
+		: "memory", "$t0", "$t1", "$t2", "$t3",				\
+		  "$t4", "$t5", "$t6", "$t7", "$t8"				\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall4(num, arg1, arg2, arg3, arg4)                              \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("a3") = (long)(arg4);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"syscall 0\n"                                                 \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2), "r"(_arg3), "r"(_arg4),                         \
-		  "r"(_num)                                                   \
-		: "memory", "$t0", "$t1", "$t2", "$t3",                       \
-		  "$t4", "$t5", "$t6", "$t7", "$t8"                           \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall4(num, arg1, arg2, arg3, arg4)				\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("a3") = (long)(arg4);			\
+										\
+	__asm__ volatile (							\
+		"syscall 0\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2), "r"(_arg3), "r"(_arg4),				\
+		  "r"(_num)							\
+		: "memory", "$t0", "$t1", "$t2", "$t3",				\
+		  "$t4", "$t5", "$t6", "$t7", "$t8"				\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)                        \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("a3") = (long)(arg4);                    \
-	register long _arg5 __asm__ ("a4") = (long)(arg5);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"syscall 0\n"                                                 \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),             \
-		  "r"(_num)                                                   \
-		: "memory", "$t0", "$t1", "$t2", "$t3",                       \
-		  "$t4", "$t5", "$t6", "$t7", "$t8"                           \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)				\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("a3") = (long)(arg4);			\
+	register long _arg5 __asm__ ("a4") = (long)(arg5);			\
+										\
+	__asm__ volatile (							\
+		"syscall 0\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),		\
+		  "r"(_num)							\
+		: "memory", "$t0", "$t1", "$t2", "$t3",				\
+		  "$t4", "$t5", "$t6", "$t7", "$t8"				\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)                  \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("a3") = (long)(arg4);                    \
-	register long _arg5 __asm__ ("a4") = (long)(arg5);                    \
-	register long _arg6 __asm__ ("a5") = (long)(arg6);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"syscall 0\n"                                                 \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), "r"(_arg6), \
-		  "r"(_num)                                                   \
-		: "memory", "$t0", "$t1", "$t2", "$t3",                       \
-		  "$t4", "$t5", "$t6", "$t7", "$t8"                           \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)			\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("a3") = (long)(arg4);			\
+	register long _arg5 __asm__ ("a4") = (long)(arg5);			\
+	register long _arg6 __asm__ ("a5") = (long)(arg6);			\
+										\
+	__asm__ volatile (							\
+		"syscall 0\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), "r"(_arg6),	\
+		  "r"(_num)							\
+		: "memory", "$t0", "$t1", "$t2", "$t3",				\
+		  "$t4", "$t5", "$t6", "$t7", "$t8"				\
+	);									\
+	_arg1;									\
 })
 
 char **environ __attribute__((weak));
diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-mips.h
index db24e0837a39..1fd1eedc12a6 100644
--- a/tools/include/nolibc/arch-mips.h
+++ b/tools/include/nolibc/arch-mips.h
@@ -57,125 +57,125 @@  struct sys_stat_struct {
  *     don't have to experience issues with register constraints.
  */
 
-#define my_syscall0(num)                                                      \
-({                                                                            \
-	register long _num __asm__ ("v0") = (num);                            \
-	register long _arg4 __asm__ ("a3");                                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"addiu $sp, $sp, -32\n"                                       \
-		"syscall\n"                                                   \
-		"addiu $sp, $sp, 32\n"                                        \
-		: "=r"(_num), "=r"(_arg4)                                     \
-		: "r"(_num)                                                   \
-		: "memory", "cc", "at", "v1", "hi", "lo",                     \
-	          "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"  \
-	);                                                                    \
-	_arg4 ? -_num : _num;                                                 \
+#define my_syscall0(num)							\
+({										\
+	register long _num __asm__ ("v0") = (num);				\
+	register long _arg4 __asm__ ("a3");					\
+										\
+	__asm__ volatile (							\
+		"addiu $sp, $sp, -32\n"						\
+		"syscall\n"							\
+		"addiu $sp, $sp, 32\n"						\
+		: "=r"(_num), "=r"(_arg4)					\
+		: "r"(_num)							\
+		: "memory", "cc", "at", "v1", "hi", "lo",			\
+		  "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"	\
+	);									\
+	_arg4 ? -_num : _num;							\
 })
 
-#define my_syscall1(num, arg1)                                                \
-({                                                                            \
-	register long _num __asm__ ("v0") = (num);                            \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg4 __asm__ ("a3");                                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"addiu $sp, $sp, -32\n"                                       \
-		"syscall\n"                                                   \
-		"addiu $sp, $sp, 32\n"                                        \
-		: "=r"(_num), "=r"(_arg4)                                     \
-		: "0"(_num),                                                  \
-		  "r"(_arg1)                                                  \
-		: "memory", "cc", "at", "v1", "hi", "lo",                     \
-	          "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"  \
-	);                                                                    \
-	_arg4 ? -_num : _num;                                                 \
+#define my_syscall1(num, arg1)							\
+({										\
+	register long _num __asm__ ("v0")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg4 __asm__ ("a3");					\
+										\
+	__asm__ volatile (							\
+		"addiu $sp, $sp, -32\n"						\
+		"syscall\n"							\
+		"addiu $sp, $sp, 32\n"						\
+		: "=r"(_num), "=r"(_arg4)					\
+		: "0"(_num),							\
+		  "r"(_arg1)							\
+		: "memory", "cc", "at", "v1", "hi", "lo",			\
+		  "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"	\
+	);									\
+	_arg4 ? -_num : _num;							\
 })
 
-#define my_syscall2(num, arg1, arg2)                                          \
-({                                                                            \
-	register long _num __asm__ ("v0") = (num);                            \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg4 __asm__ ("a3");                                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"addiu $sp, $sp, -32\n"                                       \
-		"syscall\n"                                                   \
-		"addiu $sp, $sp, 32\n"                                        \
-		: "=r"(_num), "=r"(_arg4)                                     \
-		: "0"(_num),                                                  \
-		  "r"(_arg1), "r"(_arg2)                                      \
-		: "memory", "cc", "at", "v1", "hi", "lo",                     \
-	          "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"  \
-	);                                                                    \
-	_arg4 ? -_num : _num;                                                 \
+#define my_syscall2(num, arg1, arg2)						\
+({										\
+	register long _num __asm__ ("v0")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg4 __asm__ ("a3");					\
+										\
+	__asm__ volatile (							\
+		"addiu $sp, $sp, -32\n"						\
+		"syscall\n"							\
+		"addiu $sp, $sp, 32\n"						\
+		: "=r"(_num), "=r"(_arg4)					\
+		: "0"(_num),							\
+		  "r"(_arg1), "r"(_arg2)					\
+		: "memory", "cc", "at", "v1", "hi", "lo",			\
+		  "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"	\
+	);									\
+	_arg4 ? -_num : _num;							\
 })
 
-#define my_syscall3(num, arg1, arg2, arg3)                                    \
-({                                                                            \
-	register long _num __asm__ ("v0")  = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("a3");                                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"addiu $sp, $sp, -32\n"                                       \
-		"syscall\n"                                                   \
-		"addiu $sp, $sp, 32\n"                                        \
-		: "=r"(_num), "=r"(_arg4)                                     \
-		: "0"(_num),                                                  \
-		  "r"(_arg1), "r"(_arg2), "r"(_arg3)                          \
-		: "memory", "cc", "at", "v1", "hi", "lo",                     \
-	          "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"  \
-	);                                                                    \
-	_arg4 ? -_num : _num;                                                 \
+#define my_syscall3(num, arg1, arg2, arg3)					\
+({										\
+	register long _num __asm__ ("v0")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("a3");					\
+										\
+	__asm__ volatile (							\
+		"addiu $sp, $sp, -32\n"						\
+		"syscall\n"							\
+		"addiu $sp, $sp, 32\n"						\
+		: "=r"(_num), "=r"(_arg4)					\
+		: "0"(_num),							\
+		  "r"(_arg1), "r"(_arg2), "r"(_arg3)				\
+		: "memory", "cc", "at", "v1", "hi", "lo",			\
+		  "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"	\
+	);									\
+	_arg4 ? -_num : _num;							\
 })
 
-#define my_syscall4(num, arg1, arg2, arg3, arg4)                              \
-({                                                                            \
-	register long _num __asm__ ("v0") = (num);                            \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("a3") = (long)(arg4);                    \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"addiu $sp, $sp, -32\n"                                       \
-		"syscall\n"                                                   \
-		"addiu $sp, $sp, 32\n"                                        \
-		: "=r" (_num), "=r"(_arg4)                                    \
-		: "0"(_num),                                                  \
-		  "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4)              \
-		: "memory", "cc", "at", "v1", "hi", "lo",                     \
-	          "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"  \
-	);                                                                    \
-	_arg4 ? -_num : _num;                                                 \
+#define my_syscall4(num, arg1, arg2, arg3, arg4)				\
+({										\
+	register long _num __asm__ ("v0")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("a3") = (long)(arg4);			\
+										\
+	__asm__ volatile (							\
+		"addiu $sp, $sp, -32\n"						\
+		"syscall\n"							\
+		"addiu $sp, $sp, 32\n"						\
+		: "=r" (_num), "=r"(_arg4)					\
+		: "0"(_num),							\
+		  "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4)		\
+		: "memory", "cc", "at", "v1", "hi", "lo",			\
+		  "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"	\
+	);									\
+	_arg4 ? -_num : _num;							\
 })
 
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)                        \
-({                                                                            \
-	register long _num __asm__ ("v0") = (num);                            \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("a3") = (long)(arg4);                    \
-	register long _arg5 = (long)(arg5);                                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"addiu $sp, $sp, -32\n"                                       \
-		"sw %7, 16($sp)\n"                                            \
-		"syscall\n  "                                                 \
-		"addiu $sp, $sp, 32\n"                                        \
-		: "=r" (_num), "=r"(_arg4)                                    \
-		: "0"(_num),                                                  \
-		  "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5)  \
-		: "memory", "cc", "at", "v1", "hi", "lo",                     \
-	          "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"  \
-	);                                                                    \
-	_arg4 ? -_num : _num;                                                 \
+#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)				\
+({										\
+	register long _num __asm__ ("v0")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("a3") = (long)(arg4);			\
+	register long _arg5 = (long)(arg5);					\
+										\
+	__asm__ volatile (							\
+		"addiu $sp, $sp, -32\n"						\
+		"sw %7, 16($sp)\n"						\
+		"syscall\n  "							\
+		"addiu $sp, $sp, 32\n"						\
+		: "=r" (_num), "=r"(_arg4)					\
+		: "0"(_num),							\
+		  "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5)	\
+		: "memory", "cc", "at", "v1", "hi", "lo",			\
+		  "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9"	\
+	);									\
+	_arg4 ? -_num : _num;							\
 })
 
 char **environ __attribute__((weak));
diff --git a/tools/include/nolibc/arch-riscv.h b/tools/include/nolibc/arch-riscv.h
index a2e8564e66d6..4f21e862b412 100644
--- a/tools/include/nolibc/arch-riscv.h
+++ b/tools/include/nolibc/arch-riscv.h
@@ -58,122 +58,122 @@  struct sys_stat_struct {
  */
 #define __ARCH_WANT_SYS_PSELECT6
 
-#define my_syscall0(num)                                                      \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0");                                   \
-									      \
-	__asm__  volatile (                                                   \
-		"ecall\n\t"                                                   \
-		: "=r"(_arg1)                                                 \
-		: "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall0(num)							\
+({										\
+	register long _num __asm__ ("a7") = (num);				\
+	register long _arg1 __asm__ ("a0");					\
+										\
+	__asm__ volatile (							\
+		"ecall\n\t"							\
+		: "=r"(_arg1)							\
+		: "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall1(num, arg1)                                                \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);		      \
-									      \
-	__asm__  volatile (                                                   \
-		"ecall\n"                                                     \
-		: "+r"(_arg1)                                                 \
-		: "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall1(num, arg1)							\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+										\
+	__asm__ volatile (							\
+		"ecall\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall2(num, arg1, arg2)                                          \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"ecall\n"                                                     \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2),                                                 \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall2(num, arg1, arg2)						\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+										\
+	__asm__ volatile (							\
+		"ecall\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2),							\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall3(num, arg1, arg2, arg3)                                    \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"ecall\n\t"                                                   \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2), "r"(_arg3),                                     \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall3(num, arg1, arg2, arg3)					\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+										\
+	__asm__ volatile (							\
+		"ecall\n\t"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2), "r"(_arg3),					\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall4(num, arg1, arg2, arg3, arg4)                              \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("a3") = (long)(arg4);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"ecall\n"                                                     \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2), "r"(_arg3), "r"(_arg4),                         \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall4(num, arg1, arg2, arg3, arg4)				\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("a3") = (long)(arg4);			\
+										\
+	__asm__ volatile (							\
+		"ecall\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2), "r"(_arg3), "r"(_arg4),				\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)                        \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("a3") = (long)(arg4);                    \
-	register long _arg5 __asm__ ("a4") = (long)(arg5);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"ecall\n"                                                     \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),             \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)				\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("a3") = (long)(arg4);			\
+	register long _arg5 __asm__ ("a4") = (long)(arg5);			\
+										\
+	__asm__ volatile (							\
+		"ecall\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),		\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)                  \
-({                                                                            \
-	register long _num  __asm__ ("a7") = (num);                           \
-	register long _arg1 __asm__ ("a0") = (long)(arg1);                    \
-	register long _arg2 __asm__ ("a1") = (long)(arg2);                    \
-	register long _arg3 __asm__ ("a2") = (long)(arg3);                    \
-	register long _arg4 __asm__ ("a3") = (long)(arg4);                    \
-	register long _arg5 __asm__ ("a4") = (long)(arg5);                    \
-	register long _arg6 __asm__ ("a5") = (long)(arg6);                    \
-									      \
-	__asm__  volatile (                                                   \
-		"ecall\n"                                                     \
-		: "+r"(_arg1)                                                 \
-		: "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), "r"(_arg6), \
-		  "r"(_num)                                                   \
-		: "memory", "cc"                                              \
-	);                                                                    \
-	_arg1;                                                                \
+#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)			\
+({										\
+	register long _num __asm__ ("a7")  = (num);				\
+	register long _arg1 __asm__ ("a0") = (long)(arg1);			\
+	register long _arg2 __asm__ ("a1") = (long)(arg2);			\
+	register long _arg3 __asm__ ("a2") = (long)(arg3);			\
+	register long _arg4 __asm__ ("a3") = (long)(arg4);			\
+	register long _arg5 __asm__ ("a4") = (long)(arg5);			\
+	register long _arg6 __asm__ ("a5") = (long)(arg6);			\
+										\
+	__asm__ volatile (							\
+		"ecall\n"							\
+		: "+r"(_arg1)							\
+		: "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), "r"(_arg6),	\
+		  "r"(_num)							\
+		: "memory", "cc"						\
+	);									\
+	_arg1;									\
 })
 
 char **environ __attribute__((weak));
diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s390.h
index 516dff5bff8b..8cff5b05e841 100644
--- a/tools/include/nolibc/arch-s390.h
+++ b/tools/include/nolibc/arch-s390.h
@@ -47,119 +47,119 @@  struct sys_stat_struct {
  *
  */
 
-#define my_syscall0(num)						\
-({									\
-	register long _num __asm__ ("1") = (num);			\
-	register long _rc __asm__ ("2");				\
-									\
-	__asm__  volatile (						\
-		"svc 0\n"						\
-		: "=d"(_rc)						\
-		: "d"(_num)						\
-		: "memory", "cc"					\
-		);							\
-	_rc;								\
+#define my_syscall0(num)							\
+({										\
+	register long _num __asm__ ("1") = (num);				\
+	register long _rc __asm__ ("2");					\
+										\
+	__asm__ volatile (							\
+		"svc 0\n"							\
+		: "=d"(_rc)							\
+		: "d"(_num)							\
+		: "memory", "cc"						\
+		);								\
+	_rc;									\
 })
 
-#define my_syscall1(num, arg1)						\
-({									\
-	register long _num __asm__ ("1") = (num);			\
-	register long _arg1 __asm__ ("2") = (long)(arg1);		\
-									\
-	__asm__  volatile (						\
-		"svc 0\n"						\
-		: "+d"(_arg1)						\
-		: "d"(_num)						\
-		: "memory", "cc"					\
-		);							\
-	_arg1;								\
+#define my_syscall1(num, arg1)							\
+({										\
+	register long _num __asm__ ("1")  = (num);				\
+	register long _arg1 __asm__ ("2") = (long)(arg1);			\
+										\
+	__asm__ volatile (							\
+		"svc 0\n"							\
+		: "+d"(_arg1)							\
+		: "d"(_num)							\
+		: "memory", "cc"						\
+		);								\
+	_arg1;									\
 })
 
-#define my_syscall2(num, arg1, arg2)					\
-({									\
-	register long _num __asm__ ("1") = (num);			\
-	register long _arg1 __asm__ ("2") = (long)(arg1);		\
-	register long _arg2 __asm__ ("3") = (long)(arg2);		\
-									\
-	__asm__  volatile (						\
-		"svc 0\n"						\
-		: "+d"(_arg1)						\
-		: "d"(_arg2), "d"(_num)					\
-		: "memory", "cc"					\
-		);							\
-	_arg1;								\
+#define my_syscall2(num, arg1, arg2)						\
+({										\
+	register long _num __asm__ ("1")  = (num);				\
+	register long _arg1 __asm__ ("2") = (long)(arg1);			\
+	register long _arg2 __asm__ ("3") = (long)(arg2);			\
+										\
+	__asm__ volatile (							\
+		"svc 0\n"							\
+		: "+d"(_arg1)							\
+		: "d"(_arg2), "d"(_num)						\
+		: "memory", "cc"						\
+		);								\
+	_arg1;									\
 })
 
-#define my_syscall3(num, arg1, arg2, arg3)				\
-({									\
-	register long _num __asm__ ("1") = (num);			\
-	register long _arg1 __asm__ ("2") = (long)(arg1);		\
-	register long _arg2 __asm__ ("3") = (long)(arg2);		\
-	register long _arg3 __asm__ ("4") = (long)(arg3);		\
-									\
-	__asm__  volatile (						\
-		"svc 0\n"						\
-		: "+d"(_arg1)						\
-		: "d"(_arg2), "d"(_arg3), "d"(_num)			\
-		: "memory", "cc"					\
-		);							\
-	_arg1;								\
+#define my_syscall3(num, arg1, arg2, arg3)					\
+({										\
+	register long _num __asm__ ("1")  = (num);				\
+	register long _arg1 __asm__ ("2") = (long)(arg1);			\
+	register long _arg2 __asm__ ("3") = (long)(arg2);			\
+	register long _arg3 __asm__ ("4") = (long)(arg3);			\
+										\
+	__asm__ volatile (							\
+		"svc 0\n"							\
+		: "+d"(_arg1)							\
+		: "d"(_arg2), "d"(_arg3), "d"(_num)				\
+		: "memory", "cc"						\
+		);								\
+	_arg1;									\
 })
 
-#define my_syscall4(num, arg1, arg2, arg3, arg4)			\
-({									\
-	register long _num __asm__ ("1") = (num);			\
-	register long _arg1 __asm__ ("2") = (long)(arg1);		\
-	register long _arg2 __asm__ ("3") = (long)(arg2);		\
-	register long _arg3 __asm__ ("4") = (long)(arg3);		\
-	register long _arg4 __asm__ ("5") = (long)(arg4);		\
-									\
-	__asm__  volatile (						\
-		"svc 0\n"						\
-		: "+d"(_arg1)						\
-		: "d"(_arg2), "d"(_arg3), "d"(_arg4), "d"(_num)		\
-		: "memory", "cc"					\
-		);							\
-	_arg1;								\
+#define my_syscall4(num, arg1, arg2, arg3, arg4)				\
+({										\
+	register long _num __asm__ ("1")  = (num);				\
+	register long _arg1 __asm__ ("2") = (long)(arg1);			\
+	register long _arg2 __asm__ ("3") = (long)(arg2);			\
+	register long _arg3 __asm__ ("4") = (long)(arg3);			\
+	register long _arg4 __asm__ ("5") = (long)(arg4);			\
+										\
+	__asm__ volatile (							\
+		"svc 0\n"							\
+		: "+d"(_arg1)							\
+		: "d"(_arg2), "d"(_arg3), "d"(_arg4), "d"(_num)			\
+		: "memory", "cc"						\
+		);								\
+	_arg1;									\
 })
 
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)			\
-({									\
-	register long _num __asm__ ("1") = (num);			\
-	register long _arg1 __asm__ ("2") = (long)(arg1);		\
-	register long _arg2 __asm__ ("3") = (long)(arg2);		\
-	register long _arg3 __asm__ ("4") = (long)(arg3);		\
-	register long _arg4 __asm__ ("5") = (long)(arg4);		\
-	register long _arg5 __asm__ ("6") = (long)(arg5);		\
-									\
-	__asm__  volatile (						\
-		"svc 0\n"						\
-		: "+d"(_arg1)						\
-		: "d"(_arg2), "d"(_arg3), "d"(_arg4), "d"(_arg5),	\
-		  "d"(_num)						\
-		: "memory", "cc"					\
-		);							\
-	_arg1;								\
+#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)				\
+({										\
+	register long _num __asm__ ("1")  = (num);				\
+	register long _arg1 __asm__ ("2") = (long)(arg1);			\
+	register long _arg2 __asm__ ("3") = (long)(arg2);			\
+	register long _arg3 __asm__ ("4") = (long)(arg3);			\
+	register long _arg4 __asm__ ("5") = (long)(arg4);			\
+	register long _arg5 __asm__ ("6") = (long)(arg5);			\
+										\
+	__asm__ volatile (							\
+		"svc 0\n"							\
+		: "+d"(_arg1)							\
+		: "d"(_arg2), "d"(_arg3), "d"(_arg4), "d"(_arg5),		\
+		  "d"(_num)							\
+		: "memory", "cc"						\
+		);								\
+	_arg1;									\
 })
 
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)		\
-({									\
-	register long _num __asm__ ("1") = (num);			\
-	register long _arg1 __asm__ ("2") = (long)(arg1);		\
-	register long _arg2 __asm__ ("3") = (long)(arg2);		\
-	register long _arg3 __asm__ ("4") = (long)(arg3);		\
-	register long _arg4 __asm__ ("5") = (long)(arg4);		\
-	register long _arg5 __asm__ ("6") = (long)(arg5);		\
-	register long _arg6 __asm__ ("7") = (long)(arg6);		\
-									\
-	__asm__  volatile (						\
-		"svc 0\n"						\
-		: "+d"(_arg1)						\
-		: "d"(_arg2), "d"(_arg3), "d"(_arg4), "d"(_arg5),	\
-		  "d"(_arg6), "d"(_num)					\
-		: "memory", "cc"					\
-		);							\
-	_arg1;								\
+#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)			\
+({										\
+	register long _num __asm__ ("1")  = (num);				\
+	register long _arg1 __asm__ ("2") = (long)(arg1);			\
+	register long _arg2 __asm__ ("3") = (long)(arg2);			\
+	register long _arg3 __asm__ ("4") = (long)(arg3);			\
+	register long _arg4 __asm__ ("5") = (long)(arg4);			\
+	register long _arg5 __asm__ ("6") = (long)(arg5);			\
+	register long _arg6 __asm__ ("7") = (long)(arg6);			\
+										\
+	__asm__ volatile (							\
+		"svc 0\n"							\
+		: "+d"(_arg1)							\
+		: "d"(_arg2), "d"(_arg3), "d"(_arg4), "d"(_arg5),		\
+		  "d"(_arg6), "d"(_num)						\
+		: "memory", "cc"						\
+		);								\
+	_arg1;									\
 })
 
 char **environ __attribute__((weak));
diff --git a/tools/include/nolibc/arch-x86_64.h b/tools/include/nolibc/arch-x86_64.h
index 6fc4d8392742..1dc8b60f5153 100644
--- a/tools/include/nolibc/arch-x86_64.h
+++ b/tools/include/nolibc/arch-x86_64.h
@@ -55,129 +55,129 @@  struct sys_stat_struct {
  *
  */
 
-#define my_syscall0(num)                                                      \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num  __asm__ ("rax") = (num);                          \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"syscall\n"                                                   \
-		: "=a"(_ret)                                                  \
-		: "0"(_num)                                                   \
-		: "rcx", "r11", "memory", "cc"                                \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall0(num)							\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("rax") = (num);				\
+										\
+	__asm__ volatile (							\
+		"syscall\n"							\
+		: "=a"(_ret)							\
+		: "0"(_num)							\
+		: "rcx", "r11", "memory", "cc"					\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall1(num, arg1)                                                \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num  __asm__ ("rax") = (num);                          \
-	register long _arg1 __asm__ ("rdi") = (long)(arg1);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"syscall\n"                                                   \
-		: "=a"(_ret)                                                  \
-		: "r"(_arg1),                                                 \
-		  "0"(_num)                                                   \
-		: "rcx", "r11", "memory", "cc"                                \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall1(num, arg1)							\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("rax")  = (num);				\
+	register long _arg1 __asm__ ("rdi") = (long)(arg1);			\
+										\
+	__asm__ volatile (							\
+		"syscall\n"							\
+		: "=a"(_ret)							\
+		: "r"(_arg1),							\
+		  "0"(_num)							\
+		: "rcx", "r11", "memory", "cc"					\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall2(num, arg1, arg2)                                          \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num  __asm__ ("rax") = (num);                          \
-	register long _arg1 __asm__ ("rdi") = (long)(arg1);                   \
-	register long _arg2 __asm__ ("rsi") = (long)(arg2);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"syscall\n"                                                   \
-		: "=a"(_ret)                                                  \
-		: "r"(_arg1), "r"(_arg2),                                     \
-		  "0"(_num)                                                   \
-		: "rcx", "r11", "memory", "cc"                                \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall2(num, arg1, arg2)						\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("rax")  = (num);				\
+	register long _arg1 __asm__ ("rdi") = (long)(arg1);			\
+	register long _arg2 __asm__ ("rsi") = (long)(arg2);			\
+										\
+	__asm__ volatile (							\
+		"syscall\n"							\
+		: "=a"(_ret)							\
+		: "r"(_arg1), "r"(_arg2),					\
+		  "0"(_num)							\
+		: "rcx", "r11", "memory", "cc"					\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall3(num, arg1, arg2, arg3)                                    \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num  __asm__ ("rax") = (num);                          \
-	register long _arg1 __asm__ ("rdi") = (long)(arg1);                   \
-	register long _arg2 __asm__ ("rsi") = (long)(arg2);                   \
-	register long _arg3 __asm__ ("rdx") = (long)(arg3);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"syscall\n"                                                   \
-		: "=a"(_ret)                                                  \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3),                         \
-		  "0"(_num)                                                   \
-		: "rcx", "r11", "memory", "cc"                                \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall3(num, arg1, arg2, arg3)					\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("rax")  = (num);				\
+	register long _arg1 __asm__ ("rdi") = (long)(arg1);			\
+	register long _arg2 __asm__ ("rsi") = (long)(arg2);			\
+	register long _arg3 __asm__ ("rdx") = (long)(arg3);			\
+										\
+	__asm__ volatile (							\
+		"syscall\n"							\
+		: "=a"(_ret)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3),				\
+		  "0"(_num)							\
+		: "rcx", "r11", "memory", "cc"					\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall4(num, arg1, arg2, arg3, arg4)                              \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num  __asm__ ("rax") = (num);                          \
-	register long _arg1 __asm__ ("rdi") = (long)(arg1);                   \
-	register long _arg2 __asm__ ("rsi") = (long)(arg2);                   \
-	register long _arg3 __asm__ ("rdx") = (long)(arg3);                   \
-	register long _arg4 __asm__ ("r10") = (long)(arg4);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"syscall\n"                                                   \
-		: "=a"(_ret)                                                  \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4),             \
-		  "0"(_num)                                                   \
-		: "rcx", "r11", "memory", "cc"                                \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall4(num, arg1, arg2, arg3, arg4)				\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("rax")  = (num);				\
+	register long _arg1 __asm__ ("rdi") = (long)(arg1);			\
+	register long _arg2 __asm__ ("rsi") = (long)(arg2);			\
+	register long _arg3 __asm__ ("rdx") = (long)(arg3);			\
+	register long _arg4 __asm__ ("r10") = (long)(arg4);			\
+										\
+	__asm__ volatile (							\
+		"syscall\n"							\
+		: "=a"(_ret)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4),		\
+		  "0"(_num)							\
+		: "rcx", "r11", "memory", "cc"					\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)                        \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num  __asm__ ("rax") = (num);                          \
-	register long _arg1 __asm__ ("rdi") = (long)(arg1);                   \
-	register long _arg2 __asm__ ("rsi") = (long)(arg2);                   \
-	register long _arg3 __asm__ ("rdx") = (long)(arg3);                   \
-	register long _arg4 __asm__ ("r10") = (long)(arg4);                   \
-	register long _arg5 __asm__ ("r8")  = (long)(arg5);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"syscall\n"                                                   \
-		: "=a"(_ret)                                                  \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), \
-		  "0"(_num)                                                   \
-		: "rcx", "r11", "memory", "cc"                                \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5)				\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("rax")  = (num);				\
+	register long _arg1 __asm__ ("rdi") = (long)(arg1);			\
+	register long _arg2 __asm__ ("rsi") = (long)(arg2);			\
+	register long _arg3 __asm__ ("rdx") = (long)(arg3);			\
+	register long _arg4 __asm__ ("r10") = (long)(arg4);			\
+	register long _arg5 __asm__ ("r8")  = (long)(arg5);			\
+										\
+	__asm__ volatile (							\
+		"syscall\n"							\
+		: "=a"(_ret)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),	\
+		  "0"(_num)							\
+		: "rcx", "r11", "memory", "cc"					\
+	);									\
+	_ret;									\
 })
 
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)                  \
-({                                                                            \
-	long _ret;                                                            \
-	register long _num  __asm__ ("rax") = (num);                          \
-	register long _arg1 __asm__ ("rdi") = (long)(arg1);                   \
-	register long _arg2 __asm__ ("rsi") = (long)(arg2);                   \
-	register long _arg3 __asm__ ("rdx") = (long)(arg3);                   \
-	register long _arg4 __asm__ ("r10") = (long)(arg4);                   \
-	register long _arg5 __asm__ ("r8")  = (long)(arg5);                   \
-	register long _arg6 __asm__ ("r9")  = (long)(arg6);                   \
-	                                                                      \
-	__asm__  volatile (                                                   \
-		"syscall\n"                                                   \
-		: "=a"(_ret)                                                  \
-		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), \
-		  "r"(_arg6), "0"(_num)                                       \
-		: "rcx", "r11", "memory", "cc"                                \
-	);                                                                    \
-	_ret;                                                                 \
+#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6)			\
+({										\
+	long _ret;								\
+	register long _num __asm__ ("rax")  = (num);				\
+	register long _arg1 __asm__ ("rdi") = (long)(arg1);			\
+	register long _arg2 __asm__ ("rsi") = (long)(arg2);			\
+	register long _arg3 __asm__ ("rdx") = (long)(arg3);			\
+	register long _arg4 __asm__ ("r10") = (long)(arg4);			\
+	register long _arg5 __asm__ ("r8")  = (long)(arg5);			\
+	register long _arg6 __asm__ ("r9")  = (long)(arg6);			\
+										\
+	__asm__ volatile (							\
+		"syscall\n"							\
+		: "=a"(_ret)							\
+		: "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5),	\
+		  "r"(_arg6), "0"(_num)						\
+		: "rcx", "r11", "memory", "cc"					\
+	);									\
+	_ret;									\
 })
 
 char **environ __attribute__((weak));