forked from RT-Thread/rt-thread
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: libcpu/risc-v: unify low-level bringups
This patch consolidates the separated architecture-specific code for rv64 (virt64 and c906) under a more unified approach. The changes aim to enhance maintainability and code reuse, reducing duplication between these two architectures while adding small improvements in porting compatibility. Changes: - Modified build scripts (SConscript) for both virt64 and c906 to remove ASID and vector dependencies when not required. - Updated c906's sbi.c and sbi.h to use standard integer types (uint32_t) and include the missing <stdint.h> header. - Unified inline function declaration for `sbi_call` across both c906 and virt64 using `rt_inline`. - Disabled FPU and vector in c906's startup assembly file, aligning it with the virt64 handling. - Corrected syscall handler type definitions in c906 for consistency. Signed-off-by: Shell <[email protected]>
- Loading branch information
1 parent
e244c19
commit c78a19e
Showing
8 changed files
with
19 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# RT-Thread building script for component | ||
|
||
from building import * | ||
|
||
cwd = GetCurrentDir() | ||
src = Glob('*.c') + Glob('*.cpp') + Glob('*_gcc.S') | ||
CPPPATH = [cwd] | ||
|
||
if not GetDepend('ARCH_USING_ASID'): | ||
SrcRemove(src, ['asid.c']) | ||
|
||
group = DefineGroup('libcpu', src, depend = [''], CPPPATH = CPPPATH) | ||
|
||
Return('group') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
# RT-Thread building script for component | ||
|
||
from building import * | ||
|
||
Import('rtconfig') | ||
|
||
cwd = GetCurrentDir() | ||
src = Glob('*.c') + Glob('*.cpp') + Glob('*_gcc.S') | ||
src = src + ['../common/atomic_riscv.c'] | ||
CPPPATH = [cwd] | ||
|
||
if not GetDepend('ARCH_USING_ASID'): | ||
SrcRemove(src, ['asid.c']) | ||
|
||
if not GetDepend('ARCH_RISCV_VECTOR'): | ||
SrcRemove(src, ['vector_gcc.S']) | ||
|
||
group = DefineGroup('libcpu', src, depend = [''], CPPPATH = CPPPATH) | ||
|
||
Return('group') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters