diff options
Diffstat (limited to 'include/linux/interrupt.h')
| -rw-r--r-- | include/linux/interrupt.h | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 4a728dba02e2..690b238a44d5 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -156,6 +156,10 @@ __request_percpu_irq(unsigned int irq, irq_handler_t handler, | |||
| 156 | unsigned long flags, const char *devname, | 156 | unsigned long flags, const char *devname, |
| 157 | void __percpu *percpu_dev_id); | 157 | void __percpu *percpu_dev_id); |
| 158 | 158 | ||
| 159 | extern int __must_check | ||
| 160 | request_nmi(unsigned int irq, irq_handler_t handler, unsigned long flags, | ||
| 161 | const char *name, void *dev); | ||
| 162 | |||
| 159 | static inline int __must_check | 163 | static inline int __must_check |
| 160 | request_percpu_irq(unsigned int irq, irq_handler_t handler, | 164 | request_percpu_irq(unsigned int irq, irq_handler_t handler, |
| 161 | const char *devname, void __percpu *percpu_dev_id) | 165 | const char *devname, void __percpu *percpu_dev_id) |
| @@ -164,9 +168,16 @@ request_percpu_irq(unsigned int irq, irq_handler_t handler, | |||
| 164 | devname, percpu_dev_id); | 168 | devname, percpu_dev_id); |
| 165 | } | 169 | } |
| 166 | 170 | ||
| 171 | extern int __must_check | ||
| 172 | request_percpu_nmi(unsigned int irq, irq_handler_t handler, | ||
| 173 | const char *devname, void __percpu *dev); | ||
| 174 | |||
| 167 | extern const void *free_irq(unsigned int, void *); | 175 | extern const void *free_irq(unsigned int, void *); |
| 168 | extern void free_percpu_irq(unsigned int, void __percpu *); | 176 | extern void free_percpu_irq(unsigned int, void __percpu *); |
| 169 | 177 | ||
| 178 | extern const void *free_nmi(unsigned int irq, void *dev_id); | ||
| 179 | extern void free_percpu_nmi(unsigned int irq, void __percpu *percpu_dev_id); | ||
| 180 | |||
| 170 | struct device; | 181 | struct device; |
| 171 | 182 | ||
| 172 | extern int __must_check | 183 | extern int __must_check |
| @@ -217,6 +228,13 @@ extern void enable_percpu_irq(unsigned int irq, unsigned int type); | |||
| 217 | extern bool irq_percpu_is_enabled(unsigned int irq); | 228 | extern bool irq_percpu_is_enabled(unsigned int irq); |
| 218 | extern void irq_wake_thread(unsigned int irq, void *dev_id); | 229 | extern void irq_wake_thread(unsigned int irq, void *dev_id); |
| 219 | 230 | ||
| 231 | extern void disable_nmi_nosync(unsigned int irq); | ||
| 232 | extern void disable_percpu_nmi(unsigned int irq); | ||
| 233 | extern void enable_nmi(unsigned int irq); | ||
| 234 | extern void enable_percpu_nmi(unsigned int irq, unsigned int type); | ||
| 235 | extern int prepare_percpu_nmi(unsigned int irq); | ||
| 236 | extern void teardown_percpu_nmi(unsigned int irq); | ||
| 237 | |||
| 220 | /* The following three functions are for the core kernel use only. */ | 238 | /* The following three functions are for the core kernel use only. */ |
| 221 | extern void suspend_device_irqs(void); | 239 | extern void suspend_device_irqs(void); |
| 222 | extern void resume_device_irqs(void); | 240 | extern void resume_device_irqs(void); |
| @@ -241,20 +259,29 @@ struct irq_affinity_notify { | |||
| 241 | void (*release)(struct kref *ref); | 259 | void (*release)(struct kref *ref); |
| 242 | }; | 260 | }; |
| 243 | 261 | ||
| 262 | #define IRQ_AFFINITY_MAX_SETS 4 | ||
| 263 | |||
| 244 | /** | 264 | /** |
| 245 | * struct irq_affinity - Description for automatic irq affinity assignements | 265 | * struct irq_affinity - Description for automatic irq affinity assignements |
| 246 | * @pre_vectors: Don't apply affinity to @pre_vectors at beginning of | 266 | * @pre_vectors: Don't apply affinity to @pre_vectors at beginning of |
| 247 | * the MSI(-X) vector space | 267 | * the MSI(-X) vector space |
| 248 | * @post_vectors: Don't apply affinity to @post_vectors at end of | 268 | * @post_vectors: Don't apply affinity to @post_vectors at end of |
| 249 | * the MSI(-X) vector space | 269 | * the MSI(-X) vector space |
| 250 | * @nr_sets: Length of passed in *sets array | 270 | * @nr_sets: The number of interrupt sets for which affinity |
| 251 | * @sets: Number of affinitized sets | 271 | * spreading is required |
| 272 | * @set_size: Array holding the size of each interrupt set | ||
| 273 | * @calc_sets: Callback for calculating the number and size | ||
| 274 | * of interrupt sets | ||
| 275 | * @priv: Private data for usage by @calc_sets, usually a | ||
| 276 | * pointer to driver/device specific data. | ||
| 252 | */ | 277 | */ |
| 253 | struct irq_affinity { | 278 | struct irq_affinity { |
| 254 | int pre_vectors; | 279 | unsigned int pre_vectors; |
| 255 | int post_vectors; | 280 | unsigned int post_vectors; |
| 256 | int nr_sets; | 281 | unsigned int nr_sets; |
| 257 | int *sets; | 282 | unsigned int set_size[IRQ_AFFINITY_MAX_SETS]; |
| 283 | void (*calc_sets)(struct irq_affinity *, unsigned int nvecs); | ||
| 284 | void *priv; | ||
| 258 | }; | 285 | }; |
| 259 | 286 | ||
| 260 | /** | 287 | /** |
| @@ -314,9 +341,10 @@ extern int | |||
| 314 | irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); | 341 | irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); |
| 315 | 342 | ||
| 316 | struct irq_affinity_desc * | 343 | struct irq_affinity_desc * |
| 317 | irq_create_affinity_masks(int nvec, const struct irq_affinity *affd); | 344 | irq_create_affinity_masks(unsigned int nvec, struct irq_affinity *affd); |
| 318 | 345 | ||
| 319 | int irq_calc_affinity_vectors(int minvec, int maxvec, const struct irq_affinity *affd); | 346 | unsigned int irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec, |
| 347 | const struct irq_affinity *affd); | ||
| 320 | 348 | ||
| 321 | #else /* CONFIG_SMP */ | 349 | #else /* CONFIG_SMP */ |
| 322 | 350 | ||
| @@ -350,13 +378,14 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) | |||
| 350 | } | 378 | } |
| 351 | 379 | ||
| 352 | static inline struct irq_affinity_desc * | 380 | static inline struct irq_affinity_desc * |
| 353 | irq_create_affinity_masks(int nvec, const struct irq_affinity *affd) | 381 | irq_create_affinity_masks(unsigned int nvec, struct irq_affinity *affd) |
| 354 | { | 382 | { |
| 355 | return NULL; | 383 | return NULL; |
| 356 | } | 384 | } |
| 357 | 385 | ||
| 358 | static inline int | 386 | static inline unsigned int |
| 359 | irq_calc_affinity_vectors(int minvec, int maxvec, const struct irq_affinity *affd) | 387 | irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec, |
| 388 | const struct irq_affinity *affd) | ||
| 360 | { | 389 | { |
| 361 | return maxvec; | 390 | return maxvec; |
| 362 | } | 391 | } |
