File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212- New GitHub workflow for checking invalid labels in PRs
1313- New GitHub workflow for checking modifications on CHANGELOG.md
1414- New GitHub workflow for checking clippy lints in PRs
15+ - Optional cargo feature ` single-hart ` for single CPU targets
1516
1617### Changed
1718
Original file line number Diff line number Diff line change @@ -85,17 +85,16 @@ _abs_start:
8585 .option push
8686 .option norelax
8787 la gp, __global_pointer$
88- .option pop" ,
88+ .option pop
89+ // Allocate stacks" ,
8990 #[ cfg( all( not( feature = "single-hart" ) , feature = "s-mode" ) ) ]
9091 "mv t2, a0 // the hartid is passed as parameter by SMODE" ,
9192 #[ cfg( all( not( feature = "single-hart" ) , not( feature = "s-mode" ) ) ) ]
9293 "csrr t2, mhartid" ,
9394 #[ cfg( not( feature = "single-hart" ) ) ]
9495 "lui t0, %hi(_max_hart_id)
9596 add t0, t0, %lo(_max_hart_id)
96- bgtu t2, t0, abort" ,
97- "// Allocate stacks
98- la sp, _stack_start
97+ bgtu t2, t0, abort
9998 lui t0, %hi(_hart_stack_size)
10099 add t0, t0, %lo(_hart_stack_size)" ,
101100 #[ cfg( all( not( feature = "single-hart" ) , riscvm) ) ]
@@ -109,9 +108,10 @@ _abs_start:
109108 addi t1, t1, -1
110109 bnez t1, 1b
1111102: " ,
112- "sub sp, sp, t0
113-
114- // Set frame pointer
111+ "la sp, _stack_start" ,
112+ #[ cfg( not( feature = "single-hart" ) ) ]
113+ "sub sp, sp, t0" ,
114+ "// Set frame pointer
115115 add s0, sp, zero
116116
117117 jal zero, _start_rust
Original file line number Diff line number Diff line change 327327//!
328328//! ## `single-hart`
329329//!
330- //! This feature saves a little code size by removing unnecessary stack space calculation if there is only one hart on the target.
330+ //! This feature saves a little code size if there is only one hart on the target.
331331//!
332332//! ## `s-mode`
333333//!
You can’t perform that action at this time.
0 commit comments