Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* Copyright (C) 1991, 92, 93, 96, 98, 2003 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #include <sysdeps/generic/sysdep.h>
00020 
00021 #include <sys/syscall.h>
00022 #define       HAVE_SYSCALLS
00023 
00024 /* Note that using a `PASTE' macro loses.  */
00025 #ifdef __STDC__
00026 #define       SYSCALL__(name, args)       PSEUDO (__##name, name, args)
00027 #else
00028 #define       SYSCALL__(name, args)       PSEUDO (__name, name, args)
00029 #endif
00030 #define       SYSCALL(name, args)  PSEUDO (name, name, args)
00031 
00032 /* Machine-dependent sysdep.h files are expected to define the macro
00033    PSEUDO (function_name, syscall_name) to emit assembly code to define the
00034    C-callable function FUNCTION_NAME to do system call SYSCALL_NAME.
00035    r0 and r1 are the system call outputs.  MOVE(x, y) should be defined as
00036    an instruction such that "MOVE(r1, r0)" works.  ret should be defined
00037    as the return instruction.  */
00038 
00039 #ifdef __STDC__
00040 #define SYS_ify(syscall_name) SYS_##syscall_name
00041 #else
00042 #define SYS_ify(syscall_name) SYS_syscall_name
00043 #endif
00044 
00045 /* Terminate a system call named SYM.  This is used on some platforms
00046    to generate correct debugging information.  */
00047 #ifndef PSEUDO_END
00048 #define PSEUDO_END(sym)
00049 #endif
00050 #ifndef PSEUDO_END_NOERRNO
00051 #define PSEUDO_END_NOERRNO(sym)    PSEUDO_END(sym)
00052 #endif
00053 #ifndef PSEUDO_END_ERRVAL
00054 #define PSEUDO_END_ERRVAL(sym)     PSEUDO_END(sym)
00055 #endif
00056 
00057 /* Wrappers around system calls should normally inline the system call code.
00058    But sometimes it is not possible or implemented and we use this code.  */
00059 #define INLINE_SYSCALL(name, nr, args...) __syscall_##name (args)