initial import
[glibc.git] / sysdeps / mach / alpha / sysdep.h
bloba32766270b6be0dc72b78c545748a8a795536521
1 /* Copyright (C) 1994 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
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
19 #define MOVE(x,y) mov x, y
21 #define LOSE asm volatile ("call_pal 0") /* halt */
23 #define START_MACHDEP \
24 asm ("_start: mov $30, $16\n" /* Put initial SP in a0. */ \
25 " br $27, 1f\n" /* Load GP from PC. */ \
26 "1: ldgp $29, 0($27)\n" \
27 " jmp $26, _start0"); /* Jump to _start0; don't return. */
28 #define START_ARGS char **sparg
29 #define SNARF_ARGS(argc, argv, envp) \
30 (envp = &(argv = &sparg[1])[(argc = *(int *) sparg) + 1])
32 #define CALL_WITH_SP(fn, sp) \
33 ({ register long int __fn = (long int) fn, __sp = (long int) sp; \
34 asm volatile ("mov %0,$30; jmp $31, (%1); ldgp $29, 0(%1)" \
35 : : "r" (__sp), "r" (__fn)); })
37 #define ENTRY(name) LEAF(name, ***loser no arg count***)
39 #define STACK_GROWTH_DOWN
41 #include_next <sysdep.h>