<div dir="ltr"><div><div><div><div><div><div><div><div>Hi,<br></div>I have gone through the code.<br></div><br></div><div>Please correct / provide your insights on my understanding.<br></div>1. There is no difference between local_irq_save and raw_local_irq_save with ARM architecture. ?<br>
<br><br></div><div>2. As per the below code,<br></div><div><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<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>
</div>Here, Flags contain the result of PRIMASK register. before interrupts are disabled ?? <br></div><br></div>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></div><div>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></div><div><br></div>Please provide your insights.<br><br></div>Thanks !<br>Kavi<br><div><div>
<div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 4, 2013 at 4:38 PM, anish singh <span dir="ltr"><<a href="mailto:anish198519851985@gmail.com" target="_blank">anish198519851985@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">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>
</div><a href="http://lxr.free-electrons.com/source/include/linux/irqflags.h#L61" target="_blank">http://lxr.free-electrons.com/source/include/linux/irqflags.h#L61</a><br>
read this please.<br>
<div class=""><div class="h5">><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" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div></div></div></div></div>