summaryrefslogtreecommitdiffstats
path: root/c/src/exec
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-02-04 14:56:09 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-02-04 14:56:09 +0000
commit1564ca8e5ec57255a19ddee42882fa8782394110 (patch)
tree14007c4835c85b4382d35b09069c9eaf74c557d3 /c/src/exec
parentAdded PowerPC specific header checksum code. (diff)
downloadrtems-1564ca8e5ec57255a19ddee42882fa8782394110.tar.bz2
Added PowerPC specific header checksum code.
Diffstat (limited to 'c/src/exec')
-rw-r--r--c/src/exec/libnetworking/netinet/in_cksum_powerpc.c39
1 files changed, 5 insertions, 34 deletions
diff --git a/c/src/exec/libnetworking/netinet/in_cksum_powerpc.c b/c/src/exec/libnetworking/netinet/in_cksum_powerpc.c
index 8e0a417163..fe2f04e246 100644
--- a/c/src/exec/libnetworking/netinet/in_cksum_powerpc.c
+++ b/c/src/exec/libnetworking/netinet/in_cksum_powerpc.c
@@ -42,6 +42,7 @@ in_cksum(m, len)
register struct mbuf *m;
register int len;
{
+ u_char junk;
register u_short *w;
register unsigned sum = 0;
register unsigned tmp;
@@ -91,30 +92,13 @@ in_cksum(m, len)
mlen -= 2;
}
}
- /*
- * Advance to a cache line boundary.
- */
- if (4 & (int) w && mlen >= 4) {
- ADD(0);
- MOP;
- w += 2;
- mlen -= 4;
- }
- if (8 & (int) w && mlen >= 8) {
- ADD(0);
- ADDC(4);
- MOP;
- w += 4;
- mlen -= 8;
- }
+
/*
* Do as much of the checksum as possible 32 bits at at time.
- * In fact, this loop is unrolled to make overhead from
- * branches &c small.
+ * In fact, this loop is unrolled to keep overhead from
+ * branches small.
*/
- mlen -= 1;
- while ((mlen -= 32) >= 0) {
- u_char junk;
+ while (mlen >= 32) {
/*
* Add with carry 16 words and fold in the last
* carry by adding a 0 with carry.
@@ -133,19 +117,6 @@ in_cksum(m, len)
ADDC(28);
MOP;
w += 16;
- }
- mlen += 32 + 1;
- if (mlen >= 32) {
- ADD(16);
- ADDC(0);
- ADDC(4);
- ADDC(8);
- ADDC(12);
- ADDC(20);
- ADDC(24);
- ADDC(28);
- MOP;
- w += 16;
mlen -= 32;
}
if (mlen >= 16) {