diff options
Diffstat (limited to 'arch/blackfin/lib')
-rw-r--r-- | arch/blackfin/lib/checksum.c | 21 | ||||
-rw-r--r-- | arch/blackfin/lib/ins.S | 21 | ||||
-rw-r--r-- | arch/blackfin/lib/outs.S | 16 |
3 files changed, 43 insertions, 15 deletions
diff --git a/arch/blackfin/lib/checksum.c b/arch/blackfin/lib/checksum.c index 42768e0c80ca..5c87505165d3 100644 --- a/arch/blackfin/lib/checksum.c +++ b/arch/blackfin/lib/checksum.c | |||
@@ -72,9 +72,9 @@ static unsigned short do_csum(const unsigned char *buff, int len) | |||
72 | * This is a version of ip_compute_csum() optimized for IP headers, | 72 | * This is a version of ip_compute_csum() optimized for IP headers, |
73 | * which always checksum on 4 octet boundaries. | 73 | * which always checksum on 4 octet boundaries. |
74 | */ | 74 | */ |
75 | unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | 75 | __sum16 ip_fast_csum(unsigned char *iph, unsigned int ihl) |
76 | { | 76 | { |
77 | return ~do_csum(iph, ihl * 4); | 77 | return (__force __sum16)~do_csum(iph, ihl * 4); |
78 | } | 78 | } |
79 | 79 | ||
80 | /* | 80 | /* |
@@ -89,7 +89,7 @@ unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | |||
89 | * | 89 | * |
90 | * it's best to have buff aligned on a 32-bit boundary | 90 | * it's best to have buff aligned on a 32-bit boundary |
91 | */ | 91 | */ |
92 | unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) | 92 | __wsum csum_partial(const void *buff, int len, __wsum sum) |
93 | { | 93 | { |
94 | /* | 94 | /* |
95 | * Just in case we get nasty checksum data... | 95 | * Just in case we get nasty checksum data... |
@@ -109,22 +109,22 @@ unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) | |||
109 | * this routine is used for miscellaneous IP-like checksums, mainly | 109 | * this routine is used for miscellaneous IP-like checksums, mainly |
110 | * in icmp.c | 110 | * in icmp.c |
111 | */ | 111 | */ |
112 | unsigned short ip_compute_csum(const unsigned char *buff, int len) | 112 | __sum16 ip_compute_csum(const void *buff, int len) |
113 | { | 113 | { |
114 | return ~do_csum(buff, len); | 114 | return (__force __sum16)~do_csum(buff, len); |
115 | } | 115 | } |
116 | 116 | ||
117 | /* | 117 | /* |
118 | * copy from fs while checksumming, otherwise like csum_partial | 118 | * copy from fs while checksumming, otherwise like csum_partial |
119 | */ | 119 | */ |
120 | 120 | ||
121 | unsigned int | 121 | __wsum |
122 | csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, | 122 | csum_partial_copy_from_user(const void __user *src, void *dst, |
123 | int len, int sum, int *csum_err) | 123 | int len, __wsum sum, int *csum_err) |
124 | { | 124 | { |
125 | if (csum_err) | 125 | if (csum_err) |
126 | *csum_err = 0; | 126 | *csum_err = 0; |
127 | memcpy(dst, src, len); | 127 | memcpy(dst, (__force void *)src, len); |
128 | return csum_partial(dst, len, sum); | 128 | return csum_partial(dst, len, sum); |
129 | } | 129 | } |
130 | 130 | ||
@@ -132,8 +132,7 @@ csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, | |||
132 | * copy from ds while checksumming, otherwise like csum_partial | 132 | * copy from ds while checksumming, otherwise like csum_partial |
133 | */ | 133 | */ |
134 | 134 | ||
135 | unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, | 135 | __wsum csum_partial_copy(const void *src, void *dst, int len, __wsum sum) |
136 | int len, int sum) | ||
137 | { | 136 | { |
138 | memcpy(dst, src, len); | 137 | memcpy(dst, src, len); |
139 | return csum_partial(dst, len, sum); | 138 | return csum_partial(dst, len, sum); |
diff --git a/arch/blackfin/lib/ins.S b/arch/blackfin/lib/ins.S index df7b8833a0c5..eba2343b1b59 100644 --- a/arch/blackfin/lib/ins.S +++ b/arch/blackfin/lib/ins.S | |||
@@ -7,7 +7,7 @@ | |||
7 | * Description: Implementation of ins{bwl} for BlackFin processors using zero overhead loops. | 7 | * Description: Implementation of ins{bwl} for BlackFin processors using zero overhead loops. |
8 | * | 8 | * |
9 | * Modified: | 9 | * Modified: |
10 | * Copyright 2004-2006 Analog Devices Inc. | 10 | * Copyright 2004-2008 Analog Devices Inc. |
11 | * Copyright (C) 2005 Bas Vermeulen, BuyWays BV <bas@buyways.nl> | 11 | * Copyright (C) 2005 Bas Vermeulen, BuyWays BV <bas@buyways.nl> |
12 | * | 12 | * |
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
@@ -63,6 +63,23 @@ ENTRY(_insw) | |||
63 | RTS; | 63 | RTS; |
64 | ENDPROC(_insw) | 64 | ENDPROC(_insw) |
65 | 65 | ||
66 | ENTRY(_insw_8) | ||
67 | P0 = R0; /* P0 = port */ | ||
68 | cli R3; | ||
69 | P1 = R1; /* P1 = address */ | ||
70 | P2 = R2; /* P2 = count */ | ||
71 | SSYNC; | ||
72 | LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2; | ||
73 | .Lword8_loop_s: R0 = W[P0]; | ||
74 | B[P1++] = R0; | ||
75 | R0 = R0 >> 8; | ||
76 | B[P1++] = R0; | ||
77 | NOP; | ||
78 | .Lword8_loop_e: NOP; | ||
79 | sti R3; | ||
80 | RTS; | ||
81 | ENDPROC(_insw_8) | ||
82 | |||
66 | ENTRY(_insb) | 83 | ENTRY(_insb) |
67 | P0 = R0; /* P0 = port */ | 84 | P0 = R0; /* P0 = port */ |
68 | cli R3; | 85 | cli R3; |
@@ -78,8 +95,6 @@ ENTRY(_insb) | |||
78 | RTS; | 95 | RTS; |
79 | ENDPROC(_insb) | 96 | ENDPROC(_insb) |
80 | 97 | ||
81 | |||
82 | |||
83 | ENTRY(_insl_16) | 98 | ENTRY(_insl_16) |
84 | P0 = R0; /* P0 = port */ | 99 | P0 = R0; /* P0 = port */ |
85 | cli R3; | 100 | cli R3; |
diff --git a/arch/blackfin/lib/outs.S b/arch/blackfin/lib/outs.S index 4c3da8ae094e..4685b7aa0080 100644 --- a/arch/blackfin/lib/outs.S +++ b/arch/blackfin/lib/outs.S | |||
@@ -7,7 +7,7 @@ | |||
7 | * Description: Implementation of outs{bwl} for BlackFin processors using zero overhead loops. | 7 | * Description: Implementation of outs{bwl} for BlackFin processors using zero overhead loops. |
8 | * | 8 | * |
9 | * Modified: Copyright (C) 2005 Bas Vermeulen, BuyWays BV <bas@buyways.nl> | 9 | * Modified: Copyright (C) 2005 Bas Vermeulen, BuyWays BV <bas@buyways.nl> |
10 | * Copyright 2004-2006 Analog Devices Inc. | 10 | * Copyright 2004-2008 Analog Devices Inc. |
11 | * | 11 | * |
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
13 | * | 13 | * |
@@ -63,3 +63,17 @@ ENTRY(_outsb) | |||
63 | .Lbyte_loop_e: B[P0] = R0; | 63 | .Lbyte_loop_e: B[P0] = R0; |
64 | RTS; | 64 | RTS; |
65 | ENDPROC(_outsb) | 65 | ENDPROC(_outsb) |
66 | |||
67 | ENTRY(_outsw_8) | ||
68 | P0 = R0; /* P0 = port */ | ||
69 | P1 = R1; /* P1 = address */ | ||
70 | P2 = R2; /* P2 = count */ | ||
71 | |||
72 | LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2; | ||
73 | .Lword8_loop_s: R1 = B[P1++]; | ||
74 | R0 = B[P1++]; | ||
75 | R0 = R0 << 8; | ||
76 | R0 = R0 + R1; | ||
77 | .Lword8_loop_e: W[P0] = R0; | ||
78 | RTS; | ||
79 | ENDPROC(_outsw_8) | ||