1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef LINUX_HARDIRQ_H
20#define LINUX_HARDIRQ_H
21#include <linux/preempt.h>
22#include <linux/smp_lock.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#include <linux/lockdep.h>
25#include <asm/hardirq.h>
26#include <asm/system.h>
27#define PREEMPT_BITS 8
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define SOFTIRQ_BITS 8
30#ifndef HARDIRQ_BITS
31#define HARDIRQ_BITS 12
32#if 1 << HARDIRQ_BITS < NR_IRQS
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#error HARDIRQ_BITS is too low!
35#endif
36#endif
37#define PREEMPT_SHIFT 0
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
40#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
41#define __IRQ_MASK(x) ((1UL << (x))-1)
42#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
45#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
46#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
47#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
50#if PREEMPT_ACTIVE < 1 << HARDIRQ_SHIFT + HARDIRQ_BITS
51#error PREEMPT_ACTIVE is too low!
52#endif
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
55#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
56#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
57#define in_irq() (hardirq_count())
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define in_softirq() (softirq_count())
60#define in_interrupt() (irq_count())
61#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
62#define preemptible() 0
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
65#define synchronize_irq(irq) barrier()
66struct task_struct;
67#define irq_enter()   do {   account_system_vtime(current);   add_preempt_count(HARDIRQ_OFFSET);   trace_hardirq_enter();   } while (0)
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define __irq_exit()   do {   trace_hardirq_exit();   account_system_vtime(current);   sub_preempt_count(HARDIRQ_OFFSET);   } while (0)
70#define nmi_enter() do { lockdep_off(); irq_enter(); } while (0)
71#define nmi_exit() do { __irq_exit(); lockdep_on(); } while (0)
72#endif
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74