diff options
Diffstat (limited to 'arch/um/kernel/irq.c')
-rw-r--r-- | arch/um/kernel/irq.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index dbf2f5bc842f..8f2ed3690315 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include "asm/system.h" | 25 | #include "asm/system.h" |
26 | #include "asm/errno.h" | 26 | #include "asm/errno.h" |
27 | #include "asm/uaccess.h" | 27 | #include "asm/uaccess.h" |
28 | #include "user_util.h" | ||
29 | #include "kern_util.h" | 28 | #include "kern_util.h" |
30 | #include "irq_user.h" | 29 | #include "irq_user.h" |
31 | #include "irq_kern.h" | 30 | #include "irq_kern.h" |
@@ -79,6 +78,14 @@ skip: | |||
79 | return 0; | 78 | return 0; |
80 | } | 79 | } |
81 | 80 | ||
81 | /* | ||
82 | * This list is accessed under irq_lock, except in sigio_handler, | ||
83 | * where it is safe from being modified. IRQ handlers won't change it - | ||
84 | * if an IRQ source has vanished, it will be freed by free_irqs just | ||
85 | * before returning from sigio_handler. That will process a separate | ||
86 | * list of irqs to free, with its own locking, coming back here to | ||
87 | * remove list elements, taking the irq_lock to do so. | ||
88 | */ | ||
82 | static struct irq_fd *active_fds = NULL; | 89 | static struct irq_fd *active_fds = NULL; |
83 | static struct irq_fd **last_irq_ptr = &active_fds; | 90 | static struct irq_fd **last_irq_ptr = &active_fds; |
84 | 91 | ||
@@ -244,6 +251,7 @@ void free_irq_by_fd(int fd) | |||
244 | free_irq_by_cb(same_fd, &fd); | 251 | free_irq_by_cb(same_fd, &fd); |
245 | } | 252 | } |
246 | 253 | ||
254 | /* Must be called with irq_lock held */ | ||
247 | static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out) | 255 | static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out) |
248 | { | 256 | { |
249 | struct irq_fd *irq; | 257 | struct irq_fd *irq; |
@@ -309,6 +317,12 @@ void deactivate_fd(int fd, int irqnum) | |||
309 | ignore_sigio_fd(fd); | 317 | ignore_sigio_fd(fd); |
310 | } | 318 | } |
311 | 319 | ||
320 | /* | ||
321 | * Called just before shutdown in order to provide a clean exec | ||
322 | * environment in case the system is rebooting. No locking because | ||
323 | * that would cause a pointless shutdown hang if something hadn't | ||
324 | * released the lock. | ||
325 | */ | ||
312 | int deactivate_all_fds(void) | 326 | int deactivate_all_fds(void) |
313 | { | 327 | { |
314 | struct irq_fd *irq; | 328 | struct irq_fd *irq; |