Blame view
kernel/irq/settings.h
3.65 KB
e6bea9c40
|
1 2 3 4 5 6 |
/* * Internal header to deal with irq_desc->status which will be renamed * to irq_desc->settings. */ enum { _IRQ_DEFAULT_INIT_FLAGS = IRQ_DEFAULT_INIT_FLAGS, |
a005677b3
|
7 |
_IRQ_PER_CPU = IRQ_PER_CPU, |
876dbd4cc
|
8 |
_IRQ_LEVEL = IRQ_LEVEL, |
1ccb4e612
|
9 10 |
_IRQ_NOPROBE = IRQ_NOPROBE, _IRQ_NOREQUEST = IRQ_NOREQUEST, |
7f1b1244e
|
11 |
_IRQ_NOTHREAD = IRQ_NOTHREAD, |
1ccb4e612
|
12 13 |
_IRQ_NOAUTOEN = IRQ_NOAUTOEN, _IRQ_MOVE_PCNTXT = IRQ_MOVE_PCNTXT, |
a005677b3
|
14 |
_IRQ_NO_BALANCING = IRQ_NO_BALANCING, |
1ccb4e612
|
15 |
_IRQ_NESTED_THREAD = IRQ_NESTED_THREAD, |
a005677b3
|
16 |
_IRQF_MODIFY_MASK = IRQF_MODIFY_MASK, |
e6bea9c40
|
17 |
}; |
009b4c3b8
|
18 |
|
a005677b3
|
19 |
#define IRQ_PER_CPU GOT_YOU_MORON |
a005677b3
|
20 |
#define IRQ_NO_BALANCING GOT_YOU_MORON |
876dbd4cc
|
21 |
#define IRQ_LEVEL GOT_YOU_MORON |
1ccb4e612
|
22 |
#define IRQ_NOPROBE GOT_YOU_MORON |
1ccb4e612
|
23 |
#define IRQ_NOREQUEST GOT_YOU_MORON |
7f1b1244e
|
24 |
#define IRQ_NOTHREAD GOT_YOU_MORON |
1ccb4e612
|
25 |
#define IRQ_NOAUTOEN GOT_YOU_MORON |
1ccb4e612
|
26 |
#define IRQ_NESTED_THREAD GOT_YOU_MORON |
a005677b3
|
27 28 29 30 31 32 |
#undef IRQF_MODIFY_MASK #define IRQF_MODIFY_MASK GOT_YOU_MORON static inline void irq_settings_clr_and_set(struct irq_desc *desc, u32 clr, u32 set) { |
0c6f8a8b9
|
33 34 |
desc->status_use_accessors &= ~(clr & _IRQF_MODIFY_MASK); desc->status_use_accessors |= (set & _IRQF_MODIFY_MASK); |
a005677b3
|
35 36 37 38 |
} static inline bool irq_settings_is_per_cpu(struct irq_desc *desc) { |
0c6f8a8b9
|
39 |
return desc->status_use_accessors & _IRQ_PER_CPU; |
a005677b3
|
40 41 42 43 |
} static inline void irq_settings_set_per_cpu(struct irq_desc *desc) { |
0c6f8a8b9
|
44 |
desc->status_use_accessors |= _IRQ_PER_CPU; |
a005677b3
|
45 46 47 48 |
} static inline void irq_settings_set_no_balancing(struct irq_desc *desc) { |
0c6f8a8b9
|
49 |
desc->status_use_accessors |= _IRQ_NO_BALANCING; |
a005677b3
|
50 51 52 53 |
} static inline bool irq_settings_has_no_balance_set(struct irq_desc *desc) { |
0c6f8a8b9
|
54 |
return desc->status_use_accessors & _IRQ_NO_BALANCING; |
a005677b3
|
55 |
} |
876dbd4cc
|
56 57 58 |
static inline u32 irq_settings_get_trigger_mask(struct irq_desc *desc) { |
0c6f8a8b9
|
59 |
return desc->status_use_accessors & IRQ_TYPE_SENSE_MASK; |
876dbd4cc
|
60 61 62 63 64 |
} static inline void irq_settings_set_trigger_mask(struct irq_desc *desc, u32 mask) { |
0c6f8a8b9
|
65 66 |
desc->status_use_accessors &= ~IRQ_TYPE_SENSE_MASK; desc->status_use_accessors |= mask & IRQ_TYPE_SENSE_MASK; |
876dbd4cc
|
67 68 69 70 |
} static inline bool irq_settings_is_level(struct irq_desc *desc) { |
0c6f8a8b9
|
71 |
return desc->status_use_accessors & _IRQ_LEVEL; |
876dbd4cc
|
72 73 74 75 |
} static inline void irq_settings_clr_level(struct irq_desc *desc) { |
0c6f8a8b9
|
76 |
desc->status_use_accessors &= ~_IRQ_LEVEL; |
876dbd4cc
|
77 78 79 80 |
} static inline void irq_settings_set_level(struct irq_desc *desc) { |
0c6f8a8b9
|
81 |
desc->status_use_accessors |= _IRQ_LEVEL; |
876dbd4cc
|
82 |
} |
1ccb4e612
|
83 84 85 |
static inline bool irq_settings_can_request(struct irq_desc *desc) { |
0c6f8a8b9
|
86 |
return !(desc->status_use_accessors & _IRQ_NOREQUEST); |
1ccb4e612
|
87 88 89 90 |
} static inline void irq_settings_clr_norequest(struct irq_desc *desc) { |
0c6f8a8b9
|
91 |
desc->status_use_accessors &= ~_IRQ_NOREQUEST; |
1ccb4e612
|
92 93 94 95 |
} static inline void irq_settings_set_norequest(struct irq_desc *desc) { |
0c6f8a8b9
|
96 |
desc->status_use_accessors |= _IRQ_NOREQUEST; |
1ccb4e612
|
97 |
} |
7f1b1244e
|
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
static inline bool irq_settings_can_thread(struct irq_desc *desc) { return !(desc->status_use_accessors & _IRQ_NOTHREAD); } static inline void irq_settings_clr_nothread(struct irq_desc *desc) { desc->status_use_accessors &= ~_IRQ_NOTHREAD; } static inline void irq_settings_set_nothread(struct irq_desc *desc) { desc->status_use_accessors |= _IRQ_NOTHREAD; } |
1ccb4e612
|
112 113 |
static inline bool irq_settings_can_probe(struct irq_desc *desc) { |
0c6f8a8b9
|
114 |
return !(desc->status_use_accessors & _IRQ_NOPROBE); |
1ccb4e612
|
115 116 117 118 |
} static inline void irq_settings_clr_noprobe(struct irq_desc *desc) { |
0c6f8a8b9
|
119 |
desc->status_use_accessors &= ~_IRQ_NOPROBE; |
1ccb4e612
|
120 121 122 123 |
} static inline void irq_settings_set_noprobe(struct irq_desc *desc) { |
0c6f8a8b9
|
124 |
desc->status_use_accessors |= _IRQ_NOPROBE; |
1ccb4e612
|
125 126 127 128 |
} static inline bool irq_settings_can_move_pcntxt(struct irq_desc *desc) { |
0c6f8a8b9
|
129 |
return desc->status_use_accessors & _IRQ_MOVE_PCNTXT; |
1ccb4e612
|
130 131 132 133 |
} static inline bool irq_settings_can_autoenable(struct irq_desc *desc) { |
0c6f8a8b9
|
134 |
return !(desc->status_use_accessors & _IRQ_NOAUTOEN); |
1ccb4e612
|
135 136 137 138 |
} static inline bool irq_settings_is_nested_thread(struct irq_desc *desc) { |
0c6f8a8b9
|
139 |
return desc->status_use_accessors & _IRQ_NESTED_THREAD; |
1ccb4e612
|
140 |
} |