diff options
Diffstat (limited to 'include/linux/compat.h')
-rw-r--r-- | include/linux/compat.h | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index 1a3c4f37e908..0e058792ecf6 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -7,7 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/compat_time.h> | 10 | #include <linux/time.h> |
11 | 11 | ||
12 | #include <linux/stat.h> | 12 | #include <linux/stat.h> |
13 | #include <linux/param.h> /* for HZ */ | 13 | #include <linux/param.h> /* for HZ */ |
@@ -116,13 +116,13 @@ struct compat_sel_arg_struct; | |||
116 | struct rusage; | 116 | struct rusage; |
117 | 117 | ||
118 | struct compat_utimbuf { | 118 | struct compat_utimbuf { |
119 | compat_time_t actime; | 119 | old_time32_t actime; |
120 | compat_time_t modtime; | 120 | old_time32_t modtime; |
121 | }; | 121 | }; |
122 | 122 | ||
123 | struct compat_itimerval { | 123 | struct compat_itimerval { |
124 | struct compat_timeval it_interval; | 124 | struct old_timeval32 it_interval; |
125 | struct compat_timeval it_value; | 125 | struct old_timeval32 it_value; |
126 | }; | 126 | }; |
127 | 127 | ||
128 | struct itimerval; | 128 | struct itimerval; |
@@ -146,7 +146,7 @@ struct compat_timex { | |||
146 | compat_long_t constant; | 146 | compat_long_t constant; |
147 | compat_long_t precision; | 147 | compat_long_t precision; |
148 | compat_long_t tolerance; | 148 | compat_long_t tolerance; |
149 | struct compat_timeval time; | 149 | struct old_timeval32 time; |
150 | compat_long_t tick; | 150 | compat_long_t tick; |
151 | compat_long_t ppsfreq; | 151 | compat_long_t ppsfreq; |
152 | compat_long_t jitter; | 152 | compat_long_t jitter; |
@@ -307,8 +307,8 @@ struct compat_rlimit { | |||
307 | }; | 307 | }; |
308 | 308 | ||
309 | struct compat_rusage { | 309 | struct compat_rusage { |
310 | struct compat_timeval ru_utime; | 310 | struct old_timeval32 ru_utime; |
311 | struct compat_timeval ru_stime; | 311 | struct old_timeval32 ru_stime; |
312 | compat_long_t ru_maxrss; | 312 | compat_long_t ru_maxrss; |
313 | compat_long_t ru_ixrss; | 313 | compat_long_t ru_ixrss; |
314 | compat_long_t ru_idrss; | 314 | compat_long_t ru_idrss; |
@@ -457,8 +457,8 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *fr | |||
457 | int get_compat_sigevent(struct sigevent *event, | 457 | int get_compat_sigevent(struct sigevent *event, |
458 | const struct compat_sigevent __user *u_event); | 458 | const struct compat_sigevent __user *u_event); |
459 | 459 | ||
460 | static inline int compat_timeval_compare(struct compat_timeval *lhs, | 460 | static inline int old_timeval32_compare(struct old_timeval32 *lhs, |
461 | struct compat_timeval *rhs) | 461 | struct old_timeval32 *rhs) |
462 | { | 462 | { |
463 | if (lhs->tv_sec < rhs->tv_sec) | 463 | if (lhs->tv_sec < rhs->tv_sec) |
464 | return -1; | 464 | return -1; |
@@ -467,8 +467,8 @@ static inline int compat_timeval_compare(struct compat_timeval *lhs, | |||
467 | return lhs->tv_usec - rhs->tv_usec; | 467 | return lhs->tv_usec - rhs->tv_usec; |
468 | } | 468 | } |
469 | 469 | ||
470 | static inline int compat_timespec_compare(struct compat_timespec *lhs, | 470 | static inline int old_timespec32_compare(struct old_timespec32 *lhs, |
471 | struct compat_timespec *rhs) | 471 | struct old_timespec32 *rhs) |
472 | { | 472 | { |
473 | if (lhs->tv_sec < rhs->tv_sec) | 473 | if (lhs->tv_sec < rhs->tv_sec) |
474 | return -1; | 474 | return -1; |
@@ -552,12 +552,12 @@ asmlinkage long compat_sys_io_getevents(compat_aio_context_t ctx_id, | |||
552 | compat_long_t min_nr, | 552 | compat_long_t min_nr, |
553 | compat_long_t nr, | 553 | compat_long_t nr, |
554 | struct io_event __user *events, | 554 | struct io_event __user *events, |
555 | struct compat_timespec __user *timeout); | 555 | struct old_timespec32 __user *timeout); |
556 | asmlinkage long compat_sys_io_pgetevents(compat_aio_context_t ctx_id, | 556 | asmlinkage long compat_sys_io_pgetevents(compat_aio_context_t ctx_id, |
557 | compat_long_t min_nr, | 557 | compat_long_t min_nr, |
558 | compat_long_t nr, | 558 | compat_long_t nr, |
559 | struct io_event __user *events, | 559 | struct io_event __user *events, |
560 | struct compat_timespec __user *timeout, | 560 | struct old_timespec32 __user *timeout, |
561 | const struct __compat_aio_sigset __user *usig); | 561 | const struct __compat_aio_sigset __user *usig); |
562 | 562 | ||
563 | /* fs/cookies.c */ | 563 | /* fs/cookies.c */ |
@@ -642,11 +642,11 @@ asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd, | |||
642 | asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, | 642 | asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, |
643 | compat_ulong_t __user *outp, | 643 | compat_ulong_t __user *outp, |
644 | compat_ulong_t __user *exp, | 644 | compat_ulong_t __user *exp, |
645 | struct compat_timespec __user *tsp, | 645 | struct old_timespec32 __user *tsp, |
646 | void __user *sig); | 646 | void __user *sig); |
647 | asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, | 647 | asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, |
648 | unsigned int nfds, | 648 | unsigned int nfds, |
649 | struct compat_timespec __user *tsp, | 649 | struct old_timespec32 __user *tsp, |
650 | const compat_sigset_t __user *sigmask, | 650 | const compat_sigset_t __user *sigmask, |
651 | compat_size_t sigsetsize); | 651 | compat_size_t sigsetsize); |
652 | 652 | ||
@@ -671,15 +671,15 @@ asmlinkage long compat_sys_newfstat(unsigned int fd, | |||
671 | 671 | ||
672 | /* fs/timerfd.c */ | 672 | /* fs/timerfd.c */ |
673 | asmlinkage long compat_sys_timerfd_gettime(int ufd, | 673 | asmlinkage long compat_sys_timerfd_gettime(int ufd, |
674 | struct compat_itimerspec __user *otmr); | 674 | struct old_itimerspec32 __user *otmr); |
675 | asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, | 675 | asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, |
676 | const struct compat_itimerspec __user *utmr, | 676 | const struct old_itimerspec32 __user *utmr, |
677 | struct compat_itimerspec __user *otmr); | 677 | struct old_itimerspec32 __user *otmr); |
678 | 678 | ||
679 | /* fs/utimes.c */ | 679 | /* fs/utimes.c */ |
680 | asmlinkage long compat_sys_utimensat(unsigned int dfd, | 680 | asmlinkage long compat_sys_utimensat(unsigned int dfd, |
681 | const char __user *filename, | 681 | const char __user *filename, |
682 | struct compat_timespec __user *t, | 682 | struct old_timespec32 __user *t, |
683 | int flags); | 683 | int flags); |
684 | 684 | ||
685 | /* kernel/exit.c */ | 685 | /* kernel/exit.c */ |
@@ -691,7 +691,7 @@ asmlinkage long compat_sys_waitid(int, compat_pid_t, | |||
691 | 691 | ||
692 | /* kernel/futex.c */ | 692 | /* kernel/futex.c */ |
693 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, | 693 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, |
694 | struct compat_timespec __user *utime, u32 __user *uaddr2, | 694 | struct old_timespec32 __user *utime, u32 __user *uaddr2, |
695 | u32 val3); | 695 | u32 val3); |
696 | asmlinkage long | 696 | asmlinkage long |
697 | compat_sys_set_robust_list(struct compat_robust_list_head __user *head, | 697 | compat_sys_set_robust_list(struct compat_robust_list_head __user *head, |
@@ -701,8 +701,8 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, | |||
701 | compat_size_t __user *len_ptr); | 701 | compat_size_t __user *len_ptr); |
702 | 702 | ||
703 | /* kernel/hrtimer.c */ | 703 | /* kernel/hrtimer.c */ |
704 | asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp, | 704 | asmlinkage long compat_sys_nanosleep(struct old_timespec32 __user *rqtp, |
705 | struct compat_timespec __user *rmtp); | 705 | struct old_timespec32 __user *rmtp); |
706 | 706 | ||
707 | /* kernel/itimer.c */ | 707 | /* kernel/itimer.c */ |
708 | asmlinkage long compat_sys_getitimer(int which, | 708 | asmlinkage long compat_sys_getitimer(int which, |
@@ -722,19 +722,19 @@ asmlinkage long compat_sys_timer_create(clockid_t which_clock, | |||
722 | struct compat_sigevent __user *timer_event_spec, | 722 | struct compat_sigevent __user *timer_event_spec, |
723 | timer_t __user *created_timer_id); | 723 | timer_t __user *created_timer_id); |
724 | asmlinkage long compat_sys_timer_gettime(timer_t timer_id, | 724 | asmlinkage long compat_sys_timer_gettime(timer_t timer_id, |
725 | struct compat_itimerspec __user *setting); | 725 | struct old_itimerspec32 __user *setting); |
726 | asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags, | 726 | asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags, |
727 | struct compat_itimerspec __user *new, | 727 | struct old_itimerspec32 __user *new, |
728 | struct compat_itimerspec __user *old); | 728 | struct old_itimerspec32 __user *old); |
729 | asmlinkage long compat_sys_clock_settime(clockid_t which_clock, | 729 | asmlinkage long compat_sys_clock_settime(clockid_t which_clock, |
730 | struct compat_timespec __user *tp); | 730 | struct old_timespec32 __user *tp); |
731 | asmlinkage long compat_sys_clock_gettime(clockid_t which_clock, | 731 | asmlinkage long compat_sys_clock_gettime(clockid_t which_clock, |
732 | struct compat_timespec __user *tp); | 732 | struct old_timespec32 __user *tp); |
733 | asmlinkage long compat_sys_clock_getres(clockid_t which_clock, | 733 | asmlinkage long compat_sys_clock_getres(clockid_t which_clock, |
734 | struct compat_timespec __user *tp); | 734 | struct old_timespec32 __user *tp); |
735 | asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags, | 735 | asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags, |
736 | struct compat_timespec __user *rqtp, | 736 | struct old_timespec32 __user *rqtp, |
737 | struct compat_timespec __user *rmtp); | 737 | struct old_timespec32 __user *rmtp); |
738 | 738 | ||
739 | /* kernel/ptrace.c */ | 739 | /* kernel/ptrace.c */ |
740 | asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, | 740 | asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, |
@@ -748,7 +748,7 @@ asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, | |||
748 | unsigned int len, | 748 | unsigned int len, |
749 | compat_ulong_t __user *user_mask_ptr); | 749 | compat_ulong_t __user *user_mask_ptr); |
750 | asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, | 750 | asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, |
751 | struct compat_timespec __user *interval); | 751 | struct old_timespec32 __user *interval); |
752 | 752 | ||
753 | /* kernel/signal.c */ | 753 | /* kernel/signal.c */ |
754 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, | 754 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, |
@@ -768,7 +768,7 @@ asmlinkage long compat_sys_rt_sigpending(compat_sigset_t __user *uset, | |||
768 | compat_size_t sigsetsize); | 768 | compat_size_t sigsetsize); |
769 | asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese, | 769 | asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese, |
770 | struct compat_siginfo __user *uinfo, | 770 | struct compat_siginfo __user *uinfo, |
771 | struct compat_timespec __user *uts, compat_size_t sigsetsize); | 771 | struct old_timespec32 __user *uts, compat_size_t sigsetsize); |
772 | asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig, | 772 | asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig, |
773 | struct compat_siginfo __user *uinfo); | 773 | struct compat_siginfo __user *uinfo); |
774 | /* No generic prototype for rt_sigreturn */ | 774 | /* No generic prototype for rt_sigreturn */ |
@@ -782,9 +782,9 @@ asmlinkage long compat_sys_setrlimit(unsigned int resource, | |||
782 | asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru); | 782 | asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru); |
783 | 783 | ||
784 | /* kernel/time.c */ | 784 | /* kernel/time.c */ |
785 | asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv, | 785 | asmlinkage long compat_sys_gettimeofday(struct old_timeval32 __user *tv, |
786 | struct timezone __user *tz); | 786 | struct timezone __user *tz); |
787 | asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv, | 787 | asmlinkage long compat_sys_settimeofday(struct old_timeval32 __user *tv, |
788 | struct timezone __user *tz); | 788 | struct timezone __user *tz); |
789 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 789 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
790 | 790 | ||
@@ -798,11 +798,11 @@ asmlinkage long compat_sys_mq_open(const char __user *u_name, | |||
798 | asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, | 798 | asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, |
799 | const char __user *u_msg_ptr, | 799 | const char __user *u_msg_ptr, |
800 | compat_size_t msg_len, unsigned int msg_prio, | 800 | compat_size_t msg_len, unsigned int msg_prio, |
801 | const struct compat_timespec __user *u_abs_timeout); | 801 | const struct old_timespec32 __user *u_abs_timeout); |
802 | asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes, | 802 | asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes, |
803 | char __user *u_msg_ptr, | 803 | char __user *u_msg_ptr, |
804 | compat_size_t msg_len, unsigned int __user *u_msg_prio, | 804 | compat_size_t msg_len, unsigned int __user *u_msg_prio, |
805 | const struct compat_timespec __user *u_abs_timeout); | 805 | const struct old_timespec32 __user *u_abs_timeout); |
806 | asmlinkage long compat_sys_mq_notify(mqd_t mqdes, | 806 | asmlinkage long compat_sys_mq_notify(mqd_t mqdes, |
807 | const struct compat_sigevent __user *u_notification); | 807 | const struct compat_sigevent __user *u_notification); |
808 | asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, | 808 | asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, |
@@ -819,7 +819,7 @@ asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp, | |||
819 | /* ipc/sem.c */ | 819 | /* ipc/sem.c */ |
820 | asmlinkage long compat_sys_semctl(int semid, int semnum, int cmd, int arg); | 820 | asmlinkage long compat_sys_semctl(int semid, int semnum, int cmd, int arg); |
821 | asmlinkage long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, | 821 | asmlinkage long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, |
822 | unsigned nsems, const struct compat_timespec __user *timeout); | 822 | unsigned nsems, const struct old_timespec32 __user *timeout); |
823 | 823 | ||
824 | /* ipc/shm.c */ | 824 | /* ipc/shm.c */ |
825 | asmlinkage long compat_sys_shmctl(int first, int second, void __user *uptr); | 825 | asmlinkage long compat_sys_shmctl(int first, int second, void __user *uptr); |
@@ -876,7 +876,7 @@ asmlinkage long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, | |||
876 | struct compat_siginfo __user *uinfo); | 876 | struct compat_siginfo __user *uinfo); |
877 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | 877 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, |
878 | unsigned vlen, unsigned int flags, | 878 | unsigned vlen, unsigned int flags, |
879 | struct compat_timespec __user *timeout); | 879 | struct old_timespec32 __user *timeout); |
880 | asmlinkage long compat_sys_wait4(compat_pid_t pid, | 880 | asmlinkage long compat_sys_wait4(compat_pid_t pid, |
881 | compat_uint_t __user *stat_addr, int options, | 881 | compat_uint_t __user *stat_addr, int options, |
882 | struct compat_rusage __user *ru); | 882 | struct compat_rusage __user *ru); |
@@ -928,7 +928,7 @@ asmlinkage long compat_sys_pwritev64v2(unsigned long fd, | |||
928 | asmlinkage long compat_sys_open(const char __user *filename, int flags, | 928 | asmlinkage long compat_sys_open(const char __user *filename, int flags, |
929 | umode_t mode); | 929 | umode_t mode); |
930 | asmlinkage long compat_sys_utimes(const char __user *filename, | 930 | asmlinkage long compat_sys_utimes(const char __user *filename, |
931 | struct compat_timeval __user *t); | 931 | struct old_timeval32 __user *t); |
932 | 932 | ||
933 | /* __ARCH_WANT_SYSCALL_NO_FLAGS */ | 933 | /* __ARCH_WANT_SYSCALL_NO_FLAGS */ |
934 | asmlinkage long compat_sys_signalfd(int ufd, | 934 | asmlinkage long compat_sys_signalfd(int ufd, |
@@ -942,15 +942,15 @@ asmlinkage long compat_sys_newlstat(const char __user *filename, | |||
942 | struct compat_stat __user *statbuf); | 942 | struct compat_stat __user *statbuf); |
943 | 943 | ||
944 | /* __ARCH_WANT_SYSCALL_DEPRECATED */ | 944 | /* __ARCH_WANT_SYSCALL_DEPRECATED */ |
945 | asmlinkage long compat_sys_time(compat_time_t __user *tloc); | 945 | asmlinkage long compat_sys_time(old_time32_t __user *tloc); |
946 | asmlinkage long compat_sys_utime(const char __user *filename, | 946 | asmlinkage long compat_sys_utime(const char __user *filename, |
947 | struct compat_utimbuf __user *t); | 947 | struct compat_utimbuf __user *t); |
948 | asmlinkage long compat_sys_futimesat(unsigned int dfd, | 948 | asmlinkage long compat_sys_futimesat(unsigned int dfd, |
949 | const char __user *filename, | 949 | const char __user *filename, |
950 | struct compat_timeval __user *t); | 950 | struct old_timeval32 __user *t); |
951 | asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | 951 | asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, |
952 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 952 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
953 | struct compat_timeval __user *tvp); | 953 | struct old_timeval32 __user *tvp); |
954 | asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32); | 954 | asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32); |
955 | asmlinkage long compat_sys_recv(int fd, void __user *buf, compat_size_t len, | 955 | asmlinkage long compat_sys_recv(int fd, void __user *buf, compat_size_t len, |
956 | unsigned flags); | 956 | unsigned flags); |
@@ -983,7 +983,7 @@ asmlinkage long compat_sys_sigaction(int sig, | |||
983 | #endif | 983 | #endif |
984 | 984 | ||
985 | /* obsolete: kernel/time/time.c */ | 985 | /* obsolete: kernel/time/time.c */ |
986 | asmlinkage long compat_sys_stime(compat_time_t __user *tptr); | 986 | asmlinkage long compat_sys_stime(old_time32_t __user *tptr); |
987 | 987 | ||
988 | /* obsolete: net/socket.c */ | 988 | /* obsolete: net/socket.c */ |
989 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args); | 989 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args); |
@@ -1002,15 +1002,15 @@ static inline bool in_compat_syscall(void) { return is_compat_task(); } | |||
1002 | #endif | 1002 | #endif |
1003 | 1003 | ||
1004 | /** | 1004 | /** |
1005 | * ns_to_compat_timeval - Compat version of ns_to_timeval | 1005 | * ns_to_old_timeval32 - Compat version of ns_to_timeval |
1006 | * @nsec: the nanoseconds value to be converted | 1006 | * @nsec: the nanoseconds value to be converted |
1007 | * | 1007 | * |
1008 | * Returns the compat_timeval representation of the nsec parameter. | 1008 | * Returns the old_timeval32 representation of the nsec parameter. |
1009 | */ | 1009 | */ |
1010 | static inline struct compat_timeval ns_to_compat_timeval(s64 nsec) | 1010 | static inline struct old_timeval32 ns_to_old_timeval32(s64 nsec) |
1011 | { | 1011 | { |
1012 | struct timeval tv; | 1012 | struct timeval tv; |
1013 | struct compat_timeval ctv; | 1013 | struct old_timeval32 ctv; |
1014 | 1014 | ||
1015 | tv = ns_to_timeval(nsec); | 1015 | tv = ns_to_timeval(nsec); |
1016 | ctv.tv_sec = tv.tv_sec; | 1016 | ctv.tv_sec = tv.tv_sec; |