summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2005-05-24 20:35:29 +0000
committermiod <miod@openbsd.org>2005-05-24 20:35:29 +0000
commit7d6c03a41d635de983a3fbae471c72d8a59dde80 (patch)
treee72b69244cee78783811bfd483b05ddfdf10dc47
parentserial console support (diff)
downloadwireguard-openbsd-7d6c03a41d635de983a3fbae471c72d8a59dde80.tar.xz
wireguard-openbsd-7d6c03a41d635de983a3fbae471c72d8a59dde80.zip
Do not assume anything about the calling frame in the inline assembly
statements, ends up in slightly better code and fewer memory access.
-rw-r--r--sys/arch/vax/vax/in4_cksum.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/vax/vax/in4_cksum.c b/sys/arch/vax/vax/in4_cksum.c
index 95c884f0322..f878572ba62 100644
--- a/sys/arch/vax/vax/in4_cksum.c
+++ b/sys/arch/vax/vax/in4_cksum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in4_cksum.c,v 1.1 2005/05/10 04:04:39 brad Exp $ */
+/* $OpenBSD: in4_cksum.c,v 1.2 2005/05/24 20:35:29 miod Exp $ */
/* $NetBSD: in4_cksum.c,v 1.8 2003/09/29 22:54:28 matt Exp $ */
/*
@@ -128,14 +128,14 @@ in4_cksum(struct mbuf *m, u_int8_t nxt, int off, int len)
#endif
__asm __volatile(
- "movzwl 16(ap),%0;" /* mov len to sum */
- "addb2 8(ap),%0;" /* add proto to sum */
+ "movzwl %3,%0;" /* mov len to sum */
+ "addb2 %4,%0;" /* add proto to sum */
"rotl $8,%0,%0;" /* htons, carry is preserved */
"adwc 12(%2),%0;" /* add src ip */
"adwc 16(%2),%0;" /* add dst ip */
"adwc $0,%0;" /* clean up carry */
: "=r" (sum)
- : "0" (sum), "r" (mtod(m, void *)));
+ : "0" (sum), "r" (mtod(m, void *)), "r" (len), "r"(nxt));
}
/* skip unnecessary part */