How to diasble interrupt of current core in multicore cpu

Yi Li lovelylich at gmail.com
Thu Jun 5 15:05:31 EDT 2014



-----Original Message-----
From: kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Pranay Srivastava
Sent: Friday, May 30, 2014 4:26 PM
To: J.Hwan Kim
Cc: kernelnewbies
Subject: Re: How to diasble interrupt of current core in multicore cpu

are you looking for

local_irq_disable?

On Fri, May 30, 2014 at 1:42 PM, J.Hwan Kim <kernel.frog.007 at gmail.com> wrote:
> Hi, everyone
>
> How to disable interrupt for current core in multicore CPU?
>
> Thanks in advance
> Kim.
>
local_irq_save/restore would be more suitable. you can use them without considering
is interrupt enabled now. your code may looks like this:
local_irq_save()
/*your code comes here with interrupt disabled*/
local_irq_restore()
in this way, if interrupt is in state A (may be enabled or disabled), before you call local_irq_save(), then after you call local_irq_restore,
the interrupt will still be in state A. harmless to other code.
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
        ---P.K.S

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




More information about the Kernelnewbies mailing list