Blame view

kernel/irq/settings.h 3.86 KB
e6bea9c40   Thomas Gleixner   genirq: Protect t...
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   Thomas Gleixner   genirq: Mirror IR...
7
  	_IRQ_PER_CPU		= IRQ_PER_CPU,
876dbd4cc   Thomas Gleixner   genirq: Mirror ir...
8
  	_IRQ_LEVEL		= IRQ_LEVEL,
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
9
10
  	_IRQ_NOPROBE		= IRQ_NOPROBE,
  	_IRQ_NOREQUEST		= IRQ_NOREQUEST,
7f1b1244e   Paul Mundt   genirq: Support p...
11
  	_IRQ_NOTHREAD		= IRQ_NOTHREAD,
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
12
13
  	_IRQ_NOAUTOEN		= IRQ_NOAUTOEN,
  	_IRQ_MOVE_PCNTXT	= IRQ_MOVE_PCNTXT,
a005677b3   Thomas Gleixner   genirq: Mirror IR...
14
  	_IRQ_NO_BALANCING	= IRQ_NO_BALANCING,
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
15
  	_IRQ_NESTED_THREAD	= IRQ_NESTED_THREAD,
31d9d9b6d   Marc Zyngier   genirq: Add suppo...
16
  	_IRQ_PER_CPU_DEVID	= IRQ_PER_CPU_DEVID,
a005677b3   Thomas Gleixner   genirq: Mirror IR...
17
  	_IRQF_MODIFY_MASK	= IRQF_MODIFY_MASK,
e6bea9c40   Thomas Gleixner   genirq: Protect t...
18
  };
009b4c3b8   Thomas Gleixner   genirq: Add IRQ_I...
19

a005677b3   Thomas Gleixner   genirq: Mirror IR...
20
  #define IRQ_PER_CPU		GOT_YOU_MORON
a005677b3   Thomas Gleixner   genirq: Mirror IR...
21
  #define IRQ_NO_BALANCING	GOT_YOU_MORON
876dbd4cc   Thomas Gleixner   genirq: Mirror ir...
22
  #define IRQ_LEVEL		GOT_YOU_MORON
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
23
  #define IRQ_NOPROBE		GOT_YOU_MORON
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
24
  #define IRQ_NOREQUEST		GOT_YOU_MORON
7f1b1244e   Paul Mundt   genirq: Support p...
25
  #define IRQ_NOTHREAD		GOT_YOU_MORON
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
26
  #define IRQ_NOAUTOEN		GOT_YOU_MORON
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
27
  #define IRQ_NESTED_THREAD	GOT_YOU_MORON
31d9d9b6d   Marc Zyngier   genirq: Add suppo...
28
  #define IRQ_PER_CPU_DEVID	GOT_YOU_MORON
a005677b3   Thomas Gleixner   genirq: Mirror IR...
29
30
31
32
33
34
  #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   Thomas Gleixner   genirq: Remove co...
35
36
  	desc->status_use_accessors &= ~(clr & _IRQF_MODIFY_MASK);
  	desc->status_use_accessors |= (set & _IRQF_MODIFY_MASK);
a005677b3   Thomas Gleixner   genirq: Mirror IR...
37
38
39
40
  }
  
  static inline bool irq_settings_is_per_cpu(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
41
  	return desc->status_use_accessors & _IRQ_PER_CPU;
a005677b3   Thomas Gleixner   genirq: Mirror IR...
42
  }
31d9d9b6d   Marc Zyngier   genirq: Add suppo...
43
44
45
46
  static inline bool irq_settings_is_per_cpu_devid(struct irq_desc *desc)
  {
  	return desc->status_use_accessors & _IRQ_PER_CPU_DEVID;
  }
