Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
缘_顺
rt-thread
提交
a207f221
R
rt-thread
项目概览
缘_顺
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a207f221
编写于
12月 30, 2020
作者:
B
Bernard Xiong
提交者:
GitHub
12月 30, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4206 from greedyhao/bluetrum
[bsp][bluetrum] update link.lds
上级
4c399f88
7741df50
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
51 addition
and
39 deletion
+51
-39
bsp/bluetrum/ab32vg1-ab-prougen/.config
bsp/bluetrum/ab32vg1-ab-prougen/.config
+1
-0
bsp/bluetrum/ab32vg1-ab-prougen/link.lds
bsp/bluetrum/ab32vg1-ab-prougen/link.lds
+4
-9
bsp/bluetrum/ab32vg1-ab-prougen/makefile.targets
bsp/bluetrum/ab32vg1-ab-prougen/makefile.targets
+13
-0
bsp/bluetrum/ab32vg1-ab-prougen/pre_build.sh
bsp/bluetrum/ab32vg1-ab-prougen/pre_build.sh
+4
-0
bsp/bluetrum/libcpu/cpu/context_gcc.S
bsp/bluetrum/libcpu/cpu/context_gcc.S
+22
-22
bsp/bluetrum/libcpu/cpu/cpuport.c
bsp/bluetrum/libcpu/cpu/cpuport.c
+7
-8
未找到文件。
bsp/bluetrum/ab32vg1-ab-prougen/.config
浏览文件 @
a207f221
...
...
@@ -380,6 +380,7 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_UC_COMMON is not set
# CONFIG_PKG_USING_UC_MODBUS is not set
# CONFIG_PKG_USING_PPOOL is not set
# CONFIG_PKG_USING_OPENAMP is not set
#
# peripheral libraries and drivers
...
...
bsp/bluetrum/ab32vg1-ab-prougen/link.lds
浏览文件 @
a207f221
...
...
@@ -60,15 +60,10 @@ SECTIONS
} > ram1 AT > flash
.comm : {
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*)
*idle.o (.text*)
*ipc.o (.text*)
*irq.o (.text*)
*scheduler.o (.text*)
*timer.o (.text*)
*kservice.o (.text*)
EXCLUDE_FILE (*romfs.o *lib_a**.o) *(.rodata*)
KEEP(*(.vector))
EXCLUDE_FILE(*components*finsh**.o *components*libc**.o *romfs.o *lib_a**.o) *(.text*)
*finsh*shell.o (.text*)
EXCLUDE_FILE (*components*libc**.o *romfs.o *lib_a**.o) *(.rodata*)
*(.srodata*)
*(.rela*)
*(.data*)
...
...
bsp/bluetrum/ab32vg1-ab-prougen/makefile.targets
0 → 100644
浏览文件 @
a207f221
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)
bsp/bluetrum/ab32vg1-ab-prougen/pre_build.sh
0 → 100644
浏览文件 @
a207f221
cp
../riscv32-elf-xmaker.exe
.
cp
../header.bin
.
cp
../rtthread.xm
.
cp
../download.xm
.
bsp/bluetrum/libcpu/cpu/context_gcc.S
浏览文件 @
a207f221
...
...
@@ -13,7 +13,7 @@
.
global
rt_interrupt_from_thread
.
global
rt_interrupt_to_thread
.
global
rt_cur_thread_sp
.
global
rt_
switch
_flag
.
global
rt_
thread_switch_interrupt
_flag
.
global
rt_interrupt_nest
/*
...
...
@@ -77,12 +77,12 @@ enable_int_ret:
sw
x30
,
108
(
sp
)
sw
x31
,
112
(
sp
)
lw
a5
,
EPC
(
zero
)
//
Saves
current
program
counter
(
EPC
)
as
task
program
counter
lw
a5
,
EPC
(
zero
)
//
Saves
current
program
counter
(
EPC
)
as
task
program
counter
sw
a5
,
116
(
sp
)
lw
a5
,
EPICCON
(
zero
)
sw
a5
,
120
(
sp
)
sw
sp
,
rt_cur_thread_sp
,
a4
//
store
sp
in
preempted
tasks
tcb
sw
sp
,
rt_cur_thread_sp
,
a4
//
store
sp
in
preempted
tasks
tcb
.
endm
...
...
@@ -90,7 +90,7 @@ enable_int_ret:
.
macro
restore_context
la
a5
,
rt_cur_thread_sp
lw
sp
,
0
(
a5
)
//
get
new
task
stack
pointer
lw
sp
,
0
(
a5
)
//
get
new
task
stack
pointer
/
*
Load
task
program
counter
EPC
*/
lw
a5
,
116
(
sp
)
...
...
@@ -140,16 +140,16 @@ enable_int_ret:
*/
.
globl
rt_hw_context_switch_to
rt_hw_context_switch_to
:
sw
zero
,
rt_interrupt_from_thread
,
a4
/*
set
from
thread
to
0
*/
sw
a0
,
rt_interrupt_to_thread
,
a4
/*
set
rt_interrupt_to_thread
*/
sw
zero
,
rt_interrupt_from_thread
,
a4
/*
set
from
thread
to
0
*/
sw
a0
,
rt_interrupt_to_thread
,
a4
/*
set
rt_interrupt_to_thread
*/
sb
zero
,
rt_interrupt_nest
,
a4
/*
rt_interrupt_nest
=
0
*/
sb
zero
,
rt_interrupt_nest
,
a4
/*
rt_interrupt_nest
=
0
*/
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
*/
lw
a5
,
PICCON
(
zero
)
/*
enable
interrupt
*/
lw
a5
,
PICCON
(
zero
)
/*
enable
interrupt
*/
ori
a5
,
a5
,
1
sw
a5
,
PICCON
(
zero
)
ret
...
...
@@ -161,10 +161,10 @@ rt_hw_context_switch_to:
*/
.
globl
rt_hw_context_switch
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
*/
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
*/
ret
...
...
@@ -190,37 +190,37 @@ rt_switch_to_thread:
*/
.
global
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
li
a5
,
0x01
sw
a5
,
rt_
switch
_flag
,
a4
sw
a0
,
rt_interrupt_from_thread
,
a4
/*
set
rt_interrupt_from_thread
*/
sw
a5
,
rt_
thread_switch_interrupt
_flag
,
a4
sw
a0
,
rt_interrupt_from_thread
,
a4
/*
set
rt_interrupt_from_thread
*/
_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
*/
ret
//软中断服务
.
global
rt_soft_isr
rt_soft_isr
:
li
a5
,
0x4
//
PICPND
=
BIT
(
IRQ_SW_VECTOR
)
; 清软中断Pending
li
a5
,
0x4
//
PICPND
=
BIT
(
IRQ_SW_VECTOR
)
; 清软中断Pending
sw
a5
,
PICPND
(
zero
)
ret
.
globl
low_prio_irq
low_prio_irq
:
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
jalr
a5
lw
a5
,
rt_
switch
_flag
beqz
a5
,
_low_prio_irq_exit
//
if
(
rt_
switch
_flag
)
lw
a5
,
rt_
thread_switch_interrupt
_flag
beqz
a5
,
_low_prio_irq_exit
//
if
(
rt_
thread_switch_interrupt
_flag
)
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
:
sb
zero
,
rt_interrupt_nest
,
a4
//
rt_interrupt_nest
=
0
;
restore_context
bsp/bluetrum/libcpu/cpu/cpuport.c
浏览文件 @
a207f221
...
...
@@ -14,7 +14,6 @@
volatile
rt_ubase_t
rt_interrupt_from_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_switch_flag
=
0
;
rt_uint32_t
rt_cur_thread_sp
=
0
;
/**
...
...
@@ -42,13 +41,13 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
stk
--
;
*
stk
=
(
rt_uint32_t
)
0x10003
;
/* Start address */
stk
--
;
*
stk
=
(
rt_uint32_t
)
tentry
;
/* Start address */
stk
-=
22
;
*
stk
=
(
rt_uint32_t
)
parameter
;
/* Register a0 parameter*/
stk
-=
6
;
*
stk
=
(
rt_uint32_t
)
tp
;
/* Register thread pointer */
stk
--
;
*
stk
=
(
rt_uint32_t
)
texit
;
/* Register ra texit*/
*
stk
=
(
rt_uint32_t
)
tentry
;
/* Start address */
stk
-=
22
;
*
stk
=
(
rt_uint32_t
)
parameter
;
/* Register a0 parameter*/
stk
-=
6
;
*
stk
=
(
rt_uint32_t
)
tp
;
/* Register thread pointer */
stk
--
;
*
stk
=
(
rt_uint32_t
)
texit
;
/* Register ra texit*/
/* return task's current stack address */
return
(
rt_uint8_t
*
)
stk
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录