File tree Expand file tree Collapse file tree 3 files changed +15
-19
lines changed Expand file tree Collapse file tree 3 files changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
6262 allow users get the initial address of the heap when initializing an allocator.
6363- Update documentation.
6464- Removed ` .init.rust ` section, as it is no longer required.
65+ - Add global ` _abort ` symbol, ` PROVIDE(abort = _abort) ` , and replace ` DefaultHandler ` and
66+ ` ExceptionHandler ` with ` PROVIDE(... = abort) ` .
6567
6668## [ v0.13.0] - 2024-10-19
6769
Original file line number Diff line number Diff line change 2222 means that you won't see "Address (..) is out of bounds" in the disassembly produced by `objdump`.
2323*/
2424
25+ /* Default abort entry point. If no abort symbol is provided, then abort maps to _abort. */
26+ EXTERN(_default_abort);
27+ PROVIDE(abort = _default_abort);
28+
2529/* Default trap entry point. The riscv-rt crate provides a weak alias of this function,
2630 which saves caller saved registers, calls _start_trap_rust, restores caller saved registers
2731 and then returns. Users can override this alias by defining the symbol themselves */
2832EXTERN(_start_trap);
2933
30- /* Default exception handler. The riscv-rt crate provides a weak alias of this function,
31- which is a busy loop. Users can override this alias by defining the symbol themselves */
32- EXTERN (ExceptionHandler);
34+ /* Default exception handler. By default, the exception handler is abort.
35+ Users can override this alias by defining the symbol themselves */
36+ PROVIDE (ExceptionHandler = abort );
3337
34- /* Default interrupt handler. The riscv-rt crate provides a weak alias of this function,
35- which is a busy loop. Users can override this alias by defining the symbol themselves */
36- EXTERN (DefaultHandler);
38+ /* Default interrupt handler. By default, the interrupt handler is abort.
39+ Users can override this alias by defining the symbol themselves */
40+ PROVIDE (DefaultHandler = abort );
3741
3842/* Default interrupt trap entry point. When vectored trap mode is enabled,
3943 the riscv-rt crate provides an implementation of this function, which saves caller saved
Original file line number Diff line number Diff line change @@ -251,16 +251,6 @@ _setup_interrupts:",
251251 #[ cfg( not( feature = "s-mode" ) ) ]
252252 "csrw mtvec, t0" ,
253253 "ret" ,
254- // Default implementation of `ExceptionHandler` is an infinite loop.
255- // Users can override this function by defining their own `ExceptionHandler`
256- ".weak ExceptionHandler
257- ExceptionHandler:
258- j ExceptionHandler" ,
259- // Default implementation of `DefaultHandler` is an infinite loop.
260- // Users can override this function by defining their own `DefaultHandler`
261- ".weak DefaultHandler
262- DefaultHandler:
263- j DefaultHandler" ,
264254 // Default implementation of `_pre_init_trap` is an infinite loop.
265255 // Users can override this function by defining their own `_pre_init_trap`
266256 // If the execution reaches this point, it means that there is a bug in the boot code.
@@ -278,7 +268,7 @@ riscv_rt_macros::vectored_interrupt_trap!();
278268#[ rustfmt:: skip]
279269global_asm ! (
280270 ".section .text.abort
281- .weak abort
282- abort : // make sure there is an abort symbol when linking
283- j abort "
271+ .global _default_abort
272+ _default_abort : // make sure there is an abort symbol when linking
273+ j _default_abort "
284274) ;
You can’t perform that action at this time.
0 commit comments