Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: Move declarations to proper headers

This will address below -Wmissing-prototypes warnings:

arch/um/kernel/initrd.c:18:12: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes]
arch/um/kernel/um_arch.c:408:19: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes]
arch/um/os-Linux/start_up.c:301:12: warning: no previous prototype for ‘parse_iomem’ [-Wmissing-prototypes]
arch/x86/um/ptrace_32.c:15:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes]
arch/x86/um/ptrace_32.c:101:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes]
arch/x86/um/ptrace_32.c:153:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes]
arch/x86/um/ptrace_64.c:111:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes]
arch/x86/um/ptrace_64.c:171:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes]
arch/x86/um/syscalls_64.c:48:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes]
arch/x86/um/tls_32.c:184:5: warning: no previous prototype for ‘arch_switch_tls’ [-Wmissing-prototypes]

Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Tiwei Bie and committed by
Richard Weinberger
a4b4382f 9ffc6724

+14 -9
+3
arch/um/include/asm/ptrace-generic.h
··· 36 36 extern unsigned long getreg(struct task_struct *child, int regno); 37 37 extern int putreg(struct task_struct *child, int regno, unsigned long value); 38 38 39 + extern int poke_user(struct task_struct *child, long addr, long data); 40 + extern int peek_user(struct task_struct *child, long addr, long data); 41 + 39 42 extern int arch_set_tls(struct task_struct *new, unsigned long tls); 40 43 extern void clear_flushed_tls(struct task_struct *task); 41 44 extern int syscall_trace_enter(struct pt_regs *regs);
+1
arch/um/include/shared/kern_util.h
··· 41 41 42 42 extern int start_uml(void); 43 43 extern void paging_init(void); 44 + extern int parse_iomem(char *str, int *add); 44 45 45 46 extern void uml_cleanup(void); 46 47 extern void do_uml_exitcalls(void);
+1 -2
arch/um/kernel/physmem.c
··· 12 12 #include <as-layout.h> 13 13 #include <init.h> 14 14 #include <kern.h> 15 + #include <kern_util.h> 15 16 #include <mem_user.h> 16 17 #include <os.h> 17 18 ··· 161 160 " be more, and the excess, if it's ever used, will just be swapped out.\n" 162 161 " Example: mem=64M\n\n" 163 162 ); 164 - 165 - extern int __init parse_iomem(char *str, int *add); 166 163 167 164 __uml_setup("iomem=", parse_iomem, 168 165 "iomem=<name>,<file>\n"
-2
arch/um/kernel/process.c
··· 74 74 { external_pid(), task }); 75 75 } 76 76 77 - extern void arch_switch_to(struct task_struct *to); 78 - 79 77 struct task_struct *__switch_to(struct task_struct *from, struct task_struct *to) 80 78 { 81 79 to->thread.prev_sched = from;
-3
arch/um/kernel/ptrace.c
··· 35 35 user_disable_single_step(child); 36 36 } 37 37 38 - extern int peek_user(struct task_struct * child, long addr, long data); 39 - extern int poke_user(struct task_struct * child, long addr, long data); 40 - 41 38 long arch_ptrace(struct task_struct *child, long request, 42 39 unsigned long addr, unsigned long data) 43 40 {
+2
arch/um/kernel/um_arch.h
··· 11 11 static inline void uml_dtb_init(void) { } 12 12 #endif 13 13 14 + extern int __init read_initrd(void); 15 + 14 16 #endif
+1
arch/um/os-Linux/start_up.c
··· 20 20 #include <asm/unistd.h> 21 21 #include <init.h> 22 22 #include <os.h> 23 + #include <kern_util.h> 23 24 #include <mem_user.h> 24 25 #include <ptrace_user.h> 25 26 #include <registers.h>
+6
arch/x86/um/asm/ptrace.h
··· 54 54 extern int ptrace_set_thread_area(struct task_struct *child, int idx, 55 55 struct user_desc __user *user_desc); 56 56 57 + extern int arch_switch_tls(struct task_struct *to); 58 + 57 59 #else 58 60 59 61 #define PT_REGS_R8(r) UPT_R8(&(r)->regs) ··· 85 83 unsigned long __user *addr); 86 84 87 85 #endif 86 + 88 87 #define user_stack_pointer(regs) PT_REGS_SP(regs) 88 + 89 + extern void arch_switch_to(struct task_struct *to); 90 + 89 91 #endif /* __UM_X86_PTRACE_H */
-2
arch/x86/um/ptrace_32.c
··· 10 10 #include <registers.h> 11 11 #include <skas.h> 12 12 13 - extern int arch_switch_tls(struct task_struct *to); 14 - 15 13 void arch_switch_to(struct task_struct *to) 16 14 { 17 15 int err = arch_switch_tls(to);