Skip to content

Commit e5d9a90

Browse files
Ivan Kokshayskytorvalds
authored andcommitted
alpha: use syscall wrappers
Convert OSF syscalls and add alpha specific SYSCALL_ALIAS() macro. Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Richard Henderson <rth@twiddle.net> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 299b4ea commit e5d9a90

6 files changed

Lines changed: 92 additions & 99 deletions

File tree

‎arch/alpha/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ config ALPHA
88
select HAVE_AOUT
99
select HAVE_IDE
1010
select HAVE_OPROFILE
11+
select HAVE_SYSCALL_WRAPPERS
1112
help
1213
The Alpha is a 64-bit general-purpose processor designed and
1314
marketed by the Digital Equipment Corporation of blessed memory,

‎arch/alpha/kernel/entry.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ sys_execve:
933933
osf_sigprocmask:
934934
.prologue 0
935935
mov $sp, $18
936-
jmp $31, do_osf_sigprocmask
936+
jmp $31, sys_osf_sigprocmask
937937
.end osf_sigprocmask
938938

939939
.align 4

‎arch/alpha/kernel/osf_sys.c‎

Lines changed: 50 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ extern int do_pipe(int *);
5454
* identical to OSF as we don't return 0 on success, but doing otherwise
5555
* would require changes to libc. Hopefully this is good enough.
5656
*/
57-
asmlinkage unsigned long
58-
osf_brk(unsigned long brk)
57+
SYSCALL_DEFINE1(osf_brk, unsigned long, brk)
5958
{
6059
unsigned long retval = sys_brk(brk);
6160
if (brk && brk != retval)
@@ -66,9 +65,9 @@ osf_brk(unsigned long brk)
6665
/*
6766
* This is pure guess-work..
6867
*/
69-
asmlinkage int
70-
osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
71-
unsigned long bss_start, unsigned long bss_len)
68+
SYSCALL_DEFINE4(osf_set_program_attributes, unsigned long, text_start,
69+
unsigned long, text_len, unsigned long, bss_start,
70+
unsigned long, bss_len)
7271
{
7372
struct mm_struct *mm;
7473

@@ -146,9 +145,9 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
146145
return -EFAULT;
147146
}
148147

