move ioprio syscalls into syscalls.h
PATCH 1/1 move ioprio syscalls into syscalls.h
- Make ioprio syscalls return long, like set/getpriority syscalls.
- Move function prototypes into syscalls.h so we can pick them up in the 32/64bit compat code.
fs/ioprio.c +2 -2
@@ -43,7 +43,7 @@return 0 ; } -asmlinkage int sys_ioprio_set(int which, int who, int ioprio) +asmlinkage long sys_ioprio_set (int which,int who,int ioprio) {int class =IOPRIO_PRIO_CLASS (ioprio);int data =IOPRIO_PRIO_DATA (ioprio);
@@ -115,7 +115,7 @@return ret; } -asmlinkage int sys_ioprio_get(int which, int who) +asmlinkage long sys_ioprio_get (int which,int who) {struct task_struct *g, *p;struct user_struct *user;
include/linux/syscalls.h +3 -0
@@ -506,4 +506,7 @@asmlinkage long sys_keyctl (int cmd,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5); +asmlinkage long sys_ioprio_set (int which,int who,int ioprio); +asmlinkage long sys_ioprio_get (int which,int who); +#endif
include/linux/ioprio.h +0 -3
@@ -34,9 +34,6 @@*/ #define IOPRIO_BE_NR (8) -asmlinkage int sys_ioprio_set(int, int, int); -asmlinkage int sys_ioprio_get(int, int); -enum {IOPRIO_WHO_PROCESS =1 ,IOPRIO_WHO_PGRP ,
PATCH 1/1 ppc64: sys_ppc32.c cleanups
Remove some unnecessary includes, an out of date comment and a prototype for sys_timer_create (which is now in syscalls.h)
arch/ppc64/kernel/sys_ppc32.c +0 -27
@@ -30,47 +30,26 @@#include <linux/sem.h> #include <linux/msg.h> #include <linux/shm.h> -#include <linux/slab.h> -#include <linux/uio.h> -#include <linux/aio.h> -#include <linux/nfs_fs.h> -#include <linux/module.h> -#include <linux/sunrpc/svc.h> -#include <linux/nfsd/nfsd.h> -#include <linux/nfsd/cache.h> -#include <linux/nfsd/xdr.h> -#include <linux/nfsd/syscall.h> #include <linux/poll.h> #include <linux/personality.h> #include <linux/stat.h> -#include <linux/filter.h> -#include <linux/highmem.h> -#include <linux/highuid.h> #include <linux/mman.h> -#include <linux/ipv6.h> #include <linux/in.h> -#include <linux/icmpv6.h> #include <linux/syscalls.h> #include <linux/unistd.h> #include <linux/sysctl.h> #include <linux/binfmts.h> -#include <linux/dnotify.h> #include <linux/security.h> #include <linux/compat.h> #include <linux/ptrace.h> -#include <linux/aio_abi.h> #include <linux/elf.h> -#include <net/scm.h> -#include <net/sock.h> -#include <asm/ptrace.h> #include <asm/types.h> #include <asm/ipc.h> #include <asm/uaccess.h> #include <asm/unistd.h> #include <asm/semaphore.h> -#include <asm/ppcdebug.h> #include <asm/time.h> #include <asm/mmu_context.h> #include <asm/systemcfg.h>
@@ -350,8 +329,6 @@return ret; } - -/* These are here just in case some old sparc32 binary calls it. */ asmlinkage long sys32_pause (void ) { current->state =TASK_INTERRUPTIBLE ;
@@ -360,8 +337,6 @@return -ERESTARTNOHAND ; } - -static inline long get_ts32 (struct timespec *o,struct compat_timeval __user *i) {long usec;
@@ -1273,8 +1255,6 @@ (u64)len_high << 32 | len_low, advice); } -extern asmlinkage long sys_timer_create (clockid_t ,sigevent_t __user *,timer_t __user *); -long ppc32_timer_create (clockid_t clock,struct compat_sigevent __user *ev32,timer_t __user *timer_id)
PATCH 1/1 ppc64: add ioprio syscalls
- Clean up sys32_getpriority comment.
- Add ioprio syscalls, and sign extend 32bit versions.
arch/ppc64/kernel/sys_ppc32.c +17 -10
@@ -822,16 +822,6 @@ } -/* Note: it is necessary to treat which and who as unsigned ints, -* with the corresponding cast to a signed int to insure that the -* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) -* and the register representation of a signed int (msr in 64-bit mode) is performed. -*/ -asmlinkage long sys32_getpriority (u32 which,u32 who) -{ -return sys_getpriority ((int )which, (int )who); -} -/* Note: it is necessary to treat pid as an unsigned int, * with the corresponding cast to a signed int to insure that the
@@ -1023,6 +1013,11 @@return sys_setpgid ((int )pid, (int )pgid); } +long sys32_getpriority (u32 which,u32 who) +{ +/* sign extend which and who */ +return sys_getpriority ((int )which, (int )who); +}long sys32_setpriority (u32 which,u32 who,u32 niceval) {
@@ -1030,6 +1025,18 @@return sys_setpriority ((int )which, (int )who, (int )niceval); } +long sys32_ioprio_get (u32 which,u32 who) +{ +/* sign extend which and who */ +return sys_ioprio_get ((int )which, (int )who); +} + +long sys32_ioprio_set (u32 which,u32 who,u32 ioprio) +{ +/* sign extend which, who and ioprio */ +return sys_ioprio_set ((int )which, (int )who, (int )ioprio); +} +/* Note: it is necessary to treat newmask as an unsigned int, * with the corresponding cast to a signed int to insure that the * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
include/asm-ppc64/unistd.h +3 -1
@@ -283,8 +283,10 @@#define __NR_request_key 270#define __NR_keyctl 271#define __NR_waitid 272 +#define __NR_ioprio_set 273 +#define __NR_ioprio_get 274 -#define __NR_syscalls 273 +#define __NR_syscalls 275#ifdef __KERNEL__#define NR_syscalls __NR_syscalls#endif
arch/ppc64/kernel/misc.S +5 -1
@@ -1124,9 +1124,11 @@ .llong .compat_sys_mq_getsetattr .llong .compat_sys_kexec_load .llong .sys32_add_key - .llong .sys32_request_key + .llong .sys32_request_key /* 270 */ .llong .compat_sys_keyctl .llong .compat_sys_waitid + .llong .sys32_ioprio_set + .llong .sys32_ioprio_get .balign 8 _GLOBAL(sys_call_table)
@@ -1403,3 +1405,5 @@ .llong .sys_request_key /* 270 */ .llong .sys_keyctl .llong .sys_waitid + .llong .sys_ioprio_set + .llong .sys_ioprio_get
PATCH 1/1 ppc64: remove duplicate syscall reservation
We already have a prototype for sys_remap_file_pages (239) so there is no need to reserve it twice.
include/asm-ppc/unistd.h +1 -1
@@ -262,7 +262,7 @@#define __NR_rtas 255#define __NR_sys_debug_setcontext 256/* Number 257 is reserved for vserver */ -/* Number 258 is reserved for new sys_remap_file_pages */ +/* 258 currently unused */ /* Number 259 is reserved for new sys_mbind */ /* Number 260 is reserved for new sys_get_mempolicy */ /* Number 261 is reserved for new sys_set_mempolicy */
include/asm-ppc64/unistd.h +1 -1
@@ -268,7 +268,7 @@#define __NR_rtas 255/* Number 256 is reserved for sys_debug_setcontext */ /* Number 257 is reserved for vserver */ -/* Number 258 is reserved for new sys_remap_file_pages */ +/* 258 currently unused */ #define __NR_mbind 259#define __NR_get_mempolicy 260#define __NR_set_mempolicy 261
Quoted 6 lines · Anton Blanchard
- Make ioprio syscalls return long, like set/getpriority syscalls.
- Move function prototypes intosyscalls.hso we can pick them up in the 32/64bit compat code.Signed-off-by Anton Blanchard <[email protected]>
Thanks Anton.
Quoted 50 lines
Index:
foobar2/fs/ioprio.c
===================================================================fs/ioprio.c +2
-2@@ -43,7 +43,7 @@return 0 ; } -asmlinkage int sys_ioprio_set(int which, int who, int ioprio) +asmlinkage long sys_ioprio_set (int which,int who,int ioprio) {int class =IOPRIO_PRIO_CLASS (ioprio);int data =IOPRIO_PRIO_DATA (ioprio);@@ -115,7 +115,7 @@return ret; } -asmlinkage int sys_ioprio_get(int which, int who) +asmlinkage long sys_ioprio_get (int which,int who) {struct task_struct *g, *p;struct user_struct *user;Index:
foobar2/include/linux/syscalls.h
===================================================================include/linux/syscalls.h +3
-0@@ -506,4 +506,7 @@asmlinkage long sys_keyctl (int cmd,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5); +asmlinkage long sys_ioprio_set (int which,int who,int ioprio); +asmlinkage long sys_ioprio_get (int which,int who); +#endif Index:
foobar2/include/linux/ioprio.h
===================================================================include/linux/ioprio.h +0
-3@@ -34,9 +34,6 @@*/ #define IOPRIO_BE_NR (8) -asmlinkage int sys_ioprio_set(int, int, int); -asmlinkage int sys_ioprio_get(int, int); -enum {IOPRIO_WHO_PROCESS =1 ,IOPRIO_WHO_PGRP ,
Signature · 1 line
Jens Axboe