4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-19 07:53:30 +08:00

[bsp][bluetrum] update link.lds

This commit is contained in:
greedyhao 2020-12-30 17:43:23 +08:00
parent 08aa4e5462
commit 7741df50ab
6 changed files with 51 additions and 39 deletions

View File

@ -380,6 +380,7 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_UC_COMMON is not set # CONFIG_PKG_USING_UC_COMMON is not set
# CONFIG_PKG_USING_UC_MODBUS is not set # CONFIG_PKG_USING_UC_MODBUS is not set
# CONFIG_PKG_USING_PPOOL is not set # CONFIG_PKG_USING_PPOOL is not set
# CONFIG_PKG_USING_OPENAMP is not set
# #
# peripheral libraries and drivers # peripheral libraries and drivers

View File

@ -60,15 +60,10 @@ SECTIONS
} > ram1 AT > flash } > ram1 AT > flash
.comm : { .comm : {
KEEP (*(.vector)) KEEP(*(.vector))
EXCLUDE_FILE (*hal_drivers**.o *ab32vg1_hal**.o *components*finsh**.o *components*libc**.o *rt-thread*src**.o *kernel*src**.o *romfs.o *lib_a**.o) *(.text*) EXCLUDE_FILE(*components*finsh**.o *components*libc**.o *romfs.o *lib_a**.o) *(.text*)
*idle.o (.text*) *finsh*shell.o (.text*)
*ipc.o (.text*) EXCLUDE_FILE (*components*libc**.o *romfs.o *lib_a**.o) *(.rodata*)
*irq.o (.text*)
*scheduler.o (.text*)
*timer.o (.text*)
*kservice.o (.text*)
EXCLUDE_FILE (*romfs.o *lib_a**.o) *(.rodata*)
*(.srodata*) *(.srodata*)
*(.rela*) *(.rela*)
*(.data*) *(.data*)

View File

@ -0,0 +1,13 @@
rtthread.siz:
riscv64-unknown-elf-size --format=berkeley "rtthread.elf"
sh ../pre_build.sh
riscv32-elf-xmaker -b rtthread.xm
riscv32-elf-xmaker -b download.xm
clean2:
-$(RM) $(CC_DEPS)$(C++_DEPS)$(C_UPPER_DEPS)$(CXX_DEPS)$(SECONDARY_FLASH)$(SECONDARY_SIZE)$(ASM_DEPS)$(S_UPPER_DEPS)$(C_DEPS)$(CPP_DEPS)
-$(RM) $(OBJS) *.elf
-@echo ' '
*.elf: $(wildcard D:/Softwares/RT-ThreadStudio/workspace/ab32vg1/link.lds)

View File

@ -0,0 +1,4 @@
cp ../riscv32-elf-xmaker.exe .
cp ../header.bin .
cp ../rtthread.xm .
cp ../download.xm .

View File

@ -13,7 +13,7 @@
.global rt_interrupt_from_thread .global rt_interrupt_from_thread
.global rt_interrupt_to_thread .global rt_interrupt_to_thread
.global rt_cur_thread_sp .global rt_cur_thread_sp
.global rt_switch_flag .global rt_thread_switch_interrupt_flag
.global rt_interrupt_nest .global rt_interrupt_nest
/* /*
@ -146,7 +146,7 @@ rt_hw_context_switch_to:
sb zero, rt_interrupt_nest, a4 /*rt_interrupt_nest = 0*/ sb zero, rt_interrupt_nest, a4 /*rt_interrupt_nest = 0*/
li a5, 1 li a5, 1
sw a5, rt_switch_flag, a4 // rt_switch_flag = 1; sw a5, rt_thread_switch_interrupt_flag, a4 // rt_thread_switch_interrupt_flag = 1;
SWINT /*kick soft interrupt*/ SWINT /*kick soft interrupt*/
lw a5, PICCON(zero) /*enable interrupt*/ lw a5, PICCON(zero) /*enable interrupt*/
@ -164,7 +164,7 @@ rt_hw_context_switch:
sw a0, rt_interrupt_from_thread, a4 /*set rt_interrupt_from_thread*/ sw a0, rt_interrupt_from_thread, a4 /*set rt_interrupt_from_thread*/
sw a1, rt_interrupt_to_thread, a4 /*set rt_interrupt_to_thread*/ sw a1, rt_interrupt_to_thread, a4 /*set rt_interrupt_to_thread*/
li a5, 1 li a5, 1
sw a5, rt_switch_flag, a4 // rt_switch_flag = 1; sw a5, rt_thread_switch_interrupt_flag, a4 /*rt_thread_switch_interrupt_flag = 1*/
SWINT /*kick soft interrupt*/ SWINT /*kick soft interrupt*/
ret ret
@ -190,10 +190,10 @@ rt_switch_to_thread:
*/ */
.global rt_hw_context_switch_interrupt .global rt_hw_context_switch_interrupt
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
lw a5, rt_switch_flag lw a5, rt_thread_switch_interrupt_flag
bnez a5, _reswitch bnez a5, _reswitch
li a5, 0x01 li a5, 0x01
sw a5, rt_switch_flag, a4 sw a5, rt_thread_switch_interrupt_flag, a4
sw a0, rt_interrupt_from_thread, a4 /*set rt_interrupt_from_thread*/ sw a0, rt_interrupt_from_thread, a4 /*set rt_interrupt_from_thread*/
_reswitch: _reswitch:
sw a1, rt_interrupt_to_thread, a4 /*set rt_interrupt_to_thread*/ sw a1, rt_interrupt_to_thread, a4 /*set rt_interrupt_to_thread*/
@ -209,18 +209,18 @@ rt_soft_isr:
.globl low_prio_irq .globl low_prio_irq
low_prio_irq: low_prio_irq:
save_context save_context
li a5, 1
sb a5, rt_interrupt_nest, a4 // rt_interrupt_nest = 1; lw a5, rt_interrupt_nest
bnez a5, _low_prio_irq_exit
lw a5, cpu_irq_comm_hook lw a5, cpu_irq_comm_hook
jalr a5 jalr a5
lw a5, rt_switch_flag lw a5, rt_thread_switch_interrupt_flag
beqz a5, _low_prio_irq_exit // if (rt_switch_flag) beqz a5, _low_prio_irq_exit // if (rt_thread_switch_interrupt_flag)
jal rt_switch_to_thread jal rt_switch_to_thread
sw zero, rt_switch_flag, a4 // rt_switch_flag = 0; sw zero, rt_thread_switch_interrupt_flag, a4 // rt_thread_switch_interrupt_flag = 0;
_low_prio_irq_exit: _low_prio_irq_exit:
sb zero, rt_interrupt_nest, a4 // rt_interrupt_nest = 0;
restore_context restore_context

View File

@ -14,7 +14,6 @@
volatile rt_ubase_t rt_interrupt_from_thread = 0; volatile rt_ubase_t rt_interrupt_from_thread = 0;
volatile rt_ubase_t rt_interrupt_to_thread = 0; volatile rt_ubase_t rt_interrupt_to_thread = 0;
volatile rt_uint32_t rt_thread_switch_interrupt_flag = 0; volatile rt_uint32_t rt_thread_switch_interrupt_flag = 0;
volatile rt_uint32_t rt_switch_flag = 0;
rt_uint32_t rt_cur_thread_sp = 0; rt_uint32_t rt_cur_thread_sp = 0;
/** /**