File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,6 +271,14 @@ void reset_cpu(void) {
271271 reset ();
272272}
273273
274+ uint32_t * port_stack_get_limit (void ) {
275+ return & _ebss ;
276+ }
277+
278+ uint32_t * port_stack_get_top (void ) {
279+ return & _estack ;
280+ }
281+
274282// Place the word to save 8k from the end of RAM so we and the bootloader don't clobber it.
275283#ifdef SAMD21
276284uint32_t * safe_word = (uint32_t * ) (HMCRAMC0_ADDR + HMCRAMC0_SIZE - 0x2000 );
Original file line number Diff line number Diff line change @@ -67,6 +67,14 @@ void reset_port(void) {
6767void reset_to_bootloader (void ) {
6868}
6969
70+ uint32_t * port_stack_get_limit (void ) {
71+ return & _ebss ;
72+ }
73+
74+ uint32_t * port_stack_get_top (void ) {
75+ return & _estack ;
76+ }
77+
7078extern uint32_t _ebss ;
7179
7280// Place the word to save just after our BSS section that gets blanked.
Original file line number Diff line number Diff line change @@ -146,6 +146,14 @@ void reset_cpu(void) {
146146 NVIC_SystemReset ();
147147}
148148
149+ uint32_t * port_stack_get_limit (void ) {
150+ return & _ebss ;
151+ }
152+
153+ uint32_t * port_stack_get_top (void ) {
154+ return & _estack ;
155+ }
156+
149157extern uint32_t _ebss ;
150158// Place the word to save just after our BSS section that gets blanked.
151159void port_set_saved_word (uint32_t value ) {
Original file line number Diff line number Diff line change @@ -67,6 +67,14 @@ void reset_cpu(void) {
6767 NVIC_SystemReset ();
6868}
6969
70+ uint32_t * port_stack_get_limit (void ) {
71+ return & _ebss ;
72+ }
73+
74+ uint32_t * port_stack_get_top (void ) {
75+ return & _estack ;
76+ }
77+
7078extern uint32_t _ebss ;
7179// Place the word to save just after our BSS section that gets blanked.
7280void port_set_saved_word (uint32_t value ) {
Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ void reset_board(void);
5454// Reset to the bootloader
5555void reset_to_bootloader (void );
5656
57+ // Get stack limit address
58+ uint32_t * port_stack_get_limit (void );
59+
60+ // Get stack top address
61+ uint32_t * port_stack_get_top (void );
62+
5763// Save and retrieve a word from memory that is preserved over reset. Used for safe mode.
5864void port_set_saved_word (uint32_t );
5965uint32_t port_get_saved_word (void );
You can’t perform that action at this time.
0 commit comments