Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2007
00002      Free Software Foundation, Inc.
00003 
00004    This file is part of the GNU C Library.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO.  */
00022 #include <dl-sysdep.h>
00023 #include <tls.h>
00024 
00025 #define LOSE asm volatile ("hlt")
00026 
00027 #define SNARF_ARGS(entry_sp, argc, argv, envp)                              \
00028   do                                                                 \
00029     {                                                                \
00030       register char **p;                                             \
00031       argc = (int) *entry_sp;                                               \
00032       argv = (char **) (entry_sp + 1);                                      \
00033       p = argv;                                                             \
00034       while (*p++ != NULL)                                           \
00035        ;                                                             \
00036       if (p >= (char **) argv[0])                                    \
00037        --p;                                                          \
00038       envp = p;                                                      \
00039     } while (0)
00040 
00041 #define CALL_WITH_SP(fn, info, sp) \
00042   do {                                                               \
00043        void **ptr = (void **) sp;                                    \
00044        *--(__typeof (info) *) ptr = info;                            \
00045        ptr[-1] = ptr;                                                       \
00046        --ptr;                                                        \
00047     asm volatile ("movl %0, %%esp; call %1" : :                      \
00048                 "g" (ptr), "m" (*(long int *) (fn)) : "%esp");              \
00049   } while (0)
00050 
00051 #define RETURN_TO(sp, pc, retval) \
00052   asm volatile ("movl %0, %%esp; jmp %*%1 # %2" \
00053               : : "g" (sp), "r" (pc), "a" (retval))
00054 
00055 
00056 #define STACK_GROWTH_DOWN
00057 
00058 /* Get the machine-independent Mach definitions.  */
00059 #include <sysdeps/mach/sysdep.h>
00060 
00061 
00062 /* This should be rearranged, but at the moment this file provides
00063    the most useful definitions for assembler syntax details.  */
00064 #undef ENTRY
00065 #undef ALIGN
00066 #include <sysdeps/unix/i386/sysdep.h>