summaryrefslogtreecommitdiffstats
path: root/libgloss/arm/linux-crt0.S
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2006-05-30 17:40:47 +0000
committerJeff Johnston <jjohnstn@redhat.com>2006-05-30 17:40:47 +0000
commit47e55476bedb2b49abb37446934cc7406d120425 (patch)
tree9c5ff78779ce6e2bfb4c635425367cf139c8c11d /libgloss/arm/linux-crt0.S
parent56057f03943946440499e70e00f5ec2274e08517 (diff)
downloadcygnal-47e55476bedb2b49abb37446934cc7406d120425.tar.gz
cygnal-47e55476bedb2b49abb37446934cc7406d120425.tar.bz2
cygnal-47e55476bedb2b49abb37446934cc7406d120425.zip
2006-05-30 Shaun Jackman <sjackman@gmail.com>
* arm/Makefile.in: Add Linux syscall interface. * arm/linux-crt0.S: New file. * arm/linux-syscall.h: New file. * arm/linux-syscalls0.S: New file. * arm/linux-syscalls1.c: New file.
Diffstat (limited to 'libgloss/arm/linux-crt0.S')
-rw-r--r--libgloss/arm/linux-crt0.S46
1 files changed, 46 insertions, 0 deletions
diff --git a/libgloss/arm/linux-crt0.S b/libgloss/arm/linux-crt0.S
new file mode 100644
index 000000000..b3ba5bd0d
--- /dev/null
+++ b/libgloss/arm/linux-crt0.S
@@ -0,0 +1,46 @@
+/** Linux startup code for the ARM processor.
+ * Written by Shaun Jackman <sjackman@gmail.com>.
+ * Copyright 2006 Pathway Connectivity
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+.global _start
+.type _start, %function
+_start:
+#if __thumb__
+ /* Switch to Thumb mode. */
+ adr r0, _start_thumb+1
+ bx r0
+.size _start, .-_start
+.global _start_thumb
+.thumb_func
+_start_thumb:
+#endif
+
+#if 0
+ /* Clear the BSS. This task is normally handled by the kernel. */
+ ldr r0, =__bss_start
+ mov r1, #0
+ ldr r2, =_end
+ sub r2, r2, r0
+ bl memset
+#endif
+
+ pop {r0} @ argc
+ mov r1, sp @ argv
+ lsl r2, r0, #2
+ add r2, r1
+ add r2, #4 @ envp
+ ldr r3, =environ
+ str r2, [r3]
+ bl main
+ bl exit
+ b .
+
+#if __thumb__
+.size _start_thumb, .-_start_thumb
+#else
+.size _start, .-_start
+#endif