2.9
[glibc/nacl-glibc.git] / sysdeps / mach / powerpc / sysdep.h
blobacfacc473bed84777784b0aa9554177ebdbc1dc4
1 /* system call details for Mach on PowerPC
2 Copyright (C) 2001,02 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #ifndef _MACH_POWERPC_SYSDEP_H
21 #define _MACH_POWERPC_SYSDEP_H
23 #define START_ARGS char **sparg
24 #define SNARF_ARGS(argc, argv, envp) \
25 do { \
26 argv = &sparg[1]; \
27 argc = *(int *)sparg; \
28 envp = &argv[argc + 1]; \
29 } while (0)
31 #define CALL_WITH_SP(fn, sp) \
32 do { \
33 register long __sp = (long) sp, __fn = (long) fn; \
34 asm volatile ("mr 1, %0; mtlr %1; blr" \
35 : : "r" (__sp), "r" (__fn)); \
36 } while (0)
38 #define STACK_GROWTH_DOWN
40 #define RETURN_TO(sp, pc, retval) \
41 asm volatile ("mr 1, %0; mtctr %1; mr 3, %2; bctr" \
42 : : "r" (sp), "r" (pc), "r" (retval))
44 /* Get the machine-independent Mach definitions. */
45 #define _MACH_MACHINE_ASM_H 1 /* Kludge to avoid bad Darwin header file. */
46 #include <sysdeps/mach/sysdep.h>
48 #undef ENTRY
49 #include <sysdeps/unix/powerpc/sysdep.h>
51 #endif /* _MACH_POWERPC_SYSDEP_H */