aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/irq.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:27:00 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:05 -0400
commitba180fd437156f7fd8cfb2fdd021d949eeef08d6 (patch)
treeb9f38b9cdd7a5b1aacf00341d1948314663c5871 /arch/um/kernel/irq.c
parent77bf4400319db9d2a8af6b00c2be6faa0f3d07cb (diff)
uml: style fixes pass 3
Formatting changes in the files which have been changed in the course of folding foo_skas functions into their callers. These include: copyright updates header file trimming style fixes adding severity to printks These changes should be entirely non-functional. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/kernel/irq.c')
-rw-r--r--arch/um/kernel/irq.c85
1 files changed, 38 insertions, 47 deletions
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index b10ee28b97cb..277fce17b088 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -1,37 +1,19 @@
1/* 1/*
2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 * Derived (i.e. mostly copied) from arch/i386/kernel/irq.c: 4 * Derived (i.e. mostly copied) from arch/i386/kernel/irq.c:
5 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar 5 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
6 */ 6 */
7 7
8#include "linux/kernel.h" 8#include "linux/cpumask.h"
9#include "linux/module.h" 9#include "linux/hardirq.h"
10#include "linux/smp.h"
11#include "linux/kernel_stat.h"
12#include "linux/interrupt.h" 10#include "linux/interrupt.h"
13#include "linux/random.h" 11#include "linux/kernel_stat.h"
14#include "linux/slab.h" 12#include "linux/module.h"
15#include "linux/file.h"
16#include "linux/proc_fs.h"
17#include "linux/init.h"
18#include "linux/seq_file.h" 13#include "linux/seq_file.h"
19#include "linux/profile.h" 14#include "as-layout.h"
20#include "linux/hardirq.h"
21#include "asm/irq.h"
22#include "asm/hw_irq.h"
23#include "asm/atomic.h"
24#include "asm/signal.h"
25#include "asm/system.h"
26#include "asm/errno.h"
27#include "asm/uaccess.h"
28#include "kern_util.h" 15#include "kern_util.h"
29#include "irq_user.h"
30#include "irq_kern.h"
31#include "os.h" 16#include "os.h"
32#include "sigio.h"
33#include "misc_constants.h"
34#include "as-layout.h"
35 17
36/* 18/*
37 * Generic, controller-independent functions: 19 * Generic, controller-independent functions:
@@ -71,9 +53,8 @@ int show_interrupts(struct seq_file *p, void *v)
71 seq_putc(p, '\n'); 53 seq_putc(p, '\n');
72skip: 54skip:
73 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 55 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
74 } else if (i == NR_IRQS) { 56 } else if (i == NR_IRQS)
75 seq_putc(p, '\n'); 57 seq_putc(p, '\n');
76 }
77 58
78 return 0; 59 return 0;
79} 60}
@@ -102,11 +83,13 @@ void sigio_handler(int sig, struct uml_pt_regs *regs)
102 while (1) { 83 while (1) {
103 n = os_waiting_for_events(active_fds); 84 n = os_waiting_for_events(active_fds);
104 if (n <= 0) { 85 if (n <= 0) {
105 if(n == -EINTR) continue; 86 if (n == -EINTR)
87 continue;
106 else break; 88 else break;
107 } 89 }
108 90
109 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { 91 for (irq_fd = active_fds; irq_fd != NULL;
92 irq_fd = irq_fd->next) {
110 if (irq_fd->current_events != 0) { 93 if (irq_fd->current_events != 0) {
111 irq_fd->current_events = 0; 94 irq_fd->current_events = 0;
112 do_IRQ(irq_fd->irq, regs); 95 do_IRQ(irq_fd->irq, regs);
@@ -138,8 +121,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
138 121
139 if (type == IRQ_READ) 122 if (type == IRQ_READ)
140 events = UM_POLLIN | UM_POLLPRI; 123 events = UM_POLLIN | UM_POLLPRI;
141 else 124 else events = UM_POLLOUT;
142 events = UM_POLLOUT;
143 *new_fd = ((struct irq_fd) { .next = NULL, 125 *new_fd = ((struct irq_fd) { .next = NULL,
144 .id = dev_id, 126 .id = dev_id,
145 .fd = fd, 127 .fd = fd,
@@ -153,9 +135,10 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
153 spin_lock_irqsave(&irq_lock, flags); 135 spin_lock_irqsave(&irq_lock, flags);
154 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { 136 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
155 if ((irq_fd->fd == fd) && (irq_fd->type == type)) { 137 if ((irq_fd->fd == fd) && (irq_fd->type == type)) {
156 printk("Registering fd %d twice\n", fd); 138 printk(KERN_ERR "Registering fd %d twice\n", fd);
157 printk("Irqs : %d, %d\n", irq_fd->irq, irq); 139 printk(KERN_ERR "Irqs : %d, %d\n", irq_fd->irq, irq);
158 printk("Ids : 0x%p, 0x%p\n", irq_fd->id, dev_id); 140 printk(KERN_ERR "Ids : 0x%p, 0x%p\n", irq_fd->id,
141 dev_id);
159 goto out_unlock; 142 goto out_unlock;
160 } 143 }
161 } 144 }
@@ -171,7 +154,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
171 if (n == 0) 154 if (n == 0)
172 break; 155 break;
173 156
174 /* n > 0 157 /*
158 * n > 0
175 * It means we couldn't put new pollfd to current pollfds 159 * It means we couldn't put new pollfd to current pollfds
176 * and tmp_fds is NULL or too small for new pollfds array. 160 * and tmp_fds is NULL or too small for new pollfds array.
177 * Needed size is equal to n as minimum. 161 * Needed size is equal to n as minimum.
@@ -197,7 +181,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
197 181
198 spin_unlock_irqrestore(&irq_lock, flags); 182 spin_unlock_irqrestore(&irq_lock, flags);
199 183
200 /* This calls activate_fd, so it has to be outside the critical 184 /*
185 * This calls activate_fd, so it has to be outside the critical
201 * section. 186 * section.
202 */ 187 */
203 maybe_sigio_broken(fd, (type == IRQ_READ)); 188 maybe_sigio_broken(fd, (type == IRQ_READ));
@@ -264,13 +249,14 @@ static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out)
264 i++; 249 i++;
265 } 250 }
266 if (irq == NULL) { 251 if (irq == NULL) {
267 printk("find_irq_by_fd doesn't have descriptor %d\n", fd); 252 printk(KERN_ERR "find_irq_by_fd doesn't have descriptor %d\n",
253 fd);
268 goto out; 254 goto out;
269 } 255 }
270 fdi = os_get_pollfd(i); 256 fdi = os_get_pollfd(i);
271 if ((fdi != -1) && (fdi != fd)) { 257 if ((fdi != -1) && (fdi != fd)) {
272 printk("find_irq_by_fd - mismatch between active_fds and " 258 printk(KERN_ERR "find_irq_by_fd - mismatch between active_fds "
273 "pollfds, fd %d vs %d, need %d\n", irq->fd, 259 "and pollfds, fd %d vs %d, need %d\n", irq->fd,
274 fdi, fd); 260 fdi, fd);
275 irq = NULL; 261 irq = NULL;
276 goto out; 262 goto out;
@@ -306,7 +292,7 @@ void deactivate_fd(int fd, int irqnum)
306 292
307 spin_lock_irqsave(&irq_lock, flags); 293 spin_lock_irqsave(&irq_lock, flags);
308 irq = find_irq_by_fd(fd, irqnum, &i); 294 irq = find_irq_by_fd(fd, irqnum, &i);
309 if(irq == NULL){ 295 if (irq == NULL) {
310 spin_unlock_irqrestore(&irq_lock, flags); 296 spin_unlock_irqrestore(&irq_lock, flags);
311 return; 297 return;
312 } 298 }
@@ -372,8 +358,10 @@ int um_request_irq(unsigned int irq, int fd, int type,
372EXPORT_SYMBOL(um_request_irq); 358EXPORT_SYMBOL(um_request_irq);
373EXPORT_SYMBOL(reactivate_fd); 359EXPORT_SYMBOL(reactivate_fd);
374 360
375/* hw_interrupt_type must define (startup || enable) && 361/*
376 * (shutdown || disable) && end */ 362 * hw_interrupt_type must define (startup || enable) &&
363 * (shutdown || disable) && end
364 */
377static void dummy(unsigned int irq) 365static void dummy(unsigned int irq)
378{ 366{
379} 367}
@@ -422,7 +410,8 @@ int init_aio_irq(int irq, char *name, irq_handler_t handler)
422 410
423 err = os_pipe(fds, 1, 1); 411 err = os_pipe(fds, 1, 1);
424 if (err) { 412 if (err) {
425 printk("init_aio_irq - os_pipe failed, err = %d\n", -err); 413 printk(KERN_ERR "init_aio_irq - os_pipe failed, err = %d\n",
414 -err);
426 goto out; 415 goto out;
427 } 416 }
428 417
@@ -430,7 +419,8 @@ int init_aio_irq(int irq, char *name, irq_handler_t handler)
430 IRQF_DISABLED | IRQF_SAMPLE_RANDOM, name, 419 IRQF_DISABLED | IRQF_SAMPLE_RANDOM, name,
431 (void *) (long) fds[0]); 420 (void *) (long) fds[0]);
432 if (err) { 421 if (err) {
433 printk("init_aio_irq - : um_request_irq failed, err = %d\n", 422 printk(KERN_ERR "init_aio_irq - : um_request_irq failed, "
423 "err = %d\n",
434 err); 424 err);
435 goto out_close; 425 goto out_close;
436 } 426 }
@@ -501,8 +491,9 @@ unsigned long to_irq_stack(unsigned long *mask_out)
501 int nested; 491 int nested;
502 492
503 mask = xchg(&pending_mask, *mask_out); 493 mask = xchg(&pending_mask, *mask_out);
504 if(mask != 0){ 494 if (mask != 0) {
505 /* If any interrupts come in at this point, we want to 495 /*
496 * If any interrupts come in at this point, we want to
506 * make sure that their bits aren't lost by our 497 * make sure that their bits aren't lost by our
507 * putting our bit in. So, this loop accumulates bits 498 * putting our bit in. So, this loop accumulates bits
508 * until xchg returns the same value that we put in. 499 * until xchg returns the same value that we put in.
@@ -514,13 +505,13 @@ unsigned long to_irq_stack(unsigned long *mask_out)
514 do { 505 do {
515 old |= mask; 506 old |= mask;
516 mask = xchg(&pending_mask, old); 507 mask = xchg(&pending_mask, old);
517 } while(mask != old); 508 } while (mask != old);
518 return 1; 509 return 1;
519 } 510 }
520 511
521 ti = current_thread_info(); 512 ti = current_thread_info();
522 nested = (ti->real_thread != NULL); 513 nested = (ti->real_thread != NULL);
523 if(!nested){ 514 if (!nested) {
524 struct task_struct *task; 515 struct task_struct *task;
525 struct thread_info *tti; 516 struct thread_info *tti;
526 517