about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/m68k/init-first.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/m68k/init-first.h')
-rw-r--r--sysdeps/unix/sysv/linux/m68k/init-first.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/m68k/init-first.h b/sysdeps/unix/sysv/linux/m68k/init-first.h
new file mode 100644
index 0000000000..7d8c320b0a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/init-first.h
@@ -0,0 +1,12 @@
+/* This fragment is invoked in the stack context of program start.
+   Its job is to set up a pointer to argc as an argument, pass
+   control to `INIT', and, if necessary, clean up after the call
+   to leave the stack in the same condition it was found in.  */
+
+#define SYSDEP_CALL_INIT(NAME, INIT)	\
+    asm(".globl " #NAME "\n\t"		\
+	#NAME ":\n\t"			\
+	"pea %sp@(4)\n\t"		\
+	"jbsr " #INIT "\n\t"		\
+	"addq #4,%sp\n\t"		\
+	"rts");