diff options
Diffstat (limited to 'include/linux/interrupt.h')
| -rw-r--r-- | include/linux/interrupt.h | 59 |
1 files changed, 35 insertions, 24 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 97ac926c78a7..698ad053d064 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -199,6 +199,26 @@ extern int check_wakeup_irqs(void); | |||
| 199 | static inline int check_wakeup_irqs(void) { return 0; } | 199 | static inline int check_wakeup_irqs(void) { return 0; } |
| 200 | #endif | 200 | #endif |
| 201 | 201 | ||
| 202 | /** | ||
| 203 | * struct irq_affinity_notify - context for notification of IRQ affinity changes | ||
| 204 | * @irq: Interrupt to which notification applies | ||
| 205 | * @kref: Reference count, for internal use | ||
| 206 | * @work: Work item, for internal use | ||
| 207 | * @notify: Function to be called on change. This will be | ||
| 208 | * called in process context. | ||
| 209 | * @release: Function to be called on release. This will be | ||
| 210 | * called in process context. Once registered, the | ||
| 211 | * structure must only be freed when this function is | ||
| 212 | * called or later. | ||
| 213 | */ | ||
| 214 | struct irq_affinity_notify { | ||
| 215 | unsigned int irq; | ||
| 216 | struct kref kref; | ||
| 217 | struct work_struct work; | ||
| 218 | void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask); | ||
| 219 | void (*release)(struct kref *ref); | ||
| 220 | }; | ||
| 221 | |||
| 202 | #if defined(CONFIG_SMP) | 222 | #if defined(CONFIG_SMP) |
| 203 | 223 | ||
| 204 | extern cpumask_var_t irq_default_affinity; | 224 | extern cpumask_var_t irq_default_affinity; |
| @@ -242,26 +262,6 @@ extern int irq_select_affinity(unsigned int irq); | |||
| 242 | 262 | ||
| 243 | extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m); | 263 | extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m); |
| 244 | 264 | ||
| 245 | /** | ||
| 246 | * struct irq_affinity_notify - context for notification of IRQ affinity changes | ||
| 247 | * @irq: Interrupt to which notification applies | ||
| 248 | * @kref: Reference count, for internal use | ||
| 249 | * @work: Work item, for internal use | ||
| 250 | * @notify: Function to be called on change. This will be | ||
| 251 | * called in process context. | ||
| 252 | * @release: Function to be called on release. This will be | ||
| 253 | * called in process context. Once registered, the | ||
| 254 | * structure must only be freed when this function is | ||
| 255 | * called or later. | ||
| 256 | */ | ||
| 257 | struct irq_affinity_notify { | ||
| 258 | unsigned int irq; | ||
| 259 | struct kref kref; | ||
| 260 | struct work_struct work; | ||
| 261 | void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask); | ||
| 262 | void (*release)(struct kref *ref); | ||
| 263 | }; | ||
| 264 | |||
| 265 | extern int | 265 | extern int |
| 266 | irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); | 266 | irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); |
| 267 | 267 | ||
| @@ -272,6 +272,11 @@ static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) | |||
| 272 | return -EINVAL; | 272 | return -EINVAL; |
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | static inline int irq_force_affinity(unsigned int irq, const struct cpumask *cpumask) | ||
| 276 | { | ||
| 277 | return 0; | ||
| 278 | } | ||
| 279 | |||
| 275 | static inline int irq_can_set_affinity(unsigned int irq) | 280 | static inline int irq_can_set_affinity(unsigned int irq) |
| 276 | { | 281 | { |
| 277 | return 0; | 282 | return 0; |
| @@ -284,6 +289,12 @@ static inline int irq_set_affinity_hint(unsigned int irq, | |||
| 284 | { | 289 | { |
| 285 | return -EINVAL; | 290 | return -EINVAL; |
| 286 | } | 291 | } |
| 292 | |||
| 293 | static inline int | ||
| 294 | irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) | ||
| 295 | { | ||
| 296 | return 0; | ||
| 297 | } | ||
| 287 | #endif /* CONFIG_SMP */ | 298 | #endif /* CONFIG_SMP */ |
| 288 | 299 | ||
| 289 | /* | 300 | /* |
| @@ -486,7 +497,7 @@ static inline int tasklet_trylock(struct tasklet_struct *t) | |||
| 486 | 497 | ||
| 487 | static inline void tasklet_unlock(struct tasklet_struct *t) | 498 | static inline void tasklet_unlock(struct tasklet_struct *t) |
| 488 | { | 499 | { |
| 489 | smp_mb__before_clear_bit(); | 500 | smp_mb__before_atomic(); |
| 490 | clear_bit(TASKLET_STATE_RUN, &(t)->state); | 501 | clear_bit(TASKLET_STATE_RUN, &(t)->state); |
| 491 | } | 502 | } |
| 492 | 503 | ||
| @@ -534,7 +545,7 @@ static inline void tasklet_hi_schedule_first(struct tasklet_struct *t) | |||
| 534 | static inline void tasklet_disable_nosync(struct tasklet_struct *t) | 545 | static inline void tasklet_disable_nosync(struct tasklet_struct *t) |
| 535 | { | 546 | { |
| 536 | atomic_inc(&t->count); | 547 | atomic_inc(&t->count); |
| 537 | smp_mb__after_atomic_inc(); | 548 | smp_mb__after_atomic(); |
| 538 | } | 549 | } |
| 539 | 550 | ||
| 540 | static inline void tasklet_disable(struct tasklet_struct *t) | 551 | static inline void tasklet_disable(struct tasklet_struct *t) |
| @@ -546,13 +557,13 @@ static inline void tasklet_disable(struct tasklet_struct *t) | |||
| 546 | 557 | ||
| 547 | static inline void tasklet_enable(struct tasklet_struct *t) | 558 | static inline void tasklet_enable(struct tasklet_struct *t) |
| 548 | { | 559 | { |
| 549 | smp_mb__before_atomic_dec(); | 560 | smp_mb__before_atomic(); |
| 550 | atomic_dec(&t->count); | 561 | atomic_dec(&t->count); |
| 551 | } | 562 | } |
| 552 | 563 | ||
| 553 | static inline void tasklet_hi_enable(struct tasklet_struct *t) | 564 | static inline void tasklet_hi_enable(struct tasklet_struct *t) |
| 554 | { | 565 | { |
| 555 | smp_mb__before_atomic_dec(); | 566 | smp_mb__before_atomic(); |
| 556 | atomic_dec(&t->count); | 567 | atomic_dec(&t->count); |
| 557 | } | 568 | } |
| 558 | 569 | ||
