Module: xenomai-rpm
Branch: for-upstream
Commit: a5886b354dc18f054b187b58cfbacfb60bccaf47
URL:    
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Jan 22 18:09:10 2011 +0100

hal/powerpc: provide minimum stack frame on entry to kthreads

This patch fixes the regression introduced by 90699565cbce. Xenomai
kernel threads were not given any minimum stack frame, leading to
random memory corruption, particularly on powerpc64.

---

 ksrc/arch/powerpc/switch_32.S |    1 +
 ksrc/arch/powerpc/switch_64.S |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ksrc/arch/powerpc/switch_32.S b/ksrc/arch/powerpc/switch_32.S
index d2ab314..d170df4 100644
--- a/ksrc/arch/powerpc/switch_32.S
+++ b/ksrc/arch/powerpc/switch_32.S
@@ -193,6 +193,7 @@ same_current:
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) */
 
 _GLOBAL(rthal_thread_trampoline)
+       stwu    r1,-STACK_FRAME_OVERHEAD(r1)
        mr      r3,r22
        mtlr    r23
        blr
diff --git a/ksrc/arch/powerpc/switch_64.S b/ksrc/arch/powerpc/switch_64.S
index b15fa58..aaafaee 100644
--- a/ksrc/arch/powerpc/switch_64.S
+++ b/ksrc/arch/powerpc/switch_64.S
@@ -396,6 +396,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #endif /* Linux >= 2.6.32 */
 
 _GLOBAL(rthal_thread_trampoline)
+       stdu    r1,-STACK_FRAME_OVERHEAD(r1)
        mr      r3,r22
        mr      r2,r24
        mtlr    r23


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to