This source file includes following definitions.
- sys_getpagesize
- sparc_pipe
- sys_ipc
1
2
3
4
5
6
7
8
9 #include <linux/errno.h>
10 #include <linux/sched.h>
11 #include <linux/mm.h>
12 #include <linux/sem.h>
13 #include <linux/msg.h>
14 #include <linux/shm.h>
15 #include <linux/stat.h>
16 #include <linux/mman.h>
17
18 #include <asm/segment.h>
19
20
21
22
23 asmlinkage unsigned long sys_getpagesize(void)
24 {
25 return PAGE_SIZE;
26 }
27
28
29
30
31
32 asmlinkage void sparc_pipe(struct pt_regs *regs)
33 {
34 int fd[2];
35 int error;
36
37 error = do_pipe(fd);
38 if (error) {
39 regs->u_regs[UREG_I0] = error;
40 } else {
41 regs->u_regs[UREG_I0] = fd[0];
42 regs->u_regs[UREG_I1] = fd[1];
43 }
44 }
45
46
47
48
49
50
51 asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr, long fifth)
52 {
53 int version;
54
55 version = call >> 16;
56 call &= 0xffff;
57
58 if (call <= SEMCTL)
59 switch (call) {
60 case SEMOP:
61 return sys_semop (first, (struct sembuf *)ptr, second);
62 case SEMGET:
63 return sys_semget (first, second, third);
64 case SEMCTL: {
65 union semun fourth;
66 int err;
67 if (!ptr)
68 return -EINVAL;
69 if ((err = verify_area (VERIFY_READ, ptr, sizeof(long))))
70 return err;
71 fourth.__pad = (void *) get_fs_long(ptr);
72 return sys_semctl (first, second, third, fourth);
73 }
74 default:
75 return -EINVAL;
76 }
77 if (call <= MSGCTL)
78 switch (call) {
79 case MSGSND:
80 return sys_msgsnd (first, (struct msgbuf *) ptr,
81 second, third);
82 case MSGRCV:
83 switch (version) {
84 case 0: {
85 struct ipc_kludge tmp;
86 int err;
87 if (!ptr)
88 return -EINVAL;
89 if ((err = verify_area (VERIFY_READ, ptr, sizeof(tmp))))
90 return err;
91 memcpy_fromfs (&tmp,(struct ipc_kludge *) ptr,
92 sizeof (tmp));
93 return sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp, third);
94 }
95 case 1: default:
96 return sys_msgrcv (first, (struct msgbuf *) ptr, second, fifth, third);
97 }
98 case MSGGET:
99 return sys_msgget ((key_t) first, second);
100 case MSGCTL:
101 return sys_msgctl (first, second, (struct msqid_ds *) ptr);
102 default:
103 return -EINVAL;
104 }
105 if (call <= SHMCTL)
106 switch (call) {
107 case SHMAT:
108 switch (version) {
109 case 0: default: {
110 ulong raddr;
111 int err;
112 if ((err = verify_area(VERIFY_WRITE, (ulong*) third, sizeof(ulong))))
113 return err;
114 err = sys_shmat (first, (char *) ptr, second, &raddr);
115 if (err)
116 return err;
117 put_fs_long (raddr, (ulong *) third);
118 return 0;
119 }
120 case 1:
121 if (get_fs() != get_ds())
122 return -EINVAL;
123 return sys_shmat (first, (char *) ptr, second, (ulong *) third);
124 }
125 case SHMDT:
126 return sys_shmdt ((char *)ptr);
127 case SHMGET:
128 return sys_shmget (first, second, third);
129 case SHMCTL:
130 return sys_shmctl (first, second, (struct shmid_ds *) ptr);
131 default:
132 return -EINVAL;
133 }
134 return -EINVAL;
135 }