<p dir="ltr"><br>
On Jul 5, 2013 1:20 PM, "Raj Ravi" <<a href="mailto:mekaviraj@gmail.com">mekaviraj@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
> I have gone through the code.<br>
><br>
> Please correct / provide your insights on my understanding.<br>
> 1. There is no difference between local_irq_save and raw_local_irq_save with ARM architecture. ?<br>
Yes,mostly there is no difference except in <br>
local_irq_save we enable some tracing options.<br>
><br>
> 2. As per the below code,<br>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<br>
> 13 static inline unsigned long arch_local_irq_save(void)<br>
> 14 {<br>
> 15 unsigned long flags;<br>
> 16 <br>
> 17 asm volatile(<br>
> 18 " mrs %0, cpsr @ arch_local_irq_save\n"<br>
> 19 " cpsid i"<br>
> 20 : "=r" (flags) : : "memory", "cc");<br>
> 21 return flags;<br>
> 22 }<br>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<br>
> Here, Flags contain the result of PRIMASK register. before interrupts are disabled ?? <br>
Well that is assembly and my weakness<br>
so my best answer would be that it just stores the previous state of interrupt status register and we restore it back when we call<br>
restore function.<br>
><br>
> References:<br>
> About CPSID instruction :<br>
> <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/BABHBAAB.html">http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/BABHBAAB.html</a><br>
> CPSID i ; Disable all interrupts except NMI (set <a href="http://PRIMASK.PM">PRIMASK.PM</a>)<br>
> Registers overview :<br>
> <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/CHDBIBGJ.html">http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/CHDBIBGJ.html</a><br>
> About PRIMASK register:<br>
> <a href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/CHDBIBGJ.html#BABBBGEA">http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/CHDBIBGJ.html#BABBBGEA</a><br>
> ARM GCC inline assembly:<br>
> <a href="http://www.ethernut.de/en/documents/arm-inline-asm.html">http://www.ethernut.de/en/documents/arm-inline-asm.html</a><br>
><br>
> Please provide your insights.<br>
><br>
> Thanks !<br>
> Kavi<br>
><br>
><br>
><br>
> On Thu, Jul 4, 2013 at 4:38 PM, anish singh <<a href="mailto:anish198519851985@gmail.com">anish198519851985@gmail.com</a>> wrote:<br>
>><br>
>> On Thu, Jul 4, 2013 at 3:19 PM, Raj Ravi <<a href="mailto:mekaviraj@gmail.com">mekaviraj@gmail.com</a>> wrote:<br>
>> > Thanks Anish.<br>
>> ><br>
>> > As for local_irq_save and raw_local_irq_save, it seems<br>
>> > local_irq_save - called at many different places while raw_local_irq_save is<br>
>> > called in fewer places.<br>
>> ><br>
>> > local_irq_save - does not disable Hardware<br>
>> > interrupts.<br>
>> > Whereas,raw_local_irq_save - does DISABLE hardware interrupts.<br>
>> ><br>
>> > As per code, raw_local_irq_save is related with timer interrupts.<br>
>> > Please provide your insights on this.<br>
>> <a href="http://lxr.free-electrons.com/source/include/linux/irqflags.h#L61">http://lxr.free-electrons.com/source/include/linux/irqflags.h#L61</a><br>
>> read this please.<br>
>> ><br>
>> > Also, in local_irq_save - how exactly disabling interrupts is achieved ( in<br>
>> > spite of " NOT DISABLING " hardware interrupts) ?<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > On Thu, Jul 4, 2013 at 2:45 PM, anish singh <<a href="mailto:anish198519851985@gmail.com">anish198519851985@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> On Thu, Jul 4, 2013 at 1:55 PM, Raj Ravi <<a href="mailto:mekaviraj@gmail.com">mekaviraj@gmail.com</a>> wrote:<br>
>> >> > Hi,<br>
>> >> ><br>
>> >> > Please let me know the difference between<br>
>> >> > local_irq_save and raw_local_irq_save ?<br>
>> >><br>
>> >> did you check who calls this raw_local_irq_save?<br>
>> >> similarly who calls local_irq_save?<br>
>> >> finding out these will answer your questions<br>
>> >> > At which situation one should use raw_local_irq_save?<br>
>> >> ><br>
>> >> ><br>
>> >> > Also, I read "flags" is where interrupt state is saved while disabling<br>
>> >> > interrupts in local cpu (for local_irq_save).<br>
>> >> ><br>
>> >> > What EXACTLY this flags contains? What do you mean by interrupt state<br>
>> >> > here?<br>
>> >><br>
>> >> interrupt state meaning: which all interrupts are enabled or disabled at<br>
>> >> this<br>
>> >> instant.If a particular interrupt was enabled at that instant then we<br>
>> >> don't<br>
>> >> do any thing with our locking mechanism which causes it be be disabled.<br>
>> >> What we are doing with those flags is nothing but maintaining the state.<br>
>> >> ><br>
>> >> > Thanks!<br>
>> >> > Kavi<br>
>> >> ><br>
>> >> > _______________________________________________<br>
>> >> > Kernelnewbies mailing list<br>
>> >> > <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
>> >> > <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
>> >> ><br>
>> ><br>
>> ><br>
><br>
><br>
</p>