149-
asmlinkage int
150-
osf_getdirentries(unsigned int fd, struct osf_dirent __user *dirent,
151-
unsigned int count, long __user *basep)
148+
SYSCALL_DEFINE4(osf_getdirentries, unsigned int, fd,
149+
struct osf_dirent __user *, dirent, unsigned int, count,
150+
long __user *, basep)
152151
{
153152
int error;
154153
struct file *file;
@@ -177,9 +176,9 @@ osf_getdirentries(unsigned int fd, struct osf_dirent __user *dirent,
177176

178177
#undef NAME_OFFSET
179178

180-
asmlinkage unsigned long
181-
osf_mmap(unsigned long addr, unsigned long len, unsigned long prot,
182-
unsigned long flags, unsigned long fd, unsigned long off)
179+
SYSCALL_DEFINE6(osf_mmap, unsigned long, addr, unsigned long, len,
180+
unsigned long, prot, unsigned long, flags, unsigned long, fd,
181+
unsigned long, off)
183182
{
184183
struct file *file = NULL;
185184
unsigned long ret = -EBADF;
@@ -254,8 +253,8 @@ do_osf_statfs(struct dentry * dentry, struct osf_statfs __user *buffer,
254253
return error;
255254
}
256255

257-
asmlinkage int
258-
osf_statfs(char __user *pathname, struct osf_statfs __user *buffer, unsigned long bufsiz)
256+
SYSCALL_DEFINE3(osf_statfs, char __user *, pathname,
257+
struct osf_statfs __user *, buffer, unsigned long, bufsiz)
259258
{
260259
struct path path;
261260
int retval;
@@ -268,8 +267,8 @@ osf_statfs(char __user *pathname, struct osf_statfs __user *buffer, unsigned lon
268267
return retval;
269268
}
270269

271-
asmlinkage int
272-
osf_fstatfs(unsigned long fd, struct osf_statfs __user *buffer, unsigned long bufsiz)
270+
SYSCALL_DEFINE3(osf_fstatfs, unsigned long, fd,
271+
struct osf_statfs __user *, buffer, unsigned long, bufsiz)
273272
{
274273
struct file *file;
275274
int retval;
@@ -368,8 +367,8 @@ osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags)
368367
return do_mount("", dirname, "proc", flags, NULL);
369368
}
370369

371-
asmlinkage int
372-
osf_mount(unsigned long typenr, char __user *path, int flag, void __user *data)
370+
SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
371+
int, flag, void __user *, data)
373372
{
374373
int retval = -EINVAL;
375374
char *name;
@@ -399,8 +398,7 @@ osf_mount(unsigned long typenr, char __user *path, int flag, void __user *data)
399398
return retval;
400399
}
401400

402-
asmlinkage int
403-
osf_utsname(char __user *name)
401+
SYSCALL_DEFINE1(osf_utsname, char __user *, name)
404402
{
405403
int error;
406404

@@ -423,23 +421,20 @@ osf_utsname(char __user *name)
423421
return error;
424422
}
425423

426-
asmlinkage unsigned long
427-
sys_getpagesize(void)
424+
SYSCALL_DEFINE0(getpagesize)
428425
{
429426
return PAGE_SIZE;
430427
}
431428

432-
asmlinkage unsigned long
433-
sys_getdtablesize(void)
429+
SYSCALL_DEFINE0(getdtablesize)
434430
{
435431
return sysctl_nr_open;
436432
}
437433

438434
/*
439435
* For compatibility with OSF/1 only. Use utsname(2) instead.
440436
*/
441-
asmlinkage int
442-
osf_getdomainname(char __user *name, int namelen)
437+
SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen)
443438
{
444439
unsigned len;
445440
int i;
@@ -527,8 +522,8 @@ enum pl_code {
527522
PL_DEL = 5, PL_FDEL = 6
528523
};
529524

530-
asmlinkage long
531-
osf_proplist_syscall(enum pl_code code, union pl_args __user *args)
525+
SYSCALL_DEFINE2(osf_proplist_syscall, enum pl_code, code,
526+
union pl_args __user *, args)
532527
{
533528
long error;
534529
int __user *min_buf_size_ptr;
@@ -567,8 +562,8 @@ osf_proplist_syscall(enum pl_code code, union pl_args __user *args)
567562
return error;
568563
}
569564

570-
asmlinkage int
571-
osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss)
565+
SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss,
566+
struct sigstack __user *, uoss)
572567
{
573568
unsigned long usp = rdusp();
574569
unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size;
@@ -608,8 +603,7 @@ osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss)
608603
return error;
609604
}
610605

611-
asmlinkage long
612-
osf_sysinfo(int command, char __user *buf, long count)
606+
SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count)
613607
{
614608
char *sysinfo_table[] = {
615609
utsname()->sysname,
@@ -647,9 +641,8 @@ osf_sysinfo(int command, char __user *buf, long count)
647641
return err;
648642
}
649643

650-
asmlinkage unsigned long
651-
osf_getsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
652-
int __user *start, void __user *arg)
644+
SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer,
645+
unsigned long, nbytes, int __user *, start, void __user *, arg)
653646
{
654647
unsigned long w;
655648
struct percpu_struct *cpu;
@@ -705,9 +698,8 @@ osf_getsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
705698
return -EOPNOTSUPP;
706699
}
707700

