summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-05-24 20:35:30 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-05-24 20:35:30 +0000
commitbd2161646964d463fefae274079205f808e7fffd (patch)
tree67e7e54b1d1e4dff6f291e8c6a570d1bf9636a3b
parente10a8c153b153b44ffac22ddbea1607bddfb2bbf (diff)
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 */