|
22 | 22 | means that you won't see "Address (..) is out of bounds" in the disassembly produced by `objdump`.
|
23 | 23 | */
|
24 | 24 |
|
25 |
| -PROVIDE(_stext = ORIGIN(REGION_TEXT)); |
26 |
| -PROVIDE(_stack_start = ORIGIN(REGION_STACK) + LENGTH(REGION_STACK)); |
27 |
| -PROVIDE(_max_hart_id = 0); |
28 |
| -PROVIDE(_hart_stack_size = 2K); |
29 |
| -PROVIDE(_heap_size = 0); |
30 |
| - |
31 |
| -/** TRAP ENTRY POINTS **/ |
32 |
| - |
33 | 25 | /* Default trap entry point. The riscv-rt crate provides a weak alias of this function,
|
34 | 26 | which saves caller saved registers, calls _start_trap_rust, restores caller saved registers
|
35 | 27 | and then returns. Users can override this alias by defining the symbol themselves */
|
36 | 28 | EXTERN(_start_trap);
|
37 | 29 |
|
38 |
| -/* Default interrupt trap entry point. When vectored trap mode is enabled, |
39 |
| - the riscv-rt crate provides an implementation of this function, which saves caller saved |
40 |
| - registers, calls the the DefaultHandler ISR, restores caller saved registers and returns. */ |
41 |
| -PROVIDE(_start_DefaultHandler_trap = _start_trap); |
42 |
| - |
43 |
| -/* When vectored trap mode is enabled, each interrupt source must implement its own |
44 |
| - trap entry point. By default, all interrupts start in _start_trap. However, users can |
45 |
| - override these alias by defining the symbol themselves */ |
46 |
| -PROVIDE(_start_SupervisorSoft_trap = _start_DefaultHandler_trap); |
47 |
| -PROVIDE(_start_MachineSoft_trap = _start_DefaultHandler_trap); |
48 |
| -PROVIDE(_start_SupervisorTimer_trap = _start_DefaultHandler_trap); |
49 |
| -PROVIDE(_start_MachineTimer_trap = _start_DefaultHandler_trap); |
50 |
| -PROVIDE(_start_SupervisorExternal_trap = _start_DefaultHandler_trap); |
51 |
| -PROVIDE(_start_MachineExternal_trap = _start_DefaultHandler_trap); |
52 |
| - |
53 |
| -/** EXCEPTION HANDLERS **/ |
54 |
| - |
55 | 30 | /* Default exception handler. The riscv-rt crate provides a weak alias of this function,
|
56 | 31 | which is a busy loop. Users can override this alias by defining the symbol themselves */
|
57 | 32 | EXTERN(ExceptionHandler);
|
58 | 33 |
|
59 |
| -/* It is possible to define a special handler for each exception type. |
60 |
| - By default, all exceptions are handled by ExceptionHandler. However, users can |
61 |
| - override these alias by defining the symbol themselves */ |
62 |
| -PROVIDE(InstructionMisaligned = ExceptionHandler); |
63 |
| -PROVIDE(InstructionFault = ExceptionHandler); |
64 |
| -PROVIDE(IllegalInstruction = ExceptionHandler); |
65 |
| -PROVIDE(Breakpoint = ExceptionHandler); |
66 |
| -PROVIDE(LoadMisaligned = ExceptionHandler); |
67 |
| -PROVIDE(LoadFault = ExceptionHandler); |
68 |
| -PROVIDE(StoreMisaligned = ExceptionHandler); |
69 |
| -PROVIDE(StoreFault = ExceptionHandler); |
70 |
| -PROVIDE(UserEnvCall = ExceptionHandler); |
71 |
| -PROVIDE(SupervisorEnvCall = ExceptionHandler); |
72 |
| -PROVIDE(MachineEnvCall = ExceptionHandler); |
73 |
| -PROVIDE(InstructionPageFault = ExceptionHandler); |
74 |
| -PROVIDE(LoadPageFault = ExceptionHandler); |
75 |
| -PROVIDE(StorePageFault = ExceptionHandler); |
76 |
| - |
77 |
| -/** INTERRUPT HANDLERS **/ |
78 |
| - |
79 | 34 | /* Default interrupt handler. The riscv-rt crate provides a weak alias of this function,
|
80 | 35 | which is a busy loop. Users can override this alias by defining the symbol themselves */
|
81 | 36 | EXTERN(DefaultHandler);
|
82 | 37 |
|
83 |
| -/* It is possible to define a special handler for each interrupt type. |
84 |
| - By default, all interrupts are handled by DefaultHandler. However, users can |
85 |
| - override these alias by defining the symbol themselves */ |
86 |
| -PROVIDE(SupervisorSoft = DefaultHandler); |
87 |
| -PROVIDE(MachineSoft = DefaultHandler); |
88 |
| -PROVIDE(SupervisorTimer = DefaultHandler); |
89 |
| -PROVIDE(MachineTimer = DefaultHandler); |
90 |
| -PROVIDE(SupervisorExternal = DefaultHandler); |
91 |
| -PROVIDE(MachineExternal = DefaultHandler); |
| 38 | +/* Default interrupt trap entry point. When vectored trap mode is enabled, |
| 39 | + the riscv-rt crate provides an implementation of this function, which saves caller saved |
| 40 | + registers, calls the the DefaultHandler ISR, restores caller saved registers and returns. |
| 41 | + Note, however, that this provided implementation cannot be overwritten. We use PROVIDE |
| 42 | + to avoid compilation errors in direct mode, not to allow users to overwrite the symbol. */ |
| 43 | +PROVIDE(_start_DefaultHandler_trap = _start_trap); |
| 44 | + |
| 45 | +${INCLUDE_LINKER_FILES} |
| 46 | + |
| 47 | +PROVIDE(_stext = ORIGIN(REGION_TEXT)); |
| 48 | +PROVIDE(_stack_start = ORIGIN(REGION_STACK) + LENGTH(REGION_STACK)); |
| 49 | +PROVIDE(_max_hart_id = 0); |
| 50 | +PROVIDE(_hart_stack_size = 2K); |
| 51 | +PROVIDE(_heap_size = 0); |
92 | 52 |
|
93 | 53 | SECTIONS
|
94 | 54 | {
|
|
0 commit comments