708-
asmlinkage unsigned long
709-
osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
710-
int __user *start, void __user *arg)
701+
SYSCALL_DEFINE5(osf_setsysinfo, unsigned long, op, void __user *, buffer,
702+
unsigned long, nbytes, int __user *, start, void __user *, arg)
711703
{
712704
switch (op) {
713705
case SSI_IEEE_FP_CONTROL: {
@@ -880,8 +872,8 @@ jiffies_to_timeval32(unsigned long jiffies, struct timeval32 *value)
880872
value->tv_sec = jiffies / HZ;
881873
}
882874

883-
asmlinkage int
884-
osf_gettimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
875+
SYSCALL_DEFINE2(osf_gettimeofday, struct timeval32 __user *, tv,
876+
struct timezone __user *, tz)
885877
{
886878
if (tv) {
887879
struct timeval ktv;
@@ -896,8 +888,8 @@ osf_gettimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
896888
return 0;
897889
}
898890

899-
asmlinkage int
900-
osf_settimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
891+
SYSCALL_DEFINE2(osf_settimeofday, struct timeval32 __user *, tv,
892+
struct timezone __user *, tz)
901893
{
902894
struct timespec kts;
903895
struct timezone ktz;
@@ -916,8 +908,7 @@ osf_settimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
916908
return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
917909
}
918910

919-
asmlinkage int
920-
osf_getitimer(int which, struct itimerval32 __user *it)
911+
SYSCALL_DEFINE2(osf_getitimer, int, which, struct itimerval32 __user *, it)
921912
{
922913
struct itimerval kit;
923914
int error;
@@ -929,8 +920,8 @@ osf_getitimer(int which, struct itimerval32 __user *it)
929920
return error;
930921
}
931922

932-
asmlinkage int
933-
osf_setitimer(int which, struct itimerval32 __user *in, struct itimerval32 __user *out)
923+
SYSCALL_DEFINE3(osf_setitimer, int, which, struct itimerval32 __user *, in,
924+
struct itimerval32 __user *, out)
934925
{
935926
struct itimerval kin, kout;
936927
int error;
@@ -952,8 +943,8 @@ osf_setitimer(int which, struct itimerval32 __user *in, struct itimerval32 __use
952943

953944
}
954945

955-
asmlinkage int
956-
osf_utimes(char __user *filename, struct timeval32 __user *tvs)
946+
SYSCALL_DEFINE2(osf_utimes, char __user *, filename,
947+
struct timeval32 __user *, tvs)
957948
{
958949
struct timespec tv[2];
959950

@@ -979,9 +970,8 @@ osf_utimes(char __user *filename, struct timeval32 __user *tvs)
979970
#define MAX_SELECT_SECONDS \
980971
((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
981972

982-
asmlinkage int
983-
osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
984-
struct timeval32 __user *tvp)
973+
SYSCALL_DEFINE5(osf_select, int, n, fd_set __user *, inp, fd_set __user *, outp,
974+
fd_set __user *, exp, struct timeval32 __user *, tvp)
985975
{
986976
struct timespec end_time, *to = NULL;
987977
if (tvp) {
@@ -1026,8 +1016,7 @@ struct rusage32 {
10261016
long ru_nivcsw; /* involuntary " */
10271017
};
10281018

1029-
asmlinkage int
1030-
osf_getrusage(int who, struct rusage32 __user *ru)
1019+
SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru)
10311020
{
10321021
struct rusage32 r;
10331022

@@ -1053,9 +1042,8 @@ osf_getrusage(int who, struct rusage32 __user *ru)
10531042
return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0;
10541043
}
10551044

1056-
asmlinkage long
1057-
osf_wait4(pid_t pid, int __user *ustatus, int options,
1058-
struct rusage32 __user *ur)
1045+
SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options,
1046+
struct rusage32 __user *, ur)
10591047
{
10601048
struct rusage r;
10611049
long ret, err;
@@ -1101,8 +1089,8 @@ osf_wait4(pid_t pid, int __user *ustatus, int options,
11011089
* seems to be a timeval pointer, and I suspect the second
11021090
* one is the time remaining.. Ho humm.. No documentation.
11031091
*/
1104-
asmlinkage int
1105-
osf_usleep_thread(struct timeval32 __user *sleep, struct timeval32 __user *remain)
1092+
SYSCALL_DEFINE2(osf_usleep_thread, struct timeval32 __user *, sleep,
1093+
struct timeval32 __user *, remain)
11061094
{
11071095
struct timeval tmp;
11081096
unsigned long ticks;
@@ -1155,8 +1143,7 @@ struct timex32 {
11551143
int :32; int :32; int :32; int :32;
11561144
};
11571145

1158-
asmlinkage int
1159-
sys_old_adjtimex(struct timex32 __user *txc_p)
1146+
SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
11601147
{
11611148
struct timex txc;
11621149
int ret;
@@ -1267,17 +1254,17 @@ osf_fix_iov_len(const struct iovec __user *iov, unsigned long count)
12671254
return 0;
12681255
}
12691256

1270-
asmlinkage ssize_t
1271-
osf_readv(unsigned long fd, const struct iovec __user * vector, unsigned long count)
1257+
SYSCALL_DEFINE3(osf_readv, unsigned long, fd,
1258+
const struct iovec __user *, vector, unsigned long, count)
12721259
{
12731260
if (unlikely(personality(current->personality) == PER_OSF4))
12741261
if (osf_fix_iov_len(vector, count))
12751262
return -EFAULT;
12761263
return sys_readv(fd, vector, count);
12771264
}
12781265

1279-
asmlinkage ssize_t
1280-
osf_writev(unsigned long fd, const struct iovec __user * vector, unsigned long count)
1266+
SYSCALL_DEFINE3(osf_writev, unsigned long, fd,
1267+
const struct iovec __user *, vector, unsigned long, count)
12811268
{
12821269
if (unlikely(personality(current->personality) == PER_OSF4))
12831270
if (osf_fix_iov_len(vector, count))

‎arch/alpha/kernel/signal.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/tty.h>
2020
#include <linux/binfmts.h>
2121
#include <linux/bitops.h>
22+
#include <linux/syscalls.h>
2223

2324
#include <asm/uaccess.h>
2425
#include <asm/sigcontext.h>
@@ -51,8 +52,8 @@ static void do_signal(struct pt_regs *, struct switch_stack *,
5152
* Note that we don't need to acquire the kernel lock for SMP
5253
* operation, as all of this is local to this thread.
5354
*/
54-
asmlinkage unsigned long
55-
do_osf_sigprocmask(int how, unsigned long newmask, struct pt_regs *regs)
55+
SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask,
56+
struct pt_regs *, regs)
5657
{
5758
unsigned long oldmask = -EINVAL;
5859

@@ -81,9 +82,9 @@ do_osf_sigprocmask(int how, unsigned long newmask, struct pt_regs *regs)
8182
return oldmask;
8283
}
8384

84-
asmlinkage int
85-
osf_sigaction(int sig, const struct osf_sigaction __user *act,
86-
struct osf_sigaction __user *oact)
85+
SYSCALL_DEFINE3(osf_sigaction, int, sig,
86+
const struct osf_sigaction __user *, act,
87+
struct osf_sigaction __user *, oact)
8788
{
8889
struct k_sigaction new_ka, old_ka;
8990
int ret;
@@ -112,10 +113,9 @@ osf_sigaction(int sig, const struct osf_sigaction __user *act,
112113
return ret;
113114
}
114115

115-
asmlinkage long
116-
sys_rt_sigaction(int sig, const struct sigaction __user *act,
117-
struct sigaction __user *oact,
118-
size_t sigsetsize, void __user *restorer)
116+
SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
117+
struct sigaction __user *, oact,
118+
size_t, sigsetsize, void __user *, restorer)
119119
{
120120
struct k_sigaction new_ka, old_ka;
121121
int ret;

0 commit comments

Comments
 (0)