source: svn/trunk/newcon3bcm2_21bu/toolchain/mipsel-linux-uclibc/include/linux/compat.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 3.1 KB
Line 
1#ifndef _LINUX_COMPAT_H
2#define _LINUX_COMPAT_H
3/*
4 * These are the type definitions for the architecture specific
5 * syscall compatibility layer.
6 */
7
8#ifdef CONFIG_COMPAT
9
10#include <linux/param.h>        /* for HZ */
11#include <linux/sem.h>
12
13#include <asm/compat.h>
14#include <asm/siginfo.h>
15
16#define compat_jiffies_to_clock_t(x)    \
17                (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
18
19struct rusage;
20
21struct compat_itimerspec { 
22        struct compat_timespec it_interval;
23        struct compat_timespec it_value;
24};
25
26struct compat_utimbuf {
27        compat_time_t           actime;
28        compat_time_t           modtime;
29};
30
31struct compat_itimerval {
32        struct compat_timeval   it_interval;
33        struct compat_timeval   it_value;
34};
35
36struct compat_tms {
37        compat_clock_t          tms_utime;
38        compat_clock_t          tms_stime;
39        compat_clock_t          tms_cutime;
40        compat_clock_t          tms_cstime;
41};
42
43#define _COMPAT_NSIG_WORDS      (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
44
45typedef struct {
46        compat_sigset_word      sig[_COMPAT_NSIG_WORDS];
47} compat_sigset_t;
48
49extern int cp_compat_stat(struct kstat *, struct compat_stat *);
50extern int get_compat_timespec(struct timespec *, const struct compat_timespec *);
51extern int put_compat_timespec(const struct timespec *, struct compat_timespec *);
52
53struct compat_iovec {
54        compat_uptr_t   iov_base;
55        compat_size_t   iov_len;
56};
57
58struct compat_rlimit {
59        compat_ulong_t  rlim_cur;
60        compat_ulong_t  rlim_max;
61};
62
63struct compat_rusage {
64        struct compat_timeval ru_utime;
65        struct compat_timeval ru_stime;
66        compat_long_t   ru_maxrss;
67        compat_long_t   ru_ixrss;
68        compat_long_t   ru_idrss;
69        compat_long_t   ru_isrss;
70        compat_long_t   ru_minflt;
71        compat_long_t   ru_majflt;
72        compat_long_t   ru_nswap;
73        compat_long_t   ru_inblock;
74        compat_long_t   ru_oublock;
75        compat_long_t   ru_msgsnd;
76        compat_long_t   ru_msgrcv;
77        compat_long_t   ru_nsignals;
78        compat_long_t   ru_nvcsw;
79        compat_long_t   ru_nivcsw;
80};
81
82struct compat_siginfo;
83
84extern asmlinkage long compat_sys_waitid(int, compat_pid_t,
85                struct compat_siginfo *, int,
86                struct compat_rusage *);
87
88struct compat_dirent {
89        __u32           d_ino;
90        compat_off_t    d_off;
91        __u16           d_reclen;
92        char            d_name[256];
93};
94
95typedef union compat_sigval {
96        compat_int_t    sival_int;
97        compat_uptr_t   sival_ptr;
98} compat_sigval_t;
99
100#define COMPAT_SIGEV_PAD_SIZE   ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
101
102typedef struct compat_sigevent {
103        compat_sigval_t sigev_value;
104        compat_int_t sigev_signo;
105        compat_int_t sigev_notify;
106        union {
107                compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE];
108                compat_int_t _tid;
109
110                struct {
111                        compat_uptr_t _function;
112                        compat_uptr_t _attribute;
113                } _sigev_thread;
114        } _sigev_un;
115} compat_sigevent_t;
116
117
118long compat_sys_semctl(int first, int second, int third, void *uptr);
119long compat_sys_msgsnd(int first, int second, int third, void *uptr);
120long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
121                int version, void *uptr);
122long compat_sys_msgctl(int first, int second, void *uptr);
123long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
124                void *uptr);
125long compat_sys_shmctl(int first, int second, void *uptr);
126long compat_sys_semtimedop(int semid, struct sembuf *tsems,
127                unsigned nsems, const struct compat_timespec *timeout);
128#endif /* CONFIG_COMPAT */
129#endif /* _LINUX_COMPAT_H */
Note: See TracBrowser for help on using the repository browser.