um: Fix the -Wmissing-prototypes warning for get_thread_reg
authorTiwei Bie <tiwei.btw@antgroup.com>
Tue, 23 Apr 2024 12:58:54 +0000 (20:58 +0800)
committerRichard Weinberger <richard@nod.at>
Tue, 30 Apr 2024 12:15:17 +0000 (14:15 +0200)
The get_thread_reg function is defined in the user code, and is
called by the kernel code. It should be declared in a shared header.

Fixes: dbba7f704aa0 ("um: stop polluting the namespace with registers.h contents")
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/include/asm/processor-generic.h
arch/x86/um/shared/sysdep/archsetjmp.h

index 6c3779541845bd834bbc53e4fdb346e62c18d884..5a7c05275aa74d30595506f5b97399d63911b96c 100644 (file)
@@ -94,7 +94,6 @@ extern struct cpuinfo_um boot_cpu_data;
 #define current_cpu_data boot_cpu_data
 #define cache_line_size()      (boot_cpu_data.cache_alignment)
 
-extern unsigned long get_thread_reg(int reg, jmp_buf *buf);
 #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
 extern unsigned long __get_wchan(struct task_struct *p);
 
index 166cedbab9266fb9eac60a07cbeaf681ffee3fcd..8c81d1a604a9428d3ac5866d06cc3a545592a9af 100644 (file)
@@ -1,6 +1,13 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __X86_UM_SYSDEP_ARCHSETJMP_H
+#define __X86_UM_SYSDEP_ARCHSETJMP_H
+
 #ifdef __i386__
 #include "archsetjmp_32.h"
 #else
 #include "archsetjmp_64.h"
 #endif
+
+unsigned long get_thread_reg(int reg, jmp_buf *buf);
+
+#endif /* __X86_UM_SYSDEP_ARCHSETJMP_H */