<div dir="ltr">Hi,<div><br></div><div>Please do not miss this patch, it fixes a critical bug in the new or1k port.</div><div><br></div><div>Regards,</div><div>Hesham</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 19, 2014 at 4:55 PM, Hesham ALMatary <span dir="ltr"><<a href="mailto:heshamelmatary@gmail.com" target="_blank">heshamelmatary@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Since or1k architecture stack grows down, threads should be initialized<br>
with high stack addresses instead of lower ones. This is done in<br>
_CPU_Context_Initialize function.<br>
---<br>
cpukit/score/cpu/or1k/or1k-context-initialize.c | 5 +++--<br>
1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/cpukit/score/cpu/or1k/or1k-context-initialize.c b/cpukit/score/cpu/or1k/or1k-context-initialize.c<br>
index 1c9cdd7..a7205e3 100644<br>
--- a/cpukit/score/cpu/or1k/or1k-context-initialize.c<br>
+++ b/cpukit/score/cpu/or1k/or1k-context-initialize.c<br>
@@ -32,13 +32,14 @@ void _CPU_Context_Initialize(<br>
/* Decrement 200 byte to account for red-zone */<br>
uint32_t stack = ((uint32_t) stack_area_begin) - 200;<br>
uint32_t sr;<br>
+ uint32_t stack_high = stack + stack_area_size;<br>
<br>
sr = _OR1K_mfspr(CPU_OR1K_SPR_SR);<br>
<br>
memset(context, 0, sizeof(*context));<br>
<br>
- context->r1 = stack;<br>
- context->r2 = stack;<br>
+ context->r1 = stack_high;<br>
+ context->r2 = stack_high;<br>
context->r9 = (uint32_t) entry_point;<br>
context->sr = sr;<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.3<br>
<br>
</font></span></blockquote></div><br></div>