CVS commit: src/external/gpl2/xcvs/dist/doc
Module Name:src Committed By: gutteridge Date: Wed May 1 02:15:07 UTC 2019 Modified Files: src/external/gpl2/xcvs/dist/doc: cvs.1 cvs.texinfo Log Message: cvs.1 & cvs.texinfo: add various small corrections Add various corrections mostly sourced from upstream's cvs.texinfo, e.g., note NetBSD's local change to log admin commands in history (subsequently added on upstream's HEAD, since it was noted in r. 1.689), add some references to rannotate and rlog (from r. 1.686), some amendments concerning rdiff (from r. 1.687), and miscellaneous typo fixes. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/gpl2/xcvs/dist/doc/cvs.1 cvs rdiff -u -r1.10 -r1.11 src/external/gpl2/xcvs/dist/doc/cvs.texinfo Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/xcvs/dist/doc/cvs.1 diff -u src/external/gpl2/xcvs/dist/doc/cvs.1:1.9 src/external/gpl2/xcvs/dist/doc/cvs.1:1.10 --- src/external/gpl2/xcvs/dist/doc/cvs.1:1.9 Sun Apr 28 07:13:16 2019 +++ src/external/gpl2/xcvs/dist/doc/cvs.1 Wed May 1 02:15:07 2019 @@ -1098,7 +1098,7 @@ acceptable for \fIstate\fR. A useful se stable), and \fBRel\fR (for released). By default, the state of a new revision is set to \fBExp\fR when it is created. The state is visible in the output from -\fIcvs log\fR (see node `log\(aq in the CVS manual), and in the +\fIcvs log\fR (see node `log & rlog\(aq in the CVS manual), and in the \fB$\fP\fPLog$\fR and \fB$\fP\fPState$\fR keywords (see node `Keyword substitution\(aq in the CVS manual). Note that \fBcvs\fR uses the \fBdead\fR state for its own purposes (see node `Attic\(aq in the CVS manual); to @@ -1113,7 +1113,7 @@ Useful with \fBcvs\fR. Write descriptiv contents of the named \fIfile\fR into the RCS file, deleting the existing text. The \fIfile\fR pathname may not begin with \fB-\fR. The descriptive text can be seen in the -output from \fBcvs log\fR (see node `log\(aq in the CVS manual). +output from \fBcvs log\fR (see node `log & rlog\(aq in the CVS manual). There can be no space between \fB-t\fR and its argument. .SP If \fIfile\fR is omitted, @@ -1171,9 +1171,10 @@ files. However, \fBcvs\fR has always re this option has never done anything useful. .SP .SP -.SH "annotate" +.SH "annotate & rannotate" .SS "What revision modified each line of a file?" .IX "annotate (subcommand)" +.IX "rannotate (subcommand)" .SP .IP "\(bu" 2 Synopsis: annotate [options] files\&... @@ -1225,6 +1226,8 @@ existed on \fIdate\fR. See see node `Co Annotate file as of specified date. .SP .SH "annotate example" +.IX "annotate (subcommand)" +.IX "rannotate (subcommand)" .SP For example: .SP @@ -1511,6 +1514,7 @@ $ cvs checkout -D yesterday tc .SH "commit" .SS "Check files into the repository" .IX "commit (subcommand)" +.IX "ci (subcommand)" .SP .IP "\(bu" 2 Synopsis: commit [-lnRf] [-m \(aqlog_message\(aq | @@ -1550,7 +1554,7 @@ enter a log message that will be written logging programs (see node `modules\(aq in the CVS manual, and see node `loginfo\(aq in the CVS manual) and placed in the \fBrcs\fR file inside the repository. This log message can be retrieved with the -\fBlog\fR command; see see node `log\(aq in the CVS manual. You can specify the +\fBlog\fR command (see node `log & rlog\(aq in the CVS manual). You can specify the log message on the command line with the \fB-m \fImessage\fB\fR option, and thus avoid the editor invocation, or use the \fB-F \fIfile\fB\fR option to specify @@ -1559,8 +1563,8 @@ that the argument file contains the log At \fBcommit\fR, a unique commitid is placed in the \fBrcs\fR file inside the repository. All files committed at once get the same commitid. The commitid can be retrieved with -the \fBlog\fR and \fBstatus\fR command; see see node `log\(aq in the CVS manual, -see node `File status\(aq in the CVS manual. +the \fBlog\fR and \fBstatus\fR command (see node `log & rlog\(aq in the CVS manual, +see node `File status\(aq in the CVS manual). .SP .SH "commit options" .SP @@ -2821,6 +2825,12 @@ A file was modified. .IP "" 4 A file was removed. .SP +One record type results from the admin command: +.IP "" 2 +\fBX\fR +.IP "" 4 +The admin command. +.SP The options shown as \fB-flags\fR constrain or expand the report without requiring option arguments: .SP @@ -3117,9 +3127,10 @@ $ cvs -d /usr/local/cvsroot init .PD .IP "" 0 .SP -.SH "log" +.SH "log & rlog" .SS "Print out log information for files" .IX "log (subcommand)" +.IX "rlog (subcommand)" .SP .IP "\(bu" 2 Synopsis: log [options] [files\&...] @@ -3488,7 +3499,7 @@ verifymsg .IX "rdiff (subcommand)" .SP .IP "\(bu" 2 -rdiff [-flags] [-V vn] (-r tag1[:date1] | -D date1) [-r tag2[:date2] | -D date2] modules\&... +rdiff [options] {-r tag1[:date1] | -D date1} [-r tag2[:date2] | -D date2] modules\&... .IP "\(bu" 2 Requires: repository. .IP "\(bu" 2 @@ -3499,10 +3510,7 @@
CVS commit: src/sys/arch/arm/dts
Module Name:src Committed By: jmcneill Date: Tue Apr 30 23:42:53 UTC 2019 Removed Files: src/sys/arch/arm/dts: rk3399-rockpro64.dts Log Message: Use mainline dts for rockpro64 now. To generate a diff of this commit: cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/dts/rk3399-rockpro64.dts Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/vmstat
Module Name:src Committed By: simonb Date: Tue Apr 30 23:29:18 UTC 2019 Modified Files: src/usr.bin/vmstat: vmstat.c Log Message: Use PRWORD for printing -m/-mW totals so fields don't run in to each other. While here, update field widths for 'vmstat -mW' for modern machines. To generate a diff of this commit: cvs rdiff -u -r1.225 -r1.226 src/usr.bin/vmstat/vmstat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/vmstat/vmstat.c diff -u src/usr.bin/vmstat/vmstat.c:1.225 src/usr.bin/vmstat/vmstat.c:1.226 --- src/usr.bin/vmstat/vmstat.c:1.225 Thu Dec 13 01:58:04 2018 +++ src/usr.bin/vmstat/vmstat.c Tue Apr 30 23:29:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: vmstat.c,v 1.225 2018/12/13 01:58:04 sevan Exp $ */ +/* $NetBSD: vmstat.c,v 1.226 2019/04/30 23:29:18 simonb Exp $ */ /*- * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; #else -__RCSID("$NetBSD: vmstat.c,v 1.225 2018/12/13 01:58:04 sevan Exp $"); +__RCSID("$NetBSD: vmstat.c,v 1.226 2019/04/30 23:29:18 simonb Exp $"); #endif #endif /* not lint */ @@ -1435,7 +1435,7 @@ dopool_sysctl(int verbose, int wide) size_t i, len; int name_len, ovflw; struct pool_sysctl *pp, *data; - char in_use[8], avail[8], maxp[32]; + char maxp[32]; data = asysctlbyname("kern.pool", ); if (data == NULL) @@ -1447,23 +1447,23 @@ dopool_sysctl(int verbose, int wide) (void)printf("Memory resource pool statistics\n"); (void)printf( - "%-*s%*s%*s%5s%*s%s%s%*s%*s%6s%s%6s%6s%6s%5s%s%s\n", + "%-*s%*s%*s%*s%*s%s%s%*s%*s%*s%s%*s%6s%*s%5s%s%s\n", wide ? 16 : 11, "Name", - wide ? 6 : 5, "Size", + wide ? 7 : 5, "Size", wide ? 12 : 9, "Requests", - "Fail", + wide ? 8 : 5, "Fail", wide ? 12 : 9, "Releases", - wide ? " InUse" : "", - wide ? " Avail" : "", - wide ? 7 : 6, "Pgreq", - wide ? 7 : 6, "Pgrel", - "Npage", + wide ? "InUse" : "", + wide ? "Avail" : "", + wide ? 11 : 6, "Pgreq", + wide ? 11 : 6, "Pgrel", + wide ? 8 : 6, "Npage", wide ? " PageSz" : "", - "Hiwat", + wide ? 7 : 6, "Hiwat", "Minpg", - "Maxpg", + wide ? 7 : 6, "Maxpg", "Idle", - wide ? " Flags" : "", + wide ? " Flags" : "", wide ? " Util" : ""); name_len = MIN((int)sizeof(pp->pr_wchan), wide ? 16 : 11); @@ -1478,35 +1478,33 @@ dopool_sysctl(int verbose, int wide) pp->pr_maxpages); ovflw = 0; PRWORD(ovflw, "%-*s", name_len, 0, pp->pr_wchan); - PRWORD(ovflw, " %*" PRIu64, wide ? 6 : 5, 1, pp->pr_size); + PRWORD(ovflw, " %*" PRIu64, wide ? 7 : 5, 1, pp->pr_size); PRWORD(ovflw, " %*" PRIu64, wide ? 12 : 9, 1, pp->pr_nget); pool_totals.pt_nget += pp->pr_nget; - PRWORD(ovflw, " %*" PRIu64, 5, 1, pp->pr_nfail); + PRWORD(ovflw, " %*" PRIu64, wide ? 8 : 5, 1, pp->pr_nfail); pool_totals.pt_nfail += pp->pr_nfail; PRWORD(ovflw, " %*" PRIu64, wide ? 12 : 9, 1, pp->pr_nput); pool_totals.pt_nput += pp->pr_nput; if (wide) { - PRWORD(ovflw, " %*" PRIu64, 7, 1, pp->pr_nout); + PRWORD(ovflw, " %*" PRIu64, 9, 1, pp->pr_nout); pool_totals.pt_nout += pp->pr_nout; - } - if (wide) { - PRWORD(ovflw, " %*" PRIu64, 6, 1, pp->pr_nitems); + PRWORD(ovflw, " %*" PRIu64, 9, 1, pp->pr_nitems); pool_totals.pt_nitems += pp->pr_nitems; } - PRWORD(ovflw, " %*" PRIu64, wide ? 7 : 6, 1, pp->pr_npagealloc); + PRWORD(ovflw, " %*" PRIu64, wide ? 11 : 6, 1, pp->pr_npagealloc); pool_totals.pt_npagealloc += pp->pr_npagealloc; - PRWORD(ovflw, " %*" PRIu64, wide ? 7 : 6, 1, pp->pr_npagefree); + PRWORD(ovflw, " %*" PRIu64, wide ? 11 : 6, 1, pp->pr_npagefree); pool_totals.pt_npagefree += pp->pr_npagefree; - PRWORD(ovflw, " %*" PRIu64, 6, 1, pp->pr_npages); + PRWORD(ovflw, " %*" PRIu64, wide ? 8 : 6, 1, pp->pr_npages); pool_totals.pt_npages += pp->pr_npages; if (wide) PRWORD(ovflw, " %*" PRIu64, 7, 1, pp->pr_pagesize); - PRWORD(ovflw, " %*" PRIu64, 6, 1, pp->pr_hiwat); + PRWORD(ovflw, " %*" PRIu64, wide ? 7 : 6, 1, pp->pr_hiwat); PRWORD(ovflw, " %*" PRIu64, 6, 1, pp->pr_minpages); - PRWORD(ovflw, " %*s", 6, 1, maxp); + PRWORD(ovflw, " %*s", wide ? 7 : 6, 1, maxp); PRWORD(ovflw, " %*" PRIu64, 5, 1, pp->pr_nidle); if (wide) - PRWORD(ovflw, " 0x%0*" PRIx64, 4, 1, + PRWORD(ovflw, " 0x%0*" PRIx64, 5, 1, pp->pr_flags); this_inuse = pp->pr_nout * pp->pr_size; @@ -1531,25 +1529,20 @@ dopool_sysctl(int verbose, int wide) } (void)printf("\n"); } + ovflw = 0; + PRWORD(ovflw, "%-*s", name_len, 0, "Totals"); + PRWORD(ovflw, " %*s", wide ? 7 : 5, 1, ""); + PRWORD(ovflw, " %*" PRIu64, wide ? 12 : 9, 1, pool_totals.pt_nget); + PRWORD(ovflw, " %*" PRIu64, wide ? 8 : 5, 1, pool_totals.pt_nfail); + PRWORD(ovflw, " %*" PRIu64, wide ? 12 : 9, 1,
CVS commit: src/sys/dev/ic
Module Name:src Committed By: jmcneill Date: Tue Apr 30 23:19:55 UTC 2019 Modified Files: src/sys/dev/ic: dwc_mmc.c dwc_mmc_var.h Log Message: Simplify card detect To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/ic/dwc_mmc.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/dwc_mmc_var.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/ic/dwc_mmc.c diff -u src/sys/dev/ic/dwc_mmc.c:1.15 src/sys/dev/ic/dwc_mmc.c:1.16 --- src/sys/dev/ic/dwc_mmc.c:1.15 Mon Sep 3 16:29:31 2018 +++ src/sys/dev/ic/dwc_mmc.c Tue Apr 30 23:19:55 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc_mmc.c,v 1.15 2018/09/03 16:29:31 riastradh Exp $ */ +/* $NetBSD: dwc_mmc.c,v 1.16 2019/04/30 23:19:55 jmcneill Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.15 2018/09/03 16:29:31 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.16 2019/04/30 23:19:55 jmcneill Exp $"); #include #include @@ -266,20 +266,11 @@ static int dwc_mmc_card_detect(sdmmc_chipset_handle_t sch) { struct dwc_mmc_softc *sc = sch; - int v = 0, i; if (!sc->sc_card_detect) return 1; /* no card detect pin, assume present */ - for (i = 0; i < 5; i++) { - v += sc->sc_card_detect(sc); - delay(1000); - } - if (v == 5) - sc->sc_mmc_present = 0; - else if (v == 0) - sc->sc_mmc_present = 1; - return sc->sc_mmc_present; + return sc->sc_card_detect(sc); } static int Index: src/sys/dev/ic/dwc_mmc_var.h diff -u src/sys/dev/ic/dwc_mmc_var.h:1.7 src/sys/dev/ic/dwc_mmc_var.h:1.8 --- src/sys/dev/ic/dwc_mmc_var.h:1.7 Tue Jun 19 22:44:33 2018 +++ src/sys/dev/ic/dwc_mmc_var.h Tue Apr 30 23:19:55 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc_mmc_var.h,v 1.7 2018/06/19 22:44:33 jmcneill Exp $ */ +/* $NetBSD: dwc_mmc_var.h,v 1.8 2019/04/30 23:19:55 jmcneill Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -49,7 +49,6 @@ struct dwc_mmc_softc { kcondvar_t sc_idst_cv; int sc_mmc_width; - int sc_mmc_present; int sc_mmc_port; device_t sc_sdmmc_dev;
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Tue Apr 30 23:10:33 UTC 2019 Modified Files: src/sys/dev/fdt: dwcmmc_fdt.c Log Message: Use correct size of softc in CFATTACH_DECL_NEW To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/fdt/dwcmmc_fdt.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/fdt/dwcmmc_fdt.c diff -u src/sys/dev/fdt/dwcmmc_fdt.c:1.7 src/sys/dev/fdt/dwcmmc_fdt.c:1.8 --- src/sys/dev/fdt/dwcmmc_fdt.c:1.7 Sun Aug 12 16:34:28 2018 +++ src/sys/dev/fdt/dwcmmc_fdt.c Tue Apr 30 23:10:33 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dwcmmc_fdt.c,v 1.7 2018/08/12 16:34:28 jmcneill Exp $ */ +/* $NetBSD: dwcmmc_fdt.c,v 1.8 2019/04/30 23:10:33 jmcneill Exp $ */ /*- * Copyright (c) 2015-2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.7 2018/08/12 16:34:28 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.8 2019/04/30 23:10:33 jmcneill Exp $"); #include #include @@ -70,7 +70,7 @@ struct dwcmmc_fdt_softc { u_int sc_ciu_div; }; -CFATTACH_DECL_NEW(dwcmmc_fdt, sizeof(struct dwc_mmc_softc), +CFATTACH_DECL_NEW(dwcmmc_fdt, sizeof(struct dwcmmc_fdt_softc), dwcmmc_fdt_match, dwcmmc_fdt_attach, NULL, NULL); static int
CVS commit: src/sys/arch/arm/rockchip
Module Name:src Committed By: jmcneill Date: Tue Apr 30 22:42:32 UTC 2019 Modified Files: src/sys/arch/arm/rockchip: rk3399_iomux.c Log Message: Fix mux register offset To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/rockchip/rk3399_iomux.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/rockchip/rk3399_iomux.c diff -u src/sys/arch/arm/rockchip/rk3399_iomux.c:1.3 src/sys/arch/arm/rockchip/rk3399_iomux.c:1.4 --- src/sys/arch/arm/rockchip/rk3399_iomux.c:1.3 Tue Apr 30 22:24:27 2019 +++ src/sys/arch/arm/rockchip/rk3399_iomux.c Tue Apr 30 22:42:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rk3399_iomux.c,v 1.3 2019/04/30 22:24:27 jmcneill Exp $ */ +/* $NetBSD: rk3399_iomux.c,v 1.4 2019/04/30 22:42:32 jmcneill Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -29,7 +29,7 @@ //#define RK3399_IOMUX_DEBUG #include -__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.3 2019/04/30 22:24:27 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.4 2019/04/30 22:42:32 jmcneill Exp $"); #include #include @@ -367,7 +367,7 @@ rk3399_iomux_set_mux(struct rk3399_iomux } else { reg = 0x0e000 + (0x10 * (bank - 2)); } - reg += 0x4 * (idx / 4); + reg += 0x4 * (idx / 8); mask = 3 << ((idx & 7) * 2); #ifdef RK3399_IOMUX_DEBUG
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: kamil Date: Tue Apr 30 22:39:31 UTC 2019 Modified Files: src/tests/lib/libc/sys: t_ptrace_wait.c Log Message: Add new ATF ptrace(2) tests: bytes_transfer_eof Assert that error is returned after attempt to read or write post EOF. To generate a diff of this commit: cvs rdiff -u -r1.114 -r1.115 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/tests/lib/libc/sys/t_ptrace_wait.c diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.114 src/tests/lib/libc/sys/t_ptrace_wait.c:1.115 --- src/tests/lib/libc/sys/t_ptrace_wait.c:1.114 Thu Apr 25 19:15:23 2019 +++ src/tests/lib/libc/sys/t_ptrace_wait.c Tue Apr 30 22:39:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.114 2019/04/25 19:15:23 kamil Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.115 2019/04/30 22:39:31 kamil Exp $ */ /*- * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.114 2019/04/25 19:15:23 kamil Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.115 2019/04/30 22:39:31 kamil Exp $"); #include #include @@ -3931,6 +3931,157 @@ BYTES_TRANSFER_ALIGNMENT(bytes_transfer_ /// +static void +bytes_transfer_eof(const char *operation) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + FILE *fp; + char *p; + int vector; + int op; + + struct ptrace_io_desc io; + struct ptrace_siginfo info; + + memset(, 0, sizeof(io)); + memset(, 0, sizeof(info)); + + vector = 0; + + fp = tmpfile(); + ATF_REQUIRE(fp != NULL); + + p = mmap(0, 1, PROT_READ|PROT_WRITE, MAP_PRIVATE, fileno(fp), 0); + ATF_REQUIRE(p != MAP_FAILED); + + DPRINTF("Before forking process PID=%d\n", getpid()); + SYSCALL_REQUIRE((child = fork()) != -1); + if (child == 0) { + DPRINTF("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + DPRINTF("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + DPRINTF("Before exiting of the child process\n"); + _exit(exitval); + } + DPRINTF("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child); + + validate_status_stopped(status, sigval); + + 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); + + if (strcmp(operation, "PT_READ_I") == 0 || + strcmp(operation, "PT_READ_D") == 0) { + if (strcmp(operation, "PT_READ_I")) + op = PT_READ_I; + else + op = PT_READ_D; + + errno = 0; + SYSCALL_REQUIRE(ptrace(op, child, p, 0) == -1); + ATF_REQUIRE_EQ(errno, EINVAL); + } else if (strcmp(operation, "PT_WRITE_I") == 0 || + strcmp(operation, "PT_WRITE_D") == 0) { + if (strcmp(operation, "PT_WRITE_I")) + op = PT_WRITE_I; + else + op = PT_WRITE_D; + + errno = 0; + SYSCALL_REQUIRE(ptrace(op, child, p, vector) == -1); + ATF_REQUIRE_EQ(errno, EINVAL); + } else if (strcmp(operation, "PIOD_READ_I") == 0 || + strcmp(operation, "PIOD_READ_D") == 0) { + if (strcmp(operation, "PIOD_READ_I")) + op = PIOD_READ_I; + else + op = PIOD_READ_D; + + io.piod_op = op; + io.piod_addr = + io.piod_len = sizeof(int); + io.piod_offs = p; + + errno = 0; + SYSCALL_REQUIRE(ptrace(PT_IO, child, , sizeof(io)) == -1); + ATF_REQUIRE_EQ(errno, EINVAL); + } else if (strcmp(operation, "PIOD_WRITE_I") == 0 || + strcmp(operation, "PIOD_WRITE_D") == 0) { + if (strcmp(operation, "PIOD_WRITE_I")) + op = PIOD_WRITE_I; + else + op = PIOD_WRITE_D; + + io.piod_op = op; + io.piod_addr = + io.piod_len = sizeof(int); + io.piod_offs = p; + + errno = 0; + SYSCALL_REQUIRE(ptrace(PT_IO, child, , sizeof(io)) == -1); + ATF_REQUIRE_EQ(errno, EINVAL); + } + + DPRINTF("Before resuming the child process where it left off " + "and without signal to be sent\n"); + 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); + + DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0)); +} + +#define BYTES_TRANSFER_EOF(test, operation)\
CVS commit: src/sys/kern
Module Name:src Committed By: kamil Date: Tue Apr 30 22:32:01 UTC 2019 Modified Files: src/sys/kern: sys_ptrace_common.c Log Message: Reject ptrace(2) PIOD_READ/WRITE operations with length 0 Return EINVAL for such invalid requests. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/kern/sys_ptrace_common.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.49 src/sys/kern/sys_ptrace_common.c:1.50 --- src/sys/kern/sys_ptrace_common.c:1.49 Tue Apr 30 20:50:30 2019 +++ src/sys/kern/sys_ptrace_common.c Tue Apr 30 22:32:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_ptrace_common.c,v 1.49 2019/04/30 20:50:30 kamil Exp $ */ +/* $NetBSD: sys_ptrace_common.c,v 1.50 2019/04/30 22:32:01 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.49 2019/04/30 20:50:30 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.50 2019/04/30 22:32:01 kamil Exp $"); #ifdef _KERNEL_OPT #include "opt_ptrace.h" @@ -1117,6 +1117,10 @@ do_ptrace(struct ptrace_methods *ptm, st case PT_IO: if ((error = ptm->ptm_copyin_piod(, addr, data)) != 0) break; + if (piod.piod_len < 1) { + error = EINVAL; + break; + } if ((error = ptrace_doio(l, t, lt, , addr, false)) != 0) break; if (piod.piod_len < 1) {
CVS commit: src/sys/arch/arm/rockchip
Module Name:src Committed By: jmcneill Date: Tue Apr 30 22:24:27 UTC 2019 Modified Files: src/sys/arch/arm/rockchip: rk3399_iomux.c Log Message: Pull type value mappings are different for each pin, and not based on the bank number. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/rockchip/rk3399_iomux.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/rockchip/rk3399_iomux.c diff -u src/sys/arch/arm/rockchip/rk3399_iomux.c:1.2 src/sys/arch/arm/rockchip/rk3399_iomux.c:1.3 --- src/sys/arch/arm/rockchip/rk3399_iomux.c:1.2 Wed Jan 23 04:21:54 2019 +++ src/sys/arch/arm/rockchip/rk3399_iomux.c Tue Apr 30 22:24:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rk3399_iomux.c,v 1.2 2019/01/23 04:21:54 thorpej Exp $ */ +/* $NetBSD: rk3399_iomux.c,v 1.3 2019/04/30 22:24:27 jmcneill Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -29,7 +29,7 @@ //#define RK3399_IOMUX_DEBUG #include -__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.2 2019/01/23 04:21:54 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.3 2019/04/30 22:24:27 jmcneill Exp $"); #include #include @@ -47,15 +47,15 @@ __KERNEL_RCSID(0, "$NetBSD: rk3399_iomux /* PU/PD control */ #define GRF_GPIO_P_CTL(_idx) (0x3 << (((_idx) & 7) * 2)) #define GRF_GPIO_P_WRITE_EN(_idx) (0x3 << (((_idx) & 7) * 2 + 16)) -/* Different bias value mapping for GRF and PMU registers */ -#define GRF_GPIO_P_CTL_Z 0 -#define GRF_GPIO_P_CTL_PULLDOWN 1 -#define GRF_GPIO_P_CTL_Z_ALT 2 -#define GRF_GPIO_P_CTL_PULLUP 3 -#define PMU_GPIO_P_CTL_Z 0 -#define PMU_GPIO_P_CTL_PULLUP 1 -#define PMU_GPIO_P_CTL_PULLDOWN 2 -#define PMU_GPIO_P_CTL_RESERVED 3 +/* Different bias value mapping based on pull type of pin */ +#define IO_DEF_GPIO_P_CTL_Z 0 +#define IO_DEF_GPIO_P_CTL_PULLUP 1 +#define IO_DEF_GPIO_P_CTL_PULLDOWN 2 +#define IO_DEF_GPIO_P_CTL_RESERVED 3 +#define IO_1V8_GPIO_P_CTL_Z 0 +#define IO_1V8_GPIO_P_CTL_PULLDOWN 1 +#define IO_1V8_GPIO_P_CTL_Z_ALT 2 +#define IO_1V8_GPIO_P_CTL_PULLUP 3 /* Drive strength control */ /* Different drive strength value mapping for GRF and PMU registers */ @@ -84,8 +84,14 @@ static int rk3399_drv_strength[5][9] = { [RK3399_DRV_TYPE_IO_3V3] = { 4, 7, 10, 13, 16, 19, 22, 26, -1 }, }; +enum rk3399_pull_type { + RK3399_PULL_TYPE_IO_DEFAULT, + RK3399_PULL_TYPE_IO_1V8_ONLY, +}; + struct rk3399_iomux { enum rk3399_drv_type drv_type; + enum rk3399_pull_type pull_type; }; struct rk3399_iomux_bank { @@ -99,46 +105,66 @@ static const struct rk3399_iomux_bank rk [0] = { .regs = RK_IOMUX_REGS_PMU, .iomux = { - [0] = { .drv_type = RK3399_DRV_TYPE_IO_1V8 }, - [1] = { .drv_type = RK3399_DRV_TYPE_IO_1V8 }, - [2] = { .drv_type = RK3399_DRV_TYPE_IO_DEFAULT }, - [3] = { .drv_type = RK3399_DRV_TYPE_IO_DEFAULT }, + [0] = { .drv_type = RK3399_DRV_TYPE_IO_1V8, +.pull_type = RK3399_PULL_TYPE_IO_1V8_ONLY }, + [1] = { .drv_type = RK3399_DRV_TYPE_IO_1V8, +.pull_type = RK3399_PULL_TYPE_IO_1V8_ONLY }, + [2] = { .drv_type = RK3399_DRV_TYPE_IO_DEFAULT, +.pull_type = RK3399_PULL_TYPE_IO_DEFAULT }, + [3] = { .drv_type = RK3399_DRV_TYPE_IO_DEFAULT, +.pull_type = RK3399_PULL_TYPE_IO_DEFAULT }, }, }, [1] = { .regs = RK_IOMUX_REGS_PMU, .iomux = { - [0] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0 }, - [1] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0 }, - [2] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0 }, - [3] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0 }, + [0] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0, +.pull_type = RK3399_PULL_TYPE_IO_DEFAULT }, + [1] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0, +.pull_type = RK3399_PULL_TYPE_IO_DEFAULT }, + [2] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0, +.pull_type = RK3399_PULL_TYPE_IO_DEFAULT }, + [3] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0, +.pull_type = RK3399_PULL_TYPE_IO_DEFAULT }, } }, [2] = { .regs = RK_IOMUX_REGS_GRF, .iomux = { - [0] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0 }, - [1] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0 }, - [2] = { .drv_type = RK3399_DRV_TYPE_IO_1V8 }, - [3] = { .drv_type = RK3399_DRV_TYPE_IO_1V8 }, + [0] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0, +.pull_type = RK3399_PULL_TYPE_IO_DEFAULT }, + [1] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0, +.pull_type = RK3399_PULL_TYPE_IO_DEFAULT }, + [2] = { .drv_type = RK3399_DRV_TYPE_IO_1V8, +.pull_type = RK3399_PULL_TYPE_IO_1V8_ONLY }, + [3] = { .drv_type = RK3399_DRV_TYPE_IO_1V8, +.pull_type = RK3399_PULL_TYPE_IO_1V8_ONLY }, }, }, [3] = { .regs = RK_IOMUX_REGS_GRF, .iomux = { - [0] = { .drv_type = RK3399_DRV_TYPE_IO_3V3 }, - [1] = { .drv_type = RK3399_DRV_TYPE_IO_3V3 }, - [2] = { .drv_type = RK3399_DRV_TYPE_IO_3V3 }, - [3] = { .drv_type = RK3399_DRV_TYPE_IO_1V8_3V0 }, + [0] = { .drv_type =
CVS commit: src/sys/net
Module Name:src Committed By: kre Date: Tue Apr 30 20:56:32 UTC 2019 Modified Files: src/sys/net: dl_print.c Log Message: Add the missing add. (Return to the earlier state, done differently.) When dl_print() was converted to use lla_snprintf() the offset to the LLA in dl_addr.dl_data was forgotten (dl_data contains both the interface name and the LL addr, we want the latter, not the former). When there is no data (src_len == 0), still null terminate the output buffer (provided there is space in it for the \0). To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/net/dl_print.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/net/dl_print.c diff -u src/sys/net/dl_print.c:1.5 src/sys/net/dl_print.c:1.6 --- src/sys/net/dl_print.c:1.5 Mon Apr 29 19:08:11 2019 +++ src/sys/net/dl_print.c Tue Apr 30 20:56:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dl_print.c,v 1.5 2019/04/29 19:08:11 christos Exp $ */ +/* $NetBSD: dl_print.c,v 1.6 2019/04/30 20:56:32 kre Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -29,10 +29,10 @@ #include #ifdef _KERNEL -__KERNEL_RCSID(0, "$NetBSD: dl_print.c,v 1.5 2019/04/29 19:08:11 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dl_print.c,v 1.6 2019/04/30 20:56:32 kre Exp $"); #include #else -__RCSID("$NetBSD: dl_print.c,v 1.5 2019/04/29 19:08:11 christos Exp $"); +__RCSID("$NetBSD: dl_print.c,v 1.6 2019/04/30 20:56:32 kre Exp $"); #include static const char hexdigits[] = "0123456789abcdef"; #endif @@ -44,8 +44,11 @@ lla_snprintf(char *dst, size_t dst_len, char *dp; const uint8_t *sp, *ep; - if (src_len == 0 || dst_len < 3) + if (src_len == 0 || dst_len < 3) { + if (dst_len != 0) + dst[0] = '\0'; return NULL; + } dp = dst; sp = (const uint8_t *)src; @@ -68,7 +71,7 @@ dl_print(char *buf, size_t len, const st { char abuf[256 * 3]; - lla_snprintf(abuf, sizeof(abuf), dl->dl_data, dl->dl_alen); + lla_snprintf(abuf, sizeof(abuf), dl->dl_data+dl->dl_nlen, dl->dl_alen); return snprintf(buf, len, "%.*s/%hhu#%s", (int)dl->dl_nlen, dl->dl_data, dl->dl_type, abuf); }
CVS commit: src/sys/net
Module Name:src Committed By: kre Date: Tue Apr 30 20:55:41 UTC 2019 Modified Files: src/sys/net: if_dl.h Log Message: Whitespace consistency. NFC. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/net/if_dl.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/net/if_dl.h diff -u src/sys/net/if_dl.h:1.27 src/sys/net/if_dl.h:1.28 --- src/sys/net/if_dl.h:1.27 Mon Apr 29 16:05:46 2019 +++ src/sys/net/if_dl.h Tue Apr 30 20:55:41 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_dl.h,v 1.27 2019/04/29 16:05:46 roy Exp $ */ +/* $NetBSD: if_dl.h,v 1.28 2019/04/30 20:55:41 kre Exp $ */ /* * Copyright (c) 1990, 1993 @@ -119,7 +119,7 @@ __END_DECLS #if defined(_KERNEL) || defined(_TEST) // 255 xx: + 255 'a' + / + # + 3 digits + NUL #define LINK_ADDRSTRLEN ((255 * 4) + 5) -#define LLA_ADDRSTRLEN (16 * 3) +#define LLA_ADDRSTRLEN (16 * 3) char *lla_snprintf(char *, size_t, const void *, size_t); int dl_print(char *, size_t, const struct dl_addr *);
CVS commit: src/sys/kern
Module Name:src Committed By: kamil Date: Tue Apr 30 20:50:30 UTC 2019 Modified Files: src/sys/kern: sys_ptrace_common.c Log Message: Return EIO for empty memory transfer from ptrace(2) Certain operations of PT_READ/PT_WRITE and PIOD_READ/PIOD_WRITE can result in 0 byte transfer and the ptrace(2) call still returned success. GDB had a special handling of this case for PT_IO checking piod_len != 0, but in LLDB this corner case caused infinite loop and breakage. The LLDB case has been enhanced. Unfortunately the status of operation of PT_READ/PT_WRITE is not distinguishable between successful operation and empty opeartion. This renders this call into a questionable one. Change the behavior and return error with EIO in scenarios of truncated/empty byte transfers by PT_READ/PT_WRITE and empty byte transfers from PT_IO. No code changed is needed in GDB and LLDB. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/kern/sys_ptrace_common.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.48 src/sys/kern/sys_ptrace_common.c:1.49 --- src/sys/kern/sys_ptrace_common.c:1.48 Fri Apr 26 08:38:25 2019 +++ src/sys/kern/sys_ptrace_common.c Tue Apr 30 20:50:30 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_ptrace_common.c,v 1.48 2019/04/26 08:38:25 pgoyette Exp $ */ +/* $NetBSD: sys_ptrace_common.c,v 1.49 2019/04/30 20:50:30 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.48 2019/04/26 08:38:25 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.49 2019/04/30 20:50:30 kamil Exp $"); #ifdef _KERNEL_OPT #include "opt_ptrace.h" @@ -1106,6 +1106,10 @@ do_ptrace(struct ptrace_methods *ptm, st piod.piod_op = write ? PIOD_WRITE_D : PIOD_READ_D; if ((error = ptrace_doio(l, t, lt, , addr, true)) != 0) break; + if (piod.piod_len < sizeof(tmp)) { + error = EIO; + break; + } if (!write) *retval = tmp; break; @@ -1115,6 +1119,10 @@ do_ptrace(struct ptrace_methods *ptm, st break; if ((error = ptrace_doio(l, t, lt, , addr, false)) != 0) break; + if (piod.piod_len < 1) { + error = EIO; + break; + } error = ptm->ptm_copyout_piod(, addr, data); break;
CVS commit: src/doc
Module Name:src Committed By: sevan Date: Tue Apr 30 16:23:44 UTC 2019 Modified Files: src/doc: CHANGES Log Message: CARP, Veriexec, bufq_priocscan(9) To generate a diff of this commit: cvs rdiff -u -r1.2532 -r1.2533 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.2532 src/doc/CHANGES:1.2533 --- src/doc/CHANGES:1.2532 Mon Apr 29 01:18:58 2019 +++ src/doc/CHANGES Tue Apr 30 16:23:44 2019 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2532 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2533 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -362,5 +362,14 @@ Changes from NetBSD 8.0 to NetBSD 9.0: applying device tree overlays to efiboot. [thorpej 20190421] libpthread(3): Import C11 thread support library [kamil 20190424] dhcpcd(8): Import dhcpcd-7.2.1 [roy 20190426] + carp(4): Enabled by default in GENERIC kernel config of all tier 1 & + most tier 2 ports. See system specific config otherwise. + [sevan 20190426] + veriexec(4): Enabled by default in GENERIC kernel config of all tier 1 + & most tier 2 ports. See system specific config otherwise. + [sevan 20190426] + bufq_priocscan(9): Enabled by default in GENERIC kernel config of all + tier 1 & most tier 2 ports. See system specific config otherwise. + [sevan 20190426] bind: Import version 9.14.1. [christos 20190427] acpi(4): Updated ACPICA to 20190405. [christos 20190428]
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: mrg Date: Tue Apr 30 10:10:45 UTC 2019 Modified Files: src/sys/arch/arm/sunxi: sunxi_platform.c Log Message: turn on the "sun50i-a64-unstable-timer" workaround on "allwinner,sun8i-a83t" compatible CPUs. avoids triggering the KASSERT() on cubietruck plus. idea from jmcneill. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/sunxi/sunxi_platform.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/sunxi/sunxi_platform.c diff -u src/sys/arch/arm/sunxi/sunxi_platform.c:1.35 src/sys/arch/arm/sunxi/sunxi_platform.c:1.36 --- src/sys/arch/arm/sunxi/sunxi_platform.c:1.35 Sun Feb 3 15:43:57 2019 +++ src/sys/arch/arm/sunxi/sunxi_platform.c Tue Apr 30 10:10:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_platform.c,v 1.35 2019/02/03 15:43:57 jmcneill Exp $ */ +/* $NetBSD: sunxi_platform.c,v 1.36 2019/04/30 10:10:45 mrg Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -31,7 +31,7 @@ #include "opt_console.h" #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.35 2019/02/03 15:43:57 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.36 2019/04/30 10:10:45 mrg Exp $"); #include #include @@ -219,6 +219,8 @@ sunxi_platform_device_register(device_t /* Allwinner A64 has an unstable architectural timer */ const char * compat[] = { "allwinner,sun50i-a64", + /* Cubietruck Plus triggers this problem as well. */ + "allwinner,sun8i-a83t", NULL }; if (of_match_compatible(OF_finddevice("/"), compat)) {
CVS commit: src/sys/sys
Module Name:src Committed By: uwe Date: Tue Apr 30 09:23:00 UTC 2019 Modified Files: src/sys/sys: mman.h Log Message: Format MAP_FMT so that it's more humanly readable - missed one bit in previous. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/sys/mman.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/mman.h diff -u src/sys/sys/mman.h:1.60 src/sys/sys/mman.h:1.61 --- src/sys/sys/mman.h:1.60 Mon Apr 29 23:12:12 2019 +++ src/sys/sys/mman.h Tue Apr 30 09:23:00 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mman.h,v 1.60 2019/04/29 23:12:12 uwe Exp $ */ +/* $NetBSD: mman.h,v 1.61 2019/04/30 09:23:00 uwe Exp $ */ /*- * Copyright (c) 1982, 1986, 1993 @@ -131,7 +131,7 @@ typedef __off_t off_t; /* file offset "F\14\1\0"\ ":\0" "FILE\0" \ ":\1" "ANONYMOUS\0" \ - "b\15STACK\0"\ + "b\15" "STACK\0" \ "F\30\010\0"\ ":\000" "ALIGN=NONE\0" \ ":\012" "ALIGN=1KB\0" \
CVS commit: [isaki-audio2] src/sys/dev/pci
Module Name:src Committed By: isaki Date: Tue Apr 30 06:05:02 UTC 2019 Modified Files: src/sys/dev/pci [isaki-audio2]: eap.c Log Message: More adapt to audio2. - Use set_format. - Remove an empty method. - XXX DAC1 and secondary audio device support should be removed. Now mixing two (or more) sources is done by audio layer. To generate a diff of this commit: cvs rdiff -u -r1.99.2.2 -r1.99.2.3 src/sys/dev/pci/eap.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/eap.c diff -u src/sys/dev/pci/eap.c:1.99.2.2 src/sys/dev/pci/eap.c:1.99.2.3 --- src/sys/dev/pci/eap.c:1.99.2.2 Sun Apr 21 07:55:25 2019 +++ src/sys/dev/pci/eap.c Tue Apr 30 06:05:02 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: eap.c,v 1.99.2.2 2019/04/21 07:55:25 isaki Exp $ */ +/* $NetBSD: eap.c,v 1.99.2.3 2019/04/30 06:05:02 isaki Exp $ */ /* $OpenBSD: eap.c,v 1.6 1999/10/05 19:24:42 csapuntz Exp $ */ /* @@ -50,8 +50,13 @@ * ftp://download.intel.com/ial/scalableplatforms/audio/ac97r21.pdf */ +/* + * TODO: + * - Remove DAC1 and secondary audio device support. + */ + #include -__KERNEL_RCSID(0, "$NetBSD: eap.c,v 1.99.2.2 2019/04/21 07:55:25 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: eap.c,v 1.99.2.3 2019/04/30 06:05:02 isaki Exp $"); #include "midi.h" #include "joy_eap.h" @@ -69,7 +74,6 @@ __KERNEL_RCSID(0, "$NetBSD: eap.c,v 1.99 #include #include -#include #include #include @@ -109,9 +113,9 @@ CFATTACH_DECL_NEW(eap, sizeof(struct eap static int eap_open(void *, int); static int eap_query_format(void *, struct audio_format_query *); -static int eap_set_params(void *, int, int, audio_params_t *, - audio_params_t *, stream_filter_list_t *, - stream_filter_list_t *); +static int eap_set_format(void *, int, + const audio_params_t *, const audio_params_t *, + audio_filter_reg_t *, audio_filter_reg_t *); static int eap_trigger_output(void *, void *, void *, int, void (*)(void *), void *, const audio_params_t *); @@ -129,7 +133,6 @@ static int eap1371_mixer_get_port(void * static int eap1370_query_devinfo(void *, mixer_devinfo_t *); static void *eap_malloc(void *, int, size_t); static void eap_free(void *, void *, size_t); -static size_t eap_round_buffersize(void *, int, size_t); static int eap_get_props(void *); static void eap1370_set_mixer(struct eap_softc *, int, int); static uint32_t eap1371_src_wait(struct eap_softc *); @@ -157,7 +160,7 @@ static void eap_uart_txrdy(struct eap_so static const struct audio_hw_if eap1370_hw_if = { .open = eap_open, .query_format = eap_query_format, - .set_params = eap_set_params, + .set_format = eap_set_format, .halt_output = eap_halt_output, .halt_input = eap_halt_input, .getdev = eap_getdev, @@ -166,7 +169,6 @@ static const struct audio_hw_if eap1370_ .query_devinfo = eap1370_query_devinfo, .allocm = eap_malloc, .freem = eap_free, - .round_buffersize = eap_round_buffersize, .get_props = eap_get_props, .trigger_output = eap_trigger_output, .trigger_input = eap_trigger_input, @@ -176,7 +178,7 @@ static const struct audio_hw_if eap1370_ static const struct audio_hw_if eap1371_hw_if = { .open = eap_open, .query_format = eap_query_format, - .set_params = eap_set_params, + .set_format = eap_set_format, .halt_output = eap_halt_output, .halt_input = eap_halt_input, .getdev = eap_getdev, @@ -185,7 +187,6 @@ static const struct audio_hw_if eap1371_ .query_devinfo = eap1371_query_devinfo, .allocm = eap_malloc, .freem = eap_free, - .round_buffersize = eap_round_buffersize, .get_props = eap_get_props, .trigger_output = eap_trigger_output, .trigger_input = eap_trigger_input, @@ -209,24 +210,19 @@ static struct audio_device eap_device = "eap" }; -#define EAP_NFORMATS 4 -#define EAP_FORMAT(enc, prec, ch, chmask) \ - { \ - .mode = AUMODE_PLAY | AUMODE_RECORD, \ - .encoding = (enc), \ - .validbits = (prec), \ - .precision = (prec), \ - .channels = (ch), \ - .channel_mask = (chmask), \ - .frequency_type = 0, \ - .frequency = { 4000, 48000 }, \ - } -static const struct audio_format eap_formats[EAP_NFORMATS] = { - EAP_FORMAT(AUDIO_ENCODING_SLINEAR_LE, 16, 2, AUFMT_STEREO), - EAP_FORMAT(AUDIO_ENCODING_SLINEAR_LE, 16, 1, AUFMT_MONAURAL), - EAP_FORMAT(AUDIO_ENCODING_ULINEAR_LE, 8, 2, AUFMT_STEREO), - EAP_FORMAT(AUDIO_ENCODING_ULINEAR_LE, 8, 1, AUFMT_MONAURAL), +static const struct audio_format eap_formats[] = { + { + .mode = AUMODE_PLAY | AUMODE_RECORD, + .encoding = AUDIO_ENCODING_SLINEAR_LE, + .validbits = 16, + .precision = 16, + .channels = 2, + .channel_mask = AUFMT_STEREO, + .frequency_type = 2, + .frequency = { 4000, 48000 }, + }, }; +#define EAP_NFORMATS __arraycount(eap_formats) static int eap_match(device_t parent, cfdata_t match, void *aux) @@ -944,54 +940,37 @@ eap_query_format(void *addr, struct audi