tools/nolibc: use standard __asm__ statements
authorThomas Weißschuh <linux@weissschuh.net>
Thu, 6 Apr 2023 21:54:47 +0000 (21:54 +0000)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 9 Jun 2023 18:46:07 +0000 (11:46 -0700)
Most of the code was migrated to C99-conformant __asm__ statements
before. It seems string.h was missed.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/include/nolibc/string.h
tools/testing/selftests/nolibc/nolibc-test.c

index fffdaf6ff46731d5aac33b7b7a244471f24a6724..0c2e06c7c4772bc6ea59e3536f2485ef7b516a9f 100644 (file)
@@ -90,7 +90,7 @@ void *memset(void *dst, int b, size_t len)
 
        while (len--) {
                /* prevent gcc from recognizing memset() here */
-               asm volatile("");
+               __asm__ volatile("");
                *(p++) = b;
        }
        return dst;
@@ -139,7 +139,7 @@ size_t strlen(const char *str)
        size_t len;
 
        for (len = 0; str[len]; len++)
-               asm("");
+               __asm__("");
        return len;
 }
 
index 888da60eb5bab2960319a4936ebe8996c88dc6f5..e692be98973a4ce73c9066aa687fa948b45cf8ef 100644 (file)
@@ -984,7 +984,7 @@ int main(int argc, char **argv, char **envp)
 #else
                else if (ioperm(0x501, 1, 1) == 0)
 #endif
-                       asm volatile ("outb %%al, %%dx" :: "d"(0x501), "a"(0));
+                       __asm__ volatile ("outb %%al, %%dx" :: "d"(0x501), "a"(0));
                /* if it does nothing, fall back to the regular panic */
 #endif
        }