All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Disable all iinterrupts on xenomai
@ 2013-06-28 14:12 Paolo Minazzi
  2013-06-28 14:57 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Minazzi @ 2013-06-28 14:12 UTC (permalink / raw)
  To: xenomai

Hi to all

I have to disable completely interrupts on arm on xenomai 2.5.6
I have a small piece of code that no one must interrupt.

I have seen there are a lot of #define and I have tried all.
1) rthal_local_irq_save
2) local_irq_save_hw
3) rthal_irq_disable (this seems to work but I have to disable all irq 
lines)
4) inline asm on cpsr register with mask 0x40 and 0x80

I have tried all, but the best way seems

#define my_local_irq_save(x)      ((x) = 
ipipe_test_and_stall_pipeline_head() & 1)
#define my_local_irq_restore(x)   ipipe_restore_pipeline_head(x)

but sometimes seems not works.

I only need the simple concept of local_irq_save and local_irq restore 
of standard linux.
Is there something similar on xenomai ?

Thanks in advance

Paolo



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai] Disable all iinterrupts on xenomai
  2013-06-28 14:12 [Xenomai] Disable all iinterrupts on xenomai Paolo Minazzi
@ 2013-06-28 14:57 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2013-06-28 14:57 UTC (permalink / raw)
  To: Paolo Minazzi; +Cc: xenomai

On 06/28/2013 04:12 PM, Paolo Minazzi wrote:
> Hi to all
>
> I have to disable completely interrupts on arm on xenomai 2.5.6
> I have a small piece of code that no one must interrupt.
>
> I have seen there are a lot of #define and I have tried all.
> 1) rthal_local_irq_save
> 2) local_irq_save_hw
> 3) rthal_irq_disable (this seems to work but I have to disable all irq
> lines)

Nope. rthal_irq_disable() is the strict equivalent of 
local_irq_disable() from a non-virtualized IRQ context. This masks out 
interrupts at CPU level.

> 4) inline asm on cpsr register with mask 0x40 and 0x80
>

This may not be what you need, as this does not account for the 
virtualized interrupt state the interrupt pipeline manages.

> I have tried all, but the best way seems
>
> #define my_local_irq_save(x)      ((x) =
> ipipe_test_and_stall_pipeline_head() & 1)
> #define my_local_irq_restore(x)   ipipe_restore_pipeline_head(x)
>
> but sometimes seems not works.

Certainly it does work, always. The entire house is built on top of 
this. You may want to check your test code again.

>
> I only need the simple concept of local_irq_save and local_irq restore
> of standard linux.
> Is there something similar on xenomai ?
>

Over Xenomai 2.x, rthal_local_irq_save()/restore() is a wrapper to the 
proper implementation, which depends on the underlying I-pipe code.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-28 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 14:12 [Xenomai] Disable all iinterrupts on xenomai Paolo Minazzi
2013-06-28 14:57 ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.