aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-12-09 17:21:45 -0500
committerRichard Kuo <rkuo@codeaurora.org>2014-12-16 14:27:12 -0500
commitcb84c2b401d9cead5508cfed57b59b6d5feffdac (patch)
treec16c8a0304a2d9a790360fb2376132ba9272b4b5 /arch
parentb2776bf7149bddd1f4161f14f79520f17fc1d71d (diff)
hexagon: Fix build failures in linux-next
hexagon:defconfig fails to build in linux-next since commit 332fd7c4fef5 ("genirq: Generic chip: Change irq_reg_{readl,writel} arguments"). The primary build failure is arch/hexagon/include/asm/cacheflush.h: In function 'copy_to_user_page': arch/hexagon/include/asm/cacheflush.h:89:22: error: 'VM_EXEC' undeclared This is the result of including of <linux/io.h> from <linux/irq.h>, which is now necessary due to the use of readl and writel from irq.h. This causes recursive inclusions in hexagon code; cacheflush.h is included from mm.h prior to the definition of VM_EXEC. Fix the problem by moving copy_to_user_page from the hexagon include file to arch/hexagon/mm/cache.c, similar to other architectures. After this change, several redefinitions of readl and writel are reported. Those are caused by recursive inclusions of io.h and asm/cacheflush.h. Fix those problems by reducing the number of files included from those files. Also, it was necessary to stop including asm-generic/cacheflush.h from asm/cacheflush.h. Instead, functionality originally provided by asm-generic/cacheflush.h is now coded in asm/cacheflush.h directly. Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> signed-off-by: Richard Kuo <rkuo@codeaurora.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/hexagon/include/asm/cacheflush.h36
-rw-r--r--arch/hexagon/include/asm/io.h5
-rw-r--r--arch/hexagon/kernel/setup.c1
-rw-r--r--arch/hexagon/mm/cache.c10
-rw-r--r--arch/hexagon/mm/ioremap.c1
5 files changed, 31 insertions, 22 deletions
diff --git a/arch/hexagon/include/asm/cacheflush.h b/arch/hexagon/include/asm/cacheflush.h
index 49e0896ec240..b86f9f300e94 100644
--- a/arch/hexagon/include/asm/cacheflush.h
+++ b/arch/hexagon/include/asm/cacheflush.h
@@ -21,10 +21,7 @@
21#ifndef _ASM_CACHEFLUSH_H 21#ifndef _ASM_CACHEFLUSH_H
22#define _ASM_CACHEFLUSH_H 22#define _ASM_CACHEFLUSH_H
23 23
24#include <linux/cache.h> 24#include <linux/mm_types.h>
25#include <linux/mm.h>
26#include <asm/string.h>
27#include <asm-generic/cacheflush.h>
28 25
29/* Cache flushing: 26/* Cache flushing:
30 * 27 *
@@ -41,6 +38,20 @@
41#define LINESIZE 32 38#define LINESIZE 32
42#define LINEBITS 5 39#define LINEBITS 5
43 40
41#define flush_cache_all() do { } while (0)
42#define flush_cache_mm(mm) do { } while (0)
43#define flush_cache_dup_mm(mm) do { } while (0)
44#define flush_cache_range(vma, start, end) do { } while (0)
45#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
46#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
47#define flush_dcache_page(page) do { } while (0)
48#define flush_dcache_mmap_lock(mapping) do { } while (0)
49#define flush_dcache_mmap_unlock(mapping) do { } while (0)
50#define flush_icache_page(vma, pg) do { } while (0)
51#define flush_icache_user_range(vma, pg, adr, len) do { } while (0)
52#define flush_cache_vmap(start, end) do { } while (0)
53#define flush_cache_vunmap(start, end) do { } while (0)
54
44/* 55/*
45 * Flush Dcache range through current map. 56 * Flush Dcache range through current map.
46 */ 57 */
@@ -49,7 +60,6 @@ extern void flush_dcache_range(unsigned long start, unsigned long end);
49/* 60/*
50 * Flush Icache range through current map. 61 * Flush Icache range through current map.
51 */ 62 */
52#undef flush_icache_range
53extern void flush_icache_range(unsigned long start, unsigned long end); 63extern void flush_icache_range(unsigned long start, unsigned long end);
54 64
55/* 65/*
@@ -79,19 +89,11 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
79 /* generic_ptrace_pokedata doesn't wind up here, does it? */ 89 /* generic_ptrace_pokedata doesn't wind up here, does it? */
80} 90}
81 91
82#undef copy_to_user_page 92void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
83static inline void copy_to_user_page(struct vm_area_struct *vma, 93 unsigned long vaddr, void *dst, void *src, int len);
84 struct page *page,
85 unsigned long vaddr,
86 void *dst, void *src, int len)
87{
88 memcpy(dst, src, len);
89 if (vma->vm_flags & VM_EXEC) {
90 flush_icache_range((unsigned long) dst,
91 (unsigned long) dst + len);
92 }
93}
94 94
95#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
96 memcpy(dst, src, len)
95 97
96extern void hexagon_inv_dcache_range(unsigned long start, unsigned long end); 98extern void hexagon_inv_dcache_range(unsigned long start, unsigned long end);
97extern void hexagon_clean_dcache_range(unsigned long start, unsigned long end); 99extern void hexagon_clean_dcache_range(unsigned long start, unsigned long end);
diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h
index 70298996e9b2..66f5e9a61efc 100644
--- a/arch/hexagon/include/asm/io.h
+++ b/arch/hexagon/include/asm/io.h
@@ -24,14 +24,9 @@
24#ifdef __KERNEL__ 24#ifdef __KERNEL__
25 25
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/delay.h>
28#include <linux/vmalloc.h>
29#include <asm/string.h>
30#include <asm/mem-layout.h>
31#include <asm/iomap.h> 27#include <asm/iomap.h>
32#include <asm/page.h> 28#include <asm/page.h>
33#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
34#include <asm/tlbflush.h>
35 30
36/* 31/*
37 * We don't have PCI yet. 32 * We don't have PCI yet.
diff --git a/arch/hexagon/kernel/setup.c b/arch/hexagon/kernel/setup.c
index 0e7c1dbb37b2..6981949f5df3 100644
--- a/arch/hexagon/kernel/setup.c
+++ b/arch/hexagon/kernel/setup.c
@@ -19,6 +19,7 @@
19 */ 19 */
20 20
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/delay.h>
22#include <linux/bootmem.h> 23#include <linux/bootmem.h>
23#include <linux/mmzone.h> 24#include <linux/mmzone.h>
24#include <linux/mm.h> 25#include <linux/mm.h>
diff --git a/arch/hexagon/mm/cache.c b/arch/hexagon/mm/cache.c
index 0c76c802e31c..a7c6d827d8b6 100644
--- a/arch/hexagon/mm/cache.c
+++ b/arch/hexagon/mm/cache.c
@@ -127,3 +127,13 @@ void flush_cache_all_hexagon(void)
127 local_irq_restore(flags); 127 local_irq_restore(flags);
128 mb(); 128 mb();
129} 129}
130
131void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
132 unsigned long vaddr, void *dst, void *src, int len)
133{
134 memcpy(dst, src, len);
135 if (vma->vm_flags & VM_EXEC) {
136 flush_icache_range((unsigned long) dst,
137 (unsigned long) dst + len);
138 }
139}
diff --git a/arch/hexagon/mm/ioremap.c b/arch/hexagon/mm/ioremap.c
index 5905fd5f97f6..d27d67224046 100644
--- a/arch/hexagon/mm/ioremap.c
+++ b/arch/hexagon/mm/ioremap.c
@@ -20,6 +20,7 @@
20 20
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/vmalloc.h> 22#include <linux/vmalloc.h>
23#include <linux/mm.h>
23 24
24void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size) 25void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size)
25{ 26{