summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/m68k/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/arch/m68k/crt0.S')
-rw-r--r--usr/klibc/arch/m68k/crt0.S27
1 files changed, 27 insertions, 0 deletions
diff --git a/usr/klibc/arch/m68k/crt0.S b/usr/klibc/arch/m68k/crt0.S
new file mode 100644
index 0000000..fbf6f13
--- /dev/null
+++ b/usr/klibc/arch/m68k/crt0.S
@@ -0,0 +1,27 @@
+#
+# arch/m68k/crt0.S
+#
+# Does arch-specific initialization and invokes __libc_init
+# with the appropriate arguments.
+#
+# See __static_init.c or __shared_init.c for the expected
+# arguments.
+#
+
+ .text
+ .align 4
+ .type _start,@function
+ .globl _start
+_start:
+ # Zero out the frame pointer to be nice to the debugger
+ movea.l #0,%a6
+ # Save the address of the ELF argument array
+ move.l %a7, %d0
+ # Push a zero on the stack in lieu of atexit pointer
+ clr.l -(%sp)
+ # Push ELF argument pointer on the stack
+ move.l %d0, -(%a7)
+
+ jbsr __libc_init
+
+ .size _start, .-_start