diff options
author | Andrew Ruder <andrew.ruder@elecsyscorp.com> | 2015-10-05 13:51:10 -0500 |
---|---|---|
committer | Freddie Chopin <freddie.chopin@gmail.com> | 2015-10-30 23:41:44 +0000 |
commit | 9413a7a814755f3fab92f460bfbdd518f24ffaf5 (patch) | |
tree | 778b48c83cfa0a273898810eb93dbf3bc2ffc3ed /src/rtos/rtos_standard_stackings.h | |
parent | ddc3317c54c3f2327cdd07d87f997197200a385e (diff) |
rtos: turn stack alignment into a function pointer
Some targets (Cortex M) require more complicated calculations for
turning the stored stack pointer back into a process stack pointer.
For example, the Cortex M stores a bit in the auto-stacked xPSR
indicating that alignment had to be performed and an additional 4
byte padding is present before the exception stacking. This change
only sets up the framework for Cortex-M unstacking and does not
add Cortex-M support.
Note: this also fixes the alignment calculation nearly addressed by
change #2301 entitled rtos/rtos.c: fix stack alignment calculation.
Updated calculation is in rtos_generic_stack_align.
Change-Id: I0f662cad0df81cbe5866219ad0fef980dcb3e44f
Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Cc: Paul Fertser <fercerpav@gmail.com>
Cc: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Cc: Evan Hunter <evanhunter920@gmail.com>
Cc: Jon Burgess <jburgess777@gmail.com>
Reviewed-on: http://openocd.zylin.com/3002
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
Diffstat (limited to 'src/rtos/rtos_standard_stackings.h')
-rw-r--r-- | src/rtos/rtos_standard_stackings.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rtos/rtos_standard_stackings.h b/src/rtos/rtos_standard_stackings.h index b76e2bb6..c64a4be0 100644 --- a/src/rtos/rtos_standard_stackings.h +++ b/src/rtos/rtos_standard_stackings.h @@ -30,5 +30,8 @@ extern const struct rtos_register_stacking rtos_standard_Cortex_M3_stacking; extern const struct rtos_register_stacking rtos_standard_Cortex_R4_stacking; extern const struct rtos_register_stacking rtos_standard_NDS32_N1068_stacking; +int64_t rtos_generic_stack_align8(struct target *target, + const uint8_t *stack_data, const struct rtos_register_stacking *stacking, + int64_t stack_ptr); #endif /* ifndef INCLUDED_RTOS_STANDARD_STACKINGS_H_ */ |