Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* Copyright (C) 1993, 1994, 1995, 1997, 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/unix/sysdep.h>
00020 
00021 #ifdef __ASSEMBLER__
00022 
00023 #ifdef NO_UNDERSCORES
00024 /* Since C identifiers are not normally prefixed with an underscore
00025    on this system, the asm identifier `syscall_error' intrudes on the
00026    C name space.  Make sure we use an innocuous name.  */
00027 #define       syscall_error C_SYMBOL_NAME(__syscall_error)
00028 #endif
00029 
00030 #ifdef HAVE_ELF
00031 #define       ENTRY(name)          \
00032   .global C_SYMBOL_NAME(name);     \
00033   .type name,@function;            \
00034   .align 4;                 \
00035   C_LABEL(name)
00036 
00037 #else
00038 #define       ENTRY(name)          \
00039   .global C_SYMBOL_NAME(name);     \
00040   .align 4;                 \
00041   C_LABEL(name)
00042 
00043 #endif /* HAVE_ELF */
00044 
00045 #define       PSEUDO(name, syscall_name, args)   \
00046   .global syscall_error;                  \
00047   ENTRY (name)                                   \
00048   mov SYS_ify(syscall_name), %g1;         \
00049   ta 0;                                          \
00050   bcc 1f;                                 \
00051   sethi %hi(syscall_error), %g1;          \
00052   jmp %g1 + %lo(syscall_error);    nop;          \
00053 1:
00054 
00055 #define       PSEUDO_NOERRNO(name, syscall_name, args) \
00056   .global syscall_error;                  \
00057   ENTRY (name)                                   \
00058   mov SYS_ify(syscall_name), %g1;         \
00059   ta 0
00060 
00061 #define       PSEUDO_ERRVAL(name, syscall_name, args) \
00062   .global syscall_error;                  \
00063   ENTRY (name)                                   \
00064   mov SYS_ify(syscall_name), %g1;         \
00065   ta 0
00066 
00067 #define       ret           retl; nop
00068 #define       ret_NOERRNO   retl; nop
00069 #define       ret_ERRVAL    retl; nop
00070 #define       r0            %o0
00071 #define       r1            %o1
00072 #define       MOVE(x,y)     mov x, y
00073 
00074 #endif /* __ASSEMBLER__ */