From e07a1a2666e6684ac97bbf142cc2f80de3010d23 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 23 Nov 2007 15:22:34 -0500 Subject: [PATCH] Linux 2.2.18pre15 o Default msdos behaviour to old (small) letters (Alan Cox) | An option 'big' goes with 'small' o Fix define collision in cpqfc (Arjan van de Ven) o Fix case where scripts/kwhich isnt executable (Alan Cox) o Alpha FPU divide fix (Richard Henderson) o Add ADMtek985 to the tulip list (J Katz) o Lose excess ymfpci debugging (Rob Landley) o Fix i2c bus id clash (Russell King) o Update the ARM vidc driver (Russell King) o Update the ARM am79c961a driver (Russell King) o Fix parport_pc build with no PCI (Russell King) o Fix ARM memzero (Russell King) o Update ARM for __init and __setup (Russell King) o Update ARM to loops_per_jiffy (Russell King) o Remove arm ecard debug messages (Russell King) o Fix ARM makefiles (Russell King) o Fix iph5526 driver to use mdelay (Arjan van de Ven) o Fix epca, dtlk, aha152x loops_per_sec bits (Philipp Rumpf) o Fix smp tlb invalidate and bogomip printing (Philipp Rumpf) o Fix NLS warnings (Arjan van de Ven) o Fix wavfront conversion to loops_per_jiffies (Alan Cox) o Fix an audio problem and a sanyo changer (Jens Axboe) problem o Fix include bug with divert (Alan Cox) | Alternate fix to Willy Tarreau's o Fix Alpha for loops_per_jiffy (Willy Tarreau) --- Documentation/cdrom/cdrom-standard.tex | 2 +- Documentation/cdrom/ide-cd | 2 +- MAINTAINERS | 4 +- Makefile | 4 +- arch/alpha/kernel/setup.c | 2 +- arch/alpha/kernel/smp.c | 2 +- arch/alpha/math-emu/Makefile | 2 +- arch/alpha/math-emu/math.c | 60 --- arch/alpha/math-emu/qrnnd.S | 163 ++++++++ arch/alpha/math-emu/sfp-util.h | 17 +- arch/arm/boot/Makefile | 4 +- arch/arm/kernel/ecard.c | 4 - arch/arm/kernel/iic.c | 4 +- arch/arm/kernel/setup.c | 4 +- arch/arm/lib/delay.S | 2 +- arch/arm/lib/memzero.S | 140 +++---- arch/arm/vmlinux-armo.lds.in | 124 +++--- arch/arm/vmlinux-armv.lds.in | 13 + arch/i386/kernel/setup.c | 4 +- arch/i386/kernel/smp.c | 6 +- drivers/block/acsi.c | 6 +- drivers/block/ide-cd.c | 21 +- drivers/block/rd.c | 2 + drivers/cdrom/cdrom.c | 33 +- drivers/char/dtlk.c | 2 +- drivers/char/epca.c | 4 +- drivers/misc/parport_pc.c | 4 +- drivers/net/am79c961a.c | 216 ++++++---- drivers/net/am79c961a.h | 8 +- drivers/net/fc/iph5526.c | 4 +- drivers/net/tulip.c | 2 + drivers/scsi/aha152x.c | 2 - drivers/scsi/cpqfcTSstructs.h | 37 +- drivers/scsi/sr.c | 2 +- drivers/sound/Makefile | 2 +- drivers/sound/vidc.c | 534 ++++++++++++++++++++++--- drivers/sound/vidc.h | 11 +- drivers/sound/vidc_audio.c | 313 --------------- drivers/sound/vidc_fill.S | 19 +- drivers/sound/vidc_mixer.c | 151 ------- drivers/sound/vidc_synth.c | 4 + drivers/sound/wavfront.c | 6 +- drivers/sound/ymfpci.c | 14 +- fs/adfs/super.c | 3 +- fs/fat/inode.c | 5 +- fs/nls/nls_base.c | 2 +- fs/nls/nls_cp437.c | 2 +- fs/nls/nls_cp737.c | 2 +- fs/nls/nls_cp775.c | 2 +- fs/nls/nls_cp850.c | 2 +- fs/nls/nls_cp852.c | 2 +- fs/nls/nls_cp855.c | 2 +- fs/nls/nls_cp857.c | 2 +- fs/nls/nls_cp860.c | 2 +- fs/nls/nls_cp861.c | 2 +- fs/nls/nls_cp862.c | 2 +- fs/nls/nls_cp863.c | 2 +- fs/nls/nls_cp864.c | 2 +- fs/nls/nls_cp865.c | 2 +- fs/nls/nls_cp866.c | 2 +- fs/nls/nls_cp869.c | 2 +- fs/nls/nls_cp874.c | 2 +- fs/nls/nls_cp932.c | 6 +- fs/nls/nls_cp936.c | 2 +- fs/nls/nls_cp949.c | 2 +- fs/nls/nls_cp950.c | 2 +- fs/nls/nls_iso8859-1.c | 2 +- fs/nls/nls_iso8859-14.c | 2 +- fs/nls/nls_iso8859-15.c | 2 +- fs/nls/nls_iso8859-2.c | 2 +- fs/nls/nls_iso8859-3.c | 2 +- fs/nls/nls_iso8859-4.c | 2 +- fs/nls/nls_iso8859-5.c | 2 +- fs/nls/nls_iso8859-6.c | 2 +- fs/nls/nls_iso8859-7.c | 2 +- fs/nls/nls_iso8859-8.c | 2 +- fs/nls/nls_iso8859-9.c | 2 +- fs/nls/nls_koi8-r.c | 2 +- include/asm-alpha/delay.h | 13 +- include/asm-alpha/smp.h | 2 +- include/linux/i2c.h | 3 +- include/linux/netdevice.h | 2 + include/linux/nls.h | 2 +- init/main.c | 4 +- 84 files changed, 1126 insertions(+), 938 deletions(-) create mode 100644 arch/alpha/math-emu/qrnnd.S delete mode 100644 drivers/sound/vidc_audio.c delete mode 100644 drivers/sound/vidc_mixer.c diff --git a/Documentation/cdrom/cdrom-standard.tex b/Documentation/cdrom/cdrom-standard.tex index 1bf6434cbff6..56dd21bc8242 100644 --- a/Documentation/cdrom/cdrom-standard.tex +++ b/Documentation/cdrom/cdrom-standard.tex @@ -24,7 +24,7 @@ \title{A \linux\ \cdrom\ standard} \author{David van Leeuwen\\{\normalsize\tt david@ElseWare.cistron.nl} \\{\footnotesize updated by Erik Andersen {\tt(andersee@debian.org)}} -\\{\footnotesize updated by Jens Axboe {\tt(axboe@image.dk)}}} +\\{\footnotesize updated by Jens Axboe {\tt(axboe@suse.de)}}} \date{12 March 1999} \maketitle diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd index b5967f506893..ac202df58103 100644 --- a/Documentation/cdrom/ide-cd +++ b/Documentation/cdrom/ide-cd @@ -1,7 +1,7 @@ IDE-CD driver documentation Originally by scott snyder (19 May 1996) Carrying on the torch is: Erik Andersen -New maintainers (19 Oct 1998): Jens Axboe +New maintainer (19 Oct 1998): Jens Axboe 1. Introduction --------------- diff --git a/MAINTAINERS b/MAINTAINERS index fca825504cbd..812943f55d02 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -468,7 +468,7 @@ S: Maintained IDE/ATAPI CDROM DRIVER P: Jens Axboe -M: axboe@image.dk +M: axboe@suse.de L: linux-kernel@vger.kernel.org S: Maintained @@ -943,7 +943,7 @@ S: Maintained UNIFORM CDROM DRIVER P: Jens Axboe -M: axboe@image.dk +M: axboe@suse.de L: linux-kernel@vger.kernel.org S: Maintained diff --git a/Makefile b/Makefile index 6d079f9fa4db..c4c3406a63f8 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 2 SUBLEVEL = 18 -EXTRAVERSION = pre14 +EXTRAVERSION = pre15 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) @@ -29,7 +29,7 @@ LD =$(CROSS_COMPILE)ld # otherwise 'cc' # CC =$(shell if [ -n "$(CROSS_COMPILE)" ]; then echo $(CROSS_COMPILE)gcc; else \ - scripts/kwhich gcc272 2>/dev/null || scripts/kwhich kgcc 2>/dev/null || echo cc; fi) \ + $(CONFIG_SHELL) scripts/kwhich gcc272 2>/dev/null || $(CONFIG_SHELL) scripts/kwhich kgcc 2>/dev/null || echo cc; fi) \ -D__KERNEL__ -I$(HPATH) CPP =$(CC) -E AR =$(CROSS_COMPILE)ar diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index 4aa45c911cf7..bac5fe1e6682 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -841,7 +841,7 @@ int get_cpuinfo(char *buffer) hwrpb->pagesize, hwrpb->pa_bits, hwrpb->max_asn, - loops_per_sec / 500000, (loops_per_sec / 5000) % 100, + loops_per_jiffy * HZ / 500000, (loops_per_jiffy * HZ / 5000) % 100, unaligned[0].count, unaligned[0].pc, unaligned[0].va, unaligned[1].count, unaligned[1].pc, unaligned[1].va, platform_string(), nr_processors); diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 092194bcdc8a..65664c76bda7 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -94,7 +94,7 @@ smp_setup(char *str, int *ints) static inline void __init smp_store_cpu_info(int cpuid) { - cpu_data[cpuid].loops_per_sec = loops_per_sec; + cpu_data[cpuid].loops_per_jiffy = loops_per_jiffy; cpu_data[cpuid].last_asn = (cpuid << WIDTH_HARDWARE_ASN) + ASN_FIRST_VERSION; diff --git a/arch/alpha/math-emu/Makefile b/arch/alpha/math-emu/Makefile index b5fc3776568a..91e5ba660ecc 100644 --- a/arch/alpha/math-emu/Makefile +++ b/arch/alpha/math-emu/Makefile @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definition is now in the main makefile... O_TARGET := math-emu.o -O_OBJS := math.o +O_OBJS := math.o qrnnd.o CFLAGS += -I. -I$(TOPDIR)/include/math-emu -w ifeq ($(CONFIG_MATHEMU),m) diff --git a/arch/alpha/math-emu/math.c b/arch/alpha/math-emu/math.c index 8434e46b1d65..61f22c618111 100644 --- a/arch/alpha/math-emu/math.c +++ b/arch/alpha/math-emu/math.c @@ -84,66 +84,6 @@ void cleanup_module(void) #endif /* MODULE */ -/* For 128-bit division. */ - -void -udiv128(unsigned long divisor_f0, unsigned long divisor_f1, - unsigned long dividend_f0, unsigned long dividend_f1, - unsigned long *quot, unsigned long *remd) -{ - _FP_FRAC_DECL_2(quo); - _FP_FRAC_DECL_2(rem); - _FP_FRAC_DECL_2(tmp); - unsigned long i, num_bits, bit; - - _FP_FRAC_SET_2(rem, _FP_ZEROFRAC_2); - _FP_FRAC_SET_2(quo, _FP_ZEROFRAC_2); - - if (_FP_FRAC_ZEROP_2(divisor)) - goto out; - - if (_FP_FRAC_GT_2(divisor, dividend)) { - _FP_FRAC_COPY_2(rem, dividend); - goto out; - } - - if (_FP_FRAC_EQ_2(divisor, dividend)) { - __FP_FRAC_SET_2(quo, 0, 1); - goto out; - } - - num_bits = 128; - while (1) { - bit = _FP_FRAC_NEGP_2(dividend); - _FP_FRAC_COPY_2(tmp, rem); - _FP_FRAC_SLL_2(tmp, 1); - _FP_FRAC_LOW_2(tmp) |= bit; - if (! _FP_FRAC_GE_2(tmp, divisor)) - break; - _FP_FRAC_COPY_2(rem, tmp); - _FP_FRAC_SLL_2(dividend, 1); - num_bits--; - } - - for (i = 0; i < num_bits; i++) { - bit = _FP_FRAC_NEGP_2(dividend); - _FP_FRAC_SLL_2(rem, 1); - _FP_FRAC_LOW_2(rem) |= bit; - _FP_FRAC_SUB_2(tmp, rem, divisor); - bit = _FP_FRAC_NEGP_2(tmp); - _FP_FRAC_SLL_2(dividend, 1); - _FP_FRAC_SLL_2(quo, 1); - if (!bit) { - _FP_FRAC_LOW_2(quo) |= 1; - _FP_FRAC_COPY_2(rem, tmp); - } - } - -out: - *quot = quo_f1; - *remd = rem_f1; - return; -} /* * Emulate the floating point instruction at address PC. Returns 0 if diff --git a/arch/alpha/math-emu/qrnnd.S b/arch/alpha/math-emu/qrnnd.S new file mode 100644 index 000000000000..d6373ec1bff9 --- /dev/null +++ b/arch/alpha/math-emu/qrnnd.S @@ -0,0 +1,163 @@ + # Alpha 21064 __udiv_qrnnd + # Copyright (C) 1992, 1994, 1995, 2000 Free Software Foundation, Inc. + + # This file is part of GCC. + + # The GNU MP Library 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. + + # In addition to the permissions in the GNU General Public License, the + # Free Software Foundation gives you unlimited permission to link the + # compiled version of this file with other programs, and to distribute + # those programs without any restriction coming from the use of this + # file. (The General Public License restrictions do apply in other + # respects; for example, they cover modification of the file, and + # distribution when not linked into another program.) + + # This file 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 Library General Public + # License for more details. + + # You should have received a copy of the GNU General Public License + # along with GCC; see the file COPYING. If not, write to the + # Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + # MA 02111-1307, USA. + + .set noreorder + .set noat + + .text + + .globl __udiv_qrnnd + .ent __udiv_qrnnd +__udiv_qrnnd: + .frame $30,0,$26,0 + .prologue 0 + +#define cnt $2 +#define tmp $3 +#define rem_ptr $16 +#define n1 $17 +#define n0 $18 +#define d $19 +#define qb $20 +#define AT $at + + ldiq cnt,16 + blt d,$largedivisor + +$loop1: cmplt n0,0,tmp + addq n1,n1,n1 + bis n1,tmp,n1 + addq n0,n0,n0 + cmpule d,n1,qb + subq n1,d,tmp + cmovne qb,tmp,n1 + bis n0,qb,n0 + cmplt n0,0,tmp + addq n1,n1,n1 + bis n1,tmp,n1 + addq n0,n0,n0 + cmpule d,n1,qb + subq n1,d,tmp + cmovne qb,tmp,n1 + bis n0,qb,n0 + cmplt n0,0,tmp + addq n1,n1,n1 + bis n1,tmp,n1 + addq n0,n0,n0 + cmpule d,n1,qb + subq n1,d,tmp + cmovne qb,tmp,n1 + bis n0,qb,n0 + cmplt n0,0,tmp + addq n1,n1,n1 + bis n1,tmp,n1 + addq n0,n0,n0 + cmpule d,n1,qb + subq n1,d,tmp + cmovne qb,tmp,n1 + bis n0,qb,n0 + subq cnt,1,cnt + bgt cnt,$loop1 + stq n1,0(rem_ptr) + bis $31,n0,$0 + ret $31,($26),1 + +$largedivisor: + and n0,1,$4 + + srl n0,1,n0 + sll n1,63,tmp + or tmp,n0,n0 + srl n1,1,n1 + + and d,1,$6 + srl d,1,$5 + addq $5,$6,$5 + +$loop2: cmplt n0,0,tmp + addq n1,n1,n1 + bis n1,tmp,n1 + addq n0,n0,n0 + cmpule $5,n1,qb + subq n1,$5,tmp + cmovne qb,tmp,n1 + bis n0,qb,n0 + cmplt n0,0,tmp + addq n1,n1,n1 + bis n1,tmp,n1 + addq n0,n0,n0 + cmpule $5,n1,qb + subq n1,$5,tmp + cmovne qb,tmp,n1 + bis n0,qb,n0 + cmplt n0,0,tmp + addq n1,n1,n1 + bis n1,tmp,n1 + addq n0,n0,n0 + cmpule $5,n1,qb + subq n1,$5,tmp + cmovne qb,tmp,n1 + bis n0,qb,n0 + cmplt n0,0,tmp + addq n1,n1,n1 + bis n1,tmp,n1 + addq n0,n0,n0 + cmpule $5,n1,qb + subq n1,$5,tmp + cmovne qb,tmp,n1 + bis n0,qb,n0 + subq cnt,1,cnt + bgt cnt,$loop2 + + addq n1,n1,n1 + addq $4,n1,n1 + bne $6,$Odd + stq n1,0(rem_ptr) + bis $31,n0,$0 + ret $31,($26),1 + +$Odd: + /* q' in n0. r' in n1 */ + addq n1,n0,n1 + + cmpult n1,n0,tmp # tmp := carry from addq + subq n1,d,AT + addq n0,tmp,n0 + cmovne tmp,AT,n1 + + cmpult n1,d,tmp + addq n0,1,AT + cmoveq tmp,AT,n0 + subq n1,d,AT + cmoveq tmp,AT,n1 + + stq n1,0(rem_ptr) + bis $31,n0,$0 + ret $31,($26),1 + + .end __udiv_qrnnd diff --git a/arch/alpha/math-emu/sfp-util.h b/arch/alpha/math-emu/sfp-util.h index 7a6a8cf45d49..f53707f77455 100644 --- a/arch/alpha/math-emu/sfp-util.h +++ b/arch/alpha/math-emu/sfp-util.h @@ -17,18 +17,13 @@ : "r" ((UDItype)(u)), \ "r" ((UDItype)(v))) -extern void udiv128(unsigned long, unsigned long, - unsigned long, unsigned long, - unsigned long *, - unsigned long *); - -#define udiv_qrnnd(q, r, n1, n0, d) \ - do { \ - unsigned long xr, xi; \ - udiv128((n0), (n1), 0, (d), &xr, &xi); \ - (q) = xr; \ - (r) = xi; \ +#define udiv_qrnnd(q, r, n1, n0, d) \ + do { unsigned long __r; \ + (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ + (r) = __r; \ } while (0) +extern unsigned long __udiv_qrnnd (unsigned long *, unsigned long, + unsigned long , unsigned long); #define UDIV_NEEDS_NORMALIZATION 1 diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index 3f5b82b44247..4a1c1c59e2dc 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile @@ -20,10 +20,10 @@ compressed/vmlinux: $(TOPDIR)/vmlinux dep @$(MAKE) -C compressed vmlinux install: $(CONFIGURE) Image - sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL).$(EXTRAVERSION) Image $(TOPDIR)/System.map "$(INSTALL_PATH)" + sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) Image $(TOPDIR)/System.map "$(INSTALL_PATH)" zinstall: $(CONFIGURE) zImage - sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL).$(EXTRAVERSION) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)" + sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)" clean: rm -f Image zImage diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c index 8995b822d7f6..273d46598bdb 100644 --- a/arch/arm/kernel/ecard.c +++ b/arch/arm/kernel/ecard.c @@ -140,14 +140,10 @@ ecard_task_reset(struct ecard_request *req) ecard_t *ec; for (ec = cards; ec; ec = ec->next) { - printk(KERN_DEBUG "Resetting card %d\n", - ec->slot_no); - if (ec->loader) ecard_loader_reset(POD_INT_ADDR(ec->podaddr), ec->loader); } - printk(KERN_DEBUG "All cards reset\n"); } else if (req->ec->loader) ecard_loader_reset(POD_INT_ADDR(req->ec->podaddr), req->ec->loader); diff --git a/arch/arm/kernel/iic.c b/arch/arm/kernel/iic.c index c9a672a321c4..ab73f6f53a76 100644 --- a/arch/arm/kernel/iic.c +++ b/arch/arm/kernel/iic.c @@ -22,8 +22,8 @@ */ static void iic_delay(void) { - extern unsigned long loops_per_sec; - if (loops_per_sec != (1 << 12)) { + extern unsigned long loops_per_jiffy; + if (loops_per_jiffy != (1 << 12)) { udelay(100); /* was 10 */ return; } else { diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 8047928b8abc..c60eb31c47a7 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -522,8 +522,8 @@ int get_cpuinfo(char * buffer) (int)processor_id & 15, elf_platform); p += sprintf(p, "BogoMIPS\t: %lu.%02lu\n", - (loops_per_sec+2500) / 500000, - ((loops_per_sec+2500) / 5000) % 100); + (loops_per_jiffy+2500) / (500000/HZ), + ((loops_per_jiffy+2500) / (5000/HZ)) % 100); p += sprintf(p, "Hardware\t: %s\n", machine_name); diff --git a/arch/arm/lib/delay.S b/arch/arm/lib/delay.S index 72dab5a95690..2e884c7c7e51 100644 --- a/arch/arm/lib/delay.S +++ b/arch/arm/lib/delay.S @@ -7,7 +7,7 @@ #include .text -LC0: .word SYMBOL_NAME(loops_per_sec) +LC0: .word SYMBOL_NAME(loops_per_jiffy) ENTRY(udelay) mov r2, #0x1000 diff --git a/arch/arm/lib/memzero.S b/arch/arm/lib/memzero.S index 59ec365740ff..51ccc60160fd 100644 --- a/arch/arm/lib/memzero.S +++ b/arch/arm/lib/memzero.S @@ -1,80 +1,80 @@ /* - * linux/arch/arm/lib/memzero.S + * linux/arch/arm/lib/memzero.S * - * Copyright (C) 1995-1999 Russell King + * Copyright (C) 1995-2000 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. */ #include #include -#include "constants.h" - - .text + .text + .align 5 + .word 0 /* - * Prototype: void memzero(void *d, size_t n) + * Align the pointer in r0. r3 contains the number of bytes that we are + * mis-aligned by, and r1 is the number of bytes. If r1 < 4, then we + * don't bother; we use byte stores instead. + */ +1: subs r1, r1, #4 @ 1 do we have enough + blt 5f @ 1 bytes to align with? + cmp r3, #2 @ 1 + strltb r2, [r0], #1 @ 1 + strleb r2, [r0], #1 @ 1 + strb r2, [r0], #1 @ 1 + add r1, r1, r3 @ 1 (r1 = r1 - (4 - r3)) +/* + * The pointer is now aligned and the length is adjusted. Try doing the + * memzero again. */ -1: @ 4 <= r1 - cmp ip, #2 @ 1 - strltb r2, [r0], #1 @ 1 - strleb r2, [r0], #1 @ 1 - strb r2, [r0], #1 @ 1 - rsb ip, ip, #4 @ 1 - sub r1, r1, ip @ 1 - cmp r1, #3 @ 1 - bgt 2f @ 1 @ +8 - b 4f @ 1 @ +9 - - .align 5 ENTRY(__memzero) - mov r2, #0 @ 1 - cmp r1, #4 @ 1 - blt 4f @ 1 @ = 3 - - @ r1 >= 4 - - ands ip, r0, #3 @ 1 - bne 1b @ 1 @ = 5 - -2: @ r1 >= 4 && (r0 & 3) = 0 @ = 5 or 11 - - str lr, [sp, #-4]! @ 1 - mov r3, #0 @ 1 - mov ip, #0 @ 1 - mov lr, #0 @ 1 - - @ 4 <= r1 <= 32 @ = 9 or 15 - -3: subs r1, r1, #32 @ 1 - stmgeia r0!, {r2, r3, ip, lr} @ 4 - stmgeia r0!, {r2, r3, ip, lr} @ 4 - bgt 3b @ 1 - LOADREGS(eqfd, sp!, {pc}) @ 1/2 - - @ -28 <= r1 <= -1 - - cmp r1, #-16 @ 1 - stmgeia r0!, {r2, r3, ip, lr} @ 4 - ldr lr, [sp], #4 @ 1 - addlts r1, r1, #16 @ 1 - RETINSTR(moveq,pc,lr) @ 1 - - @ -12 <= r1 <= -1 - - cmp r1, #-8 @ 1 - stmgeia r0!, {r2, r3} @ 2 - addlts r1, r1, #8 @ 1 - RETINSTR(moveq,pc,lr) @ 1 - - @ -4 <= r1 <= -1 - - cmp r1, #-4 @ 1 - strge r2, [r0], #4 @ 1 - adds r1, r1, #4 @ 1 - RETINSTR(moveq,pc,lr) @ 1 - -4: @ 1 <= r1 <= 3 - cmp r1, #2 @ 1 - strgtb r2, [r0], #1 @ 1 - strgeb r2, [r0], #1 @ 1 - strb r2, [r0], #1 @ 1 - RETINSTR(mov,pc,lr) @ 1 + mov r2, #0 @ 1 + ands r3, r0, #3 @ 1 unaligned? + bne 1b @ 1 +/* + * r3 = 0, and we know that the pointer in r0 is aligned to a word boundary. + */ + cmp r1, #16 @ 1 we can skip this chunk if we + blt 4f @ 1 have < 16 bytes +/* + * We need an extra register for this loop - save the return address and + * use the LR + */ + str lr, [sp, #-4]! @ 1 + mov ip, r2 @ 1 + mov lr, r2 @ 1 + +3: subs r1, r1, #64 @ 1 write 32 bytes out per loop + stmgeia r0!, {r2, r3, ip, lr} @ 4 + stmgeia r0!, {r2, r3, ip, lr} @ 4 + stmgeia r0!, {r2, r3, ip, lr} @ 4 + stmgeia r0!, {r2, r3, ip, lr} @ 4 + bgt 3b @ 1 + LOADREGS(eqfd, sp!, {pc}) @ 1/2 quick exit +/* + * No need to correct the count; we're only testing bits from now on + */ + tst r1, #32 @ 1 + stmneia r0!, {r2, r3, ip, lr} @ 4 + stmneia r0!, {r2, r3, ip, lr} @ 4 + tst r1, #16 @ 1 16 bytes or more? + stmneia r0!, {r2, r3, ip, lr} @ 4 + ldr lr, [sp], #4 @ 1 + +4: tst r1, #8 @ 1 8 bytes or more? + stmneia r0!, {r2, r3} @ 2 + tst r1, #4 @ 1 4 bytes or more? + strne r2, [r0], #4 @ 1 +/* + * When we get here, we've got less than 4 bytes to zero. We + * may have an unaligned pointer as well. + */ +5: tst r1, #2 @ 1 2 bytes or more? + strneb r2, [r0], #1 @ 1 + strneb r2, [r0], #1 @ 1 + tst r1, #1 @ 1 a byte left over + strneb r2, [r0], #1 @ 1 + RETINSTR(mov,pc,lr) @ 1 diff --git a/arch/arm/vmlinux-armo.lds.in b/arch/arm/vmlinux-armo.lds.in index bea2492b9da9..aac897c7ee68 100644 --- a/arch/arm/vmlinux-armo.lds.in +++ b/arch/arm/vmlinux-armo.lds.in @@ -6,55 +6,87 @@ OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { - _text = .; /* Text and read-only data */ - .text : { - *(.text) - *(.fixup) - *(.gnu.warning) - } = 0x9090 - .text.lock : { *(.text.lock) } /* out-of-line lock text */ - .rodata : { *(.rodata) } - .kstrtab : { *(.kstrtab) } - - . = ALIGN(16); /* Exception table */ - __start___ex_table = .; - __ex_table : { *(__ex_table) } - __stop___ex_table = .; - - __start___ksymtab = .; /* Kernel symbol table */ - __ksymtab : { *(__ksymtab) } - __stop___ksymtab = .; - - _etext = .; /* End of text section */ - - . = ALIGN(8192); - .data : { /* Data */ - *(.init.task) - *(.data) - CONSTRUCTORS + . = TEXTADDR; + + .init : { + __init_begin = .; /* Init code and data */ + *(.text.init) + __proc_info_begin = .; + *(.proc.info) + __proc_info_end = .; + *(.data.init) + . = ALIGN(16); + __setup_start = .; + *(.setup.init) + __setup_end = .; + __initcall_start = .; + *(.initcall.init) + __initcall_end = .; + . = ALIGN(32768); + __init_end = .; + } + + .init.task : { + *(.init.task) } - _edata = .; /* End of data section */ + /DISCARD/ : { /* Exit code and data */ + *(.text.exit) + *(.data.exit) + *(.exitcall.exit) + } - . = ALIGN(32768); /* Init code and data */ - __init_begin = .; - .text.init : { *(.text.init) } - .data.init : { *(.data.init) } - . = ALIGN(32768); - __init_end = .; + .text : { + _text = .; /* Text and read-only data */ + *(.text) + *(.fixup) + *(.gnu.warning) + *(.text.lock) /* out-of-line lock text */ + *(.rodata) + *(.kstrtab) + . = ALIGN(16); /* Exception table */ + __start___ex_table = .; + *(__ex_table) + __stop___ex_table = .; - __bss_start = .; /* BSS */ - .bss : { - *(.bss) + __start___ksymtab = .; /* Kernel symbol table */ + *(__ksymtab) + __stop___ksymtab = .; + + *(.got) /* Global offset table */ + + _etext = .; /* End of text section */ } - _end = . ; - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } + + .data : { /* Data */ + /* + * The cacheline aligned data + */ + . = ALIGN(32); + *(.data.cacheline_aligned) + + /* + * and the usual data section + */ + *(.data) + CONSTRUCTORS + + _edata = .; + } + + .bss : { + __bss_start = .; /* BSS */ + *(.bss) + *(COMMON) + _end = . ; + } + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } } diff --git a/arch/arm/vmlinux-armv.lds.in b/arch/arm/vmlinux-armv.lds.in index 060431bd8295..3843059bd99d 100644 --- a/arch/arm/vmlinux-armv.lds.in +++ b/arch/arm/vmlinux-armv.lds.in @@ -14,10 +14,23 @@ SECTIONS *(.proc.info) __proc_info_end = .; *(.data.init) + . = ALIGN(16); + __setup_start = .; + *(.setup.init) + __setup_end = .; + __initcall_start = .; + *(.initcall.init) + __initcall_end = .; . = ALIGN(4096); __init_end = .; } + /DISCARD/ : { /* Exit code and data */ + *(.text.exit) + *(.data.exit) + *(.exitcall.exit) + } + __ebsa285_begin = .; .text.ebsa285 : { *(.text.ebsa285) } .data.ebsa285 : { *(.data.ebsa285) } diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 36d1f2f65b60..ec85ca63897e 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -1257,8 +1257,8 @@ int get_cpuinfo(char * buffer) if ( c->x86_capability & (1 << i) ) p += sprintf(p, " %s", x86_cap_flags[i]); p += sprintf(p, "\nbogomips\t: %lu.%02lu\n\n", - (c->loops_per_jiffy+2500)/(500000/HZ), - ((c->loops_per_jiffy+2500)/(5000/HZ)) % 100); + c->loops_per_jiffy/(500000/HZ), + (c->loops_per_jiffy/(5000/HZ)) % 100); } return p - buffer; } diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index 1028b15d8872..cbc09a5a5972 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c @@ -1600,8 +1600,8 @@ void __init smp_boot_cpus(void) } printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", cpucount+1, - (bogosum+2500)/(500000/HZ), - ((bogosum+2500)/(5000/HZ))%100); + bogosum/(500000/HZ), + (bogosum/(5000/HZ))%100); SMP_PRINTK(("Before bogocount - setting activated=1.\n")); smp_activated=1; smp_num_cpus=cpucount+1; @@ -1813,7 +1813,7 @@ static inline void send_IPI_single(int dest, int vector) void smp_flush_tlb(void) { int cpu = smp_processor_id(); - int stuck; + long long stuck; unsigned long flags; /* diff --git a/drivers/block/acsi.c b/drivers/block/acsi.c index b1433046f2d3..8cad4ba93592 100644 --- a/drivers/block/acsi.c +++ b/drivers/block/acsi.c @@ -411,7 +411,7 @@ extern int slm_init( void ); * 6), the timeout is based on the 'jiffies' variable to provide exact * timeouts for device probing etc. * If interrupts are disabled, the number of tries is based on the - * 'loops_per_sec' variable. A rough estimation is sufficient here... + * 'loops_per_jiffy' variable. A rough estimation is sufficient here... */ #define INT_LEVEL \ @@ -429,7 +429,7 @@ int acsi_wait_for_IRQ( unsigned timeout ) if (!(mfp.par_dt_reg & 0x20)) return( 1 ); } else { - long tries = loops_per_sec / HZ / 8 * timeout; + long tries = loops_per_jiffy / 8 * timeout; while( --tries >= 0 ) if (!(mfp.par_dt_reg & 0x20)) return( 1 ); } @@ -446,7 +446,7 @@ int acsi_wait_for_noIRQ( unsigned timeout ) if (mfp.par_dt_reg & 0x20) return( 1 ); } else { - long tries = loops_per_sec * timeout / HZ / 8; + long tries = loops_per_jiffy / 8 * timeout; while( tries-- >= 0 ) if (mfp.par_dt_reg & 0x20) return( 1 ); } diff --git a/drivers/block/ide-cd.c b/drivers/block/ide-cd.c index 949e9dba0cc5..2e32b34e622a 100644 --- a/drivers/block/ide-cd.c +++ b/drivers/block/ide-cd.c @@ -210,17 +210,17 @@ * patch thanks to "Eddie C. Dost" * * 4.50 Oct 19, 1998 -- New maintainers! - * Jens Axboe + * Jens Axboe * Chris Zwilling * - * 4.51 Dec 23, 1998 -- Jens Axboe + * 4.51 Dec 23, 1998 -- Jens Axboe * - ide_cdrom_reset enabled since the ide subsystem - * handles resets fine now. + * handles resets fine now. * - Transfer size fix for Samsung CD-ROMs, thanks to * "Ville Hallik" . * - other minor stuff. * - * 4.52 Jan 19, 1999 -- Jens Axboe + * 4.52 Jan 19, 1999 -- Jens Axboe * - Detect DVD-ROM/RAM drives * * 4.53 Feb 22, 1999 - Include other model Samsung and one Goldstar @@ -1835,9 +1835,9 @@ static int cdrom_play_audio(ide_drive_t *drive, int lba_start, int lba_end) memset(&pc, 0, sizeof (pc)); pc.sense = &sense; - pc.c[0] = GPCMD_PLAY_AUDIO_10; - put_unaligned(cpu_to_be32(lba_start), (unsigned int *) &pc.c[2]); - put_unaligned(cpu_to_be16(lba_end - lba_start), (unsigned int *) &pc.c[7]); + pc.c[0] = GPCMD_PLAY_AUDIO_MSF; + lba_to_msf(lba_start, &pc.c[3], &pc.c[4], &pc.c[5]); + lba_to_msf(lba_end-1, &pc.c[6], &pc.c[7], &pc.c[8]); return cdrom_queue_packet_command(drive, &pc); } @@ -1944,14 +1944,15 @@ int ide_cdrom_audio_ioctl (struct cdrom_device_info *cdi, { ide_drive_t *drive = (ide_drive_t*) cdi->handle; struct cdrom_info *info = drive->driver_data; + int stat; switch (cmd) { /* - * emulate PLAY_AUDIO_TI command with PLAY_AUDIO_10, since + * emulate PLAY_AUDIO_TI command with PLAY_AUDIO_MSF, since * atapi doesn't support it */ case CDROMPLAYTRKIND: { - int stat, lba_start, lba_end; + int lba_start, lba_end; struct cdrom_ti *ti = (struct cdrom_ti *)arg; struct atapi_toc_entry *first_toc, *last_toc; @@ -1975,7 +1976,6 @@ int ide_cdrom_audio_ioctl (struct cdrom_device_info *cdi, } case CDROMREADTOCHDR: { - int stat; struct cdrom_tochdr *tochdr = (struct cdrom_tochdr *) arg; struct atapi_toc *toc; @@ -1991,7 +1991,6 @@ int ide_cdrom_audio_ioctl (struct cdrom_device_info *cdi, } case CDROMREADTOCENTRY: { - int stat; struct cdrom_tocentry *tocentry = (struct cdrom_tocentry*) arg; struct atapi_toc_entry *toce; diff --git a/drivers/block/rd.c b/drivers/block/rd.c index 25a6c5e056df..d39af4f01666 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -653,7 +653,9 @@ __initfunc(void initrd_load(void)) #define OF(args) args +#ifndef memzero #define memzero(s, n) memset ((s), 0, (n)) +#endif typedef unsigned char uch; diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 8739c152c78a..0ae2740ebb1c 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -82,17 +82,17 @@ Thanks to Grant R. Guenther for spotting this bug. -- Made a few things more pedanticly correct. -2.50 Oct 19, 1998 - Jens Axboe +2.50 Oct 19, 1998 - Jens Axboe -- New maintainers! Erik was too busy to continue the work on the driver, - so now Chris Zwilling and Jens Axboe + so now Chris Zwilling and Jens Axboe will do their best to follow in his footsteps - 2.51 Dec 20, 1998 - Jens Axboe + 2.51 Dec 20, 1998 - Jens Axboe -- Check if drive is capable of doing what we ask before blindly changing cdi->options in various ioctl. -- Added version to proc entry. - 2.52 Jan 16, 1999 - Jens Axboe + 2.52 Jan 16, 1999 - Jens Axboe -- Fixed an error in open_for_data where we would sometimes not return the correct error value. Thanks Huba Gaspar . -- Fixed module usage count - usage was based on /proc/sys/dev @@ -101,7 +101,7 @@ dev would be removed even though it was used. cdrom.c just illuminated that bug. - 2.53 Feb 22, 1999 - Jens Axboe + 2.53 Feb 22, 1999 - Jens Axboe -- Fixup of several ioctl calls, in particular CDROM_SET_OPTIONS has been "rewritten" because capabilities and options aren't in sync. They should be... @@ -111,16 +111,16 @@ -- Added CDROM_GET_CAPABILITY ioctl. This relieves userspace programs from parsing /proc/sys/dev/cdrom/info. - 2.54 Mar 15, 1999 - Jens Axboe + 2.54 Mar 15, 1999 - Jens Axboe -- Check capability mask from low level driver when counting tracks as per suggestion from Corey J. Scotts . - 2.55 Apr 25, 1999 - Jens Axboe + 2.55 Apr 25, 1999 - Jens Axboe -- autoclose was mistakenly checked against CDC_OPEN_TRAY instead of CDC_CLOSE_TRAY. -- proc info didn't mask against capabilities mask. - 3.00 Aug 5, 1999 - Jens Axboe + 3.00 Aug 5, 1999 - Jens Axboe -- Unified audio ioctl handling across CD-ROM drivers. A lot of the code was duplicated before. Drives that support the generic packet interface are now being fed packets from here instead. @@ -138,13 +138,13 @@ -- CDROM_SEND_PACKET ioctl added. The infrastructure was in place for doing this anyway, with the generic_packet addition. - 3.01 Aug 6, 1999 - Jens Axboe + 3.01 Aug 6, 1999 - Jens Axboe -- Fix up the sysctl handling so that the option flags get set correctly. -- Fix up ioctl handling so the device specific ones actually get called :). - 3.02 Aug 8, 1999 - Jens Axboe + 3.02 Aug 8, 1999 - Jens Axboe -- Fixed volume control on SCSI drives (or others with longer audio page). -- Fixed a couple of DVD minors. Thanks to Andrew T. Veliath @@ -153,7 +153,7 @@ DVD patches for ide-cd and while I rearranged and unified them, the interface is still the same. - 3.03 Sep 1, 1999 - Jens Axboe + 3.03 Sep 1, 1999 - Jens Axboe -- Moved the rest of the audio ioctls from the CD-ROM drivers here. Only CDROMREADTOCENTRY and CDROMREADTOCHDR are left. -- Moved the CDROMREADxxx ioctls in here. @@ -164,7 +164,7 @@ drivers are updated as well. -- Various other cleanups. - 3.04 Sep 12, 1999 - Jens Axboe + 3.04 Sep 12, 1999 - Jens Axboe -- Fixed a couple of possible memory leaks (if an operation failed and we didn't free the buffer before returning the error). -- Integrated Uniform CD Changer handling from Richard Sharman @@ -178,7 +178,7 @@ -- Export cdrom_mode_sense and cdrom_mode_select. -- init_cdrom_command() for setting up a cgc command. - 3.05 Oct 24, 1999 - Jens Axboe + 3.05 Oct 24, 1999 - Jens Axboe -- Changed the interface for CDROM_SEND_PACKET. Before it was virtually impossible to send the drive data in a sensible way. -- Lowered stack usage in mmc_ioctl(), dvd_read_disckey(), and @@ -187,7 +187,7 @@ -- Fixed CDDA ripping with cdda2wav - accept much larger requests of number of frames and split the reads in blocks of 8. - 3.06 Dec 13, 1999 - Jens Axboe + 3.06 Dec 13, 1999 - Jens Axboe -- Added support for changing the region of DVD drives. -- Added sense data to generic command. @@ -1107,6 +1107,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai) setup_report_key(&cgc, 0, 8); memset(&rpc_state, 0, sizeof(rpc_state_t)); cgc.buffer = (char *) &rpc_state; + cgc.buffer = (char *) &rpc_state; if ((ret = cdo->generic_packet(cdi, &cgc))) return ret; @@ -2553,6 +2554,7 @@ static struct ctl_table_header *cdrom_sysctl_header; * Note: only the top-level directory needs to do this; if * a lower level is referenced, the parent will be as well. */ +#ifdef CONFIG_PROC_FS static void cdrom_procfs_modcount(struct inode *inode, int fill) { if (fill) { @@ -2561,6 +2563,7 @@ static void cdrom_procfs_modcount(struct inode *inode, int fill) MOD_DEC_USE_COUNT; } } +#endif static void cdrom_sysctl_register(void) { @@ -2570,7 +2573,9 @@ static void cdrom_sysctl_register(void) return; cdrom_sysctl_header = register_sysctl_table(cdrom_root_table, 1); +#ifdef CONFIG_PROC_FS cdrom_root_table->child->de->fill_inode = &cdrom_procfs_modcount; +#endif /* set the defaults */ cdrom_sysctl_settings.autoclose = autoclose; diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index 9ff09f581107..b60aec8d7523 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c @@ -61,7 +61,7 @@ #include /* for verify_area */ #include /* for -EBUSY */ #include /* for check_region, request_region */ -#include /* for loops_per_sec */ +#include /* for loops_per_jiffy */ #include /* for put_user_byte */ #include /* for inb_p, outb_p, inb, outb, etc. */ #include /* for get_user, etc. */ diff --git a/drivers/char/epca.c b/drivers/char/epca.c index 4d036539a7f5..581fd781fcce 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -1825,8 +1825,8 @@ int pc_init(void) /* --------------------------------------------------------------------- loops_per_sec hasn't been set at this point :-(, so fake it out... I set it, so that I can use the __delay() function. - - Yes it is nowdays + + We don't use __delay(), so we don't need to fake it. ------------------------------------------------------------------------ */ diff --git a/drivers/misc/parport_pc.c b/drivers/misc/parport_pc.c index 3853ce1840ef..2da87e63b96c 100644 --- a/drivers/misc/parport_pc.c +++ b/drivers/misc/parport_pc.c @@ -617,7 +617,7 @@ static int irq_probe_ECP(struct parport *pb) sti(); irqs = probe_irq_on(); - + parport_pc_write_econtrol(pb, 0x00); /* Reset FIFO */ parport_pc_write_econtrol(pb, 0xd0); /* TEST FIFO + nErrIntrEn */ @@ -948,6 +948,7 @@ static int parport_pc_init_pci (int irq, int dma) } } +#ifdef CONFIG_PCI /* Look for parallel controllers that we don't know about. */ for (pcidev = pci_devices; pcidev; pcidev = pcidev->next) { const int class_noprogif = pcidev->class & ~0xff; @@ -968,6 +969,7 @@ static int parport_pc_init_pci (int irq, int dma) "tim@cyberelk.demon.co.uk\n", pcidev->vendor, pcidev->device); } +#endif return count; } diff --git a/drivers/net/am79c961a.c b/drivers/net/am79c961a.c index 4e0f00318311..92f1dbd59b85 100644 --- a/drivers/net/am79c961a.c +++ b/drivers/net/am79c961a.c @@ -38,35 +38,29 @@ static unsigned int net_debug = NET_DEBUG; static void am79c961_setmulticastlist (struct device *dev); -static char *version = "am79c961 ethernet driver (c) 1995 R.M.King v0.00\n"; - -#define FUNC_PROLOGUE \ - struct dev_priv *priv = (struct dev_priv *)dev->priv +static char *version = "am79c961 ethernet driver (c) 1995 R.M.King v0.01\n"; /* --------------------------------------------------------------------------- */ +#ifdef __arm__ static void write_rreg (unsigned long base, unsigned int reg, unsigned short val) { - __asm__(" - strh %1, [%2] @ NET_RAP - strh %0, [%2, #-4] @ NET_RDP + __asm__("str%?h %1, [%2] @ NET_RAP + str%?h %0, [%2, #-4] @ NET_RDP " : : "r" (val), "r" (reg), "r" (0xf0000464)); } static inline void write_ireg (unsigned long base, unsigned int reg, unsigned short val) { - __asm__(" - strh %1, [%2] @ NET_RAP - strh %0, [%2, #8] @ NET_RDP + __asm__("str%?h %1, [%2] @ NET_RAP + str%?h %0, [%2, #8] @ NET_RDP " : : "r" (val), "r" (reg), "r" (0xf0000464)); } #define am_writeword(dev,off,val)\ - __asm__("\ - strh %0, [%1]\ - " : : "r" ((val) & 0xffff), "r" (0xe0000000 + ((off) << 1))); + __asm__("str%?h %0, [%1]" : : "r" ((val) & 0xffff), "r" (0xe0000000 + ((off) << 1))); static inline void am_writebuffer(struct device *dev, unsigned int offset, unsigned char *buf, unsigned int length) @@ -74,30 +68,28 @@ am_writebuffer(struct device *dev, unsigned int offset, unsigned char *buf, unsi offset = 0xe0000000 + (offset << 1); length = (length + 1) & ~1; if ((int)buf & 2) { - __asm__ __volatile__(" - strh %2, [%0], #4 - " : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); + __asm__ __volatile__("str%?h %2, [%0], #4" + : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); buf += 2; length -= 2; } while (length > 8) { unsigned int tmp, tmp2; __asm__ __volatile__(" - ldmia %1!, {%2, %3} - strh %2, [%0], #4 - mov %2, %2, lsr #16 - strh %2, [%0], #4 - strh %3, [%0], #4 - mov %3, %3, lsr #16 - strh %3, [%0], #4 - " : "=&r" (offset), "=&r" (buf), "=r" (tmp), "=r" (tmp2) + ldm%?ia %1!, {%2, %3} + str%?h %2, [%0], #4 + mov%? %2, %2, lsr #16 + str%?h %2, [%0], #4 + str%?h %3, [%0], #4 + mov%? %3, %3, lsr #16 + str%?h %3, [%0], #4 + " : "=&r" (offset), "=&r" (buf), "=&r" (tmp), "=&r" (tmp2) : "0" (offset), "1" (buf)); length -= 8; } while (length > 0) { - __asm__ __volatile__(" - strh %2, [%0], #4 - " : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); + __asm__ __volatile__("str%?h %2, [%0], #4" + : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); buf += 2; length -= 2; } @@ -107,9 +99,8 @@ static inline unsigned short read_rreg (unsigned int base_addr, unsigned int reg) { unsigned short v; - __asm__(" - strh %1, [%2] @ NET_RAP - ldrh %0, [%2, #-4] @ NET_IDP + __asm__("str%?h %1, [%2] @ NET_RAP + ldr%?h %0, [%2, #-4] @ NET_IDP " : "=r" (v): "r" (reg), "r" (0xf0000464)); return v; } @@ -120,9 +111,7 @@ am_readword (struct device *dev, unsigned long off) unsigned long address = 0xe0000000 + (off << 1); unsigned short val; - __asm__(" - ldrh %0, [%1] - " : "=r" (val): "r" (address)); + __asm__("ldr%?h %0, [%1]" : "=r" (val): "r" (address)); return val; } @@ -134,38 +123,41 @@ am_readbuffer(struct device *dev, unsigned int offset, unsigned char *buf, unsig if ((int)buf & 2) { unsigned int tmp; __asm__ __volatile__(" - ldrh %2, [%0], #4 - strb %2, [%1], #1 - mov %2, %2, lsr #8 - strb %2, [%1], #1 + ldr%?h %2, [%0], #4 + str%?b %2, [%1], #1 + mov%? %2, %2, lsr #8 + str%?b %2, [%1], #1 " : "=&r" (offset), "=&r" (buf), "=r" (tmp): "0" (offset), "1" (buf)); length -= 2; } while (length > 8) { unsigned int tmp, tmp2, tmp3; __asm__ __volatile__(" - ldrh %2, [%0], #4 - ldrh %3, [%0], #4 - orr %2, %2, %3, lsl #16 - ldrh %3, [%0], #4 - ldrh %4, [%0], #4 - orr %3, %3, %4, lsl #16 - stmia %1!, {%2, %3} - " : "=&r" (offset), "=&r" (buf), "=r" (tmp), "=r" (tmp2), "=r" (tmp3) + ldr%?h %2, [%0], #4 + ldr%?h %3, [%0], #4 + orr%? %2, %2, %3, lsl #16 + ldr%?h %3, [%0], #4 + ldr%?h %4, [%0], #4 + orr%? %3, %3, %4, lsl #16 + stm%?ia %1!, {%2, %3} + " : "=&r" (offset), "=&r" (buf), "=&r" (tmp), "=&r" (tmp2), "=&r" (tmp3) : "0" (offset), "1" (buf)); length -= 8; } while (length > 0) { unsigned int tmp; __asm__ __volatile__(" - ldrh %2, [%0], #4 - strb %2, [%1], #1 - mov %2, %2, lsr #8 - strb %2, [%1], #1 + ldr%?h %2, [%0], #4 + str%?b %2, [%1], #1 + mov%? %2, %2, lsr #8 + str%?b %2, [%1], #1 " : "=&r" (offset), "=&r" (buf), "=r" (tmp) : "0" (offset), "1" (buf)); length -= 2; } } +#else +#error Not compatable +#endif static int am79c961_ramtest(struct device *dev, unsigned int val) @@ -259,7 +251,7 @@ am79c961_init_for_open(struct device *dev) write_rreg (dev->base_addr, SIZERXR, -RX_BUFFERS); write_rreg (dev->base_addr, SIZETXR, -TX_BUFFERS); write_rreg (dev->base_addr, CSR0, CSR0_STOP); - write_rreg (dev->base_addr, CSR3, CSR3_IDONM|CSR3_BABLM); + write_rreg (dev->base_addr, CSR3, CSR3_IDONM|CSR3_BABLM|CSR3_DXSUFLO); write_rreg (dev->base_addr, CSR0, CSR0_IENA|CSR0_STRT); } @@ -304,7 +296,7 @@ am79c961_probe1(struct device *dev) /* * The PNP initialisation should have been done by the ether bootp loader. */ - inb ((dev->base_addr + NET_RESET) >> 1); /* reset the device */ + inb((dev->base_addr + NET_RESET) >> 1); /* reset the device */ udelay (5); @@ -420,26 +412,105 @@ static struct enet_statistics *am79c961_getstats (struct device *dev) return &priv->stats; } +static inline u32 update_crc(u32 crc, u8 byte) +{ + int i; + + for (i = 8; i != 0; i--) { + byte ^= crc & 1; + crc >>= 1; + + if (byte & 1) + crc ^= 0xedb88320; + + byte >>= 1; + } + + return crc; +} + +static void am79c961_mc_hash(struct dev_mc_list *dmi, unsigned short *hash) +{ + if (dmi->dmi_addrlen == ETH_ALEN && dmi->dmi_addr[0] & 0x01) { + int i, idx, bit; + u32 crc; + + crc = 0xffffffff; + + for (i = 0; i < ETH_ALEN; i++) + crc = update_crc(crc, dmi->dmi_addr[i]); + + idx = crc >> 30; + bit = (crc >> 26) & 15; + + hash[idx] |= 1 << bit; + } +} + /* * Set or clear promiscuous/multicast mode filter for this adaptor. - * - * We don't attempt any packet filtering. The card may have a SEEQ 8004 - * in which does not have the other ethernet address registers present... + * We don't attempt any packet filtering. */ static void am79c961_setmulticastlist (struct device *dev) { unsigned long flags; - int i; + unsigned short multi_hash[4], mode; + int i, stopped; - dev->flags &= ~IFF_ALLMULTI; + mode = MODE_PORT0; - i = MODE_PORT0; - if (dev->flags & IFF_PROMISC) - i |= MODE_PROMISC; + if (dev->flags & IFF_PROMISC) { + mode |= MODE_PROMISC; + } else if (dev->flags & IFF_ALLMULTI) { + memset(multi_hash, 0xff, sizeof(multi_hash)); + } else { + struct dev_mc_list *dmi; - save_flags_cli (flags); - write_rreg (dev->base_addr, MODE, i); - restore_flags (flags); + memset(multi_hash, 0x00, sizeof(multi_hash)); + + for (dmi = dev->mc_list; dmi; dmi = dmi->next) + am79c961_mc_hash(dmi, multi_hash); + } + + save_flags_cli(flags); + + stopped = read_rreg(dev->base_addr, CSR0) & CSR0_STOP; + + if (!stopped) { + /* + * Put the chip into suspend mode + */ + write_rreg(dev->base_addr, CTRL1, CTRL1_SPND); + + /* + * Spin waiting for chip to report suspend mode + */ + while ((read_rreg(dev->base_addr, CTRL1) & CTRL1_SPND) == 0) { + restore_flags(flags); + nop(); + save_flags_cli(flags); + } + } + + /* + * Update the multicast hash table + */ + for (i = 0; i < sizeof(multi_hash) / sizeof(multi_hash[0]); i++) + write_rreg(dev->base_addr, i + LADRL, multi_hash[i]); + + /* + * Write the mode register + */ + write_rreg(dev->base_addr, MODE, mode); + + if (!stopped) { + /* + * Put the chip back into running mode + */ + write_rreg(dev->base_addr, CTRL1, 0); + } + + restore_flags(flags); } /* @@ -455,17 +526,20 @@ again: if (!test_and_set_bit(0, (void*)&dev->tbusy)) { unsigned int length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; unsigned int hdraddr, bufaddr; + unsigned int head; unsigned long flags; - hdraddr = priv->txhdr + (priv->txhead << 3); - bufaddr = priv->txbuffer[priv->txhead]; - priv->txhead ++; - if (priv->txhead >= TX_BUFFERS) - priv->txhead = 0; + head = priv->txhead; + hdraddr = priv->txhdr + (head << 3); + bufaddr = priv->txbuffer[head]; + head += 1; + if (head >= TX_BUFFERS) + head = 0; am_writebuffer (dev, bufaddr, skb->data, length); am_writeword (dev, hdraddr + 4, -length); am_writeword (dev, hdraddr + 2, TMD_OWN|TMD_STP|TMD_ENP); + priv->txhead = head; save_flags_cli (flags); write_rreg (dev->base_addr, CSR0, CSR0_TDMD|CSR0_IENA); @@ -483,10 +557,14 @@ again: int tickssofar = jiffies - dev->trans_start; if (tickssofar < 5) return 1; - printk (KERN_WARNING "%s: transmit timed out, network cable problem?\n", dev->name); + printk(KERN_WARNING "%s: transmit timed out, network cable problem?\n", dev->name); /* Try to restart the adaptor. */ + disable_irq(dev->irq); + am79c961_init(dev); + am79c961_init_for_open(dev); dev->tbusy = 0; dev->trans_start = jiffies; + enable_irq(dev->irq); goto again; } } @@ -613,7 +691,7 @@ am79c961_tx(struct device *dev, struct dev_priv *priv) am_writeword (dev, hdraddr + 6, 0); if (status2 & TST_RTRY) - priv->stats.collisions += 1; + priv->stats.collisions += 16; if (status2 & TST_LCOL) priv->stats.tx_window_errors ++; if (status2 & TST_LCAR) diff --git a/drivers/net/am79c961a.h b/drivers/net/am79c961a.h index 4c15f8a8a46a..a29bf12fa0b2 100644 --- a/drivers/net/am79c961a.h +++ b/drivers/net/am79c961a.h @@ -45,6 +45,7 @@ #define CSR3_EMBA 0x0008 #define CSR3_DXMT2PD 0x0010 #define CSR3_LAPPEN 0x0020 +#define CSR3_DXSUFLO 0x0040 #define CSR3_IDONM 0x0100 #define CSR3_TINTM 0x0200 #define CSR3_RINTM 0x0400 @@ -53,6 +54,9 @@ #define CSR3_BABLM 0x4000 #define CSR3_MASKALL 0x5F00 +#define CTRL1 5 +#define CTRL1_SPND 0x0001 + #define LADRL 8 #define LADRM1 9 #define LADRM2 10 @@ -97,8 +101,8 @@ #define TMD_ERR 0x4000 #define TMD_OWN 0x8000 -#define TST_RTRY 0x0200 -#define TST_LCAR 0x0400 +#define TST_RTRY 0x0400 +#define TST_LCAR 0x0800 #define TST_LCOL 0x1000 #define TST_UFLO 0x4000 diff --git a/drivers/net/fc/iph5526.c b/drivers/net/fc/iph5526.c index 09cc7c02199f..dabab8c626f3 100644 --- a/drivers/net/fc/iph5526.c +++ b/drivers/net/fc/iph5526.c @@ -2242,7 +2242,7 @@ static void reset_ichip(struct fc_info *fi) /* (i)chip reset */ writel(ICHIP_HCR_RESET, fi->i_r.ptr_ichip_hw_control_reg); /*wait for chip to get reset */ - udelay(10000); + mdelay(10); /*de-assert reset */ writel(ICHIP_HCR_DERESET, fi->i_r.ptr_ichip_hw_control_reg); @@ -3884,7 +3884,7 @@ struct pci_dev *pdev = NULL; /* This is to make sure that the ACC to the PRLI comes in * for the last ALPA. */ - udelay(1000000); /* Ugly! Let the Gods forgive me */ + mdelay(1000); /* Ugly! Let the Gods forgive me */ DPRINTK1("leaving iph5526_detect\n"); return no_of_hosts; diff --git a/drivers/net/tulip.c b/drivers/net/tulip.c index 21014e150d76..c0567fffb6b4 100644 --- a/drivers/net/tulip.c +++ b/drivers/net/tulip.c @@ -344,6 +344,8 @@ static struct pci_id_info pci_tbl[] __initdata = { 0x11AD, 0xc115, 0xffff, PCI_ADDR0_IO, 256, 32, tulip_probe1 }, { "ADMtek AN981 Comet", 0x1317, 0x0981, 0xffff, PCI_ADDR0_IO, 256, 32, tulip_probe1 }, + { "ADMtek AN985 Comet", + 0x1317, 0x0981, 0xffff, PCI_ADDR0_IO, 256, 32, tulip_probe1 }, { "Compex RL100-TX", 0x11F6, 0x9881, 0xffff, PCI_ADDR0_IO, 128, 32, tulip_probe1 }, { "Intel 21145 Tulip", diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index c8ee6dd46279..c439b2308db3 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -406,8 +406,6 @@ struct proc_dir_entry proc_scsi_aha152x = /* END OF DEFINES */ -extern long loops_per_sec; - #define DELAY_DEFAULT 100 /* some additional "phases" for getphase() */ diff --git a/drivers/scsi/cpqfcTSstructs.h b/drivers/scsi/cpqfcTSstructs.h index 2680228a411e..bfc5bf4f4df1 100644 --- a/drivers/scsi/cpqfcTSstructs.h +++ b/drivers/scsi/cpqfcTSstructs.h @@ -83,7 +83,9 @@ #define CPQFCTS_CMD_PER_LUN 15 // power of 2 -1, must be >0 #define CPQFCTS_REQ_QUEUE_LEN (TACH_SEST_LEN/2) // must be < TACH_SEST_LEN +#ifndef LinuxVersionCode #define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s)) +#endif #ifndef DECLARE_MUTEX_LOCKED #define DECLARE_MUTEX_LOCKED(sem) struct semaphore sem = MUTEX_LOCKED #endif @@ -104,8 +106,25 @@ typedef struct // the fields shared with ODB // need to have same value +// Queues for TachLite not in original Tachyon +// ERQ - Exchange Request Queue (for outbound commands) +// SFQ - Single Frame Queue (for incoming frames) + + // Define Tachyon Outbound Command Que + // (Since many Tachyon registers are Read + // only, maintain copies for debugging) + // most Tach ques need power-of-2 sizes, + // where registers are loaded with po2 -1 +#define TACH_SEST_LEN 512 // TachLite SEST + +#define ELS_EXCHANGES 64 // e.g. PLOGI, RSCN, ... +// define the total number of outstanding (simultaneous) exchanges +#define TACH_MAX_XID (TACH_SEST_LEN + ELS_EXCHANGES) // ELS exchanges + +#define ERQ_LEN 128 // power of 2, max 4096 +#ifndef HOSTS_C #ifndef BYTE //typedef UCHAR BYTE; @@ -307,22 +326,6 @@ typedef struct // each entry 8 words (32 bytes) } TachyonIMQE; -// Queues for TachLite not in original Tachyon -// ERQ - Exchange Request Queue (for outbound commands) -// SFQ - Single Frame Queue (for incoming frames) - - // Define Tachyon Outbound Command Que - // (Since many Tachyon registers are Read - // only, maintain copies for debugging) - // most Tach ques need power-of-2 sizes, - // where registers are loaded with po2 -1 -#define TACH_SEST_LEN 512 // TachLite SEST - -#define ELS_EXCHANGES 64 // e.g. PLOGI, RSCN, ... -// define the total number of outstanding (simultaneous) exchanges -#define TACH_MAX_XID (TACH_SEST_LEN + ELS_EXCHANGES) // ELS exchanges - -#define ERQ_LEN 128 // power of 2, max 4096 // Inbound Message Queue structures... #define IMQ_LEN 512 // minimum 4 entries [(power of 2) - 1] @@ -1489,6 +1492,6 @@ typedef struct { #define BA_SEQUENCE_ABORTED 0x00000500 - +#endif #endif /* CPQFCTSSTRUCTS_H */ diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 2dacce3c8d24..91bc0e88955d 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -20,7 +20,7 @@ * Modified by Gerd Knorr to support the * generic cdrom interface * - * Modified by Jens Axboe - Uniform sr_packet() + * Modified by Jens Axboe - Uniform sr_packet() * interface, capabilities probe additions, ioctl cleanups, etc. * * Modified by Jens Axboe - support DVD-RAM diff --git a/drivers/sound/Makefile b/drivers/sound/Makefile index 643aac4ef93c..c23c1d44259c 100644 --- a/drivers/sound/Makefile +++ b/drivers/sound/Makefile @@ -122,7 +122,7 @@ pas2-objs := pas2_card.o pas2_midi.o pas2_mixer.o pas2_pcm.o sb-objs := sb_audio.o sb_card.o sb_common.o sb_midi.o sb_mixer.o \ sb_ess.o softoss2-objs := softoss.o softoss_rs.o -vidc_mod-objs := vidc.o vidc_audio.o vidc_fill.o vidc_mixer.o vidc_synth.o +vidc_mod-objs := vidc.o vidc_fill.o vidc_synth.o wavefront-objs := wavfront.o wf_midi.o yss225.o nm256-objs := nm256_audio.o ac97.o via82cxxx-objs := via82cxxx_audio.o ac97.o diff --git a/drivers/sound/vidc.c b/drivers/sound/vidc.c index 36a4eafb1c42..c5e70cb5bb1f 100644 --- a/drivers/sound/vidc.c +++ b/drivers/sound/vidc.c @@ -1,118 +1,536 @@ /* - * drivers/sound/vidc.c + * drivers/sound/vidc.c * - * Detection routine for the VIDC. + * VIDC20 audio driver. * - * Copyright (C) 1997 by Russell King + * Copyright (C) 1997-2000 by Russell King + * + * The VIDC20 sound hardware consists of the VIDC20 itself, a DAC and a DMA + * engine. The DMA transfers fixed-format (16-bit little-endian linear) + * samples to the VIDC20, which then transfers this data serially to the + * DACs. The samplerate is controlled by the VIDC. + * + * We currently support a mixer device, but it is currently non-functional. */ #include #include -#include +#include #include +#include +#include +#include + #include "sound_config.h" #include "soundmodule.h" #include "vidc.h" -int vidc_busy; +#ifndef _SIOC_TYPE +#define _SIOC_TYPE(x) _IOC_TYPE(x) +#endif +#ifndef _SIOC_NR +#define _SIOC_NR(x) _IOC_NR(x) +#endif -void vidc_update_filler(int format, int channels) +#define VIDC_SOUND_CLOCK (250000) + +/* + * When using SERIAL SOUND mode (external DAC), the number of physical + * channels is fixed at 2. + */ +static int vidc_busy; +static int vidc_adev; +static int vidc_audio_rate; +static char vidc_audio_format; +static char vidc_audio_channels; + +static unsigned char vidc_level_l[SOUND_MIXER_NRDEVICES] = { + 85, /* master */ + 50, /* bass */ + 50, /* treble */ + 0, /* synth */ + 75, /* pcm */ + 0, /* speaker */ + 100, /* ext line */ + 0, /* mic */ + 100, /* CD */ + 0, +}; + +static unsigned char vidc_level_r[SOUND_MIXER_NRDEVICES] = { + 85, /* master */ + 50, /* bass */ + 50, /* treble */ + 0, /* synth */ + 75, /* pcm */ + 0, /* speaker */ + 100, /* ext line */ + 0, /* mic */ + 100, /* CD */ + 0, +}; + +static unsigned int vidc_audio_volume_l; /* left PCM vol, 0 - 65536 */ +static unsigned int vidc_audio_volume_r; /* right PCM vol, 0 - 65536 */ + +static void (*old_mksound)(unsigned int hz, unsigned int ticks); +extern void (*kd_mksound)(unsigned int hz, unsigned int ticks); +extern void vidc_update_filler(int bits, int channels); + +static void +vidc_mksound(unsigned int hz, unsigned int ticks) +{ + +} + +static void +vidc_mixer_set(int mdev, unsigned int level) +{ + unsigned int lev_l = level & 0x007f; + unsigned int lev_r = (level & 0x7f00) >> 8; + unsigned int mlev_l, mlev_r; + + if (lev_l > 100) + lev_l = 100; + if (lev_r > 100) + lev_r = 100; + +#define SCALE(lev,master) ((lev) * (master) * 65536 / 10000) + + mlev_l = vidc_level_l[SOUND_MIXER_VOLUME]; + mlev_r = vidc_level_r[SOUND_MIXER_VOLUME]; + + switch (mdev) { + case SOUND_MIXER_VOLUME: + case SOUND_MIXER_PCM: + vidc_level_l[mdev] = lev_l; + vidc_level_r[mdev] = lev_r; + + vidc_audio_volume_l = SCALE(lev_l, mlev_l); + vidc_audio_volume_r = SCALE(lev_r, mlev_r); + + break; + } +#undef SCALE +} + +static int vidc_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg) +{ + unsigned int val; + unsigned int mdev; + + if (_SIOC_TYPE(cmd) != 'M') + return -EINVAL; + + mdev = _SIOC_NR(cmd); + + if (_SIOC_DIR(cmd) & _SIOC_WRITE) { + if (get_user(val, (unsigned int *)arg)) + return -EFAULT; + + if (mdev < SOUND_MIXER_NRDEVICES) + vidc_mixer_set(mdev, val); + else + return -EINVAL; + } + + /* + * Return parameters + */ + switch (mdev) { + case SOUND_MIXER_RECSRC: + val = 0; + break; + + case SOUND_MIXER_DEVMASK: + val = SOUND_MASK_VOLUME | SOUND_MASK_PCM | SOUND_MASK_SYNTH; + break; + + case SOUND_MIXER_STEREODEVS: + val = SOUND_MASK_VOLUME | SOUND_MASK_PCM | SOUND_MASK_SYNTH; + break; + + case SOUND_MIXER_RECMASK: + val = 0; + break; + + case SOUND_MIXER_CAPS: + val = 0; + break; + + default: + if (mdev < SOUND_MIXER_NRDEVICES) + val = vidc_level_l[mdev] | vidc_level_r[mdev] << 8; + else + return -EINVAL; + } + + return put_user(val, (unsigned int *)arg) ? -EFAULT : 0; +} + +static struct mixer_operations vidc_mixer_operations = { + "VIDC", + "VIDCsound", + vidc_mixer_ioctl /* ioctl */ +}; + +static unsigned int vidc_audio_set_format(int dev, unsigned int fmt) +{ + switch (fmt) { + default: + fmt = AFMT_S16_LE; + case AFMT_U8: + case AFMT_S8: + case AFMT_S16_LE: + vidc_audio_format = fmt; + vidc_update_filler(vidc_audio_format, vidc_audio_channels); + case AFMT_QUERY: + break; + } + return vidc_audio_format; +} + +static int vidc_audio_set_speed(int dev, int rate) +{ + if (rate) { + unsigned int hwctrl, hwrate; + unsigned int newsize, new2size; + + /* + * If we have selected 44.1kHz, use the DAC clock. + */ + if (0 && rate == 44100) { + hwctrl = 0x00000002; + hwrate = 3; + } else { + hwctrl = 0x00000003; + + hwrate = (((VIDC_SOUND_CLOCK * 2) / rate) + 1) >> 1; + if (hwrate < 3) + hwrate = 3; + if (hwrate > 255) + hwrate = 255; + + rate = VIDC_SOUND_CLOCK / hwrate; + } + + outl(0xb0000000 | (hwrate - 2), IO_VIDC_BASE); + outl(0xb1000000 | hwctrl, IO_VIDC_BASE); + + newsize = (10000 / hwrate) & ~3; + if (newsize < 208) + newsize = 208; + if (newsize > 4096) + newsize = 4096; + for (new2size = 128; new2size < newsize; new2size <<= 1); + if (new2size - newsize > newsize - (new2size >> 1)) + new2size >>= 1; + if (new2size > 4096) { + printk(KERN_ERR "VIDC: error: dma buffer (%d) %d > 4K\n", + newsize, new2size); + new2size = 4096; + } + dma_bufsize = new2size; + vidc_audio_rate = rate; + } + return vidc_audio_rate; +} + +static short vidc_audio_set_channels(int dev, short channels) +{ + switch (channels) { + default: + channels = 2; + case 1: + case 2: + vidc_audio_channels = channels; + vidc_update_filler(vidc_audio_format, vidc_audio_channels); + case 0: + break; + } + return vidc_audio_channels; +} + +/* + * Open the device + */ +static int vidc_audio_open(int dev, int mode) +{ + /* This audio device does not have recording capability */ + if (mode == OPEN_READ) + return -EPERM; + + if (vidc_busy) + return -EBUSY; + + vidc_busy = 1; + return 0; +} + +/* + * Close the device + */ +static void vidc_audio_close(int dev) +{ + vidc_busy = 0; +} + +/* + * Output a block via DMA to sound device. + * + * We just set the DMA start and count; the DMA interrupt routine + * will take care of formatting the samples (via the appropriate + * vidc_filler routine), and flag via vidc_audio_dma_interrupt when + * more data is required. + */ +static void +vidc_audio_output_block(int dev, unsigned long buf, int total_count, int one) +{ + struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; + unsigned long flags; + + save_flags_cli(flags); + dma_start = buf - (unsigned long)dmap->raw_buf_phys + (unsigned long)dmap->raw_buf; + dma_count = total_count; + restore_flags(flags); +} + +static void +vidc_audio_start_input(int dev, unsigned long buf, int count, int intrflag) +{ +} + +static int vidc_audio_prepare_for_input(int dev, int bsize, int bcount) +{ + return -EINVAL; +} + +static void vidc_audio_dma_interrupt(void) +{ + DMAbuf_outputintr(vidc_adev, 1); +} + +/* + * Prepare for outputting samples. + * + * Each buffer that will be passed will be `bsize' bytes long, + * with a total of `bcount' buffers. + */ +static int vidc_audio_prepare_for_output(int dev, int bsize, int bcount) +{ + struct audio_operations *adev = audio_devs[dev]; + + dma_interrupt = NULL; + adev->dmap_out->flags |= DMA_NODMA; + + return 0; +} + +/* + * Stop our current operation. + */ +static void vidc_audio_reset(int dev) +{ + dma_interrupt = NULL; +} + +static int vidc_audio_local_qlen(int dev) +{ + return /*dma_count !=*/ 0; +} + +static void vidc_audio_trigger(int dev, int enable_bits) { - int fillertype; + struct audio_operations *adev = audio_devs[dev]; + if (enable_bits & PCM_ENABLE_OUTPUT) { + if (!(adev->flags & DMA_ACTIVE)) { + unsigned long flags; + + save_flags_cli(flags); + + /* prevent recusion */ + adev->flags |= DMA_ACTIVE; + + dma_interrupt = vidc_audio_dma_interrupt; + vidc_sound_dma_irq(0, NULL, NULL); + outb(DMA_CR_E | 0x10, IOMD_SD0CR); + + restore_flags(flags); + } + } +} + +static struct audio_driver vidc_audio_driver = +{ + vidc_audio_open, /* open */ + vidc_audio_close, /* close */ + vidc_audio_output_block, /* output_block */ + vidc_audio_start_input, /* start_input */ + NULL, /* ioctl */ + vidc_audio_prepare_for_input, /* prepare_for_input */ + vidc_audio_prepare_for_output, /* prepare_for_output */ + vidc_audio_reset, /* halt_io */ + vidc_audio_local_qlen, /* local_qlen */ + NULL, /* copy_user */ + NULL, /* halt_input */ + NULL, /* halt_output */ + vidc_audio_trigger, /* trigger */ + vidc_audio_set_speed, /* set_speed */ + vidc_audio_set_format, /* set_bits */ + vidc_audio_set_channels, /* set_channels */ + NULL, /* postprocess_write */ + NULL, /* postprocess_read */ + NULL /* mmap */ +}; + +void vidc_update_filler(int format, int channels) +{ #define TYPE(fmt,ch) (((fmt)<<2) | ((ch)&3)) - fillertype = TYPE(format, channels); -printk("filler type: %X\n", fillertype); - switch (fillertype) - { - default: - case TYPE(AFMT_U8, 1): - vidc_filler = vidc_fill_1x8_u; - break; - - case TYPE(AFMT_U8, 2): - vidc_filler = vidc_fill_2x8_u; - break; - - case TYPE(AFMT_S8, 1): - vidc_filler = vidc_fill_1x8_s; - break; - - case TYPE(AFMT_S8, 2): - vidc_filler = vidc_fill_2x8_s; - break; - - case TYPE(AFMT_S16_LE, 1): - vidc_filler = vidc_fill_1x16_s; - break; - - case TYPE(AFMT_S16_LE, 2): - vidc_filler = vidc_fill_2x16_s; - break; + switch (TYPE(format, channels)) { + default: + case TYPE(AFMT_U8, 1): + vidc_filler = vidc_fill_1x8_u; + break; + + case TYPE(AFMT_U8, 2): + vidc_filler = vidc_fill_2x8_u; + break; + + case TYPE(AFMT_S8, 1): + vidc_filler = vidc_fill_1x8_s; + break; + + case TYPE(AFMT_S8, 2): + vidc_filler = vidc_fill_2x8_s; + break; + + case TYPE(AFMT_S16_LE, 1): + vidc_filler = vidc_fill_1x16_s; + break; + + case TYPE(AFMT_S16_LE, 2): + vidc_filler = vidc_fill_2x16_s; + break; } } void attach_vidc(struct address_info *hw_config) { char name[32]; - int i; + int i, adev; sprintf(name, "VIDC %d-bit sound", hw_config->card_subtype); conf_printf(name, hw_config); + memset(dma_buf, 0, sizeof(dma_buf)); - for (i = 0; i < 2; i++) - { + adev = sound_install_audiodrv(AUDIO_DRIVER_VERSION, name, + &vidc_audio_driver, sizeof(vidc_audio_driver), + DMA_AUTOMODE, AFMT_U8 | AFMT_S8 | AFMT_S16_LE, + NULL, hw_config->dma, hw_config->dma2); + + if (adev < 0) + goto audio_failed; + + /* + * 1024 bytes => 64 buffers + */ + audio_devs[adev]->min_fragment = 10; + audio_devs[adev]->mixer_dev = num_mixers; + + audio_devs[adev]->mixer_dev = + sound_install_mixer(MIXER_DRIVER_VERSION, + name, &vidc_mixer_operations, + sizeof(vidc_mixer_operations), NULL); + + if (audio_devs[adev]->mixer_dev < 0) + goto mixer_failed; + + for (i = 0; i < 2; i++) { dma_buf[i] = get_free_page(GFP_KERNEL); + if (!dma_buf[i]) { + printk(KERN_ERR "%s: can't allocate required buffers\n", + name); + goto mem_failed; + } dma_pbuf[i] = virt_to_phys(dma_buf[i]); } - if (sound_alloc_dma(hw_config->dma, "VIDCsound")) - { - printk(KERN_ERR "VIDCsound: can't allocate virtual DMA channel\n"); - return; + if (sound_alloc_dma(hw_config->dma, hw_config->name)) { + printk(KERN_ERR "%s: DMA %d is in use\n", name, hw_config->dma); + goto dma_failed; } - if (request_irq(hw_config->irq, vidc_sound_dma_irq, 0, "VIDCsound", &dma_start)) - { - printk(KERN_ERR "VIDCsound: can't allocate DMA interrupt\n"); - return; + + if (request_irq(hw_config->irq, vidc_sound_dma_irq, 0, + hw_config->name, &dma_start)) { + printk(KERN_ERR "%s: IRQ %d is in use\n", name, hw_config->irq); + goto irq_failed; } -// vidc_synth_init(hw_config); - vidc_audio_init(hw_config); - vidc_mixer_init(hw_config); + old_mksound = kd_mksound; + kd_mksound = vidc_mksound; + vidc_adev = adev; + vidc_mixer_set(SOUND_MIXER_VOLUME, (85 | 85 << 8)); + return; + +irq_failed: + sound_free_dma(hw_config->dma); +dma_failed: +mem_failed: + for (i = 0; i < 2; i++) + free_page(dma_buf[i]); + sound_unload_mixerdev(audio_devs[adev]->mixer_dev); +mixer_failed: + sound_unload_audiodev(adev); +audio_failed: + return; } int probe_vidc(struct address_info *hw_config) { - hw_config->irq = IRQ_DMAS0; - hw_config->dma = DMA_VIRTUAL_SOUND; - hw_config->dma2 = -1; - hw_config->card_subtype = 16; + hw_config->irq = IRQ_DMAS0; + hw_config->dma = DMA_VIRTUAL_SOUND; + hw_config->dma2 = -1; + hw_config->card_subtype = 16; + hw_config->name = "VIDC20"; return 1; } void unload_vidc(struct address_info *hw_config) { - int i; + int i, adev = vidc_adev; - free_irq(hw_config->irq, NULL); + vidc_adev = -1; + + if (old_mksound) + kd_mksound = old_mksound; + + free_irq(hw_config->irq, &dma_start); sound_free_dma(hw_config->dma); - for (i = 0; i < 2; i++) - free_page(dma_buf[i]); + if (adev >= 0) { + sound_unload_mixerdev(audio_devs[adev]->mixer_dev); + sound_unload_audiodev(adev); + for (i = 0; i < 2; i++) + free_page(dma_buf[i]); + } } #ifdef MODULE static struct address_info config; +/* + * Note! Module use count is handled by SOUNDLOCK/SOUND_LOCK_END + */ int init_module(void) { if (probe_vidc(&config) == 0) return -ENODEV; - printk("VIDC 16-bit serial sound\n"); + SOUND_LOCK; attach_vidc(&config); + return 0; } diff --git a/drivers/sound/vidc.h b/drivers/sound/vidc.h index a79bdc85d6eb..0b56e8b7aa58 100644 --- a/drivers/sound/vidc.h +++ b/drivers/sound/vidc.h @@ -55,18 +55,9 @@ extern void (*dma_interrupt) (void); extern unsigned long dma_start, dma_count, dma_bufsize; extern unsigned long dma_buf[2], dma_pbuf[2]; -/* vidc_audio.c */ - -extern void vidc_audio_init(struct address_info *hw_config); -extern int vidc_audio_get_volume(void); -extern int vidc_audio_set_volume(int vol); - -/* vidc_mixer.c */ - -extern void vidc_mixer_init(struct address_info *hw_config); - /* vidc_synth.c */ extern void vidc_synth_init(struct address_info *hw_config); +extern void vidc_synth_exit(struct address_info *hw_config); extern int vidc_synth_get_volume(void); extern int vidc_synth_set_volume(int vol); diff --git a/drivers/sound/vidc_audio.c b/drivers/sound/vidc_audio.c deleted file mode 100644 index 919a2ea50576..000000000000 --- a/drivers/sound/vidc_audio.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - * drivers/sound/vidc_audio.c - * - * Audio routines for the VIDC - * - * Copyright (C) 1997 Russell King - */ - -#include -#include -#include - -#include "sound_config.h" -#include "vidc.h" - -/* - * VIDC sound - * - * When using SERIAL SOUND mode (external DAC), the number of physical - * channels is fixed at 2. Therefore, the sample rate = vidc sample rate. - */ - -static int vidc_adev; - -static int vidc_audio_volume; -static int vidc_audio_rate; -static char vidc_audio_format; -static char vidc_audio_channels; - -extern void vidc_update_filler(int bits, int channels); - -int vidc_audio_get_volume(void) -{ - return vidc_audio_volume; -} - -int vidc_audio_set_volume(int newvol) -{ - vidc_audio_volume = newvol; - return vidc_audio_volume; -} - -static int vidc_audio_set_bits(int fmt) -{ -printk("setting format: %d\n", fmt); - switch (fmt) - { - case AFMT_QUERY: - break; - case AFMT_U8: - case AFMT_S8: - case AFMT_S16_LE: - vidc_audio_format = fmt; - vidc_update_filler(vidc_audio_format, vidc_audio_channels); - break; - default: - vidc_audio_format = AFMT_S16_LE; - vidc_update_filler(vidc_audio_format, vidc_audio_channels); - break; - } - return vidc_audio_format; -} - -static int vidc_audio_set_rate(int rate) -{ - if (rate) - { - int newsize, new2size; - - vidc_audio_rate = ((500000 / rate) + 1) >> 1; - if (vidc_audio_rate < 3) - vidc_audio_rate = 3; - if (vidc_audio_rate > 255) - vidc_audio_rate = 255; - outl((vidc_audio_rate - 2) | 0xb0000000, IO_VIDC_BASE); - outl(0xb1000003, IO_VIDC_BASE); - newsize = (10000 / vidc_audio_rate) & ~3; - if (newsize < 208) - newsize = 208; - if (newsize > 4096) - newsize = 4096; - for (new2size = 128; new2size < newsize; new2size <<= 1); - if (new2size - newsize > newsize - (new2size >> 1)) - new2size >>= 1; - dma_bufsize = new2size; - } - return 250000 / vidc_audio_rate; -} - -static int vidc_audio_set_channels(int channels) -{ - switch (channels) - { - case 0: - break; - case 1: - case 2: - vidc_audio_channels = channels; - vidc_update_filler(vidc_audio_format, vidc_audio_channels); - break; - default: - vidc_audio_channels = 2; - vidc_update_filler(vidc_audio_format, vidc_audio_channels); - break; - } - return vidc_audio_channels; -} - -/* - * Open the device - * - * dev - device - * mode - mode to open device (logical OR of OPEN_READ and OPEN_WRITE) - * - * Called when opening the DMAbuf (dmabuf.c:259) - */ -static int vidc_audio_open(int dev, int mode) -{ - if (vidc_busy) - return -EBUSY; - - if ((mode & OPEN_READ) && (!mode & OPEN_WRITE)) - { - /* This audio device doesn't have recording capability */ - return -EIO; - } - vidc_busy = 1; - return 0; -} - -/* - * Close the device - * - * dev - device - * - * Called when closing the DMAbuf (dmabuf.c:477) - * after halt_xfer - */ -static void vidc_audio_close(int dev) -{ - vidc_busy = 0; -} - -static int vidc_audio_ioctl(int dev, unsigned int cmd, caddr_t arg) -{ - int ret; - - switch (cmd) - { - case SOUND_PCM_WRITE_RATE: - if (get_user(ret, (int *) arg)) - return -EFAULT; - ret = vidc_audio_set_rate(ret); - break; - - case SOUND_PCM_READ_RATE: - ret = vidc_audio_set_rate(0); - break; - - case SNDCTL_DSP_STEREO: - if (get_user(ret, (int *) arg)) - return -EFAULT; - ret = vidc_audio_set_channels(ret + 1) - 1; - break; - - case SOUND_PCM_WRITE_CHANNELS: - if (get_user(ret, (int *) arg)) - return -EFAULT; - ret = vidc_audio_set_channels(ret); - break; - - case SOUND_PCM_READ_CHANNELS: - ret = vidc_audio_set_channels(0); - break; - - case SNDCTL_DSP_SETFMT: - if (get_user(ret, (int *) arg)) - return -EFAULT; - ret = vidc_audio_set_bits(ret); - break; - - case SOUND_PCM_READ_BITS: - ret = vidc_audio_set_bits(0); - break; - - case SOUND_PCM_WRITE_FILTER: - case SOUND_PCM_READ_FILTER: - return -EINVAL; - - default: - return -EINVAL; - } - return put_user(ret, (int *) arg); -} - -/* - * Output a block via DMA to sound device - * - * dev - device number - * buf - physical address of buffer - * total_count - total byte count in buffer - * intrflag - set if this has been called from an interrupt (via DMAbuf_outputintr) - * restart_dma - set if DMA needs to be re-initialised - * - * Called when: - * 1. Starting output (dmabuf.c:1327) - * 2. (dmabuf.c:1504) - * 3. A new buffer needs to be sent to the device (dmabuf.c:1579) - */ -static void vidc_audio_output_block(int dev, unsigned long buf, int total_count, - int intrflag) -{ - struct audio_operations *adev = audio_devs[dev]; - struct dma_buffparms *dmap = adev->dmap_out; - - dma_start = buf - (unsigned long)dmap->raw_buf_phys + (unsigned long)dmap->raw_buf; - dma_count = total_count; - - if (!(adev->flags & DMA_ACTIVE)) - { - unsigned long flags; -printk("kicking output: %lX+%lX [%lX]\n", dma_start, dma_count, *(unsigned long *)dma_start); - save_flags_cli(flags); - vidc_sound_dma_irq(0, NULL, NULL); - outb(DMA_CR_E | 0x10, IOMD_SD0CR); - restore_flags(flags); - } -} - -static void vidc_audio_start_input(int dev, unsigned long buf, int count, - int intrflag) -{ -} - -static int vidc_audio_prepare_for_input(int dev, int bsize, int bcount) -{ - return -EINVAL; -} - -static void vidc_audio_dma_interrupt(void) -{ - DMAbuf_outputintr(vidc_adev, 1); -} - -/* - * Prepare for outputting samples to `dev' - * - * Each buffer that will be passed will be `bsize' bytes long, - * with a total of `bcount' buffers. - * - * Called when: - * 1. A trigger enables audio output (dmabuf.c:978) - * 2. We get a write buffer without dma_mode setup (dmabuf.c:1152) - * 3. We restart a transfer (dmabuf.c:1324) - */ -static int vidc_audio_prepare_for_output(int dev, int bsize, int bcount) -{ - audio_devs[dev]->dmap_out->flags |= DMA_NODMA; - dma_interrupt = vidc_audio_dma_interrupt; - return 0; -} - -/* - * Stop our current operation. - */ -static void vidc_audio_reset(int dev) -{ - /* stop interrupts. Our real interrupt routine - * will close DMA down for us - */ - dma_interrupt = NULL; -} - -static int vidc_audio_local_qlen(int dev) -{ - return /*dma_count !=*/ 0; -} - -static struct audio_driver vidc_audio_driver = -{ - vidc_audio_open, /* open */ - vidc_audio_close, /* close */ - vidc_audio_output_block, /* output_block */ - vidc_audio_start_input, /* start_input */ - vidc_audio_ioctl, /* ioctl */ - vidc_audio_prepare_for_input, /* prepare_for_input */ - vidc_audio_prepare_for_output, /* prepare_for_output */ - vidc_audio_reset, /* reset */ - vidc_audio_local_qlen, /*+local_qlen */ - NULL, /*+copy_from_user */ - NULL, /*+halt_input */ - NULL, /* halt_output */ - NULL, /*+trigger */ - NULL, /*+set_speed */ - NULL, /*+set_bits */ - NULL, /*+set_channels */ -}; - -void vidc_audio_init(struct address_info *hw_config) -{ - vidc_audio_volume = 100 | (100 << 8); - - if ((vidc_adev = sound_install_audiodrv(AUDIO_DRIVER_VERSION, - "VIDCsound", &vidc_audio_driver, - sizeof(struct audio_driver), - DMA_AUTOMODE, AFMT_U8 | AFMT_S8 | AFMT_S16_LE, - NULL, hw_config->dma, hw_config->dma2)) >= 0) - { - audio_devs[vidc_adev]->min_fragment = 10; /* 1024 bytes => 64 buffers */ - audio_devs[vidc_adev]->mixer_dev = num_mixers; - } - else printk(KERN_ERR "VIDCsound: Too many PCM devices available\n"); -} diff --git a/drivers/sound/vidc_fill.S b/drivers/sound/vidc_fill.S index b8b1e6620e7a..c198b72c69bc 100644 --- a/drivers/sound/vidc_fill.S +++ b/drivers/sound/vidc_fill.S @@ -9,6 +9,7 @@ #include #include #include +#include .text @@ -190,24 +191,24 @@ ENTRY(vidc_sound_dma_irq) .data .globl SYMBOL_NAME(dma_interrupt) SYMBOL_NAME(dma_interrupt): - .long 0 + .long 0 @ r3 .globl SYMBOL_NAME(dma_pbuf) SYMBOL_NAME(dma_pbuf): - .long 0 - .long 0 + .long 0 @ r4 + .long 0 @ r5 .globl SYMBOL_NAME(dma_start) SYMBOL_NAME(dma_start): - .long 0 + .long 0 @ r0 .globl SYMBOL_NAME(dma_count) SYMBOL_NAME(dma_count): - .long 0 + .long 0 @ r1 .globl SYMBOL_NAME(dma_buf) SYMBOL_NAME(dma_buf): - .long 0 - .long 0 + .long 0 @ r2 + .long 0 @ r3 .globl SYMBOL_NAME(vidc_filler) SYMBOL_NAME(vidc_filler): - .long SYMBOL_NAME(vidc_fill_noaudio) + .long SYMBOL_NAME(vidc_fill_noaudio) @ r4 .globl SYMBOL_NAME(dma_bufsize) SYMBOL_NAME(dma_bufsize): - .long 0x1000 + .long 0x1000 @ r5 diff --git a/drivers/sound/vidc_mixer.c b/drivers/sound/vidc_mixer.c deleted file mode 100644 index 01be4925cab1..000000000000 --- a/drivers/sound/vidc_mixer.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * drivers/sound/vidc_mixer.c - * - * Mixer routines for VIDC - * - * Copyright (C) 1997 Russell King - */ - -#include "sound_config.h" -#include "vidc.h" - -int vidc_volume; - -static int vidc_get_volume(void) -{ - return vidc_volume; -} - -static int vidc_set_volume(int newvol) -{ - vidc_volume = newvol; -/* printk ("vidc_set_volume: %X\n", newvol); */ - return newvol; -} - -static int vidc_default_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg) -{ - int ret; - - switch (cmd) - { - case SOUND_MIXER_READ_VOLUME: - ret = vidc_get_volume(); - break; - - case SOUND_MIXER_WRITE_VOLUME: - if (get_user(ret, (int *) arg)) - return -EINVAL; - ret = vidc_set_volume(ret); - break; - - case SOUND_MIXER_READ_BASS: - case SOUND_MIXER_WRITE_BASS: - case SOUND_MIXER_READ_TREBLE: - case SOUND_MIXER_WRITE_TREBLE: - ret = 50; - break; - - case SOUND_MIXER_READ_SYNTH: -// ret = vidc_synth_get_volume(); - ret = 0; - break; - - case SOUND_MIXER_WRITE_SYNTH: - if (get_user(ret, (int *) arg)) - return -EINVAL; -// ret = vidc_synth_set_volume(ret); - ret = 0; - break; - - case SOUND_MIXER_READ_PCM: - ret = vidc_audio_get_volume(); - break; - - case SOUND_MIXER_WRITE_PCM: - if (get_user(ret, (int *) arg)) - return -EINVAL; - ret = vidc_audio_set_volume(ret); - break; - - case SOUND_MIXER_READ_SPEAKER: - ret = 100; - break; - - case SOUND_MIXER_WRITE_SPEAKER: - ret = 100; - break; - - case SOUND_MIXER_READ_LINE: - case SOUND_MIXER_WRITE_LINE: - case SOUND_MIXER_READ_MIC: - case SOUND_MIXER_WRITE_MIC: - ret = 0; - break; - - case SOUND_MIXER_READ_CD: - case SOUND_MIXER_WRITE_CD: - ret = 100 | (100 << 8); - break; - - case SOUND_MIXER_READ_IMIX: - case SOUND_MIXER_WRITE_IMIX: - case SOUND_MIXER_READ_ALTPCM: - case SOUND_MIXER_WRITE_ALTPCM: - case SOUND_MIXER_READ_LINE1: - case SOUND_MIXER_WRITE_LINE1: - case SOUND_MIXER_READ_LINE2: - case SOUND_MIXER_WRITE_LINE2: - case SOUND_MIXER_READ_LINE3: - case SOUND_MIXER_WRITE_LINE3: - ret = 0; - break; - - case SOUND_MIXER_READ_RECSRC: - ret = 0; - break; - - case SOUND_MIXER_WRITE_RECSRC: - return -EINVAL; - break; - - case SOUND_MIXER_READ_DEVMASK: - ret = SOUND_MASK_VOLUME | SOUND_MASK_PCM | SOUND_MASK_SYNTH; - break; - - case SOUND_MIXER_READ_RECMASK: - ret = 0; - break; - - case SOUND_MIXER_READ_STEREODEVS: - ret = SOUND_MASK_VOLUME | SOUND_MASK_PCM | SOUND_MASK_SYNTH; - break; - - case SOUND_MIXER_READ_CAPS: - ret = 0; - break; - - case SOUND_MIXER_READ_MUTE: - return -EINVAL; - break; - - default: - return -EINVAL; - break; - } - return put_user(ret, (int *) arg); -} - -static struct mixer_operations vidc_mixer_operations = { - "VIDC", - "VIDCsound", - vidc_default_mixer_ioctl /* ioctl */ -}; - -void vidc_mixer_init(struct address_info *hw_config) -{ - int vidc_mixer = sound_alloc_mixerdev(); - vidc_volume = 100 | (100 << 8); - if (num_mixers < MAX_MIXER_DEV) - mixer_devs[vidc_mixer] = &vidc_mixer_operations; -} diff --git a/drivers/sound/vidc_synth.c b/drivers/sound/vidc_synth.c index ba94f0bc6dbb..c071cc70c513 100644 --- a/drivers/sound/vidc_synth.c +++ b/drivers/sound/vidc_synth.c @@ -88,4 +88,8 @@ void vidc_synth_init(struct address_info *hw_config) else printk(KERN_ERR "VIDCsound: Too many synthesizers\n"); } + +void vidc_synth_exit(struct address_info *hw_config) +{ +} #endif diff --git a/drivers/sound/wavfront.c b/drivers/sound/wavfront.c index 4206562a3481..7a0f318d53e2 100644 --- a/drivers/sound/wavfront.c +++ b/drivers/sound/wavfront.c @@ -87,9 +87,9 @@ #if defined(__alpha__) #ifdef __SMP__ -#define LOOPS_PER_TICK (cpu_data[smp_processor_id()].loops_per_jiffy/HZ) +#define LOOPS_PER_TICK (cpu_data[smp_processor_id()].loops_per_jiffy) #else -#define LOOPS_PER_TICK (loops_per_jiffy/HZ) +#define LOOPS_PER_TICK (loops_per_jiffy) #endif #endif @@ -459,7 +459,7 @@ wavefront_wait (int mask) if (short_loop_cnt == 0) { short_loop_cnt = wait_usecs * - (LOOPS_PER_TICK / 1000000); + (LOOPS_PER_TICK / (1000000 / HZ)); } /* Spin for a short period of time, because >99% of all diff --git a/drivers/sound/ymfpci.c b/drivers/sound/ymfpci.c index 044087d83f98..865f5914b66d 100644 --- a/drivers/sound/ymfpci.c +++ b/drivers/sound/ymfpci.c @@ -668,10 +668,10 @@ static void ymf_pcm_interrupt(ymfpci_t *codec, ymfpci_voice_t *voice) /* * Normal end of DMA. */ - printk("ymfpci%d: %d: done: delta %d" - " hwptr %d swptr %d distance %d count %d\n", - codec->inst, voice->number, delta, - dmabuf->hwptr, swptr, distance, dmabuf->count); +// printk("ymfpci%d: %d: done: delta %d" +// " hwptr %d swptr %d distance %d count %d\n", +// codec->inst, voice->number, delta, +// dmabuf->hwptr, swptr, distance, dmabuf->count); } played = dmabuf->count; if (ypcm->running) { @@ -826,8 +826,8 @@ static void ymf_pcm_init_voice(ymfpci_voice_t *voice, int stereo, end >>= 1; if (w_16) end >>= 1; -/* P3 */ printk("ymf_pcm_init_voice: %d: Rate %d Format 0x%08x Delta 0x%x End 0x%x\n", - voice->number, rate, format, delta, end); +/* P3 */ // printk("ymf_pcm_init_voice: %d: Rate %d Format 0x%08x Delta 0x%x End 0x%x\n", +// voice->number, rate, format, delta, end); for (nbank = 0; nbank < 2; nbank++) { bank = &voice->bank[nbank]; bank->format = format; @@ -1710,7 +1710,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file, case SNDCTL_DSP_SETFRAGMENT: get_user_ret(val, (int *)arg, -EFAULT); /* P3: these frags are for Doom. Amasingly, it sets [2,2**11]. */ - /* P3 */ printk("ymfpci: ioctl SNDCTL_DSP_SETFRAGMENT 0x%x\n", val); + /* P3 */ // printk("ymfpci: ioctl SNDCTL_DSP_SETFRAGMENT 0x%x\n", val); dmabuf->ossfragshift = val & 0xffff; dmabuf->ossmaxfrags = (val >> 16) & 0xffff; diff --git a/fs/adfs/super.c b/fs/adfs/super.c index 8924ee1724b8..188c0890927e 100644 --- a/fs/adfs/super.c +++ b/fs/adfs/super.c @@ -438,8 +438,7 @@ struct super_block *adfs_read_super(struct super_block *sb, void *data, int sile kfree(sb->u.adfs_sb.s_map); adfs_error(sb, "get root inode failed\n"); goto error_dec_use; - } - else + } else sb->s_root->d_op = &adfs_dentry_operations; return sb; diff --git a/fs/fat/inode.c b/fs/fat/inode.c index e89940bff1bf..488de6ca82f6 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -216,7 +216,7 @@ static int parse_options(char *options,int *fat, int *blksize, int *debug, opts->quiet = opts->sys_immutable = opts->dotsOK = opts->showexec = 0; opts->codepage = 0; opts->utf8 = 0; - opts->small_letter = 0; + opts->small_letter = 1; /* Default to old behaviour */ opts->iocharset = NULL; *debug = *fat = 0; @@ -265,6 +265,9 @@ static int parse_options(char *options,int *fat, int *blksize, int *debug, else if (!strcmp(this_char,"small")) { opts->small_letter = 1; } + else if (!strcmp(this_char,"big")) { + opts->small_letter = 0; + } else if (!strcmp(this_char,"dotsOK") && value) { if (!strcmp(value,"yes")) opts->dotsOK = 1; else if (!strcmp(value,"no")) opts->dotsOK = 0; diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c index 79fe743617dd..473b01e04bbf 100644 --- a/fs/nls/nls_base.c +++ b/fs/nls/nls_base.c @@ -380,7 +380,7 @@ void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int boundl return; } -void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp437.c b/fs/nls/nls_cp437.c index 7a8dddafa5fe..5cef80a34231 100644 --- a/fs/nls/nls_cp437.c +++ b/fs/nls/nls_cp437.c @@ -409,7 +409,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp737.c b/fs/nls/nls_cp737.c index 5987de7425da..fe6b0d72724e 100644 --- a/fs/nls/nls_cp737.c +++ b/fs/nls/nls_cp737.c @@ -337,7 +337,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp775.c b/fs/nls/nls_cp775.c index 4418dc577fbe..9a9985e4e691 100644 --- a/fs/nls/nls_cp775.c +++ b/fs/nls/nls_cp775.c @@ -337,7 +337,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp850.c b/fs/nls/nls_cp850.c index 4f389544ff79..3ff662212945 100644 --- a/fs/nls/nls_cp850.c +++ b/fs/nls/nls_cp850.c @@ -301,7 +301,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp852.c b/fs/nls/nls_cp852.c index e0c2930acf12..543831fa6d7d 100644 --- a/fs/nls/nls_cp852.c +++ b/fs/nls/nls_cp852.c @@ -301,7 +301,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp855.c b/fs/nls/nls_cp855.c index 59e24c9a78d1..fe60ae81f1b4 100644 --- a/fs/nls/nls_cp855.c +++ b/fs/nls/nls_cp855.c @@ -301,7 +301,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp857.c b/fs/nls/nls_cp857.c index ffff1a97d3aa..7eb725a6b7fa 100644 --- a/fs/nls/nls_cp857.c +++ b/fs/nls/nls_cp857.c @@ -265,7 +265,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp860.c b/fs/nls/nls_cp860.c index f0fecce34015..c032393c4680 100644 --- a/fs/nls/nls_cp860.c +++ b/fs/nls/nls_cp860.c @@ -373,7 +373,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp861.c b/fs/nls/nls_cp861.c index c7a8a9e17a98..abb8c802e19b 100644 --- a/fs/nls/nls_cp861.c +++ b/fs/nls/nls_cp861.c @@ -409,7 +409,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp862.c b/fs/nls/nls_cp862.c index c59d81748c59..c0d3ba92b254 100644 --- a/fs/nls/nls_cp862.c +++ b/fs/nls/nls_cp862.c @@ -445,7 +445,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp863.c b/fs/nls/nls_cp863.c index db86fd52975c..e87e51d21124 100644 --- a/fs/nls/nls_cp863.c +++ b/fs/nls/nls_cp863.c @@ -409,7 +409,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp864.c b/fs/nls/nls_cp864.c index 01cbf3cd5648..b4d829d79177 100644 --- a/fs/nls/nls_cp864.c +++ b/fs/nls/nls_cp864.c @@ -400,7 +400,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp865.c b/fs/nls/nls_cp865.c index a303205ebd1e..97cc75addffe 100644 --- a/fs/nls/nls_cp865.c +++ b/fs/nls/nls_cp865.c @@ -409,7 +409,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp866.c b/fs/nls/nls_cp866.c index 2218ced401b6..547206982f28 100644 --- a/fs/nls/nls_cp866.c +++ b/fs/nls/nls_cp866.c @@ -337,7 +337,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp869.c b/fs/nls/nls_cp869.c index 968d2f34d319..292d5de7badc 100644 --- a/fs/nls/nls_cp869.c +++ b/fs/nls/nls_cp869.c @@ -301,7 +301,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp874.c b/fs/nls/nls_cp874.c index 71b69aa29ac6..23d59592947f 100644 --- a/fs/nls/nls_cp874.c +++ b/fs/nls/nls_cp874.c @@ -265,7 +265,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_cp932.c b/fs/nls/nls_cp932.c index bf99153dbd78..4915dd1c66aa 100644 --- a/fs/nls/nls_cp932.c +++ b/fs/nls/nls_cp932.c @@ -9806,7 +9806,7 @@ static unsigned char *page_uni2charset[256] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, u2c_F9, u2c_FA, NULL, NULL, NULL, NULL, u2c_FF, }; -static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int boundlen, int *outlen) +static void uni2char(const unsigned char ch, unsigned char cl, unsigned char *out, int boundlen, int *outlen) { unsigned char *uni2charset; @@ -9844,7 +9844,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { unsigned char ch, cl; struct nls_unicode *charset2uni; @@ -9942,7 +9942,7 @@ static void uni2char_euc_jp(unsigned char ch, unsigned char cl, unsigned char * return; } -static void char2uni_euc_jp(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni_euc_jp(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { unsigned char ch, cl; unsigned char sjis_temp[2]; diff --git a/fs/nls/nls_cp936.c b/fs/nls/nls_cp936.c index 498a5a448155..c74e98801ffd 100644 --- a/fs/nls/nls_cp936.c +++ b/fs/nls/nls_cp936.c @@ -15609,7 +15609,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { unsigned char ch, cl; struct nls_unicode *charset2uni; diff --git a/fs/nls/nls_cp949.c b/fs/nls/nls_cp949.c index cd777ccc92bd..4f38902e035f 100644 --- a/fs/nls/nls_cp949.c +++ b/fs/nls/nls_cp949.c @@ -18465,7 +18465,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { unsigned char ch, cl; struct nls_unicode *charset2uni; diff --git a/fs/nls/nls_cp950.c b/fs/nls/nls_cp950.c index 7f2661bef186..63ac8107f875 100644 --- a/fs/nls/nls_cp950.c +++ b/fs/nls/nls_cp950.c @@ -12753,7 +12753,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { unsigned char ch, cl; struct nls_unicode *charset2uni; diff --git a/fs/nls/nls_iso8859-1.c b/fs/nls/nls_iso8859-1.c index bb86de370c19..19faab58d6f7 100644 --- a/fs/nls/nls_iso8859-1.c +++ b/fs/nls/nls_iso8859-1.c @@ -189,7 +189,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-14.c b/fs/nls/nls_iso8859-14.c index 538ce8bcb291..ebfe3e7aec1e 100644 --- a/fs/nls/nls_iso8859-14.c +++ b/fs/nls/nls_iso8859-14.c @@ -236,7 +236,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-15.c b/fs/nls/nls_iso8859-15.c index 9a0ae2ede432..f4b4effb6fc7 100644 --- a/fs/nls/nls_iso8859-15.c +++ b/fs/nls/nls_iso8859-15.c @@ -229,7 +229,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-2.c b/fs/nls/nls_iso8859-2.c index 6baddfc48596..00b4d945edc9 100644 --- a/fs/nls/nls_iso8859-2.c +++ b/fs/nls/nls_iso8859-2.c @@ -261,7 +261,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-3.c b/fs/nls/nls_iso8859-3.c index 1576aeac4e78..c7d52f127c40 100644 --- a/fs/nls/nls_iso8859-3.c +++ b/fs/nls/nls_iso8859-3.c @@ -261,7 +261,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-4.c b/fs/nls/nls_iso8859-4.c index 7d79070bc8c5..b7f79c43250c 100644 --- a/fs/nls/nls_iso8859-4.c +++ b/fs/nls/nls_iso8859-4.c @@ -261,7 +261,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-5.c b/fs/nls/nls_iso8859-5.c index 724149fa1e0d..034280dbbe7d 100644 --- a/fs/nls/nls_iso8859-5.c +++ b/fs/nls/nls_iso8859-5.c @@ -265,7 +265,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-6.c b/fs/nls/nls_iso8859-6.c index f4800a924edd..b1c877503ab2 100644 --- a/fs/nls/nls_iso8859-6.c +++ b/fs/nls/nls_iso8859-6.c @@ -225,7 +225,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-7.c b/fs/nls/nls_iso8859-7.c index f5f66c008437..190214d43e66 100644 --- a/fs/nls/nls_iso8859-7.c +++ b/fs/nls/nls_iso8859-7.c @@ -301,7 +301,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-8.c b/fs/nls/nls_iso8859-8.c index 987e719370ff..d0c35737163f 100644 --- a/fs/nls/nls_iso8859-8.c +++ b/fs/nls/nls_iso8859-8.c @@ -265,7 +265,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_iso8859-9.c b/fs/nls/nls_iso8859-9.c index eecc051b6431..408bb4843241 100644 --- a/fs/nls/nls_iso8859-9.c +++ b/fs/nls/nls_iso8859-9.c @@ -225,7 +225,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/fs/nls/nls_koi8-r.c b/fs/nls/nls_koi8-r.c index 1cff830db1d5..22c9b18ab162 100644 --- a/fs/nls/nls_koi8-r.c +++ b/fs/nls/nls_koi8-r.c @@ -337,7 +337,7 @@ static void uni2char(unsigned char ch, unsigned char cl, unsigned char *out, int return; } -static void char2uni(unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) +static void char2uni(const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2) { *uni1 = charset2uni[*rawstring].uni1; *uni2 = charset2uni[*rawstring].uni2; diff --git a/include/asm-alpha/delay.h b/include/asm-alpha/delay.h index b8b69d90f8f2..ac44f48a21f9 100644 --- a/include/asm-alpha/delay.h +++ b/include/asm-alpha/delay.h @@ -40,7 +40,7 @@ __delay(unsigned long loops) extern __inline__ void __udelay(unsigned long usecs, unsigned long lps) { - /* compute (usecs * 2**64 / 10**6) * loops_per_sec / 2**64 */ + /* compute (usecs * 2**64 / 10**6) * loops_per_jiffy * HZ / 2**64 */ usecs *= 0x000010c6f7a0b5edUL; /* 2**64 / 1000000 */ __asm__("umulh %1,%2,%0" :"=r" (usecs) :"r" (usecs),"r" (lps)); @@ -50,7 +50,7 @@ __udelay(unsigned long usecs, unsigned long lps) extern __inline__ void __small_const_udelay(unsigned long usecs, unsigned long lps) { - /* compute (usecs * 2**32 / 10**6) * loops_per_sec / 2**32 */ + /* compute (usecs * 2**32 / 10**6) * loops_per_jiffy * HZ / 2**32 */ usecs *= 0x10c6; /* 2^32 / 10^6 */ usecs *= lps; @@ -62,15 +62,16 @@ __small_const_udelay(unsigned long usecs, unsigned long lps) #define udelay(usecs) \ (__builtin_constant_p(usecs) && usecs < 0x100000000UL \ ? __small_const_udelay(usecs, \ - cpu_data[smp_processor_id()].loops_per_sec) \ + cpu_data[smp_processor_id()].loops_per_jiffy*HZ) \ : __udelay(usecs, \ - cpu_data[smp_processor_id()].loops_per_sec)) + cpu_data[smp_processor_id()].loops_per_jiffy*HZ)) #else #define udelay(usecs) \ (__builtin_constant_p(usecs) && usecs < 0x100000000UL \ - ? __small_const_udelay(usecs, loops_per_sec) \ - : __udelay(usecs, loops_per_sec)) + ? __small_const_udelay(usecs, loops_per_jiffy*HZ) \ + : __udelay(usecs, loops_per_jiffy*HZ)) #endif #endif /* defined(__ALPHA_DELAY_H) */ + diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h index 9406e6248efe..ee2f5d04aa07 100644 --- a/include/asm-alpha/smp.h +++ b/include/asm-alpha/smp.h @@ -9,7 +9,7 @@ /* make a multiple of 64-bytes */ struct cpuinfo_alpha { - unsigned long loops_per_sec; + unsigned long loops_per_jiffy; unsigned long last_asn; unsigned long *pgd_cache; unsigned long *pte_cache; diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 8b355d9ea078..ef4c97056f49 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -40,7 +40,8 @@ struct i2c_device; /* 2 is used in 2.3.x */ #define I2C_BUSID_BUZ 3 /* I2C bus on a BUZ */ #define I2C_BUSID_ZORAN 4 /* I2C bus on a Zoran */ -#define I2C_BUSID_SGIVWFB 5 /* Moved to be unique */ +#define I2C_BUSID_CYBER2000 5 /* I2C bus on a Cyber2000 */ +#define I2C_BUSID_SGIVWFB 6 /* Moved to be unique */ /* * struct for a driver for a i2c chip (tuner, soundprocessor, diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c76cada08522..2de251a0a2dc 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -30,7 +30,9 @@ #include #include #include +#ifdef __KERNEL__ #include +#endif #include diff --git a/include/linux/nls.h b/include/linux/nls.h index cf2142f62bab..4083f71bdeda 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h @@ -6,7 +6,7 @@ struct nls_unicode { struct nls_table { char *charset; void (*uni2char) (unsigned char ch, unsigned char cl, unsigned char *out, int boundlen, int *outlen); - void (*char2uni) (unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2); + void (*char2uni) (const unsigned char *rawstring, int *offset, unsigned char *uni1, unsigned char *uni2); void (*inc_use_count) (void); void (*dec_use_count) (void); diff --git a/init/main.c b/init/main.c index 4a086b242f43..0a2bfc3abf39 100644 --- a/init/main.c +++ b/init/main.c @@ -1230,8 +1230,8 @@ void __init calibrate_delay(void) /* Round the value and print it */ printk("%lu.%02lu BogoMIPS\n", - (loops_per_jiffy+2500)/(500000/HZ), - ((loops_per_jiffy+2500)/(5000/HZ)) % 100); + loops_per_jiffy/(500000/HZ), + (loops_per_jiffy/(5000/HZ)) % 100); } /* -- 2.39.5