File tree 3 files changed +31
-15
lines changed
3 files changed +31
-15
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
9
9
10
10
### Changed
11
11
12
+ - Add documentation to trap frame fields.
13
+ - Avoid using ` t3 ` + in startup assembly to ensure compatibility with RVE32.
12
14
- ` link.x.in ` : remove references to ` eh_frame ` .
13
15
- Rename start/end section symbols to align with ` cortex-m-rt ` :
14
16
- ` _stext ` : it remains, as linker files can modify it.
Original file line number Diff line number Diff line change @@ -107,13 +107,12 @@ cfg_global_asm!(
107
107
#[ cfg( riscvm) ]
108
108
"mul t0, t2, t0" ,
109
109
#[ cfg( not( riscvm) ) ]
110
- "beqz t2, 2f // Jump if single-hart
111
- mv t1, t2
112
- mv t3, t0
110
+ "beqz t2, 2f // skip if hart ID is 0
111
+ mv t1, t0
113
112
1:
114
- add t0, t0, t3
115
- addi t1, t1 , -1
116
- bnez t1 , 1b
113
+ add t0, t0, t1
114
+ addi t2, t2 , -1
115
+ bnez t2 , 1b
117
116
2: " ,
118
117
) ;
119
118
cfg_global_asm ! (
@@ -153,22 +152,22 @@ cfg_global_asm!(
153
152
"call __pre_init
154
153
// Copy .data from flash to RAM
155
154
la t0, __sdata
156
- la t2 , __edata
155
+ la a0 , __edata
157
156
la t1, __sidata
158
- bgeu t0, t2 , 2f
157
+ bgeu t0, a0 , 2f
159
158
1: " ,
160
159
#[ cfg( target_arch = "riscv32" ) ]
161
- "lw t3 , 0(t1)
160
+ "lw t2 , 0(t1)
162
161
addi t1, t1, 4
163
- sw t3 , 0(t0)
162
+ sw t2 , 0(t0)
164
163
addi t0, t0, 4
165
- bltu t0, t2 , 1b" ,
164
+ bltu t0, a0 , 1b" ,
166
165
#[ cfg( target_arch = "riscv64" ) ]
167
- "ld t3 , 0(t1)
166
+ "ld t2 , 0(t1)
168
167
addi t1, t1, 8
169
- sd t3 , 0(t0)
168
+ sd t2 , 0(t0)
170
169
addi t0, t0, 8
171
- bltu t0, t2 , 1b" ,
170
+ bltu t0, a0 , 1b" ,
172
171
"
173
172
2: // Zero out .bss
174
173
la t0, __sbss
Original file line number Diff line number Diff line change @@ -567,25 +567,40 @@ pub use riscv_rt_macros::core_interrupt_riscv64 as core_interrupt; // just for d
567
567
pub static __ONCE__: ( ) = ( ) ;
568
568
569
569
/// Registers saved in trap handler
570
- #[ allow( missing_docs) ]
571
570
#[ repr( C ) ]
572
571
#[ derive( Debug ) ]
573
572
pub struct TrapFrame {
573
+ /// `x1`: return address, stores the address to return to after a function call or interrupt.
574
574
pub ra : usize ,
575
+ /// `x5`: temporary register `t0`, used for intermediate values.
575
576
pub t0 : usize ,
577
+ /// `x6`: temporary register `t1`, used for intermediate values.
576
578
pub t1 : usize ,
579
+ /// `x7`: temporary register `t2`, used for intermediate values.
577
580
pub t2 : usize ,
581
+ /// `x28`: temporary register `t3`, used for intermediate values.
578
582
pub t3 : usize ,
583
+ /// `x29`: temporary register `t4`, used for intermediate values.
579
584
pub t4 : usize ,
585
+ /// `x30`: temporary register `t5`, used for intermediate values.
580
586
pub t5 : usize ,
587
+ /// `x31`: temporary register `t6`, used for intermediate values.
581
588
pub t6 : usize ,
589
+ /// `x10`: argument register `a0`. Used to pass the first argument to a function.
582
590
pub a0 : usize ,
591
+ /// `x11`: argument register `a1`. Used to pass the second argument to a function.
583
592
pub a1 : usize ,
593
+ /// `x12`: argument register `a2`. Used to pass the third argument to a function.
584
594
pub a2 : usize ,
595
+ /// `x13`: argument register `a3`. Used to pass the fourth argument to a function.
585
596
pub a3 : usize ,
597
+ /// `x14`: argument register `a4`. Used to pass the fifth argument to a function.
586
598
pub a4 : usize ,
599
+ /// `x15`: argument register `a5`. Used to pass the sixth argument to a function.
587
600
pub a5 : usize ,
601
+ /// `x16`: argument register `a6`. Used to pass the seventh argument to a function.
588
602
pub a6 : usize ,
603
+ /// `x17`: argument register `a7`. Used to pass the eighth argument to a function.
589
604
pub a7 : usize ,
590
605
}
591
606
You can’t perform that action at this time.
0 commit comments