Makarand Pradhan | 30 Apr 2012 19:55
Favicon

Powerpc alignment exception

Hi,

There has been a thread on this topic in the past:

https://mail.gna.org/public/xenomai-help/2009-08/msg00023.html

A quick background: We get the alignment exception, as we pass 
-fpack-struct option to gcc and some data in structures is misaligned.

I have been testing the patch on Linux 3.0.0, Xenomai 2.6 and it seems 
to work well. Do you think, it requires any additional changes to be 
used with Xenomai 2.6?

Also, I am trying to understand how it works and have a question. Am 
summarizing my understanding below. Would appreciate your comments:

alignment_exception:

+     if (test_bit(IPIPE_NOSTACK_FLAG, &ipipe_this_cpudom_var(status)) &&
+         ipipe_trap_notify(IPIPE_TRAP_ALIGNMENT, regs))
               return;

I believe, the IPIPE_NOSTACK_FLAG is set when we are running in Linux. 
So we should invoke ipipe_trap_notify only while we are running in 
linux.  While running in the primary domain, we would go ahead and fix 
the alignment.

+     if (!ipipe_root_domain_p &&
+         ipipe_trap_notify(IPIPE_TRAP_ALIGNMENT, regs))
+             return;
(Continue reading)

Philippe Gerum | 1 May 2012 09:45
Favicon

Re: Powerpc alignment exception

On 04/30/2012 07:55 PM, Makarand Pradhan wrote:
> Hi,
>
> There has been a thread on this topic in the past:
>
> https://mail.gna.org/public/xenomai-help/2009-08/msg00023.html
>
> A quick background: We get the alignment exception, as we pass
> -fpack-struct option to gcc and some data in structures is misaligned.
>
> I have been testing the patch on Linux 3.0.0, Xenomai 2.6 and it seems
> to work well. Do you think, it requires any additional changes to be
> used with Xenomai 2.6?

This is not related to the Xenomai core, this is a pipeline issue. You 
can use whatever pipeline patch you need to.

>
> Also, I am trying to understand how it works and have a question. Am
> summarizing my understanding below. Would appreciate your comments:
>
> alignment_exception:
>
> + if (test_bit(IPIPE_NOSTACK_FLAG, &ipipe_this_cpudom_var(status)) &&
> + ipipe_trap_notify(IPIPE_TRAP_ALIGNMENT, regs))
> return;
>
> I believe, the IPIPE_NOSTACK_FLAG is set when we are running in Linux.

NOSTACK means "no linux task stack", i.e. Xenomai kernel thread context, 
(Continue reading)

Makarand Pradhan | 1 May 2012 16:56
Favicon

Re: Powerpc alignment exception

Thanks Philippe. That helps.

Rgds,
Makarand.

On 01/05/12 03:45 AM, Philippe Gerum wrote:
> On 04/30/2012 07:55 PM, Makarand Pradhan wrote:
>> Hi,
>>
>> There has been a thread on this topic in the past:
>>
>> https://mail.gna.org/public/xenomai-help/2009-08/msg00023.html
>>
>> A quick background: We get the alignment exception, as we pass
>> -fpack-struct option to gcc and some data in structures is misaligned.
>>
>> I have been testing the patch on Linux 3.0.0, Xenomai 2.6 and it seems
>> to work well. Do you think, it requires any additional changes to be
>> used with Xenomai 2.6?
> This is not related to the Xenomai core, this is a pipeline issue. You
> can use whatever pipeline patch you need to.
>
>> Also, I am trying to understand how it works and have a question. Am
>> summarizing my understanding below. Would appreciate your comments:
>>
>> alignment_exception:
>>
>> + if (test_bit(IPIPE_NOSTACK_FLAG,&ipipe_this_cpudom_var(status))&&
>> + ipipe_trap_notify(IPIPE_TRAP_ALIGNMENT, regs))
>> return;
(Continue reading)


Gmane