CVS commit: src/sys
Module Name:src Committed By: kamil Date: Sun May 20 04:00:35 UTC 2018 Modified Files: src/sys/kern: kern_sig.c sys_ptrace_common.c src/sys/sys: signalvar.h Log Message: Make stopsigmask a non-static symbol now as it's used in ptrace(2) code This is a missing part of the previous commit. While there fix a typo in a newly added comment in the ptrace(2) code. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.346 -r1.347 src/sys/kern/kern_sig.c cvs rdiff -u -r1.41 -r1.42 src/sys/kern/sys_ptrace_common.c cvs rdiff -u -r1.90 -r1.91 src/sys/sys/signalvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_sig.c diff -u src/sys/kern/kern_sig.c:1.346 src/sys/kern/kern_sig.c:1.347 --- src/sys/kern/kern_sig.c:1.346 Sat May 19 05:01:42 2018 +++ src/sys/kern/kern_sig.c Sun May 20 04:00:35 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sig.c,v 1.346 2018/05/19 05:01:42 kamil Exp $ */ +/* $NetBSD: kern_sig.c,v 1.347 2018/05/20 04:00:35 kamil Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.346 2018/05/19 05:01:42 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.347 2018/05/20 04:00:35 kamil Exp $"); #include "opt_ptrace.h" #include "opt_dtrace.h" @@ -113,7 +113,7 @@ static pool_cache_t ksiginfo_cache __rea static callout_t proc_stop_ch __cacheline_aligned; sigset_t contsigmask __cacheline_aligned; -static sigset_t stopsigmask __cacheline_aligned; +sigset_t stopsigmask __cacheline_aligned; static sigset_t vforksigmask __cacheline_aligned; sigset_t sigcantmask __cacheline_aligned; Index: src/sys/kern/sys_ptrace_common.c diff -u src/sys/kern/sys_ptrace_common.c:1.41 src/sys/kern/sys_ptrace_common.c:1.42 --- src/sys/kern/sys_ptrace_common.c:1.41 Sun May 20 03:51:31 2018 +++ src/sys/kern/sys_ptrace_common.c Sun May 20 04:00:35 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_ptrace_common.c,v 1.41 2018/05/20 03:51:31 kamil Exp $ */ +/* $NetBSD: sys_ptrace_common.c,v 1.42 2018/05/20 04:00:35 kamil Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.41 2018/05/20 03:51:31 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.42 2018/05/20 04:00:35 kamil Exp $"); #ifdef _KERNEL_OPT #include "opt_ptrace.h" @@ -867,7 +867,7 @@ ptrace_sendsig(struct proc *t, struct lw t->p_xsig = signo; /* - * signo > 0 check precents a potential panic, as + * signo > 0 check prevents a potential panic, as * sigismember(&...,0) is invalid check and signo * can be equal to 0 as a special case of no-signal. */ Index: src/sys/sys/signalvar.h diff -u src/sys/sys/signalvar.h:1.90 src/sys/sys/signalvar.h:1.91 --- src/sys/sys/signalvar.h:1.90 Tue May 1 16:37:23 2018 +++ src/sys/sys/signalvar.h Sun May 20 04:00:35 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: signalvar.h,v 1.90 2018/05/01 16:37:23 kamil Exp $ */ +/* $NetBSD: signalvar.h,v 1.91 2018/05/20 04:00:35 kamil Exp $ */ /* * Copyright (c) 1991, 1993 @@ -112,7 +112,7 @@ struct sigctx { #include /* for copyin_t/copyout_t */ -extern sigset_t contsigmask, sigcantmask; +extern sigset_t contsigmask, stopsigmask, sigcantmask; struct vnode; struct coredump_iostate;
CVS commit: src/sys
Module Name:src Committed By: kamil Date: Sun May 20 04:00:35 UTC 2018 Modified Files: src/sys/kern: kern_sig.c sys_ptrace_common.c src/sys/sys: signalvar.h Log Message: Make stopsigmask a non-static symbol now as it's used in ptrace(2) code This is a missing part of the previous commit. While there fix a typo in a newly added comment in the ptrace(2) code. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.346 -r1.347 src/sys/kern/kern_sig.c cvs rdiff -u -r1.41 -r1.42 src/sys/kern/sys_ptrace_common.c cvs rdiff -u -r1.90 -r1.91 src/sys/sys/signalvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: kamil Date: Sun May 20 03:51:32 UTC 2018 Modified Files: src/sys/kern: sys_ptrace_common.c src/tests/lib/libc/sys: t_ptrace_wait.c Log Message: Fix and enable traceme_signal_nohandler2 in ATF ptrace(2) tests traceme_signal_nohandler2 checks emitting SIGSTOP to a traced process with the PT_CONTINUE operation. The expected behavior is to simulate a behavior of receiving SIGSTOP, generating SIGCHLD to its parent (in this case the debugger) and ability to call wait(2)-like function receiving the stopped child event. The previous behavior was unstopping the process and it has been adjusted in the kernel code. FreeBSD keeps unstopping a process for emitting SIGSTOP. Linux handles this scenario in the same way as NetBSD now. While there, implement the missing bits in the userland ATF test for traceme_signal_nohandler2: receiving and validating 2nd SIGSTOP event and continuing the process, followed by its normal termination. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/kern/sys_ptrace_common.c cvs rdiff -u -r1.47 -r1.48 src/tests/lib/libc/sys/t_ptrace_wait.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/sys_ptrace_common.c diff -u src/sys/kern/sys_ptrace_common.c:1.40 src/sys/kern/sys_ptrace_common.c:1.41 --- src/sys/kern/sys_ptrace_common.c:1.40 Tue May 1 16:37:23 2018 +++ src/sys/kern/sys_ptrace_common.c Sun May 20 03:51:31 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_ptrace_common.c,v 1.40 2018/05/01 16:37:23 kamil Exp $ */ +/* $NetBSD: sys_ptrace_common.c,v 1.41 2018/05/20 03:51:31 kamil Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.40 2018/05/01 16:37:23 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.41 2018/05/20 03:51:31 kamil Exp $"); #ifdef _KERNEL_OPT #include "opt_ptrace.h" @@ -865,7 +865,16 @@ ptrace_sendsig(struct proc *t, struct lw * an LWP runs to see it. */ t->p_xsig = signo; - if (resume_all) + + /* + * signo > 0 check precents a potential panic, as + * sigismember(&...,0) is invalid check and signo + * can be equal to 0 as a special case of no-signal. + */ + if (signo > 0 && sigismember(, signo)) { + t->p_waited = 0; + child_psignal(t, 0); + } else if (resume_all) proc_unstop(t); else lwp_unstop(lt); Index: src/tests/lib/libc/sys/t_ptrace_wait.c diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.47 src/tests/lib/libc/sys/t_ptrace_wait.c:1.48 --- src/tests/lib/libc/sys/t_ptrace_wait.c:1.47 Sat May 19 05:25:21 2018 +++ src/tests/lib/libc/sys/t_ptrace_wait.c Sun May 20 03:51:31 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.47 2018/05/19 05:25:21 kamil Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.48 2018/05/20 03:51:31 kamil Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.47 2018/05/19 05:25:21 kamil Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.48 2018/05/20 03:51:31 kamil Exp $"); #include #include @@ -299,6 +299,7 @@ traceme_signal_nohandler(int sigsent) switch (sigsent) { case SIGCONT: + case SIGSTOP: _exit(exitval); default: /* NOTREACHED */ @@ -332,6 +333,30 @@ traceme_signal_nohandler(int sigsent) TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child); switch (sigsent) { + case SIGSTOP: + validate_status_stopped(status, sigsent); + DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for " + "child\n"); + SYSCALL_REQUIRE(ptrace(PT_GET_SIGINFO, child, , + sizeof(info)) != -1); + + DPRINTF("Signal traced to lwpid=%d\n", info.psi_lwpid); + DPRINTF("Signal properties: si_signo=%#x si_code=%#x " + "si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, sigval); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, SI_LWP); + + DPRINTF("Before resuming the child process where it left off " + "and with signal %s to be sent\n", strsignal(sigsent)); + SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), + child); + /* FALLTHROUGH */ case SIGCONT: validate_status_exited(status, exitval); break; @@ -360,7 +385,7 @@ ATF_TC_BODY(test, tc)\ } TRACEME_SIGNAL_NOHANDLER(traceme_signal_nohandler1, SIGKILL) /* non-maskable */ -//TRACEME_SIGNAL_NOHANDLER(traceme_signal_nohandler2, SIGSTOP) /* non-maskable */ +TRACEME_SIGNAL_NOHANDLER(traceme_signal_nohandler2, SIGSTOP) /* non-maskable */ TRACEME_SIGNAL_NOHANDLER(traceme_signal_nohandler3, SIGABRT) /* abort trap
CVS commit: src
Module Name:src Committed By: kamil Date: Sun May 20 03:51:32 UTC 2018 Modified Files: src/sys/kern: sys_ptrace_common.c src/tests/lib/libc/sys: t_ptrace_wait.c Log Message: Fix and enable traceme_signal_nohandler2 in ATF ptrace(2) tests traceme_signal_nohandler2 checks emitting SIGSTOP to a traced process with the PT_CONTINUE operation. The expected behavior is to simulate a behavior of receiving SIGSTOP, generating SIGCHLD to its parent (in this case the debugger) and ability to call wait(2)-like function receiving the stopped child event. The previous behavior was unstopping the process and it has been adjusted in the kernel code. FreeBSD keeps unstopping a process for emitting SIGSTOP. Linux handles this scenario in the same way as NetBSD now. While there, implement the missing bits in the userland ATF test for traceme_signal_nohandler2: receiving and validating 2nd SIGSTOP event and continuing the process, followed by its normal termination. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/kern/sys_ptrace_common.c cvs rdiff -u -r1.47 -r1.48 src/tests/lib/libc/sys/t_ptrace_wait.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/crash
Module Name:src Committed By: christos Date: Sun May 20 03:09:02 UTC 2018 Modified Files: src/usr.sbin/crash: Makefile Log Message: Fix reproducible builds XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/crash/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/crash
Module Name:src Committed By: christos Date: Sun May 20 03:09:02 UTC 2018 Modified Files: src/usr.sbin/crash: Makefile Log Message: Fix reproducible builds XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/crash/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/crash/Makefile diff -u src/usr.sbin/crash/Makefile:1.39 src/usr.sbin/crash/Makefile:1.40 --- src/usr.sbin/crash/Makefile:1.39 Sun Mar 4 02:15:37 2018 +++ src/usr.sbin/crash/Makefile Sat May 19 23:09:02 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.39 2018/03/04 07:15:37 mlelstv Exp $ +# $NetBSD: Makefile,v 1.40 2018/05/20 03:09:02 christos Exp $ PROG= crash MAN= crash.8 @@ -84,10 +84,18 @@ SRCS+= generic.c COPTS.db_output.c += -Wno-format-nonliteral +.if ${MKREPRO} == "yes" +. if ${MKREPRO_TIMESTAMP:U0} != 0 +NVFLAGS+=-r ${MKREPRO_TIMESTAMP} +. else +NVFLAGS+=-R +. endif +.endif + # vers.c SRCS+= vers.c vers.c: ${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS} - ${HOST_SH} ${S}/conf/newvers.sh -r -n + ${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH CLEANFILES+= vers.c version .else# } {
CVS commit: src/doc
Module Name:src Committed By: thorpej Date: Sat May 19 22:57:54 UTC 2018 Modified Files: src/doc: CHANGES Log Message: Note GPIO interrupt support overhaul. To generate a diff of this commit: cvs rdiff -u -r1.2388 -r1.2389 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/doc
Module Name:src Committed By: thorpej Date: Sat May 19 22:57:54 UTC 2018 Modified Files: src/doc: CHANGES Log Message: Note GPIO interrupt support overhaul. To generate a diff of this commit: cvs rdiff -u -r1.2388 -r1.2389 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2388 src/doc/CHANGES:1.2389 --- src/doc/CHANGES:1.2388 Sat May 5 00:13:02 2018 +++ src/doc/CHANGES Sat May 19 22:57:54 2018 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2388 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2389 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -153,3 +153,6 @@ Changes from NetBSD 8.0 to NetBSD 9.0: tzdata: updated to 2017e [kre 20180504] libc: Update to tzcode2018e. [christos 20180504] acpi(4): Updated ACPICA to 20180427. [christos 20180504] + gpio(4): Overhauled interrupt support. Added GPIO interrupt + capability for Broadcom BCM283x SoCs (e.g. + Raspberry Pi). [thorpej 20180519]
CVS commit: src/external/gpl3/binutils/dist/ld/emultempl
Module Name:src Committed By: christos Date: Sat May 19 21:20:35 UTC 2018 Modified Files: src/external/gpl3/binutils/dist/ld/emultempl: elf32.em Log Message: don't prepend sysroots when we already have prepended it (breaks X11 binaries) To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 \ src/external/gpl3/binutils/dist/ld/emultempl/elf32.em Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/gpl3/binutils/dist/ld/emultempl
Module Name:src Committed By: christos Date: Sat May 19 21:20:35 UTC 2018 Modified Files: src/external/gpl3/binutils/dist/ld/emultempl: elf32.em Log Message: don't prepend sysroots when we already have prepended it (breaks X11 binaries) To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 \ src/external/gpl3/binutils/dist/ld/emultempl/elf32.em Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/binutils/dist/ld/emultempl/elf32.em diff -u src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.16 src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.17 --- src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.16 Sun May 6 10:46:58 2018 +++ src/external/gpl3/binutils/dist/ld/emultempl/elf32.em Sat May 19 17:20:35 2018 @@ -1484,7 +1484,7 @@ fragment <
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 20:40:40 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: misc.c Log Message: Remove dead code, and style. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/crypto/dist/ipsec-tools/src/racoon/misc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/misc.c diff -u src/crypto/dist/ipsec-tools/src/racoon/misc.c:1.6 src/crypto/dist/ipsec-tools/src/racoon/misc.c:1.7 --- src/crypto/dist/ipsec-tools/src/racoon/misc.c:1.6 Tue Jul 15 00:47:09 2008 +++ src/crypto/dist/ipsec-tools/src/racoon/misc.c Sat May 19 20:40:40 2018 @@ -1,11 +1,11 @@ -/* $NetBSD: misc.c,v 1.6 2008/07/15 00:47:09 mgrooms Exp $ */ +/* $NetBSD: misc.c,v 1.7 2018/05/19 20:40:40 maxv Exp $ */ /* $KAME: misc.c,v 1.23 2001/08/16 14:37:29 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -17,7 +17,7 @@ * 3. Neither the name of the project nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -50,33 +50,8 @@ #include "misc.h" #include "debug.h" -#if 0 -static int bindump __P((void *, size_t)); - -static int -bindump(buf0, len) -void *buf0; -size_t len; -{ - unsigned char *buf = (unsigned char *)buf0; - size_t i; - - for (i = 0; i < len; i++) { - if ((buf[i] & 0x80) || !isprint(buf[i])) - printf("\\x%x", buf[i]); - else - printf("%c", buf[i]); - } - printf("\n"); - - return 0; -} -#endif - int -racoon_hexdump(buf0, len) - void *buf0; - size_t len; +racoon_hexdump(void *buf0, size_t len) { caddr_t buf = (caddr_t)buf0; size_t i; @@ -94,8 +69,7 @@ racoon_hexdump(buf0, len) } char * -bit2str(n, bl) - int n, bl; +bit2str(int n, int bl) { #define MAXBITLEN 128 static char b[MAXBITLEN + 1]; @@ -115,10 +89,7 @@ bit2str(n, bl) } const char * -debug_location(file, line, func) - const char *file; - int line; - const char *func; +debug_location(const char *file, int line, const char *func) { static char buf[1024]; const char *p; @@ -143,23 +114,21 @@ debug_location(file, line, func) * -1: error occured. */ int -getfsize(path) - char *path; +getfsize(char *path) { -struct stat st; + struct stat st; -if (stat(path, ) != 0) -return -1; -else -return st.st_size; + if (stat(path, ) != 0) + return -1; + else + return st.st_size; } /* * set the close-on-exec flag for file descriptor fd. */ void -close_on_exec(fd) - int fd; +close_on_exec(int fd) { fcntl(fd, F_SETFD, FD_CLOEXEC); } @@ -170,8 +139,7 @@ close_on_exec(fd) * t2: end */ double -timedelta(t1, t2) - struct timeval *t1, *t2; +timedelta(struct timeval *t1, struct timeval *t2) { if (t2->tv_usec >= t1->tv_usec) return t2->tv_sec - t1->tv_sec +
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 20:40:40 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: misc.c Log Message: Remove dead code, and style. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/crypto/dist/ipsec-tools/src/racoon/misc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 20:21:23 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: oakley.c Log Message: Remove unused 'error' variables, it's obvious they should have no use. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/crypto/dist/ipsec-tools/src/racoon/oakley.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 20:21:23 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: oakley.c Log Message: Remove unused 'error' variables, it's obvious they should have no use. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/crypto/dist/ipsec-tools/src/racoon/oakley.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/oakley.c diff -u src/crypto/dist/ipsec-tools/src/racoon/oakley.c:1.26 src/crypto/dist/ipsec-tools/src/racoon/oakley.c:1.27 --- src/crypto/dist/ipsec-tools/src/racoon/oakley.c:1.26 Sat May 19 20:14:56 2018 +++ src/crypto/dist/ipsec-tools/src/racoon/oakley.c Sat May 19 20:21:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: oakley.c,v 1.26 2018/05/19 20:14:56 maxv Exp $ */ +/* $NetBSD: oakley.c,v 1.27 2018/05/19 20:21:23 maxv Exp $ */ /* Id: oakley.c,v 1.32 2006/05/26 12:19:46 manubsd Exp */ @@ -786,7 +786,6 @@ oakley_compute_hash3(iph1, msgid, body) { vchar_t *buf = 0, *res = 0; int len; - int error = -1; /* create buffer */ len = 1 + sizeof(u_int32_t) + body->l; @@ -811,8 +810,6 @@ oakley_compute_hash3(iph1, msgid, body) if (res == NULL) goto end; - error = 0; - plog(LLV_DEBUG, LOCATION, NULL, "HASH computed:\n"); plogdump(LLV_DEBUG, res->v, res->l); @@ -841,7 +838,6 @@ oakley_compute_hash1(iph1, msgid, body) vchar_t *buf = NULL, *res = NULL; char *p; int len; - int error = -1; /* create buffer */ len = sizeof(u_int32_t) + body->l; @@ -867,8 +863,6 @@ oakley_compute_hash1(iph1, msgid, body) if (res == NULL) goto end; - error = 0; - plog(LLV_DEBUG, LOCATION, NULL, "HASH computed:\n"); plogdump(LLV_DEBUG, res->v, res->l); @@ -893,7 +887,6 @@ oakley_ph1hash_common(iph1, sw) vchar_t *buf = NULL, *res = NULL, *bp; char *p, *bp2; int len, bl; - int error = -1; #ifdef HAVE_GSSAPI vchar_t *gsstokens = NULL; #endif @@ -986,8 +979,6 @@ oakley_ph1hash_common(iph1, sw) if (res == NULL) goto end; - error = 0; - plog(LLV_DEBUG, LOCATION, NULL, "HASH (%s) computed:\n", iph1->side == INITIATOR ? "init" : "resp"); plogdump(LLV_DEBUG, res->v, res->l); @@ -1019,7 +1010,6 @@ oakley_ph1hash_base_i(iph1, sw) vchar_t *hash = NULL; /* for signature mode */ char *p; int len; - int error = -1; /* sanity check */ if (iph1->etype != ISAKMP_ETYPE_BASE) { @@ -1133,8 +1123,6 @@ oakley_ph1hash_base_i(iph1, sw) if (res == NULL) goto end; - error = 0; - plog(LLV_DEBUG, LOCATION, NULL, "HASH_I computed:\n"); plogdump(LLV_DEBUG, res->v, res->l); @@ -1160,7 +1148,6 @@ oakley_ph1hash_base_r(iph1, sw) vchar_t *hash = NULL; char *p; int len; - int error = -1; /* sanity check */ if (iph1->etype != ISAKMP_ETYPE_BASE) { @@ -1259,8 +1246,6 @@ oakley_ph1hash_base_r(iph1, sw) if (res == NULL) goto end; - error = 0; - plog(LLV_DEBUG, LOCATION, NULL, "HASH_R computed:\n"); plogdump(LLV_DEBUG, res->v, res->l);
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 20:14:56 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: admin.c cfparse.y evt.c grabmyaddr.c handler.c ipsec_doi.c isakmp.c isakmp_var.h isakmp_xauth.c localconf.c oakley.c pfkey.c remoteconf.c sainfo.c session.c Log Message: Use strict prototypes, when they don't introduce more warnings than they fix. Also localify a few functions. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/crypto/dist/ipsec-tools/src/racoon/admin.c cvs rdiff -u -r1.50 -r1.51 src/crypto/dist/ipsec-tools/src/racoon/cfparse.y \ src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c cvs rdiff -u -r1.10 -r1.11 src/crypto/dist/ipsec-tools/src/racoon/evt.c cvs rdiff -u -r1.36 -r1.37 \ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c cvs rdiff -u -r1.41 -r1.42 src/crypto/dist/ipsec-tools/src/racoon/handler.c cvs rdiff -u -r1.77 -r1.78 src/crypto/dist/ipsec-tools/src/racoon/isakmp.c cvs rdiff -u -r1.17 -r1.18 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_var.h cvs rdiff -u -r1.29 -r1.30 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c \ src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c cvs rdiff -u -r1.9 -r1.10 src/crypto/dist/ipsec-tools/src/racoon/localconf.c cvs rdiff -u -r1.25 -r1.26 src/crypto/dist/ipsec-tools/src/racoon/oakley.c cvs rdiff -u -r1.60 -r1.61 src/crypto/dist/ipsec-tools/src/racoon/pfkey.c cvs rdiff -u -r1.15 -r1.16 src/crypto/dist/ipsec-tools/src/racoon/sainfo.c cvs rdiff -u -r1.34 -r1.35 src/crypto/dist/ipsec-tools/src/racoon/session.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/admin.c diff -u src/crypto/dist/ipsec-tools/src/racoon/admin.c:1.40 src/crypto/dist/ipsec-tools/src/racoon/admin.c:1.41 --- src/crypto/dist/ipsec-tools/src/racoon/admin.c:1.40 Sat May 19 19:23:15 2018 +++ src/crypto/dist/ipsec-tools/src/racoon/admin.c Sat May 19 20:14:56 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: admin.c,v 1.40 2018/05/19 19:23:15 maxv Exp $ */ +/* $NetBSD: admin.c,v 1.41 2018/05/19 20:14:56 maxv Exp $ */ /* Id: admin.c,v 1.25 2006/04/06 14:31:04 manubsd Exp */ @@ -97,9 +97,7 @@ static int admin_process __P((int, char static int admin_reply __P((int, struct admin_com *, int, vchar_t *)); static int -admin_handler(ctx, fd) - void *ctx; - int fd; +admin_handler(void *ctx, int fd) { int so2; struct sockaddr_storage from; Index: src/crypto/dist/ipsec-tools/src/racoon/cfparse.y diff -u src/crypto/dist/ipsec-tools/src/racoon/cfparse.y:1.50 src/crypto/dist/ipsec-tools/src/racoon/cfparse.y:1.51 --- src/crypto/dist/ipsec-tools/src/racoon/cfparse.y:1.50 Sat May 19 19:32:16 2018 +++ src/crypto/dist/ipsec-tools/src/racoon/cfparse.y Sat May 19 20:14:56 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cfparse.y,v 1.50 2018/05/19 19:32:16 maxv Exp $ */ +/* $NetBSD: cfparse.y,v 1.51 2018/05/19 20:14:56 maxv Exp $ */ /* Id: cfparse.y,v 1.66 2006/08/22 18:17:17 manubsd Exp */ @@ -172,7 +172,7 @@ static int load_x509(const char *file, c return 0; } -static int process_rmconf() +static int process_rmconf(void) { /* check a exchange mode */ @@ -2611,8 +2611,7 @@ insspspec(rmconf, spspec) } static struct secprotospec * -dupspspec(spspec) - struct secprotospec *spspec; +dupspspec(struct secprotospec *spspec) { struct secprotospec *new; Index: src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c diff -u src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c:1.50 src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c:1.51 --- src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c:1.50 Sat May 19 19:23:15 2018 +++ src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c Sat May 19 20:14:56 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ipsec_doi.c,v 1.50 2018/05/19 19:23:15 maxv Exp $ */ +/* $NetBSD: ipsec_doi.c,v 1.51 2018/05/19 20:14:56 maxv Exp $ */ /* Id: ipsec_doi.c,v 1.55 2006/08/17 09:20:41 vanhu Exp */ @@ -197,9 +197,7 @@ ipsecdoi_checkph1proposal(sa, iph1) } static void -print_ph1proposal(pair, s) - struct prop_pair *pair; - struct isakmpsa *s; +print_ph1proposal(struct prop_pair *pair, struct isakmpsa *s) { struct isakmp_pl_p *prop = pair->prop; struct isakmp_pl_t *trns = pair->trns; @@ -3302,9 +3300,7 @@ doi2ipproto(proto) */ int -ipsecdoi_subnetisaddr_v4( subnet, address ) - const vchar_t *subnet; - const vchar_t *address; +ipsecdoi_subnetisaddr_v4(const vchar_t *subnet, const vchar_t *address) { struct in_addr *mask; @@ -3325,9 +3321,7 @@ ipsecdoi_subnetisaddr_v4( subnet, addres #ifdef INET6 int -ipsecdoi_subnetisaddr_v6( subnet, address ) - const vchar_t *subnet; - const vchar_t *address; +ipsecdoi_subnetisaddr_v6(const vchar_t *subnet, const vchar_t *address) { struct in6_addr *mask; int i; Index: src/crypto/dist/ipsec-tools/src/racoon/evt.c diff -u src/crypto/dist/ipsec-tools/src/racoon/evt.c:1.10
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 20:14:56 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: admin.c cfparse.y evt.c grabmyaddr.c handler.c ipsec_doi.c isakmp.c isakmp_var.h isakmp_xauth.c localconf.c oakley.c pfkey.c remoteconf.c sainfo.c session.c Log Message: Use strict prototypes, when they don't introduce more warnings than they fix. Also localify a few functions. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/crypto/dist/ipsec-tools/src/racoon/admin.c cvs rdiff -u -r1.50 -r1.51 src/crypto/dist/ipsec-tools/src/racoon/cfparse.y \ src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c cvs rdiff -u -r1.10 -r1.11 src/crypto/dist/ipsec-tools/src/racoon/evt.c cvs rdiff -u -r1.36 -r1.37 \ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c cvs rdiff -u -r1.41 -r1.42 src/crypto/dist/ipsec-tools/src/racoon/handler.c cvs rdiff -u -r1.77 -r1.78 src/crypto/dist/ipsec-tools/src/racoon/isakmp.c cvs rdiff -u -r1.17 -r1.18 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_var.h cvs rdiff -u -r1.29 -r1.30 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c \ src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c cvs rdiff -u -r1.9 -r1.10 src/crypto/dist/ipsec-tools/src/racoon/localconf.c cvs rdiff -u -r1.25 -r1.26 src/crypto/dist/ipsec-tools/src/racoon/oakley.c cvs rdiff -u -r1.60 -r1.61 src/crypto/dist/ipsec-tools/src/racoon/pfkey.c cvs rdiff -u -r1.15 -r1.16 src/crypto/dist/ipsec-tools/src/racoon/sainfo.c cvs rdiff -u -r1.34 -r1.35 src/crypto/dist/ipsec-tools/src/racoon/session.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/alpha/include
Module Name:src Committed By: thorpej Date: Sat May 19 20:04:41 UTC 2018 Modified Files: src/sys/arch/alpha/include: pmap.h Log Message: Implement PMAP_DIRECT / pmap_direct_process() in support of experimental UBC optimizations. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/sys/arch/alpha/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/include/pmap.h diff -u src/sys/arch/alpha/include/pmap.h:1.79 src/sys/arch/alpha/include/pmap.h:1.80 --- src/sys/arch/alpha/include/pmap.h:1.79 Wed Jan 1 16:09:04 2014 +++ src/sys/arch/alpha/include/pmap.h Sat May 19 20:04:41 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.79 2014/01/01 16:09:04 matt Exp $ */ +/* $NetBSD: pmap.h,v 1.80 2018/05/19 20:04:41 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001, 2007 The NetBSD Foundation, Inc. @@ -228,11 +228,24 @@ pmap_remove_all(struct pmap *pmap) #define PMAP_STEAL_MEMORY /* enable pmap_steal_memory() */ #define PMAP_GROWKERNEL /* enable pmap_growkernel() */ +#define PMAP_DIRECT +#define PMAP_DIRECT_MAP(pa) ALPHA_PHYS_TO_K0SEG((pa)) +#define PMAP_DIRECT_UNMAP(va) ALPHA_K0SEG_TO_PHYS((va)) + +static __inline int +pmap_direct_process(paddr_t pa, voff_t pgoff, size_t len, +int (*process)(void *, size_t, void *), void *arg) +{ + vaddr_t va = PMAP_DIRECT_MAP(pa); + + return process((void *)(va + pgoff), len, arg); +} + /* * Alternate mapping hooks for pool pages. Avoids thrashing the TLB. */ -#define PMAP_MAP_POOLPAGE(pa) ALPHA_PHYS_TO_K0SEG((pa)) -#define PMAP_UNMAP_POOLPAGE(va) ALPHA_K0SEG_TO_PHYS((va)) +#define PMAP_MAP_POOLPAGE(pa) PMAP_DIRECT_MAP(pa) +#define PMAP_UNMAP_POOLPAGE(va) PMAP_DIRECT_UNMAP(va) /* * Other hooks for the pool allocator.
CVS commit: src/sys/arch/alpha/include
Module Name:src Committed By: thorpej Date: Sat May 19 20:04:41 UTC 2018 Modified Files: src/sys/arch/alpha/include: pmap.h Log Message: Implement PMAP_DIRECT / pmap_direct_process() in support of experimental UBC optimizations. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/sys/arch/alpha/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 19:47:47 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: backupsa.c isakmp_cfg.c isakmp_inf.c session.c Log Message: Remove unused labels, functions, and function prototypes. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/crypto/dist/ipsec-tools/src/racoon/backupsa.c cvs rdiff -u -r1.27 -r1.28 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c cvs rdiff -u -r1.52 -r1.53 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c cvs rdiff -u -r1.33 -r1.34 src/crypto/dist/ipsec-tools/src/racoon/session.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/backupsa.c diff -u src/crypto/dist/ipsec-tools/src/racoon/backupsa.c:1.10 src/crypto/dist/ipsec-tools/src/racoon/backupsa.c:1.11 --- src/crypto/dist/ipsec-tools/src/racoon/backupsa.c:1.10 Fri Apr 2 15:15:00 2010 +++ src/crypto/dist/ipsec-tools/src/racoon/backupsa.c Sat May 19 19:47:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: backupsa.c,v 1.10 2010/04/02 15:15:00 christos Exp $ */ +/* $NetBSD: backupsa.c,v 1.11 2018/05/19 19:47:47 maxv Exp $ */ /* $KAME: backupsa.c,v 1.16 2001/12/31 20:13:40 thorpej Exp $ */ @@ -228,7 +228,6 @@ backupsa_from_file() memset(, 0, sizeof(tm)); p = str2tmx(buf, ); if (*p != '%') { - err: plog(LLV_ERROR, LOCATION, NULL, "illegal format line#%d in %s: %s\n", line, lcconf->pathinfo[LC_PATHTYPE_BACKUPSA], Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c:1.27 src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c:1.28 --- src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c:1.27 Sat May 19 19:32:16 2018 +++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c Sat May 19 19:47:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: isakmp_cfg.c,v 1.27 2018/05/19 19:32:16 maxv Exp $ */ +/* $NetBSD: isakmp_cfg.c,v 1.28 2018/05/19 19:47:47 maxv Exp $ */ /* Id: isakmp_cfg.c,v 1.55 2006/08/22 18:17:17 manubsd Exp */ @@ -740,7 +740,7 @@ isakmp_cfg_set(iph1, attrpl) delph1(iph1); iph1 = NULL; } -end: + vfree(payload); /* Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.52 src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.53 --- src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.52 Sat May 19 19:23:15 2018 +++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c Sat May 19 19:47:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: isakmp_inf.c,v 1.52 2018/05/19 19:23:15 maxv Exp $ */ +/* $NetBSD: isakmp_inf.c,v 1.53 2018/05/19 19:47:47 maxv Exp $ */ /* Id: isakmp_inf.c,v 1.44 2006/05/06 20:45:52 manubsd Exp */ @@ -110,8 +110,6 @@ static int isakmp_info_recv_r_u_ack __P( static void isakmp_info_send_r_u __P((struct sched *)); #endif -static void purge_isakmp_spi __P((int, isakmp_index *, size_t)); - /* %%% * Information Exchange */ @@ -1072,32 +1070,6 @@ isakmp_add_pl_n(buf0, np_p, type, pr, da return buf; } -static void -purge_isakmp_spi(proto, spi, n) - int proto; - isakmp_index *spi; /*network byteorder*/ - size_t n; -{ - struct ph1handle *iph1; - size_t i; - - for (i = 0; i < n; i++) { - iph1 = getph1byindex([i]); - if (!iph1) - continue; - - plog(LLV_INFO, LOCATION, NULL, - "purged ISAKMP-SA proto_id=%s spi=%s.\n", - s_ipsecdoi_proto(proto), - isakmp_pindex([i], 0)); - - iph1->status = PHASE1ST_EXPIRED; - isakmp_ph1delete(iph1); - } -} - - - void purge_ipsec_spi(dst0, proto, spi, n) struct sockaddr *dst0; Index: src/crypto/dist/ipsec-tools/src/racoon/session.c diff -u src/crypto/dist/ipsec-tools/src/racoon/session.c:1.33 src/crypto/dist/ipsec-tools/src/racoon/session.c:1.34 --- src/crypto/dist/ipsec-tools/src/racoon/session.c:1.33 Sat May 19 19:23:15 2018 +++ src/crypto/dist/ipsec-tools/src/racoon/session.c Sat May 19 19:47:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: session.c,v 1.33 2018/05/19 19:23:15 maxv Exp $ */ +/* $NetBSD: session.c,v 1.34 2018/05/19 19:47:47 maxv Exp $ */ /* $KAME: session.c,v 1.32 2003/09/24 02:01:17 jinmei Exp $ */ @@ -111,11 +111,9 @@ struct fd_monitor { #define NUM_PRIORITIES 2 static void close_session __P((void)); -static void initfds __P((void)); static void init_signal __P((void)); static int set_signal __P((int sig, RETSIGTYPE (*func) __P((int; static void check_sigreq __P((void)); -static void check_flushsa __P((void)); static int close_sockets __P((void)); static fd_set preset_mask, active_mask;
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 19:47:47 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: backupsa.c isakmp_cfg.c isakmp_inf.c session.c Log Message: Remove unused labels, functions, and function prototypes. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/crypto/dist/ipsec-tools/src/racoon/backupsa.c cvs rdiff -u -r1.27 -r1.28 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c cvs rdiff -u -r1.52 -r1.53 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c cvs rdiff -u -r1.33 -r1.34 src/crypto/dist/ipsec-tools/src/racoon/session.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 19:32:16 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: cfparse.y isakmp_cfg.c isakmp_frag.c isakmp_xauth.c Log Message: More unused variables. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/crypto/dist/ipsec-tools/src/racoon/cfparse.y cvs rdiff -u -r1.26 -r1.27 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c cvs rdiff -u -r1.7 -r1.8 src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c cvs rdiff -u -r1.28 -r1.29 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 19:32:16 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: cfparse.y isakmp_cfg.c isakmp_frag.c isakmp_xauth.c Log Message: More unused variables. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/crypto/dist/ipsec-tools/src/racoon/cfparse.y cvs rdiff -u -r1.26 -r1.27 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c cvs rdiff -u -r1.7 -r1.8 src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c cvs rdiff -u -r1.28 -r1.29 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/cfparse.y diff -u src/crypto/dist/ipsec-tools/src/racoon/cfparse.y:1.49 src/crypto/dist/ipsec-tools/src/racoon/cfparse.y:1.50 --- src/crypto/dist/ipsec-tools/src/racoon/cfparse.y:1.49 Wed Feb 17 20:11:17 2016 +++ src/crypto/dist/ipsec-tools/src/racoon/cfparse.y Sat May 19 19:32:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cfparse.y,v 1.49 2016/02/17 20:11:17 christos Exp $ */ +/* $NetBSD: cfparse.y,v 1.50 2018/05/19 19:32:16 maxv Exp $ */ /* Id: cfparse.y,v 1.66 2006/08/22 18:17:17 manubsd Exp */ @@ -1543,7 +1543,6 @@ sainfo_id { char portbuf[10]; struct sockaddr *laddr = NULL, *haddr = NULL; - char *cur = NULL; if (($6 == IPPROTO_ICMP || $6 == IPPROTO_ICMPV6) && ($5 != IPSEC_PORT_ANY || $5 != IPSEC_PORT_ANY)) { @@ -2013,7 +2012,6 @@ remote_spec | PEERS_CERTFILE CERT_PLAINRSA QUOTEDSTRING { char path[MAXPATHLEN]; - int ret = 0; if (cur_rmconf->peerscert != NULL) { yyerror("peers_certfile already defined\n"); @@ -2365,7 +2363,6 @@ cert_spec | CERT_PLAINRSA QUOTEDSTRING { char path[MAXPATHLEN]; - int ret = 0; if (cur_rmconf->mycert != NULL) { yyerror("certificate_type already defined\n"); Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c:1.26 src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c:1.27 --- src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c:1.26 Wed Mar 9 22:27:17 2016 +++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_cfg.c Sat May 19 19:32:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: isakmp_cfg.c,v 1.26 2016/03/09 22:27:17 christos Exp $ */ +/* $NetBSD: isakmp_cfg.c,v 1.27 2018/05/19 19:32:16 maxv Exp $ */ /* Id: isakmp_cfg.c,v 1.55 2006/08/22 18:17:17 manubsd Exp */ @@ -322,7 +322,6 @@ isakmp_cfg_reply(iph1, attrpl) size_t alen; char *npp; int type; - struct sockaddr_in *sin; int error; tlen = ntohs(attrpl->h.len); @@ -782,7 +781,6 @@ isakmp_cfg_net(iph1, attr) { int type; int confsource; - in_addr_t addr4; type = ntohs(attr->type); @@ -1665,7 +1663,6 @@ isakmp_cfg_accounting_system(port, raddr char *usr; int inout; { - int error = 0; struct utmpx ut; char addr[NI_MAXHOST]; @@ -1880,8 +1877,6 @@ isakmp_cfg_setenv(iph1, envp, envc) char defdom[MAXPATHLEN + 1]; int cidr, tmp; char cidrstr[4]; - int i, p; - int test; plog(LLV_DEBUG, LOCATION, NULL, "Starting a script.\n"); @@ -2134,7 +2129,6 @@ isakmp_cfg_init(cold) int cold; { int i; - int error; isakmp_cfg_config.network4 = (in_addr_t)0x; isakmp_cfg_config.netmask4 = (in_addr_t)0x; @@ -2184,6 +2178,7 @@ isakmp_cfg_init(cold) isakmp_cfg_config.splitdns_len = 0; #if 0 + int error; if (cold == ISAKMP_CFG_INIT_COLD) { if ((error = isakmp_cfg_resize_pool(ISAKMP_CFG_MAX_CNX)) != 0) return error; Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c:1.7 src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c:1.8 --- src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c:1.7 Sun Jul 23 05:40:27 2017 +++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c Sat May 19 19:32:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: isakmp_frag.c,v 1.7 2017/07/23 05:40:27 christos Exp $ */ +/* $NetBSD: isakmp_frag.c,v 1.8 2018/05/19 19:32:16 maxv Exp $ */ /* Id: isakmp_frag.c,v 1.4 2004/11/13 17:31:36 manubsd Exp */ @@ -219,7 +219,6 @@ isakmp_frag_extract(iph1, msg) struct isakmp_frag *frag; struct isakmp_frag_item *item; vchar_t *buf; - size_t len; int last_frag = 0; char *data; int i; Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c:1.28 src/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c:1.29 --- src/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c:1.28 Wed Mar 9 15:58:25 2016 +++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c Sat May 19 19:32:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: isakmp_xauth.c,v 1.28 2016/03/09 15:58:25 christos Exp $ */ +/* $NetBSD: isakmp_xauth.c,v 1.29 2018/05/19 19:32:16 maxv Exp $ */ /* Id: isakmp_xauth.c,v 1.38 2006/08/22 18:17:17 manubsd Exp */ @@ -655,7 +655,6 @@ PAM_conv(msg_count,
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 19:23:15 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: admin.c grabmyaddr.c ipsec_doi.c isakmp.c isakmp_agg.c isakmp_base.c isakmp_ident.c isakmp_inf.c main.c oakley.c privsep.c remoteconf.c session.c vendorid.c Log Message: Remove unused variables. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/crypto/dist/ipsec-tools/src/racoon/admin.c cvs rdiff -u -r1.35 -r1.36 \ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c cvs rdiff -u -r1.49 -r1.50 src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c cvs rdiff -u -r1.76 -r1.77 src/crypto/dist/ipsec-tools/src/racoon/isakmp.c cvs rdiff -u -r1.16 -r1.17 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_agg.c cvs rdiff -u -r1.12 -r1.13 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_base.c cvs rdiff -u -r1.15 -r1.16 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_ident.c cvs rdiff -u -r1.51 -r1.52 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c cvs rdiff -u -r1.14 -r1.15 src/crypto/dist/ipsec-tools/src/racoon/main.c cvs rdiff -u -r1.24 -r1.25 src/crypto/dist/ipsec-tools/src/racoon/oakley.c cvs rdiff -u -r1.23 -r1.24 src/crypto/dist/ipsec-tools/src/racoon/privsep.c cvs rdiff -u -r1.28 -r1.29 \ src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c cvs rdiff -u -r1.32 -r1.33 src/crypto/dist/ipsec-tools/src/racoon/session.c cvs rdiff -u -r1.8 -r1.9 src/crypto/dist/ipsec-tools/src/racoon/vendorid.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/admin.c diff -u src/crypto/dist/ipsec-tools/src/racoon/admin.c:1.39 src/crypto/dist/ipsec-tools/src/racoon/admin.c:1.40 --- src/crypto/dist/ipsec-tools/src/racoon/admin.c:1.39 Mon Jun 3 05:49:31 2013 +++ src/crypto/dist/ipsec-tools/src/racoon/admin.c Sat May 19 19:23:15 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: admin.c,v 1.39 2013/06/03 05:49:31 tteras Exp $ */ +/* $NetBSD: admin.c,v 1.40 2018/05/19 19:23:15 maxv Exp $ */ /* Id: admin.c,v 1.25 2006/04/06 14:31:04 manubsd Exp */ @@ -327,7 +327,6 @@ admin_process(so2, combuf) #ifdef ENABLE_HYBRID case ADMIN_LOGOUT_USER: { - struct ph1handle *iph1; char user[LOGINLEN+1]; int found = 0, len = com->ac_len - sizeof(*com); @@ -427,7 +426,6 @@ admin_process(so2, combuf) case ADMIN_PROTO_ISAKMP: { struct ph1handle *ph1; struct remoteconf *rmconf; - u_int16_t port; l_ac_errno = -1; Index: src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c diff -u src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.35 src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.36 --- src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.35 Wed Apr 12 16:47:39 2017 +++ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c Sat May 19 19:23:15 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: grabmyaddr.c,v 1.35 2017/04/12 16:47:39 roy Exp $ */ +/* $NetBSD: grabmyaddr.c,v 1.36 2018/05/19 19:23:15 maxv Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 2008 Timo Teras. @@ -140,7 +140,7 @@ myaddr_open_all_configured(addr) struct sockaddr *addr; { /* create all configured, not already opened addresses */ - struct myaddr *cfg, *my; + struct myaddr *cfg; if (addr != NULL) { switch (addr->sa_family) { @@ -859,7 +859,6 @@ kernel_sync() caddr_t ref, buf, end; size_t bufsiz; struct if_msghdr *ifm; - struct interface *ifp; #define MIBSIZ 6 int mib[MIBSIZ] = { Index: src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c diff -u src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c:1.49 src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c:1.50 --- src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c:1.49 Tue Jun 18 05:39:50 2013 +++ src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c Sat May 19 19:23:15 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ipsec_doi.c,v 1.49 2013/06/18 05:39:50 tteras Exp $ */ +/* $NetBSD: ipsec_doi.c,v 1.50 2018/05/19 19:23:15 maxv Exp $ */ /* Id: ipsec_doi.c,v 1.55 2006/08/17 09:20:41 vanhu Exp */ @@ -264,8 +264,6 @@ get_ph1approval(iph1, doitype, sittype, for (s = pair[i]; s; s = s->next) { /* compare proposal and select one */ for (p = s; p; p = p->tnext) { -struct isakmp_pl_p *prop = p->prop; - sa = newisakmpsa(); ctx.p = p; ctx.sa = sa; @@ -3894,7 +3892,7 @@ set_identifier_qual(vpp, type, value, qu if (loglevel >= LLV_DEBUG) { X509_NAME *xn; BIO *bio; - unsigned char *ptr = (unsigned char *) new->v, *buf; + unsigned char *ptr = (unsigned char *) new->v; size_t len; char save; Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp.c diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp.c:1.76 src/crypto/dist/ipsec-tools/src/racoon/isakmp.c:1.77 --- src/crypto/dist/ipsec-tools/src/racoon/isakmp.c:1.76 Tue Jan 24 19:23:56 2017 +++
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 19:23:15 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: admin.c grabmyaddr.c ipsec_doi.c isakmp.c isakmp_agg.c isakmp_base.c isakmp_ident.c isakmp_inf.c main.c oakley.c privsep.c remoteconf.c session.c vendorid.c Log Message: Remove unused variables. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/crypto/dist/ipsec-tools/src/racoon/admin.c cvs rdiff -u -r1.35 -r1.36 \ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c cvs rdiff -u -r1.49 -r1.50 src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c cvs rdiff -u -r1.76 -r1.77 src/crypto/dist/ipsec-tools/src/racoon/isakmp.c cvs rdiff -u -r1.16 -r1.17 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_agg.c cvs rdiff -u -r1.12 -r1.13 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_base.c cvs rdiff -u -r1.15 -r1.16 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_ident.c cvs rdiff -u -r1.51 -r1.52 \ src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c cvs rdiff -u -r1.14 -r1.15 src/crypto/dist/ipsec-tools/src/racoon/main.c cvs rdiff -u -r1.24 -r1.25 src/crypto/dist/ipsec-tools/src/racoon/oakley.c cvs rdiff -u -r1.23 -r1.24 src/crypto/dist/ipsec-tools/src/racoon/privsep.c cvs rdiff -u -r1.28 -r1.29 \ src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c cvs rdiff -u -r1.32 -r1.33 src/crypto/dist/ipsec-tools/src/racoon/session.c cvs rdiff -u -r1.8 -r1.9 src/crypto/dist/ipsec-tools/src/racoon/vendorid.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 18:51:59 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: main.c nattraversal.c nattraversal.h Log Message: Style, a little... To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/crypto/dist/ipsec-tools/src/racoon/main.c cvs rdiff -u -r1.14 -r1.15 \ src/crypto/dist/ipsec-tools/src/racoon/nattraversal.c cvs rdiff -u -r1.7 -r1.8 \ src/crypto/dist/ipsec-tools/src/racoon/nattraversal.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/main.c diff -u src/crypto/dist/ipsec-tools/src/racoon/main.c:1.13 src/crypto/dist/ipsec-tools/src/racoon/main.c:1.14 --- src/crypto/dist/ipsec-tools/src/racoon/main.c:1.13 Fri Jul 12 13:11:50 2013 +++ src/crypto/dist/ipsec-tools/src/racoon/main.c Sat May 19 18:51:59 2018 @@ -1,11 +1,11 @@ -/* $NetBSD: main.c,v 1.13 2013/07/12 13:11:50 tteras Exp $ */ +/* $NetBSD: main.c,v 1.14 2018/05/19 18:51:59 maxv Exp $ */ /* Id: main.c,v 1.25 2006/06/20 20:31:34 manubsd Exp */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -17,7 +17,7 @@ * 3. Neither the name of the project nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -85,9 +85,9 @@ static int loading_sa = 0; /* install sa #ifdef TOP_PACKAGE static char version[] = "@(#)" TOP_PACKAGE_STRING " (" TOP_PACKAGE_URL ")"; -#else /* TOP_PACKAGE */ +#else static char version[] = "@(#) racoon / IPsec-tools"; -#endif /* TOP_PACKAGE */ +#endif static void print_version() @@ -162,9 +162,7 @@ usage() } static void -parse(ac, av) - int ac; - char **av; +parse(int ac, char **av) { extern char *optarg; extern int optind; @@ -264,9 +262,7 @@ parse(ac, av) } int -main(ac, av) - int ac; - char **av; +main(int ac, char **av) { int error; @@ -308,7 +304,7 @@ main(ac, av) plog(LLV_INFO, LOCATION, NULL, "@(#)" "This product linked %s (http://www.openssl.org/)" "\n", eay_version()); - plog(LLV_INFO, LOCATION, NULL, "Reading configuration from \"%s\"\n", + plog(LLV_INFO, LOCATION, NULL, "Reading configuration from \"%s\"\n", lcconf->racoon_conf); /* @@ -346,4 +342,3 @@ main(ac, av) return 0; } - Index: src/crypto/dist/ipsec-tools/src/racoon/nattraversal.c diff -u src/crypto/dist/ipsec-tools/src/racoon/nattraversal.c:1.14 src/crypto/dist/ipsec-tools/src/racoon/nattraversal.c:1.15 --- src/crypto/dist/ipsec-tools/src/racoon/nattraversal.c:1.14 Mon Mar 14 17:18:13 2011 +++ src/crypto/dist/ipsec-tools/src/racoon/nattraversal.c Sat May 19 18:51:59 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: nattraversal.c,v 1.14 2011/03/14 17:18:13 tteras Exp $ */ +/* $NetBSD: nattraversal.c,v 1.15 2018/05/19 18:51:59 maxv Exp $ */ /* * Copyright (C) 2004 SuSE Linux AG, Nuernberg, Germany. @@ -230,118 +230,117 @@ natt_udp_encap (int encmode) } int -natt_fill_options (struct ph1natt_options *opts, int version) +natt_fill_options(struct ph1natt_options *opts, int version) { - if (! opts) -return -1; + if (!opts) + return -1; - opts->version = version; + opts->version = version; - switch (version) { -case VENDORID_NATT_00: -case VENDORID_NATT_01: - opts->float_port = 0; /* No port floating for those drafts */ - opts->payload_nat_d = ISAKMP_NPTYPE_NATD_DRAFT; - opts->payload_nat_oa = ISAKMP_NPTYPE_NATOA_DRAFT; - opts->mode_udp_tunnel = IPSECDOI_ATTR_ENC_MODE_UDPTUNNEL_DRAFT; - opts->mode_udp_transport = IPSECDOI_ATTR_ENC_MODE_UDPTRNS_DRAFT; - opts->encaps_type = UDP_ENCAP_ESPINUDP_NON_IKE; + switch (version) { + case VENDORID_NATT_00: + case VENDORID_NATT_01: + opts->float_port = 0; /* No port floating for those drafts */ + opts->payload_nat_d = ISAKMP_NPTYPE_NATD_DRAFT; + opts->payload_nat_oa = ISAKMP_NPTYPE_NATOA_DRAFT; + opts->mode_udp_tunnel = IPSECDOI_ATTR_ENC_MODE_UDPTUNNEL_DRAFT; + opts->mode_udp_transport = IPSECDOI_ATTR_ENC_MODE_UDPTRNS_DRAFT; + opts->encaps_type = UDP_ENCAP_ESPINUDP_NON_IKE; + break; + case VENDORID_NATT_02: + case VENDORID_NATT_02_N: + case VENDORID_NATT_03: + opts->float_port = lcconf->port_isakmp_natt; + opts->payload_nat_d = ISAKMP_NPTYPE_NATD_DRAFT; + opts->payload_nat_oa = ISAKMP_NPTYPE_NATOA_DRAFT; + opts->mode_udp_tunnel = IPSECDOI_ATTR_ENC_MODE_UDPTUNNEL_DRAFT; + opts->mode_udp_transport = IPSECDOI_ATTR_ENC_MODE_UDPTRNS_DRAFT;
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: maxv Date: Sat May 19 18:51:59 UTC 2018 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: main.c nattraversal.c nattraversal.h Log Message: Style, a little... To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/crypto/dist/ipsec-tools/src/racoon/main.c cvs rdiff -u -r1.14 -r1.15 \ src/crypto/dist/ipsec-tools/src/racoon/nattraversal.c cvs rdiff -u -r1.7 -r1.8 \ src/crypto/dist/ipsec-tools/src/racoon/nattraversal.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/stand/mbr
Module Name:src Committed By: jakllsch Date: Sat May 19 18:19:37 UTC 2018 Modified Files: src/sys/arch/i386/stand/mbr: gpt.S Log Message: Fix some whitespace style issues. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/mbr/gpt.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/mbr/gpt.S diff -u src/sys/arch/i386/stand/mbr/gpt.S:1.2 src/sys/arch/i386/stand/mbr/gpt.S:1.3 --- src/sys/arch/i386/stand/mbr/gpt.S:1.2 Sat May 19 18:18:16 2018 +++ src/sys/arch/i386/stand/mbr/gpt.S Sat May 19 18:19:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: gpt.S,v 1.2 2018/05/19 18:18:16 jakllsch Exp $ */ +/* $NetBSD: gpt.S,v 1.3 2018/05/19 18:19:37 jakllsch Exp $ */ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ * * NO_LBA_CHECK - no check if bios supports LBA reads * NO_CRC_CHECK - disable crc checks for GPT - * NO_BANNER- do not output title line 'banner' + * NO_BANNER - do not output title line 'banner' */ #ifdef COM_PORT @@ -143,7 +143,7 @@ ENTRY(start) mov %ax, %es mov %ax, %ds movw $mbr, %di - mov $BOOTADDR + (mbr - start), %si + mov $BOOTADDR + (mbr - start), %si push %ax /* zero for %cs of lret */ push %di movw $(bss_start - mbr), %cx
CVS commit: src/sys/arch/i386/stand/mbr
Module Name:src Committed By: jakllsch Date: Sat May 19 18:19:37 UTC 2018 Modified Files: src/sys/arch/i386/stand/mbr: gpt.S Log Message: Fix some whitespace style issues. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/mbr/gpt.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/stand/mbr
Module Name:src Committed By: jakllsch Date: Sat May 19 18:18:16 UTC 2018 Modified Files: src/sys/arch/i386/stand/mbr: gpt.S Log Message: Compact crc32 code by 12 bytes of text. >From dave0 in #NetBSD on Freenode circa December 2017. Tested in a 32-bit userland harness to produce identical results as old code for one set of inputs. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/mbr/gpt.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/mbr/gpt.S diff -u src/sys/arch/i386/stand/mbr/gpt.S:1.1 src/sys/arch/i386/stand/mbr/gpt.S:1.2 --- src/sys/arch/i386/stand/mbr/gpt.S:1.1 Thu Jan 6 01:08:49 2011 +++ src/sys/arch/i386/stand/mbr/gpt.S Sat May 19 18:18:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: gpt.S,v 1.1 2011/01/06 01:08:49 jakllsch Exp $ */ +/* $NetBSD: gpt.S,v 1.2 2018/05/19 18:18:16 jakllsch Exp $ */ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -428,21 +428,14 @@ message_1: * %ebx crc (returned) */ crc32: - push %dx /* preserve drive number */ - push %ax /* preserve original CRC */ - - xorl %ebx, %ebx - decl %ebx /* init value */ + orl $-1, %ebx /* init value */ 1: - lodsb/* load next message byte to %al */ + xorb (%si), %bl /* xoring next message byte with previous result */ + inc %si movb $8, %cl /* set bit counter */ 2: - movb %al, %dl - xorb %bl, %dl /* xoring with previous result */ shrl $1, %ebx - shrb $1, %al - testb $1, %dl - jz 3f + jnc 3f crc32_poly = . + 3 /* gross, but saves a few bytes */ xorl $0xedb88320, %ebx /* EFI CRC32 Polynomial */ 3: @@ -451,8 +444,6 @@ crc32_poly = . + 3 /* gross, but saves jne 1b notl %ebx /* result correction */ - pop %ax - pop %dx ret #endif
CVS commit: src/sys/arch/i386/stand/mbr
Module Name:src Committed By: jakllsch Date: Sat May 19 18:18:16 UTC 2018 Modified Files: src/sys/arch/i386/stand/mbr: gpt.S Log Message: Compact crc32 code by 12 bytes of text. >From dave0 in #NetBSD on Freenode circa December 2017. Tested in a 32-bit userland harness to produce identical results as old code for one set of inputs. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/mbr/gpt.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/byacc/dist
Module Name:src Committed By: christos Date: Sat May 19 18:14:52 UTC 2018 Modified Files: src/external/bsd/byacc/dist: btyaccpar.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/byacc/dist/btyaccpar.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/byacc/dist/btyaccpar.c diff -u src/external/bsd/byacc/dist/btyaccpar.c:1.5 src/external/bsd/byacc/dist/btyaccpar.c:1.6 --- src/external/bsd/byacc/dist/btyaccpar.c:1.5 Fri May 18 21:53:24 2018 +++ src/external/bsd/byacc/dist/btyaccpar.c Sat May 19 14:14:51 2018 @@ -320,7 +320,7 @@ const char *const body_1[] = "newsize = YYMAXDEPTH;", "", "i = (int) (data->s_mark - data->s_base);", -"newss = realloc(data->s_base, newsize * sizeof(*newss));", +"newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));", "if (newss == 0)", "return YYENOMEM;", "", @@ -385,13 +385,13 @@ const char *const body_1[] = "#endif", "return p;", "}", -"p->yystack.s_base= malloc(size * sizeof(YYINT));", +"p->yystack.s_base= (YYINT *) malloc(size * sizeof(YYINT));", "if (p->yystack.s_base == NULL) return NULL;", -"p->yystack.l_base= malloc(size * sizeof(YYSTYPE));", +"p->yystack.l_base= (YYSTYPE *) malloc(size * sizeof(YYSTYPE));", "if (p->yystack.l_base == NULL) return NULL;", "memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", -"p->yystack.p_base= malloc(size * sizeof(YYLTYPE));", +"p->yystack.p_base= (YYLTYPE *) malloc(size * sizeof(YYLTYPE));", "if (p->yystack.p_base == NULL) return NULL;", "memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));", "#endif", @@ -525,10 +525,10 @@ const char *const body_3[] = "size_t s = (size_t) (yylvlim - yylvals);", "", "s += YYLVQUEUEGROWTH;", -"if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;", -"if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;", +"if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;", +"if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", -"if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;", +"if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;", "#endif", "yylvp = yylve = yylvals + p;", "yylvlim = yylvals + s;", @@ -645,7 +645,7 @@ const char *const body_3[] = "/* If this is a first conflict in the stack, start saving lexemes */", "if (!yylexemes)", "{", -"yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));", +"yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));", "if (yylexemes == NULL) goto yyenomem;", "yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));", "if (yylvals == NULL) goto yyenomem;", @@ -1068,12 +1068,12 @@ const char *const trailer[] = "size_t s = (size_t) (yylvlim - yylvals);", "", "s += YYLVQUEUEGROWTH;", -"if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL)", +"if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)", "goto yyenomem;", -"if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)", +"if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)", "goto yyenomem;", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", -"if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)", +"if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)", "goto yyenomem;", "#endif", "yylvp = yylve = yylvals + p;",
CVS commit: src/external/bsd/byacc/dist
Module Name:src Committed By: christos Date: Sat May 19 18:14:36 UTC 2018 Modified Files: src/external/bsd/byacc/dist: btyaccpar.skel Log Message: add more casts (needed for c++) XXX: A better solution would be to use C++ casts. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/byacc/dist/btyaccpar.skel Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/byacc/dist/btyaccpar.skel diff -u src/external/bsd/byacc/dist/btyaccpar.skel:1.5 src/external/bsd/byacc/dist/btyaccpar.skel:1.6 --- src/external/bsd/byacc/dist/btyaccpar.skel:1.5 Fri May 18 21:52:48 2018 +++ src/external/bsd/byacc/dist/btyaccpar.skel Sat May 19 14:14:36 2018 @@ -265,7 +265,7 @@ static int yygrowstack(YYSTACKDATA *data newsize = YYMAXDEPTH; i = (int) (data->s_mark - data->s_base); -newss = realloc(data->s_base, newsize * sizeof(*newss)); +newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return YYENOMEM; @@ -329,13 +329,13 @@ yyNewState(unsigned size) #endif return p; } -p->yystack.s_base= malloc(size * sizeof(YYINT)); +p->yystack.s_base= (YYINT *) malloc(size * sizeof(YYINT)); if (p->yystack.s_base == NULL) return NULL; -p->yystack.l_base= malloc(size * sizeof(YYSTYPE)); +p->yystack.l_base= (YYSTYPE *) malloc(size * sizeof(YYSTYPE)); if (p->yystack.l_base == NULL) return NULL; memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE)); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) -p->yystack.p_base= malloc(size * sizeof(YYLTYPE)); +p->yystack.p_base= (YYLTYPE *) malloc(size * sizeof(YYLTYPE)); if (p->yystack.p_base == NULL) return NULL; memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE)); #endif @@ -449,10 +449,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; -if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; -if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; +if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; +if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) -if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; +if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -563,7 +563,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { -yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); +yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -968,12 +968,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; -if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) +if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; -if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) +if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) -if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) +if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p;
CVS commit: src/external/bsd/byacc/dist
Module Name:src Committed By: christos Date: Sat May 19 18:14:36 UTC 2018 Modified Files: src/external/bsd/byacc/dist: btyaccpar.skel Log Message: add more casts (needed for c++) XXX: A better solution would be to use C++ casts. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/byacc/dist/btyaccpar.skel Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/byacc/dist
Module Name:src Committed By: christos Date: Sat May 19 18:14:52 UTC 2018 Modified Files: src/external/bsd/byacc/dist: btyaccpar.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/byacc/dist/btyaccpar.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tools/elftosb
Module Name:src Committed By: christos Date: Sat May 19 17:48:51 UTC 2018 Modified Files: src/tools/elftosb: Makefile Log Message: remove trailing newline To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tools/elftosb/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tools/elftosb
Module Name:src Committed By: christos Date: Sat May 19 17:48:51 UTC 2018 Modified Files: src/tools/elftosb: Makefile Log Message: remove trailing newline To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tools/elftosb/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/elftosb/Makefile diff -u src/tools/elftosb/Makefile:1.2 src/tools/elftosb/Makefile:1.3 --- src/tools/elftosb/Makefile:1.2 Tue May 1 08:38:39 2018 +++ src/tools/elftosb/Makefile Sat May 19 13:48:51 2018 @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.2 2018/05/01 12:38:39 christos Exp $ +# $NetBSD: Makefile,v 1.3 2018/05/19 17:48:51 christos Exp $ HOSTPROGNAME= ${_TOOL_PREFIX}elftosb HOSTPROG_CXX= ${_TOOL_PREFIX}elftosb HOST_SRCDIR= external/bsd/elftosb/usr.sbin/elftosb .include "${.CURDIR}/../Makefile.host" -
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Sat May 19 17:44:44 UTC 2018 Modified Files: src/share/mk: bsd.sys.mk Log Message: Need to delete ${DESTDIR} for lint XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.275 -r1.276 src/share/mk/bsd.sys.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.sys.mk diff -u src/share/mk/bsd.sys.mk:1.275 src/share/mk/bsd.sys.mk:1.276 --- src/share/mk/bsd.sys.mk:1.275 Thu Feb 1 20:02:41 2018 +++ src/share/mk/bsd.sys.mk Sat May 19 13:44:44 2018 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.sys.mk,v 1.275 2018/02/02 01:02:41 mrg Exp $ +# $NetBSD: bsd.sys.mk,v 1.276 2018/05/19 17:44:44 christos Exp $ # # Build definitions used for NetBSD source tree builds. @@ -29,6 +29,7 @@ CPPFLAGS+= -Wp,-iremap,${X11SRCDIR}:/usr REPROFLAGS+= -fdebug-prefix-map=\$$NETBSDSRCDIR=/usr/src REPROFLAGS+= -fdebug-prefix-map=\$$X11SRCDIR=/usr/xsrc LINTFLAGS+= -R${NETBSDSRCDIR}=/usr/src -R${X11SRCDIR}=/usr/xsrc +LINTFLAGS+= -R${DESTDIR}= REPROFLAGS+= -fdebug-regex-map='/usr/src/(.*)/obj.*=/usr/obj/\1' REPROFLAGS+= -fdebug-regex-map='/usr/src/(.*)/obj.*/(.*)=/usr/obj/\1/\2'
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Sat May 19 17:44:44 UTC 2018 Modified Files: src/share/mk: bsd.sys.mk Log Message: Need to delete ${DESTDIR} for lint XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.275 -r1.276 src/share/mk/bsd.sys.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jakllsch Date: Sat May 19 17:21:42 UTC 2018 Modified Files: src/sys/dev/pci: pci_map.c Log Message: Re-enable PCI window decode enable in PCI Command Register upon successful pci_mapreg_map(). Loosely related to PR #53286. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/pci_map.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jakllsch Date: Sat May 19 17:21:42 UTC 2018 Modified Files: src/sys/dev/pci: pci_map.c Log Message: Re-enable PCI window decode enable in PCI Command Register upon successful pci_mapreg_map(). Loosely related to PR #53286. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/pci_map.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/pci_map.c diff -u src/sys/dev/pci/pci_map.c:1.35 src/sys/dev/pci/pci_map.c:1.36 --- src/sys/dev/pci/pci_map.c:1.35 Sat May 19 17:18:57 2018 +++ src/sys/dev/pci/pci_map.c Sat May 19 17:21:42 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_map.c,v 1.35 2018/05/19 17:18:57 jakllsch Exp $ */ +/* $NetBSD: pci_map.c,v 1.36 2018/05/19 17:21:42 jakllsch Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.35 2018/05/19 17:18:57 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.36 2018/05/19 17:21:42 jakllsch Exp $"); #include #include @@ -43,7 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_map.c,v #include #include -bool pci_mapreg_map_enable_decode = false; +bool pci_mapreg_map_enable_decode = true; static int pci_io_find(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t type,
CVS commit: src/sys
Module Name:src Committed By: jakllsch Date: Sat May 19 17:18:57 UTC 2018 Modified Files: src/sys/arch/x86/x86: efi.c src/sys/dev/pci: pci_map.c pcivar.h Log Message: Refine previous change to enable PCI window decoding in Command Register upon mapping; conditionalize on a global variable, that is set to true on x86 machines booting under EFI. For now, initialize the global variable at compile time to false. This is intended to limit potential problems for other NetBSD ports, should this changeset be pulled up to netbsd-8. Related to PR #53286. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/x86/efi.c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/pci_map.c cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/pcivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/efi.c diff -u src/sys/arch/x86/x86/efi.c:1.14 src/sys/arch/x86/x86/efi.c:1.15 --- src/sys/arch/x86/x86/efi.c:1.14 Sun Oct 22 01:29:26 2017 +++ src/sys/arch/x86/x86/efi.c Sat May 19 17:18:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: efi.c,v 1.14 2017/10/22 01:29:26 maya Exp $ */ +/* $NetBSD: efi.c,v 1.15 2018/05/19 17:18:57 jakllsch Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.14 2017/10/22 01:29:26 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.15 2018/05/19 17:18:57 jakllsch Exp $"); #include #include @@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.14 #include #include +#include /* for pci_mapreg_map_enable_decode */ const struct uuid EFI_UUID_ACPI20 = EFI_TABLE_ACPI20; const struct uuid EFI_UUID_ACPI10 = EFI_TABLE_ACPI10; @@ -407,6 +408,7 @@ efi_init(void) return; } bootmethod_efi = true; + pci_mapreg_map_enable_decode = true; /* PR port-amd64/53286 */ } bool Index: src/sys/dev/pci/pci_map.c diff -u src/sys/dev/pci/pci_map.c:1.34 src/sys/dev/pci/pci_map.c:1.35 --- src/sys/dev/pci/pci_map.c:1.34 Wed May 16 19:02:00 2018 +++ src/sys/dev/pci/pci_map.c Sat May 19 17:18:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_map.c,v 1.34 2018/05/16 19:02:00 jakllsch Exp $ */ +/* $NetBSD: pci_map.c,v 1.35 2018/05/19 17:18:57 jakllsch Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.34 2018/05/16 19:02:00 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.35 2018/05/19 17:18:57 jakllsch Exp $"); #include #include @@ -43,6 +43,8 @@ __KERNEL_RCSID(0, "$NetBSD: pci_map.c,v #include #include +bool pci_mapreg_map_enable_decode = false; + static int pci_io_find(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t type, bus_addr_t *basep, bus_size_t *sizep, int *flagsp) @@ -293,11 +295,6 @@ pci_mapreg_submap(const struct pci_attac if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) { if ((pa->pa_flags & PCI_FLAGS_IO_OKAY) == 0) return 1; - s = splhigh(); - csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - csr |= PCI_COMMAND_IO_ENABLE; - pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr); - splx(s); if (pci_io_find(pa->pa_pc, pa->pa_tag, reg, type, , , )) return 1; @@ -305,11 +302,6 @@ pci_mapreg_submap(const struct pci_attac } else { if ((pa->pa_flags & PCI_FLAGS_MEM_OKAY) == 0) return 1; - s = splhigh(); - csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - csr |= PCI_COMMAND_MEM_ENABLE; - pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr); - splx(s); if (pci_mem_find(pa->pa_pc, pa->pa_tag, reg, type, , , )) return 1; @@ -339,6 +331,15 @@ pci_mapreg_submap(const struct pci_attac if (bus_space_map(tag, base, reqsize, busflags | flags, )) return 1; + if (pci_mapreg_map_enable_decode) { + s = splhigh(); + csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); + csr |= (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) ? + PCI_COMMAND_IO_ENABLE : PCI_COMMAND_MEM_ENABLE; + pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr); + splx(s); + } + if (tagp != NULL) *tagp = tag; if (handlep != NULL) Index: src/sys/dev/pci/pcivar.h diff -u src/sys/dev/pci/pcivar.h:1.111 src/sys/dev/pci/pcivar.h:1.112 --- src/sys/dev/pci/pcivar.h:1.111 Thu Apr 19 21:50:09 2018 +++ src/sys/dev/pci/pcivar.h Sat May 19 17:18:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pcivar.h,v 1.111 2018/04/19 21:50:09 christos Exp $ */ +/* $NetBSD: pcivar.h,v 1.112 2018/05/19 17:18:57 jakllsch Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -258,6 +258,8 @@ struct pci_softc { extern struct cfdriver pci_cd; +extern bool pci_mapreg_map_enable_decode; + int pcibusprint(void *, const char *); /*
CVS commit: src/sys
Module Name:src Committed By: jakllsch Date: Sat May 19 17:18:57 UTC 2018 Modified Files: src/sys/arch/x86/x86: efi.c src/sys/dev/pci: pci_map.c pcivar.h Log Message: Refine previous change to enable PCI window decoding in Command Register upon mapping; conditionalize on a global variable, that is set to true on x86 machines booting under EFI. For now, initialize the global variable at compile time to false. This is intended to limit potential problems for other NetBSD ports, should this changeset be pulled up to netbsd-8. Related to PR #53286. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/x86/efi.c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/pci_map.c cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/pcivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/include
Module Name:src Committed By: jakllsch Date: Sat May 19 16:55:59 UTC 2018 Modified Files: src/sys/arch/x86/include: pmap.h Log Message: remove some remaining uvm_emap(9)-related function prototypes To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/arch/x86/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/include
Module Name:src Committed By: jakllsch Date: Sat May 19 16:55:59 UTC 2018 Modified Files: src/sys/arch/x86/include: pmap.h Log Message: remove some remaining uvm_emap(9)-related function prototypes To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/arch/x86/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/include/pmap.h diff -u src/sys/arch/x86/include/pmap.h:1.78 src/sys/arch/x86/include/pmap.h:1.79 --- src/sys/arch/x86/include/pmap.h:1.78 Sat May 19 11:39:37 2018 +++ src/sys/arch/x86/include/pmap.h Sat May 19 16:55:59 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.78 2018/05/19 11:39:37 jdolecek Exp $ */ +/* $NetBSD: pmap.h,v 1.79 2018/05/19 16:55:59 jakllsch Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -317,10 +317,6 @@ void pmap_ldt_cleanup(struct lwp *); void pmap_ldt_sync(struct pmap *); void pmap_kremove_local(vaddr_t, vsize_t); -void pmap_emap_enter(vaddr_t, paddr_t, vm_prot_t); -void pmap_emap_remove(vaddr_t, vsize_t); -void pmap_emap_sync(bool); - #define __HAVE_PMAP_PV_TRACK 1 void pmap_pv_init(void); void pmap_pv_track(paddr_t, psize_t);
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: jakllsch Date: Sat May 19 16:51:32 UTC 2018 Modified Files: src/sys/arch/x86/x86: x86_tlb.c Log Message: remove more vestiges of uvm_emap_*(), to fix x86 kernel linking To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/x86_tlb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: jakllsch Date: Sat May 19 16:51:32 UTC 2018 Modified Files: src/sys/arch/x86/x86: x86_tlb.c Log Message: remove more vestiges of uvm_emap_*(), to fix x86 kernel linking To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/x86_tlb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/x86_tlb.c diff -u src/sys/arch/x86/x86/x86_tlb.c:1.1 src/sys/arch/x86/x86/x86_tlb.c:1.2 --- src/sys/arch/x86/x86/x86_tlb.c:1.1 Mon Jan 22 19:37:45 2018 +++ src/sys/arch/x86/x86/x86_tlb.c Sat May 19 16:51:32 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_tlb.c,v 1.1 2018/01/22 19:37:45 jdolecek Exp $ */ +/* $NetBSD: x86_tlb.c,v 1.2 2018/05/19 16:51:32 jakllsch Exp $ */ /*- * Copyright (c) 2008-2012 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.1 2018/01/22 19:37:45 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.2 2018/05/19 16:51:32 jakllsch Exp $"); #include #include @@ -199,7 +199,6 @@ pmap_tlb_invalidate(const pmap_tlb_packe /* Find out what we need to invalidate. */ if (tp->tp_count == (uint16_t)-1) { - u_int egen = uvm_emap_gen_return(); if (tp->tp_pte & PG_G) { /* Invalidating user and kernel TLB entries. */ tlbflushg(); @@ -207,7 +206,6 @@ pmap_tlb_invalidate(const pmap_tlb_packe /* Invalidating user TLB entries only. */ tlbflush(); } - uvm_emap_update(egen); } else { /* Invalidating a single page or a range of pages. */ for (i = tp->tp_count - 1; i >= 0; i--) {
CVS commit: src/sys/uvm
Module Name:src Committed By: jdolecek Date: Sat May 19 15:18:02 UTC 2018 Modified Files: src/sys/uvm: uvm_readahead.c Log Message: adjust heuristics for read-ahead to skip the full read-ahead when last page of the range is already cached; this speeds up I/O from cache, since it avoids the lookup and allocation overhead on my system I observed 4.5% - 15% improvement for cached I/O - from 2.2 GB/s to 2.3 GB/s for cached reads using non-direct UBC, and from 5.6 GB/s to 6.5 GB/s for UBC using direct map part of PR kern/53124 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/uvm/uvm_readahead.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_readahead.c diff -u src/sys/uvm/uvm_readahead.c:1.9 src/sys/uvm/uvm_readahead.c:1.10 --- src/sys/uvm/uvm_readahead.c:1.9 Fri Mar 30 07:22:59 2018 +++ src/sys/uvm/uvm_readahead.c Sat May 19 15:18:02 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_readahead.c,v 1.9 2018/03/30 07:22:59 mlelstv Exp $ */ +/* $NetBSD: uvm_readahead.c,v 1.10 2018/05/19 15:18:02 jdolecek Exp $ */ /*- * Copyright (c)2003, 2005, 2009 YAMAMOTO Takashi, @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_readahead.c,v 1.9 2018/03/30 07:22:59 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_readahead.c,v 1.10 2018/05/19 15:18:02 jdolecek Exp $"); #include #include @@ -125,6 +125,23 @@ ra_startio(struct uvm_object *uobj, off_ DPRINTF(("%s: uobj=%p, off=%" PRIu64 ", endoff=%" PRIu64 "\n", __func__, uobj, off, endoff)); + + /* + * Don't issue read-ahead if the last page of the range is already cached. + * The assumption is that since the access is sequential, the intermediate + * pages would have similar LRU stats, and hence likely to be still in cache + * too. This speeds up I/O using cache, since it avoids lookups and temporary + * allocations done by full pgo_get. + */ + mutex_enter(uobj->vmobjlock); + struct vm_page *pg = uvm_pagelookup(uobj, trunc_page(endoff - 1)); + mutex_exit(uobj->vmobjlock); + if (pg != NULL) { + DPRINTF(("%s: off=%" PRIu64 ", sz=%zu already cached\n", + __func__, off, sz)); + return endoff; + } + off = trunc_page(off); while (off < endoff) { const size_t chunksize = RA_IOCHUNK; @@ -147,7 +164,7 @@ ra_startio(struct uvm_object *uobj, off_ mutex_enter(uobj->vmobjlock); error = (*uobj->pgops->pgo_get)(uobj, off, NULL, - , 0, VM_PROT_READ, UVM_ADV_RANDOM, 0); + , 0, VM_PROT_READ, UVM_ADV_RANDOM, PGO_NOTIMESTAMP); DPRINTF(("%s: off=%" PRIu64 ", bytelen=%zu -> %d\n", __func__, off, bytelen, error)); if (error != 0 && error != EBUSY) {
CVS commit: src/sys/uvm
Module Name:src Committed By: jdolecek Date: Sat May 19 15:18:02 UTC 2018 Modified Files: src/sys/uvm: uvm_readahead.c Log Message: adjust heuristics for read-ahead to skip the full read-ahead when last page of the range is already cached; this speeds up I/O from cache, since it avoids the lookup and allocation overhead on my system I observed 4.5% - 15% improvement for cached I/O - from 2.2 GB/s to 2.3 GB/s for cached reads using non-direct UBC, and from 5.6 GB/s to 6.5 GB/s for UBC using direct map part of PR kern/53124 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/uvm/uvm_readahead.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys
I can make the Alpha pmap changes if someone’s willing to test them (I no longer have Alpha hardware). -- thorpej Sent from my iPhone. > On May 19, 2018, at 8:03 AM, Jaromir Dolecekwrote: > > implement the new interface for amd64; I hear alpha and mips might be > relatively > easy to add too, but I lack the knowledge
CVS commit: src/sys/uvm
Module Name:src Committed By: jdolecek Date: Sat May 19 15:13:26 UTC 2018 Modified Files: src/sys/uvm: uvm_bio.c Log Message: change code to take advantage of direct map when available, avoiding the need to map pages into kernel this improves performance of UBC-based (read(2)/write(2)) I/O especially for cached block I/O - sequential read on my NVMe goes from 1.7 GB/s to 1.9 GB/s for non-cached, and from 2.2 GB/s to 5.6 GB/s for cached read the new code is conditional now and off for now, so that it can be tested further; can be turned on by adjusting ubc_direct variable to true part of fix for PR kern/53124 To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/uvm/uvm_bio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/uvm
Module Name:src Committed By: jdolecek Date: Sat May 19 15:13:26 UTC 2018 Modified Files: src/sys/uvm: uvm_bio.c Log Message: change code to take advantage of direct map when available, avoiding the need to map pages into kernel this improves performance of UBC-based (read(2)/write(2)) I/O especially for cached block I/O - sequential read on my NVMe goes from 1.7 GB/s to 1.9 GB/s for non-cached, and from 2.2 GB/s to 5.6 GB/s for cached read the new code is conditional now and off for now, so that it can be tested further; can be turned on by adjusting ubc_direct variable to true part of fix for PR kern/53124 To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/uvm/uvm_bio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_bio.c diff -u src/sys/uvm/uvm_bio.c:1.94 src/sys/uvm/uvm_bio.c:1.95 --- src/sys/uvm/uvm_bio.c:1.94 Fri Apr 20 18:58:10 2018 +++ src/sys/uvm/uvm_bio.c Sat May 19 15:13:26 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_bio.c,v 1.94 2018/04/20 18:58:10 jdolecek Exp $ */ +/* $NetBSD: uvm_bio.c,v 1.95 2018/05/19 15:13:26 jdolecek Exp $ */ /* * Copyright (c) 1998 Chuck Silvers. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.94 2018/04/20 18:58:10 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.95 2018/05/19 15:13:26 jdolecek Exp $"); #include "opt_uvmhist.h" #include "opt_ubc.h" @@ -48,9 +48,9 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v #include -/* - * global data structures - */ +#ifdef PMAP_DIRECT +# define UBC_USE_PMAP_DIRECT +#endif /* * local functions @@ -59,6 +59,13 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v static int ubc_fault(struct uvm_faultinfo *, vaddr_t, struct vm_page **, int, int, vm_prot_t, int); static struct ubc_map *ubc_find_mapping(struct uvm_object *, voff_t); +#ifdef UBC_USE_PMAP_DIRECT +static int __noinline ubc_uiomove_direct(struct uvm_object *, struct uio *, vsize_t, + int, int); +static void __noinline ubc_zerorange_direct(struct uvm_object *, off_t, size_t, int); + +bool ubc_direct = false; /* XXX */ +#endif /* * local data structues @@ -149,15 +156,12 @@ UBC_EVCNT_DEFINE(faultbusy) void ubc_init(void) { - struct ubc_map *umap; - vaddr_t va; - int i; - /* * Make sure ubc_winshift is sane. */ if (ubc_winshift < PAGE_SHIFT) ubc_winshift = PAGE_SHIFT; + ubc_winsize = 1 << ubc_winshift; /* * init ubc_object. @@ -174,10 +178,7 @@ ubc_init(void) if (ubc_object.umap == NULL) panic("ubc_init: failed to allocate ubc_map"); - if (ubc_winshift < PAGE_SHIFT) { - ubc_winshift = PAGE_SHIFT; - } - va = (vaddr_t)1L; + vaddr_t va = (vaddr_t)1L; #ifdef PMAP_PREFER PMAP_PREFER(0, , 0, 0); /* kernel is never topdown */ ubc_nqueues = va >> ubc_winshift; @@ -185,13 +186,13 @@ ubc_init(void) ubc_nqueues = 1; } #endif - ubc_winsize = 1 << ubc_winshift; ubc_object.inactive = kmem_alloc(UBC_NQUEUES * sizeof(struct ubc_inactive_head), KM_SLEEP); - for (i = 0; i < UBC_NQUEUES; i++) { + for (int i = 0; i < UBC_NQUEUES; i++) { TAILQ_INIT(_object.inactive[i]); } - for (i = 0; i < ubc_nwins; i++) { + for (int i = 0; i < ubc_nwins; i++) { + struct ubc_map *umap; umap = _object.umap[i]; TAILQ_INSERT_TAIL(_object.inactive[i & (UBC_NQUEUES - 1)], umap, inactive); @@ -199,7 +200,7 @@ ubc_init(void) ubc_object.hash = hashinit(ubc_nwins, HASH_LIST, true, _object.hashmask); - for (i = 0; i <= ubc_object.hashmask; i++) { + for (int i = 0; i <= ubc_object.hashmask; i++) { LIST_INIT(_object.hash[i]); } @@ -562,6 +563,7 @@ again: (uintptr_t)umap, umap->refcount, (uintptr_t)va, flags); if (flags & UBC_FAULTBUSY) { + // XXX add offset from slot_offset? int npages = (*lenp + PAGE_SIZE - 1) >> PAGE_SHIFT; struct vm_page *pgs[npages]; int gpflags = @@ -732,6 +734,12 @@ ubc_uiomove(struct uvm_object *uobj, str KASSERT(((flags & UBC_WRITE) != 0 && uio->uio_rw == UIO_WRITE) || ((flags & UBC_READ) != 0 && uio->uio_rw == UIO_READ)); +#ifdef UBC_USE_PMAP_DIRECT + if (ubc_direct) { + return ubc_uiomove_direct(uobj, uio, todo, advice, flags); + } +#endif + off = uio->uio_offset; error = 0; while (todo > 0) { @@ -769,13 +777,20 @@ ubc_uiomove(struct uvm_object *uobj, str void ubc_zerorange(struct uvm_object *uobj, off_t off, size_t len, int flags) { - void *win; + +#ifdef UBC_USE_PMAP_DIRECT + if (ubc_direct) { + ubc_zerorange_direct(uobj, off, len, flags); + return; + } +#endif /* * XXXUBC invent kzero() and use it */ while (len) { + void *win; vsize_t bytelen = len; win = ubc_alloc(uobj, off, , UVM_ADV_NORMAL, UBC_WRITE); @@ -787,6 +802,196 @@ ubc_zerorange(struct uvm_object *uobj, o } } +#ifdef UBC_USE_PMAP_DIRECT +/* Copy data using direct map */ + +/* + * ubc_alloc_direct: allocate a file mapping window using direct map + */ +static int
CVS commit: src/sys
Module Name:src Committed By: jdolecek Date: Sat May 19 15:03:26 UTC 2018 Modified Files: src/sys/arch/amd64/include: pmap.h src/sys/uvm: uvm_page.c uvm_page.h uvm_pmap.h Log Message: add experimental new function uvm_direct_process(), to allow of read/writes of contents of uvm pages without mapping them into kernel, using direct map or moral equivalent; pmaps supporting the interface need to provide pmap_direct_process() and define PMAP_DIRECT implement the new interface for amd64; I hear alpha and mips might be relatively easy to add too, but I lack the knowledge part of resolution for PR kern/53124 To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amd64/include/pmap.h cvs rdiff -u -r1.197 -r1.198 src/sys/uvm/uvm_page.c cvs rdiff -u -r1.82 -r1.83 src/sys/uvm/uvm_page.h cvs rdiff -u -r1.38 -r1.39 src/sys/uvm/uvm_pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/include/pmap.h diff -u src/sys/arch/amd64/include/pmap.h:1.45 src/sys/arch/amd64/include/pmap.h:1.46 --- src/sys/arch/amd64/include/pmap.h:1.45 Thu Feb 22 13:27:18 2018 +++ src/sys/arch/amd64/include/pmap.h Sat May 19 15:03:26 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.45 2018/02/22 13:27:18 maxv Exp $ */ +/* $NetBSD: pmap.h,v 1.46 2018/05/19 15:03:26 jdolecek Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -318,6 +318,20 @@ pmap_pte_flush(void) } #endif +#ifdef __HAVE_DIRECT_MAP +#define PMAP_DIRECT + +static __inline int +pmap_direct_process(paddr_t pa, voff_t pgoff, size_t len, +int (*process)(void *, size_t, void *), void *arg) +{ + vaddr_t va = PMAP_DIRECT_MAP(pa); + + return process((void *)(va + pgoff), len, arg); +} + +#endif /* __HAVE_DIRECT_MAP */ + void pmap_changeprot_local(vaddr_t, vm_prot_t); #include Index: src/sys/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.197 src/sys/uvm/uvm_page.c:1.198 --- src/sys/uvm/uvm_page.c:1.197 Sat May 19 11:02:33 2018 +++ src/sys/uvm/uvm_page.c Sat May 19 15:03:26 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.197 2018/05/19 11:02:33 jdolecek Exp $ */ +/* $NetBSD: uvm_page.c,v 1.198 2018/05/19 15:03:26 jdolecek Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.197 2018/05/19 11:02:33 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.198 2018/05/19 15:03:26 jdolecek Exp $"); #include "opt_ddb.h" #include "opt_uvm.h" @@ -1758,6 +1758,51 @@ uvm_page_locked_p(struct vm_page *pg) return true; } +#ifdef PMAP_DIRECT +/* + * Call pmap to translate physical address into a virtual and to run a callback + * for it. Used to avoid actually mapping the pages, pmap most likely uses direct map + * or equivalent. + */ +int +uvm_direct_process(struct vm_page **pgs, u_int npages, voff_t off, vsize_t len, +int (*process)(void *, size_t, void *), void *arg) +{ + int error = 0; + paddr_t pa; + size_t todo; + voff_t pgoff = (off & PAGE_MASK); + struct vm_page *pg; + + KASSERT(npages > 0 && len > 0); + + for (int i = 0; i < npages; i++) { + pg = pgs[i]; + + KASSERT(len > 0); + + /* + * Caller is responsible for ensuring all the pages are + * available. + */ + KASSERT(pg != NULL && pg != PGO_DONTCARE); + + pa = VM_PAGE_TO_PHYS(pg); + todo = MIN(len, PAGE_SIZE - pgoff); + + error = pmap_direct_process(pa, pgoff, todo, process, arg); + if (error) + break; + + pgoff = 0; + len -= todo; + } + + KASSERTMSG(error != 0 || len == 0, "len %lu != 0 for non-error", len); + return error; +} +#endif /* PMAP_DIRECT */ + #if defined(DDB) || defined(DEBUGPRINT) /* Index: src/sys/uvm/uvm_page.h diff -u src/sys/uvm/uvm_page.h:1.82 src/sys/uvm/uvm_page.h:1.83 --- src/sys/uvm/uvm_page.h:1.82 Tue Nov 14 06:43:23 2017 +++ src/sys/uvm/uvm_page.h Sat May 19 15:03:26 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.h,v 1.82 2017/11/14 06:43:23 mrg Exp $ */ +/* $NetBSD: uvm_page.h,v 1.83 2018/05/19 15:03:26 jdolecek Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -336,6 +336,11 @@ int uvm_page_lookup_freelist(struct vm_p struct vm_page *uvm_phys_to_vm_page(paddr_t); paddr_t uvm_vm_page_to_phys(const struct vm_page *); +#if defined(PMAP_DIRECT) +int uvm_direct_process(struct vm_page **, u_int, voff_t, vsize_t, + int (*)(void *, size_t, void *), void *); +#endif + /* * macros */ Index: src/sys/uvm/uvm_pmap.h diff -u src/sys/uvm/uvm_pmap.h:1.38 src/sys/uvm/uvm_pmap.h:1.39 --- src/sys/uvm/uvm_pmap.h:1.38 Sat Feb 2 14:06:58 2013 +++ src/sys/uvm/uvm_pmap.h Sat May 19 15:03:26 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_pmap.h,v 1.38 2013/02/02 14:06:58 matt Exp $ */ +/* $NetBSD: uvm_pmap.h,v 1.39 2018/05/19 15:03:26 jdolecek Exp $ */ /* * Copyright (c) 1991, 1993 @@ -212,6 +212,13 @@ vaddr_t
CVS commit: src/sys
Module Name:src Committed By: jdolecek Date: Sat May 19 15:03:26 UTC 2018 Modified Files: src/sys/arch/amd64/include: pmap.h src/sys/uvm: uvm_page.c uvm_page.h uvm_pmap.h Log Message: add experimental new function uvm_direct_process(), to allow of read/writes of contents of uvm pages without mapping them into kernel, using direct map or moral equivalent; pmaps supporting the interface need to provide pmap_direct_process() and define PMAP_DIRECT implement the new interface for amd64; I hear alpha and mips might be relatively easy to add too, but I lack the knowledge part of resolution for PR kern/53124 To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amd64/include/pmap.h cvs rdiff -u -r1.197 -r1.198 src/sys/uvm/uvm_page.c cvs rdiff -u -r1.82 -r1.83 src/sys/uvm/uvm_page.h cvs rdiff -u -r1.38 -r1.39 src/sys/uvm/uvm_pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: thorpej Date: Sat May 19 14:15:40 UTC 2018 Modified Files: src/distrib/sets/lists/man: mi src/distrib/sets/lists/modules: mi src/share/man/man4: Makefile src/sys/dev/gpio: files.gpio src/sys/modules: Makefile Added Files: src/share/man/man4: gpioirq.4 src/sys/dev/gpio: gpioirq.c src/sys/modules/gpioirq: Makefile gpioirq.ioconf Log Message: Add an example "gpioirq" driver that demonstrates interrupts on GPIO pins. Will be enhanced in the future to support sending events to user space on edge-triggered interrupt events. Based on initial work by Brad Spencer. PR kern/51676 To generate a diff of this commit: cvs rdiff -u -r1.1586 -r1.1587 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.114 -r1.115 src/distrib/sets/lists/modules/mi cvs rdiff -u -r1.652 -r1.653 src/share/man/man4/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man4/gpioirq.4 cvs rdiff -u -r1.14 -r1.15 src/sys/dev/gpio/files.gpio cvs rdiff -u -r0 -r1.1 src/sys/dev/gpio/gpioirq.c cvs rdiff -u -r1.202 -r1.203 src/sys/modules/Makefile cvs rdiff -u -r0 -r1.1 src/sys/modules/gpioirq/Makefile \ src/sys/modules/gpioirq/gpioirq.ioconf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1586 src/distrib/sets/lists/man/mi:1.1587 --- src/distrib/sets/lists/man/mi:1.1586 Tue May 15 00:54:01 2018 +++ src/distrib/sets/lists/man/mi Sat May 19 14:15:39 2018 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1586 2018/05/15 00:54:01 nat Exp $ +# $NetBSD: mi,v 1.1587 2018/05/19 14:15:39 thorpej Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -1123,6 +1123,7 @@ ./usr/share/man/cat4/gpioiic.0 man-sys-catman .cat ./usr/share/man/cat4/gpiolock.0 man-sys-catman .cat ./usr/share/man/cat4/gpioow.0 man-sys-catman .cat +./usr/share/man/cat4/gpioirq.0 man-sys-catman .cat ./usr/share/man/cat4/gpiopwm.0 man-sys-catman .cat ./usr/share/man/cat4/gpiosim.0 man-sys-catman .cat ./usr/share/man/cat4/gre.0 man-sys-catman .cat @@ -4263,6 +4264,7 @@ ./usr/share/man/html4/gpioiic.html man-sys-htmlman html ./usr/share/man/html4/gpiolock.html man-sys-htmlman html ./usr/share/man/html4/gpioow.html man-sys-htmlman html +./usr/share/man/html4/gpioirq.html man-sys-htmlman html ./usr/share/man/html4/gpiopwm.html man-sys-htmlman html ./usr/share/man/html4/gpiosim.html man-sys-htmlman html ./usr/share/man/html4/gre.html man-sys-htmlman html @@ -7177,6 +7179,7 @@ ./usr/share/man/man4/gpioiic.4 man-sys-man .man ./usr/share/man/man4/gpiolock.4 man-sys-man .man ./usr/share/man/man4/gpioow.4 man-sys-man .man +./usr/share/man/man4/gpioirq.4 man-sys-man .man ./usr/share/man/man4/gpiopwm.4 man-sys-man .man ./usr/share/man/man4/gpiosim.4 man-sys-man .man ./usr/share/man/man4/gre.4 man-sys-man .man Index: src/distrib/sets/lists/modules/mi diff -u src/distrib/sets/lists/modules/mi:1.114 src/distrib/sets/lists/modules/mi:1.115 --- src/distrib/sets/lists/modules/mi:1.114 Tue Jan 9 03:31:14 2018 +++ src/distrib/sets/lists/modules/mi Sat May 19 14:15:39 2018 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.114 2018/01/09 03:31:14 christos Exp $ +# $NetBSD: mi,v 1.115 2018/05/19 14:15:39 thorpej Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -132,6 +132,8 @@ ./@MODULEDIR@/gpio/gpio.kmod base-kernel-modules kmod ./@MODULEDIR@/gpioiicbase-kernel-modules kmod ./@MODULEDIR@/gpioiic/gpioiic.kmod base-kernel-modules kmod +./@MODULEDIR@/gpioirqbase-kernel-modules kmod +./@MODULEDIR@/gpioirq/gpioirq.kmod base-kernel-modules kmod ./@MODULEDIR@/gpioowbase-kernel-modules kmod ./@MODULEDIR@/gpioow/gpioow.kmod base-kernel-modules kmod ./@MODULEDIR@/gpiosimbase-kernel-modules kmod Index: src/share/man/man4/Makefile diff -u src/share/man/man4/Makefile:1.652 src/share/man/man4/Makefile:1.653 --- src/share/man/man4/Makefile:1.652 Wed May 9 08:22:53 2018 +++ src/share/man/man4/Makefile Sat May 19 14:15:39 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.652 2018/05/09 08:22:53 msaitoh Exp $ +# $NetBSD: Makefile,v 1.653 2018/05/19 14:15:39 thorpej Exp $ # @(#)Makefile 8.1 (Berkeley) 6/18/93 MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \ @@ -26,8 +26,8 @@ MAN= aac.4 ac97.4 acardide.4 aceride.4 a fast_ipsec.4 fd.4 filemon.4 finsio.4 flash.4 fpa.4 fms.4 fss.4 \ fujbp.4 full.4 fxp.4 \ gcscaudio.4 gem.4 genfb.4 gentbi.4 geodeide.4 \ - glxtphy.4 gpib.4 gpio.4 gpiolock.4 gpiopwm.4 gpiosim.4 gre.4 \ - gphyter.4 gsip.4 \ + glxtphy.4 gpib.4 gpio.4 gpioirq.4 gpiolock.4 gpiopwm.4 \ + gpiosim.4 gre.4 gphyter.4 gsip.4 \ hdaudio.4 hifn.4 hme.4 hpacel.4 hpqlb.4 hptide.4 hythygtemp.4 \ ibmcd.4 ibmhawk.4 ichsmb.4 icmp.4 icp.4 icsphy.4 iee.4 ieee80211.4 \ ifmedia.4 igmafb.4 igphy.4 igsfb.4 iha.4 ihidev.4
CVS commit: src
Module Name:src Committed By: thorpej Date: Sat May 19 14:15:40 UTC 2018 Modified Files: src/distrib/sets/lists/man: mi src/distrib/sets/lists/modules: mi src/share/man/man4: Makefile src/sys/dev/gpio: files.gpio src/sys/modules: Makefile Added Files: src/share/man/man4: gpioirq.4 src/sys/dev/gpio: gpioirq.c src/sys/modules/gpioirq: Makefile gpioirq.ioconf Log Message: Add an example "gpioirq" driver that demonstrates interrupts on GPIO pins. Will be enhanced in the future to support sending events to user space on edge-triggered interrupt events. Based on initial work by Brad Spencer. PR kern/51676 To generate a diff of this commit: cvs rdiff -u -r1.1586 -r1.1587 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.114 -r1.115 src/distrib/sets/lists/modules/mi cvs rdiff -u -r1.652 -r1.653 src/share/man/man4/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man4/gpioirq.4 cvs rdiff -u -r1.14 -r1.15 src/sys/dev/gpio/files.gpio cvs rdiff -u -r0 -r1.1 src/sys/dev/gpio/gpioirq.c cvs rdiff -u -r1.202 -r1.203 src/sys/modules/Makefile cvs rdiff -u -r0 -r1.1 src/sys/modules/gpioirq/Makefile \ src/sys/modules/gpioirq/gpioirq.ioconf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Sat May 19 14:11:30 UTC 2018 Modified Files: src/share/mk: bsd.obj.mk Log Message: Prevent 'make obj' creating an objdir inside an objdir. This happens the second time we call 'make obj' in /usr/src/rescue with MAKEOBJDIR set. XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/share/mk/bsd.obj.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.obj.mk diff -u src/share/mk/bsd.obj.mk:1.51 src/share/mk/bsd.obj.mk:1.52 --- src/share/mk/bsd.obj.mk:1.51 Sat Dec 10 18:12:39 2016 +++ src/share/mk/bsd.obj.mk Sat May 19 10:11:30 2018 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.obj.mk,v 1.51 2016/12/10 23:12:39 christos Exp $ +# $NetBSD: bsd.obj.mk,v 1.52 2018/05/19 14:11:30 christos Exp $ .if !defined(_BSD_OBJ_MK_) _BSD_OBJ_MK_=1 @@ -27,6 +27,7 @@ obj: exit 1; \ fi; .endif +.if ${.CURDIR} == ${.OBJDIR} @if [ ! -d ${__objdir} ]; then \ mkdir -p ${__objdir}; \ if [ ! -d ${__objdir} ]; then \ @@ -34,6 +35,7 @@ obj: fi; \ ${_MKSHMSG} " objdir ${__objdir}"; \ fi +.endif .else PAWD?= /bin/pwd
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Sat May 19 14:11:30 UTC 2018 Modified Files: src/share/mk: bsd.obj.mk Log Message: Prevent 'make obj' creating an objdir inside an objdir. This happens the second time we call 'make obj' in /usr/src/rescue with MAKEOBJDIR set. XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/share/mk/bsd.obj.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/arm/broadcom
Module Name:src Committed By: thorpej Date: Sat May 19 14:02:10 UTC 2018 Modified Files: src/sys/arch/arm/broadcom: bcm2835_gpio.c Log Message: Add support for interrupts on GPIO pins. We support both FDT-driven interrupt registration as well as the new GPIO interrupt interface. Based on initial work by Brad Spencer. PR kern/51676 To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/broadcom/bcm2835_gpio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/arm/broadcom
Module Name:src Committed By: thorpej Date: Sat May 19 14:02:10 UTC 2018 Modified Files: src/sys/arch/arm/broadcom: bcm2835_gpio.c Log Message: Add support for interrupts on GPIO pins. We support both FDT-driven interrupt registration as well as the new GPIO interrupt interface. Based on initial work by Brad Spencer. PR kern/51676 To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/broadcom/bcm2835_gpio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/broadcom/bcm2835_gpio.c diff -u src/sys/arch/arm/broadcom/bcm2835_gpio.c:1.6 src/sys/arch/arm/broadcom/bcm2835_gpio.c:1.7 --- src/sys/arch/arm/broadcom/bcm2835_gpio.c:1.6 Sun Dec 10 21:38:26 2017 +++ src/sys/arch/arm/broadcom/bcm2835_gpio.c Sat May 19 14:02:10 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_gpio.c,v 1.6 2017/12/10 21:38:26 skrll Exp $ */ +/* $NetBSD: bcm2835_gpio.c,v 1.7 2018/05/19 14:02:10 thorpej Exp $ */ /*- * Copyright (c) 2013, 2014, 2017 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.6 2017/12/10 21:38:26 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.7 2018/05/19 14:02:10 thorpej Exp $"); /* * Driver for BCM2835 GPIO @@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio #include #include #include +#include #include #include @@ -66,6 +67,29 @@ int bcm2835gpiodebug = 3; #define BCMGPIO_MAXPINS 54 +struct bcmgpio_eint { + int (*eint_func)(void *); + void *eint_arg; + int eint_flags; + int eint_bank; + int eint_num; +}; + +#define BCMGPIO_INTR_POS_EDGE 0x01 +#define BCMGPIO_INTR_NEG_EDGE 0x02 +#define BCMGPIO_INTR_HIGH_LEVEL 0x04 +#define BCMGPIO_INTR_LOW_LEVEL 0x08 +#define BCMGPIO_INTR_MPSAFE 0x10 + +struct bcmgpio_softc; +struct bcmgpio_bank { + struct bcmgpio_softc *sc_bcm; + void *sc_ih; + struct bcmgpio_eint sc_eint[32]; + int sc_bankno; +}; +#define BCMGPIO_NBANKS 2 + struct bcmgpio_softc { device_t sc_dev; bus_space_tag_t sc_iot; @@ -74,6 +98,9 @@ struct bcmgpio_softc { kmutex_t sc_lock; gpio_pin_t sc_gpio_pins[BCMGPIO_MAXPINS]; + + /* For interrupt support. */ + struct bcmgpio_bank sc_banks[BCMGPIO_NBANKS]; }; struct bcmgpio_pin { @@ -90,6 +117,13 @@ static int bcm2835gpio_gpio_pin_read(voi static void bcm2835gpio_gpio_pin_write(void *, int, int); static void bcm2835gpio_gpio_pin_ctl(void *, int, int); +static void * bcmgpio_gpio_intr_establish(void *, int, int, int, + int (*)(void *), void *); +static void bcmgpio_gpio_intr_disestablish(void *, void *); +static bool bcmgpio_gpio_intrstr(void *, int, int, char *, size_t); + +static int bcmgpio_intr(void *); + u_int bcm283x_pin_getfunc(const struct bcmgpio_softc * const, u_int); void bcm283x_pin_setfunc(const struct bcmgpio_softc * const, u_int, u_int); @@ -110,6 +144,17 @@ static struct fdtbus_gpio_controller_fun .write = bcmgpio_fdt_write }; +static void * bcmgpio_fdt_intr_establish(device_t, u_int *, int, int, + int (*func)(void *), void *); +static void bcmgpio_fdt_intr_disestablish(device_t, void *); +static bool bcmgpio_fdt_intrstr(device_t, u_int *, char *, size_t); + +static struct fdtbus_interrupt_controller_func bcmgpio_fdt_intrfuncs = { + .establish = bcmgpio_fdt_intr_establish, + .disestablish = bcmgpio_fdt_intr_disestablish, + .intrstr = bcmgpio_fdt_intrstr, +}; + CFATTACH_DECL_NEW(bcmgpio, sizeof(struct bcmgpio_softc), bcmgpio_match, bcmgpio_attach, NULL, NULL); @@ -208,6 +253,7 @@ bcmgpio_attach(device_t parent, device_t u_int func; int error; int pin; + int bank; const int phandle = faa->faa_phandle; if (fdtbus_get_reg(phandle, 0, , ) != 0) { @@ -238,10 +284,18 @@ bcmgpio_attach(device_t parent, device_t if (func == BCM2835_GPIO_IN || func == BCM2835_GPIO_OUT) { + /* XXX TRISTATE? Really? */ sc->sc_gpio_pins[pin].pin_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_PUSHPULL | GPIO_PIN_TRISTATE | GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN; + sc->sc_gpio_pins[pin].pin_intrcaps = +GPIO_INTR_POS_EDGE | +GPIO_INTR_NEG_EDGE | +GPIO_INTR_DOUBLE_EDGE | +GPIO_INTR_HIGH_LEVEL | +GPIO_INTR_LOW_LEVEL | +GPIO_INTR_MPSAFE; /* read initial state */ sc->sc_gpio_pins[pin].pin_state = bcm2835gpio_gpio_pin_read(sc, pin); @@ -253,19 +307,33 @@ bcmgpio_attach(device_t parent, device_t } } - /* create controller tag */ - sc->sc_gpio_gc.gp_cookie = sc; - sc->sc_gpio_gc.gp_pin_read = bcm2835gpio_gpio_pin_read; - sc->sc_gpio_gc.gp_pin_write = bcm2835gpio_gpio_pin_write; - sc->sc_gpio_gc.gp_pin_ctl = bcm2835gpio_gpio_pin_ctl; + /* Initialize interrupts. */ + for (bank = 0; bank < BCMGPIO_NBANKS; bank++) { + char intrstr[128]; - gba.gba_gc = >sc_gpio_gc; - for (pin = 0; pin < BCMGPIO_MAXPINS;) { - const int npins = MIN(BCMGPIO_MAXPINS - pin, 32); -
CVS commit: src
Module Name:src Committed By: thorpej Date: Sat May 19 13:59:07 UTC 2018 Modified Files: src/share/man/man4: gpio.4 src/sys/dev/gpio: gpio.c gpiovar.h src/sys/sys: gpio.h src/usr.sbin/gpioctl: gpioctl.c Log Message: Overhaul of GPIO interrupt support (that wasn't even used by anything). - Remove the old, not-expressive-enough interrupt flags, and replace them with a new set of interrupt-specific flags that can express a wide variety of interrupt configurations (pos, neg, and double-edge, high and low level). - Remove old, unused gpio_pin_ctl_intr() and gpio_pin_irqen(), and replace them with gpio_intr_establish(), gpio_intr_disestablish(), and gpio_intr_str(). Corresponding fields in the gpio_chipset_tag are also added for back-end controllers, which now handle the actual dispatch of GPIO interrupts in order to properly support level-triggered interrupts as well as interoperate properly with FDT-registered interrupts. Piggy-back on the 8.99.18 version bump. Inspired by initial work from Brad Spencer. PR kern/51676 To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/share/man/man4/gpio.4 cvs rdiff -u -r1.60 -r1.61 src/sys/dev/gpio/gpio.c cvs rdiff -u -r1.17 -r1.18 src/sys/dev/gpio/gpiovar.h cvs rdiff -u -r1.15 -r1.16 src/sys/sys/gpio.h cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/gpioctl/gpioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/gpio.4 diff -u src/share/man/man4/gpio.4:1.32 src/share/man/man4/gpio.4:1.33 --- src/share/man/man4/gpio.4:1.32 Tue Feb 20 09:37:56 2018 +++ src/share/man/man4/gpio.4 Sat May 19 13:59:06 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: gpio.4,v 1.32 2018/02/20 09:37:56 wiz Exp $ +.\" $NetBSD: gpio.4,v 1.33 2018/05/19 13:59:06 thorpej Exp $ .\" $OpenBSD: gpio.4,v 1.5 2004/11/23 09:39:29 reyk Exp $ .\" .\" Copyright (c) 2004 Alexander Yurchenko@@ -167,12 +167,6 @@ pulsate output .It Dv GPIO_PIN_ALT0 - .It Dv GPIO_PIN_ALT7 select alternate pin function 0 to 7 -.It Dv GPIO_PIN_EVENTS -deliver events -.It Dv GPIO_PIN_LEVEL -trigger on pin level instead of edge -.It Dv GPIO_PIN_FALLING -trigger on falling instead of rising edge .El .Pp Note that the GPIO controller Index: src/sys/dev/gpio/gpio.c diff -u src/sys/dev/gpio/gpio.c:1.60 src/sys/dev/gpio/gpio.c:1.61 --- src/sys/dev/gpio/gpio.c:1.60 Sat Oct 28 04:53:56 2017 +++ src/sys/dev/gpio/gpio.c Sat May 19 13:59:06 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: gpio.c,v 1.60 2017/10/28 04:53:56 riastradh Exp $ */ +/* $NetBSD: gpio.c,v 1.61 2018/05/19 13:59:06 thorpej Exp $ */ /* $OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $ */ /* @@ -19,7 +19,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.60 2017/10/28 04:53:56 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.61 2018/05/19 13:59:06 thorpej Exp $"); /* * General Purpose Input/Output framework. @@ -310,28 +310,6 @@ gpiobus_print(void *aux, const char *pnp return UNCONF; } -/* called from backends when a interrupt even occurs */ -void -gpio_intr(device_t self, uint32_t evts) -{ - struct gpio_softc *sc = device_private(self); - void (*callback)(void *); - void *callback_arg; - - for (int i = 0; i < sc->sc_npins; i++) { - if (evts & (1 << i)) { - mutex_enter(>sc_mtx); - callback = sc->sc_pins[i].pin_callback; - callback_arg = sc->sc_pins[i].pin_callback_arg; - DPRINTFN(2, ("gpio pin %d event callback %p\n", i, callback)); - if (callback != NULL) { -callback(callback_arg); - } - mutex_exit(>sc_mtx); - } - } -} - void * gpio_find_device(const char *name) { @@ -426,54 +404,183 @@ gpio_pin_write(void *gpio, struct gpio_p sc->sc_pins[map->pm_map[pin]].pin_state = value; } +int +gpio_pin_get_conf(void *gpio, struct gpio_pinmap *map, int pin) +{ + struct gpio_softc *sc = gpio; + int rv; + + mutex_enter(>sc_mtx); + rv = sc->sc_pins[map->pm_map[pin]].pin_flags; + mutex_exit(>sc_mtx); + + return (rv); +} + +bool +gpio_pin_set_conf(void *gpio, struct gpio_pinmap *map, int pin, int flags) +{ + struct gpio_softc *sc = gpio; + int checkflags = flags & GPIO_PIN_HWCAPS; + + if ((sc->sc_pins[map->pm_map[pin]].pin_caps & checkflags) != checkflags) + return (false); + + gpio_pin_ctl(gpio, map, pin, flags); + + return (true); +} + void gpio_pin_ctl(void *gpio, struct gpio_pinmap *map, int pin, int flags) { struct gpio_softc *sc = gpio; - struct gpio_pin *pinp = >sc_pins[map->pm_map[pin]]; - KASSERT((flags & GPIO_PIN_EVENTS) == 0); + /* loosey-goosey version of gpio_pin_set_conf(). */ + mutex_enter(>sc_mtx); gpiobus_pin_ctl(sc->sc_gc, map->pm_map[pin], flags); - pinp->pin_callback = NULL; - pinp->pin_callback_arg = NULL; + sc->sc_pins[map->pm_map[pin]].pin_flags = flags; mutex_exit(>sc_mtx); } int -gpio_pin_ctl_intr(void *gpio, struct gpio_pinmap *map, int pin, int flags, -int ipl, void (*callback)(void *),
CVS commit: src
Module Name:src Committed By: thorpej Date: Sat May 19 13:59:07 UTC 2018 Modified Files: src/share/man/man4: gpio.4 src/sys/dev/gpio: gpio.c gpiovar.h src/sys/sys: gpio.h src/usr.sbin/gpioctl: gpioctl.c Log Message: Overhaul of GPIO interrupt support (that wasn't even used by anything). - Remove the old, not-expressive-enough interrupt flags, and replace them with a new set of interrupt-specific flags that can express a wide variety of interrupt configurations (pos, neg, and double-edge, high and low level). - Remove old, unused gpio_pin_ctl_intr() and gpio_pin_irqen(), and replace them with gpio_intr_establish(), gpio_intr_disestablish(), and gpio_intr_str(). Corresponding fields in the gpio_chipset_tag are also added for back-end controllers, which now handle the actual dispatch of GPIO interrupts in order to properly support level-triggered interrupts as well as interoperate properly with FDT-registered interrupts. Piggy-back on the 8.99.18 version bump. Inspired by initial work from Brad Spencer. PR kern/51676 To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/share/man/man4/gpio.4 cvs rdiff -u -r1.60 -r1.61 src/sys/dev/gpio/gpio.c cvs rdiff -u -r1.17 -r1.18 src/sys/dev/gpio/gpiovar.h cvs rdiff -u -r1.15 -r1.16 src/sys/sys/gpio.h cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/gpioctl/gpioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/sys
Module Name:src Committed By: jdolecek Date: Sat May 19 11:40:22 UTC 2018 Modified Files: src/sys/sys: param.h Log Message: bump version to 8.99.18 - emap removal To generate a diff of this commit: cvs rdiff -u -r1.562 -r1.563 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: jdolecek Date: Sat May 19 11:39:37 UTC 2018 Modified Files: src/sys/arch/x86/include: pmap.h src/sys/arch/x86/x86: pmap.c src/sys/kern: kern_synch.c sys_pipe.c src/sys/sys: pipe.h src/sys/uvm: files.uvm uvm_extern.h uvm_init.c Removed Files: src/sys/uvm: uvm_emap.c Log Message: Remove emap support. Unfortunately it never got to state where it would be used and usable, due to reliability and limited & complicated MD support. Going forward, we need to concentrate on interface which do not map anything into kernel in first place (such as direct map or KVA-less I/O), rather than making those mappings cheaper to do. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/include/pmap.h cvs rdiff -u -r1.289 -r1.290 src/sys/arch/x86/x86/pmap.c cvs rdiff -u -r1.314 -r1.315 src/sys/kern/kern_synch.c cvs rdiff -u -r1.144 -r1.145 src/sys/kern/sys_pipe.c cvs rdiff -u -r1.33 -r1.34 src/sys/sys/pipe.h cvs rdiff -u -r1.28 -r1.29 src/sys/uvm/files.uvm cvs rdiff -u -r1.13 -r0 src/sys/uvm/uvm_emap.c cvs rdiff -u -r1.211 -r1.212 src/sys/uvm/uvm_extern.h cvs rdiff -u -r1.48 -r1.49 src/sys/uvm/uvm_init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/sys
Module Name:src Committed By: jdolecek Date: Sat May 19 11:40:22 UTC 2018 Modified Files: src/sys/sys: param.h Log Message: bump version to 8.99.18 - emap removal To generate a diff of this commit: cvs rdiff -u -r1.562 -r1.563 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.562 src/sys/sys/param.h:1.563 --- src/sys/sys/param.h:1.562 Wed May 9 19:55:35 2018 +++ src/sys/sys/param.h Sat May 19 11:40:22 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.562 2018/05/09 19:55:35 kre Exp $ */ +/* $NetBSD: param.h,v 1.563 2018/05/19 11:40:22 jdolecek Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -67,7 +67,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 899001700 /* NetBSD 8.99.17 */ +#define __NetBSD_Version__ 899001800 /* NetBSD 8.99.18 */ #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \ (m) * 100) + (p) * 100) <= __NetBSD_Version__)
CVS commit: src/sys
Module Name:src Committed By: jdolecek Date: Sat May 19 11:39:37 UTC 2018 Modified Files: src/sys/arch/x86/include: pmap.h src/sys/arch/x86/x86: pmap.c src/sys/kern: kern_synch.c sys_pipe.c src/sys/sys: pipe.h src/sys/uvm: files.uvm uvm_extern.h uvm_init.c Removed Files: src/sys/uvm: uvm_emap.c Log Message: Remove emap support. Unfortunately it never got to state where it would be used and usable, due to reliability and limited & complicated MD support. Going forward, we need to concentrate on interface which do not map anything into kernel in first place (such as direct map or KVA-less I/O), rather than making those mappings cheaper to do. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/include/pmap.h cvs rdiff -u -r1.289 -r1.290 src/sys/arch/x86/x86/pmap.c cvs rdiff -u -r1.314 -r1.315 src/sys/kern/kern_synch.c cvs rdiff -u -r1.144 -r1.145 src/sys/kern/sys_pipe.c cvs rdiff -u -r1.33 -r1.34 src/sys/sys/pipe.h cvs rdiff -u -r1.28 -r1.29 src/sys/uvm/files.uvm cvs rdiff -u -r1.13 -r0 src/sys/uvm/uvm_emap.c cvs rdiff -u -r1.211 -r1.212 src/sys/uvm/uvm_extern.h cvs rdiff -u -r1.48 -r1.49 src/sys/uvm/uvm_init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/include/pmap.h diff -u src/sys/arch/x86/include/pmap.h:1.77 src/sys/arch/x86/include/pmap.h:1.78 --- src/sys/arch/x86/include/pmap.h:1.77 Tue May 8 17:20:44 2018 +++ src/sys/arch/x86/include/pmap.h Sat May 19 11:39:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.77 2018/05/08 17:20:44 maxv Exp $ */ +/* $NetBSD: pmap.h,v 1.78 2018/05/19 11:39:37 jdolecek Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -366,8 +366,6 @@ void pmap_tlb_shootdown(pmap_t, vaddr_t void pmap_tlb_shootnow(void); void pmap_tlb_intr(void); -#define __HAVE_PMAP_EMAP - #define PMAP_GROWKERNEL /* turn on pmap_growkernel interface */ #define PMAP_FORK /* turn on pmap_fork interface */ Index: src/sys/arch/x86/x86/pmap.c diff -u src/sys/arch/x86/x86/pmap.c:1.289 src/sys/arch/x86/x86/pmap.c:1.290 --- src/sys/arch/x86/x86/pmap.c:1.289 Sun Mar 4 23:25:35 2018 +++ src/sys/arch/x86/x86/pmap.c Sat May 19 11:39:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.289 2018/03/04 23:25:35 jdolecek Exp $ */ +/* $NetBSD: pmap.c,v 1.290 2018/05/19 11:39:37 jdolecek Exp $ */ /* * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc. @@ -170,7 +170,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.289 2018/03/04 23:25:35 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.290 2018/05/19 11:39:37 jdolecek Exp $"); #include "opt_user_ldt.h" #include "opt_lockdebug.h" @@ -1016,67 +1016,6 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v } } -void -pmap_emap_enter(vaddr_t va, paddr_t pa, vm_prot_t prot) -{ - pt_entry_t *pte, npte; - - KASSERT((prot & ~VM_PROT_ALL) == 0); - pte = (va < VM_MIN_KERNEL_ADDRESS) ? vtopte(va) : kvtopte(va); - -#ifdef DOM0OPS - if (pa < pmap_pa_start || pa >= pmap_pa_end) { - npte = pa; - } else -#endif - npte = pmap_pa2pte(pa); - - npte = pmap_pa2pte(pa); - npte |= protection_codes[prot] | PG_V; - pmap_pte_set(pte, npte); - pmap_pte_flush(); -} - -/* - * pmap_emap_sync: perform TLB flush or pmap load, if it was deferred. - */ -void -pmap_emap_sync(bool canload) -{ - struct cpu_info *ci = curcpu(); - struct pmap *pmap; - - KASSERT(kpreempt_disabled()); - if (__predict_true(ci->ci_want_pmapload && canload)) { - /* - * XXX: Hint for pmap_reactivate(), which might suggest to - * not perform TLB flush, if state has not changed. - */ - pmap = vm_map_pmap(>l_proc->p_vmspace->vm_map); - if (__predict_false(pmap == ci->ci_pmap)) { - kcpuset_atomic_clear(pmap->pm_cpus, cpu_index(ci)); - } - pmap_load(); - KASSERT(ci->ci_want_pmapload == 0); - } else { - tlbflush(); - } -} - -void -pmap_emap_remove(vaddr_t sva, vsize_t len) -{ - pt_entry_t *pte; - vaddr_t va, eva = sva + len; - - for (va = sva; va < eva; va += PAGE_SIZE) { - pte = (va < VM_MIN_KERNEL_ADDRESS) ? vtopte(va) : kvtopte(va); - pmap_pte_set(pte, 0); - } - - pmap_pte_flush(); -} - __strict_weak_alias(pmap_kenter_ma, pmap_kenter_pa); #if defined(__x86_64__) @@ -2925,9 +2864,7 @@ pmap_reactivate(struct pmap *pmap) */ kcpuset_atomic_set(pmap->pm_cpus, cid); - u_int gen = uvm_emap_gen_return(); tlbflush(); - uvm_emap_update(gen); } } @@ -3027,9 +2964,7 @@ pmap_load(void) lldt(pmap->pm_ldt_sel); - u_int gen = uvm_emap_gen_return(); cpu_load_pmap(pmap, oldpmap); - uvm_emap_update(gen); ci->ci_want_pmapload = 0; Index: src/sys/kern/kern_synch.c diff -u src/sys/kern/kern_synch.c:1.314 src/sys/kern/kern_synch.c:1.315 --- src/sys/kern/kern_synch.c:1.314 Fri Feb 16 07:04:51 2018 +++ src/sys/kern/kern_synch.c Sat May 19 11:39:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_synch.c,v 1.314 2018/02/16
CVS commit: src/sys/uvm
Module Name:src Committed By: jdolecek Date: Sat May 19 11:02:33 UTC 2018 Modified Files: src/sys/uvm: uvm_loan.c uvm_page.c Log Message: detect wraparound when bumping page wire_count and loan_count To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/uvm/uvm_loan.c cvs rdiff -u -r1.196 -r1.197 src/sys/uvm/uvm_page.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_loan.c diff -u src/sys/uvm/uvm_loan.c:1.85 src/sys/uvm/uvm_loan.c:1.86 --- src/sys/uvm/uvm_loan.c:1.85 Sat Oct 28 00:37:13 2017 +++ src/sys/uvm/uvm_loan.c Sat May 19 11:02:33 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_loan.c,v 1.85 2017/10/28 00:37:13 pgoyette Exp $ */ +/* $NetBSD: uvm_loan.c,v 1.86 2018/05/19 11:02:33 jdolecek Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.85 2017/10/28 00:37:13 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.86 2018/05/19 11:02:33 jdolecek Exp $"); #include #include @@ -424,6 +424,7 @@ uvm_loananon(struct uvm_faultinfo *ufi, pmap_page_protect(pg, VM_PROT_READ); } pg->loan_count++; + KASSERT(pg->loan_count > 0); /* detect wrap-around */ uvm_pageactivate(pg); mutex_exit(_pageqlock); **output = pg; Index: src/sys/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.196 src/sys/uvm/uvm_page.c:1.197 --- src/sys/uvm/uvm_page.c:1.196 Tue Apr 24 16:35:53 2018 +++ src/sys/uvm/uvm_page.c Sat May 19 11:02:33 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.196 2018/04/24 16:35:53 jakllsch Exp $ */ +/* $NetBSD: uvm_page.c,v 1.197 2018/05/19 11:02:33 jdolecek Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.196 2018/04/24 16:35:53 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.197 2018/05/19 11:02:33 jdolecek Exp $"); #include "opt_ddb.h" #include "opt_uvm.h" @@ -1591,6 +1591,7 @@ uvm_pagewire(struct vm_page *pg) uvmexp.wired++; } pg->wire_count++; + KASSERT(pg->wire_count > 0); /* detect wraparound */ } /*
CVS commit: src/sys/uvm
Module Name:src Committed By: jdolecek Date: Sat May 19 11:02:33 UTC 2018 Modified Files: src/sys/uvm: uvm_loan.c uvm_page.c Log Message: detect wraparound when bumping page wire_count and loan_count To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/uvm/uvm_loan.c cvs rdiff -u -r1.196 -r1.197 src/sys/uvm/uvm_page.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jdolecek Date: Sat May 19 09:32:55 UTC 2018 Modified Files: src/sys/dev/pci: if_ena.c if_enavar.h Log Message: Intermediate changes to make it further into actually at least compile, not nearly yet complete. Committed so that others can possibly pick it off, as discussed on tech-userlevel@ with Martin To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/dev/pci/if_ena.c \ src/sys/dev/pci/if_enavar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jdolecek Date: Sat May 19 09:32:55 UTC 2018 Modified Files: src/sys/dev/pci: if_ena.c if_enavar.h Log Message: Intermediate changes to make it further into actually at least compile, not nearly yet complete. Committed so that others can possibly pick it off, as discussed on tech-userlevel@ with Martin To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/dev/pci/if_ena.c \ src/sys/dev/pci/if_enavar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_ena.c diff -u src/sys/dev/pci/if_ena.c:1.1.1.1 src/sys/dev/pci/if_ena.c:1.2 --- src/sys/dev/pci/if_ena.c:1.1.1.1 Sat May 19 09:18:31 2018 +++ src/sys/dev/pci/if_ena.c Sat May 19 09:32:55 2018 @@ -28,7 +28,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include +#if 0 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $"); +#endif +__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.2 2018/05/19 09:32:55 jdolecek Exp $"); #include #include @@ -39,56 +42,27 @@ __FBSDID("$FreeBSD: head/sys/dev/ena/ena #include #include #include -#include -#include #include #include #include -#include #include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include +#include -#include -#include +#include -#include "ena.h" -#include "ena_sysctl.h" +#include /* * Function prototypes */ -static int ena_probe(device_t); +static int ena_probe(device_t, cfdata_t, void *); static void ena_intr_msix_mgmnt(void *); static int ena_allocate_pci_resources(struct ena_adapter*); static void ena_free_pci_resources(struct ena_adapter *); -static int ena_change_mtu(if_t, int); -static inline void ena_alloc_counters(counter_u64_t *, int); -static inline void ena_free_counters(counter_u64_t *, int); -static inline void ena_reset_counters(counter_u64_t *, int); +static int ena_change_mtu(struct ifnet *, int); +static inline void ena_alloc_counters(struct evcnt *, int); +static inline void ena_free_counters(struct evcnt *, int); +static inline void ena_reset_counters(struct evcnt *, int); static void ena_init_io_rings_common(struct ena_adapter *, struct ena_ring *, uint16_t); static void ena_init_io_rings(struct ena_adapter *); @@ -146,13 +120,15 @@ static int ena_rss_configure(struct ena_ static int ena_up_complete(struct ena_adapter *); static int ena_up(struct ena_adapter *); static void ena_down(struct ena_adapter *); -static uint64_t ena_get_counter(if_t, ift_counter); -static int ena_media_change(if_t); -static void ena_media_status(if_t, struct ifmediareq *); +#if 0 +static uint64_t ena_get_counter(struct ifnet *, ift_counter); +#endif +static int ena_media_change(struct ifnet *); +static void ena_media_status(struct ifnet *, struct ifmediareq *); static void ena_init(void *); -static int ena_ioctl(if_t, u_long, caddr_t); +static int ena_ioctl(struct ifnet *, u_long, void *); static int ena_get_dev_offloads(struct ena_com_dev_get_features_ctx *); -static void ena_update_host_info(struct ena_admin_host_info *, if_t); +static void ena_update_host_info(struct ena_admin_host_info *, struct ifnet *); static void ena_update_hwassist(struct ena_adapter *); static int ena_setup_ifnet(device_t, struct ena_adapter *, struct ena_com_dev_get_features_ctx *); @@ -161,9 +137,9 @@ static int ena_check_and_collapse_mbuf(s struct mbuf **mbuf); static int ena_xmit_mbuf(struct ena_ring *, struct mbuf **); static void ena_start_xmit(struct ena_ring *); -static int ena_mq_start(if_t, struct mbuf *); +static int ena_mq_start(struct ifnet *, struct mbuf *); static void ena_deferred_mq_start(void *, int); -static void ena_qflush(if_t); +static void ena_qflush(struct ifnet *); static int ena_calc_io_queue_num(struct ena_adapter *, struct ena_com_dev_get_features_ctx *); static int ena_calc_queue_size(struct ena_adapter *, uint16_t *, @@ -171,7 +147,7 @@ static int ena_calc_queue_size(struct en static int ena_rss_init_default(struct ena_adapter *); static void ena_rss_init_default_deferred(void *); static void ena_config_host_info(struct ena_com_dev *); -static int ena_attach(device_t); +static int ena_attach(device_t parent, device_t self, void *aux); static int ena_detach(device_t); static int ena_device_init(struct ena_adapter *, device_t, struct ena_com_dev_get_features_ctx *, int *); @@ -182,25 +158,32 @@ static void unimplemented_aenq_handler(v struct ena_admin_aenq_entry *); static void ena_timer_service(void *); -static char ena_version[] = DEVICE_NAME DRV_MODULE_NAME " v"
CVS commit: src/sys
Module Name:src Committed By: jdolecek Date: Sat May 19 09:27:10 UTC 2018 Modified Files: src/sys/arch/amd64/conf: ALL src/sys/dev/pci: files.pci Log Message: add config glue for ena(4) To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/amd64/conf/ALL cvs rdiff -u -r1.395 -r1.396 src/sys/dev/pci/files.pci Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: jdolecek Date: Sat May 19 09:27:10 UTC 2018 Modified Files: src/sys/arch/amd64/conf: ALL src/sys/dev/pci: files.pci Log Message: add config glue for ena(4) To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/amd64/conf/ALL cvs rdiff -u -r1.395 -r1.396 src/sys/dev/pci/files.pci Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/ALL diff -u src/sys/arch/amd64/conf/ALL:1.87 src/sys/arch/amd64/conf/ALL:1.88 --- src/sys/arch/amd64/conf/ALL:1.87 Tue May 15 01:53:27 2018 +++ src/sys/arch/amd64/conf/ALL Sat May 19 09:27:09 2018 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.87 2018/05/15 01:53:27 thorpej Exp $ +# $NetBSD: ALL,v 1.88 2018/05/19 09:27:09 jdolecek Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "ALL-$Revision: 1.87 $" +#ident "ALL-$Revision: 1.88 $" maxusers 64 # estimated number of users @@ -951,6 +951,7 @@ bwi* at pci? dev ? function ? # Broadcom cas* at pci? dev ? function ? # Sun Cassini/Cassini+ Ethernet dge* at pci? dev ? function ? # Intel 82597 10GbE LR en* at pci? dev ? function ? # ENI/Adaptec ATM +#ena* at pci? dev ? function ? # experimental - Amazon Elastic Network Adapter ep* at pci? dev ? function ? # 3Com 3c59x epic* at pci? dev ? function ? # SMC EPIC/100 Ethernet esh* at pci? dev ? function ? # Essential HIPPI card Index: src/sys/dev/pci/files.pci diff -u src/sys/dev/pci/files.pci:1.395 src/sys/dev/pci/files.pci:1.396 --- src/sys/dev/pci/files.pci:1.395 Fri May 11 07:42:22 2018 +++ src/sys/dev/pci/files.pci Sat May 19 09:27:09 2018 @@ -1,4 +1,4 @@ -# $NetBSD: files.pci,v 1.395 2018/05/11 07:42:22 maya Exp $ +# $NetBSD: files.pci,v 1.396 2018/05/19 09:27:09 jdolecek Exp $ # # Config file and device description for machine-independent PCI code. # Included by ports that need it. Requires that the SCSI files be @@ -1193,3 +1193,10 @@ include "external/bsd/drm2/pci/files.drm device ismt: i2cbus attach ismt at pci file dev/pci/ismt.c ismt + +# Amazon Elastic Network Adapter (ENA) family +device ena: ether, ifnet, arp +attach ena at pci +file dev/pci/if_ena.c ena +file external/bsd/ena-com/ena_com.c ena +file external/bsd/ena-com/ena_eth_com.c ena
CVS import: src/sys/dev/pci
Module Name:src Committed By: jdolecek Date: Sat May 19 09:18:31 UTC 2018 Update of /cvsroot/src/sys/dev/pci In directory ivanova.netbsd.org:/tmp/cvs-serv19156 Log Message: Import source for FreeBSD Amazon Elastic Network Adapter (ENA) NIC driver for reference. Needs a lot of work to port over. Remapped filenames from FreeBSD to NetBSD structure: sys/dev/ena/ena.c -> sys/dev/pci/if_ena.c sys/dev/ena/ena.h -> sys/dev/pci/if_enavar.h ena_sysctl.* not imported, if needed later will be merged into if_ena.c Status: Vendor Tag: FREEBSD Release Tags: ENA-20180510 N src/sys/dev/pci/if_ena.c N src/sys/dev/pci/if_enavar.h No conflicts created by this import
CVS import: src/sys/dev/pci
Module Name:src Committed By: jdolecek Date: Sat May 19 09:18:31 UTC 2018 Update of /cvsroot/src/sys/dev/pci In directory ivanova.netbsd.org:/tmp/cvs-serv19156 Log Message: Import source for FreeBSD Amazon Elastic Network Adapter (ENA) NIC driver for reference. Needs a lot of work to port over. Remapped filenames from FreeBSD to NetBSD structure: sys/dev/ena/ena.c -> sys/dev/pci/if_ena.c sys/dev/ena/ena.h -> sys/dev/pci/if_enavar.h ena_sysctl.* not imported, if needed later will be merged into if_ena.c Status: Vendor Tag: FREEBSD Release Tags: ENA-20180510 N src/sys/dev/pci/if_ena.c N src/sys/dev/pci/if_enavar.h No conflicts created by this import
CVS commit: src/sys/external/bsd/ena-com
Module Name:src Committed By: jdolecek Date: Sat May 19 08:59:38 UTC 2018 Modified Files: src/sys/external/bsd/ena-com: ena_plat.h Log Message: adapt for NetBSD To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/external/bsd/ena-com/ena_plat.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/ena-com/ena_plat.h diff -u src/sys/external/bsd/ena-com/ena_plat.h:1.1.1.1 src/sys/external/bsd/ena-com/ena_plat.h:1.2 --- src/sys/external/bsd/ena-com/ena_plat.h:1.1.1.1 Sat May 19 08:56:06 2018 +++ src/sys/external/bsd/ena-com/ena_plat.h Sat May 19 08:59:38 2018 @@ -35,7 +35,10 @@ #define ENA_PLAT_H_ #include +#if 0 __FBSDID("$FreeBSD: head/sys/contrib/ena-com/ena_plat.h 333453 2018-05-10 09:25:51Z mw $"); +#endif +__KERNEL_RCSID(0, "$NetBSD: ena_plat.h,v 1.2 2018/05/19 08:59:38 jdolecek Exp $"); #include #include @@ -48,45 +51,29 @@ __FBSDID("$FreeBSD: head/sys/contrib/ena #include #include #include -#include #include -#include #include #include #include -#include -#include #include -#include -#include - -#include -#include -#include -#include -#include +#include +#include -#include -#include #include -#include -#include #include #include +#include -#include -#include +#include + +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include /* XXX for struct ip */ +#include /* XXX for struct ip */ +#include /* XXX for struct ip */ +#include /* XXX for struct ip6_hdr */ +#include /* XXX for struct tcphdr */ -#include #include #include @@ -114,8 +101,8 @@ extern int ena_log_level; } while (0) #define ena_trace(level, fmt, args...)\ - ena_trace_raw(level, "%s() [TID:%d]: " \ - fmt " \n", __func__, curthread->td_tid, ##args) + ena_trace_raw(level, "%s() [LID:%d]: " \ + fmt " \n", __func__, curlwp->l_lid, ##args) #define ena_trc_dbg(format, arg...) ena_trace(ENA_DBG, format, ##arg) @@ -184,11 +171,11 @@ static inline long PTR_ERR(const void *p #define ENA_COM_PERMISSION EPERM #define ENA_COM_TIMER_EXPIRED ETIMEDOUT -#define ENA_MSLEEP(x) pause_sbt("ena", SBT_1MS * (x), SBT_1MS, 0) +#define ENA_MSLEEP(x) kpause("enaw", false, mstohz(x), NULL) #define ENA_UDELAY(x) DELAY(x) #define ENA_GET_SYSTEM_TIMEOUT(timeout_us) \ -((long)cputick2usec(cpu_ticks()) + (timeout_us)) -#define ENA_TIME_EXPIRE(timeout) ((timeout) < (long)cputick2usec(cpu_ticks())) + mstohz(timeout_us * (1000 / 100)) /* XXX assumes 100 ms sleep */ +#define ENA_TIME_EXPIRE(timeout) ((timeout)-- <= 0) #define ENA_MIGHT_SLEEP() #define min_t(type, _x, _y) ((type)(_x) < (type)(_y) ? (type)(_x) : (type)(_y)) @@ -203,52 +190,51 @@ static inline long PTR_ERR(const void *p #define ENA_MAX8(x,y) MAX(x, y) /* Spinlock related methods */ -#define ena_spinlock_t struct mtx +#define ena_spinlock_t kmutex_t #define ENA_SPINLOCK_INIT(spinlock)\ - mtx_init(&(spinlock), "ena_spin", NULL, MTX_SPIN) + mutex_init(&(spinlock), MUTEX_DEFAULT, IPL_NET) #define ENA_SPINLOCK_DESTROY(spinlock)\ do { \ - if (mtx_initialized(&(spinlock))) \ - mtx_destroy(&(spinlock)); \ + mutex_destroy(&(spinlock)); \ } while (0) #define ENA_SPINLOCK_LOCK(spinlock, flags) \ do { \ (void)(flags); \ - mtx_lock_spin(&(spinlock)); \ + mutex_enter(&(spinlock)); \ } while (0) #define ENA_SPINLOCK_UNLOCK(spinlock, flags) \ do { \ (void)(flags); \ - mtx_unlock_spin(&(spinlock)); \ + mutex_exit(&(spinlock)); \ } while (0) /* Wait queue related methods */ -#define ena_wait_event_t struct { struct cv wq; struct mtx mtx; } +#define ena_wait_event_t struct { kcondvar_t wq; kmutex_t mtx; } #define ENA_WAIT_EVENT_INIT(waitqueue) \ do {\ - cv_init(&((waitqueue).wq), "cv"); \ - mtx_init(&((waitqueue).mtx), "wq", NULL, MTX_DEF); \ + cv_init(&((waitqueue).wq), "enacv"); \ + mutex_init(&((waitqueue).mtx), MUTEX_DEFAULT, IPL_NET); \ } while (0) #define ENA_WAIT_EVENT_DESTROY(waitqueue)\ do {\ cv_destroy(&((waitqueue).wq));\ - mtx_destroy(&((waitqueue).mtx)); \ + mutex_destroy(&((waitqueue).mtx)); \ } while (0) #define ENA_WAIT_EVENT_CLEAR(waitqueue) \ - cv_init(&((waitqueue).wq), (waitqueue).wq.cv_description) + cv_init(&((waitqueue).wq), "enacv") #define ENA_WAIT_EVENT_WAIT(waitqueue, timeout_us) \ do {\ - mtx_lock(&((waitqueue).mtx));\ + mutex_enter(&((waitqueue).mtx)); \ cv_timedwait(&((waitqueue).wq), &((waitqueue).mtx), \ timeout_us * hz / 1000 / 1000 ); \ - mtx_unlock(&((waitqueue).mtx));\ + mutex_exit(&((waitqueue).mtx));\ } while (0) #define ENA_WAIT_EVENT_SIGNAL(waitqueue) \ do { \ - mtx_lock(&((waitqueue).mtx)); \ + mutex_enter(&((waitqueue).mtx)); \
CVS commit: src/sys/external/bsd/ena-com
Module Name:src Committed By: jdolecek Date: Sat May 19 08:59:38 UTC 2018 Modified Files: src/sys/external/bsd/ena-com: ena_plat.h Log Message: adapt for NetBSD To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/external/bsd/ena-com/ena_plat.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS import: src/sys/external/bsd/ena-com
Module Name:src Committed By: jdolecek Date: Sat May 19 08:56:06 UTC 2018 Update of /cvsroot/src/sys/external/bsd/ena-com In directory ivanova.netbsd.org:/tmp/cvs-serv24953 Log Message: Introduce HAL for Amazon Elastic Network Adapter (ENA) This commit adds HAL (Hardware Abstraction Layer) code for Amazon Elastic Network Adapter (ENA). Version: 1.1.4.3 Obtained from: Amazon.com, Inc. via FreeBSD Status: Vendor Tag: FREEBSD Release Tags: ENA-COM-HAL_20180510 N src/sys/external/bsd/ena-com/ena_admin_defs.h N src/sys/external/bsd/ena-com/ena_com.c N src/sys/external/bsd/ena-com/ena_com.h N src/sys/external/bsd/ena-com/ena_common_defs.h N src/sys/external/bsd/ena-com/ena_eth_com.c N src/sys/external/bsd/ena-com/ena_eth_com.h N src/sys/external/bsd/ena-com/ena_eth_io_defs.h N src/sys/external/bsd/ena-com/ena_plat.h N src/sys/external/bsd/ena-com/ena_regs_defs.h N src/sys/external/bsd/ena-com/ena_defs/ena_admin_defs.h N src/sys/external/bsd/ena-com/ena_defs/ena_common_defs.h N src/sys/external/bsd/ena-com/ena_defs/ena_eth_io_defs.h N src/sys/external/bsd/ena-com/ena_defs/ena_gen_info.h N src/sys/external/bsd/ena-com/ena_defs/ena_includes.h N src/sys/external/bsd/ena-com/ena_defs/ena_regs_defs.h No conflicts created by this import
CVS import: src/sys/external/bsd/ena-com
Module Name:src Committed By: jdolecek Date: Sat May 19 08:56:06 UTC 2018 Update of /cvsroot/src/sys/external/bsd/ena-com In directory ivanova.netbsd.org:/tmp/cvs-serv24953 Log Message: Introduce HAL for Amazon Elastic Network Adapter (ENA) This commit adds HAL (Hardware Abstraction Layer) code for Amazon Elastic Network Adapter (ENA). Version: 1.1.4.3 Obtained from: Amazon.com, Inc. via FreeBSD Status: Vendor Tag: FREEBSD Release Tags: ENA-COM-HAL_20180510 N src/sys/external/bsd/ena-com/ena_admin_defs.h N src/sys/external/bsd/ena-com/ena_com.c N src/sys/external/bsd/ena-com/ena_com.h N src/sys/external/bsd/ena-com/ena_common_defs.h N src/sys/external/bsd/ena-com/ena_eth_com.c N src/sys/external/bsd/ena-com/ena_eth_com.h N src/sys/external/bsd/ena-com/ena_eth_io_defs.h N src/sys/external/bsd/ena-com/ena_plat.h N src/sys/external/bsd/ena-com/ena_regs_defs.h N src/sys/external/bsd/ena-com/ena_defs/ena_admin_defs.h N src/sys/external/bsd/ena-com/ena_defs/ena_common_defs.h N src/sys/external/bsd/ena-com/ena_defs/ena_eth_io_defs.h N src/sys/external/bsd/ena-com/ena_defs/ena_gen_info.h N src/sys/external/bsd/ena-com/ena_defs/ena_includes.h N src/sys/external/bsd/ena-com/ena_defs/ena_regs_defs.h No conflicts created by this import
CVS commit: sys/external/bsd/ena-com
Module Name:sys Committed By: jdolecek Date: Sat May 19 08:54:34 UTC 2018 Removed Files: sys/external/bsd/ena-com: ena_admin_defs.h ena_com.c ena_com.h ena_common_defs.h ena_eth_com.c ena_eth_com.h ena_eth_io_defs.h ena_plat.h ena_regs_defs.h sys/external/bsd/ena-com/ena_defs: ena_admin_defs.h ena_common_defs.h ena_eth_io_defs.h ena_gen_info.h ena_includes.h ena_regs_defs.h Log Message: remove, wrong import path To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r0 sys/external/bsd/ena-com/ena_admin_defs.h \ sys/external/bsd/ena-com/ena_com.c sys/external/bsd/ena-com/ena_com.h \ sys/external/bsd/ena-com/ena_common_defs.h \ sys/external/bsd/ena-com/ena_eth_com.c \ sys/external/bsd/ena-com/ena_eth_com.h \ sys/external/bsd/ena-com/ena_eth_io_defs.h \ sys/external/bsd/ena-com/ena_plat.h \ sys/external/bsd/ena-com/ena_regs_defs.h cvs rdiff -u -r1.1.1.1 -r0 sys/external/bsd/ena-com/ena_defs/ena_admin_defs.h \ sys/external/bsd/ena-com/ena_defs/ena_common_defs.h \ sys/external/bsd/ena-com/ena_defs/ena_eth_io_defs.h \ sys/external/bsd/ena-com/ena_defs/ena_gen_info.h \ sys/external/bsd/ena-com/ena_defs/ena_includes.h \ sys/external/bsd/ena-com/ena_defs/ena_regs_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: sys/external/bsd/ena-com
Module Name:sys Committed By: jdolecek Date: Sat May 19 08:54:34 UTC 2018 Removed Files: sys/external/bsd/ena-com: ena_admin_defs.h ena_com.c ena_com.h ena_common_defs.h ena_eth_com.c ena_eth_com.h ena_eth_io_defs.h ena_plat.h ena_regs_defs.h sys/external/bsd/ena-com/ena_defs: ena_admin_defs.h ena_common_defs.h ena_eth_io_defs.h ena_gen_info.h ena_includes.h ena_regs_defs.h Log Message: remove, wrong import path To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r0 sys/external/bsd/ena-com/ena_admin_defs.h \ sys/external/bsd/ena-com/ena_com.c sys/external/bsd/ena-com/ena_com.h \ sys/external/bsd/ena-com/ena_common_defs.h \ sys/external/bsd/ena-com/ena_eth_com.c \ sys/external/bsd/ena-com/ena_eth_com.h \ sys/external/bsd/ena-com/ena_eth_io_defs.h \ sys/external/bsd/ena-com/ena_plat.h \ sys/external/bsd/ena-com/ena_regs_defs.h cvs rdiff -u -r1.1.1.1 -r0 sys/external/bsd/ena-com/ena_defs/ena_admin_defs.h \ sys/external/bsd/ena-com/ena_defs/ena_common_defs.h \ sys/external/bsd/ena-com/ena_defs/ena_eth_io_defs.h \ sys/external/bsd/ena-com/ena_defs/ena_gen_info.h \ sys/external/bsd/ena-com/ena_defs/ena_includes.h \ sys/external/bsd/ena-com/ena_defs/ena_regs_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS import: sys/external/bsd/ena-com
Module Name:sys Committed By: jdolecek Date: Sat May 19 08:50:54 UTC 2018 Update of /cvsroot/sys/external/bsd/ena-com In directory ivanova.netbsd.org:/tmp/cvs-serv16991 Log Message: Introduce HAL for Amazon Elastic Network Adapter (ENA) This commit adds HAL (Hardware Abstraction Layer) code for Amazon Elastic Network Adapter (ENA). Version: 1.1.4.3 Obtained from: Amazon.com, Inc. via FreeBSD Status: Vendor Tag: FREEBSD Release Tags: ENA-COM-HAL_20180510 N sys/external/bsd/ena-com/ena_admin_defs.h N sys/external/bsd/ena-com/ena_com.c N sys/external/bsd/ena-com/ena_com.h N sys/external/bsd/ena-com/ena_common_defs.h N sys/external/bsd/ena-com/ena_eth_com.c N sys/external/bsd/ena-com/ena_eth_com.h N sys/external/bsd/ena-com/ena_eth_io_defs.h N sys/external/bsd/ena-com/ena_plat.h N sys/external/bsd/ena-com/ena_regs_defs.h N sys/external/bsd/ena-com/ena_defs/ena_admin_defs.h N sys/external/bsd/ena-com/ena_defs/ena_common_defs.h N sys/external/bsd/ena-com/ena_defs/ena_eth_io_defs.h N sys/external/bsd/ena-com/ena_defs/ena_gen_info.h N sys/external/bsd/ena-com/ena_defs/ena_includes.h N sys/external/bsd/ena-com/ena_defs/ena_regs_defs.h No conflicts created by this import
CVS import: sys/external/bsd/ena-com
Module Name:sys Committed By: jdolecek Date: Sat May 19 08:50:54 UTC 2018 Update of /cvsroot/sys/external/bsd/ena-com In directory ivanova.netbsd.org:/tmp/cvs-serv16991 Log Message: Introduce HAL for Amazon Elastic Network Adapter (ENA) This commit adds HAL (Hardware Abstraction Layer) code for Amazon Elastic Network Adapter (ENA). Version: 1.1.4.3 Obtained from: Amazon.com, Inc. via FreeBSD Status: Vendor Tag: FREEBSD Release Tags: ENA-COM-HAL_20180510 N sys/external/bsd/ena-com/ena_admin_defs.h N sys/external/bsd/ena-com/ena_com.c N sys/external/bsd/ena-com/ena_com.h N sys/external/bsd/ena-com/ena_common_defs.h N sys/external/bsd/ena-com/ena_eth_com.c N sys/external/bsd/ena-com/ena_eth_com.h N sys/external/bsd/ena-com/ena_eth_io_defs.h N sys/external/bsd/ena-com/ena_plat.h N sys/external/bsd/ena-com/ena_regs_defs.h N sys/external/bsd/ena-com/ena_defs/ena_admin_defs.h N sys/external/bsd/ena-com/ena_defs/ena_common_defs.h N sys/external/bsd/ena-com/ena_defs/ena_eth_io_defs.h N sys/external/bsd/ena-com/ena_defs/ena_gen_info.h N sys/external/bsd/ena-com/ena_defs/ena_includes.h N sys/external/bsd/ena-com/ena_defs/ena_regs_defs.h No conflicts created by this import
CVS commit: src/sys/netinet6
Module Name:src Committed By: maxv Date: Sat May 19 08:22:58 UTC 2018 Modified Files: src/sys/netinet6: nd6_nbr.c nd6_rtr.c Log Message: Style. To generate a diff of this commit: cvs rdiff -u -r1.155 -r1.156 src/sys/netinet6/nd6_nbr.c cvs rdiff -u -r1.142 -r1.143 src/sys/netinet6/nd6_rtr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netinet6/nd6_nbr.c diff -u src/sys/netinet6/nd6_nbr.c:1.155 src/sys/netinet6/nd6_nbr.c:1.156 --- src/sys/netinet6/nd6_nbr.c:1.155 Thu May 17 12:07:48 2018 +++ src/sys/netinet6/nd6_nbr.c Sat May 19 08:22:58 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: nd6_nbr.c,v 1.155 2018/05/17 12:07:48 maxv Exp $ */ +/* $NetBSD: nd6_nbr.c,v 1.156 2018/05/19 08:22:58 maxv Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.155 2018/05/17 12:07:48 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.156 2018/05/19 08:22:58 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -164,7 +164,6 @@ nd6_ns_input(struct mbuf *m, int off, in } } - if (IN6_IS_ADDR_MULTICAST()) { nd6log(LOG_INFO, "bad NS target (multicast)\n"); goto bad; @@ -197,7 +196,7 @@ nd6_ns_input(struct mbuf *m, int off, in * Otherwise MAY be omitted * * In this implementation, we omit the target link-layer address - * in the "MAY" case. + * in the "MAY" case. */ #if 0 /* too much! */ ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, ); Index: src/sys/netinet6/nd6_rtr.c diff -u src/sys/netinet6/nd6_rtr.c:1.142 src/sys/netinet6/nd6_rtr.c:1.143 --- src/sys/netinet6/nd6_rtr.c:1.142 Fri May 18 21:03:33 2018 +++ src/sys/netinet6/nd6_rtr.c Sat May 19 08:22:58 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: nd6_rtr.c,v 1.142 2018/05/18 21:03:33 maxv Exp $ */ +/* $NetBSD: nd6_rtr.c,v 1.143 2018/05/19 08:22:58 maxv Exp $ */ /* $KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.142 2018/05/18 21:03:33 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.143 2018/05/19 08:22:58 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -230,12 +230,6 @@ nd6_ra_input(struct mbuf *m, int off, in struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); struct nd_router_advert *nd_ra; struct in6_addr saddr6 = ip6->ip6_src; -#if 0 - struct in6_addr daddr6 = ip6->ip6_dst; - int flags; /* = nd_ra->nd_ra_flags_reserved; */ - int is_managed = ((flags & ND_RA_FLAG_MANAGED) != 0); - int is_other = ((flags & ND_RA_FLAG_OTHER) != 0); -#endif int mcast = 0; union nd_opts ndopts; struct nd_defrouter *dr; @@ -248,9 +242,9 @@ nd6_ra_input(struct mbuf *m, int off, in ndi = ND_IFINFO(ifp); /* - * We only accept RAs when - * the system-wide variable allows the acceptance, and the - * per-interface variable allows RAs on the receiving interface. + * We only accept RAs when the system-wide variable allows the + * acceptance, and the per-interface variable allows RAs on the + * receiving interface. */ if (!nd6_accepts_rtadv(ndi)) goto freeit; @@ -958,7 +952,7 @@ restart: } static int -nd6_prelist_add(struct nd_prefixctl *prc, struct nd_defrouter *dr, +nd6_prelist_add(struct nd_prefixctl *prc, struct nd_defrouter *dr, struct nd_prefix **newp) { struct nd_prefix *newpr = NULL; @@ -968,8 +962,8 @@ nd6_prelist_add(struct nd_prefixctl *prc ND6_ASSERT_WLOCK(); - if (ip6_maxifprefixes >= 0) { - if (ext->nprefixes >= ip6_maxifprefixes / 2) + if (ip6_maxifprefixes >= 0) { + if (ext->nprefixes >= ip6_maxifprefixes / 2) purge_detached(prc->ndprc_ifp); if (ext->nprefixes >= ip6_maxifprefixes) return ENOMEM; @@ -1104,7 +1098,7 @@ nd6_prelist_remove(struct nd_prefix *pr) static int prelist_update(struct nd_prefixctl *newprc, struct nd_defrouter *dr, /* may be NULL */ - struct mbuf *m, + struct mbuf *m, int mcast) { struct in6_ifaddr *ia6_match = NULL; @@ -2024,7 +2018,7 @@ in6_ifadd(struct nd_prefixctl *prc, int int in6_tmpifadd( const struct in6_ifaddr *ia0, /* corresponding public address */ - int forcegen, + int forcegen, int dad_delay) { struct ifnet *ifp = ia0->ia_ifa.ifa_ifp;
CVS commit: src/sys/netinet6
Module Name:src Committed By: maxv Date: Sat May 19 08:22:58 UTC 2018 Modified Files: src/sys/netinet6: nd6_nbr.c nd6_rtr.c Log Message: Style. To generate a diff of this commit: cvs rdiff -u -r1.155 -r1.156 src/sys/netinet6/nd6_nbr.c cvs rdiff -u -r1.142 -r1.143 src/sys/netinet6/nd6_rtr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet6
Module Name:src Committed By: maxv Date: Sat May 19 06:44:08 UTC 2018 Modified Files: src/sys/netinet6: ip6_input.c Log Message: Remove misleading comment. To generate a diff of this commit: cvs rdiff -u -r1.203 -r1.204 src/sys/netinet6/ip6_input.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netinet6/ip6_input.c diff -u src/sys/netinet6/ip6_input.c:1.203 src/sys/netinet6/ip6_input.c:1.204 --- src/sys/netinet6/ip6_input.c:1.203 Thu May 17 11:59:36 2018 +++ src/sys/netinet6/ip6_input.c Sat May 19 06:44:08 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_input.c,v 1.203 2018/05/17 11:59:36 maxv Exp $ */ +/* $NetBSD: ip6_input.c,v 1.204 2018/05/19 06:44:08 maxv Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.203 2018/05/17 11:59:36 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.204 2018/05/19 06:44:08 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_gateway.h" @@ -1050,17 +1050,6 @@ ip6_unknown_opt(u_int8_t *optp, struct m return (-1); } -/* - * Create the "control" list for this pcb. - * - * The routine will be called from upper layer handlers like tcp6_input(). - * Thus the routine assumes that the caller (tcp6_input) have already - * called IP6_EXTHDR_CHECK() and all the extension headers are located in the - * very first mbuf on the mbuf chain. - * We may want to add some infinite loop prevention or sanity checks for safety. - * (This applies only when you are using KAME mbuf chain restriction, i.e. - * you are using IP6_EXTHDR_CHECK() not m_pulldown()) - */ void ip6_savecontrol(struct in6pcb *in6p, struct mbuf **mp, struct ip6_hdr *ip6, struct mbuf *m)
CVS commit: src/sys/netinet6
Module Name:src Committed By: maxv Date: Sat May 19 06:44:08 UTC 2018 Modified Files: src/sys/netinet6: ip6_input.c Log Message: Remove misleading comment. To generate a diff of this commit: cvs rdiff -u -r1.203 -r1.204 src/sys/netinet6/ip6_input.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.