From: David Ford <david+cert@blue-labs.org>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] include/asm/checksum.h trigraph cleanups
Date: Thu, 14 Feb 2002 14:10:38 -0500 [thread overview]
Message-ID: <3C6C0BAE.7030701@blue-labs.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 4043 bytes --]
Subject says all, this is against 2.4.18-rc1. Assembler blocks aligned
with style used for first assembler block.
-d
--- include/asm/checksum.h.orig Thu Feb 14 14:06:31 2002
+++ include/asm/checksum.h Thu Feb 14 14:05:16 2002
@@ -69,30 +69,31 @@
unsigned int ihl) {
unsigned int sum;
- __asm__ __volatile__("
- movl (%1), %0
- subl $4, %2
- jbe 2f
- addl 4(%1), %0
- adcl 8(%1), %0
- adcl 12(%1), %0
-1: adcl 16(%1), %0
- lea 4(%1), %1
- decl %2
- jne 1b
- adcl $0, %0
- movl %0, %2
- shrl $16, %0
- addw %w2, %w0
- adcl $0, %0
- notl %0
-2:
- "
+ __asm__ __volatile__(
+" movl (%1), %0 \n"
+" subl $4, %2 \n"
+" jbe 2f \n"
+" addl 4(%1), %0 \n"
+" adcl 8(%1), %0 \n"
+" adcl 12(%1), %0 \n"
+"1: adcl 16(%1), %0 \n"
+" lea 4(%1), %1 \n"
+" decl %2 \n"
+" jne 1b \n"
+" adcl $0, %0 \n"
+" movl %0, %2 \n"
+" shrl $16, %0 \n"
+" addw %w2, %w0 \n"
+" adcl $0, %0 \n"
+" notl %0 \n"
+"2: \n"
+
/* Since the input registers which are loaded with iph and ipl
are modified, we must also specify them as outputs, or gcc
will assume they contain their original values. */
: "=r" (sum), "=r" (iph), "=r" (ihl)
: "1" (iph), "2" (ihl));
+
return(sum);
}
@@ -102,13 +103,13 @@
static inline unsigned int csum_fold(unsigned int sum)
{
- __asm__("
- addl %1, %0
- adcl $0xffff, %0
- "
- : "=r" (sum)
- : "r" (sum << 16), "0" (sum & 0xffff0000)
- );
+ __asm__(
+" addl %1, %0 \n"
+" adcl $0xffff, %0 \n"
+
+ : "=r" (sum)
+ : "r" (sum << 16), "0" (sum & 0xffff0000));
+
return (~sum) >> 16;
}
@@ -118,15 +119,16 @@
unsigned short proto,
unsigned int sum)
{
- __asm__("
- addl %1, %0
- adcl %2, %0
- adcl %3, %0
- adcl $0, %0
- "
+ __asm__(
+" addl %1, %0 \n"
+" adcl %2, %0 \n"
+" adcl %3, %0 \n"
+" adcl $0, %0 \n"
+
: "=r" (sum)
: "g" (daddr), "g"(saddr), "g"((ntohs(len)<<16)+proto*256),
"0"(sum));
- return sum;
+
+ return sum;
}
/*
@@ -158,22 +160,22 @@
unsigned short proto,
unsigned int sum)
{
- __asm__("
- addl 0(%1), %0
- adcl 4(%1), %0
- adcl 8(%1), %0
- adcl 12(%1), %0
- adcl 0(%2), %0
- adcl 4(%2), %0
- adcl 8(%2), %0
- adcl 12(%2), %0
- adcl %3, %0
- adcl %4, %0
- adcl $0, %0
- "
- : "=&r" (sum)
- : "r" (saddr), "r" (daddr),
- "r"(htonl(len)), "r"(htonl(proto)), "0"(sum));
+ __asm__(
+" addl 0(%1), %0 \n"
+" adcl 4(%1), %0 \n"
+" adcl 8(%1), %0 \n"
+" adcl 12(%1), %0 \n"
+" adcl 0(%2), %0 \n"
+" adcl 4(%2), %0 \n"
+" adcl 8(%2), %0 \n"
+" adcl 12(%2), %0 \n"
+" adcl %3, %0 \n"
+" adcl %4, %0 \n"
+" adcl $0, %0 \n"
+
+ : "=&r" (sum)
+ : "r" (saddr), "r" (daddr),
+ "r"(htonl(len)), "r"(htonl(proto)), "0"(sum));
return csum_fold(sum);
}
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3254 bytes --]
reply other threads:[~2002-02-14 19:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C6C0BAE.7030701@blue-labs.org \
--to=david+cert@blue-labs.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox