diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-07 02:19:51 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-07 02:19:51 -0400 |
commit | a1922ed661ab2c1637d0b10cde933bd9cd33d965 (patch) | |
tree | 0f1777542b385ebefd30b3586d830fd8ed6fda5b /include/asm-generic | |
parent | 75e33751ca8bbb72dd6f1a74d2810ddc8cbe4bdf (diff) | |
parent | d28daf923ac5e4a0d7cecebae56f3e339189366b (diff) |
Merge branch 'tracing/core' into tracing/hw-breakpoints
Conflicts:
arch/Kconfig
kernel/trace/trace.h
Merge reason: resolve the conflicts, plus adopt to the new
ring-buffer APIs.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/4level-fixup.h | 4 | ||||
-rw-r--r-- | include/asm-generic/dma-mapping-common.h | 190 | ||||
-rw-r--r-- | include/asm-generic/hardirq.h | 13 | ||||
-rw-r--r-- | include/asm-generic/kmap_types.h | 5 | ||||
-rw-r--r-- | include/asm-generic/pci.h | 13 | ||||
-rw-r--r-- | include/asm-generic/percpu.h | 4 | ||||
-rw-r--r-- | include/asm-generic/pgtable-nopmd.h | 2 | ||||
-rw-r--r-- | include/asm-generic/pgtable-nopud.h | 2 | ||||
-rw-r--r-- | include/asm-generic/pgtable.h | 4 | ||||
-rw-r--r-- | include/asm-generic/sections.h | 3 | ||||
-rw-r--r-- | include/asm-generic/tlb.h | 12 | ||||
-rw-r--r-- | include/asm-generic/uaccess.h | 14 | ||||
-rw-r--r-- | include/asm-generic/unistd.h | 7 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 43 |
14 files changed, 255 insertions, 61 deletions
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 9d40e879f99e..77ff547730af 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
@@ -27,9 +27,9 @@ | |||
27 | #define pud_page_vaddr(pud) pgd_page_vaddr(pud) | 27 | #define pud_page_vaddr(pud) pgd_page_vaddr(pud) |
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, addr) do { } while (0) |
31 | #define pud_free(mm, 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, addr) do { } while (0) |
33 | 33 | ||
34 | #undef pud_addr_end | 34 | #undef pud_addr_end |
35 | #define pud_addr_end(addr, end) (end) | 35 | #define pud_addr_end(addr, end) (end) |
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h new file mode 100644 index 000000000000..5406a601185c --- /dev/null +++ b/include/asm-generic/dma-mapping-common.h | |||
@@ -0,0 +1,190 @@ | |||
1 | #ifndef _ASM_GENERIC_DMA_MAPPING_H | ||
2 | #define _ASM_GENERIC_DMA_MAPPING_H | ||
3 | |||
4 | #include <linux/kmemcheck.h> | ||
5 | #include <linux/scatterlist.h> | ||
6 | #include <linux/dma-debug.h> | ||
7 | #include <linux/dma-attrs.h> | ||
8 | |||
9 | static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr, | ||
10 | size_t size, | ||
11 | enum dma_data_direction dir, | ||
12 | struct dma_attrs *attrs) | ||
13 | { | ||
14 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
15 | dma_addr_t addr; | ||
16 | |||
17 | kmemcheck_mark_initialized(ptr, size); | ||
18 | BUG_ON(!valid_dma_direction(dir)); | ||
19 | addr = ops->map_page(dev, virt_to_page(ptr), | ||
20 | (unsigned long)ptr & ~PAGE_MASK, size, | ||
21 | dir, attrs); | ||
22 | debug_dma_map_page(dev, virt_to_page(ptr), | ||
23 | (unsigned long)ptr & ~PAGE_MASK, size, | ||
24 | dir, addr, true); | ||
25 | return addr; | ||
26 | } | ||
27 | |||
28 | static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr, | ||
29 | size_t size, | ||
30 | enum dma_data_direction dir, | ||
31 | struct dma_attrs *attrs) | ||
32 | { | ||
33 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
34 | |||
35 | BUG_ON(!valid_dma_direction(dir)); | ||
36 | if (ops->unmap_page) | ||
37 | ops->unmap_page(dev, addr, size, dir, attrs); | ||
38 | debug_dma_unmap_page(dev, addr, size, dir, true); | ||
39 | } | ||
40 | |||
41 | static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, | ||
42 | int nents, enum dma_data_direction dir, | ||
43 | struct dma_attrs *attrs) | ||
44 | { | ||
45 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
46 | int i, ents; | ||
47 | struct scatterlist *s; | ||
48 | |||
49 | for_each_sg(sg, s, nents, i) | ||
50 | kmemcheck_mark_initialized(sg_virt(s), s->length); | ||
51 | BUG_ON(!valid_dma_direction(dir)); | ||
52 | ents = ops->map_sg(dev, sg, nents, dir, attrs); | ||
53 | debug_dma_map_sg(dev, sg, nents, ents, dir); | ||
54 | |||
55 | return ents; | ||
56 | } | ||
57 | |||
58 | static inline void dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, | ||
59 | int nents, enum dma_data_direction dir, | ||
60 | struct dma_attrs *attrs) | ||
61 | { | ||
62 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
63 | |||
64 | BUG_ON(!valid_dma_direction(dir)); | ||
65 | debug_dma_unmap_sg(dev, sg, nents, dir); | ||
66 | if (ops->unmap_sg) | ||
67 | ops->unmap_sg(dev, sg, nents, dir, attrs); | ||
68 | } | ||
69 | |||
70 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | ||
71 | size_t offset, size_t size, | ||
72 | enum dma_data_direction dir) | ||
73 | { | ||
74 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
75 | dma_addr_t addr; | ||
76 | |||
77 | kmemcheck_mark_initialized(page_address(page) + offset, size); | ||
78 | BUG_ON(!valid_dma_direction(dir)); | ||
79 | addr = ops->map_page(dev, page, offset, size, dir, NULL); | ||
80 | debug_dma_map_page(dev, page, offset, size, dir, addr, false); | ||
81 | |||
82 | return addr; | ||
83 | } | ||
84 | |||
85 | static inline void dma_unmap_page(struct device *dev, dma_addr_t addr, | ||
86 | size_t size, enum dma_data_direction dir) | ||
87 | { | ||
88 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
89 | |||
90 | BUG_ON(!valid_dma_direction(dir)); | ||
91 | if (ops->unmap_page) | ||
92 | ops->unmap_page(dev, addr, size, dir, NULL); | ||
93 | debug_dma_unmap_page(dev, addr, size, dir, false); | ||
94 | } | ||
95 | |||
96 | static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, | ||
97 | size_t size, | ||
98 | enum dma_data_direction dir) | ||
99 | { | ||
100 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
101 | |||
102 | BUG_ON(!valid_dma_direction(dir)); | ||
103 | if (ops->sync_single_for_cpu) | ||
104 | ops->sync_single_for_cpu(dev, addr, size, dir); | ||
105 | debug_dma_sync_single_for_cpu(dev, addr, size, dir); | ||
106 | flush_write_buffers(); | ||
107 | } | ||
108 | |||
109 | static inline void dma_sync_single_for_device(struct device *dev, | ||
110 | dma_addr_t addr, size_t size, | ||
111 | enum dma_data_direction dir) | ||
112 | { | ||
113 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
114 | |||
115 | BUG_ON(!valid_dma_direction(dir)); | ||
116 | if (ops->sync_single_for_device) | ||
117 | ops->sync_single_for_device(dev, addr, size, dir); | ||
118 | debug_dma_sync_single_for_device(dev, addr, size, dir); | ||
119 | flush_write_buffers(); | ||
120 | } | ||
121 | |||
122 | static inline void dma_sync_single_range_for_cpu(struct device *dev, | ||
123 | dma_addr_t addr, | ||
124 | unsigned long offset, | ||
125 | size_t size, | ||
126 | enum dma_data_direction dir) | ||
127 | { | ||
128 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
129 | |||
130 | BUG_ON(!valid_dma_direction(dir)); | ||
131 | if (ops->sync_single_range_for_cpu) { | ||
132 | ops->sync_single_range_for_cpu(dev, addr, offset, size, dir); | ||
133 | debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); | ||
134 | |||
135 | flush_write_buffers(); | ||
136 | } else | ||
137 | dma_sync_single_for_cpu(dev, addr, size, dir); | ||
138 | } | ||
139 | |||
140 | static inline void dma_sync_single_range_for_device(struct device *dev, | ||
141 | dma_addr_t addr, | ||
142 | unsigned long offset, | ||
143 | size_t size, | ||
144 | enum dma_data_direction dir) | ||
145 | { | ||
146 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
147 | |||
148 | BUG_ON(!valid_dma_direction(dir)); | ||
149 | if (ops->sync_single_range_for_device) { | ||
150 | ops->sync_single_range_for_device(dev, addr, offset, size, dir); | ||
151 | debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); | ||
152 | |||
153 | flush_write_buffers(); | ||
154 | } else | ||
155 | dma_sync_single_for_device(dev, addr, size, dir); | ||
156 | } | ||
157 | |||
158 | static inline void | ||
159 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | ||
160 | int nelems, enum dma_data_direction dir) | ||
161 | { | ||
162 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
163 | |||
164 | BUG_ON(!valid_dma_direction(dir)); | ||
165 | if (ops->sync_sg_for_cpu) | ||
166 | ops->sync_sg_for_cpu(dev, sg, nelems, dir); | ||
167 | debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); | ||
168 | flush_write_buffers(); | ||
169 | } | ||
170 | |||
171 | static inline void | ||
172 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | ||
173 | int nelems, enum dma_data_direction dir) | ||
174 | { | ||
175 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
176 | |||
177 | BUG_ON(!valid_dma_direction(dir)); | ||
178 | if (ops->sync_sg_for_device) | ||
179 | ops->sync_sg_for_device(dev, sg, nelems, dir); | ||
180 | debug_dma_sync_sg_for_device(dev, sg, nelems, dir); | ||
181 | |||
182 | flush_write_buffers(); | ||
183 | } | ||
184 | |||
185 | #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL) | ||
186 | #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, NULL) | ||
187 | #define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, NULL) | ||
188 | #define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, NULL) | ||
189 | |||
190 | #endif | ||
diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h index 3d5d2c906ab3..23bb4dad4962 100644 --- a/include/asm-generic/hardirq.h +++ b/include/asm-generic/hardirq.h | |||
@@ -11,19 +11,6 @@ typedef struct { | |||
11 | 11 | ||
12 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | 12 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ |
13 | 13 | ||
14 | #ifndef HARDIRQ_BITS | ||
15 | #define HARDIRQ_BITS 8 | ||
16 | #endif | ||
17 | |||
18 | /* | ||
19 | * The hardirq mask has to be large enough to have | ||
20 | * space for potentially all IRQ sources in the system | ||
21 | * nesting on a single CPU: | ||
22 | */ | ||
23 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
24 | # error HARDIRQ_BITS is too low! | ||
25 | #endif | ||
26 | |||
27 | #ifndef ack_bad_irq | 14 | #ifndef ack_bad_irq |
28 | static inline void ack_bad_irq(unsigned int irq) | 15 | static inline void ack_bad_irq(unsigned int irq) |
29 | { | 16 | { |
diff --git a/include/asm-generic/kmap_types.h b/include/asm-generic/kmap_types.h index 54e8b3d956b7..eddbce0f9fb9 100644 --- a/include/asm-generic/kmap_types.h +++ b/include/asm-generic/kmap_types.h | |||
@@ -24,7 +24,10 @@ D(12) KM_SOFTIRQ1, | |||
24 | D(13) KM_SYNC_ICACHE, | 24 | D(13) KM_SYNC_ICACHE, |
25 | D(14) KM_SYNC_DCACHE, | 25 | D(14) KM_SYNC_DCACHE, |
26 | D(15) KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */ | 26 | D(15) KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */ |
27 | D(16) KM_TYPE_NR | 27 | D(16) KM_IRQ_PTE, |
28 | D(17) KM_NMI, | ||
29 | D(18) KM_NMI_PTE, | ||
30 | D(19) KM_TYPE_NR | ||
28 | }; | 31 | }; |
29 | 32 | ||
30 | #undef D | 33 | #undef D |
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h index 515c6e2e3218..b4326b5466eb 100644 --- a/include/asm-generic/pci.h +++ b/include/asm-generic/pci.h | |||
@@ -30,19 +30,6 @@ pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | |||
30 | res->end = region->end; | 30 | res->end = region->end; |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline struct resource * | ||
34 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | ||
35 | { | ||
36 | struct resource *root = NULL; | ||
37 | |||
38 | if (res->flags & IORESOURCE_IO) | ||
39 | root = &ioport_resource; | ||
40 | if (res->flags & IORESOURCE_MEM) | ||
41 | root = &iomem_resource; | ||
42 | |||
43 | return root; | ||
44 | } | ||
45 | |||
46 | #define pcibios_scan_all_fns(a, b) 0 | 33 | #define pcibios_scan_all_fns(a, b) 0 |
47 | 34 | ||
48 | #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ | 35 | #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ |
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index d7d50d7ee51e..aa00800adacc 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -97,4 +97,8 @@ extern void setup_per_cpu_areas(void); | |||
97 | #define PER_CPU_ATTRIBUTES | 97 | #define PER_CPU_ATTRIBUTES |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | #ifndef PER_CPU_DEF_ATTRIBUTES | ||
101 | #define PER_CPU_DEF_ATTRIBUTES | ||
102 | #endif | ||
103 | |||
100 | #endif /* _ASM_GENERIC_PERCPU_H_ */ | 104 | #endif /* _ASM_GENERIC_PERCPU_H_ */ |
diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index a7cdc48e8b78..725612b793ce 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h | |||
@@ -59,7 +59,7 @@ static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address) | |||
59 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | 59 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
60 | { | 60 | { |
61 | } | 61 | } |
62 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 62 | #define __pmd_free_tlb(tlb, x, a) do { } while (0) |
63 | 63 | ||
64 | #undef pmd_addr_end | 64 | #undef pmd_addr_end |
65 | #define pmd_addr_end(addr, end) (end) | 65 | #define pmd_addr_end(addr, end) (end) |
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index 87cf449a6df3..810431d8351b 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h | |||
@@ -52,7 +52,7 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address) | |||
52 | */ | 52 | */ |
53 | #define pud_alloc_one(mm, address) NULL | 53 | #define pud_alloc_one(mm, address) NULL |
54 | #define pud_free(mm, 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, a) do { } while (0) |
56 | 56 | ||
57 | #undef pud_addr_end | 57 | #undef pud_addr_end |
58 | #define pud_addr_end(addr, end) (end) | 58 | #define pud_addr_end(addr, end) (end) |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index e410f602cab1..e2bd73e8f9c0 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -129,6 +129,10 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
129 | #define move_pte(pte, prot, old_addr, new_addr) (pte) | 129 | #define move_pte(pte, prot, old_addr, new_addr) (pte) |
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | #ifndef pgprot_noncached | ||
133 | #define pgprot_noncached(prot) (prot) | ||
134 | #endif | ||
135 | |||
132 | #ifndef pgprot_writecombine | 136 | #ifndef pgprot_writecombine |
133 | #define pgprot_writecombine pgprot_noncached | 137 | #define pgprot_writecombine pgprot_noncached |
134 | #endif | 138 | #endif |
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 4ce48e878530..d083561337f2 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h | |||
@@ -14,6 +14,9 @@ extern char __kprobes_text_start[], __kprobes_text_end[]; | |||
14 | extern char __initdata_begin[], __initdata_end[]; | 14 | extern char __initdata_begin[], __initdata_end[]; |
15 | extern char __start_rodata[], __end_rodata[]; | 15 | extern char __start_rodata[], __end_rodata[]; |
16 | 16 | ||
17 | /* Start and end of .ctors section - used for constructor calls. */ | ||
18 | extern char __ctors_start[], __ctors_end[]; | ||
19 | |||
17 | /* function descriptor handling (if any). Override | 20 | /* function descriptor handling (if any). Override |
18 | * in asm/sections.h */ | 21 | * in asm/sections.h */ |
19 | #ifndef dereference_function_descriptor | 22 | #ifndef dereference_function_descriptor |
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index f490e43a90b9..e43f9766259f 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h | |||
@@ -123,24 +123,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) | |||
123 | __tlb_remove_tlb_entry(tlb, ptep, address); \ | 123 | __tlb_remove_tlb_entry(tlb, ptep, address); \ |
124 | } while (0) | 124 | } while (0) |
125 | 125 | ||
126 | #define pte_free_tlb(tlb, ptep) \ | 126 | #define pte_free_tlb(tlb, ptep, address) \ |
127 | do { \ | 127 | do { \ |
128 | tlb->need_flush = 1; \ | 128 | tlb->need_flush = 1; \ |
129 | __pte_free_tlb(tlb, ptep); \ | 129 | __pte_free_tlb(tlb, ptep, address); \ |
130 | } while (0) | 130 | } while (0) |
131 | 131 | ||
132 | #ifndef __ARCH_HAS_4LEVEL_HACK | 132 | #ifndef __ARCH_HAS_4LEVEL_HACK |
133 | #define pud_free_tlb(tlb, pudp) \ | 133 | #define pud_free_tlb(tlb, pudp, address) \ |
134 | do { \ | 134 | do { \ |
135 | tlb->need_flush = 1; \ | 135 | tlb->need_flush = 1; \ |
136 | __pud_free_tlb(tlb, pudp); \ | 136 | __pud_free_tlb(tlb, pudp, address); \ |
137 | } while (0) | 137 | } while (0) |
138 | #endif | 138 | #endif |
139 | 139 | ||
140 | #define pmd_free_tlb(tlb, pmdp) \ | 140 | #define pmd_free_tlb(tlb, pmdp, address) \ |
141 | do { \ | 141 | do { \ |
142 | tlb->need_flush = 1; \ | 142 | tlb->need_flush = 1; \ |
143 | __pmd_free_tlb(tlb, pmdp); \ | 143 | __pmd_free_tlb(tlb, pmdp, address); \ |
144 | } while (0) | 144 | } while (0) |
145 | 145 | ||
146 | #define tlb_migrate_finish(mm) do {} while (0) | 146 | #define tlb_migrate_finish(mm) do {} while (0) |
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h index 6d8cab22e294..b218b8513d04 100644 --- a/include/asm-generic/uaccess.h +++ b/include/asm-generic/uaccess.h | |||
@@ -163,7 +163,7 @@ static inline __must_check long __copy_to_user(void __user *to, | |||
163 | #define put_user(x, ptr) \ | 163 | #define put_user(x, ptr) \ |
164 | ({ \ | 164 | ({ \ |
165 | might_sleep(); \ | 165 | might_sleep(); \ |
166 | __access_ok(ptr, sizeof (*ptr)) ? \ | 166 | access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \ |
167 | __put_user(x, ptr) : \ | 167 | __put_user(x, ptr) : \ |
168 | -EFAULT; \ | 168 | -EFAULT; \ |
169 | }) | 169 | }) |
@@ -219,7 +219,7 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
219 | #define get_user(x, ptr) \ | 219 | #define get_user(x, ptr) \ |
220 | ({ \ | 220 | ({ \ |
221 | might_sleep(); \ | 221 | might_sleep(); \ |
222 | __access_ok(ptr, sizeof (*ptr)) ? \ | 222 | access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ |
223 | __get_user(x, ptr) : \ | 223 | __get_user(x, ptr) : \ |
224 | -EFAULT; \ | 224 | -EFAULT; \ |
225 | }) | 225 | }) |
@@ -244,7 +244,7 @@ static inline long copy_from_user(void *to, | |||
244 | const void __user * from, unsigned long n) | 244 | const void __user * from, unsigned long n) |
245 | { | 245 | { |
246 | might_sleep(); | 246 | might_sleep(); |
247 | if (__access_ok(from, n)) | 247 | if (access_ok(VERIFY_READ, from, n)) |
248 | return __copy_from_user(to, from, n); | 248 | return __copy_from_user(to, from, n); |
249 | else | 249 | else |
250 | return n; | 250 | return n; |
@@ -254,7 +254,7 @@ static inline long copy_to_user(void __user *to, | |||
254 | const void *from, unsigned long n) | 254 | const void *from, unsigned long n) |
255 | { | 255 | { |
256 | might_sleep(); | 256 | might_sleep(); |
257 | if (__access_ok(to, n)) | 257 | if (access_ok(VERIFY_WRITE, to, n)) |
258 | return __copy_to_user(to, from, n); | 258 | return __copy_to_user(to, from, n); |
259 | else | 259 | else |
260 | return n; | 260 | return n; |
@@ -278,7 +278,7 @@ __strncpy_from_user(char *dst, const char __user *src, long count) | |||
278 | static inline long | 278 | static inline long |
279 | strncpy_from_user(char *dst, const char __user *src, long count) | 279 | strncpy_from_user(char *dst, const char __user *src, long count) |
280 | { | 280 | { |
281 | if (!__access_ok(src, 1)) | 281 | if (!access_ok(VERIFY_READ, src, 1)) |
282 | return -EFAULT; | 282 | return -EFAULT; |
283 | return __strncpy_from_user(dst, src, count); | 283 | return __strncpy_from_user(dst, src, count); |
284 | } | 284 | } |
@@ -291,6 +291,8 @@ strncpy_from_user(char *dst, const char __user *src, long count) | |||
291 | #ifndef strnlen_user | 291 | #ifndef strnlen_user |
292 | static inline long strnlen_user(const char __user *src, long n) | 292 | static inline long strnlen_user(const char __user *src, long n) |
293 | { | 293 | { |
294 | if (!access_ok(VERIFY_READ, src, 1)) | ||
295 | return 0; | ||
294 | return strlen((void * __force)src) + 1; | 296 | return strlen((void * __force)src) + 1; |
295 | } | 297 | } |
296 | #endif | 298 | #endif |
@@ -316,7 +318,7 @@ static inline __must_check unsigned long | |||
316 | clear_user(void __user *to, unsigned long n) | 318 | clear_user(void __user *to, unsigned long n) |
317 | { | 319 | { |
318 | might_sleep(); | 320 | might_sleep(); |
319 | if (!__access_ok(to, n)) | 321 | if (!access_ok(VERIFY_WRITE, to, n)) |
320 | return n; | 322 | return n; |
321 | 323 | ||
322 | return __clear_user(to, n); | 324 | return __clear_user(to, n); |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index 5b34b6233d6d..1125e5a1ee5d 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
@@ -618,8 +618,13 @@ __SYSCALL(__NR_migrate_pages, sys_migrate_pages) | |||
618 | __SYSCALL(__NR_move_pages, sys_move_pages) | 618 | __SYSCALL(__NR_move_pages, sys_move_pages) |
619 | #endif | 619 | #endif |
620 | 620 | ||
621 | #define __NR_rt_tgsigqueueinfo 240 | ||
622 | __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) | ||
623 | #define __NR_perf_counter_open 241 | ||
624 | __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) | ||
625 | |||
621 | #undef __NR_syscalls | 626 | #undef __NR_syscalls |
622 | #define __NR_syscalls 240 | 627 | #define __NR_syscalls 242 |
623 | 628 | ||
624 | /* | 629 | /* |
625 | * All syscalls below here should go away really, | 630 | * All syscalls below here should go away really, |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 6bdba10fef4a..6ad76bf5fb40 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -30,9 +30,7 @@ | |||
30 | * EXCEPTION_TABLE(...) | 30 | * EXCEPTION_TABLE(...) |
31 | * NOTES | 31 | * NOTES |
32 | * | 32 | * |
33 | * __bss_start = .; | 33 | * BSS_SECTION(0, 0, 0) |
34 | * BSS_SECTION(0, 0) | ||
35 | * __bss_stop = .; | ||
36 | * _end = .; | 34 | * _end = .; |
37 | * | 35 | * |
38 | * /DISCARD/ : { | 36 | * /DISCARD/ : { |
@@ -191,7 +189,7 @@ | |||
191 | . = ALIGN(align); \ | 189 | . = ALIGN(align); \ |
192 | *(.data.cacheline_aligned) | 190 | *(.data.cacheline_aligned) |
193 | 191 | ||
194 | #define INIT_TASK(align) \ | 192 | #define INIT_TASK_DATA(align) \ |
195 | . = ALIGN(align); \ | 193 | . = ALIGN(align); \ |
196 | *(.data.init_task) | 194 | *(.data.init_task) |
197 | 195 | ||
@@ -434,18 +432,28 @@ | |||
434 | /* | 432 | /* |
435 | * Init task | 433 | * Init task |
436 | */ | 434 | */ |
437 | #define INIT_TASK_DATA(align) \ | 435 | #define INIT_TASK_DATA_SECTION(align) \ |
438 | . = ALIGN(align); \ | 436 | . = ALIGN(align); \ |
439 | .data.init_task : { \ | 437 | .data.init_task : { \ |
440 | INIT_TASK \ | 438 | INIT_TASK_DATA(align) \ |
441 | } | 439 | } |
442 | 440 | ||
441 | #ifdef CONFIG_CONSTRUCTORS | ||
442 | #define KERNEL_CTORS() . = ALIGN(8); \ | ||
443 | VMLINUX_SYMBOL(__ctors_start) = .; \ | ||
444 | *(.ctors) \ | ||
445 | VMLINUX_SYMBOL(__ctors_end) = .; | ||
446 | #else | ||
447 | #define KERNEL_CTORS() | ||
448 | #endif | ||
449 | |||
443 | /* init and exit section handling */ | 450 | /* init and exit section handling */ |
444 | #define INIT_DATA \ | 451 | #define INIT_DATA \ |
445 | *(.init.data) \ | 452 | *(.init.data) \ |
446 | DEV_DISCARD(init.data) \ | 453 | DEV_DISCARD(init.data) \ |
447 | CPU_DISCARD(init.data) \ | 454 | CPU_DISCARD(init.data) \ |
448 | MEM_DISCARD(init.data) \ | 455 | MEM_DISCARD(init.data) \ |
456 | KERNEL_CTORS() \ | ||
449 | *(.init.rodata) \ | 457 | *(.init.rodata) \ |
450 | DEV_DISCARD(init.rodata) \ | 458 | DEV_DISCARD(init.rodata) \ |
451 | CPU_DISCARD(init.rodata) \ | 459 | CPU_DISCARD(init.rodata) \ |
@@ -479,7 +487,8 @@ | |||
479 | * bss (Block Started by Symbol) - uninitialized data | 487 | * bss (Block Started by Symbol) - uninitialized data |
480 | * zeroed during startup | 488 | * zeroed during startup |
481 | */ | 489 | */ |
482 | #define SBSS \ | 490 | #define SBSS(sbss_align) \ |
491 | . = ALIGN(sbss_align); \ | ||
483 | .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ | 492 | .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ |
484 | *(.sbss) \ | 493 | *(.sbss) \ |
485 | *(.scommon) \ | 494 | *(.scommon) \ |
@@ -488,12 +497,10 @@ | |||
488 | #define BSS(bss_align) \ | 497 | #define BSS(bss_align) \ |
489 | . = ALIGN(bss_align); \ | 498 | . = ALIGN(bss_align); \ |
490 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ | 499 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ |
491 | VMLINUX_SYMBOL(__bss_start) = .; \ | ||
492 | *(.bss.page_aligned) \ | 500 | *(.bss.page_aligned) \ |
493 | *(.dynbss) \ | 501 | *(.dynbss) \ |
494 | *(.bss) \ | 502 | *(.bss) \ |
495 | *(COMMON) \ | 503 | *(COMMON) \ |
496 | VMLINUX_SYMBOL(__bss_stop) = .; \ | ||
497 | } | 504 | } |
498 | 505 | ||
499 | /* | 506 | /* |
@@ -616,7 +623,7 @@ | |||
616 | *(.init.ramfs) \ | 623 | *(.init.ramfs) \ |
617 | VMLINUX_SYMBOL(__initramfs_end) = .; | 624 | VMLINUX_SYMBOL(__initramfs_end) = .; |
618 | #else | 625 | #else |
619 | #define INITRAMFS | 626 | #define INIT_RAM_FS |
620 | #endif | 627 | #endif |
621 | 628 | ||
622 | /** | 629 | /** |
@@ -695,15 +702,15 @@ | |||
695 | * matches the requirment of PAGE_ALIGNED_DATA. | 702 | * matches the requirment of PAGE_ALIGNED_DATA. |
696 | * | 703 | * |
697 | * use 0 as page_align if page_aligned data is not used */ | 704 | * use 0 as page_align if page_aligned data is not used */ |
698 | #define RW_DATA_SECTION(cacheline, nosave, pagealigned, inittask) \ | 705 | #define RW_DATA_SECTION(cacheline, pagealigned, inittask) \ |
699 | . = ALIGN(PAGE_SIZE); \ | 706 | . = ALIGN(PAGE_SIZE); \ |
700 | .data : AT(ADDR(.data) - LOAD_OFFSET) { \ | 707 | .data : AT(ADDR(.data) - LOAD_OFFSET) { \ |
701 | INIT_TASK(inittask) \ | 708 | INIT_TASK_DATA(inittask) \ |
702 | CACHELINE_ALIGNED_DATA(cacheline) \ | 709 | CACHELINE_ALIGNED_DATA(cacheline) \ |
703 | READ_MOSTLY_DATA(cacheline) \ | 710 | READ_MOSTLY_DATA(cacheline) \ |
704 | DATA_DATA \ | 711 | DATA_DATA \ |
705 | CONSTRUCTORS \ | 712 | CONSTRUCTORS \ |
706 | NOSAVE_DATA(nosave) \ | 713 | NOSAVE_DATA \ |
707 | PAGE_ALIGNED_DATA(pagealigned) \ | 714 | PAGE_ALIGNED_DATA(pagealigned) \ |
708 | } | 715 | } |
709 | 716 | ||
@@ -725,8 +732,10 @@ | |||
725 | INIT_RAM_FS \ | 732 | INIT_RAM_FS \ |
726 | } | 733 | } |
727 | 734 | ||
728 | #define BSS_SECTION(sbss_align, bss_align) \ | 735 | #define BSS_SECTION(sbss_align, bss_align, stop_align) \ |
729 | SBSS \ | 736 | . = ALIGN(sbss_align); \ |
737 | VMLINUX_SYMBOL(__bss_start) = .; \ | ||
738 | SBSS(sbss_align) \ | ||
730 | BSS(bss_align) \ | 739 | BSS(bss_align) \ |
731 | . = ALIGN(4); | 740 | . = ALIGN(stop_align); \ |
732 | 741 | VMLINUX_SYMBOL(__bss_stop) = .; | |