diff options
| author | Richard Henderson <rth@are.twiddle.net> | 2002-02-28 08:27:27 -0800 |
|---|---|---|
| committer | Richard Henderson <rth@are.twiddle.net> | 2002-02-28 08:27:27 -0800 |
| commit | 4c7fefc3a448c3021ffa6b2eb4ba340b4168653a (patch) | |
| tree | 01e5b8f0f133542b641891d3e3f52f52e1ca650a /include | |
| parent | 083b4c0e866ab0a577a26f23c5bf80f554917fa4 (diff) | |
| parent | c39e9205e9c097cfa94117a2e452957d2ce03c9e (diff) | |
Merge are.twiddle.net:/home/rth/BK/linus-2.5
into are.twiddle.net:/home/rth/BK/axp-2.5
Diffstat (limited to 'include')
88 files changed, 921 insertions, 952 deletions
diff --git a/include/asm-arm/arch-adifcc/irq.h b/include/asm-arm/arch-adifcc/irq.h deleted file mode 100644 index 9477252c7971..000000000000 --- a/include/asm-arm/arch-adifcc/irq.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * linux/include/asm-arm/arch-adifcc/irq.h - * - * Copyright (C) 2001 MontaVista Software, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#define fixup_irq(irq) (irq) - - diff --git a/include/asm-arm/arch-adifcc/irqs.h b/include/asm-arm/arch-adifcc/irqs.h index fc390753716a..b559ca79ef80 100644 --- a/include/asm-arm/arch-adifcc/irqs.h +++ b/include/asm-arm/arch-adifcc/irqs.h @@ -18,11 +18,3 @@ #define NR_IRQS NR_XS80200_IRQS #define IRQ_XSCALE_PMU IRQ_XS80200_PMU - -#ifdef CONFIG_XSCALE_ADI_EVB - -/* Interrupts available on the ADI Eval Board */ - -#endif - - diff --git a/include/asm-arm/arch-anakin/irq.h b/include/asm-arm/arch-anakin/irq.h deleted file mode 100644 index e31ec96b1cad..000000000000 --- a/include/asm-arm/arch-anakin/irq.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * linux/include/asm-arm/arch-anakin/irq.h - * - * Copyright (C) 2001 Aleph One Ltd. for Acunia N.V. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Changelog: - * 10-Apr-2001 TTC Created - */ - -#ifndef __ASM_ARCH_IRQ_H -#define __ASM_ARCH_IRQ_H - -#define fixup_irq(i) i - -#endif diff --git a/include/asm-arm/arch-anakin/time.h b/include/asm-arm/arch-anakin/time.h index 88d1c6efee1e..68f92de7a87d 100644 --- a/include/asm-arm/arch-anakin/time.h +++ b/include/asm-arm/arch-anakin/time.h @@ -24,7 +24,7 @@ void __init time_init(void) { timer_irq.handler = anakin_timer_interrupt; timer_irq.flags = SA_INTERRUPT; - setup_arm_irq(IRQ_TICK, &timer_irq); + setup_irq(IRQ_TICK, &timer_irq); } #endif diff --git a/include/asm-arm/arch-arc/irq.h b/include/asm-arm/arch-arc/irq.h deleted file mode 100644 index 4951c6995168..000000000000 --- a/include/asm-arm/arch-arc/irq.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * linux/include/asm-arm/arch-arc/irq.h - * - * Copyright (C) 1996 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#define fixup_irq(x) (x) diff --git a/include/asm-arm/arch-arc/time.h b/include/asm-arm/arch-arc/time.h index 394bb5388614..6d980227fc6c 100644 --- a/include/asm-arm/arch-arc/time.h +++ b/include/asm-arm/arch-arc/time.h @@ -30,5 +30,5 @@ void __init time_init(void) timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_TIMER, &timer_irq); + setup_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-cl7500/time.h b/include/asm-arm/arch-cl7500/time.h index a63ea1e75dc4..adf3096e85da 100644 --- a/include/asm-arm/arch-cl7500/time.h +++ b/include/asm-arm/arch-cl7500/time.h @@ -37,5 +37,5 @@ void __init time_init(void) timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_TIMER, &timer_irq); + setup_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-clps711x/irq.h b/include/asm-arm/arch-clps711x/irq.h deleted file mode 100644 index 7dde5e3f7096..000000000000 --- a/include/asm-arm/arch-clps711x/irq.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * linux/include/asm-arm/arch-clps711x/irq.h - * - * Copyright (C) 2000 Deep Blue Solutions Ltd. - * - * 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#define fixup_irq(i) (i) diff --git a/include/asm-arm/arch-clps711x/time.h b/include/asm-arm/arch-clps711x/time.h index d6040c294439..635356dd62b0 100644 --- a/include/asm-arm/arch-clps711x/time.h +++ b/include/asm-arm/arch-clps711x/time.h @@ -39,5 +39,5 @@ void __init time_init(void) { clps711x_setup_timer(); timer_irq.handler = p720t_timer_interrupt; - setup_arm_irq(IRQ_TC2OI, &timer_irq); + setup_irq(IRQ_TC2OI, &timer_irq); } diff --git a/include/asm-arm/arch-ebsa110/irq.h b/include/asm-arm/arch-ebsa110/irq.h deleted file mode 100644 index 4d83d1aaf7aa..000000000000 --- a/include/asm-arm/arch-ebsa110/irq.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * linux/include/asm-arm/arch-ebsa110/irq.h - * - * Copyright (C) 1996-1998 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Changelog: - * 22-08-1998 RMK Restructured IRQ routines - */ -#define fixup_irq(i) (i) diff --git a/include/asm-arm/arch-ebsa110/time.h b/include/asm-arm/arch-ebsa110/time.h index b1bab596e9dc..278c8e3632a1 100644 --- a/include/asm-arm/arch-ebsa110/time.h +++ b/include/asm-arm/arch-ebsa110/time.h @@ -39,7 +39,7 @@ void __init time_init(void) timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_EBSA110_TIMER0, &timer_irq); + setup_irq(IRQ_EBSA110_TIMER0, &timer_irq); } diff --git a/include/asm-arm/arch-ebsa285/irq.h b/include/asm-arm/arch-ebsa285/irq.h deleted file mode 100644 index a843e992f28c..000000000000 --- a/include/asm-arm/arch-ebsa285/irq.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * linux/include/asm-arm/arch-ebsa285/irq.h - * - * Copyright (C) 1996-1998 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Changelog: - * 22-Aug-1998 RMK Restructured IRQ routines - * 03-Sep-1998 PJB Merged CATS support - * 20-Jan-1998 RMK Started merge of EBSA286, CATS and NetWinder - * 26-Jan-1999 PJB Don't use IACK on CATS - * 16-Mar-1999 RMK Added autodetect of ISA PICs - */ -#include <asm/hardware.h> -#include <asm/hardware/dec21285.h> -#include <asm/irq.h> -#include <asm/mach-types.h> - -int isa_irq = -1; - -static inline int fixup_irq(unsigned int irq) -{ -#ifdef PCIIACK_BASE - if (irq == isa_irq) - irq = *(unsigned char *)PCIIACK_BASE; -#endif - - return irq; -} - diff --git a/include/asm-arm/arch-ebsa285/time.h b/include/asm-arm/arch-ebsa285/time.h index 111bf6e306d8..7b40c671daad 100644 --- a/include/asm-arm/arch-ebsa285/time.h +++ b/include/asm-arm/arch-ebsa285/time.h @@ -270,5 +270,5 @@ void __init time_init(void) timer_irq.handler = isa_timer_interrupt; irq = IRQ_ISA_TIMER; } - setup_arm_irq(irq, &timer_irq); + setup_irq(irq, &timer_irq); } diff --git a/include/asm-arm/arch-epxa10db/irq.h b/include/asm-arm/arch-epxa10db/irq.h deleted file mode 100644 index a6c3f3adbb5b..000000000000 --- a/include/asm-arm/arch-epxa10db/irq.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * linux/include/asm-arm/arch-epxa10/irq.h - * - * Copyright (C) 1999 ARM Limited - * - * 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#define fixup_irq(i) (i) diff --git a/include/asm-arm/arch-epxa10db/time.h b/include/asm-arm/arch-epxa10db/time.h index 7f0e6a7c0d00..a025bbe65626 100644 --- a/include/asm-arm/arch-epxa10db/time.h +++ b/include/asm-arm/arch-epxa10db/time.h @@ -48,7 +48,7 @@ void __init time_init(void) /* * Make irqs happen for the system timer */ - setup_arm_irq(IRQ_TIMER0, &timer_irq); + setup_irq(IRQ_TIMER0, &timer_irq); /* Start the timer */ *TIMER0_LIMIT(IO_ADDRESS(EXC_TIMER00_BASE))=(unsigned int)(EXC_AHB2_CLK_FREQUENCY/200); diff --git a/include/asm-arm/arch-epxa10db/uncompress.h b/include/asm-arm/arch-epxa10db/uncompress.h index 0b037724249c..f30a31fa5270 100644 --- a/include/asm-arm/arch-epxa10db/uncompress.h +++ b/include/asm-arm/arch-epxa10db/uncompress.h @@ -29,14 +29,18 @@ static void puts(const char *s) { while (*s) { - while ((*UART_TSR(IO_ADDRESS(EXC_UART00_BASE)) & UART_TSR_TX_LEVEL_MSK)==15); + while ((*UART_TSR(EXC_UART00_BASE) & + UART_TSR_TX_LEVEL_MSK)==15) + barrier(); - *UART_TD(IO_ADDRESS(EXC_UART00_BASE)) = *s; + *UART_TD(EXC_UART00_BASE) = *s; if (*s == '\n') { - while ((*UART_TSR(IO_ADDRESS(EXC_UART00_BASE)) & UART_TSR_TX_LEVEL_MSK)==15); + while ((*UART_TSR(EXC_UART00_BASE) & + UART_TSR_TX_LEVEL_MSK)==15) + barrier(); - *UART_TD(IO_ADDRESS(EXC_UART00_BASE)) = '\r'; + *UART_TD(EXC_UART00_BASE) = '\r'; } s++; } diff --git a/include/asm-arm/arch-integrator/irq.h b/include/asm-arm/arch-integrator/irq.h deleted file mode 100644 index c07c83cf8e0f..000000000000 --- a/include/asm-arm/arch-integrator/irq.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * linux/include/asm-arm/arch-integrator/irq.h - * - * Copyright (C) 1999 ARM Limited - * - * 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#define fixup_irq(i) (i) diff --git a/include/asm-arm/arch-integrator/time.h b/include/asm-arm/arch-integrator/time.h index 40b48370c692..6ed75675387e 100644 --- a/include/asm-arm/arch-integrator/time.h +++ b/include/asm-arm/arch-integrator/time.h @@ -135,6 +135,6 @@ void __init time_init(void) /* * Make irqs happen for the system timer */ - setup_arm_irq(IRQ_TIMERINT1, &timer_irq); + setup_irq(IRQ_TIMERINT1, &timer_irq); gettimeoffset = integrator_gettimeoffset; } diff --git a/include/asm-arm/arch-iop310/irq.h b/include/asm-arm/arch-iop310/irq.h deleted file mode 100644 index 33c0866c1275..000000000000 --- a/include/asm-arm/arch-iop310/irq.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * linux/include/asm-arm/arch-iop80310/irq.h - * - * Copyright (C) 2001 MontaVista Software, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#define fixup_irq(irq) (irq) - - diff --git a/include/asm-arm/arch-l7200/irq.h b/include/asm-arm/arch-l7200/irq.h deleted file mode 100644 index c605a8c28698..000000000000 --- a/include/asm-arm/arch-l7200/irq.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * include/asm-arm/arch-l7200/irq.h - * - * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.ne - * Steve Hill (sjhill@cotw.com) - * - * Changelog: - * 01-02-2000 RS Created l7200 version, derived from ebsa110 code - * 04-15-2000 RS Made dependent on hardware.h - * 05-05-2000 SJH Complete rewrite - */ -#define fixup_irq(x) (x) diff --git a/include/asm-arm/arch-l7200/time.h b/include/asm-arm/arch-l7200/time.h index 27a872c63f01..727c32a96a89 100644 --- a/include/asm-arm/arch-l7200/time.h +++ b/include/asm-arm/arch-l7200/time.h @@ -58,7 +58,7 @@ void __init time_init(void) timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_RTC_TICK, &timer_irq); + setup_irq(IRQ_RTC_TICK, &timer_irq); RTC_RTCCR = RTC_RATE_128 | RTC_EN_TIC; /* Set rate and enable timer */ } diff --git a/include/asm-arm/arch-nexuspci/irq.h b/include/asm-arm/arch-nexuspci/irq.h deleted file mode 100644 index 4690e88438bb..000000000000 --- a/include/asm-arm/arch-nexuspci/irq.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * include/asm-arm/arch-nexuspci/irq.h - * - * Copyright (C) 1998, 1999, 2000 Philip Blundell - */ - -/* - * 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. - */ -#define fixup_irq(x) (x) - diff --git a/include/asm-arm/arch-nexuspci/time.h b/include/asm-arm/arch-nexuspci/time.h index ba453c17637e..ba09e7bb3ee9 100644 --- a/include/asm-arm/arch-nexuspci/time.h +++ b/include/asm-arm/arch-nexuspci/time.h @@ -55,5 +55,5 @@ void __init time_init(void) timer_irq.handler = timer_interrupt; timer_irq.flags = SA_SHIRQ; - setup_arm_irq(IRQ_TIMER, &timer_irq); + setup_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-rpc/irq.h b/include/asm-arm/arch-rpc/irq.h deleted file mode 100644 index 4446afbb29a4..000000000000 --- a/include/asm-arm/arch-rpc/irq.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * linux/include/asm-arm/arch-rpc/irq.h - * - * Copyright (C) 1996 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Changelog: - * 10-10-1996 RMK Brought up to date with arch-sa110eval - * 22-08-1998 RMK Restructured IRQ routines - */ -#define fixup_irq(x) (x) diff --git a/include/asm-arm/arch-rpc/time.h b/include/asm-arm/arch-rpc/time.h index 4fa255bc6fc7..189595c68fce 100644 --- a/include/asm-arm/arch-rpc/time.h +++ b/include/asm-arm/arch-rpc/time.h @@ -30,5 +30,5 @@ void __init time_init(void) timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_TIMER, &timer_irq); + setup_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-sa1100/assabet.h b/include/asm-arm/arch-sa1100/assabet.h index f9df2064573d..35754657b1e3 100644 --- a/include/asm-arm/arch-sa1100/assabet.h +++ b/include/asm-arm/arch-sa1100/assabet.h @@ -62,7 +62,7 @@ extern unsigned long SCR_value; #ifdef CONFIG_SA1100_ASSABET extern void ASSABET_BCR_frob(unsigned int mask, unsigned int set); #else -#define ASSABET_BCR_frob(x) do { } while (0) +#define ASSABET_BCR_frob(x,y) do { } while (0) #endif #define ASSABET_BCR_set(x) ASSABET_BCR_frob((x), (x)) diff --git a/include/asm-arm/arch-sa1100/badge4.h b/include/asm-arm/arch-sa1100/badge4.h new file mode 100644 index 000000000000..5d9177fa7837 --- /dev/null +++ b/include/asm-arm/arch-sa1100/badge4.h @@ -0,0 +1,74 @@ +/* + * linux/include/asm-arm/arch-sa1100/badge4.h + * + * Tim Connors <connors@hpl.hp.com> + * Christopher Hoover <ch@hpl.hp.com> + * + * Copyright (C) 2002 Hewlett-Packard Company + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef __ASM_ARCH_HARDWARE_H +#error "include <asm/hardware.h> instead" +#endif + +#define BADGE4_SA1111_BASE (0x48000000) + +/* GPIOs on the BadgePAD 4 */ +#define BADGE4_GPIO_INT_1111 GPIO_GPIO0 /* SA-1111 IRQ */ + +#define BADGE4_GPIO_INT_VID GPIO_GPIO1 /* Video expansion */ +#define BADGE4_GPIO_LGP2 GPIO_GPIO2 /* GPIO_LDD8 */ +#define BADGE4_GPIO_LGP3 GPIO_GPIO3 /* GPIO_LDD9 */ +#define BADGE4_GPIO_LGP4 GPIO_GPIO4 /* GPIO_LDD10 */ +#define BADGE4_GPIO_LGP5 GPIO_GPIO5 /* GPIO_LDD11 */ +#define BADGE4_GPIO_LGP6 GPIO_GPIO6 /* GPIO_LDD12 */ +#define BADGE4_GPIO_LGP7 GPIO_GPIO7 /* GPIO_LDD13 */ +#define BADGE4_GPIO_LGP8 GPIO_GPIO8 /* GPIO_LDD14 */ +#define BADGE4_GPIO_LGP9 GPIO_GPIO9 /* GPIO_LDD15 */ +#define BADGE4_GPIO_GPA_VID GPIO_GPIO10 /* Video expansion */ +#define BADGE4_GPIO_GPB_VID GPIO_GPIO11 /* Video expansion */ +#define BADGE4_GPIO_GPC_VID GPIO_GPIO12 /* Video expansion */ + +#define BADGE4_GPIO_UART_HS1 GPIO_GPIO13 +#define BADGE4_GPIO_UART_HS2 GPIO_GPIO14 + +#define BADGE4_GPIO_MUXSEL0 GPIO_GPIO15 +#define BADGE4_GPIO_TESTPT_J7 GPIO_GPIO16 + +#define BADGE4_GPIO_SDSDA GPIO_GPIO17 /* SDRAM SPD Data */ +#define BADGE4_GPIO_SDSCL GPIO_GPIO18 /* SDRAM SPD Clock */ +#define BADGE4_GPIO_SDTYP0 GPIO_GPIO19 /* SDRAM Type Control */ +#define BADGE4_GPIO_SDTYP1 GPIO_GPIO20 /* SDRAM Type Control */ + +#define BADGE4_GPIO_BGNT_1111 GPIO_GPIO21 /* GPIO_MBGNT */ +#define BADGE4_GPIO_BREQ_1111 GPIO_GPIO22 /* GPIO_TREQA */ + +#define BADGE4_GPIO_TESTPT_J6 GPIO_GPIO23 + +#define BADGE4_GPIO_PCMEN5V GPIO_GPIO24 /* 5V power */ + +#define BADGE4_GPIO_SA1111_NRST GPIO_GPIO25 /* SA-1111 nRESET */ + +#define BADGE4_GPIO_TESTPT_J5 GPIO_GPIO26 + +#define BADGE4_GPIO_CLK_1111 GPIO_GPIO27 /* GPIO_32_768kHz */ + +/* Interrupts on the BadgePAD 4 */ +#define BADGE4_IRQ_GPIO_SA1111 IRQ_GPIO0 /* SA-1111 interrupt */ + + +/* PCM5ENV Usage tracking */ + +#define BADGE4_5V_PCMCIA_SOCK0 (1<<0) +#define BADGE4_5V_PCMCIA_SOCK1 (1<<1) +#define BADGE4_5V_PCMCIA_SOCK(n) (1<<(n)) +#define BADGE4_5V_USB (1<<2) + +#ifndef __ASSEMBLY__ +extern void badge4_set_5V(unsigned subsystem, int on); +#endif diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index 8ed40e5eff31..af9ce59b8ab2 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h @@ -87,22 +87,6 @@ typedef struct { volatile u32 offset[4096]; } __regbase; #include "SA-1100.h" - -/* - * SA1100 GPIO edge detection for IRQs: - * IRQs are generated on Falling-Edge, Rising-Edge, or both. - * This must be called *before* the corresponding IRQ is registered. - * Use this instead of directly setting GRER/GFER. - */ -#define GPIO_NO_EDGES 0 -#define GPIO_FALLING_EDGE 1 -#define GPIO_RISING_EDGE 2 -#define GPIO_BOTH_EDGES 3 -#ifndef __ASSEMBLY__ -extern void set_GPIO_IRQ_edge( int gpio_mask, int edge_mask ); -#endif - - /* * Implementation specifics. * @@ -112,6 +96,8 @@ extern void set_GPIO_IRQ_edge( int gpio_mask, int edge_mask ); * ifdefs, and lots of other preprocessor gunk elsewhere. */ +#include "badge4.h" + #ifdef CONFIG_SA1100_PANGOLIN #include "pangolin.h" #endif @@ -179,6 +165,8 @@ extern void set_GPIO_IRQ_edge( int gpio_mask, int edge_mask ); #include "adsbitsy.h" #endif +#include "stork.h" + #include "system3.h" #ifdef CONFIG_SA1101 diff --git a/include/asm-arm/arch-sa1100/ide.h b/include/asm-arm/arch-sa1100/ide.h index 99d3d4bf7576..4db58c3c9588 100644 --- a/include/asm-arm/arch-sa1100/ide.h +++ b/include/asm-arm/arch-sa1100/ide.h @@ -113,7 +113,7 @@ ide_init_default_hwifs(void) /* Enable GPIO as interrupt line */ GPDR &= ~LART_GPIO_IDE; - set_GPIO_IRQ_edge(LART_GPIO_IDE, GPIO_RISING_EDGE); + set_irq_type(LART_IRQ_IDE, IRQT_RISING); /* set PCMCIA interface timing */ MECR = 0x00060006; diff --git a/include/asm-arm/arch-sa1100/irq.h b/include/asm-arm/arch-sa1100/irq.h deleted file mode 100644 index 56ae68a44e80..000000000000 --- a/include/asm-arm/arch-sa1100/irq.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * linux/include/asm-arm/arch-sa1100/irq.h - * - * Author: Nicolas Pitre - */ - -#define fixup_irq(x) (x) - -/* - * This prototype is required for cascading of multiplexed interrupts. - * Since it doesn't exist elsewhere, we'll put it here for now. - */ -extern void do_IRQ(int irq, struct pt_regs *regs); diff --git a/include/asm-arm/arch-sa1100/irqs.h b/include/asm-arm/arch-sa1100/irqs.h index cab7e59b1cd9..3105834da48c 100644 --- a/include/asm-arm/arch-sa1100/irqs.h +++ b/include/asm-arm/arch-sa1100/irqs.h @@ -148,6 +148,7 @@ */ #define IRQ_NEPONSET_SMC9196 (IRQ_BOARD_START + 0) #define IRQ_NEPONSET_USAR (IRQ_BOARD_START + 1) +#define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2) /* PT Digital Board Interrupts (CONFIG_SA1100_PT_SYSTEM3) */ #define IRQ_SYSTEM3_SMC9196 (IRQ_BOARD_START + 0) diff --git a/include/asm-arm/arch-sa1100/stork.h b/include/asm-arm/arch-sa1100/stork.h new file mode 100644 index 000000000000..91b3dbc5a30e --- /dev/null +++ b/include/asm-arm/arch-sa1100/stork.h @@ -0,0 +1,164 @@ +/* + stork.h + +*/ + +#ifndef STORK_SA1100_H +#define STORK_SA1100_H + +/* ugly - this will make sure we build sa1100fb for the Nec display not the Kyocera */ +#define STORK_TFT 1 + + +#define GPIO_STORK_SWITCH_1 (1 << 0) /* Switch 1 - input */ +#define GPIO_STORK_SWITCH_2 (1 << 1) /* Switch 2 - input */ +#define GPIO_STORK_TOUCH_SCREEN_BUSY (1 << 10) /* TOUCH_SCREEN_BUSY - input */ +#define GPIO_STORK_TOUCH_SCREEN_DATA (1 << 11) /* TOUCH_SCREEN_DATA - input */ +#define GPIO_STORK_CODEC_AGCSTAT (1 << 12) /* CODEC_AGCSTAT -input */ +#define GPIO_STORK_RS232_ON (1 << 13) /* enable RS232 (UART1) */ +#define GPIO_STORK_TEST_POINT (1 << 14) /* to test point */ +#define GPIO_STORK_L3_I2C_SDA (1 << 15) /* L3_I2C_SDA - bidirectional */ +#define GPIO_STORK_PSU_SYNC_MODE (1 << 16) /* PSU_SYNC_MODE - output */ +#define GPIO_STORK_L3_MODE (1 << 17) /* L3 mode - output (??) */ +#define GPIO_STORK_L3_I2C_SCL (1 << 18) /* L3_I2C_SCL - bidirectional */ +#define GPIO_STORK_AUDIO_CLK (1 << 19) /* SSP external clock (Audio clock) - input */ +#define GPIO_STORK_PCMCIA_A_CARD_DETECT (1 << 20) /* PCMCIA_A_CARD_DETECT - input */ +#define GPIO_STORK_PCMCIA_B_CARD_DETECT (1 << 21) /* PCMCIA_B_CARD_DETECT - input */ +#define GPIO_STORK_PCMCIA_A_RDY (1 << 22) /* PCMCIA_A_RDY - input */ +#define GPIO_STORK_PCMCIA_B_RDY (1 << 23) /* PCMCIA_B_RDY - input */ +#define GPIO_STORK_SWITCH_EXTRA_IRQ (1 << 24) /* Extra IRQ from switch detect logic - input */ +#define GPIO_STORK_SWITCH_IRQ (1 << 25) /* Sitch irq - input */ +#define GPIO_STORK_BATTERY_LOW_IRQ (1 << 26) /* BATTERY_LOW_IRQ - input */ +#define GPIO_STORK_TOUCH_SCREEN_PEN_IRQ (1 << 27) /* TOUCH_SCREEN_PEN_IRQ -input */ + +#define IRQ_GPIO_STORK_PCMCIA_A_CARD_DETECT IRQ_GPIO20 /* PCMCIA_A_CARD_DETECT - input */ +#define IRQ_GPIO_STORK_PCMCIA_B_CARD_DETECT IRQ_GPIO21 /* PCMCIA_B_CARD_DETECT - input */ + +#define IRQ_GPIO_STORK_SWITCH_1 IRQ_GPIO0 /* Switch 1 - input - active low */ +#define IRQ_GPIO_STORK_SWITCH_2 IRQ_GPIO1 /* Switch 2 - input - active low */ +#define IRQ_GPIO_STORK_SWITCH_EXTRA_IRQ IRQ_GPIO24 /* Extra IRQ from switch detect logic - input - active low */ +#define IRQ_GPIO_STORK_SWITCH_IRQ IRQ_GPIO25 /* Switch irq - input- active low */ +#define IRQ_GPIO_STORK_BATTERY_LOW_IRQ IRQ_GPIO26 /* BATTERY_LOW_IRQ - input - active low */ +#define IRQ_GPIO_STORK_TOUCH_SCREEN_PEN_IRQ IRQ_GPIO27 /* TOUCH_SCREEN_PEN_IRQ -input - goes low when it happens */ + +/* this may be bogus - no it's not the RDY line becomes the IRQ line when we're up as an IO device */ +#define IRQ_GPIO_STORK_PCMCIA_A_RDY IRQ_GPIO22 /* PCMCIA_A_RDY - input */ +#define IRQ_GPIO_STORK_PCMCIA_B_RDY IRQ_GPIO23 /* PCMCIA_B_RDY - input */ + +/* the default outputs, others are optional - I'll set these in the bootldr for now */ +#define GPIO_STORK_OUTPUT_BITS (GPIO_STORK_RS232_ON | GPIO_STORK_PSU_SYNC_MODE | GPIO_STORK_L3_MODE) + +#define STORK_LATCH_A_ADDR 0x08000000 /* cs1 A5 = 0 */ +#define STORK_LATCH_B_ADDR 0x08000020 /* cs1 A5 = 1 */ + +#define STORK_LCDCPLD_BASE_ADDR 0x10000000 /* cs2 A5 = 0 */ + +/* bit defs for latch A - these are write only and will need to be mirrored! */ + +#define STORK_TEMP_IC_POWER_ON (1 << 0) +#define STORK_SED1386_POWER_ON (1 << 1) +#define STORK_LCD_3V3_POWER_ON (1 << 2) +#define STORK_LCD_5V_POWER_ON (1 << 3) +#define STORK_LCD_BACKLIGHT_INVERTER_ON (1 << 4) +#define STORK_PCMCIA_PULL_UPS_POWER_ON (1 << 5) +#define STORK_PCMCIA_A_POWER_ON (1 << 6) +#define STORK_PCMCIA_B_POWER_ON (1 << 7) +#define STORK_AUDIO_POWER_ON (1 << 8) +#define STORK_AUDIO_AMP_ON (1 << 9) +#define STORK_BAR_CODE_POWER_ON (1 << 10) +#define STORK_BATTERY_CHARGER_ON (1 << 11) +#define STORK_SED1386_RESET (1 << 12) +#define STORK_IRDA_FREQUENCY_SELECT (1 << 13) +#define STORK_IRDA_MODE_0 (1 << 14) +#define STORK_IRDA_MODE_1 (1 << 15) + +/* and for B */ + +#define STORK_AUX_AD_SEL_0 (1 << 0) +#define STORK_AUX_AD_SEL_1 (1 << 1) +#define STORK_TOUCH_SCREEN_DCLK (1 << 2) +#define STORK_TOUCH_SCREEN_DIN (1 << 3) +#define STORK_TOUCH_SCREEN_CS (1 << 4) +#define STORK_DA_CS (1 << 5) +#define STORK_DA_LD (1 << 6) +#define STORK_RED_LED (1 << 7) /* active LOW */ +#define STORK_GREEN_LED (1 << 8) /* active LOW */ +#define STORK_YELLOW_LED (1 << 9) /* active LOW */ +#define STORK_PCMCIA_B_RESET (1 << 10) +#define STORK_PCMCIA_A_RESET (1 << 11) +#define STORK_AUDIO_CODEC_RESET (1 << 12) +#define STORK_CODEC_QMUTE (1 << 13) +#define STORK_AUDIO_CLOCK_SEL0 (1 << 14) +#define STORK_AUDIO_CLOCK_SEL1 (1 << 15) + + +/* + + There are 8 control bits in the touch screen controller (AD7873) + + S A2 A1 A0 MODE SER/DFR# PD1 PD0 + + S Start bit, always one. + A2 - A0 Channel select bits + MODE 0 => 12 bit resolution, 1 => 8 bit + SER/DFR# Single ender/Differential Reference Select bit + PD1, PD0 Power management bits (usually 10) + + +From Table 1. + + A2-A0 + + 0 Temp0 (SER must be 1) + 1 X+ (is this a typo? - is this X- really?) + 2 VBAT, + 3 read X+ (Z1), + 4 read Y- (Z2), 5 => read Y+, + +*/ + +#define AD7873_START 0x80 /* all commands need this to be set */ +#define AD7873_ADDR_BITS 4 /* ie shift by this */ +#define AD7873_8BITMODE 0x08 /* 0 => 12 bit convertions */ +#define AD7873_SER_DFR 0x04 +#define AD7873_PD1 0x02 +#define AD7873_PD0 0x01 + +#define AD7873_TEMP0 AD7873_SER_DFR +#define AD7873_X (1 << AD7873_ADDR_BITS) +#define AD7873_VBAT ((2 << AD7873_ADDR_BITS) | AD7873_SER_DFR) +#define AD7873_X_Z1 (3 << AD7873_ADDR_BITS) +#define AD7873_Y_Z2 (4 << AD7873_ADDR_BITS) +#define AD7873_Y (5 << AD7873_ADDR_BITS) +#define AD7873_AUX ((6 << AD7873_ADDR_BITS) | AD7873_SER_DFR) +#define AD7873_TEMP1 ((7 << AD7873_ADDR_BITS) | AD7873_SER_DFR) + +#ifndef __ASSEMBLY__ + +extern int storkSetLatchA(int bits); +extern int storkClearLatchA(int bits); + +extern int storkSetLatchB(int bits); +extern int storkClearLatchB(int bits); + +extern int storkSetLCDCPLD(int which, int bits); +extern int storkClearLCDCPLD(int which, int bits); + +extern void storkSetGPIO(int bits); +extern void storkClearGPIO(int bits); + +extern int storkGetGPIO(void); + +extern void storkClockShortToDtoA(int word); +extern int storkClockByteToTS(int byte); + + +/* this will return the current state of the hardware ANDED with the given bits + so NE => at least one bit was set, but maybe not all of them! */ + +extern int storkTestGPIO(int bits); + + +#endif + +#endif diff --git a/include/asm-arm/arch-sa1100/time.h b/include/asm-arm/arch-sa1100/time.h index 1f7dd3a84eba..5e459a32e8f8 100644 --- a/include/asm-arm/arch-sa1100/time.h +++ b/include/asm-arm/arch-sa1100/time.h @@ -98,7 +98,7 @@ void __init time_init(void) timer_irq.handler = sa1100_timer_interrupt; OSMR0 = 0; /* set initial match at 0 */ OSSR = 0xf; /* clear status on all timers */ - setup_arm_irq(IRQ_OST0, &timer_irq); + setup_irq(IRQ_OST0, &timer_irq); OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */ OSCR = 0; /* initialize free-running timer, force first match */ } diff --git a/include/asm-arm/arch-shark/hardware.h b/include/asm-arm/arch-shark/hardware.h index 5d75012c4660..f4f54113fd1c 100644 --- a/include/asm-arm/arch-shark/hardware.h +++ b/include/asm-arm/arch-shark/hardware.h @@ -38,7 +38,8 @@ /* defines for the Framebuffer */ -#define FB_START 0x06000000 +#define FB_START 0x06000000 +#define FB_SIZE 0x01000000 #define UNCACHEABLE_ADDR 0xdf010000 diff --git a/include/asm-arm/arch-shark/irq.h b/include/asm-arm/arch-shark/irq.h deleted file mode 100644 index ec5c9108be4d..000000000000 --- a/include/asm-arm/arch-shark/irq.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * linux/include/asm-arm/arch-shark/irq.h - * - * by Alexander Schulz - * - * derived from linux/arch/ppc/kernel/i8259.c and: - * include/asm-arm/arch-ebsa110/irq.h - * Copyright (C) 1996-1998 Russell King - */ -#define fixup_irq(x) (x) diff --git a/include/asm-arm/arch-shark/keyboard.h b/include/asm-arm/arch-shark/keyboard.h index 3d400663a304..52b5ed6e198a 100644 --- a/include/asm-arm/arch-shark/keyboard.h +++ b/include/asm-arm/arch-shark/keyboard.h @@ -29,7 +29,6 @@ extern unsigned char pckbd_sysrq_xlate[128]; static inline void kbd_init_hw(void) { - if (have_isa_bridge) { k_setkeycode = pckbd_setkeycode; k_getkeycode = pckbd_getkeycode; k_translate = pckbd_translate; @@ -40,7 +39,6 @@ static inline void kbd_init_hw(void) k_sysrq_xlate = pckbd_sysrq_xlate; #endif pckbd_init_hw(); - } } /* diff --git a/include/asm-arm/arch-shark/param.h b/include/asm-arm/arch-shark/param.h index fd18c5142ebb..3bb89b094e5b 100644 --- a/include/asm-arm/arch-shark/param.h +++ b/include/asm-arm/arch-shark/param.h @@ -4,9 +4,5 @@ * by Alexander Schulz */ -/* This must be a power of 2 because the RTC - * can't use anything else. - */ -#define HZ 64 +#define HZ 100 -#define hz_to_std(a) ((a * HZ)/100) diff --git a/include/asm-arm/arch-shark/time.h b/include/asm-arm/arch-shark/time.h index 3d5bd8c0ca3f..69f0001088d2 100644 --- a/include/asm-arm/arch-shark/time.h +++ b/include/asm-arm/arch-shark/time.h @@ -3,44 +3,21 @@ * * by Alexander Schulz * - * Uses the real time clock because you can't run - * the timer with level triggered interrupts and - * you can't run the shark with edge triggered - * inetrrupts (loses ints and hangs). - * - * derived from linux/drivers/char/rtc.c and: - * linux/include/asm-arm/arch-ebsa110/time.h + * derived from include/asm-arm/arch-ebsa110/time.h * Copyright (c) 1996,1997,1998 Russell King. */ #include <asm/leds.h> -#include <linux/mc146818rtc.h> - -#define IRQ_TIMER 8 +#include <asm/param.h> -extern void get_rtc_time(struct rtc_time *rtc_tm); -extern void set_rtc_irq_bit(unsigned char bit); -extern unsigned long epoch; +#define IRQ_TIMER 0 +#define HZ_TIME ((1193180 + HZ/2) / HZ) static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - - CMOS_READ(RTC_INTR_FLAGS); - do_leds(); - - { -#ifdef DIVISOR - static unsigned int divisor; - - if (divisor-- == 0) { - divisor = DIVISOR - 1; -#else - { -#endif - do_timer(regs); - } - } + do_timer(regs); + do_profile(regs); } /* @@ -48,38 +25,15 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) */ void __init time_init(void) { - struct rtc_time r_time; unsigned long flags; - int tmp = 0; - unsigned char val; - - /* - * Set the clock to 128 Hz, we already have a valid - * vector now: - */ - - while (HZ > (1<<tmp)) - tmp++; - - /* - * Check that the input was really a power of 2. - */ - if (HZ != (1<<tmp)) - panic("Please set HZ to a power of 2!"); - save_flags(flags); - cli(); - val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0; - val |= (16 - tmp); - CMOS_WRITE(val, RTC_FREQ_SELECT); - restore_flags(flags); - set_rtc_irq_bit(RTC_PIE); + outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */ + outb(HZ_TIME & 0xff, 0x40); /* LSB of count */ + outb(HZ_TIME >> 8, 0x40); - get_rtc_time(&r_time); - xtime.tv_sec = mktime(r_time.tm_year+epoch, r_time.tm_mon+1, r_time.tm_mday, - r_time.tm_hour, r_time.tm_min, r_time.tm_sec); + xtime.tv_sec = 0; timer_irq.handler = timer_interrupt; timer_irq.flags = SA_INTERRUPT; /* FIXME: really? */ - setup_arm_irq(IRQ_TIMER, &timer_irq); + setup_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-tbox/irq.h b/include/asm-arm/arch-tbox/irq.h deleted file mode 100644 index dd73ba7957d2..000000000000 --- a/include/asm-arm/arch-tbox/irq.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * include/asm-arm/arch-tbox/irq.h - * - * Copyright (C) 1998, 1999, 2000 Philip Blundell - */ - -/* - * 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. - */ -#define fixup_irq(x) (x) diff --git a/include/asm-arm/arch-tbox/time.h b/include/asm-arm/arch-tbox/time.h index fd0dab923422..e50e1bdb9af8 100644 --- a/include/asm-arm/arch-tbox/time.h +++ b/include/asm-arm/arch-tbox/time.h @@ -32,5 +32,5 @@ static void timer_interrupt (int irq, void *dev_id, struct pt_regs *regs) void __init time_init(void) { timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_TIMER, &timer_irq); + setup_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h index ecdd955a8381..c5c8a24a4566 100644 --- a/include/asm-arm/bitops.h +++ b/include/asm-arm/bitops.h @@ -327,6 +327,23 @@ static inline unsigned long __ffs(unsigned long word) #define ffs(x) generic_ffs(x) /* + * Find first bit set in a 168-bit bitmap, where the first + * 128 bits are unlikely to be set. + */ +static inline int sched_find_first_bit(unsigned long *b) +{ + if (unlikely(b[0])) + return __ffs(b[0]); + if (unlikely(b[1])) + return __ffs(b[1]) + 32; + if (unlikely(b[2])) + return __ffs(b[2]) + 64; + if (b[3]) + return __ffs(b[3]) + 96; + return __ffs(b[4]) + 128; +} + +/* * hweightN: returns the hamming weight (i.e. the number * of bits set) of a N-bit word */ diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h index c7ce093e2085..9db83322ea54 100644 --- a/include/asm-arm/cpu-multi32.h +++ b/include/asm-arm/cpu-multi32.h @@ -93,21 +93,6 @@ extern struct processor { void (*invalidate_page)(void *virt_page); } icache; - struct { /* TLB */ - /* - * flush all TLBs - */ - void (*invalidate_all)(void); - /* - * flush a specific TLB - */ - void (*invalidate_range)(unsigned long address, unsigned long end); - /* - * flush a specific TLB - */ - void (*invalidate_page)(unsigned long address, int flags); - } tlb; - struct { /* PageTable */ /* * Set the page table @@ -152,10 +137,6 @@ extern const struct processor sa110_processor_functions; #define cpu_icache_invalidate_range(s,e) processor.icache.invalidate_range(s,e) #define cpu_icache_invalidate_page(vp) processor.icache.invalidate_page(vp) -#define cpu_tlb_invalidate_all() processor.tlb.invalidate_all() -#define cpu_tlb_invalidate_range(s,e) processor.tlb.invalidate_range(s,e) -#define cpu_tlb_invalidate_page(vp,f) processor.tlb.invalidate_page(vp,f) - #define cpu_set_pgd(pgd) processor.pgtable.set_pgd(pgd) #define cpu_set_pmd(pmdp, pmd) processor.pgtable.set_pmd(pmdp, pmd) #define cpu_set_pte(ptep, pte) processor.pgtable.set_pte(ptep, pte) diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h index 9742554641b7..6f794bb570fe 100644 --- a/include/asm-arm/cpu-single.h +++ b/include/asm-arm/cpu-single.h @@ -37,9 +37,6 @@ #define cpu_dcache_clean_entry __cpu_fn(CPU_NAME,_dcache_clean_entry) #define cpu_icache_invalidate_range __cpu_fn(CPU_NAME,_icache_invalidate_range) #define cpu_icache_invalidate_page __cpu_fn(CPU_NAME,_icache_invalidate_page) -#define cpu_tlb_invalidate_all __cpu_fn(CPU_NAME,_tlb_invalidate_all) -#define cpu_tlb_invalidate_range __cpu_fn(CPU_NAME,_tlb_invalidate_range) -#define cpu_tlb_invalidate_page __cpu_fn(CPU_NAME,_tlb_invalidate_page) #define cpu_set_pgd __cpu_fn(CPU_NAME,_set_pgd) #define cpu_set_pmd __cpu_fn(CPU_NAME,_set_pmd) #define cpu_set_pte __cpu_fn(CPU_NAME,_set_pte) @@ -73,10 +70,6 @@ extern void cpu_dcache_clean_entry(unsigned long address); extern void cpu_icache_invalidate_range(unsigned long start, unsigned long end); extern void cpu_icache_invalidate_page(void *virt_page); -extern void cpu_tlb_invalidate_all(void); -extern void cpu_tlb_invalidate_range(unsigned long address, unsigned long end); -extern void cpu_tlb_invalidate_page(unsigned long address, int flags); - extern void cpu_set_pgd(unsigned long pgd_phys); extern void cpu_set_pmd(pmd_t *pmdp, pmd_t pmd); extern void cpu_set_pte(pte_t *ptep, pte_t pte); diff --git a/include/asm-arm/glue.h b/include/asm-arm/glue.h new file mode 100644 index 000000000000..a4f098d8aabb --- /dev/null +++ b/include/asm-arm/glue.h @@ -0,0 +1,78 @@ +/* + * linux/include/asm-arm/glue.h + * + * Copyright (C) 1997-1999 Russell King + * Copyright (C) 2000-2002 Deep Blue Solutions Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This file provides the glue to stick the processor-specific bits + * into the kernel in an efficient manner. The idea is to use branches + * when we're only targetting one class of TLB, or indirect calls + * when we're targetting multiple classes of TLBs. + */ +#ifdef __KERNEL__ + +#include <linux/config.h> + +#ifdef __STDC__ +#define ____glue(name,fn) name##fn +#else +#define ____glue(name,fn) name/**/fn +#endif +#define __glue(name,fn) ____glue(name,fn) + +/* + * Select MMU TLB handling. + */ + +/* + * ARMv3 MMU + */ +#undef _TLB +#if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710) +# ifdef _TLB +# define MULTI_TLB 1 +# else +# define _TLB v3 +# endif +#endif + +/* + * ARMv4 MMU without write buffer + */ +#if defined(CONFIG_CPU_ARM720T) +# ifdef _TLB +# define MULTI_TLB 1 +# else +# define _TLB v4 +# endif +#endif + +/* + * ARMv4 MMU with write buffer, with invalidate I TLB entry instruction + */ +#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \ + defined(CONFIG_CPU_ARM926T) || defined(CONFIG_CPU_ARM1020) || \ + defined(CONFIG_CPU_XSCALE) +# ifdef _TLB +# define MULTI_TLB 1 +# else +# define _TLB v4wbi +# endif +#endif + +/* + * ARMv4 MMU with write buffer, without invalidate I TLB entry instruction + */ +#if defined(CONFIG_CPU_SA110) || defined(CONFIG_CPU_SA1100) +# ifdef _TLB +# define MULTI_TLB 1 +# else +# define _TLB v4wb +# endif +#endif + +#endif diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 4782df468d45..3c63a8cf4cb9 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h @@ -31,9 +31,9 @@ * Generic IO read/write. These perform native-endian accesses. Note * that some architectures will want to re-define __raw_{read,write}w. */ -extern void __raw_writesb(unsigned int addr, void *data, int bytelen); -extern void __raw_writesw(unsigned int addr, void *data, int wordlen); -extern void __raw_writesl(unsigned int addr, void *data, int longlen); +extern void __raw_writesb(unsigned int addr, const void *data, int bytelen); +extern void __raw_writesw(unsigned int addr, const void *data, int wordlen); +extern void __raw_writesl(unsigned int addr, const void *data, int longlen); extern void __raw_readsb(unsigned int addr, void *data, int bytelen); extern void __raw_readsw(unsigned int addr, void *data, int wordlen); diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h index ce59302433ce..057ec51b2394 100644 --- a/include/asm-arm/irq.h +++ b/include/asm-arm/irq.h @@ -24,5 +24,19 @@ extern void disable_irq(unsigned int); extern void enable_irq(unsigned int); +#define __IRQT_FALEDGE (1 << 0) +#define __IRQT_RISEDGE (1 << 1) +#define __IRQT_LOWLVL (1 << 2) +#define __IRQT_HIGHLVL (1 << 3) + +#define IRQT_NOEDGE (0) +#define IRQT_RISING (__IRQT_RISEDGE) +#define IRQT_FALLING (__IRQT_FALEDGE) +#define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) +#define IRQT_LOW (__IRQT_LOWLVL) +#define IRQT_HIGH (__IRQT_HIGHLVL) + +int set_irq_type(unsigned int irq, unsigned int type); + #endif diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h index 4ec067c930e1..2c172b1330f2 100644 --- a/include/asm-arm/mach/irq.h +++ b/include/asm-arm/mach/irq.h @@ -10,32 +10,110 @@ #ifndef __ASM_ARM_MACH_IRQ_H #define __ASM_ARM_MACH_IRQ_H +struct irqdesc; +struct pt_regs; +struct seq_file; + +typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *); +typedef void (*irq_control_t)(unsigned int); + +struct irqchip { + /* + * Acknowledge the IRQ. + * If this is a level-based IRQ, then it is expected to mask the IRQ + * as well. + */ + void (*ack)(unsigned int); + /* + * Mask the IRQ in hardware. + */ + void (*mask)(unsigned int); + /* + * Unmask the IRQ in hardware. + */ + void (*unmask)(unsigned int); + /* + * Re-run the IRQ + */ + void (*rerun)(unsigned int); + /* + * Set the type of the IRQ. + */ + int (*type)(unsigned int, unsigned int); +}; + struct irqdesc { - unsigned int nomask : 1; /* IRQ does not mask in IRQ */ - unsigned int enabled : 1; /* IRQ is currently enabled */ - unsigned int triggered: 1; /* IRQ has occurred */ - unsigned int probing : 1; /* IRQ in use for a probe */ - unsigned int probe_ok : 1; /* IRQ can be used for probe */ - unsigned int valid : 1; /* IRQ claimable */ - unsigned int noautoenable : 1; /* don't automatically enable IRQ */ - unsigned int unused :25; - void (*mask_ack)(unsigned int irq); /* Mask and acknowledge IRQ */ - void (*mask)(unsigned int irq); /* Mask IRQ */ - void (*unmask)(unsigned int irq); /* Unmask IRQ */ + irq_handler_t handle; + struct irqchip *chip; struct irqaction *action; + + unsigned int enabled : 1; /* IRQ is currently enabled */ + unsigned int triggered: 1; /* IRQ has occurred */ + unsigned int running : 1; /* IRQ is running */ + unsigned int pending : 1; /* IRQ is pending */ + unsigned int probing : 1; /* IRQ in use for a probe */ + unsigned int probe_ok : 1; /* IRQ can be used for probe */ + unsigned int valid : 1; /* IRQ claimable */ + unsigned int noautoenable : 1; /* don't automatically enable IRQ */ + unsigned int unused :23; + unsigned int depth; /* disable depth */ + /* * IRQ lock detection */ - unsigned int lck_cnt; - unsigned int lck_pc; - unsigned int lck_jif; + unsigned int lck_cnt; + unsigned int lck_pc; + unsigned int lck_jif; }; extern struct irqdesc irq_desc[]; +/* + * This is internal. Do not use it. + */ extern void (*init_arch_irq)(void); -extern int setup_arm_irq(int, struct irqaction *); -extern int show_fiq_list(struct seq_file *, void *); extern void init_FIQ(void); +extern int show_fiq_list(struct seq_file *, void *); +void __set_irq_handler(unsigned int irq, irq_handler_t, int); +int setup_irq(unsigned int, struct irqaction *); + +/* + * External stuff. + */ +#define set_irq_handler(irq,handler) __set_irq_handler(irq,handler,0) +#define set_irq_chained_handler(irq,handler) __set_irq_handler(irq,handler,1) + +void set_irq_chip(unsigned int irq, struct irqchip *); +void set_irq_flags(unsigned int irq, unsigned int flags); + +#ifdef not_yet +/* + * This is to be used by the top-level machine IRQ decoder only. + */ +static inline void call_irq(struct pt_regs *regs, unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + + spin_lock(&irq_controller_lock); + desc->handle(irq, desc, regs); + spin_unlock(&irq_controller_lock); + + if (softirq_pending(smp_processor_id())) + do_softirq(); +} +#endif + +#define IRQF_VALID (1 << 0) +#define IRQF_PROBE (1 << 1) +#define IRQF_NOAUTOEN (1 << 2) + +/* + * Built-in IRQ handlers. + */ +void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); +void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); +void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); +void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); +void dummy_mask_unmask_irq(unsigned int irq); #endif diff --git a/include/asm-arm/mmu.h b/include/asm-arm/mmu.h index 784ff2708dc5..9b8d3d781a1e 100644 --- a/include/asm-arm/mmu.h +++ b/include/asm-arm/mmu.h @@ -1,7 +1,9 @@ #ifndef __ARM_MMU_H #define __ARM_MMU_H -/* The ARM doesn't have a mmu context */ +/* + * The ARM doesn't have a mmu context + */ typedef struct { } mm_context_t; #endif diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h index 0acf4d89c965..99e10958bc4c 100644 --- a/include/asm-arm/mmu_context.h +++ b/include/asm-arm/mmu_context.h @@ -49,27 +49,4 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, #define activate_mm(prev, next) \ switch_mm((prev),(next),NULL,smp_processor_id()) -/* - * Find first bit set in a 168-bit bitmap, where the first - * 128 bits are unlikely to be set. - */ -static inline int sched_find_first_bit(unsigned long *b) -{ -#if MAX_RT_PRIO != 128 || MAX_PRIO != 168 -#error update this function -#endif - - if (unlikely(b[0])) - return __ffs(b[0]); - if (unlikely(b[1])) - return __ffs(b[1]) + 32; - if (unlikely(b[2])) - return __ffs(b[2]) + 64; - if (unlikely(b[3])) - return __ffs(b[3]) + 96; - if (b[4]) - return __ffs(b[4]) + MAX_RT_PRIO; - return __ffs(b[5]) + 32 + MAX_RT_PRIO; -} - #endif diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index f08e9fcdd70d..f9d7f956f40a 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h @@ -14,8 +14,19 @@ #define clear_page(page) memzero((void *)(page), PAGE_SIZE) extern void copy_page(void *to, void *from); -#define clear_user_page(page, vaddr) cpu_clear_user_page(page,vaddr) -#define copy_user_page(to, from, vaddr) cpu_copy_user_page(to,from,vaddr) +#define clear_user_page(addr,vaddr) \ + do { \ + preempt_disable(); \ + cpu_clear_user_page(addr, vaddr); \ + preempt_enable(); \ + } while (0) + +#define copy_user_page(to,from,vaddr) \ + do { \ + preempt_disable(); \ + cpu_copy_user_page(to, from, vaddr); \ + preempt_enable(); \ + } while (0) #ifdef STRICT_MM_TYPECHECKS /* diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h index 935f73ad7e2c..041bbaddd971 100644 --- a/include/asm-arm/pci.h +++ b/include/asm-arm/pci.h @@ -2,7 +2,7 @@ #define ASMARM_PCI_H #ifdef __KERNEL__ - +#include <linux/config.h> #include <linux/mm.h> /* bah! */ #include <asm/arch/hardware.h> @@ -142,18 +142,9 @@ pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int directi for (i = 0; i < nents; i++, sg++) { char *virt; - if (sg->address && sg->page) - BUG(); - else if (!sg->address && !sg->page) - BUG(); - - if (sg->address) { - sg->dma_address = virt_to_bus(sg->address); - virt = sg->address; - } else { - sg->dma_address = page_to_bus(sg->page) + sg->offset; - virt = page_address(sg->page) + sg->offset; - } + + sg->dma_address = page_to_bus(sg->page) + sg->offset; + virt = page_address(sg->page) + sg->offset; consistent_sync(virt, sg->length, direction); } @@ -197,12 +188,7 @@ pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int d int i; for (i = 0; i < nelems; i++, sg++) { - char *virt; - - if (sg->address) - virt = sg->address; - else - virt = page_address(sg->page) + sg->offset; + char *virt = page_address(sg->page) + sg->offset; consistent_sync(virt, sg->length, direction); } } diff --git a/include/asm-arm/proc-armv/cache.h b/include/asm-arm/proc-armv/cache.h index 2f5f206fc43c..c73f03773594 100644 --- a/include/asm-arm/proc-armv/cache.h +++ b/include/asm-arm/proc-armv/cache.h @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ #include <asm/mman.h> +#include <asm/glue.h> /* * This flag is used to indicate that the page pointed to by a pte @@ -200,69 +201,93 @@ static inline void flush_icache_page(struct vm_area_struct *vma, struct page *pa } while (0) /* - * Old ARM MEMC stuff. This supports the reversed mapping handling that - * we have on the older 26-bit machines. We don't have a MEMC chip, so... - */ -#define memc_update_all() do { } while (0) -#define memc_update_mm(mm) do { } while (0) -#define memc_update_addr(mm,pte,log) do { } while (0) -#define memc_clear(mm,physaddr) do { } while (0) - -/* - * TLB flushing. + * TLB Management + * ============== + * + * The arch/arm/mm/tlb-*.S files implement this methods. + * + * The TLB specific code is expected to perform whatever tests it + * needs to determine if it should invalidate the TLB for each + * call. Start addresses are inclusive and end addresses are + * exclusive; it is safe to round these addresses down. + * + * flush_tlb_all() + * + * Invalidate the entire TLB. * - * - flush_tlb_all() flushes all processes TLBs - * - flush_tlb_mm(mm) flushes the specified mm context TLB's - * - flush_tlb_page(vma, vmaddr) flushes TLB for specified page - * - flush_tlb_range(vma, start, end) flushes TLB for specified range of pages + * flush_tlb_mm(mm) * - * We drain the write buffer in here to ensure that the page tables in ram - * are really up to date. It is more efficient to do this here... + * Invalidate all TLB entries in a particular address + * space. + * - mm - mm_struct describing address space + * + * flush_tlb_range(mm,start,end) + * + * Invalidate a range of TLB entries in the specified + * address space. + * - mm - mm_struct describing address space + * - start - start address (may not be aligned) + * - end - end address (exclusive, may not be aligned) + * + * flush_tlb_page(vaddr,vma) + * + * Invalidate the specified page in the specified address range. + * - vaddr - virtual address (may not be aligned) + * - vma - vma_struct describing address range + * + * flush_kern_tlb_page(kaddr) + * + * Invalidate the TLB entry for the specified page. The address + * will be in the kernels virtual memory space. Current uses + * only require the D-TLB to be invalidated. + * - kaddr - Kernel virtual memory address */ -/* - * Notes: - * current->active_mm is the currently active memory description. - * current->mm == NULL iff we are lazy. - */ -#define flush_tlb_all() \ - do { \ - cpu_tlb_invalidate_all(); \ - } while (0) +struct cpu_tlb_fns { + void (*flush_kern_all)(void); + void (*flush_user_mm)(struct mm_struct *); + void (*flush_user_range)(unsigned long, unsigned long, struct vm_area_struct *); + void (*flush_user_page)(unsigned long, struct vm_area_struct *); + void (*flush_kern_page)(unsigned long); +}; /* - * Flush all user virtual address space translations described by `_mm'. - * - * Currently, this is always called for current->mm, which should be - * the same as current->active_mm. This is currently not be called for - * the lazy TLB case. + * Convert calls to our calling convention. */ -#define flush_tlb_mm(_mm) \ - do { \ - if ((_mm) == current->active_mm) \ - cpu_tlb_invalidate_all(); \ - } while (0) +#define flush_tlb_all() __cpu_flush_kern_tlb_all() +#define flush_tlb_mm(mm) __cpu_flush_user_tlb_mm(mm) +#define flush_tlb_range(vma,start,end) __cpu_flush_user_tlb_range(start,end,vma) +#define flush_tlb_page(vma,vaddr) __cpu_flush_user_tlb_page(vaddr,vma) +#define flush_kern_tlb_page(kaddr) __cpu_flush_kern_tlb_page(kaddr) /* - * Flush the specified range of user virtual address space translations. - * - * _mm may not be current->active_mm, but may not be NULL. + * Now select the calling method */ -#define flush_tlb_range(_vma,_start,_end) \ - do { \ - if ((_mm)->vm_mm == current->active_mm) \ - cpu_tlb_invalidate_range((_start), (_end)); \ - } while (0) +#ifdef MULTI_TLB -/* - * Flush the specified user virtual address space translation. - */ -#define flush_tlb_page(_vma,_page) \ - do { \ - if ((_vma)->vm_mm == current->active_mm) \ - cpu_tlb_invalidate_page((_page), \ - ((_vma)->vm_flags & VM_EXEC)); \ - } while (0) +extern struct cpu_tlb_fns cpu_tlb; + +#define __cpu_flush_kern_tlb_all cpu_tlb.flush_kern_all +#define __cpu_flush_user_tlb_mm cpu_tlb.flush_user_mm +#define __cpu_flush_user_tlb_range cpu_tlb.flush_user_range +#define __cpu_flush_user_tlb_page cpu_tlb.flush_user_page +#define __cpu_flush_kern_tlb_page cpu_tlb.flush_kern_page + +#else + +#define __cpu_flush_kern_tlb_all __glue(_TLB,_flush_kern_tlb_all) +#define __cpu_flush_user_tlb_mm __glue(_TLB,_flush_user_tlb_mm) +#define __cpu_flush_user_tlb_range __glue(_TLB,_flush_user_tlb_range) +#define __cpu_flush_user_tlb_page __glue(_TLB,_flush_user_tlb_page) +#define __cpu_flush_kern_tlb_page __glue(_TLB,_flush_kern_tlb_page) + +extern void __cpu_flush_kern_tlb_all(void); +extern void __cpu_flush_user_tlb_mm(struct mm_struct *); +extern void __cpu_flush_user_tlb_range(unsigned long, unsigned long, struct vm_area_struct *); +extern void __cpu_flush_user_tlb_page(unsigned long, struct vm_area_struct *); +extern void __cpu_flush_kern_tlb_page(unsigned long); + +#endif /* * if PG_dcache_dirty is set for the page, we need to ensure that any @@ -270,3 +295,12 @@ static inline void flush_icache_page(struct vm_area_struct *vma, struct page *pa * back to the page. */ extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte); + +/* + * Old ARM MEMC stuff. This supports the reversed mapping handling that + * we have on the older 26-bit machines. We don't have a MEMC chip, so... + */ +#define memc_update_all() do { } while (0) +#define memc_update_mm(mm) do { } while (0) +#define memc_update_addr(mm,pte,log) do { } while (0) +#define memc_clear(mm,physaddr) do { } while (0) diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h index 4411a5d1f5a3..dda78d4e7156 100644 --- a/include/asm-arm/procinfo.h +++ b/include/asm-arm/procinfo.h @@ -14,6 +14,9 @@ #include <asm/proc-fns.h> +struct cpu_tlb_fns; +struct processor; + struct proc_info_item { const char *manufacturer; const char *cpu_name; @@ -37,15 +40,14 @@ struct proc_info_list { const char *elf_name; unsigned int elf_hwcap; struct proc_info_item *info; -#ifdef MULTI_CPU struct processor *proc; -#else - void *unused; -#endif + struct cpu_tlb_fns *tlb; }; #endif /* __ASSEMBLY__ */ +#define PROC_INFO_SZ 40 + #define HWCAP_SWP 1 #define HWCAP_HALF 2 #define HWCAP_THUMB 4 diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 0107b073abf5..b317ffcd1ec5 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h @@ -53,9 +53,9 @@ extern asmlinkage void __backtrace(void); struct thread_info; extern struct task_struct *__switch_to(struct thread_info *, struct thread_info *); -#define switch_to(prev,next,last) \ +#define switch_to(prev,next) \ do { \ - last = __switch_to(prev->thread_info,next->thread_info); \ + __switch_to(prev->thread_info,next->thread_info); \ mb(); \ } while (0) diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h index 381e9e9f3b4f..033278aa50e7 100644 --- a/include/asm-i386/fixmap.h +++ b/include/asm-i386/fixmap.h @@ -65,6 +65,11 @@ enum fixed_addresses { FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, #endif + __end_of_permanent_fixed_addresses, + /* temporary boot-time mappings, used before ioremap() is functional */ +#define NR_FIX_BTMAPS 16 + FIX_BTMAP_END = __end_of_permanent_fixed_addresses, + FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1, __end_of_fixed_addresses }; @@ -86,8 +91,8 @@ extern void __set_fixmap (enum fixed_addresses idx, * at the top of mem.. */ #define FIXADDR_TOP (0xffffe000UL) -#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) -#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) +#define __FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT) +#define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE) #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h index d443efbd91e6..1d12e37180ac 100644 --- a/include/asm-i386/io.h +++ b/include/asm-i386/io.h @@ -95,6 +95,14 @@ static inline void * ioremap_nocache (unsigned long offset, unsigned long size) extern void iounmap(void *addr); /* + * bt_ioremap() and bt_iounmap() are for temporary early boot-time + * mappings, before the real ioremap() is functional. + * A boot-time mapping is currently limited to at most 16 pages. + */ +extern void *bt_ioremap(unsigned long offset, unsigned long size); +extern void bt_iounmap(void *addr, unsigned long size); + +/* * ISA I/O bus memory addresses are 1:1 with the physical address. */ #define isa_virt_to_bus virt_to_phys diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h index bf2ef10e3731..94d4ee1ec94a 100644 --- a/include/asm-x86_64/bitops.h +++ b/include/asm-x86_64/bitops.h @@ -413,6 +413,16 @@ static __inline__ unsigned long __ffs(unsigned long word) #ifdef __KERNEL__ +static inline int sched_find_first_bit(unsigned long *b) +{ + if (b[0]) + return __ffs(b[0]); + if (b[1]) + return __ffs(b[1]) + 64; + if (b[2]) + return __ffs(b[2]) + 128; +} + /** * ffs - find first bit set * @x: the word to search diff --git a/include/asm-x86_64/mmu_context.h b/include/asm-x86_64/mmu_context.h index 94bb87ae7a82..b7b44930381e 100644 --- a/include/asm-x86_64/mmu_context.h +++ b/include/asm-x86_64/mmu_context.h @@ -7,33 +7,6 @@ #include <asm/pgalloc.h> /* - * Every architecture must define this function. It's the fastest - * way of searching a 168-bit bitmap where the first 128 bits are - * unlikely to be set. It's guaranteed that at least one of the 168 - * bits is cleared. - */ -#if MAX_RT_PRIO != 128 || MAX_PRIO != 168 -# error update this function. -#endif - -static inline int __sched_find_first_bit(unsigned long *b) -{ - if (b[0]) - return __ffs(b[0]); - if (b[1]) - return __ffs(b[1]) + 64; - if (b[2]) - return __ffs(b[2]) + 128; -} - -static inline int sched_find_first_bit(unsigned long *b) -{ - int n = __sched_find_first_bit(b); - BUG_ON((unsigned)n > 167); - return n; -} - -/* * possibly do the LDT unload here? */ #define destroy_context(mm) do { } while(0) diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index 48a878deddb4..7380af4af4ce 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h @@ -112,6 +112,8 @@ static unsigned long start_kernel_map __attribute__((unused)) = __START_KERNEL_m #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT)) #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #endif /* __KERNEL__ */ diff --git a/include/asm-x86_64/pda.h b/include/asm-x86_64/pda.h index 396dc01608ac..366410f6833b 100644 --- a/include/asm-x86_64/pda.h +++ b/include/asm-x86_64/pda.h @@ -19,11 +19,6 @@ struct x8664_pda { struct task_struct *pcurrent; /* Current process */ int irqcount; /* Irq nesting counter. Starts with -1 */ int cpunumber; /* Logical CPU number */ - /* XXX: could be a single list */ - unsigned long *pgd_quick; - unsigned long *pmd_quick; - unsigned long *pte_quick; - unsigned long pgtable_cache_sz; char *irqstackptr; unsigned int __softirq_pending; unsigned int __local_irq_count; diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h index 1d5fb0c9e51e..8f26e2dfd3a6 100644 --- a/include/asm-x86_64/pgalloc.h +++ b/include/asm-x86_64/pgalloc.h @@ -8,173 +8,74 @@ #include <linux/threads.h> #include <linux/mm.h> -#define inc_pgcache_size() add_pda(pgtable_cache_sz,1UL) -#define dec_pgcache_size() sub_pda(pgtable_cache_sz,1UL) - -#define pmd_populate(mm, pmd, pte) \ +#define pmd_populate_kernel(mm, pmd, pte) \ set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte))) #define pgd_populate(mm, pgd, pmd) \ set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pmd))) -extern __inline__ pmd_t *get_pmd_slow(void) +static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte) { - pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL); - - if (ret) - memset(ret, 0, PAGE_SIZE); - return ret; + set_pmd(pmd, __pmd(_PAGE_TABLE | + ((u64)(pte - mem_map) << PAGE_SHIFT))); } -extern __inline__ pmd_t *get_pmd_fast(void) +extern __inline__ pmd_t *get_pmd(void) { - unsigned long *ret; - - preempt_disable(); - ret = read_pda(pmd_quick); - if (ret) { - write_pda(pmd_quick, (unsigned long *)(*ret)); - ret[0] = 0; - dec_pgcache_size(); - } - preempt_enable(); - if (!ret) - ret = (unsigned long *)get_pmd_slow(); - return (pmd_t *)ret; + return (pmd_t *)get_zeroed_page(GFP_KERNEL); } extern __inline__ void pmd_free(pmd_t *pmd) { - preempt_disable(); - *(unsigned long *)pmd = (unsigned long) read_pda(pmd_quick); - write_pda(pmd_quick,(unsigned long *) pmd); - inc_pgcache_size(); - preempt_enable(); -} - -extern __inline__ void pmd_free_slow(pmd_t *pmd) -{ if ((unsigned long)pmd & (PAGE_SIZE-1)) BUG(); free_page((unsigned long)pmd); } -static inline pmd_t *pmd_alloc_one_fast (struct mm_struct *mm, unsigned long addr) -{ - unsigned long *ret; - - preempt_disable(); - ret = (unsigned long *)read_pda(pmd_quick); - - if (__builtin_expect(ret != NULL, 1)) { - write_pda(pmd_quick, (unsigned long *)(*ret)); - ret[0] = 0; - dec_pgcache_size(); - } - preempt_enable(); - return (pmd_t *)ret; -} - static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr) { - pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL); - - if (__builtin_expect(pmd != NULL, 1)) - clear_page(pmd); - return pmd; -} - - -static inline pgd_t *pgd_alloc_one_fast (void) -{ - unsigned long *ret; - - preempt_disable(); - ret = read_pda(pgd_quick); - if (likely(ret != NULL)) { - write_pda(pgd_quick,(unsigned long *)(*ret)); - ret[0] = 0; - dec_pgcache_size(); - } - preempt_enable(); - return (pgd_t *) ret; + return (pmd_t *) get_zeroed_page(GFP_KERNEL); } static inline pgd_t *pgd_alloc (struct mm_struct *mm) { - /* the VM system never calls pgd_alloc_one_fast(), so we do it here. */ - pgd_t *pgd = pgd_alloc_one_fast(); - - if (pgd == NULL) { - pgd = (pgd_t *)__get_free_page(GFP_KERNEL); - if (__builtin_expect(pgd != NULL, 1)) - clear_page(pgd); - } - return pgd; + return (pgd_t *)get_zeroed_page(GFP_KERNEL); } static inline void pgd_free (pgd_t *pgd) { - preempt_disable(); - *(unsigned long *)pgd = (unsigned long) read_pda(pgd_quick); - write_pda(pgd_quick,(unsigned long *) pgd); - inc_pgcache_size(); - preempt_enable(); -} - - -static inline void pgd_free_slow (pgd_t *pgd) -{ if ((unsigned long)pgd & (PAGE_SIZE-1)) BUG(); free_page((unsigned long)pgd); } - -static inline pte_t *pte_alloc_one(struct mm_struct *mm, unsigned long address) +static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - pte_t *pte; - - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pte) - clear_page(pte); - return pte; + return (pte_t *) get_zeroed_page(GFP_KERNEL); } -extern __inline__ pte_t *pte_alloc_one_fast(struct mm_struct *mm, unsigned long address) +static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - unsigned long *ret; - - preempt_disable(); - if(__builtin_expect((ret = read_pda(pte_quick)) != NULL, !0)) { - write_pda(pte_quick, (unsigned long *)(*ret)); - ret[0] = ret[1]; - dec_pgcache_size(); - } - preempt_enable(); - return (pte_t *)ret; + void *p = (void *)get_zeroed_page(GFP_KERNEL); + if (!p) + return NULL; + return virt_to_page(p); } -/* Should really implement gc for free page table pages. This could be done with - a reference count in struct page. */ +/* Should really implement gc for free page table pages. This could be + done with a reference count in struct page. */ -extern __inline__ void pte_free(pte_t *pte) -{ - preempt_disable(); - *(unsigned long *)pte = (unsigned long) read_pda(pte_quick); - write_pda(pte_quick, (unsigned long *) pte); - inc_pgcache_size(); - preempt_enable(); -} - -extern __inline__ void pte_free_slow(pte_t *pte) +extern __inline__ void pte_free_kernel(pte_t *pte) { if ((unsigned long)pte & (PAGE_SIZE-1)) BUG(); free_page((unsigned long)pte); } +extern inline void pte_free(struct page *pte) +{ + __free_page(pte); +} -extern int do_check_pgt_cache(int, int); /* * TLB flushing: diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index aa884aa3c8c1..5127ce27582b 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h @@ -26,7 +26,7 @@ extern pgd_t level3_ident_pgt[512], swapper_pg_dir[512]; extern pmd_t level2_kernel_pgt[512]; extern void paging_init(void); -/* Caches aren't brain-dead on the intel. */ +/* Caches aren't brain-dead. */ #define flush_cache_all() do { } while (0) #define flush_cache_mm(mm) do { } while (0) #define flush_cache_range(vma, start, end) do { } while (0) @@ -35,6 +35,7 @@ extern void paging_init(void); #define flush_dcache_page(page) do { } while (0) #define flush_icache_range(start, end) do { } while (0) #define flush_icache_page(vma,pg) do { } while (0) +#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) #define __flush_tlb() \ do { \ @@ -341,8 +342,10 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) #define page_pte(page) page_pte_prot(page, __pgprot(0)) -#define pmd_page(pmd) \ +#define pmd_page_kernel(pmd) \ ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) +#define pmd_page(pmd) \ + (mem_map + (pmd_val(pmd) >> PAGE_SHIFT)) /* to find an entry in a page-table-directory. */ #define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) @@ -360,9 +363,15 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) /* Find an entry in the third-level page table.. */ #define __pte_offset(address) \ ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) -#define pte_offset(dir, address) ((pte_t *) pmd_page(*(dir)) + \ +#define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_kernel(*(dir)) + \ __pte_offset(address)) +#define pte_offset_map(dir,address) pte_offset_kernel(dir,address) +#define pte_offset_map_nested(dir,address) pte_offset_kernel(dir,address) +#define pte_unmap(pte) /* NOP */ +#define pte_unmap_nested(pte) /* NOP */ + + /* never use these in the common code */ #define level4_page(level4) ((unsigned long) __va(level4_val(level4) & PAGE_MASK)) #define level4_index(address) ((address >> LEVEL4_SHIFT) & (PTRS_PER_LEVEL4-1)) diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index d97077c0a6bc..f74d33844458 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h @@ -18,7 +18,7 @@ extern void __switch_to(struct task_struct *prev, struct task_struct *next); #define prepare_to_switch() do { } while(0) -#define switch_to(prev,next,last) do { \ +#define switch_to(prev,next) do { \ asm volatile("pushq %%rbp\n\t" \ "pushq %%rbx\n\t" \ "pushq %%r8\n\t" \ @@ -30,10 +30,10 @@ extern void __switch_to(struct task_struct *prev, struct task_struct *next); "pushq %%r14\n\t" \ "pushq %%r15\n\t" \ "movq %%rsp,%0\n\t" /* save RSP */ \ - "movq %3,%%rsp\n\t" /* restore RSP */ \ + "movq %2,%%rsp\n\t" /* restore RSP */ \ "leaq 1f(%%rip),%%rbp\n\t" \ "movq %%rbp,%1\n\t" /* save RIP */ \ - "pushq %4\n\t" /* setup new RIP */ \ + "pushq %3\n\t" /* setup new RIP */ \ "jmp __switch_to\n\t" \ "1:\t" \ "popq %%r15\n\t" \ @@ -46,8 +46,7 @@ extern void __switch_to(struct task_struct *prev, struct task_struct *next); "popq %%r8\n\t" \ "popq %%rbx\n\t" \ "popq %%rbp\n\t" \ - :"=m" (prev->thread.rsp),"=m" (prev->thread.rip), \ - "=b" (last) \ + :"=m" (prev->thread.rsp),"=m" (prev->thread.rip) \ :"m" (next->thread.rsp),"m" (next->thread.rip), \ "b" (prev), "S" (next), "D" (prev)); \ } while (0) diff --git a/include/linux/blk.h b/include/linux/blk.h index b6507e62eb4b..173634d2264b 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -8,11 +8,6 @@ #include <linux/spinlock.h> #include <linux/compiler.h> -/* - * get rid of this next... - */ -extern int ide_init(void); - extern void set_device_ro(kdev_t dev,int flag); extern void add_blkdev_randomness(int major); diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 3649086ed83f..21da57231050 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -126,6 +126,7 @@ d_iput: no no yes #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ extern spinlock_t dcache_lock; +extern rwlock_t dparent_lock; /** * d_drop - drop a dentry diff --git a/include/linux/dnotify.h b/include/linux/dnotify.h index 794fd096f31f..60c1e2117f10 100644 --- a/include/linux/dnotify.h +++ b/include/linux/dnotify.h @@ -33,13 +33,13 @@ static inline void inode_dir_notify(struct inode *inode, unsigned long event) static inline void dnotify_parent(struct dentry *dentry, unsigned long event) { struct dentry *parent; - spin_lock(&dcache_lock); + read_lock(&dparent_lock); parent = dentry->d_parent; if (parent->d_inode->i_dnotify_mask & event) { dget(parent); - spin_unlock(&dcache_lock); + read_unlock(&dparent_lock); __inode_dir_notify(parent->d_inode, event); dput(parent); } else - spin_unlock(&dcache_lock); + read_unlock(&dparent_lock); } diff --git a/include/linux/fs.h b/include/linux/fs.h index 7bb0610ba3a6..414bf25bea5f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1212,12 +1212,12 @@ extern void invalidate_inode_buffers(struct inode *); #define destroy_buffers(dev) __invalidate_buffers((dev), 1) extern void invalidate_bdev(struct block_device *, int); extern void __invalidate_buffers(kdev_t dev, int); -extern void sync_inodes(kdev_t); +extern void sync_inodes(void); extern void sync_unlocked_inodes(void); extern void write_inode_now(struct inode *, int); -extern int sync_buffers(kdev_t, int); -extern void sync_dev(kdev_t); +extern int sync_buffers(struct block_device *, int); extern int fsync_dev(kdev_t); +extern int fsync_bdev(struct block_device *); extern int fsync_super(struct super_block *); extern int fsync_no_super(struct block_device *); extern void sync_inodes_sb(struct super_block *); @@ -1234,7 +1234,7 @@ static inline int fsync_inode_data_buffers(struct inode *inode) extern int inode_has_buffers(struct inode *); extern int filemap_fdatasync(struct address_space *); extern int filemap_fdatawait(struct address_space *); -extern void sync_supers(kdev_t); +extern void sync_supers(void); extern int bmap(struct inode *, int); extern int notify_change(struct dentry *, struct iattr *); extern int permission(struct inode *, int); @@ -1511,9 +1511,9 @@ extern int inode_setattr(struct inode *, struct iattr *); static inline ino_t parent_ino(struct dentry *dentry) { ino_t res; - spin_lock(&dcache_lock); + read_lock(&dparent_lock); res = dentry->d_parent->d_inode->i_ino; - spin_unlock(&dcache_lock); + read_unlock(&dparent_lock); return res; } diff --git a/include/linux/ide.h b/include/linux/ide.h index b734a586cd45..30f881404625 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1,9 +1,7 @@ #ifndef _IDE_H #define _IDE_H /* - * linux/include/linux/ide.h - * - * Copyright (C) 1994-1998 Linus Torvalds & authors + * Copyright (C) 1994-2002 Linus Torvalds & authors */ #include <linux/config.h> @@ -13,6 +11,7 @@ #include <linux/hdsmart.h> #include <linux/blkdev.h> #include <linux/proc_fs.h> +#include <linux/device.h> #include <linux/devfs_fs_kernel.h> #include <asm/hdreg.h> @@ -349,12 +348,13 @@ void ide_setup_ports( hw_regs_t *hw, * Now for the data we need to maintain per-drive: ide_drive_t */ -#define ide_scsi 0x21 -#define ide_disk 0x20 -#define ide_optical 0x7 -#define ide_cdrom 0x5 -#define ide_tape 0x1 -#define ide_floppy 0x0 +#define ATA_DISK 0x20 +#define ATA_TAPE 0x01 +#define ATA_ROM 0x05 /* CD-ROM */ +#define ATA_MOD 0x07 /* optical */ +#define ATA_FLOPPY 0x00 +#define ATA_SCSI 0x21 +#define ATA_NO_LUN 0x7f typedef union { unsigned all : 8; /* all of the bits together */ @@ -370,7 +370,14 @@ typedef union { struct ide_settings_s; typedef struct ide_drive_s { - request_queue_t queue; /* request queue */ + char type; /* distingiush different devices: disk, cdrom, tape, floppy, ... */ + + /* NOTE: If we had proper separation between channel and host chip, we + * could move this to the chanell and many sync problems would + * magically just go away. + */ + request_queue_t queue; /* per device request queue */ + struct ide_drive_s *next; /* circular list of hwgroup drives */ unsigned long sleep; /* sleep until this time */ unsigned long service_start; /* time we started last request */ @@ -405,7 +412,6 @@ typedef struct ide_drive_s { unsigned ata_flash : 1; /* 1=present, 0=default */ unsigned addressing; /* : 2; 0=28-bit, 1=48-bit, 2=64-bit */ byte scsi; /* 0=default, 1=skip current ide-subdriver for ide-scsi emulation */ - byte media; /* disk, cdrom, tape, floppy, ... */ select_t select; /* basic drive/head select reg value */ byte ctl; /* "normal" value for IDE_CONTROL_REG */ byte ready_stat; /* min status value for drive ready */ @@ -426,12 +432,12 @@ typedef struct ide_drive_s { unsigned long capacity; /* total number of sectors */ unsigned long long capacity48; /* total number of sectors */ unsigned int drive_data; /* for use by tuneproc/selectproc as needed */ - struct hwif_s *hwif; /* actually (ide_hwif_t *) */ + struct hwif_s *hwif; /* parent pointer to the interface we are attached to */ wait_queue_head_t wqueue; /* used to wait for drive in open() */ struct hd_driveid *id; /* drive model identification info */ struct hd_struct *part; /* drive partition table */ char name[4]; /* drive name, such as "hda" */ - struct ide_driver_s *driver; /* (ide_driver_t *) */ + struct ata_operations *driver; void *driver_data; /* extra driver data */ devfs_handle_t de; /* directory for device */ struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ @@ -450,6 +456,7 @@ typedef struct ide_drive_s { byte acoustic; /* acoustic management */ unsigned int failures; /* current failure count */ unsigned int max_failures; /* maximum allowed failure count */ + struct device device; /* global device tree handle */ } ide_drive_t; /* @@ -519,16 +526,6 @@ typedef void (ide_rw_proc_t) (ide_drive_t *, ide_dma_action_t); */ typedef int (ide_busproc_t) (ide_drive_t *, int); -#ifdef CONFIG_BLK_DEV_IDEPCI -typedef struct ide_pci_devid_s { - unsigned short vid; - unsigned short did; -} ide_pci_devid_t; - -#define IDE_PCI_DEVID_NULL ((ide_pci_devid_t){0,0}) -#define IDE_PCI_DEVID_EQ(a,b) (a.vid == b.vid && a.did == b.did) -#endif /* CONFIG_BLK_DEV_IDEPCI */ - typedef struct hwif_s { struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ @@ -559,7 +556,7 @@ typedef struct hwif_s { struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ int irq; /* our irq number */ byte major; /* our major number */ - char name[6]; /* name of interface, eg. "ide0" */ + char name[80]; /* name of interface */ byte index; /* 0 for ide0; 1 for ide1; ... */ hwif_chipset_t chipset; /* sub-module for tuning.. */ unsigned noprobe : 1; /* don't probe for this interface */ @@ -573,15 +570,14 @@ typedef struct hwif_s { byte channel; /* for dual-port chips: 0=primary, 1=secondary */ #ifdef CONFIG_BLK_DEV_IDEPCI struct pci_dev *pci_dev; /* for pci chipsets */ - ide_pci_devid_t pci_devid; /* for pci chipsets: {VID,DID} */ -#endif /* CONFIG_BLK_DEV_IDEPCI */ +#endif #if (DISK_RECOVERY_TIME > 0) unsigned long last_time; /* time when previous rq was done */ #endif byte straight8; /* Alan's straight 8 check */ - void *hwif_data; /* extra hwif data */ ide_busproc_t *busproc; /* driver soft-power interface */ byte bus_state; /* power state of the IDE bus */ + struct device device; /* global device tree handle */ } ide_hwif_t; /* @@ -671,8 +667,6 @@ typedef struct { #ifdef CONFIG_PROC_FS void proc_ide_create(void); void proc_ide_destroy(void); -void recreate_proc_ide_device(ide_hwif_t *, ide_drive_t *); -void destroy_proc_ide_device(ide_hwif_t *, ide_drive_t *); void destroy_proc_ide_drives(ide_hwif_t *); void create_proc_ide_interfaces(void); void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void *data); @@ -700,37 +694,54 @@ read_proc_t proc_ide_read_geometry; #endif /* - * Subdrivers support. + * This structure describes the operations possible on a particular device type + * (CD-ROM, tape, DISK and so on). + * + * This is the main hook for device type support submodules. */ -typedef struct ide_driver_s { - const char *name; - byte media; - unsigned busy : 1; - unsigned supports_dma : 1; - unsigned supports_dsc_overlap : 1; + +struct ata_operations { + struct module *owner; + unsigned busy: 1; /* FIXME: this will go soon away... */ int (*cleanup)(ide_drive_t *); int (*standby)(ide_drive_t *); int (*flushcache)(ide_drive_t *); ide_startstop_t (*do_request)(ide_drive_t *, struct request *, unsigned long); int (*end_request)(ide_drive_t *drive, int uptodate); + int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long); int (*open)(struct inode *, struct file *, ide_drive_t *); void (*release)(struct inode *, struct file *, ide_drive_t *); int (*media_change)(ide_drive_t *); void (*revalidate)(ide_drive_t *); + void (*pre_reset)(ide_drive_t *); unsigned long (*capacity)(ide_drive_t *); ide_startstop_t (*special)(ide_drive_t *); ide_proc_entry_t *proc; - int (*driver_init)(void); int (*driver_reinit)(ide_drive_t *); +}; + +/* Alas, no aliases. Too much hassle with bringing module.h everywhere */ +#define ata_get(ata) \ + (((ata) && (ata)->owner) \ + ? ( try_inc_mod_count((ata)->owner) ? (ata) : NULL ) \ + : (ata)) + +#define ata_put(ata) \ +do { \ + if ((ata) && (ata)->owner) \ + __MOD_DEC_USE_COUNT((ata)->owner); \ +} while(0) - /* FIXME: Single linked list of drivers for iteration. - */ - struct ide_driver_s *next; -} ide_driver_t; -#define DRIVER(drive) ((drive)->driver) +/* FIXME: Actually implement and use them as soon as possible! to make the + * ide_scan_devices() go away! */ + +extern int unregister_ata_driver(unsigned int type, struct ata_operations *driver); +extern int register_ata_driver(unsigned int type, struct ata_operations *driver); + +#define ata_ops(drive) ((drive)->driver) /* * ide_hwifs[] is the master data structure used to keep track @@ -740,10 +751,7 @@ typedef struct ide_driver_s { * structure directly (the allocation/layout may change!). * */ -#ifndef _IDE_C extern struct hwif_s ide_hwifs[]; /* master data repository */ -extern struct ide_driver_s *ide_drivers; -#endif extern int noautodma; /* @@ -818,7 +826,7 @@ unsigned long current_capacity (ide_drive_t *drive); /* * Revalidate (read partition tables) */ -void ide_revalidate_drive (ide_drive_t *drive); +extern void ide_revalidate_drive (ide_drive_t *drive); /* * Start a reset operation for an IDE interface. @@ -855,34 +863,6 @@ typedef enum { #define task_rq_offset(rq) \ (((rq)->nr_sectors - (rq)->current_nr_sectors) * SECTOR_SIZE) -extern inline void *ide_map_buffer(struct request *rq, unsigned long *flags) -{ - return bio_kmap_irq(rq->bio, flags) + ide_rq_offset(rq); -} - -extern inline void ide_unmap_buffer(char *buffer, unsigned long *flags) -{ - bio_kunmap_irq(buffer, flags); -} - -/* - * for now, taskfile requests are special :/ - */ -extern inline char *ide_map_rq(struct request *rq, unsigned long *flags) -{ - if (rq->bio) - return ide_map_buffer(rq, flags); - else - return rq->buffer + task_rq_offset(rq); -} - -extern inline void ide_unmap_rq(struct request *rq, char *buf, - unsigned long *flags) -{ - if (rq->bio) - ide_unmap_buffer(buf, flags); -} - /* * This function issues a special IDE device request * onto the request queue. @@ -959,7 +939,6 @@ void do_taskfile (ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, struct /* * Special Flagged Register Validation Caller */ -// ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task); ide_startstop_t set_multmode_intr (ide_drive_t *drive); ide_startstop_t set_geometry_intr (ide_drive_t *drive); @@ -990,7 +969,6 @@ int pkt_taskfile_ioctl (ide_drive_t *drive, struct inode *inode, struct file *fi #endif /* CONFIG_PKT_TASK_IOCTL */ void ide_delay_50ms (void); -int system_bus_clock(void); byte ide_auto_reduce_xfer (ide_drive_t *drive); int ide_driveid_update (ide_drive_t *drive); @@ -999,13 +977,7 @@ int ide_config_drive_speed (ide_drive_t *drive, byte speed); byte eighty_ninty_three (ide_drive_t *drive); int set_transfer (ide_drive_t *drive, ide_task_t *args); -/* - * ide_system_bus_speed() returns what we think is the system VESA/PCI - * bus speed (in MHz). This is used for calculating interface PIO timings. - * The default is 40 for known PCI systems, 50 otherwise. - * The "idebus=xx" parameter can be used to override this value. - */ -int ide_system_bus_speed (void); +extern int system_bus_speed; /* * idedisk_input_data() is a wrapper around ide_input_data() which copes @@ -1037,47 +1009,33 @@ void ide_intr (int irq, void *dev_id, struct pt_regs *regs); void do_ide_request (request_queue_t * q); void ide_init_subdrivers (void); -#ifndef _IDE_C extern struct block_device_operations ide_fops[]; extern ide_proc_entry_t generic_subdriver_entries[]; -#endif - -int ide_reinit_drive (ide_drive_t *drive); -#ifdef _IDE_C -# ifdef CONFIG_BLK_DEV_IDE +#ifdef CONFIG_BLK_DEV_IDE /* Probe for devices attached to the systems host controllers. */ extern int ideprobe_init (void); -# endif +#endif #ifdef CONFIG_BLK_DEV_IDEDISK -int idedisk_reinit (ide_drive_t *drive); -int idedisk_init (void); -#endif /* CONFIG_BLK_DEV_IDEDISK */ +extern int idedisk_init (void); +#endif #ifdef CONFIG_BLK_DEV_IDECD -int ide_cdrom_reinit (ide_drive_t *drive); -int ide_cdrom_init (void); -#endif /* CONFIG_BLK_DEV_IDECD */ +extern int ide_cdrom_init (void); +#endif #ifdef CONFIG_BLK_DEV_IDETAPE -int idetape_reinit (ide_drive_t *drive); -int idetape_init (void); -#endif /* CONFIG_BLK_DEV_IDETAPE */ +extern int idetape_init (void); +#endif #ifdef CONFIG_BLK_DEV_IDEFLOPPY -int idefloppy_reinit (ide_drive_t *drive); -int idefloppy_init (void); -#endif /* CONFIG_BLK_DEV_IDEFLOPPY */ +extern int idefloppy_init (void); +#endif #ifdef CONFIG_BLK_DEV_IDESCSI -int idescsi_reinit (ide_drive_t *drive); -int idescsi_init (void); -#endif /* CONFIG_BLK_DEV_IDESCSI */ -#endif /* _IDE_C */ - -extern int ide_register_module (struct ide_driver_s *d); -extern void ide_unregister_module (struct ide_driver_s *d); -ide_drive_t *ide_scan_devices (byte media, const char *name, ide_driver_t *driver, int n); -extern int ide_register_subdriver(ide_drive_t *drive, ide_driver_t *driver); +extern int idescsi_init (void); +#endif + +ide_drive_t *ide_scan_devices (byte media, const char *name, struct ata_operations *driver, int n); +extern int ide_register_subdriver(ide_drive_t *drive, struct ata_operations *driver); extern int ide_unregister_subdriver(ide_drive_t *drive); -extern int ide_replace_subdriver(ide_drive_t *drive, const char *driver); #ifdef CONFIG_BLK_DEV_IDEPCI #define ON_BOARD 1 @@ -1088,7 +1046,7 @@ extern int ide_replace_subdriver(ide_drive_t *drive, const char *driver); # define OFF_BOARD NEVER_BOARD #endif /* CONFIG_BLK_DEV_OFFBOARD */ -void ide_scan_pcibus (int scan_direction) __init; +void __init ide_scan_pcibus(int scan_direction); #endif #ifdef CONFIG_BLK_DEV_IDEDMA #define BAD_DMA_DRIVE 0 @@ -1108,5 +1066,6 @@ extern unsigned long ide_get_or_set_dma_base (ide_hwif_t *hwif, int extra, const extern spinlock_t ide_lock; extern int drive_is_ready(ide_drive_t *drive); +extern void revalidate_drives(void); #endif /* _IDE_H */ diff --git a/include/linux/init_task.h b/include/linux/init_task.h index f97e245dcddc..9f34e057079a 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -52,8 +52,6 @@ mm: NULL, \ active_mm: &init_mm, \ run_list: LIST_HEAD_INIT(tsk.run_list), \ - migration_list: LIST_HEAD_INIT(tsk.migration_list), \ - migration_sem: __MUTEX_INITIALIZER(tsk.migration_sem), \ time_slice: HZ, \ next_task: &tsk, \ prev_task: &tsk, \ diff --git a/include/linux/intermezzo_fs.h b/include/linux/intermezzo_fs.h index 240dd8f24fe6..a0fe6dbc4622 100644 --- a/include/linux/intermezzo_fs.h +++ b/include/linux/intermezzo_fs.h @@ -68,7 +68,7 @@ struct kml_fsdata }; /* super.c */ -struct presto_cache *presto_find_cache(kdev_t dev) ; +struct presto_cache *presto_find_cache(struct super_block *sb) ; extern struct file_system_type presto_fs_type; extern int init_intermezzo_fs(void); @@ -89,7 +89,6 @@ struct presto_cache { int cache_flags; char *cache_root_fileset; /* fileset mounted on cache "/" */ - kdev_t cache_dev; /* underlying block device */ struct super_block *cache_sb; struct dentry *cache_mtde; /* unix mtpt of cache XXX NOT VALID XXX */ char *cache_mtpt; /* again */ diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h index 24696e15dacc..dfd73c5ec60d 100644 --- a/include/linux/irq_cpustat.h +++ b/include/linux/irq_cpustat.h @@ -19,11 +19,13 @@ extern irq_cpustat_t irq_stat[]; /* defined in asm/hardirq.h */ +#ifndef __ARCH_IRQ_STAT /* Some architectures can do this more efficiently */ #ifdef CONFIG_SMP #define __IRQ_STAT(cpu, member) (irq_stat[cpu].member) #else #define __IRQ_STAT(cpu, member) ((void)(cpu), irq_stat[0].member) #endif +#endif /* arch independent irq_stat fields */ #define softirq_pending(cpu) __IRQ_STAT((cpu), __softirq_pending) diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index 37d3d931e416..9c67732fb12f 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h @@ -31,7 +31,7 @@ * provisions above, a recipient may use your version of this file * under either the RHEPL or the GPL. * - * $Id: jffs2.h,v 1.18 2001/03/25 22:36:12 dwmw2 Exp $ + * $Id: jffs2.h,v 1.19 2001/10/09 13:20:23 dwmw2 Exp $ * */ @@ -103,7 +103,7 @@ struct jffs2_unknown_node __u16 nodetype; __u32 totlen; /* So we can skip over nodes we don't grok */ __u32 hdr_crc; -}; +} __attribute__((packed)); struct jffs2_raw_dirent { @@ -121,7 +121,7 @@ struct jffs2_raw_dirent __u32 node_crc; __u32 name_crc; __u8 name[0]; -}; +} __attribute__((packed)); /* The JFFS2 raw inode structure: Used for storage on physical media. */ /* The uid, gid, atime, mtime and ctime members could be longer, but @@ -153,7 +153,7 @@ struct jffs2_raw_inode __u32 data_crc; /* CRC for the (compressed) data. */ __u32 node_crc; /* CRC for the raw inode (excluding data) */ // __u8 data[dsize]; -}; +} __attribute__((packed)); union jffs2_node_union { struct jffs2_raw_inode i; diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h index 2d9ad4e54f5f..626c8c57fb72 100644 --- a/include/linux/jffs2_fs_sb.h +++ b/include/linux/jffs2_fs_sb.h @@ -1,4 +1,4 @@ -/* $Id: jffs2_fs_sb.h,v 1.16 2001/09/18 20:15:18 dwmw2 Exp $ */ +/* $Id: jffs2_fs_sb.h,v 1.16.2.1 2002/02/23 14:13:34 dwmw2 Exp $ */ #ifndef _JFFS2_FS_SB #define _JFFS2_FS_SB @@ -12,6 +12,7 @@ #define INOCACHE_HASHSIZE 1 #define JFFS2_SB_FLAG_RO 1 +#define JFFS2_SB_FLAG_MOUNTING 2 /* A struct for the overall file system control. Pointers to jffs2_sb_info structs are named `c' in the source code. diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 6f3e970f40d4..1125d2fa1cbf 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h @@ -87,8 +87,7 @@ struct svc_export { void nfsd_export_init(void); void nfsd_export_shutdown(void); void exp_readlock(void); -int exp_writelock(void); -void exp_unlock(void); +void exp_readunlock(void); struct svc_client * exp_getclient(struct sockaddr_in *sin); void exp_putclient(struct svc_client *clp); struct svc_export * exp_get(struct svc_client *clp, kdev_t dev, ino_t ino); diff --git a/include/linux/nfsd/interface.h b/include/linux/nfsd/interface.h index 807a4fc6c5f5..80c65165778d 100644 --- a/include/linux/nfsd/interface.h +++ b/include/linux/nfsd/interface.h @@ -12,7 +12,8 @@ #include <linux/config.h> -#ifdef CONFIG_NFSD_MODULE +#ifndef CONFIG_NFSD +#ifdef CONFIG_MODULES extern struct nfsd_linkage { long (*do_nfsservctl)(int cmd, void *argp, void *resp); @@ -20,5 +21,6 @@ extern struct nfsd_linkage { } * nfsd_linkage; #endif +#endif #endif /* LINUX_NFSD_INTERFACE_H */ diff --git a/include/linux/parport.h b/include/linux/parport.h index ce82bcdb5e1a..a41c6be7810e 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -459,7 +459,10 @@ extern void parport_ieee1284_interrupt (int, void *, struct pt_regs *); extern int parport_negotiate (struct parport *, int mode); extern ssize_t parport_write (struct parport *, const void *buf, size_t len); extern ssize_t parport_read (struct parport *, void *buf, size_t len); + +#define PARPORT_INACTIVITY_O_NONBLOCK 1 extern long parport_set_timeout (struct pardevice *, long inactivity); + extern int parport_wait_event (struct parport *, long timeout); extern int parport_wait_peripheral (struct parport *port, unsigned char mask, diff --git a/include/linux/rtc.h b/include/linux/rtc.h index df958b66ada6..e99a2357ab28 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -66,4 +66,17 @@ struct rtc_wkalrm { #define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/ #define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/ +#ifdef __KERNEL__ + +typedef struct rtc_task { + void (*func)(void *private_data); + void *private_data; +} rtc_task_t; + +int rtc_register(rtc_task_t *task); +int rtc_unregister(rtc_task_t *task); +int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg); + +#endif /* __KERNEL__ */ + #endif /* _LINUX_RTC_H_ */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 2992fe65e6aa..c71390735df2 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -286,9 +286,6 @@ struct task_struct { wait_queue_head_t wait_chldexit; /* for wait4() */ struct completion *vfork_done; /* for vfork() */ - list_t migration_list; - struct semaphore migration_sem; - unsigned long rt_priority; unsigned long it_real_value, it_prof_value, it_virt_value; unsigned long it_real_incr, it_prof_incr, it_virt_incr; diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index eee6756b842a..892565ca4721 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -34,13 +34,11 @@ struct rpc_message { * This is the RPC task struct */ struct rpc_task { - struct rpc_task * tk_prev; /* wait queue links */ - struct rpc_task * tk_next; + struct list_head tk_list; /* wait queue links */ #ifdef RPC_DEBUG unsigned long tk_magic; /* 0xf00baa */ #endif - struct rpc_task * tk_next_task; /* global list of tasks */ - struct rpc_task * tk_prev_task; /* global list of tasks */ + struct list_head tk_task; /* global list of tasks */ struct rpc_clnt * tk_client; /* RPC client */ struct rpc_rqst * tk_rqstp; /* RPC request */ int tk_status; /* result of last operation */ @@ -88,6 +86,20 @@ struct rpc_task { #define tk_auth tk_client->cl_auth #define tk_xprt tk_client->cl_xprt +/* support walking a list of tasks on a wait queue */ +#define task_for_each(task, pos, head) \ + list_for_each(pos, head) \ + if ((task=list_entry(pos, struct rpc_task, tk_list)),1) + +#define task_for_first(task, head) \ + if (!list_empty(head) && \ + ((task=list_entry((head)->next, struct rpc_task, tk_list)),1)) + +/* .. and walking list of all tasks */ +#define alltask_for_each(task, pos, head) \ + list_for_each(pos, head) \ + if ((task=list_entry(pos, struct rpc_task, tk_task)),1) + typedef void (*rpc_action)(struct rpc_task *); /* @@ -133,16 +145,24 @@ typedef void (*rpc_action)(struct rpc_task *); * RPC synchronization objects */ struct rpc_wait_queue { - struct rpc_task * task; + struct list_head tasks; #ifdef RPC_DEBUG char * name; #endif }; #ifndef RPC_DEBUG -# define RPC_INIT_WAITQ(name) ((struct rpc_wait_queue) { NULL }) +# define RPC_WAITQ_INIT(var,qname) ((struct rpc_wait_queue) {LIST_HEAD_INIT(var)}) +# define RPC_WAITQ(var,qname) struct rpc_wait_queue var = RPC_WAITQ_INIT(var.tasks,qname) +# define INIT_RPC_WAITQ(ptr,qname) do { \ + INIT_LIST_HEAD(&(ptr)->tasks); \ + } while(0) #else -# define RPC_INIT_WAITQ(name) ((struct rpc_wait_queue) { NULL, name }) +# define RPC_WAITQ_INIT(var,qname) ((struct rpc_wait_queue) {LIST_HEAD_INIT(var.tasks), qname}) +# define RPC_WAITQ(var,qname) struct rpc_wait_queue var = RPC_WAITQ_INIT(var,qname) +# define INIT_RPC_WAITQ(ptr,qname) do { \ + INIT_LIST_HEAD(&(ptr)->tasks); (ptr)->name = qname; \ + } while(0) #endif /* diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index f6439cb4facf..2d2461bb38c8 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -27,8 +27,8 @@ * We currently do not support more than one RPC program per daemon. */ struct svc_serv { - struct svc_rqst * sv_threads; /* idle server threads */ - struct svc_sock * sv_sockets; /* pending sockets */ + struct list_head sv_threads; /* idle server threads */ + struct list_head sv_sockets; /* pending sockets */ struct svc_program * sv_program; /* RPC program */ struct svc_stat * sv_stats; /* RPC statistics */ spinlock_t sv_lock; @@ -36,7 +36,9 @@ struct svc_serv { unsigned int sv_bufsz; /* datagram buffer size */ unsigned int sv_xdrsize; /* XDR buffer size */ - struct svc_sock * sv_allsocks; /* all sockets */ + struct list_head sv_permsocks; /* all permanent sockets */ + struct list_head sv_tempsocks; /* all temporary sockets */ + int sv_tmpcnt; /* count of temporary sockets */ char * sv_name; /* service name */ }; @@ -89,8 +91,7 @@ struct svc_buf { * NOTE: First two items must be prev/next. */ struct svc_rqst { - struct svc_rqst * rq_prev; /* idle list */ - struct svc_rqst * rq_next; + struct list_head rq_list; /* idle list */ struct svc_sock * rq_sock; /* socket */ struct sockaddr_in rq_addr; /* peer address */ int rq_addrlen; @@ -115,6 +116,10 @@ struct svc_rqst { void * rq_argp; /* decoded arguments */ void * rq_resp; /* xdr'd results */ + int rq_reserved; /* space on socket outq + * reserved for this request + */ + /* Catering to nfsd */ struct svc_client * rq_client; /* RPC peer info */ struct svc_cacherep * rq_cacherep; /* cache info */ @@ -163,6 +168,7 @@ struct svc_procedure { unsigned int pc_ressize; /* result struct size */ unsigned int pc_count; /* call count */ unsigned int pc_cachetype; /* cache info (NFS) */ + unsigned int pc_xdrressize; /* maximum size of XDR reply */ }; /* @@ -180,5 +186,6 @@ void svc_destroy(struct svc_serv *); int svc_process(struct svc_serv *, struct svc_rqst *); int svc_register(struct svc_serv *, int, unsigned short); void svc_wake_up(struct svc_serv *); +void svc_reserve(struct svc_rqst *rqstp, int space); #endif /* SUNRPC_SVC_H */ diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 82d9678d4905..95f52982b49e 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h @@ -13,38 +13,38 @@ /* * RPC server socket. - * NOTE: First two items must be prev/next. */ struct svc_sock { - struct svc_sock * sk_prev; /* list of ready sockets */ - struct svc_sock * sk_next; - struct svc_sock * sk_list; /* list of all sockets */ + struct list_head sk_ready; /* list of ready sockets */ + struct list_head sk_list; /* list of all sockets */ struct socket * sk_sock; /* berkeley socket layer */ struct sock * sk_sk; /* INET layer */ - spinlock_t sk_lock; struct svc_serv * sk_server; /* service for this socket */ unsigned char sk_inuse; /* use count */ - unsigned char sk_busy; /* enqueued/receiving */ - unsigned char sk_conn; /* conn pending */ - unsigned char sk_close; /* dead or dying */ - int sk_data; /* data pending */ - unsigned int sk_temp : 1, /* temp socket */ - sk_qued : 1, /* on serv->sk_sockets */ - sk_dead : 1; /* socket closed */ + unsigned int sk_flags; +#define SK_BUSY 0 /* enqueued/receiving */ +#define SK_CONN 1 /* conn pending */ +#define SK_CLOSE 2 /* dead or dying */ +#define SK_DATA 3 /* data pending */ +#define SK_TEMP 4 /* temp (TCP) socket */ +#define SK_QUED 5 /* on serv->sk_sockets */ +#define SK_DEAD 6 /* socket closed */ + + int sk_reserved; /* space on outq that is reserved */ + int (*sk_recvfrom)(struct svc_rqst *rqstp); int (*sk_sendto)(struct svc_rqst *rqstp); /* We keep the old state_change and data_ready CB's here */ void (*sk_ostate)(struct sock *); void (*sk_odata)(struct sock *, int bytes); + void (*sk_owspace)(struct sock *); /* private TCP part */ int sk_reclen; /* length of record */ int sk_tcplen; /* current read length */ - - /* Debugging */ - struct svc_rqst * sk_rqstp; + time_t sk_lastrecv; /* time of last received request */ }; /* @@ -55,5 +55,6 @@ void svc_delete_socket(struct svc_sock *); int svc_recv(struct svc_serv *, struct svc_rqst *, long); int svc_send(struct svc_rqst *); void svc_drop(struct svc_rqst *); +void svc_sock_update_bufs(struct svc_serv *serv); #endif /* SUNRPC_SVCSOCK_H */ diff --git a/include/linux/sunrpc/types.h b/include/linux/sunrpc/types.h index 232ac45c725e..d524016fb4ba 100644 --- a/include/linux/sunrpc/types.h +++ b/include/linux/sunrpc/types.h @@ -12,60 +12,7 @@ #include <linux/timer.h> #include <linux/tqueue.h> #include <linux/sunrpc/debug.h> - -/* - * These are the RPC list manipulation primitives used everywhere. - */ -struct rpc_listitem { - struct rpc_listitem * prev; - struct rpc_listitem * next; -}; - -static __inline__ void -__rpc_append_list(struct rpc_listitem **q, struct rpc_listitem *item) -{ - struct rpc_listitem *next, *prev; - - if (!(next = *q)) { - *q = item->next = item->prev = item; - } else { - prev = next->prev; - prev->next = item; - next->prev = item; - item->next = next; - item->prev = prev; - } -} - -static __inline__ void -__rpc_insert_list(struct rpc_listitem **q, struct rpc_listitem *item) -{ - __rpc_append_list(q, item); - *q = item; -} - -static __inline__ void -__rpc_remove_list(struct rpc_listitem **q, struct rpc_listitem *item) -{ - struct rpc_listitem *prev = item->prev, - *next = item->next; - - if (item != prev) { - next->prev = prev; - prev->next = next; - } else { - next = NULL; - } - if (*q == item) - *q = next; -} - -#define rpc_insert_list(q, i) \ - __rpc_insert_list((struct rpc_listitem **) q, (struct rpc_listitem *) i) -#define rpc_append_list(q, i) \ - __rpc_append_list((struct rpc_listitem **) q, (struct rpc_listitem *) i) -#define rpc_remove_list(q, i) \ - __rpc_remove_list((struct rpc_listitem **) q, (struct rpc_listitem *) i) +#include <linux/list.h> /* * Shorthands diff --git a/include/linux/usb.h b/include/linux/usb.h index 583af126199b..391668010831 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -44,8 +44,8 @@ /* * USB directions */ -#define USB_DIR_OUT 0 -#define USB_DIR_IN 0x80 +#define USB_DIR_OUT 0 /* to device */ +#define USB_DIR_IN 0x80 /* to host */ /* * Endpoints @@ -148,12 +148,6 @@ struct usb_devmap { unsigned long devicemap[128 / (8*sizeof(unsigned long))]; }; -#define USB_MAXBUS 64 - -struct usb_busmap { - unsigned long busmap[USB_MAXBUS / (8*sizeof(unsigned long))]; -}; - struct usb_device; /*-------------------------------------------------------------------------*/ @@ -516,7 +510,8 @@ struct usb_device_id { * work to connect to a device should be done when the device is opened, * and undone at the last close. The disconnect code needs to address * concurrency issues with respect to open() and close() methods, as - * well as cancel any I/O requests that are still pending. + * well as forcing all pending I/O requests to complete (by unlinking + * them as necessary, and blocking until the unlinks complete). */ struct usb_driver { struct module *owner; @@ -905,13 +900,7 @@ extern int usb_make_path(struct usb_device *dev, char *buf, size_t size); /* Host Controller Driver (HCD) support */ -struct usb_operations { - int (*allocate)(struct usb_device *); - int (*deallocate)(struct usb_device *); - int (*get_frame_number) (struct usb_device *usb_dev); - int (*submit_urb) (struct urb *urb, int mem_flags); - int (*unlink_urb) (struct urb *urb); -}; +struct usb_operations; #define DEVNUM_ROUND_ROBIN /***** OPTION *****/ @@ -944,41 +933,12 @@ struct usb_bus { atomic_t refcnt; }; -extern struct usb_bus *usb_alloc_bus(struct usb_operations *); -extern void usb_free_bus(struct usb_bus *); -extern void usb_register_bus(struct usb_bus *); -extern void usb_deregister_bus(struct usb_bus *); -extern int usb_register_root_hub(struct usb_device *usb_dev, struct device *parent_dev); - -extern int usb_check_bandwidth (struct usb_device *dev, struct urb *urb); -extern void usb_claim_bandwidth (struct usb_device *dev, struct urb *urb, - int bustime, int isoc); -extern void usb_release_bandwidth(struct usb_device *dev, struct urb *urb, - int isoc); +// FIXME: root_hub_string vanishes when "usb_hcd" conversion is done, +// along with pre-hcd versions of the OHCI and UHCI drivers. extern int usb_root_hub_string(int id, int serial, char *type, __u8 *data, int len); /* - * Some USB 1.1 bandwidth allocation constants. - */ -#define BW_HOST_DELAY 1000L /* nanoseconds */ -#define BW_HUB_LS_SETUP 333L /* nanoseconds */ - /* 4 full-speed bit times (est.) */ - -#define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */ -#define FRAME_TIME_MAX_BITS_ALLOC (90L * FRAME_TIME_BITS / 100L) -#define FRAME_TIME_USECS 1000L -#define FRAME_TIME_MAX_USECS_ALLOC (90L * FRAME_TIME_USECS / 100L) - -#define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */ - /* Trying not to use worst-case bit-stuffing - of (7/6 * 8 * bytecount) = 9.33 * bytecount */ - /* bytecount = data payload byte count */ - -#define NS_TO_US(ns) ((ns + 500L) / 1000L) - /* convert & round nanoseconds to microseconds */ - -/* * As of USB 2.0, full/low speed devices are segregated into trees. * One type grows from USB 1.1 host controllers (OHCI, UHCI etc). * The other type grows from high speed hubs when they connect to @@ -1209,13 +1169,11 @@ void usb_show_string(struct usb_device *dev, char *id, int index); /* -------------------------------------------------------------------------- */ /* - * bus and driver list + * driver list * exported only for usbfs (not visible outside usbcore) */ extern struct list_head usb_driver_list; -extern struct list_head usb_bus_list; -extern struct semaphore usb_bus_list_lock; /* * USB device fs stuff diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 5701028e1d23..70dc293be1e2 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h @@ -135,6 +135,7 @@ typedef struct _snd_ac97 ac97_t; struct _snd_ac97 { void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val); unsigned short (*read) (ac97_t *ac97, unsigned short reg); + void (*wait) (ac97_t *ac97); void (*init) (ac97_t *ac97); snd_info_entry_t *proc_entry; snd_info_entry_t *proc_regs_entry; diff --git a/include/sound/asound.h b/include/sound/asound.h index 013e59fb6eb4..3c7df6d59649 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h @@ -127,7 +127,7 @@ enum { * * *****************************************************************************/ -#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) +#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 1) typedef unsigned long sndrv_pcm_uframes_t; typedef long sndrv_pcm_sframes_t; @@ -411,6 +411,7 @@ enum { SNDRV_PCM_IOCTL_PAUSE = _IOW('A', 0x45, int), SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, sndrv_pcm_uframes_t), SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47), + SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48), SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct sndrv_xferi), SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct sndrv_xferi), SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct sndrv_xfern), @@ -578,7 +579,7 @@ struct sndrv_timer_read { * * ****************************************************************************/ -#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) +#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) struct sndrv_ctl_card_info { int card; /* card number */ diff --git a/include/sound/core.h b/include/sound/core.h index ebd845c0191b..5744cdd5cc8e 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -292,13 +292,21 @@ unsigned int snd_dma_residue(unsigned long dma); /* misc.c */ int snd_task_name(struct task_struct *task, char *name, size_t size); +#ifdef CONFIG_SND_VERBOSE_PRINTK +int snd_verbose_printk(const char *file, int line, const char *format); +#endif /* --- */ +#ifdef CONFIG_SND_VERBOSE_PRINTK +#define snd_printk(format, args...) do { \ + printk(snd_verbose_printk(__FILE__, __LINE__, format) ? format + 3 : format, ##args); \ +} while (0) +#else #define snd_printk(format, args...) do { \ - printk("ALSA %s:%d: ", __FILE__, __LINE__); \ printk(format, ##args); \ } while (0) +#endif #ifdef CONFIG_SND_DEBUG diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 4705a929d7d6..3f03bec0cf41 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h @@ -588,7 +588,7 @@ #define REG53 0x53 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ #define A_DBG 0x53 -#define A_DBG_SINGLE_STEP_ADDR 0x00020000 /* Set to zero to start dsp */ +#define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */ #define A_DBG_ZC 0x40000000 /* zero tram counter */ #define A_DBG_STEP_ADDR 0x000003ff #define A_DBG_SATURATION_OCCURED 0x20000000 @@ -657,6 +657,11 @@ #define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */ #define SRCS_ESTSAMPLERATE 0x0007ffff /* Do not modify this field. */ +/* Note that these values can vary +/- by a small amount */ +#define SRCS_SPDIFRATE_44 0x0003acd9 +#define SRCS_SPDIFRATE_48 0x00040000 +#define SRCS_SPDIFRATE_96 0x00080000 + #define MICIDX 0x63 /* Microphone recording buffer index register */ #define MICIDX_MASK 0x0000ffff /* 16-bit value */ #define MICIDX_IDX 0x10000063 @@ -683,15 +688,15 @@ #define A_MUSTAT2 A_MUCMD2 #define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ -#define A_SPDIF_48000 0x00000000 -#define A_SPDIF_44100 0x00000040 -#define A_SPDIF_96000 0x00000080 +#define A_SPDIF_48000 0x00000080 +#define A_SPDIF_44100 0x00000000 +#define A_SPDIF_96000 0x00000040 #define A_FXRT2 0x7c -#define A_FXRT_CHANNELE 0x0000003f /* Effects send bus number for channel's effects send A */ -#define A_FXRT_CHANNELF 0x00003f00 /* Effects send bus number for channel's effects send B */ -#define A_FXRT_CHANNELG 0x003f0000 /* Effects send bus number for channel's effects send C */ -#define A_FXRT_CHANNELH 0x3f000000 /* Effects send bus number for channel's effects send D */ +#define A_FXRT_CHANNELE 0x0000003f /* Effects send bus number for channel's effects send E */ +#define A_FXRT_CHANNELF 0x00003f00 /* Effects send bus number for channel's effects send F */ +#define A_FXRT_CHANNELG 0x003f0000 /* Effects send bus number for channel's effects send G */ +#define A_FXRT_CHANNELH 0x3f000000 /* Effects send bus number for channel's effects send H */ #define A_SENDAMOUNTS 0x7d #define A_FXSENDAMOUNT_E_MASK 0xFF000000 @@ -797,8 +802,8 @@ struct _snd_emu10k1_pcm { }; typedef struct { - unsigned long send_routing[3]; - unsigned char send_volume[3][4]; + unsigned char send_routing[3][8]; + unsigned char send_volume[3][8]; unsigned short attn[3]; snd_kcontrol_t *ctl_send_routing; snd_kcontrol_t *ctl_send_volume; @@ -806,6 +811,15 @@ typedef struct { emu10k1_pcm_t *epcm; } emu10k1_pcm_mixer_t; +#define snd_emu10k1_compose_send_routing(route) \ +((route[0] | (route[1] << 4) | (route[2] << 8) | (route[3] << 12)) << 16) + +#define snd_emu10k1_compose_audigy_fxrt1(route) \ +(((unsigned int)route[0] | ((unsigned int)route[1] << 8) | ((unsigned int)route[2] << 16) | ((unsigned int)route[3] << 12)) << 24) + +#define snd_emu10k1_compose_audigy_fxrt2(route) \ +(((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 12)) << 24) + typedef struct snd_emu10k1_memblk { snd_util_memblk_t mem; /* private part */ @@ -1102,11 +1116,11 @@ int snd_emu10k1_proc_done(emu10k1_t * emu); #define GPR_NOISE1 0x59 /* noise source */ #define GPR_IRQ 0x5a /* IRQ register */ #define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */ -#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ -#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + (x)) /* x = 0x00 - 0x7f */ -#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 80 + (x)) /* x = 0x00 - 0x1f */ -#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + (x)) /* x = 0x00 - 0x7f */ -#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 80 + (x)) /* x = 0x00 - 0x1f */ +#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ +#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ +#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ +#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ +#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f? */ #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x1f? */ @@ -1171,6 +1185,10 @@ int snd_emu10k1_proc_done(emu10k1_t * emu); #define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ #define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */ #define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */ +#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */ +#define A_EXTIN_LINE2_R 0x09 /* right */ +#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */ +#define A_EXTIN_AUX2_R 0x0d /* - right */ /* Audigiy Outputs */ #define A_EXTOUT_FRONT_L 0x00 /* digital front left */ @@ -1189,9 +1207,38 @@ int snd_emu10k1_proc_done(emu10k1_t * emu); /* 0x0d ?? */ #define A_EXTOUT_AREAR_L 0x0e /* analog rear left */ #define A_EXTOUT_AREAR_R 0x0f /* right */ -/* 0x10-0x15 ?? */ -#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */ -#define A_EXTOUT_ADC_CAP_R 0x17 /* right */ +#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */ +#define A_EXTOUT_AC97_R 0x11 /* right */ +#define A_EXTOUT_ADC_CAP_L 0x12 /* ADC capture buffer left */ +#define A_EXTOUT_ADC_CAP_R 0x13 /* right */ + +/* Audigy constants */ +#define A_C_00000000 0xc0 +#define A_C_00000001 0xc1 +#define A_C_00000002 0xc2 +#define A_C_00000003 0xc3 +#define A_C_00000004 0xc4 +#define A_C_00000008 0xc5 +#define A_C_00000010 0xc6 +#define A_C_00000020 0xc7 +#define A_C_00000100 0xc8 +#define A_C_00010000 0xc9 +#define A_C_00000800 0xca +#define A_C_10000000 0xcb +#define A_C_20000000 0xcc +#define A_C_40000000 0xcd +#define A_C_80000000 0xce +#define A_C_7fffffff 0xcf +#define A_C_ffffffff 0xd0 +#define A_C_fffffffe 0xd1 +#define A_C_c0000000 0xd2 +#define A_C_4f1bbcdc 0xd3 +#define A_C_5a7ef9db 0xd4 +#define A_C_00100000 0xd5 +/* 0xd6 = 0x7fffffff (?) ACCUM? */ +/* 0xd7 = 0x0000000 CCR */ +/* 0xd8 = noise1 */ +/* 0xd9 = noise2 */ /* definitions for debug register */ #define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */ diff --git a/include/sound/version.h b/include/sound/version.h index eac7e72f5513..50a7e6f090d8 100644 --- a/include/sound/version.h +++ b/include/sound/version.h @@ -1,3 +1,3 @@ /* include/version.h. Generated automatically by configure. */ -#define CONFIG_SND_VERSION "0.9.0beta11" -#define CONFIG_SND_DATE " (Tue Feb 19 08:14:59 2002 UTC)" +#define CONFIG_SND_VERSION "0.9.0beta12" +#define CONFIG_SND_DATE " (Tue Feb 26 09:34:24 2002 UTC)" |
