summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-08-17 22:18:37 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-08-17 22:18:37 +0000
commit8b92ed51419c907aa453c063b0afaefaef268c02 (patch)
tree6b55820027aa69c816baceb1fa93a4f217d25074 /arch
parent847f8ee407875af42d99ed968bdaf7e330dcc29c (diff)
Baget updates.
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/baget/irq.c46
-rw-r--r--arch/mips/baget/prom/init.c10
-rw-r--r--arch/mips/baget/time.c10
-rw-r--r--arch/mips/baget/vacserial.c27
4 files changed, 38 insertions, 55 deletions
diff --git a/arch/mips/baget/irq.c b/arch/mips/baget/irq.c
index 8fc7ec179..fe7c91b05 100644
--- a/arch/mips/baget/irq.c
+++ b/arch/mips/baget/irq.c
@@ -5,7 +5,7 @@
* Code (mostly sleleton and comments) derived from DECstation IRQ
* handling.
*
- * $Id$
+ * $Id: irq.c,v 1.2 1999/04/11 17:03:38 harald Exp $
*/
#include <linux/errno.h>
#include <linux/init.h>
@@ -142,15 +142,6 @@ void enable_irq(unsigned int irq_nr)
}
/*
- * Data definition for static irqaction allocation.
- * It is used while SLAB module is not initialized.
- */
-
-#define MAX_STATIC_ALLOC 4
-struct irqaction static_irqaction[MAX_STATIC_ALLOC];
-int static_irq_count = 0;
-
-/*
* Pointers to the low-level handlers: first the general ones, then the
* fast ones, then the bad ones.
*/
@@ -319,7 +310,7 @@ int request_irq(unsigned int irq,
void *dev_id)
{
int retval;
- struct irqaction * action = NULL;
+ struct irqaction * action;
if (irq >= BAGET_IRQ_NR)
return -EINVAL;
@@ -328,22 +319,8 @@ int request_irq(unsigned int irq,
if (irq_to_pil_map[irq] < 0)
return -EINVAL;
- if (irqflags & SA_STATIC_ALLOC) {
- unsigned long flags;
-
- save_and_cli(flags);
- if (static_irq_count < MAX_STATIC_ALLOC)
- action = &static_irqaction[static_irq_count++];
- else
- printk("Request for IRQ%d (%s) SA_STATIC_ALLOC failed "
- "using kmalloc\n", irq, devname);
- restore_flags(flags);
- }
-
- if (action == NULL)
- action = (struct irqaction *)
+ action = (struct irqaction *)
kmalloc(sizeof(struct irqaction), GFP_KERNEL);
-
if (!action)
return -ENOMEM;
@@ -380,17 +357,6 @@ void free_irq(unsigned int irq, void *dev_id)
if (!irq[irq_action])
unmask_irq_count(irq);
restore_flags(flags);
-
- if (action->flags & SA_STATIC_ALLOC)
- {
- /* This interrupt is marked as specially allocated
- * so it is a bad idea to free it.
- */
- printk("Attempt to free statically allocated "
- "IRQ%d (%s)\n", irq, action->name);
- return;
- }
-
kfree(action);
return;
}
@@ -422,6 +388,9 @@ static void write_err_interrupt(int irq, void *dev_id, struct pt_regs * regs)
*(volatile char*) BAGET_WRERR_ACK = 0;
}
+static struct irqaction irq0 =
+{ write_err_interrupt, SA_INTERRUPT, 0, "bus write error", NULL, NULL};
+
__initfunc(void init_IRQ(void))
{
irq_setup();
@@ -432,7 +401,6 @@ __initfunc(void init_IRQ(void))
/* Enable interrupts for pils 2 and 3 (lines 0 and 1) */
modify_cp0_intmask(0, (1<<2)|(1<<3));
- if (request_irq(0/*fixme*/, write_err_interrupt,
- SA_INTERRUPT|SA_STATIC_ALLOC, "write_err", NULL) < 0)
+ if (setup_baget_irq(0, &irq0) < 0)
printk("init_IRQ: unable to register write_err irq\n");
}
diff --git a/arch/mips/baget/prom/init.c b/arch/mips/baget/prom/init.c
index e5c100dea..52b74b088 100644
--- a/arch/mips/baget/prom/init.c
+++ b/arch/mips/baget/prom/init.c
@@ -3,7 +3,7 @@
*
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
*
- * $Id$
+ * $Id: init.c,v 1.1 1999/01/17 03:49:40 ralf Exp $
*/
#include <linux/init.h>
#include <linux/config.h>
@@ -19,3 +19,11 @@ __initfunc(int prom_init(unsigned int mem_upper))
arcs_cmdline[0] = 0;
return 0;
}
+
+__initfunc(void prom_fixup_mem_map(unsigned long start, unsigned long end))
+{
+}
+
+void prom_free_prom_memory (void)
+{
+}
diff --git a/arch/mips/baget/time.c b/arch/mips/baget/time.c
index 093b6c0ac..024f1bf7b 100644
--- a/arch/mips/baget/time.c
+++ b/arch/mips/baget/time.c
@@ -1,4 +1,4 @@
-/* $Id$
+/* $Id: time.c,v 1.2 1999/04/11 17:03:39 harald Exp $
* time.c: Baget/MIPS specific time handling details
*
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
@@ -63,14 +63,14 @@ __initfunc(static void timer_enable(void))
VIC_INT_LOW|VIC_INT_ENABLE, VIC_LINT2);
}
+static struct irqaction timer_irq =
+{ timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};
+
__initfunc(void time_init(void))
{
- if (request_irq(BAGET_VIC_TIMER_IRQ, timer_interrupt,
- SA_INTERRUPT|SA_STATIC_ALLOC, "timer", NULL) < 0)
+ if (setup_baget_irq(BAGET_VIC_TIMER_IRQ, &timer_irq) < 0)
printk("time_init: unable request irq for system timer\n");
-
timer_enable();
-
/* We don't call sti() here, because it is too early for baget */
}
diff --git a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c
index 456964298..768ccb3fc 100644
--- a/arch/mips/baget/vacserial.c
+++ b/arch/mips/baget/vacserial.c
@@ -1,4 +1,4 @@
-/* $Id$
+/* $Id: vacserial.c,v 1.2 1999/04/11 17:03:39 harald Exp $
* vacserial.c: VAC UART serial driver
* This code stealed and adopted from linux/drivers/char/serial.c
* See that for author info
@@ -22,7 +22,8 @@
#define RS_STROBE_TIME (10*HZ)
#define RS_ISR_PASS_LIMIT 2 /* Beget is not a super-computer (old=256) */
-#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
+#define IRQ_T(state) \
+ ((state->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
#define SERIAL_INLINE
@@ -157,7 +158,7 @@ static struct termios *serial_termios_locked[NR_PORTS];
* memory if large numbers of serial ports are open.
*/
static unsigned char *tmp_buf;
-static struct semaphore tmp_buf_sem = MUTEX;
+static DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct async_struct *info,
kdev_t device, const char *routine)
@@ -695,7 +696,7 @@ static int startup(struct async_struct * info)
handler = rs_interrupt_single;
- retval = request_irq(state->irq, handler, IRQ_T(info),
+ retval = request_irq(state->irq, handler, IRQ_T(state),
"serial", NULL);
if (retval) {
if (capable(CAP_SYS_ADMIN)) {
@@ -813,7 +814,7 @@ static void shutdown(struct async_struct * info)
if (IRQ_ports[state->irq]) {
free_irq(state->irq, NULL);
retval = request_irq(state->irq, rs_interrupt_single,
- IRQ_T(info), "serial", NULL);
+ IRQ_T(state), "serial", NULL);
if (retval)
printk("serial shutdown: request_irq: error %d"
@@ -912,6 +913,8 @@ static void change_speed(struct async_struct *info)
/* Determine divisor based on baud rate */
baud = tty_get_baud_rate(info->tty);
+ if (!baud)
+ baud = 9600; /* B0 transition handled in rs_set_termios */
baud_base = info->state->baud_base;
if (baud == 38400 &&
((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST))
@@ -1357,7 +1360,7 @@ static int set_serial_info(struct async_struct * info,
check_and_exit:
if (!state->port || !state->type)
return 0;
- if (state->flags & ASYNC_INITIALIZED) {
+ if (info->flags & ASYNC_INITIALIZED) {
if (((old_state.flags & ASYNC_SPD_MASK) !=
(state->flags & ASYNC_SPD_MASK)) ||
(old_state.custom_divisor != state->custom_divisor)) {
@@ -1603,8 +1606,9 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
-
- if ( (tty->termios->c_cflag == old_termios->c_cflag)
+ unsigned int cflag = tty->termios->c_cflag;
+
+ if ( (cflag == old_termios->c_cflag)
&& ( RELEVANT_IFLAG(tty->termios->c_iflag)
== RELEVANT_IFLAG(old_termios->c_iflag)))
return;
@@ -1613,7 +1617,7 @@ static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
/* Handle turning off CRTSCTS */
if ((old_termios->c_cflag & CRTSCTS) &&
- !(tty->termios->c_cflag & CRTSCTS)) {
+ !(cflag & CRTSCTS)) {
tty->hw_stopped = 0;
rs_start(tty);
}
@@ -1821,7 +1825,7 @@ static void rs_hangup(struct tty_struct *tty)
static int block_til_ready(struct tty_struct *tty, struct file * filp,
struct async_struct *info)
{
- struct wait_queue wait = { current, NULL };
+ DECLARE_WAITQUEUE(wait, current);
struct serial_state *state = info->state;
int retval;
int do_clocal = 0, extra_count = 0;
@@ -1961,6 +1965,9 @@ static int get_async_struct(int line, struct async_struct **ret_info)
return -ENOMEM;
}
memset(info, 0, sizeof(struct async_struct));
+ init_waitqueue_head(&info->open_wait);
+ init_waitqueue_head(&info->close_wait);
+ init_waitqueue_head(&info->delta_msr_wait);
info->magic = SERIAL_MAGIC;
info->port = sstate->port;
info->flags = sstate->flags;