Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net/in_cksum add a dummy mkassym



details:   https://anonhg.NetBSD.org/src/rev/fa1bdf6554d8
branches:  trunk
changeset: 335406:fa1bdf6554d8
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 05 23:25:10 2015 +0000

description:
add a dummy mkassym
look in more places for cpu_in_cksum

diffstat:

 tests/net/in_cksum/Makefile   |  22 ++++++++++++++--------
 tests/net/in_cksum/in_cksum.c |  16 ++++++++++++++--
 tests/net/in_cksum/mkassym.c  |  15 +++++++++++++++
 3 files changed, 43 insertions(+), 10 deletions(-)

diffs (110 lines):

diff -r 9a3262329a9e -r fa1bdf6554d8 tests/net/in_cksum/Makefile
--- a/tests/net/in_cksum/Makefile       Mon Jan 05 23:00:52 2015 +0000
+++ b/tests/net/in_cksum/Makefile       Mon Jan 05 23:25:10 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.1 2015/01/05 22:38:36 christos Exp $
+#      $NetBSD: Makefile,v 1.2 2015/01/05 23:25:10 christos Exp $
 
 .include <bsd.own.mk>
 
@@ -7,19 +7,25 @@
 
 TESTS_SH=t_in_cksum
 
-ADIR=${NETBSDSRCDIR}/sys/arch/${MACHINE}/${MACHINE}
+
 CDIR=${NETBSDSRCDIR}/sys/netinet
+
+.for i in ${MACHINE_CPU} ${MACHINE_ARCH} ${MACHINE}
+ADIR:=${NETBSDSRCDIR}/sys/arch/${i}/${i}
 .if exists(${ADIR}/cpu_in_cksum.S)
 .PATH.S: ${ADIR}
-SRCS+=cpu_in_cksum.S
-CPPFLAGS+=-DHAVE_CPU_IN_CKSUM
+SRCS.in_cksum+=cpu_in_cksum.S in_cksum.c
+cpu_in_cksum.S: assym.h
+CLEANFILES+= assym.h
+CPPFLAGS+=-DHAVE_CPU_IN_CKSUM -I.
 .endif
+.endfor
 
-PROGS=in_cksum
+PROGS=in_cksum mkassym
 
 CPPFLAGS+=-I${CDIR}
 
-.include <bsd.test.mk>
+assym.h: mkassym
+       ${.ALLSRC} > ${.TARGET}
 
-foo:
-       echo ${ADIR}/cpu_in_cksum.S
+.include <bsd.test.mk>
diff -r 9a3262329a9e -r fa1bdf6554d8 tests/net/in_cksum/in_cksum.c
--- a/tests/net/in_cksum/in_cksum.c     Mon Jan 05 23:00:52 2015 +0000
+++ b/tests/net/in_cksum/in_cksum.c     Mon Jan 05 23:25:10 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_cksum.c,v 1.1 2015/01/05 22:38:36 christos Exp $    */
+/*     $NetBSD: in_cksum.c,v 1.2 2015/01/05 23:25:10 christos Exp $    */
 /*-
  * Copyright (c) 2008 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_cksum.c,v 1.1 2015/01/05 22:38:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_cksum.c,v 1.2 2015/01/05 23:25:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/mbuf.h>
@@ -37,6 +37,7 @@
 #include <err.h>
 #include <stdbool.h>
 #include <stdio.h>
+#include <stdarg.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
@@ -45,11 +46,22 @@
 #include "cpu_in_cksum.c"
 
 #ifdef HAVE_CPU_IN_CKSUM
+#undef cpu_in_cksum
 int    cpu_in_cksum(struct mbuf*, int, int, uint32_t);
 #endif
 
 static bool    random_aligned;
 
+void panic(const char *, ...);
+void
+panic(const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       verrx(1, fmt, ap);
+       va_end(ap);
+}
+
 static void
 free_mbuf_chain(struct mbuf *m)
 {
diff -r 9a3262329a9e -r fa1bdf6554d8 tests/net/in_cksum/mkassym.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/net/in_cksum/mkassym.c      Mon Jan 05 23:25:10 2015 +0000
@@ -0,0 +1,15 @@
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mbuf.h>
+#include <stddef.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+       printf("#define M_LEN %zu\n", offsetof(struct m_hdr, mh_len));
+       printf("#define M_DATA %zu\n", offsetof(struct m_hdr, mh_data));
+       printf("#define M_NEXT %zu\n", offsetof(struct m_hdr, mh_next));
+       return 0;
+}



Home | Main Index | Thread Index | Old Index