diff options
Diffstat (limited to 'include/asm-sh64')
-rw-r--r-- | include/asm-sh64/bitops.h | 6 | ||||
-rw-r--r-- | include/asm-sh64/dma-mapping.h | 18 | ||||
-rw-r--r-- | include/asm-sh64/ide.h | 1 | ||||
-rw-r--r-- | include/asm-sh64/io.h | 48 | ||||
-rw-r--r-- | include/asm-sh64/ipc.h | 1 | ||||
-rw-r--r-- | include/asm-sh64/scatterlist.h | 5 | ||||
-rw-r--r-- | include/asm-sh64/semaphore.h | 1 | ||||
-rw-r--r-- | include/asm-sh64/system.h | 3 | ||||
-rw-r--r-- | include/asm-sh64/tlbflush.h | 4 | ||||
-rw-r--r-- | include/asm-sh64/types.h | 6 |
10 files changed, 24 insertions, 69 deletions
diff --git a/include/asm-sh64/bitops.h b/include/asm-sh64/bitops.h index f3bdcdb5d046..600c59efb4c2 100644 --- a/include/asm-sh64/bitops.h +++ b/include/asm-sh64/bitops.h | |||
@@ -13,6 +13,11 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
16 | |||
17 | #ifndef _LINUX_BITOPS_H | ||
18 | #error only <linux/bitops.h> can be included directly | ||
19 | #endif | ||
20 | |||
16 | #include <linux/compiler.h> | 21 | #include <linux/compiler.h> |
17 | #include <asm/system.h> | 22 | #include <asm/system.h> |
18 | /* For __swab32 */ | 23 | /* For __swab32 */ |
@@ -136,6 +141,7 @@ static __inline__ unsigned long ffz(unsigned long word) | |||
136 | #include <asm-generic/bitops/__ffs.h> | 141 | #include <asm-generic/bitops/__ffs.h> |
137 | #include <asm-generic/bitops/find.h> | 142 | #include <asm-generic/bitops/find.h> |
138 | #include <asm-generic/bitops/hweight.h> | 143 | #include <asm-generic/bitops/hweight.h> |
144 | #include <asm-generic/bitops/lock.h> | ||
139 | #include <asm-generic/bitops/sched.h> | 145 | #include <asm-generic/bitops/sched.h> |
140 | #include <asm-generic/bitops/ffs.h> | 146 | #include <asm-generic/bitops/ffs.h> |
141 | #include <asm-generic/bitops/ext2-non-atomic.h> | 147 | #include <asm-generic/bitops/ext2-non-atomic.h> |
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h index de4309960207..1438b763a5ea 100644 --- a/include/asm-sh64/dma-mapping.h +++ b/include/asm-sh64/dma-mapping.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __ASM_SH_DMA_MAPPING_H | 2 | #define __ASM_SH_DMA_MAPPING_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <asm/scatterlist.h> | 5 | #include <linux/scatterlist.h> |
6 | #include <asm/io.h> | 6 | #include <asm/io.h> |
7 | 7 | ||
8 | struct pci_dev; | 8 | struct pci_dev; |
@@ -42,7 +42,11 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
42 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 42 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
43 | enum dma_data_direction dir) | 43 | enum dma_data_direction dir) |
44 | { | 44 | { |
45 | dma_cache_wback_inv((unsigned long)vaddr, size); | 45 | unsigned long s = (unsigned long) vaddr & L1_CACHE_ALIGN_MASK; |
46 | unsigned long e = (vaddr + size) & L1_CACHE_ALIGN_MASK; | ||
47 | |||
48 | for (; s <= e; s += L1_CACHE_BYTES) | ||
49 | asm volatile ("ocbp %0, 0" : : "r" (s)); | ||
46 | } | 50 | } |
47 | 51 | ||
48 | static inline dma_addr_t dma_map_single(struct device *dev, | 52 | static inline dma_addr_t dma_map_single(struct device *dev, |
@@ -67,10 +71,9 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, | |||
67 | 71 | ||
68 | for (i = 0; i < nents; i++) { | 72 | for (i = 0; i < nents; i++) { |
69 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 73 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
70 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, | 74 | dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); |
71 | sg[i].length, dir); | ||
72 | #endif | 75 | #endif |
73 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 76 | sg[i].dma_address = sg_phys(&sg[i]); |
74 | } | 77 | } |
75 | 78 | ||
76 | return nents; | 79 | return nents; |
@@ -120,10 +123,9 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, | |||
120 | 123 | ||
121 | for (i = 0; i < nelems; i++) { | 124 | for (i = 0; i < nelems; i++) { |
122 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 125 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
123 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, | 126 | dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); |
124 | sg[i].length, dir); | ||
125 | #endif | 127 | #endif |
126 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 128 | sg[i].dma_address = sg_phys(&sg[i]); |
127 | } | 129 | } |
128 | } | 130 | } |
129 | 131 | ||
diff --git a/include/asm-sh64/ide.h b/include/asm-sh64/ide.h index c9d84d5f772e..b6e31e8b9410 100644 --- a/include/asm-sh64/ide.h +++ b/include/asm-sh64/ide.h | |||
@@ -19,7 +19,6 @@ | |||
19 | /* Without this, the initialisation of PCI IDE cards end up calling | 19 | /* Without this, the initialisation of PCI IDE cards end up calling |
20 | * ide_init_hwif_ports, which won't work. */ | 20 | * ide_init_hwif_ports, which won't work. */ |
21 | #ifdef CONFIG_BLK_DEV_IDEPCI | 21 | #ifdef CONFIG_BLK_DEV_IDEPCI |
22 | #define IDE_ARCH_OBSOLETE_INIT 1 | ||
23 | #define ide_default_io_ctl(base) (0) | 22 | #define ide_default_io_ctl(base) (0) |
24 | #endif | 23 | #endif |
25 | 24 | ||
diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h index 3de3ad99f457..7bd7314d38c2 100644 --- a/include/asm-sh64/io.h +++ b/include/asm-sh64/io.h | |||
@@ -182,54 +182,6 @@ unsigned long onchip_remap(unsigned long addr, unsigned long size, const char* n | |||
182 | extern void onchip_unmap(unsigned long vaddr); | 182 | extern void onchip_unmap(unsigned long vaddr); |
183 | 183 | ||
184 | /* | 184 | /* |
185 | * The caches on some architectures aren't dma-coherent and have need to | ||
186 | * handle this in software. There are three types of operations that | ||
187 | * can be applied to dma buffers. | ||
188 | * | ||
189 | * - dma_cache_wback_inv(start, size) makes caches and RAM coherent by | ||
190 | * writing the content of the caches back to memory, if necessary. | ||
191 | * The function also invalidates the affected part of the caches as | ||
192 | * necessary before DMA transfers from outside to memory. | ||
193 | * - dma_cache_inv(start, size) invalidates the affected parts of the | ||
194 | * caches. Dirty lines of the caches may be written back or simply | ||
195 | * be discarded. This operation is necessary before dma operations | ||
196 | * to the memory. | ||
197 | * - dma_cache_wback(start, size) writes back any dirty lines but does | ||
198 | * not invalidate the cache. This can be used before DMA reads from | ||
199 | * memory, | ||
200 | */ | ||
201 | |||
202 | static __inline__ void dma_cache_wback_inv (unsigned long start, unsigned long size) | ||
203 | { | ||
204 | unsigned long s = start & L1_CACHE_ALIGN_MASK; | ||
205 | unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK; | ||
206 | |||
207 | for (; s <= e; s += L1_CACHE_BYTES) | ||
208 | asm volatile ("ocbp %0, 0" : : "r" (s)); | ||
209 | } | ||
210 | |||
211 | static __inline__ void dma_cache_inv (unsigned long start, unsigned long size) | ||
212 | { | ||
213 | // Note that caller has to be careful with overzealous | ||
214 | // invalidation should there be partial cache lines at the extremities | ||
215 | // of the specified range | ||
216 | unsigned long s = start & L1_CACHE_ALIGN_MASK; | ||
217 | unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK; | ||
218 | |||
219 | for (; s <= e; s += L1_CACHE_BYTES) | ||
220 | asm volatile ("ocbi %0, 0" : : "r" (s)); | ||
221 | } | ||
222 | |||
223 | static __inline__ void dma_cache_wback (unsigned long start, unsigned long size) | ||
224 | { | ||
225 | unsigned long s = start & L1_CACHE_ALIGN_MASK; | ||
226 | unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK; | ||
227 | |||
228 | for (; s <= e; s += L1_CACHE_BYTES) | ||
229 | asm volatile ("ocbwb %0, 0" : : "r" (s)); | ||
230 | } | ||
231 | |||
232 | /* | ||
233 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 185 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |
234 | * access | 186 | * access |
235 | */ | 187 | */ |
diff --git a/include/asm-sh64/ipc.h b/include/asm-sh64/ipc.h deleted file mode 100644 index a46e3d9c2a3f..000000000000 --- a/include/asm-sh64/ipc.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/ipc.h> | ||
diff --git a/include/asm-sh64/scatterlist.h b/include/asm-sh64/scatterlist.h index 1c723f2d7a95..5109251970e7 100644 --- a/include/asm-sh64/scatterlist.h +++ b/include/asm-sh64/scatterlist.h | |||
@@ -14,7 +14,10 @@ | |||
14 | #include <asm/types.h> | 14 | #include <asm/types.h> |
15 | 15 | ||
16 | struct scatterlist { | 16 | struct scatterlist { |
17 | struct page * page; /* Location for highmem page, if any */ | 17 | #ifdef CONFIG_DEBUG_SG |
18 | unsigned long sg_magic; | ||
19 | #endif | ||
20 | unsigned long page_link; | ||
18 | unsigned int offset;/* for highmem, page offset */ | 21 | unsigned int offset;/* for highmem, page offset */ |
19 | dma_addr_t dma_address; | 22 | dma_addr_t dma_address; |
20 | unsigned int length; | 23 | unsigned int length; |
diff --git a/include/asm-sh64/semaphore.h b/include/asm-sh64/semaphore.h index 469526459149..f027cc14b55b 100644 --- a/include/asm-sh64/semaphore.h +++ b/include/asm-sh64/semaphore.h | |||
@@ -44,7 +44,6 @@ struct semaphore { | |||
44 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 44 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
45 | 45 | ||
46 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) | 46 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) |
47 | #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) | ||
48 | 47 | ||
49 | static inline void sema_init (struct semaphore *sem, int val) | 48 | static inline void sema_init (struct semaphore *sem, int val) |
50 | { | 49 | { |
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h index 5ff94644e8c8..be2a15ffcc55 100644 --- a/include/asm-sh64/system.h +++ b/include/asm-sh64/system.h | |||
@@ -62,8 +62,7 @@ extern void __xchg_called_with_bad_pointer(void); | |||
62 | #define smp_read_barrier_depends() do { } while (0) | 62 | #define smp_read_barrier_depends() do { } while (0) |
63 | #endif /* CONFIG_SMP */ | 63 | #endif /* CONFIG_SMP */ |
64 | 64 | ||
65 | #define set_rmb(var, value) do { (void)xchg(&var, value); } while (0) | 65 | #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) |
66 | #define set_mb(var, value) set_rmb(var, value) | ||
67 | 66 | ||
68 | /* Interrupt Control */ | 67 | /* Interrupt Control */ |
69 | #ifndef HARD_CLI | 68 | #ifndef HARD_CLI |
diff --git a/include/asm-sh64/tlbflush.h b/include/asm-sh64/tlbflush.h index e45beadc29ee..16a164a23754 100644 --- a/include/asm-sh64/tlbflush.h +++ b/include/asm-sh64/tlbflush.h | |||
@@ -20,10 +20,6 @@ extern void flush_tlb_mm(struct mm_struct *mm); | |||
20 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | 20 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, |
21 | unsigned long end); | 21 | unsigned long end); |
22 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); | 22 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); |
23 | static inline void flush_tlb_pgtables(struct mm_struct *mm, | ||
24 | unsigned long start, unsigned long end) | ||
25 | { | ||
26 | } | ||
27 | 23 | ||
28 | extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); | 24 | extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); |
29 | 25 | ||
diff --git a/include/asm-sh64/types.h b/include/asm-sh64/types.h index 8d41db2153b5..2c7ad73b3883 100644 --- a/include/asm-sh64/types.h +++ b/include/asm-sh64/types.h | |||
@@ -30,9 +30,9 @@ typedef unsigned short __u16; | |||
30 | typedef __signed__ int __s32; | 30 | typedef __signed__ int __s32; |
31 | typedef unsigned int __u32; | 31 | typedef unsigned int __u32; |
32 | 32 | ||
33 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) | 33 | #if defined(__GNUC__) |
34 | typedef __signed__ long long __s64; | 34 | __extension__ typedef __signed__ long long __s64; |
35 | typedef unsigned long long __u64; | 35 | __extension__ typedef unsigned long long __u64; |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #endif /* __ASSEMBLY__ */ | 38 | #endif /* __ASSEMBLY__ */ |