diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/baget/Makefile | 18 | ||||
-rw-r--r-- | arch/mips/baget/irq.c | 10 | ||||
-rw-r--r-- | arch/mips/baget/setup.c | 4 | ||||
-rw-r--r-- | arch/mips/baget/time.c | 12 | ||||
-rw-r--r-- | arch/mips/baget/vacserial.c | 22 |
5 files changed, 39 insertions, 27 deletions
diff --git a/arch/mips/baget/Makefile b/arch/mips/baget/Makefile index 2980761be..6bddfad4b 100644 --- a/arch/mips/baget/Makefile +++ b/arch/mips/baget/Makefile @@ -15,8 +15,22 @@ image: ../../../vmlinux cp -f $< $@ O_TARGET := baget.a -O_OBJS := baget.o print.o setup.o irq.o time.o \ - bagetIRQ.o vacserial.o reset.o +O_OBJS := baget.o print.o setup.o time.o irq.o bagetIRQ.o reset.o wbflush.o + +ifeq ($(CONFIG_SERIAL),y) + OX_OBJS += vacserial.o +else + ifeq ($(CONFIG_SERIAL),m) + MX_OBJS += vacserial.o + endif +endif +ifeq ($(CONFIG_VAC_RTC),y) + OX_OBJS += vacrtc.o +else + ifeq ($(CONFIG_VAC_RTC),m) + MX_OBJS += vacrtc.o + endif +endif bagetIRQ.o : bagetIRQ.S $(CC) $(CFLAGS) -c -o $@ $< diff --git a/arch/mips/baget/irq.c b/arch/mips/baget/irq.c index a6513d7f1..8fc7ec179 100644 --- a/arch/mips/baget/irq.c +++ b/arch/mips/baget/irq.c @@ -33,6 +33,8 @@ unsigned int local_bh_count[NR_CPUS]; unsigned int local_irq_count[NR_CPUS]; unsigned long spurious_count = 0; +atomic_t __mips_bh_counter; + /* * This table is a correspondence between IRQ numbers and CPU PILs */ @@ -41,7 +43,7 @@ static int irq_to_pil_map[BAGET_IRQ_NR] = { 7/*fixme: dma_err -1*/,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 0x00 - 0x0f */ -1,-1,-1,-1, 3,-1,-1,-1, 2, 2, 2,-1, 3,-1,-1,3/*fixme: lance*/, /* 0x10 - 0x1f */ -1,-1,-1,-1,-1,-1, 5,-1,-1,-1,-1,-1, 7,-1,-1,-1, /* 0x20 - 0x2f */ - -1, 3, 2/*fixme systimer:3*/, 3, 3, 3, 2,-1, 3, 3, 3, 3, 3, 3, 3, 3 /* 0x30 - 0x3f */ + -1, 3, 2/*fixme systimer:3*/, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 /* 0x30 - 0x3f */ }; static inline int irq_to_pil(int irq_nr) @@ -61,7 +63,7 @@ static inline int irq_to_pil(int irq_nr) /* Function for careful CP0 interrupt mask access */ -static inline modify_cp0_intmask(unsigned clr_mask, unsigned set_mask) +static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask) { unsigned long status = read_32bit_cp0_register(CP0_STATUS); status &= ~((clr_mask & 0xFF) << 8); @@ -191,7 +193,7 @@ static void do_IRQ(int irq, struct pt_regs * regs) int do_random, cpu; cpu = smp_processor_id(); - irq_enter(cpu, irq); + hardirq_enter(cpu); kstat.irqs[cpu][irq]++; mask_irq(irq); @@ -213,7 +215,7 @@ static void do_IRQ(int irq, struct pt_regs * regs) printk("do_IRQ: Unregistered IRQ (0x%X) occured\n", irq); } unmask_irq(irq); - irq_exit(cpu, irq); + hardirq_exit(cpu); /* unmasking and bottom half handling is done magically for us. */ } diff --git a/arch/mips/baget/setup.c b/arch/mips/baget/setup.c index 209816dca..de5c5763d 100644 --- a/arch/mips/baget/setup.c +++ b/arch/mips/baget/setup.c @@ -17,6 +17,8 @@ extern long mips_memory_upper; +extern void wbflush_setup(void); + #define CACHEABLE_STR(val) ((val) ? "not cached" : "cached") #define MIN(a,b) (((a)<(b)) ? (a):(b)) @@ -480,6 +482,8 @@ __initfunc(void baget_setup(void)) *BAGET_WRERR_ACK = 0; irq_setup = baget_irq_setup; + wbflush_setup(); + _machine_restart = baget_machine_restart; _machine_halt = baget_machine_halt; _machine_power_off = baget_machine_power_off; diff --git a/arch/mips/baget/time.c b/arch/mips/baget/time.c index b24f5b93e..093b6c0ac 100644 --- a/arch/mips/baget/time.c +++ b/arch/mips/baget/time.c @@ -28,7 +28,7 @@ */ #define FREQ_NOM 79125 /* Baget frequency ratio */ #define FREQ_DEN 10000 -static inline int timer_intr_valid() +static inline int timer_intr_valid(void) { static unsigned long long ticks, valid_ticks; @@ -52,16 +52,6 @@ void static timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) } } -__initfunc(static void rtc_enable(void)) -{ - short ic; - - ic = vac_inw(VAC_INT_CTRL) ; - vac_outw(ic & 0xfffc, VAC_INT_CTRL); - vac_outw(ic, VAC_INT_CTRL); - vic_outb(0xb9 & 0x7f, VIC_LINT6); -} - __initfunc(static void timer_enable(void)) { unsigned char ss0cr0 = vic_inb(VIC_SS0CR0); diff --git a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c index 6e3add687..456964298 100644 --- a/arch/mips/baget/vacserial.c +++ b/arch/mips/baget/vacserial.c @@ -1289,6 +1289,8 @@ static int set_serial_info(struct async_struct * info, return -EPERM; state->flags = ((state->flags & ~ASYNC_USR_MASK) | (new_serial.flags & ASYNC_USR_MASK)); + info->flags = ((state->flags & ~ASYNC_USR_MASK) | + (info->flags & ASYNC_USR_MASK)); state->custom_divisor = new_serial.custom_divisor; goto check_and_exit; } @@ -1296,7 +1298,9 @@ static int set_serial_info(struct async_struct * info, new_serial.irq = irq_cannonicalize(new_serial.irq); if ((new_serial.irq >= NR_IRQS) || (new_serial.port > 0xffff) || - (new_serial.type < PORT_UNKNOWN) || (new_serial.type > PORT_MAX)) { + (new_serial.baud_base == 0) || (new_serial.type < PORT_UNKNOWN) || + (new_serial.type > PORT_MAX) || (new_serial.type == PORT_CIRRUS) || + (new_serial.type == PORT_STARTECH)) { return -EINVAL; } @@ -1719,8 +1723,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) if (info->blocked_open) { if (info->close_delay) { current->state = TASK_INTERRUPTIBLE; - current->timeout = jiffies + info->close_delay; - schedule(); + schedule_timeout(info->close_delay); } wake_up_interruptible(&info->open_wait); } @@ -1776,8 +1779,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) #endif current->state = TASK_INTERRUPTIBLE; current->counter = 0; /* make us low-priority */ - current->timeout = jiffies + char_time; - schedule(); + schedule_timeout(char_time); if (signal_pending(current)) break; if (timeout && ((orig_jiffies + timeout) < jiffies)) @@ -2002,7 +2004,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) tty->driver_data = info; info->tty = tty; if (serial_paranoia_check(info, tty->device, "rs_open")) { - MOD_DEC_USE_COUNT; + /* MOD_DEC_USE_COUNT; "info->tty" will cause this */ return -ENODEV; } @@ -2016,7 +2018,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) if (!tmp_buf) { page = get_free_page(GFP_KERNEL); if (!page) { - MOD_DEC_USE_COUNT; + /* MOD_DEC_USE_COUNT; "info->tty" will cause this */ return -ENOMEM; } if (tmp_buf) @@ -2032,7 +2034,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) (info->flags & ASYNC_CLOSING)) { if (info->flags & ASYNC_CLOSING) interruptible_sleep_on(&info->close_wait); - MOD_DEC_USE_COUNT; + /* MOD_DEC_USE_COUNT; "info->tty" will cause this */ #ifdef SERIAL_DO_RESTART return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); @@ -2046,13 +2048,13 @@ static int rs_open(struct tty_struct *tty, struct file * filp) */ retval = startup(info); if (retval) { - MOD_DEC_USE_COUNT; + /* MOD_DEC_USE_COUNT; "info->tty" will cause this */ return retval; } retval = block_til_ready(tty, filp, info); if (retval) { - MOD_DEC_USE_COUNT; + /* MOD_DEC_USE_COUNT; "info->tty" will cause this */ #ifdef SERIAL_DEBUG_OPEN baget_printk("rs_open returning after block_til_ready " "with %d\n", |