Use assembly version of in4_cksum (which is a piece of code that

does some of the extra work and then jumps into in_cksum).
This commit is contained in:
fvdl 2001-03-06 14:55:13 +00:00
parent a917eabaec
commit e55dd7530b
3 changed files with 57 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.i386,v 1.182 2001/02/24 01:39:11 lukem Exp $
# $NetBSD: files.i386,v 1.183 2001/03/06 14:55:13 fvdl Exp $
#
# new style config file for i386 architecture
#
@ -65,7 +65,6 @@ file arch/i386/i386/db_trace.c ddb
file arch/i386/i386/disksubr.c disk
file arch/i386/i386/gdt.c
file arch/i386/i386/in_cksum.s inet
file netinet/in4_cksum.c inet
file arch/i386/i386/ipkdb_glue.c ipkdb
file arch/i386/i386/kgdb_machdep.c kgdb
file arch/i386/i386/machdep.c

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.24 2000/12/11 05:28:59 mycroft Exp $
# $NetBSD: genassym.cf,v 1.25 2001/03/06 14:55:14 fvdl Exp $
#
# Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -86,6 +86,10 @@ include <sys/resourcevar.h>
include <sys/device.h>
include <sys/user.h>
include <sys/mbuf.h>
include <netinet/in.h>
include <netinet/in_systm.h>
include <netinet/ip.h>
include <netinet/ip_var.h>
include <uvm/uvm.h>
@ -151,6 +155,9 @@ define M_DATA offsetof(struct mbuf, m_data)
define M_LEN offsetof(struct mbuf, m_len)
define M_NEXT offsetof(struct mbuf, m_next)
define IP_SRC offsetof(struct ip, ip_src)
define IP_DST offsetof(struct ip, ip_dst)
define V_TRAP offsetof(struct uvmexp, traps)
define V_INTR offsetof(struct uvmexp, intrs)

View File

@ -1,4 +1,4 @@
/* $NetBSD: in_cksum.s,v 1.9 1998/12/01 04:31:00 thorpej Exp $ */
/* $NetBSD: in_cksum.s,v 1.10 2001/03/06 14:55:14 fvdl Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -119,6 +119,52 @@
addw %dx, %ax ; \
adcw $0, %ax
ENTRY(in4_cksum)
pushl %ebp
pushl %ebx
pushl %esi
movl 16(%esp), %ebp
movzbl 20(%esp), %eax
shl $8, %eax /* sum = w[0] (== nxt << 8) */
movzwl 28(%esp), %ebx
rorw $8, %bx
addl %ebx, %eax /* sum += htons(len) */
movl M_DATA(%ebp), %ebx
ADC(IP_SRC) /* sum += mtod(m,struct ip *)->ip_src */
ADC(IP_DST)
MOP
movl 24(%esp), %esi
mbuf_loop_0:
testl %ebp, %ebp
jz skip_done
cmpl $0, %esi
jae skip_done
movl M_LEN(%ebp), %edx
cmpl %edx, %esi
ja skip_done
subl %edx, %esi
movl M_NEXT(%ebp), %ebp
jmp mbuf_loop_0
skip_done:
testl %ebp, %ebp
jz out_of_mbufs
movl M_DATA(%ebp), %ebx
movl M_LEN(%ebp), %edx
addl %esi, %ebx
subl %esi, %edx
xorb %cl, %cl
movl 28(%esp), %esi
testl %esi, %esi
jz done
jmp in4_entry
ENTRY(in_cksum)
pushl %ebp
pushl %ebx
@ -139,6 +185,7 @@ mbuf_loop_2:
movl M_DATA(%ebp), %ebx
movl M_LEN(%ebp), %edx
in4_entry:
movl M_NEXT(%ebp), %ebp
cmpl %esi, %edx