Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004, 2007
00002    Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #ifndef _LINUX_ALPHA_SYSDEP_H
00022 #define _LINUX_ALPHA_SYSDEP_H 1
00023 
00024 #ifdef __ASSEMBLER__
00025 #include <asm/pal.h>
00026 #include <alpha/regdef.h>
00027 #endif
00028 
00029 /* There is some commonality.  */
00030 #include <sysdeps/unix/alpha/sysdep.h>
00031 
00032 #include <tls.h>
00033 
00034 /* For Linux we can use the system call table in the header file
00035        /usr/include/asm/unistd.h
00036    of the kernel.  But these symbols do not follow the SYS_* syntax
00037    so we have to redefine the `SYS_ify' macro here.  */
00038 #undef SYS_ify
00039 #ifdef __STDC__
00040 # define SYS_ify(syscall_name)     __NR_##syscall_name
00041 #else
00042 # define SYS_ify(syscall_name)     __NR_syscall_name
00043 #endif
00044 
00045 /* Define some aliases to make automatic syscall generation work
00046    properly.  The SYS_* variants are for the benefit of the files in
00047    sysdeps/unix.  */
00048 #define __NR_getpid  __NR_getxpid
00049 #define __NR_getuid  __NR_getxuid
00050 #define __NR_getgid  __NR_getxgid
00051 #define SYS_getpid   __NR_getxpid
00052 #define SYS_getuid   __NR_getxuid
00053 #define SYS_getgid   __NR_getxgid
00054 
00055 /*
00056  * Some syscalls no Linux program should know about:
00057  */
00058 #define __NR_osf_sigprocmask        48
00059 #define __NR_osf_shmat             209
00060 #define __NR_osf_getsysinfo 256
00061 #define __NR_osf_setsysinfo 257
00062 
00063 /* Help old kernel headers where particular syscalls are not available.  */
00064 #ifndef __NR_semtimedop
00065 # define __NR_semtimedop    423
00066 #endif
00067 
00068 /* This is a kludge to make syscalls.list find these under the names
00069    pread and pwrite, since some kernel headers define those names
00070    and some define the *64 names for the same system calls.  */
00071 #if !defined __NR_pread && defined __NR_pread64
00072 # define __NR_pread __NR_pread64
00073 #endif
00074 #if !defined __NR_pwrite && defined __NR_pwrite64
00075 # define __NR_pwrite __NR_pwrite64
00076 #endif
00077 
00078 /*
00079  * In order to get the hidden arguments for rt_sigaction set up
00080  * properly, we need to call the assembly version.  This shouldn't
00081  * happen except for inside sigaction.c, where we handle this
00082  * specially.  Catch other uses and error.
00083  */
00084 
00085 #undef INLINE_SYSCALL
00086 #define INLINE_SYSCALL(name, nr, args...)                      \
00087 ({                                                             \
00088        extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]   \
00089          __attribute__((unused));                              \
00090        INLINE_SYSCALL1(name, nr, args);                        \
00091 })
00092 
00093 #undef INTERNAL_SYSCALL
00094 #define INTERNAL_SYSCALL(name, err_out, nr, args...)                  \
00095 ({                                                             \
00096        extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]   \
00097          __attribute__((unused));                              \
00098        INTERNAL_SYSCALL1(name, err_out, nr, args);                    \
00099 })
00100 
00101 #endif /* _LINUX_ALPHA_SYSDEP_H */