From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <478E1270.1000409@domain.hid> Date: Wed, 16 Jan 2008 15:19:28 +0100 From: "Bernhard Michael" MIME-Version: 1.0 References: <47891672.4050409@domain.hid> <2ff1a98a0801140525y2bc4a198o97967585f6de0f7c@domain.hid> <478B8249.90303@domain.hid> <2ff1a98a0801140752y5e6e47e2tb9980bfb344522a4@domain.hid> <478CAB5F.70208@domain.hid> <2ff1a98a0801150509w2dae4826r4696cd95c21aecb3@domain.hid> <478CBD27.4020501@domain.hid> <2ff1a98a0801150610n4404224bl98be4fcbccba70b7@domain.hid> <478DD90B.6020302@domain.hid> <2ff1a98a0801160249t7e4c1989i5ebde8e6b69d52e7@domain.hid> In-Reply-To: <2ff1a98a0801160249t7e4c1989i5ebde8e6b69d52e7@domain.hid> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] Xenomai problems on pxa List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai@xenomai.org Gilles Chanteperdrix wrote: > I do not know how to solve this. From my point of view, this is a > compiler bug: knowing that it uses instructions which needs 8 bytes > alignment, the compiler should align stack frames on 8 bytes > boundaries, period. Digging a bit in the mailing lists about stack alignment and EABI I find that gcc *realy* should handle proper stack alignment. See http://gcc.gnu.org/ml/gcc/2006-07/msg00030.html or http://www.codesourcery.com/archives/arm-gnu/msg01467.html Now, looking at the assembly code for the SWI handler, I see that ipipe introduces flowing code: #ifdef CONFIG_IPIPE stmfd sp!, {r0-r3, ip} add r1, sp, #S_OFF add r1, r1, #20 mov r0, scno bl __ipipe_syscall_root cmp r0, #0 ldmfd sp!, {r0-r3, ip} blt __ipipe_ret_fast_syscall bgt __ipipe_fast_exit_syscall #endif /* CONFIG_IPIPE */ Assuming that the stack was properly aligned before this code snipped the first instruction moves 20 bytes onto the stack. 20 modulo 8 = 4 which means, the stack is not 8-byte aligned any more. This could be the reason why the strd/ldrd instructions are failing later. I can't verify this on hardware now but I'll do it for sure. -- Michael