Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
人间散章
rt-thread
提交
efbdbc26
R
rt-thread
项目概览
人间散章
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
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,发现更多精彩内容 >>
提交
efbdbc26
编写于
11月 30, 2021
作者:
G
GuEe-GUI
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixup .bss size define in link.lds and set spsel=1 in aarch64
上级
740cd9df
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
33 addition
and
41 deletion
+33
-41
bsp/qemu-virt64-aarch64/link.lds
bsp/qemu-virt64-aarch64/link.lds
+1
-1
bsp/raspberry-pi/raspi3-64/link.lds
bsp/raspberry-pi/raspi3-64/link.lds
+1
-1
bsp/raspberry-pi/raspi4-64/link.lds
bsp/raspberry-pi/raspi4-64/link.lds
+1
-1
libcpu/aarch64/common/context_gcc.S
libcpu/aarch64/common/context_gcc.S
+14
-25
libcpu/aarch64/common/stack.c
libcpu/aarch64/common/stack.c
+4
-3
libcpu/aarch64/common/vector_gcc.S
libcpu/aarch64/common/vector_gcc.S
+1
-1
libcpu/aarch64/cortex-a/entry_point.S
libcpu/aarch64/cortex-a/entry_point.S
+10
-9
src/thread.c
src/thread.c
+1
-0
未找到文件。
bsp/qemu-virt64-aarch64/link.lds
浏览文件 @
efbdbc26
...
...
@@ -148,4 +148,4 @@ SECTIONS
.debug_varnames 0 : { *(.debug_varnames) }
}
__bss_size =
(__bss_end - __bss_start)>>3
;
__bss_size =
SIZEOF(.bss)
;
bsp/raspberry-pi/raspi3-64/link.lds
浏览文件 @
efbdbc26
...
...
@@ -137,4 +137,4 @@ SECTIONS
.debug_varnames 0 : { *(.debug_varnames) }
}
__bss_size =
(__bss_end - __bss_start)>>3
;
__bss_size =
SIZEOF(.bss)
;
bsp/raspberry-pi/raspi4-64/link.lds
浏览文件 @
efbdbc26
...
...
@@ -137,4 +137,4 @@ SECTIONS
.debug_varnames 0 : { *(.debug_varnames) }
}
__bss_size =
(__bss_end - __bss_start)>>3
;
__bss_size =
SIZEOF(.bss)
;
libcpu/aarch64/common/context_gcc.S
浏览文件 @
efbdbc26
...
...
@@ -5,10 +5,11 @@
*
*
Change
Logs
:
*
Date
Author
Notes
*
2018
-
10
-
06
ZhaoXiaowei
the
first
version
*
2018
-
10
-
06
ZhaoXiaowei
the
first
version
*
2021
-
11
-
04
GuEe
-
GUI
set
sp
with
SP_ELx
*/
/
*
/*
*
enable
gtimer
*/
.
globl
rt_hw_gtimer_enable
...
...
@@ -17,6 +18,14 @@ rt_hw_gtimer_enable:
MSR
CNTP_CTL_EL0
,
X0
RET
/*
*
disable
gtimer
*/
.
globl
rt_hw_gtimer_disable
rt_hw_gtimer_disable
:
MSR
CNTP_CTL_EL0
,
XZR
RET
/*
*
set
gtimer
CNTP_TVAL_EL0
value
*/
...
...
@@ -48,10 +57,6 @@ rt_hw_get_gtimer_frq:
RET
.
macro
SAVE_CONTEXT
/
*
Switch
to
use
the
EL0
stack
pointer
.
*/
MSR
SPSEL
,
#
0
/
*
Save
the
entire
context
.
*/
STP
X0
,
X1
,
[
SP
,
#-
0x10
]!
STP
X2
,
X3
,
[
SP
,
#-
0x10
]!
...
...
@@ -98,16 +103,9 @@ rt_hw_get_gtimer_frq:
MOV
X0
,
SP
/*
Move
SP
into
X0
for
saving
.
*/
/
*
Switch
to
use
the
ELx
stack
pointer
.
*/
MSR
SPSEL
,
#
1
.
endm
.
macro
SAVE_CONTEXT_T
/
*
Switch
to
use
the
EL0
stack
pointer
.
*/
MSR
SPSEL
,
#
0
/
*
Save
the
entire
context
.
*/
STP
X0
,
X1
,
[
SP
,
#-
0x10
]!
STP
X2
,
X3
,
[
SP
,
#-
0x10
]!
...
...
@@ -135,15 +133,15 @@ rt_hw_get_gtimer_frq:
B.EQ
1
f
B
.
3
:
M
RS
X3
,
SPSR_EL3
M
OV
X3
,
0x0d
MOV
X2
,
X30
B
0
f
2
:
M
RS
X3
,
SPSR_EL2
M
OV
X3
,
0x09
MOV
X2
,
X30
B
0
f
1
:
M
RS
X3
,
SPSR_EL1
M
OV
X3
,
0x05
MOV
X2
,
X30
B
0
f
0
:
...
...
@@ -152,16 +150,10 @@ rt_hw_get_gtimer_frq:
MOV
X0
,
SP
/*
Move
SP
into
X0
for
saving
.
*/
/
*
Switch
to
use
the
ELx
stack
pointer
.
*/
MSR
SPSEL
,
#
1
.
endm
.
macro
RESTORE_CONTEXT
/
*
Switch
to
use
the
EL0
stack
pointer
.
*/
MSR
SPSEL
,
#
0
/
*
Set
the
SP
to
point
to
the
stack
of
the
task
being
restored
.
*/
MOV
SP
,
X0
...
...
@@ -206,9 +198,6 @@ rt_hw_get_gtimer_frq:
LDP
X2
,
X3
,
[
SP
],
#
0x10
LDP
X0
,
X1
,
[
SP
],
#
0x10
/
*
Switch
to
use
the
ELx
stack
pointer
.
_RB_
Might
not
be
required
.
*/
MSR
SPSEL
,
#
1
ERET
.
endm
...
...
libcpu/aarch64/common/stack.c
浏览文件 @
efbdbc26
...
...
@@ -7,15 +7,16 @@
* Date Author Notes
* 2011-09-23 Bernard the first version
* 2011-10-05 Bernard add thumb mode
* 2021-11-04 GuEe-GUI set sp with SP_ELx
*/
#include <rtthread.h>
#include <board.h>
#include <armv8.h>
#define INITIAL_SPSR_EL3 (PSTATE_EL3 | SP_EL
0
)
#define INITIAL_SPSR_EL2 (PSTATE_EL2 | SP_EL
0
)
#define INITIAL_SPSR_EL1 (PSTATE_EL1 | SP_EL
0
)
#define INITIAL_SPSR_EL3 (PSTATE_EL3 | SP_EL
x
)
#define INITIAL_SPSR_EL2 (PSTATE_EL2 | SP_EL
x
)
#define INITIAL_SPSR_EL1 (PSTATE_EL1 | SP_EL
x
)
/**
* This function will initialize thread stack
...
...
libcpu/aarch64/common/vector_gcc.S
浏览文件 @
efbdbc26
...
...
@@ -18,7 +18,7 @@ system_vectors:
.
align
11
.
set
VBAR
,
system_vectors
.
org
VBAR
//
Exception
from
CurrentEL
(
EL1
)
with
SP_EL0
(
SPSEL
=
1
)
//
Exception
from
CurrentEL
(
EL1
)
with
SP_EL0
(
SPSEL
=
0
)
.
org
(
VBAR
+
0x00
+
0
)
B
vector_error
//
Synchronous
.
org
(
VBAR
+
0x80
+
0
)
...
...
libcpu/aarch64/cortex-a/entry_point.S
浏览文件 @
efbdbc26
...
...
@@ -6,6 +6,7 @@
*
Date
Author
Notes
*
2020
-
01
-
15
bigmagic
the
first
version
*
2020
-
08
-
10
SummerGift
support
clang
compiler
*
2021
-
11
-
04
GuEe
-
GUI
set
sp
with
SP_ELx
*/
.
section
".
text.entrypoint
","
ax
"
...
...
@@ -32,14 +33,15 @@ cpu_setup:
bne
cpu_not_in_el3
/
*
Should
never
be
executed
,
just
for
completeness
.
(
EL3
)
*/
mov
x
0
,
#(
1
<<
0
)
/*
EL0
and
EL1
are
in
Non
-
Secure
state
*/
orr
x
0
,
x0
,
#(
1
<<
4
)
/*
RES1
*/
orr
x
0
,
x0
,
#(
1
<<
5
)
/*
RES1
*/
orr
x
0
,
x0
,
#(
1
<<
7
)
/*
SMC
instructions
are
undefined
at
EL1
and
above
*/
orr
x
0
,
x0
,
#(
1
<<
8
)
/*
HVC
instructions
are
enabled
at
EL1
and
above
*/
orr
x
0
,
x0
,
#(
1
<<
10
)
/*
The
next
lower
level
is
AArch64
*/
mov
x
2
,
#(
1
<<
0
)
/*
EL0
and
EL1
are
in
Non
-
Secure
state
*/
orr
x
2
,
x2
,
#(
1
<<
4
)
/*
RES1
*/
orr
x
2
,
x2
,
#(
1
<<
5
)
/*
RES1
*/
orr
x
2
,
x2
,
#(
1
<<
7
)
/*
SMC
instructions
are
undefined
at
EL1
and
above
*/
orr
x
2
,
x2
,
#(
1
<<
8
)
/*
HVC
instructions
are
enabled
at
EL1
and
above
*/
orr
x
2
,
x2
,
#(
1
<<
10
)
/*
The
next
lower
level
is
AArch64
*/
msr
scr_el3
,
x2
/
*
Change
execution
level
to
EL2
*/
mov
x2
,
#
0x3c9
msr
spsr_el3
,
x2
/*
0
b1111001001
*/
adr
x2
,
cpu_not_in_el3
...
...
@@ -51,8 +53,6 @@ cpu_not_in_el3: /* Running at EL2 or EL1 */
beq
cpu_in_el1
/*
Halt
this
core
if
running
in
El1
*/
cpu_in_el2
:
msr
sp_el1
,
x1
/
*
Enable
CNTP
for
EL1
*/
mrs
x0
,
cnthctl_el2
/*
Counter
-
timer
Hypervisor
Control
register
*/
orr
x0
,
x0
,
#
3
...
...
@@ -71,6 +71,7 @@ cpu_in_el2:
eret
cpu_in_el1
:
msr
spsel
,
#
1
mov
sp
,
x1
/*
Set
sp
in
el1
*/
/
*
Avoid
trap
from
SIMD
or
float
point
instruction
*/
...
...
@@ -89,7 +90,7 @@ cpu_in_el1:
clean_bss_loop
:
cbz
w2
,
jump_to_entry
str
xzr
,
[
x1
],
#
8
sub
w2
,
w2
,
#
1
sub
w2
,
w2
,
#
8
cbnz
w2
,
clean_bss_loop
jump_to_entry
:
...
...
src/thread.c
浏览文件 @
efbdbc26
...
...
@@ -31,6 +31,7 @@
#include <rthw.h>
#include <rtthread.h>
#include <stddef.h>
#ifdef RT_USING_HOOK
static
void
(
*
rt_thread_suspend_hook
)(
rt_thread_t
thread
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录