c3de78f4bb1fa67abe9226c238ec0b38eee09442
[platform/upstream/glibc.git] / sysdeps / unix / sysv / linux / alpha / sysdep.h
1 /* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004
2    Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4    Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
5
6    The GNU C Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The GNU C Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the GNU C Library; if not, write to the Free
18    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 #ifndef _LINUX_ALPHA_SYSDEP_H
22 #define _LINUX_ALPHA_SYSDEP_H 1
23
24 #ifdef __ASSEMBLER__
25
26 #include <asm/pal.h>
27 #include <alpha/regdef.h>
28
29 #endif
30
31 /* There is some commonality.  */
32 #include <sysdeps/unix/alpha/sysdep.h>
33
34 /* For Linux we can use the system call table in the header file
35         /usr/include/asm/unistd.h
36    of the kernel.  But these symbols do not follow the SYS_* syntax
37    so we have to redefine the `SYS_ify' macro here.  */
38 #undef SYS_ify
39 #ifdef __STDC__
40 # define SYS_ify(syscall_name)  __NR_##syscall_name
41 #else
42 # define SYS_ify(syscall_name)  __NR_/**/syscall_name
43 #endif
44
45 /* Define some aliases to make automatic syscall generation work
46    properly.  The SYS_* variants are for the benefit of the files in
47    sysdeps/unix.  */
48 #define __NR_getpid     __NR_getxpid
49 #define __NR_getuid     __NR_getxuid
50 #define __NR_getgid     __NR_getxgid
51 #define SYS_getpid      __NR_getxpid
52 #define SYS_getuid      __NR_getxuid
53 #define SYS_getgid      __NR_getxgid
54
55 /*
56  * Some syscalls no Linux program should know about:
57  */
58 #define __NR_osf_sigprocmask     48
59 #define __NR_osf_shmat          209
60 #define __NR_osf_getsysinfo     256
61 #define __NR_osf_setsysinfo     257
62
63 /* Help old kernel headers where particular syscalls are not available.  */
64 #ifndef __NR_semtimedop
65 # define __NR_semtimedop        423
66 #endif
67
68 /* This is a kludge to make syscalls.list find these under the names
69    pread and pwrite, since some kernel headers define those names
70    and some define the *64 names for the same system calls.  */
71 #if !defined __NR_pread && defined __NR_pread64
72 # define __NR_pread __NR_pread64
73 #endif
74 #if !defined __NR_pwrite && defined __NR_pwrite64
75 # define __NR_pwrite __NR_pwrite64
76 #endif
77
78 /*
79  * In order to get the hidden arguments for rt_sigaction set up
80  * properly, we need to call the assembly version.  This shouldn't
81  * happen except for inside sigaction.c, where we handle this
82  * specially.  Catch other uses and error.
83  */
84
85 #undef INLINE_SYSCALL
86 #define INLINE_SYSCALL(name, nr, args...)                               \
87 ({                                                                      \
88         extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]    \
89           __attribute__((unused));                                      \
90         INLINE_SYSCALL1(name, nr, args);                                \
91 })
92
93 #undef INTERNAL_SYSCALL
94 #define INTERNAL_SYSCALL(name, err_out, nr, args...)                    \
95 ({                                                                      \
96         extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]    \
97           __attribute__((unused));                                      \
98         INTERNAL_SYSCALL1(name, err_out, nr, args);                     \
99 })
100
101 #endif /* _LINUX_ALPHA_SYSDEP_H */