Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* Copyright (C) 1991, 92, 93, 94, 95, 97 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 /* This code wants to be run through m4.  */
00020 
00021 #include <sysdeps/unix/sysdep.h>
00022 
00023 #ifdef __ASSEMBLER__
00024 
00025 #define       POUND  #
00026 
00027 #ifdef __STDC__
00028 #define       ENTRY(name)                                                   \
00029   .globl _##name;                                                    \
00030   .even;                                                             \
00031   _##name##:
00032 #else
00033 #define       ENTRY(name)                                                   \
00034   .globl _name;                                                      \
00035   .even;                                                             \
00036   _name:
00037 #endif
00038 
00039 #define       PSEUDO(name, syscall_name, args)                              \
00040   .even;                                                             \
00041   .globl syscall_error;                                                     \
00042   error: jmp syscall_error;                                          \
00043   ENTRY (name)                                                              \
00044   DO_CALL (POUND SYS_ify (syscall_name), args)
00045 
00046 #define DO_CALL(syscall, args)                                              \
00047   movel syscall, d0;                                                 \
00048   trap POUND 0;                                                             \
00049   bcs error
00050 
00051 #define       ret    rts
00052 #define       r0     d0
00053 #define       r1     d1
00054 #define       MOVE(x,y)     movel x , y
00055 
00056 #endif /* __ASSEMBLER__ */