You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(43) |
Nov
(4) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(97) |
Mar
(29) |
Apr
(2) |
May
(22) |
Jun
(38) |
Jul
(11) |
Aug
(27) |
Sep
(40) |
Oct
(2) |
Nov
(17) |
Dec
(8) |
2002 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(480) |
May
(456) |
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(18) |
Nov
(3) |
Dec
(6) |
2003 |
Jan
|
Feb
(18) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(147) |
Jul
(7) |
Aug
(3) |
Sep
(235) |
Oct
(10) |
Nov
(2) |
Dec
(1) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Andy P. <at...@us...> - 2002-04-10 18:37:07
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/mips-boards/atlas In directory usw-pr-cvs1:/tmp/cvs-serv15904/arch/mips/mips-boards/atlas Log Message: Directory /cvsroot/linux-vax/kernel-2.4/arch/mips/mips-boards/atlas added to the repository |
From: Andy P. <at...@us...> - 2002-04-10 18:37:04
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ia64/hp In directory usw-pr-cvs1:/tmp/cvs-serv12040/ia64/hp Modified Files: hpsim_irq.c hpsim_setup.c Log Message: synch 2.4.15 commit 36 Index: hpsim_irq.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/hp/hpsim_irq.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hpsim_irq.c 14 Jan 2001 19:48:59 -0000 1.1.1.1 +++ hpsim_irq.c 10 Apr 2002 14:27:20 -0000 1.2 @@ -1,8 +1,8 @@ /* * Platform dependent support for HP simulator. * - * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang <da...@hp...> + * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2001 David Mosberger-Tang <da...@hp...> */ #include <linux/init.h> @@ -35,10 +35,12 @@ void __init hpsim_irq_init (void) { + irq_desc_t *idesc; int i; - for (i = IA64_MIN_VECTORED_IRQ; i <= IA64_MAX_VECTORED_IRQ; ++i) { - if (irq_desc[i].handler == &no_irq_type) - irq_desc[i].handler = &irq_type_hp_sim; + for (i = 0; i < NR_IRQS; ++i) { + idesc = irq_desc(i); + if (idesc->handler == &no_irq_type) + idesc->handler = &irq_type_hp_sim; } } Index: hpsim_setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/hp/hpsim_setup.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hpsim_setup.c 14 Jan 2001 19:49:00 -0000 1.1.1.1 +++ hpsim_setup.c 10 Apr 2002 14:27:20 -0000 1.2 @@ -27,28 +27,15 @@ /* * Simulator system call. */ -inline long -ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr) -{ -#ifdef __GCC_DOESNT_KNOW_IN_REGS__ - register long in0 asm ("r32") = arg0; - register long in1 asm ("r33") = arg1; - register long in2 asm ("r34") = arg2; - register long in3 asm ("r35") = arg3; -#else - register long in0 asm ("in0") = arg0; - register long in1 asm ("in1") = arg1; - register long in2 asm ("in2") = arg2; - register long in3 asm ("in3") = arg3; -#endif - register long r8 asm ("r8"); - register long r15 asm ("r15") = nr; - - asm volatile ("break 0x80001" - : "=r"(r8) - : "r"(r15), "r"(in0), "r"(in1), "r"(in2), "r"(in3)); - return r8; -} +asm (".text\n" + ".align 32\n" + ".global ia64_ssc\n" + ".proc ia64_ssc\n" + "ia64_ssc:\n" + "mov r15=r36\n" + "break 0x80001\n" + "br.ret.sptk.many rp\n" + ".endp\n"); void ia64_ssc_connect_irq (long intr, long irq) |
From: Andy P. <at...@us...> - 2002-04-10 18:37:03
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/bvme6000 In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/bvme6000 Modified Files: config.c rtc.c Log Message: synch 2.4.15 commit 37 Index: config.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/bvme6000/config.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- config.c 14 Jan 2001 19:41:32 -0000 1.1.1.1 +++ config.c 10 Apr 2002 14:34:33 -0000 1.2 @@ -17,7 +17,6 @@ #include <linux/types.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/kd.h> #include <linux/tty.h> #include <linux/console.h> #include <linux/linkage.h> @@ -30,6 +29,7 @@ #include <asm/setup.h> #include <asm/irq.h> #include <asm/traps.h> +#include <asm/rtc.h> #include <asm/machdep.h> #include <asm/bvme6000hw.h> Index: rtc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/bvme6000/rtc.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- rtc.c 25 Feb 2001 23:15:20 -0000 1.1.1.2 +++ rtc.c 10 Apr 2002 14:34:34 -0000 1.2 @@ -76,7 +76,7 @@ unsigned char mon, day, hrs, min, sec, leap_yr; unsigned int yrs; - if (!suser()) + if (!capable(CAP_SYS_ADMIN)) return -EACCES; if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, |
From: Andy P. <at...@us...> - 2002-04-10 18:37:03
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel In directory usw-pr-cvs1:/tmp/cvs-serv16972/mips/sgi/kernel Modified Files: Makefile indy_hpc.c indy_int.c indy_mc.c indy_rtc.c indy_sc.c reset.c setup.c system.c time.c Removed Files: indy_timer.c promcon.c Log Message: synch 2.4.15 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:28:22 -0000 1.1.1.1 +++ Makefile 10 Apr 2002 14:38:10 -0000 1.2 @@ -13,21 +13,13 @@ .S.o: $(CC) $(CFLAGS) -c $< -o $*.o -OBJS = indy_mc.o indy_sc.o indy_hpc.o indy_int.o indy_rtc.o \ - system.o indyIRQ.o reset.o setup.o time.o -ifdef CONFIG_SGI_PROM_CONSOLE -OBJS += promcon.o -endif +O_TARGET := ip22-kern.o -all: sgikern.a +all: ip22-kern.o indyIRQ.o -sgikern.a: $(OBJS) - $(AR) rcs sgikern.a $(OBJS) - sync +obj-y += indy_mc.o indy_sc.o indy_hpc.o indy_int.o indy_rtc.o system.o \ + indyIRQ.o reset.o setup.o time.o indyIRQ.o: indyIRQ.S - -dep: - $(CPP) $(CPPFLAGS) -M *.c > .depend include $(TOPDIR)/Rules.make Index: indy_hpc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/indy_hpc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- indy_hpc.c 14 Jan 2001 19:28:24 -0000 1.1.1.1 +++ indy_hpc.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -12,6 +12,7 @@ #include <asm/sgi/sgihpc.h> #include <asm/sgi/sgint23.h> #include <asm/sgialib.h> +#include <asm/bootinfo.h> /* #define DEBUG_SGIHPC */ @@ -50,10 +51,12 @@ prom_printf("GUINESS "); #endif sgi_guiness = 1; + mips_machtype = MACH_SGI_INDY; } else { #ifdef DEBUG_SGIHPC prom_printf("FULLHOUSE "); #endif + mips_machtype = MACH_SGI_INDIGO2; sgi_guiness = 0; } sgi_boardid = brev; Index: indy_int.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/indy_int.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- indy_int.c 25 Feb 2001 23:15:17 -0000 1.1.1.2 +++ indy_int.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * indy_int.c: Routines for generic manipulation of the INT[23] ASIC * found on INDY workstations.. * @@ -70,8 +69,6 @@ extern asmlinkage void indyIRQ(void); -unsigned long spurious_count = 0; - /* Local IRQ's are layed out logically like this: * * 0 --> 7 == local 0 interrupts @@ -79,433 +76,333 @@ * 16 --> 23 == vectored level 2 interrupts * 24 --> 31 == vectored level 3 interrupts (not used) */ -void disable_local_irq(unsigned int irq_nr) +static void enable_local0_irq(unsigned int irq) { unsigned long flags; save_and_cli(flags); - switch(irq_nr) { - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: - ioc_icontrol->imask0 &= ~(1 << irq_nr); - break; - - case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: - ioc_icontrol->imask1 &= ~(1 << (irq_nr - 8)); - break; - - case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: - ioc_icontrol->cmeimask0 &= ~(1 << (irq_nr - 16)); - break; - - default: - /* This way we'll see if anyone would ever want vectored - * level 3 interrupts. Highly unlikely. - */ - printk("Yeeee, got passed irq_nr %d at disable_irq\n", irq_nr); - panic("INVALID IRQ level!"); - }; + ioc_icontrol->imask0 |= (1 << (irq - SGINT_LOCAL0)); restore_flags(flags); } -void enable_local_irq(unsigned int irq_nr) +static unsigned int startup_local0_irq(unsigned int irq) +{ + enable_local0_irq(irq); + + return 0; /* Never anything pending */ +} + +static void disable_local0_irq(unsigned int irq) { unsigned long flags; + save_and_cli(flags); - switch(irq_nr) { - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: - ioc_icontrol->imask0 |= (1 << irq_nr); - break; - - case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: - ioc_icontrol->imask1 |= (1 << (irq_nr - 8)); - break; - - case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: - enable_local_irq(7); - ioc_icontrol->cmeimask0 |= (1 << (irq_nr - 16)); - break; - - default: - printk("Yeeee, got passed irq_nr %d at disable_irq\n", irq_nr); - panic("INVALID IRQ level!"); - }; + ioc_icontrol->imask0 &= ~(1 << (irq - SGINT_LOCAL0)); restore_flags(flags); } -void disable_gio_irq(unsigned int irq_nr) +#define shutdown_local0_irq disable_local0_irq +#define mask_and_ack_local0_irq disable_local0_irq + +static void end_local0_irq (unsigned int irq) { - /* XXX TODO XXX */ + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) + enable_local0_irq(irq); } -void enable_gio_irq(unsigned int irq_nr) +static struct hw_interrupt_type ip22_local0_irq_type = { + "IP22 local 0", + startup_local0_irq, + shutdown_local0_irq, + enable_local0_irq, + disable_local0_irq, + mask_and_ack_local0_irq, + end_local0_irq, + NULL +}; + +static void enable_local1_irq(unsigned int irq) { - /* XXX TODO XXX */ + unsigned long flags; + + save_and_cli(flags); + ioc_icontrol->imask1 |= (1 << (irq - SGINT_LOCAL1)); + restore_flags(flags); } -void disable_hpcdma_irq(unsigned int irq_nr) +static unsigned int startup_local1_irq(unsigned int irq) { - /* XXX TODO XXX */ + enable_local1_irq(irq); + + return 0; /* Never anything pending */ } -void enable_hpcdma_irq(unsigned int irq_nr) +void disable_local1_irq(unsigned int irq) { - /* XXX TODO XXX */ + unsigned long flags; + + save_and_cli(flags); + ioc_icontrol->imask1 &= ~(1 << (irq- SGINT_LOCAL1)); + restore_flags(flags); } -void disable_irq(unsigned int irq_nr) +#define shutdown_local1_irq disable_local1_irq +#define mask_and_ack_local1_irq disable_local1_irq + +static void end_local1_irq (unsigned int irq) { - unsigned int n = irq_nr; - if(n >= SGINT_END) { - printk("whee, invalid irq_nr %d\n", irq_nr); - panic("IRQ, you lose..."); - } - if(n >= SGINT_LOCAL0 && n < SGINT_GIO) { - disable_local_irq(n - SGINT_LOCAL0); - } else if(n >= SGINT_GIO && n < SGINT_HPCDMA) { - disable_gio_irq(n - SGINT_GIO); - } else if(n >= SGINT_HPCDMA && n < SGINT_END) { - disable_hpcdma_irq(n - SGINT_HPCDMA); - } else { - panic("how did I get here?"); - } + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) + enable_local1_irq(irq); } -void enable_irq(unsigned int irq_nr) +static struct hw_interrupt_type ip22_local1_irq_type = { + "IP22 local 1", + startup_local1_irq, + shutdown_local1_irq, + enable_local1_irq, + disable_local1_irq, + mask_and_ack_local1_irq, + end_local1_irq, + NULL +}; + +static void enable_local2_irq(unsigned int irq) { - unsigned int n = irq_nr; - if(n >= SGINT_END) { - printk("whee, invalid irq_nr %d\n", irq_nr); - panic("IRQ, you lose..."); - } - if(n >= SGINT_LOCAL0 && n < SGINT_GIO) { - enable_local_irq(n - SGINT_LOCAL0); - } else if(n >= SGINT_GIO && n < SGINT_HPCDMA) { - enable_gio_irq(n - SGINT_GIO); - } else if(n >= SGINT_HPCDMA && n < SGINT_END) { - enable_hpcdma_irq(n - SGINT_HPCDMA); - } else { - panic("how did I get here?"); - } + unsigned long flags; + + save_and_cli(flags); + enable_local0_irq(7); + ioc_icontrol->cmeimask0 |= (1 << (irq - SGINT_LOCAL2)); + restore_flags(flags); } -#if 0 -/* - * Currently unused. - */ -static void local_unex(int irq, void *data, struct pt_regs *regs) +static unsigned int startup_local2_irq(unsigned int irq) { - printk("Whee: unexpected local IRQ at %08lx\n", - (unsigned long) regs->cp0_epc); - printk("DUMP: stat0<%x> stat1<%x> vmeistat<%x>\n", - ioc_icontrol->istat0, ioc_icontrol->istat1, - ioc_icontrol->vmeistat); -} -#endif + enable_local2_irq(irq); -static struct irqaction *local_irq_action[24] = { - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL -}; + return 0; /* Never anything pending */ +} -int setup_indy_irq(int irq, struct irqaction * new) +void disable_local2_irq(unsigned int irq) { - printk("setup_indy_irq: Yeee, don't know how to setup irq<%d> for %s %p\n", - irq, new->name, new->handler); - return 0; + unsigned long flags; + + save_and_cli(flags); + ioc_icontrol->cmeimask0 &= ~(1 << (irq - SGINT_LOCAL2)); + restore_flags(flags); } -static struct irqaction r4ktimer_action = { - NULL, 0, 0, "R4000 timer/counter", NULL, NULL, -}; +#define shutdown_local2_irq disable_local2_irq +#define mask_and_ack_local2_irq disable_local2_irq -static struct irqaction indy_berr_action = { - NULL, 0, 0, "IP22 Bus Error", NULL, NULL, -}; +static void end_local2_irq (unsigned int irq) +{ + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) + enable_local2_irq(irq); +} -static struct irqaction *irq_action[16] = { - NULL, NULL, NULL, NULL, - NULL, NULL, &indy_berr_action, &r4ktimer_action, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL +static struct hw_interrupt_type ip22_local2_irq_type = { + "IP22 local 2", + startup_local2_irq, + shutdown_local2_irq, + enable_local2_irq, + disable_local2_irq, + mask_and_ack_local2_irq, + end_local2_irq, + NULL }; -int get_irq_list(char *buf) +static void enable_local3_irq(unsigned int irq) { - int i, len = 0; - int num = 0; - struct irqaction * action; - - for (i = 0 ; i < 16 ; i++, num++) { - action = irq_action[i]; - if (!action) - continue; - len += sprintf(buf+len, "%2d: %8d %c %s", - num, kstat.irqs[0][num], - (action->flags & SA_INTERRUPT) ? '+' : ' ', - action->name); - for (action=action->next; action; action = action->next) { - len += sprintf(buf+len, ",%s %s", - (action->flags & SA_INTERRUPT) ? " +" : "", - action->name); - } - len += sprintf(buf+len, " [on-chip]\n"); - } - for (i = 0 ; i < 24 ; i++, num++) { - action = local_irq_action[i]; - if (!action) - continue; - len += sprintf(buf+len, "%2d: %8d %c %s", - num, kstat.irqs[0][num], - (action->flags & SA_INTERRUPT) ? '+' : ' ', - action->name); - for (action=action->next; action; action = action->next) { - len += sprintf(buf+len, ",%s %s", - (action->flags & SA_INTERRUPT) ? " +" : "", - action->name); - } - len += sprintf(buf+len, " [local]\n"); - } - return len; + unsigned long flags; + + save_and_cli(flags); + printk("Yeeee, got passed irq_nr %d at enable_local3_irq\n", irq); + panic("INVALID IRQ level!"); + restore_flags(flags); } -/* - * do_IRQ handles IRQ's that have been installed without the - * SA_INTERRUPT flag: it uses the full signal-handling return - * and runs with other interrupts enabled. All relatively slow - * IRQ's should use this format: notably the keyboard/timer - * routines. - */ -asmlinkage void do_IRQ(int irq, struct pt_regs * regs) +static unsigned int startup_local3_irq(unsigned int irq) { - struct irqaction *action; - int do_random, cpu; + enable_local3_irq(irq); - cpu = smp_processor_id(); - irq_enter(cpu); - kstat.irqs[0][irq]++; + return 0; /* Never anything pending */ +} - printk("Got irq %d, press a key.", irq); - prom_getchar(); - romvec->imode(); +void disable_local3_irq(unsigned int irq) +{ + unsigned long flags; + save_and_cli(flags); /* - * mask and ack quickly, we don't want the irq controller - * thinking we're snobs just because some other CPU has - * disabled global interrupts (we have already done the - * INT_ACK cycles, it's too late to try to pretend to the - * controller that we aren't taking the interrupt). - * - * Commented out because we've already done this in the - * machinespecific part of the handler. It's reasonable to - * do this here in a highlevel language though because that way - * we could get rid of a good part of duplicated code ... + * This way we'll see if anyone would ever want vectored level 3 + * interrupts. Highly unlikely. */ - /* mask_and_ack_irq(irq); */ + printk("Yeeee, got passed irq_nr %d at disable_local3_irq\n", irq); + panic("INVALID IRQ level!"); + restore_flags(flags); +} - action = *(irq + irq_action); - if (action) { - if (!(action->flags & SA_INTERRUPT)) - __sti(); - action = *(irq + irq_action); - do_random = 0; - do { - do_random |= action->flags; - action->handler(irq, action->dev_id, regs); - action = action->next; - } while (action); - if (do_random & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - __cli(); - } - irq_exit(cpu); +#define shutdown_local3_irq disable_local3_irq +#define mask_and_ack_local3_irq disable_local3_irq - /* unmasking and bottom half handling is done magically for us. */ +static void end_local3_irq (unsigned int irq) +{ + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) + enable_local3_irq(irq); } -int request_local_irq(unsigned int lirq, void (*func)(int, void *, struct pt_regs *), - unsigned long iflags, const char *dname, void *devid) +static struct hw_interrupt_type ip22_local3_irq_type = { + "IP22 local 3", + startup_local3_irq, + shutdown_local3_irq, + enable_local3_irq, + disable_local3_irq, + mask_and_ack_local3_irq, + end_local3_irq, + NULL +}; + +void enable_gio_irq(unsigned int irq) { - struct irqaction *action; + /* XXX TODO XXX */ +} - lirq -= SGINT_LOCAL0; - if(lirq >= 24 || !func) - return -EINVAL; +static unsigned int startup_gio_irq(unsigned int irq) +{ + enable_gio_irq(irq); - action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL); - if(!action) - return -ENOMEM; + return 0; /* Never anything pending */ +} - action->handler = func; - action->flags = iflags; - action->mask = 0; - action->name = dname; - action->dev_id = devid; - action->next = 0; - local_irq_action[lirq] = action; - enable_irq(lirq + SGINT_LOCAL0); - return 0; +void disable_gio_irq(unsigned int irq) +{ + /* XXX TODO XXX */ } -void free_local_irq(unsigned int lirq, void *dev_id) +#define shutdown_gio_irq disable_gio_irq +#define mask_and_ack_gio_irq disable_gio_irq + +static void end_gio_irq (unsigned int irq) { - struct irqaction *action; + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) + enable_gio_irq(irq); +} - lirq -= SGINT_LOCAL0; - if(lirq >= 24) { - printk("Aieee: trying to free bogus local irq %d\n", - lirq + SGINT_LOCAL0); - return; - } - action = local_irq_action[lirq]; - local_irq_action[lirq] = NULL; - disable_irq(lirq + SGINT_LOCAL0); - kfree(action); -} - -int request_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, - const char * devname, - void *dev_id) -{ - int retval; - struct irqaction * action; - - if (irq >= SGINT_END) - return -EINVAL; - if (!handler) - return -EINVAL; - - if((irq >= SGINT_LOCAL0) && (irq < SGINT_GIO)) - return request_local_irq(irq, handler, irqflags, devname, dev_id); - - action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL); - if (!action) - return -ENOMEM; - - action->handler = handler; - action->flags = irqflags; - action->mask = 0; - action->name = devname; - action->next = NULL; - action->dev_id = dev_id; - - retval = setup_indy_irq(irq, action); - - if (retval) - kfree(action); - return retval; +static struct hw_interrupt_type ip22_gio_irq_type = { + "IP22 GIO", + startup_gio_irq, + shutdown_gio_irq, + enable_gio_irq, + disable_gio_irq, + mask_and_ack_gio_irq, + end_gio_irq, + NULL +}; + +void enable_hpcdma_irq(unsigned int irq) +{ + /* XXX TODO XXX */ } - -void free_irq(unsigned int irq, void *dev_id) + +static unsigned int startup_hpcdma_irq(unsigned int irq) { - struct irqaction * action, **p; - unsigned long flags; + enable_hpcdma_irq(irq); - if (irq >= SGINT_END) { - printk("Trying to free IRQ%d\n",irq); - return; - } - if((irq >= SGINT_LOCAL0) && (irq < SGINT_GIO)) { - free_local_irq(irq, dev_id); - return; - } - for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) { - if (action->dev_id != dev_id) - continue; - - /* Found it - now free it */ - save_and_cli(flags); - *p = action->next; - restore_flags(flags); - kfree(action); - return; - } - printk("Trying to free free IRQ%d\n",irq); + return 0; /* Never anything pending */ } -int (*irq_cannonicalize)(int irq); - -static int indy_irq_cannonicalize(int irq) +void disable_hpcdma_irq(unsigned int irq) { - return irq; /* Sane hardware, sane code ... */ + /* XXX TODO XXX */ } -void __init init_IRQ(void) +#define shutdown_hpcdma_irq disable_hpcdma_irq +#define mask_and_ack_hpcdma_irq disable_hpcdma_irq + +static void end_hpcdma_irq (unsigned int irq) { - irq_cannonicalize = indy_irq_cannonicalize; - irq_setup(); + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) + enable_hpcdma_irq(irq); } +static struct hw_interrupt_type ip22_hpcdma_irq_type = { + "IP22 HPC DMA", + startup_hpcdma_irq, + shutdown_hpcdma_irq, + enable_hpcdma_irq, + disable_hpcdma_irq, + mask_and_ack_hpcdma_irq, + end_hpcdma_irq, + NULL +}; + +static struct irqaction r4ktimer_action = { + NULL, 0, 0, "R4000 timer/counter", NULL, NULL, +}; + +static struct irqaction indy_berr_action = { + NULL, 0, 0, "IP22 Bus Error", NULL, NULL, +}; + +static struct irqaction *irq_action[16] = { + NULL, NULL, NULL, NULL, + NULL, NULL, &indy_berr_action, &r4ktimer_action, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL +}; + void indy_local0_irqdispatch(struct pt_regs *regs) { - struct irqaction *action; unsigned char mask = ioc_icontrol->istat0; unsigned char mask2 = 0; - int irq, cpu = smp_processor_id();; + int irq; mask &= ioc_icontrol->imask0; - if(mask & ISTAT0_LIO2) { + if (mask & ISTAT0_LIO2) { mask2 = ioc_icontrol->vmeistat; mask2 &= ioc_icontrol->cmeimask0; irq = lc2msk_to_irqnr[mask2]; - action = local_irq_action[irq]; } else { irq = lc0msk_to_irqnr[mask]; - action = local_irq_action[irq]; } /* if irq == 0, then the interrupt has already been cleared */ - if ( irq == 0 ) { goto end; } - /* if action == NULL, then we do have a handler for the irq */ - if ( action == NULL ) { goto no_handler; } - - irq_enter(cpu); - kstat.irqs[0][irq + 16]++; - action->handler(irq, action->dev_id, regs); - irq_exit(cpu); + if (irq == 0) + goto end; + + do_IRQ(irq, regs); goto end; no_handler: printk("No handler for local0 irq: %i\n", irq); end: - return; - + return; } void indy_local1_irqdispatch(struct pt_regs *regs) { - struct irqaction *action; unsigned char mask = ioc_icontrol->istat1; unsigned char mask2 = 0; - int irq, cpu = smp_processor_id();; + int irq; mask &= ioc_icontrol->imask1; - if(mask & ISTAT1_LIO3) { + if (mask & ISTAT1_LIO3) { printk("WHee: Got an LIO3 irq, winging it...\n"); mask2 = ioc_icontrol->vmeistat; mask2 &= ioc_icontrol->cmeimask1; irq = lc3msk_to_irqnr[ioc_icontrol->vmeistat]; - action = local_irq_action[irq]; } else { irq = lc1msk_to_irqnr[mask]; - action = local_irq_action[irq]; } + /* if irq == 0, then the interrupt has already been cleared */ /* not sure if it is needed here, but it is needed for local0 */ - if ( irq == 0 ) { goto end; } - /* if action == NULL, then we do have a handler for the irq */ - if ( action == NULL ) { goto no_handler; } - - irq_enter(cpu); - kstat.irqs[0][irq + 24]++; - action->handler(irq, action->dev_id, regs); - irq_exit(cpu); + if (irq == 0) + goto end; + + do_IRQ(irq, regs); goto end; no_handler: @@ -520,27 +417,16 @@ int cpu = smp_processor_id(); int irq = 6; - irq_enter(cpu); + irq_enter(cpu, irq); kstat.irqs[0][irq]++; printk("Got a bus error IRQ, shouldn't happen yet\n"); show_regs(regs); printk("Spinning...\n"); while(1); - irq_exit(cpu); -} - -/* Misc. crap just to keep the kernel linking... */ -unsigned long probe_irq_on (void) -{ - return 0; + irq_exit(cpu, irq); } -int probe_irq_off (unsigned long irqs) -{ - return 0; -} - -void __init sgint_init(void) +void __init init_IRQ(void) { int i; @@ -548,43 +434,43 @@ sgi_i3regs = (struct sgi_int3_regs *) (KSEG1 + SGI_INT3_BASE); /* Init local mask --> irq tables. */ - for(i = 0; i < 256; i++) { - if(i & 0x80) { + for (i = 0; i < 256; i++) { + if (i & 0x80) { lc0msk_to_irqnr[i] = 7; lc1msk_to_irqnr[i] = 15; lc2msk_to_irqnr[i] = 23; lc3msk_to_irqnr[i] = 31; - } else if(i & 0x40) { + } else if (i & 0x40) { lc0msk_to_irqnr[i] = 6; lc1msk_to_irqnr[i] = 14; lc2msk_to_irqnr[i] = 22; lc3msk_to_irqnr[i] = 30; - } else if(i & 0x20) { + } else if (i & 0x20) { lc0msk_to_irqnr[i] = 5; lc1msk_to_irqnr[i] = 13; lc2msk_to_irqnr[i] = 21; lc3msk_to_irqnr[i] = 29; - } else if(i & 0x10) { + } else if (i & 0x10) { lc0msk_to_irqnr[i] = 4; lc1msk_to_irqnr[i] = 12; lc2msk_to_irqnr[i] = 20; lc3msk_to_irqnr[i] = 28; - } else if(i & 0x08) { + } else if (i & 0x08) { lc0msk_to_irqnr[i] = 3; lc1msk_to_irqnr[i] = 11; lc2msk_to_irqnr[i] = 19; lc3msk_to_irqnr[i] = 27; - } else if(i & 0x04) { + } else if (i & 0x04) { lc0msk_to_irqnr[i] = 2; lc1msk_to_irqnr[i] = 10; lc2msk_to_irqnr[i] = 18; lc3msk_to_irqnr[i] = 26; - } else if(i & 0x02) { + } else if (i & 0x02) { lc0msk_to_irqnr[i] = 1; lc1msk_to_irqnr[i] = 9; lc2msk_to_irqnr[i] = 17; lc3msk_to_irqnr[i] = 25; - } else if(i & 0x01) { + } else if (i & 0x01) { lc0msk_to_irqnr[i] = 0; lc1msk_to_irqnr[i] = 8; lc2msk_to_irqnr[i] = 16; @@ -614,6 +500,29 @@ ioc_icontrol->cmeimask0 = 0; ioc_icontrol->cmeimask1 = 0; - /* Now safe to set the exception vector. */ set_except_vector(0, indyIRQ); + + init_generic_irq(); + + for (i = SGINT_LOCAL0; i < SGINT_END; i++) { + hw_irq_controller *handler; + + if (i < SGINT_LOCAL1) + handler = &ip22_local0_irq_type; + else if (i < SGINT_LOCAL2) + handler = &ip22_local1_irq_type; + else if (i < SGINT_LOCAL3) + handler = &ip22_local2_irq_type; + else if (i < SGINT_GIO) + handler = &ip22_local3_irq_type; + else if (i < SGINT_HPCDMA) + handler = &ip22_gio_irq_type; + else if (i < SGINT_END) + handler = &ip22_hpcdma_irq_type; + + irq_desc[i].status = IRQ_DISABLED; + irq_desc[i].action = 0; + irq_desc[i].depth = 1; + irq_desc[i].handler = handler; + } } Index: indy_mc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/indy_mc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: indy_rtc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/indy_rtc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- indy_rtc.c 14 Jan 2001 19:28:29 -0000 1.1.1.1 +++ indy_rtc.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -1,12 +1,11 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * RTC routines for Indy style attached Dallas chip. * - * Copyright (C) 1998 by Ralf Baechle + * Copyright (C) 1998, 2001 by Ralf Baechle */ #include <linux/mc146818rtc.h> #include <asm/sgi/sgihpc.h> Index: indy_sc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/indy_sc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- indy_sc.c 14 Jan 2001 19:28:29 -0000 1.1.1.1 +++ indy_sc.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -1,8 +1,7 @@ -/* $Id$ +/* + * indy_sc.c: Indy cache management functions. * - * indy_sc.c: Indy cache managment functions. - * - * Copyright (C) 1997 Ralf Baechle (ra...@gn...), + * Copyright (C) 1997, 2001 Ralf Baechle (ra...@gn...), * derived from r4xx0.c by David S. Miller (dm...@en...). */ #include <linux/init.h> @@ -34,30 +33,30 @@ { unsigned long tmp; - __asm__ __volatile__(" - .set noreorder - .set mips3 - .set noat - mfc0 %2, $12 - li $1, 0x80 # Go 64 bit - mtc0 $1, $12 - - dli $1, 0x9000000080000000 - or %0, $1 # first line to flush - or %1, $1 # last line to flush - .set at - -1: sw $0, 0(%0) - bne %0, %1, 1b - daddu %0, 32 - - mtc0 %2, $12 # Back to 32 bit - nop; nop; nop; nop; - .set mips0 - .set reorder" - : "=r" (first), "=r" (last), "=&r" (tmp) - : "0" (first), "1" (last) - : "$1"); + __asm__ __volatile__( + ".set\tnoreorder\t\t\t# indy_sc_wipe\n\t" + ".set\tmips3\n\t" + ".set\tnoat\n\t" + "mfc0\t%2, $12\n\t" + "li\t$1, 0x80\t\t\t# Go 64 bit\n\t" + "mtc0\t$1, $12\n\t" + + "dli\t$1, 0x9000000080000000\n\t" + "or\t%0, $1\t\t\t# first line to flush\n\t" + "or\t%1, $1\t\t\t# last line to flush\n\t" + ".set\tat\n\t" + + "1:\tsw\t$0, 0(%0)\n\t" + "bne\t%0, %1, 1b\n\t" + "daddu\t%0, 32\n\t" + + "mtc0\t%2, $12\t\t\t# Back to 32 bit\n\t" + "nop; nop; nop; nop;\n\t" + ".set\tmips0\n\t" + ".set\treorder" + : "=r" (first), "=r" (last), "=&r" (tmp) + : "0" (first), "1" (last) + : "$1"); } static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) @@ -96,27 +95,27 @@ #ifdef DEBUG_CACHE printk("Enabling R4600 SCACHE\n"); #endif - __asm__ __volatile__(" - .set push - .set noreorder - .set mips3 - mfc0 %2, $12 - nop; nop; nop; nop; - li %1, 0x80 - mtc0 %1, $12 - nop; nop; nop; nop; - li %0, 0x1 - dsll %0, 31 - lui %1, 0x9000 - dsll32 %1, 0 - or %0, %1, %0 - sb $0, 0(%0) - mtc0 $0, $12 - nop; nop; nop; nop; - mtc0 %2, $12 - nop; nop; nop; nop; - .set pop" - : "=r" (tmp1), "=r" (tmp2), "=r" (addr)); + __asm__ __volatile__( + ".set\tpush\n\t" + ".set\tnoreorder\n\t" + ".set\tmips3\n\t" + "mfc0\t%2, $12\n\t" + "nop; nop; nop; nop;\n\t" + "li\t%1, 0x80\n\t" + "mtc0\t%1, $12\n\t" + "nop; nop; nop; nop;\n\t" + "li\t%0, 0x1\n\t" + "dsll\t%0, 31\n\t" + "lui\t%1, 0x9000\n\t" + "dsll32\t%1, 0\n\t" + "or\t%0, %1, %0\n\t" + "sb\t$0, 0(%0)\n\t" + "mtc0\t$0, $12\n\t" + "nop; nop; nop; nop;\n\t" + "mtc0\t%2, $12\n\t" + "nop; nop; nop; nop;\n\t" + ".set\tpop" + : "=r" (tmp1), "=r" (tmp2), "=r" (addr)); } static void indy_sc_disable(void) @@ -126,27 +125,27 @@ #ifdef DEBUG_CACHE printk("Disabling R4600 SCACHE\n"); #endif - __asm__ __volatile__(" - .set push - .set noreorder - .set mips3 - li %0, 0x1 - dsll %0, 31 - lui %1, 0x9000 - dsll32 %1, 0 - or %0, %1, %0 - mfc0 %2, $12 - nop; nop; nop; nop; - li %1, 0x80 - mtc0 %1, $12 - nop; nop; nop; nop; - sh $0, 0(%0) - mtc0 $0, $12 - nop; nop; nop; nop; - mtc0 %2, $12 - nop; nop; nop; nop; - .set pop" - : "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)); + __asm__ __volatile__( + ".set\tpush\n\t" + ".set\tnoreorder\n\t" + ".set\tmips3\n\t" + "li\t%0, 0x1\n\t" + "dsll\t%0, 31\n\t" + "lui\t%1, 0x9000\n\t" + "dsll32\t%1, 0\n\t" + "or\t%0, %1, %0\n\t" + "mfc0\t%2, $12\n\t" + "nop; nop; nop; nop\n\t" + "li\t%1, 0x80\n\t" + "mtc0\t%1, $12\n\t" + "nop; nop; nop; nop\n\t" + "sh\t$0, 0(%0)\n\t" + "mtc0\t$0, $12\n\t" + "nop; nop; nop; nop\n\t" + "mtc0\t%2, $12\n\t" + "nop; nop; nop; nop\n\t" + ".set\tpop" + : "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)); } static inline int __init indy_sc_probe(void) Index: reset.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/reset.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- reset.c 14 Jan 2001 19:28:28 -0000 1.1.1.1 +++ reset.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -1,12 +1,9 @@ -/* $Id$ - * - * Reset a SGI. - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1997, 1998 by Ralf Baechle + * Copyright (C) 1997, 1998, 2001 by Ralf Baechle */ #include <linux/kernel.h> #include <linux/sched.h> @@ -54,7 +51,7 @@ { if (shuting_down) sgi_machine_power_off(); - prom_imode(); + ArcEnterInteractiveMode(); } static void sgi_machine_power_off(void) Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/setup.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- setup.c 14 Jan 2001 19:28:27 -0000 1.1.1.1 +++ setup.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -24,6 +24,7 @@ #include <asm/sgi/sgimc.h> #include <asm/sgi/sgihpc.h> #include <asm/sgi/sgint23.h> +#include <asm/time.h> #include <asm/gdb-stub.h> #ifdef CONFIG_REMOTE_DEBUG @@ -32,7 +33,7 @@ static int remote_debug = 0; #endif -#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SGI_PROM_CONSOLE) +#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_ARC_CONSOLE) extern void console_setup(char *); #endif @@ -117,28 +118,6 @@ sgi_read_status }; -static void __init sgi_irq_setup(void) -{ - sgint_init(); - -#ifdef CONFIG_REMOTE_DEBUG - if (remote_debug) - set_debug_traps(); - breakpoint(); /* you may move this line to whereever you want :-) */ -#endif -} - -int __init page_is_ram(unsigned long pagenr) -{ - if ((pagenr<<PAGE_SHIFT) < 0x2000UL) - return 1; - if ((pagenr<<PAGE_SHIFT) > 0x08002000) - return 1; - return 0; -} - -void (*board_time_init)(struct irqaction *irq); - static unsigned long dosample(volatile unsigned char *tcwp, volatile unsigned char *tc2p) { @@ -161,14 +140,16 @@ ct1 = read_32bit_cp0_register(CP0_COUNT); } while(msb); - /* Stop the counter. */ - *tcwp = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL | SGINT_TCWORD_MSWST); + /* Stop the counter. */ + *tcwp = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL | SGINT_TCWORD_MSWST); - /* Return the difference, this is how far the r4k counter increments - * for every 1/HZ seconds. We round off the the nearest 1 MHz of - * master clock (= 1000000 / 100 / 2 = 5000 count). - */ - return ((ct1 - ct0) / 5000) * 5000; + /* + * Return the difference, this is how far the r4k counter increments + * for every 1/HZ seconds. We round off the nearest 1 MHz of master + * clock (= 1000000 / 100 / 2 = 5000 count). + */ + + return ((ct1 - ct0) / 5000) * 5000; } #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5) @@ -180,7 +161,7 @@ */ struct sgi_ioc_timers *p; volatile unsigned char *tcwp, *tc2p; - unsigned long r4k_ticks[3] = { 0, 0, 0 }; + unsigned long r4k_ticks[3]; unsigned long r4k_next; /* Figure out the r4k offset, the algorithm is very simple @@ -201,10 +182,12 @@ dosample(tcwp, tc2p); /* Prime cache. */ dosample(tcwp, tc2p); /* Prime cache. */ /* Zero is NOT an option. */ - while (!r4k_ticks[0]) + do { r4k_ticks[0] = dosample (tcwp, tc2p); - while (!r4k_ticks[1]) + } while (!r4k_ticks[0]); + do { r4k_ticks[1] = dosample (tcwp, tc2p); + } while (!r4k_ticks[1]); if (r4k_ticks[0] != r4k_ticks[1]) { printk ("warning: timer counts differ, retrying..."); @@ -226,7 +209,7 @@ /* Set ourselves up for future interrupts */ r4k_next = (read_32bit_cp0_register(CP0_COUNT) + r4k_interval); write_32bit_cp0_register(CP0_COMPARE, r4k_next); - set_cp0_status(ST0_IM, ALLINTS); + change_cp0_status(ST0_IM, ALLINTS); sti (); } @@ -239,8 +222,6 @@ char *kgdb_ttyd; #endif - - irq_setup = sgi_irq_setup; board_time_init = sgi_time_init; /* Init the INDY HPC I/O controller. Need to call this before @@ -282,7 +263,7 @@ line ? 1 : 2); rs_kgdb_hook(line); - prom_printf("KGDB: Using serial line /dev/ttyd%d for session, " + printk("KGDB: Using serial line /dev/ttyd%d for session, " "please connect your debugger\n", line ? 1 : 2); remote_debug = 1; @@ -290,7 +271,7 @@ } #endif -#ifdef CONFIG_SGI_PROM_CONSOLE +#ifdef CONFIG_ARC_CONSOLE console_setup("ttyS0"); #endif @@ -324,5 +305,4 @@ #ifdef CONFIG_VIDEO_VINO init_vino(); #endif - } Index: system.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/system.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: time.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sgi/kernel/time.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- time.c 14 Jan 2001 19:28:28 -0000 1.1.1.1 +++ time.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -9,13 +9,13 @@ void indy_8254timer_irq(void) { - int cpu = smp_processor_id(); - int irq = 4; + int cpu = smp_processor_id(); + int irq = 4; - irq_enter(cpu); - kstat.irqs[0][irq]++; - printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n"); - prom_getchar(); - prom_imode(); - irq_exit(cpu); + irq_enter(cpu, irq); + kstat.irqs[0][irq]++; + printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n"); + prom_getchar(); + ArcEnterInteractiveMode(); + irq_exit(cpu, irq); } --- indy_timer.c DELETED --- --- promcon.c DELETED --- |
From: Andy P. <at...@us...> - 2002-04-10 18:37:03
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/images In directory usw-pr-cvs1:/tmp/cvs-serv25860/ppc/boot/images Added Files: Makefile Log Message: synch 2.4.15 commit 43 --- NEW FILE --- # # This dir holds all of the images for PPC machines. # Tom Rini January 2001 include $(TOPDIR)/Rules.make vmlinux.gz: $(TOPDIR)/vmlinux $(OBJCOPY) -S -O binary $(TOPDIR)/vmlinux vmlinux gzip -vf9 vmlinux clean: rm -f sImage vmapus vmlinux.* miboot.image* zImage* zvmlinux.* |
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/sni In directory usw-pr-cvs1:/tmp/cvs-serv16972/mips/sni Modified Files: Makefile int-handler.S io.c pci.c pcimt_scache.c setup.c Added Files: irq.c Removed Files: dma.c Log Message: synch 2.4.15 --- NEW FILE --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1992 Linus Torvalds * Copyright (C) 1994 - 2000 Ralf Baechle */ #include <linux/delay.h> #include <linux/init.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/spinlock.h> #include <asm/io.h> #include <asm/sni.h> spinlock_t pciasic_lock = SPIN_LOCK_UNLOCKED; extern asmlinkage void sni_rm200_pci_handle_int(void); extern void do_IRQ(int irq, struct pt_regs *regs); static void enable_pciasic_irq(unsigned int irq); static unsigned int startup_pciasic_irq(unsigned int irq) { enable_pciasic_irq(irq); return 0; /* never anything pending */ } #define shutdown_pciasic_irq disable_pciasic_irq void disable_pciasic_irq(unsigned int irq) { unsigned int mask = ~(1 << (irq - PCIMT_IRQ_INT2)); unsigned long flags; spin_lock_irqsave(&pciasic_lock, flags); *(volatile u8 *) PCIMT_IRQSEL &= mask; spin_unlock_irqrestore(&pciasic_lock, flags); } static void enable_pciasic_irq(unsigned int irq) { unsigned int mask = 1 << (irq - PCIMT_IRQ_INT2); unsigned long flags; spin_lock_irqsave(&pciasic_lock, flags); *(volatile u8 *) PCIMT_IRQSEL |= mask; spin_unlock_irqrestore(&pciasic_lock, flags); } #define mask_and_ack_pciasic_irq disable_pciasic_irq static void end_pciasic_irq(unsigned int irq) { if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) enable_pciasic_irq(irq); } static struct hw_interrupt_type pciasic_irq_type = { "PCIASIC", startup_pciasic_irq, shutdown_pciasic_irq, enable_pciasic_irq, disable_pciasic_irq, mask_and_ack_pciasic_irq, end_pciasic_irq, NULL }; /* * hwint0 should deal with MP agent, ASIC PCI, EISA NMI and debug * button interrupts. Later ... */ void pciasic_hwint0(struct pt_regs *regs) { panic("Received int0 but no handler yet ..."); } /* This interrupt was used for the com1 console on the first prototypes. */ void pciasic_hwint2(struct pt_regs *regs) { /* I think this shouldn't happen on production machines. */ panic("hwint2 and no handler yet"); } /* hwint5 is the r4k count / compare interrupt */ void pciasic_hwint5(struct pt_regs *regs) { panic("hwint5 and no handler yet"); } static inline int ls1bit8(unsigned int x) { int b = 8, s; x <<= 24; s = 4; if ((x & 0x0f) == 0) s = 0; b -= s; x <<= s; s = 2; if ((x & 0x03) == 0) s = 0; b -= s; x <<= s; s = 1; if ((x & 0x01) == 0) s = 0; b -= s; return b; } /* * hwint 1 deals with EISA and SCSI interrupts, * hwint 3 should deal with the PCI A - D interrupts, * hwint 4 is used for only the onboard PCnet 32. */ void pciasic_hwint134(struct pt_regs *regs) { u8 pend = *(volatile char *)PCIMT_CSITPEND; int irq; irq = PCIMT_IRQ_INT2 + ls1bit8(pend); if (irq == PCIMT_IRQ_EISA) { pend = *(volatile char *)PCIMT_INT_ACKNOWLEDGE; if (!(pend ^ 0xff)) return; } do_IRQ(irq, regs); return; } void __init init_pciasic(void) { unsigned int flags; spin_lock_irqsave(&pciasic_lock, flags); * (volatile u8 *) PCIMT_IRQSEL = IT_EISA | IT_INTA | IT_INTB | IT_INTC | IT_INTD; spin_unlock_irqrestore(&pciasic_lock, flags); } /* * On systems with i8259-style interrupt controllers we assume for * driver compatibility reasons interrupts 0 - 15 to be the i8295 * interrupts even if the hardware uses a different interrupt numbering. */ void __init init_IRQ (void) { int i; set_except_vector(0, sni_rm200_pci_handle_int); init_generic_irq(); init_i8259_irqs(); /* Integrated i8259 */ init_pciasic(); /* Actually we've got more interrupts to handle ... */ for (i = PCIMT_IRQ_INT2; i <= PCIMT_IRQ_ETHERNET; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = 0; irq_desc[i].depth = 1; irq_desc[i].handler = &pciasic_irq_type; } } Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sni/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:28:29 -0000 1.1.1.1 +++ Makefile 10 Apr 2002 14:38:10 -0000 1.2 @@ -1,4 +1,3 @@ -# $Id$ # # Makefile for the SNI specific part of the kernel # @@ -12,12 +11,12 @@ .S.o: $(CC) $(CFLAGS) -c $< -o $*.o -all: sni.o +all: sni.o int-handler.o + O_TARGET := sni.o -O_OBJS := dma.o int-handler.o io.o pci.o pcimt_scache.o reset.o setup.o -int-handler.o: int-handler.S +obj-y := int-handler.o io.o irq.o pci.o pcimt_scache.o reset.o setup.o -clean: +int-handler.o: int-handler.S include $(TOPDIR)/Rules.make Index: int-handler.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sni/int-handler.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- int-handler.S 14 Jan 2001 19:28:30 -0000 1.1.1.1 +++ int-handler.S 10 Apr 2002 14:38:10 -0000 1.2 @@ -1,8 +1,7 @@ -/* $Id$ - * +/* * SNI RM200 PCI specific interrupt handler code. * - * Copyright (C) 1994 - 1997 by Ralf Baechle + * Copyright (C) 1994, 95, 96, 97, 98, 1999, 2000 by Ralf Baechle */ #include <asm/asm.h> #include <asm/mipsregs.h> @@ -37,22 +36,14 @@ mfc0 t1, CP0_CAUSE and t0, t1 - /* The following interrupt dispatch tests for hwint 1 / - EISA bridge first such that the timer interrupt get the - highest priority. */ - andi t1, t0, 0x0800 # hardware interrupt 1 - bnez t1, hwint1 - andi t1, t0, 0x4000 # hardware interrupt 4 - bnez t1, hwint4 - + andi t1, t0, 0x4a00 # hardware interrupt 1 + bnez t1, _hwint134 andi t1, t0, 0x1000 # hardware interrupt 2 - bnez t1, hwint2 - andi t1, t0, 0x2000 # hardware interrupt 3 - bnez t1, hwint3 + bnez t1, _hwint2 andi t1, t0, 0x8000 # hardware interrupt 5 - bnez t1, hwint5 + bnez t1, _hwint5 andi t1, t0, 0x0400 # hardware interrupt 0 - bnez t1, hwint0 + bnez t1, _hwint0 nop j return # spurious interrupt @@ -60,66 +51,23 @@ ############################################################################## -swint0: PANIC("swint0") -swint1: PANIC("swint1") - - /* ------------------------------------------------------------------------ */ - -/* hwint1 deals with EISA and SCSI interrupts. */ -hwint1: lbu s0, PCIMT_CSITPEND - - andi t1, s0, 0x20 - beqz t1, 1f - andi s1, s0, 0x40 - lbu a0, PCIMT_INT_ACKNOWLEDGE # IACK cycle - xori t0, a0, 0xff - beqz t0, 1f # spurious interrupt? - nop - jal i8259_do_irq # call real handler - move a1, sp - -1: bnez s1, 1f - li a0, PCIMT_IRQ_SCSI - jal do_IRQ - move a1, sp - -1: lui t0, %hi(PCIMT_CSITPEND) - j ret_from_irq - lbu zero, %lo(PCIMT_CSITPEND)(t0) - - /* ------------------------------------------------------------------------ */ - /* hwint0 should deal with MP agent, ASIC PCI, EISA NMI and debug button interrupts. */ -hwint0: PANIC("Received int0 but no handler yet ...\n") -1: j 1b - nop - -go_spurious: j spurious_interrupt # we got fooled - nop - -/* hwint4 is used for only the onboard PCnet 32. */ -hwint4: mfc0 s0, CP0_STATUS - ori t0, s0, 0x4000 - xori t0, 0x4000 - mtc0 t0, CP0_STATUS - - li a0, PCIMT_IRQ_ETHERNET - jal do_IRQ +_hwint0: jal pciasic_hwint0 move a1, sp - mtc0 s0, CP0_STATUS +/* + * hwint 1 deals with EISA and SCSI interrupts, + * hwint 3 should deal with the PCI A - D interrupts, + * hwint 4 is used for only the onboard PCnet 32. + */ +_hwint134: jal pciasic_hwint134 - j ret_from_irq - nop /* This interrupt was used for the com1 console on the first prototypes. */ -hwint2: PANIC("hwint2 and no handler yet") - -/* hwint3 should deal with the PCI A - D interrupts. */ -hwint3: PANIC("hwint3 and no handler yet") +_hwint2: jal pciasic_hwint2 /* hwint5 is the r4k count / compare interrupt */ -hwint5: PANIC("hwint5 and no handler yet") +_hwint5: jal pciasic_hwint5 END(sni_rm200_pci_handle_int) Index: io.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sni/io.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: pci.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sni/pci.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- pci.c 14 Jan 2001 19:28:31 -0000 1.1.1.1 +++ pci.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -203,6 +203,11 @@ { } +unsigned __init int pcibios_assign_all_busses(void) +{ + return 0; +} + char * __init pcibios_setup(char *str) { Index: pcimt_scache.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sni/pcimt_scache.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/sni/setup.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- setup.c 14 Jan 2001 19:28:32 -0000 1.1.1.1 +++ setup.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -31,18 +31,6 @@ #include <asm/reboot.h> #include <asm/sni.h> -/* - * Initial irq handlers. - */ -static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { } - -/* - * IRQ2 is cascade interrupt to second interrupt controller - */ -static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL}; - -extern asmlinkage void sni_rm200_pci_handle_int(void); - extern void sni_machine_restart(char *command); extern void sni_machine_halt(void); extern void sni_machine_power_off(void); @@ -51,20 +39,6 @@ extern struct rtc_ops std_rtc_ops; extern struct kbd_ops std_kbd_ops; -static void __init sni_irq_setup(void) -{ - set_except_vector(0, sni_rm200_pci_handle_int); - request_region(0x20,0x20, "pic1"); - request_region(0xa0,0x20, "pic2"); - i8259_setup_irq(2, &irq2); - /* - * IRQ0 seems to be the irq for PC style stuff. - * I don't know how to handle the debug button interrupt, so - * don't use this button yet or bad things happen ... - */ - set_cp0_status(ST0_IM, IE_IRQ1 | IE_IRQ3 | IE_IRQ4); -} - void (*board_time_init)(struct irqaction *irq); static void __init sni_rm200_pci_time_init(struct irqaction *irq) @@ -73,7 +47,7 @@ outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */ outb_p(LATCH & 0xff , 0x40); /* LSB */ outb(LATCH >> 8 , 0x40); /* MSB */ - i8259_setup_irq(0, irq); + setup_irq(0, irq); } unsigned char aux_device_present; @@ -101,45 +75,11 @@ printk("%s.\n", boardtype); } -int __init page_is_ram(unsigned long pagenr) -{ - return 1; -} - void __init sni_rm200_pci_setup(void) { -#if 0 /* XXX Tag me deeper */ - tag *atag; - - /* - * We just check if a tag_screen_info can be gathered - * in setup_arch(), if yes we don't proceed futher... - */ - atag = bi_TagFind(tag_screen_info); - if (!atag) { - /* - * If no, we try to find the tag_arc_displayinfo which is - * always created by Milo for an ARC box (for now Milo only - * works on ARC boxes :) -Stoned. - */ - atag = bi_TagFind(tag_arcdisplayinfo); - if (atag) { - screen_info.orig_x = - ((mips_arc_DisplayInfo*)TAGVALPTR(atag))->cursor_x; - screen_info.orig_y = - ((mips_arc_DisplayInfo*)TAGVALPTR(atag))->cursor_y; - screen_info.orig_video_cols = - ((mips_arc_DisplayInfo*)TAGVALPTR(atag))->columns; - screen_info.orig_video_lines = - ((mips_arc_DisplayInfo*)TAGVALPTR(atag))->lines; - } - } -#endif - sni_pcimt_detect(); sni_pcimt_sc_init(); - irq_setup = sni_irq_setup; mips_io_port_base = SNI_PORT_BASE; /* --- dma.c DELETED --- |
From: Andy P. <at...@us...> - 2002-04-10 18:37:00
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn In directory usw-pr-cvs1:/tmp/cvs-serv1502/isdn/hysdn Modified Files: boardergo.c boardergo.h hycapi.c hysdn_boot.c hysdn_defs.h hysdn_init.c hysdn_net.c hysdn_pof.h hysdn_procconf.c hysdn_procfs.c hysdn_proclog.c hysdn_sched.c ince1pc.h Log Message: synch 2.4.15 commit 49 Index: boardergo.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/boardergo.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- boardergo.c 14 Jan 2001 18:44:18 -0000 1.1.1.1 +++ boardergo.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,40 +1,27 @@ /* $Id$ - + * * Linux driver for HYSDN cards, specific routines for ergo type boards. * + * Author Werner Cornelius (we...@ti...) for Hypercope GmbH + * Copyright 1999 by Werner Cornelius (we...@ti...) + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. + * * As all Linux supported cards Champ2, Ergo and Metro2/4 use the same * DPRAM interface and layout with only minor differences all related * stuff is done here, not in separate modules. * - * written by Werner Cornelius (we...@ti...) for Hypercope GmbH - * - * Copyright 1999 by Werner Cornelius (we...@ti...) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * */ -#define __NO_VERSION__ #include <linux/config.h> -#include <linux/module.h> -#include <linux/version.h> -#include <asm/io.h> +#include <linux/sched.h> #include <linux/signal.h> #include <linux/kernel.h> #include <linux/ioport.h> #include <linux/interrupt.h> +#include <linux/vmalloc.h> +#include <asm/io.h> #include "hysdn_defs.h" #include "boardergo.h" @@ -270,7 +257,7 @@ return (-ERR_BOOTIMG_FAIL); } } /* start_boot_img */ - return (0); /* successfull */ + return (0); /* successful */ } /* ergo_writebootimg */ /********************************************************************************/ @@ -337,7 +324,7 @@ /***********************************************************************************/ /* ergo_waitpofready waits for a maximum of 10 seconds for the completition of the */ -/* boot process. If the process has been successfull 0 is returned otherwise a */ +/* boot process. If the process has been successful 0 is returned otherwise a */ /* negative error code is returned. */ /***********************************************************************************/ static int @@ -361,7 +348,7 @@ (dpr->ToPcSize < MIN_RDY_MSG_SIZE) || (dpr->ToPcSize > MAX_RDY_MSG_SIZE) || ((*(ulong *) dpr->ToPcBuf) != RDY_MAGIC)) - break; /* an error occured */ + break; /* an error occurred */ /* Check for additional data delivered during SysReady */ msg_size = dpr->ToPcSize - RDY_MAGIC_SIZE; @@ -386,7 +373,9 @@ dpr->ToPcInt = 1; /* interrupt to E1 for all cards */ restore_flags(flags); - if ((i = hysdn_net_create(card))) { + if ((hynet_enable & (1 << card->myid)) + && (i = hysdn_net_create(card))) + { ergo_stopcard(card); card->state = CARD_STATE_BOOTERR; return (i); Index: boardergo.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/boardergo.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- boardergo.h 14 Jan 2001 18:44:19 -0000 1.1.1.1 +++ boardergo.h 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,23 +1,12 @@ /* $Id$ - - * Linux driver for HYSDN cards, definitions for ergo type boards (buffers..). - * written by Werner Cornelius (we...@ti...) for Hypercope GmbH - * - * Copyright 1999 by Werner Cornelius (we...@ti...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Linux driver for HYSDN cards, definitions for ergo type boards (buffers..). * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Werner Cornelius (we...@ti...) for Hypercope GmbH + * Copyright 1999 by Werner Cornelius (we...@ti...) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ Index: hycapi.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hycapi.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hycapi.c 14 Jan 2001 18:44:36 -0000 1.1.1.1 +++ hycapi.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,27 +1,15 @@ /* $Id$ * * Linux driver for HYSDN cards, CAPI2.0-Interface. - * written by Ulrich Albrecht (u.a...@hy...) for Hypercope GmbH * + * Author Ulrich Albrecht <u.a...@hy...> for Hypercope GmbH * Copyright 2000 by Hypercope GmbH * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ -#define __NO_VERSION__ #include <linux/module.h> #include <linux/version.h> #include <linux/signal.h> @@ -43,6 +31,9 @@ static char hycapi_revision[]="$Revision$"; +unsigned int hycapi_enable = 0xffffffff; +MODULE_PARM(hycapi_enable, "i"); + typedef struct _hycapi_appl { unsigned int ctrl_mask; capi_register_params rp; @@ -522,7 +513,7 @@ /****************************************************************** hycapi_rx_capipkt -Recieve a capi-message. +Receive a capi-message. All B3_DATA_IND are converted to 64K-extension compatible format. New nccis are created if neccessary. @@ -542,15 +533,11 @@ printk(KERN_NOTICE "hycapi_rx_capipkt\n"); #endif if(!cinfo) { - printk(KERN_ERR "HYSDN Card%d: no HYCAPI-controller!\n", - card->myid); return; } ctrl = cinfo->capi_ctrl; if(!ctrl) { - printk(KERN_ERR "HYSDN Card%d: no CAPI-controller (1)!\n", - card->myid); return; } if(len < CAPI_MSG_BASELEN) { @@ -644,8 +631,6 @@ printk(KERN_NOTICE "hycapi_tx_capiack\n"); #endif if(!cinfo) { - printk(KERN_ERR "HYSDN Card%d: no CAPI-controller (2)!\n", - card->myid); return; } spin_lock_irq(&cinfo->lock); @@ -671,8 +656,6 @@ { hycapictrl_info *cinfo = card->hyctrlinfo; if(!cinfo) { - printk(KERN_ERR "HYSDN Card%d: no CAPI-controller! (3)\n", - card->myid); return (struct sk_buff *)NULL; } if (!cinfo->sk_count) @@ -739,7 +722,7 @@ struct capi_driver *driver; driver = &hycapi_driver; if (!hy_di) { - printk(KERN_ERR "HYSDN: no capi-driver to detach (???)\n"); + printk(KERN_ERR "HYSDN: no capi-driver to detach (?)\n"); return; } printk(KERN_NOTICE "HYSDN: Detaching capi-driver\n"); @@ -792,6 +775,9 @@ #ifdef HYCAPI_PRINTFNAMES printk(KERN_NOTICE "hycapi_capi_create\n"); #endif + if((hycapi_enable & (1 << card->myid)) == 0) { + return 1; + } if (!card->hyctrlinfo) { cinfo = (hycapictrl_info *) kmalloc(sizeof(hycapictrl_info), GFP_ATOMIC); if (!cinfo) { Index: hysdn_boot.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hysdn_boot.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- hysdn_boot.c 25 Feb 2001 23:15:10 -0000 1.1.1.2 +++ hysdn_boot.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,30 +1,16 @@ /* $Id$ - - * Linux driver for HYSDN cards, specific routines for booting and pof handling. - * - * written by Werner Cornelius (we...@ti...) for Hypercope GmbH - * - * Copyright 1999 by Werner Cornelius (we...@ti...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Linux driver for HYSDN cards + * specific routines for booting and pof handling * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Werner Cornelius (we...@ti...) for Hypercope GmbH + * Copyright 1999 by Werner Cornelius (we...@ti...) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ -#define __NO_VERSION__ -#include <linux/module.h> -#include <linux/version.h> #include <linux/vmalloc.h> #include <linux/slab.h> #include <asm/uaccess.h> @@ -49,7 +35,7 @@ uchar pof_state; /* actual state of read handler */ uchar is_crypted; /* card data is crypted */ int BufSize; /* actual number of bytes bufferd */ - int last_error; /* last occured error */ + int last_error; /* last occurred error */ word pof_recid; /* actual pof recid */ ulong pof_reclen; /* total length of pof record data */ ulong pof_recoffset; /* actual offset inside pof record */ @@ -62,7 +48,7 @@ }; /*****************************************************/ -/* start decryption of sucessive POF file chuncks. */ +/* start decryption of successive POF file chuncks. */ /* */ /* to be called at start of POF file reading, */ /* before starting any decryption on any POF record. */ @@ -93,7 +79,7 @@ /********************************************************************************/ /* pof_handle_data executes the required actions dependant on the active record */ -/* id. If successfull 0 is returned, a negative value shows an error. */ +/* id. If successful 0 is returned, a negative value shows an error. */ /********************************************************************************/ static int pof_handle_data(hysdn_card * card, int datlen) @@ -182,7 +168,7 @@ /* number of data bytes. The number delivered is additionally supplied for */ /* verification. The functions handles the data and returns the needed number */ /* of bytes for the next action. If the returned value is 0 or less an error */ -/* occured and booting must be aborted. */ +/* occurred and booting must be aborted. */ /******************************************************************************/ int pof_write_buffer(hysdn_card * card, int datlen) @@ -253,7 +239,7 @@ break; } if ((boot->last_error = pof_handle_data(card, datlen)) < 0) - return (boot->last_error); /* an error occured */ + return (boot->last_error); /* an error occurred */ boot->pof_recoffset += datlen; if (boot->pof_recoffset >= boot->pof_reclen) { boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */ @@ -346,7 +332,7 @@ /*********************************************************************************/ /* EvalSysrTokData checks additional records delivered with the Sysready Message */ -/* when POF has been booted. A return value of 0 is used if no error occured. */ +/* when POF has been booted. A return value of 0 is used if no error occurred. */ /*********************************************************************************/ int EvalSysrTokData(hysdn_card * card, uchar * cp, int len) Index: hysdn_defs.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hysdn_defs.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hysdn_defs.h 14 Jan 2001 18:44:23 -0000 1.1.1.1 +++ hysdn_defs.h 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,23 +1,13 @@ /* $Id$ - - * Linux driver for HYSDN cards, global definitions and exported vars and functions. - * written by Werner Cornelius (we...@ti...) for Hypercope GmbH - * - * Copyright 1999 by Werner Cornelius (we...@ti...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Linux driver for HYSDN cards + * global definitions and exported vars and functions. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Werner Cornelius (we...@ti...) for Hypercope GmbH + * Copyright 1999 by Werner Cornelius (we...@ti...) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ @@ -273,6 +263,7 @@ extern int hysdn_tx_cfgline(hysdn_card *, uchar *, word); /* send one cfg line */ /* hysdn_net.c */ +extern unsigned int hynet_enable; extern char *hysdn_net_revision; extern int hysdn_net_create(hysdn_card *); /* create a new net device */ extern int hysdn_net_release(hysdn_card *); /* delete the device */ @@ -282,6 +273,7 @@ extern void hysdn_rx_netpkt(hysdn_card *, uchar *, word); /* rxed packet from network */ #ifdef CONFIG_HYSDN_CAPI +extern unsigned int hycapi_enable; extern struct capi_driver_interface *hy_di; extern int hycapi_capi_create(hysdn_card *); /* create a new capi device */ extern int hycapi_capi_release(hysdn_card *); /* delete the device */ Index: hysdn_init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hysdn_init.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- hysdn_init.c 25 Feb 2001 23:15:10 -0000 1.1.1.2 +++ hysdn_init.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,23 +1,12 @@ /* $Id$ - - * Linux driver for HYSDN cards, init functions. - * written by Werner Cornelius (we...@ti...) for Hypercope GmbH - * - * Copyright 1999 by Werner Cornelius (we...@ti...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Linux driver for HYSDN cards, init functions. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Werner Cornelius (we...@ti...) for Hypercope GmbH + * Copyright 1999 by Werner Cornelius (we...@ti...) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ @@ -32,6 +21,18 @@ #include "hysdn_defs.h" +static struct pci_device_id hysdn_pci_tbl[] __initdata = { + {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_METRO}, + {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2}, + {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_ERGO}, + {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_OLD_ERGO}, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE(pci, hysdn_pci_tbl); +MODULE_DESCRIPTION("ISDN4Linux: Driver for HYSDN cards"); +MODULE_AUTHOR("Werner Cornelius"); +MODULE_LICENSE("GPL"); + static char *hysdn_init_revision = "$Revision$"; int cardmax; /* number of found cards */ hysdn_card *card_root = NULL; /* pointer to first card */ @@ -62,14 +63,6 @@ } /* terminating entry */ }; -static struct pci_device_id hysdn_pci_tbl[] __initdata = { - {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_METRO}, - {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2}, - {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_ERGO}, - {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_OLD_ERGO}, - { } /* Terminating entry */ -}; -MODULE_DEVICE_TABLE(pci, hysdn_pci_tbl); /*********************************************************************/ /* search_cards searches for available cards in the pci config data. */ @@ -89,6 +82,7 @@ akt_pcidev)) != NULL) { if (pci_enable_device(akt_pcidev)) continue; + if (!(card = kmalloc(sizeof(hysdn_card), GFP_KERNEL))) { printk(KERN_ERR "HYSDN: unable to alloc device mem \n"); return; @@ -173,7 +167,6 @@ /* image becomes smaller and the driver code is only loaded when needed. */ /* Additionally newer versions may be activated without rebooting. */ /****************************************************************************/ -#ifdef CONFIG_MODULES /******************************************************/ /* extract revision number from string for log output */ @@ -197,12 +190,12 @@ /****************************************************************************/ /* init_module is called once when the module is loaded to do all necessary */ /* things like autodetect... */ -/* If the return value of this function is 0 the init has been successfull */ +/* If the return value of this function is 0 the init has been successful */ /* and the module is added to the list in /proc/modules, otherwise an error */ /* is assumed and the module will not be kept in memory. */ /****************************************************************************/ -int -init_module(void) +static int __init +hysdn_init(void) { char tmp[50]; @@ -235,14 +228,14 @@ /***********************************************************************/ /* cleanup_module is called when the module is released by the kernel. */ -/* The routine is only called if init_module has been successfull and */ +/* The routine is only called if init_module has been successful and */ /* the module counter has a value of 0. Otherwise this function will */ /* not be called. This function must release all resources still allo- */ /* cated as after the return from this function the module code will */ /* be removed from memory. */ /***********************************************************************/ -void -cleanup_module(void) +static void __exit +hysdn_exit(void) { #ifdef CONFIG_HYSDN_CAPI hysdn_card *card; @@ -261,4 +254,5 @@ printk(KERN_NOTICE "HYSDN: module unloaded\n"); } /* cleanup_module */ -#endif /* CONFIG_MODULES */ +module_init(hysdn_init); +module_exit(hysdn_exit); Index: hysdn_net.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hysdn_net.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hysdn_net.c 14 Jan 2001 18:44:25 -0000 1.1.1.1 +++ hysdn_net.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,28 +1,16 @@ /* $Id$ - + * * Linux driver for HYSDN cards, net (ethernet type) handling routines. * - * written by Werner Cornelius (we...@ti...) for Hypercope GmbH + * Author Werner Cornelius (we...@ti...) for Hypercope GmbH + * Copyright 1999 by Werner Cornelius (we...@ti...) * - * Copyright 1999 by Werner Cornelius (we...@ti...) + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * * This net module has been inspired by the skeleton driver from * Donald Becker (be...@CE...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * */ #define __NO_VERSION__ @@ -37,6 +25,9 @@ #include "hysdn_defs.h" +unsigned int hynet_enable = 0xffffffff; +MODULE_PARM(hynet_enable, "i"); + /* store the actual version for log reporting */ char *hysdn_net_revision = "$Revision$"; @@ -301,8 +292,7 @@ hysdn_net_release(card); /* release an existing net device */ if ((dev = kmalloc(sizeof(struct net_local), GFP_KERNEL)) == NULL) { printk(KERN_WARNING "HYSDN: unable to allocate mem\n"); - if (card->debug_flags & LOG_NET_INIT) - return (-ENOMEM); + return (-ENOMEM); } memset(dev, 0, sizeof(struct net_local)); /* clean the structure */ @@ -350,7 +340,7 @@ if (card->debug_flags & LOG_NET_INIT) hysdn_addlog(card, "network device deleted"); - return (0); /* always successfull */ + return (0); /* always successful */ } /* hysdn_net_release */ /*****************************************************************************/ Index: hysdn_pof.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hysdn_pof.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hysdn_pof.h 14 Jan 2001 18:44:26 -0000 1.1.1.1 +++ hysdn_pof.h 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,23 +1,12 @@ /* $Id$ - - * Linux driver for HYSDN cards, definitions used for handling pof-files. - * written by Werner Cornelius (we...@ti...) for Hypercope GmbH - * - * Copyright 1999 by Werner Cornelius (we...@ti...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Linux driver for HYSDN cards, definitions used for handling pof-files. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Werner Cornelius (we...@ti...) for Hypercope GmbH + * Copyright 1999 by Werner Cornelius (we...@ti...) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ Index: hysdn_procconf.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hysdn_procconf.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hysdn_procconf.c 14 Jan 2001 18:44:28 -0000 1.1.1.1 +++ hysdn_procconf.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,23 +1,13 @@ /* $Id$ - + * * Linux driver for HYSDN cards, /proc/net filesystem dir and conf functions. + * * written by Werner Cornelius (we...@ti...) for Hypercope GmbH * * Copyright 1999 by Werner Cornelius (we...@ti...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ @@ -41,7 +31,7 @@ #define CONF_STATE_DETECT 0 /* waiting for detect */ #define CONF_STATE_CONF 1 /* writing config data */ #define CONF_STATE_POF 2 /* writing pof data */ -#define CONF_LINE_LEN 80 /* 80 chars max */ +#define CONF_LINE_LEN 255 /* 255 chars max */ struct conf_writedata { hysdn_card *card; /* card the device is connected to */ @@ -56,7 +46,7 @@ /***********************************************************************/ /* process_line parses one config line and transfers it to the card if */ /* necessary. */ -/* if the return value is negative an error occured. */ +/* if the return value is negative an error occurred. */ /***********************************************************************/ static int process_line(struct conf_writedata *cnf) @@ -92,15 +82,6 @@ return (0); } /* process_line */ -/*************************/ -/* dummy file operations */ -/*************************/ -static loff_t -hysdn_dummy_lseek(struct file *file, loff_t offset, int orig) -{ - return -ESPIPE; -} /* hysdn_dummy_lseek */ - /***********************************/ /* conf file operations and tables */ /***********************************/ @@ -130,7 +111,7 @@ if (ch == 0x1A) { /* we detected a pof file */ if ((cnf->needed_size = pof_write_open(cnf->card, &cnf->pof_buffer)) <= 0) - return (cnf->needed_size); /* an error occured -> exit */ + return (cnf->needed_size); /* an error occurred -> exit */ cnf->buf_size = 0; /* buffer is empty */ cnf->state = CONF_STATE_POF; /* new state */ } else { @@ -158,7 +139,7 @@ cnf->needed_size = pof_write_buffer(cnf->card, cnf->buf_size); /* write data */ if (cnf->needed_size <= 0) { cnf->card->state = CARD_STATE_BOOTERR; /* show boot error */ - return (cnf->needed_size); /* an error occured */ + return (cnf->needed_size); /* an error occurred */ } cnf->buf_size = 0; /* buffer is empty again */ } @@ -396,7 +377,7 @@ /******************************************************/ static struct file_operations conf_fops = { - llseek: hysdn_dummy_lseek, + llseek: no_llseek, read: hysdn_conf_read, write: hysdn_conf_write, open: hysdn_conf_open, @@ -465,4 +446,4 @@ } remove_proc_entry(PROC_SUBDIR_NAME, proc_net); -} /* hysdn_procfs_release */ +} Index: hysdn_procfs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hysdn_procfs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hysdn_procfs.c 14 Jan 2001 18:44:30 -0000 1.1.1.1 +++ hysdn_procfs.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -20,8 +20,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log$ - * Revision 1.1.1.1 2001/01/14 18:44:30 kenn - * Importing official Linus 2.4.0 tree + * Revision 1.2 2002/04/10 15:32:26 atp + * synch 2.4.15 commit 49 * * Revision 1.1 2000/02/10 19:45:18 werner * @@ -116,15 +116,6 @@ } /* put_log_buffer */ -/*************************/ -/* dummy file operations */ -/*************************/ -static loff_t -hysdn_dummy_lseek(struct file *file, loff_t offset, int orig) -{ - return -ESPIPE; -} /* hysdn_dummy_lseek */ - /**********************************/ /* log file operations and tables */ /**********************************/ @@ -142,7 +133,7 @@ return (-ESPIPE); if ((retval = pof_boot_write(card, buf, count)) < 0) - retval = -EFAULT; /* an error occured */ + retval = -EFAULT; /* an error occurred */ return (retval); } /* hysdn_log_write */ @@ -343,7 +334,7 @@ /**************************************************/ static struct file_operations log_fops = { - llseek: hysdn_dummy_lseek, + llseek: no_llseek, read: hysdn_log_read, write: hysdn_log_write, poll: hysdn_log_poll, Index: hysdn_proclog.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hysdn_proclog.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hysdn_proclog.c 14 Jan 2001 18:44:31 -0000 1.1.1.1 +++ hysdn_proclog.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,23 +1,12 @@ /* $Id$ - - * Linux driver for HYSDN cards, /proc/net filesystem log functions. - * written by Werner Cornelius (we...@ti...) for Hypercope GmbH - * - * Copyright 1999 by Werner Cornelius (we...@ti...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Linux driver for HYSDN cards, /proc/net filesystem log functions. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Werner Cornelius (we...@ti...) for Hypercope GmbH + * Copyright 1999 by Werner Cornelius (we...@ti...) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ @@ -153,15 +142,6 @@ } /* put_log_buffer */ -/*************************/ -/* dummy file operations */ -/*************************/ -static loff_t -hysdn_dummy_lseek(struct file *file, loff_t offset, int orig) -{ - return -ESPIPE; -} /* hysdn_dummy_lseek */ - /******************************/ /* file operations and tables */ /******************************/ @@ -228,7 +208,7 @@ struct log_data *inf; int len; word ino; - struct procdata *pd; + struct procdata *pd = NULL; hysdn_card *card; if (!*((struct log_data **) file->private_data)) { @@ -271,7 +251,7 @@ hysdn_log_open(struct inode *ino, struct file *filep) { hysdn_card *card; - struct procdata *pd; + struct procdata *pd = NULL; ulong flags; lock_kernel(); @@ -381,7 +361,7 @@ unsigned int mask = 0; word ino; hysdn_card *card; - struct procdata *pd; + struct procdata *pd = NULL; if ((file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) return (mask); /* no polling for write supported */ @@ -411,7 +391,7 @@ /**************************************************/ static struct file_operations log_fops = { - llseek: hysdn_dummy_lseek, + llseek: no_llseek, read: hysdn_log_read, write: hysdn_log_write, poll: hysdn_log_poll, Index: hysdn_sched.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/hysdn_sched.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- hysdn_sched.c 14 Jan 2001 18:44:33 -0000 1.1.1.1 +++ hysdn_sched.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,36 +1,23 @@ /* $Id$ - - * Linux driver for HYSDN cards, scheduler routines for handling exchange card <-> pc. - * - * written by Werner Cornelius (we...@ti...) for Hypercope GmbH - * - * Copyright 1999 by Werner Cornelius (we...@ti...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Linux driver for HYSDN cards + * scheduler routines for handling exchange card <-> pc. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Werner Cornelius (we...@ti...) for Hypercope GmbH + * Copyright 1999 by Werner Cornelius (we...@ti...) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ -#define __NO_VERSION__ #include <linux/config.h> -#include <linux/module.h> -#include <linux/version.h> -#include <asm/io.h> +#include <linux/sched.h> #include <linux/signal.h> #include <linux/kernel.h> #include <linux/ioport.h> #include <linux/interrupt.h> +#include <asm/io.h> #include "hysdn_defs.h" @@ -47,7 +34,10 @@ switch (chan) { case CHAN_NDIS_DATA: - hysdn_rx_netpkt(card, buf, len); /* give packet to network handler */ + if (hynet_enable & (1 << card->myid)) { + /* give packet to network handler */ + hysdn_rx_netpkt(card, buf, len); + } break; case CHAN_ERRLOG: @@ -58,7 +48,9 @@ #ifdef CONFIG_HYSDN_CAPI case CHAN_CAPI: /* give packet to CAPI handler */ - hycapi_rx_capipkt(card, buf, len); + if (hycapi_enable & (1 << card->myid)) { + hycapi_rx_capipkt(card, buf, len); + } break; #endif /* CONFIG_HYSDN_CAPI */ default: @@ -115,7 +107,9 @@ return (1); /* tell that data should be send */ } /* error log start and able to send */ /* now handle network interface packets */ - if ((skb = hysdn_tx_netget(card)) != NULL) { + if ((hynet_enable & (1 << card->myid)) && + (skb = hysdn_tx_netget(card)) != NULL) + { if (skb->len <= maxlen) { memcpy(buf, skb->data, skb->len); /* copy the packet to the buffer */ *len = skb->len; @@ -126,7 +120,9 @@ hysdn_tx_netack(card); /* aknowledge packet -> throw away */ } /* send a network packet if available */ #ifdef CONFIG_HYSDN_CAPI - if((skb = hycapi_tx_capiget(card)) != NULL) { + if( ((hycapi_enable & (1 << card->myid))) && + ((skb = hycapi_tx_capiget(card)) != NULL) ) + { if (skb->len <= maxlen) { memcpy(buf, skb->data, skb->len); *len = skb->len; @@ -141,7 +137,7 @@ /*****************************************************************************/ -/* send one config line to the card and return 0 if successfull, otherwise a */ +/* send one config line to the card and return 0 if successful, otherwise a */ /* negative error code. */ /* The function works with timeouts perhaps not giving the greatest speed */ /* sending the line, but this should be meaningless beacuse only some lines */ Index: ince1pc.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/hysdn/ince1pc.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ince1pc.h 14 Jan 2001 18:44:33 -0000 1.1.1.1 +++ ince1pc.h 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,17 +1,19 @@ +/* + * Linux driver for HYSDN cards + * common definitions for both sides of the bus: + * - conventions both spoolers must know + * - channel numbers agreed upon + * + * Author M. Steinkopf + * Copyright 1999 by M. Steinkopf + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. + * + */ + #ifndef __INCE1PC_H__ #define __INCE1PC_H__ - -/**************************************************************************** - - FILE: ince1pc.h - - AUTHOR: M.Steinkopf - - PURPOSE: common definitions for both sides of the bus: - - conventions both spoolers must know - - channel numbers agreed upon - -*****************************************************************************/ /* basic scalar definitions have same meanning, * but their declaration location depends on environment |
From: Andy P. <at...@us...> - 2002-04-10 18:36:41
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/alpha/boot In directory usw-pr-cvs1:/tmp/cvs-serv19209/alpha/boot Modified Files: Makefile bootloader.lds bootp.c Log Message: synch 2.4.15 commit 31 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/boot/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:22:26 -0000 1.1.1.1 +++ Makefile 10 Apr 2002 13:07:22 -0000 1.2 @@ -59,7 +59,7 @@ echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $$5}'`" > $@T ifdef INITRD [ -f $(INITRD) ] || exit 1 - echo "#define INITRD_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T + echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T endif cmp -s $@T $@ || mv -f $@T $@ rm -f $@T Index: bootloader.lds =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/boot/bootloader.lds,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bootloader.lds 14 Jan 2001 19:22:26 -0000 1.1.1.1 +++ bootloader.lds 10 Apr 2002 13:07:22 -0000 1.2 @@ -6,7 +6,7 @@ .text : { *(.text) } _etext = .; PROVIDE (etext = .); - .rodata : { *(.rodata) } + .rodata : { *(.rodata) *(.rodata.*) } .data : { *(.data) CONSTRUCTORS } .got : { *(.got) } .sdata : { *(.sdata) } Index: bootp.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/boot/bootp.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bootp.c 14 Jan 2001 19:22:28 -0000 1.1.1.1 +++ bootp.c 10 Apr 2002 13:07:22 -0000 1.2 @@ -147,7 +147,7 @@ */ static long nbytes; static char envval[256] __attribute__((aligned(8))); -#ifdef INITRD_SIZE +#ifdef INITRD_IMAGE_SIZE static unsigned long initrd_start; #endif @@ -164,7 +164,7 @@ } pal_init(); -#ifdef INITRD_SIZE +#ifdef INITRD_IMAGE_SIZE /* The initrd must be page-aligned. See below for the cause of the magic number 5. */ initrd_start = ((START_ADDR + 5*KERNEL_SIZE) | (PAGE_SIZE-1)) + 1; @@ -192,17 +192,17 @@ * * Sigh... */ -#ifdef INITRD_SIZE - load(initrd_start, KERNEL_ORIGIN+KERNEL_SIZE, INITRD_SIZE); +#ifdef INITRD_IMAGE_SIZE + load(initrd_start, KERNEL_ORIGIN+KERNEL_SIZE, INITRD_IMAGE_SIZE); #endif load(START_ADDR+(4*KERNEL_SIZE), KERNEL_ORIGIN, KERNEL_SIZE); load(START_ADDR, START_ADDR+(4*KERNEL_SIZE), KERNEL_SIZE); memset((char*)ZERO_PGE, 0, PAGE_SIZE); strcpy((char*)ZERO_PGE, envval); -#ifdef INITRD_SIZE +#ifdef INITRD_IMAGE_SIZE ((long *)(ZERO_PGE+256))[0] = initrd_start; - ((long *)(ZERO_PGE+256))[1] = INITRD_SIZE; + ((long *)(ZERO_PGE+256))[1] = INITRD_IMAGE_SIZE; #endif runkernel(); |
From: Andy P. <at...@us...> - 2002-04-10 18:36:41
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/alpha/boot/tools In directory usw-pr-cvs1:/tmp/cvs-serv19209/alpha/boot/tools Modified Files: objstrip.c Log Message: synch 2.4.15 commit 31 Index: objstrip.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/boot/tools/objstrip.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- objstrip.c 14 Jan 2001 19:22:29 -0000 1.1.1.1 +++ objstrip.c 10 Apr 2002 13:07:22 -0000 1.2 @@ -14,6 +14,8 @@ * Richard L. Sites and Richard T. Witek. */ #include <stdio.h> +#include <string.h> +#include <stdlib.h> #include <unistd.h> #include <sys/fcntl.h> |
From: Andy P. <at...@us...> - 2002-04-10 18:36:41
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/alpha In directory usw-pr-cvs1:/tmp/cvs-serv19209/alpha Modified Files: config.in defconfig vmlinux.lds.in Log Message: synch 2.4.15 commit 31 Index: config.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/config.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- config.in 14 Jan 2001 19:22:23 -0000 1.1.1.1 +++ config.in 10 Apr 2002 13:07:21 -0000 1.2 @@ -5,6 +5,8 @@ define_bool CONFIG_ALPHA y define_bool CONFIG_UID16 n +define_bool CONFIG_RWSEM_GENERIC_SPINLOCK n +define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM y mainmenu_name "Kernel configuration of Linux for Alpha machines" @@ -52,6 +54,7 @@ RX164 CONFIG_ALPHA_RX164 \ SX164 CONFIG_ALPHA_SX164 \ Sable CONFIG_ALPHA_SABLE \ + Shark CONFIG_ALPHA_SHARK \ Takara CONFIG_ALPHA_TAKARA \ Titan CONFIG_ALPHA_TITAN \ Wildfire CONFIG_ALPHA_WILDFIRE" Generic @@ -141,9 +144,15 @@ define_bool CONFIG_ALPHA_TSUNAMI y bool 'EV67 (or later) CPU (speed > 600MHz)?' CONFIG_ALPHA_EV67 fi +if [ "$CONFIG_ALPHA_SHARK" = "y" ] +then + define_bool CONFIG_ALPHA_EV6 y + define_bool CONFIG_ALPHA_EV67 y + define_bool CONFIG_ALPHA_TSUNAMI y +fi if [ "$CONFIG_ALPHA_WILDFIRE" = "y" -o "$CONFIG_ALPHA_TITAN" = "y" ] then - define_bool CONFIG_ALPHA_EV6 y + define_bool CONFIG_ALPHA_EV6 y define_bool CONFIG_ALPHA_EV67 y fi if [ "$CONFIG_ALPHA_RAWHIDE" = "y" ] @@ -171,7 +180,7 @@ -o "$CONFIG_ALPHA_SABLE" = "y" -o "$CONFIG_ALPHA_NORITAKE" = "y" \ -o "$CONFIG_ALPHA_DP264" = "y" -o "$CONFIG_ALPHA_RAWHIDE" = "y" \ -o "$CONFIG_ALPHA_EIGER" = "y" -o "$CONFIG_ALPHA_WILDFIRE" = "y" \ - -o "$CONFIG_ALPHA_TITAN" = "y" ] + -o "$CONFIG_ALPHA_TITAN" = "y" -o "$CONFIG_ALPHA_SHARK" = "y" ] then define_bool CONFIG_ALPHA_SRM y fi @@ -180,7 +189,7 @@ -o "$CONFIG_ALPHA_TAKARA" = "y" -o "$CONFIG_ALPHA_EB164" = "y" \ -o "$CONFIG_ALPHA_ALCOR" = "y" -o "$CONFIG_ALPHA_MIATA" = "y" \ -o "$CONFIG_ALPHA_LX164" = "y" -o "$CONFIG_ALPHA_SX164" = "y" \ - -o "$CONFIG_ALPHA_NAUTILUS" = "y" ] + -o "$CONFIG_ALPHA_NAUTILUS" = "y" -o "$CONFIG_ALPHA_NONAME" = "y" ] then bool 'Use SRM as bootloader' CONFIG_ALPHA_SRM fi @@ -202,21 +211,26 @@ if [ "$CONFIG_ALPHA_SABLE" = "y" -o "$CONFIG_ALPHA_RAWHIDE" = "y" \ -o "$CONFIG_ALPHA_DP264" = "y" -o "$CONFIG_ALPHA_WILDFIRE" = "y" \ - -o "$CONFIG_ALPHA_TITAN" = "y" -o "$CONFIG_ALPHA_GENERIC" = "y" ] + -o "$CONFIG_ALPHA_TITAN" = "y" -o "$CONFIG_ALPHA_GENERIC" = "y" \ + -o "$CONFIG_ALPHA_SHARK" = "y" ] then bool 'Symmetric multi-processing support' CONFIG_SMP fi -# The machine must be able to support more than 8GB physical memory -# before large vmalloc might even pretend to be an issue. -if [ "$CONFIG_ALPHA_GENERIC" = "y" -o "$CONFIG_ALPHA_DP264" = "y" \ - -o "$CONFIG_ALPHA_WILDFIRE" = "y" -o "$CONFIG_ALPHA_TITAN" = "y" ] -then - bool 'Large VMALLOC support' CONFIG_ALPHA_LARGE_VMALLOC -else - define_bool CONFIG_ALPHA_LARGE_VMALLOC n +if [ "$CONFIG_SMP" = "y" ]; then + define_bool CONFIG_HAVE_DEC_LOCK y +fi + +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + bool 'Discontiguous Memory Support' CONFIG_DISCONTIGMEM + if [ "$CONFIG_DISCONTIGMEM" = "y" ]; then + bool ' NUMA Support' CONFIG_NUMA + fi fi +# LARGE_VMALLOC is racy, if you *really* need it then fix it first +define_bool CONFIG_ALPHA_LARGE_VMALLOC n + source drivers/pci/Config.in bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG @@ -236,6 +250,10 @@ "ELF CONFIG_KCORE_ELF \ A.OUT CONFIG_KCORE_AOUT" ELF fi +if [ "$CONFIG_PROC_FS" != "n" -a "$CONFIG_ALPHA_SRM" = "y" ]; then + tristate 'SRM environment through procfs' CONFIG_SRM_ENV +fi + tristate 'Kernel support for a.out (ECOFF) binaries' CONFIG_BINFMT_AOUT tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC @@ -278,6 +296,10 @@ fi endmenu +if [ "$CONFIG_PCI" = "y" ]; then + source drivers/message/fusion/Config.in +fi + if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment comment 'Network device support' @@ -349,17 +371,25 @@ source drivers/usb/Config.in source drivers/input/Config.in -mainmenu_option next_comment -comment 'Kernel hacking' - if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - tristate 'Kernel FP software completion' CONFIG_MATHEMU -else - define_tristate CONFIG_MATHEMU y + source net/bluetooth/Config.in fi -bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ +mainmenu_option next_comment +comment 'Kernel hacking' bool 'Legacy kernel start address' CONFIG_ALPHA_LEGACY_START_ADDRESS + +bool 'Kernel debugging' CONFIG_DEBUG_KERNEL +if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then + tristate ' Kernel FP software completion' CONFIG_MATHEMU + bool ' Debug memory allocations' CONFIG_DEBUG_SLAB + bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ + bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK + bool ' Read-write spinlock debugging' CONFIG_DEBUG_RWLOCK + bool ' Semaphore debugging' CONFIG_DEBUG_SEMAPHORE +else + define_tristate CONFIG_MATHEMU y +fi endmenu Index: defconfig =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/defconfig,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- defconfig 14 Jan 2001 19:22:25 -0000 1.1.1.1 +++ defconfig 10 Apr 2002 13:07:21 -0000 1.2 @@ -1,7 +1,10 @@ # # Automatically generated make config: don't edit # +CONFIG_ALPHA=y # CONFIG_UID16 is not set +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y # # Code maturity level options @@ -44,14 +47,18 @@ # CONFIG_ALPHA_RX164 is not set # CONFIG_ALPHA_SX164 is not set # CONFIG_ALPHA_SABLE is not set +# CONFIG_ALPHA_SHARK is not set # CONFIG_ALPHA_TAKARA is not set # CONFIG_ALPHA_TITAN is not set # CONFIG_ALPHA_WILDFIRE is not set CONFIG_ISA=y +CONFIG_EISA=y # CONFIG_SBUS is not set +# CONFIG_MCA is not set CONFIG_PCI=y CONFIG_ALPHA_BROKEN_IRQ_MASK=y # CONFIG_SMP is not set +# CONFIG_DISCONTIGMEM is not set # CONFIG_ALPHA_LARGE_VMALLOC is not set CONFIG_PCI_NAMES=y # CONFIG_HOTPLUG is not set @@ -106,8 +113,8 @@ # CONFIG_MD_RAID0 is not set # CONFIG_MD_RAID1 is not set # CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set # CONFIG_BLK_DEV_LVM is not set -# CONFIG_LVM_PROC_FS is not set # # Networking options @@ -134,12 +141,16 @@ # CONFIG_IP_NF_CONNTRACK=m CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IRC=m CONFIG_IP_NF_IPTABLES=m # CONFIG_IP_NF_MATCH_LIMIT is not set # CONFIG_IP_NF_MATCH_MAC is not set # CONFIG_IP_NF_MATCH_MARK is not set # CONFIG_IP_NF_MATCH_MULTIPORT is not set # CONFIG_IP_NF_MATCH_TOS is not set +# CONFIG_IP_NF_MATCH_LENGTH is not set +# CONFIG_IP_NF_MATCH_TTL is not set +# CONFIG_IP_NF_MATCH_TCPMSS is not set # CONFIG_IP_NF_MATCH_STATE is not set # CONFIG_IP_NF_MATCH_UNCLEAN is not set # CONFIG_IP_NF_MATCH_OWNER is not set @@ -150,13 +161,18 @@ CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m # CONFIG_IP_NF_TARGET_REDIRECT is not set +# CONFIG_IP_NF_NAT_SNMP_BASIC is not set +CONFIG_IP_NF_NAT_IRC=m +CONFIG_IP_NF_NAT_FTP=m # CONFIG_IP_NF_MANGLE is not set # CONFIG_IP_NF_TARGET_LOG is not set +# CONFIG_IP_NF_TARGET_TCPMSS is not set CONFIG_IP_NF_COMPAT_IPCHAINS=y CONFIG_IP_NF_NAT_NEEDED=y # CONFIG_IPV6 is not set # CONFIG_KHTTPD is not set # CONFIG_ATM is not set +CONFIG_VLAN_8021Q=m # # @@ -221,6 +237,7 @@ CONFIG_BLK_DEV_IDEPCI=y # CONFIG_IDEPCI_SHARE_IRQ is not set CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_IDEDMA_PCI_AUTO=y CONFIG_BLK_DEV_IDEDMA=y @@ -230,8 +247,8 @@ # CONFIG_AEC62XX_TUNING is not set CONFIG_BLK_DEV_ALI15X3=y # CONFIG_WDC_ALI15X3 is not set -# CONFIG_BLK_DEV_AMD7409 is not set -# CONFIG_AMD7409_OVERRIDE is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_AMD74XX_OVERRIDE is not set CONFIG_BLK_DEV_CMD64X=y CONFIG_BLK_DEV_CY82C693=y # CONFIG_BLK_DEV_CS5530 is not set @@ -242,7 +259,10 @@ # CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_PDC202XX is not set # CONFIG_PDC202XX_BURST is not set +# CONFIG_PDC202XX_FORCE is not set +# CONFIG_BLK_DEV_SVWKS is not set # CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_IDE_CHIPSETS is not set @@ -250,6 +270,9 @@ # CONFIG_IDEDMA_IVB is not set # CONFIG_DMA_NONPCI is not set CONFIG_BLK_DEV_IDE_MODES=y +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set # # SCSI support @@ -262,6 +285,7 @@ CONFIG_BLK_DEV_SD=y CONFIG_SD_EXTRA_DEVS=40 # CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=y CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_SR_EXTRA_DEVS=2 @@ -285,10 +309,10 @@ # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set CONFIG_SCSI_AIC7XXX=y -CONFIG_AIC7XXX_TCQ_ON_BY_DEFAULT=y -CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 -CONFIG_AIC7XXX_PROC_STATS=y -CONFIG_AIC7XXX_RESET_DELAY=5 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=253 +CONFIG_AIC7XXX_RESET_DELAY_MS=5000 +# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set +# CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set @@ -350,6 +374,12 @@ # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set CONFIG_NET_VENDOR_3COM=y # CONFIG_EL1 is not set # CONFIG_EL2 is not set @@ -357,12 +387,15 @@ # CONFIG_EL16 is not set # CONFIG_EL3 is not set # CONFIG_3C515 is not set +# CONFIG_ELMC is not set +# CONFIG_ELMC_II is not set CONFIG_VORTEX=y # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set # CONFIG_AT1700 is not set # CONFIG_DEPCA is not set +# CONFIG_HP100 is not set # CONFIG_NET_ISA is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set @@ -394,11 +427,15 @@ # Ethernet (1000 Mbit) # # CONFIG_ACENIC is not set +CONFIG_DL2K=m +# CONFIG_MYRI_SBUS is not set +CONFIG_NS83820=m # CONFIG_HAMACHI is not set CONFIG_YELLOWFIN=y # CONFIG_SK98LIN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set +# CONFIG_PLIP is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set @@ -464,7 +501,11 @@ # # Joysticks # -# CONFIG_JOYSTICK is not set +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# # # Input core support is needed for joysticks @@ -500,6 +541,8 @@ # CONFIG_QUOTA is not set CONFIG_AUTOFS_FS=m # CONFIG_AUTOFS4_FS is not set +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set # CONFIG_ADFS_FS is not set # CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set @@ -511,11 +554,15 @@ CONFIG_VFAT_FS=y # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set +CONFIG_TMPFS=y # CONFIG_RAMFS is not set CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set +# CONFIG_ZISOFS is not set # CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set # CONFIG_NTFS_FS is not set # CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set @@ -529,7 +576,6 @@ # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set -# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set # CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set @@ -555,10 +601,10 @@ # CONFIG_NCPFS_NFS_NS is not set # CONFIG_NCPFS_OS2_NS is not set # CONFIG_NCPFS_SMALLDOS is not set -# CONFIG_NCPFS_MOUNT_SUBDIR is not set -# CONFIG_NCPFS_NDS_DOMAINS is not set # CONFIG_NCPFS_NLS is not set # CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set +# CONFIG_ZLIB_FS_INFLATE is not set # # Partition Types @@ -566,6 +612,7 @@ # CONFIG_PARTITION_ADVANCED is not set CONFIG_OSF_PARTITION=y CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set CONFIG_NLS=y # @@ -587,11 +634,13 @@ # CONFIG_NLS_CODEPAGE_865 is not set # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ISO8859_1 is not set # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set @@ -599,11 +648,12 @@ # CONFIG_NLS_ISO8859_5 is not set # CONFIG_NLS_ISO8859_6 is not set # CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set # CONFIG_NLS_ISO8859_15 is not set # CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set # @@ -627,13 +677,121 @@ # CONFIG_USB is not set # +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# # Input core support # # CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set # # Kernel hacking # +CONFIG_ALPHA_LEGACY_START_ADDRESS=y +CONFIG_DEBUG_KERNEL=y CONFIG_MATHEMU=y +# CONFIG_DEBUG_SLAB is not set CONFIG_MAGIC_SYSRQ=y -CONFIG_ALPHA_LEGACY_START_ADDRESS=y Index: vmlinux.lds.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/vmlinux.lds.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- vmlinux.lds.in 14 Jan 2001 19:22:25 -0000 1.1.1.1 +++ vmlinux.lds.in 10 Apr 2002 13:07:21 -0000 1.2 @@ -53,7 +53,7 @@ /* Global data */ _data = .; .data.cacheline_aligned : { *(.data.cacheline_aligned) } - .rodata : { *(.rodata) } + .rodata : { *(.rodata) *(.rodata.*) } .data : { *(.data) CONSTRUCTORS } .got : { *(.got) } .sdata : { *(.sdata) } @@ -92,5 +92,5 @@ .debug_typenames 0 : { *(.debug_typenames) } .debug_varnames 0 : { *(.debug_varnames) } - /DISCARD/ : { *(.text.exit) *(.data.exit) } + /DISCARD/ : { *(.text.exit) *(.data.exit) *(.exitcall.exit) } } |
From: Andy P. <at...@us...> - 2002-04-10 18:36:39
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/gt64120/common In directory usw-pr-cvs1:/tmp/cvs-serv15675/arch/mips/gt64120/common Log Message: Directory /cvsroot/linux-vax/kernel-2.4/arch/mips/gt64120/common added to the repository |
From: Andy P. <at...@us...> - 2002-04-10 18:36:33
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/sparc64/mm In directory usw-pr-cvs1:/tmp/cvs-serv32333/sparc64/mm Modified Files: Makefile extable.c fault.c generic.c init.c modutil.c ultra.S Log Message: synch 2.4.15 commit 46 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/mm/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: extable.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/mm/extable.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- extable.c 14 Jan 2001 19:45:13 -0000 1.1.1.1 +++ extable.c 10 Apr 2002 15:21:24 -0000 1.2 @@ -43,27 +43,32 @@ return 0; } +extern spinlock_t modlist_lock; + unsigned long search_exception_table(unsigned long addr, unsigned long *g2) { - unsigned long ret; + unsigned long ret = 0, flags; #ifndef CONFIG_MODULES /* There is only the kernel to search. */ ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr, g2); - if (ret) return ret; + return ret; #else /* The kernel is the last "module" -- no need to treat it special. */ struct module *mp; + + spin_lock_irqsave(&modlist_lock, flags); for (mp = module_list; mp != NULL; mp = mp->next) { - if (mp->ex_table_start == NULL) + if (mp->ex_table_start == NULL || !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING))) continue; ret = search_one_table(mp->ex_table_start, mp->ex_table_end-1, addr, g2); - if (ret) return ret; + if (ret) + break; } + spin_unlock_irqrestore(&modlist_lock, flags); + return ret; #endif - - return 0; } Index: fault.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/mm/fault.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fault.c 14 Jan 2001 19:45:14 -0000 1.1.1.1 +++ fault.c 10 Apr 2002 15:21:24 -0000 1.2 @@ -22,11 +22,58 @@ #include <asm/openprom.h> #include <asm/oplib.h> #include <asm/uaccess.h> +#include <asm/asi.h> +#include <asm/lsu.h> #define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0])) extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; +/* + * To debug kernel during syscall entry. + */ +void syscall_trace_entry(struct pt_regs *regs) +{ + printk("scall entry: %s[%d]/cpu%d: %d\n", current->comm, current->pid, smp_processor_id(), (int) regs->u_regs[UREG_G1]); +} + +/* + * To debug kernel during syscall exit. + */ +void syscall_trace_exit(struct pt_regs *regs) +{ + printk("scall exit: %s[%d]/cpu%d: %d\n", current->comm, current->pid, smp_processor_id(), (int) regs->u_regs[UREG_G1]); +} + +/* + * To debug kernel to catch accesses to certain virtual/physical addresses. + * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. + * flags = VM_READ watches memread accesses, flags = VM_WRITE watches memwrite accesses. + * Caller passes in a 64bit aligned addr, with mask set to the bytes that need to be + * watched. This is only useful on a single cpu machine for now. After the watchpoint + * is detected, the process causing it will be killed, thus preventing an infinite loop. + */ +void set_brkpt(unsigned long addr, unsigned char mask, int flags, int mode) +{ + unsigned long lsubits = LSU_CONTROL_IC|LSU_CONTROL_DC|LSU_CONTROL_IM|LSU_CONTROL_DM; + + __asm__ __volatile__("stxa %0, [%1] %2\n\t" + "membar #Sync" + : /* no outputs */ + : "r" (addr), "r" (mode ? VIRT_WATCHPOINT : PHYS_WATCHPOINT), + "i" (ASI_DMMU)); + lsubits |= ((unsigned long)mask << (mode ? 25 : 33)); + if (flags & VM_READ) + lsubits |= (mode ? LSU_CONTROL_VR : LSU_CONTROL_PR); + if (flags & VM_WRITE) + lsubits |= (mode ? LSU_CONTROL_VW : LSU_CONTROL_PW); + __asm__ __volatile__("stxa %0, [%%g0] %1\n\t" + "membar #Sync" + : /* no outputs */ + : "r" (lsubits), "i" (ASI_LSU_CONTROL) + : "memory"); +} + /* Nice, simple, prom library does all the sweating for us. ;) */ unsigned long __init prom_probe_memory (void) { @@ -92,6 +139,13 @@ die_if_kernel("Oops", regs); } +/* + * We now make sure that mmap_sem is held in all paths that call + * this. Additionally, to prevent kswapd from ripping ptes from + * under us, raise interrupts around the time that we look at the + * pte, kswapd will have to wait to get his smp ipi response from + * us. This saves us having to get page_table_lock. + */ static unsigned int get_user_insn(unsigned long tpc) { pgd_t *pgdp = pgd_offset(current->mm, tpc); @@ -99,13 +153,17 @@ pte_t *ptep, pte; unsigned long pa; u32 insn = 0; + unsigned long pstate; if (pgd_none(*pgdp)) - goto out; + goto outret; pmdp = pmd_offset(pgdp, tpc); if (pmd_none(*pmdp)) - goto out; + goto outret; ptep = pte_offset(pmdp, tpc); + __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate)); + __asm__ __volatile__("wrpr %0, %1, %%pstate" + : : "r" (pstate), "i" (PSTATE_IE)); pte = *ptep; if (!pte_present(pte)) goto out; @@ -119,6 +177,8 @@ : "r" (pa), "i" (ASI_PHYS_USE_EC)); out: + __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate)); +outret: return insn; } @@ -137,21 +197,28 @@ extern int handle_ldf_stq(u32, struct pt_regs *); extern int handle_ld_nf(u32, struct pt_regs *); -static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code, - unsigned int insn, unsigned long address) +static inline unsigned int get_fault_insn(struct pt_regs *regs, unsigned int insn) { - unsigned long g2; - unsigned char asi = ASI_P; - if (!insn) { + if (!regs->tpc || (regs->tpc & 0x3)) + return 0; if (regs->tstate & TSTATE_PRIV) { - if (!regs->tpc || (regs->tpc & 0x3)) - goto cannot_handle; insn = *(unsigned int *)regs->tpc; } else { insn = get_user_insn(regs->tpc); } } + return insn; +} + +static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code, + unsigned int insn, unsigned long address) +{ + unsigned long g2; + unsigned char asi = ASI_P; + + if ((!insn) && (regs->tstate & TSTATE_PRIV)) + goto cannot_handle; /* If user insn could be read (thus insn is zero), that * is fine. We will just gun down the process with a signal @@ -232,9 +299,14 @@ * context, we must not take the fault.. */ if (in_interrupt() || !mm) - goto handle_kernel_fault; + goto intr_or_no_mm; - down(&mm->mmap_sem); + if ((current->thread.flags & SPARC_FLAG_32BIT) != 0) { + regs->tpc &= 0xffffffff; + address &= 0xffffffff; + } + + down_read(&mm->mmap_sem); vma = find_vma(mm, address); if (!vma) goto bad_area; @@ -250,16 +322,9 @@ if (((fault_code & (FAULT_CODE_DTLB | FAULT_CODE_WRITE | FAULT_CODE_WINFIXUP)) == FAULT_CODE_DTLB) && (vma->vm_flags & VM_WRITE) != 0) { - unsigned long tpc = regs->tpc; - - if (tpc & 0x3) + insn = get_fault_insn(regs, 0); + if (!insn) goto continue_fault; - - if (regs->tstate & TSTATE_PRIV) - insn = *(unsigned int *)tpc; - else - insn = get_user_insn(tpc); - if ((insn & 0xc0200000) == 0xc0200000 && (insn & 0x1780000) != 0x1680000) { /* Don't bother updating thread struct value, @@ -286,7 +351,12 @@ if (fault_code & FAULT_CODE_WRITE) { if (!(vma->vm_flags & VM_WRITE)) goto bad_area; - if ((vma->vm_flags & VM_EXEC) != 0 && + + /* Spitfire has an icache which does not snoop + * processor stores. Later processors do... + */ + if (tlb_type == spitfire && + (vma->vm_flags & VM_EXEC) != 0 && vma->vm_file != NULL) current->thread.use_blkcommit = 1; } else { @@ -308,7 +378,7 @@ goto out_of_memory; } - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); goto fault_done; /* @@ -316,7 +386,8 @@ * Fix it, but check if it's kernel or user first.. */ bad_area: - up(&mm->mmap_sem); + insn = get_fault_insn(regs, insn); + up_read(&mm->mmap_sem); handle_kernel_fault: do_kernel_fault(regs, si_code, fault_code, insn, address); @@ -328,14 +399,20 @@ * us unable to handle the page fault gracefully. */ out_of_memory: - up(&mm->mmap_sem); + insn = get_fault_insn(regs, insn); + up_read(&mm->mmap_sem); printk("VM: killing process %s\n", current->comm); if (!(regs->tstate & TSTATE_PRIV)) do_exit(SIGKILL); goto handle_kernel_fault; +intr_or_no_mm: + insn = get_fault_insn(regs, 0); + goto handle_kernel_fault; + do_sigbus: - up(&mm->mmap_sem); + insn = get_fault_insn(regs, insn); + up_read(&mm->mmap_sem); /* * Send a sigbus, regardless of whether we were in kernel Index: generic.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/mm/generic.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- generic.c 14 Jan 2001 19:45:15 -0000 1.1.1.1 +++ generic.c 10 Apr 2002 15:21:24 -0000 1.2 @@ -8,6 +8,7 @@ #include <linux/kernel.h> #include <linux/mm.h> #include <linux/swap.h> +#include <linux/pagemap.h> #include <asm/pgalloc.h> #include <asm/pgtable.h> @@ -21,11 +22,7 @@ struct page *ptpage = pte_page(page); if ((!VALID_PAGE(ptpage)) || PageReserved(ptpage)) return; - /* - * free_page() used to be able to clear swap cache - * entries. We may now have to do it manually. - */ - free_page_and_swap_cache(ptpage); + page_cache_release(ptpage); return; } swap_free(pte_to_swp_entry(page)); @@ -104,12 +101,10 @@ end = PGDIR_SIZE; offset -= address; do { - pte_t * pte = pte_alloc(pmd, address); + pte_t * pte = pte_alloc(current->mm, pmd, address); if (!pte) return -ENOMEM; - spin_lock(¤t->mm->page_table_lock); io_remap_pte_range(pte, address, end - address, address + offset, prot, space); - spin_unlock(¤t->mm->page_table_lock); address = (address + PMD_SIZE) & PMD_MASK; pmd++; } while (address < end); @@ -122,13 +117,16 @@ pgd_t * dir; unsigned long beg = from; unsigned long end = from + size; + struct mm_struct *mm = current->mm; prot = __pgprot(pg_iobits); offset -= from; - dir = pgd_offset(current->mm, from); - flush_cache_range(current->mm, beg, end); + dir = pgd_offset(mm, from); + flush_cache_range(mm, beg, end); + + spin_lock(&mm->page_table_lock); while (from < end) { - pmd_t *pmd = pmd_alloc(dir, from); + pmd_t *pmd = pmd_alloc(current->mm, dir, from); error = -ENOMEM; if (!pmd) break; @@ -138,6 +136,8 @@ from = (from + PGDIR_SIZE) & PGDIR_MASK; dir++; } + spin_unlock(&mm->page_table_lock); + flush_tlb_range(current->mm, beg, end); return error; } Index: init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/mm/init.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- init.c 25 Feb 2001 23:15:20 -0000 1.1.1.2 +++ init.c 10 Apr 2002 15:21:24 -0000 1.2 @@ -16,6 +16,9 @@ #include <linux/blk.h> #include <linux/swap.h> #include <linux/swapctl.h> +#include <linux/pagemap.h> +#include <linux/fs.h> +#include <linux/seq_file.h> #include <asm/head.h> #include <asm/system.h> @@ -27,9 +30,12 @@ #include <asm/io.h> [...1406 lines suppressed...] + unsigned long addr, initend; - addr = (unsigned long)(&__init_begin); - for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { + /* + * The init section is aligned to 8k in vmlinux.lds. Page align for >8k pagesizes. + */ + addr = PAGE_ALIGN((unsigned long)(&__init_begin)); + initend = (unsigned long)(&__init_end) & PAGE_MASK; + for (; addr < initend; addr += PAGE_SIZE) { unsigned long page; struct page *p; page = (addr + ((unsigned long) __va(phys_base)) - - ((unsigned long) &empty_zero_page)); + ((unsigned long) KERNBASE)); p = virt_to_page(page); ClearPageReserved(p); Index: modutil.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/mm/modutil.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- modutil.c 25 Feb 2001 23:15:20 -0000 1.1.1.2 +++ modutil.c 10 Apr 2002 15:21:24 -0000 1.2 @@ -10,7 +10,10 @@ #include <asm/uaccess.h> #include <asm/system.h> -#include <asm/vaddrs.h> + +#define MODULES_VADDR 0x0000000001000000ULL /* Where to map modules */ +#define MODULES_LEN 0x000000007f000000ULL +#define MODULES_END 0x0000000080000000ULL static struct vm_struct * modvmlist = NULL; @@ -59,7 +62,7 @@ *p = area; if (vmalloc_area_pages(VMALLOC_VMADDR(addr), size, GFP_KERNEL, PAGE_KERNEL)) { - vfree(addr); + module_unmap(addr); return NULL; } return addr; Index: ultra.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/mm/ultra.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ultra.S 14 Jan 2001 19:45:13 -0000 1.1.1.1 +++ ultra.S 10 Apr 2002 15:21:24 -0000 1.2 @@ -9,6 +9,23 @@ #include <asm/pgtable.h> #include <asm/page.h> #include <asm/spitfire.h> +#include <asm/mmu_context.h> + + /* Basically, all this madness has to do with the + * fact that Cheetah does not support IMMU flushes + * out of the secondary context. Someone needs to + * throw a south lake birthday party for the folks + * in Microelectronics who refused to fix this shit. + */ +#define BRANCH_IF_CHEETAH(tmp1, tmp2, label) \ + rdpr %ver, %tmp1; \ + sethi %hi(0x003e0014), %tmp2; \ + srlx %tmp1, 32, %tmp1; \ + or %tmp2, %lo(0x003e0014), %tmp2; \ + cmp %tmp1, %tmp2; \ + be,pn %icc, label; \ + nop; \ + nop; /* This file is meant to be read efficiently by the CPU, not humans. * Staraj sie tego nikomu nie pierdolnac... @@ -16,38 +33,78 @@ .text .align 32 .globl __flush_tlb_page, __flush_tlb_mm, __flush_tlb_range -__flush_tlb_page: /* %o0=(ctx & 0x3ff), %o1=page&PAGE_MASK, %o2=SECONDARY_CONTEXT */ -/*IC1*/ ldxa [%o2] ASI_DMMU, %g2 +__flush_tlb_page: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=page&PAGE_MASK, %o2=SECONDARY_CONTEXT */ +/*IC1*/ BRANCH_IF_CHEETAH(g2, g3, __cheetah_flush_tlb_page) +__spitfire_flush_tlb_page: +/*IC2*/ ldxa [%o2] ASI_DMMU, %g2 cmp %g2, %o0 - bne,pn %icc, __flush_tlb_page_slow + bne,pn %icc, __spitfire_flush_tlb_page_slow or %o1, 0x10, %g3 stxa %g0, [%g3] ASI_DMMU_DEMAP stxa %g0, [%g3] ASI_IMMU_DEMAP retl flush %g6 -__flush_tlb_mm: /* %o0=(ctx & 0x3ff), %o1=SECONDARY_CONTEXT */ -/*IC2*/ ldxa [%o1] ASI_DMMU, %g2 +__cheetah_flush_tlb_page: +/*IC3*/ rdpr %pstate, %g5 + andn %g5, PSTATE_IE, %g2 + wrpr %g2, 0x0, %pstate + wrpr %g0, 1, %tl + mov PRIMARY_CONTEXT, %o2 + ldxa [%o2] ASI_DMMU, %g2 + stxa %o0, [%o2] ASI_DMMU + stxa %g0, [%o1] ASI_DMMU_DEMAP +/*IC4*/ stxa %g0, [%o1] ASI_IMMU_DEMAP + stxa %g2, [%o2] ASI_DMMU + flush %g6 + wrpr %g0, 0, %tl + retl + wrpr %g5, 0x0, %pstate + nop + nop +__flush_tlb_mm: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=SECONDARY_CONTEXT */ +/*IC5*/ BRANCH_IF_CHEETAH(g2, g3, __cheetah_flush_tlb_mm) +__spitfire_flush_tlb_mm: +/*IC6*/ ldxa [%o1] ASI_DMMU, %g2 cmp %g2, %o0 - bne,pn %icc, __flush_tlb_mm_slow + bne,pn %icc, __spitfire_flush_tlb_mm_slow mov 0x50, %g3 stxa %g0, [%g3] ASI_DMMU_DEMAP stxa %g0, [%g3] ASI_IMMU_DEMAP retl flush %g6 -__flush_tlb_range: /* %o0=(ctx&0x3ff), %o1=start&PAGE_MASK, %o2=SECONDARY_CONTEXT, +__cheetah_flush_tlb_mm: +/*IC7*/ rdpr %pstate, %g5 + andn %g5, PSTATE_IE, %g2 + wrpr %g2, 0x0, %pstate + wrpr %g0, 1, %tl + mov PRIMARY_CONTEXT, %o2 + mov 0x40, %g3 + ldxa [%o2] ASI_DMMU, %g2 + stxa %o0, [%o2] ASI_DMMU +/*IC8*/ stxa %g0, [%g3] ASI_DMMU_DEMAP + stxa %g0, [%g3] ASI_IMMU_DEMAP + stxa %g2, [%o2] ASI_DMMU + flush %g6 + wrpr %g0, 0, %tl + retl + wrpr %g5, 0x0, %pstate + nop +__flush_tlb_range: /* %o0=(ctx&TAG_CONTEXT_BITS), %o1=start&PAGE_MASK, %o2=SECONDARY_CONTEXT, * %o3=end&PAGE_MASK, %o4=PAGE_SIZE, %o5=(end - start) */ +/*IC9*/ BRANCH_IF_CHEETAH(g2, g3, __cheetah_flush_tlb_range) +__spitfire_flush_tlb_range: #define TLB_MAGIC 207 /* Students, do you know how I calculated this? -DaveM */ -/*IC3*/ cmp %o5, %o4 +/*IC10*/cmp %o5, %o4 bleu,pt %xcc, __flush_tlb_page - srlx %o5, 13, %g5 + srlx %o5, PAGE_SHIFT, %g5 cmp %g5, TLB_MAGIC - bgeu,pn %icc, __flush_tlb_range_constant_time + bgeu,pn %icc, __spitfire_flush_tlb_range_constant_time or %o1, 0x10, %g5 ldxa [%o2] ASI_DMMU, %g2 cmp %g2, %o0 -__flush_tlb_range_page_by_page: -/*IC4*/ bne,pn %icc, __flush_tlb_range_pbp_slow +__spitfire_flush_tlb_range_page_by_page: +/*IC11*/bne,pn %icc, __spitfire_flush_tlb_range_pbp_slow sub %o5, %o4, %o5 1: stxa %g0, [%g5 + %o5] ASI_DMMU_DEMAP stxa %g0, [%g5 + %o5] ASI_IMMU_DEMAP @@ -55,10 +112,11 @@ sub %o5, %o4, %o5 retl flush %g6 -__flush_tlb_range_constant_time: /* %o0=ctx, %o1=start, %o3=end */ -/*IC5*/ rdpr %pstate, %g1 +__spitfire_flush_tlb_range_constant_time: /* %o0=ctx, %o1=start, %o3=end */ +/*IC12*/rdpr %pstate, %g1 wrpr %g1, PSTATE_IE, %pstate mov TLB_TAG_ACCESS, %g3 + /* XXX Spitfire dependency... */ mov (62 << 3), %g2 /* Spitfire Errata #32 workaround. */ @@ -67,18 +125,18 @@ flush %g6 1: ldxa [%g2] ASI_ITLB_TAG_READ, %o4 - and %o4, 0x3ff, %o5 + and %o4, TAG_CONTEXT_BITS, %o5 cmp %o5, %o0 bne,pt %icc, 2f -/*IC6*/ andn %o4, 0x3ff, %o4 +/*IC13*/ andn %o4, TAG_CONTEXT_BITS, %o4 cmp %o4, %o1 blu,pt %xcc, 2f cmp %o4, %o3 blu,pn %xcc, 4f 2: ldxa [%g2] ASI_DTLB_TAG_READ, %o4 - and %o4, 0x3ff, %o5 + and %o4, TAG_CONTEXT_BITS, %o5 cmp %o5, %o0 -/*IC7*/ andn %o4, 0x3ff, %o4 +/*IC14*/andn %o4, TAG_CONTEXT_BITS, %o4 bne,pt %icc, 3f cmp %o4, %o1 blu,pt %xcc, 3f @@ -86,7 +144,7 @@ blu,pn %xcc, 5f nop 3: brnz,pt %g2, 1b -/*IC8*/ sub %g2, (1 << 3), %g2 +/*IC15*/ sub %g2, (1 << 3), %g2 retl wrpr %g1, 0x0, %pstate 4: stxa %g0, [%g3] ASI_IMMU @@ -102,7 +160,7 @@ nop 5: stxa %g0, [%g3] ASI_DMMU -/*IC9*/ stxa %g0, [%g2] ASI_DTLB_DATA_ACCESS +/*IC16*/stxa %g0, [%g2] ASI_DTLB_DATA_ACCESS flush %g6 /* Spitfire Errata #32 workaround. */ @@ -114,46 +172,81 @@ nop .align 32 -__flush_tlb_mm_slow: -/*IC10*/rdpr %pstate, %g1 +__cheetah_flush_tlb_range: + cmp %o5, %o4 + bleu,pt %xcc, __cheetah_flush_tlb_page + nop +/*IC17*/rdpr %pstate, %g5 + andn %g5, PSTATE_IE, %g2 + wrpr %g2, 0x0, %pstate + wrpr %g0, 1, %tl + mov PRIMARY_CONTEXT, %o2 + sub %o5, %o4, %o5 + ldxa [%o2] ASI_DMMU, %g2 + stxa %o0, [%o2] ASI_DMMU + +/*IC18*/ +1: stxa %g0, [%o1 + %o5] ASI_DMMU_DEMAP + stxa %g0, [%o1 + %o5] ASI_IMMU_DEMAP + membar #Sync + brnz,pt %o5, 1b + sub %o5, %o4, %o5 + + stxa %g2, [%o2] ASI_DMMU + flush %g6 + wrpr %g0, 0, %tl + retl +/*IC19*/ wrpr %g5, 0x0, %pstate + +__spitfire_flush_tlb_mm_slow: + rdpr %pstate, %g1 wrpr %g1, PSTATE_IE, %pstate stxa %o0, [%o1] ASI_DMMU stxa %g0, [%g3] ASI_DMMU_DEMAP stxa %g0, [%g3] ASI_IMMU_DEMAP flush %g6 stxa %g2, [%o1] ASI_DMMU - flush %g6 -/*IC11*/retl +/*IC18*/flush %g6 + retl wrpr %g1, 0, %pstate - .align 32 -__flush_tlb_page_slow: -/*IC12*/rdpr %pstate, %g1 +__spitfire_flush_tlb_page_slow: + rdpr %pstate, %g1 wrpr %g1, PSTATE_IE, %pstate stxa %o0, [%o2] ASI_DMMU stxa %g0, [%g3] ASI_DMMU_DEMAP stxa %g0, [%g3] ASI_IMMU_DEMAP - flush %g6 +/*IC20*/flush %g6 stxa %g2, [%o2] ASI_DMMU flush %g6 -/*IC13*/retl + retl wrpr %g1, 0, %pstate - .align 32 -__flush_tlb_range_pbp_slow: -/*IC13*/rdpr %pstate, %g1 +__spitfire_flush_tlb_range_pbp_slow: + rdpr %pstate, %g1 wrpr %g1, PSTATE_IE, %pstate stxa %o0, [%o2] ASI_DMMU +/*IC21*/ 2: stxa %g0, [%g5 + %o5] ASI_DMMU_DEMAP stxa %g0, [%g5 + %o5] ASI_IMMU_DEMAP brnz,pt %o5, 2b sub %o5, %o4, %o5 flush %g6 -/*IC14*/stxa %g2, [%o2] ASI_DMMU + stxa %g2, [%o2] ASI_DMMU flush %g6 retl - wrpr %g1, 0x0, %pstate +/*IC22*/ wrpr %g1, 0x0, %pstate +/* + * The following code flushes one page_size worth. + */ +#if (PAGE_SHIFT == 13) +#define ITAG_MASK 0xfe +#elif (PAGE_SHIFT == 16) +#define ITAG_MASK 0x7fe +#else +#error unsupported PAGE_SIZE +#endif .align 32 .globl __flush_icache_page __flush_icache_page: /* %o0 = phys_page */ @@ -167,7 +260,7 @@ or %o0, %g1, %o0 ! VALID+phys-addr comparitor sllx %g2, 1, %g2 - andn %g2, 0xfe, %g2 ! IC_tag mask + andn %g2, ITAG_MASK, %g2 ! IC_tag mask nop nop nop @@ -210,6 +303,37 @@ .globl __flush_dcache_page __flush_dcache_page: /* %o0=kaddr, %o1=flush_icache */ sub %o0, %g4, %o0 + + rdpr %ver, %g1 + sethi %hi(0x003e0014), %g2 + srlx %g1, 32, %g1 + or %g2, %lo(0x003e0014), %g2 + cmp %g1, %g2 + bne,pt %icc, flush_dcpage_spitfire + nop + +flush_dcpage_cheetah: + sethi %hi(PAGE_SIZE), %o4 +1: subcc %o4, (1 << 5), %o4 + stxa %g0, [%o0 + %o4] ASI_DCACHE_INVALIDATE + bne,pt %icc, 1b + nop + membar #Sync + /* I-cache flush never needed on Cheetah, see callers. */ + retl + nop + +#if (PAGE_SHIFT == 13) +#define DTAG_MASK 0x3 +#elif (PAGE_SHIFT == 16) +#define DTAG_MASK 0x1f +#elif (PAGE_SHIFT == 19) +#define DTAG_MASK 0xff +#elif (PAGE_SHIFT == 22) +#define DTAG_MASK 0x3ff +#endif + +flush_dcpage_spitfire: clr %o4 srlx %o0, 11, %o0 sethi %hi(1 << 14), %o2 @@ -219,19 +343,19 @@ add %o4, (1 << 5), %o4 ! IEU0 ldxa [%o4] ASI_DCACHE_TAG, %g2 ! LSU Group o3 available add %o4, (1 << 5), %o4 ! IEU0 - andn %o3, 0x3, %o3 ! IEU1 + andn %o3, DTAG_MASK, %o3 ! IEU1 ldxa [%o4] ASI_DCACHE_TAG, %g3 ! LSU Group add %o4, (1 << 5), %o4 ! IEU0 - andn %g1, 0x3, %g1 ! IEU1 + andn %g1, DTAG_MASK, %g1 ! IEU1 cmp %o0, %o3 ! IEU1 Group be,a,pn %xcc, dflush1 ! CTI sub %o4, (4 << 5), %o4 ! IEU0 (Group) cmp %o0, %g1 ! IEU1 Group - andn %g2, 0x3, %g2 ! IEU0 + andn %g2, DTAG_MASK, %g2 ! IEU0 be,a,pn %xcc, dflush2 ! CTI sub %o4, (3 << 5), %o4 ! IEU0 (Group) cmp %o0, %g2 ! IEU1 Group - andn %g3, 0x3, %g3 ! IEU0 + andn %g3, DTAG_MASK, %g3 ! IEU0 be,a,pn %xcc, dflush3 ! CTI sub %o4, (2 << 5), %o4 ! IEU0 (Group) cmp %o0, %g3 ! IEU1 Group @@ -284,14 +408,14 @@ .globl __update_mmu_cache __update_mmu_cache: /* %o0=vma, %o1=address, %o2=pte */ ldub [%g6 + AOFF_task_thread + AOFF_thread_fault_code], %o3 - srlx %o1, 13, %o1 + srlx %o1, PAGE_SHIFT, %o1 ldx [%o0 + 0x0], %o4 /* XXX vma->vm_mm */ brz,pn %o3, 1f - sllx %o1, 13, %o0 + sllx %o1, PAGE_SHIFT, %o0 ldx [%o4 + AOFF_mm_context], %o5 andcc %o3, FAULT_CODE_DTLB, %g0 mov %o2, %o1 - and %o5, 0x3ff, %o5 + and %o5, TAG_CONTEXT_BITS, %o5 bne,pt %xcc, __prefill_dtlb or %o0, %o5, %o0 ba,a,pt %xcc, __prefill_itlb @@ -317,18 +441,18 @@ .align 32 .globl xcall_flush_tlb_page, xcall_flush_tlb_mm, xcall_flush_tlb_range xcall_flush_tlb_page: - mov SECONDARY_CONTEXT, %g2 - or %g1, 0x10, %g4 + mov PRIMARY_CONTEXT, %g2 ldxa [%g2] ASI_DMMU, %g3 stxa %g5, [%g2] ASI_DMMU - stxa %g0, [%g4] ASI_DMMU_DEMAP - stxa %g0, [%g4] ASI_IMMU_DEMAP + stxa %g0, [%g1] ASI_DMMU_DEMAP + stxa %g0, [%g1] ASI_IMMU_DEMAP stxa %g3, [%g2] ASI_DMMU retry + nop xcall_flush_tlb_mm: - mov SECONDARY_CONTEXT, %g2 - mov 0x50, %g4 + mov PRIMARY_CONTEXT, %g2 + mov 0x40, %g4 ldxa [%g2] ASI_DMMU, %g3 stxa %g5, [%g2] ASI_DMMU stxa %g0, [%g4] ASI_DMMU_DEMAP @@ -337,26 +461,27 @@ retry xcall_flush_tlb_range: - sethi %hi(8192 - 1), %g2 - or %g2, %lo(8192 - 1), %g2 + sethi %hi(PAGE_SIZE - 1), %g2 + or %g2, %lo(PAGE_SIZE - 1), %g2 andn %g1, %g2, %g1 andn %g7, %g2, %g7 sub %g7, %g1, %g3 add %g2, 1, %g2 - orcc %g1, 0x10, %g1 - srlx %g3, 13, %g4 - + srlx %g3, PAGE_SHIFT, %g4 cmp %g4, 96 + bgu,pn %icc, xcall_flush_tlb_mm - mov SECONDARY_CONTEXT, %g4 + mov PRIMARY_CONTEXT, %g4 ldxa [%g4] ASI_DMMU, %g7 sub %g3, %g2, %g3 stxa %g5, [%g4] ASI_DMMU nop nop + nop 1: stxa %g0, [%g1 + %g3] ASI_DMMU_DEMAP stxa %g0, [%g1 + %g3] ASI_IMMU_DEMAP + membar #Sync brnz,pt %g3, 1b sub %g3, %g2, %g3 stxa %g7, [%g4] ASI_DMMU @@ -378,6 +503,53 @@ b,pt %xcc, rtrap clr %l6 + .align 32 + .globl xcall_flush_dcache_page_cheetah +xcall_flush_dcache_page_cheetah: /* %g1 == physical page address */ + sethi %hi(PAGE_SIZE), %g3 +1: subcc %g3, (1 << 5), %g3 + stxa %g0, [%g1 + %g3] ASI_DCACHE_INVALIDATE + bne,pt %icc, 1b + nop + membar #Sync + retry + nop + + .globl xcall_flush_dcache_page_spitfire +xcall_flush_dcache_page_spitfire: /* %g1 == physical page address + %g7 == kernel page virtual address + %g5 == (page->mapping != NULL) */ +#if (L1DCACHE_SIZE > PAGE_SIZE) + srlx %g1, (13 - 2), %g1 ! Form tag comparitor + sethi %hi(L1DCACHE_SIZE), %g3 ! D$ size == 16K + sub %g3, (1 << 5), %g3 ! D$ linesize == 32 +1: ldxa [%g3] ASI_DCACHE_TAG, %g2 + andcc %g2, 0x3, %g0 + be,pn %xcc, 2f + andn %g2, 0x3, %g2 + cmp %g2, %g1 + + bne,pt %xcc, 2f + nop + stxa %g0, [%g3] ASI_DCACHE_TAG + membar #Sync +2: cmp %g3, 0 + bne,pt %xcc, 1b + sub %g3, (1 << 5), %g3 + + brz,pn %g5, 2f +#endif /* L1DCACHE_SIZE > PAGE_SIZE */ + sethi %hi(PAGE_SIZE), %g3 + +1: flush %g7 + subcc %g3, (1 << 5), %g3 + bne,pt %icc, 1b + add %g7, (1 << 5), %g7 + +2: retry + nop + nop + .globl xcall_capture xcall_capture: rdpr %pstate, %g2 @@ -433,7 +605,8 @@ /* These two are not performance critical... */ .globl xcall_flush_tlb_all xcall_flush_tlb_all: - + BRANCH_IF_CHEETAH(g2, g3, __cheetah_xcall_flush_tlb_all) +__spitfire_xcall_flush_tlb_all: /* Spitfire Errata #32 workaround. */ sethi %hi(errata32_hwbug), %g4 stx %g0, [%g4 + %lo(errata32_hwbug)] @@ -475,17 +648,33 @@ flush %g6 retry +__cheetah_xcall_flush_tlb_all: + mov 0x80, %g2 + stxa %g0, [%g2] ASI_DMMU_DEMAP + stxa %g0, [%g2] ASI_IMMU_DEMAP + retry + .globl xcall_flush_cache_all xcall_flush_cache_all: + BRANCH_IF_CHEETAH(g2, g3, __cheetah_xcall_flush_cache_all) +__spitfire_xcall_flush_cache_all: sethi %hi(16383), %g2 or %g2, %lo(16383), %g2 clr %g3 1: stxa %g0, [%g3] ASI_IC_TAG + membar #Sync add %g3, 32, %g3 cmp %g3, %g2 bleu,pt %xcc, 1b nop flush %g6 + retry + + /* Cheetah's caches are fully coherent in the sense that + * caches are flushed here. We need to verify this and + * really just not even send out the xcall at the top level. + */ +__cheetah_xcall_flush_cache_all: retry .globl xcall_call_function |
From: Andy P. <at...@us...> - 2002-04-10 18:36:32
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/tools In directory usw-pr-cvs1:/tmp/cvs-serv9037/cris/boot/tools Added Files: build.c Log Message: synch 2.4.15 commit 34 --- NEW FILE --- /* * linux/tools/build.c * * Copyright (C) 1991, 1992 Linus Torvalds */ /* * This file builds a disk-image from three different files: * * - bootsect: exactly 512 bytes of 8086 machine code, loads the rest * - setup: 8086 machine code, sets up system parm * - system: 80386 code for actual system * * It does some checking that all files are of the correct type, and * just writes the result to stdout, removing headers and padding to * the right amount. It also writes some system data to stderr. */ /* * Changes by tytso to allow root device specification * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996 * Cross compiling fixes by Gertjan van Wingerde, July 1996 */ #include <stdio.h> /* fprintf */ #include <string.h> #include <stdlib.h> /* contains exit */ #include <sys/types.h> /* unistd.h needs this */ #include <sys/stat.h> #include <sys/sysmacros.h> #include <unistd.h> /* contains read/write */ #include <fcntl.h> #include <linux/a.out.h> #include <errno.h> #define MINIX_HEADER 32 #define N_MAGIC_OFFSET 1024 #ifndef __BFD__ static int GCC_HEADER = sizeof(struct exec); #endif #ifdef __BIG_KERNEL__ #define SYS_SIZE 0xffff #else #define SYS_SIZE DEF_SYSSIZE #endif #define DEFAULT_MAJOR_ROOT 0 #define DEFAULT_MINOR_ROOT 0 /* max nr of sectors of setup: don't change unless you also change * bootsect etc */ #define SETUP_SECTS 4 #define STRINGIFY(x) #x typedef union { int i; long l; short s[2]; char b[4]; } conv; long intel_long(long l) { conv t; t.b[0] = l & 0xff; l >>= 8; t.b[1] = l & 0xff; l >>= 8; t.b[2] = l & 0xff; l >>= 8; t.b[3] = l & 0xff; l >>= 8; return t.l; } int intel_int(int i) { conv t; t.b[0] = i & 0xff; i >>= 8; t.b[1] = i & 0xff; i >>= 8; t.b[2] = i & 0xff; i >>= 8; t.b[3] = i & 0xff; i >>= 8; return t.i; } short intel_short(short l) { conv t; t.b[0] = l & 0xff; l >>= 8; t.b[1] = l & 0xff; l >>= 8; return t.s[0]; } void die(const char * str) { fprintf(stderr,"%s\n",str); exit(1); } void usage(void) { die("Usage: build bootsect setup system [rootdev] [> image]"); } int main(int argc, char ** argv) { int i,c,id,sz,tmp_int; unsigned long sys_size, tmp_long; char buf[1024]; #ifndef __BFD__ struct exec *ex = (struct exec *)buf; #endif char major_root, minor_root; struct stat sb; unsigned char setup_sectors; if ((argc < 4) || (argc > 5)) usage(); if (argc > 4) { if (!strcmp(argv[4], "CURRENT")) { if (stat("/", &sb)) { perror("/"); die("Couldn't stat /"); } major_root = major(sb.st_dev); minor_root = minor(sb.st_dev); } else if (strcmp(argv[4], "FLOPPY")) { if (stat(argv[4], &sb)) { perror(argv[4]); die("Couldn't stat root device."); } major_root = major(sb.st_rdev); minor_root = minor(sb.st_rdev); } else { major_root = 0; minor_root = 0; } } else { major_root = DEFAULT_MAJOR_ROOT; minor_root = DEFAULT_MINOR_ROOT; } fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root); for (i=0;i<sizeof buf; i++) buf[i]=0; if ((id=open(argv[1],O_RDONLY,0))<0) die("Unable to open 'boot'"); if (read(id,buf,MINIX_HEADER) != MINIX_HEADER) die("Unable to read header of 'boot'"); if (((long *) buf)[0]!=intel_long(0x04100301)) die("Non-Minix header of 'boot'"); if (((long *) buf)[1]!=intel_long(MINIX_HEADER)) die("Non-Minix header of 'boot'"); if (((long *) buf)[3] != 0) die("Illegal data segment in 'boot'"); if (((long *) buf)[4] != 0) die("Illegal bss in 'boot'"); if (((long *) buf)[5] != 0) die("Non-Minix header of 'boot'"); if (((long *) buf)[7] != 0) die("Illegal symbol table in 'boot'"); i=read(id,buf,sizeof buf); fprintf(stderr,"Boot sector %d bytes.\n",i); if (i != 512) die("Boot block must be exactly 512 bytes"); if ((*(unsigned short *)(buf+510)) != (unsigned short)intel_short(0xAA55)) die("Boot block hasn't got boot flag (0xAA55)"); buf[508] = (char) minor_root; buf[509] = (char) major_root; i=write(1,buf,512); if (i!=512) die("Write call failed"); close (id); if ((id=open(argv[2],O_RDONLY,0))<0) die("Unable to open 'setup'"); if (read(id,buf,MINIX_HEADER) != MINIX_HEADER) die("Unable to read header of 'setup'"); if (((long *) buf)[0]!=intel_long(0x04100301)) die("Non-Minix header of 'setup'"); if (((long *) buf)[1]!=intel_long(MINIX_HEADER)) die("Non-Minix header of 'setup'"); if (((long *) buf)[3] != 0) die("Illegal data segment in 'setup'"); if (((long *) buf)[4] != 0) die("Illegal bss in 'setup'"); if (((long *) buf)[5] != 0) die("Non-Minix header of 'setup'"); if (((long *) buf)[7] != 0) die("Illegal symbol table in 'setup'"); for (i=0 ; (c=read(id,buf,sizeof buf))>0 ; i+=c ) #ifdef __BIG_KERNEL__ { if (!i) { /* Working with memcpy because of alignment constraints on Sparc - Gertjan */ memcpy(&tmp_long, &buf[2], sizeof(long)); if (tmp_long != intel_long(0x53726448) ) die("Wrong magic in loader header of 'setup'"); memcpy(&tmp_int, &buf[6], sizeof(int)); if (tmp_int < intel_int(0x200)) die("Wrong version of loader header of 'setup'"); buf[0x11] = 1; /* LOADED_HIGH */ tmp_long = intel_long(0x100000); memcpy(&buf[0x14], &tmp_long, sizeof(long)); /* code32_start */ } #endif if (write(1,buf,c)!=c) die("Write call failed"); #ifdef __BIG_KERNEL__ } #endif if (c != 0) die("read-error on 'setup'"); close (id); setup_sectors = (unsigned char)((i + 511) / 512); /* for compatibility with LILO */ if (setup_sectors < SETUP_SECTS) setup_sectors = SETUP_SECTS; fprintf(stderr,"Setup is %d bytes.\n",i); for (c=0 ; c<sizeof(buf) ; c++) buf[c] = '\0'; while (i < setup_sectors * 512) { c = setup_sectors * 512 - i; if (c > sizeof(buf)) c = sizeof(buf); if (write(1,buf,c) != c) die("Write call failed"); i += c; } if ((id=open(argv[3],O_RDONLY,0))<0) die("Unable to open 'system'"); #ifndef __BFD__ if (read(id,buf,GCC_HEADER) != GCC_HEADER) die("Unable to read header of 'system'"); if (N_MAGIC(*ex) == ZMAGIC) { GCC_HEADER = N_MAGIC_OFFSET; lseek(id, GCC_HEADER, SEEK_SET); } else if (N_MAGIC(*ex) != QMAGIC) die("Non-GCC header of 'system'"); fprintf(stderr,"System is %d kB (%d kB code, %d kB data and %d kB bss)\n", (ex->a_text+ex->a_data+ex->a_bss)/1024, ex->a_text /1024, ex->a_data /1024, ex->a_bss /1024); sz = N_SYMOFF(*ex) - GCC_HEADER + 4; #else if (fstat (id, &sb)) { perror ("fstat"); die ("Unable to stat 'system'"); } sz = sb.st_size; fprintf (stderr, "System is %d kB\n", sz/1024); #endif sys_size = (sz + 15) / 16; if (sys_size > SYS_SIZE) die("System is too big"); while (sz > 0) { int l, n; l = sz; if (l > sizeof(buf)) l = sizeof(buf); if ((n=read(id, buf, l)) != l) { if (n == -1) perror(argv[1]); else fprintf(stderr, "Unexpected EOF\n"); die("Can't read 'system'"); } if (write(1, buf, l) != l) die("Write failed"); sz -= l; } close(id); if (lseek(1, 497, 0) == 497) { if (write(1, &setup_sectors, 1) != 1) die("Write of setup sectors failed"); } if (lseek(1,500,0) == 500) { buf[0] = (sys_size & 0xff); buf[1] = ((sys_size >> 8) & 0xff); if (write(1, buf, 2) != 2) die("Write failed"); } return(0); } |
From: Andy P. <at...@us...> - 2002-04-10 18:36:31
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris In directory usw-pr-cvs1:/tmp/cvs-serv32333/sparc64/solaris Modified Files: conv.h entry64.S fs.c ioctl.c ipc.c misc.c signal.c signal.h socket.c socksys.c socksys.h systbl.S timod.c Log Message: synch 2.4.15 commit 46 Index: conv.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/conv.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: entry64.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/entry64.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: fs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/fs.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- fs.c 25 Feb 2001 23:15:20 -0000 1.1.1.2 +++ fs.c 10 Apr 2002 15:21:25 -0000 1.2 @@ -406,21 +406,21 @@ u32 f_filler[16]; }; -static int report_statvfs(struct inode *inode, u32 buf) +static int report_statvfs(struct vfsmount *mnt, struct inode *inode, u32 buf) { struct statfs s; int error; struct sol_statvfs *ss = (struct sol_statvfs *)A(buf); - error = vfs_statfs(inode->i_sb, &s); + error = vfs_statfs(mnt->mnt_sb, &s); if (!error) { - const char *p = inode->i_sb->s_type->name; + const char *p = mnt->mnt_sb->s_type->name; int i = 0; int j = strlen (p); if (j > 15) j = 15; if (IS_RDONLY(inode)) i = 1; - if (IS_NOSUID(inode)) i |= 2; + if (mnt->mnt_flags & MNT_NOSUID) i |= 2; if (put_user (s.f_bsize, &ss->f_bsize) || __put_user (0, &ss->f_frsize) || __put_user (s.f_blocks, &ss->f_blocks) || @@ -440,21 +440,21 @@ return error; } -static int report_statvfs64(struct inode *inode, u32 buf) +static int report_statvfs64(struct vfsmount *mnt, struct inode *inode, u32 buf) { struct statfs s; int error; struct sol_statvfs64 *ss = (struct sol_statvfs64 *)A(buf); - error = vfs_statfs(inode->i_sb, &s); + error = vfs_statfs(mnt->mnt_sb, &s); if (!error) { - const char *p = inode->i_sb->s_type->name; + const char *p = mnt->mnt_sb->s_type->name; int i = 0; int j = strlen (p); if (j > 15) j = 15; if (IS_RDONLY(inode)) i = 1; - if (IS_NOSUID(inode)) i |= 2; + if (mnt->mnt_flags & MNT_NOSUID) i |= 2; if (put_user (s.f_bsize, &ss->f_bsize) || __put_user (0, &ss->f_frsize) || __put_user (s.f_blocks, &ss->f_blocks) || @@ -482,7 +482,7 @@ error = user_path_walk((const char *)A(path),&nd); if (!error) { struct inode * inode = nd.dentry->d_inode; - error = report_statvfs(inode, buf); + error = report_statvfs(nd.mnt, inode, buf); path_release(&nd); } return error; @@ -496,7 +496,7 @@ error = -EBADF; file = fget(fd); if (file) { - error = report_statvfs(file->f_dentry->d_inode, buf); + error = report_statvfs(file->f_vfsmnt, file->f_dentry->d_inode, buf); fput(file); } @@ -512,7 +512,7 @@ error = user_path_walk((const char *)A(path), &nd); if (!error) { struct inode * inode = nd.dentry->d_inode; - error = report_statvfs64(inode, buf); + error = report_statvfs64(nd.mnt, inode, buf); path_release(&nd); } unlock_kernel(); @@ -528,7 +528,7 @@ file = fget(fd); if (file) { lock_kernel(); - error = report_statvfs64(file->f_dentry->d_inode, buf); + error = report_statvfs64(file->f_vfsmnt, file->f_dentry->d_inode, buf); unlock_kernel(); fput(file); } Index: ioctl.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/ioctl.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: ipc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/ipc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: misc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/misc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- misc.c 14 Jan 2001 19:45:32 -0000 1.1.1.1 +++ misc.c 10 Apr 2002 15:21:25 -0000 1.2 @@ -92,12 +92,12 @@ ret_type = flags & _MAP_NEW; flags &= ~_MAP_NEW; - down(¤t->mm->mmap_sem); + down_write(¤t->mm->mmap_sem); flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); retval = do_mmap(file, (unsigned long) addr, (unsigned long) len, (unsigned long) prot, (unsigned long) flags, off); - up(¤t->mm->mmap_sem); + up_write(¤t->mm->mmap_sem); if(!ret_type) retval = ((retval < 0xf0000000) ? 0 : retval); @@ -708,13 +708,14 @@ extern long solaris_to_linux_signals[], linux_to_solaris_signals[]; struct exec_domain solaris_exec_domain = { - "Solaris", - (lcall7_func)NULL, - 1, 1, /* PER_SVR4 personality */ - solaris_to_linux_signals, - linux_to_solaris_signals, - THIS_MODULE, - NULL + name: "Solaris", + handler: NULL, + pers_low: 1, /* PER_SVR4 personality */ + pers_high: 1, + signal_map: solaris_to_linux_signals, + signal_invmap: linux_to_solaris_signals, + module: THIS_MODULE, + next: NULL }; extern int init_socksys(void); Index: signal.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/signal.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: signal.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/signal.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: socket.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/socket.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 Index: socksys.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/socksys.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 Index: socksys.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/socksys.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: systbl.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/systbl.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: timod.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/solaris/timod.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- timod.c 14 Jan 2001 19:45:40 -0000 1.1.1.1 +++ timod.c 10 Apr 2002 15:21:25 -0000 1.2 @@ -611,7 +611,7 @@ return 0; } default: - printk("timod_putmsg: unsuported command %u.\n", ret); + printk(KERN_INFO "timod_putmsg: unsupported command %u.\n", ret); break; } return -EINVAL; @@ -699,10 +699,7 @@ } if (ctl_maxlen >= 0 && sock->pfirst) { struct T_primsg *it = sock->pfirst; -#ifndef min -#define min(a,b) ((a)<(b)?(a):(b)) -#endif - int l = min(ctl_maxlen, it->length); + int l = min_t(int, ctl_maxlen, it->length); SCHECK_MAGIC((char*)((u64)(((char *)&it->type)+sock->offset+it->length+7)&~7),MKCTL_MAGIC); SOLD("purting ctl data"); if(copy_to_user(ctl_buf, @@ -815,7 +812,7 @@ filp->f_flags |= O_NONBLOCK; SOLD("calling recvfrom"); sys_recvfrom = (int (*)(int, void *, size_t, unsigned, struct sockaddr *, int *))SYS(recvfrom); - error = sys_recvfrom(fd, data_buf, min(0,data_maxlen), 0, (struct sockaddr*)tmpbuf, ctl_len); + error = sys_recvfrom(fd, data_buf, data_maxlen, 0, (struct sockaddr*)tmpbuf, ctl_len); filp->f_flags = oldflags; if (error < 0) return error; |
Update of /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib In directory usw-pr-cvs1:/tmp/cvs-serv32333/sparc64/lib Modified Files: Makefile PeeCeeI.c U3copy_from_user.S U3copy_in_user.S U3copy_to_user.S U3memcpy.S VIS.h VISbzero.S VIScopy.S VIScsum.S VIScsumcopy.S VIScsumcopyusr.S VISmemset.S VISsave.S atomic.S bitops.S blockops.S debuglocks.c dec_and_lock.S memcmp.S memscan.S rwlock.S strncmp.S strncpy_from_user.S Log Message: synch 2.4.15 commit 46 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: PeeCeeI.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/PeeCeeI.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: U3copy_from_user.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/U3copy_from_user.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: U3copy_in_user.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/U3copy_in_user.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- U3copy_in_user.S 14 Jan 2001 19:45:03 -0000 1.1.1.1 +++ U3copy_in_user.S 10 Apr 2002 15:21:24 -0000 1.2 @@ -231,25 +231,25 @@ .align 64 U3copy_in_user_begin: - prefetch [%o1 + 0x000], #one_read ! MS Group1 - prefetch [%o1 + 0x040], #one_read ! MS Group2 + prefetcha [%o1 + 0x000] %asi, #one_read ! MS Group1 + prefetcha [%o1 + 0x040] %asi, #one_read ! MS Group2 andn %o2, (0x40 - 1), %o4 ! A0 - prefetch [%o1 + 0x080], #one_read ! MS Group3 + prefetcha [%o1 + 0x080] %asi, #one_read ! MS Group3 cmp %o4, 0x140 ! A0 - prefetch [%o1 + 0x0c0], #one_read ! MS Group4 + prefetcha [%o1 + 0x0c0] %asi, #one_read ! MS Group4 EX(ldda [%o1 + 0x000] %asi, %f0, add %o2, %g0) ! MS Group5 (%f0 results at G8) bge,a,pt %icc, 1f ! BR - prefetch [%o1 + 0x100], #one_read ! MS Group6 + prefetcha [%o1 + 0x100] %asi, #one_read ! MS Group6 1: EX(ldda [%o1 + 0x008] %asi, %f2, add %o2, %g0) ! AX (%f2 results at G9) cmp %o4, 0x180 ! A1 bge,a,pt %icc, 1f ! BR - prefetch [%o1 + 0x140], #one_read ! MS Group7 + prefetcha [%o1 + 0x140] %asi, #one_read ! MS Group7 1: EX(ldda [%o1 + 0x010] %asi, %f4, add %o2, %g0) ! AX (%f4 results at G10) cmp %o4, 0x1c0 ! A1 bge,a,pt %icc, 1f ! BR - prefetch [%o1 + 0x180], #one_read ! MS Group8 + prefetcha [%o1 + 0x180] %asi, #one_read ! MS Group8 1: faligndata %f0, %f2, %f16 ! FGA Group9 (%f16 at G12) EX(ldda [%o1 + 0x018] %asi, %f6, add %o2, %g0) ! AX (%f6 results at G12) faligndata %f2, %f4, %f18 ! FGA Group10 (%f18 results at G13) @@ -305,7 +305,7 @@ faligndata %f8, %f10, %f24 ! FGA Group16 (%f24 results at G19) EXBLK1(ldda [%o1 + 0x040] %asi, %f0) ! AX (%f0 results at G19) - prefetch [%o1 + 0x180], #one_read ! MS + prefetcha [%o1 + 0x180] %asi, #one_read ! MS faligndata %f10, %f12, %f26 ! FGA Group17 (%f26 results at G20) subcc %o4, 0x40, %o4 ! A0 add %o1, 0x40, %o1 ! A1 Index: U3copy_to_user.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/U3copy_to_user.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: U3memcpy.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/U3memcpy.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: VIS.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/VIS.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: VISbzero.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/VISbzero.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- VISbzero.S 14 Jan 2001 19:44:39 -0000 1.1.1.1 +++ VISbzero.S 10 Apr 2002 15:21:24 -0000 1.2 @@ -83,6 +83,8 @@ .text .align 32 #ifdef __KERNEL__ + .globl __bzero_begin +__bzero_begin: .globl __bzero, __bzero_noasi __bzero_noasi: rd %asi, %g5 @@ -272,3 +274,5 @@ ba,pt %xcc, VISbzerofixup_ret0 sub %o1, %g2, %o0 #endif + .globl __bzero_end +__bzero_end: Index: VIScopy.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/VIScopy.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- VIScopy.S 14 Jan 2001 19:44:43 -0000 1.1.1.1 +++ VIScopy.S 10 Apr 2002 15:21:24 -0000 1.2 @@ -310,17 +310,6 @@ .globl __memcpy .type __memcpy,@function - .globl __memcpy_384plus - .type __memcpy_384plus,@function - - .globl __memcpy_16plus - .type __memcpy_16plus,@function - - .globl __memcpy_short - .type __memcpy_short,@function - - .globl __memcpy_entry - .type __memcpy_entry,@function memcpy_private: __memcpy: memcpy: mov ASI_P, asi_src ! IEU0 Group @@ -395,7 +384,6 @@ .align 32 #ifdef __KERNEL__ -__memcpy_384plus: andcc %o0, 7, %g2 ! IEU1 Group #endif VIS_enter: @@ -735,9 +723,6 @@ bleu,pn %xcc, __memcpy_short ! CTI cmp %o2, (64 * 6) ! IEU1 Group bgeu,pn %xcc, VIS_enter ! CTI -#ifdef __KERNEL__ -__memcpy_16plus: -#endif andcc %o0, 7, %g2 ! IEU1 Group sub %o0, %o1, %g5 ! IEU0 andcc %g5, 3, %o5 ! IEU1 Group Index: VIScsum.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/VIScsum.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: VIScsumcopy.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/VIScsumcopy.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: VIScsumcopyusr.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/VIScsumcopyusr.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: VISmemset.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/VISmemset.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: VISsave.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/VISsave.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- VISsave.S 14 Jan 2001 19:44:52 -0000 1.1.1.1 +++ VISsave.S 10 Apr 2002 15:21:24 -0000 1.2 @@ -37,14 +37,15 @@ clr %g1 ba,pt %xcc, 3f - stb %g3, [%g6 + AOFF_task_thread + AOFF_thread_gsr] + stx %g3, [%g6 + AOFF_task_thread + AOFF_thread_gsr] 2: add %g6, %g1, %g3 cmp %o5, FPRS_DU be,pn %icc, 6f sll %g1, 3, %g1 stb %o5, [%g3 + AOFF_task_thread + AOFF_thread_fpsaved] rd %gsr, %g2 - stb %g2, [%g3 + AOFF_task_thread + AOFF_thread_gsr] + add %g6, %g1, %g3 + stx %g2, [%g3 + AOFF_task_thread + AOFF_thread_gsr] add %g6, %g1, %g2 stx %fsr, [%g2 + AOFF_task_thread + AOFF_thread_xfsr] @@ -106,7 +107,8 @@ stb %g2, [%g3 + AOFF_task_thread + AOFF_thread_fpsaved] rd %gsr, %g2 - stb %g2, [%g3 + AOFF_task_thread + AOFF_thread_gsr] + add %g6, %g1, %g3 + stx %g2, [%g3 + AOFF_task_thread + AOFF_thread_gsr] add %g6, %g1, %g2 stx %fsr, [%g2 + AOFF_task_thread + AOFF_thread_xfsr] sll %g1, 5, %g1 Index: atomic.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/atomic.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: bitops.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/bitops.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bitops.S 14 Jan 2001 19:44:59 -0000 1.1.1.1 +++ bitops.S 10 Apr 2002 15:21:24 -0000 1.2 @@ -11,8 +11,8 @@ .globl __bitops_begin __bitops_begin: - .globl __test_and_set_bit -__test_and_set_bit: /* %o0=nr, %o1=addr */ + .globl ___test_and_set_bit +___test_and_set_bit: /* %o0=nr, %o1=addr */ srlx %o0, 6, %g1 mov 1, %g5 sllx %g1, 3, %g3 @@ -30,8 +30,8 @@ 2: retl nop - .globl __test_and_clear_bit -__test_and_clear_bit: /* %o0=nr, %o1=addr */ + .globl ___test_and_clear_bit +___test_and_clear_bit: /* %o0=nr, %o1=addr */ srlx %o0, 6, %g1 mov 1, %g5 sllx %g1, 3, %g3 @@ -49,8 +49,8 @@ 2: retl nop - .globl __test_and_change_bit -__test_and_change_bit: /* %o0=nr, %o1=addr */ + .globl ___test_and_change_bit +___test_and_change_bit: /* %o0=nr, %o1=addr */ srlx %o0, 6, %g1 mov 1, %g5 sllx %g1, 3, %g3 @@ -68,8 +68,8 @@ nop nop - .globl __test_and_set_le_bit -__test_and_set_le_bit: /* %o0=nr, %o1=addr */ + .globl ___test_and_set_le_bit +___test_and_set_le_bit: /* %o0=nr, %o1=addr */ srlx %o0, 5, %g1 mov 1, %g5 sllx %g1, 2, %g3 @@ -87,8 +87,8 @@ 2: retl nop - .globl __test_and_clear_le_bit -__test_and_clear_le_bit: /* %o0=nr, %o1=addr */ + .globl ___test_and_clear_le_bit +___test_and_clear_le_bit: /* %o0=nr, %o1=addr */ srlx %o0, 5, %g1 mov 1, %g5 sllx %g1, 2, %g3 Index: blockops.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/blockops.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- blockops.S 14 Jan 2001 19:44:34 -0000 1.1.1.1 +++ blockops.S 10 Apr 2002 15:21:24 -0000 1.2 @@ -23,6 +23,14 @@ #define TLBTEMP_ENT2 (62 << 3) #define TLBTEMP_ENTSZ (1 << 3) +#if (PAGE_SHIFT == 13) || (PAGE_SHIFT == 19) +#define PAGE_SIZE_REM 0x80 +#elif (PAGE_SHIFT == 16) || (PAGE_SHIFT == 22) +#define PAGE_SIZE_REM 0x100 +#else +#error Wrong PAGE_SHIFT specified +#endif + .text .align 32 @@ -35,7 +43,7 @@ add %o1, 0x40, %o1 ldda [%o1] ASI_BLK_P, %f16 add %o1, 0x40, %o1 - sethi %hi(8192), %o2 + sethi %hi(PAGE_SIZE), %o2 1: TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) ldda [%o1] ASI_BLK_P, %f32 stda %f48, [%o0] ASI_BLK_P @@ -53,13 +61,32 @@ stda %f48, [%o0] ASI_BLK_P sub %o2, 0x40, %o2 add %o1, 0x40, %o1 - cmp %o2, 0x80 + cmp %o2, PAGE_SIZE_REM bne,pt %xcc, 1b add %o0, 0x40, %o0 +#if (PAGE_SHIFT == 16) || (PAGE_SHIFT == 22) + TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) + ldda [%o1] ASI_BLK_P, %f32 + stda %f48, [%o0] ASI_BLK_P + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + add %o0, 0x40, %o0 + TOUCH(f16, f18, f20, f22, f24, f26, f28, f30) + ldda [%o1] ASI_BLK_P, %f0 + stda %f48, [%o0] ASI_BLK_P + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + add %o0, 0x40, %o0 + membar #Sync + stda %f32, [%o0] ASI_BLK_P + add %o0, 0x40, %o0 + stda %f0, [%o0] ASI_BLK_P +#else membar #Sync stda %f0, [%o0] ASI_BLK_P add %o0, 0x40, %o0 stda %f16, [%o0] ASI_BLK_P +#endif membar #Sync VISExit retl @@ -73,7 +100,7 @@ sub %o0, %g4, %g1 and %o2, %g3, %o0 sethi %hi(TLBTEMP_BASE), %o3 - sethi %uhi(_PAGE_VALID), %g3 + sethi %uhi(_PAGE_VALID | _PAGE_SZBITS), %g3 sub %o1, %g4, %g2 sllx %g3, 32, %g3 mov TLB_TAG_ACCESS, %o2 @@ -83,6 +110,8 @@ or %g2, %g3, %g2 add %o0, %o3, %o0 add %o0, %o1, %o1 +#define FIX_INSN_1 0x96102068 /* mov (13 << 3), %o3 */ +cheetah_patch_1: mov TLBTEMP_ENT1, %o3 rdpr %pstate, %g3 wrpr %g3, PSTATE_IE, %pstate @@ -96,16 +125,14 @@ /* Spitfire Errata #32 workaround */ mov 0x8, %o4 stxa %g0, [%o4] ASI_DMMU - sethi %hi(empty_zero_page), %o4 - flush %o4 + membar #Sync ldxa [%o3] ASI_DTLB_TAG_READ, %o4 /* Spitfire Errata #32 workaround */ mov 0x8, %o5 stxa %g0, [%o5] ASI_DMMU - sethi %hi(empty_zero_page), %o5 - flush %o5 + membar #Sync ldxa [%o3] ASI_DTLB_DATA_ACCESS, %o5 stxa %o0, [%o2] ASI_DMMU @@ -116,16 +143,14 @@ /* Spitfire Errata #32 workaround */ mov 0x8, %g5 stxa %g0, [%g5] ASI_DMMU - sethi %hi(empty_zero_page), %g5 - flush %g5 + membar #Sync ldxa [%o3] ASI_DTLB_TAG_READ, %g5 /* Spitfire Errata #32 workaround */ mov 0x8, %g7 stxa %g0, [%g7] ASI_DMMU - sethi %hi(empty_zero_page), %g7 - flush %g7 + membar #Sync ldxa [%o3] ASI_DTLB_DATA_ACCESS, %g7 stxa %o1, [%o2] ASI_DMMU @@ -136,11 +161,112 @@ bne,pn %xcc, copy_page_using_blkcommit nop + rdpr %ver, %g3 + sllx %g3, 16, %g3 + srlx %g3, 32 + 16, %g3 + cmp %g3, 0x14 + bne,pt %icc, spitfire_copy_user_page + nop + +cheetah_copy_user_page: + mov 121, %o2 ! A0 Group + prefetch [%o1 + 0x000], #one_read ! MS + prefetch [%o1 + 0x040], #one_read ! MS Group + prefetch [%o1 + 0x080], #one_read ! MS Group + prefetch [%o1 + 0x0c0], #one_read ! MS Group + ldd [%o1 + 0x000], %f0 ! MS Group + prefetch [%o1 + 0x100], #one_read ! MS Group + ldd [%o1 + 0x008], %f2 ! AX + prefetch [%o1 + 0x140], #one_read ! MS Group + ldd [%o1 + 0x010], %f4 ! AX + prefetch [%o1 + 0x180], #one_read ! MS Group + fmovd %f0, %f32 ! FGA Group + ldd [%o1 + 0x018], %f6 ! AX + fmovd %f2, %f34 ! FGA Group + ldd [%o1 + 0x020], %f8 ! MS + fmovd %f4, %f36 ! FGA Group + ldd [%o1 + 0x028], %f10 ! AX + membar #StoreStore ! MS + fmovd %f6, %f38 ! FGA Group + ldd [%o1 + 0x030], %f12 ! MS + fmovd %f8, %f40 ! FGA Group + ldd [%o1 + 0x038], %f14 ! AX + fmovd %f10, %f42 ! FGA Group + ldd [%o1 + 0x040], %f16 ! MS +1: ldd [%o1 + 0x048], %f2 ! AX (Group) + fmovd %f12, %f44 ! FGA + ldd [%o1 + 0x050], %f4 ! MS + fmovd %f14, %f46 ! FGA Group + stda %f32, [%o0] ASI_BLK_P ! MS + ldd [%o1 + 0x058], %f6 ! AX + fmovd %f16, %f32 ! FGA Group (8-cycle stall) + ldd [%o1 + 0x060], %f8 ! MS + fmovd %f2, %f34 ! FGA Group + ldd [%o1 + 0x068], %f10 ! AX + fmovd %f4, %f36 ! FGA Group + ldd [%o1 + 0x070], %f12 ! MS + fmovd %f6, %f38 ! FGA Group + ldd [%o1 + 0x078], %f14 ! AX + fmovd %f8, %f40 ! FGA Group + ldd [%o1 + 0x080], %f16 ! AX + prefetch [%o1 + 0x180], #one_read ! MS + fmovd %f10, %f42 ! FGA Group + subcc %o2, 1, %o2 ! A0 + add %o0, 0x40, %o0 ! A1 + bne,pt %xcc, 1b ! BR + add %o1, 0x40, %o1 ! A0 Group + + mov 5, %o2 ! A0 Group +1: ldd [%o1 + 0x048], %f2 ! AX + fmovd %f12, %f44 ! FGA + ldd [%o1 + 0x050], %f4 ! MS + fmovd %f14, %f46 ! FGA Group + stda %f32, [%o0] ASI_BLK_P ! MS + ldd [%o1 + 0x058], %f6 ! AX + fmovd %f16, %f32 ! FGA Group (8-cycle stall) + ldd [%o1 + 0x060], %f8 ! MS + fmovd %f2, %f34 ! FGA Group + ldd [%o1 + 0x068], %f10 ! AX + fmovd %f4, %f36 ! FGA Group + ldd [%o1 + 0x070], %f12 ! MS + fmovd %f6, %f38 ! FGA Group + ldd [%o1 + 0x078], %f14 ! AX + fmovd %f8, %f40 ! FGA Group + ldd [%o1 + 0x080], %f16 ! MS + fmovd %f10, %f42 ! FGA Group + subcc %o2, 1, %o2 ! A0 + add %o0, 0x40, %o0 ! A1 + bne,pt %xcc, 1b ! BR + add %o1, 0x40, %o1 ! A0 Group + + ldd [%o1 + 0x048], %f2 ! AX + fmovd %f12, %f44 ! FGA + ldd [%o1 + 0x050], %f4 ! MS + fmovd %f14, %f46 ! FGA Group + stda %f32, [%o0] ASI_BLK_P ! MS + ldd [%o1 + 0x058], %f6 ! AX + fmovd %f16, %f32 ! FGA Group (8-cycle stall) + ldd [%o1 + 0x060], %f8 ! MS + fmovd %f2, %f34 ! FGA Group + ldd [%o1 + 0x068], %f10 ! AX + fmovd %f4, %f36 ! FGA Group + ldd [%o1 + 0x070], %f12 ! MS + fmovd %f6, %f38 ! FGA Group + add %o0, 0x40, %o0 ! A0 + ldd [%o1 + 0x078], %f14 ! AX + fmovd %f8, %f40 ! FGA Group + fmovd %f10, %f42 ! FGA Group + fmovd %f12, %f44 ! FGA Group + fmovd %f14, %f46 ! FGA Group + stda %f32, [%o0] ASI_BLK_P ! MS + ba,a,pt %xcc, copy_user_page_continue + +spitfire_copy_user_page: ldda [%o1] ASI_BLK_P, %f0 add %o1, 0x40, %o1 ldda [%o1] ASI_BLK_P, %f16 add %o1, 0x40, %o1 - sethi %hi(8192), %o2 + sethi %hi(PAGE_SIZE), %o2 1: TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) ldda [%o1] ASI_BLK_P, %f32 stda %f48, [%o0] ASI_BLK_P @@ -158,13 +284,32 @@ stda %f48, [%o0] ASI_BLK_P sub %o2, 0x40, %o2 add %o1, 0x40, %o1 - cmp %o2, 0x80 + cmp %o2, PAGE_SIZE_REM bne,pt %xcc, 1b add %o0, 0x40, %o0 +#if (PAGE_SHIFT == 16) || (PAGE_SHIFT == 22) + TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) + ldda [%o1] ASI_BLK_P, %f32 + stda %f48, [%o0] ASI_BLK_P + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + add %o0, 0x40, %o0 + TOUCH(f16, f18, f20, f22, f24, f26, f28, f30) + ldda [%o1] ASI_BLK_P, %f0 + stda %f48, [%o0] ASI_BLK_P + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + add %o0, 0x40, %o0 + membar #Sync + stda %f32, [%o0] ASI_BLK_P + add %o0, 0x40, %o0 + stda %f0, [%o0] ASI_BLK_P +#else membar #Sync stda %f0, [%o0] ASI_BLK_P add %o0, 0x40, %o0 stda %f16, [%o0] ASI_BLK_P +#endif copy_user_page_continue: membar #Sync VISExit @@ -187,7 +332,7 @@ add %o1, 0x40, %o1 ldda [%o1] ASI_BLK_P, %f16 add %o1, 0x40, %o1 - sethi %hi(8192), %o2 + sethi %hi(PAGE_SIZE), %o2 1: TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) ldda [%o1] ASI_BLK_P, %f32 stda %f48, [%o0] ASI_BLK_COMMIT_P @@ -205,14 +350,34 @@ stda %f48, [%o0] ASI_BLK_COMMIT_P sub %o2, 0x40, %o2 add %o1, 0x40, %o1 - cmp %o2, 0x80 + cmp %o2, PAGE_SIZE_REM bne,pt %xcc, 1b add %o0, 0x40, %o0 +#if (PAGE_SHIFT == 16) || (PAGE_SHIFT == 22) + TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) + ldda [%o1] ASI_BLK_P, %f32 + stda %f48, [%o0] ASI_BLK_COMMIT_P + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + add %o0, 0x40, %o0 + TOUCH(f16, f18, f20, f22, f24, f26, f28, f30) + ldda [%o1] ASI_BLK_P, %f0 + stda %f48, [%o0] ASI_BLK_COMMIT_P + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + add %o0, 0x40, %o0 + membar #Sync + stda %f32, [%o0] ASI_BLK_COMMIT_P + add %o0, 0x40, %o0 + ba,pt %xcc, copy_user_page_continue + stda %f0, [%o0] ASI_BLK_COMMIT_P +#else membar #Sync stda %f0, [%o0] ASI_BLK_COMMIT_P add %o0, 0x40, %o0 ba,pt %xcc, copy_user_page_continue stda %f16, [%o0] ASI_BLK_COMMIT_P +#endif .align 32 .globl _clear_page @@ -231,12 +396,14 @@ sub %o0, %g4, %g1 and %o1, %g3, %o0 mov TLB_TAG_ACCESS, %o2 - sethi %uhi(_PAGE_VALID), %g3 + sethi %uhi(_PAGE_VALID | _PAGE_SZBITS), %g3 sethi %hi(TLBTEMP_BASE), %o3 sllx %g3, 32, %g3 or %g3, (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_L | _PAGE_W), %g3 or %g1, %g3, %g1 add %o0, %o3, %o0 +#define FIX_INSN_2 0x96102070 /* mov (14 << 3), %o3 */ +cheetah_patch_2: mov TLBTEMP_ENT2, %o3 rdpr %pstate, %g3 wrpr %g3, PSTATE_IE, %pstate @@ -244,16 +411,14 @@ /* Spitfire Errata #32 workaround */ mov 0x8, %g5 stxa %g0, [%g5] ASI_DMMU - sethi %hi(empty_zero_page), %g5 - flush %g5 + membar #Sync ldxa [%o3] ASI_DTLB_TAG_READ, %g5 /* Spitfire Errata #32 workaround */ mov 0x8, %g7 stxa %g0, [%g7] ASI_DMMU - sethi %hi(empty_zero_page), %g7 - flush %g7 + membar #Sync ldxa [%o3] ASI_DTLB_DATA_ACCESS, %g7 stxa %o0, [%o2] ASI_DMMU @@ -265,7 +430,7 @@ clear_page_common: membar #StoreLoad | #StoreStore | #LoadStore ! LSU Group fzero %f0 ! FPA Group - mov 32, %o1 ! IEU0 + mov PAGE_SIZE/256, %o1 ! IEU0 fzero %f2 ! FPA Group faddd %f0, %f2, %f4 ! FPA Group fmuld %f0, %f2, %f6 ! FPM @@ -299,3 +464,24 @@ membar #Sync jmpl %o7 + 0x8, %g0 wrpr %g3, 0x0, %pstate + + .globl cheetah_patch_pgcopyops +cheetah_patch_pgcopyops: + sethi %hi(FIX_INSN_1), %g1 + or %g1, %lo(FIX_INSN_1), %g1 + sethi %hi(cheetah_patch_1), %g2 + or %g2, %lo(cheetah_patch_1), %g2 + stw %g1, [%g2] + flush %g2 + sethi %hi(FIX_INSN_2), %g1 + or %g1, %lo(FIX_INSN_2), %g1 + sethi %hi(cheetah_patch_2), %g2 + or %g2, %lo(cheetah_patch_2), %g2 + stw %g1, [%g2] + flush %g2 + retl + nop + +#undef FIX_INSN1 +#undef FIX_INSN2 +#undef PAGE_SIZE_REM Index: debuglocks.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/debuglocks.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- debuglocks.c 14 Jan 2001 19:44:53 -0000 1.1.1.1 +++ debuglocks.c 10 Apr 2002 15:21:24 -0000 1.2 @@ -123,14 +123,14 @@ membar("#LoadLoad"); } /* Try once to increment the counter. */ - __asm__ __volatile__(" - ldx [%0], %%g5 - brlz,a,pn %%g5, 2f - mov 1, %0 - add %%g5, 1, %%g7 - casx [%0], %%g5, %%g7 - sub %%g5, %%g7, %0 -2:" : "=r" (val) + __asm__ __volatile__( +" ldx [%0], %%g5\n" +" brlz,a,pn %%g5, 2f\n" +" mov 1, %0\n" +" add %%g5, 1, %%g7\n" +" casx [%0], %%g5, %%g7\n" +" sub %%g5, %%g7, %0\n" +"2:" : "=r" (val) : "0" (&(rw->lock)) : "g5", "g7", "memory"); membar("#StoreLoad | #StoreStore"); @@ -151,13 +151,13 @@ rw->reader_pc[cpu] = 0; runlock_again: /* Spin trying to decrement the counter using casx. */ - __asm__ __volatile__(" - ldx [%0], %%g5 - sub %%g5, 1, %%g7 - casx [%0], %%g5, %%g7 - membar #StoreLoad | #StoreStore - sub %%g5, %%g7, %0 -" : "=r" (val) + __asm__ __volatile__( +" ldx [%0], %%g5\n" +" sub %%g5, 1, %%g7\n" +" casx [%0], %%g5, %%g7\n" +" membar #StoreLoad | #StoreStore\n" +" sub %%g5, %%g7, %0\n" + : "=r" (val) : "0" (&(rw->lock)) : "g5", "g7", "memory"); if (val) { @@ -187,18 +187,18 @@ } /* Try to acuire the write bit. */ - __asm__ __volatile__(" - mov 1, %%g3 - sllx %%g3, 63, %%g3 - ldx [%0], %%g5 - brlz,pn %%g5, 1f - or %%g5, %%g3, %%g7 - casx [%0], %%g5, %%g7 - membar #StoreLoad | #StoreStore - ba,pt %%xcc, 2f - sub %%g5, %%g7, %0 -1: mov 1, %0 -2:" : "=r" (val) + __asm__ __volatile__( +" mov 1, %%g3\n" +" sllx %%g3, 63, %%g3\n" +" ldx [%0], %%g5\n" +" brlz,pn %%g5, 1f\n" +" or %%g5, %%g3, %%g7\n" +" casx [%0], %%g5, %%g7\n" +" membar #StoreLoad | #StoreStore\n" +" ba,pt %%xcc, 2f\n" +" sub %%g5, %%g7, %0\n" +"1: mov 1, %0\n" +"2:" : "=r" (val) : "0" (&(rw->lock)) : "g3", "g5", "g7", "memory"); if (val) { @@ -217,15 +217,15 @@ show_write(str, rw, caller); stuck = INIT_STUCK; } - __asm__ __volatile__(" - mov 1, %%g3 - sllx %%g3, 63, %%g3 -1: ldx [%0], %%g5 - andn %%g5, %%g3, %%g7 - casx [%0], %%g5, %%g7 - cmp %%g5, %%g7 - bne,pn %%xcc, 1b - membar #StoreLoad | #StoreStore" + __asm__ __volatile__( +" mov 1, %%g3\n" +" sllx %%g3, 63, %%g3\n" +"1: ldx [%0], %%g5\n" +" andn %%g5, %%g3, %%g7\n" +" casx [%0], %%g5, %%g7\n" +" cmp %%g5, %%g7\n" +" bne,pn %%xcc, 1b\n" +" membar #StoreLoad | #StoreStore" : /* no outputs */ : "r" (&(rw->lock)) : "g3", "g5", "g7", "cc", "memory"); @@ -255,15 +255,15 @@ rw->writer_pc = 0; rw->writer_cpu = NO_PROC_ID; wlock_again: - __asm__ __volatile__(" - mov 1, %%g3 - sllx %%g3, 63, %%g3 - ldx [%0], %%g5 - andn %%g5, %%g3, %%g7 - casx [%0], %%g5, %%g7 - membar #StoreLoad | #StoreStore - sub %%g5, %%g7, %0 -" : "=r" (val) + __asm__ __volatile__( +" mov 1, %%g3\n" +" sllx %%g3, 63, %%g3\n" +" ldx [%0], %%g5\n" +" andn %%g5, %%g3, %%g7\n" +" casx [%0], %%g5, %%g7\n" +" membar #StoreLoad | #StoreStore\n" +" sub %%g5, %%g7, %0\n" + : "=r" (val) : "0" (&(rw->lock)) : "g3", "g5", "g7", "memory"); if (val) { Index: dec_and_lock.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/dec_and_lock.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: memcmp.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/memcmp.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: memscan.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/memscan.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: rwlock.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/rwlock.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: strncmp.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/strncmp.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: strncpy_from_user.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/lib/strncpy_from_user.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 |
From: Andy P. <at...@us...> - 2002-04-10 18:36:29
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/cris/drivers/examples In directory usw-pr-cvs1:/tmp/cvs-serv9037/cris/drivers/examples Added Files: kiobuftest.c Log Message: synch 2.4.15 commit 34 --- NEW FILE --- /* * Example showing how to pin down a range of virtual pages from user-space * to be able to do for example DMA directly into them. * * It is necessary because the pages the virtual pointers reference, might * not exist in memory (could be mapped to the zero-page, filemapped etc) * and DMA cannot trigger the MMU to force them in (and would have time * contraints making it impossible to wait for it anyway). * * Author: Bjorn Wesen * * $Log: kiobuftest.c,v $ * Revision 1.1 2002/04/10 14:15:58 atp * synch 2.4.15 commit 34 * * Revision 1.2 2001/02/27 13:52:50 bjornw * malloc.h -> slab.h * * Revision 1.1 2001/01/19 15:57:49 bjornw * Example of how to do direct HW -> user-mode DMA * * */ #include <linux/module.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/fs.h> #include <linux/string.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/iobuf.h> #define KIOBUFTEST_MAJOR 124 /* in the local range, experimental */ static ssize_t kiobuf_read(struct file *filp, char *buf, size_t len, loff_t *ppos) { struct kiobuf *iobuf; int res, i; /* Make a kiobuf that maps the entire length the reader has given * us */ res = alloc_kiovec(1, &iobuf); if (res) return res; if((res = map_user_kiobuf(READ, iobuf, (unsigned long)buf, len))) { printk("map_user_kiobuf failed, return %d\n", res); return res; } /* At this point, the virtual area buf[0] -> buf[len-1] will * have corresponding pages mapped in physical memory and locked * until we unmap the kiobuf. They cannot be swapped out or moved * around. */ printk("nr_pages == %d\noffset == %d\nlength == %d\n", iobuf->nr_pages, iobuf->offset, iobuf->length); for(i = 0; i < iobuf->nr_pages; i++) { printk("page_add(maplist[%d]) == 0x%x\n", i, page_address(iobuf->maplist[i])); } /* This is the place to create the necessary scatter-gather vector * for the DMA using the iobuf->maplist array and page_address * (don't forget __pa if the DMA needs the actual physical DRAM address) * and run it. */ /* Release the mapping and exit */ unmap_kiobuf(iobuf); /* The unlock_kiobuf is implicit here */ return len; } static struct file_operations kiobuf_fops = { owner: THIS_MODULE, read: kiobuf_read }; static int __init kiobuftest_init(void) { int res; /* register char device */ res = register_chrdev(KIOBUFTEST_MAJOR, "kiobuftest", &kiobuf_fops); if(res < 0) { printk(KERN_ERR "kiobuftest: couldn't get a major number.\n"); return res; } printk("Initializing kiobuf-test device\n"); } module_init(kiobuftest_init); |
From: Andy P. <at...@us...> - 2002-04-10 18:36:28
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/rescue In directory usw-pr-cvs1:/tmp/cvs-serv9037/cris/boot/rescue Added Files: Makefile head.S kimagerescue.S rescue.ld testrescue.S Log Message: synch 2.4.15 commit 34 --- NEW FILE --- # # Makefile for rescue code # ifndef TOPDIR TOPDIR = ../../../.. endif CC = gcc-cris -mlinux -I $(TOPDIR)/include CFLAGS = -O2 LD = gcc-cris -mlinux -nostdlib OBJCOPY = objcopy-cris all: rescue.bin testrescue.bin kimagerescue.bin rescue: rescue.bin # do nothing rescue.bin: head.o $(LD) -T rescue.ld -o rescue.o head.o $(OBJCOPY) -O binary --remove-section=.bss rescue.o rescue.bin cp rescue.bin $(TOPDIR) testrescue.bin: testrescue.o $(OBJCOPY) -O binary --remove-section=.bss testrescue.o tr.bin # Pad it to 784 bytes dd if=/dev/zero of=tmp2423 bs=1 count=784 cat tr.bin tmp2423 >testrescue_tmp.bin dd if=testrescue_tmp.bin of=testrescue.bin bs=1 count=784 rm tr.bin tmp2423 testrescue_tmp.bin kimagerescue.bin: kimagerescue.o $(OBJCOPY) -O binary --remove-section=.bss kimagerescue.o ktr.bin # Pad it to 784 bytes, that's what the rescue loader expects dd if=/dev/zero of=tmp2423 bs=1 count=784 cat ktr.bin tmp2423 >kimagerescue_tmp.bin dd if=kimagerescue_tmp.bin of=kimagerescue.bin bs=1 count=784 rm ktr.bin tmp2423 kimagerescue_tmp.bin head.o: head.S $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o testrescue.o: testrescue.S $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o kimagerescue.o: kimagerescue.S $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o clean: rm -f *.o *.bin fastdep: modules: modules-install: --- NEW FILE --- /* $Id: head.S,v 1.1 2002/04/10 14:15:58 atp Exp $ * * Rescue code, made to reside at the beginning of the * flash-memory. when it starts, it checks a partition * table at the first sector after the rescue sector. * the partition table was generated by the product builder * script and contains offsets, lengths, types and checksums * for each partition that this code should check. * * If any of the checksums fail, we assume the flash is so * corrupt that we cant use it to boot into the ftp flash * loader, and instead we initialize the serial port to * receive a flash-loader and new flash image. we dont include * any flash code here, but just accept a certain amount of * bytes from the serial port and jump into it. the downloaded * code is put in the cache. * * The partitiontable is designed so that it is transparent to * code execution - it has a relative branch opcode in the * beginning that jumps over it. each entry contains extra * data so we can add stuff later. * * Partition table format: * * Code transparency: * * 2 bytes [opcode 'nop'] * 2 bytes [opcode 'di'] * 4 bytes [opcode 'ba <offset>', 8-bit or 16-bit version] * 2 bytes [opcode 'nop', delay slot] * * Table validation (at +10): * * 2 bytes [magic/version word for partitiontable - 0xef, 0xbe] * 2 bytes [length of all entries plus the end marker] * 4 bytes [checksum for the partitiontable itself] * * Entries, each with the following format, last has offset -1: * * 4 bytes [offset in bytes, from start of flash] * 4 bytes [length in bytes of partition] * 4 bytes [checksum, simple longword sum] * 2 bytes [partition type] * 2 bytes [flags, only bit 0 used, ro/rw = 1/0] * 16 bytes [reserved for future use] * * End marker * * 4 bytes [-1] * * 10 bytes [0, padding] * * Bit 0 in flags signifies RW or RO. The rescue code only bothers * to check the checksum for RO partitions, since the others will * change its data without updating the checksums. A 1 in bit 0 * means RO, 0 means RW. That way, it is possible to set a partition * in RO mode initially, and later mark it as RW, since you can always * write 0's to the flash. * * During the wait for serial input, the status LED will flash so the * user knows something went wrong. * * Copyright (C) 1999,2001 Axis Communications AB */ #include <linux/config.h> #define ASSEMBLER_MACROS_ONLY #include <asm/sv_addr_ag.h> ;; The partitiontable is looked for at the first sector after the boot ;; sector. Sector size is 65536 bytes in all flashes we use. #define PTABLE_START CONFIG_ETRAX_PTABLE_SECTOR #define PTABLE_MAGIC 0xbeef ;; The normal Etrax100 on-chip boot ROM does serial boot at 0x380000f0. ;; That is not where we put our downloaded serial boot-code. The length is ;; enough for downloading code that loads the rest of itself (after ;; having setup the DRAM etc). It is the same length as the on-chip ;; ROM loads, so the same host loader can be used to load a rescued ;; product as well as one booted through the Etrax serial boot code. #define CODE_START 0x40000000 #define CODE_LENGTH 784 #ifdef CONFIG_ETRAX_RESCUE_SER0 #define SERXOFF R_SERIAL0_XOFF #define SERBAUD R_SERIAL0_BAUD #define SERRECC R_SERIAL0_REC_CTRL #define SERRDAT R_SERIAL0_REC_DATA #define SERSTAT R_SERIAL0_STATUS #endif #ifdef CONFIG_ETRAX_RESCUE_SER1 #define SERXOFF R_SERIAL1_XOFF #define SERBAUD R_SERIAL1_BAUD #define SERRECC R_SERIAL1_REC_CTRL #define SERRDAT R_SERIAL1_REC_DATA #define SERSTAT R_SERIAL1_STATUS #endif #ifdef CONFIG_ETRAX_RESCUE_SER2 #define SERXOFF R_SERIAL2_XOFF #define SERBAUD R_SERIAL2_BAUD #define SERRECC R_SERIAL2_REC_CTRL #define SERRDAT R_SERIAL2_REC_DATA #define SERSTAT R_SERIAL2_STATUS #endif #ifdef CONFIG_ETRAX_RESCUE_SER3 #define SERXOFF R_SERIAL3_XOFF #define SERBAUD R_SERIAL3_BAUD #define SERRECC R_SERIAL3_REC_CTRL #define SERRDAT R_SERIAL3_REC_DATA #define SERSTAT R_SERIAL3_STATUS #endif #define NOP_DI 0xf025050f #define RAM_INIT_MAGIC 0x56902387 .text ;; This is the entry point of the rescue code ;; 0x80000000 if loaded in flash (as it should be) ;; since etrax actually starts at address 2 when booting from flash, we ;; put a nop (2 bytes) here first so we dont accidentally skip the di nop di jump in_cache ; enter cached area instead in_cache: ;; first put a jump test to give a possibility of upgrading the rescue code ;; without erasing/reflashing the sector. we put a longword of -1 here and if ;; its not -1, we jump using the value as jump target. since we can always ;; change 1's to 0's without erasing the sector, it is possible to add new ;; code after this and altering the jumptarget in an upgrade. jtcd: move.d [jumptarget], $r0 cmp.d 0xffffffff, $r0 beq no_newjump nop jump [$r0] jumptarget: .dword 0xffffffff ; can be overwritten later to insert new code no_newjump: ;; We need to setup the bus registers before we start using the DRAM #include "../../lib/dram_init.S" ;; we now should go through the checksum-table and check the listed ;; partitions for errors. move.d PTABLE_START, $r3 move.d [$r3], $r0 cmp.d NOP_DI, $r0 ; make sure the nop/di is there... bne do_rescue nop ;; skip the code transparency block (10 bytes). addq 10, $r3 ;; check for correct magic move.w [$r3+], $r0 cmp.w PTABLE_MAGIC, $r0 bne do_rescue ; didn't recognize - trig rescue nop ;; check for correct ptable checksum movu.w [$r3+], $r2 ; ptable length move.d $r2, $r8 ; save for later, length of total ptable addq 28, $r8 ; account for the rest move.d [$r3+], $r4 ; ptable checksum move.d $r3, $r1 jsr checksum ; r1 source, r2 length, returns in r0 cmp.d $r0, $r4 bne do_rescue ; didn't match - trig rescue nop ;; ptable is ok. validate each entry. moveq -1, $r7 ploop: move.d [$r3+], $r1 ; partition offset (from ptable start) bne notfirst ; check if its the partition containing ptable nop ; yes.. move.d $r8, $r1 ; for its checksum check, skip the ptable move.d [$r3+], $r2 ; partition length sub.d $r8, $r2 ; minus the ptable length ba bosse nop notfirst: cmp.d -1, $r1 ; the end of the ptable ? beq flash_ok ; if so, the flash is validated move.d [$r3+], $r2 ; partition length bosse: move.d [$r3+], $r5 ; checksum move.d [$r3+], $r4 ; type and flags addq 16, $r3 ; skip the reserved bytes btstq 16, $r4 ; check ro flag bpl ploop ; rw partition, skip validation nop btstq 17, $r4 ; check bootable flag bpl 1f nop move.d $r1, $r7 ; remember boot partition offset 1: add.d PTABLE_START, $r1 jsr checksum ; checksum the partition cmp.d $r0, $r5 beq ploop ; checksums matched, go to next entry nop ;; otherwise fall through to the rescue code. do_rescue: ;; setup port PA and PB default initial directions and data ;; (so we can flash LEDs, and so that DTR and others are set) move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0 move.b $r0, [R_PORT_PA_DIR] move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0 move.b $r0, [R_PORT_PA_DATA] move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0 move.b $r0, [R_PORT_PB_DIR] move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0 move.b $r0, [R_PORT_PB_DATA] ;; setup the serial port at 115200 baud moveq 0, $r0 move.d $r0, [SERXOFF] move.b 0x99, $r0 move.b $r0, [SERBAUD] ; 115.2kbaud for both transmit and receive move.b 0x40, $r0 ; rec enable move.b $r0, [SERRECC] moveq 0, $r1 ; "timer" to clock out a LED red flash move.d CODE_START, $r3 ; destination counter movu.w CODE_LENGTH, $r4; length wait_ser: addq 1, $r1 #ifndef CONFIG_ETRAX_NO_LEDS #ifdef CONFIG_ETRAX_PA_LEDS move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r2 #endif #ifdef CONFIG_ETRAX_PB_LEDS move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r2 #endif move.d (1 << CONFIG_ETRAX_LED1R) | (1 << CONFIG_ETRAX_LED2R), $r0 btstq 16, $r1 bpl 1f nop or.d $r0, $r2 ; set bit ba 2f nop 1: not $r0 ; clear bit and.d $r0, $r2 2: #ifdef CONFIG_ETRAX_PA_LEDS move.b $r2, [R_PORT_PA_DATA] #endif #ifdef CONFIG_ETRAX_PB_LEDS move.b $r2, [R_PORT_PB_DATA] #endif #ifdef CONFIG_ETRAX_90000000_LEDS move.b $r2, [0x90000000] #endif #endif ;; check if we got something on the serial port move.b [SERSTAT], $r0 btstq 0, $r0 ; data_avail bpl wait_ser nop ;; got something - copy the byte and loop move.b [SERRDAT], $r0 move.b $r0, [$r3+] subq 1, $r4 ; decrease length bne wait_ser nop ;; jump into downloaded code move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is initialized jump CODE_START flash_ok: ;; check r7, which contains either -1 or the partition to boot from cmp.d -1, $r7 bne 1f nop move.d PTABLE_START, $r7; otherwise use the ptable start 1: move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is initialized jump $r7 ; boot! ;; Helper subroutines ;; Will checksum by simple addition ;; r1 - source ;; r2 - length in bytes ;; result will be in r0 checksum: moveq 0, $r0 1: addu.b [$r1+], $r0 subq 1, $r2 bne 1b nop ret nop --- NEW FILE --- /* $Id: kimagerescue.S,v 1.1 2002/04/10 14:15:58 atp Exp $ * * Rescue code to be prepended on a kimage and copied to the * rescue serial port. * This is called from the rescue code, it will copy received data to * 4004000 and after a timeout jump to it. */ #include <linux/config.h> #define ASSEMBLER_MACROS_ONLY #include <asm/sv_addr_ag.h> #define CODE_START 0x40004000 #define CODE_LENGTH 784 #define TIMEOUT_VALUE 1000 #ifdef CONFIG_ETRAX_RESCUE_SER0 #define SERXOFF R_SERIAL0_XOFF #define SERBAUD R_SERIAL0_BAUD #define SERRECC R_SERIAL0_REC_CTRL #define SERRDAT R_SERIAL0_REC_DATA #define SERSTAT R_SERIAL0_STATUS #endif #ifdef CONFIG_ETRAX_RESCUE_SER1 #define SERXOFF R_SERIAL1_XOFF #define SERBAUD R_SERIAL1_BAUD #define SERRECC R_SERIAL1_REC_CTRL #define SERRDAT R_SERIAL1_REC_DATA #define SERSTAT R_SERIAL1_STATUS #endif #ifdef CONFIG_ETRAX_RESCUE_SER2 #define SERXOFF R_SERIAL2_XOFF #define SERBAUD R_SERIAL2_BAUD #define SERRECC R_SERIAL2_REC_CTRL #define SERRDAT R_SERIAL2_REC_DATA #define SERSTAT R_SERIAL2_STATUS #endif #ifdef CONFIG_ETRAX_RESCUE_SER3 #define SERXOFF R_SERIAL3_XOFF #define SERBAUD R_SERIAL3_BAUD #define SERRECC R_SERIAL3_REC_CTRL #define SERRDAT R_SERIAL3_REC_DATA #define SERSTAT R_SERIAL3_STATUS #endif .text ;; This is the entry point of the rescue code ;; 0x80000000 if loaded in flash (as it should be) ;; since etrax actually starts at address 2 when booting from flash, we ;; put a nop (2 bytes) here first so we dont accidentally skip the di nop di #ifndef CONFIG_SVINTO_SIM ;; setup port PA and PB default initial directions and data ;; (so we can flash LEDs, and so that DTR and others are set) move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0 move.b $r0, [R_PORT_PA_DIR] move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0 move.b $r0, [R_PORT_PA_DATA] move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0 move.b $r0, [R_PORT_PB_DIR] move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0 move.b $r0, [R_PORT_PB_DATA] ;; We need to setup the bus registers before we start using the DRAM #include "../../lib/dram_init.S" #endif ;; Setup the stack to a suitably high address. ;; We assume 8 MB is the minimum DRAM in an eLinux ;; product and put the sp at the top for now. move.d 0x40800000, $sp ;; setup the serial port at 115200 baud moveq 0, $r0 move.d $r0, [SERXOFF] move.b 0x99, $r0 move.b $r0, [SERBAUD] ; 115.2kbaud for both transmit and receive move.b 0x40, $r0 ; rec enable move.b $r0, [SERRECC] moveq 0, $r1 ; "timer" to clock out a LED red flash move.d CODE_START, $r3 ; destination counter move.d CODE_LENGTH, $r4 ; length move.d TIMEOUT_VALUE, $r5 ; "timeout" until jump wait_ser: addq 1, $r1 subq 1, $r5 ; decrease timeout beq jump_start ; timed out nop #ifndef CONFIG_ETRAX_NO_LEDS #ifdef CONFIG_ETRAX_PA_LEDS move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r2 #endif #ifdef CONFIG_ETRAX_PB_LEDS move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r2 #endif move.d (1 << CONFIG_ETRAX_LED1R) | (1 << CONFIG_ETRAX_LED2R), $r0 btstq 16, $r1 bpl 1f nop or.d $r0, $r2 ; set bit ba 2f nop 1: not $r0 ; clear bit and.d $r0, $r2 2: #ifdef CONFIG_ETRAX_PA_LEDS move.b $r2, [R_PORT_PA_DATA] #endif #ifdef CONFIG_ETRAX_PB_LEDS move.b $r2, [R_PORT_PB_DATA] #endif #endif ;; check if we got something on the serial port move.b [SERSTAT], $r0 btstq 0, $r0 ; data_avail bpl wait_ser nop ;; got something - copy the byte and loop move.b [SERRDAT], $r0 move.b $r0, [$r3+] move.d TIMEOUT_VALUE, $r5 ; reset "timeout" subq 1, $r4 ; decrease length bne wait_ser nop jump_start: ;; jump into downloaded code jump CODE_START --- NEW FILE --- MEMORY { flash : ORIGIN = 0x00000000, LENGTH = 0x00100000 } SECTIONS { .text : { stext = . ; *(.text) etext = . ; } > flash .data : { *(.data) edata = . ; } > flash } --- NEW FILE --- /* $Id: testrescue.S,v 1.1 2002/04/10 14:15:58 atp Exp $ * * Simple testcode to download by the rescue block. * Just lits some LEDs to show it was downloaded correctly. * * Copyright (C) 1999 Axis Communications AB */ #define ASSEMBLER_MACROS_ONLY #include <asm/sv_addr_ag.h> .text nop nop moveq -1, $r2 move.b $r2, [R_PORT_PA_DIR] moveq 0, $r2 move.b $r2, [R_PORT_PA_DATA] endless: nop ba endless nop |
From: Andy P. <at...@us...> - 2002-04-10 18:36:27
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/mips-boards/atlas In directory usw-pr-cvs1:/tmp/cvs-serv20728/mips/mips-boards/atlas Added Files: Makefile atlas_int.c atlas_rtc.c atlas_setup.c Log Message: synch 2.4.15 commit 39 --- NEW FILE --- # # Carsten Langgaard, car...@mi... # Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. # # ######################################################################## # # This program is free software; you can distribute it and/or modify it # under the terms of the GNU General Public License (Version 2) as # published by the Free Software Foundation. # # This program is distributed in the hope it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. # # ####################################################################### # # Makefile for the MIPS Atlas specific kernel interface routines # under Linux. # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # # Note 2! The CFLAGS definitions are now in the main makefile... .S.s: $(CPP) $(CFLAGS) $< -o $*.s .S.o: $(CC) $(CFLAGS) -c $< -o $*.o all: atlas.o O_TARGET := atlas.o obj-y := atlas_int.o atlas_rtc.o atlas_setup.o include $(TOPDIR)/Rules.make --- NEW FILE --- /* * Carsten Langgaard, car...@mi... * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. * * ######################################################################## * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * ######################################################################## * * Routines for generic manipulation of the interrupts found on the MIPS * Atlas board. * */ #include <linux/config.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/interrupt.h> #include <linux/kernel_stat.h> #include <asm/irq.h> #include <asm/mips-boards/atlas.h> #include <asm/mips-boards/atlasint.h> #include <asm/gdb-stub.h> struct atlas_ictrl_regs *atlas_hw0_icregs = (struct atlas_ictrl_regs *)ATLAS_ICTRL_REGS_BASE; extern asmlinkage void mipsIRQ(void); extern void do_IRQ(int irq, struct pt_regs *regs); unsigned long spurious_count = 0; irq_desc_t irq_desc[NR_IRQS]; #if 0 #define DEBUG_INT(x...) printk(x) #else #define DEBUG_INT(x...) #endif void inline disable_irq_nosync(unsigned int irq_nr) { disable_atlas_irq(irq_nr); } void disable_atlas_irq(unsigned int irq_nr) { atlas_hw0_icregs->intrsten = (1 << irq_nr); } void enable_atlas_irq(unsigned int irq_nr) { atlas_hw0_icregs->intseten = (1 << irq_nr); } static unsigned int startup_atlas_irq(unsigned int irq) { enable_atlas_irq(irq); return 0; /* never anything pending */ } #define shutdown_atlas_irq disable_atlas_irq #define mask_and_ack_atlas_irq disable_atlas_irq static void end_atlas_irq(unsigned int irq) { if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) enable_atlas_irq(irq); } static struct hw_interrupt_type atlas_irq_type = { "Atlas", startup_atlas_irq, shutdown_atlas_irq, enable_atlas_irq, disable_atlas_irq, mask_and_ack_atlas_irq, end_atlas_irq, NULL }; int get_irq_list(char *buf) { int i, len = 0; int num = 0; struct irqaction *action; for (i = 0; i < ATLASINT_END; i++, num++) { action = irq_desc[i].action; if (!action) continue; len += sprintf(buf+len, "%2d: %8d %c %s", num, kstat.irqs[0][num], (action->flags & SA_INTERRUPT) ? '+' : ' ', action->name); for (action=action->next; action; action = action->next) { len += sprintf(buf+len, ",%s %s", (action->flags & SA_INTERRUPT) ? " +" : "", action->name); } len += sprintf(buf+len, " [hw0]\n"); } return len; } int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, void *dev_id) { struct irqaction *action; DEBUG_INT("request_irq: irq=%d, devname = %s\n", irq, devname); if (irq >= ATLASINT_END) return -EINVAL; if (!handler) return -EINVAL; action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL); if(!action) return -ENOMEM; action->handler = handler; action->flags = irqflags; action->mask = 0; action->name = devname; action->dev_id = dev_id; action->next = 0; irq_desc[irq].action = action; enable_atlas_irq(irq); return 0; } void free_irq(unsigned int irq, void *dev_id) { struct irqaction *action; if (irq >= ATLASINT_END) { printk("Trying to free IRQ%d\n",irq); return; } action = irq_desc[irq].action; irq_desc[irq].action = NULL; disable_atlas_irq(irq); kfree(action); } static inline int ls1bit32(unsigned int x) { int b = 31, s; s = 16; if (x << 16 == 0) s = 0; b -= s; x <<= s; s = 8; if (x << 8 == 0) s = 0; b -= s; x <<= s; s = 4; if (x << 4 == 0) s = 0; b -= s; x <<= s; s = 2; if (x << 2 == 0) s = 0; b -= s; x <<= s; s = 1; if (x << 1 == 0) s = 0; b -= s; return b; } void atlas_hw0_irqdispatch(struct pt_regs *regs) { struct irqaction *action; unsigned long int_status; int irq, cpu = smp_processor_id(); int_status = atlas_hw0_icregs->intstatus; /* if int_status == 0, then the interrupt has already been cleared */ if (int_status == 0) return; irq = ls1bit32(int_status); action = irq_desc[irq].action; DEBUG_INT("atlas_hw0_irqdispatch: irq=%d\n", irq); /* if action == NULL, then we don't have a handler for the irq */ if ( action == NULL ) { printk("No handler for hw0 irq: %i\n", irq); spurious_count++; return; } irq_enter(cpu, irq); kstat.irqs[0][irq]++; action->handler(irq, action->dev_id, regs); irq_exit(cpu, irq); return; } unsigned long probe_irq_on (void) { return 0; } int probe_irq_off (unsigned long irqs) { return 0; } #ifdef CONFIG_REMOTE_DEBUG extern void breakpoint(void); extern int remote_debug; #endif void __init init_IRQ(void) { int i; /* * Mask out all interrupt by writing "1" to all bit position in * the interrupt reset reg. */ atlas_hw0_icregs->intrsten = 0xffffffff; /* Now safe to set the exception vector. */ set_except_vector(0, mipsIRQ); for (i = 0; i <= ATLASINT_END; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = 0; irq_desc[i].depth = 1; irq_desc[i].handler = &atlas_irq_type; } #ifdef CONFIG_REMOTE_DEBUG if (remote_debug) { set_debug_traps(); breakpoint(); } #endif } --- NEW FILE --- /* * Carsten Langgaard, car...@mi... * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. * * ######################################################################## * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * ######################################################################## * * RTC routines for Atlas style attached Dallas chip. * */ #include <linux/mc146818rtc.h> #include <asm/mips-boards/atlas.h> static unsigned char atlas_rtc_read_data(unsigned long addr) { volatile unsigned int *rtc_adr_reg = (void *)ATLAS_RTC_ADR_REG; volatile unsigned int *rtc_dat_reg = (void *)ATLAS_RTC_DAT_REG; *rtc_adr_reg = addr; return *rtc_dat_reg; } static void atlas_rtc_write_data(unsigned char data, unsigned long addr) { volatile unsigned int *rtc_adr_reg = (void *)ATLAS_RTC_ADR_REG; volatile unsigned int *rtc_dat_reg = (void *)ATLAS_RTC_DAT_REG; *rtc_adr_reg = addr; *rtc_dat_reg = data; } static int atlas_rtc_bcd_mode(void) { return 0; } struct rtc_ops atlas_rtc_ops = { &atlas_rtc_read_data, &atlas_rtc_write_data, &atlas_rtc_bcd_mode }; --- NEW FILE --- /* * Carsten Langgaard, car...@mi... * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * Atlas specific setup. */ #include <linux/config.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/mc146818rtc.h> #include <linux/ioport.h> #include <asm/cpu.h> #include <asm/bootinfo.h> #include <asm/irq.h> #include <asm/mips-boards/generic.h> #include <asm/mips-boards/prom.h> #include <asm/gt64120.h> #include <asm/mips-boards/atlasint.h> #if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_PROM_CONSOLE) extern void console_setup(char *, int *); char serial_console[20]; #endif #ifdef CONFIG_REMOTE_DEBUG extern void rs_kgdb_hook(int); extern void saa9730_kgdb_hook(void); extern void breakpoint(void); int remote_debug = 0; #endif extern struct rtc_ops atlas_rtc_ops; extern void mips_reboot_setup(void); void __init atlas_setup(void) { #ifdef CONFIG_REMOTE_DEBUG int rs_putDebugChar(char); char rs_getDebugChar(void); int saa9730_putDebugChar(char); char saa9730_getDebugChar(void); extern int (*generic_putDebugChar)(char); extern char (*generic_getDebugChar)(void); #endif char *argptr; ioport_resource.end = 0x7fffffff; #ifdef CONFIG_SERIAL_CONSOLE argptr = prom_getcmdline(); if ((argptr = strstr(argptr, "console=ttyS0")) == NULL) { int i = 0; char *s = prom_getenv("modetty0"); while(s[i] >= '0' && s[i] <= '9') i++; strcpy(serial_console, "ttyS0,"); strncpy(serial_console + 6, s, i); prom_printf("Config serial console: %s\n", serial_console); console_setup(serial_console, NULL); } #endif #ifdef CONFIG_REMOTE_DEBUG argptr = prom_getcmdline(); if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) { int line; argptr += strlen("kgdb=ttyS"); if (*argptr != '0' && *argptr != '1') printk("KGDB: Uknown serial line /dev/ttyS%c, " "falling back to /dev/ttyS1\n", *argptr); line = *argptr == '0' ? 0 : 1; printk("KGDB: Using serial line /dev/ttyS%d for session\n", line ? 1 : 0); if(line == 0) { rs_kgdb_hook(line); generic_putDebugChar = rs_putDebugChar; generic_getDebugChar = rs_getDebugChar; } else { saa9730_kgdb_hook(); generic_putDebugChar = saa9730_putDebugChar; generic_getDebugChar = saa9730_getDebugChar; } prom_printf("KGDB: Using serial line /dev/ttyS%d for session, " "please connect your debugger\n", line ? 1 : 0); remote_debug = 1; /* Breakpoints and stuff are in atlas_irq_setup() */ } #endif argptr = prom_getcmdline(); if ((argptr = strstr(argptr, "nofpu")) != NULL) mips_cpu.options &= ~MIPS_CPU_FPU; rtc_ops = &atlas_rtc_ops; mips_reboot_setup(); } |
From: Andy P. <at...@us...> - 2002-04-10 18:36:19
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/ite-boards/ivr In directory usw-pr-cvs1:/tmp/cvs-serv20728/mips/ite-boards/ivr Added Files: Makefile README init.c pci_fixup.c Log Message: synch 2.4.15 commit 39 --- NEW FILE --- # # Copyright 2000 MontaVista Software Inc. # Author: MontaVista Software, Inc. # pp...@mv... or so...@mv... # # Makefile for the Globespan IVR board, # board-specific files. # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # .S.s: $(CPP) $(CFLAGS) $< -o $*.s .S.o: $(CC) $(CFLAGS) -c $< -o $*.o all: ivr.o O_TARGET := ivr.o obj-y := init.o obj-CONFIG_PCI += pci_fixup.o obj-CONFIG_BLK_DEV_INITRD += le_ramdisk.o include $(TOPDIR)/Rules.make --- NEW FILE --- This is not really a board made by ITE Semi, but it's very similar to the ITE QED-4N-S01B board. The IVR board is made by Globespan and it's a reference board for the PVR chip. --- NEW FILE --- /* * * BRIEF MODULE DESCRIPTION * IVR board setup. * * Copyright 2000 MontaVista Software Inc. * Author: MontaVista Software, Inc. * pp...@mv... or so...@mv... * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/init.h> #include <linux/mm.h> #include <linux/sched.h> #include <linux/bootmem.h> #include <asm/addrspace.h> #include <asm/bootinfo.h> #include <linux/config.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/sched.h> #include <asm/it8172/it8172.h> #include <asm/it8172/it8172_dbg.h> int prom_argc; char **prom_argv, **prom_envp; extern char _end; extern void __init prom_init_cmdline(void); extern unsigned long __init prom_get_memsize(void); extern void __init it8172_init_ram_resource(unsigned long memsize); #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) int __init prom_init(int argc, char **argv, char **envp, int *prom_vec) { unsigned long mem_size; unsigned long pcicr; prom_argc = argc; prom_argv = argv; prom_envp = envp; puts("IVR board running..."); mips_machgroup = MACH_GROUP_GLOBESPAN; mips_machtype = MACH_IVR; /* Globespan's iTVC15 reference board */ prom_init_cmdline(); /* pmon does not set memsize */ mem_size = prom_get_memsize(); mem_size = mem_size << 20; /* * make the entire physical memory visible to pci bus masters */ IT_READ(IT_MC_PCICR, pcicr); pcicr &= ~0x1f; pcicr |= (mem_size - 1) >> 22; IT_WRITE(IT_MC_PCICR, pcicr); it8172_init_ram_resource(mem_size); add_memory_region(0, mem_size, BOOT_MEM_RAM); return 0; } --- NEW FILE --- /* * * BRIEF MODULE DESCRIPTION * Globespan IVR board-specific pci fixups. * * Copyright 2000 MontaVista Software Inc. * Author: MontaVista Software, Inc. * pp...@mv... or so...@mv... * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/config.h> #ifdef CONFIG_PCI #include <linux/types.h> #include <linux/pci.h> #include <linux/kernel.h> #include <linux/init.h> #include <asm/it8172/it8172.h> #include <asm/it8172/it8172_pci.h> #include <asm/it8172/it8172_int.h> void __init board_int_line_fixup(struct pci_dev *dev) { unsigned int slot, func; unsigned char pin; const int internal_func_irqs[7] = { IT8172_AC97_IRQ, IT8172_DMA_IRQ, IT8172_CDMA_IRQ, IT8172_USB_IRQ, IT8172_BRIDGE_MASTER_IRQ, IT8172_IDE_IRQ, IT8172_MC68K_IRQ }; #ifdef DEBUG printk("board_int_line_fixup bus %d\n", dev->bus->number); #endif if (dev->bus->number != 0) return; pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); #ifdef DEBUG pci_read_config_dword(dev, PCI_SUBSYSTEM_VENDOR_ID, &vendor); #endif slot = PCI_SLOT(dev->devfn); func = PCI_FUNC(dev->devfn); switch (slot) { case 0x01: /* * Internal device 1 is actually 7 different internal * devices on the IT8172G (a multi-function device). */ if (func < 7) dev->irq = internal_func_irqs[func]; break; case 0x11: switch (pin) { case 0: /* pin A, hardware bug */ case 1: /* pin A */ dev->irq = IT8172_PCI_INTC_IRQ; break; case 2: /* pin B */ dev->irq = IT8172_PCI_INTD_IRQ; break; case 3: /* pin C */ dev->irq = IT8172_PCI_INTA_IRQ; break; case 4: /* pin D */ dev->irq = IT8172_PCI_INTB_IRQ; break; default: dev->irq = 0xff; break; } break; case 0x13: switch (pin) { case 0: /* pin A, hardware bug */ case 1: /* pin A */ dev->irq = IT8172_PCI_INTA_IRQ; break; case 2: /* pin B */ dev->irq = IT8172_PCI_INTB_IRQ; break; case 3: /* pin C */ dev->irq = IT8172_PCI_INTC_IRQ; break; case 4: /* pin D */ dev->irq = IT8172_PCI_INTD_IRQ; break; default: dev->irq = 0xff; break; } break; default: return; } #ifdef DEBUG printk("irq fixup: slot %d, vendor %x, int line %d, int number %d\n", slot, vendor, pin, dev->irq); #endif pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); } struct pci_fixup pcibios_fixups[] = { { PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, board_int_line_fixup }, { 0 } }; #endif |
From: Andy P. <at...@us...> - 2002-04-10 18:36:18
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/ifpsp060/src In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/ifpsp060/src Modified Files: fpsp.S ilsp.S isp.S pfpsp.S Log Message: synch 2.4.15 commit 37 Index: fpsp.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/ifpsp060/src/fpsp.S,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- fpsp.S 25 Feb 2001 23:15:19 -0000 1.1.1.2 +++ fpsp.S 10 Apr 2002 14:34:34 -0000 1.2 @@ -19594,7 +19594,7 @@ # in the data register file. If it's actually out in memory, use one of # # the mem_read() routines to fetch it. If the mem_read() access returns # # a failing value, exit through the special facc_in() routine which # -# will create an acess error exception frame from the current exception # +# will create an access error exception frame from the current exception # # frame. # # Immediate data and regular data accesses are separated because # # if an immediate data access fails, the resulting fault status # @@ -23523,7 +23523,7 @@ # in INEX2. # # # # A10. Or in INEX. # -# If INEX is set, round error occured. This is # +# If INEX is set, round error occurred. This is # # compensated for by 'or-ing' in the INEX2 flag to # # the lsb of Y. # # # @@ -23989,7 +23989,7 @@ fmul.x %fp1,%fp0 # calculate X * SCALE -> Y to fp0 # A10. Or in INEX. -# If INEX is set, round error occured. This is compensated +# If INEX is set, round error occurred. This is compensated # for by 'or-ing' in the INEX2 flag to the lsb of Y. # # Register usage: @@ -24608,7 +24608,7 @@ # made out of the current exception stack frame. # # So, we first call restore() which makes sure that any updated # # -(an)+ register gets returned to its pre-exception value and then # -# we change the stack to an acess error stack frame. # +# we change the stack to an access error stack frame. # # # ######################################################################### Index: ilsp.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/ifpsp060/src/ilsp.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ilsp.S 14 Jan 2001 19:38:09 -0000 1.1.1.1 +++ ilsp.S 10 Apr 2002 14:34:34 -0000 1.2 @@ -514,7 +514,7 @@ # fmovm.l &0x0,-(%sp) # save no fpregs # PROLOGUE END ########################################################## - mov.w %cc,MUL64_CC(%a6) # save incomming ccodes + mov.w %cc,MUL64_CC(%a6) # save incoming ccodes mov.l 0x8(%a6),%d0 # store multiplier in d0 beq.w mulu64_zero # handle zero separately @@ -625,7 +625,7 @@ # fmovm.l &0x0,-(%sp) # save no fpregs # PROLOGUE END ########################################################## - mov.w %cc,MUL64_CC(%a6) # save incomming ccodes + mov.w %cc,MUL64_CC(%a6) # save incoming ccodes mov.l 0x8(%a6),%d0 # store multiplier in d0 beq.b mulu64_zero # handle zero separately Index: isp.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/ifpsp060/src/isp.S,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- isp.S 25 Feb 2001 23:15:19 -0000 1.1.1.2 +++ isp.S 10 Apr 2002 14:34:34 -0000 1.2 @@ -3835,7 +3835,7 @@ # assert LOCKE* for the final write operation. # # (13)Exit. # # # -# The algorithm is actually implemented slightly diferently # +# The algorithm is actually implemented slightly differently # # depending on the size of the operation and the misalignment of the # # operand. A misaligned operand must be written in aligned chunks or # # else the BUSCR register control gets confused. # Index: pfpsp.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/ifpsp060/src/pfpsp.S,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- pfpsp.S 25 Feb 2001 23:15:19 -0000 1.1.1.2 +++ pfpsp.S 10 Apr 2002 14:34:34 -0000 1.2 @@ -13483,7 +13483,7 @@ # in INEX2. # # # # A10. Or in INEX. # -# If INEX is set, round error occured. This is # +# If INEX is set, round error occurred. This is # # compensated for by 'or-ing' in the INEX2 flag to # # the lsb of Y. # # # @@ -13949,7 +13949,7 @@ fmul.x %fp1,%fp0 # calculate X * SCALE -> Y to fp0 # A10. Or in INEX. -# If INEX is set, round error occured. This is compensated +# If INEX is set, round error occurred. This is compensated # for by 'or-ing' in the INEX2 flag to the lsb of Y. # # Register usage: @@ -14568,7 +14568,7 @@ # made out of the current exception stack frame. # # So, we first call restore() which makes sure that any updated # # -(an)+ register gets returned to its pre-exception value and then # -# we change the stack to an acess error stack frame. # +# we change the stack to an access error stack frame. # # # ######################################################################### |
From: Andy P. <at...@us...> - 2002-04-10 18:36:18
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/lib In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/lib Modified Files: semaphore.S Log Message: synch 2.4.15 commit 37 Index: semaphore.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/lib/semaphore.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- semaphore.S 14 Jan 2001 19:40:18 -0000 1.1.1.1 +++ semaphore.S 10 Apr 2002 14:34:35 -0000 1.2 @@ -51,49 +51,3 @@ moveml (%sp)+,%a0/%d0/%d1 rts -ENTRY(__down_read_failed) - moveml %a0/%d0/%d1,-(%sp) - jcc 3f -1: movel %a1,-(%sp) - jbsr SYMBOL_NAME(down_read_failed_biased) - movel (%sp)+,%a1 -2: moveml (%sp)+,%a0/%d0/%d1 - rts - -3: movel %a1,-(%sp) - jbsr SYMBOL_NAME(down_read_failed) - movel (%sp)+,%a1 - subql #1,%a1@ - jpl 2b - jcc 3b - jra 1b - -ENTRY(__down_write_failed) - moveml %a0/%d0/%d1,-(%sp) - jcc 3f -1: movel %a1,-(%sp) - jbsr SYMBOL_NAME(down_write_failed_biased) - movel (%sp)+,%a1 -2: moveml (%sp)+,%a0/%d0/%d1 - rts - -3: movel %a1,-(%sp) - jbsr SYMBOL_NAME(down_write_failed) - movel (%sp)+,%a1 - subl #RW_LOCK_BIAS,%a1@ - jpl 2b - jcc 3b - jra 1b - -ENTRY(__rwsem_wake) - moveml %a0/%d0/%d1,-(%sp) - jeq 1f - movel %a1,-(%sp) - jbsr SYMBOL_NAME(rwsem_wake_readers) - jra 2f -1: movel %a1,-(%sp) - jbsr rwsem_wake_writer -2: movel (%sp)+,%a1 - moveml (%sp)+,%a0/%d0/%d1 - rts - |
From: Andy P. <at...@us...> - 2002-04-10 18:36:18
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ia64/sn In directory usw-pr-cvs1:/tmp/cvs-serv12040/ia64/sn Modified Files: Makefile Log Message: synch 2.4.15 commit 36 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/sn/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:50:56 -0000 1.1.1.1 +++ Makefile 10 Apr 2002 14:27:22 -0000 1.2 @@ -8,12 +8,11 @@ EXTRA_CFLAGS := -DSN -DLANGUAGE_C=1 -D_LANGUAGE_C=1 -I. -DBRINGUP \ -DDIRECT_L1_CONSOLE -DNUMA_BASE -DSIMULATED_KLGRAPH \ -DNUMA_MIGR_CONTROL -DLITTLE_ENDIAN -DREAL_HARDWARE \ - -DNEW_INTERRUPTS -DCONFIG_IA64_SGI_IO + -DNEW_INTERRUPTS all: sn.a O_TARGET = sn.a -O_HEADERS = -O_OBJS = sn1/sn1.a +obj-y = sn1/sn1.a clean:: |
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/gt64120/momenco_ocelot In directory usw-pr-cvs1:/tmp/cvs-serv20728/mips/gt64120/momenco_ocelot Added Files: Makefile dbg_io.c int-handler.S irq.c ocelot_pld.h pci.c prom.c reset.c setup.c Log Message: synch 2.4.15 commit 39 --- NEW FILE --- # # Makefile for Momentum's Ocelot board. # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # .S.s: $(CPP) $(CFLAGS) $< -o $*.s .S.o: $(CC) $(CFLAGS) -c $< -o $*.o O_TARGET:= momenco_ocelot.o obj-y += int-handler.o irq.o pci.o prom.o reset.o setup.o obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o include $(TOPDIR)/Rules.make --- NEW FILE --- #include <linux/config.h> #if defined(CONFIG_REMOTE_DEBUG) /* --- CONFIG --- */ typedef unsigned char uint8; typedef unsigned int uint32; /* --- END OF CONFIG --- */ #define UART16550_BAUD_2400 2400 #define UART16550_BAUD_4800 4800 #define UART16550_BAUD_9600 9600 #define UART16550_BAUD_19200 19200 #define UART16550_BAUD_38400 38400 #define UART16550_BAUD_57600 57600 #define UART16550_BAUD_115200 115200 #define UART16550_PARITY_NONE 0 #define UART16550_PARITY_ODD 0x08 #define UART16550_PARITY_EVEN 0x18 #define UART16550_PARITY_MARK 0x28 #define UART16550_PARITY_SPACE 0x38 #define UART16550_DATA_5BIT 0x0 #define UART16550_DATA_6BIT 0x1 #define UART16550_DATA_7BIT 0x2 #define UART16550_DATA_8BIT 0x3 #define UART16550_STOP_1BIT 0x0 #define UART16550_STOP_2BIT 0x4 /* ----------------------------------------------------- */ /* === CONFIG === */ /* [jsun] we use the second serial port for kdb */ #define BASE 0xbd000020 #define MAX_BAUD 115200 /* === END OF CONFIG === */ #define REG_OFFSET 4 /* register offset */ #define OFS_RCV_BUFFER 0 #define OFS_TRANS_HOLD 0 #define OFS_SEND_BUFFER 0 #define OFS_INTR_ENABLE (1*REG_OFFSET) #define OFS_INTR_ID (2*REG_OFFSET) #define OFS_DATA_FORMAT (3*REG_OFFSET) #define OFS_LINE_CONTROL (3*REG_OFFSET) #define OFS_MODEM_CONTROL (4*REG_OFFSET) #define OFS_RS232_OUTPUT (4*REG_OFFSET) #define OFS_LINE_STATUS (5*REG_OFFSET) #define OFS_MODEM_STATUS (6*REG_OFFSET) #define OFS_RS232_INPUT (6*REG_OFFSET) #define OFS_SCRATCH_PAD (7*REG_OFFSET) #define OFS_DIVISOR_LSB (0*REG_OFFSET) #define OFS_DIVISOR_MSB (1*REG_OFFSET) /* memory-mapped read/write of the port */ #define UART16550_READ(y) (*((volatile uint8*)(BASE + y))) #define UART16550_WRITE(y, z) ((*((volatile uint8*)(BASE + y))) = z) void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop) { /* disable interrupts */ UART16550_WRITE(OFS_INTR_ENABLE, 0); /* set up buad rate */ { uint32 divisor; /* set DIAB bit */ UART16550_WRITE(OFS_LINE_CONTROL, 0x80); /* set divisor */ divisor = MAX_BAUD / baud; UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff); UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00) >> 8); /* clear DIAB bit */ UART16550_WRITE(OFS_LINE_CONTROL, 0x0); } /* set data format */ UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop); } static int remoteDebugInitialized = 0; uint8 getDebugChar(void) { if (!remoteDebugInitialized) { remoteDebugInitialized = 1; debugInit(UART16550_BAUD_38400, UART16550_DATA_8BIT, UART16550_PARITY_NONE, UART16550_STOP_1BIT); } while ((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0); return UART16550_READ(OFS_RCV_BUFFER); } int putDebugChar(uint8 byte) { if (!remoteDebugInitialized) { remoteDebugInitialized = 1; debugInit(UART16550_BAUD_9600, UART16550_DATA_8BIT, UART16550_PARITY_NONE, UART16550_STOP_1BIT); } while ((UART16550_READ(OFS_LINE_STATUS) & 0x20) == 0); UART16550_WRITE(OFS_SEND_BUFFER, byte); return 1; } #endif --- NEW FILE --- /* * Copyright 2001 MontaVista Software Inc. * Author: js...@mv... or js...@ju... * * First-level interrupt dispatcher for ocelot board. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include <linux/config.h> #include <asm/asm.h> #include <asm/mipsregs.h> #include <asm/addrspace.h> #include <asm/regdef.h> #include <asm/stackframe.h> /* * first level interrupt dispatcher for ocelot board - * We check for the timer first, then check PCI ints A and D. * Then check for serial IRQ and fall through. */ .align 5 NESTED(ocelot_handle_int, PT_SIZE, sp) SAVE_ALL CLI .set at mfc0 t0, CP0_CAUSE mfc0 t2, CP0_STATUS and t0, t2 andi t1, t0, STATUSF_IP2 /* int0 hardware line */ bnez t1, ll_pri_enet_irq andi t1, t0, STATUSF_IP3 /* int1 hardware line */ bnez t1, ll_sec_enet_irq andi t1, t0, STATUSF_IP4 /* int2 hardware line */ bnez t1, ll_uart1_irq andi t1, t0, STATUSF_IP5 /* int3 hardware line */ bnez t1, ll_cpci_irq andi t1, t0, STATUSF_IP6 /* int4 hardware line */ bnez t1, ll_galileo_irq andi t1, t0, STATUSF_IP7 /* cpu timer */ bnez t1, ll_cputimer_irq /* now look at the extended interrupts */ mfc0 t0, CP0_CAUSE cfc0 t1, CP0_S1_INTCONTROL /* shift the mask 8 bits left to line up the bits */ sll t2, t1, 8 and t0, t2 srl t0, t0, 16 andi t1, t0, STATUSF_IP8 /* int6 hardware line */ bnez t1, ll_pmc1_irq andi t1, t0, STATUSF_IP9 /* int7 hardware line */ bnez t1, ll_pmc2_irq andi t1, t0, STATUSF_IP10 /* int8 hardware line */ bnez t1, ll_cpci_abcd_irq andi t1, t0, STATUSF_IP11 /* int9 hardware line */ bnez t1, ll_uart2_irq .set reorder /* wrong alarm or masked ... */ j spurious_interrupt nop END(ocelot_handle_int) .align 5 ll_pri_enet_irq: li a0, 2 move a1, sp jal do_IRQ j ret_from_irq ll_sec_enet_irq: li a0, 3 move a1, sp jal do_IRQ j ret_from_irq ll_uart1_irq: li a0, 4 move a1, sp jal do_IRQ j ret_from_irq ll_cpci_irq: li a0, 5 move a1, sp jal do_IRQ j ret_from_irq ll_galileo_irq: li a0, 6 move a1, sp jal do_IRQ j ret_from_irq ll_cputimer_irq: li a0, 7 move a1, sp jal do_IRQ j ret_from_irq ll_pmc1_irq: li a0, 8 move a1, sp jal do_IRQ j ret_from_irq ll_pmc2_irq: li a0, 9 move a1, sp jal do_IRQ j ret_from_irq ll_cpci_abcd_irq: li a0, 10 move a1, sp jal do_IRQ j ret_from_irq ll_uart2_irq: li a0, 11 move a1, sp jal do_IRQ j ret_from_irq --- NEW FILE --- /* * Copyright (C) 2000 RidgeRun, Inc. * Author: RidgeRun, Inc. * gl...@ri..., sk...@ri..., st...@ri... * * Copyright 2001 MontaVista Software Inc. * Author: Jun Sun, js...@mv... or js...@ju... * Copyright (C) 2000, 2001 Ralf Baechle (ra...@gn...) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include <linux/errno.h> #include <linux/init.h> #include <linux/kernel_stat.h> #include <linux/module.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/types.h> #include <linux/interrupt.h> #include <linux/ioport.h> #include <linux/timex.h> #include <linux/slab.h> #include <linux/random.h> #include <linux/irq.h> #include <asm/bitops.h> #include <asm/bootinfo.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/mipsregs.h> #include <asm/system.h> static spinlock_t rm7000_irq_lock = SPIN_LOCK_UNLOCKED; /* Function for careful CP0 interrupt mask access */ static inline void modify_cp0_intmask(unsigned clr_mask_in, unsigned set_mask_in) { unsigned long status; unsigned clr_mask; unsigned set_mask; /* do the low 8 bits first */ clr_mask = 0xff & clr_mask_in; set_mask = 0xff & set_mask_in; status = read_32bit_cp0_register(CP0_STATUS); status &= ~((clr_mask & 0xFF) << 8); status |= (set_mask & 0xFF) << 8; write_32bit_cp0_register(CP0_STATUS, status); /* do the high 8 bits */ clr_mask = 0xff & (clr_mask_in >> 8); set_mask = 0xff & (set_mask_in >> 8); status = read_32bit_cp0_set1_register(CP0_S1_INTCONTROL); status &= ~((clr_mask & 0xFF) << 8); status |= (set_mask & 0xFF) << 8; write_32bit_cp0_set1_register(CP0_S1_INTCONTROL, status); } static inline void mask_irq(unsigned int irq) { modify_cp0_intmask(irq, 0); } static inline void unmask_irq(unsigned int irq) { modify_cp0_intmask(0, irq); } static void enable_cp7000_irq(unsigned int irq) { unsigned long flags; spin_lock_irqsave(&rm7000_irq_lock, flags); unmask_irq(1 << irq); spin_unlock_irqrestore(&rm7000_irq_lock, flags); } static unsigned int startup_cp7000_irq(unsigned int irq) { enable_cp7000_irq(irq); return 0; /* never anything pending */ } static void disable_cp7000_irq(unsigned int irq) { unsigned long flags; spin_lock_irqsave(&rm7000_irq_lock, flags); mask_irq(1 << irq); spin_unlock_irqrestore(&rm7000_irq_lock, flags); } #define shutdown_cp7000_irq disable_cp7000_irq static void mask_and_ack_cp7000_irq(unsigned int irq) { mask_irq(1 << irq); } static void end_cp7000_irq(unsigned int irq) { if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) unmask_irq(1 << irq); } static struct hw_interrupt_type cp7000_hpcdma_irq_type = { "CP7000", startup_cp7000_irq, shutdown_cp7000_irq, enable_cp7000_irq, disable_cp7000_irq, mask_and_ack_cp7000_irq, end_cp7000_irq, NULL }; extern asmlinkage void ocelot_handle_int(void); extern void gt64120_irq_init(void); void __init init_IRQ(void) { int i; /* * Clear all of the interrupts while we change the able around a bit. * int-handler is not on bootstrap */ clear_cp0_status(ST0_IM | ST0_BEV); __cli(); /* Sets the first-level interrupt dispatcher. */ set_except_vector(0, ocelot_handle_int); init_generic_irq(); for (i = 0; i <= 15; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = 0; irq_desc[i].depth = 1; irq_desc[i].handler = &cp7000_hpcdma_irq_type; } gt64120_irq_init(); #ifdef CONFIG_REMOTE_DEBUG printk("start kgdb ...\n"); set_debug_traps(); breakpoint(); /* you may move this line to whereever you want :-) */ #endif #ifdef CONFIG_GDB_CONSOLE register_gdb_console(); #endif } --- NEW FILE --- /* * $Id: ocelot_pld.h,v 1.1 2002/04/10 14:47:29 atp Exp $ * * Ocelot Board Register Definitions * * (C) 2001 Red Hat, Inc. * * GPL'd * */ #ifndef __MOMENCO_OCELOT_PLD_H__ #define __MOMENCO_OCELOT_PLD_H__ #define OCELOT_CS0_ADDR (0xe0020000) #define OCELOT_REG_BOARDREV (0) #define OCELOT_REG_PLD1_ID (1) #define OCELOT_REG_PLD2_ID (2) #define OCELOT_REG_RESET_STATUS (3) #define OCELOT_REG_BOARD_STATUS (4) #define OCELOT_REG_CPCI_ID (5) #define OCELOT_REG_I2C_CTRL (8) #define OCELOT_REG_EEPROM_MODE (9) #define OCELOT_REG_INTMASK (10) #define OCELOT_REG_INTSTATUS (11) #define OCELOT_REG_INTSET (12) #define OCELOT_REG_INTCLR (13) #define OCELOT_PLD_WRITE(x, y) writeb(x, OCELOT_CS0_ADDR + OCELOT_REG_##y) #define OCELOT_PLD_READ(x) readb(OCELOT_CS0_ADDR + OCELOT_REG_##x) #endif /* __MOMENCO_OCELOT_PLD_H__ */ --- NEW FILE --- /* * Copyright 2001 MontaVista Software Inc. * Author: Jun Sun, js...@mv... or js...@ju... * * arch/mips/gt64120/momenco_ocelot/pci.c * Board-specific PCI routines for gt64120 controller. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include <linux/types.h> #include <linux/pci.h> #include <linux/kernel.h> #include <linux/version.h> #include <linux/init.h> #include <asm/pci.h> void __init gt64120_board_pcibios_fixup_bus(struct pci_bus *bus) { struct pci_bus *current_bus = bus; struct pci_dev *devices; struct list_head *devices_link; u16 cmd; list_for_each(devices_link, &(current_bus->devices)) { devices = pci_dev_b(devices_link); if (devices == NULL) continue; if (PCI_SLOT(devices->devfn) == 1) { /* * Slot 1 is primary ether port, i82559 * we double-check against that assumption */ if ((devices->vendor != 0x8086) || (devices->device != 0x1209) ) { panic("gt64120_board_pcibios_fixup_bus: found " "unexpected PCI device in slot 1."); } devices->irq = 2; /* irq_nr is 2 for INT0 */ } else if (PCI_SLOT(devices->devfn) == 2) { /* * Slot 2 is secondary ether port, i21143 * we double-check against that assumption */ if ((devices->vendor != 0x1011) || (devices->device != 0x19) ) { panic("galileo_pcibios_fixup_bus: " "found unexpected PCI device in slot 2."); } devices->irq = 3; /* irq_nr is 3 for INT1 */ } else if (PCI_SLOT(devices->devfn) == 4) { /* PMC Slot 1 */ devices->irq = 8; /* irq_nr is 8 for INT6 */ } else if (PCI_SLOT(devices->devfn) == 5) { /* PMC Slot 1 */ devices->irq = 9; /* irq_nr is 9 for INT7 */ } else { /* We don't have assign interrupts for other devices. */ devices->irq = 0xff; } /* Assign an interrupt number for the device */ bus->ops->write_byte(devices, PCI_INTERRUPT_LINE, devices->irq); /* enable master */ bus->ops->read_word(devices, PCI_COMMAND, &cmd); cmd |= PCI_COMMAND_MASTER; bus->ops->write_word(devices, PCI_COMMAND, cmd); } } --- NEW FILE --- /* * Copyright 2001 MontaVista Software Inc. * Author: js...@mv... or js...@ju... * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include <linux/init.h> #include <linux/mm.h> #include <linux/sched.h> #include <linux/bootmem.h> #include <asm/addrspace.h> #include <asm/bootinfo.h> #define PLD_BASE 0xbc000000 #define REV 0x0 /* Board Assembly Revision */ #define PLD1ID 0x1 /* PLD 1 ID */ #define PLD2ID 0x2 /* PLD 2 ID */ #define RESET_STAT 0x3 /* Reset Status Register */ #define BOARD_STAT 0x4 /* Board Status Register */ #define CPCI_ID 0x5 /* Compact PCI ID Register */ #define CONTROL 0x8 /* Control Register */ #define CPU_EEPROM 0x9 /* CPU Configuration EEPROM Register */ #define INTMASK 0xA /* Interrupt Mask Register */ #define INTSTAT 0xB /* Interrupt Status Register */ #define INTSET 0xC /* Interrupt Set Register */ #define INTCLR 0xD /* Interrupt Clear Register */ #define PLD_REG(x) ((uint8_t*)(PLD_BASE+(x))) char arcs_cmdline[COMMAND_LINE_SIZE]; /* [js...@ju...] PMON passes arguments in C main() style */ void __init prom_init(int argc, const char **arg) { int i; /* arg[0] is "g", the rest is boot parameters */ arcs_cmdline[0] = '\0'; for (i = 1; i < argc; i++) { if (strlen(arcs_cmdline) + strlen(arg[i] + 1) >= sizeof(arcs_cmdline)) break; strcat(arcs_cmdline, arg[i]); strcat(arcs_cmdline, " "); } mips_machgroup = MACH_GROUP_MOMENCO; mips_machtype = MACH_MOMENCO_OCELOT; /* turn off the Bit Error LED, which comes on automatically * at power-up reset */ *PLD_REG(INTCLR) = 0x80; /* All the boards have at least 64MiB. If there's more, we detect and register it later */ add_memory_region(0, 64 << 20, BOOT_MEM_RAM); } void __init prom_free_prom_memory(void) { } void __init prom_fixup_mem_map(unsigned long start, unsigned long end) { } --- NEW FILE --- /* * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * Copyright (C) 1997, 2001 Ralf Baechle * Copyright 2001 MontaVista Software Inc. * Author: js...@mv... or js...@ju... */ #include <linux/sched.h> #include <linux/mm.h> #include <asm/io.h> #include <asm/pgtable.h> #include <asm/processor.h> #include <asm/reboot.h> #include <asm/system.h> void momenco_ocelot_restart(char *command) { *(volatile char *) 0xbc000000 = 0x0f; /* * Ouch, we're still alive ... This time we take the silver bullet ... * ... and find that we leave the hardware in a state in which the * kernel in the flush locks up somewhen during of after the PCI * detection stuff. */ clear_cp0_status(ST0_BEV | ST0_ERL); change_cp0_config(CONF_CM_CMASK, CONF_CM_UNCACHED); flush_cache_all(); write_32bit_cp0_register(CP0_WIRED, 0); __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000)); } void momenco_ocelot_halt(void) { printk(KERN_NOTICE "\n** You can safely turn off the power\n"); while (1) __asm__(".set\tmips3\n\t" "wait\n\t" ".set\tmips0"); } void momenco_ocelot_power_off(void) { momenco_ocelot_halt(); } --- NEW FILE --- /* * setup.c * * BRIEF MODULE DESCRIPTION * Galileo Evaluation Boards - board dependent boot routines * * Copyright (C) 1996, 1997, 2001 Ralf Baechle * Copyright (C) 2000 RidgeRun, Inc. * Copyright (C) 2001 Red Hat, Inc. * * Author: RidgeRun, Inc. * gl...@ri..., sk...@ri..., st...@ri... * * Copyright 2001 MontaVista Software Inc. * Author: js...@mv... or js...@ju... * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/mc146818rtc.h> #include <linux/mm.h> #include <linux/swap.h> #include <linux/ioport.h> #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/pci.h> #include <linux/timex.h> #include <linux/vmalloc.h> #include <asm/time.h> #include <asm/bootinfo.h> #include <asm/page.h> #include <asm/bootinfo.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/pci.h> #include <asm/processor.h> #include <asm/ptrace.h> #include <asm/reboot.h> #include <asm/mc146818rtc.h> #include <linux/version.h> #include <linux/bootmem.h> #include <linux/blk.h> #include <asm/gt64120/gt64120.h> #include "ocelot_pld.h" extern struct rtc_ops no_rtc_ops; unsigned long gt64120_base = KSEG1ADDR(GT_DEF_BASE); /* These functions are used for rebooting or halting the machine*/ extern void momenco_ocelot_restart(char *command); extern void momenco_ocelot_halt(void); extern void momenco_ocelot_power_off(void); extern void gt64120_time_init(void); extern void momenco_ocelot_irq_setup(void); static char reset_reason; #define ENTRYLO(x) ((pte_val(mk_pte_phys((x), PAGE_KERNEL_UNCACHED)) >> 6)|1) static void __init setup_l3cache(unsigned long size); void __init momenco_ocelot_setup(void) { void (*l3func)(unsigned long)=KSEG1ADDR(&setup_l3cache); unsigned int tmpword; board_time_init = gt64120_time_init; _machine_restart = momenco_ocelot_restart; _machine_halt = momenco_ocelot_halt; _machine_power_off = momenco_ocelot_power_off; /* * initrd_start = (ulong)ocelot_initrd_start; * initrd_end = (ulong)ocelot_initrd_start + (ulong)ocelot_initrd_size; * initrd_below_start_ok = 1; */ rtc_ops = &no_rtc_ops; /* A wired TLB entry for the GT64120A and the serial port. The GT64120A is going to be hit on every IRQ anyway - there's absolutely no point in letting it be a random TLB entry, as it'll just cause needless churning of the TLB. And we use the other half for the serial port, which is just a PITA otherwise :) Device Physical Virtual GT64120 Internal Regs 0x24000000 0xe0000000 UARTs (CS2) 0x2d000000 0xe0001000 */ add_wired_entry(ENTRYLO(0x24000000), ENTRYLO(0x2D000000), 0xe0000000, PM_4K); /* Also a temporary entry to let us talk to the Ocelot PLD and NVRAM in the CS[012] region. We can't use ioremap() yet. The NVRAM appears to be one of the variants of ST M48T35 - see http://www.st.com/stonline/bin/sftab.exe?table=172&filter0=M48T35 Ocelot PLD (CS0) 0x2c000000 0xe0020000 NVRAM 0x2c800000 0xe0030000 */ add_temporary_entry(ENTRYLO(0x2C000000), ENTRYLO(0x2d000000), 0xe0020000, PM_64K); /* Relocate the CS3/BootCS region */ GT_WRITE( GT_CS3BOOTLD_OFS, 0x2f000000 >> 21); /* Relocate CS[012] */ GT_WRITE(GT_CS20LD_OFS, 0x2c000000 >> 21); /* Relocate the GT64120A itself... */ GT_WRITE(GT_ISD_OFS, 0x24000000 >> 21); mb(); gt64120_base = 0xe0000000; /* ...and the PCI0 view of it. */ GT_WRITE(GT_PCI0_CFGADDR_OFS, 0x80000020); GT_WRITE(GT_PCI0_CFGDATA_OFS, 0x24000000); GT_WRITE(GT_PCI0_CFGADDR_OFS, 0x80000024); GT_WRITE(GT_PCI0_CFGDATA_OFS, 0x24000001); /* Relocate PCI0 I/O and Mem0 */ GT_WRITE(GT_PCI0IOLD_OFS, 0x20000000 >> 21); GT_WRITE(GT_PCI0M0LD_OFS, 0x22000000 >> 21); /* Relocate PCI0 Mem1 */ GT_WRITE(GT_PCI0M1LD_OFS, 0x36000000 >> 21); /* Relocate all the PCI1 stuff, not that we use it */ GT_WRITE(GT_PCI1IOLD_OFS, 0x30000000 >> 21); GT_WRITE(GT_PCI1M0LD_OFS, 0x32000000 >> 21); GT_WRITE(GT_PCI1M1LD_OFS, 0x34000000 >> 21); /* Relocate the CPU's view of the RAM... */ GT_WRITE(GT_SCS10LD_OFS, 0); GT_WRITE(GT_SCS10HD_OFS, 0x0fe00000 >> 21); GT_WRITE(GT_SCS32LD_OFS, 0x10000000 >> 21); GT_WRITE(GT_SCS32HD_OFS, 0x0fe00000 >> 21); GT_WRITE(GT_SCS1LD_OFS, 0xff); GT_WRITE(GT_SCS1HD_OFS, 0x00); GT_WRITE(GT_SCS0LD_OFS, 0); GT_WRITE(GT_SCS0HD_OFS, 0xff); GT_WRITE(GT_SCS3LD_OFS, 0xff); GT_WRITE(GT_SCS3HD_OFS, 0x00); GT_WRITE(GT_SCS2LD_OFS, 0); GT_WRITE(GT_SCS2HD_OFS, 0xff); /* ...and the PCI0 view of it. */ GT_WRITE(GT_PCI0_CFGADDR_OFS, 0x80000010); GT_WRITE(GT_PCI0_CFGDATA_OFS, 0x00000000); GT_WRITE(GT_PCI0_CFGADDR_OFS, 0x80000014); GT_WRITE(GT_PCI0_CFGDATA_OFS, 0x10000000); GT_WRITE(GT_PCI0_BS_SCS10_OFS, 0x0ffff000); GT_WRITE(GT_PCI0_BS_SCS32_OFS, 0x0ffff000); tmpword = OCELOT_PLD_READ(BOARDREV); if (tmpword < 26) printk("Momenco Ocelot: Board Assembly Rev. %c\n", 'A'+tmpword); else printk("Momenco Ocelot: Board Assembly Revision #0x%x\n", tmpword); tmpword = OCELOT_PLD_READ(PLD1_ID); printk("PLD 1 ID: %d.%d\n", tmpword>>4, tmpword&15); tmpword = OCELOT_PLD_READ(PLD2_ID); printk("PLD 2 ID: %d.%d\n", tmpword>>4, tmpword&15); tmpword = OCELOT_PLD_READ(RESET_STATUS); printk("Reset reason: 0x%x\n", tmpword); reset_reason = tmpword; OCELOT_PLD_WRITE(0xff, RESET_STATUS); tmpword = OCELOT_PLD_READ(BOARD_STATUS); printk("Board Status register: 0x%02x\n", tmpword); printk(" - User jumper: %s\n", (tmpword & 0x80)?"installed":"absent"); printk(" - Boot flash write jumper: %s\n", (tmpword&0x40)?"installed":"absent"); printk(" - Tulip PHY %s connected\n", (tmpword&0x10)?"is":"not"); printk(" - L3 Cache size: %d MiB\n", (1<<((tmpword&12) >> 2))&~1); printk(" - SDRAM size: %d MiB\n", 1<<(6+(tmpword&3))); if (tmpword&12) l3func((1<<(((tmpword&12) >> 2)+20))); switch(tmpword &3) { case 3: /* 512MiB */ add_memory_region(256<<20, 256<<20, BOOT_MEM_RAM); case 2: /* 256MiB */ /* FIXME: Is it actually here, or at 0x10000000? */ add_memory_region(128<<20, 128<<20, BOOT_MEM_RAM); case 1: /* 128MiB */ add_memory_region(64<<20, 64<<20, BOOT_MEM_RAM); case 0: /* 64MiB */ ; } /* Fix up the DiskOnChip mapping */ GT_WRITE(0x468, 0xfef73); } extern int rm7k_tcache_enabled; /* * This runs in KSEG1. See the verbiage in rm7k.c::probe_scache() */ #define Page_Invalidate_T 0x16 static void __init setup_l3cache(unsigned long size) { int register i; unsigned long tmp; printk("Enabling L3 cache..."); /* Enable the L3 cache in the GT64120A's CPU Configuration register */ GT_READ(0, &tmp); GT_WRITE(0, tmp | (1<<14)); /* Enable the L3 cache in the CPU */ set_cp0_config(1<<12 /* CONF_TE */); /* Clear the cache */ set_taglo(0); set_taghi(0); for (i=0; i < size; i+= 4096) { __asm__ __volatile__ ( ".set noreorder\n\t" ".set mips3\n\t" "cache %1, (%0)\n\t" ".set mips0\n\t" ".set reorder" : : "r" (KSEG0ADDR(i)), "i" (Page_Invalidate_T)); } /* Let the RM7000 MM code know that the tertiary cache is enabled */ rm7k_tcache_enabled = 1; printk("Done\n"); } /* This needs to be one of the first initcalls, because no I/O port access can work before this */ static int io_base_ioremap(void) { void *io_remap_range = ioremap(GT_PCI_IO_BASE, GT_PCI_IO_SIZE); if (!io_remap_range) { panic("Could not ioremap I/O port range\n"); } mips_io_port_base = io_remap_range - GT_PCI_IO_BASE; return 0; } module_init(io_base_ioremap); |
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/kernel Modified Files: bios32.c head.S ints.c process.c ptrace.c semaphore.c setup.c sys_m68k.c traps.c Log Message: synch 2.4.15 commit 37 Index: bios32.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel/bios32.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- bios32.c 25 Feb 2001 23:15:19 -0000 1.1.1.2 +++ bios32.c 10 Apr 2002 14:34:35 -0000 1.2 @@ -444,7 +444,7 @@ * dev - device. * i - resource. * - * Result: 0 if successfull. + * Result: 0 if successful. */ int __init pcibios_assign_resource(struct pci_dev *dev, int i) Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel/head.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- head.S 14 Jan 2001 19:39:56 -0000 1.1.1.1 +++ head.S 10 Apr 2002 14:34:35 -0000 1.2 @@ -840,7 +840,7 @@ #ifdef CONFIG_MVME16x is_not_mvme16x(L(gvtdone)) - /* Need to get the BRD_ID info to diferentiate between 162, 167, + /* Need to get the BRD_ID info to differentiate between 162, 167, * etc. This is available as a BI_VME_BRDINFO tag with later * versions of VMELILO and TFTPLILO, otherwise we call the Bug. */ @@ -1178,8 +1178,45 @@ #ifdef CONFIG_SUN3X is_not_sun3x(L(notsun3x)) + /* oh, the pain.. We're gonna want the prom code after + * starting the MMU, so we copy the mappings, translating + * from 8k -> 4k pages as we go. + */ + + /* copy maps from 0xfee00000 to 0xff000000 */ + movel #0xfee00000, %d0 + moveq #ROOT_INDEX_SHIFT, %d1 + lsrl %d1,%d0 + mmu_get_root_table_entry %d0 + + movel #0xfee00000, %d0 + moveq #PTR_INDEX_SHIFT, %d1 + lsrl %d1,%d0 + andl #PTR_TABLE_SIZE-1, %d0 + mmu_get_ptr_table_entry %a0,%d0 + + movel #0xfee00000, %d0 + moveq #PAGE_INDEX_SHIFT, %d1 + lsrl %d1,%d0 + andl #PAGE_TABLE_SIZE-1, %d0 + mmu_get_page_table_entry %a0,%d0 + + /* this is where the prom page table lives */ + movel 0xfefe00d4, %a1 + movel %a1@, %a1 + + movel #((0x200000 >> 13)-1), %d1 + +1: + movel %a1@+, %d3 + movel %d3,%a0@+ + addl #0x1000,%d3 + movel %d3,%a0@+ + + dbra %d1,1b + /* setup tt1 for I/O */ - mmu_map_tt #1,#0x40000000,#0x40000000,#_PAGE_NOCACHE_S + mmu_map_tt #1,#0x40000000,#0x40000000,#_PAGE_NOCACHE_S jbra L(mmu_init_done) L(notsun3x): @@ -1363,7 +1400,7 @@ is_not_sun3x(1f) /* enable copro */ - oriw #0x4000,0x61000000 + oriw #0x4000,0x61000000 1: #endif @@ -3061,6 +3098,16 @@ 2: #endif +#ifdef CONFIG_SUN3X + is_not_sun3x(2f) + movel %d0,-(%sp) + movel 0xFEFE0018,%a1 + jbsr (%a1) + addq #4,%sp + jbra L(serial_putc_done) +2: +#endif + #ifdef CONFIG_Q40 is_not_q40(2f) tst.l %pc@(L(q40_do_debug)) /* only debug if requested */ Index: ints.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel/ints.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ints.c 14 Jan 2001 19:39:57 -0000 1.1.1.1 +++ ints.c 10 Apr 2002 14:34:35 -0000 1.2 @@ -184,7 +184,7 @@ /* * Do we need these probe functions on the m68k? * - * ... may be usefull with ISA devices + * ... may be useful with ISA devices */ unsigned long probe_irq_on (void) { Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel/process.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- process.c 25 Feb 2001 23:15:19 -0000 1.1.1.2 +++ process.c 10 Apr 2002 14:34:35 -0000 1.2 @@ -38,7 +38,6 @@ * alignment requirements and potentially different initial * setup. */ -static struct vm_area_struct init_mmap = INIT_MMAP; static struct fs_struct init_fs = INIT_FS; static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS; @@ -110,8 +109,8 @@ void show_regs(struct pt_regs * regs) { printk("\n"); - printk("Format %02x Vector: %04x PC: %08lx Status: %04x\n", - regs->format, regs->vector, regs->pc, regs->sr); + printk("Format %02x Vector: %04x PC: %08lx Status: %04x %s\n", + regs->format, regs->vector, regs->pc, regs->sr, print_tainted()); printk("ORIG_D0: %08lx D0: %08lx A2: %08lx A1: %08lx\n", regs->orig_d0, regs->d0, regs->a2, regs->a1); printk("A0: %08lx D5: %08lx D4: %08lx\n", Index: ptrace.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel/ptrace.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ptrace.c 14 Jan 2001 19:40:00 -0000 1.1.1.1 +++ ptrace.c 10 Apr 2002 14:34:35 -0000 1.2 @@ -87,6 +87,19 @@ return 0; } +/* + * Called by kernel/ptrace.c when detaching.. + * + * Make sure the single step bit is not set. + */ +void ptrace_disable(struct task_struct *child) +{ + unsigned long tmp; + /* make sure the single step bit is not set. */ + tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); + put_reg(child, PT_SR, tmp); +} + asmlinkage int sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; @@ -107,50 +120,29 @@ ret = -ESRCH; read_lock(&tasklist_lock); child = find_task_by_pid(pid); - read_unlock(&tasklist_lock); /* FIXME!!! */ + if (child) + get_task_struct(child); + read_unlock(&tasklist_lock); if (!child) goto out; + ret = -EPERM; if (pid == 1) /* you may not mess with init */ - goto out; - if (request == PTRACE_ATTACH) { - if (child == current) - goto out; - if ((!child->dumpable || - (current->uid != child->euid) || - (current->uid != child->suid) || - (current->uid != child->uid) || - (current->gid != child->egid) || - (current->gid != child->sgid) || - (!cap_issubset(child->cap_permitted, current->cap_permitted)) || - (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) - goto out; - /* the same process cannot be attached many times */ - if (child->ptrace & PT_PTRACED) - goto out; - child->ptrace |= PT_PTRACED; + goto out_tsk; - write_lock_irqsave(&tasklist_lock, flags); - if (child->p_pptr != current) { - REMOVE_LINKS(child); - child->p_pptr = current; - SET_LINKS(child); - } - write_unlock_irqrestore(&tasklist_lock, flags); - - send_sig(SIGSTOP, child, 1); - ret = 0; - goto out; + if (request == PTRACE_ATTACH) { + ret = ptrace_attach(child); + goto out_tsk; } ret = -ESRCH; if (!(child->ptrace & PT_PTRACED)) - goto out; + goto out_tsk; if (child->state != TASK_STOPPED) { if (request != PTRACE_KILL) - goto out; + goto out_tsk; } if (child->p_pptr != current) - goto out; + goto out_tsk; switch (request) { /* when I and D space are separate, these will need to be fixed. */ @@ -162,9 +154,9 @@ copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); ret = -EIO; if (copied != sizeof(tmp)) - goto out; + break; ret = put_user(tmp,(unsigned long *) data); - goto out; + break; } /* read the word at location addr in the USER area. */ @@ -172,8 +164,9 @@ unsigned long tmp; ret = -EIO; - if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) - goto out; + if ((addr & 3) || addr < 0 || + addr > sizeof(struct user) - 3) + break; tmp = 0; /* Default return condition */ addr = addr >> 2; /* temporary hack. */ @@ -193,9 +186,9 @@ ((tmp & 0x0000ffff) << 16); #endif } else - goto out; + break; ret = put_user(tmp,(unsigned long *) data); - goto out; + break; } /* when I and D space are separate, this will have to be fixed. */ @@ -203,14 +196,15 @@ case PTRACE_POKEDATA: ret = 0; if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data)) - goto out; + break; ret = -EIO; - goto out; + break; case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ ret = -EIO; - if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) - goto out; + if ((addr & 3) || addr < 0 || + addr > sizeof(struct user) - 3) + break; addr = addr >> 2; /* temporary hack. */ @@ -221,9 +215,9 @@ } if (addr < 19) { if (put_reg(child, addr, data)) - goto out; + break; ret = 0; - goto out; + break; } if (addr >= 21 && addr < 48) { @@ -240,7 +234,7 @@ child->thread.fp[addr - 21] = data; ret = 0; } - goto out; + break; case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ case PTRACE_CONT: { /* restart after signal. */ @@ -248,7 +242,7 @@ ret = -EIO; if ((unsigned long) data > _NSIG) - goto out; + break; if (request == PTRACE_SYSCALL) child->ptrace |= PT_TRACESYS; else @@ -259,7 +253,7 @@ put_reg(child, PT_SR, tmp); wake_up_process(child); ret = 0; - goto out; + break; } /* @@ -272,13 +266,13 @@ ret = 0; if (child->state == TASK_ZOMBIE) /* already dead */ - goto out; + break; child->exit_code = SIGKILL; /* make sure the single step bit is not set. */ tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); put_reg(child, PT_SR, tmp); wake_up_process(child); - goto out; + break; } case PTRACE_SINGLESTEP: { /* set the trap flag. */ @@ -286,7 +280,7 @@ ret = -EIO; if ((unsigned long) data > _NSIG) - goto out; + break; child->ptrace &= ~PT_TRACESYS; tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16); put_reg(child, PT_SR, tmp); @@ -295,29 +289,12 @@ /* give it a chance to run. */ wake_up_process(child); ret = 0; - goto out; + break; } - case PTRACE_DETACH: { /* detach a process that was attached. */ - long tmp; - - ret = -EIO; - if ((unsigned long) data > _NSIG) - goto out; - child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); - child->exit_code = data; - write_lock_irqsave(&tasklist_lock, flags); - REMOVE_LINKS(child); - child->p_pptr = child->p_opptr; - SET_LINKS(child); - write_unlock_irqrestore(&tasklist_lock, flags); - /* make sure the single step bit is not set. */ - tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); - put_reg(child, PT_SR, tmp); - wake_up_process(child); - ret = 0; - goto out; - } + case PTRACE_DETACH: /* detach a process that was attached. */ + ret = ptrace_detach(child, data); + break; case PTRACE_GETREGS: { /* Get all gp regs from the child. */ int i; @@ -328,12 +305,12 @@ tmp >>= 16; if (put_user(tmp, (unsigned long *) data)) { ret = -EFAULT; - goto out; + break; } data += sizeof(long); } ret = 0; - goto out; + break; } case PTRACE_SETREGS: { /* Set all gp regs in the child. */ @@ -342,7 +319,7 @@ for (i = 0; i < 19; i++) { if (get_user(tmp, (unsigned long *) data)) { ret = -EFAULT; - goto out; + break; } if (i == PT_SR) { tmp &= SR_MASK; @@ -353,7 +330,7 @@ data += sizeof(long); } ret = 0; - goto out; + break; } case PTRACE_GETFPREGS: { /* Get the child FPU state. */ @@ -361,7 +338,7 @@ if (copy_to_user((void *)data, &child->thread.fp, sizeof(struct user_m68kfp_struct))) ret = -EFAULT; - goto out; + break; } case PTRACE_SETFPREGS: { /* Set the child FPU state. */ @@ -369,13 +346,15 @@ if (copy_from_user(&child->thread.fp, (void *)data, sizeof(struct user_m68kfp_struct))) ret = -EFAULT; - goto out; + break; } default: ret = -EIO; - goto out; + break; } +out_tsk: + free_task_struct(child); out: unlock_kernel(); return ret; @@ -383,10 +362,9 @@ asmlinkage void syscall_trace(void) { - lock_kernel(); if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) != (PT_PTRACED|PT_TRACESYS)) - goto out; + return; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; notify_parent(current, SIGCHLD); @@ -400,6 +378,4 @@ send_sig(current->exit_code, current, 1); current->exit_code = 0; } -out: - unlock_kernel(); } Index: semaphore.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel/semaphore.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- semaphore.c 14 Jan 2001 19:40:15 -0000 1.1.1.1 +++ semaphore.c 10 Apr 2002 14:34:35 -0000 1.2 @@ -130,111 +130,3 @@ { return waking_non_zero_trylock(sem); } - - -/* Wait for the lock to become unbiased. Readers - * are non-exclusive. =) - */ -void down_read_failed(struct rw_semaphore *sem) -{ - DECLARE_WAITQUEUE(wait, current); - - __up_read(sem); /* this takes care of granting the lock */ - - add_wait_queue(&sem->wait, &wait); - - while (atomic_read(&sem->count) < 0) { - set_task_state(current, TASK_UNINTERRUPTIBLE); - if (atomic_read(&sem->count) >= 0) - break; - schedule(); - } - - remove_wait_queue(&sem->wait, &wait); - current->state = TASK_RUNNING; -} - -void down_read_failed_biased(struct rw_semaphore *sem) -{ - DECLARE_WAITQUEUE(wait, current); - - add_wait_queue(&sem->wait, &wait); /* put ourselves at the head of the list */ - - for (;;) { - if (sem->read_bias_granted && xchg(&sem->read_bias_granted, 0)) - break; - set_task_state(current, TASK_UNINTERRUPTIBLE); - if (!sem->read_bias_granted) - schedule(); - } - - remove_wait_queue(&sem->wait, &wait); - current->state = TASK_RUNNING; -} - - -/* Wait for the lock to become unbiased. Since we're - * a writer, we'll make ourselves exclusive. - */ -void down_write_failed(struct rw_semaphore *sem) -{ - DECLARE_WAITQUEUE(wait, current); - - __up_write(sem); /* this takes care of granting the lock */ - - add_wait_queue_exclusive(&sem->wait, &wait); - - while (atomic_read(&sem->count) < 0) { - set_task_state(current, TASK_UNINTERRUPTIBLE); - if (atomic_read(&sem->count) >= 0) - break; /* we must attempt to acquire or bias the lock */ - schedule(); - } - - remove_wait_queue(&sem->wait, &wait); - current->state = TASK_RUNNING; -} - -void down_write_failed_biased(struct rw_semaphore *sem) -{ - DECLARE_WAITQUEUE(wait, current); - - add_wait_queue_exclusive(&sem->write_bias_wait, &wait); /* put ourselves at the end of the list */ - - for (;;) { - if (sem->write_bias_granted && xchg(&sem->write_bias_granted, 0)) - break; - set_task_state(current, TASK_UNINTERRUPTIBLE); - if (!sem->write_bias_granted) - schedule(); - } - - remove_wait_queue(&sem->write_bias_wait, &wait); - current->state = TASK_RUNNING; - - /* if the lock is currently unbiased, awaken the sleepers - * FIXME: this wakes up the readers early in a bit of a - * stampede -> bad! - */ - if (atomic_read(&sem->count) >= 0) - wake_up(&sem->wait); -} - - -/* Called when someone has done an up that transitioned from - * negative to non-negative, meaning that the lock has been - * granted to whomever owned the bias. - */ -void rwsem_wake_readers(struct rw_semaphore *sem) -{ - if (xchg(&sem->read_bias_granted, 1)) - BUG(); - wake_up(&sem->wait); -} - -void rwsem_wake_writer(struct rw_semaphore *sem) -{ - if (xchg(&sem->write_bias_granted, 1)) - BUG(); - wake_up(&sem->write_bias_wait); -} Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel/setup.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- setup.c 14 Jan 2001 19:40:02 -0000 1.1.1.1 +++ setup.c 10 Apr 2002 14:34:35 -0000 1.2 @@ -34,15 +34,15 @@ #ifdef CONFIG_ATARI #include <asm/atarihw.h> #endif +#ifdef CONFIG_SUN3X +#include <asm/dvma.h> +extern void sun_serial_setup(void); +#endif #ifdef CONFIG_BLK_DEV_INITRD #include <linux/blk.h> #endif -#ifndef CONFIG_AMIGA -#define dbprintf printk -#endif - unsigned long m68k_machtype; unsigned long m68k_cputype; unsigned long m68k_fputype; @@ -110,6 +110,11 @@ char *mach_sysrq_xlate = NULL; #endif +#if defined(CONFIG_ISA) +int isa_type; +int isa_sex; +#endif + extern int amiga_parse_bootinfo(const struct bi_record *); extern int atari_parse_bootinfo(const struct bi_record *); extern int mac_parse_bootinfo(const struct bi_record *); @@ -141,7 +146,7 @@ { while (record->tag != BI_LAST) { int unknown = 0; - const u_long *data = record->data; + const unsigned long *data = record->data; switch (record->tag) { case BI_MACHTYPE: case BI_CPUTYPE: @@ -190,7 +195,7 @@ if (unknown) printk("m68k_parse_bootinfo: unknown tag 0x%04x ignored\n", record->tag); - record = (struct bi_record *)((u_long)record+record->size); + record = (struct bi_record *)((unsigned long)record+record->size); } m68k_realnum_memory = m68k_num_memory; @@ -369,14 +374,44 @@ if (MACH_IS_ATARI) atari_stram_reserve_pages(availmem); #endif +#ifdef CONFIG_SUN3X + if (MACH_IS_SUN3X) { + dvma_init(); +#ifdef CONFIG_SUN3X_ZS + sun_serial_setup(); +#endif + } +#endif + #endif /* !CONFIG_SUN3 */ + paging_init(); + +/* set ISA defs early as possible */ +#if defined(CONFIG_ISA) +#if defined(CONFIG_Q40) + if (MACH_IS_Q40) { + isa_type = Q40_ISA; + isa_sex = 0; + } +#elif defined(CONFIG_GG2) + if (MACH_IS_AMIGA && AMIGAHW_PRESENT(GG2_ISA)){ + isa_type = GG2_ISA; + isa_sex = 0; + } +#elif defined(CONFIG_AMIGA_PCMCIA) + if (MACH_IS_AMIGA && AMIGAHW_PRESENT(PCMCIA)){ + isa_type = AG_ISA; + isa_sex = 1; + } +#endif +#endif } int get_cpuinfo(char * buffer) { const char *cpu, *mmu, *fpu; - u_long clockfreq, clockfactor; + unsigned long clockfreq, clockfactor; #define LOOP_CYCLES_68020 (8) #define LOOP_CYCLES_68030 (8) @@ -451,7 +486,7 @@ { int len = 0; char model[80]; - u_long mem; + unsigned long mem; int i; if (mach_get_model) Index: sys_m68k.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel/sys_m68k.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- sys_m68k.c 14 Jan 2001 19:40:08 -0000 1.1.1.1 +++ sys_m68k.c 10 Apr 2002 14:34:35 -0000 1.2 @@ -59,9 +59,9 @@ goto out; } - down(¤t->mm->mmap_sem); + down_write(¤t->mm->mmap_sem); error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); - up(¤t->mm->mmap_sem); + up_write(¤t->mm->mmap_sem); if (file) fput(file); @@ -146,9 +146,9 @@ } a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); - down(¤t->mm->mmap_sem); + down_write(¤t->mm->mmap_sem); error = do_mmap_pgoff(file, a.addr, a.len, a.prot, a.flags, pgoff); - up(¤t->mm->mmap_sem); + up_write(¤t->mm->mmap_sem); if (file) fput(file); out: @@ -267,7 +267,8 @@ return -ENOSYS; } -/* Convert virtual address VADDR to physical address PADDR */ + +/* Convert virtual (user) address VADDR to physical address PADDR */ #define virt_to_phys_040(vaddr) \ ({ \ unsigned long _mmusr, _paddr; \ @@ -447,6 +448,12 @@ { unsigned long paddr, i; + /* + * 68060 manual says: + * cpush %dc : flush DC, remains valid (with our %cacr setup) + * cpush %ic : invalidate IC + * cpush %bc : flush DC + invalidate IC + */ switch (scope) { case FLUSH_SCOPE_ALL: @@ -455,20 +462,17 @@ case FLUSH_CACHE_DATA: __asm__ __volatile__ (".chip 68060\n\t" "cpusha %dc\n\t" - "cinva %dc\n\t" ".chip 68k"); break; case FLUSH_CACHE_INSN: __asm__ __volatile__ (".chip 68060\n\t" "cpusha %ic\n\t" - "cinva %ic\n\t" ".chip 68k"); break; default: case FLUSH_CACHE_BOTH: __asm__ __volatile__ (".chip 68060\n\t" "cpusha %bc\n\t" - "cinva %bc\n\t" ".chip 68k"); break; } @@ -506,14 +510,12 @@ case FLUSH_CACHE_DATA: __asm__ __volatile__ (".chip 68060\n\t" "cpushl %%dc,(%0)\n\t" - "cinvl %%dc,(%0)\n\t" ".chip 68k" : : "a" (paddr)); break; case FLUSH_CACHE_INSN: __asm__ __volatile__ (".chip 68060\n\t" "cpushl %%ic,(%0)\n\t" - "cinvl %%ic,(%0)\n\t" ".chip 68k" : : "a" (paddr)); break; @@ -521,7 +523,6 @@ case FLUSH_CACHE_BOTH: __asm__ __volatile__ (".chip 68060\n\t" "cpushl %%bc,(%0)\n\t" - "cinvl %%bc,(%0)\n\t" ".chip 68k" : : "a" (paddr)); break; @@ -568,14 +569,12 @@ case FLUSH_CACHE_DATA: __asm__ __volatile__ (".chip 68060\n\t" "cpushp %%dc,(%0)\n\t" - "cinvp %%dc,(%0)\n\t" ".chip 68k" : : "a" (paddr)); break; case FLUSH_CACHE_INSN: __asm__ __volatile__ (".chip 68060\n\t" "cpushp %%ic,(%0)\n\t" - "cinvp %%ic,(%0)\n\t" ".chip 68k" : : "a" (paddr)); break; @@ -583,7 +582,6 @@ case FLUSH_CACHE_BOTH: __asm__ __volatile__ (".chip 68060\n\t" "cpushp %%bc,(%0)\n\t" - "cinvp %%bc,(%0)\n\t" ".chip 68k" : : "a" (paddr)); break; @@ -607,13 +605,14 @@ goto out; if (scope == FLUSH_SCOPE_ALL) { - /* Only the superuser may flush the whole cache. */ + /* Only the superuser may explicitly flush the whole cache. */ ret = -EPERM; if (!capable(CAP_SYS_ADMIN)) goto out; } else { - /* Verify that the specified address region actually belongs to - * this process. + /* + * Verify that the specified address region actually belongs + * to this process. */ vma = find_vma (current->mm, addr); ret = -EINVAL; @@ -652,10 +651,21 @@ } ret = 0; goto out; - } else if (CPU_IS_040) { + } else { + /* + * 040 or 060: don't blindly trust 'scope', someone could + * try to flush a few megs of memory. + */ + + if (len>=3*PAGE_SIZE && scope<FLUSH_SCOPE_PAGE) + scope=FLUSH_SCOPE_PAGE; + if (len>=10*PAGE_SIZE && scope<FLUSH_SCOPE_ALL) + scope=FLUSH_SCOPE_ALL; + if (CPU_IS_040) { ret = cache_flush_040 (addr, scope, cache, len); - } else if (CPU_IS_060) { + } else if (CPU_IS_060) { ret = cache_flush_060 (addr, scope, cache, len); + } } out: unlock_kernel(); Index: traps.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/kernel/traps.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- traps.c 14 Jan 2001 19:40:12 -0000 1.1.1.1 +++ traps.c 10 Apr 2002 14:34:35 -0000 1.2 @@ -72,6 +72,12 @@ */ void __init base_trap_init(void) { + if(MACH_IS_SUN3X) { + extern e_vector *sun3x_prom_vbr; + + __asm__ volatile ("movec %%vbr, %0" : "=r" ((void*)sun3x_prom_vbr)); + } + /* setup the exception vector table */ __asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)vectors)); @@ -245,9 +251,12 @@ #endif /* CONFIG_M68060 */ #if defined (CONFIG_M68040) -static inline unsigned long probe040(int iswrite, unsigned long addr) +static inline unsigned long probe040(int iswrite, unsigned long addr, int wbs) { unsigned long mmusr; + mm_segment_t old_fs = get_fs(); + + set_fs(MAKE_MM_SEG(wbs)); asm volatile (".chip 68040"); @@ -260,6 +269,8 @@ asm volatile (".chip 68k"); + set_fs(old_fs); + return mmusr; } @@ -267,7 +278,9 @@ unsigned long wbd) { int res = 0; + mm_segment_t old_fs = get_fs(); + /* set_fs can not be moved, otherwise put_user() may oops */ set_fs(MAKE_MM_SEG(wbs)); switch (wbs & WBSIZ_040) { @@ -282,6 +295,10 @@ break; } + /* set_fs can not be moved, otherwise put_user() may oops */ + set_fs(old_fs); + + #ifdef DEBUG printk("do_040writeback1, res=%d\n",res); #endif @@ -293,10 +310,12 @@ * to that exception is discarded, set a few bits in the old frame * to simulate what it should look like */ -static inline void fix_xframe040(struct frame *fp, unsigned short wbs) +static inline void fix_xframe040(struct frame *fp, unsigned long wba, unsigned short wbs) { - fp->un.fmt7.faddr = current->thread.faddr; + fp->un.fmt7.faddr = wba; fp->un.fmt7.ssw = wbs & 0xff; + if (wba != current->thread.faddr) + fp->un.fmt7.ssw |= MA_040; } static inline void do_040writebacks(struct frame *fp) @@ -312,7 +331,7 @@ res = do_040writeback1(fp->un.fmt7.wb2s, fp->un.fmt7.wb2a, fp->un.fmt7.wb2d); if (res) - fix_xframe040(fp, fp->un.fmt7.wb2s); + fix_xframe040(fp, fp->un.fmt7.wb2a, fp->un.fmt7.wb2s); else fp->un.fmt7.wb2s = 0; } @@ -322,7 +341,14 @@ res = do_040writeback1(fp->un.fmt7.wb3s, fp->un.fmt7.wb3a, fp->un.fmt7.wb3d); if (res) - fix_xframe040(fp, fp->un.fmt7.wb3s); + { + fix_xframe040(fp, fp->un.fmt7.wb3a, fp->un.fmt7.wb3s); + + fp->un.fmt7.wb2s = fp->un.fmt7.wb3s; + fp->un.fmt7.wb3s &= (~WBV_040); + fp->un.fmt7.wb2a = fp->un.fmt7.wb3a; + fp->un.fmt7.wb2d = fp->un.fmt7.wb3d; + } else fp->un.fmt7.wb3s = 0; } @@ -339,19 +365,15 @@ */ asmlinkage void berr_040cleanup(struct frame *fp) { - mm_segment_t old_fs = get_fs(); - fp->un.fmt7.wb2s &= ~4; fp->un.fmt7.wb3s &= ~4; do_040writebacks(fp); - set_fs(old_fs); } static inline void access_error040(struct frame *fp) { unsigned short ssw = fp->un.fmt7.ssw; - mm_segment_t old_fs = get_fs(); unsigned long mmusr; #ifdef DEBUG @@ -374,9 +396,8 @@ if (ssw & MA_040) addr = (addr + 7) & -8; - set_fs(MAKE_MM_SEG(ssw)); /* MMU error, get the MMUSR info for this access */ - mmusr = probe040(!(ssw & RW_040), addr); + mmusr = probe040(!(ssw & RW_040), addr, ssw); #ifdef DEBUG printk("mmusr = %lx\n", mmusr); #endif @@ -386,8 +407,12 @@ __flush_tlb040_one(addr); errorcode = 0; } - if (!(ssw & RW_040)) + + /* despite what documentation seems to say, RMW + * accesses have always both the LK and RW bits set */ + if (!(ssw & RW_040) || (ssw & LK_040)) errorcode |= 2; + if (do_page_fault(&fp->ptregs, addr, errorcode)) { #ifdef DEBUG printk("do_page_fault() !=0 \n"); @@ -415,7 +440,6 @@ } do_040writebacks(fp); - set_fs(old_fs); } #endif /* CONFIG_M68040 */ |
From: Andy P. <at...@us...> - 2002-04-10 18:36:15
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3 In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/sun3 Modified Files: Makefile config.c dvma.c idprom.c intersil.c mmu_emu.c sbus.c sun3_ksyms.c sun3ints.c Added Files: sun3dvma.c Log Message: synch 2.4.15 commit 37 --- NEW FILE --- /* * linux/arch/m68k/mm/sun3dvma.c * * Copyright (C) 2000 Sam Creasey * * Contains common routines for sun3/sun3x DVMA management. */ #include <linux/kernel.h> #include <linux/mm.h> #include <linux/list.h> #include <asm/page.h> #include <asm/pgtable.h> #include <asm/dvma.h> #ifdef CONFIG_SUN3X extern void dvma_unmap_iommu(unsigned long baddr, int len); #else static inline void dvma_unmap_iommu(unsigned long a, int b) { } #endif unsigned long iommu_use[IOMMU_TOTAL_ENTRIES]; #define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT) #define dvma_entry_use(baddr) (iommu_use[dvma_index(baddr)]) struct hole { unsigned long start; unsigned long end; unsigned long size; struct list_head list; }; static struct list_head hole_list; static struct list_head hole_cache; static struct hole initholes[64]; static inline int refill(void) { struct hole *hole; struct hole *prev = NULL; struct list_head *cur; int ret = 0; list_for_each(cur, &hole_list) { hole = list_entry(cur, struct hole, list); if(!prev) { prev = hole; continue; } if(hole->end == prev->start) { hole->size += prev->size; hole->end = prev->end; list_del(&(prev->list)); list_add(&(prev->list), &hole_cache); ret++; } } return ret; } static inline struct hole *rmcache(void) { struct hole *ret; if(list_empty(&hole_cache)) { if(!refill()) { printk("out of dvma hole cache!\n"); BUG(); } } ret = list_entry(hole_cache.next, struct hole, list); list_del(&(ret->list)); return ret; } static inline unsigned long get_baddr(int len, unsigned long align) { struct list_head *cur; struct hole *hole; if(list_empty(&hole_list)) { printk("out of dvma holes!\n"); BUG(); } list_for_each(cur, &hole_list) { unsigned long newlen; hole = list_entry(cur, struct hole, list); if(align > DVMA_PAGE_SIZE) newlen = len + ((hole->end - len) & (align-1)); else newlen = len; if(hole->size > newlen) { hole->end -= newlen; hole->size -= newlen; dvma_entry_use(hole->end) = newlen; return hole->end; } else if(hole->size == newlen) { list_del(&(hole->list)); list_add(&(hole->list), &hole_cache); dvma_entry_use(hole->start) = newlen; return hole->start; } } printk("unable to find dvma hole!\n"); BUG(); return 0; } static inline int free_baddr(unsigned long baddr) { unsigned long len; struct hole *hole; struct list_head *cur; unsigned long orig_baddr; orig_baddr = baddr; len = dvma_entry_use(baddr); dvma_entry_use(baddr) = 0; baddr &= DVMA_PAGE_MASK; dvma_unmap_iommu(baddr, len); list_for_each(cur, &hole_list) { hole = list_entry(cur, struct hole, list); if(hole->end == baddr) { hole->end += len; hole->size += len; return 0; } else if(hole->start == (baddr + len)) { hole->start = baddr; hole->size += len; return 0; } } hole = rmcache(); hole->start = baddr; hole->end = baddr + len; hole->size = len; // list_add_tail(&(hole->list), cur); list_add(&(hole->list), cur); return 0; } void dvma_init(void) { struct hole *hole; int i; INIT_LIST_HEAD(&hole_list); INIT_LIST_HEAD(&hole_cache); /* prepare the hole cache */ for(i = 0; i < 64; i++) list_add(&(initholes[i].list), &hole_cache); hole = rmcache(); hole->start = DVMA_START; hole->end = DVMA_END; hole->size = DVMA_SIZE; list_add(&(hole->list), &hole_list); memset(iommu_use, 0, sizeof(iommu_use)); dvma_unmap_iommu(DVMA_START, DVMA_SIZE); #ifdef CONFIG_SUN3 sun3_dvma_init(); #endif } inline unsigned long dvma_map_align(unsigned long kaddr, int len, int align) { unsigned long baddr; unsigned long off; if(!len) len = 0x800; if(!kaddr || !len) { // printk("error: kaddr %lx len %x\n", kaddr, len); // *(int *)4 = 0; return 0; } #ifdef DEBUG printk("dvma_map request %08lx bytes from %08lx\n", len, kaddr); #endif off = kaddr & ~DVMA_PAGE_MASK; kaddr &= PAGE_MASK; len += off; len = ((len + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK); if(align == 0) align = DVMA_PAGE_SIZE; else align = ((align + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK); baddr = get_baddr(len, align); // printk("using baddr %lx\n", baddr); if(!dvma_map_iommu(kaddr, baddr, len)) return (baddr + off); printk("dvma_map failed kaddr %lx baddr %lx len %x\n", kaddr, baddr, len); BUG(); return 0; } void dvma_unmap(void *baddr) { free_baddr((unsigned long)baddr); return; } void *dvma_malloc_align(unsigned long len, unsigned long align) { unsigned long kaddr; unsigned long baddr; unsigned long vaddr; if(!len) return NULL; #ifdef DEBUG printk("dvma_malloc request %lx bytes\n", len); #endif len = ((len + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK); if((kaddr = __get_free_pages(GFP_ATOMIC, get_order(len))) == 0) return NULL; if((baddr = (unsigned long)dvma_map_align(kaddr, len, align)) == 0) { free_pages(kaddr, get_order(len)); return NULL; } vaddr = dvma_btov(baddr); if(dvma_map_cpu(kaddr, vaddr, len) < 0) { dvma_unmap((void *)baddr); free_pages(kaddr, get_order(len)); return NULL; } #ifdef DEBUG printk("mapped %08lx bytes %08lx kern -> %08lx bus\n", len, kaddr, baddr); #endif return (void *)vaddr; } void dvma_free(void *vaddr) { return; } Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:42:22 -0000 1.1.1.1 +++ Makefile 10 Apr 2002 14:34:37 -0000 1.2 @@ -14,7 +14,9 @@ export-objs := sun3_ksyms.o -obj-y := config.o idprom.o mmu_emu.o sun3ints.o leds.o dvma.o \ - sbus.o intersil.o sun3_ksyms.o +obj-y := sun3_ksyms.o sun3ints.o sun3dvma.o sbus.o + +obj-$(CONFIG_SUN3) += config.o idprom.o mmu_emu.o leds.o dvma.o \ + intersil.o include $(TOPDIR)/Rules.make Index: config.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/config.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- config.c 14 Jan 2001 19:42:23 -0000 1.1.1.1 +++ config.c 10 Apr 2002 14:34:37 -0000 1.2 @@ -8,13 +8,10 @@ * for more details. */ -#include <stdarg.h> - #include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/kd.h> #include <linux/tty.h> #include <linux/console.h> #include <linux/init.h> @@ -27,10 +24,12 @@ #include <asm/pgtable.h> #include <asm/sun3-head.h> #include <asm/sun3mmu.h> +#include <asm/rtc.h> #include <asm/machdep.h> #include <asm/intersil.h> #include <asm/irq.h> #include <asm/segment.h> +#include <asm/sun3ints.h> extern char _text, _end; @@ -39,15 +38,6 @@ extern unsigned long sun3_gettimeoffset(void); extern int sun3_get_irq_list (char *); extern void sun3_sched_init(void (*handler)(int, void *, struct pt_regs *)); -extern void sun3_init_IRQ (void); -extern void (*sun3_default_handler[]) (int, void *, struct pt_regs *); -extern int sun3_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), - unsigned long flags, const char *devname, void *dev_id); -extern void sun3_free_irq (unsigned int irq, void *dev_id); -extern void sun3_enable_irq (unsigned int); -extern void sun3_disable_irq (unsigned int); -extern void sun3_enable_interrupts (void); -extern void sun3_disable_interrupts (void); extern void sun3_get_model (char* model); extern void idprom_init (void); extern void sun3_gettod (int *yearp, int *monp, int *dayp, @@ -56,7 +46,7 @@ extern void sun_serial_setup(void); volatile char* clock_va; -extern unsigned char* sun3_intreg; +extern volatile unsigned char* sun3_intreg; extern unsigned long availmem; unsigned long num_pages; @@ -76,7 +66,7 @@ prom_init((void *)LINUX_OPPROM_BEGVM); GET_CONTROL_BYTE(AC_SENABLE,enable_register); - enable_register |= 0x40; /* Enable FPU */ + enable_register |= 0x50; /* Enable FPU */ SET_CONTROL_BYTE(AC_SENABLE,enable_register); GET_CONTROL_BYTE(AC_SENABLE,enable_register); @@ -154,6 +144,7 @@ // mach_keyb_init = sun3_keyb_init; enable_irq = sun3_enable_irq; disable_irq = sun3_disable_irq; + mach_process_int = sun3_process_int; mach_get_irq_list = sun3_get_irq_list; mach_gettod = sun3_gettod; mach_reset = sun3_reboot; @@ -161,7 +152,7 @@ mach_get_model = sun3_get_model; mach_hwclk = sun3_hwclk; mach_halt = sun3_halt; -#ifndef CONFIG_SERIAL_CONSOLE +#if !defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_FB) conswitchp = &dummy_con; #endif Index: dvma.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/dvma.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- dvma.c 14 Jan 2001 19:42:23 -0000 1.1.1.1 +++ dvma.c 10 Apr 2002 14:34:37 -0000 1.2 @@ -4,42 +4,62 @@ #include <linux/kernel.h> #include <linux/mm.h> #include <linux/bootmem.h> +#include <linux/list.h> #include <asm/page.h> #include <asm/pgtable.h> #include <asm/sun3mmu.h> #include <asm/dvma.h> -unsigned long dvma_next_free = DVMA_START; -unsigned long dvma_region_end = DVMA_START + (DVMA_RESERVED_PMEGS * SUN3_PMEG_SIZE); +static unsigned long ptelist[120]; -/* reserve such dma memory as we see fit */ -void sun3_dvma_init(void) +inline unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr) { - unsigned long dvma_phys_start; - - dvma_phys_start = (sun3_get_pte(DVMA_START) & - SUN3_PAGE_PGNUM_MASK); - dvma_phys_start <<= PAGE_SHIFT; + unsigned long pte; + unsigned long j; + pte_t ptep; - reserve_bootmem(dvma_phys_start, - (DVMA_RESERVED_PMEGS * SUN3_PMEG_SIZE)); + j = *(volatile unsigned long *)kaddr; + *(volatile unsigned long *)kaddr = j; -} + ptep = __mk_pte(kaddr, PAGE_KERNEL); + pte = pte_val(ptep); +// printk("dvma_remap: addr %lx -> %lx pte %08lx len %x\n", +// kaddr, vaddr, pte, len); + if(ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] != pte) { + sun3_put_pte(vaddr, pte); + ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] = pte; + } -/* get needed number of free dma pages, or panic if not enough */ + return (vaddr + (kaddr & ~PAGE_MASK)); -void *sun3_dvma_malloc(int len) +} + +int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, + int len) { + + unsigned long end; unsigned long vaddr; - if((dvma_next_free + len) > dvma_region_end) - panic("sun3_dvma_malloc: out of dvma pages"); + vaddr = dvma_btov(baddr); + + end = vaddr + len; - vaddr = dvma_next_free; - dvma_next_free = DVMA_ALIGN(dvma_next_free + len); + while(vaddr < end) { + dvma_page(kaddr, vaddr); + kaddr += PAGE_SIZE; + vaddr += PAGE_SIZE; + } + + return 0; - return (void *)vaddr; } - +void sun3_dvma_init(void) +{ + + memset(ptelist, 0, sizeof(ptelist)); + + +} Index: idprom.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/idprom.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: intersil.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/intersil.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- intersil.c 14 Jan 2001 19:42:26 -0000 1.1.1.1 +++ intersil.c 10 Apr 2002 14:34:37 -0000 1.2 @@ -11,9 +11,9 @@ */ #include <linux/kernel.h> -#include <linux/kd.h> #include <asm/system.h> +#include <asm/rtc.h> #include <asm/intersil.h> @@ -30,7 +30,7 @@ void sun3_gettod (int *yearp, int *monp, int *dayp, int *hourp, int *minp, int *secp) { - u_char wday; + unsigned char wday; volatile struct intersil_dt* todintersil; unsigned long flags; Index: mmu_emu.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/mmu_emu.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- mmu_emu.c 14 Jan 2001 19:42:26 -0000 1.1.1.1 +++ mmu_emu.c 10 Apr 2002 14:34:37 -0000 1.2 @@ -29,6 +29,7 @@ extern void prom_reboot (char *) __attribute__ ((__noreturn__)); #undef DEBUG_MMU_EMU +#define DEBUG_PROM_MAPS /* ** Defines @@ -157,9 +158,12 @@ j = 0; for (num=0, seg=0x0F800000; seg<0x10000000; seg+=16*PAGE_SIZE) { if (sun3_get_segmap (seg) != SUN3_INVALID_PMEG) { -#ifdef DEBUG_MMU_EMU - printk ("mapped:"); - print_pte_vaddr (seg); +#ifdef DEBUG_PROM_MAPS + for(i = 0; i < 16; i++) { + printk ("mapped:"); + print_pte_vaddr (seg + (i*PAGE_SIZE)); + break; + } #endif // the lowest mapping here is the end of our // vmalloc region @@ -174,7 +178,7 @@ } - sun3_dvma_init(); + dvma_init(); /* blank everything below the kernel, and we've got the base Index: sbus.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/sbus.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- sbus.c 14 Jan 2001 19:42:26 -0000 1.1.1.1 +++ sbus.c 10 Apr 2002 14:34:37 -0000 1.2 @@ -12,8 +12,12 @@ #include <linux/types.h> #include <linux/init.h> +extern void rs_init(void); + void __init sbus_init(void) { + + rs_init(); } Index: sun3_ksyms.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/sun3_ksyms.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- sun3_ksyms.c 14 Jan 2001 19:42:26 -0000 1.1.1.1 +++ sun3_ksyms.c 10 Apr 2002 14:34:37 -0000 1.2 @@ -6,5 +6,8 @@ /* * Add things here when you find the need for it. */ -EXPORT_SYMBOL(sun3_dvma_malloc); +EXPORT_SYMBOL(dvma_map_align); +EXPORT_SYMBOL(dvma_unmap); +EXPORT_SYMBOL(dvma_malloc_align); +EXPORT_SYMBOL(dvma_free); EXPORT_SYMBOL(idprom); Index: sun3ints.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/sun3ints.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- sun3ints.c 14 Jan 2001 19:42:26 -0000 1.1.1.1 +++ sun3ints.c 10 Apr 2002 14:34:37 -0000 1.2 @@ -1,5 +1,5 @@ /* - * linux/arch/m68k/sun3/sun3ints.c -- Sun-3 Linux interrupt handling code + * linux/arch/m68k/sun3/sun3ints.c -- Sun-3(x) Linux interrupt handling code * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive @@ -35,7 +35,7 @@ ~(0x10), ~(0x08) }; -unsigned char* sun3_intreg; +volatile unsigned char* sun3_intreg; void sun3_insert_irq(irq_node_t **list, irq_node_t *node) { @@ -45,10 +45,6 @@ { } -void sun3_free_irq(unsigned int irq, void *dev_id) -{ -} - void sun3_enable_irq(unsigned int irq) { *sun3_intreg |= (1<<irq); @@ -71,41 +67,54 @@ return 0; } +static void sun3_int7(int irq, void *dev_id, struct pt_regs *fp) +{ + sun3_do_irq(irq,fp); + if(!(kstat.irqs[0][SYS_IRQS + irq] % 2000)) + sun3_leds(led_pattern[(kstat.irqs[0][SYS_IRQS+irq]%16000)/2000]); +} + static void sun3_int5(int irq, void *dev_id, struct pt_regs *fp) { kstat.irqs[0][SYS_IRQS + irq]++; - *sun3_intreg &= ~(1<<irq); +#ifdef CONFIG_SUN3 intersil_clear(); +#endif + *sun3_intreg &= ~(1<<irq); *sun3_intreg |= (1<<irq); +#ifdef CONFIG_SUN3 + intersil_clear(); +#endif do_timer(fp); if(!(kstat.irqs[0][SYS_IRQS + irq] % 20)) sun3_leds(led_pattern[(kstat.irqs[0][SYS_IRQS+irq]%160) /20]); } -static void sun3_int7(int irq, void *dev_id, struct pt_regs *fp) -{ - sun3_do_irq(irq,fp); - if(!(kstat.irqs[0][SYS_IRQS + irq] % 2000)) - sun3_leds(led_pattern[(kstat.irqs[0][SYS_IRQS+irq]%16000)/2000]); -} - /* handle requested ints, excepting 5 and 7, which always do the same thing */ static void *dev_ids[SYS_IRQS]; -static void (*inthandler[SYS_IRQS])(int, void *, struct pt_regs *) = { +static void (*sun3_inthandler[SYS_IRQS])(int, void *, struct pt_regs *) = { NULL, NULL, NULL, NULL, NULL, sun3_int5, NULL, sun3_int7 }; +static void (*sun3_vechandler[192])(int, void *, struct pt_regs *); +static void *vec_ids[192]; +static char *vec_names[192]; static void sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp) { - if(inthandler[irq] == NULL) + if(sun3_inthandler[irq] == NULL) panic ("bad interrupt %d received (id %p)\n",irq, dev_id); kstat.irqs[0][SYS_IRQS + irq]++; *sun3_intreg &= ~(1<<irq); - inthandler[irq](irq, dev_ids[irq], fp); + sun3_inthandler[irq](irq, dev_ids[irq], fp); +} + +static void sun3_vec255(int irq, void *dev_id, struct pt_regs *fp) +{ +// intersil_clear(); } void (*sun3_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = { @@ -120,6 +129,8 @@ { int i; + *sun3_intreg = 1; + for(i = 0; i < SYS_IRQS; i++) { if(dev_names[i]) @@ -127,25 +138,94 @@ 0, dev_names[i], NULL); } + for(i = 0; i < 192; i++) + sun3_vechandler[i] = NULL; + + sun3_vechandler[191] = sun3_vec255; } int sun3_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id) { - if(inthandler[irq] != NULL) { - printk("sun3_request_irq: request for irq %d -- already taken!\n", irq); - return -1; - } - inthandler[irq] = handler; - dev_ids[irq] = dev_id; - dev_names[irq] = devname; + if(irq < SYS_IRQS) { + if(sun3_inthandler[irq] != NULL) { + printk("sun3_request_irq: request for irq %d -- already taken!\n", irq); + return 1; + } + + sun3_inthandler[irq] = handler; + dev_ids[irq] = dev_id; + dev_names[irq] = devname; + + /* setting devname would be nice */ + sys_request_irq(irq, sun3_default_handler[irq], 0, devname, NULL); + + return 0; + } else { + if((irq >= 64) && (irq <= 255)) { + int vec; + + vec = irq - 64; + if(sun3_vechandler[vec] != NULL) { + printk("sun3_request_irq: request for vec %d -- already taken!\n", irq); + return 1; + } + + sun3_vechandler[vec] = handler; + vec_ids[vec] = dev_id; + vec_names[vec] = devname; + + return 0; + } + } - /* setting devname would be nice */ - - sys_request_irq(irq, sun3_default_handler[irq], 0, devname, NULL); - + printk("sun3_request_irq: invalid irq %d\n", irq); + return 1; - return 0; } +void sun3_free_irq(unsigned int irq, void *dev_id) +{ + + if(irq < SYS_IRQS) { + if(sun3_inthandler[irq] == NULL) + panic("sun3_free_int: attempt to free unused irq %d\n", irq); + if(dev_ids[irq] != dev_id) + panic("sun3_free_int: incorrect dev_id for irq %d\n", irq); + + sun3_inthandler[irq] = NULL; + return; + } else if((irq >= 64) && (irq <= 255)) { + int vec; + + vec = irq - 64; + if(sun3_vechandler[vec] == NULL) + panic("sun3_free_int: attempt to free unused vector %d\n", irq); + if(vec_ids[irq] != dev_id) + panic("sun3_free_int: incorrect dev_id for vec %d\n", irq); + + sun3_vechandler[vec] = NULL; + return; + } else { + panic("sun3_free_irq: invalid irq %d\n", irq); + } +} + +void sun3_process_int(int irq, struct pt_regs *regs) +{ + + if((irq >= 64) && (irq <= 255)) { + int vec; + + vec = irq - 64; + if(sun3_vechandler[vec] == NULL) + panic ("bad interrupt vector %d received\n",irq); + + sun3_vechandler[vec](irq, vec_ids[vec], regs); + return; + } else { + panic("sun3_process_int: unable to handle interrupt vector %d\n", + irq); + } +} |