a005677b3   Thomas Gleixner   genirq: Mirror IR...
47
48
  static inline void irq_settings_set_per_cpu(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
49
  	desc->status_use_accessors |= _IRQ_PER_CPU;
a005677b3   Thomas Gleixner   genirq: Mirror IR...
50
51
52
53
  }
  
  static inline void irq_settings_set_no_balancing(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
54
  	desc->status_use_accessors |= _IRQ_NO_BALANCING;
a005677b3   Thomas Gleixner   genirq: Mirror IR...
55
56
57
58
  }
  
  static inline bool irq_settings_has_no_balance_set(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
59
  	return desc->status_use_accessors & _IRQ_NO_BALANCING;
a005677b3   Thomas Gleixner   genirq: Mirror IR...
60
  }
876dbd4cc   Thomas Gleixner   genirq: Mirror ir...
61
62
63
  
  static inline u32 irq_settings_get_trigger_mask(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
64
  	return desc->status_use_accessors & IRQ_TYPE_SENSE_MASK;
876dbd4cc   Thomas Gleixner   genirq: Mirror ir...
65
66
67
68
69
  }
  
  static inline void
  irq_settings_set_trigger_mask(struct irq_desc *desc, u32 mask)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
70
71
  	desc->status_use_accessors &= ~IRQ_TYPE_SENSE_MASK;
  	desc->status_use_accessors |= mask & IRQ_TYPE_SENSE_MASK;
876dbd4cc   Thomas Gleixner   genirq: Mirror ir...
72
73
74
75
  }
  
  static inline bool irq_settings_is_level(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
76
  	return desc->status_use_accessors & _IRQ_LEVEL;
876dbd4cc   Thomas Gleixner   genirq: Mirror ir...
77
78
79
80
  }
  
  static inline void irq_settings_clr_level(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
81
  	desc->status_use_accessors &= ~_IRQ_LEVEL;
876dbd4cc   Thomas Gleixner   genirq: Mirror ir...
82
83
84
85
  }
  
  static inline void irq_settings_set_level(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
86
  	desc->status_use_accessors |= _IRQ_LEVEL;
876dbd4cc   Thomas Gleixner   genirq: Mirror ir...
87
  }
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
88
89
90
  
  static inline bool irq_settings_can_request(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
91
  	return !(desc->status_use_accessors & _IRQ_NOREQUEST);
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
92
93
94
95
  }
  
  static inline void irq_settings_clr_norequest(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
96
  	desc->status_use_accessors &= ~_IRQ_NOREQUEST;
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
97
98
99
100
  }
  
  static inline void irq_settings_set_norequest(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
101
  	desc->status_use_accessors |= _IRQ_NOREQUEST;
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
102
  }
7f1b1244e   Paul Mundt   genirq: Support p...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
  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   Thomas Gleixner   genirq: Wrap the ...
117
118
  static inline bool irq_settings_can_probe(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
119
  	return !(desc->status_use_accessors & _IRQ_NOPROBE);
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
120
121
122
123
  }
  
  static inline void irq_settings_clr_noprobe(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
124
  	desc->status_use_accessors &= ~_IRQ_NOPROBE;
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
125
126
127
128
  }
  
  static inline void irq_settings_set_noprobe(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
129
  	desc->status_use_accessors |= _IRQ_NOPROBE;
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
130
131
132
133
  }
  
  static inline bool irq_settings_can_move_pcntxt(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
134
  	return desc->status_use_accessors & _IRQ_MOVE_PCNTXT;
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
135
136
137
138
  }
  
  static inline bool irq_settings_can_autoenable(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
139
  	return !(desc->status_use_accessors & _IRQ_NOAUTOEN);
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
140
141
142
143
  }
  
  static inline bool irq_settings_is_nested_thread(struct irq_desc *desc)
  {
0c6f8a8b9   Thomas Gleixner   genirq: Remove co...
144
  	return desc->status_use_accessors & _IRQ_NESTED_THREAD;
1ccb4e612   Thomas Gleixner   genirq: Wrap the ...
145
  }