um: Add an internal header shared among the user code
authorTiwei Bie <tiwei.btw@antgroup.com>
Tue, 23 Apr 2024 12:58:56 +0000 (20:58 +0800)
committerRichard Weinberger <richard@nod.at>
Tue, 30 Apr 2024 12:16:44 +0000 (14:16 +0200)
Move relevant declarations to this header. This will address
below -Wmissing-prototypes warnings:

arch/um/os-Linux/elf_aux.c:26:13: warning: no previous prototype for ‘scan_elf_aux’ [-Wmissing-prototypes]
arch/um/os-Linux/mem.c:213:13: warning: no previous prototype for ‘check_tmpexec’ [-Wmissing-prototypes]
arch/um/os-Linux/skas/process.c:107:6: warning: no previous prototype for ‘wait_stub_done’ [-Wmissing-prototypes]

Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/os-Linux/elf_aux.c
arch/um/os-Linux/internal.h [new file with mode: 0644]
arch/um/os-Linux/main.c
arch/um/os-Linux/mem.c
arch/um/os-Linux/skas/mem.c
arch/um/os-Linux/skas/process.c
arch/um/os-Linux/start_up.c

index 344ac403fb5da2a39c5cdb4808e0ead45afcdd2e..0a0f91cf4d6d5457b44bd4b3f6d0a84e2bfa7ee9 100644 (file)
@@ -13,6 +13,7 @@
 #include <init.h>
 #include <elf_user.h>
 #include <mem_user.h>
+#include "internal.h"
 
 typedef Elf32_auxv_t elf_auxv_t;
 
diff --git a/arch/um/os-Linux/internal.h b/arch/um/os-Linux/internal.h
new file mode 100644 (file)
index 0000000..317fca1
--- /dev/null
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __UM_OS_LINUX_INTERNAL_H
+#define __UM_OS_LINUX_INTERNAL_H
+
+/*
+ * elf_aux.c
+ */
+void scan_elf_aux(char **envp);
+
+/*
+ * mem.c
+ */
+void check_tmpexec(void);
+
+/*
+ * skas/process.c
+ */
+void wait_stub_done(int pid);
+
+#endif /* __UM_OS_LINUX_INTERNAL_H */
index e82164f90288c1db8d20da55d7a60aa3a25432f4..f98ff79cdbf7980ecc5effa6914da9018201ebec 100644 (file)
@@ -16,6 +16,7 @@
 #include <kern_util.h>
 #include <os.h>
 #include <um_malloc.h>
+#include "internal.h"
 
 #define PGD_BOUND (4 * 1024 * 1024)
 #define STACKSIZE (8 * 1024 * 1024)
@@ -102,8 +103,6 @@ static void setup_env_path(void)
        }
 }
 
-extern void scan_elf_aux( char **envp);
-
 int __init main(int argc, char **argv, char **envp)
 {
        char **new_argv;
index c6c9495b14321201f26e57e2362c14b02557ee8c..cf44d386f23ce3c295051bd110740feaed95352b 100644 (file)
@@ -17,6 +17,7 @@
 #include <init.h>
 #include <kern_util.h>
 #include <os.h>
+#include "internal.h"
 
 /*
  * kasan_map_memory - maps memory from @start with a size of @len.
index 953fb10f3f93183229ab9b818335b0ff9eb14848..1f9c1bffc3a66d8eaed5d0fbd123a9ea3e64d9e0 100644 (file)
 #include <skas.h>
 #include <sysdep/ptrace.h>
 #include <sysdep/stub.h>
+#include "../internal.h"
 
 extern char batch_syscall_stub[], __syscall_stub_start[];
 
-extern void wait_stub_done(int pid);
-
 static inline unsigned long *check_init_stack(struct mm_id * mm_idp,
                                              unsigned long *stack)
 {
index 1f5c3f2523d1e29782eb2edc04de3728ef6de8db..41a288dcfc3458e6cd3e864313d765a13584322c 100644 (file)
@@ -23,6 +23,7 @@
 #include <skas.h>
 #include <sysdep/stub.h>
 #include <linux/threads.h>
+#include "../internal.h"
 
 int is_skas_winch(int pid, int fd, void *data)
 {
index 6b21061c431ca63f12a1eee4fd1a959c57571e88..89ad9f4f865c3fa6d7f3cf09fc2115c259122cff 100644 (file)
@@ -25,6 +25,7 @@
 #include <ptrace_user.h>
 #include <registers.h>
 #include <skas.h>
+#include "internal.h"
 
 static void ptrace_child(void)
 {
@@ -222,8 +223,6 @@ static void __init check_ptrace(void)
        check_sysemu();
 }
 
-extern void check_tmpexec(void);
-
 static void __init check_coredump_limit(void)
 {
        struct rlimit lim;