Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* Copyright (C) 1993, 1994, 1995, 1997 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 #define       POUND  #
00024 
00025 #ifdef __STDC__
00026 #define       ENTRY(name)                                                   \
00027   .globl _##name;                                                    \
00028   .even;                                                             \
00029   _##name##:
00030 #else
00031 #define       ENTRY(name)                                                   \
00032   .globl _name;                                                      \
00033   .even;                                                             \
00034   _name:
00035 #endif
00036 
00037 #define       PSEUDO(name, syscall_name, args)                              \
00038   .even;                                                             \
00039   .globl syscall_error;                                                     \
00040   error: jmp syscall_error;                                          \
00041   ENTRY (name)                                                              \
00042   DO_CALL (POUND SYS_ify (syscall_name), args)
00043 
00044 #define DO_CALL(syscall, args)                                              \
00045   movel syscall, d0;                                                 \
00046   linkw a6, POUND(0);                                                       \
00047   trap POUND(0);                                                     \
00048   unlk a6;                                                           \
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