summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/loongarch64/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/arch/loongarch64/crt0.S')
-rw-r--r--usr/klibc/arch/loongarch64/crt0.S18
1 files changed, 18 insertions, 0 deletions
diff --git a/usr/klibc/arch/loongarch64/crt0.S b/usr/klibc/arch/loongarch64/crt0.S
new file mode 100644
index 0000000..cb3da66
--- /dev/null
+++ b/usr/klibc/arch/loongarch64/crt0.S
@@ -0,0 +1,18 @@
+#
+# arch/loongarch64/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.
+#
+
+#include <machine/asm.h>
+
+ENTRY(_start)
+ move $a0, $sp # Pointer to ELF entry structure
+ move $a1, $zero # No onexit pointer
+ bstrins.d $sp, $zero, 3, 0 # Align stack to 16 bytes
+ bl __libc_init
+END(_start)