diff options
Diffstat (limited to 'arch')
59 files changed, 258 insertions, 270 deletions
diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c index a16cb03c5291..d6b61d56b656 100644 --- a/arch/blackfin/kernel/dma-mapping.c +++ b/arch/blackfin/kernel/dma-mapping.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/device.h> | 35 | #include <linux/device.h> |
36 | #include <linux/dma-mapping.h> | 36 | #include <linux/dma-mapping.h> |
37 | #include <linux/io.h> | 37 | #include <linux/io.h> |
38 | #include <linux/scatterlist.h> | ||
38 | #include <asm/cacheflush.h> | 39 | #include <asm/cacheflush.h> |
39 | #include <asm/bfin-global.h> | 40 | #include <asm/bfin-global.h> |
40 | 41 | ||
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/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c index ef490e1ce600..6f8c080dd9f9 100644 --- a/arch/m68k/kernel/dma.c +++ b/arch/m68k/kernel/dma.c | |||
@@ -9,10 +9,10 @@ | |||
9 | #include <linux/dma-mapping.h> | 9 | #include <linux/dma-mapping.h> |
10 | #include <linux/device.h> | 10 | #include <linux/device.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/scatterlist.h> | ||
12 | #include <linux/vmalloc.h> | 13 | #include <linux/vmalloc.h> |
13 | 14 | ||
14 | #include <asm/pgalloc.h> | 15 | #include <asm/pgalloc.h> |
15 | #include <asm/scatterlist.h> | ||
16 | 16 | ||
17 | void *dma_alloc_coherent(struct device *dev, size_t size, | 17 | void *dma_alloc_coherent(struct device *dev, size_t size, |
18 | dma_addr_t *handle, gfp_t flag) | 18 | dma_addr_t *handle, gfp_t flag) |
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/iommu_common.c b/arch/sparc64/kernel/iommu_common.c index b70324e0d83d..efd5dff85f60 100644 --- a/arch/sparc64/kernel/iommu_common.c +++ b/arch/sparc64/kernel/iommu_common.c | |||
@@ -234,7 +234,7 @@ unsigned long prepare_sg(struct scatterlist *sg, int nents) | |||
234 | dma_sg->dma_length = dent_len; | 234 | dma_sg->dma_length = dent_len; |
235 | 235 | ||
236 | if (dma_sg != sg) { | 236 | if (dma_sg != sg) { |
237 | dma_sg = next_sg(dma_sg); | 237 | dma_sg = sg_next(dma_sg); |
238 | dma_sg->dma_length = 0; | 238 | dma_sg->dma_length = 0; |
239 | } | 239 | } |
240 | 240 | ||
diff --git a/arch/sparc64/kernel/ldc.c b/arch/sparc64/kernel/ldc.c index c8313cb60f0a..217478a94128 100644 --- a/arch/sparc64/kernel/ldc.c +++ b/arch/sparc64/kernel/ldc.c | |||
@@ -2121,7 +2121,7 @@ int ldc_map_sg(struct ldc_channel *lp, | |||
2121 | state.nc = 0; | 2121 | state.nc = 0; |
2122 | 2122 | ||
2123 | for (i = 0; i < num_sg; i++) | 2123 | for (i = 0; i < num_sg; i++) |
2124 | fill_cookies(&state, page_to_pfn(sg[i].page) << PAGE_SHIFT, | 2124 | fill_cookies(&state, page_to_pfn(sg_page(&sg[i])) << PAGE_SHIFT, |
2125 | sg[i].offset, sg[i].length); | 2125 | sg[i].offset, sg[i].length); |
2126 | 2126 | ||
2127 | return state.nc; | 2127 | return state.nc; |
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/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c index 560cb1edb1d0..c56573a10eee 100644 --- a/arch/sparc64/kernel/sys_sparc.c +++ b/arch/sparc64/kernel/sys_sparc.c | |||
@@ -318,7 +318,7 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u | |||
318 | 318 | ||
319 | if (flags & MAP_FIXED) { | 319 | if (flags & MAP_FIXED) { |
320 | /* Ok, don't mess with it. */ | 320 | /* Ok, don't mess with it. */ |
321 | return get_unmapped_area(NULL, addr, len, pgoff, flags); | 321 | return get_unmapped_area(NULL, orig_addr, len, pgoff, flags); |
322 | } | 322 | } |
323 | flags &= ~MAP_SHARED; | 323 | flags &= ~MAP_SHARED; |
324 | 324 | ||
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/um/Kconfig.i386 b/arch/um/Kconfig.i386 index 9876d80d85dd..e0ac74e5d4c4 100644 --- a/arch/um/Kconfig.i386 +++ b/arch/um/Kconfig.i386 | |||
@@ -1,6 +1,6 @@ | |||
1 | menu "Host processor type and features" | 1 | menu "Host processor type and features" |
2 | 2 | ||
3 | source "arch/i386/Kconfig.cpu" | 3 | source "arch/x86/Kconfig.cpu" |
4 | 4 | ||
5 | endmenu | 5 | endmenu |
6 | 6 | ||
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 0178df306939..b01dfb00e5f8 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 | |||
@@ -9,6 +9,7 @@ ELF_ARCH := $(SUBARCH) | |||
9 | ELF_FORMAT := elf32-$(SUBARCH) | 9 | ELF_FORMAT := elf32-$(SUBARCH) |
10 | OBJCOPYFLAGS := -O binary -R .note -R .comment -S | 10 | OBJCOPYFLAGS := -O binary -R .note -R .comment -S |
11 | HEADER_ARCH := x86 | 11 | HEADER_ARCH := x86 |
12 | CHECKFLAGS += -D__i386__ | ||
12 | 13 | ||
13 | ifeq ("$(origin SUBARCH)", "command line") | 14 | ifeq ("$(origin SUBARCH)", "command line") |
14 | ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)") | 15 | ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)") |
@@ -26,10 +27,8 @@ AFLAGS += -DCONFIG_X86_32 | |||
26 | CONFIG_X86_32 := y | 27 | CONFIG_X86_32 := y |
27 | export CONFIG_X86_32 | 28 | export CONFIG_X86_32 |
28 | 29 | ||
29 | ARCH_KERNEL_DEFINES += -U__$(SUBARCH)__ -U$(SUBARCH) | ||
30 | |||
31 | # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. | 30 | # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. |
32 | include $(srctree)/arch/i386/Makefile.cpu | 31 | include $(srctree)/arch/x86/Makefile_32.cpu |
33 | 32 | ||
34 | # prevent gcc from keeping the stack 16 byte aligned. Taken from i386. | 33 | # prevent gcc from keeping the stack 16 byte aligned. Taken from i386. |
35 | cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) | 34 | cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) |
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index fe5316f0c6a5..8ed362f93582 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 | |||
@@ -6,12 +6,9 @@ START := 0x60000000 | |||
6 | 6 | ||
7 | _extra_flags_ = -fno-builtin -m64 | 7 | _extra_flags_ = -fno-builtin -m64 |
8 | 8 | ||
9 | #We #undef __x86_64__ for kernelspace, not for userspace where | ||
10 | #it's needed for headers to work! | ||
11 | ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__ | ||
12 | KBUILD_CFLAGS += $(_extra_flags_) | 9 | KBUILD_CFLAGS += $(_extra_flags_) |
13 | 10 | ||
14 | CHECKFLAGS += -m64 | 11 | CHECKFLAGS += -m64 -D__x86_64__ |
15 | KBUILD_AFLAGS += -m64 | 12 | KBUILD_AFLAGS += -m64 |
16 | LDFLAGS += -m elf_x86_64 | 13 | LDFLAGS += -m elf_x86_64 |
17 | KBUILD_CPPFLAGS += -m64 | 14 | KBUILD_CPPFLAGS += -m64 |
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 3a8cd3dfb51c..e184b44b1011 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "linux/genhd.h" | 35 | #include "linux/genhd.h" |
36 | #include "linux/spinlock.h" | 36 | #include "linux/spinlock.h" |
37 | #include "linux/platform_device.h" | 37 | #include "linux/platform_device.h" |
38 | #include "linux/scatterlist.h" | ||
38 | #include "asm/segment.h" | 39 | #include "asm/segment.h" |
39 | #include "asm/uaccess.h" | 40 | #include "asm/uaccess.h" |
40 | #include "asm/irq.h" | 41 | #include "asm/irq.h" |
@@ -704,6 +705,7 @@ static int ubd_add(int n, char **error_out) | |||
704 | ubd_dev->size = ROUND_BLOCK(ubd_dev->size); | 705 | ubd_dev->size = ROUND_BLOCK(ubd_dev->size); |
705 | 706 | ||
706 | INIT_LIST_HEAD(&ubd_dev->restart); | 707 | INIT_LIST_HEAD(&ubd_dev->restart); |
708 | sg_init_table(&ubd_dev->sg, MAX_SG); | ||
707 | 709 | ||
708 | err = -ENOMEM; | 710 | err = -ENOMEM; |
709 | ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock); | 711 | ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock); |
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 8456397f5f4d..59822dee438a 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -165,7 +165,7 @@ static void __init kmap_init(void) | |||
165 | kmap_prot = PAGE_KERNEL; | 165 | kmap_prot = PAGE_KERNEL; |
166 | } | 166 | } |
167 | 167 | ||
168 | static void init_highmem(void) | 168 | static void __init init_highmem(void) |
169 | { | 169 | { |
170 | pgd_t *pgd; | 170 | pgd_t *pgd; |
171 | pud_t *pud; | 171 | pud_t *pud; |
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c index 9657c89fdf31..bd3da8a61f64 100644 --- a/arch/um/sys-i386/ptrace.c +++ b/arch/um/sys-i386/ptrace.c | |||
@@ -155,7 +155,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
155 | if (err) | 155 | if (err) |
156 | return err; | 156 | return err; |
157 | 157 | ||
158 | n = copy_to_user((void *) buf, fpregs, sizeof(fpregs)); | 158 | n = copy_to_user(buf, fpregs, sizeof(fpregs)); |
159 | if(n > 0) | 159 | if(n > 0) |
160 | return -EFAULT; | 160 | return -EFAULT; |
161 | 161 | ||
@@ -168,7 +168,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
168 | long fpregs[HOST_FP_SIZE]; | 168 | long fpregs[HOST_FP_SIZE]; |
169 | 169 | ||
170 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); | 170 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); |
171 | n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs)); | 171 | n = copy_from_user(fpregs, buf, sizeof(fpregs)); |
172 | if (n > 0) | 172 | if (n > 0) |
173 | return -EFAULT; | 173 | return -EFAULT; |
174 | 174 | ||
@@ -185,7 +185,7 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) | |||
185 | if (err) | 185 | if (err) |
186 | return err; | 186 | return err; |
187 | 187 | ||
188 | n = copy_to_user((void *) buf, fpregs, sizeof(fpregs)); | 188 | n = copy_to_user(buf, fpregs, sizeof(fpregs)); |
189 | if(n > 0) | 189 | if(n > 0) |
190 | return -EFAULT; | 190 | return -EFAULT; |
191 | 191 | ||
@@ -198,7 +198,7 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) | |||
198 | long fpregs[HOST_XFP_SIZE]; | 198 | long fpregs[HOST_XFP_SIZE]; |
199 | 199 | ||
200 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); | 200 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); |
201 | n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs)); | 201 | n = copy_from_user(fpregs, buf, sizeof(fpregs)); |
202 | if (n > 0) | 202 | if (n > 0) |
203 | return -EFAULT; | 203 | return -EFAULT; |
204 | 204 | ||
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c index a3cfeed17af4..b7631b0e9ddc 100644 --- a/arch/um/sys-x86_64/ptrace.c +++ b/arch/um/sys-x86_64/ptrace.c | |||
@@ -154,7 +154,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
154 | if (err) | 154 | if (err) |
155 | return err; | 155 | return err; |
156 | 156 | ||
157 | n = copy_to_user((void *) buf, fpregs, sizeof(fpregs)); | 157 | n = copy_to_user(buf, fpregs, sizeof(fpregs)); |
158 | if(n > 0) | 158 | if(n > 0) |
159 | return -EFAULT; | 159 | return -EFAULT; |
160 | 160 | ||
@@ -167,7 +167,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
167 | long fpregs[HOST_FP_SIZE]; | 167 | long fpregs[HOST_FP_SIZE]; |
168 | 168 | ||
169 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); | 169 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); |
170 | n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs)); | 170 | n = copy_from_user(fpregs, buf, sizeof(fpregs)); |
171 | if (n > 0) | 171 | if (n > 0) |
172 | return -EFAULT; | 172 | return -EFAULT; |
173 | 173 | ||
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/crash.c b/arch/x86/kernel/crash.c index af0253f94a9a..8bb482ff091b 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/kdebug.h> | 25 | #include <linux/kdebug.h> |
26 | #include <asm/smp.h> | 26 | #include <asm/smp.h> |
27 | 27 | ||
28 | #ifdef X86_32 | 28 | #ifdef CONFIG_X86_32 |
29 | #include <mach_ipi.h> | 29 | #include <mach_ipi.h> |
30 | #else | 30 | #else |
31 | #include <asm/mach_apic.h> | 31 | #include <asm/mach_apic.h> |
@@ -41,7 +41,7 @@ static int crash_nmi_callback(struct notifier_block *self, | |||
41 | unsigned long val, void *data) | 41 | unsigned long val, void *data) |
42 | { | 42 | { |
43 | struct pt_regs *regs; | 43 | struct pt_regs *regs; |
44 | #ifdef X86_32 | 44 | #ifdef CONFIG_X86_32 |
45 | struct pt_regs fixed_regs; | 45 | struct pt_regs fixed_regs; |
46 | #endif | 46 | #endif |
47 | int cpu; | 47 | int cpu; |
@@ -60,7 +60,7 @@ static int crash_nmi_callback(struct notifier_block *self, | |||
60 | return NOTIFY_STOP; | 60 | return NOTIFY_STOP; |
61 | local_irq_disable(); | 61 | local_irq_disable(); |
62 | 62 | ||
63 | #ifdef X86_32 | 63 | #ifdef CONFIG_X86_32 |
64 | if (!user_mode_vm(regs)) { | 64 | if (!user_mode_vm(regs)) { |
65 | crash_fixup_ss_esp(&fixed_regs, regs); | 65 | crash_fixup_ss_esp(&fixed_regs, regs); |
66 | regs = &fixed_regs; | 66 | regs = &fixed_regs; |
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/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index c56e9ee64964..79b514b381b1 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -338,7 +338,6 @@ static int __dma_map_cont(struct scatterlist *start, int nelems, | |||
338 | 338 | ||
339 | BUG_ON(s != start && s->offset); | 339 | BUG_ON(s != start && s->offset); |
340 | if (s == start) { | 340 | if (s == start) { |
341 | *sout = *s; | ||
342 | sout->dma_address = iommu_bus_base; | 341 | sout->dma_address = iommu_bus_base; |
343 | sout->dma_address += iommu_page*PAGE_SIZE + s->offset; | 342 | sout->dma_address += iommu_page*PAGE_SIZE + s->offset; |
344 | sout->dma_length = s->length; | 343 | sout->dma_length = s->length; |
@@ -365,7 +364,7 @@ static inline int dma_map_cont(struct scatterlist *start, int nelems, | |||
365 | { | 364 | { |
366 | if (!need) { | 365 | if (!need) { |
367 | BUG_ON(nelems != 1); | 366 | BUG_ON(nelems != 1); |
368 | *sout = *start; | 367 | sout->dma_address = start->dma_address; |
369 | sout->dma_length = start->length; | 368 | sout->dma_length = start->length; |
370 | return 0; | 369 | return 0; |
371 | } | 370 | } |
@@ -436,7 +435,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
436 | 435 | ||
437 | error: | 436 | error: |
438 | flush_gart(); | 437 | flush_gart(); |
439 | gart_unmap_sg(dev, sg, nents, dir); | 438 | gart_unmap_sg(dev, sg, out, dir); |
440 | /* When it was forced or merged try again in a dumb way */ | 439 | /* When it was forced or merged try again in a dumb way */ |
441 | if (force_iommu || iommu_merge) { | 440 | if (force_iommu || iommu_merge) { |
442 | out = dma_map_sg_nonforce(dev, sg, nents, dir); | 441 | out = dma_map_sg_nonforce(dev, sg, nents, dir); |
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/lguest/boot.c b/arch/x86/lguest/boot.c index d2235db4085f..a55b0902f9d3 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include <linux/lguest.h> | 56 | #include <linux/lguest.h> |
57 | #include <linux/lguest_launcher.h> | 57 | #include <linux/lguest_launcher.h> |
58 | #include <linux/virtio_console.h> | 58 | #include <linux/virtio_console.h> |
59 | #include <linux/pm.h> | ||
59 | #include <asm/paravirt.h> | 60 | #include <asm/paravirt.h> |
60 | #include <asm/param.h> | 61 | #include <asm/param.h> |
61 | #include <asm/page.h> | 62 | #include <asm/page.h> |
@@ -98,7 +99,7 @@ static cycle_t clock_base; | |||
98 | * When lazy_mode is set, it means we're allowed to defer all hypercalls and do | 99 | * When lazy_mode is set, it means we're allowed to defer all hypercalls and do |
99 | * them as a batch when lazy_mode is eventually turned off. Because hypercalls | 100 | * them as a batch when lazy_mode is eventually turned off. Because hypercalls |
100 | * are reasonably expensive, batching them up makes sense. For example, a | 101 | * are reasonably expensive, batching them up makes sense. For example, a |
101 | * large mmap might update dozens of page table entries: that code calls | 102 | * large munmap might update dozens of page table entries: that code calls |
102 | * paravirt_enter_lazy_mmu(), does the dozen updates, then calls | 103 | * paravirt_enter_lazy_mmu(), does the dozen updates, then calls |
103 | * lguest_leave_lazy_mode(). | 104 | * lguest_leave_lazy_mode(). |
104 | * | 105 | * |
@@ -163,8 +164,8 @@ void async_hcall(unsigned long call, | |||
163 | /*:*/ | 164 | /*:*/ |
164 | 165 | ||
165 | /*G:033 | 166 | /*G:033 |
166 | * Here are our first native-instruction replacements: four functions for | 167 | * After that diversion we return to our first native-instruction |
167 | * interrupt control. | 168 | * replacements: four functions for interrupt control. |
168 | * | 169 | * |
169 | * The simplest way of implementing these would be to have "turn interrupts | 170 | * The simplest way of implementing these would be to have "turn interrupts |
170 | * off" and "turn interrupts on" hypercalls. Unfortunately, this is too slow: | 171 | * off" and "turn interrupts on" hypercalls. Unfortunately, this is too slow: |
@@ -183,7 +184,7 @@ static unsigned long save_fl(void) | |||
183 | return lguest_data.irq_enabled; | 184 | return lguest_data.irq_enabled; |
184 | } | 185 | } |
185 | 186 | ||
186 | /* "restore_flags" just sets the flags back to the value given. */ | 187 | /* restore_flags() just sets the flags back to the value given. */ |
187 | static void restore_fl(unsigned long flags) | 188 | static void restore_fl(unsigned long flags) |
188 | { | 189 | { |
189 | lguest_data.irq_enabled = flags; | 190 | lguest_data.irq_enabled = flags; |
@@ -356,7 +357,7 @@ static void lguest_cpuid(unsigned int *eax, unsigned int *ebx, | |||
356 | * it. The Host needs to know when the Guest wants to change them, so we have | 357 | * it. The Host needs to know when the Guest wants to change them, so we have |
357 | * a whole series of functions like read_cr0() and write_cr0(). | 358 | * a whole series of functions like read_cr0() and write_cr0(). |
358 | * | 359 | * |
359 | * We start with CR0. CR0 allows you to turn on and off all kinds of basic | 360 | * We start with cr0. cr0 allows you to turn on and off all kinds of basic |
360 | * features, but Linux only really cares about one: the horrifically-named Task | 361 | * features, but Linux only really cares about one: the horrifically-named Task |
361 | * Switched (TS) bit at bit 3 (ie. 8) | 362 | * Switched (TS) bit at bit 3 (ie. 8) |
362 | * | 363 | * |
@@ -371,8 +372,7 @@ static void lguest_cpuid(unsigned int *eax, unsigned int *ebx, | |||
371 | static unsigned long current_cr0, current_cr3; | 372 | static unsigned long current_cr0, current_cr3; |
372 | static void lguest_write_cr0(unsigned long val) | 373 | static void lguest_write_cr0(unsigned long val) |
373 | { | 374 | { |
374 | /* 8 == TS bit. */ | 375 | lazy_hcall(LHCALL_TS, val & X86_CR0_TS, 0, 0); |
375 | lazy_hcall(LHCALL_TS, val & 8, 0, 0); | ||
376 | current_cr0 = val; | 376 | current_cr0 = val; |
377 | } | 377 | } |
378 | 378 | ||
@@ -387,10 +387,10 @@ static unsigned long lguest_read_cr0(void) | |||
387 | static void lguest_clts(void) | 387 | static void lguest_clts(void) |
388 | { | 388 | { |
389 | lazy_hcall(LHCALL_TS, 0, 0, 0); | 389 | lazy_hcall(LHCALL_TS, 0, 0, 0); |
390 | current_cr0 &= ~8U; | 390 | current_cr0 &= ~X86_CR0_TS; |
391 | } | 391 | } |
392 | 392 | ||
393 | /* CR2 is the virtual address of the last page fault, which the Guest only ever | 393 | /* cr2 is the virtual address of the last page fault, which the Guest only ever |
394 | * reads. The Host kindly writes this into our "struct lguest_data", so we | 394 | * reads. The Host kindly writes this into our "struct lguest_data", so we |
395 | * just read it out of there. */ | 395 | * just read it out of there. */ |
396 | static unsigned long lguest_read_cr2(void) | 396 | static unsigned long lguest_read_cr2(void) |
@@ -398,7 +398,7 @@ static unsigned long lguest_read_cr2(void) | |||
398 | return lguest_data.cr2; | 398 | return lguest_data.cr2; |
399 | } | 399 | } |
400 | 400 | ||
401 | /* CR3 is the current toplevel pagetable page: the principle is the same as | 401 | /* cr3 is the current toplevel pagetable page: the principle is the same as |
402 | * cr0. Keep a local copy, and tell the Host when it changes. */ | 402 | * cr0. Keep a local copy, and tell the Host when it changes. */ |
403 | static void lguest_write_cr3(unsigned long cr3) | 403 | static void lguest_write_cr3(unsigned long cr3) |
404 | { | 404 | { |
@@ -411,7 +411,7 @@ static unsigned long lguest_read_cr3(void) | |||
411 | return current_cr3; | 411 | return current_cr3; |
412 | } | 412 | } |
413 | 413 | ||
414 | /* CR4 is used to enable and disable PGE, but we don't care. */ | 414 | /* cr4 is used to enable and disable PGE, but we don't care. */ |
415 | static unsigned long lguest_read_cr4(void) | 415 | static unsigned long lguest_read_cr4(void) |
416 | { | 416 | { |
417 | return 0; | 417 | return 0; |
@@ -432,7 +432,7 @@ static void lguest_write_cr4(unsigned long val) | |||
432 | * maps virtual addresses to physical addresses using "page tables". We could | 432 | * maps virtual addresses to physical addresses using "page tables". We could |
433 | * use one huge index of 1 million entries: each address is 4 bytes, so that's | 433 | * use one huge index of 1 million entries: each address is 4 bytes, so that's |
434 | * 1024 pages just to hold the page tables. But since most virtual addresses | 434 | * 1024 pages just to hold the page tables. But since most virtual addresses |
435 | * are unused, we use a two level index which saves space. The CR3 register | 435 | * are unused, we use a two level index which saves space. The cr3 register |
436 | * contains the physical address of the top level "page directory" page, which | 436 | * contains the physical address of the top level "page directory" page, which |
437 | * contains physical addresses of up to 1024 second-level pages. Each of these | 437 | * contains physical addresses of up to 1024 second-level pages. Each of these |
438 | * second level pages contains up to 1024 physical addresses of actual pages, | 438 | * second level pages contains up to 1024 physical addresses of actual pages, |
@@ -440,7 +440,7 @@ static void lguest_write_cr4(unsigned long val) | |||
440 | * | 440 | * |
441 | * Here's a diagram, where arrows indicate physical addresses: | 441 | * Here's a diagram, where arrows indicate physical addresses: |
442 | * | 442 | * |
443 | * CR3 ---> +---------+ | 443 | * cr3 ---> +---------+ |
444 | * | --------->+---------+ | 444 | * | --------->+---------+ |
445 | * | | | PADDR1 | | 445 | * | | | PADDR1 | |
446 | * Top-level | | PADDR2 | | 446 | * Top-level | | PADDR2 | |
@@ -498,8 +498,7 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval) | |||
498 | * | 498 | * |
499 | * ... except in early boot when the kernel sets up the initial pagetables, | 499 | * ... except in early boot when the kernel sets up the initial pagetables, |
500 | * which makes booting astonishingly slow. So we don't even tell the Host | 500 | * which makes booting astonishingly slow. So we don't even tell the Host |
501 | * anything changed until we've done the first page table switch. | 501 | * anything changed until we've done the first page table switch. */ |
502 | */ | ||
503 | static void lguest_set_pte(pte_t *ptep, pte_t pteval) | 502 | static void lguest_set_pte(pte_t *ptep, pte_t pteval) |
504 | { | 503 | { |
505 | *ptep = pteval; | 504 | *ptep = pteval; |
@@ -720,10 +719,10 @@ static void lguest_time_init(void) | |||
720 | /* Set up the timer interrupt (0) to go to our simple timer routine */ | 719 | /* Set up the timer interrupt (0) to go to our simple timer routine */ |
721 | set_irq_handler(0, lguest_time_irq); | 720 | set_irq_handler(0, lguest_time_irq); |
722 | 721 | ||
723 | /* Our clock structure look like arch/i386/kernel/tsc.c if we can use | 722 | /* Our clock structure looks like arch/x86/kernel/tsc_32.c if we can |
724 | * the TSC, otherwise it's a dumb nanosecond-resolution clock. Either | 723 | * use the TSC, otherwise it's a dumb nanosecond-resolution clock. |
725 | * way, the "rating" is initialized so high that it's always chosen | 724 | * Either way, the "rating" is set so high that it's always chosen over |
726 | * over any other clocksource. */ | 725 | * any other clocksource. */ |
727 | if (lguest_data.tsc_khz) | 726 | if (lguest_data.tsc_khz) |
728 | lguest_clock.mult = clocksource_khz2mult(lguest_data.tsc_khz, | 727 | lguest_clock.mult = clocksource_khz2mult(lguest_data.tsc_khz, |
729 | lguest_clock.shift); | 728 | lguest_clock.shift); |
@@ -749,7 +748,7 @@ static void lguest_time_init(void) | |||
749 | * to work. They're pretty simple. | 748 | * to work. They're pretty simple. |
750 | */ | 749 | */ |
751 | 750 | ||
752 | /* The Guest needs to tell the host what stack it expects traps to use. For | 751 | /* The Guest needs to tell the Host what stack it expects traps to use. For |
753 | * native hardware, this is part of the Task State Segment mentioned above in | 752 | * native hardware, this is part of the Task State Segment mentioned above in |
754 | * lguest_load_tr_desc(), but to help hypervisors there's this special call. | 753 | * lguest_load_tr_desc(), but to help hypervisors there's this special call. |
755 | * | 754 | * |
@@ -850,13 +849,16 @@ static __init char *lguest_memory_setup(void) | |||
850 | return "LGUEST"; | 849 | return "LGUEST"; |
851 | } | 850 | } |
852 | 851 | ||
853 | /* Before virtqueues are set up, we use LHCALL_NOTIFY on normal memory to | 852 | /* We will eventually use the virtio console device to produce console output, |
854 | * produce console output. */ | 853 | * but before that is set up we use LHCALL_NOTIFY on normal memory to produce |
854 | * console output. */ | ||
855 | static __init int early_put_chars(u32 vtermno, const char *buf, int count) | 855 | static __init int early_put_chars(u32 vtermno, const char *buf, int count) |
856 | { | 856 | { |
857 | char scratch[17]; | 857 | char scratch[17]; |
858 | unsigned int len = count; | 858 | unsigned int len = count; |
859 | 859 | ||
860 | /* We use a nul-terminated string, so we have to make a copy. Icky, | ||
861 | * huh? */ | ||
860 | if (len > sizeof(scratch) - 1) | 862 | if (len > sizeof(scratch) - 1) |
861 | len = sizeof(scratch) - 1; | 863 | len = sizeof(scratch) - 1; |
862 | scratch[len] = '\0'; | 864 | scratch[len] = '\0'; |
@@ -883,7 +885,7 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count) | |||
883 | * Our current solution is to allow the paravirt back end to optionally patch | 885 | * Our current solution is to allow the paravirt back end to optionally patch |
884 | * over the indirect calls to replace them with something more efficient. We | 886 | * over the indirect calls to replace them with something more efficient. We |
885 | * patch the four most commonly called functions: disable interrupts, enable | 887 | * patch the four most commonly called functions: disable interrupts, enable |
886 | * interrupts, restore interrupts and save interrupts. We usually have 10 | 888 | * interrupts, restore interrupts and save interrupts. We usually have 6 or 10 |
887 | * bytes to patch into: the Guest versions of these operations are small enough | 889 | * bytes to patch into: the Guest versions of these operations are small enough |
888 | * that we can fit comfortably. | 890 | * that we can fit comfortably. |
889 | * | 891 | * |
@@ -1015,7 +1017,7 @@ __init void lguest_init(void) | |||
1015 | asm volatile ("mov %0, %%fs" : : "r" (__KERNEL_DS) : "memory"); | 1017 | asm volatile ("mov %0, %%fs" : : "r" (__KERNEL_DS) : "memory"); |
1016 | 1018 | ||
1017 | /* The Host uses the top of the Guest's virtual address space for the | 1019 | /* The Host uses the top of the Guest's virtual address space for the |
1018 | * Host<->Guest Switcher, and it tells us how much it needs in | 1020 | * Host<->Guest Switcher, and it tells us how big that is in |
1019 | * lguest_data.reserve_mem, set up on the LGUEST_INIT hypercall. */ | 1021 | * lguest_data.reserve_mem, set up on the LGUEST_INIT hypercall. */ |
1020 | reserve_top_address(lguest_data.reserve_mem); | 1022 | reserve_top_address(lguest_data.reserve_mem); |
1021 | 1023 | ||
@@ -1065,6 +1067,6 @@ __init void lguest_init(void) | |||
1065 | /* | 1067 | /* |
1066 | * This marks the end of stage II of our journey, The Guest. | 1068 | * This marks the end of stage II of our journey, The Guest. |
1067 | * | 1069 | * |
1068 | * It is now time for us to explore the nooks and crannies of the three Guest | 1070 | * It is now time for us to explore the layer of virtual drivers and complete |
1069 | * devices and complete our understanding of the Guest in "make Drivers". | 1071 | * our understanding of the Guest in "make Drivers". |
1070 | */ | 1072 | */ |
diff --git a/arch/x86/lguest/i386_head.S b/arch/x86/lguest/i386_head.S index ebc6ac733899..95b6fbcded63 100644 --- a/arch/x86/lguest/i386_head.S +++ b/arch/x86/lguest/i386_head.S | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <asm/processor-flags.h> | 6 | #include <asm/processor-flags.h> |
7 | 7 | ||
8 | /*G:020 This is where we begin: head.S notes that the boot header's platform | 8 | /*G:020 This is where we begin: head.S notes that the boot header's platform |
9 | * type field is "1" (lguest), so calls us here. The boot header is in %esi. | 9 | * type field is "1" (lguest), so calls us here. |
10 | * | 10 | * |
11 | * WARNING: be very careful here! We're running at addresses equal to physical | 11 | * WARNING: be very careful here! We're running at addresses equal to physical |
12 | * addesses (around 0), not above PAGE_OFFSET as most code expectes | 12 | * addesses (around 0), not above PAGE_OFFSET as most code expectes |
@@ -17,13 +17,15 @@ | |||
17 | * boot. */ | 17 | * boot. */ |
18 | .section .init.text, "ax", @progbits | 18 | .section .init.text, "ax", @progbits |
19 | ENTRY(lguest_entry) | 19 | ENTRY(lguest_entry) |
20 | /* Make initial hypercall now, so we can set up the pagetables. */ | 20 | /* We make the "initialization" hypercall now to tell the Host about |
21 | * us, and also find out where it put our page tables. */ | ||
21 | movl $LHCALL_LGUEST_INIT, %eax | 22 | movl $LHCALL_LGUEST_INIT, %eax |
22 | movl $lguest_data - __PAGE_OFFSET, %edx | 23 | movl $lguest_data - __PAGE_OFFSET, %edx |
23 | int $LGUEST_TRAP_ENTRY | 24 | int $LGUEST_TRAP_ENTRY |
24 | 25 | ||
25 | /* The Host put the toplevel pagetable in lguest_data.pgdir. The movsl | 26 | /* The Host put the toplevel pagetable in lguest_data.pgdir. The movsl |
26 | * instruction uses %esi implicitly. */ | 27 | * instruction uses %esi implicitly as the source for the copy we' |
28 | * about to do. */ | ||
27 | movl lguest_data - __PAGE_OFFSET + LGUEST_DATA_pgdir, %esi | 29 | movl lguest_data - __PAGE_OFFSET + LGUEST_DATA_pgdir, %esi |
28 | 30 | ||
29 | /* Copy first 32 entries of page directory to __PAGE_OFFSET entries. | 31 | /* Copy first 32 entries of page directory to __PAGE_OFFSET entries. |
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/mm/fault_32.c b/arch/x86/mm/fault_32.c index 503dfc05111b..33563ee8eb0f 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c | |||
@@ -550,7 +550,7 @@ no_context: | |||
550 | page &= PAGE_MASK; | 550 | page &= PAGE_MASK; |
551 | page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT) | 551 | page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT) |
552 | & (PTRS_PER_PMD - 1)]; | 552 | & (PTRS_PER_PMD - 1)]; |
553 | printk(KERN_ALERT "*pde = %016Lx ", page); | 553 | printk(KERN_CONT "*pde = %016Lx ", page); |
554 | page &= ~_PAGE_NX; | 554 | page &= ~_PAGE_NX; |
555 | } | 555 | } |
556 | #else | 556 | #else |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 1e3862e41065..a7308b2cd058 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -728,12 +728,6 @@ int in_gate_area_no_task(unsigned long addr) | |||
728 | return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END); | 728 | return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END); |
729 | } | 729 | } |
730 | 730 | ||
731 | void * __init alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size) | ||
732 | { | ||
733 | return __alloc_bootmem_core(pgdat->bdata, size, | ||
734 | SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0); | ||
735 | } | ||
736 | |||
737 | const char *arch_vma_name(struct vm_area_struct *vma) | 731 | const char *arch_vma_name(struct vm_area_struct *vma) |
738 | { | 732 | { |
739 | if (vma->vm_mm && vma->vm_start == (long)vma->vm_mm->context.vdso) | 733 | if (vma->vm_mm && vma->vm_start == (long)vma->vm_mm->context.vdso) |
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 | ||