Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* Copyright (C) 1994,97,2002 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #define MOVE(x,y)    mov x, y
00020 
00021 #define LOSE asm volatile ("call_pal 0") /* halt */
00022 
00023 #define START_MACHDEP \
00024   asm ("_start:      mov    $30, $16\n" /* Put initial SP in a0.  */        \
00025        "      br     $27, 1f\n" /* Load GP from PC.  */              \
00026        "1:    ldgp   $29, 0($27)\n"                                         \
00027        "      jmp    $26, _start0");      /* Jump to _start0; don't return.  */
00028 #define START_ARGS   char **sparg
00029 #define SNARF_ARGS(argc, argv, envp) \
00030   (envp = &(argv = &sparg[1])[(argc = *(int *) sparg) + 1])
00031 
00032 #define CALL_WITH_SP(fn, sp) \
00033   ({ register long int __fn = (long int) fn, __sp = (long int) sp; \
00034      asm volatile ("mov %0,$30; jmp $31, (%1); ldgp $29, 0(%1)" \
00035                  : : "r" (__sp), "r" (__fn)); })
00036 
00037 #define STACK_GROWTH_DOWN
00038 
00039 #define RETURN_TO(sp, pc, retval) \
00040   asm volatile ("mov %0,$30; jmp $31, (%1); mov %2,$0" \
00041               : : "r" (sp), "r" (pc), "r" ((long int) (retval)));
00042 
00043 #define ALIGN 3
00044 #include <sysdeps/mach/sysdep.h>
00045 
00046 /* Alpha needs the .ent and .frame magic that the generic version lacks.  */
00047 #undef ENTRY
00048 #define ENTRY(name)                       \
00049   .globl name;                                   \
00050   .align 3;                               \
00051   .ent name, 0;                                  \
00052   name##:                                 \
00053   .frame sp, 0, ra
00054 
00055 #include <mach/alpha/asm.h>
00056 #undef at
00057 #define at    28
00058 #define AT    $28
00059 #define fp    s6