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