home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / LIBC / LIBC-4.6 / LIBC-4 / libc-linux / sysdeps / linux / sysdep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-25  |  2.2 KB  |  66 lines

  1. /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #include <sys/syscall.h>
  20.  
  21. /* Not that using a `PASTE' macro loses.  */
  22. #ifdef    __STDC__
  23.  
  24. #ifdef __ELF__
  25. /* Use the regular ELF conventions about underscores, and provide the
  26.    weak symbol, as required */
  27. #define    SYSCALL__(name,args)    PSEUDO (__##name, name, args) \
  28. .weak name;  \
  29.   name = __##name; \
  30. .type name,@function; \
  31. .type __##name,@function; \
  32. .L__##name##end: .size __##name,.L__##name##end - __##name
  33.  
  34. #define    SYSCALL(name,args)    PSEUDO (name, name, args) \
  35. .type name,@function; \
  36. .L_##name##end: .size name,.L_##name##end - name
  37.  
  38. #else /* __ELF__ */
  39.  
  40. /* Regular a.out definition */
  41. #define    SYSCALL__(name,args)    PSEUDO (__##name, name, args)
  42. #define    SYSCALL(name,args)    PSEUDO (name, name, args)
  43.  
  44. #endif /* __ELF__ */
  45.  
  46. #else  /* __STDC__ */
  47.  
  48. #define    SYSCALL__(name,args)    PSEUDO (__/**/name, name, args)
  49. #define    SYSCALL(name,args)    PSEUDO (name, name, args)
  50.  
  51. #endif /* __STDC__ */
  52.  
  53. /* Machine-dependent sysdep.h files are expected to define the macro
  54.    PSEUDO (function_name, syscall_name) to emit assembly code to define the
  55.    C-callable function FUNCTION_NAME to do system call SYSCALL_NAME.
  56.    r0 and r1 are the system call outputs.  movl should be defined as
  57.    an instruction such that "movl r1, r0" works.  ret should be defined
  58.    as the return instruction.  */
  59.  
  60.  
  61. #if !defined(HAVE_GNU_LD) && !defined (__ELF__)
  62. #define     ___errno    _errno
  63. #endif
  64.  
  65. #define    HAVE_SYSCALLS
  66.