diff --git a/[refs] b/[refs] index 56853c5d603b..ff31037b94af 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ea45d15394c57cb214aef8e6d40976c128995d43 +refs/heads/master: f32d26ae2649c17df742f8db48b438eba2c38400 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 231bda28c428..5b454627f211 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -2129,8 +2129,8 @@ S: Maintained JOURNALLING FLASH FILE SYSTEM V2 (JFFS2) P: David Woodhouse M: dwmw2@infradead.org -L: linux-mtd@lists.infradead.org -W: http://www.linux-mtd.infradead.org/doc/jffs2.html +L: jffs-dev@axis.com +W: http://sources.redhat.com/jffs2/ S: Maintained JFS FILESYSTEM diff --git a/trunk/Makefile b/trunk/Makefile index 8816060cdf40..2a4729024dfb 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -196,9 +196,6 @@ CROSS_COMPILE ?= UTS_MACHINE := $(ARCH) SRCARCH := $(ARCH) -# for i386 and x86_64 we use SRCARCH equal to x86 -SRCARCH := $(if $(filter x86_64 i386,$(SRCARCH)),x86,$(SRCARCH)) - KCONFIG_CONFIG ?= .config # SHELL used by kbuild @@ -421,7 +418,7 @@ ifeq ($(config-targets),1) # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed. # KBUILD_DEFCONFIG may point out an alternative default configuration # used for 'make defconfig' -include $(srctree)/arch/$(SRCARCH)/Makefile +include $(srctree)/arch/$(ARCH)/Makefile export KBUILD_DEFCONFIG config %config: scripts_basic outputmakefile FORCE @@ -500,7 +497,7 @@ else KBUILD_CFLAGS += -O2 endif -include $(srctree)/arch/$(SRCARCH)/Makefile +include $(srctree)/arch/$(ARCH)/Makefile ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls diff --git a/trunk/arch/frv/mb93090-mb00/pci-dma.c b/trunk/arch/frv/mb93090-mb00/pci-dma.c index 662f7b12d005..671ce1e8434f 100644 --- a/trunk/arch/frv/mb93090-mb00/pci-dma.c +++ b/trunk/arch/frv/mb93090-mb00/pci-dma.c @@ -15,7 +15,6 @@ #include #include #include -#include #include void *dma_alloc_coherent(struct device *hwdev, size_t size, dma_addr_t *dma_handle, gfp_t gfp) @@ -87,7 +86,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, dampr2 = __get_DAMPR(2); for (i = 0; i < nents; i++) { - vaddr = kmap_atomic(sg_page(&sg[i]), __KM_CACHE); + vaddr = kmap_atomic(sg[i].page, __KM_CACHE); frv_dcache_writeback((unsigned long) vaddr, (unsigned long) vaddr + PAGE_SIZE); diff --git a/trunk/arch/i386/.gitignore b/trunk/arch/i386/.gitignore new file mode 100644 index 000000000000..36ef4c374d25 --- /dev/null +++ b/trunk/arch/i386/.gitignore @@ -0,0 +1 @@ +boot diff --git a/trunk/arch/x86/Kconfig.i386 b/trunk/arch/i386/Kconfig similarity index 99% rename from trunk/arch/x86/Kconfig.i386 rename to trunk/arch/i386/Kconfig index 7331efe891a7..b4437ce0f973 100644 --- a/trunk/arch/x86/Kconfig.i386 +++ b/trunk/arch/i386/Kconfig @@ -287,7 +287,7 @@ config ES7000_CLUSTERED_APIC default y depends on SMP && X86_ES7000 && MPENTIUMIII -source "arch/x86/Kconfig.cpu" +source "arch/i386/Kconfig.cpu" config HPET_TIMER bool "HPET Timer Support" @@ -1272,7 +1272,7 @@ source "fs/Kconfig" source "kernel/Kconfig.instrumentation" -source "arch/x86/Kconfig.debug" +source "arch/i386/Kconfig.debug" source "security/Kconfig" diff --git a/trunk/arch/x86/Kconfig.cpu b/trunk/arch/i386/Kconfig.cpu similarity index 100% rename from trunk/arch/x86/Kconfig.cpu rename to trunk/arch/i386/Kconfig.cpu diff --git a/trunk/arch/x86/Kconfig.debug b/trunk/arch/i386/Kconfig.debug similarity index 65% rename from trunk/arch/x86/Kconfig.debug rename to trunk/arch/i386/Kconfig.debug index 970b2defe7df..f03531eacdfb 100644 --- a/trunk/arch/x86/Kconfig.debug +++ b/trunk/arch/i386/Kconfig.debug @@ -1,14 +1,14 @@ menu "Kernel hacking" config TRACE_IRQFLAGS_SUPPORT - def_bool y + bool + default y source "lib/Kconfig.debug" config EARLY_PRINTK bool "Early printk" if EMBEDDED && DEBUG_KERNEL default y - depends on X86_32 help Write kernel log output directly into the VGA buffer or to a serial port. @@ -37,12 +37,10 @@ config DEBUG_STACK_USAGE comment "Page alloc debug is incompatible with Software Suspend on i386" depends on DEBUG_KERNEL && HIBERNATION - depends on X86_32 config DEBUG_PAGEALLOC bool "Debug page memory allocations" depends on DEBUG_KERNEL && !HIBERNATION && !HUGETLBFS - depends on X86_32 help Unmap pages from the kernel linear mapping after free_pages(). This results in a large slowdown, but helps to find certain types @@ -61,7 +59,6 @@ config DEBUG_RODATA config 4KSTACKS bool "Use 4Kb for kernel stacks instead of 8Kb" depends on DEBUG_KERNEL - depends on X86_32 help If you say Y here the kernel will use a 4Kb stacksize for the kernel stack attached to each process/thread. This facilitates @@ -70,50 +67,22 @@ config 4KSTACKS will also use IRQ stacks to compensate for the reduced stackspace. config X86_FIND_SMP_CONFIG - def_bool y + bool depends on X86_LOCAL_APIC || X86_VOYAGER - depends on X86_32 + default y config X86_MPPARSE - def_bool y + bool depends on X86_LOCAL_APIC && !X86_VISWS - depends on X86_32 + default y config DOUBLEFAULT default y bool "Enable doublefault exception handler" if EMBEDDED - depends on X86_32 - help - This option allows trapping of rare doublefault exceptions that - would otherwise cause a system to silently reboot. Disabling this - option saves about 4k and might cause you much additional grey - hair. - -config IOMMU_DEBUG - bool "Enable IOMMU debugging" - depends on IOMMU && DEBUG_KERNEL - depends on X86_64 help - Force the IOMMU to on even when you have less than 4GB of - memory and add debugging code. On overflow always panic. And - allow to enable IOMMU leak tracing. Can be disabled at boot - time with iommu=noforce. This will also enable scatter gather - list merging. Currently not recommended for production - code. When you use it make sure you have a big enough - IOMMU/AGP aperture. Most of the options enabled by this can - be set more finegrained using the iommu= command line - options. See Documentation/x86_64/boot-options.txt for more - details. - -config IOMMU_LEAK - bool "IOMMU leak tracing" - depends on DEBUG_KERNEL - depends on IOMMU_DEBUG - help - Add a simple leak tracer to the IOMMU code. This is useful when you - are debugging a buggy device driver that leaks IOMMU mappings. - -#config X86_REMOTE_DEBUG -# bool "kgdb debugging stub" + This option allows trapping of rare doublefault exceptions that + would otherwise cause a system to silently reboot. Disabling this + option saves about 4k and might cause you much additional grey + hair. endmenu diff --git a/trunk/arch/x86/Makefile_32 b/trunk/arch/i386/Makefile similarity index 98% rename from trunk/arch/x86/Makefile_32 rename to trunk/arch/i386/Makefile index 346ac0766875..f5b9a37def8b 100644 --- a/trunk/arch/x86/Makefile_32 +++ b/trunk/arch/i386/Makefile @@ -1,5 +1,5 @@ # -# i386 Makefile +# i386/Makefile # # This file is included by the global makefile so that you can add your own # architecture-specific flags and dependencies. Remember to do have actions @@ -17,6 +17,9 @@ # 20050320 Kianusch Sayah Karadji # Added support for GEODE CPU +# Fill in SRCARCH +SRCARCH := x86 + # BITS is used as extension for files which are available in a 32 bit # and a 64 bit version to simplify shared Makefiles. # e.g.: obj-y += foo_$(BITS).o @@ -43,7 +46,7 @@ KBUILD_CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) # CPU-specific tuning. Anything which can be shared with UML should go here. -include $(srctree)/arch/x86/Makefile_32.cpu +include $(srctree)/arch/i386/Makefile.cpu # temporary until string.h is fixed cflags-y += -ffreestanding diff --git a/trunk/arch/x86/Makefile_32.cpu b/trunk/arch/i386/Makefile.cpu similarity index 100% rename from trunk/arch/x86/Makefile_32.cpu rename to trunk/arch/i386/Makefile.cpu diff --git a/trunk/arch/x86/configs/i386_defconfig b/trunk/arch/i386/defconfig similarity index 100% rename from trunk/arch/x86/configs/i386_defconfig rename to trunk/arch/i386/defconfig diff --git a/trunk/arch/sparc/kernel/pcic.c b/trunk/arch/sparc/kernel/pcic.c index f2d432edc92d..f2eae457fc9a 100644 --- a/trunk/arch/sparc/kernel/pcic.c +++ b/trunk/arch/sparc/kernel/pcic.c @@ -753,7 +753,7 @@ void __init pci_time_init(void) local_irq_enable(); } -static inline unsigned long do_gettimeoffset(void) +static __inline__ unsigned long do_gettimeoffset(void) { /* * We divide all by 100 diff --git a/trunk/arch/sparc/kernel/process.c b/trunk/arch/sparc/kernel/process.c index 77460e316a03..33f7a3ddb104 100644 --- a/trunk/arch/sparc/kernel/process.c +++ b/trunk/arch/sparc/kernel/process.c @@ -1,6 +1,7 @@ -/* linux/arch/sparc/kernel/process.c +/* $Id: process.c,v 1.161 2002/01/23 11:27:32 davem Exp $ + * linux/arch/sparc/kernel/process.c * - * Copyright (C) 1995 David S. Miller (davem@davemloft.net) + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) */ @@ -396,7 +397,7 @@ void flush_thread(void) } } -static inline struct sparc_stackf __user * +static __inline__ struct sparc_stackf __user * clone_stackframe(struct sparc_stackf __user *dst, struct sparc_stackf __user *src) { diff --git a/trunk/arch/sparc/kernel/time.c b/trunk/arch/sparc/kernel/time.c index 45cb7c5286d7..4bf78a5e8e0f 100644 --- a/trunk/arch/sparc/kernel/time.c +++ b/trunk/arch/sparc/kernel/time.c @@ -1,6 +1,7 @@ -/* linux/arch/sparc/kernel/time.c +/* $Id: time.c,v 1.60 2002/01/23 14:33:55 davem Exp $ + * linux/arch/sparc/kernel/time.c * - * Copyright (C) 1995 David S. Miller (davem@davemloft.net) + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) * * Chris Davis (cdavis@cois.on.ca) 03/27/1998 @@ -209,7 +210,7 @@ static void __devinit kick_start_clock(void) } /* Return nonzero if the clock chip battery is low. */ -static inline int has_low_battery(void) +static __inline__ int has_low_battery(void) { struct mostek48t02 *regs = (struct mostek48t02 *)mstk48t02_regs; unsigned char data1, data2; @@ -251,7 +252,7 @@ static void __devinit mostek_set_system_time(void) } /* Probe for the real time clock chip on Sun4 */ -static inline void sun4_clock_probe(void) +static __inline__ void sun4_clock_probe(void) { #ifdef CONFIG_SUN4 int temp; diff --git a/trunk/arch/sparc/mm/btfixup.c b/trunk/arch/sparc/mm/btfixup.c index a312d127d47a..ec4231c2855a 100644 --- a/trunk/arch/sparc/mm/btfixup.c +++ b/trunk/arch/sparc/mm/btfixup.c @@ -1,4 +1,5 @@ -/* btfixup.c: Boot time code fixup and relocator, so that +/* $Id: btfixup.c,v 1.10 2000/05/09 17:40:13 davem Exp $ + * btfixup.c: Boot time code fixup and relocator, so that * we can get rid of most indirect calls to achieve single * image sun4c and srmmu kernel. * @@ -68,7 +69,7 @@ static void __init set_addr(unsigned int *addr, unsigned int q1, int fmangled, u } } #else -static inline void set_addr(unsigned int *addr, unsigned int q1, int fmangled, unsigned int value) +static __inline__ void set_addr(unsigned int *addr, unsigned int q1, int fmangled, unsigned int value) { *addr = value; } diff --git a/trunk/arch/sparc/mm/io-unit.c b/trunk/arch/sparc/mm/io-unit.c index b86dfce8eee4..1666087c5b80 100644 --- a/trunk/arch/sparc/mm/io-unit.c +++ b/trunk/arch/sparc/mm/io-unit.c @@ -144,7 +144,7 @@ static void iounit_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus spin_lock_irqsave(&iounit->lock, flags); while (sz != 0) { --sz; - sg->dvma_address = iounit_get_area(iounit, (unsigned long) sg_virt(sg), sg->length); + sg->dvma_address = iounit_get_area(iounit, sg_virt(sg), sg->length); sg->dvma_length = sg->length; sg = sg_next(sg); } diff --git a/trunk/arch/sparc/mm/sun4c.c b/trunk/arch/sparc/mm/sun4c.c index 0729305f2f59..a2cc141291c7 100644 --- a/trunk/arch/sparc/mm/sun4c.c +++ b/trunk/arch/sparc/mm/sun4c.c @@ -1,6 +1,7 @@ -/* sun4c.c: Doing in software what should be done in hardware. +/* $Id: sun4c.c,v 1.212 2001/12/21 04:56:15 davem Exp $ + * sun4c.c: Doing in software what should be done in hardware. * - * Copyright (C) 1996 David S. Miller (davem@davemloft.net) + * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) * Copyright (C) 1996 Andrew Tridgell (Andrew.Tridgell@anu.edu.au) * Copyright (C) 1997-2000 Anton Blanchard (anton@samba.org) @@ -718,7 +719,7 @@ static void add_ring(struct sun4c_mmu_ring *ring, ring->num_entries++; } -static inline void add_lru(struct sun4c_mmu_entry *entry) +static __inline__ void add_lru(struct sun4c_mmu_entry *entry) { struct sun4c_mmu_ring *ring = &sun4c_ulru_ring; struct sun4c_mmu_entry *head = &ring->ringhd; @@ -745,7 +746,7 @@ static void add_ring_ordered(struct sun4c_mmu_ring *ring, add_lru(entry); } -static inline void remove_ring(struct sun4c_mmu_ring *ring, +static __inline__ void remove_ring(struct sun4c_mmu_ring *ring, struct sun4c_mmu_entry *entry) { struct sun4c_mmu_entry *next = entry->next; @@ -1835,7 +1836,7 @@ static unsigned long sun4c_pte_to_pgoff(pte_t pte) } -static inline unsigned long sun4c_pmd_page_v(pmd_t pmd) +static __inline__ unsigned long sun4c_pmd_page_v(pmd_t pmd) { return (pmd_val(pmd) & PAGE_MASK); } @@ -1921,7 +1922,7 @@ static void sun4c_free_pgd_fast(pgd_t *pgd) } -static inline pte_t * +static __inline__ pte_t * sun4c_pte_alloc_one_fast(struct mm_struct *mm, unsigned long address) { unsigned long *ret; @@ -1955,7 +1956,7 @@ static struct page *sun4c_pte_alloc_one(struct mm_struct *mm, unsigned long addr return virt_to_page(pte); } -static inline void sun4c_free_pte_fast(pte_t *pte) +static __inline__ void sun4c_free_pte_fast(pte_t *pte) { *(unsigned long *)pte = (unsigned long) pte_quicklist; pte_quicklist = (unsigned long *) pte; diff --git a/trunk/arch/sparc64/kernel/binfmt_elf32.c b/trunk/arch/sparc64/kernel/binfmt_elf32.c index 1587a29a4b0e..9ad84ff10a17 100644 --- a/trunk/arch/sparc64/kernel/binfmt_elf32.c +++ b/trunk/arch/sparc64/kernel/binfmt_elf32.c @@ -1,7 +1,7 @@ /* * binfmt_elf32.c: Support 32-bit Sparc ELF binaries on Ultra. * - * Copyright (C) 1995, 1996, 1997, 1998 David S. Miller (davem@davemloft.net) + * Copyright (C) 1995, 1996, 1997, 1998 David S. Miller (davem@redhat.com) * Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz) */ @@ -133,7 +133,7 @@ struct elf_prpsinfo32 #undef cputime_to_timeval #define cputime_to_timeval cputime_to_compat_timeval -static inline void +static __inline__ void cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) { unsigned long jiffies = cputime_to_jiffies(cputime); diff --git a/trunk/arch/sparc64/kernel/central.c b/trunk/arch/sparc64/kernel/central.c index b61b8dfb09cf..8230099f0d8a 100644 --- a/trunk/arch/sparc64/kernel/central.c +++ b/trunk/arch/sparc64/kernel/central.c @@ -1,6 +1,7 @@ -/* central.c: Central FHC driver for Sunfire/Starfire/Wildfire. +/* $Id: central.c,v 1.15 2001/12/19 00:29:51 davem Exp $ + * central.c: Central FHC driver for Sunfire/Starfire/Wildfire. * - * Copyright (C) 1997, 1999 David S. Miller (davem@davemloft.net) + * Copyright (C) 1997, 1999 David S. Miller (davem@redhat.com) */ #include @@ -384,7 +385,7 @@ void __init central_probe(void) init_all_fhc_hw(); } -static inline void fhc_ledblink(struct linux_fhc *fhc, int on) +static __inline__ void fhc_ledblink(struct linux_fhc *fhc, int on) { u32 tmp; @@ -401,7 +402,7 @@ static inline void fhc_ledblink(struct linux_fhc *fhc, int on) upa_readl(fhc->fhc_regs.pregs + FHC_PREGS_CTRL); } -static inline void central_ledblink(struct linux_central *central, int on) +static __inline__ void central_ledblink(struct linux_central *central, int on) { u8 tmp; diff --git a/trunk/arch/sparc64/kernel/semaphore.c b/trunk/arch/sparc64/kernel/semaphore.c index 9974a6899551..a809e63f03ef 100644 --- a/trunk/arch/sparc64/kernel/semaphore.c +++ b/trunk/arch/sparc64/kernel/semaphore.c @@ -1,4 +1,5 @@ -/* semaphore.c: Sparc64 semaphore implementation. +/* $Id: semaphore.c,v 1.9 2001/11/18 00:12:56 davem Exp $ + * semaphore.c: Sparc64 semaphore implementation. * * This is basically the PPC semaphore scheme ported to use * the sparc64 atomic instructions, so see the PPC code for @@ -18,7 +19,7 @@ * sem->count = tmp; * return old_count; */ -static inline int __sem_update_count(struct semaphore *sem, int incr) +static __inline__ int __sem_update_count(struct semaphore *sem, int incr) { int old_count, tmp; diff --git a/trunk/arch/sparc64/kernel/smp.c b/trunk/arch/sparc64/kernel/smp.c index 7cd8d94df0dc..407d74a8a542 100644 --- a/trunk/arch/sparc64/kernel/smp.c +++ b/trunk/arch/sparc64/kernel/smp.c @@ -459,7 +459,7 @@ static void spitfire_xcall_helper(u64 data0, u64 data1, u64 data2, u64 pstate, u } } -static inline void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask) +static __inline__ void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask) { u64 pstate; int i; @@ -906,7 +906,7 @@ extern atomic_t dcpage_flushes; extern atomic_t dcpage_flushes_xcall; #endif -static inline void __local_flush_dcache_page(struct page *page) +static __inline__ void __local_flush_dcache_page(struct page *page) { #ifdef DCACHE_ALIASING_POSSIBLE __flush_dcache_page(page_address(page), diff --git a/trunk/arch/sparc64/kernel/traps.c b/trunk/arch/sparc64/kernel/traps.c index 04998388259f..e9c7e4f07abf 100644 --- a/trunk/arch/sparc64/kernel/traps.c +++ b/trunk/arch/sparc64/kernel/traps.c @@ -1,6 +1,7 @@ -/* arch/sparc64/kernel/traps.c +/* $Id: traps.c,v 1.85 2002/02/09 19:49:31 davem Exp $ + * arch/sparc64/kernel/traps.c * - * Copyright (C) 1995,1997 David S. Miller (davem@davemloft.net) + * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1997,1999,2000 Jakub Jelinek (jakub@redhat.com) */ @@ -764,7 +765,7 @@ static unsigned long cheetah_afsr_errors; */ struct cheetah_err_info *cheetah_error_log; -static inline struct cheetah_err_info *cheetah_get_error_log(unsigned long afsr) +static __inline__ struct cheetah_err_info *cheetah_get_error_log(unsigned long afsr) { struct cheetah_err_info *p; int cpu = smp_processor_id(); @@ -1084,7 +1085,7 @@ static unsigned char cheetah_mtag_syntab[] = { }; /* Return the highest priority error conditon mentioned. */ -static inline unsigned long cheetah_get_hipri(unsigned long afsr) +static __inline__ unsigned long cheetah_get_hipri(unsigned long afsr) { unsigned long tmp = 0; int i; diff --git a/trunk/arch/sparc64/mm/init.c b/trunk/arch/sparc64/mm/init.c index e18ccf85224f..100c4456ed1e 100644 --- a/trunk/arch/sparc64/mm/init.c +++ b/trunk/arch/sparc64/mm/init.c @@ -201,7 +201,7 @@ inline void flush_dcache_page_impl(struct page *page) #define dcache_dirty_cpu(page) \ (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask) -static inline void set_dcache_dirty(struct page *page, int this_cpu) +static __inline__ void set_dcache_dirty(struct page *page, int this_cpu) { unsigned long mask = this_cpu; unsigned long non_cpu_bits; @@ -223,7 +223,7 @@ static inline void set_dcache_dirty(struct page *page, int this_cpu) : "g1", "g7"); } -static inline void clear_dcache_dirty_cpu(struct page *page, unsigned long cpu) +static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long cpu) { unsigned long mask = (1UL << PG_dcache_dirty); diff --git a/trunk/arch/sparc64/prom/console.c b/trunk/arch/sparc64/prom/console.c index e1c3fc87484d..3fafa9a8b50b 100644 --- a/trunk/arch/sparc64/prom/console.c +++ b/trunk/arch/sparc64/prom/console.c @@ -1,7 +1,8 @@ -/* console.c: Routines that deal with sending and receiving IO +/* $Id: console.c,v 1.9 1997/10/29 07:41:43 ecd Exp $ + * console.c: Routines that deal with sending and receiving IO * to/from the current console device using the PROM. * - * Copyright (C) 1995 David S. Miller (davem@davemloft.net) + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ @@ -18,7 +19,7 @@ extern int prom_stdin, prom_stdout; /* Non blocking get character from console input device, returns -1 * if no input was taken. This can be used for polling. */ -inline int +__inline__ int prom_nbgetchar(void) { char inc; @@ -34,7 +35,7 @@ prom_nbgetchar(void) /* Non blocking put character to console device, returns -1 if * unsuccessful. */ -inline int +__inline__ int prom_nbputchar(char c) { char outc; diff --git a/trunk/arch/sparc64/prom/tree.c b/trunk/arch/sparc64/prom/tree.c index a99ccd7fb1b0..b2c5b12c9818 100644 --- a/trunk/arch/sparc64/prom/tree.c +++ b/trunk/arch/sparc64/prom/tree.c @@ -18,12 +18,14 @@ /* Return the child of node 'node' or zero if no this node has no * direct descendent. */ -inline int __prom_getchild(int node) +__inline__ int +__prom_getchild(int node) { return p1275_cmd ("child", P1275_INOUT(1, 1), node); } -inline int prom_getchild(int node) +__inline__ int +prom_getchild(int node) { int cnode; @@ -33,7 +35,8 @@ inline int prom_getchild(int node) return (int)cnode; } -inline int prom_getparent(int node) +__inline__ int +prom_getparent(int node) { int cnode; @@ -46,12 +49,14 @@ inline int prom_getparent(int node) /* Return the next sibling of node 'node' or zero if no more siblings * at this level of depth in the tree. */ -inline int __prom_getsibling(int node) +__inline__ int +__prom_getsibling(int node) { return p1275_cmd(prom_peer_name, P1275_INOUT(1, 1), node); } -inline int prom_getsibling(int node) +__inline__ int +prom_getsibling(int node) { int sibnode; @@ -67,7 +72,8 @@ inline int prom_getsibling(int node) /* Return the length in bytes of property 'prop' at node 'node'. * Return -1 on error. */ -inline int prom_getproplen(int node, const char *prop) +__inline__ int +prom_getproplen(int node, const char *prop) { if((!node) || (!prop)) return -1; return p1275_cmd ("getproplen", @@ -80,8 +86,8 @@ inline int prom_getproplen(int node, const char *prop) * 'buffer' which has a size of 'bufsize'. If the acquisition * was successful the length will be returned, else -1 is returned. */ -inline int prom_getproperty(int node, const char *prop, - char *buffer, int bufsize) +__inline__ int +prom_getproperty(int node, const char *prop, char *buffer, int bufsize) { int plen; @@ -101,7 +107,8 @@ inline int prom_getproperty(int node, const char *prop, /* Acquire an integer property and return its value. Returns -1 * on failure. */ -inline int prom_getint(int node, const char *prop) +__inline__ int +prom_getint(int node, const char *prop) { int intprop; @@ -115,7 +122,8 @@ inline int prom_getint(int node, const char *prop) * integer. */ -int prom_getintdefault(int node, const char *property, int deflt) +int +prom_getintdefault(int node, const char *property, int deflt) { int retval; @@ -126,7 +134,8 @@ int prom_getintdefault(int node, const char *property, int deflt) } /* Acquire a boolean property, 1=TRUE 0=FALSE. */ -int prom_getbool(int node, const char *prop) +int +prom_getbool(int node, const char *prop) { int retval; @@ -139,7 +148,8 @@ int prom_getbool(int node, const char *prop) * string on error. The char pointer is the user supplied string * buffer. */ -void prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size) +void +prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size) { int len; @@ -153,7 +163,8 @@ void prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size) /* Does the device at node 'node' have name 'name'? * YES = 1 NO = 0 */ -int prom_nodematch(int node, const char *name) +int +prom_nodematch(int node, const char *name) { char namebuf[128]; prom_getproperty(node, "name", namebuf, sizeof(namebuf)); @@ -164,7 +175,8 @@ int prom_nodematch(int node, const char *name) /* Search siblings at 'node_start' for a node with name * 'nodename'. Return node if successful, zero if not. */ -int prom_searchsiblings(int node_start, const char *nodename) +int +prom_searchsiblings(int node_start, const char *nodename) { int thisnode, error; @@ -185,7 +197,8 @@ int prom_searchsiblings(int node_start, const char *nodename) /* Return the first property type for node 'node'. * buffer should be at least 32B in length */ -inline char *prom_firstprop(int node, char *buffer) +__inline__ char * +prom_firstprop(int node, char *buffer) { *buffer = 0; if(node == -1) return buffer; @@ -199,7 +212,8 @@ inline char *prom_firstprop(int node, char *buffer) * at node 'node' . Returns NULL string if no more * property types for this node. */ -inline char *prom_nextprop(int node, const char *oprop, char *buffer) +__inline__ char * +prom_nextprop(int node, const char *oprop, char *buffer) { char buf[32]; @@ -265,7 +279,8 @@ prom_setprop(int node, const char *pname, char *value, int size) node, pname, value, P1275_SIZE(size)); } -inline int prom_inst2pkg(int inst) +__inline__ int +prom_inst2pkg(int inst) { int node; diff --git a/trunk/arch/x86/Makefile b/trunk/arch/x86/Makefile deleted file mode 100644 index 309597386a77..000000000000 --- a/trunk/arch/x86/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# Unified Makefile for i386 and x86_64 - -# select defconfig based on actual architecture -KBUILD_DEFCONFIG := $(ARCH)_defconfig - -# # No need to remake these files -$(srctree)/arch/x86/Makefile%: ; - -ifeq ($(ARCH),i386) - include $(srctree)/arch/x86/Makefile_32 -else - include $(srctree)/arch/x86/Makefile_64 -endif - - - diff --git a/trunk/arch/x86/boot/boot.h b/trunk/arch/x86/boot/boot.h index d2b5adf46512..5f9a2e72a731 100644 --- a/trunk/arch/x86/boot/boot.h +++ b/trunk/arch/x86/boot/boot.h @@ -17,8 +17,6 @@ #ifndef BOOT_BOOT_H #define BOOT_BOOT_H -#define STACK_SIZE 512 /* Minimum number of bytes for stack */ - #ifndef __ASSEMBLY__ #include @@ -200,6 +198,8 @@ static inline int isdigit(int ch) } /* Heap -- available for dynamic lists. */ +#define STACK_SIZE 512 /* Minimum number of bytes for stack */ + extern char _end[]; extern char *HEAP; extern char *heap_end; @@ -216,9 +216,9 @@ static inline char *__get_heap(size_t s, size_t a, size_t n) #define GET_HEAP(type, n) \ ((type *)__get_heap(sizeof(type),__alignof__(type),(n))) -static inline bool heap_free(size_t n) +static inline int heap_free(void) { - return (int)(heap_end-HEAP) >= (int)n; + return heap_end-HEAP; } /* copy.S */ diff --git a/trunk/arch/x86/boot/compressed/head_32.S b/trunk/arch/x86/boot/compressed/head_32.S index 036e635f18a3..a0ae2e7f6cec 100644 --- a/trunk/arch/x86/boot/compressed/head_32.S +++ b/trunk/arch/x86/boot/compressed/head_32.S @@ -33,20 +33,24 @@ .globl startup_32 startup_32: - cld + /* check to see if KEEP_SEGMENTS flag is meaningful */ + cmpw $0x207, BP_version(%esi) + jb 1f + /* test KEEP_SEGMENTS flag to see if the bootloader is asking * us to not reload segments */ testb $(1<<6), BP_loadflags(%esi) - jnz 1f + jnz 2f - cli +1: cli movl $(__BOOT_DS),%eax movl %eax,%ds movl %eax,%es movl %eax,%fs movl %eax,%gs movl %eax,%ss -1: + +2: cld /* Calculate the delta between where we were compiled to run * at and where we were actually loaded at. This can only be done diff --git a/trunk/arch/x86/boot/compressed/head_64.S b/trunk/arch/x86/boot/compressed/head_64.S index 1ccb38a7f0d2..49467640751f 100644 --- a/trunk/arch/x86/boot/compressed/head_64.S +++ b/trunk/arch/x86/boot/compressed/head_64.S @@ -29,7 +29,6 @@ #include #include #include -#include .section ".text.head" .code32 @@ -37,17 +36,11 @@ startup_32: cld - /* test KEEP_SEGMENTS flag to see if the bootloader is asking - * us to not reload segments */ - testb $(1<<6), BP_loadflags(%esi) - jnz 1f - cli movl $(__KERNEL_DS), %eax movl %eax, %ds movl %eax, %es movl %eax, %ss -1: /* Calculate the delta between where we were compiled to run * at and where we were actually loaded at. This can only be done diff --git a/trunk/arch/x86/boot/header.S b/trunk/arch/x86/boot/header.S index 6ef5a060fa11..8353c81c41c0 100644 --- a/trunk/arch/x86/boot/header.S +++ b/trunk/arch/x86/boot/header.S @@ -173,8 +173,7 @@ ramdisk_size: .long 0 # its size in bytes bootsect_kludge: .long 0 # obsolete -heap_end_ptr: .word _end+STACK_SIZE-512 - # (Header version 0x0201 or later) +heap_end_ptr: .word _end+1024 # (Header version 0x0201 or later) # space from here (exclusive) down to # end of setup code can be used by setup # for local heap purposes. @@ -231,53 +230,28 @@ start_of_setup: int $0x13 #endif +# We will have entered with %cs = %ds+0x20, normalize %cs so +# it is on par with the other segments. + pushw %ds + pushw $setup2 + lretw + +setup2: # Force %es = %ds movw %ds, %ax movw %ax, %es cld -# Apparently some ancient versions of LILO invoked the kernel -# with %ss != %ds, which happened to work by accident for the -# old code. If the CAN_USE_HEAP flag is set in loadflags, or -# %ss != %ds, then adjust the stack pointer. - - # Smallest possible stack we can tolerate - movw $(_end+STACK_SIZE), %cx - - movw heap_end_ptr, %dx - addw $512, %dx - jnc 1f - xorw %dx, %dx # Wraparound - whole segment available -1: testb $CAN_USE_HEAP, loadflags - jnz 2f - - # No CAN_USE_HEAP - movw %ss, %dx - cmpw %ax, %dx # %ds == %ss? - movw %sp, %dx - # If so, assume %sp is reasonably set, otherwise use - # the smallest possible stack. - jne 4f # -> Smallest possible stack... - - # Make sure the stack is at least minimum size. Take a value - # of zero to mean "full segment." -2: - andw $~3, %dx # dword align (might as well...) - jnz 3f - movw $0xfffc, %dx # Make sure we're not zero -3: cmpw %cx, %dx - jnb 5f -4: movw %cx, %dx # Minimum value we can possibly use -5: movw %ax, %ss - movzwl %dx, %esp # Clear upper half of %esp - sti # Now we should have a working stack - -# We will have entered with %cs = %ds+0x20, normalize %cs so -# it is on par with the other segments. - pushw %ds - pushw $6f - lretw -6: +# Stack paranoia: align the stack and make sure it is good +# for both 16- and 32-bit references. In particular, if we +# were meant to have been using the full 16-bit segment, the +# caller might have set %sp to zero, which breaks %esp-based +# references. + andw $~3, %sp # dword align (might as well...) + jnz 1f + movw $0xfffc, %sp # Make sure we're not zero +1: movzwl %sp, %esp # Clear upper half of %esp + sti # Check signature at end of setup cmpl $0x5a5aaa55, setup_sig diff --git a/trunk/arch/x86/boot/video-bios.c b/trunk/arch/x86/boot/video-bios.c index ed0672a81870..68e65d95cdfd 100644 --- a/trunk/arch/x86/boot/video-bios.c +++ b/trunk/arch/x86/boot/video-bios.c @@ -79,7 +79,7 @@ static int bios_probe(void) video_bios.modes = GET_HEAP(struct mode_info, 0); for (mode = 0x14; mode <= 0x7f; mode++) { - if (!heap_free(sizeof(struct mode_info))) + if (heap_free() < sizeof(struct mode_info)) break; if (mode_defined(VIDEO_FIRST_BIOS+mode)) diff --git a/trunk/arch/x86/boot/video-vesa.c b/trunk/arch/x86/boot/video-vesa.c index 4716b9a96357..192190710710 100644 --- a/trunk/arch/x86/boot/video-vesa.c +++ b/trunk/arch/x86/boot/video-vesa.c @@ -57,7 +57,7 @@ static int vesa_probe(void) while ((mode = rdfs16(mode_ptr)) != 0xffff) { mode_ptr += 2; - if (!heap_free(sizeof(struct mode_info))) + if (heap_free() < sizeof(struct mode_info)) break; /* Heap full, can't save mode info */ if (mode & ~0x1ff) diff --git a/trunk/arch/x86/boot/video.c b/trunk/arch/x86/boot/video.c index ad9712f01739..e4ba897bf9a3 100644 --- a/trunk/arch/x86/boot/video.c +++ b/trunk/arch/x86/boot/video.c @@ -371,7 +371,7 @@ static void save_screen(void) saved.curx = boot_params.screen_info.orig_x; saved.cury = boot_params.screen_info.orig_y; - if (!heap_free(saved.x*saved.y*sizeof(u16)+512)) + if (heap_free() < saved.x*saved.y*sizeof(u16)+512) return; /* Not enough heap to save the screen */ saved.data = GET_HEAP(u16, saved.x*saved.y); diff --git a/trunk/arch/x86/kernel/acpi/processor.c b/trunk/arch/x86/kernel/acpi/processor.c index f63e5ff0aca1..2ed0a4ce62f0 100644 --- a/trunk/arch/x86/kernel/acpi/processor.c +++ b/trunk/arch/x86/kernel/acpi/processor.c @@ -62,7 +62,8 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c) /* Initialize _PDC data based on the CPU vendor */ void arch_acpi_processor_init_pdc(struct acpi_processor *pr) { - struct cpuinfo_x86 *c = &cpu_data(pr->id); + unsigned int cpu = pr->id; + struct cpuinfo_x86 *c = &cpu_data(cpu); pr->pdc = NULL; if (c->x86_vendor == X86_VENDOR_INTEL) diff --git a/trunk/arch/x86/kernel/asm-offsets_64.c b/trunk/arch/x86/kernel/asm-offsets_64.c index d1b6ed98774e..7e50bda565b4 100644 --- a/trunk/arch/x86/kernel/asm-offsets_64.c +++ b/trunk/arch/x86/kernel/asm-offsets_64.c @@ -15,16 +15,12 @@ #include #include #include -#include #define DEFINE(sym, val) \ asm volatile("\n->" #sym " %0 " #val : : "i" (val)) #define BLANK() asm volatile("\n->" : : ) -#define OFFSET(sym, str, mem) \ - DEFINE(sym, offsetof(struct str, mem)) - #define __NO_STUBS 1 #undef __SYSCALL #undef _ASM_X86_64_UNISTD_H_ @@ -113,11 +109,5 @@ int main(void) DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx)); BLANK(); DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); - - BLANK(); - OFFSET(BP_scratch, boot_params, scratch); - OFFSET(BP_loadflags, boot_params, hdr.loadflags); - OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); - OFFSET(BP_version, boot_params, hdr.version); return 0; } diff --git a/trunk/arch/x86/kernel/early-quirks.c b/trunk/arch/x86/kernel/early-quirks.c index 639e6320518e..dc34acbd54aa 100644 --- a/trunk/arch/x86/kernel/early-quirks.c +++ b/trunk/arch/x86/kernel/early-quirks.c @@ -35,14 +35,12 @@ static void __init via_bugs(void) } #ifdef CONFIG_ACPI -#ifdef CONFIG_X86_IO_APIC static int __init nvidia_hpet_check(struct acpi_table_header *header) { return 0; } -#endif /* CONFIG_X86_IO_APIC */ -#endif /* CONFIG_ACPI */ +#endif static void __init nvidia_bugs(void) { diff --git a/trunk/arch/x86/kernel/machine_kexec_64.c b/trunk/arch/x86/kernel/machine_kexec_64.c index aa3d2c8f7737..0d8577f05422 100644 --- a/trunk/arch/x86/kernel/machine_kexec_64.c +++ b/trunk/arch/x86/kernel/machine_kexec_64.c @@ -233,8 +233,6 @@ NORET_TYPE void machine_kexec(struct kimage *image) void arch_crash_save_vmcoreinfo(void) { - VMCOREINFO_SYMBOL(init_level4_pgt); - #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE VMCOREINFO_SYMBOL(node_data); VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); diff --git a/trunk/arch/x86/kernel/smp_32.c b/trunk/arch/x86/kernel/smp_32.c index fcaa026eb807..f32115308399 100644 --- a/trunk/arch/x86/kernel/smp_32.c +++ b/trunk/arch/x86/kernel/smp_32.c @@ -708,4 +708,10 @@ struct smp_ops smp_ops = { .smp_send_reschedule = native_smp_send_reschedule, .smp_call_function_mask = native_smp_call_function_mask, }; -EXPORT_SYMBOL_GPL(smp_ops); + +int smp_call_function_mask(cpumask_t mask, void (*func) (void *info), + void *info, int wait) +{ + return smp_ops.smp_call_function_mask(mask, func, info, wait); +} +EXPORT_SYMBOL(smp_call_function_mask); diff --git a/trunk/arch/x86/mach-voyager/voyager_smp.c b/trunk/arch/x86/mach-voyager/voyager_smp.c index 69371434b0cf..361ac5107b33 100644 --- a/trunk/arch/x86/mach-voyager/voyager_smp.c +++ b/trunk/arch/x86/mach-voyager/voyager_smp.c @@ -29,14 +29,14 @@ #include /* TLB state -- visible externally, indexed physically */ -DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = { &init_mm, 0 }; +DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate) ____cacheline_aligned = { &init_mm, 0 }; /* CPU IRQ affinity -- set to all ones initially */ static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned = { [0 ... NR_CPUS-1] = ~0UL }; /* per CPU data structure (for /proc/cpuinfo et al), visible externally * indexed physically */ -DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); +DEFINE_PER_CPU(cpuinfo_x86, cpu_info) __cacheline_aligned; EXPORT_PER_CPU_SYMBOL(cpu_info); /* physical ID of the CPU used to boot the system */ diff --git a/trunk/arch/x86_64/.gitignore b/trunk/arch/x86_64/.gitignore new file mode 100644 index 000000000000..36ef4c374d25 --- /dev/null +++ b/trunk/arch/x86_64/.gitignore @@ -0,0 +1 @@ +boot diff --git a/trunk/arch/x86/Kconfig.x86_64 b/trunk/arch/x86_64/Kconfig similarity index 99% rename from trunk/arch/x86/Kconfig.x86_64 rename to trunk/arch/x86_64/Kconfig index e2542e5b536c..308970aa5382 100644 --- a/trunk/arch/x86/Kconfig.x86_64 +++ b/trunk/arch/x86_64/Kconfig @@ -835,7 +835,7 @@ source fs/Kconfig source "kernel/Kconfig.instrumentation" -source "arch/x86/Kconfig.debug" +source "arch/x86_64/Kconfig.debug" source "security/Kconfig" diff --git a/trunk/arch/x86_64/Kconfig.debug b/trunk/arch/x86_64/Kconfig.debug new file mode 100644 index 000000000000..775d211a5cf9 --- /dev/null +++ b/trunk/arch/x86_64/Kconfig.debug @@ -0,0 +1,61 @@ +menu "Kernel hacking" + +config TRACE_IRQFLAGS_SUPPORT + bool + default y + +source "lib/Kconfig.debug" + +config DEBUG_RODATA + bool "Write protect kernel read-only data structures" + depends on DEBUG_KERNEL + help + Mark the kernel read-only data as write-protected in the pagetables, + in order to catch accidental (and incorrect) writes to such const data. + This option may have a slight performance impact because a portion + of the kernel code won't be covered by a 2MB TLB anymore. + If in doubt, say "N". + +config IOMMU_DEBUG + depends on IOMMU && DEBUG_KERNEL + bool "Enable IOMMU debugging" + help + Force the IOMMU to on even when you have less than 4GB of + memory and add debugging code. On overflow always panic. And + allow to enable IOMMU leak tracing. Can be disabled at boot + time with iommu=noforce. This will also enable scatter gather + list merging. Currently not recommended for production + code. When you use it make sure you have a big enough + IOMMU/AGP aperture. Most of the options enabled by this can + be set more finegrained using the iommu= command line + options. See Documentation/x86_64/boot-options.txt for more + details. + +config IOMMU_LEAK + bool "IOMMU leak tracing" + depends on DEBUG_KERNEL + depends on IOMMU_DEBUG + help + Add a simple leak tracer to the IOMMU code. This is useful when you + are debugging a buggy device driver that leaks IOMMU mappings. + +config DEBUG_STACKOVERFLOW + bool "Check for stack overflows" + depends on DEBUG_KERNEL + help + This option will cause messages to be printed if free stack space + drops below a certain limit. + +config DEBUG_STACK_USAGE + bool "Stack utilization instrumentation" + depends on DEBUG_KERNEL + help + Enables the display of the minimum amount of free stack which each + task has ever had available in the sysrq-T and sysrq-P debug output. + + This option will slow down process creation somewhat. + +#config X86_REMOTE_DEBUG +# bool "kgdb debugging stub" + +endmenu diff --git a/trunk/arch/x86/Makefile_64 b/trunk/arch/x86_64/Makefile similarity index 99% rename from trunk/arch/x86/Makefile_64 rename to trunk/arch/x86_64/Makefile index 57e714a47af7..20eb69bd5a6d 100644 --- a/trunk/arch/x86/Makefile_64 +++ b/trunk/arch/x86_64/Makefile @@ -1,5 +1,5 @@ # -# x86_64 Makefile +# x86_64/Makefile # # This file is included by the global makefile so that you can add your own # architecture-specific flags and dependencies. Remember to do have actions @@ -21,6 +21,9 @@ # # $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $ +# Fill in SRCARCH +SRCARCH := x86 + # BITS is used as extension for files which are available in a 32 bit # and a 64 bit version to simplify shared Makefiles. # e.g.: obj-y += foo_$(BITS).o diff --git a/trunk/arch/x86/configs/x86_64_defconfig b/trunk/arch/x86_64/defconfig similarity index 100% rename from trunk/arch/x86/configs/x86_64_defconfig rename to trunk/arch/x86_64/defconfig diff --git a/trunk/crypto/tcrypt.c b/trunk/crypto/tcrypt.c index 24141fb6f5cb..c457bdb2a42b 100644 --- a/trunk/crypto/tcrypt.c +++ b/trunk/crypto/tcrypt.c @@ -572,11 +572,9 @@ static int test_hash_jiffies_digest(struct hash_desc *desc, char *p, int blen, int bcount; int ret; - sg_init_table(sg, 1); - for (start = jiffies, end = start + sec * HZ, bcount = 0; time_before(jiffies, end); bcount++) { - sg_set_buf(sg, p, blen); + sg_init_one(sg, p, blen); ret = crypto_hash_digest(desc, sg, blen, out); if (ret) return ret; @@ -599,15 +597,13 @@ static int test_hash_jiffies(struct hash_desc *desc, char *p, int blen, if (plen == blen) return test_hash_jiffies_digest(desc, p, blen, out, sec); - sg_init_table(sg, 1); - for (start = jiffies, end = start + sec * HZ, bcount = 0; time_before(jiffies, end); bcount++) { ret = crypto_hash_init(desc); if (ret) return ret; for (pcount = 0; pcount < blen; pcount += plen) { - sg_set_buf(sg, p + pcount, plen); + sg_init_one(sg, p + pcount, plen); ret = crypto_hash_update(desc, sg, plen); if (ret) return ret; @@ -632,14 +628,12 @@ static int test_hash_cycles_digest(struct hash_desc *desc, char *p, int blen, int i; int ret; - sg_init_table(sg, 1); - local_bh_disable(); local_irq_disable(); /* Warm-up run. */ for (i = 0; i < 4; i++) { - sg_set_buf(sg, p, blen); + sg_init_one(sg, p, blen); ret = crypto_hash_digest(desc, sg, blen, out); if (ret) goto out; @@ -651,7 +645,7 @@ static int test_hash_cycles_digest(struct hash_desc *desc, char *p, int blen, start = get_cycles(); - sg_set_buf(sg, p, blen); + sg_init_one(sg, p, blen); ret = crypto_hash_digest(desc, sg, blen, out); if (ret) goto out; @@ -685,8 +679,6 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen, if (plen == blen) return test_hash_cycles_digest(desc, p, blen, out); - sg_init_table(sg, 1); - local_bh_disable(); local_irq_disable(); @@ -696,7 +688,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen, if (ret) goto out; for (pcount = 0; pcount < blen; pcount += plen) { - sg_set_buf(sg, p + pcount, plen); + sg_init_one(sg, p + pcount, plen); ret = crypto_hash_update(desc, sg, plen); if (ret) goto out; @@ -716,7 +708,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen, if (ret) goto out; for (pcount = 0; pcount < blen; pcount += plen) { - sg_set_buf(sg, p + pcount, plen); + sg_init_one(sg, p + pcount, plen); ret = crypto_hash_update(desc, sg, plen); if (ret) goto out; diff --git a/trunk/drivers/crypto/padlock-sha.c b/trunk/drivers/crypto/padlock-sha.c index c666b4e0933e..4e8de162fc12 100644 --- a/trunk/drivers/crypto/padlock-sha.c +++ b/trunk/drivers/crypto/padlock-sha.c @@ -55,7 +55,7 @@ static void padlock_sha_bypass(struct crypto_tfm *tfm) if (ctx(tfm)->data && ctx(tfm)->used) { struct scatterlist sg; - sg_init_one(&sg, ctx(tfm)->data, ctx(tfm)->used); + sg_set_buf(&sg, ctx(tfm)->data, ctx(tfm)->used); crypto_hash_update(&ctx(tfm)->fallback, &sg, sg.length); } @@ -79,7 +79,7 @@ static void padlock_sha_update(struct crypto_tfm *tfm, if (unlikely(ctx(tfm)->bypass)) { struct scatterlist sg; - sg_init_one(&sg, (uint8_t *)data, length); + sg_set_buf(&sg, (uint8_t *)data, length); crypto_hash_update(&ctx(tfm)->fallback, &sg, length); return; } diff --git a/trunk/drivers/ide/arm/icside.c b/trunk/drivers/ide/arm/icside.c index 93f71fcfc04d..410a0d13e35e 100644 --- a/trunk/drivers/ide/arm/icside.c +++ b/trunk/drivers/ide/arm/icside.c @@ -316,13 +316,13 @@ static int icside_dma_end(ide_drive_t *drive) drive->waiting_for_dma = 0; - disable_dma(ECARD_DEV(state->dev)->dma); + disable_dma(state->dev->dma); /* Teardown mappings after DMA has completed. */ dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents, hwif->sg_dma_direction); - return get_dma_residue(ECARD_DEV(state->dev)->dma) != 0; + return get_dma_residue(state->dev->dma) != 0; } static void icside_dma_start(ide_drive_t *drive) @@ -331,8 +331,8 @@ static void icside_dma_start(ide_drive_t *drive) struct icside_state *state = hwif->hwif_data; /* We can not enable DMA on both channels simultaneously. */ - BUG_ON(dma_channel_active(ECARD_DEV(state->dev)->dma)); - enable_dma(ECARD_DEV(state->dev)->dma); + BUG_ON(dma_channel_active(state->dev->dma)); + enable_dma(state->dev->dma); } static int icside_dma_setup(ide_drive_t *drive) @@ -350,7 +350,7 @@ static int icside_dma_setup(ide_drive_t *drive) /* * We can not enable DMA on both channels. */ - BUG_ON(dma_channel_active(ECARD_DEV(state->dev)->dma)); + BUG_ON(dma_channel_active(state->dev->dma)); icside_build_sglist(drive, rq); @@ -367,14 +367,14 @@ static int icside_dma_setup(ide_drive_t *drive) /* * Select the correct timing for this drive. */ - set_dma_speed(ECARD_DEV(state->dev)->dma, drive->drive_data); + set_dma_speed(state->dev->dma, drive->drive_data); /* * Tell the DMA engine about the SG table and * data direction. */ - set_dma_sg(ECARD_DEV(state->dev)->dma, hwif->sg_table, hwif->sg_nents); - set_dma_mode(ECARD_DEV(state->dev)->dma, dma_mode); + set_dma_sg(state->dev->dma, hwif->sg_table, hwif->sg_nents); + set_dma_mode(state->dev->dma, dma_mode); drive->waiting_for_dma = 1; diff --git a/trunk/drivers/ide/pci/cy82c693.c b/trunk/drivers/ide/pci/cy82c693.c index 3ef4fc10fe2c..1cd4e9cb0521 100644 --- a/trunk/drivers/ide/pci/cy82c693.c +++ b/trunk/drivers/ide/pci/cy82c693.c @@ -1,5 +1,5 @@ /* - * linux/drivers/ide/pci/cy82c693.c Version 0.41 Aug 27, 2007 + * linux/drivers/ide/pci/cy82c693.c Version 0.42 Oct 23, 2007 * * Copyright (C) 1998-2000 Andreas S. Krebs (akrebs@altavista.net), Maintainer * Copyright (C) 1998-2002 Andre Hedrick , Integrator @@ -436,10 +436,10 @@ static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif) hwif->ide_dma_on = &cy82c693_ide_dma_on; } -static __devinitdata ide_hwif_t *primary; - static void __devinit init_iops_cy82c693(ide_hwif_t *hwif) { + static ide_hwif_t *primary; + if (PCI_FUNC(hwif->pci_dev->devfn) == 1) primary = hwif; else { diff --git a/trunk/drivers/md/dm-crypt.c b/trunk/drivers/md/dm-crypt.c index 28c6ae095c56..1c159ac68c98 100644 --- a/trunk/drivers/md/dm-crypt.c +++ b/trunk/drivers/md/dm-crypt.c @@ -168,7 +168,7 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti, return -ENOMEM; } - sg_init_one(&sg, cc->key, cc->key_size); + sg_set_buf(&sg, cc->key, cc->key_size); desc.tfm = hash_tfm; desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP; err = crypto_hash_digest(&desc, &sg, cc->key_size, salt); diff --git a/trunk/drivers/mmc/core/mmc_ops.c b/trunk/drivers/mmc/core/mmc_ops.c index 7471d49909b2..bf4bc6adcfef 100644 --- a/trunk/drivers/mmc/core/mmc_ops.c +++ b/trunk/drivers/mmc/core/mmc_ops.c @@ -267,26 +267,15 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, int mmc_send_csd(struct mmc_card *card, u32 *csd) { - int ret, i; - if (!mmc_host_is_spi(card->host)) return mmc_send_cxd_native(card->host, card->rca << 16, csd, MMC_SEND_CSD); - ret = mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd, 16); - if (ret) - return ret; - - for (i = 0;i < 4;i++) - csd[i] = be32_to_cpu(csd[i]); - - return 0; + return mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd, 16); } int mmc_send_cid(struct mmc_host *host, u32 *cid) { - int ret, i; - if (!mmc_host_is_spi(host)) { if (!host->card) return -EINVAL; @@ -294,14 +283,7 @@ int mmc_send_cid(struct mmc_host *host, u32 *cid) cid, MMC_SEND_CID); } - ret = mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid, 16); - if (ret) - return ret; - - for (i = 0;i < 4;i++) - cid[i] = be32_to_cpu(cid[i]); - - return 0; + return mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid, 16); } int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd) diff --git a/trunk/drivers/mmc/core/sd_ops.c b/trunk/drivers/mmc/core/sd_ops.c index a6dafe62b992..ee4029a24efd 100644 --- a/trunk/drivers/mmc/core/sd_ops.c +++ b/trunk/drivers/mmc/core/sd_ops.c @@ -294,8 +294,8 @@ int mmc_app_send_scr(struct mmc_card *card, u32 *scr) if (data.error) return data.error; - scr[0] = be32_to_cpu(scr[0]); - scr[1] = be32_to_cpu(scr[1]); + scr[0] = ntohl(scr[0]); + scr[1] = ntohl(scr[1]); return 0; } diff --git a/trunk/drivers/mmc/host/au1xmmc.c b/trunk/drivers/mmc/host/au1xmmc.c index c3926eb3bf43..c77fadc0dfa3 100644 --- a/trunk/drivers/mmc/host/au1xmmc.c +++ b/trunk/drivers/mmc/host/au1xmmc.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -212,12 +212,12 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait, } if (data) { - if (data->flags & MMC_DATA_READ) { + if (flags & MMC_DATA_READ) { if (data->blocks > 1) mmccmd |= SD_CMD_CT_4; else mmccmd |= SD_CMD_CT_2; - } else if (data->flags & MMC_DATA_WRITE) { + } else if (flags & MMC_DATA_WRITE) { if (data->blocks > 1) mmccmd |= SD_CMD_CT_3; else diff --git a/trunk/drivers/mmc/host/mmc_spi.c b/trunk/drivers/mmc/host/mmc_spi.c index a6469218f194..12c2d807c145 100644 --- a/trunk/drivers/mmc/host/mmc_spi.c +++ b/trunk/drivers/mmc/host/mmc_spi.c @@ -1165,23 +1165,6 @@ mmc_spi_detect_irq(int irq, void *mmc) return IRQ_HANDLED; } -struct count_children { - unsigned n; - struct bus_type *bus; -}; - -static int maybe_count_child(struct device *dev, void *c) -{ - struct count_children *ccp = c; - - if (dev->bus == ccp->bus) { - if (ccp->n) - return -EBUSY; - ccp->n++; - } - return 0; -} - static int mmc_spi_probe(struct spi_device *spi) { void *ones; @@ -1205,30 +1188,33 @@ static int mmc_spi_probe(struct spi_device *spi) return status; } - /* We can use the bus safely iff nobody else will interfere with us. - * Most commands consist of one SPI message to issue a command, then - * several more to collect its response, then possibly more for data - * transfer. Clocking access to other devices during that period will - * corrupt the command execution. - * - * Until we have software primitives which guarantee non-interference, - * we'll aim for a hardware-level guarantee. - * - * REVISIT we can't guarantee another device won't be added later... + /* We can use the bus safely iff nobody else will interfere with + * us. That is, either we have the experimental exclusive access + * primitives ... or else there's nobody to share it with. */ if (spi->master->num_chipselect > 1) { - struct count_children cc; + struct device *parent = spi->dev.parent; - cc.n = 0; - cc.bus = spi->dev.bus; - status = device_for_each_child(spi->dev.parent, &cc, - maybe_count_child); + /* If there are multiple devices on this bus, we + * can't proceed. + */ + spin_lock(&parent->klist_children.k_lock); + if (parent->klist_children.k_list.next + != parent->klist_children.k_list.prev) + status = -EMLINK; + else + status = 0; + spin_unlock(&parent->klist_children.k_lock); if (status < 0) { dev_err(&spi->dev, "can't share SPI bus\n"); return status; } - dev_warn(&spi->dev, "ASSUMING SPI bus stays unshared!\n"); + /* REVISIT we can't guarantee another device won't + * be added later. It's uncommon though ... for now, + * work as if this is safe. + */ + dev_warn(&spi->dev, "ASSUMING unshared SPI bus!\n"); } /* We need a supply of ones to transmit. This is the only time diff --git a/trunk/drivers/net/loopback.c b/trunk/drivers/net/loopback.c index 45f30a2974b8..662b8d16803c 100644 --- a/trunk/drivers/net/loopback.c +++ b/trunk/drivers/net/loopback.c @@ -284,7 +284,7 @@ static __net_exit void loopback_net_exit(struct net *net) unregister_netdev(dev); } -static struct pernet_operations loopback_net_ops = { +static struct pernet_operations __net_initdata loopback_net_ops = { .init = loopback_net_init, .exit = loopback_net_exit, }; diff --git a/trunk/drivers/net/ppp_mppe.c b/trunk/drivers/net/ppp_mppe.c index b35d79449500..bcb0885011c8 100644 --- a/trunk/drivers/net/ppp_mppe.c +++ b/trunk/drivers/net/ppp_mppe.c @@ -68,7 +68,7 @@ MODULE_VERSION("1.0.2"); static unsigned int setup_sg(struct scatterlist *sg, const void *address, unsigned int length) { - sg_set_buf(sg, address, length); + sg_init_one(sg, address, length); return length; } @@ -140,8 +140,6 @@ static void get_new_key_from_sha(struct ppp_mppe_state * state) struct scatterlist sg[4]; unsigned int nbytes; - sg_init_table(sg, 4); - nbytes = setup_sg(&sg[0], state->master_key, state->keylen); nbytes += setup_sg(&sg[1], sha_pad->sha_pad1, sizeof(sha_pad->sha_pad1)); @@ -168,8 +166,6 @@ static void mppe_rekey(struct ppp_mppe_state * state, int initial_key) if (!initial_key) { crypto_blkcipher_setkey(state->arc4, state->sha1_digest, state->keylen); - sg_init_table(sg_in, 1); - sg_init_table(sg_out, 1); setup_sg(sg_in, state->sha1_digest, state->keylen); setup_sg(sg_out, state->session_key, state->keylen); if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in, @@ -425,8 +421,6 @@ mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf, isize -= 2; /* Encrypt packet */ - sg_init_table(sg_in, 1); - sg_init_table(sg_out, 1); setup_sg(sg_in, ibuf, isize); setup_sg(sg_out, obuf, osize); if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in, isize) != 0) { @@ -614,8 +608,6 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf, * Decrypt the first byte in order to check if it is * a compressed or uncompressed protocol field. */ - sg_init_table(sg_in, 1); - sg_init_table(sg_out, 1); setup_sg(sg_in, ibuf, 1); setup_sg(sg_out, obuf, 1); if (crypto_blkcipher_decrypt(&desc, sg_out, sg_in, 1) != 0) { diff --git a/trunk/drivers/scsi/iscsi_tcp.c b/trunk/drivers/scsi/iscsi_tcp.c index 4bcf916c21a7..097a136398cb 100644 --- a/trunk/drivers/scsi/iscsi_tcp.c +++ b/trunk/drivers/scsi/iscsi_tcp.c @@ -674,8 +674,9 @@ partial_sg_digest_update(struct hash_desc *desc, struct scatterlist *sg, { struct scatterlist temp; - sg_init_table(&temp, 1); - sg_set_page(&temp, sg_page(sg), length, offset); + memcpy(&temp, sg, sizeof(struct scatterlist)); + temp.offset = offset; + temp.length = length; crypto_hash_update(desc, &temp, length); } diff --git a/trunk/drivers/video/cirrusfb.c b/trunk/drivers/video/cirrusfb.c index f7e2d5add831..f99cb77e7b42 100644 --- a/trunk/drivers/video/cirrusfb.c +++ b/trunk/drivers/video/cirrusfb.c @@ -2509,7 +2509,8 @@ static int cirrusfb_zorro_register(struct zorro_dev *z, cinfo = info->par; cinfo->btype = btype; - assert(z); + assert(z > 0); + assert(z2 >= 0); assert(btype != BT_NONE); cinfo->zdev = z; diff --git a/trunk/fs/ecryptfs/crypto.c b/trunk/fs/ecryptfs/crypto.c index 9d70289f7df3..7a472b129997 100644 --- a/trunk/fs/ecryptfs/crypto.c +++ b/trunk/fs/ecryptfs/crypto.c @@ -279,8 +279,6 @@ int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg, int offset; int remainder_of_page; - sg_init_table(sg, sg_size); - while (size > 0 && i < sg_size) { pg = virt_to_page(addr); offset = offset_in_page(addr); diff --git a/trunk/fs/jffs2/acl.c b/trunk/fs/jffs2/acl.c index 77fc5838609c..9728614b8958 100644 --- a/trunk/fs/jffs2/acl.c +++ b/trunk/fs/jffs2/acl.c @@ -372,7 +372,7 @@ int jffs2_init_acl_post(struct inode *inode) return rc; } - return 0; + return rc; } void jffs2_clear_acl(struct jffs2_inode_info *f) diff --git a/trunk/fs/proc/proc_net.c b/trunk/fs/proc/proc_net.c index 749def054a34..4edaad0d995f 100644 --- a/trunk/fs/proc/proc_net.c +++ b/trunk/fs/proc/proc_net.c @@ -185,7 +185,7 @@ static __net_exit void proc_net_ns_exit(struct net *net) kfree(net->proc_net_root); } -static struct pernet_operations proc_net_ns_ops = { +static struct pernet_operations __net_initdata proc_net_ns_ops = { .init = proc_net_ns_init, .exit = proc_net_ns_exit, }; diff --git a/trunk/include/asm-sparc/atomic.h b/trunk/include/asm-sparc/atomic.h index 3328950dbfe6..bdca5416d8b0 100644 --- a/trunk/include/asm-sparc/atomic.h +++ b/trunk/include/asm-sparc/atomic.h @@ -1,6 +1,6 @@ /* atomic.h: These still suck, but the I-cache hit rate is higher. * - * Copyright (C) 1996 David S. Miller (davem@davemloft.net) + * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au) * Copyright (C) 2007 Kyle McMartin (kyle@parisc-linux.org) * @@ -33,7 +33,7 @@ extern void __cmpxchg_called_with_bad_pointer(void); extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); /* don't worry...optimizer will get rid of most of this */ -static inline unsigned long +static __inline__ unsigned long __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) { switch(size) { diff --git a/trunk/include/asm-sparc/dma.h b/trunk/include/asm-sparc/dma.h index 959d6c8a71ae..407b3614468a 100644 --- a/trunk/include/asm-sparc/dma.h +++ b/trunk/include/asm-sparc/dma.h @@ -1,6 +1,7 @@ -/* include/asm-sparc/dma.h +/* $Id: dma.h,v 1.35 1999/12/27 06:37:09 anton Exp $ + * include/asm-sparc/dma.h * - * Copyright 1995 (C) David S. Miller (davem@davemloft.net) + * Copyright 1995 (C) David S. Miller (davem@caip.rutgers.edu) */ #ifndef _ASM_SPARC_DMA_H @@ -20,14 +21,14 @@ struct page; extern spinlock_t dma_spin_lock; -static inline unsigned long claim_dma_lock(void) +static __inline__ unsigned long claim_dma_lock(void) { unsigned long flags; spin_lock_irqsave(&dma_spin_lock, flags); return flags; } -static inline void release_dma_lock(unsigned long flags) +static __inline__ void release_dma_lock(unsigned long flags) { spin_unlock_irqrestore(&dma_spin_lock, flags); } diff --git a/trunk/include/asm-sparc/floppy.h b/trunk/include/asm-sparc/floppy.h index dbe7a586be5b..5da1eef0f706 100644 --- a/trunk/include/asm-sparc/floppy.h +++ b/trunk/include/asm-sparc/floppy.h @@ -1,6 +1,6 @@ /* asm-sparc/floppy.h: Sparc specific parts of the Floppy driver. * - * Copyright (C) 1995 David S. Miller (davem@davemloft.net) + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ #ifndef __ASM_SPARC_FLOPPY_H @@ -232,12 +232,12 @@ extern char *pdma_base; extern unsigned long pdma_areasize; /* Common routines to all controller types on the Sparc. */ -static inline void virtual_dma_init(void) +static __inline__ void virtual_dma_init(void) { /* nothing... */ } -static inline void sun_fd_disable_dma(void) +static __inline__ void sun_fd_disable_dma(void) { doing_pdma = 0; if (pdma_base) { @@ -246,7 +246,7 @@ static inline void sun_fd_disable_dma(void) } } -static inline void sun_fd_set_dma_mode(int mode) +static __inline__ void sun_fd_set_dma_mode(int mode) { switch(mode) { case DMA_MODE_READ: @@ -261,17 +261,17 @@ static inline void sun_fd_set_dma_mode(int mode) } } -static inline void sun_fd_set_dma_addr(char *buffer) +static __inline__ void sun_fd_set_dma_addr(char *buffer) { pdma_vaddr = buffer; } -static inline void sun_fd_set_dma_count(int length) +static __inline__ void sun_fd_set_dma_count(int length) { pdma_size = length; } -static inline void sun_fd_enable_dma(void) +static __inline__ void sun_fd_enable_dma(void) { pdma_vaddr = mmu_lockarea(pdma_vaddr, pdma_size); pdma_base = pdma_vaddr; diff --git a/trunk/include/asm-sparc/ide.h b/trunk/include/asm-sparc/ide.h index 4076cb5d1581..404022765fc7 100644 --- a/trunk/include/asm-sparc/ide.h +++ b/trunk/include/asm-sparc/ide.h @@ -1,6 +1,7 @@ -/* ide.h: SPARC PCI specific IDE glue. +/* $Id: ide.h,v 1.7 2002/01/16 20:58:40 davem Exp $ + * ide.h: SPARC PCI specific IDE glue. * - * Copyright (C) 1997 David S. Miller (davem@davemloft.net) + * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) * Adaptation from sparc64 version to sparc by Pete Zaitcev. */ @@ -30,7 +31,7 @@ #define __ide_mm_outsw __ide_outsw #define __ide_mm_outsl __ide_outsl -static inline void __ide_insw(unsigned long port, +static __inline__ void __ide_insw(unsigned long port, void *dst, unsigned long count) { @@ -61,7 +62,7 @@ static inline void __ide_insw(unsigned long port, /* __flush_dcache_range((unsigned long)dst, end); */ /* P3 see hme */ } -static inline void __ide_outsw(unsigned long port, +static __inline__ void __ide_outsw(unsigned long port, const void *src, unsigned long count) { diff --git a/trunk/include/asm-sparc/posix_types.h b/trunk/include/asm-sparc/posix_types.h index 62c8fa7b36d4..9ef1b3db4cbf 100644 --- a/trunk/include/asm-sparc/posix_types.h +++ b/trunk/include/asm-sparc/posix_types.h @@ -49,7 +49,7 @@ typedef struct { #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) #undef __FD_SET -static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) +static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) { unsigned long _tmp = fd / __NFDBITS; unsigned long _rem = fd % __NFDBITS; @@ -57,7 +57,7 @@ static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) } #undef __FD_CLR -static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) +static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) { unsigned long _tmp = fd / __NFDBITS; unsigned long _rem = fd % __NFDBITS; @@ -65,7 +65,7 @@ static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) } #undef __FD_ISSET -static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p) +static __inline__ int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p) { unsigned long _tmp = fd / __NFDBITS; unsigned long _rem = fd % __NFDBITS; @@ -77,7 +77,7 @@ static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p) * for 256 and 1024-bit fd_sets respectively) */ #undef __FD_ZERO -static inline void __FD_ZERO(__kernel_fd_set *p) +static __inline__ void __FD_ZERO(__kernel_fd_set *p) { unsigned long *tmp = p->fds_bits; int i; diff --git a/trunk/include/asm-sparc/system.h b/trunk/include/asm-sparc/system.h index 2655d142b22d..8c259de02614 100644 --- a/trunk/include/asm-sparc/system.h +++ b/trunk/include/asm-sparc/system.h @@ -1,3 +1,5 @@ +/* $Id: system.h,v 1.86 2001/10/30 04:57:10 davem Exp $ */ + #ifndef __SPARC_SYSTEM_H #define __SPARC_SYSTEM_H @@ -54,7 +56,7 @@ extern void sun_do_break(void); extern int serial_console; extern int stop_a_enabled; -static inline int con_is_present(void) +static __inline__ int con_is_present(void) { return serial_console ? 0 : 1; } @@ -215,7 +217,7 @@ static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned lon extern void __xchg_called_with_bad_pointer(void); -static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size) +static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size) { switch (size) { case 4: diff --git a/trunk/include/asm-sparc64/atomic.h b/trunk/include/asm-sparc64/atomic.h index 2c71ec4a3b18..3fb4e1f7f186 100644 --- a/trunk/include/asm-sparc64/atomic.h +++ b/trunk/include/asm-sparc64/atomic.h @@ -1,4 +1,5 @@ -/* atomic.h: Thankfully the V9 is at least reasonable for this +/* $Id: atomic.h,v 1.22 2001/07/11 23:56:07 davem Exp $ + * atomic.h: Thankfully the V9 is at least reasonable for this * stuff. * * Copyright (C) 1996, 1997, 2000 David S. Miller (davem@redhat.com) @@ -73,7 +74,7 @@ extern int atomic64_sub_ret(int, atomic64_t *); #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) -static inline int atomic_add_unless(atomic_t *v, int a, int u) +static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) { int c, old; c = atomic_read(v); @@ -94,7 +95,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n))) #define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) -static inline int atomic64_add_unless(atomic64_t *v, long a, long u) +static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) { long c, old; c = atomic64_read(v); diff --git a/trunk/include/asm-sparc64/backoff.h b/trunk/include/asm-sparc64/backoff.h index dadd6c385c6c..0e32f8b62fd2 100644 --- a/trunk/include/asm-sparc64/backoff.h +++ b/trunk/include/asm-sparc64/backoff.h @@ -21,9 +21,7 @@ #else #define BACKOFF_SETUP(reg) -#define BACKOFF_SPIN(reg, tmp, label) \ - ba,pt %xcc, label; \ - nop; +#define BACKOFF_SPIN(reg, tmp, label) #endif diff --git a/trunk/include/asm-sparc64/byteorder.h b/trunk/include/asm-sparc64/byteorder.h index 3943022906fd..c69b08af5fe0 100644 --- a/trunk/include/asm-sparc64/byteorder.h +++ b/trunk/include/asm-sparc64/byteorder.h @@ -1,3 +1,4 @@ +/* $Id: byteorder.h,v 1.8 1997/12/18 02:44:14 ecd Exp $ */ #ifndef _SPARC64_BYTEORDER_H #define _SPARC64_BYTEORDER_H @@ -6,7 +7,7 @@ #ifdef __GNUC__ -static inline __u16 ___arch__swab16p(const __u16 *addr) +static __inline__ __u16 ___arch__swab16p(const __u16 *addr) { __u16 ret; @@ -16,7 +17,7 @@ static inline __u16 ___arch__swab16p(const __u16 *addr) return ret; } -static inline __u32 ___arch__swab32p(const __u32 *addr) +static __inline__ __u32 ___arch__swab32p(const __u32 *addr) { __u32 ret; @@ -26,7 +27,7 @@ static inline __u32 ___arch__swab32p(const __u32 *addr) return ret; } -static inline __u64 ___arch__swab64p(const __u64 *addr) +static __inline__ __u64 ___arch__swab64p(const __u64 *addr) { __u64 ret; diff --git a/trunk/include/asm-sparc64/fpumacro.h b/trunk/include/asm-sparc64/fpumacro.h index cc463fec806f..d583e5efd75d 100644 --- a/trunk/include/asm-sparc64/fpumacro.h +++ b/trunk/include/asm-sparc64/fpumacro.h @@ -16,7 +16,7 @@ struct fpustate { #define FPUSTATE (struct fpustate *)(current_thread_info()->fpregs) -static inline unsigned long fprs_read(void) +static __inline__ unsigned long fprs_read(void) { unsigned long retval; @@ -25,7 +25,7 @@ static inline unsigned long fprs_read(void) return retval; } -static inline void fprs_write(unsigned long val) +static __inline__ void fprs_write(unsigned long val) { __asm__ __volatile__("wr %0, 0x0, %%fprs" : : "r" (val)); } diff --git a/trunk/include/asm-sparc64/io.h b/trunk/include/asm-sparc64/io.h index c299b853b5ba..cd7ef3097ac2 100644 --- a/trunk/include/asm-sparc64/io.h +++ b/trunk/include/asm-sparc64/io.h @@ -1,3 +1,4 @@ +/* $Id: io.h,v 1.47 2001/12/13 10:36:02 davem Exp $ */ #ifndef __SPARC64_IO_H #define __SPARC64_IO_H @@ -18,7 +19,7 @@ extern unsigned long kern_base, kern_size; #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) #define BIO_VMERGE_BOUNDARY 8192 -static inline u8 _inb(unsigned long addr) +static __inline__ u8 _inb(unsigned long addr) { u8 ret; @@ -29,7 +30,7 @@ static inline u8 _inb(unsigned long addr) return ret; } -static inline u16 _inw(unsigned long addr) +static __inline__ u16 _inw(unsigned long addr) { u16 ret; @@ -40,7 +41,7 @@ static inline u16 _inw(unsigned long addr) return ret; } -static inline u32 _inl(unsigned long addr) +static __inline__ u32 _inl(unsigned long addr) { u32 ret; @@ -51,21 +52,21 @@ static inline u32 _inl(unsigned long addr) return ret; } -static inline void _outb(u8 b, unsigned long addr) +static __inline__ void _outb(u8 b, unsigned long addr) { __asm__ __volatile__("stba\t%r0, [%1] %2\t/* pci_outb */" : /* no outputs */ : "Jr" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L)); } -static inline void _outw(u16 w, unsigned long addr) +static __inline__ void _outw(u16 w, unsigned long addr) { __asm__ __volatile__("stha\t%r0, [%1] %2\t/* pci_outw */" : /* no outputs */ : "Jr" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L)); } -static inline void _outl(u32 l, unsigned long addr) +static __inline__ void _outl(u32 l, unsigned long addr) { __asm__ __volatile__("stwa\t%r0, [%1] %2\t/* pci_outl */" : /* no outputs */ @@ -204,7 +205,7 @@ static inline void _writeq(u64 q, volatile void __iomem *addr) #define writeq(__q, __addr) _writeq(__q, __addr) /* Now versions without byte-swapping. */ -static inline u8 _raw_readb(unsigned long addr) +static __inline__ u8 _raw_readb(unsigned long addr) { u8 ret; @@ -215,7 +216,7 @@ static inline u8 _raw_readb(unsigned long addr) return ret; } -static inline u16 _raw_readw(unsigned long addr) +static __inline__ u16 _raw_readw(unsigned long addr) { u16 ret; @@ -226,7 +227,7 @@ static inline u16 _raw_readw(unsigned long addr) return ret; } -static inline u32 _raw_readl(unsigned long addr) +static __inline__ u32 _raw_readl(unsigned long addr) { u32 ret; @@ -237,7 +238,7 @@ static inline u32 _raw_readl(unsigned long addr) return ret; } -static inline u64 _raw_readq(unsigned long addr) +static __inline__ u64 _raw_readq(unsigned long addr) { u64 ret; @@ -248,28 +249,28 @@ static inline u64 _raw_readq(unsigned long addr) return ret; } -static inline void _raw_writeb(u8 b, unsigned long addr) +static __inline__ void _raw_writeb(u8 b, unsigned long addr) { __asm__ __volatile__("stba\t%r0, [%1] %2\t/* pci_raw_writeb */" : /* no outputs */ : "Jr" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); } -static inline void _raw_writew(u16 w, unsigned long addr) +static __inline__ void _raw_writew(u16 w, unsigned long addr) { __asm__ __volatile__("stha\t%r0, [%1] %2\t/* pci_raw_writew */" : /* no outputs */ : "Jr" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); } -static inline void _raw_writel(u32 l, unsigned long addr) +static __inline__ void _raw_writel(u32 l, unsigned long addr) { __asm__ __volatile__("stwa\t%r0, [%1] %2\t/* pci_raw_writel */" : /* no outputs */ : "Jr" (l), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); } -static inline void _raw_writeq(u64 q, unsigned long addr) +static __inline__ void _raw_writeq(u64 q, unsigned long addr) { __asm__ __volatile__("stxa\t%r0, [%1] %2\t/* pci_raw_writeq */" : /* no outputs */ diff --git a/trunk/include/asm-sparc64/irq.h b/trunk/include/asm-sparc64/irq.h index 30cb76b47be1..182dba05c702 100644 --- a/trunk/include/asm-sparc64/irq.h +++ b/trunk/include/asm-sparc64/irq.h @@ -1,6 +1,7 @@ -/* irq.h: IRQ registers on the 64-bit Sparc. +/* $Id: irq.h,v 1.21 2002/01/23 11:27:36 davem Exp $ + * irq.h: IRQ registers on the 64-bit Sparc. * - * Copyright (C) 1996 David S. Miller (davem@davemloft.net) + * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ @@ -66,21 +67,21 @@ extern void virt_irq_free(unsigned int virt_irq); extern void fixup_irqs(void); -static inline void set_softint(unsigned long bits) +static __inline__ void set_softint(unsigned long bits) { __asm__ __volatile__("wr %0, 0x0, %%set_softint" : /* No outputs */ : "r" (bits)); } -static inline void clear_softint(unsigned long bits) +static __inline__ void clear_softint(unsigned long bits) { __asm__ __volatile__("wr %0, 0x0, %%clear_softint" : /* No outputs */ : "r" (bits)); } -static inline unsigned long get_softint(void) +static __inline__ unsigned long get_softint(void) { unsigned long retval; diff --git a/trunk/include/asm-sparc64/mostek.h b/trunk/include/asm-sparc64/mostek.h index c5652de2ace2..d14dd8988161 100644 --- a/trunk/include/asm-sparc64/mostek.h +++ b/trunk/include/asm-sparc64/mostek.h @@ -1,6 +1,7 @@ -/* mostek.h: Describes the various Mostek time of day clock registers. +/* $Id: mostek.h,v 1.4 2001/01/11 15:07:09 davem Exp $ + * mostek.h: Describes the various Mostek time of day clock registers. * - * Copyright (C) 1995 David S. Miller (davem@davemloft.net) + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) */ @@ -37,7 +38,7 @@ * * We now deal with physical addresses for I/O to the chip. -DaveM */ -static inline u8 mostek_read(void __iomem *addr) +static __inline__ u8 mostek_read(void __iomem *addr) { u8 ret; @@ -47,7 +48,7 @@ static inline u8 mostek_read(void __iomem *addr) return ret; } -static inline void mostek_write(void __iomem *addr, u8 val) +static __inline__ void mostek_write(void __iomem *addr, u8 val) { __asm__ __volatile__("stba %0, [%1] %2" : /* no outputs */ diff --git a/trunk/include/asm-sparc64/ns87303.h b/trunk/include/asm-sparc64/ns87303.h index 686defe6aaa0..6d58fdf349b5 100644 --- a/trunk/include/asm-sparc64/ns87303.h +++ b/trunk/include/asm-sparc64/ns87303.h @@ -1,4 +1,5 @@ -/* ns87303.h: Configuration Register Description for the +/* $Id: ns87303.h,v 1.3 2000/01/09 15:16:34 ecd Exp $ + * ns87303.h: Configuration Register Description for the * National Semiconductor PC87303 (SuperIO). * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -84,7 +85,7 @@ extern spinlock_t ns87303_lock; -static inline int ns87303_modify(unsigned long port, unsigned int index, +static __inline__ int ns87303_modify(unsigned long port, unsigned int index, unsigned char clr, unsigned char set) { static unsigned char reserved[] = { diff --git a/trunk/include/asm-sparc64/parport.h b/trunk/include/asm-sparc64/parport.h index e9555b246c8d..8116e8f6062c 100644 --- a/trunk/include/asm-sparc64/parport.h +++ b/trunk/include/asm-sparc64/parport.h @@ -1,4 +1,5 @@ -/* parport.h: sparc64 specific parport initialization and dma. +/* $Id: parport.h,v 1.11 2001/05/11 07:54:24 davem Exp $ + * parport.h: sparc64 specific parport initialization and dma. * * Copyright (C) 1999 Eddie C. Dost (ecd@skynet.be) */ @@ -41,7 +42,7 @@ static struct sparc_ebus_info { static DECLARE_BITMAP(dma_slot_map, PARPORT_PC_MAX_PORTS); -static inline int request_dma(unsigned int dmanr, const char *device_id) +static __inline__ int request_dma(unsigned int dmanr, const char *device_id) { if (dmanr >= PARPORT_PC_MAX_PORTS) return -EINVAL; @@ -50,7 +51,7 @@ static inline int request_dma(unsigned int dmanr, const char *device_id) return 0; } -static inline void free_dma(unsigned int dmanr) +static __inline__ void free_dma(unsigned int dmanr) { if (dmanr >= PARPORT_PC_MAX_PORTS) { printk(KERN_WARNING "Trying to free DMA%d\n", dmanr); @@ -62,7 +63,7 @@ static inline void free_dma(unsigned int dmanr) } } -static inline void enable_dma(unsigned int dmanr) +static __inline__ void enable_dma(unsigned int dmanr) { ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1); @@ -72,32 +73,32 @@ static inline void enable_dma(unsigned int dmanr) BUG(); } -static inline void disable_dma(unsigned int dmanr) +static __inline__ void disable_dma(unsigned int dmanr) { ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 0); } -static inline void clear_dma_ff(unsigned int dmanr) +static __inline__ void clear_dma_ff(unsigned int dmanr) { /* nothing */ } -static inline void set_dma_mode(unsigned int dmanr, char mode) +static __inline__ void set_dma_mode(unsigned int dmanr, char mode) { ebus_dma_prepare(&sparc_ebus_dmas[dmanr].info, (mode != DMA_MODE_WRITE)); } -static inline void set_dma_addr(unsigned int dmanr, unsigned int addr) +static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int addr) { sparc_ebus_dmas[dmanr].addr = addr; } -static inline void set_dma_count(unsigned int dmanr, unsigned int count) +static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count) { sparc_ebus_dmas[dmanr].count = count; } -static inline unsigned int get_dma_residue(unsigned int dmanr) +static __inline__ unsigned int get_dma_residue(unsigned int dmanr) { return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info); } diff --git a/trunk/include/asm-sparc64/posix_types.h b/trunk/include/asm-sparc64/posix_types.h index 3426a65ecd35..c86b9452c683 100644 --- a/trunk/include/asm-sparc64/posix_types.h +++ b/trunk/include/asm-sparc64/posix_types.h @@ -53,7 +53,7 @@ typedef struct { #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) #undef __FD_SET -static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) +static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) { unsigned long _tmp = fd / __NFDBITS; unsigned long _rem = fd % __NFDBITS; @@ -61,7 +61,7 @@ static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) } #undef __FD_CLR -static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) +static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) { unsigned long _tmp = fd / __NFDBITS; unsigned long _rem = fd % __NFDBITS; @@ -69,7 +69,7 @@ static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) } #undef __FD_ISSET -static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p) +static __inline__ int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p) { unsigned long _tmp = fd / __NFDBITS; unsigned long _rem = fd % __NFDBITS; @@ -81,7 +81,7 @@ static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p) * for 256 and 1024-bit fd_sets respectively) */ #undef __FD_ZERO -static inline void __FD_ZERO(__kernel_fd_set *p) +static __inline__ void __FD_ZERO(__kernel_fd_set *p) { unsigned long *tmp = p->fds_bits; int i; diff --git a/trunk/include/asm-sparc64/sbus.h b/trunk/include/asm-sparc64/sbus.h index 24a04a55cf85..0151cad486f3 100644 --- a/trunk/include/asm-sparc64/sbus.h +++ b/trunk/include/asm-sparc64/sbus.h @@ -29,12 +29,12 @@ * numbers + offsets, and vice versa. */ -static inline unsigned long sbus_devaddr(int slotnum, unsigned long offset) +static __inline__ unsigned long sbus_devaddr(int slotnum, unsigned long offset) { return (unsigned long) (SUN_SBUS_BVADDR+((slotnum)<<28)+(offset)); } -static inline int sbus_dev_slot(unsigned long dev_addr) +static __inline__ int sbus_dev_slot(unsigned long dev_addr) { return (int) (((dev_addr)-SUN_SBUS_BVADDR)>>28); } diff --git a/trunk/include/asm-sparc64/spitfire.h b/trunk/include/asm-sparc64/spitfire.h index 63b7040e8134..cf7807813e85 100644 --- a/trunk/include/asm-sparc64/spitfire.h +++ b/trunk/include/asm-sparc64/spitfire.h @@ -1,6 +1,7 @@ -/* spitfire.h: SpitFire/BlackBird/Cheetah inline MMU operations. +/* $Id: spitfire.h,v 1.18 2001/11/29 16:42:10 kanoj Exp $ + * spitfire.h: SpitFire/BlackBird/Cheetah inline MMU operations. * - * Copyright (C) 1996 David S. Miller (davem@davemloft.net) + * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ #ifndef _SPARC64_SPITFIRE_H @@ -66,7 +67,7 @@ extern void cheetah_enable_pcache(void); /* The data cache is write through, so this just invalidates the * specified line. */ -static inline void spitfire_put_dcache_tag(unsigned long addr, unsigned long tag) +static __inline__ void spitfire_put_dcache_tag(unsigned long addr, unsigned long tag) { __asm__ __volatile__("stxa %0, [%1] %2\n\t" "membar #Sync" @@ -80,7 +81,7 @@ static inline void spitfire_put_dcache_tag(unsigned long addr, unsigned long tag * a flush instruction (to any address) is sufficient to handle * this issue after the line is invalidated. */ -static inline void spitfire_put_icache_tag(unsigned long addr, unsigned long tag) +static __inline__ void spitfire_put_icache_tag(unsigned long addr, unsigned long tag) { __asm__ __volatile__("stxa %0, [%1] %2\n\t" "membar #Sync" @@ -88,7 +89,7 @@ static inline void spitfire_put_icache_tag(unsigned long addr, unsigned long tag : "r" (tag), "r" (addr), "i" (ASI_IC_TAG)); } -static inline unsigned long spitfire_get_dtlb_data(int entry) +static __inline__ unsigned long spitfire_get_dtlb_data(int entry) { unsigned long data; @@ -102,7 +103,7 @@ static inline unsigned long spitfire_get_dtlb_data(int entry) return data; } -static inline unsigned long spitfire_get_dtlb_tag(int entry) +static __inline__ unsigned long spitfire_get_dtlb_tag(int entry) { unsigned long tag; @@ -112,7 +113,7 @@ static inline unsigned long spitfire_get_dtlb_tag(int entry) return tag; } -static inline void spitfire_put_dtlb_data(int entry, unsigned long data) +static __inline__ void spitfire_put_dtlb_data(int entry, unsigned long data) { __asm__ __volatile__("stxa %0, [%1] %2\n\t" "membar #Sync" @@ -121,7 +122,7 @@ static inline void spitfire_put_dtlb_data(int entry, unsigned long data) "i" (ASI_DTLB_DATA_ACCESS)); } -static inline unsigned long spitfire_get_itlb_data(int entry) +static __inline__ unsigned long spitfire_get_itlb_data(int entry) { unsigned long data; @@ -135,7 +136,7 @@ static inline unsigned long spitfire_get_itlb_data(int entry) return data; } -static inline unsigned long spitfire_get_itlb_tag(int entry) +static __inline__ unsigned long spitfire_get_itlb_tag(int entry) { unsigned long tag; @@ -145,7 +146,7 @@ static inline unsigned long spitfire_get_itlb_tag(int entry) return tag; } -static inline void spitfire_put_itlb_data(int entry, unsigned long data) +static __inline__ void spitfire_put_itlb_data(int entry, unsigned long data) { __asm__ __volatile__("stxa %0, [%1] %2\n\t" "membar #Sync" @@ -154,7 +155,7 @@ static inline void spitfire_put_itlb_data(int entry, unsigned long data) "i" (ASI_ITLB_DATA_ACCESS)); } -static inline void spitfire_flush_dtlb_nucleus_page(unsigned long page) +static __inline__ void spitfire_flush_dtlb_nucleus_page(unsigned long page) { __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" "membar #Sync" @@ -162,7 +163,7 @@ static inline void spitfire_flush_dtlb_nucleus_page(unsigned long page) : "r" (page | 0x20), "i" (ASI_DMMU_DEMAP)); } -static inline void spitfire_flush_itlb_nucleus_page(unsigned long page) +static __inline__ void spitfire_flush_itlb_nucleus_page(unsigned long page) { __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" "membar #Sync" @@ -171,7 +172,7 @@ static inline void spitfire_flush_itlb_nucleus_page(unsigned long page) } /* Cheetah has "all non-locked" tlb flushes. */ -static inline void cheetah_flush_dtlb_all(void) +static __inline__ void cheetah_flush_dtlb_all(void) { __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" "membar #Sync" @@ -179,7 +180,7 @@ static inline void cheetah_flush_dtlb_all(void) : "r" (0x80), "i" (ASI_DMMU_DEMAP)); } -static inline void cheetah_flush_itlb_all(void) +static __inline__ void cheetah_flush_itlb_all(void) { __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" "membar #Sync" @@ -201,7 +202,7 @@ static inline void cheetah_flush_itlb_all(void) * ASI_{D,I}TLB_DATA_ACCESS loads, doing the load twice fixes * the problem for me. -DaveM */ -static inline unsigned long cheetah_get_ldtlb_data(int entry) +static __inline__ unsigned long cheetah_get_ldtlb_data(int entry) { unsigned long data; @@ -214,7 +215,7 @@ static inline unsigned long cheetah_get_ldtlb_data(int entry) return data; } -static inline unsigned long cheetah_get_litlb_data(int entry) +static __inline__ unsigned long cheetah_get_litlb_data(int entry) { unsigned long data; @@ -227,7 +228,7 @@ static inline unsigned long cheetah_get_litlb_data(int entry) return data; } -static inline unsigned long cheetah_get_ldtlb_tag(int entry) +static __inline__ unsigned long cheetah_get_ldtlb_tag(int entry) { unsigned long tag; @@ -239,7 +240,7 @@ static inline unsigned long cheetah_get_ldtlb_tag(int entry) return tag; } -static inline unsigned long cheetah_get_litlb_tag(int entry) +static __inline__ unsigned long cheetah_get_litlb_tag(int entry) { unsigned long tag; @@ -251,7 +252,7 @@ static inline unsigned long cheetah_get_litlb_tag(int entry) return tag; } -static inline void cheetah_put_ldtlb_data(int entry, unsigned long data) +static __inline__ void cheetah_put_ldtlb_data(int entry, unsigned long data) { __asm__ __volatile__("stxa %0, [%1] %2\n\t" "membar #Sync" @@ -261,7 +262,7 @@ static inline void cheetah_put_ldtlb_data(int entry, unsigned long data) "i" (ASI_DTLB_DATA_ACCESS)); } -static inline void cheetah_put_litlb_data(int entry, unsigned long data) +static __inline__ void cheetah_put_litlb_data(int entry, unsigned long data) { __asm__ __volatile__("stxa %0, [%1] %2\n\t" "membar #Sync" @@ -271,7 +272,7 @@ static inline void cheetah_put_litlb_data(int entry, unsigned long data) "i" (ASI_ITLB_DATA_ACCESS)); } -static inline unsigned long cheetah_get_dtlb_data(int entry, int tlb) +static __inline__ unsigned long cheetah_get_dtlb_data(int entry, int tlb) { unsigned long data; @@ -283,7 +284,7 @@ static inline unsigned long cheetah_get_dtlb_data(int entry, int tlb) return data; } -static inline unsigned long cheetah_get_dtlb_tag(int entry, int tlb) +static __inline__ unsigned long cheetah_get_dtlb_tag(int entry, int tlb) { unsigned long tag; @@ -293,7 +294,7 @@ static inline unsigned long cheetah_get_dtlb_tag(int entry, int tlb) return tag; } -static inline void cheetah_put_dtlb_data(int entry, unsigned long data, int tlb) +static __inline__ void cheetah_put_dtlb_data(int entry, unsigned long data, int tlb) { __asm__ __volatile__("stxa %0, [%1] %2\n\t" "membar #Sync" @@ -303,7 +304,7 @@ static inline void cheetah_put_dtlb_data(int entry, unsigned long data, int tlb) "i" (ASI_DTLB_DATA_ACCESS)); } -static inline unsigned long cheetah_get_itlb_data(int entry) +static __inline__ unsigned long cheetah_get_itlb_data(int entry) { unsigned long data; @@ -316,7 +317,7 @@ static inline unsigned long cheetah_get_itlb_data(int entry) return data; } -static inline unsigned long cheetah_get_itlb_tag(int entry) +static __inline__ unsigned long cheetah_get_itlb_tag(int entry) { unsigned long tag; @@ -326,7 +327,7 @@ static inline unsigned long cheetah_get_itlb_tag(int entry) return tag; } -static inline void cheetah_put_itlb_data(int entry, unsigned long data) +static __inline__ void cheetah_put_itlb_data(int entry, unsigned long data) { __asm__ __volatile__("stxa %0, [%1] %2\n\t" "membar #Sync" diff --git a/trunk/include/asm-sparc64/system.h b/trunk/include/asm-sparc64/system.h index 159e62b51d70..3f175fa7e6d2 100644 --- a/trunk/include/asm-sparc64/system.h +++ b/trunk/include/asm-sparc64/system.h @@ -1,3 +1,4 @@ +/* $Id: system.h,v 1.69 2002/02/09 19:49:31 davem Exp $ */ #ifndef __SPARC64_SYSTEM_H #define __SPARC64_SYSTEM_H @@ -239,7 +240,7 @@ static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long extern void __xchg_called_with_bad_pointer(void); -static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, +static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size) { switch (size) { @@ -262,7 +263,7 @@ extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noret #define __HAVE_ARCH_CMPXCHG 1 -static inline unsigned long +static __inline__ unsigned long __cmpxchg_u32(volatile int *m, int old, int new) { __asm__ __volatile__("membar #StoreLoad | #LoadLoad\n" @@ -275,7 +276,7 @@ __cmpxchg_u32(volatile int *m, int old, int new) return new; } -static inline unsigned long +static __inline__ unsigned long __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new) { __asm__ __volatile__("membar #StoreLoad | #LoadLoad\n" @@ -292,7 +293,7 @@ __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new) if something tries to do an invalid cmpxchg(). */ extern void __cmpxchg_called_with_bad_pointer(void); -static inline unsigned long +static __inline__ unsigned long __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) { switch (size) { diff --git a/trunk/include/asm-sparc64/upa.h b/trunk/include/asm-sparc64/upa.h index 5b1633223f92..7ae09a22e408 100644 --- a/trunk/include/asm-sparc64/upa.h +++ b/trunk/include/asm-sparc64/upa.h @@ -1,3 +1,4 @@ +/* $Id: upa.h,v 1.3 1999/09/21 14:39:47 davem Exp $ */ #ifndef _SPARC64_UPA_H #define _SPARC64_UPA_H @@ -24,7 +25,7 @@ /* UPA I/O space accessors */ #if defined(__KERNEL__) && !defined(__ASSEMBLY__) -static inline unsigned char _upa_readb(unsigned long addr) +static __inline__ unsigned char _upa_readb(unsigned long addr) { unsigned char ret; @@ -35,7 +36,7 @@ static inline unsigned char _upa_readb(unsigned long addr) return ret; } -static inline unsigned short _upa_readw(unsigned long addr) +static __inline__ unsigned short _upa_readw(unsigned long addr) { unsigned short ret; @@ -46,7 +47,7 @@ static inline unsigned short _upa_readw(unsigned long addr) return ret; } -static inline unsigned int _upa_readl(unsigned long addr) +static __inline__ unsigned int _upa_readl(unsigned long addr) { unsigned int ret; @@ -57,7 +58,7 @@ static inline unsigned int _upa_readl(unsigned long addr) return ret; } -static inline unsigned long _upa_readq(unsigned long addr) +static __inline__ unsigned long _upa_readq(unsigned long addr) { unsigned long ret; @@ -68,28 +69,28 @@ static inline unsigned long _upa_readq(unsigned long addr) return ret; } -static inline void _upa_writeb(unsigned char b, unsigned long addr) +static __inline__ void _upa_writeb(unsigned char b, unsigned long addr) { __asm__ __volatile__("stba\t%0, [%1] %2\t/* upa_writeb */" : /* no outputs */ : "r" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); } -static inline void _upa_writew(unsigned short w, unsigned long addr) +static __inline__ void _upa_writew(unsigned short w, unsigned long addr) { __asm__ __volatile__("stha\t%0, [%1] %2\t/* upa_writew */" : /* no outputs */ : "r" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); } -static inline void _upa_writel(unsigned int l, unsigned long addr) +static __inline__ void _upa_writel(unsigned int l, unsigned long addr) { __asm__ __volatile__("stwa\t%0, [%1] %2\t/* upa_writel */" : /* no outputs */ : "r" (l), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); } -static inline void _upa_writeq(unsigned long q, unsigned long addr) +static __inline__ void _upa_writeq(unsigned long q, unsigned long addr) { __asm__ __volatile__("stxa\t%0, [%1] %2\t/* upa_writeq */" : /* no outputs */ diff --git a/trunk/include/asm-sparc64/visasm.h b/trunk/include/asm-sparc64/visasm.h index 34f2ec64933b..a74078551e0f 100644 --- a/trunk/include/asm-sparc64/visasm.h +++ b/trunk/include/asm-sparc64/visasm.h @@ -1,3 +1,4 @@ +/* $Id: visasm.h,v 1.5 2001/04/24 01:09:12 davem Exp $ */ #ifndef _SPARC64_VISASM_H #define _SPARC64_VISASM_H @@ -43,7 +44,7 @@ wr %o5, 0, %fprs; #ifndef __ASSEMBLY__ -static inline void save_and_clear_fpu(void) { +static __inline__ void save_and_clear_fpu(void) { __asm__ __volatile__ ( " rd %%fprs, %%o5\n" " andcc %%o5, %0, %%g0\n" diff --git a/trunk/include/asm-x86/smp_32.h b/trunk/include/asm-x86/smp_32.h index e10b7affdfe5..7056d8684522 100644 --- a/trunk/include/asm-x86/smp_32.h +++ b/trunk/include/asm-x86/smp_32.h @@ -94,12 +94,9 @@ static inline void smp_send_reschedule(int cpu) { smp_ops.smp_send_reschedule(cpu); } -static inline int smp_call_function_mask(cpumask_t mask, - void (*func) (void *info), void *info, - int wait) -{ - return smp_ops.smp_call_function_mask(mask, func, info, wait); -} +extern int smp_call_function_mask(cpumask_t mask, + void (*func) (void *info), void *info, + int wait); void native_smp_prepare_boot_cpu(void); void native_smp_prepare_cpus(unsigned int max_cpus); diff --git a/trunk/include/linux/mv643xx_eth.h b/trunk/include/linux/mv643xx_eth.h index 8df230a279a0..3f272396642b 100644 --- a/trunk/include/linux/mv643xx_eth.h +++ b/trunk/include/linux/mv643xx_eth.h @@ -8,9 +8,6 @@ #define MV643XX_ETH_NAME "mv643xx_eth" #define MV643XX_ETH_SHARED_REGS 0x2000 #define MV643XX_ETH_SHARED_REGS_SIZE 0x2000 -#define MV643XX_ETH_BAR_4 0x220 -#define MV643XX_ETH_SIZE_REG_4 0x224 -#define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x0290 struct mv643xx_eth_platform_data { int port_number; diff --git a/trunk/include/net/net_namespace.h b/trunk/include/net/net_namespace.h index 5279466606d2..93aa87d32804 100644 --- a/trunk/include/net/net_namespace.h +++ b/trunk/include/net/net_namespace.h @@ -102,9 +102,11 @@ static inline void release_net(struct net *net) #ifdef CONFIG_NET_NS #define __net_init #define __net_exit +#define __net_initdata #else #define __net_init __init #define __net_exit __exit_refok +#define __net_initdata __initdata #endif struct pernet_operations { diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 853c8b575f1d..ddfef3b45bab 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -2668,7 +2668,7 @@ static void __net_exit dev_proc_net_exit(struct net *net) proc_net_remove(net, "dev"); } -static struct pernet_operations dev_proc_ops = { +static struct pernet_operations __net_initdata dev_proc_ops = { .init = dev_proc_net_init, .exit = dev_proc_net_exit, }; @@ -4328,7 +4328,7 @@ static void __net_exit netdev_exit(struct net *net) kfree(net->dev_index_head); } -static struct pernet_operations netdev_net_ops = { +static struct pernet_operations __net_initdata netdev_net_ops = { .init = netdev_init, .exit = netdev_exit, }; @@ -4359,7 +4359,7 @@ static void __net_exit default_device_exit(struct net *net) rtnl_unlock(); } -static struct pernet_operations default_device_ops = { +static struct pernet_operations __net_initdata default_device_ops = { .exit = default_device_exit, }; diff --git a/trunk/net/core/dev_mcast.c b/trunk/net/core/dev_mcast.c index ae354057d84c..15241cf48af8 100644 --- a/trunk/net/core/dev_mcast.c +++ b/trunk/net/core/dev_mcast.c @@ -285,7 +285,7 @@ static void __net_exit dev_mc_net_exit(struct net *net) proc_net_remove(net, "dev_mcast"); } -static struct pernet_operations dev_mc_net_ops = { +static struct pernet_operations __net_initdata dev_mc_net_ops = { .init = dev_mc_net_init, .exit = dev_mc_net_exit, }; diff --git a/trunk/net/core/rtnetlink.c b/trunk/net/core/rtnetlink.c index e1ba26fb4bf2..4a2640d38261 100644 --- a/trunk/net/core/rtnetlink.c +++ b/trunk/net/core/rtnetlink.c @@ -742,7 +742,7 @@ static struct net *get_net_ns_by_pid(pid_t pid) /* Lookup the network namespace */ net = ERR_PTR(-ESRCH); rcu_read_lock(); - tsk = find_task_by_vpid(pid); + tsk = find_task_by_pid(pid); if (tsk) { struct nsproxy *nsproxy; nsproxy = task_nsproxy(tsk); diff --git a/trunk/net/ipv4/esp4.c b/trunk/net/ipv4/esp4.c index cad4278025ad..ba9840195cf2 100644 --- a/trunk/net/ipv4/esp4.c +++ b/trunk/net/ipv4/esp4.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -111,9 +111,7 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) goto unlock; } sg_init_table(sg, nfrags); - sg_mark_end(sg, skb_to_sgvec(skb, sg, esph->enc_data + - esp->conf.ivlen - - skb->data, clen)); + skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen); err = crypto_blkcipher_encrypt(&desc, sg, sg, clen); if (unlikely(sg != &esp->sgbuf[0])) kfree(sg); @@ -205,8 +203,7 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb) goto out; } sg_init_table(sg, nfrags); - sg_mark_end(sg, skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen, - elen)); + skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen, elen); err = crypto_blkcipher_decrypt(&desc, sg, sg, elen); if (unlikely(sg != &esp->sgbuf[0])) kfree(sg); diff --git a/trunk/net/ipv6/esp6.c b/trunk/net/ipv6/esp6.c index ab17b5e62355..f67d51a4e56d 100644 --- a/trunk/net/ipv6/esp6.c +++ b/trunk/net/ipv6/esp6.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -110,9 +110,7 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) goto unlock; } sg_init_table(sg, nfrags); - sg_mark_end(sg, skb_to_sgvec(skb, sg, esph->enc_data + - esp->conf.ivlen - - skb->data, clen)); + skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen); err = crypto_blkcipher_encrypt(&desc, sg, sg, clen); if (unlikely(sg != &esp->sgbuf[0])) kfree(sg); @@ -209,9 +207,7 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb) } } sg_init_table(sg, nfrags); - sg_mark_end(sg, skb_to_sgvec(skb, sg, - sizeof(*esph) + esp->conf.ivlen, - elen)); + skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen, elen); ret = crypto_blkcipher_decrypt(&desc, sg, sg, elen); if (unlikely(sg != &esp->sgbuf[0])) kfree(sg); diff --git a/trunk/net/ipv6/tcp_ipv6.c b/trunk/net/ipv6/tcp_ipv6.c index 85208026278b..06fa4baddf05 100644 --- a/trunk/net/ipv6/tcp_ipv6.c +++ b/trunk/net/ipv6/tcp_ipv6.c @@ -59,7 +59,6 @@ #include #include #include -#include #include diff --git a/trunk/net/netlink/af_netlink.c b/trunk/net/netlink/af_netlink.c index 4f994c0fb3f8..325272925d0f 100644 --- a/trunk/net/netlink/af_netlink.c +++ b/trunk/net/netlink/af_netlink.c @@ -1888,7 +1888,7 @@ static void __net_exit netlink_net_exit(struct net *net) #endif } -static struct pernet_operations netlink_net_ops = { +static struct pernet_operations __net_initdata netlink_net_ops = { .init = netlink_net_init, .exit = netlink_net_exit, }; diff --git a/trunk/net/rxrpc/rxkad.c b/trunk/net/rxrpc/rxkad.c index eebefb6ef139..ac3cabdca78c 100644 --- a/trunk/net/rxrpc/rxkad.c +++ b/trunk/net/rxrpc/rxkad.c @@ -135,8 +135,9 @@ static void rxkad_prime_packet_security(struct rxrpc_connection *conn) tmpbuf.x[2] = 0; tmpbuf.x[3] = htonl(conn->security_ix); - sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf)); - sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); + memset(sg, 0, sizeof(sg)); + sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf)); + sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf)); crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); memcpy(&conn->csum_iv, &tmpbuf.x[2], sizeof(conn->csum_iv)); @@ -179,8 +180,9 @@ static int rxkad_secure_packet_auth(const struct rxrpc_call *call, desc.info = iv.x; desc.flags = 0; - sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf)); - sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); + memset(sg, 0, sizeof(sg)); + sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf)); + sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf)); crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); memcpy(sechdr, &tmpbuf, sizeof(tmpbuf)); @@ -225,8 +227,9 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call, desc.info = iv.x; desc.flags = 0; - sg_init_one(&sg[0], sechdr, sizeof(rxkhdr)); - sg_init_one(&sg[1], &rxkhdr, sizeof(rxkhdr)); + memset(sg, 0, sizeof(sg[0]) * 2); + sg_set_buf(&sg[0], sechdr, sizeof(rxkhdr)); + sg_set_buf(&sg[1], &rxkhdr, sizeof(rxkhdr)); crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(rxkhdr)); /* we want to encrypt the skbuff in-place */ @@ -237,7 +240,7 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call, len = data_size + call->conn->size_align - 1; len &= ~(call->conn->size_align - 1); - sg_init_table(sg, skb_to_sgvec(skb, sg, 0, len)); + skb_to_sgvec(skb, sg, 0, len); crypto_blkcipher_encrypt_iv(&desc, sg, sg, len); _leave(" = 0"); @@ -287,8 +290,9 @@ static int rxkad_secure_packet(const struct rxrpc_call *call, tmpbuf.x[0] = sp->hdr.callNumber; tmpbuf.x[1] = x; - sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf)); - sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); + memset(&sg, 0, sizeof(sg)); + sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf)); + sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf)); crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); x = ntohl(tmpbuf.x[1]); @@ -328,23 +332,20 @@ static int rxkad_verify_packet_auth(const struct rxrpc_call *call, struct rxrpc_skb_priv *sp; struct blkcipher_desc desc; struct rxrpc_crypt iv; - struct scatterlist sg[16]; + struct scatterlist sg[2]; struct sk_buff *trailer; u32 data_size, buf; u16 check; - int nsg; _enter(""); sp = rxrpc_skb(skb); /* we want to decrypt the skbuff in-place */ - nsg = skb_cow_data(skb, 0, &trailer); - if (nsg < 0 || nsg > 16) + if (skb_cow_data(skb, 0, &trailer) < 0) goto nomem; - sg_init_table(sg, nsg); - sg_mark_end(sg, skb_to_sgvec(skb, sg, 0, 8)); + skb_to_sgvec(skb, sg, 0, 8); /* start the decryption afresh */ memset(&iv, 0, sizeof(iv)); @@ -425,8 +426,7 @@ static int rxkad_verify_packet_encrypt(const struct rxrpc_call *call, goto nomem; } - sg_init_table(sg, nsg); - sg_mark_end(sg, skb_to_sgvec(skb, sg, 0, skb->len)); + skb_to_sgvec(skb, sg, 0, skb->len); /* decrypt from the session key */ payload = call->conn->key->payload.data; @@ -521,8 +521,9 @@ static int rxkad_verify_packet(const struct rxrpc_call *call, tmpbuf.x[0] = call->call_id; tmpbuf.x[1] = x; - sg_init_one(&sg[0], &tmpbuf, sizeof(tmpbuf)); - sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); + memset(&sg, 0, sizeof(sg)); + sg_set_buf(&sg[0], &tmpbuf, sizeof(tmpbuf)); + sg_set_buf(&sg[1], &tmpbuf, sizeof(tmpbuf)); crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); x = ntohl(tmpbuf.x[1]); @@ -689,20 +690,16 @@ static void rxkad_calc_response_checksum(struct rxkad_response *response) static void rxkad_sg_set_buf2(struct scatterlist sg[2], void *buf, size_t buflen) { - int nsg = 1; - sg_init_table(sg, 2); + memset(sg, 0, sizeof(sg)); sg_set_buf(&sg[0], buf, buflen); if (sg[0].offset + buflen > PAGE_SIZE) { /* the buffer was split over two pages */ sg[0].length = PAGE_SIZE - sg[0].offset; sg_set_buf(&sg[1], buf + sg[0].length, buflen - sg[0].length); - nsg++; } - sg_mark_end(sg, nsg); - ASSERTCMP(sg[0].length + sg[1].length, ==, buflen); } @@ -715,7 +712,7 @@ static void rxkad_encrypt_response(struct rxrpc_connection *conn, { struct blkcipher_desc desc; struct rxrpc_crypt iv; - struct scatterlist sg[2]; + struct scatterlist ssg[2], dsg[2]; /* continue encrypting from where we left off */ memcpy(&iv, s2->session_key, sizeof(iv)); @@ -723,8 +720,9 @@ static void rxkad_encrypt_response(struct rxrpc_connection *conn, desc.info = iv.x; desc.flags = 0; - rxkad_sg_set_buf2(sg, &resp->encrypted, sizeof(resp->encrypted)); - crypto_blkcipher_encrypt_iv(&desc, sg, sg, sizeof(resp->encrypted)); + rxkad_sg_set_buf2(ssg, &resp->encrypted, sizeof(resp->encrypted)); + memcpy(dsg, ssg, sizeof(dsg)); + crypto_blkcipher_encrypt_iv(&desc, dsg, ssg, sizeof(resp->encrypted)); } /* @@ -819,7 +817,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, { struct blkcipher_desc desc; struct rxrpc_crypt iv, key; - struct scatterlist sg[1]; + struct scatterlist ssg[1], dsg[1]; struct in_addr addr; unsigned life; time_t issue, now; @@ -852,8 +850,9 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, desc.info = iv.x; desc.flags = 0; - sg_init_one(&sg[0], ticket, ticket_len); - crypto_blkcipher_decrypt_iv(&desc, sg, sg, ticket_len); + sg_init_one(&ssg[0], ticket, ticket_len); + memcpy(dsg, ssg, sizeof(dsg)); + crypto_blkcipher_decrypt_iv(&desc, dsg, ssg, ticket_len); p = ticket; end = p + ticket_len; @@ -962,7 +961,7 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn, const struct rxrpc_crypt *session_key) { struct blkcipher_desc desc; - struct scatterlist sg[2]; + struct scatterlist ssg[2], dsg[2]; struct rxrpc_crypt iv; _enter(",,%08x%08x", @@ -980,8 +979,9 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn, desc.info = iv.x; desc.flags = 0; - rxkad_sg_set_buf2(sg, &resp->encrypted, sizeof(resp->encrypted)); - crypto_blkcipher_decrypt_iv(&desc, sg, sg, sizeof(resp->encrypted)); + rxkad_sg_set_buf2(ssg, &resp->encrypted, sizeof(resp->encrypted)); + memcpy(dsg, ssg, sizeof(dsg)); + crypto_blkcipher_decrypt_iv(&desc, dsg, ssg, sizeof(resp->encrypted)); mutex_unlock(&rxkad_ci_mutex); _leave(""); diff --git a/trunk/net/sctp/auth.c b/trunk/net/sctp/auth.c index 8af1004abefe..c9dbc3afa99f 100644 --- a/trunk/net/sctp/auth.c +++ b/trunk/net/sctp/auth.c @@ -726,7 +726,8 @@ void sctp_auth_calculate_hmac(const struct sctp_association *asoc, /* set up scatter list */ end = skb_tail_pointer(skb); - sg_init_one(&sg, auth, end - (unsigned char *)auth); + sg_init_table(&sg, 1); + sg_set_buf(&sg, auth, end - (unsigned char *)auth); desc.tfm = asoc->ep->auth_hmacs[hmac_id]; desc.flags = 0; diff --git a/trunk/net/sctp/sm_make_chunk.c b/trunk/net/sctp/sm_make_chunk.c index c377e4e8f653..c055212875f6 100644 --- a/trunk/net/sctp/sm_make_chunk.c +++ b/trunk/net/sctp/sm_make_chunk.c @@ -1513,7 +1513,8 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, struct hash_desc desc; /* Sign the message. */ - sg_init_one(&sg, &cookie->c, bodysize); + sg_init_table(&sg, 1); + sg_set_buf(&sg, &cookie->c, bodysize); keylen = SCTP_SECRET_SIZE; key = (char *)ep->secret_key[ep->current_key]; desc.tfm = sctp_sk(ep->base.sk)->hmac; @@ -1583,7 +1584,8 @@ struct sctp_association *sctp_unpack_cookie( /* Check the signature. */ keylen = SCTP_SECRET_SIZE; - sg_init_one(&sg, bear_cookie, bodysize); + sg_init_table(&sg, 1); + sg_set_buf(&sg, bear_cookie, bodysize); key = (char *)ep->secret_key[ep->current_key]; desc.tfm = sctp_sk(ep->base.sk)->hmac; desc.flags = 0; diff --git a/trunk/net/sunrpc/auth_gss/gss_krb5_crypto.c b/trunk/net/sunrpc/auth_gss/gss_krb5_crypto.c index 91cd8f0d1e10..24711be4b2dc 100644 --- a/trunk/net/sunrpc/auth_gss/gss_krb5_crypto.c +++ b/trunk/net/sunrpc/auth_gss/gss_krb5_crypto.c @@ -75,7 +75,7 @@ krb5_encrypt( memcpy(local_iv, iv, crypto_blkcipher_ivsize(tfm)); memcpy(out, in, length); - sg_init_one(sg, out, length); + sg_set_buf(sg, out, length); ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length); out: @@ -110,7 +110,7 @@ krb5_decrypt( memcpy(local_iv,iv, crypto_blkcipher_ivsize(tfm)); memcpy(out, in, length); - sg_init_one(sg, out, length); + sg_set_buf(sg, out, length); ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length); out: @@ -146,7 +146,7 @@ make_checksum(char *cksumname, char *header, int hdrlen, struct xdr_buf *body, err = crypto_hash_init(&desc); if (err) goto out; - sg_init_one(sg, header, hdrlen); + sg_set_buf(sg, header, hdrlen); err = crypto_hash_update(&desc, sg, hdrlen); if (err) goto out; @@ -188,6 +188,8 @@ encryptor(struct scatterlist *sg, void *data) /* Worst case is 4 fragments: head, end of page 1, start * of page 2, tail. Anything more is a bug. */ BUG_ON(desc->fragno > 3); + desc->infrags[desc->fragno] = *sg; + desc->outfrags[desc->fragno] = *sg; page_pos = desc->pos - outbuf->head[0].iov_len; if (page_pos >= 0 && page_pos < outbuf->page_len) { @@ -197,10 +199,7 @@ encryptor(struct scatterlist *sg, void *data) } else { in_page = sg_page(sg); } - sg_set_page(&desc->infrags[desc->fragno], in_page, sg->length, - sg->offset); - sg_set_page(&desc->outfrags[desc->fragno], sg_page(sg), sg->length, - sg->offset); + sg_assign_page(&desc->infrags[desc->fragno], in_page); desc->fragno++; desc->fraglen += sg->length; desc->pos += sg->length; @@ -211,17 +210,10 @@ encryptor(struct scatterlist *sg, void *data) if (thislen == 0) return 0; - sg_mark_end(desc->infrags, desc->fragno); - sg_mark_end(desc->outfrags, desc->fragno); - ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags, desc->infrags, thislen); if (ret) return ret; - - sg_init_table(desc->infrags, 4); - sg_init_table(desc->outfrags, 4); - if (fraglen) { sg_set_page(&desc->outfrags[0], sg_page(sg), fraglen, sg->offset + sg->length - fraglen); @@ -255,9 +247,6 @@ gss_encrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *buf, desc.fragno = 0; desc.fraglen = 0; - sg_init_table(desc.infrags, 4); - sg_init_table(desc.outfrags, 4); - ret = xdr_process_buf(buf, offset, buf->len - offset, encryptor, &desc); return ret; } @@ -282,8 +271,7 @@ decryptor(struct scatterlist *sg, void *data) /* Worst case is 4 fragments: head, end of page 1, start * of page 2, tail. Anything more is a bug. */ BUG_ON(desc->fragno > 3); - sg_set_page(&desc->frags[desc->fragno], sg_page(sg), sg->length, - sg->offset); + desc->frags[desc->fragno] = *sg; desc->fragno++; desc->fraglen += sg->length; @@ -293,15 +281,10 @@ decryptor(struct scatterlist *sg, void *data) if (thislen == 0) return 0; - sg_mark_end(desc->frags, desc->fragno); - ret = crypto_blkcipher_decrypt_iv(&desc->desc, desc->frags, desc->frags, thislen); if (ret) return ret; - - sg_init_table(desc->frags, 4); - if (fraglen) { sg_set_page(&desc->frags[0], sg_page(sg), fraglen, sg->offset + sg->length - fraglen); @@ -329,9 +312,6 @@ gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *buf, desc.desc.flags = 0; desc.fragno = 0; desc.fraglen = 0; - - sg_init_table(desc.frags, 4); - return xdr_process_buf(buf, offset, buf->len - offset, decryptor, &desc); } diff --git a/trunk/net/sunrpc/auth_gss/gss_spkm3_seal.c b/trunk/net/sunrpc/auth_gss/gss_spkm3_seal.c index abf17ce2e3b1..d158635de6c0 100644 --- a/trunk/net/sunrpc/auth_gss/gss_spkm3_seal.c +++ b/trunk/net/sunrpc/auth_gss/gss_spkm3_seal.c @@ -173,7 +173,7 @@ make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header, if (err) goto out; - sg_init_one(sg, header, hdrlen); + sg_set_buf(sg, header, hdrlen); crypto_hash_update(&desc, sg, sg->length); xdr_process_buf(body, body_offset, body->len - body_offset, diff --git a/trunk/net/sunrpc/xdr.c b/trunk/net/sunrpc/xdr.c index fdc5e6d7562b..f38dac30481b 100644 --- a/trunk/net/sunrpc/xdr.c +++ b/trunk/net/sunrpc/xdr.c @@ -1030,8 +1030,6 @@ xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, unsigned page_len, thislen, page_offset; struct scatterlist sg[1]; - sg_init_table(sg, 1); - if (offset >= buf->head[0].iov_len) { offset -= buf->head[0].iov_len; } else { diff --git a/trunk/scripts/kconfig/Makefile b/trunk/scripts/kconfig/Makefile index 59594126e8b6..83c5e76414ce 100644 --- a/trunk/scripts/kconfig/Makefile +++ b/trunk/scripts/kconfig/Makefile @@ -4,30 +4,23 @@ PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config -# If a arch/$(SRCARCH)/Kconfig.$(ARCH) file exist use it -ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/Kconfig.$(ARCH)),) - Kconfig := arch/$(SRCARCH)/Kconfig.$(ARCH) -else - Kconfig := arch/$(SRCARCH)/Kconfig -endif - xconfig: $(obj)/qconf - $< $(Kconfig) + $< arch/$(ARCH)/Kconfig gconfig: $(obj)/gconf - $< $(Kconfig) + $< arch/$(ARCH)/Kconfig menuconfig: $(obj)/mconf - $< $(Kconfig) + $< arch/$(ARCH)/Kconfig config: $(obj)/conf - $< $(Kconfig) + $< arch/$(ARCH)/Kconfig oldconfig: $(obj)/conf - $< -o $(Kconfig) + $< -o arch/$(ARCH)/Kconfig silentoldconfig: $(obj)/conf - $< -s $(Kconfig) + $< -s arch/$(ARCH)/Kconfig # Create new linux.po file # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files @@ -52,27 +45,27 @@ update-po-config: $(obj)/kxgettext PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig randconfig: $(obj)/conf - $< -r $(Kconfig) + $< -r arch/$(ARCH)/Kconfig allyesconfig: $(obj)/conf - $< -y $(Kconfig) + $< -y arch/$(ARCH)/Kconfig allnoconfig: $(obj)/conf - $< -n $(Kconfig) + $< -n arch/$(ARCH)/Kconfig allmodconfig: $(obj)/conf - $< -m $(Kconfig) + $< -m arch/$(ARCH)/Kconfig defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) - $< -d $(Kconfig) + $< -d arch/$(ARCH)/Kconfig else - @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" - $(Q)$< -D arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) + @echo *** Default configuration is based on '$(KBUILD_DEFCONFIG)' + $(Q)$< -D arch/$(ARCH)/configs/$(KBUILD_DEFCONFIG) arch/$(ARCH)/Kconfig endif %_defconfig: $(obj)/conf - $(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig) + $(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig # Help text used by make help help: diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index 1c502789cc1e..d9f78c809ee9 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -9299,6 +9299,7 @@ static struct alc_config_preset alc268_presets[] = { .num_channel_mode = ARRAY_SIZE(alc268_modes), .channel_mode = alc268_modes, .input_mux = &alc268_capture_source, + .input_mux = &alc268_capture_source, .unsol_event = alc268_toshiba_unsol_event, .init_hook = alc268_toshiba_automute, },