1/* 2 * Copyright (C) 2016-2020 Bouffalo Lab 3 */ 4 5 .section .init 6 .align 2 7 .globl __start 8 .type __start, %function 9__start: 10.option push 11.option norelax 12 la gp, __global_pointer$ 13.option pop 14 csrci mstatus, 8 15 16 /* mtvec: for all exceptions and non-vector mode IRQs */ 17 la a0, default_trap_handler 18 ori a0, a0, 3 19 csrw mtvec, a0 20 21 /* mtvt: for all vector mode IRQs */ 22 la a0, __Vectors 23 csrw mtvt, a0 24 25 .weak __StackTop 26 la sp, __StackTop 27 csrw mscratch, sp 28 29 /* Load data section removed */ 30 31 /* Clear bss section removed */ 32 33 jal SystemInit 34 35 /* start load code to itcm like. */ 36 jal start_load 37 38 jal System_Post_Init 39 40 jal entry 41 42 .size __start, . - __start 43 44__exit: 45 j __exit 46 47