1/*
2 * Copyright (c) 2015 Travis Geiselbrecht
3 *
4 * Use of this source code is governed by a MIT-style
5 * license that can be found in the LICENSE file or at
6 * https://opensource.org/licenses/MIT
7 */
8#include <lk/asm.h>
9
10.section ".text.boot"
11FUNCTION(_start)
12    # set the default stack
13    la      $sp, default_stack_top
14
15    # zero out the bss section
16    la      $t0, __bss_start
17    la     $t1, __bss_end
180:
19    sw      $zero, ($t0)
20    addi    $t0, 4
21    bne     $t0, $t1, 0b
22
23    # args to main and call it
24    li      $a0, 1
25    li      $a1, 2
26    li      $a2, 3
27    li      $a3, 4
28    jal     lk_main
29
30    # should never return here
31    b       .
32
33.bss
34.align 3
35LOCAL_DATA(default_stack)
36    .skip 4096
37LOCAL_DATA(default_stack_top)
38
39