1 /* Copyright (C) 1996, 1997 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 Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the 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 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 #define LOSE asm volatile ("1: b 1b")
21 #define START_MACHDEP asm ("\
26 # Put initial SP in a0.\n\
28 # Jump to _start0; don't return.\n\
32 #define START_ARGS int *entry_sp
33 #define SNARF_ARGS(argc, argv, envp) \
39 argv = (char **) (entry_sp + 1); \
41 while (*p++ != NULL) \
43 if (p >= (char **) argv[0]) \
48 #define CALL_WITH_SP(fn, sp) \
49 ({ register int __fn = fn, __sp = (int) sp; \
50 asm volatile ("move $sp,%0; j %1" : : "r" (__sp), "r" (__fn));})
52 #define RETURN_TO(sp, pc, retval) \
53 asm volatile ("move $29, %0; move $2, %2; move $25, %1; jr $25" \
54 : : "r" (sp), "r" (pc), "r" (retval))
56 #define STACK_GROWTH_DOWN
60 #if defined (__ASSEMBLER__)
64 #define MOVE(x,y) move y , x
66 #define SYSCALL(name, args) \
67 .globl syscall_error; \
68 kernel_trap(name,SYS_##name,args); \
73 #define SYSCALL__(name, args) \
74 .globl syscall_error; \
75 kernel_trap(__##name,SYS_##name,args); \
83 #include <sysdeps/mach/sysdep.h>