Update.
[glibc.git] / sysdeps / unix / sysv / linux / powerpc / sysdep.h
blob577809acb8bcd485a0293680316d3d03b150f099
1 /* Copyright (C) 1992, 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
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.
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.
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 not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #include <sysdeps/unix/sysdep.h>
21 /* For Linux we can use the system call table in the header file
22 /usr/include/asm/unistd.h
23 of the kernel. But these symbols do not follow the SYS_* syntax
24 so we have to redefine the `SYS_ify' macro here. */
25 #undef SYS_ify
26 #ifdef __STDC__
27 # define SYS_ify(syscall_name) __NR_##syscall_name
28 #else
29 # define SYS_ify(syscall_name) __NR_/**/syscall_name
30 #endif
32 #ifdef ASSEMBLER
34 #define ENTRY(name) \
35 .globl name; \
36 .type name,@function; \
37 .align 2; \
38 C_LABEL(name)
40 #define DO_CALL(syscall) \
41 li 0,syscall; \
44 #ifdef PIC
45 #define PSEUDO(name, syscall_name, args) \
46 .section ".text"; \
47 ENTRY (name) \
48 DO_CALL (SYS_ify (syscall_name)); \
49 bnslr; \
50 b __syscall_error@plt
51 #else
52 #define PSEUDO(name, syscall_name, args) \
53 .section ".text"; \
54 ENTRY (name) \
55 DO_CALL (SYS_ify (syscall_name)); \
56 bnslr; \
57 b __syscall_error
58 #endif
60 #define ret /* Nothing (should be 'blr', but never reached). */
62 #endif /* ASSEMBLER */