1 #ifndef __H8300_HARDIRQ_H
2 #define __H8300_HARDIRQ_H
4 #include <linux/kernel.h>
5 #include <linux/config.h>
6 #include <linux/threads.h>
7 #include <linux/interrupt.h>
11 unsigned int __softirq_pending;
12 unsigned int __syscall_count;
13 struct task_struct * __ksoftirqd_task;
14 } ____cacheline_aligned irq_cpustat_t;
16 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
19 * We put the hardirq and softirq counter into the preemption
20 * counter. The bitmask has the following meaning:
22 * - bits 0-7 are the preemption count (max preemption depth: 256)
23 * - bits 8-15 are the softirq count (max # of softirqs: 256)
24 * - bits 16-23 are the hardirq count (max # of hardirqs: 256)
26 * - ( bit 26 is the PREEMPT_ACTIVE flag. )
28 * PREEMPT_MASK: 0x000000ff
29 * HARDIRQ_MASK: 0x0000ff00
30 * SOFTIRQ_MASK: 0x00ff0000
33 #define PREEMPT_BITS 8
34 #define SOFTIRQ_BITS 8
35 #define HARDIRQ_BITS 8
37 #define PREEMPT_SHIFT 0
38 #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
39 #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
42 * The hardirq mask has to be large enough to have
43 * space for potentially all IRQ sources in the system
44 * nesting on a single CPU:
46 #if (1 << HARDIRQ_BITS) < NR_IRQS
47 # error HARDIRQ_BITS is too low!
50 #define irq_enter() (preempt_count() += HARDIRQ_OFFSET)
53 preempt_count() -= IRQ_EXIT_OFFSET; \
54 if (!in_interrupt() && softirq_pending(smp_processor_id())) \
56 preempt_enable_no_resched(); \