diff options
author | Hesham ALMatary <heshamelmatary@gmail.com> | 2014-09-19 09:55:09 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-09-29 14:36:52 -0500 |
commit | 5464752f79983a84d81ba9022da1ee588a2f839c (patch) | |
tree | 25a8b245ff68e47c7abd92d2634d882cf4287270 /cpukit/score/cpu | |
parent | bsp/genmcf548x: Use inline cache implementation (diff) | |
download | rtems-5464752f79983a84d81ba9022da1ee588a2f839c.tar.bz2 |
or1k fix bug: Initialize thread context with higher stack address.
Since or1k architecture stack grows down, threads should be initialized
with high stack addresses instead of lower ones. This is done in
_CPU_Context_Initialize function.
Diffstat (limited to 'cpukit/score/cpu')
-rw-r--r-- | cpukit/score/cpu/or1k/or1k-context-initialize.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/score/cpu/or1k/or1k-context-initialize.c b/cpukit/score/cpu/or1k/or1k-context-initialize.c index 1c9cdd7b5e..a7205e39f5 100644 --- a/cpukit/score/cpu/or1k/or1k-context-initialize.c +++ b/cpukit/score/cpu/or1k/or1k-context-initialize.c @@ -32,13 +32,14 @@ void _CPU_Context_Initialize( /* Decrement 200 byte to account for red-zone */ uint32_t stack = ((uint32_t) stack_area_begin) - 200; uint32_t sr; + uint32_t stack_high = stack + stack_area_size; sr = _OR1K_mfspr(CPU_OR1K_SPR_SR); memset(context, 0, sizeof(*context)); - context->r1 = stack; - context->r2 = stack; + context->r1 = stack_high; + context->r2 = stack_high; context->r9 = (uint32_t) entry_point; context->sr = sr; } |