aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/dma-coherent.h13
-rw-r--r--include/asm-generic/fixmap.h3
-rw-r--r--include/asm-generic/ioctl.h5
-rw-r--r--include/asm-generic/pgtable.h39
-rw-r--r--include/asm-generic/resource.h2
-rw-r--r--include/asm-generic/unaligned.h21
-rw-r--r--include/asm-generic/vmlinux.lds.h60
-rw-r--r--include/asm-generic/word-at-a-time.h8
8 files changed, 74 insertions, 77 deletions
diff --git a/include/asm-generic/dma-coherent.h b/include/asm-generic/dma-coherent.h
index 2be8a2dbc868..0297e5875798 100644
--- a/include/asm-generic/dma-coherent.h
+++ b/include/asm-generic/dma-coherent.h
@@ -16,16 +16,13 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
16 * Standard interface 16 * Standard interface
17 */ 17 */
18#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 18#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
19extern int 19int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
20dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, 20 dma_addr_t device_addr, size_t size, int flags);
21 dma_addr_t device_addr, size_t size, int flags);
22 21
23extern void 22void dma_release_declared_memory(struct device *dev);
24dma_release_declared_memory(struct device *dev);
25 23
26extern void * 24void *dma_mark_declared_memory_occupied(struct device *dev,
27dma_mark_declared_memory_occupied(struct device *dev, 25 dma_addr_t device_addr, size_t size);
28 dma_addr_t device_addr, size_t size);
29#else 26#else
30#define dma_alloc_from_coherent(dev, size, handle, ret) (0) 27#define dma_alloc_from_coherent(dev, size, handle, ret) (0)
31#define dma_release_from_coherent(dev, order, vaddr) (0) 28#define dma_release_from_coherent(dev, order, vaddr) (0)
diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h
index 5a64ca4621f3..f23174fb9ec4 100644
--- a/include/asm-generic/fixmap.h
+++ b/include/asm-generic/fixmap.h
@@ -93,5 +93,8 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)
93#define set_fixmap_io(idx, phys) \ 93#define set_fixmap_io(idx, phys) \
94 __set_fixmap(idx, phys, FIXMAP_PAGE_IO) 94 __set_fixmap(idx, phys, FIXMAP_PAGE_IO)
95 95
96#define set_fixmap_offset_io(idx, phys) \
97 __set_fixmap_offset(idx, phys, FIXMAP_PAGE_IO)
98
96#endif /* __ASSEMBLY__ */ 99#endif /* __ASSEMBLY__ */
97#endif /* __ASM_GENERIC_FIXMAP_H */ 100#endif /* __ASM_GENERIC_FIXMAP_H */
diff --git a/include/asm-generic/ioctl.h b/include/asm-generic/ioctl.h
index d17295b290fa..297fb0d7cd6c 100644
--- a/include/asm-generic/ioctl.h
+++ b/include/asm-generic/ioctl.h
@@ -3,10 +3,15 @@
3 3
4#include <uapi/asm-generic/ioctl.h> 4#include <uapi/asm-generic/ioctl.h>
5 5
6#ifdef __CHECKER__
7#define _IOC_TYPECHECK(t) (sizeof(t))
8#else
6/* provoke compile error for invalid uses of size argument */ 9/* provoke compile error for invalid uses of size argument */
7extern unsigned int __invalid_size_argument_for_IOC; 10extern unsigned int __invalid_size_argument_for_IOC;
8#define _IOC_TYPECHECK(t) \ 11#define _IOC_TYPECHECK(t) \
9 ((sizeof(t) == sizeof(t[1]) && \ 12 ((sizeof(t) == sizeof(t[1]) && \
10 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ 13 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
11 sizeof(t) : __invalid_size_argument_for_IOC) 14 sizeof(t) : __invalid_size_argument_for_IOC)
15#endif
16
12#endif /* _ASM_GENERIC_IOCTL_H */ 17#endif /* _ASM_GENERIC_IOCTL_H */
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 1ec08c198b66..53b2acc38213 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -233,6 +233,10 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
233# define pte_accessible(mm, pte) ((void)(pte), 1) 233# define pte_accessible(mm, pte) ((void)(pte), 1)
234#endif 234#endif
235 235
236#ifndef pte_present_nonuma
237#define pte_present_nonuma(pte) pte_present(pte)
238#endif
239
236#ifndef flush_tlb_fix_spurious_fault 240#ifndef flush_tlb_fix_spurious_fault
237#define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address) 241#define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address)
238#endif 242#endif
@@ -670,7 +674,7 @@ static inline int pmd_trans_unstable(pmd_t *pmd)
670static inline int pte_numa(pte_t pte) 674static inline int pte_numa(pte_t pte)
671{ 675{
672 return (pte_flags(pte) & 676 return (pte_flags(pte) &
673 (_PAGE_NUMA|_PAGE_PRESENT)) == _PAGE_NUMA; 677 (_PAGE_NUMA|_PAGE_PROTNONE|_PAGE_PRESENT)) == _PAGE_NUMA;
674} 678}
675#endif 679#endif
676 680
@@ -678,7 +682,7 @@ static inline int pte_numa(pte_t pte)
678static inline int pmd_numa(pmd_t pmd) 682static inline int pmd_numa(pmd_t pmd)
679{ 683{
680 return (pmd_flags(pmd) & 684 return (pmd_flags(pmd) &
681 (_PAGE_NUMA|_PAGE_PRESENT)) == _PAGE_NUMA; 685 (_PAGE_NUMA|_PAGE_PROTNONE|_PAGE_PRESENT)) == _PAGE_NUMA;
682} 686}
683#endif 687#endif
684 688
@@ -693,24 +697,35 @@ static inline int pmd_numa(pmd_t pmd)
693#ifndef pte_mknonnuma 697#ifndef pte_mknonnuma
694static inline pte_t pte_mknonnuma(pte_t pte) 698static inline pte_t pte_mknonnuma(pte_t pte)
695{ 699{
696 pte = pte_clear_flags(pte, _PAGE_NUMA); 700 pteval_t val = pte_val(pte);
697 return pte_set_flags(pte, _PAGE_PRESENT|_PAGE_ACCESSED); 701
702 val &= ~_PAGE_NUMA;
703 val |= (_PAGE_PRESENT|_PAGE_ACCESSED);
704 return __pte(val);
698} 705}
699#endif 706#endif
700 707
701#ifndef pmd_mknonnuma 708#ifndef pmd_mknonnuma
702static inline pmd_t pmd_mknonnuma(pmd_t pmd) 709static inline pmd_t pmd_mknonnuma(pmd_t pmd)
703{ 710{
704 pmd = pmd_clear_flags(pmd, _PAGE_NUMA); 711 pmdval_t val = pmd_val(pmd);
705 return pmd_set_flags(pmd, _PAGE_PRESENT|_PAGE_ACCESSED); 712
713 val &= ~_PAGE_NUMA;
714 val |= (_PAGE_PRESENT|_PAGE_ACCESSED);
715
716 return __pmd(val);
706} 717}
707#endif 718#endif
708 719
709#ifndef pte_mknuma 720#ifndef pte_mknuma
710static inline pte_t pte_mknuma(pte_t pte) 721static inline pte_t pte_mknuma(pte_t pte)
711{ 722{
712 pte = pte_set_flags(pte, _PAGE_NUMA); 723 pteval_t val = pte_val(pte);
713 return pte_clear_flags(pte, _PAGE_PRESENT); 724
725 val &= ~_PAGE_PRESENT;
726 val |= _PAGE_NUMA;
727
728 return __pte(val);
714} 729}
715#endif 730#endif
716 731
@@ -729,8 +744,12 @@ static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr,
729#ifndef pmd_mknuma 744#ifndef pmd_mknuma
730static inline pmd_t pmd_mknuma(pmd_t pmd) 745static inline pmd_t pmd_mknuma(pmd_t pmd)
731{ 746{
732 pmd = pmd_set_flags(pmd, _PAGE_NUMA); 747 pmdval_t val = pmd_val(pmd);
733 return pmd_clear_flags(pmd, _PAGE_PRESENT); 748
749 val &= ~_PAGE_PRESENT;
750 val |= _PAGE_NUMA;
751
752 return __pmd(val);
734} 753}
735#endif 754#endif
736 755
diff --git a/include/asm-generic/resource.h b/include/asm-generic/resource.h
index b4ea8f50fc65..5e752b959054 100644
--- a/include/asm-generic/resource.h
+++ b/include/asm-generic/resource.h
@@ -12,7 +12,7 @@
12 [RLIMIT_CPU] = { RLIM_INFINITY, RLIM_INFINITY }, \ 12 [RLIMIT_CPU] = { RLIM_INFINITY, RLIM_INFINITY }, \
13 [RLIMIT_FSIZE] = { RLIM_INFINITY, RLIM_INFINITY }, \ 13 [RLIMIT_FSIZE] = { RLIM_INFINITY, RLIM_INFINITY }, \
14 [RLIMIT_DATA] = { RLIM_INFINITY, RLIM_INFINITY }, \ 14 [RLIMIT_DATA] = { RLIM_INFINITY, RLIM_INFINITY }, \
15 [RLIMIT_STACK] = { _STK_LIM, _STK_LIM_MAX }, \ 15 [RLIMIT_STACK] = { _STK_LIM, RLIM_INFINITY }, \
16 [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ 16 [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \
17 [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ 17 [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \
18 [RLIMIT_NPROC] = { 0, 0 }, \ 18 [RLIMIT_NPROC] = { 0, 0 }, \
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h
index 03cf5936bad6..1ac097279db1 100644
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -4,22 +4,27 @@
4/* 4/*
5 * This is the most generic implementation of unaligned accesses 5 * This is the most generic implementation of unaligned accesses
6 * and should work almost anywhere. 6 * and should work almost anywhere.
7 *
8 * If an architecture can handle unaligned accesses in hardware,
9 * it may want to use the linux/unaligned/access_ok.h implementation
10 * instead.
11 */ 7 */
12#include <asm/byteorder.h> 8#include <asm/byteorder.h>
13 9
10/* Set by the arch if it can handle unaligned accesses in hardware. */
11#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
12# include <linux/unaligned/access_ok.h>
13#endif
14
14#if defined(__LITTLE_ENDIAN) 15#if defined(__LITTLE_ENDIAN)
15# include <linux/unaligned/le_struct.h> 16# ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
16# include <linux/unaligned/be_byteshift.h> 17# include <linux/unaligned/le_struct.h>
18# include <linux/unaligned/be_byteshift.h>
19# endif
17# include <linux/unaligned/generic.h> 20# include <linux/unaligned/generic.h>
18# define get_unaligned __get_unaligned_le 21# define get_unaligned __get_unaligned_le
19# define put_unaligned __put_unaligned_le 22# define put_unaligned __put_unaligned_le
20#elif defined(__BIG_ENDIAN) 23#elif defined(__BIG_ENDIAN)
21# include <linux/unaligned/be_struct.h> 24# ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
22# include <linux/unaligned/le_byteshift.h> 25# include <linux/unaligned/be_struct.h>
26# include <linux/unaligned/le_byteshift.h>
27# endif
23# include <linux/unaligned/generic.h> 28# include <linux/unaligned/generic.h>
24# define get_unaligned __get_unaligned_be 29# define get_unaligned __get_unaligned_be
25# define put_unaligned __put_unaligned_be 30# define put_unaligned __put_unaligned_be
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 146e4fffd710..d647637cd699 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -139,52 +139,23 @@
139#define TRACE_SYSCALLS() 139#define TRACE_SYSCALLS()
140#endif 140#endif
141 141
142#ifdef CONFIG_CLKSRC_OF
143#define CLKSRC_OF_TABLES() . = ALIGN(8); \
144 VMLINUX_SYMBOL(__clksrc_of_table) = .; \
145 *(__clksrc_of_table) \
146 *(__clksrc_of_table_end)
147#else
148#define CLKSRC_OF_TABLES()
149#endif
150 142
151#ifdef CONFIG_IRQCHIP 143#define ___OF_TABLE(cfg, name) _OF_TABLE_##cfg(name)
152#define IRQCHIP_OF_MATCH_TABLE() \ 144#define __OF_TABLE(cfg, name) ___OF_TABLE(cfg, name)
145#define OF_TABLE(cfg, name) __OF_TABLE(config_enabled(cfg), name)
146#define _OF_TABLE_0(name)
147#define _OF_TABLE_1(name) \
153 . = ALIGN(8); \ 148 . = ALIGN(8); \
154 VMLINUX_SYMBOL(__irqchip_begin) = .; \ 149 VMLINUX_SYMBOL(__##name##_of_table) = .; \
155 *(__irqchip_of_table) \ 150 *(__##name##_of_table) \
156 *(__irqchip_of_end) 151 *(__##name##_of_table_end)
157#else
158#define IRQCHIP_OF_MATCH_TABLE()
159#endif
160
161#ifdef CONFIG_COMMON_CLK
162#define CLK_OF_TABLES() . = ALIGN(8); \
163 VMLINUX_SYMBOL(__clk_of_table) = .; \
164 *(__clk_of_table) \
165 *(__clk_of_table_end)
166#else
167#define CLK_OF_TABLES()
168#endif
169
170#ifdef CONFIG_OF_RESERVED_MEM
171#define RESERVEDMEM_OF_TABLES() \
172 . = ALIGN(8); \
173 VMLINUX_SYMBOL(__reservedmem_of_table) = .; \
174 *(__reservedmem_of_table) \
175 *(__reservedmem_of_table_end)
176#else
177#define RESERVEDMEM_OF_TABLES()
178#endif
179 152
180#ifdef CONFIG_SMP 153#define CLKSRC_OF_TABLES() OF_TABLE(CONFIG_CLKSRC_OF, clksrc)
181#define CPU_METHOD_OF_TABLES() . = ALIGN(8); \ 154#define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip)
182 VMLINUX_SYMBOL(__cpu_method_of_table_begin) = .; \ 155#define CLK_OF_TABLES() OF_TABLE(CONFIG_COMMON_CLK, clk)
183 *(__cpu_method_of_table) \ 156#define RESERVEDMEM_OF_TABLES() OF_TABLE(CONFIG_OF_RESERVED_MEM, reservedmem)
184 VMLINUX_SYMBOL(__cpu_method_of_table_end) = .; 157#define CPU_METHOD_OF_TABLES() OF_TABLE(CONFIG_SMP, cpu_method)
185#else 158#define EARLYCON_OF_TABLES() OF_TABLE(CONFIG_SERIAL_EARLYCON, earlycon)
186#define CPU_METHOD_OF_TABLES()
187#endif
188 159
189#define KERNEL_DTB() \ 160#define KERNEL_DTB() \
190 STRUCT_ALIGN(); \ 161 STRUCT_ALIGN(); \
@@ -513,7 +484,8 @@
513 CLKSRC_OF_TABLES() \ 484 CLKSRC_OF_TABLES() \
514 CPU_METHOD_OF_TABLES() \ 485 CPU_METHOD_OF_TABLES() \
515 KERNEL_DTB() \ 486 KERNEL_DTB() \
516 IRQCHIP_OF_MATCH_TABLE() 487 IRQCHIP_OF_MATCH_TABLE() \
488 EARLYCON_OF_TABLES()
517 489
518#define INIT_TEXT \ 490#define INIT_TEXT \
519 *(.init.text) \ 491 *(.init.text) \
diff --git a/include/asm-generic/word-at-a-time.h b/include/asm-generic/word-at-a-time.h
index d3909effd725..94f9ea8abcae 100644
--- a/include/asm-generic/word-at-a-time.h
+++ b/include/asm-generic/word-at-a-time.h
@@ -50,11 +50,7 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct
50} 50}
51 51
52#ifndef zero_bytemask 52#ifndef zero_bytemask
53#ifdef CONFIG_64BIT 53#define zero_bytemask(mask) (~1ul << __fls(mask))
54#define zero_bytemask(mask) (~0ul << fls64(mask)) 54#endif
55#else
56#define zero_bytemask(mask) (~0ul << fls(mask))
57#endif /* CONFIG_64BIT */
58#endif /* zero_bytemask */
59 55
60#endif /* _ASM_WORD_AT_A_TIME_H */ 56#endif /* _ASM_WORD_AT_A_TIME_H */