diff --git a/[refs] b/[refs] index 227229fa2bcb..32ff399b8b6f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: caf5b04c82f05c65843b2d7189845d6c3df5a41e +refs/heads/master: 9216ad8cb7849d88b6d8e9f097718de4f25d4121 diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index b4a1ea762698..9474501dd6cc 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -123,15 +123,6 @@ Who: Christoph Hellwig --------------------------- -What: CONFIG_FORCED_INLINING -When: June 2006 -Why: Config option is there to see if gcc is good enough. (in january - 2006). If it is, the behavior should just be the default. If it's not, - the option should just go away entirely. -Who: Arjan van de Ven - ---------------------------- - What: START_ARRAY ioctl for md When: July 2006 Files: drivers/md/md.c diff --git a/trunk/Documentation/filesystems/tmpfs.txt b/trunk/Documentation/filesystems/tmpfs.txt index dbe4d87d2615..0d783c504ead 100644 --- a/trunk/Documentation/filesystems/tmpfs.txt +++ b/trunk/Documentation/filesystems/tmpfs.txt @@ -78,18 +78,6 @@ use up all the memory on the machine; but enhances the scalability of that instance in a system with many cpus making intensive use of it. -tmpfs has a mount option to set the NUMA memory allocation policy for -all files in that instance: -mpol=interleave prefers to allocate memory from each node in turn -mpol=default prefers to allocate memory from the local node -mpol=bind prefers to allocate from mpol_nodelist -mpol=preferred prefers to allocate from first node in mpol_nodelist - -The following mount option is used in conjunction with mpol=interleave, -mpol=bind or mpol=preferred: -mpol_nodelist: nodelist suitable for parsing with nodelist_parse. - - To specify the initial root directory you can use the following mount options: diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index 1cbcf65b764b..fe11fccf7e41 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -471,7 +471,7 @@ running once the system is up. arch/i386/kernel/cpu/cpufreq/elanfreq.c. elevator= [IOSCHED] - Format: {"anticipatory" | "cfq" | "deadline" | "noop"} + Format: {"as" | "cfq" | "deadline" | "noop"} See Documentation/block/as-iosched.txt and Documentation/block/deadline-iosched.txt for details. @@ -712,17 +712,9 @@ running once the system is up. load_ramdisk= [RAM] List of ramdisks to load from floppy See Documentation/ramdisk.txt. - lockd.nlm_grace_period=P [NFS] Assign grace period. - Format: - - lockd.nlm_tcpport=N [NFS] Assign TCP port. - Format: + lockd.udpport= [NFS] - lockd.nlm_timeout=T [NFS] Assign timeout value. - Format: - - lockd.nlm_udpport=M [NFS] Assign UDP port. - Format: + lockd.tcpport= [NFS] logibm.irq= [HW,MOUSE] Logitech Bus Mouse Driver Format: diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 513f3b6c35b9..71693c5c3137 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -1300,12 +1300,6 @@ M: ttb@tentacle.dhs.org and rml@novell.com L: linux-kernel@vger.kernel.org S: Maintained -INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) -P: Sylvain Meyer -M: sylvain.meyer@worldonline.fr -L: linux-fbdev-devel@lists.sourceforge.net -S: Maintained - INTEL 810/815 FRAMEBUFFER DRIVER P: Antonino Daplas M: adaplas@pol.net @@ -1895,11 +1889,11 @@ W: http://linux-ntfs.sf.net/ T: git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git S: Maintained -NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER -P: Antonino Daplas -M: adaplas@pol.net -L: linux-fbdev-devel@lists.sourceforge.net -S: Maintained +NVIDIA (RIVA) FRAMEBUFFER DRIVER +P: Ani Joshi +M: ajoshi@shell.unixbox.com +L: linux-nvidia@lists.surfsouth.com +S: Maintained ORACLE CLUSTER FILESYSTEM 2 (OCFS2) P: Mark Fasheh @@ -2194,12 +2188,6 @@ L: rtl@rtlinux.org W: www.rtlinux.org S: Maintained -S3 SAVAGE FRAMEBUFFER DRIVER -P: Antonino Daplas -M: adaplas@pol.net -L: linux-fbdev-devel@lists.sourceforge.net -S: Maintained - S390 P: Martin Schwidefsky M: schwidefsky@de.ibm.com diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig index 5959e36c3b4c..3cfd82a05b20 100644 --- a/trunk/arch/arm/Kconfig +++ b/trunk/arch/arm/Kconfig @@ -180,7 +180,6 @@ config ARCH_OMAP config ARCH_VERSATILE bool "Versatile" select ARM_AMBA - select ARM_VIC select ICST307 help This enables support for ARM Ltd Versatile board. @@ -401,38 +400,6 @@ config NO_IDLE_HZ Currently at least OMAP, PXA2xx and SA11x0 platforms are known to have accurate timekeeping with dynamic tick. -config AEABI - bool "Use the ARM EABI to compile the kernel" - help - This option allows for the kernel to be compiled using the latest - ARM ABI (aka EABI). This is only useful if you are using a user - space environment that is also compiled with EABI. - - Since there are major incompatibilities between the legacy ABI and - EABI, especially with regard to structure member alignment, this - option also changes the kernel syscall calling convention to - disambiguate both ABIs and allow for backward compatibility support - (selected with CONFIG_OABI_COMPAT). - - To use this you need GCC version 4.0.0 or later. - -config OABI_COMPAT - bool "Allow old ABI binaries to run with this kernel" - depends on AEABI - default y - help - This option preserves the old syscall interface along with the - new (ARM EABI) one. It also provides a compatibility layer to - intercept syscalls that have structure arguments which layout - in memory differs between the legacy ABI and the new ARM EABI - (only for non "thumb" binaries). This option adds a tiny - overhead to all syscalls and produces a slightly larger kernel. - If you know you'll be using only pure EABI user space then you - can say N here. If this option is not selected and you attempt - to execute a legacy ABI binary then the result will be - UNPREDICTABLE (in fact it can be predicted that it won't work - at all). If in doubt say Y. - config ARCH_DISCONTIGMEM_ENABLE bool default (ARCH_LH7A40X && !LH7A40X_CONTIGMEM) @@ -619,7 +586,6 @@ comment "At least one emulation must be selected" config FPE_NWFPE bool "NWFPE math emulation" - depends on !AEABI || OABI_COMPAT ---help--- Say Y to include the NWFPE floating point emulator in the kernel. This is necessary to run most binaries. Linux does not currently @@ -643,7 +609,7 @@ config FPE_NWFPE_XP config FPE_FASTFPE bool "FastFPE math emulation (EXPERIMENTAL)" - depends on (!AEABI || OABI_COMPAT) && !CPU_32v3 && EXPERIMENTAL + depends on !CPU_32v3 && EXPERIMENTAL ---help--- Say Y here to include the FAST floating point emulator in the kernel. This is an experimental much faster emulator which now also has full @@ -675,7 +641,6 @@ source "fs/Kconfig.binfmt" config ARTHUR tristate "RISC OS personality" - depends on !AEABI help Say Y here to include the kernel code necessary if you want to run Acorn RISC OS/Arthur binaries under Linux. This code is still very diff --git a/trunk/arch/arm/Makefile b/trunk/arch/arm/Makefile index fbfc14a56b96..1fa2a1011584 100644 --- a/trunk/arch/arm/Makefile +++ b/trunk/arch/arm/Makefile @@ -56,13 +56,8 @@ tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) -ifeq ($(CONFIG_AEABI),y) -CFLAGS_ABI :=-mabi=aapcs -mno-thumb-interwork -else -CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,) -endif - # Need -Uarm for gcc < 3.x +CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,) CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float diff --git a/trunk/arch/arm/common/Kconfig b/trunk/arch/arm/common/Kconfig index 5e34ca6d38b6..d7509c7a3c5e 100644 --- a/trunk/arch/arm/common/Kconfig +++ b/trunk/arch/arm/common/Kconfig @@ -1,10 +1,7 @@ -config ARM_GIC - bool - -config ARM_VIC +config ICST525 bool -config ICST525 +config ARM_GIC bool config ICST307 diff --git a/trunk/arch/arm/common/Makefile b/trunk/arch/arm/common/Makefile index c81a2ff6b5be..ec8d17c96906 100644 --- a/trunk/arch/arm/common/Makefile +++ b/trunk/arch/arm/common/Makefile @@ -4,7 +4,6 @@ obj-y += rtctime.o obj-$(CONFIG_ARM_GIC) += gic.o -obj-$(CONFIG_ARM_VIC) += vic.o obj-$(CONFIG_ICST525) += icst525.o obj-$(CONFIG_ICST307) += icst307.o obj-$(CONFIG_SA1111) += sa1111.o diff --git a/trunk/arch/arm/common/vic.c b/trunk/arch/arm/common/vic.c deleted file mode 100644 index a45ed1687a59..000000000000 --- a/trunk/arch/arm/common/vic.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * linux/arch/arm/common/vic.c - * - * Copyright (C) 1999 - 2003 ARM Limited - * Copyright (C) 2000 Deep Blue Solutions Ltd - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include -#include - -#include -#include -#include -#include - -static void __iomem *vic_base; - -static void vic_mask_irq(unsigned int irq) -{ - irq -= IRQ_VIC_START; - writel(1 << irq, vic_base + VIC_INT_ENABLE_CLEAR); -} - -static void vic_unmask_irq(unsigned int irq) -{ - irq -= IRQ_VIC_START; - writel(1 << irq, vic_base + VIC_INT_ENABLE); -} - -static struct irqchip vic_chip = { - .ack = vic_mask_irq, - .mask = vic_mask_irq, - .unmask = vic_unmask_irq, -}; - -void __init vic_init(void __iomem *base, u32 vic_sources) -{ - unsigned int i; - - vic_base = base; - - /* Disable all interrupts initially. */ - - writel(0, vic_base + VIC_INT_SELECT); - writel(0, vic_base + VIC_INT_ENABLE); - writel(~0, vic_base + VIC_INT_ENABLE_CLEAR); - writel(0, vic_base + VIC_IRQ_STATUS); - writel(0, vic_base + VIC_ITCR); - writel(~0, vic_base + VIC_INT_SOFT_CLEAR); - - /* - * Make sure we clear all existing interrupts - */ - writel(0, vic_base + VIC_VECT_ADDR); - for (i = 0; i < 19; i++) { - unsigned int value; - - value = readl(vic_base + VIC_VECT_ADDR); - writel(value, vic_base + VIC_VECT_ADDR); - } - - for (i = 0; i < 16; i++) { - void __iomem *reg = vic_base + VIC_VECT_CNTL0 + (i * 4); - writel(VIC_VECT_CNTL_ENABLE | i, reg); - } - - writel(32, vic_base + VIC_DEF_VECT_ADDR); - - for (i = 0; i < 32; i++) { - unsigned int irq = IRQ_VIC_START + i; - - set_irq_chip(irq, &vic_chip); - - if (vic_sources & (1 << i)) { - set_irq_handler(irq, do_level_IRQ); - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); - } - } -} diff --git a/trunk/arch/arm/kernel/Makefile b/trunk/arch/arm/kernel/Makefile index 2ce0e3a27a45..de94b0f3ee2a 100644 --- a/trunk/arch/arm/kernel/Makefile +++ b/trunk/arch/arm/kernel/Makefile @@ -20,7 +20,6 @@ obj-$(CONFIG_ARTHUR) += arthur.o obj-$(CONFIG_ISA_DMA) += dma-isa.o obj-$(CONFIG_PCI) += bios32.o obj-$(CONFIG_SMP) += smp.o -obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o obj-$(CONFIG_IWMMXT) += iwmmxt.o AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt diff --git a/trunk/arch/arm/kernel/armksyms.c b/trunk/arch/arm/kernel/armksyms.c index 1574941ebfe1..9997098009a9 100644 --- a/trunk/arch/arm/kernel/armksyms.c +++ b/trunk/arch/arm/kernel/armksyms.c @@ -35,16 +35,6 @@ extern void __udivsi3(void); extern void __umodsi3(void); extern void __do_div64(void); -extern void __aeabi_idiv(void); -extern void __aeabi_idivmod(void); -extern void __aeabi_lasr(void); -extern void __aeabi_llsl(void); -extern void __aeabi_llsr(void); -extern void __aeabi_lmul(void); -extern void __aeabi_uidiv(void); -extern void __aeabi_uidivmod(void); -extern void __aeabi_ulcmp(void); - extern void fpundefinstr(void); extern void fp_enter(void); @@ -151,18 +141,6 @@ EXPORT_SYMBOL(__udivsi3); EXPORT_SYMBOL(__umodsi3); EXPORT_SYMBOL(__do_div64); -#ifdef CONFIG_AEABI -EXPORT_SYMBOL(__aeabi_idiv); -EXPORT_SYMBOL(__aeabi_idivmod); -EXPORT_SYMBOL(__aeabi_lasr); -EXPORT_SYMBOL(__aeabi_llsl); -EXPORT_SYMBOL(__aeabi_llsr); -EXPORT_SYMBOL(__aeabi_lmul); -EXPORT_SYMBOL(__aeabi_uidiv); -EXPORT_SYMBOL(__aeabi_uidivmod); -EXPORT_SYMBOL(__aeabi_ulcmp); -#endif - /* bitops */ EXPORT_SYMBOL(_set_bit_le); EXPORT_SYMBOL(_test_and_set_bit_le); diff --git a/trunk/arch/arm/kernel/calls.S b/trunk/arch/arm/kernel/calls.S index 75e6f9a94713..55076a75e5bf 100644 --- a/trunk/arch/arm/kernel/calls.S +++ b/trunk/arch/arm/kernel/calls.S @@ -13,7 +13,7 @@ #define NR_syscalls 328 #else -100: +__syscall_start: /* 0 */ .long sys_restart_syscall .long sys_exit .long sys_fork_wrapper @@ -27,7 +27,7 @@ /* 10 */ .long sys_unlink .long sys_execve_wrapper .long sys_chdir - .long OBSOLETE(sys_time) /* used by libc4 */ + .long sys_time /* used by libc4 */ .long sys_mknod /* 15 */ .long sys_chmod .long sys_lchown16 @@ -36,15 +36,15 @@ .long sys_lseek /* 20 */ .long sys_getpid .long sys_mount - .long OBSOLETE(sys_oldumount) /* used by libc4 */ + .long sys_oldumount /* used by libc4 */ .long sys_setuid16 .long sys_getuid16 -/* 25 */ .long OBSOLETE(sys_stime) +/* 25 */ .long sys_stime .long sys_ptrace - .long OBSOLETE(sys_alarm) /* used by libc4 */ + .long sys_alarm /* used by libc4 */ .long sys_ni_syscall /* was sys_fstat */ .long sys_pause -/* 30 */ .long OBSOLETE(sys_utime) /* used by libc4 */ +/* 30 */ .long sys_utime /* used by libc4 */ .long sys_ni_syscall /* was sys_stty */ .long sys_ni_syscall /* was sys_getty */ .long sys_access @@ -90,21 +90,21 @@ .long sys_sigpending .long sys_sethostname /* 75 */ .long sys_setrlimit - .long OBSOLETE(sys_old_getrlimit) /* used by libc4 */ + .long sys_old_getrlimit /* used by libc4 */ .long sys_getrusage .long sys_gettimeofday .long sys_settimeofday /* 80 */ .long sys_getgroups16 .long sys_setgroups16 - .long OBSOLETE(old_select) /* used by libc4 */ + .long old_select /* used by libc4 */ .long sys_symlink .long sys_ni_syscall /* was sys_lstat */ /* 85 */ .long sys_readlink .long sys_uselib .long sys_swapon .long sys_reboot - .long OBSOLETE(old_readdir) /* used by libc4 */ -/* 90 */ .long OBSOLETE(old_mmap) /* used by libc4 */ + .long old_readdir /* used by libc4 */ +/* 90 */ .long old_mmap /* used by libc4 */ .long sys_munmap .long sys_truncate .long sys_ftruncate @@ -116,7 +116,7 @@ .long sys_statfs /* 100 */ .long sys_fstatfs .long sys_ni_syscall - .long OBSOLETE(sys_socketcall) + .long sys_socketcall .long sys_syslog .long sys_setitimer /* 105 */ .long sys_getitimer @@ -127,11 +127,11 @@ /* 110 */ .long sys_ni_syscall /* was sys_iopl */ .long sys_vhangup .long sys_ni_syscall - .long OBSOLETE(sys_syscall) /* call a syscall */ + .long sys_syscall /* call a syscall */ .long sys_wait4 /* 115 */ .long sys_swapoff .long sys_sysinfo - .long OBSOLETE(ABI(sys_ipc, sys_oabi_ipc)) + .long sys_ipc .long sys_fsync .long sys_sigreturn_wrapper /* 120 */ .long sys_clone_wrapper @@ -194,8 +194,8 @@ .long sys_rt_sigtimedwait .long sys_rt_sigqueueinfo .long sys_rt_sigsuspend_wrapper -/* 180 */ .long ABI(sys_pread64, sys_oabi_pread64) - .long ABI(sys_pwrite64, sys_oabi_pwrite64) +/* 180 */ .long sys_pread64 + .long sys_pwrite64 .long sys_chown16 .long sys_getcwd .long sys_capget @@ -207,11 +207,11 @@ /* 190 */ .long sys_vfork_wrapper .long sys_getrlimit .long sys_mmap2 - .long ABI(sys_truncate64, sys_oabi_truncate64) - .long ABI(sys_ftruncate64, sys_oabi_ftruncate64) -/* 195 */ .long ABI(sys_stat64, sys_oabi_stat64) - .long ABI(sys_lstat64, sys_oabi_lstat64) - .long ABI(sys_fstat64, sys_oabi_fstat64) + .long sys_truncate64 + .long sys_ftruncate64 +/* 195 */ .long sys_stat64 + .long sys_lstat64 + .long sys_fstat64 .long sys_lchown .long sys_getuid /* 200 */ .long sys_getgid @@ -235,11 +235,11 @@ .long sys_pivot_root .long sys_mincore /* 220 */ .long sys_madvise - .long ABI(sys_fcntl64, sys_oabi_fcntl64) + .long sys_fcntl64 .long sys_ni_syscall /* TUX */ .long sys_ni_syscall .long sys_gettid -/* 225 */ .long ABI(sys_readahead, sys_oabi_readahead) +/* 225 */ .long sys_readahead .long sys_setxattr .long sys_lsetxattr .long sys_fsetxattr @@ -265,8 +265,8 @@ .long sys_exit_group .long sys_lookup_dcookie /* 250 */ .long sys_epoll_create - .long ABI(sys_epoll_ctl, sys_oabi_epoll_ctl) - .long ABI(sys_epoll_wait, sys_oabi_epoll_wait) + .long sys_epoll_ctl + .long sys_epoll_wait .long sys_remap_file_pages .long sys_ni_syscall /* sys_set_thread_area */ /* 255 */ .long sys_ni_syscall /* sys_get_thread_area */ @@ -280,8 +280,8 @@ .long sys_clock_gettime .long sys_clock_getres /* 265 */ .long sys_clock_nanosleep - .long sys_statfs64_wrapper - .long sys_fstatfs64_wrapper + .long sys_statfs64 + .long sys_fstatfs64 .long sys_tgkill .long sys_utimes /* 270 */ .long sys_arm_fadvise64_64 @@ -312,7 +312,7 @@ /* 295 */ .long sys_getsockopt .long sys_sendmsg .long sys_recvmsg - .long ABI(sys_semop, sys_oabi_semop) + .long sys_semop .long sys_semget /* 300 */ .long sys_semctl .long sys_msgsnd @@ -326,7 +326,7 @@ .long sys_add_key /* 310 */ .long sys_request_key .long sys_keyctl - .long ABI(sys_semtimedop, sys_oabi_semtimedop) + .long sys_semtimedop /* vserver */ .long sys_ni_syscall .long sys_ioprio_set /* 315 */ .long sys_ioprio_get @@ -336,8 +336,9 @@ .long sys_mbind /* 320 */ .long sys_get_mempolicy .long sys_set_mempolicy +__syscall_end: - .rept NR_syscalls - (. - 100b) / 4 + .rept NR_syscalls - (__syscall_end - __syscall_start) / 4 .long sys_ni_syscall .endr #endif diff --git a/trunk/arch/arm/kernel/entry-armv.S b/trunk/arch/arm/kernel/entry-armv.S index 874e6bb79405..a52baedf6262 100644 --- a/trunk/arch/arm/kernel/entry-armv.S +++ b/trunk/arch/arm/kernel/entry-armv.S @@ -3,7 +3,6 @@ * * Copyright (C) 1996,1997,1998 Russell King. * ARM700 fix by Matthew Godbolt (linux-user@willothewisp.demon.co.uk) - * nommu support by Hyok S. Choi (hyok.choi@samsung.com) * * 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 @@ -105,24 +104,14 @@ common_invalid: /* * SVC mode handlers */ - -#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) -#define SPFIX(code...) code -#else -#define SPFIX(code...) -#endif - .macro svc_entry sub sp, sp, #S_FRAME_SIZE - SPFIX( tst sp, #4 ) - SPFIX( bicne sp, sp, #4 ) stmib sp, {r1 - r12} ldmia r0, {r1 - r3} add r5, sp, #S_SP @ here for interlock avoidance mov r4, #-1 @ "" "" "" "" add r0, sp, #S_FRAME_SIZE @ "" "" "" "" - SPFIX( addne r0, r0, #4 ) str r1, [sp] @ save the "real" r0 copied @ from the exception stack @@ -313,14 +302,7 @@ __pabt_svc: /* * User mode handlers - * - * EABI note: sp_svc is always 64-bit aligned here, so should S_FRAME_SIZE */ - -#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (S_FRAME_SIZE & 7) -#error "sizeof(struct pt_regs) must be a multiple of 8" -#endif - .macro usr_entry sub sp, sp, #S_FRAME_SIZE stmib sp, {r1 - r12} @@ -556,11 +538,7 @@ ENTRY(__switch_to) add ip, r1, #TI_CPU_SAVE ldr r3, [r2, #TI_TP_VALUE] stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack -#ifndef CONFIG_MMU - add r2, r2, #TI_CPU_DOMAIN -#else ldr r6, [r2, #TI_CPU_DOMAIN]! -#endif #if __LINUX_ARM_ARCH__ >= 6 #ifdef CONFIG_CPU_MPCORE clrex @@ -578,9 +556,7 @@ ENTRY(__switch_to) mov r4, #0xffff0fff str r3, [r4, #-15] @ TLS val at 0xffff0ff0 #endif -#ifdef CONFIG_MMU mcr p15, 0, r6, c3, c0, 0 @ Set domain register -#endif #ifdef CONFIG_VFP @ Always disable VFP so we can lazily save/restore the old @ state. This occurs in the context of the previous thread. diff --git a/trunk/arch/arm/kernel/entry-common.S b/trunk/arch/arm/kernel/entry-common.S index 2b92ce85f97f..e2b42997ad33 100644 --- a/trunk/arch/arm/kernel/entry-common.S +++ b/trunk/arch/arm/kernel/entry-common.S @@ -98,14 +98,20 @@ ENTRY(ret_from_fork) run on an ARM7 and we can save a couple of instructions. --pb */ #ifdef CONFIG_CPU_ARM710 -#define A710(code...) code -.Larm710bug: + .macro arm710_bug_check, instr, temp + and \temp, \instr, #0x0f000000 @ check for SWI + teq \temp, #0x0f000000 + bne .Larm700bug + .endm + +.Larm700bug: ldmia sp, {r0 - lr}^ @ Get calling r0 - lr mov r0, r0 add sp, sp, #S_FRAME_SIZE subs pc, lr, #4 #else -#define A710(code...) + .macro arm710_bug_check, instr, temp + .endm #endif .align 5 @@ -123,50 +129,14 @@ ENTRY(vector_swi) /* * Get the system call number. */ - -#if defined(CONFIG_OABI_COMPAT) - - /* - * If we have CONFIG_OABI_COMPAT then we need to look at the swi - * value to determine if it is an EABI or an old ABI call. - */ #ifdef CONFIG_ARM_THUMB - tst r8, #PSR_T_BIT - movne r10, #0 @ no thumb OABI emulation - ldreq r10, [lr, #-4] @ get SWI instruction -#else - ldr r10, [lr, #-4] @ get SWI instruction - A710( and ip, r10, #0x0f000000 @ check for SWI ) - A710( teq ip, #0x0f000000 ) - A710( bne .Larm710bug ) -#endif - -#elif defined(CONFIG_AEABI) - - /* - * Pure EABI user space always put syscall number into scno (r7). - */ - A710( ldr ip, [lr, #-4] @ get SWI instruction ) - A710( and ip, ip, #0x0f000000 @ check for SWI ) - A710( teq ip, #0x0f000000 ) - A710( bne .Larm710bug ) - -#elif defined(CONFIG_ARM_THUMB) - - /* Legacy ABI only, possibly thumb mode. */ tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs addne scno, r7, #__NR_SYSCALL_BASE @ put OS number in ldreq scno, [lr, #-4] - #else - - /* Legacy ABI only. */ ldr scno, [lr, #-4] @ get SWI instruction - A710( and ip, scno, #0x0f000000 @ check for SWI ) - A710( teq ip, #0x0f000000 ) - A710( bne .Larm710bug ) - #endif + arm710_bug_check scno, ip #ifdef CONFIG_ALIGNMENT_TRAP ldr ip, __cr_alignment @@ -175,31 +145,18 @@ ENTRY(vector_swi) #endif enable_irq + stmdb sp!, {r4, r5} @ push fifth and sixth args + get_thread_info tsk - adr tbl, sys_call_table @ load syscall table pointer ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing - -#if defined(CONFIG_OABI_COMPAT) - /* - * If the swi argument is zero, this is an EABI call and we do nothing. - * - * If this is an old ABI call, get the syscall number into scno and - * get the old ABI syscall table address. - */ - bics r10, r10, #0xff000000 - eorne scno, r10, #__NR_OABI_SYSCALL_BASE - ldrne tbl, =sys_oabi_call_table -#elif !defined(CONFIG_AEABI) bic scno, scno, #0xff000000 @ mask off SWI op-code eor scno, scno, #__NR_SYSCALL_BASE @ check OS number -#endif - - stmdb sp!, {r4, r5} @ push fifth and sixth args + adr tbl, sys_call_table @ load syscall table pointer tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? bne __sys_trace - cmp scno, #NR_syscalls @ check upper syscall limit adr lr, ret_fast_syscall @ return address + cmp scno, #NR_syscalls @ check upper syscall limit ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine add r1, sp, #S_OFF @@ -214,13 +171,11 @@ ENTRY(vector_swi) * context switches, and waiting for our parent to respond. */ __sys_trace: - mov r2, scno add r1, sp, #S_OFF mov r0, #0 @ trace entry [IP = 0] bl syscall_trace adr lr, __sys_trace_return @ return address - mov scno, r0 @ syscall number (possibly new) add r1, sp, #S_R0 + S_OFF @ pointer to regs cmp scno, #NR_syscalls @ check upper syscall limit ldmccia r1, {r0 - r3} @ have to reload r0 - r3 @@ -229,7 +184,6 @@ __sys_trace: __sys_trace_return: str r0, [sp, #S_R0 + S_OFF]! @ save returned r0 - mov r2, scno mov r1, sp mov r0, #1 @ trace exit [IP = 1] bl syscall_trace @@ -240,25 +194,11 @@ __sys_trace_return: .type __cr_alignment, #object __cr_alignment: .word cr_alignment -#endif - .ltorg - -/* - * This is the syscall table declaration for native ABI syscalls. - * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall. - */ -#define ABI(native, compat) native -#ifdef CONFIG_AEABI -#define OBSOLETE(syscall) sys_ni_syscall -#else -#define OBSOLETE(syscall) syscall #endif .type sys_call_table, #object ENTRY(sys_call_table) #include "calls.S" -#undef ABI -#undef OBSOLETE /*============================================================================ * Special system call wrappers @@ -267,7 +207,7 @@ ENTRY(sys_call_table) @ r8 = syscall table .type sys_syscall, #function sys_syscall: - eor scno, r0, #__NR_OABI_SYSCALL_BASE + eor scno, r0, #__NR_SYSCALL_BASE cmp scno, #__NR_syscall - __NR_SYSCALL_BASE cmpne scno, #NR_syscalls @ check range stmloia sp, {r5, r6} @ shuffle args @@ -315,16 +255,6 @@ sys_sigaltstack_wrapper: ldr r2, [sp, #S_OFF + S_SP] b do_sigaltstack -sys_statfs64_wrapper: - teq r1, #88 - moveq r1, #84 - b sys_statfs64 - -sys_fstatfs64_wrapper: - teq r1, #88 - moveq r1, #84 - b sys_fstatfs64 - /* * Note: off_4k (r5) is always units of 4K. If we can't do the requested * offset, we return EINVAL. @@ -341,49 +271,3 @@ sys_mmap2: str r5, [sp, #4] b do_mmap2 #endif - -#ifdef CONFIG_OABI_COMPAT - -/* - * These are syscalls with argument register differences - */ - -sys_oabi_pread64: - stmia sp, {r3, r4} - b sys_pread64 - -sys_oabi_pwrite64: - stmia sp, {r3, r4} - b sys_pwrite64 - -sys_oabi_truncate64: - mov r3, r2 - mov r2, r1 - b sys_truncate64 - -sys_oabi_ftruncate64: - mov r3, r2 - mov r2, r1 - b sys_ftruncate64 - -sys_oabi_readahead: - str r3, [sp] - mov r3, r2 - mov r2, r1 - b sys_readahead - -/* - * Let's declare a second syscall table for old ABI binaries - * using the compatibility syscall entries. - */ -#define ABI(native, compat) compat -#define OBSOLETE(syscall) syscall - - .type sys_oabi_call_table, #object -ENTRY(sys_oabi_call_table) -#include "calls.S" -#undef ABI -#undef OBSOLETE - -#endif - diff --git a/trunk/arch/arm/kernel/entry-header.S b/trunk/arch/arm/kernel/entry-header.S index 55c99cdab7d6..648cfff93138 100644 --- a/trunk/arch/arm/kernel/entry-header.S +++ b/trunk/arch/arm/kernel/entry-header.S @@ -19,7 +19,6 @@ @ @ Most of the stack format comes from struct pt_regs, but with @ the addition of 8 bytes for storing syscall args 5 and 6. -@ This _must_ remain a multiple of 8 for EABI. @ #define S_OFF 8 diff --git a/trunk/arch/arm/kernel/head.S b/trunk/arch/arm/kernel/head.S index 1aca1775b28f..1e985f2cd70f 100644 --- a/trunk/arch/arm/kernel/head.S +++ b/trunk/arch/arm/kernel/head.S @@ -251,11 +251,12 @@ __turn_mmu_on: * r10 = procinfo * * Returns: - * r0, r3, r6, r7 corrupted + * r0, r3, r5, r6, r7 corrupted * r4 = physical page table address */ .type __create_page_tables, %function __create_page_tables: + ldr r5, [r8, #MACHINFO_PHYSRAM] @ physram pgtbl r4 @ page table address /* @@ -302,7 +303,7 @@ __create_page_tables: * Then map first 1MB of ram in case it contains our boot params. */ add r0, r4, #PAGE_OFFSET >> 18 - orr r6, r7, #PHYS_OFFSET + orr r6, r5, r7 str r6, [r0] #ifdef CONFIG_XIP_KERNEL @@ -310,7 +311,7 @@ __create_page_tables: * Map some ram to cover our .data and .bss areas. * Mapping 3MB should be plenty. */ - sub r3, r4, #PHYS_OFFSET + sub r3, r4, r5 mov r3, r3, lsr #20 add r0, r0, r3, lsl #2 add r6, r6, r3, lsl #20 diff --git a/trunk/arch/arm/kernel/ptrace.c b/trunk/arch/arm/kernel/ptrace.c index 7b6256bb590e..e591f72bcdeb 100644 --- a/trunk/arch/arm/kernel/ptrace.c +++ b/trunk/arch/arm/kernel/ptrace.c @@ -766,11 +766,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) (unsigned long __user *) data); break; - case PTRACE_SET_SYSCALL: - ret = 0; - child->ptrace_message = data; - break; - default: ret = ptrace_request(child, request, addr, data); break; @@ -779,14 +774,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) return ret; } -asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) +asmlinkage void syscall_trace(int why, struct pt_regs *regs) { unsigned long ip; if (!test_thread_flag(TIF_SYSCALL_TRACE)) - return scno; + return; if (!(current->ptrace & PT_PTRACED)) - return scno; + return; /* * Save IP. IP is used to denote syscall entry/exit: @@ -795,8 +790,6 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) ip = regs->ARM_ip; regs->ARM_ip = why; - current->ptrace_message = scno; - /* the 0x80 provides a way for the tracing parent to distinguish between a syscall stop and SIGTRAP delivery */ ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) @@ -811,6 +804,4 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) current->exit_code = 0; } regs->ARM_ip = ip; - - return current->ptrace_message; } diff --git a/trunk/arch/arm/kernel/semaphore.c b/trunk/arch/arm/kernel/semaphore.c index 981fe5c6ccbe..4c31f2923055 100644 --- a/trunk/arch/arm/kernel/semaphore.c +++ b/trunk/arch/arm/kernel/semaphore.c @@ -177,42 +177,41 @@ int __down_trylock(struct semaphore * sem) * ip contains the semaphore pointer on entry. Save the C-clobbered * registers (r0 to r3 and lr), but not ip, as we use it as a return * value in some cases.. - * To remain AAPCS compliant (64-bit stack align) we save r4 as well. */ asm(" .section .sched.text,\"ax\",%progbits \n\ .align 5 \n\ .globl __down_failed \n\ __down_failed: \n\ - stmfd sp!, {r0 - r4, lr} \n\ + stmfd sp!, {r0 - r3, lr} \n\ mov r0, ip \n\ bl __down \n\ - ldmfd sp!, {r0 - r4, pc} \n\ + ldmfd sp!, {r0 - r3, pc} \n\ \n\ .align 5 \n\ .globl __down_interruptible_failed \n\ __down_interruptible_failed: \n\ - stmfd sp!, {r0 - r4, lr} \n\ + stmfd sp!, {r0 - r3, lr} \n\ mov r0, ip \n\ bl __down_interruptible \n\ mov ip, r0 \n\ - ldmfd sp!, {r0 - r4, pc} \n\ + ldmfd sp!, {r0 - r3, pc} \n\ \n\ .align 5 \n\ .globl __down_trylock_failed \n\ __down_trylock_failed: \n\ - stmfd sp!, {r0 - r4, lr} \n\ + stmfd sp!, {r0 - r3, lr} \n\ mov r0, ip \n\ bl __down_trylock \n\ mov ip, r0 \n\ - ldmfd sp!, {r0 - r4, pc} \n\ + ldmfd sp!, {r0 - r3, pc} \n\ \n\ .align 5 \n\ .globl __up_wakeup \n\ __up_wakeup: \n\ - stmfd sp!, {r0 - r4, lr} \n\ + stmfd sp!, {r0 - r3, lr} \n\ mov r0, ip \n\ bl __up \n\ - ldmfd sp!, {r0 - r4, pc} \n\ + ldmfd sp!, {r0 - r3, pc} \n\ "); EXPORT_SYMBOL(__down_failed); diff --git a/trunk/arch/arm/kernel/sys_arm.c b/trunk/arch/arm/kernel/sys_arm.c index a491de2d9024..ea569ba482b1 100644 --- a/trunk/arch/arm/kernel/sys_arm.c +++ b/trunk/arch/arm/kernel/sys_arm.c @@ -147,7 +147,6 @@ asmlinkage int old_select(struct sel_arg_struct __user *arg) return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); } -#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT) /* * sys_ipc() is the de-multiplexer for the SysV IPC calls.. * @@ -227,7 +226,6 @@ asmlinkage int sys_ipc(uint call, int first, int second, int third, return -ENOSYS; } } -#endif /* Fork a new task - this creates a new program thread. * This is called indirectly via a small wrapper diff --git a/trunk/arch/arm/kernel/sys_oabi-compat.c b/trunk/arch/arm/kernel/sys_oabi-compat.c deleted file mode 100644 index eafa8e5284af..000000000000 --- a/trunk/arch/arm/kernel/sys_oabi-compat.c +++ /dev/null @@ -1,339 +0,0 @@ -/* - * arch/arm/kernel/sys_oabi-compat.c - * - * Compatibility wrappers for syscalls that are used from - * old ABI user space binaries with an EABI kernel. - * - * Author: Nicolas Pitre - * Created: Oct 7, 2005 - * Copyright: MontaVista Software, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -/* - * The legacy ABI and the new ARM EABI have different rules making some - * syscalls incompatible especially with structure arguments. - * Most notably, Eabi says 64-bit members should be 64-bit aligned instead of - * simply word aligned. EABI also pads structures to the size of the largest - * member it contains instead of the invariant 32-bit. - * - * The following syscalls are affected: - * - * sys_stat64: - * sys_lstat64: - * sys_fstat64: - * - * struct stat64 has different sizes and some members are shifted - * Compatibility wrappers are needed for them and provided below. - * - * sys_fcntl64: - * - * struct flock64 has different sizes and some members are shifted - * A compatibility wrapper is needed and provided below. - * - * sys_statfs64: - * sys_fstatfs64: - * - * struct statfs64 has extra padding with EABI growing its size from - * 84 to 88. This struct is now __attribute__((packed,aligned(4))) - * with a small assembly wrapper to force the sz argument to 84 if it is 88 - * to avoid copying the extra padding over user space unexpecting it. - * - * sys_newuname: - * - * struct new_utsname has no padding with EABI. No problem there. - * - * sys_epoll_ctl: - * sys_epoll_wait: - * - * struct epoll_event has its second member shifted also affecting the - * structure size. Compatibility wrappers are needed and provided below. - * - * sys_ipc: - * sys_semop: - * sys_semtimedop: - * - * struct sembuf loses its padding with EABI. Since arrays of them are - * used they have to be copyed to remove the padding. Compatibility wrappers - * provided below. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -struct oldabi_stat64 { - unsigned long long st_dev; - unsigned int __pad1; - unsigned long __st_ino; - unsigned int st_mode; - unsigned int st_nlink; - - unsigned long st_uid; - unsigned long st_gid; - - unsigned long long st_rdev; - unsigned int __pad2; - - long long st_size; - unsigned long st_blksize; - unsigned long long st_blocks; - - unsigned long st_atime; - unsigned long st_atime_nsec; - - unsigned long st_mtime; - unsigned long st_mtime_nsec; - - unsigned long st_ctime; - unsigned long st_ctime_nsec; - - unsigned long long st_ino; -} __attribute__ ((packed,aligned(4))); - -static long cp_oldabi_stat64(struct kstat *stat, - struct oldabi_stat64 __user *statbuf) -{ - struct oldabi_stat64 tmp; - - tmp.st_dev = huge_encode_dev(stat->dev); - tmp.__pad1 = 0; - tmp.__st_ino = stat->ino; - tmp.st_mode = stat->mode; - tmp.st_nlink = stat->nlink; - tmp.st_uid = stat->uid; - tmp.st_gid = stat->gid; - tmp.st_rdev = huge_encode_dev(stat->rdev); - tmp.st_size = stat->size; - tmp.st_blocks = stat->blocks; - tmp.__pad2 = 0; - tmp.st_blksize = stat->blksize; - tmp.st_atime = stat->atime.tv_sec; - tmp.st_atime_nsec = stat->atime.tv_nsec; - tmp.st_mtime = stat->mtime.tv_sec; - tmp.st_mtime_nsec = stat->mtime.tv_nsec; - tmp.st_ctime = stat->ctime.tv_sec; - tmp.st_ctime_nsec = stat->ctime.tv_nsec; - tmp.st_ino = stat->ino; - return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; -} - -asmlinkage long sys_oabi_stat64(char __user * filename, - struct oldabi_stat64 __user * statbuf) -{ - struct kstat stat; - int error = vfs_stat(filename, &stat); - if (!error) - error = cp_oldabi_stat64(&stat, statbuf); - return error; -} - -asmlinkage long sys_oabi_lstat64(char __user * filename, - struct oldabi_stat64 __user * statbuf) -{ - struct kstat stat; - int error = vfs_lstat(filename, &stat); - if (!error) - error = cp_oldabi_stat64(&stat, statbuf); - return error; -} - -asmlinkage long sys_oabi_fstat64(unsigned long fd, - struct oldabi_stat64 __user * statbuf) -{ - struct kstat stat; - int error = vfs_fstat(fd, &stat); - if (!error) - error = cp_oldabi_stat64(&stat, statbuf); - return error; -} - -struct oabi_flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -} __attribute__ ((packed,aligned(4))); - -asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd, - unsigned long arg) -{ - struct oabi_flock64 user; - struct flock64 kernel; - mm_segment_t fs = USER_DS; /* initialized to kill a warning */ - unsigned long local_arg = arg; - int ret; - - switch (cmd) { - case F_GETLK64: - case F_SETLK64: - case F_SETLKW64: - if (copy_from_user(&user, (struct oabi_flock64 __user *)arg, - sizeof(user))) - return -EFAULT; - kernel.l_type = user.l_type; - kernel.l_whence = user.l_whence; - kernel.l_start = user.l_start; - kernel.l_len = user.l_len; - kernel.l_pid = user.l_pid; - local_arg = (unsigned long)&kernel; - fs = get_fs(); - set_fs(KERNEL_DS); - } - - ret = sys_fcntl64(fd, cmd, local_arg); - - switch (cmd) { - case F_GETLK64: - if (!ret) { - user.l_type = kernel.l_type; - user.l_whence = kernel.l_whence; - user.l_start = kernel.l_start; - user.l_len = kernel.l_len; - user.l_pid = kernel.l_pid; - if (copy_to_user((struct oabi_flock64 __user *)arg, - &user, sizeof(user))) - ret = -EFAULT; - } - case F_SETLK64: - case F_SETLKW64: - set_fs(fs); - } - - return ret; -} - -struct oabi_epoll_event { - __u32 events; - __u64 data; -} __attribute__ ((packed,aligned(4))); - -asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd, - struct oabi_epoll_event __user *event) -{ - struct oabi_epoll_event user; - struct epoll_event kernel; - mm_segment_t fs; - long ret; - - if (op == EPOLL_CTL_DEL) - return sys_epoll_ctl(epfd, op, fd, NULL); - if (copy_from_user(&user, event, sizeof(user))) - return -EFAULT; - kernel.events = user.events; - kernel.data = user.data; - fs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_epoll_ctl(epfd, op, fd, &kernel); - set_fs(fs); - return ret; -} - -asmlinkage long sys_oabi_epoll_wait(int epfd, - struct oabi_epoll_event __user *events, - int maxevents, int timeout) -{ - struct epoll_event *kbuf; - mm_segment_t fs; - long ret, err, i; - - if (maxevents <= 0 || maxevents > (INT_MAX/sizeof(struct epoll_event))) - return -EINVAL; - kbuf = kmalloc(sizeof(*kbuf) * maxevents, GFP_KERNEL); - if (!kbuf) - return -ENOMEM; - fs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_epoll_wait(epfd, kbuf, maxevents, timeout); - set_fs(fs); - err = 0; - for (i = 0; i < ret; i++) { - __put_user_error(kbuf[i].events, &events->events, err); - __put_user_error(kbuf[i].data, &events->data, err); - events++; - } - kfree(kbuf); - return err ? -EFAULT : ret; -} - -struct oabi_sembuf { - unsigned short sem_num; - short sem_op; - short sem_flg; - unsigned short __pad; -}; - -asmlinkage long sys_oabi_semtimedop(int semid, - struct oabi_sembuf __user *tsops, - unsigned nsops, - const struct timespec __user *timeout) -{ - struct sembuf *sops; - struct timespec local_timeout; - long err; - int i; - - if (nsops < 1) - return -EINVAL; - sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL); - if (!sops) - return -ENOMEM; - err = 0; - for (i = 0; i < nsops; i++) { - __get_user_error(sops[i].sem_num, &tsops->sem_num, err); - __get_user_error(sops[i].sem_op, &tsops->sem_op, err); - __get_user_error(sops[i].sem_flg, &tsops->sem_flg, err); - tsops++; - } - if (timeout) { - /* copy this as well before changing domain protection */ - err |= copy_from_user(&local_timeout, timeout, sizeof(*timeout)); - timeout = &local_timeout; - } - if (err) { - err = -EFAULT; - } else { - mm_segment_t fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_semtimedop(semid, sops, nsops, timeout); - set_fs(fs); - } - kfree(sops); - return err; -} - -asmlinkage long sys_oabi_semop(int semid, struct oabi_sembuf __user *tsops, - unsigned nsops) -{ - return sys_oabi_semtimedop(semid, tsops, nsops, NULL); -} - -extern asmlinkage int sys_ipc(uint call, int first, int second, int third, - void __user *ptr, long fifth); - -asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third, - void __user *ptr, long fifth) -{ - switch (call & 0xffff) { - case SEMOP: - return sys_oabi_semtimedop(first, - (struct oabi_sembuf __user *)ptr, - second, NULL); - case SEMTIMEDOP: - return sys_oabi_semtimedop(first, - (struct oabi_sembuf __user *)ptr, - second, - (const struct timespec __user *)fifth); - default: - return sys_ipc(call, first, second, third, ptr, fifth); - } -} diff --git a/trunk/arch/arm/kernel/traps.c b/trunk/arch/arm/kernel/traps.c index 10235b01582e..93cfd3ffcc72 100644 --- a/trunk/arch/arm/kernel/traps.c +++ b/trunk/arch/arm/kernel/traps.c @@ -404,7 +404,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) struct thread_info *thread = current_thread_info(); siginfo_t info; - if ((no >> 16) != (__ARM_NR_BASE>> 16)) + if ((no >> 16) != 0x9f) return bad_syscall(no, regs); switch (no & 0xffff) { diff --git a/trunk/arch/arm/lib/ashldi3.S b/trunk/arch/arm/lib/ashldi3.S index 55e57a1c2e6d..561e20717b30 100644 --- a/trunk/arch/arm/lib/ashldi3.S +++ b/trunk/arch/arm/lib/ashldi3.S @@ -37,7 +37,6 @@ Boston, MA 02110-1301, USA. */ #endif ENTRY(__ashldi3) -ENTRY(__aeabi_llsl) subs r3, r2, #32 rsb ip, r2, #32 diff --git a/trunk/arch/arm/lib/ashrdi3.S b/trunk/arch/arm/lib/ashrdi3.S index 0b31398f89b2..86fb2a90c301 100644 --- a/trunk/arch/arm/lib/ashrdi3.S +++ b/trunk/arch/arm/lib/ashrdi3.S @@ -37,7 +37,6 @@ Boston, MA 02110-1301, USA. */ #endif ENTRY(__ashrdi3) -ENTRY(__aeabi_lasr) subs r3, r2, #32 rsb ip, r2, #32 diff --git a/trunk/arch/arm/lib/lib1funcs.S b/trunk/arch/arm/lib/lib1funcs.S index 4e492f4b3f0e..59026029d017 100644 --- a/trunk/arch/arm/lib/lib1funcs.S +++ b/trunk/arch/arm/lib/lib1funcs.S @@ -206,7 +206,6 @@ Boston, MA 02111-1307, USA. */ ENTRY(__udivsi3) -ENTRY(__aeabi_uidiv) subs r2, r1, #1 moveq pc, lr @@ -247,7 +246,6 @@ ENTRY(__umodsi3) ENTRY(__divsi3) -ENTRY(__aeabi_idiv) cmp r1, #0 eor ip, r0, r1 @ save the sign of the result. @@ -305,33 +303,12 @@ ENTRY(__modsi3) rsbmi r0, r0, #0 mov pc, lr -#ifdef CONFIG_AEABI - -ENTRY(__aeabi_uidivmod) - - stmfd sp!, {r0, r1, ip, lr} - bl __aeabi_uidiv - ldmfd sp!, {r1, r2, ip, lr} - mul r3, r0, r2 - sub r1, r1, r3 - mov pc, lr - -ENTRY(__aeabi_idivmod) - - stmfd sp!, {r0, r1, ip, lr} - bl __aeabi_idiv - ldmfd sp!, {r1, r2, ip, lr} - mul r3, r0, r2 - sub r1, r1, r3 - mov pc, lr - -#endif Ldiv0: - str lr, [sp, #-8]! + str lr, [sp, #-4]! bl __div0 mov r0, #0 @ About as wrong as it could be. - ldr pc, [sp], #8 + ldr pc, [sp], #4 diff --git a/trunk/arch/arm/lib/lshrdi3.S b/trunk/arch/arm/lib/lshrdi3.S index a86dbdd59cc4..46c2ed19ec95 100644 --- a/trunk/arch/arm/lib/lshrdi3.S +++ b/trunk/arch/arm/lib/lshrdi3.S @@ -37,7 +37,6 @@ Boston, MA 02110-1301, USA. */ #endif ENTRY(__lshrdi3) -ENTRY(__aeabi_llsr) subs r3, r2, #32 rsb ip, r2, #32 diff --git a/trunk/arch/arm/lib/muldi3.S b/trunk/arch/arm/lib/muldi3.S index 72d594184b8a..c7fbdf005319 100644 --- a/trunk/arch/arm/lib/muldi3.S +++ b/trunk/arch/arm/lib/muldi3.S @@ -25,7 +25,6 @@ #endif ENTRY(__muldi3) -ENTRY(__aeabi_lmul) mul xh, yl, xh mla xh, xl, yh, xh diff --git a/trunk/arch/arm/lib/ucmpdi2.S b/trunk/arch/arm/lib/ucmpdi2.S index d847a62834cb..112630f93e5d 100644 --- a/trunk/arch/arm/lib/ucmpdi2.S +++ b/trunk/arch/arm/lib/ucmpdi2.S @@ -10,7 +10,6 @@ * published by the Free Software Foundation. */ -#include #include #ifdef __ARMEB__ @@ -34,16 +33,3 @@ ENTRY(__ucmpdi2) movhi r0, #2 mov pc, lr -#ifdef CONFIG_AEABI - -ENTRY(__aeabi_ulcmp) - - cmp xh, yh - cmpeq xl, yl - movlo r0, #-1 - moveq r0, #0 - movhi r0, #1 - mov pc, lr - -#endif - diff --git a/trunk/arch/arm/mach-aaec2000/aaed2000.c b/trunk/arch/arm/mach-aaec2000/aaed2000.c index dc5fa8e5ebef..f5ef69702296 100644 --- a/trunk/arch/arm/mach-aaec2000/aaed2000.c +++ b/trunk/arch/arm/mach-aaec2000/aaed2000.c @@ -90,6 +90,7 @@ static void __init aaed2000_map_io(void) MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform") /* Maintainer: Nicolas Bellido Y Ortega */ + .phys_ram = 0xf0000000, .phys_io = PIO_BASE, .io_pg_offst = ((VIO_BASE) >> 18) & 0xfffc, .map_io = aaed2000_map_io, diff --git a/trunk/arch/arm/mach-at91rm9200/board-csb337.c b/trunk/arch/arm/mach-at91rm9200/board-csb337.c index 54022e58d50d..4aec834ee47f 100644 --- a/trunk/arch/arm/mach-at91rm9200/board-csb337.c +++ b/trunk/arch/arm/mach-at91rm9200/board-csb337.c @@ -132,6 +132,7 @@ static void __init csb337_board_init(void) MACHINE_START(CSB337, "Cogent CSB337") /* Maintainer: Bill Gatliff */ + .phys_ram = AT91_SDRAM_BASE, .phys_io = AT91_BASE_SYS, .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, .boot_params = AT91_SDRAM_BASE + 0x100, diff --git a/trunk/arch/arm/mach-at91rm9200/board-csb637.c b/trunk/arch/arm/mach-at91rm9200/board-csb637.c index 8195f9d919ea..23e4cc21481a 100644 --- a/trunk/arch/arm/mach-at91rm9200/board-csb637.c +++ b/trunk/arch/arm/mach-at91rm9200/board-csb637.c @@ -105,6 +105,7 @@ static void __init csb637_board_init(void) MACHINE_START(CSB637, "Cogent CSB637") /* Maintainer: Bill Gatliff */ + .phys_ram = AT91_SDRAM_BASE, .phys_io = AT91_BASE_SYS, .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, .boot_params = AT91_SDRAM_BASE + 0x100, diff --git a/trunk/arch/arm/mach-at91rm9200/board-dk.c b/trunk/arch/arm/mach-at91rm9200/board-dk.c index 8a783368366e..8c747a31b95a 100644 --- a/trunk/arch/arm/mach-at91rm9200/board-dk.c +++ b/trunk/arch/arm/mach-at91rm9200/board-dk.c @@ -127,6 +127,7 @@ static void __init dk_board_init(void) MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK") /* Maintainer: SAN People/Atmel */ + .phys_ram = AT91_SDRAM_BASE, .phys_io = AT91_BASE_SYS, .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, .boot_params = AT91_SDRAM_BASE + 0x100, diff --git a/trunk/arch/arm/mach-at91rm9200/board-ek.c b/trunk/arch/arm/mach-at91rm9200/board-ek.c index fd0752eba897..d140645711be 100644 --- a/trunk/arch/arm/mach-at91rm9200/board-ek.c +++ b/trunk/arch/arm/mach-at91rm9200/board-ek.c @@ -120,6 +120,7 @@ static void __init ek_board_init(void) MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK") /* Maintainer: SAN People/Atmel */ + .phys_ram = AT91_SDRAM_BASE, .phys_io = AT91_BASE_SYS, .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, .boot_params = AT91_SDRAM_BASE + 0x100, diff --git a/trunk/arch/arm/mach-clps711x/autcpu12.c b/trunk/arch/arm/mach-clps711x/autcpu12.c index c13ca6c56baa..43b9423d1440 100644 --- a/trunk/arch/arm/mach-clps711x/autcpu12.c +++ b/trunk/arch/arm/mach-clps711x/autcpu12.c @@ -64,6 +64,7 @@ void __init autcpu12_map_io(void) MACHINE_START(AUTCPU12, "autronix autcpu12") /* Maintainer: Thomas Gleixner */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xff000000) >> 18) & 0xfffc, .boot_params = 0xc0020000, diff --git a/trunk/arch/arm/mach-clps711x/cdb89712.c b/trunk/arch/arm/mach-clps711x/cdb89712.c index 831df007f6c7..cba7be5a06c3 100644 --- a/trunk/arch/arm/mach-clps711x/cdb89712.c +++ b/trunk/arch/arm/mach-clps711x/cdb89712.c @@ -55,6 +55,7 @@ static void __init cdb89712_map_io(void) MACHINE_START(CDB89712, "Cirrus-CDB89712") /* Maintainer: Ray Lehtiniemi */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xff000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-clps711x/ceiva.c b/trunk/arch/arm/mach-clps711x/ceiva.c index e2b2c5ac8a83..35d51a759b59 100644 --- a/trunk/arch/arm/mach-clps711x/ceiva.c +++ b/trunk/arch/arm/mach-clps711x/ceiva.c @@ -56,6 +56,7 @@ static void __init ceiva_map_io(void) MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame") /* Maintainer: Rob Scott */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xff000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-clps711x/clep7312.c b/trunk/arch/arm/mach-clps711x/clep7312.c index 09fb57e45213..c83f3fd68fcd 100644 --- a/trunk/arch/arm/mach-clps711x/clep7312.c +++ b/trunk/arch/arm/mach-clps711x/clep7312.c @@ -38,6 +38,7 @@ fixup_clep7312(struct machine_desc *desc, struct tag *tags, MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") /* Maintainer: Nobody */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xff000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-clps711x/edb7211-arch.c b/trunk/arch/arm/mach-clps711x/edb7211-arch.c index dc81cc68595d..255c98b63e15 100644 --- a/trunk/arch/arm/mach-clps711x/edb7211-arch.c +++ b/trunk/arch/arm/mach-clps711x/edb7211-arch.c @@ -52,6 +52,7 @@ fixup_edb7211(struct machine_desc *desc, struct tag *tags, MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") /* Maintainer: Jon McClintock */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xff000000) >> 18) & 0xfffc, .boot_params = 0xc0020100, /* 0xc0000000 - 0xc001ffff can be video RAM */ diff --git a/trunk/arch/arm/mach-clps711x/fortunet.c b/trunk/arch/arm/mach-clps711x/fortunet.c index ff26a85aa4ba..3d88da0c287b 100644 --- a/trunk/arch/arm/mach-clps711x/fortunet.c +++ b/trunk/arch/arm/mach-clps711x/fortunet.c @@ -78,6 +78,7 @@ fortunet_fixup(struct machine_desc *desc, struct tag *tags, MACHINE_START(FORTUNET, "ARM-FortuNet") /* Maintainer: FortuNet Inc. */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc, .boot_params = 0x00000000, diff --git a/trunk/arch/arm/mach-clps711x/p720t.c b/trunk/arch/arm/mach-clps711x/p720t.c index 9ba45f4d5a7e..a1acb945fb51 100644 --- a/trunk/arch/arm/mach-clps711x/p720t.c +++ b/trunk/arch/arm/mach-clps711x/p720t.c @@ -90,6 +90,7 @@ static void __init p720t_map_io(void) MACHINE_START(P720T, "ARM-Prospector720T") /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xff000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-clps7500/core.c b/trunk/arch/arm/mach-clps7500/core.c index 5b12cab0e691..d869af0023f8 100644 --- a/trunk/arch/arm/mach-clps7500/core.c +++ b/trunk/arch/arm/mach-clps7500/core.c @@ -384,6 +384,7 @@ static void __init clps7500_init(void) MACHINE_START(CLPS7500, "CL-PS7500") /* Maintainer: Philip Blundell */ + .phys_ram = 0x10000000, .phys_io = 0x03000000, .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc, .map_io = clps7500_map_io, diff --git a/trunk/arch/arm/mach-ebsa110/core.c b/trunk/arch/arm/mach-ebsa110/core.c index 6d620d8268cc..ed4614983adb 100644 --- a/trunk/arch/arm/mach-ebsa110/core.c +++ b/trunk/arch/arm/mach-ebsa110/core.c @@ -284,6 +284,7 @@ arch_initcall(ebsa110_init); MACHINE_START(EBSA110, "EBSA110") /* Maintainer: Russell King */ + .phys_ram = 0x00000000, .phys_io = 0xe0000000, .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc, .boot_params = 0x00000400, diff --git a/trunk/arch/arm/mach-footbridge/cats-hw.c b/trunk/arch/arm/mach-footbridge/cats-hw.c index 5b64d5c5b967..49b898af0032 100644 --- a/trunk/arch/arm/mach-footbridge/cats-hw.c +++ b/trunk/arch/arm/mach-footbridge/cats-hw.c @@ -85,6 +85,7 @@ fixup_cats(struct machine_desc *desc, struct tag *tags, MACHINE_START(CATS, "Chalice-CATS") /* Maintainer: Philip Blundell */ + .phys_ram = 0x00000000, .phys_io = DC21285_ARMCSR_BASE, .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-footbridge/co285.c b/trunk/arch/arm/mach-footbridge/co285.c index 4545576ad8d9..548a79081688 100644 --- a/trunk/arch/arm/mach-footbridge/co285.c +++ b/trunk/arch/arm/mach-footbridge/co285.c @@ -29,6 +29,7 @@ fixup_coebsa285(struct machine_desc *desc, struct tag *tags, MACHINE_START(CO285, "co-EBSA285") /* Maintainer: Mark van Doesburg */ + .phys_ram = 0x00000000, .phys_io = DC21285_ARMCSR_BASE, .io_pg_offst = ((0x7cf00000) >> 18) & 0xfffc, .fixup = fixup_coebsa285, diff --git a/trunk/arch/arm/mach-footbridge/ebsa285.c b/trunk/arch/arm/mach-footbridge/ebsa285.c index b1d3bf20a41e..1c37605268d5 100644 --- a/trunk/arch/arm/mach-footbridge/ebsa285.c +++ b/trunk/arch/arm/mach-footbridge/ebsa285.c @@ -14,6 +14,7 @@ MACHINE_START(EBSA285, "EBSA285") /* Maintainer: Russell King */ + .phys_ram = 0x00000000, .phys_io = DC21285_ARMCSR_BASE, .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-footbridge/netwinder-hw.c b/trunk/arch/arm/mach-footbridge/netwinder-hw.c index 229bf0585e40..9e563de465b5 100644 --- a/trunk/arch/arm/mach-footbridge/netwinder-hw.c +++ b/trunk/arch/arm/mach-footbridge/netwinder-hw.c @@ -649,6 +649,7 @@ fixup_netwinder(struct machine_desc *desc, struct tag *tags, MACHINE_START(NETWINDER, "Rebel-NetWinder") /* Maintainer: Russell King/Rebel.com */ + .phys_ram = 0x00000000, .phys_io = DC21285_ARMCSR_BASE, .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-footbridge/personal.c b/trunk/arch/arm/mach-footbridge/personal.c index c4f843fc099d..0146b8bb59da 100644 --- a/trunk/arch/arm/mach-footbridge/personal.c +++ b/trunk/arch/arm/mach-footbridge/personal.c @@ -14,6 +14,7 @@ MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer") /* Maintainer: Jamey Hicks / George France */ + .phys_ram = 0x00000000, .phys_io = DC21285_ARMCSR_BASE, .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-h720x/h7201-eval.c b/trunk/arch/arm/mach-h720x/h7201-eval.c index 193f968edac3..fa59e9e2a5c8 100644 --- a/trunk/arch/arm/mach-h720x/h7201-eval.c +++ b/trunk/arch/arm/mach-h720x/h7201-eval.c @@ -31,6 +31,7 @@ MACHINE_START(H7201, "Hynix GMS30C7201") /* Maintainer: Robert Schwebel, Pengutronix */ + .phys_ram = 0x40000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc, .boot_params = 0xc0001000, diff --git a/trunk/arch/arm/mach-h720x/h7202-eval.c b/trunk/arch/arm/mach-h720x/h7202-eval.c index 36266896979c..d75c8221d2a5 100644 --- a/trunk/arch/arm/mach-h720x/h7202-eval.c +++ b/trunk/arch/arm/mach-h720x/h7202-eval.c @@ -72,6 +72,7 @@ static void __init init_eval_h7202(void) MACHINE_START(H7202, "Hynix HMS30C7202") /* Maintainer: Robert Schwebel, Pengutronix */ + .phys_ram = 0x40000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc, .boot_params = 0x40000100, diff --git a/trunk/arch/arm/mach-imx/mx1ads.c b/trunk/arch/arm/mach-imx/mx1ads.c index dc31e3fd6c57..c9e0cd8ed016 100644 --- a/trunk/arch/arm/mach-imx/mx1ads.c +++ b/trunk/arch/arm/mach-imx/mx1ads.c @@ -69,6 +69,7 @@ mx1ads_map_io(void) MACHINE_START(MX1ADS, "Motorola MX1ADS") /* Maintainer: Sascha Hauer, Pengutronix */ + .phys_ram = 0x08000000, .phys_io = 0x00200000, .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc, .boot_params = 0x08000100, diff --git a/trunk/arch/arm/mach-integrator/integrator_ap.c b/trunk/arch/arm/mach-integrator/integrator_ap.c index d8d3c2a5a97e..3afedeb56a6e 100644 --- a/trunk/arch/arm/mach-integrator/integrator_ap.c +++ b/trunk/arch/arm/mach-integrator/integrator_ap.c @@ -347,6 +347,7 @@ static struct sys_timer ap_timer = { MACHINE_START(INTEGRATOR, "ARM-Integrator") /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ + .phys_ram = 0x00000000, .phys_io = 0x16000000, .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-integrator/integrator_cp.c b/trunk/arch/arm/mach-integrator/integrator_cp.c index 31820170f306..16cf2482a3e9 100644 --- a/trunk/arch/arm/mach-integrator/integrator_cp.c +++ b/trunk/arch/arm/mach-integrator/integrator_cp.c @@ -578,6 +578,7 @@ static struct sys_timer cp_timer = { MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ + .phys_ram = 0x00000000, .phys_io = 0x16000000, .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-iop3xx/iop321-setup.c b/trunk/arch/arm/mach-iop3xx/iop321-setup.c index e4f4c52d93d4..80770233b8d4 100644 --- a/trunk/arch/arm/mach-iop3xx/iop321-setup.c +++ b/trunk/arch/arm/mach-iop3xx/iop321-setup.c @@ -151,6 +151,7 @@ extern void iop321_init_time(void); #if defined(CONFIG_ARCH_IQ80321) MACHINE_START(IQ80321, "Intel IQ80321") /* Maintainer: Intel Corporation */ + .phys_ram = PHYS_OFFSET, .phys_io = IQ80321_UART, .io_pg_offst = ((IQ80321_UART) >> 18) & 0xfffc, .map_io = iq80321_map_io, @@ -162,6 +163,7 @@ MACHINE_END #elif defined(CONFIG_ARCH_IQ31244) MACHINE_START(IQ31244, "Intel IQ31244") /* Maintainer: Intel Corp. */ + .phys_ram = PHYS_OFFSET, .phys_io = IQ31244_UART, .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc, .map_io = iq31244_map_io, diff --git a/trunk/arch/arm/mach-iop3xx/iop331-setup.c b/trunk/arch/arm/mach-iop3xx/iop331-setup.c index 63585485123e..e6ea1cba6a17 100644 --- a/trunk/arch/arm/mach-iop3xx/iop331-setup.c +++ b/trunk/arch/arm/mach-iop3xx/iop331-setup.c @@ -195,6 +195,7 @@ extern void iq80332_map_io(void); #if defined(CONFIG_ARCH_IQ80331) MACHINE_START(IQ80331, "Intel IQ80331") /* Maintainer: Intel Corp. */ + .phys_ram = PHYS_OFFSET, .phys_io = 0xfefff000, .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical .map_io = iq80331_map_io, @@ -207,6 +208,7 @@ MACHINE_END #elif defined(CONFIG_MACH_IQ80332) MACHINE_START(IQ80332, "Intel IQ80332") /* Maintainer: Intel Corp. */ + .phys_ram = PHYS_OFFSET, .phys_io = 0xfefff000, .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical .map_io = iq80332_map_io, diff --git a/trunk/arch/arm/mach-ixp2000/core.c b/trunk/arch/arm/mach-ixp2000/core.c index cfd5bef3190b..6851abaf5524 100644 --- a/trunk/arch/arm/mach-ixp2000/core.c +++ b/trunk/arch/arm/mach-ixp2000/core.c @@ -105,16 +105,6 @@ static struct map_desc ixp2000_io_desc[] __initdata = { .pfn = __phys_to_pfn(IXP2000_MSF_PHYS_BASE), .length = IXP2000_MSF_SIZE, .type = MT_IXP2000_DEVICE, - }, { - .virtual = IXP2000_SCRATCH_RING_VIRT_BASE, - .pfn = __phys_to_pfn(IXP2000_SCRATCH_RING_PHYS_BASE), - .length = IXP2000_SCRATCH_RING_SIZE, - .type = MT_IXP2000_DEVICE, - }, { - .virtual = IXP2000_SRAM0_VIRT_BASE, - .pfn = __phys_to_pfn(IXP2000_SRAM0_PHYS_BASE), - .length = IXP2000_SRAM0_SIZE, - .type = MT_IXP2000_DEVICE, }, { .virtual = IXP2000_PCI_IO_VIRT_BASE, .pfn = __phys_to_pfn(IXP2000_PCI_IO_PHYS_BASE), diff --git a/trunk/arch/arm/mach-ixp2000/enp2611.c b/trunk/arch/arm/mach-ixp2000/enp2611.c index 9e5a13bb39d0..61f6006241bd 100644 --- a/trunk/arch/arm/mach-ixp2000/enp2611.c +++ b/trunk/arch/arm/mach-ixp2000/enp2611.c @@ -254,6 +254,7 @@ static void __init enp2611_init_machine(void) MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board") /* Maintainer: Lennert Buytenhek */ + .phys_ram = 0x00000000, .phys_io = IXP2000_UART_PHYS_BASE, .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2400.c b/trunk/arch/arm/mach-ixp2000/ixdp2400.c index 7c782403042a..fd280a93637e 100644 --- a/trunk/arch/arm/mach-ixp2000/ixdp2400.c +++ b/trunk/arch/arm/mach-ixp2000/ixdp2400.c @@ -169,6 +169,7 @@ void ixdp2400_init_irq(void) MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = 0x00000000, .phys_io = IXP2000_UART_PHYS_BASE, .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2800.c b/trunk/arch/arm/mach-ixp2000/ixdp2800.c index 076e3f8acc96..f9073aa28615 100644 --- a/trunk/arch/arm/mach-ixp2000/ixdp2800.c +++ b/trunk/arch/arm/mach-ixp2000/ixdp2800.c @@ -285,6 +285,7 @@ void ixdp2800_init_irq(void) MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = 0x00000000, .phys_io = IXP2000_UART_PHYS_BASE, .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2x01.c b/trunk/arch/arm/mach-ixp2000/ixdp2x01.c index 10f06606d460..e6a882f35da2 100644 --- a/trunk/arch/arm/mach-ixp2000/ixdp2x01.c +++ b/trunk/arch/arm/mach-ixp2000/ixdp2x01.c @@ -376,6 +376,7 @@ static void __init ixdp2x01_init_machine(void) #ifdef CONFIG_ARCH_IXDP2401 MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = 0x00000000, .phys_io = IXP2000_UART_PHYS_BASE, .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc, .boot_params = 0x00000100, @@ -389,6 +390,7 @@ MACHINE_END #ifdef CONFIG_ARCH_IXDP2801 MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = 0x00000000, .phys_io = IXP2000_UART_PHYS_BASE, .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-ixp4xx/coyote-setup.c b/trunk/arch/arm/mach-ixp4xx/coyote-setup.c index 13f8a7ac3ba9..679594a73981 100644 --- a/trunk/arch/arm/mach-ixp4xx/coyote-setup.c +++ b/trunk/arch/arm/mach-ixp4xx/coyote-setup.c @@ -101,6 +101,7 @@ static void __init coyote_init(void) #ifdef CONFIG_ARCH_ADI_COYOTE MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = PHYS_OFFSET, .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, .map_io = ixp4xx_map_io, @@ -118,6 +119,7 @@ MACHINE_END #ifdef CONFIG_MACH_IXDPG425 MACHINE_START(IXDPG425, "Intel IXDPG425") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = PHYS_OFFSET, .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, .map_io = ixp4xx_map_io, diff --git a/trunk/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/trunk/arch/arm/mach-ixp4xx/gtwx5715-setup.c index 654e2eed81fb..038670489970 100644 --- a/trunk/arch/arm/mach-ixp4xx/gtwx5715-setup.c +++ b/trunk/arch/arm/mach-ixp4xx/gtwx5715-setup.c @@ -142,6 +142,7 @@ static void __init gtwx5715_init(void) MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)") /* Maintainer: George Joseph */ + .phys_ram = PHYS_OFFSET, .phys_io = IXP4XX_UART2_BASE_PHYS, .io_pg_offst = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc, .map_io = ixp4xx_map_io, diff --git a/trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c b/trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c index da72383ee301..c2e105c89c95 100644 --- a/trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c @@ -121,6 +121,7 @@ static void __init ixdp425_init(void) #ifdef CONFIG_ARCH_IXDP425 MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = PHYS_OFFSET, .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, .map_io = ixp4xx_map_io, @@ -134,6 +135,7 @@ MACHINE_END #ifdef CONFIG_MACH_IXDP465 MACHINE_START(IXDP465, "Intel IXDP465 Development Platform") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = PHYS_OFFSET, .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, .map_io = ixp4xx_map_io, @@ -147,6 +149,7 @@ MACHINE_END #ifdef CONFIG_ARCH_PRPMC1100 MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = PHYS_OFFSET, .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, .map_io = ixp4xx_map_io, @@ -166,6 +169,7 @@ MACHINE_END #ifdef CONFIG_ARCH_AVILA MACHINE_START(AVILA, "Gateworks Avila Network Platform") /* Maintainer: Deepak Saxena */ + .phys_ram = PHYS_OFFSET, .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, .map_io = ixp4xx_map_io, diff --git a/trunk/arch/arm/mach-ixp4xx/nas100d-setup.c b/trunk/arch/arm/mach-ixp4xx/nas100d-setup.c index 856d56f3b2ae..49998a8bd4e8 100644 --- a/trunk/arch/arm/mach-ixp4xx/nas100d-setup.c +++ b/trunk/arch/arm/mach-ixp4xx/nas100d-setup.c @@ -124,6 +124,7 @@ static void __init nas100d_init(void) MACHINE_START(NAS100D, "Iomega NAS 100d") /* Maintainer: www.nslu2-linux.org */ + .phys_ram = PHYS_OFFSET, .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-ixp4xx/nslu2-setup.c b/trunk/arch/arm/mach-ixp4xx/nslu2-setup.c index da9340a53434..289e94cb65c2 100644 --- a/trunk/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/trunk/arch/arm/mach-ixp4xx/nslu2-setup.c @@ -123,6 +123,7 @@ static void __init nslu2_init(void) MACHINE_START(NSLU2, "Linksys NSLU2") /* Maintainer: www.nslu2-linux.org */ + .phys_ram = PHYS_OFFSET, .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-l7200/core.c b/trunk/arch/arm/mach-l7200/core.c index ac626436e96f..03ed742ae2be 100644 --- a/trunk/arch/arm/mach-l7200/core.c +++ b/trunk/arch/arm/mach-l7200/core.c @@ -91,6 +91,7 @@ static void __init l7200_map_io(void) MACHINE_START(L7200, "LinkUp Systems L7200") /* Maintainer: Steve Hill / Scott McConnell */ + .phys_ram = 0xf0000000, .phys_io = 0x80040000, .io_pg_offst = ((0xd0000000) >> 18) & 0xfffc, .map_io = l7200_map_io, diff --git a/trunk/arch/arm/mach-lh7a40x/arch-kev7a400.c b/trunk/arch/arm/mach-lh7a40x/arch-kev7a400.c index 2cccc27c62e4..19f2fa2244c4 100644 --- a/trunk/arch/arm/mach-lh7a40x/arch-kev7a400.c +++ b/trunk/arch/arm/mach-lh7a40x/arch-kev7a400.c @@ -112,6 +112,7 @@ void __init lh7a40x_init_board_irq (void) MACHINE_START (KEV7A400, "Sharp KEV7a400") /* Maintainer: Marc Singer */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((io_p2v (0x80000000))>>18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/trunk/arch/arm/mach-lh7a40x/arch-lpd7a40x.c index 12e23277c5ea..4eb962fdb3a8 100644 --- a/trunk/arch/arm/mach-lh7a40x/arch-lpd7a40x.c +++ b/trunk/arch/arm/mach-lh7a40x/arch-lpd7a40x.c @@ -317,6 +317,7 @@ lpd7a400_map_io(void) MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10") /* Maintainer: Marc Singer */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((io_p2v (0x80000000))>>18) & 0xfffc, .boot_params = 0xc0000100, @@ -332,6 +333,7 @@ MACHINE_END MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10") /* Maintainer: Marc Singer */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((io_p2v (0x80000000))>>18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-omap1/board-generic.c b/trunk/arch/arm/mach-omap1/board-generic.c index bdc20b51b076..4b292e93fbe2 100644 --- a/trunk/arch/arm/mach-omap1/board-generic.c +++ b/trunk/arch/arm/mach-omap1/board-generic.c @@ -109,6 +109,7 @@ static void __init omap_generic_map_io(void) MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") /* Maintainer: Tony Lindgren */ + .phys_ram = 0x10000000, .phys_io = 0xfff00000, .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-omap1/board-h2.c b/trunk/arch/arm/mach-omap1/board-h2.c index 9533c36a92df..a07e2c9307fa 100644 --- a/trunk/arch/arm/mach-omap1/board-h2.c +++ b/trunk/arch/arm/mach-omap1/board-h2.c @@ -199,6 +199,7 @@ static void __init h2_map_io(void) MACHINE_START(OMAP_H2, "TI-H2") /* Maintainer: Imre Deak */ + .phys_ram = 0x10000000, .phys_io = 0xfff00000, .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-omap1/board-h3.c b/trunk/arch/arm/mach-omap1/board-h3.c index d665efc1c344..668e278433c2 100644 --- a/trunk/arch/arm/mach-omap1/board-h3.c +++ b/trunk/arch/arm/mach-omap1/board-h3.c @@ -215,6 +215,7 @@ static void __init h3_map_io(void) MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") /* Maintainer: Texas Instruments, Inc. */ + .phys_ram = 0x10000000, .phys_io = 0xfff00000, .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-omap1/board-innovator.c b/trunk/arch/arm/mach-omap1/board-innovator.c index 652f37c7f906..95f1ff36cdcb 100644 --- a/trunk/arch/arm/mach-omap1/board-innovator.c +++ b/trunk/arch/arm/mach-omap1/board-innovator.c @@ -303,6 +303,7 @@ static void __init innovator_map_io(void) MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") /* Maintainer: MontaVista Software, Inc. */ + .phys_ram = 0x10000000, .phys_io = 0xfff00000, .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-omap1/board-netstar.c b/trunk/arch/arm/mach-omap1/board-netstar.c index 58f783930d45..0448fa7de8a4 100644 --- a/trunk/arch/arm/mach-omap1/board-netstar.c +++ b/trunk/arch/arm/mach-omap1/board-netstar.c @@ -149,6 +149,7 @@ postcore_initcall(netstar_late_init); MACHINE_START(NETSTAR, "NetStar OMAP5910") /* Maintainer: Ladislav Michl */ + .phys_ram = 0x10000000, .phys_io = 0xfff00000, .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-omap1/board-osk.c b/trunk/arch/arm/mach-omap1/board-osk.c index e5d126e8f276..e990e1bc1669 100644 --- a/trunk/arch/arm/mach-omap1/board-osk.c +++ b/trunk/arch/arm/mach-omap1/board-osk.c @@ -274,6 +274,7 @@ static void __init osk_map_io(void) MACHINE_START(OMAP_OSK, "TI-OSK") /* Maintainer: Dirk Behme */ + .phys_ram = 0x10000000, .phys_io = 0xfff00000, .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-omap1/board-palmte.c b/trunk/arch/arm/mach-omap1/board-palmte.c index 67fada207622..5c975eb5c34b 100644 --- a/trunk/arch/arm/mach-omap1/board-palmte.c +++ b/trunk/arch/arm/mach-omap1/board-palmte.c @@ -76,6 +76,7 @@ static void __init omap_generic_map_io(void) } MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E") + .phys_ram = 0x10000000, .phys_io = 0xfff00000, .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-omap1/board-perseus2.c b/trunk/arch/arm/mach-omap1/board-perseus2.c index 88708a0c52a2..92ff5dc07351 100644 --- a/trunk/arch/arm/mach-omap1/board-perseus2.c +++ b/trunk/arch/arm/mach-omap1/board-perseus2.c @@ -199,6 +199,7 @@ static void __init omap_perseus2_map_io(void) MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") /* Maintainer: Kevin Hilman */ + .phys_ram = 0x10000000, .phys_io = 0xfff00000, .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-omap1/board-voiceblue.c b/trunk/arch/arm/mach-omap1/board-voiceblue.c index 959b4b847c87..6f9a6220e78a 100644 --- a/trunk/arch/arm/mach-omap1/board-voiceblue.c +++ b/trunk/arch/arm/mach-omap1/board-voiceblue.c @@ -281,6 +281,7 @@ EXPORT_SYMBOL(voiceblue_wdt_ping); MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") /* Maintainer: Ladislav Michl */ + .phys_ram = 0x10000000, .phys_io = 0xfff00000, .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-omap2/board-generic.c b/trunk/arch/arm/mach-omap2/board-generic.c index b937123e5c65..c602e7a3d93e 100644 --- a/trunk/arch/arm/mach-omap2/board-generic.c +++ b/trunk/arch/arm/mach-omap2/board-generic.c @@ -69,6 +69,7 @@ static void __init omap_generic_map_io(void) MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") /* Maintainer: Paul Mundt */ + .phys_ram = 0x80000000, .phys_io = 0x48000000, .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, .boot_params = 0x80000100, diff --git a/trunk/arch/arm/mach-omap2/board-h4.c b/trunk/arch/arm/mach-omap2/board-h4.c index c3c35d40378a..f2554469a76a 100644 --- a/trunk/arch/arm/mach-omap2/board-h4.c +++ b/trunk/arch/arm/mach-omap2/board-h4.c @@ -186,6 +186,7 @@ static void __init omap_h4_map_io(void) MACHINE_START(OMAP_H4, "OMAP2420 H4 board") /* Maintainer: Paul Mundt */ + .phys_ram = 0x80000000, .phys_io = 0x48000000, .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, .boot_params = 0x80000100, diff --git a/trunk/arch/arm/mach-pxa/corgi.c b/trunk/arch/arm/mach-pxa/corgi.c index 7ffd2de8f2f3..5a7b873f29b3 100644 --- a/trunk/arch/arm/mach-pxa/corgi.c +++ b/trunk/arch/arm/mach-pxa/corgi.c @@ -342,6 +342,7 @@ static void __init fixup_corgi(struct machine_desc *desc, #ifdef CONFIG_MACH_CORGI MACHINE_START(CORGI, "SHARP Corgi") + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_corgi, @@ -354,6 +355,7 @@ MACHINE_END #ifdef CONFIG_MACH_SHEPHERD MACHINE_START(SHEPHERD, "SHARP Shepherd") + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_corgi, @@ -366,6 +368,7 @@ MACHINE_END #ifdef CONFIG_MACH_HUSKY MACHINE_START(HUSKY, "SHARP Husky") + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_corgi, diff --git a/trunk/arch/arm/mach-pxa/idp.c b/trunk/arch/arm/mach-pxa/idp.c index 347b9dea24c6..7de159e2ab42 100644 --- a/trunk/arch/arm/mach-pxa/idp.c +++ b/trunk/arch/arm/mach-pxa/idp.c @@ -183,6 +183,7 @@ static void __init idp_map_io(void) MACHINE_START(PXA_IDP, "Vibren PXA255 IDP") /* Maintainer: Vibren Technologies */ + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .map_io = idp_map_io, diff --git a/trunk/arch/arm/mach-pxa/lubbock.c b/trunk/arch/arm/mach-pxa/lubbock.c index 3e26d7ce5bb2..b464bc88ff93 100644 --- a/trunk/arch/arm/mach-pxa/lubbock.c +++ b/trunk/arch/arm/mach-pxa/lubbock.c @@ -437,6 +437,7 @@ static void __init lubbock_map_io(void) MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)") /* Maintainer: MontaVista Software Inc. */ + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .map_io = lubbock_map_io, diff --git a/trunk/arch/arm/mach-pxa/mainstone.c b/trunk/arch/arm/mach-pxa/mainstone.c index d5bda60209ec..8da9d3efe9a0 100644 --- a/trunk/arch/arm/mach-pxa/mainstone.c +++ b/trunk/arch/arm/mach-pxa/mainstone.c @@ -489,6 +489,7 @@ static void __init mainstone_map_io(void) MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") /* Maintainer: MontaVista Software Inc. */ + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .map_io = mainstone_map_io, diff --git a/trunk/arch/arm/mach-pxa/poodle.c b/trunk/arch/arm/mach-pxa/poodle.c index 911e6ff5a9bd..663c95005985 100644 --- a/trunk/arch/arm/mach-pxa/poodle.c +++ b/trunk/arch/arm/mach-pxa/poodle.c @@ -311,6 +311,7 @@ static void __init fixup_poodle(struct machine_desc *desc, } MACHINE_START(POODLE, "SHARP Poodle") + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_poodle, diff --git a/trunk/arch/arm/mach-pxa/spitz.c b/trunk/arch/arm/mach-pxa/spitz.c index c094d99ebf56..a9eacc06555f 100644 --- a/trunk/arch/arm/mach-pxa/spitz.c +++ b/trunk/arch/arm/mach-pxa/spitz.c @@ -497,6 +497,7 @@ static void __init fixup_spitz(struct machine_desc *desc, #ifdef CONFIG_MACH_SPITZ MACHINE_START(SPITZ, "SHARP Spitz") + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_spitz, @@ -509,6 +510,7 @@ MACHINE_END #ifdef CONFIG_MACH_BORZOI MACHINE_START(BORZOI, "SHARP Borzoi") + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_spitz, @@ -521,6 +523,7 @@ MACHINE_END #ifdef CONFIG_MACH_AKITA MACHINE_START(AKITA, "SHARP Akita") + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_spitz, diff --git a/trunk/arch/arm/mach-pxa/tosa.c b/trunk/arch/arm/mach-pxa/tosa.c index d168286ed470..e4f92efc616e 100644 --- a/trunk/arch/arm/mach-pxa/tosa.c +++ b/trunk/arch/arm/mach-pxa/tosa.c @@ -295,6 +295,7 @@ static void __init fixup_tosa(struct machine_desc *desc, } MACHINE_START(TOSA, "SHARP Tosa") + .phys_ram = 0xa0000000, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_tosa, diff --git a/trunk/arch/arm/mach-realview/Kconfig b/trunk/arch/arm/mach-realview/Kconfig index 17f5f4439fe7..129976866d47 100644 --- a/trunk/arch/arm/mach-realview/Kconfig +++ b/trunk/arch/arm/mach-realview/Kconfig @@ -3,6 +3,7 @@ menu "RealView platform type" config MACH_REALVIEW_EB bool "Support RealView/EB platform" + default n select ARM_GIC help Include support for the ARM(R) RealView Emulation Baseboard platform. diff --git a/trunk/arch/arm/mach-realview/realview_eb.c b/trunk/arch/arm/mach-realview/realview_eb.c index d4a586e38d5b..112f7592aca9 100644 --- a/trunk/arch/arm/mach-realview/realview_eb.c +++ b/trunk/arch/arm/mach-realview/realview_eb.c @@ -166,6 +166,7 @@ static void __init realview_eb_init(void) MACHINE_START(REALVIEW_EB, "ARM-RealView EB") /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ + .phys_ram = 0x00000000, .phys_io = REALVIEW_UART0_BASE, .io_pg_offst = (IO_ADDRESS(REALVIEW_UART0_BASE) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-rpc/riscpc.c b/trunk/arch/arm/mach-rpc/riscpc.c index 208a2b5dba1b..5c4ac1c008a6 100644 --- a/trunk/arch/arm/mach-rpc/riscpc.c +++ b/trunk/arch/arm/mach-rpc/riscpc.c @@ -177,6 +177,7 @@ extern struct sys_timer ioc_timer; MACHINE_START(RISCPC, "Acorn-RiscPC") /* Maintainer: Russell King */ + .phys_ram = 0x10000000, .phys_io = 0x03000000, .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc, .boot_params = 0x10000100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-anubis.c b/trunk/arch/arm/mach-s3c2410/mach-anubis.c index 3e327b8e46be..0f81fc0c2f7f 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-anubis.c +++ b/trunk/arch/arm/mach-s3c2410/mach-anubis.c @@ -294,6 +294,7 @@ static void __init anubis_map_io(void) MACHINE_START(ANUBIS, "Simtec-Anubis") /* Maintainer: Ben Dooks */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-bast.c b/trunk/arch/arm/mach-s3c2410/mach-bast.c index 995bb8add331..4d962717fdf7 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-bast.c +++ b/trunk/arch/arm/mach-s3c2410/mach-bast.c @@ -527,6 +527,7 @@ static void __init bast_init(void) MACHINE_START(BAST, "Simtec-BAST") /* Maintainer: Ben Dooks */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-h1940.c b/trunk/arch/arm/mach-s3c2410/mach-h1940.c index 1c316f14ed94..0aa8760598f7 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-h1940.c +++ b/trunk/arch/arm/mach-s3c2410/mach-h1940.c @@ -171,6 +171,7 @@ static void __init h1940_init(void) MACHINE_START(H1940, "IPAQ-H1940") /* Maintainer: Ben Dooks */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-n30.c b/trunk/arch/arm/mach-s3c2410/mach-n30.c index 116ac3169966..378d640ab00b 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-n30.c +++ b/trunk/arch/arm/mach-s3c2410/mach-n30.c @@ -128,6 +128,7 @@ MACHINE_START(N30, "Acer-N30") /* Maintainer: Christer Weinigel , Ben Dooks */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-nexcoder.c b/trunk/arch/arm/mach-s3c2410/mach-nexcoder.c index 07d09509a626..42b0eeff2e0f 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-nexcoder.c +++ b/trunk/arch/arm/mach-s3c2410/mach-nexcoder.c @@ -148,6 +148,7 @@ static void __init nexcoder_map_io(void) MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") /* Maintainer: Guillaume GOURAT */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-otom.c b/trunk/arch/arm/mach-s3c2410/mach-otom.c index b39daedf93ca..a2eb9ed48fcd 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-otom.c +++ b/trunk/arch/arm/mach-s3c2410/mach-otom.c @@ -116,6 +116,7 @@ static void __init otom11_map_io(void) MACHINE_START(OTOM, "Nex Vision - Otom 1.1") /* Maintainer: Guillaume GOURAT */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-rx3715.c b/trunk/arch/arm/mach-s3c2410/mach-rx3715.c index 0260ed5ab946..f8d86d1e16b6 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-rx3715.c +++ b/trunk/arch/arm/mach-s3c2410/mach-rx3715.c @@ -205,6 +205,7 @@ static void __init rx3715_init_machine(void) MACHINE_START(RX3715, "IPAQ-RX3715") /* Maintainer: Ben Dooks */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-smdk2410.c b/trunk/arch/arm/mach-s3c2410/mach-smdk2410.c index 1e76e1fdfcea..2c91965ee1c8 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-smdk2410.c +++ b/trunk/arch/arm/mach-s3c2410/mach-smdk2410.c @@ -115,6 +115,7 @@ static void __init smdk2410_init_irq(void) MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch * to SMDK2410 */ /* Maintainer: Jonas Dietsche */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-smdk2440.c b/trunk/arch/arm/mach-s3c2410/mach-smdk2440.c index f4315721c3b8..4e31118533e6 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-smdk2440.c +++ b/trunk/arch/arm/mach-s3c2410/mach-smdk2440.c @@ -216,6 +216,7 @@ static void __init smdk2440_machine_init(void) MACHINE_START(S3C2440, "SMDK2440") /* Maintainer: Ben Dooks */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-s3c2410/mach-vr1000.c b/trunk/arch/arm/mach-s3c2410/mach-vr1000.c index 785fc9cdcf7c..ae7e099bf6c8 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-vr1000.c +++ b/trunk/arch/arm/mach-s3c2410/mach-vr1000.c @@ -395,6 +395,7 @@ static void __init vr1000_map_io(void) MACHINE_START(VR1000, "Thorcom-VR1000") /* Maintainer: Ben Dooks */ + .phys_ram = S3C2410_SDRAM_PA, .phys_io = S3C2410_PA_UART, .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, .boot_params = S3C2410_SDRAM_PA + 0x100, diff --git a/trunk/arch/arm/mach-sa1100/assabet.c b/trunk/arch/arm/mach-sa1100/assabet.c index a599bb0d4ab8..a66ac61233a2 100644 --- a/trunk/arch/arm/mach-sa1100/assabet.c +++ b/trunk/arch/arm/mach-sa1100/assabet.c @@ -447,6 +447,7 @@ static void __init assabet_map_io(void) MACHINE_START(ASSABET, "Intel-Assabet") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-sa1100/badge4.c b/trunk/arch/arm/mach-sa1100/badge4.c index f60b7a66dfa0..edccd5eb06be 100644 --- a/trunk/arch/arm/mach-sa1100/badge4.c +++ b/trunk/arch/arm/mach-sa1100/badge4.c @@ -297,6 +297,7 @@ static void __init badge4_map_io(void) } MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-sa1100/cerf.c b/trunk/arch/arm/mach-sa1100/cerf.c index 8269a9ef9afe..508593722bc7 100644 --- a/trunk/arch/arm/mach-sa1100/cerf.c +++ b/trunk/arch/arm/mach-sa1100/cerf.c @@ -135,6 +135,7 @@ static void __init cerf_init(void) MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") /* Maintainer: support@intrinsyc.com */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .map_io = cerf_map_io, diff --git a/trunk/arch/arm/mach-sa1100/collie.c b/trunk/arch/arm/mach-sa1100/collie.c index 6888816a1935..522abc036d3a 100644 --- a/trunk/arch/arm/mach-sa1100/collie.c +++ b/trunk/arch/arm/mach-sa1100/collie.c @@ -191,6 +191,7 @@ static void __init collie_map_io(void) } MACHINE_START(COLLIE, "Sharp-Collie") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .map_io = collie_map_io, diff --git a/trunk/arch/arm/mach-sa1100/h3600.c b/trunk/arch/arm/mach-sa1100/h3600.c index b04d92271020..e8352b7f74b0 100644 --- a/trunk/arch/arm/mach-sa1100/h3600.c +++ b/trunk/arch/arm/mach-sa1100/h3600.c @@ -392,6 +392,7 @@ static void __init h3100_map_io(void) } MACHINE_START(H3100, "Compaq iPAQ H3100") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, @@ -509,6 +510,7 @@ static void __init h3600_map_io(void) } MACHINE_START(H3600, "Compaq iPAQ H3600") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, @@ -895,6 +897,7 @@ static void __init h3800_map_io(void) } MACHINE_START(H3800, "Compaq iPAQ H3800") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-sa1100/hackkit.c b/trunk/arch/arm/mach-sa1100/hackkit.c index 046b213efd5b..c922e043c424 100644 --- a/trunk/arch/arm/mach-sa1100/hackkit.c +++ b/trunk/arch/arm/mach-sa1100/hackkit.c @@ -195,6 +195,7 @@ static void __init hackkit_init(void) */ MACHINE_START(HACKKIT, "HackKit Cpu Board") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-sa1100/jornada720.c b/trunk/arch/arm/mach-sa1100/jornada720.c index 17f5a43acdb7..2f671cc3cb99 100644 --- a/trunk/arch/arm/mach-sa1100/jornada720.c +++ b/trunk/arch/arm/mach-sa1100/jornada720.c @@ -173,6 +173,7 @@ static void __init jornada720_mach_init(void) MACHINE_START(JORNADA720, "HP Jornada 720") /* Maintainer: Michael Gernoth */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-sa1100/lart.c b/trunk/arch/arm/mach-sa1100/lart.c index 07d3a696ae7f..8c9e3dd52942 100644 --- a/trunk/arch/arm/mach-sa1100/lart.c +++ b/trunk/arch/arm/mach-sa1100/lart.c @@ -60,6 +60,7 @@ static void __init lart_map_io(void) } MACHINE_START(LART, "LART") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-sa1100/pleb.c b/trunk/arch/arm/mach-sa1100/pleb.c index 0709ebab531c..58c18f9e9b7b 100644 --- a/trunk/arch/arm/mach-sa1100/pleb.c +++ b/trunk/arch/arm/mach-sa1100/pleb.c @@ -146,6 +146,7 @@ static void __init pleb_map_io(void) } MACHINE_START(PLEB, "PLEB") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .map_io = pleb_map_io, diff --git a/trunk/arch/arm/mach-sa1100/shannon.c b/trunk/arch/arm/mach-sa1100/shannon.c index 5aafe0b56992..7482288278d9 100644 --- a/trunk/arch/arm/mach-sa1100/shannon.c +++ b/trunk/arch/arm/mach-sa1100/shannon.c @@ -83,6 +83,7 @@ static void __init shannon_map_io(void) } MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)") + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-sa1100/simpad.c b/trunk/arch/arm/mach-sa1100/simpad.c index d2c23b2c34d1..439ddc9b06d6 100644 --- a/trunk/arch/arm/mach-sa1100/simpad.c +++ b/trunk/arch/arm/mach-sa1100/simpad.c @@ -229,6 +229,7 @@ arch_initcall(simpad_init); MACHINE_START(SIMPAD, "Simpad") /* Maintainer: Holger Freyther */ + .phys_ram = 0xc0000000, .phys_io = 0x80000000, .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, .boot_params = 0xc0000100, diff --git a/trunk/arch/arm/mach-shark/core.c b/trunk/arch/arm/mach-shark/core.c index 877600e212dd..2d428b6dbb58 100644 --- a/trunk/arch/arm/mach-shark/core.c +++ b/trunk/arch/arm/mach-shark/core.c @@ -111,6 +111,7 @@ static struct sys_timer shark_timer = { MACHINE_START(SHARK, "Shark") /* Maintainer: Alexander Schulz */ + .phys_ram = 0x08000000, .phys_io = 0x40000000, .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc, .boot_params = 0x08003000, diff --git a/trunk/arch/arm/mach-versatile/Kconfig b/trunk/arch/arm/mach-versatile/Kconfig index 95096afd5271..8d787f4c78e6 100644 --- a/trunk/arch/arm/mach-versatile/Kconfig +++ b/trunk/arch/arm/mach-versatile/Kconfig @@ -9,6 +9,7 @@ config ARCH_VERSATILE_PB config MACH_VERSATILE_AB bool "Support Versatile/AB platform" + default n help Include support for the ARM(R) Versatile/AP platform. diff --git a/trunk/arch/arm/mach-versatile/core.c b/trunk/arch/arm/mach-versatile/core.c index 9ebbe808b41d..90023745b23a 100644 --- a/trunk/arch/arm/mach-versatile/core.c +++ b/trunk/arch/arm/mach-versatile/core.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -57,6 +56,24 @@ #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) +static void vic_mask_irq(unsigned int irq) +{ + irq -= IRQ_VIC_START; + writel(1 << irq, VA_VIC_BASE + VIC_IRQ_ENABLE_CLEAR); +} + +static void vic_unmask_irq(unsigned int irq) +{ + irq -= IRQ_VIC_START; + writel(1 << irq, VA_VIC_BASE + VIC_IRQ_ENABLE); +} + +static struct irqchip vic_chip = { + .ack = vic_mask_irq, + .mask = vic_mask_irq, + .unmask = vic_unmask_irq, +}; + static void sic_mask_irq(unsigned int irq) { irq -= IRQ_SIC_START; @@ -110,12 +127,43 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) void __init versatile_init_irq(void) { - unsigned int i; + unsigned int i, value; + + /* Disable all interrupts initially. */ - vic_init(VA_VIC_BASE, ~(1 << 31)); + writel(0, VA_VIC_BASE + VIC_INT_SELECT); + writel(0, VA_VIC_BASE + VIC_IRQ_ENABLE); + writel(~0, VA_VIC_BASE + VIC_IRQ_ENABLE_CLEAR); + writel(0, VA_VIC_BASE + VIC_IRQ_STATUS); + writel(0, VA_VIC_BASE + VIC_ITCR); + writel(~0, VA_VIC_BASE + VIC_IRQ_SOFT_CLEAR); + + /* + * Make sure we clear all existing interrupts + */ + writel(0, VA_VIC_BASE + VIC_VECT_ADDR); + for (i = 0; i < 19; i++) { + value = readl(VA_VIC_BASE + VIC_VECT_ADDR); + writel(value, VA_VIC_BASE + VIC_VECT_ADDR); + } + + for (i = 0; i < 16; i++) { + value = readl(VA_VIC_BASE + VIC_VECT_CNTL0 + (i * 4)); + writel(value | VICVectCntl_Enable | i, VA_VIC_BASE + VIC_VECT_CNTL0 + (i * 4)); + } + + writel(32, VA_VIC_BASE + VIC_DEF_VECT_ADDR); + + for (i = IRQ_VIC_START; i <= IRQ_VIC_END; i++) { + if (i != IRQ_VICSOURCE31) { + set_irq_chip(i, &vic_chip); + set_irq_handler(i, do_level_IRQ); + set_irq_flags(i, IRQF_VALID | IRQF_PROBE); + } + } set_irq_handler(IRQ_VICSOURCE31, sic_handle_irq); - enable_irq(IRQ_VICSOURCE31); + vic_unmask_irq(IRQ_VICSOURCE31); /* Do second interrupt controller */ writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); @@ -829,7 +877,7 @@ static unsigned long versatile_gettimeoffset(void) ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff; do { ticks1 = ticks2; - status = __raw_readl(VA_IC_BASE + VIC_RAW_STATUS); + status = __raw_readl(VA_IC_BASE + VIC_IRQ_RAW_STATUS); ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff; } while (ticks2 > ticks1); diff --git a/trunk/arch/arm/mach-versatile/versatile_ab.c b/trunk/arch/arm/mach-versatile/versatile_ab.c index 1eb596782078..e74c8a2fbb95 100644 --- a/trunk/arch/arm/mach-versatile/versatile_ab.c +++ b/trunk/arch/arm/mach-versatile/versatile_ab.c @@ -36,6 +36,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB") /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ + .phys_ram = 0x00000000, .phys_io = 0x101f1000, .io_pg_offst = ((0xf11f1000) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/mach-versatile/versatile_pb.c b/trunk/arch/arm/mach-versatile/versatile_pb.c index f17ab4fb548a..22d5ca07f75d 100644 --- a/trunk/arch/arm/mach-versatile/versatile_pb.c +++ b/trunk/arch/arm/mach-versatile/versatile_pb.c @@ -100,6 +100,7 @@ arch_initcall(versatile_pb_init); MACHINE_START(VERSATILE_PB, "ARM-Versatile PB") /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ + .phys_ram = 0x00000000, .phys_io = 0x101f1000, .io_pg_offst = ((0xf11f1000) >> 18) & 0xfffc, .boot_params = 0x00000100, diff --git a/trunk/arch/arm/nwfpe/fpa11.h b/trunk/arch/arm/nwfpe/fpa11.h index 28cd79a451d3..da4c616b6c49 100644 --- a/trunk/arch/arm/nwfpe/fpa11.h +++ b/trunk/arch/arm/nwfpe/fpa11.h @@ -62,7 +62,7 @@ typedef union tagFPREG { #else u32 padding[3]; #endif -} __attribute__ ((packed,aligned(4))) FPREG; +} FPREG; /* * FPA11 device model. @@ -89,7 +89,7 @@ typedef struct tagFPA11 { so we can use it to detect whether this instance of the emulator needs to be initialised. */ -} __attribute__ ((packed,aligned(4))) FPA11; +} FPA11; extern int8 SetRoundingMode(const unsigned int); extern int8 SetRoundingPrecision(const unsigned int); diff --git a/trunk/arch/arm/plat-omap/Kconfig b/trunk/arch/arm/plat-omap/Kconfig index 0887bb2a2551..9693e9b4ffd1 100644 --- a/trunk/arch/arm/plat-omap/Kconfig +++ b/trunk/arch/arm/plat-omap/Kconfig @@ -22,6 +22,7 @@ comment "OMAP Feature Selections" config OMAP_RESET_CLOCKS bool "Reset unused clocks during boot" depends on ARCH_OMAP + default n help Say Y if you want to reset unused clocks during boot. This option saves power, but assumes all drivers are @@ -43,6 +44,7 @@ config OMAP_MUX config OMAP_MUX_DEBUG bool "Multiplexing debug output" depends on OMAP_MUX + default n help Makes the multiplexing functions print out a lot of debug info. This is useful if you want to find out the correct values of the @@ -91,6 +93,7 @@ config OMAP_32K_TIMER_HZ config OMAP_DM_TIMER bool "Use dual-mode timer" + default n depends on ARCH_OMAP16XX help Select this option if you want to use OMAP Dual-Mode timers. diff --git a/trunk/arch/i386/Kconfig b/trunk/arch/i386/Kconfig index cbde675bc95c..d5d0df7f04fc 100644 --- a/trunk/arch/i386/Kconfig +++ b/trunk/arch/i386/Kconfig @@ -702,15 +702,6 @@ config PHYSICAL_START Don't change this unless you know what you are doing. -config HOTPLUG_CPU - bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" - depends on SMP && HOTPLUG && EXPERIMENTAL - ---help--- - Say Y here to experiment with turning CPUs off and on. CPUs - can be controlled through /sys/devices/system/cpu. - - Say N. - endmenu @@ -997,6 +988,15 @@ config SCx200 This support is also available as a module. If compiled as a module, it will be called scx200. +config HOTPLUG_CPU + bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" + depends on SMP && HOTPLUG && EXPERIMENTAL + ---help--- + Say Y here to experiment with turning CPUs off and on. CPUs + can be controlled through /sys/devices/system/cpu. + + Say N. + source "drivers/pcmcia/Kconfig" source "drivers/pci/hotplug/Kconfig" diff --git a/trunk/arch/i386/Makefile b/trunk/arch/i386/Makefile index bd2d53a9dd2b..d3c0409d201c 100644 --- a/trunk/arch/i386/Makefile +++ b/trunk/arch/i386/Makefile @@ -42,9 +42,9 @@ include $(srctree)/arch/i386/Makefile.cpu cflags-$(CONFIG_REGPARM) += $(shell if [ $(call cc-version) -ge 0300 ] ; then \ echo "-mregparm=3"; fi ;) -# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use -# a lot more stack due to the lack of sharing of stacklots: -CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;) +# Disable unit-at-a-time mode, it makes gcc use a lot more stack +# due to the lack of sharing of stacklots. +CFLAGS += $(call cc-option,-fno-unit-at-a-time) CFLAGS += $(cflags-y) diff --git a/trunk/arch/i386/kernel/traps.c b/trunk/arch/i386/kernel/traps.c index 0aaebf3e1cfa..b9f0030a2ebb 100644 --- a/trunk/arch/i386/kernel/traps.c +++ b/trunk/arch/i386/kernel/traps.c @@ -112,38 +112,33 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) p < (void *)tinfo + THREAD_SIZE - 3; } -static void print_addr_and_symbol(unsigned long addr, char *log_lvl) -{ - printk(log_lvl); - printk(" [<%08lx>] ", addr); - print_symbol("%s", addr); - printk("\n"); -} - static inline unsigned long print_context_stack(struct thread_info *tinfo, - unsigned long *stack, unsigned long ebp, - char *log_lvl) + unsigned long *stack, unsigned long ebp) { unsigned long addr; #ifdef CONFIG_FRAME_POINTER while (valid_stack_ptr(tinfo, (void *)ebp)) { addr = *(unsigned long *)(ebp + 4); - print_addr_and_symbol(addr, log_lvl); + printk(KERN_EMERG " [<%08lx>] ", addr); + print_symbol("%s", addr); + printk("\n"); ebp = *(unsigned long *)ebp; } #else while (valid_stack_ptr(tinfo, stack)) { addr = *stack++; - if (__kernel_text_address(addr)) - print_addr_and_symbol(addr, log_lvl); + if (__kernel_text_address(addr)) { + printk(KERN_EMERG " [<%08lx>]", addr); + print_symbol(" %s", addr); + printk("\n"); + } } #endif return ebp; } -static void show_trace_log_lvl(struct task_struct *task, - unsigned long *stack, char *log_lvl) +void show_trace(struct task_struct *task, unsigned long * stack) { unsigned long ebp; @@ -162,7 +157,7 @@ static void show_trace_log_lvl(struct task_struct *task, struct thread_info *context; context = (struct thread_info *) ((unsigned long)stack & (~(THREAD_SIZE - 1))); - ebp = print_context_stack(context, stack, ebp, log_lvl); + ebp = print_context_stack(context, stack, ebp); stack = (unsigned long*)context->previous_esp; if (!stack) break; @@ -170,13 +165,7 @@ static void show_trace_log_lvl(struct task_struct *task, } } -void show_trace(struct task_struct *task, unsigned long * stack) -{ - show_trace_log_lvl(task, stack, ""); -} - -static void show_stack_log_lvl(struct task_struct *task, unsigned long *esp, - char *log_lvl) +void show_stack(struct task_struct *task, unsigned long *esp) { unsigned long *stack; int i; @@ -189,26 +178,16 @@ static void show_stack_log_lvl(struct task_struct *task, unsigned long *esp, } stack = esp; - printk(log_lvl); + printk(KERN_EMERG); for(i = 0; i < kstack_depth_to_print; i++) { if (kstack_end(stack)) break; - if (i && ((i % 8) == 0)) { - printk("\n"); - printk(log_lvl); - printk(" "); - } + if (i && ((i % 8) == 0)) + printk("\n" KERN_EMERG " "); printk("%08lx ", *stack++); } - printk("\n"); - printk(log_lvl); - printk("Call Trace:\n"); - show_trace_log_lvl(task, esp, log_lvl); -} - -void show_stack(struct task_struct *task, unsigned long *esp) -{ - show_stack_log_lvl(task, esp, ""); + printk("\n" KERN_EMERG "Call Trace:\n"); + show_trace(task, esp); } /* @@ -259,7 +238,7 @@ void show_registers(struct pt_regs *regs) u8 __user *eip; printk("\n" KERN_EMERG "Stack: "); - show_stack_log_lvl(NULL, (unsigned long *)esp, KERN_EMERG); + show_stack(NULL, (unsigned long*)esp); printk(KERN_EMERG "Code: "); diff --git a/trunk/arch/i386/pci/fixup.c b/trunk/arch/i386/pci/fixup.c index 83c3645ccc43..65f67070db64 100644 --- a/trunk/arch/i386/pci/fixup.c +++ b/trunk/arch/i386/pci/fixup.c @@ -449,19 +449,3 @@ static void __devinit pci_post_fixup_toshiba_ohci1394(struct pci_dev *dev) } DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_TI, 0x8032, pci_post_fixup_toshiba_ohci1394); - - -/* - * Prevent the BIOS trapping accesses to the Cyrix CS5530A video device - * configuration space. - */ -static void __devinit pci_early_fixup_cyrix_5530(struct pci_dev *dev) -{ - u8 r; - /* clear 'F4 Video Configuration Trap' bit */ - pci_read_config_byte(dev, 0x42, &r); - r &= 0xfd; - pci_write_config_byte(dev, 0x42, r); -} -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, - pci_early_fixup_cyrix_5530); diff --git a/trunk/arch/ia64/configs/gensparse_defconfig b/trunk/arch/ia64/configs/gensparse_defconfig index 1d07d8072ec2..80f8663bc6d9 100644 --- a/trunk/arch/ia64/configs/gensparse_defconfig +++ b/trunk/arch/ia64/configs/gensparse_defconfig @@ -701,7 +701,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_SGI_L1_CONSOLE=y # CONFIG_SERIAL_JSM is not set CONFIG_SERIAL_SGI_IOC4=y -CONFIG_SERIAL_SGI_IOC3=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 @@ -1047,7 +1046,6 @@ CONFIG_INFINIBAND_IPOIB=m # SN Devices # CONFIG_SGI_IOC4=y -CONFIG_SGI_IOC3=y # # File systems diff --git a/trunk/arch/ia64/configs/sn2_defconfig b/trunk/arch/ia64/configs/sn2_defconfig index 3cb503b659e6..ff8bb3770c9d 100644 --- a/trunk/arch/ia64/configs/sn2_defconfig +++ b/trunk/arch/ia64/configs/sn2_defconfig @@ -659,7 +659,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_SGI_L1_CONSOLE=y # CONFIG_SERIAL_JSM is not set CONFIG_SERIAL_SGI_IOC4=y -CONFIG_SERIAL_SGI_IOC3=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 @@ -900,7 +899,6 @@ CONFIG_INFINIBAND_SRP=m # SN Devices # CONFIG_SGI_IOC4=y -CONFIG_SGI_IOC3=y # # File systems diff --git a/trunk/arch/powerpc/boot/Makefile b/trunk/arch/powerpc/boot/Makefile index 788dec4c7ef3..840ae595a617 100644 --- a/trunk/arch/powerpc/boot/Makefile +++ b/trunk/arch/powerpc/boot/Makefile @@ -27,6 +27,7 @@ BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \ BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc OBJCOPYFLAGS := contents,alloc,load,readonly,data OBJCOPY_COFF_ARGS := -O aixcoff-rs6000 --set-start 0x500000 +OBJCOPY_MIB_ARGS := -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c zlibheader := infblock.h infcodes.h inffast.h inftrees.h infutil.h @@ -90,11 +91,11 @@ gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section))) hostprogs-y := addnote addRamDisk hack-coff targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd \ - zImage.coff zImage.initrd.coff \ + zImage.coff zImage.initrd.coff miboot.image miboot.initrd.image \ $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \ - vmlinux.initrd + vmlinux.initrd dummy.o extra-y := initrd.o quiet_cmd_ramdisk = RAMDISK $@ @@ -116,6 +117,10 @@ quiet_cmd_addsection = ADDSEC $@ quiet_cmd_addnote = ADDNOTE $@ cmd_addnote = $(obj)/addnote $@ +quiet_cmd_gen-miboot = GEN $@ + cmd_gen-miboot = $(OBJCOPY) $(OBJCOPY_MIB_ARGS) \ + --add-section=$1=$(word 2, $^) $< $@ + quiet_cmd_gencoff = COFF $@ cmd_gencoff = $(OBJCOPY) $(OBJCOPY_COFF_ARGS) $@ && \ $(obj)/hack-coff $@ @@ -141,19 +146,25 @@ $(obj)/zImage.initrd.vmode $(obj)/zImage.initrd.coff: obj-boot += $(call obj-sec $(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds $(call cmd,bootld,$(obj-boot),zImage.lds) -# For 32-bit powermacs, build the COFF images as well as the ELF images. +# For 32-bit powermacs, build the COFF and miboot images +# as well as the ELF images. coffimage-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.coff coffrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.initrd.coff +mibootimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/miboot.image +mibrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/miboot.initrd.image -$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote $(coffimage-y-y) +$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote $(coffimage-y-y) \ + $(mibootimg-y-y) @cp -f $< $@ $(call if_changed,addnote) -$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote $(coffrdimg-y-y) +$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote \ + $(coffrdimg-y-y) $(mibrdimg-y-y) @cp -f $< $@ $(call if_changed,addnote) -$(obj)/zImage.coff: $(call obj-sec, $(required)) $(obj-boot) $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff +$(obj)/zImage.coff: $(call obj-sec, $(required)) $(obj-boot) \ + $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff $(call cmd,bootld,$(obj-boot),zImage.coff.lds) $(call cmd,gencoff) @@ -162,6 +173,12 @@ $(obj)/zImage.initrd.coff: $(call obj-sec, $(required) $(initrd)) $(obj-boot) \ $(call cmd,bootld,$(obj-boot),zImage.coff.lds) $(call cmd,gencoff) +$(obj)/miboot.image: $(obj)/dummy.o $(obj)/vmlinux.gz + $(call cmd,gen-miboot,image) + +$(obj)/miboot.initrd.image: $(obj)/miboot.image $(images)/ramdisk.image.gz + $(call cmd,gen-miboot,initrd) + #----------------------------------------------------------- # build u-boot images #----------------------------------------------------------- diff --git a/trunk/arch/powerpc/boot/dummy.c b/trunk/arch/powerpc/boot/dummy.c new file mode 100644 index 000000000000..31dbf45bf99c --- /dev/null +++ b/trunk/arch/powerpc/boot/dummy.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} diff --git a/trunk/arch/s390/crypto/aes_s390.c b/trunk/arch/s390/crypto/aes_s390.c index c5ca2dc5d428..7a1033d8e00f 100644 --- a/trunk/arch/s390/crypto/aes_s390.c +++ b/trunk/arch/s390/crypto/aes_s390.c @@ -114,108 +114,80 @@ static unsigned int aes_encrypt_ecb(const struct cipher_desc *desc, u8 *out, const u8 *in, unsigned int nbytes) { struct s390_aes_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(AES_BLOCK_SIZE - 1); switch (sctx->key_len) { case 16: - ret = crypt_s390_km(KM_AES_128_ENCRYPT, &sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_km(KM_AES_128_ENCRYPT, &sctx->key, out, in, nbytes); break; case 24: - ret = crypt_s390_km(KM_AES_192_ENCRYPT, &sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_km(KM_AES_192_ENCRYPT, &sctx->key, out, in, nbytes); break; case 32: - ret = crypt_s390_km(KM_AES_256_ENCRYPT, &sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_km(KM_AES_256_ENCRYPT, &sctx->key, out, in, nbytes); break; } - return nbytes; + return nbytes & ~(AES_BLOCK_SIZE - 1); } static unsigned int aes_decrypt_ecb(const struct cipher_desc *desc, u8 *out, const u8 *in, unsigned int nbytes) { struct s390_aes_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(AES_BLOCK_SIZE - 1); switch (sctx->key_len) { case 16: - ret = crypt_s390_km(KM_AES_128_DECRYPT, &sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_km(KM_AES_128_DECRYPT, &sctx->key, out, in, nbytes); break; case 24: - ret = crypt_s390_km(KM_AES_192_DECRYPT, &sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_km(KM_AES_192_DECRYPT, &sctx->key, out, in, nbytes); break; case 32: - ret = crypt_s390_km(KM_AES_256_DECRYPT, &sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_km(KM_AES_256_DECRYPT, &sctx->key, out, in, nbytes); break; } - return nbytes; + return nbytes & ~(AES_BLOCK_SIZE - 1); } static unsigned int aes_encrypt_cbc(const struct cipher_desc *desc, u8 *out, const u8 *in, unsigned int nbytes) { struct s390_aes_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(AES_BLOCK_SIZE - 1); memcpy(&sctx->iv, desc->info, AES_BLOCK_SIZE); switch (sctx->key_len) { case 16: - ret = crypt_s390_kmc(KMC_AES_128_ENCRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_kmc(KMC_AES_128_ENCRYPT, &sctx->iv, out, in, nbytes); break; case 24: - ret = crypt_s390_kmc(KMC_AES_192_ENCRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_kmc(KMC_AES_192_ENCRYPT, &sctx->iv, out, in, nbytes); break; case 32: - ret = crypt_s390_kmc(KMC_AES_256_ENCRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_kmc(KMC_AES_256_ENCRYPT, &sctx->iv, out, in, nbytes); break; } memcpy(desc->info, &sctx->iv, AES_BLOCK_SIZE); - return nbytes; + return nbytes & ~(AES_BLOCK_SIZE - 1); } static unsigned int aes_decrypt_cbc(const struct cipher_desc *desc, u8 *out, const u8 *in, unsigned int nbytes) { struct s390_aes_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(AES_BLOCK_SIZE - 1); memcpy(&sctx->iv, desc->info, AES_BLOCK_SIZE); switch (sctx->key_len) { case 16: - ret = crypt_s390_kmc(KMC_AES_128_DECRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_kmc(KMC_AES_128_DECRYPT, &sctx->iv, out, in, nbytes); break; case 24: - ret = crypt_s390_kmc(KMC_AES_192_DECRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_kmc(KMC_AES_192_DECRYPT, &sctx->iv, out, in, nbytes); break; case 32: - ret = crypt_s390_kmc(KMC_AES_256_DECRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + crypt_s390_kmc(KMC_AES_256_DECRYPT, &sctx->iv, out, in, nbytes); break; } - return nbytes; + return nbytes & ~(AES_BLOCK_SIZE - 1); } diff --git a/trunk/arch/s390/crypto/des_s390.c b/trunk/arch/s390/crypto/des_s390.c index e3c37aa0a199..a38bb2a3eef6 100644 --- a/trunk/arch/s390/crypto/des_s390.c +++ b/trunk/arch/s390/crypto/des_s390.c @@ -15,8 +15,10 @@ */ #include #include +#include +#include +#include #include - #include "crypt_s390.h" #include "crypto_des.h" @@ -44,92 +46,38 @@ struct crypt_s390_des3_192_ctx { u8 key[DES3_192_KEY_SIZE]; }; -static int des_setkey(void *ctx, const u8 *key, unsigned int keylen, - u32 *flags) +static int +des_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags) { - struct crypt_s390_des_ctx *dctx = ctx; + struct crypt_s390_des_ctx *dctx; int ret; - /* test if key is valid (not a weak key) */ + dctx = ctx; + //test if key is valid (not a weak key) ret = crypto_des_check_key(key, keylen, flags); - if (ret == 0) + if (ret == 0){ memcpy(dctx->key, key, keylen); + } return ret; } -static void des_encrypt(void *ctx, u8 *out, const u8 *in) -{ - struct crypt_s390_des_ctx *dctx = ctx; - - crypt_s390_km(KM_DEA_ENCRYPT, dctx->key, out, in, DES_BLOCK_SIZE); -} - -static void des_decrypt(void *ctx, u8 *out, const u8 *in) -{ - struct crypt_s390_des_ctx *dctx = ctx; - - crypt_s390_km(KM_DEA_DECRYPT, dctx->key, out, in, DES_BLOCK_SIZE); -} - -static unsigned int des_encrypt_ecb(const struct cipher_desc *desc, u8 *out, - const u8 *in, unsigned int nbytes) -{ - struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES_BLOCK_SIZE - 1); - ret = crypt_s390_km(KM_DEA_ENCRYPT, sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - return nbytes; -} -static unsigned int des_decrypt_ecb(const struct cipher_desc *desc, u8 *out, - const u8 *in, unsigned int nbytes) +static void +des_encrypt(void *ctx, u8 *dst, const u8 *src) { - struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES_BLOCK_SIZE - 1); - ret = crypt_s390_km(KM_DEA_DECRYPT, sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); + struct crypt_s390_des_ctx *dctx; - return nbytes; + dctx = ctx; + crypt_s390_km(KM_DEA_ENCRYPT, dctx->key, dst, src, DES_BLOCK_SIZE); } -static unsigned int des_encrypt_cbc(const struct cipher_desc *desc, u8 *out, - const u8 *in, unsigned int nbytes) +static void +des_decrypt(void *ctx, u8 *dst, const u8 *src) { - struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; + struct crypt_s390_des_ctx *dctx; - /* only use complete blocks */ - nbytes &= ~(DES_BLOCK_SIZE - 1); - - memcpy(sctx->iv, desc->info, DES_BLOCK_SIZE); - ret = crypt_s390_kmc(KMC_DEA_ENCRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - memcpy(desc->info, sctx->iv, DES_BLOCK_SIZE); - return nbytes; -} - -static unsigned int des_decrypt_cbc(const struct cipher_desc *desc, u8 *out, - const u8 *in, unsigned int nbytes) -{ - struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES_BLOCK_SIZE - 1); - - memcpy(&sctx->iv, desc->info, DES_BLOCK_SIZE); - ret = crypt_s390_kmc(KMC_DEA_DECRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - return nbytes; + dctx = ctx; + crypt_s390_km(KM_DEA_DECRYPT, dctx->key, dst, src, DES_BLOCK_SIZE); } static struct crypto_alg des_alg = { @@ -139,19 +87,12 @@ static struct crypto_alg des_alg = { .cra_ctxsize = sizeof(struct crypt_s390_des_ctx), .cra_module = THIS_MODULE, .cra_list = LIST_HEAD_INIT(des_alg.cra_list), - .cra_u = { - .cipher = { - .cia_min_keysize = DES_KEY_SIZE, - .cia_max_keysize = DES_KEY_SIZE, - .cia_setkey = des_setkey, - .cia_encrypt = des_encrypt, - .cia_decrypt = des_decrypt, - .cia_encrypt_ecb = des_encrypt_ecb, - .cia_decrypt_ecb = des_decrypt_ecb, - .cia_encrypt_cbc = des_encrypt_cbc, - .cia_decrypt_cbc = des_decrypt_cbc, - } - } + .cra_u = { .cipher = { + .cia_min_keysize = DES_KEY_SIZE, + .cia_max_keysize = DES_KEY_SIZE, + .cia_setkey = des_setkey, + .cia_encrypt = des_encrypt, + .cia_decrypt = des_decrypt } } }; /* @@ -166,18 +107,20 @@ static struct crypto_alg des_alg = { * Implementers MUST reject keys that exhibit this property. * */ -static int des3_128_setkey(void *ctx, const u8 *key, unsigned int keylen, - u32 *flags) +static int +des3_128_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags) { int i, ret; - struct crypt_s390_des3_128_ctx *dctx = ctx; + struct crypt_s390_des3_128_ctx *dctx; const u8* temp_key = key; + dctx = ctx; if (!(memcmp(key, &key[DES_KEY_SIZE], DES_KEY_SIZE))) { + *flags |= CRYPTO_TFM_RES_BAD_KEY_SCHED; return -EINVAL; } - for (i = 0; i < 2; i++, temp_key += DES_KEY_SIZE) { + for (i = 0; i < 2; i++, temp_key += DES_KEY_SIZE) { ret = crypto_des_check_key(temp_key, DES_KEY_SIZE, flags); if (ret < 0) return ret; @@ -186,85 +129,24 @@ static int des3_128_setkey(void *ctx, const u8 *key, unsigned int keylen, return 0; } -static void des3_128_encrypt(void *ctx, u8 *dst, const u8 *src) +static void +des3_128_encrypt(void *ctx, u8 *dst, const u8 *src) { - struct crypt_s390_des3_128_ctx *dctx = ctx; + struct crypt_s390_des3_128_ctx *dctx; + dctx = ctx; crypt_s390_km(KM_TDEA_128_ENCRYPT, dctx->key, dst, (void*)src, - DES3_128_BLOCK_SIZE); + DES3_128_BLOCK_SIZE); } -static void des3_128_decrypt(void *ctx, u8 *dst, const u8 *src) +static void +des3_128_decrypt(void *ctx, u8 *dst, const u8 *src) { - struct crypt_s390_des3_128_ctx *dctx = ctx; + struct crypt_s390_des3_128_ctx *dctx; + dctx = ctx; crypt_s390_km(KM_TDEA_128_DECRYPT, dctx->key, dst, (void*)src, - DES3_128_BLOCK_SIZE); -} - -static unsigned int des3_128_encrypt_ecb(const struct cipher_desc *desc, - u8 *out, const u8 *in, - unsigned int nbytes) -{ - struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES3_128_BLOCK_SIZE - 1); - ret = crypt_s390_km(KM_TDEA_128_ENCRYPT, sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - return nbytes; -} - -static unsigned int des3_128_decrypt_ecb(const struct cipher_desc *desc, - u8 *out, const u8 *in, - unsigned int nbytes) -{ - struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES3_128_BLOCK_SIZE - 1); - ret = crypt_s390_km(KM_TDEA_128_DECRYPT, sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - return nbytes; -} - -static unsigned int des3_128_encrypt_cbc(const struct cipher_desc *desc, - u8 *out, const u8 *in, - unsigned int nbytes) -{ - struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES3_128_BLOCK_SIZE - 1); - - memcpy(sctx->iv, desc->info, DES3_128_BLOCK_SIZE); - ret = crypt_s390_kmc(KMC_TDEA_128_ENCRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - memcpy(desc->info, sctx->iv, DES3_128_BLOCK_SIZE); - return nbytes; -} - -static unsigned int des3_128_decrypt_cbc(const struct cipher_desc *desc, - u8 *out, const u8 *in, - unsigned int nbytes) -{ - struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES3_128_BLOCK_SIZE - 1); - - memcpy(&sctx->iv, desc->info, DES3_128_BLOCK_SIZE); - ret = crypt_s390_kmc(KMC_TDEA_128_DECRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - return nbytes; + DES3_128_BLOCK_SIZE); } static struct crypto_alg des3_128_alg = { @@ -274,19 +156,12 @@ static struct crypto_alg des3_128_alg = { .cra_ctxsize = sizeof(struct crypt_s390_des3_128_ctx), .cra_module = THIS_MODULE, .cra_list = LIST_HEAD_INIT(des3_128_alg.cra_list), - .cra_u = { - .cipher = { - .cia_min_keysize = DES3_128_KEY_SIZE, - .cia_max_keysize = DES3_128_KEY_SIZE, - .cia_setkey = des3_128_setkey, - .cia_encrypt = des3_128_encrypt, - .cia_decrypt = des3_128_decrypt, - .cia_encrypt_ecb = des3_128_encrypt_ecb, - .cia_decrypt_ecb = des3_128_decrypt_ecb, - .cia_encrypt_cbc = des3_128_encrypt_cbc, - .cia_decrypt_cbc = des3_128_decrypt_cbc, - } - } + .cra_u = { .cipher = { + .cia_min_keysize = DES3_128_KEY_SIZE, + .cia_max_keysize = DES3_128_KEY_SIZE, + .cia_setkey = des3_128_setkey, + .cia_encrypt = des3_128_encrypt, + .cia_decrypt = des3_128_decrypt } } }; /* @@ -302,108 +177,50 @@ static struct crypto_alg des3_128_alg = { * property. * */ -static int des3_192_setkey(void *ctx, const u8 *key, unsigned int keylen, - u32 *flags) +static int +des3_192_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags) { int i, ret; - struct crypt_s390_des3_192_ctx *dctx = ctx; - const u8* temp_key = key; + struct crypt_s390_des3_192_ctx *dctx; + const u8* temp_key; + dctx = ctx; + temp_key = key; if (!(memcmp(key, &key[DES_KEY_SIZE], DES_KEY_SIZE) && memcmp(&key[DES_KEY_SIZE], &key[DES_KEY_SIZE * 2], - DES_KEY_SIZE))) { + DES_KEY_SIZE))) { *flags |= CRYPTO_TFM_RES_BAD_KEY_SCHED; return -EINVAL; } for (i = 0; i < 3; i++, temp_key += DES_KEY_SIZE) { ret = crypto_des_check_key(temp_key, DES_KEY_SIZE, flags); - if (ret < 0) + if (ret < 0){ return ret; + } } memcpy(dctx->key, key, keylen); return 0; } -static void des3_192_encrypt(void *ctx, u8 *dst, const u8 *src) +static void +des3_192_encrypt(void *ctx, u8 *dst, const u8 *src) { - struct crypt_s390_des3_192_ctx *dctx = ctx; + struct crypt_s390_des3_192_ctx *dctx; + dctx = ctx; crypt_s390_km(KM_TDEA_192_ENCRYPT, dctx->key, dst, (void*)src, - DES3_192_BLOCK_SIZE); + DES3_192_BLOCK_SIZE); } -static void des3_192_decrypt(void *ctx, u8 *dst, const u8 *src) +static void +des3_192_decrypt(void *ctx, u8 *dst, const u8 *src) { - struct crypt_s390_des3_192_ctx *dctx = ctx; + struct crypt_s390_des3_192_ctx *dctx; + dctx = ctx; crypt_s390_km(KM_TDEA_192_DECRYPT, dctx->key, dst, (void*)src, - DES3_192_BLOCK_SIZE); -} - -static unsigned int des3_192_encrypt_ecb(const struct cipher_desc *desc, - u8 *out, const u8 *in, - unsigned int nbytes) -{ - struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES3_192_BLOCK_SIZE - 1); - ret = crypt_s390_km(KM_TDEA_192_ENCRYPT, sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - return nbytes; -} - -static unsigned int des3_192_decrypt_ecb(const struct cipher_desc *desc, - u8 *out, const u8 *in, - unsigned int nbytes) -{ - struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES3_192_BLOCK_SIZE - 1); - ret = crypt_s390_km(KM_TDEA_192_DECRYPT, sctx->key, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - return nbytes; -} - -static unsigned int des3_192_encrypt_cbc(const struct cipher_desc *desc, - u8 *out, const u8 *in, - unsigned int nbytes) -{ - struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES3_192_BLOCK_SIZE - 1); - - memcpy(sctx->iv, desc->info, DES3_192_BLOCK_SIZE); - ret = crypt_s390_kmc(KMC_TDEA_192_ENCRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - memcpy(desc->info, sctx->iv, DES3_192_BLOCK_SIZE); - return nbytes; -} - -static unsigned int des3_192_decrypt_cbc(const struct cipher_desc *desc, - u8 *out, const u8 *in, - unsigned int nbytes) -{ - struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm); - int ret; - - /* only use complete blocks */ - nbytes &= ~(DES3_192_BLOCK_SIZE - 1); - - memcpy(&sctx->iv, desc->info, DES3_192_BLOCK_SIZE); - ret = crypt_s390_kmc(KMC_TDEA_192_DECRYPT, &sctx->iv, out, in, nbytes); - BUG_ON((ret < 0) || (ret != nbytes)); - - return nbytes; + DES3_192_BLOCK_SIZE); } static struct crypto_alg des3_192_alg = { @@ -413,43 +230,44 @@ static struct crypto_alg des3_192_alg = { .cra_ctxsize = sizeof(struct crypt_s390_des3_192_ctx), .cra_module = THIS_MODULE, .cra_list = LIST_HEAD_INIT(des3_192_alg.cra_list), - .cra_u = { - .cipher = { - .cia_min_keysize = DES3_192_KEY_SIZE, - .cia_max_keysize = DES3_192_KEY_SIZE, - .cia_setkey = des3_192_setkey, - .cia_encrypt = des3_192_encrypt, - .cia_decrypt = des3_192_decrypt, - .cia_encrypt_ecb = des3_192_encrypt_ecb, - .cia_decrypt_ecb = des3_192_decrypt_ecb, - .cia_encrypt_cbc = des3_192_encrypt_cbc, - .cia_decrypt_cbc = des3_192_decrypt_cbc, - } - } + .cra_u = { .cipher = { + .cia_min_keysize = DES3_192_KEY_SIZE, + .cia_max_keysize = DES3_192_KEY_SIZE, + .cia_setkey = des3_192_setkey, + .cia_encrypt = des3_192_encrypt, + .cia_decrypt = des3_192_decrypt } } }; -static int init(void) + + +static int +init(void) { - int ret = 0; + int ret; if (!crypt_s390_func_available(KM_DEA_ENCRYPT) || !crypt_s390_func_available(KM_TDEA_128_ENCRYPT) || - !crypt_s390_func_available(KM_TDEA_192_ENCRYPT)) + !crypt_s390_func_available(KM_TDEA_192_ENCRYPT)){ return -ENOSYS; + } - ret |= (crypto_register_alg(&des_alg) == 0) ? 0:1; - ret |= (crypto_register_alg(&des3_128_alg) == 0) ? 0:2; - ret |= (crypto_register_alg(&des3_192_alg) == 0) ? 0:4; - if (ret) { + ret = 0; + ret |= (crypto_register_alg(&des_alg) == 0)? 0:1; + ret |= (crypto_register_alg(&des3_128_alg) == 0)? 0:2; + ret |= (crypto_register_alg(&des3_192_alg) == 0)? 0:4; + if (ret){ crypto_unregister_alg(&des3_192_alg); crypto_unregister_alg(&des3_128_alg); crypto_unregister_alg(&des_alg); return -EEXIST; } + + printk(KERN_INFO "crypt_s390: des_s390 loaded.\n"); return 0; } -static void __exit fini(void) +static void __exit +fini(void) { crypto_unregister_alg(&des3_192_alg); crypto_unregister_alg(&des3_128_alg); diff --git a/trunk/arch/s390/crypto/sha256_s390.c b/trunk/arch/s390/crypto/sha256_s390.c index 1ec5e92b3454..b75bdbd476c7 100644 --- a/trunk/arch/s390/crypto/sha256_s390.c +++ b/trunk/arch/s390/crypto/sha256_s390.c @@ -51,7 +51,6 @@ static void sha256_update(void *ctx, const u8 *data, unsigned int len) { struct s390_sha256_ctx *sctx = ctx; unsigned int index; - int ret; /* how much is already in the buffer? */ index = sctx->count / 8 & 0x3f; @@ -59,29 +58,15 @@ static void sha256_update(void *ctx, const u8 *data, unsigned int len) /* update message bit length */ sctx->count += len * 8; - if ((index + len) < SHA256_BLOCK_SIZE) - goto store; - - /* process one stored block */ - if (index) { + /* process one block */ + if ((index + len) >= SHA256_BLOCK_SIZE) { memcpy(sctx->buf + index, data, SHA256_BLOCK_SIZE - index); - ret = crypt_s390_kimd(KIMD_SHA_256, sctx->state, sctx->buf, - SHA256_BLOCK_SIZE); - BUG_ON(ret != SHA256_BLOCK_SIZE); + crypt_s390_kimd(KIMD_SHA_256, sctx->state, sctx->buf, + SHA256_BLOCK_SIZE); data += SHA256_BLOCK_SIZE - index; len -= SHA256_BLOCK_SIZE - index; } - /* process as many blocks as possible */ - if (len >= SHA256_BLOCK_SIZE) { - ret = crypt_s390_kimd(KIMD_SHA_256, sctx->state, data, - len & ~(SHA256_BLOCK_SIZE - 1)); - BUG_ON(ret != (len & ~(SHA256_BLOCK_SIZE - 1))); - data += ret; - len -= ret; - } - -store: /* anything left? */ if (len) memcpy(sctx->buf + index , data, len); @@ -134,9 +119,9 @@ static struct crypto_alg alg = { .cra_list = LIST_HEAD_INIT(alg.cra_list), .cra_u = { .digest = { .dia_digestsize = SHA256_DIGEST_SIZE, - .dia_init = sha256_init, - .dia_update = sha256_update, - .dia_final = sha256_final } } + .dia_init = sha256_init, + .dia_update = sha256_update, + .dia_final = sha256_final } } }; static int init(void) diff --git a/trunk/arch/s390/kernel/process.c b/trunk/arch/s390/kernel/process.c index 008c74526fd3..2ff90a1a1056 100644 --- a/trunk/arch/s390/kernel/process.c +++ b/trunk/arch/s390/kernel/process.c @@ -58,18 +58,10 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); */ unsigned long thread_saved_pc(struct task_struct *tsk) { - struct stack_frame *sf, *low, *high; + struct stack_frame *sf; - if (!tsk || !task_stack_page(tsk)) - return 0; - low = task_stack_page(tsk); - high = (struct stack_frame *) task_pt_regs(tsk); - sf = (struct stack_frame *) (tsk->thread.ksp & PSW_ADDR_INSN); - if (sf <= low || sf > high) - return 0; - sf = (struct stack_frame *) (sf->back_chain & PSW_ADDR_INSN); - if (sf <= low || sf > high) - return 0; + sf = (struct stack_frame *) tsk->thread.ksp; + sf = (struct stack_frame *) sf->back_chain; return sf->gprs[8]; } diff --git a/trunk/arch/s390/kernel/setup.c b/trunk/arch/s390/kernel/setup.c index de8784267473..b03847d100d9 100644 --- a/trunk/arch/s390/kernel/setup.c +++ b/trunk/arch/s390/kernel/setup.c @@ -268,7 +268,7 @@ static void do_machine_restart_nonsmp(char * __unused) reipl_diag(); if (MACHINE_IS_VM) - cpcmd ("IPL", NULL, 0, NULL); + cpcmd ("IPL", NULL, 0); else reipl (0x10000 | S390_lowcore.ipl_device); } @@ -276,14 +276,14 @@ static void do_machine_restart_nonsmp(char * __unused) static void do_machine_halt_nonsmp(void) { if (MACHINE_IS_VM && strlen(vmhalt_cmd) > 0) - cpcmd(vmhalt_cmd, NULL, 0, NULL); + cpcmd(vmhalt_cmd, NULL, 0); signal_processor(smp_processor_id(), sigp_stop_and_store_status); } static void do_machine_power_off_nonsmp(void) { if (MACHINE_IS_VM && strlen(vmpoff_cmd) > 0) - cpcmd(vmpoff_cmd, NULL, 0, NULL); + cpcmd(vmpoff_cmd, NULL, 0); signal_processor(smp_processor_id(), sigp_stop_and_store_status); } @@ -315,11 +315,6 @@ void machine_power_off(void) _machine_power_off(); } -/* - * Dummy power off function. - */ -void (*pm_power_off)(void) = machine_power_off; - static void __init add_memory_hole(unsigned long start, unsigned long end) { diff --git a/trunk/arch/s390/kernel/time.c b/trunk/arch/s390/kernel/time.c index 7c0fe152a111..b0d8ca8e5eeb 100644 --- a/trunk/arch/s390/kernel/time.c +++ b/trunk/arch/s390/kernel/time.c @@ -214,7 +214,7 @@ void account_ticks(struct pt_regs *regs) #endif #ifdef CONFIG_VIRT_CPU_ACCOUNTING - account_tick_vtime(current); + account_user_vtime(current); #else while (ticks--) update_process_times(user_mode(regs)); diff --git a/trunk/arch/s390/kernel/vtime.c b/trunk/arch/s390/kernel/vtime.c index dfe6f0856617..22a895ecb7a4 100644 --- a/trunk/arch/s390/kernel/vtime.c +++ b/trunk/arch/s390/kernel/vtime.c @@ -32,7 +32,7 @@ DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); * Update process times based on virtual cpu times stored by entry.S * to the lowcore fields user_timer, system_timer & steal_clock. */ -void account_tick_vtime(struct task_struct *tsk) +void account_user_vtime(struct task_struct *tsk) { cputime_t cputime; __u64 timer, clock; @@ -72,31 +72,6 @@ void account_tick_vtime(struct task_struct *tsk) run_posix_cpu_timers(tsk); } -/* - * Update process times based on virtual cpu times stored by entry.S - * to the lowcore fields user_timer, system_timer & steal_clock. - */ -void account_vtime(struct task_struct *tsk) -{ - cputime_t cputime; - __u64 timer; - - timer = S390_lowcore.last_update_timer; - asm volatile (" STPT %0" /* Store current cpu timer value */ - : "=m" (S390_lowcore.last_update_timer) ); - S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer; - - cputime = S390_lowcore.user_timer >> 12; - S390_lowcore.user_timer -= cputime << 12; - S390_lowcore.steal_clock -= cputime << 12; - account_user_time(tsk, cputime); - - cputime = S390_lowcore.system_timer >> 12; - S390_lowcore.system_timer -= cputime << 12; - S390_lowcore.steal_clock -= cputime << 12; - account_system_time(tsk, 0, cputime); -} - /* * Update process times based on virtual cpu times stored by entry.S * to the lowcore fields user_timer, system_timer & steal_clock. diff --git a/trunk/arch/s390/lib/Makefile b/trunk/arch/s390/lib/Makefile index f20b51ff1d86..d9b97b3c597f 100644 --- a/trunk/arch/s390/lib/Makefile +++ b/trunk/arch/s390/lib/Makefile @@ -4,6 +4,5 @@ EXTRA_AFLAGS := -traditional -lib-y += delay.o string.o +lib-y += delay.o string.o spinlock.o lib-y += $(if $(CONFIG_64BIT),uaccess64.o,uaccess.o) -lib-$(CONFIG_SMP) += spinlock.o \ No newline at end of file diff --git a/trunk/arch/s390/lib/spinlock.c b/trunk/arch/s390/lib/spinlock.c index 60f80a4eed4e..68d79c502081 100644 --- a/trunk/arch/s390/lib/spinlock.c +++ b/trunk/arch/s390/lib/spinlock.c @@ -13,6 +13,7 @@ #include #include +atomic_t spin_retry_counter; int spin_retry = 1000; /** @@ -44,6 +45,7 @@ _raw_spin_lock_wait(raw_spinlock_t *lp, unsigned int pc) _diag44(); count = spin_retry; } + atomic_inc(&spin_retry_counter); if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0) return; } @@ -56,6 +58,7 @@ _raw_spin_trylock_retry(raw_spinlock_t *lp, unsigned int pc) int count = spin_retry; while (count-- > 0) { + atomic_inc(&spin_retry_counter); if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0) return 1; } @@ -74,6 +77,7 @@ _raw_read_lock_wait(raw_rwlock_t *rw) _diag44(); count = spin_retry; } + atomic_inc(&spin_retry_counter); old = rw->lock & 0x7fffffffU; if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) return; @@ -88,6 +92,7 @@ _raw_read_trylock_retry(raw_rwlock_t *rw) int count = spin_retry; while (count-- > 0) { + atomic_inc(&spin_retry_counter); old = rw->lock & 0x7fffffffU; if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) return 1; @@ -106,6 +111,7 @@ _raw_write_lock_wait(raw_rwlock_t *rw) _diag44(); count = spin_retry; } + atomic_inc(&spin_retry_counter); if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) return; } @@ -118,6 +124,7 @@ _raw_write_trylock_retry(raw_rwlock_t *rw) int count = spin_retry; while (count-- > 0) { + atomic_inc(&spin_retry_counter); if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) return 1; } diff --git a/trunk/arch/um/Makefile b/trunk/arch/um/Makefile index 45435ff589c1..322972fd064e 100644 --- a/trunk/arch/um/Makefile +++ b/trunk/arch/um/Makefile @@ -67,8 +67,7 @@ USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ # in CFLAGS. Otherwise, it would cause ld to complain about the two different # errnos. -CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ - -Dmktime=kernel_mktime +CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask CFLAGS += $(call cc-option,-fno-unit-at-a-time,) include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) diff --git a/trunk/block/genhd.c b/trunk/block/genhd.c index db57546a709d..f1ed83f3f083 100644 --- a/trunk/block/genhd.c +++ b/trunk/block/genhd.c @@ -38,100 +38,34 @@ static inline int major_to_index(int major) return major % MAX_PROBE_HASH; } -struct blkdev_info { - int index; - struct blk_major_name *bd; -}; - -/* - * iterate over a list of blkdev_info structures. allows - * the major_names array to be iterated over from outside this file - * must be called with the block_subsys_sem held - */ -void *get_next_blkdev(void *dev) -{ - struct blkdev_info *info; - - if (dev == NULL) { - info = kmalloc(sizeof(*info), GFP_KERNEL); - if (!info) - goto out; - info->index=0; - info->bd = major_names[info->index]; - if (info->bd) - goto out; - } else { - info = dev; - } - - while (info->index < ARRAY_SIZE(major_names)) { - if (info->bd) - info->bd = info->bd->next; - if (info->bd) - goto out; - /* - * No devices on this chain, move to the next - */ - info->index++; - info->bd = (info->index < ARRAY_SIZE(major_names)) ? - major_names[info->index] : NULL; - if (info->bd) - goto out; - } - -out: - return info; -} - -void *acquire_blkdev_list(void) -{ - down(&block_subsys_sem); - return get_next_blkdev(NULL); -} - -void release_blkdev_list(void *dev) -{ - up(&block_subsys_sem); - kfree(dev); -} - - -/* - * Count the number of records in the blkdev_list. - * must be called with the block_subsys_sem held - */ -int count_blkdev_list(void) +#ifdef CONFIG_PROC_FS +/* get block device names in somewhat random order */ +int get_blkdev_list(char *p, int used) { struct blk_major_name *n; - int i, count; + int i, len; - count = 0; + len = snprintf(p, (PAGE_SIZE-used), "\nBlock devices:\n"); + down(&block_subsys_sem); for (i = 0; i < ARRAY_SIZE(major_names); i++) { - for (n = major_names[i]; n; n = n->next) - count++; + for (n = major_names[i]; n; n = n->next) { + /* + * If the curent string plus the 5 extra characters + * in the line would run us off the page, then we're done + */ + if ((len + used + strlen(n->name) + 5) >= PAGE_SIZE) + goto page_full; + len += sprintf(p+len, "%3d %s\n", + n->major, n->name); + } } +page_full: + up(&block_subsys_sem); - return count; -} - -/* - * extract the major and name values from a blkdev_info struct - * passed in as a void to *dev. Must be called with - * block_subsys_sem held - */ -int get_blkdev_info(void *dev, int *major, char **name) -{ - struct blkdev_info *info = dev; - - if (info->bd == NULL) - return 1; - - *major = info->bd->major; - *name = info->bd->name; - return 0; + return len; } - +#endif int register_blkdev(unsigned int major, const char *name) { diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index 3758b558d2b5..7e1a445955bc 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -153,7 +153,7 @@ static int acpi_ec_polling_mode = EC_POLLING; Transaction Management -------------------------------------------------------------------------- */ -static u32 acpi_ec_read_status(union acpi_ec *ec) +static inline u32 acpi_ec_read_status(union acpi_ec *ec) { u32 status = 0; diff --git a/trunk/drivers/base/firmware_class.c b/trunk/drivers/base/firmware_class.c index e97e911ebf7a..3d384e3d34de 100644 --- a/trunk/drivers/base/firmware_class.c +++ b/trunk/drivers/base/firmware_class.c @@ -48,7 +48,7 @@ struct firmware_priv { struct timer_list timeout; }; -static void +static inline void fw_load_abort(struct firmware_priv *fw_priv) { set_bit(FW_STATUS_ABORT, &fw_priv->status); diff --git a/trunk/drivers/block/loop.c b/trunk/drivers/block/loop.c index 5f6d1a5cce11..864729046e22 100644 --- a/trunk/drivers/block/loop.c +++ b/trunk/drivers/block/loop.c @@ -294,7 +294,7 @@ static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec, * This helper just factors out common code between do_lo_send_direct_write() * and do_lo_send_write(). */ -static int __do_lo_send_write(struct file *file, +static inline int __do_lo_send_write(struct file *file, u8 __user *buf, const int len, loff_t pos) { ssize_t bw; diff --git a/trunk/drivers/block/pktcdvd.c b/trunk/drivers/block/pktcdvd.c index 93affeeef7bd..51b7a5c5b77a 100644 --- a/trunk/drivers/block/pktcdvd.c +++ b/trunk/drivers/block/pktcdvd.c @@ -247,7 +247,7 @@ static inline struct pkt_rb_node *pkt_rbtree_next(struct pkt_rb_node *node) return rb_entry(n, struct pkt_rb_node, rb_node); } -static void pkt_rbtree_erase(struct pktcdvd_device *pd, struct pkt_rb_node *node) +static inline void pkt_rbtree_erase(struct pktcdvd_device *pd, struct pkt_rb_node *node) { rb_erase(&node->rb_node, &pd->bio_queue); mempool_free(node, pd->rb_pool); @@ -315,7 +315,7 @@ static void pkt_rbtree_insert(struct pktcdvd_device *pd, struct pkt_rb_node *nod /* * Add a bio to a single linked list defined by its head and tail pointers. */ -static void pkt_add_list_last(struct bio *bio, struct bio **list_head, struct bio **list_tail) +static inline void pkt_add_list_last(struct bio *bio, struct bio **list_head, struct bio **list_tail) { bio->bi_next = NULL; if (*list_tail) { diff --git a/trunk/drivers/bluetooth/hci_bcsp.c b/trunk/drivers/bluetooth/hci_bcsp.c index 7bd4ef904115..8fddfdfd0fbd 100644 --- a/trunk/drivers/bluetooth/hci_bcsp.c +++ b/trunk/drivers/bluetooth/hci_bcsp.c @@ -494,7 +494,7 @@ static inline void bcsp_unslip_one_byte(struct bcsp_struct *bcsp, unsigned char } } -static void bcsp_complete_rx_pkt(struct hci_uart *hu) +static inline void bcsp_complete_rx_pkt(struct hci_uart *hu) { struct bcsp_struct *bcsp = hu->priv; int pass_up; diff --git a/trunk/drivers/char/drm/r128_state.c b/trunk/drivers/char/drm/r128_state.c index a080cdd6081e..caeecc2c36da 100644 --- a/trunk/drivers/char/drm/r128_state.c +++ b/trunk/drivers/char/drm/r128_state.c @@ -220,7 +220,7 @@ static __inline__ void r128_emit_tex1(drm_r128_private_t * dev_priv) ADVANCE_RING(); } -static void r128_emit_state(drm_r128_private_t * dev_priv) +static __inline__ void r128_emit_state(drm_r128_private_t * dev_priv) { drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; unsigned int dirty = sarea_priv->dirty; diff --git a/trunk/drivers/char/watchdog/Kconfig b/trunk/drivers/char/watchdog/Kconfig index c0dfcf273f0a..a6544790af60 100644 --- a/trunk/drivers/char/watchdog/Kconfig +++ b/trunk/drivers/char/watchdog/Kconfig @@ -395,38 +395,12 @@ config MACHZ_WDT To compile this driver as a module, choose M here: the module will be called machzwd. -config SBC_EPX_C3_WATCHDOG - tristate "Winsystems SBC EPX-C3 watchdog" - depends on WATCHDOG && X86 - ---help--- - This is the driver for the built-in watchdog timer on the EPX-C3 - Single-board computer made by Winsystems, Inc. - - *Note*: This hardware watchdog is not probeable and thus there - is no way to know if writing to its IO address will corrupt - your system or have any real effect. The only way to be sure - that this driver does what you want is to make sure you - are runnning it on an EPX-C3 from Winsystems with the watchdog - timer at IO address 0x1ee and 0x1ef. It will write to both those - IO ports. Basically, the assumption is made that if you compile - this driver into your kernel and/or load it as a module, that you - know what you are doing and that you are in fact running on an - EPX-C3 board! - - To compile this driver as a module, choose M here: the - module will be called sbc_epx_c3. - - # PowerPC Architecture config 8xx_WDT tristate "MPC8xx Watchdog Timer" depends on WATCHDOG && 8xx -config 83xx_WDT - tristate "MPC83xx Watchdog Timer" - depends on WATCHDOG && PPC_83xx - config MV64X60_WDT tristate "MV64X60 (Marvell Discovery) Watchdog Timer" depends on WATCHDOG && MV64X60 diff --git a/trunk/drivers/char/watchdog/Makefile b/trunk/drivers/char/watchdog/Makefile index 36c0b282b8ba..cfd0a3987710 100644 --- a/trunk/drivers/char/watchdog/Makefile +++ b/trunk/drivers/char/watchdog/Makefile @@ -52,11 +52,9 @@ obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o obj-$(CONFIG_W83977F_WDT) += w83977f_wdt.o obj-$(CONFIG_MACHZ_WDT) += machzwd.o -obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o # PowerPC Architecture obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o -obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o diff --git a/trunk/drivers/char/watchdog/mpc83xx_wdt.c b/trunk/drivers/char/watchdog/mpc83xx_wdt.c deleted file mode 100644 index 5d6f5061603a..000000000000 --- a/trunk/drivers/char/watchdog/mpc83xx_wdt.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - * mpc83xx_wdt.c - MPC83xx watchdog userspace interface - * - * Authors: Dave Updegraff - * Kumar Gala - * Attribution: from 83xx_wst: Florian Schirmer - * ..and from sc520_wdt - * - * Note: it appears that you can only actually ENABLE or DISABLE the thing - * once after POR. Once enabled, you cannot disable, and vice versa. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct mpc83xx_wdt { - __be32 res0; - __be32 swcrr; /* System watchdog control register */ -#define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */ -#define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */ -#define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit.*/ -#define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */ - __be32 swcnr; /* System watchdog count register */ - u8 res1[2]; - __be16 swsrr; /* System watchdog service register */ - u8 res2[0xF0]; -}; - -static struct mpc83xx_wdt __iomem *wd_base; - -static u16 timeout = 0xffff; -module_param(timeout, ushort, 0); -MODULE_PARM_DESC(timeout, "Watchdog timeout in ticks. (0swsrr, 0x556c); - out_be16(&wd_base->swsrr, 0xaa39); - spin_unlock(&wdt_spinlock); -} - -static ssize_t mpc83xx_wdt_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - if (count) - mpc83xx_wdt_keepalive(); - return count; -} - -static int mpc83xx_wdt_open(struct inode *inode, struct file *file) -{ - u32 tmp = SWCRR_SWEN; - if (test_and_set_bit(0, &wdt_is_open)) - return -EBUSY; - - /* Once we start the watchdog we can't stop it */ - __module_get(THIS_MODULE); - - /* Good, fire up the show */ - if (prescale) - tmp |= SWCRR_SWPR; - if (reset) - tmp |= SWCRR_SWRI; - - tmp |= timeout << 16; - - out_be32(&wd_base->swcrr, tmp); - - return nonseekable_open(inode, file); -} - -static int mpc83xx_wdt_release(struct inode *inode, struct file *file) -{ - printk(KERN_CRIT "Unexpected close, not stopping watchdog!\n"); - mpc83xx_wdt_keepalive(); - clear_bit(0, &wdt_is_open); - return 0; -} - -static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - void __user *argp = (void __user *)arg; - int __user *p = argp; - static struct watchdog_info ident = { - .options = WDIOF_KEEPALIVEPING, - .firmware_version = 1, - .identity = "MPC83xx", - }; - - switch (cmd) { - case WDIOC_GETSUPPORT: - return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; - case WDIOC_KEEPALIVE: - mpc83xx_wdt_keepalive(); - return 0; - case WDIOC_GETTIMEOUT: - return put_user(timeout_sec, p); - default: - return -ENOIOCTLCMD; - } -} - -static struct file_operations mpc83xx_wdt_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .write = mpc83xx_wdt_write, - .ioctl = mpc83xx_wdt_ioctl, - .open = mpc83xx_wdt_open, - .release = mpc83xx_wdt_release, -}; - -static struct miscdevice mpc83xx_wdt_miscdev = { - .minor = WATCHDOG_MINOR, - .name = "watchdog", - .fops = &mpc83xx_wdt_fops, -}; - -static int __devinit mpc83xx_wdt_probe(struct platform_device *dev) -{ - struct resource *r; - int ret; - unsigned int *freq = dev->dev.platform_data; - - /* get a pointer to the register memory */ - r = platform_get_resource(dev, IORESOURCE_MEM, 0); - - if (!r) { - ret = -ENODEV; - goto err_out; - } - - wd_base = ioremap(r->start, sizeof (struct mpc83xx_wdt)); - - if (wd_base == NULL) { - ret = -ENOMEM; - goto err_out; - } - - ret = misc_register(&mpc83xx_wdt_miscdev); - if (ret) { - printk(KERN_ERR "cannot register miscdev on minor=%d " - "(err=%d)\n", - WATCHDOG_MINOR, ret); - goto err_unmap; - } - - /* Calculate the timeout in seconds */ - if (prescale) - timeout_sec = (timeout * 0x10000) / (*freq); - else - timeout_sec = timeout / (*freq); - - printk(KERN_INFO "WDT driver for MPC83xx initialized. " - "mode:%s timeout=%d (%d seconds)\n", - reset ? "reset":"interrupt", timeout, timeout_sec); - - spin_lock_init(&wdt_spinlock); - - return 0; - -err_unmap: - iounmap(wd_base); -err_out: - return ret; -} - -static int __devexit mpc83xx_wdt_remove(struct platform_device *dev) -{ - misc_deregister(&mpc83xx_wdt_miscdev); - iounmap(wd_base); - - return 0; -} - -static struct platform_driver mpc83xx_wdt_driver = { - .probe = mpc83xx_wdt_probe, - .remove = __devexit_p(mpc83xx_wdt_remove), - .driver = { - .name = "mpc83xx_wdt", - }, -}; - -static int __init mpc83xx_wdt_init(void) -{ - return platform_driver_register(&mpc83xx_wdt_driver); -} - -static void __exit mpc83xx_wdt_exit(void) -{ - platform_driver_unregister(&mpc83xx_wdt_driver); -} - -module_init(mpc83xx_wdt_init); -module_exit(mpc83xx_wdt_exit); - -MODULE_AUTHOR("Dave Updegraff, Kumar Gala"); -MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx uProcessor"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); diff --git a/trunk/drivers/char/watchdog/sbc_epx_c3.c b/trunk/drivers/char/watchdog/sbc_epx_c3.c deleted file mode 100644 index 951764614ebf..000000000000 --- a/trunk/drivers/char/watchdog/sbc_epx_c3.c +++ /dev/null @@ -1,216 +0,0 @@ -/* - * SBC EPX C3 0.1 A Hardware Watchdog Device for the Winsystems EPX-C3 - * single board computer - * - * (c) Copyright 2006 Calin A. Culianu , All Rights - * Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * based on softdog.c by Alan Cox - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define PFX "epx_c3: " -static int epx_c3_alive; - -#define WATCHDOG_TIMEOUT 1 /* 1 sec default timeout */ - -static int nowayout = WATCHDOG_NOWAYOUT; -module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); - -#define EPXC3_WATCHDOG_CTL_REG 0x1ee /* write 1 to enable, 0 to disable */ -#define EPXC3_WATCHDOG_PET_REG 0x1ef /* write anything to pet once enabled */ - -static void epx_c3_start(void) -{ - outb(1, EPXC3_WATCHDOG_CTL_REG); -} - -static void epx_c3_stop(void) -{ - - outb(0, EPXC3_WATCHDOG_CTL_REG); - - printk(KERN_INFO PFX "Stopped watchdog timer.\n"); -} - -static void epx_c3_pet(void) -{ - outb(1, EPXC3_WATCHDOG_PET_REG); -} - -/* - * Allow only one person to hold it open - */ -static int epx_c3_open(struct inode *inode, struct file *file) -{ - if (epx_c3_alive) - return -EBUSY; - - if (nowayout) - __module_get(THIS_MODULE); - - /* Activate timer */ - epx_c3_start(); - epx_c3_pet(); - - epx_c3_alive = 1; - printk(KERN_INFO "Started watchdog timer.\n"); - - return nonseekable_open(inode, file); -} - -static int epx_c3_release(struct inode *inode, struct file *file) -{ - /* Shut off the timer. - * Lock it in if it's a module and we defined ...NOWAYOUT */ - if (!nowayout) - epx_c3_stop(); /* Turn the WDT off */ - - epx_c3_alive = 0; - - return 0; -} - -static ssize_t epx_c3_write(struct file *file, const char *data, - size_t len, loff_t *ppos) -{ - /* Refresh the timer. */ - if (len) - epx_c3_pet(); - return len; -} - -static int epx_c3_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - int options, retval = -EINVAL; - static struct watchdog_info ident = { - .options = WDIOF_KEEPALIVEPING | - WDIOF_MAGICCLOSE, - .firmware_version = 0, - .identity = "Winsystems EPX-C3 H/W Watchdog", - }; - - switch (cmd) { - case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, - &ident, sizeof(ident))) - return -EFAULT; - return 0; - case WDIOC_GETSTATUS: - case WDIOC_GETBOOTSTATUS: - return put_user(0,(int *)arg); - case WDIOC_KEEPALIVE: - epx_c3_pet(); - return 0; - case WDIOC_GETTIMEOUT: - return put_user(WATCHDOG_TIMEOUT,(int *)arg); - case WDIOC_SETOPTIONS: { - if (get_user(options, (int *)arg)) - return -EFAULT; - - if (options & WDIOS_DISABLECARD) { - epx_c3_stop(); - retval = 0; - } - - if (options & WDIOS_ENABLECARD) { - epx_c3_start(); - retval = 0; - } - - return retval; - } - default: - return -ENOIOCTLCMD; - } -} - -static int epx_c3_notify_sys(struct notifier_block *this, unsigned long code, - void *unused) -{ - if (code == SYS_DOWN || code == SYS_HALT) - epx_c3_stop(); /* Turn the WDT off */ - - return NOTIFY_DONE; -} - -static struct file_operations epx_c3_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .write = epx_c3_write, - .ioctl = epx_c3_ioctl, - .open = epx_c3_open, - .release = epx_c3_release, -}; - -static struct miscdevice epx_c3_miscdev = { - .minor = WATCHDOG_MINOR, - .name = "watchdog", - .fops = &epx_c3_fops, -}; - -static struct notifier_block epx_c3_notifier = { - .notifier_call = epx_c3_notify_sys, -}; - -static const char banner[] __initdata = - KERN_INFO PFX "Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n"; - -static int __init watchdog_init(void) -{ - int ret; - - ret = register_reboot_notifier(&epx_c3_notifier); - if (ret) { - printk(KERN_ERR PFX "cannot register reboot notifier " - "(err=%d)\n", ret); - return ret; - } - - ret = misc_register(&epx_c3_miscdev); - if (ret) { - printk(KERN_ERR PFX "cannot register miscdev on minor=%d " - "(err=%d)\n", WATCHDOG_MINOR, ret); - unregister_reboot_notifier(&epx_c3_notifier); - return ret; - } - - printk(banner); - - return 0; -} - -static void __exit watchdog_exit(void) -{ - misc_deregister(&epx_c3_miscdev); - unregister_reboot_notifier(&epx_c3_notifier); -} - -module_init(watchdog_init); -module_exit(watchdog_exit); - -MODULE_AUTHOR("Calin A. Culianu "); -MODULE_DESCRIPTION("Hardware Watchdog Device for Winsystems EPX-C3 SBC. Note that there is no way to probe for this device -- so only use it if you are *sure* you are runnning on this specific SBC system from Winsystems! It writes to IO ports 0x1ee and 0x1ef!"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); diff --git a/trunk/drivers/cpufreq/cpufreq.c b/trunk/drivers/cpufreq/cpufreq.c index 277a843a87a6..a9163d02983a 100644 --- a/trunk/drivers/cpufreq/cpufreq.c +++ b/trunk/drivers/cpufreq/cpufreq.c @@ -41,6 +41,7 @@ static DEFINE_SPINLOCK(cpufreq_driver_lock); /* internal prototypes */ static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event); static void handle_update(void *data); +static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci); /** * Two notifier lists: the "policy" list is involved in the @@ -126,7 +127,7 @@ static unsigned int debug_ratelimit = 1; static unsigned int disable_ratelimit = 1; static DEFINE_SPINLOCK(disable_ratelimit_lock); -static void cpufreq_debug_enable_ratelimit(void) +static inline void cpufreq_debug_enable_ratelimit(void) { unsigned long flags; @@ -136,7 +137,7 @@ static void cpufreq_debug_enable_ratelimit(void) spin_unlock_irqrestore(&disable_ratelimit_lock, flags); } -static void cpufreq_debug_disable_ratelimit(void) +static inline void cpufreq_debug_disable_ratelimit(void) { unsigned long flags; @@ -205,7 +206,7 @@ static inline void cpufreq_debug_disable_ratelimit(void) { return; } static unsigned long l_p_j_ref; static unsigned int l_p_j_ref_freq; -static void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) +static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) { if (ci->flags & CPUFREQ_CONST_LOOPS) return; diff --git a/trunk/drivers/firmware/dell_rbu.c b/trunk/drivers/firmware/dell_rbu.c index fdb8b042e64d..dfedb777d8c9 100644 --- a/trunk/drivers/firmware/dell_rbu.c +++ b/trunk/drivers/firmware/dell_rbu.c @@ -49,7 +49,7 @@ MODULE_AUTHOR("Abhay Salunke "); MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems"); MODULE_LICENSE("GPL"); -MODULE_VERSION("3.2"); +MODULE_VERSION("3.1"); #define BIOS_SCAN_LIMIT 0xffffffff #define MAX_IMAGE_LENGTH 16 @@ -564,10 +564,12 @@ static ssize_t read_rbu_data(struct kobject *kobj, char *buffer, static void callbackfn_rbu(const struct firmware *fw, void *context) { - rbu_data.entry_created = 0; + int rc = 0; - if (!fw || !fw->size) + if (!fw || !fw->size) { + rbu_data.entry_created = 0; return; + } spin_lock(&rbu_data.lock); if (!strcmp(image_type, "mono")) { @@ -590,6 +592,15 @@ static void callbackfn_rbu(const struct firmware *fw, void *context) } else pr_debug("invalid image type specified.\n"); spin_unlock(&rbu_data.lock); + + rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG, + "dell_rbu", &rbu_device->dev, &context, callbackfn_rbu); + if (rc) + printk(KERN_ERR + "dell_rbu:%s request_firmware_nowait failed" + " %d\n", __FUNCTION__, rc); + else + rbu_data.entry_created = 1; } static ssize_t read_rbu_image_type(struct kobject *kobj, char *buffer, @@ -724,7 +735,14 @@ static int __init dcdrbu_init(void) sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_packet_size_attr); - rbu_data.entry_created = 0; + rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG, + "dell_rbu", &rbu_device->dev, &context, callbackfn_rbu); + if (rc) + printk(KERN_ERR "dell_rbu:%s:request_firmware_nowait" + " failed %d\n", __FUNCTION__, rc); + else + rbu_data.entry_created = 1; + return rc; } diff --git a/trunk/drivers/ide/ide-cd.c b/trunk/drivers/ide/ide-cd.c index 3325660f7248..ef09a7ef2396 100644 --- a/trunk/drivers/ide/ide-cd.c +++ b/trunk/drivers/ide/ide-cd.c @@ -980,7 +980,7 @@ static void cdrom_buffer_sectors (ide_drive_t *drive, unsigned long sector, * and attempt to recover if there are problems. Returns 0 if everything's * ok; nonzero if the request has been terminated. */ -static +static inline int cdrom_read_check_ireason (ide_drive_t *drive, int len, int ireason) { if (ireason == 2) @@ -1539,7 +1539,7 @@ int cdrom_queue_packet_command(ide_drive_t *drive, struct request *rq) /* * Write handling */ -static int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ireason) +static inline int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ireason) { /* Two notes about IDE interrupt reason here - 0 means that * the drive wants to receive data from us, 2 means that diff --git a/trunk/drivers/ide/ide-disk.c b/trunk/drivers/ide/ide-disk.c index ca25f9e3d0f4..245b508208df 100644 --- a/trunk/drivers/ide/ide-disk.c +++ b/trunk/drivers/ide/ide-disk.c @@ -477,7 +477,7 @@ static inline int idedisk_supports_lba48(const struct hd_driveid *id) && id->lba_capacity_2; } -static void idedisk_check_hpa(ide_drive_t *drive) +static inline void idedisk_check_hpa(ide_drive_t *drive) { unsigned long long capacity, set_max; int lba48 = idedisk_supports_lba48(drive->id); diff --git a/trunk/drivers/ide/ide-taskfile.c b/trunk/drivers/ide/ide-taskfile.c index 9834dce4e20f..62ebefd6394a 100644 --- a/trunk/drivers/ide/ide-taskfile.c +++ b/trunk/drivers/ide/ide-taskfile.c @@ -308,7 +308,7 @@ static void ide_pio_multi(ide_drive_t *drive, unsigned int write) ide_pio_sector(drive, write); } -static void ide_pio_datablock(ide_drive_t *drive, struct request *rq, +static inline void ide_pio_datablock(ide_drive_t *drive, struct request *rq, unsigned int write) { if (rq->bio) /* fs request */ diff --git a/trunk/drivers/infiniband/core/cm.c b/trunk/drivers/infiniband/core/cm.c index 2514de3480d8..c06b18102b6a 100644 --- a/trunk/drivers/infiniband/core/cm.c +++ b/trunk/drivers/infiniband/core/cm.c @@ -856,7 +856,7 @@ static void cm_format_req(struct cm_req_msg *req_msg, param->private_data_len); } -static int cm_validate_req_param(struct ib_cm_req_param *param) +static inline int cm_validate_req_param(struct ib_cm_req_param *param) { /* peer-to-peer not supported */ if (param->peer_to_peer) @@ -1005,7 +1005,7 @@ static inline int cm_is_active_peer(__be64 local_ca_guid, __be64 remote_ca_guid, (be32_to_cpu(local_qpn) > be32_to_cpu(remote_qpn)))); } -static void cm_format_paths_from_req(struct cm_req_msg *req_msg, +static inline void cm_format_paths_from_req(struct cm_req_msg *req_msg, struct ib_sa_path_rec *primary_path, struct ib_sa_path_rec *alt_path) { diff --git a/trunk/drivers/isdn/hisax/avm_pci.c b/trunk/drivers/isdn/hisax/avm_pci.c index 4abe5ff10e72..5d8ee7368f7b 100644 --- a/trunk/drivers/isdn/hisax/avm_pci.c +++ b/trunk/drivers/isdn/hisax/avm_pci.c @@ -358,7 +358,7 @@ hdlc_fill_fifo(struct BCState *bcs) } } -static void +static inline void HDLC_irq(struct BCState *bcs, u_int stat) { int len; struct sk_buff *skb; diff --git a/trunk/drivers/isdn/hisax/diva.c b/trunk/drivers/isdn/hisax/diva.c index b0ff1cc97d7c..b62d6b30b72b 100644 --- a/trunk/drivers/isdn/hisax/diva.c +++ b/trunk/drivers/isdn/hisax/diva.c @@ -476,7 +476,7 @@ Memhscx_fill_fifo(struct BCState *bcs) } } -static void +static inline void Memhscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx) { u_char r; diff --git a/trunk/drivers/isdn/hisax/hscx_irq.c b/trunk/drivers/isdn/hisax/hscx_irq.c index 7b1ad5e4ecda..5fe9d42d03a3 100644 --- a/trunk/drivers/isdn/hisax/hscx_irq.c +++ b/trunk/drivers/isdn/hisax/hscx_irq.c @@ -119,7 +119,7 @@ hscx_fill_fifo(struct BCState *bcs) } } -static void +static inline void hscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx) { u_char r; @@ -221,7 +221,7 @@ hscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx) } } -static void +static inline void hscx_int_main(struct IsdnCardState *cs, u_char val) { diff --git a/trunk/drivers/isdn/hisax/jade_irq.c b/trunk/drivers/isdn/hisax/jade_irq.c index 1f201af15a0f..08563400e4fd 100644 --- a/trunk/drivers/isdn/hisax/jade_irq.c +++ b/trunk/drivers/isdn/hisax/jade_irq.c @@ -110,7 +110,7 @@ jade_fill_fifo(struct BCState *bcs) } -static void +static inline void jade_interrupt(struct IsdnCardState *cs, u_char val, u_char jade) { u_char r; diff --git a/trunk/drivers/md/bitmap.c b/trunk/drivers/md/bitmap.c index eae4473eadde..76a189ceb529 100644 --- a/trunk/drivers/md/bitmap.c +++ b/trunk/drivers/md/bitmap.c @@ -200,7 +200,7 @@ static int bitmap_checkpage(struct bitmap *bitmap, unsigned long page, int creat /* if page is completely empty, put it back on the free list, or dealloc it */ /* if page was hijacked, unmark the flag so it might get alloced next time */ /* Note: lock should be held when calling this */ -static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page) +static inline void bitmap_checkfree(struct bitmap *bitmap, unsigned long page) { char *ptr; diff --git a/trunk/drivers/md/dm-crypt.c b/trunk/drivers/md/dm-crypt.c index e7a650f9ca07..a601a427885c 100644 --- a/trunk/drivers/md/dm-crypt.c +++ b/trunk/drivers/md/dm-crypt.c @@ -228,7 +228,7 @@ static struct crypt_iv_operations crypt_iv_essiv_ops = { }; -static int +static inline int crypt_convert_scatterlist(struct crypt_config *cc, struct scatterlist *out, struct scatterlist *in, unsigned int length, int write, sector_t sector) diff --git a/trunk/drivers/md/dm-ioctl.c b/trunk/drivers/md/dm-ioctl.c index 1235135b384b..561bda5011e0 100644 --- a/trunk/drivers/md/dm-ioctl.c +++ b/trunk/drivers/md/dm-ioctl.c @@ -598,7 +598,7 @@ static int dev_create(struct dm_ioctl *param, size_t param_size) /* * Always use UUID for lookups if it's present, otherwise use name or dev. */ -static struct hash_cell *__find_device_hash_cell(struct dm_ioctl *param) +static inline struct hash_cell *__find_device_hash_cell(struct dm_ioctl *param) { if (*param->uuid) return __get_uuid_cell(param->uuid); @@ -608,7 +608,7 @@ static struct hash_cell *__find_device_hash_cell(struct dm_ioctl *param) return dm_get_mdptr(huge_decode_dev(param->dev)); } -static struct mapped_device *find_device(struct dm_ioctl *param) +static inline struct mapped_device *find_device(struct dm_ioctl *param) { struct hash_cell *hc; struct mapped_device *md = NULL; diff --git a/trunk/drivers/md/dm-snap.c b/trunk/drivers/md/dm-snap.c index 87727d84dbba..4b9dd8fb1e5c 100644 --- a/trunk/drivers/md/dm-snap.c +++ b/trunk/drivers/md/dm-snap.c @@ -691,7 +691,7 @@ static void copy_callback(int read_err, unsigned int write_err, void *context) /* * Dispatches the copy operation to kcopyd. */ -static void start_copy(struct pending_exception *pe) +static inline void start_copy(struct pending_exception *pe) { struct dm_snapshot *s = pe->snap; struct io_region src, dest; diff --git a/trunk/drivers/md/dm.c b/trunk/drivers/md/dm.c index 8c16359f8b01..097d1e540090 100644 --- a/trunk/drivers/md/dm.c +++ b/trunk/drivers/md/dm.c @@ -293,7 +293,7 @@ struct dm_table *dm_get_table(struct mapped_device *md) * Decrements the number of outstanding ios that a bio has been * cloned into, completing the original io if necc. */ -static void dec_pending(struct dm_io *io, int error) +static inline void dec_pending(struct dm_io *io, int error) { if (error) io->error = error; diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c index d39f584cd8b3..a06ff91f27e2 100644 --- a/trunk/drivers/md/raid1.c +++ b/trunk/drivers/md/raid1.c @@ -176,7 +176,7 @@ static void put_all_bios(conf_t *conf, r1bio_t *r1_bio) } } -static void free_r1bio(r1bio_t *r1_bio) +static inline void free_r1bio(r1bio_t *r1_bio) { conf_t *conf = mddev_to_conf(r1_bio->mddev); @@ -190,7 +190,7 @@ static void free_r1bio(r1bio_t *r1_bio) mempool_free(r1_bio, conf->r1bio_pool); } -static void put_buf(r1bio_t *r1_bio) +static inline void put_buf(r1bio_t *r1_bio) { conf_t *conf = mddev_to_conf(r1_bio->mddev); int i; diff --git a/trunk/drivers/md/raid10.c b/trunk/drivers/md/raid10.c index 9130d051b474..9e658e519a27 100644 --- a/trunk/drivers/md/raid10.c +++ b/trunk/drivers/md/raid10.c @@ -176,7 +176,7 @@ static void put_all_bios(conf_t *conf, r10bio_t *r10_bio) } } -static void free_r10bio(r10bio_t *r10_bio) +static inline void free_r10bio(r10bio_t *r10_bio) { conf_t *conf = mddev_to_conf(r10_bio->mddev); @@ -190,7 +190,7 @@ static void free_r10bio(r10bio_t *r10_bio) mempool_free(r10_bio, conf->r10bio_pool); } -static void put_buf(r10bio_t *r10_bio) +static inline void put_buf(r10bio_t *r10_bio) { conf_t *conf = mddev_to_conf(r10_bio->mddev); diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c index 25976bfb6f9c..54f4a9847e38 100644 --- a/trunk/drivers/md/raid5.c +++ b/trunk/drivers/md/raid5.c @@ -69,7 +69,7 @@ static void print_raid5_conf (raid5_conf_t *conf); -static void __release_stripe(raid5_conf_t *conf, struct stripe_head *sh) +static inline void __release_stripe(raid5_conf_t *conf, struct stripe_head *sh) { if (atomic_dec_and_test(&sh->count)) { if (!list_empty(&sh->lru)) @@ -118,7 +118,7 @@ static inline void remove_hash(struct stripe_head *sh) hlist_del_init(&sh->hash); } -static void insert_hash(raid5_conf_t *conf, struct stripe_head *sh) +static inline void insert_hash(raid5_conf_t *conf, struct stripe_head *sh) { struct hlist_head *hp = stripe_hash(conf, sh->sector); @@ -178,7 +178,7 @@ static int grow_buffers(struct stripe_head *sh, int num) static void raid5_build_block (struct stripe_head *sh, int i); -static void init_stripe(struct stripe_head *sh, sector_t sector, int pd_idx) +static inline void init_stripe(struct stripe_head *sh, sector_t sector, int pd_idx) { raid5_conf_t *conf = sh->raid_conf; int disks = conf->raid_disks, i; @@ -1415,7 +1415,7 @@ static void handle_stripe(struct stripe_head *sh) } } -static void raid5_activate_delayed(raid5_conf_t *conf) +static inline void raid5_activate_delayed(raid5_conf_t *conf) { if (atomic_read(&conf->preread_active_stripes) < IO_THRESHOLD) { while (!list_empty(&conf->delayed_list)) { @@ -1431,7 +1431,7 @@ static void raid5_activate_delayed(raid5_conf_t *conf) } } -static void activate_bit_delay(raid5_conf_t *conf) +static inline void activate_bit_delay(raid5_conf_t *conf) { /* device_lock is held */ struct list_head head; diff --git a/trunk/drivers/md/raid6main.c b/trunk/drivers/md/raid6main.c index f618a53b98be..8c823d686a60 100644 --- a/trunk/drivers/md/raid6main.c +++ b/trunk/drivers/md/raid6main.c @@ -88,7 +88,7 @@ static inline int raid6_next_disk(int disk, int raid_disks) static void print_raid6_conf (raid6_conf_t *conf); -static void __release_stripe(raid6_conf_t *conf, struct stripe_head *sh) +static inline void __release_stripe(raid6_conf_t *conf, struct stripe_head *sh) { if (atomic_dec_and_test(&sh->count)) { if (!list_empty(&sh->lru)) @@ -197,7 +197,7 @@ static int grow_buffers(struct stripe_head *sh, int num) static void raid6_build_block (struct stripe_head *sh, int i); -static void init_stripe(struct stripe_head *sh, sector_t sector, int pd_idx) +static inline void init_stripe(struct stripe_head *sh, sector_t sector, int pd_idx) { raid6_conf_t *conf = sh->raid_conf; int disks = conf->raid_disks, i; @@ -1577,7 +1577,7 @@ static void handle_stripe(struct stripe_head *sh, struct page *tmp_page) } } -static void raid6_activate_delayed(raid6_conf_t *conf) +static inline void raid6_activate_delayed(raid6_conf_t *conf) { if (atomic_read(&conf->preread_active_stripes) < IO_THRESHOLD) { while (!list_empty(&conf->delayed_list)) { @@ -1593,7 +1593,7 @@ static void raid6_activate_delayed(raid6_conf_t *conf) } } -static void activate_bit_delay(raid6_conf_t *conf) +static inline void activate_bit_delay(raid6_conf_t *conf) { /* device_lock is held */ struct list_head head; diff --git a/trunk/drivers/media/video/tvp5150.c b/trunk/drivers/media/video/tvp5150.c index 9094fa9f2ecb..e86b522938fd 100644 --- a/trunk/drivers/media/video/tvp5150.c +++ b/trunk/drivers/media/video/tvp5150.c @@ -93,7 +93,7 @@ struct tvp5150 { int sat; }; -static int tvp5150_read(struct i2c_client *c, unsigned char addr) +static inline int tvp5150_read(struct i2c_client *c, unsigned char addr) { unsigned char buffer[1]; int rc; diff --git a/trunk/drivers/message/fusion/mptlan.c b/trunk/drivers/message/fusion/mptlan.c index 73f59528212a..0b1b72825ae2 100644 --- a/trunk/drivers/message/fusion/mptlan.c +++ b/trunk/drivers/message/fusion/mptlan.c @@ -844,7 +844,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev) } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static void +static inline void mpt_lan_wake_post_buckets_task(struct net_device *dev, int priority) /* * @priority: 0 = put it on the timer queue, 1 = put it on the immediate queue @@ -866,7 +866,7 @@ mpt_lan_wake_post_buckets_task(struct net_device *dev, int priority) } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static int +static inline int mpt_lan_receive_skb(struct net_device *dev, struct sk_buff *skb) { struct mpt_lan_priv *priv = dev->priv; diff --git a/trunk/drivers/mmc/mmc_block.c b/trunk/drivers/mmc/mmc_block.c index 5b014c370e80..9b7c37e0e574 100644 --- a/trunk/drivers/mmc/mmc_block.c +++ b/trunk/drivers/mmc/mmc_block.c @@ -462,10 +462,9 @@ static int mmc_blk_probe(struct mmc_card *card) if (err) goto out; - printk(KERN_INFO "%s: %s %s %lluKiB %s\n", + printk(KERN_INFO "%s: %s %s %luKiB %s\n", md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), - (unsigned long long)(get_capacity(md->disk) >> 1), - md->read_only ? "(ro)" : ""); + get_capacity(md->disk) >> 1, md->read_only ? "(ro)" : ""); mmc_set_drvdata(card, md); add_disk(md->disk); diff --git a/trunk/drivers/mtd/devices/doc2000.c b/trunk/drivers/mtd/devices/doc2000.c index e4345cf744a2..be5e88b3888d 100644 --- a/trunk/drivers/mtd/devices/doc2000.c +++ b/trunk/drivers/mtd/devices/doc2000.c @@ -138,7 +138,7 @@ static inline int DoC_WaitReady(struct DiskOnChip *doc) bypass the internal pipeline. Each of 4 delay cycles (read from the NOP register) is required after writing to CDSN Control register, see Software Requirement 11.4 item 3. */ -static int DoC_Command(struct DiskOnChip *doc, unsigned char command, +static inline int DoC_Command(struct DiskOnChip *doc, unsigned char command, unsigned char xtraflags) { void __iomem *docptr = doc->virtadr; diff --git a/trunk/drivers/mtd/devices/doc2001.c b/trunk/drivers/mtd/devices/doc2001.c index 681a9c73a2a3..fcb28a6fd89f 100644 --- a/trunk/drivers/mtd/devices/doc2001.c +++ b/trunk/drivers/mtd/devices/doc2001.c @@ -103,7 +103,7 @@ static inline int DoC_WaitReady(void __iomem * docptr) with the internal pipeline. Each of 4 delay cycles (read from the NOP register) is required after writing to CDSN Control register, see Software Requirement 11.4 item 3. */ -static void DoC_Command(void __iomem * docptr, unsigned char command, +static inline void DoC_Command(void __iomem * docptr, unsigned char command, unsigned char xtraflags) { /* Assert the CLE (Command Latch Enable) line to the flash chip */ diff --git a/trunk/drivers/mtd/devices/doc2001plus.c b/trunk/drivers/mtd/devices/doc2001plus.c index 5f57f29efee4..0595cc7324b2 100644 --- a/trunk/drivers/mtd/devices/doc2001plus.c +++ b/trunk/drivers/mtd/devices/doc2001plus.c @@ -118,7 +118,7 @@ static inline void DoC_CheckASIC(void __iomem * docptr) /* DoC_Command: Send a flash command to the flash chip through the Flash * command register. Need 2 Write Pipeline Terminates to complete send. */ -static void DoC_Command(void __iomem * docptr, unsigned char command, +static inline void DoC_Command(void __iomem * docptr, unsigned char command, unsigned char xtraflags) { WriteDOC(command, docptr, Mplus_FlashCmd); diff --git a/trunk/drivers/mtd/nand/diskonchip.c b/trunk/drivers/mtd/nand/diskonchip.c index ec5e45e4e4ef..21d4e8f4b7af 100644 --- a/trunk/drivers/mtd/nand/diskonchip.c +++ b/trunk/drivers/mtd/nand/diskonchip.c @@ -1506,7 +1506,7 @@ static inline int __init doc2001plus_init(struct mtd_info *mtd) return 1; } -static int __init doc_probe(unsigned long physadr) +static inline int __init doc_probe(unsigned long physadr) { unsigned char ChipID; struct mtd_info *mtd; diff --git a/trunk/drivers/net/Kconfig b/trunk/drivers/net/Kconfig index 171999e67eec..5c15f3e9ea07 100644 --- a/trunk/drivers/net/Kconfig +++ b/trunk/drivers/net/Kconfig @@ -1387,7 +1387,7 @@ config FORCEDETH config CS89x0 tristate "CS89x0 support" - depends on NET_PCI && (ISA || MACH_IXDP2351 || ARCH_IXDP2X01 || ARCH_PNX010X) + depends on NET_PCI && (ISA || ARCH_IXDP2X01 || ARCH_PNX010X) ---help--- Support for CS89x0 chipset based Ethernet cards. If you have a network (Ethernet) card of this type, say Y and read the diff --git a/trunk/drivers/net/cs89x0.c b/trunk/drivers/net/cs89x0.c index fab6586d87e9..e2cfde7e31ec 100644 --- a/trunk/drivers/net/cs89x0.c +++ b/trunk/drivers/net/cs89x0.c @@ -87,12 +87,6 @@ Deepak Saxena : dsaxena@plexity.net : Intel IXDP2x01 (XScale ixp2x00 NPU) platform support - Dmitry Pervushin : dpervushin@ru.mvista.com - : PNX010X platform support - - Deepak Saxena : dsaxena@plexity.net - : Intel IXDP2351 platform support - */ /* Always include 'config.h' first in case the user wants to turn on @@ -177,10 +171,6 @@ static unsigned int cs8900_irq_map[] = {12,0,0,0}; static unsigned int netcard_portlist[] __initdata = { 0x0300, 0}; static unsigned int cs8900_irq_map[] = {1,0,0,0}; -#elif defined(CONFIG_MACH_IXDP2351) -static unsigned int netcard_portlist[] __initdata = {IXDP2351_VIRT_CS8900_BASE, 0}; -static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0}; -#include #elif defined(CONFIG_ARCH_IXDP2X01) #include static unsigned int netcard_portlist[] __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0}; @@ -348,55 +338,45 @@ struct net_device * __init cs89x0_probe(int unit) } #endif -#if defined(CONFIG_MACH_IXDP2351) -static u16 -readword(unsigned long base_addr, int portno) -{ - return __raw_readw(base_addr + (portno << 1)); -} - -static void -writeword(unsigned long base_addr, int portno, u16 value) -{ - __raw_writew(value, base_addr + (portno << 1)); -} -#elif defined(CONFIG_ARCH_IXDP2X01) -static u16 +#if defined(CONFIG_ARCH_IXDP2X01) +static int readword(unsigned long base_addr, int portno) { - return __raw_readl(base_addr + (portno << 1)); + return (u16)__raw_readl(base_addr + (portno << 1)); } static void -writeword(unsigned long base_addr, int portno, u16 value) +writeword(unsigned long base_addr, int portno, int value) { - __raw_writel(value, base_addr + (portno << 1)); + __raw_writel((u16)value, base_addr + (portno << 1)); } -#elif defined(CONFIG_ARCH_PNX010X) -static u16 +#else +#if defined(CONFIG_ARCH_PNX010X) +static int readword(unsigned long base_addr, int portno) { return inw(base_addr + (portno << 1)); } static void -writeword(unsigned long base_addr, int portno, u16 value) +writeword(unsigned long base_addr, int portno, int value) { outw(value, base_addr + (portno << 1)); } #else -static u16 +static int readword(unsigned long base_addr, int portno) { return inw(base_addr + portno); } static void -writeword(unsigned long base_addr, int portno, u16 value) +writeword(unsigned long base_addr, int portno, int value) { outw(value, base_addr + portno); } #endif +#endif static void readwords(unsigned long base_addr, int portno, void *buf, int length) @@ -404,11 +384,11 @@ readwords(unsigned long base_addr, int portno, void *buf, int length) u8 *buf8 = (u8 *)buf; do { - u16 tmp16; + u32 tmp32; - tmp16 = readword(base_addr, portno); - *buf8++ = (u8)tmp16; - *buf8++ = (u8)(tmp16 >> 8); + tmp32 = readword(base_addr, portno); + *buf8++ = (u8)tmp32; + *buf8++ = (u8)(tmp32 >> 8); } while (--length); } @@ -418,23 +398,23 @@ writewords(unsigned long base_addr, int portno, void *buf, int length) u8 *buf8 = (u8 *)buf; do { - u16 tmp16; + u32 tmp32; - tmp16 = *buf8++; - tmp16 |= (*buf8++) << 8; - writeword(base_addr, portno, tmp16); + tmp32 = *buf8++; + tmp32 |= (*buf8++) << 8; + writeword(base_addr, portno, tmp32); } while (--length); } -static u16 -readreg(struct net_device *dev, u16 regno) +static int +readreg(struct net_device *dev, int regno) { writeword(dev->base_addr, ADD_PORT, regno); return readword(dev->base_addr, DATA_PORT); } static void -writereg(struct net_device *dev, u16 regno, u16 value) +writereg(struct net_device *dev, int regno, int value) { writeword(dev->base_addr, ADD_PORT, regno); writeword(dev->base_addr, DATA_PORT, value); @@ -800,7 +780,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) } else { i = lp->isa_config & INT_NO_MASK; if (lp->chip_type == CS8900) { -#if defined(CONFIG_MACH_IXDP2351) || defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX010X) +#if defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX010X) i = cs8900_irq_map[0]; #else /* Translate the IRQ using the IRQ mapping table. */ @@ -1032,7 +1012,7 @@ dma_rx(struct net_device *dev) void __init reset_chip(struct net_device *dev) { -#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) +#ifndef CONFIG_ARCH_IXDP2X01 struct net_local *lp = netdev_priv(dev); int ioaddr = dev->base_addr; #endif @@ -1043,7 +1023,7 @@ void __init reset_chip(struct net_device *dev) /* wait 30 ms */ msleep(30); -#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) +#ifndef CONFIG_ARCH_IXDP2X01 if (lp->chip_type != CS8900) { /* Hardware problem requires PNP registers to be reconfigured after a reset */ writeword(ioaddr, ADD_PORT, PP_CS8920_ISAINT); @@ -1307,7 +1287,7 @@ net_open(struct net_device *dev) else #endif { -#if !defined(CONFIG_MACH_IXDP2351) && !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X) +#if !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX010X) if (((1 << dev->irq) & lp->irq_map) == 0) { printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n", dev->name, dev->irq, lp->irq_map); diff --git a/trunk/drivers/net/e100.c b/trunk/drivers/net/e100.c index 4726722a0635..23de22631c64 100644 --- a/trunk/drivers/net/e100.c +++ b/trunk/drivers/net/e100.c @@ -592,7 +592,7 @@ static inline void e100_write_flush(struct nic *nic) (void)readb(&nic->csr->scb.status); } -static void e100_enable_irq(struct nic *nic) +static inline void e100_enable_irq(struct nic *nic) { unsigned long flags; @@ -602,7 +602,7 @@ static void e100_enable_irq(struct nic *nic) e100_write_flush(nic); } -static void e100_disable_irq(struct nic *nic) +static inline void e100_disable_irq(struct nic *nic) { unsigned long flags; @@ -791,7 +791,7 @@ static int e100_eeprom_save(struct nic *nic, u16 start, u16 count) #define E100_WAIT_SCB_TIMEOUT 20000 /* we might have to wait 100ms!!! */ #define E100_WAIT_SCB_FAST 20 /* delay like the old code */ -static int e100_exec_cmd(struct nic *nic, u8 cmd, dma_addr_t dma_addr) +static inline int e100_exec_cmd(struct nic *nic, u8 cmd, dma_addr_t dma_addr) { unsigned long flags; unsigned int i; @@ -822,7 +822,7 @@ static int e100_exec_cmd(struct nic *nic, u8 cmd, dma_addr_t dma_addr) return err; } -static int e100_exec_cb(struct nic *nic, struct sk_buff *skb, +static inline int e100_exec_cb(struct nic *nic, struct sk_buff *skb, void (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *)) { struct cb *cb; @@ -1567,7 +1567,7 @@ static void e100_watchdog(unsigned long data) mod_timer(&nic->watchdog, jiffies + E100_WATCHDOG_PERIOD); } -static void e100_xmit_prepare(struct nic *nic, struct cb *cb, +static inline void e100_xmit_prepare(struct nic *nic, struct cb *cb, struct sk_buff *skb) { cb->command = nic->tx_command; @@ -1617,7 +1617,7 @@ static int e100_xmit_frame(struct sk_buff *skb, struct net_device *netdev) return 0; } -static int e100_tx_clean(struct nic *nic) +static inline int e100_tx_clean(struct nic *nic) { struct cb *cb; int tx_cleaned = 0; @@ -1728,7 +1728,7 @@ static inline void e100_start_receiver(struct nic *nic, struct rx *rx) } #define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN) -static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx) +static inline int e100_rx_alloc_skb(struct nic *nic, struct rx *rx) { if(!(rx->skb = dev_alloc_skb(RFD_BUF_LEN + NET_IP_ALIGN))) return -ENOMEM; @@ -1762,7 +1762,7 @@ static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx) return 0; } -static int e100_rx_indicate(struct nic *nic, struct rx *rx, +static inline int e100_rx_indicate(struct nic *nic, struct rx *rx, unsigned int *work_done, unsigned int work_to_do) { struct sk_buff *skb = rx->skb; @@ -1822,7 +1822,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, return 0; } -static void e100_rx_clean(struct nic *nic, unsigned int *work_done, +static inline void e100_rx_clean(struct nic *nic, unsigned int *work_done, unsigned int work_to_do) { struct rx *rx; diff --git a/trunk/drivers/net/sb1000.c b/trunk/drivers/net/sb1000.c index 76139478c3df..d6388e1533f0 100644 --- a/trunk/drivers/net/sb1000.c +++ b/trunk/drivers/net/sb1000.c @@ -94,7 +94,7 @@ static inline int card_wait_for_busy_clear(const int ioaddr[], const char* name); static inline int card_wait_for_ready(const int ioaddr[], const char* name, unsigned char in[]); -static int card_send_command(const int ioaddr[], const char* name, +static inline int card_send_command(const int ioaddr[], const char* name, const unsigned char out[], unsigned char in[]); /* SB1000 hardware routines to be used during frame rx interrupt */ @@ -309,7 +309,7 @@ card_wait_for_ready(const int ioaddr[], const char* name, unsigned char in[]) } /* Card Send Command (cannot be used during an interrupt) */ -static int +static inline int card_send_command(const int ioaddr[], const char* name, const unsigned char out[], unsigned char in[]) { diff --git a/trunk/drivers/net/wireless/hostap/hostap_80211_rx.c b/trunk/drivers/net/wireless/hostap/hostap_80211_rx.c index 4b13b76425c1..ffac50899454 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_80211_rx.c +++ b/trunk/drivers/net/wireless/hostap/hostap_80211_rx.c @@ -435,7 +435,7 @@ static void hostap_rx_sta_beacon(local_info_t *local, struct sk_buff *skb, } -static int +static inline int hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb, struct hostap_80211_rx_status *rx_stats, u16 type, u16 stype) @@ -499,7 +499,7 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb, /* Called only as a tasklet (software IRQ) */ -static struct net_device *prism2_rx_get_wds(local_info_t *local, +static inline struct net_device *prism2_rx_get_wds(local_info_t *local, u8 *addr) { struct hostap_interface *iface = NULL; @@ -519,7 +519,7 @@ static struct net_device *prism2_rx_get_wds(local_info_t *local, } -static int +static inline int hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr, u16 fc, struct net_device **wds) { @@ -615,7 +615,7 @@ static int hostap_is_eapol_frame(local_info_t *local, struct sk_buff *skb) /* Called only as a tasklet (software IRQ) */ -static int +static inline int hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, struct ieee80211_crypt_data *crypt) { @@ -654,7 +654,7 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, /* Called only as a tasklet (software IRQ) */ -static int +static inline int hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb, int keyidx, struct ieee80211_crypt_data *crypt) { diff --git a/trunk/drivers/net/wireless/hostap/hostap_hw.c b/trunk/drivers/net/wireless/hostap/hostap_hw.c index b1f142d9e232..abfae7fedebc 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_hw.c +++ b/trunk/drivers/net/wireless/hostap/hostap_hw.c @@ -253,7 +253,7 @@ static void prism2_clear_cmd_queue(local_info_t *local) * @dev: pointer to net_device * @entry: Prism2 command queue entry to be issued */ -static int hfa384x_cmd_issue(struct net_device *dev, +static inline int hfa384x_cmd_issue(struct net_device *dev, struct hostap_cmd_queue *entry) { struct hostap_interface *iface; @@ -743,7 +743,7 @@ static void prism2_cmd_ev(struct net_device *dev) } -static int hfa384x_wait_offset(struct net_device *dev, u16 o_off) +static inline int hfa384x_wait_offset(struct net_device *dev, u16 o_off) { int tries = HFA384X_BAP_BUSY_TIMEOUT; int res = HFA384X_INW(o_off) & HFA384X_OFFSET_BUSY; @@ -1904,7 +1904,7 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev) * and will try to get the correct fid eventually. */ #define EXTRA_FID_READ_TESTS -static u16 prism2_read_fid_reg(struct net_device *dev, u16 reg) +static inline u16 prism2_read_fid_reg(struct net_device *dev, u16 reg) { #ifdef EXTRA_FID_READ_TESTS u16 val, val2, val3; @@ -2581,7 +2581,7 @@ static void prism2_ev_tick(struct net_device *dev) /* Called only from hardware IRQ */ -static void prism2_check_magic(local_info_t *local) +static inline void prism2_check_magic(local_info_t *local) { /* at least PCI Prism2.5 with bus mastering seems to sometimes * return 0x0000 in SWSUPPORT0 for unknown reason, but re-reading the diff --git a/trunk/drivers/net/wireless/ipw2100.c b/trunk/drivers/net/wireless/ipw2100.c index 7518384f34d9..cf05661fb1bd 100644 --- a/trunk/drivers/net/wireless/ipw2100.c +++ b/trunk/drivers/net/wireless/ipw2100.c @@ -411,7 +411,7 @@ static inline void write_nic_dword_auto_inc(struct net_device *dev, u32 val) write_register(dev, IPW_REG_AUTOINCREMENT_DATA, val); } -static void write_nic_memory(struct net_device *dev, u32 addr, u32 len, +static inline void write_nic_memory(struct net_device *dev, u32 addr, u32 len, const u8 * buf) { u32 aligned_addr; @@ -449,7 +449,7 @@ static void write_nic_memory(struct net_device *dev, u32 addr, u32 len, *buf); } -static void read_nic_memory(struct net_device *dev, u32 addr, u32 len, +static inline void read_nic_memory(struct net_device *dev, u32 addr, u32 len, u8 * buf) { u32 aligned_addr; @@ -657,7 +657,7 @@ static void printk_buf(int level, const u8 * data, u32 len) #define MAX_RESET_BACKOFF 10 -static void schedule_reset(struct ipw2100_priv *priv) +static inline void schedule_reset(struct ipw2100_priv *priv) { unsigned long now = get_seconds(); @@ -1130,7 +1130,7 @@ static inline void ipw2100_hw_set_gpio(struct ipw2100_priv *priv) write_register(priv->net_dev, IPW_REG_GPIO, reg); } -static int rf_kill_active(struct ipw2100_priv *priv) +static inline int rf_kill_active(struct ipw2100_priv *priv) { #define MAX_RF_KILL_CHECKS 5 #define RF_KILL_CHECK_DELAY 40 @@ -2177,7 +2177,7 @@ static const char *frame_types[] = { }; #endif -static int ipw2100_alloc_skb(struct ipw2100_priv *priv, +static inline int ipw2100_alloc_skb(struct ipw2100_priv *priv, struct ipw2100_rx_packet *packet) { packet->skb = dev_alloc_skb(sizeof(struct ipw2100_rx)); @@ -2201,7 +2201,7 @@ static int ipw2100_alloc_skb(struct ipw2100_priv *priv, #define SEARCH_SNAPSHOT 1 #define SNAPSHOT_ADDR(ofs) (priv->snapshot[((ofs) >> 12) & 0xff] + ((ofs) & 0xfff)) -static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) +static inline int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) { int i; if (priv->snapshot[0]) @@ -2221,7 +2221,7 @@ static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) return 1; } -static void ipw2100_snapshot_free(struct ipw2100_priv *priv) +static inline void ipw2100_snapshot_free(struct ipw2100_priv *priv) { int i; if (!priv->snapshot[0]) @@ -2231,7 +2231,7 @@ static void ipw2100_snapshot_free(struct ipw2100_priv *priv) priv->snapshot[0] = NULL; } -static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, +static inline u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, size_t len, int mode) { u32 i, j; @@ -2288,7 +2288,7 @@ static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, static u8 packet_data[IPW_RX_NIC_BUFFER_LENGTH]; #endif -static void ipw2100_corruption_detected(struct ipw2100_priv *priv, int i) +static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv, int i) { #ifdef CONFIG_IPW2100_DEBUG_C3 struct ipw2100_status *status = &priv->status_queue.drv[i]; @@ -2346,7 +2346,7 @@ static void ipw2100_corruption_detected(struct ipw2100_priv *priv, int i) schedule_reset(priv); } -static void isr_rx(struct ipw2100_priv *priv, int i, +static inline void isr_rx(struct ipw2100_priv *priv, int i, struct ieee80211_rx_stats *stats) { struct ipw2100_status *status = &priv->status_queue.drv[i]; @@ -2425,7 +2425,7 @@ static void isr_rx(struct ipw2100_priv *priv, int i, priv->rx_queue.drv[i].host_addr = packet->dma_addr; } -static int ipw2100_corruption_check(struct ipw2100_priv *priv, int i) +static inline int ipw2100_corruption_check(struct ipw2100_priv *priv, int i) { struct ipw2100_status *status = &priv->status_queue.drv[i]; struct ipw2100_rx *u = priv->rx_buffers[i].rxp; @@ -2481,7 +2481,7 @@ static int ipw2100_corruption_check(struct ipw2100_priv *priv, int i) * The WRITE index is cached in the variable 'priv->rx_queue.next'. * */ -static void __ipw2100_rx_process(struct ipw2100_priv *priv) +static inline void __ipw2100_rx_process(struct ipw2100_priv *priv) { struct ipw2100_bd_queue *rxq = &priv->rx_queue; struct ipw2100_status_queue *sq = &priv->status_queue; @@ -2634,7 +2634,7 @@ static void __ipw2100_rx_process(struct ipw2100_priv *priv) * for use by future command and data packets. * */ -static int __ipw2100_tx_process(struct ipw2100_priv *priv) +static inline int __ipw2100_tx_process(struct ipw2100_priv *priv) { struct ipw2100_bd_queue *txq = &priv->tx_queue; struct ipw2100_bd *tbd; diff --git a/trunk/drivers/net/wireless/ipw2200.c b/trunk/drivers/net/wireless/ipw2200.c index 819be2b6b7df..cdfe50207757 100644 --- a/trunk/drivers/net/wireless/ipw2200.c +++ b/trunk/drivers/net/wireless/ipw2200.c @@ -813,7 +813,7 @@ static void ipw_bg_led_link_off(void *data) up(&priv->sem); } -static void __ipw_led_activity_on(struct ipw_priv *priv) +static inline void __ipw_led_activity_on(struct ipw_priv *priv) { u32 led; @@ -1508,7 +1508,7 @@ static ssize_t store_direct_dword(struct device *d, static DEVICE_ATTR(direct_dword, S_IWUSR | S_IRUGO, show_direct_dword, store_direct_dword); -static int rf_kill_active(struct ipw_priv *priv) +static inline int rf_kill_active(struct ipw_priv *priv) { if (0 == (ipw_read32(priv, 0x30) & 0x10000)) priv->status |= STATUS_RF_KILL_HW; @@ -2359,7 +2359,7 @@ static inline void eeprom_write_reg(struct ipw_priv *p, u32 data) } /* perform a chip select operation */ -static void eeprom_cs(struct ipw_priv *priv) +static inline void eeprom_cs(struct ipw_priv *priv) { eeprom_write_reg(priv, 0); eeprom_write_reg(priv, EEPROM_BIT_CS); @@ -2368,7 +2368,7 @@ static void eeprom_cs(struct ipw_priv *priv) } /* perform a chip select operation */ -static void eeprom_disable_cs(struct ipw_priv *priv) +static inline void eeprom_disable_cs(struct ipw_priv *priv) { eeprom_write_reg(priv, EEPROM_BIT_CS); eeprom_write_reg(priv, 0); @@ -2475,7 +2475,7 @@ static void ipw_eeprom_init_sram(struct ipw_priv *priv) IPW_DEBUG_TRACE("<<\n"); } -static void ipw_zero_memory(struct ipw_priv *priv, u32 start, u32 count) +static inline void ipw_zero_memory(struct ipw_priv *priv, u32 start, u32 count) { count >>= 2; if (!count) @@ -2772,7 +2772,7 @@ static inline int ipw_alive(struct ipw_priv *priv) return ipw_read32(priv, 0x90) == 0xd55555d5; } -static int ipw_poll_bit(struct ipw_priv *priv, u32 addr, u32 mask, +static inline int ipw_poll_bit(struct ipw_priv *priv, u32 addr, u32 mask, int timeout) { int i = 0; @@ -3150,7 +3150,7 @@ static int ipw_get_fw(struct ipw_priv *priv, #define IPW_RX_BUF_SIZE (3000) -static void ipw_rx_queue_reset(struct ipw_priv *priv, +static inline void ipw_rx_queue_reset(struct ipw_priv *priv, struct ipw_rx_queue *rxq) { unsigned long flags; @@ -3608,7 +3608,7 @@ static void ipw_tx_queue_free(struct ipw_priv *priv) ipw_queue_tx_free(priv, &priv->txq[3]); } -static void ipw_create_bssid(struct ipw_priv *priv, u8 * bssid) +static inline void ipw_create_bssid(struct ipw_priv *priv, u8 * bssid) { /* First 3 bytes are manufacturer */ bssid[0] = priv->mac_addr[0]; @@ -3622,7 +3622,7 @@ static void ipw_create_bssid(struct ipw_priv *priv, u8 * bssid) bssid[0] |= 0x02; /* set local assignment bit (IEEE802) */ } -static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid) +static inline u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid) { struct ipw_station_entry entry; int i; @@ -3655,7 +3655,7 @@ static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid) return i; } -static u8 ipw_find_station(struct ipw_priv *priv, u8 * bssid) +static inline u8 ipw_find_station(struct ipw_priv *priv, u8 * bssid) { int i; @@ -3794,7 +3794,7 @@ static void inline average_init(struct average *avg) memset(avg, 0, sizeof(*avg)); } -static void average_add(struct average *avg, s16 val) +static void inline average_add(struct average *avg, s16 val) { avg->sum -= avg->entries[avg->pos]; avg->sum += val; @@ -3805,7 +3805,7 @@ static void average_add(struct average *avg, s16 val) } } -static s16 average_value(struct average *avg) +static s16 inline average_value(struct average *avg) { if (!unlikely(avg->init)) { if (avg->pos) @@ -3847,7 +3847,7 @@ static void ipw_reset_stats(struct ipw_priv *priv) } -static u32 ipw_get_max_rate(struct ipw_priv *priv) +static inline u32 ipw_get_max_rate(struct ipw_priv *priv) { u32 i = 0x80000000; u32 mask = priv->rates_mask; @@ -4087,7 +4087,7 @@ static void ipw_bg_gather_stats(void *data) * roaming_threshold -> disassociate_threshold, scan and roam for better signal. * Above disassociate threshold, give up and stop scanning. * Roaming is disabled if disassociate_threshold <= roaming_threshold */ -static void ipw_handle_missed_beacon(struct ipw_priv *priv, +static inline void ipw_handle_missed_beacon(struct ipw_priv *priv, int missed_count) { priv->notif_missed_beacons = missed_count; @@ -4157,7 +4157,7 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv, * Handle host notification packet. * Called from interrupt routine */ -static void ipw_rx_notification(struct ipw_priv *priv, +static inline void ipw_rx_notification(struct ipw_priv *priv, struct ipw_rx_notification *notif) { notif->size = le16_to_cpu(notif->size); @@ -5095,7 +5095,7 @@ static int ipw_compatible_rates(struct ipw_priv *priv, return 1; } -static void ipw_copy_rates(struct ipw_supported_rates *dest, +static inline void ipw_copy_rates(struct ipw_supported_rates *dest, const struct ipw_supported_rates *src) { u8 i; @@ -5856,7 +5856,7 @@ static void ipw_debug_config(struct ipw_priv *priv) #define ipw_debug_config(x) do {} while (0) #endif -static void ipw_set_fixed_rate(struct ipw_priv *priv, int mode) +static inline void ipw_set_fixed_rate(struct ipw_priv *priv, int mode) { /* TODO: Verify that this works... */ struct ipw_fixed_rate fr = { @@ -7634,7 +7634,7 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv, } #endif -static int is_network_packet(struct ipw_priv *priv, +static inline int is_network_packet(struct ipw_priv *priv, struct ieee80211_hdr_4addr *header) { /* Filter incoming packets to determine if they are targetted toward @@ -7672,7 +7672,7 @@ static int is_network_packet(struct ipw_priv *priv, #define IPW_PACKET_RETRY_TIME HZ -static int is_duplicate_packet(struct ipw_priv *priv, +static inline int is_duplicate_packet(struct ipw_priv *priv, struct ieee80211_hdr_4addr *header) { u16 sc = le16_to_cpu(header->seq_ctl); @@ -9581,7 +9581,7 @@ static struct iw_statistics *ipw_get_wireless_stats(struct net_device *dev) /* net device stuff */ -static void init_sys_config(struct ipw_sys_config *sys_config) +static inline void init_sys_config(struct ipw_sys_config *sys_config) { memset(sys_config, 0, sizeof(struct ipw_sys_config)); sys_config->bt_coexistence = 1; /* We may need to look into prvStaBtConfig */ @@ -9627,7 +9627,7 @@ modify to send one tfd per fragment instead of using chunking. otherwise we need to heavily modify the ieee80211_skb_to_txb. */ -static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, +static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, int pri) { struct ieee80211_hdr_3addr *hdr = (struct ieee80211_hdr_3addr *) diff --git a/trunk/drivers/net/wireless/wavelan.c b/trunk/drivers/net/wireless/wavelan.c index ff192e96268a..b0d8b5b03152 100644 --- a/trunk/drivers/net/wireless/wavelan.c +++ b/trunk/drivers/net/wireless/wavelan.c @@ -102,7 +102,7 @@ static inline void hacr_write(unsigned long ioaddr, u16 hacr) * Write to card's Host Adapter Command Register. Include a delay for * those times when it is needed. */ -static void hacr_write_slow(unsigned long ioaddr, u16 hacr) +static inline void hacr_write_slow(unsigned long ioaddr, u16 hacr) { hacr_write(ioaddr, hacr); /* delay might only be needed sometimes */ @@ -242,7 +242,7 @@ static void psa_write(unsigned long ioaddr, u16 hacr, int o, /* Offset in PSA */ * The Windows drivers don't use the CRC, but the AP and the PtP tool * depend on it. */ -static u16 psa_crc(u8 * psa, /* The PSA */ +static inline u16 psa_crc(u8 * psa, /* The PSA */ int size) { /* Number of short for CRC */ int byte_cnt; /* Loop on the PSA */ @@ -310,7 +310,7 @@ static void update_psa_checksum(struct net_device * dev, unsigned long ioaddr, u /* * Write 1 byte to the MMC. */ -static void mmc_out(unsigned long ioaddr, u16 o, u8 d) +static inline void mmc_out(unsigned long ioaddr, u16 o, u8 d) { int count = 0; @@ -326,7 +326,7 @@ static void mmc_out(unsigned long ioaddr, u16 o, u8 d) * Routine to write bytes to the Modem Management Controller. * We start at the end because it is the way it should be! */ -static void mmc_write(unsigned long ioaddr, u8 o, u8 * b, int n) +static inline void mmc_write(unsigned long ioaddr, u8 o, u8 * b, int n) { o += n; b += n; @@ -340,7 +340,7 @@ static void mmc_write(unsigned long ioaddr, u8 o, u8 * b, int n) * Read a byte from the MMC. * Optimised version for 1 byte, avoid using memory. */ -static u8 mmc_in(unsigned long ioaddr, u16 o) +static inline u8 mmc_in(unsigned long ioaddr, u16 o) { int count = 0; @@ -587,7 +587,7 @@ static void wv_ack(struct net_device * dev) * Set channel attention bit and busy wait until command has * completed, then acknowledge completion of the command. */ -static int wv_synchronous_cmd(struct net_device * dev, const char *str) +static inline int wv_synchronous_cmd(struct net_device * dev, const char *str) { net_local *lp = (net_local *) dev->priv; unsigned long ioaddr = dev->base_addr; @@ -633,7 +633,7 @@ static int wv_synchronous_cmd(struct net_device * dev, const char *str) * Configuration commands completion interrupt. * Check if done, and if OK. */ -static int +static inline int wv_config_complete(struct net_device * dev, unsigned long ioaddr, net_local * lp) { unsigned short mcs_addr; @@ -843,7 +843,7 @@ if (lp->tx_n_in_use > 0) * wavelan_interrupt is not an option), so you may experience * delays sometimes. */ -static void wv_82586_reconfig(struct net_device * dev) +static inline void wv_82586_reconfig(struct net_device * dev) { net_local *lp = (net_local *) dev->priv; unsigned long flags; @@ -1281,7 +1281,7 @@ static inline void wv_packet_info(u8 * p, /* Packet to dump */ * This is the information which is displayed by the driver at startup. * There are lots of flags for configuring it to your liking. */ -static void wv_init_info(struct net_device * dev) +static inline void wv_init_info(struct net_device * dev) { short ioaddr = dev->base_addr; net_local *lp = (net_local *) dev->priv; @@ -1502,7 +1502,7 @@ static int wavelan_set_mac_address(struct net_device * dev, void *addr) * It's a bit complicated and you don't really want to look into it. * (called in wavelan_ioctl) */ -static int wv_set_frequency(unsigned long ioaddr, /* I/O port of the card */ +static inline int wv_set_frequency(unsigned long ioaddr, /* I/O port of the card */ iw_freq * frequency) { const int BAND_NUM = 10; /* Number of bands */ @@ -1677,7 +1677,7 @@ static int wv_set_frequency(unsigned long ioaddr, /* I/O port of the card */ /* * Give the list of available frequencies. */ -static int wv_frequency_list(unsigned long ioaddr, /* I/O port of the card */ +static inline int wv_frequency_list(unsigned long ioaddr, /* I/O port of the card */ iw_freq * list, /* List of frequencies to fill */ int max) { /* Maximum number of frequencies */ @@ -2489,7 +2489,7 @@ static iw_stats *wavelan_get_wireless_stats(struct net_device * dev) * Note: if any errors occur, the packet is "dropped on the floor". * (called by wv_packet_rcv()) */ -static void +static inline void wv_packet_read(struct net_device * dev, u16 buf_off, int sksize) { net_local *lp = (net_local *) dev->priv; @@ -2585,7 +2585,7 @@ wv_packet_read(struct net_device * dev, u16 buf_off, int sksize) * (called in wavelan_interrupt()). * Note : the spinlock is already grabbed for us. */ -static void wv_receive(struct net_device * dev) +static inline void wv_receive(struct net_device * dev) { unsigned long ioaddr = dev->base_addr; net_local *lp = (net_local *) dev->priv; @@ -2768,7 +2768,7 @@ static void wv_receive(struct net_device * dev) * * (called in wavelan_packet_xmit()) */ -static int wv_packet_write(struct net_device * dev, void *buf, short length) +static inline int wv_packet_write(struct net_device * dev, void *buf, short length) { net_local *lp = (net_local *) dev->priv; unsigned long ioaddr = dev->base_addr; @@ -2964,7 +2964,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev) * Routine to initialize the Modem Management Controller. * (called by wv_hw_reset()) */ -static int wv_mmc_init(struct net_device * dev) +static inline int wv_mmc_init(struct net_device * dev) { unsigned long ioaddr = dev->base_addr; net_local *lp = (net_local *) dev->priv; @@ -3136,7 +3136,7 @@ static int wv_mmc_init(struct net_device * dev) * Start the receive unit. * (called by wv_hw_reset()) */ -static int wv_ru_start(struct net_device * dev) +static inline int wv_ru_start(struct net_device * dev) { net_local *lp = (net_local *) dev->priv; unsigned long ioaddr = dev->base_addr; @@ -3228,7 +3228,7 @@ static int wv_ru_start(struct net_device * dev) * * (called by wv_hw_reset()) */ -static int wv_cu_start(struct net_device * dev) +static inline int wv_cu_start(struct net_device * dev) { net_local *lp = (net_local *) dev->priv; unsigned long ioaddr = dev->base_addr; @@ -3329,7 +3329,7 @@ static int wv_cu_start(struct net_device * dev) * * (called by wv_hw_reset()) */ -static int wv_82586_start(struct net_device * dev) +static inline int wv_82586_start(struct net_device * dev) { net_local *lp = (net_local *) dev->priv; unsigned long ioaddr = dev->base_addr; @@ -3641,7 +3641,7 @@ static void wv_82586_config(struct net_device * dev) * WaveLAN controller (i82586). * (called by wavelan_close()) */ -static void wv_82586_stop(struct net_device * dev) +static inline void wv_82586_stop(struct net_device * dev) { net_local *lp = (net_local *) dev->priv; unsigned long ioaddr = dev->base_addr; diff --git a/trunk/drivers/s390/block/dasd.c b/trunk/drivers/s390/block/dasd.c index ef4c687e7c01..9c25654b1e75 100644 --- a/trunk/drivers/s390/block/dasd.c +++ b/trunk/drivers/s390/block/dasd.c @@ -1635,7 +1635,7 @@ dasd_setup_queue(struct dasd_device * device) blk_queue_max_hw_segments(device->request_queue, -1L); blk_queue_max_segment_size(device->request_queue, -1L); blk_queue_segment_boundary(device->request_queue, -1L); - blk_queue_ordered(device->request_queue, QUEUE_ORDERED_TAG, NULL); + blk_queue_ordered(device->request_queue, 1); } /* diff --git a/trunk/drivers/s390/cio/airq.c b/trunk/drivers/s390/cio/airq.c index cd2cc28e16a7..83e6a060668e 100644 --- a/trunk/drivers/s390/cio/airq.c +++ b/trunk/drivers/s390/cio/airq.c @@ -2,12 +2,12 @@ * drivers/s390/cio/airq.c * S/390 common I/O routines -- support for adapter interruptions * - * $Revision: 1.15 $ + * $Revision: 1.12 $ * * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Ingo Adlung (adlung@de.ibm.com) - * Cornelia Huck (cornelia.huck@de.ibm.com) + * Cornelia Huck (cohuck@de.ibm.com) * Arnd Bergmann (arndb@de.ibm.com) */ diff --git a/trunk/drivers/s390/cio/blacklist.c b/trunk/drivers/s390/cio/blacklist.c index 72f27c151c09..daf21e03b21d 100644 --- a/trunk/drivers/s390/cio/blacklist.c +++ b/trunk/drivers/s390/cio/blacklist.c @@ -1,12 +1,12 @@ /* * drivers/s390/cio/blacklist.c * S/390 common I/O routines -- blacklisting of specific devices - * $Revision: 1.42 $ + * $Revision: 1.39 $ * * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Ingo Adlung (adlung@de.ibm.com) - * Cornelia Huck (cornelia.huck@de.ibm.com) + * Cornelia Huck (cohuck@de.ibm.com) * Arnd Bergmann (arndb@de.ibm.com) */ diff --git a/trunk/drivers/s390/cio/ccwgroup.c b/trunk/drivers/s390/cio/ccwgroup.c index 6c077ad71edc..503a568e47c3 100644 --- a/trunk/drivers/s390/cio/ccwgroup.c +++ b/trunk/drivers/s390/cio/ccwgroup.c @@ -1,12 +1,12 @@ /* * drivers/s390/cio/ccwgroup.c * bus driver for ccwgroup - * $Revision: 1.35 $ + * $Revision: 1.33 $ * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Arnd Bergmann (arndb@de.ibm.com) - * Cornelia Huck (cornelia.huck@de.ibm.com) + * Cornelia Huck (cohuck@de.ibm.com) */ #include #include diff --git a/trunk/drivers/s390/cio/chsc.c b/trunk/drivers/s390/cio/chsc.c index 2cbb724791a8..7270808c02d1 100644 --- a/trunk/drivers/s390/cio/chsc.c +++ b/trunk/drivers/s390/cio/chsc.c @@ -1,12 +1,12 @@ /* * drivers/s390/cio/chsc.c * S/390 common I/O routines -- channel subsystem call - * $Revision: 1.128 $ + * $Revision: 1.126 $ * * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Ingo Adlung (adlung@de.ibm.com) - * Cornelia Huck (cornelia.huck@de.ibm.com) + * Cornelia Huck (cohuck@de.ibm.com) * Arnd Bergmann (arndb@de.ibm.com) */ diff --git a/trunk/drivers/s390/cio/cio.c b/trunk/drivers/s390/cio/cio.c index 6223b06d27d5..7376bc87206d 100644 --- a/trunk/drivers/s390/cio/cio.c +++ b/trunk/drivers/s390/cio/cio.c @@ -1,12 +1,12 @@ /* * drivers/s390/cio/cio.c * S/390 common I/O routines -- low level i/o calls - * $Revision: 1.140 $ + * $Revision: 1.138 $ * * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Ingo Adlung (adlung@de.ibm.com) - * Cornelia Huck (cornelia.huck@de.ibm.com) + * Cornelia Huck (cohuck@de.ibm.com) * Arnd Bergmann (arndb@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com) */ diff --git a/trunk/drivers/s390/cio/css.c b/trunk/drivers/s390/cio/css.c index 516108779f60..2d319fb812ca 100644 --- a/trunk/drivers/s390/cio/css.c +++ b/trunk/drivers/s390/cio/css.c @@ -1,12 +1,12 @@ /* * drivers/s390/cio/css.c * driver for channel subsystem - * $Revision: 1.96 $ + * $Revision: 1.93 $ * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Arnd Bergmann (arndb@de.ibm.com) - * Cornelia Huck (cornelia.huck@de.ibm.com) + * Cornelia Huck (cohuck@de.ibm.com) */ #include #include diff --git a/trunk/drivers/s390/cio/css.h b/trunk/drivers/s390/cio/css.h index b6375861cb37..aa5ab5d4547c 100644 --- a/trunk/drivers/s390/cio/css.h +++ b/trunk/drivers/s390/cio/css.h @@ -147,7 +147,7 @@ extern int for_each_subchannel(int(*fn)(struct subchannel_id, void *), void *); struct channel_subsystem { u8 cssid; int valid; - struct channel_path *chps[__MAX_CHPID + 1]; + struct channel_path *chps[__MAX_CHPID]; struct device device; struct pgid global_pgid; }; diff --git a/trunk/drivers/s390/cio/device.c b/trunk/drivers/s390/cio/device.c index a67e7e60e330..eb73605a0527 100644 --- a/trunk/drivers/s390/cio/device.c +++ b/trunk/drivers/s390/cio/device.c @@ -1,12 +1,12 @@ /* * drivers/s390/cio/device.c * bus driver for ccw devices - * $Revision: 1.140 $ + * $Revision: 1.137 $ * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Arnd Bergmann (arndb@de.ibm.com) - * Cornelia Huck (cornelia.huck@de.ibm.com) + * Cornelia Huck (cohuck@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com) */ #include diff --git a/trunk/drivers/s390/cio/device_fsm.c b/trunk/drivers/s390/cio/device_fsm.c index b302779e7cff..23d12b65e5fa 100644 --- a/trunk/drivers/s390/cio/device_fsm.c +++ b/trunk/drivers/s390/cio/device_fsm.c @@ -4,7 +4,7 @@ * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation - * Author(s): Cornelia Huck (cornelia.huck@de.ibm.com) + * Author(s): Cornelia Huck(cohuck@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com) */ diff --git a/trunk/drivers/s390/cio/device_id.c b/trunk/drivers/s390/cio/device_id.c index e60b2d8103b8..04ceba343db8 100644 --- a/trunk/drivers/s390/cio/device_id.c +++ b/trunk/drivers/s390/cio/device_id.c @@ -3,7 +3,7 @@ * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation - * Author(s): Cornelia Huck (cornelia.huck@de.ibm.com) + * Author(s): Cornelia Huck(cohuck@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com) * * Sense ID functions. diff --git a/trunk/drivers/s390/cio/device_ops.c b/trunk/drivers/s390/cio/device_ops.c index 8b0218949b62..143b6c25a4e6 100644 --- a/trunk/drivers/s390/cio/device_ops.c +++ b/trunk/drivers/s390/cio/device_ops.c @@ -1,12 +1,12 @@ /* * drivers/s390/cio/device_ops.c * - * $Revision: 1.61 $ + * $Revision: 1.58 $ * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) - * Cornelia Huck (cornelia.huck@de.ibm.com) + * Cornelia Huck (cohuck@de.ibm.com) */ #include #include diff --git a/trunk/drivers/s390/cio/device_pgid.c b/trunk/drivers/s390/cio/device_pgid.c index d2a5b04d7cba..052832d03d38 100644 --- a/trunk/drivers/s390/cio/device_pgid.c +++ b/trunk/drivers/s390/cio/device_pgid.c @@ -3,7 +3,7 @@ * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation - * Author(s): Cornelia Huck (cornelia.huck@de.ibm.com) + * Author(s): Cornelia Huck(cohuck@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com) * * Path Group ID functions. diff --git a/trunk/drivers/s390/cio/device_status.c b/trunk/drivers/s390/cio/device_status.c index dad4dd9887c9..db09c209098b 100644 --- a/trunk/drivers/s390/cio/device_status.c +++ b/trunk/drivers/s390/cio/device_status.c @@ -3,7 +3,7 @@ * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation - * Author(s): Cornelia Huck (cornelia.huck@de.ibm.com) + * Author(s): Cornelia Huck(cohuck@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com) * * Status accumulation and basic sense functions. diff --git a/trunk/drivers/s390/cio/qdio.c b/trunk/drivers/s390/cio/qdio.c index 77be2c39bfe4..30a836ffc31f 100644 --- a/trunk/drivers/s390/cio/qdio.c +++ b/trunk/drivers/s390/cio/qdio.c @@ -7,7 +7,7 @@ * * Copyright 2000,2002 IBM Corporation * Author(s): Utz Bacher - * 2.6 cio integration by Cornelia Huck + * 2.6 cio integration by Cornelia Huck * * Restriction: only 63 iqdio subchannels would have its own indicator, * after that, subsequent subchannels share one indicator @@ -56,7 +56,7 @@ #include "ioasm.h" #include "chsc.h" -#define VERSION_QDIO_C "$Revision: 1.117 $" +#define VERSION_QDIO_C "$Revision: 1.114 $" /****************** MODULE PARAMETER VARIABLES ********************/ MODULE_AUTHOR("Utz Bacher "); diff --git a/trunk/drivers/s390/net/ctcmain.c b/trunk/drivers/s390/net/ctcmain.c index 1901feef07d9..0db4f57a6a95 100644 --- a/trunk/drivers/s390/net/ctcmain.c +++ b/trunk/drivers/s390/net/ctcmain.c @@ -1,5 +1,5 @@ /* - * $Id: ctcmain.c,v 1.79 2006/01/11 11:32:18 cohuck Exp $ + * $Id: ctcmain.c,v 1.78 2005/09/07 12:18:02 pavlic Exp $ * * CTC / ESCON network driver * @@ -8,7 +8,7 @@ * Fixes by : Jochen Röhrig (roehrig@de.ibm.com) * Arnaldo Carvalho de Melo Peter Tiedemann (ptiedem@de.ibm.com) - * Driver Model stuff by : Cornelia Huck + * Driver Model stuff by : Cornelia Huck * * Documentation used: * - Principles of Operation (IBM doc#: SA22-7201-06) @@ -37,7 +37,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.79 $ + * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.78 $ * */ #undef DEBUG @@ -248,7 +248,7 @@ static void print_banner(void) { static int printed = 0; - char vbuf[] = "$Revision: 1.79 $"; + char vbuf[] = "$Revision: 1.78 $"; char *version = vbuf; if (printed) diff --git a/trunk/drivers/s390/net/cu3088.c b/trunk/drivers/s390/net/cu3088.c index 2014fb7a4881..77dacb465732 100644 --- a/trunk/drivers/s390/net/cu3088.c +++ b/trunk/drivers/s390/net/cu3088.c @@ -1,11 +1,11 @@ /* - * $Id: cu3088.c,v 1.38 2006/01/12 14:33:09 cohuck Exp $ + * $Id: cu3088.c,v 1.36 2005/10/25 14:37:17 cohuck Exp $ * * CTC / LCS ccw_device driver * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Arnd Bergmann - * Cornelia Huck + * Cornelia Huck * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/trunk/drivers/s390/net/netiucv.c b/trunk/drivers/s390/net/netiucv.c index ac4c4b83fe17..69425a7a6e98 100644 --- a/trunk/drivers/s390/net/netiucv.c +++ b/trunk/drivers/s390/net/netiucv.c @@ -1,13 +1,12 @@ /* - * $Id: netiucv.c,v 1.69 2006/01/12 14:33:09 cohuck Exp $ + * $Id: netiucv.c,v 1.66 2005/05/11 08:10:17 holzheu Exp $ * * IUCV network driver * * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Fritz Elfert (elfert@de.ibm.com, felfert@millenux.com) * - * Sysfs integration and all bugs therein by Cornelia Huck - * (cornelia.huck@de.ibm.com) + * Driverfs integration and all bugs therein by Cornelia Huck(cohuck@de.ibm.com) * * Documentation used: * the source of the original IUCV driver by: @@ -31,7 +30,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * RELEASE-TAG: IUCV network driver $Revision: 1.69 $ + * RELEASE-TAG: IUCV network driver $Revision: 1.66 $ * */ @@ -2077,7 +2076,7 @@ DRIVER_ATTR(remove, 0200, NULL, remove_write); static void netiucv_banner(void) { - char vbuf[] = "$Revision: 1.69 $"; + char vbuf[] = "$Revision: 1.66 $"; char *version = vbuf; if ((version = strchr(version, ':'))) { diff --git a/trunk/drivers/s390/s390_rdev.c b/trunk/drivers/s390/s390_rdev.c index 206518c7d332..566cc3d185b6 100644 --- a/trunk/drivers/s390/s390_rdev.c +++ b/trunk/drivers/s390/s390_rdev.c @@ -1,11 +1,11 @@ /* * drivers/s390/s390_rdev.c * s390 root device - * $Revision: 1.4 $ + * $Revision: 1.2 $ * * Copyright (C) 2002, 2005 IBM Deutschland Entwicklung GmbH, * IBM Corporation - * Author(s): Cornelia Huck (cornelia.huck@de.ibm.com) + * Author(s): Cornelia Huck (cohuck@de.ibm.com) * Carsten Otte (cotte@de.ibm.com) */ diff --git a/trunk/drivers/scsi/aic7xxx_old.c b/trunk/drivers/scsi/aic7xxx_old.c index 770f1647e4d6..33d56c344944 100644 --- a/trunk/drivers/scsi/aic7xxx_old.c +++ b/trunk/drivers/scsi/aic7xxx_old.c @@ -1290,7 +1290,7 @@ static void aic7xxx_check_scbs(struct aic7xxx_host *p, char *buffer); * ***************************************************************************/ -static unsigned char +static inline unsigned char aic_inb(struct aic7xxx_host *p, long port) { #ifdef MMAPIO @@ -1309,7 +1309,7 @@ aic_inb(struct aic7xxx_host *p, long port) #endif } -static void +static inline void aic_outb(struct aic7xxx_host *p, unsigned char val, long port) { #ifdef MMAPIO diff --git a/trunk/drivers/scsi/iscsi_tcp.c b/trunk/drivers/scsi/iscsi_tcp.c index 780bfcc67096..1b495afe6d17 100644 --- a/trunk/drivers/scsi/iscsi_tcp.c +++ b/trunk/drivers/scsi/iscsi_tcp.c @@ -1418,7 +1418,7 @@ iscsi_data_digest_init(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) ctask->digest_count = 4; } -static int +static inline int iscsi_digest_final_send(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask, struct iscsi_buf *buf, uint32_t *digest, int final) { diff --git a/trunk/drivers/scsi/libata-core.c b/trunk/drivers/scsi/libata-core.c index 99bae8369ab2..f55b9b3f7b37 100644 --- a/trunk/drivers/scsi/libata-core.c +++ b/trunk/drivers/scsi/libata-core.c @@ -1747,7 +1747,7 @@ static const struct { { ATA_SHIFT_PIO, XFER_PIO_0 }, }; -static u8 base_from_shift(unsigned int shift) +static inline u8 base_from_shift(unsigned int shift) { int i; diff --git a/trunk/drivers/scsi/megaraid/megaraid_mbox.c b/trunk/drivers/scsi/megaraid/megaraid_mbox.c index bf9f7f7ba354..d18a4bc2498c 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_mbox.c +++ b/trunk/drivers/scsi/megaraid/megaraid_mbox.c @@ -1266,7 +1266,7 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter) * return the scb from the head of the free list. NULL if there are none * available **/ -static scb_t * +static inline scb_t * megaraid_alloc_scb(adapter_t *adapter, struct scsi_cmnd *scp) { struct list_head *head = &adapter->kscb_pool; @@ -1329,7 +1329,7 @@ megaraid_dealloc_scb(adapter_t *adapter, scb_t *scb) * * prepare the scatter-gather list */ -static int +static inline int megaraid_mbox_mksgl(adapter_t *adapter, scb_t *scb) { struct scatterlist *sgl; @@ -1402,7 +1402,7 @@ megaraid_mbox_mksgl(adapter_t *adapter, scb_t *scb) * * post the command to the controller if mailbox is availble. */ -static int +static inline int mbox_post_cmd(adapter_t *adapter, scb_t *scb) { mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); @@ -2070,7 +2070,7 @@ megaraid_mbox_prepare_epthru(adapter_t *adapter, scb_t *scb, * * Returns: 1 if the interrupt is valid, 0 otherwise */ -static int +static inline int megaraid_ack_sequence(adapter_t *adapter) { mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); @@ -2208,7 +2208,7 @@ megaraid_isr(int irq, void *devp, struct pt_regs *regs) * * DMA sync if required. */ -static void +static inline void megaraid_mbox_sync_scb(adapter_t *adapter, scb_t *scb) { mbox_ccb_t *ccb; diff --git a/trunk/drivers/scsi/megaraid/megaraid_sas.c b/trunk/drivers/scsi/megaraid/megaraid_sas.c index 511ed52a5807..c0bb8061401f 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_sas.c +++ b/trunk/drivers/scsi/megaraid/megaraid_sas.c @@ -81,7 +81,7 @@ static DEFINE_MUTEX(megasas_async_queue_mutex); * * Returns a free command from the pool */ -static struct megasas_cmd *megasas_get_cmd(struct megasas_instance +static inline struct megasas_cmd *megasas_get_cmd(struct megasas_instance *instance) { unsigned long flags; @@ -263,7 +263,7 @@ megasas_issue_blocked_abort_cmd(struct megasas_instance *instance, * If successful, this function returns the number of SG elements. Otherwise, * it returnes -1. */ -static int +static inline int megasas_make_sgl32(struct megasas_instance *instance, struct scsi_cmnd *scp, union megasas_sgl *mfi_sgl) { @@ -311,7 +311,7 @@ megasas_make_sgl32(struct megasas_instance *instance, struct scsi_cmnd *scp, * If successful, this function returns the number of SG elements. Otherwise, * it returnes -1. */ -static int +static inline int megasas_make_sgl64(struct megasas_instance *instance, struct scsi_cmnd *scp, union megasas_sgl *mfi_sgl) { @@ -360,7 +360,7 @@ megasas_make_sgl64(struct megasas_instance *instance, struct scsi_cmnd *scp, * This function prepares CDB commands. These are typcially pass-through * commands to the devices. */ -static int +static inline int megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp, struct megasas_cmd *cmd) { @@ -441,7 +441,7 @@ megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp, * * Frames (and accompanying SGLs) for regular SCSI IOs use this function. */ -static int +static inline int megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp, struct megasas_cmd *cmd) { @@ -563,7 +563,7 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp, * @scp: SCSI command * @frame_count: [OUT] Number of frames used to prepare this command */ -static struct megasas_cmd *megasas_build_cmd(struct megasas_instance +static inline struct megasas_cmd *megasas_build_cmd(struct megasas_instance *instance, struct scsi_cmnd *scp, int *frame_count) @@ -914,7 +914,7 @@ megasas_complete_abort(struct megasas_instance *instance, * @instance: Adapter soft state * @cmd: Completed command */ -static void +static inline void megasas_unmap_sgbuf(struct megasas_instance *instance, struct megasas_cmd *cmd) { dma_addr_t buf_h; @@ -958,7 +958,7 @@ megasas_unmap_sgbuf(struct megasas_instance *instance, struct megasas_cmd *cmd) * an alternate status (as in the case of aborted * commands) */ -static void +static inline void megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, u8 alt_status) { @@ -1105,7 +1105,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, * SCSI mid-layer instead of the status * returned by the FW */ -static int +static inline int megasas_deplete_reply_queue(struct megasas_instance *instance, u8 alt_status) { u32 status; diff --git a/trunk/drivers/scsi/sr.c b/trunk/drivers/scsi/sr.c index 997f8e30509b..dd8050392d01 100644 --- a/trunk/drivers/scsi/sr.c +++ b/trunk/drivers/scsi/sr.c @@ -151,7 +151,7 @@ static inline struct scsi_cd *scsi_cd_get(struct gendisk *disk) return cd; } -static void scsi_cd_put(struct scsi_cd *cd) +static inline void scsi_cd_put(struct scsi_cd *cd) { struct scsi_device *sdev = cd->device; diff --git a/trunk/drivers/serial/8250.c b/trunk/drivers/serial/8250.c index d9ce8c549416..fb610c3634a4 100644 --- a/trunk/drivers/serial/8250.c +++ b/trunk/drivers/serial/8250.c @@ -2454,7 +2454,6 @@ static struct platform_driver serial8250_isa_driver = { .resume = serial8250_resume, .driver = { .name = "serial8250", - .owner = THIS_MODULE, }, }; @@ -2595,30 +2594,21 @@ static int __init serial8250_init(void) if (ret) goto out; - ret = platform_driver_register(&serial8250_isa_driver); - if (ret) - goto unreg_uart_drv; - - serial8250_isa_devs = platform_device_alloc("serial8250", - PLAT8250_DEV_LEGACY); - if (!serial8250_isa_devs) { - ret = -ENOMEM; - goto unreg_plat_drv; + serial8250_isa_devs = platform_device_register_simple("serial8250", + PLAT8250_DEV_LEGACY, NULL, 0); + if (IS_ERR(serial8250_isa_devs)) { + ret = PTR_ERR(serial8250_isa_devs); + goto unreg; } - ret = platform_device_add(serial8250_isa_devs); - if (ret) - goto put_dev; - serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev); - goto out; + ret = platform_driver_register(&serial8250_isa_driver); + if (ret == 0) + goto out; - put_dev: - platform_device_put(serial8250_isa_devs); - unreg_plat_drv: - platform_driver_unregister(&serial8250_isa_driver); - unreg_uart_drv: + platform_device_unregister(serial8250_isa_devs); + unreg: uart_unregister_driver(&serial8250_reg); out: return ret; diff --git a/trunk/drivers/serial/Kconfig b/trunk/drivers/serial/Kconfig index 5e7199f7b59c..843717275d49 100644 --- a/trunk/drivers/serial/Kconfig +++ b/trunk/drivers/serial/Kconfig @@ -190,6 +190,7 @@ config SERIAL_8250_BOCA To compile this driver as a module, choose M here: the module will be called 8250_boca. + config SERIAL_8250_HUB6 tristate "Support Hub6 cards" depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS @@ -847,7 +848,7 @@ config SERIAL_M32R_SIO_CONSOLE config SERIAL_M32R_PLDSIO bool "M32R SIO I/F on a PLD" - depends on SERIAL_M32R_SIO=y && (PLAT_OPSPUT || PLAT_USRV || PLAT_M32700UT) + depends on SERIAL_M32R_SIO=y && (PLAT_OPSPUT || PALT_USRV || PLAT_M32700UT) default n help Say Y here if you want to use the M32R serial controller @@ -916,12 +917,4 @@ config SERIAL_SGI_IOC4 and wish to use the serial ports on this card, say Y. Otherwise, say N. -config SERIAL_SGI_IOC3 - tristate "SGI Altix IOC3 serial support" - depends on (IA64_GENERIC || IA64_SGI_SN2) && SGI_IOC3 - select SERIAL_CORE - help - If you have an SGI Altix with an IOC3 serial card, - say Y or M. Otherwise, say N. - endmenu diff --git a/trunk/drivers/serial/Makefile b/trunk/drivers/serial/Makefile index eaf8e01db198..24a583e482bb 100644 --- a/trunk/drivers/serial/Makefile +++ b/trunk/drivers/serial/Makefile @@ -56,5 +56,4 @@ obj-$(CONFIG_SERIAL_JSM) += jsm/ obj-$(CONFIG_SERIAL_TXX9) += serial_txx9.o obj-$(CONFIG_SERIAL_VR41XX) += vr41xx_siu.o obj-$(CONFIG_SERIAL_SGI_IOC4) += ioc4_serial.o -obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o obj-$(CONFIG_SERIAL_AT91) += at91_serial.o diff --git a/trunk/drivers/serial/imx.c b/trunk/drivers/serial/imx.c index 587cc6a95114..5c098be9346b 100644 --- a/trunk/drivers/serial/imx.c +++ b/trunk/drivers/serial/imx.c @@ -499,7 +499,7 @@ imx_set_termios(struct uart_port *port, struct termios *termios, ucr2 |= UCR2_STPB; if (termios->c_cflag & PARENB) { ucr2 |= UCR2_PREN; - if (termios->c_cflag & PARODD) + if (!(termios->c_cflag & PARODD)) ucr2 |= UCR2_PROE; } diff --git a/trunk/drivers/serial/ioc3_serial.c b/trunk/drivers/serial/ioc3_serial.c deleted file mode 100644 index 8097cd91f16b..000000000000 --- a/trunk/drivers/serial/ioc3_serial.c +++ /dev/null @@ -1,2197 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved. - */ - -/* - * This file contains a module version of the ioc3 serial driver. This - * includes all the support functions needed (support functions, etc.) - * and the serial driver itself. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Interesting things about the ioc3 - */ - -#define LOGICAL_PORTS 2 /* rs232(0) and rs422(1) */ -#define PORTS_PER_CARD 2 -#define LOGICAL_PORTS_PER_CARD (PORTS_PER_CARD * LOGICAL_PORTS) -#define MAX_CARDS 8 -#define MAX_LOGICAL_PORTS (LOGICAL_PORTS_PER_CARD * MAX_CARDS) - -/* determine given the sio_ir what port it applies to */ -#define GET_PORT_FROM_SIO_IR(_x) (_x & SIO_IR_SA) ? 0 : 1 - - -/* - * we have 2 logical ports (rs232, rs422) for each physical port - * evens are rs232, odds are rs422 - */ -#define GET_PHYSICAL_PORT(_x) ((_x) >> 1) -#define GET_LOGICAL_PORT(_x) ((_x) & 1) -#define IS_PHYSICAL_PORT(_x) !((_x) & 1) -#define IS_RS232(_x) !((_x) & 1) - -static unsigned int Num_of_ioc3_cards; -static unsigned int Submodule_slot; - -/* defining this will get you LOTS of great debug info */ -//#define DEBUG_INTERRUPTS -#define DPRINT_CONFIG(_x...) ; -//#define DPRINT_CONFIG(_x...) printk _x -#define NOT_PROGRESS() ; -//#define NOT_PROGRESS() printk("%s : fails %d\n", __FUNCTION__, __LINE__) - -/* number of characters we want to transmit to the lower level at a time */ -#define MAX_CHARS 256 -#define FIFO_SIZE (MAX_CHARS-1) /* it's a uchar */ - -/* Device name we're using */ -#define DEVICE_NAME "ttySIOC" -#define DEVICE_MAJOR 204 -#define DEVICE_MINOR 116 - -/* flags for next_char_state */ -#define NCS_BREAK 0x1 -#define NCS_PARITY 0x2 -#define NCS_FRAMING 0x4 -#define NCS_OVERRUN 0x8 - -/* cause we need SOME parameters ... */ -#define MIN_BAUD_SUPPORTED 1200 -#define MAX_BAUD_SUPPORTED 115200 - -/* protocol types supported */ -#define PROTO_RS232 0 -#define PROTO_RS422 1 - -/* Notification types */ -#define N_DATA_READY 0x01 -#define N_OUTPUT_LOWAT 0x02 -#define N_BREAK 0x04 -#define N_PARITY_ERROR 0x08 -#define N_FRAMING_ERROR 0x10 -#define N_OVERRUN_ERROR 0x20 -#define N_DDCD 0x40 -#define N_DCTS 0x80 - -#define N_ALL_INPUT (N_DATA_READY | N_BREAK \ - | N_PARITY_ERROR | N_FRAMING_ERROR \ - | N_OVERRUN_ERROR | N_DDCD | N_DCTS) - -#define N_ALL_OUTPUT N_OUTPUT_LOWAT - -#define N_ALL_ERRORS (N_PARITY_ERROR | N_FRAMING_ERROR \ - | N_OVERRUN_ERROR) - -#define N_ALL (N_DATA_READY | N_OUTPUT_LOWAT | N_BREAK \ - | N_PARITY_ERROR | N_FRAMING_ERROR \ - | N_OVERRUN_ERROR | N_DDCD | N_DCTS) - -#define SER_CLK_SPEED(prediv) ((22000000 << 1) / prediv) -#define SER_DIVISOR(x, clk) (((clk) + (x) * 8) / ((x) * 16)) -#define DIVISOR_TO_BAUD(div, clk) ((clk) / 16 / (div)) - -/* Some masks */ -#define LCR_MASK_BITS_CHAR (UART_LCR_WLEN5 | UART_LCR_WLEN6 \ - | UART_LCR_WLEN7 | UART_LCR_WLEN8) -#define LCR_MASK_STOP_BITS (UART_LCR_STOP) - -#define PENDING(_a, _p) (readl(&(_p)->vma->sio_ir) & (_a)->ic_enable) - -#define RING_BUF_SIZE 4096 -#define BUF_SIZE_BIT SBBR_L_SIZE -#define PROD_CONS_MASK PROD_CONS_PTR_4K - -#define TOTAL_RING_BUF_SIZE (RING_BUF_SIZE * 4) - -/* driver specific - one per card */ -struct ioc3_card { - struct { - /* uart ports are allocated here */ - struct uart_port icp_uart_port[LOGICAL_PORTS]; - /* the ioc3_port used for this port */ - struct ioc3_port *icp_port; - } ic_port[PORTS_PER_CARD]; - /* currently enabled interrupts */ - uint32_t ic_enable; -}; - -/* Local port info for each IOC3 serial port */ -struct ioc3_port { - /* handy reference material */ - struct uart_port *ip_port; - struct ioc3_card *ip_card; - struct ioc3_driver_data *ip_idd; - struct ioc3_submodule *ip_is; - - /* pci mem addresses for this port */ - struct ioc3_serialregs __iomem *ip_serial_regs; - struct ioc3_uartregs __iomem *ip_uart_regs; - - /* Ring buffer page for this port */ - dma_addr_t ip_dma_ringbuf; - /* vaddr of ring buffer */ - struct ring_buffer *ip_cpu_ringbuf; - - /* Rings for this port */ - struct ring *ip_inring; - struct ring *ip_outring; - - /* Hook to port specific values */ - struct port_hooks *ip_hooks; - - spinlock_t ip_lock; - - /* Various rx/tx parameters */ - int ip_baud; - int ip_tx_lowat; - int ip_rx_timeout; - - /* Copy of notification bits */ - int ip_notify; - - /* Shadow copies of various registers so we don't need to PIO - * read them constantly - */ - uint32_t ip_sscr; - uint32_t ip_tx_prod; - uint32_t ip_rx_cons; - unsigned char ip_flags; -}; - -/* tx low water mark. We need to notify the driver whenever tx is getting - * close to empty so it can refill the tx buffer and keep things going. - * Let's assume that if we interrupt 1 ms before the tx goes idle, we'll - * have no trouble getting in more chars in time (I certainly hope so). - */ -#define TX_LOWAT_LATENCY 1000 -#define TX_LOWAT_HZ (1000000 / TX_LOWAT_LATENCY) -#define TX_LOWAT_CHARS(baud) (baud / 10 / TX_LOWAT_HZ) - -/* Flags per port */ -#define INPUT_HIGH 0x01 - /* used to signify that we have turned off the rx_high - * temporarily - we need to drain the fifo and don't - * want to get blasted with interrupts. - */ -#define DCD_ON 0x02 - /* DCD state is on */ -#define LOWAT_WRITTEN 0x04 -#define READ_ABORTED 0x08 - /* the read was aborted - used to avaoid infinate looping - * in the interrupt handler - */ -#define INPUT_ENABLE 0x10 - -/* Since each port has different register offsets and bitmasks - * for everything, we'll store those that we need in tables so we - * don't have to be constantly checking the port we are dealing with. - */ -struct port_hooks { - uint32_t intr_delta_dcd; - uint32_t intr_delta_cts; - uint32_t intr_tx_mt; - uint32_t intr_rx_timer; - uint32_t intr_rx_high; - uint32_t intr_tx_explicit; - uint32_t intr_clear; - uint32_t intr_all; - char rs422_select_pin; -}; - -static struct port_hooks hooks_array[PORTS_PER_CARD] = { - /* values for port A */ - { - .intr_delta_dcd = SIO_IR_SA_DELTA_DCD, - .intr_delta_cts = SIO_IR_SA_DELTA_CTS, - .intr_tx_mt = SIO_IR_SA_TX_MT, - .intr_rx_timer = SIO_IR_SA_RX_TIMER, - .intr_rx_high = SIO_IR_SA_RX_HIGH, - .intr_tx_explicit = SIO_IR_SA_TX_EXPLICIT, - .intr_clear = (SIO_IR_SA_TX_MT | SIO_IR_SA_RX_FULL - | SIO_IR_SA_RX_HIGH - | SIO_IR_SA_RX_TIMER - | SIO_IR_SA_DELTA_DCD - | SIO_IR_SA_DELTA_CTS - | SIO_IR_SA_INT - | SIO_IR_SA_TX_EXPLICIT - | SIO_IR_SA_MEMERR), - .intr_all = SIO_IR_SA, - .rs422_select_pin = GPPR_UARTA_MODESEL_PIN, - }, - - /* values for port B */ - { - .intr_delta_dcd = SIO_IR_SB_DELTA_DCD, - .intr_delta_cts = SIO_IR_SB_DELTA_CTS, - .intr_tx_mt = SIO_IR_SB_TX_MT, - .intr_rx_timer = SIO_IR_SB_RX_TIMER, - .intr_rx_high = SIO_IR_SB_RX_HIGH, - .intr_tx_explicit = SIO_IR_SB_TX_EXPLICIT, - .intr_clear = (SIO_IR_SB_TX_MT | SIO_IR_SB_RX_FULL - | SIO_IR_SB_RX_HIGH - | SIO_IR_SB_RX_TIMER - | SIO_IR_SB_DELTA_DCD - | SIO_IR_SB_DELTA_CTS - | SIO_IR_SB_INT - | SIO_IR_SB_TX_EXPLICIT - | SIO_IR_SB_MEMERR), - .intr_all = SIO_IR_SB, - .rs422_select_pin = GPPR_UARTB_MODESEL_PIN, - } -}; - -struct ring_entry { - union { - struct { - uint32_t alldata; - uint32_t allsc; - } all; - struct { - char data[4]; /* data bytes */ - char sc[4]; /* status/control */ - } s; - } u; -}; - -/* Test the valid bits in any of the 4 sc chars using "allsc" member */ -#define RING_ANY_VALID \ - ((uint32_t)(RXSB_MODEM_VALID | RXSB_DATA_VALID) * 0x01010101) - -#define ring_sc u.s.sc -#define ring_data u.s.data -#define ring_allsc u.all.allsc - -/* Number of entries per ring buffer. */ -#define ENTRIES_PER_RING (RING_BUF_SIZE / (int) sizeof(struct ring_entry)) - -/* An individual ring */ -struct ring { - struct ring_entry entries[ENTRIES_PER_RING]; -}; - -/* The whole enchilada */ -struct ring_buffer { - struct ring TX_A; - struct ring RX_A; - struct ring TX_B; - struct ring RX_B; -}; - -/* Get a ring from a port struct */ -#define RING(_p, _wh) &(((struct ring_buffer *)((_p)->ip_cpu_ringbuf))->_wh) - -/* for Infinite loop detection */ -#define MAXITER 10000000 - - -/** - * set_baud - Baud rate setting code - * @port: port to set - * @baud: baud rate to use - */ -static int set_baud(struct ioc3_port *port, int baud) -{ - int divisor; - int actual_baud; - int diff; - int lcr, prediv; - struct ioc3_uartregs __iomem *uart; - - for (prediv = 6; prediv < 64; prediv++) { - divisor = SER_DIVISOR(baud, SER_CLK_SPEED(prediv)); - if (!divisor) - continue; /* invalid divisor */ - actual_baud = DIVISOR_TO_BAUD(divisor, SER_CLK_SPEED(prediv)); - - diff = actual_baud - baud; - if (diff < 0) - diff = -diff; - - /* if we're within 1% we've found a match */ - if (diff * 100 <= actual_baud) - break; - } - - /* if the above loop completed, we didn't match - * the baud rate. give up. - */ - if (prediv == 64) { - NOT_PROGRESS(); - return 1; - } - - uart = port->ip_uart_regs; - lcr = readb(&uart->iu_lcr); - - writeb(lcr | UART_LCR_DLAB, &uart->iu_lcr); - writeb((unsigned char)divisor, &uart->iu_dll); - writeb((unsigned char)(divisor >> 8), &uart->iu_dlm); - writeb((unsigned char)prediv, &uart->iu_scr); - writeb((unsigned char)lcr, &uart->iu_lcr); - - return 0; -} - -/** - * get_ioc3_port - given a uart port, return the control structure - * @the_port: uart port to find - */ -static struct ioc3_port *get_ioc3_port(struct uart_port *the_port) -{ - struct ioc3_driver_data *idd = dev_get_drvdata(the_port->dev); - struct ioc3_card *card_ptr = idd->data[Submodule_slot]; - int ii, jj; - - if (!card_ptr) { - NOT_PROGRESS(); - return NULL; - } - for (ii = 0; ii < PORTS_PER_CARD; ii++) { - for (jj = 0; jj < LOGICAL_PORTS; jj++) { - if (the_port == &card_ptr->ic_port[ii].icp_uart_port[jj]) - return card_ptr->ic_port[ii].icp_port; - } - } - NOT_PROGRESS(); - return NULL; -} - -/** - * port_init - Initialize the sio and ioc3 hardware for a given port - * called per port from attach... - * @port: port to initialize - */ -static int inline port_init(struct ioc3_port *port) -{ - uint32_t sio_cr; - struct port_hooks *hooks = port->ip_hooks; - struct ioc3_uartregs __iomem *uart; - int reset_loop_counter = 0xfffff; - struct ioc3_driver_data *idd = port->ip_idd; - - /* Idle the IOC3 serial interface */ - writel(SSCR_RESET, &port->ip_serial_regs->sscr); - - /* Wait until any pending bus activity for this port has ceased */ - do { - sio_cr = readl(&idd->vma->sio_cr); - if (reset_loop_counter-- <= 0) { - printk(KERN_WARNING - "IOC3 unable to come out of reset" - " scr 0x%x\n", sio_cr); - return -1; - } - } while (!(sio_cr & SIO_CR_ARB_DIAG_IDLE) && - (((sio_cr &= SIO_CR_ARB_DIAG) == SIO_CR_ARB_DIAG_TXA) - || sio_cr == SIO_CR_ARB_DIAG_TXB - || sio_cr == SIO_CR_ARB_DIAG_RXA - || sio_cr == SIO_CR_ARB_DIAG_RXB)); - - /* Finish reset sequence */ - writel(0, &port->ip_serial_regs->sscr); - - /* Once RESET is done, reload cached tx_prod and rx_cons values - * and set rings to empty by making prod == cons - */ - port->ip_tx_prod = readl(&port->ip_serial_regs->stcir) & PROD_CONS_MASK; - writel(port->ip_tx_prod, &port->ip_serial_regs->stpir); - port->ip_rx_cons = readl(&port->ip_serial_regs->srpir) & PROD_CONS_MASK; - writel(port->ip_rx_cons | SRCIR_ARM, &port->ip_serial_regs->srcir); - - /* Disable interrupts for this 16550 */ - uart = port->ip_uart_regs; - writeb(0, &uart->iu_lcr); - writeb(0, &uart->iu_ier); - - /* Set the default baud */ - set_baud(port, port->ip_baud); - - /* Set line control to 8 bits no parity */ - writeb(UART_LCR_WLEN8 | 0, &uart->iu_lcr); - /* UART_LCR_STOP == 1 stop */ - - /* Enable the FIFOs */ - writeb(UART_FCR_ENABLE_FIFO, &uart->iu_fcr); - /* then reset 16550 FIFOs */ - writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, - &uart->iu_fcr); - - /* Clear modem control register */ - writeb(0, &uart->iu_mcr); - - /* Clear deltas in modem status register */ - writel(0, &port->ip_serial_regs->shadow); - - /* Only do this once per port pair */ - if (port->ip_hooks == &hooks_array[0]) { - unsigned long ring_pci_addr; - uint32_t __iomem *sbbr_l, *sbbr_h; - - sbbr_l = &idd->vma->sbbr_l; - sbbr_h = &idd->vma->sbbr_h; - ring_pci_addr = (unsigned long __iomem)port->ip_dma_ringbuf; - DPRINT_CONFIG(("%s: ring_pci_addr 0x%p\n", - __FUNCTION__, (void *)ring_pci_addr)); - - writel((unsigned int)((uint64_t) ring_pci_addr >> 32), sbbr_h); - writel((unsigned int)ring_pci_addr | BUF_SIZE_BIT, sbbr_l); - } - - /* Set the receive timeout value to 10 msec */ - writel(SRTR_HZ / 100, &port->ip_serial_regs->srtr); - - /* Set rx threshold, enable DMA */ - /* Set high water mark at 3/4 of full ring */ - port->ip_sscr = (ENTRIES_PER_RING * 3 / 4); - - /* uart experiences pauses at high baud rate reducing actual - * throughput by 10% or so unless we enable high speed polling - * XXX when this hardware bug is resolved we should revert to - * normal polling speed - */ - port->ip_sscr |= SSCR_HIGH_SPD; - - writel(port->ip_sscr, &port->ip_serial_regs->sscr); - - /* Disable and clear all serial related interrupt bits */ - port->ip_card->ic_enable &= ~hooks->intr_clear; - ioc3_disable(port->ip_is, idd, hooks->intr_clear); - ioc3_ack(port->ip_is, idd, hooks->intr_clear); - return 0; -} - -/** - * enable_intrs - enable interrupts - * @port: port to enable - * @mask: mask to use - */ -static void enable_intrs(struct ioc3_port *port, uint32_t mask) -{ - if ((port->ip_card->ic_enable & mask) != mask) { - port->ip_card->ic_enable |= mask; - ioc3_enable(port->ip_is, port->ip_idd, mask); - } -} - -/** - * local_open - local open a port - * @port: port to open - */ -static inline int local_open(struct ioc3_port *port) -{ - int spiniter = 0; - - port->ip_flags = INPUT_ENABLE; - - /* Pause the DMA interface if necessary */ - if (port->ip_sscr & SSCR_DMA_EN) { - writel(port->ip_sscr | SSCR_DMA_PAUSE, - &port->ip_serial_regs->sscr); - while ((readl(&port->ip_serial_regs->sscr) - & SSCR_PAUSE_STATE) == 0) { - spiniter++; - if (spiniter > MAXITER) { - NOT_PROGRESS(); - return -1; - } - } - } - - /* Reset the input fifo. If the uart received chars while the port - * was closed and DMA is not enabled, the uart may have a bunch of - * chars hanging around in its rx fifo which will not be discarded - * by rclr in the upper layer. We must get rid of them here. - */ - writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR, - &port->ip_uart_regs->iu_fcr); - - writeb(UART_LCR_WLEN8, &port->ip_uart_regs->iu_lcr); - /* UART_LCR_STOP == 1 stop */ - - /* Re-enable DMA, set default threshold to intr whenever there is - * data available. - */ - port->ip_sscr &= ~SSCR_RX_THRESHOLD; - port->ip_sscr |= 1; /* default threshold */ - - /* Plug in the new sscr. This implicitly clears the DMA_PAUSE - * flag if it was set above - */ - writel(port->ip_sscr, &port->ip_serial_regs->sscr); - port->ip_tx_lowat = 1; - return 0; -} - -/** - * set_rx_timeout - Set rx timeout and threshold values. - * @port: port to use - * @timeout: timeout value in ticks - */ -static inline int set_rx_timeout(struct ioc3_port *port, int timeout) -{ - int threshold; - - port->ip_rx_timeout = timeout; - - /* Timeout is in ticks. Let's figure out how many chars we - * can receive at the current baud rate in that interval - * and set the rx threshold to that amount. There are 4 chars - * per ring entry, so we'll divide the number of chars that will - * arrive in timeout by 4. - * So .... timeout * baud / 10 / HZ / 4, with HZ = 100. - */ - threshold = timeout * port->ip_baud / 4000; - if (threshold == 0) - threshold = 1; /* otherwise we'll intr all the time! */ - - if ((unsigned)threshold > (unsigned)SSCR_RX_THRESHOLD) - return 1; - - port->ip_sscr &= ~SSCR_RX_THRESHOLD; - port->ip_sscr |= threshold; - writel(port->ip_sscr, &port->ip_serial_regs->sscr); - - /* Now set the rx timeout to the given value - * again timeout * SRTR_HZ / HZ - */ - timeout = timeout * SRTR_HZ / 100; - if (timeout > SRTR_CNT) - timeout = SRTR_CNT; - writel(timeout, &port->ip_serial_regs->srtr); - return 0; -} - -/** - * config_port - config the hardware - * @port: port to config - * @baud: baud rate for the port - * @byte_size: data size - * @stop_bits: number of stop bits - * @parenb: parity enable ? - * @parodd: odd parity ? - */ -static inline int -config_port(struct ioc3_port *port, - int baud, int byte_size, int stop_bits, int parenb, int parodd) -{ - char lcr, sizebits; - int spiniter = 0; - - DPRINT_CONFIG(("%s: line %d baud %d byte_size %d stop %d parenb %d " - "parodd %d\n", - __FUNCTION__, ((struct uart_port *)port->ip_port)->line, - baud, byte_size, stop_bits, parenb, parodd)); - - if (set_baud(port, baud)) - return 1; - - switch (byte_size) { - case 5: - sizebits = UART_LCR_WLEN5; - break; - case 6: - sizebits = UART_LCR_WLEN6; - break; - case 7: - sizebits = UART_LCR_WLEN7; - break; - case 8: - sizebits = UART_LCR_WLEN8; - break; - default: - return 1; - } - - /* Pause the DMA interface if necessary */ - if (port->ip_sscr & SSCR_DMA_EN) { - writel(port->ip_sscr | SSCR_DMA_PAUSE, - &port->ip_serial_regs->sscr); - while ((readl(&port->ip_serial_regs->sscr) - & SSCR_PAUSE_STATE) == 0) { - spiniter++; - if (spiniter > MAXITER) - return -1; - } - } - - /* Clear relevant fields in lcr */ - lcr = readb(&port->ip_uart_regs->iu_lcr); - lcr &= ~(LCR_MASK_BITS_CHAR | UART_LCR_EPAR | - UART_LCR_PARITY | LCR_MASK_STOP_BITS); - - /* Set byte size in lcr */ - lcr |= sizebits; - - /* Set parity */ - if (parenb) { - lcr |= UART_LCR_PARITY; - if (!parodd) - lcr |= UART_LCR_EPAR; - } - - /* Set stop bits */ - if (stop_bits) - lcr |= UART_LCR_STOP /* 2 stop bits */ ; - - writeb(lcr, &port->ip_uart_regs->iu_lcr); - - /* Re-enable the DMA interface if necessary */ - if (port->ip_sscr & SSCR_DMA_EN) { - writel(port->ip_sscr, &port->ip_serial_regs->sscr); - } - port->ip_baud = baud; - - /* When we get within this number of ring entries of filling the - * entire ring on tx, place an EXPLICIT intr to generate a lowat - * notification when output has drained. - */ - port->ip_tx_lowat = (TX_LOWAT_CHARS(baud) + 3) / 4; - if (port->ip_tx_lowat == 0) - port->ip_tx_lowat = 1; - - set_rx_timeout(port, 2); - return 0; -} - -/** - * do_write - Write bytes to the port. Returns the number of bytes - * actually written. Called from transmit_chars - * @port: port to use - * @buf: the stuff to write - * @len: how many bytes in 'buf' - */ -static inline int do_write(struct ioc3_port *port, char *buf, int len) -{ - int prod_ptr, cons_ptr, total = 0; - struct ring *outring; - struct ring_entry *entry; - struct port_hooks *hooks = port->ip_hooks; - - BUG_ON(!(len >= 0)); - - prod_ptr = port->ip_tx_prod; - cons_ptr = readl(&port->ip_serial_regs->stcir) & PROD_CONS_MASK; - outring = port->ip_outring; - - /* Maintain a 1-entry red-zone. The ring buffer is full when - * (cons - prod) % ring_size is 1. Rather than do this subtraction - * in the body of the loop, I'll do it now. - */ - cons_ptr = (cons_ptr - (int)sizeof(struct ring_entry)) & PROD_CONS_MASK; - - /* Stuff the bytes into the output */ - while ((prod_ptr != cons_ptr) && (len > 0)) { - int xx; - - /* Get 4 bytes (one ring entry) at a time */ - entry = (struct ring_entry *)((caddr_t) outring + prod_ptr); - - /* Invalidate all entries */ - entry->ring_allsc = 0; - - /* Copy in some bytes */ - for (xx = 0; (xx < 4) && (len > 0); xx++) { - entry->ring_data[xx] = *buf++; - entry->ring_sc[xx] = TXCB_VALID; - len--; - total++; - } - - /* If we are within some small threshold of filling up the - * entire ring buffer, we must place an EXPLICIT intr here - * to generate a lowat interrupt in case we subsequently - * really do fill up the ring and the caller goes to sleep. - * No need to place more than one though. - */ - if (!(port->ip_flags & LOWAT_WRITTEN) && - ((cons_ptr - prod_ptr) & PROD_CONS_MASK) - <= port->ip_tx_lowat * (int)sizeof(struct ring_entry)) { - port->ip_flags |= LOWAT_WRITTEN; - entry->ring_sc[0] |= TXCB_INT_WHEN_DONE; - } - - /* Go on to next entry */ - prod_ptr += sizeof(struct ring_entry); - prod_ptr &= PROD_CONS_MASK; - } - - /* If we sent something, start DMA if necessary */ - if (total > 0 && !(port->ip_sscr & SSCR_DMA_EN)) { - port->ip_sscr |= SSCR_DMA_EN; - writel(port->ip_sscr, &port->ip_serial_regs->sscr); - } - - /* Store the new producer pointer. If tx is disabled, we stuff the - * data into the ring buffer, but we don't actually start tx. - */ - if (!uart_tx_stopped(port->ip_port)) { - writel(prod_ptr, &port->ip_serial_regs->stpir); - - /* If we are now transmitting, enable tx_mt interrupt so we - * can disable DMA if necessary when the tx finishes. - */ - if (total > 0) - enable_intrs(port, hooks->intr_tx_mt); - } - port->ip_tx_prod = prod_ptr; - - return total; -} - -/** - * disable_intrs - disable interrupts - * @port: port to enable - * @mask: mask to use - */ -static inline void disable_intrs(struct ioc3_port *port, uint32_t mask) -{ - if (port->ip_card->ic_enable & mask) { - ioc3_disable(port->ip_is, port->ip_idd, mask); - port->ip_card->ic_enable &= ~mask; - } -} - -/** - * set_notification - Modify event notification - * @port: port to use - * @mask: events mask - * @set_on: set ? - */ -static int set_notification(struct ioc3_port *port, int mask, int set_on) -{ - struct port_hooks *hooks = port->ip_hooks; - uint32_t intrbits, sscrbits; - - BUG_ON(!mask); - - intrbits = sscrbits = 0; - - if (mask & N_DATA_READY) - intrbits |= (hooks->intr_rx_timer | hooks->intr_rx_high); - if (mask & N_OUTPUT_LOWAT) - intrbits |= hooks->intr_tx_explicit; - if (mask & N_DDCD) { - intrbits |= hooks->intr_delta_dcd; - sscrbits |= SSCR_RX_RING_DCD; - } - if (mask & N_DCTS) - intrbits |= hooks->intr_delta_cts; - - if (set_on) { - enable_intrs(port, intrbits); - port->ip_notify |= mask; - port->ip_sscr |= sscrbits; - } else { - disable_intrs(port, intrbits); - port->ip_notify &= ~mask; - port->ip_sscr &= ~sscrbits; - } - - /* We require DMA if either DATA_READY or DDCD notification is - * currently requested. If neither of these is requested and - * there is currently no tx in progress, DMA may be disabled. - */ - if (port->ip_notify & (N_DATA_READY | N_DDCD)) - port->ip_sscr |= SSCR_DMA_EN; - else if (!(port->ip_card->ic_enable & hooks->intr_tx_mt)) - port->ip_sscr &= ~SSCR_DMA_EN; - - writel(port->ip_sscr, &port->ip_serial_regs->sscr); - return 0; -} - -/** - * set_mcr - set the master control reg - * @the_port: port to use - * @mask1: mcr mask - * @mask2: shadow mask - */ -static inline int set_mcr(struct uart_port *the_port, - int mask1, int mask2) -{ - struct ioc3_port *port = get_ioc3_port(the_port); - uint32_t shadow; - int spiniter = 0; - char mcr; - - if (!port) - return -1; - - /* Pause the DMA interface if necessary */ - if (port->ip_sscr & SSCR_DMA_EN) { - writel(port->ip_sscr | SSCR_DMA_PAUSE, - &port->ip_serial_regs->sscr); - while ((readl(&port->ip_serial_regs->sscr) - & SSCR_PAUSE_STATE) == 0) { - spiniter++; - if (spiniter > MAXITER) - return -1; - } - } - shadow = readl(&port->ip_serial_regs->shadow); - mcr = (shadow & 0xff000000) >> 24; - - /* Set new value */ - mcr |= mask1; - shadow |= mask2; - writeb(mcr, &port->ip_uart_regs->iu_mcr); - writel(shadow, &port->ip_serial_regs->shadow); - - /* Re-enable the DMA interface if necessary */ - if (port->ip_sscr & SSCR_DMA_EN) { - writel(port->ip_sscr, &port->ip_serial_regs->sscr); - } - return 0; -} - -/** - * ioc3_set_proto - set the protocol for the port - * @port: port to use - * @proto: protocol to use - */ -static int ioc3_set_proto(struct ioc3_port *port, int proto) -{ - struct port_hooks *hooks = port->ip_hooks; - - switch (proto) { - default: - case PROTO_RS232: - /* Clear the appropriate GIO pin */ - DPRINT_CONFIG(("%s: rs232\n", __FUNCTION__)); - writel(0, (&port->ip_idd->vma->gppr[0] - + hooks->rs422_select_pin)); - break; - - case PROTO_RS422: - /* Set the appropriate GIO pin */ - DPRINT_CONFIG(("%s: rs422\n", __FUNCTION__)); - writel(1, (&port->ip_idd->vma->gppr[0] - + hooks->rs422_select_pin)); - break; - } - return 0; -} - -/** - * transmit_chars - upper level write, called with the_port->lock - * @the_port: port to write - */ -static void transmit_chars(struct uart_port *the_port) -{ - int xmit_count, tail, head; - int result; - char *start; - struct tty_struct *tty; - struct ioc3_port *port = get_ioc3_port(the_port); - struct uart_info *info; - - if (!the_port) - return; - if (!port) - return; - - info = the_port->info; - tty = info->tty; - - if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) { - /* Nothing to do or hw stopped */ - set_notification(port, N_ALL_OUTPUT, 0); - return; - } - - head = info->xmit.head; - tail = info->xmit.tail; - start = (char *)&info->xmit.buf[tail]; - - /* write out all the data or until the end of the buffer */ - xmit_count = (head < tail) ? (UART_XMIT_SIZE - tail) : (head - tail); - if (xmit_count > 0) { - result = do_write(port, start, xmit_count); - if (result > 0) { - /* booking */ - xmit_count -= result; - the_port->icount.tx += result; - /* advance the pointers */ - tail += result; - tail &= UART_XMIT_SIZE - 1; - info->xmit.tail = tail; - start = (char *)&info->xmit.buf[tail]; - } - } - if (uart_circ_chars_pending(&info->xmit) < WAKEUP_CHARS) - uart_write_wakeup(the_port); - - if (uart_circ_empty(&info->xmit)) { - set_notification(port, N_OUTPUT_LOWAT, 0); - } else { - set_notification(port, N_OUTPUT_LOWAT, 1); - } -} - -/** - * ioc3_change_speed - change the speed of the port - * @the_port: port to change - * @new_termios: new termios settings - * @old_termios: old termios settings - */ -static void -ioc3_change_speed(struct uart_port *the_port, - struct termios *new_termios, struct termios *old_termios) -{ - struct ioc3_port *port = get_ioc3_port(the_port); - unsigned int cflag; - int baud; - int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; - struct uart_info *info = the_port->info; - - cflag = new_termios->c_cflag; - - switch (cflag & CSIZE) { - case CS5: - new_data = 5; - break; - case CS6: - new_data = 6; - break; - case CS7: - new_data = 7; - break; - case CS8: - new_data = 8; - break; - default: - /* cuz we always need a default ... */ - new_data = 5; - break; - } - if (cflag & CSTOPB) { - new_stop = 1; - } - if (cflag & PARENB) { - new_parity_enable = 1; - if (cflag & PARODD) - new_parity = 1; - } - baud = uart_get_baud_rate(the_port, new_termios, old_termios, - MIN_BAUD_SUPPORTED, MAX_BAUD_SUPPORTED); - DPRINT_CONFIG(("%s: returned baud %d for line %d\n", __FUNCTION__, baud, - the_port->line)); - - if (!the_port->fifosize) - the_port->fifosize = FIFO_SIZE; - uart_update_timeout(the_port, cflag, baud); - - the_port->ignore_status_mask = N_ALL_INPUT; - - info->tty->low_latency = 1; - - if (I_IGNPAR(info->tty)) - the_port->ignore_status_mask &= ~(N_PARITY_ERROR - | N_FRAMING_ERROR); - if (I_IGNBRK(info->tty)) { - the_port->ignore_status_mask &= ~N_BREAK; - if (I_IGNPAR(info->tty)) - the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; - } - if (!(cflag & CREAD)) { - /* ignore everything */ - the_port->ignore_status_mask &= ~N_DATA_READY; - } - - if (cflag & CRTSCTS) { - /* enable hardware flow control */ - port->ip_sscr |= SSCR_HFC_EN; - } - else { - /* disable hardware flow control */ - port->ip_sscr &= ~SSCR_HFC_EN; - } - writel(port->ip_sscr, &port->ip_serial_regs->sscr); - - /* Set the configuration and proper notification call */ - DPRINT_CONFIG(("%s : port 0x%p line %d cflag 0%o " - "config_port(baud %d data %d stop %d penable %d " - " parity %d), notification 0x%x\n", - __FUNCTION__, (void *)port, the_port->line, cflag, baud, - new_data, new_stop, new_parity_enable, new_parity, - the_port->ignore_status_mask)); - - if ((config_port(port, baud, /* baud */ - new_data, /* byte size */ - new_stop, /* stop bits */ - new_parity_enable, /* set parity */ - new_parity)) >= 0) { /* parity 1==odd */ - set_notification(port, the_port->ignore_status_mask, 1); - } -} - -/** - * ic3_startup_local - Start up the serial port - returns >= 0 if no errors - * @the_port: Port to operate on - */ -static inline int ic3_startup_local(struct uart_port *the_port) -{ - struct ioc3_port *port; - - if (!the_port) { - NOT_PROGRESS(); - return -1; - } - - port = get_ioc3_port(the_port); - if (!port) { - NOT_PROGRESS(); - return -1; - } - - local_open(port); - - /* set the protocol */ - ioc3_set_proto(port, IS_RS232(the_port->line) ? PROTO_RS232 : - PROTO_RS422); - return 0; -} - -/* - * ioc3_cb_output_lowat - called when the output low water mark is hit - * @port: port to output - */ -static void ioc3_cb_output_lowat(struct ioc3_port *port) -{ - unsigned long pflags; - - /* the_port->lock is set on the call here */ - if (port->ip_port) { - spin_lock_irqsave(&port->ip_port->lock, pflags); - transmit_chars(port->ip_port); - spin_unlock_irqrestore(&port->ip_port->lock, pflags); - } -} - -/* - * ioc3_cb_post_ncs - called for some basic errors - * @port: port to use - * @ncs: event - */ -static void ioc3_cb_post_ncs(struct uart_port *the_port, int ncs) -{ - struct uart_icount *icount; - - icount = &the_port->icount; - - if (ncs & NCS_BREAK) - icount->brk++; - if (ncs & NCS_FRAMING) - icount->frame++; - if (ncs & NCS_OVERRUN) - icount->overrun++; - if (ncs & NCS_PARITY) - icount->parity++; -} - -/** - * do_read - Read in bytes from the port. Return the number of bytes - * actually read. - * @the_port: port to use - * @buf: place to put the stuff we read - * @len: how big 'buf' is - */ - -static inline int do_read(struct uart_port *the_port, char *buf, int len) -{ - int prod_ptr, cons_ptr, total; - struct ioc3_port *port = get_ioc3_port(the_port); - struct ring *inring; - struct ring_entry *entry; - struct port_hooks *hooks = port->ip_hooks; - int byte_num; - char *sc; - int loop_counter; - - BUG_ON(!(len >= 0)); - BUG_ON(!port); - - /* There is a nasty timing issue in the IOC3. When the rx_timer - * expires or the rx_high condition arises, we take an interrupt. - * At some point while servicing the interrupt, we read bytes from - * the ring buffer and re-arm the rx_timer. However the rx_timer is - * not started until the first byte is received *after* it is armed, - * and any bytes pending in the rx construction buffers are not drained - * to memory until either there are 4 bytes available or the rx_timer - * expires. This leads to a potential situation where data is left - * in the construction buffers forever - 1 to 3 bytes were received - * after the interrupt was generated but before the rx_timer was - * re-armed. At that point as long as no subsequent bytes are received - * the timer will never be started and the bytes will remain in the - * construction buffer forever. The solution is to execute a DRAIN - * command after rearming the timer. This way any bytes received before - * the DRAIN will be drained to memory, and any bytes received after - * the DRAIN will start the TIMER and be drained when it expires. - * Luckily, this only needs to be done when the DMA buffer is empty - * since there is no requirement that this function return all - * available data as long as it returns some. - */ - /* Re-arm the timer */ - - writel(port->ip_rx_cons | SRCIR_ARM, &port->ip_serial_regs->srcir); - - prod_ptr = readl(&port->ip_serial_regs->srpir) & PROD_CONS_MASK; - cons_ptr = port->ip_rx_cons; - - if (prod_ptr == cons_ptr) { - int reset_dma = 0; - - /* Input buffer appears empty, do a flush. */ - - /* DMA must be enabled for this to work. */ - if (!(port->ip_sscr & SSCR_DMA_EN)) { - port->ip_sscr |= SSCR_DMA_EN; - reset_dma = 1; - } - - /* Potential race condition: we must reload the srpir after - * issuing the drain command, otherwise we could think the rx - * buffer is empty, then take a very long interrupt, and when - * we come back it's full and we wait forever for the drain to - * complete. - */ - writel(port->ip_sscr | SSCR_RX_DRAIN, - &port->ip_serial_regs->sscr); - prod_ptr = readl(&port->ip_serial_regs->srpir) & PROD_CONS_MASK; - - /* We must not wait for the DRAIN to complete unless there are - * at least 8 bytes (2 ring entries) available to receive the - * data otherwise the DRAIN will never complete and we'll - * deadlock here. - * In fact, to make things easier, I'll just ignore the flush if - * there is any data at all now available. - */ - if (prod_ptr == cons_ptr) { - loop_counter = 0; - while (readl(&port->ip_serial_regs->sscr) & - SSCR_RX_DRAIN) { - loop_counter++; - if (loop_counter > MAXITER) - return -1; - } - - /* SIGH. We have to reload the prod_ptr *again* since - * the drain may have caused it to change - */ - prod_ptr = readl(&port->ip_serial_regs->srpir) - & PROD_CONS_MASK; - } - if (reset_dma) { - port->ip_sscr &= ~SSCR_DMA_EN; - writel(port->ip_sscr, &port->ip_serial_regs->sscr); - } - } - inring = port->ip_inring; - port->ip_flags &= ~READ_ABORTED; - - total = 0; - loop_counter = 0xfffff; /* to avoid hangs */ - - /* Grab bytes from the hardware */ - while ((prod_ptr != cons_ptr) && (len > 0)) { - entry = (struct ring_entry *)((caddr_t) inring + cons_ptr); - - if (loop_counter-- <= 0) { - printk(KERN_WARNING "IOC3 serial: " - "possible hang condition/" - "port stuck on read (line %d).\n", - the_port->line); - break; - } - - /* According to the producer pointer, this ring entry - * must contain some data. But if the PIO happened faster - * than the DMA, the data may not be available yet, so let's - * wait until it arrives. - */ - if ((entry->ring_allsc & RING_ANY_VALID) == 0) { - /* Indicate the read is aborted so we don't disable - * the interrupt thinking that the consumer is - * congested. - */ - port->ip_flags |= READ_ABORTED; - len = 0; - break; - } - - /* Load the bytes/status out of the ring entry */ - for (byte_num = 0; byte_num < 4 && len > 0; byte_num++) { - sc = &(entry->ring_sc[byte_num]); - - /* Check for change in modem state or overrun */ - if ((*sc & RXSB_MODEM_VALID) - && (port->ip_notify & N_DDCD)) { - /* Notify upper layer if DCD dropped */ - if ((port->ip_flags & DCD_ON) - && !(*sc & RXSB_DCD)) { - /* If we have already copied some data, - * return it. We'll pick up the carrier - * drop on the next pass. That way we - * don't throw away the data that has - * already been copied back to - * the caller's buffer. - */ - if (total > 0) { - len = 0; - break; - } - port->ip_flags &= ~DCD_ON; - - /* Turn off this notification so the - * carrier drop protocol won't see it - * again when it does a read. - */ - *sc &= ~RXSB_MODEM_VALID; - - /* To keep things consistent, we need - * to update the consumer pointer so - * the next reader won't come in and - * try to read the same ring entries - * again. This must be done here before - * the dcd change. - */ - - if ((entry->ring_allsc & RING_ANY_VALID) - == 0) { - cons_ptr += (int)sizeof - (struct ring_entry); - cons_ptr &= PROD_CONS_MASK; - } - writel(cons_ptr, - &port->ip_serial_regs->srcir); - port->ip_rx_cons = cons_ptr; - - /* Notify upper layer of carrier drop */ - if ((port->ip_notify & N_DDCD) - && port->ip_port) { - uart_handle_dcd_change - (port->ip_port, 0); - wake_up_interruptible - (&the_port->info-> - delta_msr_wait); - } - - /* If we had any data to return, we - * would have returned it above. - */ - return 0; - } - } - if (*sc & RXSB_MODEM_VALID) { - /* Notify that an input overrun occurred */ - if ((*sc & RXSB_OVERRUN) - && (port->ip_notify & N_OVERRUN_ERROR)) { - ioc3_cb_post_ncs(the_port, NCS_OVERRUN); - } - /* Don't look at this byte again */ - *sc &= ~RXSB_MODEM_VALID; - } - - /* Check for valid data or RX errors */ - if ((*sc & RXSB_DATA_VALID) && - ((*sc & (RXSB_PAR_ERR - | RXSB_FRAME_ERR | RXSB_BREAK)) - && (port->ip_notify & (N_PARITY_ERROR - | N_FRAMING_ERROR - | N_BREAK)))) { - /* There is an error condition on the next byte. - * If we have already transferred some bytes, - * we'll stop here. Otherwise if this is the - * first byte to be read, we'll just transfer - * it alone after notifying the - * upper layer of its status. - */ - if (total > 0) { - len = 0; - break; - } else { - if ((*sc & RXSB_PAR_ERR) && - (port-> - ip_notify & N_PARITY_ERROR)) { - ioc3_cb_post_ncs(the_port, - NCS_PARITY); - } - if ((*sc & RXSB_FRAME_ERR) && - (port-> - ip_notify & N_FRAMING_ERROR)) { - ioc3_cb_post_ncs(the_port, - NCS_FRAMING); - } - if ((*sc & RXSB_BREAK) - && (port->ip_notify & N_BREAK)) { - ioc3_cb_post_ncs - (the_port, NCS_BREAK); - } - len = 1; - } - } - if (*sc & RXSB_DATA_VALID) { - *sc &= ~RXSB_DATA_VALID; - *buf = entry->ring_data[byte_num]; - buf++; - len--; - total++; - } - } - - /* If we used up this entry entirely, go on to the next one, - * otherwise we must have run out of buffer space, so - * leave the consumer pointer here for the next read in case - * there are still unread bytes in this entry. - */ - if ((entry->ring_allsc & RING_ANY_VALID) == 0) { - cons_ptr += (int)sizeof(struct ring_entry); - cons_ptr &= PROD_CONS_MASK; - } - } - - /* Update consumer pointer and re-arm rx timer interrupt */ - writel(cons_ptr, &port->ip_serial_regs->srcir); - port->ip_rx_cons = cons_ptr; - - /* If we have now dipped below the rx high water mark and we have - * rx_high interrupt turned off, we can now turn it back on again. - */ - if ((port->ip_flags & INPUT_HIGH) && (((prod_ptr - cons_ptr) - & PROD_CONS_MASK) < - ((port-> - ip_sscr & - SSCR_RX_THRESHOLD) - << PROD_CONS_PTR_OFF))) { - port->ip_flags &= ~INPUT_HIGH; - enable_intrs(port, hooks->intr_rx_high); - } - return total; -} - -/** - * receive_chars - upper level read. - * @the_port: port to read from - */ -static int receive_chars(struct uart_port *the_port) -{ - struct tty_struct *tty; - unsigned char ch[MAX_CHARS]; - int read_count = 0, read_room, flip = 0; - struct uart_info *info = the_port->info; - struct ioc3_port *port = get_ioc3_port(the_port); - unsigned long pflags; - - /* Make sure all the pointers are "good" ones */ - if (!info) - return 0; - if (!info->tty) - return 0; - - if (!(port->ip_flags & INPUT_ENABLE)) - return 0; - - spin_lock_irqsave(&the_port->lock, pflags); - tty = info->tty; - - read_count = do_read(the_port, ch, MAX_CHARS); - if (read_count > 0) { - flip = 1; - read_room = tty_buffer_request_room(tty, read_count); - tty_insert_flip_string(tty, ch, read_room); - the_port->icount.rx += read_count; - } - spin_unlock_irqrestore(&the_port->lock, pflags); - - if (flip) - tty_flip_buffer_push(tty); - - return read_count; -} - -/** - * ioc3uart_intr_one - lowest level (per port) interrupt handler. - * @is : submodule - * @idd: driver data - * @pending: interrupts to handle - * @regs: pt_regs - */ - -static int inline -ioc3uart_intr_one(struct ioc3_submodule *is, - struct ioc3_driver_data *idd, - unsigned int pending, struct pt_regs *regs) -{ - int port_num = GET_PORT_FROM_SIO_IR(pending); - struct port_hooks *hooks; - unsigned int rx_high_rd_aborted = 0; - unsigned long flags; - struct uart_port *the_port; - struct ioc3_port *port; - int loop_counter; - struct ioc3_card *card_ptr; - unsigned int sio_ir; - - card_ptr = idd->data[is->id]; - port = card_ptr->ic_port[port_num].icp_port; - hooks = port->ip_hooks; - - /* Possible race condition here: The tx_mt interrupt bit may be - * cleared without the intervention of the interrupt handler, - * e.g. by a write. If the top level interrupt handler reads a - * tx_mt, then some other processor does a write, starting up - * output, then we come in here, see the tx_mt and stop DMA, the - * output started by the other processor will hang. Thus we can - * only rely on tx_mt being legitimate if it is read while the - * port lock is held. Therefore this bit must be ignored in the - * passed in interrupt mask which was read by the top level - * interrupt handler since the port lock was not held at the time - * it was read. We can only rely on this bit being accurate if it - * is read while the port lock is held. So we'll clear it for now, - * and reload it later once we have the port lock. - */ - - sio_ir = pending & ~(hooks->intr_tx_mt); - spin_lock_irqsave(&port->ip_lock, flags); - - loop_counter = MAXITER; /* to avoid hangs */ - - do { - uint32_t shadow; - - if (loop_counter-- <= 0) { - printk(KERN_WARNING "IOC3 serial: " - "possible hang condition/" - "port stuck on interrupt (line %d).\n", - ((struct uart_port *)port->ip_port)->line); - break; - } - /* Handle a DCD change */ - if (sio_ir & hooks->intr_delta_dcd) { - ioc3_ack(is, idd, hooks->intr_delta_dcd); - shadow = readl(&port->ip_serial_regs->shadow); - - if ((port->ip_notify & N_DDCD) - && (shadow & SHADOW_DCD) - && (port->ip_port)) { - the_port = port->ip_port; - uart_handle_dcd_change(the_port, - shadow & SHADOW_DCD); - wake_up_interruptible - (&the_port->info->delta_msr_wait); - } else if ((port->ip_notify & N_DDCD) - && !(shadow & SHADOW_DCD)) { - /* Flag delta DCD/no DCD */ - uart_handle_dcd_change(port->ip_port, - shadow & SHADOW_DCD); - port->ip_flags |= DCD_ON; - } - } - - /* Handle a CTS change */ - if (sio_ir & hooks->intr_delta_cts) { - ioc3_ack(is, idd, hooks->intr_delta_cts); - shadow = readl(&port->ip_serial_regs->shadow); - - if ((port->ip_notify & N_DCTS) && (port->ip_port)) { - the_port = port->ip_port; - uart_handle_cts_change(the_port, shadow - & SHADOW_CTS); - wake_up_interruptible - (&the_port->info->delta_msr_wait); - } - } - - /* rx timeout interrupt. Must be some data available. Put this - * before the check for rx_high since servicing this condition - * may cause that condition to clear. - */ - if (sio_ir & hooks->intr_rx_timer) { - ioc3_ack(is, idd, hooks->intr_rx_timer); - if ((port->ip_notify & N_DATA_READY) - && (port->ip_port)) { - receive_chars(port->ip_port); - } - } - - /* rx high interrupt. Must be after rx_timer. */ - else if (sio_ir & hooks->intr_rx_high) { - /* Data available, notify upper layer */ - if ((port->ip_notify & N_DATA_READY) && port->ip_port) { - receive_chars(port->ip_port); - } - - /* We can't ACK this interrupt. If receive_chars didn't - * cause the condition to clear, we'll have to disable - * the interrupt until the data is drained. - * If the read was aborted, don't disable the interrupt - * as this may cause us to hang indefinitely. An - * aborted read generally means that this interrupt - * hasn't been delivered to the cpu yet anyway, even - * though we see it as asserted when we read the sio_ir. - */ - if ((sio_ir = PENDING(card_ptr, idd)) - & hooks->intr_rx_high) { - if (port->ip_flags & READ_ABORTED) { - rx_high_rd_aborted++; - } - else { - card_ptr->ic_enable &= ~hooks->intr_rx_high; - port->ip_flags |= INPUT_HIGH; - } - } - } - - /* We got a low water interrupt: notify upper layer to - * send more data. Must come before tx_mt since servicing - * this condition may cause that condition to clear. - */ - if (sio_ir & hooks->intr_tx_explicit) { - port->ip_flags &= ~LOWAT_WRITTEN; - ioc3_ack(is, idd, hooks->intr_tx_explicit); - if (port->ip_notify & N_OUTPUT_LOWAT) - ioc3_cb_output_lowat(port); - } - - /* Handle tx_mt. Must come after tx_explicit. */ - else if (sio_ir & hooks->intr_tx_mt) { - /* If we are expecting a lowat notification - * and we get to this point it probably means that for - * some reason the tx_explicit didn't work as expected - * (that can legitimately happen if the output buffer is - * filled up in just the right way). - * So send the notification now. - */ - if (port->ip_notify & N_OUTPUT_LOWAT) { - ioc3_cb_output_lowat(port); - - /* We need to reload the sio_ir since the lowat - * call may have caused another write to occur, - * clearing the tx_mt condition. - */ - sio_ir = PENDING(card_ptr, idd); - } - - /* If the tx_mt condition still persists even after the - * lowat call, we've got some work to do. - */ - if (sio_ir & hooks->intr_tx_mt) { - /* If we are not currently expecting DMA input, - * and the transmitter has just gone idle, - * there is no longer any reason for DMA, so - * disable it. - */ - if (!(port->ip_notify - & (N_DATA_READY | N_DDCD))) { - BUG_ON(!(port->ip_sscr - & SSCR_DMA_EN)); - port->ip_sscr &= ~SSCR_DMA_EN; - writel(port->ip_sscr, - &port->ip_serial_regs->sscr); - } - /* Prevent infinite tx_mt interrupt */ - card_ptr->ic_enable &= ~hooks->intr_tx_mt; - } - } - sio_ir = PENDING(card_ptr, idd); - - /* if the read was aborted and only hooks->intr_rx_high, - * clear hooks->intr_rx_high, so we do not loop forever. - */ - - if (rx_high_rd_aborted && (sio_ir == hooks->intr_rx_high)) { - sio_ir &= ~hooks->intr_rx_high; - } - } while (sio_ir & hooks->intr_all); - - spin_unlock_irqrestore(&port->ip_lock, flags); - ioc3_enable(is, idd, card_ptr->ic_enable); - return 0; -} - -/** - * ioc3uart_intr - field all serial interrupts - * @is : submodule - * @idd: driver data - * @pending: interrupts to handle - * @regs: pt_regs - * - */ - -static int ioc3uart_intr(struct ioc3_submodule *is, - struct ioc3_driver_data *idd, - unsigned int pending, struct pt_regs *regs) -{ - int ret = 0; - - /* - * The upper level interrupt handler sends interrupts for both ports - * here. So we need to call for each port with its interrupts. - */ - - if (pending & SIO_IR_SA) - ret |= ioc3uart_intr_one(is, idd, pending & SIO_IR_SA, regs); - if (pending & SIO_IR_SB) - ret |= ioc3uart_intr_one(is, idd, pending & SIO_IR_SB, regs); - - return ret; -} - -/** - * ic3_type - * @port: Port to operate with (we ignore since we only have one port) - * - */ -static const char *ic3_type(struct uart_port *the_port) -{ - if (IS_RS232(the_port->line)) - return "SGI IOC3 Serial [rs232]"; - else - return "SGI IOC3 Serial [rs422]"; -} - -/** - * ic3_tx_empty - Is the transmitter empty? - * @port: Port to operate on - * - */ -static unsigned int ic3_tx_empty(struct uart_port *the_port) -{ - unsigned int ret = 0; - struct ioc3_port *port = get_ioc3_port(the_port); - - if (readl(&port->ip_serial_regs->shadow) & SHADOW_TEMT) - ret = TIOCSER_TEMT; - return ret; -} - -/** - * ic3_stop_tx - stop the transmitter - * @port: Port to operate on - * - */ -static void ic3_stop_tx(struct uart_port *the_port) -{ - struct ioc3_port *port = get_ioc3_port(the_port); - - if (port) - set_notification(port, N_OUTPUT_LOWAT, 0); -} - -/** - * ic3_stop_rx - stop the receiver - * @port: Port to operate on - * - */ -static void ic3_stop_rx(struct uart_port *the_port) -{ - struct ioc3_port *port = get_ioc3_port(the_port); - - if (port) - port->ip_flags &= ~INPUT_ENABLE; -} - -/** - * null_void_function - * @port: Port to operate on - * - */ -static void null_void_function(struct uart_port *the_port) -{ -} - -/** - * ic3_shutdown - shut down the port - free irq and disable - * @port: port to shut down - * - */ -static void ic3_shutdown(struct uart_port *the_port) -{ - unsigned long port_flags; - struct ioc3_port *port; - struct uart_info *info; - - port = get_ioc3_port(the_port); - if (!port) - return; - - info = the_port->info; - wake_up_interruptible(&info->delta_msr_wait); - - spin_lock_irqsave(&the_port->lock, port_flags); - set_notification(port, N_ALL, 0); - spin_unlock_irqrestore(&the_port->lock, port_flags); -} - -/** - * ic3_set_mctrl - set control lines (dtr, rts, etc) - * @port: Port to operate on - * @mctrl: Lines to set/unset - * - */ -static void ic3_set_mctrl(struct uart_port *the_port, unsigned int mctrl) -{ - unsigned char mcr = 0; - - if (mctrl & TIOCM_RTS) - mcr |= UART_MCR_RTS; - if (mctrl & TIOCM_DTR) - mcr |= UART_MCR_DTR; - if (mctrl & TIOCM_OUT1) - mcr |= UART_MCR_OUT1; - if (mctrl & TIOCM_OUT2) - mcr |= UART_MCR_OUT2; - if (mctrl & TIOCM_LOOP) - mcr |= UART_MCR_LOOP; - - set_mcr(the_port, mcr, SHADOW_DTR); -} - -/** - * ic3_get_mctrl - get control line info - * @port: port to operate on - * - */ -static unsigned int ic3_get_mctrl(struct uart_port *the_port) -{ - struct ioc3_port *port = get_ioc3_port(the_port); - uint32_t shadow; - unsigned int ret = 0; - - if (!port) - return 0; - - shadow = readl(&port->ip_serial_regs->shadow); - if (shadow & SHADOW_DCD) - ret |= TIOCM_CD; - if (shadow & SHADOW_DR) - ret |= TIOCM_DSR; - if (shadow & SHADOW_CTS) - ret |= TIOCM_CTS; - return ret; -} - -/** - * ic3_start_tx - Start transmitter. Called with the_port->lock - * @port: Port to operate on - * - */ -static void ic3_start_tx(struct uart_port *the_port) -{ - struct ioc3_port *port = get_ioc3_port(the_port); - - if (port) { - set_notification(port, N_OUTPUT_LOWAT, 1); - enable_intrs(port, port->ip_hooks->intr_tx_mt); - } -} - -/** - * ic3_break_ctl - handle breaks - * @port: Port to operate on - * @break_state: Break state - * - */ -static void ic3_break_ctl(struct uart_port *the_port, int break_state) -{ -} - -/** - * ic3_startup - Start up the serial port - always return 0 (We're always on) - * @port: Port to operate on - * - */ -static int ic3_startup(struct uart_port *the_port) -{ - int retval; - struct ioc3_port *port; - struct ioc3_card *card_ptr; - unsigned long port_flags; - - if (!the_port) { - NOT_PROGRESS(); - return -ENODEV; - } - port = get_ioc3_port(the_port); - if (!port) { - NOT_PROGRESS(); - return -ENODEV; - } - card_ptr = port->ip_card; - port->ip_port = the_port; - - if (!card_ptr) { - NOT_PROGRESS(); - return -ENODEV; - } - - /* Start up the serial port */ - spin_lock_irqsave(&the_port->lock, port_flags); - retval = ic3_startup_local(the_port); - spin_unlock_irqrestore(&the_port->lock, port_flags); - return retval; -} - -/** - * ic3_set_termios - set termios stuff - * @port: port to operate on - * @termios: New settings - * @termios: Old - * - */ -static void -ic3_set_termios(struct uart_port *the_port, - struct termios *termios, struct termios *old_termios) -{ - unsigned long port_flags; - - spin_lock_irqsave(&the_port->lock, port_flags); - ioc3_change_speed(the_port, termios, old_termios); - spin_unlock_irqrestore(&the_port->lock, port_flags); -} - -/** - * ic3_request_port - allocate resources for port - no op.... - * @port: port to operate on - * - */ -static int ic3_request_port(struct uart_port *port) -{ - return 0; -} - -/* Associate the uart functions above - given to serial core */ -static struct uart_ops ioc3_ops = { - .tx_empty = ic3_tx_empty, - .set_mctrl = ic3_set_mctrl, - .get_mctrl = ic3_get_mctrl, - .stop_tx = ic3_stop_tx, - .start_tx = ic3_start_tx, - .stop_rx = ic3_stop_rx, - .enable_ms = null_void_function, - .break_ctl = ic3_break_ctl, - .startup = ic3_startup, - .shutdown = ic3_shutdown, - .set_termios = ic3_set_termios, - .type = ic3_type, - .release_port = null_void_function, - .request_port = ic3_request_port, -}; - -/* - * Boot-time initialization code - */ - -static struct uart_driver ioc3_uart = { - .owner = THIS_MODULE, - .driver_name = "ioc3_serial", - .dev_name = DEVICE_NAME, - .major = DEVICE_MAJOR, - .minor = DEVICE_MINOR, - .nr = MAX_LOGICAL_PORTS -}; - -/** - * ioc3_serial_core_attach - register with serial core - * This is done during pci probing - * @is: submodule struct for this - * @idd: handle for this card - */ -static inline int ioc3_serial_core_attach( struct ioc3_submodule *is, - struct ioc3_driver_data *idd) -{ - struct ioc3_port *port; - struct uart_port *the_port; - struct ioc3_card *card_ptr = idd->data[is->id]; - int ii, phys_port; - struct pci_dev *pdev = idd->pdev; - - DPRINT_CONFIG(("%s: attach pdev 0x%p - card_ptr 0x%p\n", - __FUNCTION__, pdev, (void *)card_ptr)); - - if (!card_ptr) - return -ENODEV; - - /* once around for each logical port on this card */ - for (ii = 0; ii < LOGICAL_PORTS_PER_CARD; ii++) { - phys_port = GET_PHYSICAL_PORT(ii); - the_port = &card_ptr->ic_port[phys_port]. - icp_uart_port[GET_LOGICAL_PORT(ii)]; - port = card_ptr->ic_port[phys_port].icp_port; - port->ip_port = the_port; - - DPRINT_CONFIG(("%s: attach the_port 0x%p / port 0x%p [%d/%d]\n", - __FUNCTION__, (void *)the_port, (void *)port, - phys_port, ii)); - - /* membase, iobase and mapbase just need to be non-0 */ - the_port->membase = (unsigned char __iomem *)1; - the_port->iobase = (pdev->bus->number << 16) | ii; - the_port->line = (Num_of_ioc3_cards << 2) | ii; - the_port->mapbase = 1; - the_port->type = PORT_16550A; - the_port->fifosize = FIFO_SIZE; - the_port->ops = &ioc3_ops; - the_port->irq = idd->irq_io; - the_port->dev = &pdev->dev; - - if (uart_add_one_port(&ioc3_uart, the_port) < 0) { - printk(KERN_WARNING - "%s: unable to add port %d bus %d\n", - __FUNCTION__, the_port->line, pdev->bus->number); - } else { - DPRINT_CONFIG(("IOC3 serial port %d irq %d bus %d\n", - the_port->line, the_port->irq, pdev->bus->number)); - } - - /* all ports are rs232 for now */ - if (IS_PHYSICAL_PORT(ii)) - ioc3_set_proto(port, PROTO_RS232); - } - return 0; -} - -/** - * ioc3uart_remove - register detach function - * @is: submodule struct for this submodule - * @idd: ioc3 driver data for this submodule - */ - -static int ioc3uart_remove(struct ioc3_submodule *is, - struct ioc3_driver_data *idd) -{ - struct ioc3_card *card_ptr = idd->data[is->id]; - struct uart_port *the_port; - struct ioc3_port *port; - int ii; - - if (card_ptr) { - for (ii = 0; ii < LOGICAL_PORTS_PER_CARD; ii++) { - the_port = &card_ptr->ic_port[GET_PHYSICAL_PORT(ii)]. - icp_uart_port[GET_LOGICAL_PORT(ii)]; - if (the_port) - uart_remove_one_port(&ioc3_uart, the_port); - port = card_ptr->ic_port[GET_PHYSICAL_PORT(ii)].icp_port; - if (port && IS_PHYSICAL_PORT(ii) - && (GET_PHYSICAL_PORT(ii) == 0)) { - pci_free_consistent(port->ip_idd->pdev, - TOTAL_RING_BUF_SIZE, - (void *)port->ip_cpu_ringbuf, - port->ip_dma_ringbuf); - kfree(port); - card_ptr->ic_port[GET_PHYSICAL_PORT(ii)]. - icp_port = NULL; - } - } - kfree(card_ptr); - idd->data[is->id] = NULL; - } - return 0; -} - -/** - * ioc3uart_probe - card probe function called from shim driver - * @is: submodule struct for this submodule - * @idd: ioc3 driver data for this card - */ - -static int __devinit -ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd) -{ - struct pci_dev *pdev = idd->pdev; - struct ioc3_card *card_ptr; - int ret = 0; - struct ioc3_port *port; - struct ioc3_port *ports[PORTS_PER_CARD]; - int phys_port; - - DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __FUNCTION__, is, idd)); - - card_ptr = kmalloc(sizeof(struct ioc3_card), GFP_KERNEL); - if (!card_ptr) { - printk(KERN_WARNING "ioc3_attach_one" - ": unable to get memory for the IOC3\n"); - return -ENOMEM; - } - memset(card_ptr, 0, sizeof(struct ioc3_card)); - idd->data[is->id] = card_ptr; - Submodule_slot = is->id; - - writel(((UARTA_BASE >> 3) << SIO_CR_SER_A_BASE_SHIFT) | - ((UARTB_BASE >> 3) << SIO_CR_SER_B_BASE_SHIFT) | - (0xf << SIO_CR_CMD_PULSE_SHIFT), &idd->vma->sio_cr); - - pci_write_config_dword(pdev, PCI_LAT, 0xff00); - - /* Enable serial port mode select generic PIO pins as outputs */ - ioc3_gpcr_set(idd, GPCR_UARTA_MODESEL | GPCR_UARTB_MODESEL); - - /* Create port structures for each port */ - for (phys_port = 0; phys_port < PORTS_PER_CARD; phys_port++) { - port = kmalloc(sizeof(struct ioc3_port), GFP_KERNEL); - if (!port) { - printk(KERN_WARNING - "IOC3 serial memory not available for port\n"); - goto out4; - } - memset(port, 0, sizeof(struct ioc3_port)); - spin_lock_init(&port->ip_lock); - - /* we need to remember the previous ones, to point back to - * them farther down - setting up the ring buffers. - */ - ports[phys_port] = port; - - /* init to something useful */ - card_ptr->ic_port[phys_port].icp_port = port; - port->ip_is = is; - port->ip_idd = idd; - port->ip_baud = 9600; - port->ip_card = card_ptr; - port->ip_hooks = &hooks_array[phys_port]; - - /* Setup each port */ - if (phys_port == 0) { - port->ip_serial_regs = &idd->vma->port_a; - port->ip_uart_regs = &idd->vma->sregs.uarta; - - DPRINT_CONFIG(("%s : Port A ip_serial_regs 0x%p " - "ip_uart_regs 0x%p\n", - __FUNCTION__, - (void *)port->ip_serial_regs, - (void *)port->ip_uart_regs)); - - /* setup ring buffers */ - port->ip_cpu_ringbuf = pci_alloc_consistent(pdev, - TOTAL_RING_BUF_SIZE, &port->ip_dma_ringbuf); - - BUG_ON(!((((int64_t) port->ip_dma_ringbuf) & - (TOTAL_RING_BUF_SIZE - 1)) == 0)); - port->ip_inring = RING(port, RX_A); - port->ip_outring = RING(port, TX_A); - DPRINT_CONFIG(("%s : Port A ip_cpu_ringbuf 0x%p " - "ip_dma_ringbuf 0x%p, ip_inring 0x%p " - "ip_outring 0x%p\n", - __FUNCTION__, - (void *)port->ip_cpu_ringbuf, - (void *)port->ip_dma_ringbuf, - (void *)port->ip_inring, - (void *)port->ip_outring)); - } - else { - port->ip_serial_regs = &idd->vma->port_b; - port->ip_uart_regs = &idd->vma->sregs.uartb; - - DPRINT_CONFIG(("%s : Port B ip_serial_regs 0x%p " - "ip_uart_regs 0x%p\n", - __FUNCTION__, - (void *)port->ip_serial_regs, - (void *)port->ip_uart_regs)); - - /* share the ring buffers */ - port->ip_dma_ringbuf = - ports[phys_port - 1]->ip_dma_ringbuf; - port->ip_cpu_ringbuf = - ports[phys_port - 1]->ip_cpu_ringbuf; - port->ip_inring = RING(port, RX_B); - port->ip_outring = RING(port, TX_B); - DPRINT_CONFIG(("%s : Port B ip_cpu_ringbuf 0x%p " - "ip_dma_ringbuf 0x%p, ip_inring 0x%p " - "ip_outring 0x%p\n", - __FUNCTION__, - (void *)port->ip_cpu_ringbuf, - (void *)port->ip_dma_ringbuf, - (void *)port->ip_inring, - (void *)port->ip_outring)); - } - - DPRINT_CONFIG(("%s : port %d [addr 0x%p] card_ptr 0x%p", - __FUNCTION__, - phys_port, (void *)port, (void *)card_ptr)); - DPRINT_CONFIG((" ip_serial_regs 0x%p ip_uart_regs 0x%p\n", - (void *)port->ip_serial_regs, - (void *)port->ip_uart_regs)); - - /* Initialize the hardware for IOC3 */ - port_init(port); - - DPRINT_CONFIG(("%s: phys_port %d port 0x%p inring 0x%p " - "outring 0x%p\n", - __FUNCTION__, - phys_port, (void *)port, - (void *)port->ip_inring, - (void *)port->ip_outring)); - - } - - /* register port with the serial core */ - - if ((ret = ioc3_serial_core_attach(is, idd))) - goto out4; - - Num_of_ioc3_cards++; - - return ret; - - /* error exits that give back resources */ -out4: - kfree(card_ptr); - return ret; -} - -static struct ioc3_submodule ioc3uart_submodule = { - .name = "IOC3uart", - .probe = ioc3uart_probe, - .remove = ioc3uart_remove, - /* call .intr for both ports initially */ - .irq_mask = SIO_IR_SA | SIO_IR_SB, - .intr = ioc3uart_intr, - .owner = THIS_MODULE, -}; - -/** - * ioc3_detect - module init called, - */ -static int __devinit ioc3uart_init(void) -{ - int ret; - - /* register with serial core */ - if ((ret = uart_register_driver(&ioc3_uart)) < 0) { - printk(KERN_WARNING - "%s: Couldn't register IOC3 uart serial driver\n", - __FUNCTION__); - return ret; - } - ret = ioc3_register_submodule(&ioc3uart_submodule); - if (ret) - uart_unregister_driver(&ioc3_uart); - return ret; -} - -static void __devexit ioc3uart_exit(void) -{ - ioc3_unregister_submodule(&ioc3uart_submodule); - uart_unregister_driver(&ioc3_uart); -} - -module_init(ioc3uart_init); -module_exit(ioc3uart_exit); - -MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) "); -MODULE_DESCRIPTION("Serial PCI driver module for SGI IOC3 card"); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/serial/pmac_zilog.c b/trunk/drivers/serial/pmac_zilog.c index 4e03a87f3fb4..5f52883e64d2 100644 --- a/trunk/drivers/serial/pmac_zilog.c +++ b/trunk/drivers/serial/pmac_zilog.c @@ -69,6 +69,7 @@ #include #include #include +#include #if defined (CONFIG_SERIAL_PMACZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -1592,7 +1593,7 @@ static int pmz_suspend(struct macio_dev *mdev, pm_message_t pm_state) state = pmz_uart_reg.state + uap->port.line; mutex_lock(&pmz_irq_mutex); - mutex_lock(&state->mutex); + down(&state->sem); spin_lock_irqsave(&uap->port.lock, flags); @@ -1623,7 +1624,7 @@ static int pmz_suspend(struct macio_dev *mdev, pm_message_t pm_state) /* Shut the chip down */ pmz_set_scc_power(uap, 0); - mutex_unlock(&state->mutex); + up(&state->sem); mutex_unlock(&pmz_irq_mutex); pmz_debug("suspend, switching complete\n"); @@ -1652,7 +1653,7 @@ static int pmz_resume(struct macio_dev *mdev) state = pmz_uart_reg.state + uap->port.line; mutex_lock(&pmz_irq_mutex); - mutex_lock(&state->mutex); + down(&state->sem); spin_lock_irqsave(&uap->port.lock, flags); if (!ZS_IS_OPEN(uap) && !ZS_IS_CONS(uap)) { @@ -1684,7 +1685,7 @@ static int pmz_resume(struct macio_dev *mdev) } bail: - mutex_unlock(&state->mutex); + up(&state->sem); mutex_unlock(&pmz_irq_mutex); /* Right now, we deal with delay by blocking here, I'll be diff --git a/trunk/drivers/serial/serial_core.c b/trunk/drivers/serial/serial_core.c index 943770470b9d..2ca620900bcc 100644 --- a/trunk/drivers/serial/serial_core.c +++ b/trunk/drivers/serial/serial_core.c @@ -638,7 +638,7 @@ static int uart_set_info(struct uart_state *state, * module insertion/removal doesn't change anything * under us. */ - mutex_lock(&state->mutex); + down(&state->sem); change_irq = new_serial.irq != port->irq; @@ -797,7 +797,7 @@ static int uart_set_info(struct uart_state *state, } else retval = uart_startup(state, 1); exit: - mutex_unlock(&state->mutex); + up(&state->sem); return retval; } @@ -834,7 +834,7 @@ static int uart_tiocmget(struct tty_struct *tty, struct file *file) struct uart_port *port = state->port; int result = -EIO; - mutex_lock(&state->mutex); + down(&state->sem); if ((!file || !tty_hung_up_p(file)) && !(tty->flags & (1 << TTY_IO_ERROR))) { result = port->mctrl; @@ -843,7 +843,7 @@ static int uart_tiocmget(struct tty_struct *tty, struct file *file) result |= port->ops->get_mctrl(port); spin_unlock_irq(&port->lock); } - mutex_unlock(&state->mutex); + up(&state->sem); return result; } @@ -856,13 +856,13 @@ uart_tiocmset(struct tty_struct *tty, struct file *file, struct uart_port *port = state->port; int ret = -EIO; - mutex_lock(&state->mutex); + down(&state->sem); if ((!file || !tty_hung_up_p(file)) && !(tty->flags & (1 << TTY_IO_ERROR))) { uart_update_mctrl(port, set, clear); ret = 0; } - mutex_unlock(&state->mutex); + up(&state->sem); return ret; } @@ -873,12 +873,12 @@ static void uart_break_ctl(struct tty_struct *tty, int break_state) BUG_ON(!kernel_locked()); - mutex_lock(&state->mutex); + down(&state->sem); if (port->type != PORT_UNKNOWN) port->ops->break_ctl(port, break_state); - mutex_unlock(&state->mutex); + up(&state->sem); } static int uart_do_autoconfig(struct uart_state *state) @@ -894,7 +894,7 @@ static int uart_do_autoconfig(struct uart_state *state) * changing, and hence any extra opens of the port while * we're auto-configuring. */ - if (mutex_lock_interruptible(&state->mutex)) + if (down_interruptible(&state->sem)) return -ERESTARTSYS; ret = -EBUSY; @@ -920,7 +920,7 @@ static int uart_do_autoconfig(struct uart_state *state) ret = uart_startup(state, 1); } - mutex_unlock(&state->mutex); + up(&state->sem); return ret; } @@ -1074,7 +1074,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, if (ret != -ENOIOCTLCMD) goto out; - mutex_lock(&state->mutex); + down(&state->sem); if (tty_hung_up_p(filp)) { ret = -EIO; @@ -1098,7 +1098,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, } } out_up: - mutex_unlock(&state->mutex); + up(&state->sem); out: return ret; } @@ -1186,7 +1186,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp) DPRINTK("uart_close(%d) called\n", port->line); - mutex_lock(&state->mutex); + down(&state->sem); if (tty_hung_up_p(filp)) goto done; @@ -1260,7 +1260,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp) wake_up_interruptible(&state->info->open_wait); done: - mutex_unlock(&state->mutex); + up(&state->sem); } static void uart_wait_until_sent(struct tty_struct *tty, int timeout) @@ -1334,7 +1334,7 @@ static void uart_hangup(struct tty_struct *tty) BUG_ON(!kernel_locked()); DPRINTK("uart_hangup(%d)\n", state->port->line); - mutex_lock(&state->mutex); + down(&state->sem); if (state->info && state->info->flags & UIF_NORMAL_ACTIVE) { uart_flush_buffer(tty); uart_shutdown(state); @@ -1344,7 +1344,7 @@ static void uart_hangup(struct tty_struct *tty) wake_up_interruptible(&state->info->open_wait); wake_up_interruptible(&state->info->delta_msr_wait); } - mutex_unlock(&state->mutex); + up(&state->sem); } /* @@ -1447,9 +1447,9 @@ uart_block_til_ready(struct file *filp, struct uart_state *state) if (mctrl & TIOCM_CAR) break; - mutex_unlock(&state->mutex); + up(&state->sem); schedule(); - mutex_lock(&state->mutex); + down(&state->sem); if (signal_pending(current)) break; @@ -1475,7 +1475,7 @@ static struct uart_state *uart_get(struct uart_driver *drv, int line) mutex_lock(&port_mutex); state = drv->state + line; - if (mutex_lock_interruptible(&state->mutex)) { + if (down_interruptible(&state->sem)) { state = ERR_PTR(-ERESTARTSYS); goto out; } @@ -1483,7 +1483,7 @@ static struct uart_state *uart_get(struct uart_driver *drv, int line) state->count++; if (!state->port) { state->count--; - mutex_unlock(&state->mutex); + up(&state->sem); state = ERR_PTR(-ENXIO); goto out; } @@ -1504,7 +1504,7 @@ static struct uart_state *uart_get(struct uart_driver *drv, int line) (unsigned long)state); } else { state->count--; - mutex_unlock(&state->mutex); + up(&state->sem); state = ERR_PTR(-ENOMEM); } } @@ -1571,7 +1571,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp) if (tty_hung_up_p(filp)) { retval = -EAGAIN; state->count--; - mutex_unlock(&state->mutex); + up(&state->sem); goto fail; } @@ -1591,7 +1591,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp) */ if (retval == 0) retval = uart_block_til_ready(filp, state); - mutex_unlock(&state->mutex); + up(&state->sem); /* * If this is the first open to succeed, adjust things to suit. @@ -1867,7 +1867,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) { struct uart_state *state = drv->state + port->line; - mutex_lock(&state->mutex); + down(&state->sem); if (state->info && state->info->flags & UIF_INITIALIZED) { struct uart_ops *ops = port->ops; @@ -1896,7 +1896,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) uart_change_pm(state, 3); - mutex_unlock(&state->mutex); + up(&state->sem); return 0; } @@ -1905,7 +1905,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) { struct uart_state *state = drv->state + port->line; - mutex_lock(&state->mutex); + down(&state->sem); uart_change_pm(state, 0); @@ -1954,7 +1954,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) } } - mutex_unlock(&state->mutex); + up(&state->sem); return 0; } @@ -2049,7 +2049,7 @@ uart_unconfigure_port(struct uart_driver *drv, struct uart_state *state) if (info && info->tty) tty_vhangup(info->tty); - mutex_lock(&state->mutex); + down(&state->sem); state->info = NULL; @@ -2072,7 +2072,7 @@ uart_unconfigure_port(struct uart_driver *drv, struct uart_state *state) kfree(info); } - mutex_unlock(&state->mutex); + up(&state->sem); } static struct tty_operations uart_ops = { @@ -2161,7 +2161,7 @@ int uart_register_driver(struct uart_driver *drv) state->close_delay = 500; /* .5 seconds */ state->closing_wait = 30000; /* 30 seconds */ - mutex_init(&state->mutex); + init_MUTEX(&state->sem); } retval = tty_register_driver(normal); diff --git a/trunk/drivers/sn/Kconfig b/trunk/drivers/sn/Kconfig index d95265b187a3..13b8d249da5c 100644 --- a/trunk/drivers/sn/Kconfig +++ b/trunk/drivers/sn/Kconfig @@ -17,18 +17,4 @@ config SGI_IOC4 If you have an SGI Altix with an IOC4-based I/O controller say Y. Otherwise say N. -config SGI_IOC3 - tristate "SGI IOC3 Base IO support" - depends on (IA64_GENERIC || IA64_SGI_SN2) - default m - ---help--- - This option enables basic support for the SGI IOC3-based Base IO - controller card. This option does not enable any specific - functions on such a card, but provides necessary infrastructure - for other drivers to utilize. - - If you have an SGI Altix with an IOC3-based - I/O controller or a PCI IOC3 serial card say Y. - Otherwise say N. - endmenu diff --git a/trunk/drivers/sn/Makefile b/trunk/drivers/sn/Makefile index 2cda011597c0..c2a284185372 100644 --- a/trunk/drivers/sn/Makefile +++ b/trunk/drivers/sn/Makefile @@ -4,4 +4,3 @@ # obj-$(CONFIG_SGI_IOC4) += ioc4.o -obj-$(CONFIG_SGI_IOC3) += ioc3.o diff --git a/trunk/drivers/sn/ioc3.c b/trunk/drivers/sn/ioc3.c deleted file mode 100644 index aaa009f4a7bf..000000000000 --- a/trunk/drivers/sn/ioc3.c +++ /dev/null @@ -1,851 +0,0 @@ -/* - * SGI IOC3 master driver and IRQ demuxer - * - * Copyright (c) 2005 Stanislaw Skowronek - * Heavily based on similar work by: - * Brent Casavant - IOC4 master driver - * Pat Gefre - IOC3 serial port IRQ demuxer - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define IOC3_PCI_SIZE 0x100000 - -static LIST_HEAD(ioc3_devices); -static int ioc3_counter; -static DECLARE_RWSEM(ioc3_devices_rwsem); - -static struct ioc3_submodule *ioc3_submodules[IOC3_MAX_SUBMODULES]; -static struct ioc3_submodule *ioc3_ethernet; -static rwlock_t ioc3_submodules_lock = RW_LOCK_UNLOCKED; - -/* NIC probing code */ - -#define GPCR_MLAN_EN 0x00200000 /* enable MCR to pin 8 */ - -static inline unsigned mcr_pack(unsigned pulse, unsigned sample) -{ - return (pulse << 10) | (sample << 2); -} - -static int nic_wait(struct ioc3_driver_data *idd) -{ - volatile unsigned mcr; - - do { - mcr = (volatile unsigned)idd->vma->mcr; - } while (!(mcr & 2)); - - return mcr & 1; -} - -static int nic_reset(struct ioc3_driver_data *idd) -{ - int presence; - unsigned long flags; - - local_irq_save(flags); - idd->vma->mcr = mcr_pack(500, 65); - presence = nic_wait(idd); - local_irq_restore(flags); - - udelay(500); - - return presence; -} - -static inline int nic_read_bit(struct ioc3_driver_data *idd) -{ - int result; - unsigned long flags; - - local_irq_save(flags); - idd->vma->mcr = mcr_pack(6, 13); - result = nic_wait(idd); - local_irq_restore(flags); - - udelay(500); - - return result; -} - -static inline void nic_write_bit(struct ioc3_driver_data *idd, int bit) -{ - if (bit) - idd->vma->mcr = mcr_pack(6, 110); - else - idd->vma->mcr = mcr_pack(80, 30); - - nic_wait(idd); -} - -static unsigned nic_read_byte(struct ioc3_driver_data *idd) -{ - unsigned result = 0; - int i; - - for (i = 0; i < 8; i++) - result = (result >> 1) | (nic_read_bit(idd) << 7); - - return result; -} - -static void nic_write_byte(struct ioc3_driver_data *idd, int byte) -{ - int i, bit; - - for (i = 8; i; i--) { - bit = byte & 1; - byte >>= 1; - - nic_write_bit(idd, bit); - } -} - -static unsigned long -nic_find(struct ioc3_driver_data *idd, int *last, unsigned long addr) -{ - int a, b, index, disc; - - nic_reset(idd); - - /* Search ROM. */ - nic_write_byte(idd, 0xF0); - - /* Algorithm from ``Book of iButton Standards''. */ - for (index = 0, disc = 0; index < 64; index++) { - a = nic_read_bit(idd); - b = nic_read_bit(idd); - - if (a && b) { - printk(KERN_WARNING "IOC3 NIC search failed.\n"); - *last = 0; - return 0; - } - - if (!a && !b) { - if (index == *last) { - addr |= 1UL << index; - } else if (index > *last) { - addr &= ~(1UL << index); - disc = index; - } else if ((addr & (1UL << index)) == 0) - disc = index; - nic_write_bit(idd, (addr>>index)&1); - continue; - } else { - if (a) - addr |= 1UL << index; - else - addr &= ~(1UL << index); - nic_write_bit(idd, a); - continue; - } - } - *last = disc; - return addr; -} - -static void nic_addr(struct ioc3_driver_data *idd, unsigned long addr) -{ - int index; - - nic_reset(idd); - nic_write_byte(idd, 0xF0); - for (index = 0; index < 64; index++) { - nic_read_bit(idd); - nic_read_bit(idd); - nic_write_bit(idd, (addr>>index)&1); - } -} - -static void crc16_byte(unsigned int *crc, unsigned char db) -{ - int i; - - for(i=0;i<8;i++) { - *crc <<= 1; - if((db^(*crc>>16)) & 1) - *crc ^= 0x8005; - db >>= 1; - } - *crc &= 0xFFFF; -} - -static unsigned int crc16_area(unsigned char *dbs, int size, unsigned int crc) -{ - while(size--) - crc16_byte(&crc, *(dbs++)); - return crc; -} - -static void crc8_byte(unsigned int *crc, unsigned char db) -{ - int i,f; - - for(i=0;i<8;i++) { - f = (*crc ^ db) & 1; - *crc >>= 1; - db >>= 1; - if(f) - *crc ^= 0x8c; - } - *crc &= 0xff; -} - -static unsigned int crc8_addr(unsigned long addr) -{ - int i; - unsigned int crc = 0x00; - - for(i=0;i<8;i++) - crc8_byte(&crc, addr>>(i<<3)); - return crc; -} - -static void -read_redir_page(struct ioc3_driver_data *idd, unsigned long addr, int page, - unsigned char *redir, unsigned char *data) -{ - int loops = 16, i; - - while(redir[page] != 0xFF) { - page = redir[page]^0xFF; - loops--; - if(loops<0) { - printk(KERN_ERR "IOC3: NIC circular redirection\n"); - return; - } - } - loops = 3; - while(loops>0) { - nic_addr(idd, addr); - nic_write_byte(idd, 0xF0); - nic_write_byte(idd, (page << 5) & 0xE0); - nic_write_byte(idd, (page >> 3) & 0x1F); - for(i=0;i<0x20;i++) - data[i] = nic_read_byte(idd); - if(crc16_area(data, 0x20, 0x0000) == 0x800d) - return; - loops--; - } - printk(KERN_ERR "IOC3: CRC error in data page\n"); - for(i=0;i<0x20;i++) - data[i] = 0x00; -} - -static void -read_redir_map(struct ioc3_driver_data *idd, unsigned long addr, - unsigned char *redir) -{ - int i,j,loops = 3,crc_ok; - unsigned int crc; - - while(loops>0) { - crc_ok = 1; - nic_addr(idd, addr); - nic_write_byte(idd, 0xAA); - nic_write_byte(idd, 0x00); - nic_write_byte(idd, 0x01); - for(i=0;i<64;i+=8) { - for(j=0;j<8;j++) - redir[i+j] = nic_read_byte(idd); - crc = crc16_area(redir+i, 8, (i==0)?0x8707:0x0000); - crc16_byte(&crc, nic_read_byte(idd)); - crc16_byte(&crc, nic_read_byte(idd)); - if(crc != 0x800d) - crc_ok = 0; - } - if(crc_ok) - return; - loops--; - } - printk(KERN_ERR "IOC3: CRC error in redirection page\n"); - for(i=0;i<64;i++) - redir[i] = 0xFF; -} - -static void read_nic(struct ioc3_driver_data *idd, unsigned long addr) -{ - unsigned char redir[64]; - unsigned char data[64],part[32]; - int i,j; - - /* read redirections */ - read_redir_map(idd, addr, redir); - /* read data pages */ - read_redir_page(idd, addr, 0, redir, data); - read_redir_page(idd, addr, 1, redir, data+32); - /* assemble the part # */ - j=0; - for(i=0;i<19;i++) - if(data[i+11] != ' ') - part[j++] = data[i+11]; - for(i=0;i<6;i++) - if(data[i+32] != ' ') - part[j++] = data[i+32]; - part[j] = 0; - /* skip Octane power supplies */ - if(!strncmp(part, "060-0035-", 9)) - return; - if(!strncmp(part, "060-0038-", 9)) - return; - strcpy(idd->nic_part, part); - /* assemble the serial # */ - j=0; - for(i=0;i<10;i++) - if(data[i+1] != ' ') - idd->nic_serial[j++] = data[i+1]; - idd->nic_serial[j] = 0; -} - -static void read_mac(struct ioc3_driver_data *idd, unsigned long addr) -{ - int i, loops = 3; - unsigned char data[13]; - - while(loops>0) { - nic_addr(idd, addr); - nic_write_byte(idd, 0xF0); - nic_write_byte(idd, 0x00); - nic_write_byte(idd, 0x00); - nic_read_byte(idd); - for(i=0;i<13;i++) - data[i] = nic_read_byte(idd); - if(crc16_area(data, 13, 0x0000) == 0x800d) { - for(i=10;i>4;i--) - idd->nic_mac[10-i] = data[i]; - return; - } - loops--; - } - printk(KERN_ERR "IOC3: CRC error in MAC address\n"); - for(i=0;i<6;i++) - idd->nic_mac[i] = 0x00; -} - -static void probe_nic(struct ioc3_driver_data *idd) -{ - int save = 0, loops = 3; - unsigned long first, addr; - - idd->vma->gpcr_s = GPCR_MLAN_EN; - - while(loops>0) { - idd->nic_part[0] = 0; - idd->nic_serial[0] = 0; - addr = first = nic_find(idd, &save, 0); - if(!first) - return; - while(1) { - if(crc8_addr(addr)) - break; - else { - switch(addr & 0xFF) { - case 0x0B: - read_nic(idd, addr); - break; - case 0x09: - case 0x89: - case 0x91: - read_mac(idd, addr); - break; - } - } - addr = nic_find(idd, &save, addr); - if(addr == first) - return; - } - loops--; - } - printk(KERN_ERR "IOC3: CRC error in NIC address\n"); -} - -/* Interrupts */ - -static inline void -write_ireg(struct ioc3_driver_data *idd, uint32_t val, int which) -{ - unsigned long flags; - - spin_lock_irqsave(&idd->ir_lock, flags); - switch (which) { - case IOC3_W_IES: - writel(val, &idd->vma->sio_ies); - break; - case IOC3_W_IEC: - writel(val, &idd->vma->sio_iec); - break; - } - spin_unlock_irqrestore(&idd->ir_lock, flags); -} -static inline uint32_t get_pending_intrs(struct ioc3_driver_data *idd) -{ - unsigned long flag; - uint32_t intrs = 0; - - spin_lock_irqsave(&idd->ir_lock, flag); - intrs = readl(&idd->vma->sio_ir); - intrs &= readl(&idd->vma->sio_ies); - spin_unlock_irqrestore(&idd->ir_lock, flag); - return intrs; -} - -static irqreturn_t ioc3_intr_io(int irq, void *arg, struct pt_regs *regs) -{ - unsigned long flags; - struct ioc3_driver_data *idd = (struct ioc3_driver_data *)arg; - int handled = 1, id; - unsigned int pending; - - read_lock_irqsave(&ioc3_submodules_lock, flags); - - if(idd->dual_irq && idd->vma->eisr) { - /* send Ethernet IRQ to the driver */ - if(ioc3_ethernet && idd->active[ioc3_ethernet->id] && - ioc3_ethernet->intr) { - handled = handled && !ioc3_ethernet->intr(ioc3_ethernet, - idd, 0, regs); - } - } - pending = get_pending_intrs(idd); /* look at the IO IRQs */ - - for(id=0;idactive[id] && ioc3_submodules[id] - && (pending & ioc3_submodules[id]->irq_mask) - && ioc3_submodules[id]->intr) { - write_ireg(idd, ioc3_submodules[id]->irq_mask, - IOC3_W_IEC); - if(!ioc3_submodules[id]->intr(ioc3_submodules[id], - idd, pending & ioc3_submodules[id]->irq_mask, - regs)) - pending &= ~ioc3_submodules[id]->irq_mask; - if (ioc3_submodules[id]->reset_mask) - write_ireg(idd, ioc3_submodules[id]->irq_mask, - IOC3_W_IES); - } - } - read_unlock_irqrestore(&ioc3_submodules_lock, flags); - if(pending) { - printk(KERN_WARNING - "IOC3: Pending IRQs 0x%08x discarded and disabled\n",pending); - write_ireg(idd, pending, IOC3_W_IEC); - handled = 1; - } - return handled?IRQ_HANDLED:IRQ_NONE; -} - -static irqreturn_t ioc3_intr_eth(int irq, void *arg, struct pt_regs *regs) -{ - unsigned long flags; - struct ioc3_driver_data *idd = (struct ioc3_driver_data *)arg; - int handled = 1; - - if(!idd->dual_irq) - return IRQ_NONE; - read_lock_irqsave(&ioc3_submodules_lock, flags); - if(ioc3_ethernet && idd->active[ioc3_ethernet->id] - && ioc3_ethernet->intr) - handled = handled && !ioc3_ethernet->intr(ioc3_ethernet, idd, 0, - regs); - read_unlock_irqrestore(&ioc3_submodules_lock, flags); - return handled?IRQ_HANDLED:IRQ_NONE; -} - -void ioc3_enable(struct ioc3_submodule *is, - struct ioc3_driver_data *idd, unsigned int irqs) -{ - write_ireg(idd, irqs & is->irq_mask, IOC3_W_IES); -} - -void ioc3_ack(struct ioc3_submodule *is, struct ioc3_driver_data *idd, - unsigned int irqs) -{ - writel(irqs & is->irq_mask, &idd->vma->sio_ir); -} - -void ioc3_disable(struct ioc3_submodule *is, - struct ioc3_driver_data *idd, unsigned int irqs) -{ - write_ireg(idd, irqs & is->irq_mask, IOC3_W_IEC); -} - -void ioc3_gpcr_set(struct ioc3_driver_data *idd, unsigned int val) -{ - unsigned long flags; - spin_lock_irqsave(&idd->gpio_lock, flags); - writel(val, &idd->vma->gpcr_s); - spin_unlock_irqrestore(&idd->gpio_lock, flags); -} - -/* Keep it simple, stupid! */ -static int find_slot(void **tab, int max) -{ - int i; - for(i=0;iethernet) { - if(ioc3_ethernet==NULL) - ioc3_ethernet=is; - else - printk(KERN_WARNING - "IOC3 Ethernet module already registered!\n"); - } - } - write_unlock_irqrestore(&ioc3_submodules_lock, flags); - - if(alloc_id == -1) { - printk(KERN_WARNING "Increase IOC3_MAX_SUBMODULES!\n"); - return -ENOMEM; - } - - is->id=alloc_id; - - /* Initialize submodule for each IOC3 */ - if (!is->probe) - return 0; - - down_read(&ioc3_devices_rwsem); - list_for_each_entry(idd, &ioc3_devices, list) { - /* set to 1 for IRQs in probe */ - idd->active[alloc_id] = 1; - idd->active[alloc_id] = !is->probe(is, idd); - } - up_read(&ioc3_devices_rwsem); - - return 0; -} - -/* Unregister an IOC3 submodule */ -void ioc3_unregister_submodule(struct ioc3_submodule *is) -{ - struct ioc3_driver_data *idd; - unsigned long flags; - - write_lock_irqsave(&ioc3_submodules_lock, flags); - if(ioc3_submodules[is->id]==is) - ioc3_submodules[is->id]=NULL; - else - printk(KERN_WARNING - "IOC3 submodule %s has wrong ID.\n",is->name); - if(ioc3_ethernet==is) - ioc3_ethernet = NULL; - write_unlock_irqrestore(&ioc3_submodules_lock, flags); - - /* Remove submodule for each IOC3 */ - down_read(&ioc3_devices_rwsem); - list_for_each_entry(idd, &ioc3_devices, list) - if(idd->active[is->id]) { - if(is->remove) - if(is->remove(is, idd)) - printk(KERN_WARNING - "%s: IOC3 submodule %s remove failed " - "for pci_dev %s.\n", - __FUNCTION__, module_name(is->owner), - pci_name(idd->pdev)); - idd->active[is->id] = 0; - if(is->irq_mask) - write_ireg(idd, is->irq_mask, IOC3_W_IEC); - } - up_read(&ioc3_devices_rwsem); -} - -/********************* - * Device management * - *********************/ - -static char * -ioc3_class_names[]={"unknown", "IP27 BaseIO", "IP30 system", "MENET 1/2/3", - "MENET 4", "CADduo", "Altix Serial"}; - -static int ioc3_class(struct ioc3_driver_data *idd) -{ - int res = IOC3_CLASS_NONE; - /* NIC-based logic */ - if(!strncmp(idd->nic_part, "030-0891-", 9)) - res = IOC3_CLASS_BASE_IP30; - if(!strncmp(idd->nic_part, "030-1155-", 9)) - res = IOC3_CLASS_CADDUO; - if(!strncmp(idd->nic_part, "030-1657-", 9)) - res = IOC3_CLASS_SERIAL; - if(!strncmp(idd->nic_part, "030-1664-", 9)) - res = IOC3_CLASS_SERIAL; - /* total random heuristics */ -#ifdef CONFIG_SGI_IP27 - if(!idd->nic_part[0]) - res = IOC3_CLASS_BASE_IP27; -#endif - /* print educational message */ - printk(KERN_INFO "IOC3 part: [%s], serial: [%s] => class %s\n", - idd->nic_part, idd->nic_serial, ioc3_class_names[res]); - return res; -} -/* Adds a new instance of an IOC3 card */ -static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) -{ - struct ioc3_driver_data *idd; - uint32_t pcmd; - int ret, id; - - /* Enable IOC3 and take ownership of it */ - if ((ret = pci_enable_device(pdev))) { - printk(KERN_WARNING - "%s: Failed to enable IOC3 device for pci_dev %s.\n", - __FUNCTION__, pci_name(pdev)); - goto out; - } - pci_set_master(pdev); - -#ifdef USE_64BIT_DMA - ret = pci_set_dma_mask(pdev, 0xffffffffffffffffULL); - if (!ret) { - ret = pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL); - if (ret < 0) { - printk(KERN_WARNING "%s: Unable to obtain 64 bit DMA " - "for consistent allocations\n", - __FUNCTION__); - } - } -#endif - - /* Set up per-IOC3 data */ - idd = kmalloc(sizeof(struct ioc3_driver_data), GFP_KERNEL); - if (!idd) { - printk(KERN_WARNING - "%s: Failed to allocate IOC3 data for pci_dev %s.\n", - __FUNCTION__, pci_name(pdev)); - ret = -ENODEV; - goto out_idd; - } - memset(idd, 0, sizeof(struct ioc3_driver_data)); - spin_lock_init(&idd->ir_lock); - spin_lock_init(&idd->gpio_lock); - idd->pdev = pdev; - - /* Map all IOC3 registers. These are shared between subdevices - * so the main IOC3 module manages them. - */ - idd->pma = pci_resource_start(pdev, 0); - if (!idd->pma) { - printk(KERN_WARNING - "%s: Unable to find IOC3 resource " - "for pci_dev %s.\n", - __FUNCTION__, pci_name(pdev)); - ret = -ENODEV; - goto out_pci; - } - if (!request_region(idd->pma, IOC3_PCI_SIZE, "ioc3")) { - printk(KERN_WARNING - "%s: Unable to request IOC3 region " - "for pci_dev %s.\n", - __FUNCTION__, pci_name(pdev)); - ret = -ENODEV; - goto out_pci; - } - idd->vma = ioremap(idd->pma, IOC3_PCI_SIZE); - if (!idd->vma) { - printk(KERN_WARNING - "%s: Unable to remap IOC3 region " - "for pci_dev %s.\n", - __FUNCTION__, pci_name(pdev)); - ret = -ENODEV; - goto out_misc_region; - } - - /* Track PCI-device specific data */ - pci_set_drvdata(pdev, idd); - down_write(&ioc3_devices_rwsem); - list_add(&idd->list, &ioc3_devices); - idd->id = ioc3_counter++; - up_write(&ioc3_devices_rwsem); - - idd->gpdr_shadow = idd->vma->gpdr; - - /* Read IOC3 NIC contents */ - probe_nic(idd); - - /* Detect IOC3 class */ - idd->class = ioc3_class(idd); - - /* Initialize IOC3 */ - pci_read_config_dword(pdev, PCI_COMMAND, &pcmd); - pci_write_config_dword(pdev, PCI_COMMAND, - pcmd | PCI_COMMAND_MEMORY | - PCI_COMMAND_PARITY | PCI_COMMAND_SERR | - PCI_SCR_DROP_MODE_EN); - - write_ireg(idd, ~0, IOC3_W_IEC); - writel(~0, &idd->vma->sio_ir); - - /* Set up IRQs */ - if(idd->class == IOC3_CLASS_BASE_IP30 - || idd->class == IOC3_CLASS_BASE_IP27) { - writel(0, &idd->vma->eier); - writel(~0, &idd->vma->eisr); - - idd->dual_irq = 1; - if (!request_irq(pdev->irq, ioc3_intr_eth, SA_SHIRQ, - "ioc3-eth", (void *)idd)) { - idd->irq_eth = pdev->irq; - } else { - printk(KERN_WARNING - "%s : request_irq fails for IRQ 0x%x\n ", - __FUNCTION__, pdev->irq); - } - if (!request_irq(pdev->irq+2, ioc3_intr_io, SA_SHIRQ, - "ioc3-io", (void *)idd)) { - idd->irq_io = pdev->irq+2; - } else { - printk(KERN_WARNING - "%s : request_irq fails for IRQ 0x%x\n ", - __FUNCTION__, pdev->irq+2); - } - } else { - if (!request_irq(pdev->irq, ioc3_intr_io, SA_SHIRQ, - "ioc3", (void *)idd)) { - idd->irq_io = pdev->irq; - } else { - printk(KERN_WARNING - "%s : request_irq fails for IRQ 0x%x\n ", - __FUNCTION__, pdev->irq); - } - } - - /* Add this IOC3 to all submodules */ - read_lock(&ioc3_submodules_lock); - for(id=0;idprobe) { - idd->active[id] = 1; - idd->active[id] = !ioc3_submodules[id]->probe - (ioc3_submodules[id], idd); - } - read_unlock(&ioc3_submodules_lock); - - printk(KERN_INFO "IOC3 Master Driver loaded for %s\n", pci_name(pdev)); - - return 0; - -out_misc_region: - release_region(idd->pma, IOC3_PCI_SIZE); -out_pci: - kfree(idd); -out_idd: - pci_disable_device(pdev); -out: - return ret; -} - -/* Removes a particular instance of an IOC3 card. */ -static void ioc3_remove(struct pci_dev *pdev) -{ - int id; - struct ioc3_driver_data *idd; - - idd = pci_get_drvdata(pdev); - - /* Remove this IOC3 from all submodules */ - read_lock(&ioc3_submodules_lock); - for(id=0;idactive[id]) { - if(ioc3_submodules[id] && ioc3_submodules[id]->remove) - if(ioc3_submodules[id]->remove(ioc3_submodules[id], - idd)) - printk(KERN_WARNING - "%s: IOC3 submodule 0x%s remove failed " - "for pci_dev %s.\n", - __FUNCTION__, - module_name(ioc3_submodules[id]->owner), - pci_name(pdev)); - idd->active[id] = 0; - } - read_unlock(&ioc3_submodules_lock); - - /* Clear and disable all IRQs */ - write_ireg(idd, ~0, IOC3_W_IEC); - writel(~0, &idd->vma->sio_ir); - - /* Release resources */ - free_irq(idd->irq_io, (void *)idd); - if(idd->dual_irq) - free_irq(idd->irq_eth, (void *)idd); - iounmap(idd->vma); - release_region(idd->pma, IOC3_PCI_SIZE); - - /* Disable IOC3 and relinquish */ - pci_disable_device(pdev); - - /* Remove and free driver data */ - down_write(&ioc3_devices_rwsem); - list_del(&idd->list); - up_write(&ioc3_devices_rwsem); - kfree(idd); -} - -static struct pci_device_id ioc3_id_table[] = { - {PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3, PCI_ANY_ID, PCI_ANY_ID}, - {0} -}; - -static struct pci_driver ioc3_driver = { - .name = "IOC3", - .id_table = ioc3_id_table, - .probe = ioc3_probe, - .remove = ioc3_remove, -}; - -MODULE_DEVICE_TABLE(pci, ioc3_id_table); - -/********************* - * Module management * - *********************/ - -/* Module load */ -static int __devinit ioc3_init(void) -{ - if (ia64_platform_is("sn2")) - return pci_register_driver(&ioc3_driver); - return 0; -} - -/* Module unload */ -static void __devexit ioc3_exit(void) -{ - pci_unregister_driver(&ioc3_driver); -} - -module_init(ioc3_init); -module_exit(ioc3_exit); - -MODULE_AUTHOR("Stanislaw Skowronek "); -MODULE_DESCRIPTION("PCI driver for SGI IOC3"); -MODULE_LICENSE("GPL"); - -EXPORT_SYMBOL(ioc3_register_submodule); -EXPORT_SYMBOL(ioc3_unregister_submodule); -EXPORT_SYMBOL(ioc3_ack); -EXPORT_SYMBOL(ioc3_gpcr_set); -EXPORT_SYMBOL(ioc3_disable); -EXPORT_SYMBOL(ioc3_enable); diff --git a/trunk/drivers/usb/atm/usbatm.c b/trunk/drivers/usb/atm/usbatm.c index 7af1883d4bf9..9baa6296fc95 100644 --- a/trunk/drivers/usb/atm/usbatm.c +++ b/trunk/drivers/usb/atm/usbatm.c @@ -207,7 +207,7 @@ static inline void usbatm_pop(struct atm_vcc *vcc, struct sk_buff *skb) ** urbs ** ************/ -static struct urb *usbatm_pop_urb(struct usbatm_channel *channel) +static inline struct urb *usbatm_pop_urb(struct usbatm_channel *channel) { struct urb *urb; @@ -224,7 +224,7 @@ static struct urb *usbatm_pop_urb(struct usbatm_channel *channel) return urb; } -static int usbatm_submit_urb(struct urb *urb) +static inline int usbatm_submit_urb(struct urb *urb) { struct usbatm_channel *channel = urb->context; int ret; diff --git a/trunk/drivers/video/68328fb.c b/trunk/drivers/video/68328fb.c index 78488bb41aeb..3b0ddc55236b 100644 --- a/trunk/drivers/video/68328fb.c +++ b/trunk/drivers/video/68328fb.c @@ -102,7 +102,8 @@ static int mc68x328fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); -static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma); +static int mc68x328fb_mmap(struct fb_info *info, struct file *file, + struct vm_area_struct *vma); static struct fb_ops mc68x328fb_ops = { .fb_check_var = mc68x328fb_check_var, @@ -397,7 +398,8 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, * Most drivers don't need their own mmap function */ -static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int mc68x328fb_mmap(struct fb_info *info, struct file *file, + struct vm_area_struct *vma) { #ifndef MMU /* this is uClinux (no MMU) specific code */ diff --git a/trunk/drivers/video/acornfb.c b/trunk/drivers/video/acornfb.c index b058273527bb..750cebb18306 100644 --- a/trunk/drivers/video/acornfb.c +++ b/trunk/drivers/video/acornfb.c @@ -883,7 +883,7 @@ acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) * Note that we are entered with the kernel locked. */ static int -acornfb_mmap(struct fb_info *info, struct vm_area_struct *vma) +acornfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { unsigned long off, start; u32 len; diff --git a/trunk/drivers/video/amba-clcd.c b/trunk/drivers/video/amba-clcd.c index b2187175d03f..0da4083ba908 100644 --- a/trunk/drivers/video/amba-clcd.c +++ b/trunk/drivers/video/amba-clcd.c @@ -307,7 +307,7 @@ static int clcdfb_blank(int blank_mode, struct fb_info *info) return 0; } -static int clcdfb_mmap(struct fb_info *info, +static int clcdfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct clcd_fb *fb = to_clcd(info); diff --git a/trunk/drivers/video/amifb.c b/trunk/drivers/video/amifb.c index 3033c72dea20..2c42a812655a 100644 --- a/trunk/drivers/video/amifb.c +++ b/trunk/drivers/video/amifb.c @@ -1131,7 +1131,9 @@ static void amifb_copyarea(struct fb_info *info, const struct fb_copyarea *region); static void amifb_imageblit(struct fb_info *info, const struct fb_image *image); -static int amifb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg); +static int amifb_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + struct fb_info *info); /* @@ -2170,8 +2172,9 @@ static void amifb_imageblit(struct fb_info *info, const struct fb_image *image) * Amiga Frame Buffer Specific ioctls */ -static int amifb_ioctl(struct fb_info *info, - unsigned int cmd, unsigned long arg) +static int amifb_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + struct fb_info *info) { union { struct fb_fix_cursorinfo fix; diff --git a/trunk/drivers/video/arcfb.c b/trunk/drivers/video/arcfb.c index df8e5667b348..89060b2db8e5 100644 --- a/trunk/drivers/video/arcfb.c +++ b/trunk/drivers/video/arcfb.c @@ -399,8 +399,9 @@ static void arcfb_imageblit(struct fb_info *info, const struct fb_image *image) image->height); } -static int arcfb_ioctl(struct fb_info *info, - unsigned int cmd, unsigned long arg) +static int arcfb_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + struct fb_info *info) { void __user *argp = (void __user *)arg; struct arcfb_par *par = info->par; diff --git a/trunk/drivers/video/atafb.c b/trunk/drivers/video/atafb.c index e69ab65f7843..15ec1295bc29 100644 --- a/trunk/drivers/video/atafb.c +++ b/trunk/drivers/video/atafb.c @@ -2571,7 +2571,8 @@ atafb_pan_display(struct fb_var_screeninfo *var, int con, struct fb_info *info) } static int -atafb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +atafb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, int con, struct fb_info *info) { switch (cmd) { #ifdef FBCMD_GET_CURRENTPAR diff --git a/trunk/drivers/video/aty/aty128fb.c b/trunk/drivers/video/aty/aty128fb.c index bfc8a93b2c73..e686185a076d 100644 --- a/trunk/drivers/video/aty/aty128fb.c +++ b/trunk/drivers/video/aty/aty128fb.c @@ -431,7 +431,8 @@ static int aty128fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, static int aty128fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fb); static int aty128fb_blank(int blank, struct fb_info *fb); -static int aty128fb_ioctl(struct fb_info *info, u_int cmd, unsigned long arg); +static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd, + u_long arg, struct fb_info *info); static int aty128fb_sync(struct fb_info *info); /* @@ -2107,7 +2108,8 @@ static int aty128fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, /* in param: u32* backlight value: 0 to 15 */ #define FBIO_ATY128_SET_MIRROR _IOW('@', 2, __u32) -static int aty128fb_ioctl(struct fb_info *info, u_int cmd, u_long arg) +static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd, + u_long arg, struct fb_info *info) { struct aty128fb_par *par = info->par; u32 value; diff --git a/trunk/drivers/video/aty/atyfb_base.c b/trunk/drivers/video/aty/atyfb_base.c index 485be386a8ff..ed81005cbdba 100644 --- a/trunk/drivers/video/aty/atyfb_base.c +++ b/trunk/drivers/video/aty/atyfb_base.c @@ -238,12 +238,13 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int atyfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); static int atyfb_blank(int blank, struct fb_info *info); -static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg); +static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd, + u_long arg, struct fb_info *info); extern void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); extern void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); extern void atyfb_imageblit(struct fb_info *info, const struct fb_image *image); #ifdef __sparc__ -static int atyfb_mmap(struct fb_info *info, struct vm_area_struct *vma); +static int atyfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma); #endif static int atyfb_sync(struct fb_info *info); @@ -1738,7 +1739,8 @@ struct atyclk { #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) #endif -static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg) +static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd, + u_long arg, struct fb_info *info) { struct atyfb_par *par = (struct atyfb_par *) info->par; #ifdef __sparc__ @@ -1843,7 +1845,7 @@ static int atyfb_sync(struct fb_info *info) } #ifdef __sparc__ -static int atyfb_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int atyfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct atyfb_par *par = (struct atyfb_par *) info->par; unsigned int size, page, map_size = 0; diff --git a/trunk/drivers/video/aty/radeon_base.c b/trunk/drivers/video/aty/radeon_base.c index c9f0c5a07e6e..156db84cb363 100644 --- a/trunk/drivers/video/aty/radeon_base.c +++ b/trunk/drivers/video/aty/radeon_base.c @@ -864,8 +864,8 @@ static int radeonfb_pan_display (struct fb_var_screeninfo *var, } -static int radeonfb_ioctl (struct fb_info *info, unsigned int cmd, - unsigned long arg) +static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct radeonfb_info *rinfo = info->par; unsigned int tmp; diff --git a/trunk/drivers/video/au1100fb.c b/trunk/drivers/video/au1100fb.c index 2406899f1207..a5129806172f 100644 --- a/trunk/drivers/video/au1100fb.c +++ b/trunk/drivers/video/au1100fb.c @@ -379,7 +379,7 @@ void au1100fb_fb_rotate(struct fb_info *fbi, int angle) * Map video memory in user space. We don't use the generic fb_mmap method mainly * to allow the use of the TLB streaming flag (CCA=6) */ -int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) +int au1100fb_fb_mmap(struct fb_info *fbi, struct file *file, struct vm_area_struct *vma) { struct au1100fb_device *fbdev = to_au1100fb_device(fbi); unsigned int len; diff --git a/trunk/drivers/video/bw2.c b/trunk/drivers/video/bw2.c index c029db4646f6..9248fe1fbb1a 100644 --- a/trunk/drivers/video/bw2.c +++ b/trunk/drivers/video/bw2.c @@ -35,8 +35,9 @@ static int bw2_blank(int, struct fb_info *); -static int bw2_mmap(struct fb_info *, struct vm_area_struct *); -static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long); +static int bw2_mmap(struct fb_info *, struct file *, struct vm_area_struct *); +static int bw2_ioctl(struct inode *, struct file *, unsigned int, + unsigned long, struct fb_info *); /* * Frame buffer operations @@ -168,7 +169,7 @@ static struct sbus_mmap_map bw2_mmap_map[] = { { .size = 0 } }; -static int bw2_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int bw2_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct bw2_par *par = (struct bw2_par *)info->par; @@ -180,7 +181,8 @@ static int bw2_mmap(struct fb_info *info, struct vm_area_struct *vma) vma); } -static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +static int bw2_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct bw2_par *par = (struct bw2_par *) info->par; diff --git a/trunk/drivers/video/cg14.c b/trunk/drivers/video/cg14.c index 63b6c79c8a0a..a56147102abb 100644 --- a/trunk/drivers/video/cg14.c +++ b/trunk/drivers/video/cg14.c @@ -31,8 +31,9 @@ static int cg14_setcolreg(unsigned, unsigned, unsigned, unsigned, unsigned, struct fb_info *); -static int cg14_mmap(struct fb_info *, struct vm_area_struct *); -static int cg14_ioctl(struct fb_info *, unsigned int, unsigned long); +static int cg14_mmap(struct fb_info *, struct file *, struct vm_area_struct *); +static int cg14_ioctl(struct inode *, struct file *, unsigned int, + unsigned long, struct fb_info *); static int cg14_pan_display(struct fb_var_screeninfo *, struct fb_info *); /* @@ -267,7 +268,7 @@ static int cg14_setcolreg(unsigned regno, return 0; } -static int cg14_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int cg14_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct cg14_par *par = (struct cg14_par *) info->par; @@ -276,7 +277,8 @@ static int cg14_mmap(struct fb_info *info, struct vm_area_struct *vma) par->iospace, vma); } -static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct cg14_par *par = (struct cg14_par *) info->par; struct cg14_regs __iomem *regs = par->regs; diff --git a/trunk/drivers/video/cg3.c b/trunk/drivers/video/cg3.c index 3de6e1b5ab2f..9fcd89608ed7 100644 --- a/trunk/drivers/video/cg3.c +++ b/trunk/drivers/video/cg3.c @@ -33,8 +33,9 @@ static int cg3_setcolreg(unsigned, unsigned, unsigned, unsigned, unsigned, struct fb_info *); static int cg3_blank(int, struct fb_info *); -static int cg3_mmap(struct fb_info *, struct vm_area_struct *); -static int cg3_ioctl(struct fb_info *, unsigned int, unsigned long); +static int cg3_mmap(struct fb_info *, struct file *, struct vm_area_struct *); +static int cg3_ioctl(struct inode *, struct file *, unsigned int, + unsigned long, struct fb_info *); /* * Frame buffer operations @@ -229,7 +230,7 @@ static struct sbus_mmap_map cg3_mmap_map[] = { { .size = 0 } }; -static int cg3_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int cg3_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct cg3_par *par = (struct cg3_par *)info->par; @@ -239,7 +240,8 @@ static int cg3_mmap(struct fb_info *info, struct vm_area_struct *vma) vma); } -static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +static int cg3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct cg3_par *par = (struct cg3_par *) info->par; diff --git a/trunk/drivers/video/cg6.c b/trunk/drivers/video/cg6.c index 7aab91ead681..050835e39aa3 100644 --- a/trunk/drivers/video/cg6.c +++ b/trunk/drivers/video/cg6.c @@ -36,8 +36,9 @@ static int cg6_blank(int, struct fb_info *); static void cg6_imageblit(struct fb_info *, const struct fb_image *); static void cg6_fillrect(struct fb_info *, const struct fb_fillrect *); static int cg6_sync(struct fb_info *); -static int cg6_mmap(struct fb_info *, struct vm_area_struct *); -static int cg6_ioctl(struct fb_info *, unsigned int, unsigned long); +static int cg6_mmap(struct fb_info *, struct file *, struct vm_area_struct *); +static int cg6_ioctl(struct inode *, struct file *, unsigned int, + unsigned long, struct fb_info *); /* * Frame buffer operations @@ -523,7 +524,7 @@ static struct sbus_mmap_map cg6_mmap_map[] = { { .size = 0 } }; -static int cg6_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int cg6_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct cg6_par *par = (struct cg6_par *)info->par; @@ -533,7 +534,8 @@ static int cg6_mmap(struct fb_info *info, struct vm_area_struct *vma) vma); } -static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +static int cg6_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct cg6_par *par = (struct cg6_par *) info->par; diff --git a/trunk/drivers/video/controlfb.c b/trunk/drivers/video/controlfb.c index 655301a8671c..03798e9c882d 100644 --- a/trunk/drivers/video/controlfb.c +++ b/trunk/drivers/video/controlfb.c @@ -128,7 +128,7 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var, static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int controlfb_blank(int blank_mode, struct fb_info *info); -static int controlfb_mmap(struct fb_info *info, +static int controlfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma); static int controlfb_set_par (struct fb_info *info); static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *info); @@ -280,7 +280,7 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var, * for controlfb. * Note there's no locking in here; it's done in fb_mmap() in fbmem.c. */ -static int controlfb_mmap(struct fb_info *info, +static int controlfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { unsigned long off, start; diff --git a/trunk/drivers/video/fbmem.c b/trunk/drivers/video/fbmem.c index d2dede6ed3e5..32a9b69becc5 100644 --- a/trunk/drivers/video/fbmem.c +++ b/trunk/drivers/video/fbmem.c @@ -957,7 +957,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, default: if (fb->fb_ioctl == NULL) return -EINVAL; - return fb->fb_ioctl(info, cmd, arg); + return fb->fb_ioctl(inode, file, cmd, arg, info); } } @@ -1107,7 +1107,7 @@ fb_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) default: if (fb->fb_compat_ioctl) - ret = fb->fb_compat_ioctl(info, cmd, arg); + ret = fb->fb_compat_ioctl(file, cmd, arg, info); break; } unlock_kernel(); @@ -1135,7 +1135,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) if (fb->fb_mmap) { int res; lock_kernel(); - res = fb->fb_mmap(info, vma); + res = fb->fb_mmap(info, file, vma); unlock_kernel(); return res; } diff --git a/trunk/drivers/video/ffb.c b/trunk/drivers/video/ffb.c index 9c9b21d469a1..c4870d559afc 100644 --- a/trunk/drivers/video/ffb.c +++ b/trunk/drivers/video/ffb.c @@ -37,8 +37,9 @@ static void ffb_imageblit(struct fb_info *, const struct fb_image *); static void ffb_fillrect(struct fb_info *, const struct fb_fillrect *); static void ffb_copyarea(struct fb_info *, const struct fb_copyarea *); static int ffb_sync(struct fb_info *); -static int ffb_mmap(struct fb_info *, struct vm_area_struct *); -static int ffb_ioctl(struct fb_info *, unsigned int, unsigned long); +static int ffb_mmap(struct fb_info *, struct file *, struct vm_area_struct *); +static int ffb_ioctl(struct inode *, struct file *, unsigned int, + unsigned long, struct fb_info *); static int ffb_pan_display(struct fb_var_screeninfo *, struct fb_info *); /* @@ -838,7 +839,7 @@ static struct sbus_mmap_map ffb_mmap_map[] = { { .size = 0 } }; -static int ffb_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int ffb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct ffb_par *par = (struct ffb_par *)info->par; @@ -847,7 +848,8 @@ static int ffb_mmap(struct fb_info *info, struct vm_area_struct *vma) 0, vma); } -static int ffb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +static int ffb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct ffb_par *par = (struct ffb_par *) info->par; diff --git a/trunk/drivers/video/gbefb.c b/trunk/drivers/video/gbefb.c index 38d22729b129..d744c51807b7 100644 --- a/trunk/drivers/video/gbefb.c +++ b/trunk/drivers/video/gbefb.c @@ -979,7 +979,7 @@ static int gbefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) return 0; } -static int gbefb_mmap(struct fb_info *info, +static int gbefb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { unsigned long size = vma->vm_end - vma->vm_start; @@ -1000,6 +1000,7 @@ static int gbefb_mmap(struct fb_info *info, pgprot_fb(pgprot_val(vma->vm_page_prot)); vma->vm_flags |= VM_IO | VM_RESERVED; + vma->vm_file = file; /* look for the starting tile */ tile = &gbe_tiles.cpu[offset >> TILE_SHIFT]; diff --git a/trunk/drivers/video/geode/gx1fb_core.c b/trunk/drivers/video/geode/gx1fb_core.c index 20e69156d728..8e8da7433994 100644 --- a/trunk/drivers/video/geode/gx1fb_core.c +++ b/trunk/drivers/video/geode/gx1fb_core.c @@ -215,11 +215,11 @@ static int __init gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *d if (ret < 0) return ret; - ret = pci_request_region(dev, 0, "gx1fb (video)"); + ret = pci_request_region(dev, 1, "gx1fb (video)"); if (ret < 0) return ret; - par->vid_regs = ioremap(pci_resource_start(dev, 0), - pci_resource_len(dev, 0)); + par->vid_regs = ioremap(pci_resource_start(dev, 1), + pci_resource_len(dev, 1)); if (!par->vid_regs) return -ENOMEM; @@ -229,9 +229,12 @@ static int __init gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *d if (!par->dc_regs) return -ENOMEM; + ret = pci_request_region(dev, 0, "gx1fb (frame buffer)"); + if (ret < 0 ) + return -EBUSY; if ((fb_len = gx1_frame_buffer_size()) < 0) return -ENOMEM; - info->fix.smem_start = gx_base + 0x800000; + info->fix.smem_start = pci_resource_start(dev, 0); info->fix.smem_len = fb_len; info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len); if (!info->screen_base) diff --git a/trunk/drivers/video/igafb.c b/trunk/drivers/video/igafb.c index 6b88050d21bf..e326f44f652d 100644 --- a/trunk/drivers/video/igafb.c +++ b/trunk/drivers/video/igafb.c @@ -219,7 +219,7 @@ static void iga_blank_border(struct iga_par *par) } #ifdef __sparc__ -static int igafb_mmap(struct fb_info *info, +static int igafb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct iga_par *par = (struct iga_par *)info->par; diff --git a/trunk/drivers/video/imsttfb.c b/trunk/drivers/video/imsttfb.c index ad416ae47596..a5d813050db5 100644 --- a/trunk/drivers/video/imsttfb.c +++ b/trunk/drivers/video/imsttfb.c @@ -1267,7 +1267,8 @@ imsttfb_cursor(struct fb_info *info, struct fb_cursor *cursor) #define FBIMSTT_GETIDXREG 0x545406 static int -imsttfb_ioctl(struct fb_info *info, u_int cmd, u_long arg) +imsttfb_ioctl(struct inode *inode, struct file *file, u_int cmd, + u_long arg, struct fb_info *info) { struct imstt_par *par = info->par; void __user *argp = (void __user *)arg; diff --git a/trunk/drivers/video/intelfb/intelfbdrv.c b/trunk/drivers/video/intelfb/intelfbdrv.c index 6b8bd3cdf9c0..0090544842f5 100644 --- a/trunk/drivers/video/intelfb/intelfbdrv.c +++ b/trunk/drivers/video/intelfb/intelfbdrv.c @@ -157,8 +157,9 @@ static int intelfb_cursor(struct fb_info *info, static int intelfb_sync(struct fb_info *info); -static int intelfb_ioctl(struct fb_info *info, - unsigned int cmd, unsigned long arg); +static int intelfb_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + struct fb_info *info); static int __devinit intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent); @@ -1379,7 +1380,8 @@ intelfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) /* When/if we have our own ioctls. */ static int -intelfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +intelfb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { int retval = 0; diff --git a/trunk/drivers/video/kyro/fbdev.c b/trunk/drivers/video/kyro/fbdev.c index 477ad297de4e..bcd359b6d4ff 100644 --- a/trunk/drivers/video/kyro/fbdev.c +++ b/trunk/drivers/video/kyro/fbdev.c @@ -586,8 +586,9 @@ static int __init kyrofb_setup(char *options) } #endif -static int kyrofb_ioctl(struct fb_info *info, - unsigned int cmd, unsigned long arg) +static int kyrofb_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + struct fb_info *info) { overlay_create ol_create; overlay_viewport_set ol_viewport_set; diff --git a/trunk/drivers/video/leo.c b/trunk/drivers/video/leo.c index a23cfdb9d826..494287f8f8bf 100644 --- a/trunk/drivers/video/leo.c +++ b/trunk/drivers/video/leo.c @@ -32,8 +32,9 @@ static int leo_setcolreg(unsigned, unsigned, unsigned, unsigned, unsigned, struct fb_info *); static int leo_blank(int, struct fb_info *); -static int leo_mmap(struct fb_info *, struct vm_area_struct *); -static int leo_ioctl(struct fb_info *, unsigned int, unsigned long); +static int leo_mmap(struct fb_info *, struct file *, struct vm_area_struct *); +static int leo_ioctl(struct inode *, struct file *, unsigned int, + unsigned long, struct fb_info *); static int leo_pan_display(struct fb_var_screeninfo *, struct fb_info *); /* @@ -362,7 +363,7 @@ static struct sbus_mmap_map leo_mmap_map[] = { { .size = 0 } }; -static int leo_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int leo_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct leo_par *par = (struct leo_par *)info->par; @@ -372,7 +373,8 @@ static int leo_mmap(struct fb_info *info, struct vm_area_struct *vma) vma); } -static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +static int leo_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct leo_par *par = (struct leo_par *) info->par; diff --git a/trunk/drivers/video/matrox/matroxfb_base.c b/trunk/drivers/video/matrox/matroxfb_base.c index 4055ff6f5a81..1e74f4cca53b 100644 --- a/trunk/drivers/video/matrox/matroxfb_base.c +++ b/trunk/drivers/video/matrox/matroxfb_base.c @@ -865,8 +865,9 @@ static struct matrox_altout panellink_output = { .name = "Panellink output", }; -static int matroxfb_ioctl(struct fb_info *info, - unsigned int cmd, unsigned long arg) +static int matroxfb_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + struct fb_info *info) { void __user *argp = (void __user *)arg; MINFO_FROM_INFO(info); diff --git a/trunk/drivers/video/matrox/matroxfb_crtc2.c b/trunk/drivers/video/matrox/matroxfb_crtc2.c index 27eb4bb4f89f..d52d7d825c41 100644 --- a/trunk/drivers/video/matrox/matroxfb_crtc2.c +++ b/trunk/drivers/video/matrox/matroxfb_crtc2.c @@ -419,10 +419,11 @@ static int matroxfb_dh_get_vblank(const struct matroxfb_dh_fb_info* m2info, stru return 0; } -static int matroxfb_dh_ioctl(struct fb_info *info, +static int matroxfb_dh_ioctl(struct inode* inode, + struct file* file, unsigned int cmd, - unsigned long arg) -{ + unsigned long arg, + struct fb_info* info) { #define m2info (container_of(info, struct matroxfb_dh_fb_info, fbcon)) MINFO_FROM(m2info->primary_dev); @@ -456,7 +457,7 @@ static int matroxfb_dh_ioctl(struct fb_info *info, case MATROXFB_GET_OUTPUT_MODE: case MATROXFB_GET_ALL_OUTPUTS: { - return ACCESS_FBINFO(fbcon.fbops)->fb_ioctl(&ACCESS_FBINFO(fbcon), cmd, arg); + return ACCESS_FBINFO(fbcon.fbops)->fb_ioctl(inode, file, cmd, arg, &ACCESS_FBINFO(fbcon)); } case MATROXFB_SET_OUTPUT_CONNECTION: { diff --git a/trunk/drivers/video/matrox/matroxfb_maven.c b/trunk/drivers/video/matrox/matroxfb_maven.c index 6019710dc298..a1f2c5e8fc88 100644 --- a/trunk/drivers/video/matrox/matroxfb_maven.c +++ b/trunk/drivers/video/matrox/matroxfb_maven.c @@ -968,7 +968,7 @@ static inline int maven_compute_timming(struct maven_data* md, return 0; } -static int maven_program_timming(struct maven_data* md, +static inline int maven_program_timming(struct maven_data* md, const struct mavenregs* m) { struct i2c_client* c = md->client; diff --git a/trunk/drivers/video/neofb.c b/trunk/drivers/video/neofb.c index 747602aa5615..e18c9f98a401 100644 --- a/trunk/drivers/video/neofb.c +++ b/trunk/drivers/video/neofb.c @@ -853,7 +853,7 @@ static int neofb_set_par(struct fb_info *info) /* If the user did not specify any display devices, then... */ if (par->PanelDispCntlReg1 == 0x00) { /* Default to internal (i.e., LCD) only. */ - par->PanelDispCntlReg1 = vga_rgfx(NULL, 0x20) & 0x03; + par->PanelDispCntlReg1 |= 0x02; } /* If we are using a fixed mode, then tell the chip we are. */ diff --git a/trunk/drivers/video/p9100.c b/trunk/drivers/video/p9100.c index 0d1957505359..b251e754e16c 100644 --- a/trunk/drivers/video/p9100.c +++ b/trunk/drivers/video/p9100.c @@ -31,8 +31,9 @@ static int p9100_setcolreg(unsigned, unsigned, unsigned, unsigned, unsigned, struct fb_info *); static int p9100_blank(int, struct fb_info *); -static int p9100_mmap(struct fb_info *, struct vm_area_struct *); -static int p9100_ioctl(struct fb_info *, unsigned int, unsigned long); +static int p9100_mmap(struct fb_info *, struct file *, struct vm_area_struct *); +static int p9100_ioctl(struct inode *, struct file *, unsigned int, + unsigned long, struct fb_info *); /* * Frame buffer operations @@ -221,7 +222,7 @@ static struct sbus_mmap_map p9100_mmap_map[] = { { 0, 0, 0 } }; -static int p9100_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int p9100_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct p9100_par *par = (struct p9100_par *)info->par; @@ -231,8 +232,8 @@ static int p9100_mmap(struct fb_info *info, struct vm_area_struct *vma) vma); } -static int p9100_ioctl(struct fb_info *info, unsigned int cmd, - unsigned long arg) +static int p9100_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct p9100_par *par = (struct p9100_par *) info->par; diff --git a/trunk/drivers/video/pm3fb.c b/trunk/drivers/video/pm3fb.c index 0e78ddc81583..2e11b601c488 100644 --- a/trunk/drivers/video/pm3fb.c +++ b/trunk/drivers/video/pm3fb.c @@ -657,7 +657,9 @@ static void pm3fb_set_disp(const void *par, struct display *disp, static void pm3fb_detect(void); static int pm3fb_pan_display(const struct fb_var_screeninfo *var, struct fb_info_gen *info); -static int pm3fb_ioctl(struct fb_info *info, u_int cmd, u_long arg); +static int pm3fb_ioctl(struct inode *inode, struct file *file, + u_int cmd, u_long arg, int con, + struct fb_info *info); /* the struct that hold them together */ @@ -3436,7 +3438,9 @@ static int pm3fb_pan_display(const struct fb_var_screeninfo *var, return 0; } -static int pm3fb_ioctl(struct fb_info *info, u_int cmd, u_long arg) +static int pm3fb_ioctl(struct inode *inode, struct file *file, + u_int cmd, u_long arg, int con, + struct fb_info *info) { struct pm3fb_info *l_fb_info = (struct pm3fb_info *) info; u32 cm, i; diff --git a/trunk/drivers/video/pmag-aa-fb.c b/trunk/drivers/video/pmag-aa-fb.c index d92f352211ef..28d1fe5fe340 100644 --- a/trunk/drivers/video/pmag-aa-fb.c +++ b/trunk/drivers/video/pmag-aa-fb.c @@ -299,7 +299,8 @@ static int aafb_set_cmap(struct fb_cmap *cmap, int kspc, int con, return -EINVAL; } -static int aafb_ioctl(struct fb_info *info, u32 cmd, unsigned long arg) +static int aafb_ioctl(struct inode *inode, struct file *file, u32 cmd, + unsigned long arg, int con, struct fb_info *info) { /* TODO: Not yet implemented */ return -ENOIOCTLCMD; diff --git a/trunk/drivers/video/pxafb.c b/trunk/drivers/video/pxafb.c index 53ad61f1038c..9fc10b9e6f57 100644 --- a/trunk/drivers/video/pxafb.c +++ b/trunk/drivers/video/pxafb.c @@ -395,7 +395,7 @@ static int pxafb_blank(int blank, struct fb_info *info) return 0; } -static int pxafb_mmap(struct fb_info *info, +static int pxafb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct pxafb_info *fbi = (struct pxafb_info *)info; diff --git a/trunk/drivers/video/radeonfb.c b/trunk/drivers/video/radeonfb.c index db9fb9074dbc..600318f708f2 100644 --- a/trunk/drivers/video/radeonfb.c +++ b/trunk/drivers/video/radeonfb.c @@ -1497,8 +1497,8 @@ static int radeonfb_pan_display (struct fb_var_screeninfo *var, } -static int radeonfb_ioctl (struct fb_info *info, unsigned int cmd, - unsigned long arg) +static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct radeonfb_info *rinfo = (struct radeonfb_info *) info; unsigned int tmp; diff --git a/trunk/drivers/video/sa1100fb.c b/trunk/drivers/video/sa1100fb.c index 8a893ce7040d..087e58689e4c 100644 --- a/trunk/drivers/video/sa1100fb.c +++ b/trunk/drivers/video/sa1100fb.c @@ -815,7 +815,7 @@ static int sa1100fb_blank(int blank, struct fb_info *info) return 0; } -static int sa1100fb_mmap(struct fb_info *info, +static int sa1100fb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; diff --git a/trunk/drivers/video/sgivwfb.c b/trunk/drivers/video/sgivwfb.c index 2e6df1fcb2b9..7054660767e4 100644 --- a/trunk/drivers/video/sgivwfb.c +++ b/trunk/drivers/video/sgivwfb.c @@ -115,7 +115,7 @@ static int sgivwfb_set_par(struct fb_info *info); static int sgivwfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); -static int sgivwfb_mmap(struct fb_info *info, +static int sgivwfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma); static struct fb_ops sgivwfb_ops = { @@ -706,7 +706,7 @@ static int sgivwfb_setcolreg(u_int regno, u_int red, u_int green, return 0; } -static int sgivwfb_mmap(struct fb_info *info, +static int sgivwfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { unsigned long size = vma->vm_end - vma->vm_start; @@ -723,6 +723,7 @@ static int sgivwfb_mmap(struct fb_info *info, if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT, size, vma->vm_page_prot)) return -EAGAIN; + vma->vm_file = file; printk(KERN_DEBUG "sgivwfb: mmap framebuffer P(%lx)->V(%lx)\n", offset, vma->vm_start); return 0; diff --git a/trunk/drivers/video/sis/sis_main.c b/trunk/drivers/video/sis/sis_main.c index 8adf5bf91eee..dea1a46c67c4 100644 --- a/trunk/drivers/video/sis/sis_main.c +++ b/trunk/drivers/video/sis/sis_main.c @@ -1743,14 +1743,13 @@ sisfb_blank(int blank, struct fb_info *info) /* ----------- FBDev related routines for all series ---------- */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) -static int sisfb_ioctl(struct fb_info *info, unsigned int cmd, - unsigned long arg) -#else -static int sisfb_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - struct fb_info *info) +static int +sisfb_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + int con, #endif + struct fb_info *info) { struct sis_video_info *ivideo = (struct sis_video_info *)info->par; struct sis_memreq sismemreq; @@ -1925,6 +1924,19 @@ static int sisfb_ioctl(struct inode *inode, struct file *file, return 0; } +#ifdef SIS_NEW_CONFIG_COMPAT +static long +sisfb_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg, struct fb_info *info) +{ + int ret; + + lock_kernel(); + ret = sisfb_ioctl(NULL, f, cmd, arg, info); + unlock_kernel(); + return ret; +} +#endif + static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info) { @@ -1995,7 +2007,7 @@ static struct fb_ops sisfb_ops = { #endif .fb_sync = fbcon_sis_sync, #ifdef SIS_NEW_CONFIG_COMPAT - .fb_compat_ioctl= sisfb_ioctl, + .fb_compat_ioctl= sisfb_compat_ioctl, #endif .fb_ioctl = sisfb_ioctl }; diff --git a/trunk/drivers/video/sis/sis_main.h b/trunk/drivers/video/sis/sis_main.h index 70b6df371b8e..445bcbba03ae 100644 --- a/trunk/drivers/video/sis/sis_main.h +++ b/trunk/drivers/video/sis/sis_main.h @@ -727,14 +727,9 @@ static int sisfb_ioctl(struct inode *inode, struct file *file, #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) -static int sisfb_ioctl(struct fb_info *info, unsigned int cmd, - unsigned long arg); -#else static int sisfb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg, struct fb_info *info); -#endif static int sisfb_set_par(struct fb_info *info); static int sisfb_blank(int blank, struct fb_info *info); diff --git a/trunk/drivers/video/sstfb.c b/trunk/drivers/video/sstfb.c index 99921df35474..8a5ce210bb27 100644 --- a/trunk/drivers/video/sstfb.c +++ b/trunk/drivers/video/sstfb.c @@ -771,7 +771,8 @@ static int sstfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, return 0; } -static int sstfb_ioctl(struct fb_info *info, u_int cmd, u_long arg) +static int sstfb_ioctl(struct inode *inode, struct file *file, + u_int cmd, u_long arg, struct fb_info *info ) { struct sstfb_par *par = info->par; struct pci_dev *sst_dev = par->dev; diff --git a/trunk/drivers/video/tcx.c b/trunk/drivers/video/tcx.c index 95b918229d9b..2b27b4474001 100644 --- a/trunk/drivers/video/tcx.c +++ b/trunk/drivers/video/tcx.c @@ -33,8 +33,9 @@ static int tcx_setcolreg(unsigned, unsigned, unsigned, unsigned, unsigned, struct fb_info *); static int tcx_blank(int, struct fb_info *); -static int tcx_mmap(struct fb_info *, struct vm_area_struct *); -static int tcx_ioctl(struct fb_info *, unsigned int, unsigned long); +static int tcx_mmap(struct fb_info *, struct file *, struct vm_area_struct *); +static int tcx_ioctl(struct inode *, struct file *, unsigned int, + unsigned long, struct fb_info *); static int tcx_pan_display(struct fb_var_screeninfo *, struct fb_info *); /* @@ -301,7 +302,7 @@ static struct sbus_mmap_map __tcx_mmap_map[TCX_MMAP_ENTRIES] = { { .size = 0 } }; -static int tcx_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int tcx_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { struct tcx_par *par = (struct tcx_par *)info->par; @@ -311,8 +312,8 @@ static int tcx_mmap(struct fb_info *info, struct vm_area_struct *vma) vma); } -static int tcx_ioctl(struct fb_info *info, unsigned int cmd, - unsigned long arg) +static int tcx_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info) { struct tcx_par *par = (struct tcx_par *) info->par; diff --git a/trunk/drivers/video/vfb.c b/trunk/drivers/video/vfb.c index 53208cb58396..ffa1ad474226 100644 --- a/trunk/drivers/video/vfb.c +++ b/trunk/drivers/video/vfb.c @@ -81,7 +81,7 @@ static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int vfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); -static int vfb_mmap(struct fb_info *info, +static int vfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma); static struct fb_ops vfb_ops = { @@ -368,7 +368,7 @@ static int vfb_pan_display(struct fb_var_screeninfo *var, * Most drivers don't need their own mmap function */ -static int vfb_mmap(struct fb_info *info, +static int vfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma) { return -EINVAL; diff --git a/trunk/fs/9p/conv.c b/trunk/fs/9p/conv.c index 32a9f99154e2..55ccfa10ee9e 100644 --- a/trunk/fs/9p/conv.c +++ b/trunk/fs/9p/conv.c @@ -56,7 +56,7 @@ static inline int buf_check_overflow(struct cbuf *buf) return buf->p > buf->ep; } -static int buf_check_size(struct cbuf *buf, int len) +static inline int buf_check_size(struct cbuf *buf, int len) { if (buf->p + len > buf->ep) { if (buf->p < buf->ep) { @@ -72,7 +72,7 @@ static int buf_check_size(struct cbuf *buf, int len) return 1; } -static void *buf_alloc(struct cbuf *buf, int len) +static inline void *buf_alloc(struct cbuf *buf, int len) { void *ret = NULL; @@ -84,7 +84,7 @@ static void *buf_alloc(struct cbuf *buf, int len) return ret; } -static void buf_put_int8(struct cbuf *buf, u8 val) +static inline void buf_put_int8(struct cbuf *buf, u8 val) { if (buf_check_size(buf, 1)) { buf->p[0] = val; @@ -92,7 +92,7 @@ static void buf_put_int8(struct cbuf *buf, u8 val) } } -static void buf_put_int16(struct cbuf *buf, u16 val) +static inline void buf_put_int16(struct cbuf *buf, u16 val) { if (buf_check_size(buf, 2)) { *(__le16 *) buf->p = cpu_to_le16(val); @@ -100,7 +100,7 @@ static void buf_put_int16(struct cbuf *buf, u16 val) } } -static void buf_put_int32(struct cbuf *buf, u32 val) +static inline void buf_put_int32(struct cbuf *buf, u32 val) { if (buf_check_size(buf, 4)) { *(__le32 *)buf->p = cpu_to_le32(val); @@ -108,7 +108,7 @@ static void buf_put_int32(struct cbuf *buf, u32 val) } } -static void buf_put_int64(struct cbuf *buf, u64 val) +static inline void buf_put_int64(struct cbuf *buf, u64 val) { if (buf_check_size(buf, 8)) { *(__le64 *)buf->p = cpu_to_le64(val); @@ -116,7 +116,7 @@ static void buf_put_int64(struct cbuf *buf, u64 val) } } -static void buf_put_stringn(struct cbuf *buf, const char *s, u16 slen) +static inline void buf_put_stringn(struct cbuf *buf, const char *s, u16 slen) { if (buf_check_size(buf, slen + 2)) { buf_put_int16(buf, slen); @@ -130,7 +130,7 @@ static inline void buf_put_string(struct cbuf *buf, const char *s) buf_put_stringn(buf, s, strlen(s)); } -static u8 buf_get_int8(struct cbuf *buf) +static inline u8 buf_get_int8(struct cbuf *buf) { u8 ret = 0; @@ -142,7 +142,7 @@ static u8 buf_get_int8(struct cbuf *buf) return ret; } -static u16 buf_get_int16(struct cbuf *buf) +static inline u16 buf_get_int16(struct cbuf *buf) { u16 ret = 0; @@ -154,7 +154,7 @@ static u16 buf_get_int16(struct cbuf *buf) return ret; } -static u32 buf_get_int32(struct cbuf *buf) +static inline u32 buf_get_int32(struct cbuf *buf) { u32 ret = 0; @@ -166,7 +166,7 @@ static u32 buf_get_int32(struct cbuf *buf) return ret; } -static u64 buf_get_int64(struct cbuf *buf) +static inline u64 buf_get_int64(struct cbuf *buf) { u64 ret = 0; @@ -178,7 +178,7 @@ static u64 buf_get_int64(struct cbuf *buf) return ret; } -static void buf_get_str(struct cbuf *buf, struct v9fs_str *vstr) +static inline void buf_get_str(struct cbuf *buf, struct v9fs_str *vstr) { vstr->len = buf_get_int16(buf); if (!buf_check_overflow(buf) && buf_check_size(buf, vstr->len)) { @@ -190,7 +190,7 @@ static void buf_get_str(struct cbuf *buf, struct v9fs_str *vstr) } } -static void buf_get_qid(struct cbuf *bufp, struct v9fs_qid *qid) +static inline void buf_get_qid(struct cbuf *bufp, struct v9fs_qid *qid) { qid->type = buf_get_int8(bufp); qid->version = buf_get_int32(bufp); @@ -254,7 +254,7 @@ static int v9fs_size_wstat(struct v9fs_wstat *wstat, int extended) * */ -static void +static inline void buf_get_stat(struct cbuf *bufp, struct v9fs_stat *stat, int extended) { stat->size = buf_get_int16(bufp); @@ -427,7 +427,7 @@ static inline void v9fs_put_int64(struct cbuf *bufp, u64 val, u64 * p) buf_put_int64(bufp, val); } -static void +static inline void v9fs_put_str(struct cbuf *bufp, char *data, struct v9fs_str *str) { if (data) { @@ -441,7 +441,7 @@ v9fs_put_str(struct cbuf *bufp, char *data, struct v9fs_str *str) buf_put_stringn(bufp, data, str->len); } -static int +static inline int v9fs_put_user_data(struct cbuf *bufp, const char __user * data, int count, unsigned char **pdata) { diff --git a/trunk/fs/autofs4/root.c b/trunk/fs/autofs4/root.c index 62d8d4acb8bb..e93a7ae467c9 100644 --- a/trunk/fs/autofs4/root.c +++ b/trunk/fs/autofs4/root.c @@ -195,8 +195,6 @@ static int autofs4_dir_open(struct inode *inode, struct file *file) if (!empty) d_invalidate(dentry); - nd.dentry = dentry; - nd.mnt = mnt; nd.flags = LOOKUP_DIRECTORY; status = (dentry->d_op->d_revalidate)(dentry, &nd); diff --git a/trunk/fs/binfmt_elf.c b/trunk/fs/binfmt_elf.c index 1b117a441298..f979ebbce49c 100644 --- a/trunk/fs/binfmt_elf.c +++ b/trunk/fs/binfmt_elf.c @@ -1218,7 +1218,7 @@ static int writenote(struct memelfnote *men, struct file *file) if (!dump_seek(file, (off))) \ goto end_coredump; -static void fill_elf_header(struct elfhdr *elf, int segs) +static inline void fill_elf_header(struct elfhdr *elf, int segs) { memcpy(elf->e_ident, ELFMAG, SELFMAG); elf->e_ident[EI_CLASS] = ELF_CLASS; @@ -1243,7 +1243,7 @@ static void fill_elf_header(struct elfhdr *elf, int segs) return; } -static void fill_elf_note_phdr(struct elf_phdr *phdr, int sz, off_t offset) +static inline void fill_elf_note_phdr(struct elf_phdr *phdr, int sz, off_t offset) { phdr->p_type = PT_NOTE; phdr->p_offset = offset; diff --git a/trunk/fs/binfmt_misc.c b/trunk/fs/binfmt_misc.c index 6a7b730c206b..9ccc7d8275b8 100644 --- a/trunk/fs/binfmt_misc.c +++ b/trunk/fs/binfmt_misc.c @@ -264,7 +264,7 @@ static int unquote(char *from) return p - from; } -static char * check_special_flags (char * sfs, Node * e) +static inline char * check_special_flags (char * sfs, Node * e) { char * p = sfs; int cont = 1; diff --git a/trunk/fs/bio.c b/trunk/fs/bio.c index bbc442b8c867..7b3069589951 100644 --- a/trunk/fs/bio.c +++ b/trunk/fs/bio.c @@ -123,7 +123,7 @@ static void bio_fs_destructor(struct bio *bio) bio_free(bio, fs_bio_set); } -void bio_init(struct bio *bio) +inline void bio_init(struct bio *bio) { bio->bi_next = NULL; bio->bi_bdev = NULL; @@ -253,7 +253,7 @@ inline int bio_hw_segments(request_queue_t *q, struct bio *bio) * the actual data it points to. Reference count of returned * bio will be one. */ -void __bio_clone(struct bio *bio, struct bio *bio_src) +inline void __bio_clone(struct bio *bio, struct bio *bio_src) { request_queue_t *q = bdev_get_queue(bio_src->bi_bdev); diff --git a/trunk/fs/buffer.c b/trunk/fs/buffer.c index 7cdf48a9a501..b9bb7ad6897b 100644 --- a/trunk/fs/buffer.c +++ b/trunk/fs/buffer.c @@ -1165,7 +1165,7 @@ grow_dev_page(struct block_device *bdev, sector_t block, * some of those buffers may be aliases of filesystem data. * grow_dev_page() will go BUG() if this happens. */ -static int +static inline int grow_buffers(struct block_device *bdev, sector_t block, int size) { struct page *page; @@ -1391,7 +1391,7 @@ static void bh_lru_install(struct buffer_head *bh) /* * Look up the bh in this cpu's LRU. If it's there, move it to the head. */ -static struct buffer_head * +static inline struct buffer_head * lookup_bh_lru(struct block_device *bdev, sector_t block, int size) { struct buffer_head *ret = NULL; @@ -1541,7 +1541,7 @@ EXPORT_SYMBOL(set_bh_page); /* * Called when truncating a buffer on a page completely. */ -static void discard_buffer(struct buffer_head * bh) +static inline void discard_buffer(struct buffer_head * bh) { lock_buffer(bh); clear_buffer_dirty(bh); diff --git a/trunk/fs/char_dev.c b/trunk/fs/char_dev.c index 21195c481637..3b1b1eefdbb0 100644 --- a/trunk/fs/char_dev.c +++ b/trunk/fs/char_dev.c @@ -35,7 +35,7 @@ static struct char_device_struct { unsigned int major; unsigned int baseminor; int minorct; - char name[64]; + const char *name; struct file_operations *fops; struct cdev *cdev; /* will die */ } *chrdevs[MAX_PROBE_HASH]; @@ -46,84 +46,34 @@ static inline int major_to_index(int major) return major % MAX_PROBE_HASH; } -struct chrdev_info { - int index; - struct char_device_struct *cd; -}; - -void *get_next_chrdev(void *dev) -{ - struct chrdev_info *info; - - if (dev == NULL) { - info = kmalloc(sizeof(*info), GFP_KERNEL); - if (!info) - goto out; - info->index=0; - info->cd = chrdevs[info->index]; - if (info->cd) - goto out; - } else { - info = dev; - } - - while (info->index < ARRAY_SIZE(chrdevs)) { - if (info->cd) - info->cd = info->cd->next; - if (info->cd) - goto out; - /* - * No devices on this chain, move to the next - */ - info->index++; - info->cd = (info->index < ARRAY_SIZE(chrdevs)) ? - chrdevs[info->index] : NULL; - if (info->cd) - goto out; - } - -out: - return info; -} - -void *acquire_chrdev_list(void) -{ - down(&chrdevs_lock); - return get_next_chrdev(NULL); -} - -void release_chrdev_list(void *dev) -{ - up(&chrdevs_lock); - kfree(dev); -} - - -int count_chrdev_list(void) +/* get char device names in somewhat random order */ +int get_chrdev_list(char *page) { struct char_device_struct *cd; - int i, count; + int i, len; - count = 0; + len = sprintf(page, "Character devices:\n"); + down(&chrdevs_lock); for (i = 0; i < ARRAY_SIZE(chrdevs) ; i++) { - for (cd = chrdevs[i]; cd; cd = cd->next) - count++; + for (cd = chrdevs[i]; cd; cd = cd->next) { + /* + * if the current name, plus the 5 extra characters + * in the device line for this entry + * would run us off the page, we're done + */ + if ((len+strlen(cd->name) + 5) >= PAGE_SIZE) + goto page_full; + + + len += sprintf(page+len, "%3d %s\n", + cd->major, cd->name); + } } +page_full: + up(&chrdevs_lock); - return count; -} - -int get_chrdev_info(void *dev, int *major, char **name) -{ - struct chrdev_info *info = dev; - - if (info->cd == NULL) - return 1; - - *major = info->cd->major; - *name = info->cd->name; - return 0; + return len; } /* @@ -171,7 +121,7 @@ __register_chrdev_region(unsigned int major, unsigned int baseminor, cd->major = major; cd->baseminor = baseminor; cd->minorct = minorct; - strncpy(cd->name,name, 64); + cd->name = name; i = major_to_index(major); diff --git a/trunk/fs/compat.c b/trunk/fs/compat.c index 2468ac1df2f0..271b75d1597f 100644 --- a/trunk/fs/compat.c +++ b/trunk/fs/compat.c @@ -1537,7 +1537,7 @@ int compat_do_execve(char * filename, * Ooo, nasty. We need here to frob 32-bit unsigned longs to * 64-bit unsigned longs. */ -static +static inline int compat_get_fd_set(unsigned long nr, compat_ulong_t __user *ufdset, unsigned long *fdset) { @@ -1570,7 +1570,7 @@ int compat_get_fd_set(unsigned long nr, compat_ulong_t __user *ufdset, return 0; } -static +static inline void compat_set_fd_set(unsigned long nr, compat_ulong_t __user *ufdset, unsigned long *fdset) { diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index 86bdb93789c6..134d6775183f 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -94,7 +94,7 @@ static void d_free(struct dentry *dentry) * d_iput() operation if defined. * Called with dcache_lock and per dentry lock held, drops both. */ -static void dentry_iput(struct dentry * dentry) +static inline void dentry_iput(struct dentry * dentry) { struct inode *inode = dentry->d_inode; if (inode) { diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 62b40af68cc4..b5bcf1aae0ab 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -575,7 +575,7 @@ static int exec_mmap(struct mm_struct *mm) * disturbing other processes. (Other processes might share the signal * table via the CLONE_SIGHAND option to clone().) */ -static int de_thread(struct task_struct *tsk) +static inline int de_thread(struct task_struct *tsk) { struct signal_struct *sig = tsk->signal; struct sighand_struct *newsighand, *oldsighand = tsk->sighand; @@ -780,7 +780,7 @@ static int de_thread(struct task_struct *tsk) * so that a new one can be started */ -static void flush_old_files(struct files_struct * files) +static inline void flush_old_files(struct files_struct * files) { long j = -1; struct fdtable *fdt; @@ -964,7 +964,7 @@ int prepare_binprm(struct linux_binprm *bprm) EXPORT_SYMBOL(prepare_binprm); -static int unsafe_exec(struct task_struct *p) +static inline int unsafe_exec(struct task_struct *p) { int unsafe = 0; if (p->ptrace & PT_PTRACED) { diff --git a/trunk/fs/ext2/namei.c b/trunk/fs/ext2/namei.c index ad1432a2a62e..c5513953c825 100644 --- a/trunk/fs/ext2/namei.c +++ b/trunk/fs/ext2/namei.c @@ -83,7 +83,10 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, str if (!inode) return ERR_PTR(-EACCES); } - return d_splice_alias(inode, dentry); + if (inode) + return d_splice_alias(inode, dentry); + d_add(dentry, inode); + return NULL; } struct dentry *ext2_get_parent(struct dentry *child) diff --git a/trunk/fs/ext3/namei.c b/trunk/fs/ext3/namei.c index 8bd8ac077704..af193a304ee5 100644 --- a/trunk/fs/ext3/namei.c +++ b/trunk/fs/ext3/namei.c @@ -1005,7 +1005,10 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str if (!inode) return ERR_PTR(-EACCES); } - return d_splice_alias(inode, dentry); + if (inode) + return d_splice_alias(inode, dentry); + d_add(dentry, inode); + return NULL; } diff --git a/trunk/fs/fcntl.c b/trunk/fs/fcntl.c index 5f96786d1c73..d0767fe58362 100644 --- a/trunk/fs/fcntl.c +++ b/trunk/fs/fcntl.c @@ -36,7 +36,7 @@ void fastcall set_close_on_exec(unsigned int fd, int flag) spin_unlock(&files->file_lock); } -static int get_close_on_exec(unsigned int fd) +static inline int get_close_on_exec(unsigned int fd) { struct files_struct *files = current->files; struct fdtable *fdt; diff --git a/trunk/fs/hugetlbfs/inode.c b/trunk/fs/hugetlbfs/inode.c index f568102da1e8..ab4c3a9d51b8 100644 --- a/trunk/fs/hugetlbfs/inode.c +++ b/trunk/fs/hugetlbfs/inode.c @@ -402,7 +402,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, uid_t uid, inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; info = HUGETLBFS_I(inode); - mpol_shared_policy_init(&info->policy, MPOL_DEFAULT, NULL); + mpol_shared_policy_init(&info->policy); switch (mode & S_IFMT) { default: init_special_inode(inode, mode, dev); diff --git a/trunk/fs/isofs/namei.c b/trunk/fs/isofs/namei.c index e7ba0c30e071..e37e82b7cbf0 100644 --- a/trunk/fs/isofs/namei.c +++ b/trunk/fs/isofs/namei.c @@ -185,5 +185,8 @@ struct dentry *isofs_lookup(struct inode * dir, struct dentry * dentry, struct n } } unlock_kernel(); - return d_splice_alias(inode, dentry); + if (inode) + return d_splice_alias(inode, dentry); + d_add(dentry, inode); + return NULL; } diff --git a/trunk/fs/jffs2/build.c b/trunk/fs/jffs2/build.c index 70f7a896c04a..fff108bb118b 100644 --- a/trunk/fs/jffs2/build.c +++ b/trunk/fs/jffs2/build.c @@ -47,7 +47,7 @@ next_inode(int *i, struct jffs2_inode_cache *ic, struct jffs2_sb_info *c) ic = next_inode(&i, ic, (c))) -static void jffs2_build_inode_pass1(struct jffs2_sb_info *c, +static inline void jffs2_build_inode_pass1(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) { struct jffs2_full_dirent *fd; diff --git a/trunk/fs/jffs2/nodelist.c b/trunk/fs/jffs2/nodelist.c index b635e167a3fa..c79eebb8ab32 100644 --- a/trunk/fs/jffs2/nodelist.c +++ b/trunk/fs/jffs2/nodelist.c @@ -134,7 +134,7 @@ static void jffs2_fragtree_insert(struct jffs2_node_frag *newfrag, struct jffs2_ /* * Allocate and initializes a new fragment. */ -static struct jffs2_node_frag * new_fragment(struct jffs2_full_dnode *fn, uint32_t ofs, uint32_t size) +static inline struct jffs2_node_frag * new_fragment(struct jffs2_full_dnode *fn, uint32_t ofs, uint32_t size) { struct jffs2_node_frag *newfrag; @@ -513,7 +513,7 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info * * Checks the node if we are in the checking stage. */ -static int check_node(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn) +static inline int check_node(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn) { int ret; diff --git a/trunk/fs/lockd/xdr.c b/trunk/fs/lockd/xdr.c index 200fbda2c6d1..f01e9c0d2677 100644 --- a/trunk/fs/lockd/xdr.c +++ b/trunk/fs/lockd/xdr.c @@ -44,7 +44,7 @@ loff_t_to_s32(loff_t offset) /* * XDR functions for basic NLM types */ -static u32 *nlm_decode_cookie(u32 *p, struct nlm_cookie *c) +static inline u32 *nlm_decode_cookie(u32 *p, struct nlm_cookie *c) { unsigned int len; @@ -79,7 +79,7 @@ nlm_encode_cookie(u32 *p, struct nlm_cookie *c) return p; } -static u32 * +static inline u32 * nlm_decode_fh(u32 *p, struct nfs_fh *f) { unsigned int len; @@ -119,7 +119,7 @@ nlm_encode_oh(u32 *p, struct xdr_netobj *oh) return xdr_encode_netobj(p, oh); } -static u32 * +static inline u32 * nlm_decode_lock(u32 *p, struct nlm_lock *lock) { struct file_lock *fl = &lock->fl; diff --git a/trunk/fs/mbcache.c b/trunk/fs/mbcache.c index f5bbe4c97c58..0f1e4530670f 100644 --- a/trunk/fs/mbcache.c +++ b/trunk/fs/mbcache.c @@ -126,7 +126,7 @@ __mb_cache_entry_is_hashed(struct mb_cache_entry *ce) } -static void +static inline void __mb_cache_entry_unhash(struct mb_cache_entry *ce) { int n; @@ -139,7 +139,7 @@ __mb_cache_entry_unhash(struct mb_cache_entry *ce) } -static void +static inline void __mb_cache_entry_forget(struct mb_cache_entry *ce, gfp_t gfp_mask) { struct mb_cache *cache = ce->e_cache; @@ -158,7 +158,7 @@ __mb_cache_entry_forget(struct mb_cache_entry *ce, gfp_t gfp_mask) } -static void +static inline void __mb_cache_entry_release_unlock(struct mb_cache_entry *ce) { /* Wake up all processes queuing for this cache entry. */ diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 33fb5bd34a81..1e5746eb1380 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -113,7 +113,7 @@ * POSIX.1 2.4: an empty pathname is invalid (ENOENT). * PATH_MAX includes the nul terminator --RR. */ -static int do_getname(const char __user *filename, char *page) +static inline int do_getname(const char __user *filename, char *page) { int retval; unsigned long len = PATH_MAX; @@ -396,7 +396,7 @@ static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, * short-cut DAC fails, then call permission() to do more * complete permission check. */ -static int exec_permission_lite(struct inode *inode, +static inline int exec_permission_lite(struct inode *inode, struct nameidata *nd) { umode_t mode = inode->i_mode; @@ -486,7 +486,7 @@ static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, s static int __emul_lookup_dentry(const char *, struct nameidata *); /* SMP-safe */ -static __always_inline int +static inline int walk_init_root(const char *name, struct nameidata *nd) { read_lock(¤t->fs->lock); @@ -504,7 +504,7 @@ walk_init_root(const char *name, struct nameidata *nd) return 1; } -static __always_inline int __vfs_follow_link(struct nameidata *nd, const char *link) +static inline int __vfs_follow_link(struct nameidata *nd, const char *link) { int res = 0; char *name; @@ -544,7 +544,7 @@ struct path { struct dentry *dentry; }; -static __always_inline int __do_follow_link(struct path *path, struct nameidata *nd) +static inline int __do_follow_link(struct path *path, struct nameidata *nd) { int error; void *cookie; @@ -690,7 +690,7 @@ int follow_down(struct vfsmount **mnt, struct dentry **dentry) return 0; } -static __always_inline void follow_dotdot(struct nameidata *nd) +static inline void follow_dotdot(struct nameidata *nd) { while(1) { struct vfsmount *parent; @@ -1294,7 +1294,7 @@ static inline int check_sticky(struct inode *dir, struct inode *inode) * 10. We don't allow removal of NFS sillyrenamed files; it's handled by * nfs_async_unlink(). */ -static int may_delete(struct inode *dir,struct dentry *victim,int isdir) +static inline int may_delete(struct inode *dir,struct dentry *victim,int isdir) { int error; @@ -2315,7 +2315,7 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, return error; } -static int do_rename(const char * oldname, const char * newname) +static inline int do_rename(const char * oldname, const char * newname) { int error = 0; struct dentry * old_dir, * new_dir; diff --git a/trunk/fs/ncpfs/inode.c b/trunk/fs/ncpfs/inode.c index d277a58bd128..8c8839203cd5 100644 --- a/trunk/fs/ncpfs/inode.c +++ b/trunk/fs/ncpfs/inode.c @@ -716,8 +716,10 @@ static void ncp_put_super(struct super_block *sb) fput(server->ncp_filp); kill_proc(server->m.wdog_pid, SIGTERM, 1); - kfree(server->priv.data); - kfree(server->auth.object_name); + if (server->priv.data) + ncp_kfree_s(server->priv.data, server->priv.len); + if (server->auth.object_name) + ncp_kfree_s(server->auth.object_name, server->auth.object_name_len); vfree(server->packet); sb->s_fs_info = NULL; kfree(server); @@ -956,6 +958,11 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr) return result; } +#ifdef DEBUG_NCP_MALLOC +int ncp_malloced; +int ncp_current_malloced; +#endif + static struct super_block *ncp_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { @@ -974,6 +981,10 @@ static int __init init_ncp_fs(void) int err; DPRINTK("ncpfs: init_module called\n"); +#ifdef DEBUG_NCP_MALLOC + ncp_malloced = 0; + ncp_current_malloced = 0; +#endif err = init_inodecache(); if (err) goto out1; @@ -992,6 +1003,10 @@ static void __exit exit_ncp_fs(void) DPRINTK("ncpfs: cleanup_module called\n"); unregister_filesystem(&ncp_fs_type); destroy_inodecache(); +#ifdef DEBUG_NCP_MALLOC + PRINTK("ncp_malloced: %d\n", ncp_malloced); + PRINTK("ncp_current_malloced: %d\n", ncp_current_malloced); +#endif } module_init(init_ncp_fs) diff --git a/trunk/fs/ncpfs/ioctl.c b/trunk/fs/ncpfs/ioctl.c index eb3813ad136f..d6e0c089e1b1 100644 --- a/trunk/fs/ncpfs/ioctl.c +++ b/trunk/fs/ncpfs/ioctl.c @@ -518,11 +518,10 @@ int ncp_ioctl(struct inode *inode, struct file *filp, if (user.object_name_len > NCP_OBJECT_NAME_MAX_LEN) return -ENOMEM; if (user.object_name_len) { - newname = kmalloc(user.object_name_len, GFP_USER); - if (!newname) - return -ENOMEM; + newname = ncp_kmalloc(user.object_name_len, GFP_USER); + if (!newname) return -ENOMEM; if (copy_from_user(newname, user.object_name, user.object_name_len)) { - kfree(newname); + ncp_kfree_s(newname, user.object_name_len); return -EFAULT; } } else { @@ -541,8 +540,8 @@ int ncp_ioctl(struct inode *inode, struct file *filp, server->priv.len = 0; server->priv.data = NULL; /* leave critical section */ - kfree(oldprivate); - kfree(oldname); + if (oldprivate) ncp_kfree_s(oldprivate, oldprivatelen); + if (oldname) ncp_kfree_s(oldname, oldnamelen); return 0; } case NCP_IOC_GETPRIVATEDATA: @@ -582,11 +581,10 @@ int ncp_ioctl(struct inode *inode, struct file *filp, if (user.len > NCP_PRIVATE_DATA_MAX_LEN) return -ENOMEM; if (user.len) { - new = kmalloc(user.len, GFP_USER); - if (!new) - return -ENOMEM; + new = ncp_kmalloc(user.len, GFP_USER); + if (!new) return -ENOMEM; if (copy_from_user(new, user.data, user.len)) { - kfree(new); + ncp_kfree_s(new, user.len); return -EFAULT; } } else { @@ -598,7 +596,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp, server->priv.len = user.len; server->priv.data = new; /* leave critical section */ - kfree(old); + if (old) ncp_kfree_s(old, oldlen); return 0; } diff --git a/trunk/fs/nfsd/nfsxdr.c b/trunk/fs/nfsd/nfsxdr.c index e3a0797dd56b..aa7bb41b293d 100644 --- a/trunk/fs/nfsd/nfsxdr.c +++ b/trunk/fs/nfsd/nfsxdr.c @@ -37,7 +37,7 @@ static u32 nfs_ftypes[] = { /* * XDR functions for basic NFS types */ -static u32 * +static inline u32 * decode_fh(u32 *p, struct svc_fh *fhp) { fh_init(fhp, NFS_FHSIZE); @@ -151,7 +151,7 @@ decode_sattr(u32 *p, struct iattr *iap) return p; } -static u32 * +static inline u32 * encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp, struct kstat *stat) { diff --git a/trunk/fs/pipe.c b/trunk/fs/pipe.c index d722579df79a..eef0f29e86ef 100644 --- a/trunk/fs/pipe.c +++ b/trunk/fs/pipe.c @@ -50,7 +50,7 @@ void pipe_wait(struct inode * inode) mutex_lock(PIPE_MUTEX(*inode)); } -static int +static inline int pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len) { unsigned long copy; @@ -70,7 +70,7 @@ pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len) return 0; } -static int +static inline int pipe_iov_copy_to_user(struct iovec *iov, const void *from, unsigned long len) { unsigned long copy; diff --git a/trunk/fs/proc/proc_misc.c b/trunk/fs/proc/proc_misc.c index 8f8014285a34..63bf6c00fa0c 100644 --- a/trunk/fs/proc/proc_misc.c +++ b/trunk/fs/proc/proc_misc.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -63,6 +62,7 @@ */ extern int get_hardware_list(char *); extern int get_stram_list(char *); +extern int get_chrdev_list(char *); extern int get_filesystem_list(char *); extern int get_exec_domain_list(char *); extern int get_dma_list(char *); @@ -248,154 +248,6 @@ static int cpuinfo_open(struct inode *inode, struct file *file) { return seq_open(file, &cpuinfo_op); } - -enum devinfo_states { - CHR_HDR, - CHR_LIST, - BLK_HDR, - BLK_LIST, - DEVINFO_DONE -}; - -struct devinfo_state { - void *chrdev; - void *blkdev; - unsigned int num_records; - unsigned int cur_record; - enum devinfo_states state; -}; - -static void *devinfo_start(struct seq_file *f, loff_t *pos) -{ - struct devinfo_state *info = f->private; - - if (*pos) { - if ((info) && (*pos <= info->num_records)) - return info; - return NULL; - } - info = kmalloc(sizeof(*info), GFP_KERNEL); - f->private = info; - info->chrdev = acquire_chrdev_list(); - info->blkdev = acquire_blkdev_list(); - info->state = CHR_HDR; - info->num_records = count_chrdev_list(); - info->num_records += count_blkdev_list(); - info->num_records += 2; /* Character and Block headers */ - *pos = 1; - info->cur_record = *pos; - return info; -} - -static void *devinfo_next(struct seq_file *f, void *v, loff_t *pos) -{ - int idummy; - char *ndummy; - struct devinfo_state *info = f->private; - - switch (info->state) { - case CHR_HDR: - info->state = CHR_LIST; - (*pos)++; - /*fallthrough*/ - case CHR_LIST: - if (get_chrdev_info(info->chrdev,&idummy,&ndummy)) { - /* - * The character dev list is complete - */ - info->state = BLK_HDR; - } else { - info->chrdev = get_next_chrdev(info->chrdev); - } - (*pos)++; - break; - case BLK_HDR: - info->state = BLK_LIST; - (*pos)++; - break; - case BLK_LIST: - if (get_blkdev_info(info->blkdev,&idummy,&ndummy)) { - /* - * The block dev list is complete - */ - info->state = DEVINFO_DONE; - } else { - info->blkdev = get_next_blkdev(info->blkdev); - } - (*pos)++; - break; - case DEVINFO_DONE: - (*pos)++; - info->cur_record = *pos; - info = NULL; - break; - default: - break; - } - if (info) - info->cur_record = *pos; - return info; -} - -static void devinfo_stop(struct seq_file *f, void *v) -{ - struct devinfo_state *info = f->private; - - if (info) { - release_chrdev_list(info->chrdev); - release_blkdev_list(info->blkdev); - f->private = NULL; - kfree(info); - } -} - -static int devinfo_show(struct seq_file *f, void *arg) -{ - int major; - char *name; - struct devinfo_state *info = f->private; - - switch(info->state) { - case CHR_HDR: - seq_printf(f,"Character devices:\n"); - /* fallthrough */ - case CHR_LIST: - if (!get_chrdev_info(info->chrdev,&major,&name)) - seq_printf(f,"%3d %s\n",major,name); - break; - case BLK_HDR: - seq_printf(f,"\nBlock devices:\n"); - /* fallthrough */ - case BLK_LIST: - if (!get_blkdev_info(info->blkdev,&major,&name)) - seq_printf(f,"%3d %s\n",major,name); - break; - default: - break; - } - - return 0; -} - -static struct seq_operations devinfo_op = { - .start = devinfo_start, - .next = devinfo_next, - .stop = devinfo_stop, - .show = devinfo_show, -}; - -static int devinfo_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &devinfo_op); -} - -static struct file_operations proc_devinfo_operations = { - .open = devinfo_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - static struct file_operations proc_cpuinfo_operations = { .open = cpuinfo_open, .read = seq_read, @@ -598,6 +450,14 @@ static struct file_operations proc_stat_operations = { .release = single_release, }; +static int devices_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = get_chrdev_list(page); + len += get_blkdev_list(page+len, len); + return proc_calc_metrics(page, start, off, count, eof, len); +} + /* * /proc/interrupts */ @@ -722,6 +582,7 @@ void __init proc_misc_init(void) #ifdef CONFIG_STRAM_PROC {"stram", stram_read_proc}, #endif + {"devices", devices_read_proc}, {"filesystems", filesystems_read_proc}, {"cmdline", cmdline_read_proc}, {"locks", locks_read_proc}, @@ -737,7 +598,6 @@ void __init proc_misc_init(void) entry = create_proc_entry("kmsg", S_IRUSR, &proc_root); if (entry) entry->proc_fops = &proc_kmsg_operations; - create_seq_entry("devices", 0, &proc_devinfo_operations); create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); create_seq_entry("partitions", 0, &proc_partitions_operations); create_seq_entry("stat", 0, &proc_stat_operations); diff --git a/trunk/fs/quota_v2.c b/trunk/fs/quota_v2.c index a4ef91bb4f3b..7afcbb1b9376 100644 --- a/trunk/fs/quota_v2.c +++ b/trunk/fs/quota_v2.c @@ -35,8 +35,7 @@ static int v2_check_quota_file(struct super_block *sb, int type) size = sb->s_op->quota_read(sb, type, (char *)&dqhead, sizeof(struct v2_disk_dqheader), 0); if (size != sizeof(struct v2_disk_dqheader)) { - printk("quota_v2: failed read expected=%d got=%d\n", - sizeof(struct v2_disk_dqheader), size); + printk("failed read\n"); return 0; } if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type] || diff --git a/trunk/fs/reiserfs/namei.c b/trunk/fs/reiserfs/namei.c index 8f8d8d01107c..3549067c42d9 100644 --- a/trunk/fs/reiserfs/namei.c +++ b/trunk/fs/reiserfs/namei.c @@ -375,7 +375,11 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry, return ERR_PTR(-EIO); } - return d_splice_alias(inode, dentry); + if (inode) + return d_splice_alias(inode, dentry); + + d_add(dentry, inode); + return NULL; } /* diff --git a/trunk/fs/smbfs/Makefile b/trunk/fs/smbfs/Makefile index 6673ee82cb4c..93246b7dd6fb 100644 --- a/trunk/fs/smbfs/Makefile +++ b/trunk/fs/smbfs/Makefile @@ -13,6 +13,7 @@ smbfs-objs := proc.o dir.o cache.o sock.o inode.o file.o ioctl.o getopt.o \ EXTRA_CFLAGS += -DSMBFS_PARANOIA #EXTRA_CFLAGS += -DSMBFS_DEBUG #EXTRA_CFLAGS += -DSMBFS_DEBUG_VERBOSE +#EXTRA_CFLAGS += -DDEBUG_SMB_MALLOC #EXTRA_CFLAGS += -DDEBUG_SMB_TIMESTAMP #EXTRA_CFLAGS += -Werror diff --git a/trunk/fs/smbfs/inode.c b/trunk/fs/smbfs/inode.c index 02e3e82d465c..6ec88bf59b2d 100644 --- a/trunk/fs/smbfs/inode.c +++ b/trunk/fs/smbfs/inode.c @@ -487,11 +487,11 @@ smb_put_super(struct super_block *sb) if (server->conn_pid) kill_proc(server->conn_pid, SIGTERM, 1); - kfree(server->ops); + smb_kfree(server->ops); smb_unload_nls(server); sb->s_fs_info = NULL; smb_unlock_server(server); - kfree(server); + smb_kfree(server); } static int smb_fill_super(struct super_block *sb, void *raw_data, int silent) @@ -519,10 +519,11 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent) sb->s_op = &smb_sops; sb->s_time_gran = 100; - server = kzalloc(sizeof(struct smb_sb_info), GFP_KERNEL); + server = smb_kmalloc(sizeof(struct smb_sb_info), GFP_KERNEL); if (!server) goto out_no_server; sb->s_fs_info = server; + memset(server, 0, sizeof(struct smb_sb_info)); server->super_block = sb; server->mnt = NULL; @@ -541,8 +542,8 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent) /* FIXME: move these to the smb_sb_info struct */ VERBOSE("alloc chunk = %d\n", sizeof(struct smb_ops) + sizeof(struct smb_mount_data_kernel)); - mem = kmalloc(sizeof(struct smb_ops) + - sizeof(struct smb_mount_data_kernel), GFP_KERNEL); + mem = smb_kmalloc(sizeof(struct smb_ops) + + sizeof(struct smb_mount_data_kernel), GFP_KERNEL); if (!mem) goto out_no_mem; @@ -620,12 +621,12 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent) out_no_smbiod: smb_unload_nls(server); out_bad_option: - kfree(mem); + smb_kfree(mem); out_no_mem: if (!server->mnt) printk(KERN_ERR "smb_fill_super: allocation failure\n"); sb->s_fs_info = NULL; - kfree(server); + smb_kfree(server); goto out_fail; out_wrong_data: printk(KERN_ERR "smbfs: mount_data version %d is not supported\n", ver); @@ -781,6 +782,12 @@ smb_notify_change(struct dentry *dentry, struct iattr *attr) return error; } +#ifdef DEBUG_SMB_MALLOC +int smb_malloced; +int smb_current_kmalloced; +int smb_current_vmalloced; +#endif + static struct super_block *smb_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { @@ -800,6 +807,12 @@ static int __init init_smb_fs(void) int err; DEBUG1("registering ...\n"); +#ifdef DEBUG_SMB_MALLOC + smb_malloced = 0; + smb_current_kmalloced = 0; + smb_current_vmalloced = 0; +#endif + err = init_inodecache(); if (err) goto out_inode; @@ -824,6 +837,11 @@ static void __exit exit_smb_fs(void) unregister_filesystem(&smb_fs_type); smb_destroy_request_cache(); destroy_inodecache(); +#ifdef DEBUG_SMB_MALLOC + printk(KERN_DEBUG "smb_malloced: %d\n", smb_malloced); + printk(KERN_DEBUG "smb_current_kmalloced: %d\n",smb_current_kmalloced); + printk(KERN_DEBUG "smb_current_vmalloced: %d\n",smb_current_vmalloced); +#endif } module_init(init_smb_fs) diff --git a/trunk/fs/smbfs/request.c b/trunk/fs/smbfs/request.c index c71c375863cc..a0f296d9928a 100644 --- a/trunk/fs/smbfs/request.c +++ b/trunk/fs/smbfs/request.c @@ -68,7 +68,7 @@ static struct smb_request *smb_do_alloc_request(struct smb_sb_info *server, goto out; if (bufsize > 0) { - buf = kmalloc(bufsize, GFP_NOFS); + buf = smb_kmalloc(bufsize, GFP_NOFS); if (!buf) { kmem_cache_free(req_cachep, req); return NULL; @@ -124,8 +124,9 @@ static void smb_free_request(struct smb_request *req) { atomic_dec(&req->rq_server->nr_requests); if (req->rq_buffer && !(req->rq_flags & SMB_REQ_STATIC)) - kfree(req->rq_buffer); - kfree(req->rq_trans2buffer); + smb_kfree(req->rq_buffer); + if (req->rq_trans2buffer) + smb_kfree(req->rq_trans2buffer); kmem_cache_free(req_cachep, req); } @@ -182,7 +183,8 @@ static int smb_setup_request(struct smb_request *req) req->rq_err = 0; req->rq_errno = 0; req->rq_fragment = 0; - kfree(req->rq_trans2buffer); + if (req->rq_trans2buffer) + smb_kfree(req->rq_trans2buffer); return 0; } @@ -645,9 +647,10 @@ static int smb_recv_trans2(struct smb_sb_info *server, struct smb_request *req) goto out_too_long; req->rq_trans2bufsize = buf_len; - req->rq_trans2buffer = kzalloc(buf_len, GFP_NOFS); + req->rq_trans2buffer = smb_kmalloc(buf_len, GFP_NOFS); if (!req->rq_trans2buffer) goto out_no_mem; + memset(req->rq_trans2buffer, 0, buf_len); req->rq_parm = req->rq_trans2buffer; req->rq_data = req->rq_trans2buffer + parm_tot; diff --git a/trunk/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/trunk/include/asm-arm/arch-ixp2000/ixp2000-regs.h index 2b57f91b4ebd..8cf70ff160af 100644 --- a/trunk/include/asm-arm/arch-ixp2000/ixp2000-regs.h +++ b/trunk/include/asm-arm/arch-ixp2000/ixp2000-regs.h @@ -26,8 +26,6 @@ * fc000000 da000000 16M PCI CFG0 * fd000000 d8000000 16M PCI I/O * fe[0-7]00000 8M per-platform mappings - * fe900000 80000000 1M SRAM #0 (first MB) - * fea00000 cb400000 1M SCRATCH ring get/put * feb00000 c8000000 1M MSF * fec00000 df000000 1M PCI CSRs * fed00000 de000000 1M PCI CREG @@ -93,14 +91,6 @@ #define IXP2000_MSF_VIRT_BASE 0xfeb00000 #define IXP2000_MSF_SIZE 0x00100000 -#define IXP2000_SCRATCH_RING_PHYS_BASE 0xcb400000 -#define IXP2000_SCRATCH_RING_VIRT_BASE 0xfea00000 -#define IXP2000_SCRATCH_RING_SIZE 0x00100000 - -#define IXP2000_SRAM0_PHYS_BASE 0x80000000 -#define IXP2000_SRAM0_VIRT_BASE 0xfe900000 -#define IXP2000_SRAM0_SIZE 0x00100000 - #define IXP2000_PCI_IO_PHYS_BASE 0xd8000000 #define IXP2000_PCI_IO_VIRT_BASE 0xfd000000 #define IXP2000_PCI_IO_SIZE 0x01000000 diff --git a/trunk/include/asm-arm/arch-versatile/entry-macro.S b/trunk/include/asm-arm/arch-versatile/entry-macro.S index feff771c0a0a..58f0d71759f6 100644 --- a/trunk/include/asm-arm/arch-versatile/entry-macro.S +++ b/trunk/include/asm-arm/arch-versatile/entry-macro.S @@ -8,7 +8,6 @@ * warranty of any kind, whether express or implied. */ #include -#include .macro disable_fiq .endm diff --git a/trunk/include/asm-arm/arch-versatile/platform.h b/trunk/include/asm-arm/arch-versatile/platform.h index 72ef874567d5..cbdd9fb96332 100644 --- a/trunk/include/asm-arm/arch-versatile/platform.h +++ b/trunk/include/asm-arm/arch-versatile/platform.h @@ -293,7 +293,26 @@ * VERSATILE_SYS_IC * */ -/* VIC definitions in include/asm-arm/hardware/vic.h */ +#define VIC_IRQ_STATUS 0 +#define VIC_FIQ_STATUS 0x04 +#define VIC_IRQ_RAW_STATUS 0x08 +#define VIC_INT_SELECT 0x0C /* 1 = FIQ, 0 = IRQ */ +#define VIC_IRQ_ENABLE 0x10 /* 1 = enable, 0 = disable */ +#define VIC_IRQ_ENABLE_CLEAR 0x14 +#define VIC_IRQ_SOFT 0x18 +#define VIC_IRQ_SOFT_CLEAR 0x1C +#define VIC_PROTECT 0x20 +#define VIC_VECT_ADDR 0x30 +#define VIC_DEF_VECT_ADDR 0x34 +#define VIC_VECT_ADDR0 0x100 /* 0 to 15 */ +#define VIC_VECT_CNTL0 0x200 /* 0 to 15 */ +#define VIC_ITCR 0x300 /* VIC test control register */ + +#define VIC_FIQ_RAW_STATUS 0x08 +#define VIC_FIQ_ENABLE 0x10 /* 1 = enable, 0 = disable */ +#define VIC_FIQ_ENABLE_CLEAR 0x14 +#define VIC_FIQ_SOFT 0x18 +#define VIC_FIQ_SOFT_CLEAR 0x1C #define SIC_IRQ_STATUS 0 #define SIC_IRQ_RAW_STATUS 0x04 @@ -306,6 +325,8 @@ #define SIC_INT_PIC_ENABLES 0x20 /* set interrupt pass through bits */ #define SIC_INT_PIC_ENABLEC 0x24 /* Clear interrupt pass through bits */ +#define VICVectCntl_Enable (1 << 5) + /* ------------------------------------------------------------------------ * Interrupts - bit assignment (primary) * ------------------------------------------------------------------------ diff --git a/trunk/include/asm-arm/hardware/vic.h b/trunk/include/asm-arm/hardware/vic.h deleted file mode 100644 index 81825eb54c9e..000000000000 --- a/trunk/include/asm-arm/hardware/vic.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * linux/include/asm-arm/hardware/vic.h - * - * Copyright (c) ARM Limited 2003. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __ASM_ARM_HARDWARE_VIC_H -#define __ASM_ARM_HARDWARE_VIC_H - -#define VIC_IRQ_STATUS 0x00 -#define VIC_FIQ_STATUS 0x04 -#define VIC_RAW_STATUS 0x08 -#define VIC_INT_SELECT 0x0c /* 1 = FIQ, 0 = IRQ */ -#define VIC_INT_ENABLE 0x10 /* 1 = enable, 0 = disable */ -#define VIC_INT_ENABLE_CLEAR 0x14 -#define VIC_INT_SOFT 0x18 -#define VIC_INT_SOFT_CLEAR 0x1c -#define VIC_PROTECT 0x20 -#define VIC_VECT_ADDR 0x30 -#define VIC_DEF_VECT_ADDR 0x34 - -#define VIC_VECT_ADDR0 0x100 /* 0 to 15 */ -#define VIC_VECT_CNTL0 0x200 /* 0 to 15 */ -#define VIC_ITCR 0x300 /* VIC test control register */ - -#define VIC_VECT_CNTL_ENABLE (1 << 5) - -#ifndef __ASSEMBLY__ -void vic_init(void __iomem *base, u32 vic_sources); -#endif - -#endif diff --git a/trunk/include/asm-arm/mach/arch.h b/trunk/include/asm-arm/mach/arch.h index 8222bf9fc366..eb262e078c46 100644 --- a/trunk/include/asm-arm/mach/arch.h +++ b/trunk/include/asm-arm/mach/arch.h @@ -20,7 +20,7 @@ struct machine_desc { * by assembler code in head-armv.S */ unsigned int nr; /* architecture number */ - unsigned int __deprecated phys_ram; /* start of physical ram */ + unsigned int phys_ram; /* start of physical ram */ unsigned int phys_io; /* start of physical io */ unsigned int io_pg_offst; /* byte offset for io * page tabe entry */ diff --git a/trunk/include/asm-arm/page.h b/trunk/include/asm-arm/page.h index 416320d95419..4da1d532cbeb 100644 --- a/trunk/include/asm-arm/page.h +++ b/trunk/include/asm-arm/page.h @@ -170,13 +170,6 @@ extern pmd_t *top_pmd; #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -/* - * With EABI on ARMv5 and above we must have 64-bit aligned slab pointers. - */ -#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) -#define ARCH_SLAB_MINALIGN 8 -#endif - #endif /* __KERNEL__ */ #include diff --git a/trunk/include/asm-arm/processor.h b/trunk/include/asm-arm/processor.h index 04f4d34c6317..31290694648b 100644 --- a/trunk/include/asm-arm/processor.h +++ b/trunk/include/asm-arm/processor.h @@ -49,12 +49,6 @@ struct thread_struct { #define INIT_THREAD { } -#ifdef CONFIG_MMU -#define nommu_start_thread(regs) do { } while (0) -#else -#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data -#endif - #define start_thread(regs,pc,sp) \ ({ \ unsigned long *stack = (unsigned long *)sp; \ @@ -71,7 +65,6 @@ struct thread_struct { regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ regs->ARM_r1 = stack[1]; /* r1 (argv) */ \ regs->ARM_r0 = stack[0]; /* r0 (argc) */ \ - nommu_start_thread(regs); \ }) /* Forward declaration, a strange C thing */ diff --git a/trunk/include/asm-arm/ptrace.h b/trunk/include/asm-arm/ptrace.h index 77adb7fa169b..4377e22b7e1a 100644 --- a/trunk/include/asm-arm/ptrace.h +++ b/trunk/include/asm-arm/ptrace.h @@ -23,9 +23,6 @@ #define PTRACE_OLDSETOPTIONS 21 #define PTRACE_GET_THREAD_AREA 22 - -#define PTRACE_SET_SYSCALL 23 - /* * PSR bits */ @@ -63,11 +60,9 @@ #ifndef __ASSEMBLY__ -/* - * This struct defines the way the registers are stored on the - * stack during a system call. Note that sizeof(struct pt_regs) - * has to be a multiple of 8. - */ +/* this struct defines the way the registers are stored on the + stack during a system call. */ + struct pt_regs { long uregs[18]; }; diff --git a/trunk/include/asm-arm/stat.h b/trunk/include/asm-arm/stat.h index 42c0c13999d5..ec4e2c2e3b47 100644 --- a/trunk/include/asm-arm/stat.h +++ b/trunk/include/asm-arm/stat.h @@ -70,7 +70,14 @@ struct stat64 { long long st_size; unsigned long st_blksize; - unsigned long long st_blocks; /* Number 512-byte blocks allocated. */ + +#if defined(__ARMEB__) + unsigned long __pad4; /* Future possible st_blocks hi bits */ + unsigned long st_blocks; /* Number 512-byte blocks allocated. */ +#else /* Must be little */ + unsigned long st_blocks; /* Number 512-byte blocks allocated. */ + unsigned long __pad4; /* Future possible st_blocks hi bits */ +#endif unsigned long st_atime; unsigned long st_atime_nsec; @@ -82,6 +89,6 @@ struct stat64 { unsigned long st_ctime_nsec; unsigned long long st_ino; -}; +} __attribute__((packed)); #endif diff --git a/trunk/include/asm-arm/statfs.h b/trunk/include/asm-arm/statfs.h index a02e6a8c3d70..e81f82783b87 100644 --- a/trunk/include/asm-arm/statfs.h +++ b/trunk/include/asm-arm/statfs.h @@ -1,42 +1,6 @@ #ifndef _ASMARM_STATFS_H #define _ASMARM_STATFS_H -#ifndef __KERNEL_STRICT_NAMES -# include -typedef __kernel_fsid_t fsid_t; -#endif - -struct statfs { - __u32 f_type; - __u32 f_bsize; - __u32 f_blocks; - __u32 f_bfree; - __u32 f_bavail; - __u32 f_files; - __u32 f_ffree; - __kernel_fsid_t f_fsid; - __u32 f_namelen; - __u32 f_frsize; - __u32 f_spare[5]; -}; - -/* - * With EABI there is 4 bytes of padding added to this structure. - * Let's pack it so the padding goes away to simplify dual ABI support. - * Note that user space does NOT have to pack this structure. - */ -struct statfs64 { - __u32 f_type; - __u32 f_bsize; - __u64 f_blocks; - __u64 f_bfree; - __u64 f_bavail; - __u64 f_files; - __u64 f_ffree; - __kernel_fsid_t f_fsid; - __u32 f_namelen; - __u32 f_frsize; - __u32 f_spare[5]; -} __attribute__ ((packed,aligned(4))); +#include #endif diff --git a/trunk/include/asm-arm/unistd.h b/trunk/include/asm-arm/unistd.h index 77430d6178ae..d626e70faded 100644 --- a/trunk/include/asm-arm/unistd.h +++ b/trunk/include/asm-arm/unistd.h @@ -15,12 +15,10 @@ #include -#define __NR_OABI_SYSCALL_BASE 0x900000 - -#if defined(__thumb__) || defined(__ARM_EABI__) +#if defined(__thumb__) #define __NR_SYSCALL_BASE 0 #else -#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE +#define __NR_SYSCALL_BASE 0x900000 #endif /* @@ -375,13 +373,13 @@ #define __sys1(x) __sys2(x) #ifndef __syscall -#if defined(__thumb__) || defined(__ARM_EABI__) -#define __SYS_REG(name) register long __sysreg __asm__("r7") = __NR_##name; -#define __SYS_REG_LIST(regs...) "r" (__sysreg) , ##regs -#define __syscall(name) "swi\t0" +#if defined(__thumb__) +#define __syscall(name) \ + "push {r7}\n\t" \ + "mov r7, #" __sys1(__NR_##name) "\n\t" \ + "swi 0\n\t" \ + "pop {r7}" #else -#define __SYS_REG(name) -#define __SYS_REG_LIST(regs...) regs #define __syscall(name) "swi\t" __sys1(__NR_##name) "" #endif #endif @@ -397,34 +395,33 @@ do { \ #define _syscall0(type,name) \ type name(void) { \ - __SYS_REG(name) \ register long __res_r0 __asm__("r0"); \ long __res; \ __asm__ __volatile__ ( \ __syscall(name) \ : "=r" (__res_r0) \ - : __SYS_REG_LIST() ); \ + : \ + : "lr"); \ __res = __res_r0; \ __syscall_return(type,__res); \ } #define _syscall1(type,name,type1,arg1) \ type name(type1 arg1) { \ - __SYS_REG(name) \ register long __r0 __asm__("r0") = (long)arg1; \ register long __res_r0 __asm__("r0"); \ long __res; \ __asm__ __volatile__ ( \ __syscall(name) \ : "=r" (__res_r0) \ - : __SYS_REG_LIST( "0" (__r0) ) ); \ + : "r" (__r0) \ + : "lr"); \ __res = __res_r0; \ __syscall_return(type,__res); \ } #define _syscall2(type,name,type1,arg1,type2,arg2) \ type name(type1 arg1,type2 arg2) { \ - __SYS_REG(name) \ register long __r0 __asm__("r0") = (long)arg1; \ register long __r1 __asm__("r1") = (long)arg2; \ register long __res_r0 __asm__("r0"); \ @@ -432,7 +429,8 @@ type name(type1 arg1,type2 arg2) { \ __asm__ __volatile__ ( \ __syscall(name) \ : "=r" (__res_r0) \ - : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) ); \ + : "r" (__r0),"r" (__r1) \ + : "lr"); \ __res = __res_r0; \ __syscall_return(type,__res); \ } @@ -440,7 +438,6 @@ type name(type1 arg1,type2 arg2) { \ #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ type name(type1 arg1,type2 arg2,type3 arg3) { \ - __SYS_REG(name) \ register long __r0 __asm__("r0") = (long)arg1; \ register long __r1 __asm__("r1") = (long)arg2; \ register long __r2 __asm__("r2") = (long)arg3; \ @@ -449,7 +446,8 @@ type name(type1 arg1,type2 arg2,type3 arg3) { \ __asm__ __volatile__ ( \ __syscall(name) \ : "=r" (__res_r0) \ - : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) ); \ + : "r" (__r0),"r" (__r1),"r" (__r2) \ + : "lr"); \ __res = __res_r0; \ __syscall_return(type,__res); \ } @@ -457,7 +455,6 @@ type name(type1 arg1,type2 arg2,type3 arg3) { \ #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ - __SYS_REG(name) \ register long __r0 __asm__("r0") = (long)arg1; \ register long __r1 __asm__("r1") = (long)arg2; \ register long __r2 __asm__("r2") = (long)arg3; \ @@ -467,7 +464,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ __asm__ __volatile__ ( \ __syscall(name) \ : "=r" (__res_r0) \ - : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) ); \ + : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3) \ + : "lr"); \ __res = __res_r0; \ __syscall_return(type,__res); \ } @@ -475,7 +473,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \ - __SYS_REG(name) \ register long __r0 __asm__("r0") = (long)arg1; \ register long __r1 __asm__("r1") = (long)arg2; \ register long __r2 __asm__("r2") = (long)arg3; \ @@ -486,15 +483,14 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \ __asm__ __volatile__ ( \ __syscall(name) \ : "=r" (__res_r0) \ - : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ - "r" (__r3), "r" (__r4) ) ); \ + : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3),"r" (__r4) \ + : "lr"); \ __res = __res_r0; \ __syscall_return(type,__res); \ } #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) { \ - __SYS_REG(name) \ register long __r0 __asm__("r0") = (long)arg1; \ register long __r1 __asm__("r1") = (long)arg2; \ register long __r2 __asm__("r2") = (long)arg3; \ @@ -506,33 +502,30 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 __asm__ __volatile__ ( \ __syscall(name) \ : "=r" (__res_r0) \ - : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ - "r" (__r3), "r" (__r4), "r" (__r5) ) ); \ + : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3), "r" (__r4),"r" (__r5) \ + : "lr"); \ __res = __res_r0; \ __syscall_return(type,__res); \ } #ifdef __KERNEL__ #define __ARCH_WANT_IPC_PARSE_VERSION +#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_STAT64 +#define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_PAUSE +#define __ARCH_WANT_SYS_TIME +#define __ARCH_WANT_SYS_UTIME +#define __ARCH_WANT_SYS_SOCKETCALL #define __ARCH_WANT_SYS_GETPGRP #define __ARCH_WANT_SYS_LLSEEK #define __ARCH_WANT_SYS_NICE +#define __ARCH_WANT_SYS_OLD_GETRLIMIT +#define __ARCH_WANT_SYS_OLDUMOUNT #define __ARCH_WANT_SYS_SIGPENDING #define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_RT_SIGACTION - -#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT) -#define __ARCH_WANT_SYS_TIME -#define __ARCH_WANT_SYS_OLDUMOUNT -#define __ARCH_WANT_SYS_ALARM -#define __ARCH_WANT_SYS_UTIME -#define __ARCH_WANT_SYS_OLD_GETRLIMIT -#define __ARCH_WANT_OLD_READDIR -#define __ARCH_WANT_SYS_SOCKETCALL -#endif #endif #ifdef __KERNEL_SYSCALLS__ diff --git a/trunk/include/asm-i386/bitops.h b/trunk/include/asm-i386/bitops.h index 88e6ca248cd7..fe0819fe9c64 100644 --- a/trunk/include/asm-i386/bitops.h +++ b/trunk/include/asm-i386/bitops.h @@ -247,7 +247,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long* addr) static int test_bit(int nr, const volatile void * addr); #endif -static __always_inline int constant_test_bit(int nr, const volatile unsigned long *addr) +static inline int constant_test_bit(int nr, const volatile unsigned long *addr) { return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0; } diff --git a/trunk/include/asm-i386/current.h b/trunk/include/asm-i386/current.h index 3cbbecd79016..d97328951f5f 100644 --- a/trunk/include/asm-i386/current.h +++ b/trunk/include/asm-i386/current.h @@ -5,7 +5,7 @@ struct task_struct; -static __always_inline struct task_struct * get_current(void) +static inline struct task_struct * get_current(void) { return current_thread_info()->task; } diff --git a/trunk/include/asm-i386/string.h b/trunk/include/asm-i386/string.h index bb5f88a27f7a..02c8f5d22065 100644 --- a/trunk/include/asm-i386/string.h +++ b/trunk/include/asm-i386/string.h @@ -201,7 +201,7 @@ __asm__ __volatile__( return __res; } -static __always_inline void * __memcpy(void * to, const void * from, size_t n) +static inline void * __memcpy(void * to, const void * from, size_t n) { int d0, d1, d2; __asm__ __volatile__( @@ -223,7 +223,7 @@ return (to); * This looks ugly, but the compiler can optimize it totally, * as the count is constant. */ -static __always_inline void * __constant_memcpy(void * to, const void * from, size_t n) +static inline void * __constant_memcpy(void * to, const void * from, size_t n) { long esi, edi; if (!n) return to; @@ -367,7 +367,7 @@ return s; * things 32 bits at a time even when we don't know the size of the * area at compile-time.. */ -static __always_inline void * __constant_c_memset(void * s, unsigned long c, size_t count) +static inline void * __constant_c_memset(void * s, unsigned long c, size_t count) { int d0, d1; __asm__ __volatile__( @@ -416,7 +416,7 @@ extern char *strstr(const char *cs, const char *ct); * This looks horribly ugly, but the compiler can optimize it totally, * as we by now know that both pattern and count is constant.. */ -static __always_inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count) +static inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count) { switch (count) { case 0: diff --git a/trunk/include/asm-i386/uaccess.h b/trunk/include/asm-i386/uaccess.h index 3f1337c34208..89ab7e2bc5aa 100644 --- a/trunk/include/asm-i386/uaccess.h +++ b/trunk/include/asm-i386/uaccess.h @@ -411,7 +411,7 @@ unsigned long __must_check __copy_from_user_ll(void *to, * Returns number of bytes that could not be copied. * On success, this will be zero. */ -static __always_inline unsigned long __must_check +static inline unsigned long __must_check __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n) { if (__builtin_constant_p(n)) { @@ -432,7 +432,7 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n) return __copy_to_user_ll(to, from, n); } -static __always_inline unsigned long __must_check +static inline unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n) { might_sleep(); @@ -456,7 +456,7 @@ __copy_to_user(void __user *to, const void *from, unsigned long n) * If some data could not be copied, this function will pad the copied * data to the requested size using zero bytes. */ -static __always_inline unsigned long +static inline unsigned long __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) { if (__builtin_constant_p(n)) { @@ -477,7 +477,7 @@ __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) return __copy_from_user_ll(to, from, n); } -static __always_inline unsigned long +static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) { might_sleep(); diff --git a/trunk/include/asm-ia64/sn/ioc3.h b/trunk/include/asm-ia64/sn/ioc3.h deleted file mode 100644 index 95ed6cc83cf1..000000000000 --- a/trunk/include/asm-ia64/sn/ioc3.h +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (C) 2005 Silicon Graphics, Inc. - */ -#ifndef IA64_SN_IOC3_H -#define IA64_SN_IOC3_H - -/* serial port register map */ -struct ioc3_serialregs { - uint32_t sscr; - uint32_t stpir; - uint32_t stcir; - uint32_t srpir; - uint32_t srcir; - uint32_t srtr; - uint32_t shadow; -}; - -/* SUPERIO uart register map */ -struct ioc3_uartregs { - char iu_lcr; - union { - char iir; /* read only */ - char fcr; /* write only */ - } u3; - union { - char ier; /* DLAB == 0 */ - char dlm; /* DLAB == 1 */ - } u2; - union { - char rbr; /* read only, DLAB == 0 */ - char thr; /* write only, DLAB == 0 */ - char dll; /* DLAB == 1 */ - } u1; - char iu_scr; - char iu_msr; - char iu_lsr; - char iu_mcr; -}; - -#define iu_rbr u1.rbr -#define iu_thr u1.thr -#define iu_dll u1.dll -#define iu_ier u2.ier -#define iu_dlm u2.dlm -#define iu_iir u3.iir -#define iu_fcr u3.fcr - -struct ioc3_sioregs { - char fill[0x170]; - struct ioc3_uartregs uartb; - struct ioc3_uartregs uarta; -}; - -/* PCI IO/mem space register map */ -struct ioc3 { - uint32_t pci_id; - uint32_t pci_scr; - uint32_t pci_rev; - uint32_t pci_lat; - uint32_t pci_addr; - uint32_t pci_err_addr_l; - uint32_t pci_err_addr_h; - - uint32_t sio_ir; - /* these registers are read-only for general kernel code. To - * modify them use the functions in ioc3.c - */ - uint32_t sio_ies; - uint32_t sio_iec; - uint32_t sio_cr; - uint32_t int_out; - uint32_t mcr; - uint32_t gpcr_s; - uint32_t gpcr_c; - uint32_t gpdr; - uint32_t gppr[9]; - char fill[0x4c]; - - /* serial port registers */ - uint32_t sbbr_h; - uint32_t sbbr_l; - - struct ioc3_serialregs port_a; - struct ioc3_serialregs port_b; - char fill1[0x1ff10]; - /* superio registers */ - struct ioc3_sioregs sregs; -}; - -/* These don't exist on the ioc3 serial card... */ -#define eier fill1[8] -#define eisr fill1[4] - -#define PCI_LAT 0xc /* Latency Timer */ -#define PCI_SCR_DROP_MODE_EN 0x00008000 /* drop pios on parity err */ -#define UARTA_BASE 0x178 -#define UARTB_BASE 0x170 - - -/* bitmasks for serial RX status byte */ -#define RXSB_OVERRUN 0x01 /* char(s) lost */ -#define RXSB_PAR_ERR 0x02 /* parity error */ -#define RXSB_FRAME_ERR 0x04 /* framing error */ -#define RXSB_BREAK 0x08 /* break character */ -#define RXSB_CTS 0x10 /* state of CTS */ -#define RXSB_DCD 0x20 /* state of DCD */ -#define RXSB_MODEM_VALID 0x40 /* DCD, CTS and OVERRUN are valid */ -#define RXSB_DATA_VALID 0x80 /* FRAME_ERR PAR_ERR & BREAK valid */ - -/* bitmasks for serial TX control byte */ -#define TXCB_INT_WHEN_DONE 0x20 /* interrupt after this byte is sent */ -#define TXCB_INVALID 0x00 /* byte is invalid */ -#define TXCB_VALID 0x40 /* byte is valid */ -#define TXCB_MCR 0x80 /* data<7:0> to modem cntrl register */ -#define TXCB_DELAY 0xc0 /* delay data<7:0> mSec */ - -/* bitmasks for SBBR_L */ -#define SBBR_L_SIZE 0x00000001 /* 0 1KB rings, 1 4KB rings */ - -/* bitmasks for SSCR_ */ -#define SSCR_RX_THRESHOLD 0x000001ff /* hiwater mark */ -#define SSCR_TX_TIMER_BUSY 0x00010000 /* TX timer in progress */ -#define SSCR_HFC_EN 0x00020000 /* h/w flow cntrl enabled */ -#define SSCR_RX_RING_DCD 0x00040000 /* postRX record on delta-DCD */ -#define SSCR_RX_RING_CTS 0x00080000 /* postRX record on delta-CTS */ -#define SSCR_HIGH_SPD 0x00100000 /* 4X speed */ -#define SSCR_DIAG 0x00200000 /* bypass clock divider */ -#define SSCR_RX_DRAIN 0x08000000 /* drain RX buffer to memory */ -#define SSCR_DMA_EN 0x10000000 /* enable ring buffer DMA */ -#define SSCR_DMA_PAUSE 0x20000000 /* pause DMA */ -#define SSCR_PAUSE_STATE 0x40000000 /* set when PAUSE takes effect*/ -#define SSCR_RESET 0x80000000 /* reset DMA channels */ - -/* all producer/comsumer pointers are the same bitfield */ -#define PROD_CONS_PTR_4K 0x00000ff8 /* for 4K buffers */ -#define PROD_CONS_PTR_1K 0x000003f8 /* for 1K buffers */ -#define PROD_CONS_PTR_OFF 3 - -/* bitmasks for SRCIR_ */ -#define SRCIR_ARM 0x80000000 /* arm RX timer */ - -/* bitmasks for SHADOW_ */ -#define SHADOW_DR 0x00000001 /* data ready */ -#define SHADOW_OE 0x00000002 /* overrun error */ -#define SHADOW_PE 0x00000004 /* parity error */ -#define SHADOW_FE 0x00000008 /* framing error */ -#define SHADOW_BI 0x00000010 /* break interrupt */ -#define SHADOW_THRE 0x00000020 /* transmit holding reg empty */ -#define SHADOW_TEMT 0x00000040 /* transmit shift reg empty */ -#define SHADOW_RFCE 0x00000080 /* char in RX fifo has error */ -#define SHADOW_DCTS 0x00010000 /* delta clear to send */ -#define SHADOW_DDCD 0x00080000 /* delta data carrier detect */ -#define SHADOW_CTS 0x00100000 /* clear to send */ -#define SHADOW_DCD 0x00800000 /* data carrier detect */ -#define SHADOW_DTR 0x01000000 /* data terminal ready */ -#define SHADOW_RTS 0x02000000 /* request to send */ -#define SHADOW_OUT1 0x04000000 /* 16550 OUT1 bit */ -#define SHADOW_OUT2 0x08000000 /* 16550 OUT2 bit */ -#define SHADOW_LOOP 0x10000000 /* loopback enabled */ - -/* bitmasks for SRTR_ */ -#define SRTR_CNT 0x00000fff /* reload value for RX timer */ -#define SRTR_CNT_VAL 0x0fff0000 /* current value of RX timer */ -#define SRTR_CNT_VAL_SHIFT 16 -#define SRTR_HZ 16000 /* SRTR clock frequency */ - -/* bitmasks for SIO_IR, SIO_IEC and SIO_IES */ -#define SIO_IR_SA_TX_MT 0x00000001 /* Serial port A TX empty */ -#define SIO_IR_SA_RX_FULL 0x00000002 /* port A RX buf full */ -#define SIO_IR_SA_RX_HIGH 0x00000004 /* port A RX hiwat */ -#define SIO_IR_SA_RX_TIMER 0x00000008 /* port A RX timeout */ -#define SIO_IR_SA_DELTA_DCD 0x00000010 /* port A delta DCD */ -#define SIO_IR_SA_DELTA_CTS 0x00000020 /* port A delta CTS */ -#define SIO_IR_SA_INT 0x00000040 /* port A pass-thru intr */ -#define SIO_IR_SA_TX_EXPLICIT 0x00000080 /* port A explicit TX thru */ -#define SIO_IR_SA_MEMERR 0x00000100 /* port A PCI error */ -#define SIO_IR_SB_TX_MT 0x00000200 -#define SIO_IR_SB_RX_FULL 0x00000400 -#define SIO_IR_SB_RX_HIGH 0x00000800 -#define SIO_IR_SB_RX_TIMER 0x00001000 -#define SIO_IR_SB_DELTA_DCD 0x00002000 -#define SIO_IR_SB_DELTA_CTS 0x00004000 -#define SIO_IR_SB_INT 0x00008000 -#define SIO_IR_SB_TX_EXPLICIT 0x00010000 -#define SIO_IR_SB_MEMERR 0x00020000 -#define SIO_IR_PP_INT 0x00040000 /* P port pass-thru intr */ -#define SIO_IR_PP_INTA 0x00080000 /* PP context A thru */ -#define SIO_IR_PP_INTB 0x00100000 /* PP context B thru */ -#define SIO_IR_PP_MEMERR 0x00200000 /* PP PCI error */ -#define SIO_IR_KBD_INT 0x00400000 /* kbd/mouse intr */ -#define SIO_IR_RT_INT 0x08000000 /* RT output pulse */ -#define SIO_IR_GEN_INT1 0x10000000 /* RT input pulse */ -#define SIO_IR_GEN_INT_SHIFT 28 - -/* per device interrupt masks */ -#define SIO_IR_SA (SIO_IR_SA_TX_MT | \ - SIO_IR_SA_RX_FULL | \ - SIO_IR_SA_RX_HIGH | \ - SIO_IR_SA_RX_TIMER | \ - SIO_IR_SA_DELTA_DCD | \ - SIO_IR_SA_DELTA_CTS | \ - SIO_IR_SA_INT | \ - SIO_IR_SA_TX_EXPLICIT | \ - SIO_IR_SA_MEMERR) - -#define SIO_IR_SB (SIO_IR_SB_TX_MT | \ - SIO_IR_SB_RX_FULL | \ - SIO_IR_SB_RX_HIGH | \ - SIO_IR_SB_RX_TIMER | \ - SIO_IR_SB_DELTA_DCD | \ - SIO_IR_SB_DELTA_CTS | \ - SIO_IR_SB_INT | \ - SIO_IR_SB_TX_EXPLICIT | \ - SIO_IR_SB_MEMERR) - -#define SIO_IR_PP (SIO_IR_PP_INT | SIO_IR_PP_INTA | \ - SIO_IR_PP_INTB | SIO_IR_PP_MEMERR) -#define SIO_IR_RT (SIO_IR_RT_INT | SIO_IR_GEN_INT1) - -/* bitmasks for SIO_CR */ -#define SIO_CR_CMD_PULSE_SHIFT 15 -#define SIO_CR_SER_A_BASE_SHIFT 1 -#define SIO_CR_SER_B_BASE_SHIFT 8 -#define SIO_CR_ARB_DIAG 0x00380000 /* cur !enet PCI requet (ro) */ -#define SIO_CR_ARB_DIAG_TXA 0x00000000 -#define SIO_CR_ARB_DIAG_RXA 0x00080000 -#define SIO_CR_ARB_DIAG_TXB 0x00100000 -#define SIO_CR_ARB_DIAG_RXB 0x00180000 -#define SIO_CR_ARB_DIAG_PP 0x00200000 -#define SIO_CR_ARB_DIAG_IDLE 0x00400000 /* 0 -> active request (ro) */ - -/* defs for some of the generic I/O pins */ -#define GPCR_PHY_RESET 0x20 /* pin is output to PHY reset */ -#define GPCR_UARTB_MODESEL 0x40 /* pin is output to port B mode sel */ -#define GPCR_UARTA_MODESEL 0x80 /* pin is output to port A mode sel */ - -#define GPPR_PHY_RESET_PIN 5 /* GIO pin controlling phy reset */ -#define GPPR_UARTB_MODESEL_PIN 6 /* GIO pin cntrling uartb modeselect */ -#define GPPR_UARTA_MODESEL_PIN 7 /* GIO pin cntrling uarta modeselect */ - -#endif /* IA64_SN_IOC3_H */ diff --git a/trunk/include/asm-s390/s390_rdev.h b/trunk/include/asm-s390/s390_rdev.h index 6fa20442a48c..3ad78f2b9c48 100644 --- a/trunk/include/asm-s390/s390_rdev.h +++ b/trunk/include/asm-s390/s390_rdev.h @@ -2,7 +2,7 @@ * include/asm-s390/ccwdev.h * * Copyright (C) 2002,2005 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Cornelia Huck + * Author(s): Cornelia Huck * Carsten Otte * * Interface for s390 root device diff --git a/trunk/include/asm-s390/sigcontext.h b/trunk/include/asm-s390/sigcontext.h index aeb6e0b13329..803545351dd8 100644 --- a/trunk/include/asm-s390/sigcontext.h +++ b/trunk/include/asm-s390/sigcontext.h @@ -8,8 +8,6 @@ #ifndef _ASM_S390_SIGCONTEXT_H #define _ASM_S390_SIGCONTEXT_H -#include - #define __NUM_GPRS 16 #define __NUM_FPRS 16 #define __NUM_ACRS 16 diff --git a/trunk/include/asm-s390/system.h b/trunk/include/asm-s390/system.h index b2e65e8bf812..c7c3a9ad593f 100644 --- a/trunk/include/asm-s390/system.h +++ b/trunk/include/asm-s390/system.h @@ -115,14 +115,13 @@ static inline void sched_cacheflush(void) } #ifdef CONFIG_VIRT_CPU_ACCOUNTING -extern void account_vtime(struct task_struct *); -extern void account_tick_vtime(struct task_struct *); +extern void account_user_vtime(struct task_struct *); extern void account_system_vtime(struct task_struct *); #endif #define finish_arch_switch(prev) do { \ set_fs(current->thread.mm_segment); \ - account_vtime(prev); \ + account_system_vtime(prev); \ } while (0) #define nop() __asm__ __volatile__ ("nop") diff --git a/trunk/include/asm-x86_64/fixmap.h b/trunk/include/asm-x86_64/fixmap.h index 7b286bd21d1d..a582cfcf2231 100644 --- a/trunk/include/asm-x86_64/fixmap.h +++ b/trunk/include/asm-x86_64/fixmap.h @@ -76,7 +76,7 @@ extern void __this_fixmap_does_not_exist(void); * directly without translation, we catch the bug with a NULL-deference * kernel oops. Illegal ranges of incoming indices are caught too. */ -static __always_inline unsigned long fix_to_virt(const unsigned int idx) +static inline unsigned long fix_to_virt(const unsigned int idx) { /* * this branch gets completely eliminated after inlining, diff --git a/trunk/include/asm-x86_64/uaccess.h b/trunk/include/asm-x86_64/uaccess.h index bddffcb591b8..2892c4b7a28b 100644 --- a/trunk/include/asm-x86_64/uaccess.h +++ b/trunk/include/asm-x86_64/uaccess.h @@ -244,7 +244,7 @@ extern unsigned long copy_to_user(void __user *to, const void *from, unsigned le extern unsigned long copy_from_user(void *to, const void __user *from, unsigned len); extern unsigned long copy_in_user(void __user *to, const void __user *from, unsigned len); -static __always_inline int __copy_from_user(void *dst, const void __user *src, unsigned size) +static inline int __copy_from_user(void *dst, const void __user *src, unsigned size) { int ret = 0; if (!__builtin_constant_p(size)) @@ -273,7 +273,7 @@ static __always_inline int __copy_from_user(void *dst, const void __user *src, u } } -static __always_inline int __copy_to_user(void __user *dst, const void *src, unsigned size) +static inline int __copy_to_user(void __user *dst, const void *src, unsigned size) { int ret = 0; if (!__builtin_constant_p(size)) @@ -305,7 +305,7 @@ static __always_inline int __copy_to_user(void __user *dst, const void *src, uns } -static __always_inline int __copy_in_user(void __user *dst, const void __user *src, unsigned size) +static inline int __copy_in_user(void __user *dst, const void __user *src, unsigned size) { int ret = 0; if (!__builtin_constant_p(size)) diff --git a/trunk/include/linux/compiler-gcc3.h b/trunk/include/linux/compiler-gcc3.h index 1698b845761f..4209082ee934 100644 --- a/trunk/include/linux/compiler-gcc3.h +++ b/trunk/include/linux/compiler-gcc3.h @@ -13,4 +13,3 @@ #define __must_check __attribute__((warn_unused_result)) #endif -#define __always_inline inline __attribute__((always_inline)) diff --git a/trunk/include/linux/compiler-gcc4.h b/trunk/include/linux/compiler-gcc4.h index 6f5cc6f0e7a6..e913e9beaf69 100644 --- a/trunk/include/linux/compiler-gcc4.h +++ b/trunk/include/linux/compiler-gcc4.h @@ -3,16 +3,7 @@ /* These definitions are for GCC v4.x. */ #include -#ifdef CONFIG_FORCED_INLINING -# undef inline -# undef __inline__ -# undef __inline -# define inline inline __attribute__((always_inline)) -# define __inline__ __inline__ __attribute__((always_inline)) -# define __inline __inline __attribute__((always_inline)) -#endif - #define __attribute_used__ __attribute__((__used__)) #define __must_check __attribute__((warn_unused_result)) #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) -#define __always_inline inline __attribute__((always_inline)) + diff --git a/trunk/include/linux/cpuset.h b/trunk/include/linux/cpuset.h index 3bc606927116..c472f972bd6d 100644 --- a/trunk/include/linux/cpuset.h +++ b/trunk/include/linux/cpuset.h @@ -48,9 +48,6 @@ extern void __cpuset_memory_pressure_bump(void); extern struct file_operations proc_cpuset_operations; extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); -extern void cpuset_lock(void); -extern void cpuset_unlock(void); - #else /* !CONFIG_CPUSETS */ static inline int cpuset_init_early(void) { return 0; } @@ -96,9 +93,6 @@ static inline char *cpuset_task_status_allowed(struct task_struct *task, return buffer; } -static inline void cpuset_lock(void) {} -static inline void cpuset_unlock(void) {} - #endif /* !CONFIG_CPUSETS */ #endif /* _LINUX_CPUSET_H */ diff --git a/trunk/include/linux/fb.h b/trunk/include/linux/fb.h index 2cb19e6503aa..a973be2cfe61 100644 --- a/trunk/include/linux/fb.h +++ b/trunk/include/linux/fb.h @@ -608,15 +608,15 @@ struct fb_ops { int (*fb_sync)(struct fb_info *info); /* perform fb specific ioctl (optional) */ - int (*fb_ioctl)(struct fb_info *info, unsigned int cmd, - unsigned long arg); + int (*fb_ioctl)(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg, struct fb_info *info); /* Handle 32bit compat ioctl (optional) */ - int (*fb_compat_ioctl)(struct fb_info *info, unsigned cmd, - unsigned long arg); + long (*fb_compat_ioctl)(struct file *f, unsigned cmd, unsigned long arg, + struct fb_info *info); /* perform fb specific mmap */ - int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); + int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma); /* save current hardware state */ void (*fb_save_state)(struct fb_info *info); diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index 552cedfa6064..d1e370d25f7b 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -1383,12 +1383,6 @@ extern int register_chrdev(unsigned int, const char *, extern int unregister_chrdev(unsigned int, const char *); extern void unregister_chrdev_region(dev_t, unsigned); extern int chrdev_open(struct inode *, struct file *); -extern int get_chrdev_list(char *); -extern void *acquire_chrdev_list(void); -extern int count_chrdev_list(void); -extern void *get_next_chrdev(void *); -extern int get_chrdev_info(void *, int *, char **); -extern void release_chrdev_list(void *); /* fs/block_dev.c */ #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ @@ -1397,11 +1391,6 @@ extern const char *bdevname(struct block_device *bdev, char *buffer); extern struct block_device *lookup_bdev(const char *); extern struct block_device *open_bdev_excl(const char *, int, void *); extern void close_bdev_excl(struct block_device *); -extern void *acquire_blkdev_list(void); -extern int count_blkdev_list(void); -extern void *get_next_blkdev(void *); -extern int get_blkdev_info(void *, int *, char **); -extern void release_blkdev_list(void *); extern void init_special_inode(struct inode *, umode_t, dev_t); diff --git a/trunk/include/linux/hardirq.h b/trunk/include/linux/hardirq.h index eab537091f2a..71d2b8a723b9 100644 --- a/trunk/include/linux/hardirq.h +++ b/trunk/include/linux/hardirq.h @@ -93,6 +93,10 @@ extern void synchronize_irq(unsigned int irq); struct task_struct; #ifndef CONFIG_VIRT_CPU_ACCOUNTING +static inline void account_user_vtime(struct task_struct *tsk) +{ +} + static inline void account_system_vtime(struct task_struct *tsk) { } diff --git a/trunk/include/linux/ioc3.h b/trunk/include/linux/ioc3.h deleted file mode 100644 index e7906a72a4f1..000000000000 --- a/trunk/include/linux/ioc3.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (c) 2005 Stanislaw Skowronek - */ - -#ifndef _LINUX_IOC3_H -#define _LINUX_IOC3_H - -#include - -#define IOC3_MAX_SUBMODULES 32 - -#define IOC3_CLASS_NONE 0 -#define IOC3_CLASS_BASE_IP27 1 -#define IOC3_CLASS_BASE_IP30 2 -#define IOC3_CLASS_MENET_123 3 -#define IOC3_CLASS_MENET_4 4 -#define IOC3_CLASS_CADDUO 5 -#define IOC3_CLASS_SERIAL 6 - -/* One of these per IOC3 */ -struct ioc3_driver_data { - struct list_head list; - int id; /* IOC3 sequence number */ - /* PCI mapping */ - unsigned long pma; /* physical address */ - struct __iomem ioc3 *vma; /* pointer to registers */ - struct pci_dev *pdev; /* PCI device */ - /* IRQ stuff */ - int dual_irq; /* set if separate IRQs are used */ - int irq_io, irq_eth; /* IRQ numbers */ - /* GPIO magic */ - spinlock_t gpio_lock; - unsigned int gpdr_shadow; - /* NIC identifiers */ - char nic_part[32]; - char nic_serial[16]; - char nic_mac[6]; - /* submodule set */ - int class; - void *data[IOC3_MAX_SUBMODULES]; /* for submodule use */ - int active[IOC3_MAX_SUBMODULES]; /* set if probe succeeds */ - /* is_ir_lock must be held while - * modifying sio_ie values, so - * we can be sure that sio_ie is - * not changing when we read it - * along with sio_ir. - */ - spinlock_t ir_lock; /* SIO_IE[SC] mod lock */ -}; - -/* One per submodule */ -struct ioc3_submodule { - char *name; /* descriptive submodule name */ - struct module *owner; /* owning kernel module */ - int ethernet; /* set for ethernet drivers */ - int (*probe) (struct ioc3_submodule *, struct ioc3_driver_data *); - int (*remove) (struct ioc3_submodule *, struct ioc3_driver_data *); - int id; /* assigned by IOC3, index for the "data" array */ - /* IRQ stuff */ - unsigned int irq_mask; /* IOC3 IRQ mask, leave clear for Ethernet */ - int reset_mask; /* non-zero if you want the ioc3.c module to reset interrupts */ - int (*intr) (struct ioc3_submodule *, struct ioc3_driver_data *, unsigned int, struct pt_regs *); - /* private submodule data */ - void *data; /* assigned by submodule */ -}; - -/********************************** - * Functions needed by submodules * - **********************************/ - -#define IOC3_W_IES 0 -#define IOC3_W_IEC 1 - -/* registers a submodule for all existing and future IOC3 chips */ -extern int ioc3_register_submodule(struct ioc3_submodule *); -/* unregisters a submodule */ -extern void ioc3_unregister_submodule(struct ioc3_submodule *); -/* enables IRQs indicated by irq_mask for a specified IOC3 chip */ -extern void ioc3_enable(struct ioc3_submodule *, struct ioc3_driver_data *, unsigned int); -/* ackowledges specified IRQs */ -extern void ioc3_ack(struct ioc3_submodule *, struct ioc3_driver_data *, unsigned int); -/* disables IRQs indicated by irq_mask for a specified IOC3 chip */ -extern void ioc3_disable(struct ioc3_submodule *, struct ioc3_driver_data *, unsigned int); -/* atomically sets GPCR bits */ -extern void ioc3_gpcr_set(struct ioc3_driver_data *, unsigned int); -/* general ireg writer */ -extern void ioc3_write_ireg(struct ioc3_driver_data *idd, uint32_t value, int reg); - -#endif diff --git a/trunk/include/linux/mempolicy.h b/trunk/include/linux/mempolicy.h index d6a53ed6ab6c..c7ac77e873b3 100644 --- a/trunk/include/linux/mempolicy.h +++ b/trunk/include/linux/mempolicy.h @@ -132,8 +132,12 @@ struct shared_policy { spinlock_t lock; }; -void mpol_shared_policy_init(struct shared_policy *info, int policy, - nodemask_t *nodes); +static inline void mpol_shared_policy_init(struct shared_policy *info) +{ + info->root = RB_ROOT; + spin_lock_init(&info->lock); +} + int mpol_set_shared_policy(struct shared_policy *info, struct vm_area_struct *vma, struct mempolicy *new); @@ -207,8 +211,7 @@ static inline int mpol_set_shared_policy(struct shared_policy *info, return -EINVAL; } -static inline void mpol_shared_policy_init(struct shared_policy *info, - int policy, nodemask_t *nodes) +static inline void mpol_shared_policy_init(struct shared_policy *info) { } diff --git a/trunk/include/linux/mm.h b/trunk/include/linux/mm.h index 85854b867463..c643016499a1 100644 --- a/trunk/include/linux/mm.h +++ b/trunk/include/linux/mm.h @@ -512,7 +512,7 @@ static inline void set_page_links(struct page *page, unsigned long zone, extern struct page *mem_map; #endif -static __always_inline void *lowmem_page_address(struct page *page) +static inline void *lowmem_page_address(struct page *page) { return __va(page_to_pfn(page) << PAGE_SHIFT); } diff --git a/trunk/include/linux/ncp_fs.h b/trunk/include/linux/ncp_fs.h index e01342568530..7297e4372c0f 100644 --- a/trunk/include/linux/ncp_fs.h +++ b/trunk/include/linux/ncp_fs.h @@ -201,6 +201,34 @@ static inline struct ncp_inode_info *NCP_FINFO(struct inode *inode) return container_of(inode, struct ncp_inode_info, vfs_inode); } +#ifdef DEBUG_NCP_MALLOC + +#include + +extern int ncp_malloced; +extern int ncp_current_malloced; + +static inline void * + ncp_kmalloc(unsigned int size, int priority) +{ + ncp_malloced += 1; + ncp_current_malloced += 1; + return kmalloc(size, priority); +} + +static inline void ncp_kfree_s(void *obj, int size) +{ + ncp_current_malloced -= 1; + kfree(obj); +} + +#else /* DEBUG_NCP_MALLOC */ + +#define ncp_kmalloc(s,p) kmalloc(s,p) +#define ncp_kfree_s(o,s) kfree(o) + +#endif /* DEBUG_NCP_MALLOC */ + /* linux/fs/ncpfs/inode.c */ int ncp_notify_change(struct dentry *, struct iattr *); struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *); diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 2df1a1a2fee5..a72e17135421 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -160,7 +160,6 @@ extern unsigned long nr_iowait(void); #define SCHED_NORMAL 0 #define SCHED_FIFO 1 #define SCHED_RR 2 -#define SCHED_BATCH 3 struct sched_param { int sched_priority; @@ -471,9 +470,9 @@ struct signal_struct { /* * Priority of a process goes from 0..MAX_PRIO-1, valid RT - * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH - * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority - * values are inverted: lower p->prio value means higher priority. + * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL tasks are + * in the range MAX_RT_PRIO..MAX_PRIO-1. Priority values + * are inverted: lower p->prio value means higher priority. * * The MAX_USER_RT_PRIO value allows the actual maximum * RT priority to be separate from the value exported to diff --git a/trunk/include/linux/serial_core.h b/trunk/include/linux/serial_core.h index ec351005bf9d..a8187c3c8a7b 100644 --- a/trunk/include/linux/serial_core.h +++ b/trunk/include/linux/serial_core.h @@ -136,7 +136,6 @@ #include #include #include -#include struct uart_port; struct uart_info; @@ -285,7 +284,7 @@ struct uart_state { struct uart_info *info; struct uart_port *port; - struct mutex mutex; + struct semaphore sem; }; #define UART_XMIT_SIZE PAGE_SIZE diff --git a/trunk/include/linux/shmem_fs.h b/trunk/include/linux/shmem_fs.h index c057f0b32318..c3e598276e78 100644 --- a/trunk/include/linux/shmem_fs.h +++ b/trunk/include/linux/shmem_fs.h @@ -26,8 +26,6 @@ struct shmem_sb_info { unsigned long free_blocks; /* How many are left for allocation */ unsigned long max_inodes; /* How many inodes are allowed */ unsigned long free_inodes; /* How many are left for allocation */ - int policy; /* Default NUMA memory alloc policy */ - nodemask_t policy_nodes; /* nodemask for preferred and bind */ spinlock_t stat_lock; }; diff --git a/trunk/include/linux/smb_fs.h b/trunk/include/linux/smb_fs.h index 621a3d3662f3..c4153120ade6 100644 --- a/trunk/include/linux/smb_fs.h +++ b/trunk/include/linux/smb_fs.h @@ -58,6 +58,53 @@ static inline struct smb_inode_info *SMB_I(struct inode *inode) /* where to find the base of the SMB packet proper */ #define smb_base(buf) ((u8 *)(((u8 *)(buf))+4)) +#ifdef DEBUG_SMB_MALLOC + +#include + +extern int smb_malloced; +extern int smb_current_vmalloced; +extern int smb_current_kmalloced; + +static inline void * +smb_vmalloc(unsigned int size) +{ + smb_malloced += 1; + smb_current_vmalloced += 1; + return vmalloc(size); +} + +static inline void +smb_vfree(void *obj) +{ + smb_current_vmalloced -= 1; + vfree(obj); +} + +static inline void * +smb_kmalloc(size_t size, int flags) +{ + smb_malloced += 1; + smb_current_kmalloced += 1; + return kmalloc(size, flags); +} + +static inline void +smb_kfree(void *obj) +{ + smb_current_kmalloced -= 1; + kfree(obj); +} + +#else /* DEBUG_SMB_MALLOC */ + +#define smb_kmalloc(s,p) kmalloc(s,p) +#define smb_kfree(o) kfree(o) +#define smb_vmalloc(s) vmalloc(s) +#define smb_vfree(o) vfree(o) + +#endif /* DEBUG_SMB_MALLOC */ + /* * Flags for the in-memory inode */ diff --git a/trunk/include/linux/swap.h b/trunk/include/linux/swap.h index e92054d6530b..389d1c382e20 100644 --- a/trunk/include/linux/swap.h +++ b/trunk/include/linux/swap.h @@ -180,11 +180,6 @@ extern int isolate_lru_page(struct page *p); extern int putback_lru_pages(struct list_head *l); extern int migrate_pages(struct list_head *l, struct list_head *t, struct list_head *moved, struct list_head *failed); -#else -static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } -static inline int putback_lru_pages(struct list_head *l) { return 0; } -static inline int migrate_pages(struct list_head *l, struct list_head *t, - struct list_head *moved, struct list_head *failed) { return -ENOSYS; } #endif #ifdef CONFIG_MMU diff --git a/trunk/init/main.c b/trunk/init/main.c index 7c79da57d3a2..e092b1979a90 100644 --- a/trunk/init/main.c +++ b/trunk/init/main.c @@ -54,18 +54,20 @@ #include #include +/* + * This is one of the first .c files built. Error out early + * if we have compiler trouble.. + */ + #ifdef CONFIG_X86_LOCAL_APIC #include #endif /* - * This is one of the first .c files built. Error out early if we have compiler - * trouble. - * - * Versions of gcc older than that listed below may actually compile and link - * okay, but the end product can have subtle run time bugs. To avoid associated - * bogus bug reports, we flatly refuse to compile with a gcc that is known to be - * too old from the very beginning. + * Versions of gcc older than that listed below may actually compile + * and link okay, but the end product can have subtle run time bugs. + * To avoid associated bogus bug reports, we flatly refuse to compile + * with a gcc that is known to be too old from the very beginning. */ #if (__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 2) #error Sorry, your GCC is too old. It builds incorrect kernels. diff --git a/trunk/kernel/cpuset.c b/trunk/kernel/cpuset.c index fe2f71f92ae0..2a75e44e1a41 100644 --- a/trunk/kernel/cpuset.c +++ b/trunk/kernel/cpuset.c @@ -1554,7 +1554,7 @@ struct ctr_struct { * when reading out p->cpuset, as we don't really care if it changes * on the next cycle, and we are not going to try to dereference it. */ -static int pid_array_load(pid_t *pidarray, int npids, struct cpuset *cs) +static inline int pid_array_load(pid_t *pidarray, int npids, struct cpuset *cs) { int n = 0; struct task_struct *g, *p; @@ -2149,33 +2149,6 @@ int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) return allowed; } -/** - * cpuset_lock - lock out any changes to cpuset structures - * - * The out of memory (oom) code needs to lock down cpusets - * from being changed while it scans the tasklist looking for a - * task in an overlapping cpuset. Expose callback_sem via this - * cpuset_lock() routine, so the oom code can lock it, before - * locking the task list. The tasklist_lock is a spinlock, so - * must be taken inside callback_sem. - */ - -void cpuset_lock(void) -{ - down(&callback_sem); -} - -/** - * cpuset_unlock - release lock on cpuset changes - * - * Undo the lock taken in a previous cpuset_lock() call. - */ - -void cpuset_unlock(void) -{ - up(&callback_sem); -} - /** * cpuset_excl_nodes_overlap - Do we overlap @p's mem_exclusive ancestors? * @p: pointer to task_struct of some other task. @@ -2185,7 +2158,7 @@ void cpuset_unlock(void) * determine if task @p's memory usage might impact the memory * available to the current task. * - * Call while holding callback_sem. + * Acquires callback_sem - not suitable for calling from a fast path. **/ int cpuset_excl_nodes_overlap(const struct task_struct *p) @@ -2193,6 +2166,8 @@ int cpuset_excl_nodes_overlap(const struct task_struct *p) const struct cpuset *cs1, *cs2; /* my and p's cpuset ancestors */ int overlap = 0; /* do cpusets overlap? */ + down(&callback_sem); + task_lock(current); if (current->flags & PF_EXITING) { task_unlock(current); @@ -2211,6 +2186,8 @@ int cpuset_excl_nodes_overlap(const struct task_struct *p) overlap = nodes_intersects(cs1->mems_allowed, cs2->mems_allowed); done: + up(&callback_sem); + return overlap; } diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 93cee3671332..f8e609ff1893 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -193,7 +193,7 @@ int is_orphaned_pgrp(int pgrp) return retval; } -static int has_stopped_jobs(int pgrp) +static inline int has_stopped_jobs(int pgrp) { int retval = 0; struct task_struct *p; @@ -230,7 +230,7 @@ static int has_stopped_jobs(int pgrp) * * NOTE that reparent_to_init() gives the caller full capabilities. */ -static void reparent_to_init(void) +static inline void reparent_to_init(void) { write_lock_irq(&tasklist_lock); @@ -244,9 +244,7 @@ static void reparent_to_init(void) /* Set the exit signal to SIGCHLD so we signal init on exit */ current->exit_signal = SIGCHLD; - if ((current->policy == SCHED_NORMAL || - current->policy == SCHED_BATCH) - && (task_nice(current) < 0)) + if ((current->policy == SCHED_NORMAL) && (task_nice(current) < 0)) set_user_nice(current, 0); /* cpus_allowed? */ /* rt_priority? */ @@ -369,7 +367,7 @@ void daemonize(const char *name, ...) EXPORT_SYMBOL(daemonize); -static void close_files(struct files_struct * files) +static inline void close_files(struct files_struct * files) { int i, j; struct fdtable *fdt; @@ -543,7 +541,7 @@ static inline void choose_new_parent(task_t *p, task_t *reaper, task_t *child_re p->real_parent = reaper; } -static void reparent_thread(task_t *p, task_t *father, int traced) +static inline void reparent_thread(task_t *p, task_t *father, int traced) { /* We don't want people slaying init. */ if (p->exit_signal != -1) @@ -607,7 +605,7 @@ static void reparent_thread(task_t *p, task_t *father, int traced) * group, and if no such member exists, give it to * the global child reaper process (ie "init") */ -static void forget_original_parent(struct task_struct * father, +static inline void forget_original_parent(struct task_struct * father, struct list_head *to_release) { struct task_struct *p, *reaper = father; diff --git a/trunk/kernel/posix-timers.c b/trunk/kernel/posix-timers.c index 197208b3aa2a..9e66e614862a 100644 --- a/trunk/kernel/posix-timers.c +++ b/trunk/kernel/posix-timers.c @@ -192,7 +192,7 @@ static inline int common_clock_set(const clockid_t which_clock, return do_sys_settimeofday(tp, NULL); } -static int common_timer_create(struct k_itimer *new_timer) +static inline int common_timer_create(struct k_itimer *new_timer) { hrtimer_init(&new_timer->it.real.timer, new_timer->it_clock); new_timer->it.real.timer.data = new_timer; @@ -361,7 +361,7 @@ static int posix_timer_fn(void *data) return ret; } -static struct task_struct * good_sigevent(sigevent_t * event) +static inline struct task_struct * good_sigevent(sigevent_t * event) { struct task_struct *rtn = current->group_leader; @@ -687,7 +687,7 @@ sys_timer_getoverrun(timer_t timer_id) /* Set a POSIX.1b interval timer. */ /* timr->it_lock is taken. */ -static int +static inline int common_timer_set(struct k_itimer *timr, int flags, struct itimerspec *new_setting, struct itimerspec *old_setting) { @@ -829,7 +829,7 @@ sys_timer_delete(timer_t timer_id) /* * return timer owned by the process, used by exit_itimers */ -static void itimer_delete(struct k_itimer *timer) +static inline void itimer_delete(struct k_itimer *timer) { unsigned long flags; diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 788ecce1e0e4..c9dec2aa1976 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -521,7 +521,7 @@ static inline void sched_info_dequeued(task_t *t) * long it was waiting to run. We also note when it began so that we * can keep stats on how long its timeslice is. */ -static void sched_info_arrive(task_t *t) +static inline void sched_info_arrive(task_t *t) { unsigned long now = jiffies, diff = 0; struct runqueue *rq = task_rq(t); @@ -748,14 +748,10 @@ static int recalc_task_prio(task_t *p, unsigned long long now) unsigned long long __sleep_time = now - p->timestamp; unsigned long sleep_time; - if (unlikely(p->policy == SCHED_BATCH)) - sleep_time = 0; - else { - if (__sleep_time > NS_MAX_SLEEP_AVG) - sleep_time = NS_MAX_SLEEP_AVG; - else - sleep_time = (unsigned long)__sleep_time; - } + if (__sleep_time > NS_MAX_SLEEP_AVG) + sleep_time = NS_MAX_SLEEP_AVG; + else + sleep_time = (unsigned long)__sleep_time; if (likely(sleep_time > 0)) { /* @@ -1007,7 +1003,7 @@ void kick_process(task_t *p) * We want to under-estimate the load of migration sources, to * balance conservatively. */ -static unsigned long __source_load(int cpu, int type, enum idle_type idle) +static inline unsigned long __source_load(int cpu, int type, enum idle_type idle) { runqueue_t *rq = cpu_rq(cpu); unsigned long running = rq->nr_running; @@ -1870,7 +1866,7 @@ void sched_exec(void) * pull_task - move a task from a remote runqueue to the local runqueue. * Both runqueues must be locked. */ -static +static inline void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p, runqueue_t *this_rq, prio_array_t *this_array, int this_cpu) { @@ -1892,7 +1888,7 @@ void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p, /* * can_migrate_task - may task p from runqueue rq be migrated to this_cpu? */ -static +static inline int can_migrate_task(task_t *p, runqueue_t *rq, int this_cpu, struct sched_domain *sd, enum idle_type idle, int *all_pinned) @@ -2378,7 +2374,7 @@ static int load_balance_newidle(int this_cpu, runqueue_t *this_rq, * idle_balance is called by schedule() if this_cpu is about to become * idle. Attempts to pull tasks from other CPUs. */ -static void idle_balance(int this_cpu, runqueue_t *this_rq) +static inline void idle_balance(int this_cpu, runqueue_t *this_rq) { struct sched_domain *sd; @@ -2762,7 +2758,7 @@ static inline void wakeup_busy_runqueue(runqueue_t *rq) resched_task(rq->idle); } -static void wake_sleeping_dependent(int this_cpu, runqueue_t *this_rq) +static inline void wake_sleeping_dependent(int this_cpu, runqueue_t *this_rq) { struct sched_domain *tmp, *sd = NULL; cpumask_t sibling_map; @@ -2816,7 +2812,7 @@ static inline unsigned long smt_slice(task_t *p, struct sched_domain *sd) return p->time_slice * (100 - sd->per_cpu_gain) / 100; } -static int dependent_sleeper(int this_cpu, runqueue_t *this_rq) +static inline int dependent_sleeper(int this_cpu, runqueue_t *this_rq) { struct sched_domain *tmp, *sd = NULL; cpumask_t sibling_map; @@ -3564,7 +3560,7 @@ void set_user_nice(task_t *p, long nice) * The RT priorities are set via sched_setscheduler(), but we still * allow the 'normal' nice value to be set - but as expected * it wont have any effect on scheduling until the task is - * not SCHED_NORMAL/SCHED_BATCH: + * not SCHED_NORMAL: */ if (rt_task(p)) { p->static_prio = NICE_TO_PRIO(nice); @@ -3710,16 +3706,10 @@ static void __setscheduler(struct task_struct *p, int policy, int prio) BUG_ON(p->array); p->policy = policy; p->rt_priority = prio; - if (policy != SCHED_NORMAL && policy != SCHED_BATCH) { + if (policy != SCHED_NORMAL) p->prio = MAX_RT_PRIO-1 - p->rt_priority; - } else { + else p->prio = p->static_prio; - /* - * SCHED_BATCH tasks are treated as perpetual CPU hogs: - */ - if (policy == SCHED_BATCH) - p->sleep_avg = 0; - } } /** @@ -3743,35 +3733,29 @@ int sched_setscheduler(struct task_struct *p, int policy, if (policy < 0) policy = oldpolicy = p->policy; else if (policy != SCHED_FIFO && policy != SCHED_RR && - policy != SCHED_NORMAL && policy != SCHED_BATCH) - return -EINVAL; + policy != SCHED_NORMAL) + return -EINVAL; /* * Valid priorities for SCHED_FIFO and SCHED_RR are - * 1..MAX_USER_RT_PRIO-1, valid priority for SCHED_NORMAL and - * SCHED_BATCH is 0. + * 1..MAX_USER_RT_PRIO-1, valid priority for SCHED_NORMAL is 0. */ if (param->sched_priority < 0 || (p->mm && param->sched_priority > MAX_USER_RT_PRIO-1) || (!p->mm && param->sched_priority > MAX_RT_PRIO-1)) return -EINVAL; - if ((policy == SCHED_NORMAL || policy == SCHED_BATCH) - != (param->sched_priority == 0)) + if ((policy == SCHED_NORMAL) != (param->sched_priority == 0)) return -EINVAL; /* * Allow unprivileged RT tasks to decrease priority: */ if (!capable(CAP_SYS_NICE)) { - /* - * can't change policy, except between SCHED_NORMAL - * and SCHED_BATCH: - */ - if (((policy != SCHED_NORMAL && p->policy != SCHED_BATCH) && - (policy != SCHED_BATCH && p->policy != SCHED_NORMAL)) && - !p->signal->rlim[RLIMIT_RTPRIO].rlim_cur) + /* can't change policy */ + if (policy != p->policy && + !p->signal->rlim[RLIMIT_RTPRIO].rlim_cur) return -EPERM; /* can't increase priority */ - if ((policy != SCHED_NORMAL && policy != SCHED_BATCH) && + if (policy != SCHED_NORMAL && param->sched_priority > p->rt_priority && param->sched_priority > p->signal->rlim[RLIMIT_RTPRIO].rlim_cur) @@ -4249,7 +4233,6 @@ asmlinkage long sys_sched_get_priority_max(int policy) ret = MAX_USER_RT_PRIO-1; break; case SCHED_NORMAL: - case SCHED_BATCH: ret = 0; break; } @@ -4273,7 +4256,6 @@ asmlinkage long sys_sched_get_priority_min(int policy) ret = 1; break; case SCHED_NORMAL: - case SCHED_BATCH: ret = 0; } return ret; @@ -6008,7 +5990,7 @@ static void arch_destroy_sched_domains(const cpumask_t *cpu_map) * Detach sched domains from a group of cpus specified in cpu_map * These cpus will now be attached to the NULL domain */ -static void detach_destroy_domains(const cpumask_t *cpu_map) +static inline void detach_destroy_domains(const cpumask_t *cpu_map) { int i; diff --git a/trunk/kernel/signal.c b/trunk/kernel/signal.c index 5dafbd36d62e..1da2e74beb97 100644 --- a/trunk/kernel/signal.c +++ b/trunk/kernel/signal.c @@ -476,7 +476,7 @@ unblock_all_signals(void) spin_unlock_irqrestore(¤t->sighand->siglock, flags); } -static int collect_signal(int sig, struct sigpending *list, siginfo_t *info) +static inline int collect_signal(int sig, struct sigpending *list, siginfo_t *info) { struct sigqueue *q, *first = NULL; int still_pending = 0; @@ -1881,7 +1881,7 @@ do_signal_stop(int signr) * We return zero if we still hold the siglock and should look * for another signal without checking group_stop_count again. */ -static int handle_group_stop(void) +static inline int handle_group_stop(void) { int stop_count; diff --git a/trunk/kernel/sysctl.c b/trunk/kernel/sysctl.c index f5d69b6e29f5..62d4d9566876 100644 --- a/trunk/kernel/sysctl.c +++ b/trunk/kernel/sysctl.c @@ -648,7 +648,7 @@ static ctl_table kern_table[] = { .mode = 0644, .proc_handler = &proc_dointvec, }, -#if defined(CONFIG_S390) && defined(CONFIG_SMP) +#if defined(CONFIG_S390) { .ctl_name = KERN_SPIN_RETRY, .procname = "spin_retry", diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c index b052e2c4c710..82c4fa70595c 100644 --- a/trunk/kernel/workqueue.c +++ b/trunk/kernel/workqueue.c @@ -147,7 +147,7 @@ int fastcall queue_delayed_work(struct workqueue_struct *wq, return ret; } -static void run_workqueue(struct cpu_workqueue_struct *cwq) +static inline void run_workqueue(struct cpu_workqueue_struct *cwq) { unsigned long flags; diff --git a/trunk/lib/Kconfig.debug b/trunk/lib/Kconfig.debug index a314e663d517..a609235a517f 100644 --- a/trunk/lib/Kconfig.debug +++ b/trunk/lib/Kconfig.debug @@ -195,20 +195,6 @@ config FRAME_POINTER some architectures or if you use external debuggers. If you don't debug the kernel, you can say N. -config FORCED_INLINING - bool "Force gcc to inline functions marked 'inline'" - depends on DEBUG_KERNEL - default y - help - This option determines if the kernel forces gcc to inline the functions - developers have marked 'inline'. Doing so takes away freedom from gcc to - do what it thinks is best, which is desirable for the gcc 3.x series of - compilers. The gcc 4.x series have a rewritten inlining algorithm and - disabling this option will generate a smaller kernel there. Hopefully - this algorithm is so good that allowing gcc4 to make the decision can - become the default in the future, until then this option is there to - test gcc for this. - config RCU_TORTURE_TEST tristate "torture tests for RCU" depends on DEBUG_KERNEL diff --git a/trunk/mm/mempolicy.c b/trunk/mm/mempolicy.c index 3171f884d245..b62cab575a84 100644 --- a/trunk/mm/mempolicy.c +++ b/trunk/mm/mempolicy.c @@ -1359,30 +1359,6 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start, return 0; } -void mpol_shared_policy_init(struct shared_policy *info, int policy, - nodemask_t *policy_nodes) -{ - info->root = RB_ROOT; - spin_lock_init(&info->lock); - - if (policy != MPOL_DEFAULT) { - struct mempolicy *newpol; - - /* Falls back to MPOL_DEFAULT on any error */ - newpol = mpol_new(policy, policy_nodes); - if (!IS_ERR(newpol)) { - /* Create pseudo-vma that contains just the policy */ - struct vm_area_struct pvma; - - memset(&pvma, 0, sizeof(struct vm_area_struct)); - /* Policy covers entire file */ - pvma.vm_end = TASK_SIZE; - mpol_set_shared_policy(info, &pvma, newpol); - mpol_free(newpol); - } - } -} - int mpol_set_shared_policy(struct shared_policy *info, struct vm_area_struct *vma, struct mempolicy *npol) { diff --git a/trunk/mm/oom_kill.c b/trunk/mm/oom_kill.c index 14bd4ec79597..4748b906aff2 100644 --- a/trunk/mm/oom_kill.c +++ b/trunk/mm/oom_kill.c @@ -274,7 +274,6 @@ void out_of_memory(gfp_t gfp_mask, int order) show_mem(); } - cpuset_lock(); read_lock(&tasklist_lock); retry: p = select_bad_process(); @@ -285,7 +284,6 @@ void out_of_memory(gfp_t gfp_mask, int order) /* Found nothing?!?! Either we hang forever, or we panic. */ if (!p) { read_unlock(&tasklist_lock); - cpuset_unlock(); panic("Out of memory and no killable processes...\n"); } @@ -295,7 +293,6 @@ void out_of_memory(gfp_t gfp_mask, int order) out: read_unlock(&tasklist_lock); - cpuset_unlock(); if (mm) mmput(mm); diff --git a/trunk/mm/shmem.c b/trunk/mm/shmem.c index ce501bce1c2e..343b3c0937e5 100644 --- a/trunk/mm/shmem.c +++ b/trunk/mm/shmem.c @@ -1316,8 +1316,7 @@ shmem_get_inode(struct super_block *sb, int mode, dev_t dev) case S_IFREG: inode->i_op = &shmem_inode_operations; inode->i_fop = &shmem_file_operations; - mpol_shared_policy_init(&info->policy, sbinfo->policy, - &sbinfo->policy_nodes); + mpol_shared_policy_init(&info->policy); break; case S_IFDIR: inode->i_nlink++; @@ -1331,8 +1330,7 @@ shmem_get_inode(struct super_block *sb, int mode, dev_t dev) * Must not load anything in the rbtree, * mpol_free_shared_policy will not be called. */ - mpol_shared_policy_init(&info->policy, MPOL_DEFAULT, - NULL); + mpol_shared_policy_init(&info->policy); break; } } else if (sbinfo->max_inodes) { @@ -1845,9 +1843,7 @@ static struct inode_operations shmem_symlink_inode_operations = { .put_link = shmem_put_link, }; -static int shmem_parse_options(char *options, int *mode, uid_t *uid, - gid_t *gid, unsigned long *blocks, unsigned long *inodes, - int *policy, nodemask_t *policy_nodes) +static int shmem_parse_options(char *options, int *mode, uid_t *uid, gid_t *gid, unsigned long *blocks, unsigned long *inodes) { char *this_char, *value, *rest; @@ -1901,19 +1897,6 @@ static int shmem_parse_options(char *options, int *mode, uid_t *uid, *gid = simple_strtoul(value,&rest,0); if (*rest) goto bad_val; - } else if (!strcmp(this_char,"mpol")) { - if (!strcmp(value,"default")) - *policy = MPOL_DEFAULT; - else if (!strcmp(value,"preferred")) - *policy = MPOL_PREFERRED; - else if (!strcmp(value,"bind")) - *policy = MPOL_BIND; - else if (!strcmp(value,"interleave")) - *policy = MPOL_INTERLEAVE; - else - goto bad_val; - } else if (!strcmp(this_char,"mpol_nodelist")) { - nodelist_parse(value, *policy_nodes); } else { printk(KERN_ERR "tmpfs: Bad mount option %s\n", this_char); @@ -1934,14 +1917,12 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) struct shmem_sb_info *sbinfo = SHMEM_SB(sb); unsigned long max_blocks = sbinfo->max_blocks; unsigned long max_inodes = sbinfo->max_inodes; - int policy = sbinfo->policy; - nodemask_t policy_nodes = sbinfo->policy_nodes; unsigned long blocks; unsigned long inodes; int error = -EINVAL; - if (shmem_parse_options(data, NULL, NULL, NULL, &max_blocks, - &max_inodes, &policy, &policy_nodes)) + if (shmem_parse_options(data, NULL, NULL, NULL, + &max_blocks, &max_inodes)) return error; spin_lock(&sbinfo->stat_lock); @@ -1967,8 +1948,6 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) sbinfo->free_blocks = max_blocks - blocks; sbinfo->max_inodes = max_inodes; sbinfo->free_inodes = max_inodes - inodes; - sbinfo->policy = policy; - sbinfo->policy_nodes = policy_nodes; out: spin_unlock(&sbinfo->stat_lock); return error; @@ -1993,8 +1972,6 @@ static int shmem_fill_super(struct super_block *sb, struct shmem_sb_info *sbinfo; unsigned long blocks = 0; unsigned long inodes = 0; - int policy = MPOL_DEFAULT; - nodemask_t policy_nodes = node_online_map; #ifdef CONFIG_TMPFS /* @@ -2007,8 +1984,8 @@ static int shmem_fill_super(struct super_block *sb, inodes = totalram_pages - totalhigh_pages; if (inodes > blocks) inodes = blocks; - if (shmem_parse_options(data, &mode, &uid, &gid, &blocks, - &inodes, &policy, &policy_nodes)) + if (shmem_parse_options(data, &mode, &uid, &gid, + &blocks, &inodes)) return -EINVAL; } #else @@ -2026,8 +2003,6 @@ static int shmem_fill_super(struct super_block *sb, sbinfo->free_blocks = blocks; sbinfo->max_inodes = inodes; sbinfo->free_inodes = inodes; - sbinfo->policy = policy; - sbinfo->policy_nodes = policy_nodes; sb->s_fs_info = sbinfo; sb->s_maxbytes = SHMEM_MAX_BYTES; diff --git a/trunk/net/ieee80211/ieee80211_module.c b/trunk/net/ieee80211/ieee80211_module.c index 90d18b72da3d..321287bc887f 100644 --- a/trunk/net/ieee80211/ieee80211_module.c +++ b/trunk/net/ieee80211/ieee80211_module.c @@ -62,7 +62,7 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_AUTHOR(DRV_COPYRIGHT); MODULE_LICENSE("GPL"); -static int ieee80211_networks_allocate(struct ieee80211_device *ieee) +static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee) { if (ieee->networks) return 0; @@ -90,7 +90,7 @@ static inline void ieee80211_networks_free(struct ieee80211_device *ieee) ieee->networks = NULL; } -static void ieee80211_networks_initialize(struct ieee80211_device *ieee) +static inline void ieee80211_networks_initialize(struct ieee80211_device *ieee) { int i; diff --git a/trunk/net/ieee80211/ieee80211_rx.c b/trunk/net/ieee80211/ieee80211_rx.c index 7a121802faa9..5e3380388046 100644 --- a/trunk/net/ieee80211/ieee80211_rx.c +++ b/trunk/net/ieee80211/ieee80211_rx.c @@ -35,7 +35,7 @@ #include -static void ieee80211_monitor_rx(struct ieee80211_device *ieee, +static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee, struct sk_buff *skb, struct ieee80211_rx_stats *rx_stats) { @@ -165,7 +165,7 @@ static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee, * Responsible for handling management control frames * * Called by ieee80211_rx */ -static int +static inline int ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, struct ieee80211_rx_stats *rx_stats, u16 type, u16 stype) @@ -266,7 +266,7 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee, } /* Called only as a tasklet (software IRQ), by ieee80211_rx */ -static int +static inline int ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb, struct ieee80211_crypt_data *crypt) { @@ -297,7 +297,7 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb, } /* Called only as a tasklet (software IRQ), by ieee80211_rx */ -static int +static inline int ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, struct sk_buff *skb, int keyidx, struct ieee80211_crypt_data *crypt) @@ -1156,7 +1156,7 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee /***************************************************/ -static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee80211_probe_response +static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee80211_probe_response *beacon, struct ieee80211_network *network, struct ieee80211_rx_stats *stats) @@ -1235,7 +1235,7 @@ static inline int is_same_network(struct ieee80211_network *src, !memcmp(src->ssid, dst->ssid, src->ssid_len)); } -static void update_network(struct ieee80211_network *dst, +static inline void update_network(struct ieee80211_network *dst, struct ieee80211_network *src) { int qos_active; @@ -1294,7 +1294,7 @@ static inline int is_beacon(int fc) return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON); } -static void ieee80211_process_probe_response(struct ieee80211_device +static inline void ieee80211_process_probe_response(struct ieee80211_device *ieee, struct ieee80211_probe_response *beacon, struct ieee80211_rx_stats diff --git a/trunk/net/ieee80211/ieee80211_tx.c b/trunk/net/ieee80211/ieee80211_tx.c index 8fdd943ebe8e..e5b33c8d5dbc 100644 --- a/trunk/net/ieee80211/ieee80211_tx.c +++ b/trunk/net/ieee80211/ieee80211_tx.c @@ -127,7 +127,7 @@ payload of each frame is reduced to 492 bytes. static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 }; static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 }; -static int ieee80211_copy_snap(u8 * data, u16 h_proto) +static inline int ieee80211_copy_snap(u8 * data, u16 h_proto) { struct ieee80211_snap_hdr *snap; u8 *oui; @@ -150,7 +150,7 @@ static int ieee80211_copy_snap(u8 * data, u16 h_proto) return SNAP_SIZE + sizeof(u16); } -static int ieee80211_encrypt_fragment(struct ieee80211_device *ieee, +static inline int ieee80211_encrypt_fragment(struct ieee80211_device *ieee, struct sk_buff *frag, int hdr_len) { struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx]; diff --git a/trunk/net/ieee80211/ieee80211_wx.c b/trunk/net/ieee80211/ieee80211_wx.c index 23e1630f50b7..406d5b964905 100644 --- a/trunk/net/ieee80211/ieee80211_wx.c +++ b/trunk/net/ieee80211/ieee80211_wx.c @@ -42,7 +42,7 @@ static const char *ieee80211_modes[] = { }; #define MAX_CUSTOM_LEN 64 -static char *ipw2100_translate_scan(struct ieee80211_device *ieee, +static inline char *ipw2100_translate_scan(struct ieee80211_device *ieee, char *start, char *stop, struct ieee80211_network *network) { diff --git a/trunk/net/ipv4/fib_frontend.c b/trunk/net/ipv4/fib_frontend.c index 4e3d3811dea2..5b25fc0d980c 100644 --- a/trunk/net/ipv4/fib_frontend.c +++ b/trunk/net/ipv4/fib_frontend.c @@ -289,13 +289,13 @@ static int inet_check_attr(struct rtmsg *r, struct rtattr **rta) { int i; - for (i=1; i<=RTA_MAX; i++, rta++) { - struct rtattr *attr = *rta; + for (i=1; i<=RTA_MAX; i++) { + struct rtattr *attr = rta[i-1]; if (attr) { if (RTA_PAYLOAD(attr) < 4) return -EINVAL; if (i != RTA_MULTIPATH && i != RTA_METRICS) - *rta = (struct rtattr*)RTA_DATA(attr); + rta[i-1] = (struct rtattr*)RTA_DATA(attr); } } return 0; diff --git a/trunk/net/netfilter/nfnetlink.c b/trunk/net/netfilter/nfnetlink.c index f6063e8f0050..95fdf04f1d88 100644 --- a/trunk/net/netfilter/nfnetlink.c +++ b/trunk/net/netfilter/nfnetlink.c @@ -212,7 +212,7 @@ int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags) } /* Process one complete nfnetlink message. */ -static int nfnetlink_rcv_msg(struct sk_buff *skb, +static inline int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp) { struct nfnl_callback *nc; diff --git a/trunk/security/selinux/hooks.c b/trunk/security/selinux/hooks.c index b9f8d9731c3d..6647204e4636 100644 --- a/trunk/security/selinux/hooks.c +++ b/trunk/security/selinux/hooks.c @@ -1019,7 +1019,7 @@ static inline int dentry_has_perm(struct task_struct *tsk, has the same SID as the process. If av is zero, then access to the file is not checked, e.g. for cases where only the descriptor is affected like seek. */ -static int file_has_perm(struct task_struct *tsk, +static inline int file_has_perm(struct task_struct *tsk, struct file *file, u32 av) { diff --git a/trunk/sound/oss/esssolo1.c b/trunk/sound/oss/esssolo1.c index 849b59f67ef5..a4ecab2f0522 100644 --- a/trunk/sound/oss/esssolo1.c +++ b/trunk/sound/oss/esssolo1.c @@ -515,7 +515,7 @@ static inline int prog_dmabuf_adc(struct solo1_state *s) return 0; } -static int prog_dmabuf_dac(struct solo1_state *s) +static inline int prog_dmabuf_dac(struct solo1_state *s) { unsigned long va; int c; diff --git a/trunk/sound/pci/es1968.c b/trunk/sound/pci/es1968.c index 3747a436f0cd..9ffb600321cb 100644 --- a/trunk/sound/pci/es1968.c +++ b/trunk/sound/pci/es1968.c @@ -727,7 +727,7 @@ static void __apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 dat apu_data_set(chip, data); } -static void apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 data) +static inline void apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 data) { unsigned long flags; spin_lock_irqsave(&chip->reg_lock, flags); @@ -743,7 +743,7 @@ static u16 __apu_get_register(struct es1968 *chip, u16 channel, u8 reg) return __maestro_read(chip, IDR0_DATA_PORT); } -static u16 apu_get_register(struct es1968 *chip, u16 channel, u8 reg) +static inline u16 apu_get_register(struct es1968 *chip, u16 channel, u8 reg) { unsigned long flags; u16 v;