Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* system call details for Mach on PowerPC
00002    Copyright (C) 2001,02 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public License as
00007    published by the Free Software Foundation; either version 2.1 of the
00008    License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; see the file COPYING.LIB.  If not,
00017    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.  */
00019 
00020 #ifndef _MACH_POWERPC_SYSDEP_H
00021 #define _MACH_POWERPC_SYSDEP_H
00022 
00023 #define START_ARGS char **sparg
00024 #define SNARF_ARGS(argc, argv, envp) \
00025   do {                               \
00026     argv = &sparg[1];                \
00027     argc = *(int *)sparg;            \
00028     envp = &argv[argc + 1];          \
00029   } while (0)
00030 
00031 #define CALL_WITH_SP(fn, sp) \
00032   do {                                                 \
00033     register long __sp = (long) sp, __fn = (long) fn; \
00034     asm volatile ("mr 1, %0; mtlr %1; blr"            \
00035                 : : "r" (__sp), "r" (__fn));        \
00036   } while (0)
00037 
00038 #define STACK_GROWTH_DOWN
00039 
00040 #define RETURN_TO(sp, pc, retval) \
00041      asm volatile ("mr 1, %0; mtctr %1; mr 3, %2; bctr" \
00042                  : : "r" (sp), "r" (pc), "r" (retval))
00043 
00044 /* Get the machine-independent Mach definitions.  */
00045 #define _MACH_MACHINE_ASM_H 1      /* Kludge to avoid bad Darwin header file.  */
00046 #include <sysdeps/mach/sysdep.h>
00047 
00048 #undef ENTRY
00049 #include <sysdeps/unix/powerpc/sysdep.h>
00050 
00051 #endif  /* _MACH_POWERPC_SYSDEP_H */