about summary refs log tree commit diff
path: root/sysdeps/mach/mips/sysdep.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/mips/sysdep.h')
-rw-r--r--sysdeps/mach/mips/sysdep.h58
1 files changed, 36 insertions, 22 deletions
diff --git a/sysdeps/mach/mips/sysdep.h b/sysdeps/mach/mips/sysdep.h
index 7609be5931..a4e6dff148 100644
--- a/sysdeps/mach/mips/sysdep.h
+++ b/sysdeps/mach/mips/sysdep.h
@@ -1,35 +1,40 @@
-/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-#define MOVE(x,y)	move y , x
-
-#if 0
 #define LOSE asm volatile ("1: b 1b")
-#endif
 
+#define START_MACHDEP asm ("\
+	.text\n\
+	.globl _start\n\
+	.ent _start\n\
+_start:\n\
+	# Put initial SP in a0.\n\
+	move $4, $29\n\
+	# Jump to _start0; don't return.\n\
+	j _start0\n\
+	.end _start\n\
+");
+#define START_ARGS	int *entry_sp
 #define SNARF_ARGS(argc, argv, envp)					      \
   do									      \
     {									      \
-      int *entry_sp;							      \
       register char **p;						      \
 									      \
-      asm ("addu %0,$30,4" : "=r" (entry_sp));				      \
-									      \
       argc = *entry_sp;							      \
       argv = (char **) (entry_sp + 1);					      \
       p = argv;								      \
@@ -44,11 +49,20 @@ Cambridge, MA 02139, USA.  */
   ({ register int __fn = fn, __sp = (int) sp; \
      asm volatile ("move $sp,%0; j %1" : : "r" (__sp), "r" (__fn));})
 
+#define RETURN_TO(sp, pc, retval) \
+  asm volatile ("move $29, %0; move $2, %2; move $25, %1; jr $25" \
+		: : "r" (sp), "r" (pc), "r" (retval))
+
 #define STACK_GROWTH_DOWN
 
-#ifdef P40
 #include <syscall.h>
 
+#if defined (ASSEMBLER)
+
+#define ALIGN	2
+
+#define MOVE(x,y)	move y , x
+
 #define SYSCALL(name, args)	\
   .globl syscall_error;	\
   kernel_trap(name,SYS_##name,args);	\