Commit e38a834f authored by Chris Wedgwood's avatar Chris Wedgwood Committed by Linus Torvalds

[PATCH] uml: use generic IRQ code

Convert UML to use the generic IRQ code.
Signed-off-by: default avatarChris Wedgwood <cw@f00f.org>
Acked-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4bf182ad
# UML uses the generic IRQ sugsystem
config GENERIC_HARDIRQS
bool
default y
config USERMODE config USERMODE
bool bool
default y default y
......
...@@ -110,7 +110,6 @@ static int flush_buffer(struct line *line) ...@@ -110,7 +110,6 @@ static int flush_buffer(struct line *line)
int line_write(struct line *lines, struct tty_struct *tty, const char *buf, int len) int line_write(struct line *lines, struct tty_struct *tty, const char *buf, int len)
{ {
struct line *line; struct line *line;
char *new;
unsigned long flags; unsigned long flags;
int n, err, i, ret = 0; int n, err, i, ret = 0;
...@@ -143,7 +142,6 @@ int line_write(struct line *lines, struct tty_struct *tty, const char *buf, int ...@@ -143,7 +142,6 @@ int line_write(struct line *lines, struct tty_struct *tty, const char *buf, int
} }
out_up: out_up:
up(&line->sem); up(&line->sem);
out_free:
return(ret); return(ret);
} }
...@@ -203,13 +201,17 @@ void line_disable(struct line *line, int current_irq) ...@@ -203,13 +201,17 @@ void line_disable(struct line *line, int current_irq)
if(line->driver->read_irq == current_irq) if(line->driver->read_irq == current_irq)
free_irq_later(line->driver->read_irq, line); free_irq_later(line->driver->read_irq, line);
else else {
free_irq_by_irq_and_dev(line->driver->read_irq, line);
free_irq(line->driver->read_irq, line); free_irq(line->driver->read_irq, line);
}
if(line->driver->write_irq == current_irq) if(line->driver->write_irq == current_irq)
free_irq_later(line->driver->write_irq, line); free_irq_later(line->driver->write_irq, line);
else else {
free_irq_by_irq_and_dev(line->driver->write_irq, line);
free_irq(line->driver->write_irq, line); free_irq(line->driver->write_irq, line);
}
line->have_irq = 0; line->have_irq = 0;
} }
......
...@@ -148,6 +148,7 @@ static int uml_net_close(struct net_device *dev) ...@@ -148,6 +148,7 @@ static int uml_net_close(struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
spin_lock(&lp->lock); spin_lock(&lp->lock);
free_irq_by_irq_and_dev(dev->irq, dev);
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
if(lp->close != NULL) (*lp->close)(lp->fd, &lp->user); if(lp->close != NULL) (*lp->close)(lp->fd, &lp->user);
lp->fd = -1; lp->fd = -1;
......
...@@ -242,6 +242,7 @@ int port_wait(void *data) ...@@ -242,6 +242,7 @@ int port_wait(void *data)
* connection. Then we loop here throwing out failed * connection. Then we loop here throwing out failed
* connections until a good one is found. * connections until a good one is found.
*/ */
free_irq_by_irq_and_dev(TELNETD_IRQ, conn);
free_irq(TELNETD_IRQ, conn); free_irq(TELNETD_IRQ, conn);
if(conn->fd >= 0) break; if(conn->fd >= 0) break;
......
...@@ -63,6 +63,7 @@ int xterm_fd(int socket, int *pid_out) ...@@ -63,6 +63,7 @@ int xterm_fd(int socket, int *pid_out)
} }
down(&data->sem); down(&data->sem);
free_irq_by_irq_and_dev(XTERM_IRQ, data);
free_irq(XTERM_IRQ, data); free_irq(XTERM_IRQ, data);
ret = data->new_fd; ret = data->new_fd;
......
...@@ -10,7 +10,7 @@ enum { IRQ_READ, IRQ_WRITE }; ...@@ -10,7 +10,7 @@ enum { IRQ_READ, IRQ_WRITE };
extern void sigio_handler(int sig, union uml_pt_regs *regs); extern void sigio_handler(int sig, union uml_pt_regs *regs);
extern int activate_fd(int irq, int fd, int type, void *dev_id); extern int activate_fd(int irq, int fd, int type, void *dev_id);
extern void free_irq_by_irq_and_dev(int irq, void *dev_id); extern void free_irq_by_irq_and_dev(unsigned int irq, void *dev_id);
extern void free_irq_by_fd(int fd); extern void free_irq_by_fd(int fd);
extern void reactivate_fd(int fd, int irqnum); extern void reactivate_fd(int fd, int irqnum);
extern void deactivate_fd(int fd, int irqnum); extern void deactivate_fd(int fd, int irqnum);
......
This diff is collapsed.
...@@ -263,7 +263,7 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d) ...@@ -263,7 +263,7 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d)
return((irq->irq == data->irq) && (irq->id == data->dev)); return((irq->irq == data->irq) && (irq->id == data->dev));
} }
void free_irq_by_irq_and_dev(int irq, void *dev) void free_irq_by_irq_and_dev(unsigned int irq, void *dev)
{ {
struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq, struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq,
.dev = dev }); .dev = dev });
......
...@@ -206,7 +206,6 @@ void default_idle(void) ...@@ -206,7 +206,6 @@ void default_idle(void)
* although we are an idle CPU, we do not want to * although we are an idle CPU, we do not want to
* get into the scheduler unnecessarily. * get into the scheduler unnecessarily.
*/ */
irq_stat[smp_processor_id()].idle_timestamp = jiffies;
if(need_resched()) if(need_resched())
schedule(); schedule();
......
#ifndef __UM_HARDIRQ_H /* (c) 2004 cw@f00f.org, GPLv2 blah blah */
#define __UM_HARDIRQ_H
#include "asm/arch/hardirq.h" #ifndef __ASM_UM_HARDIRQ_H
#define __ASM_UM_HARDIRQ_H
#endif #include <linux/config.h>
#include <linux/threads.h>
#include <linux/irq.h>
/* NOTE: When SMP works again we might want to make this
* ____cacheline_aligned or maybe use per_cpu state? --cw */
typedef struct {
unsigned int __softirq_pending;
} irq_cpustat_t;
#include <linux/irq_cpustat.h>
/* As this would be very strange for UML to get we BUG() after the
* printk. */
static inline void ack_bad_irq(unsigned int irq)
{
printk(KERN_ERR "unexpected IRQ %02x\n", irq);
BUG();
}
#endif /* __ASM_UM_HARDIRQ_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment