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

ARM: 9309/1: add missing syscall prototypes

All architecture-independent system calls have prototypes in
include/linux/syscalls.h, but there are a few that only exist
on arm or that take the pt_regs directly. These cause a W=1
warning such as:

arch/arm/kernel/signal.c:186:16: error: no previous prototype for 'sys_sigreturn' [-Werror=missing-prototypes]
arch/arm/kernel/signal.c:216:16: error: no previous prototype for 'sys_rt_sigreturn' [-Werror=missing-prototypes]
arch/arm/kernel/sys_arm.c:32:17: error: no previous prototype for 'sys_arm_fadvise64_64' [-Werror=missing-prototypes]

Add prototypes for all custom syscalls on arm and add them
to asm/syscalls.h.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

authored by

Arnd Bergmann and committed by
Russell King (Oracle)
be0796b0 ad1cfe62

+55
+51
arch/arm/include/asm/syscalls.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #ifndef __ASM_SYSCALLS_H 3 + #define __ASM_SYSCALLS_H 4 + 5 + #include <linux/linkage.h> 6 + #include <linux/types.h> 7 + 8 + struct pt_regs; 9 + asmlinkage int sys_sigreturn(struct pt_regs *regs); 10 + asmlinkage int sys_rt_sigreturn(struct pt_regs *regs); 11 + asmlinkage long sys_arm_fadvise64_64(int fd, int advice, 12 + loff_t offset, loff_t len); 13 + 14 + struct oldabi_stat64; 15 + asmlinkage long sys_oabi_stat64(const char __user * filename, 16 + struct oldabi_stat64 __user * statbuf); 17 + asmlinkage long sys_oabi_lstat64(const char __user * filename, 18 + struct oldabi_stat64 __user * statbuf); 19 + asmlinkage long sys_oabi_fstat64(unsigned long fd, 20 + struct oldabi_stat64 __user * statbuf); 21 + asmlinkage long sys_oabi_fstatat64(int dfd, 22 + const char __user *filename, 23 + struct oldabi_stat64 __user *statbuf, 24 + int flag); 25 + asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd, 26 + unsigned long arg); 27 + struct oabi_epoll_event; 28 + asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd, 29 + struct oabi_epoll_event __user *event); 30 + struct oabi_sembuf; 31 + struct old_timespec32; 32 + asmlinkage long sys_oabi_semtimedop(int semid, 33 + struct oabi_sembuf __user *tsops, 34 + unsigned nsops, 35 + const struct old_timespec32 __user *timeout); 36 + asmlinkage long sys_oabi_semop(int semid, struct oabi_sembuf __user *tsops, 37 + unsigned nsops); 38 + asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third, 39 + void __user *ptr, long fifth); 40 + struct sockaddr; 41 + asmlinkage long sys_oabi_bind(int fd, struct sockaddr __user *addr, int addrlen); 42 + asmlinkage long sys_oabi_connect(int fd, struct sockaddr __user *addr, int addrlen); 43 + asmlinkage long sys_oabi_sendto(int fd, void __user *buff, 44 + size_t len, unsigned flags, 45 + struct sockaddr __user *addr, 46 + int addrlen); 47 + struct user_msghdr; 48 + asmlinkage long sys_oabi_sendmsg(int fd, struct user_msghdr __user *msg, unsigned flags); 49 + asmlinkage long sys_oabi_socketcall(int call, unsigned long __user *args); 50 + 51 + #endif
+1
arch/arm/kernel/signal.c
··· 18 18 #include <asm/traps.h> 19 19 #include <asm/unistd.h> 20 20 #include <asm/vfp.h> 21 + #include <asm/syscalls.h> 21 22 22 23 #include "signal.h" 23 24
+1
arch/arm/kernel/sys_arm.c
··· 24 24 #include <linux/ipc.h> 25 25 #include <linux/uaccess.h> 26 26 #include <linux/slab.h> 27 + #include <asm/syscalls.h> 27 28 28 29 /* 29 30 * Since loff_t is a 64 bit type we avoid a lot of ABI hassle
+2
arch/arm/kernel/sys_oabi-compat.c
··· 10 10 * Copyright: MontaVista Software, Inc. 11 11 */ 12 12 13 + #include <asm/syscalls.h> 14 + 13 15 /* 14 16 * The legacy ABI and the new ARM EABI have different rules making some 15 17 * syscalls incompatible especially with structure arguments.