OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [uclinux/] [uClinux-2.0.x/] [include/] [asm-alpha/] [unistd.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#ifndef _ALPHA_UNISTD_H
2
#define _ALPHA_UNISTD_H
3
 
4
#define __NR_exit                 1
5
#define __NR_fork                 2
6
#define __NR_read                 3
7
#define __NR_write                4
8
#define __NR_close                6
9
#define __NR_wait4                7
10
#define __NR_link                 9
11
#define __NR_unlink              10
12
#define __NR_chdir               12
13
#define __NR_fchdir              13
14
#define __NR_mknod               14
15
#define __NR_chmod               15
16
#define __NR_chown               16
17
#define __NR_brk                 17
18
#define __NR_lseek               19
19
#define __NR_getxpid             20
20
#define __NR_setuid              23
21
#define __NR_getxuid             24
22
#define __NR_ptrace              26
23
#define __NR_access              33
24
#define __NR_sync                36
25
#define __NR_kill                37
26
#define __NR_setpgid             39
27
#define __NR_dup                 41
28
#define __NR_pipe                42
29
#define __NR_open                45
30
#define __NR_getxgid             47
31
#define __NR_acct                51
32
#define __NR_sigpending          52
33
#define __NR_ioctl               54
34
#define __NR_symlink             57
35
#define __NR_readlink            58
36
#define __NR_execve              59
37
#define __NR_umask               60
38
#define __NR_chroot              61
39
#define __NR_getpgrp             63
40
#define __NR_getpagesize         64
41
#define __NR_stat                67
42
#define __NR_lstat               68
43
#define __NR_mmap                71     /* OSF/1 mmap is superset of Linux */
44
#define __NR_munmap              73
45
#define __NR_mprotect            74
46
#define __NR_madvise             75
47
#define __NR_vhangup             76
48
#define __NR_getgroups           79
49
#define __NR_setgroups           80
50
#define __NR_setpgrp             82     /* BSD alias for setpgid */
51
#define __NR_setitimer           83
52
#define __NR_getitimer           86
53
#define __NR_gethostname         87
54
#define __NR_sethostname         88
55
#define __NR_getdtablesize       89
56
#define __NR_dup2                90
57
#define __NR_fstat               91
58
#define __NR_fcntl               92
59
#define __NR_select              93
60
#define __NR_fsync               95
61
#define __NR_setpriority         96
62
#define __NR_socket              97
63
#define __NR_connect             98
64
#define __NR_accept              99
65
#define __NR_getpriority        100
66
#define __NR_send               101
67
#define __NR_recv               102
68
#define __NR_sigreturn          103
69
#define __NR_bind               104
70
#define __NR_setsockopt         105
71
#define __NR_listen             106
72
#define __NR_sigsuspend         111
73
#define __NR_recvmsg            113
74
#define __NR_sendmsg            114
75
#define __NR_gettimeofday       116
76
#define __NR_getrusage          117
77
#define __NR_getsockopt         118
78
#define __NR_readv              120
79
#define __NR_writev             121
80
#define __NR_settimeofday       122
81
#define __NR_fchown             123
82
#define __NR_fchmod             124
83
#define __NR_recvfrom           125
84
#define __NR_setreuid           126
85
#define __NR_setregid           127
86
#define __NR_rename             128
87
#define __NR_truncate           129
88
#define __NR_ftruncate          130
89
#define __NR_flock              131
90
#define __NR_setgid             132
91
#define __NR_sendto             133
92
#define __NR_shutdown           134
93
#define __NR_socketpair         135
94
#define __NR_mkdir              136
95
#define __NR_rmdir              137
96
#define __NR_utimes             138
97
#define __NR_getpeername        141
98
#define __NR_getrlimit          144
99
#define __NR_setrlimit          145
100
#define __NR_setsid             147
101
#define __NR_quotactl           148
102
#define __NR_getsockname        150
103
#define __NR_sigaction          156
104
#define __NR_setdomainname      166
105
#define __NR_msgctl             200
106
#define __NR_msgget             201
107
#define __NR_msgrcv             202
108
#define __NR_msgsnd             203
109
#define __NR_semctl             204
110
#define __NR_semget             205
111
#define __NR_semop              206
112
#define __NR_shmctl             210
113
#define __NR_shmdt              211
114
#define __NR_shmget             212
115
 
116
#define __NR_msync              217
117
 
118
#define __NR_getpgid            233
119
#define __NR_getsid             234
120
 
121
#define __NR_sysfs              254
122
 
123
/*
124
 * Linux-specific system calls begin at 300
125
 */
126
#define __NR_bdflush            300
127
#define __NR_sethae             301
128
#define __NR_mount              302
129
#define __NR_adjtimex           303
130
#define __NR_swapoff            304
131
#define __NR_getdents           305
132
#define __NR_create_module      306
133
#define __NR_init_module        307
134
#define __NR_delete_module      308
135
#define __NR_get_kernel_syms    309
136
#define __NR_syslog             310
137
#define __NR_reboot             311
138
#define __NR_clone              312
139
#define __NR_uselib             313
140
#define __NR_mlock              314
141
#define __NR_munlock            315
142
#define __NR_mlockall           316
143
#define __NR_munlockall         317
144
#define __NR_sysinfo            318
145
#define __NR__sysctl            319
146
#define __NR_idle               320
147
#define __NR_umount             321
148
#define __NR_swapon             322
149
#define __NR_times              323
150
#define __NR_personality        324
151
#define __NR_setfsuid           325
152
#define __NR_setfsgid           326
153
#define __NR_ustat              327
154
#define __NR_statfs             328
155
#define __NR_fstatfs            329
156
#define __NR_sched_setparam             330
157
#define __NR_sched_getparam             331
158
#define __NR_sched_setscheduler         332
159
#define __NR_sched_getscheduler         333
160
#define __NR_sched_yield                334
161
#define __NR_sched_get_priority_max     335
162
#define __NR_sched_get_priority_min     336
163
#define __NR_sched_rr_get_interval      337
164
#define __NR_afs_syscall                338
165
#define __NR_uname                      339
166
#define __NR_nanosleep                  340
167
#define __NR_mremap                     341
168
#define __NR_nfsctl                     342
169
#define __NR_setresuid                  343
170
#define __NR_getresuid                  344
171
#define __NR_pciconfig_read             345
172
#define __NR_pciconfig_write            346
173
 
174
#if defined(__LIBRARY__) && defined(__GNUC__)
175
 
176
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
177
#define _syscall0(type, name)                                           \
178
type name(void)                                                         \
179
{                                                                       \
180
        extern long syscall (int, ...);                                 \
181
        return syscall(__NR_##name));                                   \
182
}
183
 
184
#define _syscall1(type,name,type1,arg1)                                 \
185
type name(type1 arg1)                                                   \
186
{                                                                       \
187
        extern long syscall (int, ...);                                 \
188
        return syscall(__NR_##name, arg1);                              \
189
}
190
 
191
#define _syscall2(type,name,type1,arg1,type2,arg2)                      \
192
type name(type1 arg1,type2 arg2)                                        \
193
{                                                                       \
194
        extern long syscall (int, ...);                                 \
195
        return syscall(__NR_##name, arg1, arg2);                                \
196
}
197
 
198
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3)           \
199
type name(type1 arg1,type2 arg2,type3 arg3)                             \
200
{                                                                       \
201
        extern long syscall (int, ...);                                 \
202
        return syscall(__NR_##name, arg1, arg2, arg3);                  \
203
}
204
 
205
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
206
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4)               \
207
{                                                                        \
208
        extern long syscall (int, ...);                                  \
209
        return syscall(__NR_##name, arg1, arg2, arg3, arg4);             \
210
}
211
 
212
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
213
          type5,arg5)                                                    \
214
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5)       \
215
{                                                                        \
216
        extern long syscall (int, ...);                                  \
217
        return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5);       \
218
}
219
 
220
#endif /* __LIBRARY__ && __GNUC__ */
221
 
222
#ifdef __KERNEL_SYSCALLS__
223
 
224
#include <linux/string.h>
225
#include <linux/signal.h>
226
 
227
extern long __kernel_thread(unsigned long, int (*)(void *), void *);
228
 
229
static inline long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
230
{
231
        return __kernel_thread(flags | CLONE_VM, fn, arg);
232
}
233
 
234
extern void sys_idle(void);
235
static inline void idle(void)
236
{
237
        sys_idle();
238
}
239
 
240
extern int sys_setup(void);
241
static inline int setup(void)
242
{
243
        return sys_setup();
244
}
245
 
246
extern int sys_open(const char *, int, int);
247
static inline int open(const char * name, int mode, int flags)
248
{
249
        return sys_open(name, mode, flags);
250
}
251
 
252
extern int sys_dup(int);
253
static inline int dup(int fd)
254
{
255
        return sys_dup(fd);
256
}
257
 
258
static inline int close(int fd)
259
{
260
        return sys_close(fd);
261
}
262
 
263
extern int sys_exit(int);
264
static inline int _exit(int value)
265
{
266
        return sys_exit(value);
267
}
268
 
269
#define exit(x) _exit(x)
270
 
271
extern int sys_write(int, const char *, int);
272
static inline int write(int fd, const char * buf, int nr)
273
{
274
        return sys_write(fd, buf, nr);
275
}
276
 
277
extern int sys_read(unsigned int, char *, int);
278
static inline int read(unsigned int fd, char * buf, int nr)
279
{
280
        return sys_read(fd, buf, nr);
281
}
282
 
283
extern int do_execve(char *, char **, char **, struct pt_regs *);
284
extern void ret_from_sys_call(void);
285
static inline int execve(char * file, char ** argvp, char ** envp)
286
{
287
        int i;
288
        struct pt_regs regs;
289
 
290
        memset(&regs, 0, sizeof(regs));
291
        i = do_execve(file, argvp, envp, &regs);
292
        if (!i) {
293
                __asm__ __volatile__("bis %0,%0,$30\n\t"
294
                                "bis %1,%1,$26\n\t"
295
                                "ret $31,($26),1\n\t"
296
                                : :"r" (&regs), "r" (ret_from_sys_call));
297
        }
298
        return -1;
299
}
300
 
301
extern int sys_setsid(void);
302
static inline int setsid(void)
303
{
304
        return sys_setsid();
305
}
306
 
307
extern int sys_sync(void);
308
static inline int sync(void)
309
{
310
        return sys_sync();
311
}
312
 
313
extern int sys_wait4(int, int *, int, struct rusage *);
314
static inline pid_t waitpid(int pid, int * wait_stat, int flags)
315
{
316
        return sys_wait4(pid, wait_stat, flags, NULL);
317
}
318
 
319
static inline pid_t wait(int * wait_stat)
320
{
321
        return waitpid(-1,wait_stat,0);
322
}
323
 
324
#endif
325
 
326
#endif /* _ALPHA_UNISTD_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.