File tree 3 files changed +15
-19
lines changed
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/).
62
62
allow users get the initial address of the heap when initializing an allocator.
63
63
- Update documentation.
64
64
- 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) ` .
65
67
66
68
## [ v0.13.0] - 2024-10-19
67
69
Original file line number Diff line number Diff line change 22
22
means that you won't see "Address (..) is out of bounds" in the disassembly produced by `objdump`.
23
23
*/
24
24
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
+
25
29
/* Default trap entry point. The riscv-rt crate provides a weak alias of this function,
26
30
which saves caller saved registers, calls _start_trap_rust, restores caller saved registers
27
31
and then returns. Users can override this alias by defining the symbol themselves */
28
32
EXTERN(_start_trap);
29
33
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 );
33
37
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 );
37
41
38
42
/* Default interrupt trap entry point. When vectored trap mode is enabled,
39
43
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:",
251
251
#[ cfg( not( feature = "s-mode" ) ) ]
252
252
"csrw mtvec, t0" ,
253
253
"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" ,
264
254
// Default implementation of `_pre_init_trap` is an infinite loop.
265
255
// Users can override this function by defining their own `_pre_init_trap`
266
256
// 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!();
278
268
#[ rustfmt:: skip]
279
269
global_asm ! (
280
270
".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 "
284
274
) ;
You can’t perform that action at this time.
0 commit comments