aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-avr32
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-avr32')
-rw-r--r--include/asm-avr32/checksum.h40
-rw-r--r--include/asm-avr32/device.h7
-rw-r--r--include/asm-avr32/dma-mapping.h5
-rw-r--r--include/asm-avr32/setup.h4
-rw-r--r--include/asm-avr32/types.h5
5 files changed, 32 insertions, 29 deletions
diff --git a/include/asm-avr32/checksum.h b/include/asm-avr32/checksum.h
index 41b7af09edc4..af9d53f0f5d2 100644
--- a/include/asm-avr32/checksum.h
+++ b/include/asm-avr32/checksum.h
@@ -20,8 +20,7 @@
20 * 20 *
21 * it's best to have buff aligned on a 32-bit boundary 21 * it's best to have buff aligned on a 32-bit boundary
22 */ 22 */
23unsigned int csum_partial(const unsigned char * buff, int len, 23__wsum csum_partial(const void *buff, int len, __wsum sum);
24 unsigned int sum);
25 24
26/* 25/*
27 * the same as csum_partial, but copies from src while it 26 * the same as csum_partial, but copies from src while it
@@ -30,8 +29,8 @@ unsigned int csum_partial(const unsigned char * buff, int len,
30 * here even more important to align src and dst on a 32-bit (or even 29 * here even more important to align src and dst on a 32-bit (or even
31 * better 64-bit) boundary 30 * better 64-bit) boundary
32 */ 31 */
33unsigned int csum_partial_copy_generic(const char *src, char *dst, int len, 32__wsum csum_partial_copy_generic(const void *src, void *dst, int len,
34 int sum, int *src_err_ptr, 33 __wsum sum, int *src_err_ptr,
35 int *dst_err_ptr); 34 int *dst_err_ptr);
36 35
37/* 36/*
@@ -42,17 +41,17 @@ unsigned int csum_partial_copy_generic(const char *src, char *dst, int len,
42 * verify_area(). 41 * verify_area().
43 */ 42 */
44static inline 43static inline
45unsigned int csum_partial_copy_nocheck(const char *src, char *dst, 44__wsum csum_partial_copy_nocheck(const void *src, void *dst,
46 int len, int sum) 45 int len, __wsum sum)
47{ 46{
48 return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL); 47 return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL);
49} 48}
50 49
51static inline 50static inline
52unsigned int csum_partial_copy_from_user (const char __user *src, char *dst, 51__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
53 int len, int sum, int *err_ptr) 52 int len, __wsum sum, int *err_ptr)
54{ 53{
55 return csum_partial_copy_generic((const char __force *)src, dst, len, 54 return csum_partial_copy_generic((const void __force *)src, dst, len,
56 sum, err_ptr, NULL); 55 sum, err_ptr, NULL);
57} 56}
58 57
@@ -60,8 +59,7 @@ unsigned int csum_partial_copy_from_user (const char __user *src, char *dst,
60 * This is a version of ip_compute_csum() optimized for IP headers, 59 * This is a version of ip_compute_csum() optimized for IP headers,
61 * which always checksum on 4 octet boundaries. 60 * which always checksum on 4 octet boundaries.
62 */ 61 */
63static inline unsigned short ip_fast_csum(unsigned char *iph, 62static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
64 unsigned int ihl)
65{ 63{
66 unsigned int sum, tmp; 64 unsigned int sum, tmp;
67 65
@@ -90,14 +88,14 @@ static inline unsigned short ip_fast_csum(unsigned char *iph,
90 : "=r"(sum), "=r"(iph), "=r"(ihl), "=r"(tmp) 88 : "=r"(sum), "=r"(iph), "=r"(ihl), "=r"(tmp)
91 : "1"(iph), "2"(ihl) 89 : "1"(iph), "2"(ihl)
92 : "memory", "cc"); 90 : "memory", "cc");
93 return sum; 91 return (__force __sum16)sum;
94} 92}
95 93
96/* 94/*
97 * Fold a partial checksum 95 * Fold a partial checksum
98 */ 96 */
99 97
100static inline unsigned int csum_fold(unsigned int sum) 98static inline __sum16 csum_fold(__wsum sum)
101{ 99{
102 unsigned int tmp; 100 unsigned int tmp;
103 101
@@ -109,21 +107,20 @@ static inline unsigned int csum_fold(unsigned int sum)
109 : "=&r"(sum), "=&r"(tmp) 107 : "=&r"(sum), "=&r"(tmp)
110 : "0"(sum)); 108 : "0"(sum));
111 109
112 return ~sum; 110 return (__force __sum16)~sum;
113} 111}
114 112
115static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, 113static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
116 unsigned long daddr,
117 unsigned short len, 114 unsigned short len,
118 unsigned short proto, 115 unsigned short proto,
119 unsigned int sum) 116 __wsum sum)
120{ 117{
121 asm(" add %0, %1\n" 118 asm(" add %0, %1\n"
122 " adc %0, %0, %2\n" 119 " adc %0, %0, %2\n"
123 " adc %0, %0, %3\n" 120 " adc %0, %0, %3\n"
124 " acr %0" 121 " acr %0"
125 : "=r"(sum) 122 : "=r"(sum)
126 : "r"(daddr), "r"(saddr), "r"(ntohs(len) | (proto << 16)), 123 : "r"(daddr), "r"(saddr), "r"(len + proto),
127 "0"(sum) 124 "0"(sum)
128 : "cc"); 125 : "cc");
129 126
@@ -134,11 +131,10 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
134 * computes the checksum of the TCP/UDP pseudo-header 131 * computes the checksum of the TCP/UDP pseudo-header
135 * returns a 16-bit checksum, already complemented 132 * returns a 16-bit checksum, already complemented
136 */ 133 */
137static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, 134static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
138 unsigned long daddr,
139 unsigned short len, 135 unsigned short len,
140 unsigned short proto, 136 unsigned short proto,
141 unsigned int sum) 137 __wsum sum)
142{ 138{
143 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); 139 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
144} 140}
@@ -148,7 +144,7 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
148 * in icmp.c 144 * in icmp.c
149 */ 145 */
150 146
151static inline unsigned short ip_compute_csum(unsigned char * buff, int len) 147static inline __sum16 ip_compute_csum(const void *buff, int len)
152{ 148{
153 return csum_fold(csum_partial(buff, len, 0)); 149 return csum_fold(csum_partial(buff, len, 0));
154} 150}
diff --git a/include/asm-avr32/device.h b/include/asm-avr32/device.h
new file mode 100644
index 000000000000..d8f9872b0e2d
--- /dev/null
+++ b/include/asm-avr32/device.h
@@ -0,0 +1,7 @@
1/*
2 * Arch specific extensions to struct device
3 *
4 * This file is released under the GPLv2
5 */
6#include <asm-generic/device.h>
7
diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h
index 4c40cb41cdf8..0580b5d62bba 100644
--- a/include/asm-avr32/dma-mapping.h
+++ b/include/asm-avr32/dma-mapping.h
@@ -8,7 +8,8 @@
8#include <asm/cacheflush.h> 8#include <asm/cacheflush.h>
9#include <asm/io.h> 9#include <asm/io.h>
10 10
11extern void dma_cache_sync(void *vaddr, size_t size, int direction); 11extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
12 int direction);
12 13
13/* 14/*
14 * Return whether the given device DMA address mask can be supported 15 * Return whether the given device DMA address mask can be supported
@@ -307,7 +308,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
307#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 308#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
308#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 309#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
309 310
310static inline int dma_is_consistent(dma_addr_t dma_addr) 311static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
311{ 312{
312 return 1; 313 return 1;
313} 314}
diff --git a/include/asm-avr32/setup.h b/include/asm-avr32/setup.h
index 10193da4113b..0a5224245e44 100644
--- a/include/asm-avr32/setup.h
+++ b/include/asm-avr32/setup.h
@@ -13,6 +13,8 @@
13 13
14#define COMMAND_LINE_SIZE 256 14#define COMMAND_LINE_SIZE 256
15 15
16#ifdef __KERNEL__
17
16/* Magic number indicating that a tag table is present */ 18/* Magic number indicating that a tag table is present */
17#define ATAG_MAGIC 0xa2a25441 19#define ATAG_MAGIC 0xa2a25441
18 20
@@ -138,4 +140,6 @@ void chip_enable_sdram(void);
138 140
139#endif /* !__ASSEMBLY__ */ 141#endif /* !__ASSEMBLY__ */
140 142
143#endif /* __KERNEL__ */
144
141#endif /* __ASM_AVR32_SETUP_H__ */ 145#endif /* __ASM_AVR32_SETUP_H__ */
diff --git a/include/asm-avr32/types.h b/include/asm-avr32/types.h
index 3f47db9675af..2bff153a32ed 100644
--- a/include/asm-avr32/types.h
+++ b/include/asm-avr32/types.h
@@ -57,11 +57,6 @@ typedef unsigned long long u64;
57 57
58typedef u32 dma_addr_t; 58typedef u32 dma_addr_t;
59 59
60#ifdef CONFIG_LBD
61typedef u64 sector_t;
62#define HAVE_SECTOR_T
63#endif
64
65#endif /* __ASSEMBLY__ */ 60#endif /* __ASSEMBLY__ */
66 61
67#endif /* __KERNEL__ */ 62#endif /* __KERNEL__ */