Re: how to determine whether in irq context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 28, 2011 at 10:20 AM, loody <miloody@xxxxxxxxx> wrote:
> Dear all:
> i remember there is a marco for us to determine whether we are located
> in irq context.
> I forget what it is.
> Would anyone know what it is?
>
>
> --
> Thanks for your help
Hi,
This is copy/paste from <linux/hardirq.h>:

  /*
   * Are we doing bottom half or hardware interrupt processing?
   * Are we in a softirq context? Interrupt context?
   * in_softirq - Are we currently processing softirq or have bh disabled?
   * in_serving_softirq - Are we currently processing softirq?
   */
  #define in_irq()                (hardirq_count())
  #define in_softirq()            (softirq_count())
  #define in_interrupt()          (irq_count())
 #define in_serving_softirq()    (softirq_count() & SOFTIRQ_OFFSET)

Regards,
Bojan

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


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux