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 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 not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
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_next <sysdep.h>