api: Add FreeBSD API support for MIPS platforms
[oweals/u-boot.git] / examples / api / crt0.S
index 78d35a2893c7707af0a3acbc1ebbe65f1fb16ccd..ced2c82e5ffcacb5702cd0a9a841a559cad8d74e 100644 (file)
@@ -40,6 +40,30 @@ syscall:
        ldr     ip, =syscall_ptr
        ldr     pc, [ip]
 
+#elif defined(CONFIG_MIPS)
+       .text
+       .globl __start
+       .ent __start
+__start:
+       sw      $sp, search_hint
+       b       main
+       .end __start
+
+       .globl syscall
+       .ent syscall
+syscall:
+       sw      $ra, return_addr
+       lw      $t9, syscall_ptr
+       jalr    $t9
+       nop
+       lw      $ra, return_addr
+       jr      $ra
+       nop
+       .end syscall
+
+return_addr:
+       .align 4
+       .long 0
 #else
 #error No support for this arch!
 #endif