aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/pgtable.h57
-rw-r--r--include/asm-generic/topology.h3
-rw-r--r--include/asm-generic/vmlinux.lds.h27
3 files changed, 86 insertions, 1 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 44ef329531c3..ef87f889ef62 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -195,6 +195,63 @@ static inline int pmd_none_or_clear_bad(pmd_t *pmd)
195 } 195 }
196 return 0; 196 return 0;
197} 197}
198
199static inline pte_t __ptep_modify_prot_start(struct mm_struct *mm,
200 unsigned long addr,
201 pte_t *ptep)
202{
203 /*
204 * Get the current pte state, but zero it out to make it
205 * non-present, preventing the hardware from asynchronously
206 * updating it.
207 */
208 return ptep_get_and_clear(mm, addr, ptep);
209}
210
211static inline void __ptep_modify_prot_commit(struct mm_struct *mm,
212 unsigned long addr,
213 pte_t *ptep, pte_t pte)
214{
215 /*
216 * The pte is non-present, so there's no hardware state to
217 * preserve.
218 */
219 set_pte_at(mm, addr, ptep, pte);
220}
221
222#ifndef __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION
223/*
224 * Start a pte protection read-modify-write transaction, which
225 * protects against asynchronous hardware modifications to the pte.
226 * The intention is not to prevent the hardware from making pte
227 * updates, but to prevent any updates it may make from being lost.
228 *
229 * This does not protect against other software modifications of the
230 * pte; the appropriate pte lock must be held over the transation.
231 *
232 * Note that this interface is intended to be batchable, meaning that
233 * ptep_modify_prot_commit may not actually update the pte, but merely
234 * queue the update to be done at some later time. The update must be
235 * actually committed before the pte lock is released, however.
236 */
237static inline pte_t ptep_modify_prot_start(struct mm_struct *mm,
238 unsigned long addr,
239 pte_t *ptep)
240{
241 return __ptep_modify_prot_start(mm, addr, ptep);
242}
243
244/*
245 * Commit an update to a pte, leaving any hardware-controlled bits in
246 * the PTE unmodified.
247 */
248static inline void ptep_modify_prot_commit(struct mm_struct *mm,
249 unsigned long addr,
250 pte_t *ptep, pte_t pte)
251{
252 __ptep_modify_prot_commit(mm, addr, ptep, pte);
253}
254#endif /* __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION */
198#endif /* CONFIG_MMU */ 255#endif /* CONFIG_MMU */
199 256
200/* 257/*
diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index a6aea79bca4f..54bbf6e04ee8 100644
--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -60,7 +60,8 @@
60#ifndef node_to_cpumask_ptr 60#ifndef node_to_cpumask_ptr
61 61
62#define node_to_cpumask_ptr(v, node) \ 62#define node_to_cpumask_ptr(v, node) \
63 cpumask_t _##v = node_to_cpumask(node), *v = &_##v 63 cpumask_t _##v = node_to_cpumask(node); \
64 const cpumask_t *v = &_##v
64 65
65#define node_to_cpumask_ptr_next(v, node) \ 66#define node_to_cpumask_ptr_next(v, node) \
66 _##v = node_to_cpumask(node) 67 _##v = node_to_cpumask(node)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f054778e916c..b20409404c7d 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -67,6 +67,8 @@
67 *(.rodata1) \ 67 *(.rodata1) \
68 } \ 68 } \
69 \ 69 \
70 BUG_TABLE \
71 \
70 /* PCI quirks */ \ 72 /* PCI quirks */ \
71 .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \ 73 .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
72 VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \ 74 VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
@@ -86,6 +88,13 @@
86 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \ 88 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \
87 } \ 89 } \
88 \ 90 \
91 /* Built-in firmware blobs */ \
92 .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \
93 VMLINUX_SYMBOL(__start_builtin_fw) = .; \
94 *(.builtin_fw) \
95 VMLINUX_SYMBOL(__end_builtin_fw) = .; \
96 } \
97 \
89 /* RapidIO route ops */ \ 98 /* RapidIO route ops */ \
90 .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \ 99 .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \
91 VMLINUX_SYMBOL(__start_rio_route_ops) = .; \ 100 VMLINUX_SYMBOL(__start_rio_route_ops) = .; \
@@ -93,6 +102,8 @@
93 VMLINUX_SYMBOL(__end_rio_route_ops) = .; \ 102 VMLINUX_SYMBOL(__end_rio_route_ops) = .; \
94 } \ 103 } \
95 \ 104 \
105 TRACEDATA \
106 \
96 /* Kernel symbol table: Normal symbols */ \ 107 /* Kernel symbol table: Normal symbols */ \
97 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ 108 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
98 VMLINUX_SYMBOL(__start___ksymtab) = .; \ 109 VMLINUX_SYMBOL(__start___ksymtab) = .; \
@@ -310,6 +321,7 @@
310 .stab.indexstr 0 : { *(.stab.indexstr) } \ 321 .stab.indexstr 0 : { *(.stab.indexstr) } \
311 .comment 0 : { *(.comment) } 322 .comment 0 : { *(.comment) }
312 323
324#ifdef CONFIG_GENERIC_BUG
313#define BUG_TABLE \ 325#define BUG_TABLE \
314 . = ALIGN(8); \ 326 . = ALIGN(8); \
315 __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ 327 __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
@@ -317,6 +329,21 @@
317 *(__bug_table) \ 329 *(__bug_table) \
318 __stop___bug_table = .; \ 330 __stop___bug_table = .; \
319 } 331 }
332#else
333#define BUG_TABLE
334#endif
335
336#ifdef CONFIG_PM_TRACE
337#define TRACEDATA \
338 . = ALIGN(4); \
339 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \
340 __tracedata_start = .; \
341 *(.tracedata) \
342 __tracedata_end = .; \
343 }
344#else
345#define TRACEDATA
346#endif
320 347
321#define NOTES \ 348#define NOTES \
322 .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ 349 .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \