diff options
Diffstat (limited to 'include')
155 files changed, 1572 insertions, 1048 deletions
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h index f5cb7b878af2..ca88e54dec93 100644 --- a/include/asm-alpha/atomic.h +++ b/include/asm-alpha/atomic.h | |||
@@ -100,7 +100,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
100 | /* | 100 | /* |
101 | * Same as above, but return the result value | 101 | * Same as above, but return the result value |
102 | */ | 102 | */ |
103 | static __inline__ long atomic_add_return(int i, atomic_t * v) | 103 | static inline int atomic_add_return(int i, atomic_t *v) |
104 | { | 104 | { |
105 | long temp, result; | 105 | long temp, result; |
106 | smp_mb(); | 106 | smp_mb(); |
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index 30ee7669b19f..d5b10ef64364 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
7 | #include <linux/dma-mapping.h> | ||
7 | #include <asm/scatterlist.h> | 8 | #include <asm/scatterlist.h> |
8 | #include <asm/machvec.h> | 9 | #include <asm/machvec.h> |
9 | 10 | ||
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h index 471864e8d4c3..fdbedacc7375 100644 --- a/include/asm-alpha/pgalloc.h +++ b/include/asm-alpha/pgalloc.h | |||
@@ -31,7 +31,7 @@ pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd) | |||
31 | extern pgd_t *pgd_alloc(struct mm_struct *mm); | 31 | extern pgd_t *pgd_alloc(struct mm_struct *mm); |
32 | 32 | ||
33 | static inline void | 33 | static inline void |
34 | pgd_free(pgd_t *pgd) | 34 | pgd_free(struct mm_struct *mm, pgd_t *pgd) |
35 | { | 35 | { |
36 | free_page((unsigned long)pgd); | 36 | free_page((unsigned long)pgd); |
37 | } | 37 | } |
@@ -44,7 +44,7 @@ pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
44 | } | 44 | } |
45 | 45 | ||
46 | static inline void | 46 | static inline void |
47 | pmd_free(pmd_t *pmd) | 47 | pmd_free(struct mm_struct *mm, pmd_t *pmd) |
48 | { | 48 | { |
49 | free_page((unsigned long)pmd); | 49 | free_page((unsigned long)pmd); |
50 | } | 50 | } |
@@ -52,7 +52,7 @@ pmd_free(pmd_t *pmd) | |||
52 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); | 52 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); |
53 | 53 | ||
54 | static inline void | 54 | static inline void |
55 | pte_free_kernel(pte_t *pte) | 55 | pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
56 | { | 56 | { |
57 | free_page((unsigned long)pte); | 57 | free_page((unsigned long)pte); |
58 | } | 58 | } |
@@ -67,7 +67,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | static inline void | 69 | static inline void |
70 | pte_free(struct page *page) | 70 | pte_free(struct mm_struct *mm, struct page *page) |
71 | { | 71 | { |
72 | __free_page(page); | 72 | __free_page(page); |
73 | } | 73 | } |
diff --git a/include/asm-alpha/tlb.h b/include/asm-alpha/tlb.h index aa91335533e0..c13636575fba 100644 --- a/include/asm-alpha/tlb.h +++ b/include/asm-alpha/tlb.h | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #include <asm-generic/tlb.h> | 10 | #include <asm-generic/tlb.h> |
11 | 11 | ||
12 | #define __pte_free_tlb(tlb,pte) pte_free(pte) | 12 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
13 | #define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) | 13 | #define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) |
14 | 14 | ||
15 | #endif | 15 | #endif |
diff --git a/include/asm-alpha/tlbflush.h b/include/asm-alpha/tlbflush.h index b9e9147226f7..9d87aaa08c0d 100644 --- a/include/asm-alpha/tlbflush.h +++ b/include/asm-alpha/tlbflush.h | |||
@@ -142,6 +142,10 @@ extern void flush_tlb_range(struct vm_area_struct *, unsigned long, | |||
142 | 142 | ||
143 | #endif /* CONFIG_SMP */ | 143 | #endif /* CONFIG_SMP */ |
144 | 144 | ||
145 | #define flush_tlb_kernel_range(start, end) flush_tlb_all() | 145 | static inline void flush_tlb_kernel_range(unsigned long start, |
146 | unsigned long end) | ||
147 | { | ||
148 | flush_tlb_all(); | ||
149 | } | ||
146 | 150 | ||
147 | #endif /* _ALPHA_TLBFLUSH_H */ | 151 | #endif /* _ALPHA_TLBFLUSH_H */ |
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h index 29bf2fdc91c0..5b5c17485942 100644 --- a/include/asm-alpha/unistd.h +++ b/include/asm-alpha/unistd.h | |||
@@ -442,7 +442,6 @@ | |||
442 | #define __ARCH_WANT_OLD_READDIR | 442 | #define __ARCH_WANT_OLD_READDIR |
443 | #define __ARCH_WANT_STAT64 | 443 | #define __ARCH_WANT_STAT64 |
444 | #define __ARCH_WANT_SYS_GETHOSTNAME | 444 | #define __ARCH_WANT_SYS_GETHOSTNAME |
445 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
446 | #define __ARCH_WANT_SYS_FADVISE64 | 445 | #define __ARCH_WANT_SYS_FADVISE64 |
447 | #define __ARCH_WANT_SYS_GETPGRP | 446 | #define __ARCH_WANT_SYS_GETPGRP |
448 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | 447 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT |
diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h index 9dbc2dc794f7..bdbf5f9ffdd5 100644 --- a/include/asm-arm/arch-pxa/gpio.h +++ b/include/asm-arm/arch-pxa/gpio.h | |||
@@ -28,43 +28,35 @@ | |||
28 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
29 | #include <asm/hardware.h> | 29 | #include <asm/hardware.h> |
30 | 30 | ||
31 | static inline int gpio_request(unsigned gpio, const char *label) | 31 | #include <asm-generic/gpio.h> |
32 | { | ||
33 | return 0; | ||
34 | } | ||
35 | 32 | ||
36 | static inline void gpio_free(unsigned gpio) | ||
37 | { | ||
38 | return; | ||
39 | } | ||
40 | 33 | ||
41 | extern int gpio_direction_input(unsigned gpio); | 34 | /* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85). |
42 | extern int gpio_direction_output(unsigned gpio, int value); | 35 | * Those cases currently cause holes in the GPIO number space. |
36 | */ | ||
37 | #define NR_BUILTIN_GPIO 128 | ||
43 | 38 | ||
44 | static inline int __gpio_get_value(unsigned gpio) | 39 | static inline int gpio_get_value(unsigned gpio) |
45 | { | 40 | { |
46 | return GPLR(gpio) & GPIO_bit(gpio); | 41 | if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO)) |
42 | return GPLR(gpio) & GPIO_bit(gpio); | ||
43 | else | ||
44 | return __gpio_get_value(gpio); | ||
47 | } | 45 | } |
48 | 46 | ||
49 | #define gpio_get_value(gpio) \ | 47 | static inline void gpio_set_value(unsigned gpio, int value) |
50 | (__builtin_constant_p(gpio) ? \ | ||
51 | __gpio_get_value(gpio) : \ | ||
52 | pxa_gpio_get_value(gpio)) | ||
53 | |||
54 | static inline void __gpio_set_value(unsigned gpio, int value) | ||
55 | { | 48 | { |
56 | if (value) | 49 | if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO)) { |
57 | GPSR(gpio) = GPIO_bit(gpio); | 50 | if (value) |
58 | else | 51 | GPSR(gpio) = GPIO_bit(gpio); |
59 | GPCR(gpio) = GPIO_bit(gpio); | 52 | else |
53 | GPCR(gpio) = GPIO_bit(gpio); | ||
54 | } else { | ||
55 | __gpio_set_value(gpio, value); | ||
56 | } | ||
60 | } | 57 | } |
61 | 58 | ||
62 | #define gpio_set_value(gpio,value) \ | 59 | #define gpio_cansleep __gpio_cansleep |
63 | (__builtin_constant_p(gpio) ? \ | ||
64 | __gpio_set_value(gpio, value) : \ | ||
65 | pxa_gpio_set_value(gpio, value)) | ||
66 | |||
67 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
68 | 60 | ||
69 | #define gpio_to_irq(gpio) IRQ_GPIO(gpio) | 61 | #define gpio_to_irq(gpio) IRQ_GPIO(gpio) |
70 | #define irq_to_gpio(irq) IRQ_TO_GPIO(irq) | 62 | #define irq_to_gpio(irq) IRQ_TO_GPIO(irq) |
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 16ed24dbda4e..ac175b4d10cb 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -1131,6 +1131,19 @@ | |||
1131 | * General Purpose I/O | 1131 | * General Purpose I/O |
1132 | */ | 1132 | */ |
1133 | 1133 | ||
1134 | #define GPIO0_BASE ((void __iomem *)io_p2v(0x40E00000)) | ||
1135 | #define GPIO1_BASE ((void __iomem *)io_p2v(0x40E00004)) | ||
1136 | #define GPIO2_BASE ((void __iomem *)io_p2v(0x40E00008)) | ||
1137 | #define GPIO3_BASE ((void __iomem *)io_p2v(0x40E00100)) | ||
1138 | |||
1139 | #define GPLR_OFFSET 0x00 | ||
1140 | #define GPDR_OFFSET 0x0C | ||
1141 | #define GPSR_OFFSET 0x18 | ||
1142 | #define GPCR_OFFSET 0x24 | ||
1143 | #define GRER_OFFSET 0x30 | ||
1144 | #define GFER_OFFSET 0x3C | ||
1145 | #define GEDR_OFFSET 0x48 | ||
1146 | |||
1134 | #define GPLR0 __REG(0x40E00000) /* GPIO Pin-Level Register GPIO<31:0> */ | 1147 | #define GPLR0 __REG(0x40E00000) /* GPIO Pin-Level Register GPIO<31:0> */ |
1135 | #define GPLR1 __REG(0x40E00004) /* GPIO Pin-Level Register GPIO<63:32> */ | 1148 | #define GPLR1 __REG(0x40E00004) /* GPIO Pin-Level Register GPIO<63:32> */ |
1136 | #define GPLR2 __REG(0x40E00008) /* GPIO Pin-Level Register GPIO<80:64> */ | 1149 | #define GPLR2 __REG(0x40E00008) /* GPIO Pin-Level Register GPIO<80:64> */ |
diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h index 4d4394552911..fb6c6e3222bd 100644 --- a/include/asm-arm/pgalloc.h +++ b/include/asm-arm/pgalloc.h | |||
@@ -27,14 +27,14 @@ | |||
27 | * Since we have only two-level page tables, these are trivial | 27 | * Since we have only two-level page tables, these are trivial |
28 | */ | 28 | */ |
29 | #define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); }) | 29 | #define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); }) |
30 | #define pmd_free(pmd) do { } while (0) | 30 | #define pmd_free(mm, pmd) do { } while (0) |
31 | #define pgd_populate(mm,pmd,pte) BUG() | 31 | #define pgd_populate(mm,pmd,pte) BUG() |
32 | 32 | ||
33 | extern pgd_t *get_pgd_slow(struct mm_struct *mm); | 33 | extern pgd_t *get_pgd_slow(struct mm_struct *mm); |
34 | extern void free_pgd_slow(pgd_t *pgd); | 34 | extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd); |
35 | 35 | ||
36 | #define pgd_alloc(mm) get_pgd_slow(mm) | 36 | #define pgd_alloc(mm) get_pgd_slow(mm) |
37 | #define pgd_free(pgd) free_pgd_slow(pgd) | 37 | #define pgd_free(mm, pgd) free_pgd_slow(mm, pgd) |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * Allocate one PTE table. | 40 | * Allocate one PTE table. |
@@ -83,7 +83,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
83 | /* | 83 | /* |
84 | * Free one PTE table. | 84 | * Free one PTE table. |
85 | */ | 85 | */ |
86 | static inline void pte_free_kernel(pte_t *pte) | 86 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
87 | { | 87 | { |
88 | if (pte) { | 88 | if (pte) { |
89 | pte -= PTRS_PER_PTE; | 89 | pte -= PTRS_PER_PTE; |
@@ -91,7 +91,7 @@ static inline void pte_free_kernel(pte_t *pte) | |||
91 | } | 91 | } |
92 | } | 92 | } |
93 | 93 | ||
94 | static inline void pte_free(struct page *pte) | 94 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
95 | { | 95 | { |
96 | __free_page(pte); | 96 | __free_page(pte); |
97 | } | 97 | } |
diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h index cb740025d413..36bd402a21cb 100644 --- a/include/asm-arm/tlb.h +++ b/include/asm-arm/tlb.h | |||
@@ -85,8 +85,8 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | #define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) | 87 | #define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) |
88 | #define pte_free_tlb(tlb,ptep) pte_free(ptep) | 88 | #define pte_free_tlb(tlb, ptep) pte_free((tlb)->mm, ptep) |
89 | #define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp) | 89 | #define pmd_free_tlb(tlb, pmdp) pmd_free((tlb)->mm, pmdp) |
90 | 90 | ||
91 | #define tlb_migrate_finish(mm) do { } while (0) | 91 | #define tlb_migrate_finish(mm) do { } while (0) |
92 | 92 | ||
diff --git a/include/asm-avr32/arch-at32ap/at32ap700x.h b/include/asm-avr32/arch-at32ap/at32ap700x.h index 99684d6f3967..31e48b0e7324 100644 --- a/include/asm-avr32/arch-at32ap/at32ap700x.h +++ b/include/asm-avr32/arch-at32ap/at32ap700x.h | |||
@@ -13,8 +13,6 @@ | |||
13 | #define GPIO_PERIPH_A 0 | 13 | #define GPIO_PERIPH_A 0 |
14 | #define GPIO_PERIPH_B 1 | 14 | #define GPIO_PERIPH_B 1 |
15 | 15 | ||
16 | #define NR_GPIO_CONTROLLERS 4 | ||
17 | |||
18 | /* | 16 | /* |
19 | * Pin numbers identifying specific GPIO pins on the chip. They can | 17 | * Pin numbers identifying specific GPIO pins on the chip. They can |
20 | * also be converted to IRQ numbers by passing them through | 18 | * also be converted to IRQ numbers by passing them through |
diff --git a/include/asm-avr32/arch-at32ap/gpio.h b/include/asm-avr32/arch-at32ap/gpio.h index af7f9535bab3..0180f584ef03 100644 --- a/include/asm-avr32/arch-at32ap/gpio.h +++ b/include/asm-avr32/arch-at32ap/gpio.h | |||
@@ -5,20 +5,36 @@ | |||
5 | #include <asm/irq.h> | 5 | #include <asm/irq.h> |
6 | 6 | ||
7 | 7 | ||
8 | /* Arch-neutral GPIO API */ | 8 | /* Some GPIO chips can manage IRQs; some can't. The exact numbers can |
9 | int __must_check gpio_request(unsigned int gpio, const char *label); | 9 | * be changed if needed, but for the moment they're not configurable. |
10 | void gpio_free(unsigned int gpio); | 10 | */ |
11 | #define ARCH_NR_GPIOS (NR_GPIO_IRQS + 2 * 32) | ||
11 | 12 | ||
12 | int gpio_direction_input(unsigned int gpio); | ||
13 | int gpio_direction_output(unsigned int gpio, int value); | ||
14 | int gpio_get_value(unsigned int gpio); | ||
15 | void gpio_set_value(unsigned int gpio, int value); | ||
16 | 13 | ||
17 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | 14 | /* Arch-neutral GPIO API, supporting both "native" and external GPIOs. */ |
15 | #include <asm-generic/gpio.h> | ||
16 | |||
17 | static inline int gpio_get_value(unsigned int gpio) | ||
18 | { | ||
19 | return __gpio_get_value(gpio); | ||
20 | } | ||
21 | |||
22 | static inline void gpio_set_value(unsigned int gpio, int value) | ||
23 | { | ||
24 | __gpio_set_value(gpio, value); | ||
25 | } | ||
26 | |||
27 | static inline int gpio_cansleep(unsigned int gpio) | ||
28 | { | ||
29 | return __gpio_cansleep(gpio); | ||
30 | } | ||
31 | |||
18 | 32 | ||
19 | static inline int gpio_to_irq(unsigned int gpio) | 33 | static inline int gpio_to_irq(unsigned int gpio) |
20 | { | 34 | { |
21 | return gpio + GPIO_IRQ_BASE; | 35 | if (gpio < NR_GPIO_IRQS) |
36 | return gpio + GPIO_IRQ_BASE; | ||
37 | return -EINVAL; | ||
22 | } | 38 | } |
23 | 39 | ||
24 | static inline int irq_to_gpio(unsigned int irq) | 40 | static inline int irq_to_gpio(unsigned int irq) |
diff --git a/include/asm-avr32/arch-at32ap/irq.h b/include/asm-avr32/arch-at32ap/irq.h index 5adffab9a577..608e350368c7 100644 --- a/include/asm-avr32/arch-at32ap/irq.h +++ b/include/asm-avr32/arch-at32ap/irq.h | |||
@@ -3,11 +3,11 @@ | |||
3 | 3 | ||
4 | #define EIM_IRQ_BASE NR_INTERNAL_IRQS | 4 | #define EIM_IRQ_BASE NR_INTERNAL_IRQS |
5 | #define NR_EIM_IRQS 32 | 5 | #define NR_EIM_IRQS 32 |
6 | |||
7 | #define AT32_EXTINT(n) (EIM_IRQ_BASE + (n)) | 6 | #define AT32_EXTINT(n) (EIM_IRQ_BASE + (n)) |
8 | 7 | ||
9 | #define GPIO_IRQ_BASE (EIM_IRQ_BASE + NR_EIM_IRQS) | 8 | #define GPIO_IRQ_BASE (EIM_IRQ_BASE + NR_EIM_IRQS) |
10 | #define NR_GPIO_IRQS (5 * 32) | 9 | #define NR_GPIO_CTLR (5 /*internal*/ + 1 /*external*/) |
10 | #define NR_GPIO_IRQS (NR_GPIO_CTLR * 32) | ||
11 | 11 | ||
12 | #define NR_IRQS (GPIO_IRQ_BASE + NR_GPIO_IRQS) | 12 | #define NR_IRQS (GPIO_IRQ_BASE + NR_GPIO_IRQS) |
13 | 13 | ||
diff --git a/include/asm-avr32/pgalloc.h b/include/asm-avr32/pgalloc.h index 0e680f47209f..b77e364b4c44 100644 --- a/include/asm-avr32/pgalloc.h +++ b/include/asm-avr32/pgalloc.h | |||
@@ -30,7 +30,7 @@ static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
30 | return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL); | 30 | return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL); |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline void pgd_free(pgd_t *pgd) | 33 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
34 | { | 34 | { |
35 | kfree(pgd); | 35 | kfree(pgd); |
36 | } | 36 | } |
@@ -55,12 +55,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
55 | return pte; | 55 | return pte; |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline void pte_free_kernel(pte_t *pte) | 58 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
59 | { | 59 | { |
60 | free_page((unsigned long)pte); | 60 | free_page((unsigned long)pte); |
61 | } | 61 | } |
62 | 62 | ||
63 | static inline void pte_free(struct page *pte) | 63 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
64 | { | 64 | { |
65 | __free_page(pte); | 65 | __free_page(pte); |
66 | } | 66 | } |
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h index de09009593f8..89861a27543e 100644 --- a/include/asm-avr32/unistd.h +++ b/include/asm-avr32/unistd.h | |||
@@ -297,7 +297,7 @@ | |||
297 | 297 | ||
298 | #define __NR_utimensat 278 | 298 | #define __NR_utimensat 278 |
299 | #define __NR_signalfd 279 | 299 | #define __NR_signalfd 279 |
300 | #define __NR_timerfd 280 | 300 | /* 280 was __NR_timerfd */ |
301 | #define __NR_eventfd 281 | 301 | #define __NR_eventfd 281 |
302 | 302 | ||
303 | #ifdef __KERNEL__ | 303 | #ifdef __KERNEL__ |
diff --git a/include/asm-cris/bitops.h b/include/asm-cris/bitops.h index e2f49c27ed29..75ea6e096483 100644 --- a/include/asm-cris/bitops.h +++ b/include/asm-cris/bitops.h | |||
@@ -24,13 +24,6 @@ | |||
24 | #include <linux/compiler.h> | 24 | #include <linux/compiler.h> |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * Some hacks to defeat gcc over-optimizations.. | ||
28 | */ | ||
29 | struct __dummy { unsigned long a[100]; }; | ||
30 | #define ADDR (*(struct __dummy *) addr) | ||
31 | #define CONST_ADDR (*(const struct __dummy *) addr) | ||
32 | |||
33 | /* | ||
34 | * set_bit - Atomically set a bit in memory | 27 | * set_bit - Atomically set a bit in memory |
35 | * @nr: the bit to set | 28 | * @nr: the bit to set |
36 | * @addr: the address to start counting from | 29 | * @addr: the address to start counting from |
diff --git a/include/asm-cris/pgalloc.h b/include/asm-cris/pgalloc.h index deaddfe79bbc..8ddd66f81773 100644 --- a/include/asm-cris/pgalloc.h +++ b/include/asm-cris/pgalloc.h | |||
@@ -16,7 +16,7 @@ static inline pgd_t *pgd_alloc (struct mm_struct *mm) | |||
16 | return (pgd_t *)get_zeroed_page(GFP_KERNEL); | 16 | return (pgd_t *)get_zeroed_page(GFP_KERNEL); |
17 | } | 17 | } |
18 | 18 | ||
19 | static inline void pgd_free (pgd_t *pgd) | 19 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
20 | { | 20 | { |
21 | free_page((unsigned long)pgd); | 21 | free_page((unsigned long)pgd); |
22 | } | 22 | } |
@@ -34,12 +34,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add | |||
34 | return pte; | 34 | return pte; |
35 | } | 35 | } |
36 | 36 | ||
37 | static inline void pte_free_kernel(pte_t *pte) | 37 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
38 | { | 38 | { |
39 | free_page((unsigned long)pte); | 39 | free_page((unsigned long)pte); |
40 | } | 40 | } |
41 | 41 | ||
42 | static inline void pte_free(struct page *pte) | 42 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
43 | { | 43 | { |
44 | __free_page(pte); | 44 | __free_page(pte); |
45 | } | 45 | } |
diff --git a/include/asm-frv/dma-mapping.h b/include/asm-frv/dma-mapping.h index bcb2df68496e..2e8966ca030d 100644 --- a/include/asm-frv/dma-mapping.h +++ b/include/asm-frv/dma-mapping.h | |||
@@ -17,16 +17,6 @@ void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle | |||
17 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); | 17 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); |
18 | 18 | ||
19 | /* | 19 | /* |
20 | * These macros should be used after a pci_map_sg call has been done | ||
21 | * to get bus addresses of each of the SG entries and their lengths. | ||
22 | * You should only work with the number of sg entries pci_map_sg | ||
23 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
24 | * is 0. | ||
25 | */ | ||
26 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
27 | #define sg_dma_len(sg) ((sg)->length) | ||
28 | |||
29 | /* | ||
30 | * Map a single buffer of the indicated size for DMA in streaming mode. | 20 | * Map a single buffer of the indicated size for DMA in streaming mode. |
31 | * The 32-bit bus address to use is returned. | 21 | * The 32-bit bus address to use is returned. |
32 | * | 22 | * |
diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h index 213d92fd652a..bd9bd2d9cc78 100644 --- a/include/asm-frv/page.h +++ b/include/asm-frv/page.h | |||
@@ -76,10 +76,6 @@ extern unsigned long max_pfn; | |||
76 | 76 | ||
77 | #endif /* __ASSEMBLY__ */ | 77 | #endif /* __ASSEMBLY__ */ |
78 | 78 | ||
79 | #ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC | ||
80 | #define WANT_PAGE_VIRTUAL 1 | ||
81 | #endif | ||
82 | |||
83 | #include <asm-generic/memory_model.h> | 79 | #include <asm-generic/memory_model.h> |
84 | #include <asm-generic/page.h> | 80 | #include <asm-generic/page.h> |
85 | 81 | ||
diff --git a/include/asm-frv/pgalloc.h b/include/asm-frv/pgalloc.h index ce982a6c610f..e89620ef08ca 100644 --- a/include/asm-frv/pgalloc.h +++ b/include/asm-frv/pgalloc.h | |||
@@ -31,18 +31,18 @@ do { \ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | extern pgd_t *pgd_alloc(struct mm_struct *); | 33 | extern pgd_t *pgd_alloc(struct mm_struct *); |
34 | extern void pgd_free(pgd_t *); | 34 | extern void pgd_free(struct mm_struct *mm, pgd_t *); |
35 | 35 | ||
36 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); | 36 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); |
37 | 37 | ||
38 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); | 38 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); |
39 | 39 | ||
40 | static inline void pte_free_kernel(pte_t *pte) | 40 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
41 | { | 41 | { |
42 | free_page((unsigned long)pte); | 42 | free_page((unsigned long)pte); |
43 | } | 43 | } |
44 | 44 | ||
45 | static inline void pte_free(struct page *pte) | 45 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
46 | { | 46 | { |
47 | __free_page(pte); | 47 | __free_page(pte); |
48 | } | 48 | } |
@@ -55,7 +55,7 @@ static inline void pte_free(struct page *pte) | |||
55 | * (In the PAE case we free the pmds as part of the pgd.) | 55 | * (In the PAE case we free the pmds as part of the pgd.) |
56 | */ | 56 | */ |
57 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) | 57 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) |
58 | #define pmd_free(x) do { } while (0) | 58 | #define pmd_free(mm, x) do { } while (0) |
59 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 59 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
60 | 60 | ||
61 | #endif /* CONFIG_MMU */ | 61 | #endif /* CONFIG_MMU */ |
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h index 3c402afb9e74..6c0682ed5fc9 100644 --- a/include/asm-frv/pgtable.h +++ b/include/asm-frv/pgtable.h | |||
@@ -226,7 +226,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address) | |||
226 | * inside the pgd, so has no extra memory associated with it. | 226 | * inside the pgd, so has no extra memory associated with it. |
227 | */ | 227 | */ |
228 | #define pud_alloc_one(mm, address) NULL | 228 | #define pud_alloc_one(mm, address) NULL |
229 | #define pud_free(x) do { } while (0) | 229 | #define pud_free(mm, x) do { } while (0) |
230 | #define __pud_free_tlb(tlb, x) do { } while (0) | 230 | #define __pud_free_tlb(tlb, x) do { } while (0) |
231 | 231 | ||
232 | /* | 232 | /* |
diff --git a/include/asm-frv/scatterlist.h b/include/asm-frv/scatterlist.h index 2e7143b5a7ad..4bca8a28546c 100644 --- a/include/asm-frv/scatterlist.h +++ b/include/asm-frv/scatterlist.h | |||
@@ -31,6 +31,16 @@ struct scatterlist { | |||
31 | unsigned int length; | 31 | unsigned int length; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | /* | ||
35 | * These macros should be used after a pci_map_sg call has been done | ||
36 | * to get bus addresses of each of the SG entries and their lengths. | ||
37 | * You should only work with the number of sg entries pci_map_sg | ||
38 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
39 | * is 0. | ||
40 | */ | ||
41 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
42 | #define sg_dma_len(sg) ((sg)->length) | ||
43 | |||
34 | #define ISA_DMA_THRESHOLD (0xffffffffUL) | 44 | #define ISA_DMA_THRESHOLD (0xffffffffUL) |
35 | 45 | ||
36 | #endif /* !_ASM_SCATTERLIST_H */ | 46 | #endif /* !_ASM_SCATTERLIST_H */ |
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h index cd84f1771e34..e8c986667532 100644 --- a/include/asm-frv/unistd.h +++ b/include/asm-frv/unistd.h | |||
@@ -328,7 +328,7 @@ | |||
328 | #define __NR_epoll_pwait 319 | 328 | #define __NR_epoll_pwait 319 |
329 | #define __NR_utimensat 320 | 329 | #define __NR_utimensat 320 |
330 | #define __NR_signalfd 321 | 330 | #define __NR_signalfd 321 |
331 | #define __NR_timerfd 322 | 331 | /* #define __NR_timerfd 322 removed */ |
332 | #define __NR_eventfd 323 | 332 | #define __NR_eventfd 323 |
333 | #define __NR_fallocate 324 | 333 | #define __NR_fallocate 324 |
334 | 334 | ||
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 7b88d3931e34..9d40e879f99e 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | #undef pud_free_tlb | 29 | #undef pud_free_tlb |
30 | #define pud_free_tlb(tlb, x) do { } while (0) | 30 | #define pud_free_tlb(tlb, x) do { } while (0) |
31 | #define pud_free(x) do { } while (0) | 31 | #define pud_free(mm, x) do { } while (0) |
32 | #define __pud_free_tlb(tlb, x) do { } while (0) | 32 | #define __pud_free_tlb(tlb, x) do { } while (0) |
33 | 33 | ||
34 | #undef pud_addr_end | 34 | #undef pud_addr_end |
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 2d0aab1d8611..f29a502f4a6c 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -1,6 +1,102 @@ | |||
1 | #ifndef _ASM_GENERIC_GPIO_H | 1 | #ifndef _ASM_GENERIC_GPIO_H |
2 | #define _ASM_GENERIC_GPIO_H | 2 | #define _ASM_GENERIC_GPIO_H |
3 | 3 | ||
4 | #ifdef CONFIG_HAVE_GPIO_LIB | ||
5 | |||
6 | /* Platforms may implement their GPIO interface with library code, | ||
7 | * at a small performance cost for non-inlined operations and some | ||
8 | * extra memory (for code and for per-GPIO table entries). | ||
9 | * | ||
10 | * While the GPIO programming interface defines valid GPIO numbers | ||
11 | * to be in the range 0..MAX_INT, this library restricts them to the | ||
12 | * smaller range 0..ARCH_NR_GPIOS. | ||
13 | */ | ||
14 | |||
15 | #ifndef ARCH_NR_GPIOS | ||
16 | #define ARCH_NR_GPIOS 256 | ||
17 | #endif | ||
18 | |||
19 | struct seq_file; | ||
20 | |||
21 | /** | ||
22 | * struct gpio_chip - abstract a GPIO controller | ||
23 | * @label: for diagnostics | ||
24 | * @direction_input: configures signal "offset" as input, or returns error | ||
25 | * @get: returns value for signal "offset"; for output signals this | ||
26 | * returns either the value actually sensed, or zero | ||
27 | * @direction_output: configures signal "offset" as output, or returns error | ||
28 | * @set: assigns output value for signal "offset" | ||
29 | * @dbg_show: optional routine to show contents in debugfs; default code | ||
30 | * will be used when this is omitted, but custom code can show extra | ||
31 | * state (such as pullup/pulldown configuration). | ||
32 | * @base: identifies the first GPIO number handled by this chip; or, if | ||
33 | * negative during registration, requests dynamic ID allocation. | ||
34 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO | ||
35 | * handled is (base + ngpio - 1). | ||
36 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | ||
37 | * must while accessing GPIO expander chips over I2C or SPI | ||
38 | * | ||
39 | * A gpio_chip can help platforms abstract various sources of GPIOs so | ||
40 | * they can all be accessed through a common programing interface. | ||
41 | * Example sources would be SOC controllers, FPGAs, multifunction | ||
42 | * chips, dedicated GPIO expanders, and so on. | ||
43 | * | ||
44 | * Each chip controls a number of signals, identified in method calls | ||
45 | * by "offset" values in the range 0..(@ngpio - 1). When those signals | ||
46 | * are referenced through calls like gpio_get_value(gpio), the offset | ||
47 | * is calculated by subtracting @base from the gpio number. | ||
48 | */ | ||
49 | struct gpio_chip { | ||
50 | char *label; | ||
51 | |||
52 | int (*direction_input)(struct gpio_chip *chip, | ||
53 | unsigned offset); | ||
54 | int (*get)(struct gpio_chip *chip, | ||
55 | unsigned offset); | ||
56 | int (*direction_output)(struct gpio_chip *chip, | ||
57 | unsigned offset, int value); | ||
58 | void (*set)(struct gpio_chip *chip, | ||
59 | unsigned offset, int value); | ||
60 | void (*dbg_show)(struct seq_file *s, | ||
61 | struct gpio_chip *chip); | ||
62 | int base; | ||
63 | u16 ngpio; | ||
64 | unsigned can_sleep:1; | ||
65 | }; | ||
66 | |||
67 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, | ||
68 | unsigned offset); | ||
69 | |||
70 | /* add/remove chips */ | ||
71 | extern int gpiochip_add(struct gpio_chip *chip); | ||
72 | extern int __must_check gpiochip_remove(struct gpio_chip *chip); | ||
73 | |||
74 | |||
75 | /* Always use the library code for GPIO management calls, | ||
76 | * or when sleeping may be involved. | ||
77 | */ | ||
78 | extern int gpio_request(unsigned gpio, const char *label); | ||
79 | extern void gpio_free(unsigned gpio); | ||
80 | |||
81 | extern int gpio_direction_input(unsigned gpio); | ||
82 | extern int gpio_direction_output(unsigned gpio, int value); | ||
83 | |||
84 | extern int gpio_get_value_cansleep(unsigned gpio); | ||
85 | extern void gpio_set_value_cansleep(unsigned gpio, int value); | ||
86 | |||
87 | |||
88 | /* A platform's <asm/gpio.h> code may want to inline the I/O calls when | ||
89 | * the GPIO is constant and refers to some always-present controller, | ||
90 | * giving direct access to chip registers and tight bitbanging loops. | ||
91 | */ | ||
92 | extern int __gpio_get_value(unsigned gpio); | ||
93 | extern void __gpio_set_value(unsigned gpio, int value); | ||
94 | |||
95 | extern int __gpio_cansleep(unsigned gpio); | ||
96 | |||
97 | |||
98 | #else | ||
99 | |||
4 | /* platforms that don't directly support access to GPIOs through I2C, SPI, | 100 | /* platforms that don't directly support access to GPIOs through I2C, SPI, |
5 | * or other blocking infrastructure can use these wrappers. | 101 | * or other blocking infrastructure can use these wrappers. |
6 | */ | 102 | */ |
@@ -22,4 +118,6 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value) | |||
22 | gpio_set_value(gpio, value); | 118 | gpio_set_value(gpio, value); |
23 | } | 119 | } |
24 | 120 | ||
121 | #endif | ||
122 | |||
25 | #endif /* _ASM_GENERIC_GPIO_H */ | 123 | #endif /* _ASM_GENERIC_GPIO_H */ |
diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index 29ff5d84d8c3..087325ede76c 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h | |||
@@ -54,7 +54,7 @@ static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address) | |||
54 | * inside the pud, so has no extra memory associated with it. | 54 | * inside the pud, so has no extra memory associated with it. |
55 | */ | 55 | */ |
56 | #define pmd_alloc_one(mm, address) NULL | 56 | #define pmd_alloc_one(mm, address) NULL |
57 | #define pmd_free(x) do { } while (0) | 57 | #define pmd_free(mm, x) do { } while (0) |
58 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 58 | #define __pmd_free_tlb(tlb, x) do { } while (0) |
59 | 59 | ||
60 | #undef pmd_addr_end | 60 | #undef pmd_addr_end |
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index 566464500558..87cf449a6df3 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h | |||
@@ -51,7 +51,7 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address) | |||
51 | * inside the pgd, so has no extra memory associated with it. | 51 | * inside the pgd, so has no extra memory associated with it. |
52 | */ | 52 | */ |
53 | #define pud_alloc_one(mm, address) NULL | 53 | #define pud_alloc_one(mm, address) NULL |
54 | #define pud_free(x) do { } while (0) | 54 | #define pud_free(mm, x) do { } while (0) |
55 | #define __pud_free_tlb(tlb, x) do { } while (0) | 55 | #define __pud_free_tlb(tlb, x) do { } while (0) |
56 | 56 | ||
57 | #undef pud_addr_end | 57 | #undef pud_addr_end |
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h index a1b9719f5fbb..953d3df9dd22 100644 --- a/include/asm-ia64/bitops.h +++ b/include/asm-ia64/bitops.h | |||
@@ -122,38 +122,40 @@ clear_bit_unlock (int nr, volatile void *addr) | |||
122 | } | 122 | } |
123 | 123 | ||
124 | /** | 124 | /** |
125 | * __clear_bit_unlock - Non-atomically clear a bit with release | 125 | * __clear_bit_unlock - Non-atomically clears a bit in memory with release |
126 | * @nr: Bit to clear | ||
127 | * @addr: Address to start counting from | ||
126 | * | 128 | * |
127 | * This is like clear_bit_unlock, but the implementation uses a store | 129 | * Similarly to clear_bit_unlock, the implementation uses a store |
128 | * with release semantics. See also __raw_spin_unlock(). | 130 | * with release semantics. See also __raw_spin_unlock(). |
129 | */ | 131 | */ |
130 | static __inline__ void | 132 | static __inline__ void |
131 | __clear_bit_unlock(int nr, volatile void *addr) | 133 | __clear_bit_unlock(int nr, void *addr) |
132 | { | 134 | { |
133 | __u32 mask, new; | 135 | __u32 * const m = (__u32 *) addr + (nr >> 5); |
134 | volatile __u32 *m; | 136 | __u32 const new = *m & ~(1 << (nr & 31)); |
135 | 137 | ||
136 | m = (volatile __u32 *)addr + (nr >> 5); | ||
137 | mask = ~(1 << (nr & 31)); | ||
138 | new = *m & mask; | ||
139 | barrier(); | ||
140 | ia64_st4_rel_nta(m, new); | 138 | ia64_st4_rel_nta(m, new); |
141 | } | 139 | } |
142 | 140 | ||
143 | /** | 141 | /** |
144 | * __clear_bit - Clears a bit in memory (non-atomic version) | 142 | * __clear_bit - Clears a bit in memory (non-atomic version) |
143 | * @nr: the bit to clear | ||
144 | * @addr: the address to start counting from | ||
145 | * | ||
146 | * Unlike clear_bit(), this function is non-atomic and may be reordered. | ||
147 | * If it's called on the same region of memory simultaneously, the effect | ||
148 | * may be that only one operation succeeds. | ||
145 | */ | 149 | */ |
146 | static __inline__ void | 150 | static __inline__ void |
147 | __clear_bit (int nr, volatile void *addr) | 151 | __clear_bit (int nr, volatile void *addr) |
148 | { | 152 | { |
149 | volatile __u32 *p = (__u32 *) addr + (nr >> 5); | 153 | *((__u32 *) addr + (nr >> 5)) &= ~(1 << (nr & 31)); |
150 | __u32 m = 1 << (nr & 31); | ||
151 | *p &= ~m; | ||
152 | } | 154 | } |
153 | 155 | ||
154 | /** | 156 | /** |
155 | * change_bit - Toggle a bit in memory | 157 | * change_bit - Toggle a bit in memory |
156 | * @nr: Bit to clear | 158 | * @nr: Bit to toggle |
157 | * @addr: Address to start counting from | 159 | * @addr: Address to start counting from |
158 | * | 160 | * |
159 | * change_bit() is atomic and may not be reordered. | 161 | * change_bit() is atomic and may not be reordered. |
@@ -178,7 +180,7 @@ change_bit (int nr, volatile void *addr) | |||
178 | 180 | ||
179 | /** | 181 | /** |
180 | * __change_bit - Toggle a bit in memory | 182 | * __change_bit - Toggle a bit in memory |
181 | * @nr: the bit to set | 183 | * @nr: the bit to toggle |
182 | * @addr: the address to start counting from | 184 | * @addr: the address to start counting from |
183 | * | 185 | * |
184 | * Unlike change_bit(), this function is non-atomic and may be reordered. | 186 | * Unlike change_bit(), this function is non-atomic and may be reordered. |
@@ -197,7 +199,7 @@ __change_bit (int nr, volatile void *addr) | |||
197 | * @addr: Address to count from | 199 | * @addr: Address to count from |
198 | * | 200 | * |
199 | * This operation is atomic and cannot be reordered. | 201 | * This operation is atomic and cannot be reordered. |
200 | * It also implies a memory barrier. | 202 | * It also implies the acquisition side of the memory barrier. |
201 | */ | 203 | */ |
202 | static __inline__ int | 204 | static __inline__ int |
203 | test_and_set_bit (int nr, volatile void *addr) | 205 | test_and_set_bit (int nr, volatile void *addr) |
@@ -247,11 +249,11 @@ __test_and_set_bit (int nr, volatile void *addr) | |||
247 | 249 | ||
248 | /** | 250 | /** |
249 | * test_and_clear_bit - Clear a bit and return its old value | 251 | * test_and_clear_bit - Clear a bit and return its old value |
250 | * @nr: Bit to set | 252 | * @nr: Bit to clear |
251 | * @addr: Address to count from | 253 | * @addr: Address to count from |
252 | * | 254 | * |
253 | * This operation is atomic and cannot be reordered. | 255 | * This operation is atomic and cannot be reordered. |
254 | * It also implies a memory barrier. | 256 | * It also implies the acquisition side of the memory barrier. |
255 | */ | 257 | */ |
256 | static __inline__ int | 258 | static __inline__ int |
257 | test_and_clear_bit (int nr, volatile void *addr) | 259 | test_and_clear_bit (int nr, volatile void *addr) |
@@ -272,7 +274,7 @@ test_and_clear_bit (int nr, volatile void *addr) | |||
272 | 274 | ||
273 | /** | 275 | /** |
274 | * __test_and_clear_bit - Clear a bit and return its old value | 276 | * __test_and_clear_bit - Clear a bit and return its old value |
275 | * @nr: Bit to set | 277 | * @nr: Bit to clear |
276 | * @addr: Address to count from | 278 | * @addr: Address to count from |
277 | * | 279 | * |
278 | * This operation is non-atomic and can be reordered. | 280 | * This operation is non-atomic and can be reordered. |
@@ -292,11 +294,11 @@ __test_and_clear_bit(int nr, volatile void * addr) | |||
292 | 294 | ||
293 | /** | 295 | /** |
294 | * test_and_change_bit - Change a bit and return its old value | 296 | * test_and_change_bit - Change a bit and return its old value |
295 | * @nr: Bit to set | 297 | * @nr: Bit to change |
296 | * @addr: Address to count from | 298 | * @addr: Address to count from |
297 | * | 299 | * |
298 | * This operation is atomic and cannot be reordered. | 300 | * This operation is atomic and cannot be reordered. |
299 | * It also implies a memory barrier. | 301 | * It also implies the acquisition side of the memory barrier. |
300 | */ | 302 | */ |
301 | static __inline__ int | 303 | static __inline__ int |
302 | test_and_change_bit (int nr, volatile void *addr) | 304 | test_and_change_bit (int nr, volatile void *addr) |
@@ -315,8 +317,12 @@ test_and_change_bit (int nr, volatile void *addr) | |||
315 | return (old & bit) != 0; | 317 | return (old & bit) != 0; |
316 | } | 318 | } |
317 | 319 | ||
318 | /* | 320 | /** |
319 | * WARNING: non atomic version. | 321 | * __test_and_change_bit - Change a bit and return its old value |
322 | * @nr: Bit to change | ||
323 | * @addr: Address to count from | ||
324 | * | ||
325 | * This operation is non-atomic and can be reordered. | ||
320 | */ | 326 | */ |
321 | static __inline__ int | 327 | static __inline__ int |
322 | __test_and_change_bit (int nr, void *addr) | 328 | __test_and_change_bit (int nr, void *addr) |
diff --git a/include/asm-ia64/gcc_intrin.h b/include/asm-ia64/gcc_intrin.h index 5b6665c754c9..de2ed2cbdd84 100644 --- a/include/asm-ia64/gcc_intrin.h +++ b/include/asm-ia64/gcc_intrin.h | |||
@@ -24,7 +24,9 @@ | |||
24 | extern void ia64_bad_param_for_setreg (void); | 24 | extern void ia64_bad_param_for_setreg (void); |
25 | extern void ia64_bad_param_for_getreg (void); | 25 | extern void ia64_bad_param_for_getreg (void); |
26 | 26 | ||
27 | #ifdef __KERNEL__ | ||
27 | register unsigned long ia64_r13 asm ("r13") __used; | 28 | register unsigned long ia64_r13 asm ("r13") __used; |
29 | #endif | ||
28 | 30 | ||
29 | #define ia64_setreg(regnum, val) \ | 31 | #define ia64_setreg(regnum, val) \ |
30 | ({ \ | 32 | ({ \ |
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h index 823553bf12e6..f1663aa94a52 100644 --- a/include/asm-ia64/mca.h +++ b/include/asm-ia64/mca.h | |||
@@ -3,9 +3,9 @@ | |||
3 | * Purpose: Machine check handling specific defines | 3 | * Purpose: Machine check handling specific defines |
4 | * | 4 | * |
5 | * Copyright (C) 1999, 2004 Silicon Graphics, Inc. | 5 | * Copyright (C) 1999, 2004 Silicon Graphics, Inc. |
6 | * Copyright (C) Vijay Chander (vijay@engr.sgi.com) | 6 | * Copyright (C) Vijay Chander <vijay@engr.sgi.com> |
7 | * Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) | 7 | * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com> |
8 | * Copyright (C) Russ Anderson (rja@sgi.com) | 8 | * Copyright (C) Russ Anderson <rja@sgi.com> |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef _ASM_IA64_MCA_H | 11 | #ifndef _ASM_IA64_MCA_H |
diff --git a/include/asm-ia64/mca_asm.h b/include/asm-ia64/mca_asm.h index 76203f9a8718..dd2a5b134390 100644 --- a/include/asm-ia64/mca_asm.h +++ b/include/asm-ia64/mca_asm.h | |||
@@ -1,8 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * File: mca_asm.h | 2 | * File: mca_asm.h |
3 | * Purpose: Machine check handling specific defines | ||
3 | * | 4 | * |
4 | * Copyright (C) 1999 Silicon Graphics, Inc. | 5 | * Copyright (C) 1999 Silicon Graphics, Inc. |
5 | * Copyright (C) Vijay Chander (vijay@engr.sgi.com) | 6 | * Copyright (C) Vijay Chander <vijay@engr.sgi.com> |
6 | * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com> | 7 | * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com> |
7 | * Copyright (C) 2000 Hewlett-Packard Co. | 8 | * Copyright (C) 2000 Hewlett-Packard Co. |
8 | * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com> | 9 | * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com> |
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h index 67552cad5173..556d988123ac 100644 --- a/include/asm-ia64/pgalloc.h +++ b/include/asm-ia64/pgalloc.h | |||
@@ -27,7 +27,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
27 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 27 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
28 | } | 28 | } |
29 | 29 | ||
30 | static inline void pgd_free(pgd_t * pgd) | 30 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
31 | { | 31 | { |
32 | quicklist_free(0, NULL, pgd); | 32 | quicklist_free(0, NULL, pgd); |
33 | } | 33 | } |
@@ -44,11 +44,11 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
44 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 44 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
45 | } | 45 | } |
46 | 46 | ||
47 | static inline void pud_free(pud_t * pud) | 47 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
48 | { | 48 | { |
49 | quicklist_free(0, NULL, pud); | 49 | quicklist_free(0, NULL, pud); |
50 | } | 50 | } |
51 | #define __pud_free_tlb(tlb, pud) pud_free(pud) | 51 | #define __pud_free_tlb(tlb, pud) pud_free((tlb)->mm, pud) |
52 | #endif /* CONFIG_PGTABLE_4 */ | 52 | #endif /* CONFIG_PGTABLE_4 */ |
53 | 53 | ||
54 | static inline void | 54 | static inline void |
@@ -62,12 +62,12 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
62 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 62 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
63 | } | 63 | } |
64 | 64 | ||
65 | static inline void pmd_free(pmd_t * pmd) | 65 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
66 | { | 66 | { |
67 | quicklist_free(0, NULL, pmd); | 67 | quicklist_free(0, NULL, pmd); |
68 | } | 68 | } |
69 | 69 | ||
70 | #define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) | 70 | #define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) |
71 | 71 | ||
72 | static inline void | 72 | static inline void |
73 | pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte) | 73 | pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte) |
@@ -94,12 +94,12 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
94 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 94 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline void pte_free(struct page *pte) | 97 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
98 | { | 98 | { |
99 | quicklist_free_page(0, NULL, pte); | 99 | quicklist_free_page(0, NULL, pte); |
100 | } | 100 | } |
101 | 101 | ||
102 | static inline void pte_free_kernel(pte_t * pte) | 102 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
103 | { | 103 | { |
104 | quicklist_free(0, NULL, pte); | 104 | quicklist_free(0, NULL, pte); |
105 | } | 105 | } |
@@ -109,6 +109,6 @@ static inline void check_pgt_cache(void) | |||
109 | quicklist_trim(0, NULL, 25, 16); | 109 | quicklist_trim(0, NULL, 25, 16); |
110 | } | 110 | } |
111 | 111 | ||
112 | #define __pte_free_tlb(tlb, pte) pte_free(pte) | 112 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
113 | 113 | ||
114 | #endif /* _ASM_IA64_PGALLOC_H */ | 114 | #endif /* _ASM_IA64_PGALLOC_H */ |
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index be3b0ae43270..741f7ecb986a 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h | |||
@@ -31,7 +31,8 @@ | |||
31 | * each (assuming 8KB page size), for a total of 8TB of user virtual | 31 | * each (assuming 8KB page size), for a total of 8TB of user virtual |
32 | * address space. | 32 | * address space. |
33 | */ | 33 | */ |
34 | #define TASK_SIZE (current->thread.task_size) | 34 | #define TASK_SIZE_OF(tsk) ((tsk)->thread.task_size) |
35 | #define TASK_SIZE TASK_SIZE_OF(current) | ||
35 | 36 | ||
36 | /* | 37 | /* |
37 | * This decides where the kernel will search for a free chunk of vm | 38 | * This decides where the kernel will search for a free chunk of vm |
@@ -472,7 +473,7 @@ ia64_set_psr (__u64 psr) | |||
472 | { | 473 | { |
473 | ia64_stop(); | 474 | ia64_stop(); |
474 | ia64_setreg(_IA64_REG_PSR_L, psr); | 475 | ia64_setreg(_IA64_REG_PSR_L, psr); |
475 | ia64_srlz_d(); | 476 | ia64_srlz_i(); |
476 | } | 477 | } |
477 | 478 | ||
478 | /* | 479 | /* |
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h index 1f5412d6f9bb..2251118894ae 100644 --- a/include/asm-ia64/sal.h +++ b/include/asm-ia64/sal.h | |||
@@ -649,17 +649,6 @@ typedef struct err_rec { | |||
649 | * Now define a couple of inline functions for improved type checking | 649 | * Now define a couple of inline functions for improved type checking |
650 | * and convenience. | 650 | * and convenience. |
651 | */ | 651 | */ |
652 | static inline long | ||
653 | ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second, | ||
654 | unsigned long *drift_info) | ||
655 | { | ||
656 | struct ia64_sal_retval isrv; | ||
657 | |||
658 | SAL_CALL(isrv, SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0); | ||
659 | *ticks_per_second = isrv.v0; | ||
660 | *drift_info = isrv.v1; | ||
661 | return isrv.status; | ||
662 | } | ||
663 | 652 | ||
664 | extern s64 ia64_sal_cache_flush (u64 cache_type); | 653 | extern s64 ia64_sal_cache_flush (u64 cache_type); |
665 | extern void __init check_sal_cache_flush (void); | 654 | extern void __init check_sal_cache_flush (void); |
@@ -841,6 +830,9 @@ extern int ia64_sal_oemcall_nolock(struct ia64_sal_retval *, u64, u64, u64, | |||
841 | u64, u64, u64, u64, u64); | 830 | u64, u64, u64, u64, u64); |
842 | extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64, | 831 | extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64, |
843 | u64, u64, u64, u64, u64); | 832 | u64, u64, u64, u64, u64); |
833 | extern long | ||
834 | ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second, | ||
835 | unsigned long *drift_info); | ||
844 | #ifdef CONFIG_HOTPLUG_CPU | 836 | #ifdef CONFIG_HOTPLUG_CPU |
845 | /* | 837 | /* |
846 | * System Abstraction Layer Specification | 838 | * System Abstraction Layer Specification |
diff --git a/include/asm-m32r/irq.h b/include/asm-m32r/irq.h index 2f93f4743add..242028b4d86a 100644 --- a/include/asm-m32r/irq.h +++ b/include/asm-m32r/irq.h | |||
@@ -3,7 +3,7 @@ | |||
3 | #define _ASM_M32R_IRQ_H | 3 | #define _ASM_M32R_IRQ_H |
4 | 4 | ||
5 | 5 | ||
6 | #if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_USRV) | 6 | #if defined(CONFIG_PLAT_USRV) |
7 | /* | 7 | /* |
8 | * IRQ definitions for M32700UT | 8 | * IRQ definitions for M32700UT |
9 | * M32700 Chip: 64 interrupts | 9 | * M32700 Chip: 64 interrupts |
diff --git a/include/asm-m32r/m32700ut/m32700ut_pld.h b/include/asm-m32r/m32700ut/m32700ut_pld.h index d39121279a1a..57623beb44cb 100644 --- a/include/asm-m32r/m32700ut/m32700ut_pld.h +++ b/include/asm-m32r/m32700ut/m32700ut_pld.h | |||
@@ -13,9 +13,7 @@ | |||
13 | * this archive for more details. | 13 | * this archive for more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #if defined(CONFIG_PLAT_M32700UT_Alpha) | 16 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) |
17 | #define PLD_PLAT_BASE 0x08c00000 | ||
18 | #elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) | ||
19 | #define PLD_PLAT_BASE 0x04c00000 | 17 | #define PLD_PLAT_BASE 0x04c00000 |
20 | #else | 18 | #else |
21 | #error "no platform configuration" | 19 | #error "no platform configuration" |
diff --git a/include/asm-m32r/pgalloc.h b/include/asm-m32r/pgalloc.h index 943ba63c1ebc..e5921adfad1b 100644 --- a/include/asm-m32r/pgalloc.h +++ b/include/asm-m32r/pgalloc.h | |||
@@ -24,7 +24,7 @@ static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
24 | return pgd; | 24 | return pgd; |
25 | } | 25 | } |
26 | 26 | ||
27 | static __inline__ void pgd_free(pgd_t *pgd) | 27 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
28 | { | 28 | { |
29 | free_page((unsigned long)pgd); | 29 | free_page((unsigned long)pgd); |
30 | } | 30 | } |
@@ -46,17 +46,17 @@ static __inline__ struct page *pte_alloc_one(struct mm_struct *mm, | |||
46 | return pte; | 46 | return pte; |
47 | } | 47 | } |
48 | 48 | ||
49 | static __inline__ void pte_free_kernel(pte_t *pte) | 49 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
50 | { | 50 | { |
51 | free_page((unsigned long)pte); | 51 | free_page((unsigned long)pte); |
52 | } | 52 | } |
53 | 53 | ||
54 | static __inline__ void pte_free(struct page *pte) | 54 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
55 | { | 55 | { |
56 | __free_page(pte); | 56 | __free_page(pte); |
57 | } | 57 | } |
58 | 58 | ||
59 | #define __pte_free_tlb(tlb, pte) pte_free((pte)) | 59 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | 62 | * allocating and freeing a pmd is trivial: the 1-entry pmd is |
@@ -65,7 +65,7 @@ static __inline__ void pte_free(struct page *pte) | |||
65 | */ | 65 | */ |
66 | 66 | ||
67 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) | 67 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) |
68 | #define pmd_free(x) do { } while (0) | 68 | #define pmd_free(mm, x) do { } while (0) |
69 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 69 | #define __pmd_free_tlb(tlb, x) do { } while (0) |
70 | #define pgd_populate(mm, pmd, pte) BUG() | 70 | #define pgd_populate(mm, pmd, pte) BUG() |
71 | 71 | ||
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h index f467eac9ba70..cf701c933249 100644 --- a/include/asm-m32r/unistd.h +++ b/include/asm-m32r/unistd.h | |||
@@ -327,7 +327,7 @@ | |||
327 | #define __NR_epoll_pwait 319 | 327 | #define __NR_epoll_pwait 319 |
328 | #define __NR_utimensat 320 | 328 | #define __NR_utimensat 320 |
329 | #define __NR_signalfd 321 | 329 | #define __NR_signalfd 321 |
330 | #define __NR_timerfd 322 | 330 | /* #define __NR_timerfd 322 removed */ |
331 | #define __NR_eventfd 323 | 331 | #define __NR_eventfd 323 |
332 | #define __NR_fallocate 324 | 332 | #define __NR_fallocate 324 |
333 | 333 | ||
diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h index 27d11da2b479..28b0f49ee521 100644 --- a/include/asm-m68k/macintosh.h +++ b/include/asm-m68k/macintosh.h | |||
@@ -14,8 +14,6 @@ extern void mac_init_IRQ(void); | |||
14 | extern int mac_irq_pending(unsigned int); | 14 | extern int mac_irq_pending(unsigned int); |
15 | extern void mac_identify(void); | 15 | extern void mac_identify(void); |
16 | extern void mac_report_hardware(void); | 16 | extern void mac_report_hardware(void); |
17 | extern void mac_debugging_penguin(int); | ||
18 | extern void mac_boom(int); | ||
19 | 17 | ||
20 | /* | 18 | /* |
21 | * Floppy driver magic hook - probably shouldnt be here | 19 | * Floppy driver magic hook - probably shouldnt be here |
diff --git a/include/asm-m68k/motorola_pgalloc.h b/include/asm-m68k/motorola_pgalloc.h index 5158412cd54d..500ec9b8b189 100644 --- a/include/asm-m68k/motorola_pgalloc.h +++ b/include/asm-m68k/motorola_pgalloc.h | |||
@@ -22,7 +22,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long ad | |||
22 | return pte; | 22 | return pte; |
23 | } | 23 | } |
24 | 24 | ||
25 | static inline void pte_free_kernel(pte_t *pte) | 25 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
26 | { | 26 | { |
27 | cache_page(pte); | 27 | cache_page(pte); |
28 | free_page((unsigned long) pte); | 28 | free_page((unsigned long) pte); |
@@ -47,7 +47,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add | |||
47 | return page; | 47 | return page; |
48 | } | 48 | } |
49 | 49 | ||
50 | static inline void pte_free(struct page *page) | 50 | static inline void pte_free(struct mm_struct *mm, struct page *page) |
51 | { | 51 | { |
52 | cache_page(kmap(page)); | 52 | cache_page(kmap(page)); |
53 | kunmap(page); | 53 | kunmap(page); |
@@ -67,7 +67,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
67 | return get_pointer_table(); | 67 | return get_pointer_table(); |
68 | } | 68 | } |
69 | 69 | ||
70 | static inline int pmd_free(pmd_t *pmd) | 70 | static inline int pmd_free(struct mm_struct *mm, pmd_t *pmd) |
71 | { | 71 | { |
72 | return free_pointer_table(pmd); | 72 | return free_pointer_table(pmd); |
73 | } | 73 | } |
@@ -78,9 +78,9 @@ static inline int __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | |||
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | static inline void pgd_free(pgd_t *pgd) | 81 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
82 | { | 82 | { |
83 | pmd_free((pmd_t *)pgd); | 83 | pmd_free(mm, (pmd_t *)pgd); |
84 | } | 84 | } |
85 | 85 | ||
86 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | 86 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
diff --git a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h index fd8241117649..a5a91e72714b 100644 --- a/include/asm-m68k/sun3_pgalloc.h +++ b/include/asm-m68k/sun3_pgalloc.h | |||
@@ -21,12 +21,12 @@ extern const char bad_pmd_string[]; | |||
21 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) | 21 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) |
22 | 22 | ||
23 | 23 | ||
24 | static inline void pte_free_kernel(pte_t * pte) | 24 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
25 | { | 25 | { |
26 | free_page((unsigned long) pte); | 26 | free_page((unsigned long) pte); |
27 | } | 27 | } |
28 | 28 | ||
29 | static inline void pte_free(struct page *page) | 29 | static inline void pte_free(struct mm_struct *mm, struct page *page) |
30 | { | 30 | { |
31 | __free_page(page); | 31 | __free_page(page); |
32 | } | 32 | } |
@@ -72,10 +72,10 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p | |||
72 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | 72 | * allocating and freeing a pmd is trivial: the 1-entry pmd is |
73 | * inside the pgd, so has no extra memory associated with it. | 73 | * inside the pgd, so has no extra memory associated with it. |
74 | */ | 74 | */ |
75 | #define pmd_free(x) do { } while (0) | 75 | #define pmd_free(mm, x) do { } while (0) |
76 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 76 | #define __pmd_free_tlb(tlb, x) do { } while (0) |
77 | 77 | ||
78 | static inline void pgd_free(pgd_t * pgd) | 78 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
79 | { | 79 | { |
80 | free_page((unsigned long) pgd); | 80 | free_page((unsigned long) pgd); |
81 | } | 81 | } |
diff --git a/include/asm-m68knommu/mcfne.h b/include/asm-m68knommu/mcfne.h index c920ccdb61fe..431f63aadd0e 100644 --- a/include/asm-m68knommu/mcfne.h +++ b/include/asm-m68knommu/mcfne.h | |||
@@ -60,17 +60,6 @@ | |||
60 | #define NE2000_BYTE volatile unsigned char | 60 | #define NE2000_BYTE volatile unsigned char |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | #if defined(CONFIG_CFV240) | ||
64 | #define NE2000_ADDR 0x40010000 | ||
65 | #define NE2000_ADDR1 0x40010001 | ||
66 | #define NE2000_ODDOFFSET 0x00000000 | ||
67 | #define NE2000_IRQ 1 | ||
68 | #define NE2000_IRQ_VECTOR 0x19 | ||
69 | #define NE2000_IRQ_PRIORITY 2 | ||
70 | #define NE2000_IRQ_LEVEL 1 | ||
71 | #define NE2000_BYTE volatile unsigned char | ||
72 | #endif | ||
73 | |||
74 | #if defined(CONFIG_M5307C3) | 63 | #if defined(CONFIG_M5307C3) |
75 | #define NE2000_ADDR 0x40000300 | 64 | #define NE2000_ADDR 0x40000300 |
76 | #define NE2000_ODDOFFSET 0x00010000 | 65 | #define NE2000_ODDOFFSET 0x00010000 |
@@ -173,13 +162,8 @@ void ne2000_outsw(unsigned int addr, void *vbuf, unsigned long len); | |||
173 | * On most NE2000 implementations on ColdFire boards the chip is | 162 | * On most NE2000 implementations on ColdFire boards the chip is |
174 | * mapped in kinda funny, due to its ISA heritage. | 163 | * mapped in kinda funny, due to its ISA heritage. |
175 | */ | 164 | */ |
176 | #ifdef CONFIG_CFV240 | ||
177 | #define NE2000_PTR(addr) (NE2000_ADDR + ((addr & 0x3f) << 1) + 1) | ||
178 | #define NE2000_DATA_PTR(addr) (NE2000_ADDR + ((addr & 0x3f) << 1)) | ||
179 | #else | ||
180 | #define NE2000_PTR(addr) ((addr&0x1)?(NE2000_ODDOFFSET+addr-1):(addr)) | 165 | #define NE2000_PTR(addr) ((addr&0x1)?(NE2000_ODDOFFSET+addr-1):(addr)) |
181 | #define NE2000_DATA_PTR(addr) (addr) | 166 | #define NE2000_DATA_PTR(addr) (addr) |
182 | #endif | ||
183 | 167 | ||
184 | 168 | ||
185 | void ne2000_outb(unsigned int val, unsigned int addr) | 169 | void ne2000_outb(unsigned int val, unsigned int addr) |
@@ -285,17 +269,6 @@ void ne2000_irqsetup(int irq) | |||
285 | } | 269 | } |
286 | #endif | 270 | #endif |
287 | 271 | ||
288 | #if defined(CONFIG_CFV240) | ||
289 | void ne2000_irqsetup(int irq) | ||
290 | { | ||
291 | volatile unsigned char *icrp; | ||
292 | |||
293 | icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR1); | ||
294 | *icrp = MCFSIM_ICR_LEVEL1 | MCFSIM_ICR_PRI2 | MCFSIM_ICR_AUTOVEC; | ||
295 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT1); | ||
296 | } | ||
297 | #endif | ||
298 | |||
299 | #if defined(CONFIG_M5206e) && defined(CONFIG_NETtel) | 272 | #if defined(CONFIG_M5206e) && defined(CONFIG_NETtel) |
300 | void ne2000_irqsetup(int irq) | 273 | void ne2000_irqsetup(int irq) |
301 | { | 274 | { |
diff --git a/include/asm-m68knommu/mcfsim.h b/include/asm-m68knommu/mcfsim.h index 1074ae717f74..da3f2ceff3a4 100644 --- a/include/asm-m68knommu/mcfsim.h +++ b/include/asm-m68knommu/mcfsim.h | |||
@@ -17,9 +17,7 @@ | |||
17 | * Include 5204, 5206/e, 5235, 5249, 5270/5271, 5272, 5280/5282, | 17 | * Include 5204, 5206/e, 5235, 5249, 5270/5271, 5272, 5280/5282, |
18 | * 5307 or 5407 specific addresses. | 18 | * 5307 or 5407 specific addresses. |
19 | */ | 19 | */ |
20 | #if defined(CONFIG_M5204) | 20 | #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) |
21 | #include <asm/m5204sim.h> | ||
22 | #elif defined(CONFIG_M5206) || defined(CONFIG_M5206e) | ||
23 | #include <asm/m5206sim.h> | 21 | #include <asm/m5206sim.h> |
24 | #elif defined(CONFIG_M520x) | 22 | #elif defined(CONFIG_M520x) |
25 | #include <asm/m520xsim.h> | 23 | #include <asm/m520xsim.h> |
diff --git a/include/asm-m68knommu/mcftimer.h b/include/asm-m68knommu/mcftimer.h index 6f4d796e03db..0f90f6d2227a 100644 --- a/include/asm-m68knommu/mcftimer.h +++ b/include/asm-m68knommu/mcftimer.h | |||
@@ -16,7 +16,7 @@ | |||
16 | /* | 16 | /* |
17 | * Get address specific defines for this ColdFire member. | 17 | * Get address specific defines for this ColdFire member. |
18 | */ | 18 | */ |
19 | #if defined(CONFIG_M5204) || defined(CONFIG_M5206) || defined(CONFIG_M5206e) | 19 | #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) |
20 | #define MCFTIMER_BASE1 0x100 /* Base address of TIMER1 */ | 20 | #define MCFTIMER_BASE1 0x100 /* Base address of TIMER1 */ |
21 | #define MCFTIMER_BASE2 0x120 /* Base address of TIMER2 */ | 21 | #define MCFTIMER_BASE2 0x120 /* Base address of TIMER2 */ |
22 | #elif defined(CONFIG_M5272) | 22 | #elif defined(CONFIG_M5272) |
diff --git a/include/asm-m68knommu/mcfuart.h b/include/asm-m68knommu/mcfuart.h index 8a7a67703ac3..ef2293873612 100644 --- a/include/asm-m68knommu/mcfuart.h +++ b/include/asm-m68knommu/mcfuart.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #if defined(CONFIG_M5272) | 19 | #if defined(CONFIG_M5272) |
20 | #define MCFUART_BASE1 0x100 /* Base address of UART1 */ | 20 | #define MCFUART_BASE1 0x100 /* Base address of UART1 */ |
21 | #define MCFUART_BASE2 0x140 /* Base address of UART2 */ | 21 | #define MCFUART_BASE2 0x140 /* Base address of UART2 */ |
22 | #elif defined(CONFIG_M5204) || defined(CONFIG_M5206) || defined(CONFIG_M5206e) | 22 | #elif defined(CONFIG_M5206) || defined(CONFIG_M5206e) |
23 | #if defined(CONFIG_NETtel) | 23 | #if defined(CONFIG_NETtel) |
24 | #define MCFUART_BASE1 0x180 /* Base address of UART1 */ | 24 | #define MCFUART_BASE1 0x180 /* Base address of UART1 */ |
25 | #define MCFUART_BASE2 0x140 /* Base address of UART2 */ | 25 | #define MCFUART_BASE2 0x140 /* Base address of UART2 */ |
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h index 15b4c7d45c94..ee2dc07bae0e 100644 --- a/include/asm-m68knommu/system.h +++ b/include/asm-m68knommu/system.h | |||
@@ -207,23 +207,6 @@ cmpxchg(volatile int *p, int old, int new) | |||
207 | } | 207 | } |
208 | 208 | ||
209 | 209 | ||
210 | #ifdef CONFIG_M68332 | ||
211 | #define HARD_RESET_NOW() ({ \ | ||
212 | local_irq_disable(); \ | ||
213 | asm(" \ | ||
214 | movew #0x0000, 0xfffa6a; \ | ||
215 | reset; \ | ||
216 | /*movew #0x1557, 0xfffa44;*/ \ | ||
217 | /*movew #0x0155, 0xfffa46;*/ \ | ||
218 | moveal #0, %a0; \ | ||
219 | movec %a0, %vbr; \ | ||
220 | moveal 0, %sp; \ | ||
221 | moveal 4, %a0; \ | ||
222 | jmp (%a0); \ | ||
223 | "); \ | ||
224 | }) | ||
225 | #endif | ||
226 | |||
227 | #if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \ | 210 | #if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \ |
228 | defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 ) | 211 | defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 ) |
229 | #define HARD_RESET_NOW() ({ \ | 212 | #define HARD_RESET_NOW() ({ \ |
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h index 81b72122207a..c4efeced8396 100644 --- a/include/asm-mips/pgalloc.h +++ b/include/asm-mips/pgalloc.h | |||
@@ -58,7 +58,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
58 | return ret; | 58 | return ret; |
59 | } | 59 | } |
60 | 60 | ||
61 | static inline void pgd_free(pgd_t *pgd) | 61 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
62 | { | 62 | { |
63 | free_pages((unsigned long)pgd, PGD_ORDER); | 63 | free_pages((unsigned long)pgd, PGD_ORDER); |
64 | } | 64 | } |
@@ -85,12 +85,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
85 | return pte; | 85 | return pte; |
86 | } | 86 | } |
87 | 87 | ||
88 | static inline void pte_free_kernel(pte_t *pte) | 88 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
89 | { | 89 | { |
90 | free_pages((unsigned long)pte, PTE_ORDER); | 90 | free_pages((unsigned long)pte, PTE_ORDER); |
91 | } | 91 | } |
92 | 92 | ||
93 | static inline void pte_free(struct page *pte) | 93 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
94 | { | 94 | { |
95 | __free_pages(pte, PTE_ORDER); | 95 | __free_pages(pte, PTE_ORDER); |
96 | } | 96 | } |
@@ -103,7 +103,7 @@ static inline void pte_free(struct page *pte) | |||
103 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | 103 | * allocating and freeing a pmd is trivial: the 1-entry pmd is |
104 | * inside the pgd, so has no extra memory associated with it. | 104 | * inside the pgd, so has no extra memory associated with it. |
105 | */ | 105 | */ |
106 | #define pmd_free(x) do { } while (0) | 106 | #define pmd_free(mm, x) do { } while (0) |
107 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 107 | #define __pmd_free_tlb(tlb, x) do { } while (0) |
108 | 108 | ||
109 | #endif | 109 | #endif |
@@ -120,12 +120,12 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
120 | return pmd; | 120 | return pmd; |
121 | } | 121 | } |
122 | 122 | ||
123 | static inline void pmd_free(pmd_t *pmd) | 123 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
124 | { | 124 | { |
125 | free_pages((unsigned long)pmd, PMD_ORDER); | 125 | free_pages((unsigned long)pmd, PMD_ORDER); |
126 | } | 126 | } |
127 | 127 | ||
128 | #define __pmd_free_tlb(tlb, x) pmd_free(x) | 128 | #define __pmd_free_tlb(tlb, x) pmd_free((tlb)->mm, x) |
129 | 129 | ||
130 | #endif | 130 | #endif |
131 | 131 | ||
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 83bc94534084..36f42de59409 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h | |||
@@ -65,6 +65,8 @@ extern unsigned int vced_count, vcei_count; | |||
65 | #define TASK_UNMAPPED_BASE \ | 65 | #define TASK_UNMAPPED_BASE \ |
66 | (test_thread_flag(TIF_32BIT_ADDR) ? \ | 66 | (test_thread_flag(TIF_32BIT_ADDR) ? \ |
67 | PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3)) | 67 | PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3)) |
68 | #define TASK_SIZE_OF(tsk) \ | ||
69 | (test_tsk_thread_flag(tsk, TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE) | ||
68 | #endif | 70 | #endif |
69 | 71 | ||
70 | #define NUM_FPU_REGS 32 | 72 | #define NUM_FPU_REGS 32 |
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h index 1af1a41e0723..aab66f1bea14 100644 --- a/include/asm-parisc/pgalloc.h +++ b/include/asm-parisc/pgalloc.h | |||
@@ -43,7 +43,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
43 | return actual_pgd; | 43 | return actual_pgd; |
44 | } | 44 | } |
45 | 45 | ||
46 | static inline void pgd_free(pgd_t *pgd) | 46 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
47 | { | 47 | { |
48 | #ifdef CONFIG_64BIT | 48 | #ifdef CONFIG_64BIT |
49 | pgd -= PTRS_PER_PGD; | 49 | pgd -= PTRS_PER_PGD; |
@@ -70,7 +70,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
70 | return pmd; | 70 | return pmd; |
71 | } | 71 | } |
72 | 72 | ||
73 | static inline void pmd_free(pmd_t *pmd) | 73 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
74 | { | 74 | { |
75 | #ifdef CONFIG_64BIT | 75 | #ifdef CONFIG_64BIT |
76 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) | 76 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) |
@@ -91,7 +91,7 @@ static inline void pmd_free(pmd_t *pmd) | |||
91 | */ | 91 | */ |
92 | 92 | ||
93 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) | 93 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) |
94 | #define pmd_free(x) do { } while (0) | 94 | #define pmd_free(mm, x) do { } while (0) |
95 | #define pgd_populate(mm, pmd, pte) BUG() | 95 | #define pgd_populate(mm, pmd, pte) BUG() |
96 | 96 | ||
97 | #endif | 97 | #endif |
@@ -130,12 +130,12 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) | |||
130 | return pte; | 130 | return pte; |
131 | } | 131 | } |
132 | 132 | ||
133 | static inline void pte_free_kernel(pte_t *pte) | 133 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
134 | { | 134 | { |
135 | free_page((unsigned long)pte); | 135 | free_page((unsigned long)pte); |
136 | } | 136 | } |
137 | 137 | ||
138 | #define pte_free(page) pte_free_kernel(page_address(page)) | 138 | #define pte_free(mm, page) pte_free_kernel(page_address(page)) |
139 | 139 | ||
140 | #define check_pgt_cache() do { } while (0) | 140 | #define check_pgt_cache() do { } while (0) |
141 | 141 | ||
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index 6b294fb07a23..3bb06e898fde 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h | |||
@@ -32,7 +32,8 @@ | |||
32 | #endif | 32 | #endif |
33 | #define current_text_addr() ({ void *pc; current_ia(pc); pc; }) | 33 | #define current_text_addr() ({ void *pc; current_ia(pc); pc; }) |
34 | 34 | ||
35 | #define TASK_SIZE (current->thread.task_size) | 35 | #define TASK_SIZE_OF(tsk) ((tsk)->thread.task_size) |
36 | #define TASK_SIZE TASK_SIZE_OF(current) | ||
36 | #define TASK_UNMAPPED_BASE (current->thread.map_base) | 37 | #define TASK_UNMAPPED_BASE (current->thread.map_base) |
37 | 38 | ||
38 | #define DEFAULT_TASK_SIZE32 (0xFFF00000UL) | 39 | #define DEFAULT_TASK_SIZE32 (0xFFF00000UL) |
diff --git a/include/asm-parisc/tlb.h b/include/asm-parisc/tlb.h index 33107a248e1f..383b1db310ee 100644 --- a/include/asm-parisc/tlb.h +++ b/include/asm-parisc/tlb.h | |||
@@ -21,7 +21,7 @@ do { if (!(tlb)->fullmm) \ | |||
21 | 21 | ||
22 | #include <asm-generic/tlb.h> | 22 | #include <asm-generic/tlb.h> |
23 | 23 | ||
24 | #define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) | 24 | #define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) |
25 | #define __pte_free_tlb(tlb, pte) pte_free(pte) | 25 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
26 | 26 | ||
27 | #endif | 27 | #endif |
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h index 7a3cef785abd..852e15f51a1e 100644 --- a/include/asm-powerpc/iommu.h +++ b/include/asm-powerpc/iommu.h | |||
@@ -79,19 +79,19 @@ extern void iommu_free_table(struct iommu_table *tbl, const char *node_name); | |||
79 | extern struct iommu_table *iommu_init_table(struct iommu_table * tbl, | 79 | extern struct iommu_table *iommu_init_table(struct iommu_table * tbl, |
80 | int nid); | 80 | int nid); |
81 | 81 | ||
82 | extern int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | 82 | extern int iommu_map_sg(struct device *dev, struct scatterlist *sglist, |
83 | int nelems, unsigned long mask, | 83 | int nelems, unsigned long mask, |
84 | enum dma_data_direction direction); | 84 | enum dma_data_direction direction); |
85 | extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | 85 | extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, |
86 | int nelems, enum dma_data_direction direction); | 86 | int nelems, enum dma_data_direction direction); |
87 | 87 | ||
88 | extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, | 88 | extern void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl, |
89 | dma_addr_t *dma_handle, unsigned long mask, | 89 | size_t size, dma_addr_t *dma_handle, |
90 | gfp_t flag, int node); | 90 | unsigned long mask, gfp_t flag, int node); |
91 | extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, | 91 | extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, |
92 | void *vaddr, dma_addr_t dma_handle); | 92 | void *vaddr, dma_addr_t dma_handle); |
93 | extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, | 93 | extern dma_addr_t iommu_map_single(struct device *dev, struct iommu_table *tbl, |
94 | size_t size, unsigned long mask, | 94 | void *vaddr, size_t size, unsigned long mask, |
95 | enum dma_data_direction direction); | 95 | enum dma_data_direction direction); |
96 | extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, | 96 | extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, |
97 | size_t size, enum dma_data_direction direction); | 97 | size_t size, enum dma_data_direction direction); |
diff --git a/include/asm-powerpc/mediabay.h b/include/asm-powerpc/mediabay.h index 9daa3252d7b6..de83fe196309 100644 --- a/include/asm-powerpc/mediabay.h +++ b/include/asm-powerpc/mediabay.h | |||
@@ -18,14 +18,14 @@ | |||
18 | #define MB_NO 7 /* media bay contains nothing */ | 18 | #define MB_NO 7 /* media bay contains nothing */ |
19 | 19 | ||
20 | int check_media_bay(struct device_node *which_bay, int what); | 20 | int check_media_bay(struct device_node *which_bay, int what); |
21 | int check_media_bay_by_base(unsigned long base, int what); | ||
22 | 21 | ||
23 | /* Number of bays in the machine or 0 */ | 22 | /* Number of bays in the machine or 0 */ |
24 | extern int media_bay_count; | 23 | extern int media_bay_count; |
25 | 24 | ||
26 | /* called by pmac-ide.c to register IDE controller for media bay */ | 25 | int check_media_bay_by_base(unsigned long base, int what); |
27 | extern int media_bay_set_ide_infos(struct device_node* which_bay, | 26 | /* called by IDE PMAC host driver to register IDE controller for media bay */ |
28 | unsigned long base, int irq, int index); | 27 | int media_bay_set_ide_infos(struct device_node *which_bay, unsigned long base, |
28 | int irq, int index); | ||
29 | 29 | ||
30 | #endif /* __KERNEL__ */ | 30 | #endif /* __KERNEL__ */ |
31 | #endif /* _PPC_MEDIABAY_H */ | 31 | #endif /* _PPC_MEDIABAY_H */ |
diff --git a/include/asm-powerpc/nvram.h b/include/asm-powerpc/nvram.h index 4e7059cc6113..efde5ac82f7b 100644 --- a/include/asm-powerpc/nvram.h +++ b/include/asm-powerpc/nvram.h | |||
@@ -58,6 +58,9 @@ struct nvram_header { | |||
58 | }; | 58 | }; |
59 | 59 | ||
60 | #ifdef __KERNEL__ | 60 | #ifdef __KERNEL__ |
61 | |||
62 | #include <linux/list.h> | ||
63 | |||
61 | struct nvram_partition { | 64 | struct nvram_partition { |
62 | struct list_head partition; | 65 | struct list_head partition; |
63 | struct nvram_header header; | 66 | struct nvram_header header; |
diff --git a/include/asm-powerpc/pgalloc-32.h b/include/asm-powerpc/pgalloc-32.h index e1307432163c..c162a4c37b39 100644 --- a/include/asm-powerpc/pgalloc-32.h +++ b/include/asm-powerpc/pgalloc-32.h | |||
@@ -6,14 +6,14 @@ | |||
6 | extern void __bad_pte(pmd_t *pmd); | 6 | extern void __bad_pte(pmd_t *pmd); |
7 | 7 | ||
8 | extern pgd_t *pgd_alloc(struct mm_struct *mm); | 8 | extern pgd_t *pgd_alloc(struct mm_struct *mm); |
9 | extern void pgd_free(pgd_t *pgd); | 9 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * We don't have any real pmd's, and this code never triggers because | 12 | * We don't have any real pmd's, and this code never triggers because |
13 | * the pgd will always be present.. | 13 | * the pgd will always be present.. |
14 | */ | 14 | */ |
15 | /* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */ | 15 | /* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */ |
16 | #define pmd_free(x) do { } while (0) | 16 | #define pmd_free(mm, x) do { } while (0) |
17 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 17 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
18 | /* #define pgd_populate(mm, pmd, pte) BUG() */ | 18 | /* #define pgd_populate(mm, pmd, pte) BUG() */ |
19 | 19 | ||
@@ -31,10 +31,10 @@ extern void pgd_free(pgd_t *pgd); | |||
31 | 31 | ||
32 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); | 32 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); |
33 | extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); | 33 | extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); |
34 | extern void pte_free_kernel(pte_t *pte); | 34 | extern void pte_free_kernel(struct mm_struct *mm, pte_t *pte); |
35 | extern void pte_free(struct page *pte); | 35 | extern void pte_free(struct mm_struct *mm, struct page *pte); |
36 | 36 | ||
37 | #define __pte_free_tlb(tlb, pte) pte_free((pte)) | 37 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) |
38 | 38 | ||
39 | #define check_pgt_cache() do { } while (0) | 39 | #define check_pgt_cache() do { } while (0) |
40 | 40 | ||
diff --git a/include/asm-powerpc/pgalloc-64.h b/include/asm-powerpc/pgalloc-64.h index 43214c8085b7..5afae8593931 100644 --- a/include/asm-powerpc/pgalloc-64.h +++ b/include/asm-powerpc/pgalloc-64.h | |||
@@ -29,7 +29,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
29 | return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL); | 29 | return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL); |
30 | } | 30 | } |
31 | 31 | ||
32 | static inline void pgd_free(pgd_t *pgd) | 32 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
33 | { | 33 | { |
34 | subpage_prot_free(pgd); | 34 | subpage_prot_free(pgd); |
35 | kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd); | 35 | kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd); |
@@ -45,7 +45,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
45 | GFP_KERNEL|__GFP_REPEAT); | 45 | GFP_KERNEL|__GFP_REPEAT); |
46 | } | 46 | } |
47 | 47 | ||
48 | static inline void pud_free(pud_t *pud) | 48 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
49 | { | 49 | { |
50 | kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud); | 50 | kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud); |
51 | } | 51 | } |
@@ -81,7 +81,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
81 | GFP_KERNEL|__GFP_REPEAT); | 81 | GFP_KERNEL|__GFP_REPEAT); |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline void pmd_free(pmd_t *pmd) | 84 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
85 | { | 85 | { |
86 | kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd); | 86 | kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd); |
87 | } | 87 | } |
@@ -99,12 +99,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
99 | return pte ? virt_to_page(pte) : NULL; | 99 | return pte ? virt_to_page(pte) : NULL; |
100 | } | 100 | } |
101 | 101 | ||
102 | static inline void pte_free_kernel(pte_t *pte) | 102 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
103 | { | 103 | { |
104 | free_page((unsigned long)pte); | 104 | free_page((unsigned long)pte); |
105 | } | 105 | } |
106 | 106 | ||
107 | static inline void pte_free(struct page *ptepage) | 107 | static inline void pte_free(struct mm_struct *mm, struct page *ptepage) |
108 | { | 108 | { |
109 | __free_page(ptepage); | 109 | __free_page(ptepage); |
110 | } | 110 | } |
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index dba7c948189d..1f4765d6546f 100644 --- a/include/asm-powerpc/processor.h +++ b/include/asm-powerpc/processor.h | |||
@@ -99,8 +99,9 @@ extern struct task_struct *last_task_used_spe; | |||
99 | */ | 99 | */ |
100 | #define TASK_SIZE_USER32 (0x0000000100000000UL - (1*PAGE_SIZE)) | 100 | #define TASK_SIZE_USER32 (0x0000000100000000UL - (1*PAGE_SIZE)) |
101 | 101 | ||
102 | #define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ | 102 | #define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \ |
103 | TASK_SIZE_USER32 : TASK_SIZE_USER64) | 103 | TASK_SIZE_USER32 : TASK_SIZE_USER64) |
104 | #define TASK_SIZE TASK_SIZE_OF(current) | ||
104 | 105 | ||
105 | /* This decides where the kernel will search for a free chunk of vm | 106 | /* This decides where the kernel will search for a free chunk of vm |
106 | * space during mmap's. | 107 | * space during mmap's. |
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h index 0c8b0d679139..e996521fb3a6 100644 --- a/include/asm-powerpc/systbl.h +++ b/include/asm-powerpc/systbl.h | |||
@@ -309,7 +309,7 @@ SYSCALL_SPU(getcpu) | |||
309 | COMPAT_SYS(epoll_pwait) | 309 | COMPAT_SYS(epoll_pwait) |
310 | COMPAT_SYS_SPU(utimensat) | 310 | COMPAT_SYS_SPU(utimensat) |
311 | COMPAT_SYS_SPU(signalfd) | 311 | COMPAT_SYS_SPU(signalfd) |
312 | COMPAT_SYS_SPU(timerfd) | 312 | SYSCALL(ni_syscall) |
313 | SYSCALL_SPU(eventfd) | 313 | SYSCALL_SPU(eventfd) |
314 | COMPAT_SYS_SPU(sync_file_range2) | 314 | COMPAT_SYS_SPU(sync_file_range2) |
315 | COMPAT_SYS(fallocate) | 315 | COMPAT_SYS(fallocate) |
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h index 9204c15839c5..56512a968dab 100644 --- a/include/asm-powerpc/vio.h +++ b/include/asm-powerpc/vio.h | |||
@@ -66,7 +66,7 @@ extern void __devinit vio_unregister_device(struct vio_dev *dev); | |||
66 | 66 | ||
67 | struct device_node; | 67 | struct device_node; |
68 | 68 | ||
69 | extern struct vio_dev * __devinit vio_register_device_node( | 69 | extern struct vio_dev *vio_register_device_node( |
70 | struct device_node *node_vdev); | 70 | struct device_node *node_vdev); |
71 | extern const void *vio_get_attribute(struct vio_dev *vdev, char *which, | 71 | extern const void *vio_get_attribute(struct vio_dev *vdev, char *which, |
72 | int *length); | 72 | int *length); |
diff --git a/include/asm-ppc/pgalloc.h b/include/asm-ppc/pgalloc.h index 44d88a98e87c..7c39a95829c7 100644 --- a/include/asm-ppc/pgalloc.h +++ b/include/asm-ppc/pgalloc.h | |||
@@ -7,14 +7,14 @@ | |||
7 | extern void __bad_pte(pmd_t *pmd); | 7 | extern void __bad_pte(pmd_t *pmd); |
8 | 8 | ||
9 | extern pgd_t *pgd_alloc(struct mm_struct *mm); | 9 | extern pgd_t *pgd_alloc(struct mm_struct *mm); |
10 | extern void pgd_free(pgd_t *pgd); | 10 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * We don't have any real pmd's, and this code never triggers because | 13 | * We don't have any real pmd's, and this code never triggers because |
14 | * the pgd will always be present.. | 14 | * the pgd will always be present.. |
15 | */ | 15 | */ |
16 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) | 16 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) |
17 | #define pmd_free(x) do { } while (0) | 17 | #define pmd_free(mm, x) do { } while (0) |
18 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 18 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
19 | #define pgd_populate(mm, pmd, pte) BUG() | 19 | #define pgd_populate(mm, pmd, pte) BUG() |
20 | 20 | ||
@@ -32,10 +32,10 @@ extern void pgd_free(pgd_t *pgd); | |||
32 | 32 | ||
33 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); | 33 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); |
34 | extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); | 34 | extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); |
35 | extern void pte_free_kernel(pte_t *pte); | 35 | extern void pte_free_kernel(struct mm_struct *mm, pte_t *pte); |
36 | extern void pte_free(struct page *pte); | 36 | extern void pte_free(struct mm_struct *mm, struct page *pte); |
37 | 37 | ||
38 | #define __pte_free_tlb(tlb, pte) pte_free((pte)) | 38 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) |
39 | 39 | ||
40 | #define check_pgt_cache() do { } while (0) | 40 | #define check_pgt_cache() do { } while (0) |
41 | 41 | ||
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h index dba6fecad0be..882db054110c 100644 --- a/include/asm-s390/bitops.h +++ b/include/asm-s390/bitops.h | |||
@@ -440,242 +440,256 @@ __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) { | |||
440 | __test_bit((nr),(addr)) ) | 440 | __test_bit((nr),(addr)) ) |
441 | 441 | ||
442 | /* | 442 | /* |
443 | * ffz = Find First Zero in word. Undefined if no zero exists, | 443 | * Optimized find bit helper functions. |
444 | * so code should check against ~0UL first.. | ||
445 | */ | 444 | */ |
446 | static inline unsigned long ffz(unsigned long word) | 445 | |
446 | /** | ||
447 | * __ffz_word_loop - find byte offset of first long != -1UL | ||
448 | * @addr: pointer to array of unsigned long | ||
449 | * @size: size of the array in bits | ||
450 | */ | ||
451 | static inline unsigned long __ffz_word_loop(const unsigned long *addr, | ||
452 | unsigned long size) | ||
447 | { | 453 | { |
448 | unsigned long bit = 0; | 454 | typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; |
455 | unsigned long bytes = 0; | ||
449 | 456 | ||
457 | asm volatile( | ||
458 | #ifndef __s390x__ | ||
459 | " ahi %1,31\n" | ||
460 | " srl %1,5\n" | ||
461 | "0: c %2,0(%0,%3)\n" | ||
462 | " jne 1f\n" | ||
463 | " la %0,4(%0)\n" | ||
464 | " brct %1,0b\n" | ||
465 | "1:\n" | ||
466 | #else | ||
467 | " aghi %1,63\n" | ||
468 | " srlg %1,%1,6\n" | ||
469 | "0: cg %2,0(%0,%3)\n" | ||
470 | " jne 1f\n" | ||
471 | " la %0,8(%0)\n" | ||
472 | " brct %1,0b\n" | ||
473 | "1:\n" | ||
474 | #endif | ||
475 | : "+a" (bytes), "+d" (size) | ||
476 | : "d" (-1UL), "a" (addr), "m" (*(addrtype *) addr) | ||
477 | : "cc" ); | ||
478 | return bytes; | ||
479 | } | ||
480 | |||
481 | /** | ||
482 | * __ffs_word_loop - find byte offset of first long != 0UL | ||
483 | * @addr: pointer to array of unsigned long | ||
484 | * @size: size of the array in bits | ||
485 | */ | ||
486 | static inline unsigned long __ffs_word_loop(const unsigned long *addr, | ||
487 | unsigned long size) | ||
488 | { | ||
489 | typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; | ||
490 | unsigned long bytes = 0; | ||
491 | |||
492 | asm volatile( | ||
493 | #ifndef __s390x__ | ||
494 | " ahi %1,31\n" | ||
495 | " srl %1,5\n" | ||
496 | "0: c %2,0(%0,%3)\n" | ||
497 | " jne 1f\n" | ||
498 | " la %0,4(%0)\n" | ||
499 | " brct %1,0b\n" | ||
500 | "1:\n" | ||
501 | #else | ||
502 | " aghi %1,63\n" | ||
503 | " srlg %1,%1,6\n" | ||
504 | "0: cg %2,0(%0,%3)\n" | ||
505 | " jne 1f\n" | ||
506 | " la %0,8(%0)\n" | ||
507 | " brct %1,0b\n" | ||
508 | "1:\n" | ||
509 | #endif | ||
510 | : "+a" (bytes), "+a" (size) | ||
511 | : "d" (0UL), "a" (addr), "m" (*(addrtype *) addr) | ||
512 | : "cc" ); | ||
513 | return bytes; | ||
514 | } | ||
515 | |||
516 | /** | ||
517 | * __ffz_word - add number of the first unset bit | ||
518 | * @nr: base value the bit number is added to | ||
519 | * @word: the word that is searched for unset bits | ||
520 | */ | ||
521 | static inline unsigned long __ffz_word(unsigned long nr, unsigned long word) | ||
522 | { | ||
450 | #ifdef __s390x__ | 523 | #ifdef __s390x__ |
451 | if (likely((word & 0xffffffff) == 0xffffffff)) { | 524 | if (likely((word & 0xffffffff) == 0xffffffff)) { |
452 | word >>= 32; | 525 | word >>= 32; |
453 | bit += 32; | 526 | nr += 32; |
454 | } | 527 | } |
455 | #endif | 528 | #endif |
456 | if (likely((word & 0xffff) == 0xffff)) { | 529 | if (likely((word & 0xffff) == 0xffff)) { |
457 | word >>= 16; | 530 | word >>= 16; |
458 | bit += 16; | 531 | nr += 16; |
459 | } | 532 | } |
460 | if (likely((word & 0xff) == 0xff)) { | 533 | if (likely((word & 0xff) == 0xff)) { |
461 | word >>= 8; | 534 | word >>= 8; |
462 | bit += 8; | 535 | nr += 8; |
463 | } | 536 | } |
464 | return bit + _zb_findmap[word & 0xff]; | 537 | return nr + _zb_findmap[(unsigned char) word]; |
465 | } | 538 | } |
466 | 539 | ||
467 | /* | 540 | /** |
468 | * __ffs = find first bit in word. Undefined if no bit exists, | 541 | * __ffs_word - add number of the first set bit |
469 | * so code should check against 0UL first.. | 542 | * @nr: base value the bit number is added to |
543 | * @word: the word that is searched for set bits | ||
470 | */ | 544 | */ |
471 | static inline unsigned long __ffs (unsigned long word) | 545 | static inline unsigned long __ffs_word(unsigned long nr, unsigned long word) |
472 | { | 546 | { |
473 | unsigned long bit = 0; | ||
474 | |||
475 | #ifdef __s390x__ | 547 | #ifdef __s390x__ |
476 | if (likely((word & 0xffffffff) == 0)) { | 548 | if (likely((word & 0xffffffff) == 0)) { |
477 | word >>= 32; | 549 | word >>= 32; |
478 | bit += 32; | 550 | nr += 32; |
479 | } | 551 | } |
480 | #endif | 552 | #endif |
481 | if (likely((word & 0xffff) == 0)) { | 553 | if (likely((word & 0xffff) == 0)) { |
482 | word >>= 16; | 554 | word >>= 16; |
483 | bit += 16; | 555 | nr += 16; |
484 | } | 556 | } |
485 | if (likely((word & 0xff) == 0)) { | 557 | if (likely((word & 0xff) == 0)) { |
486 | word >>= 8; | 558 | word >>= 8; |
487 | bit += 8; | 559 | nr += 8; |
488 | } | 560 | } |
489 | return bit + _sb_findmap[word & 0xff]; | 561 | return nr + _sb_findmap[(unsigned char) word]; |
490 | } | 562 | } |
491 | 563 | ||
492 | /* | ||
493 | * Find-bit routines.. | ||
494 | */ | ||
495 | 564 | ||
496 | #ifndef __s390x__ | 565 | /** |
566 | * __load_ulong_be - load big endian unsigned long | ||
567 | * @p: pointer to array of unsigned long | ||
568 | * @offset: byte offset of source value in the array | ||
569 | */ | ||
570 | static inline unsigned long __load_ulong_be(const unsigned long *p, | ||
571 | unsigned long offset) | ||
572 | { | ||
573 | p = (unsigned long *)((unsigned long) p + offset); | ||
574 | return *p; | ||
575 | } | ||
497 | 576 | ||
498 | static inline int | 577 | /** |
499 | find_first_zero_bit(const unsigned long * addr, unsigned long size) | 578 | * __load_ulong_le - load little endian unsigned long |
579 | * @p: pointer to array of unsigned long | ||
580 | * @offset: byte offset of source value in the array | ||
581 | */ | ||
582 | static inline unsigned long __load_ulong_le(const unsigned long *p, | ||
583 | unsigned long offset) | ||
500 | { | 584 | { |
501 | typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; | 585 | unsigned long word; |
502 | unsigned long cmp, count; | ||
503 | unsigned int res; | ||
504 | 586 | ||
505 | if (!size) | 587 | p = (unsigned long *)((unsigned long) p + offset); |
506 | return 0; | 588 | #ifndef __s390x__ |
507 | asm volatile( | 589 | asm volatile( |
508 | " lhi %1,-1\n" | 590 | " ic %0,0(%1)\n" |
509 | " lr %2,%3\n" | 591 | " icm %0,2,1(%1)\n" |
510 | " slr %0,%0\n" | 592 | " icm %0,4,2(%1)\n" |
511 | " ahi %2,31\n" | 593 | " icm %0,8,3(%1)" |
512 | " srl %2,5\n" | 594 | : "=&d" (word) : "a" (p), "m" (*p) : "cc"); |
513 | "0: c %1,0(%0,%4)\n" | 595 | #else |
514 | " jne 1f\n" | 596 | asm volatile( |
515 | " la %0,4(%0)\n" | 597 | " lrvg %0,%1" |
516 | " brct %2,0b\n" | 598 | : "=d" (word) : "m" (*p) ); |
517 | " lr %0,%3\n" | 599 | #endif |
518 | " j 4f\n" | 600 | return word; |
519 | "1: l %2,0(%0,%4)\n" | ||
520 | " sll %0,3\n" | ||
521 | " lhi %1,0xff\n" | ||
522 | " tml %2,0xffff\n" | ||
523 | " jno 2f\n" | ||
524 | " ahi %0,16\n" | ||
525 | " srl %2,16\n" | ||
526 | "2: tml %2,0x00ff\n" | ||
527 | " jno 3f\n" | ||
528 | " ahi %0,8\n" | ||
529 | " srl %2,8\n" | ||
530 | "3: nr %2,%1\n" | ||
531 | " ic %2,0(%2,%5)\n" | ||
532 | " alr %0,%2\n" | ||
533 | "4:" | ||
534 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | ||
535 | : "a" (size), "a" (addr), "a" (&_zb_findmap), | ||
536 | "m" (*(addrtype *) addr) : "cc"); | ||
537 | return (res < size) ? res : size; | ||
538 | } | 601 | } |
539 | 602 | ||
540 | static inline int | 603 | /* |
541 | find_first_bit(const unsigned long * addr, unsigned long size) | 604 | * The various find bit functions. |
605 | */ | ||
606 | |||
607 | /* | ||
608 | * ffz - find first zero in word. | ||
609 | * @word: The word to search | ||
610 | * | ||
611 | * Undefined if no zero exists, so code should check against ~0UL first. | ||
612 | */ | ||
613 | static inline unsigned long ffz(unsigned long word) | ||
542 | { | 614 | { |
543 | typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; | 615 | return __ffz_word(0, word); |
544 | unsigned long cmp, count; | 616 | } |
545 | unsigned int res; | ||
546 | 617 | ||
547 | if (!size) | 618 | /** |
548 | return 0; | 619 | * __ffs - find first bit in word. |
549 | asm volatile( | 620 | * @word: The word to search |
550 | " slr %1,%1\n" | 621 | * |
551 | " lr %2,%3\n" | 622 | * Undefined if no bit exists, so code should check against 0 first. |
552 | " slr %0,%0\n" | 623 | */ |
553 | " ahi %2,31\n" | 624 | static inline unsigned long __ffs (unsigned long word) |
554 | " srl %2,5\n" | 625 | { |
555 | "0: c %1,0(%0,%4)\n" | 626 | return __ffs_word(0, word); |
556 | " jne 1f\n" | ||
557 | " la %0,4(%0)\n" | ||
558 | " brct %2,0b\n" | ||
559 | " lr %0,%3\n" | ||
560 | " j 4f\n" | ||
561 | "1: l %2,0(%0,%4)\n" | ||
562 | " sll %0,3\n" | ||
563 | " lhi %1,0xff\n" | ||
564 | " tml %2,0xffff\n" | ||
565 | " jnz 2f\n" | ||
566 | " ahi %0,16\n" | ||
567 | " srl %2,16\n" | ||
568 | "2: tml %2,0x00ff\n" | ||
569 | " jnz 3f\n" | ||
570 | " ahi %0,8\n" | ||
571 | " srl %2,8\n" | ||
572 | "3: nr %2,%1\n" | ||
573 | " ic %2,0(%2,%5)\n" | ||
574 | " alr %0,%2\n" | ||
575 | "4:" | ||
576 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | ||
577 | : "a" (size), "a" (addr), "a" (&_sb_findmap), | ||
578 | "m" (*(addrtype *) addr) : "cc"); | ||
579 | return (res < size) ? res : size; | ||
580 | } | 627 | } |
581 | 628 | ||
582 | #else /* __s390x__ */ | 629 | /** |
630 | * ffs - find first bit set | ||
631 | * @x: the word to search | ||
632 | * | ||
633 | * This is defined the same way as | ||
634 | * the libc and compiler builtin ffs routines, therefore | ||
635 | * differs in spirit from the above ffz (man ffs). | ||
636 | */ | ||
637 | static inline int ffs(int x) | ||
638 | { | ||
639 | if (!x) | ||
640 | return 0; | ||
641 | return __ffs_word(1, x); | ||
642 | } | ||
583 | 643 | ||
584 | static inline unsigned long | 644 | /** |
585 | find_first_zero_bit(const unsigned long * addr, unsigned long size) | 645 | * find_first_zero_bit - find the first zero bit in a memory region |
646 | * @addr: The address to start the search at | ||
647 | * @size: The maximum size to search | ||
648 | * | ||
649 | * Returns the bit-number of the first zero bit, not the number of the byte | ||
650 | * containing a bit. | ||
651 | */ | ||
652 | static inline unsigned long find_first_zero_bit(const unsigned long *addr, | ||
653 | unsigned long size) | ||
586 | { | 654 | { |
587 | typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; | 655 | unsigned long bytes, bits; |
588 | unsigned long res, cmp, count; | ||
589 | 656 | ||
590 | if (!size) | 657 | if (!size) |
591 | return 0; | 658 | return 0; |
592 | asm volatile( | 659 | bytes = __ffz_word_loop(addr, size); |
593 | " lghi %1,-1\n" | 660 | bits = __ffz_word(bytes*8, __load_ulong_be(addr, bytes)); |
594 | " lgr %2,%3\n" | 661 | return (bits < size) ? bits : size; |
595 | " slgr %0,%0\n" | 662 | } |
596 | " aghi %2,63\n" | 663 | |
597 | " srlg %2,%2,6\n" | 664 | /** |
598 | "0: cg %1,0(%0,%4)\n" | 665 | * find_first_bit - find the first set bit in a memory region |
599 | " jne 1f\n" | 666 | * @addr: The address to start the search at |
600 | " la %0,8(%0)\n" | 667 | * @size: The maximum size to search |
601 | " brct %2,0b\n" | 668 | * |
602 | " lgr %0,%3\n" | 669 | * Returns the bit-number of the first set bit, not the number of the byte |
603 | " j 5f\n" | 670 | * containing a bit. |
604 | "1: lg %2,0(%0,%4)\n" | 671 | */ |
605 | " sllg %0,%0,3\n" | 672 | static inline unsigned long find_first_bit(const unsigned long * addr, |
606 | " clr %2,%1\n" | 673 | unsigned long size) |
607 | " jne 2f\n" | ||
608 | " aghi %0,32\n" | ||
609 | " srlg %2,%2,32\n" | ||
610 | "2: lghi %1,0xff\n" | ||
611 | " tmll %2,0xffff\n" | ||
612 | " jno 3f\n" | ||
613 | " aghi %0,16\n" | ||
614 | " srl %2,16\n" | ||
615 | "3: tmll %2,0x00ff\n" | ||
616 | " jno 4f\n" | ||
617 | " aghi %0,8\n" | ||
618 | " srl %2,8\n" | ||
619 | "4: ngr %2,%1\n" | ||
620 | " ic %2,0(%2,%5)\n" | ||
621 | " algr %0,%2\n" | ||
622 | "5:" | ||
623 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | ||
624 | : "a" (size), "a" (addr), "a" (&_zb_findmap), | ||
625 | "m" (*(addrtype *) addr) : "cc"); | ||
626 | return (res < size) ? res : size; | ||
627 | } | ||
628 | |||
629 | static inline unsigned long | ||
630 | find_first_bit(const unsigned long * addr, unsigned long size) | ||
631 | { | 674 | { |
632 | typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; | 675 | unsigned long bytes, bits; |
633 | unsigned long res, cmp, count; | ||
634 | 676 | ||
635 | if (!size) | 677 | if (!size) |
636 | return 0; | 678 | return 0; |
637 | asm volatile( | 679 | bytes = __ffs_word_loop(addr, size); |
638 | " slgr %1,%1\n" | 680 | bits = __ffs_word(bytes*8, __load_ulong_be(addr, bytes)); |
639 | " lgr %2,%3\n" | 681 | return (bits < size) ? bits : size; |
640 | " slgr %0,%0\n" | ||
641 | " aghi %2,63\n" | ||
642 | " srlg %2,%2,6\n" | ||
643 | "0: cg %1,0(%0,%4)\n" | ||
644 | " jne 1f\n" | ||
645 | " aghi %0,8\n" | ||
646 | " brct %2,0b\n" | ||
647 | " lgr %0,%3\n" | ||
648 | " j 5f\n" | ||
649 | "1: lg %2,0(%0,%4)\n" | ||
650 | " sllg %0,%0,3\n" | ||
651 | " clr %2,%1\n" | ||
652 | " jne 2f\n" | ||
653 | " aghi %0,32\n" | ||
654 | " srlg %2,%2,32\n" | ||
655 | "2: lghi %1,0xff\n" | ||
656 | " tmll %2,0xffff\n" | ||
657 | " jnz 3f\n" | ||
658 | " aghi %0,16\n" | ||
659 | " srl %2,16\n" | ||
660 | "3: tmll %2,0x00ff\n" | ||
661 | " jnz 4f\n" | ||
662 | " aghi %0,8\n" | ||
663 | " srl %2,8\n" | ||
664 | "4: ngr %2,%1\n" | ||
665 | " ic %2,0(%2,%5)\n" | ||
666 | " algr %0,%2\n" | ||
667 | "5:" | ||
668 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | ||
669 | : "a" (size), "a" (addr), "a" (&_sb_findmap), | ||
670 | "m" (*(addrtype *) addr) : "cc"); | ||
671 | return (res < size) ? res : size; | ||
672 | } | 682 | } |
673 | 683 | ||
674 | #endif /* __s390x__ */ | 684 | /** |
675 | 685 | * find_next_zero_bit - find the first zero bit in a memory region | |
676 | static inline int | 686 | * @addr: The address to base the search on |
677 | find_next_zero_bit (const unsigned long * addr, unsigned long size, | 687 | * @offset: The bitnumber to start searching at |
678 | unsigned long offset) | 688 | * @size: The maximum size to search |
689 | */ | ||
690 | static inline int find_next_zero_bit (const unsigned long * addr, | ||
691 | unsigned long size, | ||
692 | unsigned long offset) | ||
679 | { | 693 | { |
680 | const unsigned long *p; | 694 | const unsigned long *p; |
681 | unsigned long bit, set; | 695 | unsigned long bit, set; |
@@ -688,10 +702,10 @@ find_next_zero_bit (const unsigned long * addr, unsigned long size, | |||
688 | p = addr + offset / __BITOPS_WORDSIZE; | 702 | p = addr + offset / __BITOPS_WORDSIZE; |
689 | if (bit) { | 703 | if (bit) { |
690 | /* | 704 | /* |
691 | * s390 version of ffz returns __BITOPS_WORDSIZE | 705 | * __ffz_word returns __BITOPS_WORDSIZE |
692 | * if no zero bit is present in the word. | 706 | * if no zero bit is present in the word. |
693 | */ | 707 | */ |
694 | set = ffz(*p >> bit) + bit; | 708 | set = __ffz_word(0, *p >> bit) + bit; |
695 | if (set >= size) | 709 | if (set >= size) |
696 | return size + offset; | 710 | return size + offset; |
697 | if (set < __BITOPS_WORDSIZE) | 711 | if (set < __BITOPS_WORDSIZE) |
@@ -703,9 +717,15 @@ find_next_zero_bit (const unsigned long * addr, unsigned long size, | |||
703 | return offset + find_first_zero_bit(p, size); | 717 | return offset + find_first_zero_bit(p, size); |
704 | } | 718 | } |
705 | 719 | ||
706 | static inline int | 720 | /** |
707 | find_next_bit (const unsigned long * addr, unsigned long size, | 721 | * find_next_bit - find the first set bit in a memory region |
708 | unsigned long offset) | 722 | * @addr: The address to base the search on |
723 | * @offset: The bitnumber to start searching at | ||
724 | * @size: The maximum size to search | ||
725 | */ | ||
726 | static inline int find_next_bit (const unsigned long * addr, | ||
727 | unsigned long size, | ||
728 | unsigned long offset) | ||
709 | { | 729 | { |
710 | const unsigned long *p; | 730 | const unsigned long *p; |
711 | unsigned long bit, set; | 731 | unsigned long bit, set; |
@@ -718,10 +738,10 @@ find_next_bit (const unsigned long * addr, unsigned long size, | |||
718 | p = addr + offset / __BITOPS_WORDSIZE; | 738 | p = addr + offset / __BITOPS_WORDSIZE; |
719 | if (bit) { | 739 | if (bit) { |
720 | /* | 740 | /* |
721 | * s390 version of __ffs returns __BITOPS_WORDSIZE | 741 | * __ffs_word returns __BITOPS_WORDSIZE |
722 | * if no one bit is present in the word. | 742 | * if no one bit is present in the word. |
723 | */ | 743 | */ |
724 | set = __ffs(*p & (~0UL << bit)); | 744 | set = __ffs_word(0, *p & (~0UL << bit)); |
725 | if (set >= size) | 745 | if (set >= size) |
726 | return size + offset; | 746 | return size + offset; |
727 | if (set < __BITOPS_WORDSIZE) | 747 | if (set < __BITOPS_WORDSIZE) |
@@ -744,8 +764,6 @@ static inline int sched_find_first_bit(unsigned long *b) | |||
744 | return find_first_bit(b, 140); | 764 | return find_first_bit(b, 140); |
745 | } | 765 | } |
746 | 766 | ||
747 | #include <asm-generic/bitops/ffs.h> | ||
748 | |||
749 | #include <asm-generic/bitops/fls.h> | 767 | #include <asm-generic/bitops/fls.h> |
750 | #include <asm-generic/bitops/fls64.h> | 768 | #include <asm-generic/bitops/fls64.h> |
751 | 769 | ||
@@ -772,108 +790,23 @@ static inline int sched_find_first_bit(unsigned long *b) | |||
772 | test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 790 | test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) |
773 | #define ext2_test_bit(nr, addr) \ | 791 | #define ext2_test_bit(nr, addr) \ |
774 | test_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 792 | test_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) |
775 | #define ext2_find_next_bit(addr, size, off) \ | ||
776 | generic_find_next_le_bit((unsigned long *)(addr), (size), (off)) | ||
777 | 793 | ||
778 | #ifndef __s390x__ | 794 | static inline int ext2_find_first_zero_bit(void *vaddr, unsigned int size) |
779 | |||
780 | static inline int | ||
781 | ext2_find_first_zero_bit(void *vaddr, unsigned int size) | ||
782 | { | 795 | { |
783 | typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; | 796 | unsigned long bytes, bits; |
784 | unsigned long cmp, count; | ||
785 | unsigned int res; | ||
786 | 797 | ||
787 | if (!size) | 798 | if (!size) |
788 | return 0; | 799 | return 0; |
789 | asm volatile( | 800 | bytes = __ffz_word_loop(vaddr, size); |
790 | " lhi %1,-1\n" | 801 | bits = __ffz_word(bytes*8, __load_ulong_le(vaddr, bytes)); |
791 | " lr %2,%3\n" | 802 | return (bits < size) ? bits : size; |
792 | " ahi %2,31\n" | ||
793 | " srl %2,5\n" | ||
794 | " slr %0,%0\n" | ||
795 | "0: cl %1,0(%0,%4)\n" | ||
796 | " jne 1f\n" | ||
797 | " ahi %0,4\n" | ||
798 | " brct %2,0b\n" | ||
799 | " lr %0,%3\n" | ||
800 | " j 4f\n" | ||
801 | "1: l %2,0(%0,%4)\n" | ||
802 | " sll %0,3\n" | ||
803 | " ahi %0,24\n" | ||
804 | " lhi %1,0xff\n" | ||
805 | " tmh %2,0xffff\n" | ||
806 | " jo 2f\n" | ||
807 | " ahi %0,-16\n" | ||
808 | " srl %2,16\n" | ||
809 | "2: tml %2,0xff00\n" | ||
810 | " jo 3f\n" | ||
811 | " ahi %0,-8\n" | ||
812 | " srl %2,8\n" | ||
813 | "3: nr %2,%1\n" | ||
814 | " ic %2,0(%2,%5)\n" | ||
815 | " alr %0,%2\n" | ||
816 | "4:" | ||
817 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | ||
818 | : "a" (size), "a" (vaddr), "a" (&_zb_findmap), | ||
819 | "m" (*(addrtype *) vaddr) : "cc"); | ||
820 | return (res < size) ? res : size; | ||
821 | } | 803 | } |
822 | 804 | ||
823 | #else /* __s390x__ */ | 805 | static inline int ext2_find_next_zero_bit(void *vaddr, unsigned long size, |
824 | 806 | unsigned long offset) | |
825 | static inline unsigned long | ||
826 | ext2_find_first_zero_bit(void *vaddr, unsigned long size) | ||
827 | { | ||
828 | typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; | ||
829 | unsigned long res, cmp, count; | ||
830 | |||
831 | if (!size) | ||
832 | return 0; | ||
833 | asm volatile( | ||
834 | " lghi %1,-1\n" | ||
835 | " lgr %2,%3\n" | ||
836 | " aghi %2,63\n" | ||
837 | " srlg %2,%2,6\n" | ||
838 | " slgr %0,%0\n" | ||
839 | "0: clg %1,0(%0,%4)\n" | ||
840 | " jne 1f\n" | ||
841 | " aghi %0,8\n" | ||
842 | " brct %2,0b\n" | ||
843 | " lgr %0,%3\n" | ||
844 | " j 5f\n" | ||
845 | "1: cl %1,0(%0,%4)\n" | ||
846 | " jne 2f\n" | ||
847 | " aghi %0,4\n" | ||
848 | "2: l %2,0(%0,%4)\n" | ||
849 | " sllg %0,%0,3\n" | ||
850 | " aghi %0,24\n" | ||
851 | " lghi %1,0xff\n" | ||
852 | " tmlh %2,0xffff\n" | ||
853 | " jo 3f\n" | ||
854 | " aghi %0,-16\n" | ||
855 | " srl %2,16\n" | ||
856 | "3: tmll %2,0xff00\n" | ||
857 | " jo 4f\n" | ||
858 | " aghi %0,-8\n" | ||
859 | " srl %2,8\n" | ||
860 | "4: ngr %2,%1\n" | ||
861 | " ic %2,0(%2,%5)\n" | ||
862 | " algr %0,%2\n" | ||
863 | "5:" | ||
864 | : "=&a" (res), "=&d" (cmp), "=&a" (count) | ||
865 | : "a" (size), "a" (vaddr), "a" (&_zb_findmap), | ||
866 | "m" (*(addrtype *) vaddr) : "cc"); | ||
867 | return (res < size) ? res : size; | ||
868 | } | ||
869 | |||
870 | #endif /* __s390x__ */ | ||
871 | |||
872 | static inline int | ||
873 | ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset) | ||
874 | { | 807 | { |
875 | unsigned long *addr = vaddr, *p; | 808 | unsigned long *addr = vaddr, *p; |
876 | unsigned long word, bit, set; | 809 | unsigned long bit, set; |
877 | 810 | ||
878 | if (offset >= size) | 811 | if (offset >= size) |
879 | return size; | 812 | return size; |
@@ -882,23 +815,11 @@ ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset) | |||
882 | size -= offset; | 815 | size -= offset; |
883 | p = addr + offset / __BITOPS_WORDSIZE; | 816 | p = addr + offset / __BITOPS_WORDSIZE; |
884 | if (bit) { | 817 | if (bit) { |
885 | #ifndef __s390x__ | ||
886 | asm volatile( | ||
887 | " ic %0,0(%1)\n" | ||
888 | " icm %0,2,1(%1)\n" | ||
889 | " icm %0,4,2(%1)\n" | ||
890 | " icm %0,8,3(%1)" | ||
891 | : "=&a" (word) : "a" (p), "m" (*p) : "cc"); | ||
892 | #else | ||
893 | asm volatile( | ||
894 | " lrvg %0,%1" | ||
895 | : "=a" (word) : "m" (*p) ); | ||
896 | #endif | ||
897 | /* | 818 | /* |
898 | * s390 version of ffz returns __BITOPS_WORDSIZE | 819 | * s390 version of ffz returns __BITOPS_WORDSIZE |
899 | * if no zero bit is present in the word. | 820 | * if no zero bit is present in the word. |
900 | */ | 821 | */ |
901 | set = ffz(word >> bit) + bit; | 822 | set = ffz(__load_ulong_le(p, 0) >> bit) + bit; |
902 | if (set >= size) | 823 | if (set >= size) |
903 | return size + offset; | 824 | return size + offset; |
904 | if (set < __BITOPS_WORDSIZE) | 825 | if (set < __BITOPS_WORDSIZE) |
@@ -910,6 +831,47 @@ ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset) | |||
910 | return offset + ext2_find_first_zero_bit(p, size); | 831 | return offset + ext2_find_first_zero_bit(p, size); |
911 | } | 832 | } |
912 | 833 | ||
834 | static inline unsigned long ext2_find_first_bit(void *vaddr, | ||
835 | unsigned long size) | ||
836 | { | ||
837 | unsigned long bytes, bits; | ||
838 | |||
839 | if (!size) | ||
840 | return 0; | ||
841 | bytes = __ffs_word_loop(vaddr, size); | ||
842 | bits = __ffs_word(bytes*8, __load_ulong_le(vaddr, bytes)); | ||
843 | return (bits < size) ? bits : size; | ||
844 | } | ||
845 | |||
846 | static inline int ext2_find_next_bit(void *vaddr, unsigned long size, | ||
847 | unsigned long offset) | ||
848 | { | ||
849 | unsigned long *addr = vaddr, *p; | ||
850 | unsigned long bit, set; | ||
851 | |||
852 | if (offset >= size) | ||
853 | return size; | ||
854 | bit = offset & (__BITOPS_WORDSIZE - 1); | ||
855 | offset -= bit; | ||
856 | size -= offset; | ||
857 | p = addr + offset / __BITOPS_WORDSIZE; | ||
858 | if (bit) { | ||
859 | /* | ||
860 | * s390 version of ffz returns __BITOPS_WORDSIZE | ||
861 | * if no zero bit is present in the word. | ||
862 | */ | ||
863 | set = ffs(__load_ulong_le(p, 0) >> bit) + bit; | ||
864 | if (set >= size) | ||
865 | return size + offset; | ||
866 | if (set < __BITOPS_WORDSIZE) | ||
867 | return set + offset; | ||
868 | offset += __BITOPS_WORDSIZE; | ||
869 | size -= __BITOPS_WORDSIZE; | ||
870 | p++; | ||
871 | } | ||
872 | return offset + ext2_find_first_bit(p, size); | ||
873 | } | ||
874 | |||
913 | #include <asm-generic/bitops/minix.h> | 875 | #include <asm-generic/bitops/minix.h> |
914 | 876 | ||
915 | #endif /* __KERNEL__ */ | 877 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-s390/cacheflush.h b/include/asm-s390/cacheflush.h index f7cade8083f3..49d5af916d01 100644 --- a/include/asm-s390/cacheflush.h +++ b/include/asm-s390/cacheflush.h | |||
@@ -24,4 +24,8 @@ | |||
24 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 24 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
25 | memcpy(dst, src, len) | 25 | memcpy(dst, src, len) |
26 | 26 | ||
27 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
28 | void kernel_map_pages(struct page *page, int numpages, int enable); | ||
29 | #endif | ||
30 | |||
27 | #endif /* _S390_CACHEFLUSH_H */ | 31 | #endif /* _S390_CACHEFLUSH_H */ |
diff --git a/include/asm-s390/ccwgroup.h b/include/asm-s390/ccwgroup.h index 7109c7cab87e..289053ef5e60 100644 --- a/include/asm-s390/ccwgroup.h +++ b/include/asm-s390/ccwgroup.h | |||
@@ -37,6 +37,7 @@ struct ccwgroup_device { | |||
37 | * @remove: function called on remove | 37 | * @remove: function called on remove |
38 | * @set_online: function called when device is set online | 38 | * @set_online: function called when device is set online |
39 | * @set_offline: function called when device is set offline | 39 | * @set_offline: function called when device is set offline |
40 | * @shutdown: function called when device is shut down | ||
40 | * @driver: embedded driver structure | 41 | * @driver: embedded driver structure |
41 | */ | 42 | */ |
42 | struct ccwgroup_driver { | 43 | struct ccwgroup_driver { |
@@ -49,6 +50,7 @@ struct ccwgroup_driver { | |||
49 | void (*remove) (struct ccwgroup_device *); | 50 | void (*remove) (struct ccwgroup_device *); |
50 | int (*set_online) (struct ccwgroup_device *); | 51 | int (*set_online) (struct ccwgroup_device *); |
51 | int (*set_offline) (struct ccwgroup_device *); | 52 | int (*set_offline) (struct ccwgroup_device *); |
53 | void (*shutdown)(struct ccwgroup_device *); | ||
52 | 54 | ||
53 | struct device_driver driver; | 55 | struct device_driver driver; |
54 | }; | 56 | }; |
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h index 709dd1740956..6f6619ba8980 100644 --- a/include/asm-s390/pgalloc.h +++ b/include/asm-s390/pgalloc.h | |||
@@ -57,10 +57,10 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm) | |||
57 | } | 57 | } |
58 | 58 | ||
59 | #define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) | 59 | #define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) |
60 | #define pud_free(x) do { } while (0) | 60 | #define pud_free(mm, x) do { } while (0) |
61 | 61 | ||
62 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) | 62 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) |
63 | #define pmd_free(x) do { } while (0) | 63 | #define pmd_free(mm, x) do { } while (0) |
64 | 64 | ||
65 | #define pgd_populate(mm, pgd, pud) BUG() | 65 | #define pgd_populate(mm, pgd, pud) BUG() |
66 | #define pgd_populate_kernel(mm, pgd, pud) BUG() | 66 | #define pgd_populate_kernel(mm, pgd, pud) BUG() |
@@ -76,7 +76,7 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm) | |||
76 | } | 76 | } |
77 | 77 | ||
78 | #define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) | 78 | #define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) |
79 | #define pud_free(x) do { } while (0) | 79 | #define pud_free(mm, x) do { } while (0) |
80 | 80 | ||
81 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) | 81 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) |
82 | { | 82 | { |
@@ -85,7 +85,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) | |||
85 | crst_table_init(crst, _SEGMENT_ENTRY_EMPTY); | 85 | crst_table_init(crst, _SEGMENT_ENTRY_EMPTY); |
86 | return (pmd_t *) crst; | 86 | return (pmd_t *) crst; |
87 | } | 87 | } |
88 | #define pmd_free(pmd) crst_table_free((unsigned long *) pmd) | 88 | #define pmd_free(mm, pmd) crst_table_free((unsigned long *)pmd) |
89 | 89 | ||
90 | #define pgd_populate(mm, pgd, pud) BUG() | 90 | #define pgd_populate(mm, pgd, pud) BUG() |
91 | #define pgd_populate_kernel(mm, pgd, pud) BUG() | 91 | #define pgd_populate_kernel(mm, pgd, pud) BUG() |
@@ -115,7 +115,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
115 | crst_table_init(crst, pgd_entry_type(mm)); | 115 | crst_table_init(crst, pgd_entry_type(mm)); |
116 | return (pgd_t *) crst; | 116 | return (pgd_t *) crst; |
117 | } | 117 | } |
118 | #define pgd_free(pgd) crst_table_free((unsigned long *) pgd) | 118 | #define pgd_free(mm, pgd) crst_table_free((unsigned long *) pgd) |
119 | 119 | ||
120 | static inline void | 120 | static inline void |
121 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) | 121 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) |
@@ -151,9 +151,9 @@ pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *page) | |||
151 | #define pte_alloc_one(mm, vmaddr) \ | 151 | #define pte_alloc_one(mm, vmaddr) \ |
152 | virt_to_page(page_table_alloc(s390_noexec)) | 152 | virt_to_page(page_table_alloc(s390_noexec)) |
153 | 153 | ||
154 | #define pte_free_kernel(pte) \ | 154 | #define pte_free_kernel(mm, pte) \ |
155 | page_table_free((unsigned long *) pte) | 155 | page_table_free((unsigned long *) pte) |
156 | #define pte_free(pte) \ | 156 | #define pte_free(mm, pte) \ |
157 | page_table_free((unsigned long *) page_to_phys((struct page *) pte)) | 157 | page_table_free((unsigned long *) page_to_phys((struct page *) pte)) |
158 | 158 | ||
159 | #endif /* _S390_PGALLOC_H */ | 159 | #endif /* _S390_PGALLOC_H */ |
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index 79b9eab1a0c7..3f520754e71c 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h | |||
@@ -115,15 +115,21 @@ extern char empty_zero_page[PAGE_SIZE]; | |||
115 | #ifndef __s390x__ | 115 | #ifndef __s390x__ |
116 | #define VMALLOC_START 0x78000000UL | 116 | #define VMALLOC_START 0x78000000UL |
117 | #define VMALLOC_END 0x7e000000UL | 117 | #define VMALLOC_END 0x7e000000UL |
118 | #define VMEM_MAP_MAX 0x80000000UL | 118 | #define VMEM_MAP_END 0x80000000UL |
119 | #else /* __s390x__ */ | 119 | #else /* __s390x__ */ |
120 | #define VMALLOC_START 0x3e000000000UL | 120 | #define VMALLOC_START 0x3e000000000UL |
121 | #define VMALLOC_END 0x3e040000000UL | 121 | #define VMALLOC_END 0x3e040000000UL |
122 | #define VMEM_MAP_MAX 0x40000000000UL | 122 | #define VMEM_MAP_END 0x40000000000UL |
123 | #endif /* __s390x__ */ | 123 | #endif /* __s390x__ */ |
124 | 124 | ||
125 | /* | ||
126 | * VMEM_MAX_PHYS is the highest physical address that can be added to the 1:1 | ||
127 | * mapping. This needs to be calculated at compile time since the size of the | ||
128 | * VMEM_MAP is static but the size of struct page can change. | ||
129 | */ | ||
130 | #define VMEM_MAX_PHYS min(VMALLOC_START, ((VMEM_MAP_END - VMALLOC_END) / \ | ||
131 | sizeof(struct page) * PAGE_SIZE) & ~((16 << 20) - 1)) | ||
125 | #define VMEM_MAP ((struct page *) VMALLOC_END) | 132 | #define VMEM_MAP ((struct page *) VMALLOC_END) |
126 | #define VMEM_MAP_SIZE ((VMALLOC_START / PAGE_SIZE) * sizeof(struct page)) | ||
127 | 133 | ||
128 | /* | 134 | /* |
129 | * A 31 bit pagetable entry of S390 has following format: | 135 | * A 31 bit pagetable entry of S390 has following format: |
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index c86b982aef5a..4f744609cd11 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
@@ -70,8 +70,9 @@ extern int get_cpu_capability(unsigned int *); | |||
70 | 70 | ||
71 | #else /* __s390x__ */ | 71 | #else /* __s390x__ */ |
72 | 72 | ||
73 | # define TASK_SIZE (test_thread_flag(TIF_31BIT) ? \ | 73 | # define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_31BIT) ? \ |
74 | (0x80000000UL) : (0x40000000000UL)) | 74 | (0x80000000UL) : (0x40000000000UL)) |
75 | # define TASK_SIZE TASK_SIZE_OF(current) | ||
75 | # define TASK_UNMAPPED_BASE (TASK_SIZE / 2) | 76 | # define TASK_UNMAPPED_BASE (TASK_SIZE / 2) |
76 | # define DEFAULT_TASK_SIZE (0x40000000000UL) | 77 | # define DEFAULT_TASK_SIZE (0x40000000000UL) |
77 | 78 | ||
diff --git a/include/asm-s390/tlb.h b/include/asm-s390/tlb.h index 618693cfc10f..985de2b88279 100644 --- a/include/asm-s390/tlb.h +++ b/include/asm-s390/tlb.h | |||
@@ -65,9 +65,9 @@ static inline void tlb_flush_mmu(struct mmu_gather *tlb, | |||
65 | if (!tlb->fullmm && (tlb->nr_ptes > 0 || tlb->nr_pmds < TLB_NR_PTRS)) | 65 | if (!tlb->fullmm && (tlb->nr_ptes > 0 || tlb->nr_pmds < TLB_NR_PTRS)) |
66 | __tlb_flush_mm(tlb->mm); | 66 | __tlb_flush_mm(tlb->mm); |
67 | while (tlb->nr_ptes > 0) | 67 | while (tlb->nr_ptes > 0) |
68 | pte_free(tlb->array[--tlb->nr_ptes]); | 68 | pte_free(tlb->mm, tlb->array[--tlb->nr_ptes]); |
69 | while (tlb->nr_pmds < TLB_NR_PTRS) | 69 | while (tlb->nr_pmds < TLB_NR_PTRS) |
70 | pmd_free((pmd_t *) tlb->array[tlb->nr_pmds++]); | 70 | pmd_free(tlb->mm, (pmd_t *) tlb->array[tlb->nr_pmds++]); |
71 | } | 71 | } |
72 | 72 | ||
73 | static inline void tlb_finish_mmu(struct mmu_gather *tlb, | 73 | static inline void tlb_finish_mmu(struct mmu_gather *tlb, |
@@ -102,7 +102,7 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, struct page *page) | |||
102 | if (tlb->nr_ptes >= tlb->nr_pmds) | 102 | if (tlb->nr_ptes >= tlb->nr_pmds) |
103 | tlb_flush_mmu(tlb, 0, 0); | 103 | tlb_flush_mmu(tlb, 0, 0); |
104 | } else | 104 | } else |
105 | pte_free(page); | 105 | pte_free(tlb->mm, page); |
106 | } | 106 | } |
107 | 107 | ||
108 | /* | 108 | /* |
@@ -117,7 +117,7 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | |||
117 | if (tlb->nr_ptes >= tlb->nr_pmds) | 117 | if (tlb->nr_ptes >= tlb->nr_pmds) |
118 | tlb_flush_mmu(tlb, 0, 0); | 118 | tlb_flush_mmu(tlb, 0, 0); |
119 | } else | 119 | } else |
120 | pmd_free(pmd); | 120 | pmd_free(tlb->mm, pmd); |
121 | #endif | 121 | #endif |
122 | } | 122 | } |
123 | 123 | ||
diff --git a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h index 18b613c57cf5..59ca16d77a1d 100644 --- a/include/asm-sh/pgalloc.h +++ b/include/asm-sh/pgalloc.h | |||
@@ -36,7 +36,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
36 | return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor); | 36 | return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor); |
37 | } | 37 | } |
38 | 38 | ||
39 | static inline void pgd_free(pgd_t *pgd) | 39 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
40 | { | 40 | { |
41 | quicklist_free(QUICK_PGD, NULL, pgd); | 41 | quicklist_free(QUICK_PGD, NULL, pgd); |
42 | } | 42 | } |
@@ -54,12 +54,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
54 | return pg ? virt_to_page(pg) : NULL; | 54 | return pg ? virt_to_page(pg) : NULL; |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline void pte_free_kernel(pte_t *pte) | 57 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
58 | { | 58 | { |
59 | quicklist_free(QUICK_PT, NULL, pte); | 59 | quicklist_free(QUICK_PT, NULL, pte); |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline void pte_free(struct page *pte) | 62 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
63 | { | 63 | { |
64 | quicklist_free_page(QUICK_PT, NULL, pte); | 64 | quicklist_free_page(QUICK_PT, NULL, pte); |
65 | } | 65 | } |
@@ -71,7 +71,7 @@ static inline void pte_free(struct page *pte) | |||
71 | * inside the pgd, so has no extra memory associated with it. | 71 | * inside the pgd, so has no extra memory associated with it. |
72 | */ | 72 | */ |
73 | 73 | ||
74 | #define pmd_free(x) do { } while (0) | 74 | #define pmd_free(mm, x) do { } while (0) |
75 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 75 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
76 | 76 | ||
77 | static inline void check_pgt_cache(void) | 77 | static inline void check_pgt_cache(void) |
diff --git a/include/asm-sh/unistd_32.h b/include/asm-sh/unistd_32.h index b182b1cb05fd..433fd1b48fa2 100644 --- a/include/asm-sh/unistd_32.h +++ b/include/asm-sh/unistd_32.h | |||
@@ -330,7 +330,7 @@ | |||
330 | #define __NR_epoll_pwait 319 | 330 | #define __NR_epoll_pwait 319 |
331 | #define __NR_utimensat 320 | 331 | #define __NR_utimensat 320 |
332 | #define __NR_signalfd 321 | 332 | #define __NR_signalfd 321 |
333 | #define __NR_timerfd 322 | 333 | /* #define __NR_timerfd 322 removed */ |
334 | #define __NR_eventfd 323 | 334 | #define __NR_eventfd 323 |
335 | #define __NR_fallocate 324 | 335 | #define __NR_fallocate 324 |
336 | 336 | ||
diff --git a/include/asm-sh/unistd_64.h b/include/asm-sh/unistd_64.h index 944511882cac..108d2ba897fe 100644 --- a/include/asm-sh/unistd_64.h +++ b/include/asm-sh/unistd_64.h | |||
@@ -370,7 +370,7 @@ | |||
370 | #define __NR_epoll_pwait 347 | 370 | #define __NR_epoll_pwait 347 |
371 | #define __NR_utimensat 348 | 371 | #define __NR_utimensat 348 |
372 | #define __NR_signalfd 349 | 372 | #define __NR_signalfd 349 |
373 | #define __NR_timerfd 350 | 373 | /* #define __NR_timerfd 350 removed */ |
374 | #define __NR_eventfd 351 | 374 | #define __NR_eventfd 351 |
375 | #define __NR_fallocate 352 | 375 | #define __NR_fallocate 352 |
376 | 376 | ||
diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h index a449cd4912d1..b5fbdd36447f 100644 --- a/include/asm-sparc/pgalloc.h +++ b/include/asm-sparc/pgalloc.h | |||
@@ -32,7 +32,7 @@ BTFIXUPDEF_CALL(pgd_t *, get_pgd_fast, void) | |||
32 | BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *) | 32 | BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *) |
33 | #define free_pgd_fast(pgd) BTFIXUP_CALL(free_pgd_fast)(pgd) | 33 | #define free_pgd_fast(pgd) BTFIXUP_CALL(free_pgd_fast)(pgd) |
34 | 34 | ||
35 | #define pgd_free(pgd) free_pgd_fast(pgd) | 35 | #define pgd_free(mm, pgd) free_pgd_fast(pgd) |
36 | #define pgd_alloc(mm) get_pgd_fast() | 36 | #define pgd_alloc(mm) get_pgd_fast() |
37 | 37 | ||
38 | BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *) | 38 | BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *) |
@@ -45,8 +45,8 @@ BTFIXUPDEF_CALL(pmd_t *, pmd_alloc_one, struct mm_struct *, unsigned long) | |||
45 | BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *) | 45 | BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *) |
46 | #define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd) | 46 | #define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd) |
47 | 47 | ||
48 | #define pmd_free(pmd) free_pmd_fast(pmd) | 48 | #define pmd_free(mm, pmd) free_pmd_fast(pmd) |
49 | #define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) | 49 | #define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) |
50 | 50 | ||
51 | BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *) | 51 | BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *) |
52 | #define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE) | 52 | #define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE) |
@@ -59,10 +59,10 @@ BTFIXUPDEF_CALL(pte_t *, pte_alloc_one_kernel, struct mm_struct *, unsigned long | |||
59 | #define pte_alloc_one_kernel(mm, addr) BTFIXUP_CALL(pte_alloc_one_kernel)(mm, addr) | 59 | #define pte_alloc_one_kernel(mm, addr) BTFIXUP_CALL(pte_alloc_one_kernel)(mm, addr) |
60 | 60 | ||
61 | BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *) | 61 | BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *) |
62 | #define pte_free_kernel(pte) BTFIXUP_CALL(free_pte_fast)(pte) | 62 | #define pte_free_kernel(mm, pte) BTFIXUP_CALL(free_pte_fast)(pte) |
63 | 63 | ||
64 | BTFIXUPDEF_CALL(void, pte_free, struct page *) | 64 | BTFIXUPDEF_CALL(void, pte_free, struct page *) |
65 | #define pte_free(pte) BTFIXUP_CALL(pte_free)(pte) | 65 | #define pte_free(mm, pte) BTFIXUP_CALL(pte_free)(pte) |
66 | #define __pte_free_tlb(tlb, pte) pte_free(pte) | 66 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
67 | 67 | ||
68 | #endif /* _SPARC_PGALLOC_H */ | 68 | #endif /* _SPARC_PGALLOC_H */ |
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index 5d66b858a965..b48f73c2274e 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h | |||
@@ -20,7 +20,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
20 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 20 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline void pgd_free(pgd_t *pgd) | 23 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
24 | { | 24 | { |
25 | quicklist_free(0, NULL, pgd); | 25 | quicklist_free(0, NULL, pgd); |
26 | } | 26 | } |
@@ -32,7 +32,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
32 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 32 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline void pmd_free(pmd_t *pmd) | 35 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
36 | { | 36 | { |
37 | quicklist_free(0, NULL, pmd); | 37 | quicklist_free(0, NULL, pmd); |
38 | } | 38 | } |
@@ -50,12 +50,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
50 | return pg ? virt_to_page(pg) : NULL; | 50 | return pg ? virt_to_page(pg) : NULL; |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline void pte_free_kernel(pte_t *pte) | 53 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
54 | { | 54 | { |
55 | quicklist_free(0, NULL, pte); | 55 | quicklist_free(0, NULL, pte); |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline void pte_free(struct page *ptepage) | 58 | static inline void pte_free(struct mm_struct *mm, struct page *ptepage) |
59 | { | 59 | { |
60 | quicklist_free_page(0, NULL, ptepage); | 60 | quicklist_free_page(0, NULL, ptepage); |
61 | } | 61 | } |
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h index 349d1d3e9c27..ec81cdedef2c 100644 --- a/include/asm-sparc64/tlb.h +++ b/include/asm-sparc64/tlb.h | |||
@@ -100,8 +100,8 @@ static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page) | |||
100 | } | 100 | } |
101 | 101 | ||
102 | #define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0) | 102 | #define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0) |
103 | #define pte_free_tlb(mp,ptepage) pte_free(ptepage) | 103 | #define pte_free_tlb(mp, ptepage) pte_free((mp)->mm, ptepage) |
104 | #define pmd_free_tlb(mp,pmdp) pmd_free(pmdp) | 104 | #define pmd_free_tlb(mp, pmdp) pmd_free((mp)->mm, pmdp) |
105 | #define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp) | 105 | #define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp) |
106 | 106 | ||
107 | #define tlb_migrate_finish(mm) do { } while (0) | 107 | #define tlb_migrate_finish(mm) do { } while (0) |
diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h index 9281dd8eb334..f42ff14577fa 100644 --- a/include/asm-um/a.out.h +++ b/include/asm-um/a.out.h | |||
@@ -13,11 +13,9 @@ | |||
13 | 13 | ||
14 | extern unsigned long stacksizelim; | 14 | extern unsigned long stacksizelim; |
15 | 15 | ||
16 | extern unsigned long host_task_size; | ||
17 | |||
18 | #define STACK_ROOM (stacksizelim) | 16 | #define STACK_ROOM (stacksizelim) |
19 | 17 | ||
20 | #define STACK_TOP task_size | 18 | #define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE) |
21 | 19 | ||
22 | #define STACK_TOP_MAX STACK_TOP | 20 | #define STACK_TOP_MAX STACK_TOP |
23 | 21 | ||
diff --git a/include/asm-um/current.h b/include/asm-um/current.h index 8fd72f69ce65..c2191d9aa03d 100644 --- a/include/asm-um/current.h +++ b/include/asm-um/current.h | |||
@@ -1,32 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef __UM_CURRENT_H | 6 | #ifndef __UM_CURRENT_H |
7 | #define __UM_CURRENT_H | 7 | #define __UM_CURRENT_H |
8 | 8 | ||
9 | #ifndef __ASSEMBLY__ | ||
10 | |||
11 | #include "asm/page.h" | ||
12 | #include "linux/thread_info.h" | 9 | #include "linux/thread_info.h" |
13 | 10 | ||
14 | #define current (current_thread_info()->task) | 11 | #define current (current_thread_info()->task) |
15 | 12 | ||
16 | /*Backward compatibility - it's used inside arch/um.*/ | ||
17 | #define current_thread current_thread_info() | ||
18 | |||
19 | #endif /* __ASSEMBLY__ */ | ||
20 | |||
21 | #endif | 13 | #endif |
22 | |||
23 | /* | ||
24 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
25 | * Emacs will notice this stuff at the end of the file and automatically | ||
26 | * adjust the settings for this buffer only. This must remain at the end | ||
27 | * of the file. | ||
28 | * --------------------------------------------------------------------------- | ||
29 | * Local variables: | ||
30 | * c-file-style: "linux" | ||
31 | * End: | ||
32 | */ | ||
diff --git a/include/asm-um/elf-i386.h b/include/asm-um/elf-i386.h index ca94a136dfe8..23d6893e8617 100644 --- a/include/asm-um/elf-i386.h +++ b/include/asm-um/elf-i386.h | |||
@@ -1,11 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) | 2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | #ifndef __UM_ELF_I386_H | 5 | #ifndef __UM_ELF_I386_H |
6 | #define __UM_ELF_I386_H | 6 | #define __UM_ELF_I386_H |
7 | 7 | ||
8 | #include <linux/sched.h> | 8 | #include <asm/user.h> |
9 | #include "skas.h" | 9 | #include "skas.h" |
10 | 10 | ||
11 | #define R_386_NONE 0 | 11 | #define R_386_NONE 0 |
@@ -46,7 +46,7 @@ typedef struct user_i387_struct elf_fpregset_t; | |||
46 | PT_REGS_EDI(regs) = 0; \ | 46 | PT_REGS_EDI(regs) = 0; \ |
47 | PT_REGS_EBP(regs) = 0; \ | 47 | PT_REGS_EBP(regs) = 0; \ |
48 | PT_REGS_EAX(regs) = 0; \ | 48 | PT_REGS_EAX(regs) = 0; \ |
49 | } while(0) | 49 | } while (0) |
50 | 50 | ||
51 | #define USE_ELF_CORE_DUMP | 51 | #define USE_ELF_CORE_DUMP |
52 | #define ELF_EXEC_PAGESIZE 4096 | 52 | #define ELF_EXEC_PAGESIZE 4096 |
@@ -74,14 +74,9 @@ typedef struct user_i387_struct elf_fpregset_t; | |||
74 | pr_reg[14] = PT_REGS_EFLAGS(regs); \ | 74 | pr_reg[14] = PT_REGS_EFLAGS(regs); \ |
75 | pr_reg[15] = PT_REGS_SP(regs); \ | 75 | pr_reg[15] = PT_REGS_SP(regs); \ |
76 | pr_reg[16] = PT_REGS_SS(regs); \ | 76 | pr_reg[16] = PT_REGS_SS(regs); \ |
77 | } while(0); | 77 | } while (0); |
78 | 78 | ||
79 | static inline int elf_core_copy_fpregs(struct task_struct *t, | 79 | extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu); |
80 | elf_fpregset_t *fpu) | ||
81 | { | ||
82 | int cpu = ((struct thread_info *) t->stack)->cpu; | ||
83 | return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu); | ||
84 | } | ||
85 | 80 | ||
86 | #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) | 81 | #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) |
87 | 82 | ||
@@ -91,7 +86,7 @@ extern long elf_aux_hwcap; | |||
91 | extern char * elf_aux_platform; | 86 | extern char * elf_aux_platform; |
92 | #define ELF_PLATFORM (elf_aux_platform) | 87 | #define ELF_PLATFORM (elf_aux_platform) |
93 | 88 | ||
94 | #define SET_PERSONALITY(ex, ibcs2) do ; while(0) | 89 | #define SET_PERSONALITY(ex, ibcs2) do { } while (0) |
95 | 90 | ||
96 | extern unsigned long vsyscall_ehdr; | 91 | extern unsigned long vsyscall_ehdr; |
97 | extern unsigned long vsyscall_end; | 92 | extern unsigned long vsyscall_end; |
@@ -166,14 +161,3 @@ if ( vsyscall_ehdr ) { \ | |||
166 | } | 161 | } |
167 | 162 | ||
168 | #endif | 163 | #endif |
169 | |||
170 | /* | ||
171 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
172 | * Emacs will notice this stuff at the end of the file and automatically | ||
173 | * adjust the settings for this buffer only. This must remain at the end | ||
174 | * of the file. | ||
175 | * --------------------------------------------------------------------------- | ||
176 | * Local variables: | ||
177 | * c-file-style: "linux" | ||
178 | * End: | ||
179 | */ | ||
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h index 3c9d543eb61e..3b2d5224a7e1 100644 --- a/include/asm-um/elf-x86_64.h +++ b/include/asm-um/elf-x86_64.h | |||
@@ -7,7 +7,6 @@ | |||
7 | #ifndef __UM_ELF_X86_64_H | 7 | #ifndef __UM_ELF_X86_64_H |
8 | #define __UM_ELF_X86_64_H | 8 | #define __UM_ELF_X86_64_H |
9 | 9 | ||
10 | #include <linux/sched.h> | ||
11 | #include <asm/user.h> | 10 | #include <asm/user.h> |
12 | #include "skas.h" | 11 | #include "skas.h" |
13 | 12 | ||
@@ -96,12 +95,7 @@ typedef struct user_i387_struct elf_fpregset_t; | |||
96 | (pr_reg)[25] = 0; \ | 95 | (pr_reg)[25] = 0; \ |
97 | (pr_reg)[26] = 0; | 96 | (pr_reg)[26] = 0; |
98 | 97 | ||
99 | static inline int elf_core_copy_fpregs(struct task_struct *t, | 98 | extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu); |
100 | elf_fpregset_t *fpu) | ||
101 | { | ||
102 | int cpu = current_thread->cpu; | ||
103 | return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu); | ||
104 | } | ||
105 | 99 | ||
106 | #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) | 100 | #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) |
107 | 101 | ||
diff --git a/include/asm-um/fixmap.h b/include/asm-um/fixmap.h index d352a35cfafb..89a87c18b927 100644 --- a/include/asm-um/fixmap.h +++ b/include/asm-um/fixmap.h | |||
@@ -1,9 +1,10 @@ | |||
1 | #ifndef __UM_FIXMAP_H | 1 | #ifndef __UM_FIXMAP_H |
2 | #define __UM_FIXMAP_H | 2 | #define __UM_FIXMAP_H |
3 | 3 | ||
4 | #include <asm/system.h> | ||
4 | #include <asm/kmap_types.h> | 5 | #include <asm/kmap_types.h> |
5 | #include <asm/archparam.h> | 6 | #include <asm/archparam.h> |
6 | #include <asm/elf.h> | 7 | #include <asm/page.h> |
7 | 8 | ||
8 | /* | 9 | /* |
9 | * Here we define all the compile-time 'special' virtual | 10 | * Here we define all the compile-time 'special' virtual |
@@ -55,9 +56,8 @@ extern void __set_fixmap (enum fixed_addresses idx, | |||
55 | * the start of the fixmap, and leave one page empty | 56 | * the start of the fixmap, and leave one page empty |
56 | * at the top of mem.. | 57 | * at the top of mem.. |
57 | */ | 58 | */ |
58 | extern unsigned long get_kmem_end(void); | ||
59 | 59 | ||
60 | #define FIXADDR_TOP (get_kmem_end() - 0x2000) | 60 | #define FIXADDR_TOP (CONFIG_TOP_ADDR - 2 * PAGE_SIZE) |
61 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) | 61 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) |
62 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) | 62 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) |
63 | 63 | ||
diff --git a/include/asm-um/ldt.h b/include/asm-um/ldt.h index b2553f3e87eb..52af512f5e7d 100644 --- a/include/asm-um/ldt.h +++ b/include/asm-um/ldt.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #ifndef __ASM_LDT_H | 8 | #ifndef __ASM_LDT_H |
9 | #define __ASM_LDT_H | 9 | #define __ASM_LDT_H |
10 | 10 | ||
11 | #include "asm/semaphore.h" | 11 | #include <linux/mutex.h> |
12 | #include "asm/host_ldt.h" | 12 | #include "asm/host_ldt.h" |
13 | 13 | ||
14 | extern void ldt_host_info(void); | 14 | extern void ldt_host_info(void); |
@@ -27,7 +27,7 @@ struct ldt_entry { | |||
27 | 27 | ||
28 | typedef struct uml_ldt { | 28 | typedef struct uml_ldt { |
29 | int entry_count; | 29 | int entry_count; |
30 | struct semaphore semaphore; | 30 | struct mutex lock; |
31 | union { | 31 | union { |
32 | struct ldt_entry * pages[LDT_PAGES_MAX]; | 32 | struct ldt_entry * pages[LDT_PAGES_MAX]; |
33 | struct ldt_entry entries[LDT_DIRECT_ENTRIES]; | 33 | struct ldt_entry entries[LDT_DIRECT_ENTRIES]; |
diff --git a/include/asm-um/linkage.h b/include/asm-um/linkage.h index cdb3024a699a..7dfce37adc8b 100644 --- a/include/asm-um/linkage.h +++ b/include/asm-um/linkage.h | |||
@@ -3,10 +3,4 @@ | |||
3 | 3 | ||
4 | #include "asm/arch/linkage.h" | 4 | #include "asm/arch/linkage.h" |
5 | 5 | ||
6 | |||
7 | /* <linux/linkage.h> will pick sane defaults */ | ||
8 | #ifdef CONFIG_GPROF | ||
9 | #undef fastcall | ||
10 | #endif | ||
11 | |||
12 | #endif | 6 | #endif |
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h index 5f3b863aef9a..6686fc524ca1 100644 --- a/include/asm-um/mmu_context.h +++ b/include/asm-um/mmu_context.h | |||
@@ -6,11 +6,12 @@ | |||
6 | #ifndef __UM_MMU_CONTEXT_H | 6 | #ifndef __UM_MMU_CONTEXT_H |
7 | #define __UM_MMU_CONTEXT_H | 7 | #define __UM_MMU_CONTEXT_H |
8 | 8 | ||
9 | #include <asm-generic/mm_hooks.h> | ||
10 | |||
11 | #include "linux/sched.h" | 9 | #include "linux/sched.h" |
12 | #include "um_mmu.h" | 10 | #include "um_mmu.h" |
13 | 11 | ||
12 | extern void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm); | ||
13 | extern void arch_exit_mmap(struct mm_struct *mm); | ||
14 | |||
14 | #define get_mmu_context(task) do ; while(0) | 15 | #define get_mmu_context(task) do ; while(0) |
15 | #define activate_context(tsk) do ; while(0) | 16 | #define activate_context(tsk) do ; while(0) |
16 | 17 | ||
@@ -30,6 +31,8 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) | |||
30 | */ | 31 | */ |
31 | if (old != new && (current->flags & PF_BORROWED_MM)) | 32 | if (old != new && (current->flags & PF_BORROWED_MM)) |
32 | __switch_mm(&new->context.id); | 33 | __switch_mm(&new->context.id); |
34 | |||
35 | arch_dup_mmap(old, new); | ||
33 | } | 36 | } |
34 | 37 | ||
35 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | 38 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, |
diff --git a/include/asm-um/page.h b/include/asm-um/page.h index 4b424c75fca5..fe2374d705d1 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h | |||
@@ -30,7 +30,7 @@ struct page; | |||
30 | #if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64BIT) | 30 | #if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64BIT) |
31 | 31 | ||
32 | typedef struct { unsigned long pte_low, pte_high; } pte_t; | 32 | typedef struct { unsigned long pte_low, pte_high; } pte_t; |
33 | typedef struct { unsigned long long pmd; } pmd_t; | 33 | typedef struct { unsigned long pmd; } pmd_t; |
34 | typedef struct { unsigned long pgd; } pgd_t; | 34 | typedef struct { unsigned long pgd; } pgd_t; |
35 | #define pte_val(x) ((x).pte_low | ((unsigned long long) (x).pte_high << 32)) | 35 | #define pte_val(x) ((x).pte_low | ((unsigned long long) (x).pte_high << 32)) |
36 | 36 | ||
@@ -106,8 +106,8 @@ extern unsigned long uml_physmem; | |||
106 | #define __pa(virt) to_phys((void *) (unsigned long) (virt)) | 106 | #define __pa(virt) to_phys((void *) (unsigned long) (virt)) |
107 | #define __va(phys) to_virt((unsigned long) (phys)) | 107 | #define __va(phys) to_virt((unsigned long) (phys)) |
108 | 108 | ||
109 | #define phys_to_pfn(p) ((p) >> PAGE_SHIFT) | 109 | #define phys_to_pfn(p) ((pfn_t) ((p) >> PAGE_SHIFT)) |
110 | #define pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) | 110 | #define pfn_to_phys(pfn) ((phys_t) ((pfn) << PAGE_SHIFT)) |
111 | 111 | ||
112 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | 112 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
113 | #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) | 113 | #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) |
diff --git a/include/asm-um/param.h b/include/asm-um/param.h index f914e7d67b01..4cd4a226f8c1 100644 --- a/include/asm-um/param.h +++ b/include/asm-um/param.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | 10 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ |
11 | 11 | ||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | #define HZ 100 | 13 | #define HZ CONFIG_HZ |
14 | #define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | 14 | #define USER_HZ 100 /* .. some user interfaces are in "ticks" */ |
15 | #define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ | 15 | #define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ |
16 | #endif | 16 | #endif |
diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h index 14904876e8fb..4f3e62b02861 100644 --- a/include/asm-um/pgalloc.h +++ b/include/asm-um/pgalloc.h | |||
@@ -23,17 +23,17 @@ | |||
23 | * Allocate and free page tables. | 23 | * Allocate and free page tables. |
24 | */ | 24 | */ |
25 | extern pgd_t *pgd_alloc(struct mm_struct *); | 25 | extern pgd_t *pgd_alloc(struct mm_struct *); |
26 | extern void pgd_free(pgd_t *pgd); | 26 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
27 | 27 | ||
28 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); | 28 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); |
29 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); | 29 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); |
30 | 30 | ||
31 | static inline void pte_free_kernel(pte_t *pte) | 31 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
32 | { | 32 | { |
33 | free_page((unsigned long) pte); | 33 | free_page((unsigned long) pte); |
34 | } | 34 | } |
35 | 35 | ||
36 | static inline void pte_free(struct page *pte) | 36 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
37 | { | 37 | { |
38 | __free_page(pte); | 38 | __free_page(pte); |
39 | } | 39 | } |
@@ -42,7 +42,7 @@ static inline void pte_free(struct page *pte) | |||
42 | 42 | ||
43 | #ifdef CONFIG_3_LEVEL_PGTABLES | 43 | #ifdef CONFIG_3_LEVEL_PGTABLES |
44 | 44 | ||
45 | static inline void pmd_free(pmd_t *pmd) | 45 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
46 | { | 46 | { |
47 | free_page((unsigned long)pmd); | 47 | free_page((unsigned long)pmd); |
48 | } | 48 | } |
diff --git a/include/asm-um/pgtable-2level.h b/include/asm-um/pgtable-2level.h index 172a75fde512..f534b73e753e 100644 --- a/include/asm-um/pgtable-2level.h +++ b/include/asm-um/pgtable-2level.h | |||
@@ -41,9 +41,6 @@ static inline void pgd_mkuptodate(pgd_t pgd) { } | |||
41 | #define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) | 41 | #define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) |
42 | #define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) | 42 | #define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) |
43 | 43 | ||
44 | #define pmd_page_vaddr(pmd) \ | ||
45 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | ||
46 | |||
47 | /* | 44 | /* |
48 | * Bits 0 through 4 are taken | 45 | * Bits 0 through 4 are taken |
49 | */ | 46 | */ |
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h index 3ebafbaacb24..0446f456b428 100644 --- a/include/asm-um/pgtable-3level.h +++ b/include/asm-um/pgtable-3level.h | |||
@@ -11,7 +11,11 @@ | |||
11 | 11 | ||
12 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ | 12 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ |
13 | 13 | ||
14 | #ifdef CONFIG_64BIT | ||
14 | #define PGDIR_SHIFT 30 | 15 | #define PGDIR_SHIFT 30 |
16 | #else | ||
17 | #define PGDIR_SHIFT 31 | ||
18 | #endif | ||
15 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | 19 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) |
16 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 20 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
17 | 21 | ||
@@ -28,9 +32,15 @@ | |||
28 | */ | 32 | */ |
29 | 33 | ||
30 | #define PTRS_PER_PTE 512 | 34 | #define PTRS_PER_PTE 512 |
35 | #ifdef CONFIG_64BIT | ||
31 | #define PTRS_PER_PMD 512 | 36 | #define PTRS_PER_PMD 512 |
32 | #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) | ||
33 | #define PTRS_PER_PGD 512 | 37 | #define PTRS_PER_PGD 512 |
38 | #else | ||
39 | #define PTRS_PER_PMD 1024 | ||
40 | #define PTRS_PER_PGD 1024 | ||
41 | #endif | ||
42 | |||
43 | #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) | ||
34 | #define FIRST_USER_ADDRESS 0 | 44 | #define FIRST_USER_ADDRESS 0 |
35 | 45 | ||
36 | #define pte_ERROR(e) \ | 46 | #define pte_ERROR(e) \ |
@@ -49,7 +59,12 @@ | |||
49 | #define pud_populate(mm, pud, pmd) \ | 59 | #define pud_populate(mm, pud, pmd) \ |
50 | set_pud(pud, __pud(_PAGE_TABLE + __pa(pmd))) | 60 | set_pud(pud, __pud(_PAGE_TABLE + __pa(pmd))) |
51 | 61 | ||
62 | #ifdef CONFIG_64BIT | ||
52 | #define set_pud(pudptr, pudval) set_64bit((phys_t *) (pudptr), pud_val(pudval)) | 63 | #define set_pud(pudptr, pudval) set_64bit((phys_t *) (pudptr), pud_val(pudval)) |
64 | #else | ||
65 | #define set_pud(pudptr, pudval) (*(pudptr) = (pudval)) | ||
66 | #endif | ||
67 | |||
53 | static inline int pgd_newpage(pgd_t pgd) | 68 | static inline int pgd_newpage(pgd_t pgd) |
54 | { | 69 | { |
55 | return(pgd_val(pgd) & _PAGE_NEWPAGE); | 70 | return(pgd_val(pgd) & _PAGE_NEWPAGE); |
@@ -57,17 +72,14 @@ static inline int pgd_newpage(pgd_t pgd) | |||
57 | 72 | ||
58 | static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } | 73 | static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } |
59 | 74 | ||
75 | #ifdef CONFIG_64BIT | ||
60 | #define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval)) | 76 | #define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval)) |
77 | #else | ||
78 | #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) | ||
79 | #endif | ||
61 | 80 | ||
62 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | 81 | struct mm_struct; |
63 | { | 82 | extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address); |
64 | pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL); | ||
65 | |||
66 | if(pmd) | ||
67 | memset(pmd, 0, PAGE_SIZE); | ||
68 | |||
69 | return pmd; | ||
70 | } | ||
71 | 83 | ||
72 | static inline void pud_clear (pud_t *pud) | 84 | static inline void pud_clear (pud_t *pud) |
73 | { | 85 | { |
@@ -75,8 +87,7 @@ static inline void pud_clear (pud_t *pud) | |||
75 | } | 87 | } |
76 | 88 | ||
77 | #define pud_page(pud) phys_to_page(pud_val(pud) & PAGE_MASK) | 89 | #define pud_page(pud) phys_to_page(pud_val(pud) & PAGE_MASK) |
78 | #define pud_page_vaddr(pud) \ | 90 | #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PAGE_MASK)) |
79 | ((struct page *) __va(pud_val(pud) & PAGE_MASK)) | ||
80 | 91 | ||
81 | /* Find an entry in the second-level page table.. */ | 92 | /* Find an entry in the second-level page table.. */ |
82 | #define pmd_offset(pud, address) ((pmd_t *) pud_page_vaddr(*(pud)) + \ | 93 | #define pmd_offset(pud, address) ((pmd_t *) pud_page_vaddr(*(pud)) + \ |
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index 830fc6e5d49d..4102b443e925 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Copyright 2003 PathScale, Inc. | 3 | * Copyright 2003 PathScale, Inc. |
4 | * Derived from include/asm-i386/pgtable.h | 4 | * Derived from include/asm-i386/pgtable.h |
5 | * Licensed under the GPL | 5 | * Licensed under the GPL |
@@ -8,11 +8,7 @@ | |||
8 | #ifndef __UM_PGTABLE_H | 8 | #ifndef __UM_PGTABLE_H |
9 | #define __UM_PGTABLE_H | 9 | #define __UM_PGTABLE_H |
10 | 10 | ||
11 | #include "linux/sched.h" | 11 | #include <asm/fixmap.h> |
12 | #include "linux/linkage.h" | ||
13 | #include "asm/processor.h" | ||
14 | #include "asm/page.h" | ||
15 | #include "asm/fixmap.h" | ||
16 | 12 | ||
17 | #define _PAGE_PRESENT 0x001 | 13 | #define _PAGE_PRESENT 0x001 |
18 | #define _PAGE_NEWPAGE 0x002 | 14 | #define _PAGE_NEWPAGE 0x002 |
@@ -34,22 +30,11 @@ | |||
34 | 30 | ||
35 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | 31 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; |
36 | 32 | ||
37 | extern void *um_virt_to_phys(struct task_struct *task, unsigned long virt, | ||
38 | pte_t *pte_out); | ||
39 | |||
40 | /* zero page used for uninitialized stuff */ | 33 | /* zero page used for uninitialized stuff */ |
41 | extern unsigned long *empty_zero_page; | 34 | extern unsigned long *empty_zero_page; |
42 | 35 | ||
43 | #define pgtable_cache_init() do ; while (0) | 36 | #define pgtable_cache_init() do ; while (0) |
44 | 37 | ||
45 | /* | ||
46 | * pgd entries used up by user/kernel: | ||
47 | */ | ||
48 | |||
49 | #define USER_PGD_PTRS (TASK_SIZE >> PGDIR_SHIFT) | ||
50 | #define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS) | ||
51 | |||
52 | #ifndef __ASSEMBLY__ | ||
53 | /* Just any arbitrary offset to the start of the vmalloc VM area: the | 38 | /* Just any arbitrary offset to the start of the vmalloc VM area: the |
54 | * current 8MB value just means that there will be a 8MB "hole" after the | 39 | * current 8MB value just means that there will be a 8MB "hole" after the |
55 | * physical memory until the kernel virtual memory starts. That means that | 40 | * physical memory until the kernel virtual memory starts. That means that |
@@ -62,16 +47,12 @@ extern unsigned long end_iomem; | |||
62 | 47 | ||
63 | #define VMALLOC_OFFSET (__va_space) | 48 | #define VMALLOC_OFFSET (__va_space) |
64 | #define VMALLOC_START ((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) | 49 | #define VMALLOC_START ((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) |
65 | |||
66 | #ifdef CONFIG_HIGHMEM | 50 | #ifdef CONFIG_HIGHMEM |
67 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) | 51 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) |
68 | #else | 52 | #else |
69 | # define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) | 53 | # define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) |
70 | #endif | 54 | #endif |
71 | 55 | ||
72 | #define REGION_SHIFT (sizeof(pte_t) * 8 - 4) | ||
73 | #define REGION_MASK (((unsigned long) 0xf) << REGION_SHIFT) | ||
74 | |||
75 | #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY) | 56 | #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY) |
76 | #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY) | 57 | #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY) |
77 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) | 58 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) |
@@ -81,11 +62,12 @@ extern unsigned long end_iomem; | |||
81 | #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED) | 62 | #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED) |
82 | #define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED) | 63 | #define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED) |
83 | #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED) | 64 | #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED) |
84 | #define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED) | ||
85 | 65 | ||
86 | /* | 66 | /* |
87 | * The i386 can't do page protection for execute, and considers that the same are read. | 67 | * The i386 can't do page protection for execute, and considers that the same |
88 | * Also, write permissions imply read permissions. This is the closest we can get.. | 68 | * are read. |
69 | * Also, write permissions imply read permissions. This is the closest we can | ||
70 | * get.. | ||
89 | */ | 71 | */ |
90 | #define __P000 PAGE_NONE | 72 | #define __P000 PAGE_NONE |
91 | #define __P001 PAGE_READONLY | 73 | #define __P001 PAGE_READONLY |
@@ -106,40 +88,16 @@ extern unsigned long end_iomem; | |||
106 | #define __S111 PAGE_SHARED | 88 | #define __S111 PAGE_SHARED |
107 | 89 | ||
108 | /* | 90 | /* |
109 | * Define this if things work differently on an i386 and an i486: | ||
110 | * it will (on an i486) warn about kernel memory accesses that are | ||
111 | * done without a 'access_ok(VERIFY_WRITE,..)' | ||
112 | */ | ||
113 | #undef TEST_VERIFY_AREA | ||
114 | |||
115 | /* page table for 0-4MB for everybody */ | ||
116 | extern unsigned long pg0[1024]; | ||
117 | |||
118 | /* | ||
119 | * ZERO_PAGE is a global shared page that is always zero: used | 91 | * ZERO_PAGE is a global shared page that is always zero: used |
120 | * for zero-mapped memory areas etc.. | 92 | * for zero-mapped memory areas etc.. |
121 | */ | 93 | */ |
122 | |||
123 | #define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) | 94 | #define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) |
124 | 95 | ||
125 | /* number of bits that fit into a memory pointer */ | ||
126 | #define BITS_PER_PTR (8*sizeof(unsigned long)) | ||
127 | |||
128 | /* to align the pointer to a pointer address */ | ||
129 | #define PTR_MASK (~(sizeof(void*)-1)) | ||
130 | |||
131 | /* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */ | ||
132 | /* 64-bit machines, beware! SRB. */ | ||
133 | #define SIZEOF_PTR_LOG2 3 | ||
134 | |||
135 | /* to find an entry in a page-table */ | ||
136 | #define PAGE_PTR(address) \ | ||
137 | ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK) | ||
138 | |||
139 | #define pte_clear(mm,addr,xp) pte_set_val(*(xp), (phys_t) 0, __pgprot(_PAGE_NEWPAGE)) | 96 | #define pte_clear(mm,addr,xp) pte_set_val(*(xp), (phys_t) 0, __pgprot(_PAGE_NEWPAGE)) |
140 | 97 | ||
141 | #define pmd_none(x) (!((unsigned long)pmd_val(x) & ~_PAGE_NEWPAGE)) | 98 | #define pmd_none(x) (!((unsigned long)pmd_val(x) & ~_PAGE_NEWPAGE)) |
142 | #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) | 99 | #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) |
100 | |||
143 | #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) | 101 | #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) |
144 | #define pmd_clear(xp) do { pmd_val(*(xp)) = _PAGE_NEWPAGE; } while (0) | 102 | #define pmd_clear(xp) do { pmd_val(*(xp)) = _PAGE_NEWPAGE; } while (0) |
145 | 103 | ||
@@ -149,14 +107,9 @@ extern unsigned long pg0[1024]; | |||
149 | #define pud_newpage(x) (pud_val(x) & _PAGE_NEWPAGE) | 107 | #define pud_newpage(x) (pud_val(x) & _PAGE_NEWPAGE) |
150 | #define pud_mkuptodate(x) (pud_val(x) &= ~_PAGE_NEWPAGE) | 108 | #define pud_mkuptodate(x) (pud_val(x) &= ~_PAGE_NEWPAGE) |
151 | 109 | ||
152 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) | ||
153 | |||
154 | #define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK) | 110 | #define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK) |
155 | 111 | ||
156 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | 112 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
157 | #define pte_address(x) (__va(pte_val(x) & PAGE_MASK)) | ||
158 | #define mk_phys(a, r) ((a) + (((unsigned long) r) << REGION_SHIFT)) | ||
159 | #define phys_addr(p) ((p) & ~REGION_MASK) | ||
160 | 113 | ||
161 | #define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE)) | 114 | #define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE)) |
162 | 115 | ||
@@ -309,7 +262,8 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval) | |||
309 | 262 | ||
310 | #define phys_to_page(phys) pfn_to_page(phys_to_pfn(phys)) | 263 | #define phys_to_page(phys) pfn_to_page(phys_to_pfn(phys)) |
311 | #define __virt_to_page(virt) phys_to_page(__pa(virt)) | 264 | #define __virt_to_page(virt) phys_to_page(__pa(virt)) |
312 | #define page_to_phys(page) pfn_to_phys(page_to_pfn(page)) | 265 | #define page_to_phys(page) pfn_to_phys((pfn_t) page_to_pfn(page)) |
266 | #define virt_to_page(addr) __virt_to_page((const unsigned long) addr) | ||
313 | 267 | ||
314 | #define mk_pte(page, pgprot) \ | 268 | #define mk_pte(page, pgprot) \ |
315 | ({ pte_t pte; \ | 269 | ({ pte_t pte; \ |
@@ -325,8 +279,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
325 | return pte; | 279 | return pte; |
326 | } | 280 | } |
327 | 281 | ||
328 | #define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | ||
329 | |||
330 | /* | 282 | /* |
331 | * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD] | 283 | * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD] |
332 | * | 284 | * |
@@ -335,8 +287,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
335 | */ | 287 | */ |
336 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | 288 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
337 | 289 | ||
338 | #define pgd_index_k(addr) pgd_index(addr) | ||
339 | |||
340 | /* | 290 | /* |
341 | * pgd_offset() returns a (pgd_t *) | 291 | * pgd_offset() returns a (pgd_t *) |
342 | * pgd_index() is used get the offset into the pgd page's array of pgd_t's; | 292 | * pgd_index() is used get the offset into the pgd page's array of pgd_t's; |
@@ -355,8 +305,12 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
355 | * this macro returns the index of the entry in the pmd page which would | 305 | * this macro returns the index of the entry in the pmd page which would |
356 | * control the given virtual address | 306 | * control the given virtual address |
357 | */ | 307 | */ |
308 | #define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | ||
358 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | 309 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) |
359 | 310 | ||
311 | #define pmd_page_vaddr(pmd) \ | ||
312 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | ||
313 | |||
360 | /* | 314 | /* |
361 | * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE] | 315 | * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE] |
362 | * | 316 | * |
@@ -372,6 +326,9 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
372 | #define pte_unmap(pte) do { } while (0) | 326 | #define pte_unmap(pte) do { } while (0) |
373 | #define pte_unmap_nested(pte) do { } while (0) | 327 | #define pte_unmap_nested(pte) do { } while (0) |
374 | 328 | ||
329 | struct mm_struct; | ||
330 | extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr); | ||
331 | |||
375 | #define update_mmu_cache(vma,address,pte) do ; while (0) | 332 | #define update_mmu_cache(vma,address,pte) do ; while (0) |
376 | 333 | ||
377 | /* Encode and de-code a swap entry */ | 334 | /* Encode and de-code a swap entry */ |
@@ -388,29 +345,4 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
388 | 345 | ||
389 | #include <asm-generic/pgtable.h> | 346 | #include <asm-generic/pgtable.h> |
390 | 347 | ||
391 | #include <asm-generic/pgtable-nopud.h> | ||
392 | |||
393 | #ifdef CONFIG_HIGHMEM | ||
394 | /* Clear a kernel PTE and flush it from the TLB */ | ||
395 | #define kpte_clear_flush(ptep, vaddr) \ | ||
396 | do { \ | ||
397 | pte_clear(&init_mm, vaddr, ptep); \ | ||
398 | __flush_tlb_one(vaddr); \ | ||
399 | } while (0) | ||
400 | #endif | 348 | #endif |
401 | |||
402 | #endif | ||
403 | #endif | ||
404 | |||
405 | #define virt_to_page(addr) __virt_to_page((const unsigned long) addr) | ||
406 | |||
407 | /* | ||
408 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
409 | * Emacs will notice this stuff at the end of the file and automatically | ||
410 | * adjust the settings for this buffer only. This must remain at the end | ||
411 | * of the file. | ||
412 | * --------------------------------------------------------------------------- | ||
413 | * Local variables: | ||
414 | * c-file-style: "linux" | ||
415 | * End: | ||
416 | */ | ||
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h index 78c0599cc80c..b7d9a16a7451 100644 --- a/include/asm-um/processor-generic.h +++ b/include/asm-um/processor-generic.h | |||
@@ -11,6 +11,7 @@ struct pt_regs; | |||
11 | struct task_struct; | 11 | struct task_struct; |
12 | 12 | ||
13 | #include "asm/ptrace.h" | 13 | #include "asm/ptrace.h" |
14 | #include "asm/pgtable.h" | ||
14 | #include "registers.h" | 15 | #include "registers.h" |
15 | #include "sysdep/archsetjmp.h" | 16 | #include "sysdep/archsetjmp.h" |
16 | 17 | ||
@@ -26,7 +27,6 @@ struct thread_struct { | |||
26 | * as of 2.6.11). | 27 | * as of 2.6.11). |
27 | */ | 28 | */ |
28 | int forking; | 29 | int forking; |
29 | int nsyscalls; | ||
30 | struct pt_regs regs; | 30 | struct pt_regs regs; |
31 | int singlestep_syscall; | 31 | int singlestep_syscall; |
32 | void *fault_addr; | 32 | void *fault_addr; |
@@ -58,7 +58,6 @@ struct thread_struct { | |||
58 | #define INIT_THREAD \ | 58 | #define INIT_THREAD \ |
59 | { \ | 59 | { \ |
60 | .forking = 0, \ | 60 | .forking = 0, \ |
61 | .nsyscalls = 0, \ | ||
62 | .regs = EMPTY_REGS, \ | 61 | .regs = EMPTY_REGS, \ |
63 | .fault_addr = NULL, \ | 62 | .fault_addr = NULL, \ |
64 | .prev_sched = NULL, \ | 63 | .prev_sched = NULL, \ |
@@ -68,10 +67,6 @@ struct thread_struct { | |||
68 | .request = { 0 } \ | 67 | .request = { 0 } \ |
69 | } | 68 | } |
70 | 69 | ||
71 | typedef struct { | ||
72 | unsigned long seg; | ||
73 | } mm_segment_t; | ||
74 | |||
75 | extern struct task_struct *alloc_task_struct(void); | 70 | extern struct task_struct *alloc_task_struct(void); |
76 | 71 | ||
77 | static inline void release_thread(struct task_struct *task) | 72 | static inline void release_thread(struct task_struct *task) |
@@ -97,9 +92,7 @@ static inline void mm_copy_segments(struct mm_struct *from_mm, | |||
97 | /* | 92 | /* |
98 | * User space process size: 3GB (default). | 93 | * User space process size: 3GB (default). |
99 | */ | 94 | */ |
100 | extern unsigned long task_size; | 95 | #define TASK_SIZE (CONFIG_TOP_ADDR & PGDIR_MASK) |
101 | |||
102 | #define TASK_SIZE (task_size) | ||
103 | 96 | ||
104 | /* This decides where the kernel will search for a free chunk of vm | 97 | /* This decides where the kernel will search for a free chunk of vm |
105 | * space during mmap's. | 98 | * space during mmap's. |
@@ -128,6 +121,6 @@ extern struct cpuinfo_um cpu_data[]; | |||
128 | 121 | ||
129 | 122 | ||
130 | #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf) | 123 | #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf) |
131 | #define get_wchan(p) (0) | 124 | extern unsigned long get_wchan(struct task_struct *p); |
132 | 125 | ||
133 | #endif | 126 | #endif |
diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h index 595f1c3e1e40..a2b7fe13fe1e 100644 --- a/include/asm-um/processor-i386.h +++ b/include/asm-um/processor-i386.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #include "asm/host_ldt.h" | 10 | #include "asm/host_ldt.h" |
11 | #include "asm/segment.h" | 11 | #include "asm/segment.h" |
12 | 12 | ||
13 | extern int host_has_xmm; | ||
14 | extern int host_has_cmov; | 13 | extern int host_has_cmov; |
15 | 14 | ||
16 | /* include faultinfo structure */ | 15 | /* include faultinfo structure */ |
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h index 6e5fd5c892d0..356b83e2c22e 100644 --- a/include/asm-um/thread_info.h +++ b/include/asm-um/thread_info.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -8,8 +8,9 @@ | |||
8 | 8 | ||
9 | #ifndef __ASSEMBLY__ | 9 | #ifndef __ASSEMBLY__ |
10 | 10 | ||
11 | #include <asm/processor.h> | ||
12 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | #include <asm/page.h> | ||
13 | #include <asm/uaccess.h> | ||
13 | 14 | ||
14 | struct thread_info { | 15 | struct thread_info { |
15 | struct task_struct *task; /* main task structure */ | 16 | struct task_struct *task; /* main task structure */ |
@@ -75,8 +76,8 @@ static inline struct thread_info *current_thread_info(void) | |||
75 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | 76 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ |
76 | #define TIF_SIGPENDING 1 /* signal pending */ | 77 | #define TIF_SIGPENDING 1 /* signal pending */ |
77 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ | 78 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ |
78 | #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling | 79 | #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling |
79 | * TIF_NEED_RESCHED | 80 | * TIF_NEED_RESCHED |
80 | */ | 81 | */ |
81 | #define TIF_RESTART_BLOCK 4 | 82 | #define TIF_RESTART_BLOCK 4 |
82 | #define TIF_MEMDIE 5 | 83 | #define TIF_MEMDIE 5 |
diff --git a/include/asm-um/tlb.h b/include/asm-um/tlb.h index c640033bc1fd..39fc475df6c9 100644 --- a/include/asm-um/tlb.h +++ b/include/asm-um/tlb.h | |||
@@ -1,6 +1,126 @@ | |||
1 | #ifndef __UM_TLB_H | 1 | #ifndef __UM_TLB_H |
2 | #define __UM_TLB_H | 2 | #define __UM_TLB_H |
3 | 3 | ||
4 | #include <asm/arch/tlb.h> | 4 | #include <linux/swap.h> |
5 | #include <asm/percpu.h> | ||
6 | #include <asm/pgalloc.h> | ||
7 | #include <asm/tlbflush.h> | ||
8 | |||
9 | #define tlb_start_vma(tlb, vma) do { } while (0) | ||
10 | #define tlb_end_vma(tlb, vma) do { } while (0) | ||
11 | #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) | ||
12 | |||
13 | /* struct mmu_gather is an opaque type used by the mm code for passing around | ||
14 | * any data needed by arch specific code for tlb_remove_page. | ||
15 | */ | ||
16 | struct mmu_gather { | ||
17 | struct mm_struct *mm; | ||
18 | unsigned int need_flush; /* Really unmapped some ptes? */ | ||
19 | unsigned long start; | ||
20 | unsigned long end; | ||
21 | unsigned int fullmm; /* non-zero means full mm flush */ | ||
22 | }; | ||
23 | |||
24 | /* Users of the generic TLB shootdown code must declare this storage space. */ | ||
25 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); | ||
26 | |||
27 | static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, | ||
28 | unsigned long address) | ||
29 | { | ||
30 | if (tlb->start > address) | ||
31 | tlb->start = address; | ||
32 | if (tlb->end < address + PAGE_SIZE) | ||
33 | tlb->end = address + PAGE_SIZE; | ||
34 | } | ||
35 | |||
36 | static inline void init_tlb_gather(struct mmu_gather *tlb) | ||
37 | { | ||
38 | tlb->need_flush = 0; | ||
39 | |||
40 | tlb->start = TASK_SIZE; | ||
41 | tlb->end = 0; | ||
42 | |||
43 | if (tlb->fullmm) { | ||
44 | tlb->start = 0; | ||
45 | tlb->end = TASK_SIZE; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | /* tlb_gather_mmu | ||
50 | * Return a pointer to an initialized struct mmu_gather. | ||
51 | */ | ||
52 | static inline struct mmu_gather * | ||
53 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | ||
54 | { | ||
55 | struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); | ||
56 | |||
57 | tlb->mm = mm; | ||
58 | tlb->fullmm = full_mm_flush; | ||
59 | |||
60 | init_tlb_gather(tlb); | ||
61 | |||
62 | return tlb; | ||
63 | } | ||
64 | |||
65 | extern void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, | ||
66 | unsigned long end); | ||
67 | |||
68 | static inline void | ||
69 | tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | ||
70 | { | ||
71 | if (!tlb->need_flush) | ||
72 | return; | ||
73 | |||
74 | flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end); | ||
75 | init_tlb_gather(tlb); | ||
76 | } | ||
77 | |||
78 | /* tlb_finish_mmu | ||
79 | * Called at the end of the shootdown operation to free up any resources | ||
80 | * that were required. | ||
81 | */ | ||
82 | static inline void | ||
83 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | ||
84 | { | ||
85 | tlb_flush_mmu(tlb, start, end); | ||
86 | |||
87 | /* keep the page table cache within bounds */ | ||
88 | check_pgt_cache(); | ||
89 | |||
90 | put_cpu_var(mmu_gathers); | ||
91 | } | ||
92 | |||
93 | /* tlb_remove_page | ||
94 | * Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)), | ||
95 | * while handling the additional races in SMP caused by other CPUs | ||
96 | * caching valid mappings in their TLBs. | ||
97 | */ | ||
98 | static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) | ||
99 | { | ||
100 | tlb->need_flush = 1; | ||
101 | free_page_and_swap_cache(page); | ||
102 | return; | ||
103 | } | ||
104 | |||
105 | /** | ||
106 | * tlb_remove_tlb_entry - remember a pte unmapping for later tlb invalidation. | ||
107 | * | ||
108 | * Record the fact that pte's were really umapped in ->need_flush, so we can | ||
109 | * later optimise away the tlb invalidate. This helps when userspace is | ||
110 | * unmapping already-unmapped pages, which happens quite a lot. | ||
111 | */ | ||
112 | #define tlb_remove_tlb_entry(tlb, ptep, address) \ | ||
113 | do { \ | ||
114 | tlb->need_flush = 1; \ | ||
115 | __tlb_remove_tlb_entry(tlb, ptep, address); \ | ||
116 | } while (0) | ||
117 | |||
118 | #define pte_free_tlb(tlb, ptep) __pte_free_tlb(tlb, ptep) | ||
119 | |||
120 | #define pud_free_tlb(tlb, pudp) __pud_free_tlb(tlb, pudp) | ||
121 | |||
122 | #define pmd_free_tlb(tlb, pmdp) __pmd_free_tlb(tlb, pmdp) | ||
123 | |||
124 | #define tlb_migrate_finish(mm) do {} while (0) | ||
5 | 125 | ||
6 | #endif | 126 | #endif |
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h index 077032d4fc47..b9a895d6fa1d 100644 --- a/include/asm-um/uaccess.h +++ b/include/asm-um/uaccess.h | |||
@@ -6,7 +6,15 @@ | |||
6 | #ifndef __UM_UACCESS_H | 6 | #ifndef __UM_UACCESS_H |
7 | #define __UM_UACCESS_H | 7 | #define __UM_UACCESS_H |
8 | 8 | ||
9 | #include "linux/sched.h" | 9 | #include <asm/errno.h> |
10 | #include <asm/processor.h> | ||
11 | |||
12 | /* thread_info has a mm_segment_t in it, so put the definition up here */ | ||
13 | typedef struct { | ||
14 | unsigned long seg; | ||
15 | } mm_segment_t; | ||
16 | |||
17 | #include "linux/thread_info.h" | ||
10 | 18 | ||
11 | #define VERIFY_READ 0 | 19 | #define VERIFY_READ 0 |
12 | #define VERIFY_WRITE 1 | 20 | #define VERIFY_WRITE 1 |
diff --git a/include/asm-x86/bitops_64.h b/include/asm-x86/bitops_64.h index 48adbf56ca60..aaf15194d536 100644 --- a/include/asm-x86/bitops_64.h +++ b/include/asm-x86/bitops_64.h | |||
@@ -37,12 +37,6 @@ static inline long __scanbit(unsigned long val, unsigned long max) | |||
37 | ((off)+(__scanbit(~(((*(unsigned long *)addr)) >> (off)),(size)-(off)))) : \ | 37 | ((off)+(__scanbit(~(((*(unsigned long *)addr)) >> (off)),(size)-(off)))) : \ |
38 | find_next_zero_bit(addr,size,off))) | 38 | find_next_zero_bit(addr,size,off))) |
39 | 39 | ||
40 | /* | ||
41 | * Find string of zero bits in a bitmap. -1 when not found. | ||
42 | */ | ||
43 | extern unsigned long | ||
44 | find_next_zero_string(unsigned long *bitmap, long start, long nbits, int len); | ||
45 | |||
46 | static inline void set_bit_string(unsigned long *bitmap, unsigned long i, | 40 | static inline void set_bit_string(unsigned long *bitmap, unsigned long i, |
47 | int len) | 41 | int len) |
48 | { | 42 | { |
@@ -53,16 +47,6 @@ static inline void set_bit_string(unsigned long *bitmap, unsigned long i, | |||
53 | } | 47 | } |
54 | } | 48 | } |
55 | 49 | ||
56 | static inline void __clear_bit_string(unsigned long *bitmap, unsigned long i, | ||
57 | int len) | ||
58 | { | ||
59 | unsigned long end = i + len; | ||
60 | while (i < end) { | ||
61 | __clear_bit(i, bitmap); | ||
62 | i++; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | /** | 50 | /** |
67 | * ffz - find first zero in word. | 51 | * ffz - find first zero in word. |
68 | * @word: The word to search | 52 | * @word: The word to search |
diff --git a/include/asm-x86/highmem.h b/include/asm-x86/highmem.h index c25cfcaab589..479767c9195f 100644 --- a/include/asm-x86/highmem.h +++ b/include/asm-x86/highmem.h | |||
@@ -38,11 +38,6 @@ extern pte_t *pkmap_page_table; | |||
38 | * easily, subsequent pte tables have to be allocated in one physical | 38 | * easily, subsequent pte tables have to be allocated in one physical |
39 | * chunk of RAM. | 39 | * chunk of RAM. |
40 | */ | 40 | */ |
41 | #ifdef CONFIG_X86_PAE | ||
42 | #define LAST_PKMAP 512 | ||
43 | #else | ||
44 | #define LAST_PKMAP 1024 | ||
45 | #endif | ||
46 | /* | 41 | /* |
47 | * Ordering is: | 42 | * Ordering is: |
48 | * | 43 | * |
@@ -58,7 +53,6 @@ extern pte_t *pkmap_page_table; | |||
58 | * VMALLOC_START | 53 | * VMALLOC_START |
59 | * high_memory | 54 | * high_memory |
60 | */ | 55 | */ |
61 | #define PKMAP_BASE ( (FIXADDR_BOOT_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK ) | ||
62 | #define LAST_PKMAP_MASK (LAST_PKMAP-1) | 56 | #define LAST_PKMAP_MASK (LAST_PKMAP-1) |
63 | #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) | 57 | #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) |
64 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) | 58 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) |
diff --git a/include/asm-x86/pgalloc_32.h b/include/asm-x86/pgalloc_32.h index 6c21ef951dab..bab12718a913 100644 --- a/include/asm-x86/pgalloc_32.h +++ b/include/asm-x86/pgalloc_32.h | |||
@@ -36,17 +36,17 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p | |||
36 | * Allocate and free page tables. | 36 | * Allocate and free page tables. |
37 | */ | 37 | */ |
38 | extern pgd_t *pgd_alloc(struct mm_struct *); | 38 | extern pgd_t *pgd_alloc(struct mm_struct *); |
39 | extern void pgd_free(pgd_t *pgd); | 39 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
40 | 40 | ||
41 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); | 41 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); |
42 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); | 42 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); |
43 | 43 | ||
44 | static inline void pte_free_kernel(pte_t *pte) | 44 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
45 | { | 45 | { |
46 | free_page((unsigned long)pte); | 46 | free_page((unsigned long)pte); |
47 | } | 47 | } |
48 | 48 | ||
49 | static inline void pte_free(struct page *pte) | 49 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
50 | { | 50 | { |
51 | __free_page(pte); | 51 | __free_page(pte); |
52 | } | 52 | } |
@@ -63,7 +63,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
63 | return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); | 63 | return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); |
64 | } | 64 | } |
65 | 65 | ||
66 | static inline void pmd_free(pmd_t *pmd) | 66 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
67 | { | 67 | { |
68 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); | 68 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); |
69 | free_page((unsigned long)pmd); | 69 | free_page((unsigned long)pmd); |
diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h index 8bb564687860..315314ce4bfb 100644 --- a/include/asm-x86/pgalloc_64.h +++ b/include/asm-x86/pgalloc_64.h | |||
@@ -17,7 +17,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p | |||
17 | set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); | 17 | set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); |
18 | } | 18 | } |
19 | 19 | ||
20 | static inline void pmd_free(pmd_t *pmd) | 20 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
21 | { | 21 | { |
22 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); | 22 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); |
23 | free_page((unsigned long)pmd); | 23 | free_page((unsigned long)pmd); |
@@ -33,7 +33,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
33 | return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); | 33 | return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); |
34 | } | 34 | } |
35 | 35 | ||
36 | static inline void pud_free (pud_t *pud) | 36 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
37 | { | 37 | { |
38 | BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); | 38 | BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); |
39 | free_page((unsigned long)pud); | 39 | free_page((unsigned long)pud); |
@@ -77,7 +77,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
77 | return pgd; | 77 | return pgd; |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline void pgd_free(pgd_t *pgd) | 80 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
81 | { | 81 | { |
82 | BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); | 82 | BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); |
83 | pgd_list_del(pgd); | 83 | pgd_list_del(pgd); |
@@ -100,13 +100,13 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add | |||
100 | /* Should really implement gc for free page table pages. This could be | 100 | /* Should really implement gc for free page table pages. This could be |
101 | done with a reference count in struct page. */ | 101 | done with a reference count in struct page. */ |
102 | 102 | ||
103 | static inline void pte_free_kernel(pte_t *pte) | 103 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
104 | { | 104 | { |
105 | BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); | 105 | BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); |
106 | free_page((unsigned long)pte); | 106 | free_page((unsigned long)pte); |
107 | } | 107 | } |
108 | 108 | ||
109 | static inline void pte_free(struct page *pte) | 109 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
110 | { | 110 | { |
111 | __free_page(pte); | 111 | __free_page(pte); |
112 | } | 112 | } |
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h index 935630d17304..80dd438642f6 100644 --- a/include/asm-x86/pgtable_32.h +++ b/include/asm-x86/pgtable_32.h | |||
@@ -66,6 +66,14 @@ void paging_init(void); | |||
66 | #define VMALLOC_OFFSET (8*1024*1024) | 66 | #define VMALLOC_OFFSET (8*1024*1024) |
67 | #define VMALLOC_START (((unsigned long) high_memory + \ | 67 | #define VMALLOC_START (((unsigned long) high_memory + \ |
68 | 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1)) | 68 | 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1)) |
69 | #ifdef CONFIG_X86_PAE | ||
70 | #define LAST_PKMAP 512 | ||
71 | #else | ||
72 | #define LAST_PKMAP 1024 | ||
73 | #endif | ||
74 | |||
75 | #define PKMAP_BASE ((FIXADDR_BOOT_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK) | ||
76 | |||
69 | #ifdef CONFIG_HIGHMEM | 77 | #ifdef CONFIG_HIGHMEM |
70 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) | 78 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) |
71 | #else | 79 | #else |
diff --git a/include/asm-x86/unistd_32.h b/include/asm-x86/unistd_32.h index 8d8f9b5adbb9..984123a68f7c 100644 --- a/include/asm-x86/unistd_32.h +++ b/include/asm-x86/unistd_32.h | |||
@@ -327,9 +327,11 @@ | |||
327 | #define __NR_epoll_pwait 319 | 327 | #define __NR_epoll_pwait 319 |
328 | #define __NR_utimensat 320 | 328 | #define __NR_utimensat 320 |
329 | #define __NR_signalfd 321 | 329 | #define __NR_signalfd 321 |
330 | #define __NR_timerfd 322 | 330 | #define __NR_timerfd_create 322 |
331 | #define __NR_eventfd 323 | 331 | #define __NR_eventfd 323 |
332 | #define __NR_fallocate 324 | 332 | #define __NR_fallocate 324 |
333 | #define __NR_timerfd_settime 325 | ||
334 | #define __NR_timerfd_gettime 326 | ||
333 | 335 | ||
334 | #ifdef __KERNEL__ | 336 | #ifdef __KERNEL__ |
335 | 337 | ||
diff --git a/include/asm-x86/unistd_64.h b/include/asm-x86/unistd_64.h index 5ff4d3e24c34..3883ceb54ef5 100644 --- a/include/asm-x86/unistd_64.h +++ b/include/asm-x86/unistd_64.h | |||
@@ -629,12 +629,17 @@ __SYSCALL(__NR_utimensat, sys_utimensat) | |||
629 | __SYSCALL(__NR_epoll_pwait, sys_epoll_pwait) | 629 | __SYSCALL(__NR_epoll_pwait, sys_epoll_pwait) |
630 | #define __NR_signalfd 282 | 630 | #define __NR_signalfd 282 |
631 | __SYSCALL(__NR_signalfd, sys_signalfd) | 631 | __SYSCALL(__NR_signalfd, sys_signalfd) |
632 | #define __NR_timerfd 283 | 632 | #define __NR_timerfd_create 283 |
633 | __SYSCALL(__NR_timerfd, sys_timerfd) | 633 | __SYSCALL(__NR_timerfd_create, sys_timerfd_create) |
634 | #define __NR_eventfd 284 | 634 | #define __NR_eventfd 284 |
635 | __SYSCALL(__NR_eventfd, sys_eventfd) | 635 | __SYSCALL(__NR_eventfd, sys_eventfd) |
636 | #define __NR_fallocate 285 | 636 | #define __NR_fallocate 285 |
637 | __SYSCALL(__NR_fallocate, sys_fallocate) | 637 | __SYSCALL(__NR_fallocate, sys_fallocate) |
638 | #define __NR_timerfd_settime 286 | ||
639 | __SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) | ||
640 | #define __NR_timerfd_gettime 287 | ||
641 | __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) | ||
642 | |||
638 | 643 | ||
639 | #ifndef __NO_STUBS | 644 | #ifndef __NO_STUBS |
640 | #define __ARCH_WANT_OLD_READDIR | 645 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/include/asm-xtensa/pgalloc.h b/include/asm-xtensa/pgalloc.h index 3e5b56525102..1d51ba5463f9 100644 --- a/include/asm-xtensa/pgalloc.h +++ b/include/asm-xtensa/pgalloc.h | |||
@@ -31,7 +31,7 @@ pgd_alloc(struct mm_struct *mm) | |||
31 | return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER); | 31 | return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER); |
32 | } | 32 | } |
33 | 33 | ||
34 | static inline void pgd_free(pgd_t *pgd) | 34 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
35 | { | 35 | { |
36 | free_page((unsigned long)pgd); | 36 | free_page((unsigned long)pgd); |
37 | } | 37 | } |
@@ -52,12 +52,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
52 | return virt_to_page(pte_alloc_one_kernel(mm, addr)); | 52 | return virt_to_page(pte_alloc_one_kernel(mm, addr)); |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline void pte_free_kernel(pte_t *pte) | 55 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
56 | { | 56 | { |
57 | kmem_cache_free(pgtable_cache, pte); | 57 | kmem_cache_free(pgtable_cache, pte); |
58 | } | 58 | } |
59 | 59 | ||
60 | static inline void pte_free(struct page *page) | 60 | static inline void pte_free(struct mm_struct *mm, struct page *page) |
61 | { | 61 | { |
62 | kmem_cache_free(pgtable_cache, page_address(page)); | 62 | kmem_cache_free(pgtable_cache, page_address(page)); |
63 | } | 63 | } |
diff --git a/include/asm-xtensa/tlb.h b/include/asm-xtensa/tlb.h index 4830232017af..31c220faca02 100644 --- a/include/asm-xtensa/tlb.h +++ b/include/asm-xtensa/tlb.h | |||
@@ -42,6 +42,6 @@ | |||
42 | 42 | ||
43 | #include <asm-generic/tlb.h> | 43 | #include <asm-generic/tlb.h> |
44 | 44 | ||
45 | #define __pte_free_tlb(tlb,pte) pte_free(pte) | 45 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
46 | 46 | ||
47 | #endif /* _XTENSA_TLB_H */ | 47 | #endif /* _XTENSA_TLB_H */ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index c0f9bb78727d..93631229fd5c 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -219,6 +219,7 @@ unifdef-y += i2c-dev.h | |||
219 | unifdef-y += icmp.h | 219 | unifdef-y += icmp.h |
220 | unifdef-y += icmpv6.h | 220 | unifdef-y += icmpv6.h |
221 | unifdef-y += if_addr.h | 221 | unifdef-y += if_addr.h |
222 | unifdef-y += if_addrlabel.h | ||
222 | unifdef-y += if_arp.h | 223 | unifdef-y += if_arp.h |
223 | unifdef-y += if_bridge.h | 224 | unifdef-y += if_bridge.h |
224 | unifdef-y += if_ec.h | 225 | unifdef-y += if_ec.h |
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index abc521cfb084..03e34547d489 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h | |||
@@ -109,6 +109,7 @@ extern int agp_unbind_memory(struct agp_memory *); | |||
109 | extern void agp_enable(struct agp_bridge_data *, u32); | 109 | extern void agp_enable(struct agp_bridge_data *, u32); |
110 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); | 110 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); |
111 | extern void agp_backend_release(struct agp_bridge_data *); | 111 | extern void agp_backend_release(struct agp_bridge_data *); |
112 | extern void agp_flush_chipset(struct agp_bridge_data *); | ||
112 | 113 | ||
113 | #endif /* __KERNEL__ */ | 114 | #endif /* __KERNEL__ */ |
114 | #endif /* _AGP_BACKEND_H */ | 115 | #endif /* _AGP_BACKEND_H */ |
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h index 09fbf7e5a6cb..62aef589eb94 100644 --- a/include/linux/agpgart.h +++ b/include/linux/agpgart.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int) | 38 | #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int) |
39 | #define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*) | 39 | #define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*) |
40 | #define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*) | 40 | #define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*) |
41 | #define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10) | ||
41 | 42 | ||
42 | #define AGP_DEVICE "/dev/agpgart" | 43 | #define AGP_DEVICE "/dev/agpgart" |
43 | 44 | ||
diff --git a/include/linux/capability.h b/include/linux/capability.h index bb017edffd56..7d50ff6d269f 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -14,7 +14,6 @@ | |||
14 | #define _LINUX_CAPABILITY_H | 14 | #define _LINUX_CAPABILITY_H |
15 | 15 | ||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/compiler.h> | ||
18 | 17 | ||
19 | struct task_struct; | 18 | struct task_struct; |
20 | 19 | ||
@@ -23,13 +22,20 @@ struct task_struct; | |||
23 | kernel might be somewhat backwards compatible, but don't bet on | 22 | kernel might be somewhat backwards compatible, but don't bet on |
24 | it. */ | 23 | it. */ |
25 | 24 | ||
26 | /* XXX - Note, cap_t, is defined by POSIX to be an "opaque" pointer to | 25 | /* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to |
27 | a set of three capability sets. The transposition of 3*the | 26 | a set of three capability sets. The transposition of 3*the |
28 | following structure to such a composite is better handled in a user | 27 | following structure to such a composite is better handled in a user |
29 | library since the draft standard requires the use of malloc/free | 28 | library since the draft standard requires the use of malloc/free |
30 | etc.. */ | 29 | etc.. */ |
31 | 30 | ||
32 | #define _LINUX_CAPABILITY_VERSION 0x19980330 | 31 | #define _LINUX_CAPABILITY_VERSION_1 0x19980330 |
32 | #define _LINUX_CAPABILITY_U32S_1 1 | ||
33 | |||
34 | #define _LINUX_CAPABILITY_VERSION_2 0x20071026 | ||
35 | #define _LINUX_CAPABILITY_U32S_2 2 | ||
36 | |||
37 | #define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_2 | ||
38 | #define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_2 | ||
33 | 39 | ||
34 | typedef struct __user_cap_header_struct { | 40 | typedef struct __user_cap_header_struct { |
35 | __u32 version; | 41 | __u32 version; |
@@ -42,41 +48,42 @@ typedef struct __user_cap_data_struct { | |||
42 | __u32 inheritable; | 48 | __u32 inheritable; |
43 | } __user *cap_user_data_t; | 49 | } __user *cap_user_data_t; |
44 | 50 | ||
51 | |||
45 | #define XATTR_CAPS_SUFFIX "capability" | 52 | #define XATTR_CAPS_SUFFIX "capability" |
46 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | 53 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX |
47 | 54 | ||
48 | #define XATTR_CAPS_SZ (3*sizeof(__le32)) | ||
49 | #define VFS_CAP_REVISION_MASK 0xFF000000 | 55 | #define VFS_CAP_REVISION_MASK 0xFF000000 |
56 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK | ||
57 | #define VFS_CAP_FLAGS_EFFECTIVE 0x000001 | ||
58 | |||
50 | #define VFS_CAP_REVISION_1 0x01000000 | 59 | #define VFS_CAP_REVISION_1 0x01000000 |
60 | #define VFS_CAP_U32_1 1 | ||
61 | #define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1)) | ||
51 | 62 | ||
52 | #define VFS_CAP_REVISION VFS_CAP_REVISION_1 | 63 | #define VFS_CAP_REVISION_2 0x02000000 |
64 | #define VFS_CAP_U32_2 2 | ||
65 | #define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2)) | ||
66 | |||
67 | #define XATTR_CAPS_SZ XATTR_CAPS_SZ_2 | ||
68 | #define VFS_CAP_U32 VFS_CAP_U32_2 | ||
69 | #define VFS_CAP_REVISION VFS_CAP_REVISION_2 | ||
53 | 70 | ||
54 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK | ||
55 | #define VFS_CAP_FLAGS_EFFECTIVE 0x000001 | ||
56 | 71 | ||
57 | struct vfs_cap_data { | 72 | struct vfs_cap_data { |
58 | __u32 magic_etc; /* Little endian */ | 73 | __le32 magic_etc; /* Little endian */ |
59 | __u32 permitted; /* Little endian */ | 74 | struct { |
60 | __u32 inheritable; /* Little endian */ | 75 | __le32 permitted; /* Little endian */ |
76 | __le32 inheritable; /* Little endian */ | ||
77 | } data[VFS_CAP_U32]; | ||
61 | }; | 78 | }; |
62 | 79 | ||
63 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
64 | 81 | ||
65 | /* #define STRICT_CAP_T_TYPECHECKS */ | ||
66 | |||
67 | #ifdef STRICT_CAP_T_TYPECHECKS | ||
68 | |||
69 | typedef struct kernel_cap_struct { | 82 | typedef struct kernel_cap_struct { |
70 | __u32 cap; | 83 | __u32 cap[_LINUX_CAPABILITY_U32S]; |
71 | } kernel_cap_t; | 84 | } kernel_cap_t; |
72 | 85 | ||
73 | #else | 86 | #define _USER_CAP_HEADER_SIZE (sizeof(struct __user_cap_header_struct)) |
74 | |||
75 | typedef __u32 kernel_cap_t; | ||
76 | |||
77 | #endif | ||
78 | |||
79 | #define _USER_CAP_HEADER_SIZE (2*sizeof(__u32)) | ||
80 | #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) | 87 | #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) |
81 | 88 | ||
82 | #endif | 89 | #endif |
@@ -119,10 +126,6 @@ typedef __u32 kernel_cap_t; | |||
119 | 126 | ||
120 | #define CAP_FSETID 4 | 127 | #define CAP_FSETID 4 |
121 | 128 | ||
122 | /* Used to decide between falling back on the old suser() or fsuser(). */ | ||
123 | |||
124 | #define CAP_FS_MASK 0x1f | ||
125 | |||
126 | /* Overrides the restriction that the real or effective user ID of a | 129 | /* Overrides the restriction that the real or effective user ID of a |
127 | process sending a signal must match the real or effective user ID | 130 | process sending a signal must match the real or effective user ID |
128 | of the process receiving the signal. */ | 131 | of the process receiving the signal. */ |
@@ -145,8 +148,14 @@ typedef __u32 kernel_cap_t; | |||
145 | ** Linux-specific capabilities | 148 | ** Linux-specific capabilities |
146 | **/ | 149 | **/ |
147 | 150 | ||
148 | /* Transfer any capability in your permitted set to any pid, | 151 | /* Without VFS support for capabilities: |
149 | remove any capability in your permitted set from any pid */ | 152 | * Transfer any capability in your permitted set to any pid, |
153 | * remove any capability in your permitted set from any pid | ||
154 | * With VFS support for capabilities (neither of above, but) | ||
155 | * Add any capability from current's capability bounding set | ||
156 | * to the current process' inheritable set | ||
157 | * Allow taking bits out of capability bounding set | ||
158 | */ | ||
150 | 159 | ||
151 | #define CAP_SETPCAP 8 | 160 | #define CAP_SETPCAP 8 |
152 | 161 | ||
@@ -195,7 +204,6 @@ typedef __u32 kernel_cap_t; | |||
195 | #define CAP_IPC_OWNER 15 | 204 | #define CAP_IPC_OWNER 15 |
196 | 205 | ||
197 | /* Insert and remove kernel modules - modify kernel without limit */ | 206 | /* Insert and remove kernel modules - modify kernel without limit */ |
198 | /* Modify cap_bset */ | ||
199 | #define CAP_SYS_MODULE 16 | 207 | #define CAP_SYS_MODULE 16 |
200 | 208 | ||
201 | /* Allow ioperm/iopl access */ | 209 | /* Allow ioperm/iopl access */ |
@@ -307,74 +315,183 @@ typedef __u32 kernel_cap_t; | |||
307 | 315 | ||
308 | #define CAP_SETFCAP 31 | 316 | #define CAP_SETFCAP 31 |
309 | 317 | ||
318 | /* Override MAC access. | ||
319 | The base kernel enforces no MAC policy. | ||
320 | An LSM may enforce a MAC policy, and if it does and it chooses | ||
321 | to implement capability based overrides of that policy, this is | ||
322 | the capability it should use to do so. */ | ||
323 | |||
324 | #define CAP_MAC_OVERRIDE 32 | ||
325 | |||
326 | /* Allow MAC configuration or state changes. | ||
327 | The base kernel requires no MAC configuration. | ||
328 | An LSM may enforce a MAC policy, and if it does and it chooses | ||
329 | to implement capability based checks on modifications to that | ||
330 | policy or the data required to maintain it, this is the | ||
331 | capability it should use to do so. */ | ||
332 | |||
333 | #define CAP_MAC_ADMIN 33 | ||
334 | |||
335 | #define CAP_LAST_CAP CAP_MAC_ADMIN | ||
336 | |||
337 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) | ||
338 | |||
339 | /* | ||
340 | * Bit location of each capability (used by user-space library and kernel) | ||
341 | */ | ||
342 | |||
343 | #define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */ | ||
344 | #define CAP_TO_MASK(x) (1 << ((x) & 31)) /* mask for indexed __u32 */ | ||
345 | |||
310 | #ifdef __KERNEL__ | 346 | #ifdef __KERNEL__ |
311 | 347 | ||
312 | /* | 348 | /* |
313 | * Internal kernel functions only | 349 | * Internal kernel functions only |
314 | */ | 350 | */ |
315 | 351 | ||
316 | #ifdef STRICT_CAP_T_TYPECHECKS | 352 | #define CAP_FOR_EACH_U32(__capi) \ |
353 | for (__capi = 0; __capi < _LINUX_CAPABILITY_U32S; ++__capi) | ||
354 | |||
355 | # define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \ | ||
356 | | CAP_TO_MASK(CAP_DAC_OVERRIDE) \ | ||
357 | | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \ | ||
358 | | CAP_TO_MASK(CAP_FOWNER) \ | ||
359 | | CAP_TO_MASK(CAP_FSETID)) | ||
360 | |||
361 | # define CAP_FS_MASK_B1 (CAP_TO_MASK(CAP_MAC_OVERRIDE)) | ||
362 | |||
363 | #if _LINUX_CAPABILITY_U32S != 2 | ||
364 | # error Fix up hand-coded capability macro initializers | ||
365 | #else /* HAND-CODED capability initializers */ | ||
366 | |||
367 | # define CAP_EMPTY_SET {{ 0, 0 }} | ||
368 | # define CAP_FULL_SET {{ ~0, ~0 }} | ||
369 | # define CAP_INIT_EFF_SET {{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }} | ||
370 | # define CAP_FS_SET {{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } } | ||
371 | # define CAP_NFSD_SET {{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \ | ||
372 | CAP_FS_MASK_B1 } } | ||
373 | |||
374 | #endif /* _LINUX_CAPABILITY_U32S != 2 */ | ||
375 | |||
376 | #define CAP_INIT_INH_SET CAP_EMPTY_SET | ||
377 | |||
378 | # define cap_clear(c) do { (c) = __cap_empty_set; } while (0) | ||
379 | # define cap_set_full(c) do { (c) = __cap_full_set; } while (0) | ||
380 | # define cap_set_init_eff(c) do { (c) = __cap_init_eff_set; } while (0) | ||
381 | |||
382 | #define cap_raise(c, flag) ((c).cap[CAP_TO_INDEX(flag)] |= CAP_TO_MASK(flag)) | ||
383 | #define cap_lower(c, flag) ((c).cap[CAP_TO_INDEX(flag)] &= ~CAP_TO_MASK(flag)) | ||
384 | #define cap_raised(c, flag) ((c).cap[CAP_TO_INDEX(flag)] & CAP_TO_MASK(flag)) | ||
385 | |||
386 | #define CAP_BOP_ALL(c, a, b, OP) \ | ||
387 | do { \ | ||
388 | unsigned __capi; \ | ||
389 | CAP_FOR_EACH_U32(__capi) { \ | ||
390 | c.cap[__capi] = a.cap[__capi] OP b.cap[__capi]; \ | ||
391 | } \ | ||
392 | } while (0) | ||
393 | |||
394 | #define CAP_UOP_ALL(c, a, OP) \ | ||
395 | do { \ | ||
396 | unsigned __capi; \ | ||
397 | CAP_FOR_EACH_U32(__capi) { \ | ||
398 | c.cap[__capi] = OP a.cap[__capi]; \ | ||
399 | } \ | ||
400 | } while (0) | ||
401 | |||
402 | static inline kernel_cap_t cap_combine(const kernel_cap_t a, | ||
403 | const kernel_cap_t b) | ||
404 | { | ||
405 | kernel_cap_t dest; | ||
406 | CAP_BOP_ALL(dest, a, b, |); | ||
407 | return dest; | ||
408 | } | ||
317 | 409 | ||
318 | #define to_cap_t(x) { x } | 410 | static inline kernel_cap_t cap_intersect(const kernel_cap_t a, |
319 | #define cap_t(x) (x).cap | 411 | const kernel_cap_t b) |
412 | { | ||
413 | kernel_cap_t dest; | ||
414 | CAP_BOP_ALL(dest, a, b, &); | ||
415 | return dest; | ||
416 | } | ||
320 | 417 | ||
321 | #else | 418 | static inline kernel_cap_t cap_drop(const kernel_cap_t a, |
419 | const kernel_cap_t drop) | ||
420 | { | ||
421 | kernel_cap_t dest; | ||
422 | CAP_BOP_ALL(dest, a, drop, &~); | ||
423 | return dest; | ||
424 | } | ||
322 | 425 | ||
323 | #define to_cap_t(x) (x) | 426 | static inline kernel_cap_t cap_invert(const kernel_cap_t c) |
324 | #define cap_t(x) (x) | 427 | { |
428 | kernel_cap_t dest; | ||
429 | CAP_UOP_ALL(dest, c, ~); | ||
430 | return dest; | ||
431 | } | ||
325 | 432 | ||
326 | #endif | 433 | static inline int cap_isclear(const kernel_cap_t a) |
434 | { | ||
435 | unsigned __capi; | ||
436 | CAP_FOR_EACH_U32(__capi) { | ||
437 | if (a.cap[__capi] != 0) | ||
438 | return 0; | ||
439 | } | ||
440 | return 1; | ||
441 | } | ||
327 | 442 | ||
328 | #define CAP_EMPTY_SET to_cap_t(0) | 443 | static inline int cap_issubset(const kernel_cap_t a, const kernel_cap_t set) |
329 | #define CAP_FULL_SET to_cap_t(~0) | 444 | { |
330 | #define CAP_INIT_EFF_SET to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP)) | 445 | kernel_cap_t dest; |
331 | #define CAP_INIT_INH_SET to_cap_t(0) | 446 | dest = cap_drop(a, set); |
447 | return cap_isclear(dest); | ||
448 | } | ||
332 | 449 | ||
333 | #define CAP_TO_MASK(x) (1 << (x)) | 450 | /* Used to decide between falling back on the old suser() or fsuser(). */ |
334 | #define cap_raise(c, flag) (cap_t(c) |= CAP_TO_MASK(flag)) | ||
335 | #define cap_lower(c, flag) (cap_t(c) &= ~CAP_TO_MASK(flag)) | ||
336 | #define cap_raised(c, flag) (cap_t(c) & CAP_TO_MASK(flag)) | ||
337 | 451 | ||
338 | static inline kernel_cap_t cap_combine(kernel_cap_t a, kernel_cap_t b) | 452 | static inline int cap_is_fs_cap(int cap) |
339 | { | 453 | { |
340 | kernel_cap_t dest; | 454 | const kernel_cap_t __cap_fs_set = CAP_FS_SET; |
341 | cap_t(dest) = cap_t(a) | cap_t(b); | 455 | return !!(CAP_TO_MASK(cap) & __cap_fs_set.cap[CAP_TO_INDEX(cap)]); |
342 | return dest; | ||
343 | } | 456 | } |
344 | 457 | ||
345 | static inline kernel_cap_t cap_intersect(kernel_cap_t a, kernel_cap_t b) | 458 | static inline kernel_cap_t cap_drop_fs_set(const kernel_cap_t a) |
346 | { | 459 | { |
347 | kernel_cap_t dest; | 460 | const kernel_cap_t __cap_fs_set = CAP_FS_SET; |
348 | cap_t(dest) = cap_t(a) & cap_t(b); | 461 | return cap_drop(a, __cap_fs_set); |
349 | return dest; | ||
350 | } | 462 | } |
351 | 463 | ||
352 | static inline kernel_cap_t cap_drop(kernel_cap_t a, kernel_cap_t drop) | 464 | static inline kernel_cap_t cap_raise_fs_set(const kernel_cap_t a, |
465 | const kernel_cap_t permitted) | ||
353 | { | 466 | { |
354 | kernel_cap_t dest; | 467 | const kernel_cap_t __cap_fs_set = CAP_FS_SET; |
355 | cap_t(dest) = cap_t(a) & ~cap_t(drop); | 468 | return cap_combine(a, |
356 | return dest; | 469 | cap_intersect(permitted, __cap_fs_set)); |
357 | } | 470 | } |
358 | 471 | ||
359 | static inline kernel_cap_t cap_invert(kernel_cap_t c) | 472 | static inline kernel_cap_t cap_drop_nfsd_set(const kernel_cap_t a) |
360 | { | 473 | { |
361 | kernel_cap_t dest; | 474 | const kernel_cap_t __cap_fs_set = CAP_NFSD_SET; |
362 | cap_t(dest) = ~cap_t(c); | 475 | return cap_drop(a, __cap_fs_set); |
363 | return dest; | ||
364 | } | 476 | } |
365 | 477 | ||
366 | #define cap_isclear(c) (!cap_t(c)) | 478 | static inline kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a, |
367 | #define cap_issubset(a,set) (!(cap_t(a) & ~cap_t(set))) | 479 | const kernel_cap_t permitted) |
368 | 480 | { | |
369 | #define cap_clear(c) do { cap_t(c) = 0; } while(0) | 481 | const kernel_cap_t __cap_nfsd_set = CAP_NFSD_SET; |
370 | #define cap_set_full(c) do { cap_t(c) = ~0; } while(0) | 482 | return cap_combine(a, |
371 | #define cap_mask(c,mask) do { cap_t(c) &= cap_t(mask); } while(0) | 483 | cap_intersect(permitted, __cap_nfsd_set)); |
484 | } | ||
372 | 485 | ||
373 | #define cap_is_fs_cap(c) (CAP_TO_MASK(c) & CAP_FS_MASK) | 486 | extern const kernel_cap_t __cap_empty_set; |
487 | extern const kernel_cap_t __cap_full_set; | ||
488 | extern const kernel_cap_t __cap_init_eff_set; | ||
374 | 489 | ||
375 | int capable(int cap); | 490 | int capable(int cap); |
376 | int __capable(struct task_struct *t, int cap); | 491 | int __capable(struct task_struct *t, int cap); |
377 | 492 | ||
493 | extern long cap_prctl_drop(unsigned long cap); | ||
494 | |||
378 | #endif /* __KERNEL__ */ | 495 | #endif /* __KERNEL__ */ |
379 | 496 | ||
380 | #endif /* !_LINUX_CAPABILITY_H */ | 497 | #endif /* !_LINUX_CAPABILITY_H */ |
diff --git a/include/linux/compat.h b/include/linux/compat.h index d38655f2be70..ae0a483bef9b 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -279,8 +279,11 @@ asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, | |||
279 | asmlinkage long compat_sys_signalfd(int ufd, | 279 | asmlinkage long compat_sys_signalfd(int ufd, |
280 | const compat_sigset_t __user *sigmask, | 280 | const compat_sigset_t __user *sigmask, |
281 | compat_size_t sigsetsize); | 281 | compat_size_t sigsetsize); |
282 | asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags, | 282 | asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, |
283 | const struct compat_itimerspec __user *utmr); | 283 | const struct compat_itimerspec __user *utmr, |
284 | struct compat_itimerspec __user *otmr); | ||
285 | asmlinkage long compat_sys_timerfd_gettime(int ufd, | ||
286 | struct compat_itimerspec __user *otmr); | ||
284 | 287 | ||
285 | #endif /* CONFIG_COMPAT */ | 288 | #endif /* CONFIG_COMPAT */ |
286 | #endif /* _LINUX_COMPAT_H */ | 289 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/device.h b/include/linux/device.h index 479c0b31593c..2258d89bf523 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -410,6 +410,15 @@ extern int devres_release_group(struct device *dev, void *id); | |||
410 | extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); | 410 | extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); |
411 | extern void devm_kfree(struct device *dev, void *p); | 411 | extern void devm_kfree(struct device *dev, void *p); |
412 | 412 | ||
413 | struct device_dma_parameters { | ||
414 | /* | ||
415 | * a low level driver may set these to teach IOMMU code about | ||
416 | * sg limitations. | ||
417 | */ | ||
418 | unsigned int max_segment_size; | ||
419 | unsigned long segment_boundary_mask; | ||
420 | }; | ||
421 | |||
413 | struct device { | 422 | struct device { |
414 | struct klist klist_children; | 423 | struct klist klist_children; |
415 | struct klist_node knode_parent; /* node in sibling list */ | 424 | struct klist_node knode_parent; /* node in sibling list */ |
@@ -445,6 +454,8 @@ struct device { | |||
445 | 64 bit addresses for consistent | 454 | 64 bit addresses for consistent |
446 | allocations such descriptors. */ | 455 | allocations such descriptors. */ |
447 | 456 | ||
457 | struct device_dma_parameters *dma_parms; | ||
458 | |||
448 | struct list_head dma_pools; /* dma pools (if dma'ble) */ | 459 | struct list_head dma_pools; /* dma pools (if dma'ble) */ |
449 | 460 | ||
450 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem | 461 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 4470950892be..332030709623 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -60,6 +60,36 @@ static inline int is_device_dma_capable(struct device *dev) | |||
60 | 60 | ||
61 | extern u64 dma_get_required_mask(struct device *dev); | 61 | extern u64 dma_get_required_mask(struct device *dev); |
62 | 62 | ||
63 | static inline unsigned int dma_get_max_seg_size(struct device *dev) | ||
64 | { | ||
65 | return dev->dma_parms ? dev->dma_parms->max_segment_size : 65536; | ||
66 | } | ||
67 | |||
68 | static inline unsigned int dma_set_max_seg_size(struct device *dev, | ||
69 | unsigned int size) | ||
70 | { | ||
71 | if (dev->dma_parms) { | ||
72 | dev->dma_parms->max_segment_size = size; | ||
73 | return 0; | ||
74 | } else | ||
75 | return -EIO; | ||
76 | } | ||
77 | |||
78 | static inline unsigned long dma_get_seg_boundary(struct device *dev) | ||
79 | { | ||
80 | return dev->dma_parms ? | ||
81 | dev->dma_parms->segment_boundary_mask : 0xffffffff; | ||
82 | } | ||
83 | |||
84 | static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask) | ||
85 | { | ||
86 | if (dev->dma_parms) { | ||
87 | dev->dma_parms->segment_boundary_mask = mask; | ||
88 | return 0; | ||
89 | } else | ||
90 | return -EIO; | ||
91 | } | ||
92 | |||
63 | /* flags for the coherent memory api */ | 93 | /* flags for the coherent memory api */ |
64 | #define DMA_MEMORY_MAP 0x01 | 94 | #define DMA_MEMORY_MAP 0x01 |
65 | #define DMA_MEMORY_IO 0x02 | 95 | #define DMA_MEMORY_IO 0x02 |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 7e93a9ae7064..0c6ce515185d 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -228,5 +228,7 @@ extern void FASTCALL(free_cold_page(struct page *page)); | |||
228 | 228 | ||
229 | void page_alloc_init(void); | 229 | void page_alloc_init(void); |
230 | void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); | 230 | void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); |
231 | void drain_all_pages(void); | ||
232 | void drain_local_pages(void *dummy); | ||
231 | 233 | ||
232 | #endif /* __LINUX_GFP_H */ | 234 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 1fcb0033179e..7dcbc82f3b7b 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -68,8 +68,6 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr) | |||
68 | void *addr = kmap_atomic(page, KM_USER0); | 68 | void *addr = kmap_atomic(page, KM_USER0); |
69 | clear_user_page(addr, vaddr, page); | 69 | clear_user_page(addr, vaddr, page); |
70 | kunmap_atomic(addr, KM_USER0); | 70 | kunmap_atomic(addr, KM_USER0); |
71 | /* Make sure this page is cleared on other CPU's too before using it */ | ||
72 | smp_wmb(); | ||
73 | } | 71 | } |
74 | 72 | ||
75 | #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 73 | #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
@@ -124,28 +122,40 @@ static inline void clear_highpage(struct page *page) | |||
124 | kunmap_atomic(kaddr, KM_USER0); | 122 | kunmap_atomic(kaddr, KM_USER0); |
125 | } | 123 | } |
126 | 124 | ||
127 | /* | 125 | static inline void zero_user_segments(struct page *page, |
128 | * Same but also flushes aliased cache contents to RAM. | 126 | unsigned start1, unsigned end1, |
129 | * | 127 | unsigned start2, unsigned end2) |
130 | * This must be a macro because KM_USER0 and friends aren't defined if | 128 | { |
131 | * !CONFIG_HIGHMEM | 129 | void *kaddr = kmap_atomic(page, KM_USER0); |
132 | */ | 130 | |
133 | #define zero_user_page(page, offset, size, km_type) \ | 131 | BUG_ON(end1 > PAGE_SIZE || end2 > PAGE_SIZE); |
134 | do { \ | 132 | |
135 | void *kaddr; \ | 133 | if (end1 > start1) |
136 | \ | 134 | memset(kaddr + start1, 0, end1 - start1); |
137 | BUG_ON((offset) + (size) > PAGE_SIZE); \ | 135 | |
138 | \ | 136 | if (end2 > start2) |
139 | kaddr = kmap_atomic(page, km_type); \ | 137 | memset(kaddr + start2, 0, end2 - start2); |
140 | memset((char *)kaddr + (offset), 0, (size)); \ | 138 | |
141 | flush_dcache_page(page); \ | 139 | kunmap_atomic(kaddr, KM_USER0); |
142 | kunmap_atomic(kaddr, (km_type)); \ | 140 | flush_dcache_page(page); |
143 | } while (0) | 141 | } |
142 | |||
143 | static inline void zero_user_segment(struct page *page, | ||
144 | unsigned start, unsigned end) | ||
145 | { | ||
146 | zero_user_segments(page, start, end, 0, 0); | ||
147 | } | ||
148 | |||
149 | static inline void zero_user(struct page *page, | ||
150 | unsigned start, unsigned size) | ||
151 | { | ||
152 | zero_user_segments(page, start, start + size, 0, 0); | ||
153 | } | ||
144 | 154 | ||
145 | static inline void __deprecated memclear_highpage_flush(struct page *page, | 155 | static inline void __deprecated memclear_highpage_flush(struct page *page, |
146 | unsigned int offset, unsigned int size) | 156 | unsigned int offset, unsigned int size) |
147 | { | 157 | { |
148 | zero_user_page(page, offset, size, KM_USER0); | 158 | zero_user(page, offset, size); |
149 | } | 159 | } |
150 | 160 | ||
151 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE | 161 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE |
@@ -160,8 +170,6 @@ static inline void copy_user_highpage(struct page *to, struct page *from, | |||
160 | copy_user_page(vto, vfrom, vaddr, to); | 170 | copy_user_page(vto, vfrom, vaddr, to); |
161 | kunmap_atomic(vfrom, KM_USER0); | 171 | kunmap_atomic(vfrom, KM_USER0); |
162 | kunmap_atomic(vto, KM_USER1); | 172 | kunmap_atomic(vto, KM_USER1); |
163 | /* Make sure this page is cleared on other CPU's too before using it */ | ||
164 | smp_wmb(); | ||
165 | } | 173 | } |
166 | 174 | ||
167 | #endif | 175 | #endif |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index f79dcba4b2c1..8371b664b41f 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -301,9 +301,16 @@ static inline int hrtimer_is_queued(struct hrtimer *timer) | |||
301 | } | 301 | } |
302 | 302 | ||
303 | /* Forward a hrtimer so it expires after now: */ | 303 | /* Forward a hrtimer so it expires after now: */ |
304 | extern unsigned long | 304 | extern u64 |
305 | hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); | 305 | hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); |
306 | 306 | ||
307 | /* Forward a hrtimer so it expires after the hrtimer's current now */ | ||
308 | static inline u64 hrtimer_forward_now(struct hrtimer *timer, | ||
309 | ktime_t interval) | ||
310 | { | ||
311 | return hrtimer_forward(timer, timer->base->get_time(), interval); | ||
312 | } | ||
313 | |||
307 | /* Precise sleep: */ | 314 | /* Precise sleep: */ |
308 | extern long hrtimer_nanosleep(struct timespec *rqtp, | 315 | extern long hrtimer_nanosleep(struct timespec *rqtp, |
309 | struct timespec *rmtp, | 316 | struct timespec *rmtp, |
@@ -322,9 +329,9 @@ extern void hrtimer_run_pending(void); | |||
322 | extern void __init hrtimers_init(void); | 329 | extern void __init hrtimers_init(void); |
323 | 330 | ||
324 | #if BITS_PER_LONG < 64 | 331 | #if BITS_PER_LONG < 64 |
325 | extern unsigned long ktime_divns(const ktime_t kt, s64 div); | 332 | extern u64 ktime_divns(const ktime_t kt, s64 div); |
326 | #else /* BITS_PER_LONG < 64 */ | 333 | #else /* BITS_PER_LONG < 64 */ |
327 | # define ktime_divns(kt, div) (unsigned long)((kt).tv64 / (div)) | 334 | # define ktime_divns(kt, div) (u64)((kt).tv64 / (div)) |
328 | #endif | 335 | #endif |
329 | 336 | ||
330 | /* Show pending timers: */ | 337 | /* Show pending timers: */ |
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index 85d11916e9ea..42131820bb89 100644 --- a/include/linux/hw_random.h +++ b/include/linux/hw_random.h | |||
@@ -44,7 +44,15 @@ struct hwrng { | |||
44 | /** Register a new Hardware Random Number Generator driver. */ | 44 | /** Register a new Hardware Random Number Generator driver. */ |
45 | extern int hwrng_register(struct hwrng *rng); | 45 | extern int hwrng_register(struct hwrng *rng); |
46 | /** Unregister a Hardware Random Number Generator driver. */ | 46 | /** Unregister a Hardware Random Number Generator driver. */ |
47 | extern void hwrng_unregister(struct hwrng *rng); | 47 | extern void __hwrng_unregister(struct hwrng *rng, bool suspended); |
48 | static inline void hwrng_unregister(struct hwrng *rng) | ||
49 | { | ||
50 | __hwrng_unregister(rng, false); | ||
51 | } | ||
52 | static inline void hwrng_unregister_suspended(struct hwrng *rng) | ||
53 | { | ||
54 | __hwrng_unregister(rng, true); | ||
55 | } | ||
48 | 56 | ||
49 | #endif /* __KERNEL__ */ | 57 | #endif /* __KERNEL__ */ |
50 | #endif /* LINUX_HWRANDOM_H_ */ | 58 | #endif /* LINUX_HWRANDOM_H_ */ |
diff --git a/include/linux/i2c/pca9539.h b/include/linux/i2c/pca9539.h new file mode 100644 index 000000000000..611d84ab7a30 --- /dev/null +++ b/include/linux/i2c/pca9539.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* platform data for the PCA9539 16-bit I/O expander driver */ | ||
2 | |||
3 | struct pca9539_platform_data { | ||
4 | /* number of the first GPIO */ | ||
5 | unsigned gpio_base; | ||
6 | |||
7 | /* initial polarity inversion setting */ | ||
8 | uint16_t invert; | ||
9 | |||
10 | void *context; /* param to setup/teardown */ | ||
11 | |||
12 | int (*setup)(struct i2c_client *client, | ||
13 | unsigned gpio, unsigned ngpio, | ||
14 | void *context); | ||
15 | int (*teardown)(struct i2c_client *client, | ||
16 | unsigned gpio, unsigned ngpio, | ||
17 | void *context); | ||
18 | }; | ||
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h new file mode 100644 index 000000000000..ba8ea6e16476 --- /dev/null +++ b/include/linux/i2c/pcf857x.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef __LINUX_PCF857X_H | ||
2 | #define __LINUX_PCF857X_H | ||
3 | |||
4 | /** | ||
5 | * struct pcf857x_platform_data - data to set up pcf857x driver | ||
6 | * @gpio_base: number of the chip's first GPIO | ||
7 | * @n_latch: optional bit-inverse of initial register value; if | ||
8 | * you leave this initialized to zero the driver will act | ||
9 | * like the chip was just reset | ||
10 | * @setup: optional callback issued once the GPIOs are valid | ||
11 | * @teardown: optional callback issued before the GPIOs are invalidated | ||
12 | * @context: optional parameter passed to setup() and teardown() | ||
13 | * | ||
14 | * In addition to the I2C_BOARD_INFO() state appropriate to each chip, | ||
15 | * the i2c_board_info used with the pcf875x driver must provide the | ||
16 | * chip "type" ("pcf8574", "pcf8574a", "pcf8575", "pcf8575c") and its | ||
17 | * platform_data (pointer to one of these structures) with at least | ||
18 | * the gpio_base value initialized. | ||
19 | * | ||
20 | * The @setup callback may be used with the kind of board-specific glue | ||
21 | * which hands the (now-valid) GPIOs to other drivers, or which puts | ||
22 | * devices in their initial states using these GPIOs. | ||
23 | * | ||
24 | * These GPIO chips are only "quasi-bidirectional"; read the chip specs | ||
25 | * to understand the behavior. They don't have separate registers to | ||
26 | * record which pins are used for input or output, record which output | ||
27 | * values are driven, or provide access to input values. That must be | ||
28 | * inferred by reading the chip's value and knowing the last value written | ||
29 | * to it. If you leave n_latch initialized to zero, that last written | ||
30 | * value is presumed to be all ones (as if the chip were just reset). | ||
31 | */ | ||
32 | struct pcf857x_platform_data { | ||
33 | unsigned gpio_base; | ||
34 | unsigned n_latch; | ||
35 | |||
36 | int (*setup)(struct i2c_client *client, | ||
37 | int gpio, unsigned ngpio, | ||
38 | void *context); | ||
39 | int (*teardown)(struct i2c_client *client, | ||
40 | int gpio, unsigned ngpio, | ||
41 | void *context); | ||
42 | void *context; | ||
43 | }; | ||
44 | |||
45 | #endif /* __LINUX_PCF857X_H */ | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 367c17084a28..acec99da832d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -115,10 +115,6 @@ typedef unsigned char byte; /* used everywhere */ | |||
115 | #define SATA_ERROR_OFFSET (1) | 115 | #define SATA_ERROR_OFFSET (1) |
116 | #define SATA_CONTROL_OFFSET (2) | 116 | #define SATA_CONTROL_OFFSET (2) |
117 | 117 | ||
118 | #define SATA_MISC_OFFSET (0) | ||
119 | #define SATA_PHY_OFFSET (1) | ||
120 | #define SATA_IEN_OFFSET (2) | ||
121 | |||
122 | /* | 118 | /* |
123 | * Our Physical Region Descriptor (PRD) table should be large enough | 119 | * Our Physical Region Descriptor (PRD) table should be large enough |
124 | * to handle the biggest I/O request we are likely to see. Since requests | 120 | * to handle the biggest I/O request we are likely to see. Since requests |
@@ -173,7 +169,7 @@ enum { ide_unknown, ide_generic, ide_pci, | |||
173 | ide_rz1000, ide_trm290, | 169 | ide_rz1000, ide_trm290, |
174 | ide_cmd646, ide_cy82c693, ide_4drives, | 170 | ide_cmd646, ide_cy82c693, ide_4drives, |
175 | ide_pmac, ide_etrax100, ide_acorn, | 171 | ide_pmac, ide_etrax100, ide_acorn, |
176 | ide_au1xxx, ide_forced | 172 | ide_au1xxx, ide_palm3710, ide_forced |
177 | }; | 173 | }; |
178 | 174 | ||
179 | typedef u8 hwif_chipset_t; | 175 | typedef u8 hwif_chipset_t; |
@@ -198,17 +194,6 @@ struct ide_drive_s; | |||
198 | int ide_register_hw(hw_regs_t *, void (*)(struct ide_drive_s *), | 194 | int ide_register_hw(hw_regs_t *, void (*)(struct ide_drive_s *), |
199 | struct hwif_s **); | 195 | struct hwif_s **); |
200 | 196 | ||
201 | void ide_setup_ports( hw_regs_t *hw, | ||
202 | unsigned long base, | ||
203 | int *offsets, | ||
204 | unsigned long ctrl, | ||
205 | unsigned long intr, | ||
206 | ide_ack_intr_t *ack_intr, | ||
207 | #if 0 | ||
208 | ide_io_ops_t *iops, | ||
209 | #endif | ||
210 | int irq); | ||
211 | |||
212 | static inline void ide_std_init_ports(hw_regs_t *hw, | 197 | static inline void ide_std_init_ports(hw_regs_t *hw, |
213 | unsigned long io_addr, | 198 | unsigned long io_addr, |
214 | unsigned long ctl_addr) | 199 | unsigned long ctl_addr) |
@@ -473,7 +458,6 @@ typedef struct hwif_s { | |||
473 | /* task file registers for pata and sata */ | 458 | /* task file registers for pata and sata */ |
474 | unsigned long io_ports[IDE_NR_PORTS]; | 459 | unsigned long io_ports[IDE_NR_PORTS]; |
475 | unsigned long sata_scr[SATA_NR_PORTS]; | 460 | unsigned long sata_scr[SATA_NR_PORTS]; |
476 | unsigned long sata_misc[SATA_NR_PORTS]; | ||
477 | 461 | ||
478 | ide_drive_t drives[MAX_DRIVES]; /* drive info */ | 462 | ide_drive_t drives[MAX_DRIVES]; /* drive info */ |
479 | 463 | ||
@@ -1014,7 +998,8 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o | |||
1014 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); | 998 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); |
1015 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 999 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1016 | 1000 | ||
1017 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1001 | /* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */ |
1002 | #if defined(CONFIG_BLK_DEV_IDEPCI) && defined(CONFIG_BLK_DEV_IDEDMA_PCI) | ||
1018 | void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | 1003 | void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); |
1019 | #else | 1004 | #else |
1020 | static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, | 1005 | static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, |
@@ -1324,4 +1309,25 @@ static inline void ide_set_irq(ide_drive_t *drive, int on) | |||
1324 | drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG); | 1309 | drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG); |
1325 | } | 1310 | } |
1326 | 1311 | ||
1312 | static inline u8 ide_read_status(ide_drive_t *drive) | ||
1313 | { | ||
1314 | ide_hwif_t *hwif = drive->hwif; | ||
1315 | |||
1316 | return hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); | ||
1317 | } | ||
1318 | |||
1319 | static inline u8 ide_read_altstatus(ide_drive_t *drive) | ||
1320 | { | ||
1321 | ide_hwif_t *hwif = drive->hwif; | ||
1322 | |||
1323 | return hwif->INB(hwif->io_ports[IDE_CONTROL_OFFSET]); | ||
1324 | } | ||
1325 | |||
1326 | static inline u8 ide_read_error(ide_drive_t *drive) | ||
1327 | { | ||
1328 | ide_hwif_t *hwif = drive->hwif; | ||
1329 | |||
1330 | return hwif->INB(hwif->io_ports[IDE_ERROR_OFFSET]); | ||
1331 | } | ||
1332 | |||
1327 | #endif /* _IDE_H */ | 1333 | #endif /* _IDE_H */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index f42663eaf655..1f74e1d7415f 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -121,6 +121,18 @@ extern struct group_info init_groups; | |||
121 | #else | 121 | #else |
122 | #define INIT_IDS | 122 | #define INIT_IDS |
123 | #endif | 123 | #endif |
124 | |||
125 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
126 | /* | ||
127 | * Because of the reduced scope of CAP_SETPCAP when filesystem | ||
128 | * capabilities are in effect, it is safe to allow CAP_SETPCAP to | ||
129 | * be available in the default configuration. | ||
130 | */ | ||
131 | # define CAP_INIT_BSET CAP_FULL_SET | ||
132 | #else | ||
133 | # define CAP_INIT_BSET CAP_INIT_EFF_SET | ||
134 | #endif | ||
135 | |||
124 | /* | 136 | /* |
125 | * INIT_TASK is used to set up the first task table, touch at | 137 | * INIT_TASK is used to set up the first task table, touch at |
126 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 138 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
@@ -156,6 +168,7 @@ extern struct group_info init_groups; | |||
156 | .cap_effective = CAP_INIT_EFF_SET, \ | 168 | .cap_effective = CAP_INIT_EFF_SET, \ |
157 | .cap_inheritable = CAP_INIT_INH_SET, \ | 169 | .cap_inheritable = CAP_INIT_INH_SET, \ |
158 | .cap_permitted = CAP_FULL_SET, \ | 170 | .cap_permitted = CAP_FULL_SET, \ |
171 | .cap_bset = CAP_INIT_BSET, \ | ||
159 | .keep_capabilities = 0, \ | 172 | .keep_capabilities = 0, \ |
160 | .user = INIT_USER, \ | 173 | .user = INIT_USER, \ |
161 | .comm = "swapper", \ | 174 | .comm = "swapper", \ |
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h new file mode 100644 index 000000000000..4dd4c04ff2f4 --- /dev/null +++ b/include/linux/iommu-helper.h | |||
@@ -0,0 +1,7 @@ | |||
1 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | ||
2 | unsigned long start, unsigned int nr, | ||
3 | unsigned long shift, | ||
4 | unsigned long boundary_size, | ||
5 | unsigned long align_mask); | ||
6 | extern void iommu_area_free(unsigned long *map, unsigned long start, | ||
7 | unsigned int nr); | ||
diff --git a/include/linux/latency.h b/include/linux/latency.h deleted file mode 100644 index c08b52bb55b0..000000000000 --- a/include/linux/latency.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * latency.h: Explicit system-wide latency-expectation infrastructure | ||
3 | * | ||
4 | * (C) Copyright 2006 Intel Corporation | ||
5 | * Author: Arjan van de Ven <arjan@linux.intel.com> | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _INCLUDE_GUARD_LATENCY_H_ | ||
10 | #define _INCLUDE_GUARD_LATENCY_H_ | ||
11 | |||
12 | #include <linux/notifier.h> | ||
13 | |||
14 | void set_acceptable_latency(char *identifier, int usecs); | ||
15 | void modify_acceptable_latency(char *identifier, int usecs); | ||
16 | void remove_acceptable_latency(char *identifier); | ||
17 | void synchronize_acceptable_latency(void); | ||
18 | int system_latency_constraint(void); | ||
19 | |||
20 | int register_latency_notifier(struct notifier_block * nb); | ||
21 | int unregister_latency_notifier(struct notifier_block * nb); | ||
22 | |||
23 | #define INFINITE_LATENCY 1000000 | ||
24 | |||
25 | #endif | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index b4130ff58d0c..00f89fd6c52a 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -54,7 +54,15 @@ struct led_classdev { | |||
54 | 54 | ||
55 | extern int led_classdev_register(struct device *parent, | 55 | extern int led_classdev_register(struct device *parent, |
56 | struct led_classdev *led_cdev); | 56 | struct led_classdev *led_cdev); |
57 | extern void led_classdev_unregister(struct led_classdev *led_cdev); | 57 | extern void __led_classdev_unregister(struct led_classdev *led_cdev, bool sus); |
58 | static inline void led_classdev_unregister(struct led_classdev *lcd) | ||
59 | { | ||
60 | __led_classdev_unregister(lcd, false); | ||
61 | } | ||
62 | static inline void led_classdev_unregister_suspended(struct led_classdev *lcd) | ||
63 | { | ||
64 | __led_classdev_unregister(lcd, true); | ||
65 | } | ||
58 | extern void led_classdev_suspend(struct led_classdev *led_cdev); | 66 | extern void led_classdev_suspend(struct led_classdev *led_cdev); |
59 | extern void led_classdev_resume(struct led_classdev *led_cdev); | 67 | extern void led_classdev_resume(struct led_classdev *led_cdev); |
60 | 68 | ||
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index dff9ea32606a..24b30b9b4f8a 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -43,7 +43,15 @@ struct miscdevice { | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | extern int misc_register(struct miscdevice * misc); | 45 | extern int misc_register(struct miscdevice * misc); |
46 | extern int misc_deregister(struct miscdevice * misc); | 46 | extern int __misc_deregister(struct miscdevice *misc, bool suspended); |
47 | static inline int misc_deregister(struct miscdevice *misc) | ||
48 | { | ||
49 | return __misc_deregister(misc, false); | ||
50 | } | ||
51 | static inline int misc_deregister_suspended(struct miscdevice *misc) | ||
52 | { | ||
53 | return __misc_deregister(misc, true); | ||
54 | } | ||
47 | 55 | ||
48 | #define MODULE_ALIAS_MISCDEV(minor) \ | 56 | #define MODULE_ALIAS_MISCDEV(minor) \ |
49 | MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \ | 57 | MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 1bba6789a50a..89d7c691b93a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -227,10 +227,22 @@ static inline int put_page_testzero(struct page *page) | |||
227 | */ | 227 | */ |
228 | static inline int get_page_unless_zero(struct page *page) | 228 | static inline int get_page_unless_zero(struct page *page) |
229 | { | 229 | { |
230 | VM_BUG_ON(PageCompound(page)); | 230 | VM_BUG_ON(PageTail(page)); |
231 | return atomic_inc_not_zero(&page->_count); | 231 | return atomic_inc_not_zero(&page->_count); |
232 | } | 232 | } |
233 | 233 | ||
234 | /* Support for virtually mapped pages */ | ||
235 | struct page *vmalloc_to_page(const void *addr); | ||
236 | unsigned long vmalloc_to_pfn(const void *addr); | ||
237 | |||
238 | /* Determine if an address is within the vmalloc range */ | ||
239 | static inline int is_vmalloc_addr(const void *x) | ||
240 | { | ||
241 | unsigned long addr = (unsigned long)x; | ||
242 | |||
243 | return addr >= VMALLOC_START && addr < VMALLOC_END; | ||
244 | } | ||
245 | |||
234 | static inline struct page *compound_head(struct page *page) | 246 | static inline struct page *compound_head(struct page *page) |
235 | { | 247 | { |
236 | if (unlikely(PageTail(page))) | 248 | if (unlikely(PageTail(page))) |
@@ -706,6 +718,28 @@ unsigned long unmap_vmas(struct mmu_gather **tlb, | |||
706 | struct vm_area_struct *start_vma, unsigned long start_addr, | 718 | struct vm_area_struct *start_vma, unsigned long start_addr, |
707 | unsigned long end_addr, unsigned long *nr_accounted, | 719 | unsigned long end_addr, unsigned long *nr_accounted, |
708 | struct zap_details *); | 720 | struct zap_details *); |
721 | |||
722 | /** | ||
723 | * mm_walk - callbacks for walk_page_range | ||
724 | * @pgd_entry: if set, called for each non-empty PGD (top-level) entry | ||
725 | * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry | ||
726 | * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry | ||
727 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry | ||
728 | * @pte_hole: if set, called for each hole at all levels | ||
729 | * | ||
730 | * (see walk_page_range for more details) | ||
731 | */ | ||
732 | struct mm_walk { | ||
733 | int (*pgd_entry)(pgd_t *, unsigned long, unsigned long, void *); | ||
734 | int (*pud_entry)(pud_t *, unsigned long, unsigned long, void *); | ||
735 | int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, void *); | ||
736 | int (*pte_entry)(pte_t *, unsigned long, unsigned long, void *); | ||
737 | int (*pte_hole)(unsigned long, unsigned long, void *); | ||
738 | }; | ||
739 | |||
740 | int walk_page_range(const struct mm_struct *, unsigned long addr, | ||
741 | unsigned long end, const struct mm_walk *walk, | ||
742 | void *private); | ||
709 | void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | 743 | void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, |
710 | unsigned long end, unsigned long floor, unsigned long ceiling); | 744 | unsigned long end, unsigned long floor, unsigned long ceiling); |
711 | void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, | 745 | void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, |
@@ -1089,8 +1123,6 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma) | |||
1089 | 1123 | ||
1090 | pgprot_t vm_get_page_prot(unsigned long vm_flags); | 1124 | pgprot_t vm_get_page_prot(unsigned long vm_flags); |
1091 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); | 1125 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); |
1092 | struct page *vmalloc_to_page(void *addr); | ||
1093 | unsigned long vmalloc_to_pfn(void *addr); | ||
1094 | int remap_pfn_range(struct vm_area_struct *, unsigned long addr, | 1126 | int remap_pfn_range(struct vm_area_struct *, unsigned long addr, |
1095 | unsigned long pfn, unsigned long size, pgprot_t); | 1127 | unsigned long pfn, unsigned long size, pgprot_t); |
1096 | int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); | 1128 | int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 4c4522a51a3b..8d8d1977736e 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -113,7 +113,7 @@ struct per_cpu_pages { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | struct per_cpu_pageset { | 115 | struct per_cpu_pageset { |
116 | struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ | 116 | struct per_cpu_pages pcp; |
117 | #ifdef CONFIG_NUMA | 117 | #ifdef CONFIG_NUMA |
118 | s8 expire; | 118 | s8 expire; |
119 | #endif | 119 | #endif |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index e9fddb42f26c..139d49d2f078 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -343,7 +343,8 @@ struct sdio_device_id { | |||
343 | __u8 class; /* Standard interface or SDIO_ANY_ID */ | 343 | __u8 class; /* Standard interface or SDIO_ANY_ID */ |
344 | __u16 vendor; /* Vendor or SDIO_ANY_ID */ | 344 | __u16 vendor; /* Vendor or SDIO_ANY_ID */ |
345 | __u16 device; /* Device ID or SDIO_ANY_ID */ | 345 | __u16 device; /* Device ID or SDIO_ANY_ID */ |
346 | kernel_ulong_t driver_data; /* Data private to the driver */ | 346 | kernel_ulong_t driver_data /* Data private to the driver */ |
347 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
347 | }; | 348 | }; |
348 | 349 | ||
349 | /* SSB core, see drivers/ssb/ */ | 350 | /* SSB core, see drivers/ssb/ */ |
diff --git a/include/linux/nubus.h b/include/linux/nubus.h index cdb3e9b8db54..c4355076d1a5 100644 --- a/include/linux/nubus.h +++ b/include/linux/nubus.h | |||
@@ -132,10 +132,12 @@ enum nubus_drhw { | |||
132 | NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */ | 132 | NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */ |
133 | NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */ | 133 | NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */ |
134 | NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */ | 134 | NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */ |
135 | NUBUS_DRHW_RASTER_24LXI = 0x02A0, /* RasterOps 8/24 XLi */ | 135 | NUBUS_DRHW_RASTER_24XLI = 0x02A0, /* RasterOps 8/24 XLi */ |
136 | NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */ | 136 | NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */ |
137 | NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */ | 137 | NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */ |
138 | NUBUS_DRHW_RASTER_24XLTV = 0x02B7, /* RasterOps 24XLTV */ | ||
138 | NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */ | 139 | NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */ |
140 | NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */ | ||
139 | NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */ | 141 | NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */ |
140 | NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */ | 142 | NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */ |
141 | NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */ | 143 | NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */ |
diff --git a/include/linux/of.h b/include/linux/of.h index b5f33efcb8e2..6981016dcc25 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -50,6 +50,7 @@ extern struct device_node *of_find_matching_node(struct device_node *from, | |||
50 | extern struct device_node *of_find_node_by_path(const char *path); | 50 | extern struct device_node *of_find_node_by_path(const char *path); |
51 | extern struct device_node *of_find_node_by_phandle(phandle handle); | 51 | extern struct device_node *of_find_node_by_phandle(phandle handle); |
52 | extern struct device_node *of_get_parent(const struct device_node *node); | 52 | extern struct device_node *of_get_parent(const struct device_node *node); |
53 | extern struct device_node *of_get_next_parent(struct device_node *node); | ||
53 | extern struct device_node *of_get_next_child(const struct device_node *node, | 54 | extern struct device_node *of_get_next_child(const struct device_node *node, |
54 | struct device_node *prev); | 55 | struct device_node *prev); |
55 | #define for_each_child_of_node(parent, child) \ | 56 | #define for_each_child_of_node(parent, child) \ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 209d3a47f50f..bbad43fb8181 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -131,16 +131,52 @@ | |||
131 | #define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags) | 131 | #define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags) |
132 | #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) | 132 | #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) |
133 | 133 | ||
134 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) | 134 | static inline int PageUptodate(struct page *page) |
135 | { | ||
136 | int ret = test_bit(PG_uptodate, &(page)->flags); | ||
137 | |||
138 | /* | ||
139 | * Must ensure that the data we read out of the page is loaded | ||
140 | * _after_ we've loaded page->flags to check for PageUptodate. | ||
141 | * We can skip the barrier if the page is not uptodate, because | ||
142 | * we wouldn't be reading anything from it. | ||
143 | * | ||
144 | * See SetPageUptodate() for the other side of the story. | ||
145 | */ | ||
146 | if (ret) | ||
147 | smp_rmb(); | ||
148 | |||
149 | return ret; | ||
150 | } | ||
151 | |||
152 | static inline void __SetPageUptodate(struct page *page) | ||
153 | { | ||
154 | smp_wmb(); | ||
155 | __set_bit(PG_uptodate, &(page)->flags); | ||
135 | #ifdef CONFIG_S390 | 156 | #ifdef CONFIG_S390 |
157 | page_clear_dirty(page); | ||
158 | #endif | ||
159 | } | ||
160 | |||
136 | static inline void SetPageUptodate(struct page *page) | 161 | static inline void SetPageUptodate(struct page *page) |
137 | { | 162 | { |
163 | #ifdef CONFIG_S390 | ||
138 | if (!test_and_set_bit(PG_uptodate, &page->flags)) | 164 | if (!test_and_set_bit(PG_uptodate, &page->flags)) |
139 | page_clear_dirty(page); | 165 | page_clear_dirty(page); |
140 | } | ||
141 | #else | 166 | #else |
142 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) | 167 | /* |
168 | * Memory barrier must be issued before setting the PG_uptodate bit, | ||
169 | * so that all previous stores issued in order to bring the page | ||
170 | * uptodate are actually visible before PageUptodate becomes true. | ||
171 | * | ||
172 | * s390 doesn't need an explicit smp_wmb here because the test and | ||
173 | * set bit already provides full barriers. | ||
174 | */ | ||
175 | smp_wmb(); | ||
176 | set_bit(PG_uptodate, &(page)->flags); | ||
143 | #endif | 177 | #endif |
178 | } | ||
179 | |||
144 | #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) | 180 | #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) |
145 | 181 | ||
146 | #define PageDirty(page) test_bit(PG_dirty, &(page)->flags) | 182 | #define PageDirty(page) test_bit(PG_dirty, &(page)->flags) |
diff --git a/include/linux/pci.h b/include/linux/pci.h index cee75c0ff6e7..7215d3b1f4af 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -159,6 +159,8 @@ struct pci_dev { | |||
159 | this if your device has broken DMA | 159 | this if your device has broken DMA |
160 | or supports 64-bit transfers. */ | 160 | or supports 64-bit transfers. */ |
161 | 161 | ||
162 | struct device_dma_parameters dma_parms; | ||
163 | |||
162 | pci_power_t current_state; /* Current operating state. In ACPI-speak, | 164 | pci_power_t current_state; /* Current operating state. In ACPI-speak, |
163 | this is D0-D3, D0 being fully functional, | 165 | this is D0-D3, D0 being fully functional, |
164 | and D3 being off. */ | 166 | and D3 being off. */ |
@@ -580,6 +582,8 @@ void pci_intx(struct pci_dev *dev, int enable); | |||
580 | void pci_msi_off(struct pci_dev *dev); | 582 | void pci_msi_off(struct pci_dev *dev); |
581 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | 583 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); |
582 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | 584 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); |
585 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); | ||
586 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); | ||
583 | int pcix_get_max_mmrbc(struct pci_dev *dev); | 587 | int pcix_get_max_mmrbc(struct pci_dev *dev); |
584 | int pcix_get_mmrbc(struct pci_dev *dev); | 588 | int pcix_get_mmrbc(struct pci_dev *dev); |
585 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); | 589 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); |
@@ -822,6 +826,18 @@ static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | |||
822 | return -EIO; | 826 | return -EIO; |
823 | } | 827 | } |
824 | 828 | ||
829 | static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, | ||
830 | unsigned int size) | ||
831 | { | ||
832 | return -EIO; | ||
833 | } | ||
834 | |||
835 | static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, | ||
836 | unsigned long mask) | ||
837 | { | ||
838 | return -EIO; | ||
839 | } | ||
840 | |||
825 | static inline int pci_assign_resource(struct pci_dev *dev, int i) | 841 | static inline int pci_assign_resource(struct pci_dev *dev, int i) |
826 | { | 842 | { |
827 | return -EBUSY; | 843 | return -EBUSY; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 41f6f28690f6..39d32837265b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2043,6 +2043,23 @@ | |||
2043 | #define PCI_VENDOR_ID_QUICKNET 0x15e2 | 2043 | #define PCI_VENDOR_ID_QUICKNET 0x15e2 |
2044 | #define PCI_DEVICE_ID_QUICKNET_XJ 0x0500 | 2044 | #define PCI_DEVICE_ID_QUICKNET_XJ 0x0500 |
2045 | 2045 | ||
2046 | /* | ||
2047 | * ADDI-DATA GmbH communication cards <info@addi-data.com> | ||
2048 | */ | ||
2049 | #define PCI_VENDOR_ID_ADDIDATA_OLD 0x10E8 | ||
2050 | #define PCI_VENDOR_ID_ADDIDATA 0x15B8 | ||
2051 | #define PCI_DEVICE_ID_ADDIDATA_APCI7500 0x7000 | ||
2052 | #define PCI_DEVICE_ID_ADDIDATA_APCI7420 0x7001 | ||
2053 | #define PCI_DEVICE_ID_ADDIDATA_APCI7300 0x7002 | ||
2054 | #define PCI_DEVICE_ID_ADDIDATA_APCI7800 0x818E | ||
2055 | #define PCI_DEVICE_ID_ADDIDATA_APCI7500_2 0x7009 | ||
2056 | #define PCI_DEVICE_ID_ADDIDATA_APCI7420_2 0x700A | ||
2057 | #define PCI_DEVICE_ID_ADDIDATA_APCI7300_2 0x700B | ||
2058 | #define PCI_DEVICE_ID_ADDIDATA_APCI7500_3 0x700C | ||
2059 | #define PCI_DEVICE_ID_ADDIDATA_APCI7420_3 0x700D | ||
2060 | #define PCI_DEVICE_ID_ADDIDATA_APCI7300_3 0x700E | ||
2061 | #define PCI_DEVICE_ID_ADDIDATA_APCI7800_3 0x700F | ||
2062 | |||
2046 | #define PCI_VENDOR_ID_PDC 0x15e9 | 2063 | #define PCI_VENDOR_ID_PDC 0x15e9 |
2047 | 2064 | ||
2048 | #define PCI_VENDOR_ID_FARSITE 0x1619 | 2065 | #define PCI_VENDOR_ID_FARSITE 0x1619 |
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 1c1dba9ea5fb..40fac8c4559d 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h | |||
@@ -459,7 +459,8 @@ enum | |||
459 | #define TCF_EM_U32 3 | 459 | #define TCF_EM_U32 3 |
460 | #define TCF_EM_META 4 | 460 | #define TCF_EM_META 4 |
461 | #define TCF_EM_TEXT 5 | 461 | #define TCF_EM_TEXT 5 |
462 | #define TCF_EM_MAX 5 | 462 | #define TCF_EM_VLAN 6 |
463 | #define TCF_EM_MAX 6 | ||
463 | 464 | ||
464 | enum | 465 | enum |
465 | { | 466 | { |
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h new file mode 100644 index 000000000000..2e4e97bd19f7 --- /dev/null +++ b/include/linux/pm_qos_params.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* interface for the pm_qos_power infrastructure of the linux kernel. | ||
2 | * | ||
3 | * Mark Gross | ||
4 | */ | ||
5 | #include <linux/list.h> | ||
6 | #include <linux/notifier.h> | ||
7 | #include <linux/miscdevice.h> | ||
8 | |||
9 | #define PM_QOS_RESERVED 0 | ||
10 | #define PM_QOS_CPU_DMA_LATENCY 1 | ||
11 | #define PM_QOS_NETWORK_LATENCY 2 | ||
12 | #define PM_QOS_NETWORK_THROUGHPUT 3 | ||
13 | |||
14 | #define PM_QOS_NUM_CLASSES 4 | ||
15 | #define PM_QOS_DEFAULT_VALUE -1 | ||
16 | |||
17 | int pm_qos_add_requirement(int qos, char *name, s32 value); | ||
18 | int pm_qos_update_requirement(int qos, char *name, s32 new_value); | ||
19 | void pm_qos_remove_requirement(int qos, char *name); | ||
20 | |||
21 | int pm_qos_requirement(int qos); | ||
22 | |||
23 | int pm_qos_add_notifier(int qos, struct notifier_block *notifier); | ||
24 | int pm_qos_remove_notifier(int qos, struct notifier_block *notifier); | ||
25 | |||
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index e2eff9079fe9..3800639775ae 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
@@ -63,4 +63,8 @@ | |||
63 | #define PR_GET_SECCOMP 21 | 63 | #define PR_GET_SECCOMP 21 |
64 | #define PR_SET_SECCOMP 22 | 64 | #define PR_SET_SECCOMP 22 |
65 | 65 | ||
66 | /* Get/set the capability bounding set */ | ||
67 | #define PR_CAPBSET_READ 23 | ||
68 | #define PR_CAPBSET_DROP 24 | ||
69 | |||
66 | #endif /* _LINUX_PRCTL_H */ | 70 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 8f92546b403d..e43551516831 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -19,6 +19,8 @@ struct completion; | |||
19 | */ | 19 | */ |
20 | #define FIRST_PROCESS_ENTRY 256 | 20 | #define FIRST_PROCESS_ENTRY 256 |
21 | 21 | ||
22 | /* Worst case buffer size needed for holding an integer. */ | ||
23 | #define PROC_NUMBUF 13 | ||
22 | 24 | ||
23 | /* | 25 | /* |
24 | * We always define these enumerators | 26 | * We always define these enumerators |
@@ -117,7 +119,6 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); | |||
117 | unsigned long task_vsize(struct mm_struct *); | 119 | unsigned long task_vsize(struct mm_struct *); |
118 | int task_statm(struct mm_struct *, int *, int *, int *, int *); | 120 | int task_statm(struct mm_struct *, int *, int *, int *, int *); |
119 | char *task_mem(struct mm_struct *, char *); | 121 | char *task_mem(struct mm_struct *, char *); |
120 | void clear_refs_smap(struct mm_struct *mm); | ||
121 | 122 | ||
122 | struct proc_dir_entry *de_get(struct proc_dir_entry *de); | 123 | struct proc_dir_entry *de_get(struct proc_dir_entry *de); |
123 | void de_put(struct proc_dir_entry *de); | 124 | void de_put(struct proc_dir_entry *de); |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 85ea63f462af..b93b541cf111 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -59,8 +59,6 @@ extern void machine_crash_shutdown(struct pt_regs *); | |||
59 | * Architecture independent implemenations of sys_reboot commands. | 59 | * Architecture independent implemenations of sys_reboot commands. |
60 | */ | 60 | */ |
61 | 61 | ||
62 | extern void kernel_shutdown_prepare(enum system_states state); | ||
63 | |||
64 | extern void kernel_restart(char *cmd); | 62 | extern void kernel_restart(char *cmd); |
65 | extern void kernel_halt(void); | 63 | extern void kernel_halt(void); |
66 | extern void kernel_power_off(void); | 64 | extern void kernel_power_off(void); |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index b014f6b7fe29..b9e174079002 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -602,24 +602,12 @@ struct tcamsg | |||
602 | 602 | ||
603 | #include <linux/mutex.h> | 603 | #include <linux/mutex.h> |
604 | 604 | ||
605 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); | ||
606 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) | 605 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) |
607 | { | 606 | { |
608 | int len = strlen(str) + 1; | 607 | int len = strlen(str) + 1; |
609 | return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); | 608 | return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); |
610 | } | 609 | } |
611 | 610 | ||
612 | extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); | ||
613 | extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr, | ||
614 | struct rtattr *rta, int len); | ||
615 | |||
616 | #define rtattr_parse_nested(tb, max, rta) \ | ||
617 | rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) | ||
618 | |||
619 | #define rtattr_parse_nested_compat(tb, max, rta, data, len) \ | ||
620 | ({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \ | ||
621 | __rtattr_parse_nested_compat(tb, max, rta, len); }) | ||
622 | |||
623 | extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); | 611 | extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); |
624 | extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); | 612 | extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); |
625 | extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, | 613 | extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index af6947e69b40..9c13be3a21e8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -555,6 +555,13 @@ struct signal_struct { | |||
555 | #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ | 555 | #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ |
556 | #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ | 556 | #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ |
557 | 557 | ||
558 | /* If true, all threads except ->group_exit_task have pending SIGKILL */ | ||
559 | static inline int signal_group_exit(const struct signal_struct *sig) | ||
560 | { | ||
561 | return (sig->flags & SIGNAL_GROUP_EXIT) || | ||
562 | (sig->group_exit_task != NULL); | ||
563 | } | ||
564 | |||
558 | /* | 565 | /* |
559 | * Some day this will be a full-fledged user tracking system.. | 566 | * Some day this will be a full-fledged user tracking system.. |
560 | */ | 567 | */ |
@@ -1091,7 +1098,7 @@ struct task_struct { | |||
1091 | uid_t uid,euid,suid,fsuid; | 1098 | uid_t uid,euid,suid,fsuid; |
1092 | gid_t gid,egid,sgid,fsgid; | 1099 | gid_t gid,egid,sgid,fsgid; |
1093 | struct group_info *group_info; | 1100 | struct group_info *group_info; |
1094 | kernel_cap_t cap_effective, cap_inheritable, cap_permitted; | 1101 | kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset; |
1095 | unsigned keep_capabilities:1; | 1102 | unsigned keep_capabilities:1; |
1096 | struct user_struct *user; | 1103 | struct user_struct *user; |
1097 | #ifdef CONFIG_KEYS | 1104 | #ifdef CONFIG_KEYS |
@@ -1770,7 +1777,7 @@ extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned lon | |||
1770 | struct task_struct *fork_idle(int); | 1777 | struct task_struct *fork_idle(int); |
1771 | 1778 | ||
1772 | extern void set_task_comm(struct task_struct *tsk, char *from); | 1779 | extern void set_task_comm(struct task_struct *tsk, char *from); |
1773 | extern void get_task_comm(char *to, struct task_struct *tsk); | 1780 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
1774 | 1781 | ||
1775 | #ifdef CONFIG_SMP | 1782 | #ifdef CONFIG_SMP |
1776 | extern void wait_task_inactive(struct task_struct * p); | 1783 | extern void wait_task_inactive(struct task_struct * p); |
@@ -2080,6 +2087,10 @@ static inline void migration_init(void) | |||
2080 | } | 2087 | } |
2081 | #endif | 2088 | #endif |
2082 | 2089 | ||
2090 | #ifndef TASK_SIZE_OF | ||
2091 | #define TASK_SIZE_OF(tsk) TASK_SIZE | ||
2092 | #endif | ||
2093 | |||
2083 | #endif /* __KERNEL__ */ | 2094 | #endif /* __KERNEL__ */ |
2084 | 2095 | ||
2085 | #endif | 2096 | #endif |
diff --git a/include/linux/security.h b/include/linux/security.h index d24974262dc6..fe52cdeab0a6 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -40,11 +40,6 @@ | |||
40 | #define ROOTCONTEXT_MNT 0x04 | 40 | #define ROOTCONTEXT_MNT 0x04 |
41 | #define DEFCONTEXT_MNT 0x08 | 41 | #define DEFCONTEXT_MNT 0x08 |
42 | 42 | ||
43 | /* | ||
44 | * Bounding set | ||
45 | */ | ||
46 | extern kernel_cap_t cap_bset; | ||
47 | |||
48 | extern unsigned securebits; | 43 | extern unsigned securebits; |
49 | 44 | ||
50 | struct ctl_table; | 45 | struct ctl_table; |
@@ -423,15 +418,12 @@ struct request_sock; | |||
423 | * identified by @name for @dentry. | 418 | * identified by @name for @dentry. |
424 | * Return 0 if permission is granted. | 419 | * Return 0 if permission is granted. |
425 | * @inode_getsecurity: | 420 | * @inode_getsecurity: |
426 | * Copy the extended attribute representation of the security label | 421 | * Retrieve a copy of the extended attribute representation of the |
427 | * associated with @name for @inode into @buffer. @buffer may be | 422 | * security label associated with @name for @inode via @buffer. Note that |
428 | * NULL to request the size of the buffer required. @size indicates | 423 | * @name is the remainder of the attribute name after the security prefix |
429 | * the size of @buffer in bytes. Note that @name is the remainder | 424 | * has been removed. @alloc is used to specify of the call should return a |
430 | * of the attribute name after the security. prefix has been removed. | 425 | * value via the buffer or just the value length Return size of buffer on |
431 | * @err is the return value from the preceding fs getxattr call, | 426 | * success. |
432 | * and can be used by the security module to determine whether it | ||
433 | * should try and canonicalize the attribute value. | ||
434 | * Return number of bytes used/required on success. | ||
435 | * @inode_setsecurity: | 427 | * @inode_setsecurity: |
436 | * Set the security label associated with @name for @inode from the | 428 | * Set the security label associated with @name for @inode from the |
437 | * extended attribute value @value. @size indicates the size of the | 429 | * extended attribute value @value. @size indicates the size of the |
@@ -1304,7 +1296,7 @@ struct security_operations { | |||
1304 | int (*inode_removexattr) (struct dentry *dentry, char *name); | 1296 | int (*inode_removexattr) (struct dentry *dentry, char *name); |
1305 | int (*inode_need_killpriv) (struct dentry *dentry); | 1297 | int (*inode_need_killpriv) (struct dentry *dentry); |
1306 | int (*inode_killpriv) (struct dentry *dentry); | 1298 | int (*inode_killpriv) (struct dentry *dentry); |
1307 | int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err); | 1299 | int (*inode_getsecurity)(const struct inode *inode, const char *name, void **buffer, bool alloc); |
1308 | int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); | 1300 | int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); |
1309 | int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); | 1301 | int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); |
1310 | 1302 | ||
@@ -1565,7 +1557,7 @@ int security_inode_listxattr(struct dentry *dentry); | |||
1565 | int security_inode_removexattr(struct dentry *dentry, char *name); | 1557 | int security_inode_removexattr(struct dentry *dentry, char *name); |
1566 | int security_inode_need_killpriv(struct dentry *dentry); | 1558 | int security_inode_need_killpriv(struct dentry *dentry); |
1567 | int security_inode_killpriv(struct dentry *dentry); | 1559 | int security_inode_killpriv(struct dentry *dentry); |
1568 | int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err); | 1560 | int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc); |
1569 | int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags); | 1561 | int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags); |
1570 | int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size); | 1562 | int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size); |
1571 | int security_file_permission(struct file *file, int mask); | 1563 | int security_file_permission(struct file *file, int mask); |
@@ -1967,7 +1959,7 @@ static inline int security_inode_killpriv(struct dentry *dentry) | |||
1967 | return cap_inode_killpriv(dentry); | 1959 | return cap_inode_killpriv(dentry); |
1968 | } | 1960 | } |
1969 | 1961 | ||
1970 | static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) | 1962 | static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc) |
1971 | { | 1963 | { |
1972 | return -EOPNOTSUPP; | 1964 | return -EOPNOTSUPP; |
1973 | } | 1965 | } |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index afe0f6d9b9bc..00b65c0a82ca 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -23,6 +23,7 @@ struct plat_serial8250_port { | |||
23 | resource_size_t mapbase; /* resource base */ | 23 | resource_size_t mapbase; /* resource base */ |
24 | unsigned int irq; /* interrupt number */ | 24 | unsigned int irq; /* interrupt number */ |
25 | unsigned int uartclk; /* UART clock rate */ | 25 | unsigned int uartclk; /* UART clock rate */ |
26 | void *private_data; | ||
26 | unsigned char regshift; /* register shift */ | 27 | unsigned char regshift; /* register shift */ |
27 | unsigned char iotype; /* UPIO_* */ | 28 | unsigned char iotype; /* UPIO_* */ |
28 | unsigned char hub6; | 29 | unsigned char hub6; |
diff --git a/include/linux/spi/mcp23s08.h b/include/linux/spi/mcp23s08.h new file mode 100644 index 000000000000..835ddf47d45c --- /dev/null +++ b/include/linux/spi/mcp23s08.h | |||
@@ -0,0 +1,24 @@ | |||
1 | |||
2 | /* FIXME driver should be able to handle all four slaves that | ||
3 | * can be hooked up to each chipselect, as well as IRQs... | ||
4 | */ | ||
5 | |||
6 | struct mcp23s08_platform_data { | ||
7 | /* four slaves can share one SPI chipselect */ | ||
8 | u8 slave; | ||
9 | |||
10 | /* number assigned to the first GPIO */ | ||
11 | unsigned base; | ||
12 | |||
13 | /* pins with pullups */ | ||
14 | u8 pullups; | ||
15 | |||
16 | void *context; /* param to setup/teardown */ | ||
17 | |||
18 | int (*setup)(struct spi_device *spi, | ||
19 | int gpio, unsigned ngpio, | ||
20 | void *context); | ||
21 | int (*teardown)(struct spi_device *spi, | ||
22 | int gpio, unsigned ngpio, | ||
23 | void *context); | ||
24 | }; | ||
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 646ce2d068d4..1d7d4c5797ee 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -130,7 +130,6 @@ struct pbe { | |||
130 | }; | 130 | }; |
131 | 131 | ||
132 | /* mm/page_alloc.c */ | 132 | /* mm/page_alloc.c */ |
133 | extern void drain_local_pages(void); | ||
134 | extern void mark_free_pages(struct zone *zone); | 133 | extern void mark_free_pages(struct zone *zone); |
135 | 134 | ||
136 | /** | 135 | /** |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 4f3838adbb30..353153ea0bd5 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -158,9 +158,6 @@ struct swap_list_t { | |||
158 | /* Swap 50% full? Release swapcache more aggressively.. */ | 158 | /* Swap 50% full? Release swapcache more aggressively.. */ |
159 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) | 159 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) |
160 | 160 | ||
161 | /* linux/mm/memory.c */ | ||
162 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); | ||
163 | |||
164 | /* linux/mm/page_alloc.c */ | 161 | /* linux/mm/page_alloc.c */ |
165 | extern unsigned long totalram_pages; | 162 | extern unsigned long totalram_pages; |
166 | extern unsigned long totalreserve_pages; | 163 | extern unsigned long totalreserve_pages; |
@@ -223,16 +220,17 @@ extern struct address_space swapper_space; | |||
223 | #define total_swapcache_pages swapper_space.nrpages | 220 | #define total_swapcache_pages swapper_space.nrpages |
224 | extern void show_swap_cache_info(void); | 221 | extern void show_swap_cache_info(void); |
225 | extern int add_to_swap(struct page *, gfp_t); | 222 | extern int add_to_swap(struct page *, gfp_t); |
223 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); | ||
226 | extern void __delete_from_swap_cache(struct page *); | 224 | extern void __delete_from_swap_cache(struct page *); |
227 | extern void delete_from_swap_cache(struct page *); | 225 | extern void delete_from_swap_cache(struct page *); |
228 | extern int move_to_swap_cache(struct page *, swp_entry_t); | ||
229 | extern int move_from_swap_cache(struct page *, unsigned long, | ||
230 | struct address_space *); | ||
231 | extern void free_page_and_swap_cache(struct page *); | 226 | extern void free_page_and_swap_cache(struct page *); |
232 | extern void free_pages_and_swap_cache(struct page **, int); | 227 | extern void free_pages_and_swap_cache(struct page **, int); |
233 | extern struct page * lookup_swap_cache(swp_entry_t); | 228 | extern struct page *lookup_swap_cache(swp_entry_t); |
234 | extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *vma, | 229 | extern struct page *read_swap_cache_async(swp_entry_t, gfp_t, |
235 | unsigned long addr); | 230 | struct vm_area_struct *vma, unsigned long addr); |
231 | extern struct page *swapin_readahead(swp_entry_t, gfp_t, | ||
232 | struct vm_area_struct *vma, unsigned long addr); | ||
233 | |||
236 | /* linux/mm/swapfile.c */ | 234 | /* linux/mm/swapfile.c */ |
237 | extern long total_swap_pages; | 235 | extern long total_swap_pages; |
238 | extern unsigned int nr_swapfiles; | 236 | extern unsigned int nr_swapfiles; |
@@ -306,7 +304,7 @@ static inline void swap_free(swp_entry_t swp) | |||
306 | { | 304 | { |
307 | } | 305 | } |
308 | 306 | ||
309 | static inline struct page *read_swap_cache_async(swp_entry_t swp, | 307 | static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, |
310 | struct vm_area_struct *vma, unsigned long addr) | 308 | struct vm_area_struct *vma, unsigned long addr) |
311 | { | 309 | { |
312 | return NULL; | 310 | return NULL; |
@@ -317,22 +315,12 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp) | |||
317 | return NULL; | 315 | return NULL; |
318 | } | 316 | } |
319 | 317 | ||
320 | static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset) | ||
321 | { | ||
322 | return 0; | ||
323 | } | ||
324 | |||
325 | #define can_share_swap_page(p) (page_mapcount(p) == 1) | 318 | #define can_share_swap_page(p) (page_mapcount(p) == 1) |
326 | 319 | ||
327 | static inline int move_to_swap_cache(struct page *page, swp_entry_t entry) | 320 | static inline int add_to_swap_cache(struct page *page, swp_entry_t entry, |
328 | { | 321 | gfp_t gfp_mask) |
329 | return 1; | ||
330 | } | ||
331 | |||
332 | static inline int move_from_swap_cache(struct page *page, unsigned long index, | ||
333 | struct address_space *mapping) | ||
334 | { | 322 | { |
335 | return 1; | 323 | return -1; |
336 | } | 324 | } |
337 | 325 | ||
338 | static inline void __delete_from_swap_cache(struct page *page) | 326 | static inline void __delete_from_swap_cache(struct page *page) |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index ceb6cc5ceebb..7bf2d149d209 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -42,6 +42,12 @@ static inline pgoff_t swp_offset(swp_entry_t entry) | |||
42 | return entry.val & SWP_OFFSET_MASK(entry); | 42 | return entry.val & SWP_OFFSET_MASK(entry); |
43 | } | 43 | } |
44 | 44 | ||
45 | /* check whether a pte points to a swap entry */ | ||
46 | static inline int is_swap_pte(pte_t pte) | ||
47 | { | ||
48 | return !pte_none(pte) && !pte_present(pte) && !pte_file(pte); | ||
49 | } | ||
50 | |||
45 | /* | 51 | /* |
46 | * Convert the arch-dependent pte representation of a swp_entry_t into an | 52 | * Convert the arch-dependent pte representation of a swp_entry_t into an |
47 | * arch-independent swp_entry_t. | 53 | * arch-independent swp_entry_t. |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 61def7c8fbb3..4c2577bd1c85 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -607,8 +607,11 @@ asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, | |||
607 | size_t len); | 607 | size_t len); |
608 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); | 608 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); |
609 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); | 609 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); |
610 | asmlinkage long sys_timerfd(int ufd, int clockid, int flags, | 610 | asmlinkage long sys_timerfd_create(int clockid, int flags); |
611 | const struct itimerspec __user *utmr); | 611 | asmlinkage long sys_timerfd_settime(int ufd, int flags, |
612 | const struct itimerspec __user *utmr, | ||
613 | struct itimerspec __user *otmr); | ||
614 | asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); | ||
612 | asmlinkage long sys_eventfd(unsigned int count); | 615 | asmlinkage long sys_eventfd(unsigned int count); |
613 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); | 616 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); |
614 | 617 | ||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index bf4ae4e138f7..571f01d20a86 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -102,7 +102,6 @@ enum | |||
102 | KERN_NODENAME=7, | 102 | KERN_NODENAME=7, |
103 | KERN_DOMAINNAME=8, | 103 | KERN_DOMAINNAME=8, |
104 | 104 | ||
105 | KERN_CAP_BSET=14, /* int: capability bounding set */ | ||
106 | KERN_PANIC=15, /* int: panic timeout */ | 105 | KERN_PANIC=15, /* int: panic timeout */ |
107 | KERN_REALROOTDEV=16, /* real root device to mount after initrd */ | 106 | KERN_REALROOTDEV=16, /* real root device to mount after initrd */ |
108 | 107 | ||
@@ -965,8 +964,6 @@ extern int proc_dostring(struct ctl_table *, int, struct file *, | |||
965 | void __user *, size_t *, loff_t *); | 964 | void __user *, size_t *, loff_t *); |
966 | extern int proc_dointvec(struct ctl_table *, int, struct file *, | 965 | extern int proc_dointvec(struct ctl_table *, int, struct file *, |
967 | void __user *, size_t *, loff_t *); | 966 | void __user *, size_t *, loff_t *); |
968 | extern int proc_dointvec_bset(struct ctl_table *, int, struct file *, | ||
969 | void __user *, size_t *, loff_t *); | ||
970 | extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *, | 967 | extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *, |
971 | void __user *, size_t *, loff_t *); | 968 | void __user *, size_t *, loff_t *); |
972 | extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *, | 969 | extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *, |
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h index e21937cf91d0..c50d2ba5caf0 100644 --- a/include/linux/tc_ematch/tc_em_meta.h +++ b/include/linux/tc_ematch/tc_em_meta.h | |||
@@ -81,6 +81,7 @@ enum | |||
81 | TCF_META_ID_SK_SNDTIMEO, | 81 | TCF_META_ID_SK_SNDTIMEO, |
82 | TCF_META_ID_SK_SENDMSG_OFF, | 82 | TCF_META_ID_SK_SENDMSG_OFF, |
83 | TCF_META_ID_SK_WRITE_PENDING, | 83 | TCF_META_ID_SK_WRITE_PENDING, |
84 | TCF_META_ID_VLAN_TAG, | ||
84 | __TCF_META_ID_MAX | 85 | __TCF_META_ID_MAX |
85 | }; | 86 | }; |
86 | #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) | 87 | #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 89338b468d0d..ce8e7da05807 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -45,11 +45,11 @@ extern void *vmalloc_32_user(unsigned long size); | |||
45 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 45 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
46 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, | 46 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, |
47 | pgprot_t prot); | 47 | pgprot_t prot); |
48 | extern void vfree(void *addr); | 48 | extern void vfree(const void *addr); |
49 | 49 | ||
50 | extern void *vmap(struct page **pages, unsigned int count, | 50 | extern void *vmap(struct page **pages, unsigned int count, |
51 | unsigned long flags, pgprot_t prot); | 51 | unsigned long flags, pgprot_t prot); |
52 | extern void vunmap(void *addr); | 52 | extern void vunmap(const void *addr); |
53 | 53 | ||
54 | extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, | 54 | extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, |
55 | unsigned long pgoff); | 55 | unsigned long pgoff); |
@@ -71,7 +71,7 @@ extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | |||
71 | extern struct vm_struct *get_vm_area_node(unsigned long size, | 71 | extern struct vm_struct *get_vm_area_node(unsigned long size, |
72 | unsigned long flags, int node, | 72 | unsigned long flags, int node, |
73 | gfp_t gfp_mask); | 73 | gfp_t gfp_mask); |
74 | extern struct vm_struct *remove_vm_area(void *addr); | 74 | extern struct vm_struct *remove_vm_area(const void *addr); |
75 | 75 | ||
76 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 76 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
77 | struct page ***pages); | 77 | struct page ***pages); |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 1f4fb0a81ecd..33a2aa9e02f2 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -162,6 +162,22 @@ wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int)); | |||
162 | #define wake_up_interruptible_all(x) __wake_up(x, TASK_INTERRUPTIBLE, 0, NULL) | 162 | #define wake_up_interruptible_all(x) __wake_up(x, TASK_INTERRUPTIBLE, 0, NULL) |
163 | #define wake_up_interruptible_sync(x) __wake_up_sync((x), TASK_INTERRUPTIBLE, 1) | 163 | #define wake_up_interruptible_sync(x) __wake_up_sync((x), TASK_INTERRUPTIBLE, 1) |
164 | 164 | ||
165 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
166 | /* | ||
167 | * macro to avoid include hell | ||
168 | */ | ||
169 | #define wake_up_nested(x, s) \ | ||
170 | do { \ | ||
171 | unsigned long flags; \ | ||
172 | \ | ||
173 | spin_lock_irqsave_nested(&(x)->lock, flags, (s)); \ | ||
174 | wake_up_locked(x); \ | ||
175 | spin_unlock_irqrestore(&(x)->lock, flags); \ | ||
176 | } while (0) | ||
177 | #else | ||
178 | #define wake_up_nested(x, s) wake_up(x) | ||
179 | #endif | ||
180 | |||
165 | #define __wait_event(wq, condition) \ | 181 | #define __wait_event(wq, condition) \ |
166 | do { \ | 182 | do { \ |
167 | DEFINE_WAIT(__wait); \ | 183 | DEFINE_WAIT(__wait); \ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index c6148bbf1250..b7b3362f7717 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -62,6 +62,7 @@ struct writeback_control { | |||
62 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 62 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
63 | unsigned for_writepages:1; /* This is a writepages() call */ | 63 | unsigned for_writepages:1; /* This is a writepages() call */ |
64 | unsigned range_cyclic:1; /* range_start is cyclic */ | 64 | unsigned range_cyclic:1; /* range_start is cyclic */ |
65 | unsigned more_io:1; /* more io to be dispatched */ | ||
65 | }; | 66 | }; |
66 | 67 | ||
67 | /* | 68 | /* |
@@ -100,6 +101,7 @@ extern int dirty_background_ratio; | |||
100 | extern int vm_dirty_ratio; | 101 | extern int vm_dirty_ratio; |
101 | extern int dirty_writeback_interval; | 102 | extern int dirty_writeback_interval; |
102 | extern int dirty_expire_interval; | 103 | extern int dirty_expire_interval; |
104 | extern int vm_highmem_is_dirtyable; | ||
103 | extern int block_dump; | 105 | extern int block_dump; |
104 | extern int laptop_mode; | 106 | extern int laptop_mode; |
105 | 107 | ||
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index def131a5ac70..df6b95d2218e 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -46,6 +46,7 @@ struct xattr_handler { | |||
46 | size_t size, int flags); | 46 | size_t size, int flags); |
47 | }; | 47 | }; |
48 | 48 | ||
49 | ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); | ||
49 | ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); | 50 | ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); |
50 | ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); | 51 | ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); |
51 | int vfs_setxattr(struct dentry *, char *, void *, size_t, int); | 52 | int vfs_setxattr(struct dentry *, char *, void *, size_t, int); |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 48ac620cb846..97dc35ad09be 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -389,7 +389,7 @@ static inline struct sock *inet_lookup(struct net *net, | |||
389 | } | 389 | } |
390 | 390 | ||
391 | extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, | 391 | extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, |
392 | struct sock *sk, | 392 | struct sock *sk, u32 port_offset, |
393 | int (*check_established)(struct inet_timewait_death_row *, | 393 | int (*check_established)(struct inet_timewait_death_row *, |
394 | struct sock *, __u16, struct inet_timewait_sock **), | 394 | struct sock *, __u16, struct inet_timewait_sock **), |
395 | void (*hash)(struct sock *sk)); | 395 | void (*hash)(struct sock *sk)); |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 90d1175f63de..8b12667f7a2b 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -266,6 +266,14 @@ static inline void fib_res_put(struct fib_result *res) | |||
266 | #ifdef CONFIG_PROC_FS | 266 | #ifdef CONFIG_PROC_FS |
267 | extern int __net_init fib_proc_init(struct net *net); | 267 | extern int __net_init fib_proc_init(struct net *net); |
268 | extern void __net_exit fib_proc_exit(struct net *net); | 268 | extern void __net_exit fib_proc_exit(struct net *net); |
269 | #else | ||
270 | static inline int fib_proc_init(struct net *net) | ||
271 | { | ||
272 | return 0; | ||
273 | } | ||
274 | static inline void fib_proc_exit(struct net *net) | ||
275 | { | ||
276 | } | ||
269 | #endif | 277 | #endif |
270 | 278 | ||
271 | #endif /* _NET_FIB_H */ | 279 | #endif /* _NET_FIB_H */ |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index fa80ea48639d..c0c019f72ba9 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -110,7 +110,6 @@ struct frag_hdr { | |||
110 | 110 | ||
111 | /* sysctls */ | 111 | /* sysctls */ |
112 | extern int sysctl_mld_max_msf; | 112 | extern int sysctl_mld_max_msf; |
113 | |||
114 | extern struct ctl_path net_ipv6_ctl_path[]; | 113 | extern struct ctl_path net_ipv6_ctl_path[]; |
115 | 114 | ||
116 | #define _DEVINC(statname, modifier, idev, field) \ | 115 | #define _DEVINC(statname, modifier, idev, field) \ |
@@ -586,9 +585,6 @@ extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, | |||
586 | int __user *optlen); | 585 | int __user *optlen); |
587 | 586 | ||
588 | #ifdef CONFIG_PROC_FS | 587 | #ifdef CONFIG_PROC_FS |
589 | extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); | ||
590 | extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); | ||
591 | |||
592 | extern int ac6_proc_init(void); | 588 | extern int ac6_proc_init(void); |
593 | extern void ac6_proc_exit(void); | 589 | extern void ac6_proc_exit(void); |
594 | extern int raw6_proc_init(void); | 590 | extern int raw6_proc_init(void); |
@@ -621,6 +617,8 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev) | |||
621 | extern ctl_table ipv6_route_table_template[]; | 617 | extern ctl_table ipv6_route_table_template[]; |
622 | extern ctl_table ipv6_icmp_table_template[]; | 618 | extern ctl_table ipv6_icmp_table_template[]; |
623 | 619 | ||
620 | extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); | ||
621 | extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); | ||
624 | extern int ipv6_sysctl_register(void); | 622 | extern int ipv6_sysctl_register(void); |
625 | extern void ipv6_sysctl_unregister(void); | 623 | extern void ipv6_sysctl_unregister(void); |
626 | #endif | 624 | #endif |
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index b3213c7c5309..0ca67d73c7ad 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
@@ -36,6 +36,8 @@ | |||
36 | #include <net/netlink.h> | 36 | #include <net/netlink.h> |
37 | #include <asm/atomic.h> | 37 | #include <asm/atomic.h> |
38 | 38 | ||
39 | struct cipso_v4_doi; | ||
40 | |||
39 | /* | 41 | /* |
40 | * NetLabel - A management interface for maintaining network packet label | 42 | * NetLabel - A management interface for maintaining network packet label |
41 | * mapping tables for explicit packet labling protocols. | 43 | * mapping tables for explicit packet labling protocols. |
@@ -103,12 +105,6 @@ struct netlbl_audit { | |||
103 | uid_t loginuid; | 105 | uid_t loginuid; |
104 | }; | 106 | }; |
105 | 107 | ||
106 | /* Domain mapping definition struct */ | ||
107 | struct netlbl_dom_map; | ||
108 | |||
109 | /* Domain mapping operations */ | ||
110 | int netlbl_domhsh_remove(const char *domain, struct netlbl_audit *audit_info); | ||
111 | |||
112 | /* | 108 | /* |
113 | * LSM security attributes | 109 | * LSM security attributes |
114 | */ | 110 | */ |
@@ -344,6 +340,19 @@ static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr) | |||
344 | 340 | ||
345 | #ifdef CONFIG_NETLABEL | 341 | #ifdef CONFIG_NETLABEL |
346 | /* | 342 | /* |
343 | * LSM configuration operations | ||
344 | */ | ||
345 | int netlbl_cfg_map_del(const char *domain, struct netlbl_audit *audit_info); | ||
346 | int netlbl_cfg_unlbl_add_map(const char *domain, | ||
347 | struct netlbl_audit *audit_info); | ||
348 | int netlbl_cfg_cipsov4_add(struct cipso_v4_doi *doi_def, | ||
349 | struct netlbl_audit *audit_info); | ||
350 | int netlbl_cfg_cipsov4_add_map(struct cipso_v4_doi *doi_def, | ||
351 | const char *domain, | ||
352 | struct netlbl_audit *audit_info); | ||
353 | int netlbl_cfg_cipsov4_del(u32 doi, struct netlbl_audit *audit_info); | ||
354 | |||
355 | /* | ||
347 | * LSM security attribute operations | 356 | * LSM security attribute operations |
348 | */ | 357 | */ |
349 | int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, | 358 | int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, |
@@ -378,6 +387,32 @@ void netlbl_cache_invalidate(void); | |||
378 | int netlbl_cache_add(const struct sk_buff *skb, | 387 | int netlbl_cache_add(const struct sk_buff *skb, |
379 | const struct netlbl_lsm_secattr *secattr); | 388 | const struct netlbl_lsm_secattr *secattr); |
380 | #else | 389 | #else |
390 | static inline int netlbl_cfg_map_del(const char *domain, | ||
391 | struct netlbl_audit *audit_info) | ||
392 | { | ||
393 | return -ENOSYS; | ||
394 | } | ||
395 | static inline int netlbl_cfg_unlbl_add_map(const char *domain, | ||
396 | struct netlbl_audit *audit_info) | ||
397 | { | ||
398 | return -ENOSYS; | ||
399 | } | ||
400 | static inline int netlbl_cfg_cipsov4_add(struct cipso_v4_doi *doi_def, | ||
401 | struct netlbl_audit *audit_info) | ||
402 | { | ||
403 | return -ENOSYS; | ||
404 | } | ||
405 | static inline int netlbl_cfg_cipsov4_add_map(struct cipso_v4_doi *doi_def, | ||
406 | const char *domain, | ||
407 | struct netlbl_audit *audit_info) | ||
408 | { | ||
409 | return -ENOSYS; | ||
410 | } | ||
411 | static inline int netlbl_cfg_cipsov4_del(u32 doi, | ||
412 | struct netlbl_audit *audit_info) | ||
413 | { | ||
414 | return -ENOSYS; | ||
415 | } | ||
381 | static inline int netlbl_secattr_catmap_walk( | 416 | static inline int netlbl_secattr_catmap_walk( |
382 | struct netlbl_lsm_secattr_catmap *catmap, | 417 | struct netlbl_lsm_secattr_catmap *catmap, |
383 | u32 offset) | 418 | u32 offset) |
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index d5838c30d20f..87a260e3699e 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h | |||
@@ -147,11 +147,11 @@ typedef struct config_req_t { | |||
147 | 147 | ||
148 | /* For RequestIO and ReleaseIO */ | 148 | /* For RequestIO and ReleaseIO */ |
149 | typedef struct io_req_t { | 149 | typedef struct io_req_t { |
150 | ioaddr_t BasePort1; | 150 | u_int BasePort1; |
151 | ioaddr_t NumPorts1; | 151 | u_int NumPorts1; |
152 | u_int Attributes1; | 152 | u_int Attributes1; |
153 | ioaddr_t BasePort2; | 153 | u_int BasePort2; |
154 | ioaddr_t NumPorts2; | 154 | u_int NumPorts2; |
155 | u_int Attributes2; | 155 | u_int Attributes2; |
156 | u_int IOAddrLines; | 156 | u_int IOAddrLines; |
157 | } io_req_t; | 157 | } io_req_t; |
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h index 5f388035687d..9a6bcc4952f0 100644 --- a/include/pcmcia/cs_types.h +++ b/include/pcmcia/cs_types.h | |||
@@ -27,7 +27,6 @@ typedef u_int ioaddr_t; | |||
27 | #else | 27 | #else |
28 | typedef u_short ioaddr_t; | 28 | typedef u_short ioaddr_t; |
29 | #endif | 29 | #endif |
30 | typedef unsigned long kio_addr_t; | ||
31 | 30 | ||
32 | typedef u_short socket_t; | 31 | typedef u_short socket_t; |
33 | typedef u_int event_t; | 32 | typedef u_int event_t; |
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 6e84258b94de..f95dca077c1c 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
@@ -92,7 +92,7 @@ typedef struct pccard_io_map { | |||
92 | u_char map; | 92 | u_char map; |
93 | u_char flags; | 93 | u_char flags; |
94 | u_short speed; | 94 | u_short speed; |
95 | kio_addr_t start, stop; | 95 | u_int start, stop; |
96 | } pccard_io_map; | 96 | } pccard_io_map; |
97 | 97 | ||
98 | typedef struct pccard_mem_map { | 98 | typedef struct pccard_mem_map { |
@@ -155,7 +155,7 @@ extern struct pccard_resource_ops pccard_iodyn_ops; | |||
155 | struct pcmcia_socket; | 155 | struct pcmcia_socket; |
156 | 156 | ||
157 | typedef struct io_window_t { | 157 | typedef struct io_window_t { |
158 | kio_addr_t InUse, Config; | 158 | u_int InUse, Config; |
159 | struct resource *res; | 159 | struct resource *res; |
160 | } io_window_t; | 160 | } io_window_t; |
161 | 161 | ||
@@ -208,7 +208,7 @@ struct pcmcia_socket { | |||
208 | u_int features; | 208 | u_int features; |
209 | u_int irq_mask; | 209 | u_int irq_mask; |
210 | u_int map_size; | 210 | u_int map_size; |
211 | kio_addr_t io_offset; | 211 | u_int io_offset; |
212 | u_char pci_irq; | 212 | u_char pci_irq; |
213 | struct pci_dev * cb_dev; | 213 | struct pci_dev * cb_dev; |
214 | 214 | ||