diff options
author | Hesham ALMatary <heshamelmatary@gmail.com> | 2014-09-15 17:33:28 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-09-16 09:52:56 -0500 |
commit | eb14fc2b2ea49aa8a7b4f464de9360a129845b73 (patch) | |
tree | 7e420a6627016c823c7fc905c160f3c9cc9d3f67 /cpukit/score/cpu/or1k/or1k-context-initialize.c | |
parent | sptests/sp07: Minimize thread dispatch latency (diff) | |
download | rtems-eb14fc2b2ea49aa8a7b4f464de9360a129845b73.tar.bz2 |
OpenRISC: Account for red-zone (fixup printf bug).
This patch allocate a space in the stack to account for red-zone
that gcc may utilize for the use of leaf functions. Care must be
taken to handle this red-zone from many places:
1- Upon creation of a new thread stack.
2- Once an interrupt entred.
Also moving the enable-thread-dispach() and increment ISR level before
checking if dispatch needed was required.
The previous modifications solved the printf bug which disabled ticker
to output strings after context switches that arise from Thread_Delay_ended.
Diffstat (limited to 'cpukit/score/cpu/or1k/or1k-context-initialize.c')
-rw-r--r-- | cpukit/score/cpu/or1k/or1k-context-initialize.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/score/cpu/or1k/or1k-context-initialize.c b/cpukit/score/cpu/or1k/or1k-context-initialize.c index 7ac2875ce7..1c9cdd7b5e 100644 --- a/cpukit/score/cpu/or1k/or1k-context-initialize.c +++ b/cpukit/score/cpu/or1k/or1k-context-initialize.c @@ -29,7 +29,8 @@ void _CPU_Context_Initialize( void *tls_area ) { - uint32_t stack = (uint32_t) stack_area_begin; + /* Decrement 200 byte to account for red-zone */ + uint32_t stack = ((uint32_t) stack_area_begin) - 200; uint32_t sr; sr = _OR1K_mfspr(CPU_OR1K_SPR_SR); |