66 lines
1.2 KiB
ArmAsm
66 lines
1.2 KiB
ArmAsm
/*
|
||
* Copyright (c) 2020-2020, BLUETRUM Development Team
|
||
*
|
||
* SPDX-License-Identifier: Apache-2.0
|
||
*/
|
||
|
||
#include "ab32vg1.h"
|
||
|
||
.global _start
|
||
.section .reset, "ax"
|
||
_start:
|
||
|
||
//load comm
|
||
la a0, __comm_vma
|
||
la a1, __comm_lma
|
||
la a2, __comm_size
|
||
call 0x84044
|
||
|
||
//load ram1
|
||
la a0, __ram1_vma
|
||
la a1, __ram1_lma
|
||
la a2, __ram1_size
|
||
call 0x84044
|
||
|
||
la a0, __irq_stack_start //Stack清成0x23
|
||
li a1, 0x23
|
||
la a2, __irq_stack_size
|
||
call memset
|
||
la ra, __irq_stack
|
||
lui a5, 0x1
|
||
sw zero, -1920(a5)
|
||
sw zero, -1916(a5)
|
||
|
||
//clear bss
|
||
la a0, __bss_start
|
||
li a1, 0
|
||
la a2, __bss_size
|
||
call memset
|
||
|
||
la a0, __comm_vma
|
||
sw a0, PICADR(zero)
|
||
|
||
call entry
|
||
// la ra, __exception
|
||
// jr ra
|
||
|
||
.section .vector, "ax"
|
||
// .org 0x10
|
||
//__exception:
|
||
// li sp, 0x10600 //出错后,不破坏错误点的堆栈数据
|
||
// jal exception_isr
|
||
// 1: j 1b
|
||
// mret
|
||
|
||
.org 0x40
|
||
jal x0, low_prio_irq
|
||
mret
|
||
|
||
.global cpu_irq_comm
|
||
cpu_irq_comm:
|
||
la a5, __irq_stack
|
||
mv sp, a5
|
||
j cpu_irq_comm_do
|
||
|
||
ret
|