about summary refs log tree commit diff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-05-02 06:35:55 +0000
committerRoland McGrath <roland@gnu.org>1995-05-02 06:35:55 +0000
commitd66e34cd423425c348bcc83df127dd19711b0b9a (patch)
tree97058e776d3b4fe06ef54bc4951596991652183f /sysdeps/mach
parent08162fa888913a5153d2fcdc4e1a816b57b1fe56 (diff)
downloadglibc-d66e34cd423425c348bcc83df127dd19711b0b9a.tar.gz
glibc-d66e34cd423425c348bcc83df127dd19711b0b9a.tar.xz
glibc-d66e34cd423425c348bcc83df127dd19711b0b9a.zip
* sysdeps/mach/i386/sysdep.h (SNARF_ARGS, CALL_WITH_SP): Rewritten.
	* sysdeps/i386/dl-machine.h: New file.
	* sysdeps/stub/dl-machine.h: New file.
	* sysdeps/i386/dl-runtime.c: New file.
	* sysdeps/stub/dl-runtime.c: New file.
	* sysdeps/i386/elf/start.S: New file.
	* sysdeps/generic/dl-sysdep.c: New file.
	* sysdeps/mach/hurd/dl-sysdep.c: New file.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/i386/sysdep.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/sysdeps/mach/i386/sysdep.h b/sysdeps/mach/i386/sysdep.h
index 8d482a0485..692310b320 100644
--- a/sysdeps/mach/i386/sysdep.h
+++ b/sysdeps/mach/i386/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1994, 1995 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
@@ -20,15 +20,11 @@ Cambridge, MA 02139, USA.  */
 
 #define LOSE asm volatile ("hlt")
 
-#define SNARF_ARGS(argc, argv, envp)					      \
+#define SNARF_ARGS(entry_sp, argc, argv, envp)				      \
   do									      \
     {									      \
-      int *entry_sp;							      \
       register char **p;						      \
-									      \
-      asm ("leal 4(%%ebp), %0" : "=r" (entry_sp));			      \
-									      \
-      argc = *entry_sp;							      \
+      argc = (int) *entry_sp;						      \
       argv = (char **) (entry_sp + 1);					      \
       p = argv;								      \
       while (*p++ != NULL)						      \
@@ -38,9 +34,15 @@ Cambridge, MA 02139, USA.  */
       envp = p;							      \
     } while (0)
 
-#define CALL_WITH_SP(fn, sp) \
-  asm volatile ("movl %0, %%esp; jmp %1" : : \
-		"g" (sp), "m" (*(long int *) (fn)) : "%esp")
+#define CALL_WITH_SP(fn, info, sp) \
+  do {									      \
+	void **ptr = (void **) sp;					      \
+	*--(__typeof (info) *) ptr = info;				      \
+	ptr[-1] = ptr;							      \
+	--ptr;								      \
+    asm volatile ("movl %0, %%esp; call %1" : : 			      \
+		  "g" (ptr), "m" (*(long int *) (fn)) : "%esp"); 	      \
+  } while (0)
 
 #define STACK_GROWTH_DOWN