From owner-svn-src-all@freebsd.org Sun Apr 17 00:55:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F5E5AEE31E; Sun, 17 Apr 2016 00:55:28 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 134B912F5; Sun, 17 Apr 2016 00:55:28 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from Silverstone.nc-us.unovitch.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 6FA5F180E; Sun, 17 Apr 2016 00:55:27 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Date: Sat, 16 Apr 2016 20:55:29 -0400 From: Jason Unovitch To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298107 - in head: . bin/cat bin/cat/tests bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/date/tests bin/dd bin/dd/tests bin/df bin/domainname bin/echo bin/ed bin/expr bin/e... Message-ID: <20160417005529.GA80671@Silverstone.nc-us.unovitch.com> References: <201604160745.u3G7jV8j080717@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-action=pgp-signed In-Reply-To: <201604160745.u3G7jV8j080717@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 00:55:28 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On Sat, Apr 16, 2016 at 07:45:31AM +0000, Glen Barber wrote: > Author: gjb > Date: Sat Apr 16 07:45:30 2016 > New Revision: 298107 > URL: https://svnweb.freebsd.org/changeset/base/298107 > > Log: > Merge the projects/release-pkg branch to head. > > This allows packaging the base system with pkg(8), including > but not limited to providing the ability to provide upstream > binary update possibilities for non-tier-1 architectures. > > This merge is a requirement of the 11.0-RELEASE, and as such, > thank you to everyone that has tested the project branch. > > Documentation in build(7) etc. is still somewhat sparse, but > updates to those parts will follow. > > Sponsored by: The FreeBSD Foundation > > Added: > head/lib/libcapsicum/ > - copied from r298104, projects/release-pkg/lib/libcapsicum/ > head/libexec/casper/ > - copied from r298104, projects/release-pkg/libexec/casper/ Hi Glen, It looks like this brought back the libcapsicum and capser directories that were removed by oshogbo@ in r296047 during the switch to libcapser. See: https://svnweb.FreeBSD.org/changeset/base/296047 Thanks! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJXEt75XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0NURGNTQ1OTkzQkJFMzc3OTNDQUNERUU2 RkQ0OUMzMDE2MUNBQTZFAAoJEG/UnDAWHKpuP1MH/jdd9TFtm8V/102gqKzpE7cE 8noF8v1UAUbv8absOQDQ+1hP9d4u+zPaz6tUT0tC0qpEY0o9ETZ3x13BO1r6o0W7 PcLKO7mzxjRensOzWS6h35I50HB2Pk4UWOjKMKWC+9hLBde4GcsTStnQ0tR8gXPM hbcaDMMLjbpqI87EYuDD3dmAmfINNP5R1JzC1tS1HHBDcobhyRqzV3zgMXkBdiGF Nv+wtLl7ovrSoU9UsikgKWoputNMu7zUXEYZ0KxAHi7C1GXpeS1VNRJGYATATuso B+MVYAEPP2HPX55gA4g3pnMStPOpkpaWnWk2B+YicXsIC6BEMn24UGjdg0VcSgQ= =IvQY -----END PGP SIGNATURE----- From owner-svn-src-all@freebsd.org Sun Apr 17 01:19:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDC40AEEDC5; Sun, 17 Apr 2016 01:19:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id AD71C1061; Sun, 17 Apr 2016 01:19:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 53FD21C75; Sun, 17 Apr 2016 01:19:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Sun, 17 Apr 2016 01:19:35 +0000 From: Glen Barber To: Jason Unovitch Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r298107 - in head: . bin/cat bin/cat/tests bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/date/tests bin/dd bin/dd/tests bin/df bin/domainname bin/echo bin/ed bin/expr bin/e... Message-ID: <20160417011934.GN1554@FreeBSD.org> References: <201604160745.u3G7jV8j080717@repo.freebsd.org> <20160417005529.GA80671@Silverstone.nc-us.unovitch.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="H83aLI5Lttn3Hg7B" Content-Disposition: inline In-Reply-To: <20160417005529.GA80671@Silverstone.nc-us.unovitch.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 01:19:37 -0000 --H83aLI5Lttn3Hg7B Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 16, 2016 at 08:55:29PM -0400, Jason Unovitch wrote: > On Sat, Apr 16, 2016 at 07:45:31AM +0000, Glen Barber wrote: > > Author: gjb > > Date: Sat Apr 16 07:45:30 2016 > > New Revision: 298107 > > URL: https://svnweb.freebsd.org/changeset/base/298107 > >=20 > > Log: > > Merge the projects/release-pkg branch to head. > > =20 > > This allows packaging the base system with pkg(8), including > > but not limited to providing the ability to provide upstream > > binary update possibilities for non-tier-1 architectures. > > =20 > > This merge is a requirement of the 11.0-RELEASE, and as such, > > thank you to everyone that has tested the project branch. > > =20 > > Documentation in build(7) etc. is still somewhat sparse, but > > updates to those parts will follow. > > =20 > > Sponsored by: The FreeBSD Foundation > >=20 > > Added: > > head/lib/libcapsicum/ > > - copied from r298104, projects/release-pkg/lib/libcapsicum/ > > head/libexec/casper/ > > - copied from r298104, projects/release-pkg/libexec/casper/ >=20 >=20 > Hi Glen, > It looks like this brought back the libcapsicum and capser directories > that were removed by oshogbo@ in r296047 during the switch to libcapser. >=20 You are correct, thank you. Build-testing with them removed now just to be sure there was nothing missed in merging between the branches. Thank you for spotting this. Glen --H83aLI5Lttn3Hg7B Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXEuSiAAoJEAMUWKVHj+KTSj0P/iebsfmEd7wRMhtpz/P0O6a8 d1HlPjqDSWhj1nKt35p3+O9q6UpomBgix9d3DjaMFhHX4Es7XcfnjyDLeDO/dxGe aSK7difukHG0mpZ/J7oX8UgPtDJydTEw9HhediP5HnLVQZbI4cvQBwAf6tkIsRsN VGB2iDtW615EZsVLv0K4E98vVujP+4OPe1Ac61WQPKzcMpCrBC/6zI9j3fSs98HF 5H++Lf9TXFE8DBGT1FfqvfqfzoxWTGXLE7lzSyYVTifooC/ZRZbr8JqXePOjv40i 9jkU8B0v0jKvpYaX1R5KGMXNQqN3ZtewDs4Dbg7fp39tGWVBgK/DPIaZ74QLU2Xs LRup0SxKOW/mww44YKGgNbpROYKCzt2vDX2iNB4+vzznXL18cKpG6wAmuS6cnxxH CNQfTZRTw/F/w+Q4yKw1jT1c9umYBy6FOZ/5CXG2Ei6+fi7K3LzZRYYxgYyHDvFH kqyraSS107/2Ej4CojFs+rMH1pOlORpMUGztIvbLx31+IJ1uN5BWgYF+tuLOkw9o 12XKgJnQaxvkOLtdEU90l/wc5p/9G7i67LnTRcibwwy8h0vyQJLtz2K8IMa1/lOQ zUznF2dmgxQ+LCFaGkBpvnh5GSS0yKXcepjzSALBTwXTYMkJG8JnXDJM5IoNcm4k VXopzrF48luwi4XUSi16 =5uwx -----END PGP SIGNATURE----- --H83aLI5Lttn3Hg7B-- From owner-svn-src-all@freebsd.org Sun Apr 17 01:35:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB14B0A449; Sun, 17 Apr 2016 01:35:58 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9751519F5; Sun, 17 Apr 2016 01:35:58 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H1ZvLD012442; Sun, 17 Apr 2016 01:35:57 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H1Zv1H012441; Sun, 17 Apr 2016 01:35:57 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201604170135.u3H1Zv1H012441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 17 Apr 2016 01:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298134 - stable/10/sys/cam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 01:35:58 -0000 Author: scottl Date: Sun Apr 17 01:35:57 2016 New Revision: 298134 URL: https://svnweb.freebsd.org/changeset/base/298134 Log: MFC r298004: Add a devctl/devd notification conduit for CAM errors that happen at the periph level. Due to not merging the changes to ata_res_sbuf(), this version is a little messy. Sponsored by: Netflix Modified: stable/10/sys/cam/cam_periph.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_periph.c ============================================================================== --- stable/10/sys/cam/cam_periph.c Sat Apr 16 22:02:32 2016 (r298133) +++ stable/10/sys/cam/cam_periph.c Sun Apr 17 01:35:57 2016 (r298134) @@ -86,6 +86,7 @@ static int camperiphscsisenseerror(unio u_int32_t *timeout, u_int32_t *action, const char **action_string); +static void cam_periph_devctl_notify(union ccb *ccb); static int nperiph_drivers; static int initialized = 0; @@ -1615,7 +1616,7 @@ cam_periph_error(union ccb *ccb, cam_fla struct cam_periph *periph; const char *action_string; cam_status status; - int frozen, error, openings; + int frozen, error, openings, devctl_err; u_int32_t action, relsim_flags, timeout; action = SSQ_PRINT_SENSE; @@ -1624,9 +1625,26 @@ cam_periph_error(union ccb *ccb, cam_fla status = ccb->ccb_h.status; frozen = (status & CAM_DEV_QFRZN) != 0; status &= CAM_STATUS_MASK; - openings = relsim_flags = timeout = 0; + devctl_err = openings = relsim_flags = timeout = 0; orig_ccb = ccb; + /* Filter the errors that should be reported via devctl */ + switch (ccb->ccb_h.status & CAM_STATUS_MASK) { + case CAM_CMD_TIMEOUT: + case CAM_REQ_ABORTED: + case CAM_REQ_CMP_ERR: + case CAM_REQ_TERMIO: + case CAM_UNREC_HBA_ERROR: + case CAM_DATA_RUN_ERR: + case CAM_SCSI_STATUS_ERROR: + case CAM_ATA_STATUS_ERROR: + case CAM_SMP_STATUS_ERROR: + devctl_err++; + break; + default: + break; + } + switch (status) { case CAM_REQ_CMP: error = 0; @@ -1754,6 +1772,9 @@ cam_periph_error(union ccb *ccb, cam_fla xpt_print(ccb->ccb_h.path, "Retrying command\n"); } + if (devctl_err) + cam_periph_devctl_notify(orig_ccb); + if ((action & SSQ_LOST) != 0) { lun_id_t lun_id; @@ -1824,3 +1845,83 @@ cam_periph_error(union ccb *ccb, cam_fla return (error); } + +#define CAM_PERIPH_DEVD_MSG_SIZE 256 + +static void +cam_periph_devctl_notify(union ccb *ccb) +{ + struct cam_periph *periph; + struct ccb_getdev *cgd; + struct sbuf sb; + int serr, sk, asc, ascq; + char *sbmsg, *type; + + sbmsg = malloc(CAM_PERIPH_DEVD_MSG_SIZE, M_CAMPERIPH, M_NOWAIT); + if (sbmsg == NULL) + return; + + sbuf_new(&sb, sbmsg, CAM_PERIPH_DEVD_MSG_SIZE, SBUF_FIXEDLEN); + + periph = xpt_path_periph(ccb->ccb_h.path); + sbuf_printf(&sb, "device=%s%d ", periph->periph_name, + periph->unit_number); + + sbuf_printf(&sb, "serial=\""); + if ((cgd = (struct ccb_getdev *)xpt_alloc_ccb_nowait()) != NULL) { + xpt_setup_ccb(&cgd->ccb_h, ccb->ccb_h.path, + CAM_PRIORITY_NORMAL); + cgd->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)cgd); + + if (cgd->ccb_h.status == CAM_REQ_CMP) + sbuf_bcat(&sb, cgd->serial_num, cgd->serial_num_len); + } + sbuf_printf(&sb, "\" "); + sbuf_printf(&sb, "cam_status=\"0x%x\" ", ccb->ccb_h.status); + + switch (ccb->ccb_h.status & CAM_STATUS_MASK) { + case CAM_CMD_TIMEOUT: + sbuf_printf(&sb, "timeout=%d ", ccb->ccb_h.timeout); + type = "timeout"; + break; + case CAM_SCSI_STATUS_ERROR: + sbuf_printf(&sb, "scsi_status=%d ", ccb->csio.scsi_status); + if (scsi_extract_sense_ccb(ccb, &serr, &sk, &asc, &ascq)) + sbuf_printf(&sb, "scsi_sense=\"%02x %02x %02x %02x\" ", + serr, sk, asc, ascq); + type = "error"; + break; + case CAM_ATA_STATUS_ERROR: + { + char res_str[(11 * 3) + 1]; + + sbuf_printf(&sb, "RES=\"%s\" ", ata_res_string(&ccb->ataio.res, + res_str, sizeof(res_str))); + type = "error"; + break; + } + default: + type = "error"; + break; + } + + if (ccb->ccb_h.func_code == XPT_SCSI_IO) { + sbuf_printf(&sb, "CDB=\""); + if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0) + scsi_cdb_sbuf(ccb->csio.cdb_io.cdb_ptr, &sb); + else + scsi_cdb_sbuf(ccb->csio.cdb_io.cdb_bytes, &sb); + sbuf_printf(&sb, "\" "); + } else if (ccb->ccb_h.func_code == XPT_ATA_IO) { + sbuf_printf(&sb, "ACB=\""); + ata_cmd_sbuf(&ccb->ataio.cmd, &sb); + sbuf_printf(&sb, "\" "); + } + + if (sbuf_finish(&sb) == 0) + devctl_notify("CAM", "periph", type, sbuf_data(&sb)); + sbuf_delete(&sb); + free(sbmsg, M_CAMPERIPH); +} + From owner-svn-src-all@freebsd.org Sun Apr 17 01:38:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B90C3B0A50A; Sun, 17 Apr 2016 01:38:38 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BF3D1B67; Sun, 17 Apr 2016 01:38:38 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H1cbLs012578; Sun, 17 Apr 2016 01:38:37 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H1cbVZ012577; Sun, 17 Apr 2016 01:38:37 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201604170138.u3H1cbVZ012577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 17 Apr 2016 01:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298135 - stable/10/sbin/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 01:38:38 -0000 Author: scottl Date: Sun Apr 17 01:38:37 2016 New Revision: 298135 URL: https://svnweb.freebsd.org/changeset/base/298135 Log: Merge r298008 Update the devd.conf man page to describe the new CAM/periph system/subsystem. Sponsored by: Netflix Modified: stable/10/sbin/devd/devd.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/devd/devd.conf.5 ============================================================================== --- stable/10/sbin/devd/devd.conf.5 Sun Apr 17 01:35:57 2016 (r298134) +++ stable/10/sbin/devd/devd.conf.5 Sun Apr 17 01:38:37 2016 (r298135) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd July 11, 2015 +.Dd April 14, 2016 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -492,6 +492,23 @@ Information about the state of the syste Notification that the system has woken from the suspended state. .El .El +.Pp +.It Li CAM +Events related to the +.Xr cam 4 +system. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li periph +Events related to peripheral devices. +.Bl -tag -width ".li timeout" -compact +.It Sy Type +.It Li error +Generic errors. +.It Li timeout +Command timeouts. +.El +.El .El .Pp A link state change to UP on the interface @@ -621,4 +638,5 @@ has many additional examples. .Xr coretemp 4 , .Xr devfs 5 , .Xr re_format 7 , -.Xr devd 8 +.Xr devd 8 , +.Xr cam 4 From owner-svn-src-all@freebsd.org Sun Apr 17 01:54:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13280B0AC0B; Sun, 17 Apr 2016 01:54:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D195412B7; Sun, 17 Apr 2016 01:54:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x235.google.com with SMTP id f1so47559959igr.1; Sat, 16 Apr 2016 18:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=ePNX43V5ao9HEvhHR/N5Dcxu+QgK4Jablh6t7vIneyI=; b=OEDH6PfPax5ZM88kTzfBp2/1hk9VruS6bN4EGntQyxrJHr3mr4RQ3S/yhMv8LAmnoK GKFGEkyFH46mR6ezvHvikjF8CppR/oL9cSa/jNRYQQoWnkvAI9WTV8nWoGOHByAuxnsU IaEmNn7FgSK9O/OU5vGjUgdpgb9arWRP8g9B+HTOTjmg+N08XkpX3gS+iTbla5+0oQYg SX9DcYGPBMlQaSrNFoogZEmsMNbDQ6AsQ1iR5dneRIDJ7HUgosLPQ+Fqwn5x1dPXm7VK PDslIXckVHKv+FRXOreP1N1xnW7MrGvb0C5FJtpmM+ooTZqgyZ71qmpM2muqgiJO+lC6 Hu4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=ePNX43V5ao9HEvhHR/N5Dcxu+QgK4Jablh6t7vIneyI=; b=ce4QlbWSnoiDhmVOeBUoOq3osu8/WX4YSsSm1MWzclguuyWYrkKYtVBvG7pdmdNqlr 3lRV5a5kbCdaW0R5vo/EnNDTA99aYmNyGbQD/3QOIukzpdHeMa0xCspJPb5Nq51QlAp7 6FDux39hfiCw2szeB7Ae70cHSFmgJjX/+0AjlXXsAvSuxjd/8+P3gbNVQUGWVkaCuL5h iedfknk64F0MVaiMs+CiOhVzEUUMKQa8efsqvAWVn/wIgjQlfbLiLjb3CbG+TOgWE3p1 lVUsvPDdxaOjd0eB93jWBcjh1KDoulpaJ0gzQ3NxeO30LoXC64KDK6A/b1qBuSiqitOH gJFA== X-Gm-Message-State: AOPr4FU7qNAcQ4Ic13Tke8ot3QgtrTwMi3K7+Om9uA15TU+FnKk08TNsc/jPCQ/oKTXFdxykYc9y5o91ru/h+A== MIME-Version: 1.0 X-Received: by 10.50.50.234 with SMTP id f10mr12546506igo.37.1460858077241; Sat, 16 Apr 2016 18:54:37 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Sat, 16 Apr 2016 18:54:37 -0700 (PDT) In-Reply-To: <1238F0D7-7B11-4D4F-BA6C-36993B9B9B51@lists.zabbadoz.net> References: <201604161944.u3GJif5G006451@repo.freebsd.org> <1238F0D7-7B11-4D4F-BA6C-36993B9B9B51@lists.zabbadoz.net> Date: Sat, 16 Apr 2016 18:54:37 -0700 Message-ID: Subject: Re: svn commit: r298127 - head/sys/mips/mediatek From: Adrian Chadd To: "Bjoern A. Zeeb" Cc: Stanislav Galabov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 01:54:38 -0000 heh, I'll talk with stanislav and we'll go create a separate thing in sys/kern/ so we can eliminate the code duplication. -a On 16 April 2016 at 14:20, Bjoern A. Zeeb wrote: > >> On 16 Apr 2016, at 19:44 , Stanislav Galabov wrot= e: >> >> Author: sgalabov >> Date: Sat Apr 16 19:44:41 2016 >> New Revision: 298127 >> URL: https://svnweb.freebsd.org/changeset/base/298127 >> >> Log: >> Add support for boot arguments specification via fdt >> > > Wooooohoooo, another copy =E2=80=A6 one day someone will not paste my XXX= -BZ anymore but do what it says (I failed myself, but I might be happy to h= elp). > > /bz > > From owner-svn-src-all@freebsd.org Sun Apr 17 01:55:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0658BB0ACBE; Sun, 17 Apr 2016 01:55:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C730A1453; Sun, 17 Apr 2016 01:55:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x230.google.com with SMTP id o126so167413300iod.0; Sat, 16 Apr 2016 18:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=LJR97OZO2BFL7cGWjZDgpp6mHRFgB+YYhYJT2gSqyTo=; b=L5TS8xliMPH7czkPrWSGg0Hnc5UjILyFcaU9rHE3Sh4rNBPgK+WZrFH15b9Go+bk1r xlRFQtSH4FfL4LaoTD2Mlq3cmGJ1/SkXAxR2yXoIKXp82f2gszPYVKtx/ljM19PQ3UFq 1pIl+i9EZ+TSWu1MIPtSQKal74A/qlhR1M8w8IOX+D5MUvbijiH0LADzwqwfY4wIbyjB o7N8x/FWUYBjQgAS+SY9yh4k4suVxCX+FT69HPXOCJISNxgPquuTkRIaCSlk+73sRUz9 gVpdr742h4dBodbSq4lHw+xfeSw5hAO31K93DONj8e/GgfwA98t0ZDBQeAafsQ1/3ybA hmVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=LJR97OZO2BFL7cGWjZDgpp6mHRFgB+YYhYJT2gSqyTo=; b=Wf7lry0oiKPdm9tIFz8r/J2VS8HQo8LMhDwINI4p1OmLKTrUguw2hK83+a4QAassXZ K3ti189+pDHCZPD9CV1l1YGF/1XGfntCWk6ATUTRROWMT0mGhJDv88AC6DTD9xIUKbrQ w+EbAJOvh5h7534UHGtj2IRh2lWGwbZkdGXdD8wFneQbBnazEpZgIU035fuD1jNCqgSp xmvNxJMhlbL7T3wEtvnPFH2ZzUwyV8UTld5f2kL40izRGtnkX6zBbsx+0Ul0emvRbaxy pJwUbZzN8Tm93QPtk6nnHf4B2I6j6xk696a6wQfsY6eyl0uxY9oZt/nu8UrgoXdOsI7q 6Ehw== X-Gm-Message-State: AOPr4FXeql+Lc+CRF7gxUoYNVtjfl1flDRQ2qC761xUTw+rZO3MXJN8J9NG7l/wlG4+DwlGLNc/0ahgpd4KdcA== MIME-Version: 1.0 X-Received: by 10.107.134.166 with SMTP id q38mr28732986ioi.165.1460858122751; Sat, 16 Apr 2016 18:55:22 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Sat, 16 Apr 2016 18:55:22 -0700 (PDT) In-Reply-To: <201604151526.u3FFQVGX077303@repo.freebsd.org> References: <201604151526.u3FFQVGX077303@repo.freebsd.org> Date: Sat, 16 Apr 2016 18:55:22 -0700 Message-ID: Subject: Re: svn commit: r298060 - head/sys/dev/flash From: Adrian Chadd To: Stanislav Galabov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 01:55:24 -0000 HI! You need to wrap that ofw compat_data in #ifdef FDT . I'll do it soon, but if you see this before I've done it, this is your implied commit "ok". -adrian On 15 April 2016 at 08:26, Stanislav Galabov wrote: > Author: sgalabov > Date: Fri Apr 15 15:26:31 2016 > New Revision: 298060 > URL: https://svnweb.freebsd.org/changeset/base/298060 > > Log: > Make mx25l compatible with jedec,spi-nor as well > > A lot of dts files define the SPI flashes supported by mx25l as > compatible with 'jedec,spi-nor', so we add this to the mx25l > compat_data. > > Approved by: adrian (mentor) > Sponsored by: Smartcom - Bulgaria AD > Differential Revision: https://reviews.freebsd.org/D5962 > > Modified: > head/sys/dev/flash/mx25l.c > > Modified: head/sys/dev/flash/mx25l.c > ============================================================================== > --- head/sys/dev/flash/mx25l.c Fri Apr 15 15:24:42 2016 (r298059) > +++ head/sys/dev/flash/mx25l.c Fri Apr 15 15:26:31 2016 (r298060) > @@ -432,6 +432,12 @@ mx25l_set_4b_mode(device_t dev, uint8_t > return (err); > } > > +static struct ofw_compat_data compat_data[] = { > + { "st,m25p", 1 }, > + { "jedec,spi-nor", 1 }, > + { NULL, 0 }, > +}; > + > static int > mx25l_probe(device_t dev) > { > @@ -439,7 +445,7 @@ mx25l_probe(device_t dev) > #ifdef FDT > if (!ofw_bus_status_okay(dev)) > return (ENXIO); > - if (!ofw_bus_is_compatible(dev, "st,m25p")) > + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) > return (ENXIO); > #endif > device_set_desc(dev, "M25Pxx Flash Family"); > From owner-svn-src-all@freebsd.org Sun Apr 17 02:05:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4E57B100DF; Sun, 17 Apr 2016 02:05:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 851B51A30; Sun, 17 Apr 2016 02:05:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H25j1U021449; Sun, 17 Apr 2016 02:05:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H25jrw021447; Sun, 17 Apr 2016 02:05:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604170205.u3H25jrw021447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 17 Apr 2016 02:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298136 - head/sys/dev/flash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 02:05:46 -0000 Author: adrian Date: Sun Apr 17 02:05:45 2016 New Revision: 298136 URL: https://svnweb.freebsd.org/changeset/base/298136 Log: Only compile the FDT bits when we are using FDT. Modified: head/sys/dev/flash/at45d.c head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Sun Apr 17 01:38:37 2016 (r298135) +++ head/sys/dev/flash/at45d.c Sun Apr 17 02:05:45 2016 (r298136) @@ -121,7 +121,7 @@ static int at45d_get_status(device_t dev, uint8_t *status) { uint8_t rxBuf[8], txBuf[8]; - struct spi_command cmd; + struct spi_command cmd = SPI_COMMAND_INITIALIZER; int err; memset(&cmd, 0, sizeof(cmd)); @@ -141,7 +141,7 @@ static int at45d_get_mfg_info(device_t dev, uint8_t *resp) { uint8_t rxBuf[8], txBuf[8]; - struct spi_command cmd; + struct spi_command cmd = SPI_COMMAND_INITIALIZER; int err; memset(&cmd, 0, sizeof(cmd)); @@ -303,7 +303,7 @@ at45d_task(void *arg) uint8_t rxBuf[8], txBuf[8]; struct at45d_softc *sc; struct bio *bp; - struct spi_command cmd; + struct spi_command cmd = SPI_COMMAND_INITIALIZER; device_t dev, pdev; caddr_t buf; u_long len, resid; Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Sun Apr 17 01:38:37 2016 (r298135) +++ head/sys/dev/flash/mx25l.c Sun Apr 17 02:05:45 2016 (r298136) @@ -432,11 +432,13 @@ mx25l_set_4b_mode(device_t dev, uint8_t return (err); } +#ifdef FDT static struct ofw_compat_data compat_data[] = { { "st,m25p", 1 }, { "jedec,spi-nor", 1 }, { NULL, 0 }, }; +#endif static int mx25l_probe(device_t dev) From owner-svn-src-all@freebsd.org Sun Apr 17 02:06:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35C37B1012D; Sun, 17 Apr 2016 02:06:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06B571BB0; Sun, 17 Apr 2016 02:06:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H26A8Q021509; Sun, 17 Apr 2016 02:06:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H26A0w021508; Sun, 17 Apr 2016 02:06:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201604170206.u3H26A0w021508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 17 Apr 2016 02:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298137 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 02:06:11 -0000 Author: imp Date: Sun Apr 17 02:06:10 2016 New Revision: 298137 URL: https://svnweb.freebsd.org/changeset/base/298137 Log: Dell has an OEM drive from Samsung that has issues. NCQ Trim isn't broken on this drive, but it doesn't support it and the fallback logic is failing. Quirk it until those issues can be resolved in a more generic way. Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Apr 17 02:05:45 2016 (r298136) +++ head/sys/cam/ata/ata_da.c Sun Apr 17 02:06:10 2016 (r298137) @@ -588,6 +588,15 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Samsung PM851 Series SSDs Dell OEM + * device model "SAMSUNG SSD PM851 mSATA 256GB" + * 4k optimised, NCQ broken + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG SSD PM851*", "*" }, + /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-all@freebsd.org Sun Apr 17 02:39:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA913B10A9C; Sun, 17 Apr 2016 02:39:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB9516C1; Sun, 17 Apr 2016 02:39:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H2dwRY030482; Sun, 17 Apr 2016 02:39:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H2dwIw030481; Sun, 17 Apr 2016 02:39:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604170239.u3H2dwIw030481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 17 Apr 2016 02:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298138 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 02:39:59 -0000 Author: adrian Date: Sun Apr 17 02:39:58 2016 New Revision: 298138 URL: https://svnweb.freebsd.org/changeset/base/298138 Log: [urtwn] set the A-MPDU density to 16. Obtained from: Linux rtlwifi/rtl8xxxu Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Sun Apr 17 02:06:10 2016 (r298137) +++ head/sys/dev/urtwn/if_urtwn.c Sun Apr 17 02:39:58 2016 (r298138) @@ -791,6 +791,10 @@ urtwn_vap_create(struct ieee80211com *ic vap->iv_key_alloc = urtwn_key_alloc; vap->iv_key_set = urtwn_key_set; vap->iv_key_delete = urtwn_key_delete; + + /* 802.11n parameters */ + vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_16; + if (opmode == IEEE80211_M_IBSS) { uvp->recv_mgmt = vap->iv_recv_mgmt; vap->iv_recv_mgmt = urtwn_ibss_recv_mgmt; From owner-svn-src-all@freebsd.org Sun Apr 17 02:51:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3B00B10EF1; Sun, 17 Apr 2016 02:51:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B81C1D3F; Sun, 17 Apr 2016 02:51:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H2p4Xv033628; Sun, 17 Apr 2016 02:51:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H2p43o033627; Sun, 17 Apr 2016 02:51:04 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201604170251.u3H2p43o033627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 17 Apr 2016 02:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298139 - in head: lib/libcapsicum libexec/casper X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 02:51:05 -0000 Author: gjb Date: Sun Apr 17 02:51:04 2016 New Revision: 298139 URL: https://svnweb.freebsd.org/changeset/base/298139 Log: Remove lib/libcapsicum and libexec/casper, brought back as part of a merge mishap. Reported by: junovitch Sponsored by: The FreeBSD Foundation Deleted: head/lib/libcapsicum/ head/libexec/casper/ From owner-svn-src-all@freebsd.org Sun Apr 17 03:45:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80170AED5E1; Sun, 17 Apr 2016 03:45:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5298F1950; Sun, 17 Apr 2016 03:45:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H3jjnt051729; Sun, 17 Apr 2016 03:45:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H3jjro051727; Sun, 17 Apr 2016 03:45:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201604170345.u3H3jjro051727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 17 Apr 2016 03:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298140 - in head/etc: . devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 03:45:46 -0000 Author: gjb Date: Sun Apr 17 03:45:45 2016 New Revision: 298140 URL: https://svnweb.freebsd.org/changeset/base/298140 Log: Fix etcupdate(8) with rc.sendmail and devd/*. It turns out BIN1 and such in etc/* cannot use FILESGROUPS. Reported by: peter Sponsored by: The FreeBSD Foundation Modified: head/etc/Makefile head/etc/devd/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Apr 17 02:51:04 2016 (r298139) +++ head/etc/Makefile Sun Apr 17 03:45:45 2016 (r298140) @@ -83,13 +83,8 @@ BIN1+= apmd.conf .endif .if ${MK_AUTOFS} != "no" -FILESGROUPS+= AUTOFS -AUTOFS+= auto_master +BIN1+= auto_master .endif -AUTOFSDIR= /etc -AUTOFSMODE= ${BINMODE} -AUTOFSPACKAGE= autofs -AUTOFSTAGS= config .if ${MK_FREEBSD_UPDATE} != "no" BIN1+= freebsd-update.conf @@ -141,12 +136,8 @@ BIN1+= pf.os .endif .if ${MK_SENDMAIL} != "no" -FILESGROUPS+= SENDMAILRC -SENDMAILRC= rc.sendmail +BIN1+= rc.sendmail .endif -SENDMAILRCDIR= /etc -SENDMAILRCMODE= ${BINMODE} -SENDMAILRCPACKAGE=sendmail .if ${MK_TCSH} != "no" BIN1+= csh.cshrc csh.login csh.logout Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Sun Apr 17 02:51:04 2016 (r298139) +++ head/etc/devd/Makefile Sun Apr 17 03:45:45 2016 (r298140) @@ -10,12 +10,7 @@ FILES+= apple.conf .if ${MACHINE} == "amd64" || ${MACHINE} == "i386" .if ${MK_ACPI} != "no" -FILESGROUPS+= ACPI -ACPI= asus.conf -ACPIPACKAGE= acpi -ACPIDIR= /etc/devd -ACPITAGS= config -ACPIMODE= 644 +FILES+= asus.conf .endif .if ${MK_HYPERV} != "no" FILES+= hyperv.conf From owner-svn-src-all@freebsd.org Sun Apr 17 03:57:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76BBFAED9BC; Sun, 17 Apr 2016 03:57:38 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 438201FDE; Sun, 17 Apr 2016 03:57:38 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H3vbHw055169; Sun, 17 Apr 2016 03:57:37 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H3vbjq055168; Sun, 17 Apr 2016 03:57:37 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201604170357.u3H3vbjq055168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Sun, 17 Apr 2016 03:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298141 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 03:57:38 -0000 Author: peter Date: Sun Apr 17 03:57:37 2016 New Revision: 298141 URL: https://svnweb.freebsd.org/changeset/base/298141 Log: Turn ssh_host_dsa_key back on until PR#208254 is taken care of. Modified: head/etc/rc.d/sshd Modified: head/etc/rc.d/sshd ============================================================================== --- head/etc/rc.d/sshd Sun Apr 17 03:45:45 2016 (r298140) +++ head/etc/rc.d/sshd Sun Apr 17 03:57:37 2016 (r298141) @@ -22,7 +22,7 @@ extra_commands="configtest keygen reload : ${sshd_rsa1_enable:="no"} : ${sshd_rsa_enable:="yes"} -: ${sshd_dsa_enable:="no"} +: ${sshd_dsa_enable:="yes"} : ${sshd_ecdsa_enable:="yes"} : ${sshd_ed25519_enable:="yes"} From owner-svn-src-all@freebsd.org Sun Apr 17 04:01:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E72AEDACE; Sun, 17 Apr 2016 04:01:07 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 270201207; Sun, 17 Apr 2016 04:01:07 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x236.google.com with SMTP id er2so39180665pad.3; Sat, 16 Apr 2016 21:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mDHSaA8rlt7BUzas2J7WbOfOqhaBNHBSP2uwa3z9i64=; b=pEccvGeIcQbtGD3+uPau1qq0utQuwYC05GhSr4iklDFec37+cnw0FrPuNIzM6r18nL JAKvPBgF/7gY61rC0VLmQuBfsMt1QRH9a/QEDtCuEbs5fvHDa2+Yx0LaPfKZ7S2YmNYG 0F5anOuqiXGqCpznS0YvnoJ0fTawqQvyMVJz54L1dC07MJ2QHkJS1fWNRVCK13xKpNAM JqTvHRhExNfwmamVRhseKtGZx9yvN7gtO1U1/NlWO4SsT58OVf0LJKSP3Kj9pns7yyOH wgoIA0PRqtgidnRI0WLnnao5aRXait6zBQLtXXd2caj6XIoK3L74lToyn6bEt+i2wutq wuJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mDHSaA8rlt7BUzas2J7WbOfOqhaBNHBSP2uwa3z9i64=; b=jC/+mL19Bz6+b0TyumGGiSHk4Ij9++AobRNwzF3/412zyr27Ntg3O0Df9NyO2Snjqz FthXQMN0oSq4GLHqSs9okJ4aIa49FNMXCpnBHTMVGHuo83S1kECOLQQMmx/BTPIoOEZc qfMkd3zTxU9QTlcul1LnYftK0meci6bJdzpUvl55rv7dX1Uod+c2CRG2SNE7c5iiPuWY CcXSZPuv0bMAPOUwBEbnSylHj1DttDi4uKFrMLo1AxMCnweFNy1JJAz2tXR1NeZhM40x feoyYNgggOd15SLgyx/ZsrgaegWRn5t3Zdy0a753PCVg6dQNJodYMVFHRnwDz80DlF2+ 4igA== X-Gm-Message-State: AOPr4FXFFUqPuIRngO2JC4gT5bq48smoeZq4mmKxmfNLtOIRVht2KbgW9w5GIxO/+mrdRQ== X-Received: by 10.66.190.131 with SMTP id gq3mr40230843pac.42.1460865666618; Sat, 16 Apr 2016 21:01:06 -0700 (PDT) Received: from [30.114.99.214] (mb40536d0.tmodns.net. [208.54.5.180]) by smtp.gmail.com with ESMTPSA id tp9sm74630755pab.14.2016.04.16.21.01.05 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 16 Apr 2016 21:01:05 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r298140 - in head/etc: . devd From: NGie Cooper X-Mailer: iPhone Mail (13E238) In-Reply-To: <201604170345.u3H3jjro051727@repo.freebsd.org> Date: Sat, 16 Apr 2016 21:01:04 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201604170345.u3H3jjro051727@repo.freebsd.org> To: Glen Barber X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 04:01:07 -0000 > On Apr 16, 2016, at 20:45, Glen Barber wrote: >=20 > Author: gjb > Date: Sun Apr 17 03:45:45 2016 > New Revision: 298140 > URL: https://svnweb.freebsd.org/changeset/base/298140 >=20 > Log: > Fix etcupdate(8) with rc.sendmail and devd/*. It turns out > BIN1 and such in etc/* cannot use FILESGROUPS. >=20 > Reported by: peter > Sponsored by: The FreeBSD Foundation This only applies to etc/Makefile . I offered to change that a couple years a= go and it was met with a large number of complaints and some teeth gnashing.= > Modified: > head/etc/Makefile > head/etc/devd/Makefile >=20 > Modified: head/etc/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/etc/Makefile Sun Apr 17 02:51:04 2016 (r298139) > +++ head/etc/Makefile Sun Apr 17 03:45:45 2016 (r298140) > @@ -83,13 +83,8 @@ BIN1+=3D apmd.conf > .endif >=20 > .if ${MK_AUTOFS} !=3D "no" > -FILESGROUPS+=3D AUTOFS > -AUTOFS+=3D auto_master > +BIN1+=3D auto_master > .endif > -AUTOFSDIR=3D /etc > -AUTOFSMODE=3D ${BINMODE} > -AUTOFSPACKAGE=3D autofs > -AUTOFSTAGS=3D config >=20 > .if ${MK_FREEBSD_UPDATE} !=3D "no" > BIN1+=3D freebsd-update.conf > @@ -141,12 +136,8 @@ BIN1+=3D pf.os > .endif >=20 > .if ${MK_SENDMAIL} !=3D "no" > -FILESGROUPS+=3D SENDMAILRC > -SENDMAILRC=3D rc.sendmail > +BIN1+=3D rc.sendmail > .endif > -SENDMAILRCDIR=3D /etc > -SENDMAILRCMODE=3D ${BINMODE} > -SENDMAILRCPACKAGE=3Dsendmail >=20 > .if ${MK_TCSH} !=3D "no" > BIN1+=3D csh.cshrc csh.login csh.logout >=20 > Modified: head/etc/devd/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/etc/devd/Makefile Sun Apr 17 02:51:04 2016 (r298139) > +++ head/etc/devd/Makefile Sun Apr 17 03:45:45 2016 (r298140) > @@ -10,12 +10,7 @@ FILES+=3D apple.conf >=20 > .if ${MACHINE} =3D=3D "amd64" || ${MACHINE} =3D=3D "i386" > .if ${MK_ACPI} !=3D "no" > -FILESGROUPS+=3D ACPI > -ACPI=3D asus.conf > -ACPIPACKAGE=3D acpi > -ACPIDIR=3D /etc/devd > -ACPITAGS=3D config > -ACPIMODE=3D 644 > +FILES+=3D asus.conf > .endif > .if ${MK_HYPERV} !=3D "no" > FILES+=3D hyperv.conf >=20 From owner-svn-src-all@freebsd.org Sun Apr 17 04:12:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0962AAEDFA8; Sun, 17 Apr 2016 04:12:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id EF11119BC; Sun, 17 Apr 2016 04:12:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 9B88F1B01; Sun, 17 Apr 2016 04:12:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Sun, 17 Apr 2016 04:12:16 +0000 From: Glen Barber To: NGie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298140 - in head/etc: . devd Message-ID: <20160417041216.GQ1554@FreeBSD.org> References: <201604170345.u3H3jjro051727@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ffBYM5qgR8HH9Mta" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 04:12:19 -0000 --ffBYM5qgR8HH9Mta Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 16, 2016 at 09:01:04PM -0700, NGie Cooper wrote: >=20 > > On Apr 16, 2016, at 20:45, Glen Barber wrote: > >=20 > > Author: gjb > > Date: Sun Apr 17 03:45:45 2016 > > New Revision: 298140 > > URL: https://svnweb.freebsd.org/changeset/base/298140 > >=20 > > Log: > > Fix etcupdate(8) with rc.sendmail and devd/*. It turns out > > BIN1 and such in etc/* cannot use FILESGROUPS. > >=20 > > Reported by: peter > > Sponsored by: The FreeBSD Foundation >=20 > This only applies to etc/Makefile . I offered to change that a couple yea= rs ago and it was met with a large number of complaints and some teeth gnas= hing. Based on the report, etc/devd/Makefile is affected as well. Glen --ffBYM5qgR8HH9Mta Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXEw0cAAoJEAMUWKVHj+KTCl0P/1Y0Yfkk1lEsUNKSvldWUb5K xqNPPDDrDW5RzR3JK0U1iOSVghSyK9VGlJhbPWLdpleFlvaU3MCEm6NXBNZ6bpXv TxlD6ODH/gpNklaQ7s6dxPG6xcUhVvftQkc+hD4GuJOl1OQOIlygkc/3xj85NBpZ 6Y92uY6EPUffebfpCziDRy2rJvPUjXtIBOC2ydIxxqkR6kBoZKIq11Vd50LTpPRm YfguiFcPmEr2XO7cPpt/4MF5ZZL+VDiT3z7RfGFeh/okgQ9fZrJ4BOA8ULHCtFhG anP4SZoBsXAXCqgvYOxTXN+NEYqiwAMyVfWt/TJ/AUYg1KWsZNsq7p4PBXSMbaUg grmG1K2E8utJabdZBkFmEN6I3TLfk1YjHsqTc8STvafVqIARjgTkgBCziaHSkEsn r5/vs/vtgxQ0KMmg2tqOhZ2QCTDW6dTeYL/4fyK8SG6aeqa/3JYb0crU+QcnJixs u1Nz9xOAFth06TsdOXUjQYNaMF2IpObAwSQxN6hE65zwmusjXtXyKDwdaqwZq6Ed 0jx6VUVY8WDW/iX7YNu64FsAoGiB2YIims7UsQgjO61nUIUJOInP8itgFjSatOD0 q219VDilepNIpwB0C7ISgqxSWs/wVC+qgYmen/c6L7SNPeondv3rlMQQBiTEBLh2 AD3VlSkuuEVbanquPld9 =M+rB -----END PGP SIGNATURE----- --ffBYM5qgR8HH9Mta-- From owner-svn-src-all@freebsd.org Sun Apr 17 05:24:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C2BB111D9; Sun, 17 Apr 2016 05:24:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA37B1981; Sun, 17 Apr 2016 05:24:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H5OT1f081595; Sun, 17 Apr 2016 05:24:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H5OSAo081591; Sun, 17 Apr 2016 05:24:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201604170524.u3H5OSAo081591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 17 Apr 2016 05:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298142 - in head/sys/cam: . ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 05:24:30 -0000 Author: imp Date: Sun Apr 17 05:24:28 2016 New Revision: 298142 URL: https://svnweb.freebsd.org/changeset/base/298142 Log: tag_action is not used at all in ata. It's set to 1 for ordered transactions, but that value isn't used. It's bogusly used to report in devstat, due to a cut and paste error from SCSI. Mark it as unused in cam_fill_ataio. Reclaim the memory as a new ata_flags. In addition, tag_id and init_id are completely unused, so reclaim those as 'unused' now too. These were needlessly copied when ata was split from scsi. This allows us, in the future, to create structures that can communicate AUXILIARY regsiter to the SIMs, which cannot be done now. Differential Revision: https://reviews.freebsd.org/D5598 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_ccb.h head/sys/cam/cam_periph.c head/sys/cam/scsi/scsi_pass.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Apr 17 03:57:37 2016 (r298141) +++ head/sys/cam/ata/ata_da.c Sun Apr 17 05:24:28 2016 (r298142) @@ -1851,7 +1851,7 @@ adastart(struct cam_periph *periph, unio ada_retry_count, adadone, rw_op, - tag_code, + 0, data_ptr, bp->bio_bcount, ada_default_timeout*1000); Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Sun Apr 17 03:57:37 2016 (r298141) +++ head/sys/cam/cam_ccb.h Sun Apr 17 05:24:28 2016 (r298142) @@ -744,15 +744,8 @@ struct ccb_ataio { u_int8_t *data_ptr; /* Ptr to the data buf/SG list */ u_int32_t dxfer_len; /* Data transfer length */ u_int32_t resid; /* Transfer residual length: 2's comp */ - u_int8_t tag_action; /* What to do for tag queueing */ - /* - * The tag action should be either the define below (to send a - * non-tagged transaction) or one of the defined scsi tag messages - * from scsi_message.h. - */ -#define CAM_TAG_ACTION_NONE 0x00 - u_int tag_id; /* tag id from initator (target mode) */ - u_int init_id; /* initiator id of who selected */ + u_int8_t ata_flags; /* Flags for the rest of the buffer */ + uint32_t unused[2]; /* Keep the same size */ }; struct ccb_accept_tio { @@ -1298,7 +1291,7 @@ cam_fill_ctio(struct ccb_scsiio *csio, u static __inline void cam_fill_ataio(struct ccb_ataio *ataio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int tag_action, + u_int32_t flags, u_int tag_action __unused, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int32_t timeout) { @@ -1309,7 +1302,7 @@ cam_fill_ataio(struct ccb_ataio *ataio, ataio->ccb_h.timeout = timeout; ataio->data_ptr = data_ptr; ataio->dxfer_len = dxfer_len; - ataio->tag_action = tag_action; + ataio->ata_flags = 0; } static __inline void Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sun Apr 17 03:57:37 2016 (r298141) +++ head/sys/cam/cam_periph.c Sun Apr 17 05:24:28 2016 (r298142) @@ -1117,7 +1117,7 @@ cam_periph_runccb(union ccb *ccb, } else if (ccb->ccb_h.func_code == XPT_ATA_IO) { devstat_end_transaction(ds, ccb->ataio.dxfer_len - ccb->ataio.resid, - ccb->ataio.tag_action & 0x3, + 0, /* Not used in ATA */ ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) ? DEVSTAT_NO_DATA : (ccb->ccb_h.flags & CAM_DIR_OUT) ? Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Sun Apr 17 03:57:37 2016 (r298141) +++ head/sys/cam/scsi/scsi_pass.c Sun Apr 17 05:24:28 2016 (r298142) @@ -945,7 +945,7 @@ passdone(struct cam_periph *periph, unio case XPT_ATA_IO: devstat_end_transaction(softc->device_stats, done_ccb->ataio.dxfer_len - done_ccb->ataio.resid, - done_ccb->ataio.tag_action & 0x3, + 0, /* Not used in ATA */ ((done_ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) ? DEVSTAT_NO_DATA : (done_ccb->ccb_h.flags & CAM_DIR_OUT) ? From owner-svn-src-all@freebsd.org Sun Apr 17 05:24:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68665B111FF; Sun, 17 Apr 2016 05:24:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 451061AC9; Sun, 17 Apr 2016 05:24:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3H5Ob0l081647; Sun, 17 Apr 2016 05:24:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3H5Oa3j081640; Sun, 17 Apr 2016 05:24:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201604170524.u3H5Oa3j081640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 17 Apr 2016 05:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298143 - in head/sys: cam cam/ata dev/ahci dev/ata dev/mvs dev/siis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 05:24:38 -0000 Author: imp Date: Sun Apr 17 05:24:36 2016 New Revision: 298143 URL: https://svnweb.freebsd.org/changeset/base/298143 Log: Implement Auxiliary register. Add PIM_ATA_EXT flag to flag that a SIM can handle it, and add the code to add it to the FIS that's sent to the drive. The mvs driver is the only other ATA driver in the system, and its hardware doesn't appear to support setting the Auxiliary register. Differential Revision: https://reviews.freebsd.org/D5598 Modified: head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_da.c head/sys/cam/cam_ccb.h head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-all.c head/sys/dev/mvs/mvs.c head/sys/dev/siis/siis.c Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Sun Apr 17 05:24:28 2016 (r298142) +++ head/sys/cam/ata/ata_all.h Sun Apr 17 05:24:36 2016 (r298143) @@ -46,7 +46,6 @@ struct ata_cmd { #define CAM_ATAIO_CONTROL 0x04 /* Control, not a command */ #define CAM_ATAIO_NEEDRESULT 0x08 /* Request requires result. */ #define CAM_ATAIO_DMA 0x10 /* DMA command */ -#define CAM_ATAIO_AUX_HACK 0x20 /* Kludge to make FPDMA DSM TRIM work */ u_int8_t command; u_int8_t features; Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Apr 17 05:24:28 2016 (r298142) +++ head/sys/cam/ata/ata_da.c Sun Apr 17 05:24:36 2016 (r298143) @@ -1522,7 +1522,7 @@ adaregister(struct cam_periph *periph, v * the sim do do things properly. Perhaps we should look at log 13 * dword 0 bit 0 and dword 1 bit 0 are set too... */ - if (cpi.hba_misc & PIM_NCQ_KLUDGE) + if (cpi.hba_misc & PIM_ATA_EXT) softc->flags |= ADA_FLAG_PIM_CAN_NCQ_TRIM; if ((softc->quirks & ADA_Q_NCQ_TRIM_BROKEN) == 0 && (softc->flags & ADA_FLAG_PIM_CAN_NCQ_TRIM) != 0 && @@ -1728,7 +1728,8 @@ ada_ncq_dsmtrim(struct ada_softc *softc, 0, (ranges + ATA_DSM_BLK_RANGES - 1) / ATA_DSM_BLK_RANGES); ataio->cmd.sector_count_exp = ATA_SFPDMA_DSM; - ataio->cmd.flags |= CAM_ATAIO_AUX_HACK; + ataio->ata_flags |= ATA_FLAG_AUX; + ataio->aux = 1; } static void Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Sun Apr 17 05:24:28 2016 (r298142) +++ head/sys/cam/cam_ccb.h Sun Apr 17 05:24:36 2016 (r298143) @@ -581,7 +581,7 @@ typedef enum { } pi_tmflag; typedef enum { - PIM_NCQ_KLUDGE = 0x200, /* Supports the sata ncq trim kludge */ + PIM_ATA_EXT = 0x200,/* ATA requests can understand ata_ext requests */ PIM_EXTLUNS = 0x100,/* 64bit extended LUNs supported */ PIM_SCANHILO = 0x80, /* Bus scans from high ID to low ID */ PIM_NOREMOVE = 0x40, /* Removeable devices not included in scan */ @@ -745,7 +745,9 @@ struct ccb_ataio { u_int32_t dxfer_len; /* Data transfer length */ u_int32_t resid; /* Transfer residual length: 2's comp */ u_int8_t ata_flags; /* Flags for the rest of the buffer */ - uint32_t unused[2]; /* Keep the same size */ +#define ATA_FLAG_AUX 0x1 + uint32_t aux; + uint32_t unused; }; struct ccb_accept_tio { Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sun Apr 17 05:24:28 2016 (r298142) +++ head/sys/dev/ahci/ahci.c Sun Apr 17 05:24:36 2016 (r298143) @@ -2417,12 +2417,15 @@ ahci_setup_fis(struct ahci_channel *ch, fis[13] = ccb->ataio.cmd.sector_count_exp; } fis[15] = ATA_A_4BIT; - /* Gross and vile hack -- makes ncq trim work w/o changing ataio size */ - if (ccb->ataio.cmd.flags & CAM_ATAIO_AUX_HACK) - fis[16] = 1; } else { fis[15] = ccb->ataio.cmd.control; } + if (ccb->ataio.ata_flags & ATA_FLAG_AUX) { + fis[16] = ccb->ataio.aux & 0xff; + fis[17] = (ccb->ataio.aux >> 8) & 0xff; + fis[18] = (ccb->ataio.aux >> 16) & 0xff; + fis[19] = (ccb->ataio.aux >> 24) & 0xff; + } return (20); } @@ -2677,7 +2680,7 @@ ahciaction(struct cam_sim *sim, union cc if (ch->caps & AHCI_CAP_SPM) cpi->hba_inquiry |= PI_SATAPM; cpi->target_sprt = 0; - cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED | PIM_NCQ_KLUDGE; + cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED | PIM_ATA_EXT; cpi->hba_eng_cnt = 0; if (ch->caps & AHCI_CAP_SPM) cpi->max_target = 15; Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sun Apr 17 05:24:28 2016 (r298142) +++ head/sys/dev/ata/ata-all.c Sun Apr 17 05:24:36 2016 (r298143) @@ -962,6 +962,12 @@ ata_check_ids(device_t dev, union ccb *c xpt_done(ccb); return (-1); } + /* + * It's a programming error to see AUXILIARY register requests. + */ + KASSERT(ccb->ccb_h.func_code != XPT_ATA_IO || + ((ccb->ataio.ata_flags & ATA_FLAG_AUX) == 0), + ("AUX register unsupported")); return (0); } Modified: head/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Sun Apr 17 05:24:28 2016 (r298142) +++ head/sys/dev/mvs/mvs.c Sun Apr 17 05:24:36 2016 (r298143) @@ -2245,6 +2245,12 @@ mvs_check_ids(device_t dev, union ccb *c xpt_done(ccb); return (-1); } + /* + * It's a programming error to see AUXILIARY register requests. + */ + KASSERT(ccb->ccb_h.func_code != XPT_ATA_IO || + ((ccb->ataio.ata_flags & ATA_FLAG_AUX) == 0), + ("AUX register unsupported")); return (0); } Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Sun Apr 17 05:24:28 2016 (r298142) +++ head/sys/dev/siis/siis.c Sun Apr 17 05:24:36 2016 (r298143) @@ -1728,6 +1728,12 @@ siis_setup_fis(device_t dev, struct siis fis[13] = ccb->ataio.cmd.sector_count_exp; } fis[15] = ATA_A_4BIT; + if (ccb->ataio.ata_flags & ATA_FLAG_AUX) { + fis[16] = ccb->ataio.aux & 0xff; + fis[17] = (ccb->ataio.aux >> 8) & 0xff; + fis[18] = (ccb->ataio.aux >> 16) & 0xff; + fis[19] = (ccb->ataio.aux >> 24) & 0xff; + } } else { /* Soft reset. */ } @@ -1946,7 +1952,7 @@ siisaction(struct cam_sim *sim, union cc cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE; cpi->hba_inquiry |= PI_SATAPM; cpi->target_sprt = 0; - cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED; + cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED | PIM_ATA_EXT; cpi->hba_eng_cnt = 0; cpi->max_target = 15; cpi->max_lun = 0; From owner-svn-src-all@freebsd.org Sun Apr 17 05:34:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10980B11446; Sun, 17 Apr 2016 05:34:36 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F0C011F26; Sun, 17 Apr 2016 05:34:35 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 6CC941A3; Sat, 16 Apr 2016 22:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1460871275; bh=6iM5+bg6JPx/Cl+AcjAzL9aABK9Usp/zHG3WCj8wJJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=emN0F0YvMVDFgs32+lUrW/6+BkRa8qbPESW98WIgmFCTJuxGwCviw+v6YVB2GflJf FRT7fs7UWcsWT+ZSGtUZvG3pZIhhaQfx0Fy65nzsq7juybIwpUYYkCfXN1r8No8m/N zE+gEl81heQDEBXi5rtjeOA6Iy4Ar3zwL5qxaIDk= From: Peter Wemm To: svn-src-head@freebsd.org Cc: Glen Barber , NGie Cooper , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r298140 - in head/etc: . devd Date: Sat, 16 Apr 2016 22:34:30 -0700 Message-ID: <1630118.dWhHCMdm2e@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160417041216.GQ1554@FreeBSD.org> References: <201604170345.u3H3jjro051727@repo.freebsd.org> <20160417041216.GQ1554@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7024918.Q151gEzoyt"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 05:34:36 -0000 --nextPart7024918.Q151gEzoyt Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Sunday, April 17, 2016 04:12:16 AM Glen Barber wrote: > On Sat, Apr 16, 2016 at 09:01:04PM -0700, NGie Cooper wrote: > > > On Apr 16, 2016, at 20:45, Glen Barber wrote: > > >=20 > > > Author: gjb > > > Date: Sun Apr 17 03:45:45 2016 > > > New Revision: 298140 > > > URL: https://svnweb.freebsd.org/changeset/base/298140 > > >=20 > > > Log: > > > Fix etcupdate(8) with rc.sendmail and devd/*. It turns out > > > BIN1 and such in etc/* cannot use FILESGROUPS. > > > =20 > > > Reported by: peter > > > Sponsored by: The FreeBSD Foundation > >=20 > > This only applies to etc/Makefile . I offered to change that a coup= le > > years ago and it was met with a large number of complaints and some= teeth > > gnashing. > Based on the report, etc/devd/Makefile is affected as well. >=20 > Glen Yep. The short version is that 'make installworld' doesn't put things = into=20 /etc - that's what 'make distribution', mergemaster, etcupdate, and 3r= d party=20 tools do. Having 'make installworld' suddenly begin to partly update= /etc=20 files is quite a POLA violation and caused etcupdate to delete them as = they=20 disappeared from the 'distribution' manifest. eg: D /etc/auto_master D /etc/devd/hyperv.conf D /etc/devd/uath.conf D /etc/devd/ulpt.conf D /etc/devd/usb.conf D /etc/devd/zfs.conf D /etc/rc.sendmail U /etc/mtree/BSD.var.dist =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart7024918.Q151gEzoyt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXEyBmAAoJEDXWlwnsgJ4EkqUH/3cPbBOk9VXVebkzH96Fg9+H SPk4wYiWOX4LHDCZ72RMuHgjitebEHlAjVWVVDiRaGDaUOmdBKINfuNPsNaiQ8tU QAXZPu3VgPk2tzbp/cRP4IdqMizC4s4z+GTBjzx0xA4odwpCnihfzkmN4VOxi6A4 /svQnhltfWNtvH7xCsukVBEFxElOBXUF7fYH26Y90nqGwLGF5uAqPl8JYT0hmIo7 6giqtysU3uPPfI326T6bg8Vkx+LcL+mRoLnyj9MR6JZU18/ss617b7rf4RoyBrb4 GXkUazbW9JfKh7oMRcLqpFFJIwBMbIn448o6hfo798F5nXl5shb/cbOLaEwMTOo= =gWa9 -----END PGP SIGNATURE----- --nextPart7024918.Q151gEzoyt-- From owner-svn-src-all@freebsd.org Sun Apr 17 10:29:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C9EBB11A57; Sun, 17 Apr 2016 10:29:14 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0068816E6; Sun, 17 Apr 2016 10:29:13 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p549CDBD4.dip0.t-ipconnect.de [84.156.219.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 2507283E951; Sun, 17 Apr 2016 12:20:17 +0200 (CEST) Received: from webmail.leidinger.net (webmail.Leidinger.net [IPv6:fd73:10c7:2053:1::3:102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by outgoing.leidinger.net (Postfix) with ESMTPS id A18619B08; Sun, 17 Apr 2016 12:20:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1460888412; bh=rROr/icMeMyQjUlGCQ5MW0dt0RTNoO/5+JkmTL80ucM=; h=Date:From:To:Cc:Subject:In-Reply-To; b=Matbd04oPcNW3XPchv0TUgXTzentHhNt0YTesdCLk44hSRd0g7QD22O1/38LFMbZY z2zco52O93AJ6KjxYwVzYdwr09KkLXI6x56O+WtE23pcBPrYGRGUMFMvAP9QNyyjT4 9EF5VPuGF6yQHlLH1V2MuMqRmMMgOcE7SAI9CpKHECCZxDFUY8iJZx+4AYmzqDJxuv lz97BzrLX1eW7vrWpepSr4p1QgqmqEpMth7JM2EzTd8lSQ/yq+PC8TgmMI7W2U21L1 15qyoU3CPPSxRboOB5XdMORt2Z7ayQlbHpYfSATUSzFmVyCc6L7zJhA/lmc/lFz6be dhRrVRdzs1jjw== Received: (from www@localhost) by webmail.leidinger.net (8.15.2/8.14.4/Submit) id u3HAKCwQ028826; Sun, 17 Apr 2016 12:20:12 +0200 (CEST) (envelope-from Alexander@leidinger.net) X-Authentication-Warning: webmail.leidinger.net: www set sender to Alexander@leidinger.net using -f Received: from p5DD4532D.dip0.t-ipconnect.de (p5DD4532D.dip0.t-ipconnect.de [93.212.83.45]) by webmail.leidinger.net (Horde Framework) with HTTP; Sun, 17 Apr 2016 12:20:12 +0200 Date: Sun, 17 Apr 2016 12:20:12 +0200 Message-ID: <20160417122012.Horde.-YvMZ5BJuIbDmwm13FS6r4f@webmail.leidinger.net> From: Alexander Leidinger To: Luiz Otavio O Souza Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298131 - head/sys/conf In-Reply-To: <201604162054.u3GKstrV027478@repo.freebsd.org> User-Agent: Horde Application Framework 5 Content-Type: multipart/signed; boundary="=_89Bc_PBYNI1bHUeX4Lfa5Fl"; protocol="application/pgp-signature"; micalg=pgp-sha256 MIME-Version: 1.0 X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 2507283E951.A7FB8 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-0.023, required 6, autolearn=disabled, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1461493219.02109@5zcLtdFbLrutxP09rrJZEA X-EBL-Spam-Status: No X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 10:29:14 -0000 This message is in MIME format and has been PGP signed. --=_89Bc_PBYNI1bHUeX4Lfa5Fl Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Luiz Otavio O Souza (from Sat, 16 Apr 2016=20=20 20:54:55=20+0000 (UTC)): > Author: loos > Date: Sat Apr 16 20:54:55 2016 > New Revision: 298131 > URL: https://svnweb.freebsd.org/changeset/base/298131 > > Log: > Add Codel to NOTES. I haven't found much documentation about this. It looks like it is=20=20 only=20available in PF, but not in dummynet. Is this correct? Are there=20= =20 somewhere=20examples for the use of codel (options/parameters/HOWTO)? I=20= =20 would=20expect in places where e.g. "red" could be used, but I don't=20=20 find=20any mention of codel in e.g. the FreeBSD handbook. Bye, Alexander. --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0xC773696B3BAC17DC http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0xC773696B3BAC17DC --=_89Bc_PBYNI1bHUeX4Lfa5Fl Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXE2NcAAoJEDPaGvaaHuONJmAQAJ1q3FYWMzup2wLWPihiJZWV vws2P478HTasLDHu5mJvOWTfGIHOkR1OSeZPAYtuBWoyxEH6Bl13wLJ4MXPYySyv uxTUHTSpPdpPquk0XnQLkuRN/bg0y3GTdOnTRhScnkNLngh+XUxhug5K0mlUJ4Vo LEOzjCnB5ZyWS3uWfrDLh7vJOBzvh8e3eB3WeshO9RITafYzEYIi/bWkdLQhXIDX 5KMzSq772gjMkjvavJAiMphS+6RY9uRyjOSbGdopun2L7D7ArhVrQz2yXZIePTM9 Fv++fwUEIuYhIPH/FjIjfTUiwDcXz1h6OxjMKNFHDZPt/Ax7kSBaF3NE22GyQbBH DCOYS9hvAjPZyxBUS/V/7hComqrOd6yPa5Jg6Bor0nqpsetEKMVPJgs8FVcL/W/x V98hpMfRjuv3VK2kURgD/HealHVkO4vSpHvv79CRL3mexRZSZmjY4Qsk7CNHgTWc raK+M7YyKHVF2Xa6FObrLBAE60g7eX9pgU8UopOsVifpqPVrtys4HQL4OmlR5mbY /mxzsFGdrP8eLdrqer9Z+aWE1R2pNsUQv/ZGDzh5qAnW/PDm9EzRZnhvHg12li1S vAAS1mdOKH29m1g3bpH3r+o0JrQysjIb8RevUmP4amLiuSpqG4Ql0rFFczMKq4cD 2HrWdVAww+W6dJdXDDKq =RYtH -----END PGP SIGNATURE----- --=_89Bc_PBYNI1bHUeX4Lfa5Fl-- From owner-svn-src-all@freebsd.org Sun Apr 17 10:56:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85BD3B10760; Sun, 17 Apr 2016 10:56:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 612F718F7; Sun, 17 Apr 2016 10:56:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HAuuSF082991; Sun, 17 Apr 2016 10:56:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HAuuha082988; Sun, 17 Apr 2016 10:56:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604171056.u3HAuuha082988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 17 Apr 2016 10:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298144 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 10:56:57 -0000 Author: kib Date: Sun Apr 17 10:56:56 2016 New Revision: 298144 URL: https://svnweb.freebsd.org/changeset/base/298144 Log: Add hw.dmar.batch_coalesce tunable/sysctl, which specifies rate at which queued invalidation completion interrupt is requested with regard to the queued invalidation requests. In other words, setting the value of the knob to N requests completion interrupt after N items are processed. Existing behaviour is restored by setting hw.dmar.batch_coalesce=1. The knob significantly decreases the DMAR qi interrupt rate at the cost of slightly longer DMAR map entries recycling. Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_utils.c Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Sun Apr 17 05:24:36 2016 (r298143) +++ head/sys/x86/iommu/intel_ctx.c Sun Apr 17 10:56:56 2016 (r298144) @@ -711,6 +711,18 @@ dmar_domain_unload_entry(struct dmar_map } } +static struct dmar_qi_genseq * +dmar_domain_unload_gseq(struct dmar_domain *domain, + struct dmar_map_entry *entry, struct dmar_qi_genseq *gseq) +{ + + if (TAILQ_NEXT(entry, dmamap_link) != NULL) + return (NULL); + if (domain->batch_no++ % dmar_batch_coalesce != 0) + return (NULL); + return (gseq); +} + void dmar_domain_unload(struct dmar_domain *domain, struct dmar_map_entries_tailq *entries, bool cansleep) @@ -744,8 +756,8 @@ dmar_domain_unload(struct dmar_domain *d entry->gseq.gen = 0; entry->gseq.seq = 0; dmar_qi_invalidate_locked(domain, entry->start, entry->end - - entry->start, TAILQ_NEXT(entry, dmamap_link) == NULL ? - &gseq : NULL); + entry->start, dmar_domain_unload_gseq(domain, entry, + &gseq)); } TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { entry->gseq = gseq; Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Sun Apr 17 05:24:36 2016 (r298143) +++ head/sys/x86/iommu/intel_dmar.h Sun Apr 17 10:56:56 2016 (r298144) @@ -114,6 +114,7 @@ struct dmar_domain { unload */ struct dmar_map_entry *first_place, *last_place; /* (d) */ struct task unload_task; /* (c) */ + u_int batch_no; }; struct dmar_ctx { @@ -378,6 +379,7 @@ extern dmar_haddr_t dmar_high; extern int haw; extern int dmar_tbl_pagecnt; extern int dmar_match_verbose; +extern int dmar_batch_coalesce; extern int dmar_check_free; static inline uint32_t Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Sun Apr 17 05:24:36 2016 (r298143) +++ head/sys/x86/iommu/intel_utils.c Sun Apr 17 10:56:56 2016 (r298144) @@ -618,6 +618,7 @@ dmar_barrier_exit(struct dmar_unit *dmar } int dmar_match_verbose; +int dmar_batch_coalesce = 100; static SYSCTL_NODE(_hw, OID_AUTO, dmar, CTLFLAG_RD, NULL, ""); SYSCTL_INT(_hw_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, @@ -626,6 +627,9 @@ SYSCTL_INT(_hw_dmar, OID_AUTO, tbl_pagec SYSCTL_INT(_hw_dmar, OID_AUTO, match_verbose, CTLFLAG_RWTUN, &dmar_match_verbose, 0, "Verbose matching of the PCI devices to DMAR paths"); +SYSCTL_INT(_hw_dmar, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, + &dmar_batch_coalesce, 0, + "Number of qi batches between interrupt"); #ifdef INVARIANTS int dmar_check_free; SYSCTL_INT(_hw_dmar, OID_AUTO, check_free, CTLFLAG_RWTUN, From owner-svn-src-all@freebsd.org Sun Apr 17 11:04:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D11CAB10AA0; Sun, 17 Apr 2016 11:04:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD7AF1E32; Sun, 17 Apr 2016 11:04:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HB4RFb085920; Sun, 17 Apr 2016 11:04:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HB4RrG085914; Sun, 17 Apr 2016 11:04:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604171104.u3HB4RrG085914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 17 Apr 2016 11:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298145 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 11:04:28 -0000 Author: kib Date: Sun Apr 17 11:04:27 2016 New Revision: 298145 URL: https://svnweb.freebsd.org/changeset/base/298145 Log: The struct thread td_estcpu member is only used by the 4BSD scheduler. Move it to the struct td_sched for 4BSD, removing always present field, otherwise unused for ULE. New scheduler method sched_estcpu() returns the estimation for kinfo_proc consumption. As before, it always returns 0 for ULE. Remove sched_tick() scheduler method, unused both by 4BSD and ULE. Update locking comment for the 4BSD struct td_sched, copying it from the same comment for ULE. Spell MAXPRI as PRI_MAX_TIMESHARE in the 4BSD comment. Based on some notes from, and reviewed by: bde Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_clock.c head/sys/kern/kern_proc.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/sys/proc.h head/sys/sys/sched.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sun Apr 17 10:56:56 2016 (r298144) +++ head/sys/kern/kern_clock.c Sun Apr 17 11:04:27 2016 (r298145) @@ -449,7 +449,6 @@ hardclock_cpu(int usermode) PROC_ITIMUNLOCK(p); } thread_lock(td); - sched_tick(1); td->td_flags |= flags; thread_unlock(td); @@ -539,7 +538,6 @@ hardclock_cnt(int cnt, int usermode) PROC_ITIMUNLOCK(p); } thread_lock(td); - sched_tick(cnt); td->td_flags |= flags; thread_unlock(td); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Apr 17 10:56:56 2016 (r298144) +++ head/sys/kern/kern_proc.c Sun Apr 17 11:04:27 2016 (r298145) @@ -855,7 +855,7 @@ fill_kinfo_aggregate(struct proc *p, str FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); kp->ki_pctcpu += sched_pctcpu(td); - kp->ki_estcpu += td->td_estcpu; + kp->ki_estcpu += sched_estcpu(td); thread_unlock(td); } } @@ -1101,7 +1101,7 @@ fill_kinfo_thread(struct thread *td, str rufetchtd(td, &kp->ki_rusage); kp->ki_runtime = cputick2usec(td->td_rux.rux_runtime); kp->ki_pctcpu = sched_pctcpu(td); - kp->ki_estcpu = td->td_estcpu; + kp->ki_estcpu = sched_estcpu(td); kp->ki_cow = td->td_cow; } Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Sun Apr 17 10:56:56 2016 (r298144) +++ head/sys/kern/sched_4bsd.c Sun Apr 17 11:04:27 2016 (r298145) @@ -87,12 +87,14 @@ dtrace_vtime_switch_func_t dtrace_vtime_ /* * The schedulable entity that runs a context. * This is an extension to the thread structure and is tailored to - * the requirements of this scheduler + * the requirements of this scheduler. + * All fields are protected by the scheduler lock. */ struct td_sched { - fixpt_t ts_pctcpu; /* (j) %cpu during p_swtime. */ - int ts_cpticks; /* (j) Ticks of cpu time. */ - int ts_slptime; /* (j) Seconds !RUNNING. */ + fixpt_t ts_pctcpu; /* %cpu during p_swtime. */ + u_int ts_estcpu; /* Estimated cpu utilization. */ + int ts_cpticks; /* Ticks of cpu time. */ + int ts_slptime; /* Seconds !RUNNING. */ int ts_slice; /* Remaining part of time slice. */ int ts_flags; struct runq *ts_runq; /* runq the thread is currently on */ @@ -382,20 +384,20 @@ maybe_preempt(struct thread *td) /* * Constants for digital decay and forget: - * 90% of (td_estcpu) usage in 5 * loadav time + * 90% of (ts_estcpu) usage in 5 * loadav time * 95% of (ts_pctcpu) usage in 60 seconds (load insensitive) * Note that, as ps(1) mentions, this can let percentages * total over 100% (I've seen 137.9% for 3 processes). * - * Note that schedclock() updates td_estcpu and p_cpticks asynchronously. + * Note that schedclock() updates ts_estcpu and p_cpticks asynchronously. * - * We wish to decay away 90% of td_estcpu in (5 * loadavg) seconds. + * We wish to decay away 90% of ts_estcpu in (5 * loadavg) seconds. * That is, the system wants to compute a value of decay such * that the following for loop: * for (i = 0; i < (5 * loadavg); i++) - * td_estcpu *= decay; + * ts_estcpu *= decay; * will compute - * td_estcpu *= 0.1; + * ts_estcpu *= 0.1; * for all values of loadavg: * * Mathematically this loop can be expressed by saying: @@ -559,7 +561,7 @@ schedcpu(void) thread_unlock(td); continue; } - td->td_estcpu = decay_cpu(loadfac, td->td_estcpu); + ts->ts_estcpu = decay_cpu(loadfac, ts->ts_estcpu); resetpriority(td); resetpriority_thread(td); thread_unlock(td); @@ -584,8 +586,8 @@ schedcpu_thread(void) /* * Recalculate the priority of a process after it has slept for a while. - * For all load averages >= 1 and max td_estcpu of 255, sleeping for at - * least six times the loadfactor will decay td_estcpu to zero. + * For all load averages >= 1 and max ts_estcpu of 255, sleeping for at + * least six times the loadfactor will decay ts_estcpu to zero. */ static void updatepri(struct thread *td) @@ -597,13 +599,13 @@ updatepri(struct thread *td) ts = td->td_sched; loadfac = loadfactor(averunnable.ldavg[0]); if (ts->ts_slptime > 5 * loadfac) - td->td_estcpu = 0; + ts->ts_estcpu = 0; else { - newcpu = td->td_estcpu; + newcpu = ts->ts_estcpu; ts->ts_slptime--; /* was incremented in schedcpu() */ while (newcpu && --ts->ts_slptime) newcpu = decay_cpu(loadfac, newcpu); - td->td_estcpu = newcpu; + ts->ts_estcpu = newcpu; } } @@ -615,15 +617,15 @@ updatepri(struct thread *td) static void resetpriority(struct thread *td) { - register unsigned int newpriority; + u_int newpriority; - if (td->td_pri_class == PRI_TIMESHARE) { - newpriority = PUSER + td->td_estcpu / INVERSE_ESTCPU_WEIGHT + - NICE_WEIGHT * (td->td_proc->p_nice - PRIO_MIN); - newpriority = min(max(newpriority, PRI_MIN_TIMESHARE), - PRI_MAX_TIMESHARE); - sched_user_prio(td, newpriority); - } + if (td->td_pri_class != PRI_TIMESHARE) + return; + newpriority = PUSER + td->td_sched->ts_estcpu / INVERSE_ESTCPU_WEIGHT + + NICE_WEIGHT * (td->td_proc->p_nice - PRIO_MIN); + newpriority = min(max(newpriority, PRI_MIN_TIMESHARE), + PRI_MAX_TIMESHARE); + sched_user_prio(td, newpriority); } /* @@ -709,18 +711,18 @@ sched_rr_interval(void) } /* - * We adjust the priority of the current process. The priority of - * a process gets worse as it accumulates CPU time. The cpu usage - * estimator (td_estcpu) is increased here. resetpriority() will - * compute a different priority each time td_estcpu increases by - * INVERSE_ESTCPU_WEIGHT - * (until MAXPRI is reached). The cpu usage estimator ramps up - * quite quickly when the process is running (linearly), and decays - * away exponentially, at a rate which is proportionally slower when - * the system is busy. The basic principle is that the system will - * 90% forget that the process used a lot of CPU time in 5 * loadav - * seconds. This causes the system to favor processes which haven't - * run much recently, and to round-robin among other processes. + * We adjust the priority of the current process. The priority of a + * process gets worse as it accumulates CPU time. The cpu usage + * estimator (ts_estcpu) is increased here. resetpriority() will + * compute a different priority each time ts_estcpu increases by + * INVERSE_ESTCPU_WEIGHT (until PRI_MAX_TIMESHARE is reached). The + * cpu usage estimator ramps up quite quickly when the process is + * running (linearly), and decays away exponentially, at a rate which + * is proportionally slower when the system is busy. The basic + * principle is that the system will 90% forget that the process used + * a lot of CPU time in 5 * loadav seconds. This causes the system to + * favor processes which haven't run much recently, and to round-robin + * among other processes. */ void sched_clock(struct thread *td) @@ -732,8 +734,8 @@ sched_clock(struct thread *td) ts = td->td_sched; ts->ts_cpticks++; - td->td_estcpu = ESTCPULIM(td->td_estcpu + 1); - if ((td->td_estcpu % INVERSE_ESTCPU_WEIGHT) == 0) { + ts->ts_estcpu = ESTCPULIM(ts->ts_estcpu + 1); + if ((ts->ts_estcpu % INVERSE_ESTCPU_WEIGHT) == 0) { resetpriority(td); resetpriority_thread(td); } @@ -773,7 +775,8 @@ sched_exit_thread(struct thread *td, str KTR_STATE1(KTR_SCHED, "thread", sched_tdname(child), "exit", "prio:%d", child->td_priority); thread_lock(td); - td->td_estcpu = ESTCPULIM(td->td_estcpu + child->td_estcpu); + td->td_sched->ts_estcpu = ESTCPULIM(td->td_sched->ts_estcpu + + child->td_sched->ts_estcpu); thread_unlock(td); thread_lock(child); if ((child->td_flags & TDF_NOLOAD) == 0) @@ -794,12 +797,12 @@ sched_fork_thread(struct thread *td, str childtd->td_oncpu = NOCPU; childtd->td_lastcpu = NOCPU; - childtd->td_estcpu = td->td_estcpu; childtd->td_lock = &sched_lock; childtd->td_cpuset = cpuset_ref(td->td_cpuset); childtd->td_priority = childtd->td_base_pri; ts = childtd->td_sched; bzero(ts, sizeof(*ts)); + ts->ts_estcpu = td->td_sched->ts_estcpu; ts->ts_flags |= (td->td_sched->ts_flags & TSF_AFFINITY); ts->ts_slice = 1; } @@ -1621,9 +1624,11 @@ sched_pctcpu_delta(struct thread *td) } #endif -void -sched_tick(int cnt) +u_int +sched_estcpu(struct thread *td) { + + return (td->td_sched->ts_estcpu); } /* Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Apr 17 10:56:56 2016 (r298144) +++ head/sys/kern/sched_ule.c Sun Apr 17 11:04:27 2016 (r298145) @@ -2288,13 +2288,11 @@ sched_clock(struct thread *td) } } -/* - * Called once per hz tick. - */ -void -sched_tick(int cnt) +u_int +sched_estcpu(struct thread *td __unused) { + return (0); } /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Apr 17 10:56:56 2016 (r298144) +++ head/sys/sys/proc.h Sun Apr 17 11:04:27 2016 (r298145) @@ -250,7 +250,6 @@ struct thread { int td_pinned; /* (k) Temporary cpu pin count. */ struct ucred *td_ucred; /* (k) Reference to credentials. */ struct plimit *td_limit; /* (k) Resource limits. */ - u_int td_estcpu; /* (t) estimated cpu utilization */ int td_slptick; /* (t) Time at sleep. */ int td_blktick; /* (t) Time spent blocked. */ int td_swvoltick; /* (t) Time at last SW_VOL switch. */ Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Sun Apr 17 10:56:56 2016 (r298144) +++ head/sys/sys/sched.h Sun Apr 17 11:04:27 2016 (r298145) @@ -90,6 +90,7 @@ void sched_nice(struct proc *p, int nice * priorities inherited from their procs, and use up cpu time. */ void sched_exit_thread(struct thread *td, struct thread *child); +u_int sched_estcpu(struct thread *td); void sched_fork_thread(struct thread *td, struct thread *child); void sched_lend_prio(struct thread *td, u_char prio); void sched_lend_user_prio(struct thread *td, u_char pri); @@ -102,7 +103,6 @@ void sched_unlend_prio(struct thread *td void sched_user_prio(struct thread *td, u_char prio); void sched_userret(struct thread *td); void sched_wakeup(struct thread *td); -void sched_preempt(struct thread *td); #ifdef RACCT #ifdef SCHED_4BSD fixpt_t sched_pctcpu_delta(struct thread *td); @@ -114,8 +114,8 @@ fixpt_t sched_pctcpu_delta(struct thread */ void sched_add(struct thread *td, int flags); void sched_clock(struct thread *td); +void sched_preempt(struct thread *td); void sched_rem(struct thread *td); -void sched_tick(int cnt); void sched_relinquish(struct thread *td); struct thread *sched_choose(void); void sched_idletd(void *); From owner-svn-src-all@freebsd.org Sun Apr 17 12:12:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D8F5B1194F; Sun, 17 Apr 2016 12:12:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9E7C1C83; Sun, 17 Apr 2016 12:12:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HCCQkl006886; Sun, 17 Apr 2016 12:12:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HCCQ4s006885; Sun, 17 Apr 2016 12:12:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604171212.u3HCCQ4s006885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 17 Apr 2016 12:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298146 - head/tools/tools/locale/etc/charmaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 12:12:27 -0000 Author: bapt Date: Sun Apr 17 12:12:25 2016 New Revision: 298146 URL: https://svnweb.freebsd.org/changeset/base/298146 Log: Remove leftover from Big5HKSCS removal Deleted: head/tools/tools/locale/etc/charmaps/Big5HKSCS.TXT From owner-svn-src-all@freebsd.org Sun Apr 17 12:33:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 121DFB100C4; Sun, 17 Apr 2016 12:33:21 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C9EBE14C7; Sun, 17 Apr 2016 12:33:20 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id EE92425D3A9C; Sun, 17 Apr 2016 12:33:16 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 07589D1F8BD; Sun, 17 Apr 2016 12:33:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 8aPB8AYb2NYs; Sun, 17 Apr 2016 12:33:14 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 97C1AD1F8BC; Sun, 17 Apr 2016 12:33:14 +0000 (UTC) Date: Sun, 17 Apr 2016 12:33:13 +0000 (UTC) From: "Bjoern A. Zeeb" To: Adrian Chadd cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298136 - head/sys/dev/flash In-Reply-To: <201604170205.u3H25jrw021447@repo.freebsd.org> Message-ID: References: <201604170205.u3H25jrw021447@repo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 12:33:21 -0000 On Sun, 17 Apr 2016, Adrian Chadd wrote: > Author: adrian > Date: Sun Apr 17 02:05:45 2016 > New Revision: 298136 > URL: https://svnweb.freebsd.org/changeset/base/298136 > > Log: > Only compile the FDT bits when we are using FDT. > > Modified: > head/sys/dev/flash/at45d.c > head/sys/dev/flash/mx25l.c The at45d bits don't compile and not sure if they should have been in this commit? >>> Kernel build for ATMEL started on Sun Apr 17 11:38:10 UTC 2016 /scratch/tmp/bz/head.svn/sys/dev/flash/at45d.c:124:27: error: use of undeclared identifier 'SPI_COMMAND_INITIALIZER' struct spi_command cmd = SPI_COMMAND_INITIALIZER; ^ /scratch/tmp/bz/head.svn/sys/dev/flash/at45d.c:144:27: error: use of undeclared identifier 'SPI_COMMAND_INITIALIZER' struct spi_command cmd = SPI_COMMAND_INITIALIZER; ^ /scratch/tmp/bz/head.svn/sys/dev/flash/at45d.c:306:27: error: use of undeclared identifier 'SPI_COMMAND_INITIALIZER' struct spi_command cmd = SPI_COMMAND_INITIALIZER; ^ 3 errors generated. --- at45d.o --- *** [at45d.o] Error code 1 From owner-svn-src-all@freebsd.org Sun Apr 17 15:48:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A16B12161; Sun, 17 Apr 2016 15:48:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 432F01E6B; Sun, 17 Apr 2016 15:48:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HFmJHH070001; Sun, 17 Apr 2016 15:48:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HFmJ4H070000; Sun, 17 Apr 2016 15:48:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201604171548.u3HFmJ4H070000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Apr 2016 15:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298147 - head/contrib/llvm/tools/clang/tools/driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 15:48:20 -0000 Author: dim Date: Sun Apr 17 15:48:19 2016 New Revision: 298147 URL: https://svnweb.freebsd.org/changeset/base/298147 Log: Until it has been properly fixed upstream, apply a temporary workaround for LLVM PR 26999 (in some cases, -save-temps can cause an assertion failure in clang's -cc1as stage). Modified: head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp Modified: head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp ============================================================================== --- head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp Sun Apr 17 12:12:25 2016 (r298146) +++ head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp Sun Apr 17 15:48:19 2016 (r298147) @@ -200,7 +200,7 @@ bool AssemblerInvocation::CreateFromArgs // Any DebugInfoKind implies GenDwarfForAssembly. Opts.GenDwarfForAssembly = Args.hasArg(OPT_debug_info_kind_EQ); Opts.CompressDebugSections = Args.hasArg(OPT_compress_debug_sections); - Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags); + Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 2, Diags); Opts.DwarfDebugFlags = Args.getLastArgValue(OPT_dwarf_debug_flags); Opts.DwarfDebugProducer = Args.getLastArgValue(OPT_dwarf_debug_producer); Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir); From owner-svn-src-all@freebsd.org Sun Apr 17 15:51:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E457CB1228F; Sun, 17 Apr 2016 15:51:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3FAD1248; Sun, 17 Apr 2016 15:51:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HFpQXu072396; Sun, 17 Apr 2016 15:51:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HFpQOH072395; Sun, 17 Apr 2016 15:51:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604171551.u3HFpQOH072395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 17 Apr 2016 15:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298148 - head/sys/dev/flash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 15:51:28 -0000 Author: adrian Date: Sun Apr 17 15:51:26 2016 New Revision: 298148 URL: https://svnweb.freebsd.org/changeset/base/298148 Log: undo previous commit - WIP was committed by accident. Noticed by: bz Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Sun Apr 17 15:48:19 2016 (r298147) +++ head/sys/dev/flash/at45d.c Sun Apr 17 15:51:26 2016 (r298148) @@ -121,7 +121,7 @@ static int at45d_get_status(device_t dev, uint8_t *status) { uint8_t rxBuf[8], txBuf[8]; - struct spi_command cmd = SPI_COMMAND_INITIALIZER; + struct spi_command cmd; int err; memset(&cmd, 0, sizeof(cmd)); @@ -141,7 +141,7 @@ static int at45d_get_mfg_info(device_t dev, uint8_t *resp) { uint8_t rxBuf[8], txBuf[8]; - struct spi_command cmd = SPI_COMMAND_INITIALIZER; + struct spi_command cmd; int err; memset(&cmd, 0, sizeof(cmd)); @@ -303,7 +303,7 @@ at45d_task(void *arg) uint8_t rxBuf[8], txBuf[8]; struct at45d_softc *sc; struct bio *bp; - struct spi_command cmd = SPI_COMMAND_INITIALIZER; + struct spi_command cmd; device_t dev, pdev; caddr_t buf; u_long len, resid; From owner-svn-src-all@freebsd.org Sun Apr 17 15:51:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C99A8B122B2; Sun, 17 Apr 2016 15:51:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 946E613A4; Sun, 17 Apr 2016 15:51:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x233.google.com with SMTP id f1so55023434igr.1; Sun, 17 Apr 2016 08:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=vYtYk0gIsDAAhr2OEuSBCnivDymZODrqoI7wNYumUco=; b=HP7B8Qq5q3e5XZxMBhkNv5YwWeZxT/WxODLvhjM+S4w/v2qfF/jdCoDa1jXfVa5q3e PlOpBOS7LhqX1/g179nNkwUQiZ83sNA/X2GFPv1rEVW8VFG5s1UAAV794TyuUS4UG1Td KGqFmWtvbj+/dni0ly7rM3zAjhAYSvocToRhZhEJ6sI6kJY3885OvQtOY5oLOEm4fwPN tR7J7tPFVbYm6V0j9lgpIrg4+iAalF4h531MYJ9Teyiai/5d9M8dbWk0USc9YsYG8yD4 X9J4JYq+aorem1FW5GDOl4FSCkJmV3BybhytxARG/HIvELs8B8EJ+BWjVUOEzDmtR4MU 6zVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=vYtYk0gIsDAAhr2OEuSBCnivDymZODrqoI7wNYumUco=; b=a8VCdJErX0ZprpGaGDOFUNUbV1vqdEyPPUnXrxKTEF5Fu5a5BOYxIs5+W7XhObQu8m mONX5d04+x2SVq7SEIU8tVGtnABWa44K9hHf5uYeezjxDrXIZHmz/DduFE4WG5wMgn1U k4LH7nPOnGIlffGraXbQKXIZ9pK7UJDnFut2EYdPmMEJ+RcoCrrT7yG4cQaPkJ4TxpV2 3CI8NJr/pnXxkzlEsHbYrR9qKVLM8py6pvMNRcBGr84UzGsKKIArZqMXgonD3mL6nZlI dOLxQw4Tabne5ZSu4ffhfru7SuH1oC0N9alHjpYC6Ij4MRHjWQE3uefdhNAOMYl6LBcX +JJQ== X-Gm-Message-State: AOPr4FV401kuSwPN7T+cbXZgwzAYzLqDoZOCKc5xBEshOiWQR52YSKXA6pzzTHX9OpVQs4LPyTiXw0pSW9lOkA== MIME-Version: 1.0 X-Received: by 10.50.103.232 with SMTP id fz8mr14079585igb.61.1460908295020; Sun, 17 Apr 2016 08:51:35 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Sun, 17 Apr 2016 08:51:34 -0700 (PDT) In-Reply-To: References: <201604170205.u3H25jrw021447@repo.freebsd.org> Date: Sun, 17 Apr 2016 08:51:34 -0700 X-Google-Sender-Auth: Yv53IRZR2LUI6BuzFe6dyQOAFSc Message-ID: Subject: Re: svn commit: r298136 - head/sys/dev/flash From: Adrian Chadd To: "Bjoern A. Zeeb" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 15:51:35 -0000 Fixed, thanks! Sorry, this is some in-progress SPI work.. -a On 17 April 2016 at 05:33, Bjoern A. Zeeb wrote: > On Sun, 17 Apr 2016, Adrian Chadd wrote: > >> Author: adrian >> Date: Sun Apr 17 02:05:45 2016 >> New Revision: 298136 >> URL: https://svnweb.freebsd.org/changeset/base/298136 >> >> Log: >> Only compile the FDT bits when we are using FDT. >> >> Modified: >> head/sys/dev/flash/at45d.c >> head/sys/dev/flash/mx25l.c > > > The at45d bits don't compile and not sure if they should have been in > this commit? > >>>> Kernel build for ATMEL started on Sun Apr 17 11:38:10 UTC 2016 > > > /scratch/tmp/bz/head.svn/sys/dev/flash/at45d.c:124:27: error: use of > undeclared identifier 'SPI_COMMAND_INITIALIZER' > struct spi_command cmd = SPI_COMMAND_INITIALIZER; > ^ > /scratch/tmp/bz/head.svn/sys/dev/flash/at45d.c:144:27: error: use of > undeclared identifier 'SPI_COMMAND_INITIALIZER' > struct spi_command cmd = SPI_COMMAND_INITIALIZER; > ^ > /scratch/tmp/bz/head.svn/sys/dev/flash/at45d.c:306:27: error: use of > undeclared identifier 'SPI_COMMAND_INITIALIZER' > struct spi_command cmd = SPI_COMMAND_INITIALIZER; > ^ > 3 errors generated. > --- at45d.o --- > *** [at45d.o] Error code 1 From owner-svn-src-all@freebsd.org Sun Apr 17 18:25:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9351DB11A8C; Sun, 17 Apr 2016 18:25:35 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63F6A101F; Sun, 17 Apr 2016 18:25:35 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HIPYWE019385; Sun, 17 Apr 2016 18:25:34 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HIPY9Z019384; Sun, 17 Apr 2016 18:25:34 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201604171825.u3HIPY9Z019384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sun, 17 Apr 2016 18:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298156 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 18:25:35 -0000 Author: wblock (doc committer) Date: Sun Apr 17 18:25:34 2016 New Revision: 298156 URL: https://svnweb.freebsd.org/changeset/base/298156 Log: Fix markup on "\n" in printf so it renders correctly. PR: 208852 Submitted by: coder@tuxfamily.org MFC after: 1 week Modified: head/lib/libc/stdlib/lsearch.3 Modified: head/lib/libc/stdlib/lsearch.3 ============================================================================== --- head/lib/libc/stdlib/lsearch.3 Sun Apr 17 16:51:18 2016 (r298155) +++ head/lib/libc/stdlib/lsearch.3 Sun Apr 17 18:25:34 2016 (r298156) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2013 +.Dd April 17, 2016 .Dt LSEARCH 3 .Os .Sh NAME @@ -107,7 +107,7 @@ main(int argc, char **argv) printf("Enter a number: "); if (scanf("%d", &key) != 1) { - printf("Bad input\n"); + printf("Bad input\en"); return (EXIT_FAILURE); } @@ -115,9 +115,9 @@ main(int argc, char **argv) element_compare); if (element != NULL) - printf("Element found: %d\n", *(int *)element); + printf("Element found: %d\en", *(int *)element); else - printf("Element not found\n"); + printf("Element not found\en"); return (EXIT_SUCCESS); } From owner-svn-src-all@freebsd.org Sun Apr 17 20:00:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16BB0B10BA8; Sun, 17 Apr 2016 20:00:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCDBB1861; Sun, 17 Apr 2016 20:00:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HK0Pib048323; Sun, 17 Apr 2016 20:00:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HK0PTO048322; Sun, 17 Apr 2016 20:00:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201604172000.u3HK0PTO048322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 17 Apr 2016 20:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298157 - head/usr.bin/mail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 20:00:26 -0000 Author: jilles Date: Sun Apr 17 20:00:24 2016 New Revision: 298157 URL: https://svnweb.freebsd.org/changeset/base/298157 Log: mail: Don't truncate mtime of mailbox to microseconds. Modified: head/usr.bin/mail/util.c Modified: head/usr.bin/mail/util.c ============================================================================== --- head/usr.bin/mail/util.c Sun Apr 17 18:25:34 2016 (r298156) +++ head/usr.bin/mail/util.c Sun Apr 17 20:00:24 2016 (r298157) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include +#include + #include "rcv.h" #include "extern.h" @@ -319,15 +321,13 @@ unstack(void) void alter(char *name) { - struct stat sb; - struct timeval tv[2]; + struct timespec ts[2]; - if (stat(name, &sb)) - return; - (void)gettimeofday(&tv[0], NULL); - tv[0].tv_sec++; - TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim); - (void)utimes(name, tv); + (void)clock_gettime(CLOCK_REALTIME, &ts[0]); + ts[0].tv_sec++; + ts[1].tv_sec = 0; + ts[1].tv_nsec = UTIME_OMIT; + (void)utimensat(AT_FDCWD, name, ts, 0); } /* From owner-svn-src-all@freebsd.org Sun Apr 17 21:14:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0697B127C8; Sun, 17 Apr 2016 21:14:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59F9E114B; Sun, 17 Apr 2016 21:14:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLEMYG072636; Sun, 17 Apr 2016 21:14:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLEMnk072631; Sun, 17 Apr 2016 21:14:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604172114.u3HLEMnk072631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 17 Apr 2016 21:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298159 - vendor/sqlite3/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:14:23 -0000 Author: bapt Date: Sun Apr 17 21:14:22 2016 New Revision: 298159 URL: https://svnweb.freebsd.org/changeset/base/298159 Log: Import sqlite3-3.12.1 (3120100) Added: vendor/sqlite3/dist/README.txt (contents, props changed) Deleted: vendor/sqlite3/dist/README Modified: vendor/sqlite3/dist/Makefile.am vendor/sqlite3/dist/Makefile.in vendor/sqlite3/dist/aclocal.m4 vendor/sqlite3/dist/config.guess vendor/sqlite3/dist/config.sub vendor/sqlite3/dist/configure vendor/sqlite3/dist/configure.ac vendor/sqlite3/dist/depcomp vendor/sqlite3/dist/install-sh vendor/sqlite3/dist/ltmain.sh vendor/sqlite3/dist/missing vendor/sqlite3/dist/shell.c vendor/sqlite3/dist/sqlite3.c vendor/sqlite3/dist/sqlite3.h vendor/sqlite3/dist/sqlite3ext.h Modified: vendor/sqlite3/dist/Makefile.am ============================================================================== --- vendor/sqlite3/dist/Makefile.am Sun Apr 17 20:45:52 2016 (r298158) +++ vendor/sqlite3/dist/Makefile.am Sun Apr 17 21:14:22 2016 (r298159) @@ -1,18 +1,20 @@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 bin_PROGRAMS = sqlite3 -sqlite3_SOURCES = shell.c sqlite3.c sqlite3.h -sqlite3_LDADD = @READLINE_LIBS@ -sqlite3_CFLAGS = $(AM_CFLAGS) +sqlite3_SOURCES = shell.c sqlite3.h +EXTRA_sqlite3_SOURCES = sqlite3.c +sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ +sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ +sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc Modified: vendor/sqlite3/dist/Makefile.in ============================================================================== --- vendor/sqlite3/dist/Makefile.in Sun Apr 17 20:45:52 2016 (r298158) +++ vendor/sqlite3/dist/Makefile.in Sun Apr 17 21:14:22 2016 (r298159) @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,23 +18,61 @@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -56,14 +93,12 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sqlite3$(EXEEXT) subdir = . -DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/sqlite3.pc.in $(top_srcdir)/configure INSTALL \ - config.guess config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -103,31 +138,57 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libsqlite3_la_LIBADD = am_libsqlite3_la_OBJECTS = sqlite3.lo libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS) -libsqlite3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libsqlite3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsqlite3_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) -am_sqlite3_OBJECTS = sqlite3-shell.$(OBJEXT) sqlite3-sqlite3.$(OBJEXT) +am_sqlite3_OBJECTS = sqlite3-shell.$(OBJEXT) sqlite3_OBJECTS = $(am_sqlite3_OBJECTS) -sqlite3_DEPENDENCIES = -sqlite3_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(sqlite3_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +sqlite3_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sqlite3_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) -DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ + $(EXTRA_sqlite3_SOURCES) +DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ + $(EXTRA_sqlite3_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -138,8 +199,30 @@ NROFF = nroff MANS = $(man_MANS) DATA = $(pkgconfig_DATA) HEADERS = $(include_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/sqlite3.pc.in \ + INSTALL compile config.guess config.sub depcomp install-sh \ + ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -149,14 +232,17 @@ am__remove_distdir = \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -180,13 +266,16 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +EXTRA_SHELL_OBJ = @EXTRA_SHELL_OBJ@ FGREP = @FGREP@ +FTS5_FLAGS = @FTS5_FLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JSON1_FLAGS = @JSON1_FLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -195,6 +284,7 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -272,15 +362,17 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 -sqlite3_SOURCES = shell.c sqlite3.c sqlite3.h -sqlite3_LDADD = @READLINE_LIBS@ -sqlite3_CFLAGS = $(AM_CFLAGS) +sqlite3_SOURCES = shell.c sqlite3.h +EXTRA_sqlite3_SOURCES = sqlite3.c +sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ +sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ +sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc man_MANS = sqlite3.1 @@ -303,7 +395,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -324,6 +415,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ + install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ @@ -350,14 +442,17 @@ uninstall-libLTLIBRARIES: clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES) $(EXTRA_libsqlite3_la_DEPENDENCIES) - $(libsqlite3_la_LINK) -rpath $(libdir) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libsqlite3_la_LINK) -rpath $(libdir) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -367,10 +462,12 @@ install-binPROGRAMS: $(bin_PROGRAMS) fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ @@ -391,7 +488,8 @@ uninstall-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files @@ -404,9 +502,10 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES) $(EXTRA_sqlite3_DEPENDENCIES) @rm -f sqlite3$(EXEEXT) - $(sqlite3_LINK) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) + $(AM_V_CCLD)$(sqlite3_LINK) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -419,53 +518,53 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqlite3.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< sqlite3-shell.o: shell.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.o -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shell.c' object='sqlite3-shell.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.o -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell.c' object='sqlite3-shell.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c sqlite3-shell.obj: shell.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.obj -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shell.c' object='sqlite3-shell.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.obj -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell.c' object='sqlite3-shell.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` sqlite3-sqlite3.o: sqlite3.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.o -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sqlite3.c' object='sqlite3-sqlite3.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.o -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sqlite3.c' object='sqlite3-sqlite3.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c sqlite3-sqlite3.obj: sqlite3.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.obj -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sqlite3.c' object='sqlite3-sqlite3.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.obj -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sqlite3.c' object='sqlite3-sqlite3.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -561,26 +660,15 @@ uninstall-includeHEADERS: files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -592,15 +680,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -609,24 +693,33 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) - @list='$(MANS)'; if test -n "$$list"; then \ - list=`for p in $$list; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ - if test -n "$$list" && \ - grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ - echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ - grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ - echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ - echo " typically \`make maintainer-clean' will remove them" >&2; \ - exit 1; \ - else :; fi; \ - else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -667,40 +760,42 @@ distdir: $(DISTFILES) || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -711,8 +806,6 @@ distcheck: dist GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -724,18 +817,19 @@ distcheck: dist *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -758,7 +852,7 @@ distcheck: dist && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -907,26 +1001,28 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ - clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \ - dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am \ - install-includeHEADERS install-info install-info-am \ - install-libLTLIBRARIES install-man install-man1 install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-includeHEADERS \ - uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \ - uninstall-pkgconfigDATA +.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-cscope clean-generic \ + clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \ + ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \ + dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-man1 install-pdf install-pdf-am install-pkgconfigDATA \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-includeHEADERS uninstall-libLTLIBRARIES \ + uninstall-man uninstall-man1 uninstall-pkgconfigDATA + +.PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. Added: vendor/sqlite3/dist/README.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/sqlite3/dist/README.txt Sun Apr 17 21:14:22 2016 (r298159) @@ -0,0 +1,113 @@ +This package contains: + + * the SQLite library amalgamation source code file: sqlite3.c + * the sqlite3.h and sqlite3ext.h header files that define the C-language + interface to the sqlite3.c library file + * the shell.c file used to build the sqlite3 command-line shell program + * autoconf/automake installation infrastucture for building on POSIX + compliant systems + * a Makefile.msc, sqlite3.rc, and Replace.cs for building with Microsoft + Visual C++ on Windows + +SUMMARY OF HOW TO BUILD +======================= + + Unix: ./configure; make + Windows: nmake /f Makefile.msc + +BUILDING ON POSIX +================= + +The generic installation instructions for autoconf/automake are found +in the INSTALL file. + +The following SQLite specific boolean options are supported: + + --enable-readline use readline in shell tool [default=yes] + --enable-threadsafe build a thread-safe library [default=yes] + --enable-dynamic-extensions support loadable extensions [default=yes] + +The default value for the CFLAGS variable (options passed to the C +compiler) includes debugging symbols in the build, resulting in larger +binaries than are necessary. Override it on the configure command +line like this: + + $ CFLAGS="-Os" ./configure + +to produce a smaller installation footprint. + +Other SQLite compilation parameters can also be set using CFLAGS. For +example: + + $ CFLAGS="-Os -DSQLITE_THREADSAFE=0" ./configure + + +BUILDING WITH MICROSOFT VISUAL C++ +================================== + +To compile for Windows using Microsoft Visual C++: + + $ nmake /f Makefile.msc + +Using Microsoft Visual C++ 2005 (or later) is recommended. Several Windows +platform variants may be built by adding additional macros to the NMAKE +command line. + +Building for WinRT 8.0 +---------------------- + + FOR_WINRT=1 + +Using Microsoft Visual C++ 2012 (or later) is required. When using the +above, something like the following macro will need to be added to the +NMAKE command line as well: + + "NSDKLIBPATH=%WindowsSdkDir%\..\8.0\lib\win8\um\x86" + +Building for WinRT 8.1 +---------------------- + + FOR_WINRT=1 + +Using Microsoft Visual C++ 2013 (or later) is required. When using the +above, something like the following macro will need to be added to the +NMAKE command line as well: + + "NSDKLIBPATH=%WindowsSdkDir%\..\8.1\lib\winv6.3\um\x86" + +Building for UWP 10.0 +--------------------- + + FOR_WINRT=1 FOR_UWP=1 + +Using Microsoft Visual C++ 2015 (or later) is required. When using the +above, something like the following macros will need to be added to the +NMAKE command line as well: + + "NSDKLIBPATH=%WindowsSdkDir%\..\10\lib\10.0.10586.0\um\x86" + "PSDKLIBPATH=%WindowsSdkDir%\..\10\lib\10.0.10586.0\um\x86" + "NUCRTLIBPATH=%UniversalCRTSdkDir%\..\10\lib\10.0.10586.0\ucrt\x86" + +Building for the Windows 10 SDK +------------------------------- + + FOR_WIN10=1 + +Using Microsoft Visual C++ 2015 (or later) is required. When using the +above, no other macros should be needed on the NMAKE command line. + +Other preprocessor defines +-------------------------- + +Additionally, preprocessor defines may be specified by using the OPTS macro +on the NMAKE command line. However, not all possible preprocessor defines +may be specified in this manner as some require the amalgamation to be built +with them enabled (see http://www.sqlite.org/compile.html). For example, the +following will work: + + "OPTS=-DSQLITE_ENABLE_STAT4=1 -DSQLITE_ENABLE_JSON1=1" + +However, the following will not compile unless the amalgamation was built +with it enabled: + + "OPTS=-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1" Modified: vendor/sqlite3/dist/aclocal.m4 ============================================================================== --- vendor/sqlite3/dist/aclocal.m4 Sun Apr 17 20:45:52 2016 (r298158) +++ vendor/sqlite3/dist/aclocal.m4 Sun Apr 17 21:14:22 2016 (r298159) @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.5 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,19 +11,18 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -32,36 +30,30 @@ To do so, use the procedure documented b # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . ]) -# serial 57 LT_INIT +# serial 58 LT_INIT # LT_PREREQ(VERSION) @@ -89,7 +81,7 @@ esac # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -113,7 +105,7 @@ dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -133,26 +125,43 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -199,15 +208,16 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LIN m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 17 21:15:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1FC7B1281C; Sun, 17 Apr 2016 21:15:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62C6B12A0; Sun, 17 Apr 2016 21:15:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLFRLd072725; Sun, 17 Apr 2016 21:15:27 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLFRCe072723; Sun, 17 Apr 2016 21:15:27 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604172115.u3HLFRCe072723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 17 Apr 2016 21:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298160 - vendor/sqlite3/sqlite-3120100 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:15:29 -0000 Author: bapt Date: Sun Apr 17 21:15:27 2016 New Revision: 298160 URL: https://svnweb.freebsd.org/changeset/base/298160 Log: tag import of sqlite3-3.12.1 (3120100) Added: vendor/sqlite3/sqlite-3120100/ - copied from r294088, vendor/sqlite3/dist/ vendor/sqlite3/sqlite-3120100/README.txt - copied unchanged from r298159, vendor/sqlite3/dist/README.txt Replaced: vendor/sqlite3/sqlite-3120100/Makefile.am - copied unchanged from r298159, vendor/sqlite3/dist/Makefile.am vendor/sqlite3/sqlite-3120100/Makefile.in - copied unchanged from r298159, vendor/sqlite3/dist/Makefile.in vendor/sqlite3/sqlite-3120100/aclocal.m4 - copied unchanged from r298159, vendor/sqlite3/dist/aclocal.m4 vendor/sqlite3/sqlite-3120100/config.guess - copied unchanged from r298159, vendor/sqlite3/dist/config.guess vendor/sqlite3/sqlite-3120100/config.sub - copied unchanged from r298159, vendor/sqlite3/dist/config.sub vendor/sqlite3/sqlite-3120100/configure - copied unchanged from r298159, vendor/sqlite3/dist/configure vendor/sqlite3/sqlite-3120100/configure.ac - copied unchanged from r298159, vendor/sqlite3/dist/configure.ac vendor/sqlite3/sqlite-3120100/depcomp - copied unchanged from r298159, vendor/sqlite3/dist/depcomp vendor/sqlite3/sqlite-3120100/install-sh - copied unchanged from r298159, vendor/sqlite3/dist/install-sh vendor/sqlite3/sqlite-3120100/ltmain.sh - copied unchanged from r298159, vendor/sqlite3/dist/ltmain.sh vendor/sqlite3/sqlite-3120100/missing - copied unchanged from r298159, vendor/sqlite3/dist/missing vendor/sqlite3/sqlite-3120100/shell.c - copied unchanged from r298159, vendor/sqlite3/dist/shell.c vendor/sqlite3/sqlite-3120100/sqlite3.c - copied unchanged from r298159, vendor/sqlite3/dist/sqlite3.c vendor/sqlite3/sqlite-3120100/sqlite3.h - copied unchanged from r298159, vendor/sqlite3/dist/sqlite3.h vendor/sqlite3/sqlite-3120100/sqlite3ext.h - copied unchanged from r298159, vendor/sqlite3/dist/sqlite3ext.h Deleted: vendor/sqlite3/sqlite-3120100/README Copied: vendor/sqlite3/sqlite-3120100/Makefile.am (from r298159, vendor/sqlite3/dist/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/sqlite3/sqlite-3120100/Makefile.am Sun Apr 17 21:15:27 2016 (r298160, copy of r298159, vendor/sqlite3/dist/Makefile.am) @@ -0,0 +1,21 @@ + +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE + +lib_LTLIBRARIES = libsqlite3.la +libsqlite3_la_SOURCES = sqlite3.c +libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 + +bin_PROGRAMS = sqlite3 +sqlite3_SOURCES = shell.c sqlite3.h +EXTRA_sqlite3_SOURCES = sqlite3.c +sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ +sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ +sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS + +include_HEADERS = sqlite3.h sqlite3ext.h + +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs +pkgconfigdir = ${libdir}/pkgconfig +pkgconfig_DATA = sqlite3.pc + +man_MANS = sqlite3.1 Copied: vendor/sqlite3/sqlite-3120100/Makefile.in (from r298159, vendor/sqlite3/dist/Makefile.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/sqlite3/sqlite-3120100/Makefile.in Sun Apr 17 21:15:27 2016 (r298160, copy of r298159, vendor/sqlite3/dist/Makefile.in) @@ -0,0 +1,1030 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = sqlite3$(EXEEXT) +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = sqlite3.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libsqlite3_la_LIBADD = +am_libsqlite3_la_OBJECTS = sqlite3.lo +libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libsqlite3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libsqlite3_la_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(bin_PROGRAMS) +am_sqlite3_OBJECTS = sqlite3-shell.$(OBJEXT) +sqlite3_OBJECTS = $(am_sqlite3_OBJECTS) +sqlite3_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sqlite3_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ + $(EXTRA_sqlite3_SOURCES) +DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ + $(EXTRA_sqlite3_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +DATA = $(pkgconfig_DATA) +HEADERS = $(include_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/sqlite3.pc.in \ + INSTALL compile config.guess config.sub depcomp install-sh \ + ltmain.sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_CFLAGS = @BUILD_CFLAGS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DYNAMIC_EXTENSION_FLAGS = @DYNAMIC_EXTENSION_FLAGS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXTRA_SHELL_OBJ = @EXTRA_SHELL_OBJ@ +FGREP = @FGREP@ +FTS5_FLAGS = @FTS5_FLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JSON1_FLAGS = @JSON1_FLAGS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +THREADSAFE_FLAGS = @THREADSAFE_FLAGS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +lib_LTLIBRARIES = libsqlite3.la +libsqlite3_la_SOURCES = sqlite3.c +libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 +sqlite3_SOURCES = shell.c sqlite3.h +EXTRA_sqlite3_SOURCES = sqlite3.c +sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ +sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ +sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS +include_HEADERS = sqlite3.h sqlite3ext.h +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs +pkgconfigdir = ${libdir}/pkgconfig +pkgconfig_DATA = sqlite3.pc +man_MANS = sqlite3.1 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES) $(EXTRA_libsqlite3_la_DEPENDENCIES) + $(AM_V_CCLD)$(libsqlite3_la_LINK) -rpath $(libdir) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES) $(EXTRA_sqlite3_DEPENDENCIES) + @rm -f sqlite3$(EXEEXT) + $(AM_V_CCLD)$(sqlite3_LINK) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqlite3-shell.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqlite3-sqlite3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqlite3.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +sqlite3-shell.o: shell.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.o -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell.c' object='sqlite3-shell.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c + +sqlite3-shell.obj: shell.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.obj -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell.c' object='sqlite3-shell.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` + +sqlite3-sqlite3.o: sqlite3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.o -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sqlite3.c' object='sqlite3-sqlite3.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c + +sqlite3-sqlite3.obj: sqlite3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.obj -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sqlite3.c' object='sqlite3-sqlite3.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-includeHEADERS install-man \ + install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 17 21:23:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF5B7B129C8; Sun, 17 Apr 2016 21:23:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7135B17C5; Sun, 17 Apr 2016 21:23:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLNEhg075684; Sun, 17 Apr 2016 21:23:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLNEfb075678; Sun, 17 Apr 2016 21:23:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604172123.u3HLNEfb075678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 17 Apr 2016 21:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298161 - head/contrib/sqlite3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:23:15 -0000 Author: bapt Date: Sun Apr 17 21:23:14 2016 New Revision: 298161 URL: https://svnweb.freebsd.org/changeset/base/298161 Log: Import sqlite3 3.12.1 Added: head/contrib/sqlite3/README.txt - copied unchanged from r298160, vendor/sqlite3/dist/README.txt Deleted: head/contrib/sqlite3/README Modified: head/contrib/sqlite3/Makefile.am head/contrib/sqlite3/Makefile.in head/contrib/sqlite3/aclocal.m4 head/contrib/sqlite3/config.guess head/contrib/sqlite3/config.sub head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/depcomp head/contrib/sqlite3/install-sh head/contrib/sqlite3/ltmain.sh head/contrib/sqlite3/missing head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/sqlite3ext.h Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/Makefile.am ============================================================================== --- head/contrib/sqlite3/Makefile.am Sun Apr 17 21:15:27 2016 (r298160) +++ head/contrib/sqlite3/Makefile.am Sun Apr 17 21:23:14 2016 (r298161) @@ -1,18 +1,20 @@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 bin_PROGRAMS = sqlite3 -sqlite3_SOURCES = shell.c sqlite3.c sqlite3.h -sqlite3_LDADD = @READLINE_LIBS@ -sqlite3_CFLAGS = $(AM_CFLAGS) +sqlite3_SOURCES = shell.c sqlite3.h +EXTRA_sqlite3_SOURCES = sqlite3.c +sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ +sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ +sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc Modified: head/contrib/sqlite3/Makefile.in ============================================================================== --- head/contrib/sqlite3/Makefile.in Sun Apr 17 21:15:27 2016 (r298160) +++ head/contrib/sqlite3/Makefile.in Sun Apr 17 21:23:14 2016 (r298161) @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,23 +18,61 @@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -56,14 +93,12 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sqlite3$(EXEEXT) subdir = . -DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/sqlite3.pc.in $(top_srcdir)/configure INSTALL \ - config.guess config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -103,31 +138,57 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libsqlite3_la_LIBADD = am_libsqlite3_la_OBJECTS = sqlite3.lo libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS) -libsqlite3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libsqlite3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsqlite3_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) -am_sqlite3_OBJECTS = sqlite3-shell.$(OBJEXT) sqlite3-sqlite3.$(OBJEXT) +am_sqlite3_OBJECTS = sqlite3-shell.$(OBJEXT) sqlite3_OBJECTS = $(am_sqlite3_OBJECTS) -sqlite3_DEPENDENCIES = -sqlite3_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(sqlite3_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +sqlite3_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sqlite3_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) -DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ + $(EXTRA_sqlite3_SOURCES) +DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) \ + $(EXTRA_sqlite3_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -138,8 +199,30 @@ NROFF = nroff MANS = $(man_MANS) DATA = $(pkgconfig_DATA) HEADERS = $(include_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/sqlite3.pc.in \ + INSTALL compile config.guess config.sub depcomp install-sh \ + ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -149,14 +232,17 @@ am__remove_distdir = \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -180,13 +266,16 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +EXTRA_SHELL_OBJ = @EXTRA_SHELL_OBJ@ FGREP = @FGREP@ +FTS5_FLAGS = @FTS5_FLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JSON1_FLAGS = @JSON1_FLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -195,6 +284,7 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -272,15 +362,17 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 -sqlite3_SOURCES = shell.c sqlite3.c sqlite3.h -sqlite3_LDADD = @READLINE_LIBS@ -sqlite3_CFLAGS = $(AM_CFLAGS) +sqlite3_SOURCES = shell.c sqlite3.h +EXTRA_sqlite3_SOURCES = sqlite3.c +sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ +sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ +sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc man_MANS = sqlite3.1 @@ -303,7 +395,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -324,6 +415,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ + install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ @@ -350,14 +442,17 @@ uninstall-libLTLIBRARIES: clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES) $(EXTRA_libsqlite3_la_DEPENDENCIES) - $(libsqlite3_la_LINK) -rpath $(libdir) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libsqlite3_la_LINK) -rpath $(libdir) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -367,10 +462,12 @@ install-binPROGRAMS: $(bin_PROGRAMS) fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ @@ -391,7 +488,8 @@ uninstall-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files @@ -404,9 +502,10 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES) $(EXTRA_sqlite3_DEPENDENCIES) @rm -f sqlite3$(EXEEXT) - $(sqlite3_LINK) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) + $(AM_V_CCLD)$(sqlite3_LINK) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -419,53 +518,53 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqlite3.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< sqlite3-shell.o: shell.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.o -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shell.c' object='sqlite3-shell.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.o -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell.c' object='sqlite3-shell.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.o `test -f 'shell.c' || echo '$(srcdir)/'`shell.c sqlite3-shell.obj: shell.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.obj -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shell.c' object='sqlite3-shell.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-shell.obj -MD -MP -MF $(DEPDIR)/sqlite3-shell.Tpo -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-shell.Tpo $(DEPDIR)/sqlite3-shell.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell.c' object='sqlite3-shell.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-shell.obj `if test -f 'shell.c'; then $(CYGPATH_W) 'shell.c'; else $(CYGPATH_W) '$(srcdir)/shell.c'; fi` sqlite3-sqlite3.o: sqlite3.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.o -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sqlite3.c' object='sqlite3-sqlite3.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.o -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sqlite3.c' object='sqlite3-sqlite3.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.o `test -f 'sqlite3.c' || echo '$(srcdir)/'`sqlite3.c sqlite3-sqlite3.obj: sqlite3.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.obj -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sqlite3.c' object='sqlite3-sqlite3.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -MT sqlite3-sqlite3.obj -MD -MP -MF $(DEPDIR)/sqlite3-sqlite3.Tpo -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sqlite3-sqlite3.Tpo $(DEPDIR)/sqlite3-sqlite3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sqlite3.c' object='sqlite3-sqlite3.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sqlite3_CFLAGS) $(CFLAGS) -c -o sqlite3-sqlite3.obj `if test -f 'sqlite3.c'; then $(CYGPATH_W) 'sqlite3.c'; else $(CYGPATH_W) '$(srcdir)/sqlite3.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -561,26 +660,15 @@ uninstall-includeHEADERS: files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -592,15 +680,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -609,24 +693,33 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) - @list='$(MANS)'; if test -n "$$list"; then \ - list=`for p in $$list; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ - if test -n "$$list" && \ - grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ - echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ - grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ - echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ - echo " typically \`make maintainer-clean' will remove them" >&2; \ - exit 1; \ - else :; fi; \ - else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -667,40 +760,42 @@ distdir: $(DISTFILES) || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -711,8 +806,6 @@ distcheck: dist GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -724,18 +817,19 @@ distcheck: dist *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -758,7 +852,7 @@ distcheck: dist && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -907,26 +1001,28 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ - clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \ - dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am \ - install-includeHEADERS install-info install-info-am \ - install-libLTLIBRARIES install-man install-man1 install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-includeHEADERS \ - uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \ - uninstall-pkgconfigDATA +.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-cscope clean-generic \ + clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \ + ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \ + dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-man1 install-pdf install-pdf-am install-pkgconfigDATA \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-includeHEADERS uninstall-libLTLIBRARIES \ + uninstall-man uninstall-man1 uninstall-pkgconfigDATA + +.PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. Copied: head/contrib/sqlite3/README.txt (from r298160, vendor/sqlite3/dist/README.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/sqlite3/README.txt Sun Apr 17 21:23:14 2016 (r298161, copy of r298160, vendor/sqlite3/dist/README.txt) @@ -0,0 +1,113 @@ +This package contains: + + * the SQLite library amalgamation source code file: sqlite3.c + * the sqlite3.h and sqlite3ext.h header files that define the C-language + interface to the sqlite3.c library file + * the shell.c file used to build the sqlite3 command-line shell program + * autoconf/automake installation infrastucture for building on POSIX + compliant systems + * a Makefile.msc, sqlite3.rc, and Replace.cs for building with Microsoft + Visual C++ on Windows + +SUMMARY OF HOW TO BUILD +======================= + + Unix: ./configure; make + Windows: nmake /f Makefile.msc + +BUILDING ON POSIX +================= + +The generic installation instructions for autoconf/automake are found +in the INSTALL file. + +The following SQLite specific boolean options are supported: + + --enable-readline use readline in shell tool [default=yes] + --enable-threadsafe build a thread-safe library [default=yes] + --enable-dynamic-extensions support loadable extensions [default=yes] + +The default value for the CFLAGS variable (options passed to the C +compiler) includes debugging symbols in the build, resulting in larger +binaries than are necessary. Override it on the configure command +line like this: + + $ CFLAGS="-Os" ./configure + +to produce a smaller installation footprint. + +Other SQLite compilation parameters can also be set using CFLAGS. For +example: + + $ CFLAGS="-Os -DSQLITE_THREADSAFE=0" ./configure + + +BUILDING WITH MICROSOFT VISUAL C++ +================================== + +To compile for Windows using Microsoft Visual C++: + + $ nmake /f Makefile.msc + +Using Microsoft Visual C++ 2005 (or later) is recommended. Several Windows +platform variants may be built by adding additional macros to the NMAKE +command line. + +Building for WinRT 8.0 +---------------------- + + FOR_WINRT=1 + +Using Microsoft Visual C++ 2012 (or later) is required. When using the +above, something like the following macro will need to be added to the +NMAKE command line as well: + + "NSDKLIBPATH=%WindowsSdkDir%\..\8.0\lib\win8\um\x86" + +Building for WinRT 8.1 +---------------------- + + FOR_WINRT=1 + +Using Microsoft Visual C++ 2013 (or later) is required. When using the +above, something like the following macro will need to be added to the +NMAKE command line as well: + + "NSDKLIBPATH=%WindowsSdkDir%\..\8.1\lib\winv6.3\um\x86" + +Building for UWP 10.0 +--------------------- + + FOR_WINRT=1 FOR_UWP=1 + +Using Microsoft Visual C++ 2015 (or later) is required. When using the +above, something like the following macros will need to be added to the +NMAKE command line as well: + + "NSDKLIBPATH=%WindowsSdkDir%\..\10\lib\10.0.10586.0\um\x86" + "PSDKLIBPATH=%WindowsSdkDir%\..\10\lib\10.0.10586.0\um\x86" + "NUCRTLIBPATH=%UniversalCRTSdkDir%\..\10\lib\10.0.10586.0\ucrt\x86" + +Building for the Windows 10 SDK +------------------------------- + + FOR_WIN10=1 + +Using Microsoft Visual C++ 2015 (or later) is required. When using the +above, no other macros should be needed on the NMAKE command line. + +Other preprocessor defines +-------------------------- + +Additionally, preprocessor defines may be specified by using the OPTS macro +on the NMAKE command line. However, not all possible preprocessor defines +may be specified in this manner as some require the amalgamation to be built +with them enabled (see http://www.sqlite.org/compile.html). For example, the +following will work: + + "OPTS=-DSQLITE_ENABLE_STAT4=1 -DSQLITE_ENABLE_JSON1=1" + +However, the following will not compile unless the amalgamation was built +with it enabled: + + "OPTS=-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1" Modified: head/contrib/sqlite3/aclocal.m4 ============================================================================== --- head/contrib/sqlite3/aclocal.m4 Sun Apr 17 21:15:27 2016 (r298160) +++ head/contrib/sqlite3/aclocal.m4 Sun Apr 17 21:23:14 2016 (r298161) @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.5 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,19 +11,18 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -32,36 +30,30 @@ To do so, use the procedure documented b # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . ]) -# serial 57 LT_INIT +# serial 58 LT_INIT # LT_PREREQ(VERSION) @@ -89,7 +81,7 @@ esac # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -113,7 +105,7 @@ dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -133,26 +125,43 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -199,15 +208,16 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LIN m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 17 21:25:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D911EB12AC1; Sun, 17 Apr 2016 21:25:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B55A19C6; Sun, 17 Apr 2016 21:25:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLPsEs075849; Sun, 17 Apr 2016 21:25:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLPsHP075840; Sun, 17 Apr 2016 21:25:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604172125.u3HLPsHP075840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 17 Apr 2016 21:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298162 - in vendor/libucl/dist: . include lua python python/src src tests tests/basic tests/schema utils X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:25:56 -0000 Author: bapt Date: Sun Apr 17 21:25:53 2016 New Revision: 298162 URL: https://svnweb.freebsd.org/changeset/base/298162 Log: Import libucl 0.8.0 Added: vendor/libucl/dist/tests/basic/escapes.in (contents, props changed) vendor/libucl/dist/tests/basic/escapes.res vendor/libucl/dist/tests/basic/load.in (contents, props changed) vendor/libucl/dist/tests/basic/load.inc (contents, props changed) vendor/libucl/dist/tests/basic/load.res Modified: vendor/libucl/dist/ChangeLog.md vendor/libucl/dist/Makefile.am vendor/libucl/dist/README.md vendor/libucl/dist/configure.ac vendor/libucl/dist/include/ucl++.h vendor/libucl/dist/include/ucl.h vendor/libucl/dist/lua/lua_ucl.c vendor/libucl/dist/python/src/uclmodule.c vendor/libucl/dist/python/test_uclmodule.py vendor/libucl/dist/src/ucl_emitter.c vendor/libucl/dist/src/ucl_emitter_streamline.c vendor/libucl/dist/src/ucl_hash.c vendor/libucl/dist/src/ucl_hash.h vendor/libucl/dist/src/ucl_internal.h vendor/libucl/dist/src/ucl_msgpack.c vendor/libucl/dist/src/ucl_parser.c vendor/libucl/dist/src/ucl_schema.c vendor/libucl/dist/src/ucl_sexp.c vendor/libucl/dist/src/ucl_util.c vendor/libucl/dist/tests/basic.test vendor/libucl/dist/tests/basic/18.in vendor/libucl/dist/tests/basic/18.res vendor/libucl/dist/tests/basic/2.res vendor/libucl/dist/tests/basic/9.in vendor/libucl/dist/tests/basic/9.res vendor/libucl/dist/tests/generate.res vendor/libucl/dist/tests/schema.test vendor/libucl/dist/tests/schema/definitions.json vendor/libucl/dist/tests/schema/ref.json vendor/libucl/dist/tests/schema/refRemote.json vendor/libucl/dist/tests/test_basic.c vendor/libucl/dist/tests/test_generate.c vendor/libucl/dist/tests/test_msgpack.c vendor/libucl/dist/tests/test_schema.c vendor/libucl/dist/utils/objdump.c Modified: vendor/libucl/dist/ChangeLog.md ============================================================================== --- vendor/libucl/dist/ChangeLog.md Sun Apr 17 21:23:14 2016 (r298161) +++ vendor/libucl/dist/ChangeLog.md Sun Apr 17 21:25:53 2016 (r298162) @@ -37,3 +37,31 @@ - Fixed a bug with macroes that come after an empty object - Fixed a bug in include processing when an incorrect variable has been destroyed (use-after-free) + +### Libucl 0.8.0 + +- Allow to save comments and macros when parsing UCL documents +- C++ API +- Python bindings (by Eitan Adler) +- Add msgpack support for parser and emitter +- Add Canonical S-expressions parser for libucl +- CLI interface for parsing and validation (by Maxim Ignatenko) +- Implement include with priority +- Add 'nested' functionality to .include macro (by Allan Jude) +- Allow searching an array of paths for includes (by Allan Jude) +- Add new .load macro (by Allan Jude) +- Implement .inherit macro (#100) +- Add merge strategies +- Add schema validation to lua API +- Add support for external references to schema validation +- Add coveralls integration to libucl +- Implement tests for 80% of libucl code lines +- Fix tonns of minor and major bugs +- Improve documentation +- Rework function names to the common conventions (old names are preserved for backwards compatibility) +- Add Coverity scan integration +- Add fuzz tests + +**Incompatible changes**: + +- `ucl_object_emit_full` now accepts additional argument `comments` that could be used to emit comments with UCL output \ No newline at end of file Modified: vendor/libucl/dist/Makefile.am ============================================================================== --- vendor/libucl/dist/Makefile.am Sun Apr 17 21:23:14 2016 (r298161) +++ vendor/libucl/dist/Makefile.am Sun Apr 17 21:25:53 2016 (r298162) @@ -8,4 +8,74 @@ if LUA_SUB LUA_SUBDIR = lua endif -SUBDIRS = src tests utils doc $(LUA_SUBDIR) \ No newline at end of file +COVERAGE_INFO_FILE = $(top_builddir)/coverage.info +COVERAGE_REPORT_DIR = $(top_builddir)/coverage + +.PHONY = coverage-requirement-check clean-coverage-report + +coverage-requirement-check: + @if test ! -e $(GCOV); then \ + echo "Cannot find $(GCOV). Please install gcov."; \ + exit 1; \ + fi + +coverage: coverage-requirement-check clean-coverage coverage-build coverage-check coverage-report + @echo "Please execute 'make clean' before 'make' or 'make check' to remove instrumented object files(compiled with -O0 etc.). Note that 'make clean' also remove coverage data." + +coverage-build: coverage-requirement-check + @if test `find $(top_builddir) -name "*.gcno" | wc -l` -eq 0; then \ + echo "Start to remove old non-instrumented object files..."; \ + $(MAKE) $(AM_MAKEFLAGS) clean; \ + echo "Successfully removed old non-instrumented object files."; \ + fi + @echo "Start to build libraries with coverage options..." + $(MAKE) $(AM_MAKEFLAGS) \ + CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ + CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ + LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ + LIBS="$(LIBS) $(COVERAGE_LIBS)" + @echo "Successfully built libraries with coverage options." + +coverage-check: coverage-requirement-check + @echo "Start to run tests with instrumented libraries..." + $(MAKE) $(AM_MAKEFLAGS) check \ + CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ + CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ + LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ + LIBS="$(LIBS) $(COVERAGE_LIBS)" + @echo "Successfully run tests with instrumented libraries." + +coverage-lcov: coverage-check coverage-requirement-check + $(LCOV) --capture \ + --directory "$(top_builddir)/" \ + --output-file $(COVERAGE_INFO_FILE) \ + --gcov-tool $(GCOV) \ + --compat-libtool --checksum + $(LCOV) --extract $(COVERAGE_INFO_FILE) `pwd`/src/ucl_\* \ + --output-file $(COVERAGE_INFO_FILE) + +coverage-report: coverage-lcov + @echo "Start to create coverage reports..." + $(GENHTML) --prefix "$(top_srcdir)" \ + --output-directory $(COVERAGE_REPORT_DIR) \ + --title $(PACKAGE_NAME) \ + --legend --show-details \ + $(GENHTML_OPTIONS) \ + $(COVERAGE_INFO_FILE) + @echo "Successfully created coverage reports into $(COVERAGE_REPORT_DIR) directory." + +clean-coverage-report: + -rm -rf $(COVERAGE_INFO_FILE) + -rm -rf $(COVERAGE_REPORT_DIR) + +clean-coverage: clean-coverage-report + -$(LCOV) --gcov-tool $(GCOV) --zerocounters --directory $(top_builddir) + @if xargs --version 2>/dev/null; then \ + find $(top_builddir) -name "*.gcno" | xargs --no-run-if-empty rm; \ + else \ + find $(top_builddir) -name "*.gcno" | xargs rm; \ + fi + +clean-local: clean-coverage + +SUBDIRS = src tests utils doc $(LUA_SUBDIR) Modified: vendor/libucl/dist/README.md ============================================================================== --- vendor/libucl/dist/README.md Sun Apr 17 21:23:14 2016 (r298161) +++ vendor/libucl/dist/README.md Sun Apr 17 21:25:53 2016 (r298162) @@ -1,6 +1,6 @@ # LIBUCL -[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138)[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* Modified: vendor/libucl/dist/configure.ac ============================================================================== --- vendor/libucl/dist/configure.ac Sun Apr 17 21:23:14 2016 (r298161) +++ vendor/libucl/dist/configure.ac Sun Apr 17 21:25:53 2016 (r298162) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) -m4_define([med_ver], [7]) -m4_define([min_ver], [3]) -m4_define([so_version], [5:0:2]) +m4_define([med_ver], [8]) +m4_define([min_ver], [0]) +m4_define([so_version], [6:0:0]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) @@ -173,6 +173,8 @@ AC_LINK_IFELSE([ AC_MSG_WARN([Libucl references could be thread-unsafe because atomic builtins are missing]) ]) +AX_CODE_COVERAGE + AC_CONFIG_FILES(Makefile \ src/Makefile \ lua/Makefile Modified: vendor/libucl/dist/include/ucl++.h ============================================================================== --- vendor/libucl/dist/include/ucl++.h Sun Apr 17 21:23:14 2016 (r298161) +++ vendor/libucl/dist/include/ucl++.h Sun Apr 17 21:25:53 2016 (r298162) @@ -26,7 +26,6 @@ #include #include #include -#include #include "ucl.h" @@ -120,18 +119,19 @@ public: it = std::shared_ptr(ucl_object_iterate_new (obj.obj.get()), ucl_iter_deleter()); cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true))); + if (!*cur) { + it.reset (); + cur.reset (); + } } const_iterator() {} - const_iterator(const const_iterator &other) { - it = other.it; - } + const_iterator(const const_iterator &other) = delete; + const_iterator(const_iterator &&other) = default; ~const_iterator() {} - const_iterator& operator=(const const_iterator &other) { - it = other.it; - return *this; - } + const_iterator& operator=(const const_iterator &other) = delete; + const_iterator& operator=(const_iterator &&other) = default; bool operator==(const const_iterator &other) const { @@ -264,45 +264,51 @@ public: return res; } - double number_value () const + double number_value (const double default_val = 0.0) const { - if (obj) { - return ucl_object_todouble (obj.get()); + double res; + + if (ucl_object_todouble_safe(obj.get(), &res)) { + return res; } - return 0.0; + return default_val; } - int64_t int_value () const + int64_t int_value (const int64_t default_val = 0) const { - if (obj) { - return ucl_object_toint (obj.get()); + int64_t res; + + if (ucl_object_toint_safe(obj.get(), &res)) { + return res; } - return 0; + return default_val; } - bool bool_value () const + bool bool_value (const bool default_val = false) const { - if (obj) { - return ucl_object_toboolean (obj.get()); + bool res; + + if (ucl_object_toboolean_safe(obj.get(), &res)) { + return res; } - return false; + return default_val; } - const std::string string_value () const + const std::string string_value (const std::string& default_val = "") const { - std::string res; + const char* res = nullptr; - if (obj) { - res.assign (ucl_object_tostring (obj.get())); + if (ucl_object_tostring_safe(obj.get(), &res)) { + return res; } - return res; + return default_val; } - const Ucl operator[] (size_t i) const + const Ucl at (size_t i) const { if (type () == UCL_ARRAY) { return Ucl (ucl_array_find_index (obj.get(), i)); @@ -311,15 +317,25 @@ public: return Ucl (nullptr); } - const Ucl operator[](const std::string &key) const + const Ucl lookup (const std::string &key) const { if (type () == UCL_OBJECT) { - return Ucl (ucl_object_find_keyl (obj.get(), + return Ucl (ucl_object_lookup_len (obj.get(), key.data (), key.size ())); } return Ucl (nullptr); } + + inline const Ucl operator[] (size_t i) const + { + return at(i); + } + + inline const Ucl operator[](const std::string &key) const + { + return lookup(key); + } // Serialize. void dump (std::string &out, ucl_emitter_t type = UCL_EMIT_JSON) const { @@ -328,7 +344,7 @@ public: cbdata = Ucl::default_emit_funcs(); cbdata.ud = reinterpret_cast(&out); - ucl_object_emit_full (obj.get(), type, &cbdata); + ucl_object_emit_full (obj.get(), type, &cbdata, nullptr); } std::string dump (ucl_emitter_t type = UCL_EMIT_JSON) const @@ -375,6 +391,12 @@ public: std::istreambuf_iterator()), err); } + Ucl& operator= (Ucl rhs) + { + obj.swap (rhs.obj); + return *this; + } + bool operator== (const Ucl &rhs) const { return ucl_object_compare (obj.get(), rhs.obj.get ()) == 0; @@ -388,7 +410,7 @@ public: bool operator> (const Ucl &rhs) const { return (rhs < *this); } bool operator>= (const Ucl &rhs) const { return !(*this < rhs); } - operator bool () const + explicit operator bool () const { if (!obj || type() == UCL_NULL) { return false; Modified: vendor/libucl/dist/include/ucl.h ============================================================================== --- vendor/libucl/dist/include/ucl.h Sun Apr 17 21:23:14 2016 (r298161) +++ vendor/libucl/dist/include/ucl.h Sun Apr 17 21:25:53 2016 (r298162) @@ -107,7 +107,8 @@ typedef enum ucl_error { UCL_ENESTED, /**< Input has too many recursion levels */ UCL_EMACRO, /**< Error processing a macro */ UCL_EINTERNAL, /**< Internal unclassified error */ - UCL_ESSL /**< SSL error */ + UCL_ESSL, /**< SSL error */ + UCL_EMERGE /**< A merge error occured */ } ucl_error_t; /** @@ -147,11 +148,13 @@ typedef enum ucl_emitter { * UCL still has to perform copying implicitly. */ typedef enum ucl_parser_flags { - UCL_PARSER_DEFAULT = 0x0, /**< No special flags */ - UCL_PARSER_KEY_LOWERCASE = 0x1, /**< Convert all keys to lower case */ - UCL_PARSER_ZEROCOPY = 0x2, /**< Parse input in zero-copy mode if possible */ - UCL_PARSER_NO_TIME = 0x4, /**< Do not parse time and treat time values as strings */ - UCL_PARSER_NO_IMPLICIT_ARRAYS = 0x8 /** Create explicit arrays instead of implicit ones */ + UCL_PARSER_DEFAULT = 0, /**< No special flags */ + UCL_PARSER_KEY_LOWERCASE = (1 << 0), /**< Convert all keys to lower case */ + UCL_PARSER_ZEROCOPY = (1 << 1), /**< Parse input in zero-copy mode if possible */ + UCL_PARSER_NO_TIME = (1 << 2), /**< Do not parse time and treat time values as strings */ + UCL_PARSER_NO_IMPLICIT_ARRAYS = (1 << 3), /** Create explicit arrays instead of implicit ones */ + UCL_PARSER_SAVE_COMMENTS = (1 << 4), /** Save comments in the parser context */ + UCL_PARSER_DISABLE_MACRO = (1 << 5) /** Treat macros as comments */ } ucl_parser_flags_t; /** @@ -159,17 +162,17 @@ typedef enum ucl_parser_flags { */ typedef enum ucl_string_flags { UCL_STRING_RAW = 0x0, /**< Treat string as is */ - UCL_STRING_ESCAPE = 0x1, /**< Perform JSON escape */ - UCL_STRING_TRIM = 0x2, /**< Trim leading and trailing whitespaces */ - UCL_STRING_PARSE_BOOLEAN = 0x4, /**< Parse passed string and detect boolean */ - UCL_STRING_PARSE_INT = 0x8, /**< Parse passed string and detect integer number */ - UCL_STRING_PARSE_DOUBLE = 0x10, /**< Parse passed string and detect integer or float number */ - UCL_STRING_PARSE_TIME = 0x20, /**< Parse time strings */ + UCL_STRING_ESCAPE = (1 << 0), /**< Perform JSON escape */ + UCL_STRING_TRIM = (1 << 1), /**< Trim leading and trailing whitespaces */ + UCL_STRING_PARSE_BOOLEAN = (1 << 2), /**< Parse passed string and detect boolean */ + UCL_STRING_PARSE_INT = (1 << 3), /**< Parse passed string and detect integer number */ + UCL_STRING_PARSE_DOUBLE = (1 << 4), /**< Parse passed string and detect integer or float number */ + UCL_STRING_PARSE_TIME = (1 << 5), /**< Parse time strings */ UCL_STRING_PARSE_NUMBER = UCL_STRING_PARSE_INT|UCL_STRING_PARSE_DOUBLE|UCL_STRING_PARSE_TIME, /**< Parse passed string and detect number */ UCL_STRING_PARSE = UCL_STRING_PARSE_BOOLEAN|UCL_STRING_PARSE_NUMBER, /**< Parse passed string (and detect booleans and numbers) */ - UCL_STRING_PARSE_BYTES = 0x40 /**< Treat numbers as bytes */ + UCL_STRING_PARSE_BYTES = (1 << 6) /**< Treat numbers as bytes */ } ucl_string_flags_t; /** @@ -286,10 +289,12 @@ UCL_EXTERN ucl_object_t* ucl_object_new_ /** * Create new object with userdata dtor * @param dtor destructor function + * @param emitter emitter for userdata + * @param ptr opaque pointer * @return new object */ UCL_EXTERN ucl_object_t* ucl_object_new_userdata (ucl_userdata_dtor dtor, - ucl_userdata_emitter emitter) UCL_WARN_UNUSED_RESULT; + ucl_userdata_emitter emitter, void *ptr) UCL_WARN_UNUSED_RESULT; /** * Perform deep copy of an object copying everything @@ -306,6 +311,21 @@ UCL_EXTERN ucl_object_t * ucl_object_cop UCL_EXTERN ucl_type_t ucl_object_type (const ucl_object_t *obj); /** + * Converts ucl object type to its string representation + * @param type type of object + * @return constant string describing type + */ +UCL_EXTERN const char * ucl_object_type_to_string (ucl_type_t type); + +/** + * Converts string that represents ucl type to real ucl type enum + * @param input C string with name of type + * @param res resulting target + * @return true if `input` is a name of type stored in `res` + */ +UCL_EXTERN bool ucl_object_string_to_type (const char *input, ucl_type_t *res); + +/** * Convert any string to an ucl object making the specified transformations * @param str fixed size or NULL terminated string * @param len length (if len is zero, than str is treated as NULL terminated) @@ -642,8 +662,9 @@ UCL_EXTERN const char* ucl_object_tolstr * @param key key to search * @return object matching the specified key or NULL if key was not found */ -UCL_EXTERN const ucl_object_t* ucl_object_find_key (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t* ucl_object_lookup (const ucl_object_t *obj, const char *key); +#define ucl_object_find_key ucl_object_lookup /** * Return object identified by a key in the specified object, if the first key is @@ -655,8 +676,9 @@ UCL_EXTERN const ucl_object_t* ucl_objec * @param ... list of alternative keys to search (NULL terminated) * @return object matching the specified key or NULL if key was not found */ -UCL_EXTERN const ucl_object_t* ucl_object_find_any_key (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t* ucl_object_lookup_any (const ucl_object_t *obj, const char *key, ...); +#define ucl_object_find_any_key ucl_object_lookup_any /** * Return object identified by a fixed size key in the specified object @@ -665,8 +687,9 @@ UCL_EXTERN const ucl_object_t* ucl_objec * @param klen length of a key * @return object matching the specified key or NULL if key was not found */ -UCL_EXTERN const ucl_object_t* ucl_object_find_keyl (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t* ucl_object_lookup_len (const ucl_object_t *obj, const char *key, size_t klen); +#define ucl_object_find_keyl ucl_object_lookup_len /** * Return object identified by dot notation string @@ -674,8 +697,9 @@ UCL_EXTERN const ucl_object_t* ucl_objec * @param path dot.notation.path to the path to lookup. May use numeric .index on arrays * @return object matched the specified path or NULL if path is not found */ -UCL_EXTERN const ucl_object_t *ucl_lookup_path (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t *ucl_object_lookup_path (const ucl_object_t *obj, const char *path); +#define ucl_lookup_path ucl_object_lookup_path /** * Return object identified by object notation string using arbitrary delimiter @@ -684,8 +708,9 @@ UCL_EXTERN const ucl_object_t *ucl_looku * @param sep the sepatorator to use in place of . (incase keys have . in them) * @return object matched the specified path or NULL if path is not found */ -UCL_EXTERN const ucl_object_t *ucl_lookup_path_char (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t *ucl_object_lookup_path_char (const ucl_object_t *obj, const char *path, char sep); +#define ucl_lookup_path_char ucl_object_lookup_path_char /** * Returns a key of an object as a NULL terminated string @@ -735,6 +760,19 @@ UCL_EXTERN int ucl_object_compare (const const ucl_object_t *o2); /** + * Compare objects `o1` and `o2` useful for sorting + * @param o1 the first object + * @param o2 the second object + * @return values >0, 0 and <0 if `o1` is more than, equal and less than `o2`. + * The order of comparison: + * 1) Type of objects + * 2) Size of objects + * 3) Content of objects + */ +UCL_EXTERN int ucl_object_compare_qsort (const ucl_object_t **o1, + const ucl_object_t **o2); + +/** * Sort UCL array using `cmp` compare function * @param ar * @param cmp @@ -770,8 +808,9 @@ typedef void* ucl_object_iter_t; * while ((cur = ucl_iterate_object (obj, &it)) != NULL) ... * @return the next object or NULL */ -UCL_EXTERN const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t* ucl_object_iterate (const ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); +#define ucl_iterate_object ucl_object_iterate /** * Create new safe iterator for the specified object @@ -1040,34 +1079,34 @@ UCL_EXTERN ucl_object_t* ucl_parser_get_ * @param parser parser object * @return error description */ -UCL_EXTERN const char *ucl_parser_get_error(struct ucl_parser *parser); +UCL_EXTERN const char *ucl_parser_get_error (struct ucl_parser *parser); /** * Get the code of the last error * @param parser parser object * @return error code */ -UCL_EXTERN int ucl_parser_get_error_code(struct ucl_parser *parser); +UCL_EXTERN int ucl_parser_get_error_code (struct ucl_parser *parser); /** * Get the current column number within parser * @param parser parser object * @return current column number */ -UCL_EXTERN unsigned ucl_parser_get_column(struct ucl_parser *parser); +UCL_EXTERN unsigned ucl_parser_get_column (struct ucl_parser *parser); /** * Get the current line number within parser * @param parser parser object * @return current line number */ -UCL_EXTERN unsigned ucl_parser_get_linenum(struct ucl_parser *parser); +UCL_EXTERN unsigned ucl_parser_get_linenum (struct ucl_parser *parser); /** * Clear the error in the parser * @param parser parser object */ -UCL_EXTERN void ucl_parser_clear_error(struct ucl_parser *parser); +UCL_EXTERN void ucl_parser_clear_error (struct ucl_parser *parser); /** * Free ucl parser object @@ -1076,6 +1115,42 @@ UCL_EXTERN void ucl_parser_clear_error(s UCL_EXTERN void ucl_parser_free (struct ucl_parser *parser); /** + * Get constant opaque pointer to comments structure for this parser. Increase + * refcount to prevent this object to be destroyed on parser's destruction + * @param parser parser structure + * @return ucl comments pointer or NULL + */ +UCL_EXTERN const ucl_object_t * ucl_parser_get_comments (struct ucl_parser *parser); + +/** + * Utility function to find a comment object for the specified object in the input + * @param comments comments object + * @param srch search object + * @return string comment enclosed in ucl_object_t + */ +UCL_EXTERN const ucl_object_t * ucl_comments_find (const ucl_object_t *comments, + const ucl_object_t *srch); + +/** + * Move comment from `from` object to `to` object + * @param comments comments object + * @param what source object + * @param whith destination object + * @return `true` if `from` has comment and it has been moved to `to` + */ +UCL_EXTERN bool ucl_comments_move (ucl_object_t *comments, + const ucl_object_t *from, const ucl_object_t *to); + +/** + * Adds a new comment for an object + * @param comments comments object + * @param obj object to add comment to + * @param comment string representation of a comment + */ +UCL_EXTERN void ucl_comments_add (ucl_object_t *comments, + const ucl_object_t *obj, const char *comment); + +/** * Add new public key to parser for signatures check * @param parser parser object * @param key PEM representation of a key @@ -1083,7 +1158,8 @@ UCL_EXTERN void ucl_parser_free (struct * @param err if *err is NULL it is set to parser error * @return true if a key has been successfully added */ -UCL_EXTERN bool ucl_pubkey_add (struct ucl_parser *parser, const unsigned char *key, size_t len); +UCL_EXTERN bool ucl_parser_pubkey_add (struct ucl_parser *parser, + const unsigned char *key, size_t len); /** * Set FILENAME and CURDIR variables in parser @@ -1156,8 +1232,8 @@ struct ucl_emitter_context { unsigned int indent; /** Top level object */ const ucl_object_t *top; - /** The rest of context */ - unsigned char data[1]; + /** Optional comments */ + const ucl_object_t *comments; }; /** @@ -1187,11 +1263,13 @@ UCL_EXTERN unsigned char *ucl_object_emi * @param emit_type if type is #UCL_EMIT_JSON then emit json, if type is * #UCL_EMIT_CONFIG then emit config like object * @param emitter a set of emitter functions + * @param comments optional comments for the parser * @return dump of an object (must be freed after using) or NULL in case of error */ UCL_EXTERN bool ucl_object_emit_full (const ucl_object_t *obj, enum ucl_emitter emit_type, - struct ucl_emitter_functions *emitter); + struct ucl_emitter_functions *emitter, + const ucl_object_t *comments); /** * Start streamlined UCL object emitter @@ -1280,6 +1358,9 @@ enum ucl_schema_error_code { UCL_SCHEMA_MISSING_PROPERTY,/**< one or more missing properties */ UCL_SCHEMA_CONSTRAINT, /**< constraint found */ UCL_SCHEMA_MISSING_DEPENDENCY, /**< missing dependency */ + UCL_SCHEMA_EXTERNAL_REF_MISSING, /**< cannot fetch external ref */ + UCL_SCHEMA_EXTERNAL_REF_INVALID, /**< invalid external ref */ + UCL_SCHEMA_INTERNAL_ERROR, /**< something bad happened */ UCL_SCHEMA_UNKNOWN /**< generic error */ }; @@ -1303,6 +1384,37 @@ struct ucl_schema_error { UCL_EXTERN bool ucl_object_validate (const ucl_object_t *schema, const ucl_object_t *obj, struct ucl_schema_error *err); +/** + * Validate object `obj` using schema object `schema` and root schema at `root`. + * @param schema schema object + * @param obj object to validate + * @param root root schema object + * @param err error pointer, if this parameter is not NULL and error has been + * occured, then `err` is filled with the exact error definition. + * @return true if `obj` is valid using `schema` + */ +UCL_EXTERN bool ucl_object_validate_root (const ucl_object_t *schema, + const ucl_object_t *obj, + const ucl_object_t *root, + struct ucl_schema_error *err); + +/** + * Validate object `obj` using schema object `schema` and root schema at `root` + * using some external references provided. + * @param schema schema object + * @param obj object to validate + * @param root root schema object + * @param ext_refs external references (might be modified during validation) + * @param err error pointer, if this parameter is not NULL and error has been + * occured, then `err` is filled with the exact error definition. + * @return true if `obj` is valid using `schema` + */ +UCL_EXTERN bool ucl_object_validate_root_ext (const ucl_object_t *schema, + const ucl_object_t *obj, + const ucl_object_t *root, + ucl_object_t *ext_refs, + struct ucl_schema_error *err); + /** @} */ #ifdef __cplusplus Modified: vendor/libucl/dist/lua/lua_ucl.c ============================================================================== --- vendor/libucl/dist/lua/lua_ucl.c Sun Apr 17 21:23:14 2016 (r298161) +++ vendor/libucl/dist/lua/lua_ucl.c Sun Apr 17 21:25:53 2016 (r298162) @@ -29,6 +29,7 @@ #include "ucl_internal.h" #include "lua_ucl.h" #include +#include /*** * @module ucl @@ -149,14 +150,14 @@ ucl_object_lua_push_object (lua_State *L } /* Optimize allocation by preallocation of table */ - while (ucl_iterate_object (obj, &it, true) != NULL) { + while (ucl_object_iterate (obj, &it, true) != NULL) { nelt ++; } lua_createtable (L, 0, nelt); it = NULL; - while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) { + while ((cur = ucl_object_iterate (obj, &it, true)) != NULL) { ucl_object_lua_push_element (L, ucl_object_key (cur), cur); } @@ -421,9 +422,7 @@ ucl_object_lua_fromelt (lua_State *L, in fd->idx = luaL_ref (L, LUA_REGISTRYINDEX); obj = ucl_object_new_userdata (lua_ucl_userdata_dtor, - lua_ucl_userdata_emitter); - obj->type = UCL_USERDATA; - obj->value.ud = (void *)fd; + lua_ucl_userdata_emitter, (void *)fd); } } } @@ -514,6 +513,17 @@ lua_ucl_object_get (lua_State *L, int in return *((ucl_object_t **) luaL_checkudata(L, index, OBJECT_META)); } +static void +lua_ucl_push_opaque (lua_State *L, ucl_object_t *obj) +{ + ucl_object_t **pobj; + + pobj = lua_newuserdata (L, sizeof (*pobj)); + *pobj = obj; + luaL_getmetatable (L, OBJECT_META); + lua_setmetatable (L, -2); +} + /*** * @method parser:parse_file(name) * Parse UCL object from file. @@ -629,17 +639,14 @@ static int lua_ucl_parser_get_object_wrapped (lua_State *L) { struct ucl_parser *parser; - ucl_object_t *obj, **pobj; + ucl_object_t *obj; int ret = 1; parser = lua_ucl_parser_get (L, 1); obj = ucl_parser_get_object (parser); if (obj != NULL) { - pobj = lua_newuserdata (L, sizeof (*pobj)); - *pobj = obj; - luaL_getmetatable (L, OBJECT_META); - lua_setmetatable (L, -2); + lua_ucl_push_opaque (L, obj); } else { lua_pushnil (L); @@ -806,19 +813,21 @@ lua_ucl_object_tostring (lua_State *L) } /*** - * @method object:validate(schema, path) + * @method object:validate(schema[, path[, ext_refs]]) * Validates the given ucl object using schema object represented as another * opaque ucl object. You can also specify path in the form `#/path/def` to * specify the specific schema element to perform validation. * * @param {ucl.object} schema schema object * @param {string} path optional path for validation procedure - * @return {result,err} two values: boolean result and the corresponding error + * @return {result,err} two values: boolean result and the corresponding + * error, if `ext_refs` are also specified, then they are returned as opaque + * ucl object as {result,err,ext_refs} */ static int lua_ucl_object_validate (lua_State *L) { - ucl_object_t *obj, *schema; + ucl_object_t *obj, *schema, *ext_refs = NULL; const ucl_object_t *schema_elt; bool res = false; struct ucl_schema_error err; @@ -828,15 +837,30 @@ lua_ucl_object_validate (lua_State *L) schema = lua_ucl_object_get (L, 2); if (schema && obj && ucl_object_type (schema) == UCL_OBJECT) { - if (lua_gettop (L) > 2 && lua_type (L, 3) == LUA_TSTRING) { - path = lua_tostring (L, 3); - if (path[0] == '#') { - path ++; + if (lua_gettop (L) > 2) { + if (lua_type (L, 3) == LUA_TSTRING) { + path = lua_tostring (L, 3); + if (path[0] == '#') { + path++; + } + } + else if (lua_type (L, 3) == LUA_TUSERDATA || lua_type (L, 3) == + LUA_TTABLE) { + /* External refs */ + ext_refs = lua_ucl_object_get (L, 3); + } + + if (lua_gettop (L) > 3) { + if (lua_type (L, 4) == LUA_TUSERDATA || lua_type (L, 4) == + LUA_TTABLE) { + /* External refs */ + ext_refs = lua_ucl_object_get (L, 4); + } } } if (path) { - schema_elt = ucl_lookup_path_char (schema, path, '/'); + schema_elt = ucl_object_lookup_path_char (schema, path, '/'); } else { /* Use the top object */ @@ -844,26 +868,33 @@ lua_ucl_object_validate (lua_State *L) } if (schema_elt) { - res = ucl_object_validate (schema_elt, obj, &err); + res = ucl_object_validate_root_ext (schema_elt, obj, schema, + ext_refs, &err); if (res) { lua_pushboolean (L, res); lua_pushnil (L); + + if (ext_refs) { + lua_ucl_push_opaque (L, ext_refs); + } } else { lua_pushboolean (L, res); lua_pushfstring (L, "validation error: %s", err.msg); + + if (ext_refs) { + lua_ucl_push_opaque (L, ext_refs); + } } } else { lua_pushboolean (L, res); - if (path) { - lua_pushfstring (L, "cannot find the requested path: %s", path); - } - else { - /* Should not be reached */ - lua_pushstring (L, "unknown error"); + lua_pushfstring (L, "cannot find the requested path: %s", path); + + if (ext_refs) { + lua_ucl_push_opaque (L, ext_refs); } } } @@ -872,6 +903,10 @@ lua_ucl_object_validate (lua_State *L) lua_pushstring (L, "invalid object or schema"); } + if (ext_refs) { + return 3; + } + return 2; } Modified: vendor/libucl/dist/python/src/uclmodule.c ============================================================================== --- vendor/libucl/dist/python/src/uclmodule.c Sun Apr 17 21:23:14 2016 (r298161) +++ vendor/libucl/dist/python/src/uclmodule.c Sun Apr 17 21:25:53 2016 (r298162) @@ -2,65 +2,63 @@ #include #include -static PyObject* -_basic_ucl_type(ucl_object_t const * const obj) { - if (obj->type == UCL_INT) { - return Py_BuildValue("L", (long long)ucl_object_toint (obj)); - } - else if (obj->type == UCL_FLOAT) { - return Py_BuildValue("d", ucl_object_todouble (obj)); - } - else if (obj->type == UCL_STRING) { - return Py_BuildValue("s", ucl_object_tostring (obj)); - } - else if (obj->type == UCL_BOOLEAN) { - // maybe used 'p' here? - return Py_BuildValue("s", ucl_object_tostring_forced (obj)); - } - else if (obj->type == UCL_TIME) { - return Py_BuildValue("d", ucl_object_todouble (obj)); +static PyObject * +_basic_ucl_type (ucl_object_t const *obj) +{ + switch (obj->type) { + case UCL_INT: + return Py_BuildValue ("L", (long long)ucl_object_toint (obj)); + case UCL_FLOAT: + return Py_BuildValue ("d", ucl_object_todouble (obj)); + case UCL_STRING: + return Py_BuildValue ("s", ucl_object_tostring (obj)); + case UCL_BOOLEAN: + return ucl_object_toboolean (obj) ? Py_True : Py_False; + case UCL_TIME: + return Py_BuildValue ("d", ucl_object_todouble (obj)); } return NULL; } -static PyObject* -_iterate_valid_ucl(ucl_object_t const * obj) { +static PyObject * +_iterate_valid_ucl (ucl_object_t const *obj) +{ const ucl_object_t *tmp; ucl_object_iter_t it = NULL; tmp = obj; - while ((obj = ucl_iterate_object (tmp, &it, false))) { - - PyObject* val; + while ((obj = ucl_object_iterate (tmp, &it, false))) { + PyObject *val; val = _basic_ucl_type(obj); if (!val) { - PyObject* key = NULL; + PyObject *key = NULL; + if (obj->key != NULL) { key = Py_BuildValue("s", ucl_object_key(obj)); } - PyObject* ret; - ret = PyDict_New(); if (obj->type == UCL_OBJECT) { - val = PyDict_New(); const ucl_object_t *cur; ucl_object_iter_t it_obj = NULL; - while ((cur = ucl_iterate_object (obj, &it_obj, true))) { - PyObject* keyobj = Py_BuildValue("s",ucl_object_key(cur)); + + val = PyDict_New(); + + while ((cur = ucl_object_iterate (obj, &it_obj, true))) { + PyObject *keyobj = Py_BuildValue("s",ucl_object_key(cur)); PyDict_SetItem(val, keyobj, _iterate_valid_ucl(cur)); } - } - else if (obj->type == UCL_ARRAY) { - val = PyList_New(0); + } else if (obj->type == UCL_ARRAY) { const ucl_object_t *cur; ucl_object_iter_t it_obj = NULL; - while ((cur = ucl_iterate_object (obj, &it_obj, true))) { + + val = PyList_New(0); + + while ((cur = ucl_object_iterate (obj, &it_obj, true))) { PyList_Append(val, _iterate_valid_ucl(cur)); } - } - else if (obj->type == UCL_USERDATA) { + } else if (obj->type == UCL_USERDATA) { // XXX: this should be // PyBytes_FromStringAndSize; where is the // length from? @@ -74,13 +72,13 @@ _iterate_valid_ucl(ucl_object_t const * return NULL; } -static PyObject* -_internal_load_ucl(char* uclstr) { - PyObject* ret; - +static PyObject * +_internal_load_ucl (char *uclstr) +{ + PyObject *ret; struct ucl_parser *parser = ucl_parser_new (UCL_PARSER_NO_TIME); - bool r = ucl_parser_add_string(parser, uclstr, 0); + if (r) { if (ucl_parser_get_error (parser)) { PyErr_SetString(PyExc_ValueError, ucl_parser_get_error(parser)); @@ -88,13 +86,13 @@ _internal_load_ucl(char* uclstr) { ret = NULL; goto return_with_parser; } else { - ucl_object_t* uclobj = ucl_parser_get_object(parser); + ucl_object_t *uclobj = ucl_parser_get_object(parser); ret = _iterate_valid_ucl(uclobj); ucl_object_unref(uclobj); goto return_with_parser; } - - } else { + } + else { PyErr_SetString(PyExc_ValueError, ucl_parser_get_error (parser)); ret = NULL; goto return_with_parser; @@ -106,36 +104,151 @@ return_with_parser: } static PyObject* -ucl_load(PyObject *self, PyObject *args) { - char* uclstr; +ucl_load (PyObject *self, PyObject *args) +{ + char *uclstr; + if (PyArg_ParseTuple(args, "z", &uclstr)) { if (!uclstr) { Py_RETURN_NONE; } + return _internal_load_ucl(uclstr); } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 17 21:26:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF9ECB12B21; Sun, 17 Apr 2016 21:26:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8952F1B27; Sun, 17 Apr 2016 21:26:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLQtvW075940; Sun, 17 Apr 2016 21:26:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLQtts075934; Sun, 17 Apr 2016 21:26:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604172126.u3HLQtts075934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 17 Apr 2016 21:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298163 - in vendor/libucl/libucl-0.8.0: . include lua python python/src src tests tests/basic tests/schema utils X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:26:57 -0000 Author: bapt Date: Sun Apr 17 21:26:55 2016 New Revision: 298163 URL: https://svnweb.freebsd.org/changeset/base/298163 Log: tag import of libucl 0.8.0 Added: vendor/libucl/libucl-0.8.0/ - copied from r294088, vendor/libucl/dist/ vendor/libucl/libucl-0.8.0/tests/basic/escapes.in - copied unchanged from r298162, vendor/libucl/dist/tests/basic/escapes.in vendor/libucl/libucl-0.8.0/tests/basic/escapes.res - copied unchanged from r298162, vendor/libucl/dist/tests/basic/escapes.res vendor/libucl/libucl-0.8.0/tests/basic/load.in - copied unchanged from r298162, vendor/libucl/dist/tests/basic/load.in vendor/libucl/libucl-0.8.0/tests/basic/load.inc - copied unchanged from r298162, vendor/libucl/dist/tests/basic/load.inc vendor/libucl/libucl-0.8.0/tests/basic/load.res - copied unchanged from r298162, vendor/libucl/dist/tests/basic/load.res Replaced: vendor/libucl/libucl-0.8.0/ChangeLog.md - copied unchanged from r298162, vendor/libucl/dist/ChangeLog.md vendor/libucl/libucl-0.8.0/Makefile.am - copied unchanged from r298162, vendor/libucl/dist/Makefile.am vendor/libucl/libucl-0.8.0/README.md - copied unchanged from r298162, vendor/libucl/dist/README.md vendor/libucl/libucl-0.8.0/configure.ac - copied unchanged from r298162, vendor/libucl/dist/configure.ac vendor/libucl/libucl-0.8.0/include/ucl++.h - copied unchanged from r298162, vendor/libucl/dist/include/ucl++.h vendor/libucl/libucl-0.8.0/include/ucl.h - copied unchanged from r298162, vendor/libucl/dist/include/ucl.h vendor/libucl/libucl-0.8.0/lua/lua_ucl.c - copied unchanged from r298162, vendor/libucl/dist/lua/lua_ucl.c vendor/libucl/libucl-0.8.0/python/src/uclmodule.c - copied unchanged from r298162, vendor/libucl/dist/python/src/uclmodule.c vendor/libucl/libucl-0.8.0/python/test_uclmodule.py - copied unchanged from r298162, vendor/libucl/dist/python/test_uclmodule.py vendor/libucl/libucl-0.8.0/src/ucl_emitter.c - copied unchanged from r298162, vendor/libucl/dist/src/ucl_emitter.c vendor/libucl/libucl-0.8.0/src/ucl_emitter_streamline.c - copied unchanged from r298162, vendor/libucl/dist/src/ucl_emitter_streamline.c vendor/libucl/libucl-0.8.0/src/ucl_hash.c - copied unchanged from r298162, vendor/libucl/dist/src/ucl_hash.c vendor/libucl/libucl-0.8.0/src/ucl_hash.h - copied unchanged from r298162, vendor/libucl/dist/src/ucl_hash.h vendor/libucl/libucl-0.8.0/src/ucl_internal.h - copied unchanged from r298162, vendor/libucl/dist/src/ucl_internal.h vendor/libucl/libucl-0.8.0/src/ucl_msgpack.c - copied unchanged from r298162, vendor/libucl/dist/src/ucl_msgpack.c vendor/libucl/libucl-0.8.0/src/ucl_parser.c - copied unchanged from r298162, vendor/libucl/dist/src/ucl_parser.c vendor/libucl/libucl-0.8.0/src/ucl_schema.c - copied unchanged from r298162, vendor/libucl/dist/src/ucl_schema.c vendor/libucl/libucl-0.8.0/src/ucl_sexp.c - copied unchanged from r298162, vendor/libucl/dist/src/ucl_sexp.c vendor/libucl/libucl-0.8.0/src/ucl_util.c - copied unchanged from r298162, vendor/libucl/dist/src/ucl_util.c vendor/libucl/libucl-0.8.0/tests/basic.test - copied unchanged from r298162, vendor/libucl/dist/tests/basic.test vendor/libucl/libucl-0.8.0/tests/basic/18.in - copied unchanged from r298162, vendor/libucl/dist/tests/basic/18.in vendor/libucl/libucl-0.8.0/tests/basic/18.res - copied unchanged from r298162, vendor/libucl/dist/tests/basic/18.res vendor/libucl/libucl-0.8.0/tests/basic/2.res - copied unchanged from r298162, vendor/libucl/dist/tests/basic/2.res vendor/libucl/libucl-0.8.0/tests/basic/9.in - copied unchanged from r298162, vendor/libucl/dist/tests/basic/9.in vendor/libucl/libucl-0.8.0/tests/basic/9.res - copied unchanged from r298162, vendor/libucl/dist/tests/basic/9.res vendor/libucl/libucl-0.8.0/tests/generate.res - copied unchanged from r298162, vendor/libucl/dist/tests/generate.res vendor/libucl/libucl-0.8.0/tests/schema.test - copied unchanged from r298162, vendor/libucl/dist/tests/schema.test vendor/libucl/libucl-0.8.0/tests/schema/definitions.json - copied unchanged from r298162, vendor/libucl/dist/tests/schema/definitions.json vendor/libucl/libucl-0.8.0/tests/schema/ref.json - copied unchanged from r298162, vendor/libucl/dist/tests/schema/ref.json vendor/libucl/libucl-0.8.0/tests/schema/refRemote.json - copied unchanged from r298162, vendor/libucl/dist/tests/schema/refRemote.json vendor/libucl/libucl-0.8.0/tests/test_basic.c - copied unchanged from r298162, vendor/libucl/dist/tests/test_basic.c vendor/libucl/libucl-0.8.0/tests/test_generate.c - copied unchanged from r298162, vendor/libucl/dist/tests/test_generate.c vendor/libucl/libucl-0.8.0/tests/test_msgpack.c - copied unchanged from r298162, vendor/libucl/dist/tests/test_msgpack.c vendor/libucl/libucl-0.8.0/tests/test_schema.c - copied unchanged from r298162, vendor/libucl/dist/tests/test_schema.c vendor/libucl/libucl-0.8.0/utils/objdump.c - copied unchanged from r298162, vendor/libucl/dist/utils/objdump.c Copied: vendor/libucl/libucl-0.8.0/ChangeLog.md (from r298162, vendor/libucl/dist/ChangeLog.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/libucl-0.8.0/ChangeLog.md Sun Apr 17 21:26:55 2016 (r298163, copy of r298162, vendor/libucl/dist/ChangeLog.md) @@ -0,0 +1,67 @@ +# Version history + +## Libucl 0.5 + +- Streamline emitter has been added, so it is now possible to output partial `ucl` objects +- Emitter now is more flexible due to emitter_context structure + +### 0.5.1 +- Fixed number of bugs and memory leaks + +### 0.5.2 + +- Allow userdata objects to be emitted and destructed +- Use userdata objects to store lua function references + +### Libucl 0.6 + +- Reworked macro interface + +### Libucl 0.6.1 + +- Various utilities fixes + +### Libucl 0.7.0 + +- Move to klib library from uthash to reduce memory overhead and increase performance + +### Libucl 0.7.1 + +- Added safe iterators API + +### Libucl 0.7.2 + +- Fixed serious bugs in schema and arrays iteration + +### Libucl 0.7.3 + +- Fixed a bug with macroes that come after an empty object +- Fixed a bug in include processing when an incorrect variable has been destroyed (use-after-free) + +### Libucl 0.8.0 + +- Allow to save comments and macros when parsing UCL documents +- C++ API +- Python bindings (by Eitan Adler) +- Add msgpack support for parser and emitter +- Add Canonical S-expressions parser for libucl +- CLI interface for parsing and validation (by Maxim Ignatenko) +- Implement include with priority +- Add 'nested' functionality to .include macro (by Allan Jude) +- Allow searching an array of paths for includes (by Allan Jude) +- Add new .load macro (by Allan Jude) +- Implement .inherit macro (#100) +- Add merge strategies +- Add schema validation to lua API +- Add support for external references to schema validation +- Add coveralls integration to libucl +- Implement tests for 80% of libucl code lines +- Fix tonns of minor and major bugs +- Improve documentation +- Rework function names to the common conventions (old names are preserved for backwards compatibility) +- Add Coverity scan integration +- Add fuzz tests + +**Incompatible changes**: + +- `ucl_object_emit_full` now accepts additional argument `comments` that could be used to emit comments with UCL output \ No newline at end of file Copied: vendor/libucl/libucl-0.8.0/Makefile.am (from r298162, vendor/libucl/dist/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/libucl-0.8.0/Makefile.am Sun Apr 17 21:26:55 2016 (r298163, copy of r298162, vendor/libucl/dist/Makefile.am) @@ -0,0 +1,81 @@ +ACLOCAL_AMFLAGS = -I m4 +EXTRA_DIST = uthash klib README.md + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libucl.pc + +if LUA_SUB + LUA_SUBDIR = lua +endif + +COVERAGE_INFO_FILE = $(top_builddir)/coverage.info +COVERAGE_REPORT_DIR = $(top_builddir)/coverage + +.PHONY = coverage-requirement-check clean-coverage-report + +coverage-requirement-check: + @if test ! -e $(GCOV); then \ + echo "Cannot find $(GCOV). Please install gcov."; \ + exit 1; \ + fi + +coverage: coverage-requirement-check clean-coverage coverage-build coverage-check coverage-report + @echo "Please execute 'make clean' before 'make' or 'make check' to remove instrumented object files(compiled with -O0 etc.). Note that 'make clean' also remove coverage data." + +coverage-build: coverage-requirement-check + @if test `find $(top_builddir) -name "*.gcno" | wc -l` -eq 0; then \ + echo "Start to remove old non-instrumented object files..."; \ + $(MAKE) $(AM_MAKEFLAGS) clean; \ + echo "Successfully removed old non-instrumented object files."; \ + fi + @echo "Start to build libraries with coverage options..." + $(MAKE) $(AM_MAKEFLAGS) \ + CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ + CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ + LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ + LIBS="$(LIBS) $(COVERAGE_LIBS)" + @echo "Successfully built libraries with coverage options." + +coverage-check: coverage-requirement-check + @echo "Start to run tests with instrumented libraries..." + $(MAKE) $(AM_MAKEFLAGS) check \ + CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ + CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ + LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ + LIBS="$(LIBS) $(COVERAGE_LIBS)" + @echo "Successfully run tests with instrumented libraries." + +coverage-lcov: coverage-check coverage-requirement-check + $(LCOV) --capture \ + --directory "$(top_builddir)/" \ + --output-file $(COVERAGE_INFO_FILE) \ + --gcov-tool $(GCOV) \ + --compat-libtool --checksum + $(LCOV) --extract $(COVERAGE_INFO_FILE) `pwd`/src/ucl_\* \ + --output-file $(COVERAGE_INFO_FILE) + +coverage-report: coverage-lcov + @echo "Start to create coverage reports..." + $(GENHTML) --prefix "$(top_srcdir)" \ + --output-directory $(COVERAGE_REPORT_DIR) \ + --title $(PACKAGE_NAME) \ + --legend --show-details \ + $(GENHTML_OPTIONS) \ + $(COVERAGE_INFO_FILE) + @echo "Successfully created coverage reports into $(COVERAGE_REPORT_DIR) directory." + +clean-coverage-report: + -rm -rf $(COVERAGE_INFO_FILE) + -rm -rf $(COVERAGE_REPORT_DIR) + +clean-coverage: clean-coverage-report + -$(LCOV) --gcov-tool $(GCOV) --zerocounters --directory $(top_builddir) + @if xargs --version 2>/dev/null; then \ + find $(top_builddir) -name "*.gcno" | xargs --no-run-if-empty rm; \ + else \ + find $(top_builddir) -name "*.gcno" | xargs rm; \ + fi + +clean-local: clean-coverage + +SUBDIRS = src tests utils doc $(LUA_SUBDIR) Copied: vendor/libucl/libucl-0.8.0/README.md (from r298162, vendor/libucl/dist/README.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/libucl-0.8.0/README.md Sun Apr 17 21:26:55 2016 (r298163, copy of r298162, vendor/libucl/dist/README.md) @@ -0,0 +1,382 @@ +# LIBUCL + +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138)[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Introduction](#introduction) +- [Basic structure](#basic-structure) +- [Improvements to the json notation](#improvements-to-the-json-notation) + - [General syntax sugar](#general-syntax-sugar) + - [Automatic arrays creation](#automatic-arrays-creation) + - [Named keys hierarchy](#named-keys-hierarchy) + - [Convenient numbers and booleans](#convenient-numbers-and-booleans) +- [General improvements](#general-improvements) + - [Commments](#commments) + - [Macros support](#macros-support) + - [Variables support](#variables-support) + - [Multiline strings](#multiline-strings) +- [Emitter](#emitter) +- [Validation](#validation) +- [Performance](#performance) +- [Conclusion](#conclusion) + +## Introduction + +This document describes the main features and principles of the configuration +language called `UCL` - universal configuration language. + +If you are looking for the libucl API documentation you can find it at [this page](doc/api.md). + +## Basic structure + +UCL is heavily infused by `nginx` configuration as the example of a convenient configuration +system. However, UCL is fully compatible with `JSON` format and is able to parse json files. +For example, you can write the same configuration in the following ways: + +* in nginx like: + +```nginx +param = value; +section { + param = value; + param1 = value1; + flag = true; + number = 10k; + time = 0.2s; + string = "something"; + subsection { + host = { + host = "hostname"; + port = 900; + } + host = { + host = "hostname"; + port = 901; + } + } +} +``` + +* or in JSON: + +```json +{ + "param": "value", + "param1": "value1", + "flag": true, + "subsection": { + "host": [ + { + "host": "hostname", + "port": 900 + }, + { + "host": "hostname", + "port": 901 + } + ] + } +} +``` + +## Improvements to the json notation. + +There are various things that make ucl configuration more convenient for editing than strict json: + +### General syntax sugar + +* Braces are not necessary to enclose a top object: it is automatically treated as an object: + +```json +"key": "value" +``` +is equal to: +```json +{"key": "value"} +``` + +* There is no requirement of quotes for strings and keys, moreover, `:` may be replaced `=` or even be skipped for objects: + +```nginx +key = value; +section { + key = value; +} +``` +is equal to: +```json +{ + "key": "value", + "section": { + "key": "value" + } +} +``` + +* No commas mess: you can safely place a comma or semicolon for the last element in an array or an object: + +```json +{ + "key1": "value", + "key2": "value", +} +``` +### Automatic arrays creation + +* Non-unique keys in an object are allowed and are automatically converted to the arrays internally: + +```json +{ + "key": "value1", + "key": "value2" +} +``` +is converted to: +```json +{ + "key": ["value1", "value2"] +} +``` + +### Named keys hierarchy + +UCL accepts named keys and organize them into objects hierarchy internally. Here is an example of this process: +```nginx +section "blah" { + key = value; +} +section foo { + key = value; +} +``` + +is converted to the following object: + +```nginx +section { + blah { + key = value; + } + foo { + key = value; + } +} +``` + +Plain definitions may be more complex and contain more than a single level of nested objects: + +```nginx +section "blah" "foo" { + key = value; +} +``` + +is presented as: + +```nginx +section { + blah { + foo { + key = value; + } + } +} +``` + +### Convenient numbers and booleans + +* Numbers can have suffixes to specify standard multipliers: + + `[kKmMgG]` - standard 10 base multipliers (so `1k` is translated to 1000) + + `[kKmMgG]b` - 2 power multipliers (so `1kb` is translated to 1024) + + `[s|min|d|w|y]` - time multipliers, all time values are translated to float number of seconds, for example `10min` is translated to 600.0 and `10ms` is translated to 0.01 +* Hexadecimal integers can be used by `0x` prefix, for example `key = 0xff`. However, floating point values can use decimal base only. +* Booleans can be specified as `true` or `yes` or `on` and `false` or `no` or `off`. +* It is still possible to treat numbers and booleans as strings by enclosing them in double quotes. + +## General improvements + +### Commments + +UCL supports different style of comments: + +* single line: `#` +* multiline: `/* ... */` + +Multiline comments may be nested: +```c +# Sample single line comment +/* + some comment + /* nested comment */ + end of comment +*/ +``` + +### Macros support + +UCL supports external macros both multiline and single line ones: +```nginx +.macro "sometext"; +.macro { + Some long text + .... +}; +``` + +Moreover, each macro can accept an optional list of arguments in braces. These +arguments themselves are the UCL object that is parsed and passed to a macro as +options: + +```nginx +.macro(param=value) "something"; +.macro(param={key=value}) "something"; +.macro(.include "params.conf") "something"; +.macro(#this is multiline macro +param = [value1, value2]) "something"; +.macro(key="()") "something"; +``` + +UCL also provide a convenient `include` macro to load content from another files +to the current UCL object. This macro accepts either path to file: + +```nginx +.include "/full/path.conf" +.include "./relative/path.conf" +.include "${CURDIR}/path.conf" +``` + +or URL (if ucl is built with url support provided by either `libcurl` or `libfetch`): + + .include "http://example.com/file.conf" + +`.include` macro supports a set of options: + +* `try` (default: **false**) - if this option is `true` than UCL treats errors on loading of +this file as non-fatal. For example, such a file can be absent but it won't stop the parsing +of the top-level document. +* `sign` (default: **false**) - if this option is `true` UCL loads and checks the signature for +a file from path named `.sig`. Trusted public keys should be provided for UCL API after +parser is created but before any configurations are parsed. +* `glob` (default: **false**) - if this option is `true` UCL treats the filename as GLOB pattern and load +all files that matches the specified pattern (normally the format of patterns is defined in `glob` manual page +for your operating system). This option is meaningless for URL includes. +* `url` (default: **true**) - allow URL includes. +* `path` (default: empty) - A UCL_ARRAY of directories to search for the include file. +Search ends after the first patch, unless `glob` is true, then all matches are included. +* `prefix` (default false) - Put included contents inside an object, instead +of loading them into the root. If no `key` is provided, one is automatically generated based on each files basename() +* `key` (default: ) - Key to load contents of include into. If +the key already exists, it must be the correct type +* `target` (default: object) - Specify if the `prefix` `key` should be an +object or an array. +* `priority` (default: 0) - specify priority for the include (see below). +* `duplicate` (default: 'append') - specify policy of duplicates resolving: + - `append` - default strategy, if we have new object of higher priority then it replaces old one, if we have new object with less priority it is ignored completely, and if we have two duplicate objects with the same priority then we have a multi-value key (implicit array) + - `merge` - if we have object or array, then new keys are merged inside, if we have a plain object then an implicit array is formed (regardeless of priorities) + - `error` - create error on duplicate keys and stop parsing + - `rewrite` - always rewrite an old value with new one (ignoring priorities) + +Priorities are used by UCL parser to manage the policy of objects rewriting during including other files +as following: + +* If we have two objects with the same priority then we form an implicit array +* If a new object has bigger priority then we overwrite an old one +* If a new object has lower priority then we ignore it + +By default, the priority of top-level object is set to zero (lowest priority). Currently, +you can define up to 16 priorities (from 0 to 15). Includes with bigger priorities will +rewrite keys from the objects with lower priorities as specified by the policy. + +### Variables support + +UCL supports variables in input. Variables are registered by a user of the UCL parser and can be presented in the following forms: + +* `${VARIABLE}` +* `$VARIABLE` + +UCL currently does not support nested variables. To escape variables one could use double dollar signs: + +* `$${VARIABLE}` is converted to `${VARIABLE}` +* `$$VARIABLE` is converted to `$VARIABLE` + +However, if no valid variables are found in a string, no expansion will be performed (and `$$` thus remains unchanged). This may be a subject +to change in future libucl releases. + +### Multiline strings + +UCL can handle multiline strings as well as single line ones. It uses shell/perl like notation for such objects: +``` +key = <@]), [], + [enable_urls=no]) +AC_ARG_ENABLE([regex], AS_HELP_STRING([--enable-regex], + [Enable regex checking for schema @<:@default=yes@:>@]), [], + [enable_regex=yes]) +AC_ARG_ENABLE([signatures], AS_HELP_STRING([--enable-signatures], + [Enable signatures check (requires openssl) @<:@default=no@:>@]), [], + [enable_signatures=no]) +AC_ARG_ENABLE([lua], AS_HELP_STRING([--enable-lua], + [Enable lua API build (requires lua libraries and headers) @<:@default=no@:>@]), [], + [enable_lua=no]) +AC_ARG_ENABLE([utils], + AS_HELP_STRING([--enable-utils], [Build and install utils @<:@default=no@:>@]), + [case "${enableval}" in + yes) utils=true ;; + no) utils=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-utils]) ;; + esac],[utils=false]) +AM_CONDITIONAL([UTILS], [test x$utils = xtrue]) + +AS_IF([test "x$enable_signatures" = "xyes"], [ + AC_SEARCH_LIBS([EVP_MD_CTX_create], [crypto], [ + AC_DEFINE(HAVE_OPENSSL, 1, [Define to 1 if you have the 'crypto' library (-lcrypto).]) + LIBCRYPTO_LIB="-lcrypto" + LIBS_EXTRA="${LIBS_EXTRA} -lcrypto" + ], [AC_MSG_ERROR([unable to find the EVP_MD_CTX_create() function])]) +]) +AC_SUBST(LIBCRYPTO_LIB) +AC_PATH_PROG(PANDOC, pandoc, [/non/existent]) + +AC_SEARCH_LIBS([clock_gettime], [rt], [], [ + AC_CHECK_HEADER([mach/mach_time.h], [ + AC_DEFINE(HAVE_MACH_MACH_TIME_H, 1, [Define to 1 on Darwin]) + ], [AC_MSG_ERROR([unable to find clock_gettime or mach_absolute_time])]) +]) +AC_SEARCH_LIBS([remainder], [m], [], [AC_MSG_ERROR([unable to find remainder() function])]) + +AS_IF([test "x$enable_regex" = "xyes"], [ + AC_CHECK_HEADER([regex.h], [ + AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the header file.]) + AC_SEARCH_LIBS([regexec], [regex], [ + AS_IF([test "x$ac_cv_search_regexec" = "x-lregex"], [ + LIBREGEX_LIB="-lregex" + LIBS_EXTRA="${LIBS_EXTRA} -lregex" + ] + )], + [AC_MSG_ERROR([unable to find the regexec() function])])], + [AC_MSG_ERROR([unable to find the regex.h header]) + ], + [#include ]) +]) +AC_SUBST(LIBREGEX_LIB) + +AS_IF([test "x$enable_lua" = "xyes"], [ + AX_PROG_LUA([5.1], [], [ + AX_LUA_HEADERS([ + AX_LUA_LIBS([ + AC_DEFINE(HAVE_LUA, 1, [Define to 1 for lua support.]) + with_lua="yes" + ], [AC_MSG_ERROR([unable to find the lua libraries]) + ]) + ], [AC_MSG_ERROR([unable to find the lua header files]) + ]) + ], [AC_MSG_ERROR([unable to find the lua interpreter])]) +], [with_lua="no"]) + +AM_CONDITIONAL([LUA_SUB], [test "$with_lua" = "yes"]) + +AS_IF([test "x$enable_urls" = "xyes"], [ + AC_CHECK_HEADER([fetch.h], [ + AC_DEFINE(HAVE_FETCH_H, 1, [Define to 1 if you have the header file.]) + AC_CHECK_LIB(fetch, fetchXGet, [ + AC_DEFINE(HAVE_LIBFETCH, 1, [Define to 1 if you have the 'fetch' library (-lfetch).]) + LIBFETCH_LIBS="-lfetch" + have_libfetch="yes" + LIBS_EXTRA="${LIBS_EXTRA} -lfetch" + ]) + ], [],[ + #include + #ifdef HAVE_SYS_PARAM_H + #include + #endif + ]) + AC_SUBST(LIBFETCH_LIBS) + + AS_IF([ test "x$have_libfetch" != "xyes"], [ + dnl Fallback to libcurl + PKG_CHECK_MODULES([CURL], [libcurl], [ + AC_DEFINE(CURL_FOUND, 1, [Use libcurl]) + LIBS_EXTRA="${LIBS_EXTRA} -lcurl"], + [AC_MSG_ERROR([unable to find neither libfetch nor libcurl])]) + ]) + AC_SUBST(CURL_FOUND) + AC_SUBST(CURL_LIBS) + AC_SUBST(CURL_CFLAGS) +]) + +AC_SUBST(LIBS_EXTRA) + +AC_MSG_CHECKING(for GCC atomic builtins) +AC_LINK_IFELSE([ + AC_LANG_SOURCE([[ + int main() { + volatile unsigned long val = 1; + __sync_synchronize(); + __sync_val_compare_and_swap(&val, 1, 0); + __sync_add_and_fetch(&val, 1); + __sync_sub_and_fetch(&val, 1); + return 0; + } + ]]) +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [1], [Has gcc/MSVC atomic intrinsics]) +], +[ + AC_MSG_RESULT([no]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [0], [Has gcc/MSVC atomic intrinsics]) + AC_MSG_WARN([Libucl references could be thread-unsafe because atomic builtins are missing]) +]) + +AX_CODE_COVERAGE + +AC_CONFIG_FILES(Makefile \ + src/Makefile \ + lua/Makefile + tests/Makefile \ + utils/Makefile \ + doc/Makefile \ + lua/libucl.rockspec \ + libucl.pc) +AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) +AC_OUTPUT Copied: vendor/libucl/libucl-0.8.0/include/ucl++.h (from r298162, vendor/libucl/dist/include/ucl++.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/libucl-0.8.0/include/ucl++.h Sun Apr 17 21:26:55 2016 (r298163, copy of r298162, vendor/libucl/dist/include/ucl++.h) @@ -0,0 +1,444 @@ +/* + * Copyright (c) 2015, Vsevolod Stakhov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once +#include +#include +#include + +#include "ucl.h" + +// C++11 API inspired by json11: https://github.com/dropbox/json11/ + +namespace ucl { + +struct ucl_map_construct_t { }; +constexpr ucl_map_construct_t ucl_map_construct = ucl_map_construct_t(); +struct ucl_array_construct_t { }; +constexpr ucl_array_construct_t ucl_array_construct = ucl_array_construct_t(); + +class Ucl final { +private: + + struct ucl_deleter { + void operator() (ucl_object_t *obj) { + ucl_object_unref (obj); + } + }; + + static int + append_char (unsigned char c, size_t nchars, void *ud) + { + std::string *out = reinterpret_cast(ud); + + out->append (nchars, (char)c); + + return nchars; + } + static int + append_len (unsigned const char *str, size_t len, void *ud) + { + std::string *out = reinterpret_cast(ud); + + out->append ((const char *)str, len); + + return len; + } + static int + append_int (int64_t elt, void *ud) + { + std::string *out = reinterpret_cast(ud); + auto nstr = std::to_string (elt); + + out->append (nstr); + + return nstr.size (); + } + static int + append_double (double elt, void *ud) + { + std::string *out = reinterpret_cast(ud); + auto nstr = std::to_string (elt); + + out->append (nstr); + + return nstr.size (); + } + + static struct ucl_emitter_functions default_emit_funcs() + { + struct ucl_emitter_functions func = { + Ucl::append_char, + Ucl::append_len, + Ucl::append_int, + Ucl::append_double, + nullptr, + nullptr + }; + + return func; + }; + + std::unique_ptr obj; + +public: + class const_iterator { + private: + struct ucl_iter_deleter { + void operator() (ucl_object_iter_t it) { + ucl_object_iterate_free (it); + } + }; + std::shared_ptr it; + std::unique_ptr cur; + public: + typedef std::forward_iterator_tag iterator_category; + + const_iterator(const Ucl &obj) { + it = std::shared_ptr(ucl_object_iterate_new (obj.obj.get()), + ucl_iter_deleter()); + cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true))); + if (!*cur) { + it.reset (); + cur.reset (); + } + } + + const_iterator() {} + const_iterator(const const_iterator &other) = delete; + const_iterator(const_iterator &&other) = default; + ~const_iterator() {} + + const_iterator& operator=(const const_iterator &other) = delete; + const_iterator& operator=(const_iterator &&other) = default; + + bool operator==(const const_iterator &other) const + { + if (cur && other.cur) { + return cur->obj.get() == other.cur->obj.get(); + } + + return !cur && !other.cur; + } + + bool operator!=(const const_iterator &other) const + { + return !(*this == other); + } + + const_iterator& operator++() + { + if (it) { + cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true))); + } + + if (!*cur) { + it.reset (); + cur.reset (); + } + + return *this; + } + + const Ucl& operator*() const + { + return *cur; + } + const Ucl* operator->() const + { + return cur.get(); + } + }; + + // We grab ownership if get non-const ucl_object_t + Ucl(ucl_object_t *other) { + obj.reset (other); + } + + // Shared ownership + Ucl(const ucl_object_t *other) { + obj.reset (ucl_object_ref (other)); + } + + Ucl(const Ucl &other) { + obj.reset (ucl_object_ref (other.obj.get())); + } + + Ucl(Ucl &&other) { + obj.swap (other.obj); + } + + Ucl() noexcept { + obj.reset (ucl_object_typed_new (UCL_NULL)); + } + Ucl(std::nullptr_t) noexcept { + obj.reset (ucl_object_typed_new (UCL_NULL)); + } + Ucl(double value) { + obj.reset (ucl_object_typed_new (UCL_FLOAT)); + obj->value.dv = value; + } + Ucl(int64_t value) { + obj.reset (ucl_object_typed_new (UCL_INT)); + obj->value.iv = value; + } + Ucl(bool value) { + obj.reset (ucl_object_typed_new (UCL_BOOLEAN)); + obj->value.iv = static_cast(value); + } + Ucl(const std::string &value) { + obj.reset (ucl_object_fromstring_common (value.data (), value.size (), + UCL_STRING_RAW)); + } + Ucl(const char * value) { + obj.reset (ucl_object_fromstring_common (value, 0, UCL_STRING_RAW)); + } + + // Implicit constructor: anything with a to_json() function. + template + Ucl(const T & t) : Ucl(t.to_ucl()) {} + + // Implicit constructor: map-like objects (std::map, std::unordered_map, etc) + template ::value + && std::is_constructible::value, + int>::type = 0> + Ucl(const M & m) { + obj.reset (ucl_object_typed_new (UCL_OBJECT)); + auto cobj = obj.get (); + + for (const auto &e : m) { + ucl_object_insert_key (cobj, ucl_object_ref (e.second.obj.get()), + e.first.data (), e.first.size (), true); + } + } + + // Implicit constructor: vector-like objects (std::list, std::vector, std::set, etc) + template ::value, + int>::type = 0> + Ucl(const V & v) { + obj.reset (ucl_object_typed_new (UCL_ARRAY)); + auto cobj = obj.get (); + + for (const auto &e : v) { + ucl_array_append (cobj, ucl_object_ref (e.obj.get())); + } + } + + ucl_type_t type () const { + if (obj) { + return ucl_object_type (obj.get ()); + } + return UCL_NULL; + } + + const std::string key () const { + std::string res; + + if (obj->key) { + res.assign (obj->key, obj->keylen); + } + + return res; + } + + double number_value (const double default_val = 0.0) const *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 17 21:29:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0CDEB12BD3; Sun, 17 Apr 2016 21:29:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B24D41CE6; Sun, 17 Apr 2016 21:29:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLTils076124; Sun, 17 Apr 2016 21:29:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLTi9D076123; Sun, 17 Apr 2016 21:29:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201604172129.u3HLTi9D076123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 17 Apr 2016 21:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298164 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:29:46 -0000 Author: imp Date: Sun Apr 17 21:29:44 2016 New Revision: 298164 URL: https://svnweb.freebsd.org/changeset/base/298164 Log: Do the intmax_t dance for debug so CAM_NETFLIX_IOSCHED builds on i386. Sponsored by: Netflix, Inc Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Sun Apr 17 21:26:55 2016 (r298163) +++ head/sys/cam/cam_iosched.c Sun Apr 17 21:29:44 2016 (r298164) @@ -606,10 +606,10 @@ cam_iosched_cl_maybe_steer(struct contro isc->write_stats.current = isc->write_stats.min; if (isc->write_stats.current > isc->write_stats.max) isc->write_stats.current = isc->write_stats.max; - if (old != isc->write_stats.current) - printf("Steering write from %d kBps to %d kBps due to latency of %ldus\n", + if (old != isc->write_stats.current && iosched_debug) + printf("Steering write from %d kBps to %d kBps due to latency of %jdms\n", old, isc->write_stats.current, - ((uint64_t)1000000 * (uint32_t)lat) >> 32); + (uintmax_t)((uint64_t)1000000 * (uint32_t)lat) >> 32); break; case cl_max: break; From owner-svn-src-all@freebsd.org Sun Apr 17 21:29:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A9DB12BF1; Sun, 17 Apr 2016 21:29:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4AC01CF8; Sun, 17 Apr 2016 21:29:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLTlQZ076167; Sun, 17 Apr 2016 21:29:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLTltx076166; Sun, 17 Apr 2016 21:29:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201604172129.u3HLTltx076166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 17 Apr 2016 21:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298165 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:29:48 -0000 Author: imp Date: Sun Apr 17 21:29:47 2016 New Revision: 298165 URL: https://svnweb.freebsd.org/changeset/base/298165 Log: Add CAM_NETFLIX_IOSCHED to the build. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Apr 17 21:29:44 2016 (r298164) +++ head/sys/conf/NOTES Sun Apr 17 21:29:47 2016 (r298165) @@ -1347,6 +1347,7 @@ options CAM_MAX_HIGHPOWER=4 options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS options SCSI_DELAY=5000 # Be pessimistic about Joe SCSI device +options CAM_NETFLIX_IOSCHED # Options for the CAM CDROM driver: # CHANGER_MIN_BUSY_SECONDS: Guaranteed minimum time quantum for a changer LUN From owner-svn-src-all@freebsd.org Sun Apr 17 21:30:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65D01B12C95; Sun, 17 Apr 2016 21:30:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1CD31FD9; Sun, 17 Apr 2016 21:30:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLUfcQ076271; Sun, 17 Apr 2016 21:30:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLUe8u076262; Sun, 17 Apr 2016 21:30:40 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604172130.u3HLUe8u076262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 17 Apr 2016 21:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298166 - in head/contrib/libucl: . include lua python python/src src tests tests/basic tests/schema utils X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:30:42 -0000 Author: bapt Date: Sun Apr 17 21:30:40 2016 New Revision: 298166 URL: https://svnweb.freebsd.org/changeset/base/298166 Log: Import libucl 0.8.0 Added: head/contrib/libucl/tests/basic/escapes.in - copied unchanged from r298163, vendor/libucl/dist/tests/basic/escapes.in head/contrib/libucl/tests/basic/escapes.res - copied unchanged from r298163, vendor/libucl/dist/tests/basic/escapes.res head/contrib/libucl/tests/basic/load.in - copied unchanged from r298163, vendor/libucl/dist/tests/basic/load.in head/contrib/libucl/tests/basic/load.inc - copied unchanged from r298163, vendor/libucl/dist/tests/basic/load.inc head/contrib/libucl/tests/basic/load.res - copied unchanged from r298163, vendor/libucl/dist/tests/basic/load.res Modified: head/contrib/libucl/ChangeLog.md head/contrib/libucl/Makefile.am head/contrib/libucl/README.md head/contrib/libucl/configure.ac head/contrib/libucl/include/ucl++.h head/contrib/libucl/include/ucl.h head/contrib/libucl/lua/lua_ucl.c head/contrib/libucl/python/src/uclmodule.c head/contrib/libucl/python/test_uclmodule.py head/contrib/libucl/src/ucl_emitter.c head/contrib/libucl/src/ucl_emitter_streamline.c head/contrib/libucl/src/ucl_hash.c head/contrib/libucl/src/ucl_hash.h head/contrib/libucl/src/ucl_internal.h head/contrib/libucl/src/ucl_msgpack.c head/contrib/libucl/src/ucl_parser.c head/contrib/libucl/src/ucl_schema.c head/contrib/libucl/src/ucl_sexp.c head/contrib/libucl/src/ucl_util.c head/contrib/libucl/tests/basic.test head/contrib/libucl/tests/basic/18.in head/contrib/libucl/tests/basic/18.res head/contrib/libucl/tests/basic/2.res head/contrib/libucl/tests/basic/9.in head/contrib/libucl/tests/basic/9.res head/contrib/libucl/tests/generate.res head/contrib/libucl/tests/schema.test head/contrib/libucl/tests/schema/definitions.json head/contrib/libucl/tests/schema/ref.json head/contrib/libucl/tests/schema/refRemote.json head/contrib/libucl/tests/test_basic.c head/contrib/libucl/tests/test_generate.c head/contrib/libucl/tests/test_msgpack.c head/contrib/libucl/tests/test_schema.c head/contrib/libucl/utils/objdump.c Directory Properties: head/contrib/libucl/ (props changed) Modified: head/contrib/libucl/ChangeLog.md ============================================================================== --- head/contrib/libucl/ChangeLog.md Sun Apr 17 21:29:47 2016 (r298165) +++ head/contrib/libucl/ChangeLog.md Sun Apr 17 21:30:40 2016 (r298166) @@ -37,3 +37,31 @@ - Fixed a bug with macroes that come after an empty object - Fixed a bug in include processing when an incorrect variable has been destroyed (use-after-free) + +### Libucl 0.8.0 + +- Allow to save comments and macros when parsing UCL documents +- C++ API +- Python bindings (by Eitan Adler) +- Add msgpack support for parser and emitter +- Add Canonical S-expressions parser for libucl +- CLI interface for parsing and validation (by Maxim Ignatenko) +- Implement include with priority +- Add 'nested' functionality to .include macro (by Allan Jude) +- Allow searching an array of paths for includes (by Allan Jude) +- Add new .load macro (by Allan Jude) +- Implement .inherit macro (#100) +- Add merge strategies +- Add schema validation to lua API +- Add support for external references to schema validation +- Add coveralls integration to libucl +- Implement tests for 80% of libucl code lines +- Fix tonns of minor and major bugs +- Improve documentation +- Rework function names to the common conventions (old names are preserved for backwards compatibility) +- Add Coverity scan integration +- Add fuzz tests + +**Incompatible changes**: + +- `ucl_object_emit_full` now accepts additional argument `comments` that could be used to emit comments with UCL output \ No newline at end of file Modified: head/contrib/libucl/Makefile.am ============================================================================== --- head/contrib/libucl/Makefile.am Sun Apr 17 21:29:47 2016 (r298165) +++ head/contrib/libucl/Makefile.am Sun Apr 17 21:30:40 2016 (r298166) @@ -8,4 +8,74 @@ if LUA_SUB LUA_SUBDIR = lua endif -SUBDIRS = src tests utils doc $(LUA_SUBDIR) \ No newline at end of file +COVERAGE_INFO_FILE = $(top_builddir)/coverage.info +COVERAGE_REPORT_DIR = $(top_builddir)/coverage + +.PHONY = coverage-requirement-check clean-coverage-report + +coverage-requirement-check: + @if test ! -e $(GCOV); then \ + echo "Cannot find $(GCOV). Please install gcov."; \ + exit 1; \ + fi + +coverage: coverage-requirement-check clean-coverage coverage-build coverage-check coverage-report + @echo "Please execute 'make clean' before 'make' or 'make check' to remove instrumented object files(compiled with -O0 etc.). Note that 'make clean' also remove coverage data." + +coverage-build: coverage-requirement-check + @if test `find $(top_builddir) -name "*.gcno" | wc -l` -eq 0; then \ + echo "Start to remove old non-instrumented object files..."; \ + $(MAKE) $(AM_MAKEFLAGS) clean; \ + echo "Successfully removed old non-instrumented object files."; \ + fi + @echo "Start to build libraries with coverage options..." + $(MAKE) $(AM_MAKEFLAGS) \ + CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ + CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ + LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ + LIBS="$(LIBS) $(COVERAGE_LIBS)" + @echo "Successfully built libraries with coverage options." + +coverage-check: coverage-requirement-check + @echo "Start to run tests with instrumented libraries..." + $(MAKE) $(AM_MAKEFLAGS) check \ + CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ + CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ + LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ + LIBS="$(LIBS) $(COVERAGE_LIBS)" + @echo "Successfully run tests with instrumented libraries." + +coverage-lcov: coverage-check coverage-requirement-check + $(LCOV) --capture \ + --directory "$(top_builddir)/" \ + --output-file $(COVERAGE_INFO_FILE) \ + --gcov-tool $(GCOV) \ + --compat-libtool --checksum + $(LCOV) --extract $(COVERAGE_INFO_FILE) `pwd`/src/ucl_\* \ + --output-file $(COVERAGE_INFO_FILE) + +coverage-report: coverage-lcov + @echo "Start to create coverage reports..." + $(GENHTML) --prefix "$(top_srcdir)" \ + --output-directory $(COVERAGE_REPORT_DIR) \ + --title $(PACKAGE_NAME) \ + --legend --show-details \ + $(GENHTML_OPTIONS) \ + $(COVERAGE_INFO_FILE) + @echo "Successfully created coverage reports into $(COVERAGE_REPORT_DIR) directory." + +clean-coverage-report: + -rm -rf $(COVERAGE_INFO_FILE) + -rm -rf $(COVERAGE_REPORT_DIR) + +clean-coverage: clean-coverage-report + -$(LCOV) --gcov-tool $(GCOV) --zerocounters --directory $(top_builddir) + @if xargs --version 2>/dev/null; then \ + find $(top_builddir) -name "*.gcno" | xargs --no-run-if-empty rm; \ + else \ + find $(top_builddir) -name "*.gcno" | xargs rm; \ + fi + +clean-local: clean-coverage + +SUBDIRS = src tests utils doc $(LUA_SUBDIR) Modified: head/contrib/libucl/README.md ============================================================================== --- head/contrib/libucl/README.md Sun Apr 17 21:29:47 2016 (r298165) +++ head/contrib/libucl/README.md Sun Apr 17 21:30:40 2016 (r298166) @@ -1,6 +1,6 @@ # LIBUCL -[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138)[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* Modified: head/contrib/libucl/configure.ac ============================================================================== --- head/contrib/libucl/configure.ac Sun Apr 17 21:29:47 2016 (r298165) +++ head/contrib/libucl/configure.ac Sun Apr 17 21:30:40 2016 (r298166) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) -m4_define([med_ver], [7]) -m4_define([min_ver], [3]) -m4_define([so_version], [5:0:2]) +m4_define([med_ver], [8]) +m4_define([min_ver], [0]) +m4_define([so_version], [6:0:0]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) @@ -173,6 +173,8 @@ AC_LINK_IFELSE([ AC_MSG_WARN([Libucl references could be thread-unsafe because atomic builtins are missing]) ]) +AX_CODE_COVERAGE + AC_CONFIG_FILES(Makefile \ src/Makefile \ lua/Makefile Modified: head/contrib/libucl/include/ucl++.h ============================================================================== --- head/contrib/libucl/include/ucl++.h Sun Apr 17 21:29:47 2016 (r298165) +++ head/contrib/libucl/include/ucl++.h Sun Apr 17 21:30:40 2016 (r298166) @@ -26,7 +26,6 @@ #include #include #include -#include #include "ucl.h" @@ -120,18 +119,19 @@ public: it = std::shared_ptr(ucl_object_iterate_new (obj.obj.get()), ucl_iter_deleter()); cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true))); + if (!*cur) { + it.reset (); + cur.reset (); + } } const_iterator() {} - const_iterator(const const_iterator &other) { - it = other.it; - } + const_iterator(const const_iterator &other) = delete; + const_iterator(const_iterator &&other) = default; ~const_iterator() {} - const_iterator& operator=(const const_iterator &other) { - it = other.it; - return *this; - } + const_iterator& operator=(const const_iterator &other) = delete; + const_iterator& operator=(const_iterator &&other) = default; bool operator==(const const_iterator &other) const { @@ -264,45 +264,51 @@ public: return res; } - double number_value () const + double number_value (const double default_val = 0.0) const { - if (obj) { - return ucl_object_todouble (obj.get()); + double res; + + if (ucl_object_todouble_safe(obj.get(), &res)) { + return res; } - return 0.0; + return default_val; } - int64_t int_value () const + int64_t int_value (const int64_t default_val = 0) const { - if (obj) { - return ucl_object_toint (obj.get()); + int64_t res; + + if (ucl_object_toint_safe(obj.get(), &res)) { + return res; } - return 0; + return default_val; } - bool bool_value () const + bool bool_value (const bool default_val = false) const { - if (obj) { - return ucl_object_toboolean (obj.get()); + bool res; + + if (ucl_object_toboolean_safe(obj.get(), &res)) { + return res; } - return false; + return default_val; } - const std::string string_value () const + const std::string string_value (const std::string& default_val = "") const { - std::string res; + const char* res = nullptr; - if (obj) { - res.assign (ucl_object_tostring (obj.get())); + if (ucl_object_tostring_safe(obj.get(), &res)) { + return res; } - return res; + return default_val; } - const Ucl operator[] (size_t i) const + const Ucl at (size_t i) const { if (type () == UCL_ARRAY) { return Ucl (ucl_array_find_index (obj.get(), i)); @@ -311,15 +317,25 @@ public: return Ucl (nullptr); } - const Ucl operator[](const std::string &key) const + const Ucl lookup (const std::string &key) const { if (type () == UCL_OBJECT) { - return Ucl (ucl_object_find_keyl (obj.get(), + return Ucl (ucl_object_lookup_len (obj.get(), key.data (), key.size ())); } return Ucl (nullptr); } + + inline const Ucl operator[] (size_t i) const + { + return at(i); + } + + inline const Ucl operator[](const std::string &key) const + { + return lookup(key); + } // Serialize. void dump (std::string &out, ucl_emitter_t type = UCL_EMIT_JSON) const { @@ -328,7 +344,7 @@ public: cbdata = Ucl::default_emit_funcs(); cbdata.ud = reinterpret_cast(&out); - ucl_object_emit_full (obj.get(), type, &cbdata); + ucl_object_emit_full (obj.get(), type, &cbdata, nullptr); } std::string dump (ucl_emitter_t type = UCL_EMIT_JSON) const @@ -375,6 +391,12 @@ public: std::istreambuf_iterator()), err); } + Ucl& operator= (Ucl rhs) + { + obj.swap (rhs.obj); + return *this; + } + bool operator== (const Ucl &rhs) const { return ucl_object_compare (obj.get(), rhs.obj.get ()) == 0; @@ -388,7 +410,7 @@ public: bool operator> (const Ucl &rhs) const { return (rhs < *this); } bool operator>= (const Ucl &rhs) const { return !(*this < rhs); } - operator bool () const + explicit operator bool () const { if (!obj || type() == UCL_NULL) { return false; Modified: head/contrib/libucl/include/ucl.h ============================================================================== --- head/contrib/libucl/include/ucl.h Sun Apr 17 21:29:47 2016 (r298165) +++ head/contrib/libucl/include/ucl.h Sun Apr 17 21:30:40 2016 (r298166) @@ -107,7 +107,8 @@ typedef enum ucl_error { UCL_ENESTED, /**< Input has too many recursion levels */ UCL_EMACRO, /**< Error processing a macro */ UCL_EINTERNAL, /**< Internal unclassified error */ - UCL_ESSL /**< SSL error */ + UCL_ESSL, /**< SSL error */ + UCL_EMERGE /**< A merge error occured */ } ucl_error_t; /** @@ -147,11 +148,13 @@ typedef enum ucl_emitter { * UCL still has to perform copying implicitly. */ typedef enum ucl_parser_flags { - UCL_PARSER_DEFAULT = 0x0, /**< No special flags */ - UCL_PARSER_KEY_LOWERCASE = 0x1, /**< Convert all keys to lower case */ - UCL_PARSER_ZEROCOPY = 0x2, /**< Parse input in zero-copy mode if possible */ - UCL_PARSER_NO_TIME = 0x4, /**< Do not parse time and treat time values as strings */ - UCL_PARSER_NO_IMPLICIT_ARRAYS = 0x8 /** Create explicit arrays instead of implicit ones */ + UCL_PARSER_DEFAULT = 0, /**< No special flags */ + UCL_PARSER_KEY_LOWERCASE = (1 << 0), /**< Convert all keys to lower case */ + UCL_PARSER_ZEROCOPY = (1 << 1), /**< Parse input in zero-copy mode if possible */ + UCL_PARSER_NO_TIME = (1 << 2), /**< Do not parse time and treat time values as strings */ + UCL_PARSER_NO_IMPLICIT_ARRAYS = (1 << 3), /** Create explicit arrays instead of implicit ones */ + UCL_PARSER_SAVE_COMMENTS = (1 << 4), /** Save comments in the parser context */ + UCL_PARSER_DISABLE_MACRO = (1 << 5) /** Treat macros as comments */ } ucl_parser_flags_t; /** @@ -159,17 +162,17 @@ typedef enum ucl_parser_flags { */ typedef enum ucl_string_flags { UCL_STRING_RAW = 0x0, /**< Treat string as is */ - UCL_STRING_ESCAPE = 0x1, /**< Perform JSON escape */ - UCL_STRING_TRIM = 0x2, /**< Trim leading and trailing whitespaces */ - UCL_STRING_PARSE_BOOLEAN = 0x4, /**< Parse passed string and detect boolean */ - UCL_STRING_PARSE_INT = 0x8, /**< Parse passed string and detect integer number */ - UCL_STRING_PARSE_DOUBLE = 0x10, /**< Parse passed string and detect integer or float number */ - UCL_STRING_PARSE_TIME = 0x20, /**< Parse time strings */ + UCL_STRING_ESCAPE = (1 << 0), /**< Perform JSON escape */ + UCL_STRING_TRIM = (1 << 1), /**< Trim leading and trailing whitespaces */ + UCL_STRING_PARSE_BOOLEAN = (1 << 2), /**< Parse passed string and detect boolean */ + UCL_STRING_PARSE_INT = (1 << 3), /**< Parse passed string and detect integer number */ + UCL_STRING_PARSE_DOUBLE = (1 << 4), /**< Parse passed string and detect integer or float number */ + UCL_STRING_PARSE_TIME = (1 << 5), /**< Parse time strings */ UCL_STRING_PARSE_NUMBER = UCL_STRING_PARSE_INT|UCL_STRING_PARSE_DOUBLE|UCL_STRING_PARSE_TIME, /**< Parse passed string and detect number */ UCL_STRING_PARSE = UCL_STRING_PARSE_BOOLEAN|UCL_STRING_PARSE_NUMBER, /**< Parse passed string (and detect booleans and numbers) */ - UCL_STRING_PARSE_BYTES = 0x40 /**< Treat numbers as bytes */ + UCL_STRING_PARSE_BYTES = (1 << 6) /**< Treat numbers as bytes */ } ucl_string_flags_t; /** @@ -286,10 +289,12 @@ UCL_EXTERN ucl_object_t* ucl_object_new_ /** * Create new object with userdata dtor * @param dtor destructor function + * @param emitter emitter for userdata + * @param ptr opaque pointer * @return new object */ UCL_EXTERN ucl_object_t* ucl_object_new_userdata (ucl_userdata_dtor dtor, - ucl_userdata_emitter emitter) UCL_WARN_UNUSED_RESULT; + ucl_userdata_emitter emitter, void *ptr) UCL_WARN_UNUSED_RESULT; /** * Perform deep copy of an object copying everything @@ -306,6 +311,21 @@ UCL_EXTERN ucl_object_t * ucl_object_cop UCL_EXTERN ucl_type_t ucl_object_type (const ucl_object_t *obj); /** + * Converts ucl object type to its string representation + * @param type type of object + * @return constant string describing type + */ +UCL_EXTERN const char * ucl_object_type_to_string (ucl_type_t type); + +/** + * Converts string that represents ucl type to real ucl type enum + * @param input C string with name of type + * @param res resulting target + * @return true if `input` is a name of type stored in `res` + */ +UCL_EXTERN bool ucl_object_string_to_type (const char *input, ucl_type_t *res); + +/** * Convert any string to an ucl object making the specified transformations * @param str fixed size or NULL terminated string * @param len length (if len is zero, than str is treated as NULL terminated) @@ -642,8 +662,9 @@ UCL_EXTERN const char* ucl_object_tolstr * @param key key to search * @return object matching the specified key or NULL if key was not found */ -UCL_EXTERN const ucl_object_t* ucl_object_find_key (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t* ucl_object_lookup (const ucl_object_t *obj, const char *key); +#define ucl_object_find_key ucl_object_lookup /** * Return object identified by a key in the specified object, if the first key is @@ -655,8 +676,9 @@ UCL_EXTERN const ucl_object_t* ucl_objec * @param ... list of alternative keys to search (NULL terminated) * @return object matching the specified key or NULL if key was not found */ -UCL_EXTERN const ucl_object_t* ucl_object_find_any_key (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t* ucl_object_lookup_any (const ucl_object_t *obj, const char *key, ...); +#define ucl_object_find_any_key ucl_object_lookup_any /** * Return object identified by a fixed size key in the specified object @@ -665,8 +687,9 @@ UCL_EXTERN const ucl_object_t* ucl_objec * @param klen length of a key * @return object matching the specified key or NULL if key was not found */ -UCL_EXTERN const ucl_object_t* ucl_object_find_keyl (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t* ucl_object_lookup_len (const ucl_object_t *obj, const char *key, size_t klen); +#define ucl_object_find_keyl ucl_object_lookup_len /** * Return object identified by dot notation string @@ -674,8 +697,9 @@ UCL_EXTERN const ucl_object_t* ucl_objec * @param path dot.notation.path to the path to lookup. May use numeric .index on arrays * @return object matched the specified path or NULL if path is not found */ -UCL_EXTERN const ucl_object_t *ucl_lookup_path (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t *ucl_object_lookup_path (const ucl_object_t *obj, const char *path); +#define ucl_lookup_path ucl_object_lookup_path /** * Return object identified by object notation string using arbitrary delimiter @@ -684,8 +708,9 @@ UCL_EXTERN const ucl_object_t *ucl_looku * @param sep the sepatorator to use in place of . (incase keys have . in them) * @return object matched the specified path or NULL if path is not found */ -UCL_EXTERN const ucl_object_t *ucl_lookup_path_char (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t *ucl_object_lookup_path_char (const ucl_object_t *obj, const char *path, char sep); +#define ucl_lookup_path_char ucl_object_lookup_path_char /** * Returns a key of an object as a NULL terminated string @@ -735,6 +760,19 @@ UCL_EXTERN int ucl_object_compare (const const ucl_object_t *o2); /** + * Compare objects `o1` and `o2` useful for sorting + * @param o1 the first object + * @param o2 the second object + * @return values >0, 0 and <0 if `o1` is more than, equal and less than `o2`. + * The order of comparison: + * 1) Type of objects + * 2) Size of objects + * 3) Content of objects + */ +UCL_EXTERN int ucl_object_compare_qsort (const ucl_object_t **o1, + const ucl_object_t **o2); + +/** * Sort UCL array using `cmp` compare function * @param ar * @param cmp @@ -770,8 +808,9 @@ typedef void* ucl_object_iter_t; * while ((cur = ucl_iterate_object (obj, &it)) != NULL) ... * @return the next object or NULL */ -UCL_EXTERN const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, +UCL_EXTERN const ucl_object_t* ucl_object_iterate (const ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); +#define ucl_iterate_object ucl_object_iterate /** * Create new safe iterator for the specified object @@ -1040,34 +1079,34 @@ UCL_EXTERN ucl_object_t* ucl_parser_get_ * @param parser parser object * @return error description */ -UCL_EXTERN const char *ucl_parser_get_error(struct ucl_parser *parser); +UCL_EXTERN const char *ucl_parser_get_error (struct ucl_parser *parser); /** * Get the code of the last error * @param parser parser object * @return error code */ -UCL_EXTERN int ucl_parser_get_error_code(struct ucl_parser *parser); +UCL_EXTERN int ucl_parser_get_error_code (struct ucl_parser *parser); /** * Get the current column number within parser * @param parser parser object * @return current column number */ -UCL_EXTERN unsigned ucl_parser_get_column(struct ucl_parser *parser); +UCL_EXTERN unsigned ucl_parser_get_column (struct ucl_parser *parser); /** * Get the current line number within parser * @param parser parser object * @return current line number */ -UCL_EXTERN unsigned ucl_parser_get_linenum(struct ucl_parser *parser); +UCL_EXTERN unsigned ucl_parser_get_linenum (struct ucl_parser *parser); /** * Clear the error in the parser * @param parser parser object */ -UCL_EXTERN void ucl_parser_clear_error(struct ucl_parser *parser); +UCL_EXTERN void ucl_parser_clear_error (struct ucl_parser *parser); /** * Free ucl parser object @@ -1076,6 +1115,42 @@ UCL_EXTERN void ucl_parser_clear_error(s UCL_EXTERN void ucl_parser_free (struct ucl_parser *parser); /** + * Get constant opaque pointer to comments structure for this parser. Increase + * refcount to prevent this object to be destroyed on parser's destruction + * @param parser parser structure + * @return ucl comments pointer or NULL + */ +UCL_EXTERN const ucl_object_t * ucl_parser_get_comments (struct ucl_parser *parser); + +/** + * Utility function to find a comment object for the specified object in the input + * @param comments comments object + * @param srch search object + * @return string comment enclosed in ucl_object_t + */ +UCL_EXTERN const ucl_object_t * ucl_comments_find (const ucl_object_t *comments, + const ucl_object_t *srch); + +/** + * Move comment from `from` object to `to` object + * @param comments comments object + * @param what source object + * @param whith destination object + * @return `true` if `from` has comment and it has been moved to `to` + */ +UCL_EXTERN bool ucl_comments_move (ucl_object_t *comments, + const ucl_object_t *from, const ucl_object_t *to); + +/** + * Adds a new comment for an object + * @param comments comments object + * @param obj object to add comment to + * @param comment string representation of a comment + */ +UCL_EXTERN void ucl_comments_add (ucl_object_t *comments, + const ucl_object_t *obj, const char *comment); + +/** * Add new public key to parser for signatures check * @param parser parser object * @param key PEM representation of a key @@ -1083,7 +1158,8 @@ UCL_EXTERN void ucl_parser_free (struct * @param err if *err is NULL it is set to parser error * @return true if a key has been successfully added */ -UCL_EXTERN bool ucl_pubkey_add (struct ucl_parser *parser, const unsigned char *key, size_t len); +UCL_EXTERN bool ucl_parser_pubkey_add (struct ucl_parser *parser, + const unsigned char *key, size_t len); /** * Set FILENAME and CURDIR variables in parser @@ -1156,8 +1232,8 @@ struct ucl_emitter_context { unsigned int indent; /** Top level object */ const ucl_object_t *top; - /** The rest of context */ - unsigned char data[1]; + /** Optional comments */ + const ucl_object_t *comments; }; /** @@ -1187,11 +1263,13 @@ UCL_EXTERN unsigned char *ucl_object_emi * @param emit_type if type is #UCL_EMIT_JSON then emit json, if type is * #UCL_EMIT_CONFIG then emit config like object * @param emitter a set of emitter functions + * @param comments optional comments for the parser * @return dump of an object (must be freed after using) or NULL in case of error */ UCL_EXTERN bool ucl_object_emit_full (const ucl_object_t *obj, enum ucl_emitter emit_type, - struct ucl_emitter_functions *emitter); + struct ucl_emitter_functions *emitter, + const ucl_object_t *comments); /** * Start streamlined UCL object emitter @@ -1280,6 +1358,9 @@ enum ucl_schema_error_code { UCL_SCHEMA_MISSING_PROPERTY,/**< one or more missing properties */ UCL_SCHEMA_CONSTRAINT, /**< constraint found */ UCL_SCHEMA_MISSING_DEPENDENCY, /**< missing dependency */ + UCL_SCHEMA_EXTERNAL_REF_MISSING, /**< cannot fetch external ref */ + UCL_SCHEMA_EXTERNAL_REF_INVALID, /**< invalid external ref */ + UCL_SCHEMA_INTERNAL_ERROR, /**< something bad happened */ UCL_SCHEMA_UNKNOWN /**< generic error */ }; @@ -1303,6 +1384,37 @@ struct ucl_schema_error { UCL_EXTERN bool ucl_object_validate (const ucl_object_t *schema, const ucl_object_t *obj, struct ucl_schema_error *err); +/** + * Validate object `obj` using schema object `schema` and root schema at `root`. + * @param schema schema object + * @param obj object to validate + * @param root root schema object + * @param err error pointer, if this parameter is not NULL and error has been + * occured, then `err` is filled with the exact error definition. + * @return true if `obj` is valid using `schema` + */ +UCL_EXTERN bool ucl_object_validate_root (const ucl_object_t *schema, + const ucl_object_t *obj, + const ucl_object_t *root, + struct ucl_schema_error *err); + +/** + * Validate object `obj` using schema object `schema` and root schema at `root` + * using some external references provided. + * @param schema schema object + * @param obj object to validate + * @param root root schema object + * @param ext_refs external references (might be modified during validation) + * @param err error pointer, if this parameter is not NULL and error has been + * occured, then `err` is filled with the exact error definition. + * @return true if `obj` is valid using `schema` + */ +UCL_EXTERN bool ucl_object_validate_root_ext (const ucl_object_t *schema, + const ucl_object_t *obj, + const ucl_object_t *root, + ucl_object_t *ext_refs, + struct ucl_schema_error *err); + /** @} */ #ifdef __cplusplus Modified: head/contrib/libucl/lua/lua_ucl.c ============================================================================== --- head/contrib/libucl/lua/lua_ucl.c Sun Apr 17 21:29:47 2016 (r298165) +++ head/contrib/libucl/lua/lua_ucl.c Sun Apr 17 21:30:40 2016 (r298166) @@ -29,6 +29,7 @@ #include "ucl_internal.h" #include "lua_ucl.h" #include +#include /*** * @module ucl @@ -149,14 +150,14 @@ ucl_object_lua_push_object (lua_State *L } /* Optimize allocation by preallocation of table */ - while (ucl_iterate_object (obj, &it, true) != NULL) { + while (ucl_object_iterate (obj, &it, true) != NULL) { nelt ++; } lua_createtable (L, 0, nelt); it = NULL; - while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) { + while ((cur = ucl_object_iterate (obj, &it, true)) != NULL) { ucl_object_lua_push_element (L, ucl_object_key (cur), cur); } @@ -421,9 +422,7 @@ ucl_object_lua_fromelt (lua_State *L, in fd->idx = luaL_ref (L, LUA_REGISTRYINDEX); obj = ucl_object_new_userdata (lua_ucl_userdata_dtor, - lua_ucl_userdata_emitter); - obj->type = UCL_USERDATA; - obj->value.ud = (void *)fd; + lua_ucl_userdata_emitter, (void *)fd); } } } @@ -514,6 +513,17 @@ lua_ucl_object_get (lua_State *L, int in return *((ucl_object_t **) luaL_checkudata(L, index, OBJECT_META)); } +static void +lua_ucl_push_opaque (lua_State *L, ucl_object_t *obj) +{ + ucl_object_t **pobj; + + pobj = lua_newuserdata (L, sizeof (*pobj)); + *pobj = obj; + luaL_getmetatable (L, OBJECT_META); + lua_setmetatable (L, -2); +} + /*** * @method parser:parse_file(name) * Parse UCL object from file. @@ -629,17 +639,14 @@ static int lua_ucl_parser_get_object_wrapped (lua_State *L) { struct ucl_parser *parser; - ucl_object_t *obj, **pobj; + ucl_object_t *obj; int ret = 1; parser = lua_ucl_parser_get (L, 1); obj = ucl_parser_get_object (parser); if (obj != NULL) { - pobj = lua_newuserdata (L, sizeof (*pobj)); - *pobj = obj; - luaL_getmetatable (L, OBJECT_META); - lua_setmetatable (L, -2); + lua_ucl_push_opaque (L, obj); } else { lua_pushnil (L); @@ -806,19 +813,21 @@ lua_ucl_object_tostring (lua_State *L) } /*** - * @method object:validate(schema, path) + * @method object:validate(schema[, path[, ext_refs]]) * Validates the given ucl object using schema object represented as another * opaque ucl object. You can also specify path in the form `#/path/def` to * specify the specific schema element to perform validation. * * @param {ucl.object} schema schema object * @param {string} path optional path for validation procedure - * @return {result,err} two values: boolean result and the corresponding error + * @return {result,err} two values: boolean result and the corresponding + * error, if `ext_refs` are also specified, then they are returned as opaque + * ucl object as {result,err,ext_refs} */ static int lua_ucl_object_validate (lua_State *L) { - ucl_object_t *obj, *schema; + ucl_object_t *obj, *schema, *ext_refs = NULL; const ucl_object_t *schema_elt; bool res = false; struct ucl_schema_error err; @@ -828,15 +837,30 @@ lua_ucl_object_validate (lua_State *L) schema = lua_ucl_object_get (L, 2); if (schema && obj && ucl_object_type (schema) == UCL_OBJECT) { - if (lua_gettop (L) > 2 && lua_type (L, 3) == LUA_TSTRING) { - path = lua_tostring (L, 3); - if (path[0] == '#') { - path ++; + if (lua_gettop (L) > 2) { + if (lua_type (L, 3) == LUA_TSTRING) { + path = lua_tostring (L, 3); + if (path[0] == '#') { + path++; + } + } + else if (lua_type (L, 3) == LUA_TUSERDATA || lua_type (L, 3) == + LUA_TTABLE) { + /* External refs */ + ext_refs = lua_ucl_object_get (L, 3); + } + + if (lua_gettop (L) > 3) { + if (lua_type (L, 4) == LUA_TUSERDATA || lua_type (L, 4) == + LUA_TTABLE) { + /* External refs */ + ext_refs = lua_ucl_object_get (L, 4); + } } } if (path) { - schema_elt = ucl_lookup_path_char (schema, path, '/'); + schema_elt = ucl_object_lookup_path_char (schema, path, '/'); } else { /* Use the top object */ @@ -844,26 +868,33 @@ lua_ucl_object_validate (lua_State *L) } if (schema_elt) { - res = ucl_object_validate (schema_elt, obj, &err); + res = ucl_object_validate_root_ext (schema_elt, obj, schema, + ext_refs, &err); if (res) { lua_pushboolean (L, res); lua_pushnil (L); + + if (ext_refs) { + lua_ucl_push_opaque (L, ext_refs); + } } else { lua_pushboolean (L, res); lua_pushfstring (L, "validation error: %s", err.msg); + + if (ext_refs) { + lua_ucl_push_opaque (L, ext_refs); + } } } else { lua_pushboolean (L, res); - if (path) { - lua_pushfstring (L, "cannot find the requested path: %s", path); - } - else { - /* Should not be reached */ - lua_pushstring (L, "unknown error"); + lua_pushfstring (L, "cannot find the requested path: %s", path); + + if (ext_refs) { + lua_ucl_push_opaque (L, ext_refs); } } } @@ -872,6 +903,10 @@ lua_ucl_object_validate (lua_State *L) lua_pushstring (L, "invalid object or schema"); } + if (ext_refs) { + return 3; + } + return 2; } Modified: head/contrib/libucl/python/src/uclmodule.c ============================================================================== --- head/contrib/libucl/python/src/uclmodule.c Sun Apr 17 21:29:47 2016 (r298165) +++ head/contrib/libucl/python/src/uclmodule.c Sun Apr 17 21:30:40 2016 (r298166) @@ -2,65 +2,63 @@ #include #include -static PyObject* -_basic_ucl_type(ucl_object_t const * const obj) { - if (obj->type == UCL_INT) { - return Py_BuildValue("L", (long long)ucl_object_toint (obj)); - } - else if (obj->type == UCL_FLOAT) { - return Py_BuildValue("d", ucl_object_todouble (obj)); - } - else if (obj->type == UCL_STRING) { - return Py_BuildValue("s", ucl_object_tostring (obj)); - } - else if (obj->type == UCL_BOOLEAN) { - // maybe used 'p' here? - return Py_BuildValue("s", ucl_object_tostring_forced (obj)); - } - else if (obj->type == UCL_TIME) { - return Py_BuildValue("d", ucl_object_todouble (obj)); +static PyObject * +_basic_ucl_type (ucl_object_t const *obj) +{ + switch (obj->type) { + case UCL_INT: + return Py_BuildValue ("L", (long long)ucl_object_toint (obj)); + case UCL_FLOAT: + return Py_BuildValue ("d", ucl_object_todouble (obj)); + case UCL_STRING: + return Py_BuildValue ("s", ucl_object_tostring (obj)); + case UCL_BOOLEAN: + return ucl_object_toboolean (obj) ? Py_True : Py_False; + case UCL_TIME: + return Py_BuildValue ("d", ucl_object_todouble (obj)); } return NULL; } -static PyObject* -_iterate_valid_ucl(ucl_object_t const * obj) { +static PyObject * +_iterate_valid_ucl (ucl_object_t const *obj) +{ const ucl_object_t *tmp; ucl_object_iter_t it = NULL; tmp = obj; - while ((obj = ucl_iterate_object (tmp, &it, false))) { - - PyObject* val; + while ((obj = ucl_object_iterate (tmp, &it, false))) { + PyObject *val; val = _basic_ucl_type(obj); if (!val) { - PyObject* key = NULL; + PyObject *key = NULL; + if (obj->key != NULL) { key = Py_BuildValue("s", ucl_object_key(obj)); } - PyObject* ret; - ret = PyDict_New(); if (obj->type == UCL_OBJECT) { - val = PyDict_New(); const ucl_object_t *cur; ucl_object_iter_t it_obj = NULL; - while ((cur = ucl_iterate_object (obj, &it_obj, true))) { - PyObject* keyobj = Py_BuildValue("s",ucl_object_key(cur)); + + val = PyDict_New(); + + while ((cur = ucl_object_iterate (obj, &it_obj, true))) { + PyObject *keyobj = Py_BuildValue("s",ucl_object_key(cur)); PyDict_SetItem(val, keyobj, _iterate_valid_ucl(cur)); } - } - else if (obj->type == UCL_ARRAY) { - val = PyList_New(0); + } else if (obj->type == UCL_ARRAY) { const ucl_object_t *cur; ucl_object_iter_t it_obj = NULL; - while ((cur = ucl_iterate_object (obj, &it_obj, true))) { + + val = PyList_New(0); + + while ((cur = ucl_object_iterate (obj, &it_obj, true))) { PyList_Append(val, _iterate_valid_ucl(cur)); } - } - else if (obj->type == UCL_USERDATA) { + } else if (obj->type == UCL_USERDATA) { // XXX: this should be // PyBytes_FromStringAndSize; where is the // length from? @@ -74,13 +72,13 @@ _iterate_valid_ucl(ucl_object_t const * return NULL; } -static PyObject* -_internal_load_ucl(char* uclstr) { - PyObject* ret; - +static PyObject * +_internal_load_ucl (char *uclstr) +{ + PyObject *ret; struct ucl_parser *parser = ucl_parser_new (UCL_PARSER_NO_TIME); - bool r = ucl_parser_add_string(parser, uclstr, 0); + if (r) { if (ucl_parser_get_error (parser)) { PyErr_SetString(PyExc_ValueError, ucl_parser_get_error(parser)); @@ -88,13 +86,13 @@ _internal_load_ucl(char* uclstr) { ret = NULL; goto return_with_parser; } else { - ucl_object_t* uclobj = ucl_parser_get_object(parser); + ucl_object_t *uclobj = ucl_parser_get_object(parser); ret = _iterate_valid_ucl(uclobj); ucl_object_unref(uclobj); goto return_with_parser; } - - } else { + } + else { PyErr_SetString(PyExc_ValueError, ucl_parser_get_error (parser)); ret = NULL; goto return_with_parser; @@ -106,36 +104,151 @@ return_with_parser: } static PyObject* -ucl_load(PyObject *self, PyObject *args) { - char* uclstr; +ucl_load (PyObject *self, PyObject *args) +{ + char *uclstr; + if (PyArg_ParseTuple(args, "z", &uclstr)) { if (!uclstr) { Py_RETURN_NONE; } + return _internal_load_ucl(uclstr); } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 17 21:55:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46210B1052E; Sun, 17 Apr 2016 21:55:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16F331DE5; Sun, 17 Apr 2016 21:55:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLtAB5085587; Sun, 17 Apr 2016 21:55:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLt9E4085578; Sun, 17 Apr 2016 21:55:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604172155.u3HLt9E4085578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 17 Apr 2016 21:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298167 - vendor/openresolv/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:55:11 -0000 Author: pfg Date: Sun Apr 17 21:55:09 2016 New Revision: 298167 URL: https://svnweb.freebsd.org/changeset/base/298167 Log: Import openresolv 3.8.0 Obtained from: http://roy.marples.name/projects/openresolv Modified: vendor/openresolv/dist/Makefile vendor/openresolv/dist/configure vendor/openresolv/dist/dnsmasq.in vendor/openresolv/dist/libc.in vendor/openresolv/dist/named.in vendor/openresolv/dist/resolvconf.8.in vendor/openresolv/dist/resolvconf.conf.5.in vendor/openresolv/dist/resolvconf.in vendor/openresolv/dist/unbound.in Modified: vendor/openresolv/dist/Makefile ============================================================================== --- vendor/openresolv/dist/Makefile Sun Apr 17 21:30:40 2016 (r298166) +++ vendor/openresolv/dist/Makefile Sun Apr 17 21:55:09 2016 (r298167) @@ -1,5 +1,4 @@ PKG= openresolv -VERSION= 3.7.3 # Nasty hack so that make clean works without configure being run _CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk @@ -10,14 +9,12 @@ SBINDIR?= /sbin SYSCONFDIR?= /etc LIBEXECDIR?= /libexec/resolvconf VARDIR?= /var/run/resolvconf -RCDIR?= /etc/rc.d -RESTARTCMD?= if ${RCDIR}/\1 status >/dev/null 2>\&1; then \ - ${RCDIR}/\1 restart; \ - fi INSTALL?= install SED?= sed +VERSION!= ${SED} -n 's/OPENRESOLV_VERSION="\(.*\)".*/\1/p' resolvconf.in + BINMODE?= 0755 DOCMODE?= 0644 MANMODE?= 0444 @@ -33,7 +30,9 @@ SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SY SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g' SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' -SED_RESTARTCMD= -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' +SED_RESTARTCMD= -e 's:@RESTARTCMD@:${RESTARTCMD}:g' +SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' +SED_STATUSARG= -e 's:@STATUSARG@:${STATUSARG}:g' DISTPREFIX?= ${PKG}-${VERSION} DISTFILEGZ?= ${DISTPREFIX}.tar.gz @@ -44,9 +43,10 @@ FOSSILID?= current all: ${TARGET} -.in: +.in: Makefile ${CONFIG_MK} ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ - ${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \ + ${SED_VARDIR} \ + ${SED_RCDIR} ${SED_RESTARTCMD} ${SED_RCDIR} ${SED_STATUSARG} \ $< > $@ clean: Modified: vendor/openresolv/dist/configure ============================================================================== --- vendor/openresolv/dist/configure Sun Apr 17 21:30:40 2016 (r298166) +++ vendor/openresolv/dist/configure Sun Apr 17 21:55:09 2016 (r298167) @@ -8,6 +8,7 @@ HOST= TARGET= RESTARTCMD= RCDIR= +STATUSARG= for x do opt=${x%%=*} @@ -33,6 +34,8 @@ for x do --target) TARGET=$var;; --libdir) LIBDIR=$var;; --restartcmd) RESTARTCMD=$var;; + --rcdir) RCDIR=$var;; + --statusarg) STATUSARG=$var;; --includedir) eval INCLUDEDIR="$INCLUDEDIR${INCLUDEDIR:+ }$var";; --datadir|--infodir) ;; # ignore autotools --disable-maintainer-mode|--disable-dependency-tracking) ;; @@ -117,7 +120,17 @@ echo "Configuring openresolv for ... $OS rm -rf $CONFIG_MK echo "# $OS" >$CONFIG_MK -for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR; do +# On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled +# regardless of if it's not running. +# So we force onestatus to work around this silly bug. +if [ -z "$STATUSARG" ]; then + case "$OS" in + freebsd*) STATUSARG="onestatus";; + esac +fi + +for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR RESTARTCMD RCDIR STATUSARG +do eval v=\$$x # Make files look nice for import l=$((10 - ${#x})) @@ -126,96 +139,6 @@ for x in SYSCONFDIR SBINDIR LIBEXECDIR V echo "$x=$t $v" >>$CONFIG_MK done -if [ -z "$RESTARTCMD" ]; then - printf "Checking for systemd ... " - if [ -x /bin/systemctl ]; then - RESTARTCMD="/bin/systemctl try-restart \1" - echo "yes" - elif [ -x /usr/bin/systemctl ]; then - RESTARTCMD="/usr/bin/systemctl try-restart \1" - echo "yes" - else - echo "no" - fi -fi - -# Arch upgraded to systemd, so this check has to be just after systemd -# but higher than the others -if [ -z "$RESTARTCMD" ]; then - printf "Checking for Arch ... " - if [ -e /etc/arch-release -a -d /etc/rc.d ]; then - RCDIR=/etc/rc.d - RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" - echo "yes" - else - echo "no" - fi -fi - -if [ -z "$RESTARTCMD" ]; then - printf "Checking for OpenRC ... " - if [ -x /sbin/rc-service ]; then - RESTARTCMD="if /sbin/rc-service -e \1; then /sbin/rc-service \1 -- -Ds restart; fi" - echo "yes" - else - echo "no" - fi -fi -if [ -z "$RESTARTCMD" ]; then - printf "Checking for invoke-rc.d ... " - if [ -x /usr/sbin/invoke-rc.d ]; then - RCDIR=/etc/init.d - RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1; then /usr/sbin/invoke-rc.d \1 restart; fi" - echo "yes" - else - echo "no" - fi -fi -if [ -z "$RESTARTCMD" ]; then - printf "Checking for service ... " - if [ -x /sbin/service ]; then - RCDIR=/etc/init.d - RESTARTCMD="if /sbin/service \1; then /sbin/service \1 restart; fi" - echo "yes" - else - echo "no" - fi -fi -if [ -z "$RESTARTCMD" ]; then - printf "Checking for runit... " - if [ -x /bin/sv ]; then - RESTARTCMD="/bin/sv try-restart \1" - echo "yes" - elif [ -x /usr/bin/sv ]; then - RESTARTCMD="/usr/bin/sv try-restart \1" - echo "yes" - else - echo "no" - fi -fi -if [ -z "$RESTARTCMD" ]; then - for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do - printf "Checking for $x ... " - if [ -d $x ]; then - RCDIR=$x - RESTARTCMD="if $x/\1 status >/dev/null 2>\&1; then $x/\1 restart; fi" - echo "yes" - break - else - echo "no" - fi - done -fi - -if [ -z "$RESTARTCMD" ]; then - echo "$0: WARNING: No means of interacting with system services detected!" - exit 1 -fi - -echo "RCDIR= $RCDIR" >>$CONFIG_MK -# Work around bug in the dash shell as "echo 'foo \1'" does bad things -printf "%s\n" "RESTARTCMD= $RESTARTCMD" >>$CONFIG_MK - echo echo " SYSCONFDIR = $SYSCONFDIR" echo " SBINDIR = $SBINDIR" @@ -223,3 +146,7 @@ echo " LIBEXECDIR = $LIBEXECDIR" echo " VARDIR = $RUNDIR" echo " MANDIR = $MANDIR" echo +echo " RESTARTCMD = $RESTARTCMD" +echo " RCDIR = $RCDIR" +echo " STATUSARG = $STATUSARG" +echo Modified: vendor/openresolv/dist/dnsmasq.in ============================================================================== --- vendor/openresolv/dist/dnsmasq.in Sun Apr 17 21:30:40 2016 (r298166) +++ vendor/openresolv/dist/dnsmasq.in Sun Apr 17 21:55:09 2016 (r298167) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2012 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # dnsmasq subscriber for resolvconf @@ -37,7 +37,6 @@ NL=" [ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid [ -s "$dnsmasq_pid" ] || unset dnsmasq_pid : ${dnsmasq_service:=dnsmasq} -: ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@} newconf="# Generated by resolvconf$NL" newresolv="$newconf" @@ -180,7 +179,15 @@ if [ -n "$dnsmasq_resolv" ]; then fi if $changed; then - eval $dnsmasq_restart + # dnsmasq does not re-read the configuration file on SIGHUP + if [ -n "$dnsmasq_restart" ]; then + eval $dnsmasq_restart + elif [ -n "$RESTARTCMD" ]; then + set -- ${dnsmasq_service} + eval $RESTARTCMD + else + @SBINDIR@/resolvconf -r ${dnsmasq_service} + fi fi if $dbus; then if [ -s "$dnsmasq_pid" ]; then Modified: vendor/openresolv/dist/libc.in ============================================================================== --- vendor/openresolv/dist/libc.in Sun Apr 17 21:30:40 2016 (r298166) +++ vendor/openresolv/dist/libc.in Sun Apr 17 21:55:09 2016 (r298167) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2014 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # libc subscriber for resolvconf @@ -97,7 +97,6 @@ elif [ -d "$SYSCONFDIR"/resolvconf ]; th fi : ${resolv_conf:=/etc/resolv.conf} : ${libc_service:=nscd} -: ${libc_restart:=@RESTARTCMD ${libc_service}@} : ${list_resolv:=@SBINDIR@/resolvconf -l} if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)" @@ -229,7 +228,14 @@ fi # Create our resolv.conf now (umask 022; printf %s "$newconf" >"$resolv_conf") -eval $libc_restart +if [ -n "$libc_restart" ]; then + eval $libc_restart +elif [ -n "$RESTARTCMD" ]; then + set -- ${libc_service} + eval $RESTARTCMD +else + @SBINDIR@/resolvconf -r ${libc_service} +fi retval=0 # Notify users of the resolver Modified: vendor/openresolv/dist/named.in ============================================================================== --- vendor/openresolv/dist/named.in Sun Apr 17 21:30:40 2016 (r298166) +++ vendor/openresolv/dist/named.in Sun Apr 17 21:55:09 2016 (r298167) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2012 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # named subscriber for resolvconf @@ -35,18 +35,22 @@ NL=" # Platform specific kludges if [ -z "$named_service" -a -z "$named_restart" -a \ - -d "@RCDIR@" -a ! -x "@RCDIR@"/named ] + -d "$RCDIR" -a ! -x "$RCDIR"/named ] then - if [ -x "@RCDIR@"/bind9 ]; then + if [ -x "$RCDIR"/bind9 ]; then # Debian and derivatives named_service=bind9 - elif [ -x "@RCDIR@"/rc.bind ]; then + elif [ -x "$RCDIR"/rc.bind ]; then # Slackware named_service=rc.bind fi fi : ${named_service:=named} -: ${named_restart:=@RESTARTCMD ${named_service}@} + +: ${named_pid:=/var/run/$named_service.pid} +[ -s "$named_pid" ] || named_pid=/var/run/$named_service/$named_service.pid +[ -s "$named_pid" ] || unset named_pid + newoptions="# Generated by resolvconf$NL" newzones="$newoptions" @@ -101,6 +105,14 @@ if [ -n "$named_zones" ]; then fi fi +# named does not seem to work with SIGHUP which is a same if $changed; then - eval $named_restart + if [ -n "$named_restart" ]; then + eval $named_restart + elif [ -n "$RESTARTCMD" ]; then + set -- ${named_service} + eval $RESTARTCMD + else + @SBINDIR@/resolvconf -r ${named_service} + fi fi Modified: vendor/openresolv/dist/resolvconf.8.in ============================================================================== --- vendor/openresolv/dist/resolvconf.8.in Sun Apr 17 21:30:40 2016 (r298166) +++ vendor/openresolv/dist/resolvconf.8.in Sun Apr 17 21:55:09 2016 (r298167) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007-2015 Roy Marples +.\" Copyright (c) 2007-2016 Roy Marples .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 27, 2015 +.Dd February 23, 2016 .Dt RESOLVCONF 8 .Os .Sh NAME @@ -125,24 +125,28 @@ file(s) for all the on the .Ar interface . .Pp -Here are some more options that -.Nm -has:- +Here are some options for the above commands:- .Bl -tag -width indent -.It Fl I -Initialise the state directory -.Pa @VARDIR@ . -This only needs to be called if the initial system boot sequence does not -automatically clean it out; for example the state directory is moved -somewhere other than -.Pa /var/run . -If used, it should only be called once as early in the system boot sequence -as possible and before -.Nm -is used to add interfaces. .It Fl f Ignore non existant interfaces. Only really useful for deleting interfaces. +.It Fl m Ar metric +Set the metric of the interface when adding it, default of 0. +Lower metrics take precedence. +This affects the default order of interfaces when listed. +.It Fl p +Marks the interface +.Pa resolv.conf +as private. +.It Fl x +Mark the interface +.Pa resolv.conf +as exclusive when adding, otherwise only use the latest exclusive interface. +.El +.Pp +.Nm +has some more commands for general usage:- +.Bl -tag -width indent .It Fl i Ar pattern List the interfaces and protocols, optionally matching .Ar pattern , @@ -157,14 +161,6 @@ If .Ar pattern is specified then we list the files for the interfaces and protocols that match it. -.It Fl m Ar metric -Set the metric of the interface when adding it, default of 0. -Lower metrics take precedence. -This affects the default order of interfaces when listed. -.It Fl p -Marks the interface -.Pa resolv.conf -as private. .It Fl u Force .Nm @@ -172,15 +168,31 @@ to update all its subscribers. .Nm does not update the subscribers when adding a resolv.conf that matches what it already has for that interface. -.It Fl x -Mark the interface -.Pa resolv.conf -as exclusive when adding, otherwise only use the latest exclusive interface. .El .Pp .Nm -also has some options designed to be used by its subscribers:- +also has some commands designed to be used by it's subscribers and +system startup:- .Bl -tag -width indent +.It Fl I +Initialise the state directory +.Pa @VARDIR@ . +This only needs to be called if the initial system boot sequence does not +automatically clean it out; for example the state directory is moved +somewhere other than +.Pa /var/run . +If used, it should only be called once as early in the system boot sequence +as possible and before +.Nm +is used to add interfaces. +.It Fl R +Echo the command used to restart a service. +.It Fl r Ar service +If the +.Ar service +is running then restart it. +If the service does not exist or is not running then zero is returned, +otherwise the result of restarting the service. .It Fl v Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can configure the resolver easily. Modified: vendor/openresolv/dist/resolvconf.conf.5.in ============================================================================== --- vendor/openresolv/dist/resolvconf.conf.5.in Sun Apr 17 21:30:40 2016 (r298166) +++ vendor/openresolv/dist/resolvconf.conf.5.in Sun Apr 17 21:55:09 2016 (r298167) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 21, 2016 +.Dd February 23, 2016 .Dt RESOLVCONF.CONF 5 .Os .Sh NAME @@ -284,23 +284,23 @@ variables, documented below. .Pp .Bl -tag -width indent .It Sy dnsmasq_service -Location of the dnsmasq service. +Name of the dnsmasq service. .It Sy dnsmasq_restart Command to restart the dnsmasq service. .It Sy dnsmasq_pid Location of the dnsmasq pidfile. .It Sy libc_service -Location of the libc service. +Name of the libc service. .It Sy libc_restart Command to restart the libc service. .It Sy named_service -Location of the named service. +Name of the named service. .It Sy named_restart Command to restart the named service. .It Sy pdnsd_restart Command to restart the pdnsd service. .It Sy unbound_service -Location of the unbound service. +Name of the unbound service. .It Sy unbound_restart Command to restart the unbound service. .It Sy unbound_pid Modified: vendor/openresolv/dist/resolvconf.in ============================================================================== --- vendor/openresolv/dist/resolvconf.in Sun Apr 17 21:30:40 2016 (r298166) +++ vendor/openresolv/dist/resolvconf.in Sun Apr 17 21:55:09 2016 (r298167) @@ -25,9 +25,12 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. RESOLVCONF="$0" +OPENRESOLV_VERSION="3.8.0" SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ +RCDIR=@RCDIR@ +RESTARTCMD=@RESTARTCMD@ # Disregard dhcpcd setting unset interface_order state_dir @@ -71,55 +74,45 @@ error_exit() usage() { cat <<-EOF - Usage: ${RESOLVCONF##*/} [options] + Usage: ${RESOLVCONF##*/} [options] command [argument] Inform the system about any DNS updates. - Options: + Commands: -a \$INTERFACE Add DNS information to the specified interface (DNS supplied via stdin in resolv.conf format) - -m metric Give the added DNS information a metric - -p Mark the interface as private - -x Mark the interface as exclusive -d \$INTERFACE Delete DNS information from the specified interface - -f Ignore non existant interfaces - -I Init the state dir - -u Run updates from our current DNS information - -l [\$PATTERN] Show DNS information, optionally from interfaces - that match the specified pattern + -h Show this help cruft -i [\$PATTERN] Show interfaces that have supplied DNS information optionally from interfaces that match the specified pattern + -l [\$PATTERN] Show DNS information, optionally from interfaces + that match the specified pattern + + -u Run updates from our current DNS information + + Options: + -f Ignore non existant interfaces + -m metric Give the added DNS information a metric + -p Mark the interface as private + -x Mark the interface as exclusive + + Subscriber and System Init Commands: + -I Init the state dir + -r \$SERVICE Restart the system service + (restarting a non-existent or non-running service + should have no output and return 0) + -R Show the system service restart command -v [\$PATTERN] echo NEWDOMAIN, NEWSEARCH and NEWNS variables to the console - -h Show this help cruft + -V [\$PATTERN] Same as -v, but only uses configuration in + $SYSCONFDIR/resolvconf.conf EOF [ -z "$1" ] && exit 0 echo error_exit "$*" } -echo_resolv() -{ - local line= OIFS="$IFS" - - [ -n "$1" -a -f "$IFACEDIR/$1" ] || return 1 - echo "# resolv.conf from $1" - # Our variable maker works of the fact each resolv.conf per interface - # is separated by blank lines. - # So we remove them when echoing them. - while read -r line; do - IFS="$OIFS" - if [ -n "$line" ]; then - # We need to set IFS here to preserve any whitespace - IFS='' - printf "%s\n" "$line" - fi - done < "$IFACEDIR/$1" - echo - IFS="$OIFS" -} - # Strip any trailing dot from each name as a FQDN does not belong # in resolv.conf(5) # If you think otherwise, capture a DNS trace and you'll see libc @@ -261,6 +254,108 @@ config_mkdirs() return $e } +# With the advent of alternative init systems, it's possible to have +# more than one installed. So we need to try and guess what one we're +# using unless overriden by configure. +# Note that restarting a service is a last resort - the subscribers +# should make a reasonable attempt to reconfigre the service via some +# method, normally SIGHUP. +detect_init() +{ + [ -n "$RESTARTCMD" ] && return 0 + + # Detect the running init system. + # As systemd and OpenRC can be installed on top of legacy init + # systems we try to detect them first. + local status="@STATUSARG@" + : ${status:=status} + if [ -x /bin/systemctl -a -S /run/systemd/private ]; then + RESTARTCMD="if /bin/systemctl --quiet is-active; then + /bin/systemctl restart \$1.service; +fi" + elif [ -x /usr/bin/systemctl -a -S /run/systemd/private ]; then + RESTARTCMD="if /usr/bin/systemctl --quiet is-active; then + /usr/bin/systemctl restart \$1.service; +fi" + elif [ -x /sbin/rc-service -a \ + -s /libexec/rc/init.d/softlevel -o -s /run/openrc/softlevel ] + then + RESTARTCMD="/sbin/rc-service -i \$1 -- -Ds restart" + elif [ -x /usr/sbin/invoke-rc.d ]; then + RCDIR=/etc/init.d + RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \$1 status 1>/dev/null 2>&1; then + /usr/sbin/invoke-rc.d \$1 restart; +fi" + elif [ -x /sbin/service ]; then + # Old RedHat + RCDIR=/etc/init.d + RESTARTCMD="if /sbin/service \$1; then + /sbin/service \$1 restart; +fi" + elif [ -x /usr/sbin/service ]; then + # Could be FreeBSD + RESTARTCMD="if /usr/sbin/service \$1 $status 1>/dev/null 2>&1; then + /usr/sbin/service \$1 restart; +fi" + elif [ -x /bin/sv ]; then + RESTARTCMD="/bin/sv try-restart \$1" + elif [ -x /usr/bin/sv ]; then + RESTARTCMD="/usr/bin/sv try-restart \$1" + elif [ -e /etc/arch-release -a -d /etc/rc.d ]; then + RCDIR=/etc/rc.d + RESTARTCMD="if [ -e /var/run/daemons/\$1 ]; then + /etc/rc.d/\$1 restart; +fi" + elif [ -e /etc/slackware-version -a -d /etc/rc.d ]; then + RESTARTCMD="if /etc/rc.d/rc.\$1 status 1>/dev/null 2>&1; then + /etc/rc.d/rc.\$1 restart; +fi" + elif [ -e /etc/rc.d/rc.subr -a -d /etc/rc.d ]; then + # OpenBSD + RESTARTCMD="if /etc/rc.d/\$1 check 1>/dev/null 2>&1; then + /etc/rc.d/\$1 restart; +fi" + else + for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do + [ -d $x ] || continue + RESTARTCMD="if $x/\$1 $status 1>/dev/null 2>&1; then + $x/\$1 restart; +fi" + break + done + fi + + if [ -z "$RESTARTCMD" ]; then + if [ "$NOINIT_WARNED" != true ]; then + warn "could not detect a useable init system" + _NOINIT_WARNED=true + fi + return 1 + fi + _NOINIT_WARNED= + return 0 +} + +echo_resolv() +{ + local line= OIFS="$IFS" + + [ -n "$1" -a -f "$IFACEDIR/$1" ] || return 1 + echo "# resolv.conf from $1" + # Our variable maker works of the fact each resolv.conf per interface + # is separated by blank lines. + # So we remove them when echoing them. + while read -r line; do + IFS="$OIFS" + if [ -n "$line" ]; then + # We need to set IFS here to preserve any whitespace + IFS='' + printf "%s\n" "$line" + fi + done < "$IFACEDIR/$1" + IFS="$OIFS" +} + list_resolv() { [ -d "$IFACEDIR" ] || return 0 @@ -320,6 +415,7 @@ list_resolv() cd "$IFACEDIR" retval=1 + excl=true for i in $(uniqify $list); do # Only list interfaces which we really have if ! [ -f "$i" ]; then @@ -334,6 +430,7 @@ list_resolv() printf %s "$i " else echo_resolv "$i" + echo fi [ $? = 0 -a "$retval" = 1 ] && retval=0 done @@ -499,7 +596,7 @@ make_vars() force=false VFLAG= -while getopts a:Dd:fhIilm:puvVx OPT; do +while getopts a:Dd:fhIilm:pRruvVx OPT; do case "$OPT" in f) force=true;; h) usage;; @@ -541,6 +638,18 @@ if [ "$cmd" = l -o "$cmd" = i ]; then exit $? fi +# Restart a service or echo the command to restart a service +if [ "$cmd" = r -o "$cmd" = R ]; then + detect_init || exit 1 + if [ "$cmd" = r ]; then + set -- $args + eval $RESTARTCMD + else + echo "$RESTARTCMD" + fi + exit $? +fi + # Not normally needed, but subscribers should be able to run independently if [ "$cmd" = v -o -n "$VFLAG" ]; then make_vars "$iface" @@ -765,6 +874,10 @@ case "${resolvconf:-YES}" in *) exit 0;; esac +# Try and detect a suitable init system for our scripts +detect_init +export RESTARTCMD RCDIR _NOINIT_WARNED + eval "$(make_vars)" export RESOLVCONF DOMAINS SEARCH NAMESERVERS LOCALNAMESERVERS : ${list_resolv:=list_resolv -l} Modified: vendor/openresolv/dist/unbound.in ============================================================================== --- vendor/openresolv/dist/unbound.in Sun Apr 17 21:30:40 2016 (r298166) +++ vendor/openresolv/dist/unbound.in Sun Apr 17 21:55:09 2016 (r298167) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2009-2014 Roy Marples +# Copyright (c) 2009-2016 Roy Marples # All rights reserved # unbound subscriber for resolvconf @@ -37,7 +37,6 @@ NL=" : ${unbound_pid:=/var/run/unbound.pid} : ${unbound_service:=unbound} -: ${unbound_restart:=@RESTARTCMD ${unbound_service}@} newconf="# Generated by resolvconf$NL" for d in $DOMAINS; do @@ -71,6 +70,18 @@ else @SBINDIR@/resolvconf -D "$unbound_conf" fi +restart_unbound() +{ + if [ -n "$unbound_restart" ]; then + eval $unbound_restart + elif [ -n "$RESTARTCMD" ]; then + set -- ${unbound_service} + eval $RESTARTCMD + else + @SBINDIR@/resolvconf -r ${unbound_service} + fi +} + if [ ! -f "$unbound_conf" ] || \ [ "$(cat "$unbound_conf")" != "$(printf %s "$newconf")" ] then @@ -78,9 +89,9 @@ then # If we can't sent a HUP then force a restart if [ -s "$unbound_pid" ]; then if ! kill -HUP $(cat "$unbound_pid") 2>/dev/null; then - eval $unbound_restart + restart_unbound fi else - eval $unbound_restart + restart_unbound fi fi From owner-svn-src-all@freebsd.org Sun Apr 17 21:59:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 252E3B1076E; Sun, 17 Apr 2016 21:59:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDA9C102E; Sun, 17 Apr 2016 21:59:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HLx4cP085786; Sun, 17 Apr 2016 21:59:04 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HLx4E3085785; Sun, 17 Apr 2016 21:59:04 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604172159.u3HLx4E3085785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 17 Apr 2016 21:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298168 - vendor/openresolv/3.8.0 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 21:59:06 -0000 Author: pfg Date: Sun Apr 17 21:59:04 2016 New Revision: 298168 URL: https://svnweb.freebsd.org/changeset/base/298168 Log: Tag openresolv 3.8.0 Obtained from: http://roy.marples.name/projects/openresolv Added: vendor/openresolv/3.8.0/ - copied from r298167, vendor/openresolv/dist/ From owner-svn-src-all@freebsd.org Sun Apr 17 22:42:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B73BBB11640; Sun, 17 Apr 2016 22:42:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81F8D1486; Sun, 17 Apr 2016 22:42:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HMgmBK000850; Sun, 17 Apr 2016 22:42:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HMgmBY000849; Sun, 17 Apr 2016 22:42:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604172242.u3HMgmBY000849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 17 Apr 2016 22:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298169 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 22:42:49 -0000 Author: bapt Date: Sun Apr 17 22:42:48 2016 New Revision: 298169 URL: https://svnweb.freebsd.org/changeset/base/298169 Log: Use the nitems() macro Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Sun Apr 17 21:59:04 2016 (r298168) +++ head/usr.bin/locale/locale.c Sun Apr 17 22:42:48 2016 (r298169) @@ -35,7 +35,9 @@ * nl_langinfo(CODESET). */ +#include #include + #include #include #include @@ -79,7 +81,7 @@ struct _lcinfo { { "LC_MONETARY", LC_MONETARY }, { "LC_MESSAGES", LC_MESSAGES } }; -#define NLCINFO (sizeof(lcinfo)/sizeof(lcinfo[0])) +#define NLCINFO nitems(lcinfo) /* ids for values not referenced by nl_langinfo() */ #define KW_ZERO 10000 @@ -290,7 +292,7 @@ main(int argc, char *argv[]) } } else { uint i; - for (i = 0; i < sizeof (kwinfo) / sizeof (struct _kwinfo); i++) + for (i = 0; i < nitems(kwinfo); i++) showdetails ((char *)kwinfo [i].name); } exit(0); From owner-svn-src-all@freebsd.org Sun Apr 17 23:02:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF338B11B78; Sun, 17 Apr 2016 23:02:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB4D71E20; Sun, 17 Apr 2016 23:02:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HN2nXI006745; Sun, 17 Apr 2016 23:02:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HN2nGN006743; Sun, 17 Apr 2016 23:02:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604172302.u3HN2nGN006743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 17 Apr 2016 23:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298170 - in head/usr.bin: colldef mklocale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 23:02:51 -0000 Author: bapt Date: Sun Apr 17 23:02:49 2016 New Revision: 298170 URL: https://svnweb.freebsd.org/changeset/base/298170 Log: Note that mklocale(1) and colldef(1) are no longer used mklocale and colldef has been replaced by localedef, but they have to be kept until 10.2 is EOL for mklocale (it has been added to 10.3 as a bootstrap tools) and until 10.3 is EOL for colldef (it has never been added to bootstrap tools) Modified: head/usr.bin/colldef/colldef.1 head/usr.bin/mklocale/mklocale.1 Modified: head/usr.bin/colldef/colldef.1 ============================================================================== --- head/usr.bin/colldef/colldef.1 Sun Apr 17 22:42:48 2016 (r298169) +++ head/usr.bin/colldef/colldef.1 Sun Apr 17 23:02:49 2016 (r298170) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 1995 +.Dd April 18, 2016 .Dt COLLDEF 1 .Os .Sh NAME @@ -265,7 +265,14 @@ No errors were found and the output was .It Li !=0 Errors were found. .El +.Sh NOTES +.Nm +has been replaced by +.Xr localedef 1 +in +.Fx 11.0 . .Sh SEE ALSO +.Xr localedef 1 , .Xr mklocale 1 , .Xr setlocale 3 , .Xr strcoll 3 , Modified: head/usr.bin/mklocale/mklocale.1 ============================================================================== --- head/usr.bin/mklocale/mklocale.1 Sun Apr 17 22:42:48 2016 (r298169) +++ head/usr.bin/mklocale/mklocale.1 Sun Apr 17 23:02:49 2016 (r298170) @@ -31,7 +31,7 @@ .\" @(#)mklocale.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 17, 2004 +.Dd April 18, 2016 .Dt MKLOCALE 1 .Os .Sh NAME @@ -282,8 +282,15 @@ Defines runes with display width 3. .Pp If no display width explicitly defined, width 1 assumed for printable runes by default. +.Sh NOTES +.Nm +has been replaced by +.Xr localedef 1 +in +.Fx 11.0 . .Sh SEE ALSO .Xr colldef 1 , +.Xr localedef 1 , .Xr setlocale 3 , .Xr wcwidth 3 , .Xr big5 5 , From owner-svn-src-all@freebsd.org Sun Apr 17 23:08:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 201F6B11DE4; Sun, 17 Apr 2016 23:08:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE2B11044; Sun, 17 Apr 2016 23:08:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HN8nfl006986; Sun, 17 Apr 2016 23:08:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HN8lJF006969; Sun, 17 Apr 2016 23:08:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604172308.u3HN8lJF006969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Apr 2016 23:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298171 - in head/sys/cddl: contrib/opensolaris/uts/common/sys dev/dtrace/aarch64 dev/dtrace/amd64 dev/dtrace/arm dev/dtrace/i386 dev/dtrace/mips dev/dtrace/powerpc dev/fbt dev/fbt/aarc... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 23:08:50 -0000 Author: markj Date: Sun Apr 17 23:08:47 2016 New Revision: 298171 URL: https://svnweb.freebsd.org/changeset/base/298171 Log: Make the second argument of dtrace_invop() a trapframe pointer. Currently this argument is a pointer into the stack which is used by FBT to fetch the first five probe arguments. On all non-x86 architectures it's simply the trapframe address, so this change has no functional impact. On amd64 it's a pointer into the trapframe such that stack[1 .. 5] gives the first five argument registers, which are deliberately grouped together in the amd64 trapframe definition. A trapframe argument simplifies the invop handlers on !x86 and makes the x86 FBT invop handler easier to understand. Moreover, it allows for invop handlers that may want to modify the register set of the interrupted thread. Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c head/sys/cddl/dev/dtrace/amd64/dtrace_asm.S head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/arm/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_asm.S head/sys/cddl/dev/dtrace/i386/dtrace_isa.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c head/sys/cddl/dev/dtrace/mips/dtrace_subr.c head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c head/sys/cddl/dev/fbt/aarch64/fbt_isa.c head/sys/cddl/dev/fbt/arm/fbt_isa.c head/sys/cddl/dev/fbt/fbt.h head/sys/cddl/dev/fbt/powerpc/fbt_isa.c head/sys/cddl/dev/fbt/x86/fbt_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Sun Apr 17 23:08:47 2016 (r298171) @@ -2398,8 +2398,9 @@ extern int dtrace_instr_size(uchar_t *in extern int dtrace_instr_size_isa(uchar_t *, model_t, int *); extern void dtrace_invop_callsite(void); #endif -extern void dtrace_invop_add(int (*)(uintptr_t, uintptr_t *, uintptr_t)); -extern void dtrace_invop_remove(int (*)(uintptr_t, uintptr_t *, uintptr_t)); +extern void dtrace_invop_add(int (*)(uintptr_t, struct trapframe *, uintptr_t)); +extern void dtrace_invop_remove(int (*)(uintptr_t, struct trapframe *, + uintptr_t)); #ifdef __sparc extern int dtrace_blksuword32(uintptr_t, uint32_t *, int); @@ -2427,7 +2428,9 @@ extern void dtrace_helpers_destroy(proc_ #if defined(__i386) || defined(__amd64) #define DTRACE_INVOP_PUSHL_EBP 1 +#define DTRACE_INVOP_PUSHQ_RBP DTRACE_INVOP_PUSHL_EBP #define DTRACE_INVOP_POPL_EBP 2 +#define DTRACE_INVOP_POPQ_RBP DTRACE_INVOP_POPL_EBP #define DTRACE_INVOP_LEAVE 3 #define DTRACE_INVOP_NOP 4 #define DTRACE_INVOP_RET 5 Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Sun Apr 17 23:08:47 2016 (r298171) @@ -49,25 +49,25 @@ extern dtrace_id_t dtrace_probeid_error; extern int (*dtrace_invop_jump_addr)(struct trapframe *); extern void dtrace_getnanotime(struct timespec *tsp); -int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); void dtrace_invop_init(void); void dtrace_invop_uninit(void); typedef struct dtrace_invop_hdlr { - int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); struct dtrace_invop_hdlr *dtih_next; } dtrace_invop_hdlr_t; dtrace_invop_hdlr_t *dtrace_invop_hdlr; int -dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax) +dtrace_invop(uintptr_t addr, struct trapframe *frame, uintptr_t eax) { dtrace_invop_hdlr_t *hdlr; int rval; for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) - if ((rval = hdlr->dtih_func(addr, stack, eax)) != 0) + if ((rval = hdlr->dtih_func(addr, frame, eax)) != 0) return (rval); return (0); @@ -75,7 +75,7 @@ dtrace_invop(uintptr_t addr, uintptr_t * void -dtrace_invop_add(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_add(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr; @@ -86,7 +86,7 @@ dtrace_invop_add(int (*func)(uintptr_t, } void -dtrace_invop_remove(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_remove(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr, *prev; @@ -240,7 +240,7 @@ dtrace_invop_start(struct trapframe *fra int tmp; int i; - invop = dtrace_invop(frame->tf_elr, (uintptr_t *)frame, frame->tf_elr); + invop = dtrace_invop(frame->tf_elr, frame, frame->tf_elr); tmp = (invop & LDP_STP_MASK); if (tmp == STP_64 || tmp == LDP_64) { Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Sun Apr 17 23:08:47 2016 (r298171) @@ -69,13 +69,10 @@ */ movq TF_RIP(%rsp), %rdi decq %rdi - movq TF_RSP(%rsp), %rsi - movq TF_RAX(%rsp), %rdx - pushq (%rsi) movq %rsp, %rsi + movq TF_RAX(%rsp), %rdx call dtrace_invop ALTENTRY(dtrace_invop_callsite) - addq $8, %rsp cmpl $DTRACE_INVOP_PUSHL_EBP, %eax je bp_push cmpl $DTRACE_INVOP_LEAVE, %eax Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sun Apr 17 23:08:47 2016 (r298171) @@ -382,11 +382,10 @@ dtrace_getarg(int arg, int aframes) * we'll pull the true stack pointer out of the saved * registers and decrement our argument by the number * of arguments passed in registers; if the argument - * we're seeking is passed in regsiters, we can just + * we're seeking is passed in registers, we can just * load it directly. */ - struct trapframe *tf = (struct trapframe *) - ((uintptr_t)&fp[1] + sizeof(uintptr_t)); + struct trapframe *tf = (struct trapframe *)&fp[1]; if (arg <= inreg) { switch (arg) { Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sun Apr 17 23:08:47 2016 (r298171) @@ -46,30 +46,30 @@ extern void dtrace_getnanotime(struct timespec *tsp); -int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); typedef struct dtrace_invop_hdlr { - int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); struct dtrace_invop_hdlr *dtih_next; } dtrace_invop_hdlr_t; dtrace_invop_hdlr_t *dtrace_invop_hdlr; int -dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax) +dtrace_invop(uintptr_t addr, struct trapframe *frame, uintptr_t eax) { dtrace_invop_hdlr_t *hdlr; int rval; for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) - if ((rval = hdlr->dtih_func(addr, stack, eax)) != 0) + if ((rval = hdlr->dtih_func(addr, frame, eax)) != 0) return (rval); return (0); } void -dtrace_invop_add(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_add(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr; @@ -80,7 +80,7 @@ dtrace_invop_add(int (*func)(uintptr_t, } void -dtrace_invop_remove(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_remove(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr = dtrace_invop_hdlr, *prev = NULL; Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Sun Apr 17 23:08:47 2016 (r298171) @@ -55,25 +55,25 @@ extern dtrace_id_t dtrace_probeid_error; extern int (*dtrace_invop_jump_addr)(struct trapframe *); extern void dtrace_getnanotime(struct timespec *tsp); -int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); void dtrace_invop_init(void); void dtrace_invop_uninit(void); typedef struct dtrace_invop_hdlr { - int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); struct dtrace_invop_hdlr *dtih_next; } dtrace_invop_hdlr_t; dtrace_invop_hdlr_t *dtrace_invop_hdlr; int -dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax) +dtrace_invop(uintptr_t addr, struct trapframe *frame, uintptr_t eax) { dtrace_invop_hdlr_t *hdlr; int rval; for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) - if ((rval = hdlr->dtih_func(addr, stack, eax)) != 0) + if ((rval = hdlr->dtih_func(addr, frame, eax)) != 0) return (rval); return (0); @@ -81,7 +81,7 @@ dtrace_invop(uintptr_t addr, uintptr_t * void -dtrace_invop_add(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_add(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr; @@ -92,7 +92,7 @@ dtrace_invop_add(int (*func)(uintptr_t, } void -dtrace_invop_remove(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_remove(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr = dtrace_invop_hdlr, *prev = NULL; @@ -237,7 +237,7 @@ dtrace_invop_start(struct trapframe *fra register_t *r0, *sp; int data, invop, reg, update_sp; - invop = dtrace_invop(frame->tf_pc, (uintptr_t *)frame, frame->tf_pc); + invop = dtrace_invop(frame->tf_pc, frame, frame->tf_pc); switch (invop & DTRACE_INVOP_MASK) { case DTRACE_INVOP_PUSHM: sp = (register_t *)frame->tf_svc_sp; Modified: head/sys/cddl/dev/dtrace/i386/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_asm.S Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/i386/dtrace_asm.S Sun Apr 17 23:08:47 2016 (r298171) @@ -38,7 +38,7 @@ pushl %eax /* push %eax -- may be return value */ pushl %esp /* push stack pointer */ - addl $48, (%esp) /* adjust to incoming args */ + subl $8, (%esp) /* skip first arg and segment regs */ pushl 40(%esp) /* push calling EIP */ /* Modified: head/sys/cddl/dev/dtrace/i386/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_isa.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/i386/dtrace_isa.c Sun Apr 17 23:08:47 2016 (r298171) @@ -423,9 +423,9 @@ zero: uint64_t dtrace_getarg(int arg, int aframes) { - uintptr_t val; + struct trapframe *frame; struct i386_frame *fp = (struct i386_frame *)dtrace_getfp(); - uintptr_t *stack; + uintptr_t *stack, val; int i; for (i = 1; i <= aframes; i++) { @@ -435,13 +435,18 @@ dtrace_getarg(int arg, int aframes) (long)dtrace_invop_callsite) { /* * If we pass through the invalid op handler, we will - * use the pointer that it passed to the stack as the - * second argument to dtrace_invop() as the pointer to - * the stack. When using this stack, we must step - * beyond the EIP/RIP that was pushed when the trap was - * taken -- hence the "+ 1" below. + * use the trap frame pointer that it pushed on the + * stack as the second argument to dtrace_invop() as + * the pointer to the stack. When using this stack, we + * must skip the third argument to dtrace_invop(), + * which is included in the i386_frame. */ - stack = ((uintptr_t **)&fp[1])[0] + 1; + frame = (struct trapframe *)(((uintptr_t **)&fp[1])[0]); + /* + * Skip the three hardware-saved registers and the + * return address. + */ + stack = (uintptr_t *)frame->tf_isp + 4; goto load; } Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun Apr 17 23:08:47 2016 (r298171) @@ -49,30 +49,30 @@ extern uintptr_t kernelbase; extern void dtrace_getnanotime(struct timespec *tsp); -int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); typedef struct dtrace_invop_hdlr { - int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); struct dtrace_invop_hdlr *dtih_next; } dtrace_invop_hdlr_t; dtrace_invop_hdlr_t *dtrace_invop_hdlr; int -dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax) +dtrace_invop(uintptr_t addr, struct trapframe *frame, uintptr_t eax) { dtrace_invop_hdlr_t *hdlr; int rval; for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) - if ((rval = hdlr->dtih_func(addr, stack, eax)) != 0) + if ((rval = hdlr->dtih_func(addr, frame, eax)) != 0) return (rval); return (0); } void -dtrace_invop_add(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_add(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr; @@ -83,7 +83,7 @@ dtrace_invop_add(int (*func)(uintptr_t, } void -dtrace_invop_remove(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_remove(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr = dtrace_invop_hdlr, *prev = NULL; Modified: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Sun Apr 17 23:08:47 2016 (r298171) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); extern dtrace_id_t dtrace_probeid_error; -int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); typedef struct dtrace_invop_hdlr { int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); @@ -58,7 +58,7 @@ typedef struct dtrace_invop_hdlr { dtrace_invop_hdlr_t *dtrace_invop_hdlr; int -dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax) +dtrace_invop(uintptr_t addr, struct trapframe *stack, uintptr_t eax) { dtrace_invop_hdlr_t *hdlr; int rval; Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Sun Apr 17 23:08:47 2016 (r298171) @@ -51,32 +51,32 @@ extern int (*dtrace_invop_jump_addr)(str extern void dtrace_getnanotime(struct timespec *tsp); -int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); void dtrace_invop_init(void); void dtrace_invop_uninit(void); typedef struct dtrace_invop_hdlr { - int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); struct dtrace_invop_hdlr *dtih_next; } dtrace_invop_hdlr_t; dtrace_invop_hdlr_t *dtrace_invop_hdlr; int -dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t arg0) +dtrace_invop(uintptr_t addr, struct trapframe *frame, uintptr_t arg0) { dtrace_invop_hdlr_t *hdlr; int rval; for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) - if ((rval = hdlr->dtih_func(addr, stack, arg0)) != 0) + if ((rval = hdlr->dtih_func(addr, frame, arg0)) != 0) return (rval); return (0); } void -dtrace_invop_add(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_add(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr; @@ -87,7 +87,7 @@ dtrace_invop_add(int (*func)(uintptr_t, } void -dtrace_invop_remove(int (*func)(uintptr_t, uintptr_t *, uintptr_t)) +dtrace_invop_remove(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { dtrace_invop_hdlr_t *hdlr = dtrace_invop_hdlr, *prev = NULL; @@ -326,7 +326,8 @@ dtrace_probe_error(dtrace_state_t *state static int dtrace_invop_start(struct trapframe *frame) { - switch (dtrace_invop(frame->srr0, (uintptr_t *)frame, frame->fixreg[3])) { + + switch (dtrace_invop(frame->srr0, frame, frame->fixreg[3])) { case DTRACE_INVOP_JUMP: break; case DTRACE_INVOP_BCTR: @@ -341,9 +342,7 @@ dtrace_invop_start(struct trapframe *fra break; default: return (-1); - break; } - return (0); } Modified: head/sys/cddl/dev/fbt/aarch64/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/aarch64/fbt_isa.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/fbt/aarch64/fbt_isa.c Sun Apr 17 23:08:47 2016 (r298171) @@ -46,13 +46,11 @@ #define FBT_RETURN "return" int -fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval) +fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) { - struct trapframe *frame; solaris_cpu_t *cpu; fbt_probe_t *fbt; - frame = (struct trapframe *)stack; cpu = &solaris_cpu[curcpu]; fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/arm/fbt_isa.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Sun Apr 17 23:08:47 2016 (r298171) @@ -49,9 +49,8 @@ #define FBT_RETURN "return" int -fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval) +fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) { - struct trapframe *frame = (struct trapframe *)stack; solaris_cpu_t *cpu = &solaris_cpu[curcpu]; fbt_probe_t *fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; register_t fifthparam; Modified: head/sys/cddl/dev/fbt/fbt.h ============================================================================== --- head/sys/cddl/dev/fbt/fbt.h Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/fbt/fbt.h Sun Apr 17 23:08:47 2016 (r298171) @@ -51,8 +51,9 @@ typedef struct fbt_probe { struct linker_file; struct linker_symval; +struct trapframe; -int fbt_invop(uintptr_t, uintptr_t *, uintptr_t); +int fbt_invop(uintptr_t, struct trapframe *, uintptr_t); void fbt_patch_tracepoint(fbt_probe_t *, fbt_patchval_t); int fbt_provide_module_function(struct linker_file *, int, struct linker_symval *, void *); Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Sun Apr 17 23:08:47 2016 (r298171) @@ -51,9 +51,8 @@ #define FBT_AFRAMES 7 int -fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval) +fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) { - struct trapframe *frame = (struct trapframe *)stack; solaris_cpu_t *cpu = &solaris_cpu[curcpu]; fbt_probe_t *fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; uintptr_t tmp; Modified: head/sys/cddl/dev/fbt/x86/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/x86/fbt_isa.c Sun Apr 17 23:02:49 2016 (r298170) +++ head/sys/cddl/dev/fbt/x86/fbt_isa.c Sun Apr 17 23:08:47 2016 (r298171) @@ -58,16 +58,40 @@ #define FBT_RETURN "return" int -fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval) +fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) { - solaris_cpu_t *cpu = &solaris_cpu[curcpu]; - uintptr_t stack0, stack1, stack2, stack3, stack4; - fbt_probe_t *fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; + solaris_cpu_t *cpu; + uintptr_t *stack; + uintptr_t arg0, arg1, arg2, arg3, arg4; + fbt_probe_t *fbt; +#ifdef __amd64__ + stack = (uintptr_t *)frame->tf_rsp; +#else + /* Skip hardware-saved registers. */ + stack = (uintptr_t *)frame->tf_isp + 3; +#endif + + cpu = &solaris_cpu[curcpu]; + fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { if ((uintptr_t)fbt->fbtp_patchpoint == addr) { if (fbt->fbtp_roffset == 0) { +#ifdef __amd64__ + /* fbt->fbtp_rval == DTRACE_INVOP_PUSHQ_RBP */ + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); + cpu->cpu_dtrace_caller = stack[0]; + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | + CPU_DTRACE_BADADDR); + + arg0 = frame->tf_rdi; + arg1 = frame->tf_rsi; + arg2 = frame->tf_rdx; + arg3 = frame->tf_rcx; + arg4 = frame->tf_r8; +#else int i = 0; + /* * When accessing the arguments on the stack, * we must protect against accessing beyond @@ -77,16 +101,17 @@ fbt_invop(uintptr_t addr, uintptr_t *sta */ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); cpu->cpu_dtrace_caller = stack[i++]; - stack0 = stack[i++]; - stack1 = stack[i++]; - stack2 = stack[i++]; - stack3 = stack[i++]; - stack4 = stack[i++]; + arg0 = stack[i++]; + arg1 = stack[i++]; + arg2 = stack[i++]; + arg3 = stack[i++]; + arg4 = stack[i++]; DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR); +#endif - dtrace_probe(fbt->fbtp_id, stack0, stack1, - stack2, stack3, stack4); + dtrace_probe(fbt->fbtp_id, arg0, arg1, + arg2, arg3, arg4); cpu->cpu_dtrace_caller = 0; } else { @@ -94,7 +119,7 @@ fbt_invop(uintptr_t addr, uintptr_t *sta /* * On amd64, we instrument the ret, not the * leave. We therefore need to set the caller - * to assure that the top frame of a stack() + * to ensure that the top frame of a stack() * action is correct. */ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); From owner-svn-src-all@freebsd.org Sun Apr 17 23:10:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ABC2B11F41; Sun, 17 Apr 2016 23:10:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B98211D1; Sun, 17 Apr 2016 23:10:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HNA933007091; Sun, 17 Apr 2016 23:10:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HNA94p007090; Sun, 17 Apr 2016 23:10:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604172310.u3HNA94p007090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Apr 2016 23:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298172 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 23:10:10 -0000 Author: markj Date: Sun Apr 17 23:10:09 2016 New Revision: 298172 URL: https://svnweb.freebsd.org/changeset/base/298172 Log: Fix the description of the first two arguments to proc:::create. Reported by: Matt C Modified: head/share/man/man4/dtrace_proc.4 Modified: head/share/man/man4/dtrace_proc.4 ============================================================================== --- head/share/man/man4/dtrace_proc.4 Sun Apr 17 23:08:47 2016 (r298171) +++ head/share/man/man4/dtrace_proc.4 Sun Apr 17 23:10:09 2016 (r298172) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2015 +.Dd April 17, 2016 .Dt DTRACE_PROC 4 .Os .Sh NAME @@ -59,7 +59,7 @@ In particular, kernel processes created KPI will not trigger this probe. The .Fn proc:::create -probe's first two arguments are the parent process and new child process, +probe's first two arguments are the new child process and its parent, respectively. The third argument is a mask of .Xr rfork 2 From owner-svn-src-all@freebsd.org Sun Apr 17 23:22:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED256B1247D; Sun, 17 Apr 2016 23:22:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B950C1B03; Sun, 17 Apr 2016 23:22:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3HNMWR2012821; Sun, 17 Apr 2016 23:22:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3HNMWdm012820; Sun, 17 Apr 2016 23:22:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604172322.u3HNMWdm012820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Apr 2016 23:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298173 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 23:22:34 -0000 Author: markj Date: Sun Apr 17 23:22:32 2016 New Revision: 298173 URL: https://svnweb.freebsd.org/changeset/base/298173 Log: Use a loop instead of a goto in sysctl_kern_proc_kstack(). MFC after: 3 days Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Apr 17 23:10:09 2016 (r298172) +++ head/sys/kern/kern_proc.c Sun Apr 17 23:22:32 2016 (r298173) @@ -2534,10 +2534,8 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_A st = stack_create(); lwpidarray = NULL; - numthreads = 0; PROC_LOCK(p); -repeat: - if (numthreads < p->p_numthreads) { + do { if (lwpidarray != NULL) { free(lwpidarray, M_TEMP); lwpidarray = NULL; @@ -2547,9 +2545,7 @@ repeat: lwpidarray = malloc(sizeof(*lwpidarray) * numthreads, M_TEMP, M_WAITOK | M_ZERO); PROC_LOCK(p); - goto repeat; - } - i = 0; + } while (numthreads < p->p_numthreads); /* * XXXRW: During the below loop, execve(2) and countless other sorts @@ -2560,6 +2556,7 @@ repeat: * have changed, in which case the right to extract debug info might * no longer be assured. */ + i = 0; FOREACH_THREAD_IN_PROC(p, td) { KASSERT(i < numthreads, ("sysctl_kern_proc_kstack: numthreads")); From owner-svn-src-all@freebsd.org Mon Apr 18 00:26:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62A65AEE64A; Mon, 18 Apr 2016 00:26:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A73C1257; Mon, 18 Apr 2016 00:26:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I0QBYP030824; Mon, 18 Apr 2016 00:26:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I0QB6f030823; Mon, 18 Apr 2016 00:26:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604180026.u3I0QB6f030823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 18 Apr 2016 00:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298174 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 00:26:12 -0000 Author: adrian Date: Mon Apr 18 00:26:11 2016 New Revision: 298174 URL: https://svnweb.freebsd.org/changeset/base/298174 Log: [net80211] put in a comment about the not-quite-correctness of A-MPDU parameters. Although we correctly (now!) calculate the right A-MPDU parameters, the ioctl() has some faulty logic for choosing which to display. The BSS params are what were advertised to us, and we would have chosen the lower of theirs/ours when advertising the HT bits back at them. So, we /should/ track and fix that so we display the correct A-MPDU density and size. However, since I'm a forgetful type, and I don't want to have to re-learn that this is wrong, drop in a comment so I or someone else fixes it. Or, when I discover this again in 4 years, I don't have to go digging too much to remember. Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Apr 17 23:22:32 2016 (r298173) +++ head/sys/net80211/ieee80211_ioctl.c Mon Apr 18 00:26:11 2016 (r298174) @@ -1020,6 +1020,10 @@ ieee80211_ioctl_get80211(struct ieee8021 if (vap->iv_opmode == IEEE80211_M_HOSTAP) ireq->i_val = vap->iv_ampdu_rxmax; else if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) + /* + * XXX TODO: this isn't completely correct, as we've + * negotiated the higher of the two. + */ ireq->i_val = MS(vap->iv_bss->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); else @@ -1028,6 +1032,10 @@ ieee80211_ioctl_get80211(struct ieee8021 case IEEE80211_IOC_AMPDU_DENSITY: if (vap->iv_opmode == IEEE80211_M_STA && (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP)) + /* + * XXX TODO: this isn't completely correct, as we've + * negotiated the higher of the two. + */ ireq->i_val = MS(vap->iv_bss->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); else From owner-svn-src-all@freebsd.org Mon Apr 18 00:28:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4634AAEE705; Mon, 18 Apr 2016 00:28:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1780613DC; Mon, 18 Apr 2016 00:28:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I0SP1s030944; Mon, 18 Apr 2016 00:28:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I0SPkl030943; Mon, 18 Apr 2016 00:28:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604180028.u3I0SPkl030943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 18 Apr 2016 00:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298175 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 00:28:26 -0000 Author: adrian Date: Mon Apr 18 00:28:25 2016 New Revision: 298175 URL: https://svnweb.freebsd.org/changeset/base/298175 Log: [urtwn] default to announcing RX 64K aggregates. Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Mon Apr 18 00:26:11 2016 (r298174) +++ head/sys/dev/urtwn/if_urtwn.c Mon Apr 18 00:28:25 2016 (r298175) @@ -794,6 +794,7 @@ urtwn_vap_create(struct ieee80211com *ic /* 802.11n parameters */ vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_16; + vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K; if (opmode == IEEE80211_M_IBSS) { uvp->recv_mgmt = vap->iv_recv_mgmt; From owner-svn-src-all@freebsd.org Mon Apr 18 02:36:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81DE2B12A9A; Mon, 18 Apr 2016 02:36:50 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A73F14F0; Mon, 18 Apr 2016 02:36:50 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I2anw1069690; Mon, 18 Apr 2016 02:36:49 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I2anpU069689; Mon, 18 Apr 2016 02:36:49 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201604180236.u3I2anpU069689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Mon, 18 Apr 2016 02:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298176 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 02:36:50 -0000 Author: wblock (doc committer) Date: Mon Apr 18 02:36:49 2016 New Revision: 298176 URL: https://svnweb.freebsd.org/changeset/base/298176 Log: Add the kern.vt.enable_bell sysctl, which was not documented previously. Minor additional punctuation and wording changes. PR: 208785 Submitted by: david.marec@davenulle.org MFC after: 1 week Modified: head/share/man/man4/vt.4 Modified: head/share/man/man4/vt.4 ============================================================================== --- head/share/man/man4/vt.4 Mon Apr 18 00:28:25 2016 (r298175) +++ head/share/man/man4/vt.4 Mon Apr 18 02:36:49 2016 (r298176) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2014 +.Dd April 17, 2016 .Dt "VIRTUAL TERMINALS" 4 .Os .Sh NAME @@ -56,6 +56,7 @@ In .Cd kern.vt.kbd_reboot=1 .Cd kern.vt.kbd_debug=1 .Cd kern.vt.kbd_panic=0 +.Cd kern.vt.enable_bell=1 .Sh DESCRIPTION The .Nm @@ -122,7 +123,7 @@ driver. .Bl -tag -width MAXCONS .It Dv TERMINAL_NORM_ATTR= Ns Pa attribute .It Dv TERMINAL_KERN_ATTR= Ns Pa attribute -These options allow changing the default colors used for normal and kernel +These options change the default colors used for normal and kernel text. Available colors are defined in .In sys/terminal.h . @@ -212,14 +213,15 @@ backend. The mode is applied to all output connectors. This is currently only supported by the .Cm vt_fb -backend when it's paired with a KMS video driver. +backend when it is paired with a KMS video driver. .It Va kern.vt.fb.modes. Ns Pa connector_name Set this value to a graphic mode to override the default mode picked by the .Nm backend. This mode is applied to the output connector .Pa connector_name -only. It has precedence over +only. +It has precedence over .Va kern.vt.fb.default_mode . The names of available connector names can be found in .Xr dmesg 8 @@ -227,7 +229,7 @@ after loading the KMS driver. It will contain a list of connectors and their associated tunables. This is currently only supported by the .Cm vt_fb -backend when it's paired with a KMS video driver. +backend when it is paired with a KMS video driver. .El .Sh KEYBOARD SYSCTL TUNABLES These settings control whether certain special key combinations are enabled or @@ -255,6 +257,17 @@ Enable debug request key combination, us .It Va kern.vt.kbd_panic Enable panic key combination. .El +.Sh OTHER SYSCTL TUNABLES +These settings can be entered at the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +or changed at runtime with +.Xr sysctl 8 . +.Bl -tag -width indent +.It Va kern.vt.enable_bell +Enable the terminal bell. +.El .Sh FILES .Bl -tag -width /usr/share/vt/keymaps/* -compact .It Pa /dev/console From owner-svn-src-all@freebsd.org Mon Apr 18 03:44:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 661D1B12181; Mon, 18 Apr 2016 03:44:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37B9E195C; Mon, 18 Apr 2016 03:44:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I3igYT091083; Mon, 18 Apr 2016 03:44:42 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I3igvm091082; Mon, 18 Apr 2016 03:44:42 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180344.u3I3igvm091082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 03:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298177 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 03:44:43 -0000 Author: araujo Date: Mon Apr 18 03:44:42 2016 New Revision: 298177 URL: https://svnweb.freebsd.org/changeset/base/298177 Log: Use nitems instead of 'sizeof(mapnames) / sizeof(mapnames[0]'. Modified: head/usr.sbin/ypldap/yp.c Modified: head/usr.sbin/ypldap/yp.c ============================================================================== --- head/usr.sbin/ypldap/yp.c Mon Apr 18 02:36:49 2016 (r298176) +++ head/usr.sbin/ypldap/yp.c Mon Apr 18 03:44:42 2016 (r298177) @@ -597,14 +597,14 @@ ypproc_maplist_2_svc(domainname *arg, st { "netid.byname", YPMAP_NETID_BYNAME }, }; static ypresp_maplist res; - static struct ypmaplist maps[sizeof(mapnames) / sizeof(mapnames[0])]; + static struct ypmaplist maps[nitems(mapnames)]; if (yp_valid_domain(*arg, (struct ypresp_val *)&res) == -1) return (&res); res.stat = YP_TRUE; res.maps = NULL; - for (i = 0; i < sizeof(mapnames) / sizeof(mapnames[0]); i++) { + for (i = 0; i < nitems(mapnames); i++) { if (!(env->sc_flags & mapnames[i].cond)) continue; maps[i].map = mapnames[i].name; From owner-svn-src-all@freebsd.org Mon Apr 18 04:43:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8955CB11314; Mon, 18 Apr 2016 04:43:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49CC71EBE; Mon, 18 Apr 2016 04:43:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I4h5Eq009040; Mon, 18 Apr 2016 04:43:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I4h4Pa009026; Mon, 18 Apr 2016 04:43:04 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201604180443.u3I4h4Pa009026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 18 Apr 2016 04:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298178 - in vendor/file/dist: . doc magic magic/Magdir python src X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 04:43:06 -0000 Author: delphij Date: Mon Apr 18 04:43:03 2016 New Revision: 298178 URL: https://svnweb.freebsd.org/changeset/base/298178 Log: Vendor import of file 4.26. Added: vendor/file/dist/magic/Magdir/bioinformatics vendor/file/dist/magic/Magdir/coff vendor/file/dist/magic/Magdir/der vendor/file/dist/magic/Magdir/finger vendor/file/dist/magic/Magdir/flif vendor/file/dist/magic/Magdir/microfocus vendor/file/dist/magic/Magdir/polyml vendor/file/dist/magic/Magdir/vacuum-cleaner vendor/file/dist/src/der.c (contents, props changed) vendor/file/dist/src/der.h (contents, props changed) vendor/file/dist/src/dprintf.c (contents, props changed) Modified: vendor/file/dist/ChangeLog vendor/file/dist/README vendor/file/dist/config.h.in vendor/file/dist/configure vendor/file/dist/configure.ac vendor/file/dist/doc/file.man vendor/file/dist/doc/libmagic.man vendor/file/dist/magic/Magdir/android vendor/file/dist/magic/Magdir/animation vendor/file/dist/magic/Magdir/apple vendor/file/dist/magic/Magdir/archive vendor/file/dist/magic/Magdir/audio vendor/file/dist/magic/Magdir/c-lang vendor/file/dist/magic/Magdir/cafebabe vendor/file/dist/magic/Magdir/commands vendor/file/dist/magic/Magdir/compress vendor/file/dist/magic/Magdir/console vendor/file/dist/magic/Magdir/database vendor/file/dist/magic/Magdir/filesystems vendor/file/dist/magic/Magdir/fonts vendor/file/dist/magic/Magdir/fortran vendor/file/dist/magic/Magdir/hitachi-sh vendor/file/dist/magic/Magdir/images vendor/file/dist/magic/Magdir/intel vendor/file/dist/magic/Magdir/java vendor/file/dist/magic/Magdir/lisp vendor/file/dist/magic/Magdir/mach vendor/file/dist/magic/Magdir/macintosh vendor/file/dist/magic/Magdir/misctools vendor/file/dist/magic/Magdir/modem vendor/file/dist/magic/Magdir/msdos vendor/file/dist/magic/Magdir/msvc vendor/file/dist/magic/Magdir/msx vendor/file/dist/magic/Magdir/netbsd vendor/file/dist/magic/Magdir/psdbms vendor/file/dist/magic/Magdir/python vendor/file/dist/magic/Magdir/sendmail vendor/file/dist/magic/Magdir/sgml vendor/file/dist/magic/Magdir/sinclair vendor/file/dist/magic/Magdir/sql vendor/file/dist/magic/Magdir/terminfo vendor/file/dist/magic/Magdir/windows vendor/file/dist/magic/Magdir/wordprocessors vendor/file/dist/magic/Makefile.am vendor/file/dist/magic/Makefile.in vendor/file/dist/python/README vendor/file/dist/python/magic.py vendor/file/dist/python/setup.py vendor/file/dist/src/Makefile.am vendor/file/dist/src/Makefile.in vendor/file/dist/src/apprentice.c vendor/file/dist/src/ascmagic.c vendor/file/dist/src/compress.c vendor/file/dist/src/file.c vendor/file/dist/src/file.h vendor/file/dist/src/file_opts.h vendor/file/dist/src/fmtcheck.c vendor/file/dist/src/funcs.c vendor/file/dist/src/magic.c vendor/file/dist/src/magic.h vendor/file/dist/src/print.c vendor/file/dist/src/readcdf.c vendor/file/dist/src/readelf.c vendor/file/dist/src/readelf.h vendor/file/dist/src/softmagic.c Modified: vendor/file/dist/ChangeLog ============================================================================== --- vendor/file/dist/ChangeLog Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/ChangeLog Mon Apr 18 04:43:03 2016 (r298178) @@ -1,3 +1,49 @@ +2016-04-16 18:34 Christos Zoulas + + * release 5.25 + +2016-03-31 13:50 Christos Zoulas + + * make the number of bytes read from files configurable. + +2016-03-21 13:40 Christos Zoulas + + * Add bounds checks for DER code (discovered by Thomas Jarosch) + * Change indirect recursion limit to indirect use count and + bump from 15 to 50 to prevent abuse. + +2016-03-13 20:39 Christos Zoulas + + * Add -00 which prints filename\0description\0 + +2016-03-01 13:28 Christos Zoulas + + * Fix ID3 indirect parsing + +2016-01-19 10:18 Christos Zoulas + + * add DER parsing capability + +2015-11-13 10:35 Christos Zoulas + + * provide dprintf(3) for the OS's that don't have it. + +2015-11-11 16:25 Christos Zoulas + + * redo the compression code report decompression errors + +2015-11-10 23:25 Christos Zoulas + + * REG_STARTEND code is not working as expected, delete it. + +2015-11-09 16:05 Christos Zoulas + + * Add zlib support if we have it. + +2015-11-05 11:22 Christos Zoulas + + * PR/492: compression forking was broken with magic_buffer. + 2015-09-16 9:50 Christos Zoulas * release 5.25 Modified: vendor/file/dist/README ============================================================================== --- vendor/file/dist/README Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/README Mon Apr 18 04:43:03 2016 (r298178) @@ -1,6 +1,6 @@ ## README for file(1) Command ## - @(#) $File: README,v 1.49 2015/01/02 20:23:04 christos Exp $ + @(#) $File: README,v 1.50 2016/04/16 22:40:54 christos Exp $ Mailing List: file@mx.gw.com Mailing List archives: http://mx.gw.com/pipermail/file/ @@ -67,17 +67,41 @@ in magic(5) format please, to the mainta COPYING - read this first. README - read this second (you are currently reading this file). INSTALL - read on how to install +src/localtime_r.c +src/magic.c +src/magic.h +src/mygetopt.h +src/newtest2.c +src/newtest3.c +src/pread.c +src/print.c +src/readcdf.c +src/readelf.c +src/readelf.h +src/regex.c +src/regex2.c +src/softmagic.c +src/strcasestr.c +src/strlcat.c +src/strlcpy.c +src/strndup.c +src/tar.h +src/teststrchr.c +src/vasprintf.c +src/x.c src/apprentice.c - parses /etc/magic to learn magic -src/asctime_r.c - replacement for OS's that don't have it. src/apptype.c - used for OS/2 specific application type magic -src/asprintf.c - replacement for OS's that don't have it. src/ascmagic.c - third & last set of tests, based on hardwired assumptions. src/asctime_r.c - replacement for OS's that don't have it. src/asprintf.c - replacement for OS's that don't have it. +src/asctime_r.c - replacement for OS's that don't have it. +src/asprintf.c - replacement for OS's that don't have it. src/cdf.[ch] - parser for Microsoft Compound Document Files src/cdf_time.c - time converter for CDF. src/compress.c - handles decompressing files to look inside. src/ctime_r.c - replacement for OS's that don't have it. +src/der.[ch] - parser for Distinguished Encoding Rules +src/dprintf.c - replacement for OS's that don't have it. src/elfclass.h - common code for elf 32/64. src/encoding.c - handles unicode encodings src/file.c - the main program @@ -88,10 +112,13 @@ src/fsmagic.c - first set of tests the p src/funcs.c - utilility functions src/getline.c - replacement for OS's that don't have it. src/getopt_long.c - replacement for OS's that don't have it. -src/is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore). -src/names.h - header file for ascmagic.c +src/gmtime_r.c - replacement for OS's that don't have it. +src/is_tar.c, tar.h - knows about Tape ARchive format (courtesy John Gilmore). +src/localtime_r.c - replacement for OS's that don't have it. src/magic.h.in - source file for magic.h +src/mygetopt.h - replacement for OS's that don't have it. src/magic.c - the libmagic api +src/names.h - header file for ascmagic.c src/pread.c - replacement for OS's that don't have it. src/print.c - print results, errors, warnings. src/readcdf.c - CDF wrapper. Modified: vendor/file/dist/config.h.in ============================================================================== --- vendor/file/dist/config.h.in Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/config.h.in Mon Apr 18 04:43:03 2016 (r298178) @@ -32,6 +32,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `dprintf' function. */ +#undef HAVE_DPRINTF + /* Define to 1 if you have the header file. */ #undef HAVE_ERR_H Modified: vendor/file/dist/configure ============================================================================== --- vendor/file/dist/configure Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/configure Mon Apr 18 04:43:03 2016 (r298178) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.25. +# Generated by GNU Autoconf 2.69 for file 5.26. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.25' -PACKAGE_STRING='file 5.25' +PACKAGE_VERSION='5.26' +PACKAGE_STRING='file 5.26' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.25 to adapt to many kinds of systems. +\`configure' configures file 5.26 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.25:";; + short | recursive ) echo "Configuration of file 5.26:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.25 +file configure 5.26 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.25, which was +It was created by file $as_me 5.26, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.25' + VERSION='5.26' cat >>confdefs.h <<_ACEOF @@ -14385,6 +14385,19 @@ esac fi +ac_fn_c_check_func "$LINENO" "dprintf" "ac_cv_func_dprintf" +if test "x$ac_cv_func_dprintf" = xyes; then : + $as_echo "#define HAVE_DPRINTF 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" dprintf.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dprintf.$ac_objext" + ;; +esac + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 @@ -15036,7 +15049,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.25, which was +This file was extended by file $as_me 5.26, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15102,7 +15115,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.25 +file config.status 5.26 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/file/dist/configure.ac ============================================================================== --- vendor/file/dist/configure.ac Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/configure.ac Mon Apr 18 04:43:03 2016 (r298178) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.25],[christos@astron.com]) +AC_INIT([file],[5.26],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -145,7 +145,7 @@ dnl Checks for functions AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale) dnl Provide implementation of some required functions if necessary -AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck) +AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf) dnl Checks for libraries AC_CHECK_LIB(z,gzopen) Modified: vendor/file/dist/doc/file.man ============================================================================== --- vendor/file/dist/doc/file.man Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/doc/file.man Mon Apr 18 04:43:03 2016 (r298178) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.118 2015/09/11 17:24:09 christos Exp $ -.Dd September 11, 2015 +.\" $File: file.man,v 1.120 2016/03/31 17:51:12 christos Exp $ +.Dd March 13, 2016 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -317,6 +317,7 @@ Set various parameter limits. .It Li elf_phnum Ta 128 Ta max ELF program sections processed .It Li elf_shnum Ta 32768 Ta max ELF sections processed .It Li regex Ta 8192 Ta length limit for regex searches +.It Li bytes Ta 1048576 Ta max number of bytes to read from file .El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. @@ -358,6 +359,11 @@ Nice to .Xr cut 1 the output. This does not affect the separator, which is still printed. +.Pp +If this option is repeated more than once, then +.Nm +prints just the filename followed by a NUL followed by the description +(or ERROR: text) followed by a second NUL for each entry. .It Fl -help Print a help message and exit. .El Modified: vendor/file/dist/doc/libmagic.man ============================================================================== --- vendor/file/dist/doc/libmagic.man Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/doc/libmagic.man Mon Apr 18 04:43:03 2016 (r298178) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.38 2015/09/11 17:24:09 christos Exp $ +.\" $File: libmagic.man,v 1.40 2016/03/31 17:51:12 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -225,7 +225,7 @@ It returns 0 on success and \-1 on failu .Pp The .Fn magic_compile -function can be used to compile the the colon +function can be used to compile the colon separated list of database files passed in as .Ar filename , or @@ -251,7 +251,7 @@ for the default database. .Pp The .Fn magic_load -function must be used to load the the colon +function must be used to load the colon separated list of database files passed in as .Ar filename , or @@ -282,7 +282,7 @@ The .Fn magic_getparam and .Fn magic_setparam -allow getting and setting various limits related to the the magic +allow getting and setting various limits related to the magic library. .Bl -column "MAGIC_PARAM_ELF_PHNUM_MAX" "size_t" "Default" -offset indent .It Sy "Parameter" Ta Sy "Type" Ta Sy "Default" @@ -292,6 +292,7 @@ library. .It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128 .It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768 .It Li MAGIC_PARAM_REGEX_MAX Ta size_t Ta 8192 +.It Li MAGIC_PARAM_BYTES_MAX Ta size_t Ta 1048576 .El .Pp The Modified: vendor/file/dist/magic/Magdir/android ============================================================================== --- vendor/file/dist/magic/Magdir/android Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/magic/Magdir/android Mon Apr 18 04:43:03 2016 (r298178) @@ -1,6 +1,6 @@ #------------------------------------------------------------ -# $File: android,v 1.8 2015/03/19 18:04:37 christos Exp $ +# $File: android,v 1.9 2016/01/11 21:19:18 christos Exp $ # Various android related magic entries #------------------------------------------------------------ @@ -128,7 +128,7 @@ # partition size in blocks ? #>>>>0x22 ulelong x \b*%d -# Android bootimg format +# Android sparse img format # From https://android.googlesource.com/\ # platform/system/core/+/master/libsparse/sparse_format.h 0 lelong 0xed26ff3a Android sparse image Modified: vendor/file/dist/magic/Magdir/animation ============================================================================== --- vendor/file/dist/magic/Magdir/animation Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/magic/Magdir/animation Mon Apr 18 04:43:03 2016 (r298178) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: animation,v 1.56 2014/10/23 23:12:51 christos Exp $ +# $File: animation,v 1.57 2015/11/29 22:11:07 christos Exp $ # animation: file(1) magic for animation/movie formats # # animation formats @@ -76,6 +76,8 @@ >8 string da2b \b, DMB MAF, ext da2a, with 3GPP timed text, DID, TVA, REL, IPMP >8 string da3a \b, DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images >8 string da3b \b, DMB MAF, ext da3a w/ BIFS, 3GPP, DID, TVA, REL, IPMP +>8 string dash \b, MPEG v4 system, Dynamic Adaptive Streaming over HTTP +!:mime video/mp4 >8 string dmb1 \b, DMB MAF supporting all the components defined in the spec >8 string dmpf \b, Digital Media Project >8 string drc1 \b, Dirac (wavelet compression), encap in ISO base media (MP4) Modified: vendor/file/dist/magic/Magdir/apple ============================================================================== --- vendor/file/dist/magic/Magdir/apple Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/magic/Magdir/apple Mon Apr 18 04:43:03 2016 (r298178) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: apple,v 1.31 2015/08/29 07:10:35 christos Exp $ +# $File: apple,v 1.32 2015/12/04 20:40:10 christos Exp $ # apple: file(1) magic for Apple file formats # 0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text @@ -65,18 +65,48 @@ # Eric Fischer # AppleWorks word processor: -# -# This matches the standard tab stops for an AppleWorks file, but if -# a file has a tab stop set in the first four columns this will fail. -# +# URL: https://en.wikipedia.org/wiki/AppleWorks +# Reference: http://www.gno.org/pub/apple2/doc/apple/filetypes/ftn.1a.xxxx +# Update: Joerg Jenderek +# NOTE: # The "O" is really the magic number, but that's so common that it's # necessary to check the tab stops that follow it to avoid false positives. - -4 string O==== AppleWorks word processor data ->85 byte&0x01 >0 \b, zoomed ->90 byte&0x01 >0 \b, paginated ->92 byte&0x01 >0 \b, with mail merge -#>91 byte x \b, left margin %d +# and/or look for unused bits of booleans bytes like zoom, paginated, mail merge +# the newer AppleWorks is from claris with extension CWK +4 string O +# test for unused bits of zoom- , paginated-boolean bytes +>84 ubequad ^0x00Fe00000000Fe00 +# look for tabstop definitions "=" no tab, "|" no tab +# "<" left tab,"^" center tab,">" right tab, "." decimal tab, +# unofficial "!" other , "\x8a" other +# official only if SFMinVers is nonzero +>>5 regex/s [=.<>|!^\x8a]{79} AppleWorks Word Processor +# AppleWorks Word Processor File (Apple II) +# ./apple (version 5.25) labeled the entry as "AppleWorks word processor data" +# application/x-appleworks is mime type for claris version with cwk extension +!:mime application/x-appleworks3 +# http://home.earthlink.net/~hughhood/appleiiworksenvoy/ +# ('p' + 1-byte ProDOS File Type + 2-byte ProDOS Aux Type') +# $70 $1A $F8 $FF is this the apple type ? +#:apple pdospøÿ +!:ext awp +# minimum version needed to read this files. SFMinVers (0 , 30~3.0 ) +>>>183 ubyte 30 3.0 +>>>183 ubyte !30 +>>>>183 ubyte !0 0x%x +# usual tabstop start sequence "=====<" +>>>5 string x \b, tabstop ruler "%6.6s" +# tabstop ruler +#>>>5 string >\0 \b, tabstops "%-79s" +# zoom switch +>>>85 byte&0x01 >0 \b, zoomed +# whether paginated +>>>90 byte&0x01 >0 \b, paginated +# contains any mail-merge commands +>>>92 byte&0x01 >0 \b, with mail merge +# left margin in 1/10 inches ( normally 0 or 10 ) +>>>91 ubyte >0 +>>>>91 ubyte x \b, %d/10 inch left margin # AppleWorks database: # Modified: vendor/file/dist/magic/Magdir/archive ============================================================================== --- vendor/file/dist/magic/Magdir/archive Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/magic/Magdir/archive Mon Apr 18 04:43:03 2016 (r298178) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.91 2015/09/16 13:49:33 christos Exp $ +# $File: archive,v 1.102 2016/01/11 20:59:24 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -246,7 +246,15 @@ # BA # TODO: idarc says "bytes 0-2 == bytes 3-5" # TTComp -0 string \0\6 TTComp archive data +# URL: http://fileformats.archiveteam.org/wiki/TTComp_archive +# Update: Joerg Jenderek +# GRR: line below is too general as it matches also Panorama database "TCDB 2003-10 demo.pan", others +0 string \0\6 +# look for first keyword of Panorama database *.pan +>12 search/261 DESIGN +# skip keyword with low entropy +>12 default x TTComp archive, binary, 4K dictionary +# (version 5.25) labeled the above entry as "TTComp archive data" # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation? 0 string ESP ESP archive data # ZPack @@ -544,55 +552,212 @@ >>0x36 string >\0 fstype %.8s # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu) -2 string -lh0- LHarc 1.x/ARX archive data [lh0] -!:mime application/x-lharc -2 string -lh1- LHarc 1.x/ARX archive data [lh1] -!:mime application/x-lharc -2 string -lz4- LHarc 1.x archive data [lz4] -!:mime application/x-lharc -2 string -lz5- LHarc 1.x archive data [lz5] -!:mime application/x-lharc +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/LHA_(file_format) +# Reference: http://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html +# +# check and display information of lharc (LHa,PMarc) file +0 name lharc-file +# check 1st character of method id like -lz4- -lh5- or -pm2- +>2 string - +# check 5th character of method id +>>6 string - +# check header level 0 1 2 3 +>>>20 ubyte <4 +# check 2nd, 3th and 4th character of method id +>>>>3 regex \^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1) \b +!:mime application/x-lzh-compressed +# creator type "LHA " +!:apple ????LHA +# display archive type name like "LHa/LZS archive data" or "LArc archive" +>>>>>2 string -lz \b +!:ext lzs +# already known -lzs- -lz4- -lz5- with old names +>>>>>>2 string -lzs LHa/LZS archive data +>>>>>>3 regex \^lz[45] LHarc 1.x archive data +# missing -lz?- with wikipedia names +>>>>>>3 regex \^lz[2378] LArc archive +# display archive type name like "LHa (2.x) archive data" +>>>>>2 string -lh \b +# already known -lh0- -lh1- -lh2- -lh3- -lh4- -lh5- -lh6- -lh7- -lhd- variants with old names +>>>>>>3 regex \^lh[01] LHarc 1.x/ARX archive data +# LHice archiver use ".ICE" as name extension instead usual one ".lzh" +# FOOBAR archiver use ".foo" as name extension instead usual one +# "Florain Orjanov's and Olga Bachetska's ARchiver" not found at the moment +>>>>>>>2 string -lh1 \b +!:ext lha/lzh/ice +>>>>>>3 regex \^lh[23d] LHa 2.x? archive data +>>>>>>3 regex \^lh[7] LHa (2.x)/LHark archive data +>>>>>>3 regex \^lh[456] LHa (2.x) archive data +>>>>>>>2 string -lh5 \b +# https://en.wikipedia.org/wiki/BIOS +# Some mainboard BIOS like Award use LHa compression. So archives with unusal extension are found like +# bios.rom , kd7_v14.bin, 1010.004, ... +!:ext lha/lzh/rom/bin +# missing -lh?- variants (Joe Jared) +>>>>>>3 regex \^lh[89a-ce] LHa (Joe Jared) archive +# UNLHA32 2.67a +>>>>>>2 string -lhx LHa (UNLHA32) archive +# lha archives with standard file name extensions ".lha" ".lzh" +>>>>>>3 regex !\^(lh1|lh5) \b +!:ext lha/lzh +# this should not happen if all -lh variants are described +>>>>>>2 default x LHa (unknown) archive +#!:ext lha +# PMarc +>>>>>3 regex \^pm[012] PMarc archive data +!:ext pma +# append method id without leading and trailing minus character +>>>>>3 string x [%3.3s] +>>>>>>0 use lharc-header +# +# check and display information of lharc header +0 name lharc-header +# header size 0x4 , 0x1b-0x61 +>0 ubyte x +# compressed data size != compressed file size +#>7 ulelong x \b, data size %d +# attribute: 0x2~?? 0x10~symlink|target 0x20~normal +#>19 ubyte x \b, 19_0x%x +# level identifier 0 1 2 3 +#>20 ubyte x \b, level %d +# time stamp +#>15 ubelong x DATE 0x%8.8x +# OS ID for level 1 +>20 ubyte 1 +# 0x20 types find for *.rom files +>>(21.b+24) ubyte <0x21 \b, 0x%x OS +# ascii type like M for MSDOS +>>(21.b+24) ubyte >0x20 \b, '%c' OS +# OS ID for level 2 +>20 ubyte 2 +#>>23 ubyte x \b, OS ID 0x%x +>>23 ubyte <0x21 \b, 0x%x OS +>>23 ubyte >0x20 \b, '%c' OS +# filename only for level 0 and 1 +>20 ubyte <2 +# length of filename +>>21 ubyte >0 \b, with +# filename +>>>21 pstring x "%s" +# +#2 string -lh0- LHarc 1.x/ARX archive data [lh0] +#!:mime application/x-lharc +2 string -lh0- +>0 use lharc-file +#2 string -lh1- LHarc 1.x/ARX archive data [lh1] +#!:mime application/x-lharc +2 string -lh1- +>0 use lharc-file +# NEW -lz2- ... -lz8- +2 string -lz2- +>0 use lharc-file +2 string -lz3- +>0 use lharc-file +2 string -lz4- +>0 use lharc-file +2 string -lz5- +>0 use lharc-file +2 string -lz7- +>0 use lharc-file +2 string -lz8- +>0 use lharc-file # [never seen any but the last; -lh4- reported in comp.compression:] -2 string -lzs- LHa/LZS archive data [lzs] -!:mime application/x-lha -2 string -lh\40- LHa 2.x? archive data [lh ] -!:mime application/x-lha -2 string -lhd- LHa 2.x? archive data [lhd] -!:mime application/x-lha -2 string -lh2- LHa 2.x? archive data [lh2] -!:mime application/x-lha -2 string -lh3- LHa 2.x? archive data [lh3] -!:mime application/x-lha -2 string -lh4- LHa (2.x) archive data [lh4] -!:mime application/x-lha -2 string -lh5- LHa (2.x) archive data [lh5] -!:mime application/x-lha -2 string -lh6- LHa (2.x) archive data [lh6] -!:mime application/x-lha -2 string -lh7- LHa (2.x)/LHark archive data [lh7] -!:mime application/x-lha ->20 byte x - header level %d +#2 string -lzs- LHa/LZS archive data [lzs] +2 string -lzs- +>0 use lharc-file +# According to wikipedia and others such a version does not exist +#2 string -lh\40- LHa 2.x? archive data [lh ] +#2 string -lhd- LHa 2.x? archive data [lhd] +2 string -lhd- +>0 use lharc-file +#2 string -lh2- LHa 2.x? archive data [lh2] +2 string -lh2- +>0 use lharc-file +#2 string -lh3- LHa 2.x? archive data [lh3] +2 string -lh3- +>0 use lharc-file +#2 string -lh4- LHa (2.x) archive data [lh4] +2 string -lh4- +>0 use lharc-file +#2 string -lh5- LHa (2.x) archive data [lh5] +2 string -lh5- +>0 use lharc-file +#2 string -lh6- LHa (2.x) archive data [lh6] +2 string -lh6- +>0 use lharc-file +#2 string -lh7- LHa (2.x)/LHark archive data [lh7] +2 string -lh7- +# !:mime application/x-lha +# >20 byte x - header level %d +>0 use lharc-file +# NEW -lh8- ... -lhe- , -lhx- +2 string -lh8- +>0 use lharc-file +2 string -lh9- +>0 use lharc-file +2 string -lha- +>0 use lharc-file +2 string -lhb- +>0 use lharc-file +2 string -lhc- +>0 use lharc-file +2 string -lhe- +>0 use lharc-file +2 string -lhx- +>0 use lharc-file # taken from idarc [JW] 2 string -lZ PUT archive data -2 string -lz LZS archive data +# already done by LHarc magics +# this should never happen if all sub types of LZS archive are identified +#2 string -lz LZS archive data 2 string -sw1- Swag archive data -# RAR archiver (Greg Roelofs, newt@uchicago.edu) -0 string Rar! RAR archive data, +0 name rar-file-header +>24 byte 15 \b, v1.5 +>24 byte 20 \b, v2.0 +>24 byte 29 \b, v4 +>15 byte 0 \b, os: MS-DOS +>15 byte 1 \b, os: OS/2 +>15 byte 2 \b, os: Win32 +>15 byte 3 \b, os: Unix +>15 byte 4 \b, os: Mac OS +>15 byte 5 \b, os: BeOS + +0 name rar-archive-header +>3 leshort&0x1ff >0 \b, flags: +>>3 leshort &0x01 ArchiveVolume +>>3 leshort &0x02 Commented +>>3 leshort &0x04 Locked +>>3 leshort &0x10 NewVolumeNaming +>>3 leshort &0x08 Solid +>>3 leshort &0x20 Authenticated +>>3 leshort &0x40 RecoveryRecordPresent +>>3 leshort &0x80 EncryptedBlockHeader +>>3 leshort &0x100 FirstVolume + +# RAR (Roshal Archive) archive +0 string Rar!\x1a\7\0 RAR archive data +!:mime application/x-rar +!:ext rar/cbr +# file header +>(0xc.l+9) byte 0x74 +>>(0xc.l+7) use rar-file-header +# subblock seems to share information with file header +>(0xc.l+9) byte 0x7a +>>(0xc.l+7) use rar-file-header +>9 byte 0x73 +>>7 use rar-archive-header + +0 string Rar!\x1a\7\1\0 RAR archive data, v5 +!:mime application/x-rar +!:ext rar + +# Very old RAR archive +# http://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf +0 string RE\x7e\x5e RAR archive data (44 byte x v%0x, ->10 byte >0 flags: ->>10 byte &0x01 Archive volume, ->>10 byte &0x02 Commented, ->>10 byte &0x04 Locked, ->>10 byte &0x08 Solid, ->>10 byte &0x20 Authenticated, ->35 byte 0 os: MS-DOS ->35 byte 1 os: OS/2 ->35 byte 2 os: Win32 ->35 byte 3 os: Unix -# some old version? idarc says: -0 string RE\x7e\x5e RAR archive data +!:ext rar/cbr # SQUISH archiver (Greg Roelofs, newt@uchicago.edu) 0 string SQSH squished archive data (Acorn RISCOS) @@ -604,9 +769,12 @@ # PKZIP multi-volume archive 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract !:mime application/zip +!:ext zip/cbz # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 0 string PK\005\006 Zip archive data (empty) +!:mime application/zip +!:ext zip/cbz 0 string PK\003\004 # Specialised zip formats which start with a member named 'mimetype' @@ -764,12 +932,24 @@ 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data # # PMA (CP/M derivative of LHA) +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/LHA_(file_format) # -2 string -pm0- PMarc archive data [pm0] -2 string -pm1- PMarc archive data [pm1] -2 string -pm2- PMarc archive data [pm2] +#2 string -pm0- PMarc archive data [pm0] +2 string -pm0- +>0 use lharc-file +#2 string -pm1- PMarc archive data [pm1] +2 string -pm1- +>0 use lharc-file +#2 string -pm2- PMarc archive data [pm2] +2 string -pm2- +>0 use lharc-file 2 string -pms- PMarc SFX archive (CP/M, DOS) +#!:mime application/x-foobar-exec +!:ext com 5 string -pc1- PopCom compressed executable (CP/M) +#!:mime application/x- +#!:ext com # From Rafael Laboissiere # The Project Revision Control System (see @@ -802,6 +982,9 @@ # Felix von Leitner 0 string d8:announce BitTorrent file !:mime application/x-bittorrent +# Durval Menezes, +0 string d13:announce-list BitTorrent file +!:mime application/x-bittorrent # Atari MSA archive - Teemu Hukkanen 0 beshort 0x0e0f Atari MSA archive data @@ -889,19 +1072,16 @@ # From "Nelson A. de Oliveira" 0 string MPQ\032 MoPaQ (MPQ) archive -# From: Dirk Jagdmann -# xar archive format: http://code.google.com/p/xar/ -0 string xar! xar archive ->6 beshort x - version %d - # From: "Nelson A. de Oliveira" # .kgb 0 string KGB_arch KGB Archiver file >10 string x with compression level %.1s # xar (eXtensible ARchiver) archive +# xar archive format: http://code.google.com/p/xar/ # From: "David Remahl" 0 string xar! xar archive +!:mime application/x-xar #>4 beshort x header size %d >6 beshort x version %d, #>8 quad x compressed TOC: %d, @@ -975,3 +1155,9 @@ >0xE08 search/7776 \x55\xAA >>&-512 indirect x \b; contains +# Google Chrome extensions +# https://developer.chrome.com/extensions/crx +# https://developer.chrome.com/extensions/hosting +0 string Cr24 Google Chrome extension +!:mime application/x-chrome-extension +>4 ulong x \b, version %u Modified: vendor/file/dist/magic/Magdir/audio ============================================================================== --- vendor/file/dist/magic/Magdir/audio Mon Apr 18 03:44:42 2016 (r298177) +++ vendor/file/dist/magic/Magdir/audio Mon Apr 18 04:43:03 2016 (r298178) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: audio,v 1.73 2015/03/15 23:21:42 christos Exp $ +# $File: audio,v 1.75 2016/02/08 17:30:11 christos Exp $ # audio: file(1) magic for sound formats (see also "iff") # # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com), @@ -585,7 +585,7 @@ 0 string SC68\ Music-file\ /\ (c)\ (BeN)jami sc68 Atari ST music # musepak support From: "Jiri Pejchal" -0 string MP+ Musepack audio +0 string MP+ Musepack audio (MP+) !:mime audio/x-musepack >3 byte 255 \b, SV pre8 >3 byte&0xF 0x6 \b, SV 6 @@ -619,6 +619,9 @@ >>27 byte 114 \b, Beta 1.14 >>27 byte 115 \b, Alpha 1.15 +0 string MPCK Musepack audio (MPCK) +!:mime audio/x-musepack + # IMY # from http://filext.com/detaillist.php?extdetail=IMY # http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm @@ -715,3 +718,41 @@ 0 string ZBOT >4 byte 0xc5 GVOX Encore music, version < 5.0 +# Summary: Garmin Voice Processing Module (WAVE audios) +# From: Joerg Jenderek +# URL: http://www.garmin.com/ +# Reference: http://turboccc.wikispaces.com/share/view/28622555 +# NOTE: there exist 2 other Garmin VPM formats +0 string AUDIMG +# skip text files starting with string "AUDIMG" +>13 ubyte <13 Garmin Voice Processing Module +!:mime audio/x-vpm-wav-garmin +!:ext vpm +# 3 bytes indicating the voice version (200,220) +>>6 string x \b, version %3.3s +# day of release (01-31) +>>12 ubyte x \b, %.2d +# month of release (01-12) +>>13 ubyte x \b.%.2d +# year of release (like 2006, 2007, 2008) +>>14 uleshort x \b.%.4d +# hour of release (0-23) +>>11 ubyte x %.2d +# minute of release (0-59) +>>10 ubyte x \b:%.2d +# second of release (0-59) +>>9 ubyte x \b:%.2d +# if you select a language like german on your garmin device +# you can only select voice modules with correponding language byte ID like 1 +>>18 ubyte x \b, language ID %d +# pointer to 1st audio WAV sample +>>16 uleshort >0 +>>>(16.s) ulelong >0 \b, at offset 0x%x +# WAV length +>>>>(16.s+4) ulelong >0 %d Bytes +# look for magic +>>>>>(&-8.l) string RIFF +# determine type by ./riff +>>>>>>&-4 indirect x \b +# 2 - ~ 131 WAV samples following same way + Added: vendor/file/dist/magic/Magdir/bioinformatics ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/file/dist/magic/Magdir/bioinformatics Mon Apr 18 04:43:03 2016 (r298178) @@ -0,0 +1,178 @@ + +#------------------------------------------------------------------------------ +# $File: bioinformatics,v 1.2 2016/02/14 15:53:53 christos Exp $ +# bioinfomatics: file(1) magic for Bioinfomatics file formats + +############################################################################### +# BGZF (Blocked GNU Zip Format) - gzip compatible, but also indexable +# used by SAMtools bgzip/tabix (http://samtools.sourceforge.net/tabix.shtml) +############################################################################### +0 string \037\213 +>3 byte &0x04 +>>12 string BC +>>>14 leshort &0x02 Blocked GNU Zip Format (BGZF; gzip compatible) +>>>>16 leshort x \b, block length %d +!:mime application/x-gzip + + +############################################################################### +# Tabix index file +# used by SAMtools bgzip/tabix (http://samtools.sourceforge.net/tabix.shtml) +############################################################################### +0 string TBI\1 SAMtools TBI (Tabix index format) +>0x04 lelong =1 \b, with %d reference sequence +>0x04 lelong >1 \b, with %d reference sequences +>0x08 lelong &0x10000 \b, using half-closed-half-open coordinates (BED style) +>0x08 lelong ^0x10000 +>>0x08 lelong =0 \b, using closed and one based coordinates (GFF style) +>>0x08 lelong =1 \b, using SAM format +>>0x08 lelong =2 \b, using VCF format +>0x0c lelong x \b, sequence name column: %d +>0x10 lelong x \b, region start column: %d +>0x08 lelong =0 +>>0x14 lelong x \b, region end column: %d +>0x18 byte x \b, comment character: %c +>0x1c lelong x \b, skip line count: %d + + +############################################################################### +# BAM (Binary Sequence Alignment/Map format) +# used by SAMtools (http://samtools.sourceforge.net/SAM1.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BAM\1 SAMtools BAM (Binary Sequence Alignment/Map) +>0x04 lelong >0 +>>&0x00 regex =^[@]HD\t.*VN: \b, with SAM header +>>>&0 regex =[0-9.]+ \b version %s +>>&(0x04) lelong >0 \b, with %d reference sequences + + +############################################################################### +# BAI (BAM indexing format) +# used by SAMtools (http://samtools.sourceforge.net/SAM1.pdf) +############################################################################### +0 string BAI\1 SAMtools BAI (BAM indexing format) +>0x04 lelong >0 \b, with %d reference sequences + + +############################################################################### +# CRAM (Binary Sequence Alignment/Map format) +############################################################################### +0 string CRAM CRAM +>0x04 byte >-1 version %d. +>0x05 byte >-1 \b%d +>0x06 string >\0 (identified as %s) + + +############################################################################### +# BCF (Binary Call Format), version 1 +# used by SAMtools & VCFtools (http://vcftools.sourceforge.net/bcf.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\4 +# length of seqnm data in bytes is positive +>&0x00 lelong >0 +# length of smpl data in bytes is positive +>>&(&-0x04) lelong >0 SAMtools BCF (Binary Call Format) +# length of meta in bytes +>>>&(&-0x04) lelong >0 +# have meta text string +>>>>&0x00 search ##samtoolsVersion= +>>>>>&0x00 string x \b, generated by SAMtools version %s + + +############################################################################### +# BCF (Binary Call Format), version 2.1 +# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\2\1 Binary Call Format (BCF) version 2.1 +# length of header text +>&0x00 lelong >0 +# have header string +>>&0x00 search ##samtoolsVersion= +>>>&0x00 string x \b, generated by SAMtools version %s + + +############################################################################### +# BCF (Binary Call Format), version 2.2 +# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\2\2 Binary Call Format (BCF) version 2.2 +# length of header text +>&0x00 lelong >0 +# have header string +>>&0x00 search ##samtoolsVersion= +>>>&0x00 string x \b, generated by SAMtools version %s + +############################################################################### +# VCF (Variant Call Format) +# used by VCFtools (http://vcftools.sourceforge.net/) +############################################################################### +0 search ##fileformat=VCFv Variant Call Format (VCF) +>&0 string x \b version %s + +############################################################################### +# FASTQ +# used by MAQ (http://maq.sourceforge.net/fastq.shtml) +############################################################################### +# XXX Broken? +# @ +#0 regex =^@[A-Za-z0-9_.:-]+\?\n +# +#>&1 regex =^[A-Za-z\n.~]++ +# +[] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Apr 18 04:43:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB019B113C2; Mon, 18 Apr 2016 04:43:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E990102E; Mon, 18 Apr 2016 04:43:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I4ho5O009103; Mon, 18 Apr 2016 04:43:50 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I4hoN0009102; Mon, 18 Apr 2016 04:43:50 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201604180443.u3I4hoN0009102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 18 Apr 2016 04:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298179 - vendor/file/5.26 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 04:43:52 -0000 Author: delphij Date: Mon Apr 18 04:43:50 2016 New Revision: 298179 URL: https://svnweb.freebsd.org/changeset/base/298179 Log: Tag file 5.26. Added: vendor/file/5.26/ - copied from r298178, vendor/file/dist/ From owner-svn-src-all@freebsd.org Mon Apr 18 05:19:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38339B12093; Mon, 18 Apr 2016 05:19:46 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A9081F7B; Mon, 18 Apr 2016 05:19:45 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I5JjSv018288; Mon, 18 Apr 2016 05:19:45 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I5JjPr018287; Mon, 18 Apr 2016 05:19:45 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180519.u3I5JjPr018287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 05:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298180 - head/usr.sbin/makefs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 05:19:46 -0000 Author: araujo Date: Mon Apr 18 05:19:45 2016 New Revision: 298180 URL: https://svnweb.freebsd.org/changeset/base/298180 Log: The malloc will return NULL if it can't allocate memory. MFC after: 2 weeks. Modified: head/usr.sbin/makefs/ffs/mkfs.c Modified: head/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- head/usr.sbin/makefs/ffs/mkfs.c Mon Apr 18 04:43:50 2016 (r298179) +++ head/usr.sbin/makefs/ffs/mkfs.c Mon Apr 18 05:19:45 2016 (r298180) @@ -492,7 +492,7 @@ ffs_mkfs(const char *fsys, const fsinfo_ iobufsize = SBLOCKSIZE + 3 * sblock.fs_bsize; else iobufsize = 4 * sblock.fs_bsize; - if ((iobuf = malloc(iobufsize)) == 0) { + if ((iobuf = malloc(iobufsize)) == NULL) { printf("Cannot allocate I/O buffer\n"); exit(38); } From owner-svn-src-all@freebsd.org Mon Apr 18 05:26:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1042DB124D3; Mon, 18 Apr 2016 05:26:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1F27148F; Mon, 18 Apr 2016 05:26:33 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I5QW60021428; Mon, 18 Apr 2016 05:26:32 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I5QWSN021426; Mon, 18 Apr 2016 05:26:32 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180526.u3I5QWSN021426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 05:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298181 - head/usr.bin/login X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 05:26:34 -0000 Author: araujo Date: Mon Apr 18 05:26:32 2016 New Revision: 298181 URL: https://svnweb.freebsd.org/changeset/base/298181 Log: Use NULL instead of 0. strtok(3) will return NULL when no more tokens remain. MFC after: 2 weeks. Modified: head/usr.bin/login/login_fbtab.c Modified: head/usr.bin/login/login_fbtab.c ============================================================================== --- head/usr.bin/login/login_fbtab.c Mon Apr 18 05:19:45 2016 (r298180) +++ head/usr.bin/login/login_fbtab.c Mon Apr 18 05:26:32 2016 (r298181) @@ -96,15 +96,15 @@ login_fbtab(char *tty, uid_t uid, gid_t while (fgets(buf, sizeof(buf), fp)) { if ((cp = strchr(buf, '#'))) *cp = 0; /* strip comment */ - if ((cp = devname = strtok(buf, WSPACE)) == 0) + if ((cp = devname = strtok(buf, WSPACE)) == NULL) continue; /* empty or comment */ if (strncmp(devname, _PATH_DEV, sizeof _PATH_DEV - 1) != 0 - || (cp = strtok(NULL, WSPACE)) == 0 + || (cp = strtok(NULL, WSPACE)) == NULL || *cp != '0' || sscanf(cp, "%o", &prot) == 0 || prot == 0 || (prot & 0777) != prot - || (cp = strtok(NULL, WSPACE)) == 0) { + || (cp = strtok(NULL, WSPACE)) == NULL) { syslog(LOG_ERR, "%s: bad entry: %s", table, cp ? cp : "(null)"); continue; } From owner-svn-src-all@freebsd.org Mon Apr 18 05:46:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E854B12B64; Mon, 18 Apr 2016 05:46:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FDA111ED; Mon, 18 Apr 2016 05:46:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I5kILM027825; Mon, 18 Apr 2016 05:46:18 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I5kImI027822; Mon, 18 Apr 2016 05:46:18 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180546.u3I5kImI027822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 05:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298182 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 05:46:19 -0000 Author: araujo Date: Mon Apr 18 05:46:18 2016 New Revision: 298182 URL: https://svnweb.freebsd.org/changeset/base/298182 Log: Use NULL instead of 0 for pointers. Also malloc will return NULL if it cannot allocate memory. MFC after: 2 weeks. Modified: head/usr.bin/netstat/inet.c head/usr.bin/netstat/sctp.c head/usr.bin/netstat/unix.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Mon Apr 18 05:26:32 2016 (r298181) +++ head/usr.bin/netstat/inet.c Mon Apr 18 05:46:18 2016 (r298182) @@ -120,7 +120,7 @@ pcblist_sysctl(int proto, const char *na xo_warn("sysctl: %s", mibvar); return (0); } - if ((buf = malloc(len)) == 0) { + if ((buf = malloc(len)) == NULL) { xo_warnx("malloc %lu bytes", (u_long)len); return (0); } @@ -207,7 +207,7 @@ pcblist_kvm(u_long off, char **bufp, int len = 2 * sizeof(xig) + (pcbinfo.ipi_count + pcbinfo.ipi_count / 8) * sizeof(struct xinpcb); - if ((buf = malloc(len)) == 0) { + if ((buf = malloc(len)) == NULL) { xo_warnx("malloc %lu bytes", (u_long)len); return (0); } @@ -1460,7 +1460,7 @@ inetname(struct in_addr *inp) if (np) cp = np->n_name; } - if (cp == 0) { + if (cp == NULL) { hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); if (hp) { cp = hp->h_name; Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Mon Apr 18 05:26:32 2016 (r298181) +++ head/usr.bin/netstat/sctp.c Mon Apr 18 05:46:18 2016 (r298182) @@ -128,7 +128,7 @@ inetname(struct in_addr *inp) if (np) cp = np->n_name; } - if (cp == 0) { + if (cp == NULL) { hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); if (hp) { cp = hp->h_name; @@ -586,7 +586,7 @@ sctp_protopr(u_long off __unused, xo_warn("sysctl: %s", mibvar); return; } - if ((buf = malloc(len)) == 0) { + if ((buf = malloc(len)) == NULL) { xo_warnx("malloc %lu bytes", (u_long)len); return; } Modified: head/usr.bin/netstat/unix.c ============================================================================== --- head/usr.bin/netstat/unix.c Mon Apr 18 05:26:32 2016 (r298181) +++ head/usr.bin/netstat/unix.c Mon Apr 18 05:46:18 2016 (r298182) @@ -83,7 +83,7 @@ pcblist_sysctl(int type, char **bufp) xo_warn("sysctl: %s", mibvar); return (-1); } - if ((buf = malloc(len)) == 0) { + if ((buf = malloc(len)) == NULL) { xo_warnx("malloc %lu bytes", (u_long)len); return (-2); } @@ -116,7 +116,7 @@ pcblist_kvm(u_long count_off, u_long gen return (-1); kread(count_off, &unp_count, sizeof(unp_count)); len = 2 * sizeof(xug) + (unp_count + unp_count / 8) * sizeof(xu); - if ((buf = malloc(len)) == 0) { + if ((buf = malloc(len)) == NULL) { xo_warnx("malloc %lu bytes", (u_long)len); return (-2); } From owner-svn-src-all@freebsd.org Mon Apr 18 06:02:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FA3B1103C; Mon, 18 Apr 2016 06:02:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB9F41A18; Mon, 18 Apr 2016 06:02:27 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I62RV4033845; Mon, 18 Apr 2016 06:02:27 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I62RLZ033844; Mon, 18 Apr 2016 06:02:27 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180602.u3I62RLZ033844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 06:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298183 - head/usr.bin/rpcgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 06:02:28 -0000 Author: araujo Date: Mon Apr 18 06:02:26 2016 New Revision: 298183 URL: https://svnweb.freebsd.org/changeset/base/298183 Log: Use NULL for pointers. strrchr(3) will return NULL if the character does not appears in the string. MFC after: 2 weeks. Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Mon Apr 18 05:46:18 2016 (r298182) +++ head/usr.bin/rpcgen/rpc_main.c Mon Apr 18 06:02:26 2016 (r298183) @@ -451,7 +451,7 @@ generate_guard(const char *pathname) char *guard, *tmp, *stopat; filename = strrchr(pathname, '/'); /* find last component */ - filename = ((filename == 0) ? pathname : filename+1); + filename = ((filename == NULL) ? pathname : filename+1); guard = xstrdup(filename); stopat = strrchr(guard, '.'); From owner-svn-src-all@freebsd.org Mon Apr 18 06:12:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2115DB11389; Mon, 18 Apr 2016 06:12:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E68821F5D; Mon, 18 Apr 2016 06:12:01 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I6C1tj034948; Mon, 18 Apr 2016 06:12:01 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I6C12j034947; Mon, 18 Apr 2016 06:12:01 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180612.u3I6C12j034947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 06:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298184 - head/usr.bin/whereis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 06:12:02 -0000 Author: araujo Date: Mon Apr 18 06:12:00 2016 New Revision: 298184 URL: https://svnweb.freebsd.org/changeset/base/298184 Log: Use NULL instead of 0 for pointers. realloc will return NULL if it cannot allocate memory. MFC after: 2 weeks. Modified: head/usr.bin/whereis/whereis.c Modified: head/usr.bin/whereis/whereis.c ============================================================================== --- head/usr.bin/whereis/whereis.c Mon Apr 18 06:02:26 2016 (r298183) +++ head/usr.bin/whereis/whereis.c Mon Apr 18 06:12:00 2016 (r298184) @@ -461,7 +461,7 @@ main(int argc, char **argv) nlen = strlen(cp); bin = realloc(bin, olen + nlen + 2); - if (bin == 0) + if (bin == NULL) abort(); strcat(bin, " "); strcat(bin, cp); @@ -535,7 +535,7 @@ main(int argc, char **argv) nlen = strlen(cp2); man = realloc(man, olen + nlen + 2); - if (man == 0) + if (man == NULL) abort(); strcat(man, " "); strcat(man, cp2); @@ -574,7 +574,7 @@ main(int argc, char **argv) nlen = strlen(cp); src = realloc(src, olen + nlen + 2); - if (src == 0) + if (src == NULL) abort(); strcat(src, " "); strcat(src, cp); @@ -643,7 +643,7 @@ main(int argc, char **argv) src = realloc(src, olen + nlen + 2); - if (src == 0) + if (src == NULL) abort(); strcat(src, " "); strcat(src, buf); From owner-svn-src-all@freebsd.org Mon Apr 18 06:15:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BF7DB114B3; Mon, 18 Apr 2016 06:15:59 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42A8A117A; Mon, 18 Apr 2016 06:15:59 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I6FwAR037070; Mon, 18 Apr 2016 06:15:58 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I6Fw19037068; Mon, 18 Apr 2016 06:15:58 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604180615.u3I6Fw19037068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Mon, 18 Apr 2016 06:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298185 - head/sys/mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 06:15:59 -0000 Author: sgalabov Date: Mon Apr 18 06:15:58 2016 New Revision: 298185 URL: https://svnweb.freebsd.org/changeset/base/298185 Log: Allow RT3350 CPU clock to be detected as part of RT3050/RT3052 detection OpenWRT's dts files treat RT3050/RT3052/RT3350 within the same SoC dtsi file, so we need to distinguish between the three dynamically, mainly because the bit we use to determine the clock speed on RT3050/RT3052 can actually be floating on RT3350 and RT3350 is always at 320MHz. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5983 Modified: head/sys/mips/mediatek/mtk_soc.c head/sys/mips/mediatek/mtk_sysctl.h Modified: head/sys/mips/mediatek/mtk_soc.c ============================================================================== --- head/sys/mips/mediatek/mtk_soc.c Mon Apr 18 06:12:00 2016 (r298184) +++ head/sys/mips/mediatek/mtk_soc.c Mon Apr 18 06:15:58 2016 (r298185) @@ -76,13 +76,17 @@ static const struct ofw_compat_data comp static uint32_t mtk_detect_cpuclk_rt305x(bus_space_tag_t bst, bus_space_handle_t bsh) { - uint32_t clk; + uint32_t val; + + val = bus_space_read_4(bst, bsh, SYSCTL_CHIPID0_3); + if (val == RT3350_CHIPID0_3) + return (MTK_CPU_CLK_320MHZ); - clk = bus_space_read_4(bst, bsh, SYSCTL_SYSCFG); - clk >>= RT305X_CPU_CLKSEL_OFF; - clk &= RT305X_CPU_CLKSEL_MSK; + val = bus_space_read_4(bst, bsh, SYSCTL_SYSCFG); + val >>= RT305X_CPU_CLKSEL_OFF; + val &= RT305X_CPU_CLKSEL_MSK; - return ((clk == 0) ? MTK_CPU_CLK_320MHZ : MTK_CPU_CLK_384MHZ); + return ((val == 0) ? MTK_CPU_CLK_320MHZ : MTK_CPU_CLK_384MHZ); } static uint32_t @@ -265,10 +269,8 @@ mtk_soc_try_early_detect(void) switch (mtk_soc_socid) { case MTK_SOC_RT3050: /* fallthrough */ case MTK_SOC_RT3052: - mtk_soc_cpuclk = mtk_detect_cpuclk_rt305x(bst, bsh); - break; case MTK_SOC_RT3350: - mtk_soc_cpuclk = MTK_CPU_CLK_320MHZ; + mtk_soc_cpuclk = mtk_detect_cpuclk_rt305x(bst, bsh); break; case MTK_SOC_RT3352: mtk_soc_cpuclk = mtk_detect_cpuclk_rt3352(bst, bsh); Modified: head/sys/mips/mediatek/mtk_sysctl.h ============================================================================== --- head/sys/mips/mediatek/mtk_sysctl.h Mon Apr 18 06:12:00 2016 (r298184) +++ head/sys/mips/mediatek/mtk_sysctl.h Mon Apr 18 06:15:58 2016 (r298185) @@ -52,6 +52,8 @@ #define SYSCFG1_USB_HOST_MODE (1<<10) +#define RT3350_CHIPID0_3 0x33335452 + extern uint32_t mtk_sysctl_get(uint32_t); extern void mtk_sysctl_set(uint32_t, uint32_t); extern void mtk_sysctl_clr_set(uint32_t, uint32_t, uint32_t); From owner-svn-src-all@freebsd.org Mon Apr 18 06:20:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13780B115EE; Mon, 18 Apr 2016 06:20:00 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 02E6F1350; Mon, 18 Apr 2016 06:19:59 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id AF86A173D8; Sun, 17 Apr 2016 23:19:58 -0700 (PDT) Date: Sun, 17 Apr 2016 23:19:58 -0700 From: hiren panchasara To: Alexander Leidinger Cc: Luiz Otavio O Souza , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298131 - head/sys/conf Message-ID: <20160418061958.GB31516@strugglingcoder.info> References: <201604162054.u3GKstrV027478@repo.freebsd.org> <20160417122012.Horde.-YvMZ5BJuIbDmwm13FS6r4f@webmail.leidinger.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Ag0ALTx5bNxCf4La" Content-Disposition: inline In-Reply-To: <20160417122012.Horde.-YvMZ5BJuIbDmwm13FS6r4f@webmail.leidinger.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 06:20:00 -0000 --Ag0ALTx5bNxCf4La Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 04/17/16 at 12:20P, Alexander Leidinger wrote: >=20 > Quoting Luiz Otavio O Souza (from Sat, 16 Apr 2016 =20 > 20:54:55 +0000 (UTC)): >=20 > > Author: loos > > Date: Sat Apr 16 20:54:55 2016 > > New Revision: 298131 > > URL: https://svnweb.freebsd.org/changeset/base/298131 > > > > Log: > > Add Codel to NOTES. >=20 > I haven't found much documentation about this. It looks like it is =20 > only available in PF, but not in dummynet. Is this correct? Are there =20 > somewhere examples for the use of codel (options/parameters/HOWTO)? I =20 > would expect in places where e.g. "red" could be used, but I don't =20 > find any mention of codel in e.g. the FreeBSD handbook. I'd also appreciate if more details on 1) how to use it 2) under what scenarios/workloads would this be most beneficial. And more importantly 3) how was this addition validated. Thank you for the work! Cheers, Hiren --Ag0ALTx5bNxCf4La Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXFHyKXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lGSUH/0K8Dck2We81S7szh9Rw7k9z 9+oIWRRfnZYUBKLl3bh3Zn+R95CnzEP93maYpGB43VthidBSRajY8CMgFwIKNURz I+O2TzBuu7F75hAv2bGnCqXNjpDqMYENMvwFjtkyQ90zPWmVnys6DpTGZ69UNlss Rw6lvS+ACvKNwuyVDpzdY+ErTi+rYcF8qVE+x7DAar/kSGJMESMdviKgeM7u3DGQ 28lE9zS7B8Zp7Jcq3SnYjlvaO6UaCK+EPPmNfUIDaNvS9HYHYJIsZF9mBIADelUu iMMJTaIyrAzJkhra1FdL1BU0WU/Wxd0TEoeUxpZvFgWoM+3Y1loU2wmjR+9brZY= =xPqD -----END PGP SIGNATURE----- --Ag0ALTx5bNxCf4La-- From owner-svn-src-all@freebsd.org Mon Apr 18 06:32:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8186DB11A6E; Mon, 18 Apr 2016 06:32:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FA2E1B43; Mon, 18 Apr 2016 06:32:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I6WO0a042974; Mon, 18 Apr 2016 06:32:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I6WO4p042973; Mon, 18 Apr 2016 06:32:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604180632.u3I6WO4p042973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 Apr 2016 06:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298186 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 06:32:25 -0000 Author: tuexen Date: Mon Apr 18 06:32:24 2016 New Revision: 298186 URL: https://svnweb.freebsd.org/changeset/base/298186 Log: Remove a left-over debug printf(). Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Apr 18 06:15:58 2016 (r298185) +++ head/sys/netinet/sctp_input.c Mon Apr 18 06:32:24 2016 (r298186) @@ -906,11 +906,6 @@ sctp_handle_shutdown(struct sctp_shutdow asoc->control_pdapi->on_strm_q); } } - printf("%s:%d End added to ctl:%p (%d)\n", - __FUNCTION__, - __LINE__, - asoc->control_pdapi, - asoc->control_pdapi->on_strm_q); asoc->control_pdapi->end_added = 1; asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; @@ -1026,11 +1021,6 @@ sctp_handle_shutdown_ack(struct sctp_shu * With a normal shutdown we assume the end of last record. */ SCTP_INP_READ_LOCK(stcb->sctp_ep); - printf("%s:%d End added to ctl:%p (%d)\n", - __FUNCTION__, - __LINE__, - asoc->control_pdapi, - asoc->control_pdapi->on_strm_q); asoc->control_pdapi->end_added = 1; asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; From owner-svn-src-all@freebsd.org Mon Apr 18 06:38:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68D5FB11B8B; Mon, 18 Apr 2016 06:38:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F2471D80; Mon, 18 Apr 2016 06:38:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I6cs7Z043232; Mon, 18 Apr 2016 06:38:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I6cs5P043229; Mon, 18 Apr 2016 06:38:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604180638.u3I6cs5P043229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 Apr 2016 06:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298187 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 06:38:55 -0000 Author: tuexen Date: Mon Apr 18 06:38:53 2016 New Revision: 298187 URL: https://svnweb.freebsd.org/changeset/base/298187 Log: Don't use anonymous unions. Modified: head/sys/netinet/sctp_header.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Mon Apr 18 06:32:24 2016 (r298186) +++ head/sys/netinet/sctp_header.h Mon Apr 18 06:38:53 2016 (r298187) @@ -160,7 +160,7 @@ struct sctp_idata { union { uint32_t protocol_id; uint32_t fsn; /* Fragment Sequence Number */ - }; + } ppid_fsn; /* user data follows */ } SCTP_PACKED; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Apr 18 06:32:24 2016 (r298186) +++ head/sys/netinet/sctp_indata.c Mon Apr 18 06:38:53 2016 (r298187) @@ -1558,7 +1558,7 @@ sctp_process_a_data_chunk(struct sctp_tc if (ch->ch.chunk_flags & SCTP_DATA_FIRST_FRAG) fsn = 0; else - fsn = ntohl(nch->dp.fsn); + fsn = ntohl(nch->dp.ppid_fsn.fsn); old_data = 0; } else { ch = (struct sctp_data_chunk *)sctp_m_getptr(*m, offset, Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Apr 18 06:32:24 2016 (r298186) +++ head/sys/netinet/sctp_output.c Mon Apr 18 06:38:53 2016 (r298187) @@ -7641,9 +7641,9 @@ dont_do_it: ndchkh->dp.reserved = htons(0); ndchkh->dp.msg_id = htonl(sp->msg_id); if (sp->fsn == 0) - ndchkh->dp.protocol_id = chk->rec.data.payloadtype; + ndchkh->dp.ppid_fsn.protocol_id = chk->rec.data.payloadtype; else - ndchkh->dp.fsn = htonl(sp->fsn); + ndchkh->dp.ppid_fsn.fsn = htonl(sp->fsn); sp->fsn++; ndchkh->ch.chunk_length = htons(chk->send_size); } From owner-svn-src-all@freebsd.org Mon Apr 18 06:58:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A00FB125B7; Mon, 18 Apr 2016 06:58:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AE5B1B24; Mon, 18 Apr 2016 06:58:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I6w7rT049385; Mon, 18 Apr 2016 06:58:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I6w7Xw049384; Mon, 18 Apr 2016 06:58:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604180658.u3I6w7Xw049384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 Apr 2016 06:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298188 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 06:58:08 -0000 Author: tuexen Date: Mon Apr 18 06:58:07 2016 New Revision: 298188 URL: https://svnweb.freebsd.org/changeset/base/298188 Log: Cleanup debug output. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Apr 18 06:38:53 2016 (r298187) +++ head/sys/netinet/sctp_indata.c Mon Apr 18 06:58:07 2016 (r298188) @@ -507,7 +507,7 @@ sctp_queue_data_to_stream(struct sctp_tc } if (SCTP_MSGID_GT((!asoc->idata_supported), strm->last_sequence_delivered, control->sinfo_ssn)) { /* The incoming sseq is behind where we last delivered? */ - SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n", + SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ: %u delivered: %u from peer, Abort association\n", control->sinfo_ssn, strm->last_sequence_delivered); protocol_error: /* @@ -571,7 +571,7 @@ protocol_error: if (control->on_strm_q == SCTP_ON_ORDERED) { TAILQ_REMOVE(&strm->inqueue, control, next_instrm); } else { - panic("Huh control:%p is on_strm_q:%d", + panic("Huh control: %p is on_strm_q: %d", control, control->on_strm_q); } control->on_strm_q = 0; @@ -612,7 +612,7 @@ protocol_error: struct mbuf *oper; snprintf(msg, sizeof(msg), - "Queue to str mid:%d duplicate", + "Queue to str msg_id: %u duplicate", control->msg_id); clean_up_control(stcb, control); oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); @@ -870,7 +870,7 @@ sctp_inject_old_data_unordered(struct sc if (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) { /* Its the very first one. */ SCTPDBG(SCTP_DEBUG_XXX, - "chunk is a first fsn:%d becomes fsn_included\n", + "chunk is a first fsn: %u becomes fsn_included\n", chk->rec.data.fsn_num); if (control->first_frag_seen) { /* @@ -1014,14 +1014,14 @@ sctp_deliver_reasm_check(struct sctp_tcb return (0); } while (control) { - SCTPDBG(SCTP_DEBUG_XXX, "Looking at control:%p e(%d) ssn:%d top_fsn:%d inc_fsn:%d -uo\n", + SCTPDBG(SCTP_DEBUG_XXX, "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u -uo\n", control, control->end_added, control->sinfo_ssn, control->top_fsn, control->fsn_included); nctl = TAILQ_NEXT(control, next_instrm); if (control->end_added) { /* We just put the last bit on */ if (control->on_strm_q) { if (control->on_strm_q != SCTP_ON_UNORDERED) { - panic("Huh control:%p on_q:%d -- not unordered?", + panic("Huh control: %p on_q: %d -- not unordered?", control, control->on_strm_q); } TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); @@ -1066,14 +1066,14 @@ done_un: */ nctl = TAILQ_NEXT(control, next_instrm); SCTPDBG(SCTP_DEBUG_XXX, - "Looking at control:%p e(%d) ssn:%d top_fsn:%d inc_fsn:%d (lastdel:%d)- o\n", + "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u (lastdel: %u)- o\n", control, control->end_added, control->sinfo_ssn, control->top_fsn, control->fsn_included, strm->last_sequence_delivered); if (control->end_added) { if (control->on_strm_q) { if (control->on_strm_q != SCTP_ON_ORDERED) { - panic("Huh control:%p on_q:%d -- not ordered?", + panic("Huh control: %p on_q: %d -- not ordered?", control, control->on_strm_q); } TAILQ_REMOVE(&strm->inqueue, control, next_instrm); @@ -1103,7 +1103,7 @@ deliver_more: next_to_del = strm->last_sequence_delivered + 1; if (control) { SCTPDBG(SCTP_DEBUG_XXX, - "Looking at control:%p e(%d) ssn:%d top_fsn:%d inc_fsn:%d (nxtdel:%d)- o\n", + "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u (nxtdel: %u)- o\n", control, control->end_added, control->sinfo_ssn, control->top_fsn, control->fsn_included, next_to_del); nctl = TAILQ_NEXT(control, next_instrm); @@ -1114,7 +1114,7 @@ deliver_more: /* We are done with it afterwards */ if (control->on_strm_q) { if (control->on_strm_q != SCTP_ON_ORDERED) { - panic("Huh control:%p on_q:%d -- not ordered?", + panic("Huh control: %p on_q: %d -- not ordered?", control, control->on_strm_q); } TAILQ_REMOVE(&strm->inqueue, control, next_instrm); @@ -1211,7 +1211,7 @@ sctp_add_chk_to_control(struct sctp_queu TAILQ_REMOVE(&strm->inqueue, control, next_instrm); control->on_strm_q = 0; } else if (control->on_strm_q) { - panic("Unknown state on ctrl:%p on_strm_q:%d", control, + panic("Unknown state on ctrl: %p on_strm_q: %d", control, control->on_strm_q); } } @@ -1288,7 +1288,7 @@ sctp_queue_data_for_reasm(struct sctp_tc if (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) { /* Its the very first one. */ SCTPDBG(SCTP_DEBUG_XXX, - "chunk is a first fsn:%d becomes fsn_included\n", + "chunk is a first fsn: %u becomes fsn_included\n", chk->rec.data.fsn_num); if (control->first_frag_seen) { /* @@ -1317,13 +1317,13 @@ sctp_queue_data_for_reasm(struct sctp_tc /* Still willing to raise highest FSN seen */ if (SCTP_TSN_GT(chk->rec.data.fsn_num, control->top_fsn)) { SCTPDBG(SCTP_DEBUG_XXX, - "We have a new top_fsn:%d\n", + "We have a new top_fsn: %u\n", chk->rec.data.fsn_num); control->top_fsn = chk->rec.data.fsn_num; } if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) { SCTPDBG(SCTP_DEBUG_XXX, - "The last fsn is now in place fsn:%d\n", + "The last fsn is now in place fsn: %u\n", chk->rec.data.fsn_num); control->last_frag_seen = 1; } @@ -1349,7 +1349,7 @@ sctp_queue_data_for_reasm(struct sctp_tc if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) { /* Second last? huh? */ SCTPDBG(SCTP_DEBUG_XXX, - "Duplicate last fsn:%d (top:%d) -- abort\n", + "Duplicate last fsn: %u (top: %u) -- abort\n", chk->rec.data.fsn_num, control->top_fsn); sctp_abort_in_reasm(stcb, strm, control, chk, abort_flag, @@ -1370,7 +1370,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * this so its a dup */ SCTPDBG(SCTP_DEBUG_XXX, - "New fsn:%d is already seen in included_fsn:%d -- abort\n", + "New fsn: %u is already seen in included_fsn: %u -- abort\n", chk->rec.data.fsn_num, control->fsn_included); sctp_abort_in_reasm(stcb, strm, control, chk, abort_flag, @@ -1384,7 +1384,7 @@ sctp_queue_data_for_reasm(struct sctp_tc */ if (SCTP_TSN_GT(chk->rec.data.fsn_num, control->top_fsn)) { SCTPDBG(SCTP_DEBUG_XXX, - "New fsn:%d is beyond or at top_fsn:%d -- abort\n", + "New fsn: %u is beyond or at top_fsn: %u -- abort\n", chk->rec.data.fsn_num, control->top_fsn); sctp_abort_in_reasm(stcb, strm, control, chk, @@ -1398,7 +1398,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * reassembly for this control. */ SCTPDBG(SCTP_DEBUG_XXX, - "chunk is a not first fsn:%d needs to be inserted\n", + "chunk is a not first fsn: %u needs to be inserted\n", chk->rec.data.fsn_num); TAILQ_FOREACH(at, &control->reasm, sctp_next) { if (SCTP_TSN_GT(at->rec.data.fsn_num, chk->rec.data.fsn_num)) { @@ -1407,7 +1407,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * one, insert the new one before at. */ SCTPDBG(SCTP_DEBUG_XXX, - "Insert it before fsn:%d\n", + "Insert it before fsn: %u\n", at->rec.data.fsn_num); asoc->size_on_reasm_queue += chk->send_size; sctp_ucount_incr(asoc->cnt_on_reasm_queue); @@ -1428,7 +1428,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * the chunk! */ SCTPDBG(SCTP_DEBUG_XXX, - "Duplicate to fsn:%d -- abort\n", + "Duplicate to fsn: %u -- abort\n", at->rec.data.fsn_num); sctp_abort_in_reasm(stcb, strm, control, chk, abort_flag, @@ -1438,7 +1438,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } if (inserted == 0) { /* Goes on the end */ - SCTPDBG(SCTP_DEBUG_XXX, "Inserting at tail of list fsn:%d\n", + SCTPDBG(SCTP_DEBUG_XXX, "Inserting at tail of list fsn: %u\n", chk->rec.data.fsn_num); asoc->size_on_reasm_queue += chk->send_size; sctp_ucount_incr(asoc->cnt_on_reasm_queue); @@ -1460,7 +1460,7 @@ sctp_queue_data_for_reasm(struct sctp_tc if (at->rec.data.fsn_num == next_fsn) { /* We can add this one now to the control */ SCTPDBG(SCTP_DEBUG_XXX, - "Adding more to control:%p at:%p fsn:%d next_fsn:%d included:%d\n", + "Adding more to control: %p at: %p fsn: %u next_fsn: %u included: %u\n", control, at, at->rec.data.fsn_num, next_fsn, control->fsn_included); @@ -1745,7 +1745,7 @@ sctp_process_a_data_chunk(struct sctp_tc SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for msg in case we have dup\n", chunk_flags); if (find_reasm_entry(strm, msg_id, ordered, old_data)) { - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x dup detected on msg_id:%d\n", + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on msg_id: %u\n", chunk_flags, msg_id); @@ -1837,7 +1837,7 @@ sctp_process_a_data_chunk(struct sctp_tc (chunk_flags & SCTP_DATA_UNORDERED) == 0 && SCTP_MSGID_GE(old_data, asoc->strmin[strmno].last_sequence_delivered, msg_id)) { /* The incoming sseq is behind where we last delivered? */ - SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ:%d delivered:%d from peer, Abort!\n", + SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ: %u delivered: %u from peer, Abort!\n", msg_id, asoc->strmin[strmno].last_sequence_delivered); snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", @@ -1931,7 +1931,7 @@ sctp_process_a_data_chunk(struct sctp_tc } created_control = 1; } - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x ordered:%d msgid:%d control:%p\n", + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x ordered: %d msgid: %u control: %p\n", chunk_flags, ordered, msg_id, control); if ((chunk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG && TAILQ_EMPTY(&asoc->resetHead) && @@ -1950,7 +1950,7 @@ sctp_process_a_data_chunk(struct sctp_tc if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } - SCTPDBG(SCTP_DEBUG_XXX, "Injecting control:%p to be read (mid:%d)\n", + SCTPDBG(SCTP_DEBUG_XXX, "Injecting control: %p to be read (msg_id: %u)\n", control, msg_id); sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -1993,7 +1993,7 @@ sctp_process_a_data_chunk(struct sctp_tc chk->asoc = asoc; chk->send_size = the_len; chk->whoTo = net; - SCTPDBG(SCTP_DEBUG_XXX, "Building ck:%p for control:%p to be read (mid:%d)\n", + SCTPDBG(SCTP_DEBUG_XXX, "Building ck: %p for control: %p to be read (msg_id: %u)\n", chk, control, msg_id); atomic_add_int(&net->ref_count, 1); @@ -2058,7 +2058,7 @@ sctp_process_a_data_chunk(struct sctp_tc } if (chunk_flags & SCTP_DATA_UNORDERED) { /* queue directly into socket buffer */ - SCTPDBG(SCTP_DEBUG_XXX, "Unordered data to be read control:%p msg_id:%d\n", + SCTPDBG(SCTP_DEBUG_XXX, "Unordered data to be read control: %p msg_id: %u\n", control, msg_id); sctp_mark_non_revokable(asoc, control->sinfo_tsn); sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -2067,7 +2067,7 @@ sctp_process_a_data_chunk(struct sctp_tc SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } else { - SCTPDBG(SCTP_DEBUG_XXX, "Queue control:%p for reordering msg_id:%d\n", control, + SCTPDBG(SCTP_DEBUG_XXX, "Queue control: %p for reordering msg_id: %u\n", control, msg_id); sctp_queue_data_to_stream(stcb, strm, asoc, control, abort_flag, &need_reasm_check); if (*abort_flag) { @@ -2082,7 +2082,7 @@ sctp_process_a_data_chunk(struct sctp_tc /* If we reach here its a reassembly */ need_reasm_check = 1; SCTPDBG(SCTP_DEBUG_XXX, - "Queue data to stream for reasm control:%p msg_id:%d\n", + "Queue data to stream for reasm control: %p msg_id: %u\n", control, msg_id); sctp_queue_data_for_reasm(stcb, asoc, strm, control, chk, created_control, abort_flag, tsn); if (*abort_flag) { @@ -2317,7 +2317,7 @@ sctp_slide_mapping_arrays(struct sctp_tc #ifdef INVARIANTS panic("impossible slide"); #else - SCTP_PRINTF("impossible slide lgap:%x slide_end:%x slide_from:%x? at:%d\n", + SCTP_PRINTF("impossible slide lgap: %x slide_end: %x slide_from: %x? at: %d\n", lgap, slide_end, slide_from, at); return; #endif @@ -2326,7 +2326,7 @@ sctp_slide_mapping_arrays(struct sctp_tc #ifdef INVARIANTS panic("would overrun buffer"); #else - SCTP_PRINTF("Gak, would have overrun map end:%d slide_end:%d\n", + SCTP_PRINTF("Gak, would have overrun map end: %d slide_end: %d\n", asoc->mapping_array_size, slide_end); slide_end = asoc->mapping_array_size; #endif @@ -3661,7 +3661,7 @@ sctp_fs_audit(struct sctp_association *a TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { if (chk->sent < SCTP_DATAGRAM_RESEND) { - SCTP_PRINTF("Chk TSN:%u size:%d inflight cnt:%d\n", + SCTP_PRINTF("Chk TSN: %u size: %d inflight cnt: %d\n", chk->rec.data.TSN_seq, chk->send_size, chk->snd_count); @@ -3681,10 +3681,10 @@ sctp_fs_audit(struct sctp_association *a #ifdef INVARIANTS panic("Flight size-express incorrect? \n"); #else - SCTP_PRINTF("asoc->total_flight:%d cnt:%d\n", + SCTP_PRINTF("asoc->total_flight: %d cnt: %d\n", entry_flight, entry_cnt); - SCTP_PRINTF("Flight size-express incorrect F:%d I:%d R:%d Ab:%d ACK:%d\n", + SCTP_PRINTF("Flight size-express incorrect F: %d I: %d R: %d Ab: %d ACK: %d\n", inflight, inbetween, resend, above, acked); ret = 1; #endif @@ -4378,7 +4378,7 @@ sctp_handle_sack(struct mbuf *m, int off SCTP_PRINTF("NEW cum_ack:%x send_s:%x is smaller or equal\n", cum_ack, send_s); if (tp1) { - SCTP_PRINTF("Got send_s from tsn:%x + 1 of tp1:%p\n", + SCTP_PRINTF("Got send_s from tsn:%x + 1 of tp1: %p\n", tp1->rec.data.TSN_seq, (void *)tp1); } hopeless_peer: @@ -5168,7 +5168,7 @@ sctp_kick_prsctp_reorder_queue(struct sc } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm); } else { - panic("strmin:%p ctl:%p unknown %d", + panic("strmin: %p ctl: %p unknown %d", strmin, ctl, ctl->on_strm_q); } ctl->on_strm_q = 0; @@ -5231,7 +5231,7 @@ sctp_kick_prsctp_reorder_queue(struct sc } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm); } else { - panic("strmin:%p ctl:%p unknown %d", + panic("strmin: %p ctl: %p unknown %d", strmin, ctl, ctl->on_strm_q); } ctl->on_strm_q = 0; @@ -5494,7 +5494,7 @@ sctp_handle_forward_tsn(struct sctp_tcb } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { TAILQ_REMOVE(&strm->uno_inqueue, ctl, next_instrm); } else if (ctl->on_strm_q) { - panic("strm:%p ctl:%p unknown %d", + panic("strm: %p ctl: %p unknown %d", strm, ctl, ctl->on_strm_q); } ctl->on_strm_q = 0; From owner-svn-src-all@freebsd.org Mon Apr 18 07:05:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26388B1280A; Mon, 18 Apr 2016 07:05:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E779D1FCB; Mon, 18 Apr 2016 07:05:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I75Jdk052267; Mon, 18 Apr 2016 07:05:19 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I75JoJ052266; Mon, 18 Apr 2016 07:05:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180705.u3I75JoJ052266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 07:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298189 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 07:05:20 -0000 Author: araujo Date: Mon Apr 18 07:05:18 2016 New Revision: 298189 URL: https://svnweb.freebsd.org/changeset/base/298189 Log: Use NULL instead of 0 for pointers. MFC after: 2 weeks. Modified: head/usr.bin/find/function.c Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Mon Apr 18 06:58:07 2016 (r298188) +++ head/usr.bin/find/function.c Mon Apr 18 07:05:18 2016 (r298189) @@ -224,7 +224,7 @@ nextarg(OPTION *option, char ***argvp) { char *arg; - if ((arg = **argvp) == 0) + if ((arg = **argvp) == NULL) errx(1, "%s: requires additional arguments", option->name); (*argvp)++; return arg; From owner-svn-src-all@freebsd.org Mon Apr 18 07:09:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B87DB129E3; Mon, 18 Apr 2016 07:09:35 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C9AA11AC; Mon, 18 Apr 2016 07:09:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I79YMQ052446; Mon, 18 Apr 2016 07:09:34 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I79YBO052445; Mon, 18 Apr 2016 07:09:34 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180709.u3I79YBO052445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 07:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298190 - head/usr.bin/m4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 07:09:35 -0000 Author: araujo Date: Mon Apr 18 07:09:34 2016 New Revision: 298190 URL: https://svnweb.freebsd.org/changeset/base/298190 Log: Use NULL instead of 0 for pointers. fopen(3) will return NULL in case it cannot open the STREAM. MFC after: 2 weeks. Modified: head/usr.bin/m4/gnum4.c Modified: head/usr.bin/m4/gnum4.c ============================================================================== --- head/usr.bin/m4/gnum4.c Mon Apr 18 07:05:18 2016 (r298189) +++ head/usr.bin/m4/gnum4.c Mon Apr 18 07:09:34 2016 (r298190) @@ -129,7 +129,7 @@ dopath(struct input_file *i, const char for (pe = first; pe; pe = pe->next) { snprintf(path, sizeof(path), "%s/%s", pe->name, filename); - if ((f = fopen(path, "r")) != 0) { + if ((f = fopen(path, "r")) != NULL) { set_input(i, f, path); return i; } From owner-svn-src-all@freebsd.org Mon Apr 18 07:14:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C94B6B12C3C; Mon, 18 Apr 2016 07:14:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB3116DF; Mon, 18 Apr 2016 07:14:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I7E1jk055262; Mon, 18 Apr 2016 07:14:01 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I7E1oc055261; Mon, 18 Apr 2016 07:14:01 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180714.u3I7E1oc055261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 07:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298191 - head/usr.bin/talk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 07:14:02 -0000 Author: araujo Date: Mon Apr 18 07:14:01 2016 New Revision: 298191 URL: https://svnweb.freebsd.org/changeset/base/298191 Log: User NULL instead of 0 for pointers. getservent(3) returns NULL on EOF or error. MFC after: 2 weeks. Modified: head/usr.bin/talk/get_addrs.c Modified: head/usr.bin/talk/get_addrs.c ============================================================================== --- head/usr.bin/talk/get_addrs.c Mon Apr 18 07:09:34 2016 (r298190) +++ head/usr.bin/talk/get_addrs.c Mon Apr 18 07:14:01 2016 (r298191) @@ -59,7 +59,7 @@ get_addrs(const char *my_machine_name __ err(1, "failed to find my interface address"); /* find the server's port */ sp = getservbyname("ntalk", "udp"); - if (sp == 0) + if (sp == NULL) errx(1, "ntalk/udp: service is not registered"); daemon_port = sp->s_port; } From owner-svn-src-all@freebsd.org Mon Apr 18 07:36:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C0C9B124DC; Mon, 18 Apr 2016 07:36:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30D581100; Mon, 18 Apr 2016 07:36:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I7aQfE061413; Mon, 18 Apr 2016 07:36:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I7aPRs061399; Mon, 18 Apr 2016 07:36:25 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201604180736.u3I7aPRs061399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 18 Apr 2016 07:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298192 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src lib/libmagic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 07:36:27 -0000 Author: delphij Date: Mon Apr 18 07:36:24 2016 New Revision: 298192 URL: https://svnweb.freebsd.org/changeset/base/298192 Log: MFV r298178: Update file to 5.26. MFC after: 2 weeks Relnotes: yes Added: head/contrib/file/magic/Magdir/bioinformatics - copied unchanged from r298178, vendor/file/dist/magic/Magdir/bioinformatics head/contrib/file/magic/Magdir/coff - copied unchanged from r298178, vendor/file/dist/magic/Magdir/coff head/contrib/file/magic/Magdir/der - copied unchanged from r298178, vendor/file/dist/magic/Magdir/der head/contrib/file/magic/Magdir/finger - copied unchanged from r298178, vendor/file/dist/magic/Magdir/finger head/contrib/file/magic/Magdir/flif - copied unchanged from r298178, vendor/file/dist/magic/Magdir/flif head/contrib/file/magic/Magdir/microfocus - copied unchanged from r298178, vendor/file/dist/magic/Magdir/microfocus head/contrib/file/magic/Magdir/polyml - copied unchanged from r298178, vendor/file/dist/magic/Magdir/polyml head/contrib/file/magic/Magdir/vacuum-cleaner - copied unchanged from r298178, vendor/file/dist/magic/Magdir/vacuum-cleaner head/contrib/file/src/der.c - copied unchanged from r298178, vendor/file/dist/src/der.c head/contrib/file/src/der.h - copied unchanged from r298178, vendor/file/dist/src/der.h head/contrib/file/src/dprintf.c - copied unchanged from r298178, vendor/file/dist/src/dprintf.c Modified: head/contrib/file/ChangeLog head/contrib/file/README head/contrib/file/config.h.in head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/doc/file.man head/contrib/file/doc/libmagic.man head/contrib/file/magic/Magdir/android head/contrib/file/magic/Magdir/animation head/contrib/file/magic/Magdir/apple head/contrib/file/magic/Magdir/archive head/contrib/file/magic/Magdir/audio head/contrib/file/magic/Magdir/c-lang head/contrib/file/magic/Magdir/cafebabe head/contrib/file/magic/Magdir/commands head/contrib/file/magic/Magdir/compress head/contrib/file/magic/Magdir/console head/contrib/file/magic/Magdir/database head/contrib/file/magic/Magdir/filesystems head/contrib/file/magic/Magdir/fonts head/contrib/file/magic/Magdir/fortran head/contrib/file/magic/Magdir/hitachi-sh head/contrib/file/magic/Magdir/images head/contrib/file/magic/Magdir/intel head/contrib/file/magic/Magdir/java head/contrib/file/magic/Magdir/lisp head/contrib/file/magic/Magdir/mach head/contrib/file/magic/Magdir/macintosh head/contrib/file/magic/Magdir/misctools head/contrib/file/magic/Magdir/modem head/contrib/file/magic/Magdir/msdos head/contrib/file/magic/Magdir/msvc head/contrib/file/magic/Magdir/msx head/contrib/file/magic/Magdir/netbsd head/contrib/file/magic/Magdir/psdbms head/contrib/file/magic/Magdir/python head/contrib/file/magic/Magdir/sendmail head/contrib/file/magic/Magdir/sgml head/contrib/file/magic/Magdir/sinclair head/contrib/file/magic/Magdir/sql head/contrib/file/magic/Magdir/terminfo head/contrib/file/magic/Magdir/windows head/contrib/file/magic/Magdir/wordprocessors head/contrib/file/magic/Makefile.am head/contrib/file/magic/Makefile.in head/contrib/file/python/README head/contrib/file/python/magic.py head/contrib/file/python/setup.py head/contrib/file/src/Makefile.am head/contrib/file/src/Makefile.in head/contrib/file/src/apprentice.c head/contrib/file/src/ascmagic.c head/contrib/file/src/compress.c head/contrib/file/src/file.c head/contrib/file/src/file.h head/contrib/file/src/file_opts.h head/contrib/file/src/fmtcheck.c head/contrib/file/src/funcs.c head/contrib/file/src/magic.c head/contrib/file/src/magic.h head/contrib/file/src/print.c head/contrib/file/src/readcdf.c head/contrib/file/src/readelf.c head/contrib/file/src/readelf.h head/contrib/file/src/softmagic.c head/lib/libmagic/Makefile head/lib/libmagic/config.h Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/ChangeLog ============================================================================== --- head/contrib/file/ChangeLog Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/ChangeLog Mon Apr 18 07:36:24 2016 (r298192) @@ -1,3 +1,49 @@ +2016-04-16 18:34 Christos Zoulas + + * release 5.25 + +2016-03-31 13:50 Christos Zoulas + + * make the number of bytes read from files configurable. + +2016-03-21 13:40 Christos Zoulas + + * Add bounds checks for DER code (discovered by Thomas Jarosch) + * Change indirect recursion limit to indirect use count and + bump from 15 to 50 to prevent abuse. + +2016-03-13 20:39 Christos Zoulas + + * Add -00 which prints filename\0description\0 + +2016-03-01 13:28 Christos Zoulas + + * Fix ID3 indirect parsing + +2016-01-19 10:18 Christos Zoulas + + * add DER parsing capability + +2015-11-13 10:35 Christos Zoulas + + * provide dprintf(3) for the OS's that don't have it. + +2015-11-11 16:25 Christos Zoulas + + * redo the compression code report decompression errors + +2015-11-10 23:25 Christos Zoulas + + * REG_STARTEND code is not working as expected, delete it. + +2015-11-09 16:05 Christos Zoulas + + * Add zlib support if we have it. + +2015-11-05 11:22 Christos Zoulas + + * PR/492: compression forking was broken with magic_buffer. + 2015-09-16 9:50 Christos Zoulas * release 5.25 Modified: head/contrib/file/README ============================================================================== --- head/contrib/file/README Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/README Mon Apr 18 07:36:24 2016 (r298192) @@ -1,6 +1,6 @@ ## README for file(1) Command ## - @(#) $File: README,v 1.49 2015/01/02 20:23:04 christos Exp $ + @(#) $File: README,v 1.50 2016/04/16 22:40:54 christos Exp $ Mailing List: file@mx.gw.com Mailing List archives: http://mx.gw.com/pipermail/file/ @@ -67,17 +67,41 @@ in magic(5) format please, to the mainta COPYING - read this first. README - read this second (you are currently reading this file). INSTALL - read on how to install +src/localtime_r.c +src/magic.c +src/magic.h +src/mygetopt.h +src/newtest2.c +src/newtest3.c +src/pread.c +src/print.c +src/readcdf.c +src/readelf.c +src/readelf.h +src/regex.c +src/regex2.c +src/softmagic.c +src/strcasestr.c +src/strlcat.c +src/strlcpy.c +src/strndup.c +src/tar.h +src/teststrchr.c +src/vasprintf.c +src/x.c src/apprentice.c - parses /etc/magic to learn magic -src/asctime_r.c - replacement for OS's that don't have it. src/apptype.c - used for OS/2 specific application type magic -src/asprintf.c - replacement for OS's that don't have it. src/ascmagic.c - third & last set of tests, based on hardwired assumptions. src/asctime_r.c - replacement for OS's that don't have it. src/asprintf.c - replacement for OS's that don't have it. +src/asctime_r.c - replacement for OS's that don't have it. +src/asprintf.c - replacement for OS's that don't have it. src/cdf.[ch] - parser for Microsoft Compound Document Files src/cdf_time.c - time converter for CDF. src/compress.c - handles decompressing files to look inside. src/ctime_r.c - replacement for OS's that don't have it. +src/der.[ch] - parser for Distinguished Encoding Rules +src/dprintf.c - replacement for OS's that don't have it. src/elfclass.h - common code for elf 32/64. src/encoding.c - handles unicode encodings src/file.c - the main program @@ -88,10 +112,13 @@ src/fsmagic.c - first set of tests the p src/funcs.c - utilility functions src/getline.c - replacement for OS's that don't have it. src/getopt_long.c - replacement for OS's that don't have it. -src/is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore). -src/names.h - header file for ascmagic.c +src/gmtime_r.c - replacement for OS's that don't have it. +src/is_tar.c, tar.h - knows about Tape ARchive format (courtesy John Gilmore). +src/localtime_r.c - replacement for OS's that don't have it. src/magic.h.in - source file for magic.h +src/mygetopt.h - replacement for OS's that don't have it. src/magic.c - the libmagic api +src/names.h - header file for ascmagic.c src/pread.c - replacement for OS's that don't have it. src/print.c - print results, errors, warnings. src/readcdf.c - CDF wrapper. Modified: head/contrib/file/config.h.in ============================================================================== --- head/contrib/file/config.h.in Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/config.h.in Mon Apr 18 07:36:24 2016 (r298192) @@ -32,6 +32,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `dprintf' function. */ +#undef HAVE_DPRINTF + /* Define to 1 if you have the header file. */ #undef HAVE_ERR_H Modified: head/contrib/file/configure ============================================================================== --- head/contrib/file/configure Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/configure Mon Apr 18 07:36:24 2016 (r298192) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.25. +# Generated by GNU Autoconf 2.69 for file 5.26. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.25' -PACKAGE_STRING='file 5.25' +PACKAGE_VERSION='5.26' +PACKAGE_STRING='file 5.26' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.25 to adapt to many kinds of systems. +\`configure' configures file 5.26 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.25:";; + short | recursive ) echo "Configuration of file 5.26:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.25 +file configure 5.26 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.25, which was +It was created by file $as_me 5.26, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.25' + VERSION='5.26' cat >>confdefs.h <<_ACEOF @@ -14385,6 +14385,19 @@ esac fi +ac_fn_c_check_func "$LINENO" "dprintf" "ac_cv_func_dprintf" +if test "x$ac_cv_func_dprintf" = xyes; then : + $as_echo "#define HAVE_DPRINTF 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" dprintf.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dprintf.$ac_objext" + ;; +esac + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 @@ -15036,7 +15049,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.25, which was +This file was extended by file $as_me 5.26, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15102,7 +15115,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.25 +file config.status 5.26 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/file/configure.ac ============================================================================== --- head/contrib/file/configure.ac Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/configure.ac Mon Apr 18 07:36:24 2016 (r298192) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.25],[christos@astron.com]) +AC_INIT([file],[5.26],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -145,7 +145,7 @@ dnl Checks for functions AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale) dnl Provide implementation of some required functions if necessary -AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck) +AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf) dnl Checks for libraries AC_CHECK_LIB(z,gzopen) Modified: head/contrib/file/doc/file.man ============================================================================== --- head/contrib/file/doc/file.man Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/doc/file.man Mon Apr 18 07:36:24 2016 (r298192) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.118 2015/09/11 17:24:09 christos Exp $ -.Dd September 11, 2015 +.\" $File: file.man,v 1.120 2016/03/31 17:51:12 christos Exp $ +.Dd March 13, 2016 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -317,6 +317,7 @@ Set various parameter limits. .It Li elf_phnum Ta 128 Ta max ELF program sections processed .It Li elf_shnum Ta 32768 Ta max ELF sections processed .It Li regex Ta 8192 Ta length limit for regex searches +.It Li bytes Ta 1048576 Ta max number of bytes to read from file .El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. @@ -358,6 +359,11 @@ Nice to .Xr cut 1 the output. This does not affect the separator, which is still printed. +.Pp +If this option is repeated more than once, then +.Nm +prints just the filename followed by a NUL followed by the description +(or ERROR: text) followed by a second NUL for each entry. .It Fl -help Print a help message and exit. .El Modified: head/contrib/file/doc/libmagic.man ============================================================================== --- head/contrib/file/doc/libmagic.man Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/doc/libmagic.man Mon Apr 18 07:36:24 2016 (r298192) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.38 2015/09/11 17:24:09 christos Exp $ +.\" $File: libmagic.man,v 1.40 2016/03/31 17:51:12 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -225,7 +225,7 @@ It returns 0 on success and \-1 on failu .Pp The .Fn magic_compile -function can be used to compile the the colon +function can be used to compile the colon separated list of database files passed in as .Ar filename , or @@ -251,7 +251,7 @@ for the default database. .Pp The .Fn magic_load -function must be used to load the the colon +function must be used to load the colon separated list of database files passed in as .Ar filename , or @@ -282,7 +282,7 @@ The .Fn magic_getparam and .Fn magic_setparam -allow getting and setting various limits related to the the magic +allow getting and setting various limits related to the magic library. .Bl -column "MAGIC_PARAM_ELF_PHNUM_MAX" "size_t" "Default" -offset indent .It Sy "Parameter" Ta Sy "Type" Ta Sy "Default" @@ -292,6 +292,7 @@ library. .It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128 .It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768 .It Li MAGIC_PARAM_REGEX_MAX Ta size_t Ta 8192 +.It Li MAGIC_PARAM_BYTES_MAX Ta size_t Ta 1048576 .El .Pp The Modified: head/contrib/file/magic/Magdir/android ============================================================================== --- head/contrib/file/magic/Magdir/android Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/magic/Magdir/android Mon Apr 18 07:36:24 2016 (r298192) @@ -1,6 +1,6 @@ #------------------------------------------------------------ -# $File: android,v 1.8 2015/03/19 18:04:37 christos Exp $ +# $File: android,v 1.9 2016/01/11 21:19:18 christos Exp $ # Various android related magic entries #------------------------------------------------------------ @@ -128,7 +128,7 @@ # partition size in blocks ? #>>>>0x22 ulelong x \b*%d -# Android bootimg format +# Android sparse img format # From https://android.googlesource.com/\ # platform/system/core/+/master/libsparse/sparse_format.h 0 lelong 0xed26ff3a Android sparse image Modified: head/contrib/file/magic/Magdir/animation ============================================================================== --- head/contrib/file/magic/Magdir/animation Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/magic/Magdir/animation Mon Apr 18 07:36:24 2016 (r298192) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: animation,v 1.56 2014/10/23 23:12:51 christos Exp $ +# $File: animation,v 1.57 2015/11/29 22:11:07 christos Exp $ # animation: file(1) magic for animation/movie formats # # animation formats @@ -76,6 +76,8 @@ >8 string da2b \b, DMB MAF, ext da2a, with 3GPP timed text, DID, TVA, REL, IPMP >8 string da3a \b, DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images >8 string da3b \b, DMB MAF, ext da3a w/ BIFS, 3GPP, DID, TVA, REL, IPMP +>8 string dash \b, MPEG v4 system, Dynamic Adaptive Streaming over HTTP +!:mime video/mp4 >8 string dmb1 \b, DMB MAF supporting all the components defined in the spec >8 string dmpf \b, Digital Media Project >8 string drc1 \b, Dirac (wavelet compression), encap in ISO base media (MP4) Modified: head/contrib/file/magic/Magdir/apple ============================================================================== --- head/contrib/file/magic/Magdir/apple Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/magic/Magdir/apple Mon Apr 18 07:36:24 2016 (r298192) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: apple,v 1.31 2015/08/29 07:10:35 christos Exp $ +# $File: apple,v 1.32 2015/12/04 20:40:10 christos Exp $ # apple: file(1) magic for Apple file formats # 0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text @@ -65,18 +65,48 @@ # Eric Fischer # AppleWorks word processor: -# -# This matches the standard tab stops for an AppleWorks file, but if -# a file has a tab stop set in the first four columns this will fail. -# +# URL: https://en.wikipedia.org/wiki/AppleWorks +# Reference: http://www.gno.org/pub/apple2/doc/apple/filetypes/ftn.1a.xxxx +# Update: Joerg Jenderek +# NOTE: # The "O" is really the magic number, but that's so common that it's # necessary to check the tab stops that follow it to avoid false positives. - -4 string O==== AppleWorks word processor data ->85 byte&0x01 >0 \b, zoomed ->90 byte&0x01 >0 \b, paginated ->92 byte&0x01 >0 \b, with mail merge -#>91 byte x \b, left margin %d +# and/or look for unused bits of booleans bytes like zoom, paginated, mail merge +# the newer AppleWorks is from claris with extension CWK +4 string O +# test for unused bits of zoom- , paginated-boolean bytes +>84 ubequad ^0x00Fe00000000Fe00 +# look for tabstop definitions "=" no tab, "|" no tab +# "<" left tab,"^" center tab,">" right tab, "." decimal tab, +# unofficial "!" other , "\x8a" other +# official only if SFMinVers is nonzero +>>5 regex/s [=.<>|!^\x8a]{79} AppleWorks Word Processor +# AppleWorks Word Processor File (Apple II) +# ./apple (version 5.25) labeled the entry as "AppleWorks word processor data" +# application/x-appleworks is mime type for claris version with cwk extension +!:mime application/x-appleworks3 +# http://home.earthlink.net/~hughhood/appleiiworksenvoy/ +# ('p' + 1-byte ProDOS File Type + 2-byte ProDOS Aux Type') +# $70 $1A $F8 $FF is this the apple type ? +#:apple pdospøÿ +!:ext awp +# minimum version needed to read this files. SFMinVers (0 , 30~3.0 ) +>>>183 ubyte 30 3.0 +>>>183 ubyte !30 +>>>>183 ubyte !0 0x%x +# usual tabstop start sequence "=====<" +>>>5 string x \b, tabstop ruler "%6.6s" +# tabstop ruler +#>>>5 string >\0 \b, tabstops "%-79s" +# zoom switch +>>>85 byte&0x01 >0 \b, zoomed +# whether paginated +>>>90 byte&0x01 >0 \b, paginated +# contains any mail-merge commands +>>>92 byte&0x01 >0 \b, with mail merge +# left margin in 1/10 inches ( normally 0 or 10 ) +>>>91 ubyte >0 +>>>>91 ubyte x \b, %d/10 inch left margin # AppleWorks database: # Modified: head/contrib/file/magic/Magdir/archive ============================================================================== --- head/contrib/file/magic/Magdir/archive Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/magic/Magdir/archive Mon Apr 18 07:36:24 2016 (r298192) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.91 2015/09/16 13:49:33 christos Exp $ +# $File: archive,v 1.102 2016/01/11 20:59:24 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -246,7 +246,15 @@ # BA # TODO: idarc says "bytes 0-2 == bytes 3-5" # TTComp -0 string \0\6 TTComp archive data +# URL: http://fileformats.archiveteam.org/wiki/TTComp_archive +# Update: Joerg Jenderek +# GRR: line below is too general as it matches also Panorama database "TCDB 2003-10 demo.pan", others +0 string \0\6 +# look for first keyword of Panorama database *.pan +>12 search/261 DESIGN +# skip keyword with low entropy +>12 default x TTComp archive, binary, 4K dictionary +# (version 5.25) labeled the above entry as "TTComp archive data" # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation? 0 string ESP ESP archive data # ZPack @@ -544,55 +552,212 @@ >>0x36 string >\0 fstype %.8s # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu) -2 string -lh0- LHarc 1.x/ARX archive data [lh0] -!:mime application/x-lharc -2 string -lh1- LHarc 1.x/ARX archive data [lh1] -!:mime application/x-lharc -2 string -lz4- LHarc 1.x archive data [lz4] -!:mime application/x-lharc -2 string -lz5- LHarc 1.x archive data [lz5] -!:mime application/x-lharc +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/LHA_(file_format) +# Reference: http://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html +# +# check and display information of lharc (LHa,PMarc) file +0 name lharc-file +# check 1st character of method id like -lz4- -lh5- or -pm2- +>2 string - +# check 5th character of method id +>>6 string - +# check header level 0 1 2 3 +>>>20 ubyte <4 +# check 2nd, 3th and 4th character of method id +>>>>3 regex \^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1) \b +!:mime application/x-lzh-compressed +# creator type "LHA " +!:apple ????LHA +# display archive type name like "LHa/LZS archive data" or "LArc archive" +>>>>>2 string -lz \b +!:ext lzs +# already known -lzs- -lz4- -lz5- with old names +>>>>>>2 string -lzs LHa/LZS archive data +>>>>>>3 regex \^lz[45] LHarc 1.x archive data +# missing -lz?- with wikipedia names +>>>>>>3 regex \^lz[2378] LArc archive +# display archive type name like "LHa (2.x) archive data" +>>>>>2 string -lh \b +# already known -lh0- -lh1- -lh2- -lh3- -lh4- -lh5- -lh6- -lh7- -lhd- variants with old names +>>>>>>3 regex \^lh[01] LHarc 1.x/ARX archive data +# LHice archiver use ".ICE" as name extension instead usual one ".lzh" +# FOOBAR archiver use ".foo" as name extension instead usual one +# "Florain Orjanov's and Olga Bachetska's ARchiver" not found at the moment +>>>>>>>2 string -lh1 \b +!:ext lha/lzh/ice +>>>>>>3 regex \^lh[23d] LHa 2.x? archive data +>>>>>>3 regex \^lh[7] LHa (2.x)/LHark archive data +>>>>>>3 regex \^lh[456] LHa (2.x) archive data +>>>>>>>2 string -lh5 \b +# https://en.wikipedia.org/wiki/BIOS +# Some mainboard BIOS like Award use LHa compression. So archives with unusal extension are found like +# bios.rom , kd7_v14.bin, 1010.004, ... +!:ext lha/lzh/rom/bin +# missing -lh?- variants (Joe Jared) +>>>>>>3 regex \^lh[89a-ce] LHa (Joe Jared) archive +# UNLHA32 2.67a +>>>>>>2 string -lhx LHa (UNLHA32) archive +# lha archives with standard file name extensions ".lha" ".lzh" +>>>>>>3 regex !\^(lh1|lh5) \b +!:ext lha/lzh +# this should not happen if all -lh variants are described +>>>>>>2 default x LHa (unknown) archive +#!:ext lha +# PMarc +>>>>>3 regex \^pm[012] PMarc archive data +!:ext pma +# append method id without leading and trailing minus character +>>>>>3 string x [%3.3s] +>>>>>>0 use lharc-header +# +# check and display information of lharc header +0 name lharc-header +# header size 0x4 , 0x1b-0x61 +>0 ubyte x +# compressed data size != compressed file size +#>7 ulelong x \b, data size %d +# attribute: 0x2~?? 0x10~symlink|target 0x20~normal +#>19 ubyte x \b, 19_0x%x +# level identifier 0 1 2 3 +#>20 ubyte x \b, level %d +# time stamp +#>15 ubelong x DATE 0x%8.8x +# OS ID for level 1 +>20 ubyte 1 +# 0x20 types find for *.rom files +>>(21.b+24) ubyte <0x21 \b, 0x%x OS +# ascii type like M for MSDOS +>>(21.b+24) ubyte >0x20 \b, '%c' OS +# OS ID for level 2 +>20 ubyte 2 +#>>23 ubyte x \b, OS ID 0x%x +>>23 ubyte <0x21 \b, 0x%x OS +>>23 ubyte >0x20 \b, '%c' OS +# filename only for level 0 and 1 +>20 ubyte <2 +# length of filename +>>21 ubyte >0 \b, with +# filename +>>>21 pstring x "%s" +# +#2 string -lh0- LHarc 1.x/ARX archive data [lh0] +#!:mime application/x-lharc +2 string -lh0- +>0 use lharc-file +#2 string -lh1- LHarc 1.x/ARX archive data [lh1] +#!:mime application/x-lharc +2 string -lh1- +>0 use lharc-file +# NEW -lz2- ... -lz8- +2 string -lz2- +>0 use lharc-file +2 string -lz3- +>0 use lharc-file +2 string -lz4- +>0 use lharc-file +2 string -lz5- +>0 use lharc-file +2 string -lz7- +>0 use lharc-file +2 string -lz8- +>0 use lharc-file # [never seen any but the last; -lh4- reported in comp.compression:] -2 string -lzs- LHa/LZS archive data [lzs] -!:mime application/x-lha -2 string -lh\40- LHa 2.x? archive data [lh ] -!:mime application/x-lha -2 string -lhd- LHa 2.x? archive data [lhd] -!:mime application/x-lha -2 string -lh2- LHa 2.x? archive data [lh2] -!:mime application/x-lha -2 string -lh3- LHa 2.x? archive data [lh3] -!:mime application/x-lha -2 string -lh4- LHa (2.x) archive data [lh4] -!:mime application/x-lha -2 string -lh5- LHa (2.x) archive data [lh5] -!:mime application/x-lha -2 string -lh6- LHa (2.x) archive data [lh6] -!:mime application/x-lha -2 string -lh7- LHa (2.x)/LHark archive data [lh7] -!:mime application/x-lha ->20 byte x - header level %d +#2 string -lzs- LHa/LZS archive data [lzs] +2 string -lzs- +>0 use lharc-file +# According to wikipedia and others such a version does not exist +#2 string -lh\40- LHa 2.x? archive data [lh ] +#2 string -lhd- LHa 2.x? archive data [lhd] +2 string -lhd- +>0 use lharc-file +#2 string -lh2- LHa 2.x? archive data [lh2] +2 string -lh2- +>0 use lharc-file +#2 string -lh3- LHa 2.x? archive data [lh3] +2 string -lh3- +>0 use lharc-file +#2 string -lh4- LHa (2.x) archive data [lh4] +2 string -lh4- +>0 use lharc-file +#2 string -lh5- LHa (2.x) archive data [lh5] +2 string -lh5- +>0 use lharc-file +#2 string -lh6- LHa (2.x) archive data [lh6] +2 string -lh6- +>0 use lharc-file +#2 string -lh7- LHa (2.x)/LHark archive data [lh7] +2 string -lh7- +# !:mime application/x-lha +# >20 byte x - header level %d +>0 use lharc-file +# NEW -lh8- ... -lhe- , -lhx- +2 string -lh8- +>0 use lharc-file +2 string -lh9- +>0 use lharc-file +2 string -lha- +>0 use lharc-file +2 string -lhb- +>0 use lharc-file +2 string -lhc- +>0 use lharc-file +2 string -lhe- +>0 use lharc-file +2 string -lhx- +>0 use lharc-file # taken from idarc [JW] 2 string -lZ PUT archive data -2 string -lz LZS archive data +# already done by LHarc magics +# this should never happen if all sub types of LZS archive are identified +#2 string -lz LZS archive data 2 string -sw1- Swag archive data -# RAR archiver (Greg Roelofs, newt@uchicago.edu) -0 string Rar! RAR archive data, +0 name rar-file-header +>24 byte 15 \b, v1.5 +>24 byte 20 \b, v2.0 +>24 byte 29 \b, v4 +>15 byte 0 \b, os: MS-DOS +>15 byte 1 \b, os: OS/2 +>15 byte 2 \b, os: Win32 +>15 byte 3 \b, os: Unix +>15 byte 4 \b, os: Mac OS +>15 byte 5 \b, os: BeOS + +0 name rar-archive-header +>3 leshort&0x1ff >0 \b, flags: +>>3 leshort &0x01 ArchiveVolume +>>3 leshort &0x02 Commented +>>3 leshort &0x04 Locked +>>3 leshort &0x10 NewVolumeNaming +>>3 leshort &0x08 Solid +>>3 leshort &0x20 Authenticated +>>3 leshort &0x40 RecoveryRecordPresent +>>3 leshort &0x80 EncryptedBlockHeader +>>3 leshort &0x100 FirstVolume + +# RAR (Roshal Archive) archive +0 string Rar!\x1a\7\0 RAR archive data +!:mime application/x-rar +!:ext rar/cbr +# file header +>(0xc.l+9) byte 0x74 +>>(0xc.l+7) use rar-file-header +# subblock seems to share information with file header +>(0xc.l+9) byte 0x7a +>>(0xc.l+7) use rar-file-header +>9 byte 0x73 +>>7 use rar-archive-header + +0 string Rar!\x1a\7\1\0 RAR archive data, v5 +!:mime application/x-rar +!:ext rar + +# Very old RAR archive +# http://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf +0 string RE\x7e\x5e RAR archive data (44 byte x v%0x, ->10 byte >0 flags: ->>10 byte &0x01 Archive volume, ->>10 byte &0x02 Commented, ->>10 byte &0x04 Locked, ->>10 byte &0x08 Solid, ->>10 byte &0x20 Authenticated, ->35 byte 0 os: MS-DOS ->35 byte 1 os: OS/2 ->35 byte 2 os: Win32 ->35 byte 3 os: Unix -# some old version? idarc says: -0 string RE\x7e\x5e RAR archive data +!:ext rar/cbr # SQUISH archiver (Greg Roelofs, newt@uchicago.edu) 0 string SQSH squished archive data (Acorn RISCOS) @@ -604,9 +769,12 @@ # PKZIP multi-volume archive 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract !:mime application/zip +!:ext zip/cbz # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 0 string PK\005\006 Zip archive data (empty) +!:mime application/zip +!:ext zip/cbz 0 string PK\003\004 # Specialised zip formats which start with a member named 'mimetype' @@ -764,12 +932,24 @@ 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data # # PMA (CP/M derivative of LHA) +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/LHA_(file_format) # -2 string -pm0- PMarc archive data [pm0] -2 string -pm1- PMarc archive data [pm1] -2 string -pm2- PMarc archive data [pm2] +#2 string -pm0- PMarc archive data [pm0] +2 string -pm0- +>0 use lharc-file +#2 string -pm1- PMarc archive data [pm1] +2 string -pm1- +>0 use lharc-file +#2 string -pm2- PMarc archive data [pm2] +2 string -pm2- +>0 use lharc-file 2 string -pms- PMarc SFX archive (CP/M, DOS) +#!:mime application/x-foobar-exec +!:ext com 5 string -pc1- PopCom compressed executable (CP/M) +#!:mime application/x- +#!:ext com # From Rafael Laboissiere # The Project Revision Control System (see @@ -802,6 +982,9 @@ # Felix von Leitner 0 string d8:announce BitTorrent file !:mime application/x-bittorrent +# Durval Menezes, +0 string d13:announce-list BitTorrent file +!:mime application/x-bittorrent # Atari MSA archive - Teemu Hukkanen 0 beshort 0x0e0f Atari MSA archive data @@ -889,19 +1072,16 @@ # From "Nelson A. de Oliveira" 0 string MPQ\032 MoPaQ (MPQ) archive -# From: Dirk Jagdmann -# xar archive format: http://code.google.com/p/xar/ -0 string xar! xar archive ->6 beshort x - version %d - # From: "Nelson A. de Oliveira" # .kgb 0 string KGB_arch KGB Archiver file >10 string x with compression level %.1s # xar (eXtensible ARchiver) archive +# xar archive format: http://code.google.com/p/xar/ # From: "David Remahl" 0 string xar! xar archive +!:mime application/x-xar #>4 beshort x header size %d >6 beshort x version %d, #>8 quad x compressed TOC: %d, @@ -975,3 +1155,9 @@ >0xE08 search/7776 \x55\xAA >>&-512 indirect x \b; contains +# Google Chrome extensions +# https://developer.chrome.com/extensions/crx +# https://developer.chrome.com/extensions/hosting +0 string Cr24 Google Chrome extension +!:mime application/x-chrome-extension +>4 ulong x \b, version %u Modified: head/contrib/file/magic/Magdir/audio ============================================================================== --- head/contrib/file/magic/Magdir/audio Mon Apr 18 07:14:01 2016 (r298191) +++ head/contrib/file/magic/Magdir/audio Mon Apr 18 07:36:24 2016 (r298192) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: audio,v 1.73 2015/03/15 23:21:42 christos Exp $ +# $File: audio,v 1.75 2016/02/08 17:30:11 christos Exp $ # audio: file(1) magic for sound formats (see also "iff") # # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com), @@ -585,7 +585,7 @@ 0 string SC68\ Music-file\ /\ (c)\ (BeN)jami sc68 Atari ST music # musepak support From: "Jiri Pejchal" -0 string MP+ Musepack audio +0 string MP+ Musepack audio (MP+) !:mime audio/x-musepack >3 byte 255 \b, SV pre8 >3 byte&0xF 0x6 \b, SV 6 @@ -619,6 +619,9 @@ >>27 byte 114 \b, Beta 1.14 >>27 byte 115 \b, Alpha 1.15 +0 string MPCK Musepack audio (MPCK) +!:mime audio/x-musepack + # IMY # from http://filext.com/detaillist.php?extdetail=IMY # http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm @@ -715,3 +718,41 @@ 0 string ZBOT >4 byte 0xc5 GVOX Encore music, version < 5.0 +# Summary: Garmin Voice Processing Module (WAVE audios) +# From: Joerg Jenderek +# URL: http://www.garmin.com/ +# Reference: http://turboccc.wikispaces.com/share/view/28622555 +# NOTE: there exist 2 other Garmin VPM formats +0 string AUDIMG +# skip text files starting with string "AUDIMG" +>13 ubyte <13 Garmin Voice Processing Module +!:mime audio/x-vpm-wav-garmin +!:ext vpm +# 3 bytes indicating the voice version (200,220) +>>6 string x \b, version %3.3s +# day of release (01-31) +>>12 ubyte x \b, %.2d +# month of release (01-12) +>>13 ubyte x \b.%.2d +# year of release (like 2006, 2007, 2008) +>>14 uleshort x \b.%.4d +# hour of release (0-23) +>>11 ubyte x %.2d +# minute of release (0-59) +>>10 ubyte x \b:%.2d +# second of release (0-59) +>>9 ubyte x \b:%.2d +# if you select a language like german on your garmin device +# you can only select voice modules with correponding language byte ID like 1 +>>18 ubyte x \b, language ID %d +# pointer to 1st audio WAV sample +>>16 uleshort >0 +>>>(16.s) ulelong >0 \b, at offset 0x%x +# WAV length +>>>>(16.s+4) ulelong >0 %d Bytes +# look for magic +>>>>>(&-8.l) string RIFF +# determine type by ./riff +>>>>>>&-4 indirect x \b +# 2 - ~ 131 WAV samples following same way + Copied: head/contrib/file/magic/Magdir/bioinformatics (from r298178, vendor/file/dist/magic/Magdir/bioinformatics) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/file/magic/Magdir/bioinformatics Mon Apr 18 07:36:24 2016 (r298192, copy of r298178, vendor/file/dist/magic/Magdir/bioinformatics) @@ -0,0 +1,178 @@ + +#------------------------------------------------------------------------------ +# $File: bioinformatics,v 1.2 2016/02/14 15:53:53 christos Exp $ +# bioinfomatics: file(1) magic for Bioinfomatics file formats + +############################################################################### +# BGZF (Blocked GNU Zip Format) - gzip compatible, but also indexable +# used by SAMtools bgzip/tabix (http://samtools.sourceforge.net/tabix.shtml) +############################################################################### +0 string \037\213 +>3 byte &0x04 +>>12 string BC +>>>14 leshort &0x02 Blocked GNU Zip Format (BGZF; gzip compatible) +>>>>16 leshort x \b, block length %d +!:mime application/x-gzip + + +############################################################################### +# Tabix index file +# used by SAMtools bgzip/tabix (http://samtools.sourceforge.net/tabix.shtml) +############################################################################### +0 string TBI\1 SAMtools TBI (Tabix index format) +>0x04 lelong =1 \b, with %d reference sequence +>0x04 lelong >1 \b, with %d reference sequences +>0x08 lelong &0x10000 \b, using half-closed-half-open coordinates (BED style) +>0x08 lelong ^0x10000 +>>0x08 lelong =0 \b, using closed and one based coordinates (GFF style) +>>0x08 lelong =1 \b, using SAM format +>>0x08 lelong =2 \b, using VCF format +>0x0c lelong x \b, sequence name column: %d +>0x10 lelong x \b, region start column: %d +>0x08 lelong =0 +>>0x14 lelong x \b, region end column: %d +>0x18 byte x \b, comment character: %c +>0x1c lelong x \b, skip line count: %d + + +############################################################################### +# BAM (Binary Sequence Alignment/Map format) +# used by SAMtools (http://samtools.sourceforge.net/SAM1.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BAM\1 SAMtools BAM (Binary Sequence Alignment/Map) +>0x04 lelong >0 +>>&0x00 regex =^[@]HD\t.*VN: \b, with SAM header +>>>&0 regex =[0-9.]+ \b version %s +>>&(0x04) lelong >0 \b, with %d reference sequences + + +############################################################################### +# BAI (BAM indexing format) +# used by SAMtools (http://samtools.sourceforge.net/SAM1.pdf) +############################################################################### +0 string BAI\1 SAMtools BAI (BAM indexing format) +>0x04 lelong >0 \b, with %d reference sequences + + +############################################################################### +# CRAM (Binary Sequence Alignment/Map format) +############################################################################### +0 string CRAM CRAM +>0x04 byte >-1 version %d. +>0x05 byte >-1 \b%d +>0x06 string >\0 (identified as %s) + + +############################################################################### +# BCF (Binary Call Format), version 1 +# used by SAMtools & VCFtools (http://vcftools.sourceforge.net/bcf.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\4 +# length of seqnm data in bytes is positive +>&0x00 lelong >0 +# length of smpl data in bytes is positive +>>&(&-0x04) lelong >0 SAMtools BCF (Binary Call Format) +# length of meta in bytes +>>>&(&-0x04) lelong >0 +# have meta text string +>>>>&0x00 search ##samtoolsVersion= +>>>>>&0x00 string x \b, generated by SAMtools version %s + + +############################################################################### +# BCF (Binary Call Format), version 2.1 +# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\2\1 Binary Call Format (BCF) version 2.1 +# length of header text +>&0x00 lelong >0 +# have header string +>>&0x00 search ##samtoolsVersion= +>>>&0x00 string x \b, generated by SAMtools version %s + + +############################################################################### +# BCF (Binary Call Format), version 2.2 +# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\2\2 Binary Call Format (BCF) version 2.2 +# length of header text +>&0x00 lelong >0 +# have header string +>>&0x00 search ##samtoolsVersion= +>>>&0x00 string x \b, generated by SAMtools version %s + +############################################################################### +# VCF (Variant Call Format) +# used by VCFtools (http://vcftools.sourceforge.net/) +############################################################################### +0 search ##fileformat=VCFv Variant Call Format (VCF) +>&0 string x \b version %s + +############################################################################### +# FASTQ +# used by MAQ (http://maq.sourceforge.net/fastq.shtml) +############################################################################### +# XXX Broken? +# @ +#0 regex =^@[A-Za-z0-9_.:-]+\?\n +# +#>&1 regex =^[A-Za-z\n.~]++ +# +[] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Apr 18 07:40:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E4DCB126FB; Mon, 18 Apr 2016 07:40:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB631332; Mon, 18 Apr 2016 07:40:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I7ea2v061597; Mon, 18 Apr 2016 07:40:36 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I7eaDO061596; Mon, 18 Apr 2016 07:40:36 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180740.u3I7eaDO061596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 07:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298193 - head/sbin/bsdlabel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 07:40:37 -0000 Author: araujo Date: Mon Apr 18 07:40:36 2016 New Revision: 298193 URL: https://svnweb.freebsd.org/changeset/base/298193 Log: Use NULL instead of 0 for pointers. strchr(3) will return NULL if the character does not appear in the string. MFC after: 2 weeks. Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Mon Apr 18 07:36:24 2016 (r298192) +++ head/sbin/bsdlabel/bsdlabel.c Mon Apr 18 07:40:36 2016 (r298193) @@ -781,7 +781,7 @@ getasciilabel(FILE *f, struct disklabel lp->d_sbsize = 0; /* XXX */ while (fgets(line, sizeof(line) - 1, f)) { lineno++; - if ((cp = strchr(line,'\n')) != 0) + if ((cp = strchr(line,'\n')) != NULL) *cp = '\0'; cp = skip(line); if (cp == NULL) From owner-svn-src-all@freebsd.org Mon Apr 18 07:44:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F07CB1299B; Mon, 18 Apr 2016 07:44:54 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C491184A; Mon, 18 Apr 2016 07:44:54 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I7irGZ064392; Mon, 18 Apr 2016 07:44:53 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I7irai064390; Mon, 18 Apr 2016 07:44:53 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180744.u3I7irai064390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 07:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298194 - head/sbin/fsck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 07:44:54 -0000 Author: araujo Date: Mon Apr 18 07:44:53 2016 New Revision: 298194 URL: https://svnweb.freebsd.org/changeset/base/298194 Log: strchr(3) will return NULL if it cannot find the character in the string. getfsent(3) will return NULL on EOF or error. MFC after: 2 weeks. Modified: head/sbin/fsck/fsck.c head/sbin/fsck/preen.c Modified: head/sbin/fsck/fsck.c ============================================================================== --- head/sbin/fsck/fsck.c Mon Apr 18 07:40:36 2016 (r298193) +++ head/sbin/fsck/fsck.c Mon Apr 18 07:44:53 2016 (r298194) @@ -200,7 +200,7 @@ main(int argc, char *argv[]) mntpt = NULL; spec = *argv; cp = strrchr(spec, '/'); - if (cp == 0) { + if (cp == NULL) { (void)snprintf(device, sizeof(device), "%s%s", _PATH_DEV, spec); spec = device; Modified: head/sbin/fsck/preen.c ============================================================================== --- head/sbin/fsck/preen.c Mon Apr 18 07:40:36 2016 (r298193) +++ head/sbin/fsck/preen.c Mon Apr 18 07:44:53 2016 (r298194) @@ -106,7 +106,7 @@ checkfstab(int flags, int (*docheck)(str warnx("Can't open checklist file: %s\n", _PATH_FSTAB); return (8); } - while ((fs = getfsent()) != 0) { + while ((fs = getfsent()) != NULL) { name = fs->fs_spec; if (fs->fs_passno > passno && fs->fs_passno < nextpass) nextpass = fs->fs_passno; From owner-svn-src-all@freebsd.org Mon Apr 18 07:47:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2EB5B12AD1; Mon, 18 Apr 2016 07:47:27 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B44311C1C; Mon, 18 Apr 2016 07:47:27 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I7lQtN064768; Mon, 18 Apr 2016 07:47:26 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I7lQAC064767; Mon, 18 Apr 2016 07:47:26 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604180747.u3I7lQAC064767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 07:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298195 - head/sbin/fsdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 07:47:28 -0000 Author: araujo Date: Mon Apr 18 07:47:26 2016 New Revision: 298195 URL: https://svnweb.freebsd.org/changeset/base/298195 Log: Use NULL instead of 0 for pointers. malloc will return NULL if it cannot allocate memory. MFC after: 2 weeks. Modified: head/sbin/fsdb/fsdbutil.c Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Mon Apr 18 07:44:53 2016 (r298194) +++ head/sbin/fsdb/fsdbutil.c Mon Apr 18 07:47:26 2016 (r298195) @@ -310,7 +310,7 @@ printblocks(ino_t inum, union dinode *dp return; bufp = malloc((unsigned int)sblock.fs_bsize); - if (bufp == 0) + if (bufp == NULL) errx(EEXIT, "cannot allocate indirect block buffer"); printf("Indirect blocks:\n"); for (i = 0; i < NIADDR; i++) From owner-svn-src-all@freebsd.org Mon Apr 18 07:48:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8D0FB12B4B; Mon, 18 Apr 2016 07:48:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6AAE1DC9; Mon, 18 Apr 2016 07:48:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I7mR7g064847; Mon, 18 Apr 2016 07:48:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I7mRlZ064846; Mon, 18 Apr 2016 07:48:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604180748.u3I7mRlZ064846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 18 Apr 2016 07:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298196 - head/tests/sys/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 07:48:29 -0000 Author: ngie Date: Mon Apr 18 07:48:27 2016 New Revision: 298196 URL: https://svnweb.freebsd.org/changeset/base/298196 Log: Minor cosmetic cleanup - Remove spurious trailing whitespace in licensing header - Remove unnecessary semi-colon after comment [*] MFC after: 3 days Submitted by: pfg [*] Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/file/newfileops_on_fork_test.c Modified: head/tests/sys/file/newfileops_on_fork_test.c ============================================================================== --- head/tests/sys/file/newfileops_on_fork_test.c Mon Apr 18 07:47:26 2016 (r298195) +++ head/tests/sys/file/newfileops_on_fork_test.c Mon Apr 18 07:48:27 2016 (r298196) @@ -3,7 +3,7 @@ * All rights reserved. * * This software was developed at the University of Cambridge Computer - * Laboratory with support from a grant from Google, Inc. + * Laboratory with support from a grant from Google, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -115,7 +115,7 @@ main(__unused int argc, __unused char *a err(-1, "listen"); if (pthread_create(&accept_thread, NULL, do_accept, NULL) != 0) err(-1, "pthread_create"); - sleep(1); /* Easier than using a CV. */; + sleep(1); /* Easier than using a CV. */ do_fork(); exit(0); } From owner-svn-src-all@freebsd.org Mon Apr 18 08:24:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E300B11F4A; Mon, 18 Apr 2016 08:24:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EFA4113B; Mon, 18 Apr 2016 08:24:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I8OD4b076637; Mon, 18 Apr 2016 08:24:13 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I8ODHf076636; Mon, 18 Apr 2016 08:24:13 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201604180824.u3I8ODHf076636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 18 Apr 2016 08:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298197 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 08:24:14 -0000 Author: delphij Date: Mon Apr 18 08:24:13 2016 New Revision: 298197 URL: https://svnweb.freebsd.org/changeset/base/298197 Log: Fix tinderbox LINT build. Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Mon Apr 18 07:48:27 2016 (r298196) +++ head/sys/cam/cam_iosched.c Mon Apr 18 08:24:13 2016 (r298197) @@ -63,7 +63,6 @@ static MALLOC_DEFINE(M_CAMSCHED, "CAM I/ #ifdef CAM_NETFLIX_IOSCHED -SYSCTL_DECL(_kern_cam); static int do_netflix_iosched = 1; TUNABLE_INT("kern.cam.do_netflix_iosched", &do_netflix_iosched); SYSCTL_INT(_kern_cam, OID_AUTO, do_netflix_iosched, CTLFLAG_RD, From owner-svn-src-all@freebsd.org Mon Apr 18 08:30:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32DC2B1223C; Mon, 18 Apr 2016 08:30:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D76DE14C6; Mon, 18 Apr 2016 08:30:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I8Uu5v079048; Mon, 18 Apr 2016 08:30:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I8Urnu079016; Mon, 18 Apr 2016 08:30:53 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201604180830.u3I8Urnu079016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 18 Apr 2016 08:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298198 - in stable/9: contrib/file contrib/file/doc contrib/file/magic/Magdir contrib/file/src lib/libmagic X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 08:30:57 -0000 Author: delphij Date: Mon Apr 18 08:30:52 2016 New Revision: 298198 URL: https://svnweb.freebsd.org/changeset/base/298198 Log: MFC r287453,287454,288143: file 5.25. Modified: stable/9/contrib/file/ChangeLog stable/9/contrib/file/configure stable/9/contrib/file/configure.ac stable/9/contrib/file/doc/file.man stable/9/contrib/file/doc/libmagic.man stable/9/contrib/file/doc/magic.man stable/9/contrib/file/magic/Magdir/adventure stable/9/contrib/file/magic/Magdir/apple stable/9/contrib/file/magic/Magdir/archive stable/9/contrib/file/magic/Magdir/c-lang stable/9/contrib/file/magic/Magdir/c64 stable/9/contrib/file/magic/Magdir/compress stable/9/contrib/file/magic/Magdir/database stable/9/contrib/file/magic/Magdir/elf stable/9/contrib/file/magic/Magdir/filesystems stable/9/contrib/file/magic/Magdir/fortran stable/9/contrib/file/magic/Magdir/frame stable/9/contrib/file/magic/Magdir/iff stable/9/contrib/file/magic/Magdir/images stable/9/contrib/file/magic/Magdir/karma stable/9/contrib/file/magic/Magdir/linux stable/9/contrib/file/magic/Magdir/mail.news stable/9/contrib/file/magic/Magdir/make stable/9/contrib/file/magic/Magdir/map stable/9/contrib/file/magic/Magdir/msdos stable/9/contrib/file/magic/Magdir/netscape stable/9/contrib/file/magic/Magdir/python stable/9/contrib/file/magic/Magdir/scientific stable/9/contrib/file/magic/Magdir/sgi stable/9/contrib/file/magic/Magdir/sgml stable/9/contrib/file/magic/Magdir/windows stable/9/contrib/file/src/apprentice.c stable/9/contrib/file/src/file.c stable/9/contrib/file/src/file.h stable/9/contrib/file/src/file_opts.h stable/9/contrib/file/src/funcs.c stable/9/contrib/file/src/gmtime_r.c stable/9/contrib/file/src/localtime_r.c stable/9/contrib/file/src/magic.c stable/9/contrib/file/src/magic.h stable/9/contrib/file/src/magic.h.in stable/9/contrib/file/src/print.c stable/9/contrib/file/src/readelf.c stable/9/contrib/file/src/softmagic.c stable/9/lib/libmagic/config.h Directory Properties: stable/9/contrib/file/ (props changed) stable/9/lib/libmagic/ (props changed) Modified: stable/9/contrib/file/ChangeLog ============================================================================== --- stable/9/contrib/file/ChangeLog Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/ChangeLog Mon Apr 18 08:30:52 2016 (r298198) @@ -1,3 +1,23 @@ +2015-09-16 9:50 Christos Zoulas + + * release 5.25 + +2015-09-11 13:25 Christos Zoulas + + * add a limit to the length of regex searches + +2015-09-08 9:50 Christos Zoulas + + * fix problems with --parameter (Christoph Biedl) + +2015-07-11 10:35 Christos Zoulas + + * Windows fixes PR/466 (Jason Hood) + +2015-07-09 10:35 Christos Zoulas + + * release 5.24 + 2015-06-11 8:52 Christos Zoulas * redo long option encoding to fix off-by-one in 5.23 Modified: stable/9/contrib/file/configure ============================================================================== --- stable/9/contrib/file/configure Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/configure Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.23. +# Generated by GNU Autoconf 2.69 for file 5.25. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.23' -PACKAGE_STRING='file 5.23' +PACKAGE_VERSION='5.25' +PACKAGE_STRING='file 5.25' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.23 to adapt to many kinds of systems. +\`configure' configures file 5.25 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.23:";; + short | recursive ) echo "Configuration of file 5.25:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.23 +file configure 5.25 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.23, which was +It was created by file $as_me 5.25, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.23' + VERSION='5.25' cat >>confdefs.h <<_ACEOF @@ -15036,7 +15036,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.23, which was +This file was extended by file $as_me 5.25, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15102,7 +15102,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.23 +file config.status 5.25 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/9/contrib/file/configure.ac ============================================================================== --- stable/9/contrib/file/configure.ac Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/configure.ac Mon Apr 18 08:30:52 2016 (r298198) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.23],[christos@astron.com]) +AC_INIT([file],[5.25],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Modified: stable/9/contrib/file/doc/file.man ============================================================================== --- stable/9/contrib/file/doc/file.man Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/doc/file.man Mon Apr 18 08:30:52 2016 (r298198) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.117 2015/06/03 19:51:27 christos Exp $ -.Dd June 3, 2015 +.\" $File: file.man,v 1.118 2015/09/11 17:24:09 christos Exp $ +.Dd September 11, 2015 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -316,6 +316,7 @@ Set various parameter limits. .It Li elf_notes Ta 256 Ta max ELF notes processed .It Li elf_phnum Ta 128 Ta max ELF program sections processed .It Li elf_shnum Ta 32768 Ta max ELF sections processed +.It Li regex Ta 8192 Ta length limit for regex searches .El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. Modified: stable/9/contrib/file/doc/libmagic.man ============================================================================== --- stable/9/contrib/file/doc/libmagic.man Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/doc/libmagic.man Mon Apr 18 08:30:52 2016 (r298198) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.37 2015/06/03 18:21:24 christos Exp $ +.\" $File: libmagic.man,v 1.38 2015/09/11 17:24:09 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 3, 2015 +.Dd September 11, 2015 .Dt LIBMAGIC 3 .Os .Sh NAME @@ -291,6 +291,7 @@ library. .It Li MAGIC_PARAM_ELF_NOTES_MAX Ta size_t Ta 256 .It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128 .It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768 +.It Li MAGIC_PARAM_REGEX_MAX Ta size_t Ta 8192 .El .Pp The Modified: stable/9/contrib/file/doc/magic.man ============================================================================== --- stable/9/contrib/file/doc/magic.man Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/doc/magic.man Mon Apr 18 08:30:52 2016 (r298198) @@ -1,4 +1,4 @@ -.\" $File: magic.man,v 1.85 2015/01/01 17:07:34 christos Exp $ +.\" $File: magic.man,v 1.86 2015/09/08 13:48:44 christos Exp $ .Dd January 1, 2015 .Dt MAGIC __FSECTION__ .Os @@ -200,7 +200,7 @@ interpreted as a UNIX-style date, but in than UTC. .It Dv indirect Starting at the given offset, consult the magic database again. -The offset of th +The offset of the .Dv indirect magic is by default absolute in the file, but one can specify .Dv /r Modified: stable/9/contrib/file/magic/Magdir/adventure ============================================================================== --- stable/9/contrib/file/magic/Magdir/adventure Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/adventure Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: adventure,v 1.14 2012/06/21 01:32:26 christos Exp $ +# $File: adventure,v 1.15 2015/09/07 10:03:21 christos Exp $ # adventure: file(1) magic for Adventure game files # # from Allen Garvin @@ -17,6 +17,7 @@ # Infocom (see z-machine) #------------------------------------------------------------------------------ # Z-machine: file(1) magic for Z-machine binaries. +# Sanity checks by David Griffith # Updated by Adam Buchbinder # #http://www.gnelson.demon.co.uk/zspec/sect11.html @@ -41,10 +42,12 @@ >>>>>>>2 ubeshort < 10 Release %d / >>>>>>>>18 string >\0 Serial %.6s) !:strength + 40 +!:mime application/x-zmachine #------------------------------------------------------------------------------ # Glulx: file(1) magic for Glulx binaries. # +# David Griffith # I haven't checked for false matches yet. # 0 string Glul Glulx game data @@ -52,7 +55,7 @@ >>6 byte x \b.%d >>8 byte x \b.%d) >36 string Info Compiled by Inform - +!:mime application/x-glulx # For Quetzal and blorb magic see iff @@ -66,11 +69,13 @@ >9 belong !0x0A0D1A00 game data, CORRUPTED >9 belong 0x0A0D1A00 >>13 string >\0 %s game data +!:mime application/x-tads # Resource files start with "TADS2 rsc\n\r\032\0" then the compiler version. 0 string TADS2\ rsc TADS >9 belong !0x0A0D1A00 resource data, CORRUPTED >9 belong 0x0A0D1A00 >>13 string >\0 %s resource data +!:mime application/x-tads # Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian # 2-byte length N, the N-char name of the game file *without* a NUL (darn!), # "TADS2 save\n\r\032\0" and the interpreter version. @@ -78,12 +83,14 @@ >12 belong !0x0A0D1A00 saved game data, CORRUPTED >12 belong 0x0A0D1A00 >>(16.s+32) string >\0 %s saved game data +!:mime application/x-tads # Other saved game files start with "TADS2 save\n\r\032\0" and the interpreter # version. 0 string TADS2\ save TADS >10 belong !0x0A0D1A00 saved game data, CORRUPTED >10 belong 0x0A0D1A00 >>14 string >\0 %s saved game data +!:mime application/x-tads # TADS (Text Adventure Development System) version 3 # Game files start with "T3-image\015\012\032" @@ -97,14 +104,18 @@ >>11 byte x \b%c >>12 byte x \b%c >>13 byte x \b%c) +!:mime application/x-t3vm-image +# edited by David Griffith # Danny Milosavljevic -# this are adrift (adventure game standard) game files, extension .taf -# depending on version magic continues with 0x93453E6139FA (V 4.0) -# 0x9445376139FA (V 3.90) -# 0x9445366139FA (V 3.80) -# this is from source (http://www.adrift.org.uk/) and I have some taf -# files, and checked them. -#0 belong 0x3C423FC9 -#>4 belong 0x6A87C2CF Adrift game file -#!:mime application/x-adrift +# These are ADRIFT (adventure game standard) game files, extension .taf +# Checked from source at (http://www.adrift.co/) and various taf files +# found at the Interactive Fiction Archive (http://ifarchive.org/) +0 belong 0x3C423FC9 +>4 belong 0x6A87C2CF Adrift game file version +>>8 belong 0x94453661 3.80 +>>8 belong 0x94453761 3.90 +>>8 belong 0x93453E61 4.0 +>>8 belong 0x92453E61 5.0 +>>8 default x unknown +!:mime application/x-adrift Modified: stable/9/contrib/file/magic/Magdir/apple ============================================================================== --- stable/9/contrib/file/magic/Magdir/apple Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/apple Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: apple,v 1.30 2015/04/13 13:09:06 christos Exp $ +# $File: apple,v 1.31 2015/08/29 07:10:35 christos Exp $ # apple: file(1) magic for Apple file formats # 0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text @@ -265,14 +265,14 @@ >>20 beshort x \b, descriptors %d # Assume 8 partitions each at a multiple of the sector size. # We could glean this from the partition descriptors, but they are empty!?!? ->>(2.S*1) indirect \b, contains[@0x%x]: ->>(2.S*2) indirect \b, contains[@0x%x]: ->>(2.S*3) indirect \b, contains[@0x%x]: ->>(2.S*4) indirect \b, contains[@0x%x]: ->>(2.S*5) indirect \b, contains[@0x%x]: ->>(2.S*6) indirect \b, contains[@0x%x]: ->>(2.S*7) indirect \b, contains[@0x%x]: ->>(2.S*8) indirect \b, contains[@0x%x]: +>>(2.S*1) indirect x \b, contains[@0x%x]: +>>(2.S*2) indirect x \b, contains[@0x%x]: +>>(2.S*3) indirect x \b, contains[@0x%x]: +>>(2.S*4) indirect x \b, contains[@0x%x]: +>>(2.S*5) indirect x \b, contains[@0x%x]: +>>(2.S*6) indirect x \b, contains[@0x%x]: +>>(2.S*7) indirect x \b, contains[@0x%x]: +>>(2.S*8) indirect x \b, contains[@0x%x]: # Yes, the 3rd and 4th bytes are reserved, but we use them to make the # magic stronger. Modified: stable/9/contrib/file/magic/Magdir/archive ============================================================================== --- stable/9/contrib/file/magic/Magdir/archive Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/archive Mon Apr 18 08:30:52 2016 (r298198) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.90 2015/04/24 15:44:12 christos Exp $ +# $File: archive,v 1.91 2015/09/16 13:49:33 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -434,16 +434,34 @@ # AIN 0 string \x33\x18 AIN archive data 0 string \x33\x17 AIN archive data -# XPA32 -0 string xpa\0\1 XPA32 archive data +# XPA32 test moved and merged with XPA by Joerg Jenderek at Sep 2015 # SZip (TODO: doesn't catch all versions) 0 string SZ\x0a\4 SZip archive data # XPack DiskImage -0 string jm XPack DiskImage archive data +# *.XDI updated by Joerg Jenderek Sep 2015 +# ftp://ftp.sac.sk/pub/sac/pack/0index.txt +# GRR: this test is still too general as it catches also text files starting with jm +0 string jm +# only found examples with this additional characteristic 2 bytes +>2 string \x2\x4 Xpack DiskImage archive data +#!:ext xdi # XPack Data -0 string xpa XPack archive data +# *.xpa updated by Joerg Jenderek Sep 2015 +# ftp://ftp.elf.stuba.sk/pub/pc/pack/ +0 string xpa XPA +!:ext xpa +# XPA32 +# ftp://ftp.elf.stuba.sk/pub/pc/pack/xpa32.zip +# created by XPA32.EXE version 1.0.2 for Windows +>0 string xpa\0\1 \b32 archive data +# created by XPACK.COM version 1.67m or 1.67r with short 0x1800 +>3 ubeshort !0x0001 \bck archive data # XPack Single Data -0 string \xc3\x8d\ jm XPack single archive data +# changed by Joerg Jenderek Sep 2015 back to like in version 5.12 +# letter 'I'+ acute accent is equivalent to \xcd +0 string \xcd\ jm Xpack single archive data +#!:mime application/x-xpa-compressed +!:ext xpa # TODO: missing due to unknown magic/magic at end of file: #DWC Modified: stable/9/contrib/file/magic/Magdir/c-lang ============================================================================== --- stable/9/contrib/file/magic/Magdir/c-lang Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/c-lang Mon Apr 18 08:30:52 2016 (r298198) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: c-lang,v 1.19 2014/06/03 19:17:27 christos Exp $ +# $File: c-lang,v 1.20 2015/07/27 14:33:10 christos Exp $ # c-lang: file(1) magic for C and related languages programs # @@ -29,7 +29,7 @@ # C++ # The strength of these rules is increased so they beat the C rules above -0 regex \^template[\ \t\n]+ C++ source text +0 regex \^template[\ \t]+<.*>[\ \t\n]+ C++ source text !:strength + 5 !:mime text/x-c++ 0 regex \^virtual[\ \t\n]+ C++ source text Modified: stable/9/contrib/file/magic/Magdir/c64 ============================================================================== --- stable/9/contrib/file/magic/Magdir/c64 Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/c64 Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: c64,v 1.5 2009/09/19 16:28:08 christos Exp $ +# $File: c64,v 1.6 2015/08/24 05:17:42 christos Exp $ # c64: file(1) magic for various commodore 64 related files # # From: Dirk Jagdmann @@ -41,3 +41,9 @@ >32 leshort x Version:0x%x >36 leshort !0 Entries:%i >40 string x Name:%.24s + +# Raw tape file format (.tap files) +# Esa Hyyti +0 string C64-TAPE-RAW C64 Raw Tape File (.tap), +>0x0c byte x Version:%u, +>0x10 lelong x Length:%u cycles Modified: stable/9/contrib/file/magic/Magdir/compress ============================================================================== --- stable/9/contrib/file/magic/Magdir/compress Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/compress Mon Apr 18 08:30:52 2016 (r298198) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: compress,v 1.63 2015/03/11 19:27:35 christos Exp $ +# $File: compress,v 1.64 2015/07/27 15:41:09 christos Exp $ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc. @@ -258,7 +258,8 @@ !:mime application/x-qpress # Zlib https://www.ietf.org/rfc/rfc6713.txt -0 beshort%31 =0 ->0 byte&0xf =8 ->>0 byte&0x80 =0 zlib compressed data +0 string/b x +>0 beshort%31 =0 +>>0 byte&0xf =8 +>>>0 byte&0x80 =0 zlib compressed data !:mime application/zlib Modified: stable/9/contrib/file/magic/Magdir/database ============================================================================== --- stable/9/contrib/file/magic/Magdir/database Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/database Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: database,v 1.43 2014/10/28 15:47:39 christos Exp $ +# $File: database,v 1.45 2015/09/09 16:25:29 christos Exp $ # database: file(1) magic for various databases # # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk) @@ -533,9 +533,15 @@ # From: Stephane Blondon http://www.yaal.fr # Database file for Zope (done by FileStorage) -0 string FS21 Zope Object Database File Storage (data) +0 string FS21 Zope Object Database File Storage v3 (data) +0 string FS30 Zope Object Database File Storage v4 (data) + # Cache file for the database of Zope (done by ClientStorage) 0 string ZEC3 Zope Object Database Client Cache File (data) # IDA (Interactive Disassembler) database 0 string IDA1 IDA (Interactive Disassembler) database + +# Hopper (reverse engineering tool) http://www.hopperapp.com/ +0 string hopperdb Hopper database + Modified: stable/9/contrib/file/magic/Magdir/elf ============================================================================== --- stable/9/contrib/file/magic/Magdir/elf Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/elf Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: elf,v 1.68 2014/09/19 19:05:57 christos Exp $ +# $File: elf,v 1.69 2015/06/16 17:23:08 christos Exp $ # elf: file(1) magic for ELF executables # # We have to check the byte order flag to see what byte order all the @@ -15,6 +15,32 @@ # Modified by (4): (VMS Itanium) # Modified by (5): Matthias Urlichs (Listing of many architectures) +0 name elf-mips +>0 lelong&0xf0000000 0x00000000 MIPS-I +>0 lelong&0xf0000000 0x10000000 MIPS-II +>0 lelong&0xf0000000 0x20000000 MIPS-III +>0 lelong&0xf0000000 0x30000000 MIPS-IV +>0 lelong&0xf0000000 0x40000000 MIPS-V +>0 lelong&0xf0000000 0x50000000 MIPS32 +>0 lelong&0xf0000000 0x60000000 MIPS64 +>0 lelong&0xf0000000 0x70000000 MIPS32 rel2 +>0 lelong&0xf0000000 0x80000000 MIPS64 rel2 +>0 lelong&0xf0000000 0x90000000 MIPS32 rel6 +>0 lelong&0xf0000000 0xa0000000 MIPS64 rel6 + +0 name elf-sparc +>0 lelong&0x00ffff00 0x00000100 V8+ Required, +>0 lelong&0x00ffff00 0x00000200 Sun UltraSPARC1 Extensions Required, +>0 lelong&0x00ffff00 0x00000400 HaL R1 Extensions Required, +>0 lelong&0x00ffff00 0x00000800 Sun UltraSPARC3 Extensions Required, +>0 lelong&0x3 0 total store ordering, +>0 lelong&0x3 1 partial store ordering, +>0 lelong&0x3 2 relaxed memory ordering, + +0 name elf-pa-risc +>2 leshort 0x0214 2.0 +>0 leshort &0x0008 (LP64) + 0 name elf-le >16 leshort 0 no file type, !:mime application/octet-stream @@ -55,47 +81,26 @@ >18 leshort 8 # only for 32-bit >>4 byte 1 ->>>36 lelong&0xf0000000 0x00000000 MIPS-I ->>>36 lelong&0xf0000000 0x10000000 MIPS-II ->>>36 lelong&0xf0000000 0x20000000 MIPS-III ->>>36 lelong&0xf0000000 0x30000000 MIPS-IV ->>>36 lelong&0xf0000000 0x40000000 MIPS-V ->>>36 lelong&0xf0000000 0x50000000 MIPS32 ->>>36 lelong&0xf0000000 0x60000000 MIPS64 ->>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2 ->>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2 +>>>36 use elf-mips # only for 64-bit >>4 byte 2 ->>>48 lelong&0xf0000000 0x00000000 MIPS-I ->>>48 lelong&0xf0000000 0x10000000 MIPS-II ->>>48 lelong&0xf0000000 0x20000000 MIPS-III ->>>48 lelong&0xf0000000 0x30000000 MIPS-IV ->>>48 lelong&0xf0000000 0x40000000 MIPS-V ->>>48 lelong&0xf0000000 0x50000000 MIPS32 ->>>48 lelong&0xf0000000 0x60000000 MIPS64 ->>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2 ->>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2 +>>>48 use elf-mips >18 leshort 9 Amdahl, >18 leshort 10 MIPS (deprecated), >18 leshort 11 RS6000, >18 leshort 15 PA-RISC, # only for 32-bit >>4 byte 1 ->>>38 leshort 0x0214 2.0 ->>>36 leshort &0x0008 (LP64) +>>>36 use elf-pa-risc # only for 64-bit >>4 byte 2 ->>>50 leshort 0x0214 2.0 ->>>48 leshort &0x0008 (LP64) +>>>48 use elf-pa-risc >18 leshort 16 nCUBE, >18 leshort 17 Fujitsu VPP500, >18 leshort 18 SPARC32PLUS, # only for 32-bit >>4 byte 1 ->>>36 lelong&0xffff00 0x000100 V8+ Required, ->>>36 lelong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required, ->>>36 lelong&0xffff00 0x000400 HaL R1 Extensions Required, ->>>36 lelong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required, +>>>36 use elf-sparc >18 leshort 19 Intel 80960, >18 leshort 20 PowerPC or cisco 4500, >18 leshort 21 64-bit PowerPC or cisco 7500, @@ -117,12 +122,7 @@ >18 leshort 42 Renesas SH, >18 leshort 43 SPARC V9, >>4 byte 2 ->>>48 lelong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required, ->>>48 lelong&0xffff00 0x000400 HaL R1 Extensions Required, ->>>48 lelong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required, ->>>48 lelong&0x3 0 total store ordering, ->>>48 lelong&0x3 1 partial store ordering, ->>>48 lelong&0x3 2 relaxed memory ordering, +>>>48 use elf-sparc >18 leshort 44 Siemens Tricore Embedded Processor, >18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc., >18 leshort 46 Renesas H8/300, Modified: stable/9/contrib/file/magic/Magdir/filesystems ============================================================================== --- stable/9/contrib/file/magic/Magdir/filesystems Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/filesystems Mon Apr 18 08:30:52 2016 (r298198) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: filesystems,v 1.109 2015/02/22 01:22:54 christos Exp $ +# $File: filesystems,v 1.111 2015/09/09 16:26:54 christos Exp $ # filesystems: file(1) magic for different filesystems # 0 name partid @@ -1721,7 +1721,7 @@ 0x410 leshort 0x137f !:strength / 2 >0x402 beshort < 100 ->0x402 beshort > -1 Minix filesystem, V1, %d zones +>0x402 beshort > -1 Minix filesystem, V1, 14 char names, %d zones >0x1e string minix \b, bootable 0x410 beshort 0x137f !:strength / 2 @@ -1740,27 +1740,26 @@ >0x1e string minix \b, bootable 0x410 leshort 0x2468 >0x402 beshort < 100 ->>0x402 beshort > -1 Minix filesystem, V2, %d zones +>>0x402 beshort > -1 Minix filesystem, V2, 14 char names >0x1e string minix \b, bootable 0x410 beshort 0x2468 >0x402 beshort < 100 ->0x402 beshort > -1 Minix filesystem, V2 (big endian), %d zones +>0x402 beshort > -1 Minix filesystem, V2 (big endian) >0x1e string minix \b, bootable - 0x410 leshort 0x2478 >0x402 beshort < 100 ->0x402 beshort > -1 Minix filesystem, V2, 30 char names, %d zones +>0x402 beshort > -1 Minix filesystem, V2, 30 char names >0x1e string minix \b, bootable 0x410 leshort 0x2478 >0x402 beshort < 100 ->0x402 beshort > -1 Minix filesystem, V2, 30 char names, %d zones +>0x402 beshort > -1 Minix filesystem, V2, 30 char names >0x1e string minix \b, bootable 0x410 beshort 0x2478 ->0x402 beshort !0 Minix filesystem, V2, 30 char names (big endian), %d zones ->0x1e string minix \b, bootable -0x410 leshort 0x4d5a ->0x402 beshort !0 Minix filesystem, V3, %d zones +>0x402 beshort !0 Minix filesystem, V2, 30 char names (big endian) >0x1e string minix \b, bootable +0x418 leshort 0x4d5a +>0x402 beshort <100 +>>0x402 beshort > -1 Minix filesystem, V3, 60 char names # SGI disk labels - Nathan Scott 0 belong 0x0BE5A941 SGI disk label (volume header) @@ -2209,13 +2208,21 @@ >>0x10024 belong x (blocksize %d, >>0x10060 string >\0 lockproto %s) -# BTRFS -0x10040 string _BHRfS_M BTRFS Filesystem ->0x1012b string >\0 (label "%s", ->0x10090 lelong x sectorsize %d, ->0x10094 lelong x nodesize %d, ->0x10098 lelong x leafsize %d) - +# Russell Coker +0x10040 string _BHRfS_M BTRFS Filesystem +>0x1012b string >\0 label "%s", +>0x10090 lelong x sectorsize %d, +>0x10094 lelong x nodesize %d, +>0x10098 lelong x leafsize %d, +>0x10020 belong x UUID=%8x- +>0x10024 beshort x \b%4x- +>0x10026 beshort x \b%4x- +>0x10028 beshort x \b%4x- +>0x1002a beshort x \b%4x +>0x1002c belong x \b%8x, +>0x10078 lequad x %lld/ +>0x10070 lequad x \b%lld bytes used, +>0x10088 lequad x %lld devices # dvdisaster's .ecc # From: "Nelson A. de Oliveira" Modified: stable/9/contrib/file/magic/Magdir/fortran ============================================================================== --- stable/9/contrib/file/magic/Magdir/fortran Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/fortran Mon Apr 18 08:30:52 2016 (r298198) @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ -# $File: fortran,v 1.8 2014/06/03 19:01:34 christos Exp $ +# $File: fortran,v 1.9 2015/06/17 19:55:27 christos Exp $ # FORTRAN source -0 regex/100l \^[Cc][\ \t] FORTRAN program +0 regex/100l \^[Cc][\ \t] FORTRAN program text !:mime text/x-fortran !:strength - 5 Modified: stable/9/contrib/file/magic/Magdir/frame ============================================================================== --- stable/9/contrib/file/magic/Magdir/frame Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/frame Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: frame,v 1.12 2009/09/19 16:28:09 christos Exp $ +# $File: frame,v 1.13 2015/08/29 07:10:35 christos Exp $ # frame: file(1) magic for FrameMaker files # # This stuff came on a FrameMaker demo tape, most of which is @@ -41,10 +41,10 @@ >10 string 1.0 (1.0 >13 byte x %c) # XXX - this book entry should be verified, if you find one, uncomment this -#0 string \6 string 3.0 (3.0) #>6 string 2.0 (2.0) #>6 string 1.0 (1.0) -0 string \ # I don't see why these might collide with anything else. # # Interactive Fiction related formats @@ -69,3 +70,4 @@ >8 string IFRS \b, Blorb Interactive Fiction >>24 string Exec with executable chunk >8 string IFZS \b, Z-machine or Glulx saved game file (Quetzal) +!:mime application/x-blorb Modified: stable/9/contrib/file/magic/Magdir/images ============================================================================== --- stable/9/contrib/file/magic/Magdir/images Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/images Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: images,v 1.106 2015/02/22 01:26:05 christos Exp $ +# $File: images,v 1.107 2015/07/11 14:40:10 christos Exp $ # images: file(1) magic for image formats (see also "iff", and "c-lang" for # XPM bitmaps) # @@ -37,7 +37,7 @@ # The next byte following the magic is always whitespace. # strength is changed to try these patterns before "x86 boot sector" 0 name netpbm ->3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm PPM image data +>3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm image data >>&0 regex =[0-9]{1,50} \b, size = %s x >>>&0 regex =[0-9]{1,50} \b %s @@ -59,7 +59,6 @@ !:strength + 45 !:mime image/x-portable-pixmap - 0 string P4 >0 use netpbm >>0 string x \b, rawbits, bitmap Modified: stable/9/contrib/file/magic/Magdir/karma ============================================================================== --- stable/9/contrib/file/magic/Magdir/karma Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/karma Mon Apr 18 08:30:52 2016 (r298198) @@ -1,9 +1,9 @@ #------------------------------------------------------------------------------ -# $File: karma,v 1.7 2014/04/30 21:41:02 christos Exp $ +# $File: karma,v 1.8 2015/08/29 07:10:35 christos Exp $ # karma: file(1) magic for Karma data files # # From -0 string KarmaRHD Version Karma Data Structure Version +0 string KarmaRHD\040Version Karma Data Structure Version >16 belong x %u Modified: stable/9/contrib/file/magic/Magdir/linux ============================================================================== --- stable/9/contrib/file/magic/Magdir/linux Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/linux Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: linux,v 1.62 2015/05/03 13:06:36 christos Exp $ +# $File: linux,v 1.63 2015/08/24 05:16:11 christos Exp $ # linux: file(1) magic for Linux files # # Values for Linux/i386 binaries, from Daniel Quinlan @@ -417,6 +417,25 @@ 0 lelong 0xde020109 locale archive >24 lelong x %d strings +# Linux Software RAID (mdadm) +# Russell Coker +0 name linuxraid +>16 belong x UUID=%8x: +>20 belong x \b%8x: +>24 belong x \b%8x: +>28 belong x \b%8x +>32 string x name=%s +>72 lelong x level=%d +>92 lelong x disks=%d + +4096 lelong 0xa92b4efc Linux Software RAID +>4100 lelong x version 1.2 (%d) +>4096 use linuxraid + +0 lelong 0xa92b4efc Linux Software RAID +>4 lelong x version 1.1 (%d) +>0 use linuxraid + # Summary: Database file for mlocate # Description: A database file as used by mlocate, a fast implementation # of locate/updatedb. It uses merging to reuse the existing Modified: stable/9/contrib/file/magic/Magdir/mail.news ============================================================================== --- stable/9/contrib/file/magic/Magdir/mail.news Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/mail.news Mon Apr 18 08:30:52 2016 (r298198) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: mail.news,v 1.22 2013/01/04 14:22:07 christos Exp $ +# $File: mail.news,v 1.23 2015/06/29 14:44:26 christos Exp $ # mail.news: file(1) magic for mail and news # # Unfortunately, saved netnews also has From line added in some news software. @@ -41,6 +41,7 @@ # From: Simon Matter 0 string \241\002\213\015skiplist\ file\0\0\0 Cyrus skiplist DB +0 string \241\002\213\015twoskip\ file\0\0\0\0 Cyrus twoskip DB # JAM(mbp) Fidonet message area databases # JHR file Modified: stable/9/contrib/file/magic/Magdir/make ============================================================================== --- stable/9/contrib/file/magic/Magdir/make Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/make Mon Apr 18 08:30:52 2016 (r298198) @@ -1,15 +1,21 @@ #------------------------------------------------------------------------------ -# $File: make,v 1.1 2011/12/08 12:12:46 rrt Exp $ +# $File: make,v 1.2 2015/08/25 07:34:06 christos Exp $ # make: file(1) magic for makefiles # -0 regex \^CFLAGS makefile script text +0 regex/100l \^CFLAGS makefile script text !:mime text/x-makefile -0 regex \^LDFLAGS makefile script text +0 regex/100l \^VPATH makefile script text !:mime text/x-makefile -0 regex \^all: makefile script text +0 regex/100l \^LDFLAGS makefile script text !:mime text/x-makefile -0 regex \^.PRECIOUS makefile script text +0 regex/100l \^all: makefile script text +!:mime text/x-makefile +0 regex/100l \^\.PRECIOUS makefile script text +!:mime text/x-makefile +0 regex/100l \^\.BEGIN BSD makefile script text +!:mime text/x-makefile +0 regex/100l \^\.include BSD makefile script text !:mime text/x-makefile -0 regex \^SUBDIRS automake makefile script text +0 regex/100l \^SUBDIRS automake makefile script text !:mime text/x-makefile Modified: stable/9/contrib/file/magic/Magdir/map ============================================================================== --- stable/9/contrib/file/magic/Magdir/map Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/map Mon Apr 18 08:30:52 2016 (r298198) @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ -# $File: map,v 1.1 2014/06/03 18:22:25 christos Exp $ +# $File: map,v 1.4 2015/08/10 05:18:27 christos Exp $ # map: file(1) magic for Map data # @@ -9,9 +9,11 @@ 8 string .FIT FIT Map data >15 byte 0 >>35 belong x \b, unit id %d -# 20 years after unix epoch >>39 lelong x \b, serial %u ->>43 ledate/631152000 x \b, %s +# http://pub.ks-and-ks.ne.jp/cycling/edge500_fit.shtml +# 20 years after unix epoch +# TZ=GMT date -d '1989-12-31 0:00' +%s +>>43 leldate+631065600 x \b, %s >>47 leshort x \b, manufacturer %d >>47 leshort 1 \b (garmin) @@ -23,3 +25,17 @@ >>53 byte 4 \b (Activity) >>53 byte 8 \b (Elevations) >>53 byte 10 \b (Totals) + +# TOM TOM GPS watches ttbin files: +# http://github.com/ryanbinns/ttwatch/tree/master/ttbin +# From: Daniel Lenski +0 byte 0x20 +>1 leshort 0x0007 +>>0x76 byte 0x20 +>>>0x77 leshort 0x0075 TomTom activity file, v7 +>>>>8 leldate x (%s, +>>>>3 byte x device firmware %d. +>>>>4 byte x \b%d. +>>>>5 byte x \b%d, +>>>>6 leshort x product ID %04d) + Modified: stable/9/contrib/file/magic/Magdir/msdos ============================================================================== --- stable/9/contrib/file/magic/Magdir/msdos Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/msdos Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: msdos,v 1.100 2014/06/03 19:17:27 christos Exp $ +# $File: msdos,v 1.101 2015/08/24 05:08:48 christos Exp $ # msdos: file(1) magic for MS-DOS files # @@ -772,7 +772,7 @@ 0 ulequad 0x3a000000024e4c MS Advisor help file # HtmlHelp files (.chm) -0 string/b ITSF\003\000\000\000\x60\000\000\000\001\000\000\000 MS Windows HtmlHelp Data +0 string/b ITSF\003\000\000\000\x60\000\000\000 MS Windows HtmlHelp Data # GFA-BASIC (Wolfram Kleff) 2 string/b GFA-BASIC3 GFA-BASIC 3 data Modified: stable/9/contrib/file/magic/Magdir/netscape ============================================================================== --- stable/9/contrib/file/magic/Magdir/netscape Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/netscape Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: netscape,v 1.6 2009/09/19 16:28:11 christos Exp $ +# $File: netscape,v 1.7 2015/08/24 05:20:52 christos Exp $ # netscape: file(1) magic for Netscape files # "H. Nanosecond" # version 3 and 4 I think @@ -22,4 +22,5 @@ # #This is files ending in .art, FIXME add more rules -0 string JG\004\016\0\0\0\0 ART +0 string JG\004\016\0\0\0\0 AOL ART image +0 string JG\003\016\0\0\0\0 AOL ART image Modified: stable/9/contrib/file/magic/Magdir/python ============================================================================== --- stable/9/contrib/file/magic/Magdir/python Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/python Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: python,v 1.26 2014/08/04 05:58:40 christos Exp $ +# $File: python,v 1.27 2015/09/08 13:59:44 christos Exp $ # python: file(1) magic for python # # Outlook puts """ too for urgent messages @@ -26,12 +26,16 @@ 0 belong 0xee0c0d0a python 3.4 byte-compiled 0 search/1/w #!\ /usr/bin/python Python script text executable +!:strength + 10 !:mime text/x-python 0 search/1/w #!\ /usr/local/bin/python Python script text executable +!:strength + 10 !:mime text/x-python 0 search/1 #!/usr/bin/env\ python Python script text executable +!:strength + 10 !:mime text/x-python -0 search/1 #!\ /usr/bin/env\ python Python script text executable +0 search/10 #!\ /usr/bin/env\ python Python script text executable +!:strength + 10 !:mime text/x-python Modified: stable/9/contrib/file/magic/Magdir/scientific ============================================================================== --- stable/9/contrib/file/magic/Magdir/scientific Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/scientific Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: scientific,v 1.9 2014/06/03 19:01:34 christos Exp $ +# $File: scientific,v 1.10 2015/08/24 05:18:55 christos Exp $ # scientific: file(1) magic for scientific formats # # From: Joe Krahn @@ -104,3 +104,8 @@ >>5 byte x version %d.0 >4 byte >0x00 version %d >>5 byte x \b.%d + +# Type: LXT (interLaced eXtensible Trace) +# chrysn +0 beshort 0x0138 interLaced eXtensible Trace (LXT) file +>2 beshort >0 (Version %u) Modified: stable/9/contrib/file/magic/Magdir/sgi ============================================================================== --- stable/9/contrib/file/magic/Magdir/sgi Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/sgi Mon Apr 18 08:30:52 2016 (r298198) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: sgi,v 1.21 2014/04/30 21:41:02 christos Exp $ +# $File: sgi,v 1.22 2015/08/29 07:10:35 christos Exp $ # sgi: file(1) magic for Silicon Graphics operating systems and applications # # Executable images are handled either in aout (for old-style a.out @@ -55,8 +55,8 @@ 0 string WNGZWZSS Wingz spreadsheet 0 string WNGZWZHP Wingz help file # -0 string #Inventor V IRIS Inventor 1.0 file -0 string #Inventor V2 Open Inventor 2.0 file +0 string #Inventor\040V IRIS Inventor 1.0 file +0 string #Inventor\040V2 Open Inventor 2.0 file # GLF is OpenGL stream encoding 0 string glfHeadMagic(); GLF_TEXT 4 belong 0x7d000000 GLF_BINARY_LSB_FIRST Modified: stable/9/contrib/file/magic/Magdir/sgml ============================================================================== --- stable/9/contrib/file/magic/Magdir/sgml Mon Apr 18 08:24:13 2016 (r298197) +++ stable/9/contrib/file/magic/Magdir/sgml Mon Apr 18 08:30:52 2016 (r298198) @@ -1,5 +1,4 @@ -#------------------------------------------------------------------------------ -# $File: sgml,v 1.31 2015/03/11 19:38:04 christos Exp $ +#------------------------------------------------------------------------------ # $File: sgml,v 1.32 2015/07/11 15:08:53 christos Exp $ # Type: SVG Vectorial Graphics # From: Noel Torres 0 string \15 string >\0 ->>19 search/4096/cWbt \19 search/4096/cWbt \>15 string >\0 (version %.3s) !:mime text/html 0 string/t \15 string >\0 ->>19 search/4096/cWbt \19 search/4096/cWbt \>15 string >\0 (version %.3s) !:mime text/html 0 string/t \15 string >\0 ->>19 search/4096/cWbt \19 search/4096/cWbt \>15 string >\0 (version %.3s) !:mime text/html #------------------------------------------------------------------------------ @@ -106,9 +105,6 @@ >15 string/t >\0 %.3s document text *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Apr 18 09:29:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB29BB1173C; Mon, 18 Apr 2016 09:29:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CFFE112E; Mon, 18 Apr 2016 09:29:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I9TEIv095109; Mon, 18 Apr 2016 09:29:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I9TEA3095105; Mon, 18 Apr 2016 09:29:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604180929.u3I9TEA3095105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 Apr 2016 09:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298199 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 09:29:16 -0000 Author: tuexen Date: Mon Apr 18 09:29:14 2016 New Revision: 298199 URL: https://svnweb.freebsd.org/changeset/base/298199 Log: Put panic() calls under INVARIANTS. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Apr 18 08:30:52 2016 (r298198) +++ head/sys/netinet/sctp_indata.c Mon Apr 18 09:29:14 2016 (r298199) @@ -570,9 +570,11 @@ protocol_error: sctp_ucount_decr(asoc->cnt_on_all_streams); if (control->on_strm_q == SCTP_ON_ORDERED) { TAILQ_REMOVE(&strm->inqueue, control, next_instrm); +#ifdef INVARIANTS } else { panic("Huh control: %p is on_strm_q: %d", control, control->on_strm_q); +#endif } control->on_strm_q = 0; strm->last_sequence_delivered++; @@ -674,7 +676,11 @@ sctp_add_to_tail_pointer(struct sctp_que stcb = control->stcb; if (stcb == NULL) { +#ifdef INVARIANTS panic("Control broken"); +#else + return; +#endif } if (control->tail_mbuf == NULL) { /* TSNH */ @@ -1020,10 +1026,12 @@ sctp_deliver_reasm_check(struct sctp_tcb if (control->end_added) { /* We just put the last bit on */ if (control->on_strm_q) { +#ifdef INVARIANTS if (control->on_strm_q != SCTP_ON_UNORDERED) { panic("Huh control: %p on_q: %d -- not unordered?", control, control->on_strm_q); } +#endif TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); control->on_strm_q = 0; } @@ -1072,10 +1080,12 @@ done_un: strm->last_sequence_delivered); if (control->end_added) { if (control->on_strm_q) { +#ifdef INVARIANTS if (control->on_strm_q != SCTP_ON_ORDERED) { panic("Huh control: %p on_q: %d -- not ordered?", control, control->on_strm_q); } +#endif TAILQ_REMOVE(&strm->inqueue, control, next_instrm); control->on_strm_q = 0; } @@ -1113,10 +1123,12 @@ deliver_more: if (control->end_added) { /* We are done with it afterwards */ if (control->on_strm_q) { +#ifdef INVARIANTS if (control->on_strm_q != SCTP_ON_ORDERED) { panic("Huh control: %p on_q: %d -- not ordered?", control, control->on_strm_q); } +#endif TAILQ_REMOVE(&strm->inqueue, control, next_instrm); control->on_strm_q = 0; } @@ -1210,9 +1222,11 @@ sctp_add_chk_to_control(struct sctp_queu /* Ordered */ TAILQ_REMOVE(&strm->inqueue, control, next_instrm); control->on_strm_q = 0; +#ifdef INVARIANTS } else if (control->on_strm_q) { panic("Unknown state on ctrl: %p on_strm_q: %d", control, control->on_strm_q); +#endif } } control->end_added = 1; @@ -5167,9 +5181,11 @@ sctp_kick_prsctp_reorder_queue(struct sc TAILQ_REMOVE(&strmin->inqueue, ctl, next_instrm); } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm); +#ifdef INVARIANTS } else { panic("strmin: %p ctl: %p unknown %d", strmin, ctl, ctl->on_strm_q); +#endif } ctl->on_strm_q = 0; } @@ -5230,9 +5246,11 @@ sctp_kick_prsctp_reorder_queue(struct sc TAILQ_REMOVE(&strmin->inqueue, ctl, next_instrm); } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm); +#ifdef INVARIANTS } else { panic("strmin: %p ctl: %p unknown %d", strmin, ctl, ctl->on_strm_q); +#endif } ctl->on_strm_q = 0; } @@ -5493,9 +5511,11 @@ sctp_handle_forward_tsn(struct sctp_tcb TAILQ_REMOVE(&strm->inqueue, ctl, next_instrm); } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { TAILQ_REMOVE(&strm->uno_inqueue, ctl, next_instrm); +#ifdef INVARIANTS } else if (ctl->on_strm_q) { panic("strm: %p ctl: %p unknown %d", strm, ctl, ctl->on_strm_q); +#endif } ctl->on_strm_q = 0; stcb->asoc.control_pdapi = ctl; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Apr 18 08:30:52 2016 (r298198) +++ head/sys/netinet/sctp_input.c Mon Apr 18 09:29:14 2016 (r298199) @@ -900,10 +900,12 @@ sctp_handle_shutdown(struct sctp_shutdow /* Ordered */ TAILQ_REMOVE(&strm->inqueue, asoc->control_pdapi, next_instrm); asoc->control_pdapi->on_strm_q = 0; +#ifdef INVARIANTS } else { panic("Unknown state on ctrl:%p on_strm_q:%d", asoc->control_pdapi, asoc->control_pdapi->on_strm_q); +#endif } } asoc->control_pdapi->end_added = 1; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Apr 18 08:30:52 2016 (r298198) +++ head/sys/netinet/sctputil.c Mon Apr 18 09:29:14 2016 (r298199) @@ -5565,10 +5565,12 @@ restart_nosblocks: sctp_m_free(control->aux_data); control->aux_data = NULL; } +#ifdef INVARIANTS if (control->on_strm_q) { panic("About to free ctl:%p so:%p and its in %d", control, so, control->on_strm_q); } +#endif sctp_free_remote_addr(control->whoFrom); sctp_free_a_readq(stcb, control); if (hold_rlock) { @@ -5976,10 +5978,12 @@ get_more_data: no_rcv_needed = control->do_not_ref_stcb; sctp_free_remote_addr(control->whoFrom); control->data = NULL; +#ifdef INVARIANTS if (control->on_strm_q) { panic("About to free ctl:%p so:%p and its in %d", control, so, control->on_strm_q); } +#endif sctp_free_a_readq(stcb, control); control = NULL; if ((freed_so_far >= rwnd_req) && From owner-svn-src-all@freebsd.org Mon Apr 18 09:39:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D86BB11B72; Mon, 18 Apr 2016 09:39:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E7BA18F3; Mon, 18 Apr 2016 09:39:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I9dk02098068; Mon, 18 Apr 2016 09:39:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I9dk85098067; Mon, 18 Apr 2016 09:39:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604180939.u3I9dk85098067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 Apr 2016 09:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298200 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 09:39:47 -0000 Author: tuexen Date: Mon Apr 18 09:39:46 2016 New Revision: 298200 URL: https://svnweb.freebsd.org/changeset/base/298200 Log: Fix a warning about an unused variable. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Apr 18 09:29:14 2016 (r298199) +++ head/sys/netinet/sctp_indata.c Mon Apr 18 09:39:46 2016 (r298200) @@ -1288,7 +1288,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } } } - if ((asoc->idata_supported == 0) && ((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED)) { + if ((asoc->idata_supported == 0) && (unordered == 1)) { sctp_inject_old_data_unordered(stcb, asoc, strm, control, chk, abort_flag); return; } From owner-svn-src-all@freebsd.org Mon Apr 18 09:56:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0D60B12497; Mon, 18 Apr 2016 09:56:42 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 815D51435; Mon, 18 Apr 2016 09:56:42 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3I9uffO004425; Mon, 18 Apr 2016 09:56:41 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3I9ufjb004424; Mon, 18 Apr 2016 09:56:41 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201604180956.u3I9ufjb004424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Mon, 18 Apr 2016 09:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298201 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 09:56:42 -0000 Author: pluknet Date: Mon Apr 18 09:56:41 2016 New Revision: 298201 URL: https://svnweb.freebsd.org/changeset/base/298201 Log: Fixed indentation, minor style. Modified: head/lib/libc/stdlib/qsort.3 Modified: head/lib/libc/stdlib/qsort.3 ============================================================================== --- head/lib/libc/stdlib/qsort.3 Mon Apr 18 09:39:46 2016 (r298200) +++ head/lib/libc/stdlib/qsort.3 Mon Apr 18 09:56:41 2016 (r298201) @@ -252,16 +252,16 @@ and then prints the sorted array to stan #include /* - * Custom comparison function that can compare 'int' values through pointers + * Custom comparison function that compares 'int' values through pointers * passed by qsort(3). */ static int int_compare(const void *p1, const void *p2) { - int left = *(const int *)p1; - int right = *(const int *)p2; + int left = *(const int *)p1; + int right = *(const int *)p2; - return ((left > right) - (left < right)); + return ((left > right) - (left < right)); } /* @@ -270,15 +270,15 @@ int_compare(const void *p1, const void * int main(void) { - int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 }; - const size_t array_size = sizeof(int_array) / sizeof(int_array[0]); - size_t k; + int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 }; + size_t array_size = sizeof(int_array) / sizeof(int_array[0]); + size_t k; - qsort(&int_array, array_size, sizeof(int_array[0]), int_compare); - for (k = 0; k < array_size; k++) - printf(" %d", int_array[k]); - puts(""); - return (EXIT_SUCCESS); + qsort(&int_array, array_size, sizeof(int_array[0]), int_compare); + for (k = 0; k < array_size; k++) + printf(" %d", int_array[k]); + puts(""); + return (EXIT_SUCCESS); } .Ed .Sh COMPATIBILITY From owner-svn-src-all@freebsd.org Mon Apr 18 10:37:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C1FAB127EA; Mon, 18 Apr 2016 10:37:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C87BA1DD3; Mon, 18 Apr 2016 10:37:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IAbpOa016436; Mon, 18 Apr 2016 10:37:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IAbpGB016435; Mon, 18 Apr 2016 10:37:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604181037.u3IAbpGB016435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 18 Apr 2016 10:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298202 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 10:37:52 -0000 Author: andrew Date: Mon Apr 18 10:37:50 2016 New Revision: 298202 URL: https://svnweb.freebsd.org/changeset/base/298202 Log: Pull the MSI/MSI-X handling functions out to help with INTRNG integration. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Apr 18 09:56:41 2016 (r298201) +++ head/sys/dev/pci/pci_host_generic.c Mon Apr 18 10:37:50 2016 (r298202) @@ -656,6 +656,63 @@ generic_pcie_deactivate_resource(device_ return (res); } +static int +generic_pcie_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + +#if defined(__aarch64__) + return (arm_alloc_msi(pci, child, count, maxcount, irqs)); +#else + return (ENXIO); +#endif +} + +static int +generic_pcie_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + +#if defined(__aarch64__) + return (arm_release_msi(pci, child, count, irqs)); +#else + return (ENXIO); +#endif +} + +static int +generic_pcie_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + +#if defined(__aarch64__) + return (arm_map_msi(pci, child, irq, addr, data)); +#else + return (ENXIO); +#endif +} + +static int +generic_pcie_alloc_msix(device_t pci, device_t child, int *irq) +{ + +#if defined(__aarch64__) + return (arm_alloc_msix(pci, child, irq)); +#else + return (ENXIO); +#endif +} + +static int +generic_pcie_release_msix(device_t pci, device_t child, int irq) +{ + +#if defined(__aarch64__) + return (arm_release_msix(pci, child, irq)); +#else + return (ENXIO); +#endif +} + static device_method_t generic_pcie_methods[] = { DEVMETHOD(device_probe, generic_pcie_probe), DEVMETHOD(device_attach, pci_host_generic_attach), @@ -674,13 +731,11 @@ static device_method_t generic_pcie_meth DEVMETHOD(pcib_route_interrupt, generic_pcie_route_interrupt), DEVMETHOD(pcib_read_config, generic_pcie_read_config), DEVMETHOD(pcib_write_config, generic_pcie_write_config), -#if defined(__aarch64__) - DEVMETHOD(pcib_alloc_msi, arm_alloc_msi), - DEVMETHOD(pcib_release_msi, arm_release_msi), - DEVMETHOD(pcib_alloc_msix, arm_alloc_msix), - DEVMETHOD(pcib_release_msix, arm_release_msix), - DEVMETHOD(pcib_map_msi, arm_map_msi), -#endif + DEVMETHOD(pcib_alloc_msi, generic_pcie_alloc_msi), + DEVMETHOD(pcib_release_msi, generic_pcie_release_msi), + DEVMETHOD(pcib_alloc_msix, generic_pcie_alloc_msix), + DEVMETHOD(pcib_release_msix, generic_pcie_release_msix), + DEVMETHOD(pcib_map_msi, generic_pcie_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, generic_pcie_ofw_get_devinfo), From owner-svn-src-all@freebsd.org Mon Apr 18 11:39:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65CA4B119F6; Mon, 18 Apr 2016 11:39:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31BF41497; Mon, 18 Apr 2016 11:39:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IBdfp2035182; Mon, 18 Apr 2016 11:39:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IBdfGj035180; Mon, 18 Apr 2016 11:39:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604181139.u3IBdfGj035180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 Apr 2016 11:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298203 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 11:39:42 -0000 Author: tuexen Date: Mon Apr 18 11:39:41 2016 New Revision: 298203 URL: https://svnweb.freebsd.org/changeset/base/298203 Log: Fix signed/unsigned warnings. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Apr 18 10:37:50 2016 (r298202) +++ head/sys/netinet/sctp_indata.c Mon Apr 18 11:39:41 2016 (r298203) @@ -2598,7 +2598,7 @@ sctp_process_data(struct mbuf **mm, int } else { clen = sizeof(struct sctp_idata_chunk); } - if ((size_t)chk_length < clen) { + if (chk_length < clen) { /* * Need to send an abort since we had a * invalid data chunk. Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Apr 18 10:37:50 2016 (r298202) +++ head/sys/netinet/sctp_output.c Mon Apr 18 11:39:41 2016 (r298203) @@ -7186,7 +7186,8 @@ sctp_move_to_outqueue(struct sctp_tcb *s struct sctp_tmit_chunk *chk; struct sctp_data_chunk *dchkh = NULL; struct sctp_idata_chunk *ndchkh = NULL; - uint32_t to_move, length, leading; + uint32_t to_move, length; + int leading; uint8_t rcv_flags = 0; uint8_t some_taken; uint8_t send_lock_up = 0; @@ -7491,9 +7492,9 @@ dont_do_it: atomic_subtract_int(&sp->length, to_move); } if (stcb->asoc.idata_supported == 0) { - leading = (int)sizeof(struct sctp_data_chunk); + leading = sizeof(struct sctp_data_chunk); } else { - leading = (int)sizeof(struct sctp_idata_chunk); + leading = sizeof(struct sctp_idata_chunk); } if (M_LEADINGSPACE(chk->data) < leading) { /* Not enough room for a chunk header, get some */ From owner-svn-src-all@freebsd.org Mon Apr 18 13:14:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BBEBB13591; Mon, 18 Apr 2016 13:14:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D53A1CBC; Mon, 18 Apr 2016 13:14:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IDE0Nl064828; Mon, 18 Apr 2016 13:14:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IDDxsK064810; Mon, 18 Apr 2016 13:13:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604181313.u3IDDxsK064810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Apr 2016 13:13:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298204 - in head: lib/libdwarf lib/libelf lib/libelftc usr.bin/addr2line usr.bin/cxxfilt usr.bin/elfcopy usr.bin/nm usr.bin/readelf usr.bin/size usr.bin/strings X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 13:14:01 -0000 Author: emaste Date: Mon Apr 18 13:13:59 2016 New Revision: 298204 URL: https://svnweb.freebsd.org/changeset/base/298204 Log: Replace ${CURDIR}/../.. with ${CURDIR:H:H} in elftoolchain This produces a nicer path in debug info and build logs. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libdwarf/Makefile head/lib/libelf/Makefile head/lib/libelftc/Makefile head/usr.bin/addr2line/Makefile head/usr.bin/cxxfilt/Makefile head/usr.bin/elfcopy/Makefile head/usr.bin/nm/Makefile head/usr.bin/readelf/Makefile head/usr.bin/size/Makefile head/usr.bin/strings/Makefile Modified: head/lib/libdwarf/Makefile ============================================================================== --- head/lib/libdwarf/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/lib/libdwarf/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -2,7 +2,7 @@ .include PACKAGE=lib${LIB} -TOP= ${.CURDIR}/../../contrib/elftoolchain +TOP= ${.CURDIR:H:H}/contrib/elftoolchain SRCDIR= ${TOP}/libdwarf .PATH: ${SRCDIR} Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/lib/libelf/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -5,7 +5,7 @@ SHLIBDIR?= /lib .include -TOP= ${.CURDIR}/../../contrib/elftoolchain +TOP= ${.CURDIR:H:H}/contrib/elftoolchain SRCDIR= ${TOP}/libelf .PATH: ${SRCDIR} Modified: head/lib/libelftc/Makefile ============================================================================== --- head/lib/libelftc/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/lib/libelftc/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -4,7 +4,7 @@ PACKAGE=lib${LIB} INTERNALLIB= -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain .PATH: ${ELFTCDIR}/libelftc Modified: head/usr.bin/addr2line/Makefile ============================================================================== --- head/usr.bin/addr2line/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/usr.bin/addr2line/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain ADDR2LINEDIR= ${ELFTCDIR}/addr2line .PATH: ${ADDR2LINEDIR} Modified: head/usr.bin/cxxfilt/Makefile ============================================================================== --- head/usr.bin/cxxfilt/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/usr.bin/cxxfilt/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain SRCDIR= ${ELFTCDIR}/cxxfilt .PATH: ${SRCDIR} Modified: head/usr.bin/elfcopy/Makefile ============================================================================== --- head/usr.bin/elfcopy/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/usr.bin/elfcopy/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain ELFCOPYDIR= ${ELFTCDIR}/elfcopy .PATH: ${ELFCOPYDIR} Modified: head/usr.bin/nm/Makefile ============================================================================== --- head/usr.bin/nm/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/usr.bin/nm/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain NMDIR= ${ELFTCDIR}/nm .PATH: ${NMDIR} Modified: head/usr.bin/readelf/Makefile ============================================================================== --- head/usr.bin/readelf/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/usr.bin/readelf/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -1,6 +1,6 @@ # $FreeBSD$ -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain READELFDIR= ${ELFTCDIR}/readelf .PATH: ${READELFDIR} Modified: head/usr.bin/size/Makefile ============================================================================== --- head/usr.bin/size/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/usr.bin/size/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain SIZEDIR= ${ELFTCDIR}/size .PATH: ${SIZEDIR} Modified: head/usr.bin/strings/Makefile ============================================================================== --- head/usr.bin/strings/Makefile Mon Apr 18 11:39:41 2016 (r298203) +++ head/usr.bin/strings/Makefile Mon Apr 18 13:13:59 2016 (r298204) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain .PATH: ${ELFTCDIR}/strings From owner-svn-src-all@freebsd.org Mon Apr 18 14:08:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F459B12875; Mon, 18 Apr 2016 14:08:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39DD41BF4; Mon, 18 Apr 2016 14:08:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IE8aBW082035; Mon, 18 Apr 2016 14:08:36 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IE8aKe082032; Mon, 18 Apr 2016 14:08:36 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604181408.u3IE8aKe082032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 14:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298205 - in head/sbin: growfs newfs restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 14:08:37 -0000 Author: araujo Date: Mon Apr 18 14:08:35 2016 New Revision: 298205 URL: https://svnweb.freebsd.org/changeset/base/298205 Log: Use NULL instead of 0 for pointers. strchr(3) will return NULL if the character does not appear in the string. MFC after: 2 weeks. Modified: head/sbin/growfs/growfs.c head/sbin/newfs/newfs.c head/sbin/restore/utilities.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Mon Apr 18 13:13:59 2016 (r298204) +++ head/sbin/growfs/growfs.c Mon Apr 18 14:08:35 2016 (r298205) @@ -1331,7 +1331,7 @@ getdev(const char *name) return (name); cp = strrchr(name, '/'); - if (cp == 0) { + if (cp == NULL) { snprintf(device, sizeof(device), "%s%s", _PATH_DEV, name); if (is_dev(device)) return (device); Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Mon Apr 18 13:13:59 2016 (r298204) +++ head/sbin/newfs/newfs.c Mon Apr 18 14:08:35 2016 (r298205) @@ -306,7 +306,7 @@ main(int argc, char *argv[]) if (!special[0]) err(1, "empty file/special name"); cp = strrchr(special, '/'); - if (cp == 0) { + if (cp == NULL) { /* * No path prefix; try prefixing _PATH_DEV. */ Modified: head/sbin/restore/utilities.c ============================================================================== --- head/sbin/restore/utilities.c Mon Apr 18 13:13:59 2016 (r298204) +++ head/sbin/restore/utilities.c Mon Apr 18 14:08:35 2016 (r298205) @@ -62,7 +62,7 @@ pathcheck(char *name) char *start; start = strchr(name, '/'); - if (start == 0) + if (start == NULL) return; for (cp = start; *cp != '\0'; cp++) { if (*cp != '/') From owner-svn-src-all@freebsd.org Mon Apr 18 14:12:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF449B12AC0; Mon, 18 Apr 2016 14:12:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 997CF1059; Mon, 18 Apr 2016 14:12:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IECgpJ084878; Mon, 18 Apr 2016 14:12:42 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IECgfm084877; Mon, 18 Apr 2016 14:12:42 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604181412.u3IECgfm084877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 14:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298206 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 14:12:43 -0000 Author: araujo Date: Mon Apr 18 14:12:42 2016 New Revision: 298206 URL: https://svnweb.freebsd.org/changeset/base/298206 Log: User NULL instead of 0 for pointers. gethostbyname(3) will return NULL in case of an error. MFC after: 2 weeks. Modified: head/sbin/ifconfig/af_inet.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Mon Apr 18 14:08:35 2016 (r298205) +++ head/sbin/ifconfig/af_inet.c Mon Apr 18 14:12:42 2016 (r298206) @@ -133,10 +133,10 @@ in_getaddr(const char *s, int which) if (inet_aton(s, &sin->sin_addr)) return; - if ((hp = gethostbyname(s)) != 0) + if ((hp = gethostbyname(s)) != NULL) bcopy(hp->h_addr, (char *)&sin->sin_addr, MIN((size_t)hp->h_length, sizeof(sin->sin_addr))); - else if ((np = getnetbyname(s)) != 0) + else if ((np = getnetbyname(s)) != NULL) sin->sin_addr = inet_makeaddr(np->n_net, INADDR_ANY); else errx(1, "%s: bad value", s); From owner-svn-src-all@freebsd.org Mon Apr 18 14:37:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 273E2B134EF; Mon, 18 Apr 2016 14:37:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBF451213; Mon, 18 Apr 2016 14:37:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IEbR2F091545; Mon, 18 Apr 2016 14:37:27 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IEbR5l091544; Mon, 18 Apr 2016 14:37:27 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604181437.u3IEbR5l091544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Apr 2016 14:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298207 - head/lib/libcompat/4.3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 14:37:28 -0000 Author: pfg Date: Mon Apr 18 14:37:26 2016 New Revision: 298207 URL: https://svnweb.freebsd.org/changeset/base/298207 Log: rexec(3): use NULL instead of zero for pointers. Modified: head/lib/libcompat/4.3/rexec.c Modified: head/lib/libcompat/4.3/rexec.c ============================================================================== --- head/lib/libcompat/4.3/rexec.c Mon Apr 18 14:12:42 2016 (r298206) +++ head/lib/libcompat/4.3/rexec.c Mon Apr 18 14:37:26 2016 (r298207) @@ -187,7 +187,7 @@ next: case LOGIN: if (token()) - if (*aname == 0) { + if (*aname == NULL) { *aname = malloc((unsigned) strlen(tokval) + 1); (void) strcpy(*aname, tokval); } else { @@ -196,14 +196,14 @@ next: } break; case PASSWD: - if ((*aname == 0 || strcmp(*aname, "anonymous")) && + if ((*aname == NULL || strcmp(*aname, "anonymous")) && fstat(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { warnx("Error: .netrc file is readable by others."); warnx("Remove password or make file unreadable by others."); goto bad; } - if (token() && *apass == 0) { + if (token() && *apass == NULL) { *apass = malloc((unsigned) strlen(tokval) + 1); (void) strcpy(*apass, tokval); } @@ -215,7 +215,7 @@ next: warnx("Remove account or make file unreadable by others."); goto bad; } - if (token() && *aacct == 0) { + if (token() && *aacct == NULL) { *aacct = malloc((unsigned) strlen(tokval) + 1); (void) strcpy(*aacct, tokval); } @@ -305,7 +305,7 @@ rexec(ahost, rport, name, pass, cmd, fd2 char c, *acct; hp = gethostbyname(*ahost); - if (hp == 0) { + if (hp == NULL) { herror(*ahost); return (-1); } From owner-svn-src-all@freebsd.org Mon Apr 18 14:41:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BB50B138FA; Mon, 18 Apr 2016 14:41:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D471819CB; Mon, 18 Apr 2016 14:41:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IEfU7N092350; Mon, 18 Apr 2016 14:41:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IEfU1B092349; Mon, 18 Apr 2016 14:41:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604181441.u3IEfU1B092349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Apr 2016 14:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298208 - head/lib/libbluetooth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 14:41:32 -0000 Author: pfg Date: Mon Apr 18 14:41:30 2016 New Revision: 298208 URL: https://svnweb.freebsd.org/changeset/base/298208 Log: libbluetooth: use NULL instead of zero for pointers. Modified: head/lib/libbluetooth/bluetooth.c Modified: head/lib/libbluetooth/bluetooth.c ============================================================================== --- head/lib/libbluetooth/bluetooth.c Mon Apr 18 14:37:26 2016 (r298207) +++ head/lib/libbluetooth/bluetooth.c Mon Apr 18 14:41:30 2016 (r298208) @@ -67,7 +67,7 @@ bt_gethostbyname(char const *name) while ((p = bt_gethostent()) != NULL) { if (strcasecmp(p->h_name, name) == 0) break; - for (cp = p->h_aliases; *cp != 0; cp++) + for (cp = p->h_aliases; *cp != NULL; cp++) if (strcasecmp(*cp, name) == 0) goto found; } @@ -180,7 +180,7 @@ bt_getprotobyname(char const *name) while ((p = bt_getprotoent()) != NULL) { if (strcmp(p->p_name, name) == 0) break; - for (cp = p->p_aliases; *cp != 0; cp++) + for (cp = p->p_aliases; *cp != NULL; cp++) if (strcmp(*cp, name) == 0) goto found; } From owner-svn-src-all@freebsd.org Mon Apr 18 14:44:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD772B13A74; Mon, 18 Apr 2016 14:44:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FAC81D18; Mon, 18 Apr 2016 14:44:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IEi1Oe094446; Mon, 18 Apr 2016 14:44:01 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IEi1gJ094445; Mon, 18 Apr 2016 14:44:01 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604181444.u3IEi1gJ094445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 18 Apr 2016 14:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298209 - head/usr.bin/finger X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 14:44:02 -0000 Author: araujo Date: Mon Apr 18 14:44:01 2016 New Revision: 298209 URL: https://svnweb.freebsd.org/changeset/base/298209 Log: Use NULL instead of 0 for pointers. strchr(3) will return NULL if the character does not appear in the string. MFC after: 2 weeks. Modified: head/usr.bin/finger/net.c Modified: head/usr.bin/finger/net.c ============================================================================== --- head/usr.bin/finger/net.c Mon Apr 18 14:41:30 2016 (r298208) +++ head/usr.bin/finger/net.c Mon Apr 18 14:44:01 2016 (r298209) @@ -68,7 +68,7 @@ netfinger(char *name) static struct addrinfo hint; host = strrchr(name, '@'); - if (host == 0) + if (host == NULL) return; *host++ = '\0'; signal(SIGALRM, cleanup); @@ -92,7 +92,7 @@ netfinger(char *name) else printf("[%s]\n", ai0->ai_canonname); - for (ai = ai0; ai != 0; ai = ai->ai_next) { + for (ai = ai0; ai != NULL; ai = ai->ai_next) { if (multi) trying(ai); From owner-svn-src-all@freebsd.org Mon Apr 18 14:45:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28C53B13B66; Mon, 18 Apr 2016 14:45:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA8341EC4; Mon, 18 Apr 2016 14:45:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IEjvcP094548; Mon, 18 Apr 2016 14:45:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IEjuqE094545; Mon, 18 Apr 2016 14:45:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604181445.u3IEjuqE094545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Apr 2016 14:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298210 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 14:45:58 -0000 Author: pfg Date: Mon Apr 18 14:45:56 2016 New Revision: 298210 URL: https://svnweb.freebsd.org/changeset/base/298210 Log: libstand: use NULL instead of zero for pointers. Modified: head/lib/libstand/cd9660.c head/lib/libstand/nfs.c head/lib/libstand/strtol.c Modified: head/lib/libstand/cd9660.c ============================================================================== --- head/lib/libstand/cd9660.c Mon Apr 18 14:44:01 2016 (r298209) +++ head/lib/libstand/cd9660.c Mon Apr 18 14:45:56 2016 (r298210) @@ -273,13 +273,13 @@ dirmatch(struct open_file *f, const char static int cd9660_open(const char *path, struct open_file *f) { - struct file *fp = 0; + struct file *fp = NULL; void *buf; struct iso_primary_descriptor *vd; size_t buf_size, read, dsize, off; daddr_t bno, boff; struct iso_directory_record rec; - struct iso_directory_record *dp = 0; + struct iso_directory_record *dp = NULL; int rc, first, use_rrip, lenskip; /* First find the volume descriptor */ @@ -415,7 +415,7 @@ cd9660_close(struct open_file *f) { struct file *fp = (struct file *)f->f_fsdata; - f->f_fsdata = 0; + f->f_fsdata = NULL; free(fp); return 0; Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Mon Apr 18 14:44:01 2016 (r298209) +++ head/lib/libstand/nfs.c Mon Apr 18 14:45:56 2016 (r298210) @@ -511,7 +511,7 @@ nfs_open(const char *upath, struct open_ #ifndef NFS_NOSYMLINK bcopy(&nfs_root_node, currfd, sizeof(*currfd)); - newfd = 0; + newfd = NULL; cp = path = strdup(upath); if (path == NULL) { @@ -593,14 +593,14 @@ nfs_open(const char *upath, struct open_ bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); - newfd = 0; + newfd = NULL; continue; } free(currfd); currfd = newfd; - newfd = 0; + newfd = NULL; } error = 0; @@ -1155,7 +1155,7 @@ nfs_open(const char *upath, struct open_ } #ifndef NFS_NOSYMLINK bcopy(&nfs_root_node, currfd, sizeof(*currfd)); - newfd = 0; + newfd = NULL; cp = path = strdup(upath); if (path == NULL) { @@ -1241,14 +1241,14 @@ nfs_open(const char *upath, struct open_ bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); - newfd = 0; + newfd = NULL; continue; } free(currfd); currfd = newfd; - newfd = 0; + newfd = NULL; } error = 0; Modified: head/lib/libstand/strtol.c ============================================================================== --- head/lib/libstand/strtol.c Mon Apr 18 14:44:01 2016 (r298209) +++ head/lib/libstand/strtol.c Mon Apr 18 14:45:56 2016 (r298210) @@ -126,7 +126,7 @@ strtol(nptr, endptr, base) errno = ERANGE; } else if (neg) acc = -acc; - if (endptr != 0) + if (endptr != NULL) *endptr = (char *)(any ? s - 1 : nptr); return (acc); } From owner-svn-src-all@freebsd.org Mon Apr 18 15:01:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8341DB1316B; Mon, 18 Apr 2016 15:01:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5100B1B94; Mon, 18 Apr 2016 15:01:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IF1nV6098309; Mon, 18 Apr 2016 15:01:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IF1n1I098308; Mon, 18 Apr 2016 15:01:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604181501.u3IF1n1I098308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Apr 2016 15:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298211 - head/libexec/ftpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 15:01:50 -0000 Author: pfg Date: Mon Apr 18 15:01:49 2016 New Revision: 298211 URL: https://svnweb.freebsd.org/changeset/base/298211 Log: ftpd: replace malloc + memset 0 with calloc. It is faster and usually safer. Use NULL instead of zero for the pointer. Modified: head/libexec/ftpd/popen.c Modified: head/libexec/ftpd/popen.c ============================================================================== --- head/libexec/ftpd/popen.c Mon Apr 18 14:45:56 2016 (r298210) +++ head/libexec/ftpd/popen.c Mon Apr 18 15:01:49 2016 (r298211) @@ -81,9 +81,8 @@ ftpd_popen(char *program, char *type) if (!pids) { if ((fds = getdtablesize()) <= 0) return (NULL); - if ((pids = malloc(fds * sizeof(int))) == NULL) + if ((pids = calloc(fds, sizeof(int))) == NULL) return (NULL); - memset(pids, 0, fds * sizeof(int)); } if (pipe(pdes) < 0) return (NULL); @@ -185,7 +184,7 @@ ftpd_pclose(FILE *iop) * pclose returns -1 if stream is not associated with a * `popened' command, or, if already `pclosed'. */ - if (pids == 0 || pids[fdes = fileno(iop)] == 0) + if (pids == NULL || pids[fdes = fileno(iop)] == 0) return (-1); (void)fclose(iop); omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP)); From owner-svn-src-all@freebsd.org Mon Apr 18 15:02:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AFC1B131A7; Mon, 18 Apr 2016 15:02:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7B4A1D42; Mon, 18 Apr 2016 15:02:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IF1xCn098365; Mon, 18 Apr 2016 15:01:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IF1xnp098363; Mon, 18 Apr 2016 15:01:59 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604181501.u3IF1xnp098363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 18 Apr 2016 15:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298212 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 15:02:01 -0000 Author: asomers Date: Mon Apr 18 15:01:59 2016 New Revision: 298212 URL: https://svnweb.freebsd.org/changeset/base/298212 Log: Add the ability to read a SAS device's Target Port NAA designator sys/cam/scsi/scsi_all.h sys/cam/scsi/scsi_all.c Add the scsi_devid_is_port_naa helper function Reviewed by: ken MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D5975 Modified: head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Mon Apr 18 15:01:49 2016 (r298211) +++ head/sys/cam/scsi/scsi_all.c Mon Apr 18 15:01:59 2016 (r298212) @@ -5626,6 +5626,19 @@ scsi_devid_is_lun_name(uint8_t *bufp) return 1; } +int +scsi_devid_is_port_naa(uint8_t *bufp) +{ + struct scsi_vpd_id_descriptor *descr; + + descr = (struct scsi_vpd_id_descriptor *)bufp; + if ((descr->id_type & SVPD_ID_ASSOC_MASK) != SVPD_ID_ASSOC_PORT) + return 0; + if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_NAA) + return 0; + return 1; +} + struct scsi_vpd_id_descriptor * scsi_get_devid_desc(struct scsi_vpd_id_descriptor *desc, uint32_t len, scsi_devid_checkfn_t ck_fn) Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Mon Apr 18 15:01:49 2016 (r298211) +++ head/sys/cam/scsi/scsi_all.h Mon Apr 18 15:01:59 2016 (r298212) @@ -3661,6 +3661,7 @@ int scsi_devid_is_lun_eui64(uint8_t *bu int scsi_devid_is_lun_naa(uint8_t *bufp); int scsi_devid_is_lun_name(uint8_t *bufp); int scsi_devid_is_lun_t10(uint8_t *bufp); +int scsi_devid_is_port_naa(uint8_t *bufp); struct scsi_vpd_id_descriptor * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len, scsi_devid_checkfn_t ck_fn); From owner-svn-src-all@freebsd.org Mon Apr 18 15:05:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FAB9B133B4; Mon, 18 Apr 2016 15:05:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3C411D5; Mon, 18 Apr 2016 15:05:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IF5mw4000585; Mon, 18 Apr 2016 15:05:48 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IF5mwv000584; Mon, 18 Apr 2016 15:05:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604181505.u3IF5mwv000584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Apr 2016 15:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298213 - head/libexec/rbootd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 15:05:49 -0000 Author: pfg Date: Mon Apr 18 15:05:48 2016 New Revision: 298213 URL: https://svnweb.freebsd.org/changeset/base/298213 Log: rbootd: use NULL instead of zero for pointers. Modified: head/libexec/rbootd/bpf.c Modified: head/libexec/rbootd/bpf.c ============================================================================== --- head/libexec/rbootd/bpf.c Mon Apr 18 15:01:59 2016 (r298212) +++ head/libexec/rbootd/bpf.c Mon Apr 18 15:05:48 2016 (r298213) @@ -241,7 +241,7 @@ BpfGetIntfName(char **errmsg) ifrp = ibuf; ifend = (struct ifreq *)((char *)ibuf + ifc.ifc_len); - mp = 0; + mp = NULL; minunit = 666; for (; ifrp < ifend; ++ifrp) { if (ioctl(fd, SIOCGIFFLAGS, (char *)ifrp) < 0) { @@ -271,7 +271,7 @@ BpfGetIntfName(char **errmsg) } (void) close(fd); - if (mp == 0) { + if (mp == NULL) { (void) strcpy(errbuf, "bpf: no interfaces found"); return(NULL); } From owner-svn-src-all@freebsd.org Mon Apr 18 15:08:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 973CDB13483; Mon, 18 Apr 2016 15:08:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A60713A0; Mon, 18 Apr 2016 15:08:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IF8VN1000710; Mon, 18 Apr 2016 15:08:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IF8V0t000709; Mon, 18 Apr 2016 15:08:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604181508.u3IF8V0t000709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Apr 2016 15:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298214 - head/lib/libipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 15:08:32 -0000 Author: pfg Date: Mon Apr 18 15:08:31 2016 New Revision: 298214 URL: https://svnweb.freebsd.org/changeset/base/298214 Log: libipsec: use NULL instead of zero for pointers. Modified: head/lib/libipsec/pfkey.c Modified: head/lib/libipsec/pfkey.c ============================================================================== --- head/lib/libipsec/pfkey.c Mon Apr 18 15:05:48 2016 (r298213) +++ head/lib/libipsec/pfkey.c Mon Apr 18 15:08:31 2016 (r298214) @@ -1645,7 +1645,7 @@ pfkey_recv(so) /* read real message */ reallen = PFKEY_UNUNIT64(buf.sadb_msg_len); - if ((newmsg = CALLOC(reallen, struct sadb_msg *)) == 0) { + if ((newmsg = CALLOC(reallen, struct sadb_msg *)) == NULL) { __ipsec_set_strerror(strerror(errno)); return NULL; } From owner-svn-src-all@freebsd.org Mon Apr 18 15:09:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A04FDB134F8 for ; Mon, 18 Apr 2016 15:09:17 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EB2F168B for ; Mon, 18 Apr 2016 15:09:17 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 62849c3e-0577-11e6-9fea-b54670b854a5 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 18 Apr 2016 15:08:19 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u3IF87Zu033107; Mon, 18 Apr 2016 09:08:07 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1460992087.52955.47.camel@freebsd.org> Subject: Re: svn commit: r298187 - head/sys/netinet From: Ian Lepore To: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 18 Apr 2016 09:08:07 -0600 In-Reply-To: <201604180638.u3I6cs5P043229@repo.freebsd.org> References: <201604180638.u3I6cs5P043229@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 15:09:17 -0000 On Mon, 2016-04-18 at 06:38 +0000, Michael Tuexen wrote: > Author: tuexen > Date: Mon Apr 18 06:38:53 2016 > New Revision: 298187 > URL: https://svnweb.freebsd.org/changeset/base/298187 > > Log: > Don't use anonymous unions. > Why not? This is one of those commit messages that really needs to say WHY the change is happening more than WHAT is happening. -- Ian > Modified: > head/sys/netinet/sctp_header.h > head/sys/netinet/sctp_indata.c > head/sys/netinet/sctp_output.c > > Modified: head/sys/netinet/sctp_header.h > ===================================================================== > ========= > --- head/sys/netinet/sctp_header.h Mon Apr 18 06:32:24 2016 > (r298186) > +++ head/sys/netinet/sctp_header.h Mon Apr 18 06:38:53 2016 > (r298187) > @@ -160,7 +160,7 @@ struct sctp_idata { > union { > uint32_t protocol_id; > uint32_t fsn; /* Fragment Sequence Number */ > - }; > + } ppid_fsn; > /* user data follows */ > } SCTP_PACKED; > > > Modified: head/sys/netinet/sctp_indata.c > ===================================================================== > ========= > --- head/sys/netinet/sctp_indata.c Mon Apr 18 06:32:24 2016 > (r298186) > +++ head/sys/netinet/sctp_indata.c Mon Apr 18 06:38:53 2016 > (r298187) > @@ -1558,7 +1558,7 @@ sctp_process_a_data_chunk(struct sctp_tc > if (ch->ch.chunk_flags & SCTP_DATA_FIRST_FRAG) > fsn = 0; > else > - fsn = ntohl(nch->dp.fsn); > + fsn = ntohl(nch->dp.ppid_fsn.fsn); > old_data = 0; > } else { > ch = (struct sctp_data_chunk *)sctp_m_getptr(*m, > offset, > > Modified: head/sys/netinet/sctp_output.c > ===================================================================== > ========= > --- head/sys/netinet/sctp_output.c Mon Apr 18 06:32:24 2016 > (r298186) > +++ head/sys/netinet/sctp_output.c Mon Apr 18 06:38:53 2016 > (r298187) > @@ -7641,9 +7641,9 @@ dont_do_it: > ndchkh->dp.reserved = htons(0); > ndchkh->dp.msg_id = htonl(sp->msg_id); > if (sp->fsn == 0) > - ndchkh->dp.protocol_id = chk > ->rec.data.payloadtype; > + ndchkh->dp.ppid_fsn.protocol_id = chk > ->rec.data.payloadtype; > else > - ndchkh->dp.fsn = htonl(sp->fsn); > + ndchkh->dp.ppid_fsn.fsn = htonl(sp->fsn); > sp->fsn++; > ndchkh->ch.chunk_length = htons(chk->send_size); > } > From owner-svn-src-all@freebsd.org Mon Apr 18 15:10:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFC50B13584 for ; Mon, 18 Apr 2016 15:10:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78A1B1830 for ; Mon, 18 Apr 2016 15:10:11 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a6bfd372-0577-11e6-8bda-c73aafa13d19 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 18 Apr 2016 15:10:13 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u3IFA2Qx033118; Mon, 18 Apr 2016 09:10:02 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1460992202.52955.49.camel@freebsd.org> Subject: Re: svn commit: r298199 - head/sys/netinet From: Ian Lepore To: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 18 Apr 2016 09:10:02 -0600 In-Reply-To: <201604180929.u3I9TEA3095105@repo.freebsd.org> References: <201604180929.u3I9TEA3095105@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 15:10:11 -0000 On Mon, 2016-04-18 at 09:29 +0000, Michael Tuexen wrote: > Author: tuexen > Date: Mon Apr 18 09:29:14 2016 > New Revision: 298199 > URL: https://svnweb.freebsd.org/changeset/base/298199 > > Log: > Put panic() calls under INVARIANTS. > A panic that's only active when INVARIANTS is defined is usually spelled KASSERT. -- Ian From owner-svn-src-all@freebsd.org Mon Apr 18 16:25:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25D6AB1377D; Mon, 18 Apr 2016 16:25:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA6471B12; Mon, 18 Apr 2016 16:25:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IGPcOU024563; Mon, 18 Apr 2016 16:25:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IGPcQc024562; Mon, 18 Apr 2016 16:25:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604181625.u3IGPcQc024562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Apr 2016 16:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298215 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 16:25:39 -0000 Author: pfg Date: Mon Apr 18 16:25:37 2016 New Revision: 298215 URL: https://svnweb.freebsd.org/changeset/base/298215 Log: Re-use our roundup2() macro instead of reinventing the wheel. Obtained from: DragonflyBSD Modified: head/lib/libc/gen/tls.c Modified: head/lib/libc/gen/tls.c ============================================================================== --- head/lib/libc/gen/tls.c Mon Apr 18 15:08:31 2016 (r298214) +++ head/lib/libc/gen/tls.c Mon Apr 18 16:25:37 2016 (r298215) @@ -33,6 +33,7 @@ */ #include +#include #include #include #include @@ -82,9 +83,6 @@ void __libc_free_tls(void *tls, size_t t #ifndef PIC -#define round(size, align) \ - (((size) + (align) - 1) & ~((align) - 1)) - static size_t tls_static_space; static size_t tls_init_size; static void *tls_init; @@ -190,7 +188,7 @@ __libc_free_tls(void *tcb, size_t tcbsiz * Figure out the size of the initial TLS block so that we can * find stuff which ___tls_get_addr() allocated dynamically. */ - size = round(tls_static_space, tcbalign); + size = roundup2(tls_static_space, tcbalign); dtv = ((Elf_Addr**)tcb)[1]; tlsend = (Elf_Addr) tcb; @@ -210,7 +208,7 @@ __libc_allocate_tls(void *oldtls, size_t Elf_Addr *dtv; Elf_Addr segbase, oldsegbase; - size = round(tls_static_space, tcbalign); + size = roundup2(tls_static_space, tcbalign); if (tcbsize < 2 * sizeof(Elf_Addr)) tcbsize = 2 * sizeof(Elf_Addr); @@ -307,7 +305,7 @@ _init_tls(void) for (i = 0; (unsigned) i < phnum; i++) { if (phdr[i].p_type == PT_TLS) { - tls_static_space = round(phdr[i].p_memsz, + tls_static_space = roundup2(phdr[i].p_memsz, phdr[i].p_align); tls_init_size = phdr[i].p_filesz; tls_init = (void*) phdr[i].p_vaddr; From owner-svn-src-all@freebsd.org Mon Apr 18 16:56:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6377EB1323A; Mon, 18 Apr 2016 16:56:35 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB7C1D5B; Mon, 18 Apr 2016 16:56:35 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.102] (p508F0542.dip0.t-ipconnect.de [80.143.5.66]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 21EB0721E280E; Mon, 18 Apr 2016 18:56:30 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r298187 - head/sys/netinet From: Michael Tuexen In-Reply-To: <1460992087.52955.47.camel@freebsd.org> Date: Mon, 18 Apr 2016 18:56:29 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <0BC0F7D1-9523-4FE6-A6ED-57372CC80206@freebsd.org> References: <201604180638.u3I6cs5P043229@repo.freebsd.org> <1460992087.52955.47.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 16:56:35 -0000 > On 18 Apr 2016, at 17:08, Ian Lepore wrote: > > On Mon, 2016-04-18 at 06:38 +0000, Michael Tuexen wrote: >> Author: tuexen >> Date: Mon Apr 18 06:38:53 2016 >> New Revision: 298187 >> URL: https://svnweb.freebsd.org/changeset/base/298187 >> >> Log: >> Don't use anonymous unions. >> > > Why not? This is one of those commit messages that really needs to say Because the same code is used in a userland SCTP stack and that uses C99. Anonymous unions are introduced in C11. That's why. > WHY the change is happening more than WHAT is happening. Will try to provide better commit messages. Best regards Michael > > -- Ian > >> Modified: >> head/sys/netinet/sctp_header.h >> head/sys/netinet/sctp_indata.c >> head/sys/netinet/sctp_output.c >> >> Modified: head/sys/netinet/sctp_header.h >> ===================================================================== >> ========= >> --- head/sys/netinet/sctp_header.h Mon Apr 18 06:32:24 2016 >> (r298186) >> +++ head/sys/netinet/sctp_header.h Mon Apr 18 06:38:53 2016 >> (r298187) >> @@ -160,7 +160,7 @@ struct sctp_idata { >> union { >> uint32_t protocol_id; >> uint32_t fsn; /* Fragment Sequence Number */ >> - }; >> + } ppid_fsn; >> /* user data follows */ >> } SCTP_PACKED; >> >> >> Modified: head/sys/netinet/sctp_indata.c >> ===================================================================== >> ========= >> --- head/sys/netinet/sctp_indata.c Mon Apr 18 06:32:24 2016 >> (r298186) >> +++ head/sys/netinet/sctp_indata.c Mon Apr 18 06:38:53 2016 >> (r298187) >> @@ -1558,7 +1558,7 @@ sctp_process_a_data_chunk(struct sctp_tc >> if (ch->ch.chunk_flags & SCTP_DATA_FIRST_FRAG) >> fsn = 0; >> else >> - fsn = ntohl(nch->dp.fsn); >> + fsn = ntohl(nch->dp.ppid_fsn.fsn); >> old_data = 0; >> } else { >> ch = (struct sctp_data_chunk *)sctp_m_getptr(*m, >> offset, >> >> Modified: head/sys/netinet/sctp_output.c >> ===================================================================== >> ========= >> --- head/sys/netinet/sctp_output.c Mon Apr 18 06:32:24 2016 >> (r298186) >> +++ head/sys/netinet/sctp_output.c Mon Apr 18 06:38:53 2016 >> (r298187) >> @@ -7641,9 +7641,9 @@ dont_do_it: >> ndchkh->dp.reserved = htons(0); >> ndchkh->dp.msg_id = htonl(sp->msg_id); >> if (sp->fsn == 0) >> - ndchkh->dp.protocol_id = chk >> ->rec.data.payloadtype; >> + ndchkh->dp.ppid_fsn.protocol_id = chk >> ->rec.data.payloadtype; >> else >> - ndchkh->dp.fsn = htonl(sp->fsn); >> + ndchkh->dp.ppid_fsn.fsn = htonl(sp->fsn); >> sp->fsn++; >> ndchkh->ch.chunk_length = htons(chk->send_size); >> } >> From owner-svn-src-all@freebsd.org Mon Apr 18 16:58:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE41EB132EB; Mon, 18 Apr 2016 16:58:23 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BADBF1EF6; Mon, 18 Apr 2016 16:58:23 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.102] (p508F0542.dip0.t-ipconnect.de [80.143.5.66]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 6DD24721E280E; Mon, 18 Apr 2016 18:58:21 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r298199 - head/sys/netinet From: Michael Tuexen In-Reply-To: <1460992202.52955.49.camel@freebsd.org> Date: Mon, 18 Apr 2016 18:58:20 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <201604180929.u3I9TEA3095105@repo.freebsd.org> <1460992202.52955.49.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 16:58:24 -0000 > On 18 Apr 2016, at 17:10, Ian Lepore wrote: > > On Mon, 2016-04-18 at 09:29 +0000, Michael Tuexen wrote: >> Author: tuexen >> Date: Mon Apr 18 09:29:14 2016 >> New Revision: 298199 >> URL: https://svnweb.freebsd.org/changeset/base/298199 >> >> Log: >> Put panic() calls under INVARIANTS. >> > > A panic that's only active when INVARIANTS is defined is usually > spelled KASSERT. OK. The change happens because when using the code in the userland SCTP stack, we don't provide a panic() replacement unless we compile the INVARIANTS defined. Therefore I catch this when compiling the userland stack... Best regards Michael > > -- Ian > From owner-svn-src-all@freebsd.org Mon Apr 18 17:30:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F42BB13F52; Mon, 18 Apr 2016 17:30:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DABA01AE9; Mon, 18 Apr 2016 17:30:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IHUYhM044137; Mon, 18 Apr 2016 17:30:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IHUXJc044135; Mon, 18 Apr 2016 17:30:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604181730.u3IHUXJc044135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 18 Apr 2016 17:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298216 - in head/usr.sbin: btxld usbdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 17:30:35 -0000 Author: pfg Date: Mon Apr 18 17:30:33 2016 New Revision: 298216 URL: https://svnweb.freebsd.org/changeset/base/298216 Log: Reuse our roundup2() macro instead of reinventing the wheel. Obtained from: DragonflyBSD Modified: head/usr.sbin/btxld/btxld.c head/usr.sbin/usbdump/usbdump.c Modified: head/usr.sbin/btxld/btxld.c ============================================================================== --- head/usr.sbin/btxld/btxld.c Mon Apr 18 16:25:37 2016 (r298215) +++ head/usr.sbin/btxld/btxld.c Mon Apr 18 17:30:33 2016 (r298216) @@ -68,8 +68,6 @@ static const char rcsid[] = #define IMPURE 1 /* Writable text */ #define MAXU32 0xffffffff /* Maximum unsigned 32-bit quantity */ -#define align(x, y) (((x) + (y) - 1) & ~((y) - 1)) - struct hdr { uint32_t fmt; /* Format */ uint32_t flags; /* Bit flags */ @@ -425,7 +423,7 @@ puthdr(int fd, struct hdr *hdr) eh.p[1].p_offset = htole32(le32toh(eh.p[0].p_offset) + le32toh(eh.p[0].p_filesz)); eh.p[1].p_vaddr = eh.p[1].p_paddr = - htole32(align(le32toh(eh.p[0].p_paddr) + le32toh(eh.p[0].p_memsz), + htole32(roundup2(le32toh(eh.p[0].p_paddr) + le32toh(eh.p[0].p_memsz), 4096)); eh.p[1].p_filesz = eh.p[1].p_memsz = htole32(hdr->data); eh.sh[2].sh_addr = eh.p[0].p_vaddr; Modified: head/usr.sbin/usbdump/usbdump.c ============================================================================== --- head/usr.sbin/usbdump/usbdump.c Mon Apr 18 16:25:37 2016 (r298215) +++ head/usr.sbin/usbdump/usbdump.c Mon Apr 18 17:30:33 2016 (r298216) @@ -95,8 +95,6 @@ struct usbcap_filehdr { uint8_t reserved[26]; } __packed; -#define HEADER_ALIGN(x,a) (((x) + (a) - 1) & ~((a) - 1)) - struct header_32 { /* capture timestamp */ uint32_t ts_sec; @@ -622,7 +620,7 @@ print_packets(uint8_t *data, const int d temp.hdrlen = hdr32->hdrlen; temp.align = hdr32->align; - next = ptr + HEADER_ALIGN(temp.hdrlen + temp.caplen, temp.align); + next = ptr + roundup2(temp.hdrlen + temp.caplen, temp.align); if (next <= ptr) err(EXIT_FAILURE, "Invalid length"); From owner-svn-src-all@freebsd.org Mon Apr 18 17:48:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFDC9B13607 for ; Mon, 18 Apr 2016 17:48:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8255316F3 for ; Mon, 18 Apr 2016 17:48:41 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ceb4f599-058d-11e6-8bda-c73aafa13d19 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 18 Apr 2016 17:48:49 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u3IHmcOA033444; Mon, 18 Apr 2016 11:48:38 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1461001718.52955.50.camel@freebsd.org> Subject: Re: svn commit: r298199 - head/sys/netinet From: Ian Lepore To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 18 Apr 2016 11:48:38 -0600 In-Reply-To: References: <201604180929.u3I9TEA3095105@repo.freebsd.org> <1460992202.52955.49.camel@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 17:48:41 -0000 On Mon, 2016-04-18 at 18:58 +0200, Michael Tuexen wrote: > > On 18 Apr 2016, at 17:10, Ian Lepore wrote: > > > > On Mon, 2016-04-18 at 09:29 +0000, Michael Tuexen wrote: > > > Author: tuexen > > > Date: Mon Apr 18 09:29:14 2016 > > > New Revision: 298199 > > > URL: https://svnweb.freebsd.org/changeset/base/298199 > > > > > > Log: > > > Put panic() calls under INVARIANTS. > > > > > > > A panic that's only active when INVARIANTS is defined is usually > > spelled KASSERT. > OK. The change happens because when using the code in the userland > SCTP stack, we don't provide a panic() replacement unless we > compile the INVARIANTS defined. Therefore I catch this when compiling > the userland stack... > > Best regards > Michael > > Ahh, no KASSERT in userland, thanks. I probably could have figured that out for myself if I had put a bit of effort into looking. -- Ian From owner-svn-src-all@freebsd.org Mon Apr 18 18:12:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B985B13C72; Mon, 18 Apr 2016 18:12:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0F5E130B; Mon, 18 Apr 2016 18:12:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IICDu8058520; Mon, 18 Apr 2016 18:12:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IICDmi058519; Mon, 18 Apr 2016 18:12:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604181812.u3IICDmi058519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 18 Apr 2016 18:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298217 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:12:14 -0000 Author: bdrewery Date: Mon Apr 18 18:12:12 2016 New Revision: 298217 URL: https://svnweb.freebsd.org/changeset/base/298217 Log: META_MODE: Clean .meta files with 'make cleandepend'. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Apr 18 17:30:33 2016 (r298216) +++ head/share/mk/bsd.dep.mk Mon Apr 18 18:12:12 2016 (r298217) @@ -54,6 +54,9 @@ HTAGSFLAGS?= .MAKE.DEPENDFILE= ${DEPENDFILE} .endif CLEANDEPENDFILES+= ${DEPENDFILE} ${DEPENDFILE}.* +.if ${MK_META_MODE} == "yes" +CLEANDEPENDFILES+= *.meta +.endif # Keep `tags' here, before SRCS are mangled below for `depend'. .if !target(tags) && defined(SRCS) && !defined(NO_TAGS) From owner-svn-src-all@freebsd.org Mon Apr 18 18:14:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 784BFB13D4F; Mon, 18 Apr 2016 18:14:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49440152B; Mon, 18 Apr 2016 18:14:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IIE2XQ059302; Mon, 18 Apr 2016 18:14:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IIE22P059301; Mon, 18 Apr 2016 18:14:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604181814.u3IIE22P059301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 18 Apr 2016 18:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298219 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:14:03 -0000 Author: bdrewery Date: Mon Apr 18 18:14:02 2016 New Revision: 298219 URL: https://svnweb.freebsd.org/changeset/base/298219 Log: Cause an error during 'make install' if trying to compile with CC. This is limited to src-tree builds, meaning not extended to ports or other out-of-tree builds. This will help ensure that read-only OBJDIRS will be respected at install-time by causing a more consistent failure for those who don't use a read-only OBJDIR. It also will cause Jenkins to yell. This is a better solution than trying to see CC=false as has been attempted and discussed before. Of course this is only relevant for files generated by CC. Disable this for META_MODE since it will detect the CFLAGS/command change and force a rebuild. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Mon Apr 18 18:13:58 2016 (r298218) +++ head/share/mk/bsd.sys.mk Mon Apr 18 18:14:02 2016 (r298219) @@ -178,6 +178,13 @@ ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} +.if defined(SRCTOP) +# Prevent rebuilding during install to support read-only objdirs. +.if make(install) && empty(.MAKE.MODE:Mmeta) +CFLAGS+= ERROR-tried-to-rebuild-during-make-install +.endif +.endif + # Tell bmake not to mistake standard targets for things to be searched for # or expect to ever be up-to-date. PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend beforeinstall \ From owner-svn-src-all@freebsd.org Mon Apr 18 18:14:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32CBAB13D3E; Mon, 18 Apr 2016 18:14:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 034D0152A; Mon, 18 Apr 2016 18:13:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IIDxtt059253; Mon, 18 Apr 2016 18:13:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IIDwHo059248; Mon, 18 Apr 2016 18:13:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604181813.u3IIDwHo059248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 18 Apr 2016 18:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298218 - in head/gnu: lib/csu lib/libgcc lib/libgcov usr.bin/cc/cc_tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:14:00 -0000 Author: bdrewery Date: Mon Apr 18 18:13:58 2016 New Revision: 298218 URL: https://svnweb.freebsd.org/changeset/base/298218 Log: Follow-up r297842: Rework header generation to fix always rebuilding. This reworks the handling of common headers to just include the needed logic rather than invoke MAKE. This avoids the problem listed in r297842 and avoids other dependency tracking issues. Pointyhat to: bdrewery Reported by: Nikolai Lifanov Sponsored by: EMC / Isilon Storage Division Added: head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs (contents, props changed) Modified: head/gnu/lib/csu/Makefile head/gnu/lib/libgcc/Makefile head/gnu/lib/libgcov/Makefile head/gnu/usr.bin/cc/cc_tools/Makefile Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Mon Apr 18 18:12:12 2016 (r298217) +++ head/gnu/lib/csu/Makefile Mon Apr 18 18:13:58 2016 (r298218) @@ -7,10 +7,11 @@ GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs CCDIR= ${.CURDIR}/../../usr.bin/cc .include "${CCDIR}/Makefile.tgt" +.include "${CCDIR}/cc_tools/Makefile.hdrs" .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR} -SRCS= crtstuff.c tconfig.h tm.h options.h +SRCS= crtstuff.c ${COMMONHDRS} OBJS= crtbegin.o crtend.o crtbeginT.o SOBJS= crtbeginS.o crtendS.o CSTD?= gnu89 @@ -70,8 +71,7 @@ crtendS.o: ${ENDSRC} ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \ -c -o ${.TARGET} ${.ALLSRC:N*.h} -CLEANFILES+= tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h -tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile .PHONY - (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) +COMMONHDRS+= tm.h tconfig.h options.h +CLEANFILES+= ${COMMONHDRS} optionlist cs-tconfig.h cs-tm.h .include Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Mon Apr 18 18:12:12 2016 (r298217) +++ head/gnu/lib/libgcc/Makefile Mon Apr 18 18:13:58 2016 (r298218) @@ -3,6 +3,7 @@ PACKAGE= clibs GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs +CCDIR= ${.CURDIR}/../../usr.bin/cc COMPILERRTDIR= ${.CURDIR}/../../../contrib/compiler-rt UNWINDINCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/include UNWINDSRCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/src @@ -17,7 +18,8 @@ SHLIBDIR?= /lib # MK_SSP= no -.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" +.include "${CCDIR}/Makefile.tgt" +.include "${CCDIR}/cc_tools/Makefile.hdrs" .if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI @@ -29,7 +31,7 @@ CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_F -DHAVE_GTHR_DEFAULT \ -I${GCCLIB}/include \ -I${GCCDIR}/config -I${GCCDIR} -I. \ - -I${.CURDIR}/../../usr.bin/cc/cc_tools + -I${CCDIR}/cc_tools LDFLAGS+= -nodefaultlibs LIBADD+= c @@ -340,13 +342,6 @@ ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS .endfor -#----------------------------------------------------------------------- -# -# Generated headers -# -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY - (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) - CLEANFILES += ${COMMONHDRS} CLEANFILES += cs-*.h option* Modified: head/gnu/lib/libgcov/Makefile ============================================================================== --- head/gnu/lib/libgcov/Makefile Mon Apr 18 18:12:12 2016 (r298217) +++ head/gnu/lib/libgcov/Makefile Mon Apr 18 18:13:58 2016 (r298218) @@ -4,17 +4,20 @@ MK_PROFILE= no MK_SSP= no .include -.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs +CCDIR= ${.CURDIR}/../../usr.bin/cc +.include "${CCDIR}/Makefile.tgt" +.include "${CCDIR}/cc_tools/Makefile.hdrs" + .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR} LIB= gcov CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED CFLAGS+= -D_PTHREADS -DGTHREAD_USE_WEAK -CFLAGS+= -I${.CURDIR}/../../usr.bin/cc/cc_tools \ +CFLAGS+= -I${CCDIR}/cc_tools \ -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. .if ${TARGET_CPUARCH} == "arm" @@ -45,9 +48,6 @@ CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DS COMMONHDRS= tm.h tconfig.h gcov-iov.h options.h CLEANFILES+= ${COMMONHDRS} cs-tm.h cs-tconfig.h options.h optionlist -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY - (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) - ${OBJS} beforedepend: ${COMMONHDRS} ${OBJS_T}: libgcov.c Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Mon Apr 18 18:12:12 2016 (r298217) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Mon Apr 18 18:13:58 2016 (r298218) @@ -5,6 +5,9 @@ CFLAGS+= -I. .include "../Makefile.inc" +# Some of the logic needed in here is defined in Makefile.hdrs as it is shared +# with gnu/lib. +.include "Makefile.hdrs" CFLAGS+= -g CFLAGS+= -DGENERATOR_FILE -DHAVE_CONFIG_H @@ -21,51 +24,6 @@ LIBIBERTY= libiberty.a # # The list of headers to go into tm.h # -TARGET_INC+= options.h -.if ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= i386/biarch64.h -.endif -.if ${TARGET_CPUARCH} != "arm" -TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h -.endif -.if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= ${GCC_CPU}/unix.h -TARGET_INC+= ${GCC_CPU}/att.h -.endif -TARGET_INC+= dbxelf.h -TARGET_INC+= elfos-undef.h -TARGET_INC+= elfos.h -TARGET_INC+= freebsd-native.h -TARGET_INC+= freebsd-spec.h -TARGET_INC+= freebsd.h -.if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64" -. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h) -TARGET_INC+= ${GCC_CPU}/sysv4.h -. endif -.endif -.if ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= ${GCC_CPU}/x86-64.h -.endif -.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips" -TARGET_INC+= ${GCC_CPU}/elf.h -.endif -.if ${TARGET_CPUARCH} == "arm" -TARGET_INC+= ${GCC_CPU}/aout.h -TARGET_INC+= ${GCC_CPU}/bpabi.h -.endif -.if ${TARGET_ARCH} == "powerpc64" -TARGET_INC+= ${GCC_CPU}/biarch64.h -TARGET_INC+= ${GCC_CPU}/default64.h -.endif -TARGET_INC+= ${GCC_CPU}/freebsd.h -.if ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= ${GCC_CPU}/freebsd64.h -.endif -.if ${TARGET_CPUARCH} == "arm" -TARGET_INC+= ${GCC_CPU}/arm.h -.endif -TARGET_INC+= defaults.h - .for H in ${TARGET_INC} .for D in ${GCCDIR}/config ${GCCDIR} ${.CURDIR} .if exists($D/$H) @@ -155,31 +113,6 @@ TREE_DEF_FILES= TREE_DEF_FILES+= cp/cp-tree.def .endif -# -# Option files. -# -OPT_FILES= c.opt common.opt - -.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt) -OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt -.endif - -.if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt) -OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt -.endif - -.if ${TARGET_CPUARCH} == "powerpc" -OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt -.endif - -.if ${TARGET_CPUARCH} == "sparc64" -OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt -.endif - -.if exists(${.CURDIR}/freebsd.opt) -OPT_FILES+= ${.CURDIR}/freebsd.opt -.endif - #----------------------------------------------------------------------- # Build rules for header files and generator tools @@ -207,41 +140,13 @@ GENSRCS+= bconfig.h CLEANFILES+= cs-bconfig.h # tconfig.h -tconfig.h: - TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ - HEADERS="auto-host.h ansidecl.h" \ - DEFINES="USED_FOR_TARGET" \ - /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} - GENSRCS+= tconfig.h CLEANFILES+= cs-tconfig.h # Options -optionlist: ${OPT_FILES} - LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET} - -options.h: optionlist - LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ - -f ${GCCDIR}/opth-gen.awk \ - < ${.ALLSRC} > ${.TARGET} - -options.c: optionlist - LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ - -f ${GCCDIR}/optc-gen.awk \ - -v header_name="config.h system.h coretypes.h tm.h" \ - < ${.ALLSRC} > ${.TARGET} GENONLY+= optionlist options.h options.c # Target machine config -tm.h: - TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ - HEADERS="${TARGET_INC}" \ - DEFINES="" \ - /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} -.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def) - echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET} -.endif - GENSRCS+= tm.h CLEANFILES+= cs-tm.h @@ -294,9 +199,6 @@ gtyp-gen.h: ${GTFILES} GENSRCS+= gtyp-gen.h # Version header for gcov -gcov-iov.h: - echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET} - GENSRCS+= gcov-iov.h # Multilib config file @@ -346,20 +248,8 @@ gstdint.h: GENSRCS+= gstdint.h # Linked headers -gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA - ln -sf ${.ALLSRC} ${.TARGET} - GENSRCS+= gthr-default.h -.if ${TARGET_CPUARCH} == "arm" -unwind.h: ${GCCDIR}/config/arm/unwind-arm.h -.else -unwind.h: ${GCCDIR}/unwind-generic.h -.endif - -unwind.h: .NOMETA - ln -sf ${.ALLSRC} ${.TARGET} - GENSRCS+= unwind.h # Added: head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs Mon Apr 18 18:13:58 2016 (r298218) @@ -0,0 +1,132 @@ +# $FreeBSD$ +# +# This is logic for common headers shared inside of gnu/lib. It used to +# live in gnu/usr.bin/cc/cc_tools/Makefile. + +.if !defined(TARGET_CPUARCH) || !defined(GCC_CPU) +.error ${.CURDIR}: Must include gnu/usr.bin/cc/Makefile.tgt first. +.endif + +# +# The list of headers to go into tm.h +# +TARGET_INC+= options.h +.if ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= i386/biarch64.h +.endif +.if ${TARGET_CPUARCH} != "arm" +TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h +.endif +.if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= ${GCC_CPU}/unix.h +TARGET_INC+= ${GCC_CPU}/att.h +.endif +TARGET_INC+= dbxelf.h +TARGET_INC+= elfos-undef.h +TARGET_INC+= elfos.h +TARGET_INC+= freebsd-native.h +TARGET_INC+= freebsd-spec.h +TARGET_INC+= freebsd.h +.if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64" +. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h) +TARGET_INC+= ${GCC_CPU}/sysv4.h +. endif +.endif +.if ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= ${GCC_CPU}/x86-64.h +.endif +.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips" +TARGET_INC+= ${GCC_CPU}/elf.h +.endif +.if ${TARGET_CPUARCH} == "arm" +TARGET_INC+= ${GCC_CPU}/aout.h +TARGET_INC+= ${GCC_CPU}/bpabi.h +.endif +.if ${TARGET_ARCH} == "powerpc64" +TARGET_INC+= ${GCC_CPU}/biarch64.h +TARGET_INC+= ${GCC_CPU}/default64.h +.endif +TARGET_INC+= ${GCC_CPU}/freebsd.h +.if ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= ${GCC_CPU}/freebsd64.h +.endif +.if ${TARGET_CPUARCH} == "arm" +TARGET_INC+= ${GCC_CPU}/arm.h +.endif +TARGET_INC+= defaults.h + +# +# Option files. +# +OPT_FILES= c.opt common.opt + +.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt) +OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt +.endif + +.if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt) +OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt +.endif + +.if ${TARGET_CPUARCH} == "powerpc" +OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt +.endif + +.if ${TARGET_CPUARCH} == "sparc64" +OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt +.endif + +.if exists(${.CURDIR}/freebsd.opt) +OPT_FILES+= ${.CURDIR}/freebsd.opt +.endif + + +# Options +optionlist: ${OPT_FILES} + LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET} + +options.h: optionlist + LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ + -f ${GCCDIR}/opth-gen.awk \ + < ${.ALLSRC} > ${.TARGET} + +options.c: optionlist + LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ + -f ${GCCDIR}/optc-gen.awk \ + -v header_name="config.h system.h coretypes.h tm.h" \ + < ${.ALLSRC} > ${.TARGET} + +# Target machine config +tm.h: + TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ + HEADERS="${TARGET_INC}" \ + DEFINES="" \ + /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} +.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def) + echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET} +.endif + +# tconfig.h +tconfig.h: + TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ + HEADERS="auto-host.h ansidecl.h" \ + DEFINES="USED_FOR_TARGET" \ + /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} + +# Version header for gcov +gcov-iov.h: + echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET} + +# Linked headers +gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA + ln -sf ${.ALLSRC} ${.TARGET} + +.if ${TARGET_CPUARCH} == "arm" +unwind.h: ${GCCDIR}/config/arm/unwind-arm.h +.else +unwind.h: ${GCCDIR}/unwind-generic.h +.endif + +unwind.h: .NOMETA + ln -sf ${.ALLSRC} ${.TARGET} + From owner-svn-src-all@freebsd.org Mon Apr 18 18:14:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADDEAB13D71; Mon, 18 Apr 2016 18:14:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 697F216C6; Mon, 18 Apr 2016 18:14:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IIE51d059348; Mon, 18 Apr 2016 18:14:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IIE5a2059347; Mon, 18 Apr 2016 18:14:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604181814.u3IIE5a2059347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 18 Apr 2016 18:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298220 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:14:06 -0000 Author: bdrewery Date: Mon Apr 18 18:14:05 2016 New Revision: 298220 URL: https://svnweb.freebsd.org/changeset/base/298220 Log: META_MODE: Disable during installworld and similar. META_MODE may create cookies during staging of files to WORLDTMP that would also prevent installation of the files to the final DESTDIR, since the cookie already exists. This is not yet the case but will be soon. Prevent other similar issues by disabling META_MODE for any top-level install targets. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Apr 18 18:14:02 2016 (r298219) +++ head/Makefile Mon Apr 18 18:14:05 2016 (r298220) @@ -183,6 +183,14 @@ SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk _MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +# Must disable META_MODE when installing to avoid missing anything. The +# main problem is that buildworld will create cookies for install targets +# since they are being installed into WORLDTMP. This avoids unneeded and +# redundant restaging but is dangerous for user install targets. +.if make(distrib*) || make(*install*) +_MAKE+= MK_META_MODE=no +.endif + # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) _TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/} From owner-svn-src-all@freebsd.org Mon Apr 18 18:17:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDBE3B13F19; Mon, 18 Apr 2016 18:17:21 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yw0-x242.google.com (mail-yw0-x242.google.com [IPv6:2607:f8b0:4002:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 696591C1B; Mon, 18 Apr 2016 18:17:21 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by mail-yw0-x242.google.com with SMTP id v81so5708739ywa.2; Mon, 18 Apr 2016 11:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=50ahMJ0DP1+C6iPRyJf/WNTOMjRbr6O9grVMFjG80NM=; b=K0ulb5XhFlxun6a3coEgnVeYufcLERydtZVPhSTNK236RhWZAJf2jg+NbO+kHjhVjc VAphcdbuU0ObwXppLb/VpeZJqg6e67PLnqTg3wga5X6w6bA4BAAjKPYnhk1paHUny8yS LlW8GyaLqB58iJ4AlJj3NwcxyHjJbERgkX8eA5qknqBlmMJVVmdZ+ZYcaEBtyaIR7gGI RhMeqZRJbPfafmWWKzRjUgfW1sitkPMlmuFz4EGJKqBO85KiOmZcScyHQWGR3WykhVvL 54Kv1bnfVCBlZu4Ycjz3RT0meUbwJaVhY+Hl9T3b/+TovMmTMEqjHEnPT6VunM+tsjT4 lyqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=50ahMJ0DP1+C6iPRyJf/WNTOMjRbr6O9grVMFjG80NM=; b=DkNiy7zWg3baI5mOXh5ZjqdNW2nArskVWd0p8uLaK3REGtUj1qjRAd4+AXZ525THhL +ZYriEAz/ShyWhQoFVVQ0pkjF0JllF1TdezRtH94OFJTT6ETwhR6X0aIFyx1e57FuMeu hA7zxisWMEc/7tlH5dQTEucZoyuK1p0W1yYXmbKWPJm5dFEE/KXIl1NCgFcOTbkhDEXU crz4mfhgDhUgfd1Allrlgmob7QxNjHfFv4n7Yj2D92yww/Usq5OhIybomDxcTC4BDtmg H2AW8JNf/eeLU6EiPr2P904YTRzrXb2CmcTkOrXMiaCA6ZWEyNjIwxfmoP4ZOSJnmigj uYKg== X-Gm-Message-State: AOPr4FWL1+lmVpZzEXuCP27fATZOZS1quxsBNBoo5BazUWGN3lWOGm2jXtpYwao0MBov11INvkDMx//BzxjY/g== MIME-Version: 1.0 X-Received: by 10.129.136.67 with SMTP id y64mr7480884ywf.39.1461003440463; Mon, 18 Apr 2016 11:17:20 -0700 (PDT) Sender: ermal.luci@gmail.com Received: by 10.129.51.67 with HTTP; Mon, 18 Apr 2016 11:17:20 -0700 (PDT) In-Reply-To: <201604160211.u3G2B4Mv078856@repo.freebsd.org> References: <201604160211.u3G2B4Mv078856@repo.freebsd.org> Date: Mon, 18 Apr 2016 20:17:20 +0200 X-Google-Sender-Auth: 29DEuEyLYvr8BzC9_cbCZHB6RJE Message-ID: Subject: Re: svn commit: r298091 - in stable/10: sbin/pfctl share/man/man4 sys/conf sys/contrib/altq/altq sys/netpfil/pf From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= To: Luiz Otavio O Souza Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:17:21 -0000 Careful with things you should credit to me :) Your boss likes to play games do not get in the middle as well. On Sat, Apr 16, 2016 at 4:11 AM, Luiz Otavio O Souza wrote: > Author: loos > Date: Sat Apr 16 02:11:04 2016 > New Revision: 298091 > URL: https://svnweb.freebsd.org/changeset/base/298091 > > Log: > MFC r284777, r284814, r284863 and r298088: > > ALTQ FAIRQ discipline import from DragonFLY. > > Differential Revision: https://reviews.freebsd.org/D2847 > Obtained from: pfSense > Sponsored by: Rubicon Communications (Netgate) > > Added: > stable/10/sys/contrib/altq/altq/altq_fairq.c (contents, props changed) > stable/10/sys/contrib/altq/altq/altq_fairq.h (contents, props changed) > Modified: > stable/10/sbin/pfctl/parse.y > stable/10/sbin/pfctl/pfctl_altq.c > stable/10/sbin/pfctl/pfctl_parser.h > stable/10/sbin/pfctl/pfctl_qstats.c > stable/10/share/man/man4/altq.4 > stable/10/sys/conf/NOTES > stable/10/sys/conf/files > stable/10/sys/conf/options > stable/10/sys/contrib/altq/altq/altq.h > stable/10/sys/contrib/altq/altq/altq_subr.c > stable/10/sys/contrib/altq/altq/altq_var.h > stable/10/sys/netpfil/pf/pf.c > stable/10/sys/netpfil/pf/pf_altq.h > stable/10/sys/netpfil/pf/pf_mtag.h > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sbin/pfctl/parse.y > > ============================================================================== > --- stable/10/sbin/pfctl/parse.y Sat Apr 16 00:01:16 2016 > (r298090) > +++ stable/10/sbin/pfctl/parse.y Sat Apr 16 02:11:04 2016 > (r298091) > @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > #include > @@ -300,6 +301,7 @@ struct pool_opts { > > > struct node_hfsc_opts hfsc_opts; > +struct node_fairq_opts fairq_opts; > struct node_state_opt *keep_state_defaults = NULL; > > int disallow_table(struct node_host *, const char *); > @@ -422,6 +424,7 @@ typedef struct { > struct table_opts table_opts; > struct pool_opts pool_opts; > struct node_hfsc_opts hfsc_opts; > + struct node_fairq_opts fairq_opts; > } v; > int lineno; > } YYSTYPE; > @@ -446,8 +449,8 @@ int parseport(char *, struct range *r, i > %token REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID > %token ANTISPOOF FOR INCLUDE > %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY > -%token ALTQ CBQ PRIQ HFSC BANDWIDTH TBRSIZE LINKSHARE REALTIME UPPERLIMIT > -%token QUEUE PRIORITY QLIMIT RTABLE > +%token ALTQ CBQ PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME > UPPERLIMIT > +%token QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE > %token LOAD RULESET_OPTIMIZATION > %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE > %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY > @@ -495,6 +498,7 @@ int parseport(char *, struct range *r, i > %type cbqflags_list cbqflags_item > %type priqflags_list priqflags_item > %type hfscopts_list hfscopts_item hfsc_opts > +%type fairqopts_list fairqopts_item fairq_opts > %type bandwidth > %type filter_opts filter_opt filter_opts_l > %type antispoof_opts antispoof_opt > antispoof_opts_l > @@ -1659,6 +1663,15 @@ scheduler : CBQ { > $$.qtype = ALTQT_HFSC; > $$.data.hfsc_opts = $3; > } > + | FAIRQ { > + $$.qtype = ALTQT_FAIRQ; > + bzero(&$$.data.fairq_opts, > + sizeof(struct node_fairq_opts)); > + } > + | FAIRQ '(' fairq_opts ')' { > + $$.qtype = ALTQT_FAIRQ; > + $$.data.fairq_opts = $3; > + } > ; > > cbqflags_list : cbqflags_item { $$ |= $1; } > @@ -1807,6 +1820,61 @@ hfscopts_item : LINKSHARE bandwidth > { > } > ; > > +fairq_opts : { > + bzero(&fairq_opts, > + sizeof(struct node_fairq_opts)); > + } > + fairqopts_list { > + $$ = fairq_opts; > + } > + ; > + > +fairqopts_list : fairqopts_item > + | fairqopts_list comma fairqopts_item > + ; > + > +fairqopts_item : LINKSHARE bandwidth { > + if (fairq_opts.linkshare.used) { > + yyerror("linkshare already specified"); > + YYERROR; > + } > + fairq_opts.linkshare.m2 = $2; > + fairq_opts.linkshare.used = 1; > + } > + | LINKSHARE '(' bandwidth number bandwidth ')' { > + if (fairq_opts.linkshare.used) { > + yyerror("linkshare already specified"); > + YYERROR; > + } > + fairq_opts.linkshare.m1 = $3; > + fairq_opts.linkshare.d = $4; > + fairq_opts.linkshare.m2 = $5; > + fairq_opts.linkshare.used = 1; > + } > + | HOGS bandwidth { > + fairq_opts.hogs_bw = $2; > + } > + | BUCKETS number { > + fairq_opts.nbuckets = $2; > + } > + | STRING { > + if (!strcmp($1, "default")) > + fairq_opts.flags |= FARF_DEFAULTCLASS; > + else if (!strcmp($1, "red")) > + fairq_opts.flags |= FARF_RED; > + else if (!strcmp($1, "ecn")) > + fairq_opts.flags |= FARF_RED|FARF_ECN; > + else if (!strcmp($1, "rio")) > + fairq_opts.flags |= FARF_RIO; > + else { > + yyerror("unknown fairq flag \"%s\"", $1); > + free($1); > + YYERROR; > + } > + free($1); > + } > + ; > + > qassign : /* empty */ { $$ = NULL; } > | qassign_item { $$ = $1; } > | '{' optnl qassign_list '}' { $$ = $3; } > @@ -5226,6 +5294,7 @@ lookup(char *s) > { "bitmask", BITMASK}, > { "block", BLOCK}, > { "block-policy", BLOCKPOLICY}, > + { "buckets", BUCKETS}, > { "cbq", CBQ}, > { "code", CODE}, > { "crop", FRAGCROP}, > @@ -5235,6 +5304,7 @@ lookup(char *s) > { "drop", DROP}, > { "drop-ovl", FRAGDROP}, > { "dup-to", DUPTO}, > + { "fairq", FAIRQ}, > { "fastroute", FASTROUTE}, > { "file", FILENAME}, > { "fingerprints", FINGERPRINTS}, > @@ -5247,6 +5317,7 @@ lookup(char *s) > { "global", GLOBAL}, > { "group", GROUP}, > { "hfsc", HFSC}, > + { "hogs", HOGS}, > { "hostid", HOSTID}, > { "icmp-type", ICMPTYPE}, > { "icmp6-type", ICMP6TYPE}, > > Modified: stable/10/sbin/pfctl/pfctl_altq.c > > ============================================================================== > --- stable/10/sbin/pfctl/pfctl_altq.c Sat Apr 16 00:01:16 2016 > (r298090) > +++ stable/10/sbin/pfctl/pfctl_altq.c Sat Apr 16 02:11:04 2016 > (r298091) > @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include "pfctl_parser.h" > #include "pfctl.h" > @@ -68,6 +69,11 @@ static int check_commit_hfsc(int, int, s > static int print_hfsc_opts(const struct pf_altq *, > const struct node_queue_opt *); > > +static int eval_pfqueue_fairq(struct pfctl *, struct pf_altq *); > +static int print_fairq_opts(const struct pf_altq *, > + const struct node_queue_opt *); > +static int check_commit_fairq(int, int, struct pf_altq *); > + > static void gsc_add_sc(struct gen_sc *, struct service_curve > *); > static int is_gsc_under_sc(struct gen_sc *, > struct service_curve *); > @@ -88,6 +94,8 @@ int eval_queue_opts(struct pf_altq *, > u_int32_t eval_bwspec(struct node_queue_bw *, u_int32_t); > void print_hfsc_sc(const char *, u_int, u_int, u_int, > const struct node_hfsc_sc *); > +void print_fairq_sc(const char *, u_int, u_int, u_int, > + const struct node_fairq_sc *); > > void > pfaltq_store(struct pf_altq *a) > @@ -173,6 +181,10 @@ print_altq(const struct pf_altq *a, unsi > if (!print_hfsc_opts(a, qopts)) > printf("hfsc "); > break; > + case ALTQT_FAIRQ: > + if (!print_fairq_opts(a, qopts)) > + printf("fairq "); > + break; > } > > if (bw != NULL && bw->bw_percent > 0) { > @@ -203,7 +215,8 @@ print_queue(const struct pf_altq *a, uns > printf("%s ", a->qname); > if (print_interface) > printf("on %s ", a->ifname); > - if (a->scheduler == ALTQT_CBQ || a->scheduler == ALTQT_HFSC) { > + if (a->scheduler == ALTQT_CBQ || a->scheduler == ALTQT_HFSC || > + a->scheduler == ALTQT_FAIRQ) { > if (bw != NULL && bw->bw_percent > 0) { > if (bw->bw_percent < 100) > printf("bandwidth %u%% ", bw->bw_percent); > @@ -224,6 +237,9 @@ print_queue(const struct pf_altq *a, uns > case ALTQT_HFSC: > print_hfsc_opts(a, qopts); > break; > + case ALTQT_FAIRQ: > + print_fairq_opts(a, qopts); > + break; > } > } > > @@ -294,6 +310,9 @@ check_commit_altq(int dev, int opts) > case ALTQT_HFSC: > error = check_commit_hfsc(dev, opts, altq); > break; > + case ALTQT_FAIRQ: > + error = check_commit_fairq(dev, opts, > altq); > + break; > default: > break; > } > @@ -342,7 +361,8 @@ eval_pfqueue(struct pfctl *pf, struct pf > if (pa->qlimit == 0) > pa->qlimit = DEFAULT_QLIMIT; > > - if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC) { > + if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC || > + pa->scheduler == ALTQT_FAIRQ) { > pa->bandwidth = eval_bwspec(bw, > parent == NULL ? 0 : parent->bandwidth); > > @@ -388,6 +408,9 @@ eval_pfqueue(struct pfctl *pf, struct pf > case ALTQT_HFSC: > error = eval_pfqueue_hfsc(pf, pa); > break; > + case ALTQT_FAIRQ: > + error = eval_pfqueue_fairq(pf, pa); > + break; > default: > break; > } > @@ -807,6 +830,85 @@ err_ret: > return (-1); > } > > +/* > + * FAIRQ support functions > + */ > +static int > +eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa) > +{ > + struct pf_altq *altq, *parent; > + struct fairq_opts *opts; > + struct service_curve sc; > + > + opts = &pa->pq_u.fairq_opts; > + > + if (pa->parent[0] == 0) { > + /* root queue */ > + opts->lssc_m1 = pa->ifbandwidth; > + opts->lssc_m2 = pa->ifbandwidth; > + opts->lssc_d = 0; > + return (0); > + } > + > + LIST_INIT(&lssc); > + > + /* if link_share is not specified, use bandwidth */ > + if (opts->lssc_m2 == 0) > + opts->lssc_m2 = pa->bandwidth; > + > + /* > + * admission control: > + * for the real-time service curve, the sum of the service curves > + * should not exceed 80% of the interface bandwidth. 20% is > reserved > + * not to over-commit the actual interface bandwidth. > + * for the link-sharing service curve, the sum of the child service > + * curve should not exceed the parent service curve. > + * for the upper-limit service curve, the assigned bandwidth should > + * be smaller than the interface bandwidth, and the upper-limit > should > + * be larger than the real-time service curve when both are > defined. > + */ > + parent = qname_to_pfaltq(pa->parent, pa->ifname); > + if (parent == NULL) > + errx(1, "parent %s not found for %s", pa->parent, > pa->qname); > + > + TAILQ_FOREACH(altq, &altqs, entries) { > + if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) > + continue; > + if (altq->qname[0] == 0) /* this is for interface */ > + continue; > + > + if (strncmp(altq->parent, pa->parent, PF_QNAME_SIZE) != 0) > + continue; > + > + /* if the class has a link-sharing service curve, add it. > */ > + if (opts->lssc_m2 != 0 && altq->pq_u.fairq_opts.lssc_m2 != > 0) { > + sc.m1 = altq->pq_u.fairq_opts.lssc_m1; > + sc.d = altq->pq_u.fairq_opts.lssc_d; > + sc.m2 = altq->pq_u.fairq_opts.lssc_m2; > + gsc_add_sc(&lssc, &sc); > + } > + } > + > + /* check the link-sharing service curve. */ > + if (opts->lssc_m2 != 0) { > + sc.m1 = parent->pq_u.fairq_opts.lssc_m1; > + sc.d = parent->pq_u.fairq_opts.lssc_d; > + sc.m2 = parent->pq_u.fairq_opts.lssc_m2; > + if (!is_gsc_under_sc(&lssc, &sc)) { > + warnx("link-sharing sc exceeds parent's sc"); > + goto err_ret; > + } > + } > + > + gsc_destroy(&lssc); > + > + return (0); > + > +err_ret: > + gsc_destroy(&lssc); > + return (-1); > +} > + > static int > check_commit_hfsc(int dev, int opts, struct pf_altq *pa) > { > @@ -847,6 +949,43 @@ check_commit_hfsc(int dev, int opts, str > } > > static int > +check_commit_fairq(int dev __unused, int opts __unused, struct pf_altq > *pa) > +{ > + struct pf_altq *altq, *def = NULL; > + int default_class; > + int error = 0; > + > + /* check if fairq has one default queue for this interface */ > + default_class = 0; > + TAILQ_FOREACH(altq, &altqs, entries) { > + if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) > + continue; > + if (altq->qname[0] == 0) /* this is for interface */ > + continue; > + if (altq->pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) { > + default_class++; > + def = altq; > + } > + } > + if (default_class != 1) { > + warnx("should have one default queue on %s", pa->ifname); > + return (1); > + } > + /* make sure the default queue is a leaf */ > + TAILQ_FOREACH(altq, &altqs, entries) { > + if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) > + continue; > + if (altq->qname[0] == 0) /* this is for interface */ > + continue; > + if (strncmp(altq->parent, def->qname, PF_QNAME_SIZE) == 0) > { > + warnx("default queue is not a leaf"); > + error++; > + } > + } > + return (error); > +} > + > +static int > print_hfsc_opts(const struct pf_altq *a, const struct node_queue_opt > *qopts) > { > const struct hfsc_opts *opts; > @@ -892,6 +1031,43 @@ print_hfsc_opts(const struct pf_altq *a, > return (0); > } > > +static int > +print_fairq_opts(const struct pf_altq *a, const struct node_queue_opt > *qopts) > +{ > + const struct fairq_opts *opts; > + const struct node_fairq_sc *loc_lssc; > + > + opts = &a->pq_u.fairq_opts; > + if (qopts == NULL) > + loc_lssc = NULL; > + else > + loc_lssc = &qopts->data.fairq_opts.linkshare; > + > + if (opts->flags || > + (opts->lssc_m2 != 0 && (opts->lssc_m2 != a->bandwidth || > + opts->lssc_d != 0))) { > + printf("fairq("); > + if (opts->flags & FARF_RED) > + printf(" red"); > + if (opts->flags & FARF_ECN) > + printf(" ecn"); > + if (opts->flags & FARF_RIO) > + printf(" rio"); > + if (opts->flags & FARF_CLEARDSCP) > + printf(" cleardscp"); > + if (opts->flags & FARF_DEFAULTCLASS) > + printf(" default"); > + if (opts->lssc_m2 != 0 && (opts->lssc_m2 != a->bandwidth || > + opts->lssc_d != 0)) > + print_fairq_sc("linkshare", opts->lssc_m1, > opts->lssc_d, > + opts->lssc_m2, loc_lssc); > + printf(" ) "); > + > + return (1); > + } else > + return (0); > +} > + > /* > * admission control using generalized service curve > */ > @@ -1211,6 +1387,23 @@ eval_queue_opts(struct pf_altq *pa, stru > opts->data.hfsc_opts.upperlimit.d; > } > break; > + case ALTQT_FAIRQ: > + pa->pq_u.fairq_opts.flags = opts->data.fairq_opts.flags; > + pa->pq_u.fairq_opts.nbuckets = > opts->data.fairq_opts.nbuckets; > + pa->pq_u.fairq_opts.hogs_m1 = > + eval_bwspec(&opts->data.fairq_opts.hogs_bw, > ref_bw); > + > + if (opts->data.fairq_opts.linkshare.used) { > + pa->pq_u.fairq_opts.lssc_m1 = > + > eval_bwspec(&opts->data.fairq_opts.linkshare.m1, > + ref_bw); > + pa->pq_u.fairq_opts.lssc_m2 = > + > eval_bwspec(&opts->data.fairq_opts.linkshare.m2, > + ref_bw); > + pa->pq_u.fairq_opts.lssc_d = > + opts->data.fairq_opts.linkshare.d; > + } > + break; > default: > warnx("eval_queue_opts: unknown scheduler type %u", > opts->qtype); > @@ -1256,3 +1449,27 @@ print_hfsc_sc(const char *scname, u_int > if (d != 0) > printf(")"); > } > + > +void > +print_fairq_sc(const char *scname, u_int m1, u_int d, u_int m2, > + const struct node_fairq_sc *sc) > +{ > + printf(" %s", scname); > + > + if (d != 0) { > + printf("("); > + if (sc != NULL && sc->m1.bw_percent > 0) > + printf("%u%%", sc->m1.bw_percent); > + else > + printf("%s", rate2str((double)m1)); > + printf(" %u", d); > + } > + > + if (sc != NULL && sc->m2.bw_percent > 0) > + printf(" %u%%", sc->m2.bw_percent); > + else > + printf(" %s", rate2str((double)m2)); > + > + if (d != 0) > + printf(")"); > +} > > Modified: stable/10/sbin/pfctl/pfctl_parser.h > > ============================================================================== > --- stable/10/sbin/pfctl/pfctl_parser.h Sat Apr 16 00:01:16 2016 > (r298090) > +++ stable/10/sbin/pfctl/pfctl_parser.h Sat Apr 16 02:11:04 2016 > (r298091) > @@ -150,12 +150,27 @@ struct node_hfsc_opts { > int flags; > }; > > +struct node_fairq_sc { > + struct node_queue_bw m1; /* slope of 1st segment; bps */ > + u_int d; /* x-projection of m1; msec */ > + struct node_queue_bw m2; /* slope of 2nd segment; bps */ > + u_int8_t used; > +}; > + > +struct node_fairq_opts { > + struct node_fairq_sc linkshare; > + struct node_queue_bw hogs_bw; > + u_int nbuckets; > + int flags; > +}; > + > struct node_queue_opt { > int qtype; > union { > struct cbq_opts cbq_opts; > struct priq_opts priq_opts; > struct node_hfsc_opts hfsc_opts; > + struct node_fairq_opts fairq_opts; > } data; > }; > > > Modified: stable/10/sbin/pfctl/pfctl_qstats.c > > ============================================================================== > --- stable/10/sbin/pfctl/pfctl_qstats.c Sat Apr 16 00:01:16 2016 > (r298090) > +++ stable/10/sbin/pfctl/pfctl_qstats.c Sat Apr 16 02:11:04 2016 > (r298091) > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include "pfctl.h" > #include "pfctl_parser.h" > @@ -46,6 +47,7 @@ union class_stats { > class_stats_t cbq_stats; > struct priq_classstats priq_stats; > struct hfsc_classstats hfsc_stats; > + struct fairq_classstats fairq_stats; > }; > > #define AVGN_MAX 8 > @@ -77,6 +79,7 @@ void pfctl_print_altq_node(int, const > void print_cbqstats(struct queue_stats); > void print_priqstats(struct queue_stats); > void print_hfscstats(struct queue_stats); > +void print_fairqstats(struct queue_stats); > void pfctl_free_altq_node(struct pf_altq_node *); > void pfctl_print_altq_nodestat(int, > const struct pf_altq_node *); > @@ -317,6 +320,9 @@ pfctl_print_altq_nodestat(int dev, const > case ALTQT_HFSC: > print_hfscstats(a->qstats); > break; > + case ALTQT_FAIRQ: > + print_fairqstats(a->qstats); > + break; > } > } > > @@ -382,6 +388,26 @@ print_hfscstats(struct queue_stats cur) > } > > void > +print_fairqstats(struct queue_stats cur) > +{ > + printf(" [ pkts: %10llu bytes: %10llu " > + "dropped pkts: %6llu bytes: %6llu ]\n", > + (unsigned long long)cur.data.fairq_stats.xmit_cnt.packets, > + (unsigned long long)cur.data.fairq_stats.xmit_cnt.bytes, > + (unsigned long long)cur.data.fairq_stats.drop_cnt.packets, > + (unsigned long long)cur.data.fairq_stats.drop_cnt.bytes); > + printf(" [ qlength: %3d/%3d ]\n", > + cur.data.fairq_stats.qlength, cur.data.fairq_stats.qlimit); > + > + if (cur.avgn < 2) > + return; > + > + printf(" [ measured: %7.1f packets/s, %s/s ]\n", > + cur.avg_packets / STAT_INTERVAL, > + rate2str((8 * cur.avg_bytes) / STAT_INTERVAL)); > +} > + > +void > pfctl_free_altq_node(struct pf_altq_node *node) > { > while (node != NULL) { > @@ -421,6 +447,10 @@ update_avg(struct pf_altq_node *a) > b = qs->data.hfsc_stats.xmit_cnt.bytes; > p = qs->data.hfsc_stats.xmit_cnt.packets; > break; > + case ALTQT_FAIRQ: > + b = qs->data.fairq_stats.xmit_cnt.bytes; > + p = qs->data.fairq_stats.xmit_cnt.packets; > + break; > default: > b = 0; > p = 0; > > Modified: stable/10/share/man/man4/altq.4 > > ============================================================================== > --- stable/10/share/man/man4/altq.4 Sat Apr 16 00:01:16 2016 > (r298090) > +++ stable/10/share/man/man4/altq.4 Sat Apr 16 02:11:04 2016 > (r298091) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd December 9, 2011 > +.Dd June 24, 2015 > .Dt ALTQ 4 > .Os > .Sh NAME > @@ -40,6 +40,7 @@ > .Cd options ALTQ_HFSC > .Cd options ALTQ_CDNR > .Cd options ALTQ_PRIQ > +.Cd options ALTQ_FAIRQ > .Sh DESCRIPTION > The > .Nm > @@ -93,6 +94,10 @@ any of the available disciplines or cons > Build the > .Dq "Priority Queuing" > discipline. > +.It Dv ALTQ_FAIRQ > +Build the > +.Dq "Fair Queuing" > +discipline. > .It Dv ALTQ_NOPCC > Required if the TSC is unusable. > .It Dv ALTQ_DEBUG > > Modified: stable/10/sys/conf/NOTES > > ============================================================================== > --- stable/10/sys/conf/NOTES Sat Apr 16 00:01:16 2016 (r298090) > +++ stable/10/sys/conf/NOTES Sat Apr 16 02:11:04 2016 (r298091) > @@ -700,6 +700,7 @@ options ALTQ_CBQ # Class Based Queueing > options ALTQ_RED # Random Early Detection > options ALTQ_RIO # RED In/Out > options ALTQ_HFSC # Hierarchical Packet Scheduler > +options ALTQ_FAIRQ # Fair Packet Scheduler > options ALTQ_CDNR # Traffic conditioner > options ALTQ_PRIQ # Priority Queueing > options ALTQ_NOPCC # Required if the TSC is unusable > > Modified: stable/10/sys/conf/files > > ============================================================================== > --- stable/10/sys/conf/files Sat Apr 16 00:01:16 2016 (r298090) > +++ stable/10/sys/conf/files Sat Apr 16 02:11:04 2016 (r298091) > @@ -252,6 +252,7 @@ compat/freebsd32/freebsd32_syscalls.c op > compat/freebsd32/freebsd32_sysent.c optional compat_freebsd32 > contrib/altq/altq/altq_cbq.c optional altq > contrib/altq/altq/altq_cdnr.c optional altq > +contrib/altq/altq/altq_fairq.c optional altq > contrib/altq/altq/altq_hfsc.c optional altq > contrib/altq/altq/altq_priq.c optional altq > contrib/altq/altq/altq_red.c optional altq > > Modified: stable/10/sys/conf/options > > ============================================================================== > --- stable/10/sys/conf/options Sat Apr 16 00:01:16 2016 (r298090) > +++ stable/10/sys/conf/options Sat Apr 16 02:11:04 2016 (r298091) > @@ -385,6 +385,7 @@ ALTQ opt_global.h > ALTQ_CBQ opt_altq.h > ALTQ_CDNR opt_altq.h > ALTQ_DEBUG opt_altq.h > +ALTQ_FAIRQ opt_altq.h > ALTQ_HFSC opt_altq.h > ALTQ_NOPCC opt_altq.h > ALTQ_PRIQ opt_altq.h > > Modified: stable/10/sys/contrib/altq/altq/altq.h > > ============================================================================== > --- stable/10/sys/contrib/altq/altq/altq.h Sat Apr 16 00:01:16 2016 > (r298090) > +++ stable/10/sys/contrib/altq/altq/altq.h Sat Apr 16 02:11:04 2016 > (r298091) > @@ -63,7 +63,8 @@ > #define ALTQT_BLUE 10 /* blue */ > #define ALTQT_PRIQ 11 /* priority queue */ > #define ALTQT_JOBS 12 /* JoBS */ > -#define ALTQT_MAX 13 /* should be max > discipline type + 1 */ > +#define ALTQT_FAIRQ 13 /* fairq */ > +#define ALTQT_MAX 14 /* should be max > discipline type + 1 */ > > #ifdef ALTQ3_COMPAT > struct altqreq { > > Added: stable/10/sys/contrib/altq/altq/altq_fairq.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/10/sys/contrib/altq/altq/altq_fairq.c Sat Apr 16 > 02:11:04 2016 (r298091) > @@ -0,0 +1,874 @@ > +/* > + * Copyright (c) 2008 The DragonFly Project. All rights reserved. > + * > + * This code is derived from software contributed to The DragonFly Project > + * by Matthew Dillon > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * 3. Neither the name of The DragonFly 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 COPYRIGHT HOLDERS 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 ARE DISCLAIMED. IN NO EVENT SHALL THE > + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, > + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; > + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT > + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $DragonFly: src/sys/net/altq/altq_fairq.c,v 1.1 2008/04/06 18:58:15 > dillon Exp $ > + * $FreeBSD$ > + */ > +/* > + * Matt: I gutted altq_priq.c and used it as a skeleton on which to build > + * fairq. The fairq algorithm is completely different then priq, of > course, > + * but because I used priq's skeleton I believe I should include priq's > + * copyright. > + * > + * Copyright (C) 2000-2003 > + * Sony Computer Science Laboratories Inc. All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY SONY CSL 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 > + * ARE DISCLAIMED. IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +/* > + * FAIRQ - take traffic classified by keep state (hashed into > + * mbuf->m_pkthdr.altq_state_hash) and bucketize it. Fairly extract > + * the first packet from each bucket in a round-robin fashion. > + * > + * TODO - better overall qlimit support (right now it is per-bucket). > + * - NOTE: red etc is per bucket, not overall. > + * - better service curve support. > + * > + * EXAMPLE: > + * > + * altq on em0 fairq bandwidth 650Kb queue { std, bulk } > + * queue std priority 3 bandwidth 400Kb \ > + * fairq (buckets 64, default, hogs 1Kb) qlimit 50 > + * queue bulk priority 2 bandwidth 100Kb \ > + * fairq (buckets 64, hogs 1Kb) qlimit 50 > + * > + * pass out on em0 from any to any keep state queue std > + * pass out on em0 inet proto tcp ..... port ... keep state queue bulk > + */ > +#include "opt_altq.h" > +#include "opt_inet.h" > +#include "opt_inet6.h" > + > +#ifdef ALTQ_FAIRQ /* fairq is enabled in the kernel conf */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +/* > + * function prototypes > + */ > +static int fairq_clear_interface(struct fairq_if *); > +static int fairq_request(struct ifaltq *, int, void *); > +static void fairq_purge(struct fairq_if *); > +static struct fairq_class *fairq_class_create(struct fairq_if *, int, > int, u_int, struct fairq_opts *, int); > +static int fairq_class_destroy(struct fairq_class *); > +static int fairq_enqueue(struct ifaltq *, struct mbuf *, struct > altq_pktattr *); > +static struct mbuf *fairq_dequeue(struct ifaltq *, int); > + > +static int fairq_addq(struct fairq_class *, struct mbuf *, u_int32_t); > +static struct mbuf *fairq_getq(struct fairq_class *, uint64_t); > +static struct mbuf *fairq_pollq(struct fairq_class *, uint64_t, int *); > +static fairq_bucket_t *fairq_selectq(struct fairq_class *, int); > +static void fairq_purgeq(struct fairq_class *); > + > +static void get_class_stats(struct fairq_classstats *, struct > fairq_class *); > +static struct fairq_class *clh_to_clp(struct fairq_if *, uint32_t); > + > +int > +fairq_pfattach(struct pf_altq *a) > +{ > + struct ifnet *ifp; > + int error; > + > + if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL) > + return (EINVAL); > + > + error = altq_attach(&ifp->if_snd, ALTQT_FAIRQ, a->altq_disc, > + fairq_enqueue, fairq_dequeue, fairq_request, NULL, NULL); > + > + return (error); > +} > + > +int > +fairq_add_altq(struct pf_altq *a) > +{ > + struct fairq_if *pif; > + struct ifnet *ifp; > + > + if ((ifp = ifunit(a->ifname)) == NULL) > + return (EINVAL); > + if (!ALTQ_IS_READY(&ifp->if_snd)) > + return (ENODEV); > + > + > + pif = malloc(sizeof(struct fairq_if), > + M_DEVBUF, M_WAITOK | M_ZERO); > + pif->pif_bandwidth = a->ifbandwidth; > + pif->pif_maxpri = -1; > + pif->pif_ifq = &ifp->if_snd; > + > + /* keep the state in pf_altq */ > + a->altq_disc = pif; > + > + return (0); > +} > + > +int > +fairq_remove_altq(struct pf_altq *a) > +{ > + struct fairq_if *pif; > + > + if ((pif = a->altq_disc) == NULL) > + return (EINVAL); > + a->altq_disc = NULL; > + > + fairq_clear_interface(pif); > + > + free(pif, M_DEVBUF); > + return (0); > +} > + > +int > +fairq_add_queue(struct pf_altq *a) > +{ > + struct fairq_if *pif; > + struct fairq_class *cl; > + > + if ((pif = a->altq_disc) == NULL) > + return (EINVAL); > + > + /* check parameters */ > + if (a->priority >= FAIRQ_MAXPRI) > + return (EINVAL); > + if (a->qid == 0) > + return (EINVAL); > + if (pif->pif_classes[a->priority] != NULL) > + return (EBUSY); > + if (clh_to_clp(pif, a->qid) != NULL) > + return (EBUSY); > + > + cl = fairq_class_create(pif, a->priority, a->qlimit, a->bandwidth, > + &a->pq_u.fairq_opts, a->qid); > + if (cl == NULL) > + return (ENOMEM); > + > + return (0); > +} > + > +int > +fairq_remove_queue(struct pf_altq *a) > +{ > + struct fairq_if *pif; > + struct fairq_class *cl; > + > + if ((pif = a->altq_disc) == NULL) > + return (EINVAL); > + > + if ((cl = clh_to_clp(pif, a->qid)) == NULL) > + return (EINVAL); > + > + return (fairq_class_destroy(cl)); > +} > + > +int > +fairq_getqstats(struct pf_altq *a, void *ubuf, int *nbytes) > +{ > + struct fairq_if *pif; > + struct fairq_class *cl; > + struct fairq_classstats stats; > + int error = 0; > + > + if ((pif = altq_lookup(a->ifname, ALTQT_FAIRQ)) == NULL) > + return (EBADF); > + > + if ((cl = clh_to_clp(pif, a->qid)) == NULL) > + return (EINVAL); > + > + if (*nbytes < sizeof(stats)) > + return (EINVAL); > + > + get_class_stats(&stats, cl); > + > + if ((error = copyout((caddr_t)&stats, ubuf, sizeof(stats))) != 0) > + return (error); > + *nbytes = sizeof(stats); > + return (0); > +} > + > +/* > + * bring the interface back to the initial state by discarding > + * all the filters and classes. > + */ > +static int > +fairq_clear_interface(struct fairq_if *pif) > +{ > + struct fairq_class *cl; > + int pri; > + > + /* clear out the classes */ > + for (pri = 0; pri <= pif->pif_maxpri; pri++) { > + if ((cl = pif->pif_classes[pri]) != NULL) > + fairq_class_destroy(cl); > + } > + > + return (0); > +} > + > +static int > +fairq_request(struct ifaltq *ifq, int req, void *arg) > +{ > + struct fairq_if *pif = (struct fairq_if *)ifq->altq_disc; > + > + IFQ_LOCK_ASSERT(ifq); > + > + switch (req) { > + case ALTRQ_PURGE: > + fairq_purge(pif); > + break; > + } > + return (0); > +} > + > +/* discard all the queued packets on the interface */ > +static void > +fairq_purge(struct fairq_if *pif) > +{ > + struct fairq_class *cl; > + int pri; > + > + for (pri = 0; pri <= pif->pif_maxpri; pri++) { > + if ((cl = pif->pif_classes[pri]) != NULL && cl->cl_head) > + fairq_purgeq(cl); > + } > + if (ALTQ_IS_ENABLED(pif->pif_ifq)) > + pif->pif_ifq->ifq_len = 0; > +} > + > +static struct fairq_class * > +fairq_class_create(struct fairq_if *pif, int pri, int qlimit, > + u_int bandwidth, struct fairq_opts *opts, int qid) > +{ > + struct fairq_class *cl; > + int flags = opts->flags; > + u_int nbuckets = opts->nbuckets; > + int i; > + > +#ifndef ALTQ_RED > + if (flags & FARF_RED) { > +#ifdef ALTQ_DEBUG > + printf("fairq_class_create: RED not configured for > FAIRQ!\n"); > +#endif > + return (NULL); > + } > +#endif > + if (nbuckets == 0) > + nbuckets = 256; > + if (nbuckets > FAIRQ_MAX_BUCKETS) > + nbuckets = FAIRQ_MAX_BUCKETS; > + /* enforce power-of-2 size */ > + while ((nbuckets ^ (nbuckets - 1)) != ((nbuckets << 1) - 1)) > + ++nbuckets; > + > + if ((cl = pif->pif_classes[pri]) != NULL) { > + /* modify the class instead of creating a new one */ > + IFQ_LOCK(cl->cl_pif->pif_ifq); > + if (cl->cl_head) > + fairq_purgeq(cl); > + IFQ_UNLOCK(cl->cl_pif->pif_ifq); > +#ifdef ALTQ_RIO > + if (cl->cl_qtype == Q_RIO) > + rio_destroy((rio_t *)cl->cl_red); > +#endif > +#ifdef ALTQ_RED > + if (cl->cl_qtype == Q_RED) > + red_destroy(cl->cl_red); > +#endif > + } else { > + cl = malloc(sizeof(struct fairq_class), > + M_DEVBUF, M_WAITOK | M_ZERO); > + cl->cl_nbuckets = nbuckets; > + cl->cl_nbucket_mask = nbuckets - 1; > + > + cl->cl_buckets = malloc( > + sizeof(struct fairq_bucket) * cl->cl_nbuckets, > + M_DEVBUF, M_WAITOK | M_ZERO); > + cl->cl_head = NULL; > + } > + > + pif->pif_classes[pri] = cl; > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > -- > Ermal > From owner-svn-src-all@freebsd.org Mon Apr 18 18:20:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30304B1206C; Mon, 18 Apr 2016 18:20:05 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD17F1ECF; Mon, 18 Apr 2016 18:20:04 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qg0-x22a.google.com with SMTP id v14so31739768qge.0; Mon, 18 Apr 2016 11:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=edw87kCjKuxVs/SlyQ8myQJQ5bXqlaxbdeV42fMF5O8=; b=sApIuhjQ6IlQw+fFY5pqO3wqZf2kFYqanR7geE/gEUKizwj3g01X0wNPdB1ODufSgo gfkFLmT14KGnD6yfeGlUBOGO1RPxw6yJOet4NF+ij5N+iModyhcq6YRoNQJGsEOx500Y 5IgN13ZzubtNKtz5EdP2ew/OUKVXnyH1Ee/DsSDiqehF05fOCSwvEI3eIekS+TtU+O6N 6i9pDpSYhBu1nOdOcGJXvdp+lBe8QvoxjuoLbx0z9Jvo/54K2+UM1yQ5yDSi7vXlegOG bBmSTOCO6OelSkugYc2w+Nfx3369M3U102boS0TWbvIgjI/mcag+aXEVQOfV/L5M5RnO 5Xpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; bh=edw87kCjKuxVs/SlyQ8myQJQ5bXqlaxbdeV42fMF5O8=; b=h8YdLhSXhwjsm2NSSIdtoKCgXYI0F7Oq0Vz6eDOXU2XPfgN121D9lVlJnCsZ1d95qP CKAFIaCnj2J+gOVxiAuZlKWj7P4vcowcM/JQ2IbF9PhkUMe6UwmA7hIb71VMXvbsqA/X JlhrfnsDOfrAZNv5/mFHAdZhmySbRRRiG4w2711k16rfmJasPQW/QzPgfa+871/lyjv1 VhDirMJjlTtBJcBIxvfTb0bLfGRPfd1L6TLX50SnHvktVPtL4mCdYLxcFPwdAXR9azdk ksKygWtOVz2PjdfMXWSzFj4O6Bt5K73cYJfwYxhtX9o3nkwCejEq1JBjm6ZACBO/Dx9R Y7ZA== X-Gm-Message-State: AOPr4FVDkG/lYl+F2F5j/3kRTsCRUXYT0VsgypEEoj+hY41/H5WrD2yGwkuXHLFenVeLWg== X-Received: by 10.140.203.65 with SMTP id y62mr46934231qha.40.1461003603985; Mon, 18 Apr 2016 11:20:03 -0700 (PDT) Received: from mbp.home (179-125-142-141.desktop.com.br. [179.125.142.141]) by smtp.gmail.com with ESMTPSA id f143sm7866445qhf.27.2016.04.18.11.20.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Apr 2016 11:20:02 -0700 (PDT) Sender: Renato Botelho Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r298107 - in head: . bin/cat bin/cat/tests bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/date/tests bin/dd bin/dd/tests bin/df bin/domainname bin/echo bin/ed bin/expr bin/e... From: Renato Botelho In-Reply-To: <201604160745.u3G7jV8j080717@repo.freebsd.org> Date: Mon, 18 Apr 2016 15:20:05 -0300 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201604160745.u3G7jV8j080717@repo.freebsd.org> To: Glen Barber X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:20:05 -0000 > On Apr 16, 2016, at 04:45, Glen Barber wrote: >=20 > Author: gjb > Date: Sat Apr 16 07:45:30 2016 > New Revision: 298107 > URL: https://svnweb.freebsd.org/changeset/base/298107 >=20 > Log: > Merge the projects/release-pkg branch to head. >=20 > This allows packaging the base system with pkg(8), including > but not limited to providing the ability to provide upstream > binary update possibilities for non-tier-1 architectures. >=20 > This merge is a requirement of the 11.0-RELEASE, and as such, > thank you to everyone that has tested the project branch. >=20 > Documentation in build(7) etc. is still somewhat sparse, but > updates to those parts will follow. >=20 > Sponsored by: The FreeBSD Foundation >=20 Glen, During CFT message you mentioned a patch should be applied to = ports-mgmt/pkg to keep track of base shared libraries. Is it still = necessary? If yes, do you know when it=E2=80=99s going to be applied in = pkg? -- Renato Botelho From owner-svn-src-all@freebsd.org Mon Apr 18 18:20:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78B7AB12148; Mon, 18 Apr 2016 18:20:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 4964C10B0; Mon, 18 Apr 2016 18:20:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 365811CF8; Mon, 18 Apr 2016 18:20:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id D0DEEDE12; Mon, 18 Apr 2016 18:20:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 7waFdYW8WNuK; Mon, 18 Apr 2016 18:20:40 +0000 (UTC) Subject: Re: svn commit: r297842 - in head/gnu/lib: csu libgcc libgcov DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 92CC4DE0C To: Jilles Tjoelker References: <201604120245.u3C2jJfo002870@repo.freebsd.org> <20160416120542.GA92656@stack.nl> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <0b5bb852-a238-ff9c-464f-704c0512d9df@FreeBSD.org> Date: Mon, 18 Apr 2016 11:20:50 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160416120542.GA92656@stack.nl> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wL8WdkWgRL8A4dCGmAUFEsrCwKM7PqoA6" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:20:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wL8WdkWgRL8A4dCGmAUFEsrCwKM7PqoA6 Content-Type: multipart/mixed; boundary="1PKXH6qNvp7vann79oacTuEblwf6WrpTt" From: Bryan Drewery To: Jilles Tjoelker Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0b5bb852-a238-ff9c-464f-704c0512d9df@FreeBSD.org> Subject: Re: svn commit: r297842 - in head/gnu/lib: csu libgcc libgcov References: <201604120245.u3C2jJfo002870@repo.freebsd.org> <20160416120542.GA92656@stack.nl> In-Reply-To: <20160416120542.GA92656@stack.nl> --1PKXH6qNvp7vann79oacTuEblwf6WrpTt Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 4/16/2016 5:05 AM, Jilles Tjoelker wrote: > On Tue, Apr 12, 2016 at 02:45:19AM +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Tue Apr 12 02:45:19 2016 >> New Revision: 297842 >> URL: https://svnweb.freebsd.org/changeset/base/297842 >=20 >> Log: >> META_MODE: Avoid changed build command every build. >=20 >> Because the file is generated with -f using another Makefile, 2 >> different Makefiles are trying to handle the .meta file for the >> target. The obvious .NOMETA_CMP or .NOMETA on the ${MAKE} targets >> don't work as they are very limited in scope in bmake. Using >> .PHONY fixes the problem and ensures that the ${MAKE} command >> is always ran to check if it is outdated in the sub-make. >=20 >> An example of the problem in gnu/lib/libgcc (with make -dM): >> /usr/obj/root/git/freebsd/gnu/lib/libgcc/tm.h.meta: 2: a build com= mand has changed >> TARGET_CPU_DEFAULT=3D"" HEADERS=3D"options.h i386/biarch64.h i386= /i386.h i386/unix.h i386/att.h dbxelf.h elfos-undef.h elfos.h freebsd-nat= ive.h freebsd-spec.h freebsd.h i386/x86-64.h i386/freebsd.h i386/freebsd6= 4.h defaults.h" DEFINES=3D"" /bin/sh /root/git/freebsd/gnu/lib/libgcc/.= =2E/../../contrib/gcc/mkconfig.sh tm.h >> vs >> (cd /root/git/freebsd/gnu/lib/libgcc; make -f /root/git/freebsd/gn= u/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile MFILE=3D/root/git/freebsd= /gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile GCCDIR=3D/root/git/fre= ebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h) >> Skipping meta for tm.h: .NOMETA >> (cd /root/git/freebsd/gnu/lib/libgcc; make -f /root/git/freebsd/gn= u/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile MFILE=3D/root/git/freebsd= /gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile GCCDIR=3D/root/git/fre= ebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h) >> `tm.h' is up to date. >=20 >> Modified: >> head/gnu/lib/csu/Makefile >> head/gnu/lib/libgcc/Makefile >> head/gnu/lib/libgcov/Makefile >=20 >> Modified: head/gnu/lib/csu/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/gnu/lib/csu/Makefile Tue Apr 12 02:01:16 2016 (r297841) >> +++ head/gnu/lib/csu/Makefile Tue Apr 12 02:45:19 2016 (r297842) >> @@ -71,7 +71,7 @@ crtendS.o: ${ENDSRC} >> -c -o ${.TARGET} ${.ALLSRC:N*.h} >> =20 >> CLEANFILES+=3D tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm= =2Eh >> -tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile >> +tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile .PHONY >> (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=3D${.ALLSRC} GCCDIR=3D${= GCCDIR} ${.TARGET}) >> =20 >> .include >> >> Modified: head/gnu/lib/libgcc/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/gnu/lib/libgcc/Makefile Tue Apr 12 02:01:16 2016 (r297841) >> +++ head/gnu/lib/libgcc/Makefile Tue Apr 12 02:45:19 2016 (r297842) >> @@ -343,7 +343,7 @@ ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS >> # >> # Generated headers >> # >> -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile >> +${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY >> (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=3D${.ALLSRC} GCCDIR=3D${= GCCDIR} ${.TARGET}) >> =20 >> CLEANFILES +=3D ${COMMONHDRS} >> >> Modified: head/gnu/lib/libgcov/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/gnu/lib/libgcov/Makefile Tue Apr 12 02:01:16 2016 (r297841) >> +++ head/gnu/lib/libgcov/Makefile Tue Apr 12 02:45:19 2016 (r297842) >> @@ -45,7 +45,7 @@ CC_S =3D ${CC} -c ${CFLAGS} ${PICFLAG} -DS >> COMMONHDRS=3D tm.h tconfig.h gcov-iov.h options.h >> CLEANFILES+=3D ${COMMONHDRS} cs-tm.h cs-tconfig.h options.h optionlis= t >> =20 >> -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile >> +${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY >> (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=3D${.ALLSRC} GCCDIR=3D${= GCCDIR} ${.TARGET}) >> =20 >> ${OBJS} beforedepend: ${COMMONHDRS} >=20 > Unfortunately, this causes things to be built every time for > non-metamode builds, including make installworld. I had to revert the > gnu/lib/csu/Makefile part locally to get make installworld with a > read-only /usr/obj to work again. >=20 Yup, it does in META MODE as well. I failed to do an install test. r298218 fixes it and I added an error in install if a rebuild occurs in r298219 to help catch these earlier. --=20 Regards, Bryan Drewery --1PKXH6qNvp7vann79oacTuEblwf6WrpTt-- --wL8WdkWgRL8A4dCGmAUFEsrCwKM7PqoA6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXFSWCAAoJEDXXcbtuRpfPQFAH/iruQH4g9JAUkQjJlg9jYFcI 8j2S34jySPteHHGTtBOFprNik4WQ6dVV8lESCQIuwSTh1TPHJa/x7hO7OqO9Q2tV e9VLDp2mbKKC5NwWhz5hzg/UOWrlwiugvrECpjTHuruCTXMNPRsk22cv2k5V4rp6 0dFB9Tg5eji5BFmBLngKqz9kUksQpsAylza+ZQDEDzJbk3ttSMrBwTLTK8xjHnA3 eap5yq/8jFcSQKW62FoysWryhlCqqYz6YysbKpnp7+/OMYElACLLrAIfcxwlOnH4 wQ0178JNvlR6+fXDEfDRYFNw4l5I3cjtj9GDBz4ZrT5ARE269tH8C/YexwFPvyI= =vfW8 -----END PGP SIGNATURE----- --wL8WdkWgRL8A4dCGmAUFEsrCwKM7PqoA6-- From owner-svn-src-all@freebsd.org Mon Apr 18 18:37:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79832B12753; Mon, 18 Apr 2016 18:37:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 6940D1B89; Mon, 18 Apr 2016 18:37:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 0F90F1110; Mon, 18 Apr 2016 18:37:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 18 Apr 2016 18:37:45 +0000 From: Glen Barber To: Renato Botelho Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298107 - in head: . bin/cat bin/cat/tests bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/date/tests bin/dd bin/dd/tests bin/df bin/domainname bin/echo bin/ed bin/expr bin/e... Message-ID: <20160418183745.GU1554@FreeBSD.org> References: <201604160745.u3G7jV8j080717@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MhP8cYafZlTESjGT" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:37:47 -0000 --MhP8cYafZlTESjGT Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 18, 2016 at 03:20:05PM -0300, Renato Botelho wrote: > > On Apr 16, 2016, at 04:45, Glen Barber wrote: > >=20 > > Author: gjb > > Date: Sat Apr 16 07:45:30 2016 > > New Revision: 298107 > > URL: https://svnweb.freebsd.org/changeset/base/298107 > >=20 > > Log: > > Merge the projects/release-pkg branch to head. > >=20 > > This allows packaging the base system with pkg(8), including > > but not limited to providing the ability to provide upstream > > binary update possibilities for non-tier-1 architectures. > >=20 > > This merge is a requirement of the 11.0-RELEASE, and as such, > > thank you to everyone that has tested the project branch. > >=20 > > Documentation in build(7) etc. is still somewhat sparse, but > > updates to those parts will follow. > >=20 > > Sponsored by: The FreeBSD Foundation > >=20 >=20 > Glen, >=20 > During CFT message you mentioned a patch should be applied to ports-mgmt/= pkg to keep track of base shared libraries. Is it still necessary? If yes, = do you know when it=E2=80=99s going to be applied in pkg? >=20 It is included in pkg 1.7.x, so no patch is required anymore. Glen --MhP8cYafZlTESjGT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXFSl5AAoJEAMUWKVHj+KTQlQP/2o/I+IMI5KwbwvGjbadhBXK wtbACEBiVJMHnEenSCuKVkljjawrKvmWLIsENUMDxMPDEGygKAjRpXBSXOEjEvuN e+sl06KKUbF1+aDtnq0i6t12VFzfNEq24FOr0ri3mQDds0qR1MUFa18e0fW0xXz5 lfft+aFPaxokWaQv16dXkvtg35/BPgmSp7Qr8DAHqv4wMplNpgHATNm9dAaZ/3lj 9aj6soRGxTASg93ZhtH96Da91GJc+svzPljdNXp1kC3XBpzT5HsLMNAjyiUxrKsc wZYQAPpA4P6jEsUIDOQJTgPLTrVhf5zcPM2QK8Qa4iaX1Osr5Ba5GNtEx3xVy51y Ng/xRUib0EQ6fu5x51JO8K3+Fu1FnQpVxGRGnMDRhWqkd6D2GdwKwZxQ69Vx4E9s 1k8E3yMCElFpDiy6KTBfOHFsP+Q/xdS2K5EUne4yyWZomI2NFWjd47VHBOcuisEl 0BMvxLE36+8UMJ6RZyLi3n8om8YqCE050FNLiPdZ3p+xJrFOd5KWCfa5+EEb1ogw 9wpELm8QT5JXiWvEbxjG7IFlKfDpkUsC90UUFyfaia+liTr5uG4T3QH4nbHBjA7T UuvdAamhVTIz1KFcmX8IEMyN5zrdwbXOAi9fcI6ElTBKq4bRVjAAdFFdWvdDr8qf xv9SMwIwBHtAPk/WImig =Hirr -----END PGP SIGNATURE----- --MhP8cYafZlTESjGT-- From owner-svn-src-all@freebsd.org Mon Apr 18 18:39:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38889B12860; Mon, 18 Apr 2016 18:39:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A4581D73; Mon, 18 Apr 2016 18:39:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IIdhNk065897; Mon, 18 Apr 2016 18:39:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IIdhP1065896; Mon, 18 Apr 2016 18:39:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604181839.u3IIdhP1065896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 18 Apr 2016 18:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298221 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:39:44 -0000 Author: bdrewery Date: Mon Apr 18 18:39:43 2016 New Revision: 298221 URL: https://svnweb.freebsd.org/changeset/base/298221 Log: Follow-up r298220: Don't pass down META_MODE which will still enable it. Reported by: Nikolai Lifanov Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Apr 18 18:14:05 2016 (r298220) +++ head/Makefile Mon Apr 18 18:39:43 2016 (r298221) @@ -189,6 +189,7 @@ _MAKE= PATH=${PATH} ${SUB_MAKE} -f Makef # redundant restaging but is dangerous for user install targets. .if make(distrib*) || make(*install*) _MAKE+= MK_META_MODE=no +.unexport META_MODE .endif # Guess machine architecture from machine type, and vice versa. From owner-svn-src-all@freebsd.org Mon Apr 18 18:53:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BC93B12F4A; Mon, 18 Apr 2016 18:53:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18A111BA6; Mon, 18 Apr 2016 18:53:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 163C4B989; Mon, 18 Apr 2016 14:53:52 -0400 (EDT) From: John Baldwin To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298107 - in head: . bin/cat bin/cat/tests bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/date/tests bin/dd bin/dd/tests bin/df bin/domainname bin/echo bin/ed bin/expr bin/e... Date: Mon, 18 Apr 2016 10:36:41 -0700 Message-ID: <1815296.pIt0iZy7kC@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604160745.u3G7jV8j080717@repo.freebsd.org> References: <201604160745.u3G7jV8j080717@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 18 Apr 2016 14:53:52 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:53:53 -0000 On Saturday, April 16, 2016 07:45:31 AM Glen Barber wrote: > Author: gjb > Date: Sat Apr 16 07:45:30 2016 > New Revision: 298107 > URL: https://svnweb.freebsd.org/changeset/base/298107 > > Log: > Merge the projects/release-pkg branch to head. > > This allows packaging the base system with pkg(8), including > but not limited to providing the ability to provide upstream > binary update possibilities for non-tier-1 architectures. > > This merge is a requirement of the 11.0-RELEASE, and as such, > thank you to everyone that has tested the project branch. > > Documentation in build(7) etc. is still somewhat sparse, but > updates to those parts will follow. > > Sponsored by: The FreeBSD Foundation > > Replaced: > head/sys/boot/forth/Makefile > - copied unchanged from r298104, projects/release-pkg/sys/boot/forth/Makefile You destroyed the history for this file in a way that is pretty much impossible to recover. Compare svn log of stable/10/sys/boot/forth/Makefile with head/sys/boot/forth/Makefile. This is why svn merge IMO should _never_ be used from a projects or user branch into HEAD. It is just too broken. I think we should always use 'svn diff > foo.patch' and 'svn patch foo.patch' in a clean checkout instead. (Note that previous merges such as the initial bhyve import have also destroyed history on files, so this is something that happens fairly often on merges from project branches. I really do think we should forbid them and document that as such.) -- John Baldwin From owner-svn-src-all@freebsd.org Mon Apr 18 18:57:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B87AB131DD; Mon, 18 Apr 2016 18:57:56 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 273C11190; Mon, 18 Apr 2016 18:57:56 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.102] (p508F0542.dip0.t-ipconnect.de [80.143.5.66]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 98D7B721E280E; Mon, 18 Apr 2016 20:57:53 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r298199 - head/sys/netinet From: Michael Tuexen In-Reply-To: <1461001718.52955.50.camel@freebsd.org> Date: Mon, 18 Apr 2016 20:57:52 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <3BCA34A1-0DC4-4DDF-B668-A0DAE8722011@freebsd.org> References: <201604180929.u3I9TEA3095105@repo.freebsd.org> <1460992202.52955.49.camel@freebsd.org> <1461001718.52955.50.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 18:57:56 -0000 > On 18 Apr 2016, at 19:48, Ian Lepore wrote: > > On Mon, 2016-04-18 at 18:58 +0200, Michael Tuexen wrote: >>> On 18 Apr 2016, at 17:10, Ian Lepore wrote: >>> >>> On Mon, 2016-04-18 at 09:29 +0000, Michael Tuexen wrote: >>>> Author: tuexen >>>> Date: Mon Apr 18 09:29:14 2016 >>>> New Revision: 298199 >>>> URL: https://svnweb.freebsd.org/changeset/base/298199 >>>> >>>> Log: >>>> Put panic() calls under INVARIANTS. >>>> >>> >>> A panic that's only active when INVARIANTS is defined is usually >>> spelled KASSERT. >> OK. The change happens because when using the code in the userland >> SCTP stack, we don't provide a panic() replacement unless we >> compile the INVARIANTS defined. Therefore I catch this when compiling >> the userland stack... >> >> Best regards >> Michael >>> > > Ahh, no KASSERT in userland, thanks. I probably could have figured > that out for myself if I had put a bit of effort into looking. Well, we also have KASSERT in the userland code. All panic() calls in the SCTP code are under INVARIANTS and only the last integrated changes broke with the rule. I detected this when getting these changes into the userland code and therefore I fixed it. I'll try to convert them to KASSERTs sometime in the future. But this has not high priority right now... Thanks for making me aware of it. Best regards Michael > > -- Ian > From owner-svn-src-all@freebsd.org Mon Apr 18 19:27:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA114B13E71; Mon, 18 Apr 2016 19:27:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75B731899; Mon, 18 Apr 2016 19:27:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IJRpqA081123; Mon, 18 Apr 2016 19:27:51 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IJRpqW081122; Mon, 18 Apr 2016 19:27:51 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201604181927.u3IJRpqW081122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 18 Apr 2016 19:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298222 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 19:27:52 -0000 Author: gjb Date: Mon Apr 18 19:27:51 2016 New Revision: 298222 URL: https://svnweb.freebsd.org/changeset/base/298222 Log: Add MK_AUTO_OBJ=no to ${MAKE} invocation if PKG_VERSION needs to be created to avoid creating ${.OBJDIR}. The duplicate REVISION/BRANCH/VERSION evaluation will be addressed separately. Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Apr 18 18:39:43 2016 (r298221) +++ head/Makefile.inc1 Mon Apr 18 19:27:51 2016 (r298222) @@ -195,8 +195,8 @@ VERSION= FreeBSD ${REVISION}-${BRANCH:C/ .endif .if !defined(PKG_VERSION) -REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION -BRANCH!= ${MAKE} -C ${SRCDIR}/release -V BRANCH +REVISION!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V REVISION +BRANCH!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V BRANCH SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ ${SRCDIR}/sys/sys/param.h .if ${BRANCH:MSTABLE*} || ${BRANCH:MCURRENT*} From owner-svn-src-all@freebsd.org Mon Apr 18 20:14:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D790CB1368E; Mon, 18 Apr 2016 20:14:52 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA141F18; Mon, 18 Apr 2016 20:14:52 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by mail-lf0-x22e.google.com with SMTP id j11so230270789lfb.1; Mon, 18 Apr 2016 13:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=vShLhx/+SrOx9kz6mNKKWsYkBqCRDukuko7ldHhi3S4=; b=E8bT8VZ0G2A5iQALnN45G6x5fVcpnwZztHwE3sipCHXZr1s5J1WockK2/4QK44BuSu MmrblFnDMSHHe5vISXUEDGqRguj9TNHN74TAxggUA/xH6z4Hwh/FdHJKosLS0dU7yh2b ybej6navkk4jb6WyHRkdP7vY8wOxZ73C6Yb1lJmQtaa5HlzC1LKSp9TZWC68IO266mnr G5I6IOp0yR7be3z5fszfopfZDa4zQHqcaQpvRMXOMLx1QF2oWeHb5gGSmgL29LE9GY46 /hQFQ+nq4G5KGL2vAffdSMNL9Dxy7i4GiUiiwUKmf8xuAf3EG+bKmQ/ORz+SQxwmrh88 wrEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=vShLhx/+SrOx9kz6mNKKWsYkBqCRDukuko7ldHhi3S4=; b=SP/QnvIRbCf74fD0ADkeD85UM7dJeNP6GeJsQ/d69ogCcWTHYDVBPwjq9KTvJbYA1k fcvgpQGULmOuCYHBfV5isjp9g4tbyiYRyHyl8WAR2HR7oHcGmk7MVNt2fbc3gK53N69t AgkHtzbwPh/TpnfIjZNIYeSazwssRxZGof/nM7V5UPvCPdorvdMTNLu3LVYUilecwB4G Ety0P/q/OKDRr7px45l2/PqS4O+/JlPWMMDh6DghsZtWnpzP4zAjAIsoktKm1tiXpVlE yzXBC1Yvf4Px0HSr5gsHQZddAI1Y6LTNqKEavWLfblI0kL3hQNtZwtvPaoJUIkufpuD2 uU7A== X-Gm-Message-State: AOPr4FXV5CYZN6AElJFmWPX4zp64lLLMxinhX0reEfiJj7PUBkFmXQDaB8PR8Mnqe21eB7RCWtIeKCwucULQFg== MIME-Version: 1.0 X-Received: by 10.112.184.79 with SMTP id es15mr1466062lbc.30.1461010490679; Mon, 18 Apr 2016 13:14:50 -0700 (PDT) Received: by 10.112.130.2 with HTTP; Mon, 18 Apr 2016 13:14:50 -0700 (PDT) In-Reply-To: <20160418061958.GB31516@strugglingcoder.info> References: <201604162054.u3GKstrV027478@repo.freebsd.org> <20160417122012.Horde.-YvMZ5BJuIbDmwm13FS6r4f@webmail.leidinger.net> <20160418061958.GB31516@strugglingcoder.info> Date: Mon, 18 Apr 2016 17:14:50 -0300 Message-ID: Subject: Re: svn commit: r298131 - head/sys/conf From: Luiz Otavio O Souza To: hiren panchasara Cc: Alexander Leidinger , Luiz Otavio O Souza , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 20:14:52 -0000 On Mon, Apr 18, 2016 at 3:19 AM, hiren panchasara wrote: > On 04/17/16 at 12:20P, Alexander Leidinger wrote: >> >> Quoting Luiz Otavio O Souza (from Sat, 16 Apr 2016 >> 20:54:55 +0000 (UTC)): >> >> > Author: loos >> > Date: Sat Apr 16 20:54:55 2016 >> > New Revision: 298131 >> > URL: https://svnweb.freebsd.org/changeset/base/298131 >> > >> > Log: >> > Add Codel to NOTES. >> >> I haven't found much documentation about this. It looks like it is >> only available in PF, but not in dummynet. Is this correct? Are there >> somewhere examples for the use of codel (options/parameters/HOWTO)? I >> would expect in places where e.g. "red" could be used, but I don't >> find any mention of codel in e.g. the FreeBSD handbook. Yes, this code relies on pf and ALTQ, dummynet support isn't available (yet). Dummynet support is being worked by Rasool Al-Saadi (see 'Dummynet AQM v0.2- CoDel, FQ-CoDel, PIE and FQ-PIE for FreeBSD's ipfw/dummynet' in freebsd-ipfw@) I agree with the lack of documentation, but I couldn't fix the docs myself, the ALTQ section hasn't received any update since the pf import. Examples bellow. > > I'd also appreciate if more details on 1) how to use it 2) under what > scenarios/workloads would this be most beneficial. And more importantly > 3) how was this addition validated. As a parameterless[1] queue algorithm, the usage is very simple: altq on igb0 codelq queue This enables codel queueing on output packets for igb0. Codel can also work together with the other schedulers: altq on igb5 hfsc bandwidth 100Mb queue { q1 } queue q1 on igb5 hfsc ( codel, default ) Codel is expected to help with xDSL links where the link quality can vary with the time. Its use should not produce any negative effect. I'm not aware of any formal validation other than the tests done by pfSense developers (code was written by eri@ at the time) and the beneficial results reported by pfSense users over the years. Luiz [1]: http://www.bufferbloat.net/projects/codel/wiki From owner-svn-src-all@freebsd.org Mon Apr 18 20:16:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BD10B137AE; Mon, 18 Apr 2016 20:16:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D01311B9; Mon, 18 Apr 2016 20:16:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IKGgOH095797; Mon, 18 Apr 2016 20:16:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IKGgVc095792; Mon, 18 Apr 2016 20:16:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604182016.u3IKGgVc095792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 Apr 2016 20:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298223 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 20:16:43 -0000 Author: tuexen Date: Mon Apr 18 20:16:41 2016 New Revision: 298223 URL: https://svnweb.freebsd.org/changeset/base/298223 Log: Address issues found by the XCode code analyzer. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Apr 18 19:27:51 2016 (r298222) +++ head/sys/netinet/sctp_indata.c Mon Apr 18 20:16:41 2016 (r298223) @@ -413,7 +413,6 @@ sctp_place_control_in_stream(struct sctp static void sctp_abort_in_reasm(struct sctp_tcb *stcb, - struct sctp_stream_in *strm, struct sctp_queued_to_read *control, struct sctp_tmit_chunk *chk, int *abort_flag, int opspot) @@ -431,7 +430,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stc chk->rec.data.fsn_num, chk->rec.data.stream_seq); } else { snprintf(msg, sizeof(msg), - "Reass %x, CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x, SSN:%4.4x", + "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", opspot, control->fsn_included, chk->rec.data.TSN_seq, @@ -610,16 +609,13 @@ protocol_error: * to put it on the queue. */ if (sctp_place_control_in_stream(strm, asoc, control)) { - char msg[SCTP_DIAG_INFO_LEN]; - struct mbuf *oper; - snprintf(msg, sizeof(msg), "Queue to str msg_id: %u duplicate", control->msg_id); clean_up_control(stcb, control); - oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } } @@ -829,7 +825,7 @@ restart: TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); control->on_strm_q = 0; } - sctp_wakeup_the_read_socket(stcb->sctp_ep); + sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); if ((nc) && (nc->first_frag_seen)) { /* * Switch to the new guy and @@ -852,7 +848,7 @@ restart: SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); strm->pd_api_started = 1; control->pdapi_started = 1; - sctp_wakeup_the_read_socket(stcb->sctp_ep); + sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); return (0); } else { return (1); @@ -861,7 +857,6 @@ restart: static void sctp_inject_old_data_unordered(struct sctp_tcb *stcb, struct sctp_association *asoc, - struct sctp_stream_in *strm, struct sctp_queued_to_read *control, struct sctp_tmit_chunk *chk, int *abort_flag) @@ -908,7 +903,7 @@ sctp_inject_old_data_unordered(struct sc * only happen if we can get more TSN's * higher before the pd-api-point. */ - sctp_abort_in_reasm(stcb, strm, control, chk, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_4); @@ -971,7 +966,7 @@ place_chunk: chk->data = NULL; } sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); - sctp_abort_in_reasm(stcb, strm, control, chk, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_5); return; @@ -1010,7 +1005,6 @@ sctp_deliver_reasm_check(struct sctp_tcb if ((control) && (asoc->idata_supported == 0)) { /* Special handling needed for "old" data format */ - nctl = TAILQ_NEXT(control, next_instrm); if (sctp_handle_old_data(stcb, asoc, strm, control, pd_point)) { goto done_un; } @@ -1269,7 +1263,7 @@ sctp_queue_data_for_reasm(struct sctp_tc if (sctp_place_control_in_stream(strm, asoc, control)) { /* Duplicate SSN? */ clean_up_control(stcb, control); - sctp_abort_in_reasm(stcb, strm, control, chk, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_6); return; @@ -1281,7 +1275,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * and we have up to the cum-ack then its invalid. */ if ((chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) == 0) { - sctp_abort_in_reasm(stcb, strm, control, chk, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_7); return; @@ -1289,7 +1283,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } } if ((asoc->idata_supported == 0) && (unordered == 1)) { - sctp_inject_old_data_unordered(stcb, asoc, strm, control, chk, abort_flag); + sctp_inject_old_data_unordered(stcb, asoc, control, chk, abort_flag); return; } /* @@ -1311,7 +1305,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * un-ordered chunks that were fragmented at the * same time in the same stream. */ - sctp_abort_in_reasm(stcb, strm, control, chk, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_8); return; @@ -1353,7 +1347,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * We have already delivered up to * this so its a dup */ - sctp_abort_in_reasm(stcb, strm, control, chk, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_9); return; @@ -1365,7 +1359,7 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_XXX, "Duplicate last fsn: %u (top: %u) -- abort\n", chk->rec.data.fsn_num, control->top_fsn); - sctp_abort_in_reasm(stcb, strm, control, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_10); return; @@ -1386,7 +1380,7 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_XXX, "New fsn: %u is already seen in included_fsn: %u -- abort\n", chk->rec.data.fsn_num, control->fsn_included); - sctp_abort_in_reasm(stcb, strm, control, chk, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_11); return; @@ -1401,7 +1395,7 @@ sctp_queue_data_for_reasm(struct sctp_tc "New fsn: %u is beyond or at top_fsn: %u -- abort\n", chk->rec.data.fsn_num, control->top_fsn); - sctp_abort_in_reasm(stcb, strm, control, chk, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_12); return; @@ -1444,7 +1438,7 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_XXX, "Duplicate to fsn: %u -- abort\n", at->rec.data.fsn_num); - sctp_abort_in_reasm(stcb, strm, control, + sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_13); return; @@ -1502,7 +1496,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } if ((control->on_read_q) && (cnt_added > 0)) { /* Need to wakeup the reader */ - sctp_wakeup_the_read_socket(stcb->sctp_ep); + sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); } } @@ -1564,7 +1558,6 @@ sctp_process_a_data_chunk(struct sctp_tc if (chtype == SCTP_IDATA) { nch = (struct sctp_idata_chunk *)sctp_m_getptr(*m, offset, sizeof(struct sctp_idata_chunk), (uint8_t *) & chunk_buf); - ch = (struct sctp_data_chunk *)nch; clen = sizeof(struct sctp_idata_chunk); tsn = ntohl(ch->dp.tsn); @@ -1577,7 +1570,6 @@ sctp_process_a_data_chunk(struct sctp_tc } else { ch = (struct sctp_data_chunk *)sctp_m_getptr(*m, offset, sizeof(struct sctp_data_chunk), (uint8_t *) & chunk_buf); - tsn = ntohl(ch->dp.tsn); clen = sizeof(struct sctp_data_chunk); fsn = tsn; @@ -1590,15 +1582,12 @@ sctp_process_a_data_chunk(struct sctp_tc /* * Need to send an abort since we had a empty data chunk. */ - struct mbuf *op_err; - op_err = sctp_generate_no_user_data_cause(ch->dp.tsn); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_14; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } - ordered = ((chunk_flags & SCTP_DATA_UNORDERED) == 0); if ((chunk_flags & SCTP_DATA_SACK_IMMEDIATELY) == SCTP_DATA_SACK_IMMEDIATELY) { asoc->send_sack = 1; } Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon Apr 18 19:27:51 2016 (r298222) +++ head/sys/netinet/sctp_usrreq.c Mon Apr 18 20:16:41 2016 (r298223) @@ -242,7 +242,8 @@ sctp_notify(struct sctp_inpcb *inp, void sctp_ctlinput(int cmd, struct sockaddr *sa, void *vip) { - struct ip *outer_ip, *inner_ip; + struct ip *outer_ip; + struct ip *inner_ip; struct sctphdr *sh; struct icmp *icmp; struct sctp_inpcb *inp; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Apr 18 19:27:51 2016 (r298222) +++ head/sys/netinet/sctputil.c Mon Apr 18 20:16:41 2016 (r298223) @@ -4454,9 +4454,15 @@ sctp_pull_off_control_to_new_inp(struct } void -sctp_wakeup_the_read_socket(struct sctp_inpcb *inp) +sctp_wakeup_the_read_socket(struct sctp_inpcb *inp, + struct sctp_tcb *stcb, + int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { - if (inp && inp->sctp_socket) { + if ((inp != NULL) && (inp->sctp_socket != NULL)) { if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); } else { @@ -4584,7 +4590,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp if (inp_read_lock_held == 0) SCTP_INP_READ_UNLOCK(inp); if (inp && inp->sctp_socket) { - sctp_wakeup_the_read_socket(inp); + sctp_wakeup_the_read_socket(inp, stcb, so_locked); } } Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Mon Apr 18 19:27:51 2016 (r298222) +++ head/sys/netinet/sctputil.h Mon Apr 18 20:16:41 2016 (r298223) @@ -108,7 +108,12 @@ void sctp_mtu_size_reset(struct sctp_inpcb *, struct sctp_association *, uint32_t); void - sctp_wakeup_the_read_socket(struct sctp_inpcb *inp); +sctp_wakeup_the_read_socket(struct sctp_inpcb *inp, struct sctp_tcb *stcb, + int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +); void sctp_add_to_readq(struct sctp_inpcb *inp, Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Mon Apr 18 19:27:51 2016 (r298222) +++ head/sys/netinet6/sctp6_usrreq.c Mon Apr 18 20:16:41 2016 (r298223) @@ -244,7 +244,6 @@ sctp6_notify(struct sctp_inpcb *inp, } else { timer_stopped = 0; } - break; /* Update the path MTU. */ if (net->mtu > next_mtu) { net->mtu = next_mtu; @@ -310,7 +309,7 @@ sctp6_ctlinput(int cmd, struct sockaddr * verification tag of the SCTP common header. */ if (ip6cp->ip6c_m->m_pkthdr.len < - ip6cp->ip6c_off + offsetof(struct sctphdr, checksum)) { + (int32_t) (ip6cp->ip6c_off + offsetof(struct sctphdr, checksum))) { return; } /* Copy out the port numbers and the verification tag. */ From owner-svn-src-all@freebsd.org Mon Apr 18 20:33:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2DFEB13E91; Mon, 18 Apr 2016 20:33:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C9FF1D7C; Mon, 18 Apr 2016 20:33:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IKXiXm001775; Mon, 18 Apr 2016 20:33:44 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IKXiNk001771; Mon, 18 Apr 2016 20:33:44 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201604182033.u3IKXiNk001771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 18 Apr 2016 20:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298224 - in head/sys/dev: e1000 ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 20:33:45 -0000 Author: sbruno Date: Mon Apr 18 20:33:44 2016 New Revision: 298224 URL: https://svnweb.freebsd.org/changeset/base/298224 Log: Correct possible underflow conditions when checking for available space in the tx h/w ring buffer. Reviewed by: gnn jeb.j.cramer@intel.com MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D5918 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ixgbe/ix_txrx.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Apr 18 20:16:41 2016 (r298223) +++ head/sys/dev/e1000/if_em.c Mon Apr 18 20:33:44 2016 (r298224) @@ -2092,7 +2092,7 @@ retry: txr->tx_tso = FALSE; } - if (nsegs > (txr->tx_avail - EM_MAX_SCATTER)) { + if (txr->tx_avail < (nsegs + EM_MAX_SCATTER)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Apr 18 20:16:41 2016 (r298223) +++ head/sys/dev/e1000/if_igb.c Mon Apr 18 20:33:44 2016 (r298224) @@ -1887,7 +1887,7 @@ retry: } /* Make certain there are enough descriptors */ - if (nsegs > txr->tx_avail - 2) { + if (txr->tx_avail < (nsegs + 2)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Mon Apr 18 20:16:41 2016 (r298223) +++ head/sys/dev/e1000/if_lem.c Mon Apr 18 20:33:44 2016 (r298224) @@ -1699,7 +1699,7 @@ lem_xmit(struct adapter *adapter, struct return (error); } - if (nsegs > (adapter->num_tx_desc_avail - 2)) { + if (adapter->num_tx_desc_avail < (nsegs + 2)) { adapter->no_tx_desc_avail2++; bus_dmamap_unload(adapter->txtag, map); return (ENOBUFS); Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Mon Apr 18 20:16:41 2016 (r298223) +++ head/sys/dev/ixgbe/ix_txrx.c Mon Apr 18 20:33:44 2016 (r298224) @@ -402,7 +402,7 @@ retry: } /* Make certain there are enough descriptors */ - if (nsegs > txr->tx_avail - 2) { + if (txr->tx_avail < (nsegs + 2)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); From owner-svn-src-all@freebsd.org Mon Apr 18 20:56:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD4FB13645; Mon, 18 Apr 2016 20:56:22 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52BBC1A1F; Mon, 18 Apr 2016 20:56:22 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IKuLoA007927; Mon, 18 Apr 2016 20:56:21 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IKuL4P007924; Mon, 18 Apr 2016 20:56:21 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201604182056.u3IKuL4P007924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 18 Apr 2016 20:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298225 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 20:56:22 -0000 Author: sjg Date: Mon Apr 18 20:56:21 2016 New Revision: 298225 URL: https://svnweb.freebsd.org/changeset/base/298225 Log: Update dirdeps.mk et al dirdeps.mk: move logic to handle -f dirdeps.mk to inside check for first read of dirdeps.mk Also fix handling of WITHOUT_DIRDEPS_BELOW gendirdeps.mk: pass M2D_EXCLUDES to meta2deps meta.autodep.mk: if we build with nofilemon, leave a cookie to prevent updating dependencies until cleaned. Reviewed by: bdrewery Modified: head/share/mk/dirdeps.mk head/share/mk/gendirdeps.mk head/share/mk/meta.autodep.mk Modified: head/share/mk/dirdeps.mk ============================================================================== --- head/share/mk/dirdeps.mk Mon Apr 18 20:33:44 2016 (r298224) +++ head/share/mk/dirdeps.mk Mon Apr 18 20:56:21 2016 (r298225) @@ -122,6 +122,23 @@ _DIRDEP_USE_LEVEL?= 0 # and non-specific Makefile.depend* .if !target(_DIRDEP_USE) + +.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" +# This little trick let's us do +# +# mk -f dirdeps.mk some/dir.${TARGET_SPEC} +# +all: +${.TARGETS:Nall}: all +DIRDEPS := ${.TARGETS:M*[/.]*} +# so that -DNO_DIRDEPS works +DEP_RELDIR := ${DIRDEPS:[1]:R} +# this will become DEP_MACHINE below +TARGET_MACHINE := ${DIRDEPS:[1]:E:C/,.*//} +# disable DIRDEPS_CACHE as it does not like this trick +MK_DIRDEPS_CACHE = no +.endif + # make sure we get the behavior we expect .MAKE.SAVE_DOLLARS = no @@ -245,20 +262,6 @@ DEP_${TARGET_SPEC_VARS:[$i]} := ${_tspec DEP_MACHINE := ${_DEP_TARGET_SPEC} .endif -.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" -# This little trick let's us do -# -# mk -f dirdeps.mk some/dir.${TARGET_SPEC} -# -all: -${.TARGETS:Nall}: all -DIRDEPS := ${.TARGETS:M*/*} -# so that -DNO_DIRDEPS works -DEP_RELDIR := ${DIRDEPS:R:[1]} -# disable DIRDEPS_CACHE as it does not like this trick -MK_DIRDEPS_CACHE = no -.endif - # reset each time through _build_all_dirs = @@ -285,7 +288,7 @@ _DEP_RELDIR := ${DEP_RELDIR} # pickup customizations # as below you can use !target(_DIRDEP_USE) to protect things # which should only be done once. -.-include "local.dirdeps.mk" +.-include .if !target(_DIRDEP_USE) # things we skip for host tools @@ -305,7 +308,13 @@ DEP_SKIP_DIR = ${SKIP_DIR} \ NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} -.if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +.if defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +NO_DIRDEPS = +.elif defined(WITHOUT_DIRDEPS_BELOW) +NO_DIRDEPS_BELOW = +.endif + +.if defined(NO_DIRDEPS) # confine ourselves to the original dir and below. DIRDEPS_FILTER += M${_DEP_RELDIR}* .elif defined(NO_DIRDEPS_BELOW) @@ -371,7 +380,7 @@ MK_DIRDEPS_CACHE ?= no BUILD_DIRDEPS_CACHE ?= no BUILD_DIRDEPS ?= yes -.if !defined(NO_DIRDEPS) +.if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW) .if ${MK_DIRDEPS_CACHE} == "yes" # this is where we will cache all our work DIRDEPS_CACHE?= ${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.} @@ -453,7 +462,7 @@ _this_dir := ${SRCTOP}/${DEP_RELDIR} # on rare occasions, there can be a need for extra help _dep_hack := ${_this_dir}/${.MAKE.DEPENDFILE_PREFIX}.inc -.-include "${_dep_hack}" +.-include <${_dep_hack}> .if ${DEP_RELDIR} != ${_DEP_RELDIR} || ${DEP_TARGET_SPEC} != ${TARGET_SPEC} # this should be all Modified: head/share/mk/gendirdeps.mk ============================================================================== --- head/share/mk/gendirdeps.mk Mon Apr 18 20:33:44 2016 (r298224) +++ head/share/mk/gendirdeps.mk Mon Apr 18 20:56:21 2016 (r298225) @@ -83,7 +83,7 @@ META_FILES := ${META_FILES:T:O:u} .export META_FILES # pickup customizations -.-include "local.gendirdeps.mk" +.-include # these are actually prefixes that we'll skip # they should all be absolute paths @@ -139,7 +139,8 @@ META2DEPS_CMD += -T ${TARGET_OBJ_SPEC} .endif META2DEPS_CMD += \ -R ${RELDIR} -H ${HOST_TARGET} \ - ${M2D_OBJROOTS:O:u:@o@-O $o@} + ${M2D_OBJROOTS:O:u:@o@-O $o@} \ + ${M2D_EXCLUDES:O:u:@o@-X $o@} \ M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${_objroot} @@ -256,6 +257,7 @@ DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER .if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" .info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS} +.info ${RELDIR}: M2D_EXCLUDES=${M2D_EXCLUDES} .info ${RELDIR}: dir_list='${dir_list}' .info ${RELDIR}: dpadd_dir_list='${dpadd_dir_list}' .info ${RELDIR}: dirdep_list='${dirdep_list}' Modified: head/share/mk/meta.autodep.mk ============================================================================== --- head/share/mk/meta.autodep.mk Mon Apr 18 20:33:44 2016 (r298224) +++ head/share/mk/meta.autodep.mk Mon Apr 18 20:56:21 2016 (r298225) @@ -19,7 +19,7 @@ _this ?= ${.PARSEFILE} .if !target(__${_this}__) __${_this}__: .NOTMAIN -.-include "local.autodep.mk" +.-include .if defined(SRCS) # it would be nice to be able to query .SUFFIXES @@ -56,6 +56,21 @@ _OBJTOP ?= ${OBJTOP} _OBJROOT ?= ${OBJROOT:U${_OBJTOP}} _DEPENDFILE := ${_CURDIR}/${.MAKE.DEPENDFILE:T} +.if ${.MAKE.LEVEL} > 0 || ${BUILD_AT_LEVEL0:Uyes:tl} == "yes" +# do not allow auto update if we ever built this dir without filemon +NO_FILEMON_COOKIE = .nofilemon +CLEANFILES += ${NO_FILEMON_COOKIE} +.if ${.MAKE.MODE:Uno:Mnofilemon} != "" +UPDATE_DEPENDFILE = NO +all: ${NO_FILEMON_COOKIE} +${NO_FILEMON_COOKIE}: .NOMETA + @echo UPDATE_DEPENDFILE=NO > ${.TARGET} +.elif exists(${NO_FILEMON_COOKIE}) +UPDATE_DEPENDFILE = NO +.warning ${RELDIR} built with nofilemon; UPDATE_DEPENDFILE=NO +.endif +.endif + .if ${.MAKE.LEVEL} == 0 .if ${BUILD_AT_LEVEL0:Uyes:tl} == "no" UPDATE_DEPENDFILE = NO From owner-svn-src-all@freebsd.org Mon Apr 18 21:05:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC0C5B13A00; Mon, 18 Apr 2016 21:05:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 700001028; Mon, 18 Apr 2016 21:05:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IL5JID010927; Mon, 18 Apr 2016 21:05:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IL5FG9010855; Mon, 18 Apr 2016 21:05:15 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604182105.u3IL5FG9010855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 18 Apr 2016 21:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298226 - in head/lib/libc: db/btree gen inet isc net resolv rpc secure stdlib xdr yp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 21:05:20 -0000 Author: avos Date: Mon Apr 18 21:05:15 2016 New Revision: 298226 URL: https://svnweb.freebsd.org/changeset/base/298226 Log: libc: do not include where was already included According to style(9): > normally, include OR , but not both. ( already includes when LOCORE is not defined). Modified: head/lib/libc/db/btree/bt_split.c head/lib/libc/gen/arc4random.c head/lib/libc/gen/devname.c head/lib/libc/gen/exec.c head/lib/libc/gen/getnetgrent.c head/lib/libc/gen/setproctitle.c head/lib/libc/inet/inet_addr.c head/lib/libc/inet/inet_ntop.c head/lib/libc/inet/inet_pton.c head/lib/libc/inet/nsap_addr.c head/lib/libc/isc/eventlib_p.h head/lib/libc/net/base64.c head/lib/libc/net/ether_addr.c head/lib/libc/net/eui64.c head/lib/libc/net/getaddrinfo.c head/lib/libc/net/gethostbydns.c head/lib/libc/net/getprotoent.c head/lib/libc/net/getservent.c head/lib/libc/net/hesiod.c head/lib/libc/net/ip6opt.c head/lib/libc/net/map_v4v6.c head/lib/libc/net/rthdr.c head/lib/libc/net/sourcefilter.c head/lib/libc/resolv/herror.c head/lib/libc/resolv/res_comp.c head/lib/libc/resolv/res_data.c head/lib/libc/resolv/res_debug.c head/lib/libc/resolv/res_init.c head/lib/libc/resolv/res_mkquery.c head/lib/libc/resolv/res_mkupdate.c head/lib/libc/resolv/res_query.c head/lib/libc/resolv/res_send.c head/lib/libc/rpc/getrpcent.c head/lib/libc/rpc/rpc_generic.c head/lib/libc/rpc/svc_vc.c head/lib/libc/secure/stack_protector.c head/lib/libc/stdlib/rand.c head/lib/libc/xdr/xdr_float.c head/lib/libc/yp/yplib.c Modified: head/lib/libc/db/btree/bt_split.c ============================================================================== --- head/lib/libc/db/btree/bt_split.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/db/btree/bt_split.c Mon Apr 18 21:05:15 2016 (r298226) @@ -36,7 +36,6 @@ static char sccsid[] = "@(#)bt_split.c 8 #include __FBSDID("$FreeBSD$"); -#include #include #include Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/gen/arc4random.c Mon Apr 18 21:05:15 2016 (r298226) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/lib/libc/gen/devname.c ============================================================================== --- head/lib/libc/gen/devname.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/gen/devname.c Mon Apr 18 21:05:15 2016 (r298226) @@ -33,14 +33,13 @@ static char sccsid[] = "@(#)devname.c 8. #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include #include #include -#include #include char * Modified: head/lib/libc/gen/exec.c ============================================================================== --- head/lib/libc/gen/exec.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/gen/exec.c Mon Apr 18 21:05:15 2016 (r298226) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include -#include #include #include #include Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/gen/getnetgrent.c Mon Apr 18 21:05:15 2016 (r298226) @@ -85,9 +85,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include +#include #include static char *_netgr_yp_domain; int _use_only_yp; Modified: head/lib/libc/gen/setproctitle.c ============================================================================== --- head/lib/libc/gen/setproctitle.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/gen/setproctitle.c Mon Apr 18 21:05:15 2016 (r298226) @@ -19,7 +19,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include #include #include #include Modified: head/lib/libc/inet/inet_addr.c ============================================================================== --- head/lib/libc/inet/inet_addr.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/inet/inet_addr.c Mon Apr 18 21:05:15 2016 (r298226) @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$"); #include "port_before.h" -#include #include #include Modified: head/lib/libc/inet/inet_ntop.c ============================================================================== --- head/lib/libc/inet/inet_ntop.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/inet/inet_ntop.c Mon Apr 18 21:05:15 2016 (r298226) @@ -24,7 +24,6 @@ __FBSDID("$FreeBSD$"); #include "port_before.h" #include -#include #include #include Modified: head/lib/libc/inet/inet_pton.c ============================================================================== --- head/lib/libc/inet/inet_pton.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/inet/inet_pton.c Mon Apr 18 21:05:15 2016 (r298226) @@ -23,7 +23,6 @@ __FBSDID("$FreeBSD$"); #include "port_before.h" #include -#include #include #include #include Modified: head/lib/libc/inet/nsap_addr.c ============================================================================== --- head/lib/libc/inet/nsap_addr.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/inet/nsap_addr.c Mon Apr 18 21:05:15 2016 (r298226) @@ -23,7 +23,6 @@ __FBSDID("$FreeBSD$"); #include "port_before.h" -#include #include #include Modified: head/lib/libc/isc/eventlib_p.h ============================================================================== --- head/lib/libc/isc/eventlib_p.h Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/isc/eventlib_p.h Mon Apr 18 21:05:15 2016 (r298226) @@ -27,7 +27,6 @@ #define _EVENTLIB_P_H #include -#include #include #include #include Modified: head/lib/libc/net/base64.c ============================================================================== --- head/lib/libc/net/base64.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/base64.c Mon Apr 18 21:05:15 2016 (r298226) @@ -43,7 +43,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include Modified: head/lib/libc/net/ether_addr.c ============================================================================== --- head/lib/libc/net/ether_addr.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/ether_addr.c Mon Apr 18 21:05:15 2016 (r298226) @@ -40,7 +40,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include Modified: head/lib/libc/net/eui64.c ============================================================================== --- head/lib/libc/net/eui64.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/eui64.c Mon Apr 18 21:05:15 2016 (r298226) @@ -72,11 +72,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include -#include #ifdef YP #include #include Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/getaddrinfo.c Mon Apr 18 21:05:15 2016 (r298226) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include #include #include #include Modified: head/lib/libc/net/gethostbydns.c ============================================================================== --- head/lib/libc/net/gethostbydns.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/gethostbydns.c Mon Apr 18 21:05:15 2016 (r298226) @@ -56,7 +56,6 @@ static char fromrcsid[] = "From: Id: get #include __FBSDID("$FreeBSD$"); -#include #include #include #include Modified: head/lib/libc/net/getprotoent.c ============================================================================== --- head/lib/libc/net/getprotoent.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/getprotoent.c Mon Apr 18 21:05:15 2016 (r298226) @@ -34,7 +34,6 @@ static char sccsid[] = "@(#)getprotoent. __FBSDID("$FreeBSD$"); #include -#include #include #include #include Modified: head/lib/libc/net/getservent.c ============================================================================== --- head/lib/libc/net/getservent.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/getservent.c Mon Apr 18 21:05:15 2016 (r298226) @@ -34,7 +34,6 @@ static char sccsid[] = "@(#)getservent.c __FBSDID("$FreeBSD$"); #include -#include #include #include #include Modified: head/lib/libc/net/hesiod.c ============================================================================== --- head/lib/libc/net/hesiod.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/hesiod.c Mon Apr 18 21:05:15 2016 (r298226) @@ -51,7 +51,6 @@ static char *orig_rcsid = "$NetBSD: hesi #include __FBSDID("$FreeBSD$"); -#include #include #include #include Modified: head/lib/libc/net/ip6opt.c ============================================================================== --- head/lib/libc/net/ip6opt.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/ip6opt.c Mon Apr 18 21:05:15 2016 (r298226) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: head/lib/libc/net/map_v4v6.c ============================================================================== --- head/lib/libc/net/map_v4v6.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/map_v4v6.c Mon Apr 18 21:05:15 2016 (r298226) @@ -55,7 +55,6 @@ static char sccsid[] = "@(#)gethostnamad #include __FBSDID("$FreeBSD$"); -#include #include #include #include Modified: head/lib/libc/net/rthdr.c ============================================================================== --- head/lib/libc/net/rthdr.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/rthdr.c Mon Apr 18 21:05:15 2016 (r298226) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: head/lib/libc/net/sourcefilter.c ============================================================================== --- head/lib/libc/net/sourcefilter.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/net/sourcefilter.c Mon Apr 18 21:05:15 2016 (r298226) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include #include #include #include Modified: head/lib/libc/resolv/herror.c ============================================================================== --- head/lib/libc/resolv/herror.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/resolv/herror.c Mon Apr 18 21:05:15 2016 (r298226) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include "port_before.h" #include "namespace.h" -#include #include #include Modified: head/lib/libc/resolv/res_comp.c ============================================================================== --- head/lib/libc/resolv/res_comp.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/resolv/res_comp.c Mon Apr 18 21:05:15 2016 (r298226) @@ -72,7 +72,6 @@ static const char rcsid[] = "$Id: res_co __FBSDID("$FreeBSD$"); #include "port_before.h" -#include #include #include #include Modified: head/lib/libc/resolv/res_data.c ============================================================================== --- head/lib/libc/resolv/res_data.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/resolv/res_data.c Mon Apr 18 21:05:15 2016 (r298226) @@ -23,7 +23,6 @@ __FBSDID("$FreeBSD$"); #include "port_before.h" -#include #include #include #include Modified: head/lib/libc/resolv/res_debug.c ============================================================================== --- head/lib/libc/resolv/res_debug.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/resolv/res_debug.c Mon Apr 18 21:05:15 2016 (r298226) @@ -98,7 +98,6 @@ __FBSDID("$FreeBSD$"); #include "port_before.h" -#include #include #include Modified: head/lib/libc/resolv/res_init.c ============================================================================== --- head/lib/libc/resolv/res_init.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/resolv/res_init.c Mon Apr 18 21:05:15 2016 (r298226) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include #include #include #include Modified: head/lib/libc/resolv/res_mkquery.c ============================================================================== --- head/lib/libc/resolv/res_mkquery.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/resolv/res_mkquery.c Mon Apr 18 21:05:15 2016 (r298226) @@ -72,7 +72,6 @@ static const char rcsid[] = "$Id: res_mk __FBSDID("$FreeBSD$"); #include "port_before.h" -#include #include #include #include Modified: head/lib/libc/resolv/res_mkupdate.c ============================================================================== --- head/lib/libc/resolv/res_mkupdate.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/resolv/res_mkupdate.c Mon Apr 18 21:05:15 2016 (r298226) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "port_before.h" -#include #include #include Modified: head/lib/libc/resolv/res_query.c ============================================================================== --- head/lib/libc/resolv/res_query.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/resolv/res_query.c Mon Apr 18 21:05:15 2016 (r298226) @@ -72,7 +72,6 @@ static const char rcsid[] = "$Id: res_qu __FBSDID("$FreeBSD$"); #include "port_before.h" -#include #include #include #include Modified: head/lib/libc/resolv/res_send.c ============================================================================== --- head/lib/libc/resolv/res_send.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/resolv/res_send.c Mon Apr 18 21:05:15 2016 (r298226) @@ -82,7 +82,6 @@ __FBSDID("$FreeBSD$"); #endif #include "namespace.h" -#include #include #include #include Modified: head/lib/libc/rpc/getrpcent.c ============================================================================== --- head/lib/libc/rpc/getrpcent.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/rpc/getrpcent.c Mon Apr 18 21:05:15 2016 (r298226) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include #include #include Modified: head/lib/libc/rpc/rpc_generic.c ============================================================================== --- head/lib/libc/rpc/rpc_generic.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/rpc/rpc_generic.c Mon Apr 18 21:05:15 2016 (r298226) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include "reentrant.h" -#include #include #include #include Modified: head/lib/libc/rpc/svc_vc.c ============================================================================== --- head/lib/libc/rpc/svc_vc.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/rpc/svc_vc.c Mon Apr 18 21:05:15 2016 (r298226) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include "reentrant.h" -#include #include #include #include Modified: head/lib/libc/secure/stack_protector.c ============================================================================== --- head/lib/libc/secure/stack_protector.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/secure/stack_protector.c Mon Apr 18 21:05:15 2016 (r298226) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/stdlib/rand.c Mon Apr 18 21:05:15 2016 (r298226) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include -#include #include #include "un-namespace.h" Modified: head/lib/libc/xdr/xdr_float.c ============================================================================== --- head/lib/libc/xdr/xdr_float.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/xdr/xdr_float.c Mon Apr 18 21:05:15 2016 (r298226) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); */ #include "namespace.h" -#include #include #include Modified: head/lib/libc/yp/yplib.c ============================================================================== --- head/lib/libc/yp/yplib.c Mon Apr 18 20:56:21 2016 (r298225) +++ head/lib/libc/yp/yplib.c Mon Apr 18 21:05:15 2016 (r298226) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include "reentrant.h" #include -#include #include #include #include From owner-svn-src-all@freebsd.org Mon Apr 18 21:05:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E10D8B13A03; Mon, 18 Apr 2016 21:05:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE6221029; Mon, 18 Apr 2016 21:05:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IL5J01010939; Mon, 18 Apr 2016 21:05:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IL5J8L010938; Mon, 18 Apr 2016 21:05:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604182105.u3IL5J8L010938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 18 Apr 2016 21:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298227 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 21:05:21 -0000 Author: bdrewery Date: Mon Apr 18 21:05:19 2016 New Revision: 298227 URL: https://svnweb.freebsd.org/changeset/base/298227 Log: Update meta2deps to fix crash when using -X with M2D_EXCLUDES. Modified: head/share/mk/meta2deps.py Modified: head/share/mk/meta2deps.py ============================================================================== --- head/share/mk/meta2deps.py Mon Apr 18 21:05:15 2016 (r298226) +++ head/share/mk/meta2deps.py Mon Apr 18 21:05:19 2016 (r298227) @@ -38,7 +38,7 @@ We only pay attention to a subset of the """ RCSid: - $Id: meta2deps.py,v 1.18 2015/04/03 18:23:25 sjg Exp $ + $Id: meta2deps.py,v 1.19 2016/04/02 20:45:40 sjg Exp $ Copyright (c) 2011-2013, Juniper Networks, Inc. All rights reserved. @@ -483,7 +483,7 @@ class MetaFile: for p in self.excludes: if p and path.startswith(p): if self.debug > 2: - print >> self.debug_out, "exclude:", p, path + print("exclude:", p, path, file=self.debug_out) return # we don't want to resolve the last component if it is # a symlink From owner-svn-src-all@freebsd.org Mon Apr 18 21:11:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0717EB13CA4; Mon, 18 Apr 2016 21:11:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C67B717E6; Mon, 18 Apr 2016 21:11:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3ILBuLU013555; Mon, 18 Apr 2016 21:11:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3ILBuqM013554; Mon, 18 Apr 2016 21:11:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604182111.u3ILBuqM013554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 18 Apr 2016 21:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298228 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 21:11:57 -0000 Author: bdrewery Date: Mon Apr 18 21:11:55 2016 New Revision: 298228 URL: https://svnweb.freebsd.org/changeset/base/298228 Log: META_MODE: Don't hide the .depend rm -f command. Otherwise the build command changes every build. META_MODE will only remove it if something changes to warrant rebuilding the file. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Apr 18 21:05:19 2016 (r298227) +++ head/share/mk/bsd.dep.mk Mon Apr 18 21:11:55 2016 (r298228) @@ -238,7 +238,7 @@ DPSRCS+= ${SRCS} # beforedepend/_EXTRADEPEND/afterdepend. The target is kept # to allow 'make depend' to generate files. ${DEPENDFILE}: ${DPSRCS} -.if exists(${.OBJDIR}/${DEPENDFILE}) +.if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE}) rm -f ${DEPENDFILE} .endif .if target(_EXTRADEPEND) From owner-svn-src-all@freebsd.org Mon Apr 18 22:00:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEC41B1307E; Mon, 18 Apr 2016 22:00:27 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCC0D1948; Mon, 18 Apr 2016 22:00:27 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IM0QFb026988; Mon, 18 Apr 2016 22:00:26 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IM0Q2o026987; Mon, 18 Apr 2016 22:00:26 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201604182200.u3IM0Q2o026987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 18 Apr 2016 22:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298229 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 22:00:28 -0000 Author: sjg Date: Mon Apr 18 22:00:26 2016 New Revision: 298229 URL: https://svnweb.freebsd.org/changeset/base/298229 Log: Allow -f dirdeps.mk some/dir with no TARGET_MACHINE spec Use $MACHINE if target does not specify. Reviewed by: bdrewery Modified: head/share/mk/dirdeps.mk Modified: head/share/mk/dirdeps.mk ============================================================================== --- head/share/mk/dirdeps.mk Mon Apr 18 21:11:55 2016 (r298228) +++ head/share/mk/dirdeps.mk Mon Apr 18 22:00:26 2016 (r298229) @@ -135,6 +135,9 @@ DIRDEPS := ${.TARGETS:M*[/.]*} DEP_RELDIR := ${DIRDEPS:[1]:R} # this will become DEP_MACHINE below TARGET_MACHINE := ${DIRDEPS:[1]:E:C/,.*//} +.if ${TARGET_MACHINE:N*/*} == "" +TARGET_MACHINE := ${MACHINE} +.endif # disable DIRDEPS_CACHE as it does not like this trick MK_DIRDEPS_CACHE = no .endif From owner-svn-src-all@freebsd.org Mon Apr 18 23:09:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 659F5B1282C; Mon, 18 Apr 2016 23:09:24 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CF391AC1; Mon, 18 Apr 2016 23:09:24 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3IN9NKU047490; Mon, 18 Apr 2016 23:09:23 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IN9MC6047480; Mon, 18 Apr 2016 23:09:22 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201604182309.u3IN9MC6047480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 18 Apr 2016 23:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 23:09:24 -0000 Author: allanjude Date: Mon Apr 18 23:09:22 2016 New Revision: 298230 URL: https://svnweb.freebsd.org/changeset/base/298230 Log: A new implementation of the loader block cache The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy. Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks. Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device. The cache also implements limited read-ahead to increase performance. To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache. Booting from a virtual CD over IPMI: 0ms latency, before: 27 second, after: 7 seconds 60ms latency, before: over 12 minutes, after: under 5 minutes. Submitted by: Toomas Soome Reviewed by: delphij (previous version), emaste (previous version) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4713 Modified: head/lib/libstand/cd9660.c head/lib/libstand/dosfs.c head/lib/libstand/dosfs.h head/lib/libstand/ext2fs.c head/lib/libstand/read.c head/lib/libstand/stand.h head/lib/libstand/ufs.c head/lib/libstand/write.c head/sys/boot/common/bcache.c head/sys/boot/common/bootstrap.h head/sys/boot/common/disk.c head/sys/boot/common/md.c head/sys/boot/common/module.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/efi/libefi/libefi.c head/sys/boot/efi/loader/main.c head/sys/boot/i386/libfirewire/firewire.c head/sys/boot/i386/libi386/bioscd.c head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/i386/libi386/biosmem.c head/sys/boot/i386/libi386/pxe.c head/sys/boot/i386/loader/main.c head/sys/boot/mips/beri/loader/beri_disk_cfi.c head/sys/boot/mips/beri/loader/beri_disk_sdcard.c head/sys/boot/ofw/libofw/ofw_disk.c head/sys/boot/pc98/libpc98/bioscd.c head/sys/boot/pc98/libpc98/biosdisk.c head/sys/boot/pc98/libpc98/biosmem.c head/sys/boot/pc98/loader/main.c head/sys/boot/powerpc/kboot/hostdisk.c head/sys/boot/powerpc/ps3/ps3cdrom.c head/sys/boot/powerpc/ps3/ps3disk.c head/sys/boot/uboot/lib/disk.c head/sys/boot/usb/storage/umass_loader.c head/sys/boot/userboot/userboot/host.c head/sys/boot/userboot/userboot/main.c head/sys/boot/userboot/userboot/userboot_disk.c head/sys/boot/zfs/zfs.c Modified: head/lib/libstand/cd9660.c ============================================================================== --- head/lib/libstand/cd9660.c Mon Apr 18 22:00:26 2016 (r298229) +++ head/lib/libstand/cd9660.c Mon Apr 18 23:09:22 2016 (r298230) @@ -143,7 +143,7 @@ susp_lookup_record(struct open_file *f, if (bcmp(sh->type, SUSP_CONTINUATION, 2) == 0) { shc = (ISO_RRIP_CONT *)sh; error = f->f_dev->dv_strategy(f->f_devdata, F_READ, - cdb2devb(isonum_733(shc->location)), + cdb2devb(isonum_733(shc->location)), 0, ISO_DEFAULT_BLOCK_SIZE, susp_buffer, &read); /* Bail if it fails. */ @@ -288,7 +288,7 @@ cd9660_open(const char *path, struct ope for (bno = 16;; bno++) { twiddle(1); rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno), - ISO_DEFAULT_BLOCK_SIZE, buf, &read); + 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read); if (rc) goto out; if (read != ISO_DEFAULT_BLOCK_SIZE) { @@ -322,7 +322,7 @@ cd9660_open(const char *path, struct ope twiddle(1); rc = f->f_dev->dv_strategy (f->f_devdata, F_READ, - cdb2devb(bno + boff), + cdb2devb(bno + boff), 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read); if (rc) @@ -381,7 +381,7 @@ cd9660_open(const char *path, struct ope bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); twiddle(1); rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno), - ISO_DEFAULT_BLOCK_SIZE, buf, &read); + 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read); if (rc) goto out; if (read != ISO_DEFAULT_BLOCK_SIZE) { @@ -438,7 +438,8 @@ buf_read_file(struct open_file *f, char twiddle(16); rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, - cdb2devb(blkno), ISO_DEFAULT_BLOCK_SIZE, fp->f_buf, &read); + cdb2devb(blkno), 0, ISO_DEFAULT_BLOCK_SIZE, + fp->f_buf, &read); if (rc) return (rc); if (read != ISO_DEFAULT_BLOCK_SIZE) Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Mon Apr 18 22:00:26 2016 (r298229) +++ head/lib/libstand/dosfs.c Mon Apr 18 23:09:22 2016 (r298230) @@ -131,7 +131,18 @@ static DOS_DE dot[2] = { #define stclus(sz, de) ((sz) != 32 ? cv2((de)->clus) : \ ((u_int)cv2((de)->dex.h_clus) << 16) | \ cv2((de)->clus)) - + +/* + * fat cache metadata + */ +struct fatcache { + int unit; /* disk unit number */ + int size; /* buffer (and fat) size in sectors */ + u_char *buf; +}; + +static struct fatcache fat; + static int dosunmount(DOS_FS *); static int parsebs(DOS_FS *, DOS_BS *); static int namede(DOS_FS *, const char *, DOS_DE **); @@ -143,8 +154,36 @@ static int fatcnt(DOS_FS *, u_int); static int fatget(DOS_FS *, u_int *); static int fatend(u_int, u_int); static int ioread(DOS_FS *, u_int, void *, u_int); -static int iobuf(DOS_FS *, u_int); -static int ioget(struct open_file *, u_int, void *, u_int); +static int ioget(struct open_file *, daddr_t, size_t, void *, u_int); + +static void +dos_read_fat(DOS_FS *fs, struct open_file *fd) +{ + struct devdesc *dd = fd->f_devdata; + + if (fat.buf != NULL) { /* can we reuse old buffer? */ + if (fat.size != fs->spf) { + free(fat.buf); /* no, free old buffer */ + fat.buf = NULL; + } + } + + if (fat.buf == NULL) + fat.buf = malloc(secbyt(fs->spf)); + + if (fat.buf != NULL) { + if (ioget(fd, fs->lsnfat, 0, fat.buf, secbyt(fs->spf)) == 0) { + fat.size = fs->spf; + fat.unit = dd->d_unit; + return; + } + } + if (fat.buf != NULL) /* got IO error */ + free(fat.buf); + fat.buf = NULL; + fat.unit = -1; /* impossible unit */ + fat.size = 0; +} /* * Mount DOS filesystem @@ -153,15 +192,25 @@ static int dos_mount(DOS_FS *fs, struct open_file *fd) { int err; + struct devdesc *dd = fd->f_devdata; + u_char *buf; bzero(fs, sizeof(DOS_FS)); fs->fd = fd; - if ((err = !(fs->buf = malloc(SECSIZ)) ? errno : 0) || - (err = ioget(fs->fd, 0, fs->buf, 1)) || - (err = parsebs(fs, (DOS_BS *)fs->buf))) { + + if ((err = !(buf = malloc(secbyt(1))) ? errno : 0) || + (err = ioget(fs->fd, 0, 0, buf, secbyt(1))) || + (err = parsebs(fs, (DOS_BS *)buf))) { + if (buf != NULL) + free(buf); (void)dosunmount(fs); return(err); } + free(buf); + + if (fat.buf == NULL || fat.unit != dd->d_unit) + dos_read_fat(fs, fd); + fs->root = dot[0]; fs->root.name[0] = ' '; if (fs->fatsz == 32) { @@ -194,8 +243,6 @@ dos_unmount(DOS_FS *fs) static int dosunmount(DOS_FS *fs) { - if (fs->buf) - free(fs->buf); free(fs); return(0); } @@ -252,42 +299,47 @@ dos_read(struct open_file *fd, void *buf DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; int err = 0; + /* + * as ioget() can be called *a lot*, use twiddle here. + * also 4 seems to be good value not to slow loading down too much: + * with 270MB file (~540k ioget() calls, twiddle can easily waste 4-5sec. + */ + twiddle(4); nb = (u_int)nbyte; if ((size = fsize(f->fs, &f->de)) == -1) return EINVAL; if (nb > (n = size - f->offset)) - nb = n; + nb = n; off = f->offset; if ((clus = stclus(f->fs->fatsz, &f->de))) - off &= f->fs->bsize - 1; + off &= f->fs->bsize - 1; c = f->c; cnt = nb; while (cnt) { - n = 0; - if (!c) { - if ((c = clus)) - n = bytblk(f->fs, f->offset); - } else if (!off) - n++; - while (n--) { - if ((err = fatget(f->fs, &c))) + n = 0; + if (!c) { + if ((c = clus)) + n = bytblk(f->fs, f->offset); + } else if (!off) + n++; + while (n--) { + if ((err = fatget(f->fs, &c))) goto out; - if (!okclus(f->fs, c)) { + if (!okclus(f->fs, c)) { err = EINVAL; goto out; } - } - if (!clus || (n = f->fs->bsize - off) > cnt) - n = cnt; - if ((err = ioread(f->fs, (c ? blkoff(f->fs, c) : - secbyt(f->fs->lsndir)) + off, - buf, n))) + } + if (!clus || (n = f->fs->bsize - off) > cnt) + n = cnt; + if ((err = ioread(f->fs, (c ? blkoff(f->fs, c) : + secbyt(f->fs->lsndir)) + off, buf, n))) goto out; - f->offset += n; - f->c = c; - off = 0; - buf = (char *)buf + n; - cnt -= n; + f->offset += n; + f->c = c; + off = 0; + buf = (char *)buf + n; + cnt -= n; } out: if (resid) @@ -364,6 +416,23 @@ dos_stat(struct open_file *fd, struct st } static int +dos_checksum(char *name, char *ext) +{ + int x, i; + char buf[11]; + + bcopy(name, buf, 8); + bcopy(ext, buf+8, 3); + x = 0; + for (i = 0; i < 11; i++) { + x = ((x & 1) << 7) | (x >> 1); + x += buf[i]; + x &= 0xff; + } + return (x); +} + +static int dos_readdir(struct open_file *fd, struct dirent *d) { /* DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; */ @@ -417,12 +486,7 @@ dos_readdir(struct open_file *fd, struct } } else { if (xdn == 1) { - x = 0; - for (i = 0; i < 11; i++) { - x = ((x & 1) << 7) | (x >> 1); - x += dd.de.name[i]; - x &= 0xff; - } + x = dos_checksum(dd.de.name, dd.de.ext); if (x == chk) break; } else { @@ -555,7 +619,7 @@ lookup(DOS_FS *fs, u_int clus, const cha else return EINVAL; for (sec = 0; sec < nsec; sec++) { - if ((err = ioget(fs->fd, lsec + sec, dir, 1))) + if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1)))) return err; for (ent = 0; ent < DEPSEC; ent++) { if (!*dir[ent].de.name) @@ -577,9 +641,7 @@ lookup(DOS_FS *fs, u_int clus, const cha } } else if (!(dir[ent].de.attr & FA_LABEL)) { if ((ok = xdn == 1)) { - for (x = 0, i = 0; i < 11; i++) - x = ((((x & 1) << 7) | (x >> 1)) + - dir[ent].de.name[i]) & 0xff; + x = dos_checksum(dir[ent].de.name, dir[ent].de.ext); ok = chk == x && !strcasecmp(name, (const char *)lfn); } @@ -699,22 +761,52 @@ fatcnt(DOS_FS *fs, u_int c) } /* - * Get next cluster in cluster chain + * Get next cluster in cluster chain. Use in core fat cache unless another + * device replaced it. */ static int fatget(DOS_FS *fs, u_int *c) { u_char buf[4]; - u_int x; - int err; + u_char *s; + u_int x, offset, off, n, nbyte, lsec; + struct devdesc *dd = fs->fd->f_devdata; + int err = 0; + + if (fat.unit != dd->d_unit) { + /* fat cache was changed to another device, dont use it */ + err = ioread(fs, secbyt(fs->lsnfat) + fatoff(fs->fatsz, *c), buf, + fs->fatsz != 32 ? 2 : 4); + if (err) + return err; + } else { + offset = fatoff(fs->fatsz, *c); + nbyte = fs->fatsz != 32 ? 2 : 4; + + s = buf; + if ((off = offset & (SECSIZ - 1))) { + offset -= off; + lsec = bytsec(offset); + offset += SECSIZ; + if ((n = SECSIZ - off) > nbyte) + n = nbyte; + memcpy(s, fat.buf + secbyt(lsec) + off, n); + s += n; + nbyte -= n; + } + n = nbyte & (SECSIZ - 1); + if (nbyte -= n) { + memcpy(s, fat.buf + secbyt(bytsec(offset)), nbyte); + offset += nbyte; + s += nbyte; + } + if (n) + memcpy(s, fat.buf + secbyt(bytsec(offset)), n); + } - err = ioread(fs, secbyt(fs->lsnfat) + fatoff(fs->fatsz, *c), buf, - fs->fatsz != 32 ? 2 : 4); - if (err) - return err; x = fs->fatsz != 32 ? cv2(buf) : cv4(buf); *c = fs->fatsz == 12 ? *c & 1 ? x >> 4 : x & 0xfff : x; - return 0; + return (0); } /* @@ -739,42 +831,24 @@ ioread(DOS_FS *fs, u_int offset, void *b s = buf; if ((off = offset & (SECSIZ - 1))) { offset -= off; - if ((err = iobuf(fs, bytsec(offset)))) - return err; - offset += SECSIZ; if ((n = SECSIZ - off) > nbyte) n = nbyte; - memcpy(s, fs->buf + off, n); + if ((err = ioget(fs->fd, bytsec(offset), off, s, n))) + return err; + offset += SECSIZ; s += n; nbyte -= n; } n = nbyte & (SECSIZ - 1); if (nbyte -= n) { - if ((err = ioget(fs->fd, bytsec(offset), s, bytsec(nbyte)))) + if ((err = ioget(fs->fd, bytsec(offset), 0, s, nbyte))) return err; offset += nbyte; s += nbyte; } if (n) { - if ((err = iobuf(fs, bytsec(offset)))) - return err; - memcpy(s, fs->buf, n); - } - return 0; -} - -/* - * Buffered sector-based I/O primitive - */ -static int -iobuf(DOS_FS *fs, u_int lsec) -{ - int err; - - if (fs->bufsec != lsec) { - if ((err = ioget(fs->fd, lsec, fs->buf, 1))) + if ((err = ioget(fs->fd, bytsec(offset), 0, s, n))) return err; - fs->bufsec = lsec; } return 0; } @@ -783,13 +857,8 @@ iobuf(DOS_FS *fs, u_int lsec) * Sector-based I/O primitive */ static int -ioget(struct open_file *fd, u_int lsec, void *buf, u_int nsec) +ioget(struct open_file *fd, daddr_t lsec, size_t offset, void *buf, u_int size) { - int err; - - twiddle(1); - if ((err = (fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, - secbyt(nsec), buf, NULL))) - return(err); - return(0); + return ((fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, offset, + size, buf, NULL)); } Modified: head/lib/libstand/dosfs.h ============================================================================== --- head/lib/libstand/dosfs.h Mon Apr 18 22:00:26 2016 (r298229) +++ head/lib/libstand/dosfs.h Mon Apr 18 23:09:22 2016 (r298230) @@ -96,8 +96,6 @@ typedef union { typedef struct { struct open_file *fd; /* file descriptor */ - u_char *buf; /* buffer */ - u_int bufsec; /* buffered sector */ u_int links; /* active links to structure */ u_int spc; /* sectors per cluster */ u_int bsize; /* cluster size in bytes */ Modified: head/lib/libstand/ext2fs.c ============================================================================== --- head/lib/libstand/ext2fs.c Mon Apr 18 22:00:26 2016 (r298229) +++ head/lib/libstand/ext2fs.c Mon Apr 18 23:09:22 2016 (r298230) @@ -355,7 +355,7 @@ ext2fs_open(const char *upath, struct op fp->f_fs = fs; twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - EXT2_SBLOCK, EXT2_SBSIZE, (char *)fs, &buf_size); + EXT2_SBLOCK, 0, EXT2_SBSIZE, (char *)fs, &buf_size); if (error) goto out; @@ -397,7 +397,7 @@ ext2fs_open(const char *upath, struct op fp->f_bg = malloc(len); twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, len, + EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, 0, len, (char *)fp->f_bg, &buf_size); if (error) goto out; @@ -509,7 +509,7 @@ ext2fs_open(const char *upath, struct op twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, - F_READ, fsb_to_db(fs, disk_block), + F_READ, fsb_to_db(fs, disk_block), 0, fs->fs_bsize, buf, &buf_size); if (error) goto out; @@ -570,7 +570,7 @@ read_inode(ino_t inumber, struct open_fi buf = malloc(fs->fs_bsize); twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - ino_to_db(fs, fp->f_bg, inumber), fs->fs_bsize, buf, &rsize); + ino_to_db(fs, fp->f_bg, inumber), 0, fs->fs_bsize, buf, &rsize); if (error) goto out; if (rsize != fs->fs_bsize) { @@ -667,7 +667,7 @@ block_map(struct open_file *f, daddr_t f malloc(fs->fs_bsize); twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsb_to_db(fp->f_fs, ind_block_num), fs->fs_bsize, + fsb_to_db(fp->f_fs, ind_block_num), 0, fs->fs_bsize, fp->f_blk[level], &fp->f_blksize[level]); if (error) return (error); @@ -725,7 +725,7 @@ buf_read_file(struct open_file *f, char } else { twiddle(4); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsb_to_db(fs, disk_block), block_size, + fsb_to_db(fs, disk_block), 0, block_size, fp->f_buf, &fp->f_buf_size); if (error) goto done; Modified: head/lib/libstand/read.c ============================================================================== --- head/lib/libstand/read.c Mon Apr 18 22:00:26 2016 (r298229) +++ head/lib/libstand/read.c Mon Apr 18 23:09:22 2016 (r298230) @@ -79,7 +79,7 @@ read(int fd, void *dest, size_t bcount) if (f->f_flags & F_RAW) { twiddle(4); errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - btodb(f->f_offset), bcount, dest, &resid); + btodb(f->f_offset), 0, bcount, dest, &resid); if (errno) return (-1); f->f_offset += resid; Modified: head/lib/libstand/stand.h ============================================================================== --- head/lib/libstand/stand.h Mon Apr 18 22:00:26 2016 (r298229) +++ head/lib/libstand/stand.h Mon Apr 18 23:09:22 2016 (r298230) @@ -138,8 +138,8 @@ struct devsw { const char dv_name[8]; int dv_type; /* opaque type constant, arch-dependant */ int (*dv_init)(void); /* early probe call */ - int (*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size, - char *buf, size_t *rsize); + int (*dv_strategy)(void *devdata, int rw, daddr_t blk, + size_t offset, size_t size, char *buf, size_t *rsize); int (*dv_open)(struct open_file *f, ...); int (*dv_close)(struct open_file *f); int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); @@ -154,6 +154,24 @@ extern struct devsw netdev; extern int errno; +/* + * Generic device specifier; architecture-dependent + * versions may be larger, but should be allowed to + * overlap. + */ +struct devdesc +{ + struct devsw *d_dev; + int d_type; +#define DEVT_NONE 0 +#define DEVT_DISK 1 +#define DEVT_NET 2 +#define DEVT_CD 3 +#define DEVT_ZFS 4 + int d_unit; + void *d_opendata; +}; + struct open_file { int f_flags; /* see F_* below */ struct devsw *f_dev; /* pointer to device operations */ Modified: head/lib/libstand/ufs.c ============================================================================== --- head/lib/libstand/ufs.c Mon Apr 18 22:00:26 2016 (r298229) +++ head/lib/libstand/ufs.c Mon Apr 18 23:09:22 2016 (r298230) @@ -157,7 +157,7 @@ read_inode(inumber, f) buf = malloc(fs->fs_bsize); twiddle(1); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize, + fsbtodb(fs, ino_to_fsba(fs, inumber)), 0, fs->fs_bsize, buf, &rsize); if (rc) goto out; @@ -267,7 +267,7 @@ block_map(f, file_block, disk_block_p) malloc(fs->fs_bsize); twiddle(1); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsbtodb(fp->f_fs, ind_block_num), + fsbtodb(fp->f_fs, ind_block_num), 0, fs->fs_bsize, fp->f_blk[level], &fp->f_blksize[level]); @@ -348,7 +348,7 @@ buf_write_file(f, buf_p, size_p) twiddle(4); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsbtodb(fs, disk_block), + fsbtodb(fs, disk_block), 0, block_size, fp->f_buf, &fp->f_buf_size); if (rc) return (rc); @@ -367,7 +367,7 @@ buf_write_file(f, buf_p, size_p) twiddle(4); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, - fsbtodb(fs, disk_block), + fsbtodb(fs, disk_block), 0, block_size, fp->f_buf, &fp->f_buf_size); return (rc); } @@ -408,7 +408,7 @@ buf_read_file(f, buf_p, size_p) } else { twiddle(4); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsbtodb(fs, disk_block), + fsbtodb(fs, disk_block), 0, block_size, fp->f_buf, &fp->f_buf_size); if (rc) return (rc); @@ -521,7 +521,7 @@ ufs_open(upath, f) */ for (i = 0; sblock_try[i] != -1; i++) { rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - sblock_try[i] / DEV_BSIZE, SBLOCKSIZE, + sblock_try[i] / DEV_BSIZE, 0, SBLOCKSIZE, (char *)fs, &buf_size); if (rc) goto out; @@ -651,7 +651,7 @@ ufs_open(upath, f) twiddle(1); rc = (f->f_dev->dv_strategy)(f->f_devdata, - F_READ, fsbtodb(fs, disk_block), + F_READ, fsbtodb(fs, disk_block), 0, fs->fs_bsize, buf, &buf_size); if (rc) goto out; Modified: head/lib/libstand/write.c ============================================================================== --- head/lib/libstand/write.c Mon Apr 18 22:00:26 2016 (r298229) +++ head/lib/libstand/write.c Mon Apr 18 23:09:22 2016 (r298230) @@ -82,7 +82,7 @@ write(fd, dest, bcount) if (f->f_flags & F_RAW) { twiddle(4); errno = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, - btodb(f->f_offset), bcount, dest, &resid); + btodb(f->f_offset), 0, bcount, dest, &resid); if (errno) return (-1); f->f_offset += resid; Modified: head/sys/boot/common/bcache.c ============================================================================== --- head/sys/boot/common/bcache.c Mon Apr 18 22:00:26 2016 (r298229) +++ head/sys/boot/common/bcache.c Mon Apr 18 23:09:22 2016 (r298230) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1998 Michael Smith + * Copyright 2015 Toomas Soome * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,99 +26,155 @@ */ #include +#include __FBSDID("$FreeBSD$"); /* - * Simple LRU block cache + * Simple hashed block cache */ #include #include #include -#include +#include #include "bootstrap.h" /* #define BCACHE_DEBUG */ #ifdef BCACHE_DEBUG -#define BCACHE_TIMEOUT 10 # define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) #else -#define BCACHE_TIMEOUT 2 # define DEBUG(fmt, args...) #endif - struct bcachectl { daddr_t bc_blkno; - time_t bc_stamp; int bc_count; }; -static struct bcachectl *bcache_ctl; -static caddr_t bcache_data; -static bitstr_t *bcache_miss; -static u_int bcache_nblks; -static u_int bcache_blksize; -static u_int bcache_hits, bcache_misses, bcache_ops, bcache_bypasses; -static u_int bcache_flushes; -static u_int bcache_bcount; - -static void bcache_invalidate(daddr_t blkno); -static void bcache_insert(caddr_t buf, daddr_t blkno); -static int bcache_lookup(caddr_t buf, daddr_t blkno); +/* + * bcache per device node. cache is allocated on device first open and freed + * on last close, to save memory. The issue there is the size; biosdisk + * supports up to 31 (0x1f) devices. Classic setup would use single disk + * to boot from, but this has changed with zfs. + */ +struct bcache { + struct bcachectl *bcache_ctl; + caddr_t bcache_data; + u_int bcache_nblks; + size_t ra; +}; + +static u_int bcache_total_nblks; /* set by bcache_init */ +static u_int bcache_blksize; /* set by bcache_init */ +static u_int bcache_numdev; /* set by bcache_add_dev */ +/* statistics */ +static u_int bcache_units; /* number of devices with cache */ +static u_int bcache_unit_nblks; /* nblocks per unit */ +static u_int bcache_hits; +static u_int bcache_misses; +static u_int bcache_ops; +static u_int bcache_bypasses; +static u_int bcache_bcount; +static u_int bcache_rablks; + +#define BHASH(bc, blkno) ((blkno) & ((bc)->bcache_nblks - 1)) +#define BCACHE_LOOKUP(bc, blkno) \ + ((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno)) +#define BCACHE_READAHEAD 256 +#define BCACHE_MINREADAHEAD 32 + +static void bcache_invalidate(struct bcache *bc, daddr_t blkno); +static void bcache_insert(struct bcache *bc, daddr_t blkno); +static void bcache_free_instance(struct bcache *bc); /* * Initialise the cache for (nblks) of (bsize). */ -int +void bcache_init(u_int nblks, size_t bsize) { - /* discard any old contents */ - if (bcache_data != NULL) { - free(bcache_data); - bcache_data = NULL; - free(bcache_ctl); - } - - /* Allocate control structures */ - bcache_nblks = nblks; + /* set up control data */ + bcache_total_nblks = nblks; bcache_blksize = bsize; - bcache_data = malloc(bcache_nblks * bcache_blksize); - bcache_ctl = (struct bcachectl *)malloc(bcache_nblks * sizeof(struct bcachectl)); - bcache_miss = bit_alloc((bcache_nblks + 1) / 2); - if ((bcache_data == NULL) || (bcache_ctl == NULL) || (bcache_miss == NULL)) { - if (bcache_miss) - free(bcache_miss); - if (bcache_ctl) - free(bcache_ctl); - if (bcache_data) - free(bcache_data); - bcache_data = NULL; - return(ENOMEM); - } - - return(0); } /* - * Flush the cache + * add number of devices to bcache. we have to divide cache space + * between the devices, so bcache_add_dev() can be used to set up the + * number. The issue is, we need to get the number before actual allocations. + * bcache_add_dev() is supposed to be called from device init() call, so the + * assumption is, devsw dv_init is called for plain devices first, and + * for zfs, last. */ void -bcache_flush(void) +bcache_add_dev(int devices) { - u_int i; + bcache_numdev += devices; +} - bcache_flushes++; +void * +bcache_allocate(void) +{ + u_int i; + struct bcache *bc = malloc(sizeof (struct bcache)); + int disks = bcache_numdev; + + if (disks == 0) + disks = 1; /* safe guard */ + + if (bc == NULL) { + errno = ENOMEM; + return (bc); + } + + /* + * the bcache block count must be power of 2 for hash function + */ + i = fls(disks) - 1; /* highbit - 1 */ + if (disks > (1 << i)) /* next power of 2 */ + i++; + + bc->bcache_nblks = bcache_total_nblks >> i; + bcache_unit_nblks = bc->bcache_nblks; + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); + if (bc->bcache_data == NULL) { + /* dont error out yet. fall back to 32 blocks and try again */ + bc->bcache_nblks = 32; + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); + } + + bc->bcache_ctl = malloc(bc->bcache_nblks * sizeof(struct bcachectl)); + + if ((bc->bcache_data == NULL) || (bc->bcache_ctl == NULL)) { + bcache_free_instance(bc); + errno = ENOMEM; + return(NULL); + } /* Flush the cache */ - for (i = 0; i < bcache_nblks; i++) { - bcache_ctl[i].bc_count = -1; - bcache_ctl[i].bc_blkno = -1; - } + for (i = 0; i < bc->bcache_nblks; i++) { + bc->bcache_ctl[i].bc_count = -1; + bc->bcache_ctl[i].bc_blkno = -1; + } + bcache_units++; + bc->ra = BCACHE_READAHEAD; /* optimistic read ahead */ + return (bc); +} + +void +bcache_free(void *cache) +{ + struct bcache *bc = cache; + + if (bc == NULL) + return; + + bcache_free_instance(bc); + bcache_units--; } /* @@ -125,31 +182,22 @@ bcache_flush(void) * cache with the new values. */ static int -write_strategy(void *devdata, int unit, int rw, daddr_t blk, size_t size, - char *buf, size_t *rsize) +write_strategy(void *devdata, int rw, daddr_t blk, size_t offset, + size_t size, char *buf, size_t *rsize) { struct bcache_devdata *dd = (struct bcache_devdata *)devdata; + struct bcache *bc = dd->dv_cache; daddr_t i, nblk; - int err; nblk = size / bcache_blksize; /* Invalidate the blocks being written */ for (i = 0; i < nblk; i++) { - bcache_invalidate(blk + i); + bcache_invalidate(bc, blk + i); } /* Write the blocks */ - err = dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize); - - /* Populate the block cache with the new data */ - if (err == 0) { - for (i = 0; i < nblk; i++) { - bcache_insert(buf + (i * bcache_blksize),blk + i); - } - } - - return err; + return (dd->dv_strategy(dd->dv_devdata, rw, blk, offset, size, buf, rsize)); } /* @@ -158,61 +206,87 @@ write_strategy(void *devdata, int unit, * device I/O and then use the I/O results to populate the cache. */ static int -read_strategy(void *devdata, int unit, int rw, daddr_t blk, size_t size, - char *buf, size_t *rsize) +read_strategy(void *devdata, int rw, daddr_t blk, size_t offset, + size_t size, char *buf, size_t *rsize) { struct bcache_devdata *dd = (struct bcache_devdata *)devdata; - int p_size, result; - daddr_t p_blk, i, j, nblk; + struct bcache *bc = dd->dv_cache; + size_t i, nblk, p_size, r_size, complete, ra; + int result; + daddr_t p_blk; caddr_t p_buf; + if (bc == NULL) { + errno = ENODEV; + return (-1); + } + + if (rsize != NULL) + *rsize = 0; + nblk = size / bcache_blksize; + if ((nblk == 0 && size != 0) || offset != 0) + nblk++; result = 0; + complete = 1; - /* Satisfy any cache hits up front */ + /* Satisfy any cache hits up front, break on first miss */ for (i = 0; i < nblk; i++) { - if (bcache_lookup(buf + (bcache_blksize * i), blk + i)) { - bit_set(bcache_miss, i); /* cache miss */ - bcache_misses++; + if (BCACHE_LOOKUP(bc, (daddr_t)(blk + i))) { + bcache_misses += (nblk - i); + complete = 0; + if (nblk - i > BCACHE_MINREADAHEAD && bc->ra > BCACHE_MINREADAHEAD) + bc->ra >>= 1; /* reduce read ahead */ + break; } else { - bit_clear(bcache_miss, i); /* cache hit */ bcache_hits++; } } - /* Go back and fill in any misses XXX optimise */ - p_blk = -1; - p_buf = NULL; - p_size = 0; - for (i = 0; i < nblk; i++) { - if (bit_test(bcache_miss, i)) { - /* miss, add to pending transfer */ - if (p_blk == -1) { - p_blk = blk + i; - p_buf = buf + (bcache_blksize * i); - p_size = 1; - } else { - p_size++; - } - } else if (p_blk != -1) { - /* hit, complete pending transfer */ - result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * bcache_blksize, p_buf, NULL); - if (result != 0) - goto done; - for (j = 0; j < p_size; j++) - bcache_insert(p_buf + (j * bcache_blksize), p_blk + j); - p_blk = -1; - } - } - if (p_blk != -1) { - /* pending transfer left */ - result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * bcache_blksize, p_buf, NULL); - if (result != 0) - goto done; - for (j = 0; j < p_size; j++) - bcache_insert(p_buf + (j * bcache_blksize), p_blk + j); - } - + if (complete) { /* whole set was in cache, return it */ + if (bc->ra < BCACHE_READAHEAD) + bc->ra <<= 1; /* increase read ahead */ + bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, + buf, size); + goto done; + } + + /* + * Fill in any misses. From check we have i pointing to first missing + * block, read in all remaining blocks + readahead. + * We have space at least for nblk - i before bcache wraps. + */ + p_blk = blk + i; + p_buf = bc->bcache_data + (bcache_blksize * BHASH(bc, p_blk)); + r_size = bc->bcache_nblks - BHASH(bc, p_blk); /* remaining blocks */ + + p_size = MIN(r_size, nblk - i); /* read at least those blocks */ + + ra = bc->bcache_nblks - BHASH(bc, p_blk + p_size); + if (ra != bc->bcache_nblks) { /* do we have RA space? */ + ra = MIN(bc->ra, ra); + p_size += ra; + } + + /* invalidate bcache */ + for (i = 0; i < p_size; i++) { + bcache_invalidate(bc, p_blk + i); + } + r_size = 0; + result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, 0, + p_size * bcache_blksize, p_buf, &r_size); + + if (result) + goto done; + + r_size /= bcache_blksize; + for (i = 0; i < r_size; i++) + bcache_insert(bc, p_blk + i); + + bcache_rablks += ra; + bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, buf, + size); + done: if ((result == 0) && (rsize != NULL)) *rsize = size; @@ -220,130 +294,144 @@ read_strategy(void *devdata, int unit, i } /* - * Requests larger than 1/2 the cache size will be bypassed and go + * Requests larger than 1/2 cache size will be bypassed and go * directly to the disk. XXX tune this. */ int -bcache_strategy(void *devdata, int unit, int rw, daddr_t blk, size_t size, - char *buf, size_t *rsize) +bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset, + size_t size, char *buf, size_t *rsize) { - static int bcache_unit = -1; struct bcache_devdata *dd = (struct bcache_devdata *)devdata; + struct bcache *bc = dd->dv_cache; + u_int bcache_nblks = 0; + int nblk, cblk, ret; + size_t csize, isize, total; bcache_ops++; - if(bcache_unit != unit) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Apr 18 23:26:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9496CB12D47; Mon, 18 Apr 2016 23:26:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61E3A11CF; Mon, 18 Apr 2016 23:26:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3INQBPJ053461; Mon, 18 Apr 2016 23:26:11 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3INQBIx053460; Mon, 18 Apr 2016 23:26:11 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201604182326.u3INQBIx053460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 18 Apr 2016 23:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298231 - head/sys/dev/hptmv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 23:26:12 -0000 Author: sbruno Date: Mon Apr 18 23:26:11 2016 New Revision: 298231 URL: https://svnweb.freebsd.org/changeset/base/298231 Log: hptmv(4) Fix potential buffer overflow in hpt_set_info. While here, adjust some whitespace and yeild some useful debug info. This is untested on this hardware, testing requests to -scsi went unanswered. PR: 206585 Submitted by: cturt@hardenedbsd.org MFC after: 2 weeks Modified: head/sys/dev/hptmv/hptproc.c Modified: head/sys/dev/hptmv/hptproc.c ============================================================================== --- head/sys/dev/hptmv/hptproc.c Mon Apr 18 23:09:22 2016 (r298230) +++ head/sys/dev/hptmv/hptproc.c Mon Apr 18 23:26:11 2016 (r298231) @@ -308,7 +308,9 @@ hpt_set_info(int length) /* * map buffer to kernel. */ - if (piop->nInBufferSize+piop->nOutBufferSize > PAGE_SIZE) { + if (piop->nInBufferSize > PAGE_SIZE || + piop->nOutBufferSize > PAGE_SIZE || + piop->nInBufferSize+piop->nOutBufferSize > PAGE_SIZE) { KdPrintE(("User buffer too large\n")); return -EINVAL; } @@ -319,8 +321,13 @@ hpt_set_info(int length) return -EINVAL; } - if (piop->nInBufferSize) - copyin((void*)(ULONG_PTR)piop->lpInBuffer, ke_area, piop->nInBufferSize); + if (piop->nInBufferSize) { + if (copyin((void*)(ULONG_PTR)piop->lpInBuffer, ke_area, piop->nInBufferSize) != 0) { + KdPrintE(("Failed to copyin from lpInBuffer\n")); + free(ke_area, M_DEVBUF); + return -EFAULT; + } + } /* * call kernel handler. @@ -342,7 +349,7 @@ hpt_set_info(int length) else KdPrintW(("Kernel_ioctl(): return %d\n", err)); free(ke_area, M_DEVBUF); - return -EINVAL; + return -EINVAL; } else { KdPrintW(("Wrong signature: %x\n", piop->Magic)); return -EINVAL; From owner-svn-src-all@freebsd.org Mon Apr 18 23:36:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DC39B1317F; Mon, 18 Apr 2016 23:36:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67AFF196A; Mon, 18 Apr 2016 23:36:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x236.google.com with SMTP id f1so86768162igr.1; Mon, 18 Apr 2016 16:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=PLNCtrQBSiO+R1Ui4k2JJUBchO3j4qmtJBgGc5ku2MU=; b=nRNGiSB0BSC8DQ5heDtbWFUf4+uviYy7w3RTIJFN82Su4cl5yWOk/rOoyHax8TpNO3 bIA5VTIbvjnhFguB+iI0xUvnqu3eNnJNHwOsSawn/O65Q/fiqbueiLbJGTvIC9qG4wYV DUMVLDcr2DFG/f1qjUkT6eyQ7oSpF5anG/0Bti10GbJVYbLz97xqjxBuGu5XWARObcrV 48Hek3/eLnClp2Mwi4aqfFvGGWX1HUcmPeuTgZpyXQADwZIrZBbOmhJbiqyxjIOEc8nD 6+CYYSCgwsRHF5q0aKmKZOTLO1hEHNqePbNCtufW695I103A8aWev/ZC7/EKL7q9hIqd fQVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=PLNCtrQBSiO+R1Ui4k2JJUBchO3j4qmtJBgGc5ku2MU=; b=RsazablrE3vJ7p+g6sTlRVqhOx8oYpMeEmb2yW0F9djRdu5SKGMeXwOHoLT23eeLIK FZEpPfE8s5xQjLW1kH9mPOaR+dorC8BKHC8FE1Iwd+7j0rMccoKQXCvI+SrTDcP9NsVo oaV9elXfONqrx3GMM0neZF3Us6jGnmfs8zmOxX2wkKlEfbcP9GnGV4OhbmkVikkC0Q5F APQYNn4aFZOnuLcuRJS/A1IHwyyrahrQbgLKwaaiCMSK6SeFQw/d3/acCHWoGy8sNTaC bWnyn3YXz2XvZlCpDSQ6Ua43Ig9t1/L2xKzEPEeDptlQEtGP/4WxHGK0lpfXDdL4Jvxa t1sA== X-Gm-Message-State: AOPr4FUYPtE1zMByraEfqjWq5S8NdNRPpDixgBhW66yJkvR4y1jdTWdxckz9AX8xg3zPgSr9tcrcXzt22Dpkhg== MIME-Version: 1.0 X-Received: by 10.50.3.129 with SMTP id c1mr18020256igc.22.1461022570080; Mon, 18 Apr 2016 16:36:10 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Mon, 18 Apr 2016 16:36:10 -0700 (PDT) In-Reply-To: <201604182309.u3IN9MC6047480@repo.freebsd.org> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> Date: Mon, 18 Apr 2016 16:36:10 -0700 Message-ID: Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: Adrian Chadd To: Allan Jude Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 23:36:11 -0000 Someone pointed out how this bloats out memory requirement in loader. Did anyone check that? -adrian On 18 April 2016 at 16:09, Allan Jude wrote: > Author: allanjude > Date: Mon Apr 18 23:09:22 2016 > New Revision: 298230 > URL: https://svnweb.freebsd.org/changeset/base/298230 > > Log: > A new implementation of the loader block cache > > The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy. > Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks. > Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device. > The cache also implements limited read-ahead to increase performance. > To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache. > > Booting from a virtual CD over IPMI: > 0ms latency, before: 27 second, after: 7 seconds > 60ms latency, before: over 12 minutes, after: under 5 minutes. > > Submitted by: Toomas Soome > Reviewed by: delphij (previous version), emaste (previous version) > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D4713 > > Modified: > head/lib/libstand/cd9660.c > head/lib/libstand/dosfs.c > head/lib/libstand/dosfs.h > head/lib/libstand/ext2fs.c > head/lib/libstand/read.c > head/lib/libstand/stand.h > head/lib/libstand/ufs.c > head/lib/libstand/write.c > head/sys/boot/common/bcache.c > head/sys/boot/common/bootstrap.h > head/sys/boot/common/disk.c > head/sys/boot/common/md.c > head/sys/boot/common/module.c > head/sys/boot/efi/libefi/efipart.c > head/sys/boot/efi/libefi/libefi.c > head/sys/boot/efi/loader/main.c > head/sys/boot/i386/libfirewire/firewire.c > head/sys/boot/i386/libi386/bioscd.c > head/sys/boot/i386/libi386/biosdisk.c > head/sys/boot/i386/libi386/biosmem.c > head/sys/boot/i386/libi386/pxe.c > head/sys/boot/i386/loader/main.c > head/sys/boot/mips/beri/loader/beri_disk_cfi.c > head/sys/boot/mips/beri/loader/beri_disk_sdcard.c > head/sys/boot/ofw/libofw/ofw_disk.c > head/sys/boot/pc98/libpc98/bioscd.c > head/sys/boot/pc98/libpc98/biosdisk.c > head/sys/boot/pc98/libpc98/biosmem.c > head/sys/boot/pc98/loader/main.c > head/sys/boot/powerpc/kboot/hostdisk.c > head/sys/boot/powerpc/ps3/ps3cdrom.c > head/sys/boot/powerpc/ps3/ps3disk.c > head/sys/boot/uboot/lib/disk.c > head/sys/boot/usb/storage/umass_loader.c > head/sys/boot/userboot/userboot/host.c > head/sys/boot/userboot/userboot/main.c > head/sys/boot/userboot/userboot/userboot_disk.c > head/sys/boot/zfs/zfs.c > > Modified: head/lib/libstand/cd9660.c > ============================================================================== > --- head/lib/libstand/cd9660.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/cd9660.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -143,7 +143,7 @@ susp_lookup_record(struct open_file *f, > if (bcmp(sh->type, SUSP_CONTINUATION, 2) == 0) { > shc = (ISO_RRIP_CONT *)sh; > error = f->f_dev->dv_strategy(f->f_devdata, F_READ, > - cdb2devb(isonum_733(shc->location)), > + cdb2devb(isonum_733(shc->location)), 0, > ISO_DEFAULT_BLOCK_SIZE, susp_buffer, &read); > > /* Bail if it fails. */ > @@ -288,7 +288,7 @@ cd9660_open(const char *path, struct ope > for (bno = 16;; bno++) { > twiddle(1); > rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno), > - ISO_DEFAULT_BLOCK_SIZE, buf, &read); > + 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read); > if (rc) > goto out; > if (read != ISO_DEFAULT_BLOCK_SIZE) { > @@ -322,7 +322,7 @@ cd9660_open(const char *path, struct ope > twiddle(1); > rc = f->f_dev->dv_strategy > (f->f_devdata, F_READ, > - cdb2devb(bno + boff), > + cdb2devb(bno + boff), 0, > ISO_DEFAULT_BLOCK_SIZE, > buf, &read); > if (rc) > @@ -381,7 +381,7 @@ cd9660_open(const char *path, struct ope > bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); > twiddle(1); > rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno), > - ISO_DEFAULT_BLOCK_SIZE, buf, &read); > + 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read); > if (rc) > goto out; > if (read != ISO_DEFAULT_BLOCK_SIZE) { > @@ -438,7 +438,8 @@ buf_read_file(struct open_file *f, char > > twiddle(16); > rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, > - cdb2devb(blkno), ISO_DEFAULT_BLOCK_SIZE, fp->f_buf, &read); > + cdb2devb(blkno), 0, ISO_DEFAULT_BLOCK_SIZE, > + fp->f_buf, &read); > if (rc) > return (rc); > if (read != ISO_DEFAULT_BLOCK_SIZE) > > Modified: head/lib/libstand/dosfs.c > ============================================================================== > --- head/lib/libstand/dosfs.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/dosfs.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -131,7 +131,18 @@ static DOS_DE dot[2] = { > #define stclus(sz, de) ((sz) != 32 ? cv2((de)->clus) : \ > ((u_int)cv2((de)->dex.h_clus) << 16) | \ > cv2((de)->clus)) > - > + > +/* > + * fat cache metadata > + */ > +struct fatcache { > + int unit; /* disk unit number */ > + int size; /* buffer (and fat) size in sectors */ > + u_char *buf; > +}; > + > +static struct fatcache fat; > + > static int dosunmount(DOS_FS *); > static int parsebs(DOS_FS *, DOS_BS *); > static int namede(DOS_FS *, const char *, DOS_DE **); > @@ -143,8 +154,36 @@ static int fatcnt(DOS_FS *, u_int); > static int fatget(DOS_FS *, u_int *); > static int fatend(u_int, u_int); > static int ioread(DOS_FS *, u_int, void *, u_int); > -static int iobuf(DOS_FS *, u_int); > -static int ioget(struct open_file *, u_int, void *, u_int); > +static int ioget(struct open_file *, daddr_t, size_t, void *, u_int); > + > +static void > +dos_read_fat(DOS_FS *fs, struct open_file *fd) > +{ > + struct devdesc *dd = fd->f_devdata; > + > + if (fat.buf != NULL) { /* can we reuse old buffer? */ > + if (fat.size != fs->spf) { > + free(fat.buf); /* no, free old buffer */ > + fat.buf = NULL; > + } > + } > + > + if (fat.buf == NULL) > + fat.buf = malloc(secbyt(fs->spf)); > + > + if (fat.buf != NULL) { > + if (ioget(fd, fs->lsnfat, 0, fat.buf, secbyt(fs->spf)) == 0) { > + fat.size = fs->spf; > + fat.unit = dd->d_unit; > + return; > + } > + } > + if (fat.buf != NULL) /* got IO error */ > + free(fat.buf); > + fat.buf = NULL; > + fat.unit = -1; /* impossible unit */ > + fat.size = 0; > +} > > /* > * Mount DOS filesystem > @@ -153,15 +192,25 @@ static int > dos_mount(DOS_FS *fs, struct open_file *fd) > { > int err; > + struct devdesc *dd = fd->f_devdata; > + u_char *buf; > > bzero(fs, sizeof(DOS_FS)); > fs->fd = fd; > - if ((err = !(fs->buf = malloc(SECSIZ)) ? errno : 0) || > - (err = ioget(fs->fd, 0, fs->buf, 1)) || > - (err = parsebs(fs, (DOS_BS *)fs->buf))) { > + > + if ((err = !(buf = malloc(secbyt(1))) ? errno : 0) || > + (err = ioget(fs->fd, 0, 0, buf, secbyt(1))) || > + (err = parsebs(fs, (DOS_BS *)buf))) { > + if (buf != NULL) > + free(buf); > (void)dosunmount(fs); > return(err); > } > + free(buf); > + > + if (fat.buf == NULL || fat.unit != dd->d_unit) > + dos_read_fat(fs, fd); > + > fs->root = dot[0]; > fs->root.name[0] = ' '; > if (fs->fatsz == 32) { > @@ -194,8 +243,6 @@ dos_unmount(DOS_FS *fs) > static int > dosunmount(DOS_FS *fs) > { > - if (fs->buf) > - free(fs->buf); > free(fs); > return(0); > } > @@ -252,42 +299,47 @@ dos_read(struct open_file *fd, void *buf > DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; > int err = 0; > > + /* > + * as ioget() can be called *a lot*, use twiddle here. > + * also 4 seems to be good value not to slow loading down too much: > + * with 270MB file (~540k ioget() calls, twiddle can easily waste 4-5sec. > + */ > + twiddle(4); > nb = (u_int)nbyte; > if ((size = fsize(f->fs, &f->de)) == -1) > return EINVAL; > if (nb > (n = size - f->offset)) > - nb = n; > + nb = n; > off = f->offset; > if ((clus = stclus(f->fs->fatsz, &f->de))) > - off &= f->fs->bsize - 1; > + off &= f->fs->bsize - 1; > c = f->c; > cnt = nb; > while (cnt) { > - n = 0; > - if (!c) { > - if ((c = clus)) > - n = bytblk(f->fs, f->offset); > - } else if (!off) > - n++; > - while (n--) { > - if ((err = fatget(f->fs, &c))) > + n = 0; > + if (!c) { > + if ((c = clus)) > + n = bytblk(f->fs, f->offset); > + } else if (!off) > + n++; > + while (n--) { > + if ((err = fatget(f->fs, &c))) > goto out; > - if (!okclus(f->fs, c)) { > + if (!okclus(f->fs, c)) { > err = EINVAL; > goto out; > } > - } > - if (!clus || (n = f->fs->bsize - off) > cnt) > - n = cnt; > - if ((err = ioread(f->fs, (c ? blkoff(f->fs, c) : > - secbyt(f->fs->lsndir)) + off, > - buf, n))) > + } > + if (!clus || (n = f->fs->bsize - off) > cnt) > + n = cnt; > + if ((err = ioread(f->fs, (c ? blkoff(f->fs, c) : > + secbyt(f->fs->lsndir)) + off, buf, n))) > goto out; > - f->offset += n; > - f->c = c; > - off = 0; > - buf = (char *)buf + n; > - cnt -= n; > + f->offset += n; > + f->c = c; > + off = 0; > + buf = (char *)buf + n; > + cnt -= n; > } > out: > if (resid) > @@ -364,6 +416,23 @@ dos_stat(struct open_file *fd, struct st > } > > static int > +dos_checksum(char *name, char *ext) > +{ > + int x, i; > + char buf[11]; > + > + bcopy(name, buf, 8); > + bcopy(ext, buf+8, 3); > + x = 0; > + for (i = 0; i < 11; i++) { > + x = ((x & 1) << 7) | (x >> 1); > + x += buf[i]; > + x &= 0xff; > + } > + return (x); > +} > + > +static int > dos_readdir(struct open_file *fd, struct dirent *d) > { > /* DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; */ > @@ -417,12 +486,7 @@ dos_readdir(struct open_file *fd, struct > } > } else { > if (xdn == 1) { > - x = 0; > - for (i = 0; i < 11; i++) { > - x = ((x & 1) << 7) | (x >> 1); > - x += dd.de.name[i]; > - x &= 0xff; > - } > + x = dos_checksum(dd.de.name, dd.de.ext); > if (x == chk) > break; > } else { > @@ -555,7 +619,7 @@ lookup(DOS_FS *fs, u_int clus, const cha > else > return EINVAL; > for (sec = 0; sec < nsec; sec++) { > - if ((err = ioget(fs->fd, lsec + sec, dir, 1))) > + if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1)))) > return err; > for (ent = 0; ent < DEPSEC; ent++) { > if (!*dir[ent].de.name) > @@ -577,9 +641,7 @@ lookup(DOS_FS *fs, u_int clus, const cha > } > } else if (!(dir[ent].de.attr & FA_LABEL)) { > if ((ok = xdn == 1)) { > - for (x = 0, i = 0; i < 11; i++) > - x = ((((x & 1) << 7) | (x >> 1)) + > - dir[ent].de.name[i]) & 0xff; > + x = dos_checksum(dir[ent].de.name, dir[ent].de.ext); > ok = chk == x && > !strcasecmp(name, (const char *)lfn); > } > @@ -699,22 +761,52 @@ fatcnt(DOS_FS *fs, u_int c) > } > > /* > - * Get next cluster in cluster chain > + * Get next cluster in cluster chain. Use in core fat cache unless another > + * device replaced it. > */ > static int > fatget(DOS_FS *fs, u_int *c) > { > u_char buf[4]; > - u_int x; > - int err; > + u_char *s; > + u_int x, offset, off, n, nbyte, lsec; > + struct devdesc *dd = fs->fd->f_devdata; > + int err = 0; > + > + if (fat.unit != dd->d_unit) { > + /* fat cache was changed to another device, dont use it */ > + err = ioread(fs, secbyt(fs->lsnfat) + fatoff(fs->fatsz, *c), buf, > + fs->fatsz != 32 ? 2 : 4); > + if (err) > + return err; > + } else { > + offset = fatoff(fs->fatsz, *c); > + nbyte = fs->fatsz != 32 ? 2 : 4; > + > + s = buf; > + if ((off = offset & (SECSIZ - 1))) { > + offset -= off; > + lsec = bytsec(offset); > + offset += SECSIZ; > + if ((n = SECSIZ - off) > nbyte) > + n = nbyte; > + memcpy(s, fat.buf + secbyt(lsec) + off, n); > + s += n; > + nbyte -= n; > + } > + n = nbyte & (SECSIZ - 1); > + if (nbyte -= n) { > + memcpy(s, fat.buf + secbyt(bytsec(offset)), nbyte); > + offset += nbyte; > + s += nbyte; > + } > + if (n) > + memcpy(s, fat.buf + secbyt(bytsec(offset)), n); > + } > > - err = ioread(fs, secbyt(fs->lsnfat) + fatoff(fs->fatsz, *c), buf, > - fs->fatsz != 32 ? 2 : 4); > - if (err) > - return err; > x = fs->fatsz != 32 ? cv2(buf) : cv4(buf); > *c = fs->fatsz == 12 ? *c & 1 ? x >> 4 : x & 0xfff : x; > - return 0; > + return (0); > } > > /* > @@ -739,42 +831,24 @@ ioread(DOS_FS *fs, u_int offset, void *b > s = buf; > if ((off = offset & (SECSIZ - 1))) { > offset -= off; > - if ((err = iobuf(fs, bytsec(offset)))) > - return err; > - offset += SECSIZ; > if ((n = SECSIZ - off) > nbyte) > n = nbyte; > - memcpy(s, fs->buf + off, n); > + if ((err = ioget(fs->fd, bytsec(offset), off, s, n))) > + return err; > + offset += SECSIZ; > s += n; > nbyte -= n; > } > n = nbyte & (SECSIZ - 1); > if (nbyte -= n) { > - if ((err = ioget(fs->fd, bytsec(offset), s, bytsec(nbyte)))) > + if ((err = ioget(fs->fd, bytsec(offset), 0, s, nbyte))) > return err; > offset += nbyte; > s += nbyte; > } > if (n) { > - if ((err = iobuf(fs, bytsec(offset)))) > - return err; > - memcpy(s, fs->buf, n); > - } > - return 0; > -} > - > -/* > - * Buffered sector-based I/O primitive > - */ > -static int > -iobuf(DOS_FS *fs, u_int lsec) > -{ > - int err; > - > - if (fs->bufsec != lsec) { > - if ((err = ioget(fs->fd, lsec, fs->buf, 1))) > + if ((err = ioget(fs->fd, bytsec(offset), 0, s, n))) > return err; > - fs->bufsec = lsec; > } > return 0; > } > @@ -783,13 +857,8 @@ iobuf(DOS_FS *fs, u_int lsec) > * Sector-based I/O primitive > */ > static int > -ioget(struct open_file *fd, u_int lsec, void *buf, u_int nsec) > +ioget(struct open_file *fd, daddr_t lsec, size_t offset, void *buf, u_int size) > { > - int err; > - > - twiddle(1); > - if ((err = (fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, > - secbyt(nsec), buf, NULL))) > - return(err); > - return(0); > + return ((fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, offset, > + size, buf, NULL)); > } > > Modified: head/lib/libstand/dosfs.h > ============================================================================== > --- head/lib/libstand/dosfs.h Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/dosfs.h Mon Apr 18 23:09:22 2016 (r298230) > @@ -96,8 +96,6 @@ typedef union { > > typedef struct { > struct open_file *fd; /* file descriptor */ > - u_char *buf; /* buffer */ > - u_int bufsec; /* buffered sector */ > u_int links; /* active links to structure */ > u_int spc; /* sectors per cluster */ > u_int bsize; /* cluster size in bytes */ > > Modified: head/lib/libstand/ext2fs.c > ============================================================================== > --- head/lib/libstand/ext2fs.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/ext2fs.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -355,7 +355,7 @@ ext2fs_open(const char *upath, struct op > fp->f_fs = fs; > twiddle(1); > error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - EXT2_SBLOCK, EXT2_SBSIZE, (char *)fs, &buf_size); > + EXT2_SBLOCK, 0, EXT2_SBSIZE, (char *)fs, &buf_size); > if (error) > goto out; > > @@ -397,7 +397,7 @@ ext2fs_open(const char *upath, struct op > fp->f_bg = malloc(len); > twiddle(1); > error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, len, > + EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, 0, len, > (char *)fp->f_bg, &buf_size); > if (error) > goto out; > @@ -509,7 +509,7 @@ ext2fs_open(const char *upath, struct op > > twiddle(1); > error = (f->f_dev->dv_strategy)(f->f_devdata, > - F_READ, fsb_to_db(fs, disk_block), > + F_READ, fsb_to_db(fs, disk_block), 0, > fs->fs_bsize, buf, &buf_size); > if (error) > goto out; > @@ -570,7 +570,7 @@ read_inode(ino_t inumber, struct open_fi > buf = malloc(fs->fs_bsize); > twiddle(1); > error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - ino_to_db(fs, fp->f_bg, inumber), fs->fs_bsize, buf, &rsize); > + ino_to_db(fs, fp->f_bg, inumber), 0, fs->fs_bsize, buf, &rsize); > if (error) > goto out; > if (rsize != fs->fs_bsize) { > @@ -667,7 +667,7 @@ block_map(struct open_file *f, daddr_t f > malloc(fs->fs_bsize); > twiddle(1); > error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsb_to_db(fp->f_fs, ind_block_num), fs->fs_bsize, > + fsb_to_db(fp->f_fs, ind_block_num), 0, fs->fs_bsize, > fp->f_blk[level], &fp->f_blksize[level]); > if (error) > return (error); > @@ -725,7 +725,7 @@ buf_read_file(struct open_file *f, char > } else { > twiddle(4); > error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsb_to_db(fs, disk_block), block_size, > + fsb_to_db(fs, disk_block), 0, block_size, > fp->f_buf, &fp->f_buf_size); > if (error) > goto done; > > Modified: head/lib/libstand/read.c > ============================================================================== > --- head/lib/libstand/read.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/read.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -79,7 +79,7 @@ read(int fd, void *dest, size_t bcount) > if (f->f_flags & F_RAW) { > twiddle(4); > errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - btodb(f->f_offset), bcount, dest, &resid); > + btodb(f->f_offset), 0, bcount, dest, &resid); > if (errno) > return (-1); > f->f_offset += resid; > > Modified: head/lib/libstand/stand.h > ============================================================================== > --- head/lib/libstand/stand.h Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/stand.h Mon Apr 18 23:09:22 2016 (r298230) > @@ -138,8 +138,8 @@ struct devsw { > const char dv_name[8]; > int dv_type; /* opaque type constant, arch-dependant */ > int (*dv_init)(void); /* early probe call */ > - int (*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size, > - char *buf, size_t *rsize); > + int (*dv_strategy)(void *devdata, int rw, daddr_t blk, > + size_t offset, size_t size, char *buf, size_t *rsize); > int (*dv_open)(struct open_file *f, ...); > int (*dv_close)(struct open_file *f); > int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); > @@ -154,6 +154,24 @@ extern struct devsw netdev; > > extern int errno; > > +/* > + * Generic device specifier; architecture-dependent > + * versions may be larger, but should be allowed to > + * overlap. > + */ > +struct devdesc > +{ > + struct devsw *d_dev; > + int d_type; > +#define DEVT_NONE 0 > +#define DEVT_DISK 1 > +#define DEVT_NET 2 > +#define DEVT_CD 3 > +#define DEVT_ZFS 4 > + int d_unit; > + void *d_opendata; > +}; > + > struct open_file { > int f_flags; /* see F_* below */ > struct devsw *f_dev; /* pointer to device operations */ > > Modified: head/lib/libstand/ufs.c > ============================================================================== > --- head/lib/libstand/ufs.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/ufs.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -157,7 +157,7 @@ read_inode(inumber, f) > buf = malloc(fs->fs_bsize); > twiddle(1); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize, > + fsbtodb(fs, ino_to_fsba(fs, inumber)), 0, fs->fs_bsize, > buf, &rsize); > if (rc) > goto out; > @@ -267,7 +267,7 @@ block_map(f, file_block, disk_block_p) > malloc(fs->fs_bsize); > twiddle(1); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsbtodb(fp->f_fs, ind_block_num), > + fsbtodb(fp->f_fs, ind_block_num), 0, > fs->fs_bsize, > fp->f_blk[level], > &fp->f_blksize[level]); > @@ -348,7 +348,7 @@ buf_write_file(f, buf_p, size_p) > > twiddle(4); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsbtodb(fs, disk_block), > + fsbtodb(fs, disk_block), 0, > block_size, fp->f_buf, &fp->f_buf_size); > if (rc) > return (rc); > @@ -367,7 +367,7 @@ buf_write_file(f, buf_p, size_p) > > twiddle(4); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, > - fsbtodb(fs, disk_block), > + fsbtodb(fs, disk_block), 0, > block_size, fp->f_buf, &fp->f_buf_size); > return (rc); > } > @@ -408,7 +408,7 @@ buf_read_file(f, buf_p, size_p) > } else { > twiddle(4); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsbtodb(fs, disk_block), > + fsbtodb(fs, disk_block), 0, > block_size, fp->f_buf, &fp->f_buf_size); > if (rc) > return (rc); > @@ -521,7 +521,7 @@ ufs_open(upath, f) > */ > for (i = 0; sblock_try[i] != -1; i++) { > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - sblock_try[i] / DEV_BSIZE, SBLOCKSIZE, > + sblock_try[i] / DEV_BSIZE, 0, SBLOCKSIZE, > (char *)fs, &buf_size); > if (rc) > goto out; > @@ -651,7 +651,7 @@ ufs_open(upath, f) > > twiddle(1); > rc = (f->f_dev->dv_strategy)(f->f_devdata, > - F_READ, fsbtodb(fs, disk_block), > + F_READ, fsbtodb(fs, disk_block), 0, > fs->fs_bsize, buf, &buf_size); > if (rc) > goto out; > > Modified: head/lib/libstand/write.c > ============================================================================== > --- head/lib/libstand/write.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/write.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -82,7 +82,7 @@ write(fd, dest, bcount) > if (f->f_flags & F_RAW) { > twiddle(4); > errno = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, > - btodb(f->f_offset), bcount, dest, &resid); > + btodb(f->f_offset), 0, bcount, dest, &resid); > if (errno) > return (-1); > f->f_offset += resid; > > Modified: head/sys/boot/common/bcache.c > ============================================================================== > --- head/sys/boot/common/bcache.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/sys/boot/common/bcache.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 1998 Michael Smith > + * Copyright 2015 Toomas Soome > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -25,99 +26,155 @@ > */ > > #include > +#include > __FBSDID("$FreeBSD$"); > > /* > - * Simple LRU block cache > + * Simple hashed block cache > */ > > #include > > #include > #include > -#include > +#include > > #include "bootstrap.h" > > /* #define BCACHE_DEBUG */ > > #ifdef BCACHE_DEBUG > -#define BCACHE_TIMEOUT 10 > # define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) > #else > -#define BCACHE_TIMEOUT 2 > # define DEBUG(fmt, args...) > #endif > > - > struct bcachectl > { > daddr_t bc_blkno; > - time_t bc_stamp; > int bc_count; > }; > > -static struct bcachectl *bcache_ctl; > -static caddr_t bcache_data; > -static bitstr_t *bcache_miss; > -static u_int bcache_nblks; > -static u_int bcache_blksize; > -static u_int bcache_hits, bcache_misses, bcache_ops, bcache_bypasses; > -static u_int bcache_flushes; > -static u_int bcache_bcount; > - > -static void bcache_invalidate(daddr_t blkno); > -static void bcache_insert(caddr_t buf, daddr_t blkno); > -static int bcache_lookup(caddr_t buf, daddr_t blkno); > +/* > + * bcache per device node. cache is allocated on device first open and freed > + * on last close, to save memory. The issue there is the size; biosdisk > + * supports up to 31 (0x1f) devices. Classic setup would use single disk > + * to boot from, but this has changed with zfs. > + */ > +struct bcache { > + struct bcachectl *bcache_ctl; > + caddr_t bcache_data; > + u_int bcache_nblks; > + size_t ra; > +}; > + > +static u_int bcache_total_nblks; /* set by bcache_init */ > +static u_int bcache_blksize; /* set by bcache_init */ > +static u_int bcache_numdev; /* set by bcache_add_dev */ > +/* statistics */ > +static u_int bcache_units; /* number of devices with cache */ > +static u_int bcache_unit_nblks; /* nblocks per unit */ > +static u_int bcache_hits; > +static u_int bcache_misses; > +static u_int bcache_ops; > +static u_int bcache_bypasses; > +static u_int bcache_bcount; > +static u_int bcache_rablks; > + > +#define BHASH(bc, blkno) ((blkno) & ((bc)->bcache_nblks - 1)) > +#define BCACHE_LOOKUP(bc, blkno) \ > + ((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno)) > +#define BCACHE_READAHEAD 256 > +#define BCACHE_MINREADAHEAD 32 > + > +static void bcache_invalidate(struct bcache *bc, daddr_t blkno); > +static void bcache_insert(struct bcache *bc, daddr_t blkno); > +static void bcache_free_instance(struct bcache *bc); > > /* > * Initialise the cache for (nblks) of (bsize). > */ > -int > +void > bcache_init(u_int nblks, size_t bsize) > { > - /* discard any old contents */ > - if (bcache_data != NULL) { > - free(bcache_data); > - bcache_data = NULL; > - free(bcache_ctl); > - } > - > - /* Allocate control structures */ > - bcache_nblks = nblks; > + /* set up control data */ > + bcache_total_nblks = nblks; > bcache_blksize = bsize; > - bcache_data = malloc(bcache_nblks * bcache_blksize); > - bcache_ctl = (struct bcachectl *)malloc(bcache_nblks * sizeof(struct bcachectl)); > - bcache_miss = bit_alloc((bcache_nblks + 1) / 2); > - if ((bcache_data == NULL) || (bcache_ctl == NULL) || (bcache_miss == NULL)) { > - if (bcache_miss) > - free(bcache_miss); > - if (bcache_ctl) > - free(bcache_ctl); > - if (bcache_data) > - free(bcache_data); > - bcache_data = NULL; > - return(ENOMEM); > - } > - > - return(0); > } > > /* > - * Flush the cache > + * add number of devices to bcache. we have to divide cache space > + * between the devices, so bcache_add_dev() can be used to set up the > + * number. The issue is, we need to get the number before actual allocations. > + * bcache_add_dev() is supposed to be called from device init() call, so the > + * assumption is, devsw dv_init is called for plain devices first, and > + * for zfs, last. > */ > void > -bcache_flush(void) > +bcache_add_dev(int devices) > { > - u_int i; > + bcache_numdev += devices; > +} > > - bcache_flushes++; > +void * > +bcache_allocate(void) > +{ > + u_int i; > + struct bcache *bc = malloc(sizeof (struct bcache)); > + int disks = bcache_numdev; > + > + if (disks == 0) > + disks = 1; /* safe guard */ > + > + if (bc == NULL) { > + errno = ENOMEM; > + return (bc); > + } > + > + /* > + * the bcache block count must be power of 2 for hash function > + */ > + i = fls(disks) - 1; /* highbit - 1 */ > + if (disks > (1 << i)) /* next power of 2 */ > + i++; > + > + bc->bcache_nblks = bcache_total_nblks >> i; > + bcache_unit_nblks = bc->bcache_nblks; > + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); > + if (bc->bcache_data == NULL) { > + /* dont error out yet. fall back to 32 blocks and try again */ > + bc->bcache_nblks = 32; > + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); > + } > + > + bc->bcache_ctl = malloc(bc->bcache_nblks * sizeof(struct bcachectl)); > + > + if ((bc->bcache_data == NULL) || (bc->bcache_ctl == NULL)) { > + bcache_free_instance(bc); > + errno = ENOMEM; > + return(NULL); > + } > > /* Flush the cache */ > - for (i = 0; i < bcache_nblks; i++) { > - bcache_ctl[i].bc_count = -1; > - bcache_ctl[i].bc_blkno = -1; > - } > + for (i = 0; i < bc->bcache_nblks; i++) { > + bc->bcache_ctl[i].bc_count = -1; > + bc->bcache_ctl[i].bc_blkno = -1; > + } > + bcache_units++; > + bc->ra = BCACHE_READAHEAD; /* optimistic read ahead */ > + return (bc); > +} > + > +void > +bcache_free(void *cache) > +{ > + struct bcache *bc = cache; > + > + if (bc == NULL) > + return; > + > + bcache_free_instance(bc); > + bcache_units--; > } > > /* > @@ -125,31 +182,22 @@ bcache_flush(void) > * cache with the new values. > */ > static int > -write_strategy(void *devdata, int unit, int rw, daddr_t blk, size_t size, > - char *buf, size_t *rsize) > +write_strategy(void *devdata, int rw, daddr_t blk, size_t offset, > + size_t size, char *buf, size_t *rsize) > { > struct bcache_devdata *dd = (struct bcache_devdata *)devdata; > + struct bcache *bc = dd->dv_cache; > daddr_t i, nblk; > - int err; > > nblk = size / bcache_blksize; > > /* Invalidate the blocks being written */ > for (i = 0; i < nblk; i++) { > - bcache_invalidate(blk + i); > + bcache_invalidate(bc, blk + i); > } > > /* Write the blocks */ > - err = dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize); > - > - /* Populate the block cache with the new data */ > - if (err == 0) { > - for (i = 0; i < nblk; i++) { > - bcache_insert(buf + (i * bcache_blksize),blk + i); > - } > - } > - > - return err; > + return (dd->dv_strategy(dd->dv_devdata, rw, blk, offset, size, buf, rsize)); > } > > /* > @@ -158,61 +206,87 @@ write_strategy(void *devdata, int unit, > * device I/O and then use the I/O results to populate the cache. > */ > static int > -read_strategy(void *devdata, int unit, int rw, daddr_t blk, size_t size, > - char *buf, size_t *rsize) > +read_strategy(void *devdata, int rw, daddr_t blk, size_t offset, > + size_t size, char *buf, size_t *rsize) > { > struct bcache_devdata *dd = (struct bcache_devdata *)devdata; > - int p_size, result; > - daddr_t p_blk, i, j, nblk; > + struct bcache *bc = dd->dv_cache; > + size_t i, nblk, p_size, r_size, complete, ra; > + int result; > + daddr_t p_blk; > caddr_t p_buf; > > + if (bc == NULL) { > + errno = ENODEV; > + return (-1); > + } > + > + if (rsize != NULL) > + *rsize = 0; > + > nblk = size / bcache_blksize; > + if ((nblk == 0 && size != 0) || offset != 0) > + nblk++; > result = 0; > + complete = 1; > > - /* Satisfy any cache hits up front */ > + /* Satisfy any cache hits up front, break on first miss */ > for (i = 0; i < nblk; i++) { > - if (bcache_lookup(buf + (bcache_blksize * i), blk + i)) { > - bit_set(bcache_miss, i); /* cache miss */ > - bcache_misses++; > + if (BCACHE_LOOKUP(bc, (daddr_t)(blk + i))) { > + bcache_misses += (nblk - i); > + complete = 0; > + if (nblk - i > BCACHE_MINREADAHEAD && bc->ra > BCACHE_MINREADAHEAD) > + bc->ra >>= 1; /* reduce read ahead */ > + break; > } else { > - bit_clear(bcache_miss, i); /* cache hit */ > bcache_hits++; > } > } > > - /* Go back and fill in any misses XXX optimise */ > - p_blk = -1; > - p_buf = NULL; > - p_size = 0; > - for (i = 0; i < nblk; i++) { > - if (bit_test(bcache_miss, i)) { > - /* miss, add to pending transfer */ > - if (p_blk == -1) { > - p_blk = blk + i; > - p_buf = buf + (bcache_blksize * i); > - p_size = 1; > - } else { > - p_size++; > - } > - } else if (p_blk != -1) { > - /* hit, complete pending transfer */ > - result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * bcache_blksize, p_buf, NULL); > - if (result != 0) > - goto done; > - for (j = 0; j < p_size; j++) > - bcache_insert(p_buf + (j * bcache_blksize), p_blk + j); > - p_blk = -1; > - } > - } > - if (p_blk != -1) { > - /* pending transfer left */ > - result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * bcache_blksize, p_buf, NULL); > - if (result != 0) > - goto done; > - for (j = 0; j < p_size; j++) > - bcache_insert(p_buf + (j * bcache_blksize), p_blk + j); > - } > - > + if (complete) { /* whole set was in cache, return it */ > + if (bc->ra < BCACHE_READAHEAD) > + bc->ra <<= 1; /* increase read ahead */ > + bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, > + buf, size); > + goto done; > + } > + > + /* > + * Fill in any misses. From check we have i pointing to first missing > + * block, read in all remaining blocks + readahead. > + * We have space at least for nblk - i before bcache wraps. > + */ > + p_blk = blk + i; > + p_buf = bc->bcache_data + (bcache_blksize * BHASH(bc, p_blk)); > + r_size = bc->bcache_nblks - BHASH(bc, p_blk); /* remaining blocks */ > + > + p_size = MIN(r_size, nblk - i); /* read at least those blocks */ > + > + ra = bc->bcache_nblks - BHASH(bc, p_blk + p_size); > + if (ra != bc->bcache_nblks) { /* do we have RA space? */ > + ra = MIN(bc->ra, ra); > + p_size += ra; > + } > + > + /* invalidate bcache */ > + for (i = 0; i < p_size; i++) { > + bcache_invalidate(bc, p_blk + i); > + } > + r_size = 0; > + result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, 0, > + p_size * bcache_blksize, p_buf, &r_size); > + > + if (result) > + goto done; > + > + r_size /= bcache_blksize; > + for (i = 0; i < r_size; i++) > + bcache_insert(bc, p_blk + i); > + > + bcache_rablks += ra; > + bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, buf, > + size); > + > done: > if ((result == 0) && (rsize != NULL)) > *rsize = size; > @@ -220,130 +294,144 @@ read_strategy(void *devdata, int unit, i > } > > /* > - * Requests larger than 1/2 the cache size will be bypassed and go > + * Requests larger than 1/2 cache size will be bypassed and go > * directly to the disk. XXX tune this. > */ > int > -bcache_strategy(void *devdata, int unit, int rw, daddr_t blk, size_t size, > - char *buf, size_t *rsize) > +bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset, > + size_t size, char *buf, size_t *rsize) > { > - static int bcache_unit = -1; > struct bcache_devdata *dd = (struct bcache_devdata *)devdata; > + struct bcache *bc = dd->dv_cache; > + u_int bcache_nblks = 0; > + int nblk, cblk, ret; > + size_t csize, isize, total; > > bcache_ops++; > > - if(bcache_unit != unit) { > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-all@freebsd.org Mon Apr 18 23:43:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14541B133E0; Mon, 18 Apr 2016 23:43:24 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id EA84C1DD8; Mon, 18 Apr 2016 23:43:23 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.10] (unknown [192.168.1.10]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id B771CD426; Mon, 18 Apr 2016 23:43:17 +0000 (UTC) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... To: Adrian Chadd References: <201604182309.u3IN9MC6047480@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <57157108.6090500@freebsd.org> Date: Mon, 18 Apr 2016 19:43:04 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 23:43:24 -0000 On 2016-04-18 19:36, Adrian Chadd wrote: > Someone pointed out how this bloats out memory requirement in loader. > > Did anyone check that? > > -adrian > I tested down to 128mb of ram in QEMU, booted from the installer ISO, did the install, and booted the installed system without issue. > > On 18 April 2016 at 16:09, Allan Jude wrote: >> Author: allanjude >> Date: Mon Apr 18 23:09:22 2016 >> New Revision: 298230 >> URL: https://svnweb.freebsd.org/changeset/base/298230 >> >> Log: >> A new implementation of the loader block cache >> >> The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy. >> Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks. >> Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device. >> The cache also implements limited read-ahead to increase performance. >> To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache. >> >> Booting from a virtual CD over IPMI: >> 0ms latency, before: 27 second, after: 7 seconds >> 60ms latency, before: over 12 minutes, after: under 5 minutes. >> >> Submitted by: Toomas Soome >> Reviewed by: delphij (previous version), emaste (previous version) >> Relnotes: yes >> Differential Revision: https://reviews.freebsd.org/D4713 >> -- Allan Jude From owner-svn-src-all@freebsd.org Tue Apr 19 00:30:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEB08B1325B; Tue, 19 Apr 2016 00:30:51 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC22B1F0F; Tue, 19 Apr 2016 00:30:51 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:61561 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1asBHQ-0007rd-1g; Mon, 18 Apr 2016 08:40:04 -0700 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: Devin Teske In-Reply-To: <57157108.6090500@freebsd.org> Date: Mon, 18 Apr 2016 17:30:43 -0700 Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Devin Teske Message-Id: <84FB3FCC-4779-4ED1-B0A6-142C90D08EEF@freebsd.org> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 00:30:52 -0000 > On Apr 18, 2016, at 4:43 PM, Allan Jude wrote: >=20 > On 2016-04-18 19:36, Adrian Chadd wrote: >> Someone pointed out how this bloats out memory requirement in loader. >>=20 >> Did anyone check that? >>=20 >> -adrian >>=20 >=20 > I tested down to 128mb of ram in QEMU, booted from the installer ISO, = did the install, and booted the installed system without issue. Hmm. Would be nice if we could claim success under 64MB too. If you get the chance. How low can it go? --=20 Devin= From owner-svn-src-all@freebsd.org Tue Apr 19 00:38:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3213B134B4; Tue, 19 Apr 2016 00:38:08 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C563E13A1; Tue, 19 Apr 2016 00:38:08 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J0c8O0074546; Tue, 19 Apr 2016 00:38:08 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J0c8j2074545; Tue, 19 Apr 2016 00:38:08 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190038.u3J0c8j2074545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 00:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298232 - head/bin/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 00:38:09 -0000 Author: araujo Date: Tue Apr 19 00:38:07 2016 New Revision: 298232 URL: https://svnweb.freebsd.org/changeset/base/298232 Log: Use NULL for pointers instead of 0. MFC after: 2 weeks. Modified: head/bin/test/test.c Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Mon Apr 18 23:26:11 2016 (r298231) +++ head/bin/test/test.c Tue Apr 19 00:38:07 2016 (r298232) @@ -465,7 +465,7 @@ t_lex(char *s) { int num; - if (s == 0) { + if (s == NULL) { return EOI; } num = find_op(s); From owner-svn-src-all@freebsd.org Tue Apr 19 00:40:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D7AAB135E8; Tue, 19 Apr 2016 00:40:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE5117C5; Tue, 19 Apr 2016 00:40:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J0eh7l074869; Tue, 19 Apr 2016 00:40:43 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J0ehdC074868; Tue, 19 Apr 2016 00:40:43 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190040.u3J0ehdC074868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 00:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298233 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 00:40:44 -0000 Author: araujo Date: Tue Apr 19 00:40:43 2016 New Revision: 298233 URL: https://svnweb.freebsd.org/changeset/base/298233 Log: Use NULL instead of 0 for pointers. kvm_open(3) will return NULL when it cannot access kernel virtual memory. MFC after: 2 weeks. Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Tue Apr 19 00:38:07 2016 (r298232) +++ head/bin/ps/ps.c Tue Apr 19 00:40:43 2016 (r298233) @@ -451,7 +451,7 @@ main(int argc, char *argv[]) xkeep = xkeep_implied; kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); - if (kd == 0) + if (kd == NULL) xo_errx(1, "%s", errbuf); if (!_fmt) From owner-svn-src-all@freebsd.org Tue Apr 19 00:59:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DD44B13A70; Tue, 19 Apr 2016 00:59:17 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CECD71EF9; Tue, 19 Apr 2016 00:59:16 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J0xF3I080833; Tue, 19 Apr 2016 00:59:15 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J0xFvm080832; Tue, 19 Apr 2016 00:59:15 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190059.u3J0xFvm080832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 00:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298234 - head/sbin/atm/atmconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 00:59:17 -0000 Author: araujo Date: Tue Apr 19 00:59:15 2016 New Revision: 298234 URL: https://svnweb.freebsd.org/changeset/base/298234 Log: Use NULL for pointers instead of 0. MFC after: 2 weeks. Modified: head/sbin/atm/atmconfig/natm.c Modified: head/sbin/atm/atmconfig/natm.c ============================================================================== --- head/sbin/atm/atmconfig/natm.c Tue Apr 19 00:40:43 2016 (r298233) +++ head/sbin/atm/atmconfig/natm.c Tue Apr 19 00:59:15 2016 (r298234) @@ -575,7 +575,7 @@ natm_delete(int argc, char *argv[]) TAILQ_FOREACH(aif, &diagif_list, link) if (strcmp(aif->ifname, argv[0]) == 0) break; - if (aif == 0) + if (aif == NULL) errx(1, "no such interface '%s'", argv[0]); vpi = parse_num(argv[1], "VPI", 0xff); From owner-svn-src-all@freebsd.org Tue Apr 19 01:01:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E0C5B13C1C; Tue, 19 Apr 2016 01:01:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C8B511C2; Tue, 19 Apr 2016 01:01:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J11M9E082935; Tue, 19 Apr 2016 01:01:22 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J11Mfi082934; Tue, 19 Apr 2016 01:01:22 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190101.u3J11Mfi082934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 01:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298235 - head/sbin/dump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 01:01:23 -0000 Author: araujo Date: Tue Apr 19 01:01:22 2016 New Revision: 298235 URL: https://svnweb.freebsd.org/changeset/base/298235 Log: Use NULL instead of 0. malloc will return NULL in case it cannot allocate memory. MFC after: 2 weeks. Modified: head/sbin/dump/traverse.c Modified: head/sbin/dump/traverse.c ============================================================================== --- head/sbin/dump/traverse.c Tue Apr 19 00:59:15 2016 (r298234) +++ head/sbin/dump/traverse.c Tue Apr 19 01:01:22 2016 (r298235) @@ -928,7 +928,7 @@ loop: if (cnt == size) return; } else { - if (tmpbuf == NULL && (tmpbuf = malloc(secsize)) == 0) + if (tmpbuf == NULL && (tmpbuf = malloc(secsize)) == NULL) quit("buffer malloc failed\n"); xfer = 0; bytes = size; From owner-svn-src-all@freebsd.org Tue Apr 19 01:12:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3484FB1408F for ; Tue, 19 Apr 2016 01:12:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm43-vm10.bullet.mail.bf1.yahoo.com (nm43-vm10.bullet.mail.bf1.yahoo.com [216.109.114.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA95519A5 for ; Tue, 19 Apr 2016 01:12:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461027981; bh=OUaD9LnZdOQC4XSW4FU5W4ywavjoF4WlfURwvy0HcF8=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=Wps9WcZqrTjW3wv0ELsDulJU07eUkXV3yaxYIVHKyF5zfmT2ENKHTisFO3BUm1dO+ms+nCQ+06EiyH6xbUaEdxTUTTFeLrUJa2QxNZLTIY+adqt4kWgDGGbkTaSt89Kn5zeDdZ52nLLDihy42Qh7tvDj/7mSVLiCWJvUZRBGulrYOhRW2eZhZakZSfdpw/i5jQj0okSFa8kxdUr7yDNCngsfzP2W3i+4mfdyDGOseqjO2GEMy7dQbEvMdGKAU2T6oGbaIZD3Ey/vMKdpeRS995FG3q0UKuYM8fvXWmvNp8JxZ2iOvJuGS8FCAt/iOqhcia0mCqB3iHpXcBqrYzY6lA== Received: from [98.139.214.32] by nm43.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 01:06:21 -0000 Received: from [68.142.230.76] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 01:06:21 -0000 Received: from [127.0.0.1] by smtp233.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 01:06:21 -0000 X-Yahoo-Newman-Id: 266739.99613.bm@smtp233.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: VlMhfvAVM1kmRDrvKYdrUl.w0543oSQInb2GfkN0XpotEzg uvPnijo8t289EWjk_n0R98Uhf_iqcwU8stIIT9RjZc1P0OaFozrZ.XkUg19R HAuadPpKQNeN8mvqXMlhQUNil7AX4Ze__EEQ.Kqz6y.p.yyRdWVthH4Ngaqj 8BmfAQl11qhTg7W4nbmzA.wQ62djREnVw8TwuFPZky9dFLralE9j.qj3.Od0 iM6VwIP_aTWqLzXNLbSpThA8LAbS8AtWt.IwAT6S8yMGBiVd9bmDHIR9.9H. q5X3Z2GGWfbmylZ6UpEQ6zm_ZizbpGC61UfKtMdtFUCJBO_wwpaIAhIaL_iV 87hfyemfoLvn6hNgR_lFXlV4vU0xctU82MS5lWU._ZiHD3YvUCDA5HhLi9bD eNb_ubn68hn3qEMomu1en.AQm6PKPB5BvpnswgjgYmLzcsqOmd7CtGvHA70G XOpQhaEcyVpL6kE7DdXqqyNzjG_OJlDYINM32xijqksJQwMFE5CW951Tvreh dbibIoOW515htOfqc9oQawLdXuNk_FNiW X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... To: Devin Teske , Allan Jude References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <84FB3FCC-4779-4ED1-B0A6-142C90D08EEF@freebsd.org> Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <5715848F.7020805@FreeBSD.org> Date: Mon, 18 Apr 2016 20:06:23 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <84FB3FCC-4779-4ED1-B0A6-142C90D08EEF@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 01:12:21 -0000 On 04/18/16 19:30, Devin Teske wrote: > > >> On Apr 18, 2016, at 4:43 PM, Allan Jude > > wrote: >> >> On 2016-04-18 19:36, Adrian Chadd wrote: >>> Someone pointed out how this bloats out memory requirement in loader. >>> >>> Did anyone check that? >>> >>> -adrian >>> >> >> I tested down to 128mb of ram in QEMU, booted from the installer ISO, >> did the install, and booted the installed system without issue. > > Hmm. Would be nice if we could claim success under 64MB too. > If you get the chance. > How low can it go? FWIW, The code review comments state: BTW: as mentioned in very beginning of this project, I'm reserving fairly large chunk of memory (64MB) for loader and using same amount for both BIOS/UEFI variants, default in freebsd is 3MB, eventually this should be reviewed, but currently it will affect very small setups. I still think it's pretty cool, thanks to everyone involved. Cheers, Pedro. From owner-svn-src-all@freebsd.org Tue Apr 19 01:25:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A245B145F5; Tue, 19 Apr 2016 01:25:36 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B62C1055; Tue, 19 Apr 2016 01:25:36 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J1PZSw089935; Tue, 19 Apr 2016 01:25:35 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J1PZRd089934; Tue, 19 Apr 2016 01:25:35 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190125.u3J1PZRd089934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 01:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298236 - head/sbin/init X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 01:25:36 -0000 Author: araujo Date: Tue Apr 19 01:25:35 2016 New Revision: 298236 URL: https://svnweb.freebsd.org/changeset/base/298236 Log: Use NULL instead of 0 for pointers. dbopen(3) will returns a NULL on error. MFC after: 2 weeks. Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Tue Apr 19 01:01:22 2016 (r298235) +++ head/sbin/init/init.c Tue Apr 19 01:25:35 2016 (r298236) @@ -1144,7 +1144,7 @@ start_session_db(void) { if (session_db && (*session_db->close)(session_db)) emergency("session database close: %s", strerror(errno)); - if ((session_db = dbopen(NULL, O_RDWR, 0, DB_HASH, NULL)) == 0) { + if ((session_db = dbopen(NULL, O_RDWR, 0, DB_HASH, NULL)) == NULL) { emergency("session database open: %s", strerror(errno)); return (1); } @@ -1284,7 +1284,7 @@ new_session(session_t *sprev, struct tty } sp->se_next = 0; - if (sprev == 0) { + if (sprev == NULL) { sessions = sp; sp->se_prev = 0; } else { @@ -1311,7 +1311,7 @@ setupargv(session_t *sp, struct ttyent * sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name); sp->se_getty_argv_space = strdup(sp->se_getty); sp->se_getty_argv = construct_argv(sp->se_getty_argv_space); - if (sp->se_getty_argv == 0) { + if (sp->se_getty_argv == NULL) { warning("can't parse getty for port %s", sp->se_device); free(sp->se_getty); free(sp->se_getty_argv_space); @@ -1329,7 +1329,7 @@ setupargv(session_t *sp, struct ttyent * sp->se_window = strdup(typ->ty_window); sp->se_window_argv_space = strdup(sp->se_window); sp->se_window_argv = construct_argv(sp->se_window_argv_space); - if (sp->se_window_argv == 0) { + if (sp->se_window_argv == NULL) { warning("can't parse window for port %s", sp->se_device); free(sp->se_window_argv_space); From owner-svn-src-all@freebsd.org Tue Apr 19 01:32:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28008B14893; Tue, 19 Apr 2016 01:32:25 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 162941520; Tue, 19 Apr 2016 01:32:25 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:62331 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1asCF5-0008M8-Cp; Mon, 18 Apr 2016 09:41:43 -0700 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: Devin Teske In-Reply-To: <5715848F.7020805@FreeBSD.org> Date: Mon, 18 Apr 2016 18:32:23 -0700 Cc: Allan Jude , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Devin Teske Content-Transfer-Encoding: quoted-printable Message-Id: References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <84FB3FCC-4779-4ED1-B0A6-142C90D08EEF@freebsd.org> <5715848F.7020805@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 01:32:25 -0000 > On Apr 18, 2016, at 6:06 PM, Pedro Giffuni wrote: >=20 >=20 >=20 > On 04/18/16 19:30, Devin Teske wrote: >>=20 >>=20 >>> On Apr 18, 2016, at 4:43 PM, Allan Jude >> > wrote: >>>=20 >>> On 2016-04-18 19:36, Adrian Chadd wrote: >>>> Someone pointed out how this bloats out memory requirement in = loader. >>>>=20 >>>> Did anyone check that? >>>>=20 >>>> -adrian >>>>=20 >>>=20 >>> I tested down to 128mb of ram in QEMU, booted from the installer = ISO, >>> did the install, and booted the installed system without issue. >>=20 >> Hmm. Would be nice if we could claim success under 64MB too. >> If you get the chance. >> How low can it go? >=20 > FWIW, The code review comments state: >=20 > >=20 > BTW: as mentioned in very beginning of this project, I'm reserving = fairly large chunk of memory (64MB) for loader and using same amount for = both BIOS/UEFI variants, default in freebsd is 3MB, eventually this = should be reviewed, but currently it will affect very small setups. >=20 > >=20 > I still think it's pretty cool, thanks to everyone involved. >=20 Does anyone know what the original memory reservation amount was before = it was upped to 64MB? --=20 Devin From owner-svn-src-all@freebsd.org Tue Apr 19 01:38:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED5DB14A3C; Tue, 19 Apr 2016 01:38:00 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 9396F189E; Tue, 19 Apr 2016 01:38:00 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 875E7D67D; Tue, 19 Apr 2016 01:37:59 +0000 (UTC) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... To: Devin Teske , Pedro Giffuni References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <84FB3FCC-4779-4ED1-B0A6-142C90D08EEF@freebsd.org> <5715848F.7020805@FreeBSD.org> Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <57158BF3.3060605@freebsd.org> Date: Mon, 18 Apr 2016 21:37:55 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pcp1rf5ulefrpgRKSrgXjhW2OvjaQhvIp" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 01:38:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pcp1rf5ulefrpgRKSrgXjhW2OvjaQhvIp Content-Type: multipart/mixed; boundary="HSIa0OAnGmUTCkg9Ca4K5CUNKvXfAQUMq" From: Allan Jude To: Devin Teske , Pedro Giffuni Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <57158BF3.3060605@freebsd.org> Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <84FB3FCC-4779-4ED1-B0A6-142C90D08EEF@freebsd.org> <5715848F.7020805@FreeBSD.org> In-Reply-To: --HSIa0OAnGmUTCkg9Ca4K5CUNKvXfAQUMq Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-04-18 21:32, Devin Teske wrote: >=20 >> On Apr 18, 2016, at 6:06 PM, Pedro Giffuni wrote: >> >> >> >> On 04/18/16 19:30, Devin Teske wrote: >>> >>> >>>> On Apr 18, 2016, at 4:43 PM, Allan Jude >>> > wrote: >>>> >>>> On 2016-04-18 19:36, Adrian Chadd wrote: >>>>> Someone pointed out how this bloats out memory requirement in loade= r. >>>>> >>>>> Did anyone check that? >>>>> >>>>> -adrian >>>>> >>>> >>>> I tested down to 128mb of ram in QEMU, booted from the installer ISO= , >>>> did the install, and booted the installed system without issue. >>> >>> Hmm. Would be nice if we could claim success under 64MB too. >>> If you get the chance. >>> How low can it go? >> >> FWIW, The code review comments state: >> >> >> >> BTW: as mentioned in very beginning of this project, I'm reserving fai= rly large chunk of memory (64MB) for loader and using same amount for bot= h BIOS/UEFI variants, default in freebsd is 3MB, eventually this should b= e reviewed, but currently it will affect very small setups. >> >> >> >> I still think it's pretty cool, thanks to everyone involved. >> >=20 > Does anyone know what the original memory reservation amount was before= it was upped to 64MB? >=20 It was 3MB --=20 Allan Jude --HSIa0OAnGmUTCkg9Ca4K5CUNKvXfAQUMq-- --pcp1rf5ulefrpgRKSrgXjhW2OvjaQhvIp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJXFYv2AAoJEBmVNT4SmAt+E6AP/iY14px2r8xwkK1j1/U1R//O AifzoDADgT0rWRxgtKr67iU6lllfIfqpfyp5jVmv6Vg0B/zOxcj9f0KakEtYu5tH 93ozhYNFvpsMV9nF2RaiFilsO+I7vrU/8y1WfjW2DKxrhuaE0XuPWUdRvQS2u0Oj mo1DisEzzFVYc+sLk1XtqOo8HQm8BjgtWnlw7R7LL1hoAfwJMM8DJX3migb8HsFn RBAHrDoWMayvNcXe1+lTqzmbvVJ6MXevTmNvWBg6o0Z2oGOLN3HZPBPXu+e26dCU wdq3g4wtsXLvli+8f4dLvlHWrYl1SLHdihbS+ePdIZUVQcwmK/8jnlkb7FP3mzyB Ok2kDBcjVkn2J2kSft7oDqLjl6bp74UYHMlNAHk+v05m1XIm/TFbUJ/qcPO4l1Cj 2IDylZWRIeFknM5xWdH9bGo31xn2ncaCcgDW220QzLCidVeTzqT3Cxhn6REWUIze Yzc1X+p37i71TQIGMU0d9+1bTWlagAMNSmavnGfQoTjwGakPEK9YLFZJdKP/J+bL vP1QhbkguI3rkRN1L35A5brDiRkYirFcHlnYkkW9SoFmT5YpBa1P+9zlU4Zx/STt PhcA32vi77yenPgwLbjny1xR+znJFjgq8pAblBZwYJ+TftsRocREh3ClWdkgTjOd e1zF3nzR9myjO0iXE++M =o/AI -----END PGP SIGNATURE----- --pcp1rf5ulefrpgRKSrgXjhW2OvjaQhvIp-- From owner-svn-src-all@freebsd.org Tue Apr 19 01:48:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF56AB14D28; Tue, 19 Apr 2016 01:48:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B03431D9E; Tue, 19 Apr 2016 01:48:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J1mJnT096049; Tue, 19 Apr 2016 01:48:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J1mICu096042; Tue, 19 Apr 2016 01:48:18 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201604190148.u3J1mICu096042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 19 Apr 2016 01:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298237 - in head/sys: dev/dpaa powerpc/booke powerpc/include powerpc/mpc85xx powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 01:48:20 -0000 Author: jhibbits Date: Tue Apr 19 01:48:18 2016 New Revision: 298237 URL: https://svnweb.freebsd.org/changeset/base/298237 Log: Fix SMP booting for PowerPC Book-E Summary: PowerPC Book-E SMP is currently broken for unknown reasons. Pull in Semihalf changes made c2012 for e500mc/e5500, which enables booting SMP. This eliminates the shared software TLB1 table, replacing it with tlb1_read_entry() function. This does not yet support ePAPR SMP booting, and doesn't handle resetting CPUs already released (ePAPR boot releases APs to a spin loop waiting on a specific address). This will be addressed in the near future by using the MPIC to reset the AP into our own alternate boot address. This does include a change to the dpaa/dtsec(4) driver, to mark the portals as CPU-private. Test Plan: Tested on Amiga X5000/20 (P5020). Boots, prints the following messages: Adding CPU 0, pir=0, awake=1 Waking up CPU 1 (dev=1) Adding CPU 1, pir=20, awake=1 SMP: AP CPU #1 launched top(1) shows CPU1 active. Obtained from: Semihalf Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D5945 Modified: head/sys/dev/dpaa/portals_common.c head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/tlb.h head/sys/powerpc/mpc85xx/platform_mpc85xx.c head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/dev/dpaa/portals_common.c ============================================================================== --- head/sys/dev/dpaa/portals_common.c Tue Apr 19 01:25:35 2016 (r298236) +++ head/sys/dev/dpaa/portals_common.c Tue Apr 19 01:48:18 2016 (r298237) @@ -75,8 +75,6 @@ dpaa_portal_alloc_res(device_t dev, stru sc->sc_rres[0] = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->sc_rrid[0], rle->start + sc->sc_dp_pa, rle->end + sc->sc_dp_pa, rle->count, RF_ACTIVE); - pmap_change_attr((vm_offset_t)rman_get_bushandle(sc->sc_rres[0]), - rle->count, VM_MEMATTR_CACHEABLE); if (sc->sc_rres[0] == NULL) { device_printf(dev, "Could not allocate memory.\n"); return (ENXIO); Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Tue Apr 19 01:25:35 2016 (r298236) +++ head/sys/powerpc/booke/locore.S Tue Apr 19 01:48:18 2016 (r298237) @@ -104,6 +104,10 @@ __start: mtmsr %r3 isync +/* + * Initial HIDs configuration + */ +1: mfpvr %r3 rlwinm %r3, %r3, 16, 16, 31 @@ -161,7 +165,6 @@ __start: /* * Create temporary mapping in AS=1 and switch to it */ - addi %r3, %r29, 1 bl tlb1_temp_mapping_as1 mfmsr %r3 @@ -197,7 +200,7 @@ __start: lis %r3, KERNBASE@h ori %r3, %r3, KERNBASE@l /* EPN = KERNBASE */ #ifdef SMP - ori %r3, %r3, MAS2_M@l /* WIMGE = 0b00100 */ + ori %r3, %r3, (_TLB_ENTRY_SHARED | MAS2_M)@l /* WIMGE = 0b00100 */ #endif mtspr SPR_MAS2, %r3 isync @@ -295,21 +298,19 @@ done_mapping: __boot_page: bl 1f - .globl bp_ntlb1s -bp_ntlb1s: + .globl bp_trace +bp_trace: .long 0 - .globl bp_tlb1 -bp_tlb1: - .space 4 * 3 * 64 - - .globl bp_tlb1_end -bp_tlb1_end: + .globl bp_kernload +bp_kernload: + .long 0 /* * Initial configuration */ -1: mflr %r31 /* r31 hold the address of bp_ntlb1s */ +1: + mflr %r31 /* r31 hold the address of bp_trace */ /* Set HIDs */ mfpvr %r3 @@ -332,20 +333,7 @@ bp_tlb1_end: 3: mtspr SPR_HID0, %r4 isync -/* - * E500mc and E5500 do not have HID1 register, so skip HID1 setup on - * this core. - */ - cmpli 0, 0, %r3, FSL_E500mc - beq 1f - cmpli 0, 0, %r3, FSL_E5500 - beq 1f - lis %r3, HID1_E500_DEFAULT_SET@h - ori %r3, %r3, HID1_E500_DEFAULT_SET@l - mtspr SPR_HID1, %r3 - isync -1: /* Enable branch prediction */ li %r3, BUCSR_BPEN mtspr SPR_BUCSR, %r3 @@ -367,7 +355,7 @@ bp_tlb1_end: /* * Create temporary translation in AS=1 and switch to it */ - lwz %r3, 0(%r31) + bl tlb1_temp_mapping_as1 mfmsr %r3 @@ -388,39 +376,46 @@ bp_tlb1_end: /* * Setup final mapping in TLB1[1] and switch to it */ - lwz %r6, 0(%r31) - addi %r5, %r31, 4 - li %r4, 0 - -4: lis %r3, MAS0_TLBSEL1@h - rlwimi %r3, %r4, 16, 12, 15 + /* Final kernel mapping, map in 64 MB of RAM */ + lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ + li %r4, 0 /* Entry 0 */ + rlwimi %r3, %r4, 16, 4, 15 mtspr SPR_MAS0, %r3 isync - lwz %r3, 0(%r5) - mtspr SPR_MAS1, %r3 + + li %r3, (TLB_SIZE_64M << MAS1_TSIZE_SHIFT)@l + oris %r3, %r3, (MAS1_VALID | MAS1_IPROT)@h + mtspr SPR_MAS1, %r3 /* note TS was not filled, so it's TS=0 */ isync - lwz %r3, 4(%r5) + + lis %r3, KERNBASE@h + ori %r3, %r3, KERNBASE@l /* EPN = KERNBASE */ + ori %r3, %r3, (_TLB_ENTRY_SHARED | MAS2_M)@l /* WIMGE = 0b00100 */ mtspr SPR_MAS2, %r3 isync - lwz %r3, 8(%r5) + + /* Retrieve kernel load [physical] address from bp_kernload */ + bl 4f + .long bp_kernload + .long __boot_page +4: mflr %r3 + lwz %r4, 0(%r3) + lwz %r5, 4(%r3) + rlwinm %r3, %r3, 0, 0, 19 + sub %r4, %r4, %r5 /* offset of bp_kernload within __boot_page */ + lwzx %r3, %r4, %r3 + + /* Set RPN and protection */ + ori %r3, %r3, (MAS3_SX | MAS3_SW | MAS3_SR)@l mtspr SPR_MAS3, %r3 isync tlbwe isync msync - addi %r5, %r5, 12 - addi %r4, %r4, 1 - cmpw %r4, %r6 - blt 4b /* Switch to the final mapping */ bl 5f - .long __boot_page-. -5: mflr %r5 - lwz %r3,0(%r3) - add %r5,%r5,%r3 /* __boot_page in r5 */ - bl 6f -6: mflr %r3 +5: mflr %r3 rlwinm %r3, %r3, 0, 0xfff /* Offset from boot page start */ add %r3, %r3, %r5 /* Make this virtual address */ addi %r3, %r3, 32 @@ -449,6 +444,7 @@ bp_tlb1_end: 1: mflr %r1 lwz %r2,0(%r1) add %r1,%r1,%r2 + stw %r1, 0(%r1) addi %r1, %r1, (TMPSTACKSZ - 16) /* @@ -479,6 +475,7 @@ bp_tlb1_end: 6: b 6b #endif /* SMP */ +#if defined (BOOKE_E500) /* * Invalidate all entries in the given TLB. * @@ -508,7 +505,7 @@ tlb1_find_current: isync tlbsx 0, %r3 mfspr %r17, SPR_MAS0 - rlwinm %r29, %r17, 16, 20, 31 /* MAS0[ESEL] -> r29 */ + rlwinm %r29, %r17, 16, 26, 31 /* MAS0[ESEL] -> r29 */ /* Make sure we have IPROT set on the entry */ mfspr %r17, SPR_MAS1 @@ -541,14 +538,11 @@ tlb1_inval_entry: blr /* - * r3 entry of temp translation - * r29 entry of current translation - * r28 returns temp entry passed in r3 - * r4-r5 scratched + * r29 current entry number + * r28 returned temp entry + * r3-r5 scratched */ tlb1_temp_mapping_as1: - mr %r28, %r3 - /* Read our current translation */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ rlwimi %r3, %r29, 16, 10, 15 /* Select our current entry */ @@ -556,8 +550,14 @@ tlb1_temp_mapping_as1: isync tlbre - /* Prepare and write temp entry */ + /* + * Prepare and write temp entry + * + * FIXME this is not robust against overflow i.e. when the current + * entry is the last in TLB1 + */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ + addi %r28, %r29, 1 /* Use next entry. */ rlwimi %r3, %r28, 16, 10, 15 /* Select temp entry */ mtspr SPR_MAS0, %r3 isync @@ -640,8 +640,19 @@ zero_mas8: mtspr SPR_MAS8, %r20 isync blr +#endif #ifdef SMP +.globl __boot_tlb1 + /* + * The __boot_tlb1 table is used to hold BSP TLB1 entries + * marked with _TLB_ENTRY_SHARED flag during AP bootstrap. + * The BSP fills in the table in tlb_ap_prep() function. Next, + * AP loads its contents to TLB1 hardware in pmap_bootstrap_ap(). + */ +__boot_tlb1: + .space TLB1_MAX_ENTRIES * TLB_ENTRY_SIZE + __boot_page_padding: /* * Boot page needs to be exactly 4K, with the last word of this page @@ -779,14 +790,8 @@ ENTRY(dataloss_erratum_access) mtspr SPR_L1CSR1, %r11 isync - mflr %r9 - bl 1f - .long 2f-. -1: - mflr %r5 - lwz %r8, 0(%r5) - mtlr %r9 - add %r8, %r8, %r5 + lis %r8, 2f@h + ori %r8, %r8, 2f@l icbtls 0, 0, %r8 addi %r9, %r8, 64 Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Apr 19 01:25:35 2016 (r298236) +++ head/sys/powerpc/booke/pmap.c Tue Apr 19 01:48:18 2016 (r298237) @@ -110,10 +110,6 @@ extern unsigned char _end[]; extern uint32_t *bootinfo; -#ifdef SMP -extern uint32_t bp_ntlb1s; -#endif - vm_paddr_t kernload; vm_offset_t kernstart; vm_size_t kernsize; @@ -187,11 +183,6 @@ uint32_t tlb1_entries; #define TLB1_ENTRIES (tlb1_entries) #define TLB1_MAXENTRIES 64 -/* In-ram copy of the TLB1 */ -static tlb_entry_t tlb1[TLB1_MAXENTRIES]; - -/* Next free entry in the TLB1 */ -static unsigned int tlb1_idx; static vm_offset_t tlb1_map_base = VM_MAXUSER_ADDRESS + PAGE_SIZE; static tlbtid_t tid_alloc(struct pmap *); @@ -199,7 +190,8 @@ static void tid_flush(tlbtid_t tid); static void tlb_print_entry(int, uint32_t, uint32_t, uint32_t, uint32_t); -static void tlb1_write_entry(unsigned int); +static void tlb1_read_entry(tlb_entry_t *, unsigned int); +static void tlb1_write_entry(tlb_entry_t *, unsigned int); static int tlb1_iomapped(int, vm_paddr_t, vm_size_t, vm_offset_t *); static vm_size_t tlb1_mapin_region(vm_offset_t, vm_paddr_t, vm_size_t); @@ -271,6 +263,7 @@ static vm_offset_t ptbl_buf_pool_vabase; static struct ptbl_buf *ptbl_bufs; #ifdef SMP +extern tlb_entry_t __boot_tlb1[]; void pmap_bootstrap_ap(volatile uint32_t *); #endif @@ -1369,6 +1362,22 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset } #ifdef SMP + void +tlb1_ap_prep(void) +{ + tlb_entry_t *e, tmp; + unsigned int i; + + /* Prepare TLB1 image for AP processors */ + e = __boot_tlb1; + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(&tmp, i); + + if ((tmp.mas1 & MAS1_VALID) && (tmp.mas2 & _TLB_ENTRY_SHARED)) + memcpy(e++, &tmp, sizeof(tmp)); + } +} + void pmap_bootstrap_ap(volatile uint32_t *trcp __unused) { @@ -1376,15 +1385,15 @@ pmap_bootstrap_ap(volatile uint32_t *trc /* * Finish TLB1 configuration: the BSP already set up its TLB1 and we - * have the snapshot of its contents in the s/w tlb1[] table, so use - * these values directly to (re)program AP's TLB1 hardware. - */ - for (i = bp_ntlb1s; i < tlb1_idx; i++) { - /* Skip invalid entries */ - if (!(tlb1[i].mas1 & MAS1_VALID)) - continue; - - tlb1_write_entry(i); + * have the snapshot of its contents in the s/w __boot_tlb1[] table + * created by tlb1_ap_prep(), so use these values directly to + * (re)program AP's TLB1 hardware. + * + * Start at index 1 because index 0 has the kernel map. + */ + for (i = 1; i < TLB1_ENTRIES; i++) { + if (__boot_tlb1[i].mas1 & MAS1_VALID) + tlb1_write_entry(&__boot_tlb1[i], i); } set_mas4_defaults(); @@ -1429,14 +1438,16 @@ mmu_booke_extract(mmu_t mmu, pmap_t pmap static vm_paddr_t mmu_booke_kextract(mmu_t mmu, vm_offset_t va) { + tlb_entry_t e; int i; /* Check TLB1 mappings */ - for (i = 0; i < tlb1_idx; i++) { - if (!(tlb1[i].mas1 & MAS1_VALID)) + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(&e, i); + if (!(e.mas1 & MAS1_VALID)) continue; - if (va >= tlb1[i].virt && va < tlb1[i].virt + tlb1[i].size) - return (tlb1[i].phys + (va - tlb1[i].virt)); + if (va >= e.virt && va < e.virt + e.size) + return (e.phys + (va - e.virt)); } return (pte_vatopa(mmu, kernel_pmap, va)); @@ -2652,7 +2663,7 @@ mmu_booke_dev_direct_mapped(mmu_t mmu, v * This currently does not work for entries that * overlap TLB1 entries. */ - for (i = 0; i < tlb1_idx; i ++) { + for (i = 0; i < TLB1_ENTRIES; i ++) { if (tlb1_iomapped(i, pa, size, &va) == 0) return (0); } @@ -2692,28 +2703,36 @@ mmu_booke_dumpsys_unmap(mmu_t mmu, vm_pa vm_paddr_t ppa; vm_offset_t ofs; vm_size_t gran; + tlb_entry_t e; + int i; /* Minidumps are based on virtual memory addresses. */ /* Nothing to do... */ if (do_minidump) return; + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(&e, i); + if (!(e.mas1 & MAS1_VALID)) + break; + } + /* Raw physical memory dumps don't have a virtual address. */ - tlb1_idx--; - tlb1[tlb1_idx].mas1 = 0; - tlb1[tlb1_idx].mas2 = 0; - tlb1[tlb1_idx].mas3 = 0; - tlb1_write_entry(tlb1_idx); + i--; + e.mas1 = 0; + e.mas2 = 0; + e.mas3 = 0; + tlb1_write_entry(&e, i); gran = 256 * 1024 * 1024; ppa = pa & ~(gran - 1); ofs = pa - ppa; if (sz > (gran - ofs)) { - tlb1_idx--; - tlb1[tlb1_idx].mas1 = 0; - tlb1[tlb1_idx].mas2 = 0; - tlb1[tlb1_idx].mas3 = 0; - tlb1_write_entry(tlb1_idx); + i--; + e.mas1 = 0; + e.mas2 = 0; + e.mas3 = 0; + tlb1_write_entry(&e, i); } } @@ -2796,6 +2815,7 @@ mmu_booke_mapdev(mmu_t mmu, vm_paddr_t p static void * mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_size_t size, vm_memattr_t ma) { + tlb_entry_t e; void *res; uintptr_t va, tmpva; vm_size_t sz; @@ -2807,13 +2827,14 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd * requirement, but now only checks the easy case. */ if (ma == VM_MEMATTR_DEFAULT) { - for (i = 0; i < tlb1_idx; i++) { - if (!(tlb1[i].mas1 & MAS1_VALID)) + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(&e, i); + if (!(e.mas1 & MAS1_VALID)) continue; - if (pa >= tlb1[i].phys && - (pa + size) <= (tlb1[i].phys + tlb1[i].size)) - return (void *)(tlb1[i].virt + - (vm_offset_t)(pa - tlb1[i].phys)); + if (pa >= e.phys && + (pa + size) <= (e.phys + e.size)) + return (void *)(e.virt + + (vm_offset_t)(pa - e.phys)); } } @@ -2846,9 +2867,10 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd } while (va % sz != 0); } if (bootverbose) - printf("Wiring VA=%x to PA=%jx (size=%x), " - "using TLB1[%d]\n", va, (uintmax_t)pa, sz, tlb1_idx); - tlb1_set_entry(va, pa, sz, tlb_calc_wimg(pa, ma)); + printf("Wiring VA=%x to PA=%jx (size=%x)\n", + va, (uintmax_t)pa, sz); + tlb1_set_entry(va, pa, sz, + _TLB_ENTRY_SHARED | tlb_calc_wimg(pa, ma)); size -= sz; pa += sz; va += sz; @@ -2912,30 +2934,34 @@ mmu_booke_change_attr(mmu_t mmu, vm_offs vm_offset_t va; pte_t *pte; int i, j; + tlb_entry_t e; /* Check TLB1 mappings */ - for (i = 0; i < tlb1_idx; i++) { - if (!(tlb1[i].mas1 & MAS1_VALID)) + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(&e, i); + if (!(e.mas1 & MAS1_VALID)) continue; - if (addr >= tlb1[i].virt && addr < tlb1[i].virt + tlb1[i].size) + if (addr >= e.virt && addr < e.virt + e.size) break; } - if (i < tlb1_idx) { + if (i < TLB1_ENTRIES) { /* Only allow full mappings to be modified for now. */ /* Validate the range. */ - for (j = i, va = addr; va < addr + sz; va += tlb1[j].size, j++) { - if (va != tlb1[j].virt || (sz - (va - addr) < tlb1[j].size)) + for (j = i, va = addr; va < addr + sz; va += e.size, j++) { + tlb1_read_entry(&e, j); + if (va != e.virt || (sz - (va - addr) < e.size)) return (EINVAL); } - for (va = addr; va < addr + sz; va += tlb1[i].size, i++) { - tlb1[i].mas2 &= ~MAS2_WIMGE_MASK; - tlb1[i].mas2 |= tlb_calc_wimg(tlb1[i].phys, mode); + for (va = addr; va < addr + sz; va += e.size, i++) { + tlb1_read_entry(&e, i); + e.mas2 &= ~MAS2_WIMGE_MASK; + e.mas2 |= tlb_calc_wimg(e.phys, mode); /* * Write it out to the TLB. Should really re-sync with other * cores. */ - tlb1_write_entry(i); + tlb1_write_entry(&e, i); } return (0); } @@ -3118,12 +3144,48 @@ tlb0_print_tlbentries(void) * windows, other devices mappings. */ + /* + * Read an entry from given TLB1 slot. + */ +void +tlb1_read_entry(tlb_entry_t *entry, unsigned int slot) +{ + uint32_t mas0; + + KASSERT((entry != NULL), ("%s(): Entry is NULL!", __func__)); + + mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(slot); + mtspr(SPR_MAS0, mas0); + __asm __volatile("isync; tlbre"); + + entry->mas1 = mfspr(SPR_MAS1); + entry->mas2 = mfspr(SPR_MAS2); + entry->mas3 = mfspr(SPR_MAS3); + + switch ((mfpvr() >> 16) & 0xFFFF) { + case FSL_E500v2: + case FSL_E500mc: + case FSL_E5500: + entry->mas7 = mfspr(SPR_MAS7); + break; + default: + entry->mas7 = 0; + break; + } + + entry->virt = entry->mas2 & MAS2_EPN_MASK; + entry->phys = ((vm_paddr_t)(entry->mas7 & MAS7_RPN) << 32) | + (entry->mas3 & MAS3_RPN); + entry->size = + tsize2size((entry->mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT); +} + /* * Write given entry to TLB1 hardware. * Use 32 bit pa, clear 4 high-order bits of RPN (mas7). */ static void -tlb1_write_entry(unsigned int idx) +tlb1_write_entry(tlb_entry_t *e, unsigned int idx) { uint32_t mas0; @@ -3135,11 +3197,11 @@ tlb1_write_entry(unsigned int idx) mtspr(SPR_MAS0, mas0); __asm __volatile("isync"); - mtspr(SPR_MAS1, tlb1[idx].mas1); + mtspr(SPR_MAS1, e->mas1); __asm __volatile("isync"); - mtspr(SPR_MAS2, tlb1[idx].mas2); + mtspr(SPR_MAS2, e->mas2); __asm __volatile("isync"); - mtspr(SPR_MAS3, tlb1[idx].mas3); + mtspr(SPR_MAS3, e->mas3); __asm __volatile("isync"); switch ((mfpvr() >> 16) & 0xFFFF) { case FSL_E500mc: @@ -3148,7 +3210,7 @@ tlb1_write_entry(unsigned int idx) __asm __volatile("isync"); /* FALLTHROUGH */ case FSL_E500v2: - mtspr(SPR_MAS7, tlb1[idx].mas7); + mtspr(SPR_MAS7, e->mas7); __asm __volatile("isync"); break; default: @@ -3207,10 +3269,21 @@ int tlb1_set_entry(vm_offset_t va, vm_paddr_t pa, vm_size_t size, uint32_t flags) { + tlb_entry_t e; uint32_t ts, tid; int tsize, index; - index = atomic_fetchadd_int(&tlb1_idx, 1); + for (index = 0; index < TLB1_ENTRIES; index++) { + tlb1_read_entry(&e, index); + if ((e.mas1 & MAS1_VALID) == 0) + break; + /* Check if we're just updating the flags, and update them. */ + if (e.phys == pa && e.virt == va && e.size == size) { + e.mas2 = (va & MAS2_EPN_MASK) | flags; + tlb1_write_entry(&e, index); + return (0); + } + } if (index >= TLB1_ENTRIES) { printf("tlb1_set_entry: TLB1 full!\n"); return (-1); @@ -3223,23 +3296,18 @@ tlb1_set_entry(vm_offset_t va, vm_paddr_ /* XXX TS is hard coded to 0 for now as we only use single address space */ ts = (0 << MAS1_TS_SHIFT) & MAS1_TS_MASK; - /* - * Atomicity is preserved by the atomic increment above since nothing - * is ever removed from tlb1. - */ - - tlb1[index].phys = pa; - tlb1[index].virt = va; - tlb1[index].size = size; - tlb1[index].mas1 = MAS1_VALID | MAS1_IPROT | ts | tid; - tlb1[index].mas1 |= ((tsize << MAS1_TSIZE_SHIFT) & MAS1_TSIZE_MASK); - tlb1[index].mas2 = (va & MAS2_EPN_MASK) | flags; + e.phys = pa; + e.virt = va; + e.size = size; + e.mas1 = MAS1_VALID | MAS1_IPROT | ts | tid; + e.mas1 |= ((tsize << MAS1_TSIZE_SHIFT) & MAS1_TSIZE_MASK); + e.mas2 = (va & MAS2_EPN_MASK) | flags; /* Set supervisor RWX permission bits */ - tlb1[index].mas3 = (pa & MAS3_RPN) | MAS3_SR | MAS3_SW | MAS3_SX; - tlb1[index].mas7 = (pa >> 32) & MAS7_RPN; + e.mas3 = (pa & MAS3_RPN) | MAS3_SR | MAS3_SW | MAS3_SX; + e.mas7 = (pa >> 32) & MAS7_RPN; - tlb1_write_entry(index); + tlb1_write_entry(&e, index); /* * XXX in general TLB1 updates should be propagated between CPUs, @@ -3302,7 +3370,8 @@ tlb1_mapin_region(vm_offset_t va, vm_pad for (idx = 0; idx < nents; idx++) { pgsz = pgs[idx]; debugf("%u: %llx -> %x, size=%x\n", idx, pa, va, pgsz); - tlb1_set_entry(va, pa, pgsz, _TLB_ENTRY_MEM); + tlb1_set_entry(va, pa, pgsz, + _TLB_ENTRY_SHARED | _TLB_ENTRY_MEM); pa += pgsz; va += pgsz; } @@ -3326,9 +3395,6 @@ tlb1_init() { uint32_t mas0, mas1, mas2, mas3, mas7; uint32_t tsz; - int i; - - tlb1_idx = 1; tlb1_get_tlbconf(); @@ -3341,27 +3407,11 @@ tlb1_init() mas3 = mfspr(SPR_MAS3); mas7 = mfspr(SPR_MAS7); - tlb1[0].mas1 = mas1; - tlb1[0].mas2 = mfspr(SPR_MAS2); - tlb1[0].mas3 = mas3; - tlb1[0].mas7 = mas7; - tlb1[0].virt = mas2 & MAS2_EPN_MASK; - tlb1[0].phys = ((vm_paddr_t)(mas7 & MAS7_RPN) << 32) | + kernload = ((vm_paddr_t)(mas7 & MAS7_RPN) << 32) | (mas3 & MAS3_RPN); - kernload = tlb1[0].phys; - tsz = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; - tlb1[0].size = (tsz > 0) ? tsize2size(tsz) : 0; - kernsize += tlb1[0].size; - -#ifdef SMP - bp_ntlb1s = tlb1_idx; -#endif - - /* Purge the remaining entries */ - for (i = tlb1_idx; i < TLB1_ENTRIES; i++) - tlb1_write_entry(i); + kernsize += (tsz > 0) ? tsize2size(tsz) : 0; /* Setup TLB miss defaults */ set_mas4_defaults(); @@ -3373,15 +3423,17 @@ pmap_early_io_map(vm_paddr_t pa, vm_size vm_paddr_t pa_base; vm_offset_t va, sz; int i; + tlb_entry_t e; KASSERT(!pmap_bootstrapped, ("Do not use after PMAP is up!")); - for (i = 0; i < tlb1_idx; i++) { - if (!(tlb1[i].mas1 & MAS1_VALID)) + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(&e, i); + if (!(e.mas1 & MAS1_VALID)) continue; - if (pa >= tlb1[i].phys && (pa + size) <= - (tlb1[i].phys + tlb1[i].size)) - return (tlb1[i].virt + (pa - tlb1[i].phys)); + if (pa >= e.phys && (pa + size) <= + (e.phys + e.size)) + return (e.virt + (pa - e.phys)); } pa_base = rounddown(pa, PAGE_SIZE); @@ -3391,16 +3443,13 @@ pmap_early_io_map(vm_paddr_t pa, vm_size do { sz = 1 << (ilog2(size) & ~1); - tlb1_set_entry(tlb1_map_base, pa_base, sz, _TLB_ENTRY_IO); + tlb1_set_entry(tlb1_map_base, pa_base, sz, + _TLB_ENTRY_SHARED | _TLB_ENTRY_IO); size -= sz; pa_base += sz; tlb1_map_base += sz; } while (size > 0); -#ifdef SMP - bp_ntlb1s = tlb1_idx; -#endif - return (va); } @@ -3450,20 +3499,6 @@ tlb1_print_tlbentries(void) } /* - * Print out contents of the in-ram tlb1 table. - */ -void -tlb1_print_entries(void) -{ - int i; - - debugf("tlb1[] table entries:\n"); - for (i = 0; i < TLB1_ENTRIES; i++) - tlb_print_entry(i, tlb1[i].mas1, tlb1[i].mas2, tlb1[i].mas3, - tlb1[i].mas7); -} - -/* * Return 0 if the physical IO range is encompassed by one of the * the TLB1 entries, otherwise return related error code. */ @@ -3475,39 +3510,41 @@ tlb1_iomapped(int i, vm_paddr_t pa, vm_s vm_paddr_t pa_end; unsigned int entry_tsize; vm_size_t entry_size; + tlb_entry_t e; *va = (vm_offset_t)NULL; + tlb1_read_entry(&e, i); /* Skip invalid entries */ - if (!(tlb1[i].mas1 & MAS1_VALID)) + if (!(e.mas1 & MAS1_VALID)) return (EINVAL); /* * The entry must be cache-inhibited, guarded, and r/w * so it can function as an i/o page */ - prot = tlb1[i].mas2 & (MAS2_I | MAS2_G); + prot = e.mas2 & (MAS2_I | MAS2_G); if (prot != (MAS2_I | MAS2_G)) return (EPERM); - prot = tlb1[i].mas3 & (MAS3_SR | MAS3_SW); + prot = e.mas3 & (MAS3_SR | MAS3_SW); if (prot != (MAS3_SR | MAS3_SW)) return (EPERM); /* The address should be within the entry range. */ - entry_tsize = (tlb1[i].mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; + entry_tsize = (e.mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; KASSERT((entry_tsize), ("tlb1_iomapped: invalid entry tsize")); entry_size = tsize2size(entry_tsize); - pa_start = (((vm_paddr_t)tlb1[i].mas7 & MAS7_RPN) << 32) | - (tlb1[i].mas3 & MAS3_RPN); + pa_start = (((vm_paddr_t)e.mas7 & MAS7_RPN) << 32) | + (e.mas3 & MAS3_RPN); pa_end = pa_start + entry_size; if ((pa < pa_start) || ((pa + size) > pa_end)) return (ERANGE); /* Return virtual address of this mapping. */ - *va = (tlb1[i].mas2 & MAS2_EPN_MASK) + (pa - pa_start); + *va = (e.mas2 & MAS2_EPN_MASK) + (pa - pa_start); return (0); } Modified: head/sys/powerpc/include/tlb.h ============================================================================== --- head/sys/powerpc/include/tlb.h Tue Apr 19 01:25:35 2016 (r298236) +++ head/sys/powerpc/include/tlb.h Tue Apr 19 01:48:18 2016 (r298237) @@ -74,7 +74,7 @@ #define MAS2_M 0x00000004 #define MAS2_G 0x00000002 #define MAS2_E 0x00000001 -#define MAS2_WIMGE_MASK 0x0000001F +#define MAS2_WIMGE_MASK 0x0000007F #define MAS3_RPN 0xFFFFF000 #define MAS3_RPN_SHIFT 12 @@ -120,9 +120,17 @@ */ #define KERNEL_REGION_MAX_TLB_ENTRIES 4 +/* + * Use MAS2_X0 to mark entries which will be copied + * to AP CPUs during SMP bootstrap. As result entries + * marked with _TLB_ENTRY_SHARED will be shared by all CPUs. + */ +#define _TLB_ENTRY_SHARED (MAS2_X0) /* XXX under SMP? */ #define _TLB_ENTRY_IO (MAS2_I | MAS2_G) #define _TLB_ENTRY_MEM (MAS2_M) +#define TLB1_MAX_ENTRIES 64 + #if !defined(LOCORE) typedef struct tlb_entry { vm_paddr_t phys; @@ -211,6 +219,7 @@ struct pmap; void tlb_lock(uint32_t *); void tlb_unlock(uint32_t *); +void tlb1_ap_prep(void); int tlb1_set_entry(vm_offset_t, vm_paddr_t, vm_size_t, uint32_t); #endif /* !LOCORE */ Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Tue Apr 19 01:25:35 2016 (r298236) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Tue Apr 19 01:48:18 2016 (r298237) @@ -62,9 +62,7 @@ __FBSDID("$FreeBSD$"); extern void *ap_pcpu; extern vm_paddr_t kernload; /* Kernel physical load address */ extern uint8_t __boot_page[]; /* Boot page body */ -extern uint32_t bp_ntlb1s; -extern uint32_t bp_tlb1[]; -extern uint32_t bp_tlb1_end[]; +extern uint32_t bp_kernload; #endif extern uint32_t *bootinfo; @@ -321,10 +319,9 @@ static int mpc85xx_smp_start_cpu(platform_t plat, struct pcpu *pc) { #ifdef SMP - uint32_t *tlb1; vm_paddr_t bptr; uint32_t reg; - int i, timeout; + int timeout; uintptr_t brr; int cpuid; @@ -344,6 +341,7 @@ mpc85xx_smp_start_cpu(platform_t plat, s brr = OCP85XX_EEBPCR; cpuid = pc->pc_cpuid + 24; #endif + bp_kernload = kernload; reg = ccsr_read4(brr); if ((reg & (1 << cpuid)) != 0) { printf("SMP: CPU %d already out of hold-off state!\n", @@ -354,20 +352,6 @@ mpc85xx_smp_start_cpu(platform_t plat, s ap_pcpu = pc; __asm __volatile("msync; isync"); - i = 0; - tlb1 = bp_tlb1; - while (i < bp_ntlb1s && tlb1 < bp_tlb1_end) { - mtspr(SPR_MAS0, MAS0_TLBSEL(1) | MAS0_ESEL(i)); - __asm __volatile("isync; tlbre"); - tlb1[0] = mfspr(SPR_MAS1); - tlb1[1] = mfspr(SPR_MAS2); - tlb1[2] = mfspr(SPR_MAS3); - i++; - tlb1 += 3; - } - if (i < bp_ntlb1s) - bp_ntlb1s = i; - /* Flush caches to have our changes hit DRAM. */ cpu_flush_dcache(__boot_page, 4096); Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Tue Apr 19 01:25:35 2016 (r298236) +++ head/sys/powerpc/powerpc/genassym.c Tue Apr 19 01:48:18 2016 (r298237) @@ -125,7 +125,7 @@ ASSYM(PM_PDIR, offsetof(struct pmap, pm_ ASSYM(PTE_RPN, 0); ASSYM(PTE_FLAGS, sizeof(uint32_t)); #if defined(BOOKE_E500) -ASSYM(TLB0_ENTRY_SIZE, sizeof(struct tlb_entry)); +ASSYM(TLB_ENTRY_SIZE, sizeof(struct tlb_entry)); #endif #endif Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Tue Apr 19 01:25:35 2016 (r298236) +++ head/sys/powerpc/powerpc/mp_machdep.c Tue Apr 19 01:48:18 2016 (r298237) @@ -212,6 +212,9 @@ cpu_mp_unleash(void *dummy) cpus = 0; smp_cpus = 0; +#ifdef BOOKE + tlb1_ap_prep(); +#endif STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { cpus++; if (!pc->pc_bsp) { From owner-svn-src-all@freebsd.org Tue Apr 19 01:57:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF82FB12287; Tue, 19 Apr 2016 01:57:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACE911321; Tue, 19 Apr 2016 01:57:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J1vufA099008; Tue, 19 Apr 2016 01:57:56 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J1vuwE099007; Tue, 19 Apr 2016 01:57:56 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190157.u3J1vuwE099007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 01:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298238 - head/sbin/ping6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 01:57:58 -0000 Author: araujo Date: Tue Apr 19 01:57:56 2016 New Revision: 298238 URL: https://svnweb.freebsd.org/changeset/base/298238 Log: Use NULL instead of 0 for pointers. malloc will return NULL if it cannot allocate memory. MFC after: 2 weeks. Modified: head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Tue Apr 19 01:48:18 2016 (r298237) +++ head/sbin/ping6/ping6.c Tue Apr 19 01:57:56 2016 (r298238) @@ -863,7 +863,7 @@ main(int argc, char *argv[]) /* set IP6 packet options */ if (ip6optlen) { - if ((scmsg = (char *)malloc(ip6optlen)) == 0) + if ((scmsg = (char *)malloc(ip6optlen)) == NULL) errx(1, "can't allocate enough memory"); smsghdr.msg_control = (caddr_t)scmsg; smsghdr.msg_controllen = ip6optlen; From owner-svn-src-all@freebsd.org Tue Apr 19 01:59:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 399D1B123D3; Tue, 19 Apr 2016 01:59:27 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0161520; Tue, 19 Apr 2016 01:59:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J1xQ0e099099; Tue, 19 Apr 2016 01:59:26 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J1xQRC099098; Tue, 19 Apr 2016 01:59:26 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190159.u3J1xQRC099098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 01:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298239 - head/sbin/quotacheck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 01:59:27 -0000 Author: araujo Date: Tue Apr 19 01:59:26 2016 New Revision: 298239 URL: https://svnweb.freebsd.org/changeset/base/298239 Log: getfsent(3) will return NULL on EOF or error. MFC after: 2 weeks. Modified: head/sbin/quotacheck/preen.c Modified: head/sbin/quotacheck/preen.c ============================================================================== --- head/sbin/quotacheck/preen.c Tue Apr 19 01:57:56 2016 (r298238) +++ head/sbin/quotacheck/preen.c Tue Apr 19 01:59:26 2016 (r298239) @@ -105,7 +105,7 @@ checkfstab(int uflag, int gflag) warnx("Can't open checklist file: %s\n", _PATH_FSTAB); return (8); } - while ((fs = getfsent()) != 0) { + while ((fs = getfsent()) != NULL) { if (fs->fs_passno > passno && fs->fs_passno < nextpass) nextpass = fs->fs_passno; From owner-svn-src-all@freebsd.org Tue Apr 19 02:00:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAA28B12620; Tue, 19 Apr 2016 02:00:49 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A82DB180C; Tue, 19 Apr 2016 02:00:49 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J20m2p099215; Tue, 19 Apr 2016 02:00:48 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J20mfq099214; Tue, 19 Apr 2016 02:00:48 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190200.u3J20mfq099214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 02:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298240 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 02:00:50 -0000 Author: araujo Date: Tue Apr 19 02:00:48 2016 New Revision: 298240 URL: https://svnweb.freebsd.org/changeset/base/298240 Log: malloc will return NULL if it cannot allocate memory. MFC after: 2 weeks. Modified: head/sbin/restore/dirs.c Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Tue Apr 19 01:59:26 2016 (r298239) +++ head/sbin/restore/dirs.c Tue Apr 19 02:00:48 2016 (r298240) @@ -598,7 +598,7 @@ setdirmodes(int flags) if (bufsize < node.extsize) { if (bufsize > 0) free(buf); - if ((buf = malloc(node.extsize)) != 0) { + if ((buf = malloc(node.extsize)) != NULL) { bufsize = node.extsize; } else { bufsize = 0; From owner-svn-src-all@freebsd.org Tue Apr 19 02:05:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CB33B12881; Tue, 19 Apr 2016 02:05:33 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59F001D5D; Tue, 19 Apr 2016 02:05:33 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J25WiC002227; Tue, 19 Apr 2016 02:05:32 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J25Wpn002224; Tue, 19 Apr 2016 02:05:32 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190205.u3J25Wpn002224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 02:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298241 - head/usr.bin/lex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 02:05:33 -0000 Author: araujo Date: Tue Apr 19 02:05:32 2016 New Revision: 298241 URL: https://svnweb.freebsd.org/changeset/base/298241 Log: Use NULL instead of 0 for pointers. realloc will return NULL in case it cannot allocate memory. MFC after: 2 weeks. Modified: head/usr.bin/lex/initparse.c head/usr.bin/lex/initscan.c Modified: head/usr.bin/lex/initparse.c ============================================================================== --- head/usr.bin/lex/initparse.c Tue Apr 19 02:00:48 2016 (r298240) +++ head/usr.bin/lex/initparse.c Tue Apr 19 02:05:32 2016 (r298241) @@ -680,14 +680,14 @@ static int yygrowstack(YYSTACKDATA *data i = data->s_mark - data->s_base; newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return -1; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return -1; data->l_base = newvs; @@ -721,7 +721,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') Modified: head/usr.bin/lex/initscan.c ============================================================================== --- head/usr.bin/lex/initscan.c Tue Apr 19 02:00:48 2016 (r298240) +++ head/usr.bin/lex/initscan.c Tue Apr 19 02:05:32 2016 (r298241) @@ -3455,7 +3455,7 @@ YY_RULE_SETUP } nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ - if ( (nmdefptr = ndlookup( nmstr )) == 0 ) + if ( (nmdefptr = ndlookup( nmstr )) == NULL ) format_synerr( _( "undefined definition {%s}" ), nmstr ); From owner-svn-src-all@freebsd.org Tue Apr 19 02:06:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52074B12934; Tue, 19 Apr 2016 02:06:03 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22E3D1EC6; Tue, 19 Apr 2016 02:06:03 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J262Mp002288; Tue, 19 Apr 2016 02:06:02 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J2620l002287; Tue, 19 Apr 2016 02:06:02 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201604190206.u3J2620l002287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 19 Apr 2016 02:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298242 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 02:06:03 -0000 Author: allanjude Date: Tue Apr 19 02:06:02 2016 New Revision: 298242 URL: https://svnweb.freebsd.org/changeset/base/298242 Log: Unbreak the build if you enable WITH_NAND Followup to r298230 Submitted by: Nikolai Lifanov (original version) Sponsored by: ScaleEngine Inc. Modified: head/lib/libstand/nandfs.c Modified: head/lib/libstand/nandfs.c ============================================================================== --- head/lib/libstand/nandfs.c Tue Apr 19 02:05:32 2016 (r298241) +++ head/lib/libstand/nandfs.c Tue Apr 19 02:06:02 2016 (r298242) @@ -1024,7 +1024,7 @@ ioread(struct open_file *f, off_t pos, v buffer = malloc(nsec * bsize); - err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, pos, + err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, pos, 0, nsec * bsize, buffer, NULL); memcpy(buf, (void *)((uintptr_t)buffer + off), length); @@ -1045,7 +1045,7 @@ nandfs_probe_sectorsize(struct open_file for (i = 512; i < (16 * 1024); i <<= 1) { NANDFS_DEBUG("%d ", i); - err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0, i, + err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0, 0, i, buffer, NULL); if (err == 0) { From owner-svn-src-all@freebsd.org Tue Apr 19 02:15:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B8AFB12F2D for ; Tue, 19 Apr 2016 02:15:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm50-vm4.bullet.mail.bf1.yahoo.com (nm50-vm4.bullet.mail.bf1.yahoo.com [216.109.115.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E93D71752 for ; Tue, 19 Apr 2016 02:15:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461031790; bh=qyf0UKbGoAT1oAhZIwzMWgVrlFUrvjO4Js8MXqYu4Ow=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=F6GT5u+werAXGj6Alyomh38XoPnewjMaEZcE5oaxiVl8M7NkDPc6GKpLUvKPi/wiqkn8rzJDMv17sSEeqw33qjuSOS7UWDZywMiEUmk4Tgua3emCfp9DSVlnBZDnwFPtNW4nYw95Nv8+H75ySkbPsCEPBhq/RUr87EcfJxww8U2Bt3AMHSvY+NN9M4sUxYCa54WfBVFKaid28MBgNKWoLCzZkE0iD0ahr2ab4ug13BLk5hiXTV7lTjlB2mvma98EVUQ+uaBcJRazJFA76s9x/7YA5c/eaUfPZ7HPoSPqvxRo4BZHjfuSpdChSfxZUJBYSxTvqThfV/MOhenyjbG4fA== Received: from [98.139.170.178] by nm50.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 02:09:50 -0000 Received: from [98.139.213.14] by tm21.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 02:09:50 -0000 Received: from [127.0.0.1] by smtp114.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 02:09:50 -0000 X-Yahoo-Newman-Id: 462154.13896.bm@smtp114.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: dtWIEGoVM1lhc8kTK0pZoBnPLNrDxp75sHnSTzIAHMxdmKp vvVSNV1zS2qvdpuj.mjWFJF4eGM8uXIqkweYVJX6t4n9OvL6dhyI.cUMJobn sMmTzHQrfUaw6m_HXbbR1S23NMoPVwuB0ntfjHeMCmvkJA1knF2zY51A_sgD 0YJ7_XNTEAh2SeCTDPCEDoEadG6LeVQzQ_wziB1tyowRqU5N2UFk_PM.8scf RdjmlXGLyWndj2E9XTq7Cp8BqUDO0t5t8Jc6nh1NFZSrkKRI4W__SzT1oiiS b6YUhUIFnucX591NRy.L9FIT9BsslBaPi_ZPeVqay1ITvGIY8EmwFh2jY7QI zwwasAw_I64L9iRJjXh7OPxVWw6yRMIPKb7Ow3V7V6ykJGpbvV_MxBbJoV6p UU6UOKgmDW4dC8TMUs4YncFNoe4FMCt367rXPlGETTTgyppWHsj6vm51JXmr _7uBKnWBms3rpX8J4yOtna_OCIo_iSFhCTbhZcklrRtfUxDfFg0LQV15XazE CKtRPxqx41eSsIltRc04cQBpTA.hRNRt8 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298241 - head/usr.bin/lex To: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604190205.u3J25Wpn002224@repo.freebsd.org> From: Pedro Giffuni Message-ID: <5715936B.50807@FreeBSD.org> Date: Mon, 18 Apr 2016 21:09:47 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <201604190205.u3J25Wpn002224@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 02:15:58 -0000 On 04/18/16 21:05, Marcelo Araujo wrote: > Author: araujo > Date: Tue Apr 19 02:05:32 2016 > New Revision: 298241 > URL: https://svnweb.freebsd.org/changeset/base/298241 > > Log: > Use NULL instead of 0 for pointers. > > realloc will return NULL in case it cannot allocate memory. > > MFC after: 2 weeks. > > Modified: > head/usr.bin/lex/initparse.c > head/usr.bin/lex/initscan.c > Hmm ... These files are computer generated, we have to work out the issues with upstream (flex). Cheers, Pedro. From owner-svn-src-all@freebsd.org Tue Apr 19 02:39:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20A11B13B4A; Tue, 19 Apr 2016 02:39:46 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com [IPv6:2607:f8b0:4003:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA8701300; Tue, 19 Apr 2016 02:39:45 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-oi0-x22c.google.com with SMTP id r78so3016173oie.0; Mon, 18 Apr 2016 19:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc; bh=6oawHP6V5qiXBv+szPfrnrVL/MBPYwsV9xDKoC+PqEY=; b=X6DVn5gDB9Hc0qd4ehKcXTuZKX6JHLEqt1g0kOpvEzxio9cspno7uy6bHibx7jbDo2 593Ic6njRBX6zdSlC2lTYl5f+QZj3faZTYu1RzEH2siXJc6ZbvhVQlIp9mzUSkdvjIt1 4HcDB+xzwAJviTs10VM6rc92VDdMLFVqmsdIINjSugc4jBUyQDCBowHmu8eJame7ho4H anoSP9wLLan8S2r0EHLNET7PBu/ataSBtdM9IH86Osi1f8K+s7CYZhX4pSrb9EjCB+f1 5uYLUGTopcLS/WqXfDQEs4rz78KdiWraXMWd0DaVpkSP31gEgrGJp9Q87UlffNQrN3Jy fw8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=6oawHP6V5qiXBv+szPfrnrVL/MBPYwsV9xDKoC+PqEY=; b=Uw9/Sw0nx2GhQu1rDs962F7h45DF6aCEDdnkBoxI9OjpBF7nrVHx8GN2z9/1z0Fdsl 78ZjriqgLjUr9NxkvttnVZbIPWAPvMmdjdPREjCeGKelYB2s3t60J0UlstY3fFqobY4X vJh3UxyUavsWXS+WCle2G0pPbjyFdvTOfbJMQQCmbxoMas08/lsb+/fzQeav+lCir04f PV4beurnwfKxzo4WQdwzuHY4v97o9fjo+5LlWDjswYSnIGYxGBk3l7H5p51i84Dpskqa AlgzhIGEAAwS8sxTTgQ9kZwSicuNwVL8PG4tbA8NHDTnozSnVpHQPc4pc0kG9jNEI6dT Rmjg== X-Gm-Message-State: AOPr4FUM6exqJyXwaOc7F1/1dvypLUn2u+CaSEVA8S44nZ9QUuGBGardjWc2TfWb1O9F9r1It/v48NH377VuVA== MIME-Version: 1.0 X-Received: by 10.157.3.97 with SMTP id 88mr184391otv.137.1461033585029; Mon, 18 Apr 2016 19:39:45 -0700 (PDT) Received: by 10.182.156.65 with HTTP; Mon, 18 Apr 2016 19:39:44 -0700 (PDT) Received: by 10.182.156.65 with HTTP; Mon, 18 Apr 2016 19:39:44 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <5715936B.50807@FreeBSD.org> References: <201604190205.u3J25Wpn002224@repo.freebsd.org> <5715936B.50807@FreeBSD.org> Date: Tue, 19 Apr 2016 10:39:44 +0800 Message-ID: Subject: Re: svn commit: r298241 - head/usr.bin/lex From: Marcelo Araujo To: Pedro Giffuni Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, Marcelo Araujo , svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 02:39:46 -0000 Ok, gonna revert this commit! Thanks, On Apr 19, 2016 10:15 AM, "Pedro Giffuni" wrote: > > > On 04/18/16 21:05, Marcelo Araujo wrote: > >> Author: araujo >> Date: Tue Apr 19 02:05:32 2016 >> New Revision: 298241 >> URL: https://svnweb.freebsd.org/changeset/base/298241 >> >> Log: >> Use NULL instead of 0 for pointers. >> >> realloc will return NULL in case it cannot allocate memory. >> >> MFC after: 2 weeks. >> >> Modified: >> head/usr.bin/lex/initparse.c >> head/usr.bin/lex/initscan.c >> >> > Hmm ... > > These files are computer generated, we have to work out the issues with > upstream (flex). > > Cheers, > > Pedro. > From owner-svn-src-all@freebsd.org Tue Apr 19 02:41:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E81D1B13CEC for ; Tue, 19 Apr 2016 02:41:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm34-vm2.bullet.mail.bf1.yahoo.com (nm34-vm2.bullet.mail.bf1.yahoo.com [72.30.239.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A046B16BC for ; Tue, 19 Apr 2016 02:41:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461033714; bh=5j6YF/Dv2mCZCzB/s7ei2lFbktKfSp5SryWm54YaUm4=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=KPnvH6MjpfXV4QGggrxuLYdKjqjo/mjNA1dI7JIRnSQubqIxyF0snH7XLtwbtC5RSv3qxuzNw6YWQgAooVhlGxUIWaphUN8IafTXMhNdjzdQKPzO0qRGxuWek4DS/F5WhOC3a/9wiYh4HbuFs6NmSFOeZUy7UbhnA7eiJ8lv1RrzChmwO4WmcX/E1FIzxwFYbX6PuDnmZuDl1aXTMfK60Y+XHJ+6ORJegZw49fJDNYxDU0dUVpJoFBoJyIIWrxfmDg11vUOL92bjhzl3PFCQ8M6x4dC1CmTrsPUoBNWYbDLeGN3NXt/tmBLrqjhDtSYq4t1wVllG75fC5+ZINhdTVg== Received: from [98.139.170.181] by nm34.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 02:41:54 -0000 Received: from [98.139.211.194] by tm24.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 02:41:54 -0000 Received: from [127.0.0.1] by smtp203.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 02:41:54 -0000 X-Yahoo-Newman-Id: 491937.74354.bm@smtp203.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: scSIGQAVM1k3yFYQCorvzuNc15YVqnAypM5ip4EqUZUNWUv lwYjzS.UMjNFRIDcGOu6rTXgSrh7dZ0583oyF9mqvgDMUe78MzdMXs4EDn6f CEZAs3NwPK8D6URrrAylWClG_CvfvItM6L26guhQOmnR1as7wa5ri0zb7okz pf.g7OqvZ6Gn8lEpr.3b.qsTkRe5ET7PDLSGQpFU9KQRfd44rVsdprQJvjOP 32kfbR14hwyLDahaMxYE2hQpqfwdJhU6v44f_F4C1wzu1D7N9D0jEc9RKABs 7YyU4Bf8jlajgnEMA1yf8rN6ajZQ6v2iEo3nRBy1.D5_xbbvxexUFl5wXlMt WPcKPYjiqn7.UMlR4Ms3bmf7vKj8eii4Vh87cvvjAumXwHSkz1oyEZ22ZZY9 yd5kBDLPyhgNq9EZL02EwlUA7Kr7U4Vqsirg0MVIspMNyelaeHFLnQYyGf0D LlbxHqx2sOBcq1AhZaYgOtYvuO1zzxIPumyj.NZOopkEMWp1yvtJHe_dz5yp o80lzsMrF7qIOVabDV82eKeuDkylwoE7z X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298241 - head/usr.bin/lex To: araujo@FreeBSD.org References: <201604190205.u3J25Wpn002224@repo.freebsd.org> <5715936B.50807@FreeBSD.org> Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org From: Pedro Giffuni Message-ID: <57159AF3.6000306@FreeBSD.org> Date: Mon, 18 Apr 2016 21:41:55 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 02:41:57 -0000 No need.. it's done already.. I think. On 04/18/16 21:39, Marcelo Araujo wrote: > Ok, gonna revert this commit! > > Thanks, > > On Apr 19, 2016 10:15 AM, "Pedro Giffuni" > wrote: > > > > On 04/18/16 21:05, Marcelo Araujo wrote: > > Author: araujo > Date: Tue Apr 19 02:05:32 2016 > New Revision: 298241 > URL: https://svnweb.freebsd.org/changeset/base/298241 > > Log: > Use NULL instead of 0 for pointers. > > realloc will return NULL in case it cannot allocate memory. > > MFC after: 2 weeks. > > Modified: > head/usr.bin/lex/initparse.c > head/usr.bin/lex/initscan.c > > > Hmm ... > > These files are computer generated, we have to work out the issues with > upstream (flex). > > Cheers, > > Pedro. > From owner-svn-src-all@freebsd.org Tue Apr 19 02:59:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86C54B131D2; Tue, 19 Apr 2016 02:59:53 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72C371D56; Tue, 19 Apr 2016 02:59:53 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=62519 helo=[10.0.0.105]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1asDbj-000964-Ha; Mon, 18 Apr 2016 11:09:11 -0700 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: Devin Teske In-Reply-To: <57158BF3.3060605@freebsd.org> Date: Mon, 18 Apr 2016 19:59:51 -0700 Cc: Pedro Giffuni , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Devin Teske Message-Id: References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <84FB3FCC-4779-4ED1-B0A6-142C90D08EEF@freebsd.org> <5715848F.7020805@FreeBSD.org> <57158BF3.3060605@freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 02:59:53 -0000 > On Apr 18, 2016, at 6:37 PM, Allan Jude wrote: >=20 > On 2016-04-18 21:32, Devin Teske wrote: >>=20 >>> On Apr 18, 2016, at 6:06 PM, Pedro Giffuni wrote: >>>=20 >>>=20 >>>=20 >>> On 04/18/16 19:30, Devin Teske wrote: >>>>=20 >>>>=20 >>>>> On Apr 18, 2016, at 4:43 PM, Allan Jude >>>> > wrote: >>>>>=20 >>>>> On 2016-04-18 19:36, Adrian Chadd wrote: >>>>>> Someone pointed out how this bloats out memory requirement in = loader. >>>>>>=20 >>>>>> Did anyone check that? >>>>>>=20 >>>>>> -adrian >>>>>>=20 >>>>>=20 >>>>> I tested down to 128mb of ram in QEMU, booted from the installer = ISO, >>>>> did the install, and booted the installed system without issue. >>>>=20 >>>> Hmm. Would be nice if we could claim success under 64MB too. >>>> If you get the chance. >>>> How low can it go? >>>=20 >>> FWIW, The code review comments state: >>>=20 >>> >>>=20 >>> BTW: as mentioned in very beginning of this project, I'm reserving = fairly large chunk of memory (64MB) for loader and using same amount for = both BIOS/UEFI variants, default in freebsd is 3MB, eventually this = should be reviewed, but currently it will affect very small setups. >>>=20 >>> >>>=20 >>> I still think it's pretty cool, thanks to everyone involved. >>>=20 >>=20 >> Does anyone know what the original memory reservation amount was = before it was upped to 64MB? >>=20 >=20 > It was 3MB >=20 Next [possibly] dumb question(s). Is it easily tunable? If not, why not? What happens when we want to bump it further in the future? --=20 Devin= From owner-svn-src-all@freebsd.org Tue Apr 19 03:17:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9080B138B2; Tue, 19 Apr 2016 03:17:49 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 949291C26; Tue, 19 Apr 2016 03:17:49 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 2EC13D8CE; Tue, 19 Apr 2016 03:17:48 +0000 (UTC) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... To: Devin Teske References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <84FB3FCC-4779-4ED1-B0A6-142C90D08EEF@freebsd.org> <5715848F.7020805@FreeBSD.org> <57158BF3.3060605@freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <5715A35B.9070602@freebsd.org> Date: Mon, 18 Apr 2016 23:17:47 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 03:17:49 -0000 On 2016-04-18 22:59, Devin Teske wrote: > >> On Apr 18, 2016, at 6:37 PM, Allan Jude > > wrote: >> >> On 2016-04-18 21:32, Devin Teske wrote: >>> >>>> On Apr 18, 2016, at 6:06 PM, Pedro Giffuni >>> > wrote: >>>> >>>> >>>> >>>> On 04/18/16 19:30, Devin Teske wrote: >>>>> >>>>> >>>>>> On Apr 18, 2016, at 4:43 PM, Allan Jude >>>>> >>>>>> > wrote: >>>>>> >>>>>> On 2016-04-18 19:36, Adrian Chadd wrote: >>>>>>> Someone pointed out how this bloats out memory requirement in loader. >>>>>>> >>>>>>> Did anyone check that? >>>>>>> >>>>>>> -adrian >>>>>>> >>>>>> >>>>>> I tested down to 128mb of ram in QEMU, booted from the installer ISO, >>>>>> did the install, and booted the installed system without issue. >>>>> >>>>> Hmm. Would be nice if we could claim success under 64MB too. >>>>> If you get the chance. >>>>> How low can it go? >>>> >>>> FWIW, The code review comments state: >>>> >>>> >>>> >>>> BTW: as mentioned in very beginning of this project, I'm reserving >>>> fairly large chunk of memory (64MB) for loader and using same amount >>>> for both BIOS/UEFI variants, default in freebsd is 3MB, eventually >>>> this should be reviewed, but currently it will affect very small setups. >>>> >>>> >>>> >>>> I still think it's pretty cool, thanks to everyone involved. >>>> >>> >>> Does anyone know what the original memory reservation amount was >>> before it was upped to 64MB? >>> >> >> It was 3MB >> > > Next [possibly] dumb question(s). > > Is it easily tunable? > If not, why not? > What happens when we want to bump it further in the future? > -- > Devin So, the size of the heap, is a #define in sys/boot/{i386/libi386,pc98/libpc98}/biosmem.c sys/boot/efi/libefi/libefi.c It went from 3MB to 64MB The size of the block cache is set in each of the respective loaders with the call to bcache_init(). The size went from 16kb to 16mb. -- Allan Jude From owner-svn-src-all@freebsd.org Tue Apr 19 03:25:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70359B13E35; Tue, 19 Apr 2016 03:25:37 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E0B11331; Tue, 19 Apr 2016 03:25:37 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J3PacF026465; Tue, 19 Apr 2016 03:25:36 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J3PaNo026464; Tue, 19 Apr 2016 03:25:36 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201604190325.u3J3PaNo026464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 19 Apr 2016 03:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298243 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 03:25:37 -0000 Author: allanjude Date: Tue Apr 19 03:25:36 2016 New Revision: 298243 URL: https://svnweb.freebsd.org/changeset/base/298243 Log: Add a new installation type to bsdinstall/zfsboot: BIOS+UEFI Installs both pmbr+gptzfsboot as well as boot1.efifat in separate partitions The resulting system can be booted with either UEFI or BIOS/CSM. Preference is controlled by the user's firmware boot settings. This is now the default for zfsboot installs PR: 208629 Submitted by: Galael LAPLANCHE (original version) Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Tue Apr 19 02:06:02 2016 (r298242) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Tue Apr 19 03:25:36 2016 (r298243) @@ -112,7 +112,7 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_PARTITION_SCHEME:=} # -# Default partitioning scheme to use on disks +# Default boot type to use on disks # : ${ZFSBOOT_BOOT_TYPE:=} @@ -755,6 +755,21 @@ zfs_create_diskpart() esac # + # Enable boot pool if encryption is desired + # + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1 + + # + # ZFSBOOT_BOOT_POOL and BIOS+UEFI boot type are incompatible + # + if [ "$ZFSBOOT_BOOT_POOL" -a "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]; then + f_dprintf "$funcname: ZFSBOOT_BOOT_POOL is incompatible with BIOS+UEFI boot type" + msg_error="$msg_error: $funcname" f_show_err \ + "ZFSBOOT_BOOT_POOL is incompatible with BIOS+UEFI boot type" + return $FAILURE + fi + + # # Destroy whatever partition layout is currently on disk. # NOTE: `-F' required to destroy if partitions still exist. # NOTE: Failure is ok here, blank disk will have nothing to destroy. @@ -769,11 +784,6 @@ zfs_create_diskpart() f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk # - # Enable boot pool if encryption is desired - # - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1 - - # # Lay down the desired type of partition scheme # local setsize mbrindex align_small align_big @@ -813,7 +823,7 @@ zfs_create_diskpart() # # 2. Add small freebsd-boot or efi partition # - if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" ]; then + if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]; then f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ "$align_small" efiboot$index efi 800k $disk || @@ -821,26 +831,49 @@ zfs_create_diskpart() f_eval_catch $funcname gpart "$GPART_BOOTCODE_PARTONLY" \ /boot/boot1.efifat 1 $disk || return $FAILURE - else + fi + + if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]; then f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ "$align_small" gptboot$index freebsd-boot \ 512k $disk || return $FAILURE - f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ - /boot/pmbr /boot/gptzfsboot 1 $disk || - return $FAILURE + if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" ]; then + f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ + /boot/pmbr /boot/gptzfsboot 1 $disk || + return $FAILURE + else + f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ + /boot/pmbr /boot/gptzfsboot 2 $disk || + return $FAILURE + fi fi # NB: zpool will use the `zfs#' GPT labels - bootpart=p2 swappart=p2 targetpart=p2 - [ ${swapsize:-0} -gt 0 ] && targetpart=p3 + if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then + bootpart=p3 swappart=p4 targetpart=p4 + [ ${swapsize:-0} -gt 0 ] && targetpart=p5 + else + # Bootpart unused + bootpart=p3 swappart=p3 targetpart=p3 + [ ${swapsize:-0} -gt 0 ] && targetpart=p4 + fi + else + if [ "$ZFSBOOT_BOOT_POOL" ]; then + bootpart=p2 swappart=p3 targetpart=p3 + [ ${swapsize:-0} -gt 0 ] && targetpart=p4 + else + # Bootpart unused + bootpart=p2 swappart=p2 targetpart=p2 + [ ${swapsize:-0} -gt 0 ] && targetpart=p3 + fi + fi # # Prepare boot pool if enabled (e.g., for geli(8)) # if [ "$ZFSBOOT_BOOT_POOL" ]; then - bootpart=p2 swappart=p3 targetpart=p3 - [ ${swapsize:-0} -gt 0 ] && targetpart=p4 f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ "$align_big" boot$index freebsd-zfs \ @@ -1444,7 +1477,7 @@ f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" bootmethod=$( sysctl -n machdep.bootmethod ) f_dprintf "machdep.bootmethod=[%s]" "$bootmethod" if [ "$bootmethod" = "UEFI" ]; then - : ${ZFSBOOT_BOOT_TYPE:=UEFI} + : ${ZFSBOOT_BOOT_TYPE:=BIOS+UEFI} : ${ZFSBOOT_PARTITION_SCHEME:=GPT} else : ${ZFSBOOT_BOOT_TYPE:=BIOS} @@ -1574,6 +1607,9 @@ while :; do if [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" -a "$ZFSBOOT_BOOT_TYPE" = "BIOS" ]; then ZFSBOOT_PARTITION_SCHEME="GPT" ZFSBOOT_BOOT_TYPE="UEFI" + elif [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" -a "$ZFSBOOT_BOOT_TYPE" = "UEFI" ]; then + ZFSBOOT_PARTITION_SCHEME="GPT" + ZFSBOOT_BOOT_TYPE="BIOS+UEFI" elif [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" ]; then ZFSBOOT_PARTITION_SCHEME="MBR" ZFSBOOT_BOOT_TYPE="BIOS" From owner-svn-src-all@freebsd.org Tue Apr 19 03:43:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70E49B1432F; Tue, 19 Apr 2016 03:43:24 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 406A31D3D; Tue, 19 Apr 2016 03:43:23 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-252-92.lns20.per4.internode.on.net [121.45.252.92]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u3J3hBJt015178 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 18 Apr 2016 20:43:16 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r298204 - in head: lib/libdwarf lib/libelf lib/libelftc usr.bin/addr2line usr.bin/cxxfilt usr.bin/elfcopy usr.bin/nm usr.bin/readelf usr.bin/size usr.bin/strings To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604181313.u3IDDxsK064810@repo.freebsd.org> From: Julian Elischer Message-ID: <5715A949.1020100@freebsd.org> Date: Tue, 19 Apr 2016 11:43:05 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201604181313.u3IDDxsK064810@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 03:43:24 -0000 On 18/04/2016 9:13 PM, Ed Maste wrote: > Author: emaste > Date: Mon Apr 18 13:13:59 2016 > New Revision: 298204 > URL: https://svnweb.freebsd.org/changeset/base/298204 > > Log: > Replace ${CURDIR}/../.. with ${CURDIR:H:H} in elftoolchain and if the last component is '..' ? What our FreeBSD lacks are the $(abspath ... ) or $(realpath ...) operations from gnu make. Actually it lacks a LOT from gnu make. I'd love to see us import a lot of things from there that are genuinely useful (and a lot less cryptic). you could try make use of :tA in to make this more robust and useful. > > This produces a nicer path in debug info and build logs. > > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > > Modified: > head/lib/libdwarf/Makefile > head/lib/libelf/Makefile > head/lib/libelftc/Makefile > head/usr.bin/addr2line/Makefile > head/usr.bin/cxxfilt/Makefile > head/usr.bin/elfcopy/Makefile > head/usr.bin/nm/Makefile > head/usr.bin/readelf/Makefile > head/usr.bin/size/Makefile > head/usr.bin/strings/Makefile > > Modified: head/lib/libdwarf/Makefile > ============================================================================== > --- head/lib/libdwarf/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/lib/libdwarf/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -2,7 +2,7 @@ > .include > > PACKAGE=lib${LIB} > -TOP= ${.CURDIR}/../../contrib/elftoolchain > +TOP= ${.CURDIR:H:H}/contrib/elftoolchain > SRCDIR= ${TOP}/libdwarf > > .PATH: ${SRCDIR} > > Modified: head/lib/libelf/Makefile > ============================================================================== > --- head/lib/libelf/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/lib/libelf/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -5,7 +5,7 @@ SHLIBDIR?= /lib > > .include > > -TOP= ${.CURDIR}/../../contrib/elftoolchain > +TOP= ${.CURDIR:H:H}/contrib/elftoolchain > SRCDIR= ${TOP}/libelf > > .PATH: ${SRCDIR} > > Modified: head/lib/libelftc/Makefile > ============================================================================== > --- head/lib/libelftc/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/lib/libelftc/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -4,7 +4,7 @@ > PACKAGE=lib${LIB} > INTERNALLIB= > > -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain > +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain > > .PATH: ${ELFTCDIR}/libelftc > > > Modified: head/usr.bin/addr2line/Makefile > ============================================================================== > --- head/usr.bin/addr2line/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/usr.bin/addr2line/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -2,7 +2,7 @@ > > .include > > -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain > +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain > ADDR2LINEDIR= ${ELFTCDIR}/addr2line > > .PATH: ${ADDR2LINEDIR} > > Modified: head/usr.bin/cxxfilt/Makefile > ============================================================================== > --- head/usr.bin/cxxfilt/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/usr.bin/cxxfilt/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -2,7 +2,7 @@ > > .include > > -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain > +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain > SRCDIR= ${ELFTCDIR}/cxxfilt > > .PATH: ${SRCDIR} > > Modified: head/usr.bin/elfcopy/Makefile > ============================================================================== > --- head/usr.bin/elfcopy/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/usr.bin/elfcopy/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -2,7 +2,7 @@ > > .include > > -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain > +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain > ELFCOPYDIR= ${ELFTCDIR}/elfcopy > > .PATH: ${ELFCOPYDIR} > > Modified: head/usr.bin/nm/Makefile > ============================================================================== > --- head/usr.bin/nm/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/usr.bin/nm/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -2,7 +2,7 @@ > > .include > > -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain > +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain > NMDIR= ${ELFTCDIR}/nm > > .PATH: ${NMDIR} > > Modified: head/usr.bin/readelf/Makefile > ============================================================================== > --- head/usr.bin/readelf/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/usr.bin/readelf/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -1,6 +1,6 @@ > # $FreeBSD$ > > -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain > +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain > READELFDIR= ${ELFTCDIR}/readelf > > .PATH: ${READELFDIR} > > Modified: head/usr.bin/size/Makefile > ============================================================================== > --- head/usr.bin/size/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/usr.bin/size/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -2,7 +2,7 @@ > > .include > > -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain > +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain > SIZEDIR= ${ELFTCDIR}/size > > .PATH: ${SIZEDIR} > > Modified: head/usr.bin/strings/Makefile > ============================================================================== > --- head/usr.bin/strings/Makefile Mon Apr 18 11:39:41 2016 (r298203) > +++ head/usr.bin/strings/Makefile Mon Apr 18 13:13:59 2016 (r298204) > @@ -2,7 +2,7 @@ > > .include > > -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain > +ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain > > .PATH: ${ELFTCDIR}/strings > > > From owner-svn-src-all@freebsd.org Tue Apr 19 03:47:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E8B9B14402; Tue, 19 Apr 2016 03:47:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 054081F03; Tue, 19 Apr 2016 03:47:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id c20so2059203pfc.1; Mon, 18 Apr 2016 20:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8ChaDjT4Zd8IN17U8lVeH2+R4d2E7NjRiIyctu5q+OI=; b=vF4uIeDweGYdv9hCv/AfD61oV3zzpTSryWRqoYvZmzR2vxBhpB7+lE1BFAZmtkwKp0 fiGxumMcbStHcslWYKEMiTYFF/UTMwt/GNRGTAeQTc4efAeuu3HX/gEfKjiXKWSWu/xe ZqD4rrPoZzd+DHPG6Co2n4BgW5rEnoOihCVAx/z3C0eCIQZK3Me68wwzoAPizc/f5SEj xQlE0eNyNkcp0FKLG3lASrnX5K2jXBj0V7C64Yc4MvKqLIrR09zXYi4SzSazkqFc6Wmv h24oZLZ/QPLi2iTI+5N3MXo2flpN3NhTXFf8z1F7IS7cr8puUpYAploQbAY9Tp8w+Wd4 YewQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8ChaDjT4Zd8IN17U8lVeH2+R4d2E7NjRiIyctu5q+OI=; b=elgGt+MX12nOUi5rGiKnxai827w0pw5q/stNwjQ+r2v4xler5Vk0Ac5+uaxYhPLC/t aP5yAP0HRszT4MKOc9HWI4DR4saALxt1wAUFkpCGXcUJikThnRiuY1u7Orm8Rt+j8dq5 W0T7VumD6X0hRaayuER7gabo4vHrp4OHrIxdHNLuF/OH2ByVeBoUFT8A6OEvEMIickAa uGokdu5CgjQZECNRYRJE1e63Xuwzj8WH5D6rvvWtdiA+iDSPVSlBJksyJKgpM5B6Xek6 g6ccJE5zlZNhHCdi96cyCN4FproR4ae1jDLhTWZY1tiKGs4iOjn57Dh6QVbUaXnrByDr yIVQ== X-Gm-Message-State: AOPr4FVt7X/qtSh+QatoSgkFclxV0eP7LhClhnZrtSLU8n7zifOqTBBvGsj0KqxI0KIwLQ== X-Received: by 10.98.76.22 with SMTP id z22mr1022174pfa.78.1461037620460; Mon, 18 Apr 2016 20:47:00 -0700 (PDT) Received: from ?IPv6:2601:601:800:126d:5809:7708:b651:d864? ([2601:601:800:126d:5809:7708:b651:d864]) by smtp.gmail.com with ESMTPSA id 187sm9092990pff.66.2016.04.18.20.46.58 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Apr 2016 20:46:59 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298204 - in head: lib/libdwarf lib/libelf lib/libelftc usr.bin/addr2line usr.bin/cxxfilt usr.bin/elfcopy usr.bin/nm usr.bin/readelf usr.bin/size usr.bin/strings From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <5715A949.1020100@freebsd.org> Date: Mon, 18 Apr 2016 20:46:59 -0700 Cc: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2E536470-D205-458F-A5D8-687D4EB8883C@gmail.com> References: <201604181313.u3IDDxsK064810@repo.freebsd.org> <5715A949.1020100@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 03:47:01 -0000 > On Apr 18, 2016, at 20:43, Julian Elischer wrote: >=20 > On 18/04/2016 9:13 PM, Ed Maste wrote: >> Author: emaste >> Date: Mon Apr 18 13:13:59 2016 >> New Revision: 298204 >> URL: https://svnweb.freebsd.org/changeset/base/298204 >>=20 >> Log: >> Replace ${CURDIR}/../.. with ${CURDIR:H:H} in elftoolchain >=20 > and if the last component is '..' ? > What our FreeBSD lacks are the $(abspath ... ) or $(realpath ...) > operations from gnu make. Actually it lacks a LOT from gnu make. > I'd love to see us import a lot of things from there that are = genuinely useful (and a lot less cryptic). >=20 >=20 > you could try make use of :tA in to make this more robust and useful. Or use SRCTOP, which (by proxy) uses :tA. Thanks, -Ngie= From owner-svn-src-all@freebsd.org Tue Apr 19 04:28:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E898B14FE3; Tue, 19 Apr 2016 04:28:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F93A109B; Tue, 19 Apr 2016 04:28:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J4SPtI044553; Tue, 19 Apr 2016 04:28:25 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J4SP2w044552; Tue, 19 Apr 2016 04:28:25 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190428.u3J4SP2w044552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 04:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298244 - head/sbin/dumpon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 04:28:26 -0000 Author: araujo Date: Tue Apr 19 04:28:25 2016 New Revision: 298244 URL: https://svnweb.freebsd.org/changeset/base/298244 Log: Use nitems() instead of sizeof(name) / sizeof(*name). MFC after: 2 weeks. Modified: head/sbin/dumpon/dumpon.c Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Tue Apr 19 03:25:36 2016 (r298243) +++ head/sbin/dumpon/dumpon.c Tue Apr 19 04:28:25 2016 (r298244) @@ -72,7 +72,7 @@ static void check_size(int fd, const char *fn) { int name[] = { CTL_HW, HW_PHYSMEM }; - size_t namelen = sizeof(name) / sizeof(*name); + size_t namelen = nitems(name); unsigned long physmem; size_t len; off_t mediasize; From owner-svn-src-all@freebsd.org Tue Apr 19 04:37:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF728B1338A; Tue, 19 Apr 2016 04:37:18 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2D101763; Tue, 19 Apr 2016 04:37:18 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J4bHg3047806; Tue, 19 Apr 2016 04:37:17 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J4bHvI047805; Tue, 19 Apr 2016 04:37:17 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190437.u3J4bHvI047805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 04:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298245 - head/sbin/fdisk_pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 04:37:19 -0000 Author: araujo Date: Tue Apr 19 04:37:17 2016 New Revision: 298245 URL: https://svnweb.freebsd.org/changeset/base/298245 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/fdisk_pc98/fdisk.c Modified: head/sbin/fdisk_pc98/fdisk.c ============================================================================== --- head/sbin/fdisk_pc98/fdisk.c Tue Apr 19 04:28:25 2016 (r298244) +++ head/sbin/fdisk_pc98/fdisk.c Tue Apr 19 04:37:17 2016 (r298245) @@ -854,7 +854,7 @@ string(const char *str, char **ans) static const char * get_type(int type) { - int numentries = (sizeof(part_types)/sizeof(struct part_type)); + int numentries = (nitems(part_types)); int counter = 0; struct part_type *ptr = part_types; From owner-svn-src-all@freebsd.org Tue Apr 19 04:42:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6730B135B1; Tue, 19 Apr 2016 04:42:35 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED2C1B96; Tue, 19 Apr 2016 04:42:35 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J4gYVJ050606; Tue, 19 Apr 2016 04:42:34 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J4gY4T050604; Tue, 19 Apr 2016 04:42:34 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190442.u3J4gY4T050604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 04:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298246 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 04:42:35 -0000 Author: araujo Date: Tue Apr 19 04:42:34 2016 New Revision: 298246 URL: https://svnweb.freebsd.org/changeset/base/298246 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/ifconfig/ifbridge.c head/sbin/ifconfig/iflagg.c Modified: head/sbin/ifconfig/ifbridge.c ============================================================================== --- head/sbin/ifconfig/ifbridge.c Tue Apr 19 04:37:17 2016 (r298245) +++ head/sbin/ifconfig/ifbridge.c Tue Apr 19 04:42:34 2016 (r298246) @@ -185,22 +185,19 @@ bridge_interfaces(int s, const char *pre printf(" path cost %u", req->ifbr_path_cost); if (req->ifbr_ifsflags & IFBIF_STP) { - if (req->ifbr_proto < - sizeof(stpproto) / sizeof(stpproto[0])) + if (req->ifbr_proto < nitems(stpproto)) printf(" proto %s", stpproto[req->ifbr_proto]); else printf(" ", req->ifbr_proto); printf("\n%s", pad); - if (req->ifbr_role < - sizeof(stproles) / sizeof(stproles[0])) + if (req->ifbr_role < nitems(stproles)) printf("role %s", stproles[req->ifbr_role]); else printf("", req->ifbr_role); - if (req->ifbr_state < - sizeof(stpstates) / sizeof(stpstates[0])) + if (req->ifbr_state < nitems(stpstates)) printf(" state %s", stpstates[req->ifbr_state]); else printf(" ", Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Tue Apr 19 04:37:17 2016 (r298245) +++ head/sbin/ifconfig/iflagg.c Tue Apr 19 04:42:34 2016 (r298246) @@ -291,7 +291,7 @@ lagg_status(int s) if (0 /* XXX */) { printf("\tsupported aggregation protocols:\n"); - for (i = 0; i < (sizeof(lpr) / sizeof(lpr[0])); i++) + for (i = 0; i < nitems(lpr); i++) printf("\t\tlaggproto %s\n", lpr[i].lpr_name); } } From owner-svn-src-all@freebsd.org Tue Apr 19 04:46:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2951B1368D; Tue, 19 Apr 2016 04:46:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCFC31D8C; Tue, 19 Apr 2016 04:46:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J4kDit050781; Tue, 19 Apr 2016 04:46:13 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J4kD9G050780; Tue, 19 Apr 2016 04:46:13 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190446.u3J4kD9G050780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 04:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298247 - head/sbin/fdisk_pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 04:46:15 -0000 Author: araujo Date: Tue Apr 19 04:46:13 2016 New Revision: 298247 URL: https://svnweb.freebsd.org/changeset/base/298247 Log: Remove redundant parenthesis. Submitted by: pfg MFC after: 2 weeks. Modified: head/sbin/fdisk_pc98/fdisk.c Modified: head/sbin/fdisk_pc98/fdisk.c ============================================================================== --- head/sbin/fdisk_pc98/fdisk.c Tue Apr 19 04:42:34 2016 (r298246) +++ head/sbin/fdisk_pc98/fdisk.c Tue Apr 19 04:46:13 2016 (r298247) @@ -854,7 +854,7 @@ string(const char *str, char **ans) static const char * get_type(int type) { - int numentries = (nitems(part_types)); + int numentries = nitems(part_types); int counter = 0; struct part_type *ptr = part_types; From owner-svn-src-all@freebsd.org Tue Apr 19 04:52:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92F7FB1389A; Tue, 19 Apr 2016 04:52:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63C7A1077; Tue, 19 Apr 2016 04:52:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J4qD1O053606; Tue, 19 Apr 2016 04:52:13 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J4qDA7053605; Tue, 19 Apr 2016 04:52:13 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190452.u3J4qDA7053605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 04:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298248 - head/sbin/kldconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 04:52:14 -0000 Author: araujo Date: Tue Apr 19 04:52:13 2016 New Revision: 298248 URL: https://svnweb.freebsd.org/changeset/base/298248 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/kldconfig/kldconfig.c Modified: head/sbin/kldconfig/kldconfig.c ============================================================================== --- head/sbin/kldconfig/kldconfig.c Tue Apr 19 04:46:13 2016 (r298247) +++ head/sbin/kldconfig/kldconfig.c Tue Apr 19 04:52:13 2016 (r298248) @@ -85,7 +85,7 @@ getmib(void) if (miblen != 0) return; - miblen = sizeof(mib) / sizeof(mib[0]); + miblen = nitems(mib); if (sysctlnametomib(pathctl, mib, &miblen) != 0) err(1, "sysctlnametomib(%s)", pathctl); } From owner-svn-src-all@freebsd.org Tue Apr 19 04:52:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA28B13920; Tue, 19 Apr 2016 04:52:52 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D65112E7; Tue, 19 Apr 2016 04:52:52 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J4qp7k053674; Tue, 19 Apr 2016 04:52:51 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J4qpVI053673; Tue, 19 Apr 2016 04:52:51 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190452.u3J4qpVI053673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 04:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298249 - head/sbin/kldload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 04:52:52 -0000 Author: araujo Date: Tue Apr 19 04:52:51 2016 New Revision: 298249 URL: https://svnweb.freebsd.org/changeset/base/298249 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/kldload/kldload.c Modified: head/sbin/kldload/kldload.c ============================================================================== --- head/sbin/kldload/kldload.c Tue Apr 19 04:52:13 2016 (r298248) +++ head/sbin/kldload/kldload.c Tue Apr 19 04:52:51 2016 (r298249) @@ -74,7 +74,7 @@ path_check(const char *kldname, int quie dev = sb.st_dev; ino = sb.st_ino; - miblen = sizeof(mib) / sizeof(mib[0]); + miblen = nitems(mib); if (sysctlnametomib(PATHCTL, mib, &miblen) != 0) { err(1, "sysctlnametomib(%s)", PATHCTL); } From owner-svn-src-all@freebsd.org Tue Apr 19 04:57:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53263B13A17; Tue, 19 Apr 2016 04:57:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 202FA14E8; Tue, 19 Apr 2016 04:57:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J4vwYm053889; Tue, 19 Apr 2016 04:57:58 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J4vwfJ053887; Tue, 19 Apr 2016 04:57:58 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190457.u3J4vwfJ053887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 04:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298250 - in head/sbin: newfs_msdos newfs_nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 04:57:59 -0000 Author: araujo Date: Tue Apr 19 04:57:57 2016 New Revision: 298250 URL: https://svnweb.freebsd.org/changeset/base/298250 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/newfs_msdos/mkfs_msdos.c head/sbin/newfs_nandfs/newfs_nandfs.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Tue Apr 19 04:52:51 2016 (r298249) +++ head/sbin/newfs_msdos/mkfs_msdos.c Tue Apr 19 04:57:57 2016 (r298250) @@ -760,7 +760,7 @@ getstdfmt(const char *fmt, struct bpb *b { u_int x, i; - x = sizeof(stdfmt) / sizeof(stdfmt[0]); + x = nitems(stdfmt); for (i = 0; i < x && strcmp(fmt, stdfmt[i].name); i++); if (i == x) { warnx("%s: unknown standard format", fmt); Modified: head/sbin/newfs_nandfs/newfs_nandfs.c ============================================================================== --- head/sbin/newfs_nandfs/newfs_nandfs.c Tue Apr 19 04:52:51 2016 (r298249) +++ head/sbin/newfs_nandfs/newfs_nandfs.c Tue Apr 19 04:57:57 2016 (r298250) @@ -808,7 +808,7 @@ create_fs(void) char *data; int i; - nuserfiles = (sizeof(user_files) / sizeof(user_files[0])); + nuserfiles = nitems(user_files); /* Count and assign blocks */ count_seg_blocks(); From owner-svn-src-all@freebsd.org Tue Apr 19 04:58:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 938D4B13A3E for ; Tue, 19 Apr 2016 04:58:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm25-vm1.bullet.mail.bf1.yahoo.com (nm25-vm1.bullet.mail.bf1.yahoo.com [98.139.212.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3F31758 for ; Tue, 19 Apr 2016 04:58:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461041887; bh=n28csdQfzLA+/c3BwoSuvI4VGVNSulLaa0OqZimzBug=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=kE5YuczoTKJ7My9F2XbiEPLT9LGfrdIY66c9KoykUn582CvgvUrZK4ZASgnLUqqKBPxZ1+Bzh4HJu/wjWX7+YwYq1cfxnlu/TjgknYk4OEdZC3wqI0L+qrITDy0maMABLvTYwP+vYx0ffa9lqOdcE+S8mdlIP8y4JRZqv6XpmtcRKWyrOddJ1WaYJpmVafG0LdCqma1L+cKTtFYvG2K12fjn2E5kbNWAflbLUh8xYlNVuAyxP+rXacVhc3+sCMfG9lqPP1UWQdTFBxECj5hocC43o+YYDwapKbCMIoY/fFOSoOSNQcswVrEGe/EdAJled7LJM3tTUSkpDCZCkHWWkA== Received: from [98.139.215.142] by nm25.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 04:58:07 -0000 Received: from [98.139.211.198] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 04:58:07 -0000 Received: from [127.0.0.1] by smtp207.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 04:58:07 -0000 X-Yahoo-Newman-Id: 308820.84737.bm@smtp207.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: sQRoX.cVM1kpMbqdIK3ypXdra1ac6GSDX_Wbg6E83J0Ok6r 6l5mNCz71LWjmTz5GTis5hQrY4MLnyiwJdBDigH0ybPaQN1DxFA8qERQDOmw QjvBR5mz7deL7LRRSPcEb4uVtOR6B3td1Su6819lKz2FUQ3U4BNr6Cz4E6oe US25tFBhkfTwvBEY0LZ24cbdEMsGu.hNPuS8kDk3A3iSqDs6fobS6W5DA5FZ uVFgWbdMoYbJPrHhMDO249GRdbzWXKoNLyVG1KVKEenuRYnT7REOt__KftMm 8LAaNqJdgARARfZo9kPFhpR_esE2uslEvOH1IVPzkhQmD3NS_yb8B.bsm82F au7iqP1xWn6PdrM62eBrv2ejptXtGFG9gwEZz5_q0JNfN4m3q1NWaKdms2uu vB3J2m49VX2iktYgc0pBYRlbsMBhgKq7dAHOKssCz7sxKArTFvbCqyos5b2E q3C7lzf2_FFsWlWa5tqHB.J61cCd9DjozD8BgeChJXMmkNpzaZIBjJvmLl9F SSYFWJpeGy4sReKGYdTCzhH3UiwSyNBUe X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298244 - head/sbin/dumpon To: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604190428.u3J4SP2w044552@repo.freebsd.org> From: Pedro Giffuni Message-ID: <53a3202e-c144-b7d0-02f1-a7f4364d594e@FreeBSD.org> Date: Mon, 18 Apr 2016 23:58:08 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201604190428.u3J4SP2w044552@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 04:58:09 -0000 On 04/18/16 23:28, Marcelo Araujo wrote: > Author: araujo > Date: Tue Apr 19 04:28:25 2016 > New Revision: 298244 > URL: https://svnweb.freebsd.org/changeset/base/298244 > > Log: > Use nitems() instead of sizeof(name) / sizeof(*name). > > MFC after: 2 weeks. > FWIW, while I see why it makes sense to make these cosmetic changes, it's probably too much to MFC them. At least I have no plans to merge the ones I've made since they are non-functional. Pedro. From owner-svn-src-all@freebsd.org Tue Apr 19 05:01:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EA20B13B67; Tue, 19 Apr 2016 05:01:46 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-ob0-x233.google.com (mail-ob0-x233.google.com [IPv6:2607:f8b0:4003:c01::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53FAA1AEB; Tue, 19 Apr 2016 05:01:46 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-ob0-x233.google.com with SMTP id n10so2336326obb.2; Mon, 18 Apr 2016 22:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc; bh=igmR1dHo4+/yRHIZLh34nhQYIvHEwaA6WEY/CJ6eLFI=; b=Qax/3kxM9A25UVjVE4YOnQzXVHRpMnz/lg23ezpggdTPwczB1IasDLUHauLBFaBkU9 yJvPXzQkrP0qtxG+ydEpqOGBE0Os3KRVWd1pw8IM8dXdUhpaO9MtIzo9QPpiWQmFjGme xxS5vX1cAcb+6H6iZKmJlAGypGC/MwCPD5Su4omrdHZhjQeOb9ItCrRSWEApAjlKVh6E xuvAzuQU58Vl4rhmjwcXmrYdaqKfeutJUp/A2uYhWZOrtJ75opAtKY0kBMB0mmIj8nxo TImmuSqqgxLppdTgGodq/Tl9AKMhjy45uNiR2o2yn2XcKSHDfdBewNz/LGA13s27NOVk 1I6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=igmR1dHo4+/yRHIZLh34nhQYIvHEwaA6WEY/CJ6eLFI=; b=IeSTrXyher8mDTjeDphT0ZG/NWC0uTPlGF06JHJmHVMWh/PSsm+xNZAgxNZy+DfhCk bKThbPN4djQ65S3QLiKLr0FvoQ29iNDsBwC8orMdQ9pC7a6JbAYAr59INWsKnww3SQjO mbEb24tBmTM30kbHuqNpEgmmvTFjch0bddAkV/lRZ0Be3lFsrg98ia3rGywPp/VV8O4K +21fiNkxgaCGfh4dSIKTHOh9YNsQ6fciD/w1u72U1wWePaHT0XP7S8/H2nRUKD1O+nro XUdsTvaoRs0LD9l0NtsnIv0sIUKlAgcnQrFC1xoI83aUOBPE2MMbWOhDwWJWQkhEM4Ax oLow== X-Gm-Message-State: AOPr4FUlo/dvOswFIwZflauRT9llzZF3Js7nxDDveHExyk21ytGW+Z5zyfkPZp/2jXzDeoAMgv0S3xbH2G2j8A== MIME-Version: 1.0 X-Received: by 10.60.54.8 with SMTP id f8mr318498oep.31.1461042105669; Mon, 18 Apr 2016 22:01:45 -0700 (PDT) Received: by 10.182.156.65 with HTTP; Mon, 18 Apr 2016 22:01:45 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <53a3202e-c144-b7d0-02f1-a7f4364d594e@FreeBSD.org> References: <201604190428.u3J4SP2w044552@repo.freebsd.org> <53a3202e-c144-b7d0-02f1-a7f4364d594e@FreeBSD.org> Date: Tue, 19 Apr 2016 13:01:45 +0800 Message-ID: Subject: Re: svn commit: r298244 - head/sbin/dumpon From: Marcelo Araujo To: Pedro Giffuni Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 05:01:46 -0000 2016-04-19 12:58 GMT+08:00 Pedro Giffuni : > > > On 04/18/16 23:28, Marcelo Araujo wrote: > >> Author: araujo >> Date: Tue Apr 19 04:28:25 2016 >> New Revision: 298244 >> URL: https://svnweb.freebsd.org/changeset/base/298244 >> >> Log: >> Use nitems() instead of sizeof(name) / sizeof(*name). >> >> MFC after: 2 weeks. >> >> > FWIW, while I see why it makes sense to make these cosmetic > changes, it's probably too much to MFC them. > > At least I have no plans to merge the ones I've made since > they are non-functional. > > Pedro. > I was thinking to MFC it at once(less work)! As now I'm checking/committing one by one. Best, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Tue Apr 19 05:04:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5827B13CD4; Tue, 19 Apr 2016 05:04:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8799A1D97; Tue, 19 Apr 2016 05:04:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J54dYa056745; Tue, 19 Apr 2016 05:04:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J54dbX056743; Tue, 19 Apr 2016 05:04:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201604190504.u3J54dbX056743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 19 Apr 2016 05:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298251 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 05:04:40 -0000 Author: eadler Date: Tue Apr 19 05:04:39 2016 New Revision: 298251 URL: https://svnweb.freebsd.org/changeset/base/298251 Log: Remove pathnames.h - it only holds a single constant - it doesn't exist in the GNU variant Deleted: head/usr.bin/units/pathnames.h Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Tue Apr 19 04:57:57 2016 (r298250) +++ head/usr.bin/units/units.c Tue Apr 19 05:04:39 2016 (r298251) @@ -33,7 +33,7 @@ static const char rcsid[] = #include -#include "pathnames.h" +#define _PATH_UNITSLIB "/usr/share/misc/units.lib" #ifndef UNITSFILE #define UNITSFILE _PATH_UNITSLIB From owner-svn-src-all@freebsd.org Tue Apr 19 05:17:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D2E6B0208B; Tue, 19 Apr 2016 05:17:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15D45128D; Tue, 19 Apr 2016 05:17:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J5HhPx059790; Tue, 19 Apr 2016 05:17:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J5Hh8e059789; Tue, 19 Apr 2016 05:17:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604190517.u3J5Hh8e059789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 19 Apr 2016 05:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298252 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 05:17:44 -0000 Author: adrian Date: Tue Apr 19 05:17:43 2016 New Revision: 298252 URL: https://svnweb.freebsd.org/changeset/base/298252 Log: Add VHT power envelope parsing to ifconfig. Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Apr 19 05:04:39 2016 (r298251) +++ head/sbin/ifconfig/ifieee80211.c Tue Apr 19 05:17:43 2016 (r298252) @@ -2573,6 +2573,39 @@ printvhtinfo(const char *tag, const u_in } static void +printvhtpwrenv(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) +{ + printf("%s", tag); + static const char *txpwrmap[] = { + "20", + "40", + "80", + "160", + }; + if (verbose) { + const struct ieee80211_ie_vht_txpwrenv *vhtpwr = + (const struct ieee80211_ie_vht_txpwrenv *) ie; + int i, n; + const char *sep = ""; + + /* Get count; trim at ielen */ + n = (vhtpwr->tx_info & + IEEE80211_VHT_TXPWRENV_INFO_COUNT_MASK) + 1; + /* Trim at ielen */ + if (n > ielen - 3) + n = ielen - 3; + printf("tx_info); + for (i = 0; i < n; i++) { + printf("%s%s:%.2f", sep, txpwrmap[i], + ((float) ((int8_t) ie[i+3])) / 2.0); + sep = " "; + } + + printf("]>"); + } +} + +static void printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) { printf("%s", tag); @@ -3151,7 +3184,6 @@ iename(int elemid) case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS"; case IEEE80211_ELEMID_TPC: return " TPC"; case IEEE80211_ELEMID_CCKM: return " CCKM"; - case IEEE80211_ELEMID_VHT_PWR_ENV: return " VHTPWRENV"; } return " ???"; } @@ -3222,6 +3254,9 @@ printies(const u_int8_t *vp, int ielen, case IEEE80211_ELEMID_VHT_OPMODE: printvhtinfo(" VHTOPMODE", vp, 2+vp[1], maxcols); break; + case IEEE80211_ELEMID_VHT_PWR_ENV: + printvhtpwrenv(" VHTPWRENV", vp, 2+vp[1], maxcols); + break; case IEEE80211_ELEMID_BSSLOAD: printbssload(" BSSLOAD", vp, 2+vp[1], maxcols); break; From owner-svn-src-all@freebsd.org Tue Apr 19 05:18:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B073CB020F8; Tue, 19 Apr 2016 05:18:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7327D13E5; Tue, 19 Apr 2016 05:18:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J5Hxju059844; Tue, 19 Apr 2016 05:17:59 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J5Hxm9059841; Tue, 19 Apr 2016 05:17:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201604190517.u3J5Hxm9059841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 19 Apr 2016 05:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298253 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 05:18:00 -0000 Author: eadler Date: Tue Apr 19 05:17:59 2016 New Revision: 298253 URL: https://svnweb.freebsd.org/changeset/base/298253 Log: Rename units.lib -> definitions.units - this matches GNU units 2.12 add ISO country codes from units 2.12 Added: head/usr.bin/units/definitions.units - copied, changed from r298252, head/usr.bin/units/units.lib Deleted: head/usr.bin/units/units.lib Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Copied and modified: head/usr.bin/units/definitions.units (from r298252, head/usr.bin/units/units.lib) ============================================================================== --- head/usr.bin/units/units.lib Tue Apr 19 05:17:43 2016 (r298252, copy source) +++ head/usr.bin/units/definitions.units Tue Apr 19 05:17:59 2016 (r298253) @@ -363,6 +363,170 @@ lithuanianlitas 1|3.45280 euro pacificfrancexchange 1|0.00838 euro westafricancfafranc 1|655.957 euro +# ISO Currency Codes + +AED uaedirham +AFN afghanafghani +ALL albanialek +AMD armeniadram +AOA angolakwanza +ARS argentinapeso +AUD australiadollar +AWG arubaflorin +AZN azerbaijanmanat +BAM bosniaconvertiblemark +BBD barbadosdollar +BDT bangladeshtaka +BGN bulgarialev +BHD bahraindinar +BIF burundifranc +BMD bermudadollar +BND bruneidollar +BOB boliviaboliviano +BRL brazilreal +BSD bahamasdollar +BTN bhutanngultrum +BWP botswanapula +BYR belarusruble +BZD belizedollar +CAD canadadollar +CDF drcfranccongolais +CHF swissfranc +CLP chilepeso +CMG sintmaartencaribbeanguilder +CNY chinayuan +COP colombiapeso +CRC costaricacolon +CUP cubapeso +CVE capeverdeescudo +CZK czechkoruna +DJF djiboutifranc +DKK denmarkkrona +DOP dominicanrepublicpeso +DZD algeriadinar +EGP egyptpound +ERN eritreanakfa +ETB ethiopianbirr +EUR euro +FJD fijidollar +FKP falklandislandspound +GBP ukpound +GEL georgialari +GGP guernseypound +GHS ghanacedi +GIP gibraltarpound +GMD gambiadalasi +GNF guineafranc +GTQ guatemalaquetzal +GYD guyanadollar +HKD hongkongdollar +HNL honduraslempira +HRK croatiakuna +HTG haitigourde +HUF hungariaforint +IDR indonesiarupiah +ILS israelnewshekel +IMP manxpound +INR indiarupee +IQD iraqdinar +IRR iranrial +ISK icelandkrona +JEP jerseypound +JMD jamaicadollar +JOD jordandinar +JPY japanyen +KES kenyaschilling +KGS kyrgyzstansom +KHR cambodiariel +KMF comorosfranc +KPW northkoreawon +KRW southkoreawon +KWD kuwaitdinar +KYD caymanislandsdollar +KZT kazakhstantenge +LAK laokip +LBP lebanonpound +LKR srilankanrupee +LRD liberiadollar +LTL lithuanialita +LVL latvialat +LYD libyadinar +MAD moroccodirham +MDL moldovaleu +MGA madagascarariary +MKD macedoniadenar +MMK myanmarkyat +MNT mongoliatugrik +MOP macaupataca +MRO mauritaniaouguiya +MUR mauritiusrupee +MVR maldiverufiyaa +MWK malawikwacha +MXN mexicopeso +MYR malaysiaringgit +MZN mozambicanmetical +NAD namibiadollar +NGN nigerianaira +NIO nicaraguacordobaoro +NOK norwaykrone +NPR nepalrupee +NZD newzealanddollar +OMR omanrial +PAB panamabalboa +PEN perunuevosol +PGK papuanewguineakina +PHP philippinepeso +PKR pakistanrupee +PLN polandzloty +PYG paraguayguarani +QAR qatarrial +RON romanianewlei +RSD serbiadinar +RUB russiarouble +RWF rwandafranc +SAR saudiarabiariyal +SBD solomonislandsdollar +SCR seychellesrupee +SDG sudanpound +SEK swedenkrona +SGD singaporedollar +SHP sainthelenapound +SLL sierraleoneleone +SOS somaliaschilling +SRD surinamedollar +STD saotome&principedobra +SVC elsalvadorcolon +SYP syriapound +SZL swazilandlilangeni +THB thailandbaht +TJS tajikistansomoni +TMT turkmenistanmanat +TND tunisiadinar +TOP tongapa'anga +TRY turkeylira +TTD trinidadandtobagodollar +TVD tuvaludollar +TWD taiwandollar +TZS tanzaniashilling +UAH ukrainehryvnia +UGX ugandaschilling +USD usdollar +UYU uruguaypeso +UZS uzbekistansum +VEF venezuelabolivar +VND vietnamdong +VUV vanuatuvatu +WST samoatala +XAF centralafricancfafranc +XCD eastcaribbeandollar +XDR specialdrawingrights +XOF westafricanfranc +XPF cfpfranc +YER yemenrial +ZAR southafricarand +ZMW zambiakwacha +ZWL zimbabwedollar + # These ones are pegged on the US Dollar # See http://en.wikipedia.org/wiki/USD for details. dollar usdollar Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Tue Apr 19 05:17:43 2016 (r298252) +++ head/usr.bin/units/units.1 Tue Apr 19 05:17:59 2016 (r298253) @@ -177,8 +177,8 @@ units. .It "mile 5280 ft" .El .Sh FILES -.Bl -tag -width /usr/share/misc/units.lib -compact -.It Pa /usr/share/misc/units.lib +.Bl -tag -width /usr/share/misc/definitions.units -compact +.It Pa /usr/share/misc/definitions.units the standard units library .El .Sh AUTHORS Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Tue Apr 19 05:17:43 2016 (r298252) +++ head/usr.bin/units/units.c Tue Apr 19 05:17:59 2016 (r298253) @@ -33,7 +33,7 @@ static const char rcsid[] = #include -#define _PATH_UNITSLIB "/usr/share/misc/units.lib" +#define _PATH_UNITSLIB "/usr/share/misc/definitions.units" #ifndef UNITSFILE #define UNITSFILE _PATH_UNITSLIB From owner-svn-src-all@freebsd.org Tue Apr 19 05:18:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6AA4B02152; Tue, 19 Apr 2016 05:18:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A97E916BC; Tue, 19 Apr 2016 05:18:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J5ICYp059898; Tue, 19 Apr 2016 05:18:12 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J5ICHK059897; Tue, 19 Apr 2016 05:18:12 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201604190518.u3J5ICHK059897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 19 Apr 2016 05:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298254 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 05:18:13 -0000 Author: eadler Date: Tue Apr 19 05:18:12 2016 New Revision: 298254 URL: https://svnweb.freebsd.org/changeset/base/298254 Log: Rename units.lib -> definitions.units - this matches GNU units 2.12 add ISO country codes from units 2.12 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Apr 19 05:17:59 2016 (r298253) +++ head/ObsoleteFiles.inc Tue Apr 19 05:18:12 2016 (r298254) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160419: rename units.lib -> definitions.units +OLD_FILES+=usr/share/misc/units.lib # 20160419: remove Big5HKSCS locales OLD_FILES+=usr/share/locale/zh_HK.Big5HKSCS/LC_COLLATE OLD_FILES+=usr/share/locale/zh_HK.Big5HKSCS/LC_CTYPE From owner-svn-src-all@freebsd.org Tue Apr 19 06:32:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33709B13F25; Tue, 19 Apr 2016 06:32:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF7BA16CC; Tue, 19 Apr 2016 06:32:36 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J6Wau1083731; Tue, 19 Apr 2016 06:32:36 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J6WaeJ083730; Tue, 19 Apr 2016 06:32:36 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190632.u3J6WaeJ083730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 06:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298255 - head/sbin/pfctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 06:32:37 -0000 Author: araujo Date: Tue Apr 19 06:32:35 2016 New Revision: 298255 URL: https://svnweb.freebsd.org/changeset/base/298255 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/pfctl/pfctl_parser.c Modified: head/sbin/pfctl/pfctl_parser.c ============================================================================== --- head/sbin/pfctl/pfctl_parser.c Tue Apr 19 05:18:12 2016 (r298254) +++ head/sbin/pfctl/pfctl_parser.c Tue Apr 19 06:32:35 2016 (r298255) @@ -213,14 +213,12 @@ geticmptypebynumber(u_int8_t type, sa_fa unsigned int i; if (af != AF_INET6) { - for (i=0; i < (sizeof (icmp_type) / sizeof(icmp_type[0])); - i++) { + for (i=0; i < nitems(icmp_type); i++) { if (type == icmp_type[i].type) return (&icmp_type[i]); } } else { - for (i=0; i < (sizeof (icmp6_type) / - sizeof(icmp6_type[0])); i++) { + for (i=0; i < nitems(icmp6_type); i++) { if (type == icmp6_type[i].type) return (&icmp6_type[i]); } @@ -234,14 +232,12 @@ geticmptypebyname(char *w, sa_family_t a unsigned int i; if (af != AF_INET6) { - for (i=0; i < (sizeof (icmp_type) / sizeof(icmp_type[0])); - i++) { + for (i=0; i < nitems(icmp_type); i++) { if (!strcmp(w, icmp_type[i].name)) return (&icmp_type[i]); } } else { - for (i=0; i < (sizeof (icmp6_type) / - sizeof(icmp6_type[0])); i++) { + for (i=0; i < nitems(icmp6_type); i++) { if (!strcmp(w, icmp6_type[i].name)) return (&icmp6_type[i]); } @@ -255,15 +251,13 @@ geticmpcodebynumber(u_int8_t type, u_int unsigned int i; if (af != AF_INET6) { - for (i=0; i < (sizeof (icmp_code) / sizeof(icmp_code[0])); - i++) { + for (i=0; i < nitems(icmp_code); i++) { if (type == icmp_code[i].type && code == icmp_code[i].code) return (&icmp_code[i]); } } else { - for (i=0; i < (sizeof (icmp6_code) / - sizeof(icmp6_code[0])); i++) { + for (i=0; i < nitems(icmp6_code); i++) { if (type == icmp6_code[i].type && code == icmp6_code[i].code) return (&icmp6_code[i]); @@ -278,15 +272,13 @@ geticmpcodebyname(u_long type, char *w, unsigned int i; if (af != AF_INET6) { - for (i=0; i < (sizeof (icmp_code) / sizeof(icmp_code[0])); - i++) { + for (i=0; i < nitems(icmp_code); i++) { if (type == icmp_code[i].type && !strcmp(w, icmp_code[i].name)) return (&icmp_code[i]); } } else { - for (i=0; i < (sizeof (icmp6_code) / - sizeof(icmp6_code[0])); i++) { + for (i=0; i < nitems(icmp6_code); i++) { if (type == icmp6_code[i].type && !strcmp(w, icmp6_code[i].name)) return (&icmp6_code[i]); From owner-svn-src-all@freebsd.org Tue Apr 19 06:34:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D56C2B14014; Tue, 19 Apr 2016 06:34:32 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2DF41894; Tue, 19 Apr 2016 06:34:32 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J6YV8t083847; Tue, 19 Apr 2016 06:34:31 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J6YVvl083846; Tue, 19 Apr 2016 06:34:31 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190634.u3J6YVvl083846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 06:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298256 - head/sbin/ping6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 06:34:32 -0000 Author: araujo Date: Tue Apr 19 06:34:31 2016 New Revision: 298256 URL: https://svnweb.freebsd.org/changeset/base/298256 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Tue Apr 19 06:32:35 2016 (r298255) +++ head/sbin/ping6/ping6.c Tue Apr 19 06:34:31 2016 (r298256) @@ -2495,7 +2495,7 @@ pr_icmph(struct icmp6_hdr *icp, u_char * break; } if (options & F_VERBOSE) { - if (ni->ni_code > sizeof(nircode) / sizeof(nircode[0])) + if (ni->ni_code > nitems(nircode)) printf(", invalid"); else printf(", %s", nircode[ni->ni_code]); From owner-svn-src-all@freebsd.org Tue Apr 19 06:54:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9D31B14699 for ; Tue, 19 Apr 2016 06:54:11 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 673D01186 for ; Tue, 19 Apr 2016 06:54:11 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22e.google.com with SMTP id u206so12385973wme.1 for ; Mon, 18 Apr 2016 23:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=GN52DM9fML5+aU4RmAfwPJogjNdTzcSUcHXp/Qu4eyg=; b=AJPWGSsk0pW/VQQZvtvSO/zflBnoPrxUZRuHbdZqJFpKgB72OGsKWOHmNzG0r67Van O/ZXfGWppnv4WHTJ8wnpETLxQ6WSTODam+eeSw7CEEqprPmMs3v0yHuFNo5EN0cDbUyQ XqHy5u00jzPwiCqQ9JhbvtXnQW570zWgI3P0F9LWd0wnzGZu2nNGss52dBEmtKbcSB6S cLwAdTHkLIAPslfKVNvVeVUGzXwRIhNT6xtKGshXu3sx7R9JtWCQuWI1ansH++Sqvn7v cj2vzImg1QOH/xxXN5vhKzdNPmyA3hIIcHuWa7t178Hug9JlyUqAudWrAmqchWFPnFNN oiVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=GN52DM9fML5+aU4RmAfwPJogjNdTzcSUcHXp/Qu4eyg=; b=WF0fnTBM84BVjNM5bfog3V5lwlNVR946yYfH19wu9+T2VVGy7o+AsnGXdni5c6guvv /pofhZYUy6ifakTSiPSMWlpJ6gt92J9FJ5F2cMFMB9bGsaaHzxaElMqfI0rZDBCXrk+B fq0kOa3L+noQYUsqYH48380VNUBxgXSmAlJodIZomrHu5RmkgXetjAhF5Sd9qsIg/+EC i0PEo9Y67VWSMYKSo00qWEY5DyOiJobHSRmYlBXLgf2rs4OSoW2u9Y26MOQ2jJS/7INK aKJ15+Ab4LfBSiisLZSsa64LJecLmX50pDKIyrJps7M+slV7026nI5fp51072HooVKGK Xzqg== X-Gm-Message-State: AOPr4FVV3U1kp5Eal1P7BO+YWH2P8n7f0Hb5vjMH70d8HJ/VPuSFDj0BXym4WOkRfKuhy9fM X-Received: by 10.28.180.133 with SMTP id d127mr1986795wmf.45.1461048849208; Mon, 18 Apr 2016 23:54:09 -0700 (PDT) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id d1sm2541823wmh.18.2016.04.18.23.54.07 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Apr 2016 23:54:08 -0700 (PDT) Subject: Re: svn commit: r298244 - head/sbin/dumpon To: araujo@FreeBSD.org, Pedro Giffuni References: <201604190428.u3J4SP2w044552@repo.freebsd.org> <53a3202e-c144-b7d0-02f1-a7f4364d594e@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Steven Hartland Message-ID: <5715D615.8020806@multiplay.co.uk> Date: Tue, 19 Apr 2016 07:54:13 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 06:54:11 -0000 On 19/04/2016 06:01, Marcelo Araujo wrote: > > > 2016-04-19 12:58 GMT+08:00 Pedro Giffuni >: > > > > On 04/18/16 23:28, Marcelo Araujo wrote: > > Author: araujo > Date: Tue Apr 19 04:28:25 2016 > New Revision: 298244 > URL: https://svnweb.freebsd.org/changeset/base/298244 > > Log: > Use nitems() instead of sizeof(name) / sizeof(*name). > > MFC after: 2 weeks. > > > FWIW, while I see why it makes sense to make these cosmetic > changes, it's probably too much to MFC them. > > At least I have no plans to merge the ones I've made since > they are non-functional. > > Pedro. > > > I was thinking to MFC it at once(less work)! As now I'm > checking/committing one by one. > Also not MFC'ing is likely to make it much harder to MFC other functional changes in the same area, so if they are easy then I'd say do it :) Regards Steve From owner-svn-src-all@freebsd.org Tue Apr 19 07:28:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2EC5B1316F; Tue, 19 Apr 2016 07:28:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7045C1125; Tue, 19 Apr 2016 07:28:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J7Sdlf098836; Tue, 19 Apr 2016 07:28:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J7SdSf098835; Tue, 19 Apr 2016 07:28:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201604190728.u3J7SdSf098835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 19 Apr 2016 07:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298257 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 07:28:40 -0000 Author: delphij Date: Tue Apr 19 07:28:39 2016 New Revision: 298257 URL: https://svnweb.freebsd.org/changeset/base/298257 Log: Fix build breakage introduced by r298253. Modified: head/usr.bin/units/Makefile Modified: head/usr.bin/units/Makefile ============================================================================== --- head/usr.bin/units/Makefile Tue Apr 19 06:34:31 2016 (r298256) +++ head/usr.bin/units/Makefile Tue Apr 19 07:28:39 2016 (r298257) @@ -3,7 +3,7 @@ .include PROG= units -FILES= units.lib +FILES= definitions.units FILESDIR= ${SHAREDIR}/misc LIBADD= edit From owner-svn-src-all@freebsd.org Tue Apr 19 07:34:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1440FB135E2; Tue, 19 Apr 2016 07:34:33 +0000 (UTC) (envelope-from thomas@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7F1F1AB5; Tue, 19 Apr 2016 07:34:32 +0000 (UTC) (envelope-from thomas@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J7YVMA001986; Tue, 19 Apr 2016 07:34:31 GMT (envelope-from thomas@FreeBSD.org) Received: (from thomas@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J7YVJg001981; Tue, 19 Apr 2016 07:34:31 GMT (envelope-from thomas@FreeBSD.org) Message-Id: <201604190734.u3J7YVJg001981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thomas set sender to thomas@FreeBSD.org using -f From: Thomas Quinot Date: Tue, 19 Apr 2016 07:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298258 - stable/10/bin/dd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 07:34:33 -0000 Author: thomas Date: Tue Apr 19 07:34:31 2016 New Revision: 298258 URL: https://svnweb.freebsd.org/changeset/base/298258 Log: MFC r295749: Reorganize the handling all-zeroes terminal block in sparse mode PR: 189284 (original PR whose fix introduced this bug) PR: 207092 Added: stable/10/bin/dd/ref.obs_zeroes - copied unchanged from r295749, head/bin/dd/ref.obs_zeroes Modified: stable/10/bin/dd/Makefile stable/10/bin/dd/dd.c stable/10/bin/dd/dd.h stable/10/bin/dd/gen.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/Makefile ============================================================================== --- stable/10/bin/dd/Makefile Tue Apr 19 07:28:39 2016 (r298257) +++ stable/10/bin/dd/Makefile Tue Apr 19 07:34:31 2016 (r298258) @@ -24,7 +24,18 @@ test: ${PROG} gen LC_ALL=en_US.US-ASCII hexdump -C | \ diff -I FreeBSD - ${.CURDIR}/ref.${conv} .endfor - @rm -f gen + @${ECHO} "testing sparse file (obs zeroes)" + @./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2> /dev/null + @hexdump -C obs_zeroes | diff -I FreeBSD - ${.CURDIR}/ref.obs_zeroes + + @${ECHO} "testing spase file (all zeroes)" + @./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null + @./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2> /dev/null + @./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null + @diff 1M_zeroes 1M_zeroes.1 + @diff 1M_zeroes 1M_zeroes.2 + + @rm -f gen 1M_zeroes* obs_zeroes .if ${MK_TESTS} != "no" SUBDIR+= tests Modified: stable/10/bin/dd/dd.c ============================================================================== --- stable/10/bin/dd/dd.c Tue Apr 19 07:28:39 2016 (r298257) +++ stable/10/bin/dd/dd.c Tue Apr 19 07:34:31 2016 (r298258) @@ -77,7 +77,6 @@ STAT st; /* statistics */ void (*cfunc)(void); /* conversion function */ uintmax_t cpy_cnt; /* # of blocks to copy */ static off_t pending = 0; /* pending seek if sparse */ -static off_t last_sp = 0; /* size of last added sparse block */ u_int ddflags = 0; /* conversion options */ size_t cbsz; /* conversion block size */ uintmax_t files_cnt = 1; /* # of files to copy */ @@ -410,6 +409,15 @@ dd_close(void) } if (out.dbcnt || pending) dd_out(1); + + /* + * If the file ends with a hole, ftruncate it to extend its size + * up to the end of the hole (without having to write any data). + */ + if (out.seek_offset > 0 && (out.flags & ISTRUNC)) { + if (ftruncate(out.fd, out.seek_offset) == -1) + err(1, "truncating %s", out.name); + } } void @@ -458,29 +466,27 @@ dd_out(int force) } if (sparse && !force) { pending += cnt; - last_sp = cnt; nw = cnt; } else { if (pending != 0) { - /* If forced to write, and we have no - * data left, we need to write the last - * sparse block explicitly. + /* + * Seek past hole. Note that we need to record the + * reached offset, because we might have no more data + * to write, in which case we'll need to call + * ftruncate to extend the file size. */ - if (force && cnt == 0) { - pending -= last_sp; - assert(outp == out.db); - memset(outp, 0, cnt); - } - if (lseek(out.fd, pending, SEEK_CUR) == - -1) + out.seek_offset = lseek(out.fd, pending, SEEK_CUR); + if (out.seek_offset == -1) err(2, "%s: seek error creating sparse file", out.name); - pending = last_sp = 0; + pending = 0; } - if (cnt) + if (cnt) { nw = write(out.fd, outp, cnt); - else + out.seek_offset = 0; + } else { return; + } } if (nw <= 0) { Modified: stable/10/bin/dd/dd.h ============================================================================== --- stable/10/bin/dd/dd.h Tue Apr 19 07:28:39 2016 (r298257) +++ stable/10/bin/dd/dd.h Tue Apr 19 07:34:31 2016 (r298258) @@ -54,6 +54,7 @@ typedef struct { const char *name; /* name */ int fd; /* file descriptor */ off_t offset; /* # of blocks to skip */ + off_t seek_offset; /* offset of last seek past output hole */ } IO; typedef struct { Modified: stable/10/bin/dd/gen.c ============================================================================== --- stable/10/bin/dd/gen.c Tue Apr 19 07:28:39 2016 (r298257) +++ stable/10/bin/dd/gen.c Tue Apr 19 07:34:31 2016 (r298258) @@ -5,13 +5,20 @@ */ #include +#include int -main(int argc __unused, char **argv __unused) +main(int argc, char **argv) { int i; - for (i = 0; i < 256; i++) - putchar(i); + if (argc > 1 && !strcmp(argv[1], "189284")) { + fputs("ABCDEFGH", stdout); + for (i = 0; i < 8; i++) + putchar(0); + } else { + for (i = 0; i < 256; i++) + putchar(i); + } return (0); } Copied: stable/10/bin/dd/ref.obs_zeroes (from r295749, head/bin/dd/ref.obs_zeroes) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/bin/dd/ref.obs_zeroes Tue Apr 19 07:34:31 2016 (r298258, copy of r295749, head/bin/dd/ref.obs_zeroes) @@ -0,0 +1,3 @@ +$FreeBSD$ +00000000 41 42 43 44 45 46 47 48 00 00 00 00 00 00 00 00 |ABCDEFGH........| +00000010 From owner-svn-src-all@freebsd.org Tue Apr 19 07:45:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 529ABB13F2F; Tue, 19 Apr 2016 07:45:43 +0000 (UTC) (envelope-from thomas@FreeBSD.ORG) Received: from melamine.cuivre.fr.eu.org (houdart.cuivre.fr.eu.org [81.57.40.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21B7F169E; Tue, 19 Apr 2016 07:45:42 +0000 (UTC) (envelope-from thomas@FreeBSD.ORG) Received: by melamine.cuivre.fr.eu.org (Postfix, from userid 1000) id ADAD219C508; Tue, 19 Apr 2016 09:36:18 +0200 (CEST) Date: Tue, 19 Apr 2016 09:36:18 +0200 From: Thomas Quinot To: Maxim Sobolev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn: head/bin/dd Message-ID: <20160419073618.GA3417@melamine.cuivre.fr.eu.org> References: <201602180844.u1I8iGTN082641@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-message-flag: WARNING! Using Outlook can damage your computer. User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 07:45:43 -0000 * Maxim Sobolev, 2016-02-19 : > Thanks, Thomas. IMHO this is quite serious bug in one of the core > utilities, so I suggest it gets faster MFC before 10.3 goes into beta stage > on Feb 26. The old code in RELENG_10 is just plain broken anyway now, so it > could not make it any worse. Thanks! It turns out that I was unable to make it in time for 10.3, sorry about that! (Newborn kid ate my time). This long overdue MFC is now installed in stable/10 as ov rev 298258. Thomas. From owner-svn-src-all@freebsd.org Tue Apr 19 09:09:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F3D7B1270C; Tue, 19 Apr 2016 09:09:03 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CA56F17CC; Tue, 19 Apr 2016 09:09:02 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 8017625D3A0E; Tue, 19 Apr 2016 09:08:59 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id AA939D1F8E8; Tue, 19 Apr 2016 09:08:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id nRbJKmxRUpdi; Tue, 19 Apr 2016 09:08:56 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 82925D1F8E6; Tue, 19 Apr 2016 09:08:56 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: "Bjoern A. Zeeb" In-Reply-To: <201604182309.u3IN9MC6047480@repo.freebsd.org> Date: Tue, 19 Apr 2016 09:08:53 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3DB7C327-E42A-44AB-A1CB-FA34698B2CF3@lists.zabbadoz.net> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 09:09:03 -0000 > On 18 Apr 2016, at 23:09 , Allan Jude wrote: >=20 > Author: allanjude > Date: Mon Apr 18 23:09:22 2016 > New Revision: 298230 > URL: https://svnweb.freebsd.org/changeset/base/298230 >=20 Can you have a look at this please? =3D=3D=3D> sys/boot/pc98/libpc98 (all) /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:132:5: = warning: incompatible pointer types initializing 'int (*)(void *, int, = daddr_t, size_t, size_t, char *, size_t *)' (aka 'int (*)(void *, int, = long long, unsigned int, unsigned int , char *, unsigned int *)') with an expression of type 'int (void *, = int, daddr_t, size_t, char *, size_t *)' (aka 'int (void *, int, long = long, unsigned int, char *, unsigned int *)') = [-Wincompatible-pointer-types] bd_strategy, ^~~~~~~~~~~ /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:736:1: error: = conflicting types for 'bd_strategy' bd_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t = size, ^ /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:120:12: note: = previous declaration is here static int bd_strategy(void *devdata, int flag, daddr_t dblk, ^ /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:740:33: error: = use of undeclared identifier 'f' struct i386_devdesc *dev =3D f->f_devdata; ^ /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:743:21: = warning: incompatible pointer types assigning to 'int (*)(void *, int, = daddr_t, size_t, size_t, char *, size_t *)' (aka 'int (*)(void *, int, = long long, unsigned int, unsigned in t, char *, unsigned int *)') from 'int (void *, int, daddr_t, size_t, = char *, size_t *)' (aka 'int (void *, int, long long, unsigned int, char = *, unsigned int *)') [-Wincompatible-pointer-types] bcd.dv_strategy =3D bd_realstrategy; ^ ~~~~~~~~~~~~~~~ /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:747:13: error: = too many arguments to function call, expected 7, have 8 size, buf, rsize)); ^~~~~ = /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/../../common/bootstrap.h:79= :1: note: 'bcache_strategy' declared here int bcache_strategy(void *devdata, int rw, daddr_t blk, size_t = offset, ^ /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:751:1: error: = conflicting types for 'bd_realstrategy' bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset, ^ /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:122:12: note: = previous declaration is here static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, ^ 2 warnings and 4 errors generated. --- biosdisk.o --- *** [biosdisk.o] Error code 1 bmake[8]: stopped in /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98 =3D=3D=3D> usr.sbin/cron/crontab (all) =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-all@freebsd.org Tue Apr 19 09:25:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47275B12EE4; Tue, 19 Apr 2016 09:25:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1999613D7; Tue, 19 Apr 2016 09:25:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J9Puoi034765; Tue, 19 Apr 2016 09:25:56 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J9PuFf034764; Tue, 19 Apr 2016 09:25:56 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604190925.u3J9PuFf034764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 19 Apr 2016 09:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298259 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 09:25:57 -0000 Author: sephe Date: Tue Apr 19 09:25:56 2016 New Revision: 298259 URL: https://svnweb.freebsd.org/changeset/base/298259 Log: hyperv: Remove two assign-only local variables Submitted by: Jun Su MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Tue Apr 19 07:34:31 2016 (r298258) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Tue Apr 19 09:25:56 2016 (r298259) @@ -368,12 +368,6 @@ vmbus_channel_on_offer(hv_vmbus_channel_ offer = (hv_vmbus_channel_offer_channel*) hdr; - hv_guid *guidType; - hv_guid *guidInstance; - - guidType = &offer->offer.interface_type; - guidInstance = &offer->offer.interface_instance; - // copy offer data copied = malloc(sizeof(*copied), M_DEVBUF, M_NOWAIT); if (copied == NULL) { From owner-svn-src-all@freebsd.org Tue Apr 19 09:30:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9852B130C0; Tue, 19 Apr 2016 09:30:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2763E18B4; Tue, 19 Apr 2016 09:30:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u3J9UMxK037382 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 19 Apr 2016 12:30:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u3J9UMxK037382 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u3J9UMPW037372; Tue, 19 Apr 2016 12:30:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 19 Apr 2016 12:30:22 +0300 From: Konstantin Belousov To: Allan Jude Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... Message-ID: <20160419093022.GV2422@kib.kiev.ua> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57157108.6090500@freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 09:30:32 -0000 On Mon, Apr 18, 2016 at 07:43:04PM -0400, Allan Jude wrote: > On 2016-04-18 19:36, Adrian Chadd wrote: > > Someone pointed out how this bloats out memory requirement in loader. > > > > Did anyone check that? > > > > -adrian > > > > I tested down to 128mb of ram in QEMU, booted from the installer ISO, > did the install, and booted the installed system without issue. 64MB is^H^H was very much useful and workable i386 config. i386 kernel does fit into the 32M but current automatic tuning prevents usermode from operating. Little manual tuning make 32M on tolerable. Making loader require 64M is a regression. At very least, it is impossible to test low mem configs anymore. From owner-svn-src-all@freebsd.org Tue Apr 19 09:42:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4053B13588; Tue, 19 Apr 2016 09:42:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B8611147; Tue, 19 Apr 2016 09:42:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J9gm0h040715; Tue, 19 Apr 2016 09:42:48 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J9gm32040712; Tue, 19 Apr 2016 09:42:48 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604190942.u3J9gm32040712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 19 Apr 2016 09:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298260 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 09:42:49 -0000 Author: sephe Date: Tue Apr 19 09:42:48 2016 New Revision: 298260 URL: https://svnweb.freebsd.org/changeset/base/298260 Log: hyperv/vmbus: Make device probe/attach synchronous w/ vmbus attach/SYSINIT Discussed with: Jun Su , Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Tue Apr 19 09:25:56 2016 (r298259) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Tue Apr 19 09:42:48 2016 (r298260) @@ -27,7 +27,10 @@ */ #include +#include +#include #include +#include #include "hv_vmbus_priv.h" @@ -92,6 +95,14 @@ typedef struct hv_work_item { void* context; } hv_work_item; +static struct mtx vmbus_chwait_lock; +MTX_SYSINIT(vmbus_chwait_lk, &vmbus_chwait_lock, "vmbus primarych wait lock", + MTX_DEF); +static uint32_t vmbus_chancnt; +static uint32_t vmbus_devcnt; + +#define VMBUS_CHANCNT_DONE 0x80000000 + /** * Implementation of the work abstraction. */ @@ -276,6 +287,11 @@ vmbus_channel_process_offer(hv_vmbus_cha mtx_unlock(&hv_vmbus_g_connection.channel_lock); hv_vmbus_free_vmbus_channel(new_channel); } + + mtx_lock(&vmbus_chwait_lock); + vmbus_devcnt++; + mtx_unlock(&vmbus_chwait_lock); + wakeup(&vmbus_devcnt); } void @@ -377,6 +393,11 @@ vmbus_channel_on_offer(hv_vmbus_channel_ memcpy(copied, hdr, sizeof(*copied)); hv_queue_work_item(vmbus_channel_on_offer_internal, copied); + + mtx_lock(&vmbus_chwait_lock); + if ((vmbus_chancnt & VMBUS_CHANCNT_DONE) == 0) + vmbus_chancnt++; + mtx_unlock(&vmbus_chwait_lock); } static void @@ -468,6 +489,11 @@ vmbus_channel_on_offer_rescind_internal( static void vmbus_channel_on_offers_delivered(hv_vmbus_channel_msg_header* hdr) { + + mtx_lock(&vmbus_chwait_lock); + vmbus_chancnt |= VMBUS_CHANCNT_DONE; + mtx_unlock(&vmbus_chwait_lock); + wakeup(&vmbus_chancnt); } /** @@ -745,3 +771,18 @@ vmbus_select_outgoing_channel(struct hv_ return(outgoing_channel); } + +void +vmbus_scan(void) +{ + uint32_t chancnt; + + mtx_lock(&vmbus_chwait_lock); + while ((vmbus_chancnt & VMBUS_CHANCNT_DONE) == 0) + mtx_sleep(&vmbus_chancnt, &vmbus_chwait_lock, 0, "waitch", 0); + chancnt = vmbus_chancnt & ~VMBUS_CHANCNT_DONE; + + while (vmbus_devcnt != chancnt) + mtx_sleep(&vmbus_devcnt, &vmbus_chwait_lock, 0, "waitdev", 0); + mtx_unlock(&vmbus_chwait_lock); +} Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Apr 19 09:25:56 2016 (r298259) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Apr 19 09:42:48 2016 (r298260) @@ -326,7 +326,6 @@ int hv_vmbus_child_device_register(struct hv_device *child_dev) { device_t child; - int ret = 0; if (bootverbose) { char name[40]; @@ -338,10 +337,6 @@ hv_vmbus_child_device_register(struct hv child_dev->device = child; device_set_ivars(child, child_dev); - mtx_lock(&Giant); - ret = device_probe_and_attach(child); - mtx_unlock(&Giant); - return (0); } @@ -481,6 +476,11 @@ vmbus_bus_init(void) goto cleanup1; hv_vmbus_request_channel_offers(); + + vmbus_scan(); + bus_generic_attach(vmbus_devp); + device_printf(vmbus_devp, "device scan, probe and attach done\n"); + return (ret); cleanup1: Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Apr 19 09:25:56 2016 (r298259) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Apr 19 09:42:48 2016 (r298260) @@ -751,6 +751,9 @@ void hv_vmbus_on_events(int cpu); void hv_et_init(void); void hv_et_intr(struct trapframe*); +/* Wait for device creation */ +void vmbus_scan(void); + /* * The guest OS needs to register the guest ID with the hypervisor. * The guest ID is a 64 bit entity and the structure of this ID is From owner-svn-src-all@freebsd.org Tue Apr 19 09:43:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0C90B136DC; Tue, 19 Apr 2016 09:43:52 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3C51337; Tue, 19 Apr 2016 09:43:52 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J9hpBa040798; Tue, 19 Apr 2016 09:43:51 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J9hpwW040797; Tue, 19 Apr 2016 09:43:51 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604190943.u3J9hpwW040797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 09:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298261 - head/sbin/setkey X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 09:43:52 -0000 Author: araujo Date: Tue Apr 19 09:43:51 2016 New Revision: 298261 URL: https://svnweb.freebsd.org/changeset/base/298261 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/setkey/test-policy.c Modified: head/sbin/setkey/test-policy.c ============================================================================== --- head/sbin/setkey/test-policy.c Tue Apr 19 09:42:48 2016 (r298260) +++ head/sbin/setkey/test-policy.c Tue Apr 19 09:43:51 2016 (r298261) @@ -76,7 +76,7 @@ main() int i; char *buf; - for (i = 0; i < sizeof(requests)/sizeof(requests[0]); i++) { + for (i = 0; i < nitems(requests); i++) { printf("* requests:[%s]\n", requests[i]); if ((buf = setpolicy(requests[i])) == NULL) continue; From owner-svn-src-all@freebsd.org Tue Apr 19 11:12:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07BA1B13FC7; Tue, 19 Apr 2016 11:12:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8A491888; Tue, 19 Apr 2016 11:12:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JBCvvt067661; Tue, 19 Apr 2016 11:12:57 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JBCvQv067660; Tue, 19 Apr 2016 11:12:57 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604191112.u3JBCvQv067660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 19 Apr 2016 11:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298262 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 11:12:59 -0000 Author: araujo Date: Tue Apr 19 11:12:57 2016 New Revision: 298262 URL: https://svnweb.freebsd.org/changeset/base/298262 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/camcontrol/progress.c Modified: head/sbin/camcontrol/progress.c ============================================================================== --- head/sbin/camcontrol/progress.c Tue Apr 19 09:43:51 2016 (r298261) +++ head/sbin/camcontrol/progress.c Tue Apr 19 11:12:57 2016 (r298262) @@ -56,7 +56,7 @@ static const char * const suffixes[] = { "EiB", /* 2^60 Exbibyte */ }; -#define NSUFFIXES (sizeof(suffixes) / sizeof(suffixes[0])) +#define NSUFFIXES nitems(suffixes) #define SECSPERHOUR (60 * 60) #define DEFAULT_TTYWIDTH 80 From owner-svn-src-all@freebsd.org Tue Apr 19 11:26:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00AF9B146AB for ; Tue, 19 Apr 2016 11:26:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm49-vm6.bullet.mail.bf1.yahoo.com (nm49-vm6.bullet.mail.bf1.yahoo.com [216.109.115.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABA8F1F9E for ; Tue, 19 Apr 2016 11:26:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461065165; bh=FNmZCqvowfYUaxNiclyL2VqubxTbk7HOjMbZePCfElc=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=OKhQg5I2uuXVMPVWPaI5ztVzQLXBNnj1L9PPs8G9QM72R3DKrWpNn7Ctf1tulQMd40f4N935WQSjizVz/bCY+vhqtzYIo3XSkMfqWdAmKOhNBNEW9m/C6ljdiBr/wR2JLYFWzMAX4At1CEpdkXLcw4cVXW5JbZ+fT1l7pjKfABWKnIRMGvG/ZHAvm68M1NXJAe+vjS2z3y1lhg+RjmbgAGzBvXASZH/tAavQ6QbfmB24yssGJODWBcm2c/RtULjVed6/fqt3MgEn2ImsBEaQPgtB3aaZSqIHD6DSNgaUFoGaA8VmVSvNzQx25CxwSfdgV3433juOpiPBa7kcs2bOrg== Received: from [98.139.215.143] by nm49.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 11:26:05 -0000 Received: from [98.139.213.15] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 11:26:05 -0000 Received: from [127.0.0.1] by smtp115.mail.bf1.yahoo.com with NNFMP; 19 Apr 2016 11:26:05 -0000 X-Yahoo-Newman-Id: 900901.89945.bm@smtp115.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FTyZuTYVM1n5OwWedlVNL6kwVcGSknBDNxewjXYFkYm8lEI 65DKUR8Tc5O0DilxiAHQbx7gPlxg2lgTFvnPBtvr8tMFuqWaIvh0MiQTMOHg RYPCVQts74LZemMdl5IhiZA0Pnz0ZtLKP5jYd943RVS.TVXCxANVzxdGNaco ZzQMBg980zJ60RmZJeQ2nRsQW7u0OTLu_jX7GDBMVQlNxj1X.Et2OG71GQGs FjPb1zNgERNXOtlUWx9rqoxIw1npz5lTaO.8Ony8ddKKph7NxgfcqLsQ3yck xmJ1gbAZTse.c9vrdLMDC_ZVP56Gisp5.PgcL_wVSA.bvSjPEyP8gzy5jrdd HX2tSPR0srwAYuVxeQwF39Ys_YNVmNWOsm5Oakf1zcA58jG3wStwoBr6uHUp 3sD8xXNn0I10q2PCfK7JiRePuCa7i6G5xFlNYZg8Sx.Wg8bhq.0LRwJVrPr5 zH_rBDmhwgKSA06p45XUreSV0OUGHcLKCzSKaWPoke4YSt0qF_zBS0PFpNEU AvWlsU6.jMNXCjm7FbNBDojy8adO9dap. X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298244 - head/sbin/dumpon To: Steven Hartland , araujo@FreeBSD.org References: <201604190428.u3J4SP2w044552@repo.freebsd.org> <53a3202e-c144-b7d0-02f1-a7f4364d594e@FreeBSD.org> <5715D615.8020806@multiplay.co.uk> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: Date: Tue, 19 Apr 2016 06:26:08 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <5715D615.8020806@multiplay.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 11:26:14 -0000 On 04/19/16 01:54, Steven Hartland wrote: > > On 19/04/2016 06:01, Marcelo Araujo wrote: >> >> >> 2016-04-19 12:58 GMT+08:00 Pedro Giffuni > >: >> >> >> >> On 04/18/16 23:28, Marcelo Araujo wrote: >> >> Author: araujo >> Date: Tue Apr 19 04:28:25 2016 >> New Revision: 298244 >> URL: https://svnweb.freebsd.org/changeset/base/298244 >> >> Log: >> Use nitems() instead of sizeof(name) / sizeof(*name). >> >> MFC after: 2 weeks. >> >> >> FWIW, while I see why it makes sense to make these cosmetic >> changes, it's probably too much to MFC them. >> >> At least I have no plans to merge the ones I've made since >> they are non-functional. >> >> Pedro. >> >> >> I was thinking to MFC it at once(less work)! As now I'm >> checking/committing one by one. >> > Also not MFC'ing is likely to make it much harder to MFC other > functional changes in the same area, so if they are easy then I'd say do > it :) > That's fine. It's a personal choice. I just don't think many people will be reading the code for dumpon, and if they do they should probably read current anyways ;). Pedro. From owner-svn-src-all@freebsd.org Tue Apr 19 11:37:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB5E5B14AB5; Tue, 19 Apr 2016 11:37:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8A3918E5; Tue, 19 Apr 2016 11:37:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JBbhBx073719; Tue, 19 Apr 2016 11:37:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JBbh3g073718; Tue, 19 Apr 2016 11:37:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604191137.u3JBbh3g073718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Apr 2016 11:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298263 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 11:37:45 -0000 Author: kib Date: Tue Apr 19 11:37:43 2016 New Revision: 298263 URL: https://svnweb.freebsd.org/changeset/base/298263 Log: Fix umtx lock/trylock for compat32. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Tue Apr 19 11:12:57 2016 (r298262) +++ head/sys/kern/kern_umtx.c Tue Apr 19 11:37:43 2016 (r298263) @@ -4063,8 +4063,8 @@ static const _umtx_op_func op_table_comp [UMTX_OP_RESERVED1] = __umtx_op_unimpl, [UMTX_OP_WAIT] = __umtx_op_wait_compat32, [UMTX_OP_WAKE] = __umtx_op_wake, - [UMTX_OP_MUTEX_LOCK] = __umtx_op_trylock_umutex, - [UMTX_OP_MUTEX_TRYLOCK] = __umtx_op_lock_umutex_compat32, + [UMTX_OP_MUTEX_TRYLOCK] = __umtx_op_trylock_umutex, + [UMTX_OP_MUTEX_LOCK] = __umtx_op_lock_umutex_compat32, [UMTX_OP_MUTEX_UNLOCK] = __umtx_op_unlock_umutex, [UMTX_OP_SET_CEILING] = __umtx_op_set_ceiling, [UMTX_OP_CV_WAIT] = __umtx_op_cv_wait_compat32, From owner-svn-src-all@freebsd.org Tue Apr 19 12:14:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A8AB14126; Tue, 19 Apr 2016 12:14:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2321065; Tue, 19 Apr 2016 12:14:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JCEFOu085811; Tue, 19 Apr 2016 12:14:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JCEF9k085810; Tue, 19 Apr 2016 12:14:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604191214.u3JCEF9k085810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 19 Apr 2016 12:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298264 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 12:14:16 -0000 Author: avg Date: Tue Apr 19 12:14:15 2016 New Revision: 298264 URL: https://svnweb.freebsd.org/changeset/base/298264 Log: MFC r297520: zfs receive: -u can be ignored sometimes PR: 204705 Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Apr 19 11:37:43 2016 (r298263) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Apr 19 12:14:15 2016 (r298264) @@ -3479,7 +3479,8 @@ zfs_receive_one(libzfs_handle_t *hdl, in } if (clp) { - err |= changelist_postfix(clp); + if (!flags->nomount) + err |= changelist_postfix(clp); changelist_free(clp); } From owner-svn-src-all@freebsd.org Tue Apr 19 12:14:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27002B141C2; Tue, 19 Apr 2016 12:14:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7C3511D0; Tue, 19 Apr 2016 12:14:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JCErER085886; Tue, 19 Apr 2016 12:14:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JCErnE085885; Tue, 19 Apr 2016 12:14:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604191214.u3JCErnE085885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 19 Apr 2016 12:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298265 - stable/9/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 12:14:54 -0000 Author: avg Date: Tue Apr 19 12:14:52 2016 New Revision: 298265 URL: https://svnweb.freebsd.org/changeset/base/298265 Log: MFC r297520: zfs receive: -u can be ignored sometimes PR: 204705 Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Apr 19 12:14:15 2016 (r298264) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Apr 19 12:14:52 2016 (r298265) @@ -3105,7 +3105,8 @@ zfs_receive_one(libzfs_handle_t *hdl, in } if (clp) { - err |= changelist_postfix(clp); + if (!flags->nomount) + err |= changelist_postfix(clp); changelist_free(clp); } From owner-svn-src-all@freebsd.org Tue Apr 19 12:16:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EF2CB1425B; Tue, 19 Apr 2016 12:16:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B385E1354; Tue, 19 Apr 2016 12:16:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u3JCFpec081405 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 19 Apr 2016 15:15:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u3JCFpec081405 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u3JCFpve081403; Tue, 19 Apr 2016 15:15:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 19 Apr 2016 15:15:51 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298219 - head/share/mk Message-ID: <20160419121551.GX2422@kib.kiev.ua> References: <201604181814.u3IIE22P059301@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <201604181814.u3IIE22P059301@repo.freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 12:16:02 -0000 On Mon, Apr 18, 2016 at 06:14:02PM +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Mon Apr 18 18:14:02 2016 > New Revision: 298219 > URL: https://svnweb.freebsd.org/changeset/base/298219 >=20 > Log: > Cause an error during 'make install' if trying to compile with CC. > =20 > This is limited to src-tree builds, meaning not extended to ports or ot= her > out-of-tree builds. > =20 > This will help ensure that read-only OBJDIRS will be respected at insta= ll-time > by causing a more consistent failure for those who don't use a read-only > OBJDIR. It also will cause Jenkins to yell. This is a better solution= than > trying to see CC=3Dfalse as has been attempted and discussed before. > =20 > Of course this is only relevant for files generated by CC. > =20 > Disable this for META_MODE since it will detect the CFLAGS/command > change and force a rebuild. > =20 > Sponsored by: EMC / Isilon Storage Division >=20 > Modified: > head/share/mk/bsd.sys.mk >=20 > Modified: head/share/mk/bsd.sys.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/mk/bsd.sys.mk Mon Apr 18 18:13:58 2016 (r298218) > +++ head/share/mk/bsd.sys.mk Mon Apr 18 18:14:02 2016 (r298219) > @@ -178,6 +178,13 @@ ACFLAGS+=3D ${ACFLAGS.${.IMPSRC:T}} > CFLAGS+=3D ${CFLAGS.${.IMPSRC:T}} > CXXFLAGS+=3D ${CXXFLAGS.${.IMPSRC:T}} > =20 > +.if defined(SRCTOP) > +# Prevent rebuilding during install to support read-only objdirs. > +.if make(install) && empty(.MAKE.MODE:Mmeta) > +CFLAGS+=3D ERROR-tried-to-rebuild-during-make-install > +.endif > +.endif > + > # Tell bmake not to mistake standard targets for things to be searched f= or > # or expect to ever be up-to-date. > PHONY_NOTMAIN =3D analyze afterdepend afterinstall all beforedepend befo= reinstall \ It seems to cause the following behaviour: make buildenv cd lib/libthr # make DEBUG_FLAGS=3D-g WITHOUT_TESTS=3Dyes all install cc -O2 -pipe -DPTHREAD_KERNEL -I/usr/home/kostik/work/build/bsd/DEV/src= /lib/libthr/../libc/include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/l= ibthr/thread -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../../in= clude -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/arch/amd64/inclu= de -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/sys -I/usr/home/kos= tik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld-elf -I/usr/home/ko= stik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld-elf/amd64 -I/usr/= home/kostik/work/build/bsd/DEV/src/lib/libthr/../libthread_db -Winline -fex= ceptions -D_PTHREAD_FORCED_UNWIND -D_PTHREADS_INVARIANTS -mno-mmx -mno-sse = -mno-avx -g -MD -MP -MF.depend.thr_init.o -MTthr_init.o -std=3Dgnu99 -Wsyst= em-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-= prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-poi= nter-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -= Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-u= nused-function -Wno-enum-conversion -Wno-unused-local-typedef -Qunused-arg= uments ERROR-tried-to-rebuild-during-make-install -c /usr/home/kostik/work= /build/bsd/DEV/src/lib/libthr/thread/thr_init.c -o thr_init.o cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-make-i= nstall' *** Error code 1 Stop. make[3]: stopped in /usr/home/kostik/work/build/bsd/DEV/src/lib/libthr Doing separate steps for all and install targets work, but before, it also worked and was convenient to list sequential targets on the make command line. From owner-svn-src-all@freebsd.org Tue Apr 19 12:20:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DBB7B14636; Tue, 19 Apr 2016 12:20:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEF9917A0; Tue, 19 Apr 2016 12:20:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JCKT5F086218; Tue, 19 Apr 2016 12:20:29 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JCKTjZ086217; Tue, 19 Apr 2016 12:20:29 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604191220.u3JCKTjZ086217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 19 Apr 2016 12:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298266 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 12:20:30 -0000 Author: avg Date: Tue Apr 19 12:20:28 2016 New Revision: 298266 URL: https://svnweb.freebsd.org/changeset/base/298266 Log: MFC r297521: fix zfs set canmount=off on an unmounted filesystem No MFC to stable/9 because of a non-trivial merge conflict and no way to test the edited code. Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Apr 19 12:14:52 2016 (r298265) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Apr 19 12:20:28 2016 (r298266) @@ -1627,8 +1627,9 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl * its canmount property to 'on' or 'noauto'. We only use * the changelist logic to unmount when setting canmount=off. */ - if (!(prop == ZFS_PROP_CANMOUNT && - fnvpair_value_uint64(elem) != ZFS_CANMOUNT_OFF)) { + if (prop != ZFS_PROP_CANMOUNT || + (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_OFF && + zfs_is_mounted(zhp, NULL))) { cls[cl_idx] = changelist_gather(zhp, prop, 0, 0); if (cls[cl_idx] == NULL) goto error; From owner-svn-src-all@freebsd.org Tue Apr 19 13:14:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 697C4B13CB2; Tue, 19 Apr 2016 13:14:34 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32F861E4C; Tue, 19 Apr 2016 13:14:34 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22a.google.com with SMTP id g185so17921411ioa.2; Tue, 19 Apr 2016 06:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=SThxmZaOc5i2XCpqaFdwA0MiIqb+3B9Iq77CSCgtxRc=; b=Zqa2HfoyPt7j6BmPRKjhQtsKpc5q0AJSm7M8o18yZA6s6KMUM/NtUUb7O0KY34u1HW QDiq3hxYK4ciGS8BaKmt5khkY+XQw7JyfXqsDGXntwbUmkUJF+XnRWK73J13aOZtv0HR Mcjf+h0ZP3VovdY9HZoX+eImtt9+X6i8G36MnOSJGNjzjKjDK0rAGv8DSmWZVx04TJoD jt/fwZUhHYzB8ABl5M8g/KK8OCykwLfjP/wKRTDf/XcVjfM314JrNOR9BfrDLBpGSa0p RNdmvdJpZRby3rjVj0rD/mLYH4ZpeLa+fZOgpw6/NGc7tvtF9RZLklKFZ3s0+QQLHmFU NaEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=SThxmZaOc5i2XCpqaFdwA0MiIqb+3B9Iq77CSCgtxRc=; b=S9YnacW5WgfLQflqGYGhSlRqHna3NUbyl1phLdZgsCrhqK6TaLUD+YcDJLbcQsTqGd segvZ40kheLnqKjajAIz1Zp0A+qn4iKtvHxznXZgCNW+d8op/ai3qFRNi2Mdi7z2CKIH uGDOYklRtNliYRCfaGuYIeL4YbG6ZsH5YJkjECkQrSdjTfwZCO2cNFLaFqfn7RofSmAM UzwgF2ww/lWv+UwXt4DWugeUWQCge2tTxxrsIcXYzNNPlWCcmHMBbOvyUq6lu4dU25pu CZM4yCGzhGylT9KrxcPrU+HV8hbdBP8LeGSIy6S2SKzT3Sv14A6XvmuGm16wLTaUK3oS 0JBA== X-Gm-Message-State: AOPr4FXEm56Y2XDgj4tjqwT+SFT8T2Dq8y0MzsGQuMEFOKwWI8p36DQjh/0lsrbTfvHe+j7IR7Xf+8X9qSRj7w== X-Received: by 10.107.31.129 with SMTP id f123mr3686004iof.180.1461071673480; Tue, 19 Apr 2016 06:14:33 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.9.224 with HTTP; Tue, 19 Apr 2016 06:14:13 -0700 (PDT) In-Reply-To: <2E536470-D205-458F-A5D8-687D4EB8883C@gmail.com> References: <201604181313.u3IDDxsK064810@repo.freebsd.org> <5715A949.1020100@freebsd.org> <2E536470-D205-458F-A5D8-687D4EB8883C@gmail.com> From: Ed Maste Date: Tue, 19 Apr 2016 09:14:13 -0400 X-Google-Sender-Auth: -MCgNPJVtQnbW1Rsc6R6FAqk-AY Message-ID: Subject: Re: svn commit: r298204 - in head: lib/libdwarf lib/libelf lib/libelftc usr.bin/addr2line usr.bin/cxxfilt usr.bin/elfcopy usr.bin/nm usr.bin/readelf usr.bin/size usr.bin/strings To: "Ngie Cooper (yaneurabeya)" Cc: Julian Elischer , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 13:14:34 -0000 On 18 April 2016 at 23:46, Ngie Cooper (yaneurabeya) wrote: > >> On Apr 18, 2016, at 20:43, Julian Elischer wrote: >> >> On 18/04/2016 9:13 PM, Ed Maste wrote: >>> Author: emaste >>> Date: Mon Apr 18 13:13:59 2016 >>> New Revision: 298204 >>> URL: https://svnweb.freebsd.org/changeset/base/298204 >>> >>> Log: >>> Replace ${CURDIR}/../.. with ${CURDIR:H:H} in elftoolchain >> >> and if the last component is '..' ? How would you test a ${.CURDIR} with .. as the last component? > Or use SRCTOP, which (by proxy) uses :tA. Ok, this is likely the way to go. I've created a review for that change here: https://reviews.freebsd.org/D5998 From owner-svn-src-all@freebsd.org Tue Apr 19 13:36:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D212FB14570; Tue, 19 Apr 2016 13:36:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A091A1A48; Tue, 19 Apr 2016 13:36:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JDaVWi011298; Tue, 19 Apr 2016 13:36:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JDaVDv011297; Tue, 19 Apr 2016 13:36:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604191336.u3JDaVDv011297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Apr 2016 13:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298267 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 13:36:32 -0000 Author: trasz Date: Tue Apr 19 13:36:31 2016 New Revision: 298267 URL: https://svnweb.freebsd.org/changeset/base/298267 Log: Fix debugging printf. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Tue Apr 19 12:20:28 2016 (r298266) +++ head/sys/kern/kern_rctl.c Tue Apr 19 13:36:31 2016 (r298267) @@ -660,10 +660,11 @@ rctl_enforce(struct proc *p, int resourc if (sleep_ms > rctl_throttle_max) sleep_ms = rctl_throttle_max; #if 0 - printf("%s: pid %d (%s), %jd of %jd, will sleep for %ld ms (ratio %ld, available %ld)\n", + printf("%s: pid %d (%s), %jd of %jd, will sleep for %ju ms (ratio %ju, available %jd)\n", __func__, p->p_pid, p->p_comm, p->p_racct->r_resources[resource], - rule->rr_amount, sleep_ms, sleep_ratio, available); + rule->rr_amount, (uintmax_t)sleep_ms, + (uintmax_t)sleep_ratio, (intmax_t)available); #endif KASSERT(sleep_ms >= rctl_throttle_min, ("%s: %ju < %d\n", From owner-svn-src-all@freebsd.org Tue Apr 19 14:18:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EEA5B13670; Tue, 19 Apr 2016 14:18:13 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F17416BE; Tue, 19 Apr 2016 14:18:13 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JEICIC023256; Tue, 19 Apr 2016 14:18:12 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JEICrY023254; Tue, 19 Apr 2016 14:18:12 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604191418.u3JEICrY023254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 19 Apr 2016 14:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298268 - head/sys/dev/spibus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 14:18:13 -0000 Author: br Date: Tue Apr 19 14:18:12 2016 New Revision: 298268 URL: https://svnweb.freebsd.org/changeset/base/298268 Log: Add optional chip_select/deselect methods. This is required when we want to keep CS asserted for multiple transfers. Modified: head/sys/dev/spibus/spibus.c head/sys/dev/spibus/spibus_if.m Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Tue Apr 19 13:36:31 2016 (r298267) +++ head/sys/dev/spibus/spibus.c Tue Apr 19 14:18:12 2016 (r298268) @@ -185,9 +185,24 @@ spibus_hinted_child(device_t bus, const static int spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd) { + return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd)); } +static int +spibus_chip_select_impl(device_t dev, device_t child) +{ + + return (SPIBUS_CHIP_SELECT(device_get_parent(dev), child)); +} + +static int +spibus_chip_deselect_impl(device_t dev, device_t child) +{ + + return (SPIBUS_CHIP_DESELECT(device_get_parent(dev), child)); +} + static device_method_t spibus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, spibus_probe), @@ -208,6 +223,8 @@ static device_method_t spibus_methods[] /* spibus interface */ DEVMETHOD(spibus_transfer, spibus_transfer_impl), + DEVMETHOD(spibus_chip_select, spibus_chip_select_impl), + DEVMETHOD(spibus_chip_deselect, spibus_chip_deselect_impl), DEVMETHOD_END }; Modified: head/sys/dev/spibus/spibus_if.m ============================================================================== --- head/sys/dev/spibus/spibus_if.m Tue Apr 19 13:36:31 2016 (r298267) +++ head/sys/dev/spibus/spibus_if.m Tue Apr 19 14:18:12 2016 (r298268) @@ -39,3 +39,19 @@ METHOD int transfer { device_t child; struct spi_command *cmd; }; + +# +# Assert chip select +# +METHOD int chip_select { + device_t dev; + device_t child; +}; + +# +# Deassert chip select +# +METHOD int chip_deselect { + device_t dev; + device_t child; +}; From owner-svn-src-all@freebsd.org Tue Apr 19 14:33:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 628DBB13F03 for ; Tue, 19 Apr 2016 14:33:19 +0000 (UTC) (envelope-from bounce-mc.us1_50242045.3087309-svn-src-all=freebsd.org@mail51.atl51.rsgsv.net) Received: from mail51.atl51.rsgsv.net (mail51.atl51.rsgsv.net [205.201.135.51]) by mx1.freebsd.org (Postfix) with ESMTP id 0B0E517DE for ; Tue, 19 Apr 2016 14:33:19 +0000 (UTC) (envelope-from bounce-mc.us1_50242045.3087309-svn-src-all=freebsd.org@mail51.atl51.rsgsv.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=k1; d=mail51.atl51.rsgsv.net; h=Subject:From:Reply-To:To:Date:Message-ID:List-ID:List-Unsubscribe:Sender:Content-Type:MIME-Version; i=maria=3Dfashionablyin.com@mail51.atl51.rsgsv.net; bh=ZodK/a78AaPMJbq8hdmImgqGl8I=; b=IANsJpmuxR7A6rBATDETqgN0TqzX9cuYOya5j0Twvd21N+dTlT7pm6U5H/C30Ju+8EaBHs0+zaO3 dzUEDlDB+YKok+Y0Ffvg3BLOWbiUg5ZMR+BLVwtDcOIxOxZZayJdYmr+dS5eNrBRdy8OYCZhWpH2 BFec9sycxvaCmCxSBw8= Received: from (127.0.0.1) by mail51.atl51.rsgsv.net id h2p0qu1mr1or for ; Tue, 19 Apr 2016 14:33:04 +0000 (envelope-from ) Subject: =?utf-8?Q?Re=3A=20Fashionablyin=20Maria?= From: =?utf-8?Q?Maria=20Shumusti?= Reply-To: To: =?utf-8?Q??= Date: Tue, 19 Apr 2016 14:33:04 +0000 Message-ID: <8e7d8ec661c4606682b4765dd1417440e3e.20160419143210@mail51.atl51.rsgsv.net> X-Mailer: MailChimp Mailer - **CID3d4c9a0bce1417440e3e** X-Campaign: mailchimp8e7d8ec661c4606682b4765dd.3d4c9a0bce X-campaignid: mailchimp8e7d8ec661c4606682b4765dd.3d4c9a0bce X-Report-Abuse: Please report abuse for this campaign here: http://www.mailchimp.com/abuse/abuse.phtml?u=8e7d8ec661c4606682b4765dd&id=3d4c9a0bce&e=1417440e3e X-MC-User: 8e7d8ec661c4606682b4765dd X-Feedback-ID: 50242045:50242045.3087309:us1:mc Precedence: bulk X-Auto-Response-Suppress: OOF, AutoReply X-Accounttype: pd Sender: "Maria Shumusti" x-mcda: FALSE MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format="fixed" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 14:33:19 -0000 19 April 2016 Tuesday http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c46066= 82b4765dd&id=3Dd1bb1d6181&e=3D1417440e3e Maria Shumusti Fashion Feature Writer Maria likes her coffee strong and likes to romanticize fashion and life in= to her little black dairy. She reads Kafka and Hosseini by day=2C Vogue an= d Cosmo by night. In a parallel universe she's best friends with Roberto C= avalli. "Never say never in fashion. Because two years later never will be back in= style again" Get Featured in Fashionablyin Contact Maria (mailto:maria@fashionablyin.com?subject=3DRe%3A%20Fashionablyin%20Feature&= body=3DQuestionnaire%20for%20Designers%0AHow%20did%20you%20get%20into%20fa= shion%3F%0ATell%20us%20what%20have%20influenced%20you%20when%20becoming%20= a%20fashion%20designer%3F%0AWhere%20do%20you%20go%20for%20inspiration%3F%0= AHow%20much%20do%20trends%20influence%20your%20designs%3F%0AHow%20did%20yo= u%20come%20to%20start%20your%20own%20brand%3F%0ACan%20you%20tell%20us%20ab= out%20the%20next%20collection%3F%20%0A%0AQuestionnaire%20for%20Events%0AIs= %20this%20an%20annual%20event%20%3F%20If%20not%20how%20many%20times%20a%20= year%20is%20it%20organized%3F%0AHow%20many%20stalls%20are%20registered%20a= lready%20for%20the%20event%3F%0AWhat%20kind%20of%20footfall%20are%20we%20l= ooking%20to%20expect%3F%0AWhat%20is%20the%20biggest%20highlight%20of%20the= %20event%3F%0AWhat%20is%20your%20most%20favorite%20part%20about%20the%20Po= p%20Up%20Flea%20Fest%3F%0AWhere%20do%20you%20see%20the%20future%20of%20thi= s%20event%20headed%20towards%3F% 0A%0AQuestionnaire%20for%20Shops%20%2F%20Boutiques%3F%20%0AHow%20long%20ha= s%20this%20shop%2Fboutique%20been%20running%20for%3F%0AWhat%20do%20you%20s= pecialize%20in%3F%0AWhen%20is%20the%20time%20of%20the%20year%20%2C%20with%= 20the%20highest%20sales%3F%0AWhat%20sales%20and%20marketing%20strategies%2= 0do%20you%20use%20and%20apply%3F%0AWhich%20is%20your%20most%20loyal%20cust= omer%20group%3F%0AWhat%20other%20methods%20do%20you%20use%2Fif%20any%20to%= 20keep%20the%20customer%20base%20growing%3F) http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c46066= 82b4765dd&id=3D3546dee3c0&e=3D1417440e3e VOGUE 100- A CENTURY OF STYLE http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3Dabbcb1b695&e=3D1417440e3e ARIZONA APPAREL SHOW 2016 http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D5005f66529&e=3D1417440e3e ** Peru Moda ------------------------------------------------------------ ** The leading international exhibition of the garment industry in Peru. T= he leading international trade fair for clothing industry in Peru. April 2= 0-22 PERU MODA The event takes place parallel to the events Peru Gift Show (sam= e date and same place) .On the accreditations to Peru PERU Read More (http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8= ec661c4606682b4765dd&id=3D42dab6e2ae&e=3D1417440e3e) ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3Da7052da37c&e=3D1417440e3e ** Cueros Ferrer ------------------------------------------------------------ ** We are a company dedicated to the heading of making and selling leather= goods and accessories. We offer exclusive models of handbags=2C wallets= =2C purses=2C key chains=2C calendars=2C belts=2C backpacks=2C etc... Read More (http://fashionablyin.us1.list-manage2.com/track/click?u=3D8e7d8= ec661c4606682b4765dd&id=3D7ff9979639&e=3D1417440e3e) ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3Dddc6eef61f&e=3D1417440e3e ** AMANTANI PUEBLO S.A.C ------------------------------------------------------------ ** AMANTANI PUEBLO is a Peruvian company dedicated to teaching everyone th= e beauty and fineness of the alpaca fiber in Peru=2C offering domestic and= foreign market high quality products... Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8e= c661c4606682b4765dd&id=3D3c31244eaf&e=3D1417440e3e) ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3Da8766b2ebc&e=3D1417440e3e ** Performance Days ------------------------------------------------------------ ** PERFORMANCE DAYS =E2=80=93 functional fabric fair is the place to be tw= ice a year for the sourcing of high performance functional fabrics and acc= essories. With more than 120 exhibitors from 23 nations=2C PERFORMANCE DAY= S shows the latest trends in fabric development Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8e= c661c4606682b4765dd&id=3D88e5496c63&e=3D1417440e3e) ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D05de44fa49&e=3D1417440e3e ** A Sampaio & Filhos - T=C3=AAxteis SA ------------------------------------------------------------ ** A.Sampaio & Filhos - Textiles S.A. is a market leader in the manufactur= e of circular knitting. Equipped with the most modern technology and following the highest quality= standards=2C we deliver in time and in the right quality Presentation... Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8e= c661c4606682b4765dd&id=3Df89f591019&e=3D1417440e3e) ------------------------------------------------------------ http://fashionablyin.us1.list-manage2.com/track/click?u=3D8e7d8ec661c46066= 82b4765dd&id=3D83c5a71bd4&e=3D1417440e3e ** Zhejiang Apex Textile Co Ltd ------------------------------------------------------------ ** Established in 2008=2C Apex Textile Co.=2C Ltd. is an enterprise solely= invested by Taiwan merchants. Our factory covering an area of 20295 squar= e meters is located in Hangzhou Economic and Technological Development Zon= e=2C and was formally put into operation in October 2008. Having brought i= n ... Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8e= c661c4606682b4765dd&id=3D144a2c8a7b&e=3D1417440e3e) ------------------------------------------------------------ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Isaac Ray Fashionablyin Consultant Join Fashionablyin and start an exciting journey towards a bright new futu= re! As a consultant you are offered the chance to Make fashion connections= =2C Earn money and Have fun. ** BECOME A FASHIONABLYIN CONSULTANT TODAY (http://fashionablyin.us1.list-= manage1.com/track/click?u=3D8e7d8ec661c4606682b4765dd&id=3D7197aba3f7&e=3D= 1417440e3e) ** GO PREMIUM!! (http://fashionablyin.us1.list-manage1.com/track/click?u= =3D8e7d8ec661c4606682b4765dd&id=3D5e120ef0dc&e=3D1417440e3e) ** MARKETING SERVICES (http://fashionablyin.us1.list-manage.com/track/clic= k?u=3D8e7d8ec661c4606682b4765dd&id=3Dfb5d58b749&e=3D1417440e3e) ** ADVERTISE ON FASHIONABLYIN (http://fashionablyin.us1.list-manage.com/tr= ack/click?u=3D8e7d8ec661c4606682b4765dd&id=3D63dc5c1dbe&e=3D= 1417440e3e) ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3Df2ac3b0275&e=3D1417440e3e) ** (http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c4= 606682b4765dd&id=3D216868ce3a&e=3D1417440e3e) ** (http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c4= 606682b4765dd&id=3D7331788478&e=3D1417440e3e) ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3Ddcbc8bd8e1&e=3D1417440e3e) Copyright =C2=A9 2016 FASHIONABLYIN=2C All rights reserved. You subscribed on our website - Fashionablyin.com Our mailing address is: FASHIONABLYIN 2-4 Unit 27 Exmoor Street London=2C W10 6BD United Kingdom Want to change how you receive these emails? You can ** update your preferences (http://fashionablyin.us1.list-manage.c= om/profile?u=3D8e7d8ec661c4606682b4765dd&id=3Db4c7b5ed13&e=3D1417440e3e) or ** unsubscribe from this list (http://fashionablyin.us1.list-manage1.co= m/unsubscribe?u=3D8e7d8ec661c4606682b4765dd&id=3Db4c7b5ed13&e=3D1417440e3e&c= =3D3d4c9a0bce) From owner-svn-src-all@freebsd.org Tue Apr 19 14:41:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AC73B144AC for ; Tue, 19 Apr 2016 14:41:42 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03D061F39 for ; Tue, 19 Apr 2016 14:41:41 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: cc125860-063c-11e6-b8f9-33a5b3560672 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 19 Apr 2016 14:41:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u3JEfdme035810; Tue, 19 Apr 2016 08:41:39 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1461076899.1232.23.camel@freebsd.org> Subject: Re: svn commit: r298268 - head/sys/dev/spibus From: Ian Lepore To: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 19 Apr 2016 08:41:39 -0600 In-Reply-To: <201604191418.u3JEICrY023254@repo.freebsd.org> References: <201604191418.u3JEICrY023254@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 14:41:42 -0000 On Tue, 2016-04-19 at 14:18 +0000, Ruslan Bukin wrote: > Author: br > Date: Tue Apr 19 14:18:12 2016 > New Revision: 298268 > URL: https://svnweb.freebsd.org/changeset/base/298268 > > Log: > Add optional chip_select/deselect methods. This is required > when we want to keep CS asserted for multiple transfers. > This is missing a now-required mechanism to arbitrate ownership of the bus. If a leaf driver can take over the bus for longer than a single transfer, then it needs the same kind of logic as the iicbus uses (well, conceptually the same, it doesn't need the same horrible implementation). I also don't see any default implementation of the new methods, or a commit that adds the new functionality to all existing SPI controller drivers. -- Ian From owner-svn-src-all@freebsd.org Tue Apr 19 14:47:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB27B148B2; Tue, 19 Apr 2016 14:47:09 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DD8117D2; Tue, 19 Apr 2016 14:47:09 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JEl8tQ032819; Tue, 19 Apr 2016 14:47:08 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JEl85U032818; Tue, 19 Apr 2016 14:47:08 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604191447.u3JEl85U032818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 19 Apr 2016 14:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298269 - head/sys/dev/xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 14:47:09 -0000 Author: br Date: Tue Apr 19 14:47:08 2016 New Revision: 298269 URL: https://svnweb.freebsd.org/changeset/base/298269 Log: Add driver for Xilinx AXI Quad SPI device. The device was found in lowRISC hardware. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Added: head/sys/dev/xilinx/ head/sys/dev/xilinx/axi_quad_spi.c (contents, props changed) Added: head/sys/dev/xilinx/axi_quad_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xilinx/axi_quad_spi.c Tue Apr 19 14:47:08 2016 (r298269) @@ -0,0 +1,252 @@ +/*- + * Copyright (c) 2016 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Xilinx AXI_QUAD_SPI + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "spibus_if.h" + +#include +#include +#include +#include + +#include +#include +#include + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) + +#define SPI_SRR 0x40 /* Software reset register */ +#define SRR_RESET 0x0A /* The only reset value */ +#define SPI_CR 0x60 /* Control register */ +#define CR_LSB_FIRST (1 << 9) /* LSB first */ +#define CR_MASTER_TI (1 << 8) /* Master Transaction Inhibit */ +#define CR_MSS (1 << 7) /* Manual Slave Select */ +#define CR_RST_RX (1 << 6) /* RX FIFO Reset */ +#define CR_RST_TX (1 << 5) /* TX FIFO Reset */ +#define CR_CPHA (1 << 4) /* Clock phase */ +#define CR_CPOL (1 << 3) /* Clock polarity */ +#define CR_MASTER (1 << 2) /* Master (SPI master mode) */ +#define CR_SPE (1 << 1) /* SPI system enable */ +#define CR_LOOP (1 << 0) /* Local loopback mode */ +#define SPI_SR 0x64 /* Status register */ +#define SR_TX_FULL (1 << 3) /* Transmit full */ +#define SR_TX_EMPTY (1 << 2) /* Transmit empty */ +#define SR_RX_FULL (1 << 1) /* Receive full */ +#define SR_RX_EMPTY (1 << 0) /* Receive empty */ +#define SPI_DTR 0x68 /* Data transmit register */ +#define SPI_DRR 0x6C /* Data receive register */ +#define SPI_SSR 0x70 /* Slave select register */ +#define SPI_TFOR 0x74 /* Transmit FIFO Occupancy Register */ +#define SPI_RFOR 0x78 /* Receive FIFO Occupancy Register */ +#define SPI_DGIER 0x1C /* Device global interrupt enable register */ +#define SPI_IPISR 0x20 /* IP interrupt status register */ +#define SPI_IPIER 0x28 /* IP interrupt enable register */ + +struct spi_softc { + struct resource *res[1]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih; +}; + +static struct resource_spec spi_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +spi_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "xlnx,xps-spi-3.2")) + return (ENXIO); + + device_set_desc(dev, "Xilinx Quad SPI"); + return (BUS_PROBE_DEFAULT); +} + +static int +spi_chip_select(device_t dev, device_t child) +{ + struct spi_softc *sc; + uint32_t cs; + + sc = device_get_softc(dev); + + spibus_get_cs(child, &cs); + + WRITE4(sc, SPI_SSR, ~(1 << cs)); + + return (0); +} + +static int +spi_chip_deselect(device_t dev, device_t child) +{ + struct spi_softc *sc; + + sc = device_get_softc(dev); + + WRITE4(sc, SPI_SSR, ~0); + + return (0); +} + +static int +spi_attach(device_t dev) +{ + struct spi_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, spi_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* Reset */ + WRITE4(sc, SPI_SRR, SRR_RESET); + + DELAY(1000); + + reg = (CR_MASTER | CR_MSS | CR_RST_RX | CR_RST_TX); + WRITE4(sc, SPI_CR, reg); + WRITE4(sc, SPI_DGIER, 0); /* Disable interrupts */ + + reg = (CR_MASTER | CR_MSS | CR_SPE); + WRITE4(sc, SPI_CR, reg); + + device_add_child(dev, "spibus", 0); + return (bus_generic_attach(dev)); +} + +static int +spi_txrx(struct spi_softc *sc, uint8_t *out_buf, + uint8_t *in_buf, int bufsz, int cs) +{ + uint32_t data; + uint32_t i; + + for (i = 0; i < bufsz; i++) { + WRITE4(sc, SPI_DTR, out_buf[i]); + + while(!(READ4(sc, SPI_SR) & SR_TX_EMPTY)) + continue; + + data = READ4(sc, SPI_DRR); + if (in_buf) + in_buf[i] = (data & 0xff); + } + + return (0); +} + +static int +spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct spi_softc *sc; + uint32_t cs; + + sc = device_get_softc(dev); + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("%s: TX/RX command sizes should be equal", __func__)); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("%s: TX/RX data sizes should be equal", __func__)); + + /* get the proper chip select */ + spibus_get_cs(child, &cs); + + /* Command */ + spi_txrx(sc, cmd->tx_cmd, cmd->rx_cmd, cmd->tx_cmd_sz, cs); + + /* Data */ + spi_txrx(sc, cmd->tx_data, cmd->rx_data, cmd->tx_data_sz, cs); + + return (0); +} + +static device_method_t spi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, spi_probe), + DEVMETHOD(device_attach, spi_attach), + + /* SPI interface */ + DEVMETHOD(spibus_transfer, spi_transfer), + DEVMETHOD(spibus_chip_select, spi_chip_select), + DEVMETHOD(spibus_chip_deselect, spi_chip_deselect), + + DEVMETHOD_END +}; + +static driver_t spi_driver = { + "spi", + spi_methods, + sizeof(struct spi_softc), +}; + +static devclass_t spi_devclass; + +DRIVER_MODULE(spi, simplebus, spi_driver, spi_devclass, 0, 0); From owner-svn-src-all@freebsd.org Tue Apr 19 15:07:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1084CB13247; Tue, 19 Apr 2016 15:07:06 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D24FD144E; Tue, 19 Apr 2016 15:07:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JF74tN038956; Tue, 19 Apr 2016 15:07:04 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JF74HO038955; Tue, 19 Apr 2016 15:07:04 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201604191507.u3JF74HO038955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 19 Apr 2016 15:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298270 - head/sys/dev/amdtemp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:07:06 -0000 Author: loos Date: Tue Apr 19 15:07:04 2016 New Revision: 298270 URL: https://svnweb.freebsd.org/changeset/base/298270 Log: Add PCI ID for family 10h model 30h to amdtemp(4). This adds support to CPU found in PC Engines APU2 series. MFC after: 3 weeks Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Tue Apr 19 14:47:08 2016 (r298269) +++ head/sys/dev/amdtemp/amdtemp.c Tue Apr 19 15:07:04 2016 (r298270) @@ -80,6 +80,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC14 0x1703 #define DEVICEID_AMD_MISC15 0x1603 #define DEVICEID_AMD_MISC16 0x1533 +#define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_MISC17 0x141d static struct amdtemp_product { @@ -93,6 +94,7 @@ static struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_MISC14 }, { VENDORID_AMD, DEVICEID_AMD_MISC15 }, { VENDORID_AMD, DEVICEID_AMD_MISC16 }, + { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H }, { VENDORID_AMD, DEVICEID_AMD_MISC17 }, { 0, 0 } }; From owner-svn-src-all@freebsd.org Tue Apr 19 15:08:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61640B132C2; Tue, 19 Apr 2016 15:08:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30DE41722; Tue, 19 Apr 2016 15:08:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JF8Zj1039042; Tue, 19 Apr 2016 15:08:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JF8ZFQ039041; Tue, 19 Apr 2016 15:08:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604191508.u3JF8ZFQ039041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Apr 2016 15:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298271 - head/sbin/tunefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:08:36 -0000 Author: trasz Date: Tue Apr 19 15:08:35 2016 New Revision: 298271 URL: https://svnweb.freebsd.org/changeset/base/298271 Log: Mention fsck_ffs -E in tunefs(8). It's non-obvious that one should use it after enabling TRIM. Reviewed by: brueffer@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5928 Modified: head/sbin/tunefs/tunefs.8 Modified: head/sbin/tunefs/tunefs.8 ============================================================================== --- head/sbin/tunefs/tunefs.8 Tue Apr 19 15:07:04 2016 (r298270) +++ head/sbin/tunefs/tunefs.8 Tue Apr 19 15:08:35 2016 (r298271) @@ -28,7 +28,7 @@ .\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd June 22, 2011 +.Dd April 19, 2016 .Dt TUNEFS 8 .Os .Sh NAME @@ -166,9 +166,15 @@ device for each freed block. The trim enable flag is typically set when the underlying device uses flash-memory as the device can use the delete command to pre-zero or at least avoid copying blocks that have been deleted. +.Pp +Note that this does not trim blocks that are already free. +See the +.Xr fsck_ffs 8 +.Fl E +flag. .El .Pp -At least one of the above flags is required. +At least one of these flags is required. .Sh FILES .Bl -tag -width ".Pa /etc/fstab" .It Pa /etc/fstab From owner-svn-src-all@freebsd.org Tue Apr 19 15:18:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1423B1384E; Tue, 19 Apr 2016 15:18:32 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEF6D1141; Tue, 19 Apr 2016 15:18:32 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JFIVAd042222; Tue, 19 Apr 2016 15:18:31 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JFIVFA042221; Tue, 19 Apr 2016 15:18:31 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201604191518.u3JFIVFA042221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 19 Apr 2016 15:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298272 - head/lib/libgpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:18:33 -0000 Author: loos Date: Tue Apr 19 15:18:31 2016 New Revision: 298272 URL: https://svnweb.freebsd.org/changeset/base/298272 Log: Use GPIOTOGGLE to toggle the pin state instead of read, modify and write. Modified: head/lib/libgpio/gpio.c Modified: head/lib/libgpio/gpio.c ============================================================================== --- head/lib/libgpio/gpio.c Tue Apr 19 15:08:35 2016 (r298271) +++ head/lib/libgpio/gpio.c Tue Apr 19 15:18:31 2016 (r298272) @@ -181,14 +181,14 @@ gpio_pin_set(gpio_handle_t handle, gpio_ int gpio_pin_toggle(gpio_handle_t handle, gpio_pin_t pin) { - gpio_value_t value; + struct gpio_req gpreq; - value = gpio_pin_get(handle, pin); - if (value == GPIO_VALUE_INVALID) + bzero(&gpreq, sizeof(gpreq)); + gpreq.gp_pin = pin; + if (ioctl(handle, GPIOTOGGLE, &gpreq) < 0) return (-1); - value = !value; - return (gpio_pin_set(handle, pin, value)); + return (0); } int From owner-svn-src-all@freebsd.org Tue Apr 19 15:30:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5EB2B13C70; Tue, 19 Apr 2016 15:30:15 +0000 (UTC) (envelope-from howard0su@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66D221BE4; Tue, 19 Apr 2016 15:30:15 +0000 (UTC) (envelope-from howard0su@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id 2so22355181ioy.1; Tue, 19 Apr 2016 08:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=DigzlhHAXJeq6aXo9SUWQ8A6d9nFjn9u9k8GOlH6GgU=; b=fL/eX5xsA5sORA1J9P42AIQ1ITRHkTQ6eQXKzIztJk47uqwIqp2w+N2/OMTe3CWyLb mI7JXPokAq55ojR5p/Q8zpAnIKDO7bV9LnuqJbH16b1FNGYd2xqDxuXZtIBryWn/CvjV kibVfAFp2nV+2sjejFeLbkvIBsnY8CJJ1bbrej2pm6IvohFTa1WB+WuQwPc6muAXWjVo 5xnPNIa+OgNdtFsmxzAmo7TN383gVblOsZIepctlZMHTn3CfGGvsgwg4UUdKDIZnW1sS m0yReEq5e+/b51lGwmVzEzVViLnM2NCoXpmpHv2XNT/VfF0s3G5/RZ6N9ujXDfdjKPlR Joqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=DigzlhHAXJeq6aXo9SUWQ8A6d9nFjn9u9k8GOlH6GgU=; b=kNugpM1X/9Q5frnj6eGDUwKsQQB5p+xRTQOlPHpqIZNO+JO8pvG/Iplo2e+D23TIRR ZHOifiHjd4C464K9+yEU9Bb4gQATU9vasSaGdUD4J3srtrK655pnoEtf4AHrV0/QeqAh 66s038L3bbHC5PXBsXKy1Kc6Se9buSjGfcruJ20m4ZR1Ou81CdmQZlvQD0A4xKwLy5V4 pAjiQxRajQ2loQc9tc8m4zkQN7WCtdc7xGYZk9y/feY/3C37kFx8hml9tCjoWeEaNA/r ZO+XznLGPf0fWn1ZTFELcS4YwVg73wfjYEkn8TucuKeFojyizGzuO0LgKgRdjyqay+4H BgOA== X-Gm-Message-State: AOPr4FWHO/vFAniwJkxJtodUxjQMVuodbKQmBWLeaXU6t6SZKi6xymxicVSx6GT/4+mNAZOOCnLmiqq25gbMqw== X-Received: by 10.107.7.23 with SMTP id 23mr4198813ioh.64.1461079814530; Tue, 19 Apr 2016 08:30:14 -0700 (PDT) MIME-Version: 1.0 References: <201604182309.u3IN9MC6047480@repo.freebsd.org> In-Reply-To: <201604182309.u3IN9MC6047480@repo.freebsd.org> From: Howard Su Date: Tue, 19 Apr 2016 15:30:05 +0000 Message-ID: Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... To: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:30:15 -0000 this is wonderful change. this also helps a lot on the situation loading many .ko files from local disk. In my case, loading 5 different ko is reduced from 5 seconds to 1second. great job! -Howard On Tue, Apr 19, 2016 at 7:09 AM Allan Jude wrote: > Author: allanjude > Date: Mon Apr 18 23:09:22 2016 > New Revision: 298230 > URL: https://svnweb.freebsd.org/changeset/base/298230 > > Log: > A new implementation of the loader block cache > > The block cache implementation in loader has proven to be almost > useless, and in worst case even slowing down the disk reads due to > insufficient cache size and extra memory copy. > Also the current cache implementation does not cache reads from CDs, or > work with zfs built on top of multiple disks. > Instead of an LRU, this code uses a simple hash (O(1) read from cache), > and instead of a single global cache, a separate cache per block device. > The cache also implements limited read-ahead to increase performance. > To simplify read ahead management, the read ahead will not wrap over > bcache end, so in worst case, single block physical read will be performed > to fill the last block in bcache. > > Booting from a virtual CD over IPMI: > 0ms latency, before: 27 second, after: 7 seconds > 60ms latency, before: over 12 minutes, after: under 5 minutes. > > Submitted by: Toomas Soome > Reviewed by: delphij (previous version), emaste (previous version) > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D4713 > > Modified: > head/lib/libstand/cd9660.c > head/lib/libstand/dosfs.c > head/lib/libstand/dosfs.h > head/lib/libstand/ext2fs.c > head/lib/libstand/read.c > head/lib/libstand/stand.h > head/lib/libstand/ufs.c > head/lib/libstand/write.c > head/sys/boot/common/bcache.c > head/sys/boot/common/bootstrap.h > head/sys/boot/common/disk.c > head/sys/boot/common/md.c > head/sys/boot/common/module.c > head/sys/boot/efi/libefi/efipart.c > head/sys/boot/efi/libefi/libefi.c > head/sys/boot/efi/loader/main.c > head/sys/boot/i386/libfirewire/firewire.c > head/sys/boot/i386/libi386/bioscd.c > head/sys/boot/i386/libi386/biosdisk.c > head/sys/boot/i386/libi386/biosmem.c > head/sys/boot/i386/libi386/pxe.c > head/sys/boot/i386/loader/main.c > head/sys/boot/mips/beri/loader/beri_disk_cfi.c > head/sys/boot/mips/beri/loader/beri_disk_sdcard.c > head/sys/boot/ofw/libofw/ofw_disk.c > head/sys/boot/pc98/libpc98/bioscd.c > head/sys/boot/pc98/libpc98/biosdisk.c > head/sys/boot/pc98/libpc98/biosmem.c > head/sys/boot/pc98/loader/main.c > head/sys/boot/powerpc/kboot/hostdisk.c > head/sys/boot/powerpc/ps3/ps3cdrom.c > head/sys/boot/powerpc/ps3/ps3disk.c > head/sys/boot/uboot/lib/disk.c > head/sys/boot/usb/storage/umass_loader.c > head/sys/boot/userboot/userboot/host.c > head/sys/boot/userboot/userboot/main.c > head/sys/boot/userboot/userboot/userboot_disk.c > head/sys/boot/zfs/zfs.c > > Modified: head/lib/libstand/cd9660.c > > ============================================================================== > --- head/lib/libstand/cd9660.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/cd9660.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -143,7 +143,7 @@ susp_lookup_record(struct open_file *f, > if (bcmp(sh->type, SUSP_CONTINUATION, 2) == 0) { > shc = (ISO_RRIP_CONT *)sh; > error = f->f_dev->dv_strategy(f->f_devdata, F_READ, > - cdb2devb(isonum_733(shc->location)), > + cdb2devb(isonum_733(shc->location)), 0, > ISO_DEFAULT_BLOCK_SIZE, susp_buffer, &read); > > /* Bail if it fails. */ > @@ -288,7 +288,7 @@ cd9660_open(const char *path, struct ope > for (bno = 16;; bno++) { > twiddle(1); > rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, > cdb2devb(bno), > - ISO_DEFAULT_BLOCK_SIZE, buf, > &read); > + 0, ISO_DEFAULT_BLOCK_SIZE, buf, > &read); > if (rc) > goto out; > if (read != ISO_DEFAULT_BLOCK_SIZE) { > @@ -322,7 +322,7 @@ cd9660_open(const char *path, struct ope > twiddle(1); > rc = f->f_dev->dv_strategy > (f->f_devdata, F_READ, > - cdb2devb(bno + boff), > + cdb2devb(bno + boff), 0, > ISO_DEFAULT_BLOCK_SIZE, > buf, &read); > if (rc) > @@ -381,7 +381,7 @@ cd9660_open(const char *path, struct ope > bno = isonum_733(rec.extent) + > isonum_711(rec.ext_attr_length); > twiddle(1); > rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, > cdb2devb(bno), > - ISO_DEFAULT_BLOCK_SIZE, buf, &read); > + 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read); > if (rc) > goto out; > if (read != ISO_DEFAULT_BLOCK_SIZE) { > @@ -438,7 +438,8 @@ buf_read_file(struct open_file *f, char > > twiddle(16); > rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, > - cdb2devb(blkno), ISO_DEFAULT_BLOCK_SIZE, fp->f_buf, > &read); > + cdb2devb(blkno), 0, ISO_DEFAULT_BLOCK_SIZE, > + fp->f_buf, &read); > if (rc) > return (rc); > if (read != ISO_DEFAULT_BLOCK_SIZE) > > Modified: head/lib/libstand/dosfs.c > > ============================================================================== > --- head/lib/libstand/dosfs.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/dosfs.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -131,7 +131,18 @@ static DOS_DE dot[2] = { > #define stclus(sz, de) ((sz) != 32 ? cv2((de)->clus) : \ > ((u_int)cv2((de)->dex.h_clus) << 16) | \ > cv2((de)->clus)) > - > + > +/* > + * fat cache metadata > + */ > +struct fatcache { > + int unit; /* disk unit number */ > + int size; /* buffer (and fat) size in sectors */ > + u_char *buf; > +}; > + > +static struct fatcache fat; > + > static int dosunmount(DOS_FS *); > static int parsebs(DOS_FS *, DOS_BS *); > static int namede(DOS_FS *, const char *, DOS_DE **); > @@ -143,8 +154,36 @@ static int fatcnt(DOS_FS *, u_int); > static int fatget(DOS_FS *, u_int *); > static int fatend(u_int, u_int); > static int ioread(DOS_FS *, u_int, void *, u_int); > -static int iobuf(DOS_FS *, u_int); > -static int ioget(struct open_file *, u_int, void *, u_int); > +static int ioget(struct open_file *, daddr_t, size_t, void *, u_int); > + > +static void > +dos_read_fat(DOS_FS *fs, struct open_file *fd) > +{ > + struct devdesc *dd = fd->f_devdata; > + > + if (fat.buf != NULL) { /* can we reuse old buffer? */ > + if (fat.size != fs->spf) { > + free(fat.buf); /* no, free old buffer */ > + fat.buf = NULL; > + } > + } > + > + if (fat.buf == NULL) > + fat.buf = malloc(secbyt(fs->spf)); > + > + if (fat.buf != NULL) { > + if (ioget(fd, fs->lsnfat, 0, fat.buf, secbyt(fs->spf)) == 0) { > + fat.size = fs->spf; > + fat.unit = dd->d_unit; > + return; > + } > + } > + if (fat.buf != NULL) /* got IO error */ > + free(fat.buf); > + fat.buf = NULL; > + fat.unit = -1; /* impossible unit */ > + fat.size = 0; > +} > > /* > * Mount DOS filesystem > @@ -153,15 +192,25 @@ static int > dos_mount(DOS_FS *fs, struct open_file *fd) > { > int err; > + struct devdesc *dd = fd->f_devdata; > + u_char *buf; > > bzero(fs, sizeof(DOS_FS)); > fs->fd = fd; > - if ((err = !(fs->buf = malloc(SECSIZ)) ? errno : 0) || > - (err = ioget(fs->fd, 0, fs->buf, 1)) || > - (err = parsebs(fs, (DOS_BS *)fs->buf))) { > + > + if ((err = !(buf = malloc(secbyt(1))) ? errno : 0) || > + (err = ioget(fs->fd, 0, 0, buf, secbyt(1))) || > + (err = parsebs(fs, (DOS_BS *)buf))) { > + if (buf != NULL) > + free(buf); > (void)dosunmount(fs); > return(err); > } > + free(buf); > + > + if (fat.buf == NULL || fat.unit != dd->d_unit) > + dos_read_fat(fs, fd); > + > fs->root = dot[0]; > fs->root.name[0] = ' '; > if (fs->fatsz == 32) { > @@ -194,8 +243,6 @@ dos_unmount(DOS_FS *fs) > static int > dosunmount(DOS_FS *fs) > { > - if (fs->buf) > - free(fs->buf); > free(fs); > return(0); > } > @@ -252,42 +299,47 @@ dos_read(struct open_file *fd, void *buf > DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; > int err = 0; > > + /* > + * as ioget() can be called *a lot*, use twiddle here. > + * also 4 seems to be good value not to slow loading down too much: > + * with 270MB file (~540k ioget() calls, twiddle can easily waste > 4-5sec. > + */ > + twiddle(4); > nb = (u_int)nbyte; > if ((size = fsize(f->fs, &f->de)) == -1) > return EINVAL; > if (nb > (n = size - f->offset)) > - nb = n; > + nb = n; > off = f->offset; > if ((clus = stclus(f->fs->fatsz, &f->de))) > - off &= f->fs->bsize - 1; > + off &= f->fs->bsize - 1; > c = f->c; > cnt = nb; > while (cnt) { > - n = 0; > - if (!c) { > - if ((c = clus)) > - n = bytblk(f->fs, f->offset); > - } else if (!off) > - n++; > - while (n--) { > - if ((err = fatget(f->fs, &c))) > + n = 0; > + if (!c) { > + if ((c = clus)) > + n = bytblk(f->fs, f->offset); > + } else if (!off) > + n++; > + while (n--) { > + if ((err = fatget(f->fs, &c))) > goto out; > - if (!okclus(f->fs, c)) { > + if (!okclus(f->fs, c)) { > err = EINVAL; > goto out; > } > - } > - if (!clus || (n = f->fs->bsize - off) > cnt) > - n = cnt; > - if ((err = ioread(f->fs, (c ? blkoff(f->fs, c) : > - secbyt(f->fs->lsndir)) + off, > - buf, n))) > + } > + if (!clus || (n = f->fs->bsize - off) > cnt) > + n = cnt; > + if ((err = ioread(f->fs, (c ? blkoff(f->fs, c) : > + secbyt(f->fs->lsndir)) + off, buf, > n))) > goto out; > - f->offset += n; > - f->c = c; > - off = 0; > - buf = (char *)buf + n; > - cnt -= n; > + f->offset += n; > + f->c = c; > + off = 0; > + buf = (char *)buf + n; > + cnt -= n; > } > out: > if (resid) > @@ -364,6 +416,23 @@ dos_stat(struct open_file *fd, struct st > } > > static int > +dos_checksum(char *name, char *ext) > +{ > + int x, i; > + char buf[11]; > + > + bcopy(name, buf, 8); > + bcopy(ext, buf+8, 3); > + x = 0; > + for (i = 0; i < 11; i++) { > + x = ((x & 1) << 7) | (x >> 1); > + x += buf[i]; > + x &= 0xff; > + } > + return (x); > +} > + > +static int > dos_readdir(struct open_file *fd, struct dirent *d) > { > /* DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; */ > @@ -417,12 +486,7 @@ dos_readdir(struct open_file *fd, struct > } > } else { > if (xdn == 1) { > - x = 0; > - for (i = 0; i < 11; i++) { > - x = ((x & 1) << 7) | (x >> 1); > - x += dd.de.name[i]; > - x &= 0xff; > - } > + x = dos_checksum(dd.de.name, dd.de.ext); > if (x == chk) > break; > } else { > @@ -555,7 +619,7 @@ lookup(DOS_FS *fs, u_int clus, const cha > else > return EINVAL; > for (sec = 0; sec < nsec; sec++) { > - if ((err = ioget(fs->fd, lsec + sec, dir, 1))) > + if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1)))) > return err; > for (ent = 0; ent < DEPSEC; ent++) { > if (!*dir[ent].de.name) > @@ -577,9 +641,7 @@ lookup(DOS_FS *fs, u_int clus, const cha > } > } else if (!(dir[ent].de.attr & FA_LABEL)) { > if ((ok = xdn == 1)) { > - for (x = 0, i = 0; i < 11; i++) > - x = ((((x & 1) << 7) | (x >> 1)) + > - dir[ent].de.name[i]) & 0xff; > + x = dos_checksum(dir[ent].de.name, > dir[ent].de.ext); > ok = chk == x && > !strcasecmp(name, (const char *)lfn); > } > @@ -699,22 +761,52 @@ fatcnt(DOS_FS *fs, u_int c) > } > > /* > - * Get next cluster in cluster chain > + * Get next cluster in cluster chain. Use in core fat cache unless another > + * device replaced it. > */ > static int > fatget(DOS_FS *fs, u_int *c) > { > u_char buf[4]; > - u_int x; > - int err; > + u_char *s; > + u_int x, offset, off, n, nbyte, lsec; > + struct devdesc *dd = fs->fd->f_devdata; > + int err = 0; > + > + if (fat.unit != dd->d_unit) { > + /* fat cache was changed to another device, dont use it */ > + err = ioread(fs, secbyt(fs->lsnfat) + fatoff(fs->fatsz, *c), buf, > + fs->fatsz != 32 ? 2 : 4); > + if (err) > + return err; > + } else { > + offset = fatoff(fs->fatsz, *c); > + nbyte = fs->fatsz != 32 ? 2 : 4; > + > + s = buf; > + if ((off = offset & (SECSIZ - 1))) { > + offset -= off; > + lsec = bytsec(offset); > + offset += SECSIZ; > + if ((n = SECSIZ - off) > nbyte) > + n = nbyte; > + memcpy(s, fat.buf + secbyt(lsec) + off, n); > + s += n; > + nbyte -= n; > + } > + n = nbyte & (SECSIZ - 1); > + if (nbyte -= n) { > + memcpy(s, fat.buf + secbyt(bytsec(offset)), nbyte); > + offset += nbyte; > + s += nbyte; > + } > + if (n) > + memcpy(s, fat.buf + secbyt(bytsec(offset)), n); > + } > > - err = ioread(fs, secbyt(fs->lsnfat) + fatoff(fs->fatsz, *c), buf, > - fs->fatsz != 32 ? 2 : 4); > - if (err) > - return err; > x = fs->fatsz != 32 ? cv2(buf) : cv4(buf); > *c = fs->fatsz == 12 ? *c & 1 ? x >> 4 : x & 0xfff : x; > - return 0; > + return (0); > } > > /* > @@ -739,42 +831,24 @@ ioread(DOS_FS *fs, u_int offset, void *b > s = buf; > if ((off = offset & (SECSIZ - 1))) { > offset -= off; > - if ((err = iobuf(fs, bytsec(offset)))) > - return err; > - offset += SECSIZ; > if ((n = SECSIZ - off) > nbyte) > n = nbyte; > - memcpy(s, fs->buf + off, n); > + if ((err = ioget(fs->fd, bytsec(offset), off, s, n))) > + return err; > + offset += SECSIZ; > s += n; > nbyte -= n; > } > n = nbyte & (SECSIZ - 1); > if (nbyte -= n) { > - if ((err = ioget(fs->fd, bytsec(offset), s, bytsec(nbyte)))) > + if ((err = ioget(fs->fd, bytsec(offset), 0, s, nbyte))) > return err; > offset += nbyte; > s += nbyte; > } > if (n) { > - if ((err = iobuf(fs, bytsec(offset)))) > - return err; > - memcpy(s, fs->buf, n); > - } > - return 0; > -} > - > -/* > - * Buffered sector-based I/O primitive > - */ > -static int > -iobuf(DOS_FS *fs, u_int lsec) > -{ > - int err; > - > - if (fs->bufsec != lsec) { > - if ((err = ioget(fs->fd, lsec, fs->buf, 1))) > + if ((err = ioget(fs->fd, bytsec(offset), 0, s, n))) > return err; > - fs->bufsec = lsec; > } > return 0; > } > @@ -783,13 +857,8 @@ iobuf(DOS_FS *fs, u_int lsec) > * Sector-based I/O primitive > */ > static int > -ioget(struct open_file *fd, u_int lsec, void *buf, u_int nsec) > +ioget(struct open_file *fd, daddr_t lsec, size_t offset, void *buf, u_int > size) > { > - int err; > - > - twiddle(1); > - if ((err = (fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, > - secbyt(nsec), buf, NULL))) > - return(err); > - return(0); > + return ((fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, offset, > + size, buf, NULL)); > } > > Modified: head/lib/libstand/dosfs.h > > ============================================================================== > --- head/lib/libstand/dosfs.h Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/dosfs.h Mon Apr 18 23:09:22 2016 (r298230) > @@ -96,8 +96,6 @@ typedef union { > > typedef struct { > struct open_file *fd; /* file descriptor */ > - u_char *buf; /* buffer */ > - u_int bufsec; /* buffered sector */ > u_int links; /* active links to structure */ > u_int spc; /* sectors per cluster */ > u_int bsize; /* cluster size in bytes */ > > Modified: head/lib/libstand/ext2fs.c > > ============================================================================== > --- head/lib/libstand/ext2fs.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/ext2fs.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -355,7 +355,7 @@ ext2fs_open(const char *upath, struct op > fp->f_fs = fs; > twiddle(1); > error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - EXT2_SBLOCK, EXT2_SBSIZE, (char *)fs, &buf_size); > + EXT2_SBLOCK, 0, EXT2_SBSIZE, (char *)fs, &buf_size); > if (error) > goto out; > > @@ -397,7 +397,7 @@ ext2fs_open(const char *upath, struct op > fp->f_bg = malloc(len); > twiddle(1); > error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, len, > + EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, 0, len, > (char *)fp->f_bg, &buf_size); > if (error) > goto out; > @@ -509,7 +509,7 @@ ext2fs_open(const char *upath, struct op > > twiddle(1); > error = > (f->f_dev->dv_strategy)(f->f_devdata, > - F_READ, fsb_to_db(fs, disk_block), > + F_READ, fsb_to_db(fs, disk_block), 0, > fs->fs_bsize, buf, &buf_size); > if (error) > goto out; > @@ -570,7 +570,7 @@ read_inode(ino_t inumber, struct open_fi > buf = malloc(fs->fs_bsize); > twiddle(1); > error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - ino_to_db(fs, fp->f_bg, inumber), fs->fs_bsize, buf, &rsize); > + ino_to_db(fs, fp->f_bg, inumber), 0, fs->fs_bsize, buf, > &rsize); > if (error) > goto out; > if (rsize != fs->fs_bsize) { > @@ -667,7 +667,7 @@ block_map(struct open_file *f, daddr_t f > malloc(fs->fs_bsize); > twiddle(1); > error = (f->f_dev->dv_strategy)(f->f_devdata, > F_READ, > - fsb_to_db(fp->f_fs, ind_block_num), > fs->fs_bsize, > + fsb_to_db(fp->f_fs, ind_block_num), 0, > fs->fs_bsize, > fp->f_blk[level], &fp->f_blksize[level]); > if (error) > return (error); > @@ -725,7 +725,7 @@ buf_read_file(struct open_file *f, char > } else { > twiddle(4); > error = (f->f_dev->dv_strategy)(f->f_devdata, > F_READ, > - fsb_to_db(fs, disk_block), block_size, > + fsb_to_db(fs, disk_block), 0, block_size, > fp->f_buf, &fp->f_buf_size); > if (error) > goto done; > > Modified: head/lib/libstand/read.c > > ============================================================================== > --- head/lib/libstand/read.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/read.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -79,7 +79,7 @@ read(int fd, void *dest, size_t bcount) > if (f->f_flags & F_RAW) { > twiddle(4); > errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - btodb(f->f_offset), bcount, dest, > &resid); > + btodb(f->f_offset), 0, bcount, dest, > &resid); > if (errno) > return (-1); > f->f_offset += resid; > > Modified: head/lib/libstand/stand.h > > ============================================================================== > --- head/lib/libstand/stand.h Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/stand.h Mon Apr 18 23:09:22 2016 (r298230) > @@ -138,8 +138,8 @@ struct devsw { > const char dv_name[8]; > int dv_type; /* opaque type constant, > arch-dependant */ > int (*dv_init)(void); /* early probe call */ > - int (*dv_strategy)(void *devdata, int rw, daddr_t blk, > size_t size, > - char *buf, size_t *rsize); > + int (*dv_strategy)(void *devdata, int rw, daddr_t blk, > + size_t offset, size_t size, char *buf, size_t > *rsize); > int (*dv_open)(struct open_file *f, ...); > int (*dv_close)(struct open_file *f); > int (*dv_ioctl)(struct open_file *f, u_long cmd, void > *data); > @@ -154,6 +154,24 @@ extern struct devsw netdev; > > extern int errno; > > +/* > + * Generic device specifier; architecture-dependent > + * versions may be larger, but should be allowed to > + * overlap. > + */ > +struct devdesc > +{ > + struct devsw *d_dev; > + int d_type; > +#define DEVT_NONE 0 > +#define DEVT_DISK 1 > +#define DEVT_NET 2 > +#define DEVT_CD 3 > +#define DEVT_ZFS 4 > + int d_unit; > + void *d_opendata; > +}; > + > struct open_file { > int f_flags; /* see F_* below */ > struct devsw *f_dev; /* pointer to device operations */ > > Modified: head/lib/libstand/ufs.c > > ============================================================================== > --- head/lib/libstand/ufs.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/ufs.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -157,7 +157,7 @@ read_inode(inumber, f) > buf = malloc(fs->fs_bsize); > twiddle(1); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize, > + fsbtodb(fs, ino_to_fsba(fs, inumber)), 0, fs->fs_bsize, > buf, &rsize); > if (rc) > goto out; > @@ -267,7 +267,7 @@ block_map(f, file_block, disk_block_p) > malloc(fs->fs_bsize); > twiddle(1); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsbtodb(fp->f_fs, ind_block_num), > + fsbtodb(fp->f_fs, ind_block_num), 0, > fs->fs_bsize, > fp->f_blk[level], > &fp->f_blksize[level]); > @@ -348,7 +348,7 @@ buf_write_file(f, buf_p, size_p) > > twiddle(4); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsbtodb(fs, disk_block), > + fsbtodb(fs, disk_block), 0, > block_size, fp->f_buf, &fp->f_buf_size); > if (rc) > return (rc); > @@ -367,7 +367,7 @@ buf_write_file(f, buf_p, size_p) > > twiddle(4); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, > - fsbtodb(fs, disk_block), > + fsbtodb(fs, disk_block), 0, > block_size, fp->f_buf, &fp->f_buf_size); > return (rc); > } > @@ -408,7 +408,7 @@ buf_read_file(f, buf_p, size_p) > } else { > twiddle(4); > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - fsbtodb(fs, disk_block), > + fsbtodb(fs, disk_block), 0, > block_size, fp->f_buf, &fp->f_buf_size); > if (rc) > return (rc); > @@ -521,7 +521,7 @@ ufs_open(upath, f) > */ > for (i = 0; sblock_try[i] != -1; i++) { > rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, > - sblock_try[i] / DEV_BSIZE, SBLOCKSIZE, > + sblock_try[i] / DEV_BSIZE, 0, SBLOCKSIZE, > (char *)fs, &buf_size); > if (rc) > goto out; > @@ -651,7 +651,7 @@ ufs_open(upath, f) > > twiddle(1); > rc = (f->f_dev->dv_strategy)(f->f_devdata, > - F_READ, fsbtodb(fs, disk_block), > + F_READ, fsbtodb(fs, disk_block), 0, > fs->fs_bsize, buf, &buf_size); > if (rc) > goto out; > > Modified: head/lib/libstand/write.c > > ============================================================================== > --- head/lib/libstand/write.c Mon Apr 18 22:00:26 2016 (r298229) > +++ head/lib/libstand/write.c Mon Apr 18 23:09:22 2016 (r298230) > @@ -82,7 +82,7 @@ write(fd, dest, bcount) > if (f->f_flags & F_RAW) { > twiddle(4); > errno = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, > - btodb(f->f_offset), bcount, dest, &resid); > + btodb(f->f_offset), 0, bcount, dest, &resid); > if (errno) > return (-1); > f->f_offset += resid; > > Modified: head/sys/boot/common/bcache.c > > ============================================================================== > --- head/sys/boot/common/bcache.c Mon Apr 18 22:00:26 2016 > (r298229) > +++ head/sys/boot/common/bcache.c Mon Apr 18 23:09:22 2016 > (r298230) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 1998 Michael Smith > + * Copyright 2015 Toomas Soome > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -25,99 +26,155 @@ > */ > > #include > +#include > __FBSDID("$FreeBSD$"); > > /* > - * Simple LRU block cache > + * Simple hashed block cache > */ > > #include > > #include > #include > -#include > +#include > > #include "bootstrap.h" > > /* #define BCACHE_DEBUG */ > > #ifdef BCACHE_DEBUG > -#define BCACHE_TIMEOUT 10 > # define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## > args) > #else > -#define BCACHE_TIMEOUT 2 > # define DEBUG(fmt, args...) > #endif > > - > struct bcachectl > { > daddr_t bc_blkno; > - time_t bc_stamp; > int bc_count; > }; > > -static struct bcachectl *bcache_ctl; > -static caddr_t bcache_data; > -static bitstr_t *bcache_miss; > -static u_int bcache_nblks; > -static u_int bcache_blksize; > -static u_int bcache_hits, bcache_misses, bcache_ops, > bcache_bypasses; > -static u_int bcache_flushes; > -static u_int bcache_bcount; > - > -static void bcache_invalidate(daddr_t blkno); > -static void bcache_insert(caddr_t buf, daddr_t blkno); > -static int bcache_lookup(caddr_t buf, daddr_t blkno); > +/* > + * bcache per device node. cache is allocated on device first open and > freed > + * on last close, to save memory. The issue there is the size; biosdisk > + * supports up to 31 (0x1f) devices. Classic setup would use single disk > + * to boot from, but this has changed with zfs. > + */ > +struct bcache { > + struct bcachectl *bcache_ctl; > + caddr_t bcache_data; > + u_int bcache_nblks; > + size_t ra; > +}; > + > +static u_int bcache_total_nblks; /* set by bcache_init */ > +static u_int bcache_blksize; /* set by bcache_init */ > +static u_int bcache_numdev; /* set by bcache_add_dev */ > +/* statistics */ > +static u_int bcache_units; /* number of devices with cache */ > +static u_int bcache_unit_nblks; /* nblocks per unit */ > +static u_int bcache_hits; > +static u_int bcache_misses; > +static u_int bcache_ops; > +static u_int bcache_bypasses; > +static u_int bcache_bcount; > +static u_int bcache_rablks; > + > +#define BHASH(bc, blkno) ((blkno) & ((bc)->bcache_nblks - > 1)) > +#define BCACHE_LOOKUP(bc, blkno) \ > + ((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno)) > +#define BCACHE_READAHEAD 256 > +#define BCACHE_MINREADAHEAD 32 > + > +static void bcache_invalidate(struct bcache *bc, daddr_t blkno); > +static void bcache_insert(struct bcache *bc, daddr_t blkno); > +static void bcache_free_instance(struct bcache *bc); > > /* > * Initialise the cache for (nblks) of (bsize). > */ > -int > +void > bcache_init(u_int nblks, size_t bsize) > { > - /* discard any old contents */ > - if (bcache_data != NULL) { > - free(bcache_data); > - bcache_data = NULL; > - free(bcache_ctl); > - } > - > - /* Allocate control structures */ > - bcache_nblks = nblks; > + /* set up control data */ > + bcache_total_nblks = nblks; > bcache_blksize = bsize; > - bcache_data = malloc(bcache_nblks * bcache_blksize); > - bcache_ctl = (struct bcachectl *)malloc(bcache_nblks * sizeof(struct > bcachectl)); > - bcache_miss = bit_alloc((bcache_nblks + 1) / 2); > - if ((bcache_data == NULL) || (bcache_ctl == NULL) || (bcache_miss == > NULL)) { > - if (bcache_miss) > - free(bcache_miss); > - if (bcache_ctl) > - free(bcache_ctl); > - if (bcache_data) > - free(bcache_data); > - bcache_data = NULL; > - return(ENOMEM); > - } > - > - return(0); > } > > /* > - * Flush the cache > + * add number of devices to bcache. we have to divide cache space > + * between the devices, so bcache_add_dev() can be used to set up the > + * number. The issue is, we need to get the number before actual > allocations. > + * bcache_add_dev() is supposed to be called from device init() call, so > the > + * assumption is, devsw dv_init is called for plain devices first, and > + * for zfs, last. > */ > void > -bcache_flush(void) > +bcache_add_dev(int devices) > { > - u_int i; > + bcache_numdev += devices; > +} > > - bcache_flushes++; > +void * > +bcache_allocate(void) > +{ > + u_int i; > + struct bcache *bc = malloc(sizeof (struct bcache)); > + int disks = bcache_numdev; > + > + if (disks == 0) > + disks = 1; /* safe guard */ > + > + if (bc == NULL) { > + errno = ENOMEM; > + return (bc); > + } > + > + /* > + * the bcache block count must be power of 2 for hash function > + */ > + i = fls(disks) - 1; /* highbit - 1 */ > + if (disks > (1 << i)) /* next power of 2 */ > + i++; > + > + bc->bcache_nblks = bcache_total_nblks >> i; > + bcache_unit_nblks = bc->bcache_nblks; > + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); > + if (bc->bcache_data == NULL) { > + /* dont error out yet. fall back to 32 blocks and try again */ > + bc->bcache_nblks = 32; > + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); > + } > + > + bc->bcache_ctl = malloc(bc->bcache_nblks * sizeof(struct bcachectl)); > + > + if ((bc->bcache_data == NULL) || (bc->bcache_ctl == NULL)) { > + bcache_free_instance(bc); > + errno = ENOMEM; > + return(NULL); > + } > > /* Flush the cache */ > - for (i = 0; i < bcache_nblks; i++) { > - bcache_ctl[i].bc_count = -1; > - bcache_ctl[i].bc_blkno = -1; > - } > + for (i = 0; i < bc->bcache_nblks; i++) { > + bc->bcache_ctl[i].bc_count = -1; > + bc->bcache_ctl[i].bc_blkno = -1; > + } > + bcache_units++; > + bc->ra = BCACHE_READAHEAD; /* optimistic read ahead */ > + return (bc); > +} > + > +void > +bcache_free(void *cache) > +{ > + struct bcache *bc = cache; > + > + if (bc == NULL) > + return; > + > + bcache_free_instance(bc); > + bcache_units--; > } > > /* > @@ -125,31 +182,22 @@ bcache_flush(void) > * cache with the new values. > */ > static int > -write_strategy(void *devdata, int unit, int rw, daddr_t blk, size_t size, > - char *buf, size_t *rsize) > +write_strategy(void *devdata, int rw, daddr_t blk, size_t offset, > + size_t size, char *buf, size_t *rsize) > { > struct bcache_devdata *dd = (struct bcache_devdata *)devdata; > + struct bcache *bc = dd->dv_cache; > daddr_t i, nblk; > - int err; > > nblk = size / bcache_blksize; > > /* Invalidate the blocks being written */ > for (i = 0; i < nblk; i++) { > - bcache_invalidate(blk + i); > + bcache_invalidate(bc, blk + i); > } > > /* Write the blocks */ > - err = dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize); > - > - /* Populate the block cache with the new data */ > - if (err == 0) { > - for (i = 0; i < nblk; i++) { > - bcache_insert(buf + (i * bcache_blksize),blk + i); > - } > - } > - > - return err; > + return (dd->dv_strategy(dd->dv_devdata, rw, blk, offset, size, buf, > rsize)); > } > > /* > @@ -158,61 +206,87 @@ write_strategy(void *devdata, int unit, > * device I/O and then use the I/O results to populate the cache. > */ > static int > -read_strategy(void *devdata, int unit, int rw, daddr_t blk, size_t size, > - char *buf, size_t *rsize) > +read_strategy(void *devdata, int rw, daddr_t blk, size_t offset, > + size_t size, char *buf, size_t *rsize) > { > struct bcache_devdata *dd = (struct bcache_devdata *)devdata; > - int p_size, result; > - daddr_t p_blk, i, j, nblk; > + struct bcache *bc = dd->dv_cache; > + size_t i, nblk, p_size, r_size, complete, ra; > + int result; > + daddr_t p_blk; > caddr_t p_buf; > > + if (bc == NULL) { > + errno = ENODEV; > + return (-1); > + } > + > + if (rsize != NULL) > + *rsize = 0; > + > nblk = size / bcache_blksize; > + if ((nblk == 0 && size != 0) || offset != 0) > + nblk++; > result = 0; > + complete = 1; > > - /* Satisfy any cache hits up front */ > + /* Satisfy any cache hits up front, break on first miss */ > for (i = 0; i < nblk; i++) { > - if (bcache_lookup(buf + (bcache_blksize * i), blk + i)) { > - bit_set(bcache_miss, i); /* cache miss */ > - bcache_misses++; > + if (BCACHE_LOOKUP(bc, (daddr_t)(blk + i))) { > + bcache_misses += (nblk - i); > + complete = 0; > + if (nblk - i > BCACHE_MINREADAHEAD && bc->ra > > BCACHE_MINREADAHEAD) > + bc->ra >>= 1; /* reduce read ahead */ > + break; > } else { > - bit_clear(bcache_miss, i); /* cache hit */ > bcache_hits++; > } > } > > - /* Go back and fill in any misses XXX optimise */ > - p_blk = -1; > - p_buf = NULL; > - p_size = 0; > - for (i = 0; i < nblk; i++) { > - if (bit_test(bcache_miss, i)) { > - /* miss, add to pending transfer */ > - if (p_blk == -1) { > - p_blk = blk + i; > - p_buf = buf + (bcache_blksize * i); > - p_size = 1; > - } else { > - p_size++; > - } > - } else if (p_blk != -1) { > - /* hit, complete pending transfer */ > - result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * > bcache_blksize, p_buf, NULL); > - if (result != 0) > - goto done; > - for (j = 0; j < p_size; j++) > - bcache_insert(p_buf + (j * bcache_blksize), p_blk + j); > - p_blk = -1; > - } > - } > - if (p_blk != -1) { > - /* pending transfer left */ > - result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * > bcache_blksize, p_buf, NULL); > - if (result != 0) > - goto done; > - for (j = 0; j < p_size; j++) > - bcache_insert(p_buf + (j * bcache_blksize), p_blk + j); > - } > - > + if (complete) { /* whole set was in cache, return it */ > + if (bc->ra < BCACHE_READAHEAD) > + bc->ra <<= 1; /* increase read ahead */ > + bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, > + buf, size); > + goto done; > + } > + > + /* > + * Fill in any misses. From check we have i pointing to first missing > + * block, read in all remaining blocks + readahead. > + * We have space at least for nblk - i before bcache wraps. > + */ > + p_blk = blk + i; > + p_buf = bc->bcache_data + (bcache_blksize * BHASH(bc, p_blk)); > + r_size = bc->bcache_nblks - BHASH(bc, p_blk); /* remaining blocks */ > + > + p_size = MIN(r_size, nblk - i); /* read at least those blocks */ > + > + ra = bc->bcache_nblks - BHASH(bc, p_blk + p_size); > + if (ra != bc->bcache_nblks) { /* do we have RA space? */ > + ra = MIN(bc->ra, ra); > + p_size += ra; > + } > + > + /* invalidate bcache */ > + for (i = 0; i < p_size; i++) { > + bcache_invalidate(bc, p_blk + i); > + } > + r_size = 0; > + result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, 0, > + p_size * bcache_blksize, p_buf, &r_size); > + > + if (result) > + goto done; > + > + r_size /= bcache_blksize; > + for (i = 0; i < r_size; i++) > + bcache_insert(bc, p_blk + i); > + > + bcache_rablks += ra; > + bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, > buf, > + size); > + > done: > if ((result == 0) && (rsize != NULL)) > *rsize = size; > @@ -220,130 +294,144 @@ read_strategy(void *devdata, int unit, i > } > > /* > - * Requests larger than 1/2 the cache size will be bypassed and go > + * Requests larger than 1/2 cache size will be bypassed and go > * directly to the disk. XXX tune this. > */ > int > -bcache_strategy(void *devdata, int unit, int rw, daddr_t blk, size_t size, > - char *buf, size_t *rsize) > +bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset, > + size_t size, char *buf, size_t *rsize) > { > - static int bcache_unit = -1; > struct bcache_devdata *dd = (struct bcache_devdata *)devdata; > + struct bcache *bc = dd->dv_cache; > + u_int bcache_nblks = 0; > + int nblk, cblk, ret; > + size_t csize, isize, total; > > bcache_ops++; > > - if(bcache_unit != unit) { > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > -- -Howard From owner-svn-src-all@freebsd.org Tue Apr 19 15:36:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC6FFB14019; Tue, 19 Apr 2016 15:36:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 836311200; Tue, 19 Apr 2016 15:36:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JFaICx048496; Tue, 19 Apr 2016 15:36:18 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JFaIYq048495; Tue, 19 Apr 2016 15:36:18 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604191536.u3JFaIYq048495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 19 Apr 2016 15:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298273 - head/sys/dev/xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:36:19 -0000 Author: br Date: Tue Apr 19 15:36:18 2016 New Revision: 298273 URL: https://svnweb.freebsd.org/changeset/base/298273 Log: Assert CS for single transfers. Modified: head/sys/dev/xilinx/axi_quad_spi.c Modified: head/sys/dev/xilinx/axi_quad_spi.c ============================================================================== --- head/sys/dev/xilinx/axi_quad_spi.c Tue Apr 19 15:18:31 2016 (r298272) +++ head/sys/dev/xilinx/axi_quad_spi.c Tue Apr 19 15:36:18 2016 (r298273) @@ -123,33 +123,6 @@ spi_probe(device_t dev) } static int -spi_chip_select(device_t dev, device_t child) -{ - struct spi_softc *sc; - uint32_t cs; - - sc = device_get_softc(dev); - - spibus_get_cs(child, &cs); - - WRITE4(sc, SPI_SSR, ~(1 << cs)); - - return (0); -} - -static int -spi_chip_deselect(device_t dev, device_t child) -{ - struct spi_softc *sc; - - sc = device_get_softc(dev); - - WRITE4(sc, SPI_SSR, ~0); - - return (0); -} - -static int spi_attach(device_t dev) { struct spi_softc *sc; @@ -207,6 +180,7 @@ static int spi_transfer(device_t dev, device_t child, struct spi_command *cmd) { struct spi_softc *sc; + uint32_t reg; uint32_t cs; sc = device_get_softc(dev); @@ -219,12 +193,22 @@ spi_transfer(device_t dev, device_t chil /* get the proper chip select */ spibus_get_cs(child, &cs); + /* Assert CS */ + reg = READ4(sc, SPI_SSR); + reg &= ~(1 << cs); + WRITE4(sc, SPI_SSR, reg); + /* Command */ spi_txrx(sc, cmd->tx_cmd, cmd->rx_cmd, cmd->tx_cmd_sz, cs); /* Data */ spi_txrx(sc, cmd->tx_data, cmd->rx_data, cmd->tx_data_sz, cs); + /* Deassert CS */ + reg = READ4(sc, SPI_SSR); + reg |= (1 << cs); + WRITE4(sc, SPI_SSR, reg); + return (0); } @@ -235,9 +219,6 @@ static device_method_t spi_methods[] = { /* SPI interface */ DEVMETHOD(spibus_transfer, spi_transfer), - DEVMETHOD(spibus_chip_select, spi_chip_select), - DEVMETHOD(spibus_chip_deselect, spi_chip_deselect), - DEVMETHOD_END }; From owner-svn-src-all@freebsd.org Tue Apr 19 15:39:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09750B14160; Tue, 19 Apr 2016 15:39:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B131E1457; Tue, 19 Apr 2016 15:39:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JFdkMh048680; Tue, 19 Apr 2016 15:39:46 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JFdkHx048678; Tue, 19 Apr 2016 15:39:46 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604191539.u3JFdkHx048678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 19 Apr 2016 15:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298274 - head/sys/dev/spibus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:39:48 -0000 Author: br Date: Tue Apr 19 15:39:46 2016 New Revision: 298274 URL: https://svnweb.freebsd.org/changeset/base/298274 Log: Revert r298268 (Add optional chip_select/deselect methods). None of supported hardware do require that. Modified: head/sys/dev/spibus/spibus.c head/sys/dev/spibus/spibus_if.m Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Tue Apr 19 15:36:18 2016 (r298273) +++ head/sys/dev/spibus/spibus.c Tue Apr 19 15:39:46 2016 (r298274) @@ -185,24 +185,9 @@ spibus_hinted_child(device_t bus, const static int spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd) { - return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd)); } -static int -spibus_chip_select_impl(device_t dev, device_t child) -{ - - return (SPIBUS_CHIP_SELECT(device_get_parent(dev), child)); -} - -static int -spibus_chip_deselect_impl(device_t dev, device_t child) -{ - - return (SPIBUS_CHIP_DESELECT(device_get_parent(dev), child)); -} - static device_method_t spibus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, spibus_probe), @@ -223,8 +208,6 @@ static device_method_t spibus_methods[] /* spibus interface */ DEVMETHOD(spibus_transfer, spibus_transfer_impl), - DEVMETHOD(spibus_chip_select, spibus_chip_select_impl), - DEVMETHOD(spibus_chip_deselect, spibus_chip_deselect_impl), DEVMETHOD_END }; Modified: head/sys/dev/spibus/spibus_if.m ============================================================================== --- head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:36:18 2016 (r298273) +++ head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:39:46 2016 (r298274) @@ -39,19 +39,3 @@ METHOD int transfer { device_t child; struct spi_command *cmd; }; - -# -# Assert chip select -# -METHOD int chip_select { - device_t dev; - device_t child; -}; - -# -# Deassert chip select -# -METHOD int chip_deselect { - device_t dev; - device_t child; -}; From owner-svn-src-all@freebsd.org Tue Apr 19 15:41:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2D99B1432B; Tue, 19 Apr 2016 15:41:37 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-32.csi.cam.ac.uk (ppsw-32.csi.cam.ac.uk [131.111.8.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C04CD189C; Tue, 19 Apr 2016 15:41:37 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from xc1.bsdpad.com ([195.154.136.64]:47167) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1asXmR-000xul-2A (Exim 4.86_36-e07b163) (return-path ); Tue, 19 Apr 2016 16:41:35 +0100 Date: Tue, 19 Apr 2016 16:26:29 +0100 From: Ruslan Bukin To: Ian Lepore Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298268 - head/sys/dev/spibus Message-ID: <20160419152629.GA28888@bsdpad.com> References: <201604191418.u3JEICrY023254@repo.freebsd.org> <1461076899.1232.23.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1461076899.1232.23.camel@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: "R. Bukin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:41:38 -0000 On Tue, Apr 19, 2016 at 08:41:39AM -0600, Ian Lepore wrote: > On Tue, 2016-04-19 at 14:18 +0000, Ruslan Bukin wrote: > > Author: br > > Date: Tue Apr 19 14:18:12 2016 > > New Revision: 298268 > > URL: https://svnweb.freebsd.org/changeset/base/298268 > > > > Log: > > Add optional chip_select/deselect methods. This is required > > when we want to keep CS asserted for multiple transfers. > > > > This is missing a now-required mechanism to arbitrate ownership of the > bus. If a leaf driver can take over the bus for longer than a single > transfer, then it needs the same kind of logic as the iicbus uses > (well, conceptually the same, it doesn't need the same horrible > implementation). > > I also don't see any default implementation of the new methods, or a > commit that adds the new functionality to all existing SPI controller > drivers. > Thanks, Ian. I just realized we don't require to hold CS for multiple transfers in our hardware. So I reverted this. Ruslan From owner-svn-src-all@freebsd.org Tue Apr 19 15:46:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F29FB146EC; Tue, 19 Apr 2016 15:46:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0D2E11DA; Tue, 19 Apr 2016 15:46:22 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JFkLJN051714; Tue, 19 Apr 2016 15:46:21 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JFkLYs051713; Tue, 19 Apr 2016 15:46:21 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201604191546.u3JFkLYs051713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 19 Apr 2016 15:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298275 - head/sys/boot/pc98/libpc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:46:23 -0000 Author: allanjude Date: Tue Apr 19 15:46:21 2016 New Revision: 298275 URL: https://svnweb.freebsd.org/changeset/base/298275 Log: Fix pc98 build error introduced in r298230 Submitted by: Toomas Soome Spotted by: bz Differential Revision: https://reviews.freebsd.org/D6002 Modified: head/sys/boot/pc98/libpc98/biosdisk.c Modified: head/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosdisk.c Tue Apr 19 15:39:46 2016 (r298274) +++ head/sys/boot/pc98/libpc98/biosdisk.c Tue Apr 19 15:46:21 2016 (r298275) @@ -118,9 +118,9 @@ static void bd_printbsdslice(struct open static int bd_init(void); static int bd_strategy(void *devdata, int flag, daddr_t dblk, - size_t size, char *buf, size_t *rsize); + size_t offset, size_t size, char *buf, size_t *rsize); static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, - size_t size, char *buf, size_t *rsize); + size_t offset, size_t size, char *buf, size_t *rsize); static int bd_open(struct open_file *f, ...); static int bd_close(struct open_file *f); static void bd_print(int verbose); From owner-svn-src-all@freebsd.org Tue Apr 19 15:49:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A556B14868; Tue, 19 Apr 2016 15:49:33 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 0C52414C2; Tue, 19 Apr 2016 15:49:32 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id B9478D634; Tue, 19 Apr 2016 15:49:31 +0000 (UTC) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... To: Konstantin Belousov References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <20160419093022.GV2422@kib.kiev.ua> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <5716538B.4060108@freebsd.org> Date: Tue, 19 Apr 2016 11:49:31 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160419093022.GV2422@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:49:33 -0000 On 2016-04-19 05:30, Konstantin Belousov wrote: > On Mon, Apr 18, 2016 at 07:43:04PM -0400, Allan Jude wrote: >> On 2016-04-18 19:36, Adrian Chadd wrote: >>> Someone pointed out how this bloats out memory requirement in loader. >>> >>> Did anyone check that? >>> >>> -adrian >>> >> >> I tested down to 128mb of ram in QEMU, booted from the installer ISO, >> did the install, and booted the installed system without issue. > > 64MB is^H^H was very much useful and workable i386 config. i386 kernel > does fit into the 32M but current automatic tuning prevents usermode > from operating. Little manual tuning make 32M on tolerable. > > Making loader require 64M is a regression. At very least, it is > impossible to test low mem configs anymore. > Would a src.conf knob make sense, to use a smaller value when targeting small systems, while keeping the advantages when using more reasonable systems? Or we could make these changes to the HEAP and bcache size specific to 64bit platforms? -- Allan Jude From owner-svn-src-all@freebsd.org Tue Apr 19 15:49:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71EC1B1499D; Tue, 19 Apr 2016 15:49:59 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 33B3417AE; Tue, 19 Apr 2016 15:49:58 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 81B51D63C; Tue, 19 Apr 2016 15:49:58 +0000 (UTC) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... To: "Bjoern A. Zeeb" References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <3DB7C327-E42A-44AB-A1CB-FA34698B2CF3@lists.zabbadoz.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <571653A6.5000700@freebsd.org> Date: Tue, 19 Apr 2016 11:49:58 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <3DB7C327-E42A-44AB-A1CB-FA34698B2CF3@lists.zabbadoz.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:49:59 -0000 On 2016-04-19 05:08, Bjoern A. Zeeb wrote: > >> On 18 Apr 2016, at 23:09 , Allan Jude wrote: >> >> Author: allanjude >> Date: Mon Apr 18 23:09:22 2016 >> New Revision: 298230 >> URL: https://svnweb.freebsd.org/changeset/base/298230 >> > > Can you have a look at this please? > > ===> sys/boot/pc98/libpc98 (all) > /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:132:5: warning: incompatible pointer types initializing 'int (*)(void *, int, daddr_t, size_t, size_t, char *, size_t *)' (aka 'int (*)(void *, int, long long, unsigned int, unsigned int > , char *, unsigned int *)') with an expression of type 'int (void *, int, daddr_t, size_t, char *, size_t *)' (aka 'int (void *, int, long long, unsigned int, char *, unsigned int *)') [-Wincompatible-pointer-types] > bd_strategy, > ^~~~~~~~~~~ > /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:736:1: error: conflicting types for 'bd_strategy' > bd_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, > ^ > /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:120:12: note: previous declaration is here > static int bd_strategy(void *devdata, int flag, daddr_t dblk, > ^ > /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:740:33: error: use of undeclared identifier 'f' > struct i386_devdesc *dev = f->f_devdata; > ^ > /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:743:21: warning: incompatible pointer types assigning to 'int (*)(void *, int, daddr_t, size_t, size_t, char *, size_t *)' (aka 'int (*)(void *, int, long long, unsigned int, unsigned in > t, char *, unsigned int *)') from 'int (void *, int, daddr_t, size_t, char *, size_t *)' (aka 'int (void *, int, long long, unsigned int, char *, unsigned int *)') [-Wincompatible-pointer-types] > bcd.dv_strategy = bd_realstrategy; > ^ ~~~~~~~~~~~~~~~ > /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:747:13: error: too many arguments to function call, expected 7, have 8 > size, buf, rsize)); > ^~~~~ > /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/../../common/bootstrap.h:79:1: note: 'bcache_strategy' declared here > int bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset, > ^ > /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:751:1: error: conflicting types for 'bd_realstrategy' > bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset, > ^ > /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:122:12: note: previous declaration is here > static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, > ^ > 2 warnings and 4 errors generated. > --- biosdisk.o --- > *** [biosdisk.o] Error code 1 > > bmake[8]: stopped in /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98 > ===> usr.sbin/cron/crontab (all) > > — > Bjoern A. Zeeb Charles Haddon Spurgeon: > "Friendship is one of the sweetest joys of life. Many might have failed > beneath the bitterness of their trial had they not found a friend." > > Fixed in r298275, sorry I missed that one -- Allan Jude From owner-svn-src-all@freebsd.org Tue Apr 19 15:52:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02457B14BC8; Tue, 19 Apr 2016 15:52:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2FE51C14; Tue, 19 Apr 2016 15:52:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JFqugQ054649; Tue, 19 Apr 2016 15:52:56 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JFqtbw054643; Tue, 19 Apr 2016 15:52:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604191552.u3JFqtbw054643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 19 Apr 2016 15:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298276 - head/sys/dev/bhnd/bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:52:57 -0000 Author: adrian Date: Tue Apr 19 15:52:55 2016 New Revision: 298276 URL: https://svnweb.freebsd.org/changeset/base/298276 Log: [bhnd] Add support for specifying the address space used by bhndb children This adds support for specifying the address space used by a bridge child; this will either be the bridged SoC address space, or the host address space required by children that map non SoC-address ranges from the PCI BAR. This is necessary to support SROM/OTP child devices that live directly beneath the bhndb device and require access to host resources, instead of the standard behavior of delegating access to the bridged SoC address space. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D5757 Modified: head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndb/bhndb_private.h head/sys/dev/bhnd/bhndb/bhndb_subr.c head/sys/dev/bhnd/bhndb/bhndbvar.h Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Tue Apr 19 15:46:21 2016 (r298275) +++ head/sys/dev/bhnd/bhndb/bhndb.c Tue Apr 19 15:52:55 2016 (r298276) @@ -85,8 +85,11 @@ static int bhndb_read_chipid(struct b const struct bhndb_hwcfg *cfg, struct bhnd_chipid *result); +bhndb_addrspace bhndb_get_addrspace(struct bhndb_softc *sc, + device_t child); + static struct rman *bhndb_get_rman(struct bhndb_softc *sc, - int type); + device_t child, int type); static int bhndb_init_child_resource(struct resource *r, struct resource *parent, @@ -509,6 +512,7 @@ bhndb_read_chipid(struct bhndb_softc *sc int bhndb_attach(device_t dev, bhnd_devclass_t bridge_devclass) { + struct bhndb_devinfo *dinfo; struct bhndb_softc *sc; const struct bhndb_hwcfg *cfg; int error; @@ -525,45 +529,30 @@ bhndb_attach(device_t dev, bhnd_devclass if ((error = bhndb_read_chipid(sc, cfg, &sc->chipid))) return (error); - /* Set up a resource manager for the device's address space. */ - sc->mem_rman.rm_start = 0; - sc->mem_rman.rm_end = BUS_SPACE_MAXADDR_32BIT; - sc->mem_rman.rm_type = RMAN_ARRAY; - sc->mem_rman.rm_descr = "BHND I/O memory addresses"; - - if ((error = rman_init(&sc->mem_rman))) { - device_printf(dev, "could not initialize mem_rman\n"); - return (error); - } - - error = rman_manage_region(&sc->mem_rman, 0, BUS_SPACE_MAXADDR_32BIT); - if (error) { - device_printf(dev, "could not configure mem_rman\n"); - goto failed; - } - - /* Initialize basic resource allocation state. */ + /* Populate generic resource allocation state. */ sc->bus_res = bhndb_alloc_resources(dev, sc->parent_dev, cfg); if (sc->bus_res == NULL) { - error = ENXIO; - goto failed; + return (ENXIO); } /* Attach our bridged bus device */ - sc->bus_dev = device_add_child(dev, devclass_get_name(bhnd_devclass), + sc->bus_dev = BUS_ADD_CHILD(dev, 0, devclass_get_name(bhnd_devclass), -1); if (sc->bus_dev == NULL) { error = ENXIO; goto failed; } + /* Configure address space */ + dinfo = device_get_ivars(sc->bus_dev); + dinfo->addrspace = BHNDB_ADDRSPACE_BRIDGED; + + /* Finish attach */ return (bus_generic_attach(dev)); failed: BHNDB_LOCK_DESTROY(sc); - rman_fini(&sc->mem_rman); - if (sc->bus_res != NULL) bhndb_free_resources(sc->bus_res); @@ -680,7 +669,6 @@ bhndb_generic_detach(device_t dev) return (error); /* Clean up our driver state. */ - rman_fini(&sc->mem_rman); bhndb_free_resources(sc->bus_res); BHNDB_LOCK_DESTROY(sc); @@ -826,24 +814,60 @@ bhndb_write_ivar(device_t dev, device_t } /** + * Return the address space for the given @p child device. + */ +bhndb_addrspace +bhndb_get_addrspace(struct bhndb_softc *sc, device_t child) +{ + struct bhndb_devinfo *dinfo; + device_t imd_dev; + + /* Find the directly attached parent of the requesting device */ + imd_dev = child; + while (imd_dev != NULL && device_get_parent(imd_dev) != sc->dev) + imd_dev = device_get_parent(imd_dev); + + if (imd_dev == NULL) + panic("bhndb address space request for non-child device %s\n", + device_get_nameunit(child)); + + dinfo = device_get_ivars(imd_dev); + return (dinfo->addrspace); +} + +/** * Return the rman instance for a given resource @p type, if any. * * @param sc The bhndb device state. + * @param child The requesting child. * @param type The resource type (e.g. SYS_RES_MEMORY, SYS_RES_IRQ, ...) */ static struct rman * -bhndb_get_rman(struct bhndb_softc *sc, int type) -{ - switch (type) { - case SYS_RES_MEMORY: - return &sc->mem_rman; - case SYS_RES_IRQ: - // TODO - // return &sc->irq_rman; - return (NULL); - default: - return (NULL); - }; +bhndb_get_rman(struct bhndb_softc *sc, device_t child, int type) +{ + switch (bhndb_get_addrspace(sc, child)) { + case BHNDB_ADDRSPACE_NATIVE: + switch (type) { + case SYS_RES_MEMORY: + return (&sc->bus_res->ht_mem_rman); + case SYS_RES_IRQ: + return (NULL); + default: + return (NULL); + }; + + case BHNDB_ADDRSPACE_BRIDGED: + switch (type) { + case SYS_RES_MEMORY: + return (&sc->bus_res->br_mem_rman); + case SYS_RES_IRQ: + // TODO + // return &sc->irq_rman; + return (NULL); + default: + return (NULL); + }; + } } /** @@ -865,6 +889,7 @@ bhndb_add_child(device_t dev, u_int orde return (NULL); } + dinfo->addrspace = BHNDB_ADDRSPACE_NATIVE; resource_list_init(&dinfo->resources); device_set_ivars(child, dinfo); @@ -1062,7 +1087,7 @@ bhndb_alloc_resource(device_t dev, devic return (NULL); /* Fetch the resource manager */ - rm = bhndb_get_rman(sc, type); + rm = bhndb_get_rman(sc, child, type); if (rm == NULL) return (NULL); @@ -1080,8 +1105,8 @@ bhndb_alloc_resource(device_t dev, devic if (error) { device_printf(dev, "failed to activate entry %#x type %d for " - "child %s\n", - *rid, type, device_get_nameunit(child)); + "child %s: %d\n", + *rid, type, device_get_nameunit(child), error); rman_release_resource(rv); @@ -1137,7 +1162,7 @@ bhndb_adjust_resource(device_t dev, devi error = 0; /* Fetch resource manager */ - rm = bhndb_get_rman(sc, type); + rm = bhndb_get_rman(sc, child, type); if (rm == NULL) return (ENXIO); @@ -1159,7 +1184,8 @@ bhndb_adjust_resource(device_t dev, devi /** * Initialize child resource @p r with a virtual address, tag, and handle - * copied from @p parent, adjusted to contain only the range defined by @p win. + * copied from @p parent, adjusted to contain only the range defined by + * @p offsize and @p size. * * @param r The register to be initialized. * @param parent The parent bus resource that fully contains the subregion. @@ -1171,7 +1197,6 @@ static int bhndb_init_child_resource(struct resource *r, struct resource *parent, bhnd_size_t offset, bhnd_size_t size) { - bus_space_handle_t bh, child_bh; bus_space_tag_t bt; uintptr_t vaddr; @@ -1335,13 +1360,39 @@ bhndb_try_activate_resource(struct bhndb if (indirect) *indirect = false; + + r_start = rman_get_start(r); + r_size = rman_get_size(r); + + /* Activate native addrspace resources using the host address space */ + if (bhndb_get_addrspace(sc, child) == BHNDB_ADDRSPACE_NATIVE) { + struct resource *parent; + + /* Find the bridge resource referenced by the child */ + parent = bhndb_find_resource_range(sc->bus_res, r_start, + r_size); + if (parent == NULL) { + device_printf(sc->dev, "host resource not found " + "for 0x%llx-0x%llx\n", + (unsigned long long) r_start, + (unsigned long long) r_start + r_size - 1); + return (ENOENT); + } + + /* Initialize child resource with the real bus values */ + error = bhndb_init_child_resource(r, parent, + r_start - rman_get_start(parent), r_size); + if (error) + return (error); + + /* Try to activate child resource */ + return (rman_activate_resource(r)); + } /* Default to low priority */ dw_priority = BHNDB_PRIORITY_LOW; /* Look for a bus region matching the resource's address range */ - r_start = rman_get_start(r); - r_size = rman_get_size(r); region = bhndb_find_resource_region(sc->bus_res, r_start, r_size); if (region != NULL) dw_priority = region->priority; @@ -1431,7 +1482,7 @@ bhndb_deactivate_resource(device_t dev, sc = device_get_softc(dev); - if ((rm = bhndb_get_rman(sc, type)) == NULL) + if ((rm = bhndb_get_rman(sc, child, type)) == NULL) return (EINVAL); /* Mark inactive */ @@ -1439,11 +1490,13 @@ bhndb_deactivate_resource(device_t dev, return (error); /* Free any dynamic window allocation. */ - BHNDB_LOCK(sc); - dwa = bhndb_dw_find_resource(sc->bus_res, r); - if (dwa != NULL) - bhndb_dw_release(sc->bus_res, dwa, r); - BHNDB_UNLOCK(sc); + if (bhndb_get_addrspace(sc, child) == BHNDB_ADDRSPACE_BRIDGED) { + BHNDB_LOCK(sc); + dwa = bhndb_dw_find_resource(sc->bus_res, r); + if (dwa != NULL) + bhndb_dw_release(sc->bus_res, dwa, r); + BHNDB_UNLOCK(sc); + } return (0); } @@ -1516,9 +1569,13 @@ bhndb_release_bhnd_resource(device_t dev /** * Default bhndb(4) implementation of BHND_BUS_ACTIVATE_RESOURCE(). + * + * For BHNDB_ADDRSPACE_NATIVE children, all resources may be assumed to + * be actived by the bridge. * - * Attempts to activate a static register window, a dynamic register window, - * or configures @p r as an indirect resource -- in that order. + * For BHNDB_ADDRSPACE_BRIDGED children, attempts to activate a static register + * window, a dynamic register window, or configures @p r as an indirect + * resource -- in that order. */ static int bhndb_activate_bhnd_resource(device_t dev, device_t child, @@ -1526,7 +1583,6 @@ bhndb_activate_bhnd_resource(device_t de { struct bhndb_softc *sc; struct bhndb_region *region; - bhndb_priority_t r_prio; rman_res_t r_start, r_size; int error; bool indirect; @@ -1539,19 +1595,25 @@ bhndb_activate_bhnd_resource(device_t de sc = device_get_softc(dev); - /* Fetch the address range's resource priority */ r_start = rman_get_start(r->res); r_size = rman_get_size(r->res); - r_prio = BHNDB_PRIORITY_NONE; - region = bhndb_find_resource_region(sc->bus_res, r_start, r_size); - if (region != NULL) - r_prio = region->priority; - - /* If less than the minimum dynamic window priority, this - * resource should always be indirect. */ - if (r_prio < sc->bus_res->min_prio) - return (0); + /* Verify bridged address range's resource priority, and skip direct + * allocation if the priority is too low. */ + if (bhndb_get_addrspace(sc, child) == BHNDB_ADDRSPACE_BRIDGED) { + bhndb_priority_t r_prio; + + region = bhndb_find_resource_region(sc->bus_res, r_start, r_size); + if (region != NULL) + r_prio = region->priority; + else + r_prio = BHNDB_PRIORITY_NONE; + + /* If less than the minimum dynamic window priority, this + * resource should always be indirect. */ + if (r_prio < sc->bus_res->min_prio) + return (0); + } /* Attempt direct activation */ error = bhndb_try_activate_resource(sc, child, type, rid, r->res, @@ -1565,7 +1627,9 @@ bhndb_activate_bhnd_resource(device_t de r->direct = false; } - if (BHNDB_DEBUG(PRIO)) { + if (BHNDB_DEBUG(PRIO) && + bhndb_get_addrspace(sc, child) == BHNDB_ADDRSPACE_BRIDGED) + { device_printf(child, "activated 0x%llx-0x%llx as %s " "resource\n", (unsigned long long) r_start, Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Tue Apr 19 15:46:21 2016 (r298275) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Tue Apr 19 15:52:55 2016 (r298276) @@ -375,10 +375,18 @@ bhndb_pci_init_full_config(device_t dev, * access to the PCIe SerDes required by the quirk workarounds. */ if (sc->pci_devclass == BHND_DEVCLASS_PCIE) { - sc->mdio = device_add_child(dev, + sc->mdio = BUS_ADD_CHILD(dev, 0, devclass_get_name(bhnd_mdio_pci_devclass), 0); if (sc->mdio == NULL) return (ENXIO); + + error = bus_set_resource(sc->mdio, SYS_RES_MEMORY, 0, + rman_get_start(sc->mem_res) + sc->mem_off + + BHND_PCIE_MDIO_CTL, sizeof(uint32_t)*2); + if (error) { + device_printf(dev, "failed to set MDIO resource\n"); + return (error); + } if ((error = device_probe_and_attach(sc->mdio))) { device_printf(dev, "failed to attach MDIO device\n"); @@ -1021,25 +1029,6 @@ bhndb_pci_discover_quirks(struct bhndb_p static int bhndb_mdio_pcie_probe(device_t dev) { - struct bhndb_softc *psc; - device_t parent; - - /* Parent must be a bhndb_pcie instance */ - parent = device_get_parent(dev); - if (device_get_driver(parent) != &bhndb_pci_driver) - return (ENXIO); - - /* Parent must have PCIe-Gen1 hostb device */ - psc = device_get_softc(parent); - if (psc->hostb_dev == NULL) - return (ENXIO); - - if (bhnd_get_vendor(psc->hostb_dev) != BHND_MFGID_BCM || - bhnd_get_device(psc->hostb_dev) != BHND_COREID_PCIE) - { - return (ENXIO); - } - device_quiet(dev); return (BUS_PROBE_NOWILDCARD); } @@ -1048,15 +1037,11 @@ static int bhndb_mdio_pcie_attach(device_t dev) { struct bhndb_pci_softc *psc; - psc = device_get_softc(device_get_parent(dev)); - return (bhnd_mdio_pcie_attach(dev, &psc->bhnd_mem_res, -1, psc->mem_off + BHND_PCIE_MDIO_CTL, (psc->quirks & BHNDB_PCIE_QUIRK_SD_C22_EXTADDR) != 0)); - - return (ENXIO); } static device_method_t bhnd_mdio_pcie_methods[] = { Modified: head/sys/dev/bhnd/bhndb/bhndb_private.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_private.h Tue Apr 19 15:46:21 2016 (r298275) +++ head/sys/dev/bhnd/bhndb/bhndb_private.h Tue Apr 19 15:52:55 2016 (r298276) @@ -50,6 +50,10 @@ struct bhndb_dw_alloc; struct bhndb_region; struct bhndb_resources; +struct resource *bhndb_find_resource_range( + struct bhndb_resources *br, + rman_res_t start, rman_res_t count); + struct resource *bhndb_find_regwin_resource( struct bhndb_resources *br, const struct bhndb_regwin *win); @@ -167,6 +171,9 @@ struct bhndb_resources { device_t parent_dev; /**< parent device */ struct resource_spec *res_spec; /**< parent bus resource specs */ struct resource **res; /**< parent bus resources */ + + struct rman ht_mem_rman; /**< host memory manager */ + struct rman br_mem_rman; /**< bridged memory manager */ STAILQ_HEAD(, bhndb_region) bus_regions; /**< bus region descriptors */ Modified: head/sys/dev/bhnd/bhndb/bhndb_subr.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_subr.c Tue Apr 19 15:46:21 2016 (r298275) +++ head/sys/dev/bhnd/bhndb/bhndb_subr.c Tue Apr 19 15:52:55 2016 (r298276) @@ -183,6 +183,39 @@ bhnd_generic_br_resume_child(device_t de } /** + * Find a SYS_RES_MEMORY resource containing the given address range. + * + * @param br The bhndb resource state to search. + * @param start The start address of the range to search for. + * @param count The size of the range to search for. + * + * @retval resource the host resource containing the requested range. + * @retval NULL if no resource containing the requested range can be found. + */ +struct resource * +bhndb_find_resource_range(struct bhndb_resources *br, rman_res_t start, + rman_res_t count) +{ + for (u_int i = 0; br->res_spec[i].type != -1; i++) { + struct resource *r = br->res[i]; + + if (br->res_spec->type != SYS_RES_MEMORY) + continue; + + /* Verify range */ + if (rman_get_start(r) > start) + continue; + + if (rman_get_end(r) < (start + count - 1)) + continue; + + return (r); + } + + return (NULL); +} + +/** * Find the resource containing @p win. * * @param br The bhndb resource state to search. @@ -235,8 +268,11 @@ bhndb_alloc_resources(device_t dev, devi u_int rnid; int error; bool free_parent_res; + bool free_ht_mem, free_br_mem; free_parent_res = false; + free_ht_mem = false; + free_br_mem = false; r = malloc(sizeof(*r), M_BHND, M_NOWAIT|M_ZERO); if (r == NULL) @@ -249,6 +285,37 @@ bhndb_alloc_resources(device_t dev, devi r->min_prio = BHNDB_PRIORITY_NONE; STAILQ_INIT(&r->bus_regions); + /* Initialize host address space resource manager. */ + r->ht_mem_rman.rm_start = 0; + r->ht_mem_rman.rm_end = ~0; + r->ht_mem_rman.rm_type = RMAN_ARRAY; + r->ht_mem_rman.rm_descr = "BHNDB host memory"; + if ((error = rman_init(&r->ht_mem_rman))) { + device_printf(r->dev, "could not initialize ht_mem_rman\n"); + goto failed; + } + free_ht_mem = true; + + + /* Initialize resource manager for the bridged address space. */ + r->br_mem_rman.rm_start = 0; + r->br_mem_rman.rm_end = BUS_SPACE_MAXADDR_32BIT; + r->br_mem_rman.rm_type = RMAN_ARRAY; + r->br_mem_rman.rm_descr = "BHNDB bridged memory"; + + if ((error = rman_init(&r->br_mem_rman))) { + device_printf(r->dev, "could not initialize br_mem_rman\n"); + goto failed; + } + free_br_mem = true; + + error = rman_manage_region(&r->br_mem_rman, 0, BUS_SPACE_MAXADDR_32BIT); + if (error) { + device_printf(r->dev, "could not configure br_mem_rman\n"); + goto failed; + } + + /* Determine our bridge resource count from the hardware config. */ res_num = 0; for (size_t i = 0; cfg->resource_specs[i].type != -1; i++) @@ -284,6 +351,26 @@ bhndb_alloc_resources(device_t dev, devi free_parent_res = true; } + /* Add allocated memory resources to our host memory resource manager */ + for (u_int i = 0; r->res_spec[i].type != -1; i++) { + struct resource *res; + + /* skip non-memory resources */ + if (r->res_spec[i].type != SYS_RES_MEMORY) + continue; + + /* add host resource to set of managed regions */ + res = r->res[i]; + error = rman_manage_region(&r->ht_mem_rman, rman_get_start(res), + rman_get_end(res)); + if (error) { + device_printf(r->dev, + "could not register host memory region with " + "ht_mem_rman: %d\n", error); + goto failed; + } + } + /* Fetch the dynamic regwin count and verify that it does not exceed * what is representable via our freelist bitmask. */ r->dwa_count = bhndb_regwin_count(cfg->register_windows, @@ -371,6 +458,12 @@ bhndb_alloc_resources(device_t dev, devi failed: if (free_parent_res) bus_release_resources(r->parent_dev, r->res_spec, r->res); + + if (free_ht_mem) + rman_fini(&r->ht_mem_rman); + + if (free_br_mem) + rman_fini(&r->br_mem_rman); if (r->res != NULL) free(r->res, M_BHND); @@ -423,6 +516,10 @@ bhndb_free_resources(struct bhndb_resour free(region, M_BHND); } + /* Release our resource managers */ + rman_fini(&br->ht_mem_rman); + rman_fini(&br->br_mem_rman); + /* Free backing resource state structures */ free(br->res, M_BHND); free(br->res_spec, M_BHND); Modified: head/sys/dev/bhnd/bhndb/bhndbvar.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndbvar.h Tue Apr 19 15:46:21 2016 (r298275) +++ head/sys/dev/bhnd/bhndb/bhndbvar.h Tue Apr 19 15:52:55 2016 (r298276) @@ -65,9 +65,20 @@ int bhndb_generic_init_full_config(devic int bhnd_generic_br_suspend_child(device_t dev, device_t child); int bhnd_generic_br_resume_child(device_t dev, device_t child); +/** + * bhndb child address space. Children either operate in the bridged + * SoC address space, or within the address space mapped to the host + * device (e.g. the PCI BAR(s)). + */ +typedef enum { + BHNDB_ADDRSPACE_BRIDGED, /**< bridged (SoC) address space */ + BHNDB_ADDRSPACE_NATIVE /**< host address space */ +} bhndb_addrspace; + /** bhndb child instance state */ struct bhndb_devinfo { - struct resource_list resources; /**< child resources. */ + bhndb_addrspace addrspace; /**< child address space. */ + struct resource_list resources; /**< child resources. */ }; /** @@ -85,9 +96,7 @@ struct bhndb_softc { if the @p bus_dev has not yet called BHNDB_INIT_FULL_CONFIG() */ - struct rman mem_rman; /**< bridged bus memory manager */ struct mtx sc_mtx; /**< resource lock. */ - struct bhndb_resources *bus_res; /**< bus resource state */ }; From owner-svn-src-all@freebsd.org Tue Apr 19 15:53:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79526B14C4B; Tue, 19 Apr 2016 15:53:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C2961DE6; Tue, 19 Apr 2016 15:53:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JFrwUC054733; Tue, 19 Apr 2016 15:53:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JFrvIf054726; Tue, 19 Apr 2016 15:53:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604191553.u3JFrvIf054726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 19 Apr 2016 15:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298277 - in head/sys/dev/bhnd: . bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:53:59 -0000 Author: adrian Date: Tue Apr 19 15:53:57 2016 New Revision: 298277 URL: https://svnweb.freebsd.org/changeset/base/298277 Log: [bhnd] Clean up bhnd resource handling and inherited bus methods To facilitate use by SoC implementors working with bhnd-inheriting fdt/nexus drivers: * Splits bhnd_bus method implementations into generic bus implementations (bhnd_bus_generic) and generic bhnd(4) driver implementations (bhnd_generic) * Simplifies bhnd resource handling, allowing bhnd bus implementations to support bhnd resource activation by implementing the standard BUS_* resource APIs and BHND_BUS_ACTIVATE_RESOURCE(). Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D5758 Modified: head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndvar.h Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Tue Apr 19 15:52:55 2016 (r298276) +++ head/sys/dev/bhnd/bhnd.c Tue Apr 19 15:53:57 2016 (r298277) @@ -90,11 +90,10 @@ static int compare_descending_probe_orde const void *rhs); /** - * Helper function for implementing DEVICE_ATTACH(). - * - * This function can be used to implement DEVICE_ATTACH() for bhnd(4) - * bus implementations. It calls device_probe_and_attach() for each - * of the device's children, in order. + * Default bhnd(4) bus driver implementation of DEVICE_ATTACH(). + * + * This implementation calls device_probe_and_attach() for each of the device's + * children, in bhnd probe order. */ int bhnd_generic_attach(device_t dev) @@ -120,12 +119,11 @@ bhnd_generic_attach(device_t dev) } /** - * Helper function for implementing DEVICE_DETACH(). - * - * This function can be used to implement DEVICE_DETACH() for bhnd(4) - * bus implementations. It calls device_detach() for each - * of the device's children, in reverse order, terminating if - * any call to device_detach() fails. + * Default bhnd(4) bus driver implementation of DEVICE_DETACH(). + * + * This implementation calls device_detach() for each of the the device's + * children, in reverse bhnd probe order, terminating if any call to + * device_detach() fails. */ int bhnd_generic_detach(device_t dev) @@ -156,12 +154,11 @@ cleanup: } /** - * Helper function for implementing DEVICE_SHUTDOWN(). + * Default bhnd(4) bus driver implementation of DEVICE_SHUTDOWN(). * - * This function can be used to implement DEVICE_SHUTDOWN() for bhnd(4) - * bus implementations. It calls device_shutdown() for each - * of the device's children, in reverse order, terminating if - * any call to device_shutdown() fails. + * This implementation calls device_shutdown() for each of the device's + * children, in reverse bhnd probe order, terminating if any call to + * device_shutdown() fails. */ int bhnd_generic_shutdown(device_t dev) @@ -192,12 +189,11 @@ cleanup: } /** - * Helper function for implementing DEVICE_RESUME(). - * - * This function can be used to implement DEVICE_RESUME() for bhnd(4) - * bus implementations. It calls BUS_RESUME_CHILD() for each - * of the device's children, in order, terminating if - * any call to BUS_RESUME_CHILD() fails. + * Default bhnd(4) bus driver implementation of DEVICE_RESUME(). + * + * This implementation calls BUS_RESUME_CHILD() for each of the device's + * children in bhnd probe order, terminating if any call to BUS_RESUME_CHILD() + * fails. */ int bhnd_generic_resume(device_t dev) @@ -227,14 +223,13 @@ cleanup: } /** - * Helper function for implementing DEVICE_SUSPEND(). - * - * This function can be used to implement DEVICE_SUSPEND() for bhnd(4) - * bus implementations. It calls BUS_SUSPEND_CHILD() for each - * of the device's children, in reverse order. If any call to - * BUS_SUSPEND_CHILD() fails, the suspend operation is terminated and - * any devices that were suspended are resumed immediately by calling - * their BUS_RESUME_CHILD() methods. + * Default bhnd(4) bus driver implementation of DEVICE_SUSPEND(). + * + * This implementation calls BUS_SUSPEND_CHILD() for each of the device's + * children in reverse bhnd probe order. If any call to BUS_SUSPEND_CHILD() + * fails, the suspend operation is terminated and any devices that were + * suspended are resumed immediately by calling their BUS_RESUME_CHILD() + * methods. */ int bhnd_generic_suspend(device_t dev) @@ -305,8 +300,8 @@ compare_descending_probe_order(const voi } /** - * Helper function for implementing BHND_BUS_GET_PROBE_ORDER(). - * + * Default bhnd(4) bus driver implementation of BHND_BUS_GET_PROBE_ORDER(). + * * This implementation determines probe ordering based on the device's class * and other properties, including whether the device is serving as a host * bridge. @@ -360,14 +355,14 @@ bhnd_generic_get_probe_order(device_t de } /** - * Helper function for implementing BHND_BUS_IS_REGION_VALID(). + * Default bhnd(4) bus driver implementation of BHND_BUS_IS_REGION_VALID(). * * This implementation assumes that port and region numbers are 0-indexed and * are allocated non-sparsely, using BHND_BUS_GET_PORT_COUNT() and * BHND_BUS_GET_REGION_COUNT() to determine if @p port and @p region fall * within the defined range. */ -bool +static bool bhnd_generic_is_region_valid(device_t dev, device_t child, bhnd_port_type type, u_int port, u_int region) { @@ -413,14 +408,14 @@ find_nvram_child(device_t dev) } /** - * Helper function for implementing BHND_BUS_READ_NVRAM_VAR(). + * Default bhnd(4) bus driver implementation of BHND_BUS_READ_NVRAM_VAR(). * * This implementation searches @p dev for a valid NVRAM device. If no NVRAM * child device is found on @p dev, the request is delegated to the * BHND_BUS_READ_NVRAM_VAR() method on the parent * of @p dev. */ -int +static int bhnd_generic_read_nvram_var(device_t dev, device_t child, const char *name, void *buf, size_t *size) { @@ -435,7 +430,7 @@ bhnd_generic_read_nvram_var(device_t dev } /** - * Helper function for implementing BUS_PRINT_CHILD(). + * Default bhnd(4) bus driver implementation of BUS_PRINT_CHILD(). * * This implementation requests the device's struct resource_list via * BUS_GET_RESOURCE_LIST. @@ -463,7 +458,7 @@ bhnd_generic_print_child(device_t dev, d } /** - * Helper function for implementing BUS_PRINT_CHILD(). + * Default bhnd(4) bus driver implementation of BUS_PROBE_NOMATCH(). * * This implementation requests the device's struct resource_list via * BUS_GET_RESOURCE_LIST. @@ -525,7 +520,7 @@ bhnd_child_pnpinfo_str(device_t dev, dev } /** - * Default implementation of implementing BUS_PRINT_CHILD(). + * Default implementation of BUS_CHILD_LOCATION_STR(). */ static int bhnd_child_location_str(device_t dev, device_t child, char *buf, @@ -585,215 +580,6 @@ bhnd_generic_resume_child(device_t dev, return bus_generic_resume_child(dev, child); } -/** - * Helper function for implementing BHND_BUS_IS_HOSTB_DEVICE(). - * - * If a parent device is available, this implementation delegates the - * request to the BHND_BUS_IS_HOSTB_DEVICE() method on the parent of @p dev. - * - * If no parent device is available (i.e. on a the bus root), false - * is returned. - */ -bool -bhnd_generic_is_hostb_device(device_t dev, device_t child) { - if (device_get_parent(dev) != NULL) - return (BHND_BUS_IS_HOSTB_DEVICE(device_get_parent(dev), - child)); - - return (false); -} - -/** - * Helper function for implementing BHND_BUS_IS_HW_DISABLED(). - * - * If a parent device is available, this implementation delegates the - * request to the BHND_BUS_IS_HW_DISABLED() method on the parent of @p dev. - * - * If no parent device is available (i.e. on a the bus root), the hardware - * is assumed to be usable and false is returned. - */ -bool -bhnd_generic_is_hw_disabled(device_t dev, device_t child) -{ - if (device_get_parent(dev) != NULL) - return (BHND_BUS_IS_HW_DISABLED(device_get_parent(dev), child)); - - return (false); -} - -/** - * Helper function for implementing BHND_BUS_GET_CHIPID(). - * - * This implementation delegates the request to the BHND_BUS_GET_CHIPID() - * method on the parent of @p dev. - */ -const struct bhnd_chipid * -bhnd_generic_get_chipid(device_t dev, device_t child) { - return (BHND_BUS_GET_CHIPID(device_get_parent(dev), child)); -} - -/** - * Helper function for implementing BHND_BUS_ALLOC_RESOURCE(). - * - * This simple implementation of BHND_BUS_ALLOC_RESOURCE() determines - * any default values via BUS_GET_RESOURCE_LIST(), and calls - * BHND_BUS_ALLOC_RESOURCE() method of the parent of @p dev. - * - * If no parent device is available, the request is instead delegated to - * BUS_ALLOC_RESOURCE(). - */ -struct bhnd_resource * -bhnd_generic_alloc_bhnd_resource(device_t dev, device_t child, int type, - int *rid, rman_res_t start, rman_res_t end, rman_res_t count, - u_int flags) -{ - struct bhnd_resource *r; - struct resource_list *rl; - struct resource_list_entry *rle; - bool isdefault; - bool passthrough; - - passthrough = (device_get_parent(child) != dev); - isdefault = RMAN_IS_DEFAULT_RANGE(start, end); - - /* the default RID must always be the first device port/region. */ - if (!passthrough && *rid == 0) { - int rid0 = bhnd_get_port_rid(child, BHND_PORT_DEVICE, 0, 0); - KASSERT(*rid == rid0, - ("rid 0 does not map to the first device port (%d)", rid0)); - } - - /* Determine locally-known defaults before delegating the request. */ - if (!passthrough && isdefault) { - /* fetch resource list from child's bus */ - rl = BUS_GET_RESOURCE_LIST(dev, child); - if (rl == NULL) - return (NULL); /* no resource list */ - - /* look for matching type/rid pair */ - rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child), - type, *rid); - if (rle == NULL) - return (NULL); - - /* set default values */ - start = rle->start; - end = rle->end; - count = ulmax(count, rle->count); - } - - /* Try to delegate to our parent. */ - if (device_get_parent(dev) != NULL) { - return (BHND_BUS_ALLOC_RESOURCE(device_get_parent(dev), child, - type, rid, start, end, count, flags)); - } - - /* If this is the bus root, use a real bus-allocated resource */ - r = malloc(sizeof(struct bhnd_resource), M_BHND, M_NOWAIT); - if (r == NULL) - return NULL; - - /* Allocate the bus resource, marking it as 'direct' (not requiring - * any bus window remapping to perform I/O) */ - r->direct = true; - r->res = BUS_ALLOC_RESOURCE(dev, child, type, rid, start, end, - count, flags); - - if (r->res == NULL) { - free(r, M_BHND); - return NULL; - } - - return (r); -} - -/** - * Helper function for implementing BHND_BUS_RELEASE_RESOURCE(). - * - * This simple implementation of BHND_BUS_RELEASE_RESOURCE() simply calls the - * BHND_BUS_RELEASE_RESOURCE() method of the parent of @p dev. - * - * If no parent device is available, the request is delegated to - * BUS_RELEASE_RESOURCE(). - */ -int -bhnd_generic_release_bhnd_resource(device_t dev, device_t child, int type, - int rid, struct bhnd_resource *r) -{ - int error; - - /* Try to delegate to the parent. */ - if (device_get_parent(dev) != NULL) - return (BHND_BUS_RELEASE_RESOURCE(device_get_parent(dev), child, - type, rid, r)); - - /* Release the resource directly */ - if (!r->direct) { - panic("bhnd indirect resource released without " - "bhnd parent bus"); - } - - error = BUS_RELEASE_RESOURCE(dev, child, type, rid, r->res); - if (error) - return (error); - - free(r, M_BHND); - return (0); -} - -/** - * Helper function for implementing BHND_BUS_ACTIVATE_RESOURCE(). - * - * This simple implementation of BHND_BUS_ACTIVATE_RESOURCE() simply calls the - * BHND_BUS_ACTIVATE_RESOURCE() method of the parent of @p dev. - * - * If no parent device is available, the request is delegated to - * BUS_ACTIVATE_RESOURCE(). - */ -int -bhnd_generic_activate_bhnd_resource(device_t dev, device_t child, int type, - int rid, struct bhnd_resource *r) -{ - /* Try to delegate to the parent */ - if (device_get_parent(dev) != NULL) - return (BHND_BUS_ACTIVATE_RESOURCE(device_get_parent(dev), - child, type, rid, r)); - - /* Activate the resource directly */ - if (!r->direct) { - panic("bhnd indirect resource released without " - "bhnd parent bus"); - } - - return (BUS_ACTIVATE_RESOURCE(dev, child, type, rid, r->res)); -}; - -/** - * Helper function for implementing BHND_BUS_DEACTIVATE_RESOURCE(). - * - * This simple implementation of BHND_BUS_ACTIVATE_RESOURCE() simply calls the - * BHND_BUS_ACTIVATE_RESOURCE() method of the parent of @p dev. - * - * If no parent device is available, the request is delegated to - * BUS_DEACTIVATE_RESOURCE(). - */ -int -bhnd_generic_deactivate_bhnd_resource(device_t dev, device_t child, int type, - int rid, struct bhnd_resource *r) -{ - if (device_get_parent(dev) != NULL) - return (BHND_BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), - child, type, rid, r)); - - /* De-activate the resource directly */ - if (!r->direct) { - panic("bhnd indirect resource released without " - "bhnd parent bus"); - } - - return (BUS_DEACTIVATE_RESOURCE(dev, child, type, rid, r->res)); -}; - /* * Delegate all indirect I/O to the parent device. When inherited by * non-bridged bus implementations, resources will never be marked as @@ -885,12 +671,12 @@ static device_method_t bhnd_methods[] = DEVMETHOD(bus_get_dma_tag, bus_generic_get_dma_tag), /* BHND interface */ - DEVMETHOD(bhnd_bus_alloc_resource, bhnd_generic_alloc_bhnd_resource), - DEVMETHOD(bhnd_bus_release_resource, bhnd_generic_release_bhnd_resource), - DEVMETHOD(bhnd_bus_activate_resource, bhnd_generic_activate_bhnd_resource), - DEVMETHOD(bhnd_bus_activate_resource, bhnd_generic_deactivate_bhnd_resource), - DEVMETHOD(bhnd_bus_get_chipid, bhnd_generic_get_chipid), + DEVMETHOD(bhnd_bus_get_chipid, bhnd_bus_generic_get_chipid), DEVMETHOD(bhnd_bus_get_probe_order, bhnd_generic_get_probe_order), + DEVMETHOD(bhnd_bus_is_region_valid, bhnd_generic_is_region_valid), + DEVMETHOD(bhnd_bus_is_hostb_device, bhnd_bus_generic_is_hostb_device), + DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_bus_generic_is_hw_disabled), + DEVMETHOD(bhnd_bus_read_nvram_var, bhnd_generic_read_nvram_var), DEVMETHOD(bhnd_bus_read_1, bhnd_read_1), DEVMETHOD(bhnd_bus_read_2, bhnd_read_2), DEVMETHOD(bhnd_bus_read_4, bhnd_read_4), Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue Apr 19 15:52:55 2016 (r298276) +++ head/sys/dev/bhnd/bhnd.h Tue Apr 19 15:53:57 2016 (r298277) @@ -293,6 +293,36 @@ int bhnd_read_chipid(device_t dev, void bhnd_set_generic_core_desc(device_t dev); + + +bool bhnd_bus_generic_is_hostb_device(device_t dev, + device_t child); +bool bhnd_bus_generic_is_hw_disabled(device_t dev, + device_t child); +bool bhnd_bus_generic_is_region_valid(device_t dev, + device_t child, bhnd_port_type type, + u_int port, u_int region); +int bhnd_bus_generic_read_nvram_var(device_t dev, + device_t child, const char *name, + void *buf, size_t *size); +const struct bhnd_chipid *bhnd_bus_generic_get_chipid(device_t dev, + device_t child); +struct bhnd_resource *bhnd_bus_generic_alloc_resource (device_t dev, + device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, + rman_res_t count, u_int flags); +int bhnd_bus_generic_release_resource (device_t dev, + device_t child, int type, int rid, + struct bhnd_resource *r); +int bhnd_bus_generic_activate_resource (device_t dev, + device_t child, int type, int rid, + struct bhnd_resource *r); +int bhnd_bus_generic_deactivate_resource (device_t dev, + device_t child, int type, int rid, + struct bhnd_resource *r); + + + /** * Return true if @p dev is serving as a host bridge for its parent bhnd * bus. Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Tue Apr 19 15:52:55 2016 (r298276) +++ head/sys/dev/bhnd/bhnd_bus_if.m Tue Apr 19 15:53:57 2016 (r298277) @@ -52,7 +52,25 @@ CODE { static struct bhnd_chipid * bhnd_bus_null_get_chipid(device_t dev, device_t child) { - panic("bhnd_get_chipid unimplemented"); + panic("bhnd_bus_get_chipid unimplemented"); + } + + static bool + bhnd_bus_null_is_hostb_device(device_t dev, device_t child) + { + panic("bhnd_bus_is_hostb_device unimplemented"); + } + + static bool + bhnd_bus_null_is_hw_disabled(device_t dev, device_t child) + { + panic("bhnd_bus_is_hw_disabled unimplemented"); + } + + static int + bhnd_bus_null_get_probe_order(device_t dev, device_t child) + { + panic("bhnd_bus_get_probe_order unimplemented"); } static int @@ -68,7 +86,7 @@ CODE { { return (ENOENT); } - + static int bhnd_bus_null_get_region_addr(device_t dev, device_t child, bhnd_port_type type, u_int port, u_int region, bhnd_addr_t *addr, @@ -83,6 +101,7 @@ CODE { { return (ENOENT); } + } /** @@ -98,7 +117,7 @@ CODE { METHOD bool is_hostb_device { device_t dev; device_t child; -} DEFAULT bhnd_generic_is_hostb_device; +} DEFAULT bhnd_bus_null_is_hostb_device; /** * Return true if the hardware components required by @p child are unpopulated @@ -115,7 +134,7 @@ METHOD bool is_hostb_device { METHOD bool is_hw_disabled { device_t dev; device_t child; -} DEFAULT bhnd_generic_is_hw_disabled; +} DEFAULT bhnd_bus_null_is_hw_disabled; /** * Return the probe (and attach) order for @p child. @@ -147,7 +166,7 @@ METHOD bool is_hw_disabled { METHOD int get_probe_order { device_t dev; device_t child; -} DEFAULT bhnd_generic_get_probe_order; +} DEFAULT bhnd_bus_null_get_probe_order; /** * Return the BHND chip identification for the parent bus. @@ -205,7 +224,7 @@ METHOD struct bhnd_resource * alloc_reso rman_res_t end; rman_res_t count; u_int flags; -} DEFAULT bhnd_generic_alloc_bhnd_resource; +} DEFAULT bhnd_bus_generic_alloc_resource; /** * Release a bhnd resource. @@ -219,7 +238,7 @@ METHOD int release_resource { int type; int rid; struct bhnd_resource *res; -} DEFAULT bhnd_generic_release_bhnd_resource; +} DEFAULT bhnd_bus_generic_release_resource; /** * Activate a bhnd resource. @@ -233,7 +252,7 @@ METHOD int activate_resource { int type; int rid; struct bhnd_resource *r; -} DEFAULT bhnd_generic_activate_bhnd_resource; +} DEFAULT bhnd_bus_generic_activate_resource; /** * Deactivate a bhnd resource. @@ -247,7 +266,7 @@ METHOD int deactivate_resource { int type; int rid; struct bhnd_resource *r; -} DEFAULT bhnd_generic_deactivate_bhnd_resource; +} DEFAULT bhnd_bus_generic_deactivate_resource; /** * Return true if @p region_num is a valid region on @p port_num of @@ -259,13 +278,13 @@ METHOD int deactivate_resource { * @param port_num The port number being queried. * @param region_num The region number being queried. */ -METHOD u_int is_region_valid { +METHOD bool is_region_valid { device_t dev; device_t child; bhnd_port_type type; u_int port_num; u_int region_num; -} DEFAULT bhnd_generic_is_region_valid; +}; /** * Return the number of ports of type @p type attached to @p child. @@ -278,7 +297,7 @@ METHOD u_int get_port_count { device_t dev; device_t child; bhnd_port_type type; -} +}; /** * Return the number of memory regions mapped to @p child @p port of @@ -294,7 +313,7 @@ METHOD u_int get_region_count { device_t child; bhnd_port_type type; u_int port; -} +}; /** * Return the SYS_RES_MEMORY resource-ID for a port/region pair attached to Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Tue Apr 19 15:52:55 2016 (r298276) +++ head/sys/dev/bhnd/bhnd_subr.c Tue Apr 19 15:53:57 2016 (r298277) @@ -646,3 +646,160 @@ bhnd_set_generic_core_desc(device_t dev) device_set_desc(dev, dev_name); } } + +/** + * Helper function for implementing BHND_BUS_IS_HOSTB_DEVICE(). + * + * If a parent device is available, this implementation delegates the + * request to the BHND_BUS_IS_HOSTB_DEVICE() method on the parent of @p dev. + * + * If no parent device is available (i.e. on a the bus root), false + * is returned. + */ +bool +bhnd_bus_generic_is_hostb_device(device_t dev, device_t child) { + if (device_get_parent(dev) != NULL) + return (BHND_BUS_IS_HOSTB_DEVICE(device_get_parent(dev), + child)); + + return (false); +} + +/** + * Helper function for implementing BHND_BUS_IS_HW_DISABLED(). + * + * If a parent device is available, this implementation delegates the + * request to the BHND_BUS_IS_HW_DISABLED() method on the parent of @p dev. + * + * If no parent device is available (i.e. on a the bus root), the hardware + * is assumed to be usable and false is returned. + */ +bool +bhnd_bus_generic_is_hw_disabled(device_t dev, device_t child) +{ + if (device_get_parent(dev) != NULL) + return (BHND_BUS_IS_HW_DISABLED(device_get_parent(dev), child)); + + return (false); +} + +/** + * Helper function for implementing BHND_BUS_GET_CHIPID(). + * + * This implementation delegates the request to the BHND_BUS_GET_CHIPID() + * method on the parent of @p dev. If no parent exists, the implementation + * will panic. + */ +const struct bhnd_chipid * +bhnd_bus_generic_get_chipid(device_t dev, device_t child) +{ + if (device_get_parent(dev) != NULL) + return (BHND_BUS_GET_CHIPID(device_get_parent(dev), child)); + + panic("missing BHND_BUS_GET_CHIPID()"); +} + +/** + * Helper function for implementing BHND_BUS_ALLOC_RESOURCE(). + * + * This implementation of BHND_BUS_ALLOC_RESOURCE() delegates allocation + * of the underlying resource to BUS_ALLOC_RESOURCE(), and activation + * to @p dev's BHND_BUS_ACTIVATE_RESOURCE(). + */ +struct bhnd_resource * +bhnd_bus_generic_alloc_resource(device_t dev, device_t child, int type, + int *rid, rman_res_t start, rman_res_t end, rman_res_t count, + u_int flags) +{ + struct bhnd_resource *br; + struct resource *res; + int error; + + br = NULL; + res = NULL; + + /* Allocate the real bus resource (without activating it) */ + res = BUS_ALLOC_RESOURCE(dev, child, type, rid, start, end, count, + (flags & ~RF_ACTIVE)); + if (res == NULL) + return (NULL); + + /* Allocate our bhnd resource wrapper. */ + br = malloc(sizeof(struct bhnd_resource), M_BHND, M_NOWAIT); + if (br == NULL) + goto failed; + + br->direct = false; + br->res = res; + + /* Attempt activation */ + if (flags & RF_ACTIVE) { + error = BHND_BUS_ACTIVATE_RESOURCE(dev, child, type, *rid, br); + if (error) + goto failed; + } + + return (br); + +failed: + if (res != NULL) + BUS_RELEASE_RESOURCE(dev, child, type, *rid, res); + + free(br, M_BHND); + return (NULL); +} + +/** + * Helper function for implementing BHND_BUS_RELEASE_RESOURCE(). + * + * This implementation of BHND_BUS_RELEASE_RESOURCE() delegates release of + * the backing resource to BUS_RELEASE_RESOURCE(). + */ +int +bhnd_bus_generic_release_resource(device_t dev, device_t child, int type, + int rid, struct bhnd_resource *r) +{ + int error; + + if ((error = BUS_RELEASE_RESOURCE(dev, child, type, rid, r->res))) + return (error); + + free(r, M_BHND); + return (0); +} + + +/** + * Helper function for implementing BHND_BUS_ACTIVATE_RESOURCE(). + * + * This implementation of BHND_BUS_ACTIVATE_RESOURCE() simply calls the + * BHND_BUS_ACTIVATE_RESOURCE() method of the parent of @p dev. + */ +int +bhnd_bus_generic_activate_resource(device_t dev, device_t child, int type, + int rid, struct bhnd_resource *r) +{ + /* Try to delegate to the parent */ + if (device_get_parent(dev) != NULL) + return (BHND_BUS_ACTIVATE_RESOURCE(device_get_parent(dev), + child, type, rid, r)); + + return (EINVAL); +}; + +/** + * Helper function for implementing BHND_BUS_DEACTIVATE_RESOURCE(). + * + * This implementation of BHND_BUS_ACTIVATE_RESOURCE() simply calls the + * BHND_BUS_ACTIVATE_RESOURCE() method of the parent of @p dev. + */ +int +bhnd_bus_generic_deactivate_resource(device_t dev, device_t child, + int type, int rid, struct bhnd_resource *r) +{ + if (device_get_parent(dev) != NULL) + return (BHND_BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), + child, type, rid, r)); + + return (EINVAL); +}; \ No newline at end of file Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Tue Apr 19 15:52:55 2016 (r298276) +++ head/sys/dev/bhnd/bhndb/bhndb.c Tue Apr 19 15:53:57 2016 (r298277) @@ -1048,15 +1048,15 @@ bhndb_alloc_resource(device_t dev, devic struct resource *rv; struct rman *rm; int error; - bool immed_child, defaults; + bool passthrough, isdefault; sc = device_get_softc(dev); - immed_child = (device_get_parent(child) == dev); - defaults = (start == 0UL && end == ~0UL); + passthrough = (device_get_parent(child) != dev); + isdefault = RMAN_IS_DEFAULT_RANGE(start, end); rle = NULL; /* Populate defaults */ - if (immed_child && defaults) { + if (!passthrough && isdefault) { /* Fetch the resource list entry. */ rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child), type, *rid); @@ -1083,7 +1083,7 @@ bhndb_alloc_resource(device_t dev, devic } /* Validate resource addresses */ - if (start > end || end < start || count > ((end - start) + 1)) + if (start > end || count > ((end - start) + 1)) return (NULL); /* Fetch the resource manager */ @@ -1512,62 +1512,6 @@ bhndb_get_resource_list(device_t dev, de } /** - * Default bhndb(4) implementation of BHND_BUS_ALLOC_RESOURCE(). - */ -static struct bhnd_resource * -bhndb_alloc_bhnd_resource(device_t dev, device_t child, int type, - int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct bhndb_softc *sc; - struct bhnd_resource *br; - - sc = device_get_softc(dev); - - /* Allocate resource wrapper */ - br = malloc(sizeof(struct bhnd_resource), M_BHND, M_NOWAIT|M_ZERO); - if (br == NULL) - return (NULL); - - /* Configure */ - br->direct = false; - br->res = bus_alloc_resource(child, type, rid, start, end, count, - flags & ~RF_ACTIVE); - if (br->res == NULL) - goto failed; - - - if (flags & RF_ACTIVE) { - if (bhnd_activate_resource(child, type, *rid, br)) - goto failed; - } - - return (br); - -failed: - if (br->res != NULL) - bus_release_resource(child, type, *rid, br->res); - - free(br, M_BHND); - return (NULL); -} - -/** - * Default bhndb(4) implementation of BHND_BUS_RELEASE_RESOURCE(). - */ -static int -bhndb_release_bhnd_resource(device_t dev, device_t child, - int type, int rid, struct bhnd_resource *r) -{ - int error; - - if ((error = bus_release_resource(child, type, rid, r->res))) - return (error); - - free(r, M_BHND); - return (0); -} - -/** * Default bhndb(4) implementation of BHND_BUS_ACTIVATE_RESOURCE(). * * For BHNDB_ADDRSPACE_NATIVE children, all resources may be assumed to @@ -1983,8 +1927,6 @@ static device_method_t bhndb_methods[] = DEVMETHOD(bhnd_bus_is_hw_disabled, bhndb_is_hw_disabled), DEVMETHOD(bhnd_bus_is_hostb_device, bhndb_is_hostb_device), DEVMETHOD(bhnd_bus_get_chipid, bhndb_get_chipid), - DEVMETHOD(bhnd_bus_alloc_resource, bhndb_alloc_bhnd_resource), - DEVMETHOD(bhnd_bus_release_resource, bhndb_release_bhnd_resource), DEVMETHOD(bhnd_bus_activate_resource, bhndb_activate_bhnd_resource), DEVMETHOD(bhnd_bus_activate_resource, bhndb_deactivate_bhnd_resource), DEVMETHOD(bhnd_bus_read_1, bhndb_bus_read_1), Modified: head/sys/dev/bhnd/bhndvar.h ============================================================================== --- head/sys/dev/bhnd/bhndvar.h Tue Apr 19 15:52:55 2016 (r298276) +++ head/sys/dev/bhnd/bhndvar.h Tue Apr 19 15:53:57 2016 (r298277) @@ -70,37 +70,5 @@ int bhnd_generic_suspend_child(device device_t child); int bhnd_generic_resume_child(device_t dev, device_t child); - -bool bhnd_generic_is_hostb_device(device_t dev, - device_t child); -bool bhnd_generic_is_hw_disabled(device_t dev, - device_t child); -bool bhnd_generic_is_region_valid(device_t dev, - device_t child, bhnd_port_type type, u_int port, - u_int region); - -int bhnd_generic_read_nvram_var(device_t dev, - device_t child, const char *name, void *buf, - size_t *size); - -const struct bhnd_chipid *bhnd_generic_get_chipid(device_t dev, device_t child); - -struct bhnd_resource *bhnd_generic_alloc_bhnd_resource (device_t dev, - device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, - u_int flags); - -int bhnd_generic_release_bhnd_resource (device_t dev, - device_t child, int type, int rid, - struct bhnd_resource *r); - -int bhnd_generic_activate_bhnd_resource (device_t dev, - device_t child, int type, int rid, - struct bhnd_resource *r); - -int bhnd_generic_deactivate_bhnd_resource (device_t dev, - device_t child, int type, int rid, - struct bhnd_resource *r); - #endif /* _BHND_BHNDVAR_H_ */ From owner-svn-src-all@freebsd.org Tue Apr 19 15:56:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1311B14D62; Tue, 19 Apr 2016 15:56:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DAF01FD0; Tue, 19 Apr 2016 15:56:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JFueMp054881; Tue, 19 Apr 2016 15:56:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JFueTD054874; Tue, 19 Apr 2016 15:56:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604191556.u3JFueTD054874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 19 Apr 2016 15:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298278 - in head/sys/dev/bhnd: . bhndb cores/chipc cores/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 15:56:41 -0000 Author: adrian Date: Tue Apr 19 15:56:39 2016 New Revision: 298278 URL: https://svnweb.freebsd.org/changeset/base/298278 Log: [bhnd] Standardize bhnd device tables and quirk matching. This add a bhnd device table mechanism that standardizes matching of devices on the bhnd(4) bus, discovery of device quirk flags, and should be pluggable into the new PNPINFO machinery. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D5759 Modified: head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndb/bhndb_pcivar.h head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue Apr 19 15:53:57 2016 (r298277) +++ head/sys/dev/bhnd/bhnd.h Tue Apr 19 15:56:39 2016 (r298278) @@ -167,72 +167,104 @@ struct bhnd_hwrev_match { /** * Wildcard hardware revision match descriptor. */ -#define BHND_HWREV_MATCH_ANY { BHND_HWREV_INVALID, BHND_HWREV_INVALID } - - -/** A core match descriptor. */ -struct bhnd_core_match { - uint16_t vendor; /**< required JEP106 device vendor or BHND_MFGID_INVALID. */ - uint16_t device; /**< required core ID or BHND_COREID_INVALID */ - struct bhnd_hwrev_match hwrev; /**< matching revisions. */ - bhnd_devclass_t class; /**< required class or BHND_DEVCLASS_INVALID */ - int unit; /**< required core unit, or -1 */ -}; - - -/** - * Revision-specific hardware quirk descriptor. - * - * Defines a set of quirk flags applicable to a range of hardware - * revisions. - */ -struct bhnd_device_quirk { - struct bhnd_hwrev_match hwrev; /**< applicable hardware revisions */ - uint32_t quirks; /**< applicable quirk flags */ -}; +#define BHND_HWREV_ANY { BHND_HWREV_INVALID, BHND_HWREV_INVALID } +#define BHND_HWREV_IS_ANY(_m) \ + ((_m)->start == BHND_HWREV_INVALID && (_m)->end == BHND_HWREV_INVALID) /** - * Define a bhnd_device_quirk over a range of hardware revisions. + * Hardware revision match descriptor for an inclusive range. * * @param _start The first applicable hardware revision. * @param _end The last applicable hardware revision, or BHND_HWREV_INVALID * to match on any revision. - * @param _quirks Quirk flags applicable to this revision range. */ -#define BHND_QUIRK_HWREV_RANGE(_start, _end, _quirks) \ - { .hwrev = { _start, _end }, .quirks = _quirks } +#define BHND_HWREV_RANGE(_start, _end) { _start, _end } /** - * Define a bhnd_device_quirk for a specific hardware revision. + * Hardware revision match descriptor for a single revision. * * @param _hwrev The hardware revision to match on. - * @param _quirks Quirk flags applicable to this revision. */ -#define BHND_QUIRK_HWREV_EQ(_hwrev, _quirks) \ - BHND_QUIRK_HWREV_RANGE(_hwrev, _hwrev, _quirks) +#define BHND_HWREV_EQ(_hwrev) BHND_HWREV_RANGE(_hwrev, _hwrev) /** - * Define a bhnd_device_quirk for any hardware revision equal or greater + * Hardware revision match descriptor for any revision equal to or greater * than @p _start. * * @param _start The first hardware revision to match on. - * @param _quirks Quirk flags applicable to this revision. */ -#define BHND_QUIRK_HWREV_GTE(_start, _quirks) \ - BHND_QUIRK_HWREV_RANGE(_start, BHND_HWREV_INVALID, _quirks) +#define BHND_HWREV_GTE(_start) BHND_HWREV_RANGE(_start, BHND_HWREV_INVALID) /** - * Define a bhnd_device_quirk for any hardware revision equal or less + * Hardware revision match descriptor for any revision equal to or less * than @p _end. * * @param _end The last hardware revision to match on. - * @param _quirks Quirk flags applicable to this revision. */ -#define BHND_QUIRK_HWREV_LTE(_end, _quirks) \ - BHND_QUIRK_HWREV_RANGE(0, _end, _quirks) +#define BHND_HWREV_LTE(_end) BHND_HWREV_RANGE(0, _end) + + +/** A core match descriptor. */ +struct bhnd_core_match { + uint16_t vendor; /**< required JEP106 device vendor or BHND_MFGID_INVALID. */ + uint16_t device; /**< required core ID or BHND_COREID_INVALID */ + struct bhnd_hwrev_match hwrev; /**< matching revisions. */ + bhnd_devclass_t class; /**< required class or BHND_DEVCLASS_INVALID */ + int unit; /**< required core unit, or -1 */ +}; + +/** + * Core match descriptor matching against the given @p _vendor, @p _device, + * and @p _hwrev match descriptors. + */ +#define BHND_CORE_MATCH(_vendor, _device, _hwrev) \ + { _vendor, _device, _hwrev, BHND_DEVCLASS_INVALID, -1 } + +/** + * Wildcard core match descriptor. + */ +#define BHND_CORE_MATCH_ANY \ + { \ + .vendor = BHND_MFGID_INVALID, \ + .device = BHND_COREID_INVALID, \ + .hwrev = BHND_HWREV_ANY, \ + .class = BHND_DEVCLASS_INVALID, \ + .unit = -1 \ + } + +/** + * Device quirk table descriptor. + */ +struct bhnd_device_quirk { + struct bhnd_hwrev_match hwrev; /**< applicable hardware revisions */ + uint32_t quirks; /**< quirk flags */ +}; +#define BHND_DEVICE_QUIRK_END { BHND_HWREV_ANY, 0 } +#define BHND_DEVICE_QUIRK_IS_END(_q) \ + (BHND_HWREV_IS_ANY(&(_q)->hwrev) && (_q)->quirks == 0) + +enum { + BHND_DF_ANY = 0, + BHND_DF_HOSTB = (1<<0) /**< core is serving as the bus' + * host bridge */ +}; + +/** Device probe table descriptor */ +struct bhnd_device { + const struct bhnd_core_match core; /**< core match descriptor */ + const char *desc; /**< device description, or NULL. */ + const struct bhnd_device_quirk *quirks_table; /**< quirks table for this device, or NULL */ + uint32_t device_flags; /**< required BHND_DF_* flags */ +}; + +#define _BHND_DEVICE(_device, _desc, _quirks, _flags, ...) \ + { BHND_CORE_MATCH(BHND_MFGID_BCM, BHND_COREID_ ## _device, \ + BHND_HWREV_ANY), _desc, _quirks, _flags } + +#define BHND_DEVICE(_device, _desc, _quirks, ...) \ + _BHND_DEVICE(_device, _desc, _quirks, ## __VA_ARGS__, 0) -/** Mark the end of a bhnd_device_quirk table. */ -#define BHND_QUIRK_HWREV_END { BHND_HWREV_MATCH_ANY, 0 } +#define BHND_DEVICE_END { BHND_CORE_MATCH_ANY, NULL, NULL, 0 } const char *bhnd_vendor_name(uint16_t vendor); const char *bhnd_port_type_name(bhnd_port_type port_type); @@ -271,6 +303,14 @@ bool bhnd_hwrev_matches(uint16_t hwr bool bhnd_device_matches(device_t dev, const struct bhnd_core_match *desc); +const struct bhnd_device *bhnd_device_lookup(device_t dev, + const struct bhnd_device *table, + size_t entry_size); + +uint32_t bhnd_device_quirks(device_t dev, + const struct bhnd_device *table, + size_t entry_size); + struct bhnd_core_info bhnd_get_core_info(device_t dev); @@ -290,9 +330,9 @@ int bhnd_read_chipid(device_t dev, bus_size_t chipc_offset, struct bhnd_chipid *result); -void bhnd_set_generic_core_desc(device_t dev); - - +void bhnd_set_custom_core_desc(device_t dev, + const char *name); +void bhnd_set_default_core_desc(device_t dev); bool bhnd_bus_generic_is_hostb_device(device_t dev, Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Tue Apr 19 15:53:57 2016 (r298277) +++ head/sys/dev/bhnd/bhnd_subr.c Tue Apr 19 15:56:39 2016 (r298278) @@ -470,6 +470,85 @@ bhnd_device_matches(device_t dev, const } /** + * Search @p table for an entry matching @p dev. + * + * @param dev A bhnd device to match against @p table. + * @param table The device table to search. + * @param entry_size The @p table entry size, in bytes. + * + * @retval bhnd_device the first matching device, if any. + * @retval NULL if no matching device is found in @p table. + */ +const struct bhnd_device * +bhnd_device_lookup(device_t dev, const struct bhnd_device *table, + size_t entry_size) +{ + const struct bhnd_device *entry; + + for (entry = table; entry->desc != NULL; entry = + (const struct bhnd_device *) ((const char *) entry + entry_size)) + { + /* match core info */ + if (!bhnd_device_matches(dev, &entry->core)) + continue; + + /* match device flags */ + if (entry->device_flags & BHND_DF_HOSTB) { + if (!bhnd_is_hostb_device(dev)) + continue; + } + + /* device found */ + return (entry); + } + + /* not found */ + return (NULL); +} + +/** + * Scan @p table for all quirk flags applicable to @p dev. + * + * @param dev A bhnd device to match against @p table. + * @param table The device table to search. + * @param entry_size The @p table entry size, in bytes. + * + * @return returns all matching quirk flags. + */ +uint32_t +bhnd_device_quirks(device_t dev, const struct bhnd_device *table, + size_t entry_size) +{ + const struct bhnd_device *dent; + const struct bhnd_device_quirk *qtable, *qent; + uint32_t quirks; + uint16_t hwrev; + + hwrev = bhnd_get_hwrev(dev); + quirks = 0; + + /* Find the quirk table */ + if ((dent = bhnd_device_lookup(dev, table, entry_size)) == NULL) { + /* This is almost certainly a (caller) implementation bug */ + device_printf(dev, "quirk lookup did not match any device\n"); + return (0); + } + + /* Quirks aren't a mandatory field */ + if ((qtable = dent->quirks_table) == NULL) + return (0); + + /* Collect matching quirk entries */ + for (qent = qtable; !BHND_DEVICE_QUIRK_IS_END(qent); qent++) { + if (bhnd_hwrev_matches(hwrev, &qent->hwrev)) + quirks |= qent->quirks; + } + + return (quirks); +} + + +/** * Allocate bhnd(4) resources defined in @p rs from a parent bus. * * @param dev The device requesting ownership of the resources. @@ -619,25 +698,21 @@ cleanup: } /** - * Using the bhnd(4) bus-level core information, populate @p dev's device - * description. + * Using the bhnd(4) bus-level core information and a custom core name, + * populate @p dev's device description. * * @param dev A bhnd-bus attached device. + * @param dev_name The core's name (e.g. "SDIO Device Core") */ void -bhnd_set_generic_core_desc(device_t dev) +bhnd_set_custom_core_desc(device_t dev, const char *dev_name) { - const char *dev_name; const char *vendor_name; char *desc; vendor_name = bhnd_get_vendor_name(dev); - dev_name = bhnd_get_device_name(dev); - - asprintf(&desc, M_BHND, "%s %s, rev %hhu", - bhnd_get_vendor_name(dev), - bhnd_get_device_name(dev), - bhnd_get_hwrev(dev)); + asprintf(&desc, M_BHND, "%s %s, rev %hhu", vendor_name, dev_name, + bhnd_get_hwrev(dev)); if (desc != NULL) { device_set_desc_copy(dev, desc); @@ -648,6 +723,18 @@ bhnd_set_generic_core_desc(device_t dev) } /** + * Using the bhnd(4) bus-level core information, populate @p dev's device + * description. + * + * @param dev A bhnd-bus attached device. + */ +void +bhnd_set_default_core_desc(device_t dev) +{ + bhnd_set_custom_core_desc(dev, bhnd_get_device_name(dev)); +} + +/** * Helper function for implementing BHND_BUS_IS_HOSTB_DEVICE(). * * If a parent device is available, this implementation delegates the Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Tue Apr 19 15:53:57 2016 (r298277) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Tue Apr 19 15:56:39 2016 (r298278) @@ -111,56 +111,60 @@ static const struct bhndb_pci_id *bhndb_ */ static const struct bhndb_pci_id bhndb_pci_ids[] = { /* PCI */ - BHNDB_PCI_ID(PCI, - BHND_QUIRK_HWREV_GTE (0, - BHNDB_PCI_QUIRK_EXT_CLOCK_GATING | - BHNDB_PCI_QUIRK_SBTOPCI2_PREF_BURST), - - BHND_QUIRK_HWREV_RANGE (0, 5, - BHNDB_PCI_QUIRK_SBINTVEC), - - BHND_QUIRK_HWREV_GTE (11, - BHNDB_PCI_QUIRK_SBTOPCI2_READMULTI | - BHNDB_PCI_QUIRK_CLKRUN_DSBL), + { BHND_COREID_PCI, BHND_PCI_REGFMT_PCI, + (struct bhnd_device_quirk[]) { + { BHND_HWREV_GTE (0), + BHNDB_PCI_QUIRK_EXT_CLOCK_GATING | + BHNDB_PCI_QUIRK_SBTOPCI2_PREF_BURST }, + + { BHND_HWREV_RANGE (0, 5), + BHNDB_PCI_QUIRK_SBINTVEC }, + + { BHND_HWREV_GTE (11), + BHNDB_PCI_QUIRK_SBTOPCI2_READMULTI | + BHNDB_PCI_QUIRK_CLKRUN_DSBL }, - BHND_QUIRK_HWREV_END - ), + BHND_DEVICE_QUIRK_END + } + }, /* PCI Gen 1 */ - BHNDB_PCI_ID(PCIE, - BHND_QUIRK_HWREV_EQ (0, - BHNDB_PCIE_QUIRK_SDR9_L0s_HANG), + { BHND_COREID_PCIE, BHND_PCI_REGFMT_PCIE, + (struct bhnd_device_quirk[]) { + { BHND_HWREV_EQ (0), + BHNDB_PCIE_QUIRK_SDR9_L0s_HANG }, - BHND_QUIRK_HWREV_RANGE (0, 1, - BHNDB_PCIE_QUIRK_UR_STATUS_FIX), + { BHND_HWREV_RANGE (0, 1), + BHNDB_PCIE_QUIRK_UR_STATUS_FIX }, - BHND_QUIRK_HWREV_EQ (1, - BHNDB_PCIE_QUIRK_PCIPM_REQEN), + { BHND_HWREV_EQ (1), + BHNDB_PCIE_QUIRK_PCIPM_REQEN }, - BHND_QUIRK_HWREV_RANGE (3, 5, - BHNDB_PCIE_QUIRK_ASPM_OVR | - BHNDB_PCIE_QUIRK_SDR9_POLARITY | - BHNDB_PCIE_QUIRK_SDR9_NO_FREQRETRY), + { BHND_HWREV_RANGE (3, 5), + BHNDB_PCIE_QUIRK_ASPM_OVR | + BHNDB_PCIE_QUIRK_SDR9_POLARITY | + BHNDB_PCIE_QUIRK_SDR9_NO_FREQRETRY }, - BHND_QUIRK_HWREV_LTE (6, - BHNDB_PCIE_QUIRK_L1_IDLE_THRESH), + { BHND_HWREV_LTE (6), + BHNDB_PCIE_QUIRK_L1_IDLE_THRESH }, - BHND_QUIRK_HWREV_GTE (6, - BHNDB_PCIE_QUIRK_SPROM_L23_PCI_RESET), + { BHND_HWREV_GTE (6), + BHNDB_PCIE_QUIRK_SPROM_L23_PCI_RESET }, - BHND_QUIRK_HWREV_EQ (7, - BHNDB_PCIE_QUIRK_SERDES_NOPLLDOWN), + { BHND_HWREV_EQ (7), + BHNDB_PCIE_QUIRK_SERDES_NOPLLDOWN }, - BHND_QUIRK_HWREV_GTE (8, - BHNDB_PCIE_QUIRK_L1_TIMER_PERF), + { BHND_HWREV_GTE (8), + BHNDB_PCIE_QUIRK_L1_TIMER_PERF }, - BHND_QUIRK_HWREV_GTE (10, - BHNDB_PCIE_QUIRK_SD_C22_EXTADDR), + { BHND_HWREV_GTE (10), + BHNDB_PCIE_QUIRK_SD_C22_EXTADDR }, - BHND_QUIRK_HWREV_END - ), + BHND_DEVICE_QUIRK_END + } + }, - { BHND_COREID_INVALID, BHND_PCI_REGFMT_PCI, NULL } + { BHND_COREID_INVALID, BHND_PCI_REGFMT_PCI } }; Modified: head/sys/dev/bhnd/bhndb/bhndb_pcivar.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pcivar.h Tue Apr 19 15:53:57 2016 (r298277) +++ head/sys/dev/bhnd/bhndb/bhndb_pcivar.h Tue Apr 19 15:56:39 2016 (r298278) @@ -97,15 +97,6 @@ struct bhndb_pci_softc { } sdr9_quirk_polarity; }; -/* Declare a bhndb_pci_id entry */ -#define BHNDB_PCI_ID(_device, _desc, ...) { \ - BHND_COREID_ ## _device, \ - BHND_PCI_REGFMT_ ## _device, \ - (struct bhnd_device_quirk[]) { \ - __VA_ARGS__ \ - } \ -} - /* * PCI/PCIe-Gen1 endpoint-mode device quirks */ Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Tue Apr 19 15:53:57 2016 (r298277) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Tue Apr 19 15:56:39 2016 (r298278) @@ -62,21 +62,22 @@ static const struct resource_spec chipc_ { -1, -1, 0 } }; +static struct bhnd_device_quirk chipc_quirks[]; + /* Supported device identifiers */ -static const struct chipc_device { - uint16_t device; -} chipc_devices[] = { - { BHND_COREID_CC }, - { BHND_COREID_INVALID } +static const struct bhnd_device chipc_devices[] = { + BHND_DEVICE(CC, "", chipc_quirks), + BHND_DEVICE_END }; + /* Device quirks table */ static struct bhnd_device_quirk chipc_quirks[] = { - BHND_QUIRK_HWREV_RANGE (0, 21, CHIPC_QUIRK_ALWAYS_HAS_SPROM), - BHND_QUIRK_HWREV_EQ (22, CHIPC_QUIRK_SPROM_CHECK_CST_R22), - BHND_QUIRK_HWREV_RANGE (23, 31, CHIPC_QUIRK_SPROM_CHECK_CST_R23), - BHND_QUIRK_HWREV_GTE (35, CHIPC_QUIRK_SUPPORTS_NFLASH), - BHND_QUIRK_HWREV_END + { BHND_HWREV_RANGE (0, 21), CHIPC_QUIRK_ALWAYS_HAS_SPROM }, + { BHND_HWREV_EQ (22), CHIPC_QUIRK_SPROM_CHECK_CST_R22 }, + { BHND_HWREV_RANGE (23, 31), CHIPC_QUIRK_SPROM_CHECK_CST_R23 }, + { BHND_HWREV_GTE (35), CHIPC_QUIRK_SUPPORTS_NFLASH }, + BHND_DEVICE_QUIRK_END }; /* quirk and capability flag convenience macros */ @@ -95,25 +96,19 @@ static struct bhnd_device_quirk chipc_qu static int chipc_probe(device_t dev) { - const struct chipc_device *id; + const struct bhnd_device *id; - for (id = chipc_devices; id->device != BHND_COREID_INVALID; id++) - { - if (bhnd_get_vendor(dev) == BHND_MFGID_BCM && - bhnd_get_device(dev) == id->device) - { - bhnd_set_generic_core_desc(dev); - return (BUS_PROBE_DEFAULT); - } - } + id = bhnd_device_lookup(dev, chipc_devices, sizeof(chipc_devices[0])); + if (id == NULL) + return (ENXIO); - return (ENXIO); + bhnd_set_default_core_desc(dev); + return (BUS_PROBE_DEFAULT); } static int chipc_attach(device_t dev) { - struct bhnd_device_quirk *dq; struct chipc_softc *sc; bhnd_addr_t enum_addr; uint32_t ccid_reg; @@ -122,6 +117,8 @@ chipc_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + sc->quirks = bhnd_device_quirks(dev, chipc_devices, + sizeof(chipc_devices[0])); /* Allocate bus resources */ memcpy(sc->rspec, chipc_rspec, sizeof(sc->rspec)); @@ -155,13 +152,6 @@ chipc_attach(device_t dev) sc->caps = bhnd_bus_read_4(sc->core, CHIPC_CAPABILITIES); sc->cst = bhnd_bus_read_4(sc->core, CHIPC_CHIPST); - /* Populate the set of applicable quirk flags */ - sc->quirks = 0; - for (dq = chipc_quirks; dq->quirks != 0; dq++) { - if (bhnd_hwrev_matches(bhnd_get_hwrev(dev), &dq->hwrev)) - sc->quirks |= dq->quirks; - } - // TODO switch (bhnd_chipc_nvram_src(dev)) { case BHND_NVRAM_SRC_CIS: Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c Tue Apr 19 15:53:57 2016 (r298277) +++ head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c Tue Apr 19 15:56:39 2016 (r298278) @@ -68,7 +68,7 @@ bhnd_pci_hostb_probe(device_t dev) if (!bhnd_is_hostb_device(dev)) return (ENXIO); - bhnd_set_generic_core_desc(dev); + bhnd_set_default_core_desc(dev); return (BUS_PROBE_DEFAULT); } From owner-svn-src-all@freebsd.org Tue Apr 19 16:05:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBB08B14156; Tue, 19 Apr 2016 16:05:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73B4917D3; Tue, 19 Apr 2016 16:05:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u3JG506G035260 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 19 Apr 2016 19:05:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u3JG506G035260 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u3JG50sO035244; Tue, 19 Apr 2016 19:05:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 19 Apr 2016 19:05:00 +0300 From: Konstantin Belousov To: Allan Jude Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... Message-ID: <20160419160500.GY2422@kib.kiev.ua> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <20160419093022.GV2422@kib.kiev.ua> <5716538B.4060108@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5716538B.4060108@freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 16:05:11 -0000 On Tue, Apr 19, 2016 at 11:49:31AM -0400, Allan Jude wrote: > On 2016-04-19 05:30, Konstantin Belousov wrote: > > On Mon, Apr 18, 2016 at 07:43:04PM -0400, Allan Jude wrote: > >> On 2016-04-18 19:36, Adrian Chadd wrote: > >>> Someone pointed out how this bloats out memory requirement in loader. > >>> > >>> Did anyone check that? > >>> > >>> -adrian > >>> > >> > >> I tested down to 128mb of ram in QEMU, booted from the installer ISO, > >> did the install, and booted the installed system without issue. > > > > 64MB is^H^H was very much useful and workable i386 config. i386 kernel > > does fit into the 32M but current automatic tuning prevents usermode > > from operating. Little manual tuning make 32M on tolerable. > > > > Making loader require 64M is a regression. At very least, it is > > impossible to test low mem configs anymore. > > > > Would a src.conf knob make sense, to use a smaller value when targeting > small systems, while keeping the advantages when using more reasonable > systems? > > Or we could make these changes to the HEAP and bcache size specific to > 64bit platforms? I do not consider neither the current state, nor the two proposed changes, acceptable. Loader is same on 32 and 64 bit x86 machines, so how would you reconfigure it on 64bit machine ? Non-default knob is too obscure and hard to communicate, people would try to use 32M and see that it breaks, just abandoning the idea of trying. Either default-built loader should size itself dynamically based on the available memory, perhaps capping heap at 64MB starting from the 128MB configs, or, assuming that we consider 32MB be the absolute minimal workable config, loader could set HEAP to 8MB. Dynamic heap size is theoretically best, but it might be hard to do if memory map is retrieved after heap is configured (I do not know). From owner-svn-src-all@freebsd.org Tue Apr 19 16:40:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B1BBB13118; Tue, 19 Apr 2016 16:40:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474911FDA; Tue, 19 Apr 2016 16:40:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22e.google.com with SMTP id gy3so20591153igb.1; Tue, 19 Apr 2016 09:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=zUKoaFTA4VXEOsmI4SItbx1fRuYJOsmlLDDfVxswF3o=; b=fkd6zfD70BTA2GmVihvfzFcUhRPRdvqxb9Vrx+Hc773j/dJHUG1VXXZkEagP4mHClR lqgxNLWZh4e6PHedmI5hspqlQFqHFbow0he+U2mtbTJ19d+DYGXH544xK/ANy9EFHCFY cdb3MpU36FfyPLUdAH5NxCDv8GYEGetTUv01LIT/5/yvfOWxsf4XWcdHzxP3Mafm3TGY y1XjCASYpmso8dwxNkTsbKb+wRHC5cMpm/Gvf6OEeTEsoNl1e24QxZbAN/X+23T/LNOb b67xdpoUW4SIATyCFdBktJZWY9OvFBvQaQ6I1armZ2GlRBNvRBelXgTg58WhcZEkYbtg 9OHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=zUKoaFTA4VXEOsmI4SItbx1fRuYJOsmlLDDfVxswF3o=; b=VMJ60tdSr+zsifpfxlfq7sUg0pUJW5RitMK3U3z2NfSM6qN7jrN/rn45ygWBnPbNEj 3QDA6qe+ymKMKAFp2cvANaABGfETx7txDFNDN3s0LwxN3YDTWBk/YB4fV1Aj0Lg4tbkh ljb8+SIjEfDZoo8AcDUDEilns6d9sv4SkedNfb7DBEMKjwmxQtI+l8W+AmQlZGXDrhKo fE+GAsxsOf5o2CkFxh7zITuNR3VSC5VNcQKHzjeq2DNg1Hz7WWPRER+NuCQcwMeL/XJ9 Xkz9bNyUjsvBuaQALv20j40ASLpp3hchP8Fwf0igTkJbmySCsuYJuv8xVcyvUVMfQVzA aALg== X-Gm-Message-State: AOPr4FVqxf5mr3ku+cuv1YUtJtmPrC53gTlvHSxlxrAuWU99NGGX0UoZYPCkk9dpZUGgEx6EXacMUofJ4JFpVA== MIME-Version: 1.0 X-Received: by 10.50.50.234 with SMTP id f10mr26889312igo.37.1461084023630; Tue, 19 Apr 2016 09:40:23 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Tue, 19 Apr 2016 09:40:23 -0700 (PDT) In-Reply-To: <201604191539.u3JFdkHx048678@repo.freebsd.org> References: <201604191539.u3JFdkHx048678@repo.freebsd.org> Date: Tue, 19 Apr 2016 09:40:23 -0700 Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Adrian Chadd To: Ruslan Bukin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 16:40:24 -0000 Hm, why'd you do this? did you get it reviewed first? I'm about to write a kernel bitbang SPI driver that supports arbitrary GPIOs, and I was thinking of fleshing this out somewhat. -adrian On 19 April 2016 at 08:39, Ruslan Bukin wrote: > Author: br > Date: Tue Apr 19 15:39:46 2016 > New Revision: 298274 > URL: https://svnweb.freebsd.org/changeset/base/298274 > > Log: > Revert r298268 (Add optional chip_select/deselect methods). > None of supported hardware do require that. > > Modified: > head/sys/dev/spibus/spibus.c > head/sys/dev/spibus/spibus_if.m > > Modified: head/sys/dev/spibus/spibus.c > ============================================================================== > --- head/sys/dev/spibus/spibus.c Tue Apr 19 15:36:18 2016 (r298273) > +++ head/sys/dev/spibus/spibus.c Tue Apr 19 15:39:46 2016 (r298274) > @@ -185,24 +185,9 @@ spibus_hinted_child(device_t bus, const > static int > spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd) > { > - > return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd)); > } > > -static int > -spibus_chip_select_impl(device_t dev, device_t child) > -{ > - > - return (SPIBUS_CHIP_SELECT(device_get_parent(dev), child)); > -} > - > -static int > -spibus_chip_deselect_impl(device_t dev, device_t child) > -{ > - > - return (SPIBUS_CHIP_DESELECT(device_get_parent(dev), child)); > -} > - > static device_method_t spibus_methods[] = { > /* Device interface */ > DEVMETHOD(device_probe, spibus_probe), > @@ -223,8 +208,6 @@ static device_method_t spibus_methods[] > > /* spibus interface */ > DEVMETHOD(spibus_transfer, spibus_transfer_impl), > - DEVMETHOD(spibus_chip_select, spibus_chip_select_impl), > - DEVMETHOD(spibus_chip_deselect, spibus_chip_deselect_impl), > > DEVMETHOD_END > }; > > Modified: head/sys/dev/spibus/spibus_if.m > ============================================================================== > --- head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:36:18 2016 (r298273) > +++ head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:39:46 2016 (r298274) > @@ -39,19 +39,3 @@ METHOD int transfer { > device_t child; > struct spi_command *cmd; > }; > - > -# > -# Assert chip select > -# > -METHOD int chip_select { > - device_t dev; > - device_t child; > -}; > - > -# > -# Deassert chip select > -# > -METHOD int chip_deselect { > - device_t dev; > - device_t child; > -}; > From owner-svn-src-all@freebsd.org Tue Apr 19 16:48:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2783DB13600; Tue, 19 Apr 2016 16:48:16 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC2A618DC; Tue, 19 Apr 2016 16:48:15 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JGmFpm069885; Tue, 19 Apr 2016 16:48:15 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JGmFtd069884; Tue, 19 Apr 2016 16:48:15 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201604191648.u3JGmFtd069884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 19 Apr 2016 16:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298279 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 16:48:16 -0000 Author: sbruno Date: Tue Apr 19 16:48:14 2016 New Revision: 298279 URL: https://svnweb.freebsd.org/changeset/base/298279 Log: Plug memory leak in ctl(4) when ctl_copyin_args() is called with a non- null terminated ASCII string. PR: 207626 Submitted by: cturt@hardenedbsd.org MFC after: 2 days Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Apr 19 15:56:39 2016 (r298278) +++ head/sys/cam/ctl/ctl.c Tue Apr 19 16:48:14 2016 (r298279) @@ -2445,6 +2445,7 @@ ctl_copyin_args(int num_args, struct ctl && (tmpptr[args[i].vallen - 1] != '\0')) { snprintf(error_str, error_str_len, "Argument " "%d value is not NUL-terminated", i); + free(tmpptr, M_CTL); goto bailout; } args[i].kvalue = tmpptr; From owner-svn-src-all@freebsd.org Tue Apr 19 17:11:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48CCAB141EA; Tue, 19 Apr 2016 17:11:58 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8E7C1969; Tue, 19 Apr 2016 17:11:57 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by mail-lf0-x22d.google.com with SMTP id g184so24763496lfb.3; Tue, 19 Apr 2016 10:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=UHLG3LknSn0yDQiFiXjNX1/FBEaB8TSZq0vqXqJCUJ4=; b=S08SZdVWlT53leIKywxLT80h473pYTtC1O3kZCqXRbo7F9CnHTbfGU4TFCiOEENjWr 9B8A4HZgGA9dxOsfmx21gjDyJSXU/tbiis5uRENdbvGCvVX69zPxLJnkH1emwnrhiDU+ UGBqCYOGs3DdcP0CVf/42slQt0xJ01zmg7EFbLg24dplmkzM9m6J+dRTb6Swqigr5EXy wrtF6EPa/0n0lYP5hRkmDDkQIesv+OOGLh+BJkHbRGW8kpXkzgEi4ItiGlzfBWeB/Mi5 bu7opxNaMN31OeU3yTP/4LsBd/PF1A7Od44R/q6JBE8y5T/PqqIWIFUquyqMo39WmGH/ UPWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=UHLG3LknSn0yDQiFiXjNX1/FBEaB8TSZq0vqXqJCUJ4=; b=EqrHYPhvLEc7ipTeHC/jA3s8qI45ikn9v6L3zkG/yPGzstYJx6sz6c2Yiu2NEvB2U8 p8k2a8QS5Bucw5YjoO8dWBMTkGXU23gwcyPwMSZs9rSJRhsUB4csrPFQh17NVUApINh3 XUmhe/4rdDOEob8iLjjtdUWvySpPpbhibJuPG2zWbIYy7mQ2tcjw7JwyXA5AOwrZxwBL k58orDwe1cdMUE0t51SWb9z6GddwZwdZhUkhDk8fCqeHegsGqkdT3zm5S7/SJNTFbrJy 7CZzFAK4Lnr/JREoVaGycgWm+yOtku7jkrXTwl4Vn1/LcFMxLr4xVzqdxBQO7z+jvYs3 4cgg== X-Gm-Message-State: AOPr4FVvCYcdLUocZoIX0dOAwLXbKIe3BZF0a8ceL8oO9ZtUYWutJdSH2GtN/VYimPB7c8XzB+bDn2JTBzWzuA== MIME-Version: 1.0 X-Received: by 10.25.86.209 with SMTP id k200mr1894525lfb.75.1461085915734; Tue, 19 Apr 2016 10:11:55 -0700 (PDT) Received: by 10.112.130.2 with HTTP; Tue, 19 Apr 2016 10:11:55 -0700 (PDT) In-Reply-To: References: <201604191539.u3JFdkHx048678@repo.freebsd.org> Date: Tue, 19 Apr 2016 14:11:55 -0300 Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Luiz Otavio O Souza To: Adrian Chadd Cc: Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 17:11:58 -0000 On Tue, Apr 19, 2016 at 1:40 PM, Adrian Chadd wrote: > Hm, why'd you do this? did you get it reviewed first? > > I'm about to write a kernel bitbang SPI driver that supports arbitrary > GPIOs, and I was thinking of fleshing this out somewhat. Hi Adrian, ray@ wrote one for zrouter, it needs some cleanup (maybe some FDT bits and variable word length) but it is well tested. About this commit, yeah, very few hardware support the direct control of the CS pin. Luiz From owner-svn-src-all@freebsd.org Tue Apr 19 17:27:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DD4EB14A5C; Tue, 19 Apr 2016 17:27:54 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-43.csi.cam.ac.uk (ppsw-43.csi.cam.ac.uk [131.111.8.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A16D17FC; Tue, 19 Apr 2016 17:27:53 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from xc1.bsdpad.com ([195.154.136.64]:26651) by ppsw-43.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1asZRG-000349-oI (Exim 4.86_36-e07b163) (return-path ); Tue, 19 Apr 2016 18:27:50 +0100 Date: Tue, 19 Apr 2016 18:12:44 +0100 From: Ruslan Bukin To: Adrian Chadd Cc: Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298274 - head/sys/dev/spibus Message-ID: <20160419171243.GA30453@bsdpad.com> References: <201604191539.u3JFdkHx048678@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: "R. Bukin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 17:27:54 -0000 Why I added or why I reverted ? So once I started to work on generic MMC over SPI driver it was looking like MMC/SD device in harware requires to keep CS asserted during multiple transfers, but once I completed it is become clear hardware don't require that. Ruslan On Tue, Apr 19, 2016 at 09:40:23AM -0700, Adrian Chadd wrote: > Hm, why'd you do this? did you get it reviewed first? > > I'm about to write a kernel bitbang SPI driver that supports arbitrary > GPIOs, and I was thinking of fleshing this out somewhat. > > > > -adrian > > > On 19 April 2016 at 08:39, Ruslan Bukin wrote: > > Author: br > > Date: Tue Apr 19 15:39:46 2016 > > New Revision: 298274 > > URL: https://svnweb.freebsd.org/changeset/base/298274 > > > > Log: > > Revert r298268 (Add optional chip_select/deselect methods). > > None of supported hardware do require that. > > > > Modified: > > head/sys/dev/spibus/spibus.c > > head/sys/dev/spibus/spibus_if.m > > > > Modified: head/sys/dev/spibus/spibus.c > > ============================================================================== > > --- head/sys/dev/spibus/spibus.c Tue Apr 19 15:36:18 2016 (r298273) > > +++ head/sys/dev/spibus/spibus.c Tue Apr 19 15:39:46 2016 (r298274) > > @@ -185,24 +185,9 @@ spibus_hinted_child(device_t bus, const > > static int > > spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd) > > { > > - > > return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd)); > > } > > > > -static int > > -spibus_chip_select_impl(device_t dev, device_t child) > > -{ > > - > > - return (SPIBUS_CHIP_SELECT(device_get_parent(dev), child)); > > -} > > - > > -static int > > -spibus_chip_deselect_impl(device_t dev, device_t child) > > -{ > > - > > - return (SPIBUS_CHIP_DESELECT(device_get_parent(dev), child)); > > -} > > - > > static device_method_t spibus_methods[] = { > > /* Device interface */ > > DEVMETHOD(device_probe, spibus_probe), > > @@ -223,8 +208,6 @@ static device_method_t spibus_methods[] > > > > /* spibus interface */ > > DEVMETHOD(spibus_transfer, spibus_transfer_impl), > > - DEVMETHOD(spibus_chip_select, spibus_chip_select_impl), > > - DEVMETHOD(spibus_chip_deselect, spibus_chip_deselect_impl), > > > > DEVMETHOD_END > > }; > > > > Modified: head/sys/dev/spibus/spibus_if.m > > ============================================================================== > > --- head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:36:18 2016 (r298273) > > +++ head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:39:46 2016 (r298274) > > @@ -39,19 +39,3 @@ METHOD int transfer { > > device_t child; > > struct spi_command *cmd; > > }; > > - > > -# > > -# Assert chip select > > -# > > -METHOD int chip_select { > > - device_t dev; > > - device_t child; > > -}; > > - > > -# > > -# Deassert chip select > > -# > > -METHOD int chip_deselect { > > - device_t dev; > > - device_t child; > > -}; > > > From owner-svn-src-all@freebsd.org Tue Apr 19 17:29:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F7ABB14B39 for ; Tue, 19 Apr 2016 17:29:27 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D4BF19C7 for ; Tue, 19 Apr 2016 17:29:26 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 45fd5c2e-0654-11e6-8bda-c73aafa13d19 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 19 Apr 2016 17:29:29 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u3JHTIZW036206; Tue, 19 Apr 2016 11:29:18 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1461086958.1232.30.camel@freebsd.org> Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: Ian Lepore To: Allan Jude , Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Tue, 19 Apr 2016 11:29:18 -0600 In-Reply-To: <5716538B.4060108@freebsd.org> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <20160419093022.GV2422@kib.kiev.ua> <5716538B.4060108@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 17:29:27 -0000 On Tue, 2016-04-19 at 11:49 -0400, Allan Jude wrote: > On 2016-04-19 05:30, Konstantin Belousov wrote: > > On Mon, Apr 18, 2016 at 07:43:04PM -0400, Allan Jude wrote: > > > On 2016-04-18 19:36, Adrian Chadd wrote: > > > > Someone pointed out how this bloats out memory requirement in > > > > loader. > > > > > > > > Did anyone check that? > > > > > > > > -adrian > > > > > > > > > > I tested down to 128mb of ram in QEMU, booted from the installer > > > ISO, > > > did the install, and booted the installed system without issue. > > > > 64MB is^H^H was very much useful and workable i386 config. i386 > > kernel > > does fit into the 32M but current automatic tuning prevents > > usermode > > from operating. Little manual tuning make 32M on tolerable. > > > > Making loader require 64M is a regression. At very least, it is > > impossible to test low mem configs anymore. > > > > Would a src.conf knob make sense, to use a smaller value when > targeting > small systems, while keeping the advantages when using more > reasonable > systems? > > Or we could make these changes to the HEAP and bcache size specific > to > 64bit platforms? > Exactly which "small systems" are we talking about here? From what I saw in the commit, all of this affects only i386 and amd64 and pc98 right now, not arm or mips or other systems that often have < 64MB ram. I take care of some really old legacy embedded systems at customer sites, and even so, with stuff dating back to the 2003-ish timeframe, the smallest i386 memory I have to deal with is 64MB. Are there really x86 systems that need to run in 32MB or less of ram these days, and use BIOS or EFI to boot? On a related note, can this stuff be used for u-boot and other non-x86 -BIOS flavors of loader(8)? If so, then a buildtime knob or the ability to set the heap and/or cache size at runtime after figuring out how much ram is available would be good features to have. -- Ian From owner-svn-src-all@freebsd.org Tue Apr 19 18:23:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40E98B15DCE; Tue, 19 Apr 2016 18:23:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 294641A8A; Tue, 19 Apr 2016 18:23:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 180BE152C; Tue, 19 Apr 2016 18:23:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id B7E7420DDC; Tue, 19 Apr 2016 18:23:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id PdgVw11g7OV3; Tue, 19 Apr 2016 18:23:15 +0000 (UTC) Subject: Re: svn commit: r298219 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 6312E20DD1 To: Konstantin Belousov References: <201604181814.u3IIE22P059301@repo.freebsd.org> <20160419121551.GX2422@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <9d854fa9-23b5-fd1c-8070-afaac8606f13@FreeBSD.org> Date: Tue, 19 Apr 2016 11:23:12 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160419121551.GX2422@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kwJDWVW71NLu9pQ0dviMIDM6gKT4Hj7Ew" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 18:23:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kwJDWVW71NLu9pQ0dviMIDM6gKT4Hj7Ew Content-Type: multipart/mixed; boundary="UI66GJwprXsHhPUoG4K4PUwdsreR4au1T" From: Bryan Drewery To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <9d854fa9-23b5-fd1c-8070-afaac8606f13@FreeBSD.org> Subject: Re: svn commit: r298219 - head/share/mk References: <201604181814.u3IIE22P059301@repo.freebsd.org> <20160419121551.GX2422@kib.kiev.ua> In-Reply-To: <20160419121551.GX2422@kib.kiev.ua> --UI66GJwprXsHhPUoG4K4PUwdsreR4au1T Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 4/19/2016 5:15 AM, Konstantin Belousov wrote: > On Mon, Apr 18, 2016 at 06:14:02PM +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Mon Apr 18 18:14:02 2016 >> New Revision: 298219 >> URL: https://svnweb.freebsd.org/changeset/base/298219 >> >> Log: >> Cause an error during 'make install' if trying to compile with CC. >> =20 >> This is limited to src-tree builds, meaning not extended to ports or= other >> out-of-tree builds. >> =20 >> This will help ensure that read-only OBJDIRS will be respected at in= stall-time >> by causing a more consistent failure for those who don't use a read-= only >> OBJDIR. It also will cause Jenkins to yell. This is a better solut= ion than >> trying to see CC=3Dfalse as has been attempted and discussed before.= >> =20 >> Of course this is only relevant for files generated by CC. >> =20 >> Disable this for META_MODE since it will detect the CFLAGS/command >> change and force a rebuild. >> =20 >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/share/mk/bsd.sys.mk >> >> Modified: head/share/mk/bsd.sys.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/share/mk/bsd.sys.mk Mon Apr 18 18:13:58 2016 (r298218) >> +++ head/share/mk/bsd.sys.mk Mon Apr 18 18:14:02 2016 (r298219) >> @@ -178,6 +178,13 @@ ACFLAGS+=3D ${ACFLAGS.${.IMPSRC:T}} >> CFLAGS+=3D ${CFLAGS.${.IMPSRC:T}} >> CXXFLAGS+=3D ${CXXFLAGS.${.IMPSRC:T}} >> =20 >> +.if defined(SRCTOP) >> +# Prevent rebuilding during install to support read-only objdirs. >> +.if make(install) && empty(.MAKE.MODE:Mmeta) >> +CFLAGS+=3D ERROR-tried-to-rebuild-during-make-install >> +.endif >> +.endif >> + >> # Tell bmake not to mistake standard targets for things to be searche= d for >> # or expect to ever be up-to-date. >> PHONY_NOTMAIN =3D analyze afterdepend afterinstall all beforedepend b= eforeinstall \ >=20 > It seems to cause the following behaviour: > make buildenv > cd lib/libthr > # make DEBUG_FLAGS=3D-g WITHOUT_TESTS=3Dyes all install > cc -O2 -pipe -DPTHREAD_KERNEL -I/usr/home/kostik/work/build/bsd/DEV= /src/lib/libthr/../libc/include -I/usr/home/kostik/work/build/bsd/DEV/src= /lib/libthr/thread -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/= =2E./../include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/arch= /amd64/include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/sys -= I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld-el= f -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld= -elf/amd64 -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../libthr= ead_db -Winline -fexceptions -D_PTHREAD_FORCED_UNWIND -D_PTHREADS_INVARIA= NTS -mno-mmx -mno-sse -mno-avx -g -MD -MP -MF.depend.thr_init.o -MTthr_in= it.o -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-= unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith= -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-in= t -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value = -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-= unused-local-typedef -Qunused-arguments ERROR-tried-to-rebuild-during-m= ake-install -c /usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/thread/= thr_init.c -o thr_init.o > cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-ma= ke-install' > *** Error code 1 >=20 > Stop. > make[3]: stopped in /usr/home/kostik/work/build/bsd/DEV/src/lib/libthr >=20 > Doing separate steps for all and install targets work, but before, it a= lso > worked and was convenient to list sequential targets on the make comman= d > line. >=20 I'll address this soon. --=20 Regards, Bryan Drewery --UI66GJwprXsHhPUoG4K4PUwdsreR4au1T-- --kwJDWVW71NLu9pQ0dviMIDM6gKT4Hj7Ew Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXFneRAAoJEDXXcbtuRpfP2aEIAJOGV9h2+q9rUGI8h4UAiROa RgFJYSgtCds2kFlfgorbEqEU0sdGfZyL+DbwUCeos+DR4iEvz2gNdMSCFPfiTN+T /G2ev3ZSsjq4AtCrazIefoUTZvmB2pGh1I9erwa72tfJCXxa6wDCa+FkCZaT8iNw ynQ55eSocgzg+2A823vrUQ9mdBG906TfrNa4GFw3CC1X8u43f2oqgjMsrJRZKXYB r5EZPXMegGq/4rMOuONrnpSbBwZ5uDiPIZZ7T/JJdbRnACKb9CyoRzmOU5SCZdp4 ldc2ydLOG/FxUjj51FRvPSdfICdTHnNPIQJsMhX/J22jplozwoEgd1d9wdnMSUA= =3/VB -----END PGP SIGNATURE----- --kwJDWVW71NLu9pQ0dviMIDM6gKT4Hj7Ew-- From owner-svn-src-all@freebsd.org Tue Apr 19 18:27:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F5B7B15F6B; Tue, 19 Apr 2016 18:27:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C38DE1D9C; Tue, 19 Apr 2016 18:27:29 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JIRSu6099904; Tue, 19 Apr 2016 18:27:28 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JIRSUo099902; Tue, 19 Apr 2016 18:27:28 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201604191827.u3JIRSUo099902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 19 Apr 2016 18:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298280 - in head/sys/dev: aac aacraid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 18:27:30 -0000 Author: sbruno Date: Tue Apr 19 18:27:28 2016 New Revision: 298280 URL: https://svnweb.freebsd.org/changeset/base/298280 Log: aacraid(4): Sanely copyin userland pointers and ensure that we don't get anything janky from a user. (cturt) aac(4): landergriffith+freebsdbugzilla@gmail.com pointed out that aacraid(4) had the same issue and handling of pointers, so let's change that too. PR: 206573 Submitted by: cturt@hardenedbsd.org Obtained from: HardenedBSD MFC after: 1 week Modified: head/sys/dev/aac/aac.c head/sys/dev/aacraid/aacraid.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Tue Apr 19 16:48:14 2016 (r298279) +++ head/sys/dev/aac/aac.c Tue Apr 19 18:27:28 2016 (r298280) @@ -3103,18 +3103,30 @@ aac_ioctl_send_raw_srb(struct aac_softc /* Retrieve correct SG entries. */ if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) { + struct aac_sg_entry sg; + sge = srbcmd->sg_map.SgEntry; sge64 = NULL; - srb_sg_bytecount = sge->SgByteCount; - srb_sg_address = (void *)(uintptr_t)sge->SgAddress; + + if ((error = copyin(sge, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = (void *)(uintptr_t)sg.SgAddress; } #ifdef __amd64__ else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { + struct aac_sg_entry64 sg; + sge = NULL; sge64 = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; - srb_sg_bytecount = sge64->SgByteCount; - srb_sg_address = (void *)sge64->SgAddress; + + if ((error = copyin(sge64, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = (void *)sg.SgAddress; if (sge64->SgAddress > 0xffffffffull && (sc->flags & AAC_FLAGS_SG_64BIT) == 0) { error = EINVAL; Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Tue Apr 19 16:48:14 2016 (r298279) +++ head/sys/dev/aacraid/aacraid.c Tue Apr 19 18:27:28 2016 (r298280) @@ -2873,15 +2873,25 @@ aac_ioctl_send_raw_srb(struct aac_softc if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) { struct aac_sg_entry *sgp = srbcmd->sg_map.SgEntry; - srb_sg_bytecount = sgp->SgByteCount; - srb_sg_address = (u_int64_t)sgp->SgAddress; + struct aac_sg_entry sg; + + if ((error = copyin(sgp, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = (u_int64_t)sg.SgAddress; } else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { #ifdef __LP64__ struct aac_sg_entry64 *sgp = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; - srb_sg_bytecount = sgp->SgByteCount; - srb_sg_address = sgp->SgAddress; + struct aac_sg_entry64 sg; + + if ((error = copyin(sgp, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = sg.SgAddress; if (srb_sg_address > 0xffffffffull && !(sc->flags & AAC_FLAGS_SG_64BIT)) #endif From owner-svn-src-all@freebsd.org Tue Apr 19 18:33:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1CE6B13349; Tue, 19 Apr 2016 18:33:37 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 908EA1379; Tue, 19 Apr 2016 18:33:37 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JIXa4n002888; Tue, 19 Apr 2016 18:33:36 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JIXa1p002886; Tue, 19 Apr 2016 18:33:36 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604191833.u3JIXa1p002886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Apr 2016 18:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298281 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 18:33:37 -0000 Author: davidcs Date: Tue Apr 19 18:33:36 2016 New Revision: 298281 URL: https://svnweb.freebsd.org/changeset/base/298281 Log: MFC r297873 1. Process tx completions in bxe_periodic_callout_func() and restart transmissions if possible. 2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED 3. remove code not needed in bxe_init_internal_common() Submitted by:vaishali.kulkarni@qlogic.com;venkata.bhavaraju@qlogic.com Modified: stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/bxe/bxe_stats.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Tue Apr 19 18:27:28 2016 (r298280) +++ stable/10/sys/dev/bxe/bxe.c Tue Apr 19 18:33:36 2016 (r298281) @@ -498,7 +498,9 @@ static const struct { { STATS_OFFSET32(mbuf_alloc_sge), 4, STATS_FLAGS_FUNC, "mbuf_alloc_sge"}, { STATS_OFFSET32(mbuf_alloc_tpa), - 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"} + 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, + { STATS_OFFSET32(tx_queue_full_return), + 4, STATS_FLAGS_FUNC, "tx_queue_full_return"} }; static const struct { @@ -609,7 +611,9 @@ static const struct { { Q_STATS_OFFSET32(mbuf_alloc_sge), 4, "mbuf_alloc_sge"}, { Q_STATS_OFFSET32(mbuf_alloc_tpa), - 4, "mbuf_alloc_tpa"} + 4, "mbuf_alloc_tpa"}, + { Q_STATS_OFFSET32(tx_queue_full_return), + 4, "tx_queue_full_return"} }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -4626,7 +4630,7 @@ bxe_ioctl(struct ifnet *ifp, if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* set the receive mode flags */ bxe_set_rx_mode(sc); - } else { + } else if(sc->state != BXE_STATE_DISABLED) { bxe_init_locked(sc); } } else { @@ -5729,11 +5733,6 @@ bxe_tx_start(struct ifnet *ifp) return; } - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { - BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n"); - return; - } - if (!sc->link_vars.link_up) { BLOGW(sc, "Interface link is down, ignoring transmit request\n"); return; @@ -5741,6 +5740,11 @@ bxe_tx_start(struct ifnet *ifp) fp = &sc->fp[0]; + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + fp->eth_q_stats.tx_queue_full_return++; + return; + } + BXE_FP_TX_LOCK(fp); bxe_tx_start_locked(sc, ifp, fp); BXE_FP_TX_UNLOCK(fp); @@ -9942,21 +9946,6 @@ bxe_init_internal_common(struct bxe_soft { int i; - if (IS_MF_SI(sc)) { - /* - * In switch independent mode, the TSTORM needs to accept - * packets that failed classification, since approximate match - * mac addresses aren't written to NIG LLH. - */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 2); - } else if (!CHIP_IS_E1(sc)) { /* 57710 doesn't support MF */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 0); - } - /* * Zero this manually as its initialization is currently missing * in the initTool. @@ -12299,6 +12288,8 @@ static void bxe_periodic_callout_func(void *xsc) { struct bxe_softc *sc = (struct bxe_softc *)xsc; + struct bxe_fastpath *fp; + uint16_t tx_bd_avail; int i; if (!BXE_CORE_TRYLOCK(sc)) { @@ -12321,6 +12312,48 @@ bxe_periodic_callout_func(void *xsc) return; } +#if __FreeBSD_version >= 800000 + + FOR_EACH_QUEUE(sc, i) { + fp = &sc->fp[i]; + + if (BXE_FP_TX_TRYLOCK(fp)) { + struct ifnet *ifp = sc->ifnet; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_mq_start_locked(sc, ifp, fp, NULL); + } + BXE_FP_TX_UNLOCK(fp); + } + } + +#else + + fp = &sc->fp[0]; + if (BXE_FP_TX_TRYLOCK(fp)) { + struct ifnet *ifp = sc->ifnet; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_start_locked(sc, ifp, fp); + } + + BXE_FP_TX_UNLOCK(fp); + } + +#endif /* #if __FreeBSD_version >= 800000 */ + /* Check for TX timeouts on any fastpath. */ FOR_EACH_QUEUE(sc, i) { if (bxe_watchdog(sc, &sc->fp[i]) != 0) { @@ -16169,6 +16202,7 @@ bxe_detach(device_t dev) if (sc->state != BXE_STATE_CLOSED) { BXE_CORE_LOCK(sc); bxe_nic_unload(sc, UNLOAD_CLOSE, TRUE); + sc->state = BXE_STATE_DISABLED; BXE_CORE_UNLOCK(sc); } Modified: stable/10/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.h Tue Apr 19 18:27:28 2016 (r298280) +++ stable/10/sys/dev/bxe/bxe_stats.h Tue Apr 19 18:33:36 2016 (r298281) @@ -263,6 +263,9 @@ struct bxe_eth_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; @@ -366,6 +369,9 @@ struct bxe_eth_q_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; struct bxe_eth_stats_old { From owner-svn-src-all@freebsd.org Tue Apr 19 18:43:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5662DB1375D for ; Tue, 19 Apr 2016 18:43:49 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27BE119FB for ; Tue, 19 Apr 2016 18:43:49 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-oi0-x234.google.com with SMTP id x201so18156293oif.3 for ; Tue, 19 Apr 2016 11:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=Hw34JcqVxAF1D6VrNa0QMFOdBWDcfUmgUKtKHinljhI=; b=ACTujPCnijPGEyp8k59HLZu2n4aylMSBxbV5QDGqwV3tbSGp+TMjGrgCmccBtAEzjF ASSbKVbhPBGeF1qiEtpdarqZDCrs7TaLLcZ4UfUtoMRYE+yy1HzVBj3pZSFcQnSQ41gu Zf+OEEOnL2u9KYI75vMv+5yDkfDOGMaGMY9x4qrW02hkyQj63apeLenaT1oSKrA6wf4n wKDTVNvBr07bEQQAP03xyqhm0Ol+g98jKiHfB9cwtOJ94f4TDnH09oJkwqNZ8tgJ43mQ 2wdEKF63CeIJXmQXzZjArXLWE0nTBuCFEppYMJGk7uiFd8/Wijlbozk4mq8mT2P5R1vj 6o2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Hw34JcqVxAF1D6VrNa0QMFOdBWDcfUmgUKtKHinljhI=; b=MAH+Z+Rvf2yKLv71rrtGXiW+JpNXb3C73zjcRqwsAJGkZXakBsIPTYIQU1El/iD7/Q UrpGNpiHTPZsyNi1NNYCAq68Kk1y7H+3f/TYf0YabT4oMSjUjrIe8tzgCc9yY2HWCPSG BGyRld/ndSXfHBGgLjR9mi96WmRiTc8XGvOeyVc0HcU42h6o9AwSIgadZAKkjxrEnEhk QFDdCVHcvjIX1qUvBScXzMw4y4dcOMiDs5LoKMCvopAXiPcZXdsUJRFXA1/rvVeQBLbD 84UewU8HQN+UHEXPzuVcVhvlkKCmHgtB22plJ20Du8pWw935EGNEEOZhqaX+UioenUtH nbfg== X-Gm-Message-State: AOPr4FU6Mxn3pghKz73G5sPCowz9MWvxrUgqy5q6vvfIG4pU2sxLVUuDD8rFz5kR4kkUcDEMux5vQMyBrzqAanib MIME-Version: 1.0 X-Received: by 10.202.75.136 with SMTP id y130mr1822393oia.111.1461091428360; Tue, 19 Apr 2016 11:43:48 -0700 (PDT) Sender: sobomax@sippysoft.com Received: by 10.157.37.123 with HTTP; Tue, 19 Apr 2016 11:43:48 -0700 (PDT) In-Reply-To: <1461086958.1232.30.camel@freebsd.org> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <20160419093022.GV2422@kib.kiev.ua> <5716538B.4060108@freebsd.org> <1461086958.1232.30.camel@freebsd.org> Date: Tue, 19 Apr 2016 11:43:48 -0700 X-Google-Sender-Auth: WFsMgdByFdQAPN55S5k8A0eiSOo Message-ID: Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: Maxim Sobolev To: Ian Lepore Cc: Allan Jude , Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 18:43:49 -0000 Sorry, if stupid question, but can this feature kick in automatically once you have more than X MB amount of memory available, going back to default memory-conserving "slow" mode if not? I cannot imagine that would take too much effort/code to implement. I take care of some really old legacy embedded systems at customer > sites, and even so, with stuff dating back to the 2003-ish timeframe, > the smallest i386 memory I have to deal with is 64MB. Are there really > x86 systems that need to run in 32MB or less of ram these days, and use > BIOS or EFI to boot? > Ian, let's not forget that there are lot of VM systems out there these days. If you run very narrow functionality image but your app needs to run zillion of them you might want to dial down VM memory size to a bare minimum. Still those VM system often use just the regular i386 loader bits. So, yes, it's possible that some people might actually run amd64 or i386 kernels on very small RAM footprints even today. -Max From owner-svn-src-all@freebsd.org Tue Apr 19 18:47:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD40BB1395C; Tue, 19 Apr 2016 18:47:35 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C8E01D23; Tue, 19 Apr 2016 18:47:35 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JIlYEe005975; Tue, 19 Apr 2016 18:47:34 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JIlYvR005972; Tue, 19 Apr 2016 18:47:34 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604191847.u3JIlYvR005972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Apr 2016 18:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298282 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 18:47:35 -0000 Author: davidcs Date: Tue Apr 19 18:47:34 2016 New Revision: 298282 URL: https://svnweb.freebsd.org/changeset/base/298282 Log: MFC r297884 Add support for Flash Update Submitted by:nrapendra.singh@qlogic.com;vaishali.kulkarni@qlogic.com;davidcs@freebsd.org Modified: stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/bxe/bxe.h stable/10/sys/dev/bxe/bxe_ioctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Tue Apr 19 18:33:36 2016 (r298281) +++ stable/10/sys/dev/bxe/bxe.c Tue Apr 19 18:47:34 2016 (r298282) @@ -13685,49 +13685,60 @@ bxe_get_tunable_params(struct bxe_softc sc->udp_rss); } -static void +static int bxe_media_detect(struct bxe_softc *sc) { + int port_type; uint32_t phy_idx = bxe_get_cur_phy_idx(sc); + switch (sc->link_params.phy[phy_idx].media_type) { case ELINK_ETH_PHY_SFPP_10G_FIBER: case ELINK_ETH_PHY_XFP_FIBER: BLOGI(sc, "Found 10Gb Fiber media.\n"); sc->media = IFM_10G_SR; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_SFP_1G_FIBER: BLOGI(sc, "Found 1Gb Fiber media.\n"); sc->media = IFM_1000_SX; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_KR: case ELINK_ETH_PHY_CX4: BLOGI(sc, "Found 10GBase-CX4 media.\n"); sc->media = IFM_10G_CX4; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_DA_TWINAX: BLOGI(sc, "Found 10Gb Twinax media.\n"); sc->media = IFM_10G_TWINAX; + port_type = PORT_DA; break; case ELINK_ETH_PHY_BASE_T: if (sc->link_params.speed_cap_mask[0] & PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) { BLOGI(sc, "Found 10GBase-T media.\n"); sc->media = IFM_10G_T; + port_type = PORT_TP; } else { BLOGI(sc, "Found 1000Base-T media.\n"); sc->media = IFM_1000_T; + port_type = PORT_TP; } break; case ELINK_ETH_PHY_NOT_PRESENT: BLOGI(sc, "Media not present.\n"); sc->media = 0; + port_type = PORT_OTHER; break; case ELINK_ETH_PHY_UNSPECIFIED: default: BLOGI(sc, "Unknown media!\n"); sc->media = 0; + port_type = PORT_OTHER; break; } + return port_type; } #define GET_FIELD(value, fname) \ @@ -18746,6 +18757,14 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->grc_dump == NULL) return (-1); + sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); + + if (sc->eeprom == NULL) { + BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); + free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; + return (-1); + } + sc->ioctl_dev = make_dev(&bxe_cdevsw, sc->ifnet->if_dunit, UID_ROOT, @@ -18757,6 +18776,8 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->ioctl_dev == NULL) { free(sc->grc_dump, M_DEVBUF); + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; return (-1); } @@ -18772,12 +18793,152 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump == NULL) + if (sc->grc_dump != NULL) free(sc->grc_dump, M_DEVBUF); + if (sc->eeprom != NULL) { + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; + } + return; } +static bool bxe_is_nvram_accessible(struct bxe_softc *sc) +{ + + if ((sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) == 0) + return FALSE; + + return TRUE; +} + + +static int +bxe_wr_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_write(sc, offset, (uint8_t *)data, len); + + + return (rval); +} + +static int +bxe_rd_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_read(sc, offset, (uint8_t *)data, len); + + return (rval); +} + +static int +bxe_eeprom_rd_wr(struct bxe_softc *sc, bxe_eeprom_t *eeprom) +{ + int rval = 0; + + switch (eeprom->eeprom_cmd) { + + case BXE_EEPROM_CMD_SET_EEPROM: + + rval = copyin(eeprom->eeprom_data, sc->eeprom, + eeprom->eeprom_data_len); + + if (rval) + break; + + rval = bxe_wr_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + break; + + case BXE_EEPROM_CMD_GET_EEPROM: + + rval = bxe_rd_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + + if (rval) { + break; + } + + rval = copyout(sc->eeprom, eeprom->eeprom_data, + eeprom->eeprom_data_len); + break; + + default: + rval = EINVAL; + break; + } + + if (rval) { + BLOGW(sc, "ioctl cmd %d failed rval %d\n", eeprom->eeprom_cmd, rval); + } + + return (rval); +} + +static int +bxe_get_settings(struct bxe_softc *sc, bxe_dev_setting_t *dev_p) +{ + uint32_t ext_phy_config; + int port = SC_PORT(sc); + int cfg_idx = bxe_get_link_cfg_idx(sc); + + dev_p->supported = sc->port.supported[cfg_idx] | + (sc->port.supported[cfg_idx ^ 1] & + (ELINK_SUPPORTED_TP | ELINK_SUPPORTED_FIBRE)); + dev_p->advertising = sc->port.advertising[cfg_idx]; + if(sc->link_params.phy[bxe_get_cur_phy_idx(sc)].media_type == + ELINK_ETH_PHY_SFP_1G_FIBER) { + dev_p->supported = ~(ELINK_SUPPORTED_10000baseT_Full); + dev_p->advertising &= ~(ADVERTISED_10000baseT_Full); + } + if ((sc->state == BXE_STATE_OPEN) && sc->link_vars.link_up && + !(sc->flags & BXE_MF_FUNC_DIS)) { + dev_p->duplex = sc->link_vars.duplex; + if (IS_MF(sc) && !BXE_NOMCP(sc)) + dev_p->speed = bxe_get_mf_speed(sc); + else + dev_p->speed = sc->link_vars.line_speed; + } else { + dev_p->duplex = DUPLEX_UNKNOWN; + dev_p->speed = SPEED_UNKNOWN; + } + + dev_p->port = bxe_media_detect(sc); + + ext_phy_config = SHMEM_RD(sc, + dev_info.port_hw_config[port].external_phy_config); + if((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) == + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) + dev_p->phy_address = sc->port.phy_addr; + else if(((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE) && + ((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) + dev_p->phy_address = ELINK_XGXS_EXT_PHY_ADDR(ext_phy_config); + else + dev_p->phy_address = 0; + + if(sc->link_params.req_line_speed[cfg_idx] == ELINK_SPEED_AUTO_NEG) + dev_p->autoneg = AUTONEG_ENABLE; + else + dev_p->autoneg = AUTONEG_DISABLE; + + + return 0; +} + static int bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) @@ -18787,6 +18948,14 @@ bxe_eioctl(struct cdev *dev, u_long cmd, device_t pci_dev; bxe_grcdump_t *dump = NULL; int grc_dump_size; + bxe_drvinfo_t *drv_infop = NULL; + bxe_dev_setting_t *dev_p; + bxe_dev_setting_t dev_set; + bxe_get_regs_t *reg_p; + bxe_reg_rdw_t *reg_rdw_p; + bxe_pcicfg_rdw_t *cfg_rdw_p; + bxe_perm_mac_addr_t *mac_addr_p; + if ((sc = (struct bxe_softc *)dev->si_drv1) == NULL) return ENXIO; @@ -18799,14 +18968,15 @@ bxe_eioctl(struct cdev *dev, u_long cmd, case BXE_GRC_DUMP_SIZE: dump->pci_func = sc->pcie_func; - dump->grcdump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + dump->grcdump_size = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); break; case BXE_GRC_DUMP: grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + sizeof(struct dump_header); if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { @@ -18819,6 +18989,92 @@ bxe_eioctl(struct cdev *dev, u_long cmd, break; + case BXE_DRV_INFO: + drv_infop = (bxe_drvinfo_t *)data; + snprintf(drv_infop->drv_name, BXE_DRV_NAME_LENGTH, "%s", "bxe"); + snprintf(drv_infop->drv_version, BXE_DRV_VERSION_LENGTH, "v:%s", + BXE_DRIVER_VERSION); + snprintf(drv_infop->mfw_version, BXE_MFW_VERSION_LENGTH, "%s", + sc->devinfo.bc_ver_str); + snprintf(drv_infop->stormfw_version, BXE_STORMFW_VERSION_LENGTH, + "%s", sc->fw_ver_str); + drv_infop->eeprom_dump_len = sc->devinfo.flash_size; + drv_infop->reg_dump_len = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", + sc->pcie_bus, sc->pcie_device, sc->pcie_func); + break; + case BXE_DEV_SETTING: + dev_p = (bxe_dev_setting_t *)data; + bxe_get_settings(sc, &dev_set); + dev_p->supported = dev_set.supported; + dev_p->advertising = dev_set.advertising; + dev_p->speed = dev_set.speed; + dev_p->duplex = dev_set.duplex; + dev_p->port = dev_set.port; + dev_p->phy_address = dev_set.phy_address; + dev_p->autoneg = dev_set.autoneg; + + break; + + case BXE_GET_REGS: + + reg_p = (bxe_get_regs_t *)data; + grc_dump_size = reg_p->reg_buf_len; + + if (sc->grc_dump == NULL) { + rval = EINVAL; + break; + } + + if(!sc->grcdump_done) { + bxe_grc_dump(sc); + } + if(sc->grcdump_done) { + rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + sc->grcdump_done = 0; + } + + break; + case BXE_RDW_REG: + reg_rdw_p = (bxe_reg_rdw_t *)data; + if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + reg_rdw_p->reg_val = REG_RD(sc, reg_rdw_p->reg_id); + + if((reg_rdw_p->reg_cmd == BXE_WRITE_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + REG_WR(sc, reg_rdw_p->reg_id, reg_rdw_p->reg_val); + + break; + + case BXE_RDW_PCICFG: + cfg_rdw_p = (bxe_pcicfg_rdw_t *)data; + if(cfg_rdw_p->cfg_cmd == BXE_READ_PCICFG) { + + cfg_rdw_p->cfg_val = pci_read_config(sc->dev, cfg_rdw_p->cfg_id, + cfg_rdw_p->cfg_width); + + } else if(cfg_rdw_p->cfg_cmd == BXE_WRITE_PCICFG) { + pci_write_config(sc->dev, cfg_rdw_p->cfg_id, cfg_rdw_p->cfg_val, + cfg_rdw_p->cfg_width); + } else { + BLOGW(sc, "BXE_RDW_PCICFG ioctl wrong cmd passed\n"); + } + break; + + case BXE_MAC_ADDR: + mac_addr_p = (bxe_perm_mac_addr_t *)data; + snprintf(mac_addr_p->mac_addr_str, sizeof(sc->mac_addr_str), "%s", + sc->mac_addr_str); + break; + + case BXE_EEPROM: + rval = bxe_eeprom_rd_wr(sc, (bxe_eeprom_t *)data); + break; + + default: break; } Modified: stable/10/sys/dev/bxe/bxe.h ============================================================================== --- stable/10/sys/dev/bxe/bxe.h Tue Apr 19 18:33:36 2016 (r298281) +++ stable/10/sys/dev/bxe/bxe.h Tue Apr 19 18:47:34 2016 (r298282) @@ -1788,6 +1788,7 @@ struct bxe_softc { struct cdev *ioctl_dev; void *grc_dump; int grcdump_done; + void *eeprom; }; /* struct bxe_softc */ /* IOCTL sub-commands for edebug and firmware upgrade */ @@ -2109,6 +2110,28 @@ static const uint32_t dmae_reg_go_c[] = #define PCI_PM_D0 1 #define PCI_PM_D3hot 2 +#ifndef DUPLEX_UNKNOWN +#define DUPLEX_UNKNOWN (0xff) +#endif + +#ifndef SPEED_UNKNOWN +#define SPEED_UNKNOWN (-1) +#endif + +/* Enable or disable autonegotiation. */ +#define AUTONEG_DISABLE 0x00 +#define AUTONEG_ENABLE 0x01 + +/* Which connector port. */ +#define PORT_TP 0x00 +#define PORT_AUI 0x01 +#define PORT_MII 0x02 +#define PORT_FIBRE 0x03 +#define PORT_BNC 0x04 +#define PORT_DA 0x05 +#define PORT_NONE 0xef +#define PORT_OTHER 0xff + int bxe_test_bit(int nr, volatile unsigned long * addr); void bxe_set_bit(unsigned int nr, volatile unsigned long * addr); void bxe_clear_bit(int nr, volatile unsigned long * addr); Modified: stable/10/sys/dev/bxe/bxe_ioctl.h ============================================================================== --- stable/10/sys/dev/bxe/bxe_ioctl.h Tue Apr 19 18:33:36 2016 (r298281) +++ stable/10/sys/dev/bxe/bxe_ioctl.h Tue Apr 19 18:47:34 2016 (r298282) @@ -42,6 +42,86 @@ struct bxe_grcdump { }; typedef struct bxe_grcdump bxe_grcdump_t; +#define BXE_DRV_NAME_LENGTH 32 +#define BXE_DRV_VERSION_LENGTH 32 +#define BXE_MFW_VERSION_LENGTH 32 +#define BXE_STORMFW_VERSION_LENGTH 32 +#define BXE_BUS_INFO_LENGTH 32 + +struct bxe_drvinfo { + char drv_name[BXE_DRV_NAME_LENGTH]; + char drv_version[BXE_DRV_VERSION_LENGTH]; + char mfw_version[BXE_MFW_VERSION_LENGTH]; + char stormfw_version[BXE_STORMFW_VERSION_LENGTH]; + uint32_t eeprom_dump_len; /* in bytes */ + uint32_t reg_dump_len; /* in bytes */ + char bus_info[BXE_BUS_INFO_LENGTH]; +}; +typedef struct bxe_drvinfo bxe_drvinfo_t; + +struct bxe_dev_setting { + + uint32_t supported; /* Features this interface supports */ + uint32_t advertising;/* Features this interface advertises */ + uint32_t speed; /* The forced speed, 10Mb, 100Mb, gigabit */ + uint32_t duplex; /* Duplex, half or full */ + uint32_t port; /* Which connector port */ + uint32_t phy_address;/* port number*/ + uint32_t autoneg; /* Enable or disable autonegotiation */ +}; +typedef struct bxe_dev_setting bxe_dev_setting_t; + +struct bxe_get_regs { + void *reg_buf; + uint32_t reg_buf_len; +}; +typedef struct bxe_get_regs bxe_get_regs_t; + +#define BXE_EEPROM_MAX_DATA_LEN 524288 + +struct bxe_eeprom { + uint32_t eeprom_cmd; +#define BXE_EEPROM_CMD_SET_EEPROM 0x01 +#define BXE_EEPROM_CMD_GET_EEPROM 0x02 + + void *eeprom_data; + uint32_t eeprom_offset; + uint32_t eeprom_data_len; + uint32_t eeprom_magic; +}; +typedef struct bxe_eeprom bxe_eeprom_t; + +struct bxe_reg_rdw { + uint32_t reg_cmd; +#define BXE_READ_REG_CMD 0x01 +#define BXE_WRITE_REG_CMD 0x02 + + uint32_t reg_id; + uint32_t reg_val; + uint32_t reg_access_type; +#define BXE_REG_ACCESS_DIRECT 0x01 +#define BXE_REG_ACCESS_INDIRECT 0x02 +}; + +typedef struct bxe_reg_rdw bxe_reg_rdw_t; + +struct bxe_pcicfg_rdw { + uint32_t cfg_cmd; +#define BXE_READ_PCICFG 0x01 +#define BXE_WRITE_PCICFG 0x01 + uint32_t cfg_id; + uint32_t cfg_val; + uint32_t cfg_width; +}; + +typedef struct bxe_pcicfg_rdw bxe_pcicfg_rdw_t; + +struct bxe_perm_mac_addr { + char mac_addr_str[32]; +}; + +typedef struct bxe_perm_mac_addr bxe_perm_mac_addr_t; + /* * Read grcdump size @@ -53,5 +133,41 @@ typedef struct bxe_grcdump bxe_grcdump_t */ #define BXE_GRC_DUMP _IOWR('e', 2, bxe_grcdump_t) +/* + * Read driver info + */ +#define BXE_DRV_INFO _IOR('e', 3, bxe_drvinfo_t) + +/* + * Read Device Setting + */ +#define BXE_DEV_SETTING _IOR('e', 4, bxe_dev_setting_t) + +/* + * Get Registers + */ +#define BXE_GET_REGS _IOR('e', 5, bxe_get_regs_t) + +/* + * Get/Set EEPROM + */ +#define BXE_EEPROM _IOWR('e', 6, bxe_eeprom_t) + +/* + * read/write a register + */ +#define BXE_RDW_REG _IOWR('e', 7, bxe_reg_rdw_t) + +/* + * read/write PCIcfg + */ +#define BXE_RDW_PCICFG _IOWR('e', 8, bxe_reg_rdw_t) + +/* + * get permanent mac address + */ + +#define BXE_MAC_ADDR _IOWR('e', 9, bxe_perm_mac_addr_t) + #endif /* #ifndef _QLNX_IOCTL_H_ */ From owner-svn-src-all@freebsd.org Tue Apr 19 18:57:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5EB7B13E39; Tue, 19 Apr 2016 18:57:32 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD6031392; Tue, 19 Apr 2016 18:57:32 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JIvVc3008974; Tue, 19 Apr 2016 18:57:31 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JIvV5q008971; Tue, 19 Apr 2016 18:57:31 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604191857.u3JIvV5q008971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Apr 2016 18:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298283 - stable/9/sys/dev/bxe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 18:57:32 -0000 Author: davidcs Date: Tue Apr 19 18:57:31 2016 New Revision: 298283 URL: https://svnweb.freebsd.org/changeset/base/298283 Log: MFC r297873 1. Process tx completions in bxe_periodic_callout_func() and restart transmissions if possible. 2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED 3. remove code not needed in bxe_init_internal_common() Submitted by:vaishali.kulkarni@qlogic.com;venkata.bhavaraju@qlogic.com Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe_stats.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Tue Apr 19 18:47:34 2016 (r298282) +++ stable/9/sys/dev/bxe/bxe.c Tue Apr 19 18:57:31 2016 (r298283) @@ -498,7 +498,9 @@ static const struct { { STATS_OFFSET32(mbuf_alloc_sge), 4, STATS_FLAGS_FUNC, "mbuf_alloc_sge"}, { STATS_OFFSET32(mbuf_alloc_tpa), - 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"} + 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, + { STATS_OFFSET32(tx_queue_full_return), + 4, STATS_FLAGS_FUNC, "tx_queue_full_return"} }; static const struct { @@ -609,7 +611,9 @@ static const struct { { Q_STATS_OFFSET32(mbuf_alloc_sge), 4, "mbuf_alloc_sge"}, { Q_STATS_OFFSET32(mbuf_alloc_tpa), - 4, "mbuf_alloc_tpa"} + 4, "mbuf_alloc_tpa"}, + { Q_STATS_OFFSET32(tx_queue_full_return), + 4, "tx_queue_full_return"} }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -4626,7 +4630,7 @@ bxe_ioctl(struct ifnet *ifp, if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* set the receive mode flags */ bxe_set_rx_mode(sc); - } else { + } else if(sc->state != BXE_STATE_DISABLED) { bxe_init_locked(sc); } } else { @@ -5737,11 +5741,6 @@ bxe_tx_start(struct ifnet *ifp) return; } - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { - BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n"); - return; - } - if (!sc->link_vars.link_up) { BLOGW(sc, "Interface link is down, ignoring transmit request\n"); return; @@ -5749,6 +5748,11 @@ bxe_tx_start(struct ifnet *ifp) fp = &sc->fp[0]; + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + fp->eth_q_stats.tx_queue_full_return++; + return; + } + BXE_FP_TX_LOCK(fp); bxe_tx_start_locked(sc, ifp, fp); BXE_FP_TX_UNLOCK(fp); @@ -9950,21 +9954,6 @@ bxe_init_internal_common(struct bxe_soft { int i; - if (IS_MF_SI(sc)) { - /* - * In switch independent mode, the TSTORM needs to accept - * packets that failed classification, since approximate match - * mac addresses aren't written to NIG LLH. - */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 2); - } else if (!CHIP_IS_E1(sc)) { /* 57710 doesn't support MF */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 0); - } - /* * Zero this manually as its initialization is currently missing * in the initTool. @@ -12307,6 +12296,8 @@ static void bxe_periodic_callout_func(void *xsc) { struct bxe_softc *sc = (struct bxe_softc *)xsc; + struct bxe_fastpath *fp; + uint16_t tx_bd_avail; int i; if (!BXE_CORE_TRYLOCK(sc)) { @@ -12329,6 +12320,48 @@ bxe_periodic_callout_func(void *xsc) return; } +#if __FreeBSD_version >= 800000 + + FOR_EACH_QUEUE(sc, i) { + fp = &sc->fp[i]; + + if (BXE_FP_TX_TRYLOCK(fp)) { + struct ifnet *ifp = sc->ifnet; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_mq_start_locked(sc, ifp, fp, NULL); + } + BXE_FP_TX_UNLOCK(fp); + } + } + +#else + + fp = &sc->fp[0]; + if (BXE_FP_TX_TRYLOCK(fp)) { + struct ifnet *ifp = sc->ifnet; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_start_locked(sc, ifp, fp); + } + + BXE_FP_TX_UNLOCK(fp); + } + +#endif /* #if __FreeBSD_version >= 800000 */ + /* Check for TX timeouts on any fastpath. */ FOR_EACH_QUEUE(sc, i) { if (bxe_watchdog(sc, &sc->fp[i]) != 0) { @@ -16177,6 +16210,7 @@ bxe_detach(device_t dev) if (sc->state != BXE_STATE_CLOSED) { BXE_CORE_LOCK(sc); bxe_nic_unload(sc, UNLOAD_CLOSE, TRUE); + sc->state = BXE_STATE_DISABLED; BXE_CORE_UNLOCK(sc); } Modified: stable/9/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/9/sys/dev/bxe/bxe_stats.h Tue Apr 19 18:47:34 2016 (r298282) +++ stable/9/sys/dev/bxe/bxe_stats.h Tue Apr 19 18:57:31 2016 (r298283) @@ -263,6 +263,9 @@ struct bxe_eth_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; @@ -366,6 +369,9 @@ struct bxe_eth_q_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; struct bxe_eth_stats_old { From owner-svn-src-all@freebsd.org Tue Apr 19 19:03:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A63DB14193; Tue, 19 Apr 2016 19:03:07 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7021A17; Tue, 19 Apr 2016 19:03:07 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JJ36L8012002; Tue, 19 Apr 2016 19:03:06 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JJ36bE011999; Tue, 19 Apr 2016 19:03:06 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604191903.u3JJ36bE011999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Apr 2016 19:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298284 - stable/9/sys/dev/bxe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:03:07 -0000 Author: davidcs Date: Tue Apr 19 19:03:06 2016 New Revision: 298284 URL: https://svnweb.freebsd.org/changeset/base/298284 Log: MFC r297884 Add support for Flash Update Submitted by:nrapendra.singh@qlogic.com;vaishali.kulkarni@qlogic.com;davidcs@freebsd.org Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_ioctl.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Tue Apr 19 18:57:31 2016 (r298283) +++ stable/9/sys/dev/bxe/bxe.c Tue Apr 19 19:03:06 2016 (r298284) @@ -13693,49 +13693,60 @@ bxe_get_tunable_params(struct bxe_softc sc->udp_rss); } -static void +static int bxe_media_detect(struct bxe_softc *sc) { + int port_type; uint32_t phy_idx = bxe_get_cur_phy_idx(sc); + switch (sc->link_params.phy[phy_idx].media_type) { case ELINK_ETH_PHY_SFPP_10G_FIBER: case ELINK_ETH_PHY_XFP_FIBER: BLOGI(sc, "Found 10Gb Fiber media.\n"); sc->media = IFM_10G_SR; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_SFP_1G_FIBER: BLOGI(sc, "Found 1Gb Fiber media.\n"); sc->media = IFM_1000_SX; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_KR: case ELINK_ETH_PHY_CX4: BLOGI(sc, "Found 10GBase-CX4 media.\n"); sc->media = IFM_10G_CX4; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_DA_TWINAX: BLOGI(sc, "Found 10Gb Twinax media.\n"); sc->media = IFM_10G_TWINAX; + port_type = PORT_DA; break; case ELINK_ETH_PHY_BASE_T: if (sc->link_params.speed_cap_mask[0] & PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) { BLOGI(sc, "Found 10GBase-T media.\n"); sc->media = IFM_10G_T; + port_type = PORT_TP; } else { BLOGI(sc, "Found 1000Base-T media.\n"); sc->media = IFM_1000_T; + port_type = PORT_TP; } break; case ELINK_ETH_PHY_NOT_PRESENT: BLOGI(sc, "Media not present.\n"); sc->media = 0; + port_type = PORT_OTHER; break; case ELINK_ETH_PHY_UNSPECIFIED: default: BLOGI(sc, "Unknown media!\n"); sc->media = 0; + port_type = PORT_OTHER; break; } + return port_type; } #define GET_FIELD(value, fname) \ @@ -18754,6 +18765,14 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->grc_dump == NULL) return (-1); + sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); + + if (sc->eeprom == NULL) { + BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); + free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; + return (-1); + } + sc->ioctl_dev = make_dev(&bxe_cdevsw, sc->ifnet->if_dunit, UID_ROOT, @@ -18765,6 +18784,8 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->ioctl_dev == NULL) { free(sc->grc_dump, M_DEVBUF); + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; return (-1); } @@ -18780,12 +18801,152 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump == NULL) + if (sc->grc_dump != NULL) free(sc->grc_dump, M_DEVBUF); + if (sc->eeprom != NULL) { + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; + } + return; } +static bool bxe_is_nvram_accessible(struct bxe_softc *sc) +{ + + if ((sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) == 0) + return FALSE; + + return TRUE; +} + + +static int +bxe_wr_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_write(sc, offset, (uint8_t *)data, len); + + + return (rval); +} + +static int +bxe_rd_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_read(sc, offset, (uint8_t *)data, len); + + return (rval); +} + +static int +bxe_eeprom_rd_wr(struct bxe_softc *sc, bxe_eeprom_t *eeprom) +{ + int rval = 0; + + switch (eeprom->eeprom_cmd) { + + case BXE_EEPROM_CMD_SET_EEPROM: + + rval = copyin(eeprom->eeprom_data, sc->eeprom, + eeprom->eeprom_data_len); + + if (rval) + break; + + rval = bxe_wr_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + break; + + case BXE_EEPROM_CMD_GET_EEPROM: + + rval = bxe_rd_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + + if (rval) { + break; + } + + rval = copyout(sc->eeprom, eeprom->eeprom_data, + eeprom->eeprom_data_len); + break; + + default: + rval = EINVAL; + break; + } + + if (rval) { + BLOGW(sc, "ioctl cmd %d failed rval %d\n", eeprom->eeprom_cmd, rval); + } + + return (rval); +} + +static int +bxe_get_settings(struct bxe_softc *sc, bxe_dev_setting_t *dev_p) +{ + uint32_t ext_phy_config; + int port = SC_PORT(sc); + int cfg_idx = bxe_get_link_cfg_idx(sc); + + dev_p->supported = sc->port.supported[cfg_idx] | + (sc->port.supported[cfg_idx ^ 1] & + (ELINK_SUPPORTED_TP | ELINK_SUPPORTED_FIBRE)); + dev_p->advertising = sc->port.advertising[cfg_idx]; + if(sc->link_params.phy[bxe_get_cur_phy_idx(sc)].media_type == + ELINK_ETH_PHY_SFP_1G_FIBER) { + dev_p->supported = ~(ELINK_SUPPORTED_10000baseT_Full); + dev_p->advertising &= ~(ADVERTISED_10000baseT_Full); + } + if ((sc->state == BXE_STATE_OPEN) && sc->link_vars.link_up && + !(sc->flags & BXE_MF_FUNC_DIS)) { + dev_p->duplex = sc->link_vars.duplex; + if (IS_MF(sc) && !BXE_NOMCP(sc)) + dev_p->speed = bxe_get_mf_speed(sc); + else + dev_p->speed = sc->link_vars.line_speed; + } else { + dev_p->duplex = DUPLEX_UNKNOWN; + dev_p->speed = SPEED_UNKNOWN; + } + + dev_p->port = bxe_media_detect(sc); + + ext_phy_config = SHMEM_RD(sc, + dev_info.port_hw_config[port].external_phy_config); + if((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) == + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) + dev_p->phy_address = sc->port.phy_addr; + else if(((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE) && + ((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) + dev_p->phy_address = ELINK_XGXS_EXT_PHY_ADDR(ext_phy_config); + else + dev_p->phy_address = 0; + + if(sc->link_params.req_line_speed[cfg_idx] == ELINK_SPEED_AUTO_NEG) + dev_p->autoneg = AUTONEG_ENABLE; + else + dev_p->autoneg = AUTONEG_DISABLE; + + + return 0; +} + static int bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) @@ -18795,6 +18956,14 @@ bxe_eioctl(struct cdev *dev, u_long cmd, device_t pci_dev; bxe_grcdump_t *dump = NULL; int grc_dump_size; + bxe_drvinfo_t *drv_infop = NULL; + bxe_dev_setting_t *dev_p; + bxe_dev_setting_t dev_set; + bxe_get_regs_t *reg_p; + bxe_reg_rdw_t *reg_rdw_p; + bxe_pcicfg_rdw_t *cfg_rdw_p; + bxe_perm_mac_addr_t *mac_addr_p; + if ((sc = (struct bxe_softc *)dev->si_drv1) == NULL) return ENXIO; @@ -18807,14 +18976,15 @@ bxe_eioctl(struct cdev *dev, u_long cmd, case BXE_GRC_DUMP_SIZE: dump->pci_func = sc->pcie_func; - dump->grcdump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + dump->grcdump_size = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); break; case BXE_GRC_DUMP: grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + sizeof(struct dump_header); if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { @@ -18827,6 +18997,92 @@ bxe_eioctl(struct cdev *dev, u_long cmd, break; + case BXE_DRV_INFO: + drv_infop = (bxe_drvinfo_t *)data; + snprintf(drv_infop->drv_name, BXE_DRV_NAME_LENGTH, "%s", "bxe"); + snprintf(drv_infop->drv_version, BXE_DRV_VERSION_LENGTH, "v:%s", + BXE_DRIVER_VERSION); + snprintf(drv_infop->mfw_version, BXE_MFW_VERSION_LENGTH, "%s", + sc->devinfo.bc_ver_str); + snprintf(drv_infop->stormfw_version, BXE_STORMFW_VERSION_LENGTH, + "%s", sc->fw_ver_str); + drv_infop->eeprom_dump_len = sc->devinfo.flash_size; + drv_infop->reg_dump_len = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", + sc->pcie_bus, sc->pcie_device, sc->pcie_func); + break; + case BXE_DEV_SETTING: + dev_p = (bxe_dev_setting_t *)data; + bxe_get_settings(sc, &dev_set); + dev_p->supported = dev_set.supported; + dev_p->advertising = dev_set.advertising; + dev_p->speed = dev_set.speed; + dev_p->duplex = dev_set.duplex; + dev_p->port = dev_set.port; + dev_p->phy_address = dev_set.phy_address; + dev_p->autoneg = dev_set.autoneg; + + break; + + case BXE_GET_REGS: + + reg_p = (bxe_get_regs_t *)data; + grc_dump_size = reg_p->reg_buf_len; + + if (sc->grc_dump == NULL) { + rval = EINVAL; + break; + } + + if(!sc->grcdump_done) { + bxe_grc_dump(sc); + } + if(sc->grcdump_done) { + rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + sc->grcdump_done = 0; + } + + break; + case BXE_RDW_REG: + reg_rdw_p = (bxe_reg_rdw_t *)data; + if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + reg_rdw_p->reg_val = REG_RD(sc, reg_rdw_p->reg_id); + + if((reg_rdw_p->reg_cmd == BXE_WRITE_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + REG_WR(sc, reg_rdw_p->reg_id, reg_rdw_p->reg_val); + + break; + + case BXE_RDW_PCICFG: + cfg_rdw_p = (bxe_pcicfg_rdw_t *)data; + if(cfg_rdw_p->cfg_cmd == BXE_READ_PCICFG) { + + cfg_rdw_p->cfg_val = pci_read_config(sc->dev, cfg_rdw_p->cfg_id, + cfg_rdw_p->cfg_width); + + } else if(cfg_rdw_p->cfg_cmd == BXE_WRITE_PCICFG) { + pci_write_config(sc->dev, cfg_rdw_p->cfg_id, cfg_rdw_p->cfg_val, + cfg_rdw_p->cfg_width); + } else { + BLOGW(sc, "BXE_RDW_PCICFG ioctl wrong cmd passed\n"); + } + break; + + case BXE_MAC_ADDR: + mac_addr_p = (bxe_perm_mac_addr_t *)data; + snprintf(mac_addr_p->mac_addr_str, sizeof(sc->mac_addr_str), "%s", + sc->mac_addr_str); + break; + + case BXE_EEPROM: + rval = bxe_eeprom_rd_wr(sc, (bxe_eeprom_t *)data); + break; + + default: break; } Modified: stable/9/sys/dev/bxe/bxe.h ============================================================================== --- stable/9/sys/dev/bxe/bxe.h Tue Apr 19 18:57:31 2016 (r298283) +++ stable/9/sys/dev/bxe/bxe.h Tue Apr 19 19:03:06 2016 (r298284) @@ -1788,6 +1788,7 @@ struct bxe_softc { struct cdev *ioctl_dev; void *grc_dump; int grcdump_done; + void *eeprom; }; /* struct bxe_softc */ /* IOCTL sub-commands for edebug and firmware upgrade */ @@ -2109,6 +2110,28 @@ static const uint32_t dmae_reg_go_c[] = #define PCI_PM_D0 1 #define PCI_PM_D3hot 2 +#ifndef DUPLEX_UNKNOWN +#define DUPLEX_UNKNOWN (0xff) +#endif + +#ifndef SPEED_UNKNOWN +#define SPEED_UNKNOWN (-1) +#endif + +/* Enable or disable autonegotiation. */ +#define AUTONEG_DISABLE 0x00 +#define AUTONEG_ENABLE 0x01 + +/* Which connector port. */ +#define PORT_TP 0x00 +#define PORT_AUI 0x01 +#define PORT_MII 0x02 +#define PORT_FIBRE 0x03 +#define PORT_BNC 0x04 +#define PORT_DA 0x05 +#define PORT_NONE 0xef +#define PORT_OTHER 0xff + int bxe_test_bit(int nr, volatile unsigned long * addr); void bxe_set_bit(unsigned int nr, volatile unsigned long * addr); void bxe_clear_bit(int nr, volatile unsigned long * addr); Modified: stable/9/sys/dev/bxe/bxe_ioctl.h ============================================================================== --- stable/9/sys/dev/bxe/bxe_ioctl.h Tue Apr 19 18:57:31 2016 (r298283) +++ stable/9/sys/dev/bxe/bxe_ioctl.h Tue Apr 19 19:03:06 2016 (r298284) @@ -42,6 +42,86 @@ struct bxe_grcdump { }; typedef struct bxe_grcdump bxe_grcdump_t; +#define BXE_DRV_NAME_LENGTH 32 +#define BXE_DRV_VERSION_LENGTH 32 +#define BXE_MFW_VERSION_LENGTH 32 +#define BXE_STORMFW_VERSION_LENGTH 32 +#define BXE_BUS_INFO_LENGTH 32 + +struct bxe_drvinfo { + char drv_name[BXE_DRV_NAME_LENGTH]; + char drv_version[BXE_DRV_VERSION_LENGTH]; + char mfw_version[BXE_MFW_VERSION_LENGTH]; + char stormfw_version[BXE_STORMFW_VERSION_LENGTH]; + uint32_t eeprom_dump_len; /* in bytes */ + uint32_t reg_dump_len; /* in bytes */ + char bus_info[BXE_BUS_INFO_LENGTH]; +}; +typedef struct bxe_drvinfo bxe_drvinfo_t; + +struct bxe_dev_setting { + + uint32_t supported; /* Features this interface supports */ + uint32_t advertising;/* Features this interface advertises */ + uint32_t speed; /* The forced speed, 10Mb, 100Mb, gigabit */ + uint32_t duplex; /* Duplex, half or full */ + uint32_t port; /* Which connector port */ + uint32_t phy_address;/* port number*/ + uint32_t autoneg; /* Enable or disable autonegotiation */ +}; +typedef struct bxe_dev_setting bxe_dev_setting_t; + +struct bxe_get_regs { + void *reg_buf; + uint32_t reg_buf_len; +}; +typedef struct bxe_get_regs bxe_get_regs_t; + +#define BXE_EEPROM_MAX_DATA_LEN 524288 + +struct bxe_eeprom { + uint32_t eeprom_cmd; +#define BXE_EEPROM_CMD_SET_EEPROM 0x01 +#define BXE_EEPROM_CMD_GET_EEPROM 0x02 + + void *eeprom_data; + uint32_t eeprom_offset; + uint32_t eeprom_data_len; + uint32_t eeprom_magic; +}; +typedef struct bxe_eeprom bxe_eeprom_t; + +struct bxe_reg_rdw { + uint32_t reg_cmd; +#define BXE_READ_REG_CMD 0x01 +#define BXE_WRITE_REG_CMD 0x02 + + uint32_t reg_id; + uint32_t reg_val; + uint32_t reg_access_type; +#define BXE_REG_ACCESS_DIRECT 0x01 +#define BXE_REG_ACCESS_INDIRECT 0x02 +}; + +typedef struct bxe_reg_rdw bxe_reg_rdw_t; + +struct bxe_pcicfg_rdw { + uint32_t cfg_cmd; +#define BXE_READ_PCICFG 0x01 +#define BXE_WRITE_PCICFG 0x01 + uint32_t cfg_id; + uint32_t cfg_val; + uint32_t cfg_width; +}; + +typedef struct bxe_pcicfg_rdw bxe_pcicfg_rdw_t; + +struct bxe_perm_mac_addr { + char mac_addr_str[32]; +}; + +typedef struct bxe_perm_mac_addr bxe_perm_mac_addr_t; + /* * Read grcdump size @@ -53,5 +133,41 @@ typedef struct bxe_grcdump bxe_grcdump_t */ #define BXE_GRC_DUMP _IOWR('e', 2, bxe_grcdump_t) +/* + * Read driver info + */ +#define BXE_DRV_INFO _IOR('e', 3, bxe_drvinfo_t) + +/* + * Read Device Setting + */ +#define BXE_DEV_SETTING _IOR('e', 4, bxe_dev_setting_t) + +/* + * Get Registers + */ +#define BXE_GET_REGS _IOR('e', 5, bxe_get_regs_t) + +/* + * Get/Set EEPROM + */ +#define BXE_EEPROM _IOWR('e', 6, bxe_eeprom_t) + +/* + * read/write a register + */ +#define BXE_RDW_REG _IOWR('e', 7, bxe_reg_rdw_t) + +/* + * read/write PCIcfg + */ +#define BXE_RDW_PCICFG _IOWR('e', 8, bxe_reg_rdw_t) + +/* + * get permanent mac address + */ + +#define BXE_MAC_ADDR _IOWR('e', 9, bxe_perm_mac_addr_t) + #endif /* #ifndef _QLNX_IOCTL_H_ */ From owner-svn-src-all@freebsd.org Tue Apr 19 19:03:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3251B14261; Tue, 19 Apr 2016 19:03:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95F7B1C14; Tue, 19 Apr 2016 19:03:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JJ3tAE012077; Tue, 19 Apr 2016 19:03:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JJ3tgV012072; Tue, 19 Apr 2016 19:03:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604191903.u3JJ3tgV012072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 19:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298285 - in head/libexec/rtld-elf: . arm mips powerpc powerpc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:03:56 -0000 Author: pfg Date: Tue Apr 19 19:03:55 2016 New Revision: 298285 URL: https://svnweb.freebsd.org/changeset/base/298285 Log: rtld-elf: use NULL instead of zero for pointers. Modified: head/libexec/rtld-elf/arm/reloc.c head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/powerpc/reloc.c head/libexec/rtld-elf/powerpc64/reloc.c head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/arm/reloc.c ============================================================================== --- head/libexec/rtld-elf/arm/reloc.c Tue Apr 19 19:03:06 2016 (r298284) +++ head/libexec/rtld-elf/arm/reloc.c Tue Apr 19 19:03:55 2016 (r298285) @@ -133,7 +133,7 @@ int _open(); void _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase) { - const Elf_Rel *rel = 0, *rellim; + const Elf_Rel *rel = NULL, *rellim; Elf_Addr relsz = 0; Elf_Addr *where; uint32_t size; Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Tue Apr 19 19:03:06 2016 (r298284) +++ head/libexec/rtld-elf/mips/reloc.c Tue Apr 19 19:03:55 2016 (r298285) @@ -141,7 +141,7 @@ store_ptr(void *where, Elf_Sxword val, s void _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase) { - const Elf_Rel *rel = 0, *rellim; + const Elf_Rel *rel = NULL, *rellim; Elf_Addr relsz = 0; const Elf_Sym *symtab = NULL, *sym; Elf_Addr *where; Modified: head/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc/reloc.c Tue Apr 19 19:03:06 2016 (r298284) +++ head/libexec/rtld-elf/powerpc/reloc.c Tue Apr 19 19:03:55 2016 (r298285) @@ -126,7 +126,7 @@ do_copy_relocations(Obj_Entry *dstobj) void reloc_non_plt_self(Elf_Dyn *dynp, Elf_Addr relocbase) { - const Elf_Rela *rela = 0, *relalim; + const Elf_Rela *rela = NULL, *relalim; Elf_Addr relasz = 0; Elf_Addr *where; Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Tue Apr 19 19:03:06 2016 (r298284) +++ head/libexec/rtld-elf/powerpc64/reloc.c Tue Apr 19 19:03:55 2016 (r298285) @@ -122,7 +122,7 @@ do_copy_relocations(Obj_Entry *dstobj) void reloc_non_plt_self(Elf_Dyn *dynp, Elf_Addr relocbase) { - const Elf_Rela *rela = 0, *relalim; + const Elf_Rela *rela = NULL, *relalim; Elf_Addr relasz = 0; Elf_Addr *where; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Apr 19 19:03:06 2016 (r298284) +++ head/libexec/rtld-elf/rtld.c Tue Apr 19 19:03:55 2016 (r298285) @@ -519,7 +519,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ rtld_die(); } - if (aux_info[AT_EXECPATH] != 0) { + if (aux_info[AT_EXECPATH] != NULL) { char *kexecpath; char buf[MAXPATHLEN]; From owner-svn-src-all@freebsd.org Tue Apr 19 19:08:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD4C5B143F7; Tue, 19 Apr 2016 19:08:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A98D1E47; Tue, 19 Apr 2016 19:08:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JJ8bZQ012277; Tue, 19 Apr 2016 19:08:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JJ8blq012276; Tue, 19 Apr 2016 19:08:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604191908.u3JJ8blq012276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 19:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298286 - head/sbin/fsck_msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:08:38 -0000 Author: pfg Date: Tue Apr 19 19:08:37 2016 New Revision: 298286 URL: https://svnweb.freebsd.org/changeset/base/298286 Log: fsck_msdosfs: use NULL instead of zero for pointers. Modified: head/sbin/fsck_msdosfs/dir.c Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Tue Apr 19 19:03:55 2016 (r298285) +++ head/sbin/fsck_msdosfs/dir.c Tue Apr 19 19:08:37 2016 (r298286) @@ -289,7 +289,7 @@ finishDosDirSection(void) np = p->next; freeDirTodo(p); } - pendingDirectories = 0; + pendingDirectories = NULL; for (d = rootDir; d; d = nd) { if ((nd = d->child) != NULL) { d->child = 0; From owner-svn-src-all@freebsd.org Tue Apr 19 19:08:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7241B1441F; Tue, 19 Apr 2016 19:08:45 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A86E31F77; Tue, 19 Apr 2016 19:08:45 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JJ8is6012325; Tue, 19 Apr 2016 19:08:44 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JJ8iWq012323; Tue, 19 Apr 2016 19:08:44 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604191908.u3JJ8iWq012323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Apr 2016 19:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r298287 - stable/8/sys/dev/bxe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:08:46 -0000 Author: davidcs Date: Tue Apr 19 19:08:44 2016 New Revision: 298287 URL: https://svnweb.freebsd.org/changeset/base/298287 Log: MFC r297873 1. Process tx completions in bxe_periodic_callout_func() and restart transmissions if possible. 2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED 3. remove code not needed in bxe_init_internal_common() Submitted by:vaishali.kulkarni@qlogic.com;venkata.bhavaraju@qlogic.com Modified: stable/8/sys/dev/bxe/bxe.c stable/8/sys/dev/bxe/bxe_stats.h Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Tue Apr 19 19:08:37 2016 (r298286) +++ stable/8/sys/dev/bxe/bxe.c Tue Apr 19 19:08:44 2016 (r298287) @@ -498,7 +498,9 @@ static const struct { { STATS_OFFSET32(mbuf_alloc_sge), 4, STATS_FLAGS_FUNC, "mbuf_alloc_sge"}, { STATS_OFFSET32(mbuf_alloc_tpa), - 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"} + 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, + { STATS_OFFSET32(tx_queue_full_return), + 4, STATS_FLAGS_FUNC, "tx_queue_full_return"} }; static const struct { @@ -609,7 +611,9 @@ static const struct { { Q_STATS_OFFSET32(mbuf_alloc_sge), 4, "mbuf_alloc_sge"}, { Q_STATS_OFFSET32(mbuf_alloc_tpa), - 4, "mbuf_alloc_tpa"} + 4, "mbuf_alloc_tpa"}, + { Q_STATS_OFFSET32(tx_queue_full_return), + 4, "tx_queue_full_return"} }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -4626,7 +4630,7 @@ bxe_ioctl(struct ifnet *ifp, if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* set the receive mode flags */ bxe_set_rx_mode(sc); - } else { + } else if(sc->state != BXE_STATE_DISABLED) { bxe_init_locked(sc); } } else { @@ -5729,11 +5733,6 @@ bxe_tx_start(struct ifnet *ifp) return; } - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { - BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n"); - return; - } - if (!sc->link_vars.link_up) { BLOGW(sc, "Interface link is down, ignoring transmit request\n"); return; @@ -5741,6 +5740,11 @@ bxe_tx_start(struct ifnet *ifp) fp = &sc->fp[0]; + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + fp->eth_q_stats.tx_queue_full_return++; + return; + } + BXE_FP_TX_LOCK(fp); bxe_tx_start_locked(sc, ifp, fp); BXE_FP_TX_UNLOCK(fp); @@ -9942,21 +9946,6 @@ bxe_init_internal_common(struct bxe_soft { int i; - if (IS_MF_SI(sc)) { - /* - * In switch independent mode, the TSTORM needs to accept - * packets that failed classification, since approximate match - * mac addresses aren't written to NIG LLH. - */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 2); - } else if (!CHIP_IS_E1(sc)) { /* 57710 doesn't support MF */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 0); - } - /* * Zero this manually as its initialization is currently missing * in the initTool. @@ -12299,6 +12288,8 @@ static void bxe_periodic_callout_func(void *xsc) { struct bxe_softc *sc = (struct bxe_softc *)xsc; + struct bxe_fastpath *fp; + uint16_t tx_bd_avail; int i; if (!BXE_CORE_TRYLOCK(sc)) { @@ -12321,6 +12312,48 @@ bxe_periodic_callout_func(void *xsc) return; } +#if __FreeBSD_version >= 800000 + + FOR_EACH_QUEUE(sc, i) { + fp = &sc->fp[i]; + + if (BXE_FP_TX_TRYLOCK(fp)) { + struct ifnet *ifp = sc->ifnet; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_mq_start_locked(sc, ifp, fp, NULL); + } + BXE_FP_TX_UNLOCK(fp); + } + } + +#else + + fp = &sc->fp[0]; + if (BXE_FP_TX_TRYLOCK(fp)) { + struct ifnet *ifp = sc->ifnet; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_start_locked(sc, ifp, fp); + } + + BXE_FP_TX_UNLOCK(fp); + } + +#endif /* #if __FreeBSD_version >= 800000 */ + /* Check for TX timeouts on any fastpath. */ FOR_EACH_QUEUE(sc, i) { if (bxe_watchdog(sc, &sc->fp[i]) != 0) { @@ -16169,6 +16202,7 @@ bxe_detach(device_t dev) if (sc->state != BXE_STATE_CLOSED) { BXE_CORE_LOCK(sc); bxe_nic_unload(sc, UNLOAD_CLOSE, TRUE); + sc->state = BXE_STATE_DISABLED; BXE_CORE_UNLOCK(sc); } Modified: stable/8/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/8/sys/dev/bxe/bxe_stats.h Tue Apr 19 19:08:37 2016 (r298286) +++ stable/8/sys/dev/bxe/bxe_stats.h Tue Apr 19 19:08:44 2016 (r298287) @@ -263,6 +263,9 @@ struct bxe_eth_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; @@ -366,6 +369,9 @@ struct bxe_eth_q_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; struct bxe_eth_stats_old { From owner-svn-src-all@freebsd.org Tue Apr 19 19:13:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B277CB14638; Tue, 19 Apr 2016 19:13:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BAAD139A; Tue, 19 Apr 2016 19:13:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JJDXRF015176; Tue, 19 Apr 2016 19:13:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JJDXZL015174; Tue, 19 Apr 2016 19:13:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604191913.u3JJDXZL015174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 19:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298288 - head/sbin/dump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:13:34 -0000 Author: pfg Date: Tue Apr 19 19:13:33 2016 New Revision: 298288 URL: https://svnweb.freebsd.org/changeset/base/298288 Log: dump: use NULL instead of zero for pointers. Clean out the casts from calloc(3) while here. Modified: head/sbin/dump/itime.c head/sbin/dump/main.c Modified: head/sbin/dump/itime.c ============================================================================== --- head/sbin/dump/itime.c Tue Apr 19 19:08:44 2016 (r298287) +++ head/sbin/dump/itime.c Tue Apr 19 19:13:33 2016 (r298288) @@ -58,7 +58,7 @@ struct dumptime { SLIST_ENTRY(dumptime) dt_list; }; SLIST_HEAD(dthead, dumptime) dthead = SLIST_HEAD_INITIALIZER(dthead); -struct dumpdates **ddatev = 0; +struct dumpdates **ddatev = NULL; int nddates = 0; static void dumprecout(FILE *, const struct dumpdates *); @@ -118,8 +118,7 @@ readdumptimes(FILE *df) * arrayify the list, leaving enough room for the additional * record that we may have to add to the ddate structure */ - ddatev = (struct dumpdates **) - calloc((unsigned) (nddates + 1), sizeof (struct dumpdates *)); + ddatev = calloc((unsigned) (nddates + 1), sizeof (struct dumpdates *)); dtwalk = SLIST_FIRST(&dthead); for (i = nddates - 1; i >= 0; i--, dtwalk = SLIST_NEXT(dtwalk, dt_list)) ddatev[i] = &dtwalk->dt_value; @@ -174,8 +173,8 @@ putdumptime(void) fd = fileno(df); (void) flock(fd, LOCK_EX); fname = disk; - free((char *)ddatev); - ddatev = 0; + free(ddatev); + ddatev = NULL; nddates = 0; readdumptimes(df); if (fseek(df, 0L, 0) < 0) Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Tue Apr 19 19:08:44 2016 (r298287) +++ head/sbin/dump/main.c Tue Apr 19 19:13:33 2016 (r298288) @@ -340,7 +340,7 @@ main(int argc, char *argv[]) spcl.c_dev[NAMELEN-1]='\0'; spcl.c_filesys[NAMELEN-1]='\0'; - if ((mntpt = getmntpt(disk, &mntflags)) != 0) { + if ((mntpt = getmntpt(disk, &mntflags)) != NULL) { if (mntflags & MNT_RDONLY) { if (snapdump != 0) { msg("WARNING: %s\n", From owner-svn-src-all@freebsd.org Tue Apr 19 19:14:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F10DB14696; Tue, 19 Apr 2016 19:14:05 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1F91675; Tue, 19 Apr 2016 19:14:05 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JJE48J015245; Tue, 19 Apr 2016 19:14:04 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JJE45s015242; Tue, 19 Apr 2016 19:14:04 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604191914.u3JJE45s015242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Apr 2016 19:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r298289 - stable/8/sys/dev/bxe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:14:05 -0000 Author: davidcs Date: Tue Apr 19 19:14:04 2016 New Revision: 298289 URL: https://svnweb.freebsd.org/changeset/base/298289 Log: MFC r297884 Add support for Flash Update Submitted by:nrapendra.singh@qlogic.com;vaishali.kulkarni@qlogic.com;davidcs@freebsd.org Modified: stable/8/sys/dev/bxe/bxe.c stable/8/sys/dev/bxe/bxe.h stable/8/sys/dev/bxe/bxe_ioctl.h Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Tue Apr 19 19:13:33 2016 (r298288) +++ stable/8/sys/dev/bxe/bxe.c Tue Apr 19 19:14:04 2016 (r298289) @@ -13685,49 +13685,60 @@ bxe_get_tunable_params(struct bxe_softc sc->udp_rss); } -static void +static int bxe_media_detect(struct bxe_softc *sc) { + int port_type; uint32_t phy_idx = bxe_get_cur_phy_idx(sc); + switch (sc->link_params.phy[phy_idx].media_type) { case ELINK_ETH_PHY_SFPP_10G_FIBER: case ELINK_ETH_PHY_XFP_FIBER: BLOGI(sc, "Found 10Gb Fiber media.\n"); sc->media = IFM_10G_SR; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_SFP_1G_FIBER: BLOGI(sc, "Found 1Gb Fiber media.\n"); sc->media = IFM_1000_SX; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_KR: case ELINK_ETH_PHY_CX4: BLOGI(sc, "Found 10GBase-CX4 media.\n"); sc->media = IFM_10G_CX4; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_DA_TWINAX: BLOGI(sc, "Found 10Gb Twinax media.\n"); sc->media = IFM_10G_TWINAX; + port_type = PORT_DA; break; case ELINK_ETH_PHY_BASE_T: if (sc->link_params.speed_cap_mask[0] & PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) { BLOGI(sc, "Found 10GBase-T media.\n"); sc->media = IFM_10G_T; + port_type = PORT_TP; } else { BLOGI(sc, "Found 1000Base-T media.\n"); sc->media = IFM_1000_T; + port_type = PORT_TP; } break; case ELINK_ETH_PHY_NOT_PRESENT: BLOGI(sc, "Media not present.\n"); sc->media = 0; + port_type = PORT_OTHER; break; case ELINK_ETH_PHY_UNSPECIFIED: default: BLOGI(sc, "Unknown media!\n"); sc->media = 0; + port_type = PORT_OTHER; break; } + return port_type; } #define GET_FIELD(value, fname) \ @@ -18746,6 +18757,14 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->grc_dump == NULL) return (-1); + sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); + + if (sc->eeprom == NULL) { + BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); + free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; + return (-1); + } + sc->ioctl_dev = make_dev(&bxe_cdevsw, sc->ifnet->if_dunit, UID_ROOT, @@ -18757,6 +18776,8 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->ioctl_dev == NULL) { free(sc->grc_dump, M_DEVBUF); + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; return (-1); } @@ -18772,12 +18793,152 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump == NULL) + if (sc->grc_dump != NULL) free(sc->grc_dump, M_DEVBUF); + if (sc->eeprom != NULL) { + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; + } + return; } +static bool bxe_is_nvram_accessible(struct bxe_softc *sc) +{ + + if ((sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) == 0) + return FALSE; + + return TRUE; +} + + +static int +bxe_wr_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_write(sc, offset, (uint8_t *)data, len); + + + return (rval); +} + +static int +bxe_rd_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_read(sc, offset, (uint8_t *)data, len); + + return (rval); +} + +static int +bxe_eeprom_rd_wr(struct bxe_softc *sc, bxe_eeprom_t *eeprom) +{ + int rval = 0; + + switch (eeprom->eeprom_cmd) { + + case BXE_EEPROM_CMD_SET_EEPROM: + + rval = copyin(eeprom->eeprom_data, sc->eeprom, + eeprom->eeprom_data_len); + + if (rval) + break; + + rval = bxe_wr_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + break; + + case BXE_EEPROM_CMD_GET_EEPROM: + + rval = bxe_rd_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + + if (rval) { + break; + } + + rval = copyout(sc->eeprom, eeprom->eeprom_data, + eeprom->eeprom_data_len); + break; + + default: + rval = EINVAL; + break; + } + + if (rval) { + BLOGW(sc, "ioctl cmd %d failed rval %d\n", eeprom->eeprom_cmd, rval); + } + + return (rval); +} + +static int +bxe_get_settings(struct bxe_softc *sc, bxe_dev_setting_t *dev_p) +{ + uint32_t ext_phy_config; + int port = SC_PORT(sc); + int cfg_idx = bxe_get_link_cfg_idx(sc); + + dev_p->supported = sc->port.supported[cfg_idx] | + (sc->port.supported[cfg_idx ^ 1] & + (ELINK_SUPPORTED_TP | ELINK_SUPPORTED_FIBRE)); + dev_p->advertising = sc->port.advertising[cfg_idx]; + if(sc->link_params.phy[bxe_get_cur_phy_idx(sc)].media_type == + ELINK_ETH_PHY_SFP_1G_FIBER) { + dev_p->supported = ~(ELINK_SUPPORTED_10000baseT_Full); + dev_p->advertising &= ~(ADVERTISED_10000baseT_Full); + } + if ((sc->state == BXE_STATE_OPEN) && sc->link_vars.link_up && + !(sc->flags & BXE_MF_FUNC_DIS)) { + dev_p->duplex = sc->link_vars.duplex; + if (IS_MF(sc) && !BXE_NOMCP(sc)) + dev_p->speed = bxe_get_mf_speed(sc); + else + dev_p->speed = sc->link_vars.line_speed; + } else { + dev_p->duplex = DUPLEX_UNKNOWN; + dev_p->speed = SPEED_UNKNOWN; + } + + dev_p->port = bxe_media_detect(sc); + + ext_phy_config = SHMEM_RD(sc, + dev_info.port_hw_config[port].external_phy_config); + if((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) == + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) + dev_p->phy_address = sc->port.phy_addr; + else if(((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE) && + ((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) + dev_p->phy_address = ELINK_XGXS_EXT_PHY_ADDR(ext_phy_config); + else + dev_p->phy_address = 0; + + if(sc->link_params.req_line_speed[cfg_idx] == ELINK_SPEED_AUTO_NEG) + dev_p->autoneg = AUTONEG_ENABLE; + else + dev_p->autoneg = AUTONEG_DISABLE; + + + return 0; +} + static int bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) @@ -18787,6 +18948,14 @@ bxe_eioctl(struct cdev *dev, u_long cmd, device_t pci_dev; bxe_grcdump_t *dump = NULL; int grc_dump_size; + bxe_drvinfo_t *drv_infop = NULL; + bxe_dev_setting_t *dev_p; + bxe_dev_setting_t dev_set; + bxe_get_regs_t *reg_p; + bxe_reg_rdw_t *reg_rdw_p; + bxe_pcicfg_rdw_t *cfg_rdw_p; + bxe_perm_mac_addr_t *mac_addr_p; + if ((sc = (struct bxe_softc *)dev->si_drv1) == NULL) return ENXIO; @@ -18799,14 +18968,15 @@ bxe_eioctl(struct cdev *dev, u_long cmd, case BXE_GRC_DUMP_SIZE: dump->pci_func = sc->pcie_func; - dump->grcdump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + dump->grcdump_size = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); break; case BXE_GRC_DUMP: grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + sizeof(struct dump_header); if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { @@ -18819,6 +18989,92 @@ bxe_eioctl(struct cdev *dev, u_long cmd, break; + case BXE_DRV_INFO: + drv_infop = (bxe_drvinfo_t *)data; + snprintf(drv_infop->drv_name, BXE_DRV_NAME_LENGTH, "%s", "bxe"); + snprintf(drv_infop->drv_version, BXE_DRV_VERSION_LENGTH, "v:%s", + BXE_DRIVER_VERSION); + snprintf(drv_infop->mfw_version, BXE_MFW_VERSION_LENGTH, "%s", + sc->devinfo.bc_ver_str); + snprintf(drv_infop->stormfw_version, BXE_STORMFW_VERSION_LENGTH, + "%s", sc->fw_ver_str); + drv_infop->eeprom_dump_len = sc->devinfo.flash_size; + drv_infop->reg_dump_len = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", + sc->pcie_bus, sc->pcie_device, sc->pcie_func); + break; + case BXE_DEV_SETTING: + dev_p = (bxe_dev_setting_t *)data; + bxe_get_settings(sc, &dev_set); + dev_p->supported = dev_set.supported; + dev_p->advertising = dev_set.advertising; + dev_p->speed = dev_set.speed; + dev_p->duplex = dev_set.duplex; + dev_p->port = dev_set.port; + dev_p->phy_address = dev_set.phy_address; + dev_p->autoneg = dev_set.autoneg; + + break; + + case BXE_GET_REGS: + + reg_p = (bxe_get_regs_t *)data; + grc_dump_size = reg_p->reg_buf_len; + + if (sc->grc_dump == NULL) { + rval = EINVAL; + break; + } + + if(!sc->grcdump_done) { + bxe_grc_dump(sc); + } + if(sc->grcdump_done) { + rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + sc->grcdump_done = 0; + } + + break; + case BXE_RDW_REG: + reg_rdw_p = (bxe_reg_rdw_t *)data; + if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + reg_rdw_p->reg_val = REG_RD(sc, reg_rdw_p->reg_id); + + if((reg_rdw_p->reg_cmd == BXE_WRITE_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + REG_WR(sc, reg_rdw_p->reg_id, reg_rdw_p->reg_val); + + break; + + case BXE_RDW_PCICFG: + cfg_rdw_p = (bxe_pcicfg_rdw_t *)data; + if(cfg_rdw_p->cfg_cmd == BXE_READ_PCICFG) { + + cfg_rdw_p->cfg_val = pci_read_config(sc->dev, cfg_rdw_p->cfg_id, + cfg_rdw_p->cfg_width); + + } else if(cfg_rdw_p->cfg_cmd == BXE_WRITE_PCICFG) { + pci_write_config(sc->dev, cfg_rdw_p->cfg_id, cfg_rdw_p->cfg_val, + cfg_rdw_p->cfg_width); + } else { + BLOGW(sc, "BXE_RDW_PCICFG ioctl wrong cmd passed\n"); + } + break; + + case BXE_MAC_ADDR: + mac_addr_p = (bxe_perm_mac_addr_t *)data; + snprintf(mac_addr_p->mac_addr_str, sizeof(sc->mac_addr_str), "%s", + sc->mac_addr_str); + break; + + case BXE_EEPROM: + rval = bxe_eeprom_rd_wr(sc, (bxe_eeprom_t *)data); + break; + + default: break; } Modified: stable/8/sys/dev/bxe/bxe.h ============================================================================== --- stable/8/sys/dev/bxe/bxe.h Tue Apr 19 19:13:33 2016 (r298288) +++ stable/8/sys/dev/bxe/bxe.h Tue Apr 19 19:14:04 2016 (r298289) @@ -1788,6 +1788,7 @@ struct bxe_softc { struct cdev *ioctl_dev; void *grc_dump; int grcdump_done; + void *eeprom; }; /* struct bxe_softc */ /* IOCTL sub-commands for edebug and firmware upgrade */ @@ -2109,6 +2110,28 @@ static const uint32_t dmae_reg_go_c[] = #define PCI_PM_D0 1 #define PCI_PM_D3hot 2 +#ifndef DUPLEX_UNKNOWN +#define DUPLEX_UNKNOWN (0xff) +#endif + +#ifndef SPEED_UNKNOWN +#define SPEED_UNKNOWN (-1) +#endif + +/* Enable or disable autonegotiation. */ +#define AUTONEG_DISABLE 0x00 +#define AUTONEG_ENABLE 0x01 + +/* Which connector port. */ +#define PORT_TP 0x00 +#define PORT_AUI 0x01 +#define PORT_MII 0x02 +#define PORT_FIBRE 0x03 +#define PORT_BNC 0x04 +#define PORT_DA 0x05 +#define PORT_NONE 0xef +#define PORT_OTHER 0xff + int bxe_test_bit(int nr, volatile unsigned long * addr); void bxe_set_bit(unsigned int nr, volatile unsigned long * addr); void bxe_clear_bit(int nr, volatile unsigned long * addr); Modified: stable/8/sys/dev/bxe/bxe_ioctl.h ============================================================================== --- stable/8/sys/dev/bxe/bxe_ioctl.h Tue Apr 19 19:13:33 2016 (r298288) +++ stable/8/sys/dev/bxe/bxe_ioctl.h Tue Apr 19 19:14:04 2016 (r298289) @@ -42,6 +42,86 @@ struct bxe_grcdump { }; typedef struct bxe_grcdump bxe_grcdump_t; +#define BXE_DRV_NAME_LENGTH 32 +#define BXE_DRV_VERSION_LENGTH 32 +#define BXE_MFW_VERSION_LENGTH 32 +#define BXE_STORMFW_VERSION_LENGTH 32 +#define BXE_BUS_INFO_LENGTH 32 + +struct bxe_drvinfo { + char drv_name[BXE_DRV_NAME_LENGTH]; + char drv_version[BXE_DRV_VERSION_LENGTH]; + char mfw_version[BXE_MFW_VERSION_LENGTH]; + char stormfw_version[BXE_STORMFW_VERSION_LENGTH]; + uint32_t eeprom_dump_len; /* in bytes */ + uint32_t reg_dump_len; /* in bytes */ + char bus_info[BXE_BUS_INFO_LENGTH]; +}; +typedef struct bxe_drvinfo bxe_drvinfo_t; + +struct bxe_dev_setting { + + uint32_t supported; /* Features this interface supports */ + uint32_t advertising;/* Features this interface advertises */ + uint32_t speed; /* The forced speed, 10Mb, 100Mb, gigabit */ + uint32_t duplex; /* Duplex, half or full */ + uint32_t port; /* Which connector port */ + uint32_t phy_address;/* port number*/ + uint32_t autoneg; /* Enable or disable autonegotiation */ +}; +typedef struct bxe_dev_setting bxe_dev_setting_t; + +struct bxe_get_regs { + void *reg_buf; + uint32_t reg_buf_len; +}; +typedef struct bxe_get_regs bxe_get_regs_t; + +#define BXE_EEPROM_MAX_DATA_LEN 524288 + +struct bxe_eeprom { + uint32_t eeprom_cmd; +#define BXE_EEPROM_CMD_SET_EEPROM 0x01 +#define BXE_EEPROM_CMD_GET_EEPROM 0x02 + + void *eeprom_data; + uint32_t eeprom_offset; + uint32_t eeprom_data_len; + uint32_t eeprom_magic; +}; +typedef struct bxe_eeprom bxe_eeprom_t; + +struct bxe_reg_rdw { + uint32_t reg_cmd; +#define BXE_READ_REG_CMD 0x01 +#define BXE_WRITE_REG_CMD 0x02 + + uint32_t reg_id; + uint32_t reg_val; + uint32_t reg_access_type; +#define BXE_REG_ACCESS_DIRECT 0x01 +#define BXE_REG_ACCESS_INDIRECT 0x02 +}; + +typedef struct bxe_reg_rdw bxe_reg_rdw_t; + +struct bxe_pcicfg_rdw { + uint32_t cfg_cmd; +#define BXE_READ_PCICFG 0x01 +#define BXE_WRITE_PCICFG 0x01 + uint32_t cfg_id; + uint32_t cfg_val; + uint32_t cfg_width; +}; + +typedef struct bxe_pcicfg_rdw bxe_pcicfg_rdw_t; + +struct bxe_perm_mac_addr { + char mac_addr_str[32]; +}; + +typedef struct bxe_perm_mac_addr bxe_perm_mac_addr_t; + /* * Read grcdump size @@ -53,5 +133,41 @@ typedef struct bxe_grcdump bxe_grcdump_t */ #define BXE_GRC_DUMP _IOWR('e', 2, bxe_grcdump_t) +/* + * Read driver info + */ +#define BXE_DRV_INFO _IOR('e', 3, bxe_drvinfo_t) + +/* + * Read Device Setting + */ +#define BXE_DEV_SETTING _IOR('e', 4, bxe_dev_setting_t) + +/* + * Get Registers + */ +#define BXE_GET_REGS _IOR('e', 5, bxe_get_regs_t) + +/* + * Get/Set EEPROM + */ +#define BXE_EEPROM _IOWR('e', 6, bxe_eeprom_t) + +/* + * read/write a register + */ +#define BXE_RDW_REG _IOWR('e', 7, bxe_reg_rdw_t) + +/* + * read/write PCIcfg + */ +#define BXE_RDW_PCICFG _IOWR('e', 8, bxe_reg_rdw_t) + +/* + * get permanent mac address + */ + +#define BXE_MAC_ADDR _IOWR('e', 9, bxe_perm_mac_addr_t) + #endif /* #ifndef _QLNX_IOCTL_H_ */ From owner-svn-src-all@freebsd.org Tue Apr 19 19:19:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81EC2B14819; Tue, 19 Apr 2016 19:19:00 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44BB418C9; Tue, 19 Apr 2016 19:19:00 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JJIxJw015455; Tue, 19 Apr 2016 19:18:59 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JJIxi8015453; Tue, 19 Apr 2016 19:18:59 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604191918.u3JJIxi8015453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Apr 2016 19:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r298290 - stable/7/sys/dev/bxe X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:19:00 -0000 Author: davidcs Date: Tue Apr 19 19:18:59 2016 New Revision: 298290 URL: https://svnweb.freebsd.org/changeset/base/298290 Log: MFC r297873 1. Process tx completions in bxe_periodic_callout_func() and restart transmissions if possible. 2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED 3. remove code not needed in bxe_init_internal_common() Submitted by:vaishali.kulkarni@qlogic.com;venkata.bhavaraju@qlogic.com Modified: stable/7/sys/dev/bxe/bxe.c stable/7/sys/dev/bxe/bxe_stats.h Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/bxe.c ============================================================================== --- stable/7/sys/dev/bxe/bxe.c Tue Apr 19 19:14:04 2016 (r298289) +++ stable/7/sys/dev/bxe/bxe.c Tue Apr 19 19:18:59 2016 (r298290) @@ -498,7 +498,9 @@ static const struct { { STATS_OFFSET32(mbuf_alloc_sge), 4, STATS_FLAGS_FUNC, "mbuf_alloc_sge"}, { STATS_OFFSET32(mbuf_alloc_tpa), - 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"} + 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, + { STATS_OFFSET32(tx_queue_full_return), + 4, STATS_FLAGS_FUNC, "tx_queue_full_return"} }; static const struct { @@ -609,7 +611,9 @@ static const struct { { Q_STATS_OFFSET32(mbuf_alloc_sge), 4, "mbuf_alloc_sge"}, { Q_STATS_OFFSET32(mbuf_alloc_tpa), - 4, "mbuf_alloc_tpa"} + 4, "mbuf_alloc_tpa"}, + { Q_STATS_OFFSET32(tx_queue_full_return), + 4, "tx_queue_full_return"} }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -4626,7 +4630,7 @@ bxe_ioctl(struct ifnet *ifp, if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* set the receive mode flags */ bxe_set_rx_mode(sc); - } else { + } else if(sc->state != BXE_STATE_DISABLED) { bxe_init_locked(sc); } } else { @@ -5729,11 +5733,6 @@ bxe_tx_start(struct ifnet *ifp) return; } - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { - BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n"); - return; - } - if (!sc->link_vars.link_up) { BLOGW(sc, "Interface link is down, ignoring transmit request\n"); return; @@ -5741,6 +5740,11 @@ bxe_tx_start(struct ifnet *ifp) fp = &sc->fp[0]; + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + fp->eth_q_stats.tx_queue_full_return++; + return; + } + BXE_FP_TX_LOCK(fp); bxe_tx_start_locked(sc, ifp, fp); BXE_FP_TX_UNLOCK(fp); @@ -9942,21 +9946,6 @@ bxe_init_internal_common(struct bxe_soft { int i; - if (IS_MF_SI(sc)) { - /* - * In switch independent mode, the TSTORM needs to accept - * packets that failed classification, since approximate match - * mac addresses aren't written to NIG LLH. - */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 2); - } else if (!CHIP_IS_E1(sc)) { /* 57710 doesn't support MF */ - REG_WR8(sc, - (BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), - 0); - } - /* * Zero this manually as its initialization is currently missing * in the initTool. @@ -12299,6 +12288,8 @@ static void bxe_periodic_callout_func(void *xsc) { struct bxe_softc *sc = (struct bxe_softc *)xsc; + struct bxe_fastpath *fp; + uint16_t tx_bd_avail; int i; if (!BXE_CORE_TRYLOCK(sc)) { @@ -12321,6 +12312,48 @@ bxe_periodic_callout_func(void *xsc) return; } +#if __FreeBSD_version >= 800000 + + FOR_EACH_QUEUE(sc, i) { + fp = &sc->fp[i]; + + if (BXE_FP_TX_TRYLOCK(fp)) { + struct ifnet *ifp = sc->ifnet; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_mq_start_locked(sc, ifp, fp, NULL); + } + BXE_FP_TX_UNLOCK(fp); + } + } + +#else + + fp = &sc->fp[0]; + if (BXE_FP_TX_TRYLOCK(fp)) { + struct ifnet *ifp = sc->ifnet; + /* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ + (void) bxe_txeof(sc, fp); + + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { + bxe_tx_start_locked(sc, ifp, fp); + } + + BXE_FP_TX_UNLOCK(fp); + } + +#endif /* #if __FreeBSD_version >= 800000 */ + /* Check for TX timeouts on any fastpath. */ FOR_EACH_QUEUE(sc, i) { if (bxe_watchdog(sc, &sc->fp[i]) != 0) { @@ -16169,6 +16202,7 @@ bxe_detach(device_t dev) if (sc->state != BXE_STATE_CLOSED) { BXE_CORE_LOCK(sc); bxe_nic_unload(sc, UNLOAD_CLOSE, TRUE); + sc->state = BXE_STATE_DISABLED; BXE_CORE_UNLOCK(sc); } Modified: stable/7/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/7/sys/dev/bxe/bxe_stats.h Tue Apr 19 19:14:04 2016 (r298289) +++ stable/7/sys/dev/bxe/bxe_stats.h Tue Apr 19 19:18:59 2016 (r298290) @@ -263,6 +263,9 @@ struct bxe_eth_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; @@ -366,6 +369,9 @@ struct bxe_eth_q_stats { uint32_t mbuf_alloc_rx; uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; + + /* num. of times tx queue full occured */ + uint32_t tx_queue_full_return; }; struct bxe_eth_stats_old { From owner-svn-src-all@freebsd.org Tue Apr 19 19:22:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC472B14B2F; Tue, 19 Apr 2016 19:22:08 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B9D31DE3; Tue, 19 Apr 2016 19:22:08 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JJM7Tm017598; Tue, 19 Apr 2016 19:22:07 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JJM7TZ017594; Tue, 19 Apr 2016 19:22:07 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604191922.u3JJM7TZ017594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Apr 2016 19:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r298291 - stable/7/sys/dev/bxe X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:22:08 -0000 Author: davidcs Date: Tue Apr 19 19:22:07 2016 New Revision: 298291 URL: https://svnweb.freebsd.org/changeset/base/298291 Log: MFC r297884 Add support for Flash Update Submitted by:nrapendra.singh@qlogic.com;vaishali.kulkarni@qlogic.com;davidcs@freebsd.org Modified: stable/7/sys/dev/bxe/bxe.c stable/7/sys/dev/bxe/bxe.h stable/7/sys/dev/bxe/bxe_ioctl.h Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/bxe.c ============================================================================== --- stable/7/sys/dev/bxe/bxe.c Tue Apr 19 19:18:59 2016 (r298290) +++ stable/7/sys/dev/bxe/bxe.c Tue Apr 19 19:22:07 2016 (r298291) @@ -13685,49 +13685,60 @@ bxe_get_tunable_params(struct bxe_softc sc->udp_rss); } -static void +static int bxe_media_detect(struct bxe_softc *sc) { + int port_type; uint32_t phy_idx = bxe_get_cur_phy_idx(sc); + switch (sc->link_params.phy[phy_idx].media_type) { case ELINK_ETH_PHY_SFPP_10G_FIBER: case ELINK_ETH_PHY_XFP_FIBER: BLOGI(sc, "Found 10Gb Fiber media.\n"); sc->media = IFM_10G_SR; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_SFP_1G_FIBER: BLOGI(sc, "Found 1Gb Fiber media.\n"); sc->media = IFM_1000_SX; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_KR: case ELINK_ETH_PHY_CX4: BLOGI(sc, "Found 10GBase-CX4 media.\n"); sc->media = IFM_10G_CX4; + port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_DA_TWINAX: BLOGI(sc, "Found 10Gb Twinax media.\n"); sc->media = IFM_10G_TWINAX; + port_type = PORT_DA; break; case ELINK_ETH_PHY_BASE_T: if (sc->link_params.speed_cap_mask[0] & PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) { BLOGI(sc, "Found 10GBase-T media.\n"); sc->media = IFM_10G_T; + port_type = PORT_TP; } else { BLOGI(sc, "Found 1000Base-T media.\n"); sc->media = IFM_1000_T; + port_type = PORT_TP; } break; case ELINK_ETH_PHY_NOT_PRESENT: BLOGI(sc, "Media not present.\n"); sc->media = 0; + port_type = PORT_OTHER; break; case ELINK_ETH_PHY_UNSPECIFIED: default: BLOGI(sc, "Unknown media!\n"); sc->media = 0; + port_type = PORT_OTHER; break; } + return port_type; } #define GET_FIELD(value, fname) \ @@ -18746,6 +18757,14 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->grc_dump == NULL) return (-1); + sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); + + if (sc->eeprom == NULL) { + BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); + free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; + return (-1); + } + sc->ioctl_dev = make_dev(&bxe_cdevsw, sc->ifnet->if_dunit, UID_ROOT, @@ -18757,6 +18776,8 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->ioctl_dev == NULL) { free(sc->grc_dump, M_DEVBUF); + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; return (-1); } @@ -18772,12 +18793,152 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump == NULL) + if (sc->grc_dump != NULL) free(sc->grc_dump, M_DEVBUF); + if (sc->eeprom != NULL) { + free(sc->eeprom, M_DEVBUF); + sc->eeprom = NULL; + } + return; } +static bool bxe_is_nvram_accessible(struct bxe_softc *sc) +{ + + if ((sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) == 0) + return FALSE; + + return TRUE; +} + + +static int +bxe_wr_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_write(sc, offset, (uint8_t *)data, len); + + + return (rval); +} + +static int +bxe_rd_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ + int rval = 0; + + if(!bxe_is_nvram_accessible(sc)) { + BLOGW(sc, "Cannot access eeprom when interface is down\n"); + return (-EAGAIN); + } + rval = bxe_nvram_read(sc, offset, (uint8_t *)data, len); + + return (rval); +} + +static int +bxe_eeprom_rd_wr(struct bxe_softc *sc, bxe_eeprom_t *eeprom) +{ + int rval = 0; + + switch (eeprom->eeprom_cmd) { + + case BXE_EEPROM_CMD_SET_EEPROM: + + rval = copyin(eeprom->eeprom_data, sc->eeprom, + eeprom->eeprom_data_len); + + if (rval) + break; + + rval = bxe_wr_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + break; + + case BXE_EEPROM_CMD_GET_EEPROM: + + rval = bxe_rd_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, + eeprom->eeprom_data_len); + + if (rval) { + break; + } + + rval = copyout(sc->eeprom, eeprom->eeprom_data, + eeprom->eeprom_data_len); + break; + + default: + rval = EINVAL; + break; + } + + if (rval) { + BLOGW(sc, "ioctl cmd %d failed rval %d\n", eeprom->eeprom_cmd, rval); + } + + return (rval); +} + +static int +bxe_get_settings(struct bxe_softc *sc, bxe_dev_setting_t *dev_p) +{ + uint32_t ext_phy_config; + int port = SC_PORT(sc); + int cfg_idx = bxe_get_link_cfg_idx(sc); + + dev_p->supported = sc->port.supported[cfg_idx] | + (sc->port.supported[cfg_idx ^ 1] & + (ELINK_SUPPORTED_TP | ELINK_SUPPORTED_FIBRE)); + dev_p->advertising = sc->port.advertising[cfg_idx]; + if(sc->link_params.phy[bxe_get_cur_phy_idx(sc)].media_type == + ELINK_ETH_PHY_SFP_1G_FIBER) { + dev_p->supported = ~(ELINK_SUPPORTED_10000baseT_Full); + dev_p->advertising &= ~(ADVERTISED_10000baseT_Full); + } + if ((sc->state == BXE_STATE_OPEN) && sc->link_vars.link_up && + !(sc->flags & BXE_MF_FUNC_DIS)) { + dev_p->duplex = sc->link_vars.duplex; + if (IS_MF(sc) && !BXE_NOMCP(sc)) + dev_p->speed = bxe_get_mf_speed(sc); + else + dev_p->speed = sc->link_vars.line_speed; + } else { + dev_p->duplex = DUPLEX_UNKNOWN; + dev_p->speed = SPEED_UNKNOWN; + } + + dev_p->port = bxe_media_detect(sc); + + ext_phy_config = SHMEM_RD(sc, + dev_info.port_hw_config[port].external_phy_config); + if((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) == + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) + dev_p->phy_address = sc->port.phy_addr; + else if(((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE) && + ((ext_phy_config & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) != + PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) + dev_p->phy_address = ELINK_XGXS_EXT_PHY_ADDR(ext_phy_config); + else + dev_p->phy_address = 0; + + if(sc->link_params.req_line_speed[cfg_idx] == ELINK_SPEED_AUTO_NEG) + dev_p->autoneg = AUTONEG_ENABLE; + else + dev_p->autoneg = AUTONEG_DISABLE; + + + return 0; +} + static int bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) @@ -18787,6 +18948,14 @@ bxe_eioctl(struct cdev *dev, u_long cmd, device_t pci_dev; bxe_grcdump_t *dump = NULL; int grc_dump_size; + bxe_drvinfo_t *drv_infop = NULL; + bxe_dev_setting_t *dev_p; + bxe_dev_setting_t dev_set; + bxe_get_regs_t *reg_p; + bxe_reg_rdw_t *reg_rdw_p; + bxe_pcicfg_rdw_t *cfg_rdw_p; + bxe_perm_mac_addr_t *mac_addr_p; + if ((sc = (struct bxe_softc *)dev->si_drv1) == NULL) return ENXIO; @@ -18799,14 +18968,15 @@ bxe_eioctl(struct cdev *dev, u_long cmd, case BXE_GRC_DUMP_SIZE: dump->pci_func = sc->pcie_func; - dump->grcdump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + dump->grcdump_size = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); break; case BXE_GRC_DUMP: grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); + sizeof(struct dump_header); if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { @@ -18819,6 +18989,92 @@ bxe_eioctl(struct cdev *dev, u_long cmd, break; + case BXE_DRV_INFO: + drv_infop = (bxe_drvinfo_t *)data; + snprintf(drv_infop->drv_name, BXE_DRV_NAME_LENGTH, "%s", "bxe"); + snprintf(drv_infop->drv_version, BXE_DRV_VERSION_LENGTH, "v:%s", + BXE_DRIVER_VERSION); + snprintf(drv_infop->mfw_version, BXE_MFW_VERSION_LENGTH, "%s", + sc->devinfo.bc_ver_str); + snprintf(drv_infop->stormfw_version, BXE_STORMFW_VERSION_LENGTH, + "%s", sc->fw_ver_str); + drv_infop->eeprom_dump_len = sc->devinfo.flash_size; + drv_infop->reg_dump_len = + (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", + sc->pcie_bus, sc->pcie_device, sc->pcie_func); + break; + case BXE_DEV_SETTING: + dev_p = (bxe_dev_setting_t *)data; + bxe_get_settings(sc, &dev_set); + dev_p->supported = dev_set.supported; + dev_p->advertising = dev_set.advertising; + dev_p->speed = dev_set.speed; + dev_p->duplex = dev_set.duplex; + dev_p->port = dev_set.port; + dev_p->phy_address = dev_set.phy_address; + dev_p->autoneg = dev_set.autoneg; + + break; + + case BXE_GET_REGS: + + reg_p = (bxe_get_regs_t *)data; + grc_dump_size = reg_p->reg_buf_len; + + if (sc->grc_dump == NULL) { + rval = EINVAL; + break; + } + + if(!sc->grcdump_done) { + bxe_grc_dump(sc); + } + if(sc->grcdump_done) { + rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + sc->grcdump_done = 0; + } + + break; + case BXE_RDW_REG: + reg_rdw_p = (bxe_reg_rdw_t *)data; + if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + reg_rdw_p->reg_val = REG_RD(sc, reg_rdw_p->reg_id); + + if((reg_rdw_p->reg_cmd == BXE_WRITE_REG_CMD) && + (reg_rdw_p->reg_access_type == BXE_REG_ACCESS_DIRECT)) + REG_WR(sc, reg_rdw_p->reg_id, reg_rdw_p->reg_val); + + break; + + case BXE_RDW_PCICFG: + cfg_rdw_p = (bxe_pcicfg_rdw_t *)data; + if(cfg_rdw_p->cfg_cmd == BXE_READ_PCICFG) { + + cfg_rdw_p->cfg_val = pci_read_config(sc->dev, cfg_rdw_p->cfg_id, + cfg_rdw_p->cfg_width); + + } else if(cfg_rdw_p->cfg_cmd == BXE_WRITE_PCICFG) { + pci_write_config(sc->dev, cfg_rdw_p->cfg_id, cfg_rdw_p->cfg_val, + cfg_rdw_p->cfg_width); + } else { + BLOGW(sc, "BXE_RDW_PCICFG ioctl wrong cmd passed\n"); + } + break; + + case BXE_MAC_ADDR: + mac_addr_p = (bxe_perm_mac_addr_t *)data; + snprintf(mac_addr_p->mac_addr_str, sizeof(sc->mac_addr_str), "%s", + sc->mac_addr_str); + break; + + case BXE_EEPROM: + rval = bxe_eeprom_rd_wr(sc, (bxe_eeprom_t *)data); + break; + + default: break; } Modified: stable/7/sys/dev/bxe/bxe.h ============================================================================== --- stable/7/sys/dev/bxe/bxe.h Tue Apr 19 19:18:59 2016 (r298290) +++ stable/7/sys/dev/bxe/bxe.h Tue Apr 19 19:22:07 2016 (r298291) @@ -1788,6 +1788,7 @@ struct bxe_softc { struct cdev *ioctl_dev; void *grc_dump; int grcdump_done; + void *eeprom; }; /* struct bxe_softc */ /* IOCTL sub-commands for edebug and firmware upgrade */ @@ -2109,6 +2110,28 @@ static const uint32_t dmae_reg_go_c[] = #define PCI_PM_D0 1 #define PCI_PM_D3hot 2 +#ifndef DUPLEX_UNKNOWN +#define DUPLEX_UNKNOWN (0xff) +#endif + +#ifndef SPEED_UNKNOWN +#define SPEED_UNKNOWN (-1) +#endif + +/* Enable or disable autonegotiation. */ +#define AUTONEG_DISABLE 0x00 +#define AUTONEG_ENABLE 0x01 + +/* Which connector port. */ +#define PORT_TP 0x00 +#define PORT_AUI 0x01 +#define PORT_MII 0x02 +#define PORT_FIBRE 0x03 +#define PORT_BNC 0x04 +#define PORT_DA 0x05 +#define PORT_NONE 0xef +#define PORT_OTHER 0xff + int bxe_test_bit(int nr, volatile unsigned long * addr); void bxe_set_bit(unsigned int nr, volatile unsigned long * addr); void bxe_clear_bit(int nr, volatile unsigned long * addr); Modified: stable/7/sys/dev/bxe/bxe_ioctl.h ============================================================================== --- stable/7/sys/dev/bxe/bxe_ioctl.h Tue Apr 19 19:18:59 2016 (r298290) +++ stable/7/sys/dev/bxe/bxe_ioctl.h Tue Apr 19 19:22:07 2016 (r298291) @@ -42,6 +42,86 @@ struct bxe_grcdump { }; typedef struct bxe_grcdump bxe_grcdump_t; +#define BXE_DRV_NAME_LENGTH 32 +#define BXE_DRV_VERSION_LENGTH 32 +#define BXE_MFW_VERSION_LENGTH 32 +#define BXE_STORMFW_VERSION_LENGTH 32 +#define BXE_BUS_INFO_LENGTH 32 + +struct bxe_drvinfo { + char drv_name[BXE_DRV_NAME_LENGTH]; + char drv_version[BXE_DRV_VERSION_LENGTH]; + char mfw_version[BXE_MFW_VERSION_LENGTH]; + char stormfw_version[BXE_STORMFW_VERSION_LENGTH]; + uint32_t eeprom_dump_len; /* in bytes */ + uint32_t reg_dump_len; /* in bytes */ + char bus_info[BXE_BUS_INFO_LENGTH]; +}; +typedef struct bxe_drvinfo bxe_drvinfo_t; + +struct bxe_dev_setting { + + uint32_t supported; /* Features this interface supports */ + uint32_t advertising;/* Features this interface advertises */ + uint32_t speed; /* The forced speed, 10Mb, 100Mb, gigabit */ + uint32_t duplex; /* Duplex, half or full */ + uint32_t port; /* Which connector port */ + uint32_t phy_address;/* port number*/ + uint32_t autoneg; /* Enable or disable autonegotiation */ +}; +typedef struct bxe_dev_setting bxe_dev_setting_t; + +struct bxe_get_regs { + void *reg_buf; + uint32_t reg_buf_len; +}; +typedef struct bxe_get_regs bxe_get_regs_t; + +#define BXE_EEPROM_MAX_DATA_LEN 524288 + +struct bxe_eeprom { + uint32_t eeprom_cmd; +#define BXE_EEPROM_CMD_SET_EEPROM 0x01 +#define BXE_EEPROM_CMD_GET_EEPROM 0x02 + + void *eeprom_data; + uint32_t eeprom_offset; + uint32_t eeprom_data_len; + uint32_t eeprom_magic; +}; +typedef struct bxe_eeprom bxe_eeprom_t; + +struct bxe_reg_rdw { + uint32_t reg_cmd; +#define BXE_READ_REG_CMD 0x01 +#define BXE_WRITE_REG_CMD 0x02 + + uint32_t reg_id; + uint32_t reg_val; + uint32_t reg_access_type; +#define BXE_REG_ACCESS_DIRECT 0x01 +#define BXE_REG_ACCESS_INDIRECT 0x02 +}; + +typedef struct bxe_reg_rdw bxe_reg_rdw_t; + +struct bxe_pcicfg_rdw { + uint32_t cfg_cmd; +#define BXE_READ_PCICFG 0x01 +#define BXE_WRITE_PCICFG 0x01 + uint32_t cfg_id; + uint32_t cfg_val; + uint32_t cfg_width; +}; + +typedef struct bxe_pcicfg_rdw bxe_pcicfg_rdw_t; + +struct bxe_perm_mac_addr { + char mac_addr_str[32]; +}; + +typedef struct bxe_perm_mac_addr bxe_perm_mac_addr_t; + /* * Read grcdump size @@ -53,5 +133,41 @@ typedef struct bxe_grcdump bxe_grcdump_t */ #define BXE_GRC_DUMP _IOWR('e', 2, bxe_grcdump_t) +/* + * Read driver info + */ +#define BXE_DRV_INFO _IOR('e', 3, bxe_drvinfo_t) + +/* + * Read Device Setting + */ +#define BXE_DEV_SETTING _IOR('e', 4, bxe_dev_setting_t) + +/* + * Get Registers + */ +#define BXE_GET_REGS _IOR('e', 5, bxe_get_regs_t) + +/* + * Get/Set EEPROM + */ +#define BXE_EEPROM _IOWR('e', 6, bxe_eeprom_t) + +/* + * read/write a register + */ +#define BXE_RDW_REG _IOWR('e', 7, bxe_reg_rdw_t) + +/* + * read/write PCIcfg + */ +#define BXE_RDW_PCICFG _IOWR('e', 8, bxe_reg_rdw_t) + +/* + * get permanent mac address + */ + +#define BXE_MAC_ADDR _IOWR('e', 9, bxe_perm_mac_addr_t) + #endif /* #ifndef _QLNX_IOCTL_H_ */ From owner-svn-src-all@freebsd.org Tue Apr 19 19:26:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1735FB14C8F; Tue, 19 Apr 2016 19:26:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDA331053; Tue, 19 Apr 2016 19:26:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F2A0FB9B7; Tue, 19 Apr 2016 15:26:22 -0400 (EDT) From: John Baldwin To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 Date: Tue, 19 Apr 2016 09:16 -0700 Message-ID: <4114217.PtcV9LDMal@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604190446.u3J4kD9G050780@repo.freebsd.org> References: <201604190446.u3J4kD9G050780@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 19 Apr 2016 15:26:23 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:26:24 -0000 On Tuesday, April 19, 2016 04:46:13 AM Marcelo Araujo wrote: > Author: araujo > Date: Tue Apr 19 04:46:13 2016 > New Revision: 298247 > URL: https://svnweb.freebsd.org/changeset/base/298247 > > Log: > Remove redundant parenthesis. > > Submitted by: pfg > MFC after: 2 weeks. For this case, it might be better to remove numentries and use nitems() directly in the one place it is used. I would probably even do this as a for-loop: struct part_type *ptr; int counter; for (counter = 0, ptr = part_types; counter < nitems(part_types); counter++, ptr++) { if (ptr->type == (type & 0x7f)) return (ptr->name); } return ("unknown"); If you renamed 'counter' to 'i' you could probably fit it all on one line. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Apr 19 19:26:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82FC4B14CBA; Tue, 19 Apr 2016 19:26:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59A5F1095; Tue, 19 Apr 2016 19:26:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 56B85B9C5; Tue, 19 Apr 2016 15:26:24 -0400 (EDT) From: John Baldwin To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298243 - head/usr.sbin/bsdinstall/scripts Date: Tue, 19 Apr 2016 09:12:32 -0700 Message-ID: <97483568.HegCXKxvF0@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604190325.u3J3PaNo026464@repo.freebsd.org> References: <201604190325.u3J3PaNo026464@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 19 Apr 2016 15:26:24 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:26:25 -0000 On Tuesday, April 19, 2016 03:25:36 AM Allan Jude wrote: > Author: allanjude > Date: Tue Apr 19 03:25:36 2016 > New Revision: 298243 > URL: https://svnweb.freebsd.org/changeset/base/298243 > > Log: > Add a new installation type to bsdinstall/zfsboot: BIOS+UEFI > > Installs both pmbr+gptzfsboot as well as boot1.efifat in separate partitions > The resulting system can be booted with either UEFI or BIOS/CSM. > Preference is controlled by the user's firmware boot settings. > > This is now the default for zfsboot installs > > PR: 208629 > Submitted by: Galael LAPLANCHE (original version) Any thought about supporting this for UFS as well? -- John Baldwin From owner-svn-src-all@freebsd.org Tue Apr 19 19:26:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1C1AB14C7F; Tue, 19 Apr 2016 19:26:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0BA7104C; Tue, 19 Apr 2016 19:26:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BE3B2B9B2; Tue, 19 Apr 2016 15:26:21 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: Allan Jude , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... Date: Tue, 19 Apr 2016 09:26:41 -0700 Message-ID: <1769146.f6cP0aQdA7@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160419160500.GY2422@kib.kiev.ua> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <5716538B.4060108@freebsd.org> <20160419160500.GY2422@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 19 Apr 2016 15:26:21 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:26:22 -0000 On Tuesday, April 19, 2016 07:05:00 PM Konstantin Belousov wrote: > On Tue, Apr 19, 2016 at 11:49:31AM -0400, Allan Jude wrote: > > On 2016-04-19 05:30, Konstantin Belousov wrote: > > > On Mon, Apr 18, 2016 at 07:43:04PM -0400, Allan Jude wrote: > > >> On 2016-04-18 19:36, Adrian Chadd wrote: > > >>> Someone pointed out how this bloats out memory requirement in loader. > > >>> > > >>> Did anyone check that? > > >>> > > >>> -adrian > > >>> > > >> > > >> I tested down to 128mb of ram in QEMU, booted from the installer ISO, > > >> did the install, and booted the installed system without issue. > > > > > > 64MB is^H^H was very much useful and workable i386 config. i386 kernel > > > does fit into the 32M but current automatic tuning prevents usermode > > > from operating. Little manual tuning make 32M on tolerable. > > > > > > Making loader require 64M is a regression. At very least, it is > > > impossible to test low mem configs anymore. > > > > > > > Would a src.conf knob make sense, to use a smaller value when targeting > > small systems, while keeping the advantages when using more reasonable > > systems? > > > > Or we could make these changes to the HEAP and bcache size specific to > > 64bit platforms? > I do not consider neither the current state, nor the two proposed > changes, acceptable. Loader is same on 32 and 64 bit x86 machines, so > how would you reconfigure it on 64bit machine ? Non-default knob is too > obscure and hard to communicate, people would try to use 32M and see > that it breaks, just abandoning the idea of trying. > > Either default-built loader should size itself dynamically based on the > available memory, perhaps capping heap at 64MB starting from the 128MB > configs, or, assuming that we consider 32MB be the absolute minimal > workable config, loader could set HEAP to 8MB. > > Dynamic heap size is theoretically best, but it might be hard to do > if memory map is retrieved after heap is configured (I do not know). We retreive the memory map first and parse the SMAP to pick the best "spot" for the heap. (We prefer to put it "away" from the location where we load the kernel + modules.) Choosing a dynamic size for the heap should be quite doable. Fixing libstand's malloc() to try to "grow" when necessary would be nice for the EFI case as well, but that is a larger change. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Apr 19 20:01:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D3FB0A9F2; Tue, 19 Apr 2016 20:01:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20F051E20; Tue, 19 Apr 2016 20:01:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22f.google.com with SMTP id gy3so21431427igb.1; Tue, 19 Apr 2016 13:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=1/66NYteWMbTavLcVrdcYD3IQrKLQhQz1Em1S/hMxRE=; b=LT4/AftcmLeYgvjuBwPrWOUI8fnsjiE1vBcYJljJp8NpHqy+Yq8sUC91TuS8dhomN8 Rnw2L9M3JwNelL1g2DsAg7X6hd2xDsQEofiGiil5nom1IHfAe4f1v5WFnc783bpsYlMd AsCC1PhxQvWuiaZfPWJ6xKZUmewb3GoXFUw8UV47W02Yg0bWY95kndUYRtnWXev8GWxu eQr1TFuWWijmcRovAroyYFN+ZZycwX2r4rUmhWeiBv21beL5l8XECFtcKp29WS1Q0+Qr TYuzL5i4OSoUnSK1xPopEup/63Gf4Nkgd2VJrZDcHgHYDeuo46SioJBtk/fJCOXTGbYL V1SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=1/66NYteWMbTavLcVrdcYD3IQrKLQhQz1Em1S/hMxRE=; b=dT2XW5LPJ3CmKL93pl+/83O3q/vS9cGjqgffEcptZvD7PPD3UqEDV1ynY5Nthqgpju N4ceRL0byDtFzsJYgMdO9VVUnSAwifFvQWxibIAmjHlpWZEy1ZwQxQ2aqPmspaDR71UY 4neJJqKSZgfiNFA+pMzjDtpvDqigtk4K5g1IrFZMpXNgBn/emgOOe1fSCeWfoxKEfsjr DcA3C5SdWqFEJVt0YQlPS7nznQMDtMdCMUPrX2nSx8MlnxEaZDk0Wp7G8mEAPunIZQjE IKJP40bMqCLGhfqH/+HTxGyd9H/RR23qlKqsjHDMguynC3yI6DwM3+GMjQ+DBoey/ZQ6 vKqw== X-Gm-Message-State: AOPr4FXNjxApgTtZ5LDpHINsy7QnoAUN7PS9o0Kn3Lajan3ks4Q9iAeXO/1nU2LCY/F0v0CT4ZdqOGfpt6zNBg== MIME-Version: 1.0 X-Received: by 10.50.180.202 with SMTP id dq10mr6067241igc.37.1461096115282; Tue, 19 Apr 2016 13:01:55 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Tue, 19 Apr 2016 13:01:55 -0700 (PDT) In-Reply-To: References: <201604191539.u3JFdkHx048678@repo.freebsd.org> Date: Tue, 19 Apr 2016 13:01:55 -0700 Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Adrian Chadd To: Luiz Otavio O Souza Cc: Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:01:56 -0000 damn, how'd this never get committed to -HEAD? -a On 19 April 2016 at 10:11, Luiz Otavio O Souza wrote: > On Tue, Apr 19, 2016 at 1:40 PM, Adrian Chadd wrote: >> Hm, why'd you do this? did you get it reviewed first? >> >> I'm about to write a kernel bitbang SPI driver that supports arbitrary >> GPIOs, and I was thinking of fleshing this out somewhat. > > Hi Adrian, > > ray@ wrote one for zrouter, it needs some cleanup (maybe some FDT bits > and variable word length) but it is well tested. > > About this commit, yeah, very few hardware support the direct control > of the CS pin. > > Luiz From owner-svn-src-all@freebsd.org Tue Apr 19 20:12:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60392B140A0; Tue, 19 Apr 2016 20:12:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DC261A90; Tue, 19 Apr 2016 20:12:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JKCkOX033740; Tue, 19 Apr 2016 20:12:46 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JKCkE0033739; Tue, 19 Apr 2016 20:12:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604192012.u3JKCkE0033739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 20:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298292 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:12:47 -0000 Author: pfg Date: Tue Apr 19 20:12:46 2016 New Revision: 298292 URL: https://svnweb.freebsd.org/changeset/base/298292 Log: rtld-elf: use our roundup2() macro when param.h is available. Modified: head/libexec/rtld-elf/malloc.c Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Tue Apr 19 19:22:07 2016 (r298291) +++ head/libexec/rtld-elf/malloc.c Tue Apr 19 20:12:46 2016 (r298292) @@ -224,7 +224,7 @@ malloc(nbytes) * Record allocated size of block and * bound space with magic numbers. */ - op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); + op->ov_size = roundup2(nbytes, RSLOP); op->ov_rmagic = RMAGIC; *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; #endif @@ -388,7 +388,7 @@ realloc(cp, nbytes) } if (nbytes <= onb && nbytes > (size_t)i) { #ifdef RCHECK - op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); + op->ov_size = roundup2(nbytes, RSLOP); *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; #endif return(cp); From owner-svn-src-all@freebsd.org Tue Apr 19 20:17:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 536A7B14448 for ; Tue, 19 Apr 2016 20:17:29 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17BE1105C for ; Tue, 19 Apr 2016 20:17:29 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: by mail-ig0-x22a.google.com with SMTP id gy3so110347270igb.0 for ; Tue, 19 Apr 2016 13:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clockworksquid.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=skWIM2XNlCULk/IOXLLVauVcyK/4CIU/NiJgucFLybM=; b=RczozftpEGWL5clBtcAr0b4FeN8oCPvdDhg8Bv02de3Y2RK3/nrUwl8h3VUy9JWD5B XrPqNzoJPur+9psfOhC/t6AItk7QMXwaeWTZ0aYwRRpBbes/cEPsTdTWoNaDO4iwU7Wz VVjWfzpN1cE3XPTbVBR5sBZk13j8zClBMpDEI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=skWIM2XNlCULk/IOXLLVauVcyK/4CIU/NiJgucFLybM=; b=DZDA76R6VuwXCdcEUSZ/MqYNJip9xdSezGR0PEAz9QbpRcgyqjkv4oJY3ZElcwOWDr B8b1+tfNEebCSYTnrRc4NKWvnvX11USC0O2IouRCUgrA58CqFWk8mtQ1reCeYmo0SeFB hg9xOpIZ/KW8+HFOHn5f2YY7+wv5YDsCkZ1QiEUF+dC2fzktuK7DYc+kzILaZQ8SOeBq 9ElDvPFVVsXaOB2czsSxZGPeXM+ByuSLzAN7H4PLngtATALsU4mYS8VK79J1ITZBWpUt cxKYsFza4GoMqp9EfSq89QdtHrg4gBkrgEyy7Rs8sAvSSs+bqyU+uIouAD+42RPW2M3L B3Vw== X-Gm-Message-State: AOPr4FVeO+lJt6hvH2RapnObCNWSOtKKD5lf3Ksbx4lIs6hEAb3bevvvF93iucji65YezfB6xgzL2SGG12f/3g== X-Received: by 10.50.10.166 with SMTP id j6mr6025367igb.28.1461097048154; Tue, 19 Apr 2016 13:17:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.15.66 with HTTP; Tue, 19 Apr 2016 13:17:08 -0700 (PDT) In-Reply-To: <20160419171243.GA30453@bsdpad.com> References: <201604191539.u3JFdkHx048678@repo.freebsd.org> <20160419171243.GA30453@bsdpad.com> From: Juli Mallett Date: Tue, 19 Apr 2016 13:17:08 -0700 Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus To: Ruslan Bukin Cc: Adrian Chadd , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Patrick Kelsey Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:17:29 -0000 Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody seemed interested. I know of one proprietary branch of FreeBSD using it. You might poke him if you want to know how he dealt with this, and if you want to commit his driver. On Tue, Apr 19, 2016 at 10:12 AM, Ruslan Bukin wrote: > Why I added or why I reverted ? > So once I started to work on generic MMC over SPI driver it was looking like > MMC/SD device in harware requires to keep CS asserted during multiple transfers, > but once I completed it is become clear hardware don't require that. > > Ruslan > > On Tue, Apr 19, 2016 at 09:40:23AM -0700, Adrian Chadd wrote: >> Hm, why'd you do this? did you get it reviewed first? >> >> I'm about to write a kernel bitbang SPI driver that supports arbitrary >> GPIOs, and I was thinking of fleshing this out somewhat. >> >> >> >> -adrian >> >> >> On 19 April 2016 at 08:39, Ruslan Bukin wrote: >> > Author: br >> > Date: Tue Apr 19 15:39:46 2016 >> > New Revision: 298274 >> > URL: https://svnweb.freebsd.org/changeset/base/298274 >> > >> > Log: >> > Revert r298268 (Add optional chip_select/deselect methods). >> > None of supported hardware do require that. >> > >> > Modified: >> > head/sys/dev/spibus/spibus.c >> > head/sys/dev/spibus/spibus_if.m >> > >> > Modified: head/sys/dev/spibus/spibus.c >> > ============================================================================== >> > --- head/sys/dev/spibus/spibus.c Tue Apr 19 15:36:18 2016 (r298273) >> > +++ head/sys/dev/spibus/spibus.c Tue Apr 19 15:39:46 2016 (r298274) >> > @@ -185,24 +185,9 @@ spibus_hinted_child(device_t bus, const >> > static int >> > spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd) >> > { >> > - >> > return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd)); >> > } >> > >> > -static int >> > -spibus_chip_select_impl(device_t dev, device_t child) >> > -{ >> > - >> > - return (SPIBUS_CHIP_SELECT(device_get_parent(dev), child)); >> > -} >> > - >> > -static int >> > -spibus_chip_deselect_impl(device_t dev, device_t child) >> > -{ >> > - >> > - return (SPIBUS_CHIP_DESELECT(device_get_parent(dev), child)); >> > -} >> > - >> > static device_method_t spibus_methods[] = { >> > /* Device interface */ >> > DEVMETHOD(device_probe, spibus_probe), >> > @@ -223,8 +208,6 @@ static device_method_t spibus_methods[] >> > >> > /* spibus interface */ >> > DEVMETHOD(spibus_transfer, spibus_transfer_impl), >> > - DEVMETHOD(spibus_chip_select, spibus_chip_select_impl), >> > - DEVMETHOD(spibus_chip_deselect, spibus_chip_deselect_impl), >> > >> > DEVMETHOD_END >> > }; >> > >> > Modified: head/sys/dev/spibus/spibus_if.m >> > ============================================================================== >> > --- head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:36:18 2016 (r298273) >> > +++ head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:39:46 2016 (r298274) >> > @@ -39,19 +39,3 @@ METHOD int transfer { >> > device_t child; >> > struct spi_command *cmd; >> > }; >> > - >> > -# >> > -# Assert chip select >> > -# >> > -METHOD int chip_select { >> > - device_t dev; >> > - device_t child; >> > -}; >> > - >> > -# >> > -# Deassert chip select >> > -# >> > -METHOD int chip_deselect { >> > - device_t dev; >> > - device_t child; >> > -}; >> > >> > From owner-svn-src-all@freebsd.org Tue Apr 19 20:19:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38773B14543; Tue, 19 Apr 2016 20:19:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 062001300; Tue, 19 Apr 2016 20:19:22 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JKJMvD034074; Tue, 19 Apr 2016 20:19:22 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JKJMKD034073; Tue, 19 Apr 2016 20:19:22 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604192019.u3JKJMKD034073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 19 Apr 2016 20:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298293 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:19:23 -0000 Author: avos Date: Tue Apr 19 20:19:21 2016 New Revision: 298293 URL: https://svnweb.freebsd.org/changeset/base/298293 Log: net80211: do not reschedule scan_curchan_task() if the scan was canceled. This should fix possible use-after-free in the scheduled task. PR: 208605 Modified: head/sys/net80211/ieee80211_scan_sw.c Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Tue Apr 19 20:12:46 2016 (r298292) +++ head/sys/net80211/ieee80211_scan_sw.c Tue Apr 19 20:19:21 2016 (r298293) @@ -736,8 +736,11 @@ end: /* clear mindwell lock and initial channel change flush */ ss_priv->ss_iflags &= ~ISCAN_REP; - if (ss_priv->ss_iflags & (ISCAN_CANCEL|ISCAN_ABORT)) + if (ss_priv->ss_iflags & (ISCAN_CANCEL|ISCAN_ABORT)) { + taskqueue_cancel_timeout(ic->ic_tq, &ss_priv->ss_scan_curchan, + NULL); goto end; + } IEEE80211_DPRINTF(ss->ss_vap, IEEE80211_MSG_SCAN, "%s: waiting\n", __func__); From owner-svn-src-all@freebsd.org Tue Apr 19 20:21:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0B3AB147C8 for ; Tue, 19 Apr 2016 20:21:23 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66D0F17DE for ; Tue, 19 Apr 2016 20:21:23 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 403ba7bc-066c-11e6-b8f9-33a5b3560672 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 19 Apr 2016 20:21:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u3JKLK5D036738; Tue, 19 Apr 2016 14:21:20 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1461097280.1232.34.camel@freebsd.org> Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Ian Lepore To: Juli Mallett Cc: Adrian Chadd , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Patrick Kelsey Date: Tue, 19 Apr 2016 14:21:20 -0600 In-Reply-To: References: <201604191539.u3JFdkHx048678@repo.freebsd.org> <20160419171243.GA30453@bsdpad.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:21:23 -0000 On Tue, 2016-04-19 at 13:17 -0700, Juli Mallett wrote: > Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody > seemed > interested. I know of one proprietary branch of FreeBSD using it. > You might poke him if you want to know how he dealt with this, and if > you want to commit his driver. > Patrick is a committer, maybe he should just commit it. :) -- Ian From owner-svn-src-all@freebsd.org Tue Apr 19 20:28:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ABC4B14B43; Tue, 19 Apr 2016 20:28:32 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AE161EE2; Tue, 19 Apr 2016 20:28:32 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JKSVBs037126; Tue, 19 Apr 2016 20:28:31 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JKSVFA037123; Tue, 19 Apr 2016 20:28:31 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604192028.u3JKSVFA037123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Apr 2016 20:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298294 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:28:32 -0000 Author: davidcs Date: Tue Apr 19 20:28:30 2016 New Revision: 298294 URL: https://svnweb.freebsd.org/changeset/base/298294 Log: 1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocated and freed on as needed basis. 2. grcdump can be taken at failure points by invoking bxe_grc_dump() when trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done sysctl flag is set. 3. grcdump_done can be monitored by the user to retrieve the grcdump. Submitted by:vaishali.kulkarni@qlogic.com Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue Apr 19 20:19:21 2016 (r298293) +++ head/sys/dev/bxe/bxe.c Tue Apr 19 20:28:30 2016 (r298294) @@ -672,7 +672,6 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct bxe_softc *sc); static int bxe_alloc_buf_rings(struct bxe_softc *sc); static void bxe_free_buf_rings(struct bxe_softc *sc); @@ -3449,6 +3448,10 @@ bxe_watchdog(struct bxe_softc *sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } BXE_FP_TX_UNLOCK(fp); @@ -15637,30 +15640,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } static int -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS) -{ - struct bxe_softc *sc; - int error, result; - - result = 0; - error = sysctl_handle_int(oidp, &result, 0, req); - - if (error || !req->newptr) { - return (error); - } - - if (result == 1) { - sc = (struct bxe_softc *)arg1; - - BLOGI(sc, "... grcdump start ...\n"); - bxe_grc_dump(sc); - BLOGI(sc, "... grcdump done ...\n"); - } - - return (error); -} - -static int bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS) { struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15811,14 +15790,16 @@ bxe_add_sysctls(struct bxe_softc *sc) "debug logging mode"); #endif /* #if __FreeBSD_version >= 900000 */ - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, - bxe_sysctl_trigger_grcdump, "IU", - "set by driver when a grcdump is needed"); + sc->trigger_grcdump = 0; + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", + CTLFLAG_RW, &sc->trigger_grcdump, 0, + "trigger grcdump should be invoked" + " before collecting grcdump"); + sc->grcdump_started = 0; sc->grcdump_done = 0; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done", - CTLFLAG_RW, &sc->grcdump_done, 0, + CTLFLAG_RD, &sc->grcdump_done, 0, "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; @@ -18650,7 +18631,7 @@ bxe_get_preset_regs(struct bxe_softc *sc return 0; } -static int +int bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; @@ -18658,12 +18639,53 @@ bxe_grc_dump(struct bxe_softc *sc) uint8_t *buf; uint32_t size; struct dump_header *d_hdr; + uint32_t i; + uint32_t reg_val; + uint32_t reg_addr; + uint32_t cmd_offset; + int context_size; + int allocated; + struct ecore_ilt *ilt = SC_ILT(sc); + struct bxe_fastpath *fp; + struct ilt_client_info *ilt_cli; + int grc_dump_size; - if (sc->grcdump_done) + + if (sc->grcdump_done || sc->grcdump_started) return (rval); + sc->grcdump_started = 1; + BLOGI(sc, "Started collecting grcdump\n"); + + grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + + sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); + + if (sc->grc_dump == NULL) { + BLOGW(sc, "Unable to allocate memory for grcdump collection\n"); + return(ENOMEM); + } + + + + /* Disable parity attentions as long as following dump may + * cause false alarms by reading never written registers. We + * will re-enable parity attentions right after the dump. + */ + + /* Disable parity on path 0 */ + bxe_pretend_func(sc, 0); + ecore_disable_blocks_parity(sc); + /* Disable parity on path 1 */ + bxe_pretend_func(sc, 1); + ecore_disable_blocks_parity(sc); + + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + buf = sc->grc_dump; d_hdr = sc->grc_dump; @@ -18695,7 +18717,7 @@ bxe_grc_dump(struct bxe_softc *sc) (preset_idx == 11)) continue; - rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); + rval = bxe_get_preset_regs(sc, (uint32_t *)buf, preset_idx); if (rval) break; @@ -18705,9 +18727,81 @@ bxe_grc_dump(struct bxe_softc *sc) buf += size; } + bxe_pretend_func(sc, 0); + ecore_clear_blocks_parity(sc); + ecore_enable_blocks_parity(sc); + + bxe_pretend_func(sc, 1); ecore_clear_blocks_parity(sc); ecore_enable_blocks_parity(sc); + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + + + context_size = (sizeof(union cdu_context) * BXE_L2_CID_COUNT(sc)); + for (i = 0, allocated = 0; allocated < context_size; i++) { + + BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)sc->context[i].vcxt_dma.paddr, + sc->context[i].vcxt_dma.vaddr, + sc->context[i].size); + allocated += sc->context[i].size; + } + BLOGI(sc, "fw stats start_paddr %#jx end_paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->fw_stats_req_mapping, + (uintmax_t)sc->fw_stats_data_mapping, + sc->fw_stats_req, (sc->fw_stats_req_size + sc->fw_stats_data_size)); + BLOGI(sc, "def_status_block paddr %p vaddr %p size 0x%zx\n", + (void *)sc->def_sb_dma.paddr, sc->def_sb, + sizeof(struct host_sp_status_block)); + BLOGI(sc, "event_queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%zx\n", + (uintmax_t)sc->sp_dma.paddr, sc->sp_dma.vaddr, + sizeof(struct bxe_slowpath)); + BLOGI(sc, "slow path queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->spq_dma.paddr, sc->spq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "fw_buf paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->gz_buf_dma.paddr, sc->gz_buf_dma.vaddr, + FW_BUF_SIZE); + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->sb_dma.paddr, fp->sb_dma.vaddr, + sizeof(union bxe_host_hc_status_block)); + BLOGI(sc, "TX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->tx_dma.paddr, fp->tx_dma.vaddr, + (BCM_PAGE_SIZE * TX_BD_NUM_PAGES)); + BLOGI(sc, "RX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_dma.paddr, fp->rx_dma.vaddr, + (BCM_PAGE_SIZE * RX_BD_NUM_PAGES)); + BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->rcq_dma.paddr, fp->rcq_dma.vaddr, + (BCM_PAGE_SIZE * RCQ_NUM_PAGES)); + BLOGI(sc, "RX SGE CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_sge_dma.paddr, fp->rx_sge_dma.vaddr, + (BCM_PAGE_SIZE * RX_SGE_NUM_PAGES)); + } + + ilt_cli = &ilt->clients[1]; + for (i = ilt_cli->start; i <= ilt_cli->end; i++) { + BLOGI(sc, "ECORE_ILT paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)(((struct bxe_dma *)((&ilt->lines[i])->page))->paddr), + ((struct bxe_dma *)((&ilt->lines[i])->page))->vaddr, BCM_PAGE_SIZE); + } + + + cmd_offset = DMAE_REG_CMD_MEM; + for (i = 0; i < 224; i++) { + reg_addr = (cmd_offset +(i * 4)); + reg_val = REG_RD(sc, reg_addr); + BLOGI(sc, "DMAE_REG_CMD_MEM i=%d reg_addr 0x%x reg_val 0x%08x\n",i, + reg_addr, reg_val); + } + + + BLOGI(sc, "Collection of grcdump done\n"); sc->grcdump_done = 1; return(rval); } @@ -18715,21 +18809,10 @@ bxe_grc_dump(struct bxe_softc *sc) static int bxe_add_cdev(struct bxe_softc *sc) { - int grc_dump_size; - - grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); - - sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); - - if (sc->grc_dump == NULL) - return (-1); - sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); if (sc->eeprom == NULL) { BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); - free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; return (-1); } @@ -18742,11 +18825,8 @@ bxe_add_cdev(struct bxe_softc *sc) if_name(sc->ifp)); if (sc->ioctl_dev == NULL) { - - free(sc->grc_dump, M_DEVBUF); free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; - return (-1); } @@ -18761,13 +18841,11 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump != NULL) - free(sc->grc_dump, M_DEVBUF); - if (sc->eeprom != NULL) { free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; } + sc->ioctl_dev = NULL; return; } @@ -18945,15 +19023,26 @@ bxe_eioctl(struct cdev *dev, u_long cmd, grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + sizeof(struct dump_header); - - if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || - (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { + if ((!sc->trigger_grcdump) || (dump->grcdump == NULL) || + (dump->grcdump_size < grc_dump_size)) { rval = EINVAL; break; } - dump->grcdump_dwords = grc_dump_size >> 2; - rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); - sc->grcdump_done = 0; + + if((sc->trigger_grcdump) && (!sc->grcdump_done) && + (!sc->grcdump_started)) { + rval = bxe_grc_dump(sc); + } + + if((!rval) && (sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { + dump->grcdump_dwords = grc_dump_size >> 2; + rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; + sc->grcdump_done = 0; + } break; @@ -18973,6 +19062,7 @@ bxe_eioctl(struct cdev *dev, u_long cmd, snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", sc->pcie_bus, sc->pcie_device, sc->pcie_func); break; + case BXE_DEV_SETTING: dev_p = (bxe_dev_setting_t *)data; bxe_get_settings(sc, &dev_set); @@ -18991,20 +19081,20 @@ bxe_eioctl(struct cdev *dev, u_long cmd, reg_p = (bxe_get_regs_t *)data; grc_dump_size = reg_p->reg_buf_len; - if (sc->grc_dump == NULL) { - rval = EINVAL; - break; - } - - if(!sc->grcdump_done) { + if((!sc->grcdump_done) && (!sc->grcdump_started)) { bxe_grc_dump(sc); } - if(sc->grcdump_done) { + if((sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; sc->grcdump_done = 0; } break; + case BXE_RDW_REG: reg_rdw_p = (bxe_reg_rdw_t *)data; if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Tue Apr 19 20:19:21 2016 (r298293) +++ head/sys/dev/bxe/bxe.h Tue Apr 19 20:28:30 2016 (r298294) @@ -1786,8 +1786,12 @@ struct bxe_softc { int panic; struct cdev *ioctl_dev; + void *grc_dump; - int grcdump_done; + unsigned int trigger_grcdump; + unsigned int grcdump_done; + unsigned int grcdump_started; + void *eeprom; }; /* struct bxe_softc */ @@ -2293,7 +2297,7 @@ void bxe_dump_mem(struct bxe_softc *sc, uint8_t *mem, uint32_t len); void bxe_dump_mbuf_data(struct bxe_softc *sc, char *pTag, struct mbuf *m, uint8_t contents); - +extern int bxe_grc_dump(struct bxe_softc *sc); #if __FreeBSD_version >= 800000 #if __FreeBSD_version >= 1000000 Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Tue Apr 19 20:19:21 2016 (r298293) +++ head/sys/dev/bxe/bxe_stats.c Tue Apr 19 20:28:30 2016 (r298294) @@ -234,6 +234,10 @@ bxe_stats_comp(struct bxe_softc *sc) while (*stats_comp != DMAE_COMP_VAL) { if (!cnt) { BLOGE(sc, "Timeout waiting for stats finished\n"); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } break; } @@ -1310,8 +1314,12 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } + atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); } } return; From owner-svn-src-all@freebsd.org Tue Apr 19 20:29:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2BAB14D2E; Tue, 19 Apr 2016 20:29:46 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD6FE10EE; Tue, 19 Apr 2016 20:29:46 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from aurora.physics.berkeley.edu (aurora.physics.berkeley.edu [128.32.117.67]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u3JKTdnt016680 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 19 Apr 2016 13:29:39 -0700 Subject: Re: svn commit: r298243 - head/usr.sbin/bsdinstall/scripts To: John Baldwin , Allan Jude References: <201604190325.u3J3PaNo026464@repo.freebsd.org> <97483568.HegCXKxvF0@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <57169533.3020908@freebsd.org> Date: Tue, 19 Apr 2016 13:29:39 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <97483568.HegCXKxvF0@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbj2oTUnVnqSCrfZOs+OvBGlpQMSOTRbll0tcxRVvR0qxCdcVxADNImivB+lFa26QUj21RdEXjizZHDmFvfeAKu7PnWpT1BWRs= X-Sonic-ID: C;7MWfcG0G5hGNU7eqjlfmnQ== M;ftbecG0G5hGNU7eqjlfmnQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:29:46 -0000 On 04/19/16 09:12, John Baldwin wrote: > On Tuesday, April 19, 2016 03:25:36 AM Allan Jude wrote: >> Author: allanjude >> Date: Tue Apr 19 03:25:36 2016 >> New Revision: 298243 >> URL: https://svnweb.freebsd.org/changeset/base/298243 >> >> Log: >> Add a new installation type to bsdinstall/zfsboot: BIOS+UEFI >> >> Installs both pmbr+gptzfsboot as well as boot1.efifat in separate partitions >> The resulting system can be booted with either UEFI or BIOS/CSM. >> Preference is controlled by the user's firmware boot settings. >> >> This is now the default for zfsboot installs >> >> PR: 208629 >> Submitted by: Galael LAPLANCHE (original version) > Any thought about supporting this for UFS as well? > It would be pretty easy just to set that up by default. I'm happy to add that this weekend if you think it would be useful. -Nathan From owner-svn-src-all@freebsd.org Tue Apr 19 20:37:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1036B15249; Tue, 19 Apr 2016 20:37:31 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-yw0-x22d.google.com (mail-yw0-x22d.google.com [IPv6:2607:f8b0:4002:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D5961AAD; Tue, 19 Apr 2016 20:37:31 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-yw0-x22d.google.com with SMTP id t10so31546377ywa.0; Tue, 19 Apr 2016 13:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=mZWZbpPfx9j2MxNOxdoBXMzZHbr+E3sv8a0G/aMGkbI=; b=Re/8HahoH2zOb4M+YHAN18P/VrQi+kwuS8nKYe04MoHaNXCdfbK60jB8jaeMiIkk+3 4Zx8smOeOI/SALrZn+Lj8txpnh1gKjZdQ/p5pCfiWVg1LrqhB6BottbLFXukzON4kB0e F2iuXKfrMKBZOHU2pS4D4YYs1zjz6wb+mNketK4fYHXcM9BlT5JQUy2BhATUGStzTY2G egUoQC9XpJILg6cntL+PsGtY4+n9uujKUAS0ax2KMGfSXbYMaiHIWRPgzfvUanyOl/cs q/jc/NMTlED74wt62y4P3bim2LcMf0VSbi9+J1NraJS2tFN9fxINktXzP4Bagl5WZzyV CIgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=mZWZbpPfx9j2MxNOxdoBXMzZHbr+E3sv8a0G/aMGkbI=; b=ZeF3MnNVtPw7Yagr1msLfiorqVdhrke16vthepRiOZhllTDGd+vs97sU3bt+KKP79P N+RvpV/8mgV5mmy/LapQvtIM3/5u2OPvHER3oQYzzL5p+9vTuycBzeSZe/riWt9nWLA0 uZsWRow2GehejKMaPC1+Z2MGJzifA4s992z3rpaU1UD4kY5DK+csmWEnNPIwi7M+raNe 5cQmonqB6f//vIVxGG+sdLQjXA5sMhW7UkNEfBPN6yY9jqIq39gDjmfVfuvmFhp7gEFp UlEVzWe1CKLvl1xzcqZZCPalXSYzY/W3ZjllajavkBVxNyv15zKqWok8eXST/moKaS6p ew4g== X-Gm-Message-State: AOPr4FV8thzMpOUzmY9sFYK18Gt68yOSiliqs3I1/drNCUWWfmFu45RWANOiqVDzu44KfWFFgoI1/whUvMp49w== MIME-Version: 1.0 X-Received: by 10.37.87.135 with SMTP id l129mr3131387ybb.7.1461098250809; Tue, 19 Apr 2016 13:37:30 -0700 (PDT) Sender: pkelsey@gmail.com Received: by 10.129.27.14 with HTTP; Tue, 19 Apr 2016 13:37:30 -0700 (PDT) In-Reply-To: <1461097280.1232.34.camel@freebsd.org> References: <201604191539.u3JFdkHx048678@repo.freebsd.org> <20160419171243.GA30453@bsdpad.com> <1461097280.1232.34.camel@freebsd.org> Date: Tue, 19 Apr 2016 16:37:30 -0400 X-Google-Sender-Auth: FubPsHy14OrE9nXwLbLsnZpRrTw Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Patrick Kelsey To: Ian Lepore Cc: Juli Mallett , Adrian Chadd , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:37:32 -0000 On Tue, Apr 19, 2016 at 4:21 PM, Ian Lepore wrote: > On Tue, 2016-04-19 at 13:17 -0700, Juli Mallett wrote: > > Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody > > seemed > > interested. I know of one proprietary branch of FreeBSD using it. > > You might poke him if you want to know how he dealt with this, and if > > you want to commit his driver. > > > > Patrick is a committer, maybe he should just commit it. :) > What I believe originally held up that driver being committed (by others - this was before my commit bit) was that I relied on some out-of-tree spibus changes Luiz had made (as I recall, mainly being able to reserve the SPI bus for multiple transactions), and getting those into the tree would have required updating/testing other existing SPI drivers, based on feedback I received at the time. All I had was the RB450G that I developed and tested the driver with, so I really couldn't address that issue, and then work took me in some other direction entirely. Some or all of these spibus changes that I relied on might now be in the tree, I'm not sure offhand. I am sure though that a huge stack of other things I need to get through has chronically kept me from updating that driver to current and retesting. When I wrote that driver, I put a lot of effort into testing it against as many different cards as I could obtain at the time - I believe 30 or so in total, all the details are in the code that was posted to the list back then. I encountered a number of strange/unexpected behaviors in that set of cards, and all of that hard-won knowledge is in that driver, including a much less complex fix for a shifted-response-data issue than you will see if you look at the Linux mmcpsi driver (as I recall, the Linux driver has code to arbitrarily bit-shift card response data, and to detect when that should be done, but it turns out that can be avoided entirely by inserting idle cycles in the right place when sending the command). -Patrick From owner-svn-src-all@freebsd.org Tue Apr 19 20:37:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43330B15277; Tue, 19 Apr 2016 20:37:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 096B51ACE; Tue, 19 Apr 2016 20:37:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id f89so20393737ioi.0; Tue, 19 Apr 2016 13:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=/Wgy7PFQPp6BeGGjNafbAp6t5a8ou+OEKA4AkiXqTuY=; b=uE6es/xcp5au8uXdkJKDKaDGCt7262mfs/ZD+Am3Q068/sX9X3h4rjwL7HaiYwkj1T qhAnaJmlhwzro4WL0ES4PoDj6CRK7bPY+OW6kjOjpwoTtyWVNO9w4IHTOtgJ33eMMsxs B5o7SpiiVMb5GIju3I108uQRxXG+VdaqWXJoB+ua+93OlKnzsGvYlit2YJC07ZSb76bX LhOk94eI9LxLBriamPDSN9IQUJ35PEW17C0BkawoJmhUYEgIVVQHxXYTz7AytiFEjBpR XbNtQ9I8CgpNB65IqX2I0I0zgjfQPTLWgyJYs+cWlSsV56OBn+IeFlDsmMuryTitK6n5 DKqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=/Wgy7PFQPp6BeGGjNafbAp6t5a8ou+OEKA4AkiXqTuY=; b=GCCE/xYqMKKpIDAeSEc2YDPBnzeo/nbDYxlqh1YRU9RJDSJxuoSDjw/MsuetmeBgYL zv9en2XW/N5avqWsNFKpiUxaBFAxZvfM1W1eCN9M2e33TaqsIZXfN6C2GdwFHoLYrpae hnLmGrhJU1ajRzfVId0ztuyXDtp2wGqn6HH7nnYKIStN3Qex19tlsuzrNsm1lTLceuyW bFSfqVA9l7PdcpsSFUvrY4/1G0jqix3/dN+fql2S1HAaW9BOhu1mVjIWGuYzeWBemOdq rKtm4m8meybNMf6tHLSMfvEukZ8OkaScfQpxh/cSZoJFXCisfIaRglSuBIek2ixfuj24 bMWQ== X-Gm-Message-State: AOPr4FX0iLEPNXeHacXY/BXS+oNX42+Veg9q1Zs6WpkJ7BawtkopXItIncP8wTZul+LcyI35Bm/6swPjMm7+RA== MIME-Version: 1.0 X-Received: by 10.107.19.42 with SMTP id b42mr5767725ioj.75.1461098255577; Tue, 19 Apr 2016 13:37:35 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Tue, 19 Apr 2016 13:37:35 -0700 (PDT) In-Reply-To: <1461097280.1232.34.camel@freebsd.org> References: <201604191539.u3JFdkHx048678@repo.freebsd.org> <20160419171243.GA30453@bsdpad.com> <1461097280.1232.34.camel@freebsd.org> Date: Tue, 19 Apr 2016 13:37:35 -0700 Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Adrian Chadd To: Ian Lepore Cc: Juli Mallett , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Patrick Kelsey Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:37:36 -0000 I'll bug patrick privately. :) -a On 19 April 2016 at 13:21, Ian Lepore wrote: > On Tue, 2016-04-19 at 13:17 -0700, Juli Mallett wrote: >> Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody >> seemed >> interested. I know of one proprietary branch of FreeBSD using it. >> You might poke him if you want to know how he dealt with this, and if >> you want to commit his driver. >> > > Patrick is a committer, maybe he should just commit it. :) > > -- Ian > From owner-svn-src-all@freebsd.org Tue Apr 19 20:37:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E358AB152C4 for ; Tue, 19 Apr 2016 20:37:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B00FD1DBF for ; Tue, 19 Apr 2016 20:37:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ig0-x22c.google.com with SMTP id m9so19914960ige.1 for ; Tue, 19 Apr 2016 13:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=OXvP36yruqOx+CW8x7VzJkJbYTyEMxpmv4Anf8iivGI=; b=SIwywqmpmWJAebUUWGTKuUnqY7FFjXv9oNORfXc0sS5CYILvP3Db+bXI0/b8hvQhoO vhzruccviQh/EztGN/CD3qg4HXBFMnE1fGdyMxnO5maW6FQ/qy7f9SwJgaG1fmZlj80P /Po3AjtOA21uP1FBGXyljAzz1SeqXJLlaUfaezjuLNQHRAdGItVTRmnRFb5LnoC752gk MI1rUjtxKidke3Q633750xbpHcjUjOOEYkg5Tr56yZm43Kav09WLjA3WxcXHkIaGHIXk n7LRr24JuOoj7j3sPDKEmnKAudBFfBlD2tsK16VtrEClK+zByieraCI5L9KYy9qNQSb+ S7HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=OXvP36yruqOx+CW8x7VzJkJbYTyEMxpmv4Anf8iivGI=; b=i0Ex7MWqmFUTG33IbjoB+yCfofkdNEv3wxqzd+OW8YhS8eJfRcfEAHdGnFDOJzhi4l OJGhZb/8Pzu5OVebG2vcmfuZUq7g6ol1aTT45zK+TtwJpSbM+6kxTmTE377rcOo9DLN1 HgkKO6t5as6UYJ1xSGW4E9JdnZ53+xJKxcPlZl13DSYGa30HfzG4srISXAfdLOrsJIqE b1X3mbdW4EqdeQpyjyc464PIAmity+EbF8JW9LtEeTP/sMfDnoq6A8rZMLMwjjflKiN/ PkPQwtzRJzHY0+6jVi3q8U9xjCEfDO0Tg3o/r/kj/U1uPdc1mi3WEBSo5i2U/yAyYPbG 5CCA== X-Gm-Message-State: AOPr4FXS00XtseseiEpUpU0OFvAm5y8u9lUSataShA/0Apw/cjh2fblK6dxleFThthSz9QiNfR/hFkr5dVetcA== MIME-Version: 1.0 X-Received: by 10.50.110.99 with SMTP id hz3mr26545872igb.16.1461098268132; Tue, 19 Apr 2016 13:37:48 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.79.104.197 with HTTP; Tue, 19 Apr 2016 13:37:48 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <57169533.3020908@freebsd.org> References: <201604190325.u3J3PaNo026464@repo.freebsd.org> <97483568.HegCXKxvF0@ralph.baldwin.cx> <57169533.3020908@freebsd.org> Date: Tue, 19 Apr 2016 14:37:48 -0600 X-Google-Sender-Auth: SD_KVehYeOnIUg59NuEfGyipNbg Message-ID: Subject: Re: svn commit: r298243 - head/usr.sbin/bsdinstall/scripts From: Warner Losh To: Nathan Whitehorn Cc: John Baldwin , Allan Jude , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:37:50 -0000 On Tue, Apr 19, 2016 at 2:29 PM, Nathan Whitehorn wrote: > > > On 04/19/16 09:12, John Baldwin wrote: > >> On Tuesday, April 19, 2016 03:25:36 AM Allan Jude wrote: >> >>> Author: allanjude >>> Date: Tue Apr 19 03:25:36 2016 >>> New Revision: 298243 >>> URL: https://svnweb.freebsd.org/changeset/base/298243 >>> >>> Log: >>> Add a new installation type to bsdinstall/zfsboot: BIOS+UEFI >>> Installs both pmbr+gptzfsboot as well as boot1.efifat in separate >>> partitions >>> The resulting system can be booted with either UEFI or BIOS/CSM. >>> Preference is controlled by the user's firmware boot settings. >>> This is now the default for zfsboot installs >>> PR: 208629 >>> Submitted by: Galael LAPLANCHE >>> (original version) >>> >> Any thought about supporting this for UFS as well? >> >> It would be pretty easy just to set that up by default. I'm happy to add > that this weekend if you think it would be useful. I have scripts that I stole for nanobsd that does that. I stole them from the release process. Perhaps we need to refactor things so we have just one copy of the scripts. This code copying will bring nothing but pain in the end. Already crochet has had issues with lagging due to copied rather than shared code. Warner From owner-svn-src-all@freebsd.org Tue Apr 19 20:38:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D9B9B15366; Tue, 19 Apr 2016 20:38:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9FEE1F50; Tue, 19 Apr 2016 20:38:21 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x230.google.com with SMTP id f1so110748113igr.1; Tue, 19 Apr 2016 13:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=V1jVxVU3h04hul5GFPYgJlQ/+aqWicdmVRomwrEmJOo=; b=XTNtBf+WEjOcsXNAibz/47kVWPnijQU9EhTbvAIy4lBQBvLT36QPREABPIfSud3tZM vuK1XCnaFwqJSdefLxYwy7xEv1g/qR4j22ZjHIJkdk6YfpwjwzVRTQgUytM8x163be2P TIPolHLh7gkS00jWif4vPBOoDRlHc+SNoUy2DLn9rrKRQ1A0Mk5iGWfl4tejjQ6Al3b+ kcb/gp1mbXZjKTQFEwZcx1DFSvGeEv4hFED4tF1lFrKEXubEmUW8kmshLmkj2vSIyarN HGcFJTFs11LFJrNdVgRoDcCjYzZNzuUiDdzszd/aBME78ggn6EQOn/W1kd5z1LB+l4ND ny4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=V1jVxVU3h04hul5GFPYgJlQ/+aqWicdmVRomwrEmJOo=; b=EmCjxOi/tg9daoLJBGDwsgrPypsObPpzhhw62Ojdsq4vtKppr1XcIJcud+eOoZjGdd 6rSJvq1ODfhGn4iAr1YHlxq9aIwKyda9e+obwZjEzJLDOGyKYhtJ6X6qcGXpoXbfJOEj X5Qyd9+Lw3ZfGTWar4aoDh9qDp81aesvCxAqPmBDRYKjY/Xgm5rT9St16aWX/6MMDggH Y7DuvPHXccT6E4QQdMBZNSdM6/vM8RrD4d1GTDq3krbZijD+nL0GS6vWkMxK93dU4yq/ uzIVNkPeAMPx7BKgHZnnAaDC6Tssyk2yV0mxfWQiTDmtCGm5xWLummfwSrYZqwa48MdZ CTKw== X-Gm-Message-State: AOPr4FXz9HGtdYITds/E1UBm3wVqR91SHcpz00dHa4TU7d1rI8bBw2UuvYnJ5RmdSFmOa7V9D6PiZxKsEeihPg== MIME-Version: 1.0 X-Received: by 10.50.57.199 with SMTP id k7mr5834289igq.61.1461098300300; Tue, 19 Apr 2016 13:38:20 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Tue, 19 Apr 2016 13:38:20 -0700 (PDT) In-Reply-To: References: <201604191539.u3JFdkHx048678@repo.freebsd.org> <20160419171243.GA30453@bsdpad.com> <1461097280.1232.34.camel@freebsd.org> Date: Tue, 19 Apr 2016 13:38:20 -0700 Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Adrian Chadd To: Patrick Kelsey Cc: Ian Lepore , Juli Mallett , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:38:22 -0000 On 19 April 2016 at 13:37, Patrick Kelsey wrote: > > > On Tue, Apr 19, 2016 at 4:21 PM, Ian Lepore wrote: >> >> On Tue, 2016-04-19 at 13:17 -0700, Juli Mallett wrote: >> > Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody >> > seemed >> > interested. I know of one proprietary branch of FreeBSD using it. >> > You might poke him if you want to know how he dealt with this, and if >> > you want to commit his driver. >> > >> >> Patrick is a committer, maybe he should just commit it. :) > > > What I believe originally held up that driver being committed (by others - > this was before my commit bit) was that I relied on some out-of-tree spibus > changes Luiz had made (as I recall, mainly being able to reserve the SPI bus > for multiple transactions), and getting those into the tree would have > required updating/testing other existing SPI drivers, based on feedback I > received at the time. All I had was the RB450G that I developed and tested > the driver with, so I really couldn't address that issue, and then work took > me in some other direction entirely. Some or all of these spibus changes > that I relied on might now be in the tree, I'm not sure offhand. I am sure > though that a huge stack of other things I need to get through has > chronically kept me from updating that driver to current and retesting. > > When I wrote that driver, I put a lot of effort into testing it against as > many different cards as I could obtain at the time - I believe 30 or so in > total, all the details are in the code that was posted to the list back > then. I encountered a number of strange/unexpected behaviors in that set of > cards, and all of that hard-won knowledge is in that driver, including a > much less complex fix for a shifted-response-data issue than you will see if > you look at the Linux mmcpsi driver (as I recall, the Linux driver has code > to arbitrarily bit-shift card response data, and to detect when that should > be done, but it turns out that can be avoided entirely by inserting idle > cycles in the right place when sending the command). Well, we should add the SPI bus reservation code and churn stuff as needed. I think that'd be a great addition. Do you have a patchset somewhere? -adrian From owner-svn-src-all@freebsd.org Tue Apr 19 20:39:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E60F9B153D0; Tue, 19 Apr 2016 20:39:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFA9210DE; Tue, 19 Apr 2016 20:39:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x232.google.com with SMTP id f1so110771185igr.1; Tue, 19 Apr 2016 13:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=y1IkqbN+zwNdffI6P8L/Xg1p7OS6SFAEYgkARLl0x7Y=; b=DFJuG3Hdj26bedOFHvWBu0AzN8r8PMpy+YXcM1r+yddn8ctpsbVIe9uJHI+fuuAZJr Bn8uImEt4n+JkREtLvXPF7LgwkeYW0O3e5ZM3bJWFLKFiPj3ckQKssd8b8PdUY9KQUx0 mjYyF68vok2col4gnM9PBdBinCFHJOc80FS3jFGii43jtboSfS9vFN0VrACZEcvRsuaT em49TEeroZE0jWV+mdk2q4JJxdvTBMiFmd2iztWbleaipwiq7zed4UB+etU3BU1uYE5s aIifX0SWxFi+Vbr+MJjZiWu6BAZV3XVC2Ce1FW/Im2dqehz7nMneml9SxgQz13Y/Eljl rHYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=y1IkqbN+zwNdffI6P8L/Xg1p7OS6SFAEYgkARLl0x7Y=; b=LTf+SdXhn9TlOBUK0T42sib2+m5ADmJfBfEvBqbniPkiSKlgPEdA/TCa1w9tgbP9ST PzjB4BMx2/lnm7KVgQjeMQPSpZ00h7pbkB417e/S5JFBXfCMYHBq0RTrVuXSGGWfFlTa WCaBwIp30+zq7a2ia7/abhymxDnSDtvpQiGJ/DDEVNykUPaIIU96ZHttrR3brpqeK5/C sE54KjrbA+wLnNDbru9UIe5uSGVYx5MD75iyMz8V0zxLXNbV1febRIFzD/iTxflFenPI gjCvXVgIMR1nx+5jGrkBT4fVqyaZLNcdriX22hVgEJ6Gr96g4HvctRMfMd0bke/1/7W2 fEHA== X-Gm-Message-State: AOPr4FXijBBQQU1KugjII9Q+xtNYP/npjY4C1us5Y01gdp/A+5yMkUMEEd0sQMDUmsHkubFucy/NUGRg9s7p4Q== MIME-Version: 1.0 X-Received: by 10.50.3.129 with SMTP id c1mr23479560igc.22.1461098359075; Tue, 19 Apr 2016 13:39:19 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Tue, 19 Apr 2016 13:39:18 -0700 (PDT) In-Reply-To: <1769146.f6cP0aQdA7@ralph.baldwin.cx> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <5716538B.4060108@freebsd.org> <20160419160500.GY2422@kib.kiev.ua> <1769146.f6cP0aQdA7@ralph.baldwin.cx> Date: Tue, 19 Apr 2016 13:39:18 -0700 Message-ID: Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: Adrian Chadd To: John Baldwin Cc: Konstantin Belousov , Allan Jude , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:39:20 -0000 [almost trolling] We could almost just import freebsd-2.0 as a boot loader environment at this point..... -adrian From owner-svn-src-all@freebsd.org Tue Apr 19 20:40:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0715B1543F; Tue, 19 Apr 2016 20:40:01 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBFD2125C; Tue, 19 Apr 2016 20:40:01 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from aurora.physics.berkeley.edu (aurora.physics.berkeley.edu [128.32.117.67]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u3JKdxfG027774 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 19 Apr 2016 13:39:59 -0700 Subject: Re: svn commit: r298243 - head/usr.sbin/bsdinstall/scripts To: Warner Losh References: <201604190325.u3J3PaNo026464@repo.freebsd.org> <97483568.HegCXKxvF0@ralph.baldwin.cx> <57169533.3020908@freebsd.org> Cc: John Baldwin , Allan Jude , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <5716979F.2030408@freebsd.org> Date: Tue, 19 Apr 2016 13:39:59 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: X-Sonic-CAuth: UmFuZG9tSVbfWkcDd3oI6tyAZdGVucMi3mxpRvIzNNoiQSLFfsZzQ0oGoemowO1TJFnpSyeLIY9Hpm3sMeEEGDPqXKMus147lIDPB6faKtI= X-Sonic-ID: C;nIUr4m4G5hGbBreqjlfmnQ== M;usJX4m4G5hGbBreqjlfmnQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:40:01 -0000 On 04/19/16 13:37, Warner Losh wrote: > > > On Tue, Apr 19, 2016 at 2:29 PM, Nathan Whitehorn > > wrote: > > > > On 04/19/16 09:12, John Baldwin wrote: > > On Tuesday, April 19, 2016 03:25:36 AM Allan Jude wrote: > > Author: allanjude > Date: Tue Apr 19 03:25:36 2016 > New Revision: 298243 > URL: https://svnweb.freebsd.org/changeset/base/298243 > > Log: > Add a new installation type to bsdinstall/zfsboot: > BIOS+UEFI > Installs both pmbr+gptzfsboot as well as > boot1.efifat in separate partitions > The resulting system can be booted with either UEFI or > BIOS/CSM. > Preference is controlled by the user's firmware boot > settings. > This is now the default for zfsboot installs > PR: 208629 > Submitted by: Galael LAPLANCHE > > (original version) > > Any thought about supporting this for UFS as well? > > It would be pretty easy just to set that up by default. I'm happy > to add that this weekend if you think it would be useful. > > > I have scripts that I stole for nanobsd that does that. I stole them > from the release process. > > Perhaps we need to refactor things so we have just one copy of the > scripts. This code copying will > bring nothing but pain in the end. Already crochet has had issues with > lagging due to copied > rather than shared code. > > Warner The release stuff uses makefs rather than geom, so there has to be some bifurcation there. Otherwise, you can script the installer/sade. -Nathan From owner-svn-src-all@freebsd.org Tue Apr 19 20:41:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 675EBB154AF; Tue, 19 Apr 2016 20:41:23 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21A7F14C6; Tue, 19 Apr 2016 20:41:23 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-yw0-x22b.google.com with SMTP id t10so31664118ywa.0; Tue, 19 Apr 2016 13:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=lQlHWRzRQCZIw3HoIhUlcEYEyhCr1F9Q7n+dl+ymljs=; b=NbjnRJ9a5CKc0e7HBE72wAdKhcb0MbhyhXaUZ0jsXxmoC3k5SZ3nPAoip4UWqUtwTI KW0t1I+p1DfWL0dF8kTregHrJ07I4csioCqc97CgCjlr7vkS1Hu8naQOPjAflE41V6Tq lDDaGQ3un6r/DJOehFiErkwDRa1PdEl5e82zMX3sc+BHaoTkUVSwxY7sF4edtvhqXCtG u1+pX5l8dIUuSF/hYN60Uh7rCHgyws0ferQ6Qck5Janhfw020025gZOoBzoX45X31UD5 lqBLKsLab/JBNm+ag8CD2vmPVAk8XmKj18LB3qUOWIiItW1U66qTSOkROQVqPcEg4dPp fYGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=lQlHWRzRQCZIw3HoIhUlcEYEyhCr1F9Q7n+dl+ymljs=; b=QfX+uh013zWC07VMXZGwVwxqCML2n97DitlAG56XFUJWmIa1GixFaD3N+0kH0eLi4D /MW/U+1RghS5rRvx2tANYy/3yIyrCoPjbxCb4FWBzw9PXxeqc7wZ8/pPleOBXbdVu5+c OoH1a1hIqkstzCYHJ+0Eq5bBQgUjBvTvcIrg+OKGufuPLuu1r2LeZt/j+nZzQSTOz5ZL rHRo0apWlA/rt5CPDvZny/fcdLDnbeab8JyTeDSKGbBhLlJ/j+0wnhLuZjovsLYsiQmj TjGucRoMon/IRiGR+0l8KdcR0guWFEhumVpVj3qBF2YSnqNQ3X8Vgdafup0eJ/ms71sb Q+Lg== X-Gm-Message-State: AOPr4FVTWE+89e3S5sDjPc6W5XCnbH3vdN/BZGfIBIbxv4N0/K3//1P7gsgmtXx4+cu2sNBDBEGD3O5IHJjJZg== MIME-Version: 1.0 X-Received: by 10.37.209.215 with SMTP id i206mr2926006ybg.127.1461098482263; Tue, 19 Apr 2016 13:41:22 -0700 (PDT) Sender: pkelsey@gmail.com Received: by 10.129.27.14 with HTTP; Tue, 19 Apr 2016 13:41:22 -0700 (PDT) In-Reply-To: References: <201604191539.u3JFdkHx048678@repo.freebsd.org> <20160419171243.GA30453@bsdpad.com> <1461097280.1232.34.camel@freebsd.org> Date: Tue, 19 Apr 2016 16:41:22 -0400 X-Google-Sender-Auth: BKZDzLVUoNrAOXSLyxMRQAV0hUY Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Patrick Kelsey To: Adrian Chadd Cc: Ian Lepore , Juli Mallett , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:41:23 -0000 On Tue, Apr 19, 2016 at 4:38 PM, Adrian Chadd wrote: > On 19 April 2016 at 13:37, Patrick Kelsey wrote: > > > > > > On Tue, Apr 19, 2016 at 4:21 PM, Ian Lepore wrote: > >> > >> On Tue, 2016-04-19 at 13:17 -0700, Juli Mallett wrote: > >> > Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody > >> > seemed > >> > interested. I know of one proprietary branch of FreeBSD using it. > >> > You might poke him if you want to know how he dealt with this, and if > >> > you want to commit his driver. > >> > > >> > >> Patrick is a committer, maybe he should just commit it. :) > > > > > > What I believe originally held up that driver being committed (by others > - > > this was before my commit bit) was that I relied on some out-of-tree > spibus > > changes Luiz had made (as I recall, mainly being able to reserve the SPI > bus > > for multiple transactions), and getting those into the tree would have > > required updating/testing other existing SPI drivers, based on feedback I > > received at the time. All I had was the RB450G that I developed and > tested > > the driver with, so I really couldn't address that issue, and then work > took > > me in some other direction entirely. Some or all of these spibus changes > > that I relied on might now be in the tree, I'm not sure offhand. I am > sure > > though that a huge stack of other things I need to get through has > > chronically kept me from updating that driver to current and retesting. > > > > When I wrote that driver, I put a lot of effort into testing it against > as > > many different cards as I could obtain at the time - I believe 30 or so > in > > total, all the details are in the code that was posted to the list back > > then. I encountered a number of strange/unexpected behaviors in that > set of > > cards, and all of that hard-won knowledge is in that driver, including a > > much less complex fix for a shifted-response-data issue than you will > see if > > you look at the Linux mmcpsi driver (as I recall, the Linux driver has > code > > to arbitrarily bit-shift card response data, and to detect when that > should > > be done, but it turns out that can be avoided entirely by inserting idle > > cycles in the right place when sending the command). > > Well, we should add the SPI bus reservation code and churn stuff as > needed. I think that'd be a great addition. > > Do you have a patchset somewhere? > > Just going from memory here - there is what I posted to the list, then at some point Luiz took a stab at updating it to then-current (I should have a copy of those somewhere - not sure where else they went, if anywhere), and beyond that, I think there's a harmless but unnecessary conditional in the original code that could be removed. -Patrick From owner-svn-src-all@freebsd.org Tue Apr 19 20:43:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18D45B1568D; Tue, 19 Apr 2016 20:43:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4B881AFE; Tue, 19 Apr 2016 20:43:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JKh677042796; Tue, 19 Apr 2016 20:43:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JKh69L042795; Tue, 19 Apr 2016 20:43:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604192043.u3JKh69L042795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Apr 2016 20:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298295 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:43:07 -0000 Author: jhb Date: Tue Apr 19 20:43:05 2016 New Revision: 298295 URL: https://svnweb.freebsd.org/changeset/base/298295 Log: Always emit an error message on passthru configuration errors. Previously, many errors (such as the PCI device not being attached to the ppt(4) driver) resulted in bhyve silently exiting without starting the virtual machine. Now any errors encountered when configuring a virtual slot for a PCI passthru device should be noted on stderr. Reviewed by: neel Differential Revision: https://reviews.freebsd.org/D5990 Modified: head/usr.sbin/bhyve/pci_passthru.c Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Tue Apr 19 20:28:30 2016 (r298294) +++ head/usr.sbin/bhyve/pci_passthru.c Tue Apr 19 20:43:05 2016 (r298295) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -483,9 +483,9 @@ init_msix_table(struct vmctx *ctx, struc PROT_WRITE, MAP_SHARED, memfd, start + pi->pi_msix.pba_page_offset); if (pi->pi_msix.pba_page == MAP_FAILED) { - printf( - "Failed to map PBA page for MSI-X on %d/%d/%d: %s\n", - b, s, f, strerror(errno)); + warn( + "Failed to map PBA page for MSI-X on %d/%d/%d", + b, s, f); return (-1); } } @@ -559,7 +559,7 @@ cfginitbar(struct vmctx *ctx, struct pas if (bartype != PCIBAR_IO) { if (((base | size) & PAGE_MASK) != 0) { - printf("passthru device %d/%d/%d BAR %d: " + warnx("passthru device %d/%d/%d BAR %d: " "base %#lx or size %#lx not page aligned\n", sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, i, base, size); @@ -617,11 +617,17 @@ cfginit(struct vmctx *ctx, struct pci_de sc->psc_sel.pc_dev = slot; sc->psc_sel.pc_func = func; - if (cfginitmsi(sc) != 0) + if (cfginitmsi(sc) != 0) { + warnx("failed to initialize MSI for PCI %d/%d/%d", + bus, slot, func); goto done; + } - if (cfginitbar(ctx, sc) != 0) + if (cfginitbar(ctx, sc) != 0) { + warnx("failed to initialize BARs for PCI %d/%d/%d", + bus, slot, func); goto done; + } error = 0; /* success */ done: @@ -639,34 +645,45 @@ passthru_init(struct vmctx *ctx, struct memflags = vm_get_memflags(ctx); if (!(memflags & VM_MEM_F_WIRED)) { - fprintf(stderr, "passthru requires guest memory to be wired\n"); + warnx("passthru requires guest memory to be wired"); goto done; } if (pcifd < 0) { pcifd = open(_PATH_DEVPCI, O_RDWR, 0); - if (pcifd < 0) + if (pcifd < 0) { + warn("failed to open %s", _PATH_DEVPCI); goto done; + } } if (iofd < 0) { iofd = open(_PATH_DEVIO, O_RDWR, 0); - if (iofd < 0) + if (iofd < 0) { + warn("failed to open %s", _PATH_DEVIO); goto done; + } } if (memfd < 0) { memfd = open(_PATH_MEM, O_RDWR, 0); - if (memfd < 0) + if (memfd < 0) { + warn("failed to open %s", _PATH_MEM); goto done; + } } if (opts == NULL || - sscanf(opts, "%d/%d/%d", &bus, &slot, &func) != 3) + sscanf(opts, "%d/%d/%d", &bus, &slot, &func) != 3) { + warnx("invalid passthru options"); goto done; + } - if (vm_assign_pptdev(ctx, bus, slot, func) != 0) + if (vm_assign_pptdev(ctx, bus, slot, func) != 0) { + warnx("PCI device at %d/%d/%d is not using the ppt(4) driver", + bus, slot, func); goto done; + } sc = calloc(1, sizeof(struct passthru_softc)); @@ -777,10 +794,8 @@ passthru_cfgwrite(struct vmctx *ctx, int sc->psc_sel.pc_dev, sc->psc_sel.pc_func, pi->pi_msi.addr, pi->pi_msi.msg_data, pi->pi_msi.maxmsgnum); - if (error != 0) { - printf("vm_setup_pptdev_msi error %d\r\n", errno); - exit(1); - } + if (error != 0) + err(1, "vm_setup_pptdev_msi"); return (0); } @@ -796,11 +811,8 @@ passthru_cfgwrite(struct vmctx *ctx, int pi->pi_msix.table[i].msg_data, pi->pi_msix.table[i].vector_control); - if (error) { - printf("vm_setup_pptdev_msix error " - "%d\r\n", errno); - exit(1); - } + if (error) + err(1, "vm_setup_pptdev_msix"); } } return (0); From owner-svn-src-all@freebsd.org Tue Apr 19 20:47:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7236B15915; Tue, 19 Apr 2016 20:47:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76EE2114C; Tue, 19 Apr 2016 20:47:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JKlE6J043095; Tue, 19 Apr 2016 20:47:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JKlEL1043093; Tue, 19 Apr 2016 20:47:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604192047.u3JKlEL1043093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 20:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298296 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:47:15 -0000 Author: pfg Date: Tue Apr 19 20:47:14 2016 New Revision: 298296 URL: https://svnweb.freebsd.org/changeset/base/298296 Log: restore: use our roundup2/rounddown2() macros when param.h is available. While here cleanup a little a malloc call. Modified: head/sbin/restore/dirs.c head/sbin/restore/symtab.c Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Tue Apr 19 20:43:05 2016 (r298295) +++ head/sbin/restore/dirs.c Tue Apr 19 20:47:14 2016 (r298296) @@ -441,7 +441,7 @@ rst_seekdir(RST_DIR *dirp, long loc, lon loc -= base; if (loc < 0) fprintf(stderr, "bad seek pointer to rst_seekdir %ld\n", loc); - (void) lseek(dirp->dd_fd, base + (loc & ~(DIRBLKSIZ - 1)), SEEK_SET); + (void) lseek(dirp->dd_fd, base + rounddown2(loc, DIRBLKSIZ), SEEK_SET); dirp->dd_loc = loc & (DIRBLKSIZ - 1); if (dirp->dd_loc != 0) dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, DIRBLKSIZ); Modified: head/sbin/restore/symtab.c ============================================================================== --- head/sbin/restore/symtab.c Tue Apr 19 20:43:05 2016 (r298295) +++ head/sbin/restore/symtab.c Tue Apr 19 20:47:14 2016 (r298296) @@ -372,7 +372,7 @@ struct strhdr { }; #define STRTBLINCR (sizeof(struct strhdr)) -#define allocsize(size) (((size) + 1 + STRTBLINCR - 1) & ~(STRTBLINCR - 1)) +#define allocsize(size) roundup2((size) + 1, STRTBLINCR) static struct strhdr strtblhdr[allocsize(NAME_MAX) / STRTBLINCR]; @@ -384,7 +384,7 @@ char * savename(char *name) { struct strhdr *np; - long len; + size_t len; char *cp; if (name == NULL) @@ -395,7 +395,7 @@ savename(char *name) strtblhdr[len / STRTBLINCR].next = np->next; cp = (char *)np; } else { - cp = malloc((unsigned)allocsize(len)); + cp = malloc(allocsize(len)); if (cp == NULL) panic("no space for string table\n"); } From owner-svn-src-all@freebsd.org Tue Apr 19 20:56:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D343DB15B4D; Tue, 19 Apr 2016 20:56:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA8B21838; Tue, 19 Apr 2016 20:56:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JKu21q046025; Tue, 19 Apr 2016 20:56:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JKu2ve046023; Tue, 19 Apr 2016 20:56:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604192056.u3JKu2ve046023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Apr 2016 20:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298297 - stable/10/usr.sbin/kbdcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:56:03 -0000 Author: emaste Date: Tue Apr 19 20:56:02 2016 New Revision: 298297 URL: https://svnweb.freebsd.org/changeset/base/298297 Log: MFC r296926: kbdcontrol: add -P path option to add keymap search paths PR: 193865 Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/kbdcontrol/kbdcontrol.1 stable/10/usr.sbin/kbdcontrol/kbdcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/kbdcontrol/kbdcontrol.1 ============================================================================== --- stable/10/usr.sbin/kbdcontrol/kbdcontrol.1 Tue Apr 19 20:47:14 2016 (r298296) +++ stable/10/usr.sbin/kbdcontrol/kbdcontrol.1 Tue Apr 19 20:56:02 2016 (r298297) @@ -13,7 +13,7 @@ .\" @(#)kbdcontrol.1 .\" $FreeBSD$ .\" -.Dd January 29, 2008 +.Dd April 19, 2016 .Dt KBDCONTROL 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Op Fl f Ar # Ar string .Op Fl k Ar keyboard_device .Op Fl L Ar keymap_file +.Op Fl P Ar path .Sh DESCRIPTION The .Nm @@ -171,6 +172,12 @@ and write the compiled from it to stdout. This option is primarily intended for programmers and is probably of little use under normal circumstances. +.It Fl P Ar path +Search for the keymap file in +.Ar path . +The +.Fl P +option may be specified multiple times. .El .Sh ENVIRONMENT The environment variable Modified: stable/10/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- stable/10/usr.sbin/kbdcontrol/kbdcontrol.c Tue Apr 19 20:47:14 2016 (r298296) +++ stable/10/usr.sbin/kbdcontrol/kbdcontrol.c Tue Apr 19 20:56:02 2016 (r298297) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "path.h" #include "lex.h" @@ -112,11 +113,13 @@ static const int repeats[] = { 34, 38, static const int ndelays = (sizeof(delays) / sizeof(int)); static const int nrepeats = (sizeof(repeats) / sizeof(int)); static int hex = 0; +static int paths_configured = 0; static int token; int number; char letter; +static void add_keymap_path(const char *path); static void dump_accent_definition(char *name, accentmap_t *accentmap); static void dump_entry(int value); static void dump_key_definition(char *name, keymap_t *keymap); @@ -142,6 +145,12 @@ static void set_keyrates(char *opt); static void show_kbd_info(void); static void usage(void) __dead2; +struct pathent { + STAILQ_ENTRY(pathent) next; + char *path; +}; +static STAILQ_HEAD(, pathent) pathlist = STAILQ_HEAD_INITIALIZER(pathlist); + /* Detect presence of vt(4). */ static int is_vt4(void) @@ -279,11 +288,11 @@ get_entry(void) } static int -get_definition_line(FILE *fd, keymap_t *keymap, accentmap_t *accentmap) +get_definition_line(FILE *file, keymap_t *keymap, accentmap_t *accentmap) { int c; - yyin = fd; + yyin = file; if (token < 0) token = yylex(); @@ -791,32 +800,57 @@ dump_accent_definition(char *name, accen } static void +add_keymap_path(const char *path) +{ + struct pathent* pe; + size_t len; + + len = strlen(path); + if ((pe = malloc(sizeof(*pe))) == NULL || + (pe->path = malloc(len + 2)) == NULL) + err(1, "malloc"); + memcpy(pe->path, path, len); + if (len > 0 && path[len - 1] != '/') + pe->path[len++] = '/'; + pe->path[len] = '\0'; + STAILQ_INSERT_TAIL(&pathlist, pe, next); +} + +static void load_keymap(char *opt, int dumponly) { keymap_t keymap; accentmap_t accentmap; - FILE *fd; - int i, j; + struct pathent *pe; + FILE *file; + int j; char *name, *cp; char blank[] = "", keymap_path[] = KEYMAP_PATH; char vt_keymap_path[] = VT_KEYMAP_PATH, dotkbd[] = ".kbd"; - char *prefix[] = {blank, blank, keymap_path, NULL}; char *postfix[] = {blank, dotkbd, NULL}; - if (is_vt4()) - prefix[2] = vt_keymap_path; - cp = getenv("KEYMAP_PATH"); - if (cp != NULL) - asprintf(&(prefix[0]), "%s/", cp); - - fd = NULL; - for (i=0; prefix[i] && fd == NULL; i++) { - for (j=0; postfix[j] && fd == NULL; j++) { - name = mkfullname(prefix[i], opt, postfix[j]); - fd = fopen(name, "r"); + if (!paths_configured) { + cp = getenv("KEYMAP_PATH"); + if (cp != NULL) + add_keymap_path(cp); + add_keymap_path(""); + if (is_vt4()) + add_keymap_path(vt_keymap_path); + else + add_keymap_path(keymap_path); + paths_configured = 1; + } + + file = NULL; + STAILQ_FOREACH(pe, &pathlist, next) { + for (j=0; postfix[j] && file == NULL; j++) { + name = mkfullname(pe->path, opt, postfix[j]); + file = fopen(name, "r"); + if (file != NULL) + break; } } - if (fd == NULL) { + if (file == NULL) { warn("keymap file \"%s\" not found", opt); return; } @@ -824,7 +858,7 @@ load_keymap(char *opt, int dumponly) memset(&accentmap, 0, sizeof(accentmap)); token = -1; while (1) { - if (get_definition_line(fd, &keymap, &accentmap) < 0) + if (get_definition_line(file, &keymap, &accentmap) < 0) break; } if (dumponly) { @@ -841,13 +875,13 @@ load_keymap(char *opt, int dumponly) } if ((keymap.n_keys > 0) && (ioctl(0, PIO_KEYMAP, &keymap) < 0)) { warn("setting keymap"); - fclose(fd); + fclose(file); return; } if ((accentmap.n_accs > 0) && (ioctl(0, PIO_DEADKEYMAP, &accentmap) < 0)) { warn("setting accentmap"); - fclose(fd); + fclose(file); return; } } @@ -1170,7 +1204,7 @@ usage(void) fprintf(stderr, "%s\n%s\n%s\n", "usage: kbdcontrol [-dFKix] [-A name] [-a name] [-b duration.pitch | [quiet.]belltype]", " [-r delay.repeat | speed] [-l mapfile] [-f # string]", -" [-k device] [-L mapfile]"); +" [-k device] [-L mapfile] [-P path]"); exit(1); } @@ -1178,9 +1212,16 @@ usage(void) int main(int argc, char **argv) { + const char *optstring = "A:a:b:df:iKk:Fl:L:P:r:x"; int opt; - while((opt = getopt(argc, argv, "A:a:b:df:iKk:Fl:L:r:x")) != -1) + /* Collect any -P arguments, regardless of where they appear. */ + while ((opt = getopt(argc, argv, optstring)) != -1) + if (opt == 'P') + add_keymap_path(optarg); + + optind = optreset = 1; + while ((opt = getopt(argc, argv, optstring)) != -1) switch(opt) { case 'A': case 'a': @@ -1198,6 +1239,8 @@ main(int argc, char **argv) case 'L': load_keymap(optarg, 1); break; + case 'P': + break; case 'f': set_functionkey(optarg, nextarg(argc, argv, &optind, 'f')); From owner-svn-src-all@freebsd.org Tue Apr 19 20:56:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90219B15BE7; Tue, 19 Apr 2016 20:56:46 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6134E19F9; Tue, 19 Apr 2016 20:56:46 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JKujfW046100; Tue, 19 Apr 2016 20:56:45 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JKujjW046099; Tue, 19 Apr 2016 20:56:45 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201604192056.u3JKujjW046099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 19 Apr 2016 20:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298298 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 20:56:46 -0000 Author: allanjude Date: Tue Apr 19 20:56:45 2016 New Revision: 298298 URL: https://svnweb.freebsd.org/changeset/base/298298 Log: Link bcache into userboot.so, was not added in r298230 This should help speed up bhyve boots too Reviewed by: olivier Modified: head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Tue Apr 19 20:56:02 2016 (r298297) +++ head/sys/boot/userboot/userboot/Makefile Tue Apr 19 20:56:45 2016 (r298298) @@ -11,6 +11,7 @@ STRIP= LIBDIR= /boot SRCS= autoload.c +SRCS+= bcache.c SRCS+= biossmap.c SRCS+= bootinfo.c SRCS+= bootinfo32.c From owner-svn-src-all@freebsd.org Tue Apr 19 21:05:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF341B15F1E; Tue, 19 Apr 2016 21:05:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A72E41FED; Tue, 19 Apr 2016 21:05:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x235.google.com with SMTP id g185so32565817ioa.2; Tue, 19 Apr 2016 14:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=zMbPvDK5bRZqlxLE/RFddtqscOP04AnsbGhdeFS7sIE=; b=W9J+7Cuf4VXu/pKwChXKRawUd00p4fMGhjcmk3gq6VW/xMEANpXcOIi7akScKlj0Xl ok2NubQrmBoisQDOL42IVr+qA1AqtUTBiCL8zyYiONzCjrWpKv7EZP5SbRPuzlDQx54j POblI0whgDCEWp53AYppxUEbinFfL2UdJXo5vT5i4KgHMQuf9rWWmKRuCPTTp32aRkqW brdMlZPLZtqf1ZXoK77iLLxJDwkIHPnBjgRDojKNGTTjh2DfNy5NXiiP6EBiKqNoVXZH wTumXDw7HlSiY1xkrrgpnLGMW3fk1AGrv2dxLvwT8P4LEUECAGFomzYSY20S5QqbeYtD 19Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=zMbPvDK5bRZqlxLE/RFddtqscOP04AnsbGhdeFS7sIE=; b=hl9LOAAZHc1rieTp1iPg1kC/vBNccpX/Yy3Nxid1puooyOBpLIZxtVtF+tIlKjtcRD +POof/uAeFkhw+jd8LztbP/teOaYMH+qKkkgCROKRY9euIqjEg44UZWnZ2avuWGogI08 kF1GWpQromARWyv/RLbT4aGoA0my6pXFhuCuegKR0Vye74qL6tkthtW7ppDMFAP3+m4P XnUI/gCvKpQ9hRAHM4EV866CIf+BOr7wDLUgqim62FpnfpA/j30O1K3+7K9eGQapQ4uS LsMzEFLWLs/iBg6IEZn9xfPH4iS6R/o5NACHZ8+TIOmF5dboYIQsLqBQeNSj7amV7Ipi wrfw== X-Gm-Message-State: AOPr4FUzrrZJplszMdrbMUHCBgQ245jyeMik53gtXwx4bLWIu16kgAmiPn0nQSVVlxct1VyJ6b33L3ZStggbLQ== MIME-Version: 1.0 X-Received: by 10.107.134.166 with SMTP id q38mr5806590ioi.165.1461099936079; Tue, 19 Apr 2016 14:05:36 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Tue, 19 Apr 2016 14:05:35 -0700 (PDT) In-Reply-To: References: <201604191539.u3JFdkHx048678@repo.freebsd.org> <20160419171243.GA30453@bsdpad.com> <1461097280.1232.34.camel@freebsd.org> Date: Tue, 19 Apr 2016 14:05:35 -0700 Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Adrian Chadd To: Patrick Kelsey Cc: Ian Lepore , Juli Mallett , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 21:05:37 -0000 Ok. I'll go tidy up the software spi bits to throw into -HEAD, because I'd then like to then commit a userland API to speak to said SPI bus so I can drive LCDs at a not terrible speed. I'll go poke you/Luiz off-line to go find the mmcspi bits to throw in! -adrian From owner-svn-src-all@freebsd.org Tue Apr 19 21:06:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C34E8B15F86; Tue, 19 Apr 2016 21:06:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 950B21172; Tue, 19 Apr 2016 21:06:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JL6dfn049092; Tue, 19 Apr 2016 21:06:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JL6dGW049091; Tue, 19 Apr 2016 21:06:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604192106.u3JL6dGW049091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Apr 2016 21:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298299 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 21:06:40 -0000 Author: emaste Date: Tue Apr 19 21:06:39 2016 New Revision: 298299 URL: https://svnweb.freebsd.org/changeset/base/298299 Log: Bump __FreeBSD_version for kbdcontrol's -P option MFC'd in r298297 Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Tue Apr 19 20:56:45 2016 (r298298) +++ stable/10/sys/sys/param.h Tue Apr 19 21:06:39 2016 (r298299) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1003500 /* Master, propagated to newvers */ +#define __FreeBSD_version 1003501 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Apr 19 21:19:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BB2BB144AD; Tue, 19 Apr 2016 21:19:30 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15E1D19B4; Tue, 19 Apr 2016 21:19:30 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-yw0-x22f.google.com with SMTP id g133so29021503ywb.2; Tue, 19 Apr 2016 14:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=hTfVjqqZ8cNzzQAf3RBIN3bMRR4lhIhgJxlS1unhaso=; b=WuFOz5eCXL94ZCm6NdztIB6x85cJ5EdR/q5+kAsWcmIqN0igSPo1x/pIAE147x3M0f GaFUrSl9En6OfhgM7NuSWzPoGZY8djgylOTAMECwo/S7xE9kXyGCD2YRTGSrfXmcCEbe O9gP/M5/2iiuYkB8KY1TcjfWidjxoklGHxAtP68i2gK/7FMlXVcE3wTcfNvYAUJbdFcm AK5jGksS8tPtG5kaQrWI9ONh3Z9BDem+IVcBElR/92H+VuNfTA9kYRbF3JsKLWvA3Dec Qhwgr9ZdUFfmM9o0HBHrv3B7TgHOscnvTBQOF01HGBUOirmxlD47U8ytyLYsI5NH4zIs sk/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=hTfVjqqZ8cNzzQAf3RBIN3bMRR4lhIhgJxlS1unhaso=; b=MVYd2HJ7SpJXl51laa4lxxznMkDtV8AVBau07EJnUkrTB9pH/pE6g5CTN8ivh7T/8w E5wGrwEM0Jyj6T2xf4kclkH0I6qHJ5yYPukE3rlDT9b4TgIWU0O1PuUgPgntXDL52H2L lIjSrec8SjM9eLE8AALoJtaTLR2zDuqI0/1nDf3G1EqB+PpzbdbGCrlq4tMiO1fGEel9 +a7fxZz7aTQn33rjnVPI1MTxyv6SEnfL3Je4zncH9MM5Of96HabLEBDrlVSEIRvid+Fr jZssKe6G+gv8ZMr6iRjWsWVcHW9sdBOEwqoiKA/NnWdoo1tX269R6Ea0nHVR3J4RGbKv 1q+g== X-Gm-Message-State: AOPr4FXzd1SJaE8nZB3rv7JcAosYmiExZch/2GZxjluRCoYQS7LwRleAfxZ3MGDXWHwZ2TnP/CH/wDifPU4y7A== MIME-Version: 1.0 X-Received: by 10.129.38.10 with SMTP id m10mr3489135ywm.183.1461100769272; Tue, 19 Apr 2016 14:19:29 -0700 (PDT) Sender: pkelsey@gmail.com Received: by 10.129.27.14 with HTTP; Tue, 19 Apr 2016 14:19:29 -0700 (PDT) In-Reply-To: References: <201604191539.u3JFdkHx048678@repo.freebsd.org> <20160419171243.GA30453@bsdpad.com> <1461097280.1232.34.camel@freebsd.org> Date: Tue, 19 Apr 2016 17:19:29 -0400 X-Google-Sender-Auth: 4GdxdDZ9wZCXiEkm3eV-u-jtGsQ Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Patrick Kelsey To: Adrian Chadd Cc: Ian Lepore , Juli Mallett , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 21:19:30 -0000 On Tue, Apr 19, 2016 at 4:41 PM, Patrick Kelsey wrote: > > > > On Tue, Apr 19, 2016 at 4:38 PM, Adrian Chadd > wrote: > >> On 19 April 2016 at 13:37, Patrick Kelsey wrote: >> > >> > >> > On Tue, Apr 19, 2016 at 4:21 PM, Ian Lepore wrote: >> >> >> >> On Tue, 2016-04-19 at 13:17 -0700, Juli Mallett wrote: >> >> > Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody >> >> > seemed >> >> > interested. I know of one proprietary branch of FreeBSD using it. >> >> > You might poke him if you want to know how he dealt with this, and if >> >> > you want to commit his driver. >> >> > >> >> >> >> Patrick is a committer, maybe he should just commit it. :) >> > >> > >> > What I believe originally held up that driver being committed (by >> others - >> > this was before my commit bit) was that I relied on some out-of-tree >> spibus >> > changes Luiz had made (as I recall, mainly being able to reserve the >> SPI bus >> > for multiple transactions), and getting those into the tree would have >> > required updating/testing other existing SPI drivers, based on feedback >> I >> > received at the time. All I had was the RB450G that I developed and >> tested >> > the driver with, so I really couldn't address that issue, and then work >> took >> > me in some other direction entirely. Some or all of these spibus >> changes >> > that I relied on might now be in the tree, I'm not sure offhand. I am >> sure >> > though that a huge stack of other things I need to get through has >> > chronically kept me from updating that driver to current and retesting. >> > >> > When I wrote that driver, I put a lot of effort into testing it against >> as >> > many different cards as I could obtain at the time - I believe 30 or so >> in >> > total, all the details are in the code that was posted to the list back >> > then. I encountered a number of strange/unexpected behaviors in that >> set of >> > cards, and all of that hard-won knowledge is in that driver, including a >> > much less complex fix for a shifted-response-data issue than you will >> see if >> > you look at the Linux mmcpsi driver (as I recall, the Linux driver has >> code >> > to arbitrarily bit-shift card response data, and to detect when that >> should >> > be done, but it turns out that can be avoided entirely by inserting idle >> > cycles in the right place when sending the command). >> >> Well, we should add the SPI bus reservation code and churn stuff as >> needed. I think that'd be a great addition. >> >> Do you have a patchset somewhere? >> >> > > Just going from memory here - there is what I posted to the list, then at > some point Luiz took a stab at updating it to then-current (I should have a > copy of those somewhere - not sure where else they went, if anywhere), and > beyond that, I think there's a harmless but unnecessary conditional in the > original code that could be removed. > > > For reference, my original patchset and the work-in-progress update Luiz sent me a few months later are now available at https://people.freebsd.org/~pkelsey/mmcspi/ -Patrick From owner-svn-src-all@freebsd.org Tue Apr 19 22:07:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C42BB13DF1; Tue, 19 Apr 2016 22:07:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16E471A0E; Tue, 19 Apr 2016 22:07:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JM7bZ2066987; Tue, 19 Apr 2016 22:07:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JM7aeT066982; Tue, 19 Apr 2016 22:07:36 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604192207.u3JM7aeT066982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 22:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298300 - in head/sys/dev/usb: input serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 22:07:38 -0000 Author: pfg Date: Tue Apr 19 22:07:36 2016 New Revision: 298300 URL: https://svnweb.freebsd.org/changeset/base/298300 Log: dev/usb: use our nitems() macro when param.h is available. Reviewed by: hselasky Modified: head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/umcs.c head/sys/dev/usb/serial/uplcom.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Tue Apr 19 21:06:39 2016 (r298299) +++ head/sys/dev/usb/input/ukbd.c Tue Apr 19 22:07:36 2016 (r298300) @@ -2087,7 +2087,7 @@ ukbd_key2scan(struct ukbd_softc *sc, int 0x72, /* Apple Keyboard JIS (Eisu) */ }; - if ((code >= 89) && (code < (int)(89 + (sizeof(scan) / sizeof(scan[0]))))) { + if ((code >= 89) && (code < (int)(89 + nitems(scan)))) { code = scan[code - 89]; } /* Pause/Break */ Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue Apr 19 21:06:39 2016 (r298299) +++ head/sys/dev/usb/serial/u3g.c Tue Apr 19 22:07:36 2016 (r298300) @@ -670,7 +670,7 @@ u3g_sael_m460_init(struct usb_device *ud return; } - for (n = 0; n != (sizeof(setup)/sizeof(setup[0])); n++) { + for (n = 0; n != nitems(setup); n++) { memcpy(&req, setup[n], sizeof(req)); Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Tue Apr 19 21:06:39 2016 (r298299) +++ head/sys/dev/usb/serial/uchcom.c Tue Apr 19 22:07:36 2016 (r298300) @@ -195,7 +195,7 @@ static const struct uchcom_divider_recor {367, 1, 11719, {0, 0, 0}}, }; -#define NUM_DIVIDERS (sizeof (dividers) / sizeof (dividers[0])) +#define NUM_DIVIDERS nitems(dividers) static const STRUCT_USB_HOST_ID uchcom_devs[] = { {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, Modified: head/sys/dev/usb/serial/umcs.c ============================================================================== --- head/sys/dev/usb/serial/umcs.c Tue Apr 19 21:06:39 2016 (r298299) +++ head/sys/dev/usb/serial/umcs.c Tue Apr 19 22:07:36 2016 (r298300) @@ -1072,7 +1072,7 @@ umcs7840_set_baudrate(struct umcs7840_so /* Maximum speeds for standard frequences, when PLL is not used */ static const uint32_t umcs7840_baudrate_divisors[] = {0, 115200, 230400, 403200, 460800, 806400, 921600, 1572864, 3145728,}; -static const uint8_t umcs7840_baudrate_divisors_len = sizeof(umcs7840_baudrate_divisors) / sizeof(umcs7840_baudrate_divisors[0]); +static const uint8_t umcs7840_baudrate_divisors_len = nitems(umcs7840_baudrate_divisors); static usb_error_t umcs7840_calc_baudrate(uint32_t rate, uint16_t *divisor, uint8_t *clk) Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Tue Apr 19 21:06:39 2016 (r298299) +++ head/sys/dev/usb/serial/uplcom.c Tue Apr 19 22:07:36 2016 (r298300) @@ -642,7 +642,7 @@ static const uint32_t uplcom_rates[] = { 230400, 460800, 614400, 921600, 1228800 }; -#define N_UPLCOM_RATES (sizeof(uplcom_rates)/sizeof(uplcom_rates[0])) +#define N_UPLCOM_RATES nitems(uplcom_rates) static int uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) From owner-svn-src-all@freebsd.org Tue Apr 19 22:25:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B51EFB144F9; Tue, 19 Apr 2016 22:25:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 748A31328; Tue, 19 Apr 2016 22:25:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JMPEJM072956; Tue, 19 Apr 2016 22:25:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JMPEpq072955; Tue, 19 Apr 2016 22:25:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604192225.u3JMPEpq072955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Apr 2016 22:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298301 - head/tests/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 22:25:15 -0000 Author: ngie Date: Tue Apr 19 22:25:14 2016 New Revision: 298301 URL: https://svnweb.freebsd.org/changeset/base/298301 Log: Fix leaks and test for getpagesize() returning == -1 - close file descriptors after use. - Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3). CID: 1331374-1331377, 1331653-1331662 Differential Revision: https://reviews.freebsd.org/D6011 MFC after: 2 weeks Reported by: Coverity Reviewed by: cem Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/vm/mmap_test.c Modified: head/tests/sys/vm/mmap_test.c ============================================================================== --- head/tests/sys/vm/mmap_test.c Tue Apr 19 22:07:36 2016 (r298300) +++ head/tests/sys/vm/mmap_test.c Tue Apr 19 22:25:14 2016 (r298301) @@ -91,8 +91,10 @@ static void checked_mmap(int prot, int flags, int fd, int error, const char *msg) { void *p; + int pagesize; - p = mmap(NULL, getpagesize(), prot, flags, fd, 0); + ATF_REQUIRE((pagesize = getpagesize()) > 0); + p = mmap(NULL, pagesize, prot, flags, fd, 0); if (p == MAP_FAILED) { if (error == 0) ATF_CHECK_MSG(0, "%s failed with errno %d", msg, @@ -103,18 +105,19 @@ checked_mmap(int prot, int flags, int fd errno, error); } else { ATF_CHECK_MSG(error == 0, "%s succeeded", msg); - munmap(p, getpagesize()); + munmap(p, pagesize); } } ATF_TC_WITHOUT_HEAD(mmap__bad_arguments); ATF_TC_BODY(mmap__bad_arguments, tc) { - int devstatfd, shmfd, zerofd; + int devstatfd, pagesize, shmfd, zerofd; + ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((devstatfd = open("/dev/devstat", O_RDONLY)) >= 0); ATF_REQUIRE((shmfd = shm_open(SHM_ANON, O_RDWR, 0644)) >= 0); - ATF_REQUIRE(ftruncate(shmfd, getpagesize()) == 0); + ATF_REQUIRE(ftruncate(shmfd, pagesize) == 0); ATF_REQUIRE((zerofd = open("/dev/zero", O_RDONLY)) >= 0); /* These should work. */ @@ -171,6 +174,10 @@ ATF_TC_BODY(mmap__bad_arguments, tc) */ checked_mmap(PROT_READ, MAP_PRIVATE, devstatfd, EINVAL, "MAP_PRIVATE of /dev/devstat"); + + close(devstatfd); + close(shmfd); + close(zerofd); } ATF_TC_WITHOUT_HEAD(mmap__dev_zero_private); @@ -178,22 +185,21 @@ ATF_TC_BODY(mmap__dev_zero_private, tc) { char *p1, *p2, *p3; size_t i; - int fd; + int fd, pagesize; + ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0); - p1 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, - 0); + p1 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ATF_REQUIRE(p1 != MAP_FAILED); - p2 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, - 0); + p2 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ATF_REQUIRE(p2 != MAP_FAILED); - for (i = 0; i < getpagesize(); i++) + for (i = 0; i < pagesize; i++) ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); - ATF_REQUIRE(memcmp(p1, p2, getpagesize()) == 0); + ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); p1[0] = 1; @@ -203,11 +209,15 @@ ATF_TC_BODY(mmap__dev_zero_private, tc) ATF_REQUIRE(p1[0] == 1); - p3 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, - 0); + p3 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ATF_REQUIRE(p3 != MAP_FAILED); ATF_REQUIRE(p3[0] == 0); + + munmap(p1, pagesize); + munmap(p2, pagesize); + munmap(p3, pagesize); + close(fd); } ATF_TC_WITHOUT_HEAD(mmap__dev_zero_shared); @@ -215,22 +225,21 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc) { char *p1, *p2, *p3; size_t i; - int fd; + int fd, pagesize; + ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0); - p1 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + p1 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ATF_REQUIRE(p1 != MAP_FAILED); - p2 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + p2 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ATF_REQUIRE(p2 != MAP_FAILED); - for (i = 0; i < getpagesize(); i++) + for (i = 0; i < pagesize; i++) ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); - ATF_REQUIRE(memcmp(p1, p2, getpagesize()) == 0); + ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); p1[0] = 1; @@ -240,11 +249,16 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc) ATF_REQUIRE(p1[0] == 1); - p3 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, + p3 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ATF_REQUIRE(p3 != MAP_FAILED); ATF_REQUIRE(p3[0] == 0); + + munmap(p1, pagesize); + munmap(p2, pagesize); + munmap(p3, pagesize); + close(fd); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Tue Apr 19 22:59:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6228B151B2; Tue, 19 Apr 2016 22:59:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3F4E164B; Tue, 19 Apr 2016 22:59:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JMxL8G081869; Tue, 19 Apr 2016 22:59:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JMxLlo081868; Tue, 19 Apr 2016 22:59:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604192259.u3JMxLlo081868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Apr 2016 22:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298303 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 22:59:22 -0000 Author: ngie Date: Tue Apr 19 22:59:21 2016 New Revision: 298303 URL: https://svnweb.freebsd.org/changeset/base/298303 Log: Remove trailing whitespace and use `nitems(mib)` instead of `2` when calling sysctl(3) MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/gen/getpagesize.c Modified: head/lib/libc/gen/getpagesize.c ============================================================================== --- head/lib/libc/gen/getpagesize.c Tue Apr 19 22:38:31 2016 (r298302) +++ head/lib/libc/gen/getpagesize.c Tue Apr 19 22:59:21 2016 (r298303) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); int getpagesize(void) { - int mib[2]; + int mib[2]; static int value; size_t size; int error; @@ -68,7 +68,7 @@ getpagesize(void) mib[0] = CTL_HW; mib[1] = HW_PAGESIZE; size = sizeof value; - if (sysctl(mib, 2, &value, &size, NULL, 0) == -1) + if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) == -1) return (-1); return (value); From owner-svn-src-all@freebsd.org Tue Apr 19 23:15:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C79AB155CF; Tue, 19 Apr 2016 23:15:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2B51FF7; Tue, 19 Apr 2016 23:15:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JNFlst087769; Tue, 19 Apr 2016 23:15:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JNFli9087768; Tue, 19 Apr 2016 23:15:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604192315.u3JNFli9087768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Apr 2016 23:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298304 - head/tests/sys/posixshm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 23:15:48 -0000 Author: ngie Date: Tue Apr 19 23:15:47 2016 New Revision: 298304 URL: https://svnweb.freebsd.org/changeset/base/298304 Log: Fix issues identified by Coverity - Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3). - Remove intermediate variable for assigning from $TMPDIR if set in the environment to eliminate warnings about pointer conversions with "/tmp", and to mute an invalid buffer overflow concern from Coverity (snprintf and tacking on a NUL terminator was alleviating that concern before). - Remove useless self-test of psize before it's initialized. - Check the return values of getrlimit/setrlimit. Cosmetic changes: - Replace a `(void*)0` with NULL. - Do some minor whitespace clean up. - Remove an unnecessary cast to mmap. - Make all munmap calls use ATF_REQUIRE_MSG instead of using the: > if (munmap(..) == -1) > atf_tc_fail(..) idiom. Employ the new idiom consistently when calling munmap. CID: 1331351, 1331382-1331386, 1331513, 1331514, 1331565, 1331583, 1331694 Differential Revision: https://reviews.freebsd.org/D6012 MFC after: 2 weeks Reported by: Coverity Reviewed by: markj Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/posixshm/posixshm_test.c Modified: head/tests/sys/posixshm/posixshm_test.c ============================================================================== --- head/tests/sys/posixshm/posixshm_test.c Tue Apr 19 22:59:21 2016 (r298303) +++ head/tests/sys/posixshm/posixshm_test.c Tue Apr 19 23:15:47 2016 (r298304) @@ -50,12 +50,9 @@ static char test_path[TEST_PATH_LEN]; static void gen_test_path(void) { - char *tmpdir = getenv("TMPDIR"); - if (tmpdir == NULL) - tmpdir = "/tmp"; - - snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", tmpdir); + snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", + getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); test_path[sizeof(test_path) - 1] = '\0'; ATF_REQUIRE_MSG(mkstemp(test_path) != -1, "mkstemp failed; errno=%d", errno); @@ -99,10 +96,12 @@ static int scribble_object(void) { char *page; - int fd; + int fd, pagesize; gen_test_path(); + ATF_REQUIRE(0 < (pagesize = getpagesize())); + fd = shm_open(test_path, O_CREAT|O_EXCL|O_RDWR, 0777); if (fd < 0 && errno == EEXIST) { if (shm_unlink(test_path) < 0) @@ -111,17 +110,16 @@ scribble_object(void) } if (fd < 0) atf_tc_fail("shm_open failed; errno=%d", errno); - if (ftruncate(fd, getpagesize()) < 0) + if (ftruncate(fd, pagesize) < 0) atf_tc_fail("ftruncate failed; errno=%d", errno); - page = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap failed; errno=%d", errno); page[0] = '1'; - if (munmap(page, getpagesize()) < 0) - atf_tc_fail("munmap failed; errno=%d", errno); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); return (fd); } @@ -130,12 +128,13 @@ ATF_TC_WITHOUT_HEAD(remap_object); ATF_TC_BODY(remap_object, tc) { char *page; - int fd; + int fd, pagesize; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); fd = scribble_object(); - page = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(2) failed; errno=%d", errno); @@ -143,8 +142,8 @@ ATF_TC_BODY(remap_object, tc) atf_tc_fail("missing data ('%c' != '1')", page[0]); close(fd); - if (munmap(page, getpagesize()) < 0) - atf_tc_fail("munmap failed; errno=%d", errno); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); ATF_REQUIRE_MSG(shm_unlink(test_path) != -1, "shm_unlink failed; errno=%d", errno); @@ -154,7 +153,9 @@ ATF_TC_WITHOUT_HEAD(reopen_object); ATF_TC_BODY(reopen_object, tc) { char *page; - int fd; + int fd, pagesize; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); fd = scribble_object(); close(fd); @@ -163,14 +164,15 @@ ATF_TC_BODY(reopen_object, tc) if (fd < 0) atf_tc_fail("shm_open(2) failed; errno=%d", errno); - page = mmap(0, getpagesize(), PROT_READ, MAP_SHARED, fd, 0); + page = mmap(0, pagesize, PROT_READ, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(2) failed; errno=%d", errno); if (page[0] != '1') atf_tc_fail("missing data ('%c' != '1')", page[0]); - munmap(page, getpagesize()); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); close(fd); ATF_REQUIRE_MSG(shm_unlink(test_path) != -1, "shm_unlink failed; errno=%d", errno); @@ -180,7 +182,9 @@ ATF_TC_WITHOUT_HEAD(readonly_mmap_write) ATF_TC_BODY(readonly_mmap_write, tc) { char *page; - int fd; + int fd, pagesize; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); gen_test_path(); @@ -188,8 +192,7 @@ ATF_TC_BODY(readonly_mmap_write, tc) ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno); /* PROT_WRITE should fail with EACCES. */ - page = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page != MAP_FAILED) atf_tc_fail("mmap(PROT_WRITE) succeeded unexpectedly"); @@ -359,49 +362,49 @@ ATF_TC_BODY(object_resize, tc) { pid_t pid; struct stat sb; - char err_buf[1024], *page; - int fd, status; + char *page; + int fd, pagesize, status; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); /* Start off with a size of a single page. */ fd = shm_open(SHM_ANON, O_CREAT|O_RDWR, 0777); if (fd < 0) atf_tc_fail("shm_open failed; errno=%d", errno); - if (ftruncate(fd, getpagesize()) < 0) + if (ftruncate(fd, pagesize) < 0) atf_tc_fail("ftruncate(1) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(1) failed; errno=%d", errno); - if (sb.st_size != getpagesize()) + if (sb.st_size != pagesize) atf_tc_fail("first resize failed (%d != %d)", - (int)sb.st_size, getpagesize()); + (int)sb.st_size, pagesize); /* Write a '1' to the first byte. */ - page = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(1)"); page[0] = '1'; - if (munmap(page, getpagesize()) < 0) - atf_tc_fail("munmap(1) failed; errno=%d", errno); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); /* Grow the object to 2 pages. */ - if (ftruncate(fd, getpagesize() * 2) < 0) + if (ftruncate(fd, pagesize * 2) < 0) atf_tc_fail("ftruncate(2) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(2) failed; errno=%d", errno); - if (sb.st_size != getpagesize() * 2) + if (sb.st_size != pagesize * 2) atf_tc_fail("second resize failed (%d != %d)", - (int)sb.st_size, getpagesize() * 2); + (int)sb.st_size, pagesize * 2); /* Check for '1' at the first byte. */ - page = mmap(0, getpagesize() * 2, PROT_READ|PROT_WRITE, MAP_SHARED, - fd, 0); + page = mmap(0, pagesize * 2, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(2) failed; errno=%d", errno); @@ -409,18 +412,18 @@ ATF_TC_BODY(object_resize, tc) atf_tc_fail("'%c' != '1'", page[0]); /* Write a '2' at the start of the second page. */ - page[getpagesize()] = '2'; + page[pagesize] = '2'; /* Shrink the object back to 1 page. */ - if (ftruncate(fd, getpagesize()) < 0) + if (ftruncate(fd, pagesize) < 0) atf_tc_fail("ftruncate(3) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(3) failed; errno=%d", errno); - if (sb.st_size != getpagesize()) + if (sb.st_size != pagesize) atf_tc_fail("third resize failed (%d != %d)", - (int)sb.st_size, getpagesize()); + (int)sb.st_size, pagesize); /* * Fork a child process to make sure the second page is no @@ -435,16 +438,16 @@ ATF_TC_BODY(object_resize, tc) char c; /* Don't generate a core dump. */ - getrlimit(RLIMIT_CORE, &lim); + ATF_REQUIRE(getrlimit(RLIMIT_CORE, &lim) == 0); lim.rlim_cur = 0; - setrlimit(RLIMIT_CORE, &lim); + ATF_REQUIRE(setrlimit(RLIMIT_CORE, &lim) == 0); /* * The previous ftruncate(2) shrunk the backing object * so that this address is no longer valid, so reading * from it should trigger a SIGSEGV. */ - c = page[getpagesize()]; + c = page[pagesize]; fprintf(stderr, "child: page 1: '%c'\n", c); exit(0); } @@ -456,15 +459,15 @@ ATF_TC_BODY(object_resize, tc) atf_tc_fail("child terminated with status %x", status); /* Grow the object back to 2 pages. */ - if (ftruncate(fd, getpagesize() * 2) < 0) + if (ftruncate(fd, pagesize * 2) < 0) atf_tc_fail("ftruncate(2) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(2) failed; errno=%d", errno); - if (sb.st_size != getpagesize() * 2) + if (sb.st_size != pagesize * 2) atf_tc_fail("fourth resize failed (%d != %d)", - (int)sb.st_size, getpagesize()); + (int)sb.st_size, pagesize); /* * Note that the mapping at 'page' for the second page is @@ -475,9 +478,9 @@ ATF_TC_BODY(object_resize, tc) * object was shrunk and the new pages when an object are * grown are zero-filled. */ - if (page[getpagesize()] != 0) + if (page[pagesize] != 0) atf_tc_fail("invalid data at %d: %x != 0", - getpagesize(), (int)page[getpagesize()]); + pagesize, (int)page[pagesize]); close(fd); } @@ -524,7 +527,7 @@ ATF_TC_BODY(shm_functionality_across_for scval = sysconf(_SC_PAGESIZE); if (scval == -1 && errno != 0) { atf_tc_fail("sysconf(_SC_PAGESIZE) failed; errno=%d", errno); - } else if (scval <= 0 || (size_t)psize != psize) { + } else if (scval <= 0) { fprintf(stderr, "bogus return from sysconf(_SC_PAGESIZE): %ld", scval); psize = 4096; @@ -542,8 +545,7 @@ ATF_TC_BODY(shm_functionality_across_for ATF_REQUIRE_MSG(ftruncate(desc, (off_t)psize) != -1, "ftruncate failed; errno=%d", errno); - region = mmap((void *)0, psize, PROT_READ | PROT_WRITE, MAP_SHARED, - desc, (off_t)0); + region = mmap(NULL, psize, PROT_READ | PROT_WRITE, MAP_SHARED, desc, 0); ATF_REQUIRE_MSG(region != MAP_FAILED, "mmap failed; errno=%d", errno); memset(region, '\377', psize); @@ -601,6 +603,10 @@ ATF_TC_BODY(shm_functionality_across_for strsignal(WTERMSIG(status))); } } + + ATF_REQUIRE_MSG(munmap(region, psize) == 0, "munmap failed; errno=%d", + errno); + shm_unlink(test_path); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Tue Apr 19 23:30:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F17C0B159E7; Tue, 19 Apr 2016 23:30:23 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1D191759; Tue, 19 Apr 2016 23:30:23 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JNUMdh090886; Tue, 19 Apr 2016 23:30:22 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JNUMrd090885; Tue, 19 Apr 2016 23:30:22 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604192330.u3JNUMrd090885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 19 Apr 2016 23:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298305 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 23:30:24 -0000 Author: gonzo Date: Tue Apr 19 23:30:22 2016 New Revision: 298305 URL: https://svnweb.freebsd.org/changeset/base/298305 Log: Fix build for Pi kernels with syscons enabled Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Tue Apr 19 23:15:47 2016 (r298304) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Tue Apr 19 23:30:22 2016 (r298305) @@ -146,10 +146,10 @@ bcm_fb_attach(device_t dev) sc = device_get_softc(dev); memset(&fb, 0, sizeof(fb)); - if (bcm2835_mbox_fb_get_w_h(dev, &fb) != 0) + if (bcm2835_mbox_fb_get_w_h(&fb) != 0) return (ENXIO); fb.bpp = FB_DEPTH; - if (bcm2835_mbox_fb_init(dev, &fb) != 0) + if (bcm2835_mbox_fb_init(&fb) != 0) return (ENXIO); sc->fb_addr = (intptr_t)pmap_mapdev(fb.base, fb.size); From owner-svn-src-all@freebsd.org Tue Apr 19 23:31:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0138B15B05; Tue, 19 Apr 2016 23:31:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D7CE1A6F; Tue, 19 Apr 2016 23:31:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JNVZ2f090972; Tue, 19 Apr 2016 23:31:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JNVZbE090969; Tue, 19 Apr 2016 23:31:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604192331.u3JNVZbE090969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 23:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298306 - head/sys/dev/agp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 23:31:37 -0000 Author: pfg Date: Tue Apr 19 23:31:35 2016 New Revision: 298306 URL: https://svnweb.freebsd.org/changeset/base/298306 Log: dev/agp: use our nitems() macro when it is avaliable through param.h. Consistently capitalize the macros used in the driver. No functional change. Modified: head/sys/dev/agp/agp.c head/sys/dev/agp/agp_ali.c head/sys/dev/agp/agp_amd64.c Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Tue Apr 19 23:30:22 2016 (r298305) +++ head/sys/dev/agp/agp.c Tue Apr 19 23:31:35 2016 (r298306) @@ -185,7 +185,7 @@ static u_int agp_max[][2] = { {2048, 1920}, {4096, 3932} }; -#define agp_max_size (sizeof(agp_max) / sizeof(agp_max[0])) +#define AGP_MAX_SIZE nitems(agp_max) /** * Sets the PCI resource which represents the AGP aperture. @@ -228,12 +228,12 @@ agp_generic_attach(device_t dev) * uses a heurisitc table from the Linux driver. */ memsize = ptoa(realmem) >> 20; - for (i = 0; i < agp_max_size; i++) { + for (i = 0; i < AGP_MAX_SIZE; i++) { if (memsize <= agp_max[i][0]) break; } - if (i == agp_max_size) - i = agp_max_size - 1; + if (i == AGP_MAX_SIZE) + i = AGP_MAX_SIZE - 1; sc->as_maxmem = agp_max[i][1] << 20U; /* Modified: head/sys/dev/agp/agp_ali.c ============================================================================== --- head/sys/dev/agp/agp_ali.c Tue Apr 19 23:30:22 2016 (r298305) +++ head/sys/dev/agp/agp_ali.c Tue Apr 19 23:31:35 2016 (r298306) @@ -171,7 +171,7 @@ static u_int32_t agp_ali_table[] = { 128*M, /* 9 - invalid */ 256*M, /* 10 - invalid */ }; -#define agp_ali_table_size (sizeof(agp_ali_table) / sizeof(agp_ali_table[0])) +#define AGP_ALI_TABLE_SIZE nitems(agp_ali_table) static u_int32_t agp_ali_get_aperture(device_t dev) @@ -181,7 +181,7 @@ agp_ali_get_aperture(device_t dev) * I'm not sure this is correct.. */ int i = pci_read_config(dev, AGP_ALI_ATTBASE, 4) & 0xf; - if (i >= agp_ali_table_size) + if (i >= AGP_ALI_TABLE_SIZE) return 0; return agp_ali_table[i]; } @@ -192,10 +192,10 @@ agp_ali_set_aperture(device_t dev, u_int int i; u_int32_t attbase; - for (i = 0; i < agp_ali_table_size; i++) + for (i = 0; i < AGP_ALI_TABLE_SIZE; i++) if (agp_ali_table[i] == aperture) break; - if (i == agp_ali_table_size) + if (i == AGP_ALI_TABLE_SIZE) return EINVAL; attbase = pci_read_config(dev, AGP_ALI_ATTBASE, 4); Modified: head/sys/dev/agp/agp_amd64.c ============================================================================== --- head/sys/dev/agp/agp_amd64.c Tue Apr 19 23:30:22 2016 (r298305) +++ head/sys/dev/agp/agp_amd64.c Tue Apr 19 23:31:35 2016 (r298306) @@ -274,8 +274,7 @@ static uint32_t agp_amd64_table[] = { 0x80000000, /* 2048 MB */ }; -#define AGP_AMD64_TABLE_SIZE \ - (sizeof(agp_amd64_table) / sizeof(agp_amd64_table[0])) +#define AGP_AMD64_TABLE_SIZE nitems(agp_amd64_table) static uint32_t agp_amd64_get_aperture(device_t dev) From owner-svn-src-all@freebsd.org Tue Apr 19 23:37:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0D51B15CAE; Tue, 19 Apr 2016 23:37:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5166B1E48; Tue, 19 Apr 2016 23:37:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JNbS4Y094052; Tue, 19 Apr 2016 23:37:28 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JNbOTJ094010; Tue, 19 Apr 2016 23:37:24 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604192337.u3JNbOTJ094010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 23:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298307 - in head/sys/dev: adb age aha ale altera/atse atkbdc bktr bwi bwn cardbus digi dwc ed flash hatm hifn if_ndis jme kbd mlx mxge nand ncr nctgpio nfe patm rc re rl sf sio sound/i... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 23:37:29 -0000 Author: pfg Date: Tue Apr 19 23:37:24 2016 New Revision: 298307 URL: https://svnweb.freebsd.org/changeset/base/298307 Log: sys/dev: use our nitems() macro when it is avaliable through param.h. No functional change, only trivial cases are done in this sweep, Drivers that can get further enhancements will be done independently. Discussed in: freebsd-current Modified: head/sys/dev/adb/adb_kbd.c head/sys/dev/age/if_age.c head/sys/dev/aha/aha_isa.c head/sys/dev/ale/if_ale.c head/sys/dev/altera/atse/if_atse.c head/sys/dev/atkbdc/atkbd.c head/sys/dev/atkbdc/atkbdc.c head/sys/dev/atkbdc/psm.c head/sys/dev/bktr/bktr_core.c head/sys/dev/bwi/bwirf.c head/sys/dev/bwn/if_bwn.c head/sys/dev/cardbus/cardbus_cis.c head/sys/dev/digi/digi.c head/sys/dev/digi/digi_isa.c head/sys/dev/dwc/if_dwc.c head/sys/dev/ed/if_ed_hpp.c head/sys/dev/ed/if_ed_isa.c head/sys/dev/ed/if_ed_pci.c head/sys/dev/flash/mx25l.c head/sys/dev/hatm/if_hatm.c head/sys/dev/hifn/hifn7751.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/jme/if_jme.c head/sys/dev/kbd/kbd.c head/sys/dev/mlx/mlx.c head/sys/dev/mxge/if_mxge.c head/sys/dev/nand/nand_id.c head/sys/dev/ncr/ncr.c head/sys/dev/nctgpio/nctgpio.c head/sys/dev/nfe/if_nfe.c head/sys/dev/patm/if_patm_attach.c head/sys/dev/rc/rc.c head/sys/dev/re/if_re.c head/sys/dev/rl/if_rl.c head/sys/dev/sf/if_sf.c head/sys/dev/sio/sio.c head/sys/dev/sound/isa/gusc.c head/sys/dev/speaker/spkr.c head/sys/dev/stge/if_stge.c head/sys/dev/vkbd/vkbd.c head/sys/dev/wbwd/wbwd.c Modified: head/sys/dev/adb/adb_kbd.c ============================================================================== --- head/sys/dev/adb/adb_kbd.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/adb/adb_kbd.c Tue Apr 19 23:37:24 2016 (r298307) @@ -162,7 +162,7 @@ keycode2scancode(int keycode, int shift, int scancode; scancode = keycode; - if ((keycode >= 89) && (keycode < 89 + sizeof(scan) / sizeof(scan[0]))) + if ((keycode >= 89) && (keycode < 89 + nitems(scan))) scancode = scan[keycode - 89] | SCAN_PREFIX_E0; /* pause/break */ if ((keycode == 104) && !(shift & CTLS)) Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/age/if_age.c Tue Apr 19 23:37:24 2016 (r298307) @@ -323,8 +323,7 @@ age_probe(device_t dev) vendor = pci_get_vendor(dev); devid = pci_get_device(dev); sp = age_devs; - for (i = 0; i < sizeof(age_devs) / sizeof(age_devs[0]); - i++, sp++) { + for (i = 0; i < nitems(age_devs); i++, sp++) { if (vendor == sp->age_vendorid && devid == sp->age_deviceid) { device_set_desc(dev, sp->age_name); Modified: head/sys/dev/aha/aha_isa.c ============================================================================== --- head/sys/dev/aha/aha_isa.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/aha/aha_isa.c Tue Apr 19 23:37:24 2016 (r298307) @@ -310,8 +310,7 @@ aha_isa_identify(driver_t *driver, devic device_t child; /* Attempt to find an adapter */ - for (i = 0; i < sizeof(aha_board_ports) / sizeof(aha_board_ports[0]); - i++) { + for (i = 0; i < nitems(aha_board_ports); i++) { bzero(&aha, sizeof(aha)); ioport = aha_board_ports[i]; /* Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/ale/if_ale.c Tue Apr 19 23:37:24 2016 (r298307) @@ -343,7 +343,7 @@ ale_probe(device_t dev) vendor = pci_get_vendor(dev); devid = pci_get_device(dev); sp = ale_devs; - for (i = 0; i < sizeof(ale_devs) / sizeof(ale_devs[0]); i++) { + for (i = 0; i < nitems(ale_devs); i++) { if (vendor == sp->ale_vendorid && devid == sp->ale_deviceid) { device_set_desc(dev, sp->ale_name); Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/altera/atse/if_atse.c Tue Apr 19 23:37:24 2016 (r298307) @@ -1727,8 +1727,7 @@ atse_sysctl_stats_attach(device_t dev) soid = device_get_sysctl_tree(dev); /* MAC statistics. */ - for (i = 0; i < sizeof(atse_mac_stats_regs) / - sizeof(*atse_mac_stats_regs); i++) { + for (i = 0; i < nitems(atse_mac_stats_regs); i++) { if (atse_mac_stats_regs[i].name == NULL || atse_mac_stats_regs[i].descr == NULL) continue; Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/atkbdc/atkbd.c Tue Apr 19 23:37:24 2016 (r298307) @@ -362,8 +362,7 @@ atkbd_init(int unit, keyboard_t **kbdp, keymap = &default_keymap; accmap = &default_accentmap; fkeymap = default_fkeytab; - fkeymap_size = - sizeof(default_fkeytab)/sizeof(default_fkeytab[0]); + fkeymap_size = nitems(default_fkeytab); needfree = 0; } else if (*kbdp == NULL) { *kbdp = kbd = malloc(sizeof(*kbd), M_DEVBUF, M_NOWAIT | M_ZERO); @@ -1506,12 +1505,12 @@ typematic(int delay, int rate) int value; int i; - for (i = sizeof(delays)/sizeof(delays[0]) - 1; i > 0; --i) { + for (i = nitems(delays) - 1; i > 0; --i) { if (delay >= delays[i]) break; } value = i << 5; - for (i = sizeof(rates)/sizeof(rates[0]) - 1; i > 0; --i) { + for (i = nitems(rates) - 1; i > 0; --i) { if (rate >= rates[i]) break; } Modified: head/sys/dev/atkbdc/atkbdc.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/atkbdc/atkbdc.c Tue Apr 19 23:37:24 2016 (r298307) @@ -154,7 +154,7 @@ atkbdc_softc_t { atkbdc_softc_t *sc; - if (unit >= sizeof(atkbdc_softc)/sizeof(atkbdc_softc[0])) + if (unit >= nitems(atkbdc_softc)) return NULL; sc = atkbdc_softc[unit]; if (sc == NULL) { Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/atkbdc/psm.c Tue Apr 19 23:37:24 2016 (r298307) @@ -524,8 +524,7 @@ static struct { { MOUSE_MODEL_GENERIC, 0xc0, MOUSE_PS2_PACKETSIZE, NULL }, }; -#define GENERIC_MOUSE_ENTRY \ - ((sizeof(vendortype) / sizeof(*vendortype)) - 1) +#define GENERIC_MOUSE_ENTRY (nitems(vendortype) - 1) /* device driver declarateion */ static device_method_t psm_methods[] = { @@ -3874,7 +3873,7 @@ enable_kmouse(struct psm_softc *sc, enum * The special sequence to enable the third and fourth buttons. * Otherwise they behave like the first and second buttons. */ - for (i = 0; i < sizeof(rate)/sizeof(rate[0]); ++i) + for (i = 0; i < nitems(rate); ++i) if (set_mouse_sampling_rate(kbdc, rate[i]) != rate[i]) return (FALSE); @@ -3971,7 +3970,7 @@ enable_msexplorer(struct psm_softc *sc, enable_msintelli(sc, arg); /* the special sequence to enable the extra buttons and the roller. */ - for (i = 0; i < sizeof(rate1)/sizeof(rate1[0]); ++i) + for (i = 0; i < nitems(rate1); ++i) if (set_mouse_sampling_rate(kbdc, rate1[i]) != rate1[i]) return (FALSE); /* the device will give the genuine ID only after the above sequence */ @@ -3994,7 +3993,7 @@ enable_msexplorer(struct psm_softc *sc, * sequence; it will make the KVM think the mouse is IntelliMouse * when it is in fact IntelliMouse Explorer. */ - for (i = 0; i < sizeof(rate0)/sizeof(rate0[0]); ++i) + for (i = 0; i < nitems(rate0); ++i) if (set_mouse_sampling_rate(kbdc, rate0[i]) != rate0[i]) break; get_aux_id(kbdc); @@ -4016,7 +4015,7 @@ enable_msintelli(struct psm_softc *sc, e int i; /* the special sequence to enable the third button and the roller. */ - for (i = 0; i < sizeof(rate)/sizeof(rate[0]); ++i) + for (i = 0; i < nitems(rate); ++i) if (set_mouse_sampling_rate(kbdc, rate[i]) != rate[i]) return (FALSE); /* the device will give the genuine ID only after the above sequence */ @@ -4044,7 +4043,7 @@ enable_4dmouse(struct psm_softc *sc, enu int id; int i; - for (i = 0; i < sizeof(rate)/sizeof(rate[0]); ++i) + for (i = 0; i < nitems(rate); ++i) if (set_mouse_sampling_rate(kbdc, rate[i]) != rate[i]) return (FALSE); id = get_aux_id(kbdc); Modified: head/sys/dev/bktr/bktr_core.c ============================================================================== --- head/sys/dev/bktr/bktr_core.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/bktr/bktr_core.c Tue Apr 19 23:37:24 2016 (r298307) @@ -324,7 +324,7 @@ static struct meteor_pixfmt_internal { { { 0, METEOR_PIXTYPE_YUV_12, 2, { 0xff0000,0x00ff00,0x0000ff }, 1,1 }, 0x88 }, }; -#define PIXFMT_TABLE_SIZE ( sizeof(pixfmt_table) / sizeof(pixfmt_table[0]) ) +#define PIXFMT_TABLE_SIZE nitems(pixfmt_table) /* * Table of Meteor-supported Pixel Formats (for SETGEO compatibility) @@ -354,8 +354,7 @@ static struct { }, }; -#define METEOR_PIXFMT_TABLE_SIZE ( sizeof(meteor_pixfmt_table) / \ - sizeof(meteor_pixfmt_table[0]) ) +#define METEOR_PIXFMT_TABLE_SIZE nitems(meteor_pixfmt_table) #define BSWAP (BT848_COLOR_CTL_BSWAP_ODD | BT848_COLOR_CTL_BSWAP_EVEN) Modified: head/sys/dev/bwi/bwirf.c ============================================================================== --- head/sys/dev/bwi/bwirf.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/bwi/bwirf.c Tue Apr 19 23:37:24 2016 (r298307) @@ -1018,8 +1018,7 @@ bwi_rf_calibval(struct bwi_mac *mac) val = RF_READ(mac, BWI_RFR_BBP_ATTEN); idx = __SHIFTOUT(val, BWI_RFR_BBP_ATTEN_CALIB_IDX); - KASSERT(idx < (int)(sizeof(rf_calibvals) / sizeof(rf_calibvals[0])), - ("idx %d", idx)); + KASSERT(idx < (int)nitems(rf_calibvals), ("idx %d", idx)); calib = rf_calibvals[idx] << 1; if (val & BWI_RFR_BBP_ATTEN_CALIB_BIT) Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/bwn/if_bwn.c Tue Apr 19 23:37:24 2016 (r298307) @@ -906,7 +906,7 @@ bwn_probe(device_t dev) { int i; - for (i = 0; i < sizeof(bwn_devs) / sizeof(bwn_devs[0]); i++) { + for (i = 0; i < nitems(bwn_devs); i++) { if (siba_get_vendor(dev) == bwn_devs[i].sd_vendor && siba_get_device(dev) == bwn_devs[i].sd_device && siba_get_revid(dev) == bwn_devs[i].sd_rev) Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/cardbus/cardbus_cis.c Tue Apr 19 23:37:24 2016 (r298307) @@ -205,7 +205,7 @@ decode_tuple_funcid(device_t cbdev, devi struct tuple_callbacks *info, void *argp) { struct cardbus_devinfo *dinfo = device_get_ivars(child); - int numnames = sizeof(funcnames) / sizeof(funcnames[0]); + int numnames = nitems(funcnames); int i; if (cardbus_cis_debug) { Modified: head/sys/dev/digi/digi.c ============================================================================== --- head/sys/dev/digi/digi.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/digi/digi.c Tue Apr 19 23:37:24 2016 (r298307) @@ -1441,8 +1441,8 @@ digi_errortxt(int id) "tty-level buffer overflow", }; - KASSERT(id >= 0 && id < sizeof(error_desc) / sizeof(error_desc[0]), - ("Unexpected digi error id %d\n", id)); + KASSERT(id >= 0 && id < nitems(error_desc), + ("Unexpected digi error id %d\n", id)); return (error_desc[id]); } Modified: head/sys/dev/digi/digi_isa.c ============================================================================== --- head/sys/dev/digi/digi_isa.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/digi/digi_isa.c Tue Apr 19 23:37:24 2016 (r298307) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); static u_long digi_validio[] = { 0x100, 0x110, 0x120, 0x200, 0x220, 0x300, 0x320 }; -#define DIGI_NVALIDIO (sizeof(digi_validio) / sizeof(digi_validio[0])) +#define DIGI_NVALIDIO nitems(digi_validio) #define IO_SIZE 0x04 static u_long digi_validmem[] = { @@ -68,7 +68,7 @@ static u_long digi_validmem[] = { 0xf6000000, 0xf7000000, 0xf8000000, 0xf9000000, 0xfa000000, 0xfb000000, 0xfc000000, 0xfd000000, 0xfe000000, 0xff000000 }; -#define DIGI_NVALIDMEM (sizeof(digi_validmem) / sizeof(digi_validmem[0])) +#define DIGI_NVALIDMEM (nitems(digi_validmem)) static u_char * digi_isa_setwin(struct digi_softc *sc, unsigned int addr) Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/dwc/if_dwc.c Tue Apr 19 23:37:24 2016 (r298307) @@ -1049,7 +1049,7 @@ dwc_reset(device_t dev) } if (GPIO_MAP_GPIOS(gpio, node, gpio_node, - sizeof(gpio_prop) / sizeof(gpio_prop[0]) - 1, + nitems(gpio_prop) - 1, gpio_prop + 1, &pin, &flags) != 0) { device_printf(dev, "Can't map gpio for phy reset\n"); return (ENXIO); Modified: head/sys/dev/ed/if_ed_hpp.c ============================================================================== --- head/sys/dev/ed/if_ed_hpp.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/ed/if_ed_hpp.c Tue Apr 19 23:37:24 2016 (r298307) @@ -214,7 +214,7 @@ ed_probe_HP_pclanp(device_t dev, int por * Check for impossible IRQ. */ - if (irq >= (sizeof(ed_hpp_intr_val) / sizeof(ed_hpp_intr_val[0]))) + if (irq >= (nitems(ed_hpp_intr_val))) return (ENXIO); /* Modified: head/sys/dev/ed/if_ed_isa.c ============================================================================== --- head/sys/dev/ed/if_ed_isa.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/ed/if_ed_isa.c Tue Apr 19 23:37:24 2016 (r298307) @@ -202,5 +202,5 @@ DRIVER_MODULE(ed, isa, ed_isa_driver, ed MODULE_DEPEND(ed, isa, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); MODULE_PNP_INFO("E:pnpid;", isa, ed, ed_ids, sizeof(ed_ids[0]), - sizeof(ed_ids) / sizeof(ed_ids[0]) - 1); + nitems(ed_ids) - 1); Modified: head/sys/dev/ed/if_ed_pci.c ============================================================================== --- head/sys/dev/ed/if_ed_pci.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/ed/if_ed_pci.c Tue Apr 19 23:37:24 2016 (r298307) @@ -144,5 +144,5 @@ DRIVER_MODULE(ed, pci, ed_pci_driver, ed MODULE_DEPEND(ed, pci, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ed, pci_ids, sizeof(pci_ids[0]), - sizeof(pci_ids) / sizeof(pci_ids[0]) - 1); + nitems(pci_ids) - 1); Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/flash/mx25l.c Tue Apr 19 23:37:24 2016 (r298307) @@ -189,7 +189,7 @@ mx25l_get_device_ident(struct mx25l_soft dev_id = (rxBuf[2] << 8) | (rxBuf[3]); for (i = 0; - i < sizeof(flash_devices)/sizeof(struct mx25l_flash_ident); i++) { + i < nitems(flash_devices); i++) { if ((flash_devices[i].manufacturer_id == manufacturer_id) && (flash_devices[i].device_id == dev_id)) return &flash_devices[i]; Modified: head/sys/dev/hatm/if_hatm.c ============================================================================== --- head/sys/dev/hatm/if_hatm.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/hatm/if_hatm.c Tue Apr 19 23:37:24 2016 (r298307) @@ -608,7 +608,7 @@ hatm_read_prom_byte(struct hatm_softc *s BARRIER_W(sc); /* send READ */ - for (i = 0; i < sizeof(readtab) / sizeof(readtab[0]); i++) { + for (i = 0; i < nitems(readtab); i++) { WRITE4(sc, HE_REGO_HOST_CNTL, val | readtab[i]); BARRIER_W(sc); DELAY(EEPROM_DELAY); Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/hifn/hifn7751.c Tue Apr 19 23:37:24 2016 (r298307) @@ -1029,7 +1029,7 @@ hifn_enable_crypto(struct hifn_softc *sc u_int32_t dmacfg, ramcfg, encl, addr, i; char *offtbl = NULL; - for (i = 0; i < sizeof(pci2id)/sizeof(pci2id[0]); i++) { + for (i = 0; i < nitems(pci2id); i++) { if (pci2id[i].pci_vendor == pci_get_vendor(sc->sc_dev) && pci2id[i].pci_prod == pci_get_device(sc->sc_dev)) { offtbl = pci2id[i].card_id; Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/if_ndis/if_ndis.c Tue Apr 19 23:37:24 2016 (r298307) @@ -2400,7 +2400,7 @@ ndis_setstate_80211(struct ndis_softc *s /* Set TX power */ if ((ic->ic_caps & IEEE80211_C_TXPMGT) && - ic->ic_txpowlimit < (sizeof(dBm2mW) / sizeof(dBm2mW[0]))) { + ic->ic_txpowlimit < nitems(dBm2mW)) { arg = dBm2mW[ic->ic_txpowlimit]; len = sizeof(arg); ndis_set_info(sc, OID_802_11_TX_POWER_LEVEL, &arg, &len); @@ -2810,7 +2810,7 @@ ndis_getstate_80211(struct ndis_softc *s if (ic->ic_caps & IEEE80211_C_TXPMGT) { len = sizeof(arg); ndis_get_info(sc, OID_802_11_TX_POWER_LEVEL, &arg, &len); - for (i = 0; i < (sizeof(dBm2mW) / sizeof(dBm2mW[0])); i++) + for (i = 0; i < nitems(dBm2mW); i++) if (dBm2mW[i] >= arg) break; ic->ic_txpowlimit = i; Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/jme/if_jme.c Tue Apr 19 23:37:24 2016 (r298307) @@ -337,8 +337,7 @@ jme_probe(device_t dev) vendor = pci_get_vendor(dev); devid = pci_get_device(dev); sp = jme_devs; - for (i = 0; i < sizeof(jme_devs) / sizeof(jme_devs[0]); - i++, sp++) { + for (i = 0; i < nitems(jme_devs); i++, sp++) { if (vendor == sp->jme_vendorid && devid == sp->jme_deviceid) { device_set_desc(dev, sp->jme_name); Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/kbd/kbd.c Tue Apr 19 23:37:24 2016 (r298307) @@ -1144,7 +1144,7 @@ static char }; int i; - for (i = 0; i < sizeof(name_table)/sizeof(name_table[0]); ++i) { + for (i = 0; i < nitems(name_table); ++i) { if (type == name_table[i].type) return (name_table[i].name); } Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/mlx/mlx.c Tue Apr 19 23:37:24 2016 (r298307) @@ -1364,7 +1364,7 @@ mlx_periodic_eventlog_respond(struct mlx /* Mylex vendor-specific message indicating a drive was killed? */ if ((el->el_sensekey == 9) && (el->el_asc == 0x80)) { - if (el->el_asq < (sizeof(mlx_sense_messages) / sizeof(mlx_sense_messages[0]))) { + if (el->el_asq < nitems(mlx_sense_messages)) { reason = mlx_sense_messages[el->el_asq]; } else { reason = "for unknown reason"; Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/mxge/if_mxge.c Tue Apr 19 23:37:24 2016 (r298307) @@ -2994,16 +2994,14 @@ mxge_media_probe(mxge_softc_t *sc) /* -R is XFP */ mxge_media_types = mxge_xfp_media_types; mxge_media_type_entries = - sizeof (mxge_xfp_media_types) / - sizeof (mxge_xfp_media_types[0]); + nitems(mxge_xfp_media_types); byte = MXGE_XFP_COMPLIANCE_BYTE; cage_type = "XFP"; } else if (sc->connector == MXGE_SFP) { /* -S or -2S is SFP+ */ mxge_media_types = mxge_sfp_media_types; mxge_media_type_entries = - sizeof (mxge_sfp_media_types) / - sizeof (mxge_sfp_media_types[0]); + nitems(mxge_sfp_media_types); cage_type = "SFP+"; byte = 3; } else { Modified: head/sys/dev/nand/nand_id.c ============================================================================== --- head/sys/dev/nand/nand_id.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/nand/nand_id.c Tue Apr 19 23:37:24 2016 (r298307) @@ -59,7 +59,7 @@ struct nand_params *nand_get_params(stru { int i; - for (i = 0; i < sizeof(nand_ids) / sizeof(nand_ids[0]); i++) + for (i = 0; i < nitems(nand_ids); i++) if (nand_ids[i].id.man_id == id->man_id && nand_ids[i].id.dev_id == id->dev_id) return (&nand_ids[i]); Modified: head/sys/dev/ncr/ncr.c ============================================================================== --- head/sys/dev/ncr/ncr.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/ncr/ncr.c Tue Apr 19 23:37:24 2016 (r298307) @@ -3230,7 +3230,7 @@ static int ncr_chip_lookup(u_long device int i, found; found = -1; - for (i = 0; i < sizeof(ncr_chip_table)/sizeof(ncr_chip_table[0]); i++) { + for (i = 0; i < nitems(ncr_chip_table); i++) { if (device_id == ncr_chip_table[i].device_id && ncr_chip_table[i].minrevid <= revision_id) { if (found < 0 || Modified: head/sys/dev/nctgpio/nctgpio.c ============================================================================== --- head/sys/dev/nctgpio/nctgpio.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/nctgpio/nctgpio.c Tue Apr 19 23:37:24 2016 (r298307) @@ -455,7 +455,7 @@ nct_probe(device_t dev) sc = device_get_softc(dev); - for (i = 0; i < sizeof(probe_addrs) / sizeof(*probe_addrs); i++) { + for (i = 0; i < nitems(probe_addrs); i++) { sc->rid = 0; sc->portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->rid, probe_addrs[i], probe_addrs[i] + 1, 2, RF_ACTIVE); @@ -476,7 +476,7 @@ nct_probe(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, sc->rid, sc->portres); bus_delete_resource(dev, SYS_RES_IOPORT, sc->rid); - for (j = 0; j < sizeof(nct_devs) / sizeof(*nct_devs); j++) { + for (j = 0; j < nitems(nct_devs); j++) { if (chipid == nct_devs[j].chip_id) { rc = bus_set_resource(dev, SYS_RES_IOPORT, 0, probe_addrs[i], 2); if (rc != 0) { Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/nfe/if_nfe.c Tue Apr 19 23:37:24 2016 (r298307) @@ -843,7 +843,7 @@ nfe_can_use_msix(struct nfe_softc *sc) product = kern_getenv("smbios.planar.product"); use_msix = 1; if (maker != NULL && product != NULL) { - count = sizeof(msix_blacklists) / sizeof(msix_blacklists[0]); + count = nitems(msix_blacklists); mblp = msix_blacklists; for (n = 0; n < count; n++) { if (strcmp(maker, mblp->maker) == 0 && Modified: head/sys/dev/patm/if_patm_attach.c ============================================================================== --- head/sys/dev/patm/if_patm_attach.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/patm/if_patm_attach.c Tue Apr 19 23:37:24 2016 (r298307) @@ -675,7 +675,7 @@ patm_read_eeprom(struct patm_softc *sc) gp = patm_nor_read(sc, IDT_NOR_GP); gp &= ~(IDT_GP_EESCLK | IDT_GP_EECS | IDT_GP_EEDO); - for (i = 0; i < sizeof(tab) / sizeof(tab[0]); i++) { + for (i = 0; i < nitems(tab); i++) { patm_nor_write(sc, IDT_NOR_GP, gp | tab[i]); DELAY(40); } Modified: head/sys/dev/rc/rc.c ============================================================================== --- head/sys/dev/rc/rc.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/rc/rc.c Tue Apr 19 23:37:24 2016 (r298307) @@ -186,7 +186,7 @@ rc_probe(device_t dev) if (port == -1) return (ENXIO); found = 0; - for (i = 0; i < sizeof(rc_ports) / sizeof(int); i++) + for (i = 0; i < nitems(rc_ports); i++) if (rc_ports[i] == port) { found = 1; break; Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/re/if_re.c Tue Apr 19 23:37:24 2016 (r298307) @@ -953,7 +953,7 @@ re_probe(device_t dev) } t = re_devs; - for (i = 0; i < sizeof(re_devs) / sizeof(re_devs[0]); i++, t++) { + for (i = 0; i < nitems(re_devs); i++, t++) { if (vendor == t->rl_vid && devid == t->rl_did) { device_set_desc(dev, t->rl_name); return (BUS_PROBE_DEFAULT); Modified: head/sys/dev/rl/if_rl.c ============================================================================== --- head/sys/dev/rl/if_rl.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/rl/if_rl.c Tue Apr 19 23:37:24 2016 (r298307) @@ -598,7 +598,7 @@ rl_probe(device_t dev) } } t = rl_devs; - for (i = 0; i < sizeof(rl_devs) / sizeof(rl_devs[0]); i++, t++) { + for (i = 0; i < nitems(rl_devs); i++, t++) { if (vendor == t->rl_vid && devid == t->rl_did) { device_set_desc(dev, t->rl_name); return (BUS_PROBE_DEFAULT); Modified: head/sys/dev/sf/if_sf.c ============================================================================== --- head/sys/dev/sf/if_sf.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/sf/if_sf.c Tue Apr 19 23:37:24 2016 (r298307) @@ -710,7 +710,7 @@ sf_probe(device_t dev) sdid = pci_get_subdevice(dev); t = sf_devs; - for (i = 0; i < sizeof(sf_devs) / sizeof(sf_devs[0]); i++, t++) { + for (i = 0; i < nitems(sf_devs); i++, t++) { if (vid == t->sf_vid && did == t->sf_did) { if (sdid == t->sf_sdid) { device_set_desc(dev, t->sf_sname); Modified: head/sys/dev/sio/sio.c ============================================================================== --- head/sys/dev/sio/sio.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/sio/sio.c Tue Apr 19 23:37:24 2016 (r298307) @@ -1638,7 +1638,7 @@ txrdy: outb(com->data_port, *ioptr++); ++com->bytes_out; if (com->unit == siotsunit - && siotso < sizeof siots / sizeof siots[0]) + && siotso < nitems(siots)) nanouptime(&siots[siotso++]); } com->obufq.l_head = ioptr; Modified: head/sys/dev/sound/isa/gusc.c ============================================================================== --- head/sys/dev/sound/isa/gusc.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/sound/isa/gusc.c Tue Apr 19 23:37:24 2016 (r298307) @@ -491,7 +491,7 @@ alloc_resource(sc_p scp) base = isa_get_port(scp->dev); else base = 0; - for (i = 0 ; i < sizeof(scp->io) / sizeof(*scp->io) ; i++) { + for (i = 0 ; i < nitems(scp->io); i++) { if (scp->io[i] == NULL) { scp->io_rid[i] = i; if (base == 0) @@ -521,7 +521,7 @@ alloc_resource(sc_p scp) return (1); scp->irq_alloced = 0; } - for (i = 0 ; i < sizeof(scp->drq) / sizeof(*scp->drq) ; i++) { + for (i = 0 ; i < nitems(scp->drq); i++) { if (scp->drq[i] == NULL) { scp->drq_rid[i] = i; if (base == 0 || i == 0) @@ -597,7 +597,7 @@ release_resource(sc_p scp) switch(lid) { case LOGICALID_PCM: case LOGICALID_NOPNP: /* XXX Non-PnP */ - for (i = 0 ; i < sizeof(scp->io) / sizeof(*scp->io) ; i++) { + for (i = 0 ; i < nitems(scp->io); i++) { if (scp->io[i] != NULL) { bus_release_resource(scp->dev, SYS_RES_IOPORT, scp->io_rid[i], scp->io[i]); scp->io[i] = NULL; @@ -607,7 +607,7 @@ release_resource(sc_p scp) bus_release_resource(scp->dev, SYS_RES_IRQ, scp->irq_rid, scp->irq); scp->irq = NULL; } - for (i = 0 ; i < sizeof(scp->drq) / sizeof(*scp->drq) ; i++) { + for (i = 0 ; i < nitems(scp->drq); i++) { if (scp->drq[i] != NULL) { bus_release_resource(scp->dev, SYS_RES_DRQ, scp->drq_rid[i], scp->drq[i]); scp->drq[i] = NULL; Modified: head/sys/dev/speaker/spkr.c ============================================================================== --- head/sys/dev/speaker/spkr.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/speaker/spkr.c Tue Apr 19 23:37:24 2016 (r298307) @@ -327,15 +327,13 @@ playstring(char *cp, size_t slen) slen--; } else { GETNUM(cp, octave); - if (octave >= sizeof(pitchtab) / sizeof(pitchtab[0]) / - OCTAVE_NOTES) + if (octave >= nitems(pitchtab) / OCTAVE_NOTES) octave = DFLT_OCTAVE; octprefix = TRUE; } break; case '>': - if (octave < sizeof(pitchtab) / sizeof(pitchtab[0]) / - OCTAVE_NOTES - 1) + if (octave < nitems(pitchtab) / OCTAVE_NOTES - 1) octave++; octprefix = TRUE; break; Modified: head/sys/dev/stge/if_stge.c ============================================================================== --- head/sys/dev/stge/if_stge.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/stge/if_stge.c Tue Apr 19 23:37:24 2016 (r298307) @@ -416,8 +416,7 @@ stge_probe(device_t dev) vendor = pci_get_vendor(dev); devid = pci_get_device(dev); sp = stge_products; - for (i = 0; i < sizeof(stge_products)/sizeof(stge_products[0]); - i++, sp++) { + for (i = 0; i < nitems(stge_products); i++, sp++) { if (vendor == sp->stge_vendorid && devid == sp->stge_deviceid) { device_set_desc(dev, sp->stge_name); Modified: head/sys/dev/vkbd/vkbd.c ============================================================================== --- head/sys/dev/vkbd/vkbd.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/vkbd/vkbd.c Tue Apr 19 23:37:24 2016 (r298307) @@ -380,11 +380,11 @@ vkbd_dev_write(struct cdev *dev, struct while (uio->uio_resid >= sizeof(q->q[0])) { if (q->head == q->tail) { if (q->cc == 0) - avail = sizeof(q->q)/sizeof(q->q[0]) - q->head; + avail = nitems(q->q) - q->head; else avail = 0; /* queue must be full */ } else if (q->head < q->tail) - avail = sizeof(q->q)/sizeof(q->q[0]) - q->tail; + avail = nitems(q->q) - q->tail; else avail = q->head - q->tail; @@ -410,7 +410,7 @@ vkbd_dev_write(struct cdev *dev, struct q->cc += avail; q->tail += avail; - if (q->tail == sizeof(q->q)/sizeof(q->q[0])) + if (q->tail == nitems(q->q)) q->tail = 0; /* queue interrupt task if needed */ @@ -459,7 +459,7 @@ vkbd_dev_poll(struct cdev *dev, int even } if (events & (POLLOUT | POLLWRNORM)) { - if (q->cc < sizeof(q->q)/sizeof(q->q[0])) + if (q->cc < nitems(q->q)) revents |= events & (POLLOUT | POLLWRNORM); else selrecord(td, &state->ks_wsel); @@ -524,7 +524,7 @@ vkbd_data_read(vkbd_state_t *state, int /* get first code from the queue */ q->cc --; c = q->q[q->head ++]; - if (q->head == sizeof(q->q)/sizeof(q->q[0])) + if (q->head == nitems(q->q)) q->head = 0; /* wakeup ks_inq writers/poll()ers */ @@ -1326,12 +1326,12 @@ typematic(int delay, int rate) int value; int i; - for (i = sizeof(delays)/sizeof(delays[0]) - 1; i > 0; i --) { + for (i = nitems(delays) - 1; i > 0; i --) { if (delay >= delays[i]) break; } value = i << 5; - for (i = sizeof(rates)/sizeof(rates[0]) - 1; i > 0; i --) { + for (i = nitems(rates) - 1; i > 0; i --) { if (rate >= rates[i]) break; } Modified: head/sys/dev/wbwd/wbwd.c ============================================================================== --- head/sys/dev/wbwd/wbwd.c Tue Apr 19 23:31:35 2016 (r298306) +++ head/sys/dev/wbwd/wbwd.c Tue Apr 19 23:37:24 2016 (r298307) @@ -619,7 +619,7 @@ wb_probe_enable(device_t dev, int probe) error = ENXIO; found = 0; - for (i = 0; i < sizeof(probe_addrs) / sizeof(*probe_addrs); i++) { + for (i = 0; i < nitems(probe_addrs); i++) { if (sc != NULL) { /* Allocate bus resources for IO index/data register access. */ @@ -657,7 +657,7 @@ wb_probe_enable(device_t dev, int probe) goto cleanup; } - for (j = 0; j < sizeof(wb_devs) / sizeof(*wb_devs); j++) { + for (j = 0; j < nitems(wb_devs); j++) { if (wb_devs[j].device_id == dev_id) { found = 1; break; From owner-svn-src-all@freebsd.org Tue Apr 19 23:41:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E7B7B15E96; Tue, 19 Apr 2016 23:41:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E5E411BE; Tue, 19 Apr 2016 23:41:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JNflZX096197; Tue, 19 Apr 2016 23:41:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JNfkmK096186; Tue, 19 Apr 2016 23:41:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604192341.u3JNfkmK096186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 23:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298308 - in head/sys: amd64/amd64 amd64/linux amd64/linux32 i386/i386 i386/ibcs2 i386/linux x86/isa x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 23:41:48 -0000 Author: pfg Date: Tue Apr 19 23:41:46 2016 New Revision: 298308 URL: https://svnweb.freebsd.org/changeset/base/298308 Log: X86: use our nitems() macro when it is avaliable through param.h. No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current Modified: head/sys/amd64/amd64/amd64_mem.c head/sys/amd64/amd64/machdep.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/i386/i686_mem.c head/sys/i386/i386/machdep.c head/sys/i386/ibcs2/ibcs2_sysvec.c head/sys/i386/linux/linux_sysvec.c head/sys/x86/isa/atpic.c head/sys/x86/x86/identcpu.c head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/amd64_mem.c ============================================================================== --- head/sys/amd64/amd64/amd64_mem.c Tue Apr 19 23:37:24 2016 (r298307) +++ head/sys/amd64/amd64/amd64_mem.c Tue Apr 19 23:41:46 2016 (r298308) @@ -117,7 +117,7 @@ static int amd64_mtrrtomrt[] = { MDF_WRITEBACK }; -#define MTRRTOMRTLEN (sizeof(amd64_mtrrtomrt) / sizeof(amd64_mtrrtomrt[0])) +#define MTRRTOMRTLEN nitems(amd64_mtrrtomrt) static int amd64_mtrr2mrt(int val) Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Apr 19 23:37:24 2016 (r298307) +++ head/sys/amd64/amd64/machdep.c Tue Apr 19 23:41:46 2016 (r298308) @@ -217,8 +217,8 @@ vm_paddr_t phys_avail[PHYSMAP_SIZE + 2]; vm_paddr_t dump_avail[PHYSMAP_SIZE + 2]; /* must be 2 less so 0 0 can signal end of chunks */ -#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(phys_avail[0])) - 2) -#define DUMP_AVAIL_ARRAY_END ((sizeof(dump_avail) / sizeof(dump_avail[0])) - 2) +#define PHYS_AVAIL_ARRAY_END (nitems(phys_avail) - 2) +#define DUMP_AVAIL_ARRAY_END (nitems(dump_avail) - 2) struct kva_md_info kmi; Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Tue Apr 19 23:37:24 2016 (r298307) +++ head/sys/amd64/linux/linux_sysvec.c Tue Apr 19 23:41:46 2016 (r298308) @@ -186,7 +186,7 @@ static int _bsd_to_linux_trapcode[] = { 15 /* 30 T_RESERVED */ }; #define bsd_to_linux_trapcode(code) \ - ((code) Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2E4CB15F8E; Tue, 19 Apr 2016 23:44:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5B75143B; Tue, 19 Apr 2016 23:44:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JNiX0b096961; Tue, 19 Apr 2016 23:44:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JNiXtb096957; Tue, 19 Apr 2016 23:44:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604192344.u3JNiXtb096957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 23:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298309 - in head/sys/boot: common efi/loader mips/beri/boot2 uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 23:44:35 -0000 Author: pfg Date: Tue Apr 19 23:44:33 2016 New Revision: 298309 URL: https://svnweb.freebsd.org/changeset/base/298309 Log: sys/boot: use our nitems() macro when it is available through param.h. No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current Modified: head/sys/boot/common/part.c head/sys/boot/efi/loader/bootinfo.c head/sys/boot/mips/beri/boot2/boot2.c head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Tue Apr 19 23:41:46 2016 (r298308) +++ head/sys/boot/common/part.c Tue Apr 19 23:44:33 2016 (r298309) @@ -104,7 +104,7 @@ parttype2str(enum partition_type type) { size_t i; - for (i = 0; i < sizeof(ptypes) / sizeof(ptypes[0]); i++) + for (i = 0; i < nitems(ptypes); i++) if (ptypes[i].type == type) return (ptypes[i].desc); return (ptypes[0].desc); Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Tue Apr 19 23:41:46 2016 (r298308) +++ head/sys/boot/efi/loader/bootinfo.c Tue Apr 19 23:44:33 2016 (r298309) @@ -445,7 +445,7 @@ bi_load(char *args, vm_offset_t *modulep /* Do relocation fixup on metadata of each module. */ for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - for (i = 0; i < sizeof mdt / sizeof mdt[0]; i++) { + for (i = 0; i < nitems(mdt); i++) { md = file_findmetadata(xp, mdt[i]); if (md) { bcopy(md->md_data, &vaddr, sizeof vaddr); Modified: head/sys/boot/mips/beri/boot2/boot2.c ============================================================================== --- head/sys/boot/mips/beri/boot2/boot2.c Tue Apr 19 23:41:46 2016 (r298308) +++ head/sys/boot/mips/beri/boot2/boot2.c Tue Apr 19 23:44:33 2016 (r298309) @@ -116,7 +116,7 @@ static const unsigned char flags[NOPT] = /* These must match BOOTINFO_DEV_TYPE constants. */ static const char *const dev_nm[] = {"dram", "cfi", "sdcard"}; -static const u_int dev_nm_count = sizeof(dev_nm) / sizeof(dev_nm[0]); +static const u_int dev_nm_count = nitems(dev_nm); static struct dmadat __dmadat; Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Tue Apr 19 23:41:46 2016 (r298308) +++ head/sys/boot/uboot/common/metadata.c Tue Apr 19 23:44:33 2016 (r298309) @@ -349,7 +349,7 @@ md_load(char *args, vm_offset_t *modulep /* Do relocation fixup on metadata of each module. */ for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - for (i = 0; i < sizeof mdt / sizeof mdt[0]; i++) { + for (i = 0; i < nitems(mdt); i++) { md = file_findmetadata(xp, mdt[i]); if (md) { bcopy(md->md_data, &vaddr, sizeof vaddr); From owner-svn-src-all@freebsd.org Tue Apr 19 23:48:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4E88B15068; Tue, 19 Apr 2016 23:48:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B0A31749; Tue, 19 Apr 2016 23:48:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JNmTuj097181; Tue, 19 Apr 2016 23:48:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JNmRGs097156; Tue, 19 Apr 2016 23:48:27 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604192348.u3JNmRGs097156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 23:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298310 - in head/sys: compat/linux ddb fs/autofs fs/nfs geom/part kern net netinet netinet6 netipsec netnatm netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 23:48:30 -0000 Author: pfg Date: Tue Apr 19 23:48:27 2016 New Revision: 298310 URL: https://svnweb.freebsd.org/changeset/base/298310 Log: kernel: use our nitems() macro when it is available through param.h. No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current Modified: head/sys/compat/linux/linux_socket.c head/sys/ddb/db_variables.c head/sys/fs/autofs/autofs.c head/sys/fs/nfs/nfs_commonkrpc.c head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_ldm.c head/sys/geom/part/g_part_mbr.c head/sys/kern/kern_dump.c head/sys/kern/kern_ffclock.c head/sys/kern/kern_jail.c head/sys/kern/kern_ktrace.c head/sys/kern/subr_hash.c head/sys/kern/subr_witness.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/uipc_usrreq.c head/sys/net/rtsock.c head/sys/netinet/in_proto.c head/sys/netinet/tcp_syncache.c head/sys/netinet6/in6_proto.c head/sys/netipsec/key.c head/sys/netipsec/keysock.c head/sys/netnatm/natm_proto.c head/sys/netsmb/smb_smb.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/compat/linux/linux_socket.c Tue Apr 19 23:48:27 2016 (r298310) @@ -1703,7 +1703,7 @@ static const unsigned char lxs_args[] = LINUX_AL(4) /* sendmmsg */ }; -#define LINUX_AL_SIZE sizeof(lxs_args) / sizeof(lxs_args[0]) - 1 +#define LINUX_AL_SIZE (nitems(lxs_args) - 1) int linux_socketcall(struct thread *td, struct linux_socketcall_args *args) Modified: head/sys/ddb/db_variables.c ============================================================================== --- head/sys/ddb/db_variables.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/ddb/db_variables.c Tue Apr 19 23:48:27 2016 (r298310) @@ -54,7 +54,7 @@ static struct db_variable db_vars[] = { #endif }; static struct db_variable *db_evars = - db_vars + sizeof(db_vars)/sizeof(db_vars[0]); + db_vars + nitems(db_vars); static int db_find_variable(struct db_variable **varp) Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/fs/autofs/autofs.c Tue Apr 19 23:48:27 2016 (r298310) @@ -354,7 +354,7 @@ autofs_set_sigmask(sigset_t *oldset) /* Remove the autofs set of signals from newset */ PROC_LOCK(curproc); mtx_lock(&curproc->p_sigacts->ps_mtx); - for (i = 0 ; i < sizeof(autofs_sig_set)/sizeof(int) ; i++) { + for (i = 0 ; i < nitems(autofs_sig_set); i++) { /* * But make sure we leave the ones already masked * by the process, i.e. remove the signal from the Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/fs/nfs/nfs_commonkrpc.c Tue Apr 19 23:48:27 2016 (r298310) @@ -1053,7 +1053,7 @@ nfs_sig_pending(sigset_t set) { int i; - for (i = 0 ; i < sizeof(newnfs_sig_set)/sizeof(int) ; i++) + for (i = 0 ; i < nitems(newnfs_sig_set); i++) if (SIGISMEMBER(set, newnfs_sig_set[i])) return (1); return (0); @@ -1078,7 +1078,7 @@ newnfs_set_sigmask(struct thread *td, si /* Remove the NFS set of signals from newset */ PROC_LOCK(p); mtx_lock(&p->p_sigacts->ps_mtx); - for (i = 0 ; i < sizeof(newnfs_sig_set)/sizeof(int) ; i++) { + for (i = 0 ; i < nitems(newnfs_sig_set); i++) { /* * But make sure we leave the ones already masked * by the process, ie. remove the signal from the Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/geom/part/g_part_bsd.c Tue Apr 19 23:48:27 2016 (r298310) @@ -141,7 +141,7 @@ bsd_parse_type(const char *type, uint8_t return (0); } for (i = 0; - i < sizeof(bsd_alias_match) / sizeof(bsd_alias_match[0]); i++) { + i < nitems(bsd_alias_match); i++) { alias = g_part_alias_name(bsd_alias_match[i].alias); if (strcasecmp(type, alias) == 0) { *fstype = bsd_alias_match[i].type; Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/geom/part/g_part_ebr.c Tue Apr 19 23:48:27 2016 (r298310) @@ -189,7 +189,7 @@ ebr_parse_type(const char *type, u_char return (0); } for (i = 0; - i < sizeof(ebr_alias_match) / sizeof(ebr_alias_match[0]); i++) { + i < nitems(ebr_alias_match); i++) { alias = g_part_alias_name(ebr_alias_match[i].alias); if (strcasecmp(type, alias) == 0) { *dp_typ = ebr_alias_match[i].typ; @@ -604,7 +604,7 @@ g_part_ebr_type(struct g_part_table *bas entry = (struct g_part_ebr_entry *)baseentry; for (i = 0; - i < sizeof(ebr_alias_match) / sizeof(ebr_alias_match[0]); i++) { + i < nitems(ebr_alias_match); i++) { if (ebr_alias_match[i].typ == entry->ent.dp_typ) return (g_part_alias_name(ebr_alias_match[i].alias)); } Modified: head/sys/geom/part/g_part_ldm.c ============================================================================== --- head/sys/geom/part/g_part_ldm.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/geom/part/g_part_ldm.c Tue Apr 19 23:48:27 2016 (r298310) @@ -454,7 +454,7 @@ ldm_privhdr_check(struct ldm_db *db, str } else last = pp->mediasize / pp->sectorsize - 1; for (found = 0, i = is_gpt; - i < sizeof(ldm_ph_off) / sizeof(ldm_ph_off[0]); i++) { + i < nitems(ldm_ph_off); i++) { offset = ldm_ph_off[i]; /* * In the GPT case consumer is attached to the LDM metadata @@ -1469,7 +1469,7 @@ g_part_ldm_type(struct g_part_table *bas entry = (struct g_part_ldm_entry *)baseentry; for (i = 0; - i < sizeof(ldm_alias_match) / sizeof(ldm_alias_match[0]); i++) { + i < nitems(ldm_alias_match); i++) { if (ldm_alias_match[i].typ == entry->type) return (g_part_alias_name(ldm_alias_match[i].alias)); } Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/geom/part/g_part_mbr.c Tue Apr 19 23:48:27 2016 (r298310) @@ -159,7 +159,7 @@ mbr_parse_type(const char *type, u_char return (0); } for (i = 0; - i < sizeof(mbr_alias_match) / sizeof(mbr_alias_match[0]); i++) { + i < nitems(mbr_alias_match); i++) { alias = g_part_alias_name(mbr_alias_match[i].alias); if (strcasecmp(type, alias) == 0) { *dp_typ = mbr_alias_match[i].typ; @@ -561,7 +561,7 @@ g_part_mbr_type(struct g_part_table *bas entry = (struct g_part_mbr_entry *)baseentry; for (i = 0; - i < sizeof(mbr_alias_match) / sizeof(mbr_alias_match[0]); i++) { + i < nitems(mbr_alias_match); i++) { if (mbr_alias_match[i].typ == entry->ent.dp_typ) return (g_part_alias_name(mbr_alias_match[i].alias)); } Modified: head/sys/kern/kern_dump.c ============================================================================== --- head/sys/kern/kern_dump.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/kern/kern_dump.c Tue Apr 19 23:48:27 2016 (r298310) @@ -71,7 +71,7 @@ dumpsys_gen_pa_init(void) int n, idx; bzero(dump_map, sizeof(dump_map)); - for (n = 0; n < sizeof(dump_map) / sizeof(dump_map[0]); n++) { + for (n = 0; n < nitems(dump_map); n++) { idx = n * 2; if (dump_avail[idx] == 0 && dump_avail[idx + 1] == 0) break; Modified: head/sys/kern/kern_ffclock.c ============================================================================== --- head/sys/kern/kern_ffclock.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/kern/kern_ffclock.c Tue Apr 19 23:48:27 2016 (r298310) @@ -160,7 +160,7 @@ SYSCTL_NODE(_kern_sysclock, OID_AUTO, ff static char *sysclocks[] = {"feedback", "feed-forward"}; #define MAX_SYSCLOCK_NAME_LEN 16 -#define NUM_SYSCLOCKS (sizeof(sysclocks) / sizeof(*sysclocks)) +#define NUM_SYSCLOCKS nitems(sysclocks) static int ffclock_version = 2; SYSCTL_INT(_kern_sysclock_ffclock, OID_AUTO, version, CTLFLAG_RD, Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/kern/kern_jail.c Tue Apr 19 23:48:27 2016 (r298310) @@ -357,8 +357,7 @@ sys_jail(struct thread *td, struct jail_ int kern_jail(struct thread *td, struct jail *j) { - struct iovec optiov[2 * (4 - + sizeof(pr_allow_names) / sizeof(pr_allow_names[0]) + struct iovec optiov[2 * (4 + nitems(pr_allow_names) #ifdef INET + 1 #endif @@ -389,8 +388,7 @@ kern_jail(struct thread *td, struct jail /* Set permissions for top-level jails from sysctls. */ if (!jailed(td->td_ucred)) { - for (fi = 0; fi < sizeof(pr_allow_names) / - sizeof(pr_allow_names[0]); fi++) { + for (fi = 0; fi < nitems(pr_allow_names); fi++) { optiov[opt.uio_iovcnt].iov_base = (jail_default_allow & (1 << fi)) ? pr_allow_names[fi] : pr_allow_nonames[fi]; @@ -503,8 +501,8 @@ kern_jail(struct thread *td, struct jail } opt.uio_iovcnt++; #endif - KASSERT(opt.uio_iovcnt <= sizeof(optiov) / sizeof(optiov[0]), - ("kern_jail: too many iovecs (%d)", opt.uio_iovcnt)); + KASSERT(opt.uio_iovcnt <= nitems(optiov), + ("kern_jail: too many iovecs (%d)", opt.uio_iovcnt)); error = kern_jail_set(td, &opt, JAIL_CREATE | JAIL_ATTACH); free(u_path, M_TEMP); return (error); @@ -651,16 +649,14 @@ kern_jail_set(struct thread *td, struct gotrsnum = 1; pr_flags = ch_flags = 0; - for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); - fi++) { + for (fi = 0; fi < nitems(pr_flag_names); fi++) { if (pr_flag_names[fi] == NULL) continue; vfs_flagopt(opts, pr_flag_names[fi], &pr_flags, 1 << fi); vfs_flagopt(opts, pr_flag_nonames[fi], &ch_flags, 1 << fi); } ch_flags |= pr_flags; - for (fi = 0; fi < sizeof(pr_flag_jailsys) / sizeof(pr_flag_jailsys[0]); - fi++) { + for (fi = 0; fi < nitems(pr_flag_jailsys); fi++) { error = vfs_copyopt(opts, pr_flag_jailsys[fi].name, &jsys, sizeof(jsys)); if (error == ENOENT) @@ -716,8 +712,7 @@ kern_jail_set(struct thread *td, struct #endif pr_allow = ch_allow = 0; - for (fi = 0; fi < sizeof(pr_allow_names) / sizeof(pr_allow_names[0]); - fi++) { + for (fi = 0; fi < nitems(pr_allow_names); fi++) { vfs_flagopt(opts, pr_allow_names[fi], &pr_allow, 1 << fi); vfs_flagopt(opts, pr_allow_nonames[fi], &ch_allow, 1 << fi); } @@ -2136,8 +2131,7 @@ kern_jail_get(struct thread *td, struct sizeof(pr->pr_devfs_rsnum)); if (error != 0 && error != ENOENT) goto done_deref; - for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); - fi++) { + for (fi = 0; fi < nitems(pr_flag_names); fi++) { if (pr_flag_names[fi] == NULL) continue; i = (pr->pr_flags & (1 << fi)) ? 1 : 0; @@ -2149,8 +2143,7 @@ kern_jail_get(struct thread *td, struct if (error != 0 && error != ENOENT) goto done_deref; } - for (fi = 0; fi < sizeof(pr_flag_jailsys) / sizeof(pr_flag_jailsys[0]); - fi++) { + for (fi = 0; fi < nitems(pr_flag_jailsys); fi++) { i = pr->pr_flags & (pr_flag_jailsys[fi].disable | pr_flag_jailsys[fi].new); i = pr_flag_jailsys[fi].disable && @@ -2162,8 +2155,7 @@ kern_jail_get(struct thread *td, struct if (error != 0 && error != ENOENT) goto done_deref; } - for (fi = 0; fi < sizeof(pr_allow_names) / sizeof(pr_allow_names[0]); - fi++) { + for (fi = 0; fi < nitems(pr_allow_names); fi++) { if (pr_allow_names[fi] == NULL) continue; i = (pr->pr_allow & (1 << fi)) ? 1 : 0; @@ -4694,12 +4686,10 @@ db_show_prison(struct prison *pr) db_printf(" child = %p\n", LIST_FIRST(&pr->pr_children)); db_printf(" sibling = %p\n", LIST_NEXT(pr, pr_sibling)); db_printf(" flags = 0x%x", pr->pr_flags); - for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); - fi++) + for (fi = 0; fi < nitems(pr_flag_names); fi++) if (pr_flag_names[fi] != NULL && (pr->pr_flags & (1 << fi))) db_printf(" %s", pr_flag_names[fi]); - for (fi = 0; fi < sizeof(pr_flag_jailsys) / sizeof(pr_flag_jailsys[0]); - fi++) { + for (fi = 0; fi < nitems(pr_flag_jailsys); fi++) { jsf = pr->pr_flags & (pr_flag_jailsys[fi].disable | pr_flag_jailsys[fi].new); db_printf(" %-16s= %s\n", pr_flag_jailsys[fi].name, @@ -4709,8 +4699,7 @@ db_show_prison(struct prison *pr) : "inherit"); } db_printf(" allow = 0x%x", pr->pr_allow); - for (fi = 0; fi < sizeof(pr_allow_names) / sizeof(pr_allow_names[0]); - fi++) + for (fi = 0; fi < nitems(pr_allow_names); fi++) if (pr_allow_names[fi] != NULL && (pr->pr_allow & (1 << fi))) db_printf(" %s", pr_allow_names[fi]); db_printf("\n"); Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/kern/kern_ktrace.c Tue Apr 19 23:48:27 2016 (r298310) @@ -1163,8 +1163,7 @@ ktr_writerequest(struct thread *td, stru mtx_unlock(&ktrace_mtx); kth = &req->ktr_header; - KASSERT(((u_short)kth->ktr_type & ~KTR_DROP) < - sizeof(data_lengths) / sizeof(data_lengths[0]), + KASSERT(((u_short)kth->ktr_type & ~KTR_DROP) < nitems(data_lengths), ("data_lengths array overflow")); datalen = data_lengths[(u_short)kth->ktr_type & ~KTR_DROP]; buflen = kth->ktr_len; Modified: head/sys/kern/subr_hash.c ============================================================================== --- head/sys/kern/subr_hash.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/kern/subr_hash.c Tue Apr 19 23:48:27 2016 (r298310) @@ -101,7 +101,7 @@ hashdestroy(void *vhashtbl, struct mallo static const int primes[] = { 1, 13, 31, 61, 127, 251, 509, 761, 1021, 1531, 2039, 2557, 3067, 3583, 4093, 4603, 5119, 5623, 6143, 6653, 7159, 7673, 8191, 12281, 16381, 24571, 32749 }; -#define NPRIMES (sizeof(primes) / sizeof(primes[0])) +#define NPRIMES nitems(primes) /* * General routine to allocate a prime number sized hash table. Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/kern/subr_witness.c Tue Apr 19 23:48:27 2016 (r298310) @@ -709,8 +709,7 @@ static struct witness_order_list_entry o */ static struct witness_blessed blessed_list[] = { }; -static int blessed_count = - sizeof(blessed_list) / sizeof(struct witness_blessed); +static int blessed_count = nitems(blessed_list); #endif /* Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/kern/sysv_msg.c Tue Apr 19 23:48:27 2016 (r298310) @@ -1519,7 +1519,7 @@ sys_msgsys(td, uap) if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) return (ENOSYS); if (uap->which < 0 || - uap->which >= sizeof(msgcalls)/sizeof(msgcalls[0])) + uap->which >= nitems(msgcalls)) return (EINVAL); error = (*msgcalls[uap->which])(td, &uap->a2); return (error); Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/kern/sysv_sem.c Tue Apr 19 23:48:27 2016 (r298310) @@ -1401,7 +1401,7 @@ sys_semsys(td, uap) if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) return (ENOSYS); if (uap->which < 0 || - uap->which >= sizeof(semcalls)/sizeof(semcalls[0])) + uap->which >= nitems(semcalls)) return (EINVAL); error = (*semcalls[uap->which])(td, &uap->a2); return (error); Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/kern/uipc_usrreq.c Tue Apr 19 23:48:27 2016 (r298310) @@ -337,7 +337,7 @@ static struct domain localdomain = { .dom_externalize = unp_externalize, .dom_dispose = unp_dispose_so, .dom_protosw = localsw, - .dom_protoswNPROTOSW = &localsw[sizeof(localsw)/sizeof(localsw[0])] + .dom_protoswNPROTOSW = &localsw[nitems(localsw)] }; DOMAIN_SET(local); Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/net/rtsock.c Tue Apr 19 23:48:27 2016 (r298310) @@ -1919,7 +1919,7 @@ static struct domain routedomain = { .dom_family = PF_ROUTE, .dom_name = "route", .dom_protosw = routesw, - .dom_protoswNPROTOSW = &routesw[sizeof(routesw)/sizeof(routesw[0])] + .dom_protoswNPROTOSW = &routesw[nitems(routesw)] }; VNET_DOMAIN_SET(route); Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/netinet/in_proto.c Tue Apr 19 23:48:27 2016 (r298310) @@ -357,7 +357,7 @@ struct domain inetdomain = { .dom_family = AF_INET, .dom_name = "internet", .dom_protosw = inetsw, - .dom_protoswNPROTOSW = &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], + .dom_protoswNPROTOSW = &inetsw[nitems(inetsw)], #ifdef RADIX_MPATH .dom_rtattach = rn4_mpath_inithead, #else Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/netinet/tcp_syncache.c Tue Apr 19 23:48:27 2016 (r298310) @@ -1896,7 +1896,7 @@ syncookie_generate(struct syncache_head /* Map our computed MSS into the 3-bit index. */ mss = min(tcp_mssopt(&sc->sc_inc), max(sc->sc_peer_mss, V_tcp_minmss)); - for (i = sizeof(tcp_sc_msstab) / sizeof(*tcp_sc_msstab) - 1; + for (i = nitems(tcp_sc_msstab) - 1; tcp_sc_msstab[i] > mss && i > 0; i--) ; @@ -1908,7 +1908,7 @@ syncookie_generate(struct syncache_head */ if (sc->sc_flags & SCF_WINSCALE) { wscale = sc->sc_requested_s_scale; - for (i = sizeof(tcp_sc_wstab) / sizeof(*tcp_sc_wstab) - 1; + for (i = nitems(tcp_sc_wstab) - 1; tcp_sc_wstab[i] > wscale && i > 0; i--) ; Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/netinet6/in6_proto.c Tue Apr 19 23:48:27 2016 (r298310) @@ -382,7 +382,7 @@ struct domain inet6domain = { .dom_name = "internet6", .dom_protosw = (struct protosw *)inet6sw, .dom_protoswNPROTOSW = (struct protosw *) - &inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], + &inet6sw[nitems(inet6sw)], #ifdef RADIX_MPATH .dom_rtattach = rn6_mpath_inithead, #else Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/netipsec/key.c Tue Apr 19 23:48:27 2016 (r298310) @@ -3365,7 +3365,7 @@ key_setdumpsa(struct secasvar *sav, u_in goto fail; result = m; - for (i = sizeof(dumporder)/sizeof(dumporder[0]) - 1; i >= 0; i--) { + for (i = nitems(dumporder) - 1; i >= 0; i--) { m = NULL; switch (dumporder[i]) { case SADB_EXT_SA: @@ -7410,7 +7410,7 @@ key_parse(struct mbuf *m, struct socket */ } - if (msg->sadb_msg_type >= sizeof(key_typesw)/sizeof(key_typesw[0]) || + if (msg->sadb_msg_type >= nitems(key_typesw) || key_typesw[msg->sadb_msg_type] == NULL) { PFKEYSTAT_INC(out_invmsgtype); error = EINVAL; @@ -7562,8 +7562,8 @@ key_validate_ext(const struct sadb_ext * return EINVAL; /* if it does not match minimum/maximum length, bail */ - if (ext->sadb_ext_type >= sizeof(minsize) / sizeof(minsize[0]) || - ext->sadb_ext_type >= sizeof(maxsize) / sizeof(maxsize[0])) + if (ext->sadb_ext_type >= nitems(minsize) || + ext->sadb_ext_type >= nitems(maxsize)) return EINVAL; if (!minsize[ext->sadb_ext_type] || len < minsize[ext->sadb_ext_type]) return EINVAL; Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/netipsec/keysock.c Tue Apr 19 23:48:27 2016 (r298310) @@ -564,7 +564,7 @@ struct domain keydomain = { .dom_destroy = key_destroy, #endif .dom_protosw = keysw, - .dom_protoswNPROTOSW = &keysw[sizeof(keysw)/sizeof(keysw[0])] + .dom_protoswNPROTOSW = &keysw[nitems(keysw)] }; VNET_DOMAIN_SET(key); Modified: head/sys/netnatm/natm_proto.c ============================================================================== --- head/sys/netnatm/natm_proto.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/netnatm/natm_proto.c Tue Apr 19 23:48:27 2016 (r298310) @@ -87,7 +87,7 @@ static struct domain natmdomain = { .dom_name = "natm", .dom_init = natm_init, .dom_protosw = natmsw, - .dom_protoswNPROTOSW = &natmsw[sizeof(natmsw)/sizeof(natmsw[0])], + .dom_protoswNPROTOSW = &natmsw[nitems(natmsw)], }; static struct netisr_handler natm_nh = { Modified: head/sys/netsmb/smb_smb.c ============================================================================== --- head/sys/netsmb/smb_smb.c Tue Apr 19 23:44:33 2016 (r298309) +++ head/sys/netsmb/smb_smb.c Tue Apr 19 23:48:27 2016 (r298310) @@ -68,7 +68,7 @@ static struct smb_dialect smb_dialects[] {-1, NULL} }; -#define SMB_DIALECT_MAX (sizeof(smb_dialects) / sizeof(struct smb_dialect) - 2) +#define SMB_DIALECT_MAX (nitems(smb_dialects) - 2) static u_int32_t smb_vc_maxread(struct smb_vc *vcp) From owner-svn-src-all@freebsd.org Tue Apr 19 23:59:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A86D0B154EC; Tue, 19 Apr 2016 23:59:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7996E1C0F; Tue, 19 Apr 2016 23:59:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JNxAQT000429; Tue, 19 Apr 2016 23:59:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JNxAhP000428; Tue, 19 Apr 2016 23:59:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604192359.u3JNxAhP000428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 19 Apr 2016 23:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298311 - head/lib/libc/tests/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 23:59:11 -0000 Author: ngie Date: Tue Apr 19 23:59:10 2016 New Revision: 298311 URL: https://svnweb.freebsd.org/changeset/base/298311 Log: Make sure fmemopen succeeds in :test_append_binary_pos before calling ftell on the FILE object This fixes potential null pointer dereferences on failure CID: 1254952 MFC after: 2 weeks Reported by: Coverity Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/stdio/fmemopen2_test.c Modified: head/lib/libc/tests/stdio/fmemopen2_test.c ============================================================================== --- head/lib/libc/tests/stdio/fmemopen2_test.c Tue Apr 19 23:48:27 2016 (r298310) +++ head/lib/libc/tests/stdio/fmemopen2_test.c Tue Apr 19 23:59:10 2016 (r298311) @@ -250,12 +250,14 @@ ATF_TC_BODY(test_append_binary_pos, tc) FILE *fp; fp = fmemopen(NULL, 16, "ab+"); + ATF_REQUIRE(fp != NULL); ATF_REQUIRE(ftell(fp) == 0L); fclose(fp); /* Make sure that a pre-allocated buffer behaves correctly. */ char buf[] = "Hello"; fp = fmemopen(buf, sizeof(buf), "ab+"); + ATF_REQUIRE(fp != NULL); ATF_REQUIRE(ftell(fp) == strlen(buf)); fclose(fp); } From owner-svn-src-all@freebsd.org Wed Apr 20 00:19:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEDF8B15C47; Wed, 20 Apr 2016 00:19:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2615180E; Wed, 20 Apr 2016 00:19:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K0J4tW006670; Wed, 20 Apr 2016 00:19:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K0J43L006669; Wed, 20 Apr 2016 00:19:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604200019.u3K0J43L006669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 20 Apr 2016 00:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298312 - head/lib/libc/tests/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 00:19:06 -0000 Author: ngie Date: Wed Apr 20 00:19:04 2016 New Revision: 298312 URL: https://svnweb.freebsd.org/changeset/base/298312 Log: Fix double fclose of `fp1` when freopen fails freopen handles closing file descriptors on error, with the exception of fdopen'ed descriptors, so closing an already fclose'd file descriptor is incorrect CID: 1338525 Differential Revision: https://reviews.freebsd.org/D6013 MFC after: 2 weeks Reported by: Coverity Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/stdio/freopen_test.c Modified: head/lib/libc/tests/stdio/freopen_test.c ============================================================================== --- head/lib/libc/tests/stdio/freopen_test.c Tue Apr 19 23:59:10 2016 (r298311) +++ head/lib/libc/tests/stdio/freopen_test.c Wed Apr 20 00:19:04 2016 (r298312) @@ -48,7 +48,6 @@ runtest(const char *fname1, const char * "fopen(\"%s\", \"%s\") failed; errno=%d", fname1, mode1, errno); fp2 = freopen(fname2, mode2, fp1); if (fp2 == NULL) { - fclose(fp1); ATF_REQUIRE_MSG(success == false, "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) succeeded " "unexpectedly", fname2_print, mode2, fname1, mode1); From owner-svn-src-all@freebsd.org Wed Apr 20 00:44:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E196B13790; Wed, 20 Apr 2016 00:44:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EF2614AE; Wed, 20 Apr 2016 00:44:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K0iDIV015471; Wed, 20 Apr 2016 00:44:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K0iDs3015470; Wed, 20 Apr 2016 00:44:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604200044.u3K0iDs3015470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Apr 2016 00:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298313 - stable/10/sbin/fsck_msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 00:44:14 -0000 Author: pfg Date: Wed Apr 20 00:44:13 2016 New Revision: 298313 URL: https://svnweb.freebsd.org/changeset/base/298313 Log: MFC r297618: fsck_msdosfs(8): Optimimize memsets Obtained from: NetBSD (bin/50908) Modified: stable/10/sbin/fsck_msdosfs/dir.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_msdosfs/dir.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/dir.c Wed Apr 20 00:19:04 2016 (r298312) +++ stable/10/sbin/fsck_msdosfs/dir.c Wed Apr 20 00:44:13 2016 (r298313) @@ -925,6 +925,7 @@ int reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head) { struct dosDirEntry d; + int len; u_char *p; if (!ask(1, "Reconnect")) @@ -976,14 +977,15 @@ reconnect(int dosfs, struct bootblock *b boot->NumFiles++; /* Ensure uniqueness of entry here! XXX */ memset(&d, 0, sizeof d); - (void)snprintf(d.name, sizeof(d.name), "%u", head); + /* worst case -1 = 4294967295, 10 digits */ + len = snprintf(d.name, sizeof(d.name), "%u", head); d.flags = 0; d.head = head; d.size = fat[head].length * boot->ClusterSize; - memset(p, 0, 32); - memset(p, ' ', 11); - memcpy(p, d.name, strlen(d.name)); + memcpy(p, d.name, len); + memset(p + len, ' ', 11 - len); + memset(p + 11, 0, 32 - 11); p[26] = (u_char)d.head; p[27] = (u_char)(d.head >> 8); if (boot->ClustMask == CLUST32_MASK) { From owner-svn-src-all@freebsd.org Wed Apr 20 00:48:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF237B13899; Wed, 20 Apr 2016 00:48:08 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-oi0-x22b.google.com (mail-oi0-x22b.google.com [IPv6:2607:f8b0:4003:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73BF5176A; Wed, 20 Apr 2016 00:48:08 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-oi0-x22b.google.com with SMTP id x201so26247161oif.3; Tue, 19 Apr 2016 17:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc; bh=Crca7+39QE3MZfgnby7i5aVBWEtJyOZoEqw2H3KXPQ0=; b=u+/uyCiO0KMKyJQPGTjAwuSYHVqc8HckMvbeY/o//kooxVcxsbHd0ClQD1GvOL102X 0qV7AnMQpIIB7ZTG5cN066gH2WFP+raJPnlMRNsbXVrB9lgVUwb/M5D5w4e3OkLGfIPG TpIFc4x8vQO4yBoAUCd+KtvVARdFqpGooYoKKI2RvC2UPRKLvdZucRx/Rq5ZTYTkiSpl HEQVE3fdu1uSkSq8LLiDDkquVSUddjlMYbUIWqzCkWg6/glmb8iE/OuvedlI6eRZ8tK2 WfHyOzC4EexD96KFh8MoSR5JDyhM5sB/d/i3sb7l1sfAPEcnbS2GlCaAQR9brDdUqiEs hcCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=Crca7+39QE3MZfgnby7i5aVBWEtJyOZoEqw2H3KXPQ0=; b=frltztjy3XKJ2x3xvRW1cpmrCes++GkKMmZOEoqeF0CcSBm1+GR03jqnGIUNtUbslh 9GXcnkQkPcI/4TpcQGKvwHwrSpMKUC7X5k5yZ2XtLhiQsvKkNqoImsXkfXoPz7UYYR7z JBEmS97HeZlk0TwWaEKZeLWsBm33dMmXqyJ+iaBMCT3mZ1Nbf2IBReNzH8wL861EJCBG KSnnX88itlQtXmffMZDuCTkqeF8X8pDiYLnME2DDwvFkFO0LBclp6JOqBUKZNEpidLXA gfDZFDU3eX/q5BqEvQRBlkjkNELR7fu2ZEGotxOfkoNaJ720fQDHu8/Xs4u4m9WhVaVM rn+Q== X-Gm-Message-State: AOPr4FVgo4HBeQxij3/3vUyMeHYIDe0qjoIRuMXgy1aE5dsN5SpsvWZcByeswXALISlK1e41Oha8T7nfJyS3Mw== MIME-Version: 1.0 X-Received: by 10.157.3.97 with SMTP id 88mr2776859otv.137.1461113287648; Tue, 19 Apr 2016 17:48:07 -0700 (PDT) Received: by 10.182.156.65 with HTTP; Tue, 19 Apr 2016 17:48:07 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <4114217.PtcV9LDMal@ralph.baldwin.cx> References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <4114217.PtcV9LDMal@ralph.baldwin.cx> Date: Wed, 20 Apr 2016 08:48:07 +0800 Message-ID: Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 From: Marcelo Araujo To: John Baldwin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 00:48:08 -0000 2016-04-20 0:16 GMT+08:00 John Baldwin : > On Tuesday, April 19, 2016 04:46:13 AM Marcelo Araujo wrote: > > Author: araujo > > Date: Tue Apr 19 04:46:13 2016 > > New Revision: 298247 > > URL: https://svnweb.freebsd.org/changeset/base/298247 > > > > Log: > > Remove redundant parenthesis. > > > > Submitted by: pfg > > MFC after: 2 weeks. > > For this case, it might be better to remove numentries and use > nitems() directly in the one place it is used. I would probably > even do this as a for-loop: > > struct part_type *ptr; > int counter; > > for (counter = 0, ptr = part_types; counter < nitems(part_types); > counter++, ptr++) { > if (ptr->type == (type & 0x7f)) > return (ptr->name); > } > return ("unknown"); > > If you renamed 'counter' to 'i' you could probably fit it all on one line. > > -- > John Baldwin > Hi John, Yeap, make sense! I came up with something like: struct part_type *ptr = part_types; for (int i = 0; i < nitems(part_types); i++) { if (ptr->type == (type & 0x7f)) return (ptr->name); ptr++; } return("unknown"); What do you think? Best, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Wed Apr 20 00:49:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 451BBB1399D; Wed, 20 Apr 2016 00:49:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2188C19F9; Wed, 20 Apr 2016 00:49:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K0ncZn015708; Wed, 20 Apr 2016 00:49:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K0nbop015698; Wed, 20 Apr 2016 00:49:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604200049.u3K0nbop015698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Apr 2016 00:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298314 - stable/10/lib/libgssapi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 00:49:39 -0000 Author: pfg Date: Wed Apr 20 00:49:37 2016 New Revision: 298314 URL: https://svnweb.freebsd.org/changeset/base/298314 Log: MFC 297942: libgssapi: avoid NULL pointer dereferences. While here also use NULL instead of zero for pointers. Modified: stable/10/lib/libgssapi/gss_add_cred.c stable/10/lib/libgssapi/gss_encapsulate_token.c stable/10/lib/libgssapi/gss_get_mic.c stable/10/lib/libgssapi/gss_inquire_context.c stable/10/lib/libgssapi/gss_mech_switch.c stable/10/lib/libgssapi/gss_pseudo_random.c stable/10/lib/libgssapi/gss_verify_mic.c stable/10/lib/libgssapi/gss_wrap.c stable/10/lib/libgssapi/gss_wrap_size_limit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libgssapi/gss_add_cred.c ============================================================================== --- stable/10/lib/libgssapi/gss_add_cred.c Wed Apr 20 00:44:13 2016 (r298313) +++ stable/10/lib/libgssapi/gss_add_cred.c Wed Apr 20 00:49:37 2016 (r298314) @@ -121,7 +121,7 @@ gss_add_cred(OM_uint32 *minor_status, * gss_add_cred for that mechanism, otherwise we copy the mc * to new_cred. */ - target_mc = 0; + target_mc = NULL; if (cred) { SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) { if (gss_oid_equal(mc->gmc_mech_oid, desired_mech)) { @@ -151,7 +151,7 @@ gss_add_cred(OM_uint32 *minor_status, return (major_status); } } else { - mn = 0; + mn = NULL; } m = _gss_find_mech_switch(desired_mech); Modified: stable/10/lib/libgssapi/gss_encapsulate_token.c ============================================================================== --- stable/10/lib/libgssapi/gss_encapsulate_token.c Wed Apr 20 00:44:13 2016 (r298313) +++ stable/10/lib/libgssapi/gss_encapsulate_token.c Wed Apr 20 00:49:37 2016 (r298314) @@ -47,7 +47,7 @@ gss_encapsulate_token(const gss_buffer_t * First time around, we calculate the size, second time, we * encode the token. */ - p = 0; + p = NULL; for (i = 0; i < 2; i++) { len = 0; Modified: stable/10/lib/libgssapi/gss_get_mic.c ============================================================================== --- stable/10/lib/libgssapi/gss_get_mic.c Wed Apr 20 00:44:13 2016 (r298313) +++ stable/10/lib/libgssapi/gss_get_mic.c Wed Apr 20 00:49:37 2016 (r298314) @@ -40,13 +40,14 @@ gss_get_mic(OM_uint32 *minor_status, gss_buffer_t message_token) { struct _gss_context *ctx = (struct _gss_context *) context_handle; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; _gss_buffer_zero(message_token); if (ctx == NULL) { *minor_status = 0; return (GSS_S_NO_CONTEXT); } + m = ctx->gc_mech; return (m->gm_get_mic(minor_status, ctx->gc_ctx, qop_req, message_buffer, message_token)); Modified: stable/10/lib/libgssapi/gss_inquire_context.c ============================================================================== --- stable/10/lib/libgssapi/gss_inquire_context.c Wed Apr 20 00:44:13 2016 (r298313) +++ stable/10/lib/libgssapi/gss_inquire_context.c Wed Apr 20 00:49:37 2016 (r298314) @@ -99,7 +99,7 @@ gss_inquire_context(OM_uint32 *minor_sta if (src_name) gss_release_name(minor_status, src_name); m->gm_release_name(minor_status, &src_mn); - minor_status = 0; + minor_status = NULL; return (GSS_S_FAILURE); } *targ_name = (gss_name_t) name; Modified: stable/10/lib/libgssapi/gss_mech_switch.c ============================================================================== --- stable/10/lib/libgssapi/gss_mech_switch.c Wed Apr 20 00:44:13 2016 (r298313) +++ stable/10/lib/libgssapi/gss_mech_switch.c Wed Apr 20 00:49:37 2016 (r298314) @@ -83,7 +83,7 @@ _gss_string_to_oid(const char* s, gss_OI * out the size. Second time around, we actually encode the * number. */ - res = 0; + res = NULL; for (i = 0; i < 2; i++) { byte_count = 0; for (p = s, j = 0; p; p = q, j++) { Modified: stable/10/lib/libgssapi/gss_pseudo_random.c ============================================================================== --- stable/10/lib/libgssapi/gss_pseudo_random.c Wed Apr 20 00:44:13 2016 (r298313) +++ stable/10/lib/libgssapi/gss_pseudo_random.c Wed Apr 20 00:49:37 2016 (r298314) @@ -48,7 +48,7 @@ gss_pseudo_random(OM_uint32 *minor_statu gss_buffer_t prf_out) { struct _gss_context *ctx = (struct _gss_context *) context; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; OM_uint32 major_status; _gss_buffer_zero(prf_out); @@ -58,6 +58,7 @@ gss_pseudo_random(OM_uint32 *minor_statu *minor_status = 0; return GSS_S_NO_CONTEXT; } + m = ctx->gc_mech; if (m->gm_pseudo_random == NULL) return GSS_S_UNAVAILABLE; Modified: stable/10/lib/libgssapi/gss_verify_mic.c ============================================================================== --- stable/10/lib/libgssapi/gss_verify_mic.c Wed Apr 20 00:44:13 2016 (r298313) +++ stable/10/lib/libgssapi/gss_verify_mic.c Wed Apr 20 00:49:37 2016 (r298314) @@ -39,7 +39,7 @@ gss_verify_mic(OM_uint32 *minor_status, gss_qop_t *qop_state) { struct _gss_context *ctx = (struct _gss_context *) context_handle; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; if (qop_state) *qop_state = 0; @@ -47,6 +47,7 @@ gss_verify_mic(OM_uint32 *minor_status, *minor_status = 0; return (GSS_S_NO_CONTEXT); } + m = ctx->gc_mech; return (m->gm_verify_mic(minor_status, ctx->gc_ctx, message_buffer, token_buffer, qop_state)); Modified: stable/10/lib/libgssapi/gss_wrap.c ============================================================================== --- stable/10/lib/libgssapi/gss_wrap.c Wed Apr 20 00:44:13 2016 (r298313) +++ stable/10/lib/libgssapi/gss_wrap.c Wed Apr 20 00:49:37 2016 (r298314) @@ -42,7 +42,7 @@ gss_wrap(OM_uint32 *minor_status, gss_buffer_t output_message_buffer) { struct _gss_context *ctx = (struct _gss_context *) context_handle; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; if (conf_state) *conf_state = 0; @@ -51,6 +51,7 @@ gss_wrap(OM_uint32 *minor_status, *minor_status = 0; return (GSS_S_NO_CONTEXT); } + m = ctx->gc_mech; return (m->gm_wrap(minor_status, ctx->gc_ctx, conf_req_flag, qop_req, input_message_buffer, Modified: stable/10/lib/libgssapi/gss_wrap_size_limit.c ============================================================================== --- stable/10/lib/libgssapi/gss_wrap_size_limit.c Wed Apr 20 00:44:13 2016 (r298313) +++ stable/10/lib/libgssapi/gss_wrap_size_limit.c Wed Apr 20 00:49:37 2016 (r298314) @@ -40,13 +40,14 @@ gss_wrap_size_limit(OM_uint32 *minor_sta OM_uint32 *max_input_size) { struct _gss_context *ctx = (struct _gss_context *) context_handle; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; *max_input_size = 0; if (ctx == NULL) { *minor_status = 0; return (GSS_S_NO_CONTEXT); } + m = ctx->gc_mech; return (m->gm_wrap_size_limit(minor_status, ctx->gc_ctx, conf_req_flag, qop_req, req_output_size, max_input_size)); From owner-svn-src-all@freebsd.org Wed Apr 20 00:49:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 385D7B139F1; Wed, 20 Apr 2016 00:49:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08FE91BB3; Wed, 20 Apr 2016 00:49:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K0nnnv015759; Wed, 20 Apr 2016 00:49:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K0nnMW015758; Wed, 20 Apr 2016 00:49:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604200049.u3K0nnMW015758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 20 Apr 2016 00:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298315 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 00:49:50 -0000 Author: ngie Date: Wed Apr 20 00:49:49 2016 New Revision: 298315 URL: https://svnweb.freebsd.org/changeset/base/298315 Log: Don't leak fd on sectorsize malloc failure Also, call endfsent after calling getfsent (i.e. when not explicitly called with a swap device) for code cleanliness CID: 1354785 Differential Revision: https://reviews.freebsd.org/D6014 X-MFC with: r298076 Reported by: Coverity Reviewed by: cem Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Apr 20 00:49:37 2016 (r298314) +++ head/sbin/savecore/savecore.c Wed Apr 20 00:49:49 2016 (r298315) @@ -502,7 +502,7 @@ DoFile(const char *savedir, const char * temp = malloc(sectorsize); if (temp == NULL) { syslog(LOG_ERR, "%m"); - return; + goto closefd; } } if (lseek(fd, lasthd, SEEK_SET) != lasthd || @@ -845,6 +845,7 @@ main(int argc, char **argv) continue; DoFile(savedir, fsp->fs_spec); } + endfsent(); } else { for (i = 0; i < argc; i++) DoFile(savedir, argv[i]); From owner-svn-src-all@freebsd.org Wed Apr 20 00:50:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F7FDB13A9A; Wed, 20 Apr 2016 00:50:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BDF71D9E; Wed, 20 Apr 2016 00:50:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K0oIAG015846; Wed, 20 Apr 2016 00:50:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K0oHhZ015836; Wed, 20 Apr 2016 00:50:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604200050.u3K0oHhZ015836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Apr 2016 00:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298316 - stable/9/lib/libgssapi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 00:50:19 -0000 Author: pfg Date: Wed Apr 20 00:50:17 2016 New Revision: 298316 URL: https://svnweb.freebsd.org/changeset/base/298316 Log: MFC 297942: libgssapi: avoid NULL pointer dereferences. While here also use NULL instead of zero for pointers. Modified: stable/9/lib/libgssapi/gss_add_cred.c stable/9/lib/libgssapi/gss_encapsulate_token.c stable/9/lib/libgssapi/gss_get_mic.c stable/9/lib/libgssapi/gss_inquire_context.c stable/9/lib/libgssapi/gss_mech_switch.c stable/9/lib/libgssapi/gss_pseudo_random.c stable/9/lib/libgssapi/gss_verify_mic.c stable/9/lib/libgssapi/gss_wrap.c stable/9/lib/libgssapi/gss_wrap_size_limit.c Directory Properties: stable/9/lib/libgssapi/ (props changed) Modified: stable/9/lib/libgssapi/gss_add_cred.c ============================================================================== --- stable/9/lib/libgssapi/gss_add_cred.c Wed Apr 20 00:49:49 2016 (r298315) +++ stable/9/lib/libgssapi/gss_add_cred.c Wed Apr 20 00:50:17 2016 (r298316) @@ -121,7 +121,7 @@ gss_add_cred(OM_uint32 *minor_status, * gss_add_cred for that mechanism, otherwise we copy the mc * to new_cred. */ - target_mc = 0; + target_mc = NULL; if (cred) { SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) { if (gss_oid_equal(mc->gmc_mech_oid, desired_mech)) { @@ -151,7 +151,7 @@ gss_add_cred(OM_uint32 *minor_status, return (major_status); } } else { - mn = 0; + mn = NULL; } m = _gss_find_mech_switch(desired_mech); Modified: stable/9/lib/libgssapi/gss_encapsulate_token.c ============================================================================== --- stable/9/lib/libgssapi/gss_encapsulate_token.c Wed Apr 20 00:49:49 2016 (r298315) +++ stable/9/lib/libgssapi/gss_encapsulate_token.c Wed Apr 20 00:50:17 2016 (r298316) @@ -47,7 +47,7 @@ gss_encapsulate_token(const gss_buffer_t * First time around, we calculate the size, second time, we * encode the token. */ - p = 0; + p = NULL; for (i = 0; i < 2; i++) { len = 0; Modified: stable/9/lib/libgssapi/gss_get_mic.c ============================================================================== --- stable/9/lib/libgssapi/gss_get_mic.c Wed Apr 20 00:49:49 2016 (r298315) +++ stable/9/lib/libgssapi/gss_get_mic.c Wed Apr 20 00:50:17 2016 (r298316) @@ -40,13 +40,14 @@ gss_get_mic(OM_uint32 *minor_status, gss_buffer_t message_token) { struct _gss_context *ctx = (struct _gss_context *) context_handle; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; _gss_buffer_zero(message_token); if (ctx == NULL) { *minor_status = 0; return (GSS_S_NO_CONTEXT); } + m = ctx->gc_mech; return (m->gm_get_mic(minor_status, ctx->gc_ctx, qop_req, message_buffer, message_token)); Modified: stable/9/lib/libgssapi/gss_inquire_context.c ============================================================================== --- stable/9/lib/libgssapi/gss_inquire_context.c Wed Apr 20 00:49:49 2016 (r298315) +++ stable/9/lib/libgssapi/gss_inquire_context.c Wed Apr 20 00:50:17 2016 (r298316) @@ -99,7 +99,7 @@ gss_inquire_context(OM_uint32 *minor_sta if (src_name) gss_release_name(minor_status, src_name); m->gm_release_name(minor_status, &src_mn); - minor_status = 0; + minor_status = NULL; return (GSS_S_FAILURE); } *targ_name = (gss_name_t) name; Modified: stable/9/lib/libgssapi/gss_mech_switch.c ============================================================================== --- stable/9/lib/libgssapi/gss_mech_switch.c Wed Apr 20 00:49:49 2016 (r298315) +++ stable/9/lib/libgssapi/gss_mech_switch.c Wed Apr 20 00:50:17 2016 (r298316) @@ -83,7 +83,7 @@ _gss_string_to_oid(const char* s, gss_OI * out the size. Second time around, we actually encode the * number. */ - res = 0; + res = NULL; for (i = 0; i < 2; i++) { byte_count = 0; for (p = s, j = 0; p; p = q, j++) { Modified: stable/9/lib/libgssapi/gss_pseudo_random.c ============================================================================== --- stable/9/lib/libgssapi/gss_pseudo_random.c Wed Apr 20 00:49:49 2016 (r298315) +++ stable/9/lib/libgssapi/gss_pseudo_random.c Wed Apr 20 00:50:17 2016 (r298316) @@ -48,7 +48,7 @@ gss_pseudo_random(OM_uint32 *minor_statu gss_buffer_t prf_out) { struct _gss_context *ctx = (struct _gss_context *) context; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; OM_uint32 major_status; _gss_buffer_zero(prf_out); @@ -58,6 +58,7 @@ gss_pseudo_random(OM_uint32 *minor_statu *minor_status = 0; return GSS_S_NO_CONTEXT; } + m = ctx->gc_mech; if (m->gm_pseudo_random == NULL) return GSS_S_UNAVAILABLE; Modified: stable/9/lib/libgssapi/gss_verify_mic.c ============================================================================== --- stable/9/lib/libgssapi/gss_verify_mic.c Wed Apr 20 00:49:49 2016 (r298315) +++ stable/9/lib/libgssapi/gss_verify_mic.c Wed Apr 20 00:50:17 2016 (r298316) @@ -39,7 +39,7 @@ gss_verify_mic(OM_uint32 *minor_status, gss_qop_t *qop_state) { struct _gss_context *ctx = (struct _gss_context *) context_handle; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; if (qop_state) *qop_state = 0; @@ -47,6 +47,7 @@ gss_verify_mic(OM_uint32 *minor_status, *minor_status = 0; return (GSS_S_NO_CONTEXT); } + m = ctx->gc_mech; return (m->gm_verify_mic(minor_status, ctx->gc_ctx, message_buffer, token_buffer, qop_state)); Modified: stable/9/lib/libgssapi/gss_wrap.c ============================================================================== --- stable/9/lib/libgssapi/gss_wrap.c Wed Apr 20 00:49:49 2016 (r298315) +++ stable/9/lib/libgssapi/gss_wrap.c Wed Apr 20 00:50:17 2016 (r298316) @@ -42,7 +42,7 @@ gss_wrap(OM_uint32 *minor_status, gss_buffer_t output_message_buffer) { struct _gss_context *ctx = (struct _gss_context *) context_handle; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; if (conf_state) *conf_state = 0; @@ -51,6 +51,7 @@ gss_wrap(OM_uint32 *minor_status, *minor_status = 0; return (GSS_S_NO_CONTEXT); } + m = ctx->gc_mech; return (m->gm_wrap(minor_status, ctx->gc_ctx, conf_req_flag, qop_req, input_message_buffer, Modified: stable/9/lib/libgssapi/gss_wrap_size_limit.c ============================================================================== --- stable/9/lib/libgssapi/gss_wrap_size_limit.c Wed Apr 20 00:49:49 2016 (r298315) +++ stable/9/lib/libgssapi/gss_wrap_size_limit.c Wed Apr 20 00:50:17 2016 (r298316) @@ -40,13 +40,14 @@ gss_wrap_size_limit(OM_uint32 *minor_sta OM_uint32 *max_input_size) { struct _gss_context *ctx = (struct _gss_context *) context_handle; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; *max_input_size = 0; if (ctx == NULL) { *minor_status = 0; return (GSS_S_NO_CONTEXT); } + m = ctx->gc_mech; return (m->gm_wrap_size_limit(minor_status, ctx->gc_ctx, conf_req_flag, qop_req, req_output_size, max_input_size)); From owner-svn-src-all@freebsd.org Wed Apr 20 00:55:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B85B13DF1; Wed, 20 Apr 2016 00:55:36 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3570D1187; Wed, 20 Apr 2016 00:55:36 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K0tZsJ018639; Wed, 20 Apr 2016 00:55:35 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K0tZs7018638; Wed, 20 Apr 2016 00:55:35 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604200055.u3K0tZs7018638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 20 Apr 2016 00:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298317 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 00:55:36 -0000 Author: araujo Date: Wed Apr 20 00:55:35 2016 New Revision: 298317 URL: https://svnweb.freebsd.org/changeset/base/298317 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/hastd/subr.c Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Wed Apr 20 00:50:17 2016 (r298316) +++ head/sbin/hastd/subr.c Wed Apr 20 00:55:35 2016 (r298317) @@ -247,7 +247,7 @@ drop_privs(const struct hast_resource *r "Unable to limit capability rights on local descriptor"); } if (cap_ioctls_limit(res->hr_localfd, geomcmds, - sizeof(geomcmds) / sizeof(geomcmds[0])) == -1) { + nitems(geomcmds)) == -1) { pjdlog_errno(LOG_ERR, "Unable to limit allowed GEOM ioctls"); } @@ -266,7 +266,7 @@ drop_privs(const struct hast_resource *r "Unable to limit capability rights to CAP_IOCTL on ggate descriptor"); } if (cap_ioctls_limit(res->hr_ggatefd, ggatecmds, - sizeof(ggatecmds) / sizeof(ggatecmds[0])) == -1) { + nitems(ggatecmds)) == -1) { pjdlog_errno(LOG_ERR, "Unable to limit allowed ggate ioctls"); } From owner-svn-src-all@freebsd.org Wed Apr 20 01:00:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F8FAB13FE9; Wed, 20 Apr 2016 01:00:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01C4414ED; Wed, 20 Apr 2016 01:00:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K10Dj6018860; Wed, 20 Apr 2016 01:00:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K10DD4018859; Wed, 20 Apr 2016 01:00:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200100.u3K10DD4018859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 01:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298318 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:00:14 -0000 Author: cem Date: Wed Apr 20 01:00:13 2016 New Revision: 298318 URL: https://svnweb.freebsd.org/changeset/base/298318 Log: linprocfs: Don't print uninitialized values Reported by: Coverity CID: 1354624 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Apr 20 00:55:35 2016 (r298317) +++ head/sys/compat/linprocfs/linprocfs.c Wed Apr 20 01:00:13 2016 (r298318) @@ -1422,7 +1422,7 @@ linprocfs_doproclimits(PFS_FILL_ARGS) "kern.sigqueue.max_pending_per_proc", &res, &size, 0, 0, 0, 0); if (error != 0) - break; + goto out; rl.rlim_cur = res; rl.rlim_max = res; break; @@ -1430,7 +1430,7 @@ linprocfs_doproclimits(PFS_FILL_ARGS) error = kernel_sysctlbyname(td, "kern.ipc.msgmnb", &res, &size, 0, 0, 0, 0); if (error != 0) - break; + goto out; rl.rlim_cur = res; rl.rlim_max = res; break; @@ -1452,6 +1452,7 @@ linprocfs_doproclimits(PFS_FILL_ARGS) li->desc, (unsigned long long)rl.rlim_cur, (unsigned long long)rl.rlim_max, li->unit); } +out: lim_free(limp); return (error); } From owner-svn-src-all@freebsd.org Wed Apr 20 01:03:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 602FDB14231; Wed, 20 Apr 2016 01:03:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32D6F1A1E; Wed, 20 Apr 2016 01:03:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K136Uq021762; Wed, 20 Apr 2016 01:03:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K136dn021761; Wed, 20 Apr 2016 01:03:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200103.u3K136dn021761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 01:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298319 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:03:07 -0000 Author: cem Date: Wed Apr 20 01:03:06 2016 New Revision: 298319 URL: https://svnweb.freebsd.org/changeset/base/298319 Log: linprocfs_doproclimits: Initialize error return before use Reported by: Coverity CID: 1354623 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Apr 20 01:00:13 2016 (r298318) +++ head/sys/compat/linprocfs/linprocfs.c Wed Apr 20 01:03:06 2016 (r298319) @@ -1403,6 +1403,8 @@ linprocfs_doproclimits(PFS_FILL_ARGS) ssize_t size; int res, error; + error = 0; + PROC_LOCK(p); limp = lim_hold(p->p_limit); PROC_UNLOCK(p); From owner-svn-src-all@freebsd.org Wed Apr 20 01:05:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62BCBB14382; Wed, 20 Apr 2016 01:05:55 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33F841C08; Wed, 20 Apr 2016 01:05:55 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K15sHh021937; Wed, 20 Apr 2016 01:05:54 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K15sCP021936; Wed, 20 Apr 2016 01:05:54 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604200105.u3K15sCP021936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 20 Apr 2016 01:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298320 - head/sbin/sunlabel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:05:55 -0000 Author: araujo Date: Wed Apr 20 01:05:54 2016 New Revision: 298320 URL: https://svnweb.freebsd.org/changeset/base/298320 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/sunlabel/sunlabel.c Modified: head/sbin/sunlabel/sunlabel.c ============================================================================== --- head/sbin/sunlabel/sunlabel.c Wed Apr 20 01:03:06 2016 (r298319) +++ head/sbin/sunlabel/sunlabel.c Wed Apr 20 01:05:54 2016 (r298320) @@ -903,7 +903,7 @@ tagname(unsigned int tag) struct tags *tp; for (i = 0, tp = knowntags; - i < sizeof(knowntags) / sizeof(struct tags); + i < nitems(knowntags); i++, tp++) if (tp->id == tag) return (tp->name); @@ -921,7 +921,7 @@ flagname(unsigned int flag) struct tags *tp; for (i = 0, tp = knownflags; - i < sizeof(knownflags) / sizeof(struct tags); + i < nitems(knownflags); i++, tp++) if (tp->id == flag) return (tp->name); @@ -940,7 +940,7 @@ parse_tag(struct sun_disklabel *sl, int unsigned long l; for (i = 0, tp = knowntags; - i < sizeof(knowntags) / sizeof(struct tags); + i < nitems(knowntags); i++, tp++) if (strcmp(tp->name, tag) == 0) { sl->sl_vtoc_map[part].svtoc_tag = (uint16_t)tp->id; @@ -965,7 +965,7 @@ parse_flag(struct sun_disklabel *sl, int unsigned long l; for (i = 0, tp = knownflags; - i < sizeof(knownflags) / sizeof(struct tags); + i < nitems(knownflags); i++, tp++) if (strcmp(tp->name, flag) == 0) { sl->sl_vtoc_map[part].svtoc_flag = (uint16_t)tp->id; From owner-svn-src-all@freebsd.org Wed Apr 20 01:10:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2737B14568; Wed, 20 Apr 2016 01:10:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FE6C1E73; Wed, 20 Apr 2016 01:10:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K1A7Ht022149; Wed, 20 Apr 2016 01:10:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K1A7je022147; Wed, 20 Apr 2016 01:10:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200110.u3K1A7je022147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 01:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298321 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:10:08 -0000 Author: cem Date: Wed Apr 20 01:10:07 2016 New Revision: 298321 URL: https://svnweb.freebsd.org/changeset/base/298321 Log: SRAT: Don't overflow domain_pxm table If we reached MAXMEMDOM, we would previously try to insert an additional element and only detect overflow after causing (probably trivial) memory overflow. Instead, detect the ndomain > MAXMEMDOM case before we write past the end. Reported by: Coverity CID: 1354783 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/x86/acpica/srat.c Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Wed Apr 20 01:05:54 2016 (r298320) +++ head/sys/x86/acpica/srat.c Wed Apr 20 01:10:07 2016 (r298321) @@ -355,17 +355,18 @@ renumber_domains(void) if (j < ndomain && domain_pxm[j] == mem_info[i].domain) continue; + if (ndomain >= MAXMEMDOM) { + ndomain = 1; + printf("SRAT: Too many memory domains\n"); + return (EFBIG); + } + /* Insert the new domain at slot 'j'. */ slot = j; for (j = ndomain; j > slot; j--) domain_pxm[j] = domain_pxm[j - 1]; domain_pxm[slot] = mem_info[i].domain; ndomain++; - if (ndomain > MAXMEMDOM) { - ndomain = 1; - printf("SRAT: Too many memory domains\n"); - return (EFBIG); - } } /* Renumber each domain to its index in the sorted 'domain_pxm' list. */ From owner-svn-src-all@freebsd.org Wed Apr 20 01:17:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06EA0B1493C; Wed, 20 Apr 2016 01:17:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCCF3130E; Wed, 20 Apr 2016 01:17:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K1HJKa025116; Wed, 20 Apr 2016 01:17:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K1HJGl025115; Wed, 20 Apr 2016 01:17:19 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200117.u3K1HJGl025115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 01:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298322 - head/sys/dev/nctgpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:17:20 -0000 Author: cem Date: Wed Apr 20 01:17:18 2016 New Revision: 298322 URL: https://svnweb.freebsd.org/changeset/base/298322 Log: nctgpio(4): Don't index past the end of sc->pins array This driver thinks that the NCT_MAX_PIN index is a valid index in a few places (nct_attach() for-loop, as well as NCT_IS_VALID_PIN()). Allocate room for NCT_MAX_PIN as an index, that is, NCT_MAX_PIN + 1 elements. Reported by: Coverity CIDs: 1353806, 1353807, 1353808, 1353809, 1353810 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/nctgpio/nctgpio.c Modified: head/sys/dev/nctgpio/nctgpio.c ============================================================================== --- head/sys/dev/nctgpio/nctgpio.c Wed Apr 20 01:10:07 2016 (r298321) +++ head/sys/dev/nctgpio/nctgpio.c Wed Apr 20 01:17:18 2016 (r298322) @@ -101,7 +101,7 @@ struct nct_softc { struct mtx mtx; struct resource *portres; int rid; - struct gpio_pin pins[NCT_MAX_PIN]; + struct gpio_pin pins[NCT_MAX_PIN + 1]; }; #define GPIO_LOCK_INIT(_sc) mtx_init(&(_sc)->mtx, \ From owner-svn-src-all@freebsd.org Wed Apr 20 01:21:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EB4CB14AF2; Wed, 20 Apr 2016 01:21:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B072216FA; Wed, 20 Apr 2016 01:21:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K1LdAg025922; Wed, 20 Apr 2016 01:21:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K1Ldot025919; Wed, 20 Apr 2016 01:21:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604200121.u3K1Ldot025919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Apr 2016 01:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298323 - in head/lib/libc: db/hash net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:21:41 -0000 Author: pfg Date: Wed Apr 20 01:21:39 2016 New Revision: 298323 URL: https://svnweb.freebsd.org/changeset/base/298323 Log: libc: use our roundup2/rounddown2() macros when param.h is available. rounddown2 tends to produce longer lines than the original code but still it makes the code more readable. Modified: head/lib/libc/db/hash/hash_page.c head/lib/libc/net/ip6opt.c head/lib/libc/net/name6.c Modified: head/lib/libc/db/hash/hash_page.c ============================================================================== --- head/lib/libc/db/hash/hash_page.c Wed Apr 20 01:17:18 2016 (r298322) +++ head/lib/libc/db/hash/hash_page.c Wed Apr 20 01:21:39 2016 (r298323) @@ -677,7 +677,7 @@ overflow_page(HTAB *hashp) bit = hashp->LAST_FREED & ((hashp->BSIZE << BYTE_SHIFT) - 1); j = bit / BITS_PER_MAP; - bit = bit & ~(BITS_PER_MAP - 1); + bit = rounddown2(bit, BITS_PER_MAP); } else { bit = 0; j = 0; Modified: head/lib/libc/net/ip6opt.c ============================================================================== --- head/lib/libc/net/ip6opt.c Wed Apr 20 01:17:18 2016 (r298322) +++ head/lib/libc/net/ip6opt.c Wed Apr 20 01:21:39 2016 (r298323) @@ -130,8 +130,7 @@ inet6_option_append(struct cmsghdr *cmsg /* calculate pad length before the option. */ off = bp - (u_char *)eh; - padlen = (((off % multx) + (multx - 1)) & ~(multx - 1)) - - (off % multx); + padlen = roundup2(off % multx, multx) - (off % multx); padlen += plusy; padlen %= multx; /* keep the pad as short as possible */ /* insert padding */ @@ -200,7 +199,7 @@ inet6_option_alloc(struct cmsghdr *cmsg, /* calculate pad length before the option. */ off = bp - (u_char *)eh; - padlen = (((off % multx) + (multx - 1)) & ~(multx - 1)) - + padlen = roundup2(off % multx, multx) - (off % multx); padlen += plusy; padlen %= multx; /* keep the pad as short as possible */ Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Wed Apr 20 01:17:18 2016 (r298322) +++ head/lib/libc/net/name6.c Wed Apr 20 01:21:39 2016 (r298323) @@ -330,7 +330,7 @@ getipnodebyaddr(const void *src, size_t *errp = NO_RECOVERY; return NULL; } - if ((long)src & ~(sizeof(struct in_addr) - 1)) { + if (rounddown2((long)src, sizeof(struct in_addr))) { memcpy(&addrbuf, src, len); src = &addrbuf; } @@ -343,7 +343,8 @@ getipnodebyaddr(const void *src, size_t *errp = NO_RECOVERY; return NULL; } - if ((long)src & ~(sizeof(struct in6_addr) / 2 - 1)) { /*XXX*/ + if (rounddown2((long)src, sizeof(struct in6_addr) / 2)) { + /* XXX */ memcpy(&addrbuf, src, len); src = &addrbuf; } From owner-svn-src-all@freebsd.org Wed Apr 20 01:26:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 135A4B14D5A; Wed, 20 Apr 2016 01:26:05 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9A951A64; Wed, 20 Apr 2016 01:26:04 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K1Q4B2028079; Wed, 20 Apr 2016 01:26:04 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K1Q3Cr028075; Wed, 20 Apr 2016 01:26:03 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604200126.u3K1Q3Cr028075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 20 Apr 2016 01:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298324 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:26:05 -0000 Author: araujo Date: Wed Apr 20 01:26:03 2016 New Revision: 298324 URL: https://svnweb.freebsd.org/changeset/base/298324 Log: Use NULL instead of 0 for pointers. gethostbyname(3) will return NULL for error status. MFC after: 2 weeks. Modified: head/usr.bin/systat/cmds.c head/usr.bin/systat/netcmds.c head/usr.bin/systat/netstat.c Modified: head/usr.bin/systat/cmds.c ============================================================================== --- head/usr.bin/systat/cmds.c Wed Apr 20 01:21:39 2016 (r298323) +++ head/usr.bin/systat/cmds.c Wed Apr 20 01:26:03 2016 (r298324) @@ -120,10 +120,10 @@ command(const char *cmd) (*curcmd->c_close)(wnd); curcmd->c_flags &= ~CF_INIT; wnd = (*p->c_open)(); - if (wnd == 0) { + if (wnd == NULL) { error("Couldn't open new display"); wnd = (*curcmd->c_open)(); - if (wnd == 0) { + if (wnd == NULL) { error("Couldn't change back to previous cmd"); exit(1); } @@ -141,7 +141,7 @@ command(const char *cmd) status(); goto done; } - if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(tmpstr1, cp)) + if (curcmd->c_cmd == NULL || !(*curcmd->c_cmd)(tmpstr1, cp)) error("%s: Unknown command.", tmpstr1); done: free(tmpstr); Modified: head/usr.bin/systat/netcmds.c ============================================================================== --- head/usr.bin/systat/netcmds.c Wed Apr 20 01:21:39 2016 (r298323) +++ head/usr.bin/systat/netcmds.c Wed Apr 20 01:26:03 2016 (r298324) @@ -150,7 +150,7 @@ changeitems(const char *args, int onoff) continue; } hp = gethostbyname(tmpstr1); - if (hp == 0) { + if (hp == NULL) { in.s_addr = inet_addr(tmpstr1); if (in.s_addr == INADDR_NONE) { error("%s: unknown host or port", tmpstr1); @@ -167,7 +167,7 @@ static int selectproto(const char *proto) { - if (proto == 0 || streq(proto, "all")) + if (proto == NULL || streq(proto, "all")) protos = TCP | UDP; else if (streq(proto, "tcp")) protos = TCP; @@ -202,13 +202,13 @@ selectport(long port, int onoff) struct pitem *p; if (port == -1) { - if (ports == 0) + if (ports == NULL) return (0); free((char *)ports), ports = 0; nports = 0; return (1); } - for (p = ports; p < ports+nports; p++) + for (p = ports; p < ports + nports; p++) if (p->port == port) { p->onoff = onoff; return (0); @@ -258,8 +258,8 @@ selecthost(struct in_addr *in, int onoff { struct hitem *p; - if (in == 0) { - if (hosts == 0) + if (in == NULL) { + if (hosts == NULL) return (0); free((char *)hosts), hosts = 0; nhosts = 0; Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Wed Apr 20 01:21:39 2016 (r298323) +++ head/usr.bin/systat/netstat.c Wed Apr 20 01:26:03 2016 (r298324) @@ -605,7 +605,7 @@ inetname(struct sockaddr *sa) if (np) cp = np->n_name; } - if (cp == 0) { + if (cp == NULL) { hp = gethostbyaddr((char *)&in, sizeof (in), AF_INET); if (hp) cp = hp->h_name; From owner-svn-src-all@freebsd.org Wed Apr 20 01:28:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D5BAB14DF3; Wed, 20 Apr 2016 01:28:32 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5403B1C14; Wed, 20 Apr 2016 01:28:32 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K1SVPc028203; Wed, 20 Apr 2016 01:28:31 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K1SVb0028202; Wed, 20 Apr 2016 01:28:31 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604200128.u3K1SVb0028202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 20 Apr 2016 01:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298325 - head/usr.bin/tftp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:28:32 -0000 Author: araujo Date: Wed Apr 20 01:28:31 2016 New Revision: 298325 URL: https://svnweb.freebsd.org/changeset/base/298325 Log: Use NULL instead of 0 for pointers. Small cosmetic change. MFC after: 2 weeks. Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Wed Apr 20 01:26:03 2016 (r298324) +++ head/usr.bin/tftp/main.c Wed Apr 20 01:28:31 2016 (r298325) @@ -749,11 +749,11 @@ command(void) if (margc == 0) continue; c = getcmd(margv[0]); - if (c == (struct cmd *)-1) { + if (c == (struct cmd *) - 1) { printf("?Ambiguous command\n"); continue; } - if (c == 0) { + if (c == NULL) { printf("?Invalid command\n"); continue; } From owner-svn-src-all@freebsd.org Wed Apr 20 01:29:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF5D9B14E5B for ; Wed, 20 Apr 2016 01:29:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm47-vm9.bullet.mail.bf1.yahoo.com (nm47-vm9.bullet.mail.bf1.yahoo.com [216.109.114.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 991611DC6 for ; Wed, 20 Apr 2016 01:29:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461115446; bh=uNBqOJtVj2xO4eAKEC+GEcTWapkpLJDSvhHqcunCgds=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=ArrBVJsM/RhzeNKm4uqcsKTbKGuJwqHUj6FodIEOPM2ELgwgK0/f6x7bWjgoPlgc1Ay2PL3ShZrz9UqrgAH5jJY7rcIVeUs3gCKL/HFHtsGnF84P1thYJmtmZEAApHAy1fYhAr0yA60eXyUJK6ArhlyoJh047yoLRxAC2EnbjUm6X5rq1z+UFSmrr5Mbn6jyke2TN0nZZXPbQuggiKl51AcXbUe4fjwQsTGot/CDZtyzzRZSMzMQfRFYBFWbcft1WDQPLdNqb1Cpy2KbEPB7+KdXenEMLPja6H+F8H+45DOjx3F5Kk1mn1LolIL9YadU3v/lz8xD4syZh1zGjbNlvQ== Received: from [98.139.170.182] by nm47.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 01:24:06 -0000 Received: from [98.139.211.200] by tm25.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 01:24:06 -0000 Received: from [127.0.0.1] by smtp209.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 01:24:06 -0000 X-Yahoo-Newman-Id: 225365.71839.bm@smtp209.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: dTbJ4mkVM1lZhQqHhsxetoc59N3hRvJ1i90gSzBdQ7Tuqsp dhqUCVmVphXoYLRF06Dh1hgFZ.2m_wYTRDGaiFj5JULAsaD2ybT7AhyDM9tM jtwVIs2SZ2Atm.8FemBonKYOTSyx_4uO0.N9pK_dIvrRnr6NpK_pjtxKItEk BqF_Ta9RUFG3gQiH7VJ8EPoGZgq7WYGTcN8orQMH0EVMZqzarGv4I2eNJP_r kVAHmQCCwnyRZS1td3Zmx0xl0a6aBp2ZENeqpvxrCr.0bQwCP1kls.y3yCbb 8mophQoR_GuXtvP0ILZXJr2yUj1_wSSrW4t.RtwQbpJWpJSSgc43u9eXaB7b gGd_MK2JGA1WS0cX8eHtECZ27U7cMTWLRPM9gNnKyIJS2kGdYW6pb6VGdSaq t7lvr.W.zucEpx5agCWv2msJ4wSliKospVOqfz1PK24zGRtiOtCdBuxULZFE Kay0D2vqdEdGDU1REZZHUMlEUSukOYkwkr8uThIYuNH3aYHyLWYOmTAhUh8A 6yampG2I534gkk2m3zlrP0JRzezeO2Dpu X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298320 - head/sbin/sunlabel To: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604200105.u3K15sCP021936@repo.freebsd.org> From: Pedro Giffuni Message-ID: <81a0edfd-67cf-5049-a4d7-f6b5e517f529@FreeBSD.org> Date: Tue, 19 Apr 2016 20:24:08 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201604200105.u3K15sCP021936@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:29:42 -0000 On 04/19/16 20:05, Marcelo Araujo wrote: > Author: araujo > Date: Wed Apr 20 01:05:54 2016 > New Revision: 298320 > URL: https://svnweb.freebsd.org/changeset/base/298320 > > Log: > Use nitems() from sys/param.h. > > MFC after: 2 weeks. > > Modified: > head/sbin/sunlabel/sunlabel.c > > Modified: head/sbin/sunlabel/sunlabel.c > ============================================================================== > --- head/sbin/sunlabel/sunlabel.c Wed Apr 20 01:03:06 2016 (r298319) > +++ head/sbin/sunlabel/sunlabel.c Wed Apr 20 01:05:54 2016 (r298320) > @@ -903,7 +903,7 @@ tagname(unsigned int tag) > struct tags *tp; > > for (i = 0, tp = knowntags; > - i < sizeof(knowntags) / sizeof(struct tags); > + i < nitems(knowntags); > i++, tp++) > if (tp->id == tag) > return (tp->name); Please re-indent lines like this, the complete "for" fits in one line. (same for the others) Pedro. > @@ -921,7 +921,7 @@ flagname(unsigned int flag) > struct tags *tp; > > for (i = 0, tp = knownflags; > - i < sizeof(knownflags) / sizeof(struct tags); > + i < nitems(knownflags); > i++, tp++) > if (tp->id == flag) > return (tp->name); > @@ -940,7 +940,7 @@ parse_tag(struct sun_disklabel *sl, int > unsigned long l; > > for (i = 0, tp = knowntags; > - i < sizeof(knowntags) / sizeof(struct tags); > + i < nitems(knowntags); > i++, tp++) > if (strcmp(tp->name, tag) == 0) { > sl->sl_vtoc_map[part].svtoc_tag = (uint16_t)tp->id; > @@ -965,7 +965,7 @@ parse_flag(struct sun_disklabel *sl, int > unsigned long l; > > for (i = 0, tp = knownflags; > - i < sizeof(knownflags) / sizeof(struct tags); > + i < nitems(knownflags); > i++, tp++) > if (strcmp(tp->name, flag) == 0) { > sl->sl_vtoc_map[part].svtoc_flag = (uint16_t)tp->id; > From owner-svn-src-all@freebsd.org Wed Apr 20 01:35:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86F2EB15042; Wed, 20 Apr 2016 01:35:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 585291190; Wed, 20 Apr 2016 01:35:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K1Z9vW031062; Wed, 20 Apr 2016 01:35:09 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K1Z9N6031061; Wed, 20 Apr 2016 01:35:09 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604200135.u3K1Z9N6031061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 20 Apr 2016 01:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298326 - head/sbin/sunlabel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:35:10 -0000 Author: araujo Date: Wed Apr 20 01:35:09 2016 New Revision: 298326 URL: https://svnweb.freebsd.org/changeset/base/298326 Log: Re-ident lines. Requested by: pfg MFC after: 2 weeks. Modified: head/sbin/sunlabel/sunlabel.c Modified: head/sbin/sunlabel/sunlabel.c ============================================================================== --- head/sbin/sunlabel/sunlabel.c Wed Apr 20 01:28:31 2016 (r298325) +++ head/sbin/sunlabel/sunlabel.c Wed Apr 20 01:35:09 2016 (r298326) @@ -902,9 +902,7 @@ tagname(unsigned int tag) size_t i; struct tags *tp; - for (i = 0, tp = knowntags; - i < nitems(knowntags); - i++, tp++) + for (i = 0, tp = knowntags; i < nitems(knowntags); i++, tp++) if (tp->id == tag) return (tp->name); @@ -920,9 +918,7 @@ flagname(unsigned int flag) size_t i; struct tags *tp; - for (i = 0, tp = knownflags; - i < nitems(knownflags); - i++, tp++) + for (i = 0, tp = knownflags; i < nitems(knownflags); i++, tp++) if (tp->id == flag) return (tp->name); @@ -939,9 +935,7 @@ parse_tag(struct sun_disklabel *sl, int size_t i; unsigned long l; - for (i = 0, tp = knowntags; - i < nitems(knowntags); - i++, tp++) + for (i = 0, tp = knowntags; i < nitems(knowntags); i++, tp++) if (strcmp(tp->name, tag) == 0) { sl->sl_vtoc_map[part].svtoc_tag = (uint16_t)tp->id; return (0); @@ -964,9 +958,7 @@ parse_flag(struct sun_disklabel *sl, int size_t i; unsigned long l; - for (i = 0, tp = knownflags; - i < nitems(knownflags); - i++, tp++) + for (i = 0, tp = knownflags; i < nitems(knownflags); i++, tp++) if (strcmp(tp->name, flag) == 0) { sl->sl_vtoc_map[part].svtoc_flag = (uint16_t)tp->id; return (0); From owner-svn-src-all@freebsd.org Wed Apr 20 01:35:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4608DB1507F; Wed, 20 Apr 2016 01:35:22 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BA9D12EB; Wed, 20 Apr 2016 01:35:22 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-oi0-x231.google.com with SMTP id r78so27240559oie.0; Tue, 19 Apr 2016 18:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc; bh=rX/UmftAPkq7+ZmWMcqg7wsPW7+DBqSmwwoEIy7yhm4=; b=AYrkKc+a1n1pfnQsJ7180h0ltMvv0JYvCUYxjoQ0pS09ArP409Butncgn1qxngNaGw lpkX6iTrIWQMSiIBDlv9rpZrtA59g//Tg7WxoMHdRFo0f8F3FV/EPST/39mpixSB5n5x CTZQw8Hdag/CssAFQJrwzFCHUppxclf/Mjj5ObsjrynKD7Euk4zAfY/zmLqjZCqnfzZN IS9wk86fAWe3LS3F2hdhBYNsx6Kq08zwmzOKEWplRblJMtgNcMkamVieO4pRcVGVAHCj E7vCUrxJ9jWedWnjiKMEBNZZuTZk6aOpUHb1rSMURQsmkWCuHzoe3g0yMSRgurboi0NS mOkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=rX/UmftAPkq7+ZmWMcqg7wsPW7+DBqSmwwoEIy7yhm4=; b=aHC38e/Y7kb6iPVXMKXJm1Lz/fodwYqC/A3MEJXCaw+Cg1unhQWgr93iagN/torjBn KNF5xgBsOAGsEIKYrBwLpeIbLoH9nnm6YgYitjQ/hUKqSM1gmqZV+lkOwN4+MlSq0sLd nmO8ErkE5O2SgaHqGZtV3YLrnub58h8i8w7Apgv4umKBaUTYyIcrTRnX+3Yxnseh9vPY 3K28i1QcOx/v9zDncJrmeHHR9dLW5oNIFD6d/eXOcjKhDKFewjid8AqAPLOkDeFbVQxz VSdnRBnqENvKbxDMTp2qhUcXM+h3vFxYUkqO0ll1L4phf7cTHLL/JKsT0n27onPXiON3 h8sg== X-Gm-Message-State: AOPr4FXb+SZRbAOkuD/gbpn3BgX4rYz97Lakfz9E2n9zR0gxBit9tOzZpo/rYXIqQbFDXUaKsFw9+SCLMrngnQ== MIME-Version: 1.0 X-Received: by 10.157.3.97 with SMTP id 88mr2845958otv.137.1461116121374; Tue, 19 Apr 2016 18:35:21 -0700 (PDT) Received: by 10.182.156.65 with HTTP; Tue, 19 Apr 2016 18:35:21 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <81a0edfd-67cf-5049-a4d7-f6b5e517f529@FreeBSD.org> References: <201604200105.u3K15sCP021936@repo.freebsd.org> <81a0edfd-67cf-5049-a4d7-f6b5e517f529@FreeBSD.org> Date: Wed, 20 Apr 2016 09:35:21 +0800 Message-ID: Subject: Re: svn commit: r298320 - head/sbin/sunlabel From: Marcelo Araujo To: Pedro Giffuni Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:35:22 -0000 2016-04-20 9:24 GMT+08:00 Pedro Giffuni : > > > On 04/19/16 20:05, Marcelo Araujo wrote: > >> Author: araujo >> Date: Wed Apr 20 01:05:54 2016 >> New Revision: 298320 >> URL: https://svnweb.freebsd.org/changeset/base/298320 >> >> Log: >> Use nitems() from sys/param.h. >> >> MFC after: 2 weeks. >> >> Modified: >> head/sbin/sunlabel/sunlabel.c >> >> Modified: head/sbin/sunlabel/sunlabel.c >> >> ============================================================================== >> --- head/sbin/sunlabel/sunlabel.c Wed Apr 20 01:03:06 2016 >> (r298319) >> +++ head/sbin/sunlabel/sunlabel.c Wed Apr 20 01:05:54 2016 >> (r298320) >> @@ -903,7 +903,7 @@ tagname(unsigned int tag) >> struct tags *tp; >> >> for (i = 0, tp = knowntags; >> - i < sizeof(knowntags) / sizeof(struct tags); >> + i < nitems(knowntags); >> i++, tp++) >> if (tp->id == tag) >> return (tp->name); >> > > Please re-indent lines like this, the complete "for" fits in one line. > (same for the others) > > Pedro. > > > @@ -921,7 +921,7 @@ flagname(unsigned int flag) >> struct tags *tp; >> >> for (i = 0, tp = knownflags; >> - i < sizeof(knownflags) / sizeof(struct tags); >> + i < nitems(knownflags); >> i++, tp++) >> if (tp->id == flag) >> return (tp->name); >> @@ -940,7 +940,7 @@ parse_tag(struct sun_disklabel *sl, int >> unsigned long l; >> >> for (i = 0, tp = knowntags; >> - i < sizeof(knowntags) / sizeof(struct tags); >> + i < nitems(knowntags); >> i++, tp++) >> if (strcmp(tp->name, tag) == 0) { >> sl->sl_vtoc_map[part].svtoc_tag = >> (uint16_t)tp->id; >> @@ -965,7 +965,7 @@ parse_flag(struct sun_disklabel *sl, int >> unsigned long l; >> >> for (i = 0, tp = knownflags; >> - i < sizeof(knownflags) / sizeof(struct tags); >> + i < nitems(knownflags); >> i++, tp++) >> if (strcmp(tp->name, flag) == 0) { >> sl->sl_vtoc_map[part].svtoc_flag = >> (uint16_t)tp->id; >> >> Done! Thanks! -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Wed Apr 20 01:38:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95D88B15174; Wed, 20 Apr 2016 01:38:55 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 668171506; Wed, 20 Apr 2016 01:38:55 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K1cs8F031216; Wed, 20 Apr 2016 01:38:54 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K1csPm031215; Wed, 20 Apr 2016 01:38:54 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604200138.u3K1csPm031215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 20 Apr 2016 01:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298327 - head/usr.bin/tftp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:38:55 -0000 Author: araujo Date: Wed Apr 20 01:38:54 2016 New Revision: 298327 URL: https://svnweb.freebsd.org/changeset/base/298327 Log: Partially revert the change on r298325 where there is an (-1) casted to a pointer. Submitted by: pfg MFC after: 2 weeks. Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Wed Apr 20 01:35:09 2016 (r298326) +++ head/usr.bin/tftp/main.c Wed Apr 20 01:38:54 2016 (r298327) @@ -749,7 +749,7 @@ command(void) if (margc == 0) continue; c = getcmd(margv[0]); - if (c == (struct cmd *) - 1) { + if (c == (struct cmd *)-1) { printf("?Ambiguous command\n"); continue; } From owner-svn-src-all@freebsd.org Wed Apr 20 01:39:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D846EB151D9; Wed, 20 Apr 2016 01:39:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5D6E178A; Wed, 20 Apr 2016 01:39:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K1dVXR031281; Wed, 20 Apr 2016 01:39:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K1dVgH031280; Wed, 20 Apr 2016 01:39:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200139.u3K1dVgH031280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 01:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298328 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 01:39:33 -0000 Author: cem Date: Wed Apr 20 01:39:31 2016 New Revision: 298328 URL: https://svnweb.freebsd.org/changeset/base/298328 Log: bpf_getdltlist: Don't overrun 'lst' 'lst' is allocated with 'n1' members. 'n' indexes 'lst'. So 'n == n1' is an invalid 'lst' index. This is a follow-up to r296009. Reported by: Coverity CID: 1352743 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Wed Apr 20 01:38:54 2016 (r298327) +++ head/sys/net/bpf.c Wed Apr 20 01:39:31 2016 (r298328) @@ -2739,7 +2739,7 @@ again: LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp != ifp) continue; - if (n > n1) { + if (n >= n1) { free(lst, M_TEMP); goto again; } From owner-svn-src-all@freebsd.org Wed Apr 20 02:01:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71225B15AFB; Wed, 20 Apr 2016 02:01:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4254F1315; Wed, 20 Apr 2016 02:01:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K21j3b039927; Wed, 20 Apr 2016 02:01:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K21jUc039926; Wed, 20 Apr 2016 02:01:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200201.u3K21jUc039926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 02:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298329 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 02:01:46 -0000 Author: cem Date: Wed Apr 20 02:01:45 2016 New Revision: 298329 URL: https://svnweb.freebsd.org/changeset/base/298329 Log: radix rn_inithead: Fix minor leak in low memory conditions R_Zalloc is essentially a malloc(M_NOWAIT) wrapper. It is possible that 'rnh' failed to allocate, but 'rmh' succeeds. In that case, we bail out of rn_inithead() but previously did not free 'rmh'. Introduced in r287073 (projects/routing) / MFP r294706. Reported by: Coverity CID: 1350258 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Wed Apr 20 01:39:31 2016 (r298328) +++ head/sys/net/radix.c Wed Apr 20 02:01:45 2016 (r298329) @@ -1156,6 +1156,8 @@ rn_inithead(void **head, int off) if (rnh == NULL || rmh == NULL) { if (rnh != NULL) R_Free(rnh); + if (rmh != NULL) + R_Free(rmh); return (0); } From owner-svn-src-all@freebsd.org Wed Apr 20 02:09:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55DE6B15CE7; Wed, 20 Apr 2016 02:09:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2827916EE; Wed, 20 Apr 2016 02:09:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K29cWc040226; Wed, 20 Apr 2016 02:09:38 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K29cpR040225; Wed, 20 Apr 2016 02:09:38 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200209.u3K29cpR040225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 02:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298330 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 02:09:39 -0000 Author: cem Date: Wed Apr 20 02:09:38 2016 New Revision: 298330 URL: https://svnweb.freebsd.org/changeset/base/298330 Log: kern_rctl: Fix resource leak in error path Ordinarily, rctl_write_outbuf frees 'sb'. However, if we are in low memory conditions we skip past the rctl_write_outbuf. In that case, free 'sb'. Reported by: Coverity CID: 1338539 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Wed Apr 20 02:01:45 2016 (r298329) +++ head/sys/kern/kern_rctl.c Wed Apr 20 02:09:38 2016 (r298330) @@ -1866,6 +1866,7 @@ sys_rctl_get_limits(struct thread *td, s RCTL_RUNLOCK(); if (sbuf_error(sb) == ENOMEM) { error = ERANGE; + sbuf_delete(sb); goto out; } From owner-svn-src-all@freebsd.org Wed Apr 20 02:58:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B098B15FD8; Wed, 20 Apr 2016 02:58:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18B861FC4; Wed, 20 Apr 2016 02:58:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K2wMlV055532; Wed, 20 Apr 2016 02:58:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K2wM6d055531; Wed, 20 Apr 2016 02:58:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200258.u3K2wM6d055531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 02:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298331 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 02:58:23 -0000 Author: cem Date: Wed Apr 20 02:58:22 2016 New Revision: 298331 URL: https://svnweb.freebsd.org/changeset/base/298331 Log: i915kms intel_pm: Read from actual tsc_freq instead of uninitialized local The local of the same name would alias the global, but we didn't even include the header that defines tsc_freq. Include it and rename the local. Reported by: Coverity CID: 1331559 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/drm2/i915/intel_pm.c Modified: head/sys/dev/drm2/i915/intel_pm.c ============================================================================== --- head/sys/dev/drm2/i915/intel_pm.c Wed Apr 20 02:09:38 2016 (r298330) +++ head/sys/dev/drm2/i915/intel_pm.c Wed Apr 20 02:58:22 2016 (r298331) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define FORCEWAKE_ACK_TIMEOUT_MS 2 @@ -2686,9 +2687,9 @@ static void gen6_update_ring_freq(struct if (!max_ia_freq) max_ia_freq = tsc_khz; #else - uint64_t tsc_freq; - tsc_freq = atomic_load_acq_64(&tsc_freq); - max_ia_freq = tsc_freq / 1000; + uint64_t freq; + freq = atomic_load_acq_64(&tsc_freq); + max_ia_freq = freq / 1000; #endif /* FREEBSD_WIP */ /* Convert from kHz to MHz */ From owner-svn-src-all@freebsd.org Wed Apr 20 03:05:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE41B14375; Wed, 20 Apr 2016 03:05:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEA2A1836; Wed, 20 Apr 2016 03:05:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K35X2E058946; Wed, 20 Apr 2016 03:05:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K35Xoj058945; Wed, 20 Apr 2016 03:05:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200305.u3K35Xoj058945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 03:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298332 - head/sys/crypto/aesni X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 03:05:34 -0000 Author: cem Date: Wed Apr 20 03:05:32 2016 New Revision: 298332 URL: https://svnweb.freebsd.org/changeset/base/298332 Log: aesni(4): Initialize error before use Reported by: Coverity CID: 1331554 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Wed Apr 20 02:58:22 2016 (r298331) +++ head/sys/crypto/aesni/aesni.c Wed Apr 20 03:05:32 2016 (r298332) @@ -534,6 +534,7 @@ aesni_cipher_process(struct aesni_sessio if (buf == NULL) return (ENOMEM); + error = 0; authbuf = NULL; authallocated = 0; if (authcrd != NULL) { From owner-svn-src-all@freebsd.org Wed Apr 20 03:06:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7014AB146B7; Wed, 20 Apr 2016 03:06:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 4BCBD1ABD; Wed, 20 Apr 2016 03:06:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 0041E7828E0; Wed, 20 Apr 2016 13:06:38 +1000 (AEST) Date: Wed, 20 Apr 2016 13:06:38 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: araujo@freebsd.org cc: John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 In-Reply-To: Message-ID: <20160420115844.Y967@besplex.bde.org> References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <4114217.PtcV9LDMal@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=87LdVkbKfUkx3EZG1_8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 03:06:50 -0000 On Wed, 20 Apr 2016, Marcelo Araujo wrote: > 2016-04-20 0:16 GMT+08:00 John Baldwin : > >> On Tuesday, April 19, 2016 04:46:13 AM Marcelo Araujo wrote: >>> Author: araujo >>> Date: Tue Apr 19 04:46:13 2016 >>> New Revision: 298247 >>> URL: https://svnweb.freebsd.org/changeset/base/298247 >>> >>> Log: >>> Remove redundant parenthesis. >>> >>> Submitted by: pfg >>> MFC after: 2 weeks. I don't realling like churnging to the nonstandard nitems(). Use of the nonstandard is bad enough. >> For this case, it might be better to remove numentries and use >> nitems() directly in the one place it is used. I would probably >> even do this as a for-loop: >> >> struct part_type *ptr; >> int counter; >> >> for (counter = 0, ptr = part_types; counter < nitems(part_types); >> counter++, ptr++) { >> if (ptr->type == (type & 0x7f)) >> return (ptr->name); >> } >> return ("unknown"); >> >> If you renamed 'counter' to 'i' you could probably fit it all on one line. 'ptr' is also not a usefully verbose name. If its name is longer than that of 'p', then it could more usefully give a hint of the pointer type (pp or ptp). nitimems() is not even easy to use. It is of course undocumented, but if we look at its internals we can see that its type is the binary promotion of size_t. This type is normally size_t again, thus normally unsigned. Broken compilers might warn about this. Only broken ones would, since it is clear that 'counter' always has a small non-negative value. Such warnings are often "fixed" by unimproving the code using casts. Here the old code uses a temporary variable of type int. Consistently broken compilers might warn about assigning the unsigned expression to this signed variable. > I came up with something like: > > struct part_type *ptr = part_types; > > for (int i = 0; i < nitems(part_types); i++) { > if (ptr->type == (type & 0x7f)) > return (ptr->name); > ptr++; > } > return("unknown"); > > What do you think? The first line preserves 3 style bugs that were fixed in jhb's version: - tab after 'struct' - tab (indentation) anywhere at all in the local declarations - initialization in declararions. All the declarations in this function had the second 2 of these style bugs. Removing them thus fixes 4 style bugs. The next non-empty line adds 3 style bugs: - nested declaration - C++ syntax needed for nested declaration/initialization - inconsistent scoping style. 'ptr' is just as local to the loop as 'i' The loop body preserves verbosesness and inconsistent style that were fixed in jhb's version. Just like for the initialization, incrementing the pointer is just as fundamental to the loop's operation as incrementing the counter (slightly more so). Normal style is probably still to increment pointers independently of indexes and write this as 'i++, p++' in the loop statement, but this uses pointers excessively. It was good on PDP11's with primitive compilers. It is clearer to only increment i and use indexing for the pointer: base_p[i], and depend on the compiler to change this to p++ if this is good, but on modern CISC CPUs like i386 the p++ method is a pessimization unless the compiler does the opposite transformation. Here base_p is a global variable so we don't even need another variable (less the compiler copy it to a register iff that is good). Churnging too much (also remove excessive parentheses and braces) gives: size_t i; /* XXX: I don't like unsigned types, but... */ for (i = 0; i < nitems(part_types); i++) if (part_types[i].type == type & 0x7f) return (part_types[i].name); return ("unknown"); The number of references to part_types cannot be reduced much by using a local variable, because part_types is an array but the local can only be a pointer, and nitems() needs the array. All the other versions have another style bug related to this: they write the initialization as 'ptr = part_types'. This depends on the array decaying to a pointer. This expression would still work if part_types were already a pointer, but nitems(part_types) wouldn't work then. The initialization should be written as 'ptr = &part_types[0]' to make the types clearer. But it is better to never convert arrays to pointers. Bruce From owner-svn-src-all@freebsd.org Wed Apr 20 03:25:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB059B14FE5; Wed, 20 Apr 2016 03:25:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A94D01525; Wed, 20 Apr 2016 03:25:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K3OxPE064789; Wed, 20 Apr 2016 03:24:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K3OxfF064788; Wed, 20 Apr 2016 03:24:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200324.u3K3OxfF064788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 03:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298333 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 03:25:01 -0000 Author: cem Date: Wed Apr 20 03:24:59 2016 New Revision: 298333 URL: https://svnweb.freebsd.org/changeset/base/298333 Log: Make Racct macro slightly more gracious given RACCT_UNDEFINED rctl_string_to_rule could previously index below the zeroth element of racct_types via the macro. Maybe it shouldn't use the macro on RACCT_UNDEFINED. But given every other RACCT_ definition is non-negative, it seems pretty easy to foot-shoot this one without the check. Reported by: Coverity CID: 1305574 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/sys/racct.h Modified: head/sys/sys/racct.h ============================================================================== --- head/sys/sys/racct.h Wed Apr 20 03:05:32 2016 (r298332) +++ head/sys/sys/racct.h Wed Apr 20 03:24:59 2016 (r298333) @@ -99,7 +99,8 @@ extern int racct_enable; * visible to the userland. It gets fixed up when retrieving resource * usage or adding rules. */ -#define RACCT_IS_IN_MILLIONS(X) (racct_types[X] & RACCT_IN_MILLIONS) +#define RACCT_IS_IN_MILLIONS(X) \ + ((X) != RACCT_UNDEFINED && (racct_types[(X)] & RACCT_IN_MILLIONS) != 0) /* * Resource usage can drop, as opposed to only grow. When the process From owner-svn-src-all@freebsd.org Wed Apr 20 03:45:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14D1EB156EC; Wed, 20 Apr 2016 03:45:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D848F10CC; Wed, 20 Apr 2016 03:45:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K3jkMN070723; Wed, 20 Apr 2016 03:45:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K3jk2x070722; Wed, 20 Apr 2016 03:45:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200345.u3K3jk2x070722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 03:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298334 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 03:45:47 -0000 Author: cem Date: Wed Apr 20 03:45:45 2016 New Revision: 298334 URL: https://svnweb.freebsd.org/changeset/base/298334 Log: drm2(4): Fix double-free in low-memory error path Reallocf frees 'block'; don't attempt to free it again. Reported by: Coverity CID: 1091165 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/drm2/drm_edid.c Modified: head/sys/dev/drm2/drm_edid.c ============================================================================== --- head/sys/dev/drm2/drm_edid.c Wed Apr 20 03:24:59 2016 (r298333) +++ head/sys/dev/drm2/drm_edid.c Wed Apr 20 03:45:45 2016 (r298334) @@ -353,8 +353,10 @@ drm_do_get_edid(struct drm_connector *co new = reallocf(block, (block[0x7e] + 1) * EDID_LENGTH, DRM_MEM_KMS, M_NOWAIT); - if (!new) + if (!new) { + block = NULL; goto out; + } block = new; for (j = 1; j <= block[0x7e]; j++) { From owner-svn-src-all@freebsd.org Wed Apr 20 03:48:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE425B15813; Wed, 20 Apr 2016 03:48:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77D741305; Wed, 20 Apr 2016 03:48:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K3mvnc070910; Wed, 20 Apr 2016 03:48:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K3mv1B070909; Wed, 20 Apr 2016 03:48:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200348.u3K3mv1B070909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 03:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298335 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 03:48:58 -0000 Author: cem Date: Wed Apr 20 03:48:57 2016 New Revision: 298335 URL: https://svnweb.freebsd.org/changeset/base/298335 Log: i915kms: Fix memory leak if a CRT is detected Reported by: Coverity CID: 1090729 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/drm2/i915/intel_crt.c Modified: head/sys/dev/drm2/i915/intel_crt.c ============================================================================== --- head/sys/dev/drm2/i915/intel_crt.c Wed Apr 20 03:45:45 2016 (r298334) +++ head/sys/dev/drm2/i915/intel_crt.c Wed Apr 20 03:48:57 2016 (r298335) @@ -423,6 +423,7 @@ static bool intel_crt_detect_ddc(struct struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private; struct edid *edid; device_t i2c; + bool res = false; BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG); @@ -439,7 +440,8 @@ static bool intel_crt_detect_ddc(struct */ if (!is_digital) { DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n"); - return true; + res = true; + goto out; } DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n"); @@ -447,9 +449,10 @@ static bool intel_crt_detect_ddc(struct DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [no valid EDID found]\n"); } +out: free(edid, DRM_MEM_KMS); - return false; + return res; } static enum drm_connector_status From owner-svn-src-all@freebsd.org Wed Apr 20 04:45:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F25A4B1419B; Wed, 20 Apr 2016 04:45:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C477D1CFE; Wed, 20 Apr 2016 04:45:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K4jOdo088801; Wed, 20 Apr 2016 04:45:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K4jOGJ088800; Wed, 20 Apr 2016 04:45:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200445.u3K4jOGJ088800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 04:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298336 - head/sys/rpc/rpcsec_gss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 04:45:25 -0000 Author: cem Date: Wed Apr 20 04:45:23 2016 New Revision: 298336 URL: https://svnweb.freebsd.org/changeset/base/298336 Log: kgssapi(4): Fix string overrun in Kerberos principal construction 'buf.value' was previously treated as a nul-terminated string, but only allocated with strlen() space. Rectify this. Reported by: Coverity CID: 1007639 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Wed Apr 20 03:48:57 2016 (r298335) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Wed Apr 20 04:45:23 2016 (r298336) @@ -331,7 +331,7 @@ rpc_gss_get_principal_name(rpc_gss_princ * Construct a gss_buffer containing the full name formatted * as "name/node@domain" where node and domain are optional. */ - namelen = strlen(name); + namelen = strlen(name) + 1; if (node) { namelen += strlen(node) + 1; } From owner-svn-src-all@freebsd.org Wed Apr 20 04:50:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3778B14382; Wed, 20 Apr 2016 04:50:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A33B71EC2; Wed, 20 Apr 2016 04:50:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K4oXWL089014; Wed, 20 Apr 2016 04:50:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K4oXIm089013; Wed, 20 Apr 2016 04:50:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200450.u3K4oXIm089013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 04:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298337 - head/sys/dev/pty X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 04:50:34 -0000 Author: cem Date: Wed Apr 20 04:50:33 2016 New Revision: 298337 URL: https://svnweb.freebsd.org/changeset/base/298337 Log: pty(4): Use strlcpy to guarantee destination buffer isn't overrun The devtoname() name is strcpyed into a small stack buffer. Sure, we always expect the name to be ttyXX (or ptyXX). If that's the case, strlcpy() doesn't hurt. Reported by: Coverity CID: 1006768 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/pty/pty.c Modified: head/sys/dev/pty/pty.c ============================================================================== --- head/sys/dev/pty/pty.c Wed Apr 20 04:45:23 2016 (r298336) +++ head/sys/dev/pty/pty.c Wed Apr 20 04:50:33 2016 (r298337) @@ -67,7 +67,7 @@ ptydev_fdopen(struct cdev *dev, int ffla return (EBUSY); /* Generate device name and create PTY. */ - strcpy(name, devtoname(dev)); + strlcpy(name, devtoname(dev), sizeof(name)); name[0] = 't'; error = pts_alloc_external(fflags & (FREAD|FWRITE), td, fp, dev, name); From owner-svn-src-all@freebsd.org Wed Apr 20 05:02:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED92FB14860; Wed, 20 Apr 2016 05:02:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BADE01454; Wed, 20 Apr 2016 05:02:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K52Doq094783; Wed, 20 Apr 2016 05:02:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K52Dx8094782; Wed, 20 Apr 2016 05:02:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200502.u3K52Dx8094782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 05:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298338 - head/sys/kgssapi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 05:02:15 -0000 Author: cem Date: Wed Apr 20 05:02:13 2016 New Revision: 298338 URL: https://svnweb.freebsd.org/changeset/base/298338 Log: kgssapi(4): Don't allow user-provided arguments to overrun stack buffer An over-long path argument to gssd_syscall could overrun the stack sockaddr_un buffer. Fix gssd_syscall to not permit that. If an over-long path is provided, gssd_syscall now returns EINVAL. It looks like PRIV_NFS_DAEMON isn't granted anywhere, so my best guess is that this is likely only triggerable by root. Reported by: Coverity CID: 1006751 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kgssapi/gss_impl.c Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Wed Apr 20 04:50:33 2016 (r298337) +++ head/sys/kgssapi/gss_impl.c Wed Apr 20 05:02:13 2016 (r298338) @@ -104,10 +104,12 @@ sys_gssd_syscall(struct thread *td, stru error = copyinstr(uap->path, path, sizeof(path), NULL); if (error) return (error); + if (strlen(path) + 1 > sizeof(sun.sun_path)) + return (EINVAL); if (path[0] != '\0') { sun.sun_family = AF_LOCAL; - strcpy(sun.sun_path, path); + strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); sun.sun_len = SUN_LEN(&sun); nconf = getnetconfigent("local"); From owner-svn-src-all@freebsd.org Wed Apr 20 05:11:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BC47B14BF4; Wed, 20 Apr 2016 05:11:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D0061B19; Wed, 20 Apr 2016 05:11:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K5B0mC095244; Wed, 20 Apr 2016 05:11:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K5B0WJ095243; Wed, 20 Apr 2016 05:11:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200511.u3K5B0WJ095243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 05:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298339 - head/sys/dev/sound/midi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 05:11:01 -0000 Author: cem Date: Wed Apr 20 05:11:00 2016 New Revision: 298339 URL: https://svnweb.freebsd.org/changeset/base/298339 Log: sound(4): Don't use-after-free in midi module unload Also, use ANSI function parameter definitions (void) while here. Reported by: Coverity CID: 1006107 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/sound/midi/midi.c Modified: head/sys/dev/sound/midi/midi.c ============================================================================== --- head/sys/dev/sound/midi/midi.c Wed Apr 20 05:02:13 2016 (r298338) +++ head/sys/dev/sound/midi/midi.c Wed Apr 20 05:11:00 2016 (r298339) @@ -1401,7 +1401,7 @@ midi_destroy(struct snd_midi *m, int mid */ static int -midi_load() +midi_load(void) { mtx_init(&midistat_lock, "midistat lock", NULL, 0); TAILQ_INIT(&midi_devs); /* Initialize the queue. */ @@ -1414,9 +1414,9 @@ midi_load() } static int -midi_unload() +midi_unload(void) { - struct snd_midi *m; + struct snd_midi *m, *tmp; int retval; MIDI_DEBUG(1, printf("midi_unload()\n")); @@ -1425,7 +1425,7 @@ midi_unload() if (midistat_isopen) goto exit0; - TAILQ_FOREACH(m, &midi_devs, link) { + TAILQ_FOREACH_SAFE(m, &midi_devs, link, tmp) { mtx_lock(&m->lock); if (m->busy) retval = EBUSY; From owner-svn-src-all@freebsd.org Wed Apr 20 05:13:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35306B14CE3; Wed, 20 Apr 2016 05:13:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07C841EAE; Wed, 20 Apr 2016 05:13:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K5DaeJ097935; Wed, 20 Apr 2016 05:13:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K5DaSg097934; Wed, 20 Apr 2016 05:13:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604200513.u3K5DaSg097934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Apr 2016 05:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298340 - head/sys/dev/sym X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 05:13:37 -0000 Author: cem Date: Wed Apr 20 05:13:36 2016 New Revision: 298340 URL: https://svnweb.freebsd.org/changeset/base/298340 Log: sym(4): Don't double-free 'sim' in failure case Reported by: Coverity CID: 1006106 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Wed Apr 20 05:11:00 2016 (r298339) +++ head/sys/dev/sym/sym_hipd.c Wed Apr 20 05:13:36 2016 (r298340) @@ -8890,6 +8890,7 @@ static int sym_cam_attach(hcb_p np) if (xpt_bus_register(sim, np->device, 0) != CAM_SUCCESS) goto fail; np->sim = sim; + sim = NULL; if (xpt_create_path(&path, NULL, cam_sim_path(np->sim), CAM_TARGET_WILDCARD, From owner-svn-src-all@freebsd.org Wed Apr 20 06:29:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ED87B15589; Wed, 20 Apr 2016 06:29:04 +0000 (UTC) (envelope-from novel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AD9B1251; Wed, 20 Apr 2016 06:29:04 +0000 (UTC) (envelope-from novel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K6T3va019371; Wed, 20 Apr 2016 06:29:03 GMT (envelope-from novel@FreeBSD.org) Received: (from novel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K6T3ix019370; Wed, 20 Apr 2016 06:29:03 GMT (envelope-from novel@FreeBSD.org) Message-Id: <201604200629.u3K6T3ix019370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: novel set sender to novel@FreeBSD.org using -f From: Roman Bogorodskiy Date: Wed, 20 Apr 2016 06:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298341 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 06:29:04 -0000 Author: novel (ports committer) Date: Wed Apr 20 06:29:03 2016 New Revision: 298341 URL: https://svnweb.freebsd.org/changeset/base/298341 Log: Update the bhyve(8) man page: - Document powering off by sending SIGTERM signal - Document exit codes Reviewed by: wblock, neel Approved by: wblock Differential Revision: D5982 Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Wed Apr 20 05:13:36 2016 (r298340) +++ head/usr.sbin/bhyve/bhyve.8 Wed Apr 20 06:29:03 2016 (r298341) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2015 +.Dd April 18, 2016 .Dt BHYVE 8 .Os .Sh NAME @@ -289,6 +289,27 @@ Alphanumeric name of the guest. This should be the same as that created by .Xr bhyveload 8 . .El +.Sh SIGNAL HANDLING +.Nm +deals with the following signals: +.Pp +.Bl -tag -width indent -compact +.It SIGTERM +Trigger ACPI poweroff for a VM +.El +.Sh EXIT STATUS +Exit status indicates how the VM was terminated: +.Pp +.Bl -tag -width indent -compact +.It 0 +rebooted +.It 1 +powered off +.It 2 +halted +.It 3 +triple fault +.El .Sh EXAMPLES The guest operating system must have been loaded with .Xr bhyveload 8 From owner-svn-src-all@freebsd.org Wed Apr 20 07:44:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02F1DB15096; Wed, 20 Apr 2016 07:44:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3A0B1BB2; Wed, 20 Apr 2016 07:44:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K7iorK043175; Wed, 20 Apr 2016 07:44:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K7io8X043174; Wed, 20 Apr 2016 07:44:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604200744.u3K7io8X043174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Apr 2016 07:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298342 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 07:44:52 -0000 Author: hselasky Date: Wed Apr 20 07:44:50 2016 New Revision: 298342 URL: https://svnweb.freebsd.org/changeset/base/298342 Log: Fix inverted priv check calls. Priv check returns zero on success and an error code on failure. Refer to man 9 priv_check . Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Wed Apr 20 06:29:03 2016 (r298341) +++ head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Wed Apr 20 07:44:50 2016 (r298342) @@ -1613,7 +1613,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uv response = (void __user *) (unsigned long) cmd->response; if (!disable_raw_qp_enforcement && - cmd->qp_type == IB_QPT_RAW_PACKET && !priv_check(curthread, PRIV_NET_RAW)) + cmd->qp_type == IB_QPT_RAW_PACKET && priv_check(curthread, PRIV_NET_RAW)) return -EPERM; INIT_UDATA(&udata, buf + cmd_size, response + resp_size, @@ -3377,7 +3377,7 @@ int ib_uverbs_ex_create_flow(struct ib_u if (cmd.comp_mask) return -EINVAL; - if (!priv_check(curthread, PRIV_NET_RAW) && !disable_raw_qp_enforcement) + if (priv_check(curthread, PRIV_NET_RAW) && !disable_raw_qp_enforcement) return -EPERM; if (cmd.flow_attr.num_of_specs > IB_FLOW_SPEC_SUPPORT_LAYERS) @@ -3686,7 +3686,7 @@ ssize_t ib_uverbs_exp_create_qp(struct i return ret; if (!disable_raw_qp_enforcement && - cmd_exp.qp_type == IB_QPT_RAW_PACKET && !priv_check(curthread, + cmd_exp.qp_type == IB_QPT_RAW_PACKET && priv_check(curthread, PRIV_NET_RAW)) return -EPERM; From owner-svn-src-all@freebsd.org Wed Apr 20 08:45:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72435B156D2; Wed, 20 Apr 2016 08:45:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 033201B7F; Wed, 20 Apr 2016 08:45:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u3K8jgpL092793 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 20 Apr 2016 11:45:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u3K8jgpL092793 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u3K8jg7M092791; Wed, 20 Apr 2016 11:45:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 20 Apr 2016 11:45:42 +0300 From: Konstantin Belousov To: Ian Lepore Cc: Allan Jude , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... Message-ID: <20160420084542.GC2422@kib.kiev.ua> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <20160419093022.GV2422@kib.kiev.ua> <5716538B.4060108@freebsd.org> <1461086958.1232.30.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461086958.1232.30.camel@freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 08:45:52 -0000 On Tue, Apr 19, 2016 at 11:29:18AM -0600, Ian Lepore wrote: > On Tue, 2016-04-19 at 11:49 -0400, Allan Jude wrote: > > On 2016-04-19 05:30, Konstantin Belousov wrote: > > > On Mon, Apr 18, 2016 at 07:43:04PM -0400, Allan Jude wrote: > > > > On 2016-04-18 19:36, Adrian Chadd wrote: > > > > > Someone pointed out how this bloats out memory requirement in > > > > > loader. > > > > > > > > > > Did anyone check that? > > > > > > > > > > -adrian > > > > > > > > > > > > > I tested down to 128mb of ram in QEMU, booted from the installer > > > > ISO, > > > > did the install, and booted the installed system without issue. > > > > > > 64MB is^H^H was very much useful and workable i386 config. i386 > > > kernel > > > does fit into the 32M but current automatic tuning prevents > > > usermode > > > from operating. Little manual tuning make 32M on tolerable. > > > > > > Making loader require 64M is a regression. At very least, it is > > > impossible to test low mem configs anymore. > > > > > > > Would a src.conf knob make sense, to use a smaller value when > > targeting > > small systems, while keeping the advantages when using more > > reasonable > > systems? > > > > Or we could make these changes to the HEAP and bcache size specific > > to > > 64bit platforms? > > > > Exactly which "small systems" are we talking about here? From what I > saw in the commit, all of this affects only i386 and amd64 and pc98 > right now, not arm or mips or other systems that often have < 64MB ram. > > I take care of some really old legacy embedded systems at customer > sites, and even so, with stuff dating back to the 2003-ish timeframe, > the smallest i386 memory I have to deal with is 64MB. Are there really > x86 systems that need to run in 32MB or less of ram these days, and use > BIOS or EFI to boot? Most of the VM/core system work is performed on the x86 machines, I mean the debugging and testing, and not compiling. Consider this first-hand experience. That is, not being able to check a change on 32MB x86 machine means, for significant number of developers, that the change cannot be tested on 32M machine at all. I leave the exercise of predicting the FreeBSD behaviour on 32MB MIPS or ARM arches, after the x86 is left to require 128MB at least for several months, to interested readers. What I wrote above is the only my concern, I do not know for sure if there are any production-important installations where x86 FreeBSD of recent versions run on, say, 64MB. As I noted elsewere, 64MB is enough to have userspace fully operational. 32MB is not, but it is still useful for kernel-only use. > > On a related note, can this stuff be used for u-boot and other non-x86 > -BIOS flavors of loader(8)? If so, then a buildtime knob or the > ability to set the heap and/or cache size at runtime after figuring out > how much ram is available would be good features to have. > > -- Ian From owner-svn-src-all@freebsd.org Wed Apr 20 13:23:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C09AB150FF; Wed, 20 Apr 2016 13:23:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02BE114DE; Wed, 20 Apr 2016 13:23:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KDN75i045925; Wed, 20 Apr 2016 13:23:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KDN7fC045924; Wed, 20 Apr 2016 13:23:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604201323.u3KDN7fC045924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Apr 2016 13:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298343 - head/sys/arm64/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 13:23:08 -0000 Author: andrew Date: Wed Apr 20 13:23:06 2016 New Revision: 298343 URL: https://svnweb.freebsd.org/changeset/base/298343 Log: Pull out the MSI/MSI-X handling calls to simplify future intrng integration. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/cavium/thunder_pcie_pem.c Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Wed Apr 20 07:44:50 2016 (r298342) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Wed Apr 20 13:23:06 2016 (r298343) @@ -126,6 +126,11 @@ static int thunder_pem_adjust_resource(d struct resource *, rman_res_t, rman_res_t); static struct resource * thunder_pem_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int thunder_pem_alloc_msi(device_t, device_t, int, int, int *); +static int thunder_pem_release_msi(device_t, device_t, int, int *); +static int thunder_pem_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); +static int thunder_pem_alloc_msix(device_t, device_t, int *); +static int thunder_pem_release_msix(device_t, device_t, int); static int thunder_pem_attach(device_t); static int thunder_pem_deactivate_resource(device_t, device_t, int, int, struct resource *); @@ -169,11 +174,12 @@ static device_method_t thunder_pem_metho DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(pcib_map_msi, arm_map_msi), - DEVMETHOD(pcib_alloc_msix, arm_alloc_msix), - DEVMETHOD(pcib_release_msix, arm_release_msix), - DEVMETHOD(pcib_alloc_msi, arm_alloc_msi), - DEVMETHOD(pcib_release_msi, arm_release_msi), + DEVMETHOD(pcib_map_msi, thunder_pem_map_msi), + DEVMETHOD(pcib_alloc_msix, thunder_pem_alloc_msix), + DEVMETHOD(pcib_release_msix, thunder_pem_release_msix), + DEVMETHOD(pcib_alloc_msi, thunder_pem_alloc_msi), + DEVMETHOD(pcib_release_msi, thunder_pem_release_msi), + DEVMETHOD_END }; @@ -315,6 +321,43 @@ thunder_pem_adjust_resource(device_t dev } static int +thunder_pem_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + + return (arm_alloc_msi(pci, child, count, maxcount, irqs)); +} + +static int +thunder_pem_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + + return (arm_release_msi(pci, child, count, irqs)); +} + +static int +thunder_pem_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + + return (arm_map_msi(pci, child, irq, addr, data)); +} + +static int +thunder_pem_alloc_msix(device_t pci, device_t child, int *irq) +{ + + return (arm_alloc_msix(pci, child, irq)); +} + +static int +thunder_pem_release_msix(device_t pci, device_t child, int irq) +{ + + return (arm_release_msix(pci, child, irq)); +} + +static int thunder_pem_identify(device_t dev) { struct thunder_pem_softc *sc; From owner-svn-src-all@freebsd.org Wed Apr 20 14:12:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F1D9B1632B; Wed, 20 Apr 2016 14:12:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6081284; Wed, 20 Apr 2016 14:12:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KECeoH061384; Wed, 20 Apr 2016 14:12:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KECeAY061383; Wed, 20 Apr 2016 14:12:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604201412.u3KECeAY061383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Apr 2016 14:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298344 - head/sys/arm64/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 14:12:41 -0000 Author: andrew Date: Wed Apr 20 14:12:40 2016 New Revision: 298344 URL: https://svnweb.freebsd.org/changeset/base/298344 Log: Group the ThunderX PCIe PEM newbus methods to help find them. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/cavium/thunder_pcie_pem.c Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Wed Apr 20 13:23:06 2016 (r298343) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Wed Apr 20 14:12:40 2016 (r298344) @@ -161,9 +161,8 @@ static device_method_t thunder_pem_metho DEVMETHOD(device_probe, thunder_pem_probe), DEVMETHOD(device_attach, thunder_pem_attach), DEVMETHOD(device_detach, thunder_pem_detach), - DEVMETHOD(pcib_maxslots, thunder_pem_maxslots), - DEVMETHOD(pcib_read_config, thunder_pem_read_config), - DEVMETHOD(pcib_write_config, thunder_pem_write_config), + + /* Bus interface */ DEVMETHOD(bus_read_ivar, thunder_pem_read_ivar), DEVMETHOD(bus_write_ivar, thunder_pem_write_ivar), DEVMETHOD(bus_alloc_resource, thunder_pem_alloc_resource), @@ -174,6 +173,10 @@ static device_method_t thunder_pem_metho DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* pcib interface */ + DEVMETHOD(pcib_maxslots, thunder_pem_maxslots), + DEVMETHOD(pcib_read_config, thunder_pem_read_config), + DEVMETHOD(pcib_write_config, thunder_pem_write_config), DEVMETHOD(pcib_map_msi, thunder_pem_map_msi), DEVMETHOD(pcib_alloc_msix, thunder_pem_alloc_msix), DEVMETHOD(pcib_release_msix, thunder_pem_release_msix), From owner-svn-src-all@freebsd.org Wed Apr 20 14:29:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EF88B1699D; Wed, 20 Apr 2016 14:29:05 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A5BB1D39; Wed, 20 Apr 2016 14:29:05 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KET42b064830; Wed, 20 Apr 2016 14:29:04 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KET3FS064821; Wed, 20 Apr 2016 14:29:03 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604201429.u3KET3FS064821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Wed, 20 Apr 2016 14:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298345 - head/sys/gnu/dts/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 14:29:05 -0000 Author: sgalabov Date: Wed Apr 20 14:29:03 2016 New Revision: 298345 URL: https://svnweb.freebsd.org/changeset/base/298345 Log: Change OpenWRT imported dtsi files Change '#include ' to '/include/ "fbsd-*"' in [rm]t*.dtsi Basically the pre-import work on OpenWRT's dts/dtsi files boils down to: for f in `ls [mr]t*.dtsi`; do printf '\n/include/ "fbsd-$f"\n' >> $f done Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5993 Modified: head/sys/gnu/dts/mips/mt7620a.dtsi head/sys/gnu/dts/mips/mt7620n.dtsi head/sys/gnu/dts/mips/mt7621.dtsi head/sys/gnu/dts/mips/mt7628an.dtsi head/sys/gnu/dts/mips/rt2880.dtsi head/sys/gnu/dts/mips/rt3050.dtsi head/sys/gnu/dts/mips/rt3352.dtsi head/sys/gnu/dts/mips/rt3883.dtsi head/sys/gnu/dts/mips/rt5350.dtsi Modified: head/sys/gnu/dts/mips/mt7620a.dtsi ============================================================================== --- head/sys/gnu/dts/mips/mt7620a.dtsi Wed Apr 20 14:12:40 2016 (r298344) +++ head/sys/gnu/dts/mips/mt7620a.dtsi Wed Apr 20 14:29:03 2016 (r298345) @@ -535,4 +535,4 @@ }; }; -#include +/include/ "fbsd-mt7620a.dtsi" Modified: head/sys/gnu/dts/mips/mt7620n.dtsi ============================================================================== --- head/sys/gnu/dts/mips/mt7620n.dtsi Wed Apr 20 14:12:40 2016 (r298344) +++ head/sys/gnu/dts/mips/mt7620n.dtsi Wed Apr 20 14:29:03 2016 (r298345) @@ -334,4 +334,4 @@ }; }; -#include +/include/ "fbsd-mt7620n.dtsi" Modified: head/sys/gnu/dts/mips/mt7621.dtsi ============================================================================== --- head/sys/gnu/dts/mips/mt7621.dtsi Wed Apr 20 14:12:40 2016 (r298344) +++ head/sys/gnu/dts/mips/mt7621.dtsi Wed Apr 20 14:29:03 2016 (r298345) @@ -374,4 +374,4 @@ }; }; -#include +/include/ "fbsd-mt7621.dtsi" Modified: head/sys/gnu/dts/mips/mt7628an.dtsi ============================================================================== --- head/sys/gnu/dts/mips/mt7628an.dtsi Wed Apr 20 14:12:40 2016 (r298344) +++ head/sys/gnu/dts/mips/mt7628an.dtsi Wed Apr 20 14:29:03 2016 (r298345) @@ -456,4 +456,4 @@ }; }; -#include +/include/ "fbsd-mt7628an.dtsi" Modified: head/sys/gnu/dts/mips/rt2880.dtsi ============================================================================== --- head/sys/gnu/dts/mips/rt2880.dtsi Wed Apr 20 14:12:40 2016 (r298344) +++ head/sys/gnu/dts/mips/rt2880.dtsi Wed Apr 20 14:29:03 2016 (r298345) @@ -193,4 +193,4 @@ }; }; -#include +/include/ "fbsd-rt2880.dtsi" Modified: head/sys/gnu/dts/mips/rt3050.dtsi ============================================================================== --- head/sys/gnu/dts/mips/rt3050.dtsi Wed Apr 20 14:12:40 2016 (r298344) +++ head/sys/gnu/dts/mips/rt3050.dtsi Wed Apr 20 14:29:03 2016 (r298345) @@ -262,4 +262,4 @@ }; }; -#include +/include/ "fbsd-rt3050.dtsi" Modified: head/sys/gnu/dts/mips/rt3352.dtsi ============================================================================== --- head/sys/gnu/dts/mips/rt3352.dtsi Wed Apr 20 14:12:40 2016 (r298344) +++ head/sys/gnu/dts/mips/rt3352.dtsi Wed Apr 20 14:29:03 2016 (r298345) @@ -290,4 +290,4 @@ }; }; -#include +/include/ "fbsd-rt3352.dtsi" Modified: head/sys/gnu/dts/mips/rt3883.dtsi ============================================================================== --- head/sys/gnu/dts/mips/rt3883.dtsi Wed Apr 20 14:12:40 2016 (r298344) +++ head/sys/gnu/dts/mips/rt3883.dtsi Wed Apr 20 14:29:03 2016 (r298345) @@ -402,4 +402,4 @@ }; }; -#include +/include/ "fbsd-rt3883.dtsi" Modified: head/sys/gnu/dts/mips/rt5350.dtsi ============================================================================== --- head/sys/gnu/dts/mips/rt5350.dtsi Wed Apr 20 14:12:40 2016 (r298344) +++ head/sys/gnu/dts/mips/rt5350.dtsi Wed Apr 20 14:29:03 2016 (r298345) @@ -331,4 +331,4 @@ }; }; -#include +/include/ "fbsd-rt5350.dtsi" From owner-svn-src-all@freebsd.org Wed Apr 20 14:31:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D656AB16AF3; Wed, 20 Apr 2016 14:31:02 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A78011FFF; Wed, 20 Apr 2016 14:31:02 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KEV1Ho064945; Wed, 20 Apr 2016 14:31:01 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KEV1vp064944; Wed, 20 Apr 2016 14:31:01 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604201431.u3KEV1vp064944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Wed, 20 Apr 2016 14:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298346 - head/sys/boot/fdt/dts/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 14:31:02 -0000 Author: sgalabov Date: Wed Apr 20 14:31:01 2016 New Revision: 298346 URL: https://svnweb.freebsd.org/changeset/base/298346 Log: Include resets and clocks properties for PCI in FreeBSD RT3883 dtsi file This change is required so that RT3662/RT3883 PCI can function correctly Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6028 Modified: head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi Modified: head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi Wed Apr 20 14:29:03 2016 (r298345) +++ head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi Wed Apr 20 14:31:01 2016 (r298346) @@ -46,5 +46,8 @@ interrupt-parent = <&cpuintc>; interrupts = <4>; + + resets = <&rstctrl 23>; + clocks = <&clkctrl 21>; }; }; From owner-svn-src-all@freebsd.org Wed Apr 20 14:33:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64679B16BB3; Wed, 20 Apr 2016 14:33:01 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3530E1334; Wed, 20 Apr 2016 14:33:01 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KEX0mc067688; Wed, 20 Apr 2016 14:33:00 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KEX0aV067687; Wed, 20 Apr 2016 14:33:00 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604201433.u3KEX0aV067687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Wed, 20 Apr 2016 14:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298347 - head/sys/dev/flash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 14:33:01 -0000 Author: sgalabov Date: Wed Apr 20 14:33:00 2016 New Revision: 298347 URL: https://svnweb.freebsd.org/changeset/base/298347 Log: Modify mx25l FDT compatible device handling If we cannot establish compatibility by only looking at the compat_data we also check the flash_devices structure's names for a compatible device. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6026 Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Wed Apr 20 14:31:01 2016 (r298346) +++ head/sys/dev/flash/mx25l.c Wed Apr 20 14:33:00 2016 (r298347) @@ -443,12 +443,26 @@ static struct ofw_compat_data compat_dat static int mx25l_probe(device_t dev) { - #ifdef FDT + int i; + if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) - return (ENXIO); + + /* First try to match the compatible property to the compat_data */ + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 1) + goto found; + + /* + * Next, try to find a compatible device using the names in the + * flash_devices structure + */ + for (i = 0; i < nitems(flash_devices); i++) + if (ofw_bus_is_compatible(dev, flash_devices[i].name)) + goto found; + + return (ENXIO); +found: #endif device_set_desc(dev, "M25Pxx Flash Family"); From owner-svn-src-all@freebsd.org Wed Apr 20 14:33:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51018B16BC6 for ; Wed, 20 Apr 2016 14:33:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm13-vm0.bullet.mail.bf1.yahoo.com (nm13-vm0.bullet.mail.bf1.yahoo.com [98.139.213.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD7A01355 for ; Wed, 20 Apr 2016 14:33:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461162782; bh=tRrboU9+lnI7mUlC3o4xNws6BsUgrnR7SaPgsGwOxy8=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=WoSEtsg/5OFs+F+vj/jBpDoqRxOLEXgUOwi38R0ave+rg4gf9rh8ObjouDO/kd2Wlcjp9OVB9qdroSOMcNTx8qDWcmQ76UCFlBaW/kMAgKoaCztT+vGxpkLRGnlvyfPjutE9r5EpSheBMaPngj6r/jJevmbesOrhfFBN69J/KNardePWeoEuEAwc6Tm1FarMvUYeV9HSMWpnRbmYeQyHTaoVctgAs7QWsxhf3PQ0cFaoR2PH8sYpvUOdCIivaYOGl7eNGywsGqNc6qvMGOf9kOtUuAGqa63R7vQTu3zAnkRiiXVTDXCLu+dboPnsosndrgzVsILWAB1W7D5ZU8hvjw== Received: from [98.139.215.140] by nm13.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 14:33:02 -0000 Received: from [98.139.213.9] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 14:33:02 -0000 Received: from [127.0.0.1] by smtp109.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 14:33:02 -0000 X-Yahoo-Newman-Id: 811760.34204.bm@smtp109.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 7.pKa.EVM1lEbcaMg8a73isXdz6wbBTqD3s6yoGgupoqC9X ChCS2PzUJEwjwcv1hi57X2CARmvINIAi_cVWahDNuxQ2x6CbXLq9nO9fuGrl JPB6sxuGrEad0nLgolozprtCvHJ.NRdwk.hkhhLaXsBF6fLD1srQD59er7EP 4crT5MlpZWyfdXR.vV5ZnlvsytmFwZVNaq3sGF2pjICJXrhZxsqcJGma2Dvk 2i4V_WoxBRobVVBhH6bvifdWDz7DBnQxey7fpjGnl7nE6pGaq3X772NM6ouY qzjwKrFsauaSECGx3wHAmi.aO7hMbaz8_PBO2fBQnsIhSJ1.3yBA.TfbR3Us yLOhgQUPOrwyAzf0NU4fJC6YuNKPjcOAmqoyesQSgk.sn74XvPMaByvBUYki iu2_Xiq0k614rsFyKH9dhuJe8CWXh7kK7ajyWi1n6bimI0PNYvlVn3mWqdzL rLxyV.CqrIGbu71IjHaKUoYGRW5hOnMV9rEXQJPonu6_DfGN0xoGQMKEqFJ7 nbnUBvZWuH.TtfBqT_rRKwOz3Trr6.cJ9 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 To: Bruce Evans , araujo@freebsd.org References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <4114217.PtcV9LDMal@ralph.baldwin.cx> <20160420115844.Y967@besplex.bde.org> Cc: John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: Date: Wed, 20 Apr 2016 09:33:07 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160420115844.Y967@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 14:33:05 -0000 On 04/19/16 22:06, Bruce Evans wrote: > On Wed, 20 Apr 2016, Marcelo Araujo wrote: > >> 2016-04-20 0:16 GMT+08:00 John Baldwin : >> >>> On Tuesday, April 19, 2016 04:46:13 AM Marcelo Araujo wrote: >>>> Author: araujo >>>> Date: Tue Apr 19 04:46:13 2016 >>>> New Revision: 298247 >>>> URL: https://svnweb.freebsd.org/changeset/base/298247 >>>> >>>> Log: >>>> Remove redundant parenthesis. >>>> >>>> Submitted by: pfg >>>> MFC after: 2 weeks. > > I don't realling like churnging to the nonstandard nitems(). Use > of the nonstandard is bad enough. > TBH, I am not joyful about them either, however it does improve readability so it makes sense only in the cases where sys/param.h is already in use. One of the things I dislike is that most of the macros are in lowercase. Lowercase would make sense if these were inline functions but inline functions have disadvantages for these use cases. OTOH, if they were uppercase, they would not be very easy on the eyes, which is the current advantage. No way out of it :(. Pedro. From owner-svn-src-all@freebsd.org Wed Apr 20 14:35:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E62B16C9D; Wed, 20 Apr 2016 14:35:01 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D09617C0; Wed, 20 Apr 2016 14:35:01 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KEZ0Cb067798; Wed, 20 Apr 2016 14:35:00 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KEZ0xL067796; Wed, 20 Apr 2016 14:35:00 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604201435.u3KEZ0xL067796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Wed, 20 Apr 2016 14:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298348 - head/sys/mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 14:35:01 -0000 Author: sgalabov Date: Wed Apr 20 14:35:00 2016 New Revision: 298348 URL: https://svnweb.freebsd.org/changeset/base/298348 Log: Introduce OpenWRT compatible pinctrl driver for Mediatek/Ralink SoCs The driver can read and parse the OpenWRT pinctrl dts entries. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5999 Added: head/sys/mips/mediatek/mtk_pinctrl.h (contents, props changed) Modified: head/sys/mips/mediatek/mtk_pinctrl.c Modified: head/sys/mips/mediatek/mtk_pinctrl.c ============================================================================== --- head/sys/mips/mediatek/mtk_pinctrl.c Wed Apr 20 14:33:00 2016 (r298347) +++ head/sys/mips/mediatek/mtk_pinctrl.c Wed Apr 20 14:35:00 2016 (r298348) @@ -40,11 +40,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include "fdt_pinctrl_if.h" static const struct ofw_compat_data compat_data[] = { - { "ralink,rt2880-pinctrl", 1 }, + { "ralink,rt2880-pinmux", 1 }, /* Sentinel */ { NULL, 0 } @@ -74,21 +76,142 @@ mtk_pinctrl_attach(device_t dev) return (ENXIO); } - fdt_pinctrl_register(dev, "pinctrl-single,bits"); + if (bootverbose) + device_printf(dev, "GPIO mode start: 0x%08x\n", + mtk_sysctl_get(SYSCTL_GPIOMODE)); + + fdt_pinctrl_register(dev, NULL); fdt_pinctrl_configure_tree(dev); if (bootverbose) - device_printf(dev, "GPIO mode: 0x%08x\n", + device_printf(dev, "GPIO mode end : 0x%08x\n", mtk_sysctl_get(SYSCTL_GPIOMODE)); return (0); } static int +mtk_pinctrl_process_entry(device_t dev, struct mtk_pin_group *table, + const char *group, char *func) +{ + uint32_t val; + int found = 0, i, j; + + for (i = 0; table[i].name != NULL; i++) { + if (strcmp(table[i].name, group) == 0) { + found = 1; + break; + } + } + + if (!found) + return (ENOENT); + + for (j = 0; j < table[i].funcnum; j++) { + if (strcmp(table[i].functions[j].name, func) == 0) { + val = mtk_sysctl_get(table[i].sysc_reg); + val &= ~(table[i].mask << table[i].offset); + val |= (table[i].functions[j].value << table[i].offset); + mtk_sysctl_set(table[i].sysc_reg, val); + return (0); + } + } + + return (ENOENT); +} + +static int +mtk_pinctrl_process_node(device_t dev, struct mtk_pin_group *table, + phandle_t node) +{ + const char **group_list = NULL; + char *pin_function = NULL; + int ret, num_groups, i; + + ret = 0; + + num_groups = ofw_bus_string_list_to_array(node, "ralink,group", + &group_list); + + if (num_groups <= 0) + return (ENOENT); + + if (OF_getprop_alloc(node, "ralink,function", sizeof(*pin_function), + (void **)&pin_function) == -1) { + ret = ENOENT; + goto out; + } + + for (i = 0; i < num_groups; i++) { + if ((ret = mtk_pinctrl_process_entry(dev, table, group_list[i], + pin_function)) != 0) + goto out; + } + +out: + free(group_list, M_OFWPROP); + free(pin_function, M_OFWPROP); + return (ret); +} + +static int mtk_pinctrl_configure(device_t dev, phandle_t cfgxref) { + struct mtk_pin_group *pintable; + phandle_t node, child; + uint32_t socid; + int ret; + + node = OF_node_from_xref(cfgxref); + ret = 0; + + /* Now, get the system type, so we can get the proper GPIO mode array */ + socid = mtk_soc_get_socid(); + + switch (socid) { + case MTK_SOC_RT3050: /* fallthrough */ + case MTK_SOC_RT3052: + case MTK_SOC_RT3350: + pintable = rt3050_pintable; + break; + case MTK_SOC_RT3352: + pintable = rt3352_pintable; + break; + case MTK_SOC_RT3662: /* fallthrough */ + case MTK_SOC_RT3883: + pintable = rt3883_pintable; + break; + case MTK_SOC_RT5350: + pintable = rt5350_pintable; + break; + case MTK_SOC_MT7620A: /* fallthrough */ + case MTK_SOC_MT7620N: + pintable = mt7620_pintable; + break; + case MTK_SOC_MT7628: /* fallthrough */ + case MTK_SOC_MT7688: + pintable = mt7628_pintable; + break; + case MTK_SOC_MT7621: + pintable = mt7621_pintable; + break; + default: + ret = ENOENT; + goto out; + } + + /* + * OpenWRT dts files have single child within the pinctrl nodes, which + * contains the 'ralink,group' and 'ralink,function' properties. + */ + for (child = OF_child(node); child != 0 && child != -1; + child = OF_peer(child)) { + if ((ret = mtk_pinctrl_process_node(dev, pintable, child)) != 0) + return (ret); + } - return (EINVAL); +out: + return (ret); } static device_method_t mtk_pinctrl_methods[] = { Added: head/sys/mips/mediatek/mtk_pinctrl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mediatek/mtk_pinctrl.h Wed Apr 20 14:35:00 2016 (r298348) @@ -0,0 +1,354 @@ +/*- + * Copyright (c) 2016 Stanislav Galabov. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MTK_PINCTRL_H_ +#define _MTK_PINCTRL_H_ + +struct mtk_pin_function { + const char *name; + uint32_t value; +}; + +struct mtk_pin_group { + const char *name; + uint32_t sysc_reg; + uint32_t offset; + uint32_t mask; + struct mtk_pin_function *functions; + uint32_t funcnum; +}; + +#define FUNC(_name, _value) \ + { .name = (_name), .value = (_value) } + +#define GROUP(_name, _reg, _off, _mask, _funcs) \ + { .name = (_name), .sysc_reg = (_reg), .offset = (_off), \ + .mask = (_mask), .functions = (_funcs), .funcnum = nitems(_funcs) } + +#define GROUP_END { NULL, 0, 0, 0, NULL, 0 } + +#define DECL_FUNC(_name) \ + static struct mtk_pin_function _name[] +#define DECL_TABLE(_name) \ + static struct mtk_pin_group _name[] + +/* Pin function declarations */ +DECL_FUNC(i2c_func) = { + FUNC("i2c", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(spi_func) = { + FUNC("spi", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(uartf_func) = { + FUNC("uartf", 0), FUNC("pcm uartf", 1), FUNC("pcm i2s", 2), + FUNC("i2s uartf", 3), FUNC("pcm gpio", 4), FUNC("gpio uartf", 5), + FUNC("gpio i2s", 6), FUNC("gpio", 7) +}; + +DECL_FUNC(wdt_func) = { + FUNC("wdt rst", 0), FUNC("wdt", 0), FUNC("wdt refclk", 1), + FUNC("gpio", 2) +}; + +DECL_FUNC(uartlite_func) = { + FUNC("uartlite", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(jtag_func) = { + FUNC("jtag", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(mdio_func) = { + FUNC("mdio", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(led_func) = { + FUNC("led", 0), FUNC("gpio", 1), FUNC("bt", 2) +}; + +DECL_FUNC(cs1_func) = { + FUNC("spi_cs1", 0), FUNC("wdt_cs1", 1), FUNC("gpio", 2) +}; + +DECL_FUNC(sdram_func) = { + FUNC("sdram", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(rgmii_func) = { + FUNC("rgmii", 0), FUNC("rgmii1", 0), FUNC("rgmii2", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(lna_func) = { + FUNC("lna", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(pa_func) = { + FUNC("pa", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(gex_func) = { + FUNC("ge1", 0), FUNC("ge2", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(rt3883_pci_func) = { + FUNC("pci-dev", 0), FUNC("pci-host2", 1), FUNC("pci-host1", 2), + FUNC("pci-fnc", 3), FUNC("gpio", 7) +}; + +DECL_FUNC(mt7620_pcie_func) = { + FUNC("pcie rst", 0), FUNC("pcie refclk", 1), FUNC("gpio", 2) +}; + +DECL_FUNC(lna_a_func) = { + FUNC("lna a", 0), FUNC("lna g", 0), FUNC("codec", 2), FUNC("gpio", 3) +}; + +DECL_FUNC(nd_sd_func) = { + FUNC("nand", 0), FUNC("sd", 1), FUNC("gpio", 2) +}; + +DECL_FUNC(mt7620_mdio_func) = { + FUNC("mdio", 0), FUNC("mdio refclk", 1), FUNC("gpio", 2) +}; + +DECL_FUNC(spi_refclk_func) = { + FUNC("spi refclk", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(wled_func) = { + FUNC("wled", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(ephy_func) = { + FUNC("ephy", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(mt7628_gpio_func) = { + FUNC("gpio", 0), FUNC("gpio", 1), FUNC("refclk", 2), FUNC("pcie", 3) +}; + +DECL_FUNC(mt7628_spis_func) = { + FUNC("spis", 0), FUNC("gpio", 1), FUNC("utif", 2), FUNC("pwm", 3) +}; + +DECL_FUNC(mt7628_spi_cs1_func) = { + FUNC("spi", 0), FUNC("gpio", 1), FUNC("refclk", 2), FUNC("-", 3) +}; + +DECL_FUNC(mt7628_i2s_func) = { + FUNC("i2s", 0), FUNC("gpio", 1), FUNC("pcm", 2), FUNC("anttenna", 3) +}; + +DECL_FUNC(mt7628_uart0_func) = { + FUNC("uart", 0), FUNC("gpio", 1), FUNC("-", 2), FUNC("-", 3) +}; + +DECL_FUNC(mt7628_sd_func) = { + FUNC("sdxc", 0), FUNC("gpio", 1), FUNC("utif", 2), FUNC("jtag", 3) +}; + +DECL_FUNC(mt7628_perst_func) = { + FUNC("perst", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(mt7628_refclk_func) = { + FUNC("refclk", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(mt7628_i2c_func) = { + FUNC("i2c", 0), FUNC("gpio", 1), FUNC("debug", 2), FUNC("-", 3) +}; + +DECL_FUNC(mt7628_uart1_func) = { + FUNC("uart", 0), FUNC("gpio", 1), FUNC("pwm", 2), FUNC("sw r", 3) +}; + +DECL_FUNC(mt7628_uart2_func) = { + FUNC("uart", 0), FUNC("gpio", 1), FUNC("pwm", 2), FUNC("sdxc", 3) +}; + +DECL_FUNC(mt7628_pwm0_func) = { + FUNC("pwm", 0), FUNC("gpio", 1), FUNC("utif", 2), FUNC("sdxc", 3) +}; + +DECL_FUNC(mt7621_uart1_func) = { + FUNC("uart1", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(mt7621_i2c_func) = { + FUNC("i2c", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(mt7621_uart3_func) = { + FUNC("uart3", 0), FUNC("gpio", 1), FUNC("i2s", 2), FUNC("spdif3", 3) +}; + +DECL_FUNC(mt7621_uart2_func) = { + FUNC("uart2", 0), FUNC("gpio", 1), FUNC("pcm", 2), FUNC("spdif2", 3) +}; + +DECL_FUNC(mt7621_jtag_func) = { + FUNC("jtag", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(mt7621_wdt_func) = { + FUNC("wdt rst", 0), FUNC("gpio", 1), FUNC("wdt refclk", 2), FUNC("-", 3) +}; + +DECL_FUNC(mt7621_pcie_func) = { + FUNC("pcie rst", 0), FUNC("gpio", 1), FUNC("pcie refclk", 2), + FUNC("-", 3) +}; + +DECL_FUNC(mt7621_mdio_func) = { + FUNC("mdio", 0), FUNC("gpio", 1), FUNC("-", 2), FUNC("-", 3) +}; + +DECL_FUNC(mt7621_rgmii_func) = { + FUNC("rgmii1", 0), FUNC("rgmii2", 0), FUNC("gpio", 1) +}; + +DECL_FUNC(mt7621_spi_func) = { + FUNC("spi", 0), FUNC("gpio", 1), FUNC("nand1", 2), FUNC("-", 3) +}; + +DECL_FUNC(mt7621_sdhci_func) = { + FUNC("sdhci", 0), FUNC("gpio", 1), FUNC("nand1", 2), FUNC("-", 3) +}; + +/* Pin groups declarations */ +DECL_TABLE(mt7628_pintable) = { + GROUP("gpio", SYSCTL_GPIOMODE, 0, 3, mt7628_gpio_func), + GROUP("spis", SYSCTL_GPIOMODE, 2, 3, mt7628_spis_func), + GROUP("spi cs1", SYSCTL_GPIOMODE, 4, 3, mt7628_spi_cs1_func), + GROUP("i2s", SYSCTL_GPIOMODE, 6, 3, mt7628_i2s_func), + GROUP("uart0", SYSCTL_GPIOMODE, 8, 3, mt7628_uart0_func), + GROUP("sdmode", SYSCTL_GPIOMODE, 10, 3, mt7628_sd_func), + GROUP("spi", SYSCTL_GPIOMODE, 12, 1, spi_func), + GROUP("wdt", SYSCTL_GPIOMODE, 14, 1, wdt_func), + GROUP("perst", SYSCTL_GPIOMODE, 16, 1, mt7628_perst_func), + GROUP("refclk", SYSCTL_GPIOMODE, 18, 1, mt7628_refclk_func), + GROUP("i2c", SYSCTL_GPIOMODE, 20, 3, mt7628_i2c_func), + GROUP("uart1", SYSCTL_GPIOMODE, 24, 3, mt7628_uart1_func), + GROUP("uart2", SYSCTL_GPIOMODE, 26, 3, mt7628_uart2_func), + GROUP("pwm0", SYSCTL_GPIOMODE, 28, 3, mt7628_pwm0_func), + GROUP("pwm1", SYSCTL_GPIOMODE, 30, 3, mt7628_pwm0_func), + GROUP_END +}; + +DECL_TABLE(mt7621_pintable) = { + GROUP("uart1", SYSCTL_GPIOMODE, 1, 1, mt7621_uart1_func), + GROUP("i2c", SYSCTL_GPIOMODE, 2, 1, mt7621_i2c_func), + GROUP("uart3", SYSCTL_GPIOMODE, 3, 3, mt7621_uart3_func), + GROUP("uart2", SYSCTL_GPIOMODE, 5, 3, mt7621_uart2_func), + GROUP("jtag", SYSCTL_GPIOMODE, 7, 1, mt7621_jtag_func), + GROUP("wdt", SYSCTL_GPIOMODE, 8, 3, mt7621_wdt_func), + GROUP("pcie", SYSCTL_GPIOMODE, 10, 3, mt7621_pcie_func), + GROUP("mdio", SYSCTL_GPIOMODE, 12, 3, mt7621_mdio_func), + GROUP("rgmii2", SYSCTL_GPIOMODE, 15, 1, mt7621_rgmii_func), + GROUP("spi", SYSCTL_GPIOMODE, 16, 3, mt7621_spi_func), + GROUP("sdhci", SYSCTL_GPIOMODE, 18, 3, mt7621_sdhci_func), + GROUP("rgmii1", SYSCTL_GPIOMODE, 14, 1, mt7621_rgmii_func), + GROUP_END +}; + +DECL_TABLE(mt7620_pintable) = { + GROUP("i2c", SYSCTL_GPIOMODE, 0, 1, i2c_func), + GROUP("uartf", SYSCTL_GPIOMODE, 2, 7, uartf_func), + GROUP("uartlite", SYSCTL_GPIOMODE, 5, 1, uartlite_func), + GROUP("mdio", SYSCTL_GPIOMODE, 7, 3, mt7620_mdio_func), + GROUP("rgmii1", SYSCTL_GPIOMODE, 9, 1, rgmii_func), + GROUP("rgmii2", SYSCTL_GPIOMODE, 10, 1, rgmii_func), + GROUP("spi", SYSCTL_GPIOMODE, 11, 1, spi_func), + GROUP("spi refclk", SYSCTL_GPIOMODE, 12, 1, spi_refclk_func), + GROUP("wled", SYSCTL_GPIOMODE, 13, 1, wled_func), + GROUP("ephy", SYSCTL_GPIOMODE, 15, 1, ephy_func), + GROUP("pcie", SYSCTL_GPIOMODE, 16, 3, mt7620_pcie_func), + GROUP("nd_sd", SYSCTL_GPIOMODE, 18, 3, nd_sd_func), + GROUP("pa", SYSCTL_GPIOMODE, 20, 1, pa_func), + GROUP("wdt", SYSCTL_GPIOMODE, 21, 3, wdt_func), + GROUP_END +}; + +DECL_TABLE(rt3050_pintable) = { + GROUP("i2c", SYSCTL_GPIOMODE, 0, 1, i2c_func), + GROUP("spi", SYSCTL_GPIOMODE, 1, 1, spi_func), + GROUP("uartf", SYSCTL_GPIOMODE, 2, 7, uartf_func), + GROUP("uartlite", SYSCTL_GPIOMODE, 5, 1, uartlite_func), + GROUP("jtag", SYSCTL_GPIOMODE, 6, 1, jtag_func), + GROUP("mdio", SYSCTL_GPIOMODE, 7, 1, mdio_func), + GROUP("sdram", SYSCTL_GPIOMODE, 8, 1, sdram_func), + GROUP("rgmii", SYSCTL_GPIOMODE, 9, 1, rgmii_func), + GROUP_END +}; + +DECL_TABLE(rt3352_pintable) = { + GROUP("i2c", SYSCTL_GPIOMODE, 0, 1, i2c_func), + GROUP("spi", SYSCTL_GPIOMODE, 1, 1, i2c_func), + GROUP("uartf", SYSCTL_GPIOMODE, 2, 7, uartf_func), + GROUP("uartlite", SYSCTL_GPIOMODE, 5, 1, uartlite_func), + GROUP("jtag", SYSCTL_GPIOMODE, 6, 1, jtag_func), + GROUP("mdio", SYSCTL_GPIOMODE, 7, 1, mdio_func), + GROUP("rgmii", SYSCTL_GPIOMODE, 9, 1, rgmii_func), + GROUP("led", SYSCTL_GPIOMODE, 14, 3, led_func), + GROUP("lna", SYSCTL_GPIOMODE, 18, 1, lna_func), + GROUP("pa", SYSCTL_GPIOMODE, 20, 1, pa_func), + GROUP("spi_cs1", SYSCTL_GPIOMODE, 21, 3, cs1_func), + GROUP_END +}; + +DECL_TABLE(rt3883_pintable) = { + GROUP("i2c", SYSCTL_GPIOMODE, 0, 1, i2c_func), + GROUP("spi", SYSCTL_GPIOMODE, 1, 1, spi_func), + GROUP("uartf", SYSCTL_GPIOMODE, 2, 7, uartf_func), + GROUP("uartlite", SYSCTL_GPIOMODE, 5, 1, uartlite_func), + GROUP("jtag", SYSCTL_GPIOMODE, 6, 1, jtag_func), + GROUP("mdio", SYSCTL_GPIOMODE, 7, 1, mdio_func), + GROUP("lna a", SYSCTL_GPIOMODE, 16, 3, lna_a_func), + GROUP("lna g", SYSCTL_GPIOMODE, 18, 3, lna_a_func), + GROUP("pci", SYSCTL_GPIOMODE, 11, 7, rt3883_pci_func), + GROUP("ge1", SYSCTL_GPIOMODE, 9, 1, gex_func), + GROUP("ge2", SYSCTL_GPIOMODE, 10, 1, gex_func), + GROUP_END +}; + +DECL_TABLE(rt5350_pintable) = { + GROUP("i2c", SYSCTL_GPIOMODE, 0, 1, i2c_func), + GROUP("spi", SYSCTL_GPIOMODE, 1, 1, spi_func), + GROUP("uartf", SYSCTL_GPIOMODE, 2, 7, uartf_func), + GROUP("uartlite", SYSCTL_GPIOMODE, 5, 1, uartlite_func), + GROUP("jtag", SYSCTL_GPIOMODE, 6, 1, jtag_func), + GROUP("led", SYSCTL_GPIOMODE, 14, 3, led_func), + GROUP("spi_cs1", SYSCTL_GPIOMODE, 21, 3, cs1_func), + GROUP_END +}; + +#endif /* _MTK_PINCTRL_H_ */ From owner-svn-src-all@freebsd.org Wed Apr 20 14:36:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A16E3B16D64; Wed, 20 Apr 2016 14:36:46 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F3A119DB; Wed, 20 Apr 2016 14:36:46 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KEaj2Z067893; Wed, 20 Apr 2016 14:36:45 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KEajJn067892; Wed, 20 Apr 2016 14:36:45 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604201436.u3KEajJn067892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Wed, 20 Apr 2016 14:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298349 - head/sys/mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 14:36:46 -0000 Author: sgalabov Date: Wed Apr 20 14:36:45 2016 New Revision: 298349 URL: https://svnweb.freebsd.org/changeset/base/298349 Log: Rework mtk_gpio_v1 driver This revision makes the mtk_gpio_v1 driver read its register map property from the OpenWRT dts files. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6029 Modified: head/sys/mips/mediatek/mtk_gpio_v1.c Modified: head/sys/mips/mediatek/mtk_gpio_v1.c ============================================================================== --- head/sys/mips/mediatek/mtk_gpio_v1.c Wed Apr 20 14:35:00 2016 (r298348) +++ head/sys/mips/mediatek/mtk_gpio_v1.c Wed Apr 20 14:36:45 2016 (r298349) @@ -59,6 +59,20 @@ __FBSDID("$FreeBSD$"); #define MTK_GPIO_PINS 32 +enum mtk_gpio_regs { + GPIO_PIOINT = 0, + GPIO_PIOEDGE, + GPIO_PIORENA, + GPIO_PIOFENA, + GPIO_PIODATA, + GPIO_PIODIR, + GPIO_PIOPOL, + GPIO_PIOSET, + GPIO_PIORESET, + GPIO_PIOTOG, + GPIO_PIOMAX +}; + struct mtk_gpio_pin_irqsrc { struct intr_irqsrc isrc; u_int irq; @@ -81,6 +95,7 @@ struct mtk_gpio_softc { struct mtk_gpio_pin pins[MTK_GPIO_PINS]; void *intrhand; + uint8_t regs[GPIO_PIOMAX]; uint32_t num_pins; uint8_t do_remap; }; @@ -105,20 +120,10 @@ static int mtk_gpio_intr(void *arg); "mtk_gpio", MTX_SPIN) #define MTK_GPIO_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtx) -#define MTK_WRITE_4(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) -#define MTK_READ_4(sc, reg) bus_read_4((sc)->res[0], (reg)) - -/* Register definitions */ -#define GPIO_PIOINT(_sc) 0x0000 -#define GPIO_PIOEDGE(_sc) 0x0004 -#define GPIO_PIORENA(_sc) 0x0008 -#define GPIO_PIOFENA(_sc) 0x000C -#define GPIO_PIODATA(_sc) ((_sc)->do_remap ? 0x0020 : 0x0010) -#define GPIO_PIODIR(_sc) ((_sc)->do_remap ? 0x0024 : 0x0014) -#define GPIO_PIOPOL(_sc) ((_sc)->do_remap ? 0x0028 : 0x0018) -#define GPIO_PIOSET(_sc) ((_sc)->do_remap ? 0x002C : 0x001C) -#define GPIO_PIORESET(_sc) ((_sc)->do_remap ? 0x0030 : 0x0020) -#define GPIO_PIOTOG(_sc) ((_sc)->do_remap ? 0x0034 : 0x0024) +#define MTK_WRITE_4(sc, reg, val) \ + bus_write_4((sc)->res[0], (sc)->regs[(reg)], (val)) +#define MTK_READ_4(sc, reg) \ + bus_read_4((sc)->res[0], (sc)->regs[(reg)]) static struct ofw_compat_data compat_data[] = { { "ralink,rt2880-gpio", 1 }, @@ -182,12 +187,12 @@ mtk_gpio_pin_set_direction(struct mtk_gp if (!(sc->pins[pin].pin_caps & dir)) return (EINVAL); - regval = MTK_READ_4(sc, GPIO_PIODIR(sc)); + regval = MTK_READ_4(sc, GPIO_PIODIR); if (dir == GPIO_PIN_INPUT) regval &= ~mask; else regval |= mask; - MTK_WRITE_4(sc, GPIO_PIODIR(sc), regval); + MTK_WRITE_4(sc, GPIO_PIODIR, regval); sc->pins[pin].pin_flags &= ~(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT); sc->pins[pin].pin_flags |= dir; @@ -200,12 +205,12 @@ mtk_gpio_pin_set_invert(struct mtk_gpio_ { uint32_t regval, mask = (1u << pin); - regval = MTK_READ_4(sc, GPIO_PIOPOL(sc)); + regval = MTK_READ_4(sc, GPIO_PIOPOL); if (val) regval |= mask; else regval &= ~mask; - MTK_WRITE_4(sc, GPIO_PIOPOL(sc), regval); + MTK_WRITE_4(sc, GPIO_PIOPOL, regval); sc->pins[pin].pin_flags &= ~(GPIO_PIN_INVIN | GPIO_PIN_INVOUT); sc->pins[pin].pin_flags |= val; @@ -221,25 +226,25 @@ mtk_gpio_pin_probe(struct mtk_gpio_softc /* Clear cached gpio config */ sc->pins[pin].pin_flags = 0; - val = MTK_READ_4(sc, GPIO_PIORENA(sc)) | - MTK_READ_4(sc, GPIO_PIOFENA(sc)); + val = MTK_READ_4(sc, GPIO_PIORENA) | + MTK_READ_4(sc, GPIO_PIOFENA); if (val & mask) { /* Pin is in interrupt mode */ sc->pins[pin].intr_trigger = INTR_TRIGGER_EDGE; - val = MTK_READ_4(sc, GPIO_PIORENA(sc)); + val = MTK_READ_4(sc, GPIO_PIORENA); if (val & mask) sc->pins[pin].intr_polarity = INTR_POLARITY_HIGH; else sc->pins[pin].intr_polarity = INTR_POLARITY_LOW; } - val = MTK_READ_4(sc, GPIO_PIODIR(sc)); + val = MTK_READ_4(sc, GPIO_PIODIR); if (val & mask) sc->pins[pin].pin_flags |= GPIO_PIN_OUTPUT; else sc->pins[pin].pin_flags |= GPIO_PIN_INPUT; - val = MTK_READ_4(sc, GPIO_PIOPOL(sc)); + val = MTK_READ_4(sc, GPIO_PIOPOL); if (val & mask) { if (sc->pins[pin].pin_flags & GPIO_PIN_INPUT) { sc->pins[pin].pin_flags |= GPIO_PIN_INVIN; @@ -273,12 +278,10 @@ mtk_gpio_attach(device_t dev) if (OF_hasprop(node, "resets")) mtk_soc_reset_device(dev); - if (OF_hasprop(node, "mtk,register-gap")) { - device_printf(dev, "\n"); - sc->do_remap = 1; - } else { - device_printf(dev, "\n"); - sc->do_remap = 0; + if (OF_getprop(node, "ralink,register-map", sc->regs, + GPIO_PIOMAX) <= 0) { + device_printf(dev, "Failed to read register map\n"); + return (ENXIO); } if (OF_hasprop(node, "ralink,num-gpios") && (OF_getencprop(node, @@ -447,9 +450,9 @@ mtk_gpio_pin_set(device_t dev, uint32_t } if (value) - MTK_WRITE_4(sc, GPIO_PIOSET(sc), (1u << pin)); + MTK_WRITE_4(sc, GPIO_PIOSET, (1u << pin)); else - MTK_WRITE_4(sc, GPIO_PIORESET(sc), (1u << pin)); + MTK_WRITE_4(sc, GPIO_PIORESET, (1u << pin)); out: MTK_GPIO_UNLOCK(sc); @@ -474,7 +477,7 @@ mtk_gpio_pin_get(device_t dev, uint32_t ret = EINVAL; goto out; } - data = MTK_READ_4(sc, GPIO_PIODATA(sc)); + data = MTK_READ_4(sc, GPIO_PIODATA); *val = (data & (1u << pin)) ? 1 : 0; out: @@ -499,7 +502,7 @@ mtk_gpio_pin_toggle(device_t dev, uint32 ret = EINVAL; goto out; } - MTK_WRITE_4(sc, GPIO_PIOTOG(sc), (1u << pin)); + MTK_WRITE_4(sc, GPIO_PIOTOG, (1u << pin)); out: MTK_GPIO_UNLOCK(sc); @@ -539,15 +542,15 @@ mtk_gpio_pic_enable_intr(device_t dev, s MTK_GPIO_LOCK(sc); if (sc->pins[pin].intr_polarity == INTR_POLARITY_LOW) { - val = MTK_READ_4(sc, GPIO_PIORENA(sc)) & ~mask; - MTK_WRITE_4(sc, GPIO_PIORENA(sc), val); - val = MTK_READ_4(sc, GPIO_PIOFENA(sc)) | mask; - MTK_WRITE_4(sc, GPIO_PIOFENA(sc), val); + val = MTK_READ_4(sc, GPIO_PIORENA) & ~mask; + MTK_WRITE_4(sc, GPIO_PIORENA, val); + val = MTK_READ_4(sc, GPIO_PIOFENA) | mask; + MTK_WRITE_4(sc, GPIO_PIOFENA, val); } else { - val = MTK_READ_4(sc, GPIO_PIOFENA(sc)) & ~mask; - MTK_WRITE_4(sc, GPIO_PIOFENA(sc), val); - val = MTK_READ_4(sc, GPIO_PIORENA(sc)) | mask; - MTK_WRITE_4(sc, GPIO_PIORENA(sc), val); + val = MTK_READ_4(sc, GPIO_PIOFENA) & ~mask; + MTK_WRITE_4(sc, GPIO_PIOFENA, val); + val = MTK_READ_4(sc, GPIO_PIORENA) | mask; + MTK_WRITE_4(sc, GPIO_PIORENA, val); } MTK_GPIO_UNLOCK(sc); @@ -568,10 +571,10 @@ mtk_gpio_pic_disable_intr(device_t dev, MTK_GPIO_LOCK(sc); - val = MTK_READ_4(sc, GPIO_PIORENA(sc)) & ~mask; - MTK_WRITE_4(sc, GPIO_PIORENA(sc), val); - val = MTK_READ_4(sc, GPIO_PIOFENA(sc)) & ~mask; - MTK_WRITE_4(sc, GPIO_PIOFENA(sc), val); + val = MTK_READ_4(sc, GPIO_PIORENA) & ~mask; + MTK_WRITE_4(sc, GPIO_PIORENA, val); + val = MTK_READ_4(sc, GPIO_PIOFENA) & ~mask; + MTK_WRITE_4(sc, GPIO_PIOFENA, val); MTK_GPIO_UNLOCK(sc); } @@ -599,7 +602,7 @@ mtk_gpio_pic_post_filter(device_t dev, s pisrc = (struct mtk_gpio_pin_irqsrc *)isrc; sc = device_get_softc(dev); MTK_GPIO_LOCK(sc); - MTK_WRITE_4(sc, GPIO_PIOINT(sc), 1u << pisrc->irq); + MTK_WRITE_4(sc, GPIO_PIOINT, 1u << pisrc->irq); MTK_GPIO_UNLOCK(sc); } @@ -610,7 +613,7 @@ mtk_gpio_intr(void *arg) uint32_t i, interrupts; sc = arg; - interrupts = MTK_READ_4(sc, GPIO_PIOINT(sc)); + interrupts = MTK_READ_4(sc, GPIO_PIOINT); for (i = 0; interrupts != 0; i++, interrupts >>= 1) { if ((interrupts & 0x1) == 0) From owner-svn-src-all@freebsd.org Wed Apr 20 14:41:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77DF5B16F09; Wed, 20 Apr 2016 14:41:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ob0-f193.google.com (mail-ob0-f193.google.com [209.85.214.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45B6C1EE9; Wed, 20 Apr 2016 14:41:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ob0-f193.google.com with SMTP id js7so4164301obc.0; Wed, 20 Apr 2016 07:41:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=RP5t7Eoj6lhI8lGX7z+Rp9FCo8N+akCwGDAORRn5Oy0=; b=lnV+FMffuIgxwAaXw0ufZWlemlp5BeLY8G8Cb93jBEZE9zUPhrV2Vkti8J4KNrzLxV FCaCZclPCWyaN7eJs4Pi4e2eEoOoK9Te0vkrI3HcPeA/XmqF51F+h6lFv1suyLlv4jsy X8CBvIulokuarFiyJu3YTkrWvTClyFKCGXXXLhS8RdrRANVm6RCAJTcvbfqRIgp2ToZ2 q8H7ofvN27jtxfenkGTy+OkwA6wVUpIXDqNWhwApBArhOPM4El5yQPxnjJgOkVr3ZT4m 5D1EGqKPiBtNlPc6W/fIXVNwx0ASXcB872dXThd/BlHv26hXJEcAxF6CBqZHTopXWVob MbBg== X-Gm-Message-State: AOPr4FVyITMabX5mW+fS3R229mq1UAxYEeRgpEpwWRFRiBekpruQYY0X7B4o1mZG1o0zVg== X-Received: by 10.182.49.6 with SMTP id q6mr3900680obn.79.1461163302786; Wed, 20 Apr 2016 07:41:42 -0700 (PDT) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id n6sm22712570obi.4.2016.04.20.07.41.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Apr 2016 07:41:42 -0700 (PDT) Received: by mail-oi0-f51.google.com with SMTP id r78so42387937oie.0; Wed, 20 Apr 2016 07:41:42 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.157.6.65 with SMTP id 59mr4312066otn.39.1461163301971; Wed, 20 Apr 2016 07:41:41 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.22.215 with HTTP; Wed, 20 Apr 2016 07:41:41 -0700 (PDT) In-Reply-To: References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <4114217.PtcV9LDMal@ralph.baldwin.cx> <20160420115844.Y967@besplex.bde.org> Date: Wed, 20 Apr 2016 07:41:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 From: Conrad Meyer To: Pedro Giffuni Cc: Bruce Evans , araujo@freebsd.org, John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 14:41:44 -0000 On Wed, Apr 20, 2016 at 7:33 AM, Pedro Giffuni wrote: > One of the things I dislike is that most of the macros are in > lowercase. Lowercase would make sense if these were inline functions > but inline functions have disadvantages for these use cases. > OTOH, if they were uppercase, they would not be very easy on the eyes, > which is the current advantage. You bring up a good point. Obviously nitems() can't be an inline function, but roundup2() and friends could. Is there any reason not to change them over to inline functions? Best, Conrad From owner-svn-src-all@freebsd.org Wed Apr 20 14:47:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68F34B15410; Wed, 20 Apr 2016 14:47:18 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C17D1379; Wed, 20 Apr 2016 14:47:18 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KElHLX070937; Wed, 20 Apr 2016 14:47:17 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KElHL5070934; Wed, 20 Apr 2016 14:47:17 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604201447.u3KElHL5070934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Wed, 20 Apr 2016 14:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298350 - in head/sys: dev/rt mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 14:47:18 -0000 Author: sgalabov Date: Wed Apr 20 14:47:16 2016 New Revision: 298350 URL: https://svnweb.freebsd.org/changeset/base/298350 Log: Add compat strings used by OpenWRT to some Mediatek/Ralink drivers Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5995 Modified: head/sys/dev/rt/if_rt.c head/sys/mips/mediatek/mtk_pcie.c head/sys/mips/mediatek/mtk_usb_phy.c Modified: head/sys/dev/rt/if_rt.c ============================================================================== --- head/sys/dev/rt/if_rt.c Wed Apr 20 14:36:45 2016 (r298349) +++ head/sys/dev/rt/if_rt.c Wed Apr 20 14:47:16 2016 (r298350) @@ -104,6 +104,7 @@ static const struct ofw_compat_data rt_c { "ralink,rt3883-eth", RT_CHIPID_RT3050 }, { "ralink,rt5350-eth", RT_CHIPID_RT5350 }, { "ralink,mt7620a-eth", RT_CHIPID_MT7620 }, + { "mediatek,mt7620-eth", RT_CHIPID_MT7620 }, { "ralink,mt7621-eth", RT_CHIPID_MT7621 }, { "mediatek,mt7621-eth", RT_CHIPID_MT7621 }, { NULL, 0 } Modified: head/sys/mips/mediatek/mtk_pcie.c ============================================================================== --- head/sys/mips/mediatek/mtk_pcie.c Wed Apr 20 14:36:45 2016 (r298349) +++ head/sys/mips/mediatek/mtk_pcie.c Wed Apr 20 14:47:16 2016 (r298350) @@ -201,13 +201,9 @@ mtk_pci_ranges(phandle_t node, struct mt } static struct ofw_compat_data compat_data[] = { - { "ralink,rt3662-pcie", MTK_SOC_RT3883 }, - { "ralink,rt3883-pcie", MTK_SOC_RT3883 }, - { "ralink,mt7620a-pcie", MTK_SOC_MT7620A }, - { "ralink,mt7621-pcie", MTK_SOC_MT7621 }, + { "ralink,rt3883-pci", MTK_SOC_RT3883 }, + { "mediatek,mt7620-pci", MTK_SOC_MT7620A }, { "mediatek,mt7621-pci", MTK_SOC_MT7621 }, - { "ralink,mt7628-pcie", MTK_SOC_MT7628 }, - { "ralink,mt7688-pcie", MTK_SOC_MT7628 }, { NULL, MTK_SOC_UNKNOWN } }; Modified: head/sys/mips/mediatek/mtk_usb_phy.c ============================================================================== --- head/sys/mips/mediatek/mtk_usb_phy.c Wed Apr 20 14:36:45 2016 (r298349) +++ head/sys/mips/mediatek/mtk_usb_phy.c Wed Apr 20 14:47:16 2016 (r298350) @@ -85,6 +85,7 @@ static void mtk_usb_phy_mt7628_init(devi static struct ofw_compat_data compat_data[] = { { "ralink,mt7620-usbphy", MTK_SOC_MT7620A }, + { "mediatek,mt7620-usbphy", MTK_SOC_MT7620A }, { "ralink,mt7628an-usbphy", MTK_SOC_MT7628 }, { "ralink,rt3352-usbphy", MTK_SOC_RT3352 }, { "ralink,rt3050-usbphy", MTK_SOC_RT3050 }, From owner-svn-src-all@freebsd.org Wed Apr 20 15:04:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7921B1608B for ; Wed, 20 Apr 2016 15:04:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm47-vm9.bullet.mail.bf1.yahoo.com (nm47-vm9.bullet.mail.bf1.yahoo.com [216.109.114.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9AD172A for ; Wed, 20 Apr 2016 15:04:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461164681; bh=O6X5VE0Eg24MnhkitNnEfUBcg+ZnSYb553BCmZPlG9c=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=g+Q6paxNbY9DkAJEqeArVv2y+tYS9Ax9pddF/nWW9Ds/wMYbLXmeEibqjnmYvYfveV+ZdPPe2tzvkGTD9Lor5/PLnv5BDTqVnkIq/e35Vnos4kvukfWkrgwyuDgjkt6/OR+NvvRMpVJf4qniXQLSVm4bBUSChtmrbiAxBWLexmE426e/56cr3MDhju4KKdnQ2Sba0gjsKl9mhwnnMbBMa6ko0DpRxNBazRIAq7wOgeAh2dF5HLGVfmimcsSmVQo1S7/MAO0XqO8gDYtbBMQ3x1X3mof8bbo+Ro00/XlPEILi9V7og91a9S97JJzKbCMdrdUTmKTnJ400deG6TGjT0w== Received: from [98.139.170.179] by nm47.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:04:41 -0000 Received: from [68.142.230.78] by tm22.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:04:41 -0000 Received: from [127.0.0.1] by smtp235.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:04:41 -0000 X-Yahoo-Newman-Id: 720905.92508.bm@smtp235.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: RSuORfUVM1mOoxixV7_7YpcKWGKrbqcLRMvbq53z5kWyXLz ReSLPpQqoJYhqPl133sT8eVlF.W_yV_9.2tNx0rQLpMkPQySbYZ9S5tqMA5N qNprBsQDb6veC6rwoySrEnW0RJNX2saHJpu1r10DH_oLX1X4o1UTtTh3UFOu 7RSACzivOGHxCSZEFsmx4to5SusTO08Q2Rej2IYRbKViSE3CRzpRn59hSLUC V1wwHW_LozVRH2m.d7Kf1scYcil4b3kBXDO_7SOEvEz5wwOUkqRcAZlfMVg2 ke4.OiSiGHVLwbYgr3C4dQeqDjdsyDmlmiZcUHdSsWO3h1VAYr6h.ga74Cxt 9zcgnW1XcETJY0DHu5sYQPtmDLsEuoKMPTuT5Poksw17vX3BgZKzdKIylxcF jzGV.nr7SsdnYNvzfqf00aiDddBkEmdV860N4roERPHnU0EMVIpWUDsrc51w iVTXQ69GzKt.Fj4L7onTGteGN.fssPKK7hY9fltzqkBYqYVRSdWZSHEC9bwg HCAwxXrDSFQ4ZgB_Mgg6FFFD4Zxxaf7pw X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 To: cem@FreeBSD.org References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <4114217.PtcV9LDMal@ralph.baldwin.cx> <20160420115844.Y967@besplex.bde.org> Cc: Bruce Evans , araujo@freebsd.org, John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <3ddd1087-e83a-d14c-1cc2-951a6d23306f@FreeBSD.org> Date: Wed, 20 Apr 2016 10:04:47 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 15:04:44 -0000 On 04/20/16 09:41, Conrad Meyer wrote: > On Wed, Apr 20, 2016 at 7:33 AM, Pedro Giffuni wrote: >> One of the things I dislike is that most of the macros are in >> lowercase. Lowercase would make sense if these were inline functions >> but inline functions have disadvantages for these use cases. >> OTOH, if they were uppercase, they would not be very easy on the eyes, >> which is the current advantage. > > > You bring up a good point. Obviously nitems() can't be an inline > function, but roundup2() and friends could. Is there any reason not > to change them over to inline functions? > That would be interesting. The question would be if there are type issues. I guess most uses require ints but some many use size_t. If you are willing to try that, have a look at his patch: https://people.freebsd.org/~pfg/patches/sys-roundup2.diff I also have a coccinelle "patch" to replace howmany() and roundup(). Pedro. From owner-svn-src-all@freebsd.org Wed Apr 20 15:06:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98CA7B1616E for ; Wed, 20 Apr 2016 15:06:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm30-vm0.bullet.mail.bf1.yahoo.com (nm30-vm0.bullet.mail.bf1.yahoo.com [98.139.213.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E3B61985 for ; Wed, 20 Apr 2016 15:06:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461164804; bh=zoiaeODonzQ3jxS4/SturDAKnI4Ina1ajkrNo2Rj3DQ=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=g8DH2XDnmNXGHAjlQndxuUcDvCMeWMP9ec3jw2CjA/0xUffQ+eEg/LNfNKxddkeCpnl9s93Izkqbnz5BAeqGTWoHnZ4MNwFPsjEXZ+URMBMq8mTrzkAxan8L/3iCMGJ+LeUT3x+Ts4K72xaI5ar4qlvlQyuO4waUmtGIWbqrpOq0yKTJvpg9jbRhShyrnPj+mHADF3/r2k+uF9iL6DKccsMJDznuaHOsuI8VNbHkrStBt/j86z/E3j8WGuU5s9MjD22e2kdONxLw9VtmEuFtoBVhDR99fO0qfiTZ/DnKyKpDzehuhBrI80maYlWHF/W/miDPaYY9gPO1v9sGpgt/sw== Received: from [98.139.214.32] by nm30.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:06:44 -0000 Received: from [68.142.230.74] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:06:44 -0000 Received: from [127.0.0.1] by smtp231.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:06:44 -0000 X-Yahoo-Newman-Id: 896411.82476.bm@smtp231.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: hibHc90VM1k0t8F8.c37vIHNicIh0gmjGbxxgpBsxH4aWm0 _GwUqCs2.QC_x.2jb85M_e6dcw3uW83b7haSHSiGtAHEQ4dpgAKGhJRGzuCc aHXYpey_2yyDlFOGi7AuDKA_8fKHAfPYS3n2sMvq7MDyho3WjIgVwgt29kA0 GGNjWXswJ89DeS0tJd6JdtgmOuTyveQOgb4MT0.3K.mzxBe70FhnrTWXOz9D HZ9VO6zZrXM.x3ZmdHvbLHHA53SPW0Atck0NdSaMIDO0CraSOSJ7QPontqP4 sijpCRLn8jU643AzzsFCOTfqO0ZF97_H3Sv965p2OzKZEICGyvOPG0x0BH1c 3cLCXtu_pkTjppbHQ6jTRFrCdcNOR31JuXEeJN4e1EdlMnd5BIw2YuAgr9il elfqaArH9HUShhu_FpZqVQOgQBz5rJyPMk0Hg3Ys.RzebN.Hd7YfE6Aub95v mpgq29MVcMsxOu9Fl9v0mutTyMkQ32w1LXESP_mbPfe00F7NDlpYpE3gKPOd pRkRtZt3fdCsu0QxvmFStQZrCMlhKyQNO X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 To: cem@FreeBSD.org References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <4114217.PtcV9LDMal@ralph.baldwin.cx> <20160420115844.Y967@besplex.bde.org> <3ddd1087-e83a-d14c-1cc2-951a6d23306f@FreeBSD.org> Cc: Bruce Evans , araujo@freebsd.org, John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <753495a5-9ccd-1ec8-6f62-4006ff0345e2@FreeBSD.org> Date: Wed, 20 Apr 2016 10:06:49 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <3ddd1087-e83a-d14c-1cc2-951a6d23306f@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 15:06:53 -0000 On 04/20/16 10:04, Pedro Giffuni wrote: > > > On 04/20/16 09:41, Conrad Meyer wrote: >> On Wed, Apr 20, 2016 at 7:33 AM, Pedro Giffuni wrote: >>> One of the things I dislike is that most of the macros are in >>> lowercase. Lowercase would make sense if these were inline functions >>> but inline functions have disadvantages for these use cases. >>> OTOH, if they were uppercase, they would not be very easy on the eyes, >>> which is the current advantage. >> >> >> You bring up a good point. Obviously nitems() can't be an inline >> function, but roundup2() and friends could. Is there any reason not >> to change them over to inline functions? >> > > That would be interesting. The question would be if there are type > issues. I guess most uses require ints but some many use size_t. > s/many/may/ Pedro. From owner-svn-src-all@freebsd.org Wed Apr 20 15:15:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 087A5B1665B; Wed, 20 Apr 2016 15:15:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 96A551152; Wed, 20 Apr 2016 15:15:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 3003AD62CAF; Thu, 21 Apr 2016 01:15:18 +1000 (AEST) Date: Thu, 21 Apr 2016 01:15:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Pedro Giffuni , Bruce Evans , araujo@freebsd.org, John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 In-Reply-To: Message-ID: <20160421004457.L1073@besplex.bde.org> References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <4114217.PtcV9LDMal@ralph.baldwin.cx> <20160420115844.Y967@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=TuMb/2jh c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=3oYkN2nUbJYVCEAYZf8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 15:15:29 -0000 On Wed, 20 Apr 2016, Conrad Meyer wrote: > On Wed, Apr 20, 2016 at 7:33 AM, Pedro Giffuni wrote: >> One of the things I dislike is that most of the macros are in >> lowercase. Lowercase would make sense if these were inline functions >> but inline functions have disadvantages for these use cases. >> OTOH, if they were uppercase, they would not be very easy on the eyes, >> which is the current advantage. Lower case is correct if nitems is a safe macro. I think it is safe, because its parameter must be an array and an expression with side effects can't be an array. > You bring up a good point. Obviously nitems() can't be an inline > function, but roundup2() and friends could. Is there any reason not > to change them over to inline functions? 1. Namespace pollution. Adding nitems() to sys/param.h already broke anything using that name. 2. roundup2() and friends can't be inline functions without unportable complications to make them type-generic. No one ever did this for the more important imin() family of inline functions. 4.4BSD removed the MAX() and MIN() macros in the kernel to enforce use of the imin() family, but this gave type errors and was routed around by restoring the macros, first in scattered places and then back in sys/param.h. 2-arg type-generic functions are especially difficult since they have N^2 combinations where N is approximately the number of types in inttypes.h. There are 8 basic types just for 8/16/32/64 bits signed and unsigned. For compaibility, the result type must be the same as what the macro gives. Bruce From owner-svn-src-all@freebsd.org Wed Apr 20 15:17:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45AECB166F1 for ; Wed, 20 Apr 2016 15:17:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A5561308 for ; Wed, 20 Apr 2016 15:17:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ig0-x234.google.com with SMTP id m9so39827120ige.1 for ; Wed, 20 Apr 2016 08:17:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=lhUzTdDwI7cD9KSKErake1VAyMvSEZiIPdmUTvsY07I=; b=JMngcPJxr7RMSDU33ZuSnDKltmRhhayLwR1tQm2y5m3dYVu0jP5ze+2ygIxrPh5Mik kmKYPzFc4XXZpNweT/X+5TclpfkTuvbbKG4ZxJznLdisg/3wM05+aNdzuopWelGMOPST R+vCuBK9b6uZI3w85S2sxevHGmcdjURVtzGowDYHGmkCHcE6YBzHbjlv+sVBv0H8Y5wS 7pITwT2+8UcKXJWfbtmcRua10nQxTabe34G13I7Ip3cY4iZLwyB3a7twQB7Cq6dLKox2 XL0VQRbDofzRKShOPNx+VJUEGG2fhezUFXl2N9SoVD+RcX5CvWguqAiBG+jOrA1qdMvZ 4SKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=lhUzTdDwI7cD9KSKErake1VAyMvSEZiIPdmUTvsY07I=; b=SjwojheYFoS6Yk0EYzcFQbde74AOesfFnAwhSYgR8HWkK8ZVPGWBCErXKhQuAQGK5/ eprU+LvefXVUQmkTgL84O6CAshgxIs6Nbn/iNpZUI0AuFhBlPjcLaEMXJCDzC95S9x0P ojHozvK5pSJLggs0gss1zk2Fm7TWDOkyw715WfWzODpsbA+S50kJvxClXMgC5thj1IOJ 6N0iMa85dyJJHFi3GHHqmkYz6ZlFnPEoCQUA5ybazeElzqW1cD+qmTAWvF/s3+W/M3Kj NL3ib9Ebr7HiS13uuUxfhAbQAflkHTOVwnlX7MQCxM++8IM7N87v1UbhRqQIsuSzY89R Qksw== X-Gm-Message-State: AOPr4FXEC/QBYTua8l3jcvEoAp+GyH8203luuGWGuU/oSOD+EwWbREBIvOeTsOucfJTJcHIj3wjBo1zs+gtHfg== MIME-Version: 1.0 X-Received: by 10.50.110.99 with SMTP id hz3mr4139737igb.16.1461165426276; Wed, 20 Apr 2016 08:17:06 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.79.104.197 with HTTP; Wed, 20 Apr 2016 08:17:06 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160420084542.GC2422@kib.kiev.ua> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <57157108.6090500@freebsd.org> <20160419093022.GV2422@kib.kiev.ua> <5716538B.4060108@freebsd.org> <1461086958.1232.30.camel@freebsd.org> <20160420084542.GC2422@kib.kiev.ua> Date: Wed, 20 Apr 2016 09:17:06 -0600 X-Google-Sender-Auth: N7gBQ2QGjnkfHoTNua920uN4-H8 Message-ID: Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: Warner Losh To: Konstantin Belousov Cc: Ian Lepore , Allan Jude , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 15:17:07 -0000 On Wed, Apr 20, 2016 at 2:45 AM, Konstantin Belousov wrote: > On Tue, Apr 19, 2016 at 11:29:18AM -0600, Ian Lepore wrote: > > On Tue, 2016-04-19 at 11:49 -0400, Allan Jude wrote: > > > On 2016-04-19 05:30, Konstantin Belousov wrote: > > > > On Mon, Apr 18, 2016 at 07:43:04PM -0400, Allan Jude wrote: > > > > > On 2016-04-18 19:36, Adrian Chadd wrote: > > > > > > Someone pointed out how this bloats out memory requirement in > > > > > > loader. > > > > > > > > > > > > Did anyone check that? > > > > > > > > > > > > -adrian > > > > > > > > > > > > > > > > I tested down to 128mb of ram in QEMU, booted from the installer > > > > > ISO, > > > > > did the install, and booted the installed system without issue. > > > > > > > > 64MB is^H^H was very much useful and workable i386 config. i386 > > > > kernel > > > > does fit into the 32M but current automatic tuning prevents > > > > usermode > > > > from operating. Little manual tuning make 32M on tolerable. > > > > > > > > Making loader require 64M is a regression. At very least, it is > > > > impossible to test low mem configs anymore. > > > > > > > > > > Would a src.conf knob make sense, to use a smaller value when > > > targeting > > > small systems, while keeping the advantages when using more > > > reasonable > > > systems? > > > > > > Or we could make these changes to the HEAP and bcache size specific > > > to > > > 64bit platforms? > > > > > > > Exactly which "small systems" are we talking about here? From what I > > saw in the commit, all of this affects only i386 and amd64 and pc98 > > right now, not arm or mips or other systems that often have < 64MB ram. > > > > I take care of some really old legacy embedded systems at customer > > sites, and even so, with stuff dating back to the 2003-ish timeframe, > > the smallest i386 memory I have to deal with is 64MB. Are there really > > x86 systems that need to run in 32MB or less of ram these days, and use > > BIOS or EFI to boot? > Most of the VM/core system work is performed on the x86 machines, I mean > the debugging and testing, and not compiling. Consider this first-hand > experience. > > That is, not being able to check a change on 32MB x86 machine means, > for significant number of developers, that the change cannot be tested > on 32M machine at all. I leave the exercise of predicting the FreeBSD > behaviour on 32MB MIPS or ARM arches, after the x86 is left to require > 128MB at least for several months, to interested readers. > > What I wrote above is the only my concern, I do not know for sure if there > are any production-important installations where x86 FreeBSD of recent > versions run on, say, 64MB. As I noted elsewere, 64MB is enough to have > userspace fully operational. 32MB is not, but it is still useful for > kernel-only use. 32MB on arm is tight. Some heroics on tuning and you can still run on 32MB boards. But it is a lot of heroics, at least for ARM. Some minor tweaking gets 64MB to perform well, at least for the DNS / DHCP server I run on mine. Warner From owner-svn-src-all@freebsd.org Wed Apr 20 15:31:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C421B16C13; Wed, 20 Apr 2016 15:31:04 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39F921C92; Wed, 20 Apr 2016 15:31:04 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KFV3oe083071; Wed, 20 Apr 2016 15:31:03 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KFV3dr083070; Wed, 20 Apr 2016 15:31:03 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201604201531.u3KFV3dr083070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 20 Apr 2016 15:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298351 - head/sys/nlm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 15:31:04 -0000 Author: sbruno Date: Wed Apr 20 15:31:03 2016 New Revision: 298351 URL: https://svnweb.freebsd.org/changeset/base/298351 Log: Avoid a possible heap overflow in our nlm code by limiting the number of service to the arbitrary value of 256. Log an appropriate message that indicates the hard limit. PR: 208808 Submitted by: cturt@hardenedbsd.org Reviewed by: dfr Obtained from: HardenedBSD MFC after: 2 weeks Modified: head/sys/nlm/nlm_prot_impl.c Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Wed Apr 20 14:47:16 2016 (r298350) +++ head/sys/nlm/nlm_prot_impl.c Wed Apr 20 15:31:03 2016 (r298351) @@ -1439,6 +1439,12 @@ nlm_register_services(SVCPOOL *pool, int return (EINVAL); } + if (addr_count < 0 || addr_count > 256 ) { + NLM_ERR("NLM: too many service addresses (%d) given, " + "max 256 - can't start server\n", addr_count); + return (EINVAL); + } + xprts = malloc(addr_count * sizeof(SVCXPRT *), M_NLM, M_WAITOK|M_ZERO); for (i = 0; i < version_count; i++) { for (j = 0; j < addr_count; j++) { From owner-svn-src-all@freebsd.org Wed Apr 20 15:45:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D102B151E7; Wed, 20 Apr 2016 15:45:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2ADD1859; Wed, 20 Apr 2016 15:45:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KFjv2H088981; Wed, 20 Apr 2016 15:45:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KFjtkV088965; Wed, 20 Apr 2016 15:45:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604201545.u3KFjtkV088965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Apr 2016 15:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298352 - in head/sys: arm/amlogic/aml8726 arm/arm arm/at91 arm/mv/armadaxp arm/ti/cpsw arm/xscale/ixp425 mips/mips pc98/cbus powerpc/powerpc powerpc/pseries sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 15:45:58 -0000 Author: pfg Date: Wed Apr 20 15:45:55 2016 New Revision: 298352 URL: https://svnweb.freebsd.org/changeset/base/298352 Log: Use our nitems() macro when param.h is available. Replacements specific to arm, mips, pc98, powerpc and sparc64. Discussed in: freebsd-current Modified: head/sys/arm/amlogic/aml8726/aml8726_clkmsr.c head/sys/arm/arm/db_interface.c head/sys/arm/at91/at91_pmc.c head/sys/arm/mv/armadaxp/armadaxp.c head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/xscale/ixp425/ixp425.c head/sys/mips/mips/db_interface.c head/sys/pc98/cbus/gdc.c head/sys/pc98/cbus/pckbd.c head/sys/pc98/cbus/scterm-sck.c head/sys/powerpc/powerpc/db_trace.c head/sys/powerpc/pseries/xics.c head/sys/sparc64/sparc64/db_trace.c head/sys/sparc64/sparc64/elf_machdep.c head/sys/sparc64/sparc64/trap.c Modified: head/sys/arm/amlogic/aml8726/aml8726_clkmsr.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_clkmsr.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/arm/amlogic/aml8726/aml8726_clkmsr.c Wed Apr 20 15:45:55 2016 (r298352) @@ -69,8 +69,7 @@ static struct aml8726_clkmsr_clk { #define AML_CLKMSR_CLK81 0 -#define AML_CLKMSR_NCLKS (sizeof(aml8726_clkmsr_clks) \ - / sizeof(aml8726_clkmsr_clks[0])) +#define AML_CLKMSR_NCLKS nitems(aml8726_clkmsr_clks) struct aml8726_clkmsr_softc { device_t dev; Modified: head/sys/arm/arm/db_interface.c ============================================================================== --- head/sys/arm/arm/db_interface.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/arm/arm/db_interface.c Wed Apr 20 15:45:55 2016 (r298352) @@ -100,7 +100,7 @@ struct db_variable db_regs[] = { { "irq_sp", &nil, db_access_irq_sp, }, }; -struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]); +struct db_variable *db_eregs = db_regs + nitems(db_regs); int db_access_und_sp(struct db_variable *vp, db_expr_t *valp, int rw) Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/arm/at91/at91_pmc.c Wed Apr 20 15:45:55 2016 (r298352) @@ -320,7 +320,7 @@ at91_pmc_clock_add(const char *name, uin else clk->parent = parent; - for (i = 0; i < sizeof(clock_list) / sizeof(clock_list[0]); i++) { + for (i = 0; i < nitems(clock_list); i++) { if (clock_list[i] == NULL) { clock_list[i] = clk; return (clk); @@ -358,7 +358,7 @@ at91_pmc_clock_ref(const char *name) { int i; - for (i = 0; i < sizeof(clock_list) / sizeof(clock_list[0]); i++) { + for (i = 0; i < nitems(clock_list); i++) { if (clock_list[i] == NULL) break; if (strcmp(name, clock_list[i]->name) == 0) @@ -484,7 +484,7 @@ static const unsigned int at91_main_cloc 12000000, 12288000, 13560000, 14318180, 14745600, 16000000, 17344700, 18432000, 20000000 }; -#define MAIN_CLOCK_TBL_LEN (sizeof(at91_main_clock_tbl) / sizeof(*at91_main_clock_tbl)) +#define MAIN_CLOCK_TBL_LEN nitems(at91_main_clock_tbl) #endif static unsigned int Modified: head/sys/arm/mv/armadaxp/armadaxp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/arm/mv/armadaxp/armadaxp.c Wed Apr 20 15:45:55 2016 (r298352) @@ -150,13 +150,13 @@ count_l2clk(void) sar_fab_freq = FAB_FREQ_FIELD(sar_reg); /* Check if CPU frequency field has correct value */ - array_size = sizeof(cpu_clock_table) / sizeof(cpu_clock_table[0]); + array_size = nitems(cpu_clock_table); if (sar_cpu_freq >= array_size) panic("Reserved value in cpu frequency configuration field: " "%d", sar_cpu_freq); /* Check if fabric frequency field has correct value */ - array_size = sizeof(freq_conf_table) / sizeof(freq_conf_table[0]); + array_size = nitems(freq_conf_table); if (sar_fab_freq >= array_size) panic("Reserved value in fabric frequency configuration field: " "%d", sar_fab_freq); Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/arm/ti/cpsw/if_cpsw.c Wed Apr 20 15:45:55 2016 (r298352) @@ -470,7 +470,7 @@ cpsw_init_slots(struct cpsw_softc *sc) STAILQ_INIT(&sc->avail); /* Put the slot descriptors onto the global avail list. */ - for (i = 0; i < sizeof(sc->_slots) / sizeof(sc->_slots[0]); i++) { + for (i = 0; i < nitems(sc->_slots); i++) { slot = &sc->_slots[i]; slot->bd_offset = cpsw_cpdma_bd_offset(i); STAILQ_INSERT_TAIL(&sc->avail, slot, next); @@ -480,7 +480,7 @@ cpsw_init_slots(struct cpsw_softc *sc) static int cpsw_add_slots(struct cpsw_softc *sc, struct cpsw_queue *queue, int requested) { - const int max_slots = sizeof(sc->_slots) / sizeof(sc->_slots[0]); + const int max_slots = nitems(sc->_slots); struct cpsw_slot *slot; int i; @@ -917,7 +917,7 @@ cpsw_detach(device_t dev) cpsw_intr_detach(sc); /* Free dmamaps and mbufs */ - for (i = 0; i < sizeof(sc->_slots) / sizeof(sc->_slots[0]); ++i) + for (i = 0; i < nitems(sc->_slots); ++i) cpsw_free_slot(sc, &sc->_slots[i]); /* Free null mbuf. */ Modified: head/sys/arm/xscale/ixp425/ixp425.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/arm/xscale/ixp425/ixp425.c Wed Apr 20 15:45:55 2016 (r298352) @@ -473,7 +473,7 @@ gethwvtrans(uint32_t hwbase, uint32_t si }; int i; - for (i = 0; i < sizeof hwvtrans / sizeof *hwvtrans; i++) { + for (i = 0; i < nitems(hwvtrans); i++) { if (hwbase >= hwvtrans[i].hwbase && hwbase + size <= hwvtrans[i].hwbase + hwvtrans[i].size) return &hwvtrans[i]; Modified: head/sys/mips/mips/db_interface.c ============================================================================== --- head/sys/mips/mips/db_interface.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/mips/mips/db_interface.c Wed Apr 20 15:45:55 2016 (r298352) @@ -117,7 +117,7 @@ struct db_variable db_regs[] = { { "cs", DB_OFFSET(cause), db_frame }, { "pc", DB_OFFSET(pc), db_frame }, }; -struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]); +struct db_variable *db_eregs = db_regs + nitems(db_regs); int (*do_db_log_stack_trace_cmd)(char *); Modified: head/sys/pc98/cbus/gdc.c ============================================================================== --- head/sys/pc98/cbus/gdc.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/pc98/cbus/gdc.c Wed Apr 20 15:45:55 2016 (r298352) @@ -585,7 +585,7 @@ map_gen_mode_num(int type, int color, in }; int i; - for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) { + for (i = 0; i < nitems(mode_map); ++i) { if (mode_map[i].from == mode) return mode_map[i].to; } Modified: head/sys/pc98/cbus/pckbd.c ============================================================================== --- head/sys/pc98/cbus/pckbd.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/pc98/cbus/pckbd.c Wed Apr 20 15:45:55 2016 (r298352) @@ -446,8 +446,7 @@ pckbd_init(int unit, keyboard_t **kbdp, keymap = &default_keymap; accmap = &default_accentmap; fkeymap = default_fkeytab; - fkeymap_size = - sizeof(default_fkeytab)/sizeof(default_fkeytab[0]); + fkeymap_size = nitems(default_fkeytab); state->kbdc = kbdc_open(data[0]); if (state->kbdc == NULL) Modified: head/sys/pc98/cbus/scterm-sck.c ============================================================================== --- head/sys/pc98/cbus/scterm-sck.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/pc98/cbus/scterm-sck.c Wed Apr 20 15:45:55 2016 (r298352) @@ -819,7 +819,7 @@ scterm_scan_esc(scr_stat *scp, term_stat v2 = tcp->param[2]; switch (n) { case 1: /* flags only */ - if (v0 < sizeof(cattrs)/sizeof(cattrs[0])) + if (v0 < nitems(cattrs)) v0 = cattrs[v0]; else /* backward compatibility */ v0 = cattrs[v0 & 0x3]; @@ -884,7 +884,7 @@ scterm_scan_esc(scr_stat *scp, term_stat v0 = 0; /* FALL THROUGH */ case 1: - if (v0 < sizeof(tcattrs)/sizeof(tcattrs[0])) + if (v0 < nitems(tcattrs)) sc_change_cursor_shape(scp, tcattrs[v0], -1, -1); break; Modified: head/sys/powerpc/powerpc/db_trace.c ============================================================================== --- head/sys/powerpc/powerpc/db_trace.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/powerpc/powerpc/db_trace.c Wed Apr 20 15:45:55 2016 (r298352) @@ -106,7 +106,7 @@ struct db_variable db_regs[] = { { "esr", DB_OFFSET(cpu.booke.esr), db_frame }, #endif }; -struct db_variable *db_eregs = db_regs + sizeof (db_regs)/sizeof (db_regs[0]); +struct db_variable *db_eregs = db_regs + nitems(db_regs); /* * register variable handling Modified: head/sys/powerpc/pseries/xics.c ============================================================================== --- head/sys/powerpc/pseries/xics.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/powerpc/pseries/xics.c Wed Apr 20 15:45:55 2016 (r298352) @@ -266,8 +266,8 @@ xicp_enable(device_t dev, u_int irq, u_i sc = device_get_softc(dev); - KASSERT(sc->nintvecs + 1 < sizeof(sc->intvecs)/sizeof(sc->intvecs[0]), - ("Too many XICP interrupts")); + KASSERT(sc->nintvecs + 1 < nitems(sc->intvecs), + ("Too many XICP interrupts")); mtx_lock(&sc->sc_mtx); sc->intvecs[sc->nintvecs].irq = irq; Modified: head/sys/sparc64/sparc64/db_trace.c ============================================================================== --- head/sys/sparc64/sparc64/db_trace.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/sparc64/sparc64/db_trace.c Wed Apr 20 15:45:55 2016 (r298352) @@ -74,7 +74,7 @@ struct db_variable db_regs[] = { { "tpc", DB_OFFSET(tf_tpc), db_frame }, { "tstate", DB_OFFSET(tf_tstate), db_frame }, }; -struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]); +struct db_variable *db_eregs = db_regs + nitems(db_regs); static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/sparc64/sparc64/elf_machdep.c Wed Apr 20 15:45:55 2016 (r298352) @@ -357,8 +357,7 @@ elf_reloc(linker_file_t lf, Elf_Addr rel return (0); if (rtype == R_SPARC_JMP_SLOT || rtype == R_SPARC_COPY || - rtype >= sizeof(reloc_target_bitmask) / - sizeof(*reloc_target_bitmask)) { + rtype >= nitems(reloc_target_bitmask)) { printf("kldload: unexpected relocation type %ld\n", rtype); return (-1); } Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Wed Apr 20 15:31:03 2016 (r298351) +++ head/sys/sparc64/sparc64/trap.c Wed Apr 20 15:45:55 2016 (r298352) @@ -215,8 +215,8 @@ static const int trap_sig[] = { -1, /* kernel stack fault */ }; -CTASSERT(sizeof(trap_msg) / sizeof(*trap_msg) == T_MAX); -CTASSERT(sizeof(trap_sig) / sizeof(*trap_sig) == T_MAX); +CTASSERT(nitems(trap_msg) == T_MAX); +CTASSERT(nitems(trap_sig) == T_MAX); CTASSERT(sizeof(struct trapframe) == 256); From owner-svn-src-all@freebsd.org Wed Apr 20 15:58:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60C05B15B5B for ; Wed, 20 Apr 2016 15:58:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm7.bullet.mail.bf1.yahoo.com (nm7.bullet.mail.bf1.yahoo.com [98.139.212.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E211108E for ; Wed, 20 Apr 2016 15:58:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461167925; bh=FOGUC6KN5n6PB+ZFOyIhLvSq2GpMK5BFFP1fTsFmCzQ=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=HLahhZCDF+s5JvXAFyJ4phBuBt+fI3ossCa+qXPTGIYcq/+7MAsqI6U1K5Gp/EmbNkNnaw93dv8wv20QEoYtQV53c5aMjfHMaX7qolpwDmmBeTNR8xR1njDsd0eypoCmv8+VX6Sk+lvKw9NovNNNKdkhtPBDQasfdeAYsPdKWuN54c6BMkky4x4i6Ldnl6A4oqQGdkw5MUdRS13onMRy2fNtQO472QuvoN4ur2Hk3gdJsW+FAMkDdnkGxAGTsZ9cwHKv8UP9ezXyAz8leahiOCWRan4uJXZKwFTLbB1C2bUevNBRgeRic6ZalSIhoRprXpdjrO8r/Vbdto2srr4Yow== Received: from [98.139.170.178] by nm7.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:58:45 -0000 Received: from [98.139.211.203] by tm21.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:58:45 -0000 Received: from [127.0.0.1] by smtp212.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:58:45 -0000 X-Yahoo-Newman-Id: 99920.90198.bm@smtp212.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: tmyM5AUVM1lmpF9d_WAsBWyMQYdBndipb6q3jAM.mUMIsJ1 pMKWrHigiVr2umHf1nfZ1WEm2KmONRErzEWmFEmQ2tfscTj0p6symYh0.Koo ._qFwLIBvJ3G9oUcVehxbdpYJD_LbwgRlsnSF7adrx5NYpNsrdGrl_E0nauI ScxHkVtFuG82fBsrHi4i.bpOM.k_8tUxdWuqH.gpuI2pf8WROK4QThzz0_jM Dkkhlo0IIkZXKhfV2JQ8n1vjPB_IetHiQq0NK_vPqfDqrWOgeFMGx6nxoG78 GcXuCFROS_mS_A52dG_oacvsBgLR_iag6FyUS451tLmge6pdCiIkCE6UJyXt t_W85afZB.Jk1dlTZioedZsW7IDA3e.ylUiI.JIqyahGisgP8gJjETMBwz09 SrddA492QqbLIK4p2C409cJ1fHoEe9KpyjGYfAtlM8D80J4VpKVVyfwRyS1. iso40j0u2mkESJl0nW0XvLOIyHwtxmXsQPvLndeW7sWax0yJCnyr.AtZmRzN 2IFsm8Y.a7mBvOExK0BDb2tM8yRdvU_p6 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 To: Bruce Evans , Conrad Meyer References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <4114217.PtcV9LDMal@ralph.baldwin.cx> <20160420115844.Y967@besplex.bde.org> <20160421004457.L1073@besplex.bde.org> Cc: araujo@freebsd.org, John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: Date: Wed, 20 Apr 2016 10:58:48 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160421004457.L1073@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 15:58:48 -0000 On 04/20/16 10:15, Bruce Evans wrote: > On Wed, 20 Apr 2016, Conrad Meyer wrote: > >> On Wed, Apr 20, 2016 at 7:33 AM, Pedro Giffuni wrote: >>> One of the things I dislike is that most of the macros are in >>> lowercase. Lowercase would make sense if these were inline functions >>> but inline functions have disadvantages for these use cases. >>> OTOH, if they were uppercase, they would not be very easy on the eyes, >>> which is the current advantage. > > Lower case is correct if nitems is a safe macro. I think it is safe, > because its parameter must be an array and an expression with side > effects can't be an array. > Ahh .. so I guess it's not that bad then :-/. >> You bring up a good point. Obviously nitems() can't be an inline >> function, but roundup2() and friends could. Is there any reason not >> to change them over to inline functions? > > 1. Namespace pollution. Adding nitems() to sys/param.h already broke > anything using that name. > Yes, and there's nothing to do now. > 2. roundup2() and friends can't be inline functions without unportable > complications to make them type-generic. No one ever did this for > the more important imin() family of inline functions. 4.4BSD removed > the MAX() and MIN() macros in the kernel to enforce use of the imin() > family, but this gave type errors and was routed around by restoring > the macros, first in scattered places and then back in sys/param.h. > I see, the imin() stuff is in sys/libkern.h. Looks like a nice use case for coccinelle. Pedro. From owner-svn-src-all@freebsd.org Wed Apr 20 16:03:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53029B16004; Wed, 20 Apr 2016 16:03:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DEC51AA3; Wed, 20 Apr 2016 16:03:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KG3riw094878; Wed, 20 Apr 2016 16:03:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KG3rIv094877; Wed, 20 Apr 2016 16:03:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604201603.u3KG3rIv094877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Apr 2016 16:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298353 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 16:03:54 -0000 Author: pfg Date: Wed Apr 20 16:03:53 2016 New Revision: 298353 URL: https://svnweb.freebsd.org/changeset/base/298353 Log: Minor indentation issue. Modified: head/lib/libc/net/ip6opt.c Modified: head/lib/libc/net/ip6opt.c ============================================================================== --- head/lib/libc/net/ip6opt.c Wed Apr 20 15:45:55 2016 (r298352) +++ head/lib/libc/net/ip6opt.c Wed Apr 20 16:03:53 2016 (r298353) @@ -199,8 +199,7 @@ inet6_option_alloc(struct cmsghdr *cmsg, /* calculate pad length before the option. */ off = bp - (u_char *)eh; - padlen = roundup2(off % multx, multx) - - (off % multx); + padlen = roundup2(off % multx, multx) - (off % multx); padlen += plusy; padlen %= multx; /* keep the pad as short as possible */ /* insert padding */ From owner-svn-src-all@freebsd.org Wed Apr 20 16:19:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF1B1B16673; Wed, 20 Apr 2016 16:19:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A92BB14A1; Wed, 20 Apr 2016 16:19:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KGJj5r098121; Wed, 20 Apr 2016 16:19:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KGJjNd098112; Wed, 20 Apr 2016 16:19:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604201619.u3KGJjNd098112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Apr 2016 16:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298354 - in head/sys: ddb geom/part kern netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 16:19:46 -0000 Author: pfg Date: Wed Apr 20 16:19:44 2016 New Revision: 298354 URL: https://svnweb.freebsd.org/changeset/base/298354 Log: Indentation issues. Contract some lines leftover from r298310. Mea culpa. Modified: head/sys/ddb/db_variables.c head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_ldm.c head/sys/geom/part/g_part_mbr.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/netinet/tcp_syncache.c head/sys/netinet6/in6_proto.c Modified: head/sys/ddb/db_variables.c ============================================================================== --- head/sys/ddb/db_variables.c Wed Apr 20 16:03:53 2016 (r298353) +++ head/sys/ddb/db_variables.c Wed Apr 20 16:19:44 2016 (r298354) @@ -53,8 +53,7 @@ static struct db_variable db_vars[] = { { "db_vnet", NULL, db_var_db_vnet }, #endif }; -static struct db_variable *db_evars = - db_vars + nitems(db_vars); +static struct db_variable *db_evars = db_vars + nitems(db_vars); static int db_find_variable(struct db_variable **varp) Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Wed Apr 20 16:03:53 2016 (r298353) +++ head/sys/geom/part/g_part_bsd.c Wed Apr 20 16:19:44 2016 (r298354) @@ -140,8 +140,7 @@ bsd_parse_type(const char *type, uint8_t *fstype = (u_int)lt; return (0); } - for (i = 0; - i < nitems(bsd_alias_match); i++) { + for (i = 0; i < nitems(bsd_alias_match); i++) { alias = g_part_alias_name(bsd_alias_match[i].alias); if (strcasecmp(type, alias) == 0) { *fstype = bsd_alias_match[i].type; Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Wed Apr 20 16:03:53 2016 (r298353) +++ head/sys/geom/part/g_part_ebr.c Wed Apr 20 16:19:44 2016 (r298354) @@ -188,8 +188,7 @@ ebr_parse_type(const char *type, u_char *dp_typ = (u_char)lt; return (0); } - for (i = 0; - i < nitems(ebr_alias_match); i++) { + for (i = 0; i < nitems(ebr_alias_match); i++) { alias = g_part_alias_name(ebr_alias_match[i].alias); if (strcasecmp(type, alias) == 0) { *dp_typ = ebr_alias_match[i].typ; @@ -603,8 +602,7 @@ g_part_ebr_type(struct g_part_table *bas int i; entry = (struct g_part_ebr_entry *)baseentry; - for (i = 0; - i < nitems(ebr_alias_match); i++) { + for (i = 0; i < nitems(ebr_alias_match); i++) { if (ebr_alias_match[i].typ == entry->ent.dp_typ) return (g_part_alias_name(ebr_alias_match[i].alias)); } Modified: head/sys/geom/part/g_part_ldm.c ============================================================================== --- head/sys/geom/part/g_part_ldm.c Wed Apr 20 16:03:53 2016 (r298353) +++ head/sys/geom/part/g_part_ldm.c Wed Apr 20 16:19:44 2016 (r298354) @@ -453,8 +453,7 @@ ldm_privhdr_check(struct ldm_db *db, str cp2->provider->mediasize / cp2->provider->sectorsize - 1; } else last = pp->mediasize / pp->sectorsize - 1; - for (found = 0, i = is_gpt; - i < nitems(ldm_ph_off); i++) { + for (found = 0, i = is_gpt; i < nitems(ldm_ph_off); i++) { offset = ldm_ph_off[i]; /* * In the GPT case consumer is attached to the LDM metadata @@ -1468,8 +1467,7 @@ g_part_ldm_type(struct g_part_table *bas int i; entry = (struct g_part_ldm_entry *)baseentry; - for (i = 0; - i < nitems(ldm_alias_match); i++) { + for (i = 0; i < nitems(ldm_alias_match); i++) { if (ldm_alias_match[i].typ == entry->type) return (g_part_alias_name(ldm_alias_match[i].alias)); } Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Wed Apr 20 16:03:53 2016 (r298353) +++ head/sys/geom/part/g_part_mbr.c Wed Apr 20 16:19:44 2016 (r298354) @@ -158,8 +158,7 @@ mbr_parse_type(const char *type, u_char *dp_typ = (u_char)lt; return (0); } - for (i = 0; - i < nitems(mbr_alias_match); i++) { + for (i = 0; i < nitems(mbr_alias_match); i++) { alias = g_part_alias_name(mbr_alias_match[i].alias); if (strcasecmp(type, alias) == 0) { *dp_typ = mbr_alias_match[i].typ; @@ -560,8 +559,7 @@ g_part_mbr_type(struct g_part_table *bas int i; entry = (struct g_part_mbr_entry *)baseentry; - for (i = 0; - i < nitems(mbr_alias_match); i++) { + for (i = 0; i < nitems(mbr_alias_match); i++) { if (mbr_alias_match[i].typ == entry->ent.dp_typ) return (g_part_alias_name(mbr_alias_match[i].alias)); } Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Wed Apr 20 16:03:53 2016 (r298353) +++ head/sys/kern/sysv_msg.c Wed Apr 20 16:19:44 2016 (r298354) @@ -1518,8 +1518,7 @@ sys_msgsys(td, uap) if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) return (ENOSYS); - if (uap->which < 0 || - uap->which >= nitems(msgcalls)) + if (uap->which < 0 || uap->which >= nitems(msgcalls)) return (EINVAL); error = (*msgcalls[uap->which])(td, &uap->a2); return (error); Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Wed Apr 20 16:03:53 2016 (r298353) +++ head/sys/kern/sysv_sem.c Wed Apr 20 16:19:44 2016 (r298354) @@ -1400,8 +1400,7 @@ sys_semsys(td, uap) if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) return (ENOSYS); - if (uap->which < 0 || - uap->which >= nitems(semcalls)) + if (uap->which < 0 || uap->which >= nitems(semcalls)) return (EINVAL); error = (*semcalls[uap->which])(td, &uap->a2); return (error); Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Apr 20 16:03:53 2016 (r298353) +++ head/sys/netinet/tcp_syncache.c Wed Apr 20 16:19:44 2016 (r298354) @@ -1896,8 +1896,7 @@ syncookie_generate(struct syncache_head /* Map our computed MSS into the 3-bit index. */ mss = min(tcp_mssopt(&sc->sc_inc), max(sc->sc_peer_mss, V_tcp_minmss)); - for (i = nitems(tcp_sc_msstab) - 1; - tcp_sc_msstab[i] > mss && i > 0; + for (i = nitems(tcp_sc_msstab) - 1; tcp_sc_msstab[i] > mss && i > 0; i--) ; cookie.flags.mss_idx = i; @@ -1909,7 +1908,7 @@ syncookie_generate(struct syncache_head if (sc->sc_flags & SCF_WINSCALE) { wscale = sc->sc_requested_s_scale; for (i = nitems(tcp_sc_wstab) - 1; - tcp_sc_wstab[i] > wscale && i > 0; + tcp_sc_wstab[i] > wscale && i > 0; i--) ; cookie.flags.wscale_idx = i; Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Wed Apr 20 16:03:53 2016 (r298353) +++ head/sys/netinet6/in6_proto.c Wed Apr 20 16:19:44 2016 (r298354) @@ -381,8 +381,7 @@ struct domain inet6domain = { .dom_family = AF_INET6, .dom_name = "internet6", .dom_protosw = (struct protosw *)inet6sw, - .dom_protoswNPROTOSW = (struct protosw *) - &inet6sw[nitems(inet6sw)], + .dom_protoswNPROTOSW = (struct protosw *)&inet6sw[nitems(inet6sw)], #ifdef RADIX_MPATH .dom_rtattach = rn6_mpath_inithead, #else From owner-svn-src-all@freebsd.org Wed Apr 20 17:05:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FD43B15A5D; Wed, 20 Apr 2016 17:05:33 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1230E125B; Wed, 20 Apr 2016 17:05:33 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KH5Wco013077; Wed, 20 Apr 2016 17:05:32 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KH5Wi3013076; Wed, 20 Apr 2016 17:05:32 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201604201705.u3KH5Wi3013076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Wed, 20 Apr 2016 17:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298355 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 17:05:33 -0000 Author: grehan Date: Wed Apr 20 17:05:32 2016 New Revision: 298355 URL: https://svnweb.freebsd.org/changeset/base/298355 Log: Don't use SYSDIR to avoid conflicts with existing usage. Also, use SRCTOP to locate the top of the source tree instead of a relative path. PR: 208856 Modified: head/usr.sbin/bhyve/Makefile Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Wed Apr 20 16:19:44 2016 (r298354) +++ head/usr.sbin/bhyve/Makefile Wed Apr 20 17:05:32 2016 (r298355) @@ -9,7 +9,7 @@ DEBUG_FLAGS= -g -O0 MAN= bhyve.8 -SYSDIR?=${.CURDIR}/../.. +BHYVE_SYSDIR?=${SRCTOP} SRCS= \ atkbdc.c \ @@ -45,7 +45,7 @@ SRCS= \ xmsr.c \ spinup_ap.c -.PATH: ${SYSDIR}/sys/amd64/vmm +.PATH: ${BHYVE_SYSDIR}/sys/amd64/vmm SRCS+= vmm_instruction_emul.c LIBADD= vmmapi md pthread From owner-svn-src-all@freebsd.org Wed Apr 20 17:28:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 458D4B16217; Wed, 20 Apr 2016 17:28:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17F731FBE; Wed, 20 Apr 2016 17:28:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KHSLsu019379; Wed, 20 Apr 2016 17:28:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KHSLkN019378; Wed, 20 Apr 2016 17:28:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604201728.u3KHSLkN019378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Apr 2016 17:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298356 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 17:28:22 -0000 Author: kib Date: Wed Apr 20 17:28:21 2016 New Revision: 298356 URL: https://svnweb.freebsd.org/changeset/base/298356 Log: Arm and arm64 both have fueword() implemented for some time. Correct the comment. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_uio.c Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Wed Apr 20 17:05:32 2016 (r298355) +++ head/sys/kern/subr_uio.c Wed Apr 20 17:28:21 2016 (r298356) @@ -500,8 +500,8 @@ copyout_unmap(struct thread *td, vm_offs /* * XXXKIB The temporal implementation of fue*() functions which do not * handle usermode -1 properly, mixing it with the fault code. Keep - * this until MD code is written. Currently sparc64, mips and arm do - * not have proper implementation. + * this until MD code is written. Currently sparc64 and mips do not + * have proper implementation. */ int From owner-svn-src-all@freebsd.org Wed Apr 20 17:54:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD232B16D5B; Wed, 20 Apr 2016 17:54:54 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EE5F10D8; Wed, 20 Apr 2016 17:54:54 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KHsrrc028200; Wed, 20 Apr 2016 17:54:53 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KHsr9a028199; Wed, 20 Apr 2016 17:54:53 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201604201754.u3KHsr9a028199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 20 Apr 2016 17:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298357 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 17:54:54 -0000 Author: wma Date: Wed Apr 20 17:54:53 2016 New Revision: 298357 URL: https://svnweb.freebsd.org/changeset/base/298357 Log: Fix MFS symbol redefinition with clang 3.8.0 Newest CLANG objcpy uses different name parsing. Modify regexp to match (i.e. avoid substitution of "/" or "-" with "_"). Obtained from: Semihalf Sponsored by: Juniper Networks Reviewed by: hselasky, zbb Differential Revision: https://reviews.freebsd.org/D5873 Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Apr 20 17:28:21 2016 (r298356) +++ head/sys/conf/kern.post.mk Wed Apr 20 17:54:53 2016 (r298357) @@ -364,6 +364,9 @@ embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} --output-target ${EMBEDFS_FORMAT.${MACHINE_ARCH}} \ --binary-architecture ${EMBEDFS_ARCH.${MACHINE_ARCH}} \ ${MFS_IMAGE} ${.TARGET} + # Provide set of two distinct regexp to match for GCC (first three) + # and for CLANG >= 3.8.0 (last three). First three should be removed + # once support for GCC and CLANG < 3.8.0 is abandoned. ${OBJCOPY} \ --rename-section .data=mfs,contents,alloc,load,readonly,data \ --redefine-sym \ @@ -372,6 +375,12 @@ embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} _binary_${MFS_IMAGE:C,[^[:alnum:]],_,g}_start=mfs_root \ --redefine-sym \ _binary_${MFS_IMAGE:C,[^[:alnum:]],_,g}_end=mfs_root_end \ + --redefine-sym \ + _binary_${MFS_IMAGE:C,[^-/[:alnum:]],_,g}_size=__mfs_root_size \ + --redefine-sym \ + _binary_${MFS_IMAGE:C,[^-/[:alnum:]],_,g}_start=mfs_root \ + --redefine-sym \ + _binary_${MFS_IMAGE:C,[^-/[:alnum:]],_,g}_end=mfs_root_end \ ${.TARGET} .endif .endif From owner-svn-src-all@freebsd.org Wed Apr 20 17:58:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFCC5B16E11; Wed, 20 Apr 2016 17:58:14 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 822CC1294; Wed, 20 Apr 2016 17:58:14 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KHwDiL028378; Wed, 20 Apr 2016 17:58:13 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KHwDNq028372; Wed, 20 Apr 2016 17:58:13 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201604201758.u3KHwDNq028372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 20 Apr 2016 17:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298358 - in head: contrib/gdb/gdb gnu/usr.bin/gdb/kgdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 17:58:14 -0000 Author: wma Date: Wed Apr 20 17:58:13 2016 New Revision: 298358 URL: https://svnweb.freebsd.org/changeset/base/298358 Log: Fix KGDB backtrace on ARM Modify trapframe decoding to properly analyze trapframe. Provide method for fixup_pc. It happens, that in some kernel functions, the GDB stack frame decoder cannot determine both func name and frame size. This is because these functions either contain invalid instruction, or their format does not match standard schema. Detect that scenarios and move PC accordingly to jump into known function schema, which GDB is able to parse. Obtained from: Semihalf Sponsored by: Juniper Networks Reviewed by: kib, zbb Differential Revision: https://reviews.freebsd.org/D5976 Modified: head/contrib/gdb/gdb/arm-tdep.c head/contrib/gdb/gdb/frame.c head/contrib/gdb/gdb/frame.h head/gnu/usr.bin/gdb/kgdb/kgdb.h head/gnu/usr.bin/gdb/kgdb/main.c head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Modified: head/contrib/gdb/gdb/arm-tdep.c ============================================================================== --- head/contrib/gdb/gdb/arm-tdep.c Wed Apr 20 17:54:53 2016 (r298357) +++ head/contrib/gdb/gdb/arm-tdep.c Wed Apr 20 17:58:13 2016 (r298358) @@ -678,6 +678,9 @@ arm_scan_prologue (struct frame_info *ne cache->framesize = 0; cache->frameoffset = 0; + if (frame_tdep_pc_fixup) + frame_tdep_pc_fixup(&prev_pc); + /* Check for Thumb prologue. */ if (arm_pc_is_thumb (prev_pc)) { @@ -914,7 +917,6 @@ arm_make_prologue_cache (struct frame_in cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); arm_scan_prologue (next_frame, cache); - unwound_fp = frame_unwind_register_unsigned (next_frame, cache->framereg); if (unwound_fp == 0) return cache; Modified: head/contrib/gdb/gdb/frame.c ============================================================================== --- head/contrib/gdb/gdb/frame.c Wed Apr 20 17:54:53 2016 (r298357) +++ head/contrib/gdb/gdb/frame.c Wed Apr 20 17:58:13 2016 (r298358) @@ -136,6 +136,7 @@ static int frame_debug; static int backtrace_past_main; static unsigned int backtrace_limit = UINT_MAX; +int (*frame_tdep_pc_fixup)(CORE_ADDR *pc); void fprint_frame_id (struct ui_file *file, struct frame_id id) @@ -2010,6 +2011,9 @@ frame_unwind_address_in_block (struct fr /* A draft address. */ CORE_ADDR pc = frame_pc_unwind (next_frame); + if ((frame_tdep_pc_fixup != NULL) && (frame_tdep_pc_fixup(&pc) == 0)) + return pc; + /* If THIS frame is not inner most (i.e., NEXT isn't the sentinel), and NEXT is `normal' (i.e., not a sigtramp, dummy, ....) THIS frame's PC ends up pointing at the instruction fallowing the Modified: head/contrib/gdb/gdb/frame.h ============================================================================== --- head/contrib/gdb/gdb/frame.h Wed Apr 20 17:54:53 2016 (r298357) +++ head/contrib/gdb/gdb/frame.h Wed Apr 20 17:58:13 2016 (r298358) @@ -702,4 +702,6 @@ extern struct frame_info *deprecated_fra code. */ extern int legacy_frame_p (struct gdbarch *gdbarch); +extern int (*frame_tdep_pc_fixup)(CORE_ADDR *pc); + #endif /* !defined (FRAME_H) */ Modified: head/gnu/usr.bin/gdb/kgdb/kgdb.h ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/kgdb.h Wed Apr 20 17:54:53 2016 (r298357) +++ head/gnu/usr.bin/gdb/kgdb/kgdb.h Wed Apr 20 17:58:13 2016 (r298358) @@ -75,4 +75,7 @@ CORE_ADDR kgdb_parse_1(const char *, int #define kgdb_parse(exp) kgdb_parse_1((exp), 0) #define kgdb_parse_quiet(exp) kgdb_parse_1((exp), 1) +extern int (*arm_tdep_pc_fixup)(CORE_ADDR *pc); +int kgdb_trgt_pc_fixup(CORE_ADDR *pc); + #endif /* _KGDB_H_ */ Modified: head/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/main.c Wed Apr 20 17:54:53 2016 (r298357) +++ head/gnu/usr.bin/gdb/kgdb/main.c Wed Apr 20 17:58:13 2016 (r298358) @@ -474,7 +474,9 @@ main(int argc, char *argv[]) add_arg(&args, NULL); init_ui_hook = kgdb_init; - +#if TARGET_CPUARCH == arm + frame_tdep_pc_fixup = kgdb_trgt_pc_fixup; +#endif kgdb_sniffer_kluge = kgdb_trgt_trapframe_sniffer; return (gdb_main(&args)); Modified: head/gnu/usr.bin/gdb/kgdb/trgt_arm.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Wed Apr 20 17:54:53 2016 (r298357) +++ head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Wed Apr 20 17:58:13 2016 (r298358) @@ -96,6 +96,7 @@ kgdb_trgt_new_objfile(struct objfile *ob struct kgdb_frame_cache { CORE_ADDR fp; CORE_ADDR sp; + CORE_ADDR pc; }; static int kgdb_trgt_frame_offset[26] = { @@ -135,6 +136,7 @@ kgdb_trgt_frame_cache(struct frame_info frame_unwind_register(next_frame, ARM_FP_REGNUM, buf); cache->fp = extract_unsigned_integer(buf, register_size(current_gdbarch, ARM_FP_REGNUM)); + cache->pc = frame_func_unwind(next_frame); } return (cache); } @@ -148,7 +150,7 @@ kgdb_trgt_trapframe_this_id(struct frame struct kgdb_frame_cache *cache; cache = kgdb_trgt_frame_cache(next_frame, this_cache); - *this_id = frame_id_build(cache->fp, 0); + *this_id = frame_id_build(cache->sp, cache->pc); } static void @@ -159,7 +161,7 @@ kgdb_trgt_trapframe_prev_register(struct char dummy_valuep[MAX_REGISTER_SIZE]; struct kgdb_frame_cache *cache; int ofs, regsz; - int is_undefined = 0; + CORE_ADDR sp; regsz = register_size(current_gdbarch, regnum); @@ -177,24 +179,12 @@ kgdb_trgt_trapframe_prev_register(struct return; cache = kgdb_trgt_frame_cache(next_frame, this_cache); + sp = cache->sp; - if (is_undef && (regnum == ARM_SP_REGNUM || regnum == ARM_PC_REGNUM)) { - *addrp = cache->sp + offsetof(struct trapframe, tf_spsr); - target_read_memory(*addrp, valuep, regsz); - is_undefined = 1; - ofs = kgdb_trgt_frame_offset[ARM_SP_REGNUM]; - - } - *addrp = cache->sp + ofs; + ofs = kgdb_trgt_frame_offset[regnum]; + *addrp = sp + ofs; *lvalp = lval_memory; target_read_memory(*addrp, valuep, regsz); - - if (is_undefined) { - *addrp = *(unsigned int *)valuep + (regnum == ARM_SP_REGNUM ? - 0 : 8); - target_read_memory(*addrp, valuep, regsz); - - } } static const struct frame_unwind kgdb_trgt_trapframe_unwind = { @@ -233,3 +223,64 @@ kgdb_trgt_trapframe_sniffer(struct frame #endif return (NULL); } + +/* + * This function ensures, that the PC is inside the + * function section which is understood by GDB. + * + * Return 0 when fixup is necessary, -1 otherwise. + */ +int +kgdb_trgt_pc_fixup(CORE_ADDR *pc) +{ +#ifndef CROSS_DEBUGGER + struct minimal_symbol *msymbol; + int valpc; + + /* + * exception_exit and swi_exit are special. These functions + * are artificially injected into the stack to be executed + * as the last entry in calling chain when all functions exit. + * Treat them differently. + */ + msymbol = lookup_minimal_symbol_by_pc(*pc); + if (msymbol != NULL) { + if (strcmp(DEPRECATED_SYMBOL_NAME(msymbol), "exception_exit") == 0) + return (0); + if (strcmp(DEPRECATED_SYMBOL_NAME(msymbol), "swi_exit") == 0) + return (0); + } + + /* + * kdb_enter contains an invalid instruction which is supposed + * to generate a trap. BFD does not understand it and treats + * this part of function as a separate function. Move PC + * two instruction earlier to be inside kdb_enter section. + */ + target_read_memory(*pc - 4, (char*)&valpc, 4); + if (valpc == 0xe7ffffff) { + *pc = *pc - 8; + return (0); + } + + /* + * When the panic/vpanic is the last (noreturn) function, + * the bottom of the calling function looks as below. + * mov lr, pc + * b panic + * Normally, GDB is not able to detect function boundaries, + * so move the PC two instruction earlier where it can deal + * with it. + * Match this pair of instructions: mov lr, pc followed with + * non-linked branch. + */ + if ((valpc & 0xff000000) == 0xea000000) { + target_read_memory(*pc - 8, (char*)&valpc, 4); + if (valpc == 0xe1a0e00f) { + *pc -= 8; + return (0); + } + } +#endif + return (-1); +} From owner-svn-src-all@freebsd.org Wed Apr 20 18:29:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8818B15D68; Wed, 20 Apr 2016 18:29:33 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A461804; Wed, 20 Apr 2016 18:29:33 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KITWc3037370; Wed, 20 Apr 2016 18:29:32 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KITUma037352; Wed, 20 Apr 2016 18:29:30 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604201829.u3KITUma037352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 20 Apr 2016 18:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298359 - in head/sys: dev/ath dev/otus dev/rtwn dev/urtwn net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 18:29:33 -0000 Author: avos Date: Wed Apr 20 18:29:30 2016 New Revision: 298359 URL: https://svnweb.freebsd.org/changeset/base/298359 Log: net80211: replace internal LE_READ_*/LE_WRITE_* macro with system le*dec / le*enc functions. Replace net80211 specific macros with system-wide bytestream encoding/decoding functions: - LE_READ_2 -> le16dec - LE_READ_4 -> le32dec - LE_WRITE_2 -> le16enc - LE_WRITE_4 -> le32enc + drop ieee80211_input.h include, where it was included for these operations only. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D6030 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_beacon.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/otus/if_otus.c head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/if_rtwnreg.h head/sys/dev/urtwn/if_urtwn.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_input.h head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_superg.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/dev/ath/if_ath.c Wed Apr 20 18:29:30 2016 (r298359) @@ -3483,10 +3483,10 @@ ath_update_mcast_hw(struct ath_softc *sc /* calculate XOR of eight 6bit values */ dl = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); - val = LE_READ_4(dl + 0); + val = le32dec(dl + 0); pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; - val = LE_READ_4(dl + 3); + val = le32dec(dl + 3); pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; pos &= 0x3f; Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/dev/ath/if_ath_beacon.c Wed Apr 20 18:29:30 2016 (r298359) @@ -942,11 +942,11 @@ ath_beacon_config(struct ath_softc *sc, ATH_UNLOCK(sc); /* extract tstamp from last beacon and convert to TU */ - nexttbtt = TSF_TO_TU(LE_READ_4(ni->ni_tstamp.data + 4), - LE_READ_4(ni->ni_tstamp.data)); + nexttbtt = TSF_TO_TU(le32dec(ni->ni_tstamp.data + 4), + le32dec(ni->ni_tstamp.data)); - tsf_beacon = ((uint64_t) LE_READ_4(ni->ni_tstamp.data + 4)) << 32; - tsf_beacon |= LE_READ_4(ni->ni_tstamp.data); + tsf_beacon = ((uint64_t) le32dec(ni->ni_tstamp.data + 4)) << 32; + tsf_beacon |= le32dec(ni->ni_tstamp.data); if (ic->ic_opmode == IEEE80211_M_HOSTAP || ic->ic_opmode == IEEE80211_M_MBSS) { Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/dev/ath/if_ath_misc.h Wed Apr 20 18:29:30 2016 (r298359) @@ -39,15 +39,6 @@ * and into something else. */ -/* unaligned little endian access */ -#define LE_READ_2(p) \ - ((u_int16_t) \ - ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8))) -#define LE_READ_4(p) \ - ((u_int32_t) \ - ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8) | \ - (((u_int8_t *)(p))[2] << 16) | (((u_int8_t *)(p))[3] << 24))) - extern int ath_rxbuf; extern int ath_txbuf; extern int ath_txbuf_mgmt; Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/dev/ath/if_ath_rx.c Wed Apr 20 18:29:30 2016 (r298359) @@ -344,8 +344,8 @@ ath_recv_mgmt(struct ieee80211_node *ni, uint64_t tsf_beacon_target; int tsf_intval; - tsf_beacon_old = ((uint64_t) LE_READ_4(ni->ni_tstamp.data + 4)) << 32; - tsf_beacon_old |= LE_READ_4(ni->ni_tstamp.data); + tsf_beacon_old = ((uint64_t) le32dec(ni->ni_tstamp.data + 4)) << 32; + tsf_beacon_old |= le32dec(ni->ni_tstamp.data); #define TU_TO_TSF(_tu) (((u_int64_t)(_tu)) << 10) tsf_intval = 1; @@ -378,8 +378,8 @@ ath_recv_mgmt(struct ieee80211_node *ni, ATH_RSSI_LPF(sc->sc_halstats.ns_avgbrssi, rssi); - tsf_beacon = ((uint64_t) LE_READ_4(ni->ni_tstamp.data + 4)) << 32; - tsf_beacon |= LE_READ_4(ni->ni_tstamp.data); + tsf_beacon = ((uint64_t) le32dec(ni->ni_tstamp.data + 4)) << 32; + tsf_beacon |= le32dec(ni->ni_tstamp.data); nexttbtt = ath_hal_getnexttbtt(sc->sc_ah); Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/dev/otus/if_otus.c Wed Apr 20 18:29:30 2016 (r298359) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef IEEE80211_SUPPORT_SUPERG #include #endif @@ -2307,7 +2306,7 @@ otus_set_multi(struct otus_softc *sc) uint32_t val; dl = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); - val = LE_READ_4(dl + 4); + val = le32dec(dl + 4); /* Get address byte 5 */ val = val & 0x0000ff00; val = val >> 8; Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/dev/rtwn/if_rtwn.c Wed Apr 20 18:29:30 2016 (r298359) @@ -1265,8 +1265,8 @@ rtwn_newstate(struct ieee80211vap *vap, rtwn_write_4(sc, R92C_CR, reg); /* Set BSSID. */ - rtwn_write_4(sc, R92C_BSSID + 0, LE_READ_4(&ni->ni_bssid[0])); - rtwn_write_4(sc, R92C_BSSID + 4, LE_READ_2(&ni->ni_bssid[4])); + rtwn_write_4(sc, R92C_BSSID + 0, le32dec(&ni->ni_bssid[0])); + rtwn_write_4(sc, R92C_BSSID + 4, le16dec(&ni->ni_bssid[4])); if (ic->ic_curmode == IEEE80211_MODE_11B) rtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 0); Modified: head/sys/dev/rtwn/if_rtwnreg.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnreg.h Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/dev/rtwn/if_rtwnreg.h Wed Apr 20 18:29:30 2016 (r298359) @@ -895,10 +895,6 @@ #define R92C_RAID_11B 6 -/* Macros to access unaligned little-endian memory. */ -#define LE_READ_2(x) ((x)[0] | (x)[1] << 8) -#define LE_READ_4(x) ((x)[0] | (x)[1] << 8 | (x)[2] << 16 | (x)[3] << 24) - /* * Macros to access subfields in registers. */ Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/dev/urtwn/if_urtwn.c Wed Apr 20 18:29:30 2016 (r298359) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -2266,20 +2265,20 @@ urtwn_key_set_cb(struct urtwn_softc *sc, /* Write key. */ for (i = 0; i < 4; i++) { error = urtwn_cam_write(sc, R92C_CAM_KEY(k->wk_keyix, i), - LE_READ_4(&k->wk_key[i * 4])); + le32dec(&k->wk_key[i * 4])); if (error != 0) goto fail; } /* Write CTL0 last since that will validate the CAM entry. */ error = urtwn_cam_write(sc, R92C_CAM_CTL1(k->wk_keyix), - LE_READ_4(&k->wk_macaddr[2])); + le32dec(&k->wk_macaddr[2])); if (error != 0) goto fail; error = urtwn_cam_write(sc, R92C_CAM_CTL0(k->wk_keyix), SM(R92C_CAM_ALGO, algo) | SM(R92C_CAM_KEYID, keyid) | - SM(R92C_CAM_MACLO, LE_READ_2(&k->wk_macaddr[0])) | + SM(R92C_CAM_MACLO, le16dec(&k->wk_macaddr[0])) | R92C_CAM_VALID); if (error != 0) goto fail; @@ -2579,8 +2578,8 @@ urtwn_newstate(struct ieee80211vap *vap, urtwn_set_mode(sc, mode); /* Set BSSID. */ - urtwn_write_4(sc, R92C_BSSID + 0, LE_READ_4(&ni->ni_bssid[0])); - urtwn_write_4(sc, R92C_BSSID + 4, LE_READ_2(&ni->ni_bssid[4])); + urtwn_write_4(sc, R92C_BSSID + 0, le32dec(&ni->ni_bssid[0])); + urtwn_write_4(sc, R92C_BSSID + 4, le16dec(&ni->ni_bssid[4])); if (ic->ic_curmode == IEEE80211_MODE_11B) urtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 0); Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_hostap.c Wed Apr 20 18:29:30 2016 (r298359) @@ -1165,7 +1165,7 @@ static int wpa_cipher(const uint8_t *sel, uint8_t *keylen) { #define WPA_SEL(x) (((x)<<24)|WPA_OUI) - uint32_t w = LE_READ_4(sel); + uint32_t w = le32dec(sel); switch (w) { case WPA_SEL(WPA_CSE_NULL): @@ -1195,7 +1195,7 @@ static int wpa_keymgmt(const uint8_t *sel) { #define WPA_SEL(x) (((x)<<24)|WPA_OUI) - uint32_t w = LE_READ_4(sel); + uint32_t w = le32dec(sel); switch (w) { case WPA_SEL(WPA_ASE_8021X_UNSPEC): @@ -1242,7 +1242,7 @@ ieee80211_parse_wpa(struct ieee80211vap } frm += 6, len -= 4; /* NB: len is payload only */ /* NB: iswpaoui already validated the OUI and type */ - w = LE_READ_2(frm); + w = le16dec(frm); if (w != WPA_VERSION) { IEEE80211_DISCARD_IE(vap, IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, @@ -1258,7 +1258,7 @@ ieee80211_parse_wpa(struct ieee80211vap frm += 4, len -= 4; /* unicast ciphers */ - n = LE_READ_2(frm); + n = le16dec(frm); frm += 2, len -= 2; if (len < n*4+2) { IEEE80211_DISCARD_IE(vap, @@ -1278,7 +1278,7 @@ ieee80211_parse_wpa(struct ieee80211vap rsn->rsn_ucastcipher = IEEE80211_CIPHER_AES_CCM; /* key management algorithms */ - n = LE_READ_2(frm); + n = le16dec(frm); frm += 2, len -= 2; if (len < n*4) { IEEE80211_DISCARD_IE(vap, @@ -1298,7 +1298,7 @@ ieee80211_parse_wpa(struct ieee80211vap rsn->rsn_keymgmt = WPA_ASE_8021X_PSK; if (len > 2) /* optional capabilities */ - rsn->rsn_caps = LE_READ_2(frm); + rsn->rsn_caps = le16dec(frm); return 0; } @@ -1312,7 +1312,7 @@ static int rsn_cipher(const uint8_t *sel, uint8_t *keylen) { #define RSN_SEL(x) (((x)<<24)|RSN_OUI) - uint32_t w = LE_READ_4(sel); + uint32_t w = le32dec(sel); switch (w) { case RSN_SEL(RSN_CSE_NULL): @@ -1344,7 +1344,7 @@ static int rsn_keymgmt(const uint8_t *sel) { #define RSN_SEL(x) (((x)<<24)|RSN_OUI) - uint32_t w = LE_READ_4(sel); + uint32_t w = le32dec(sel); switch (w) { case RSN_SEL(RSN_ASE_8021X_UNSPEC): @@ -1389,7 +1389,7 @@ ieee80211_parse_rsn(struct ieee80211vap return IEEE80211_REASON_IE_INVALID; } frm += 2; - w = LE_READ_2(frm); + w = le16dec(frm); if (w != RSN_VERSION) { IEEE80211_DISCARD_IE(vap, IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, @@ -1405,7 +1405,7 @@ ieee80211_parse_rsn(struct ieee80211vap frm += 4, len -= 4; /* unicast ciphers */ - n = LE_READ_2(frm); + n = le16dec(frm); frm += 2, len -= 2; if (len < n*4+2) { IEEE80211_DISCARD_IE(vap, @@ -1425,7 +1425,7 @@ ieee80211_parse_rsn(struct ieee80211vap rsn->rsn_ucastcipher = IEEE80211_CIPHER_AES_CCM; /* key management algorithms */ - n = LE_READ_2(frm); + n = le16dec(frm); frm += 2, len -= 2; if (len < n*4) { IEEE80211_DISCARD_IE(vap, @@ -1446,7 +1446,7 @@ ieee80211_parse_rsn(struct ieee80211vap /* optional RSN capabilities */ if (len > 2) - rsn->rsn_caps = LE_READ_2(frm); + rsn->rsn_caps = le16dec(frm); /* XXXPMKID */ return 0; Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_ht.c Wed Apr 20 18:29:30 2016 (r298359) @@ -1424,7 +1424,7 @@ ieee80211_parse_htcap(struct ieee80211_n } else ni->ni_flags &= ~IEEE80211_NODE_HTCOMPAT; - ni->ni_htcap = LE_READ_2(ie + + ni->ni_htcap = le16dec(ie + __offsetof(struct ieee80211_ie_htcap, hc_cap)); ni->ni_htparam = ie[__offsetof(struct ieee80211_ie_htcap, hc_param)]; } @@ -1437,9 +1437,9 @@ htinfo_parse(struct ieee80211_node *ni, ni->ni_htctlchan = htinfo->hi_ctrlchannel; ni->ni_ht2ndchan = SM(htinfo->hi_byte1, IEEE80211_HTINFO_2NDCHAN); - w = LE_READ_2(&htinfo->hi_byte2); + w = le16dec(&htinfo->hi_byte2); ni->ni_htopmode = SM(w, IEEE80211_HTINFO_OPMODE); - w = LE_READ_2(&htinfo->hi_byte45); + w = le16dec(&htinfo->hi_byte45); ni->ni_htstbc = SM(w, IEEE80211_HTINFO_BASIC_STBCMCS); } @@ -1932,9 +1932,9 @@ ht_recv_action_ba_addba_request(struct i int tid; dialogtoken = frm[2]; - baparamset = LE_READ_2(frm+3); - batimeout = LE_READ_2(frm+5); - baseqctl = LE_READ_2(frm+7); + baparamset = le16dec(frm+3); + batimeout = le16dec(frm+5); + baseqctl = le16dec(frm+7); tid = MS(baparamset, IEEE80211_BAPS_TID); @@ -1997,12 +1997,12 @@ ht_recv_action_ba_addba_response(struct int tid, bufsiz; dialogtoken = frm[2]; - code = LE_READ_2(frm+3); - baparamset = LE_READ_2(frm+5); + code = le16dec(frm+3); + baparamset = le16dec(frm+5); tid = MS(baparamset, IEEE80211_BAPS_TID); bufsiz = MS(baparamset, IEEE80211_BAPS_BUFSIZ); policy = MS(baparamset, IEEE80211_BAPS_POLICY); - batimeout = LE_READ_2(frm+7); + batimeout = le16dec(frm+7); tap = &ni->ni_tx_ampdu[tid]; if ((tap->txa_flags & IEEE80211_AGGR_XCHGPEND) == 0) { @@ -2069,8 +2069,8 @@ ht_recv_action_ba_delba(struct ieee80211 uint16_t baparamset, code; int tid; - baparamset = LE_READ_2(frm+2); - code = LE_READ_2(frm+4); + baparamset = le16dec(frm+2); + code = le16dec(frm+4); tid = MS(baparamset, IEEE80211_DELBAPS_TID); Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_hwmp.c Wed Apr 20 18:29:30 2016 (r298359) @@ -118,18 +118,6 @@ static void hwmp_peerdown(struct ieee802 static struct timeval ieee80211_hwmp_preqminint = { 0, 100000 }; static struct timeval ieee80211_hwmp_perrminint = { 0, 100000 }; -/* unalligned little endian access */ -#define LE_WRITE_2(p, v) do { \ - ((uint8_t *)(p))[0] = (v) & 0xff; \ - ((uint8_t *)(p))[1] = ((v) >> 8) & 0xff; \ -} while (0) -#define LE_WRITE_4(p, v) do { \ - ((uint8_t *)(p))[0] = (v) & 0xff; \ - ((uint8_t *)(p))[1] = ((v) >> 8) & 0xff; \ - ((uint8_t *)(p))[2] = ((v) >> 16) & 0xff; \ - ((uint8_t *)(p))[3] = ((v) >> 24) & 0xff; \ -} while (0) - /* NB: the Target Address set in a Proactive PREQ is the broadcast address. */ static const uint8_t broadcastaddr[IEEE80211_ADDR_LEN] = @@ -440,18 +428,18 @@ hwmp_recv_action_meshpath(struct ieee802 preq->preq_flags = *iefrm_t++; preq->preq_hopcount = *iefrm_t++; preq->preq_ttl = *iefrm_t++; - preq->preq_id = LE_READ_4(iefrm_t); iefrm_t += 4; + preq->preq_id = le32dec(iefrm_t); iefrm_t += 4; IEEE80211_ADDR_COPY(preq->preq_origaddr, iefrm_t); iefrm_t += 6; - preq->preq_origseq = LE_READ_4(iefrm_t); iefrm_t += 4; + preq->preq_origseq = le32dec(iefrm_t); iefrm_t += 4; /* NB: may have Originator Proxied Address */ if (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AE) { IEEE80211_ADDR_COPY( preq->preq_orig_ext_addr, iefrm_t); iefrm_t += 6; } - preq->preq_lifetime = LE_READ_4(iefrm_t); iefrm_t += 4; - preq->preq_metric = LE_READ_4(iefrm_t); iefrm_t += 4; + preq->preq_lifetime = le32dec(iefrm_t); iefrm_t += 4; + preq->preq_metric = le32dec(iefrm_t); iefrm_t += 4; preq->preq_tcount = *iefrm_t++; for (i = 0; i < preq->preq_tcount; i++) { @@ -460,7 +448,7 @@ hwmp_recv_action_meshpath(struct ieee802 preq->preq_targets[i].target_addr, iefrm_t); iefrm_t += 6; preq->preq_targets[i].target_seq = - LE_READ_4(iefrm_t); + le32dec(iefrm_t); iefrm_t += 4; } @@ -489,18 +477,18 @@ hwmp_recv_action_meshpath(struct ieee802 prep->prep_ttl = *iefrm_t++; IEEE80211_ADDR_COPY(prep->prep_targetaddr, iefrm_t); iefrm_t += 6; - prep->prep_targetseq = LE_READ_4(iefrm_t); iefrm_t += 4; + prep->prep_targetseq = le32dec(iefrm_t); iefrm_t += 4; /* NB: May have Target Proxied Address */ if (prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE) { IEEE80211_ADDR_COPY( prep->prep_target_ext_addr, iefrm_t); iefrm_t += 6; } - prep->prep_lifetime = LE_READ_4(iefrm_t); iefrm_t += 4; - prep->prep_metric = LE_READ_4(iefrm_t); iefrm_t += 4; + prep->prep_lifetime = le32dec(iefrm_t); iefrm_t += 4; + prep->prep_metric = le32dec(iefrm_t); iefrm_t += 4; IEEE80211_ADDR_COPY(prep->prep_origaddr, iefrm_t); iefrm_t += 6; - prep->prep_origseq = LE_READ_4(iefrm_t); iefrm_t += 4; + prep->prep_origseq = le32dec(iefrm_t); iefrm_t += 4; hwmp_recv_prep(vap, ni, wh, prep); IEEE80211_FREE(prep, M_80211_MESH_PREP); @@ -533,7 +521,7 @@ hwmp_recv_action_meshpath(struct ieee802 IEEE80211_ADDR_COPY( perr->perr_dests[i].dest_addr, iefrm_t); iefrm_t += 6; - perr->perr_dests[i].dest_seq = LE_READ_4(iefrm_t); + perr->perr_dests[i].dest_seq = le32dec(iefrm_t); iefrm_t += 4; /* NB: May have Target Proxied Address */ if (perr->perr_dests[i].dest_flags & @@ -544,7 +532,7 @@ hwmp_recv_action_meshpath(struct ieee802 iefrm_t += 6; } perr->perr_dests[i].dest_rcode = - LE_READ_2(iefrm_t); + le16dec(iefrm_t); iefrm_t += 2; } @@ -566,9 +554,9 @@ hwmp_recv_action_meshpath(struct ieee802 return 1; } memcpy(&rann, mrann, sizeof(rann)); - rann.rann_seq = LE_READ_4(&mrann->rann_seq); - rann.rann_interval = LE_READ_4(&mrann->rann_interval); - rann.rann_metric = LE_READ_4(&mrann->rann_metric); + rann.rann_seq = le32dec(&mrann->rann_seq); + rann.rann_interval = le32dec(&mrann->rann_interval); + rann.rann_metric = le32dec(&mrann->rann_metric); hwmp_recv_rann(vap, ni, wh, &rann); found++; break; @@ -682,12 +670,11 @@ hwmp_send_action(struct ieee80211vap *va } #define ADDSHORT(frm, v) do { \ - frm[0] = (v) & 0xff; \ - frm[1] = (v) >> 8; \ + le16enc(frm, v); \ frm += 2; \ } while (0) #define ADDWORD(frm, v) do { \ - LE_WRITE_4(frm, v); \ + le32enc(frm, v); \ frm += 4; \ } while (0) /* Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_input.c Wed Apr 20 18:29:30 2016 (r298359) @@ -549,7 +549,7 @@ ieee80211_parse_beacon(struct ieee80211_ break; case IEEE80211_ELEMID_FHPARMS: if (ic->ic_phytype == IEEE80211_T_FH) { - scan->fhdwell = LE_READ_2(&frm[2]); + scan->fhdwell = le16dec(&frm[2]); scan->chan = IEEE80211_FH_CHAN(frm[4], frm[5]); scan->fhindex = frm[6]; } Modified: head/sys/net80211/ieee80211_input.h ============================================================================== --- head/sys/net80211/ieee80211_input.h Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_input.h Wed Apr 20 18:29:30 2016 (r298359) @@ -80,70 +80,58 @@ void ieee80211_ssid_mismatch(struct ieee } while (0) #endif /* !IEEE80211_DEBUG */ -/* unalligned little endian access */ -#define LE_READ_2(p) \ - ((uint16_t) \ - ((((const uint8_t *)(p))[0] ) | \ - (((const uint8_t *)(p))[1] << 8))) -#define LE_READ_4(p) \ - ((uint32_t) \ - ((((const uint8_t *)(p))[0] ) | \ - (((const uint8_t *)(p))[1] << 8) | \ - (((const uint8_t *)(p))[2] << 16) | \ - (((const uint8_t *)(p))[3] << 24))) +#include /* For le16toh() / le32dec() */ static __inline int iswpaoui(const uint8_t *frm) { - return frm[1] > 3 && LE_READ_4(frm+2) == ((WPA_OUI_TYPE<<24)|WPA_OUI); + return frm[1] > 3 && le32dec(frm+2) == ((WPA_OUI_TYPE<<24)|WPA_OUI); } static __inline int iswmeoui(const uint8_t *frm) { - return frm[1] > 3 && LE_READ_4(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI); + return frm[1] > 3 && le32dec(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI); } static __inline int iswmeparam(const uint8_t *frm) { - return frm[1] > 5 && LE_READ_4(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI) && + return frm[1] > 5 && le32dec(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI) && frm[6] == WME_PARAM_OUI_SUBTYPE; } static __inline int iswmeinfo(const uint8_t *frm) { - return frm[1] > 5 && LE_READ_4(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI) && + return frm[1] > 5 && le32dec(frm+2) == ((WME_OUI_TYPE<<24)|WME_OUI) && frm[6] == WME_INFO_OUI_SUBTYPE; } static __inline int isatherosoui(const uint8_t *frm) { - return frm[1] > 3 && LE_READ_4(frm+2) == ((ATH_OUI_TYPE<<24)|ATH_OUI); + return frm[1] > 3 && le32dec(frm+2) == ((ATH_OUI_TYPE<<24)|ATH_OUI); } static __inline int istdmaoui(const uint8_t *frm) { - return frm[1] > 3 && LE_READ_4(frm+2) == ((TDMA_OUI_TYPE<<24)|TDMA_OUI); + return frm[1] > 3 && le32dec(frm+2) == ((TDMA_OUI_TYPE<<24)|TDMA_OUI); } static __inline int ishtcapoui(const uint8_t *frm) { - return frm[1] > 3 && LE_READ_4(frm+2) == ((BCM_OUI_HTCAP<<24)|BCM_OUI); + return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTCAP<<24)|BCM_OUI); } static __inline int ishtinfooui(const uint8_t *frm) { - return frm[1] > 3 && LE_READ_4(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI); + return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI); } -#include /* For le16toh() */ - /* * Check the current frame sequence number against the current TID * state and return whether it's in sequence or should be dropped. Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_mesh.c Wed Apr 20 18:29:30 2016 (r298359) @@ -1710,7 +1710,7 @@ mesh_input(struct ieee80211_node *ni, st } /* XXX: are we sure there is no reallocating after m_pullup? */ - seq = LE_READ_4(mc->mc_seq); + seq = le32dec(mc->mc_seq); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) addr = wh->i_addr3; else if (ae == IEEE80211_MESH_AE_01) @@ -2135,12 +2135,12 @@ mesh_parse_meshpeering_action(struct iee mpie = (const struct ieee80211_meshpeer_ie *) frm; memset(mp, 0, sizeof(*mp)); mp->peer_len = mpie->peer_len; - mp->peer_proto = LE_READ_2(&mpie->peer_proto); - mp->peer_llinkid = LE_READ_2(&mpie->peer_llinkid); + mp->peer_proto = le16dec(&mpie->peer_proto); + mp->peer_llinkid = le16dec(&mpie->peer_llinkid); switch (subtype) { case IEEE80211_ACTION_MESHPEERING_CONFIRM: mp->peer_linkid = - LE_READ_2(&mpie->peer_linkid); + le16dec(&mpie->peer_linkid); break; case IEEE80211_ACTION_MESHPEERING_CLOSE: /* NB: peer link ID is optional */ @@ -2148,12 +2148,12 @@ mesh_parse_meshpeering_action(struct iee (IEEE80211_MPM_BASE_SZ + 2)) { mp->peer_linkid = 0; mp->peer_rcode = - LE_READ_2(&mpie->peer_linkid); + le16dec(&mpie->peer_linkid); } else { mp->peer_linkid = - LE_READ_2(&mpie->peer_linkid); + le16dec(&mpie->peer_linkid); mp->peer_rcode = - LE_READ_2(&mpie->peer_rcode); + le16dec(&mpie->peer_rcode); } break; } @@ -2550,8 +2550,8 @@ mesh_parse_meshgate_action(struct ieee80 ie->gann_hopcount = gannie->gann_hopcount; ie->gann_ttl = gannie->gann_ttl; IEEE80211_ADDR_COPY(ie->gann_addr, gannie->gann_addr); - ie->gann_seq = LE_READ_4(&gannie->gann_seq); - ie->gann_interval = LE_READ_2(&gannie->gann_interval); + ie->gann_seq = le32dec(&gannie->gann_seq); + ie->gann_interval = le16dec(&gannie->gann_interval); break; } frm += frm[1] + 2; Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_output.c Wed Apr 20 18:29:30 2016 (r298359) @@ -77,18 +77,6 @@ __FBSDID("$FreeBSD$"); #define ETHER_HEADER_COPY(dst, src) \ memcpy(dst, src, sizeof(struct ether_header)) -/* unalligned little endian access */ -#define LE_WRITE_2(p, v) do { \ - ((uint8_t *)(p))[0] = (v) & 0xff; \ - ((uint8_t *)(p))[1] = ((v) >> 8) & 0xff; \ -} while (0) -#define LE_WRITE_4(p, v) do { \ - ((uint8_t *)(p))[0] = (v) & 0xff; \ - ((uint8_t *)(p))[1] = ((v) >> 8) & 0xff; \ - ((uint8_t *)(p))[2] = ((v) >> 16) & 0xff; \ - ((uint8_t *)(p))[3] = ((v) >> 24) & 0xff; \ -} while (0) - static int ieee80211_fragment(struct ieee80211vap *, struct mbuf *, u_int hdrsize, u_int ciphdrsize, u_int mtu); static void ieee80211_tx_mgt_cb(struct ieee80211_node *, void *, int); @@ -1518,7 +1506,7 @@ ieee80211_encap(struct ieee80211vap *vap } mc->mc_ttl = ms->ms_ttl; ms->ms_seq++; - LE_WRITE_4(mc->mc_seq, ms->ms_seq); + le32enc(mc->mc_seq, ms->ms_seq); break; #endif case IEEE80211_M_WDS: /* NB: is4addr should always be true */ @@ -1843,7 +1831,7 @@ static uint8_t * ieee80211_add_cfparms(uint8_t *frm, struct ieee80211com *ic) { #define ADDSHORT(frm, v) do { \ - LE_WRITE_2(frm, v); \ + le16enc(frm, v); \ frm += 2; \ } while (0) *frm++ = IEEE80211_ELEMID_CFPARMS; @@ -1898,7 +1886,7 @@ ieee80211_add_wme_param(uint8_t *frm, st { #define SM(_v, _f) (((_v) << _f##_S) & _f) #define ADDSHORT(frm, v) do { \ - LE_WRITE_2(frm, v); \ + le16enc(frm, v); \ frm += 2; \ } while (0) /* NB: this works 'cuz a param has an info at the front */ Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_scan_sta.c Wed Apr 20 18:29:30 2016 (r298359) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -785,7 +786,7 @@ maxrate(const struct ieee80211_scan_entr } else for (i = 31; i >= 0 && isclr(htcap->hc_mcsset, i); i--); if (i >= 0) { - caps = LE_READ_2(&htcap->hc_cap); + caps = le16dec(&htcap->hc_cap); if ((caps & IEEE80211_HTCAP_CHWIDTH40) && (caps & IEEE80211_HTCAP_SHORTGI40)) rmax = ieee80211_htrates[i].ht40_rate_400ns; Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_sta.c Wed Apr 20 18:29:30 2016 (r298359) @@ -1120,7 +1120,7 @@ ieee80211_parse_wmeparams(struct ieee802 wmep->wmep_aifsn = MS(frm[0], WME_PARAM_AIFSN); wmep->wmep_logcwmin = MS(frm[1], WME_PARAM_LOGCWMIN); wmep->wmep_logcwmax = MS(frm[1], WME_PARAM_LOGCWMAX); - wmep->wmep_txopLimit = LE_READ_2(frm+2); + wmep->wmep_txopLimit = le16dec(frm+2); frm += 4; } wme->wme_wmeChanParams.cap_info = qosinfo; Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Wed Apr 20 17:58:13 2016 (r298358) +++ head/sys/net80211/ieee80211_superg.c Wed Apr 20 18:29:30 2016 (r298359) @@ -195,7 +195,7 @@ ieee80211_parse_ath(struct ieee80211_nod (const struct ieee80211_ath_ie *) ie; ni->ni_ath_flags = ath->ath_capability; - ni->ni_ath_defkeyix = LE_READ_2(&ath->ath_defkeyix); + ni->ni_ath_defkeyix = le16dec(&ath->ath_defkeyix); } int @@ -216,7 +216,7 @@ ieee80211_parse_athparams(struct ieee802 } ath = (const struct ieee80211_ath_ie *)frm; capschanged = (ni->ni_ath_flags != ath->ath_capability); - defkeyix = LE_READ_2(ath->ath_defkeyix); + defkeyix = le16dec(ath->ath_defkeyix); if (capschanged || defkeyix != ni->ni_ath_defkeyix) { ni->ni_ath_flags = ath->ath_capability; ni->ni_ath_defkeyix = defkeyix; From owner-svn-src-all@freebsd.org Wed Apr 20 18:45:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E69A5B16440; Wed, 20 Apr 2016 18:45:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1E54132D; Wed, 20 Apr 2016 18:45:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 81E9CB98D; Wed, 20 Apr 2016 14:45:01 -0400 (EDT) From: John Baldwin To: Bruce Evans Cc: araujo@freebsd.org, "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 Date: Wed, 20 Apr 2016 10:38:06 -0700 Message-ID: <17068472.zUDTmEYeVg@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160420115844.Y967@besplex.bde.org> References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <20160420115844.Y967@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 20 Apr 2016 14:45:01 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 18:45:03 -0000 On Wednesday, April 20, 2016 01:06:38 PM Bruce Evans wrote: > On Wed, 20 Apr 2016, Marcelo Araujo wrote: > > > 2016-04-20 0:16 GMT+08:00 John Baldwin : > > > >> On Tuesday, April 19, 2016 04:46:13 AM Marcelo Araujo wrote: > >>> Author: araujo > >>> Date: Tue Apr 19 04:46:13 2016 > >>> New Revision: 298247 > >>> URL: https://svnweb.freebsd.org/changeset/base/298247 > >>> > >>> Log: > >>> Remove redundant parenthesis. > >>> > >>> Submitted by: pfg > >>> MFC after: 2 weeks. > > I don't realling like churnging to the nonstandard nitems(). Use > of the nonstandard is bad enough. I think it's not that bad from a readability standpoint. Other languages have fairly concise syntax for 'for-each' loops and this provides a closer variant of that for statically sized arrays. TAILQ_FOREACH() is still nicer of course. One could imagine doing some sort of ARRAY_FOREACH() that was: #define ARRAY_FOREACH(p, array) \ for (size_t __i = 0, (p) = &(array)[0]; __i < nitems((array)); __i++, (p)++) (This requires C99 to handle __i) Perhaps better is this: #define ARRAY_FOREACH(p, array) \ for ((p) = &(array)[0]; (p) < &(array)[nitems((array))]; (p)++) (No need for __i) > >> For this case, it might be better to remove numentries and use > >> nitems() directly in the one place it is used. I would probably > >> even do this as a for-loop: > >> > >> struct part_type *ptr; > >> int counter; > >> > >> for (counter = 0, ptr = part_types; counter < nitems(part_types); > >> counter++, ptr++) { > >> if (ptr->type == (type & 0x7f)) > >> return (ptr->name); > >> } > >> return ("unknown"); > >> > >> If you renamed 'counter' to 'i' you could probably fit it all on one line. > > 'ptr' is also not a usefully verbose name. If its name is longer than that > of 'p', then it could more usefully give a hint of the pointer type (pp or > ptp). > > nitimems() is not even easy to use. It is of course undocumented, but > if we look at its internals we can see that its type is the binary > promotion of size_t. This type is normally size_t again, thus normally > unsigned. Broken compilers might warn about this. Only broken ones > would, since it is clear that 'counter' always has a small non-negative > value. Such warnings are often "fixed" by unimproving the code using > casts. Here the old code uses a temporary variable of type int. > Consistently broken compilers might warn about assigning the unsigned > expression to this signed variable. Yes, I end up using 'unsigned' with it often due to compile warnings for sign mismatches on comparison. > Churnging too much (also remove excessive parentheses and braces) gives: > > size_t i; /* XXX: I don't like unsigned types, but... */ > > for (i = 0; i < nitems(part_types); i++) > if (part_types[i].type == type & 0x7f) > return (part_types[i].name); > return ("unknown"); This would work for me (unless folks actually like the ARRAY_FOREACH() idea). -- John Baldwin From owner-svn-src-all@freebsd.org Wed Apr 20 18:48:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B90F4B165A9; Wed, 20 Apr 2016 18:48:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3111746; Wed, 20 Apr 2016 18:48:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KImdE7043810; Wed, 20 Apr 2016 18:48:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KImdHY043809; Wed, 20 Apr 2016 18:48:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604201848.u3KImdHY043809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 20 Apr 2016 18:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298360 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 18:48:40 -0000 Author: avos Date: Wed Apr 20 18:48:39 2016 New Revision: 298360 URL: https://svnweb.freebsd.org/changeset/base/298360 Log: net80211 (trivial, noop): remove duplicate check from hostap_recv_mgmt() Differential Revision: https://reviews.freebsd.org/D5483 Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Wed Apr 20 18:29:30 2016 (r298359) +++ head/sys/net80211/ieee80211_hostap.c Wed Apr 20 18:48:39 2016 (r298360) @@ -1677,18 +1677,19 @@ hostap_recv_mgmt(struct ieee80211_node * efrm = mtod(m0, uint8_t *) + m0->m_len; switch (subtype) { case IEEE80211_FC0_SUBTYPE_PROBE_RESP: - case IEEE80211_FC0_SUBTYPE_BEACON: { - struct ieee80211_scanparams scan; /* * We process beacon/probe response frames when scanning; * otherwise we check beacon frames for overlapping non-ERP * BSS in 11g and/or overlapping legacy BSS when in HT. - */ - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0 && - subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP) { + */ + if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { vap->iv_stats.is_rx_mgtdiscard++; return; } + /* FALLTHROUGH */ + case IEEE80211_FC0_SUBTYPE_BEACON: { + struct ieee80211_scanparams scan; + /* NB: accept off-channel frames */ /* XXX TODO: use rxstatus to determine off-channel details */ if (ieee80211_parse_beacon(ni, m0, ic->ic_curchan, &scan) &~ IEEE80211_BPARSE_OFFCHAN) From owner-svn-src-all@freebsd.org Wed Apr 20 19:13:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05FEB16E63; Wed, 20 Apr 2016 19:13:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0FE716F5; Wed, 20 Apr 2016 19:13:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KJD0P1052590; Wed, 20 Apr 2016 19:13:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KJD0rr052589; Wed, 20 Apr 2016 19:13:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604201913.u3KJD0rr052589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Apr 2016 19:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298361 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 19:13:02 -0000 Author: emaste Date: Wed Apr 20 19:13:00 2016 New Revision: 298361 URL: https://svnweb.freebsd.org/changeset/base/298361 Log: elfcopy: map all !alnum characters to '_' in binary input symbol names This matches bfd and gold. Obtained from: ELF Tool Chain r3445 Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/elfcopy/binary.c Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Wed Apr 20 18:48:39 2016 (r298360) +++ head/contrib/elftoolchain/elfcopy/binary.c Wed Apr 20 19:13:00 2016 (r298361) @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -213,9 +214,9 @@ create_elf_from_binary(struct elfcopy *e if ((sym_basename = strdup(ifn)) == NULL) err(1, "strdup"); - p = sym_basename; - while ((p = strchr(p, '.')) != NULL) - *p++ = '_'; + for (p = sym_basename; *p != '\0'; p++) + if (!isalnum(*p)) + *p = '_'; #define _GEN_SYMNAME(S) do { \ snprintf(name, sizeof(name), "%s%s%s", "_binary_", sym_basename, S); \ } while (0) From owner-svn-src-all@freebsd.org Wed Apr 20 19:21:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40EC4B1515D; Wed, 20 Apr 2016 19:21:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E5301B19; Wed, 20 Apr 2016 19:21:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KJLQ6w055616; Wed, 20 Apr 2016 19:21:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KJLQAL055615; Wed, 20 Apr 2016 19:21:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604201921.u3KJLQAL055615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Apr 2016 19:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298362 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 19:21:27 -0000 Author: emaste Date: Wed Apr 20 19:21:26 2016 New Revision: 298362 URL: https://svnweb.freebsd.org/changeset/base/298362 Log: Update comment added in r298357 The additional regex replacements are actully required due to an elfcopy bug which is now fixed (by r298361), not a Clang/GCC issue. Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Apr 20 19:13:00 2016 (r298361) +++ head/sys/conf/kern.post.mk Wed Apr 20 19:21:26 2016 (r298362) @@ -364,9 +364,8 @@ embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} --output-target ${EMBEDFS_FORMAT.${MACHINE_ARCH}} \ --binary-architecture ${EMBEDFS_ARCH.${MACHINE_ARCH}} \ ${MFS_IMAGE} ${.TARGET} - # Provide set of two distinct regexp to match for GCC (first three) - # and for CLANG >= 3.8.0 (last three). First three should be removed - # once support for GCC and CLANG < 3.8.0 is abandoned. + # Provide set of two distinct regexp to work around an elfcopy bug + # fixed in r298361 (last three). ${OBJCOPY} \ --rename-section .data=mfs,contents,alloc,load,readonly,data \ --redefine-sym \ From owner-svn-src-all@freebsd.org Wed Apr 20 20:09:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E135B1653B; Wed, 20 Apr 2016 20:09:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [IPv6:2607:f8b0:400e:c03::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 309C313DC; Wed, 20 Apr 2016 20:09:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x233.google.com with SMTP id r5so18979370pag.1; Wed, 20 Apr 2016 13:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=lAQPkbQwu9vDakTCEqe3ZAX1bnRHiLKtRs7zxeuyxWQ=; b=RhaNoHF/YlGX3r0gOoJPZYfEFHnSBnI5MJEhw8cusglax9bn+7/ECgw/v907s9/hco DIYNYr0OnxSXzpbogu8e1zVZ4SbfB9cqp69jCAGSEk6riyTX54k8QPvuN9H7U9B3VAFQ q0w53Y3FyqQqnQM9mXrM8qUjMIzSIS/T3qSOsICdFEHtEkycbRn4eEhaA/84mMsSR1l1 JltrqVFhKTGNC3kvHoE0zcAP16HPLTDBAkLjDE5xYl50jI2bX9F3ReEdIPsY/QirtXqR qzH7x8HH1Zb/65kKLpCjT3bgc/0mzPZIQGwkr5dkgu4IfZl5ui0+2mN0NDt3jdGh4RdG uBeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=lAQPkbQwu9vDakTCEqe3ZAX1bnRHiLKtRs7zxeuyxWQ=; b=JM/tcQOGS2owjBSY12Y1ASfM90vA96y8ZSLII2dSN1TVatEzsOF8811D+PZB1S9byj WD6L1s8omIo2bqwGoqUVFK1iKz2fBnXldG011ntbkDhdwb3i1hDqnpQrQtYFI8slxHc7 Uq7k3lLM8YMixTT+NAXZHt76OZspKE4HWvYgAIx4qxgUdNsU7R0GEkLZi/70KwX+Vvlr Ht7RxNWUe7R7na9R7cIN/kNTrDbWxJRAhooMkpa6SvhVJMTQsjk3u9lZJ+Lv4VM0A/Q0 wApFeaPi93PAQr61Grrn6BA4MXFdKCUPNVn8oB/HxOrU6HvAayK4DuGqA/QrXSq+LDFk C7hg== X-Gm-Message-State: AOPr4FULvcxpPjdt3W9H4BQdCV1FC0Zy9g1Gfty38L5VXUdJ9EhN5DoLWRH3cplP8Gveug== X-Received: by 10.66.63.104 with SMTP id f8mr14974373pas.109.1461182976743; Wed, 20 Apr 2016 13:09:36 -0700 (PDT) Received: from [192.168.100.106] ([199.231.240.59]) by smtp.gmail.com with ESMTPSA id kh2sm33243933pad.9.2016.04.20.13.09.35 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2016 13:09:35 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298358 - in head: contrib/gdb/gdb gnu/usr.bin/gdb/kgdb From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201604201758.u3KHwDNq028372@repo.freebsd.org> Date: Wed, 20 Apr 2016 13:09:36 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <19FE0F58-8B36-427F-9517-8C14765B9F8B@gmail.com> References: <201604201758.u3KHwDNq028372@repo.freebsd.org> To: Wojciech Macek X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:09:37 -0000 > On Apr 20, 2016, at 10:58, Wojciech Macek wrote: >=20 > Author: wma > Date: Wed Apr 20 17:58:13 2016 > New Revision: 298358 > URL: https://svnweb.freebsd.org/changeset/base/298358 >=20 > Log: > Fix KGDB backtrace on ARM >=20 > Modify trapframe decoding to properly analyze trapframe. >=20 > Provide method for fixup_pc. It happens, that in some kernel > functions, the GDB stack frame decoder cannot determine both > func name and frame size. This is because these functions > either contain invalid instruction, or their format does > not match standard schema. Detect that scenarios and move > PC accordingly to jump into known function schema, which > GDB is able to parse. >=20 > Obtained from: Semihalf > Sponsored by: Juniper Networks > Reviewed by: kib, zbb > Differential Revision: https://reviews.freebsd.org/D5976 This broke the build on i386: = https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/2909/ .= From owner-svn-src-all@freebsd.org Wed Apr 20 20:22:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09CB6B16AB0; Wed, 20 Apr 2016 20:22:50 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C042B1DC7; Wed, 20 Apr 2016 20:22:49 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKMmmu073685; Wed, 20 Apr 2016 20:22:48 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKMmee073678; Wed, 20 Apr 2016 20:22:48 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201604202022.u3KKMmee073678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 20 Apr 2016 20:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298363 - head/gnu/usr.bin/gdb/kgdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:22:50 -0000 Author: wma Date: Wed Apr 20 20:22:48 2016 New Revision: 298363 URL: https://svnweb.freebsd.org/changeset/base/298363 Log: Add missing function prototypes in KGDB This fixes the build broken by r298358 Modified: head/gnu/usr.bin/gdb/kgdb/main.c head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c head/gnu/usr.bin/gdb/kgdb/trgt_i386.c head/gnu/usr.bin/gdb/kgdb/trgt_mips.c head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c head/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c Modified: head/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/main.c Wed Apr 20 19:21:26 2016 (r298362) +++ head/gnu/usr.bin/gdb/kgdb/main.c Wed Apr 20 20:22:48 2016 (r298363) @@ -474,9 +474,7 @@ main(int argc, char *argv[]) add_arg(&args, NULL); init_ui_hook = kgdb_init; -#if TARGET_CPUARCH == arm frame_tdep_pc_fixup = kgdb_trgt_pc_fixup; -#endif kgdb_sniffer_kluge = kgdb_trgt_trapframe_sniffer; return (gdb_main(&args)); Modified: head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Wed Apr 20 19:21:26 2016 (r298362) +++ head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Wed Apr 20 20:22:48 2016 (r298363) @@ -195,3 +195,16 @@ kgdb_trgt_trapframe_sniffer(struct frame /* printf("%s: %lx =%s\n", __func__, pc, pname); */ return (NULL); } + +/* + * This function ensures, that the PC is inside the + * function section which is understood by GDB. + * + * Return 0 when fixup is necessary, -1 otherwise. + */ +int +kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused) +{ + + return (-1); +} Modified: head/gnu/usr.bin/gdb/kgdb/trgt_i386.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_i386.c Wed Apr 20 19:21:26 2016 (r298362) +++ head/gnu/usr.bin/gdb/kgdb/trgt_i386.c Wed Apr 20 20:22:48 2016 (r298363) @@ -385,3 +385,16 @@ kgdb_trgt_trapframe_sniffer(struct frame /* printf("%s: %llx =%s\n", __func__, pc, pname); */ return (NULL); } + +/* + * This function ensures, that the PC is inside the + * function section which is understood by GDB. + * + * Return 0 when fixup is necessary, -1 otherwise. + */ +int +kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused) +{ + + return (-1); +} Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Wed Apr 20 19:21:26 2016 (r298362) +++ head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Wed Apr 20 20:22:48 2016 (r298363) @@ -238,3 +238,16 @@ kgdb_trgt_trapframe_sniffer(struct frame #endif return (NULL); } + +/* + * This function ensures, that the PC is inside the + * function section which is understood by GDB. + * + * Return 0 when fixup is necessary, -1 otherwise. + */ +int +kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused) +{ + + return (-1); +} Modified: head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c Wed Apr 20 19:21:26 2016 (r298362) +++ head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c Wed Apr 20 20:22:48 2016 (r298363) @@ -199,3 +199,16 @@ kgdb_trgt_trapframe_sniffer(struct frame /* printf("%s: %llx =%s\n", __func__, pc, pname); */ return (NULL); } + +/* + * This function ensures, that the PC is inside the + * function section which is understood by GDB. + * + * Return 0 when fixup is necessary, -1 otherwise. + */ +int +kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused) +{ + + return (-1); +} Modified: head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c Wed Apr 20 19:21:26 2016 (r298362) +++ head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c Wed Apr 20 20:22:48 2016 (r298363) @@ -196,3 +196,16 @@ kgdb_trgt_trapframe_sniffer(struct frame /* printf("%s: %llx =%s\n", __func__, pc, pname); */ return (NULL); } + +/* + * This function ensures, that the PC is inside the + * function section which is understood by GDB. + * + * Return 0 when fixup is necessary, -1 otherwise. + */ +int +kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused) +{ + + return (-1); +} Modified: head/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c Wed Apr 20 19:21:26 2016 (r298362) +++ head/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c Wed Apr 20 20:22:48 2016 (r298363) @@ -203,3 +203,16 @@ kgdb_trgt_trapframe_sniffer(struct frame /* printf("%s: %lx =%s\n", __func__, pc, pname); */ return (NULL); } + +/* + * This function ensures, that the PC is inside the + * function section which is understood by GDB. + * + * Return 0 when fixup is necessary, -1 otherwise. + */ +int +kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused) +{ + + return (-1); +} From owner-svn-src-all@freebsd.org Wed Apr 20 20:23:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A041B16B2D for ; Wed, 20 Apr 2016 20:23:24 +0000 (UTC) (envelope-from wma@semihalf.com) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34F261F39 for ; Wed, 20 Apr 2016 20:23:24 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-ig0-x236.google.com with SMTP id g8so61120447igr.0 for ; Wed, 20 Apr 2016 13:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=orfUqQmoktrLWOxrwUh1MScRCsJbSQowZWGSRPnkTrA=; b=1fEAgX7VMeoETkauRSHKRu0mzatEFT/eKiB5FCBmpd5XlwVan4+G0WdRMUI+8DhaBN 0MQhJ5OOShddTe8kCPPqdgPqbsgCL2rTxl0icB5THfXMN2d4mooOAzvNqrU0ZtcE6np9 7YqomtNShSHj68KuQpL5feceMtjR9oaAkUAOQ//vXLIrT9uBVV9B9ZmtVmH4s4XqGB2K sZTZdmk9ZQ2ig7xQpjJwCPWDTwW/kFkRodosuWqTvPEr6TVcsRaiNVRG40I1pmF5mMdB pVZZhQY//Ww8j0O24feP1lrMWM5d2iv6BnGe43oOWxMcMGP47DmKaqBj9B+0xkPCaVR3 2fKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=orfUqQmoktrLWOxrwUh1MScRCsJbSQowZWGSRPnkTrA=; b=da955SmlZFRvUUicYeGqXu/BvLMrL3skHn3mq/5XkeMi2LbIEb341Kn24NqCo2lN/B rpmW1zIIryUCOwcge+VZ3Pv2/9/Hf8lYUMptlxnPSFo4uj6Yy9EG943BlgvzZRtOUR+E 4giASlZTSCsSaJjxhSGLdv3wiv6ia3Qb8a/95/7hmIk0QYPDGRniTMehFD7GUKtAPyO4 Hh4ouUsvmSZt+fdqnrl4ACfgFXWOtA1x4a+jgdVWLLvr3fY4mAYod4og6RUZRTmN3JRk 7pi2q3Ch+fnQPOBGqi1s3sDhKQx0be0pGDyG1xBvCMlGNqa1ur/MlNTAUEKDOASmzrfp x7Lg== X-Gm-Message-State: AOPr4FUOes9vtHvSO7BcB5iZP6tJGGk9I9p9SBL1hQnF5pfP6Bsn9gd+enYQFsLwFJNouSqtyL/dJertupjbOA== X-Received: by 10.50.221.67 with SMTP id qc3mr6214915igc.77.1461183803642; Wed, 20 Apr 2016 13:23:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.133.134 with HTTP; Wed, 20 Apr 2016 13:23:04 -0700 (PDT) In-Reply-To: <19FE0F58-8B36-427F-9517-8C14765B9F8B@gmail.com> References: <201604201758.u3KHwDNq028372@repo.freebsd.org> <19FE0F58-8B36-427F-9517-8C14765B9F8B@gmail.com> From: Wojciech Macek Date: Wed, 20 Apr 2016 13:23:04 -0700 Message-ID: Subject: Re: svn commit: r298358 - in head: contrib/gdb/gdb gnu/usr.bin/gdb/kgdb To: "Ngie Cooper (yaneurabeya)" Cc: Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:23:24 -0000 Fixed. 2016-04-20 13:09 GMT-07:00 Ngie Cooper (yaneurabeya) : > > > On Apr 20, 2016, at 10:58, Wojciech Macek wrote: > > > > Author: wma > > Date: Wed Apr 20 17:58:13 2016 > > New Revision: 298358 > > URL: https://svnweb.freebsd.org/changeset/base/298358 > > > > Log: > > Fix KGDB backtrace on ARM > > > > Modify trapframe decoding to properly analyze trapframe. > > > > Provide method for fixup_pc. It happens, that in some kernel > > functions, the GDB stack frame decoder cannot determine both > > func name and frame size. This is because these functions > > either contain invalid instruction, or their format does > > not match standard schema. Detect that scenarios and move > > PC accordingly to jump into known function schema, which > > GDB is able to parse. > > > > Obtained from: Semihalf > > Sponsored by: Juniper Networks > > Reviewed by: kib, zbb > > Differential Revision: https://reviews.freebsd.org/D5976 > > This broke the build on i386: > https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/2909/ . From owner-svn-src-all@freebsd.org Wed Apr 20 20:30:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8418EB16D3D; Wed, 20 Apr 2016 20:30:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54A0C1318; Wed, 20 Apr 2016 20:30:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKUJND074003; Wed, 20 Apr 2016 20:30:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKUIbB073995; Wed, 20 Apr 2016 20:30:18 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604202030.u3KKUIbB073995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 20 Apr 2016 20:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298364 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:30:20 -0000 Author: avos Date: Wed Apr 20 20:30:18 2016 New Revision: 298364 URL: https://svnweb.freebsd.org/changeset/base/298364 Log: net80211: provide descriptions for reason codes Add text description for deauth/disassoc/etc reason codes in addition to 'reason: ' string. Reviewed by: adrian Obtained from: IEEE Std 802.11-2012, 8.4.1.7 "Reason Code field" Differential Revision: https://reviews.freebsd.org/D5367 Modified: head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Wed Apr 20 20:22:48 2016 (r298363) +++ head/sys/net80211/ieee80211_hostap.c Wed Apr 20 20:30:18 2016 (r298364) @@ -2183,8 +2183,10 @@ hostap_recv_mgmt(struct ieee80211_node * IEEE80211_NODE_STAT(ni, rx_disassoc); } IEEE80211_NOTE(vap, IEEE80211_MSG_AUTH, ni, - "recv %s (reason %d)", ieee80211_mgt_subtype_name[subtype >> - IEEE80211_FC0_SUBTYPE_SHIFT], reason); + "recv %s (reason: %d (%s))", + ieee80211_mgt_subtype_name[subtype >> + IEEE80211_FC0_SUBTYPE_SHIFT], + reason, ieee80211_reason_to_string(reason)); if (ni != vap->iv_bss) ieee80211_node_leave(ni); break; Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Wed Apr 20 20:22:48 2016 (r298363) +++ head/sys/net80211/ieee80211_ht.c Wed Apr 20 20:30:18 2016 (r298364) @@ -2243,8 +2243,9 @@ ieee80211_ampdu_stop(struct ieee80211_no tap->txa_flags &= ~IEEE80211_AGGR_BARPEND; if (IEEE80211_AMPDU_RUNNING(tap)) { IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, - ni, "%s: stop BA stream for TID %d (reason %d)", - __func__, tap->txa_tid, reason); + ni, "%s: stop BA stream for TID %d (reason: %d (%s))", + __func__, tap->txa_tid, reason, + ieee80211_reason_to_string(reason)); vap->iv_stats.is_ampdu_stop++; ic->ic_addba_stop(ni, tap); @@ -2255,8 +2256,9 @@ ieee80211_ampdu_stop(struct ieee80211_no IEEE80211_ACTION_BA_DELBA, args); } else { IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, - ni, "%s: BA stream for TID %d not running (reason %d)", - __func__, tap->txa_tid, reason); + ni, "%s: BA stream for TID %d not running " + "(reason: %d (%s))", __func__, tap->txa_tid, reason, + ieee80211_reason_to_string(reason)); vap->iv_stats.is_ampdu_stop_failed++; } } @@ -2584,8 +2586,8 @@ ht_send_action_ba_delba(struct ieee80211 | args[1] ; IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "send DELBA action: tid %d, initiator %d reason %d", - args[0], args[1], args[2]); + "send DELBA action: tid %d, initiator %d reason %d (%s)", + args[0], args[1], args[2], ieee80211_reason_to_string(args[2])); IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", __func__, __LINE__, Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Wed Apr 20 20:22:48 2016 (r298363) +++ head/sys/net80211/ieee80211_ioctl.c Wed Apr 20 20:30:18 2016 (r298364) @@ -1281,18 +1281,20 @@ mlmedebug(struct ieee80211vap *vap, cons if (op == IEEE80211_MLME_AUTH) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_IOCTL | IEEE80211_MSG_STATE | IEEE80211_MSG_AUTH, mac, - "station authenticate %s via MLME (reason %d)", + "station authenticate %s via MLME (reason: %d (%s))", reason == IEEE80211_STATUS_SUCCESS ? "ACCEPT" : "REJECT", - reason); + reason, ieee80211_reason_to_string(reason)); } else if (!(IEEE80211_MLME_ASSOC <= op && op <= IEEE80211_MLME_AUTH)) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_ANY, mac, - "unknown MLME request %d (reason %d)", op, reason); + "unknown MLME request %d (reason: %d (%s))", op, reason, + ieee80211_reason_to_string(reason)); } else if (reason == IEEE80211_STATUS_SUCCESS) { IEEE80211_NOTE_MAC(vap, ops[op].mask, mac, "station %s via MLME", ops[op].opstr); } else { IEEE80211_NOTE_MAC(vap, ops[op].mask, mac, - "station %s via MLME (reason %d)", ops[op].opstr, reason); + "station %s via MLME (reason: %d (%s))", ops[op].opstr, + reason, ieee80211_reason_to_string(reason)); } #endif /* IEEE80211_DEBUG */ } Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Wed Apr 20 20:22:48 2016 (r298363) +++ head/sys/net80211/ieee80211_mesh.c Wed Apr 20 20:30:18 2016 (r298364) @@ -2856,8 +2856,8 @@ mesh_send_action_meshpeering_close(struc uint8_t *frm; IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, - "send PEER CLOSE action: localid 0x%x, peerid 0x%x reason %d", - args[0], args[1], args[2]); + "send PEER CLOSE action: localid 0x%x, peerid 0x%x reason %d (%s)", + args[0], args[1], args[2], ieee80211_reason_to_string(args[2])); IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", __func__, __LINE__, Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Wed Apr 20 20:22:48 2016 (r298363) +++ head/sys/net80211/ieee80211_output.c Wed Apr 20 20:30:18 2016 (r298364) @@ -2317,7 +2317,8 @@ ieee80211_send_mgmt(struct ieee80211_nod case IEEE80211_FC0_SUBTYPE_DEAUTH: IEEE80211_NOTE(vap, IEEE80211_MSG_AUTH, ni, - "send station deauthenticate (reason %d)", arg); + "send station deauthenticate (reason: %d (%s))", arg, + ieee80211_reason_to_string(arg)); m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t)); @@ -2537,7 +2538,8 @@ ieee80211_send_mgmt(struct ieee80211_nod case IEEE80211_FC0_SUBTYPE_DISASSOC: IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni, - "send station disassociate (reason %d)", arg); + "send station disassociate (reason: %d (%s))", arg, + ieee80211_reason_to_string(arg)); m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t)); Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Wed Apr 20 20:22:48 2016 (r298363) +++ head/sys/net80211/ieee80211_proto.c Wed Apr 20 20:30:18 2016 (r298364) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting + * Copyright (c) 2012 IEEE * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -101,6 +102,138 @@ const char *ieee80211_wme_acnames[] = { "WME_UPSD", }; + +/* + * Reason code descriptions were (mostly) obtained from + * IEEE Std 802.11-2012, pp. 442-445 Table 8-36. + */ +const char * +ieee80211_reason_to_string(uint16_t reason) +{ + switch (reason) { + case IEEE80211_REASON_UNSPECIFIED: + return ("unspecified"); + case IEEE80211_REASON_AUTH_EXPIRE: + return ("previous authentication is expired"); + case IEEE80211_REASON_AUTH_LEAVE: + return ("sending STA is leaving/has left IBSS or ESS"); + case IEEE80211_REASON_ASSOC_EXPIRE: + return ("disassociated due to inactivity"); + case IEEE80211_REASON_ASSOC_TOOMANY: + return ("too many associated STAs"); + case IEEE80211_REASON_NOT_AUTHED: + return ("class 2 frame received from nonauthenticated STA"); + case IEEE80211_REASON_NOT_ASSOCED: + return ("class 3 frame received from nonassociated STA"); + case IEEE80211_REASON_ASSOC_LEAVE: + return ("sending STA is leaving/has left BSS"); + case IEEE80211_REASON_ASSOC_NOT_AUTHED: + return ("STA requesting (re)association is not authenticated"); + case IEEE80211_REASON_DISASSOC_PWRCAP_BAD: + return ("information in the Power Capability element is " + "unacceptable"); + case IEEE80211_REASON_DISASSOC_SUPCHAN_BAD: + return ("information in the Supported Channels element is " + "unacceptable"); + case IEEE80211_REASON_IE_INVALID: + return ("invalid element"); + case IEEE80211_REASON_MIC_FAILURE: + return ("MIC failure"); + case IEEE80211_REASON_4WAY_HANDSHAKE_TIMEOUT: + return ("4-Way handshake timeout"); + case IEEE80211_REASON_GROUP_KEY_UPDATE_TIMEOUT: + return ("group key update timeout"); + case IEEE80211_REASON_IE_IN_4WAY_DIFFERS: + return ("element in 4-Way handshake different from " + "(re)association request/probe response/beacon frame"); + case IEEE80211_REASON_GROUP_CIPHER_INVALID: + return ("invalid group cipher"); + case IEEE80211_REASON_PAIRWISE_CIPHER_INVALID: + return ("invalid pairwise cipher"); + case IEEE80211_REASON_AKMP_INVALID: + return ("invalid AKMP"); + case IEEE80211_REASON_UNSUPP_RSN_IE_VERSION: + return ("unsupported version in RSN IE"); + case IEEE80211_REASON_INVALID_RSN_IE_CAP: + return ("invalid capabilities in RSN IE"); + case IEEE80211_REASON_802_1X_AUTH_FAILED: + return ("IEEE 802.1X authentication failed"); + case IEEE80211_REASON_CIPHER_SUITE_REJECTED: + return ("cipher suite rejected because of the security " + "policy"); + case IEEE80211_REASON_UNSPECIFIED_QOS: + return ("unspecified (QoS-related)"); + case IEEE80211_REASON_INSUFFICIENT_BW: + return ("QoS AP lacks sufficient bandwidth for this QoS STA"); + case IEEE80211_REASON_TOOMANY_FRAMES: + return ("too many frames need to be acknowledged"); + case IEEE80211_REASON_OUTSIDE_TXOP: + return ("STA is transmitting outside the limits of its TXOPs"); + case IEEE80211_REASON_LEAVING_QBSS: + return ("requested from peer STA (the STA is " + "resetting/leaving the BSS)"); + case IEEE80211_REASON_BAD_MECHANISM: + return ("requested from peer STA (it does not want to use " + "the mechanism)"); + case IEEE80211_REASON_SETUP_NEEDED: + return ("requested from peer STA (setup is required for the " + "used mechanism)"); + case IEEE80211_REASON_TIMEOUT: + return ("requested from peer STA (timeout)"); + case IEEE80211_REASON_PEER_LINK_CANCELED: + return ("SME cancels the mesh peering instance (not related " + "to the maximum number of peer mesh STAs)"); + case IEEE80211_REASON_MESH_MAX_PEERS: + return ("maximum number of peer mesh STAs was reached"); + case IEEE80211_REASON_MESH_CPVIOLATION: + return ("the received information violates the Mesh " + "Configuration policy configured in the mesh STA " + "profile"); + case IEEE80211_REASON_MESH_CLOSE_RCVD: + return ("the mesh STA has received a Mesh Peering Close " + "message requesting to close the mesh peering"); + case IEEE80211_REASON_MESH_MAX_RETRIES: + return ("the mesh STA has resent dot11MeshMaxRetries Mesh " + "Peering Open messages, without receiving a Mesh " + "Peering Confirm message"); + case IEEE80211_REASON_MESH_CONFIRM_TIMEOUT: + return ("the confirmTimer for the mesh peering instance times " + "out"); + case IEEE80211_REASON_MESH_INVALID_GTK: + return ("the mesh STA fails to unwrap the GTK or the values " + "in the wrapped contents do not match"); + case IEEE80211_REASON_MESH_INCONS_PARAMS: + return ("the mesh STA receives inconsistent information about " + "the mesh parameters between Mesh Peering Management " + "frames"); + case IEEE80211_REASON_MESH_INVALID_SECURITY: + return ("the mesh STA fails the authenticated mesh peering " + "exchange because due to failure in selecting " + "pairwise/group ciphersuite"); + case IEEE80211_REASON_MESH_PERR_NO_PROXY: + return ("the mesh STA does not have proxy information for " + "this external destination"); + case IEEE80211_REASON_MESH_PERR_NO_FI: + return ("the mesh STA does not have forwarding information " + "for this destination"); + case IEEE80211_REASON_MESH_PERR_DEST_UNREACH: + return ("the mesh STA determines that the link to the next " + "hop of an active path in its forwarding information " + "is no longer usable"); + case IEEE80211_REASON_MESH_MAC_ALRDY_EXISTS_MBSS: + return ("the MAC address of the STA already exists in the " + "mesh BSS"); + case IEEE80211_REASON_MESH_CHAN_SWITCH_REG: + return ("the mesh STA performs channel switch to meet " + "regulatory requirements"); + case IEEE80211_REASON_MESH_CHAN_SWITCH_UNSPEC: + return ("the mesh STA performs channel switch with " + "unspecified reason"); + default: + return ("reserved/unknown"); + } +} + static void beacon_miss(void *, int); static void beacon_swmiss(void *, int); static void parent_updown(void *, int); Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Wed Apr 20 20:22:48 2016 (r298363) +++ head/sys/net80211/ieee80211_proto.h Wed Apr 20 20:30:18 2016 (r298364) @@ -51,6 +51,8 @@ extern const char *ieee80211_mgt_subtype extern const char *ieee80211_phymode_name[IEEE80211_MODE_MAX]; extern const int ieee80211_opcap[IEEE80211_OPMODE_MAX]; +const char *ieee80211_reason_to_string(uint16_t); + void ieee80211_proto_attach(struct ieee80211com *); void ieee80211_proto_detach(struct ieee80211com *); void ieee80211_proto_vattach(struct ieee80211vap *); Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Wed Apr 20 20:22:48 2016 (r298363) +++ head/sys/net80211/ieee80211_sta.c Wed Apr 20 20:30:18 2016 (r298364) @@ -1788,7 +1788,8 @@ sta_recv_mgmt(struct ieee80211_node *ni, IEEE80211_NODE_STAT(ni, rx_deauth); IEEE80211_NOTE(vap, IEEE80211_MSG_AUTH, ni, - "recv deauthenticate (reason %d)", reason); + "recv deauthenticate (reason: %d (%s))", reason, + ieee80211_reason_to_string(reason)); ieee80211_new_state(vap, IEEE80211_S_AUTH, (reason << 8) | IEEE80211_FC0_SUBTYPE_DEAUTH); break; @@ -1821,7 +1822,8 @@ sta_recv_mgmt(struct ieee80211_node *ni, IEEE80211_NODE_STAT(ni, rx_disassoc); IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni, - "recv disassociate (reason %d)", reason); + "recv disassociate (reason: %d (%s))", reason, + ieee80211_reason_to_string(reason)); ieee80211_new_state(vap, IEEE80211_S_ASSOC, 0); break; } From owner-svn-src-all@freebsd.org Wed Apr 20 20:37:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B093DB16040; Wed, 20 Apr 2016 20:37:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD3A1939; Wed, 20 Apr 2016 20:37:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKbwSR076894; Wed, 20 Apr 2016 20:37:58 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKbwbr076893; Wed, 20 Apr 2016 20:37:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604202037.u3KKbwbr076893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Apr 2016 20:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298365 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:37:59 -0000 Author: pfg Date: Wed Apr 20 20:37:58 2016 New Revision: 298365 URL: https://svnweb.freebsd.org/changeset/base/298365 Log: Remove unused e500_event_codes_size. Found by: jhb Modified: head/sys/dev/hwpmc/hwpmc_e500.c Modified: head/sys/dev/hwpmc/hwpmc_e500.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_e500.c Wed Apr 20 20:30:18 2016 (r298364) +++ head/sys/dev/hwpmc/hwpmc_e500.c Wed Apr 20 20:37:58 2016 (r298365) @@ -242,9 +242,6 @@ static struct e500_event_code_map e500_e PMC_E500MC_ONLY(STWCX_FAILURES, 180), }; -const size_t e500_event_codes_size = - sizeof(e500_event_codes) / sizeof(e500_event_codes[0]); - static pmc_value_t e500_pmcn_read(unsigned int pmc) { From owner-svn-src-all@freebsd.org Wed Apr 20 20:43:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97C03B16437; Wed, 20 Apr 2016 20:43:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6695012EF; Wed, 20 Apr 2016 20:43:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKh5Xo081071; Wed, 20 Apr 2016 20:43:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKh5oQ081069; Wed, 20 Apr 2016 20:43:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604202043.u3KKh5oQ081069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 20 Apr 2016 20:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298366 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:43:06 -0000 Author: ngie Date: Wed Apr 20 20:43:05 2016 New Revision: 298366 URL: https://svnweb.freebsd.org/changeset/base/298366 Log: Fix coverity issues with contrib/netbsd-tests/lib/libc/sys/t_connect.c - Ensure socket(2) calls succeed - Don't leak slist allocated by earlier socket(2) call MFC after: 2 weeks CID: 976773, 1251405 Reported by: Coverity Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/sys/t_connect.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_connect.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_connect.c Wed Apr 20 20:37:58 2016 (r298365) +++ head/contrib/netbsd-tests/lib/libc/sys/t_connect.c Wed Apr 20 20:43:05 2016 (r298366) @@ -56,6 +56,11 @@ ATF_TC_BODY(connect_low_port, tc) slist = socket(AF_INET, SOCK_STREAM, 0); sd = socket(AF_INET, SOCK_STREAM, 0); +#ifdef __FreeBSD__ + ATF_REQUIRE(sd > 0); + ATF_REQUIRE(slist > 0); +#endif + /* bind listening socket */ memset(&sinlist, 0, sizeof(sinlist)); sinlist.sin_family = AF_INET; @@ -92,6 +97,9 @@ ATF_TC_BODY(connect_low_port, tc) ATF_REQUIRE(ntohs(sin.sin_port) <= IPPORT_RESERVEDMAX); close(sd); +#ifdef __FreeBSD__ + close(slist); +#endif } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Wed Apr 20 20:44:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52AE3B165EA; Wed, 20 Apr 2016 20:44:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23D9419A1; Wed, 20 Apr 2016 20:44:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKiU91081453; Wed, 20 Apr 2016 20:44:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKiUMq081452; Wed, 20 Apr 2016 20:44:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604202044.u3KKiUMq081452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 20 Apr 2016 20:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298367 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:44:31 -0000 Author: bapt Date: Wed Apr 20 20:44:30 2016 New Revision: 298367 URL: https://svnweb.freebsd.org/changeset/base/298367 Log: Check the returned value of memchr(3) before using it Reported by: Coverity CID: 1338530 Modified: head/lib/libc/locale/ascii.c Modified: head/lib/libc/locale/ascii.c ============================================================================== --- head/lib/libc/locale/ascii.c Wed Apr 20 20:43:05 2016 (r298366) +++ head/lib/libc/locale/ascii.c Wed Apr 20 20:44:30 2016 (r298367) @@ -133,11 +133,14 @@ _ascii_mbsnrtowcs(wchar_t * __restrict d if (dst == NULL) { s = memchr(*src, '\0', nms); + if (s == NULL) + return (nms); + if (*s & 0x80) { errno = EILSEQ; return ((size_t)-1); } - return (s != NULL ? s - *src : nms); + return (s - *src); } s = *src; From owner-svn-src-all@freebsd.org Wed Apr 20 20:48:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69B65B16712; Wed, 20 Apr 2016 20:48:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 373481BB0; Wed, 20 Apr 2016 20:48:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKmsgj081629; Wed, 20 Apr 2016 20:48:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKmsD0081628; Wed, 20 Apr 2016 20:48:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604202048.u3KKmsD0081628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 20 Apr 2016 20:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298368 - head/contrib/netbsd-tests/lib/libc/ssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:48:55 -0000 Author: ngie Date: Wed Apr 20 20:48:54 2016 New Revision: 298368 URL: https://svnweb.freebsd.org/changeset/base/298368 Log: Fix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.c Ensure opening /dev/zero succeeds. Abort the test if it doesn't. Also, use _PATH_DEVZERO instead of hardcoding "/dev/zero" MFC after: 2 weeks CID: 1251410 Reported by: Coverity Sponsored by: EMC / Isilon Storage Division" Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_read.c Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_read.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/h_read.c Wed Apr 20 20:44:30 2016 (r298367) +++ head/contrib/netbsd-tests/lib/libc/ssp/h_read.c Wed Apr 20 20:48:54 2016 (r298368) @@ -38,6 +38,7 @@ __RCSID("$NetBSD: h_read.c,v 1.1 2010/12 #ifdef __FreeBSD__ #include +#include int main(int argc, char *argv[]) @@ -46,7 +47,8 @@ main(int argc, char *argv[]) int fd, n; size_t len = atoi(argv[1]); - fd = open("/dev/zero", O_RDONLY); + if ((fd = open(_PATH_DEVZERO, O_RDONLY)) == -1); + abort(); if ((n = read(fd, b, len)) == -1) abort(); (void)printf("%s\n", b); From owner-svn-src-all@freebsd.org Wed Apr 20 20:54:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E074B16928; Wed, 20 Apr 2016 20:54:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F04A1FF2; Wed, 20 Apr 2016 20:54:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKslsa084440; Wed, 20 Apr 2016 20:54:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKsl67084439; Wed, 20 Apr 2016 20:54:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604202054.u3KKsl67084439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 20 Apr 2016 20:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298369 - head/usr.bin/at X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:54:48 -0000 Author: bapt Date: Wed Apr 20 20:54:47 2016 New Revision: 298369 URL: https://svnweb.freebsd.org/changeset/base/298369 Log: Fix typo: actually test the return of strchr(3) Reported by: Coverity CID: 1007335 MFC after: 3 days Modified: head/usr.bin/at/at.c Modified: head/usr.bin/at/at.c ============================================================================== --- head/usr.bin/at/at.c Wed Apr 20 20:48:54 2016 (r298368) +++ head/usr.bin/at/at.c Wed Apr 20 20:54:47 2016 (r298369) @@ -351,7 +351,7 @@ writefile(time_t runtimer, char queue) char *eqp; eqp = strchr(*atenv, '='); - if (ap == NULL) + if (eqp == NULL) eqp = *atenv; else { From owner-svn-src-all@freebsd.org Wed Apr 20 20:56:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E014B169DA; Wed, 20 Apr 2016 20:56:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDADE1262; Wed, 20 Apr 2016 20:55:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKtxaY084539; Wed, 20 Apr 2016 20:55:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKtwkC084536; Wed, 20 Apr 2016 20:55:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604202055.u3KKtwkC084536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 Apr 2016 20:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298370 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:56:00 -0000 Author: jhb Date: Wed Apr 20 20:55:58 2016 New Revision: 298370 URL: https://svnweb.freebsd.org/changeset/base/298370 Log: Add a wrapper for evaluating _OSC methods. This wrapper does not translate errors in the first word to ACPI error status returns. Use this wrapper in the acpi_cpu(4) driver in place of the existing _OSC code. While here, fix a bug where the wrong count of words was passed when invoking _OSC. Reviewed by: jkim MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6022 Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Apr 20 20:54:47 2016 (r298369) +++ head/sys/dev/acpica/acpi.c Wed Apr 20 20:55:58 2016 (r298370) @@ -2480,6 +2480,29 @@ acpi_AppendBufferResource(ACPI_BUFFER *b return (AE_OK); } +ACPI_STATUS +acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid, int revision, int count, + uint32_t *caps, bool query) +{ + ACPI_OBJECT arg[4]; + ACPI_OBJECT_LIST arglist; + + arglist.Pointer = arg; + arglist.Count = 4; + arg[0].Type = ACPI_TYPE_BUFFER; + arg[0].Buffer.Length = ACPI_UUID_LENGTH; + arg[0].Buffer.Pointer = uuid; + arg[1].Type = ACPI_TYPE_INTEGER; + arg[1].Integer.Value = revision; + arg[2].Type = ACPI_TYPE_INTEGER; + arg[2].Integer.Value = count; + arg[3].Type = ACPI_TYPE_BUFFER; + arg[3].Buffer.Length = count * sizeof(uint32_t); + arg[3].Buffer.Pointer = (uint8_t *)caps; + caps[0] = query ? 1 : 0; + return (AcpiEvaluateObject(handle, "_OSC", &arglist, NULL)); +} + /* * Set interrupt model. */ Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed Apr 20 20:54:47 2016 (r298369) +++ head/sys/dev/acpica/acpi_cpu.c Wed Apr 20 20:55:58 2016 (r298370) @@ -296,7 +296,7 @@ static int acpi_cpu_attach(device_t dev) { ACPI_BUFFER buf; - ACPI_OBJECT arg[4], *obj; + ACPI_OBJECT arg[1], *obj; ACPI_OBJECT_LIST arglist; struct pcpu *pcpu_data; struct acpi_cpu_softc *sc; @@ -391,21 +391,9 @@ acpi_cpu_attach(device_t dev) * Intel Processor Vendor-Specific ACPI Interface Specification. */ if (sc->cpu_features) { - arglist.Pointer = arg; - arglist.Count = 4; - arg[0].Type = ACPI_TYPE_BUFFER; - arg[0].Buffer.Length = sizeof(cpu_oscuuid); - arg[0].Buffer.Pointer = cpu_oscuuid; /* UUID */ - arg[1].Type = ACPI_TYPE_INTEGER; - arg[1].Integer.Value = 1; /* revision */ - arg[2].Type = ACPI_TYPE_INTEGER; - arg[2].Integer.Value = 1; /* count */ - arg[3].Type = ACPI_TYPE_BUFFER; - arg[3].Buffer.Length = sizeof(cap_set); /* Capabilities buffer */ - arg[3].Buffer.Pointer = (uint8_t *)cap_set; - cap_set[0] = 0; /* status */ cap_set[1] = sc->cpu_features; - status = AcpiEvaluateObject(sc->cpu_handle, "_OSC", &arglist, NULL); + status = acpi_EvaluateOSC(sc->cpu_handle, cpu_oscuuid, 1, 2, cap_set, + false); if (ACPI_SUCCESS(status)) { if (cap_set[0] != 0) device_printf(dev, "_OSC returned status %#x\n", cap_set[0]); Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Apr 20 20:54:47 2016 (r298369) +++ head/sys/dev/acpica/acpivar.h Wed Apr 20 20:55:58 2016 (r298370) @@ -335,6 +335,8 @@ ACPI_STATUS acpi_FindIndexedResource(ACP ACPI_RESOURCE **resp); ACPI_STATUS acpi_AppendBufferResource(ACPI_BUFFER *buf, ACPI_RESOURCE *res); +ACPI_STATUS acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid, + int revision, int count, uint32_t *caps, bool query); ACPI_STATUS acpi_OverrideInterruptLevel(UINT32 InterruptNumber); ACPI_STATUS acpi_SetIntrModel(int model); int acpi_ReqSleepState(struct acpi_softc *sc, int state); From owner-svn-src-all@freebsd.org Wed Apr 20 20:56:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 785D9B16A00; Wed, 20 Apr 2016 20:56:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 223F21380; Wed, 20 Apr 2016 20:56:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKu6aF084593; Wed, 20 Apr 2016 20:56:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKu6xQ084592; Wed, 20 Apr 2016 20:56:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604202056.u3KKu6xQ084592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 20 Apr 2016 20:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298371 - head/usr.bin/whereis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:56:07 -0000 Author: bapt Date: Wed Apr 20 20:56:06 2016 New Revision: 298371 URL: https://svnweb.freebsd.org/changeset/base/298371 Log: Fix bad checking of the return of realloc(3) Reported by: Coverity CID: 1007335 MFC after: 3 days Modified: head/usr.bin/whereis/whereis.c Modified: head/usr.bin/whereis/whereis.c ============================================================================== --- head/usr.bin/whereis/whereis.c Wed Apr 20 20:55:58 2016 (r298370) +++ head/usr.bin/whereis/whereis.c Wed Apr 20 20:56:06 2016 (r298371) @@ -207,7 +207,7 @@ decolonify(char *s, ccharp **cppp, int * *cp = '\0'; if (strlen(s) && !contains(*cppp, s)) { *cppp = realloc(*cppp, (*ip + 2) * sizeof(char *)); - if (cppp == NULL) + if (*cppp == NULL) abort(); (*cppp)[*ip] = s; (*cppp)[*ip + 1] = NULL; From owner-svn-src-all@freebsd.org Wed Apr 20 20:58:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3DC0B16B40; Wed, 20 Apr 2016 20:58:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4CDC1709; Wed, 20 Apr 2016 20:58:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KKwUGO084714; Wed, 20 Apr 2016 20:58:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KKwU4F084713; Wed, 20 Apr 2016 20:58:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604202058.u3KKwU4F084713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 Apr 2016 20:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298372 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 20:58:32 -0000 Author: jhb Date: Wed Apr 20 20:58:30 2016 New Revision: 298372 URL: https://svnweb.freebsd.org/changeset/base/298372 Log: Invoke _OSC on Host-PCI bridges. Tell the firmware that we support PCI-express config space access and MSI. Reviewed by: jkim MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6023 Modified: head/sys/dev/acpica/acpi_pcib_acpi.c Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Wed Apr 20 20:56:06 2016 (r298371) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Wed Apr 20 20:58:30 2016 (r298372) @@ -295,6 +295,40 @@ first_decoded_bus(struct acpi_hpcib_soft } #endif +static void +acpi_pcib_osc(struct acpi_hpcib_softc *sc) +{ + ACPI_STATUS status; + uint32_t cap_set[3]; + + static uint8_t pci_host_bridge_uuid[ACPI_UUID_LENGTH] = { + 0x5b, 0x4d, 0xdb, 0x33, 0xf7, 0x1f, 0x1c, 0x40, + 0x96, 0x57, 0x74, 0x41, 0xc0, 0x3d, 0xd7, 0x66 + }; + + /* Support Field: Extended PCI Config Space, MSI */ + cap_set[1] = 0x11; + + /* Control Field */ + cap_set[2] = 0; + + status = acpi_EvaluateOSC(sc->ap_handle, pci_host_bridge_uuid, 1, + nitems(cap_set), cap_set, false); + if (ACPI_FAILURE(status)) { + if (status == AE_NOT_FOUND) + return; + device_printf(sc->ap_dev, "_OSC failed: %s\n", + AcpiFormatException(status)); + return; + } + + if (cap_set[0] != 0) { + device_printf(sc->ap_dev, "_OSC returned error %#x\n", + cap_set[0]); + return; + } +} + static int acpi_pcib_acpi_attach(device_t dev) { @@ -321,6 +355,8 @@ acpi_pcib_acpi_attach(device_t dev) if (!acpi_DeviceIsPresent(dev)) return (ENXIO); + acpi_pcib_osc(sc); + /* * Get our segment number by evaluating _SEG. * It's OK for this to not exist. From owner-svn-src-all@freebsd.org Wed Apr 20 21:04:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE61FB16DEF; Wed, 20 Apr 2016 21:04:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABEBC1CC6; Wed, 20 Apr 2016 21:04:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KL4dKL087552; Wed, 20 Apr 2016 21:04:39 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KL4dZi087551; Wed, 20 Apr 2016 21:04:39 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201604202104.u3KL4dZi087551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 20 Apr 2016 21:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298373 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:04:41 -0000 Author: bz Date: Wed Apr 20 21:04:39 2016 New Revision: 298373 URL: https://svnweb.freebsd.org/changeset/base/298373 Log: Add more fields from struct ifnet needed during debugging a kernel panic. Move if_fib into the right place. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if_debug.c Modified: head/sys/net/if_debug.c ============================================================================== --- head/sys/net/if_debug.c Wed Apr 20 20:58:30 2016 (r298372) +++ head/sys/net/if_debug.c Wed Apr 20 21:04:39 2016 (r298373) @@ -65,6 +65,9 @@ if_show_ifnet(struct ifnet *ifp) IF_DB_PRINTF("%d", if_index_reserved); IF_DB_PRINTF("%p", if_softc); IF_DB_PRINTF("%p", if_l2com); + IF_DB_PRINTF("%p", if_afdata); + IF_DB_PRINTF("%d", if_afdata_initialized); + IF_DB_PRINTF("%u", if_fib); IF_DB_PRINTF("%p", if_vnet); IF_DB_PRINTF("%p", if_home_vnet); IF_DB_PRINTF("%p", if_vlantrunk); @@ -87,7 +90,6 @@ if_show_ifnet(struct ifnet *ifp) IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); IF_DB_PRINTF("%d", if_snd.altq_type); IF_DB_PRINTF("%x", if_snd.altq_flags); - IF_DB_PRINTF("%u", if_fib); #undef IF_DB_PRINTF } From owner-svn-src-all@freebsd.org Wed Apr 20 21:11:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8887B15017; Wed, 20 Apr 2016 21:11:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F2CD1068; Wed, 20 Apr 2016 21:11:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KLBnrD089825; Wed, 20 Apr 2016 21:11:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KLBnWs089824; Wed, 20 Apr 2016 21:11:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604202111.u3KLBnWs089824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 20 Apr 2016 21:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298374 - head/usr.sbin/mpsutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:11:51 -0000 Author: bapt Date: Wed Apr 20 21:11:49 2016 New Revision: 298374 URL: https://svnweb.freebsd.org/changeset/base/298374 Log: Plug leaks Reported by: Coverity CID: 1340155 and 1340156 MFC after: 1 week Modified: head/usr.sbin/mpsutil/mps_flash.c Modified: head/usr.sbin/mpsutil/mps_flash.c ============================================================================== --- head/usr.sbin/mpsutil/mps_flash.c Wed Apr 20 21:04:39 2016 (r298373) +++ head/usr.sbin/mpsutil/mps_flash.c Wed Apr 20 21:11:49 2016 (r298374) @@ -83,6 +83,7 @@ flash_save(int argc, char **argv) if ((size = mps_firmware_get(fd, &firmware_buffer, bios)) < 0) { warnx("Fail to save %s", argv[1]); + close(fd); return (1); } @@ -100,6 +101,7 @@ flash_save(int argc, char **argv) error = errno; warn("write"); free(firmware_buffer); + close(fd); return (error); } written += ret; @@ -189,12 +191,14 @@ flash_update(int argc, char **argv) warnx("Invalid bios: no boot record magic number"); munmap(mem, st.st_size); close(fd); + free(facts); return (1); } if ((st.st_size % 512) != 0) { warnx("Invalid bios: size not a multiple of 512"); munmap(mem, st.st_size); close(fd); + free(facts); return (1); } } else { @@ -206,6 +210,7 @@ flash_update(int argc, char **argv) warnx(" Image Vendor ID: %04x", fwheader->VendorID); munmap(mem, st.st_size); close(fd); + free(facts); return (1); } @@ -215,6 +220,7 @@ flash_update(int argc, char **argv) warnx(" Image Product ID: %04x", fwheader->ProductID); munmap(mem, st.st_size); close(fd); + free(facts); return (1); } } @@ -224,11 +230,13 @@ flash_update(int argc, char **argv) warnx("Fail to update %s", argv[1]); munmap(mem, st.st_size); close(fd); + free(facts); return (1); } munmap(mem, st.st_size); close(fd); + free(facts); printf("%s successfully updated\n", argv[1]); return (0); } From owner-svn-src-all@freebsd.org Wed Apr 20 21:13:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE04B150BE; Wed, 20 Apr 2016 21:13:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E18531252; Wed, 20 Apr 2016 21:13:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KLDPkj090541; Wed, 20 Apr 2016 21:13:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KLDPbY090540; Wed, 20 Apr 2016 21:13:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604202113.u3KLDPbY090540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Apr 2016 21:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298375 - head/sys/netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:13:26 -0000 Author: pfg Date: Wed Apr 20 21:13:24 2016 New Revision: 298375 URL: https://svnweb.freebsd.org/changeset/base/298375 Log: Remove unused SMB_DIALECT_MAX macro. Found by: jhb Modified: head/sys/netsmb/smb_smb.c Modified: head/sys/netsmb/smb_smb.c ============================================================================== --- head/sys/netsmb/smb_smb.c Wed Apr 20 21:11:49 2016 (r298374) +++ head/sys/netsmb/smb_smb.c Wed Apr 20 21:13:24 2016 (r298375) @@ -68,8 +68,6 @@ static struct smb_dialect smb_dialects[] {-1, NULL} }; -#define SMB_DIALECT_MAX (nitems(smb_dialects) - 2) - static u_int32_t smb_vc_maxread(struct smb_vc *vcp) { From owner-svn-src-all@freebsd.org Wed Apr 20 21:15:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F16BB15218; Wed, 20 Apr 2016 21:15:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FE1614A7; Wed, 20 Apr 2016 21:15:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KLFuNF090676; Wed, 20 Apr 2016 21:15:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KLFte0090664; Wed, 20 Apr 2016 21:15:55 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604202115.u3KLFte0090664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 20 Apr 2016 21:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298376 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:15:57 -0000 Author: avos Date: Wed Apr 20 21:15:55 2016 New Revision: 298376 URL: https://svnweb.freebsd.org/changeset/base/298376 Log: net80211: hide subtype mask & shift in function call. Hide subtype mask/shift (which is used for index calculation in ieee80211_mgt_subtype_name[] array) in function call. Tested with RTL8188CUS, STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5369 Modified: head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_input.h head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_scan.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_tdma.c head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_adhoc.c Wed Apr 20 21:15:55 2016 (r298376) @@ -613,8 +613,7 @@ adhoc_input(struct ieee80211_node *ni, s if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) || ieee80211_msg_dumppkts(vap)) { if_printf(ifp, "received %s from %s rssi %d\n", - ieee80211_mgt_subtype_name[subtype >> - IEEE80211_FC0_SUBTYPE_SHIFT], + ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } #endif Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_hostap.c Wed Apr 20 21:15:55 2016 (r298376) @@ -831,8 +831,7 @@ hostap_input(struct ieee80211_node *ni, if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) || ieee80211_msg_dumppkts(vap)) { if_printf(ifp, "received %s from %s rssi %d\n", - ieee80211_mgt_subtype_name[subtype >> - IEEE80211_FC0_SUBTYPE_SHIFT], + ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } #endif @@ -2184,8 +2183,7 @@ hostap_recv_mgmt(struct ieee80211_node * } IEEE80211_NOTE(vap, IEEE80211_MSG_AUTH, ni, "recv %s (reason: %d (%s))", - ieee80211_mgt_subtype_name[subtype >> - IEEE80211_FC0_SUBTYPE_SHIFT], + ieee80211_mgt_subtype_name(subtype), reason, ieee80211_reason_to_string(reason)); if (ni != vap->iv_bss) ieee80211_node_leave(ni); Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_input.c Wed Apr 20 21:15:55 2016 (r298376) @@ -930,12 +930,8 @@ ieee80211_discard_frame(const struct iee if_printf(vap->iv_ifp, "[%s] discard ", ether_sprintf(ieee80211_getbssid(vap, wh))); - if (type == NULL) { - printf("%s frame, ", ieee80211_mgt_subtype_name[ - (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) >> - IEEE80211_FC0_SUBTYPE_SHIFT]); - } else - printf("%s frame, ", type); + printf("%s frame, ", type != NULL ? type : + ieee80211_mgt_subtype_name(wh->i_fc[0])); va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); Modified: head/sys/net80211/ieee80211_input.h ============================================================================== --- head/sys/net80211/ieee80211_input.h Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_input.h Wed Apr 20 21:15:55 2016 (r298376) @@ -62,8 +62,7 @@ void ieee80211_ssid_mismatch(struct ieee memcmp((_ssid) + 2, (_ni)->ni_essid, (_ssid)[1]) != 0)) { \ if (ieee80211_msg_input(vap)) \ ieee80211_ssid_mismatch(vap, \ - ieee80211_mgt_subtype_name[subtype >> \ - IEEE80211_FC0_SUBTYPE_SHIFT], \ + ieee80211_mgt_subtype_name(subtype), \ wh->i_addr2, _ssid); \ vap->iv_stats.is_rx_ssidmismatch++; \ _action; \ Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_mesh.c Wed Apr 20 21:15:55 2016 (r298376) @@ -1793,8 +1793,7 @@ mesh_input(struct ieee80211_node *ni, st (vap->iv_ic->ic_flags & IEEE80211_F_SCAN)) || ieee80211_msg_dumppkts(vap)) { if_printf(ifp, "received %s from %s rssi %d\n", - ieee80211_mgt_subtype_name[subtype >> - IEEE80211_FC0_SUBTYPE_SHIFT], + ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } #endif Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_output.c Wed Apr 20 21:15:55 2016 (r298376) @@ -804,9 +804,7 @@ ieee80211_mgmt_output(struct ieee80211_n if (vap->iv_state == IEEE80211_S_CAC) { IEEE80211_NOTE(vap, IEEE80211_MSG_OUTPUT | IEEE80211_MSG_DOTH, ni, "block %s frame in CAC state", - ieee80211_mgt_subtype_name[ - (type & IEEE80211_FC0_SUBTYPE_MASK) >> - IEEE80211_FC0_SUBTYPE_SHIFT]); + ieee80211_mgt_subtype_name(type)); vap->iv_stats.is_tx_badstate++; ieee80211_free_node(ni); m_freem(m); @@ -841,9 +839,7 @@ ieee80211_mgmt_output(struct ieee80211_n ieee80211_msg_dumppkts(vap)) { printf("[%s] send %s on channel %u\n", ether_sprintf(wh->i_addr1), - ieee80211_mgt_subtype_name[ - (type & IEEE80211_FC0_SUBTYPE_MASK) >> - IEEE80211_FC0_SUBTYPE_SHIFT], + ieee80211_mgt_subtype_name(type), ieee80211_chan2ieee(ic, ic->ic_curchan)); } #endif Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_proto.c Wed Apr 20 21:15:55 2016 (r298376) @@ -63,13 +63,13 @@ __FBSDID("$FreeBSD$"); #define AGGRESSIVE_MODE_SWITCH_HYSTERESIS 3 /* pkts / 100ms */ #define HIGH_PRI_SWITCH_THRESH 10 /* pkts / 100ms */ -const char *ieee80211_mgt_subtype_name[] = { +const char *mgt_subtype_name[] = { "assoc_req", "assoc_resp", "reassoc_req", "reassoc_resp", "probe_req", "probe_resp", "timing_adv", "reserved#7", "beacon", "atim", "disassoc", "auth", "deauth", "action", "action_noack", "reserved#15" }; -const char *ieee80211_ctl_subtype_name[] = { +const char *ctl_subtype_name[] = { "reserved#0", "reserved#1", "reserved#2", "reserved#3", "reserved#4", "reserved#5", "reserved#6", "control_wrap", "bar", "ba", "ps_poll", "rts", @@ -574,9 +574,7 @@ ieee80211_dump_pkt(struct ieee80211com * printf(" data"); break; case IEEE80211_FC0_TYPE_MGT: - printf(" %s", ieee80211_mgt_subtype_name[ - (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) - >> IEEE80211_FC0_SUBTYPE_SHIFT]); + printf(" %s", ieee80211_mgt_subtype_name(wh->i_fc[0])); break; default: printf(" type#%d", wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK); Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_proto.h Wed Apr 20 21:15:55 2016 (r298376) @@ -47,10 +47,25 @@ enum ieee80211_state { #define IEEE80211_SEND_MGMT(_ni,_type,_arg) \ ((*(_ni)->ni_ic->ic_send_mgmt)(_ni, _type, _arg)) -extern const char *ieee80211_mgt_subtype_name[]; +extern const char *mgt_subtype_name[]; +extern const char *ctl_subtype_name[]; extern const char *ieee80211_phymode_name[IEEE80211_MODE_MAX]; extern const int ieee80211_opcap[IEEE80211_OPMODE_MAX]; +static __inline const char * +ieee80211_mgt_subtype_name(uint8_t subtype) +{ + return mgt_subtype_name[(subtype & IEEE80211_FC0_SUBTYPE_MASK) >> + IEEE80211_FC0_SUBTYPE_SHIFT]; +} + +static __inline const char * +ieee80211_ctl_subtype_name(uint8_t subtype) +{ + return ctl_subtype_name[(subtype & IEEE80211_FC0_SUBTYPE_MASK) >> + IEEE80211_FC0_SUBTYPE_SHIFT]; +} + const char *ieee80211_reason_to_string(uint16_t); void ieee80211_proto_attach(struct ieee80211com *); Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_scan.c Wed Apr 20 21:15:55 2016 (r298376) @@ -539,8 +539,7 @@ ieee80211_scan_dump_probe_beacon(uint8_t printf("[%s] %s%s on chan %u (bss chan %u) ", ether_sprintf(mac), isnew ? "new " : "", - ieee80211_mgt_subtype_name[subtype >> IEEE80211_FC0_SUBTYPE_SHIFT], - sp->chan, sp->bchan); + ieee80211_mgt_subtype_name(subtype), sp->chan, sp->bchan); ieee80211_print_essid(sp->ssid + 2, sp->ssid[1]); printf(" rssi %d\n", rssi); Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_sta.c Wed Apr 20 21:15:55 2016 (r298376) @@ -880,8 +880,7 @@ sta_input(struct ieee80211_node *ni, str if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) || ieee80211_msg_dumppkts(vap)) { if_printf(ifp, "received %s from %s rssi %d\n", - ieee80211_mgt_subtype_name[subtype >> - IEEE80211_FC0_SUBTYPE_SHIFT], + ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } #endif @@ -892,8 +891,7 @@ sta_input(struct ieee80211_node *ni, str * should be encrypted, discard all others. */ IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, - wh, ieee80211_mgt_subtype_name[subtype >> - IEEE80211_FC0_SUBTYPE_SHIFT], + wh, ieee80211_mgt_subtype_name(subtype), "%s", "WEP set but not permitted"); vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ goto out; Modified: head/sys/net80211/ieee80211_tdma.c ============================================================================== --- head/sys/net80211/ieee80211_tdma.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_tdma.c Wed Apr 20 21:15:55 2016 (r298376) @@ -343,8 +343,7 @@ tdma_recv_mgmt(struct ieee80211_node *ni */ IEEE80211_DISCARD(vap, IEEE80211_MSG_ELEMID | IEEE80211_MSG_INPUT, - wh, ieee80211_mgt_subtype_name[subtype >> - IEEE80211_FC0_SUBTYPE_SHIFT], + wh, ieee80211_mgt_subtype_name(subtype), "%s", "no TDMA ie"); vap->iv_stats.is_rx_mgtdiscard++; return; Modified: head/sys/net80211/ieee80211_wds.c ============================================================================== --- head/sys/net80211/ieee80211_wds.c Wed Apr 20 21:13:24 2016 (r298375) +++ head/sys/net80211/ieee80211_wds.c Wed Apr 20 21:15:55 2016 (r298376) @@ -693,8 +693,7 @@ wds_input(struct ieee80211_node *ni, str #ifdef IEEE80211_DEBUG if (ieee80211_msg_debug(vap) || ieee80211_msg_dumppkts(vap)) { if_printf(ifp, "received %s from %s rssi %d\n", - ieee80211_mgt_subtype_name[subtype >> - IEEE80211_FC0_SUBTYPE_SHIFT], + ieee80211_mgt_subtype_name(subtype), ether_sprintf(wh->i_addr2), rssi); } #endif From owner-svn-src-all@freebsd.org Wed Apr 20 21:21:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46ED7B15511; Wed, 20 Apr 2016 21:21:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 222F31A50; Wed, 20 Apr 2016 21:21:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KLLm8O091571; Wed, 20 Apr 2016 21:21:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KLLllG091567; Wed, 20 Apr 2016 21:21:47 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201604202121.u3KLLllG091567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 20 Apr 2016 21:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298377 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:21:49 -0000 Author: jkim Date: Wed Apr 20 21:21:47 2016 New Revision: 298377 URL: https://svnweb.freebsd.org/changeset/base/298377 Log: Remove query flag from acpi_EvaluateOSC(). This function does not support return buffer (yet). Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Apr 20 21:15:55 2016 (r298376) +++ head/sys/dev/acpica/acpi.c Wed Apr 20 21:21:47 2016 (r298377) @@ -2482,7 +2482,7 @@ acpi_AppendBufferResource(ACPI_BUFFER *b ACPI_STATUS acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid, int revision, int count, - uint32_t *caps, bool query) + uint32_t *caps) { ACPI_OBJECT arg[4]; ACPI_OBJECT_LIST arglist; @@ -2499,7 +2499,6 @@ acpi_EvaluateOSC(ACPI_HANDLE handle, uin arg[3].Type = ACPI_TYPE_BUFFER; arg[3].Buffer.Length = count * sizeof(uint32_t); arg[3].Buffer.Pointer = (uint8_t *)caps; - caps[0] = query ? 1 : 0; return (AcpiEvaluateObject(handle, "_OSC", &arglist, NULL)); } Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed Apr 20 21:15:55 2016 (r298376) +++ head/sys/dev/acpica/acpi_cpu.c Wed Apr 20 21:21:47 2016 (r298377) @@ -391,9 +391,9 @@ acpi_cpu_attach(device_t dev) * Intel Processor Vendor-Specific ACPI Interface Specification. */ if (sc->cpu_features) { + cap_set[0] = 0; cap_set[1] = sc->cpu_features; - status = acpi_EvaluateOSC(sc->cpu_handle, cpu_oscuuid, 1, 2, cap_set, - false); + status = acpi_EvaluateOSC(sc->cpu_handle, cpu_oscuuid, 1, 2, cap_set); if (ACPI_SUCCESS(status)) { if (cap_set[0] != 0) device_printf(dev, "_OSC returned status %#x\n", cap_set[0]); Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Wed Apr 20 21:15:55 2016 (r298376) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Wed Apr 20 21:21:47 2016 (r298377) @@ -306,6 +306,9 @@ acpi_pcib_osc(struct acpi_hpcib_softc *s 0x96, 0x57, 0x74, 0x41, 0xc0, 0x3d, 0xd7, 0x66 }; + /* Query Support Flag */ + cap_set[0] = 0; + /* Support Field: Extended PCI Config Space, MSI */ cap_set[1] = 0x11; @@ -313,7 +316,7 @@ acpi_pcib_osc(struct acpi_hpcib_softc *s cap_set[2] = 0; status = acpi_EvaluateOSC(sc->ap_handle, pci_host_bridge_uuid, 1, - nitems(cap_set), cap_set, false); + nitems(cap_set), cap_set); if (ACPI_FAILURE(status)) { if (status == AE_NOT_FOUND) return; Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Apr 20 21:15:55 2016 (r298376) +++ head/sys/dev/acpica/acpivar.h Wed Apr 20 21:21:47 2016 (r298377) @@ -336,7 +336,7 @@ ACPI_STATUS acpi_FindIndexedResource(ACP ACPI_STATUS acpi_AppendBufferResource(ACPI_BUFFER *buf, ACPI_RESOURCE *res); ACPI_STATUS acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid, - int revision, int count, uint32_t *caps, bool query); + int revision, int count, uint32_t *caps); ACPI_STATUS acpi_OverrideInterruptLevel(UINT32 InterruptNumber); ACPI_STATUS acpi_SetIntrModel(int model); int acpi_ReqSleepState(struct acpi_softc *sc, int state); From owner-svn-src-all@freebsd.org Wed Apr 20 21:23:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A1ACB155C8; Wed, 20 Apr 2016 21:23:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01E701CBE; Wed, 20 Apr 2016 21:23:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KLNhYA093661; Wed, 20 Apr 2016 21:23:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KLNhhJ093658; Wed, 20 Apr 2016 21:23:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604202123.u3KLNhhJ093658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 20 Apr 2016 21:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298378 - head/usr.bin/localedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:23:44 -0000 Author: bapt Date: Wed Apr 20 21:23:42 2016 New Revision: 298378 URL: https://svnweb.freebsd.org/changeset/base/298378 Log: Plug memory leaks Reported by: Coverity CID= 1338535, 1338536, 1338542, 1338569, 1338570 Modified: head/usr.bin/localedef/collate.c head/usr.bin/localedef/time.c Modified: head/usr.bin/localedef/collate.c ============================================================================== --- head/usr.bin/localedef/collate.c Wed Apr 20 21:21:47 2016 (r298377) +++ head/usr.bin/localedef/collate.c Wed Apr 20 21:23:42 2016 (r298378) @@ -502,6 +502,7 @@ define_collsym(char *name) * This should never happen because we are only called * for undefined symbols. */ + free(sym); INTERR; return; } @@ -538,6 +539,7 @@ get_collundef(char *name) if (((ud = calloc(sizeof (*ud), 1)) == NULL) || ((ud->name = strdup(name)) == NULL)) { fprintf(stderr,"out of memory"); + free(ud); return (NULL); } for (i = 0; i < NUM_WT; i++) { @@ -812,6 +814,7 @@ define_collelem(char *name, wchar_t *wcs if ((RB_FIND(elem_by_symbol, &elem_by_symbol, e) != NULL) || (RB_FIND(elem_by_expand, &elem_by_expand, e) != NULL)) { fprintf(stderr, "duplicate collating element definition"); + free(e); return; } RB_INSERT(elem_by_symbol, &elem_by_symbol, e); Modified: head/usr.bin/localedef/time.c ============================================================================== --- head/usr.bin/localedef/time.c Wed Apr 20 21:21:47 2016 (r298377) +++ head/usr.bin/localedef/time.c Wed Apr 20 21:23:42 2016 (r298378) @@ -87,6 +87,7 @@ add_time_str(wchar_t *wcs) case T_ERA_T_FMT: case T_ERA_D_T_FMT: /* Silently ignore it. */ + free(str); break; default: free(str); @@ -139,6 +140,7 @@ add_time_list(wchar_t *wcs) tm.pm = str; } else { fprintf(stderr,"too many list elements"); + free(str); } break; case T_ALT_DIGITS: From owner-svn-src-all@freebsd.org Wed Apr 20 21:27:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29920B156DF; Wed, 20 Apr 2016 21:27:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2D071E73; Wed, 20 Apr 2016 21:27:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KLR0hC093807; Wed, 20 Apr 2016 21:27:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KLR00X093806; Wed, 20 Apr 2016 21:27:00 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201604202127.u3KLR00X093806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 20 Apr 2016 21:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298379 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:27:01 -0000 Author: jkim Date: Wed Apr 20 21:26:59 2016 New Revision: 298379 URL: https://svnweb.freebsd.org/changeset/base/298379 Log: There is no need to use array any more. No functional change. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed Apr 20 21:23:42 2016 (r298378) +++ head/sys/dev/acpica/acpi_cpu.c Wed Apr 20 21:26:59 2016 (r298379) @@ -296,7 +296,7 @@ static int acpi_cpu_attach(device_t dev) { ACPI_BUFFER buf; - ACPI_OBJECT arg[1], *obj; + ACPI_OBJECT arg, *obj; ACPI_OBJECT_LIST arglist; struct pcpu *pcpu_data; struct acpi_cpu_softc *sc; @@ -399,11 +399,11 @@ acpi_cpu_attach(device_t dev) device_printf(dev, "_OSC returned status %#x\n", cap_set[0]); } else { - arglist.Pointer = arg; + arglist.Pointer = &arg; arglist.Count = 1; - arg[0].Type = ACPI_TYPE_BUFFER; - arg[0].Buffer.Length = sizeof(cap_set); - arg[0].Buffer.Pointer = (uint8_t *)cap_set; + arg.Type = ACPI_TYPE_BUFFER; + arg.Buffer.Length = sizeof(cap_set); + arg.Buffer.Pointer = (uint8_t *)cap_set; cap_set[0] = 1; /* revision */ cap_set[1] = 1; /* number of capabilities integers */ cap_set[2] = sc->cpu_features; From owner-svn-src-all@freebsd.org Wed Apr 20 21:30:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A0F5B157D8; Wed, 20 Apr 2016 21:30:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 258981132; Wed, 20 Apr 2016 21:30:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KLUuHB093981; Wed, 20 Apr 2016 21:30:56 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KLUuLS093980; Wed, 20 Apr 2016 21:30:56 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201604202130.u3KLUuLS093980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 20 Apr 2016 21:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298380 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:30:57 -0000 Author: jkim Date: Wed Apr 20 21:30:56 2016 New Revision: 298380 URL: https://svnweb.freebsd.org/changeset/base/298380 Log: Prefer sizeof(*pointer) over sizeof(type). No funtional change. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Apr 20 21:26:59 2016 (r298379) +++ head/sys/dev/acpica/acpi.c Wed Apr 20 21:30:56 2016 (r298380) @@ -2497,7 +2497,7 @@ acpi_EvaluateOSC(ACPI_HANDLE handle, uin arg[2].Type = ACPI_TYPE_INTEGER; arg[2].Integer.Value = count; arg[3].Type = ACPI_TYPE_BUFFER; - arg[3].Buffer.Length = count * sizeof(uint32_t); + arg[3].Buffer.Length = count * sizeof(*caps); arg[3].Buffer.Pointer = (uint8_t *)caps; return (AcpiEvaluateObject(handle, "_OSC", &arglist, NULL)); } From owner-svn-src-all@freebsd.org Wed Apr 20 21:32:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B863B15956; Wed, 20 Apr 2016 21:32:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 123C513AC; Wed, 20 Apr 2016 21:32:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KLWYBd096651; Wed, 20 Apr 2016 21:32:34 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KLWYMK096650; Wed, 20 Apr 2016 21:32:34 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604202132.u3KLWYMK096650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 20 Apr 2016 21:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298381 - head/usr.sbin/mpsutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:32:35 -0000 Author: bapt Date: Wed Apr 20 21:32:34 2016 New Revision: 298381 URL: https://svnweb.freebsd.org/changeset/base/298381 Log: Plug various resources leak While here fix a test logic Reported by: coverity CID: 1332096, 1332097, 1332098, 1332099, 1332100, 1332101, 1332102 MFC after: 1 week Modified: head/usr.sbin/mpsutil/mps_show.c Modified: head/usr.sbin/mpsutil/mps_show.c ============================================================================== --- head/usr.sbin/mpsutil/mps_show.c Wed Apr 20 21:30:56 2016 (r298380) +++ head/usr.sbin/mpsutil/mps_show.c Wed Apr 20 21:32:34 2016 (r298381) @@ -139,15 +139,19 @@ show_adapter(int ac, char **av) if (sas0 == NULL) { error = errno; warn("Error retrieving SAS IO Unit page %d", IOCStatus); + free(sas0); + close(fd); return (error); } sas1 = mps_read_extended_config_page(fd, MPI2_CONFIG_EXTPAGETYPE_SAS_IO_UNIT, MPI2_SASIOUNITPAGE1_PAGEVERSION, 1, 0, &IOCStatus); - if (sas0 == NULL) { + if (sas1 == NULL) { error = errno; warn("Error retrieving SAS IO Unit page %d", IOCStatus); + free(sas0); + close(fd); return (error); } printf("\n"); @@ -266,12 +270,14 @@ show_adapters(int ac, char **av) error = errno; warn("Failed to get controller info"); close(fd); + free(facts); return (error); } if (man0->Header.PageLength < sizeof(*man0) / 4) { warnx("Invalid controller info"); close(fd); free(man0); + free(facts); return (EINVAL); } printf("/dev/mp%s%d\t%16s %16s %08x\n", @@ -476,6 +482,7 @@ show_devices(int ac, char **av) break; error = errno; warn("Error retrieving device page"); + close(fd); return (error); } handle = device->DevHandle; @@ -515,6 +522,8 @@ show_devices(int ac, char **av) error = errno; warn("Error retrieving expander page 1: 0x%x", IOCStatus); + close(fd); + free(device); return (error); } speed = " "; @@ -579,6 +588,7 @@ show_enclosures(int ac, char **av) break; error = errno; warn("Error retrieving enclosure page"); + close(fd); return (error); } type = get_enc_type(enc->Flags, &issep); @@ -629,6 +639,7 @@ show_expanders(int ac, char **av) break; error = errno; warn("Error retrieving expander page 0"); + close(fd); return (error); } @@ -766,6 +777,7 @@ show_cfgpage(int ac, char **av) printf("Page 0x%x: %s %d, %s\n", page, pgname, num, pgattr); hexdump(data, len, NULL, HD_REVERSED | 4); free(data); + close(fd); return (0); } From owner-svn-src-all@freebsd.org Wed Apr 20 21:37:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F1DFB15B31; Wed, 20 Apr 2016 21:37:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E9031822; Wed, 20 Apr 2016 21:37:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KLbWAc096893; Wed, 20 Apr 2016 21:37:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KLbW45096892; Wed, 20 Apr 2016 21:37:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604202137.u3KLbW45096892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 20 Apr 2016 21:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298382 - head/usr.sbin/sesutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:37:33 -0000 Author: bapt Date: Wed Apr 20 21:37:32 2016 New Revision: 298382 URL: https://svnweb.freebsd.org/changeset/base/298382 Log: Plug memory leak Reported by: coverity CID: 1331664, 1331665 Modified: head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Wed Apr 20 21:32:34 2016 (r298381) +++ head/usr.sbin/sesutil/sesutil.c Wed Apr 20 21:37:32 2016 (r298382) @@ -272,6 +272,7 @@ sesled(int argc, char **argv, bool setfa } } } + free(objp); close(fd); } globfree(&g); @@ -424,6 +425,7 @@ objmap(int argc, char **argv __unused) sbuf_delete(extra); free(e_devname.elm_devnames); } + free(e_ptr); close(fd); } globfree(&g); From owner-svn-src-all@freebsd.org Wed Apr 20 22:27:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D366B16F9A; Wed, 20 Apr 2016 22:27:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F11E10D9; Wed, 20 Apr 2016 22:27:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 064F7B918; Wed, 20 Apr 2016 18:27:26 -0400 (EDT) From: John Baldwin To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298377 - head/sys/dev/acpica Date: Wed, 20 Apr 2016 15:27:21 -0700 Message-ID: <2347008.OyWmM6azol@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604202121.u3KLLllG091567@repo.freebsd.org> References: <201604202121.u3KLLllG091567@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 20 Apr 2016 18:27:26 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 22:27:27 -0000 On Wednesday, April 20, 2016 09:21:47 PM Jung-uk Kim wrote: > Author: jkim > Date: Wed Apr 20 21:21:47 2016 > New Revision: 298377 > URL: https://svnweb.freebsd.org/changeset/base/298377 > > Log: > Remove query flag from acpi_EvaluateOSC(). This function does not support > return buffer (yet). Hmm, I should probably fix that then instead? The PCI variant is (now) incorrectly assuming it gets the buffer back in the array it passed in. The 5.0 spec at least says that the returned values are identical in length to the array passed in. We could either add a new parameter for the outputs or copy them to the inputs. Perhaps the former is better? I'd still prefer to set caps[0] in the common code since it is not UUID-specific but something all _OSC callers have to do. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Apr 20 22:27:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62608B16F9D; Wed, 20 Apr 2016 22:27:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 444D610DB; Wed, 20 Apr 2016 22:27:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5B03DB98D; Wed, 20 Apr 2016 18:27:27 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298372 - head/sys/dev/acpica Date: Wed, 20 Apr 2016 15:21:11 -0700 Message-ID: <63608115.rabsQY3fcH@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604202058.u3KKwU4F084713@repo.freebsd.org> References: <201604202058.u3KKwU4F084713@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 20 Apr 2016 18:27:27 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 22:27:28 -0000 On Wednesday, April 20, 2016 08:58:30 PM John Baldwin wrote: > Author: jhb > Date: Wed Apr 20 20:58:30 2016 > New Revision: 298372 > URL: https://svnweb.freebsd.org/changeset/base/298372 > > Log: > Invoke _OSC on Host-PCI bridges. > > Tell the firmware that we support PCI-express config space access > and MSI. We should perhaps have some constants for some of the _OSC related fields. I'm surprised ACPI-CA doesn't include constants for at least the return values in the first word _OSC returns since that is defined by ACPI and common to all the different _OSC variants. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Apr 20 22:35:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52DE7B1541E; Wed, 20 Apr 2016 22:35:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D99C7180F; Wed, 20 Apr 2016 22:35:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r298377 - head/sys/dev/acpica To: John Baldwin References: <201604202121.u3KLLllG091567@repo.freebsd.org> <2347008.OyWmM6azol@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim Message-ID: Date: Wed, 20 Apr 2016 18:35:42 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <2347008.OyWmM6azol@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IvcrD46UlnST3vnPuFVsRpv777TQjFpKr" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 22:35:43 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IvcrD46UlnST3vnPuFVsRpv777TQjFpKr Content-Type: multipart/mixed; boundary="cXJvhqlrJF1ec4isfFbLHqkGTQnmS0mWJ" From: Jung-uk Kim To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r298377 - head/sys/dev/acpica References: <201604202121.u3KLLllG091567@repo.freebsd.org> <2347008.OyWmM6azol@ralph.baldwin.cx> In-Reply-To: <2347008.OyWmM6azol@ralph.baldwin.cx> --cXJvhqlrJF1ec4isfFbLHqkGTQnmS0mWJ Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 04/20/16 06:27 PM, John Baldwin wrote: > On Wednesday, April 20, 2016 09:21:47 PM Jung-uk Kim wrote: >> Author: jkim >> Date: Wed Apr 20 21:21:47 2016 >> New Revision: 298377 >> URL: https://svnweb.freebsd.org/changeset/base/298377 >> >> Log: >> Remove query flag from acpi_EvaluateOSC(). This function does not s= upport >> return buffer (yet). >=20 > Hmm, I should probably fix that then instead? The PCI variant is (now)= > incorrectly assuming it gets the buffer back in the array it passed in.= > The 5.0 spec at least says that the returned values are identical in > length to the array passed in. We could either add a new parameter for= > the outputs or copy them to the inputs. Perhaps the former is better? Yes and yes. > I'd still prefer to set caps[0] in the common code since it is not > UUID-specific but something all _OSC callers have to do. Agreed iff we implement the return buffer. Jung-uk Kim --cXJvhqlrJF1ec4isfFbLHqkGTQnmS0mWJ-- --IvcrD46UlnST3vnPuFVsRpv777TQjFpKr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXGAQ+AAoJEHyflib82/FGkc8H+wYbBgQCLfTzXog501pG1+Se Nl+7B8BKVTWluhD7kd9Qa7K6TLU3Yzfw7EaGDRWVkBXg5o0VoRe+ajnBxmrpxbuD DzSwjm+rsKGxgkNyXqZQAZqqvcc7dqlB9XHZ5pFRIKIca7Hn+vb192//kEpQ9Q5f 2flojHLT6VwH4HsK2ll6Y7Z9Gaa5GLAPxOy5VQ+Z+4vYQSyIpWH6+iBIRIMndoSM Qh6KF/+IjAqSgDtmZWtnaPSPXsJzO5PkKNYViUQ1s7NXoaQGehbM/gSuChiOIXqd HQTmIppCQwUCkcnRgYwOlXf/Ojrt2+aUujIGERLpjGfU0Z9KOeJCIy4c9LHnlIk= =odKD -----END PGP SIGNATURE----- --IvcrD46UlnST3vnPuFVsRpv777TQjFpKr-- From owner-svn-src-all@freebsd.org Wed Apr 20 22:38:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAEBDB15566; Wed, 20 Apr 2016 22:38:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B69561A00; Wed, 20 Apr 2016 22:38:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KMc0PE015404; Wed, 20 Apr 2016 22:38:00 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KMc0pF015399; Wed, 20 Apr 2016 22:38:00 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604202238.u3KMc0pF015399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 20 Apr 2016 22:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298383 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 22:38:02 -0000 Author: gonzo Date: Wed Apr 20 22:38:00 2016 New Revision: 298383 URL: https://svnweb.freebsd.org/changeset/base/298383 Log: Force framebuffer virtual viewport to be the same as physical VideoCore reports garbage in viewport geometry fields unless viewport was set previously by earlier stage boot loader. So when booting FreeBSD kernel directly from VideoCore's start.elf framebuffer intialization fails due to invalid vxres, vyres values. Make sure we request viewport to be equal to physical resolution Submitted by: Sylvain Garrigues Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Apr 20 21:37:32 2016 (r298382) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Apr 20 22:38:00 2016 (r298383) @@ -149,6 +149,9 @@ bcm_fb_attach(device_t dev) if (bcm2835_mbox_fb_get_w_h(&fb) != 0) return (ENXIO); fb.bpp = FB_DEPTH; + fb.vxres = fb.xres; + fb.vyres = fb.yres; + fb.xoffset = fb.yoffset = 0; if (bcm2835_mbox_fb_init(&fb) != 0) return (ENXIO); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Apr 20 21:37:32 2016 (r298382) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Apr 20 22:38:00 2016 (r298383) @@ -80,6 +80,10 @@ bcm_fb_init(struct bcmsc_softc *sc, stru return (ENXIO); fb->bpp = FB_DEPTH; + fb->vxres = fb->xres; + fb->vyres = fb->yres; + fb->xoffset = fb->yoffset = 0; + if ((err = bcm2835_mbox_fb_init(fb)) != 0) { device_printf(sc->dev, "bcm2835_mbox_fb_init failed, err=%d\n", err); return (ENXIO); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Wed Apr 20 21:37:32 2016 (r298382) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Wed Apr 20 22:38:00 2016 (r298383) @@ -475,20 +475,12 @@ bcm2835_mbox_fb_get_w_h(struct bcm2835_f msg.hdr.code = BCM2835_MBOX_CODE_REQ; BCM2835_MBOX_INIT_TAG(&msg.physical_w_h, GET_PHYSICAL_W_H); msg.physical_w_h.tag_hdr.val_len = 0; - BCM2835_MBOX_INIT_TAG(&msg.virtual_w_h, GET_VIRTUAL_W_H); - msg.virtual_w_h.tag_hdr.val_len = 0; - BCM2835_MBOX_INIT_TAG(&msg.offset, GET_VIRTUAL_OFFSET); - msg.offset.tag_hdr.val_len = 0; msg.end_tag = 0; err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err == 0) { fb->xres = msg.physical_w_h.body.resp.width; fb->yres = msg.physical_w_h.body.resp.height; - fb->vxres = msg.virtual_w_h.body.resp.width; - fb->vyres = msg.virtual_w_h.body.resp.height; - fb->xoffset = msg.offset.body.resp.x; - fb->yoffset = msg.offset.body.resp.y; } return (err); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Wed Apr 20 21:37:32 2016 (r298382) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Wed Apr 20 22:38:00 2016 (r298383) @@ -469,8 +469,6 @@ struct bcm2835_fb_config { struct msg_fb_get_w_h { struct bcm2835_mbox_hdr hdr; struct bcm2835_mbox_tag_fb_w_h physical_w_h; - struct bcm2835_mbox_tag_fb_w_h virtual_w_h; - struct bcm2835_mbox_tag_virtual_offset offset; uint32_t end_tag; }; From owner-svn-src-all@freebsd.org Wed Apr 20 22:41:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AB4AB1566F; Wed, 20 Apr 2016 22:41:21 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC5E21C68; Wed, 20 Apr 2016 22:41:20 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KMfKMT017515; Wed, 20 Apr 2016 22:41:20 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KMfKB9017514; Wed, 20 Apr 2016 22:41:20 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201604202241.u3KMfKB9017514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 20 Apr 2016 22:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298384 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 22:41:21 -0000 Author: wma Date: Wed Apr 20 22:41:19 2016 New Revision: 298384 URL: https://svnweb.freebsd.org/changeset/base/298384 Log: Revert r298357 Revert workaround fixed by r298361 Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Apr 20 22:38:00 2016 (r298383) +++ head/sys/conf/kern.post.mk Wed Apr 20 22:41:19 2016 (r298384) @@ -364,8 +364,6 @@ embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} --output-target ${EMBEDFS_FORMAT.${MACHINE_ARCH}} \ --binary-architecture ${EMBEDFS_ARCH.${MACHINE_ARCH}} \ ${MFS_IMAGE} ${.TARGET} - # Provide set of two distinct regexp to work around an elfcopy bug - # fixed in r298361 (last three). ${OBJCOPY} \ --rename-section .data=mfs,contents,alloc,load,readonly,data \ --redefine-sym \ @@ -374,12 +372,6 @@ embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} _binary_${MFS_IMAGE:C,[^[:alnum:]],_,g}_start=mfs_root \ --redefine-sym \ _binary_${MFS_IMAGE:C,[^[:alnum:]],_,g}_end=mfs_root_end \ - --redefine-sym \ - _binary_${MFS_IMAGE:C,[^-/[:alnum:]],_,g}_size=__mfs_root_size \ - --redefine-sym \ - _binary_${MFS_IMAGE:C,[^-/[:alnum:]],_,g}_start=mfs_root \ - --redefine-sym \ - _binary_${MFS_IMAGE:C,[^-/[:alnum:]],_,g}_end=mfs_root_end \ ${.TARGET} .endif .endif From owner-svn-src-all@freebsd.org Wed Apr 20 23:56:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EE2DB16D98; Wed, 20 Apr 2016 23:56:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB04218A8; Wed, 20 Apr 2016 23:56:26 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KNuQiX039195; Wed, 20 Apr 2016 23:56:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KNuQCX039194; Wed, 20 Apr 2016 23:56:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604202356.u3KNuQCX039194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 20 Apr 2016 23:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298385 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 23:56:27 -0000 Author: sephe Date: Wed Apr 20 23:56:25 2016 New Revision: 298385 URL: https://svnweb.freebsd.org/changeset/base/298385 Log: dhclient: Log a warning instead of bailing upon "illegal" options In Azure, the DHCP servers add private option (id 0xf5), which contains binary form of an IPv4 address. Once this option is converted to string form, it could contain '$', e.g. IPv4 address: 100.72.36.54 binary form: 0x64 0x48 0x24 0x36 string form: "dH$6" dhclient bails upon "illegal" options like the above example, thus the VM bring-up will fail. Also as a side note, this "illegal" option detection was added in OpenBSD ~11years ago: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.50&content-type=text/x-cvsweb-markup And it was removed along with the removal of script support in OpenBSD ~3years ago: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.159&content-type=text/x-cvsweb-markup Reported by: Hongxiong Xian Reviewed by: jhb, Dexuan Cui Tested by: Hongxiong Xian Analyzed by: Dong Liu MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5853 Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Apr 20 22:41:19 2016 (r298384) +++ head/sbin/dhclient/dhclient.c Wed Apr 20 23:56:25 2016 (r298385) @@ -2275,6 +2275,17 @@ script_set_env(struct client_state *clie { int i, j, namelen; + /* No `` or $() command substitution allowed in environment values! */ + for (j=0; j < strlen(value); j++) + switch (value[j]) { + case '`': + case '$': + warning("illegal character (%c) in value '%s'", + value[j], value); + /* Ignore this option */ + return; + } + namelen = strlen(name); for (i = 0; client->scriptEnv[i]; i++) @@ -2311,16 +2322,6 @@ script_set_env(struct client_state *clie strlen(value) + 1); if (client->scriptEnv[i] == NULL) error("script_set_env: no memory for variable assignment"); - - /* No `` or $() command substitution allowed in environment values! */ - for (j=0; j < strlen(value); j++) - switch (value[j]) { - case '`': - case '$': - error("illegal character (%c) in value '%s'", value[j], - value); - /* not reached */ - } snprintf(client->scriptEnv[i], strlen(prefix) + strlen(name) + 1 + strlen(value) + 1, "%s%s=%s", prefix, name, value); } From owner-svn-src-all@freebsd.org Thu Apr 21 01:08:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84769B16678 for ; Thu, 21 Apr 2016 01:08:29 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f194.google.com (mail-lb0-f194.google.com [209.85.217.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19B4C1738 for ; Thu, 21 Apr 2016 01:08:28 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lb0-f194.google.com with SMTP id ot1so2278436lbb.0 for ; Wed, 20 Apr 2016 18:08:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=mQ4wPc7nPx18qgbDAore35XVCGwyK6ZHd6ybNzPhG5E=; b=X5SCcC6VulVjjYD2M3ac7wN31Yh/zLfSwsWa5z7j+K7yHm4n3g8TvlFRlj8R0iw+Is nWF8j37dwDm1SA9B1bPnzjlQtixlJvGHp8pI//f7mjXokbm1KtW944Ri5zC2RKIBYiVC 52Hq9fP2Gler/L/nJ4ogCorZoi9r8wQnu3XOO7Emsml1pqstdiw+hLiMoh4kvVeqmujx Ezt2wDb0HZfyi3yHnA/ZZfOYAogFqM/vbVBkMN5Sa4caKBpOAREpGp4ZQJ1IdsmaQa4h cGOBcVip9ddajFR6Btaar1xYEoF5SO3uExpGkD2K92n4GLb1gSgE7O0MX/MX4t/gNQv3 HELg== X-Gm-Message-State: AOPr4FU4CNYgAqqb/w7GzFd9XMEY14Vt+svLuTqnJf9xIJmlCB/C+JUh9jhNIxibP76IEw== X-Received: by 10.112.28.75 with SMTP id z11mr4920557lbg.40.1461200230902; Wed, 20 Apr 2016 17:57:10 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id q13sm23179lfi.21.2016.04.20.17.57.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2016 17:57:10 -0700 (PDT) Subject: Re: svn commit: r298367 - head/lib/libc/locale To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604202044.u3KKiUMq081452@repo.freebsd.org> From: Andrey Chernov Message-ID: Date: Thu, 21 Apr 2016 03:57:09 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201604202044.u3KKiUMq081452@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 01:08:29 -0000 On 20.04.2016 23:44, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Apr 20 20:44:30 2016 > New Revision: 298367 > URL: https://svnweb.freebsd.org/changeset/base/298367 > > Log: > Check the returned value of memchr(3) before using it > > Reported by: Coverity > CID: 1338530 > > Modified: > head/lib/libc/locale/ascii.c > > Modified: head/lib/libc/locale/ascii.c > ============================================================================== > --- head/lib/libc/locale/ascii.c Wed Apr 20 20:43:05 2016 (r298366) > +++ head/lib/libc/locale/ascii.c Wed Apr 20 20:44:30 2016 (r298367) > @@ -133,11 +133,14 @@ _ascii_mbsnrtowcs(wchar_t * __restrict d > > if (dst == NULL) { > s = memchr(*src, '\0', nms); > + if (s == NULL) > + return (nms); > + > if (*s & 0x80) { > errno = EILSEQ; > return ((size_t)-1); > } > - return (s != NULL ? s - *src : nms); > + return (s - *src); > } > > s = *src; > The whole code is incorrect, only the very first char is checked, there must be a loop like in -stable: if (dst == NULL) { for (s = *src; nms > 0 && *s != '\0'; s++, nms--) { if (*s & 0x80) { errno = EILSEQ; return ((size_t)-1); } } return (s - *src); } Since svn history is lost on deleting, I don't know why incorrect version was committed. From owner-svn-src-all@freebsd.org Thu Apr 21 02:17:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68BC7B175D5 for ; Thu, 21 Apr 2016 02:17:10 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1C111FEA for ; Thu, 21 Apr 2016 02:17:09 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f68.google.com with SMTP id o124so6795020lfb.2 for ; Wed, 20 Apr 2016 19:17:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=/E5o9fctubXEWf6L0MhEzi0iY18M2RAyZmRYzpj8pW0=; b=OleE2DiZTkgjOwc6feocvFil06F9efCeaMWUF5TN3jgVeyCng30AR4Qays2WR+uGaW nxTLZfw1pbPF6Fy86T+c8vZCpdwhnddf6twLMbwimWGowrLLSBE/S3Rw7gq799Q0lJ0u v6iQKhp9/JbPdsb21RxD+hBVC1Itr+3HgKJL3gyF1KQ9vfEzAEuI4E7zI/fhMZC7oGaB g9lQ0eE82Ed2+IppwGvjbsYKNuPoxq9qX5fUpTktoQYV4w/aLuF/kmWY9wjigUZAUUXR uhKhT34wDHGnUjS/JvhCu7pjP6ydRS66gM8znGX33jlSHReL43WyYAEXm9hwaKIwuPjl qxsQ== X-Gm-Message-State: AOPr4FXxegLtMI43eqM5FHwl+Pi5LkD4QKQcQKfjxJvuNcdG8/BMszDDF33UgW0Aw6pXog== X-Received: by 10.25.161.17 with SMTP id k17mr4273380lfe.61.1461204022391; Wed, 20 Apr 2016 19:00:22 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id o66sm55624lfg.32.2016.04.20.19.00.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2016 19:00:21 -0700 (PDT) Subject: Re: svn commit: r298367 - head/lib/libc/locale To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604202044.u3KKiUMq081452@repo.freebsd.org> From: Andrey Chernov Message-ID: Date: Thu, 21 Apr 2016 05:00:20 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 02:17:10 -0000 On 21.04.2016 3:57, Andrey Chernov wrote: > On 20.04.2016 23:44, Baptiste Daroussin wrote: >> Author: bapt >> Date: Wed Apr 20 20:44:30 2016 >> New Revision: 298367 >> URL: https://svnweb.freebsd.org/changeset/base/298367 >> >> Log: >> Check the returned value of memchr(3) before using it >> >> Reported by: Coverity >> CID: 1338530 >> >> Modified: >> head/lib/libc/locale/ascii.c >> >> Modified: head/lib/libc/locale/ascii.c >> ============================================================================== >> --- head/lib/libc/locale/ascii.c Wed Apr 20 20:43:05 2016 (r298366) >> +++ head/lib/libc/locale/ascii.c Wed Apr 20 20:44:30 2016 (r298367) >> @@ -133,11 +133,14 @@ _ascii_mbsnrtowcs(wchar_t * __restrict d >> >> if (dst == NULL) { >> s = memchr(*src, '\0', nms); >> + if (s == NULL) >> + return (nms); >> + >> if (*s & 0x80) { >> errno = EILSEQ; >> return ((size_t)-1); >> } >> - return (s != NULL ? s - *src : nms); >> + return (s - *src); >> } >> >> s = *src; >> > > The whole code is incorrect, only the very first char is checked, there > must be a loop like in -stable: > > if (dst == NULL) { > for (s = *src; nms > 0 && *s != '\0'; s++, nms--) { > if (*s & 0x80) { > errno = EILSEQ; > return ((size_t)-1); > } > } > return (s - *src); > } > > Since svn history is lost on deleting, I don't know why incorrect > version was committed. > Typo, the very first == the very last, i.e. only NUL char is checked which always pass. From owner-svn-src-all@freebsd.org Thu Apr 21 03:17:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15ECCB159EF; Thu, 21 Apr 2016 03:17:55 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D07C510A5; Thu, 21 Apr 2016 03:17:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L3HrGE099614; Thu, 21 Apr 2016 03:17:53 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L3HrLl099613; Thu, 21 Apr 2016 03:17:53 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201604210317.u3L3HrLl099613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 21 Apr 2016 03:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298386 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 03:17:55 -0000 Author: gnn Date: Thu Apr 21 03:17:53 2016 New Revision: 298386 URL: https://svnweb.freebsd.org/changeset/base/298386 Log: Add the address at which the routine returned. MFC after: 1 week Sponsored by: Rubicon Communications (Netgate) Modified: head/share/dtrace/retval Modified: head/share/dtrace/retval ============================================================================== --- head/share/dtrace/retval Wed Apr 20 23:56:25 2016 (r298385) +++ head/share/dtrace/retval Thu Apr 21 03:17:53 2016 (r298386) @@ -37,6 +37,6 @@ #pragma D option quiet fbt::$1:return { - printf("%s %d\n", probefunc, arg1); + printf("%s+0x%x returned %d\n", probefunc, arg0, arg1); } From owner-svn-src-all@freebsd.org Thu Apr 21 04:09:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7F5CB149E2; Thu, 21 Apr 2016 04:09:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com [IPv6:2a00:1450:4010:c04::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F958137B; Thu, 21 Apr 2016 04:09:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x234.google.com with SMTP id u8so20183394lbk.0; Wed, 20 Apr 2016 21:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=K24zSQLShz19rejK36H307mh3tWFQDRfIi0punTetno=; b=gvakEd8KWj7Hjk2dELWbClbWklZztzKC/R7n8EBncM+tj617nOZ4Jzy5JmchGW8xIQ vGU5ahWQqhYvV/4oSi1hFV/osYFoIo2QPTUiXohcJ+uqAcq75jC9zr4d5fhkI2ruwSiD 8GdJsQz7DKAciVZs87bgnfrZek1zdiS7Qsw8cGanMU6bmOC7+DNx0J+ySm7EVLkDv6ss to0xAceaXCiv5mOyjoGDauupRO2y5SOXXPMewVx7wYw5lkt2AiLOHIUBN47hq3Pp6n0Y nKVzZ85BlDzKJCWmBe5cCTTuFzUO8L3dcX4SDCROLdRE3fObiLArct95ok35G5f2q/AV W2Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=K24zSQLShz19rejK36H307mh3tWFQDRfIi0punTetno=; b=R30dH32x7+y23RaUi+4r/q+/z2n5cbUz4c2s2Q7lakgT/h9aeb1Cpt2VHUrAhkNZCK nVBkFDi79NUZNUZ+OJHlipMRcAB2gTZ+gwcjNhIyehIGIbbaj+daqvaVfJjn/eGy4fc4 6T3iMxGLgYioFzF30wtyny6bU2ShEoSCWC2onxhPZYYeXwNvhYKXbASatvHDWdD8hItS TyeXeFK1jJVNyMOBtROrZRLmUKLEKi38WMja4hF/Z/MS6LxHb0/VtizaVevupzJoqhsK X327ovwrMrtxjPzhyATYN5DUxwNdP/kk77n80jh5Cg0gIuw3xyaUZT8Dlvw9xbm1gswD fpbA== X-Gm-Message-State: AOPr4FUDwBt2Y52SNzybadV44ka6AGiozR62xWL3Ul6LN/WlZSpHyPnzUP2HL5UwyHVdcpQRJ6LyX3XTg7ebWQ== MIME-Version: 1.0 X-Received: by 10.112.171.74 with SMTP id as10mr1735729lbc.139.1461211796513; Wed, 20 Apr 2016 21:09:56 -0700 (PDT) Received: by 10.112.236.33 with HTTP; Wed, 20 Apr 2016 21:09:56 -0700 (PDT) In-Reply-To: <201604202111.u3KLBnWs089824@repo.freebsd.org> References: <201604202111.u3KLBnWs089824@repo.freebsd.org> Date: Wed, 20 Apr 2016 21:09:56 -0700 Message-ID: Subject: Re: svn commit: r298374 - head/usr.sbin/mpsutil From: Ngie Cooper To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 04:10:00 -0000 On Wed, Apr 20, 2016 at 2:11 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Apr 20 21:11:49 2016 > New Revision: 298374 > URL: https://svnweb.freebsd.org/changeset/base/298374 > > Log: > Plug leaks > > Reported by: Coverity > CID: 1340155 and 1340156 > MFC after: 1 week This could have been simplified via a strategically placed goto... From owner-svn-src-all@freebsd.org Thu Apr 21 04:11:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D54ABB14B8F; Thu, 21 Apr 2016 04:11:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com [IPv6:2a00:1450:4010:c04::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DB101738; Thu, 21 Apr 2016 04:11:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x22b.google.com with SMTP id os9so20173639lbb.2; Wed, 20 Apr 2016 21:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=dYhewLN0gT8alHcrXiwXTTvCU9et/7NyplvtOlN/w6Y=; b=BslnoQ0MvPy9TadVR6LcsTYhvtlfNQzrJKh/5EQ4tIiAOlR/vvMF79uRtvg5un8NVF BY7oygI1klEp70nzC4TjH/xVutzUkrC2xCUsLxzLUL05GeT4szUFZ0EjBL60F2XXyFf8 0UmyjgTyrTrUCX4zL1up8ShSMMNGDqgehZn2gmIvz4WCX4h83a0vxIbWM3o/8ul4GJHW WnoBgbjjbjWT2wNxxa8rCTIR1LPiFK4CH8iqzvvWWM7vhBVXnn12BhdOiLgnS9s6RJXP EZWNaY7QelYzOXjgQXYIa3j9XycB/C2mac5AEnNI2m/XdeRhQwGJg2n2wnoKB7WzgJnJ n2ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=dYhewLN0gT8alHcrXiwXTTvCU9et/7NyplvtOlN/w6Y=; b=NwZRaO0dWUkJu7XUUGTCo77shWuTMU/s0IyvNgZtzjAsfDqW4aGs1FhvWr5qcoqSxg pD9Yt1eK+7YsA+vTmufrXfW7wtTFWz+wtkuk7bunzK0EFKykzQBAbzC6M9wZAVwCO3J+ eOrF/Nto+nqrCaHgJG/J1d84XPf4JqrM4rHQgEOQ/T4dEFTJ4ryeD1YQj3s/YG1nSwQf HvKjb3nLOPcVrqgHuwFp/i7hmym53S4VDtOI/b/VZWhiAYjt4DSWKXbOsVpKQsz26MNH jWuRcwAG3+BvKYmSUfn9EUVlsWUU0HndWVBCawbBxh1GVPnJHXJ/OKM4sRdhWP72rNEP 5OiA== X-Gm-Message-State: AOPr4FVkNRNdnqjF9UtBVz1BWRZ27Va6J2jVtDO2uKzhnPUCMAtE7LVkcehgFOz9oF9O96BgltEQGGNAl47+Vg== MIME-Version: 1.0 X-Received: by 10.112.52.196 with SMTP id v4mr4626781lbo.59.1461211899614; Wed, 20 Apr 2016 21:11:39 -0700 (PDT) Received: by 10.112.236.33 with HTTP; Wed, 20 Apr 2016 21:11:39 -0700 (PDT) In-Reply-To: <201604202132.u3KLWYMK096650@repo.freebsd.org> References: <201604202132.u3KLWYMK096650@repo.freebsd.org> Date: Wed, 20 Apr 2016 21:11:39 -0700 Message-ID: Subject: Re: svn commit: r298381 - head/usr.sbin/mpsutil From: Ngie Cooper To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 04:11:41 -0000 On Wed, Apr 20, 2016 at 2:32 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Apr 20 21:32:34 2016 > New Revision: 298381 > URL: https://svnweb.freebsd.org/changeset/base/298381 > > Log: ... > While here fix a test logic Which was testing `sas1 == NULL`, but I can't figure that out without looking at the diff. From owner-svn-src-all@freebsd.org Thu Apr 21 04:33:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 798BEB16356; Thu, 21 Apr 2016 04:33:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49C4C1070; Thu, 21 Apr 2016 04:33:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L4X79w023081; Thu, 21 Apr 2016 04:33:07 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L4X7oc023080; Thu, 21 Apr 2016 04:33:07 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201604210433.u3L4X7oc023080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 21 Apr 2016 04:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298387 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 04:33:08 -0000 Author: eadler Date: Thu Apr 21 04:33:07 2016 New Revision: 298387 URL: https://svnweb.freebsd.org/changeset/base/298387 Log: Remove project.name which is a product of a bygone era. Modified: head/.arcconfig Modified: head/.arcconfig ============================================================================== --- head/.arcconfig Thu Apr 21 03:17:53 2016 (r298386) +++ head/.arcconfig Thu Apr 21 04:33:07 2016 (r298387) @@ -1,5 +1,4 @@ { - "project.name": "S", "repository.callsign" : "S", "phabricator.uri" : "https://reviews.freebsd.org/", "history.immutable" : true From owner-svn-src-all@freebsd.org Thu Apr 21 04:48:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE16CB16874 for ; Thu, 21 Apr 2016 04:48:43 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CFEA18FB for ; Thu, 21 Apr 2016 04:48:43 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-wm0-x243.google.com with SMTP id n3so18613952wmn.1 for ; Wed, 20 Apr 2016 21:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lcxCx9o/rXTCJUDDYBA4nWw+YWnrNK9e4F0LDhOmh2c=; b=Up6e4D2N1y8FrkbXnlkNeTgZZdDI/vaoE9sKxwiECRUL1owJyF4UCeCpVyZ1ZPv/UP 8HSxZdyNe7/PXrK8GSqe0ML2vNZdaA8UnI9uSQt7Q0TbmmaqRLWDYd8WcBR/dXT2WSAQ u/vevtTu8lNZKDNIkstCs1oloe2YS6NG6ort4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lcxCx9o/rXTCJUDDYBA4nWw+YWnrNK9e4F0LDhOmh2c=; b=C/dXendIq4KgIyMbvjCSxZ0JB5rB743un7B00taX0L9jX0H6E5TGn7pSAVFd/NSMUE 5JLETKLUaGC2gD/ZK0ey8faRWb1xzg2K5fmr0ACddJa95n3emwvvf3yT2rvdvzqd05lS LVG2gQ1WEmLKMYWTkvTjQoZXHUGqdmsdqRyghOhse6LAwFr+VIKYRrD4XsVfT/xH9k2H EdqoMOGVaQFE8e6qnl6i9Ru6eQkv/ZgD1YdsxBu29szwClmIQczXBAwVPDVdXSbfymbv XaDQ3oLZkU7D0A9+LVURi/ELOX/2Vvjzq6Iy2WBHbN6mGJo8u7uSfWSx+ezkwyFdHVRP AxNA== X-Gm-Message-State: AOPr4FUJiwnCsqnp1iq0MfNYEcG3Vc/15b21JPtToo9/psuCyDdC4t7E2ZvC8vKDOUW/11mcLbmqKJDhM5abFg== X-Received: by 10.194.143.51 with SMTP id sb19mr12068763wjb.98.1461214121842; Wed, 20 Apr 2016 21:48:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.31.8 with HTTP; Wed, 20 Apr 2016 21:48:12 -0700 (PDT) In-Reply-To: <201604190728.u3J7SdSf098835@repo.freebsd.org> References: <201604190728.u3J7SdSf098835@repo.freebsd.org> From: Eitan Adler Date: Wed, 20 Apr 2016 21:48:12 -0700 Message-ID: Subject: Re: svn commit: r298257 - head/usr.bin/units To: Xin LI Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 04:48:43 -0000 On 19 April 2016 at 00:28, Xin LI wrote: > Author: delphij > Date: Tue Apr 19 07:28:39 2016 > New Revision: 298257 > URL: https://svnweb.freebsd.org/changeset/base/298257 > > Log: > Fix build breakage introduced by r298253. Thanks! I forgot to commit this file. -- Eitan Adler From owner-svn-src-all@freebsd.org Thu Apr 21 05:24:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30D7CB16BC9; Thu, 21 Apr 2016 05:24:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E224F1E70; Thu, 21 Apr 2016 05:24:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L5OmMj038341; Thu, 21 Apr 2016 05:24:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L5Ol00038339; Thu, 21 Apr 2016 05:24:47 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201604210524.u3L5Ol00038339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 21 Apr 2016 05:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298388 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 05:24:49 -0000 Author: eadler Date: Thu Apr 21 05:24:47 2016 New Revision: 298388 URL: https://svnweb.freebsd.org/changeset/base/298388 Log: Bring a little more compability with GNU units 2.12 - notionally support a 'history file' flag. This doesn't do much now, but is there to prevent scripts written against GNU units from breaking - correctly gracefully quit rather than exit (this will make it easier to support a history file in the future) - remove the "t" flag from fopen which was there to support windows. We have not supported windows since at the latest, the introduction of capsicum. Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Thu Apr 21 04:33:07 2016 (r298387) +++ head/usr.bin/units/units.1 Thu Apr 21 05:24:47 2016 (r298388) @@ -8,6 +8,7 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar filename +.Op Fl H Ar filename .Op Fl qvUV .Op Ar from-unit to-unit .Sh OPTIONS @@ -17,6 +18,8 @@ The following options are available: Show an overview of options .It Fl f Ar filename No , Fl -file Ar filename Specify the name of the units data file to load. +.It Fl H Ar filename No , Fl -historyfile Ar filename +Ignored, for compatibility with GNU units. .It Fl e , Fl -exponential Behave as if -o '%6e' was typed. .It Fl q No , Fl -quiet Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Thu Apr 21 04:33:07 2016 (r298387) +++ head/usr.bin/units/units.c Thu Apr 21 05:24:47 2016 (r298388) @@ -33,10 +33,8 @@ static const char rcsid[] = #include -#define _PATH_UNITSLIB "/usr/share/misc/definitions.units" - #ifndef UNITSFILE -#define UNITSFILE _PATH_UNITSLIB +#define UNITSFILE "/usr/share/misc/definitions.units" #endif #define MAXUNITS 1000 @@ -47,6 +45,7 @@ static const char rcsid[] = #define PRIMITIVECHAR '!' static const char *powerstring = "^"; +static const char *numfmt = "%.8g"; static struct { char *uname; @@ -128,12 +127,12 @@ readunits(const char *userfile) linenum = 0; if (userfile) { - unitfile = fopen(userfile, "rt"); + unitfile = fopen(userfile, "r"); if (!unitfile) errx(1, "unable to open units file '%s'", userfile); } else { - unitfile = fopen(UNITSFILE, "rt"); + unitfile = fopen(UNITSFILE, "r"); if (!unitfile) { char *direc, *env; char filename[1000]; @@ -255,7 +254,7 @@ showunit(struct unittype * theunit) int printedslash; int counter = 1; - printf("%.8g", theunit->factor); + printf(numfmt, theunit->factor); if (theunit->offset) printf("&%.8g", theunit->offset); for (ptr = theunit->numerator; *ptr; ptr++) { @@ -723,7 +722,7 @@ static void usage(void) { fprintf(stderr, - "usage: units [-f unitsfile] [-UVq] [from-unit to-unit]\n"); + "usage: units [-f unitsfile] [-H historyfile] [-UVq] [from-unit to-unit]\n"); exit(3); } @@ -731,6 +730,7 @@ static struct option longopts[] = { {"help", no_argument, NULL, 'h'}, {"exponential", no_argument, NULL, 'e'}, {"file", required_argument, NULL, 'f'}, + {"history", required_argument, NULL, 'H'}, {"output-format", required_argument, NULL, 'o'}, {"quiet", no_argument, NULL, 'q'}, {"terse", no_argument, NULL, 't'}, @@ -749,15 +749,19 @@ main(int argc, char **argv) int optchar; bool quiet; bool readfile; + bool quit; History *inhistory; EditLine *el; HistEvent ev; int inputsz; + char const * history_file; quiet = false; readfile = false; - outputformat = "%.8g"; - while ((optchar = getopt_long(argc, argv, "+ehf:oqtvUV", longopts, NULL)) != -1) { + history_file = NULL; + outputformat = numfmt; + quit = false; + while ((optchar = getopt_long(argc, argv, "+ehf:oqtvHUV", longopts, NULL)) != -1) { switch (optchar) { case 'e': outputformat = "%6e"; @@ -769,6 +773,9 @@ main(int argc, char **argv) else readunits(optarg); break; + case 'H': + history_file = optarg; + break; case 'q': quiet = true; break; @@ -833,31 +840,41 @@ main(int argc, char **argv) if (!quiet) printf("%d units, %d prefixes\n", unitcount, prefixcount); - for (;;) { + while (!quit) { do { initializeunit(&have); if (!quiet) promptstr = "You have: "; havestr = el_gets(el, &inputsz); - if (havestr == NULL) - exit(0); + if (havestr == NULL) { + quit = true; + break; + } if (inputsz > 0) history(inhistory, &ev, H_ENTER, havestr); } while (addunit(&have, havestr, 0, 1) || completereduce(&have)); + if (quit) { + break; + } do { initializeunit(&want); if (!quiet) promptstr = "You want: "; wantstr = el_gets(el, &inputsz); - if (wantstr == NULL) - exit(0); + if (wantstr == NULL) { + quit = true; + break; + } if (inputsz > 0) history(inhistory, &ev, H_ENTER, wantstr); } while (addunit(&want, wantstr, 0, 1) || completereduce(&want)); + if (quit) { + break; + } showanswer(&have, &want); } From owner-svn-src-all@freebsd.org Thu Apr 21 05:47:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1788B171FB; Thu, 21 Apr 2016 05:47:48 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE3F8180C; Thu, 21 Apr 2016 05:47:48 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L5llhR044474; Thu, 21 Apr 2016 05:47:47 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L5ll5v044470; Thu, 21 Apr 2016 05:47:47 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604210547.u3L5ll5v044470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 21 Apr 2016 05:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298389 - in head/sys: dev/malo dev/mwl net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 05:47:48 -0000 Author: avos Date: Thu Apr 21 05:47:47 2016 New Revision: 298389 URL: https://svnweb.freebsd.org/changeset/base/298389 Log: net80211: enable promiscuous mode state change for non-monitor/ahdemo modes - Allow to enable/disable promiscuous mode when: * interface is not a member of bridge, or; * request was issued by user (ifconfig wlan0 promisc), or; * interface is in MONITOR or AHDEMO mode. - Drop local workarounds in mwl(4) and malo(4). Tested with: - Intel 3945BG, STA mode; - RTL8188CUS, MONITOR mode; Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5472 Modified: head/sys/dev/malo/if_malo.c head/sys/dev/mwl/if_mwl.c head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Thu Apr 21 05:24:47 2016 (r298388) +++ head/sys/dev/malo/if_malo.c Thu Apr 21 05:47:47 2016 (r298389) @@ -1570,14 +1570,7 @@ malo_mode_init(struct malo_softc *sc) struct ieee80211com *ic = &sc->malo_ic; struct malo_hal *mh = sc->malo_mh; - /* - * NB: Ignore promisc in hostap mode; it's set by the - * bridge. This is wrong but we have no way to - * identify internal requests (from the bridge) - * versus external requests such as for tcpdump. - */ - malo_hal_setpromisc(mh, ic->ic_promisc > 0 && - ic->ic_opmode != IEEE80211_M_HOSTAP); + malo_hal_setpromisc(mh, ic->ic_promisc > 0); malo_setmcastfilter(sc); return ENXIO; Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Thu Apr 21 05:24:47 2016 (r298388) +++ head/sys/dev/mwl/if_mwl.c Thu Apr 21 05:47:47 2016 (r298389) @@ -1753,14 +1753,7 @@ mwl_mode_init(struct mwl_softc *sc) struct ieee80211com *ic = &sc->sc_ic; struct mwl_hal *mh = sc->sc_mh; - /* - * NB: Ignore promisc in hostap mode; it's set by the - * bridge. This is wrong but we have no way to - * identify internal requests (from the bridge) - * versus external requests such as for tcpdump. - */ - mwl_hal_setpromisc(mh, ic->ic_promisc > 0 && - ic->ic_opmode != IEEE80211_M_HOSTAP); + mwl_hal_setpromisc(mh, ic->ic_promisc > 0); mwl_setmcastfilter(sc); return 0; Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Thu Apr 21 05:24:47 2016 (r298388) +++ head/sys/net80211/ieee80211.c Thu Apr 21 05:47:47 2016 (r298389) @@ -704,16 +704,6 @@ ieee80211_promisc(struct ieee80211vap *v { struct ieee80211com *ic = vap->iv_ic; - /* - * XXX the bridge sets PROMISC but we don't want to - * enable it on the device, discard here so all the - * drivers don't need to special-case it - */ - if (!(vap->iv_opmode == IEEE80211_M_MONITOR || - (vap->iv_opmode == IEEE80211_M_AHDEMO && - (vap->iv_caps & IEEE80211_C_TDMA) == 0))) - return; - IEEE80211_LOCK_ASSERT(ic); if (on) { Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Apr 21 05:24:47 2016 (r298388) +++ head/sys/net80211/ieee80211_ioctl.c Thu Apr 21 05:47:47 2016 (r298389) @@ -3306,11 +3306,27 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon switch (cmd) { case SIOCSIFFLAGS: IEEE80211_LOCK(ic); - if ((ifp->if_flags ^ vap->iv_ifflags) & IFF_PROMISC) - ieee80211_promisc(vap, ifp->if_flags & IFF_PROMISC); - if ((ifp->if_flags ^ vap->iv_ifflags) & IFF_ALLMULTI) + if ((ifp->if_flags ^ vap->iv_ifflags) & IFF_PROMISC) { + /* + * Enable promiscuous mode when: + * 1. Interface is not a member of bridge, or + * 2. Requested by user, or + * 3. In monitor (or adhoc-demo) mode. + */ + if (ifp->if_bridge == NULL || + (ifp->if_flags & IFF_PPROMISC) != 0 || + vap->iv_opmode == IEEE80211_M_MONITOR || + (vap->iv_opmode == IEEE80211_M_AHDEMO && + (vap->iv_caps & IEEE80211_C_TDMA) == 0)) { + ieee80211_promisc(vap, + ifp->if_flags & IFF_PROMISC); + vap->iv_ifflags ^= IFF_PROMISC; + } + } + if ((ifp->if_flags ^ vap->iv_ifflags) & IFF_ALLMULTI) { ieee80211_allmulti(vap, ifp->if_flags & IFF_ALLMULTI); - vap->iv_ifflags = ifp->if_flags; + vap->iv_ifflags ^= IFF_ALLMULTI; + } if (ifp->if_flags & IFF_UP) { /* * Bring ourself up unless we're already operational. From owner-svn-src-all@freebsd.org Thu Apr 21 06:01:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C464AB17722; Thu, 21 Apr 2016 06:01:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 55738101E; Thu, 21 Apr 2016 06:01:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 55A1E781620; Thu, 21 Apr 2016 16:01:18 +1000 (AEST) Date: Thu, 21 Apr 2016 16:01:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Bruce Evans , araujo@freebsd.org, "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 In-Reply-To: <17068472.zUDTmEYeVg@ralph.baldwin.cx> Message-ID: <20160421150811.K1013@besplex.bde.org> References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <20160420115844.Y967@besplex.bde.org> <17068472.zUDTmEYeVg@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=97wTcub5ifeoF_xb2IAA:9 a=F8U9ZFIdhsjt1h1j:21 a=zVJKAXGHhyAhCwZx:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 06:01:28 -0000 On Wed, 20 Apr 2016, John Baldwin wrote: > On Wednesday, April 20, 2016 01:06:38 PM Bruce Evans wrote: >> On Wed, 20 Apr 2016, Marcelo Araujo wrote: >> >>> 2016-04-20 0:16 GMT+08:00 John Baldwin : >>> >>>> On Tuesday, April 19, 2016 04:46:13 AM Marcelo Araujo wrote: >>>>> Author: araujo >>>>> Date: Tue Apr 19 04:46:13 2016 >>>>> New Revision: 298247 >>>>> URL: https://svnweb.freebsd.org/changeset/base/298247 >>>>> >>>>> Log: >>>>> Remove redundant parenthesis. >>>>> >>>>> Submitted by: pfg >>>>> MFC after: 2 weeks. >> >> I don't realling like churnging to the nonstandard nitems(). Use >> of the nonstandard is bad enough. > > I think it's not that bad from a readability standpoint. Other languages > have fairly concise syntax for 'for-each' loops and this provides a > closer variant of that for statically sized arrays. TAILQ_FOREACH() is > still nicer of course. One could imagine doing some sort of > ARRAY_FOREACH() that was: Ugh, I really realling (sic) don't like the FOREACH macros. The FOREACH macros add syntactic salt. The queue macros were bad enough before they had FOREACH. Arrays don't start with such nastiness. > #define ARRAY_FOREACH(p, array) \ > for (size_t __i = 0, (p) = &(array)[0]; __i < nitems((array)); __i++, (p)++) This only works in the not very usual case of a simple loop from the start to the end. Even the name EACH becomes wrong if the range is anything else. For full nastiness, add a few hundred FORFOO macros to handle multi- dimensional arrays with different access methods, array slices, sentinels and other terminating conditions, etc. > Perhaps better is this: > > #define ARRAY_FOREACH(p, array) \ > for ((p) = &(array)[0]; (p) < &(array)[nitems((array))]; (p)++) > > (No need for __i) But hiding the indexes forces the old C programming idiom of using pointers for everything. A mere few hundred FORFOO macros won't do. For just 1-dimensional FOREACH, you need 3 versions to expose p, i or both p and i. >> Churnging too much (also remove excessive parentheses and braces) gives: >> >> size_t i; /* XXX: I don't like unsigned types, but... */ >> >> for (i = 0; i < nitems(part_types); i++) >> if (part_types[i].type == type & 0x7f) >> return (part_types[i].name); >> return ("unknown"); > > This would work for me (unless folks actually like the ARRAY_FOREACH() > idea). Once a loop is simple enough, it is easy to see that it really is simple without an ARRAY_FOREACH() macros that hides its details. Actually, it is not so simple since it has a special terminating condition. It only handles EACH (every) element in unusual cases. Bruce From owner-svn-src-all@freebsd.org Thu Apr 21 06:11:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 231F7B17ABD; Thu, 21 Apr 2016 06:11:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E819E1679; Thu, 21 Apr 2016 06:11:25 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L6BPpo050503; Thu, 21 Apr 2016 06:11:25 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L6BPEv050502; Thu, 21 Apr 2016 06:11:25 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604210611.u3L6BPEv050502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 21 Apr 2016 06:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298390 - head/sbin/fdisk_pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 06:11:26 -0000 Author: araujo Date: Thu Apr 21 06:11:24 2016 New Revision: 298390 URL: https://svnweb.freebsd.org/changeset/base/298390 Log: Simplify the get_type() function. Submitted by: bde Discussed with: bde, jhb and pfg MFC after: 2 weeks. Modified: head/sbin/fdisk_pc98/fdisk.c Modified: head/sbin/fdisk_pc98/fdisk.c ============================================================================== --- head/sbin/fdisk_pc98/fdisk.c Thu Apr 21 05:47:47 2016 (r298389) +++ head/sbin/fdisk_pc98/fdisk.c Thu Apr 21 06:11:24 2016 (r298390) @@ -854,17 +854,11 @@ string(const char *str, char **ans) static const char * get_type(int type) { - int numentries = nitems(part_types); - int counter = 0; - struct part_type *ptr = part_types; + size_t i; - - while(counter < numentries) { - if(ptr->type == (type & 0x7f)) - return(ptr->name); - ptr++; - counter++; - } + for (i = 0; i < nitems(part_types); i++) + if(part_types[i].type == (type & 0x7f)) + return(part_types[i].name); return("unknown"); } From owner-svn-src-all@freebsd.org Thu Apr 21 06:14:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11EE6B17D79; Thu, 21 Apr 2016 06:14:32 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5BF71BD3; Thu, 21 Apr 2016 06:14:31 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L6EVha053224; Thu, 21 Apr 2016 06:14:31 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L6EVwd053223; Thu, 21 Apr 2016 06:14:31 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604210614.u3L6EVwd053223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 21 Apr 2016 06:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298391 - head/sbin/fdisk_pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 06:14:32 -0000 Author: araujo Date: Thu Apr 21 06:14:30 2016 New Revision: 298391 URL: https://svnweb.freebsd.org/changeset/base/298391 Log: Fix a missing blank space. Modified: head/sbin/fdisk_pc98/fdisk.c Modified: head/sbin/fdisk_pc98/fdisk.c ============================================================================== --- head/sbin/fdisk_pc98/fdisk.c Thu Apr 21 06:11:24 2016 (r298390) +++ head/sbin/fdisk_pc98/fdisk.c Thu Apr 21 06:14:30 2016 (r298391) @@ -857,7 +857,7 @@ get_type(int type) size_t i; for (i = 0; i < nitems(part_types); i++) - if(part_types[i].type == (type & 0x7f)) + if (part_types[i].type == (type & 0x7f)) return(part_types[i].name); return("unknown"); } From owner-svn-src-all@freebsd.org Thu Apr 21 06:19:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6A1AB17FAF; Thu, 21 Apr 2016 06:19:34 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90D371E99; Thu, 21 Apr 2016 06:19:34 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L6JXHI053447; Thu, 21 Apr 2016 06:19:33 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L6JXKw053445; Thu, 21 Apr 2016 06:19:33 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604210619.u3L6JXKw053445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 21 Apr 2016 06:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298392 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 06:19:34 -0000 Author: avos Date: Thu Apr 21 06:19:33 2016 New Revision: 298392 URL: https://svnweb.freebsd.org/changeset/base/298392 Log: net80211: refresh comments for ieee80211_scan_next() and ieee80211_scan_done(). Refresh comments that reference scan_next() method (does not exist since r191746) + fix spelling of 'current'. Differential Revision: https://reviews.freebsd.org/D5137 Modified: head/sys/net80211/ieee80211_scan.c head/sys/net80211/ieee80211_scan_sw.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Thu Apr 21 06:14:30 2016 (r298391) +++ head/sys/net80211/ieee80211_scan.c Thu Apr 21 06:19:33 2016 (r298392) @@ -453,8 +453,9 @@ ieee80211_cancel_anyscan(struct ieee8021 } /* - * Public access to scan_next for drivers that manage - * scanning themselves (e.g. for firmware-based devices). + * Manually switch to the next channel in the channel list. + * Provided for drivers that manage scanning themselves + * (e.g. for firmware-based devices). */ void ieee80211_scan_next(struct ieee80211vap *vap) @@ -465,8 +466,9 @@ ieee80211_scan_next(struct ieee80211vap } /* - * Public access to scan_next for drivers that are not able to scan single - * channels (e.g. for firmware-based devices). + * Manually stop a scan that is currently running. + * Provided for drivers that are not able to scan single channels + * (e.g. for firmware-based devices). */ void ieee80211_scan_done(struct ieee80211vap *vap) @@ -486,7 +488,7 @@ ieee80211_scan_done(struct ieee80211vap } /* - * Probe the curent channel, if allowed, while scanning. + * Probe the current channel, if allowed, while scanning. * If the channel is not marked passive-only then send * a probe request immediately. Otherwise mark state and * listen for beacons on the channel; if we receive something Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Thu Apr 21 06:14:30 2016 (r298391) +++ head/sys/net80211/ieee80211_scan_sw.c Thu Apr 21 06:19:33 2016 (r298392) @@ -476,8 +476,9 @@ ieee80211_swscan_cancel_anyscan(struct i } /* - * Public access to scan_next for drivers that manage - * scanning themselves (e.g. for firmware-based devices). + * Manually switch to the next channel in the channel list. + * Provided for drivers that manage scanning themselves + * (e.g. for firmware-based devices). */ static void ieee80211_swscan_scan_next(struct ieee80211vap *vap) @@ -491,8 +492,9 @@ ieee80211_swscan_scan_next(struct ieee80 } /* - * Public access to scan_next for drivers that are not able to scan single - * channels (e.g. for firmware-based devices). + * Manually stop a scan that is currently running. + * Provided for drivers that are not able to scan single channels + * (e.g. for firmware-based devices). */ static void ieee80211_swscan_scan_done(struct ieee80211vap *vap) @@ -506,7 +508,7 @@ ieee80211_swscan_scan_done(struct ieee80 } /* - * Probe the curent channel, if allowed, while scanning. + * Probe the current channel, if allowed, while scanning. * If the channel is not marked passive-only then send * a probe request immediately. Otherwise mark state and * listen for beacons on the channel; if we receive something From owner-svn-src-all@freebsd.org Thu Apr 21 06:21:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACF84B16197; Thu, 21 Apr 2016 06:21:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D7C51137; Thu, 21 Apr 2016 06:21:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L6LXjg056143; Thu, 21 Apr 2016 06:21:33 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L6LXT5056142; Thu, 21 Apr 2016 06:21:33 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604210621.u3L6LXT5056142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 21 Apr 2016 06:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298393 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 06:21:34 -0000 Author: araujo Date: Thu Apr 21 06:21:33 2016 New Revision: 298393 URL: https://svnweb.freebsd.org/changeset/base/298393 Log: Use MAX() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Thu Apr 21 06:19:33 2016 (r298392) +++ head/sbin/hastd/hastd.c Thu Apr 21 06:21:33 2016 (r298393) @@ -1090,7 +1090,7 @@ main_loop(void) fd = proto_descriptor(lst->hl_conn); PJDLOG_ASSERT(fd >= 0); FD_SET(fd, &rfds); - maxfd = fd > maxfd ? fd : maxfd; + maxfd = MAX(fd, maxfd); } TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { if (res->hr_event == NULL) @@ -1098,14 +1098,14 @@ main_loop(void) fd = proto_descriptor(res->hr_event); PJDLOG_ASSERT(fd >= 0); FD_SET(fd, &rfds); - maxfd = fd > maxfd ? fd : maxfd; + maxfd = MAX(fd, maxfd); if (res->hr_role == HAST_ROLE_PRIMARY) { /* Only primary workers asks for connections. */ PJDLOG_ASSERT(res->hr_conn != NULL); fd = proto_descriptor(res->hr_conn); PJDLOG_ASSERT(fd >= 0); FD_SET(fd, &rfds); - maxfd = fd > maxfd ? fd : maxfd; + maxfd = MAX(fd, maxfd); } else { PJDLOG_ASSERT(res->hr_conn == NULL); } From owner-svn-src-all@freebsd.org Thu Apr 21 06:24:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEABEB16280; Thu, 21 Apr 2016 06:24:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEFFA147C; Thu, 21 Apr 2016 06:24:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L6OD7D056289; Thu, 21 Apr 2016 06:24:13 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L6OD4s056287; Thu, 21 Apr 2016 06:24:13 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604210624.u3L6OD4s056287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 21 Apr 2016 06:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298394 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 06:24:15 -0000 Author: araujo Date: Thu Apr 21 06:24:13 2016 New Revision: 298394 URL: https://svnweb.freebsd.org/changeset/base/298394 Log: Use MIN()/MAX() macros from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/restore/dirs.c head/sbin/restore/tape.c Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Thu Apr 21 06:21:33 2016 (r298393) +++ head/sbin/restore/dirs.c Thu Apr 21 06:24:13 2016 (r298394) @@ -690,7 +690,7 @@ genliteraldir(char *name, ino_t ino) rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); dp = dup(dirp->dd_fd); for (i = itp->t_size; i > 0; i -= BUFSIZ) { - size = i < BUFSIZ ? i : BUFSIZ; + size = MIN(i, BUFSIZ); if (read(dp, buf, (int) size) == -1) { fprintf(stderr, "write error extracting inode %ju, name %s\n", Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Thu Apr 21 06:21:33 2016 (r298393) +++ head/sbin/restore/tape.c Thu Apr 21 06:24:13 2016 (r298394) @@ -132,7 +132,7 @@ setinput(char *source, int ispipecommand if (bflag) newtapebuf(ntrec); else - newtapebuf(NTREC > HIGHDENSITYTREC ? NTREC : HIGHDENSITYTREC); + newtapebuf(MAX(NTREC, HIGHDENSITYTREC)); terminal = stdin; if (ispipecommand) @@ -1010,7 +1010,7 @@ loop: * block of the hole in the file. Postpone the * seek until next file write. */ - seekpos += (long)(size > TP_BSIZE ? TP_BSIZE : size); + seekpos += (long)MIN(TP_BSIZE, size); } if ((size -= TP_BSIZE) <= 0) { if (size > -TP_BSIZE && curblk > 0) { From owner-svn-src-all@freebsd.org Thu Apr 21 06:27:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 153A8B16421; Thu, 21 Apr 2016 06:27:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0C66183E; Thu, 21 Apr 2016 06:27:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L6R7qj056422; Thu, 21 Apr 2016 06:27:07 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L6R7bd056421; Thu, 21 Apr 2016 06:27:07 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604210627.u3L6R7bd056421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 21 Apr 2016 06:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298395 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 06:27:08 -0000 Author: bapt Date: Thu Apr 21 06:27:06 2016 New Revision: 298395 URL: https://svnweb.freebsd.org/changeset/base/298395 Log: Restore histrory messed up in r290620 ascii.c was removed during r290494 but this introduced an issue with ASCII that has been fixed in r290618 and lead to a rewrite of ascii.c based on none.c. ascii.c was wrongly reintroduced in r290620 without proper svn operation which lost the history. Reported by: ache, danfe Replaced: head/lib/libc/locale/ascii.c - copied, changed from r298272, head/lib/libc/locale/none.c Copied and modified: head/lib/libc/locale/ascii.c (from r298272, head/lib/libc/locale/none.c) ============================================================================== --- head/lib/libc/locale/none.c Tue Apr 19 15:18:31 2016 (r298272, copy source) +++ head/lib/libc/locale/ascii.c Thu Apr 21 06:27:06 2016 (r298395) @@ -1,4 +1,4 @@ -/*- +/* * Copyright 2013 Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. @@ -36,11 +36,10 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * @(#)none.c 8.1 (Berkeley) 6/4/93 */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)none.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -54,41 +53,35 @@ __FBSDID("$FreeBSD$"); #include #include "mblocal.h" -static size_t _none_mbrtowc(wchar_t * __restrict, const char * __restrict, +static size_t _ascii_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, mbstate_t * __restrict); -static int _none_mbsinit(const mbstate_t *); -static size_t _none_mbsnrtowcs(wchar_t * __restrict dst, +static int _ascii_mbsinit(const mbstate_t *); +static size_t _ascii_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, size_t nms, size_t len, mbstate_t * __restrict ps __unused); -static size_t _none_wcrtomb(char * __restrict, wchar_t, +static size_t _ascii_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); -static size_t _none_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, +static size_t _ascii_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t, size_t, mbstate_t * __restrict); -/* setup defaults */ - -int __mb_cur_max = 1; -int __mb_sb_limit = 256; /* Expected to be <= _CACHED_RUNES */ - int -_none_init(struct xlocale_ctype *l, _RuneLocale *rl) +_ascii_init(struct xlocale_ctype *l, _RuneLocale *rl) { - l->__mbrtowc = _none_mbrtowc; - l->__mbsinit = _none_mbsinit; - l->__mbsnrtowcs = _none_mbsnrtowcs; - l->__wcrtomb = _none_wcrtomb; - l->__wcsnrtombs = _none_wcsnrtombs; + l->__mbrtowc = _ascii_mbrtowc; + l->__mbsinit = _ascii_mbsinit; + l->__mbsnrtowcs = _ascii_mbsnrtowcs; + l->__wcrtomb = _ascii_wcrtomb; + l->__wcsnrtombs = _ascii_wcsnrtombs; l->runes = rl; l->__mb_cur_max = 1; - l->__mb_sb_limit = 256; + l->__mb_sb_limit = 128; return(0); } static int -_none_mbsinit(const mbstate_t *ps __unused) +_ascii_mbsinit(const mbstate_t *ps __unused) { - /* * Encoding is not state dependent - we are always in the * initial state. @@ -97,30 +90,33 @@ _none_mbsinit(const mbstate_t *ps __unus } static size_t -_none_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, +_ascii_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps __unused) { - if (s == NULL) /* Reset to initial shift state (no-op) */ return (0); if (n == 0) /* Incomplete multibyte sequence */ return ((size_t)-2); + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } if (pwc != NULL) *pwc = (unsigned char)*s; return (*s == '\0' ? 0 : 1); } static size_t -_none_wcrtomb(char * __restrict s, wchar_t wc, +_ascii_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps __unused) { if (s == NULL) /* Reset to initial shift state (no-op) */ return (1); - if (wc < 0 || wc > UCHAR_MAX) { + if (wc < 0 || wc > 127) { errno = EILSEQ; return ((size_t)-1); } @@ -129,7 +125,7 @@ _none_wcrtomb(char * __restrict s, wchar } static size_t -_none_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, +_ascii_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, size_t nms, size_t len, mbstate_t * __restrict ps __unused) { const char *s; @@ -137,12 +133,23 @@ _none_mbsnrtowcs(wchar_t * __restrict ds if (dst == NULL) { s = memchr(*src, '\0', nms); - return (s != NULL ? s - *src : nms); + if (s == NULL) + return (nms); + + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } + return (s - *src); } s = *src; nchr = 0; while (len-- > 0 && nms-- > 0) { + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } if ((*dst++ = (unsigned char)*s++) == L'\0') { *src = NULL; return (nchr); @@ -154,7 +161,7 @@ _none_mbsnrtowcs(wchar_t * __restrict ds } static size_t -_none_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, +_ascii_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t nwc, size_t len, mbstate_t * __restrict ps __unused) { const wchar_t *s; @@ -162,7 +169,7 @@ _none_wcsnrtombs(char * __restrict dst, if (dst == NULL) { for (s = *src; nwc > 0 && *s != L'\0'; s++, nwc--) { - if (*s < 0 || *s > UCHAR_MAX) { + if (*s < 0 || *s > 127) { errno = EILSEQ; return ((size_t)-1); } @@ -173,7 +180,7 @@ _none_wcsnrtombs(char * __restrict dst, s = *src; nchr = 0; while (len-- > 0 && nwc-- > 0) { - if (*s < 0 || *s > UCHAR_MAX) { + if (*s < 0 || *s > 127) { errno = EILSEQ; return ((size_t)-1); } @@ -186,29 +193,3 @@ _none_wcsnrtombs(char * __restrict dst, *src = s; return (nchr); } - -/* setup defaults */ - -struct xlocale_ctype __xlocale_global_ctype = { - {{0}, "C"}, - (_RuneLocale*)&_DefaultRuneLocale, - _none_mbrtowc, - _none_mbsinit, - _none_mbsnrtowcs, - _none_wcrtomb, - _none_wcsnrtombs, - 1, /* __mb_cur_max, */ - 256 /* __mb_sb_limit */ -}; - -struct xlocale_ctype __xlocale_C_ctype = { - {{0}, "C"}, - (_RuneLocale*)&_DefaultRuneLocale, - _none_mbrtowc, - _none_mbsinit, - _none_mbsnrtowcs, - _none_wcrtomb, - _none_wcsnrtombs, - 1, /* __mb_cur_max, */ - 256 /* __mb_sb_limit */ -}; From owner-svn-src-all@freebsd.org Thu Apr 21 06:29:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE8B2B1677B; Thu, 21 Apr 2016 06:29:57 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7742E1C26; Thu, 21 Apr 2016 06:29:57 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id e201so15166635wme.2; Wed, 20 Apr 2016 23:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MevEM0VPvHAzpGcq8aqORrSivnz3B9ctuxJvI0H+UiU=; b=eIBHZ0IcryuPocRW3riU0JOraNUZT15NRzKV2hPXzGOnnbrKLNhmMgMAx1NfUBHaKj Cw8LQLTda3Epa7aoVV2/UkXhHXTpdzCeEk4etPGFdwLTzv1QWQomQDoRS2AIxD0iBSpa UomGLO/s/Ep5y0TgEc/8vUJgW7WaxkIJW0HugkY0bT7nb+mND55xYfUv8gj2W8Q1L/mw eCsNzFs4tK3r9U8Ceb0tcUK58J1UWPh19KSaA5hrOaZP02gNbEJbh1mWkxK04kb6LU0q XSsDLPRr/3Kes0NvfAZ7uPpqOmZPW8M6/pOzmEe+V+3JB+GY41OM266maZNNAC2HcRc3 2EoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=MevEM0VPvHAzpGcq8aqORrSivnz3B9ctuxJvI0H+UiU=; b=RPfyaKdElUEv8YKsF5xKEoFKSv02jg3qwnRySJRGE0tePvbnM2RHO7NKUcGhjSrysj TyX8wIXkb9C8xADuT+IYyKlsoC2JufyY5PAXX79TTu8nKxOkIByUYfqJBYfXH1RKybjv FMx7lB7ezlecDqJTyZtui9sglavywx8+Q05gjUgxGvQfx+Nzj4yjR3BPRzzJc2ut0m29 FGRTb3k6iEJKgh9k5m7LPGwsmJEescLSfxqLMvGR7OervjteiTeSOLdDvpiVNxEml921 vyQPP29kTC+93HaVom/1kyWajB3YwdRgsFua8upyqwbfdC11JMTA289U7L4I2ouGsyvL TZPA== X-Gm-Message-State: AOPr4FVJ8ut3DbtuP0QcDUgg0iGBpHVvnVOqVGnsWtuZzgjaORgYr6lNkN40FeQDGFzyCQ== X-Received: by 10.194.63.226 with SMTP id j2mr12202371wjs.27.1461220196094; Wed, 20 Apr 2016 23:29:56 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id f8sm1120735wjm.13.2016.04.20.23.29.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Apr 2016 23:29:55 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 21 Apr 2016 08:29:53 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298367 - head/lib/libc/locale Message-ID: <20160421062953.GI26116@ivaldir.etoilebsd.net> References: <201604202044.u3KKiUMq081452@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1E1Oui4vdubnXi3o" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 06:29:57 -0000 --1E1Oui4vdubnXi3o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 21, 2016 at 05:00:20AM +0300, Andrey Chernov wrote: > On 21.04.2016 3:57, Andrey Chernov wrote: > > On 20.04.2016 23:44, Baptiste Daroussin wrote: > >> Author: bapt > >> Date: Wed Apr 20 20:44:30 2016 > >> New Revision: 298367 > >> URL: https://svnweb.freebsd.org/changeset/base/298367 > >> > >> Log: > >> Check the returned value of memchr(3) before using it > >> =20 > >> Reported by: Coverity > >> CID: 1338530 > >> > >> Modified: > >> head/lib/libc/locale/ascii.c > >> > >> Modified: head/lib/libc/locale/ascii.c > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/lib/libc/locale/ascii.c Wed Apr 20 20:43:05 2016 (r298366) > >> +++ head/lib/libc/locale/ascii.c Wed Apr 20 20:44:30 2016 (r298367) > >> @@ -133,11 +133,14 @@ _ascii_mbsnrtowcs(wchar_t * __restrict d > >> =20 > >> if (dst =3D=3D NULL) { > >> s =3D memchr(*src, '\0', nms); > >> + if (s =3D=3D NULL) > >> + return (nms); > >> + > >> if (*s & 0x80) { > >> errno =3D EILSEQ; > >> return ((size_t)-1); > >> } > >> - return (s !=3D NULL ? s - *src : nms); > >> + return (s - *src); > >> } > >> =20 > >> s =3D *src; > >> > >=20 > > The whole code is incorrect, only the very first char is checked, there > > must be a loop like in -stable: > >=20 > > if (dst =3D=3D NULL) { > > for (s =3D *src; nms > 0 && *s !=3D '\0'; s++, nms--) { > > if (*s & 0x80) { > > errno =3D EILSEQ; > > return ((size_t)-1); > > } > > } > > return (s - *src); > > } > >=20 > > Since svn history is lost on deleting, I don't know why incorrect > > version was committed. > >=20 >=20 > Typo, the very first =3D=3D the very last, i.e. only NUL char is checked > which always pass. >=20 I have restored the history (I hope correctly) Bapt --1E1Oui4vdubnXi3o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXGHNhAAoJEGOJi9zxtz5aaJkP/iWUYS7+Ez+uXI1xSKzTeG0J Ifk5U044Vp5auJWBSJz6a7Oz4ujFOJRPg4nofLf+Q0vYEUod2thY8WvlyySUlpaj alt1iqvSNLzFC1EjzbC1tv9EFFruP3QNtfDn+V1rc4gWAPlmMNrf9wXH6cHqAxEL qZGpHXhJpHR63IQDuP1ntwaXgS7wQf0K9YgkEZzKi0XZWI8mBWofzerZAGouUSHx n/xQdyc73CXq3FgLZ3yQIWJwWy7275b579IXOz6zA04+Ihl7L9y/A2swCoAI8JIM MYlJCIBq/dqk/9kYvHB/zgHXYsk75dG0Gmfjf9eS5JI89BiX06AWfX23B4Wx7AaG k39VJPPTsdqornUiwY3GHe6qkT9kHzobjDqNlzlWloD39CD1reBt8sbtqhdWkwBW gQEyxzuBDLjTlwAWgKYwuKnRbMDbVHvCVS27IzhdATFekqOkKUihSe78r0KUwRMW Awmc2GxyKTziTUIUbRUeMyXKYUhjdTJ4rOI85lClmxetc75mVcswVbk5CC7pcf17 wcFLgbn+CANsJAQ1Ei7dwWwTnd+6ziultHSK5mWeAyDKs/TkVaEexY6hj6hWTsQz B/5Dba73lw5ClWfhuGp4FvAA8mJt5xZI0oddPRERuF8OYeYCNiA1LqY64iV219g9 lHZpc/1wo6OTF/JkftNg =Z6HN -----END PGP SIGNATURE----- --1E1Oui4vdubnXi3o-- From owner-svn-src-all@freebsd.org Thu Apr 21 07:22:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65174B17832 for ; Thu, 21 Apr 2016 07:22:54 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f196.google.com (mail-lb0-f196.google.com [209.85.217.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3E7112E5 for ; Thu, 21 Apr 2016 07:22:53 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lb0-f196.google.com with SMTP id w1so2451350lbl.1 for ; Thu, 21 Apr 2016 00:22:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=mZDtKuIMNiD9N9YWpxR/NQDjENGpRMLlBV54F1BEgaI=; b=QE9dxynzFypJNK9ybHBGEvqPME353/+o2ccJdTvr/7Fx6lK6X/WEpUi+reNt59Z/KH 1gUsjciiXC0bMX8MzqRjFBwtzv9lwhJzhoe7gjB4KKLwPA9JoAoeJlY9ZMWgOgrMTpFW xJVMiaQLvgpSVktNRJuelJDLviJH/nFgZE3IAO/6KsAr7+IjZAoekPBuhZnwkkEDqfc1 UOlqHsf1fZy3j2TPxq6lT9fLnYDErDfCOwdruV7TiFHB0gSryj1xYqMjzLjO5j9H7Ms5 9J1fhvteooq+gKBllKx/UMZlk5sfW5wTRNdJlnKxV5JBEjCQ4PU/Qcpgrxi4YhbomlD5 K4nQ== X-Gm-Message-State: AOPr4FXG3Ww6dmH+lmDloYRtNrocxsTmkTCon6hYe8MG73nlwRsf6J3sAQ8xAGyK3Ixq2g== X-Received: by 10.112.85.43 with SMTP id e11mr5935554lbz.80.1461223371524; Thu, 21 Apr 2016 00:22:51 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id w125sm288813lfa.10.2016.04.21.00.22.50 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Apr 2016 00:22:50 -0700 (PDT) Subject: Re: svn commit: r298367 - head/lib/libc/locale To: Baptiste Daroussin References: <201604202044.u3KKiUMq081452@repo.freebsd.org> <20160421062953.GI26116@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <7ef69cc0-4f38-788d-3fab-5058749cee8e@freebsd.org> Date: Thu, 21 Apr 2016 10:22:48 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160421062953.GI26116@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XtDbF0Vtl2grLCnSw0t66Ww52sUnl4lqD" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 07:22:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XtDbF0Vtl2grLCnSw0t66Ww52sUnl4lqD Content-Type: multipart/mixed; boundary="VVij2iOfPhGTeF73fnksGQjjx0KA9f4xh" From: Andrey Chernov To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <7ef69cc0-4f38-788d-3fab-5058749cee8e@freebsd.org> Subject: Re: svn commit: r298367 - head/lib/libc/locale References: <201604202044.u3KKiUMq081452@repo.freebsd.org> <20160421062953.GI26116@ivaldir.etoilebsd.net> In-Reply-To: <20160421062953.GI26116@ivaldir.etoilebsd.net> --VVij2iOfPhGTeF73fnksGQjjx0KA9f4xh Content-Type: multipart/mixed; boundary="------------55479B238AAE8B7ABC0D9A3B" This is a multi-part message in MIME format. --------------55479B238AAE8B7ABC0D9A3B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 21.04.2016 9:29, Baptiste Daroussin wrote: >>>> Modified: head/lib/libc/locale/ascii.c >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- head/lib/libc/locale/ascii.c Wed Apr 20 20:43:05 2016 (r298366) >>>> +++ head/lib/libc/locale/ascii.c Wed Apr 20 20:44:30 2016 (r298367) >>>> @@ -133,11 +133,14 @@ _ascii_mbsnrtowcs(wchar_t * __restrict d >>>> =20 >>>> if (dst =3D=3D NULL) { >>>> s =3D memchr(*src, '\0', nms); >>>> + if (s =3D=3D NULL) >>>> + return (nms); >>>> + >>>> if (*s & 0x80) { >>>> errno =3D EILSEQ; >>>> return ((size_t)-1); >>>> } >>>> - return (s !=3D NULL ? s - *src : nms); >>>> + return (s - *src); >>>> } >>>> =20 >>>> s =3D *src; >>>> >>> >>> The whole code is incorrect, only the very first char is checked, the= re >>> must be a loop like in -stable: >>> >>> if (dst =3D=3D NULL) { >>> for (s =3D *src; nms > 0 && *s !=3D '\0'; s++, nms--)= { >>> if (*s & 0x80) { >>> errno =3D EILSEQ; >>> return ((size_t)-1); >>> } >>> } >>> return (s - *src); >>> } >>> >>> Since svn history is lost on deleting, I don't know why incorrect >>> version was committed. >>> >> >> Typo, the very first =3D=3D the very last, i.e. only NUL char is check= ed >> which always pass. >> >=20 > I have restored the history (I hope correctly) >=20 > Bapt >=20 All the restored history is related to none.c, but ascii.c was made afterwards a bit differently and transition history between none.c -> ascii.c is lost in any case somehow. We still have correct version in -stable. The diff is attached. BTW, recent none.c from which ascii.c is made don't have this two copyrights too: - * Copyright 2013 Garrett D'Amore - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. --------------55479B238AAE8B7ABC0D9A3B Content-Type: text/plain; charset=UTF-8; name="patch.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="patch.txt" SW5kZXg6IGFzY2lpLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gYXNjaWkuYwkoLi4uL2hlYWQvbGli L2xpYmMvbG9jYWxlL2FzY2lpLmMpCShyZXZpc2lvbiAyOTgzOTUpCisrKyBhc2NpaS5jCSgu Li4vc3RhYmxlLzEwL2xpYi9saWJjL2xvY2FsZS9hc2NpaS5jKQkod29ya2luZyBjb3B5KQpA QCAtMSw2ICsxLDQgQEAKLS8qCi0gKiBDb3B5cmlnaHQgMjAxMyBHYXJyZXR0IEQnQW1vcmUg PGdhcnJldHRAZGFtb3JlLm9yZz4KLSAqIENvcHlyaWdodCAyMDEwIE5leGVudGEgU3lzdGVt cywgSW5jLiAgQWxsIHJpZ2h0cyByZXNlcnZlZC4KKy8qLQogICogQ29weXJpZ2h0IChjKSAy MDAyLTIwMDQgVGltIEouIFJvYmJpbnMuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKiBDb3B5 cmlnaHQgKGMpIDE5OTMKICAqCVRoZSBSZWdlbnRzIG9mIHRoZSBVbml2ZXJzaXR5IG9mIENh bGlmb3JuaWEuICBBbGwgcmlnaHRzIHJlc2VydmVkLgpAQCAtMzYsOCArMzQsNiBAQAogICog TElBQklMSVRZLCBPUiBUT1JUIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0Up IEFSSVNJTkcgSU4gQU5ZIFdBWQogICogT1VUIE9GIFRIRSBVU0UgT0YgVEhJUyBTT0ZUV0FS RSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRgogICogU1VDSCBEQU1B R0UuCi0gKgotICogQCgjKW5vbmUuYwk4LjEgKEJlcmtlbGV5KSA2LzQvOTMKICAqLwogCiAj aW5jbHVkZSA8c3lzL2NkZWZzLmg+CkBAIC02NSw3ICs2MSw3IEBACiAJCSAgICBzaXplX3Qs IHNpemVfdCwgbWJzdGF0ZV90ICogX19yZXN0cmljdCk7CiAKIGludAotX2FzY2lpX2luaXQo c3RydWN0IHhsb2NhbGVfY3R5cGUgKmwsIF9SdW5lTG9jYWxlICpybCkKK19hc2NpaV9pbml0 KHN0cnVjdCB4bG9jYWxlX2N0eXBlICpsLF9SdW5lTG9jYWxlICpybCkKIHsKIAogCWwtPl9f bWJydG93YyA9IF9hc2NpaV9tYnJ0b3djOwpAQCAtODIsNiArNzgsNyBAQAogc3RhdGljIGlu dAogX2FzY2lpX21ic2luaXQoY29uc3QgbWJzdGF0ZV90ICpwcyBfX3VudXNlZCkKIHsKKwog CS8qCiAJICogRW5jb2RpbmcgaXMgbm90IHN0YXRlIGRlcGVuZGVudCAtIHdlIGFyZSBhbHdh eXMgaW4gdGhlCiAJICogaW5pdGlhbCBzdGF0ZS4KQEAgLTkzLDYgKzkwLDcgQEAKIF9hc2Np aV9tYnJ0b3djKHdjaGFyX3QgKiBfX3Jlc3RyaWN0IHB3YywgY29uc3QgY2hhciAqIF9fcmVz dHJpY3Qgcywgc2l6ZV90IG4sCiAgICAgbWJzdGF0ZV90ICogX19yZXN0cmljdCBwcyBfX3Vu dXNlZCkKIHsKKwogCWlmIChzID09IE5VTEwpCiAJCS8qIFJlc2V0IHRvIGluaXRpYWwgc2hp ZnQgc3RhdGUgKG5vLW9wKSAqLwogCQlyZXR1cm4gKDApOwpAQCAtMTMyLDEzICsxMzAsMTEg QEAKIAlzaXplX3QgbmNocjsKIAogCWlmIChkc3QgPT0gTlVMTCkgewotCQlzID0gbWVtY2hy KCpzcmMsICdcMCcsIG5tcyk7Ci0JCWlmIChzID09IE5VTEwpCi0JCQlyZXR1cm4gKG5tcyk7 Ci0KLQkJaWYgKCpzICYgMHg4MCkgewotCQkJZXJybm8gPSBFSUxTRVE7Ci0JCQlyZXR1cm4g KChzaXplX3QpLTEpOworCQlmb3IgKHMgPSAqc3JjOyBubXMgPiAwICYmICpzICE9ICdcMCc7 IHMrKywgbm1zLS0pIHsKKwkJCWlmICgqcyAmIDB4ODApIHsKKwkJCQllcnJubyA9IEVJTFNF UTsKKwkJCQlyZXR1cm4gKChzaXplX3QpLTEpOworCQkJfQogCQl9CiAJCXJldHVybiAocyAt ICpzcmMpOwogCX0KQEAgLTE5MywzICsxODksNCBAQAogCSpzcmMgPSBzOwogCXJldHVybiAo bmNocik7CiB9CisK --------------55479B238AAE8B7ABC0D9A3B-- --VVij2iOfPhGTeF73fnksGQjjx0KA9f4xh-- --XtDbF0Vtl2grLCnSw0t66Ww52sUnl4lqD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXGH/JAAoJEKUckv0MjfbKiyAH/iDtX/ll0B4/LstaxfwmK01M nw18knxhuX6YfnjEYQHUXZTMAeb8B73egJx9yirhwxp+AwbXu39v2IVrssZvEe/O X5mfa5NQ66a9YvLy3idVEKbI7A/t4uJeqyms2K8zVv3BVp6BXPYrfegKMNHeT4YO EHuaa9ZjIrN3L2p47tz8Mxjq0jEjQRzauIKsCWKk11wfd3q1zawXHBrRbmzx31HS NcXNNyiGLEpCQ4XNfIXSTWkugs8brUQ+XGAghMsAdl+39JfSZ1k7Gamvh4mRpMFV MnxKNUYtcyIgh2sxBMH7FqPkhEnj0lkqjGQbCteRW7ntHViOK+CWIU314v6CMK4= =639G -----END PGP SIGNATURE----- --XtDbF0Vtl2grLCnSw0t66Ww52sUnl4lqD-- From owner-svn-src-all@freebsd.org Thu Apr 21 07:36:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B8BEB17BE8; Thu, 21 Apr 2016 07:36:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 336041AC2; Thu, 21 Apr 2016 07:36:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L7aBUJ077537; Thu, 21 Apr 2016 07:36:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L7aBuZ077536; Thu, 21 Apr 2016 07:36:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604210736.u3L7aBuZ077536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 21 Apr 2016 07:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298396 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 07:36:12 -0000 Author: bapt Date: Thu Apr 21 07:36:11 2016 New Revision: 298396 URL: https://svnweb.freebsd.org/changeset/base/298396 Log: Restore the original ascii.c from prior to r290494 It was doing the right thing, there was no need to "fail" to reinvent it from none.c Pointy hat: bapt Submitted by: ache Replaced: - copied unchanged from r290493, head/lib/libc/locale/ascii.c Directory Properties: head/lib/libc/locale/ascii.c (props changed) Copied: head/lib/libc/locale/ascii.c (from r290493, head/lib/libc/locale/ascii.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/locale/ascii.c Thu Apr 21 07:36:11 2016 (r298396, copy of r290493, head/lib/libc/locale/ascii.c) @@ -0,0 +1,192 @@ +/*- + * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University 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 REGENTS 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +static size_t _ascii_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _ascii_mbsinit(const mbstate_t *); +static size_t _ascii_mbsnrtowcs(wchar_t * __restrict dst, + const char ** __restrict src, size_t nms, size_t len, + mbstate_t * __restrict ps __unused); +static size_t _ascii_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); +static size_t _ascii_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict); + +int +_ascii_init(struct xlocale_ctype *l,_RuneLocale *rl) +{ + + l->__mbrtowc = _ascii_mbrtowc; + l->__mbsinit = _ascii_mbsinit; + l->__mbsnrtowcs = _ascii_mbsnrtowcs; + l->__wcrtomb = _ascii_wcrtomb; + l->__wcsnrtombs = _ascii_wcsnrtombs; + l->runes = rl; + l->__mb_cur_max = 1; + l->__mb_sb_limit = 128; + return(0); +} + +static int +_ascii_mbsinit(const mbstate_t *ps __unused) +{ + + /* + * Encoding is not state dependent - we are always in the + * initial state. + */ + return (1); +} + +static size_t +_ascii_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps __unused) +{ + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (0); + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } + if (pwc != NULL) + *pwc = (unsigned char)*s; + return (*s == '\0' ? 0 : 1); +} + +static size_t +_ascii_wcrtomb(char * __restrict s, wchar_t wc, + mbstate_t * __restrict ps __unused) +{ + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + if (wc < 0 || wc > 127) { + errno = EILSEQ; + return ((size_t)-1); + } + *s = (unsigned char)wc; + return (1); +} + +static size_t +_ascii_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, + size_t nms, size_t len, mbstate_t * __restrict ps __unused) +{ + const char *s; + size_t nchr; + + if (dst == NULL) { + for (s = *src; nms > 0 && *s != '\0'; s++, nms--) { + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } + } + return (s - *src); + } + + s = *src; + nchr = 0; + while (len-- > 0 && nms-- > 0) { + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } + if ((*dst++ = (unsigned char)*s++) == L'\0') { + *src = NULL; + return (nchr); + } + nchr++; + } + *src = s; + return (nchr); +} + +static size_t +_ascii_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, + size_t nwc, size_t len, mbstate_t * __restrict ps __unused) +{ + const wchar_t *s; + size_t nchr; + + if (dst == NULL) { + for (s = *src; nwc > 0 && *s != L'\0'; s++, nwc--) { + if (*s < 0 || *s > 127) { + errno = EILSEQ; + return ((size_t)-1); + } + } + return (s - *src); + } + + s = *src; + nchr = 0; + while (len-- > 0 && nwc-- > 0) { + if (*s < 0 || *s > 127) { + errno = EILSEQ; + return ((size_t)-1); + } + if ((*dst++ = *s++) == '\0') { + *src = NULL; + return (nchr); + } + nchr++; + } + *src = s; + return (nchr); +} + From owner-svn-src-all@freebsd.org Thu Apr 21 07:40:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54629B17E56; Thu, 21 Apr 2016 07:40:05 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C7E81D8A; Thu, 21 Apr 2016 07:40:05 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L7e4Jl077733; Thu, 21 Apr 2016 07:40:04 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L7e3L4077723; Thu, 21 Apr 2016 07:40:03 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604210740.u3L7e3L4077723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Thu, 21 Apr 2016 07:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298397 - in head/sys/mips: conf mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 07:40:05 -0000 Author: sgalabov Date: Thu Apr 21 07:40:03 2016 New Revision: 298397 URL: https://svnweb.freebsd.org/changeset/base/298397 Log: Rework Mediatek/Ralink configuration files Only compile what each SoC needs and get rid of MEDIATEK generic config. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5996 Added: head/sys/mips/mediatek/files.mediatek (contents, props changed) head/sys/mips/mediatek/std.mediatek (contents, props changed) Deleted: head/sys/mips/conf/MEDIATEK head/sys/mips/conf/MEDIATEK_BASE Modified: head/sys/mips/conf/MT7620A_FDT head/sys/mips/conf/MT7620N_FDT head/sys/mips/conf/MT7621_FDT head/sys/mips/conf/MT7628_FDT head/sys/mips/conf/RT3050_FDT head/sys/mips/conf/RT3352_FDT head/sys/mips/conf/RT3883_FDT head/sys/mips/conf/RT5350_FDT Modified: head/sys/mips/conf/MT7620A_FDT ============================================================================== --- head/sys/mips/conf/MT7620A_FDT Thu Apr 21 07:36:11 2016 (r298396) +++ head/sys/mips/conf/MT7620A_FDT Thu Apr 21 07:40:03 2016 (r298397) @@ -1,8 +1,7 @@ # # MT7620A_FDT -- Kernel configuration file for FreeBSD/MIPS MT7620A SoC # -# This includes all the configurable parts of the kernel. Please read through -# MEDIATEK kernel config and customize the options to fit your board if needed. +# This includes all the configurable parts of the kernel. # # $FreeBSD$ # @@ -14,17 +13,65 @@ # #makeoptions FDT_DTS_FILE=MT7620a.dts -# -# The user should never have to edit what's below this line. -# If customizations are needed, they should be done to the MEDIATEK kernel -# configuration. -# - # Start with a base configuration -include MEDIATEK_BASE +include "../mediatek/std.mediatek" ident MT7620A cpu CPU_MIPS24K -# Include optional configuration (to be edited by the user if needed) -include MEDIATEK +# Don't build any modules by default +makeoptions MODULES_OVERRIDE="" + +# Default rootfs device configuration, should be changed to suit target board +options ROOTDEVNAME=\"ufs:md0.uzip\" + +# Support geom_uzip(4) compressed disk images +device geom_uzip +options GEOM_UZIP + +# Support md(4) and md-based rootfs +device md +options MD_ROOT + +# Interrupt controller support +device mtk_intr_v1 + +# UART device support +nodevice uart_ns8250 +device uart_dev_mtk + +# SPI and SPI flash support +device mtk_spi_v1 +device spibus +device mx25l + +# GPIO and gpioled support +device mtk_gpio_v1 +device gpio +device gpioled + +# PCI support +device pci + +# USB (ehci, ohci) support +device usb +device mtk_usb_phy +device ehci +device ohci + +# USB umass(4) storage and da(4) support +device umass +device da + +# CAM support, required if umass(4) is enabled above +device pass +device scbus + +# Ethernet, BPF and bridge support +device rt +device bpf +device if_bridge + +# Extres +device ext_resources +device clk Modified: head/sys/mips/conf/MT7620N_FDT ============================================================================== --- head/sys/mips/conf/MT7620N_FDT Thu Apr 21 07:36:11 2016 (r298396) +++ head/sys/mips/conf/MT7620N_FDT Thu Apr 21 07:40:03 2016 (r298397) @@ -1,8 +1,7 @@ # # MT7620N_FDT -- Kernel configuration file for FreeBSD/MIPS MT7620N SoC # -# This includes all the configurable parts of the kernel. Please read through -# MEDIATEK kernel config and customize the options to fit your board if needed. +# This includes all the configurable parts of the kernel. # # $FreeBSD$ # @@ -14,17 +13,62 @@ # #makeoptions FDT_DTS_FILE=WRTNODE.dts -# -# The user should never have to edit what's below this line. -# If customizations are needed, they should be done to the MEDIATEK kernel -# configuration. -# - # Start with a base configuration -include MEDIATEK_BASE +include "../mediatek/std.mediatek" ident MT7620N cpu CPU_MIPS24K -# Include optional configuration (to be edited by the user if needed) -include MEDIATEK +# Don't build any modules by default +makeoptions MODULES_OVERRIDE="" + +# Default rootfs device configuration, should be changed to suit target board +options ROOTDEVNAME=\"ufs:md0.uzip\" + +# Support geom_uzip(4) compressed disk images +device geom_uzip +options GEOM_UZIP + +# Support md(4) and md-based rootfs +device md +options MD_ROOT + +# Interrupt controller support +device mtk_intr_v1 + +# UART device support +nodevice uart_ns8250 +device uart_dev_mtk + +# SPI and SPI flash support +device mtk_spi_v1 +device spibus +device mx25l + +# GPIO and gpioled support +device mtk_gpio_v1 +device gpio +device gpioled + +# USB (ehci, ohci) support +device usb +device mtk_usb_phy +device ehci +device ohci + +# USB umass(4) storage and da(4) support +device umass +device da + +# CAM support, required if umass(4) is enabled above +device pass +device scbus + +# Ethernet, BPF and bridge support +device rt +device bpf +device if_bridge + +# Extres +device ext_resources +device clk Modified: head/sys/mips/conf/MT7621_FDT ============================================================================== --- head/sys/mips/conf/MT7621_FDT Thu Apr 21 07:36:11 2016 (r298396) +++ head/sys/mips/conf/MT7621_FDT Thu Apr 21 07:40:03 2016 (r298397) @@ -1,8 +1,7 @@ # # MT7621_FDT -- Kernel configuration file for FreeBSD/MIPS MT7621 SoC # -# This includes all the configurable parts of the kernel. Please read through -# MEDIATEK kernel config and customize the options to fit your board if needed. +# This includes all the configurable parts of the kernel. # # $FreeBSD$ # @@ -12,19 +11,63 @@ # # FDT_DTS_FILE should be modified to suit the target board type. # -#makeoptions FDT_DTS_FILE=ZBT-WG2626.dts - -# -# The user should never have to edit what's below this line. -# If customizations are needed, they should be done to the MEDIATEK kernel -# configuration. -# +#makeoptions FDT_DTS_FILE=WITI.dts # Start with a base configuration -include MEDIATEK_BASE +include "../mediatek/std.mediatek" ident MT7621 cpu CPU_MIPS1004K -# Include optional configuration (to be edited by the user if needed) -include MEDIATEK +# Don't build any modules by default +makeoptions MODULES_OVERRIDE="" + +# Default rootfs device configuration, should be changed to suit target board +options ROOTDEVNAME=\"ufs:md0.uzip\" + +# Support geom_uzip(4) compressed disk images +device geom_uzip +options GEOM_UZIP + +# Support md(4) and md-based rootfs +device md +options MD_ROOT + +# Interrupt controller support +device mtk_intr_gic + +# UART device support is compiled in when uart_ns8250 is selected (default) + +# SPI and SPI flash support +device mtk_spi_v2 +device spibus +device mx25l + +# GPIO and gpioled support +device mtk_gpio_v2 +device gpio +device gpioled + +# PCI support +device pci + +# USB (ehci, ohci) support +device usb +device xhci + +# USB umass(4) storage and da(4) support +device umass +device da + +# CAM support, required if umass(4) is enabled above +device pass +device scbus + +# Ethernet, BPF and bridge support +device rt +device bpf +device if_bridge + +# Extres +device ext_resources +device clk Modified: head/sys/mips/conf/MT7628_FDT ============================================================================== --- head/sys/mips/conf/MT7628_FDT Thu Apr 21 07:36:11 2016 (r298396) +++ head/sys/mips/conf/MT7628_FDT Thu Apr 21 07:40:03 2016 (r298397) @@ -1,8 +1,8 @@ # -# MT7628_FDT -- Kernel configuration file for FreeBSD/MIPS MT7628/MT7688 SoCs +# MT7628_FDT -- Kernel configuration file for FreeBSD/MIPS MT7628 and MT7688 +# SoCs # -# This includes all the configurable parts of the kernel. Please read through -# MEDIATEK kernel config and customize the options to fit your board if needed. +# This includes all the configurable parts of the kernel. # # $FreeBSD$ # @@ -12,19 +12,65 @@ # # FDT_DTS_FILE should be modified to suit the target board type. # -#makeoptions FDT_DTS_FILE=MT7628.dts - -# -# The user should never have to edit what's below this line. -# If customizations are needed, they should be done to the MEDIATEK kernel -# configuration. -# +#makeoptions FDT_DTS_FILE=LINKIT7688.dts # Start with a base configuration -include MEDIATEK_BASE +include "../mediatek/std.mediatek" ident MT7628 cpu CPU_MIPS24K -# Include optional configuration (to be edited by the user if needed) -include MEDIATEK +# Don't build any modules by default +makeoptions MODULES_OVERRIDE="" + +# Default rootfs device configuration, should be changed to suit target board +options ROOTDEVNAME=\"ufs:md0.uzip\" + +# Support geom_uzip(4) compressed disk images +device geom_uzip +options GEOM_UZIP + +# Support md(4) and md-based rootfs +device md +options MD_ROOT + +# Interrupt controller support +device mtk_intr_v2 + +# UART device support is compiled in when uart_ns8250 is selected (default) + +# SPI and SPI flash support +device mtk_spi_v2 +device spibus +device mx25l + +# GPIO and gpioled support +device mtk_gpio_v2 +device gpio +device gpioled + +# PCI support +device pci + +# USB (ehci, ohci) support +device usb +device mtk_usb_phy +device ehci +device ohci + +# USB umass(4) storage and da(4) support +device umass +device da + +# CAM support, required if umass(4) is enabled above +device pass +device scbus + +# Ethernet, BPF and bridge support +device rt +device bpf +device if_bridge + +# Extres +device ext_resources +device clk Modified: head/sys/mips/conf/RT3050_FDT ============================================================================== --- head/sys/mips/conf/RT3050_FDT Thu Apr 21 07:36:11 2016 (r298396) +++ head/sys/mips/conf/RT3050_FDT Thu Apr 21 07:40:03 2016 (r298397) @@ -1,9 +1,8 @@ # -# RT3050_FDT -- Kernel configuration file for FreeBSD/MIPS RT3050/RT3052/RT3350 -# SoCs +# RT3050_FDT -- Kernel configuration file for FreeBSD/MIPS RT3050, RT3052 and +# RT3350 SoCs # -# This includes all the configurable parts of the kernel. Please read through -# MEDIATEK kernel config and customize the options to fit your board if needed. +# This includes all the configurable parts of the kernel. # # $FreeBSD$ # @@ -15,17 +14,65 @@ # #makeoptions FDT_DTS_FILE=DIR-600-B1.dts -# -# The user should never have to edit what's below this line. -# If customizations are needed, they should be done to the MEDIATEK kernel -# configuration. -# - # Start with a base configuration -include MEDIATEK_BASE +include "../mediatek/std.mediatek" ident RT3050 cpu CPU_MIPS24K -# Include optional configuration (to be edited by the user if needed) -include MEDIATEK +# Don't build any modules by default +makeoptions MODULES_OVERRIDE="" + +# Default rootfs device configuration, should be changed to suit target board +options ROOTDEVNAME=\"ufs:md0.uzip\" + +# Support geom_uzip(4) compressed disk images +device geom_uzip +options GEOM_UZIP + +# Support md(4) and md-based rootfs +device md +options MD_ROOT + +# Interrupt controller support +device mtk_intr_v1 + +# UART device support +nodevice uart_ns8250 +device uart_dev_mtk + +# SPI and SPI flash support +device mtk_spi_v1 +device spibus +device mx25l + +# CFI support +device cfi +device cfid + +# GPIO and gpioled support +device mtk_gpio_v1 +device gpio +device gpioled + +# USB (dwcotg) support +device usb +device mtk_usb_phy +device dwcotg + +# USB umass(4) storage and da(4) support +device umass +device da + +# CAM support, required if umass(4) is enabled above +device pass +device scbus + +# Ethernet, BPF and bridge support +device rt +device bpf +device if_bridge + +# Extres +device ext_resources +device clk Modified: head/sys/mips/conf/RT3352_FDT ============================================================================== --- head/sys/mips/conf/RT3352_FDT Thu Apr 21 07:36:11 2016 (r298396) +++ head/sys/mips/conf/RT3352_FDT Thu Apr 21 07:40:03 2016 (r298397) @@ -1,8 +1,7 @@ # # RT3352_FDT -- Kernel configuration file for FreeBSD/MIPS RT3352 SoC # -# This includes all the configurable parts of the kernel. Please read through -# MEDIATEK kernel config and customize the options to fit your board if needed. +# This includes all the configurable parts of the kernel. # # $FreeBSD$ # @@ -14,17 +13,62 @@ # #makeoptions FDT_DTS_FILE=DIR-615-H1.dts -# -# The user should never have to edit what's below this line. -# If customizations are needed, they should be done to the MEDIATEK kernel -# configuration. -# - # Start with a base configuration -include MEDIATEK_BASE +include "../mediatek/std.mediatek" ident RT3352 cpu CPU_MIPS24K -# Include optional configuration (to be edited by the user if needed) -include MEDIATEK +# Don't build any modules by default +makeoptions MODULES_OVERRIDE="" + +# Default rootfs device configuration, should be changed to suit target board +options ROOTDEVNAME=\"ufs:md0.uzip\" + +# Support geom_uzip(4) compressed disk images +device geom_uzip +options GEOM_UZIP + +# Support md(4) and md-based rootfs +device md +options MD_ROOT + +# Interrupt controller support +device mtk_intr_v1 + +# UART device support +nodevice uart_ns8250 +device uart_dev_mtk + +# SPI and SPI flash support +device mtk_spi_v1 +device spibus +device mx25l + +# GPIO and gpioled support +device mtk_gpio_v1 +device gpio +device gpioled + +# USB (ehci, ohci) support +device usb +device mtk_usb_phy +device ehci +device ohci + +# USB umass(4) storage and da(4) support +device umass +device da + +# CAM support, required if umass(4) is enabled above +device pass +device scbus + +# Ethernet, BPF and bridge support +device rt +device bpf +device if_bridge + +# Extres +device ext_resources +device clk Modified: head/sys/mips/conf/RT3883_FDT ============================================================================== --- head/sys/mips/conf/RT3883_FDT Thu Apr 21 07:36:11 2016 (r298396) +++ head/sys/mips/conf/RT3883_FDT Thu Apr 21 07:40:03 2016 (r298397) @@ -1,8 +1,8 @@ # -# RT3883_FDT -- Kernel configuration file for FreeBSD/MIPS RT3662/RT3883 SoCs +# RT3883_FDT -- Kernel configuration file for FreeBSD/MIPS RT3662 and RT3883 +# SoCs # -# This includes all the configurable parts of the kernel. Please read through -# MEDIATEK kernel config and customize the options to fit your board if needed. +# This includes all the configurable parts of the kernel. # # $FreeBSD$ # @@ -14,17 +14,65 @@ # #makeoptions FDT_DTS_FILE=DIR-645.dts -# -# The user should never have to edit what's below this line. -# If customizations are needed, they should be done to the MEDIATEK kernel -# configuration. -# - # Start with a base configuration -include MEDIATEK_BASE +include "../mediatek/std.mediatek" ident RT3883 cpu CPU_MIPS74K -# Include optional configuration (to be edited by the user if needed) -include MEDIATEK +# Don't build any modules by default +makeoptions MODULES_OVERRIDE="" + +# Default rootfs device configuration, should be changed to suit target board +options ROOTDEVNAME=\"ufs:md0.uzip\" + +# Support geom_uzip(4) compressed disk images +device geom_uzip +options GEOM_UZIP + +# Support md(4) and md-based rootfs +device md +options MD_ROOT + +# Interrupt controller support +device mtk_intr_v1 + +# UART device support +nodevice uart_ns8250 +device uart_dev_mtk + +# SPI and SPI flash support +device mtk_spi_v1 +device spibus +device mx25l + +# CFI support +#device cfi +#device cfid + +# GPIO and gpioled support +device mtk_gpio_v1 +device gpio +device gpioled + +# USB (dwcotg) support +device usb +device mtk_usb_phy +device dwcotg + +# USB umass(4) storage and da(4) support +device umass +device da + +# CAM support, required if umass(4) is enabled above +device pass +device scbus + +# Ethernet, BPF and bridge support +device rt +device bpf +device if_bridge + +# Extres +device ext_resources +device clk Modified: head/sys/mips/conf/RT5350_FDT ============================================================================== --- head/sys/mips/conf/RT5350_FDT Thu Apr 21 07:36:11 2016 (r298396) +++ head/sys/mips/conf/RT5350_FDT Thu Apr 21 07:40:03 2016 (r298397) @@ -1,8 +1,7 @@ # # RT5350_FDT -- Kernel configuration file for FreeBSD/MIPS RT5350 SoC # -# This includes all the configurable parts of the kernel. Please read through -# MEDIATEK kernel config and customize the options to fit your board if needed. +# This includes all the configurable parts of the kernel. # # $FreeBSD$ # @@ -12,19 +11,64 @@ # # FDT_DTS_FILE should be modified to suit the target board type. # -#makeoptions FDT_DTS_FILE=DIR-300-B7.dts - -# -# The user should never have to edit what's below this line. -# If customizations are needed, they should be done to the MEDIATEK kernel -# configuration. -# +#makeoptions FDT_DTS_FILE=DIR-610-A1.dts # Start with a base configuration -include MEDIATEK_BASE +include "../mediatek/std.mediatek" ident RT5350 cpu CPU_MIPS24K -# Include optional configuration (to be edited by the user if needed) -include MEDIATEK +# Don't build any modules by default +makeoptions MODULES_OVERRIDE="" + +# Default rootfs device configuration, should be changed to suit target board +options ROOTDEVNAME=\"ufs:md0.uzip\" + +# Support geom_uzip(4) compressed disk images +device geom_uzip +options GEOM_UZIP + +# Support md(4) and md-based rootfs +device md +options MD_ROOT + +# Interrupt controller support +device mtk_intr_v1 + +# UART device support +nodevice uart_ns8250 +device uart_dev_mtk + +# SPI and SPI flash support +device mtk_spi_v1 +device spibus +device mx25l + +# GPIO and gpioled support +device mtk_gpio_v1 +device gpio +device gpioled + +# USB (ehci, ohci) support +device usb +device mtk_usb_phy +device ehci +device ohci + +# USB umass(4) storage and da(4) support +device umass +device da + +# CAM support, required if umass(4) is enabled above +device pass +device scbus + +# Ethernet, BPF and bridge support +device rt +device bpf +device if_bridge + +# Extres +device ext_resources +device clk Added: head/sys/mips/mediatek/files.mediatek ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mediatek/files.mediatek Thu Apr 21 07:40:03 2016 (r298397) @@ -0,0 +1,42 @@ +# $FreeBSD$ + +mips/mediatek/mtk_machdep.c standard +mips/mediatek/mtk_sysctl.c standard +mips/mediatek/mtk_soc.c standard +mips/mediatek/mtk_reset.c standard +mips/mediatek/mtk_clock.c standard +mips/mediatek/mtk_pinctrl.c standard +mips/mediatek/palmbus.c standard +mips/mediatek/mtk_intr_v1.c optional mtk_intr_v1 +mips/mediatek/mtk_intr_v2.c optional mtk_intr_v2 +mips/mediatek/mtk_intr_gic.c optional mtk_intr_gic +mips/mediatek/uart_dev_mtk.c optional uart uart_dev_mtk +mips/mediatek/uart_dev_mtk_ns8250.c optional uart uart_ns8250 +mips/mediatek/mtk_spi_v1.c optional spibus mtk_spi_v1 +mips/mediatek/mtk_spi_v2.c optional spibus mtk_spi_v2 +mips/mediatek/mtk_usb_phy.c optional usb mtk_usb_phy +mips/mediatek/mtk_xhci.c optional usb xhci +mips/mediatek/mtk_ohci.c optional usb ohci +mips/mediatek/mtk_ehci.c optional usb ehci +mips/mediatek/mtk_dotg.c optional usb dwcotg +mips/mediatek/mtk_pcie.c optional pci +mips/mediatek/mtk_gpio_v1.c optional gpio mtk_gpio_v1 +mips/mediatek/mtk_gpio_v2.c optional gpio mtk_gpio_v2 +#mips/mediatek/mtk_mmc.c optional mmc + +# Ralink/Mediatek Ethernet driver +dev/rt/if_rt.c optional rt + +# Hack to reuse ARM intrng code +kern/subr_intr.c standard +kern/pic_if.m standard + +# Intrng compatible MIPS32 interrupt controller +mips/mips/mips_pic.c standard + +# Standard MIPS ticker +mips/mips/tick.c standard + +# Temporary Reset if +mips/mediatek/fdt_reset.c standard +mips/mediatek/fdt_reset_if.m standard Added: head/sys/mips/mediatek/std.mediatek ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mediatek/std.mediatek Thu Apr 21 07:40:03 2016 (r298397) @@ -0,0 +1,84 @@ +# +# std.mtk -- Base kernel configuration file for FreeBSD/MIPS Mediatek/Ralink +# SoCs. +# +# This includes all the required drivers for the SoCs. +# +# $FreeBSD$ +# + +# Include the standard file list for Mediatek SoCs. +files "../mediatek/files.mediatek" + +# Building a mips/mipsel kernel +machine mips mipsel + +# Little-endian machine +makeoptions MIPS_LITTLE_ENDIAN=defined + +# Default kernel load address +makeoptions KERNLOADADDR=0x80001000 + +# Mediatek/Ralink SoC support depends on FDT (with static DTB for the moment) +options FDT +options FDT_DTB_STATIC + +# We rely on INTRNG code +options INTRNG +options MIPS_NIRQ=256 + +# We rely on NEW_PCIB code +options NEW_PCIB + +# Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g + +# Support for DDB and KDB +options DDB +options KDB + +# Debugging for use in -current +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS +options WITNESS_SKIPSPIN +options DEBUG_REDZONE +options DEBUG_MEMGUARD + +# For small memory footprints +options VM_KMEM_SIZE_SCALE=1 + +# General options, including scheduler, etc. +options SCHED_ULE # ULE scheduler +options INET # InterNETworking +#options INET6 # IPv6 +options PSEUDOFS # Pseude-filesystem framework +options FFS # Berkeley Fast Filesystem +#options SOFTUPDATES # Enable FFS soft updates support +#options UFS_ACL # Support for access control lists +#options UFS_DIRHASH # Improve big directory performance +#options MSDOSFS # Enable support for MSDOS filesystems +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time ext. + +# +# Standard drivers section +# +# The drivers in the following section are required in order to successfully +# compile the kernel. +# + +# FDT clock and pinctrl framework +device fdt_clock +device fdt_pinctrl + +# UART support +device uart + +# random support +device random + +# loop device support +device loop + +# ether device support +device ether From owner-svn-src-all@freebsd.org Thu Apr 21 07:43:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFCACB1612C; Thu, 21 Apr 2016 07:43:18 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54683116E; Thu, 21 Apr 2016 07:43:18 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id e201so15526146wme.2; Thu, 21 Apr 2016 00:43:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=twXT4gbnxP0pS+jxoAJ8xA0r/lQn1Gcrse2wrK0P3Us=; b=LL8FHSMG0DAp7eEJdmDu5zAFdSI7Zodkcv055+S1ZjSQBp2hL4foZnvvdj0C24SOLX akNZZI+vDh5ra8EncxmwhBGfx0vXQcEqr7vlbadGbOIGEANkEqkL1LBk8n9SwqP4XHNx JVvsFsopMl40ZneS/hywyM6zo4cpdTEQ4OKtuSTOs901rujYRAErtlFmbgqnU/RoNw6/ IDibxXLFo7bG2KsrLEq2NJsxKbItWr32vYN81V7AVE6dCalGKM17J4byc1oqXPKMjSuN OK96eW+86/QePCKa4BEM/CEvQUBBvF4M3Lrm9AJsVhSANgU80B3JyX4ThqNqG+R+SMlE jUXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=twXT4gbnxP0pS+jxoAJ8xA0r/lQn1Gcrse2wrK0P3Us=; b=bm6kiA9ZrYh0QLOfl1aNIqRcHJOBzdp3MiVPQ0F5V+QSTB/XEPOpaRWaZn4MSMv83G WcCSOKBG2va6bfXQo2gvHZKBQiKBHp3pXDJo4IhvoWLjWL6YpD04fpfiawxCSITkUOjZ UexRVnQX9IFD/Eg2SNujlhpwomwCGNxFvNReoOqFYS4sl258rFiA/8uZ9u5qXEnwZTkp sRx8czdqJ8V4YzSQhxWKctwwPlPjxx+KB7xCNF89uNdLxY1Rsf6lS8ywjCgrpvBRoEZK RA1uZaDgUk7SvWy7FNzYy0PQPKBA86Tn+iA7ITAJrLAMMKoMGiga+WkPCTsAJ/PhV1kk JaLQ== X-Gm-Message-State: AOPr4FU/6bBqFrv6DN3l0fwIbuOCL7y+7JIv+PRYSbNIPnNHMc4lh4ZN5tmW5CmW/tljfQ== X-Received: by 10.28.54.33 with SMTP id d33mr14016447wma.63.1461224596931; Thu, 21 Apr 2016 00:43:16 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id iv1sm1391863wjb.34.2016.04.21.00.43.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Apr 2016 00:43:15 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 21 Apr 2016 09:43:13 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r298367 - head/lib/libc/locale Message-ID: <20160421074313.GJ26116@ivaldir.etoilebsd.net> References: <201604202044.u3KKiUMq081452@repo.freebsd.org> <20160421062953.GI26116@ivaldir.etoilebsd.net> <7ef69cc0-4f38-788d-3fab-5058749cee8e@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="P6YfpwaDcfcOCJkJ" Content-Disposition: inline In-Reply-To: <7ef69cc0-4f38-788d-3fab-5058749cee8e@freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 07:43:18 -0000 --P6YfpwaDcfcOCJkJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 21, 2016 at 10:22:48AM +0300, Andrey Chernov wrote: > On 21.04.2016 9:29, Baptiste Daroussin wrote: > >>>> Modified: head/lib/libc/locale/ascii.c > >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > >>>> --- head/lib/libc/locale/ascii.c Wed Apr 20 20:43:05 2016 (r298366) > >>>> +++ head/lib/libc/locale/ascii.c Wed Apr 20 20:44:30 2016 (r298367) > >>>> @@ -133,11 +133,14 @@ _ascii_mbsnrtowcs(wchar_t * __restrict d > >>>> =20 > >>>> if (dst =3D=3D NULL) { > >>>> s =3D memchr(*src, '\0', nms); > >>>> + if (s =3D=3D NULL) > >>>> + return (nms); > >>>> + > >>>> if (*s & 0x80) { > >>>> errno =3D EILSEQ; > >>>> return ((size_t)-1); > >>>> } > >>>> - return (s !=3D NULL ? s - *src : nms); > >>>> + return (s - *src); > >>>> } > >>>> =20 > >>>> s =3D *src; > >>>> > >>> > >>> The whole code is incorrect, only the very first char is checked, the= re > >>> must be a loop like in -stable: > >>> > >>> if (dst =3D=3D NULL) { > >>> for (s =3D *src; nms > 0 && *s !=3D '\0'; s++, nms--)= { > >>> if (*s & 0x80) { > >>> errno =3D EILSEQ; > >>> return ((size_t)-1); > >>> } > >>> } > >>> return (s - *src); > >>> } > >>> > >>> Since svn history is lost on deleting, I don't know why incorrect > >>> version was committed. > >>> > >> > >> Typo, the very first =3D=3D the very last, i.e. only NUL char is check= ed > >> which always pass. > >> > >=20 > > I have restored the history (I hope correctly) > >=20 > > Bapt > >=20 >=20 I backed it out to the original version, I really sorry for all the mess I = made there. Bapt --P6YfpwaDcfcOCJkJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXGISRAAoJEGOJi9zxtz5aNrIQALfP2xXapdyu/Tm9ROGoSKiN RGTpRh38J8BLYi4/hqFbIoj0uUbFgKW3uJK+aKAxYFODU3KsMFnb8DAuPHEUc6jY bjWvVMNlvfd9bccDL6KhZEWSUa1IitZfrDKRIRXakN3EeQ6mPDYKBHJK9U1l5aF9 j+IPyZwMX/n18FLFF8u8fBgpVZWkHrujR4VgO4v0jxUXkx14VCM7q4FUHrqXWhqN ZGx4bSsUfJvzbX+ozYoLa5l1dt/v/CnIZNagsnTpOa1XJ6iK7E9o0XIjGJmWL99P 2ghoKnXAhAAR4tlgPgcV6fXCljBEXWFeQE8UVESNg9/AlZtIuZQAqfC/BvJxpe0U drGSAdo16Q0D9pqsNyERrsS37vWWnNLcTgGGg6OGC8D2dYz9rWqetvTvKeWdBBAZ RLhB1hwWBbnWJWw1RNOvIRCDWpNKQYxr+kkzXyggB65jS9hcZNW4Bmax0zooFX4W ITQrtp0LdCCfQwz0Qbo7XXk9OWbpTj/QHU6xQ0ojGSUrkiIULFhm4dXtDRM5dOTM /JiStD3ITaQ6j2bLEUQx43lZozUS3/bggqCynW6MMjlF5miekgHrvWtGNs1NvwgQ Rc6SQpBoWcm3cv8yi66P+plFLg+qtqRxY9ozxKrHvBTT73T1z9nGIuLL/l7bvEad QaTnpyYVqhr/3tx6/P1h =cZxm -----END PGP SIGNATURE----- --P6YfpwaDcfcOCJkJ-- From owner-svn-src-all@freebsd.org Thu Apr 21 08:55:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10C14B15E7B; Thu, 21 Apr 2016 08:55:50 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C4B75127A; Thu, 21 Apr 2016 08:55:49 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 64B9F25D3A00; Thu, 21 Apr 2016 08:55:39 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E9EE5D1F7E0; Thu, 21 Apr 2016 08:55:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id KcfbyicWSb_h; Thu, 21 Apr 2016 08:55:37 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:bd3c:6e05:eb25:14d] (unknown [IPv6:fde9:577b:c1a9:4410:bd3c:6e05:eb25:14d]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E555CD1F7DE; Thu, 21 Apr 2016 08:55:36 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy... From: "Bjoern A. Zeeb" In-Reply-To: <571653A6.5000700@freebsd.org> Date: Thu, 21 Apr 2016 08:55:16 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7B08E945-591C-48B8-82F7-F90656143924@lists.zabbadoz.net> References: <201604182309.u3IN9MC6047480@repo.freebsd.org> <3DB7C327-E42A-44AB-A1CB-FA34698B2CF3@lists.zabbadoz.net> <571653A6.5000700@freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 08:55:50 -0000 > On 19 Apr 2016, at 15:49 , Allan Jude wrote: >=20 > On 2016-04-19 05:08, Bjoern A. Zeeb wrote: >>=20 >>> On 18 Apr 2016, at 23:09 , Allan Jude wrote: >>>=20 >>> Author: allanjude >>> Date: Mon Apr 18 23:09:22 2016 >>> New Revision: 298230 >>> URL: https://svnweb.freebsd.org/changeset/base/298230 >>>=20 >>=20 >> Can you have a look at this please? >=20 > Fixed in r298275, sorry I missed that one Can you also look at this one, which still happens? =3D=3D> sys/boot/pc98/kgzldr (all) =3D=3D=3D> sys/boot/pc98/libpc98 (all) /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:740:33: error: = use of undeclared identifier 'f' struct i386_devdesc *dev =3D f->f_devdata; ^ /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/biosdisk.c:747:13: error: = too many arguments to function call, expected 7, have 8 size, buf, rsize)); ^~~~~ = /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98/../../common/bootstrap.h:79= :1: note: 'bcache_strategy' declared here int bcache_strategy(void *devdata, int rw, daddr_t blk, size_t = offset, ^ 2 errors generated. --- biosdisk.o --- *** [biosdisk.o] Error code 1 bmake[8]: stopped in /scratch/tmp/bz/head.svn/sys/boot/pc98/libpc98 =3D=3D=3D> sbin/ipf/ipmon (all) --- all --- *** [all] Error code 1 bmake[7]: stopped in /scratch/tmp/bz/head.svn/sys/boot/pc98 --- all --- *** [all] Error code 1 bmake[6]: stopped in /scratch/tmp/bz/head.svn/sys/boot --- all --- *** [all] Error code 1 bmake[5]: stopped in /scratch/tmp/bz/head.svn/sys --- all_subdir_sys --- *** [all_subdir_sys] Error code 1 bmake[4]: stopped in /scratch/tmp/bz/head.svn= From owner-svn-src-all@freebsd.org Thu Apr 21 10:58:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B1C3B17CFE; Thu, 21 Apr 2016 10:58:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 638CD18AF; Thu, 21 Apr 2016 10:58:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LAw8iH037265; Thu, 21 Apr 2016 10:58:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LAw8R7037260; Thu, 21 Apr 2016 10:58:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201604211058.u3LAw8R7037260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 21 Apr 2016 10:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298398 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 10:58:09 -0000 Author: ae Date: Thu Apr 21 10:58:07 2016 New Revision: 298398 URL: https://svnweb.freebsd.org/changeset/base/298398 Log: Constify mbuf pointer for IPSEC functions where mbuf isn't modified. Modified: head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec6.h head/sys/netipsec/key_debug.c head/sys/netipsec/key_debug.h Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Thu Apr 21 07:40:03 2016 (r298397) +++ head/sys/netipsec/ipsec.c Thu Apr 21 10:58:07 2016 (r298398) @@ -240,14 +240,14 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ipsec6, struct ipsecstat, ipsec6stat, "IPsec IPv6 statistics."); #endif /* INET6 */ -static int ipsec_in_reject(struct secpolicy *, struct mbuf *); -static int ipsec_setspidx_inpcb(struct mbuf *, struct inpcb *); -static int ipsec_setspidx(struct mbuf *, struct secpolicyindex *, int); -static void ipsec4_get_ulp(struct mbuf *m, struct secpolicyindex *, int); -static int ipsec4_setspidx_ipaddr(struct mbuf *, struct secpolicyindex *); +static int ipsec_in_reject(struct secpolicy *, const struct mbuf *); +static int ipsec_setspidx_inpcb(const struct mbuf *, struct inpcb *); +static int ipsec_setspidx(const struct mbuf *, struct secpolicyindex *, int); +static void ipsec4_get_ulp(const struct mbuf *m, struct secpolicyindex *, int); +static int ipsec4_setspidx_ipaddr(const struct mbuf *, struct secpolicyindex *); #ifdef INET6 -static void ipsec6_get_ulp(struct mbuf *m, struct secpolicyindex *, int); -static int ipsec6_setspidx_ipaddr(struct mbuf *, struct secpolicyindex *); +static void ipsec6_get_ulp(const struct mbuf *m, struct secpolicyindex *, int); +static int ipsec6_setspidx_ipaddr(const struct mbuf *, struct secpolicyindex *); #endif static void ipsec_delpcbpolicy(struct inpcbpolicy *); static struct secpolicy *ipsec_deepcopy_policy(struct secpolicy *src); @@ -324,7 +324,8 @@ ipsec_getpolicy(struct tdb_ident *tdbi, * NOTE: IPv6 mapped adddress concern is implemented here. */ static struct secpolicy * -ipsec_getpolicybysock(struct mbuf *m, u_int dir, struct inpcb *inp, int *error) +ipsec_getpolicybysock(const struct mbuf *m, u_int dir, struct inpcb *inp, + int *error) { struct inpcbpolicy *pcbsp; struct secpolicy *currsp = NULL; /* Policy on socket. */ @@ -427,7 +428,7 @@ ipsec_getpolicybysock(struct mbuf *m, u_ * others : error occured. */ struct secpolicy * -ipsec_getpolicybyaddr(struct mbuf *m, u_int dir, int *error) +ipsec_getpolicybyaddr(const struct mbuf *m, u_int dir, int *error) { struct secpolicyindex spidx; struct secpolicy *sp; @@ -457,7 +458,8 @@ ipsec_getpolicybyaddr(struct mbuf *m, u_ } struct secpolicy * -ipsec4_checkpolicy(struct mbuf *m, u_int dir, int *error, struct inpcb *inp) +ipsec4_checkpolicy(const struct mbuf *m, u_int dir, int *error, + struct inpcb *inp) { struct secpolicy *sp; @@ -499,7 +501,7 @@ ipsec4_checkpolicy(struct mbuf *m, u_int } static int -ipsec_setspidx_inpcb(struct mbuf *m, struct inpcb *inp) +ipsec_setspidx_inpcb(const struct mbuf *m, struct inpcb *inp) { int error; @@ -528,12 +530,13 @@ ipsec_setspidx_inpcb(struct mbuf *m, str * The caller is responsible for error recovery (like clearing up spidx). */ static int -ipsec_setspidx(struct mbuf *m, struct secpolicyindex *spidx, int needport) +ipsec_setspidx(const struct mbuf *m, struct secpolicyindex *spidx, + int needport) { - struct ip *ip = NULL; struct ip ipbuf; + const struct ip *ip = NULL; + const struct mbuf *n; u_int v; - struct mbuf *n; int len; int error; @@ -562,7 +565,7 @@ ipsec_setspidx(struct mbuf *m, struct se } if (m->m_len >= sizeof(*ip)) - ip = mtod(m, struct ip *); + ip = mtod(m, const struct ip *); else { m_copydata(m, 0, sizeof(ipbuf), (caddr_t)&ipbuf); ip = &ipbuf; @@ -598,7 +601,8 @@ ipsec_setspidx(struct mbuf *m, struct se } static void -ipsec4_get_ulp(struct mbuf *m, struct secpolicyindex *spidx, int needport) +ipsec4_get_ulp(const struct mbuf *m, struct secpolicyindex *spidx, + int needport) { u_int8_t nxt; int off; @@ -608,7 +612,7 @@ ipsec4_get_ulp(struct mbuf *m, struct se IPSEC_ASSERT(m->m_pkthdr.len >= sizeof(struct ip),("packet too short")); if (m->m_len >= sizeof (struct ip)) { - struct ip *ip = mtod(m, struct ip *); + const struct ip *ip = mtod(m, const struct ip *); if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) goto done; off = ip->ip_hl << 2; @@ -673,7 +677,7 @@ done_proto: /* Assumes that m is sane. */ static int -ipsec4_setspidx_ipaddr(struct mbuf *m, struct secpolicyindex *spidx) +ipsec4_setspidx_ipaddr(const struct mbuf *m, struct secpolicyindex *spidx) { static const struct sockaddr_in template = { sizeof (struct sockaddr_in), @@ -692,7 +696,7 @@ ipsec4_setspidx_ipaddr(struct mbuf *m, s sizeof (struct in_addr), (caddr_t) &spidx->dst.sin.sin_addr); } else { - struct ip *ip = mtod(m, struct ip *); + const struct ip *ip = mtod(m, const struct ip *); spidx->src.sin.sin_addr = ip->ip_src; spidx->dst.sin.sin_addr = ip->ip_dst; } @@ -705,7 +709,8 @@ ipsec4_setspidx_ipaddr(struct mbuf *m, s #ifdef INET6 static void -ipsec6_get_ulp(struct mbuf *m, struct secpolicyindex *spidx, int needport) +ipsec6_get_ulp(const struct mbuf *m, struct secpolicyindex *spidx, + int needport) { int off, nxt; struct tcphdr th; @@ -769,14 +774,14 @@ ipsec6_get_ulp(struct mbuf *m, struct se /* Assumes that m is sane. */ static int -ipsec6_setspidx_ipaddr(struct mbuf *m, struct secpolicyindex *spidx) +ipsec6_setspidx_ipaddr(const struct mbuf *m, struct secpolicyindex *spidx) { - struct ip6_hdr *ip6 = NULL; struct ip6_hdr ip6buf; + const struct ip6_hdr *ip6 = NULL; struct sockaddr_in6 *sin6; if (m->m_len >= sizeof(*ip6)) - ip6 = mtod(m, struct ip6_hdr *); + ip6 = mtod(m, const struct ip6_hdr *); else { m_copydata(m, 0, sizeof(ip6buf), (caddr_t)&ip6buf); ip6 = &ip6buf; @@ -1229,7 +1234,7 @@ ipsec_get_reqlevel(struct ipsecrequest * * 1: invalid */ static int -ipsec_in_reject(struct secpolicy *sp, struct mbuf *m) +ipsec_in_reject(struct secpolicy *sp, const struct mbuf *m) { struct ipsecrequest *isr; int need_auth; @@ -1300,7 +1305,7 @@ ipsec_in_reject(struct secpolicy *sp, st * Non zero return value means security policy DISCARD or policy violation. */ static int -ipsec46_in_reject(struct mbuf *m, struct inpcb *inp) +ipsec46_in_reject(const struct mbuf *m, struct inpcb *inp) { struct secpolicy *sp; int error; @@ -1332,7 +1337,7 @@ ipsec46_in_reject(struct mbuf *m, struct * and {ah,esp}4_input for tunnel mode. */ int -ipsec4_in_reject(struct mbuf *m, struct inpcb *inp) +ipsec4_in_reject(const struct mbuf *m, struct inpcb *inp) { int result; @@ -1350,7 +1355,7 @@ ipsec4_in_reject(struct mbuf *m, struct * and {ah,esp}6_input for tunnel mode. */ int -ipsec6_in_reject(struct mbuf *m, struct inpcb *inp) +ipsec6_in_reject(const struct mbuf *m, struct inpcb *inp) { int result; @@ -1430,7 +1435,7 @@ ipsec_hdrsiz_internal(struct secpolicy * * disabled ip6_ipsec_mtu() and ip6_forward(). */ size_t -ipsec_hdrsiz(struct mbuf *m, u_int dir, struct inpcb *inp) +ipsec_hdrsiz(const struct mbuf *m, u_int dir, struct inpcb *inp) { struct secpolicy *sp; int error; @@ -1678,16 +1683,16 @@ ipsec_logsastr(struct secasvar *sav, cha } void -ipsec_dumpmbuf(struct mbuf *m) +ipsec_dumpmbuf(const struct mbuf *m) { + const u_char *p; int totlen; int i; - u_char *p; totlen = 0; printf("---\n"); while (m) { - p = mtod(m, u_char *); + p = mtod(m, const u_char *); for (i = 0; i < m->m_len; i++) { printf("%02x ", p[i]); totlen++; Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Thu Apr 21 07:40:03 2016 (r298397) +++ head/sys/netipsec/ipsec.h Thu Apr 21 10:58:07 2016 (r298398) @@ -311,9 +311,10 @@ extern void ipsec_delisr(struct ipsecreq struct tdb_ident; extern struct secpolicy *ipsec_getpolicy(struct tdb_ident*, u_int); struct inpcb; -extern struct secpolicy *ipsec4_checkpolicy(struct mbuf *, u_int, - int *, struct inpcb *); -extern struct secpolicy * ipsec_getpolicybyaddr(struct mbuf *, u_int, int *); +extern struct secpolicy *ipsec4_checkpolicy(const struct mbuf *, u_int, + int *, struct inpcb *); +extern struct secpolicy * ipsec_getpolicybyaddr(const struct mbuf *, u_int, + int *); struct inpcb; extern int ipsec_init_policy(struct socket *so, struct inpcbpolicy **); @@ -323,23 +324,23 @@ extern u_int ipsec_get_reqlevel(struct i extern int ipsec_set_policy(struct inpcb *inp, int optname, caddr_t request, size_t len, struct ucred *cred); extern int ipsec_get_policy(struct inpcb *inpcb, caddr_t request, - size_t len, struct mbuf **mp); + size_t len, struct mbuf **mp); extern int ipsec_delete_pcbpolicy(struct inpcb *); -extern int ipsec4_in_reject(struct mbuf *, struct inpcb *); +extern int ipsec4_in_reject(const struct mbuf *, struct inpcb *); struct secas; struct tcpcb; extern int ipsec_chkreplay(u_int32_t, struct secasvar *); extern int ipsec_updatereplay(u_int32_t, struct secasvar *); -extern size_t ipsec_hdrsiz(struct mbuf *, u_int, struct inpcb *); +extern size_t ipsec_hdrsiz(const struct mbuf *, u_int, struct inpcb *); extern size_t ipsec_hdrsiz_tcp(struct tcpcb *); union sockaddr_union; extern char *ipsec_address(union sockaddr_union *, char *, socklen_t); extern char *ipsec_logsastr(struct secasvar *, char *, size_t); -extern void ipsec_dumpmbuf(struct mbuf *); +extern void ipsec_dumpmbuf(const struct mbuf *); struct m_tag; extern int ah4_input(struct mbuf **mp, int *offp, int proto); Modified: head/sys/netipsec/ipsec6.h ============================================================================== --- head/sys/netipsec/ipsec6.h Thu Apr 21 07:40:03 2016 (r298397) +++ head/sys/netipsec/ipsec6.h Thu Apr 21 10:58:07 2016 (r298398) @@ -59,7 +59,7 @@ VNET_DECLARE(int, ip6_ipsec_ecn); #define V_ip6_ipsec_ecn VNET(ip6_ipsec_ecn) struct inpcb; -extern int ipsec6_in_reject(struct mbuf *, struct inpcb *); +extern int ipsec6_in_reject(const struct mbuf *, struct inpcb *); struct m_tag; extern int ipsec6_common_input(struct mbuf **mp, int *offp, int proto); Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Thu Apr 21 07:40:03 2016 (r298397) +++ head/sys/netipsec/key_debug.c Thu Apr 21 10:58:07 2016 (r298398) @@ -623,7 +623,7 @@ kdebug_secreplay(struct secreplay *rpl) } void -kdebug_mbufhdr(struct mbuf *m) +kdebug_mbufhdr(const struct mbuf *m) { /* sanity check */ if (m == NULL) @@ -650,9 +650,9 @@ kdebug_mbufhdr(struct mbuf *m) } void -kdebug_mbuf(struct mbuf *m0) +kdebug_mbuf(const struct mbuf *m0) { - struct mbuf *m = m0; + const struct mbuf *m = m0; int i, j; for (j = 0; m; m = m->m_next) { @@ -663,7 +663,7 @@ kdebug_mbuf(struct mbuf *m0) printf("\n"); if (i % 4 == 0) printf(" "); - printf("%02x", mtod(m, u_char *)[i]); + printf("%02x", mtod(m, const u_char *)[i]); j++; } printf("\n"); Modified: head/sys/netipsec/key_debug.h ============================================================================== --- head/sys/netipsec/key_debug.h Thu Apr 21 07:40:03 2016 (r298397) +++ head/sys/netipsec/key_debug.h Thu Apr 21 10:58:07 2016 (r298398) @@ -76,8 +76,8 @@ extern void kdebug_secpolicy(struct secp extern void kdebug_secpolicyindex(struct secpolicyindex *); extern void kdebug_secasindex(struct secasindex *); extern void kdebug_secasv(struct secasvar *); -extern void kdebug_mbufhdr(struct mbuf *); -extern void kdebug_mbuf(struct mbuf *); +extern void kdebug_mbufhdr(const struct mbuf *); +extern void kdebug_mbuf(const struct mbuf *); #endif /*_KERNEL*/ struct sockaddr; From owner-svn-src-all@freebsd.org Thu Apr 21 11:02:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 623AFB17EF2; Thu, 21 Apr 2016 11:02:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3207D1CA4; Thu, 21 Apr 2016 11:02:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LB2644037696; Thu, 21 Apr 2016 11:02:06 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LB26bY037695; Thu, 21 Apr 2016 11:02:06 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201604211102.u3LB26bY037695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 21 Apr 2016 11:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298399 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 11:02:07 -0000 Author: ae Date: Thu Apr 21 11:02:06 2016 New Revision: 298399 URL: https://svnweb.freebsd.org/changeset/base/298399 Log: Remove stale function declaration Modified: head/sys/netipsec/ipsec.h Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Thu Apr 21 10:58:07 2016 (r298398) +++ head/sys/netipsec/ipsec.h Thu Apr 21 11:02:06 2016 (r298399) @@ -354,8 +354,6 @@ extern int ipsec4_common_input_cb(struct extern int ipsec4_process_packet(struct mbuf *, struct ipsecrequest *); extern int ipsec_process_done(struct mbuf *, struct ipsecrequest *); -extern struct mbuf *ipsec_copypkt(struct mbuf *); - extern void m_checkalignment(const char* where, struct mbuf *m0, int off, int len); extern struct mbuf *m_makespace(struct mbuf *m0, int skip, int hlen, int *off); From owner-svn-src-all@freebsd.org Thu Apr 21 11:32:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5B1AB16B9E; Thu, 21 Apr 2016 11:32:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89E731FFA; Thu, 21 Apr 2016 11:32:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LBWMrp050917; Thu, 21 Apr 2016 11:32:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LBWMBN050916; Thu, 21 Apr 2016 11:32:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604211132.u3LBWMBN050916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 21 Apr 2016 11:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298400 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 11:32:23 -0000 Author: hselasky Date: Thu Apr 21 11:32:22 2016 New Revision: 298400 URL: https://svnweb.freebsd.org/changeset/base/298400 Log: Properly setup arguments for if_resolvemulti() callback. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/addr.c Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 21 11:02:06 2016 (r298399) +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 21 11:32:22 2016 (r298400) @@ -310,13 +310,19 @@ mcast: return rdma_copy_addr(addr, ifp, ifp->if_broadcastaddr); if (multi) { struct sockaddr *llsa; + struct sockaddr_dl sdl; + + sdl.sdl_len = sizeof(sdl); + llsa = (struct sockaddr *)&sdl; + + if (ifp->if_resolvemulti == NULL) + return -EOPNOTSUPP; error = ifp->if_resolvemulti(ifp, &llsa, dst_in); if (error) return -error; error = rdma_copy_addr(addr, ifp, LLADDR((struct sockaddr_dl *)llsa)); - free(llsa, M_IFMADDR); if (error == 0) memcpy(src_in, ifa->ifa_addr, ip_addr_size(ifa->ifa_addr)); return error; From owner-svn-src-all@freebsd.org Thu Apr 21 12:58:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4683DB16088; Thu, 21 Apr 2016 12:58:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09C091DCE; Thu, 21 Apr 2016 12:58:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LCwUcR076363; Thu, 21 Apr 2016 12:58:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LCwTjn076353; Thu, 21 Apr 2016 12:58:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604211258.u3LCwTjn076353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Apr 2016 12:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298401 - in head: lib/libdwarf lib/libelf lib/libelftc usr.bin/addr2line usr.bin/cxxfilt usr.bin/elfcopy usr.bin/nm usr.bin/readelf usr.bin/size usr.bin/strings X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 12:58:31 -0000 Author: emaste Date: Thu Apr 21 12:58:29 2016 New Revision: 298401 URL: https://svnweb.freebsd.org/changeset/base/298401 Log: elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree It's provided by sys.mk so there's no need to derive it from ${.CURDIR}. Suggested by: ngie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5998 Modified: head/lib/libdwarf/Makefile head/lib/libelf/Makefile head/lib/libelftc/Makefile head/usr.bin/addr2line/Makefile head/usr.bin/cxxfilt/Makefile head/usr.bin/elfcopy/Makefile head/usr.bin/nm/Makefile head/usr.bin/readelf/Makefile head/usr.bin/size/Makefile head/usr.bin/strings/Makefile Modified: head/lib/libdwarf/Makefile ============================================================================== --- head/lib/libdwarf/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/lib/libdwarf/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -2,8 +2,8 @@ .include PACKAGE=lib${LIB} -TOP= ${.CURDIR:H:H}/contrib/elftoolchain -SRCDIR= ${TOP}/libdwarf +ELFTCDIR=${SRCTOP}/contrib/elftoolchain +SRCDIR= ${ELFTCDIR}/libdwarf .PATH: ${SRCDIR} @@ -92,7 +92,7 @@ GENSRCS= dwarf_pubnames.c dwarf_pubtypes dwarf_pro_vars.c CLEANFILES= ${GENSRCS} CLEANDIRS= sys -CFLAGS+= -I. -I${SRCDIR} -I${TOP}/common -I${TOP}/libelf +CFLAGS+= -I. -I${SRCDIR} -I${ELFTCDIR}/common -I${ELFTCDIR}/libelf sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET} .NOMETA mkdir -p ${.OBJDIR}/sys Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/lib/libelf/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -5,8 +5,8 @@ SHLIBDIR?= /lib .include -TOP= ${.CURDIR:H:H}/contrib/elftoolchain -SRCDIR= ${TOP}/libelf +ELFTCDIR=${SRCTOP}/contrib/elftoolchain +SRCDIR= ${ELFTCDIR}/libelf .PATH: ${SRCDIR} @@ -80,7 +80,7 @@ SRCS+= sys/elf32.h sys/elf64.h sys/elf_c GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c CLEANFILES= ${GENSRCS} CLEANDIRS= sys -CFLAGS+= -I. -I${SRCDIR} -I${TOP}/common +CFLAGS+= -I. -I${SRCDIR} -I${ELFTCDIR}/common sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET} .NOMETA mkdir -p ${.OBJDIR}/sys Modified: head/lib/libelftc/Makefile ============================================================================== --- head/lib/libelftc/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/lib/libelftc/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -4,7 +4,7 @@ PACKAGE=lib${LIB} INTERNALLIB= -ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain .PATH: ${ELFTCDIR}/libelftc Modified: head/usr.bin/addr2line/Makefile ============================================================================== --- head/usr.bin/addr2line/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/usr.bin/addr2line/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain ADDR2LINEDIR= ${ELFTCDIR}/addr2line .PATH: ${ADDR2LINEDIR} Modified: head/usr.bin/cxxfilt/Makefile ============================================================================== --- head/usr.bin/cxxfilt/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/usr.bin/cxxfilt/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain SRCDIR= ${ELFTCDIR}/cxxfilt .PATH: ${SRCDIR} Modified: head/usr.bin/elfcopy/Makefile ============================================================================== --- head/usr.bin/elfcopy/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/usr.bin/elfcopy/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain ELFCOPYDIR= ${ELFTCDIR}/elfcopy .PATH: ${ELFCOPYDIR} Modified: head/usr.bin/nm/Makefile ============================================================================== --- head/usr.bin/nm/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/usr.bin/nm/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain NMDIR= ${ELFTCDIR}/nm .PATH: ${NMDIR} Modified: head/usr.bin/readelf/Makefile ============================================================================== --- head/usr.bin/readelf/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/usr.bin/readelf/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -1,6 +1,6 @@ # $FreeBSD$ -ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain READELFDIR= ${ELFTCDIR}/readelf .PATH: ${READELFDIR} Modified: head/usr.bin/size/Makefile ============================================================================== --- head/usr.bin/size/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/usr.bin/size/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain SIZEDIR= ${ELFTCDIR}/size .PATH: ${SIZEDIR} Modified: head/usr.bin/strings/Makefile ============================================================================== --- head/usr.bin/strings/Makefile Thu Apr 21 11:32:22 2016 (r298400) +++ head/usr.bin/strings/Makefile Thu Apr 21 12:58:29 2016 (r298401) @@ -2,7 +2,7 @@ .include -ELFTCDIR= ${.CURDIR:H:H}/contrib/elftoolchain +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain .PATH: ${ELFTCDIR}/strings From owner-svn-src-all@freebsd.org Thu Apr 21 13:14:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4102B169E9; Thu, 21 Apr 2016 13:14:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95BC51B9F; Thu, 21 Apr 2016 13:14:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LDEt8Y083063; Thu, 21 Apr 2016 13:14:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LDEtc6083062; Thu, 21 Apr 2016 13:14:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604211314.u3LDEtc6083062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Apr 2016 13:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298402 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 13:14:56 -0000 Author: emaste Date: Thu Apr 21 13:14:55 2016 New Revision: 298402 URL: https://svnweb.freebsd.org/changeset/base/298402 Log: Adjust BOOTSTRAPPING test after MFC of kbdcontrol's -P option Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 21 12:58:29 2016 (r298401) +++ head/Makefile.inc1 Thu Apr 21 13:14:55 2016 (r298402) @@ -1520,8 +1520,9 @@ _crunch= usr.sbin/crunch _awk= usr.bin/awk .endif -# r296926 -P keymap search path -.if ${BOOTSTRAPPING} < 1100103 +# r296926 -P keymap search path, MFC to stable/10 in r298297 +.if ${BOOTSTRAPPING} < 1003501 || \ + (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) _kbdcontrol= usr.sbin/kbdcontrol .endif From owner-svn-src-all@freebsd.org Thu Apr 21 13:15:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7E80B16AD3; Thu, 21 Apr 2016 13:15:55 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A93F1D55; Thu, 21 Apr 2016 13:15:55 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: by mail-pf0-x22c.google.com with SMTP id e128so30043144pfe.3; Thu, 21 Apr 2016 06:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:mime-version:from:subject:date:to; bh=C+CAkg6sRLNQeubF287kxidsfYYRrw4iV9F8NRHFOEQ=; b=LlsoMpNvU8sPvT6+h4+9sj3+fscJPwafnxeaONgGCPTdStDJgsk85DP52J/40T2VeW ztAajvt8oaITaXgA2EXtSKsCKB7QT7kbJx3YnP20WC9Gi9/7gyyflx6EVd9IvyHIx1aP nmnIRzsxzbmXoCErNo/+c4CZjhOwuiB5TUJ0oBmBUxzdLmHPGmDEiiuakSrsnWaOIwXS 5RC6kyRA4uXhA6w53ZV1AZcq+dL3W9ts2yucQ/VtFyI/8QCmhz0l2U1dKWPRgFIzTtNZ PBBR7jGz9Dx/6jytciQN6cYMj491mYcEf2RJOIKW4TJFxsUMs4Q1DH88mqkGo5xlsaSe xkww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:mime-version:from:subject:date:to; bh=C+CAkg6sRLNQeubF287kxidsfYYRrw4iV9F8NRHFOEQ=; b=LzODT3Z0Oxo9fJcPbrxTa4uhk2s/Py1xR6vDnqx9UU0P+cMlVGLBC7J+7bYxsO23xK PHTOGqaQhLeDGhgmNQnrNy0luOpdtBB24p11fpWSiW1y7xBqyB+qktIAhKQjdeg/mAd3 mX4cmqmUSV/O1LoQkFVkoGdmje/46625bBf1/phQiwUJnMjhyq08zgjqwgXFpxFZvDD+ 1M7aRUcFvL5mfsdqvJ2kAZTFl5VdsgcuJQTBFUa0/5feg89ANcrDYSGAydicDS1V7JP2 +ckJYnBdO060F6dWVf1WZopWXkZuxRruHpP0nl9004wwu9jREH7VZmlBsVMrowfEgfSi 7qGw== X-Gm-Message-State: AOPr4FU8G23/V25XEMnEnWoAB1KNbJCeygBCvODvXtoJP/uySvQqKWR2w6ZUshaMj7lpzA== X-Received: by 10.98.64.79 with SMTP id n76mr20476826pfa.149.1461244554970; Thu, 21 Apr 2016 06:15:54 -0700 (PDT) Received: from [25.188.27.85] (S0106002401cb186f.gv.shawcable.net. [96.50.22.10]) by smtp.gmail.com with ESMTPSA id u2sm2189641pan.45.2016.04.21.06.15.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Apr 2016 06:15:54 -0700 (PDT) Message-ID: <5718d28a.8231420a.4e0ff.395e@mx.google.com> MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r298378 - head/usr.bin/localedef Date: Thu, 21 Apr 2016 06:15:56 -0700 To: Baptiste Daroussin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "cy@freebsd.org" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 13:15:55 -0000 U2hvdWxkIHdlIE1GQyB0aGlzIHRvbz8NCg0KU2VudCBmcm9tIG15IGNlbGxwaG9uZSwNCn5DeQ0K DQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogQmFwdGlzdGUgRGFyb3Vzc2luDQpT ZW50OiAyMC8wNC8yMDE2IDE0OjIzDQpUbzogc3JjLWNvbW1pdHRlcnNAZnJlZWJzZC5vcmc7IHN2 bi1zcmMtYWxsQGZyZWVic2Qub3JnOyBzdm4tc3JjLWhlYWRAZnJlZWJzZC5vcmcNClN1YmplY3Q6 IHN2biBjb21taXQ6IHIyOTgzNzggLSBoZWFkL3Vzci5iaW4vbG9jYWxlZGVmDQoNCkF1dGhvcjog YmFwdA0KRGF0ZTogV2VkIEFwciAyMCAyMToyMzo0MiAyMDE2DQpOZXcgUmV2aXNpb246IDI5ODM3 OA0KVVJMOiBodHRwczovL3N2bndlYi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8yOTgzNzgN Cg0KTG9nOg0KICBQbHVnIG1lbW9yeSBsZWFrcw0KICANCiAgUmVwb3J0ZWQgYnk6CUNvdmVyaXR5 DQogIENJRD0JCTEzMzg1MzUsIDEzMzg1MzYsIDEzMzg1NDIsIDEzMzg1NjksIDEzMzg1NzANCg0K TW9kaWZpZWQ6DQogIGhlYWQvdXNyLmJpbi9sb2NhbGVkZWYvY29sbGF0ZS5jDQogIGhlYWQvdXNy LmJpbi9sb2NhbGVkZWYvdGltZS5jDQoNCk1vZGlmaWVkOiBoZWFkL3Vzci5iaW4vbG9jYWxlZGVm L2NvbGxhdGUuYw0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQotLS0gaGVhZC91c3IuYmluL2xvY2Fs ZWRlZi9jb2xsYXRlLmMJV2VkIEFwciAyMCAyMToyMTo0NyAyMDE2CShyMjk4Mzc3KQ0KKysrIGhl YWQvdXNyLmJpbi9sb2NhbGVkZWYvY29sbGF0ZS5jCVdlZCBBcHIgMjAgMjE6MjM6NDIgMjAxNgko cjI5ODM3OCkNCkBAIC01MDIsNiArNTAyLDcgQEAgZGVmaW5lX2NvbGxzeW0oY2hhciAqbmFtZSkN CiAJCSAqIFRoaXMgc2hvdWxkIG5ldmVyIGhhcHBlbiBiZWNhdXNlIHdlIGFyZSBvbmx5IGNhbGxl ZA0KIAkJICogZm9yIHVuZGVmaW5lZCBzeW1ib2xzLg0KIAkJICovDQorCQlmcmVlKHN5bSk7DQog CQlJTlRFUlI7DQogCQlyZXR1cm47DQogCX0NCkBAIC01MzgsNiArNTM5LDcgQEAgZ2V0X2NvbGx1 bmRlZihjaGFyICpuYW1lKQ0KIAkJaWYgKCgodWQgPSBjYWxsb2Moc2l6ZW9mICgqdWQpLCAxKSkg PT0gTlVMTCkgfHwNCiAJCSAgICAoKHVkLT5uYW1lID0gc3RyZHVwKG5hbWUpKSA9PSBOVUxMKSkg ew0KIAkJCWZwcmludGYoc3RkZXJyLCJvdXQgb2YgbWVtb3J5Iik7DQorCQkJZnJlZSh1ZCk7DQog CQkJcmV0dXJuIChOVUxMKTsNCiAJCX0NCiAJCWZvciAoaSA9IDA7IGkgPCBOVU1fV1Q7IGkrKykg ew0KQEAgLTgxMiw2ICs4MTQsNyBAQCBkZWZpbmVfY29sbGVsZW0oY2hhciAqbmFtZSwgd2NoYXJf dCAqd2NzDQogCWlmICgoUkJfRklORChlbGVtX2J5X3N5bWJvbCwgJmVsZW1fYnlfc3ltYm9sLCBl KSAhPSBOVUxMKSB8fA0KIAkgICAgKFJCX0ZJTkQoZWxlbV9ieV9leHBhbmQsICZlbGVtX2J5X2V4 cGFuZCwgZSkgIT0gTlVMTCkpIHsNCiAJCWZwcmludGYoc3RkZXJyLCAiZHVwbGljYXRlIGNvbGxh dGluZyBlbGVtZW50IGRlZmluaXRpb24iKTsNCisJCWZyZWUoZSk7DQogCQlyZXR1cm47DQogCX0N CiAJUkJfSU5TRVJUKGVsZW1fYnlfc3ltYm9sLCAmZWxlbV9ieV9zeW1ib2wsIGUpOw0KDQpNb2Rp ZmllZDogaGVhZC91c3IuYmluL2xvY2FsZWRlZi90aW1lLmMNCj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PQ0KLS0tIGhlYWQvdXNyLmJpbi9sb2NhbGVkZWYvdGltZS5jCVdlZCBBcHIgMjAgMjE6MjE6NDcg MjAxNgkocjI5ODM3NykNCisrKyBoZWFkL3Vzci5iaW4vbG9jYWxlZGVmL3RpbWUuYwlXZWQgQXBy IDIwIDIxOjIzOjQyIDIwMTYJKHIyOTgzNzgpDQpAQCAtODcsNiArODcsNyBAQCBhZGRfdGltZV9z dHIod2NoYXJfdCAqd2NzKQ0KIAljYXNlIFRfRVJBX1RfRk1UOg0KIAljYXNlIFRfRVJBX0RfVF9G TVQ6DQogCQkvKiBTaWxlbnRseSBpZ25vcmUgaXQuICovDQorCQlmcmVlKHN0cik7DQogCQlicmVh azsNCiAJZGVmYXVsdDoNCiAJCWZyZWUoc3RyKTsNCkBAIC0xMzksNiArMTQwLDcgQEAgYWRkX3Rp bWVfbGlzdCh3Y2hhcl90ICp3Y3MpDQogCQkJdG0ucG0gPSBzdHI7DQogCQl9IGVsc2Ugew0KIAkJ CWZwcmludGYoc3RkZXJyLCJ0b28gbWFueSBsaXN0IGVsZW1lbnRzIik7DQorCQkJZnJlZShzdHIp Ow0KIAkJfQ0KIAkJYnJlYWs7DQogCWNhc2UgVF9BTFRfRElHSVRTOg0KDQo= From owner-svn-src-all@freebsd.org Thu Apr 21 13:21:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40F48B16DFA; Thu, 21 Apr 2016 13:21:58 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6F6911D6; Thu, 21 Apr 2016 13:21:57 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id l6so21494069wml.3; Thu, 21 Apr 2016 06:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9Nw7r7neI3qreKKtcNjy6jSnQeQLXRMVc0rB1fqIIYY=; b=Xbm2VFIGGh67llG+iG9K5OoYFAvbg9V1GoqRRdnkxK8CG/Ns+Ozdc7kkvGZ0tUNxdi /7swr1BTB51JPabNVMNVBzcAYfoVrJBH3hQHXKcxgBANKzDGMAvDeFEN7+SaR9xxQ+UA dt8GACXGGuR+RfI2z5cvfCvc0g2oFqIZaMw9ZQvFtpyBzFwzuy83ogxlD/Oa/iNd9Rze zxQoFuBqi7PX1g31o6+ibxTSvrzLhO8Xkl/CsTnwZXruqJm3dyoD71kZulsb0zAqHOm5 zLQp3llPD8DYJL5zHHmR0W2D9XPDG+N2P2oQSceyYrvkBhV+A5DxxPHdA3hIK12BSd0Y kfIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=9Nw7r7neI3qreKKtcNjy6jSnQeQLXRMVc0rB1fqIIYY=; b=QKSS+SzHcoXbZJQcdzR4xI5SY6vQ5b865YK0jhabG3gXjsR/YzkLd3y5umpXBX0vAu Eg0bbtZiOT276ft1VEMIlsGm4TV+ADT+Pcf0jVU0w/fi1cEGd0/HWWd2NFbFBpIjfPHR MrrMcnGd/3wS1oetcfpLPFr3sJ/7JN9/AiI4vByjofYCYKc/SBC+tFpRXIwQ3ZeeBnbO mEgEGj1NWlVN7usBum+cH4PeDIzJP3mEfewZy/O9fY4rgsF3jsnnb+KkwA4bI1yOk95R wCBmkAOjzS9ufwthjobRuf52w3o7nk7OlIQzE9NwjOMR1wpS8xAOCOuQmdAv9wxoJMYV TgCw== X-Gm-Message-State: AOPr4FXinHQLvYK4pSXps3yHP+rw8lg0QK/+jYnhGMifphEQVgtgEgRpDhvBZ1vJ7DLRTA== X-Received: by 10.28.60.134 with SMTP id j128mr15184470wma.71.1461244916337; Thu, 21 Apr 2016 06:21:56 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id lh1sm2860047wjb.20.2016.04.21.06.21.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Apr 2016 06:21:55 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 21 Apr 2016 15:21:53 +0200 From: Baptiste Daroussin To: Cy Schubert Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "cy@freebsd.org" Subject: Re: svn commit: r298378 - head/usr.bin/localedef Message-ID: <20160421132153.GK26116@ivaldir.etoilebsd.net> References: <5718d28a.8231420a.4e0ff.395e@mx.google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="/0P/MvzTfyTu5j9Q" Content-Disposition: inline In-Reply-To: <5718d28a.8231420a.4e0ff.395e@mx.google.com> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 13:21:58 -0000 --/0P/MvzTfyTu5j9Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 21, 2016 at 06:15:56AM -0700, Cy Schubert wrote: > Should we MFC this too? >=20 localdef is only on head Best regards, Bapt --/0P/MvzTfyTu5j9Q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXGNPxAAoJEGOJi9zxtz5aZ24P/2Hr22IPpze1iThb1KP9Z7Dx kJO6nQ+mzhU+ZwNV+ezl7Js0jSnSaHD9VKSiuZfZERzHIzmIkEsACerclkriWbMb eDAzBvYWlG81VmOdzZz5MD2zpsTLoqagedwHGbgttExHEBnbrAS1FA9n6EXsU2E1 JYXqfqFtYoa3X/pXBp24kUWUoWHNnGxjmZDu8GaR8XH2HkvPe8EYk7Sxtx1/yf+6 MNtixRVlAH9dRelKzsVka33zmaQeMs56W8fVodaYgCQsdnH1KhR+/whGIEyMMW0b ohplURvXDncYvrGQUyRSqciGj+D7HPGsrjma0mrAAEetoawXbuPkFI0lm16FmjWH TDq57T3cZvYo1W+wLQsTsU6u7gv7frfasgWXnTjjL/XWjR77zZ4q+bdXJ5MYCfPj +ZwVP9siSEL6E6uONP5tcXJVbt4g1hBJtXtItX5zVZEr/lXuMT1zaiGLgrLvVOO2 aGPgPBv/e2fWK8E8jGkYMbSkKJl9PKPPwYLV9Nci63tBxei8co3qQxFVmVdobA72 mjcB+ZyS71S5/sOvphmq/kE1ZgFTpFF/4XVFQ8scSWlG7MUpCovIH1gbKj54VHHW +pgPGuVuDpL3EtFuo6Oz+se4Nm3oVtkXvYgNu5D6XL8ENkQLQiD3BbYLLbBLlqND jVSAd9q2s16BT3fWBdaU =D2Ho -----END PGP SIGNATURE----- --/0P/MvzTfyTu5j9Q-- From owner-svn-src-all@freebsd.org Thu Apr 21 14:04:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A388B17EE7; Thu, 21 Apr 2016 14:04:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 171BD199D; Thu, 21 Apr 2016 14:04:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LE4upd098509; Thu, 21 Apr 2016 14:04:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LE4uMt098508; Thu, 21 Apr 2016 14:04:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604211404.u3LE4uMt098508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 21 Apr 2016 14:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298403 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 14:04:57 -0000 Author: andrew Date: Thu Apr 21 14:04:56 2016 New Revision: 298403 URL: https://svnweb.freebsd.org/changeset/base/298403 Log: Make the GIC SGI global variables static, they are only ever used within within this file. Approved by: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Thu Apr 21 13:14:55 2016 (r298402) +++ head/sys/arm/arm/gic.c Thu Apr 21 14:04:56 2016 (r298403) @@ -131,8 +131,8 @@ static int arm_gic_intr(void *); static int arm_gic_bind_intr(device_t dev, struct intr_irqsrc *isrc); #ifdef SMP -u_int sgi_to_ipi[GIC_LAST_SGI - GIC_FIRST_SGI + 1]; -u_int sgi_first_unused = GIC_FIRST_SGI; +static u_int sgi_to_ipi[GIC_LAST_SGI - GIC_FIRST_SGI + 1]; +static u_int sgi_first_unused = GIC_FIRST_SGI; #endif #endif From owner-svn-src-all@freebsd.org Thu Apr 21 14:20:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42AF9B163AF; Thu, 21 Apr 2016 14:20:47 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED6831FB9; Thu, 21 Apr 2016 14:20:46 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LEKkkp001911; Thu, 21 Apr 2016 14:20:46 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LEKkna001910; Thu, 21 Apr 2016 14:20:46 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201604211420.u3LEKkna001910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Thu, 21 Apr 2016 14:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298404 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 14:20:47 -0000 Author: skreuzer (doc,ports committer) Date: Thu Apr 21 14:20:45 2016 New Revision: 298404 URL: https://svnweb.freebsd.org/changeset/base/298404 Log: Document r296417, clang, llvm, etc. updated to upstream 3.8.0 Approved by: gjb@ Differential Revision: D6037 Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Apr 21 14:04:56 2016 (r298403) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Apr 21 14:20:45 2016 (r298404) @@ -585,21 +585,21 @@ The &man.nc.1; utility has been updated to the OpenBSD 5.8 version. - Clang has - been updated to version 3.7.0. + Clang has + been updated to version 3.8.0. - LLVM has - been updated to version 3.7.0. + LLVM has + been updated to version 3.8.0. - LLDB has - been updated to version 3.7.0. + LLDB has + been updated to version 3.8.0. - libc++ has - been updated to version 3.7.0. + libc++ has + been updated to version 3.8.0. - The + The compiler_rt utility has been - updated to version 3.7.0. + updated to version 3.8.0. From owner-svn-src-all@freebsd.org Thu Apr 21 14:25:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B85B16653; Thu, 21 Apr 2016 14:25:46 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77E4714AF; Thu, 21 Apr 2016 14:25:46 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LEPjmS004720; Thu, 21 Apr 2016 14:25:45 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LEPjvK004719; Thu, 21 Apr 2016 14:25:45 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201604211425.u3LEPjvK004719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Thu, 21 Apr 2016 14:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298405 - stable/10/usr.sbin/ctm/ctm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 14:25:46 -0000 Author: wblock (doc committer) Date: Thu Apr 21 14:25:45 2016 New Revision: 298405 URL: https://svnweb.freebsd.org/changeset/base/298405 Log: MFC r298005: Remove a link to the CTM section of the Handbook, which no longer exists. Modified: stable/10/usr.sbin/ctm/ctm/ctm.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctm/ctm/ctm.1 ============================================================================== --- stable/10/usr.sbin/ctm/ctm/ctm.1 Thu Apr 21 14:20:45 2016 (r298404) +++ stable/10/usr.sbin/ctm/ctm/ctm.1 Thu Apr 21 14:25:45 2016 (r298405) @@ -12,7 +12,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2015 +.Dd April 14, 2016 .Dt CTM 1 .Os .Sh NAME @@ -308,11 +308,6 @@ options. .Xr ctm_smail 1 , .Xr ctm 5 .Rs -.%B "The FreeBSD Handbook" -.%T "Using CTM" -.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ctm.html -.Re -.Rs .%T "Miscellaneous CTM on FreeBSD Resources" .%U http://ctm.berklix.org .Re From owner-svn-src-all@freebsd.org Thu Apr 21 14:57:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD09CB177B5; Thu, 21 Apr 2016 14:57:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A6DB19B6; Thu, 21 Apr 2016 14:57:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LEviC4013999; Thu, 21 Apr 2016 14:57:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LEviow013998; Thu, 21 Apr 2016 14:57:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604211457.u3LEviow013998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Apr 2016 14:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298406 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 14:57:45 -0000 Author: pfg Date: Thu Apr 21 14:57:44 2016 New Revision: 298406 URL: https://svnweb.freebsd.org/changeset/base/298406 Log: MFC r297527, r297688: chdone(): Prevent returning uninitialized scalar value. Instead of attempting to initialize all the possible cases, just move the check nearer to the case where it makes sense. CID: 1006486 Reviewed by: ken Modified: stable/10/sys/cam/scsi/scsi_ch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_ch.c Thu Apr 21 14:25:45 2016 (r298405) +++ stable/10/sys/cam/scsi/scsi_ch.c Thu Apr 21 14:57:44 2016 (r298406) @@ -648,6 +648,11 @@ chdone(struct cam_periph *periph, union softc->sc_counts[CHET_IE], PLURAL(softc->sc_counts[CHET_IE])); #undef PLURAL + if (announce_buf[0] != '\0') { + xpt_announce_periph(periph, announce_buf); + xpt_announce_quirks(periph, softc->quirks, + CH_Q_BIT_STRING); + } } else { int error; @@ -714,14 +719,8 @@ chdone(struct cam_periph *periph, union cam_periph_invalidate(periph); - announce_buf[0] = '\0'; } } - if (announce_buf[0] != '\0') { - xpt_announce_periph(periph, announce_buf); - xpt_announce_quirks(periph, softc->quirks, - CH_Q_BIT_STRING); - } softc->state = CH_STATE_NORMAL; free(mode_header, M_SCSICH); /* From owner-svn-src-all@freebsd.org Thu Apr 21 15:02:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B222B17B47; Thu, 21 Apr 2016 15:02:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFD2D1F5A; Thu, 21 Apr 2016 15:02:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LF2w0Z016828; Thu, 21 Apr 2016 15:02:58 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LF2wT0016827; Thu, 21 Apr 2016 15:02:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604211502.u3LF2wT0016827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Apr 2016 15:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298407 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 15:02:59 -0000 Author: pfg Date: Thu Apr 21 15:02:57 2016 New Revision: 298407 URL: https://svnweb.freebsd.org/changeset/base/298407 Log: MFC r297527, r297688: chdone(): Prevent returning uninitialized scalar value. Instead of attempting to initialize all the possible cases, just move the check nearer to the case where it makes sense. CID: 1006486 Reviewed by: ken Modified: stable/9/sys/cam/scsi/scsi_ch.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_ch.c Thu Apr 21 14:57:44 2016 (r298406) +++ stable/9/sys/cam/scsi/scsi_ch.c Thu Apr 21 15:02:57 2016 (r298407) @@ -649,6 +649,11 @@ chdone(struct cam_periph *periph, union softc->sc_counts[CHET_IE], PLURAL(softc->sc_counts[CHET_IE])); #undef PLURAL + if (announce_buf[0] != '\0') { + xpt_announce_periph(periph, announce_buf); + xpt_announce_quirks(periph, softc->quirks, + CH_Q_BIT_STRING); + } } else { int error; @@ -712,14 +717,8 @@ chdone(struct cam_periph *periph, union cam_periph_invalidate(periph); - announce_buf[0] = '\0'; } } - if (announce_buf[0] != '\0') { - xpt_announce_periph(periph, announce_buf); - xpt_announce_quirks(periph, softc->quirks, - CH_Q_BIT_STRING); - } softc->state = CH_STATE_NORMAL; free(mode_header, M_SCSICH); /* From owner-svn-src-all@freebsd.org Thu Apr 21 15:06:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23BACB17D9B; Thu, 21 Apr 2016 15:06:55 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E96631296; Thu, 21 Apr 2016 15:06:54 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LF6s9B017205; Thu, 21 Apr 2016 15:06:54 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LF6s9t017204; Thu, 21 Apr 2016 15:06:54 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201604211506.u3LF6s9t017204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 21 Apr 2016 15:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298408 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 15:06:55 -0000 Author: jtl Date: Thu Apr 21 15:06:53 2016 New Revision: 298408 URL: https://svnweb.freebsd.org/changeset/base/298408 Log: Prevent underflows in tp->snd_wnd if the remote side ACKs more than tp->snd_wnd. This can happen, for example, when the remote side responds to a window probe by ACKing the one byte it contains. Differential Revision: https://reviews.freebsd.org/D5625 Reviewed by: hiren Obtained from: Juniper Networks (earlier version) MFC after: 2 weeks Sponsored by: Juniper Networks Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Apr 21 15:02:57 2016 (r298407) +++ head/sys/netinet/tcp_input.c Thu Apr 21 15:06:53 2016 (r298408) @@ -2754,6 +2754,9 @@ process_ACK: INP_WLOCK_ASSERT(tp->t_inpcb); acked = BYTES_THIS_ACK(tp, th); + KASSERT(acked >= 0, ("%s: acked unexepectedly negative " + "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__, + tp->snd_una, th->th_ack, tp, m)); TCPSTAT_INC(tcps_rcvackpack); TCPSTAT_ADD(tcps_rcvackbyte, acked); @@ -2823,13 +2826,19 @@ process_ACK: SOCKBUF_LOCK(&so->so_snd); if (acked > sbavail(&so->so_snd)) { - tp->snd_wnd -= sbavail(&so->so_snd); + if (tp->snd_wnd >= sbavail(&so->so_snd)) + tp->snd_wnd -= sbavail(&so->so_snd); + else + tp->snd_wnd = 0; mfree = sbcut_locked(&so->so_snd, (int)sbavail(&so->so_snd)); ourfinisacked = 1; } else { mfree = sbcut_locked(&so->so_snd, acked); - tp->snd_wnd -= acked; + if (tp->snd_wnd >= (u_long) acked) + tp->snd_wnd -= acked; + else + tp->snd_wnd = 0; ourfinisacked = 0; } /* NB: sowwakeup_locked() does an implicit unlock. */ From owner-svn-src-all@freebsd.org Thu Apr 21 15:18:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC4B9B157EB; Thu, 21 Apr 2016 15:18:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7373117D; Thu, 21 Apr 2016 15:18:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7B0A8B93C; Thu, 21 Apr 2016 11:18:46 -0400 (EDT) From: John Baldwin To: Bruce Evans Cc: araujo@freebsd.org, "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 Date: Thu, 21 Apr 2016 08:14:52 -0700 Message-ID: <2005850.CZJyyynVaq@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160421150811.K1013@besplex.bde.org> References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <17068472.zUDTmEYeVg@ralph.baldwin.cx> <20160421150811.K1013@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 21 Apr 2016 11:18:46 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 15:18:48 -0000 On Thursday, April 21, 2016 04:01:17 PM Bruce Evans wrote: > On Wed, 20 Apr 2016, John Baldwin wrote: > > > On Wednesday, April 20, 2016 01:06:38 PM Bruce Evans wrote: > >> On Wed, 20 Apr 2016, Marcelo Araujo wrote: > >> > >>> 2016-04-20 0:16 GMT+08:00 John Baldwin : > >>> > >>>> On Tuesday, April 19, 2016 04:46:13 AM Marcelo Araujo wrote: > >>>>> Author: araujo > >>>>> Date: Tue Apr 19 04:46:13 2016 > >>>>> New Revision: 298247 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/298247 > >>>>> > >>>>> Log: > >>>>> Remove redundant parenthesis. > >>>>> > >>>>> Submitted by: pfg > >>>>> MFC after: 2 weeks. > >> > >> I don't realling like churnging to the nonstandard nitems(). Use > >> of the nonstandard is bad enough. > > > > I think it's not that bad from a readability standpoint. Other languages > > have fairly concise syntax for 'for-each' loops and this provides a > > closer variant of that for statically sized arrays. TAILQ_FOREACH() is > > still nicer of course. One could imagine doing some sort of > > ARRAY_FOREACH() that was: > > Ugh, I really realling (sic) don't like the FOREACH macros. The FOREACH > macros add syntactic salt. The queue macros were bad enough before they > had FOREACH. Arrays don't start with such nastiness. > > > #define ARRAY_FOREACH(p, array) \ > > for (size_t __i = 0, (p) = &(array)[0]; __i < nitems((array)); __i++, (p)++) > > This only works in the not very usual case of a simple loop from the start > to the end. Even the name EACH becomes wrong if the range is anything else. > For full nastiness, add a few hundred FORFOO macros to handle multi- > dimensional arrays with different access methods, array slices, sentinels > and other terminating conditions, etc. Actually, combined with break this is a common case. The fairly widespread use of the queue FOREACH macros (and most of the uses of nitems() in the tree) are a testament to this. > > Perhaps better is this: > > > > #define ARRAY_FOREACH(p, array) \ > > for ((p) = &(array)[0]; (p) < &(array)[nitems((array))]; (p)++) > > > > (No need for __i) > > But hiding the indexes forces the old C programming idiom of using > pointers for everything. A mere few hundred FORFOO macros won't do. > For just 1-dimensional FOREACH, you need 3 versions to expose p, i or > both p and i. If someone wanted 'i' they could maintain it on their own through the loop. In practice, 'foreach' is a common idiom in other languages and is used to mean 'for each item in container'. The 'short' syntax always implies a full iteration (though you could use break to bail early). For example, in python: for item in list: # do stuff Or in C++11: for (p : array) { } In C++11 I think this only works for std::array rather than a plain C array, though compared to a fixed-size array for which nitems() works, std::array is equivalent. Both of these work for dynamically sized containers for which our queue macros are the equivalent. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Apr 21 15:24:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4E29B15AE6; Thu, 21 Apr 2016 15:24:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 875CD17DB; Thu, 21 Apr 2016 15:24:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LFOLra023095; Thu, 21 Apr 2016 15:24:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LFOLMX023094; Thu, 21 Apr 2016 15:24:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604211524.u3LFOLMX023094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Apr 2016 15:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298409 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 15:24:22 -0000 Author: pfg Date: Thu Apr 21 15:24:21 2016 New Revision: 298409 URL: https://svnweb.freebsd.org/changeset/base/298409 Log: siba(4): remove slightly used 'bound' variable. It can be replaced with nitems(). While here simplify the function Suggested by: jhb Modified: head/sys/dev/siba/siba.c Modified: head/sys/dev/siba/siba.c ============================================================================== --- head/sys/dev/siba/siba.c Thu Apr 21 15:06:53 2016 (r298408) +++ head/sys/dev/siba/siba.c Thu Apr 21 15:24:21 2016 (r298409) @@ -337,22 +337,19 @@ siba_attach(device_t dev) static struct siba_devid * siba_dev_match(uint16_t vid, uint16_t devid, uint8_t rev) { - size_t i, bound; + size_t i; struct siba_devid *sd; - bound = sizeof(siba_devids) / sizeof(struct siba_devid); sd = &siba_devids[0]; - for (i = 0; i < bound; i++, sd++) { + for (i = 0; i < nitems(siba_devids); i++, sd++) { if (((vid == SIBA_VID_ANY) || (vid == sd->sd_vendor)) && ((devid == SIBA_DEVID_ANY) || (devid == sd->sd_device)) && ((rev == SIBA_REV_ANY) || (rev == sd->sd_rev) || (sd->sd_rev == SIBA_REV_ANY))) - break; + return(sd); } - if (i == bound) - sd = NULL; - return (sd); + return (NULL); } static int From owner-svn-src-all@freebsd.org Thu Apr 21 15:25:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D73DB15B77; Thu, 21 Apr 2016 15:25:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0011E19AF; Thu, 21 Apr 2016 15:25:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LFPI3N023175; Thu, 21 Apr 2016 15:25:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LFPHYa023172; Thu, 21 Apr 2016 15:25:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604211525.u3LFPHYa023172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 21 Apr 2016 15:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298410 - stable/10/usr.bin/truss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 15:25:19 -0000 Author: jhb Date: Thu Apr 21 15:25:17 2016 New Revision: 298410 URL: https://svnweb.freebsd.org/changeset/base/298410 Log: MFC 295677,295678: Fetch the current thread and it's syscall state from the trussinfo object instead of passing some of that state as arguments to print_syscall() and print_syscallret(). This just makes the calls of these functions shorter and easier to read. Modified: stable/10/usr.bin/truss/setup.c stable/10/usr.bin/truss/syscall.h stable/10/usr.bin/truss/syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/truss/setup.c ============================================================================== --- stable/10/usr.bin/truss/setup.c Thu Apr 21 15:24:21 2016 (r298409) +++ stable/10/usr.bin/truss/setup.c Thu Apr 21 15:25:17 2016 (r298410) @@ -422,8 +422,7 @@ exit_syscall(struct trussinfo *info, str } } - print_syscall_ret(info, t->cs.name, t->cs.nargs, t->cs.s_args, - errorp, retval, sc); + print_syscall_ret(info, errorp, retval); free_syscall(t); /* Modified: stable/10/usr.bin/truss/syscall.h ============================================================================== --- stable/10/usr.bin/truss/syscall.h Thu Apr 21 15:24:21 2016 (r298409) +++ stable/10/usr.bin/truss/syscall.h Thu Apr 21 15:25:17 2016 (r298410) @@ -111,7 +111,6 @@ struct linux_socketcall_args { }; void init_syscalls(void); -void print_syscall(struct trussinfo *, const char *, int, char **); -void print_syscall_ret(struct trussinfo *, const char *, int, char **, int, - long *, struct syscall *); +void print_syscall(struct trussinfo *); +void print_syscall_ret(struct trussinfo *, int, long *); void print_summary(struct trussinfo *trussinfo); Modified: stable/10/usr.bin/truss/syscalls.c ============================================================================== --- stable/10/usr.bin/truss/syscalls.c Thu Apr 21 15:24:21 2016 (r298409) +++ stable/10/usr.bin/truss/syscalls.c Thu Apr 21 15:25:17 2016 (r298410) @@ -1620,37 +1620,39 @@ print_arg(struct syscall_args *sc, unsig } /* - * Print (to outfile) the system call and its arguments. Note that - * nargs is the number of arguments (not the number of words; this is - * potentially confusing, I know). + * Print (to outfile) the system call and its arguments. */ void -print_syscall(struct trussinfo *trussinfo, const char *name, int nargs, - char **s_args) +print_syscall(struct trussinfo *trussinfo) { struct timespec timediff; - int i, len; + struct threadinfo *t; + const char *name; + char **s_args; + int i, len, nargs; len = 0; + t = trussinfo->curthread; if (trussinfo->flags & FOLLOWFORKS) len += fprintf(trussinfo->outfile, "%5d: ", - trussinfo->curthread->proc->pid); + t->proc->pid); + name = t->cs.name; + nargs = t->cs.nargs; + s_args = t->cs.s_args; if (name != NULL && (strcmp(name, "execve") == 0 || strcmp(name, "exit") == 0)) { - clock_gettime(CLOCK_REALTIME, &trussinfo->curthread->after); + clock_gettime(CLOCK_REALTIME, &t->after); } if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, - &trussinfo->start_time, &timediff); + timespecsubt(&t->after, &trussinfo->start_time, &timediff); len += fprintf(trussinfo->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, - &trussinfo->curthread->before, &timediff); + timespecsubt(&t->after, &t->before, &timediff); len += fprintf(trussinfo->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, timediff.tv_nsec); } @@ -1658,7 +1660,7 @@ print_syscall(struct trussinfo *trussinf len += fprintf(trussinfo->outfile, "%s(", name); for (i = 0; i < nargs; i++) { - if (s_args[i]) + if (s_args[i] != NULL) len += fprintf(trussinfo->outfile, "%s", s_args[i]); else len += fprintf(trussinfo->outfile, @@ -1672,15 +1674,17 @@ print_syscall(struct trussinfo *trussinf } void -print_syscall_ret(struct trussinfo *trussinfo, const char *name, int nargs, - char **s_args, int errorp, long *retval, struct syscall *sc) +print_syscall_ret(struct trussinfo *trussinfo, int errorp, long *retval) { struct timespec timediff; + struct threadinfo *t; + struct syscall *sc; + t = trussinfo->curthread; + sc = t->cs.sc; if (trussinfo->flags & COUNTONLY) { - clock_gettime(CLOCK_REALTIME, &trussinfo->curthread->after); - timespecsubt(&trussinfo->curthread->after, - &trussinfo->curthread->before, &timediff); + clock_gettime(CLOCK_REALTIME, &t->after); + timespecsubt(&t->after, &t->before, &timediff); timespecadd(&sc->time, &timediff, &sc->time); sc->ncalls++; if (errorp) @@ -1688,7 +1692,7 @@ print_syscall_ret(struct trussinfo *trus return; } - print_syscall(trussinfo, name, nargs, s_args); + print_syscall(trussinfo); fflush(trussinfo->outfile); if (errorp) fprintf(trussinfo->outfile, " ERR#%ld '%s'\n", retval[0], From owner-svn-src-all@freebsd.org Thu Apr 21 15:38:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0BD4B1403D; Thu, 21 Apr 2016 15:38:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AB5A11CD; Thu, 21 Apr 2016 15:38:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LFcUtT026617; Thu, 21 Apr 2016 15:38:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LFcSN0026596; Thu, 21 Apr 2016 15:38:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604211538.u3LFcSN0026596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Apr 2016 15:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298411 - in head/sys: cam cam/ata cam/scsi dev/advansys dev/hwpmc dev/pccard dev/sge dev/sound/pci dev/uart kern mips/nlm net netgraph/bluetooth/socket nlm security/audit vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 15:38:31 -0000 Author: pfg Date: Thu Apr 21 15:38:28 2016 New Revision: 298411 URL: https://svnweb.freebsd.org/changeset/base/298411 Log: Remove slightly used const values that can be replaced with nitems(). Suggested by: jhb Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam.c head/sys/cam/scsi/scsi_all.c head/sys/dev/advansys/adw_pci.c head/sys/dev/advansys/adwlib.c head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_mpc7xxx.c head/sys/dev/hwpmc/hwpmc_uncore.c head/sys/dev/hwpmc/hwpmc_xscale.c head/sys/dev/pccard/pccard_cis_quirks.c head/sys/dev/sge/if_sge.c head/sys/dev/sound/pci/emu10kx.c head/sys/dev/uart/uart_subr.c head/sys/kern/subr_witness.c head/sys/mips/nlm/xlp_machdep.c head/sys/net/netisr.c head/sys/netgraph/bluetooth/socket/ng_btsocket.c head/sys/nlm/nlm_prot_impl.c head/sys/security/audit/audit_bsm_klib.c head/sys/security/audit/bsm_errno.c head/sys/vm/vm_pager.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/cam/ata/ata_xpt.c Thu Apr 21 15:38:28 2016 (r298411) @@ -160,9 +160,6 @@ static struct ata_quirk_entry ata_quirk_ }, }; -static const int ata_quirk_table_size = - sizeof(ata_quirk_table) / sizeof(*ata_quirk_table); - static cam_status proberegister(struct cam_periph *periph, void *arg); static void probeschedule(struct cam_periph *probe_periph); @@ -1284,7 +1281,7 @@ ata_find_quirk(struct cam_ed *device) match = cam_quirkmatch((caddr_t)&device->ident_data, (caddr_t)ata_quirk_table, - ata_quirk_table_size, + nitems(ata_quirk_table), sizeof(*ata_quirk_table), ata_identify_match); if (match == NULL) @@ -1579,7 +1576,7 @@ ata_alloc_device(struct cam_eb *bus, str * Take the default quirk entry until we have inquiry * data and can determine a better quirk to use. */ - quirk = &ata_quirk_table[ata_quirk_table_size - 1]; + quirk = &ata_quirk_table[nitems(ata_quirk_table) - 1]; device->quirk = (void *)quirk; device->mintags = 0; device->maxtags = 0; Modified: head/sys/cam/cam.c ============================================================================== --- head/sys/cam/cam.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/cam/cam.c Thu Apr 21 15:38:28 2016 (r298411) @@ -105,9 +105,6 @@ const struct cam_status_entry cam_status { CAM_SCSI_BUSY, "SCSI Bus Busy" }, }; -const int num_cam_status_entries = - sizeof(cam_status_table)/sizeof(*cam_status_table); - #ifdef _KERNEL SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD, 0, "CAM Subsystem"); @@ -256,7 +253,7 @@ cam_fetch_status_entry(cam_status status { status &= CAM_STATUS_MASK; return (bsearch(&status, &cam_status_table, - num_cam_status_entries, + nitems(cam_status_table), sizeof(*cam_status_table), camstatusentrycomp)); } Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/cam/scsi/scsi_all.c Thu Apr 21 15:38:28 2016 (r298411) @@ -737,9 +737,6 @@ const struct sense_key_table_entry sense { SSD_KEY_COMPLETED, SS_NOP, "COMPLETED" } }; -const int sense_key_table_size = - sizeof(sense_key_table)/sizeof(sense_key_table[0]); - static struct asc_table_entry quantum_fireball_entries[] = { { SST(0x04, 0x0b, SS_START | SSQ_DECREMENT_COUNT | ENXIO, "Logical unit not ready, initializing cmd. required") } @@ -3291,14 +3288,14 @@ fetchtableentries(int sense_key, int asc sense_tables[0] = quirk->sense_key_info; sense_tables_size[0] = quirk->num_sense_keys; sense_tables[1] = sense_key_table; - sense_tables_size[1] = sense_key_table_size; + sense_tables_size[1] = nitems(sense_key_table); num_sense_tables = 2; } else { asc_tables[0] = asc_table; asc_tables_size[0] = asc_table_size; num_asc_tables = 1; sense_tables[0] = sense_key_table; - sense_tables_size[0] = sense_key_table_size; + sense_tables_size[0] = nitems(sense_key_table); num_sense_tables = 1; } Modified: head/sys/dev/advansys/adw_pci.c ============================================================================== --- head/sys/dev/advansys/adw_pci.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/dev/advansys/adw_pci.c Thu Apr 21 15:38:28 2016 (r298411) @@ -121,9 +121,6 @@ struct adw_pci_identity adw_pci_ident_ta #endif }; -static const int adw_num_pci_devs = - sizeof(adw_pci_ident_table) / sizeof(*adw_pci_ident_table); - #define ADW_PCI_MAX_DMA_ADDR (0xFFFFFFFFUL) #define ADW_PCI_MAX_DMA_COUNT (0xFFFFFFFFUL) @@ -173,7 +170,7 @@ adw_find_pci_device(device_t dev) pci_get_subdevice(dev), pci_get_subvendor(dev)); - for (i = 0; i < adw_num_pci_devs; i++) { + for (i = 0; i < nitems(adw_pci_ident_table); i++) { entry = &adw_pci_ident_table[i]; if (entry->full_id == (full_id & entry->id_mask)) return (entry); Modified: head/sys/dev/advansys/adwlib.c ============================================================================== --- head/sys/dev/advansys/adwlib.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/dev/advansys/adwlib.c Thu Apr 21 15:38:28 2016 (r298411) @@ -161,8 +161,6 @@ const struct adw_syncrate adw_syncrates[ { ADW_MC_SDTR_ASYNC, 0, "async" } }; -const int adw_num_syncrates = sizeof(adw_syncrates) / sizeof(adw_syncrates[0]); - static u_int16_t adw_eeprom_read_16(struct adw_softc *adw, int addr); static void adw_eeprom_write_16(struct adw_softc *adw, int addr, u_int data); @@ -817,7 +815,7 @@ adw_find_sdtr(struct adw_softc *adw, u_i if (period == 0) return ADW_MC_SDTR_ASYNC; - for (; i < adw_num_syncrates; i++) { + for (; i < nitems(adw_syncrates); i++) { if (period <= adw_syncrates[i].period) return (adw_syncrates[i].mc_sdtr); } @@ -829,7 +827,7 @@ adw_find_period(struct adw_softc *adw, u { int i; - for (i = 0; i < adw_num_syncrates; i++) { + for (i = 0; i < nitems(adw_syncrates); i++) { if (mc_sdtr == adw_syncrates[i].mc_sdtr) break; } Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/dev/hwpmc/hwpmc_core.c Thu Apr 21 15:38:28 2016 (r298411) @@ -1894,8 +1894,6 @@ static struct iap_event_descr iap_events IAPDESCR(FDH_40H, 0xFD, 0x40, IAP_F_FM | IAP_F_WM | IAP_F_I7), }; -static const int niap_events = sizeof(iap_events) / sizeof(iap_events[0]); - static pmc_value_t iap_perfctr_value_to_reload_count(pmc_value_t v) { @@ -2251,11 +2249,11 @@ iap_allocate_pmc(int cpu, int ri, struct break; } - for (n = 0, ie = iap_events; n < niap_events; n++, ie++) + for (n = 0, ie = iap_events; n < nitems(iap_events); n++, ie++) if (ie->iap_ev == ev && ie->iap_flags & cpuflag) break; - if (n == niap_events) + if (n == nitems(iap_events)) return (EINVAL); /* Modified: head/sys/dev/hwpmc/hwpmc_mpc7xxx.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Thu Apr 21 15:38:28 2016 (r298411) @@ -311,9 +311,6 @@ static struct mpc7xxx_event_code_map mpc PMC_POWERPC_EVENT(PREFETCH_ENGINE_FULL, 0x20, 57) }; -const size_t mpc7xxx_event_codes_size = - sizeof(mpc7xxx_event_codes) / sizeof(mpc7xxx_event_codes[0]); - static pmc_value_t mpc7xxx_pmcn_read(unsigned int pmc) { @@ -616,14 +613,14 @@ mpc7xxx_allocate_pmc(int cpu, int ri, st caps = a->pm_caps; pe = a->pm_ev; - for (i = 0; i < mpc7xxx_event_codes_size; i++) { + for (i = 0; i < nitems(mpc7xxx_event_codes); i++) { if (mpc7xxx_event_codes[i].pe_ev == pe) { config = mpc7xxx_event_codes[i].pe_code; counter = mpc7xxx_event_codes[i].pe_counter_mask; break; } } - if (i == mpc7xxx_event_codes_size) + if (i == nitems(mpc7xxx_event_codes)) return (EINVAL); if ((counter & (1 << ri)) == 0) Modified: head/sys/dev/hwpmc/hwpmc_uncore.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_uncore.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/dev/hwpmc/hwpmc_uncore.c Thu Apr 21 15:38:28 2016 (r298411) @@ -790,8 +790,6 @@ static struct ucp_event_descr ucp_events UCPDESCR(86H_01H, 0x86, 0x01, UCP_F_FM | UCP_F_WM) }; -static const int nucp_events = sizeof(ucp_events) / sizeof(ucp_events[0]); - static pmc_value_t ucp_perfctr_value_to_reload_count(pmc_value_t v) { @@ -883,11 +881,11 @@ ucp_allocate_pmc(int cpu, int ri, struct return (EINVAL); } - for (n = 0, ie = ucp_events; n < nucp_events; n++, ie++) + for (n = 0, ie = ucp_events; n < nitems(ucp_events); n++, ie++) if (ie->ucp_ev == ev && ie->ucp_flags & cpuflag) break; - if (n == nucp_events) + if (n == nitems(ucp_events)) return (EINVAL); /* Modified: head/sys/dev/hwpmc/hwpmc_xscale.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_xscale.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/dev/hwpmc/hwpmc_xscale.c Thu Apr 21 15:38:28 2016 (r298411) @@ -88,9 +88,6 @@ const struct xscale_event_code_map xscal { PMC_EV_XSCALE_DATA_BUS_TRANS, 0x48 }, }; -const int xscale_event_codes_size = - sizeof(xscale_event_codes) / sizeof(xscale_event_codes[0]); - /* * Per-processor information. */ @@ -264,13 +261,13 @@ xscale_allocate_pmc(int cpu, int ri, str if (a->pm_class != PMC_CLASS_XSCALE) return (EINVAL); pe = a->pm_ev; - for (i = 0; i < xscale_event_codes_size; i++) { + for (i = 0; i < nitems(xscale_event_codes); i++) { if (xscale_event_codes[i].pe_ev == pe) { config = xscale_event_codes[i].pe_code; break; } } - if (i == xscale_event_codes_size) + if (i == nitems(xscale_event_codes)) return EINVAL; /* Generation 1 has fewer events */ if (xscale_gen == 1 && i > PMC_EV_XSCALE_PC_CHANGE) Modified: head/sys/dev/pccard/pccard_cis_quirks.c ============================================================================== --- head/sys/dev/pccard/pccard_cis_quirks.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/dev/pccard/pccard_cis_quirks.c Thu Apr 21 15:38:28 2016 (r298411) @@ -257,9 +257,6 @@ static struct pccard_cis_quirk pccard_ci &pccard_ndc_nd5100_func0, &pccard_ndc_nd5100_func0_cfe0 }, }; -static int n_pccard_cis_quirks = - sizeof(pccard_cis_quirks)/sizeof(pccard_cis_quirks[0]); - static int pccard_cis_quirk_match(struct pccard_softc *sc, struct pccard_cis_quirk *q) { @@ -289,7 +286,7 @@ void pccard_check_cis_quirks(device_t de pf = NULL; pf_last = NULL; - for (i=0; ivid && pci_get_device(dev) == tp->did) { free(kids, M_TEMP); Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/dev/sound/pci/emu10kx.c Thu Apr 21 15:38:28 2016 (r298411) @@ -564,16 +564,14 @@ emu_getcard(device_t dev) { uint16_t device; uint16_t subdevice; - int n_cards; unsigned int thiscard; int i; device = pci_read_config(dev, PCIR_DEVICE, /* bytes */ 2); subdevice = pci_read_config(dev, PCIR_SUBDEV_0, /* bytes */ 2); - n_cards = sizeof(emu_cards) / sizeof(struct emu_hwinfo); thiscard = 0; - for (i = 1; i < n_cards; i++) { + for (i = 1; i < nitems(emu_cards); i++) { if (device == emu_cards[i].device) { if (subdevice == emu_cards[i].subdevice) { thiscard = i; @@ -589,8 +587,7 @@ emu_getcard(device_t dev) } } - n_cards = sizeof(emu_bad_cards) / sizeof(struct emu_hwinfo); - for (i = 0; i < n_cards; i++) { + for (i = 0; i < nitems(emu_cards); i++) { if (device == emu_bad_cards[i].device) { if (subdevice == emu_bad_cards[i].subdevice) { thiscard = 0; Modified: head/sys/dev/uart/uart_subr.c ============================================================================== --- head/sys/dev/uart/uart_subr.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/dev/uart/uart_subr.c Thu Apr 21 15:38:28 2016 (r298411) @@ -56,7 +56,6 @@ static struct uart_class *uart_classes[] &uart_s3c2410_class, #endif }; -static size_t uart_nclasses = sizeof(uart_classes) / sizeof(uart_classes[0]); static bus_addr_t uart_parse_addr(const char **p) @@ -72,7 +71,7 @@ uart_parse_class(struct uart_class *clas size_t len; u_int i; - for (i = 0; i < uart_nclasses; i++) { + for (i = 0; i < nitems(uart_classes); i++) { uc = uart_classes[i]; nm = uart_getname(uc); if (nm == NULL || *nm == '\0') Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/kern/subr_witness.c Thu Apr 21 15:38:28 2016 (r298411) @@ -709,7 +709,6 @@ static struct witness_order_list_entry o */ static struct witness_blessed blessed_list[] = { }; -static int blessed_count = nitems(blessed_list); #endif /* @@ -2059,7 +2058,7 @@ blessed(struct witness *w1, struct witne int i; struct witness_blessed *b; - for (i = 0; i < blessed_count; i++) { + for (i = 0; i < nitems(blessed_list); i++) { b = &blessed_list[i]; if (strcmp(w1->w_name, b->b_lock1) == 0) { if (strcmp(w2->w_name, b->b_lock2) == 0) Modified: head/sys/mips/nlm/xlp_machdep.c ============================================================================== --- head/sys/mips/nlm/xlp_machdep.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/mips/nlm/xlp_machdep.c Thu Apr 21 15:38:28 2016 (r298411) @@ -441,11 +441,10 @@ static vm_paddr_t xlp_mem_excl[] = { static int mem_exclude_add(vm_paddr_t *avail, vm_paddr_t mstart, vm_paddr_t mend) { - int nreg = sizeof(xlp_mem_excl)/sizeof(xlp_mem_excl[0]); int i, pos; pos = 0; - for (i = 0; i < nreg; i += 2) { + for (i = 0; i < nitems(xlp_mem_excl); i += 2) { if (mstart > xlp_mem_excl[i + 1]) continue; if (mstart < xlp_mem_excl[i]) { Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/net/netisr.c Thu Apr 21 15:38:28 2016 (r298411) @@ -287,8 +287,6 @@ static const struct netisr_dispatch_tabl { NETISR_DISPATCH_HYBRID, "hybrid" }, { NETISR_DISPATCH_DIRECT, "direct" }, }; -static const u_int netisr_dispatch_table_len = - (sizeof(netisr_dispatch_table) / sizeof(netisr_dispatch_table[0])); static void netisr_dispatch_policy_to_str(u_int dispatch_policy, char *buffer, @@ -299,7 +297,7 @@ netisr_dispatch_policy_to_str(u_int disp u_int i; str = "unknown"; - for (i = 0; i < netisr_dispatch_table_len; i++) { + for (i = 0; i < nitems(netisr_dispatch_table); i++) { ndtep = &netisr_dispatch_table[i]; if (ndtep->ndte_policy == dispatch_policy) { str = ndtep->ndte_policy_str; @@ -315,7 +313,7 @@ netisr_dispatch_policy_from_str(const ch const struct netisr_dispatch_table_entry *ndtep; u_int i; - for (i = 0; i < netisr_dispatch_table_len; i++) { + for (i = 0; i < nitems(netisr_dispatch_table); i++) { ndtep = &netisr_dispatch_table[i]; if (strcmp(ndtep->ndte_policy_str, str) == 0) { *dispatch_policyp = ndtep->ndte_policy; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket.c Thu Apr 21 15:38:28 2016 (r298411) @@ -213,10 +213,9 @@ static struct protosw ng_btsocket_proto .pr_usrreqs = &ng_btsocket_sco_usrreqs, }, }; -#define ng_btsocket_protosw_size \ - (sizeof(ng_btsocket_protosw)/sizeof(ng_btsocket_protosw[0])) + #define ng_btsocket_protosw_end \ - &ng_btsocket_protosw[ng_btsocket_protosw_size] + &ng_btsocket_protosw[nitems(ng_btsocket_protosw)] /* * BLUETOOTH domain Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/nlm/nlm_prot_impl.c Thu Apr 21 15:38:28 2016 (r298411) @@ -1426,7 +1426,6 @@ nlm_register_services(SVCPOOL *pool, int static void (*dispatchers[])(struct svc_req *, SVCXPRT *) = { nlm_prog_0, nlm_prog_1, nlm_prog_3, nlm_prog_4 }; - static const int version_count = sizeof(versions) / sizeof(versions[0]); SVCXPRT **xprts; char netid[16]; @@ -1446,7 +1445,7 @@ nlm_register_services(SVCPOOL *pool, int } xprts = malloc(addr_count * sizeof(SVCXPRT *), M_NLM, M_WAITOK|M_ZERO); - for (i = 0; i < version_count; i++) { + for (i = 0; i < nitems(versions); i++) { for (j = 0; j < addr_count; j++) { /* * Create transports for the first version and Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/security/audit/audit_bsm_klib.c Thu Apr 21 15:38:28 2016 (r298411) @@ -95,7 +95,6 @@ static const struct aue_open_event aue_o { (O_WRONLY | O_CREAT | O_TRUNC), AUE_OPEN_WTC }, { (O_WRONLY | O_TRUNC), AUE_OPEN_WT }, }; -static const int aue_open_count = sizeof(aue_open) / sizeof(aue_open[0]); static const struct aue_open_event aue_openat[] = { { O_RDONLY, AUE_OPENAT_R }, @@ -111,7 +110,6 @@ static const struct aue_open_event aue_o { (O_WRONLY | O_CREAT | O_TRUNC), AUE_OPENAT_WTC }, { (O_WRONLY | O_TRUNC), AUE_OPENAT_WT }, }; -static const int aue_openat_count = sizeof(aue_openat) / sizeof(aue_openat[0]); /* * Look up the class for an audit event in the class mapping table. @@ -296,7 +294,7 @@ audit_flags_and_error_to_openevent(int o * Need to check only those flags we care about. */ oflags = oflags & (O_RDONLY | O_CREAT | O_TRUNC | O_RDWR | O_WRONLY); - for (i = 0; i < aue_open_count; i++) { + for (i = 0; i < nitems(aue_open); i++) { if (aue_open[i].aoe_flags == oflags) return (aue_open[i].aoe_event); } @@ -312,7 +310,7 @@ audit_flags_and_error_to_openatevent(int * Need to check only those flags we care about. */ oflags = oflags & (O_RDONLY | O_CREAT | O_TRUNC | O_RDWR | O_WRONLY); - for (i = 0; i < aue_openat_count; i++) { + for (i = 0; i < nitems(aue_openat); i++) { if (aue_openat[i].aoe_flags == oflags) return (aue_openat[i].aoe_event); } Modified: head/sys/security/audit/bsm_errno.c ============================================================================== --- head/sys/security/audit/bsm_errno.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/security/audit/bsm_errno.c Thu Apr 21 15:38:28 2016 (r298411) @@ -699,14 +699,13 @@ static const struct bsm_errno bsm_errnos #endif ES("Not permitted in capability mode") }, }; -static const int bsm_errnos_count = sizeof(bsm_errnos) / sizeof(bsm_errnos[0]); static const struct bsm_errno * bsm_lookup_errno_local(int local_errno) { int i; - for (i = 0; i < bsm_errnos_count; i++) { + for (i = 0; i < nitems(bsm_errnos); i++) { if (bsm_errnos[i].be_local_errno == local_errno) return (&bsm_errnos[i]); } @@ -733,7 +732,7 @@ bsm_lookup_errno_bsm(u_char bsm_errno) { int i; - for (i = 0; i < bsm_errnos_count; i++) { + for (i = 0; i < nitems(bsm_errnos); i++) { if (bsm_errnos[i].be_bsm_errno == bsm_errno) return (&bsm_errnos[i]); } Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Thu Apr 21 15:25:17 2016 (r298410) +++ head/sys/vm/vm_pager.c Thu Apr 21 15:38:28 2016 (r298411) @@ -165,8 +165,6 @@ struct pagerops *pagertab[] = { &mgtdevicepagerops, /* OBJT_MGTDEVICE */ }; -static const int npagers = sizeof(pagertab) / sizeof(pagertab[0]); - /* * Kernel address space for mapping pages. * Used by pagers where KVAs are needed for IO. @@ -189,7 +187,7 @@ vm_pager_init() /* * Initialize known pagers */ - for (pgops = pagertab; pgops < &pagertab[npagers]; pgops++) + for (pgops = pagertab; pgops < &pagertab[nitems(pagertab)]; pgops++) if ((*pgops)->pgo_init != NULL) (*(*pgops)->pgo_init) (); } From owner-svn-src-all@freebsd.org Thu Apr 21 16:04:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 882FCB14EF3; Thu, 21 Apr 2016 16:04:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58FEB1796; Thu, 21 Apr 2016 16:04:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LG4wjX035875; Thu, 21 Apr 2016 16:04:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LG4wmT035874; Thu, 21 Apr 2016 16:04:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604211604.u3LG4wmT035874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 21 Apr 2016 16:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:04:59 -0000 Author: hselasky Date: Thu Apr 21 16:04:58 2016 New Revision: 298412 URL: https://svnweb.freebsd.org/changeset/base/298412 Log: Fix for resolving mac address when the destination address is a gateway. Remove some dead code while at it. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/addr.c Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 21 15:38:28 2016 (r298411) +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 21 16:04:58 2016 (r298412) @@ -333,17 +333,18 @@ mcast: switch (dst_in->sa_family) { #ifdef INET case AF_INET: - error = arpresolve(ifp, is_gw, NULL, dst_in, edst, NULL); + error = arpresolve(ifp, is_gw, NULL, + is_gw ? rte->rt_gateway : dst_in, edst, NULL); break; #endif #ifdef INET6 case AF_INET6: - error = nd6_resolve(ifp, is_gw, NULL, dst_in, edst, NULL); + error = nd6_resolve(ifp, is_gw, NULL, + is_gw ? rte->rt_gateway : dst_in, edst, NULL); break; #endif default: - /* XXX: Shouldn't happen. */ - error = -EINVAL; + break; } RTFREE(rte); if (error == 0) { From owner-svn-src-all@freebsd.org Thu Apr 21 16:12:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73FDFB164E2; Thu, 21 Apr 2016 16:12:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 455CF10DC; Thu, 21 Apr 2016 16:12:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGCtN8039085; Thu, 21 Apr 2016 16:12:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGCtY1039084; Thu, 21 Apr 2016 16:12:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604211612.u3LGCtY1039084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 21 Apr 2016 16:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298413 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:12:56 -0000 Author: bdrewery Date: Thu Apr 21 16:12:55 2016 New Revision: 298413 URL: https://svnweb.freebsd.org/changeset/base/298413 Log: Follow-up r298219: Don't error with 'make all install'. Reported by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Thu Apr 21 16:04:58 2016 (r298412) +++ head/share/mk/bsd.sys.mk Thu Apr 21 16:12:55 2016 (r298413) @@ -180,7 +180,7 @@ CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} .if defined(SRCTOP) # Prevent rebuilding during install to support read-only objdirs. -.if make(install) && empty(.MAKE.MODE:Mmeta) +.if !make(all) && make(install) && empty(.MAKE.MODE:Mmeta) CFLAGS+= ERROR-tried-to-rebuild-during-make-install .endif .endif From owner-svn-src-all@freebsd.org Thu Apr 21 16:13:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39704B16511; Thu, 21 Apr 2016 16:13:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 116591232; Thu, 21 Apr 2016 16:13:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 04BCC1644; Thu, 21 Apr 2016 16:13:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 93340213A1; Thu, 21 Apr 2016 16:13:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 6ZPK5-NsVftv; Thu, 21 Apr 2016 16:13:04 +0000 (UTC) Subject: Re: svn commit: r298219 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CA3102139A To: Konstantin Belousov References: <201604181814.u3IIE22P059301@repo.freebsd.org> <20160419121551.GX2422@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <5718FC0C.7040604@FreeBSD.org> Date: Thu, 21 Apr 2016 09:13:00 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160419121551.GX2422@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:13:08 -0000 On 4/19/16 5:15 AM, Konstantin Belousov wrote: > On Mon, Apr 18, 2016 at 06:14:02PM +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Mon Apr 18 18:14:02 2016 >> New Revision: 298219 >> URL: https://svnweb.freebsd.org/changeset/base/298219 >> >> Log: >> Cause an error during 'make install' if trying to compile with CC. >> >> This is limited to src-tree builds, meaning not extended to ports or other >> out-of-tree builds. >> >> This will help ensure that read-only OBJDIRS will be respected at install-time >> by causing a more consistent failure for those who don't use a read-only >> OBJDIR. It also will cause Jenkins to yell. This is a better solution than >> trying to see CC=false as has been attempted and discussed before. >> >> Of course this is only relevant for files generated by CC. >> >> Disable this for META_MODE since it will detect the CFLAGS/command >> change and force a rebuild. >> >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/share/mk/bsd.sys.mk >> >> Modified: head/share/mk/bsd.sys.mk >> ============================================================================== >> --- head/share/mk/bsd.sys.mk Mon Apr 18 18:13:58 2016 (r298218) >> +++ head/share/mk/bsd.sys.mk Mon Apr 18 18:14:02 2016 (r298219) >> @@ -178,6 +178,13 @@ ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} >> CFLAGS+= ${CFLAGS.${.IMPSRC:T}} >> CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} >> >> +.if defined(SRCTOP) >> +# Prevent rebuilding during install to support read-only objdirs. >> +.if make(install) && empty(.MAKE.MODE:Mmeta) >> +CFLAGS+= ERROR-tried-to-rebuild-during-make-install >> +.endif >> +.endif >> + >> # Tell bmake not to mistake standard targets for things to be searched for >> # or expect to ever be up-to-date. >> PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend beforeinstall \ > > It seems to cause the following behaviour: > make buildenv > cd lib/libthr > # make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all install By the way, since r295646 it should be safe to use -j here. Let me know if you run into trouble with it. > cc -O2 -pipe -DPTHREAD_KERNEL -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../libc/include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/thread -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../../include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/arch/amd64/include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/sys -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld-elf -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld-elf/amd64 -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../libthread_db -Winline -fexceptions -D_PTHREAD_FORCED_UNWIND -D_PTHREADS_INVARIANTS -mno-mmx -mno-sse -mno-avx -g -MD -MP -MF.depend.thr_init.o -MTthr_init.o -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compar e -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Qunused-arguments ERROR-tried-to-rebuild-during-make-install -c /usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/thread/thr_init.c -o thr_init.o > cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-make-install' > *** Error code 1 > > Stop. > make[3]: stopped in /usr/home/kostik/work/build/bsd/DEV/src/lib/libthr > > Doing separate steps for all and install targets work, but before, it also > worked and was convenient to list sequential targets on the make command > line. > Fixed in r298413. -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Thu Apr 21 16:22:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF681B16A46; Thu, 21 Apr 2016 16:22:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 736561BD6; Thu, 21 Apr 2016 16:22:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGMqZ5042589; Thu, 21 Apr 2016 16:22:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGMq1b042586; Thu, 21 Apr 2016 16:22:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604211622.u3LGMq1b042586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 21 Apr 2016 16:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298414 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:22:53 -0000 Author: trasz Date: Thu Apr 21 16:22:52 2016 New Revision: 298414 URL: https://svnweb.freebsd.org/changeset/base/298414 Log: Get rid of rctl_lock; use racct_lock where appropriate. The fast paths already required both of them, so having a separate rctl_lock didn't buy us anything. Reviewed by: mjg@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5914 Modified: head/sys/kern/kern_racct.c head/sys/kern/kern_rctl.c head/sys/sys/racct.h Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Thu Apr 21 16:12:55 2016 (r298413) +++ head/sys/kern/kern_racct.c Thu Apr 21 16:22:52 2016 (r298414) @@ -91,13 +91,9 @@ SYSCTL_UINT(_kern_racct, OID_AUTO, pcpu_ */ #define RACCT_PCPU_SECS 3 -static struct mtx racct_lock; +struct mtx racct_lock; MTX_SYSINIT(racct_lock, &racct_lock, "racct lock", MTX_DEF); -#define RACCT_LOCK() mtx_lock(&racct_lock) -#define RACCT_UNLOCK() mtx_unlock(&racct_lock) -#define RACCT_LOCK_ASSERT() mtx_assert(&racct_lock, MA_OWNED) - static uma_zone_t racct_zone; static void racct_sub_racct(struct racct *dest, const struct racct *src); @@ -111,6 +107,8 @@ SDT_PROBE_DEFINE3(racct, , rusage, add, "struct proc *", "int", "uint64_t"); SDT_PROBE_DEFINE3(racct, , rusage, add__failure, "struct proc *", "int", "uint64_t"); +SDT_PROBE_DEFINE3(racct, , rusage, add__buf, + "struct proc *", "const struct buf *", "int"); SDT_PROBE_DEFINE3(racct, , rusage, add__cred, "struct ucred *", "int", "uint64_t"); SDT_PROBE_DEFINE3(racct, , rusage, add__force, @@ -618,8 +616,6 @@ racct_add_cred_locked(struct ucred *cred ASSERT_RACCT_ENABLED(); - SDT_PROBE3(racct, , rusage, add__cred, cred, resource, amount); - racct_adjust_resource(cred->cr_ruidinfo->ui_racct, resource, amount); for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent) racct_adjust_resource(pr->pr_prison_racct->prr_racct, resource, @@ -638,6 +634,8 @@ racct_add_cred(struct ucred *cred, int r if (!racct_enable) return; + SDT_PROBE3(racct, , rusage, add__cred, cred, resource, amount); + RACCT_LOCK(); racct_add_cred_locked(cred, resource, amount); RACCT_UNLOCK(); @@ -654,6 +652,8 @@ racct_add_buf(struct proc *p, const stru ASSERT_RACCT_ENABLED(); PROC_LOCK_ASSERT(p, MA_OWNED); + SDT_PROBE3(racct, , rusage, add__buf, p, bp, is_write); + RACCT_LOCK(); if (is_write) { racct_add_locked(curproc, RACCT_WRITEBPS, bp->b_bcount, 1); @@ -766,13 +766,19 @@ racct_set_force(struct proc *p, int reso uint64_t racct_get_limit(struct proc *p, int resource) { +#ifdef RCTL + uint64_t available; if (!racct_enable) return (UINT64_MAX); -#ifdef RCTL - return (rctl_get_limit(p, resource)); + RACCT_LOCK(); + available = rctl_get_limit(p, resource); + RACCT_UNLOCK(); + + return (available); #else + return (UINT64_MAX); #endif } @@ -786,13 +792,19 @@ racct_get_limit(struct proc *p, int reso uint64_t racct_get_available(struct proc *p, int resource) { +#ifdef RCTL + uint64_t available; if (!racct_enable) return (UINT64_MAX); -#ifdef RCTL - return (rctl_get_available(p, resource)); + RACCT_LOCK(); + available = rctl_get_available(p, resource); + RACCT_UNLOCK(); + + return (available); #else + return (UINT64_MAX); #endif } @@ -805,12 +817,18 @@ racct_get_available(struct proc *p, int static int64_t racct_pcpu_available(struct proc *p) { +#ifdef RCTL + uint64_t available; ASSERT_RACCT_ENABLED(); -#ifdef RCTL - return (rctl_pcpu_available(p)); + RACCT_LOCK(); + available = rctl_pcpu_available(p); + RACCT_UNLOCK(); + + return (available); #else + return (INT64_MAX); #endif } @@ -852,14 +870,6 @@ racct_sub_cred_locked(struct ucred *cred ASSERT_RACCT_ENABLED(); - SDT_PROBE3(racct, , rusage, sub__cred, cred, resource, amount); - -#ifdef notyet - KASSERT(RACCT_CAN_DROP(resource), - ("%s: called for resource %d which can not drop", __func__, - resource)); -#endif - racct_adjust_resource(cred->cr_ruidinfo->ui_racct, resource, -amount); for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent) racct_adjust_resource(pr->pr_prison_racct->prr_racct, resource, @@ -877,6 +887,14 @@ racct_sub_cred(struct ucred *cred, int r if (!racct_enable) return; + SDT_PROBE3(racct, , rusage, sub__cred, cred, resource, amount); + +#ifdef notyet + KASSERT(RACCT_CAN_DROP(resource), + ("%s: called for resource %d which can not drop", __func__, + resource)); +#endif + RACCT_LOCK(); racct_sub_cred_locked(cred, resource, amount); RACCT_UNLOCK(); @@ -948,11 +966,12 @@ void racct_proc_fork_done(struct proc *child) { - PROC_LOCK_ASSERT(child, MA_OWNED); -#ifdef RCTL if (!racct_enable) return; + PROC_LOCK_ASSERT(child, MA_OWNED); + +#ifdef RCTL RACCT_LOCK(); rctl_enforce(child, RACCT_NPROC, 0); rctl_enforce(child, RACCT_NTHR, 0); @@ -1003,13 +1022,12 @@ racct_proc_exit(struct proc *p) racct_set_locked(p, i, 0, 0); } - RACCT_UNLOCK(); - PROC_UNLOCK(p); - #ifdef RCTL rctl_racct_release(p->p_racct); #endif - racct_destroy(&p->p_racct); + racct_destroy_locked(&p->p_racct); + RACCT_UNLOCK(); + PROC_UNLOCK(p); } /* Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Thu Apr 21 16:12:55 2016 (r298413) +++ head/sys/kern/kern_rctl.c Thu Apr 21 16:22:52 2016 (r298414) @@ -212,15 +212,6 @@ SYSINIT(rctl, SI_SUB_RACCT, SI_ORDER_FIR static uma_zone_t rctl_rule_zone; static uma_zone_t rctl_rule_link_zone; -static struct rwlock rctl_lock; -RW_SYSINIT(rctl_lock, &rctl_lock, "RCTL lock"); - -#define RCTL_RLOCK() rw_rlock(&rctl_lock) -#define RCTL_RUNLOCK() rw_runlock(&rctl_lock) -#define RCTL_WLOCK() rw_wlock(&rctl_lock) -#define RCTL_WUNLOCK() rw_wunlock(&rctl_lock) -#define RCTL_LOCK_ASSERT() rw_assert(&rctl_lock, RA_LOCKED) -#define RCTL_WLOCK_ASSERT() rw_assert(&rctl_lock, RA_WLOCKED) static int rctl_rule_fully_specified(const struct rctl_rule *rule); static void rctl_rule_to_sbuf(struct sbuf *sb, const struct rctl_rule *rule); @@ -237,9 +228,9 @@ static int rctl_throttle_min_sysctl(SYSC if (val < 1 || val > rctl_throttle_max) return (EINVAL); - RCTL_WLOCK(); + RACCT_LOCK(); rctl_throttle_min = val; - RCTL_WUNLOCK(); + RACCT_UNLOCK(); return (0); } @@ -254,9 +245,9 @@ static int rctl_throttle_max_sysctl(SYSC if (val < rctl_throttle_min) return (EINVAL); - RCTL_WLOCK(); + RACCT_LOCK(); rctl_throttle_max = val; - RCTL_WUNLOCK(); + RACCT_UNLOCK(); return (0); } @@ -271,9 +262,9 @@ static int rctl_throttle_pct_sysctl(SYSC if (val < 0) return (EINVAL); - RCTL_WLOCK(); + RACCT_LOCK(); rctl_throttle_pct = val; - RCTL_WUNLOCK(); + RACCT_UNLOCK(); return (0); } @@ -288,9 +279,9 @@ static int rctl_throttle_pct2_sysctl(SYS if (val < 0) return (EINVAL); - RCTL_WLOCK(); + RACCT_LOCK(); rctl_throttle_pct2 = val; - RCTL_WUNLOCK(); + RACCT_UNLOCK(); return (0); } @@ -340,7 +331,7 @@ rctl_proc_rule_to_racct(const struct pro struct ucred *cred = p->p_ucred; ASSERT_RACCT_ENABLED(); - RCTL_LOCK_ASSERT(); + RACCT_LOCK_ASSERT(); switch (rule->rr_per) { case RCTL_SUBJECT_TYPE_PROCESS: @@ -367,7 +358,7 @@ rctl_available_resource(const struct pro int64_t available; ASSERT_RACCT_ENABLED(); - RCTL_LOCK_ASSERT(); + RACCT_LOCK_ASSERT(); racct = rctl_proc_rule_to_racct(p, rule); available = rule->rr_amount - racct->r_resources[rule->rr_resource]; @@ -390,11 +381,10 @@ rctl_throttle_decay(struct racct *racct, int64_t minavailable; ASSERT_RACCT_ENABLED(); + RACCT_LOCK_ASSERT(); minavailable = INT64_MAX; - RCTL_RLOCK(); - LIST_FOREACH(link, &racct->r_rule_links, rrl_next) { rule = link->rrl_rule; @@ -407,8 +397,6 @@ rctl_throttle_decay(struct racct *racct, minavailable = rule->rr_amount; } - RCTL_RUNLOCK(); - if (racct->r_resources[resource] < minavailable) { racct->r_resources[resource] = 0; } else { @@ -436,12 +424,11 @@ rctl_pcpu_available(const struct proc *p int64_t available, minavailable, limit; ASSERT_RACCT_ENABLED(); + RACCT_LOCK_ASSERT(); minavailable = INT64_MAX; limit = 0; - RCTL_RLOCK(); - LIST_FOREACH(link, &p->p_racct->r_rule_links, rrl_next) { rule = link->rrl_rule; if (rule->rr_resource != RACCT_PCTCPU) @@ -455,8 +442,6 @@ rctl_pcpu_available(const struct proc *p } } - RCTL_RUNLOCK(); - /* * Return slightly less than actual value of the available * %cpu resource. This makes %cpu throttling more agressive @@ -516,10 +501,8 @@ rctl_enforce(struct proc *p, int resourc uint64_t sleep_ms, sleep_ratio; int should_deny = 0; - ASSERT_RACCT_ENABLED(); - - RCTL_RLOCK(); + RACCT_LOCK_ASSERT(); /* * There may be more than one matching rule; go through all of them. @@ -693,8 +676,6 @@ rctl_enforce(struct proc *p, int resourc } } - RCTL_RUNLOCK(); - if (should_deny) { /* * Return fake error code; the caller should change it @@ -714,8 +695,7 @@ rctl_get_limit(struct proc *p, int resou uint64_t amount = UINT64_MAX; ASSERT_RACCT_ENABLED(); - - RCTL_RLOCK(); + RACCT_LOCK_ASSERT(); /* * There may be more than one matching rule; go through all of them. @@ -731,8 +711,6 @@ rctl_get_limit(struct proc *p, int resou amount = rule->rr_amount; } - RCTL_RUNLOCK(); - return (amount); } @@ -746,8 +724,7 @@ rctl_get_available(struct proc *p, int r minavailable = INT64_MAX; ASSERT_RACCT_ENABLED(); - - RCTL_RLOCK(); + RACCT_LOCK_ASSERT(); /* * There may be more than one matching rule; go through all of them. @@ -764,8 +741,6 @@ rctl_get_available(struct proc *p, int r minavailable = available; } - RCTL_RUNLOCK(); - /* * XXX: Think about this _hard_. */ @@ -774,6 +749,7 @@ rctl_get_available(struct proc *p, int r minavailable += allocated; if (minavailable < 0) minavailable = 0; + return (minavailable); } @@ -908,9 +884,9 @@ rctl_racct_add_rule(struct racct *racct, link->rrl_rule = rule; link->rrl_exceeded = 0; - RCTL_WLOCK(); + RACCT_LOCK(); LIST_INSERT_HEAD(&racct->r_rule_links, link, rrl_next); - RCTL_WUNLOCK(); + RACCT_UNLOCK(); } static int @@ -920,7 +896,7 @@ rctl_racct_add_rule_locked(struct racct ASSERT_RACCT_ENABLED(); KASSERT(rctl_rule_fully_specified(rule), ("rule not fully specified")); - RCTL_WLOCK_ASSERT(); + RACCT_LOCK_ASSERT(); link = uma_zalloc(rctl_rule_link_zone, M_NOWAIT); if (link == NULL) @@ -930,6 +906,7 @@ rctl_racct_add_rule_locked(struct racct link->rrl_exceeded = 0; LIST_INSERT_HEAD(&racct->r_rule_links, link, rrl_next); + return (0); } @@ -946,7 +923,7 @@ rctl_racct_remove_rules(struct racct *ra int removed = 0; ASSERT_RACCT_ENABLED(); - RCTL_WLOCK_ASSERT(); + RACCT_LOCK_ASSERT(); LIST_FOREACH_SAFE(link, &racct->r_rule_links, rrl_next, linktmp) { if (!rctl_rule_matches(link->rrl_rule, filter)) @@ -1417,14 +1394,14 @@ static void rctl_rule_pre_callback(void) { - RCTL_WLOCK(); + RACCT_LOCK(); } static void rctl_rule_post_callback(void) { - RCTL_WUNLOCK(); + RACCT_UNLOCK(); } static void @@ -1434,7 +1411,7 @@ rctl_rule_remove_callback(struct racct * int found = 0; ASSERT_RACCT_ENABLED(); - RCTL_WLOCK_ASSERT(); + RACCT_LOCK_ASSERT(); found += rctl_racct_remove_rules(racct, filter); @@ -1455,9 +1432,9 @@ rctl_rule_remove(struct rctl_rule *filte if (filter->rr_subject_type == RCTL_SUBJECT_TYPE_PROCESS && filter->rr_subject.rs_proc != NULL) { p = filter->rr_subject.rs_proc; - RCTL_WLOCK(); + RACCT_LOCK(); found = rctl_racct_remove_rules(p->p_racct, filter); - RCTL_WUNLOCK(); + RACCT_UNLOCK(); if (found) return (0); return (ESRCH); @@ -1474,11 +1451,11 @@ rctl_rule_remove(struct rctl_rule *filte filter, (void *)&found); sx_assert(&allproc_lock, SA_LOCKED); - RCTL_WLOCK(); + RACCT_LOCK(); FOREACH_PROC_IN_SYSTEM(p) { found += rctl_racct_remove_rules(p->p_racct, filter); } - RCTL_WUNLOCK(); + RACCT_UNLOCK(); if (found) return (0); @@ -1610,7 +1587,9 @@ rctl_racct_to_sbuf(struct racct *racct, for (i = 0; i <= RACCT_MAX; i++) { if (sloppy == 0 && RACCT_IS_SLOPPY(i)) continue; + RACCT_LOCK(); amount = racct->r_resources[i]; + RACCT_UNLOCK(); if (RACCT_IS_IN_MILLIONS(i)) amount /= 1000000; sbuf_printf(sb, "%s=%jd,", rctl_resource_name(i), amount); @@ -1705,7 +1684,7 @@ rctl_get_rules_callback(struct racct *ra struct sbuf *sb = (struct sbuf *)arg3; ASSERT_RACCT_ENABLED(); - RCTL_LOCK_ASSERT(); + RACCT_LOCK_ASSERT(); LIST_FOREACH(link, &racct->r_rule_links, rrl_next) { if (!rctl_rule_matches(link->rrl_rule, filter)) @@ -1756,7 +1735,7 @@ sys_rctl_get_rules(struct thread *td, st KASSERT(sb != NULL, ("sbuf_new failed")); FOREACH_PROC_IN_SYSTEM(p) { - RCTL_RLOCK(); + RACCT_LOCK(); LIST_FOREACH(link, &p->p_racct->r_rule_links, rrl_next) { /* * Non-process rules will be added to the buffer later. @@ -1770,7 +1749,7 @@ sys_rctl_get_rules(struct thread *td, st rctl_rule_to_sbuf(sb, link->rrl_rule); sbuf_printf(sb, ","); } - RCTL_RUNLOCK(); + RACCT_UNLOCK(); } loginclass_racct_foreach(rctl_get_rules_callback, @@ -1857,13 +1836,13 @@ sys_rctl_get_limits(struct thread *td, s sb = sbuf_new(NULL, buf, bufsize, SBUF_FIXEDLEN); KASSERT(sb != NULL, ("sbuf_new failed")); - RCTL_RLOCK(); + RACCT_LOCK(); LIST_FOREACH(link, &filter->rr_subject.rs_proc->p_racct->r_rule_links, rrl_next) { rctl_rule_to_sbuf(sb, link->rrl_rule); sbuf_printf(sb, ","); } - RCTL_RUNLOCK(); + RACCT_UNLOCK(); if (sbuf_error(sb) == ENOMEM) { error = ERANGE; sbuf_delete(sb); @@ -1989,7 +1968,7 @@ again: * credentials. */ rulecnt = 0; - RCTL_RLOCK(); + RACCT_LOCK(); LIST_FOREACH(link, &p->p_racct->r_rule_links, rrl_next) { if (link->rrl_rule->rr_subject_type == RCTL_SUBJECT_TYPE_PROCESS) @@ -2001,7 +1980,7 @@ again: rulecnt++; LIST_FOREACH(link, &newprr->prr_racct->r_rule_links, rrl_next) rulecnt++; - RCTL_RUNLOCK(); + RACCT_UNLOCK(); /* * Create temporary list. We've dropped the rctl_lock in order @@ -2019,7 +1998,7 @@ again: /* * Assign rules to the newly allocated list entries. */ - RCTL_WLOCK(); + RACCT_LOCK(); LIST_FOREACH(link, &p->p_racct->r_rule_links, rrl_next) { if (link->rrl_rule->rr_subject_type == RCTL_SUBJECT_TYPE_PROCESS) { @@ -2087,13 +2066,13 @@ again: newlink, rrl_next); } - RCTL_WUNLOCK(); + RACCT_UNLOCK(); return; } goaround: - RCTL_WUNLOCK(); + RACCT_UNLOCK(); /* * Rule list changed while we were not holding the rctl_lock. @@ -2120,12 +2099,11 @@ rctl_proc_fork(struct proc *parent, stru struct rctl_rule_link *link; int error; - LIST_INIT(&child->p_racct->r_rule_links); - ASSERT_RACCT_ENABLED(); + RACCT_LOCK_ASSERT(); KASSERT(parent->p_racct != NULL, ("process without racct; p = %p", parent)); - RCTL_WLOCK(); + LIST_INIT(&child->p_racct->r_rule_links); /* * Go through limits applicable to the parent and assign them @@ -2154,7 +2132,6 @@ rctl_proc_fork(struct proc *parent, stru } } - RCTL_WUNLOCK(); return (0); fail: @@ -2164,7 +2141,7 @@ fail: rctl_rule_release(link->rrl_rule); uma_zfree(rctl_rule_link_zone, link); } - RCTL_WUNLOCK(); + return (EAGAIN); } @@ -2177,15 +2154,14 @@ rctl_racct_release(struct racct *racct) struct rctl_rule_link *link; ASSERT_RACCT_ENABLED(); + RACCT_LOCK_ASSERT(); - RCTL_WLOCK(); while (!LIST_EMPTY(&racct->r_rule_links)) { link = LIST_FIRST(&racct->r_rule_links); LIST_REMOVE(link, rrl_next); rctl_rule_release(link->rrl_rule); uma_zfree(rctl_rule_link_zone, link); } - RCTL_WUNLOCK(); } static void Modified: head/sys/sys/racct.h ============================================================================== --- head/sys/sys/racct.h Thu Apr 21 16:12:55 2016 (r298413) +++ head/sys/sys/racct.h Thu Apr 21 16:22:52 2016 (r298414) @@ -156,6 +156,12 @@ SYSCTL_DECL(_kern_racct); #ifdef RACCT +extern struct mtx racct_lock; + +#define RACCT_LOCK() mtx_lock(&racct_lock) +#define RACCT_UNLOCK() mtx_unlock(&racct_lock) +#define RACCT_LOCK_ASSERT() mtx_assert(&racct_lock, MA_OWNED) + int racct_add(struct proc *p, int resource, uint64_t amount); void racct_add_cred(struct ucred *cred, int resource, uint64_t amount); void racct_add_force(struct proc *p, int resource, uint64_t amount); From owner-svn-src-all@freebsd.org Thu Apr 21 16:30:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84735B16D6B; Thu, 21 Apr 2016 16:30:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 551DB1021; Thu, 21 Apr 2016 16:30:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGUP6w042919; Thu, 21 Apr 2016 16:30:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGUPJg042918; Thu, 21 Apr 2016 16:30:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604211630.u3LGUPJg042918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 21 Apr 2016 16:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298416 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:30:26 -0000 Author: bdrewery Date: Thu Apr 21 16:30:25 2016 New Revision: 298416 URL: https://svnweb.freebsd.org/changeset/base/298416 Log: Fix 'make -n' for new packaging targets. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 21 16:30:16 2016 (r298415) +++ head/Makefile.inc1 Thu Apr 21 16:30:25 2016 (r298416) @@ -1238,7 +1238,7 @@ packagekernel: .PHONY .endif stagekernel: .PHONY - ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} distributekernel + ${_+_}${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} distributekernel PORTSDIR?= /usr/ports WSTAGEDIR?= ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH}/worldstage @@ -1257,7 +1257,7 @@ _pkgbootstrap: .PHONY .endif packages: .PHONY - ${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} real-packages + ${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} real-packages package-pkg: .PHONY rm -rf /tmp/ports.${TARGET} || : From owner-svn-src-all@freebsd.org Thu Apr 21 16:30:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B387B16D27; Thu, 21 Apr 2016 16:30:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 357D31EEC; Thu, 21 Apr 2016 16:30:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGUGZ5042869; Thu, 21 Apr 2016 16:30:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGUGFO042868; Thu, 21 Apr 2016 16:30:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604211630.u3LGUGFO042868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 21 Apr 2016 16:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298415 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:30:17 -0000 Author: bdrewery Date: Thu Apr 21 16:30:16 2016 New Revision: 298415 URL: https://svnweb.freebsd.org/changeset/base/298415 Log: Add more missing .PHONY. This also protects them from trying to create .meta files with WITH_META_MODE. Reported by: Nikolai Lifanov Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 21 16:22:52 2016 (r298414) +++ head/Makefile.inc1 Thu Apr 21 16:30:16 2016 (r298415) @@ -729,9 +729,9 @@ kernel-toolchain: ${TOOLCHAIN_TGTS:N_inc # # Checks to be sure system is ready for installworld/installkernel. # -installcheck: _installcheck_world _installcheck_kernel -_installcheck_world: -_installcheck_kernel: +installcheck: _installcheck_world _installcheck_kernel .PHONY +_installcheck_world: .PHONY +_installcheck_kernel: .PHONY # # Require DESTDIR to be set if installing for a different architecture or @@ -742,7 +742,7 @@ _installcheck_kernel: .if !make(distributeworld) _installcheck_world: __installcheck_DESTDIR _installcheck_kernel: __installcheck_DESTDIR -__installcheck_DESTDIR: +__installcheck_DESTDIR: .PHONY .if !defined(DESTDIR) || empty(DESTDIR) @echo "ERROR: Please set DESTDIR!"; \ false @@ -769,7 +769,7 @@ CHECK_UIDS+= unbound CHECK_GIDS+= unbound .endif _installcheck_world: __installcheck_UGID -__installcheck_UGID: +__installcheck_UGID: .PHONY .for uid in ${CHECK_UIDS} @if ! `id -u ${uid} >/dev/null 2>&1`; then \ echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ @@ -933,7 +933,7 @@ distributeworld installworld stageworld: .endif .endif -packageworld: +packageworld: .PHONY .for dist in base ${EXTRA_DISTRIBUTIONS} .if defined(NO_ROOT) ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ @@ -1129,7 +1129,7 @@ buildkernel: .MAKE .PHONY # Install the kernel defined by INSTALLKERNEL # installkernel installkernel.debug \ -reinstallkernel reinstallkernel.debug: _installcheck_kernel +reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY .if !defined(NO_INSTALLKERNEL) .if empty(INSTALLKERNEL) @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ @@ -1153,7 +1153,7 @@ reinstallkernel reinstallkernel.debug: _ .endfor .endif -distributekernel distributekernel.debug: +distributekernel distributekernel.debug: .PHONY .if !defined(NO_INSTALLKERNEL) .if empty(INSTALLKERNEL) @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ @@ -1192,7 +1192,7 @@ distributekernel distributekernel.debug: .endfor .endif -packagekernel: +packagekernel: .PHONY .if defined(NO_ROOT) .if !defined(NO_INSTALLKERNEL) cd ${DESTDIR}/${DISTDIR}/kernel; \ @@ -1237,7 +1237,7 @@ packagekernel: .endif .endif -stagekernel: +stagekernel: .PHONY ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} distributekernel PORTSDIR?= /usr/ports @@ -1251,29 +1251,29 @@ PKGSIGNKEY?= # empty .ORDER: create-packages create-kernel-packages .ORDER: create-packages sign-packages -_pkgbootstrap: +_pkgbootstrap: .PHONY .if !exists(${LOCALBASE}/sbin/pkg) @env ASSUME_ALWAYS_YES=YES pkg bootstrap .endif -packages: +packages: .PHONY ${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} real-packages -package-pkg: +package-pkg: .PHONY rm -rf /tmp/ports.${TARGET} || : env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${REVISION} \ PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} WSTAGEDIR=${WSTAGEDIR} \ sh ${.CURDIR}/release/scripts/make-pkg-package.sh -real-packages: stage-packages create-packages sign-packages +real-packages: stage-packages create-packages sign-packages .PHONY -stage-packages: +stage-packages: .PHONY @mkdir -p ${REPODIR} ${WSTAGEDIR} ${KSTAGEDIR} ${_+_}@cd ${.CURDIR}; \ ${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT -B stageworld ; \ ${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT -B stagekernel -create-packages: _pkgbootstrap +create-packages: _pkgbootstrap .PHONY @mkdir -p ${REPODIR} ${_+_}@cd ${.CURDIR}; \ ${MAKE} DESTDIR=${WSTAGEDIR} \ @@ -1282,7 +1282,7 @@ create-packages: _pkgbootstrap PKG_VERSION=${PKG_VERSION} DISTDIR=kernel \ create-kernel-packages -create-world-packages: _pkgbootstrap +create-world-packages: _pkgbootstrap .PHONY @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || : @cd ${WSTAGEDIR} ; \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ @@ -1307,7 +1307,7 @@ create-world-packages: _pkgbootstrap -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ done -create-kernel-packages: _pkgbootstrap +create-kernel-packages: _pkgbootstrap .PHONY .if exists(${KSTAGEDIR}/kernel.meta) .for flavor in "" -debug @cd ${KSTAGEDIR}/${DISTDIR} ; \ @@ -1367,7 +1367,7 @@ create-kernel-packages: _pkgbootstrap .endfor .endif -sign-packages: _pkgbootstrap +sign-packages: _pkgbootstrap .PHONY @[ -L "${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ unlink ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ @@ -1409,7 +1409,7 @@ doxygen: .PHONY # Update the source tree(s), by running svn/svnup to update to the # latest copy. # -update: +update: .PHONY .if defined(SVN_UPDATE) @echo "--------------------------------------------------------------" @echo ">>> Updating ${.CURDIR} using Subversion" @@ -1441,7 +1441,7 @@ update: _elftoolchain_libs= lib/libelf lib/libdwarf .endif -legacy: +legacy: .PHONY .if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0 @echo "ERROR: Source upgrades from versions prior to 8.0 are not supported."; \ false @@ -1665,7 +1665,7 @@ build-tools: build-tools_${_tool} # # kernel-tools: Build kernel-building tools # -kernel-tools: +kernel-tools: .PHONY mkdir -p ${MAKEOBJDIRPREFIX}/usr mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ -p ${MAKEOBJDIRPREFIX}/usr >/dev/null @@ -2144,7 +2144,7 @@ RM_I=-i RM_I=-v .endif -delete-old-files: +delete-old-files: .PHONY @echo ">>> Removing old files (only deletes safe to delete libs)" # Ask for every old file if the user really wants to remove it. # It's annoying, but better safe than sorry. @@ -2180,7 +2180,7 @@ delete-old-files: done @echo ">>> Old files removed" -check-old-files: +check-old-files: .PHONY @echo ">>> Checking for old files" @cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ @@ -2205,7 +2205,7 @@ check-old-files: fi; \ done -delete-old-libs: +delete-old-libs: .PHONY @echo ">>> Removing old libraries" @echo "${OLD_LIBS_MESSAGE}" | fmt @exec 3<&0; \ @@ -2227,7 +2227,7 @@ delete-old-libs: done @echo ">>> Old libraries removed" -check-old-libs: +check-old-libs: .PHONY @echo ">>> Checking for old libraries" @cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ @@ -2243,7 +2243,7 @@ check-old-libs: done; \ done -delete-old-dirs: +delete-old-dirs: .PHONY @echo ">>> Removing old directories" @cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ @@ -2257,7 +2257,7 @@ delete-old-dirs: done @echo ">>> Old directories removed" -check-old-dirs: +check-old-dirs: .PHONY @echo ">>> Checking for old directories" @cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ @@ -2270,10 +2270,10 @@ check-old-dirs: fi; \ done -delete-old: delete-old-files delete-old-dirs +delete-old: delete-old-files delete-old-dirs .PHONY @echo "To remove old libraries run '${MAKE} delete-old-libs'." -check-old: check-old-files check-old-libs check-old-dirs +check-old: check-old-files check-old-libs check-old-dirs .PHONY @echo "To remove old files and directories run '${MAKE} delete-old'." @echo "To remove old libraries run '${MAKE} delete-old-libs'." @@ -2282,7 +2282,7 @@ check-old: check-old-files check-old-lib # # showconfig - show build configuration. # -showconfig: +showconfig: .PHONY @(${MAKE} -n -f ${.CURDIR}/sys/conf/kern.opts.mk -V dummy -dg1; \ ${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1) 2>&1 | grep ^MK_ | sort -u @@ -2305,7 +2305,7 @@ DTBOUTPUTPATH= ${.CURDIR} # # Build 'standalone' Device Tree Blob # -builddtb: +builddtb: .PHONY @PATH=${TMPPATH} MACHINE=${TARGET} \ ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ "${FDT_DTS_FILE}" ${DTBOUTPUTPATH} @@ -2378,10 +2378,10 @@ OSREL!= uname -r | sed -e 's/[-(].*//' .endif .ORDER: xdev-build xdev-install xdev-links -xdev: xdev-build xdev-install +xdev: xdev-build xdev-install .PHONY .ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools -xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools +xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools .PHONY _xb-worldtmp: .PHONY mkdir -p ${CDTMP}/usr @@ -2437,7 +2437,7 @@ _xi-mtree: .PHONY .endif .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries -xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries +xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries .PHONY _xi-cross-tools: .PHONY @echo "_xi-cross-tools" @@ -2471,6 +2471,6 @@ xdev-links: .PHONY ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ done .else -xdev xdev-build xdev-install xdev-links: +xdev xdev-build xdev-install xdev-links: .PHONY @echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${.TARGET}\" target" .endif From owner-svn-src-all@freebsd.org Thu Apr 21 16:30:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 870CCB16DA0; Thu, 21 Apr 2016 16:30:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53356108B; Thu, 21 Apr 2016 16:30:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGUSYA042967; Thu, 21 Apr 2016 16:30:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGUSrx042966; Thu, 21 Apr 2016 16:30:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604211630.u3LGUSrx042966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 21 Apr 2016 16:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298417 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:30:29 -0000 Author: bdrewery Date: Thu Apr 21 16:30:28 2016 New Revision: 298417 URL: https://svnweb.freebsd.org/changeset/base/298417 Log: Remove redundant logic from the pkg-base merge. These will be set from the logic right above it. Reviewed by: gjb Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 21 16:30:25 2016 (r298416) +++ head/Makefile.inc1 Thu Apr 21 16:30:28 2016 (r298417) @@ -195,10 +195,6 @@ VERSION= FreeBSD ${REVISION}-${BRANCH:C/ .endif .if !defined(PKG_VERSION) -REVISION!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V REVISION -BRANCH!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V BRANCH -SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ - ${SRCDIR}/sys/sys/param.h .if ${BRANCH:MSTABLE*} || ${BRANCH:MCURRENT*} TIMENOW= %Y%m%d%H%M%S EXTRA_REVISION= .s${TIMENOW:gmtime} From owner-svn-src-all@freebsd.org Thu Apr 21 16:32:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB72DB16F85; Thu, 21 Apr 2016 16:32:49 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7541714; Thu, 21 Apr 2016 16:32:49 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGWmKB045953; Thu, 21 Apr 2016 16:32:48 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGWmln045951; Thu, 21 Apr 2016 16:32:48 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201604211632.u3LGWmln045951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 21 Apr 2016 16:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298418 - head/sys/boot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:32:49 -0000 Author: allanjude Date: Thu Apr 21 16:32:48 2016 New Revision: 298418 URL: https://svnweb.freebsd.org/changeset/base/298418 Log: Add more guards to disable GELIBOOT by defining LOADER_NO_GELI_SUPPORT Reviewed by: cem Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D6049 Modified: head/sys/boot/Makefile.amd64 head/sys/boot/Makefile.i386 Modified: head/sys/boot/Makefile.amd64 ============================================================================== --- head/sys/boot/Makefile.amd64 Thu Apr 21 16:30:28 2016 (r298417) +++ head/sys/boot/Makefile.amd64 Thu Apr 21 16:32:48 2016 (r298418) @@ -3,9 +3,12 @@ SUBDIR+= efi SUBDIR+= libstand32 SUBDIR+= zfs -SUBDIR+= geli SUBDIR+= userboot +.if !defined(LOADER_NO_GELI_SUPPORT) +SUBDIR+= geli +.endif + .if ${MK_FORTH} != "no" SUBDIR+= ficl32 .endif Modified: head/sys/boot/Makefile.i386 ============================================================================== --- head/sys/boot/Makefile.i386 Thu Apr 21 16:30:28 2016 (r298417) +++ head/sys/boot/Makefile.i386 Thu Apr 21 16:32:48 2016 (r298418) @@ -3,4 +3,7 @@ SUBDIR+= efi SUBDIR+= libstand32 SUBDIR+= zfs + +.if !defined(LOADER_NO_GELI_SUPPORT) SUBDIR+= geli +.endif From owner-svn-src-all@freebsd.org Thu Apr 21 16:33:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5195CB1701B; Thu, 21 Apr 2016 16:33:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2934418BD; Thu, 21 Apr 2016 16:33:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGXgKc046048; Thu, 21 Apr 2016 16:33:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGXgmY046047; Thu, 21 Apr 2016 16:33:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604211633.u3LGXgmY046047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 21 Apr 2016 16:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298419 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:33:43 -0000 Author: hselasky Date: Thu Apr 21 16:33:42 2016 New Revision: 298419 URL: https://svnweb.freebsd.org/changeset/base/298419 Log: Fix for using IPv6 addresses with RDMA: IPv6 addresses has a scope ID which sometimes is stored in the "sin6_scope_id" field of "struct sockaddr_in6" and sometimes as part of the IPv6 address itself depending on the context. If the scope ID is not in the expected location, the IPv6 address lookups in the so-called GID table will fail. Some code factoring has been made to achieve a clean exit of the "addr_resolve" function via a common "done" label. Sponsored by: Mellanox Technologies Submitted by: Shani Michaeli MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/addr.c Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 21 16:32:48 2016 (r298418) +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 21 16:33:42 2016 (r298419) @@ -109,6 +109,14 @@ int rdma_copy_addr(struct rdma_dev_addr } EXPORT_SYMBOL(rdma_copy_addr); +#define SCOPE_ID_CACHE(_scope_id, _addr6) do { \ + (_addr6)->sin6_addr.s6_addr[3] = (_scope_id); \ + (_addr6)->sin6_scope_id = 0; } while (0) + +#define SCOPE_ID_RESTORE(_scope_id, _addr6) do { \ + (_addr6)->sin6_scope_id = (_scope_id); \ + (_addr6)->sin6_addr.s6_addr[3] = 0; } while (0) + int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr, u16 *vlan_id) { @@ -144,12 +152,18 @@ int rdma_translate_ip(struct sockaddr *a struct sockaddr_in6 *sin6; struct ifaddr *ifa; in_port_t port; + uint32_t scope_id; sin6 = (struct sockaddr_in6 *)addr; port = sin6->sin6_port; sin6->sin6_port = 0; + scope_id = sin6->sin6_scope_id; + if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) + SCOPE_ID_CACHE(scope_id, sin6); ifa = ifa_ifwithaddr(addr); sin6->sin6_port = port; + if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) + SCOPE_ID_RESTORE(scope_id, sin6); if (ifa == NULL) { ret = -ENODEV; break; @@ -161,6 +175,8 @@ int rdma_translate_ip(struct sockaddr *a break; } #endif + default: + break; } return ret; } @@ -203,7 +219,12 @@ static int addr_resolve(struct sockaddr struct ifaddr *ifa; struct ifnet *ifp; struct rtentry *rte; +#if defined(INET) || defined(INET6) in_port_t port; +#endif +#ifdef INET6 + uint32_t scope_id; +#endif u_char edst[MAX_ADDR_LEN]; int multi; int bcast; @@ -219,6 +240,13 @@ static int addr_resolve(struct sockaddr sin6 = NULL; ifp = NULL; rte = NULL; + ifa = NULL; + ifp = NULL; + memset(edst, 0, sizeof(edst)); +#ifdef INET6 + scope_id = -1U; +#endif + switch (dst_in->sa_family) { #ifdef INET case AF_INET: @@ -236,6 +264,22 @@ static int addr_resolve(struct sockaddr port = sin->sin_port; sin->sin_port = 0; memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); + + /* + * If we have a source address to use look it + * up first and verify that it is a local + * interface: + */ + ifa = ifa_ifwithaddr(src_in); + sin->sin_port = port; + if (ifa == NULL) { + error = ENETUNREACH; + goto done; + } + ifp = ifa->ifa_ifp; + ifa_free(ifa); + if (bcast || multi) + goto mcast; } break; #endif @@ -244,42 +288,55 @@ static int addr_resolve(struct sockaddr sin6 = (struct sockaddr_in6 *)dst_in; if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) multi = 1; + if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) { + /* + * The IB address comparison fails if the + * scope ID is set and not part of the addr: + */ + scope_id = sin6->sin6_scope_id; + if (scope_id < 256) + SCOPE_ID_CACHE(scope_id, sin6); + } sin6 = (struct sockaddr_in6 *)src_in; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { port = sin6->sin6_port; sin6->sin6_port = 0; - } else - src_in = NULL; + if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) { + if (scope_id < 256) + SCOPE_ID_CACHE(scope_id, sin6); + } + + /* + * If we have a source address to use look it + * up first and verify that it is a local + * interface: + */ + ifa = ifa_ifwithaddr(src_in); + sin6->sin6_port = port; + if (ifa == NULL) { + error = ENETUNREACH; + goto done; + } + ifp = ifa->ifa_ifp; + ifa_free(ifa); + if (bcast || multi) + goto mcast; + } break; #endif default: - return -EINVAL; - } - /* - * If we have a source address to use look it up first and verify - * that it is a local interface. - */ - if (sin->sin_addr.s_addr != INADDR_ANY) { - ifa = ifa_ifwithaddr(src_in); - if (sin) - sin->sin_port = port; - if (sin6) - sin6->sin6_port = port; - if (ifa == NULL) - return -ENETUNREACH; - ifp = ifa->ifa_ifp; - ifa_free(ifa); - if (bcast || multi) - goto mcast; + error = EINVAL; + goto done; } /* * Make sure the route exists and has a valid link. */ rte = rtalloc1(dst_in, 1, 0); if (rte == NULL || rte->rt_ifp == NULL || !RT_LINK_IS_UP(rte->rt_ifp)) { - if (rte) + if (rte) RTFREE_LOCKED(rte); - return -EHOSTUNREACH; + error = EHOSTUNREACH; + goto done; } if (rte->rt_flags & RTF_GATEWAY) is_gw = 1; @@ -297,7 +354,8 @@ static int addr_resolve(struct sockaddr RTFREE_LOCKED(rte); } else if (ifp && ifp != rte->rt_ifp) { RTFREE_LOCKED(rte); - return -ENETUNREACH; + error = ENETUNREACH; + goto done; } else { if (ifp == NULL) { ifp = rte->rt_ifp; @@ -305,27 +363,29 @@ static int addr_resolve(struct sockaddr } RT_UNLOCK(rte); } +#if defined(INET) || defined(INET6) mcast: - if (bcast) - return rdma_copy_addr(addr, ifp, ifp->if_broadcastaddr); - if (multi) { +#endif + if (bcast) { + memcpy(edst, ifp->if_broadcastaddr, ifp->if_addrlen); + goto done; + } else if (multi) { struct sockaddr *llsa; struct sockaddr_dl sdl; sdl.sdl_len = sizeof(sdl); llsa = (struct sockaddr *)&sdl; - if (ifp->if_resolvemulti == NULL) - return -EOPNOTSUPP; - + if (ifp->if_resolvemulti == NULL) { + error = EOPNOTSUPP; + goto done; + } error = ifp->if_resolvemulti(ifp, &llsa, dst_in); - if (error) - return -error; - error = rdma_copy_addr(addr, ifp, - LLADDR((struct sockaddr_dl *)llsa)); - if (error == 0) - memcpy(src_in, ifa->ifa_addr, ip_addr_size(ifa->ifa_addr)); - return error; + if (error == 0) { + memcpy(edst, LLADDR((struct sockaddr_dl *)llsa), + ifp->if_addrlen); + } + goto done; } /* * Resolve the link local address. @@ -347,12 +407,21 @@ mcast: break; } RTFREE(rte); - if (error == 0) { +done: + if (error == 0) + error = -rdma_copy_addr(addr, ifp, edst); + if (error == 0) memcpy(src_in, ifa->ifa_addr, ip_addr_size(ifa->ifa_addr)); - return rdma_copy_addr(addr, ifp, edst); +#ifdef INET6 + if (scope_id < 256) { + sin6 = (struct sockaddr_in6 *)src_in; + SCOPE_ID_RESTORE(scope_id, sin6); + sin6 = (struct sockaddr_in6 *)dst_in; + SCOPE_ID_RESTORE(scope_id, sin6); } +#endif if (error == EWOULDBLOCK) - return -ENODATA; + error = ENODATA; return -error; } From owner-svn-src-all@freebsd.org Thu Apr 21 16:43:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73175B1745C; Thu, 21 Apr 2016 16:43:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4065310FD; Thu, 21 Apr 2016 16:43:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGhFH5057983; Thu, 21 Apr 2016 16:43:15 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGhFpR057982; Thu, 21 Apr 2016 16:43:15 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604211643.u3LGhFpR057982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 21 Apr 2016 16:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298420 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:43:16 -0000 Author: asomers Date: Thu Apr 21 16:43:15 2016 New Revision: 298420 URL: https://svnweb.freebsd.org/changeset/base/298420 Log: Notify userspace listeners when geom disk attributes have changed sys/geom/geom_disk.c: disk_attr_changed(): Generate a devctl event of type GEOM: for every call. MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D5952 Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Thu Apr 21 16:33:42 2016 (r298419) +++ head/sys/geom/geom_disk.c Thu Apr 21 16:43:15 2016 (r298420) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -839,11 +840,14 @@ disk_attr_changed(struct disk *dp, const { struct g_geom *gp; struct g_provider *pp; + char devnamebuf[128]; gp = dp->d_geom; if (gp != NULL) LIST_FOREACH(pp, &gp->provider, provider) (void)g_attr_changed(pp, attr, flag); + snprintf(devnamebuf, 128, "devname=%s%d", dp->d_name, dp->d_unit); + devctl_notify("GEOM", "disk", attr, devnamebuf); } void From owner-svn-src-all@freebsd.org Thu Apr 21 16:43:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30219B174E3; Thu, 21 Apr 2016 16:43:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 027A0132D; Thu, 21 Apr 2016 16:43:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGhafq058141; Thu, 21 Apr 2016 16:43:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGhahR058140; Thu, 21 Apr 2016 16:43:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604211643.u3LGhahR058140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 21 Apr 2016 16:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298421 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:43:37 -0000 Author: bdrewery Date: Thu Apr 21 16:43:36 2016 New Revision: 298421 URL: https://svnweb.freebsd.org/changeset/base/298421 Log: Add more missing .PHONY Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 21 16:43:15 2016 (r298420) +++ head/Makefile.inc1 Thu Apr 21 16:43:36 2016 (r298421) @@ -660,7 +660,7 @@ _libraries: ${_+_}cd ${.CURDIR}; \ ${WMAKE} -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no \ MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS} libraries -everything: +everything: .PHONY @echo @echo "--------------------------------------------------------------" @echo ">>> stage 4.3: building everything" @@ -679,7 +679,7 @@ WMAKE_TGTS+= everything WMAKE_TGTS+= build${libcompat} .endif -buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue +buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue buildworld_prologue: .PHONY @@ -717,8 +717,8 @@ buildenv: .PHONY || true TOOLCHAIN_TGTS= ${WMAKE_TGTS:Neverything:Nbuild${libcompat}} -toolchain: ${TOOLCHAIN_TGTS} -kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} +toolchain: ${TOOLCHAIN_TGTS} .PHONY +kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} .PHONY # # installcheck @@ -824,7 +824,7 @@ DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTR MTREE_MAGIC?= mtree 2.0 -distributeworld installworld stageworld: _installcheck_world +distributeworld installworld stageworld: _installcheck_world .PHONY mkdir -p ${INSTALLTMP} progs=$$(for prog in ${ITOOLS}; do \ if progpath=`which $$prog`; then \ From owner-svn-src-all@freebsd.org Thu Apr 21 16:49:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB188B176F5; Thu, 21 Apr 2016 16:49:06 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6733187E; Thu, 21 Apr 2016 16:49:06 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGn5Y0058968; Thu, 21 Apr 2016 16:49:06 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGn4Vo058952; Thu, 21 Apr 2016 16:49:04 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201604211649.u3LGn4Vo058952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 21 Apr 2016 16:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298422 - in head: release/arm sys/arm/allwinner sys/arm/allwinner/a20 sys/arm/allwinner/a31 sys/arm/conf sys/boot/fdt/dts/arm sys/modules/dtb/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:49:07 -0000 Author: jmcneill Date: Thu Apr 21 16:49:04 2016 New Revision: 298422 URL: https://svnweb.freebsd.org/changeset/base/298422 Log: Replace the A20 kernel config with a generic ALLWINNER kernel config that supports A20, A31, and A31S. Adds support for the BananaPi M2 (A31S) board. Submitted by: Emmanuel Vadot Reviewed by: jmcneill Differential Revision: https://reviews.freebsd.org/D5580 Added: head/sys/arm/allwinner/a31/files.a31 (contents, props changed) head/sys/arm/allwinner/a31/std.a31 (contents, props changed) head/sys/arm/allwinner/aw_if_dwc.c - copied unchanged from r298421, head/sys/arm/allwinner/a20/a20_if_dwc.c head/sys/arm/allwinner/std.allwinner (contents, props changed) head/sys/arm/conf/ALLWINNER - copied, changed from r298421, head/sys/arm/conf/A20 head/sys/boot/fdt/dts/arm/bananapim2.dts (contents, props changed) Deleted: head/sys/arm/allwinner/a20/a20_if_dwc.c head/sys/arm/conf/A20 Modified: head/release/arm/BANANAPI.conf head/release/arm/CUBIEBOARD2.conf head/sys/arm/allwinner/a10_padconf.c head/sys/arm/allwinner/a20/a20_padconf.c head/sys/arm/allwinner/a20/files.a20 head/sys/arm/allwinner/a31/a31_padconf.c head/sys/arm/allwinner/a31/a31s_padconf.c head/sys/arm/allwinner/files.allwinner head/sys/modules/dtb/allwinner/Makefile Modified: head/release/arm/BANANAPI.conf ============================================================================== --- head/release/arm/BANANAPI.conf Thu Apr 21 16:43:36 2016 (r298421) +++ head/release/arm/BANANAPI.conf Thu Apr 21 16:49:04 2016 (r298422) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-bananapi" -KERNEL="A20" +KERNEL="ALLWINNER" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" Modified: head/release/arm/CUBIEBOARD2.conf ============================================================================== --- head/release/arm/CUBIEBOARD2.conf Thu Apr 21 16:43:36 2016 (r298421) +++ head/release/arm/CUBIEBOARD2.conf Thu Apr 21 16:49:04 2016 (r298422) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" -KERNEL="A20" +KERNEL="ALLWINNER" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" Modified: head/sys/arm/allwinner/a10_padconf.c ============================================================================== --- head/sys/arm/allwinner/a10_padconf.c Thu Apr 21 16:43:36 2016 (r298421) +++ head/sys/arm/allwinner/a10_padconf.c Thu Apr 21 16:49:04 2016 (r298422) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include +#ifdef SOC_ALLWINNER_A10 + const static struct allwinner_pins a10_pins[] = { {"PA0", 0, 0, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, {"PA1", 0, 1, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, @@ -225,3 +227,5 @@ const struct allwinner_padconf a10_padco .npins = sizeof(a10_pins) / sizeof(struct allwinner_pins), .pins = a10_pins, }; + +#endif /* SOC_ALLWINNER_A10 */ Modified: head/sys/arm/allwinner/a20/a20_padconf.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_padconf.c Thu Apr 21 16:43:36 2016 (r298421) +++ head/sys/arm/allwinner/a20/a20_padconf.c Thu Apr 21 16:49:04 2016 (r298422) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include +#ifdef SOC_ALLWINNER_A20 + const static struct allwinner_pins a20_pins[] = { {"PA0", 0, 0, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", "gmac", NULL, NULL}}, {"PA1", 0, 1, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", "gmac", NULL, NULL}}, @@ -225,3 +227,5 @@ const struct allwinner_padconf a20_padco .npins = sizeof(a20_pins) / sizeof(struct allwinner_pins), .pins = a20_pins, }; + +#endif /* SOC_ALLWINNER_A20 */ Modified: head/sys/arm/allwinner/a20/files.a20 ============================================================================== --- head/sys/arm/allwinner/a20/files.a20 Thu Apr 21 16:43:36 2016 (r298421) +++ head/sys/arm/allwinner/a20/files.a20 Thu Apr 21 16:49:04 2016 (r298422) @@ -1,5 +1,3 @@ # $FreeBSD$ arm/allwinner/a20/a20_padconf.c standard -arm/allwinner/aw_mp.c optional smp -arm/allwinner/a20/a20_if_dwc.c optional dwc Modified: head/sys/arm/allwinner/a31/a31_padconf.c ============================================================================== --- head/sys/arm/allwinner/a31/a31_padconf.c Thu Apr 21 16:43:36 2016 (r298421) +++ head/sys/arm/allwinner/a31/a31_padconf.c Thu Apr 21 16:49:04 2016 (r298422) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include +#ifdef SOC_ALLWINNER_A31 + const static struct allwinner_pins a31_pins[] = { {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, @@ -214,3 +216,5 @@ const struct allwinner_padconf a31_padco .npins = nitems(a31_pins), .pins = a31_pins, }; + +#endif /* SOC_ALLWINNER_A31 */ Modified: head/sys/arm/allwinner/a31/a31s_padconf.c ============================================================================== --- head/sys/arm/allwinner/a31/a31s_padconf.c Thu Apr 21 16:43:36 2016 (r298421) +++ head/sys/arm/allwinner/a31/a31s_padconf.c Thu Apr 21 16:49:04 2016 (r298422) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include +#ifdef SOC_ALLWINNER_A31S + const static struct allwinner_pins a31s_pins[] = { {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, @@ -194,3 +196,5 @@ const struct allwinner_padconf a31s_padc .npins = nitems(a31s_pins), .pins = a31s_pins, }; + +#endif /* SOC_ALLWINNER_A31S */ Added: head/sys/arm/allwinner/a31/files.a31 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a31/files.a31 Thu Apr 21 16:49:04 2016 (r298422) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +arm/allwinner/a31/a31_padconf.c standard +arm/allwinner/a31/a31s_padconf.c standard Added: head/sys/arm/allwinner/a31/std.a31 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a31/std.a31 Thu Apr 21 16:49:04 2016 (r298422) @@ -0,0 +1,15 @@ +# Allwinner A31 common options +#$FreeBSD$ + +cpu CPU_CORTEXA +machine arm armv6 +makeoptions CONF_CFLAGS="-march=armv7a" + +makeoptions KERNVIRTADDR=0xc0200000 +options KERNVIRTADDR=0xc0200000 + +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + +files "../allwinner/files.allwinner" +files "../allwinner/a31/files.a31" Copied: head/sys/arm/allwinner/aw_if_dwc.c (from r298421, head/sys/arm/allwinner/a20/a20_if_dwc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_if_dwc.c Thu Apr 21 16:49:04 2016 (r298422, copy of r298421, head/sys/arm/allwinner/a20/a20_if_dwc.c) @@ -0,0 +1,145 @@ +/*- + * Copyright (c) 2015 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "if_dwc_if.h" + +static int +a20_if_dwc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "allwinner,sun7i-a20-gmac")) + return (ENXIO); + device_set_desc(dev, "A20 Gigabit Ethernet Controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +a20_if_dwc_init(device_t dev) +{ + const char *tx_parent_name; + char *phy_type; + clk_t clk_tx, clk_tx_parent; + regulator_t reg; + phandle_t node; + int error; + + node = ofw_bus_get_node(dev); + + /* Configure PHY for MII or RGMII mode */ + if (OF_getprop_alloc(node, "phy-mode", 1, (void **)&phy_type)) { + error = clk_get_by_ofw_name(dev, "allwinner_gmac_tx", &clk_tx); + if (error != 0) { + device_printf(dev, "could not get tx clk\n"); + return (error); + } + + if (strcmp(phy_type, "rgmii") == 0) + tx_parent_name = "gmac_int_tx"; + else + tx_parent_name = "mii_phy_tx"; + + error = clk_get_by_name(dev, tx_parent_name, &clk_tx_parent); + if (error != 0) { + device_printf(dev, "could not get clock '%s'\n", + tx_parent_name); + return (error); + } + + error = clk_set_parent_by_clk(clk_tx, clk_tx_parent); + if (error != 0) { + device_printf(dev, "could not set tx clk parent\n"); + return (error); + } + } + + /* Enable PHY regulator if applicable */ + if (regulator_get_by_ofw_property(dev, "phy-supply", ®) == 0) { + error = regulator_enable(reg); + if (error != 0) { + device_printf(dev, "could not enable PHY regulator\n"); + return (error); + } + } + + return (0); +} + +static int +a20_if_dwc_mac_type(device_t dev) +{ + + return (DWC_GMAC_ALT_DESC); +} + +static int +a20_if_dwc_mii_clk(device_t dev) +{ + + return (GMAC_MII_CLK_150_250M_DIV102); +} + +static device_method_t a20_dwc_methods[] = { + DEVMETHOD(device_probe, a20_if_dwc_probe), + + DEVMETHOD(if_dwc_init, a20_if_dwc_init), + DEVMETHOD(if_dwc_mac_type, a20_if_dwc_mac_type), + DEVMETHOD(if_dwc_mii_clk, a20_if_dwc_mii_clk), + + DEVMETHOD_END +}; + +static devclass_t a20_dwc_devclass; + +extern driver_t dwc_driver; + +DEFINE_CLASS_1(dwc, a20_dwc_driver, a20_dwc_methods, sizeof(struct dwc_softc), + dwc_driver); +DRIVER_MODULE(a20_dwc, simplebus, a20_dwc_driver, a20_dwc_devclass, 0, 0); + +MODULE_DEPEND(a20_dwc, dwc, 1, 1, 1); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Thu Apr 21 16:43:36 2016 (r298421) +++ head/sys/arm/allwinner/files.allwinner Thu Apr 21 16:49:04 2016 (r298422) @@ -10,10 +10,12 @@ arm/allwinner/aw_usbphy.c optional ehci arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_mmc.c optional mmc arm/allwinner/a10_sramc.c standard +arm/allwinner/aw_if_dwc.c optional dwc arm/allwinner/aw_rtc.c standard arm/allwinner/aw_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/allwinner_machdep.c standard +arm/allwinner/aw_mp.c optional smp arm/allwinner/axp209.c optional axp209 arm/allwinner/if_emac.c optional emac arm/allwinner/sunxi_dma_if.m standard Added: head/sys/arm/allwinner/std.allwinner ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/std.allwinner Thu Apr 21 16:49:04 2016 (r298422) @@ -0,0 +1,16 @@ +# Allwinner common options +#$FreeBSD$ + +cpu CPU_CORTEXA +machine arm armv6 +makeoptions CONF_CFLAGS="-march=armv7a" + +makeoptions KERNVIRTADDR=0xc0200000 +options KERNVIRTADDR=0xc0200000 + +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + +files "../allwinner/files.allwinner" +files "../allwinner/a20/files.a20" +files "../allwinner/a31/files.a31" Copied and modified: head/sys/arm/conf/ALLWINNER (from r298421, head/sys/arm/conf/A20) ============================================================================== --- head/sys/arm/conf/A20 Thu Apr 21 16:43:36 2016 (r298421, copy source) +++ head/sys/arm/conf/ALLWINNER Thu Apr 21 16:49:04 2016 (r298422) @@ -1,5 +1,5 @@ # -# A20 -- Custom configuration for the Allwinner A20 ARM SoC +# ALLWINNER -- Custom configuration for the Allwinner A20 and A31 ARM SoC # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -18,14 +18,16 @@ # # $FreeBSD$ -ident A20 +ident ALLWINNER include "std.armv6" -include "../allwinner/a20/std.a20" +include "../allwinner/std.allwinner" options INTRNG options SOC_ALLWINNER_A20 +options SOC_ALLWINNER_A31 +options SOC_ALLWINNER_A31S options HZ=100 options SCHED_ULE # ULE scheduler @@ -56,7 +58,7 @@ options WITNESS_SKIPSPIN # Don't run wi #options BOOTP_WIRED_TO=dwc0 # EXT_RESOURCES pseudo devices -options EXT_RESOURCES +options EXT_RESOURCES device clk device phy device hwreset @@ -125,9 +127,6 @@ device miibus # Sound support device sound -# Pinmux -device fdt_pinctrl - # Framebuffer support device vt device kbdmux @@ -136,6 +135,9 @@ device ukbd device videomode device hdmi +# Pinmux +device fdt_pinctrl + # Flattened Device Tree options FDT # Configure using FDT/DTB data makeoptions MODULES_EXTRA=dtb/allwinner Added: head/sys/boot/fdt/dts/arm/bananapim2.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/bananapim2.dts Thu Apr 21 16:49:04 2016 (r298422) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "sun6i-a31s-sinovoip-bpi-m2.dts" + +&mmc2 { + status = "disabled"; +}; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Thu Apr 21 16:43:36 2016 (r298421) +++ head/sys/modules/dtb/allwinner/Makefile Thu Apr 21 16:49:04 2016 (r298422) @@ -2,6 +2,7 @@ # All the dts files for allwinner systems we support. DTS= \ bananapi.dts \ + bananapim2.dts \ cubieboard.dts \ cubieboard2.dts \ olimex-a20-som-evb.dts \ From owner-svn-src-all@freebsd.org Thu Apr 21 16:50:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28202B177F2; Thu, 21 Apr 2016 16:50:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2AD61ADF; Thu, 21 Apr 2016 16:50:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LGokk6059111; Thu, 21 Apr 2016 16:50:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LGokxk059110; Thu, 21 Apr 2016 16:50:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604211650.u3LGokxk059110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 21 Apr 2016 16:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298423 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:50:47 -0000 Author: bdrewery Date: Thu Apr 21 16:50:45 2016 New Revision: 298423 URL: https://svnweb.freebsd.org/changeset/base/298423 Log: Fix unset variables from r298417. Pointyhat to: bdrewery Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 21 16:49:04 2016 (r298422) +++ head/Makefile.inc1 Thu Apr 21 16:50:45 2016 (r298423) @@ -185,24 +185,33 @@ OSRELDATE= 0 .endif # Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION. -.if !defined(VERSION) -REVISION!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V REVISION -BRANCH!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V BRANCH +.if !defined(_REVISION) +_REVISION!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V REVISION +.export _REVISION +.endif +.if !defined(_BRANCH) +_BRANCH!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V BRANCH +.export _BRANCH +.endif +.if !defined(SRCRELDATE) SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ ${SRCDIR}/sys/sys/param.h -VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE} +.export SRCRELDATE +.endif +.if !defined(VERSION) +VERSION= FreeBSD ${_REVISION}-${_BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE} .export VERSION .endif .if !defined(PKG_VERSION) -.if ${BRANCH:MSTABLE*} || ${BRANCH:MCURRENT*} +.if ${_BRANCH:MSTABLE*} || ${_BRANCH:MCURRENT*} TIMENOW= %Y%m%d%H%M%S EXTRA_REVISION= .s${TIMENOW:gmtime} .endif -.if ${BRANCH:M*-p*} -EXTRA_REVISION= _${BRANCH:C/.*-p([0-9]+$)/\1/} +.if ${_BRANCH:M*-p*} +EXTRA_REVISION= _${_BRANCH:C/.*-p([0-9]+$)/\1/} .endif -PKG_VERSION= ${REVISION}${EXTRA_REVISION} +PKG_VERSION= ${_REVISION}${EXTRA_REVISION} .endif KNOWN_ARCHES?= aarch64/arm64 \ @@ -1257,7 +1266,7 @@ packages: .PHONY package-pkg: .PHONY rm -rf /tmp/ports.${TARGET} || : - env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${REVISION} \ + env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \ PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} WSTAGEDIR=${WSTAGEDIR} \ sh ${.CURDIR}/release/scripts/make-pkg-package.sh From owner-svn-src-all@freebsd.org Thu Apr 21 17:08:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D952CB17168; Thu, 21 Apr 2016 17:08:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com [IPv6:2a00:1450:4010:c04::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62C1516BB; Thu, 21 Apr 2016 17:08:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x22f.google.com with SMTP id os9so30611544lbb.2; Thu, 21 Apr 2016 10:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=5R98OdF+WezAVKIxIwGzVSlaXF0eR/+YRvzlLVRF9CY=; b=z9YxiliOVhN0pPdvIDXnNOXChBEzNaywPA3KJqNNJuNgyFe03pSLGiLRdm5EBwAjNS 4Jl7JPGDIHs3BdaHPYY2T00w2Urvyrqjxtt7s9iX55kL5MelJ0eRLXEhl9A7PQ4I8PIa aaNConQVOAm4uNCgcdJWyofKEqRa8TiaCUxLNeDXZDKXEZfVA/fC9Pevawy2lJ18lUp8 qJeEkBKy41dqZHnFGb2GVndDO0ICj6ieDYLeA0q5fIh9P8KldVbS4m6oK3m1EYzWd2av 6Vv45rIrLP5b+fKne2l7jXs1yDbjaMv70JoD62BlaNWEWxgHMb5OC8alZFeF3d5qIeM1 2hmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=5R98OdF+WezAVKIxIwGzVSlaXF0eR/+YRvzlLVRF9CY=; b=TnDGfUsv4DvH+zm/njMambHG14zV2ifcOgoXT8Pind0Qk4O9hMaS3Hiybh2/Rn7EXj klJratI3bhfxyviyhKb7qP4ifNqgUhlrsecdz9mXH5V/URqv7OkpjTuBPn0YBgWy9gsV K8dTdgRotGKAkyrhp4JOkJ1u1BdYwhm5WmX+LANLwn/RaDILgoEs26Wcsu78ZnvIkfC8 IH56cRf90OCfh+isyUsBY45uuwa5DaNRzDGE4HAFXTSDARDt4bWY2SL+WUp3RxxQywZk rCIhKBV5YZjRYvhNNNFGVLBaOW3EiMUckYsyg5PzND1V3qQIzqtLwhtMBf/Pc9mLlyB5 aNrQ== X-Gm-Message-State: AOPr4FWIZtO9eNv2FE3oxshs33D9tMBPXmI8N0KNUwxnpEHpOuj5jhWLX2juUwVKlNlvy2yd+lN9gO9gRY09Jg== MIME-Version: 1.0 X-Received: by 10.112.147.225 with SMTP id tn1mr6855001lbb.98.1461258524621; Thu, 21 Apr 2016 10:08:44 -0700 (PDT) Received: by 10.112.236.33 with HTTP; Thu, 21 Apr 2016 10:08:44 -0700 (PDT) In-Reply-To: <201604211643.u3LGhFpR057982@repo.freebsd.org> References: <201604211643.u3LGhFpR057982@repo.freebsd.org> Date: Thu, 21 Apr 2016 10:08:44 -0700 Message-ID: Subject: Re: svn commit: r298420 - head/sys/geom From: Ngie Cooper To: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 17:08:47 -0000 On Thu, Apr 21, 2016 at 9:43 AM, Alan Somers wrote: > Author: asomers > Date: Thu Apr 21 16:43:15 2016 > New Revision: 298420 > URL: https://svnweb.freebsd.org/changeset/base/298420 > > Log: > Notify userspace listeners when geom disk attributes have changed > > sys/geom/geom_disk.c: > disk_attr_changed(): Generate a devctl event of type GEOM: for > every call. > > MFC after: 4 weeks > Sponsored by: Spectra Logic Corp > Differential Revision: https://reviews.freebsd.org/D5952 > > Modified: > head/sys/geom/geom_disk.c > > Modified: head/sys/geom/geom_disk.c > ============================================================================== > --- head/sys/geom/geom_disk.c Thu Apr 21 16:33:42 2016 (r298419) > +++ head/sys/geom/geom_disk.c Thu Apr 21 16:43:15 2016 (r298420) > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -839,11 +840,14 @@ disk_attr_changed(struct disk *dp, const > { > struct g_geom *gp; > struct g_provider *pp; > + char devnamebuf[128]; Why 128? Also, why not sbuf? > gp = dp->d_geom; > if (gp != NULL) > LIST_FOREACH(pp, &gp->provider, provider) > (void)g_attr_changed(pp, attr, flag); > + snprintf(devnamebuf, 128, "devname=%s%d", dp->d_name, dp->d_unit); Why not sizeof(devnamebuf) ? > + devctl_notify("GEOM", "disk", attr, devnamebuf); > } > > void > From owner-svn-src-all@freebsd.org Thu Apr 21 17:09:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEEA5B171DB; Thu, 21 Apr 2016 17:09:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x22d.google.com (mail-lb0-x22d.google.com [IPv6:2a00:1450:4010:c04::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91A77185D; Thu, 21 Apr 2016 17:09:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x22d.google.com with SMTP id b1so27072677lbi.1; Thu, 21 Apr 2016 10:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=h/+N5nd3Uselza9CngxDvaeGfxFmpsOm86kTEWW3IqY=; b=H0qBvpnfs4Vb0uJdvYr48jDySXexMBbtgnJrkAurn4kftTh6NzBRLjOXwIjdE/c1e3 LNJcoWi9eiJ6ZFs6IR49u3r1JKvmP0Lf3jJzXnrZJXxZbuCeN7wmMpXlXwEzIn8cm5TO gedX7ENSNgxe53psYWsbNKPKmjouCPt28IJTt28nHeNJQFTbUbQHSjRzcSYr/5avc26j o7gTn64oUIeN1Nqy7PY9dva8wrPp6090jl7Yw2cR8rvpzOEKbmjEvWPTUyw/L96IvQjn pvmuuD4zLmv4m17hkGQKm8rwse9COVGgU76YZrQGt1fihQzW6ki6Q+tK5YLCbpd4jmKM LiXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=h/+N5nd3Uselza9CngxDvaeGfxFmpsOm86kTEWW3IqY=; b=JOij36yDNq7xEZBq8VdoexMJv5bw13kOuT2YoqWQOkGMS+DwGGm5irWDREwUKUC/PC mQEiIam7m6xqDp81WdLJxAQZXDHqL6Prp9ecXq7Bq8oQ6WsiU6aOKr33Ng8c0/lvIpI2 kzc/Wd6SZvTe3d5XOF9LNr4DpOeCdZzdw9lt+j+cHTMQXm7bLSJku7zqL8rZiWBaCuVL 97aTQSxap5jc7VHaitz4BGxFiN+GaJu1VnyZ2tRb1NvLprlKHtfbpVgNBmMDuBbaSKv+ kQpHFutuXVG8sr1YnSv2ALIlsNG4/FrjAZ3fqsdz9GG3eDxIAmwpoMvidSBjsjVgFYFM d/+g== X-Gm-Message-State: AOPr4FUszCHZZUlgvt4AU7Nwy94yW6T4b/gbXTtlLhPFu8ZRvu/npbu8MWRyPmtjBXd3JpZSJHAv4i+dxoC3Dg== MIME-Version: 1.0 X-Received: by 10.112.171.74 with SMTP id as10mr3133475lbc.139.1461258588771; Thu, 21 Apr 2016 10:09:48 -0700 (PDT) Received: by 10.112.236.33 with HTTP; Thu, 21 Apr 2016 10:09:48 -0700 (PDT) In-Reply-To: References: <201604211643.u3LGhFpR057982@repo.freebsd.org> Date: Thu, 21 Apr 2016 10:09:48 -0700 Message-ID: Subject: Re: svn commit: r298420 - head/sys/geom From: Ngie Cooper To: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 17:09:51 -0000 On Thu, Apr 21, 2016 at 10:08 AM, Ngie Cooper wrote: > On Thu, Apr 21, 2016 at 9:43 AM, Alan Somers wrote: >> Author: asomers >> Date: Thu Apr 21 16:43:15 2016 >> New Revision: 298420 >> URL: https://svnweb.freebsd.org/changeset/base/298420 >> >> Log: >> Notify userspace listeners when geom disk attributes have changed >> >> sys/geom/geom_disk.c: >> disk_attr_changed(): Generate a devctl event of type GEOM: for >> every call. >> >> MFC after: 4 weeks >> Sponsored by: Spectra Logic Corp >> Differential Revision: https://reviews.freebsd.org/D5952 >> >> Modified: >> head/sys/geom/geom_disk.c >> >> Modified: head/sys/geom/geom_disk.c >> ============================================================================== >> --- head/sys/geom/geom_disk.c Thu Apr 21 16:33:42 2016 (r298419) >> +++ head/sys/geom/geom_disk.c Thu Apr 21 16:43:15 2016 (r298420) >> @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -839,11 +840,14 @@ disk_attr_changed(struct disk *dp, const >> { >> struct g_geom *gp; >> struct g_provider *pp; >> + char devnamebuf[128]; > > Why 128? Also, why not sbuf? > >> gp = dp->d_geom; >> if (gp != NULL) >> LIST_FOREACH(pp, &gp->provider, provider) >> (void)g_attr_changed(pp, attr, flag); >> + snprintf(devnamebuf, 128, "devname=%s%d", dp->d_name, dp->d_unit); > > Why not sizeof(devnamebuf) ? Also: this doesn't NUL terminate devnamebuf; it really should (otherwise, boom... crash in geom)... From owner-svn-src-all@freebsd.org Thu Apr 21 17:12:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A4FB173AA; Thu, 21 Apr 2016 17:12:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x235.google.com (mail-lb0-x235.google.com [IPv6:2a00:1450:4010:c04::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4FE61D7F; Thu, 21 Apr 2016 17:12:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x235.google.com with SMTP id os9so30664061lbb.2; Thu, 21 Apr 2016 10:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=fMxVspsjiLUrGolJ/7Rke1ubGzlvDnFb7n9sfEHL0II=; b=tOu0iHzCdEFyZP2wWha7nWE/vPQatF6sgac8uxSa1GO2MjMUd/wpZ63jYVJZCZzfmQ VdVGWgg+F2jpU2/4RAEygMXcgOLwnCRmLyIW51Z+m8wwH3075/lu9cJTi1IQcwhGHPNk uMmb2ojNeywjL7PqGQfc9YXoBnZBjOgqzFgNwX1i3xkk461+M3+ForZohHIqmGVg27Q/ CAlmB3tI+lTkR6uZjefcx05klLH8Wa4EZrpTOPIgYK5U9ObSF7oDZL6b/vsFevS6wl1c /j6pc+INC02CYqZfTxzGMPSj/RE97X4BKh+xBGpizspIsQK6vWK4rHb9Qb9WoRAYUgeD R+eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=fMxVspsjiLUrGolJ/7Rke1ubGzlvDnFb7n9sfEHL0II=; b=T/7uAJivySxDTIDxg83DSIxfvcpiHttV8BULrukBE5ZKFvTO5ga8uSeruOz+cC5hDi qqX5B6FR3s9D6nGsWC4sOhZQ6ml1n8bNl8GkEEi3PDLmAtXX1XIcE9TpBCXEuDcyj87l McVwylzHJKcE9hE31VhOLnjGPLcuEkgujgW3L4aB/47feOVnwT8zCQfb0ZCbdtsSUvxW qCDprjozkrE5bp3OPTEtKtiguyn11PWiIVTuCOfUNiSBJevvRj2SrgPBb1uJs3rXLyw6 v4sVH7z6TTogmlFh6a6r+g/pryUAB21s8ScwGcBnOJU0BHr3uot9vXm/I10n1qlLvHYe t/jg== X-Gm-Message-State: AOPr4FUiC1P1nIZsembGUIcOhV0sVSq3fSORrvB9fBmZv54XHNPGn7JBobFx3TYrEf3x4SFQY/lhBqQvSKdE1Q== MIME-Version: 1.0 X-Received: by 10.112.205.69 with SMTP id le5mr410755lbc.138.1461258741834; Thu, 21 Apr 2016 10:12:21 -0700 (PDT) Received: by 10.112.236.33 with HTTP; Thu, 21 Apr 2016 10:12:21 -0700 (PDT) In-Reply-To: <201604211604.u3LG4wmT035874@repo.freebsd.org> References: <201604211604.u3LG4wmT035874@repo.freebsd.org> Date: Thu, 21 Apr 2016 10:12:21 -0700 Message-ID: Subject: Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core From: Ngie Cooper To: Hans Petter Selasky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 17:12:25 -0000 On Thu, Apr 21, 2016 at 9:04 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Apr 21 16:04:58 2016 > New Revision: 298412 > URL: https://svnweb.freebsd.org/changeset/base/298412 > > Log: > Fix for resolving mac address when the destination address is a gateway. > Remove some dead code while at it. > > Sponsored by: Mellanox Technologies > MFC after: 1 week > > Modified: > head/sys/ofed/drivers/infiniband/core/addr.c > > Modified: head/sys/ofed/drivers/infiniband/core/addr.c > ============================================================================== > --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 21 15:38:28 2016 (r298411) > +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 21 16:04:58 2016 (r298412) > @@ -333,17 +333,18 @@ mcast: > switch (dst_in->sa_family) { > #ifdef INET > case AF_INET: > - error = arpresolve(ifp, is_gw, NULL, dst_in, edst, NULL); > + error = arpresolve(ifp, is_gw, NULL, > + is_gw ? rte->rt_gateway : dst_in, edst, NULL); > break; > #endif > #ifdef INET6 > case AF_INET6: > - error = nd6_resolve(ifp, is_gw, NULL, dst_in, edst, NULL); > + error = nd6_resolve(ifp, is_gw, NULL, > + is_gw ? rte->rt_gateway : dst_in, edst, NULL); > break; > #endif > default: > - /* XXX: Shouldn't happen. */ > - error = -EINVAL; > + break; > } > RTFREE(rte); > if (error == 0) { Please put the "deadcode" back. It will crash now if it's given an invalid address family (or none are configured in the kernel) when it tries to do the memcpy below. From owner-svn-src-all@freebsd.org Thu Apr 21 17:19:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EA30B175A0; Thu, 21 Apr 2016 17:19:03 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4618A103D; Thu, 21 Apr 2016 17:19:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 84A981FE024; Thu, 21 Apr 2016 19:18:59 +0200 (CEST) Subject: Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core To: Ngie Cooper References: <201604211604.u3LG4wmT035874@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <57190C47.8070106@selasky.org> Date: Thu, 21 Apr 2016 19:22:15 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 17:19:03 -0000 On 04/21/16 19:12, Ngie Cooper wrote: > Please put the "deadcode" back. It will crash now if it's given an > invalid address family (or none are configured in the kernel) when it > tries to do the memcpy below. If you look a few lines up in the file, not the patch, you'll see that there already is a switch case which catches this. OK? --HPS From owner-svn-src-all@freebsd.org Thu Apr 21 17:26:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4EA0B17A41; Thu, 21 Apr 2016 17:26:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89620174F; Thu, 21 Apr 2016 17:26:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x22d.google.com with SMTP id r78so94193114oie.0; Thu, 21 Apr 2016 10:26:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=5EC8JLlAakCw1Cv4g641xdzYUTr6ogN+nqPl0EXJ1XU=; b=S6nBuLSV5JB0x+/NiKykomiZJ7pBu3vGY35eE4jDq/bcGSAwDunHJn2zf7NBs3Nft6 f6FxJCmbRU+0dEaJ4mxdpF5QChad5r0/SUtyIeqxQw//tLNmIPLAvlEZx871jSZsk9mW KXah/fbsJSmoihdQDYfZANJsmh+jkRya3OUBry/2ceOZ5DsWVmKPvh2CimSOs5AUjD3/ 7tW2PHZaIAX8HCMAdvpVClo+CVso8SkgxmpOihXfmRF/AMgQgDrYPVpqVORCFG/s/F2g yrA+nHiDE8wTtH/whm9oSA8zCJonrr0jmybuS0hd1lOq0YZXlaJYcLWnn8B62gcm9DM5 TTnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=5EC8JLlAakCw1Cv4g641xdzYUTr6ogN+nqPl0EXJ1XU=; b=APfFJUwS0KR5RLLCCQ5HR3FY8rRnJ5i1/fBYvwosPV6LizEMs3zhp0bNDu+I3wStLw yG+KM9qLlJANqZEhVilfFQDP2eTMApxDkCcDVwGYMGqxIuOZQZOcH5HZxWVvo77BLqxD CavTQjW/KwrM4ghlBVZpK3y+gt1ZqdtGhtW0XNbW6esLTIHO39CZNPecZZpbTG2N1OQa HOpx3nEYzMFSHTb7EiLeXH6R49oW99ZLFPEEvNTNBhkmB4uPu2RGzwHaEkua91d+QxyU dYxX8WRLEckEp7bTV1G95UJwD6oXm6wsKU4qlsXcGC0aP3oV5BwY/d+qo49ZtbveHcJV f3vg== X-Gm-Message-State: AOPr4FUYxQCnG2UEv2rhYS6xrW8SDCaBTnHuLmua+hnVwtoRO/UbZZkU55eto4PzMjOjWKk7i8NPznHNGxmdcw== MIME-Version: 1.0 X-Received: by 10.182.28.168 with SMTP id c8mr7125852obh.49.1461259587906; Thu, 21 Apr 2016 10:26:27 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.64.138 with HTTP; Thu, 21 Apr 2016 10:26:27 -0700 (PDT) In-Reply-To: References: <201604211643.u3LGhFpR057982@repo.freebsd.org> Date: Thu, 21 Apr 2016 11:26:27 -0600 X-Google-Sender-Auth: SCqwqFe0rGNmOpp95t_Kc3ke8jY Message-ID: Subject: Re: svn commit: r298420 - head/sys/geom From: Alan Somers To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 17:26:28 -0000 On Thu, Apr 21, 2016 at 11:09 AM, Ngie Cooper wrote: > On Thu, Apr 21, 2016 at 10:08 AM, Ngie Cooper > wrote: > > On Thu, Apr 21, 2016 at 9:43 AM, Alan Somers > wrote: > >> Author: asomers > >> Date: Thu Apr 21 16:43:15 2016 > >> New Revision: 298420 > >> URL: https://svnweb.freebsd.org/changeset/base/298420 > >> > >> Log: > >> Notify userspace listeners when geom disk attributes have changed > >> > >> sys/geom/geom_disk.c: > >> disk_attr_changed(): Generate a devctl event of type > GEOM: for > >> every call. > >> > >> MFC after: 4 weeks > >> Sponsored by: Spectra Logic Corp > >> Differential Revision: https://reviews.freebsd.org/D5952 > >> > >> Modified: > >> head/sys/geom/geom_disk.c > >> > >> Modified: head/sys/geom/geom_disk.c > >> > ============================================================================== > >> --- head/sys/geom/geom_disk.c Thu Apr 21 16:33:42 2016 > (r298419) > >> +++ head/sys/geom/geom_disk.c Thu Apr 21 16:43:15 2016 > (r298420) > >> @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > >> #include > >> #include > >> #include > >> +#include > >> #include > >> #include > >> #include > >> @@ -839,11 +840,14 @@ disk_attr_changed(struct disk *dp, const > >> { > >> struct g_geom *gp; > >> struct g_provider *pp; > >> + char devnamebuf[128]; > > > > Why 128? Also, why not sbuf? > > > >> gp = dp->d_geom; > >> if (gp != NULL) > >> LIST_FOREACH(pp, &gp->provider, provider) > >> (void)g_attr_changed(pp, attr, flag); > >> + snprintf(devnamebuf, 128, "devname=%s%d", dp->d_name, > dp->d_unit); > > > > Why not sizeof(devnamebuf) ? > > Also: this doesn't NUL terminate devnamebuf; it really should > (otherwise, boom... crash in geom)... > snprintf(3) says "The output is always null-terminated." and it looks like the kernel version does the same thing at subr_prf.c:560. Am I missing something? From owner-svn-src-all@freebsd.org Thu Apr 21 17:30:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9430B17B72; Thu, 21 Apr 2016 17:30:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A73851AA5; Thu, 21 Apr 2016 17:30:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2309F1FE024; Thu, 21 Apr 2016 19:30:40 +0200 (CEST) Subject: Re: svn commit: r298420 - head/sys/geom To: Alan Somers , Ngie Cooper References: <201604211643.u3LGhFpR057982@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <57190F03.2080703@selasky.org> Date: Thu, 21 Apr 2016 19:33:55 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 17:30:43 -0000 On 04/21/16 19:26, Alan Somers wrote: > On Thu, Apr 21, 2016 at 11:09 AM, Ngie Cooper wrote: > >> On Thu, Apr 21, 2016 at 10:08 AM, Ngie Cooper >> wrote: >>> On Thu, Apr 21, 2016 at 9:43 AM, Alan Somers >>>> { >>>> struct g_geom *gp; >>>> struct g_provider *pp; >>>> + char devnamebuf[128]; >>> >>> Why 128? Also, why not sbuf? >>> >>>> gp = dp->d_geom; >>>> if (gp != NULL) >>>> LIST_FOREACH(pp, &gp->provider, provider) >>>> (void)g_attr_changed(pp, attr, flag); >>>> + snprintf(devnamebuf, 128, "devname=%s%d", dp->d_name, >> dp->d_unit); >>> >>> Why not sizeof(devnamebuf) ? >> >> Also: this doesn't NUL terminate devnamebuf; it really should >> (otherwise, boom... crash in geom)... >> > > snprintf(3) says "The output is always null-terminated." and it looks like > the kernel version does the same thing at subr_prf.c:560. Am I missing > something? > Hi, The code is correct, though it is good practice to use sizeof() like Ngie suggests or define the size of the buffer like a macro. grep -rE "snprintf.*sizeof" /usr/src/sys/dev --HPS From owner-svn-src-all@freebsd.org Thu Apr 21 17:45:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AFAFB1636D; Thu, 21 Apr 2016 17:45:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59033169D; Thu, 21 Apr 2016 17:45:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LHjbqV077207; Thu, 21 Apr 2016 17:45:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LHjbAw077205; Thu, 21 Apr 2016 17:45:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604211745.u3LHjbAw077205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 21 Apr 2016 17:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298424 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 17:45:38 -0000 Author: hselasky Date: Thu Apr 21 17:45:37 2016 New Revision: 298424 URL: https://svnweb.freebsd.org/changeset/base/298424 Log: Add new USB quirk. Submitted by: Naram Qashat PR: 208642 MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Thu Apr 21 16:50:45 2016 (r298423) +++ head/sys/dev/usb/quirk/usb_quirk.c Thu Apr 21 17:45:37 2016 (r298424) @@ -136,6 +136,8 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair Vengeance K70 keyboard */ USB_QUIRK(CORSAIR, K70, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + /* Quirk for Corsair STRAFE Gaming keyboard */ + USB_QUIRK(CORSAIR, STRAFE, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(SANYO, SCP4900, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Apr 21 16:50:45 2016 (r298423) +++ head/sys/dev/usb/usbdevs Thu Apr 21 17:45:37 2016 (r298424) @@ -1510,6 +1510,7 @@ product COREGA FETHER_USB_TXC 0x9601 FEt /* Corsair products */ product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard +product CORSAIR STRAFE 0x1b15 Cossair STRAFE Gaming keyboard /* Creative products */ product CREATIVE NOMAD_II 0x1002 Nomad II MP3 player From owner-svn-src-all@freebsd.org Thu Apr 21 17:52:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F575B16A9B for ; Thu, 21 Apr 2016 17:52:57 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 510F511AA for ; Thu, 21 Apr 2016 17:52:57 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: by mail-ig0-x229.google.com with SMTP id f1so164045284igr.1 for ; Thu, 21 Apr 2016 10:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clockworksquid.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sZqqS6Trh5/l6f+WbJON4hsLewyEZtKhJwXAOTFHtlQ=; b=YBkGcW7qaMnP3N+DbUkgAvyqGjN988EWbDMUJJnOq9NUp7vDn3tc5+cdWbsbOa5BV8 gCAJxOH0YfIMerXcStpO0LzkbeKH3uYerVYRtys9LMlBvO5nGlD6hbp6Lawo2uhwwpow TVBGsQOAnI4WWlyilndqS+JVt/dLH2yc7AaME= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sZqqS6Trh5/l6f+WbJON4hsLewyEZtKhJwXAOTFHtlQ=; b=hLz5XNdKkmwWJUlgZFGJbLue73f5mjm7JFjoBpI002U7Iem7chB5iKGKjYcfj3ZZNs FtD8CLmANLwzxUj6xSE2RPD8T5mnPAv8lCUYHu25jNJTKlfe2MkkDTvw7R7D6Wt705tW LwLkX8mutfCPQkSHkFc9ZC2QAxT8CjfdogGbONIPig0bzGUJs0CKJtYK/Bzrt7qtsIN9 N0aO8dujqioqkw+IWQpOlho4bGv4kN9rjSpDEyX7fW7N8DetijPniXBq3JGVgOej2f3P iSL5Z5rWuiJ9kSBZ5s8Hn/ux7q+9K5k/CP6q1gnskFmWehHxiPHAVk1Kd6b1j9Gg8EOd 2Opw== X-Gm-Message-State: AOPr4FWyxZ6CL3ssmzypkCXy9zLuR2E8U3BwGGrX75Dis3X4iCTe+s4dAEIrHIhN9vWkf16Gm3m7lhuIAJLjRg== X-Received: by 10.50.6.110 with SMTP id z14mr5261931igz.33.1461261176750; Thu, 21 Apr 2016 10:52:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.15.66 with HTTP; Thu, 21 Apr 2016 10:52:37 -0700 (PDT) In-Reply-To: <57190C47.8070106@selasky.org> References: <201604211604.u3LG4wmT035874@repo.freebsd.org> <57190C47.8070106@selasky.org> From: Juli Mallett Date: Thu, 21 Apr 2016 10:52:37 -0700 Message-ID: Subject: Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core To: Hans Petter Selasky Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 17:52:57 -0000 On Thu, Apr 21, 2016 at 10:22 AM, Hans Petter Selasky wrote: > On 04/21/16 19:12, Ngie Cooper wrote: >> >> Please put the "deadcode" back. It will crash now if it's given an >> invalid address family (or none are configured in the kernel) when it >> tries to do the memcpy below. > > > If you look a few lines up in the file, not the patch, you'll see that there > already is a switch case which catches this. > > OK? Then there should be an assertion or something else of that sort (I forget if we have a __builtin_unreachable()-alike macro in the kernel; the lint(1)y NOTREACHED isn't as nice as actual code) so that it is apparent to a human that this case cannot be reached. The presence of a do-nothing default case is not typically indicative of unreachable code. From owner-svn-src-all@freebsd.org Thu Apr 21 18:09:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 841B5B17323; Thu, 21 Apr 2016 18:09:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 499F31CEC; Thu, 21 Apr 2016 18:09:17 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id AADD61FE024; Thu, 21 Apr 2016 20:09:15 +0200 (CEST) Subject: Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core To: Pedro Giffuni , Juli Mallett References: <201604211604.u3LG4wmT035874@repo.freebsd.org> <57190C47.8070106@selasky.org> <5719150F.7030200@FreeBSD.org> Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <5719180F.90509@selasky.org> Date: Thu, 21 Apr 2016 20:12:31 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <5719150F.7030200@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:09:18 -0000 On 04/21/16 19:59, Pedro Giffuni wrote: > > > On 21/04/2016 12:52, Juli Mallett wrote: >> On Thu, Apr 21, 2016 at 10:22 AM, Hans Petter Selasky >> wrote: >>> On 04/21/16 19:12, Ngie Cooper wrote: Hi, >> Then there should be an assertion or something else of that sort (I >> forget if we have a __builtin_unreachable()-alike macro in the kernel; >> the lint(1)y NOTREACHED isn't as nice as actual code) so that it is >> apparent to a human that this case cannot be reached. The presence of >> a do-nothing default case is not typically indicative of unreachable >> code. > > We do have __unreachable() in cdefs.h > > It should work with both GCC and clang. > > Pedro. > I don't see anyone using __unreachable() yet in the kernel. Do you recommend it over a KASSERT() ? --HPS From owner-svn-src-all@freebsd.org Thu Apr 21 18:13:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E25B17822 for ; Thu, 21 Apr 2016 18:13:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm47-vm1.bullet.mail.bf1.yahoo.com (nm47-vm1.bullet.mail.bf1.yahoo.com [216.109.115.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A9BE1271 for ; Thu, 21 Apr 2016 18:13:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461261605; bh=hHSbGOs9yEOQULPsGft246RKEW6hFAo6rDdu5IlgjXQ=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=inScR5j8Wklrt3GOadcrYTJjdLf783fvpZQizKAQmlxZUxYUwar6+t5SMV3WVTvFPkTD4aXo/Rdcuo6NQQmpbSjtXOz7WNKzYf0GloChJWd/+lfoX92LhBlhWUgpNxgCMjlzrjwmauzJk3Op7wJM9/t7sCyN/2eFi8LpWWbu/lObU7vydIPmjs2kaYFyCLhM/DxpQf5g13zwxL2NAqYcmM5uT54t1guysroGF+3MdHIYhrRF7x5MbgNssFjY0YQazqQO73ZGAE+WIHLJ8UEDcnPrmdFk+JMElOLJ+GkRexydnG+GsWDCqhCToXNL9MWvYrtKTTgpPgWw1kDtt5G6Zw== Received: from [98.139.170.182] by nm47.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:00:05 -0000 Received: from [98.139.213.13] by tm25.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:00:05 -0000 Received: from [127.0.0.1] by smtp113.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:00:05 -0000 X-Yahoo-Newman-Id: 424123.97673.bm@smtp113.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 5m9yDlgVM1mEQR.clensywQ1OoIAsaOj4STvQm.FH5IAeUS jpQezZDFBRXrRvJq4cZdOOh7Fb5ZRZi.elNh4NnML2w4JvFCkLVUq99RNIde 0MPj6YCJrKWVR.yvxPK8xuPhQgvcWobUKIrexS2fb9h_GUERfnlC8x0NtVAu i1nAD7jdwIBds9eRtBxtWkRYjlbmGuya0PnW4wS8EgbHCu_au32YFw7o.egJ M9isV56k88vRrsAqorEPerUeqUFTLcba7KmyFIRj1j9gogTnU2AHqCdFxmwY hT9TI5zrICLqsGpkMtV_zlsc9nL34H82GTjw4mwGGCLosndyoPMJBzTz1rYs Di0lML9TbN.YXnsDsJhz2d7IUDABMDA6T.yxMlHasG_9dTidf8iXTGD2qnmR P5KWOfiD9OCC0CS15ahgY2.MFIDyihUKguzofQ4f6YDRhJQdwP_xX9MHq6xs ASFpawCYHKRpB2o5sC.9K9_W06idC4GwDLWEuiymlIwdoqPGpX7wyvPA7WNe 5HWy3hHmPaNGUgk46DKxmnug_2RXICyCi X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core To: Juli Mallett , Hans Petter Selasky References: <201604211604.u3LG4wmT035874@repo.freebsd.org> <57190C47.8070106@selasky.org> Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <5719150F.7030200@FreeBSD.org> Date: Thu, 21 Apr 2016 12:59:43 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:13:02 -0000 On 21/04/2016 12:52, Juli Mallett wrote: > On Thu, Apr 21, 2016 at 10:22 AM, Hans Petter Selasky wrote: >> On 04/21/16 19:12, Ngie Cooper wrote: >>> Please put the "deadcode" back. It will crash now if it's given an >>> invalid address family (or none are configured in the kernel) when it >>> tries to do the memcpy below. >> >> If you look a few lines up in the file, not the patch, you'll see that there >> already is a switch case which catches this. >> >> OK? > Then there should be an assertion or something else of that sort (I > forget if we have a __builtin_unreachable()-alike macro in the kernel; > the lint(1)y NOTREACHED isn't as nice as actual code) so that it is > apparent to a human that this case cannot be reached. The presence of > a do-nothing default case is not typically indicative of unreachable > code. We do have __unreachable() in cdefs.h It should work with both GCC and clang. Pedro. From owner-svn-src-all@freebsd.org Thu Apr 21 18:19:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCA91B17BA6; Thu, 21 Apr 2016 18:19:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75FA91893; Thu, 21 Apr 2016 18:19:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u3LIJbGG070163 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 21 Apr 2016 21:19:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u3LIJbGG070163 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u3LIJbn9070162; Thu, 21 Apr 2016 21:19:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 Apr 2016 21:19:37 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298219 - head/share/mk Message-ID: <20160421181937.GO2422@kib.kiev.ua> References: <201604181814.u3IIE22P059301@repo.freebsd.org> <20160419121551.GX2422@kib.kiev.ua> <5718FC0C.7040604@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <5718FC0C.7040604@FreeBSD.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:19:43 -0000 On Thu, Apr 21, 2016 at 09:13:00AM -0700, Bryan Drewery wrote: > On 4/19/16 5:15 AM, Konstantin Belousov wrote: > > On Mon, Apr 18, 2016 at 06:14:02PM +0000, Bryan Drewery wrote: > >> Author: bdrewery > >> Date: Mon Apr 18 18:14:02 2016 > >> New Revision: 298219 > >> URL: https://svnweb.freebsd.org/changeset/base/298219 > >> > >> Log: > >> Cause an error during 'make install' if trying to compile with CC. > >> =20 > >> This is limited to src-tree builds, meaning not extended to ports or= other > >> out-of-tree builds. > >> =20 > >> This will help ensure that read-only OBJDIRS will be respected at in= stall-time > >> by causing a more consistent failure for those who don't use a read-= only > >> OBJDIR. It also will cause Jenkins to yell. This is a better solut= ion than > >> trying to see CC=3Dfalse as has been attempted and discussed before. > >> =20 > >> Of course this is only relevant for files generated by CC. > >> =20 > >> Disable this for META_MODE since it will detect the CFLAGS/command > >> change and force a rebuild. > >> =20 > >> Sponsored by: EMC / Isilon Storage Division > >> > >> Modified: > >> head/share/mk/bsd.sys.mk > >> > >> Modified: head/share/mk/bsd.sys.mk > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/share/mk/bsd.sys.mk Mon Apr 18 18:13:58 2016 (r298218) > >> +++ head/share/mk/bsd.sys.mk Mon Apr 18 18:14:02 2016 (r298219) > >> @@ -178,6 +178,13 @@ ACFLAGS+=3D ${ACFLAGS.${.IMPSRC:T}} > >> CFLAGS+=3D ${CFLAGS.${.IMPSRC:T}} > >> CXXFLAGS+=3D ${CXXFLAGS.${.IMPSRC:T}} > >> =20 > >> +.if defined(SRCTOP) > >> +# Prevent rebuilding during install to support read-only objdirs. > >> +.if make(install) && empty(.MAKE.MODE:Mmeta) > >> +CFLAGS+=3D ERROR-tried-to-rebuild-during-make-install > >> +.endif > >> +.endif > >> + > >> # Tell bmake not to mistake standard targets for things to be searche= d for > >> # or expect to ever be up-to-date. > >> PHONY_NOTMAIN =3D analyze afterdepend afterinstall all beforedepend b= eforeinstall \ > >=20 > > It seems to cause the following behaviour: > > make buildenv > > cd lib/libthr > > # make DEBUG_FLAGS=3D-g WITHOUT_TESTS=3Dyes all install >=20 > By the way, since r295646 it should be safe to use -j here. Let me know > if you run into trouble with it. You mean, that install -j does the right thing now ? Thanks. >=20 > > cc -O2 -pipe -DPTHREAD_KERNEL -I/usr/home/kostik/work/build/bsd/DEV= /src/lib/libthr/../libc/include -I/usr/home/kostik/work/build/bsd/DEV/src/l= ib/libthr/thread -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../.= =2E/include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/arch/amd64= /include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/sys -I/usr/ho= me/kostik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld-elf -I/usr/h= ome/kostik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld-elf/amd64 -= I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../libthread_db -Winlin= e -fexceptions -D_PTHREAD_FORCED_UNWIND -D_PTHREADS_INVARIANTS -mno-mmx -mn= o-sse -mno-avx -g -MD -MP -MF.depend.thr_init.o -MTthr_init.o -std=3Dgnu99 = -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Ws= trict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -W= no-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-vari= able -Wno-tautological-compar > e > -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-en= um-conversion -Wno-unused-local-typedef -Qunused-arguments ERROR-tried-to= -rebuild-during-make-install -c /usr/home/kostik/work/build/bsd/DEV/src/lib= /libthr/thread/thr_init.c -o thr_init.o > > cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-ma= ke-install' > > *** Error code 1 > >=20 > > Stop. > > make[3]: stopped in /usr/home/kostik/work/build/bsd/DEV/src/lib/libthr > >=20 > > Doing separate steps for all and install targets work, but before, it a= lso > > worked and was convenient to list sequential targets on the make command > > line. > >=20 >=20 > Fixed in r298413. Yes, make all install worked. Still, I do not think that the revision would help for any other target used in-line with install. I believe it is sometimes useful, but more rare than all install idiom. From owner-svn-src-all@freebsd.org Thu Apr 21 18:22:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEFE7B17DF6; Thu, 21 Apr 2016 18:22:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id CBE7C1DCB; Thu, 21 Apr 2016 18:22:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id C005D11BA; Thu, 21 Apr 2016 18:22:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 75587217E5; Thu, 21 Apr 2016 18:22:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 3c_uN-r-MwZ5; Thu, 21 Apr 2016 18:22:33 +0000 (UTC) Subject: Re: svn commit: r298219 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 167B3217D8 To: Konstantin Belousov References: <201604181814.u3IIE22P059301@repo.freebsd.org> <20160419121551.GX2422@kib.kiev.ua> <5718FC0C.7040604@FreeBSD.org> <20160421181937.GO2422@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <57191A66.2050602@FreeBSD.org> Date: Thu, 21 Apr 2016 11:22:30 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160421181937.GO2422@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:22:38 -0000 On 4/21/16 11:19 AM, Konstantin Belousov wrote: > On Thu, Apr 21, 2016 at 09:13:00AM -0700, Bryan Drewery wrote: >> On 4/19/16 5:15 AM, Konstantin Belousov wrote: >>> On Mon, Apr 18, 2016 at 06:14:02PM +0000, Bryan Drewery wrote: >>>> Author: bdrewery >>>> Date: Mon Apr 18 18:14:02 2016 >>>> New Revision: 298219 >>>> URL: https://svnweb.freebsd.org/changeset/base/298219 >>>> >>>> Log: >>>> Cause an error during 'make install' if trying to compile with CC. >>>> >>>> This is limited to src-tree builds, meaning not extended to ports or other >>>> out-of-tree builds. >>>> >>>> This will help ensure that read-only OBJDIRS will be respected at install-time >>>> by causing a more consistent failure for those who don't use a read-only >>>> OBJDIR. It also will cause Jenkins to yell. This is a better solution than >>>> trying to see CC=false as has been attempted and discussed before. >>>> >>>> Of course this is only relevant for files generated by CC. >>>> >>>> Disable this for META_MODE since it will detect the CFLAGS/command >>>> change and force a rebuild. >>>> >>>> Sponsored by: EMC / Isilon Storage Division >>>> >>>> Modified: >>>> head/share/mk/bsd.sys.mk >>>> >>>> Modified: head/share/mk/bsd.sys.mk >>>> ============================================================================== >>>> --- head/share/mk/bsd.sys.mk Mon Apr 18 18:13:58 2016 (r298218) >>>> +++ head/share/mk/bsd.sys.mk Mon Apr 18 18:14:02 2016 (r298219) >>>> @@ -178,6 +178,13 @@ ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} >>>> CFLAGS+= ${CFLAGS.${.IMPSRC:T}} >>>> CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} >>>> >>>> +.if defined(SRCTOP) >>>> +# Prevent rebuilding during install to support read-only objdirs. >>>> +.if make(install) && empty(.MAKE.MODE:Mmeta) >>>> +CFLAGS+= ERROR-tried-to-rebuild-during-make-install >>>> +.endif >>>> +.endif >>>> + >>>> # Tell bmake not to mistake standard targets for things to be searched for >>>> # or expect to ever be up-to-date. >>>> PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend beforeinstall \ >>> >>> It seems to cause the following behaviour: >>> make buildenv >>> cd lib/libthr >>> # make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all install >> >> By the way, since r295646 it should be safe to use -j here. Let me know >> if you run into trouble with it. > You mean, that install -j does the right thing now ? Thanks. I mean 'make -j all install' should build in parallel before installing. > >> >>> cc -O2 -pipe -DPTHREAD_KERNEL -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../libc/include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/thread -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../../include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/arch/amd64/include -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/sys -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld-elf -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../../libexec/rtld-elf/amd64 -I/usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/../libthread_db -Winline -fexceptions -D_PTHREAD_FORCED_UNWIND -D_PTHREADS_INVARIANTS -mno-mmx -mno-sse -mno-avx -g -MD -MP -MF.depend.thr_init.o -MTthr_init.o -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-comp a r >> e >> -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Qunused-arguments ERROR-tried-to-rebuild-during-make-install -c /usr/home/kostik/work/build/bsd/DEV/src/lib/libthr/thread/thr_init.c -o thr_init.o >>> cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-make-install' >>> *** Error code 1 >>> >>> Stop. >>> make[3]: stopped in /usr/home/kostik/work/build/bsd/DEV/src/lib/libthr >>> >>> Doing separate steps for all and install targets work, but before, it also >>> worked and was convenient to list sequential targets on the make command >>> line. >>> >> >> Fixed in r298413. > > Yes, make all install worked. > > Still, I do not think that the revision would help for any other target > used in-line with install. I believe it is sometimes useful, but more > rare than all install idiom. > Yes it won't work if you do something like 'make foo.o install' or 'make progname install' etc. I am likely going to rework this to be a flag passed in installworld to activate it rather than checking for make(install). -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Thu Apr 21 18:25:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F38CB17FF4 for ; Thu, 21 Apr 2016 18:25:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm30-vm0.bullet.mail.bf1.yahoo.com (nm30-vm0.bullet.mail.bf1.yahoo.com [98.139.213.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8F901089 for ; Thu, 21 Apr 2016 18:25:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461263148; bh=nUm43aE+cy+5ayDdSnkBw56Ch+Ca42lxLti62OnPReY=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=GALWl+MlWuxxVx/rbwlzTrtCjUN82gttot8yR81gtlPdTOdAsiolSce23AZUdRZ3FCK4wM0xSSE+BMRlqs9SW1TJ33LBU0tLN1dMnfIRImpEeAbyoyi3KQaxjc9TtHKAugMgr8jVf9+vuyhkrsbZLDLa1Pa0BXGhSCZnfeyQDNZiOK+5dKSJvu+dtGk38oCTwRliHU2NZXLvwuez0CZucrTTVnSB1hMr4aXNb+vC12VQeElG6swhvE2vD64L6e42WpyXd05e5Ct3kdvIS1vF4I6+g9qzDkar7WBOtS0eW5NqIx68HeWNbJ/JonQZH87dv3cJ7tfjhQiY2wrd0NqBCQ== Received: from [66.196.81.171] by nm30.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:25:48 -0000 Received: from [68.142.230.70] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:25:48 -0000 Received: from [127.0.0.1] by smtp227.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:25:48 -0000 X-Yahoo-Newman-Id: 293055.53103.bm@smtp227.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: neVIQUkVM1nH53.m5ZfhXkrYh_QDd9I4uwv6bpD9o9ipdOX vcc44_YNFgjGmdD8u1gnCUnofaGISMjmP5IkQI8nUgj6zX8NzYW5.ALy7TwM IiXmYuEh.XmnmdEmSvyZ3dB7fdoZuEVkvICFimvGk_x82FUA9vOq1GtIf1Uz sYHxw5lJbiKLI3EsS0TkaIxEywXbnxEV4i_CYRvKSelUgsCCYRi3JLdsmqSy 1._kZn3vkgkNl.G_cOhfy9ubgmE9hClYoSibfn8TaIDHZFDadVwvddBv2LVH xXcJIMzIvWkI6WDg5ZqT9ob.m03utBJMKhQr9oMBmDan3.MssVpboi5SLO8Q Ez_YFQok2SpUh_AXjCmGgdtL7aF5kCK2OwYY50WMpcwjfd4nJTlw211Yp5Ci 7UIwDNPCUxKnnpP7RJgPR_48zYaMTveDQdc4WoyO248r5_5RI79We_kjx8q7 98lN9XHCtsjx1.Mp511eg4B8IIE6.yt1vfkuqQmc.C5fHdnV61hoKzRDQGnx J0yoQklKY3gNrtdbCSfRNLIon0db3Fk2F X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core To: Hans Petter Selasky , Juli Mallett References: <201604211604.u3LG4wmT035874@repo.freebsd.org> <57190C47.8070106@selasky.org> <5719150F.7030200@FreeBSD.org> <5719180F.90509@selasky.org> Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <57191B33.7070406@FreeBSD.org> Date: Thu, 21 Apr 2016 13:25:55 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <5719180F.90509@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:25:56 -0000 On 21/04/2016 13:12, Hans Petter Selasky wrote: > On 04/21/16 19:59, Pedro Giffuni wrote: >> >> >> On 21/04/2016 12:52, Juli Mallett wrote: >>> On Thu, Apr 21, 2016 at 10:22 AM, Hans Petter Selasky >>> wrote: >>>> On 04/21/16 19:12, Ngie Cooper wrote: > > Hi, > >>> Then there should be an assertion or something else of that sort (I >>> forget if we have a __builtin_unreachable()-alike macro in the kernel; >>> the lint(1)y NOTREACHED isn't as nice as actual code) so that it is >>> apparent to a human that this case cannot be reached. The presence of >>> a do-nothing default case is not typically indicative of unreachable >>> code. >> >> We do have __unreachable() in cdefs.h >> >> It should work with both GCC and clang. >> >> Pedro. >> > > I don't see anyone using __unreachable() yet in the kernel. Do you > recommend it over a KASSERT() ? > It's a rather recent addition (I added it after checking NetBSD's cdefs). It is meant mostly for the compiler/static analyzers. From the clang documentation: "The __builtin_unreachable() builtin has completely undefined behavior. Since it has undefined behavior, it is a statement that it is never reached and the optimizer can take advantage of this to produce better code. This builtin takes no arguments and produces a void result." There was some discussion before it was introduced about turning it into an assertion, but I recall it was not possible. hth, Pedro. From owner-svn-src-all@freebsd.org Thu Apr 21 18:27:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 701AEB18070; Thu, 21 Apr 2016 18:27:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20F3611F7; Thu, 21 Apr 2016 18:27:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LIR55W089178; Thu, 21 Apr 2016 18:27:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LIR5ML089177; Thu, 21 Apr 2016 18:27:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604211827.u3LIR5ML089177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 21 Apr 2016 18:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298425 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:27:06 -0000 Author: jhb Date: Thu Apr 21 18:27:05 2016 New Revision: 298425 URL: https://svnweb.freebsd.org/changeset/base/298425 Log: Queue the CPU-probing task after all acpi_cpu devices are attached. Eventually with earlier AP startup this code will change to call the startup function synchronously instead of queueing the task. Moving the time we queue the task should be a no-op since taskqueue threads don't start executing tasks until much later, but this reduces the diff with the earlier AP startup patches. Sponsored by: Netflix Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Thu Apr 21 17:45:37 2016 (r298424) +++ head/sys/dev/acpica/acpi_cpu.c Thu Apr 21 18:27:05 2016 (r298425) @@ -355,9 +355,6 @@ acpi_cpu_attach(device_t dev) cpu_sysctl_tree = SYSCTL_ADD_NODE(&cpu_sysctl_ctx, SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "cpu", CTLFLAG_RD, 0, "node for CPU children"); - - /* Queue post cpu-probing task handler */ - AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL); } /* @@ -423,17 +420,27 @@ acpi_cpu_postattach(void *unused __unuse device_t *devices; int err; int i, n; + int attached; err = devclass_get_devices(acpi_cpu_devclass, &devices, &n); if (err != 0) { printf("devclass_get_devices(acpi_cpu_devclass) failed\n"); return; } + attached = 0; + for (i = 0; i < n; i++) + if (device_is_attached(devices[i])) + attached = 1; for (i = 0; i < n; i++) bus_generic_probe(devices[i]); for (i = 0; i < n; i++) bus_generic_attach(devices[i]); free(devices, M_TEMP); + + if (attached) { + /* Queue post cpu-probing task handler */ + AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL); + } } SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, From owner-svn-src-all@freebsd.org Thu Apr 21 18:30:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47CBAB1817E for ; Thu, 21 Apr 2016 18:30:52 +0000 (UTC) (envelope-from giffunip@yahoo.com) Received: from nm44-vm10.bullet.mail.bf1.yahoo.com (nm44-vm10.bullet.mail.bf1.yahoo.com [216.109.115.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F122714A1 for ; Thu, 21 Apr 2016 18:30:51 +0000 (UTC) (envelope-from giffunip@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461263444; bh=fosNDXIpWkZRzFa/wTY11HUc42CSqySQUyotZG5yGdk=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=O54clxe7kWUrlBsYPUKdenXbNCKNz6QH/SK7r21E6WEI1eg3uibH8JWomQlMkKfGmYH+XIMkFhsZBZKaOu4QYOBWfYSPqxlBZzlTrf1HL5C3T7jCXUSsy1Wlu/1ScFpH2oP4vCkzQlE50+jsP5BHKzbrrVm4/6wz+EnEpaslAYCALqUexIKz2HVkzajxcSyO8nmCbbNAvzl5r4MlNZSeJhuILo2YMAjuj+Eb6Ylj196DqtgzWr6wWeK9XXvXbCYz9dDn+kQI8eezGTcxqfqI/IX2agV2iuWqgOjgugql8U0vMFH0CrszhH9bdLO9D8JoLycl3iQ36TDwCbyE4WHfpw== Received: from [98.139.215.140] by nm44.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:30:44 -0000 Received: from [98.139.211.195] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:30:44 -0000 Received: from [127.0.0.1] by smtp204.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:30:44 -0000 X-Yahoo-Newman-Id: 237445.40789.bm@smtp204.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: _v8.rXAVM1kmluxo_3jlKYIibJV.m5INUrgz35fzJHyuaak asbGFNkSLHUwoLGatuLYgox71zoPTwRGc01lDtJBvajXod9RisSQcldzNDe1 8Hr7Cl4wDwkjxooHAeOd.pMGT9YK0uW5v2fay4r6vJQUPAx_.XCHc1IxEPDS RVJhoB_n1woeZgyZwbucSQQswUTb__QhjQkH1VBag5vzW5nk2mus31nyeYYn ODvJp9F9zVTU5yvpbweEGbz.7UMKSVry5qbZjD0zcnfrXIBW_Yy_SxKhU_0M 7bmRcHfU.pOEwvFCEexEvajuKuSlXbYMd1WfVEPRFNFPpPpjO.Gjyg84Bum9 R7eHjZECqAMWEdXA9cPy0L18z836a3bzjFQGnuh.K5HS5tNgXWpqyZApv17D qSWj4Ws_NY2aiLJxAbbRgw.Ji3cNF.9V43ldS.rjIVnttZYrGB5Jn4i0fO.b tQY2tVa1I_526XFjdzm9hH0iX9QuRSSiiRss0r4BEjDV1PdO3z2b.caihGNx fBfWq3ITPqk9PY8VwMgwG6crRih.dzpv6lcc- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core To: Hans Petter Selasky , Juli Mallett References: <201604211604.u3LG4wmT035874@repo.freebsd.org> <57190C47.8070106@selasky.org> <5719150F.7030200@FreeBSD.org> <5719180F.90509@selasky.org> <57191B33.7070406@FreeBSD.org> Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <57191C5C.8020106@yahoo.com> Date: Thu, 21 Apr 2016 13:30:52 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <57191B33.7070406@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:30:52 -0000 On 21/04/2016 13:25, Pedro Giffuni wrote: > > > On 21/04/2016 13:12, Hans Petter Selasky wrote: >> On 04/21/16 19:59, Pedro Giffuni wrote: >>> >>> >>> On 21/04/2016 12:52, Juli Mallett wrote: >>>> On Thu, Apr 21, 2016 at 10:22 AM, Hans Petter Selasky >>>> wrote: >>>>> On 04/21/16 19:12, Ngie Cooper wrote: >> >> Hi, >> >>>> Then there should be an assertion or something else of that sort (I >>>> forget if we have a __builtin_unreachable()-alike macro in the kernel; >>>> the lint(1)y NOTREACHED isn't as nice as actual code) so that it is >>>> apparent to a human that this case cannot be reached. The presence of >>>> a do-nothing default case is not typically indicative of unreachable >>>> code. >>> >>> We do have __unreachable() in cdefs.h >>> >>> It should work with both GCC and clang. >>> >>> Pedro. >>> >> >> I don't see anyone using __unreachable() yet in the kernel. Do you >> recommend it over a KASSERT() ? >> > > It's a rather recent addition (I added it after checking NetBSD's cdefs). > > It is meant mostly for the compiler/static analyzers. > > From the clang documentation: > "The __builtin_unreachable() builtin has completely undefined > behavior. Since it has undefined behavior, it is a statement that it > is never reached and the optimizer can take advantage of this to > produce better code. This builtin takes no arguments and produces a > void result." > Replying to myself with the better description[1]: "__builtin_unreachable is used to indicate that a specific point in the program cannot be reached, even if the compiler might otherwise think it can. This is useful to improve optimization and eliminates certain warnings. " Pedro. [1] http://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions From owner-svn-src-all@freebsd.org Thu Apr 21 18:30:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D1B7B181A3 for ; Thu, 21 Apr 2016 18:30:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm3-vm0.bullet.mail.bf1.yahoo.com (nm3-vm0.bullet.mail.bf1.yahoo.com [98.139.212.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D38F214BD for ; Thu, 21 Apr 2016 18:30:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461263453; bh=fosNDXIpWkZRzFa/wTY11HUc42CSqySQUyotZG5yGdk=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=K6pN6QmGdv12+1dO751dLStz114zWOFtVn5WrejJKWruimgV3hgQYmmUR3mjn78bo8H9132cKA4BbyBxleHCr1d09NzwsIflydeimWrdcQvN3/krqQENDIf7GYryYkfTWPwx6ep/ukdWizBU33W4gAXzaQ/5rxxAWnveH3ICGPhJl27+CcvIyRv6AsRpYjnIKWa9AkGBUDA4KzA5lsdOp2B8/uO/vUdMx8IiNMks/oarfmoTEDtEGKseB0IsrU55ykJ/9cQbxHVrNqadkDZEjA44dyy4bCckgHx6fCPNC45QfqXNpi7JOQLKXidgFNSmrJwjiDbTDJdxIRB7CHWnSg== Received: from [66.196.81.170] by nm3.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:30:53 -0000 Received: from [98.139.211.198] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:30:53 -0000 Received: from [127.0.0.1] by smtp207.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:30:53 -0000 X-Yahoo-Newman-Id: 887409.11621.bm@smtp207.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Z041PowVM1kc5NyWT4opCOkLysyGi.yxvhPxngG4JEzRKnh _bXDgugJdCrWSAe77qnA7B0LN9BgNpPSkCwyiMcBPfKbkGUfqBBzsNHdwYqE daNPGvyOq7wONNJifum4SD45FCeM5NMNnuIH6UyltWWVOatPohuJAt00Ilhq hFNAwfcMBTV2eeVtsaPysxOtEw_jhimoMYAwkcqBMeKoUbFcQQN987cwrqzs vcMXBqlqaaYiMVQppZN6_yVjBnt99nOhrXgc7mxjbsPpJF5bLurHsILuinlL HsX50wO3MIzK5Op24bPjs3to0LCj5onCdN5SccNwot_6Z4ZAPF1pO8r.rQE8 O.nTtePBZ07J3sWD0_xyX_1mYGoLzQC4ndKXbfIVlBwCfjWYLFPWSLRZEaro uFL6Y5o0Zk.PSnVe7U0rZKqnpzTfMqRQhYX2tkFYs1Clddz2r0kZgur8kuhH 6hFxWOQ5bzjvUTnp1B9gscN0VeaZbt0KFxJSElg5jlERM6mEf_IjiLdXxEFA j7ADYKGFRCwsGQHJKbmQXRVn6azLVOdd3 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core To: Hans Petter Selasky , Juli Mallett References: <201604211604.u3LG4wmT035874@repo.freebsd.org> <57190C47.8070106@selasky.org> <5719150F.7030200@FreeBSD.org> <5719180F.90509@selasky.org> <57191B33.7070406@FreeBSD.org> Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <57191C65.2050209@FreeBSD.org> Date: Thu, 21 Apr 2016 13:31:01 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <57191B33.7070406@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:30:56 -0000 On 21/04/2016 13:25, Pedro Giffuni wrote: > > > On 21/04/2016 13:12, Hans Petter Selasky wrote: >> On 04/21/16 19:59, Pedro Giffuni wrote: >>> >>> >>> On 21/04/2016 12:52, Juli Mallett wrote: >>>> On Thu, Apr 21, 2016 at 10:22 AM, Hans Petter Selasky >>>> wrote: >>>>> On 04/21/16 19:12, Ngie Cooper wrote: >> >> Hi, >> >>>> Then there should be an assertion or something else of that sort (I >>>> forget if we have a __builtin_unreachable()-alike macro in the kernel; >>>> the lint(1)y NOTREACHED isn't as nice as actual code) so that it is >>>> apparent to a human that this case cannot be reached. The presence of >>>> a do-nothing default case is not typically indicative of unreachable >>>> code. >>> >>> We do have __unreachable() in cdefs.h >>> >>> It should work with both GCC and clang. >>> >>> Pedro. >>> >> >> I don't see anyone using __unreachable() yet in the kernel. Do you >> recommend it over a KASSERT() ? >> > > It's a rather recent addition (I added it after checking NetBSD's cdefs). > > It is meant mostly for the compiler/static analyzers. > > From the clang documentation: > "The __builtin_unreachable() builtin has completely undefined > behavior. Since it has undefined behavior, it is a statement that it > is never reached and the optimizer can take advantage of this to > produce better code. This builtin takes no arguments and produces a > void result." > Replying to myself with the better description[1]: "__builtin_unreachable is used to indicate that a specific point in the program cannot be reached, even if the compiler might otherwise think it can. This is useful to improve optimization and eliminates certain warnings. " Pedro. [1] http://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions From owner-svn-src-all@freebsd.org Thu Apr 21 18:37:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FD9EB184AD; Thu, 21 Apr 2016 18:37:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D8F41D97; Thu, 21 Apr 2016 18:37:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LIbbi1092258; Thu, 21 Apr 2016 18:37:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LIbalm092252; Thu, 21 Apr 2016 18:37:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604211837.u3LIbalm092252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 21 Apr 2016 18:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298426 - head/sys/dev/fdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:37:38 -0000 Author: jhb Date: Thu Apr 21 18:37:36 2016 New Revision: 298426 URL: https://svnweb.freebsd.org/changeset/base/298426 Log: Adjust the fdc worker thread startup to work when APs are started earlier. - Enable the commented out locking in fd_probe(). The worker thread should not be running yet (even after these changes), but better to be safe than sorry. - Defer starting the worker thread until after the child drives have been probed. The worker thread startup is moved into a fdc_start_worker() thread that the various front ends call at the end of attach. As a side effect this fixes a few edge cases that weren't shutting down the worker thread if attach encountered a late failure. - When executing the initial reset requested by attach in the worker thread, use DELAY() instead of a tsleep() if cold is set. Tested by: Howard Su Sponsored by: Netflix Modified: head/sys/dev/fdc/fdc.c head/sys/dev/fdc/fdc_acpi.c head/sys/dev/fdc/fdc_cbus.c head/sys/dev/fdc/fdc_isa.c head/sys/dev/fdc/fdc_pccard.c head/sys/dev/fdc/fdcvar.h Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Thu Apr 21 18:27:05 2016 (r298425) +++ head/sys/dev/fdc/fdc.c Thu Apr 21 18:37:36 2016 (r298426) @@ -953,7 +953,10 @@ fdc_worker(struct fdc_data *fdc) if (fdc->flags & FDC_NEEDS_RESET) { fdc->flags &= ~FDC_NEEDS_RESET; fdc_reset(fdc); - tsleep(fdc, PRIBIO, "fdcrst", hz); + if (cold) + DELAY(1000000); + else + tsleep(fdc, PRIBIO, "fdcrst", hz); /* Discard results */ for (i = 0; i < 4; i++) fdc_sense_int(fdc, &st0, &cyl); @@ -2055,14 +2058,21 @@ fdc_attach(device_t dev) #endif bioq_init(&fdc->head); - kproc_create(fdc_thread, fdc, &fdc->fdc_thread, 0, 0, - "fdc%d", device_get_unit(dev)); - settle = hz / 8; return (0); } +void +fdc_start_worker(device_t dev) +{ + struct fdc_data *fdc; + + fdc = device_get_softc(dev); + kproc_create(fdc_thread, fdc, &fdc->fdc_thread, 0, 0, + "fdc%d", device_get_unit(dev)); +} + int fdc_hints_probe(device_t dev) { @@ -2155,9 +2165,8 @@ fd_probe(device_t dev) return (ENXIO); #ifndef PC98 -/* mtx_lock(&fdc->fdc_mtx); -*/ + /* select it */ fd_select(fd); fd_motor(fd, 1); @@ -2200,9 +2209,7 @@ fd_probe(device_t dev) fd_motor(fd, 0); fdc->fd = NULL; -/* mtx_unlock(&fdc->fdc_mtx); -*/ if ((flags & FD_NO_PROBE) == 0 && (st0 & NE7_ST0_EC) != 0) /* no track 0 -> no drive present */ Modified: head/sys/dev/fdc/fdc_acpi.c ============================================================================== --- head/sys/dev/fdc/fdc_acpi.c Thu Apr 21 18:27:05 2016 (r298425) +++ head/sys/dev/fdc/fdc_acpi.c Thu Apr 21 18:37:36 2016 (r298426) @@ -135,6 +135,9 @@ fdc_acpi_attach(device_t dev) obj = buf.Pointer; error = fdc_acpi_probe_children(bus, dev, obj->Buffer.Pointer); + if (error == 0) + fdc_start_worker(dev); + out: if (buf.Pointer) free(buf.Pointer, M_TEMP); Modified: head/sys/dev/fdc/fdc_cbus.c ============================================================================== --- head/sys/dev/fdc/fdc_cbus.c Thu Apr 21 18:27:05 2016 (r298425) +++ head/sys/dev/fdc/fdc_cbus.c Thu Apr 21 18:37:36 2016 (r298426) @@ -150,7 +150,9 @@ fdc_cbus_attach(device_t dev) error = fdc_attach(dev); if (error == 0) error = fdc_hints_probe(dev); - if (error) + if (error == 0) + fdc_start_worker(dev); + else fdc_release_resources(fdc); return (error); } Modified: head/sys/dev/fdc/fdc_isa.c ============================================================================== --- head/sys/dev/fdc/fdc_isa.c Thu Apr 21 18:27:05 2016 (r298425) +++ head/sys/dev/fdc/fdc_isa.c Thu Apr 21 18:37:36 2016 (r298426) @@ -190,7 +190,9 @@ fdc_isa_attach(device_t dev) error = fdc_attach(dev); if (error == 0) error = fdc_hints_probe(dev); - if (error) + if (error == 0) + fdc_start_worker(dev); + else fdc_release_resources(fdc); return (error); } Modified: head/sys/dev/fdc/fdc_pccard.c ============================================================================== --- head/sys/dev/fdc/fdc_pccard.c Thu Apr 21 18:27:05 2016 (r298425) +++ head/sys/dev/fdc/fdc_pccard.c Thu Apr 21 18:37:36 2016 (r298426) @@ -108,7 +108,9 @@ fdc_pccard_attach(device_t dev) device_set_flags(child, 0x24); error = bus_generic_attach(dev); } - if (error) + if (error == 0) + fdc_start_worker(dev); + else fdc_release_resources(fdc); return (error); } Modified: head/sys/dev/fdc/fdcvar.h ============================================================================== --- head/sys/dev/fdc/fdcvar.h Thu Apr 21 18:27:05 2016 (r298425) +++ head/sys/dev/fdc/fdcvar.h Thu Apr 21 18:37:36 2016 (r298426) @@ -83,6 +83,7 @@ __BUS_ACCESSOR(fdc, fdtype, FDC, FDTYPE, void fdc_release_resources(struct fdc_data *); int fdc_attach(device_t); +void fdc_start_worker(device_t); int fdc_hints_probe(device_t); int fdc_detach(device_t dev); device_t fdc_add_child(device_t, const char *, int); From owner-svn-src-all@freebsd.org Thu Apr 21 18:41:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 805B6B1858B; Thu, 21 Apr 2016 18:41:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AE891FE3; Thu, 21 Apr 2016 18:41:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id CD6151FE024; Thu, 21 Apr 2016 20:40:59 +0200 (CEST) Subject: Re: svn commit: r298426 - head/sys/dev/fdc To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604211837.u3LIbalm092252@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <57191F7F.4010900@selasky.org> Date: Thu, 21 Apr 2016 20:44:15 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201604211837.u3LIbalm092252@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:41:02 -0000 On 04/21/16 20:37, John Baldwin wrote: > - tsleep(fdc, PRIBIO, "fdcrst", hz); > + if (cold) > + DELAY(1000000); > + else > + tsleep(fdc, PRIBIO, "fdcrst", hz); Hi, pause() and pause_sbt() does exactly this, checking for "cold" and using DELAY(). --HPS From owner-svn-src-all@freebsd.org Thu Apr 21 18:44:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF712B187B0; Thu, 21 Apr 2016 18:44:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA8DC1391; Thu, 21 Apr 2016 18:44:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LIism3095141; Thu, 21 Apr 2016 18:44:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LIirPi095135; Thu, 21 Apr 2016 18:44:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604211844.u3LIirPi095135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 21 Apr 2016 18:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298427 - stable/10/usr.bin/truss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:44:55 -0000 Author: jhb Date: Thu Apr 21 18:44:53 2016 New Revision: 298427 URL: https://svnweb.freebsd.org/changeset/base/298427 Log: MFC 295930: Add support for displaying thread IDs to truss(1). - Consolidate duplicate code for printing the metadata at the start of each line into a shared function. - Add an -H option which will log the thread ID of the relevant thread for each event. While here, remove some extraneous calls to clock_gettime() in print_syscall() and print_syscall_ret(). The caller of print_syscall_ret() always updates the current thread's "after" time before it is called. Modified: stable/10/usr.bin/truss/extern.h stable/10/usr.bin/truss/main.c stable/10/usr.bin/truss/setup.c stable/10/usr.bin/truss/syscalls.c stable/10/usr.bin/truss/truss.1 stable/10/usr.bin/truss/truss.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/truss/extern.h ============================================================================== --- stable/10/usr.bin/truss/extern.h Thu Apr 21 18:37:36 2016 (r298426) +++ stable/10/usr.bin/truss/extern.h Thu Apr 21 18:44:53 2016 (r298427) @@ -31,6 +31,7 @@ * $FreeBSD$ */ +extern int print_line_prefix(struct trussinfo *); extern void setup_and_wait(struct trussinfo *, char **); extern void start_tracing(struct trussinfo *, pid_t); extern void restore_proc(int); Modified: stable/10/usr.bin/truss/main.c ============================================================================== --- stable/10/usr.bin/truss/main.c Thu Apr 21 18:37:36 2016 (r298426) +++ stable/10/usr.bin/truss/main.c Thu Apr 21 18:44:53 2016 (r298427) @@ -95,7 +95,7 @@ main(int ac, char **av) trussinfo->curthread = NULL; LIST_INIT(&trussinfo->proclist); init_syscalls(); - while ((c = getopt(ac, av, "p:o:facedDs:S")) != -1) { + while ((c = getopt(ac, av, "p:o:facedDs:SH")) != -1) { switch (c) { case 'p': /* specified pid */ pid = atoi(optarg); @@ -131,6 +131,9 @@ main(int ac, char **av) case 'S': /* Don't trace signals */ trussinfo->flags |= NOSIGS; break; + case 'H': + trussinfo->flags |= DISPLAYTIDS; + break; default: usage(); } Modified: stable/10/usr.bin/truss/setup.c ============================================================================== --- stable/10/usr.bin/truss/setup.c Thu Apr 21 18:37:36 2016 (r298426) +++ stable/10/usr.bin/truss/setup.c Thu Apr 21 18:44:53 2016 (r298427) @@ -439,26 +439,46 @@ exit_syscall(struct trussinfo *info, str } } -static void -report_exit(struct trussinfo *info, siginfo_t *si) +int +print_line_prefix(struct trussinfo *info) { struct timespec timediff; + struct threadinfo *t; + int len; - if (info->flags & FOLLOWFORKS) - fprintf(info->outfile, "%5d: ", si->si_pid); - clock_gettime(CLOCK_REALTIME, &info->curthread->after); + len = 0; + t = info->curthread; + if (info->flags & (FOLLOWFORKS | DISPLAYTIDS)) { + if (info->flags & FOLLOWFORKS) + len += fprintf(info->outfile, "%5d", t->proc->pid); + if ((info->flags & (FOLLOWFORKS | DISPLAYTIDS)) == + (FOLLOWFORKS | DISPLAYTIDS)) + len += fprintf(info->outfile, " "); + if (info->flags & DISPLAYTIDS) + len += fprintf(info->outfile, "%6d", t->tid); + len += fprintf(info->outfile, ": "); + } if (info->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->start_time, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); + timespecsubt(&t->after, &info->start_time, &timediff); + len += fprintf(info->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, timediff.tv_nsec); } if (info->flags & RELATIVETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->curthread->before, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); + timespecsubt(&t->after, &t->before, &timediff); + len += fprintf(info->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, timediff.tv_nsec); } + return (len); +} + +static void +report_exit(struct trussinfo *info, siginfo_t *si) +{ + struct threadinfo *t; + + t = info->curthread; + clock_gettime(CLOCK_REALTIME, &t->after); + print_line_prefix(info); if (si->si_code == CLD_EXITED) fprintf(info->outfile, "process exit, rval = %u\n", si->si_status); @@ -469,48 +489,26 @@ report_exit(struct trussinfo *info, sigi } static void -report_new_child(struct trussinfo *info, pid_t pid) +report_new_child(struct trussinfo *info) { - struct timespec timediff; + struct threadinfo *t; - clock_gettime(CLOCK_REALTIME, &info->curthread->after); - assert(info->flags & FOLLOWFORKS); - fprintf(info->outfile, "%5d: ", pid); - if (info->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->start_time, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); - } - if (info->flags & RELATIVETIMESTAMPS) { - timediff.tv_sec = 0; - timediff.tv_nsec = 0; - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); - } + t = info->curthread; + clock_gettime(CLOCK_REALTIME, &t->after); + t->before = t->after; + print_line_prefix(info); fprintf(info->outfile, "\n"); } static void report_signal(struct trussinfo *info, siginfo_t *si) { - struct timespec timediff; + struct threadinfo *t; char *signame; - if (info->flags & FOLLOWFORKS) - fprintf(info->outfile, "%5d: ", si->si_pid); - if (info->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->start_time, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); - } - if (info->flags & RELATIVETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->curthread->before, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); - } + t = info->curthread; + clock_gettime(CLOCK_REALTIME, &t->after); + print_line_prefix(info); signame = strsig(si->si_status); fprintf(info->outfile, "SIGNAL %u (%s)\n", si->si_status, signame == NULL ? "?" : signame); @@ -572,7 +570,7 @@ eventloop(struct trussinfo *info) pending_signal = 0; } else if (pl.pl_flags & PL_FLAG_CHILD) { if ((info->flags & COUNTONLY) == 0) - report_new_child(info, si.si_pid); + report_new_child(info); pending_signal = 0; } else { if ((info->flags & NOSIGS) == 0) Modified: stable/10/usr.bin/truss/syscalls.c ============================================================================== --- stable/10/usr.bin/truss/syscalls.c Thu Apr 21 18:37:36 2016 (r298426) +++ stable/10/usr.bin/truss/syscalls.c Thu Apr 21 18:44:53 2016 (r298427) @@ -1625,38 +1625,18 @@ print_arg(struct syscall_args *sc, unsig void print_syscall(struct trussinfo *trussinfo) { - struct timespec timediff; struct threadinfo *t; const char *name; char **s_args; int i, len, nargs; - len = 0; t = trussinfo->curthread; - if (trussinfo->flags & FOLLOWFORKS) - len += fprintf(trussinfo->outfile, "%5d: ", - t->proc->pid); name = t->cs.name; nargs = t->cs.nargs; s_args = t->cs.s_args; - if (name != NULL && (strcmp(name, "execve") == 0 || - strcmp(name, "exit") == 0)) { - clock_gettime(CLOCK_REALTIME, &t->after); - } - - if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&t->after, &trussinfo->start_time, &timediff); - len += fprintf(trussinfo->outfile, "%jd.%09ld ", - (intmax_t)timediff.tv_sec, timediff.tv_nsec); - } - - if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt(&t->after, &t->before, &timediff); - len += fprintf(trussinfo->outfile, "%jd.%09ld ", - (intmax_t)timediff.tv_sec, timediff.tv_nsec); - } + len = print_line_prefix(trussinfo); len += fprintf(trussinfo->outfile, "%s(", name); for (i = 0; i < nargs; i++) { @@ -1683,7 +1663,6 @@ print_syscall_ret(struct trussinfo *trus t = trussinfo->curthread; sc = t->cs.sc; if (trussinfo->flags & COUNTONLY) { - clock_gettime(CLOCK_REALTIME, &t->after); timespecsubt(&t->after, &t->before, &timediff); timespecadd(&sc->time, &timediff, &sc->time); sc->ncalls++; Modified: stable/10/usr.bin/truss/truss.1 ============================================================================== --- stable/10/usr.bin/truss/truss.1 Thu Apr 21 18:37:36 2016 (r298426) +++ stable/10/usr.bin/truss/truss.1 Thu Apr 21 18:44:53 2016 (r298427) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd October 9, 2015 +.Dd February 23, 2016 .Dt TRUSS 1 .Os .Sh NAME @@ -8,12 +8,12 @@ .Nd trace system calls .Sh SYNOPSIS .Nm -.Op Fl facedDS +.Op Fl facedDHS .Op Fl o Ar file .Op Fl s Ar strsize .Fl p Ar pid .Nm -.Op Fl facedDS +.Op Fl facedDHS .Op Fl o Ar file .Op Fl s Ar strsize .Ar command Op Ar args @@ -32,6 +32,10 @@ Trace descendants of the original traced .Xr fork 2 , .Xr vfork 2 , etc. +To distinguish events between processes, +the process ID +.Pq PID +of the process is included in the output of each event. .It Fl a Show the argument strings that are passed in each .Xr execve 2 @@ -52,6 +56,8 @@ since the trace was started. .It Fl D Include timestamps in the output showing the time elapsed since the last recorded event. +.It Fl H +Include the thread ID of in the output of each event. .It Fl S Do not display information about signals received by the process. (Normally, Modified: stable/10/usr.bin/truss/truss.h ============================================================================== --- stable/10/usr.bin/truss/truss.h Thu Apr 21 18:37:36 2016 (r298426) +++ stable/10/usr.bin/truss/truss.h Thu Apr 21 18:44:53 2016 (r298427) @@ -35,6 +35,7 @@ #define EXECVEARGS 0x00000010 #define EXECVEENVS 0x00000020 #define COUNTONLY 0x00000040 +#define DISPLAYTIDS 0x00000080 struct procinfo; struct trussinfo; From owner-svn-src-all@freebsd.org Thu Apr 21 18:58:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5205B18C3F; Thu, 21 Apr 2016 18:58:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5CC91BCA; Thu, 21 Apr 2016 18:58:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LIw6jj098423; Thu, 21 Apr 2016 18:58:06 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LIw6Pu098422; Thu, 21 Apr 2016 18:58:06 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604211858.u3LIw6Pu098422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 21 Apr 2016 18:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298428 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 18:58:08 -0000 Author: gonzo Date: Thu Apr 21 18:58:06 2016 New Revision: 298428 URL: https://svnweb.freebsd.org/changeset/base/298428 Log: Use proper type of tag in bcm2835_mbox_fb_init bcm2835_mbox_fb_init sets configuration so SET_VIRTUAL_OFFSET should be used instead of GET_VIRTUAL_OFFSET Submitted by: Sylvain Garrigues Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Thu Apr 21 18:44:53 2016 (r298427) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Thu Apr 21 18:58:06 2016 (r298428) @@ -501,7 +501,7 @@ bcm2835_mbox_fb_init(struct bcm2835_fb_c BCM2835_MBOX_INIT_TAG(&msg.virtual_w_h, SET_VIRTUAL_W_H); msg.virtual_w_h.body.req.width = fb->vxres; msg.virtual_w_h.body.req.height = fb->vyres; - BCM2835_MBOX_INIT_TAG(&msg.offset, GET_VIRTUAL_OFFSET); + BCM2835_MBOX_INIT_TAG(&msg.offset, SET_VIRTUAL_OFFSET); msg.offset.body.req.x = fb->xoffset; msg.offset.body.req.y = fb->yoffset; BCM2835_MBOX_INIT_TAG(&msg.depth, SET_DEPTH); From owner-svn-src-all@freebsd.org Thu Apr 21 19:24:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DF01B179A5; Thu, 21 Apr 2016 19:24:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 476A41D6D; Thu, 21 Apr 2016 19:24:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LJObIi007437; Thu, 21 Apr 2016 19:24:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LJOabk007432; Thu, 21 Apr 2016 19:24:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604211924.u3LJOabk007432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Apr 2016 19:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298429 - in stable/10: . sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 19:24:38 -0000 Author: emaste Date: Thu Apr 21 19:24:36 2016 New Revision: 298429 URL: https://svnweb.freebsd.org/changeset/base/298429 Log: Fix compiled-in keymap generation for sc/vt consoles In r298297 kbdcontrol's -P option was MFC'd to stable/10, which enables this change for a simplified compile-time default keymap build process. PR: 193865 MFC of: r296899, r296914, r297363, r298402 Modified: stable/10/Makefile.inc1 stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/conf/files.pc98 stable/10/sys/conf/files.sparc64 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Thu Apr 21 18:58:06 2016 (r298428) +++ stable/10/Makefile.inc1 Thu Apr 21 19:24:36 2016 (r298429) @@ -1321,6 +1321,12 @@ _cat= bin/cat _awk= usr.bin/awk .endif +# r296926 -P keymap search path, MFC to stable/10 in r298297 +.if ${BOOTSTRAPPING} < 1003501 || \ + (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) +_kbdcontrol= usr.sbin/kbdcontrol +.endif + .if ${MK_BSNMP} != "no" _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif @@ -1391,6 +1397,7 @@ bootstrap-tools: .PHONY ${_dtc} \ ${_awk} \ ${_cat} \ + ${_kbdcontrol} \ usr.bin/lorder \ usr.bin/makewhatis \ ${_mklocale} \ Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Thu Apr 21 18:58:06 2016 (r298428) +++ stable/10/sys/conf/files.amd64 Thu Apr 21 19:24:36 2016 (r298429) @@ -50,12 +50,12 @@ font.h optional sc_dflt_font \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Thu Apr 21 18:58:06 2016 (r298428) +++ stable/10/sys/conf/files.i386 Thu Apr 21 19:24:36 2016 (r298429) @@ -49,12 +49,12 @@ font.h optional sc_dflt_font \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # Modified: stable/10/sys/conf/files.pc98 ============================================================================== --- stable/10/sys/conf/files.pc98 Thu Apr 21 18:58:06 2016 (r298428) +++ stable/10/sys/conf/files.pc98 Thu Apr 21 19:24:36 2016 (r298429) @@ -46,7 +46,7 @@ svr4_assym.h optional compat_svr4 \ clean "svr4_assym.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # Modified: stable/10/sys/conf/files.sparc64 ============================================================================== --- stable/10/sys/conf/files.sparc64 Thu Apr 21 18:58:06 2016 (r298428) +++ stable/10/sys/conf/files.sparc64 Thu Apr 21 19:24:36 2016 (r298429) @@ -8,17 +8,17 @@ # dependency lines other than the first are silently ignored. # atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # sunkbdmap.h optional sunkbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${SUNKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > sunkbdmap.h" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${SUNKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > sunkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "sunkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # From owner-svn-src-all@freebsd.org Thu Apr 21 19:25:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34D86B17AA2; Thu, 21 Apr 2016 19:25:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 105C71EE3; Thu, 21 Apr 2016 19:25:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LJPYAe007549; Thu, 21 Apr 2016 19:25:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LJPXgS007543; Thu, 21 Apr 2016 19:25:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604211925.u3LJPXgS007543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Apr 2016 19:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298430 - in stable/10/sys: conf dev/kbdmux modules/kbdmux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 19:25:35 -0000 Author: emaste Date: Thu Apr 21 19:25:33 2016 New Revision: 298430 URL: https://svnweb.freebsd.org/changeset/base/298430 Log: MFC r297685: Add option to specify built-in keymap for kbdmux PR: 153459 Submitted by: swell.k@gmail.com Modified: stable/10/sys/conf/NOTES stable/10/sys/conf/files stable/10/sys/conf/options stable/10/sys/dev/kbdmux/kbdmux.c stable/10/sys/modules/kbdmux/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Thu Apr 21 19:24:36 2016 (r298429) +++ stable/10/sys/conf/NOTES Thu Apr 21 19:25:33 2016 (r298430) @@ -1413,6 +1413,10 @@ options MSGBUF_SIZE=40960 options KBD_DISABLE_KEYMAP_LOAD # refuse to load a keymap options KBD_INSTALL_CDEV # install a CDEV entry in /dev +device kbdmux # keyboard multiplexer +options KBDMUX_DFLT_KEYMAP # specify the built-in keymap +makeoptions KBDMUX_DFLT_KEYMAP=it.iso + options FB_DEBUG # Frame buffer debugging device splash # Splash screen and screen saver support Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Apr 21 19:24:36 2016 (r298429) +++ stable/10/sys/conf/files Thu Apr 21 19:25:33 2016 (r298430) @@ -47,6 +47,10 @@ pccarddevs.h standard \ compile-with "${AWK} -f $S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \ no-obj no-implicit-rule before-depend \ clean "pccarddevs.h" +kbdmuxmap.h optional kbdmux_dflt_keymap \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${KBDMUX_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > kbdmuxmap.h" \ + no-obj no-implicit-rule before-depend \ + clean "kbdmuxmap.h" teken_state.h optional sc | vt \ dependency "$S/teken/gensequences $S/teken/sequences" \ compile-with "${AWK} -f $S/teken/gensequences $S/teken/sequences > teken_state.h" \ Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Thu Apr 21 19:24:36 2016 (r298429) +++ stable/10/sys/conf/options Thu Apr 21 19:25:33 2016 (r298430) @@ -796,6 +796,8 @@ KBD_MAXWAIT opt_kbd.h KBD_RESETDELAY opt_kbd.h KBDIO_DEBUG opt_kbd.h +KBDMUX_DFLT_KEYMAP opt_kbdmux.h + # options for the Atheros driver ATH_DEBUG opt_ath.h ATH_TXBUF opt_ath.h Modified: stable/10/sys/dev/kbdmux/kbdmux.c ============================================================================== --- stable/10/sys/dev/kbdmux/kbdmux.c Thu Apr 21 19:24:36 2016 (r298429) +++ stable/10/sys/dev/kbdmux/kbdmux.c Thu Apr 21 19:25:33 2016 (r298430) @@ -33,6 +33,7 @@ #include "opt_compat.h" #include "opt_kbd.h" +#include "opt_kbdmux.h" #include #include @@ -54,6 +55,13 @@ #include #include #include + +/* the initial key map, accent map and fkey strings */ +#ifdef KBDMUX_DFLT_KEYMAP +#define KBD_DFLT_KEYMAP +#include "kbdmuxmap.h" +#endif + #include #define KEYBOARD_NAME "kbdmux" Modified: stable/10/sys/modules/kbdmux/Makefile ============================================================================== --- stable/10/sys/modules/kbdmux/Makefile Thu Apr 21 19:24:36 2016 (r298429) +++ stable/10/sys/modules/kbdmux/Makefile Thu Apr 21 19:25:33 2016 (r298430) @@ -4,7 +4,7 @@ .PATH: ${.CURDIR}/../../dev/kbdmux KMOD= kbdmux -SRCS= kbdmux.c opt_compat.h opt_kbd.h bus_if.h device_if.h +SRCS= kbdmux.c opt_compat.h opt_kbd.h opt_kbdmux.h bus_if.h device_if.h .if !defined(KERNBUILDDIR) opt_compat.h: From owner-svn-src-all@freebsd.org Thu Apr 21 19:40:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAD30B18026; Thu, 21 Apr 2016 19:40:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 720271979; Thu, 21 Apr 2016 19:40:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LJeEg9011194; Thu, 21 Apr 2016 19:40:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LJeBZ5011157; Thu, 21 Apr 2016 19:40:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604211940.u3LJeBZ5011157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Apr 2016 19:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298431 - in head/sys: cam/ata cam/scsi dev/advansys dev/ae dev/aic dev/fb dev/hwpmc dev/le dev/rndtest dev/uart mips/nlm mips/rmi/dev/nlge netgraph netgraph/atm security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 19:40:16 -0000 Author: pfg Date: Thu Apr 21 19:40:10 2016 New Revision: 298431 URL: https://svnweb.freebsd.org/changeset/base/298431 Log: sys: use our nitems() macro when param.h is available. This should cover all the remaining cases in the kernel. Discussed in: freebsd-current Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_xpt.c head/sys/cam/scsi/smp_all.c head/sys/dev/advansys/adv_isa.c head/sys/dev/advansys/advlib.c head/sys/dev/ae/if_ae.c head/sys/dev/aic/aic.c head/sys/dev/aic/aic_cbus.c head/sys/dev/aic/aic_isa.c head/sys/dev/fb/creator.c head/sys/dev/fb/fb.c head/sys/dev/fb/machfb.c head/sys/dev/fb/vesa.c head/sys/dev/fb/vga.c head/sys/dev/hwpmc/hwpmc_amd.c head/sys/dev/hwpmc/hwpmc_mips24k.c head/sys/dev/hwpmc/hwpmc_mips74k.c head/sys/dev/hwpmc/hwpmc_octeon.c head/sys/dev/le/if_le_isa.c head/sys/dev/le/if_le_lebuffer.c head/sys/dev/le/if_le_ledma.c head/sys/dev/rndtest/rndtest.c head/sys/dev/uart/uart_kbd_sun.c head/sys/mips/nlm/board.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/netgraph/atm/ng_atm.c head/sys/netgraph/ng_gif_demux.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_socket.c head/sys/security/audit/bsm_fcntl.c head/sys/security/audit/bsm_socket_type.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/cam/ata/ata_da.c Thu Apr 21 19:40:10 2016 (r298431) @@ -1431,7 +1431,7 @@ adaregister(struct cam_periph *periph, v */ match = cam_quirkmatch((caddr_t)&cgd->ident_data, (caddr_t)ada_quirk_table, - sizeof(ada_quirk_table)/sizeof(*ada_quirk_table), + nitems(ada_quirk_table), sizeof(*ada_quirk_table), ata_identify_match); if (match != NULL) softc->quirks = ((struct ada_quirk_entry *)match)->quirks; Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/cam/scsi/scsi_all.c Thu Apr 21 19:40:10 2016 (r298431) @@ -154,7 +154,7 @@ static struct scsi_op_quirk_entry scsi_o * feel free to change this quirk entry. */ {T_CDROM, SIP_MEDIA_REMOVABLE, "PLEXTOR", "CD-ROM PX*", "*"}, - sizeof(plextor_cd_ops)/sizeof(struct op_table_entry), + nitems(plextor_cd_ops), plextor_cd_ops } }; @@ -645,8 +645,7 @@ scsi_op_desc(u_int16_t opcode, struct sc match = cam_quirkmatch((caddr_t)inq_data, (caddr_t)scsi_op_quirk_table, - sizeof(scsi_op_quirk_table)/ - sizeof(*scsi_op_quirk_table), + nitems(scsi_op_quirk_table), sizeof(*scsi_op_quirk_table), scsi_inquiry_match); } @@ -655,7 +654,7 @@ scsi_op_desc(u_int16_t opcode, struct sc table[0] = ((struct scsi_op_quirk_entry *)match)->op_table; num_ops[0] = ((struct scsi_op_quirk_entry *)match)->num_ops; table[1] = scsi_op_codes; - num_ops[1] = sizeof(scsi_op_codes)/sizeof(scsi_op_codes[0]); + num_ops[1] = nitems(scsi_op_codes); num_tables = 2; } else { /* @@ -666,7 +665,7 @@ scsi_op_desc(u_int16_t opcode, struct sc return("Vendor Specific Command"); table[0] = scsi_op_codes; - num_ops[0] = sizeof(scsi_op_codes)/sizeof(scsi_op_codes[0]); + num_ops[0] = nitems(scsi_op_codes); num_tables = 1; } @@ -921,7 +920,7 @@ static struct scsi_sense_quirk_entry sen */ {T_DIRECT, SIP_MEDIA_FIXED, "QUANTUM", "FIREBALL S*", "*"}, /*num_sense_keys*/0, - sizeof(quantum_fireball_entries)/sizeof(struct asc_table_entry), + nitems(quantum_fireball_entries), /*sense key entries*/NULL, quantum_fireball_entries }, @@ -932,7 +931,7 @@ static struct scsi_sense_quirk_entry sen */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "SONY", "SMO-*", "*"}, /*num_sense_keys*/0, - sizeof(sony_mo_entries)/sizeof(struct asc_table_entry), + nitems(sony_mo_entries), /*sense key entries*/NULL, sony_mo_entries }, @@ -942,7 +941,7 @@ static struct scsi_sense_quirk_entry sen */ {T_DIRECT, SIP_MEDIA_FIXED, "HGST", "*", "*"}, /*num_sense_keys*/0, - sizeof(hgst_entries)/sizeof(struct asc_table_entry), + nitems(hgst_entries), /*sense key entries*/NULL, hgst_entries }, @@ -952,14 +951,13 @@ static struct scsi_sense_quirk_entry sen */ {T_DIRECT, SIP_MEDIA_FIXED, "SEAGATE", "*", "*"}, /*num_sense_keys*/0, - sizeof(seagate_entries)/sizeof(struct asc_table_entry), + nitems(seagate_entries), /*sense key entries*/NULL, seagate_entries } }; -const int sense_quirk_table_size = - sizeof(sense_quirk_table)/sizeof(sense_quirk_table[0]); +const int sense_quirk_table_size = nitems(sense_quirk_table); static struct asc_table_entry asc_table[] = { /* @@ -3195,7 +3193,7 @@ static struct asc_table_entry asc_table[ "Security conflict in translated device") } }; -const int asc_table_size = sizeof(asc_table)/sizeof(asc_table[0]); +const int asc_table_size = nitems(asc_table); struct asc_key { @@ -4704,8 +4702,7 @@ scsi_sense_desc_sbuf(struct sbuf *sb, st { int i; - for (i = 0; i < (sizeof(scsi_sense_printers) / - sizeof(scsi_sense_printers[0])); i++) { + for (i = 0; i < (nitems(scsi_sense_printers)); i++) { struct scsi_sense_desc_printer *printer; printer = &scsi_sense_printers[i]; @@ -5490,7 +5487,7 @@ scsi_calc_syncsrate(u_int period_factor) return (3300); } - num_syncrates = sizeof(scsi_syncrates) / sizeof(scsi_syncrates[0]); + num_syncrates = nitems(scsi_syncrates); /* See if the period is in the "exception" table */ for (i = 0; i < num_syncrates; i++) { @@ -5522,7 +5519,7 @@ scsi_calc_syncparam(u_int period) /* Adjust for exception table being in 100ths. */ period *= 10; - num_syncrates = sizeof(scsi_syncrates) / sizeof(scsi_syncrates[0]); + num_syncrates = nitems(scsi_syncrates); /* See if the period is in the "exception" table */ for (i = 0; i < num_syncrates; i++) { @@ -6568,8 +6565,7 @@ scsi_parse_transportid(char *transportid goto bailout; } - num_proto_entries = sizeof(scsi_proto_map) / - sizeof(scsi_proto_map[0]); + num_proto_entries = nitems(scsi_proto_map); status = scsi_get_nv(scsi_proto_map, num_proto_entries, tmpstr, &table_entry, SCSI_NV_FLAG_IG_CASE); if (status != SCSI_NV_FOUND) { @@ -7289,7 +7285,7 @@ struct scsi_attrib_table_entry * scsi_get_attrib_entry(uint32_t id) { return (scsi_find_attrib_entry(scsi_mam_attr_table, - sizeof(scsi_mam_attr_table) / sizeof(scsi_mam_attr_table[0]), + nitems(scsi_mam_attr_table), id)); } @@ -7416,19 +7412,16 @@ scsi_attrib_sbuf(struct sbuf *sb, struct table1 = user_table; table1_size = num_user_entries; table2 = scsi_mam_attr_table; - table2_size = sizeof(scsi_mam_attr_table) / - sizeof(scsi_mam_attr_table[0]); + table2_size = nitems(scsi_mam_attr_table); } else { table1 = scsi_mam_attr_table; - table1_size = sizeof(scsi_mam_attr_table) / - sizeof(scsi_mam_attr_table[0]); + table1_size = nitems(scsi_mam_attr_table); table2 = user_table; table2_size = num_user_entries; } } else { table1 = scsi_mam_attr_table; - table1_size = sizeof(scsi_mam_attr_table) / - sizeof(scsi_mam_attr_table[0]); + table1_size = nitems(scsi_mam_attr_table); } entry = scsi_find_attrib_entry(table1, table1_size, id); Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/cam/scsi/scsi_cd.c Thu Apr 21 19:40:10 2016 (r298431) @@ -578,7 +578,7 @@ cdregister(struct cam_periph *periph, vo */ match = cam_quirkmatch((caddr_t)&cgd->inq_data, (caddr_t)cd_quirk_table, - sizeof(cd_quirk_table)/sizeof(*cd_quirk_table), + nitems(cd_quirk_table), sizeof(*cd_quirk_table), scsi_inquiry_match); if (match != NULL) @@ -1266,8 +1266,7 @@ cdgetpagesize(int page_num) { int i; - for (i = 0; i < (sizeof(cd_page_size_table)/ - sizeof(cd_page_size_table[0])); i++) { + for (i = 0; i < nitems(cd_page_size_table); i++) { if (cd_page_size_table[i].page == page_num) return (cd_page_size_table[i].page_size); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/cam/scsi/scsi_da.c Thu Apr 21 19:40:10 2016 (r298431) @@ -2190,7 +2190,7 @@ daregister(struct cam_periph *periph, vo */ match = cam_quirkmatch((caddr_t)&cgd->inq_data, (caddr_t)da_quirk_table, - sizeof(da_quirk_table)/sizeof(*da_quirk_table), + nitems(da_quirk_table), sizeof(*da_quirk_table), scsi_inquiry_match); if (match != NULL) Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/cam/scsi/scsi_sa.c Thu Apr 21 19:40:10 2016 (r298431) @@ -309,7 +309,7 @@ struct sa_prot_map { /*min_val*/ 0, /*max_val*/ 1, NULL } }; -#define SA_NUM_PROT_ENTS sizeof(sa_prot_table)/sizeof(sa_prot_table[0]) +#define SA_NUM_PROT_ENTS nitems(sa_prot_table) #define SA_PROT_ENABLED(softc) ((softc->flags & SA_FLAG_PROTECT_SUPP) \ && (softc->prot_info.cur_prot_state.initialized != 0) \ @@ -1313,7 +1313,7 @@ safindparament(struct mtparamset *ps) { unsigned int i; - for (i = 0; i < sizeof(sa_param_table) /sizeof(sa_param_table[0]); i++){ + for (i = 0; i < nitems(sa_param_table); i++){ /* * For entries, we compare all of the characters. For * nodes, we only compare the first N characters. The node @@ -2375,7 +2375,7 @@ saregister(struct cam_periph *periph, vo */ match = cam_quirkmatch((caddr_t)&cgd->inq_data, (caddr_t)sa_quirk_table, - sizeof(sa_quirk_table)/sizeof(*sa_quirk_table), + nitems(sa_quirk_table), sizeof(*sa_quirk_table), scsi_inquiry_match); if (match != NULL) { Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/cam/scsi/scsi_xpt.c Thu Apr 21 19:40:10 2016 (r298431) @@ -556,8 +556,7 @@ static struct scsi_quirk_entry scsi_quir }, }; -static const int scsi_quirk_table_size = - sizeof(scsi_quirk_table) / sizeof(*scsi_quirk_table); +static const int scsi_quirk_table_size = nitems(scsi_quirk_table); static cam_status proberegister(struct cam_periph *periph, void *arg); @@ -1848,8 +1847,7 @@ scsi_find_quirk(struct cam_ed *device) match = cam_quirkmatch((caddr_t)&device->inq_data, (caddr_t)scsi_quirk_table, - sizeof(scsi_quirk_table) / - sizeof(*scsi_quirk_table), + nitems(scsi_quirk_table), sizeof(*scsi_quirk_table), scsi_inquiry_match); if (match == NULL) Modified: head/sys/cam/scsi/smp_all.c ============================================================================== --- head/sys/cam/scsi/smp_all.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/cam/scsi/smp_all.c Thu Apr 21 19:40:10 2016 (r298431) @@ -118,8 +118,7 @@ smp_error_desc(int function_result) { int i; - for (i = 0; i < (sizeof(smp_error_table)/sizeof(smp_error_table[0])); - i++){ + for (i = 0; i < nitems(smp_error_table); i++){ if (function_result == smp_error_table[i].function_result) return (smp_error_table[i].desc); } @@ -164,7 +163,7 @@ smp_command_desc(uint8_t cmd_num) { int i; - for (i = 0; i < (sizeof(smp_cmd_table)/sizeof(smp_cmd_table[0])) && + for (i = 0; i < nitems(smp_cmd_table) && smp_cmd_table[i].cmd_num <= cmd_num; i++) { if (cmd_num == smp_cmd_table[i].cmd_num) return (smp_cmd_table[i].desc); Modified: head/sys/dev/advansys/adv_isa.c ============================================================================== --- head/sys/dev/advansys/adv_isa.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/advansys/adv_isa.c Thu Apr 21 19:40:10 2016 (r298431) @@ -96,7 +96,7 @@ static u_int16_t adv_isa_ioports[] = 0x330 /* Eighth and default selection in BIOS setup */ }; -#define MAX_ISA_IOPORT_INDEX (sizeof(adv_isa_ioports)/sizeof(u_int16_t) - 1) +#define MAX_ISA_IOPORT_INDEX (nitems(adv_isa_ioports) - 1) static int adv_isa_probe(device_t dev); static int adv_isa_attach(device_t dev); Modified: head/sys/dev/advansys/advlib.c ============================================================================== --- head/sys/dev/advansys/advlib.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/advansys/advlib.c Thu Apr 21 19:40:10 2016 (r298431) @@ -316,7 +316,7 @@ advasync(void *callback_arg, u_int32_t c target_mask = ADV_TID_TO_TARGET_MASK(cgd->ccb_h.target_id); - num_entries = sizeof(adv_quirk_table)/sizeof(*adv_quirk_table); + num_entries = nitems(adv_quirk_table); match = cam_quirkmatch((caddr_t)&cgd->inq_data, (caddr_t)adv_quirk_table, num_entries, sizeof(*adv_quirk_table), Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/ae/if_ae.c Thu Apr 21 19:40:10 2016 (r298431) @@ -85,7 +85,7 @@ static struct ae_dev { { VENDORID_ATTANSIC, DEVICEID_ATTANSIC_L2, "Attansic Technology Corp, L2 FastEthernet" }, }; -#define AE_DEVS_COUNT (sizeof(ae_devs) / sizeof(*ae_devs)) +#define AE_DEVS_COUNT (nitems(ae_devs)) static struct resource_spec ae_res_spec_mem[] = { { SYS_RES_MEMORY, PCIR_BAR(0), RF_ACTIVE }, Modified: head/sys/dev/aic/aic.c ============================================================================== --- head/sys/dev/aic/aic.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/aic/aic.c Thu Apr 21 19:40:10 2016 (r298431) @@ -1443,7 +1443,7 @@ aic_init(struct aic_softc *aic) aic->chip_type = AIC6260; aic_insb(aic, ID, chip_id, sizeof(chip_id) - 1); chip_id[sizeof(chip_id) - 1] = '\0'; - for (i = 0; i < sizeof(aic_chip_ids) / sizeof(aic_chip_ids[0]); i++) { + for (i = 0; i < nitems(aic_chip_ids); i++) { if (!strcmp(chip_id, aic_chip_ids[i].idstring)) { aic->chip_type = aic_chip_ids[i].type; break; Modified: head/sys/dev/aic/aic_cbus.c ============================================================================== --- head/sys/dev/aic/aic_cbus.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/aic/aic_cbus.c Thu Apr 21 19:40:10 2016 (r298431) @@ -57,7 +57,8 @@ static int aic_isa_probe(device_t); static int aic_isa_attach(device_t); static u_int aic_isa_ports[] = { 0x1840 }; -#define AIC_ISA_NUMPORTS (sizeof(aic_isa_ports) / sizeof(aic_isa_ports[0])) + +#define AIC_ISA_NUMPORTS nitems(aic_isa_ports) #define AIC_ISA_PORTSIZE 0x20 #define AIC98_GENERIC 0x00 Modified: head/sys/dev/aic/aic_isa.c ============================================================================== --- head/sys/dev/aic/aic_isa.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/aic/aic_isa.c Thu Apr 21 19:40:10 2016 (r298431) @@ -57,7 +57,7 @@ static int aic_isa_probe(device_t); static int aic_isa_attach(device_t); static u_int aic_isa_ports[] = { 0x340, 0x140 }; -#define AIC_ISA_NUMPORTS (sizeof(aic_isa_ports) / sizeof(aic_isa_ports[0])) +#define AIC_ISA_NUMPORTS (nitems(aic_isa_ports)) #define AIC_ISA_PORTSIZE 0x20 static struct isa_pnp_id aic_ids[] = { Modified: head/sys/dev/fb/creator.c ============================================================================== --- head/sys/dev/fb/creator.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/fb/creator.c Thu Apr 21 19:40:10 2016 (r298431) @@ -151,8 +151,7 @@ static const struct { { FFB_VIRT_EXP, FFB_PHYS_EXP, FFB_SIZE_EXP }, }; -#define CREATOR_FB_MAP_SIZE \ - (sizeof(creator_fb_map) / sizeof(creator_fb_map[0])) +#define CREATOR_FB_MAP_SIZE nitems(creator_fb_map) extern const struct gfb_font gallant12x22; Modified: head/sys/dev/fb/fb.c ============================================================================== --- head/sys/dev/fb/fb.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/fb/fb.c Thu Apr 21 19:40:10 2016 (r298431) @@ -610,7 +610,7 @@ fb_type(int adp_type) }; int i; - for (i = 0; i < sizeof(types)/sizeof(types[0]); ++i) { + for (i = 0; i < nitems(types); ++i) { if (types[i].va_type == adp_type) return types[i].fb_type; } Modified: head/sys/dev/fb/machfb.c ============================================================================== --- head/sys/dev/fb/machfb.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/fb/machfb.c Thu Apr 21 19:40:10 2016 (r298431) @@ -478,7 +478,7 @@ machfb_configure(int flags) return (0); if (OF_getprop(output, "device-id", &id, sizeof(id)) == -1) return (0); - for (i = 0; i < sizeof(machfb_info) / sizeof(machfb_info[0]); i++) { + for (i = 0; i < nitems(machfb_info); i++) { if (id == machfb_info[i].chip_id) { sc->sc_flags = MACHFB_CONSOLE; sc->sc_node = output; @@ -532,7 +532,7 @@ machfb_init(int unit, video_adapter_t *a return (ENXIO); sc->sc_ramdac_freq = 0; - for (i = 0; i < sizeof(machfb_info) / sizeof(machfb_info[0]); i++) { + for (i = 0; i < nitems(machfb_info); i++) { if (sc->sc_chip_id == machfb_info[i].chip_id) { sc->sc_ramdac_freq = machfb_info[i].ramdac_freq; break; @@ -1139,7 +1139,7 @@ machfb_pci_probe(device_t dev) pci_get_subclass(dev) != PCIS_DISPLAY_VGA) return (ENXIO); - for (i = 0; i < sizeof(machfb_info) / sizeof(machfb_info[0]); i++) { + for (i = 0; i < nitems(machfb_info); i++) { if (pci_get_device(dev) == machfb_info[i].chip_id) { device_set_desc(dev, machfb_info[i].name); return (BUS_PROBE_DEFAULT); Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/fb/vesa.c Thu Apr 21 19:40:10 2016 (r298431) @@ -653,7 +653,7 @@ vesa_map_gen_mode_num(int type, int colo }; int i; - for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) { + for (i = 0; i < nitems(mode_map); ++i) { if (mode_map[i].from == mode) return (mode_map[i].to); } @@ -676,7 +676,7 @@ vesa_translate_flags(u_int16_t vflags) int flags; int i; - for (flags = 0, i = 0; i < sizeof(ftable)/sizeof(ftable[0]); ++i) { + for (flags = 0, i = 0; i < nitems(ftable); ++i) { flags |= (vflags & ftable[i].mask) ? ftable[i].set : ftable[i].reset; } Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/fb/vga.c Thu Apr 21 19:40:10 2016 (r298431) @@ -602,7 +602,7 @@ map_mode_num(int mode) }; int i; - for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) { + for (i = 0; i < nitems(mode_map); ++i) { if (mode_map[i].from == mode) return mode_map[i].to; } @@ -655,7 +655,7 @@ map_gen_mode_num(int type, int color, in } } - for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) { + for (i = 0; i < nitems(mode_map); ++i) { if (mode_map[i].from == mode) return ((color) ? mode_map[i].to_color : mode_map[i].to_mono); } @@ -702,7 +702,7 @@ map_bios_mode_num(int type, int color, i switch (type) { case KD_VGA: - if (bios_mode < sizeof(vga_modes)/sizeof(vga_modes[0])) + if (bios_mode < nitems(vga_modes)) return vga_modes[bios_mode]; else if (color) return M_VGA_C80x25; @@ -711,7 +711,7 @@ map_bios_mode_num(int type, int color, i break; case KD_EGA: - if (bios_mode < sizeof(ega_modes)/sizeof(ega_modes[0])) + if (bios_mode < nitems(ega_modes)) return ega_modes[bios_mode]; else if (color) return M_ENH_C80x25; @@ -720,7 +720,7 @@ map_bios_mode_num(int type, int color, i break; case KD_CGA: - if (bios_mode < sizeof(cga_modes)/sizeof(cga_modes[0])) + if (bios_mode < nitems(cga_modes)) return cga_modes[bios_mode]; else return M_C80x25; @@ -772,7 +772,7 @@ fill_adapter_param(int code, video_adapt { DCC_EGAMONO, DCC_CGA80 }, }; - if ((code < 0) || (code >= sizeof(dcc)/sizeof(dcc[0]))) { + if ((code < 0) || (code >= nitems(dcc))) { adp[V_ADP_PRIMARY] = adapter_init_value[DCC_MONO]; adp[V_ADP_SECONDARY] = adapter_init_value[DCC_CGA80]; } else { @@ -918,7 +918,7 @@ comp_adpregs(u_char *buf1, u_char *buf2) if ((buf1 == NULL) || (buf2 == NULL)) return COMP_DIFFERENT; - for (i = 0; i < sizeof(params)/sizeof(params[0]); ++i) { + for (i = 0; i < nitems(params); ++i) { if (params[i].mask == 0) /* don't care */ continue; if ((buf1[i] & params[i].mask) != (buf2[i] & params[i].mask)) Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/hwpmc/hwpmc_amd.c Thu Apr 21 19:40:10 2016 (r298431) @@ -241,8 +241,7 @@ const struct amd_event_code_map amd_even }; -const int amd_event_codes_size = - sizeof(amd_event_codes) / sizeof(amd_event_codes[0]); +const int amd_event_codes_size = nitems(amd_event_codes); /* * Per-processor information Modified: head/sys/dev/hwpmc/hwpmc_mips24k.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips24k.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/hwpmc/hwpmc_mips24k.c Thu Apr 21 19:40:10 2016 (r298431) @@ -149,8 +149,7 @@ const struct mips_event_code_map mips_ev }; -const int mips_event_codes_size = - sizeof(mips_event_codes) / sizeof(mips_event_codes[0]); +const int mips_event_codes_size = nitems(mips_event_codes); struct mips_pmc_spec mips_pmc_spec = { .ps_cpuclass = PMC_CLASS_MIPS24K, Modified: head/sys/dev/hwpmc/hwpmc_mips74k.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips74k.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/hwpmc/hwpmc_mips74k.c Thu Apr 21 19:40:10 2016 (r298431) @@ -181,8 +181,7 @@ const struct mips_event_code_map mips_ev { PMC_EV_MIPS74K_WBB_25_50_FULL, MIPS_CTR_1, 76 }, }; -const int mips_event_codes_size = - sizeof(mips_event_codes) / sizeof(mips_event_codes[0]); +const int mips_event_codes_size = nitems(mips_event_codes); struct mips_pmc_spec mips_pmc_spec = { .ps_cpuclass = PMC_CLASS_MIPS74K, Modified: head/sys/dev/hwpmc/hwpmc_octeon.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_octeon.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/hwpmc/hwpmc_octeon.c Thu Apr 21 19:40:10 2016 (r298431) @@ -103,8 +103,7 @@ const struct mips_event_code_map mips_ev { PMC_EV_OCTEON_SYNCW, MIPS_CTR_ALL, CVMX_CORE_PERF_SYNCW }, }; -const int mips_event_codes_size = - sizeof(mips_event_codes) / sizeof(mips_event_codes[0]); +const int mips_event_codes_size = nitems(mips_event_codes); struct mips_pmc_spec mips_pmc_spec = { .ps_cpuclass = PMC_CLASS_OCTEON, Modified: head/sys/dev/le/if_le_isa.c ============================================================================== --- head/sys/dev/le/if_le_isa.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/le/if_le_isa.c Thu Apr 21 19:40:10 2016 (r298431) @@ -241,8 +241,7 @@ le_isa_probe(device_t dev) case 0: return (BUS_PROBE_DEFAULT); case ENOENT: - for (i = 0; i < sizeof(le_isa_params) / - sizeof(le_isa_params[0]); i++) { + for (i = 0; i < nitems(le_isa_params); i++) { if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) { device_set_desc(dev, le_isa_params[i].name); return (BUS_PROBE_DEFAULT); @@ -279,8 +278,7 @@ le_isa_attach(device_t dev) macstride = 1; break; case ENOENT: - for (i = 0; i < sizeof(le_isa_params) / - sizeof(le_isa_params[0]); i++) { + for (i = 0; i < nitems(le_isa_params); i++) { if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) { lesc->sc_rres = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &j, Modified: head/sys/dev/le/if_le_lebuffer.c ============================================================================== --- head/sys/dev/le/if_le_lebuffer.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/le/if_le_lebuffer.c Thu Apr 21 19:40:10 2016 (r298431) @@ -104,8 +104,7 @@ MODULE_DEPEND(le, lebuffer, 1, 1, 1); static const int le_lebuffer_media[] = { IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, 0) }; -#define NLEMEDIA \ - (sizeof(le_lebuffer_media) / sizeof(le_lebuffer_media[0])) +#define NLEMEDIA nitems(le_lebuffer_media) static void le_lebuffer_wrcsr(struct lance_softc *, uint16_t, uint16_t); static uint16_t le_lebuffer_rdcsr(struct lance_softc *, uint16_t); Modified: head/sys/dev/le/if_le_ledma.c ============================================================================== --- head/sys/dev/le/if_le_ledma.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/le/if_le_ledma.c Thu Apr 21 19:40:10 2016 (r298431) @@ -388,7 +388,7 @@ le_dma_attach(device_t dev) sc->sc_mediachange = le_dma_supmediachange; sc->sc_mediastatus = le_dma_supmediastatus; sc->sc_supmedia = le_dma_supmedia; - sc->sc_nsupmedia = sizeof(le_dma_supmedia) / sizeof(le_dma_supmedia[0]); + sc->sc_nsupmedia = nitems(le_dma_supmedia); sc->sc_defaultmedia = le_dma_supmedia[0]; OF_getetheraddr(dev, sc->sc_enaddr); Modified: head/sys/dev/rndtest/rndtest.c ============================================================================== --- head/sys/dev/rndtest/rndtest.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/rndtest/rndtest.c Thu Apr 21 19:40:10 2016 (r298431) @@ -68,7 +68,7 @@ static const struct rndtest_testfunc { { rndtest_longruns }, }; -#define RNDTEST_NTESTS (sizeof(rndtest_funcs)/sizeof(rndtest_funcs[0])) +#define RNDTEST_NTESTS nitems(rndtest_funcs) static SYSCTL_NODE(_kern, OID_AUTO, rndtest, CTLFLAG_RD, 0, "RNG test parameters"); Modified: head/sys/dev/uart/uart_kbd_sun.c ============================================================================== --- head/sys/dev/uart/uart_kbd_sun.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/dev/uart/uart_kbd_sun.c Thu Apr 21 19:40:10 2016 (r298431) @@ -857,7 +857,7 @@ keycode2scancode(int keycode, int shift, int scancode; scancode = keycode; - if ((keycode >= 89) && (keycode < 89 + sizeof(scan) / sizeof(scan[0]))) + if ((keycode >= 89) && (keycode < 89 + nitems(scan))) scancode = scan[keycode - 89] | SCAN_PREFIX_E0; /* pause/break */ if ((keycode == 104) && !(shift & CTLS)) Modified: head/sys/mips/nlm/board.c ============================================================================== --- head/sys/mips/nlm/board.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/mips/nlm/board.c Thu Apr 21 19:40:10 2016 (r298431) @@ -105,10 +105,10 @@ nlm_get_vfbid_mapping(int vfbid) struct vfbid_tbl *p; if (nlm_is_xlp3xx()) { - nentries = sizeof(nlm3xx_vfbid)/sizeof(struct vfbid_tbl); + nentries = nitems(nlm3xx_vfbid); p = nlm3xx_vfbid; } else { - nentries = sizeof(nlm_vfbid)/sizeof(struct vfbid_tbl); + nentries = nitems(nlm_vfbid); p = nlm_vfbid; } Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Apr 21 19:40:10 2016 (r298431) @@ -2404,7 +2404,7 @@ dump_fmn_cpu_credits_for_gmac(struct xlr int j, k, r, c; int n_gmac_buckets; - n_gmac_buckets = sizeof (gmac_bucket_ids) / sizeof (gmac_bucket_ids[0]); + n_gmac_buckets = nitems(gmac_bucket_ids); for (j = 0; j < 8; j++) { // for each cpu cc = board->credit_configs[j]; printf("Credits for Station CPU_%d ---> GMAC buckets (tx path)\n", j); @@ -2518,7 +2518,7 @@ dump_mii_regs(struct nlge_softc *sc) if (sc->mii_base == NULL || sc->mii_bus == NULL) return; - n_regs = sizeof (mii_regs) / sizeof (mii_regs[0]); + n_regs = nitems(mii_regs); for (i = 0; i < n_regs; i++) { printf("[mii_0x%x] = %x\n", mii_regs[i], nlge_mii_read_internal(sc->mii_base, sc->phy_addr, Modified: head/sys/netgraph/atm/ng_atm.c ============================================================================== --- head/sys/netgraph/atm/ng_atm.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/netgraph/atm/ng_atm.c Thu Apr 21 19:40:10 2016 (r298431) @@ -872,7 +872,7 @@ text_status(node_p node, char *arg, u_in sbuf_new(&sbuf, arg, len, SBUF_FIXEDLEN); sbuf_printf(&sbuf, "interface: %s\n", priv->ifp->if_xname); - if (mib->device >= sizeof(devices) / sizeof(devices[0])) + if (mib->device >= nitems(devices)) sbuf_printf(&sbuf, "device=unknown\nvendor=unknown\n"); else sbuf_printf(&sbuf, "device=%s\nvendor=%s\n", Modified: head/sys/netgraph/ng_gif_demux.c ============================================================================== --- head/sys/netgraph/ng_gif_demux.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/netgraph/ng_gif_demux.c Thu Apr 21 19:40:10 2016 (r298431) @@ -111,7 +111,7 @@ const static struct iffam gFamilies[] = { AF_ATM, NG_GIF_DEMUX_HOOK_ATM }, { AF_NATM, NG_GIF_DEMUX_HOOK_NATM }, }; -#define NUM_FAMILIES (sizeof(gFamilies) / sizeof(*gFamilies)) +#define NUM_FAMILIES nitems(gFamilies) /* Per-node private data */ struct ng_gif_demux_private { Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/netgraph/ng_iface.c Thu Apr 21 19:40:10 2016 (r298431) @@ -104,7 +104,7 @@ const static struct iffam gFamilies[] = { AF_ATM, NG_IFACE_HOOK_ATM }, { AF_NATM, NG_IFACE_HOOK_NATM }, }; -#define NUM_FAMILIES (sizeof(gFamilies) / sizeof(*gFamilies)) +#define NUM_FAMILIES nitems(gFamilies) /* Node private data */ struct ng_iface_private { Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/netgraph/ng_socket.c Thu Apr 21 19:40:10 2016 (r298431) @@ -1163,7 +1163,7 @@ struct domain ngdomain = { .dom_family = AF_NETGRAPH, .dom_name = "netgraph", .dom_protosw = ngsw, - .dom_protoswNPROTOSW = &ngsw[sizeof(ngsw) / sizeof(ngsw[0])] + .dom_protoswNPROTOSW = &ngsw[nitems(ngsw)] }; /* Modified: head/sys/security/audit/bsm_fcntl.c ============================================================================== --- head/sys/security/audit/bsm_fcntl.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/security/audit/bsm_fcntl.c Thu Apr 21 19:40:10 2016 (r298431) @@ -237,8 +237,7 @@ static const bsm_fcntl_cmd_t bsm_fcntl_c { BSM_F_FS_SPECIFIC_15, FCNTL_FS_SPECIFIC_BASE + 15}, #endif /* FCNTL_FS_SPECIFIC_BASE */ }; -static const int bsm_fcntl_cmd_count = sizeof(bsm_fcntl_cmdtab) / - sizeof(bsm_fcntl_cmdtab[0]); +static const int bsm_fcntl_cmd_count = nitems(bsm_fcntl_cmdtab); static const bsm_fcntl_cmd_t * bsm_lookup_local_fcntl_cmd(int local_fcntl_cmd) Modified: head/sys/security/audit/bsm_socket_type.c ============================================================================== --- head/sys/security/audit/bsm_socket_type.c Thu Apr 21 19:25:33 2016 (r298430) +++ head/sys/security/audit/bsm_socket_type.c Thu Apr 21 19:40:10 2016 (r298431) @@ -52,8 +52,7 @@ static const struct bsm_socket_type bsm_ { BSM_SOCK_RDM, SOCK_RDM }, { BSM_SOCK_SEQPACKET, SOCK_SEQPACKET }, }; -static const int bsm_socket_types_count = sizeof(bsm_socket_types) / - sizeof(bsm_socket_types[0]); +static const int bsm_socket_types_count = nitems(bsm_socket_types); static const struct bsm_socket_type * bsm_lookup_local_socket_type(int local_socket_type) From owner-svn-src-all@freebsd.org Thu Apr 21 19:48:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3755B183FF; Thu, 21 Apr 2016 19:48:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1536106D; Thu, 21 Apr 2016 19:48:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LJmStV014173; Thu, 21 Apr 2016 19:48:28 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LJmSlo014172; Thu, 21 Apr 2016 19:48:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604211948.u3LJmSlo014172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Apr 2016 19:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298432 - head/sys/dev/aic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 19:48:30 -0000 Author: pfg Date: Thu Apr 21 19:48:28 2016 New Revision: 298432 URL: https://svnweb.freebsd.org/changeset/base/298432 Log: Redundant parenthesis from r298431. Modified: head/sys/dev/aic/aic_isa.c Modified: head/sys/dev/aic/aic_isa.c ============================================================================== --- head/sys/dev/aic/aic_isa.c Thu Apr 21 19:40:10 2016 (r298431) +++ head/sys/dev/aic/aic_isa.c Thu Apr 21 19:48:28 2016 (r298432) @@ -57,7 +57,8 @@ static int aic_isa_probe(device_t); static int aic_isa_attach(device_t); static u_int aic_isa_ports[] = { 0x340, 0x140 }; -#define AIC_ISA_NUMPORTS (nitems(aic_isa_ports)) + +#define AIC_ISA_NUMPORTS nitems(aic_isa_ports) #define AIC_ISA_PORTSIZE 0x20 static struct isa_pnp_id aic_ids[] = { From owner-svn-src-all@freebsd.org Thu Apr 21 19:57:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5761CB186CC; Thu, 21 Apr 2016 19:57:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E877916A8; Thu, 21 Apr 2016 19:57:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LJvlIt017163; Thu, 21 Apr 2016 19:57:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LJve7g017099; Thu, 21 Apr 2016 19:57:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604211957.u3LJve7g017099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Apr 2016 19:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298433 - in head/sys: amd64/amd64 arm/arm arm/at91 arm/cavium/cns11xx arm/mv arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa arm64/arm64 boot/common boot/mips/beri/loader boot/zfs d... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 19:57:48 -0000 Author: pfg Date: Thu Apr 21 19:57:40 2016 New Revision: 298433 URL: https://svnweb.freebsd.org/changeset/base/298433 Log: sys: use our roundup2/rounddown2() macros when param.h is available. rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted. Modified: head/sys/amd64/amd64/amd64_mem.c head/sys/amd64/amd64/pmap.c head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/pmap-v4.c head/sys/arm/at91/at91_machdep.c head/sys/arm/cavium/cns11xx/econa_machdep.c head/sys/arm/mv/mv_common.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/i8134x/i81342_pci.c head/sys/arm/xscale/i8134x/i81342_space.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c head/sys/arm64/arm64/pmap.c head/sys/boot/common/module.c head/sys/boot/mips/beri/loader/arch.c head/sys/boot/zfs/zfs.c head/sys/dev/adb/adb_mouse.c head/sys/dev/agp/agp_nvidia.c head/sys/dev/bce/if_bce.c head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/en/midway.c head/sys/dev/exca/exca.c head/sys/dev/fatm/if_fatm.c head/sys/dev/hatm/if_hatm.c head/sys/dev/hptmv/gui_lib.c head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c head/sys/dev/pccbb/pccbb.c head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c head/sys/dev/sym/sym_hipd.c head/sys/dev/ti/if_ti.c head/sys/dev/usb/usb_busdma.c head/sys/dev/vt/hw/efifb/efifb.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/geom/bde/g_bde_crypt.c head/sys/geom/part/g_part_bsd64.c head/sys/i386/i386/i686_mem.c head/sys/i386/i386/minidump_machdep.c head/sys/i386/i386/sys_machdep.c head/sys/i386/svr4/svr4_machdep.c head/sys/kern/imgact_elf.c head/sys/kern/init_main.c head/sys/kern/kern_linker.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/sys/kern/vfs_bio.c head/sys/mips/cavium/octopci.c head/sys/mips/mips/tlb.c head/sys/mips/mips/trap.c head/sys/mips/rmi/dev/sec/rmilib.c head/sys/mips/sibyte/sb_zbpci.c head/sys/net/bpf.c head/sys/net80211/ieee80211_freebsd.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/machdep.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_dirhash.c head/sys/ufs/ufs/ufs_lookup.c head/sys/vm/phys_pager.c head/sys/vm/vm_page.c head/sys/vm/vm_phys.c head/sys/x86/iommu/intel_gas.c Modified: head/sys/amd64/amd64/amd64_mem.c ============================================================================== --- head/sys/amd64/amd64/amd64_mem.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/amd64/amd64/amd64_mem.c Thu Apr 21 19:57:40 2016 (r298433) @@ -383,7 +383,7 @@ amd64_mrstoreone(void *arg) /* mask/active register */ if (mrd->mr_flags & MDF_ACTIVE) { msrv = MTRR_PHYSMASK_VALID | - (~(mrd->mr_len - 1) & mtrr_physmask); + rounddown2(mtrr_physmask, mrd->mr_len); } else { msrv = 0; } Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/amd64/amd64/pmap.c Thu Apr 21 19:57:40 2016 (r298433) @@ -496,7 +496,7 @@ pmap_kmem_choose(vm_offset_t addr) { vm_offset_t newaddr = addr; - newaddr = (addr + (NBPDR - 1)) & ~(NBPDR - 1); + newaddr = roundup2(addr, NBPDR); return (newaddr); } Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/arm/elf_trampoline.c Thu Apr 21 19:57:40 2016 (r298433) @@ -675,8 +675,8 @@ __start(void) curaddr = (void*)((unsigned int)curaddr & 0xfff00000); #ifdef KZIP if (*kernel == 0x1f && kernel[1] == 0x8b) { - pt_addr = (((int)&_end + KERNSIZE + 0x100) & - ~(L1_TABLE_SIZE - 1)) + L1_TABLE_SIZE; + pt_addr = L1_TABLE_SIZE + + rounddown2((int)&_end + KERNSIZE + 0x100, L1_TABLE_SIZE); #ifdef CPU_ARM9 /* So that idcache_wbinv works; */ @@ -710,7 +710,7 @@ __start(void) (unsigned int)curaddr, (unsigned int)&func_end, 0); dst = (void *)(((vm_offset_t)dst & ~3)); - pt_addr = ((unsigned int)dst &~(L1_TABLE_SIZE - 1)) + L1_TABLE_SIZE; + pt_addr = L1_TABLE_SIZE + rounddown2((unsigned int)dst, L1_TABLE_SIZE); setup_pagetables(pt_addr, (vm_paddr_t)curaddr, (vm_paddr_t)curaddr + 0x10000000, 0); sp = pt_addr + L1_TABLE_SIZE + 8192; Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/arm/pmap-v4.c Thu Apr 21 19:57:40 2016 (r298433) @@ -4754,7 +4754,7 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offs vm_size_t resid; int i; - resid = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1); + resid = roundup2(size, PAGE_SIZE); if (l1pt == 0) panic("pmap_map_chunk: no L1 table provided"); Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/at91/at91_machdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -515,9 +515,9 @@ initarm(struct arm_boot_params *abp) pmap_link_l2pt(l1pagetable, KERNBASE + i * L1_S_SIZE, &kernel_pt_table[KERNEL_PT_KERN + i]); pmap_map_chunk(l1pagetable, KERNBASE, PHYSADDR, - (((uint32_t)lastaddr - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - afterkern = round_page((lastaddr + L1_S_SIZE) & ~(L1_S_SIZE - 1)); + rounddown2(((uint32_t)lastaddr - KERNBASE) + PAGE_SIZE, PAGE_SIZE), + VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + afterkern = round_page(rounddown2(lastaddr + L1_S_SIZE, L1_S_SIZE)); for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) { pmap_link_l2pt(l1pagetable, afterkern + i * L1_S_SIZE, &kernel_pt_table[KERNEL_PT_AFKERNEL + i]); Modified: head/sys/arm/cavium/cns11xx/econa_machdep.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa_machdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/cavium/cns11xx/econa_machdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -229,9 +229,9 @@ initarm(struct arm_boot_params *abp) pmap_link_l2pt(l1pagetable, KERNBASE + i * L1_S_SIZE, &kernel_pt_table[KERNEL_PT_KERN + i]); pmap_map_chunk(l1pagetable, KERNBASE, PHYSADDR, - (((uint32_t)lastaddr - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - afterkern = round_page((lastaddr + L1_S_SIZE) & ~(L1_S_SIZE - 1)); + rounddown2(((uint32_t)lastaddr - KERNBASE) + PAGE_SIZE, PAGE_SIZE), + VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + afterkern = round_page(rounddown2(lastaddr + L1_S_SIZE, L1_S_SIZE)); for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) { pmap_link_l2pt(l1pagetable, afterkern + i * L1_S_SIZE, &kernel_pt_table[KERNEL_PT_AFKERNEL + i]); Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/mv/mv_common.c Thu Apr 21 19:57:40 2016 (r298433) @@ -823,7 +823,7 @@ decode_win_cpu_valid(void) continue; } - if (b != (b & ~(s - 1))) { + if (b != rounddown2(b, s)) { printf("CPU window#%d: address 0x%08x is not aligned " "to 0x%08x\n", i, b, s); rv = 0; Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -131,8 +131,8 @@ static const struct arm_devmap_entry iq8 * Cheat and map a whole section, this will bring * both PCI-X and PCI-E outbound I/O */ - IOP34X_PCIX_OIOBAR_VADDR &~ (0x100000 - 1), - IOP34X_PCIX_OIOBAR &~ (0x100000 - 1), + rounddown2(IOP34X_PCIX_OIOBAR_VADDR, 0x100000), + rounddown2(IOP34X_PCIX_OIOBAR, 0x100000), 0x100000, }, { @@ -227,8 +227,8 @@ initarm(struct arm_boot_params *abp) l1pagetable = kernel_l1pt.pv_va; /* Map the L2 pages tables in the L1 page table */ - pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1), - &kernel_pt_table[KERNEL_PT_SYS]); + pmap_link_l2pt(l1pagetable, rounddown2(ARM_VECTORS_HIGH, 0x00100000), + &kernel_pt_table[KERNEL_PT_SYS]); pmap_map_chunk(l1pagetable, KERNBASE, SDRAM_START, 0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); @@ -236,11 +236,10 @@ initarm(struct arm_boot_params *abp) 0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); pmap_map_chunk(l1pagetable, KERNBASE + 0x200000, SDRAM_START + 0x200000, - (((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1), - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - freemem_after = ((int)lastaddr + PAGE_SIZE) & ~(PAGE_SIZE - 1); - afterkern = round_page(((vm_offset_t)lastaddr + L1_S_SIZE) & ~(L1_S_SIZE - - 1)); + rounddown2(((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE, L1_S_SIZE), + VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + freemem_after = rounddown2((int)lastaddr + PAGE_SIZE, PAGE_SIZE); + afterkern = round_page(rounddown2((vm_offset_t)lastaddr + L1_S_SIZE, L1_S_SIZE)); for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) { pmap_link_l2pt(l1pagetable, afterkern + i * 0x00100000, &kernel_pt_table[KERNEL_PT_AFKERNEL + i]); Modified: head/sys/arm/xscale/i8134x/i81342_pci.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342_pci.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/xscale/i8134x/i81342_pci.c Thu Apr 21 19:57:40 2016 (r298433) @@ -121,8 +121,8 @@ i81342_pci_attach(device_t dev) memstart | PCI_MAPREG_MEM_PREFETCHABLE_MASK | PCI_MAPREG_MEM_TYPE_64BIT); bus_space_write_4(sc->sc_st, sc->sc_atu_sh, ATU_IAUBAR1, 0); - bus_space_write_4(sc->sc_st, sc->sc_atu_sh, ATU_IALR1, ~(memsize - 1) - &~(0xfff)); + bus_space_write_4(sc->sc_st, sc->sc_atu_sh, ATU_IALR1, + rounddown2(~(0xfff), memsize)); bus_space_write_4(sc->sc_st, sc->sc_atu_sh, ATU_IATVR1, memstart); bus_space_write_4(sc->sc_st, sc->sc_atu_sh, ATU_IAUTVR1, 0); Modified: head/sys/arm/xscale/i8134x/i81342_space.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342_space.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/xscale/i8134x/i81342_space.c Thu Apr 21 19:57:40 2016 (r298433) @@ -178,13 +178,13 @@ i81342_mem_bs_map(bus_space_tag_t tag, b tmp = tmp->next; } addr = allocable; - endaddr = ((addr + size) &~ (0x1000000 - 1)) + 0x1000000; + endaddr = rounddown2(addr + size, 0x1000000) + 0x1000000; if (endaddr >= IOP34X_VADDR) panic("PCI virtual memory exhausted"); allocable = endaddr; tmp = malloc(sizeof(*tmp), M_DEVBUF, M_WAITOK); tmp->next = NULL; - paddr = bpa &~ (0x100000 - 1); + paddr = rounddown2(bpa, 0x100000); tmp->paddr = paddr; tmp->vaddr = addr; tmp->size = 0; Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -291,7 +291,7 @@ initarm(struct arm_boot_params *abp) l1pagetable = kernel_l1pt.pv_va; /* Map the L2 pages tables in the L1 page table */ - pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1), + pmap_link_l2pt(l1pagetable, rounddown2(ARM_VECTORS_HIGH, 0x00100000), &kernel_pt_table[KERNEL_PT_SYS]); pmap_link_l2pt(l1pagetable, IXP425_IO_VBASE, &kernel_pt_table[KERNEL_PT_IO]); Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -222,8 +222,8 @@ initarm(struct arm_boot_params *abp) l1pagetable = kernel_l1pt.pv_va; /* Map the L2 pages tables in the L1 page table */ - pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1), - &kernel_pt_table[KERNEL_PT_SYS]); + pmap_link_l2pt(l1pagetable, rounddown2(ARM_VECTORS_HIGH, 0x00100000), + &kernel_pt_table[KERNEL_PT_SYS]); #if 0 /* XXXBJR: What is this? Don't know if there's an analogue. */ pmap_link_l2pt(l1pagetable, IQ80321_IOPXS_VBASE, &kernel_pt_table[KERNEL_PT_IOPXS]); @@ -235,11 +235,10 @@ initarm(struct arm_boot_params *abp) pmap_map_chunk(l1pagetable, KERNBASE + 0x100000, SDRAM_START + 0x100000, 0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); pmap_map_chunk(l1pagetable, KERNBASE + 0x200000, SDRAM_START + 0x200000, - (((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1), - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - freemem_after = ((int)lastaddr + PAGE_SIZE) & ~(PAGE_SIZE - 1); - afterkern = round_page(((vm_offset_t)lastaddr + L1_S_SIZE) & - ~(L1_S_SIZE - 1)); + rounddown2(((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE, L1_S_SIZE), + VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + freemem_after = rounddown2((int)lastaddr + PAGE_SIZE, PAGE_SIZE); + afterkern = round_page(rounddown2((vm_offset_t)lastaddr + L1_S_SIZE, L1_S_SIZE)); for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) { pmap_link_l2pt(l1pagetable, afterkern + i * 0x00100000, &kernel_pt_table[KERNEL_PT_AFKERNEL + i]); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/arm64/arm64/pmap.c Thu Apr 21 19:57:40 2016 (r298433) @@ -622,7 +622,7 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_o KASSERT((va & L2_OFFSET) == 0, ("Invalid virtual address")); l2 = pmap_l2(kernel_pmap, va); - l2 = (pd_entry_t *)((uintptr_t)l2 & ~(PAGE_SIZE - 1)); + l2 = (pd_entry_t *)rounddown2((uintptr_t)l2, PAGE_SIZE); l2pt = (vm_offset_t)l2; l2_slot = pmap_l2_index(va); l3pt = l3_start; Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/boot/common/module.c Thu Apr 21 19:57:40 2016 (r298433) @@ -744,7 +744,7 @@ file_search(const char *name, char **ext } #define INT_ALIGN(base, ptr) ptr = \ - (base) + (((ptr) - (base) + sizeof(int) - 1) & ~(sizeof(int) - 1)) + (base) + roundup2((ptr) - (base), sizeof(int)) static char * mod_search_hints(struct moduledir *mdp, const char *modname, Modified: head/sys/boot/mips/beri/loader/arch.c ============================================================================== --- head/sys/boot/mips/beri/loader/arch.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/boot/mips/beri/loader/arch.c Thu Apr 21 19:57:40 2016 (r298433) @@ -86,7 +86,7 @@ beri_arch_loadaddr(u_int type, void *dat /* Align ELF objects at page boundaries; others at cache lines. */ align = (type == LOAD_ELF) ? PAGE_SIZE : CACHE_LINE_SIZE; - return ((addr + align - 1) & ~(align - 1)); + return (roundup2(addr, align)); } static ssize_t Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/boot/zfs/zfs.c Thu Apr 21 19:57:40 2016 (r298433) @@ -310,7 +310,7 @@ zfs_readdir(struct open_file *f, struct fzap_next: chunk = fp->f_seekp & (bsize - 1); if (chunk == ZAP_LEAF_NUMCHUNKS(&zl)) { - fp->f_seekp = (fp->f_seekp & ~(bsize - 1)) + bsize; + fp->f_seekp = rounddown2(fp->f_seekp, bsize) + bsize; chunk = 0; /* Modified: head/sys/dev/adb/adb_mouse.c ============================================================================== --- head/sys/dev/adb/adb_mouse.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/adb/adb_mouse.c Thu Apr 21 19:57:40 2016 (r298433) @@ -403,7 +403,7 @@ adb_mouse_receive_packet(device_t dev, u * high button events when they are touched. */ - if (buttons & ~((1 << sc->hw.buttons) - 1) + if (rounddown2(buttons, 1 << sc->hw.buttons) && !(sc->flags & AMS_TOUCHPAD)) { buttons |= 1 << (sc->hw.buttons - 1); } Modified: head/sys/dev/agp/agp_nvidia.c ============================================================================== --- head/sys/dev/agp/agp_nvidia.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/agp/agp_nvidia.c Thu Apr 21 19:57:40 2016 (r298433) @@ -216,8 +216,8 @@ agp_nvidia_attach (device_t dev) if (sc->num_dirs == 0) { sc->num_dirs = 1; sc->num_active_entries /= (64 / size); - sc->pg_offset = (apbase & (64 * 1024 * 1024 - 1) & - ~(AGP_GET_APERTURE(dev) - 1)) / PAGE_SIZE; + sc->pg_offset = rounddown2(apbase & (64 * 1024 * 1024 - 1), + AGP_GET_APERTURE(dev)) / PAGE_SIZE; } /* (G)ATT Base Address */ @@ -410,7 +410,7 @@ nvidia_init_iorr(u_int32_t addr, u_int32 } base = (addr & ~0xfff) | 0x18; - mask = (0xfULL << 32) | ((~(size - 1)) & 0xfffff000) | 0x800; + mask = (0xfULL << 32) | rounddown2(0xfffff000, size) | 0x800; wrmsr(IORR_BASE0 + 2 * iorr_addr, base); wrmsr(IORR_MASK0 + 2 * iorr_addr, mask); Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/bce/if_bce.c Thu Apr 21 19:57:40 2016 (r298433) @@ -3047,7 +3047,7 @@ bce_get_rx_buffer_sizes(struct bce_softc sc->rx_bd_mbuf_alloc_size = MHLEN; /* Make sure offset is 16 byte aligned for hardware. */ sc->rx_bd_mbuf_align_pad = - roundup2((MSIZE - MHLEN), 16) - (MSIZE - MHLEN); + roundup2(MSIZE - MHLEN, 16) - (MSIZE - MHLEN); sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - sc->rx_bd_mbuf_align_pad; } else { Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/cxgbe/common/t4_hw.c Thu Apr 21 19:57:40 2016 (r298433) @@ -607,8 +607,8 @@ int t4_mem_read(struct adapter *adap, in * need to round down the start and round up the end. We'll start * copying out of the first line at (addr - start) a word at a time. */ - start = addr & ~(64-1); - end = (addr + len + 64-1) & ~(64-1); + start = rounddown2(addr, 64); + end = roundup2(addr + len, 64); offset = (addr - start)/sizeof(__be32); for (pos = start; pos < end; pos += 64, offset = 0) { Modified: head/sys/dev/en/midway.c ============================================================================== --- head/sys/dev/en/midway.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/en/midway.c Thu Apr 21 19:57:40 2016 (r298433) @@ -1487,7 +1487,7 @@ en_init(struct en_softc *sc) loc = sc->txslot[slot].cur = sc->txslot[slot].start; loc = loc - MID_RAMOFF; /* mask, cvt to words */ - loc = (loc & ~((EN_TXSZ * 1024) - 1)) >> 2; + loc = rounddown2(loc, EN_TXSZ * 1024) >> 2; /* top 11 bits */ loc = loc >> MIDV_LOCTOPSHFT; en_write(sc, MIDX_PLACE(slot), MIDX_MKPLACE(en_k2sz(EN_TXSZ), @@ -2992,7 +2992,7 @@ en_attach(struct en_softc *sc) sc->rxslot[lcv].stop = ptr; midvloc = midvloc - MID_RAMOFF; /* mask, cvt to words */ - midvloc = (midvloc & ~((EN_RXSZ*1024) - 1)) >> 2; + midvloc = rounddown2(midvloc, EN_RXSZ * 1024) >> 2; /* we only want the top 11 bits */ midvloc = midvloc >> MIDV_LOCTOPSHFT; midvloc = (midvloc & MIDV_LOCMASK) << MIDV_LOCSHIFT; Modified: head/sys/dev/exca/exca.c ============================================================================== --- head/sys/dev/exca/exca.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/exca/exca.c Thu Apr 21 19:57:40 2016 (r298433) @@ -402,7 +402,7 @@ exca_mem_set_offset(struct exca_softc *s "set_memory_offset: specified resource not active\n"); return (ENOENT); } - sc->mem[win].cardaddr = cardaddr & ~(EXCA_MEM_PAGESIZE - 1); + sc->mem[win].cardaddr = rounddown2(cardaddr, EXCA_MEM_PAGESIZE); delta = cardaddr % EXCA_MEM_PAGESIZE; if (deltap) *deltap = delta; Modified: head/sys/dev/fatm/if_fatm.c ============================================================================== --- head/sys/dev/fatm/if_fatm.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/fatm/if_fatm.c Thu Apr 21 19:57:40 2016 (r298433) @@ -116,8 +116,8 @@ static const struct utopia_methods fatm_ }; #define VC_OK(SC, VPI, VCI) \ - (((VPI) & ~((1 << IFP2IFATM((SC)->ifp)->mib.vpi_bits) - 1)) == 0 && \ - (VCI) != 0 && ((VCI) & ~((1 << IFP2IFATM((SC)->ifp)->mib.vci_bits) - 1)) == 0) + (rounddown2(VPI, 1 << IFP2IFATM((SC)->ifp)->mib.vpi_bits) == 0 && \ + (VCI) != 0 && rounddown2(VCI, 1 << IFP2IFATM((SC)->ifp)->mib.vci_bits) == 0) static int fatm_load_vc(struct fatm_softc *sc, struct card_vcc *vc); Modified: head/sys/dev/hatm/if_hatm.c ============================================================================== --- head/sys/dev/hatm/if_hatm.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/hatm/if_hatm.c Thu Apr 21 19:57:40 2016 (r298433) @@ -788,16 +788,14 @@ hatm_init_cm(struct hatm_softc *sc) rsra = 0; mlbm = ((rsra + IFP2IFATM(sc->ifp)->mib.max_vccs * 8) + 0x7ff) & ~0x7ff; rabr = ((mlbm + numbuffs * 2) + 0x7ff) & ~0x7ff; - sc->rsrb = ((rabr + 2048) + (2 * IFP2IFATM(sc->ifp)->mib.max_vccs - 1)) & - ~(2 * IFP2IFATM(sc->ifp)->mib.max_vccs - 1); + sc->rsrb = roundup2(rabr + 2048, 2 * IFP2IFATM(sc->ifp)->mib.max_vccs); tsra = 0; sc->tsrb = tsra + IFP2IFATM(sc->ifp)->mib.max_vccs * 8; sc->tsrc = sc->tsrb + IFP2IFATM(sc->ifp)->mib.max_vccs * 4; sc->tsrd = sc->tsrc + IFP2IFATM(sc->ifp)->mib.max_vccs * 2; tabr = sc->tsrd + IFP2IFATM(sc->ifp)->mib.max_vccs * 1; - mtpd = ((tabr + 1024) + (16 * IFP2IFATM(sc->ifp)->mib.max_vccs - 1)) & - ~(16 * IFP2IFATM(sc->ifp)->mib.max_vccs - 1); + mtpd = roundup2(tabr + 1024, 16 * IFP2IFATM(sc->ifp)->mib.max_vccs); DBG(sc, ATTACH, ("rsra=%x mlbm=%x rabr=%x rsrb=%x", rsra, mlbm, rabr, sc->rsrb)); Modified: head/sys/dev/hptmv/gui_lib.c ============================================================================== --- head/sys/dev/hptmv/gui_lib.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/hptmv/gui_lib.c Thu Apr 21 19:57:40 2016 (r298433) @@ -783,8 +783,8 @@ simple: for(i = 0; i < pArray->u.array.bArnMember; i++) if(pArray->u.array.pMember[i]->VDeviceCapacity < capacity) capacity = pArray->u.array.pMember[i]->VDeviceCapacity; - pArray->VDeviceCapacity = (capacity & ~(pArray->u.array.bStripeWitch - 1)) - * (pArray->u.array.bArnMember - 1); + pArray->VDeviceCapacity = rounddown2(capacity, pArray->u.array.bStripeWitch) * + (pArray->u.array.bArnMember - 1); break; default: Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/mpr/mpr.c Thu Apr 21 19:57:40 2016 (r298433) @@ -1084,8 +1084,8 @@ mpr_alloc_queues(struct mpr_softc *sc) * * These two queues are allocated together for simplicity. */ - sc->fqdepth = roundup2((sc->num_replies + 1), 16); - sc->pqdepth = roundup2((sc->num_replies + 1), 16); + sc->fqdepth = roundup2(sc->num_replies + 1, 16); + sc->pqdepth = roundup2(sc->num_replies + 1, 16); fqsize= sc->fqdepth * 4; pqsize = sc->pqdepth * 8; qsize = fqsize + pqsize; Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/mps/mps.c Thu Apr 21 19:57:40 2016 (r298433) @@ -1080,8 +1080,8 @@ mps_alloc_queues(struct mps_softc *sc) * * These two queues are allocated together for simplicity. */ - sc->fqdepth = roundup2((sc->num_replies + 1), 16); - sc->pqdepth = roundup2((sc->num_replies + 1), 16); + sc->fqdepth = roundup2(sc->num_replies + 1, 16); + sc->pqdepth = roundup2(sc->num_replies + 1, 16); fqsize= sc->fqdepth * 4; pqsize = sc->pqdepth * 8; qsize = fqsize + pqsize; Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/pccbb/pccbb.c Thu Apr 21 19:57:40 2016 (r298433) @@ -1155,7 +1155,7 @@ cbb_cardbus_auto_open(struct cbb_softc * if (starts[i] == START_NONE) continue; starts[i] &= ~(align - 1); - ends[i] = ((ends[i] + align - 1) & ~(align - 1)) - 1; + ends[i] = roundup2(ends[i], align) - 1; } if (starts[0] != START_NONE && starts[1] != START_NONE) { if (starts[0] < starts[1]) { Modified: head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Thu Apr 21 19:57:40 2016 (r298433) @@ -5049,8 +5049,8 @@ STATIC void agtiapi_PrepCCBs( struct agt sizeof(tiSgl_t), max_ccb ); - ccb_sz = (AGTIAPI_CCB_SIZE + cache_line_size() - 1) & ~(cache_line_size() -1); - hdr_sz = (sizeof(*hdr) + cache_line_size() - 1) & ~(cache_line_size() - 1); + ccb_sz = roundup2(AGTIAPI_CCB_SIZE, cache_line_size()); + hdr_sz = roundup2(sizeof(*hdr), cache_line_size()); AGTIAPI_PRINTK("agtiapi_PrepCCBs: after cache line\n"); @@ -5174,9 +5174,8 @@ STATIC U32 agtiapi_InitCCBs(struct agtia #endif max_ccb = tgtCount * AGTIAPI_CCB_PER_DEVICE;// / 4; // TBR - ccb_sz = ( (AGTIAPI_CCB_SIZE + cache_line_size() - 1) & - ~(cache_line_size() -1) ); - hdr_sz = (sizeof(*hdr) + cache_line_size() - 1) & ~(cache_line_size() - 1); + ccb_sz = roundup2(AGTIAPI_CCB_SIZE, cache_line_size()); + hdr_sz = roundup2(sizeof(*hdr), cache_line_size()); size = ccb_sz * max_ccb + hdr_sz; for (i = 0; i < (1 << no_allocs); i++) @@ -5854,7 +5853,7 @@ STATIC void agtiapi_ReleaseCCBs( struct while ((hdr = pCard->ccbAllocList) != NULL) { pCard->ccbAllocList = hdr->next; - hdr_sz = (sizeof(*hdr) + cache_line_size() - 1) & ~(cache_line_size() - 1); + hdr_sz = roundup2(sizeof(*hdr), cache_line_size()); pccb = (ccb_t*) ((char*)hdr + hdr_sz); if (pCard->buffer_dmat != NULL && pccb->CCB_dmamap != NULL) { Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/sym/sym_hipd.c Thu Apr 21 19:57:40 2016 (r298433) @@ -7903,7 +7903,7 @@ sym_scatter_sg_physical(hcb_p np, ccb_p pe = ps + psegs[t].ds_len; while (s >= 0) { - pn = (pe - 1) & ~(SYM_CONF_DMA_BOUNDARY - 1); + pn = rounddown2(pe - 1, SYM_CONF_DMA_BOUNDARY); if (pn <= ps) pn = ps; k = pe - pn; Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/ti/if_ti.c Thu Apr 21 19:57:40 2016 (r298433) @@ -434,7 +434,7 @@ ti_mem_read(struct ti_softc *sc, uint32_ segsize = cnt; else segsize = TI_WINLEN - (segptr % TI_WINLEN); - CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1))); + CSR_WRITE_4(sc, TI_WINBASE, rounddown2(segptr, TI_WINLEN)); bus_space_read_region_4(sc->ti_btag, sc->ti_bhandle, TI_WINDOW + (segptr & (TI_WINLEN - 1)), (uint32_t *)ptr, segsize / 4); @@ -464,7 +464,7 @@ ti_mem_write(struct ti_softc *sc, uint32 segsize = cnt; else segsize = TI_WINLEN - (segptr % TI_WINLEN); - CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1))); + CSR_WRITE_4(sc, TI_WINBASE, rounddown2(segptr, TI_WINLEN)); bus_space_write_region_4(sc->ti_btag, sc->ti_bhandle, TI_WINDOW + (segptr & (TI_WINLEN - 1)), (uint32_t *)ptr, segsize / 4); @@ -491,7 +491,7 @@ ti_mem_zero(struct ti_softc *sc, uint32_ segsize = cnt; else segsize = TI_WINLEN - (segptr % TI_WINLEN); - CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1))); + CSR_WRITE_4(sc, TI_WINBASE, rounddown2(segptr, TI_WINLEN)); bus_space_set_region_4(sc->ti_btag, sc->ti_bhandle, TI_WINDOW + (segptr & (TI_WINLEN - 1)), 0, segsize / 4); segptr += segsize; @@ -559,7 +559,7 @@ ti_copy_mem(struct ti_softc *sc, uint32_ segsize = cnt; else segsize = TI_WINLEN - (segptr % TI_WINLEN); - CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1))); + CSR_WRITE_4(sc, TI_WINBASE, rounddown2(segptr, TI_WINLEN)); ti_offset = TI_WINDOW + (segptr & (TI_WINLEN -1)); @@ -628,7 +628,7 @@ ti_copy_mem(struct ti_softc *sc, uint32_ /* * Set the segment pointer. */ - CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1))); + CSR_WRITE_4(sc, TI_WINBASE, rounddown2(segptr, TI_WINLEN)); ti_offset = TI_WINDOW + (segptr & (TI_WINLEN - 1)); Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/usb/usb_busdma.c Thu Apr 21 19:57:40 2016 (r298433) @@ -467,7 +467,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ off = 0; pg = pc->page_start; - pg->physaddr = segs->ds_addr & ~(USB_PAGE_SIZE - 1); + pg->physaddr = rounddown2(segs->ds_addr, USB_PAGE_SIZE); rem = segs->ds_addr & (USB_PAGE_SIZE - 1); pc->page_offset_buf = rem; pc->page_offset_end += rem; @@ -502,7 +502,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ break; } pg++; - pg->physaddr = (segs->ds_addr + off) & ~(USB_PAGE_SIZE - 1); + pg->physaddr = rounddown2(segs->ds_addr + off, USB_PAGE_SIZE); } done: Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/dev/vt/hw/efifb/efifb.c Thu Apr 21 19:57:40 2016 (r298433) @@ -116,7 +116,7 @@ vt_efifb_init(struct vt_device *vd) info->fb_depth = fls(efifb->fb_mask_red | efifb->fb_mask_green | efifb->fb_mask_blue | efifb->fb_mask_reserved); /* Round to a multiple of the bits in a byte. */ - info->fb_bpp = (info->fb_depth + NBBY - 1) & ~(NBBY - 1); + info->fb_bpp = roundup2(info->fb_depth, NBBY); /* Stride in bytes, not pixels */ info->fb_stride = efifb->fb_stride * (info->fb_bpp / NBBY); Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/fs/ext2fs/ext2_lookup.c Thu Apr 21 19:57:40 2016 (r298433) @@ -540,7 +540,7 @@ found: * in the cache as to where the entry was found. */ if ((flags & ISLASTCN) && nameiop == LOOKUP) - dp->i_diroff = i_offset &~ (DIRBLKSIZ - 1); + dp->i_diroff = rounddown2(i_offset, DIRBLKSIZ); /* * If deleting, and at end of pathname, return * parameters which can be used to remove file. Modified: head/sys/geom/bde/g_bde_crypt.c ============================================================================== --- head/sys/geom/bde/g_bde_crypt.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/geom/bde/g_bde_crypt.c Thu Apr 21 19:57:40 2016 (r298433) @@ -311,7 +311,7 @@ g_bde_map_sector(struct g_bde_work *wp) /* Compensate for lock sectors */ for (u = 0; u < G_BDE_MAXKEYS; u++) { /* Find the start of this lock sector */ - ko = kp->lsector[u] & ~((uint64_t)kp->sectorsize - 1); + ko = rounddown2(kp->lsector[u], (uint64_t)kp->sectorsize); if (wp->kso >= ko) wp->kso += kp->sectorsize; Modified: head/sys/geom/part/g_part_bsd64.c ============================================================================== --- head/sys/geom/part/g_part_bsd64.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/geom/part/g_part_bsd64.c Thu Apr 21 19:57:40 2016 (r298433) @@ -447,9 +447,9 @@ g_part_bsd64_resize(struct g_part_table if (baseentry == NULL) { pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; table = (struct g_part_bsd64_table *)basetable; - table->d_abase = ((pp->mediasize - - table->d_bbase * pp->sectorsize) & ~(table->d_align - 1)) / - pp->sectorsize; + table->d_abase = + rounddown2(pp->mediasize - table->d_bbase * pp->sectorsize, + table->d_align) / pp->sectorsize; basetable->gpt_last = table->d_abase - 1; return (0); } @@ -477,8 +477,8 @@ g_part_bsd64_probe(struct g_part_table * pp = cp->provider; if (pp->mediasize < 2 * PALIGN_SIZE) return (ENOSPC); - v = (pp->sectorsize + - offsetof(struct disklabel64, d_magic)) & ~(pp->sectorsize - 1); + v = rounddown2(pp->sectorsize + offsetof(struct disklabel64, d_magic), + pp->sectorsize); buf = g_read_data(cp, 0, v, &error); if (buf == NULL) return (error); @@ -502,8 +502,7 @@ g_part_bsd64_read(struct g_part_table *b pp = cp->provider; table = (struct g_part_bsd64_table *)basetable; - v32 = (pp->sectorsize + - sizeof(struct disklabel64) - 1) & ~(pp->sectorsize - 1); + v32 = roundup2(sizeof(struct disklabel64), pp->sectorsize); buf = g_read_data(cp, 0, v32, &error); if (buf == NULL) return (error); @@ -620,8 +619,7 @@ g_part_bsd64_write(struct g_part_table * pp = cp->provider; table = (struct g_part_bsd64_table *)basetable; - sz = (pp->sectorsize + - sizeof(struct disklabel64) - 1) & ~(pp->sectorsize - 1); + sz = roundup2(sizeof(struct disklabel64), pp->sectorsize); dlp = g_malloc(sz, M_WAITOK | M_ZERO); memcpy(dlp->d_reserved0, table->d_reserved0, Modified: head/sys/i386/i386/i686_mem.c ============================================================================== --- head/sys/i386/i386/i686_mem.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/i386/i386/i686_mem.c Thu Apr 21 19:57:40 2016 (r298433) @@ -377,7 +377,7 @@ i686_mrstoreone(void *arg) /* mask/active register */ if (mrd->mr_flags & MDF_ACTIVE) { msrv = MTRR_PHYSMASK_VALID | - (~(mrd->mr_len - 1) & mtrr_physmask); + rounddown2(mtrr_physmask, mrd->mr_len); } else { msrv = 0; } Modified: head/sys/i386/i386/minidump_machdep.c ============================================================================== --- head/sys/i386/i386/minidump_machdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/i386/i386/minidump_machdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -54,7 +54,7 @@ CTASSERT(sizeof(struct kerneldumpheader) #define SIZEOF_METADATA (64*1024) #define MD_ALIGN(x) (((off_t)(x) + PAGE_MASK) & ~PAGE_MASK) -#define DEV_ALIGN(x) (((off_t)(x) + (DEV_BSIZE-1)) & ~(DEV_BSIZE-1)) +#define DEV_ALIGN(x) roundup2((off_t)(x), DEV_BSIZE) uint32_t *vm_page_dump; int vm_page_dump_size; Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/i386/i386/sys_machdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #define MAX_LD 8192 #define LD_PER_PAGE 512 -#define NEW_MAX_LD(num) ((num + LD_PER_PAGE) & ~(LD_PER_PAGE-1)) +#define NEW_MAX_LD(num) rounddown2(num + LD_PER_PAGE, LD_PER_PAGE) #define SIZE_FROM_LARGEST_LD(num) (NEW_MAX_LD(num) << 3) #define NULL_LDT_BASE ((caddr_t)NULL) Modified: head/sys/i386/svr4/svr4_machdep.c ============================================================================== --- head/sys/i386/svr4/svr4_machdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/i386/svr4/svr4_machdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -159,7 +159,7 @@ svr4_getcontext(td, uc, mask, oonstack) #if defined(DONE_MORE_SIGALTSTACK_WORK) bsd_to_svr4_sigaltstack(sf, s); #else - s->ss_sp = (void *)(((u_long) tf->tf_esp) & ~(16384 - 1)); + s->ss_sp = (void *)rounddown2((u_long)tf->tf_esp, 16384); s->ss_size = 16384; s->ss_flags = 0; #endif Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/kern/imgact_elf.c Thu Apr 21 19:57:40 2016 (r298433) @@ -139,8 +139,8 @@ SYSCTL_INT(_kern_elf32, OID_AUTO, read_e static Elf_Brandinfo *elf_brand_list[MAX_BRANDS]; -#define trunc_page_ps(va, ps) ((va) & ~(ps - 1)) -#define round_page_ps(va, ps) (((va) + (ps - 1)) & ~(ps - 1)) +#define trunc_page_ps(va, ps) rounddown2(va, ps) +#define round_page_ps(va, ps) roundup2(va, ps) #define aligned(a, t) (trunc_page_ps((u_long)(a), sizeof(t)) == (u_long)(a)) static const char FREEBSD_ABI_VENDOR[] = "FreeBSD"; Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/kern/init_main.c Thu Apr 21 19:57:40 2016 (r298433) @@ -787,7 +787,7 @@ start_init(void *dummy) /* * Move out the arg pointers. */ - uap = (char **)((intptr_t)ucp & ~(sizeof(intptr_t)-1)); + uap = (char **)rounddown2((intptr_t)ucp, sizeof(intptr_t)); (void)suword((caddr_t)--uap, (long)0); /* terminator */ (void)suword((caddr_t)--uap, (long)(intptr_t)arg1); (void)suword((caddr_t)--uap, (long)(intptr_t)arg0); Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/kern/kern_linker.c Thu Apr 21 19:57:40 2016 (r298433) @@ -1713,7 +1713,7 @@ linker_lookup_file(const char *path, int } #define INT_ALIGN(base, ptr) ptr = \ - (base) + (((ptr) - (base) + sizeof(int) - 1) & ~(sizeof(int) - 1)) + (base) + roundup2((ptr) - (base), sizeof(int)) /* * Lookup KLD which contains requested module in the "linker.hints" file. If Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/kern/sysv_sem.c Thu Apr 21 19:57:40 2016 (r298433) @@ -164,7 +164,7 @@ struct sem_undo { * SEMUSZ is properly aligned. */ -#define SEM_ALIGN(bytes) (((bytes) + (sizeof(long) - 1)) & ~(sizeof(long) - 1)) +#define SEM_ALIGN(bytes) roundup2(bytes, sizeof(long)) /* actual size of an undo structure */ #define SEMUSZ SEM_ALIGN(offsetof(struct sem_undo, un_ent[SEMUME])) Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/kern/sysv_shm.c Thu Apr 21 19:57:40 2016 (r298433) @@ -370,7 +370,7 @@ kern_shmat_locked(struct thread *td, int prot |= VM_PROT_WRITE; if (shmaddr != NULL) { if ((shmflg & SHM_RND) != 0) - attach_va = (vm_offset_t)shmaddr & ~(SHMLBA-1); + attach_va = rounddown2((vm_offset_t)shmaddr, SHMLBA); else if (((vm_offset_t)shmaddr & (SHMLBA-1)) == 0) attach_va = (vm_offset_t)shmaddr; else Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/kern/vfs_bio.c Thu Apr 21 19:57:40 2016 (r298433) @@ -3865,7 +3865,7 @@ allocbuf(struct buf *bp, int size) if (bp->b_kvasize != 0 && bp->b_kvasize < size) panic("allocbuf: buffer too small"); - newbsize = (size + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1); + newbsize = roundup2(size, DEV_BSIZE); if ((bp->b_flags & B_VMIO) == 0) { if ((bp->b_flags & B_MALLOC) == 0) newbsize = round_page(newbsize); Modified: head/sys/mips/cavium/octopci.c ============================================================================== --- head/sys/mips/cavium/octopci.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/mips/cavium/octopci.c Thu Apr 21 19:57:40 2016 (r298433) @@ -487,7 +487,7 @@ octopci_init_bar(device_t dev, unsigned if (PCI_BAR_IO(bar)) { size = ~(bar & PCIM_BAR_IO_BASE) + 1; - sc->sc_io_next = (sc->sc_io_next + size - 1) & ~(size - 1); + sc->sc_io_next = roundup2(sc->sc_io_next, size); if (sc->sc_io_next + size > CVMX_OCT_PCI_IO_SIZE) { device_printf(dev, "%02x.%02x:%02x: no ports for BAR%u.\n", b, s, f, barnum); @@ -527,7 +527,7 @@ octopci_init_bar(device_t dev, unsigned size = ~(bar & (uint32_t)PCIM_BAR_MEM_BASE) + 1; - sc->sc_mem1_next = (sc->sc_mem1_next + size - 1) & ~(size - 1); + sc->sc_mem1_next = roundup2(sc->sc_mem1_next, size); if (sc->sc_mem1_next + size > CVMX_OCT_PCI_MEM1_SIZE) { device_printf(dev, "%02x.%02x:%02x: no memory for BAR%u.\n", b, s, f, barnum); Modified: head/sys/mips/mips/tlb.c ============================================================================== --- head/sys/mips/mips/tlb.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/mips/mips/tlb.c Thu Apr 21 19:57:40 2016 (r298433) @@ -215,7 +215,7 @@ tlb_invalidate_range(pmap_t pmap, vm_off * and round the virtual address "end" to an even page frame number. */ start &= ~((1 << TLBMASK_SHIFT) - 1); - end = (end + (1 << TLBMASK_SHIFT) - 1) & ~((1 << TLBMASK_SHIFT) - 1); + end = roundup2(end, 1 << TLBMASK_SHIFT); s = intr_disable(); save_asid = mips_rd_entryhi() & TLBHI_ASID_MASK; Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/mips/mips/trap.c Thu Apr 21 19:57:40 2016 (r298433) @@ -1576,7 +1576,7 @@ mips_unaligned_load_store(struct trapfra return (0); } - if (!useracc((void *)((vm_offset_t)addr & ~(size - 1)), size * 2, mode)) + if (!useracc((void *)rounddown2((vm_offset_t)addr, size), size * 2, mode)) return (0); /* Modified: head/sys/mips/rmi/dev/sec/rmilib.c ============================================================================== --- head/sys/mips/rmi/dev/sec/rmilib.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/mips/rmi/dev/sec/rmilib.c Thu Apr 21 19:57:40 2016 (r298433) @@ -397,7 +397,7 @@ xlr_sec_setup_packet(xlr_sec_io_pt op, /* physical address of the source buffer */ addr = (uint64_t) vtophys((void *)(unsigned long)op->source_buf); /* cache-aligned base of the source buffer */ - seg_addr = (addr & ~(SMP_CACHE_BYTES - 1)); + seg_addr = rounddown2(addr, SMP_CACHE_BYTES); /* offset in bytes to the source buffer start from the segment base */ byte_offset = addr - seg_addr; /* global offset: 0-7 bytes */ @@ -417,7 +417,7 @@ xlr_sec_setup_packet(xlr_sec_io_pt op, len = op->source_buf_size + byte_offset - global_offset; if (multi_frag_flag) { next_seg_addr = (uint64_t)vtophys((void *)(uintptr_t)desc->next_src_buf); - next_seg_addr = (next_seg_addr & ~(SMP_CACHE_BYTES - 1)); + next_seg_addr = rounddown2(next_seg_addr, SMP_CACHE_BYTES); next_len = desc->next_src_len; } /* length of the whole thing in dwords */ @@ -602,10 +602,10 @@ xlr_sec_setup_packet(xlr_sec_io_pt op, */ if (multi_frag_flag) { next_seg_addr = (uint64_t) vtophys((void *)(unsigned long)(desc->next_dest_buf)); - next_seg_addr = (next_seg_addr & ~(SMP_CACHE_BYTES - 1)); + next_seg_addr = rounddown2(next_seg_addr, SMP_CACHE_BYTES); } addr = (uint64_t) vtophys((void *)(unsigned long)op->dest_buf); - seg_addr = (addr & ~(SMP_CACHE_BYTES - 1)); + seg_addr = rounddown2(addr, SMP_CACHE_BYTES); byte_offset = addr - seg_addr; global_offset = byte_offset & 0x7; Modified: head/sys/mips/sibyte/sb_zbpci.c ============================================================================== --- head/sys/mips/sibyte/sb_zbpci.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/mips/sibyte/sb_zbpci.c Thu Apr 21 19:57:40 2016 (r298433) @@ -345,7 +345,7 @@ zbpci_config_space_va(int bus, int slot, #if _BYTE_ORDER == _BIG_ENDIAN pa = pa ^ (4 - bytes); #endif - pa_page = pa & ~(PAGE_SIZE - 1); + pa_page = rounddown2(pa, PAGE_SIZE); if (zbpci_config_space[cpu].paddr != pa_page) { pmap_kremove(va_page); pmap_kenter_attr(va_page, pa_page, PTE_C_UNCACHED); Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/net/bpf.c Thu Apr 21 19:57:40 2016 (r298433) @@ -121,7 +121,7 @@ CTASSERT(offsetof(struct bpf_if, bif_ext #include #include #define BPF_ALIGNMENT32 sizeof(int32_t) -#define BPF_WORDALIGN32(x) (((x)+(BPF_ALIGNMENT32-1))&~(BPF_ALIGNMENT32-1)) +#define BPF_WORDALIGN32(x) roundup2(x, BPF_ALIGNMENT32) #ifndef BURN_BRIDGES /* Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/net80211/ieee80211_freebsd.c Thu Apr 21 19:57:40 2016 (r298433) @@ -340,7 +340,7 @@ ieee80211_flush_ifq(struct ifqueue *ifq, */ #define MC_ALIGN(m, len) \ do { \ - (m)->m_data += (MCLBYTES - (len)) &~ (sizeof(long) - 1); \ + (m)->m_data += rounddown2(MCLBYTES - (len), sizeof(long)); \ } while (/* CONSTCOND */ 0) /* Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/powerpc/aim/mmu_oea.c Thu Apr 21 19:57:40 2016 (r298433) @@ -1673,7 +1673,7 @@ moea_pinit(mmu_t mmu, pmap_t pmap) } i = ffs(~moea_vsid_bitmap[n]) - 1; mask = 1 << i; - hash &= 0xfffff & ~(VSID_NBPW - 1); + hash &= rounddown2(0xfffff, VSID_NBPW); hash |= i; } KASSERT(!(moea_vsid_bitmap[n] & mask), @@ -1865,7 +1865,7 @@ moea_bootstrap_alloc(vm_size_t size, u_i size = round_page(size); for (i = 0; phys_avail[i + 1] != 0; i += 2) { if (align != 0) - s = (phys_avail[i] + align - 1) & ~(align - 1); + s = roundup2(phys_avail[i], align); else s = phys_avail[i]; e = s + size; Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Apr 21 19:57:40 2016 (r298433) @@ -1966,7 +1966,7 @@ moea64_get_unique_vsid(void) { } i = ffs(~moea64_vsid_bitmap[n]) - 1; mask = 1 << i; - hash &= VSID_HASHMASK & ~(VSID_NBPW - 1); + hash &= rounddown2(VSID_HASHMASK, VSID_NBPW); hash |= i; } if (hash == VSID_VRMA) /* also special, avoid this too */ @@ -2296,7 +2296,7 @@ moea64_bootstrap_alloc(vm_size_t size, u size = round_page(size); for (i = 0; phys_avail[i + 1] != 0; i += 2) { if (align != 0) - s = (phys_avail[i] + align - 1) & ~(align - 1); + s = roundup2(phys_avail[i], align); else s = phys_avail[i]; e = s + size; Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/powerpc/booke/pmap.c Thu Apr 21 19:57:40 2016 (r298433) @@ -2687,7 +2687,7 @@ mmu_booke_dumpsys_map(mmu_t mmu, vm_padd /* Raw physical memory dumps don't have a virtual address. */ /* We always map a 256MB page at 256M. */ gran = 256 * 1024 * 1024; - ppa = pa & ~(gran - 1); + ppa = rounddown2(pa, gran); ofs = pa - ppa; *va = (void *)gran; tlb1_set_entry((vm_offset_t)va, ppa, gran, _TLB_ENTRY_IO); @@ -2725,7 +2725,7 @@ mmu_booke_dumpsys_unmap(mmu_t mmu, vm_pa tlb1_write_entry(&e, i); gran = 256 * 1024 * 1024; - ppa = pa & ~(gran - 1); + ppa = rounddown2(pa, gran); ofs = pa - ppa; if (sz > (gran - ofs)) { i--; @@ -3332,7 +3332,7 @@ tlb1_mapin_region(vm_offset_t va, vm_pad int idx, nents; /* Round up to the next 1M */ - size = (size + (1 << 20) - 1) & ~((1 << 20) - 1); + size = roundup2(size, 1 << 20); mapped = 0; idx = 0; Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/powerpc/powerpc/machdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -449,7 +449,7 @@ cpu_flush_dcache(void *ptr, size_t len) addr = (uintptr_t)ptr; off = addr & (cacheline_size - 1); addr -= off; - len = (len + off + cacheline_size - 1) & ~(cacheline_size - 1); + len = roundup2(len + off, cacheline_size); while (len > 0) { __asm __volatile ("dcbf 0,%0" :: "r"(addr)); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Apr 21 19:57:40 2016 (r298433) @@ -13594,7 +13594,7 @@ clear_inodedeps(mp) /* * Find the last inode in the block with dependencies. */ - firstino = inodedep->id_ino & ~(INOPB(fs) - 1); + firstino = rounddown2(inodedep->id_ino, INOPB(fs)); for (lastino = firstino + INOPB(fs) - 1; lastino > firstino; lastino--) if (inodedep_lookup(mp, lastino, 0, &inodedep) != 0) break; Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/ufs/ufs/ufs_dirhash.c Thu Apr 21 19:57:40 2016 (r298433) @@ -1145,7 +1145,7 @@ ufsdirhash_getprev(struct direct *dirp, doff_t blkoff, prevoff; int entrypos, i; - blkoff = offset & ~(DIRBLKSIZ - 1); /* offset of start of block */ + blkoff = rounddown2(offset, DIRBLKSIZ); /* offset of start of block */ entrypos = offset & (DIRBLKSIZ - 1); /* entry relative to block */ blkbuf = (char *)dirp - entrypos; prevoff = blkoff; Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/ufs/ufs/ufs_lookup.c Thu Apr 21 19:57:40 2016 (r298433) @@ -577,7 +577,7 @@ found: * in the cache as to where the entry was found. */ if ((flags & ISLASTCN) && nameiop == LOOKUP) - dp->i_diroff = i_offset &~ (DIRBLKSIZ - 1); + dp->i_diroff = rounddown2(i_offset, DIRBLKSIZ); /* * If deleting, and at end of pathname, return @@ -1100,7 +1100,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir if (dp->i_dirhash != NULL) ufsdirhash_checkblock(dp, dirbuf - (dp->i_offset & (DIRBLKSIZ - 1)), - dp->i_offset & ~(DIRBLKSIZ - 1)); + rounddown2(dp->i_offset, DIRBLKSIZ)); #endif if (DOINGSOFTDEP(dvp)) { @@ -1231,7 +1231,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) if (dp->i_dirhash != NULL) ufsdirhash_checkblock(dp, (char *)ep - ((dp->i_offset - dp->i_count) & (DIRBLKSIZ - 1)), - dp->i_offset & ~(DIRBLKSIZ - 1)); + rounddown2(dp->i_offset, DIRBLKSIZ)); #endif out: error = 0; Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/vm/phys_pager.c Thu Apr 21 19:57:40 2016 (r298433) @@ -187,7 +187,7 @@ phys_pager_haspage(vm_object_t object, v { vm_pindex_t base, end; - base = pindex & (~(PHYSCLUSTER - 1)); + base = rounddown2(pindex, PHYSCLUSTER); end = base + (PHYSCLUSTER - 1); if (before != NULL) *before = pindex - base; Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Apr 21 19:48:28 2016 (r298432) +++ head/sys/vm/vm_page.c Thu Apr 21 19:57:40 2016 (r298433) @@ -2157,8 +2157,8 @@ vm_page_scan_contig(u_long npages, vm_pa m_inc = atop(roundup2(pa, alignment) - pa); continue; } - if (((pa ^ (pa + ptoa(npages) - 1)) & ~(boundary - - 1)) != 0) { + if (rounddown2(pa ^ (pa + ptoa(npages) - 1), + boundary) != 0) { m_inc = atop(roundup2(pa, boundary) - pa); continue; } @@ -3495,7 +3495,7 @@ vm_page_set_valid_range(vm_page_t m, int * bit is clear, we have to zero out a portion of the * first block. */ - if ((frag = base & ~(DEV_BSIZE - 1)) != base && + if ((frag = rounddown2(base, DEV_BSIZE)) != base && (m->valid & (1 << (base >> DEV_BSHIFT))) == 0) pmap_zero_page_area(m, frag, base - frag); @@ -3505,7 +3505,7 @@ vm_page_set_valid_range(vm_page_t m, int * the last block. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Apr 21 19:59:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDCACB187C4; Thu, 21 Apr 2016 19:59:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F17F1889; Thu, 21 Apr 2016 19:59:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LJxteq017273; Thu, 21 Apr 2016 19:59:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LJxtGh017272; Thu, 21 Apr 2016 19:59:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604211959.u3LJxtGh017272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 21 Apr 2016 19:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298434 - head/lib/msun/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 19:59:56 -0000 Author: ngie Date: Thu Apr 21 19:59:55 2016 New Revision: 298434 URL: https://svnweb.freebsd.org/changeset/base/298434 Log: Completely disable fmaxmin_test (follow up to r297952) COMPILER_TYPE/COMPILER_VERSION doesn't get passed down properly at buildworld/installworld with older build hosts MFC after: never PR: 208703, 208963 Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division Modified: head/lib/msun/tests/Makefile Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Thu Apr 21 19:57:40 2016 (r298433) +++ head/lib/msun/tests/Makefile Thu Apr 21 19:59:55 2016 (r298434) @@ -53,9 +53,15 @@ TAP_TESTS_C+= exponential_test TAP_TESTS_C+= fenv_test TAP_TESTS_C+= fma_test # clang 3.8.0 fails always fails this test. See: bug 208703 -.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} == 30800) -TAP_TESTS_C+= fmaxmin_test -.endif +# +# XXX: depending on this compiler version check doesn't work at +# buildworld/installworld time, which results in jenkins failures (bug 208963) +# because the build is run on a 10.x instance, which has an older clang +# compiler. +# +#.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} == 30800) +#TAP_TESTS_C+= fmaxmin_test +#.endif TAP_TESTS_C+= ilogb_test TAP_TESTS_C+= invtrig_test TAP_TESTS_C+= invctrig_test From owner-svn-src-all@freebsd.org Thu Apr 21 20:30:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3583B174CC; Thu, 21 Apr 2016 20:30:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 943871B40; Thu, 21 Apr 2016 20:30:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LKUc63026331; Thu, 21 Apr 2016 20:30:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LKUcRk026325; Thu, 21 Apr 2016 20:30:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604212030.u3LKUcRk026325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Apr 2016 20:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298435 - in head/sys: cam/scsi dev/ae dev/digi dev/ed i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 20:30:39 -0000 Author: pfg Date: Thu Apr 21 20:30:38 2016 New Revision: 298435 URL: https://svnweb.freebsd.org/changeset/base/298435 Log: Yet more redundant parenthesis from r298431. Mea culpa. Modified: head/sys/cam/scsi/scsi_all.c head/sys/dev/ae/if_ae.c head/sys/dev/digi/digi_isa.c head/sys/dev/ed/if_ed_hpp.c head/sys/i386/i386/i686_mem.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Apr 21 19:59:55 2016 (r298434) +++ head/sys/cam/scsi/scsi_all.c Thu Apr 21 20:30:38 2016 (r298435) @@ -4702,7 +4702,7 @@ scsi_sense_desc_sbuf(struct sbuf *sb, st { int i; - for (i = 0; i < (nitems(scsi_sense_printers)); i++) { + for (i = 0; i < nitems(scsi_sense_printers); i++) { struct scsi_sense_desc_printer *printer; printer = &scsi_sense_printers[i]; @@ -7285,8 +7285,7 @@ struct scsi_attrib_table_entry * scsi_get_attrib_entry(uint32_t id) { return (scsi_find_attrib_entry(scsi_mam_attr_table, - nitems(scsi_mam_attr_table), - id)); + nitems(scsi_mam_attr_table), id)); } int Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Thu Apr 21 19:59:55 2016 (r298434) +++ head/sys/dev/ae/if_ae.c Thu Apr 21 20:30:38 2016 (r298435) @@ -85,7 +85,7 @@ static struct ae_dev { { VENDORID_ATTANSIC, DEVICEID_ATTANSIC_L2, "Attansic Technology Corp, L2 FastEthernet" }, }; -#define AE_DEVS_COUNT (nitems(ae_devs)) +#define AE_DEVS_COUNT nitems(ae_devs) static struct resource_spec ae_res_spec_mem[] = { { SYS_RES_MEMORY, PCIR_BAR(0), RF_ACTIVE }, Modified: head/sys/dev/digi/digi_isa.c ============================================================================== --- head/sys/dev/digi/digi_isa.c Thu Apr 21 19:59:55 2016 (r298434) +++ head/sys/dev/digi/digi_isa.c Thu Apr 21 20:30:38 2016 (r298435) @@ -68,7 +68,7 @@ static u_long digi_validmem[] = { 0xf6000000, 0xf7000000, 0xf8000000, 0xf9000000, 0xfa000000, 0xfb000000, 0xfc000000, 0xfd000000, 0xfe000000, 0xff000000 }; -#define DIGI_NVALIDMEM (nitems(digi_validmem)) +#define DIGI_NVALIDMEM nitems(digi_validmem) static u_char * digi_isa_setwin(struct digi_softc *sc, unsigned int addr) Modified: head/sys/dev/ed/if_ed_hpp.c ============================================================================== --- head/sys/dev/ed/if_ed_hpp.c Thu Apr 21 19:59:55 2016 (r298434) +++ head/sys/dev/ed/if_ed_hpp.c Thu Apr 21 20:30:38 2016 (r298435) @@ -214,7 +214,7 @@ ed_probe_HP_pclanp(device_t dev, int por * Check for impossible IRQ. */ - if (irq >= (nitems(ed_hpp_intr_val))) + if (irq >= nitems(ed_hpp_intr_val)) return (ENXIO); /* Modified: head/sys/i386/i386/i686_mem.c ============================================================================== --- head/sys/i386/i386/i686_mem.c Thu Apr 21 19:59:55 2016 (r298434) +++ head/sys/i386/i386/i686_mem.c Thu Apr 21 20:30:38 2016 (r298435) @@ -113,7 +113,7 @@ static int i686_mtrrtomrt[] = { MDF_WRITEBACK }; -#define MTRRTOMRTLEN (nitems(i686_mtrrtomrt)) +#define MTRRTOMRTLEN nitems(i686_mtrrtomrt) static int i686_mtrr2mrt(int val) From owner-svn-src-all@freebsd.org Thu Apr 21 20:34:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C57CB17750; Thu, 21 Apr 2016 20:34:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37CF21F7B; Thu, 21 Apr 2016 20:34:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LKYcT9029121; Thu, 21 Apr 2016 20:34:38 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LKYcbY029119; Thu, 21 Apr 2016 20:34:38 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604212034.u3LKYcbY029119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 21 Apr 2016 20:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298436 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 20:34:39 -0000 Author: avos Date: Thu Apr 21 20:34:38 2016 New Revision: 298436 URL: https://svnweb.freebsd.org/changeset/base/298436 Log: urtwn: optimize rate lookup in the urtwn_ra_init() Replace loop with switch statement (rate2ridx()) (should be noop). Tested with RTL8188EU / RTL8188CUS, STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D4848 (rebased) Modified: head/sys/dev/urtwn/if_urtwn.c head/sys/dev/urtwn/if_urtwnreg.h Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Thu Apr 21 20:30:38 2016 (r298435) +++ head/sys/dev/urtwn/if_urtwn.c Thu Apr 21 20:34:38 2016 (r298436) @@ -1944,6 +1944,32 @@ urtwn_r88e_read_rom(struct urtwn_softc * return (0); } +static __inline uint8_t +rate2ridx(uint8_t rate) +{ + if (rate & IEEE80211_RATE_MCS) { + /* 11n rates start at idx 12 */ + return ((rate & 0xf) + 12); + } + switch (rate) { + /* 11g */ + case 12: return 4; + case 18: return 5; + case 24: return 6; + case 36: return 7; + case 48: return 8; + case 72: return 9; + case 96: return 10; + case 108: return 11; + /* 11b */ + case 2: return 0; + case 4: return 1; + case 11: return 2; + case 22: return 3; + default: return URTWN_RIDX_UNKNOWN; + } +} + /* * Initialize rate adaptation in firmware. */ @@ -1956,8 +1982,8 @@ urtwn_ra_init(struct urtwn_softc *sc) struct ieee80211_rateset *rs, *rs_ht; struct r92c_fw_cmd_macid_cfg cmd; uint32_t rates, basicrates; - uint8_t mode; - int maxrate, maxbasicrate, error, i, j; + uint8_t mode, ridx; + int maxrate, maxbasicrate, error, i; ni = ieee80211_ref_node(vap->iv_bss); rs = &ni->ni_rates; @@ -1970,19 +1996,16 @@ urtwn_ra_init(struct urtwn_softc *sc) /* This is for 11bg */ for (i = 0; i < rs->rs_nrates; i++) { /* Convert 802.11 rate to HW rate index. */ - for (j = 0; j < nitems(ridx2rate); j++) - if ((rs->rs_rates[i] & IEEE80211_RATE_VAL) == - ridx2rate[j]) - break; - if (j == nitems(ridx2rate)) /* Unknown rate, skip. */ + ridx = rate2ridx(IEEE80211_RV(rs->rs_rates[i])); + if (ridx == URTWN_RIDX_UNKNOWN) /* Unknown rate, skip. */ continue; - rates |= 1 << j; - if (j > maxrate) - maxrate = j; + rates |= 1 << ridx; + if (ridx > maxrate) + maxrate = ridx; if (rs->rs_rates[i] & IEEE80211_RATE_BASIC) { - basicrates |= 1 << j; - if (j > maxbasicrate) - maxbasicrate = j; + basicrates |= 1 << ridx; + if (ridx > maxbasicrate) + maxbasicrate = ridx; } } @@ -1992,12 +2015,12 @@ urtwn_ra_init(struct urtwn_softc *sc) if ((rs_ht->rs_rates[i] & 0x7f) > 0xf) continue; /* 11n rates start at index 12 */ - j = ((rs_ht->rs_rates[i]) & 0xf) + 12; - rates |= (1 << j); + ridx = ((rs_ht->rs_rates[i]) & 0xf) + 12; + rates |= (1 << ridx); /* Guard against the rate table being oddly ordered */ - if (j > maxrate) - maxrate = j; + if (ridx > maxrate) + maxrate = ridx; } } @@ -2802,32 +2825,6 @@ urtwn_r88e_get_rssi(struct urtwn_softc * return (rssi); } -static __inline uint8_t -rate2ridx(uint8_t rate) -{ - if (rate & IEEE80211_RATE_MCS) { - /* 11n rates start at idx 12 */ - return ((rate & 0xf) + 12); - } - switch (rate) { - /* 11g */ - case 12: return 4; - case 18: return 5; - case 24: return 6; - case 36: return 7; - case 48: return 8; - case 72: return 9; - case 96: return 10; - case 108: return 11; - /* 11b */ - case 2: return 0; - case 4: return 1; - case 11: return 2; - case 22: return 3; - default: return 0; - } -} - static int urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m, struct urtwn_data *data) Modified: head/sys/dev/urtwn/if_urtwnreg.h ============================================================================== --- head/sys/dev/urtwn/if_urtwnreg.h Thu Apr 21 20:30:38 2016 (r298435) +++ head/sys/dev/urtwn/if_urtwnreg.h Thu Apr 21 20:34:38 2016 (r298436) @@ -1242,6 +1242,7 @@ static const uint8_t ridx2rate[] = #define URTWN_RIDX_OFDM54 11 #define URTWN_RIDX_COUNT 28 +#define URTWN_RIDX_UNKNOWN (uint8_t)-1 /* From owner-svn-src-all@freebsd.org Thu Apr 21 20:37:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99BB6B178F8; Thu, 21 Apr 2016 20:37:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BA06128B; Thu, 21 Apr 2016 20:37:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LKbrUY029265; Thu, 21 Apr 2016 20:37:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LKbrNp029264; Thu, 21 Apr 2016 20:37:53 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201604212037.u3LKbrNp029264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Apr 2016 20:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298437 - head/contrib/llvm/tools/clang/tools/driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 20:37:54 -0000 Author: dim Date: Thu Apr 21 20:37:53 2016 New Revision: 298437 URL: https://svnweb.freebsd.org/changeset/base/298437 Log: Revert r298147 (temporary workaround for LLVM PR 26999) in preparation for committing the final upstream fix. Modified: head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp Modified: head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp ============================================================================== --- head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp Thu Apr 21 20:34:38 2016 (r298436) +++ head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp Thu Apr 21 20:37:53 2016 (r298437) @@ -200,7 +200,7 @@ bool AssemblerInvocation::CreateFromArgs // Any DebugInfoKind implies GenDwarfForAssembly. Opts.GenDwarfForAssembly = Args.hasArg(OPT_debug_info_kind_EQ); Opts.CompressDebugSections = Args.hasArg(OPT_compress_debug_sections); - Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 2, Diags); + Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags); Opts.DwarfDebugFlags = Args.getLastArgValue(OPT_dwarf_debug_flags); Opts.DwarfDebugProducer = Args.getLastArgValue(OPT_dwarf_debug_producer); Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir); From owner-svn-src-all@freebsd.org Thu Apr 21 20:38:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30215B1793D; Thu, 21 Apr 2016 20:38:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F40D813E4; Thu, 21 Apr 2016 20:38:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LKcBDm029324; Thu, 21 Apr 2016 20:38:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LKcBQl029323; Thu, 21 Apr 2016 20:38:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201604212038.u3LKcBQl029323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Apr 2016 20:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298438 - head/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 20:38:12 -0000 Author: dim Date: Thu Apr 21 20:38:10 2016 New Revision: 298438 URL: https://svnweb.freebsd.org/changeset/base/298438 Log: Pull r266775 from upstream clang trunk (by Douglas Katzman): Pass dwarf-version to cc1as. Fix PR26999 - crashing in cc1as with any '*bsd' target. This should fix possible crashes when using -g in combination with -save-temps. Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Thu Apr 21 20:37:53 2016 (r298437) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Thu Apr 21 20:38:10 2016 (r298438) @@ -6061,6 +6061,12 @@ void ClangAs::ConstructJob(Compilation & // FIXME: Stop lying and consume only the appropriate driver flags Args.ClaimAllArgs(options::OPT_W_Group); + // Assemblers that want to know the dwarf version can't assume a value, + // since the defaulting logic resides in the driver. Put in something + // reasonable now, in case a subsequent "-Wa,-g" changes it. + RenderDebugEnablingArgs(Args, CmdArgs, CodeGenOptions::NoDebugInfo, + getToolChain().GetDefaultDwarfVersion(), + llvm::DebuggerKind::Default); CollectArgsForIntegratedAssembler(C, Args, CmdArgs, getToolChain().getDriver()); From owner-svn-src-all@freebsd.org Thu Apr 21 20:57:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 356E2B1805F; Thu, 21 Apr 2016 20:57:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [IPv6:2607:f8b0:400e:c03::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1371FDA; Thu, 21 Apr 2016 20:57:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x233.google.com with SMTP id zm5so32465594pac.0; Thu, 21 Apr 2016 13:57:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oY4He3oYvunKLDCOlAW67DBT1NUdIulNS3njvXnLEFw=; b=dgwp1hR7EoIrwHN2laIz4BTMqTJLm4+P/HrSHUVoT9b9YvAKCmsWDYCLBnfCRqqwkV g1tWTfo9sElP6C1KYffotySM9gKqF3b1ZSxbTHU3ZrcajZrPc8qEB+bGwitEd18xXuDR SD9ellZzzUqOq0we04nFBdSh7bLp6/QeXk8G0EZHGJgPpC1iSRav0oxksmtpUtRfesG+ O6m3Ov2PjQpAiIPNP/AL5J0UdgVSsx5b64bPQS0zV7l/7GVknOHEldPyGBQe41K3NmQE lj62FYmNNUqez+pdrJzmRlLogaE6y4kEaqmeXR1aNMVMnO82TUZBi9/EyXkgISRCXX8R XsrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oY4He3oYvunKLDCOlAW67DBT1NUdIulNS3njvXnLEFw=; b=RY5kEuwGTBt9/3W6VOhRQlE4TilcVTOHZMdaJnvkdobx4UFSbmCuaW+Or5q78aV00J u0eoGuzEWnuvqmcIm4t3zE7gIqqNdaLZVGhkKFDOuWy0CFA8R7OVG29Lff942iV+TGPj 7vtVWPVjhpkdpO6qRypBPxcHHGujP8gmbPYv8RokEPPUHT6h5hZdplRywc/wS3wn53IW yO8ILcCaJsdS8BEHaNazshaBg6PIOVVh4YErX08Sn+gG9gii5LJ8EzSz/cg2LaRTRLml tvcY6q0gDvDzswdPE5qk/lR2taKNkr/il6rVaKG/0KlzK4r/gkosXguLEDEk2d4cv/yi Ks9Q== X-Gm-Message-State: AOPr4FXsi9f+BePrHHfdi+wZJr4TqvMERWfVbLpbOuDGwyQVc/UYs+cYp5zY1h50b3Gp4A== X-Received: by 10.66.250.132 with SMTP id zc4mr23641586pac.130.1461272236205; Thu, 21 Apr 2016 13:57:16 -0700 (PDT) Received: from [192.168.100.108] ([199.231.240.59]) by smtp.gmail.com with ESMTPSA id q70sm3099962pfj.81.2016.04.21.13.57.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Apr 2016 13:57:14 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298420 - head/sys/geom From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Thu, 21 Apr 2016 12:18:09 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201604211643.u3LGhFpR057982@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 20:57:17 -0000 > On Apr 21, 2016, at 10:26, Alan Somers wrote: >=20 >=20 >=20 > On Thu, Apr 21, 2016 at 11:09 AM, Ngie Cooper = wrote: > On Thu, Apr 21, 2016 at 10:08 AM, Ngie Cooper = wrote: > > On Thu, Apr 21, 2016 at 9:43 AM, Alan Somers = wrote: > >> Author: asomers > >> Date: Thu Apr 21 16:43:15 2016 > >> New Revision: 298420 > >> URL: https://svnweb.freebsd.org/changeset/base/298420 > >> > >> Log: > >> Notify userspace listeners when geom disk attributes have changed > >> > >> sys/geom/geom_disk.c: > >> disk_attr_changed(): Generate a devctl event of type = GEOM: for > >> every call. > >> > >> MFC after: 4 weeks > >> Sponsored by: Spectra Logic Corp > >> Differential Revision: https://reviews.freebsd.org/D5952 > >> > >> Modified: > >> head/sys/geom/geom_disk.c > >> > >> Modified: head/sys/geom/geom_disk.c > >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > >> --- head/sys/geom/geom_disk.c Thu Apr 21 16:33:42 2016 = (r298419) > >> +++ head/sys/geom/geom_disk.c Thu Apr 21 16:43:15 2016 = (r298420) > >> @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > >> #include > >> #include > >> #include > >> +#include > >> #include > >> #include > >> #include > >> @@ -839,11 +840,14 @@ disk_attr_changed(struct disk *dp, const > >> { > >> struct g_geom *gp; > >> struct g_provider *pp; > >> + char devnamebuf[128]; > > > > Why 128? Also, why not sbuf? > > > >> gp =3D dp->d_geom; > >> if (gp !=3D NULL) > >> LIST_FOREACH(pp, &gp->provider, provider) > >> (void)g_attr_changed(pp, attr, flag); > >> + snprintf(devnamebuf, 128, "devname=3D%s%d", dp->d_name, = dp->d_unit); > > > > Why not sizeof(devnamebuf) ? >=20 > Also: this doesn't NUL terminate devnamebuf; it really should > (otherwise, boom... crash in geom)... >=20 > snprintf(3) says "The output is always null-terminated." and it looks = like the kernel version does the same thing at subr_prf.c:560. Am I = missing something? Derp. Forgot that NUL termination occurs with snprintf as long as the = buffer size is specified and is correct. Please ignore this part..= From owner-svn-src-all@freebsd.org Thu Apr 21 21:13:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A769B1881A; Thu, 21 Apr 2016 21:13:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0802D1D6B; Thu, 21 Apr 2016 21:13:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LLDgUl041379; Thu, 21 Apr 2016 21:13:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LLDgtv041378; Thu, 21 Apr 2016 21:13:42 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604212113.u3LLDgtv041378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 21 Apr 2016 21:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298439 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 21:13:43 -0000 Author: asomers Date: Thu Apr 21 21:13:41 2016 New Revision: 298439 URL: https://svnweb.freebsd.org/changeset/base/298439 Log: DRY on buffer sizes. Update to r298420. sys/geom/geom_disk.c: In disk_attr_changed, don't repeat a buffer size. Reported by: ngie, hselasky MFC after: 4 weeks X-MFC-With: 298420 Sponsored by: Spectra Logic Corp Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Thu Apr 21 20:38:10 2016 (r298438) +++ head/sys/geom/geom_disk.c Thu Apr 21 21:13:41 2016 (r298439) @@ -846,7 +846,8 @@ disk_attr_changed(struct disk *dp, const if (gp != NULL) LIST_FOREACH(pp, &gp->provider, provider) (void)g_attr_changed(pp, attr, flag); - snprintf(devnamebuf, 128, "devname=%s%d", dp->d_name, dp->d_unit); + snprintf(devnamebuf, sizeof(devnamebuf), "devname=%s%d", dp->d_name, + dp->d_unit); devctl_notify("GEOM", "disk", attr, devnamebuf); } From owner-svn-src-all@freebsd.org Thu Apr 21 21:30:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFFDFB18B8C; Thu, 21 Apr 2016 21:30:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1652130E; Thu, 21 Apr 2016 21:30:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3LLUp9d044545; Thu, 21 Apr 2016 21:30:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3LLUpiU044544; Thu, 21 Apr 2016 21:30:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604212130.u3LLUpiU044544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Apr 2016 21:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298440 - head/usr.bin/sed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 21:30:52 -0000 Author: pfg Date: Thu Apr 21 21:30:51 2016 New Revision: 298440 URL: https://svnweb.freebsd.org/changeset/base/298440 Log: kernel: use our nitems() macro when it is available through param.h. No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current Modified: head/usr.bin/sed/compile.c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Thu Apr 21 21:13:41 2016 (r298439) +++ head/usr.bin/sed/compile.c Thu Apr 21 21:30:51 2016 (r298440) @@ -160,10 +160,10 @@ compile_stream(struct s_command **link) char re[_POSIX2_LINE_MAX + 1]; int naddr; /* Number of addresses */ - stack = 0; + stack = NULL; for (;;) { if ((p = cu_fgets(lbuf, sizeof(lbuf), NULL)) == NULL) { - if (stack != 0) + if (stack != NULL) errx(1, "%lu: %s: unexpected EOF (pending }'s)", linenum, fname); return (link); @@ -203,9 +203,9 @@ semicolon: EATSPACE(); p = compile_addr(p, cmd->a2); EATSPACE(); } else - cmd->a2 = 0; + cmd->a2 = NULL; } else - cmd->a1 = cmd->a2 = 0; + cmd->a1 = cmd->a2 = NULL; nonsel: /* Now parse the command */ if (!*p) @@ -241,7 +241,7 @@ nonsel: /* Now parse the command */ * group is really just a noop. */ cmd->nonsel = 1; - if (stack == 0) + if (stack == NULL) errx(1, "%lu: %s: unexpected }", linenum, fname); cmd2 = stack; stack = cmd2->next; From owner-svn-src-all@freebsd.org Thu Apr 21 21:35:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B14C1B18D5D for ; Thu, 21 Apr 2016 21:35:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm7.bullet.mail.bf1.yahoo.com (nm7.bullet.mail.bf1.yahoo.com [98.139.212.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B9501862 for ; Thu, 21 Apr 2016 21:35:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461274541; bh=47t/0dJDGsAwu4xWTpjQB/bhgvED4uogEyyHqeRVo7c=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=en4CDXrLT6aBzPqazpBMjTjcSAgGiUZTfA5YLgWlnRLTkovUViEuNWpbBcp4vdz4DaQbyzyJg2RK9WsNGP3mWjsfDuY/J2u+eqyJZyaeli/KnuNUcBYip/6xagzNjoWHf6wq/HRErwh/48l2c32rigjEQO8ACaYSYmTKLpC+TaGsamAJYjlbIDFsCS9EpL1QBdg4QIbNcMUNJJGvoA17Fnrioa9iBtTHcIShPFSdg+0FcHPObzTPjZB9Ohs0JQUkTjRAfZ+e+5YRlSNH2XaBSpOTqwx3Sza8P2EaRjPd73EwkvgQ8qDQrZZbK99kAKW2rwGHBYRv23gnqlCLtEFzPA== Received: from [66.196.81.172] by nm7.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 21:35:41 -0000 Received: from [68.142.230.74] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 21:35:41 -0000 Received: from [127.0.0.1] by smtp231.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 21:35:41 -0000 X-Yahoo-Newman-Id: 876063.6936.bm@smtp231.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: RfY_BcoVM1ljP1oYsy.fJKTq6NsojxqaL7pN5OvUjCUm9bB 82obO0wrnflJEhEbgaaEL4UVd0Pg_kkEH7nDZ4xsEvjtYaDA.VyDoQ1EJYDL TKodBwB9r4jxxBnNp1qXVuZpCyeYN9xvWG4Ig1UgZIl76C86DXWlK8Ji1GzE 5JoH2n5iQriApqMdpNMxZxq2FI9dFMTtwhOxc_ZRiUEyxnPX_ceyjxQrVInB fgvAft.kYfhbXwHd1m0.MGZRtqyQkE1c7uupKzh9RSGHPn9jO7TBKoS8quWN P4atCt.fWKqrYRAzXB1nNQCztMXH_CM_TH37tTRUWzQ9oUFg9skcT7tby_wT llZqd2v3JQQjcXBOki2DvB7KUa4Hpnus9yYy7toB5BsQNuSsrSEdlKWZ.I5_ lh57pk7Bz7b6UZxpSXvciAzI1V_c2DEePq9bAv1We7CGqYQu3NDYTI.qN.S2 D4fjY789HnXnRtg3e_DDHlmxLa2Q17uLrrrkRWk0I2q6fSxhmWauy1N5FTMe wuWMb9h3qpvrv9ojtXu9uVMS8tMirT5Y0 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298440 - head/usr.bin/sed To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604212130.u3LLUpiU044544@repo.freebsd.org> From: Pedro Giffuni Message-ID: <145b413d-b9d6-a759-9135-83328003acaf@FreeBSD.org> Date: Thu, 21 Apr 2016 16:35:49 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201604212130.u3LLUpiU044544@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 21:35:49 -0000 Oops wrong log message.... It's supposed to be: sed: use NULL instead of zero for pointers. On 04/21/16 16:30, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Apr 21 21:30:51 2016 > New Revision: 298440 > URL: https://svnweb.freebsd.org/changeset/base/298440 > > Log: > kernel: use our nitems() macro when it is available through param.h. > > No functional change, only trivial cases are done in this sweep, > > Discussed in: freebsd-current > > Modified: > head/usr.bin/sed/compile.c > > Modified: head/usr.bin/sed/compile.c > ============================================================================== > --- head/usr.bin/sed/compile.c Thu Apr 21 21:13:41 2016 (r298439) > +++ head/usr.bin/sed/compile.c Thu Apr 21 21:30:51 2016 (r298440) > @@ -160,10 +160,10 @@ compile_stream(struct s_command **link) > char re[_POSIX2_LINE_MAX + 1]; > int naddr; /* Number of addresses */ > > - stack = 0; > + stack = NULL; > for (;;) { > if ((p = cu_fgets(lbuf, sizeof(lbuf), NULL)) == NULL) { > - if (stack != 0) > + if (stack != NULL) > errx(1, "%lu: %s: unexpected EOF (pending }'s)", > linenum, fname); > return (link); > @@ -203,9 +203,9 @@ semicolon: EATSPACE(); > p = compile_addr(p, cmd->a2); > EATSPACE(); > } else > - cmd->a2 = 0; > + cmd->a2 = NULL; > } else > - cmd->a1 = cmd->a2 = 0; > + cmd->a1 = cmd->a2 = NULL; > > nonsel: /* Now parse the command */ > if (!*p) > @@ -241,7 +241,7 @@ nonsel: /* Now parse the command */ > * group is really just a noop. > */ > cmd->nonsel = 1; > - if (stack == 0) > + if (stack == NULL) > errx(1, "%lu: %s: unexpected }", linenum, fname); > cmd2 = stack; > stack = cmd2->next; > From owner-svn-src-all@freebsd.org Fri Apr 22 02:21:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B61D3B1895A; Fri, 22 Apr 2016 02:21:40 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0106.outbound.protection.outlook.com [207.46.100.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DA2011A6; Fri, 22 Apr 2016 02:21:39 +0000 (UTC) (envelope-from jtl@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-junipernetworks-onmicrosoft-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GnANqxYwjkeW67PI1U7vaaST73QzZiMO85ZD+/l6+rY=; b=b5u3yR1V1yqKD4aibXZA2YxB53diaFFjmKGYNweZfb7F3/944tH8KMMuGH8P7QlTHf6qoFLblmgysf4OyJ65TxVeblgwZy0RttGhxtaKhklCecME2hZOhQDRHEBKOci6cH0fYSKQYY2WLhxOAo8qZKrOjHHYfGGj+Y/j/6khMMA= Received: from SN1PR05CA0012.namprd05.prod.outlook.com (10.163.68.150) by SN2PR0501MB816.namprd05.prod.outlook.com (10.160.14.139) with Microsoft SMTP Server (TLS) id 15.1.466.19; Fri, 22 Apr 2016 02:21:33 +0000 Received: from BN1BFFO11FD037.protection.gbl (2a01:111:f400:7c10::1:198) by SN1PR05CA0012.outlook.office365.com (2a01:111:e400:5197::22) with Microsoft SMTP Server (TLS) id 15.1.466.19 via Frontend Transport; Fri, 22 Apr 2016 02:21:32 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.19) by BN1BFFO11FD037.mail.protection.outlook.com (10.58.144.100) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Fri, 22 Apr 2016 02:21:32 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 21 Apr 2016 19:21:30 -0700 Received: from [172.29.34.127] (rcallon-sslvpn-nc.jnpr.net [172.29.34.127]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u3M2LPZ31130; Thu, 21 Apr 2016 19:21:25 -0700 (PDT) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/f.15.1.160411 Date: Thu, 21 Apr 2016 22:21:24 -0400 Subject: Re: svn commit: r298408 - head/sys/netinet From: "Jonathan T. Looney" Sender: Jonathan Looney To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" CC: Message-ID: <5E4878D9-56FC-41FA-8D06-EB2CB72097C6@juniper.net> Thread-Topic: svn commit: r298408 - head/sys/netinet References: <201604211506.u3LF6s9t017204@repo.freebsd.org> In-Reply-To: <201604211506.u3LF6s9t017204@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(199003)(189002)(24454002)(13624006)(377454003)(2950100001)(16796002)(6806005)(230700001)(1096002)(76176999)(54356999)(1220700001)(50986999)(189998001)(23676002)(2501003)(586003)(19580405001)(19580395003)(92566002)(5820100001)(36756003)(2201001)(82746002)(87936001)(86362001)(11100500001)(5001770100001)(105596002)(106466001)(4001350100001)(4326007)(9686002)(50466002)(47776003)(15975445007)(33656002)(83716003)(77096005)(2906002)(83506001)(81166005)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:SN2PR0501MB816; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD037; 1:VOLMylGeXmmMielArPGooRzFU/nD1eJ0EKGiB1qXFVoc54PjHFqIMJ3oAVqcrq8roEGSVpPF5qKLwRTM0RcGxxUC7hJCQYA9YDR3MUGDPUY0VMIzf/mIuy96lk1Jyy9TEdADCvp66CEOjTXi90yJdBPQ3kMzFqLILQRuM+tjg64t9L0eDa38V0X7ZUHklyvjbkf8ZYb7V8mt4AN/bExdWj8drq93qP4P6oL6T22fhtmDunGqmnTMq3WY/XRhlnuZx3bIl+QjLkeFgUagNWwtsTXgOBXN9xmrAimdvDUrSTtudabKr3Vs784atzNNp+RGs2VcJ8Dgs4ZtR4SM66q2RhR4gUihKeAW/5jggLGcXCgJUsHbKrEdXUYg5E2OdisCZ0z3IyyChotze6LrNgtxuUBs74YvVN2CpH64MLCfY37A/W0wEht45KbmKXH4djPCjolE9lMbZZmpSVjAE5JFqgR3UMuEZow6ddYdGPtVsD/8c7+her/GzZGzbKlzVonivAL+4ccCwQCn5UFFOE9A0hyL4CkorJo+QOM+qU3KXgM= X-MS-Office365-Filtering-Correlation-Id: 328a5711-e066-45c5-e77f-08d36a54d235 X-Microsoft-Exchange-Diagnostics: 1; SN2PR0501MB816; 2:tveagSQdAgQN21QWLl9nw5WyhCcKnE+AYuwUqt2GwVrkZC000/v0qh3VluLKpr6Q4ReGlNNUlP+JXB9WqqhjuSIVdUhAJSU1CcTwy5Y3mOfku1ZOXQVO3jjJNkIp6mhQJ2r3+gqsQhba65h7W6pH+NNlaYx0n0RjbB1f7JKuYqwEx8OxKih5Db4ZRJp5ZY0r; 3:UJaZBS09JYTH4F01r/PSRun97+uIpQmgL5zti7SK/ZKV7XdrJpnyRNgxCKh2f9T8IoSYtlF8r0vX02SnklyprIq/hBu2DHlh/AmKouCYqEkw1s49am/zCHOB/RyW5fn/4QUSJSY4ieowDOuBjYsZ4yggVE3aTpe5oj53lisznZiPbnxrfZ13qORmRXc4TcJZy9O7KRCBAVMdaPAhadRtBxCdFtiQen2XB7AQP0CcYVY=; 25:B8vyeVCmt4Eb3da+/42gn3pIVtEfs9mYA6EwRuc95/vgnULnczsYCjejvsVMChVUeX3bHPhHH94lYvIRD8TRefd+rc/eKLq++96oiqP/SybUQeZcnphdNjcArsYWpovGHx77+o5xKsoph0DlsFI/+ftYesPvbPqMp+9jhOWow73R49IWLfbSjUAPRwT/P7Ac/Y1LTvLfRhUCMXY/AWaBpdOY2PrebEItBrsseKJf4feHJ6/Ssi3rAW0yyuAwkNfEFzUholx9pexfsGCFvF+Gsp9eq6QBKf6mHutb0WJwmRGBASRsh0Rxkb55OgrDezw4E9tg+D7iexR/o+teKQemaQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR0501MB816; X-JNPR-Received-From: outside X-Microsoft-Exchange-Diagnostics: 1; SN2PR0501MB816; 20:yYPC8Q8itUU5XFbhEEMtwRQzEC5hnjLHmdQjohNGwnneQv+u6i8fu1q1Grmu4XNa0yRMG2yzawuQY2VOZCfchQpYIc01JHZYilSBXGJ8EX1X7UhaRkOA5K8ygirUlLZrWe0OL4SOCoOC9P+3RVOPydXr6mh/DXcvuPLo7q47mOjGwPjMmvsErGqrMLR0TWKALkE8N3Jjq3+1ZobHHjmO2ndDgZhIfW5JoDQDADWnEjuyTdCv5Lc2Fh17L0twnt569SGIO22M340F1ldjRq6kEXxjWLHRHL6LRTQ7+xk2u//pqha5QSnoC4bprZP0WacqDQnwU7oVJF5f3Wu1rSA+T4iMBT67yWtrVpH0T3rRwRktLMK+tZ+aREv4S7vvn5UcNhfKzizYKTBYVx9qeeSr4YHzPJUmCpWjnrdN6DKMI/ne2gSLFO/vX1qPh+z5L2c3YB2Os6IrCVwEZKbwJn0c6XVPf1gyEiE8FyCKiX+I2HAXt1WqaQW66NcadbgUav2M X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13024025)(13015025)(8121501046)(13018025)(5005006)(13023025)(10201501046)(3002001)(6055026); SRVR:SN2PR0501MB816; BCL:0; PCL:0; RULEID:; SRVR:SN2PR0501MB816; X-Microsoft-Exchange-Diagnostics: 1; SN2PR0501MB816; 4:JRqz2XxgNlMEl3adpFu6ivZYVwJTagvVZN/F3iTmq/DEqg6Wp5VeVOXIaZXsrOEnu1TLZnjJKn+6rHJL1UqlJ1vPfGFM9UhFqnr4DdCatt8iAsQLTq6BvQyFpYrLOwJIsIbLPQkhNrE3V3VhuYySSanVpHLpdZfKzJ/9araiP3aR+9+oxayq9zQFnbHoK2uyv/4LqnYSSxzuiAwHwyujRq/+3tMd8C8URXQ5X+I+OdGmmhXl2A4ua5h7rVVBYmw67dMuoVO5AM0DzNfznnmCP0iCFPy8whdpBjxkAr1g2SntqB4grUbtscvGqsAlYzlspIqicN4Z0IjGZBMZz/iGHas7iIbPvQRvsOSZdJY+EyVBQP7j17UNP1WKAM/CAaIaxUFi2Do25/9LPraItfjb4W5H2JIIlrclFNG+BIJsOLh7MSlygCDVxcDBGsakINmVzbCbpiil0/dSSERT3i8/wJR3u5dm1tcguRekQyGbu6U= X-Forefront-PRVS: 0920602B08 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjJQUjA1MDFNQjgxNjsyMzpsZHBkV1RJckNhdWNONjRkWUxYdW9hK0Jj?= =?utf-8?B?aWtibjdySVQzeVJScFZwT1paa3FhbHk2aGkvcTQrRFc3UUNic2tla0FFYklM?= =?utf-8?B?cVlMUVplQmRSYWVOZTRHNUh4SVpFeGRqL2d1VXJpMkQvUVlQQ3NPSlBteGUz?= =?utf-8?B?SjllRWpqVWVrVEJXVE1zVitub2o0cXVCYnZlU21vMXQrdnFCempJa251ektm?= =?utf-8?B?VFZJdkxIMU9pRkRwYzlna2NnWHZ5OFpHYWNKNzlBbGs1RmZyTjVUSHFMUTJv?= =?utf-8?B?QlJCWlFXRnlUeHlkR2NLSmlsanlsQzNLMlBwTG1oOUFtZGpzM3ZraytCdFVU?= =?utf-8?B?eG9qVklueHdxSzdNZllTRnkyUEEvVHE4ckE4Um1DVWtLMU9CbVJUSmpHb1FK?= =?utf-8?B?eEc2ZzJSQTFINkxpS05GT2gyZ0pSSDVHZEVzUExyOTJhS0JrVjFVUW1yNjVU?= =?utf-8?B?UjJ1TmpaTUFXSjJkWFJMZS90eVY4Z1lSYm12V25MaU5oNmZiY0xrRUQvT2ZZ?= =?utf-8?B?V3B0L0c5aFFvQVJ2YnBTcGkwMkxxUFczWFc3KzMrbmFsYnRuZ1QzWVU4Vzl1?= =?utf-8?B?Q1ZZZDFQZXd6MGVvMklOQVY3bWt4YWJWZ2hiV1hrUGIzR2VpTlJCSEh6ekw2?= =?utf-8?B?WVhGSEE0aFFOTERKQ00rUUdGaE9Ua1NFaVU3M3NsT01HcXd3dkRQRjgxbzVy?= =?utf-8?B?WHJoVWxJcUZVRVQwcU9EMytVQmdoUUFSODNtQXRQcnhWYUxqbkFRbnpVNDRh?= =?utf-8?B?QnlKWk9WdmE3bnFXNk9vTnhmc2dEcDA4UzhCU1VWVmZxWFJlVGk5TGFDb1JG?= =?utf-8?B?eDloVlV6ejlvSFIzNWRLSTB4aXNIdS9YZXRXZDlrd2t6bG1YSS9kMFJabTBa?= =?utf-8?B?M1orRzJWK2RnWnlFZjYvTzFHTjEydTFXUlJyQ1gwM3FTa2R4L1BRRHhZTFBX?= =?utf-8?B?MTJKKytXdkNUZkhwUjB6NDkzQnF6cElNdmFSaGFSci93WVhCck1ESS90UDNm?= =?utf-8?B?Z3lhd0hwVmxQd2VWWkkyTlZMQjdpeUxneThLWk1XaDAvV25qZTB2Qk5neXBR?= =?utf-8?B?UVBldElHQW1LekJRcC9QWitiUTZTanZmVHg0d2cwR2JXZ1ppUnQzYXpGbFU1?= =?utf-8?B?VnV2YnlMVkYwMUp5dnJBMkZ0RnM3b21tSlYrOFRZcjdPZTU5cVlBQmJSWmhQ?= =?utf-8?B?VXV6VW1abjlCZEw0MFNjWUJDMEF0TVZuUnFtblFHNmhkZjE2Q3VBRjZtNDVR?= =?utf-8?B?RkFSM3hpM1pNZHJIN2wvcDdKQUdDcmEwbnkzSlZCeFpHVDdoTnR0UnVJUXdC?= =?utf-8?B?Y1JHRmRaSmZPcWpmemNSWW8yZFlyRlVXRG8yNjcyM1Nsb2JzSHF5RUlTVUlH?= =?utf-8?B?SG5VUTFkRm83dURMUVJUb3JtRDR5eXl1LzFSZFpMcm9oOStQVXp3NUpabms1?= =?utf-8?B?TjFBMFlJSVVYVDlDOGk4dFhXOVZUdWpGa3VHNW8zbC85b0c5TEwyb3JlTXFV?= =?utf-8?B?RXlCYUtlMzFpYlhUU0VwbFNWcHVqS0JkYlJGdGJFTzl2K2lVM2RaR2l2ckNY?= =?utf-8?B?NmhiRGFXR2dwYVVpZWlVYlBmcURrSjVVVnFxbHVNTVBVdC8vT0lZMi85TVNN?= =?utf-8?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN2PR0501MB816; 5:MkfQjpiPBUetmP5F2RyjpU9ScKE9f75PlNPSr401tSnst3sMoc/s6E8s7/94Z12pn1SIuWH5pqGzIoTi7o5tKq1rT3nW7O0jV/E7bKJvN6jGBHdJUQ4taIi9l3QIJTDSA8Z8vjzHR8Q8xLSoKoqLVDpm3e7Sdw0a7v0Dd9idlZE6m2QzzZGL8xPlxioZXRwD; 24:6knDpRJcDfTi+3pNFVCLmt8oaP5OxkVQ6Pmcqxd2zDjQaPGwu7kQYLvlePs2cV5rqXHXb2eVCihK1VRsYw+1/ICnuSfNk+gsaN11Lpnrp9w=; 7:ebF1eW06ktu4jfd0eQRSf0i9lsDT4vxtvyeI7E8dBy8zm82hrRxoOxDCx8dT4e8JQJQ+3pK5Kr80dcgT7p1T29xGdr60yV4Mph5e9Dy7jgIYU+a0z6rZQ/mOEmZKmYKecsciHATC8xTju4uEQToitxOho4M19fOhLlu8lO85ZAp+f4dGa6+1Lvt1IxmdKMIN7c5bWXGaP1+mZGJ9Kx33zMrTOXYPvYlNVyWcK98GcT4= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2016 02:21:32.2173 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR0501MB816 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 02:21:40 -0000 On 4/21/16, 11:06 AM, "owner-src-committers@freebsd.org on behalf of Jonathan T. Looney" wrote: >Author: jtl >Date: Thu Apr 21 15:06:53 2016 >New Revision: 298408 >URL: https://svnweb.freebsd.org/changeset/base/298408 > >Log: > Prevent underflows in tp->snd_wnd if the remote side ACKs more than > tp->snd_wnd. This can happen, for example, when the remote side responds to > a window probe by ACKing the one byte it contains. > > Differential Revision: https://reviews.freebsd.org/D5625 > Reviewed by: hiren > Obtained from: Juniper Networks (earlier version) > MFC after: 2 weeks > Sponsored by: Juniper Networks This should also have said: Submitted by: srushti.gs14@gmail.com (earlier version) Jonathan > >Modified: > head/sys/netinet/tcp_input.c > >Modified: head/sys/netinet/tcp_input.c >============================================================================== >--- head/sys/netinet/tcp_input.c Thu Apr 21 15:02:57 2016 (r298407) >+++ head/sys/netinet/tcp_input.c Thu Apr 21 15:06:53 2016 (r298408) >@@ -2754,6 +2754,9 @@ process_ACK: > INP_WLOCK_ASSERT(tp->t_inpcb); > > acked = BYTES_THIS_ACK(tp, th); >+ KASSERT(acked >= 0, ("%s: acked unexepectedly negative " >+ "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__, >+ tp->snd_una, th->th_ack, tp, m)); > TCPSTAT_INC(tcps_rcvackpack); > TCPSTAT_ADD(tcps_rcvackbyte, acked); > >@@ -2823,13 +2826,19 @@ process_ACK: > > SOCKBUF_LOCK(&so->so_snd); > if (acked > sbavail(&so->so_snd)) { >- tp->snd_wnd -= sbavail(&so->so_snd); >+ if (tp->snd_wnd >= sbavail(&so->so_snd)) >+ tp->snd_wnd -= sbavail(&so->so_snd); >+ else >+ tp->snd_wnd = 0; > mfree = sbcut_locked(&so->so_snd, > (int)sbavail(&so->so_snd)); > ourfinisacked = 1; > } else { > mfree = sbcut_locked(&so->so_snd, acked); >- tp->snd_wnd -= acked; >+ if (tp->snd_wnd >= (u_long) acked) >+ tp->snd_wnd -= acked; >+ else >+ tp->snd_wnd = 0; > ourfinisacked = 0; > } > /* NB: sowwakeup_locked() does an implicit unlock. */ > > From owner-svn-src-all@freebsd.org Fri Apr 22 03:32:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 307CAB18C57; Fri, 22 Apr 2016 03:32:16 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFC5B1447; Fri, 22 Apr 2016 03:32:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M3WFJf055445; Fri, 22 Apr 2016 03:32:15 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M3WF2S055444; Fri, 22 Apr 2016 03:32:15 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604220332.u3M3WF2S055444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 22 Apr 2016 03:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298441 - head/sbin/fsck_msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 03:32:16 -0000 Author: araujo Date: Fri Apr 22 03:32:14 2016 New Revision: 298441 URL: https://svnweb.freebsd.org/changeset/base/298441 Log: Use macro MAX() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/fsck_msdosfs/dir.c Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Thu Apr 21 21:30:51 2016 (r298440) +++ head/sbin/fsck_msdosfs/dir.c Fri Apr 22 03:32:14 2016 (r298441) @@ -223,7 +223,7 @@ resetDosDirSection(struct bootblock *boo b1 = boot->bpbRootDirEnts * 32; b2 = boot->bpbSecPerClust * boot->bpbBytesPerSec; - if ((buffer = malloc(len = b1 > b2 ? b1 : b2)) == NULL) { + if ((buffer = malloc(len = MAX(b1, b2))) == NULL) { perr("No space for directory buffer (%zu)", len); return FSFATAL; } From owner-svn-src-all@freebsd.org Fri Apr 22 03:37:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 249F2B18DA5; Fri, 22 Apr 2016 03:37:29 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB37F178C; Fri, 22 Apr 2016 03:37:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M3bStk055666; Fri, 22 Apr 2016 03:37:28 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M3bSu3055665; Fri, 22 Apr 2016 03:37:28 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604220337.u3M3bSu3055665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 22 Apr 2016 03:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298442 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 03:37:29 -0000 Author: araujo Date: Fri Apr 22 03:37:27 2016 New Revision: 298442 URL: https://svnweb.freebsd.org/changeset/base/298442 Log: Use macro MAX() from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/netstat/sctp.c Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Fri Apr 22 03:32:14 2016 (r298441) +++ head/usr.bin/netstat/sctp.c Fri Apr 22 03:37:27 2016 (r298442) @@ -349,7 +349,7 @@ sctp_process_tcb(struct xsctp_tcb *xstcb xo_open_list("address"); xl = LIST_FIRST(&xladdr_head); xr = LIST_FIRST(&xraddr_head); - x_max = (xl_total > xr_total) ? xl_total : xr_total; + x_max = MAX(xl_total, xr_total); for (i = 0; i < x_max; i++) { xo_open_instance("address"); From owner-svn-src-all@freebsd.org Fri Apr 22 03:43:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A01B18F51; Fri, 22 Apr 2016 03:43:07 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3AE11BCE; Fri, 22 Apr 2016 03:43:07 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M3h6vv058754; Fri, 22 Apr 2016 03:43:06 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M3h69m058753; Fri, 22 Apr 2016 03:43:06 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604220343.u3M3h69m058753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 22 Apr 2016 03:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298443 - head/usr.bin/stat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 03:43:07 -0000 Author: araujo Date: Fri Apr 22 03:43:06 2016 New Revision: 298443 URL: https://svnweb.freebsd.org/changeset/base/298443 Log: Use macro MAX() from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Fri Apr 22 03:37:27 2016 (r298442) +++ head/usr.bin/stat/stat.c Fri Apr 22 03:43:06 2016 (r298443) @@ -1025,7 +1025,7 @@ format1(const struct stat *st, * * Nanoseconds: long. */ - (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ? 9 : prec); + (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec)); (void)strcat(lfmt, tmp); /* From owner-svn-src-all@freebsd.org Fri Apr 22 03:46:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85C59B17078; Fri, 22 Apr 2016 03:46:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 466EF1DE7; Fri, 22 Apr 2016 03:46:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M3kvB0058930; Fri, 22 Apr 2016 03:46:57 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M3kvbW058929; Fri, 22 Apr 2016 03:46:57 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604220346.u3M3kvbW058929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 22 Apr 2016 03:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298444 - head/usr.bin/vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 03:46:58 -0000 Author: araujo Date: Fri Apr 22 03:46:57 2016 New Revision: 298444 URL: https://svnweb.freebsd.org/changeset/base/298444 Log: Use MIN() macro from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Fri Apr 22 03:43:06 2016 (r298443) +++ head/usr.bin/vmstat/vmstat.c Fri Apr 22 03:46:57 2016 (r298444) @@ -884,7 +884,7 @@ printhdr(int maxid, u_long cpumask) { int i, num_shown; - num_shown = (num_selected < maxshowdevs) ? num_selected : maxshowdevs; + num_shown = MIN(num_selected, maxshowdevs); if (hflag) { xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); } else { From owner-svn-src-all@freebsd.org Fri Apr 22 03:55:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F19C9B1752B; Fri, 22 Apr 2016 03:55:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C21761359; Fri, 22 Apr 2016 03:55:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M3tX5M061829; Fri, 22 Apr 2016 03:55:33 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M3tXXl061828; Fri, 22 Apr 2016 03:55:33 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604220355.u3M3tXXl061828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 22 Apr 2016 03:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298445 - head/usr.sbin/moused X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 03:55:35 -0000 Author: araujo Date: Fri Apr 22 03:55:33 2016 New Revision: 298445 URL: https://svnweb.freebsd.org/changeset/base/298445 Log: Use macro MAX() from sys/param.h. MFC after: 2 weeks. Modified: head/usr.sbin/moused/moused.c Modified: head/usr.sbin/moused/moused.c ============================================================================== --- head/usr.sbin/moused/moused.c Fri Apr 22 03:46:57 2016 (r298444) +++ head/usr.sbin/moused/moused.c Fri Apr 22 03:55:33 2016 (r298445) @@ -2986,7 +2986,7 @@ pnpgets(char *buf) connect_idle: /* we may still have something in the buffer */ - return ((i > 0) ? i : 0); + return (MAX(i, 0)); } static int From owner-svn-src-all@freebsd.org Fri Apr 22 05:01:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58586B185FE; Fri, 22 Apr 2016 05:01:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2453D1B14; Fri, 22 Apr 2016 05:01:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M51kfk082358; Fri, 22 Apr 2016 05:01:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M51hH5082334; Fri, 22 Apr 2016 05:01:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604220501.u3M51hH5082334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 22 Apr 2016 05:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298446 - in head/sys/dev/hyperv: include netvsc storvsc utilities vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 05:01:47 -0000 Author: sephe Date: Fri Apr 22 05:01:43 2016 New Revision: 298446 URL: https://svnweb.freebsd.org/changeset/base/298446 Log: hyperv: Update copyright to 2016 for the files Microsoft changed in 2016 Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6039 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_kvp.h head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/utilities/hv_util.h head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_et.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_ring_buffer.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/include/hyperv.h Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2010-2012 Citrix Inc. * Copyright (c) 2012 NetApp Inc. * All rights reserved. Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2010-2012 Citrix Inc. * Copyright (c) 2012 NetApp Inc. * All rights reserved. Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2010-2012 Citrix Inc. - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * All rights reserved. * Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2010-2012 Citrix Inc. * Copyright (c) 2012 NetApp Inc. * All rights reserved. Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2010-2012 Citrix Inc. * Copyright (c) 2012 NetApp Inc. * All rights reserved. Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2010-2012 Citrix Inc. * Copyright (c) 2012 NetApp Inc. * All rights reserved. Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2014,2016 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2014,2016 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/hyperv/utilities/hv_kvp.h ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.h Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/utilities/hv_kvp.h Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2014,2016 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2014,2016 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2014,2016 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/utilities/hv_util.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2014,2016 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/hyperv/utilities/hv_util.h ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.h Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/utilities/hv_util.h Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/vmbus/hv_et.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Microsoft Corp. + * Copyright (c) 2015,2016 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri Apr 22 03:55:33 2016 (r298445) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri Apr 22 05:01:43 2016 (r298446) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2009-2012,2016 Microsoft Corp. * Copyright (c) 2012 NetApp Inc. * Copyright (c) 2012 Citrix Inc. * All rights reserved. From owner-svn-src-all@freebsd.org Fri Apr 22 05:08:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03345B18800; Fri, 22 Apr 2016 05:08:00 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB2A51DB3; Fri, 22 Apr 2016 05:08:00 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M57xIW082593; Fri, 22 Apr 2016 05:07:59 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M57xlb082592; Fri, 22 Apr 2016 05:07:59 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604220507.u3M57xlb082592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 22 Apr 2016 05:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298447 - head/usr.sbin/pmccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 05:08:01 -0000 Author: araujo Date: Fri Apr 22 05:07:59 2016 New Revision: 298447 URL: https://svnweb.freebsd.org/changeset/base/298447 Log: Use macro MAX() from sys/param.h. MFC after: 2 weeks. Modified: head/usr.sbin/pmccontrol/pmccontrol.c Modified: head/usr.sbin/pmccontrol/pmccontrol.c ============================================================================== --- head/usr.sbin/pmccontrol/pmccontrol.c Fri Apr 22 05:01:43 2016 (r298446) +++ head/usr.sbin/pmccontrol/pmccontrol.c Fri Apr 22 05:07:59 2016 (r298447) @@ -141,7 +141,7 @@ pmcc_do_enable_disable(struct pmcc_op_li err(EX_OSERR, "Unable to determine the number of PMCs in CPU %d", c); - npmc = t > npmc ? t : npmc; + npmc = MAX(t, npmc); } if (npmc == 0) From owner-svn-src-all@freebsd.org Fri Apr 22 05:14:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 986E2B189D1; Fri, 22 Apr 2016 05:14:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5318B1189; Fri, 22 Apr 2016 05:14:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M5ECdm085610; Fri, 22 Apr 2016 05:14:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M5EC0Z085609; Fri, 22 Apr 2016 05:14:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604220514.u3M5EC0Z085609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 05:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298448 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 05:14:13 -0000 Author: ngie Date: Fri Apr 22 05:14:12 2016 New Revision: 298448 URL: https://svnweb.freebsd.org/changeset/base/298448 Log: Don't leak `string` in parse_define(..) when a macro has been found and the parser token != TOK_ASSIGN MFC after: 1 week CID: 1007187, 1007188 Reported by: Coverity Obtained from: Isilon OneFS (part of r445479) Submitted by: Miles Ohlrich Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/config.c Modified: head/contrib/bsnmp/snmpd/config.c ============================================================================== --- head/contrib/bsnmp/snmpd/config.c Fri Apr 22 05:07:59 2016 (r298447) +++ head/contrib/bsnmp/snmpd/config.c Fri Apr 22 05:14:12 2016 (r298448) @@ -1150,7 +1150,8 @@ parse_define(const char *varname) free(m->value); m->value = string; m->length = length; - } + } else + free(string); } token = TOK_EOL; From owner-svn-src-all@freebsd.org Fri Apr 22 05:16:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9130EB18A93; Fri, 22 Apr 2016 05:16:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53ABE1307; Fri, 22 Apr 2016 05:16:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M5Fx5F085718; Fri, 22 Apr 2016 05:15:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M5FxNq085715; Fri, 22 Apr 2016 05:15:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604220515.u3M5FxNq085715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 22 Apr 2016 05:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298449 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 05:16:00 -0000 Author: sephe Date: Fri Apr 22 05:15:59 2016 New Revision: 298449 URL: https://svnweb.freebsd.org/changeset/base/298449 Log: hyperv/et: Make Hyper-V event timer a device. Submitted by: Jun Su Reviewed by: sephe, Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5957 Modified: head/sys/dev/hyperv/vmbus/hv_et.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Fri Apr 22 05:14:12 2016 (r298448) +++ head/sys/dev/hyperv/vmbus/hv_et.c Fri Apr 22 05:15:59 2016 (r298449) @@ -28,6 +28,9 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include #include #include #include @@ -40,8 +43,7 @@ __FBSDID("$FreeBSD$"); #define HV_MAX_DELTA_TICKS 0xffffffffLL #define HV_MIN_DELTA_TICKS 1LL -static struct eventtimer et; -static uint64_t periodticks[MAXCPU]; +static struct eventtimer *et; static inline uint64_t sbintime2tick(sbintime_t time) @@ -62,10 +64,6 @@ hv_et_start(struct eventtimer *et, sbint timer_cfg.auto_enable = 1; timer_cfg.sintx = HV_VMBUS_TIMER_SINT; - periodticks[curcpu] = sbintime2tick(periodtime); - if (firsttime == 0) - firsttime = periodtime; - current = rdmsr(HV_X64_MSR_TIME_REF_COUNT); current += sbintime2tick(firsttime); @@ -87,45 +85,77 @@ hv_et_stop(struct eventtimer *et) void hv_et_intr(struct trapframe *frame) { - union hv_timer_config timer_cfg; struct trapframe *oldframe; struct thread *td; - if (periodticks[curcpu] != 0) { - uint64_t tick = sbintime2tick(periodticks[curcpu]); - timer_cfg.as_uint64 = rdmsr(HV_X64_MSR_STIMER0_CONFIG); - timer_cfg.enable = 0; - timer_cfg.auto_enable = 1; - timer_cfg.periodic = 1; - periodticks[curcpu] = 0; - - wrmsr(HV_X64_MSR_STIMER0_CONFIG, timer_cfg.as_uint64); - wrmsr(HV_X64_MSR_STIMER0_COUNT, tick); - } - - if (et.et_active) { + if (et->et_active) { td = curthread; td->td_intr_nesting_level++; oldframe = td->td_intr_frame; td->td_intr_frame = frame; - et.et_event_cb(&et, et.et_arg); + et->et_event_cb(et, et->et_arg); td->td_intr_frame = oldframe; td->td_intr_nesting_level--; } } -void -hv_et_init(void) +static void +hv_et_identify (driver_t *driver, device_t parent) +{ + if (device_find_child(parent, "hv_et", -1) != NULL) + return; + + device_add_child(parent, "hv_et", -1); +} + +static int +hv_et_probe(device_t dev) +{ + device_set_desc(dev, "Hyper-V event timer"); + + return (BUS_PROBE_NOWILDCARD); +} + +static int +hv_et_attach(device_t dev) +{ + /* XXX: need allocate SINT and remove global et */ + et = device_get_softc(dev); + + et->et_name = "Hyper-V"; + et->et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; + et->et_quality = 1000; + et->et_frequency = HV_TIMER_FREQUENCY; + et->et_min_period = HV_MIN_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); + et->et_max_period = HV_MAX_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); + et->et_start = hv_et_start; + et->et_stop = hv_et_stop; + et->et_priv = dev; + + return (et_register(et)); +} + +static int +hv_et_detach(device_t dev) { - et.et_name = "HyperV"; - et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU | ET_FLAGS_PERIODIC; - et.et_quality = 1000; - et.et_frequency = HV_TIMER_FREQUENCY; - et.et_min_period = (1LL << 32) / HV_TIMER_FREQUENCY; - et.et_max_period = HV_MAX_DELTA_TICKS * ((1LL << 32) / HV_TIMER_FREQUENCY); - et.et_start = hv_et_start; - et.et_stop = hv_et_stop; - et.et_priv = &et; - et_register(&et); + return (et_deregister(et)); } +static device_method_t hv_et_methods[] = { + DEVMETHOD(device_identify, hv_et_identify), + DEVMETHOD(device_probe, hv_et_probe), + DEVMETHOD(device_attach, hv_et_attach), + DEVMETHOD(device_detach, hv_et_detach), + + DEVMETHOD_END +}; + +static driver_t hv_et_driver = { + "hv_et", + hv_et_methods, + sizeof(struct eventtimer) +}; + +static devclass_t hv_et_devclass; +DRIVER_MODULE(hv_et, vmbus, hv_et_driver, hv_et_devclass, NULL, 0); +MODULE_VERSION(hv_et, 1); Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Fri Apr 22 05:14:12 2016 (r298448) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Fri Apr 22 05:15:59 2016 (r298449) @@ -171,8 +171,6 @@ hv_vmbus_init(void) hv_vmbus_g_context.hypercall_page = virt_addr; - hv_et_init(); - return (0); cleanup: Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri Apr 22 05:14:12 2016 (r298448) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri Apr 22 05:15:59 2016 (r298449) @@ -277,6 +277,9 @@ vmbus_child_pnpinfo_str(device_t dev, de char guidbuf[40]; struct hv_device *dev_ctx = device_get_ivars(child); + if (dev_ctx == NULL) + return (0); + strlcat(buf, "classid=", buflen); snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->class_id); strlcat(buf, guidbuf, buflen); @@ -525,6 +528,7 @@ vmbus_attach(device_t dev) if (!cold) vmbus_bus_init(); + bus_generic_probe(dev); return (0); } From owner-svn-src-all@freebsd.org Fri Apr 22 05:24:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AD67B18CCA; Fri, 22 Apr 2016 05:24:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFCBA18A2; Fri, 22 Apr 2016 05:24:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M5OG7G088639; Fri, 22 Apr 2016 05:24:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M5OGEM088638; Fri, 22 Apr 2016 05:24:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604220524.u3M5OGEM088638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 05:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298450 - head/contrib/bsnmp/gensnmptree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 05:24:17 -0000 Author: ngie Date: Fri Apr 22 05:24:15 2016 New Revision: 298450 URL: https://svnweb.freebsd.org/changeset/base/298450 Log: Simplify always evaluated branch (`e != NULL`) - xalloc(..) ensures that e will be non-null via malloc + err. - `e` is already dereferenced above, so logically it's impossible to hit the lower test without crashing if it was indeed NULL. MFC after: 3 days CID: 1007408 Reported by: Coverity Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.c Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- head/contrib/bsnmp/gensnmptree/gensnmptree.c Fri Apr 22 05:15:59 2016 (r298449) +++ head/contrib/bsnmp/gensnmptree/gensnmptree.c Fri Apr 22 05:24:15 2016 (r298450) @@ -743,10 +743,8 @@ parse_type(enum tok *tok, struct type *t report("need value for ENUM/BITS"); if (gettoken() != TOK_STR) report("need string in ENUM/BITS"); - if (e != NULL) { - e->name = savetok(); - TAILQ_INSERT_TAIL(&t->enums, e, link); - } + e->name = savetok(); + TAILQ_INSERT_TAIL(&t->enums, e, link); if ((*tok = gettoken()) == TOK_EOF) report("unexpected EOF in ENUM/BITS"); } while (*tok != ')'); From owner-svn-src-all@freebsd.org Fri Apr 22 05:52:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEAE4B18494; Fri, 22 Apr 2016 05:52:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C0DB14AE; Fri, 22 Apr 2016 05:52:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M5qe87097610; Fri, 22 Apr 2016 05:52:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M5qeku097609; Fri, 22 Apr 2016 05:52:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604220552.u3M5qeku097609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 05:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298451 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 05:52:41 -0000 Author: ngie Date: Fri Apr 22 05:52:40 2016 New Revision: 298451 URL: https://svnweb.freebsd.org/changeset/base/298451 Log: Don't use `entry` after free in the "already in lists" case Return with 0 as it isn't an error. MFC after: 1 week CID: 1006085 Reported by: Coverity Obtained from: Isilon OneFS (part of r493633) Submitted by: Thor Steingrimsson Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Fri Apr 22 05:24:15 2016 (r298450) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Fri Apr 22 05:52:40 2016 (r298451) @@ -693,6 +693,7 @@ snmp_import_table(struct snmp_toolinfo * /* Same entry already present in lists. */ free(entry->string); free(entry); + return (0); } (void) snmp_import_update_table(ENTRY_INDEX, entry); From owner-svn-src-all@freebsd.org Fri Apr 22 06:01:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C14B188CE; Fri, 22 Apr 2016 06:01:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 421A519C7; Fri, 22 Apr 2016 06:01:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M61BBx097958; Fri, 22 Apr 2016 06:01:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M61Btd097957; Fri, 22 Apr 2016 06:01:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604220601.u3M61Btd097957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 06:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298452 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 06:01:12 -0000 Author: ngie Date: Fri Apr 22 06:01:11 2016 New Revision: 298452 URL: https://svnweb.freebsd.org/changeset/base/298452 Log: Don't try to free `string` (stack allocated char[]) Fix minor style with warnx call while in the neighborhood MFC after: 1 week CID: 1009683 Reported by: Coverity, gcc 5.x Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri Apr 22 05:52:40 2016 (r298451) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri Apr 22 06:01:11 2016 (r298452) @@ -1079,10 +1079,9 @@ snmp_oid2asn_oid(struct snmp_toolinfo *s strlcpy(string, str, i + 1); string[i] = '\0'; if (snmp_lookup_enumoid(snmptoolctx, &obj, string) < 0) { - warnx("Unknown string - %s",string); + warnx("Unknown string - %s", string); return (NULL); } - free(string); } asn_append_oid(oid, &(obj.val.var)); From owner-svn-src-all@freebsd.org Fri Apr 22 06:23:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49BF8B1809F; Fri, 22 Apr 2016 06:23:24 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A674137A; Fri, 22 Apr 2016 06:23:24 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M6NNYM006712; Fri, 22 Apr 2016 06:23:23 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M6NNVG006711; Fri, 22 Apr 2016 06:23:23 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604220623.u3M6NNVG006711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 22 Apr 2016 06:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298453 - head/usr.bin/xlint/lint1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 06:23:24 -0000 Author: araujo Date: Fri Apr 22 06:23:23 2016 New Revision: 298453 URL: https://svnweb.freebsd.org/changeset/base/298453 Log: Use roundup2() macro from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/xlint/lint1/decl.c Modified: head/usr.bin/xlint/lint1/decl.c ============================================================================== --- head/usr.bin/xlint/lint1/decl.c Fri Apr 22 06:01:11 2016 (r298452) +++ head/usr.bin/xlint/lint1/decl.c Fri Apr 22 06:23:23 2016 (r298453) @@ -1105,7 +1105,7 @@ align(int al, int len) if (al > dcs->d_stralign) dcs->d_stralign = al; - no = (dcs->d_offset + (al - 1)) & ~(al - 1); + no = roundup2(dcs->d_offset, al); if (len == 0 || dcs->d_offset + len > no) dcs->d_offset = no; } From owner-svn-src-all@freebsd.org Fri Apr 22 06:25:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDE37B18167; Fri, 22 Apr 2016 06:25:33 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDDCC1682; Fri, 22 Apr 2016 06:25:33 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M6PWMC006826; Fri, 22 Apr 2016 06:25:32 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M6PWbS006824; Fri, 22 Apr 2016 06:25:32 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604220625.u3M6PWbS006824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 22 Apr 2016 06:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298454 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 06:25:34 -0000 Author: araujo Date: Fri Apr 22 06:25:32 2016 New Revision: 298454 URL: https://svnweb.freebsd.org/changeset/base/298454 Log: Use MIN()/MAX() macros from sys/param.h. Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D6054 Modified: head/usr.sbin/bhyve/fwctl.c head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/fwctl.c ============================================================================== --- head/usr.sbin/bhyve/fwctl.c Fri Apr 22 06:23:23 2016 (r298453) +++ head/usr.sbin/bhyve/fwctl.c Fri Apr 22 06:25:32 2016 (r298454) @@ -348,7 +348,7 @@ fwctl_request_data(uint32_t value) /* Make sure remaining size is >= 0 */ rinfo.req_size -= sizeof(uint32_t); - remlen = (rinfo.req_size > 0) ? rinfo.req_size: 0; + remlen = MAX(rinfo.req_size, 0); (*rinfo.req_op->op_data)(value, remlen); Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Apr 22 06:23:23 2016 (r298453) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Apr 22 06:25:32 2016 (r298454) @@ -741,7 +741,7 @@ read_prdt(struct ahci_port *p, int slot, dbcsz = (prdt->dbc & DBCMASK) + 1; ptr = paddr_guest2host(ahci_ctx(p->pr_sc), prdt->dba, dbcsz); - sublen = len < dbcsz ? len : dbcsz; + sublen = MIN(len, dbcsz); memcpy(to, ptr, sublen); len -= sublen; to += sublen; @@ -847,7 +847,7 @@ write_prdt(struct ahci_port *p, int slot dbcsz = (prdt->dbc & DBCMASK) + 1; ptr = paddr_guest2host(ahci_ctx(p->pr_sc), prdt->dba, dbcsz); - sublen = len < dbcsz ? len : dbcsz; + sublen = MIN(len, dbcsz); memcpy(ptr, from, sublen); len -= sublen; from += sublen; From owner-svn-src-all@freebsd.org Fri Apr 22 06:26:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79DAEB181E6; Fri, 22 Apr 2016 06:26:46 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3F31812; Fri, 22 Apr 2016 06:26:46 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M6QjW1006908; Fri, 22 Apr 2016 06:26:45 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M6QjM9006907; Fri, 22 Apr 2016 06:26:45 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201604220626.u3M6QjM9006907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 22 Apr 2016 06:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298455 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 06:26:46 -0000 Author: skra Date: Fri Apr 22 06:26:45 2016 New Revision: 298455 URL: https://svnweb.freebsd.org/changeset/base/298455 Log: Add four functions which check a virtual address for stage 1 privileged (PL1) and unprivileged (PL0) read/write access. As cp15 virtual to physical address translation operations are used, interrupts must be disabled to get consistent result when they are called. These functions should be used only in very specific occasions like during abort handling or kernel debugging. One of them is going to be used in pmap_fault(). However, complete function set is added. It cost nothing, as they are inlined. While here, fix comment of #endif. Reviewed by: kib Modified: head/sys/arm/include/cpu-v6.h Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Fri Apr 22 06:25:32 2016 (r298454) +++ head/sys/arm/include/cpu-v6.h Fri Apr 22 06:26:45 2016 (r298455) @@ -181,6 +181,8 @@ _RF0(cp15_actlr_get, CP15_ACTLR(%0)) _WF1(cp15_actlr_set, CP15_ACTLR(%0)) _WF1(cp15_ats1cpr_set, CP15_ATS1CPR(%0)) _WF1(cp15_ats1cpw_set, CP15_ATS1CPW(%0)) +_WF1(cp15_ats1cur_set, CP15_ATS1CUR(%0)) +_WF1(cp15_ats1cuw_set, CP15_ATS1CUW(%0)) _RF0(cp15_par_get, CP15_PAR(%0)) _RF0(cp15_sctlr_get, CP15_SCTLR(%0)) @@ -581,6 +583,52 @@ cp15_ttbr_set(uint32_t reg) isb(); tlb_flush_all_ng_local(); } -#endif /* _KERNEL */ + +/* + * Functions for address checking: + * + * cp15_ats1cpr_check() ... check stage 1 privileged (PL1) read access + * cp15_ats1cpw_check() ... check stage 1 privileged (PL1) write access + * cp15_ats1cur_check() ... check stage 1 unprivileged (PL0) read access + * cp15_ats1cuw_check() ... check stage 1 unprivileged (PL0) write access + * + * They must be called while interrupts are disabled to get consistent result. + */ +static __inline int +cp15_ats1cpr_check(vm_offset_t addr) +{ + + cp15_ats1cpr_set(addr); + isb(); + return (cp15_par_get() & 0x01 ? EFAULT : 0); +} + +static __inline int +cp15_ats1cpw_check(vm_offset_t addr) +{ + + cp15_ats1cpw_set(addr); + isb(); + return (cp15_par_get() & 0x01 ? EFAULT : 0); +} + +static __inline int +cp15_ats1cur_check(vm_offset_t addr) +{ + + cp15_ats1cur_set(addr); + isb(); + return (cp15_par_get() & 0x01 ? EFAULT : 0); +} + +static __inline int +cp15_ats1cuw_check(vm_offset_t addr) +{ + + cp15_ats1cuw_set(addr); + isb(); + return (cp15_par_get() & 0x01 ? EFAULT : 0); +} +#endif /* !__ARM_ARCH < 6 */ #endif /* !MACHINE_CPU_V6_H */ From owner-svn-src-all@freebsd.org Fri Apr 22 06:32:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10091B1842B; Fri, 22 Apr 2016 06:32:29 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BECBC1D71; Fri, 22 Apr 2016 06:32:28 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M6WRdt009722; Fri, 22 Apr 2016 06:32:27 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M6WRCY009720; Fri, 22 Apr 2016 06:32:27 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201604220632.u3M6WRCY009720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 22 Apr 2016 06:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298457 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 06:32:29 -0000 Author: skra Date: Fri Apr 22 06:32:27 2016 New Revision: 298457 URL: https://svnweb.freebsd.org/changeset/base/298457 Log: Don't use atomic operations for page table entries and handle access and R/W emulation aborts under pmap lock. There were two reasons for using of atomic operations: (1) the pmap code is based on i386 one where they are used, (2) there was an idea that access and R/W emulation aborts should be handled as quick as possible, without pmap locking. However, the atomic operations in i386 pmap code are used only because page table entries may be modified by hardware. At the beginning, we were not sure that it's the only reason. So even if arm hardware does not modify them, we did not risk to not use them at that time. Further, it turns out after some testing that using of pmap lock for access and R/W emulation aborts does not bring any extra cost and there was no measurable difference. Thus, we have decided finally to use pmap lock for all operations on page table entries and so, there is no reason for atomic operations on them. This makes the code cleaner and safer. This decision introduce a question if it's safe to use pmap lock for access and R/W emulation aborts. Anyhow, there may happen two cases in general: (A) Aborts while the pmap lock is locked already - this should not happen as pmap lock is not recursive. However, under pmap lock only internal kernel data should be accessed and such data should be mapped with A bit set and NM bit cleared. If double abort happens, then a mapping of data which has caused it must be fixed. (B) Aborts while another lock(s) is/are locked - this already can happen. There is no difference here if it's either access or R/W emulation abort, or if it's some other abort. Reviewed by: kib Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap_var.h Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Apr 22 06:29:49 2016 (r298456) +++ head/sys/arm/arm/pmap-v6.c Fri Apr 22 06:32:27 2016 (r298457) @@ -3230,7 +3230,6 @@ pmap_promote_pte1(pmap_t pmap, pt1_entry * within a 1MB page. */ fpte2p = pmap_pte2_quick(pmap, pte1_trunc(va)); -setpte1: fpte2 = pte2_load(fpte2p); if ((fpte2 & ((PTE2_FRAME & PTE1_OFFSET) | PTE2_A | PTE2_V)) != (PTE2_A | PTE2_V)) { @@ -3249,16 +3248,9 @@ setpte1: /* * When page is not modified, PTE2_RO can be set without * a TLB invalidation. - * - * Note: When modified bit is being set, then in hardware case, - * the TLB entry is re-read (updated) from PT2, and in - * software case (abort), the PTE2 is read from PT2 and - * TLB flushed if changed. The following cmpset() solves - * any race with setting this bit in both cases. */ - if (!pte2_cmpset(fpte2p, fpte2, fpte2 | PTE2_RO)) - goto setpte1; fpte2 |= PTE2_RO; + pte2_store(fpte2p, fpte2); } /* @@ -3269,7 +3261,6 @@ setpte1: fpte2_fav = (fpte2 & (PTE2_FRAME | PTE2_A | PTE2_V)); fpte2_fav += PTE1_SIZE - PTE2_SIZE; /* examine from the end */ for (pte2p = fpte2p + NPTE2_IN_PT2 - 1; pte2p > fpte2p; pte2p--) { -setpte2: pte2 = pte2_load(pte2p); if ((pte2 & (PTE2_FRAME | PTE2_A | PTE2_V)) != fpte2_fav) { pmap_pte1_p_failures++; @@ -3282,9 +3273,8 @@ setpte2: * When page is not modified, PTE2_RO can be set * without a TLB invalidation. See note above. */ - if (!pte2_cmpset(pte2p, pte2, pte2 | PTE2_RO)) - goto setpte2; pte2 |= PTE2_RO; + pte2_store(pte2p, pte2); pteva = pte1_trunc(va) | (pte2 & PTE1_OFFSET & PTE2_FRAME); CTR3(KTR_PMAP, "%s: protect for va %#x in pmap %p", @@ -4655,7 +4645,7 @@ pmap_protect_pte1(pmap_t pmap, pt1_entry PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((sva & PTE1_OFFSET) == 0, ("%s: sva is not 1mpage aligned", __func__)); -retry: + opte1 = npte1 = pte1_load(pte1p); if (pte1_is_managed(opte1)) { eva = sva + PTE1_SIZE; @@ -4676,8 +4666,7 @@ retry: */ if (npte1 != opte1) { - if (!pte1_cmpset(pte1p, opte1, npte1)) - goto retry; + pte1_store(pte1p, npte1); pmap_tlb_flush(pmap, sva); } } @@ -4779,7 +4768,7 @@ resume: for (pte2p = pmap_pte2_quick(pmap, sva); sva != nextva; pte2p++, sva += PAGE_SIZE) { vm_page_t m; -retry: + opte2 = npte2 = pte2_load(pte2p); if (!pte2_is_valid(opte2)) continue; @@ -4803,9 +4792,7 @@ retry: */ if (npte2 != opte2) { - - if (!pte2_cmpset(pte2p, opte2, npte2)) - goto retry; + pte2_store(pte2p, npte2); pmap_tlb_flush(pmap, sva); } } @@ -5287,12 +5274,9 @@ small_mappings: KASSERT(!pte1_is_section(pte1_load(pte1p)), ("%s: found" " a section in page %p's pv list", __func__, m)); pte2p = pmap_pte2_quick(pmap, pv->pv_va); -retry: opte2 = pte2_load(pte2p); if (!(opte2 & PTE2_RO)) { - if (!pte2_cmpset(pte2p, opte2, - opte2 | (PTE2_RO | PTE2_NM))) - goto retry; + pte2_store(pte2p, opte2 | PTE2_RO | PTE2_NM); if (pte2_is_dirty(opte2)) vm_page_dirty(m); pmap_tlb_flush(pmap, pv->pv_va); @@ -6200,33 +6184,49 @@ pmap_fault(pmap_t pmap, vm_offset_t far, } /* + * A pmap lock is used below for handling of access and R/W emulation + * aborts. They were handled by atomic operations before so some + * analysis of new situation is needed to answer the following question: + * Is it safe to use the lock even for these aborts? + * + * There may happen two cases in general: + * + * (1) Aborts while the pmap lock is locked already - this should not + * happen as pmap lock is not recursive. However, under pmap lock only + * internal kernel data should be accessed and such data should be + * mapped with A bit set and NM bit cleared. If double abort happens, + * then a mapping of data which has caused it must be fixed. Further, + * all new mappings are always made with A bit set and the bit can be + * cleared only on managed mappings. + * + * (2) Aborts while another lock(s) is/are locked - this already can + * happen. However, there is no difference here if it's either access or + * R/W emulation abort, or if it's some other abort. + */ + + PMAP_LOCK(pmap); + /* * Accesss bits for page and section. Note that the entry * is not in TLB yet, so TLB flush is not necessary. * * QQQ: This is hardware emulation, we do not call userret() * for aborts from user mode. - * We do not lock PMAP, so cmpset() is a need. Hopefully, - * no one removes the mapping when we are here. */ if (idx == FAULT_ACCESS_L2) { pte2p = pt2map_entry(far); -pte2_seta: pte2 = pte2_load(pte2p); if (pte2_is_valid(pte2)) { - if (!pte2_cmpset(pte2p, pte2, pte2 | PTE2_A)) { - goto pte2_seta; - } + pte2_store(pte2p, pte2 | PTE2_A); + PMAP_UNLOCK(pmap); return (KERN_SUCCESS); } } if (idx == FAULT_ACCESS_L1) { pte1p = pmap_pte1(pmap, far); -pte1_seta: pte1 = pte1_load(pte1p); if (pte1_is_section(pte1)) { - if (!pte1_cmpset(pte1p, pte1, pte1 | PTE1_A)) { - goto pte1_seta; - } + pte1_store(pte1p, pte1 | PTE1_A); + PMAP_UNLOCK(pmap); return (KERN_SUCCESS); } } @@ -6238,32 +6238,26 @@ pte1_seta: * * QQQ: This is hardware emulation, we do not call userret() * for aborts from user mode. - * We do not lock PMAP, so cmpset() is a need. Hopefully, - * no one removes the mapping when we are here. */ if ((fsr & FSR_WNR) && (idx == FAULT_PERM_L2)) { pte2p = pt2map_entry(far); -pte2_setrw: pte2 = pte2_load(pte2p); if (pte2_is_valid(pte2) && !(pte2 & PTE2_RO) && (pte2 & PTE2_NM)) { - if (!pte2_cmpset(pte2p, pte2, pte2 & ~PTE2_NM)) { - goto pte2_setrw; - } + pte2_store(pte2p, pte2 & ~PTE2_NM); tlb_flush(trunc_page(far)); + PMAP_UNLOCK(pmap); return (KERN_SUCCESS); } } if ((fsr & FSR_WNR) && (idx == FAULT_PERM_L1)) { pte1p = pmap_pte1(pmap, far); -pte1_setrw: pte1 = pte1_load(pte1p); if (pte1_is_section(pte1) && !(pte1 & PTE1_RO) && (pte1 & PTE1_NM)) { - if (!pte1_cmpset(pte1p, pte1, pte1 & ~PTE1_NM)) { - goto pte1_setrw; - } + pte1_store(pte1p, pte1 & ~PTE1_NM); tlb_flush(pte1_trunc(far)); + PMAP_UNLOCK(pmap); return (KERN_SUCCESS); } } @@ -6278,9 +6272,6 @@ pte1_setrw: /* * Read an entry in PT2TAB associated with both pmap and far. * It's safe because PT2TAB is always mapped. - * - * QQQ: We do not lock PMAP, so false positives could happen if - * the mapping is removed concurrently. */ pte2 = pt2tab_load(pmap_pt2tab_entry(pmap, far)); if (pte2_is_valid(pte2)) { @@ -6303,6 +6294,7 @@ pte1_setrw: } } #endif + PMAP_UNLOCK(pmap); return (KERN_FAILURE); } Modified: head/sys/arm/include/pmap_var.h ============================================================================== --- head/sys/arm/include/pmap_var.h Fri Apr 22 06:29:49 2016 (r298456) +++ head/sys/arm/include/pmap_var.h Fri Apr 22 06:32:27 2016 (r298457) @@ -143,7 +143,8 @@ static __inline void pte1_store(pt1_entry_t *pte1p, pt1_entry_t pte1) { - atomic_store_rel_int(pte1p, pte1); + dmb(); + *pte1p = pte1; pte1_sync(pte1p); } @@ -158,22 +159,11 @@ static __inline void pte1_clear_bit(pt1_entry_t *pte1p, uint32_t bit) { - atomic_clear_int(pte1p, bit); + *pte1p &= ~bit; pte1_sync(pte1p); } static __inline boolean_t -pte1_cmpset(pt1_entry_t *pte1p, pt1_entry_t opte1, pt1_entry_t npte1) -{ - boolean_t ret; - - ret = atomic_cmpset_int(pte1p, opte1, npte1); - if (ret) pte1_sync(pte1p); - - return (ret); -} - -static __inline boolean_t pte1_is_link(pt1_entry_t pte1) { @@ -231,7 +221,8 @@ pte1_load_clear(pt1_entry_t *pte1p) { pt1_entry_t opte1; - opte1 = atomic_readandclear_int(pte1p); + opte1 = *pte1p; + *pte1p = 0; pte1_sync(pte1p); return (opte1); } @@ -240,7 +231,7 @@ static __inline void pte1_set_bit(pt1_entry_t *pte1p, uint32_t bit) { - atomic_set_int(pte1p, bit); + *pte1p |= bit; pte1_sync(pte1p); } @@ -292,7 +283,8 @@ static __inline void pte2_store(pt2_entry_t *pte2p, pt2_entry_t pte2) { - atomic_store_rel_int(pte2p, pte2); + dmb(); + *pte2p = pte2; pte2_sync(pte2p); } @@ -307,22 +299,11 @@ static __inline void pte2_clear_bit(pt2_entry_t *pte2p, uint32_t bit) { - atomic_clear_int(pte2p, bit); + *pte2p &= ~bit; pte2_sync(pte2p); } static __inline boolean_t -pte2_cmpset(pt2_entry_t *pte2p, pt2_entry_t opte2, pt2_entry_t npte2) -{ - boolean_t ret; - - ret = atomic_cmpset_int(pte2p, opte2, npte2); - if (ret) pte2_sync(pte2p); - - return (ret); -} - -static __inline boolean_t pte2_is_dirty(pt2_entry_t pte2) { @@ -364,7 +345,8 @@ pte2_load_clear(pt2_entry_t *pte2p) { pt2_entry_t opte2; - opte2 = atomic_readandclear_int(pte2p); + opte2 = *pte2p; + *pte2p = 0; pte2_sync(pte2p); return (opte2); } @@ -373,7 +355,7 @@ static __inline void pte2_set_bit(pt2_entry_t *pte2p, uint32_t bit) { - atomic_set_int(pte2p, bit); + *pte2p |= bit; pte2_sync(pte2p); } @@ -386,9 +368,9 @@ pte2_set_wired(pt2_entry_t *pte2p, boole * so pte2_sync() is not needed. */ if (wired) - atomic_set_int(pte2p, PTE2_W); + *pte2p |= PTE2_W; else - atomic_clear_int(pte2p, PTE2_W); + *pte2p &= ~PTE2_W; } static __inline vm_paddr_t From owner-svn-src-all@freebsd.org Fri Apr 22 06:33:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D4F6B1849A; Fri, 22 Apr 2016 06:33:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5981EF2; Fri, 22 Apr 2016 06:33:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M6X6NX009803; Fri, 22 Apr 2016 06:33:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M6X6LS009802; Fri, 22 Apr 2016 06:33:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604220633.u3M6X6LS009802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 Apr 2016 06:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298458 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 06:33:07 -0000 Author: hselasky Date: Fri Apr 22 06:33:06 2016 New Revision: 298458 URL: https://svnweb.freebsd.org/changeset/base/298458 Log: Add missing set of the current VNET when inputting IP packets in IPoIB. This fixes a kernel panic when using IPoIB with VIMAGE and infiniband. PR: 208957 Sponsored by: Mellanox Technologies Tested by: Justin Clift MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Fri Apr 22 06:32:27 2016 (r298457) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Fri Apr 22 06:33:06 2016 (r298458) @@ -481,6 +481,8 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ int has_srq; u_short proto; + CURVNET_SET_QUIET(dev->if_vnet); + ipoib_dbg_data(priv, "cm recv completion: id %d, status: %d\n", wr_id, wc->status); @@ -496,7 +498,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ } else ipoib_warn(priv, "cm recv completion event with wrid %d (> %d)\n", wr_id, ipoib_recvq_size); - return; + goto done; } p = wc->qp->qp_context; @@ -520,7 +522,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ queue_work(ipoib_workqueue, &priv->cm.rx_reap_task); spin_unlock(&priv->lock); } - return; + goto done; } } @@ -579,6 +581,9 @@ repost: "for buf %d\n", wr_id); } } +done: + CURVNET_RESTORE(); + return; } static inline int post_send(struct ipoib_dev_priv *priv, From owner-svn-src-all@freebsd.org Fri Apr 22 06:39:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D3DEB18660; Fri, 22 Apr 2016 06:39:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD908112A; Fri, 22 Apr 2016 06:39:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M6d8K9010062; Fri, 22 Apr 2016 06:39:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M6d8vF010061; Fri, 22 Apr 2016 06:39:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604220639.u3M6d8vF010061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 Apr 2016 06:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298459 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 06:39:09 -0000 Author: hselasky Date: Fri Apr 22 06:39:07 2016 New Revision: 298459 URL: https://svnweb.freebsd.org/changeset/base/298459 Log: Add KASSERT() and set error code in dead code case to help static code analysis tools. Suggested by: ngie@ Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/addr.c Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Fri Apr 22 06:33:06 2016 (r298458) +++ head/sys/ofed/drivers/infiniband/core/addr.c Fri Apr 22 06:39:07 2016 (r298459) @@ -404,6 +404,8 @@ mcast: break; #endif default: + KASSERT(0, ("rdma_addr_resolve: Unreachable")); + error = EINVAL; break; } RTFREE(rte); From owner-svn-src-all@freebsd.org Fri Apr 22 06:40:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32EB3B18722; Fri, 22 Apr 2016 06:40:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0554212DA; Fri, 22 Apr 2016 06:40:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id 184so38491928pff.0; Thu, 21 Apr 2016 23:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=H0p9FTixt0K7K7HwH9lWNlRPS19YmZNjEl6DyfjtSpE=; b=pB9/Cdvf+skOf6r2vfgjlR/UYd+sOnMPRhcJBMq81VzjAdawpyjNFNetZk/VkqHaGC m9ZaXNV5izePFonhBUlaEvYooGEnkri4v+UVqGKI+A+JfPPNMb2jc9Ogcb7IRU3qFNhZ SF/Zdl16IMYYfDbbw5AeE6wMAHUZDaWO4lWx5PY4fPp5REird1VtGCf4sHLJmQBRmpUx ZIR0oHdezgtam0RQY6dLuvQxTilRVFkemcsilqhMA6How6nvsUQ1/KB5MfERtArJEmjj TIVeZtqA5HsKrFTzS1xlFOTRnAFZ+1uD7sU2D4vx+N2zpH4P2siaNO1f2mTNuEBJ9wHq jUcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=H0p9FTixt0K7K7HwH9lWNlRPS19YmZNjEl6DyfjtSpE=; b=DPNnuv/k5Tq9pveB6ZXNuLlBULPwqFhks9zAtoQfGOHOpQ7TQkTdwNzfvtMJXFLuyY 7un6CCvN7u7b8Vr6j3FATwIWX1T3wEWL6Mek6e04VQTSjtt3SyjIMukWgIN0gAHptPyU YsHPWVEOgoz6l9GfsEHxqcJuXa0H9sbs2HxQ0JNEl1UZdA5BjCK6sfr0qPul0RSK9FZa XttPb9ltFHdxGAzD7VXO7sSDmkJPhq5s8gOmFT9SCPAsTxvCo6Gkqfe9BkRAPomvnGoV wIXIF+hWU7r/biPG2DrCGcre6nd2BaLg5ZpklvF2gvLV6v2f1zbv0KT5GATSVQBp4ccg EJvQ== X-Gm-Message-State: AOPr4FWTQlmysnfq9VBUdqso25yB1bcLRFdr4FLasgAU7jie+hE56OE9EDDs1sZ4zFdzPQ== X-Received: by 10.98.36.195 with SMTP id k64mr26203654pfk.88.1461307230468; Thu, 21 Apr 2016 23:40:30 -0700 (PDT) Received: from [192.168.20.7] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id yp9sm6658685pab.42.2016.04.21.23.40.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Apr 2016 23:40:29 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298459 - head/sys/ofed/drivers/infiniband/core From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201604220639.u3M6d8vF010061@repo.freebsd.org> Date: Thu, 21 Apr 2016 23:40:28 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201604220639.u3M6d8vF010061@repo.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 06:40:31 -0000 > On Apr 21, 2016, at 23:39, Hans Petter Selasky = wrote: >=20 > Author: hselasky > Date: Fri Apr 22 06:39:07 2016 > New Revision: 298459 > URL: https://svnweb.freebsd.org/changeset/base/298459 >=20 > Log: > Add KASSERT() and set error code in dead code case to help static = code > analysis tools. >=20 > Suggested by: ngie@ > Sponsored by: Mellanox Technologies > MFC after: 1 week >=20 > Modified: > head/sys/ofed/drivers/infiniband/core/addr.c >=20 > Modified: head/sys/ofed/drivers/infiniband/core/addr.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/ofed/drivers/infiniband/core/addr.c Fri Apr 22 = 06:33:06 2016 (r298458) > +++ head/sys/ofed/drivers/infiniband/core/addr.c Fri Apr 22 = 06:39:07 2016 (r298459) > @@ -404,6 +404,8 @@ mcast: > break; > #endif > default: > + KASSERT(0, ("rdma_addr_resolve: Unreachable")); > + error =3D EINVAL; > break; > } > RTFREE(rte); Thanks :)!= From owner-svn-src-all@freebsd.org Fri Apr 22 06:42:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E321B18896; Fri, 22 Apr 2016 06:42:51 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48B5B17D0; Fri, 22 Apr 2016 06:42:51 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M6goh9012805; Fri, 22 Apr 2016 06:42:50 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M6go6M012804; Fri, 22 Apr 2016 06:42:50 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201604220642.u3M6go6M012804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 22 Apr 2016 06:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298460 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 06:42:51 -0000 Author: skra Date: Fri Apr 22 06:42:50 2016 New Revision: 298460 URL: https://svnweb.freebsd.org/changeset/base/298460 Log: Fix duplicate TLB entries issue during section promotion/demotion. Such situation is defined as UNPREDICTABLE by arm arm manual. This patch fixes all explicit TLB fetches which could cause this issue and speculative TLB fetches for sections mapped in user address space. Speculative TLB fetches for sections mapped in kernel address space are not fixed yet as the break-before-make approach must be implemented for kernel mappings too. This means that promoted/demoted section will be unmapped for a while. Either kernel stack the promotion/demotion is being done on or L1 page table(s) which must be modified may be mapped by this section. Thus the fix will not be so simple like for userland mappings. The issue was detectable only on Cortex-A8 platforms and only very rarely. It was reported few times. First, it was by Mikael Urankar in June 2015. He helped to identify the mechanism of this issue, but we were not sure how to fix it correctly until now. PR: 208381 Reported by: Mikael Urankar (mikael.urankar at gmail.com) Reviewed by: kib Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Apr 22 06:39:07 2016 (r298459) +++ head/sys/arm/arm/pmap-v6.c Fri Apr 22 06:42:50 2016 (r298460) @@ -1531,6 +1531,14 @@ static u_long pmap_pte1_promotions; SYSCTL_ULONG(_vm_pmap_pte1, OID_AUTO, promotions, CTLFLAG_RD, &pmap_pte1_promotions, 0, "1MB page promotions"); +static u_long pmap_pte1_kern_demotions; +SYSCTL_ULONG(_vm_pmap_pte1, OID_AUTO, kern_demotions, CTLFLAG_RD, + &pmap_pte1_kern_demotions, 0, "1MB page kernel demotions"); + +static u_long pmap_pte1_kern_promotions; +SYSCTL_ULONG(_vm_pmap_pte1, OID_AUTO, kern_promotions, CTLFLAG_RD, + &pmap_pte1_kern_promotions, 0, "1MB page kernel promotions"); + static __inline ttb_entry_t pmap_ttb_get(pmap_t pmap) { @@ -3198,6 +3206,166 @@ pmap_pv_insert_pte1(pmap_t pmap, vm_offs return (FALSE); } +static inline void +pmap_tlb_flush_pte1(pmap_t pmap, vm_offset_t va, pt1_entry_t npte1) +{ + + /* Kill all the small mappings or the big one only. */ + if (pte1_is_section(npte1)) + pmap_tlb_flush_range(pmap, pte1_trunc(va), PTE1_SIZE); + else + pmap_tlb_flush(pmap, pte1_trunc(va)); +} + +/* + * Update kernel pte1 on all pmaps. + * + * The following function is called only on one cpu with disabled interrupts. + * In SMP case, smp_rendezvous_cpus() is used to stop other cpus. This way + * nobody can invoke explicit hardware table walk during the update of pte1. + * Unsolicited hardware table walk can still happen, invoked by speculative + * data or instruction prefetch or even by speculative hardware table walk. + * + * The break-before-make approach should be implemented here. However, it's + * not so easy to do that for kernel mappings as it would be unhappy to unmap + * itself unexpectedly but voluntarily. + */ +static void +pmap_update_pte1_kernel(vm_offset_t va, pt1_entry_t npte1) +{ + pmap_t pmap; + pt1_entry_t *pte1p; + + /* + * Get current pmap. Interrupts should be disabled here + * so PCPU_GET() is done atomically. + */ + pmap = PCPU_GET(curpmap); + if (pmap == NULL) + pmap = kernel_pmap; + + /* + * (1) Change pte1 on current pmap. + * (2) Flush all obsolete TLB entries on current CPU. + * (3) Change pte1 on all pmaps. + * (4) Flush all obsolete TLB entries on all CPUs in SMP case. + */ + + pte1p = pmap_pte1(pmap, va); + pte1_store(pte1p, npte1); + + /* Kill all the small mappings or the big one only. */ + if (pte1_is_section(npte1)) { + pmap_pte1_kern_promotions++; + tlb_flush_range_local(pte1_trunc(va), PTE1_SIZE); + } else { + pmap_pte1_kern_demotions++; + tlb_flush_local(pte1_trunc(va)); + } + + /* + * In SMP case, this function is called when all cpus are at smp + * rendezvous, so there is no need to use 'allpmaps_lock' lock here. + * In UP case, the function is called with this lock locked. + */ + LIST_FOREACH(pmap, &allpmaps, pm_list) { + pte1p = pmap_pte1(pmap, va); + pte1_store(pte1p, npte1); + } + +#ifdef SMP + /* Kill all the small mappings or the big one only. */ + if (pte1_is_section(npte1)) + tlb_flush_range(pte1_trunc(va), PTE1_SIZE); + else + tlb_flush(pte1_trunc(va)); +#endif +} + +#ifdef SMP +struct pte1_action { + vm_offset_t va; + pt1_entry_t npte1; + u_int update; /* CPU that updates the PTE1 */ +}; + +static void +pmap_update_pte1_action(void *arg) +{ + struct pte1_action *act = arg; + + if (act->update == PCPU_GET(cpuid)) + pmap_update_pte1_kernel(act->va, act->npte1); +} + +/* + * Change pte1 on current pmap. + * Note that kernel pte1 must be changed on all pmaps. + * + * By ARM ARM manual, the behaviour is UNPREDICABLE when two or more TLB + * entries map same VA. It's a problem when either promotion or demotion + * is being done. The pte1 update and appropriate TLB flush must be done + * atomically in general. + */ +static void +pmap_change_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t va, + pt1_entry_t npte1) +{ + + if (pmap == kernel_pmap) { + struct pte1_action act; + + sched_pin(); + act.va = va; + act.npte1 = npte1; + act.update = PCPU_GET(cpuid); + smp_rendezvous_cpus(all_cpus, smp_no_rendevous_barrier, + pmap_update_pte1_action, NULL, &act); + sched_unpin(); + } else { + register_t cspr; + + /* + * Use break-before-make approach for changing userland + * mappings. It can cause L1 translation aborts on other + * cores in SMP case. So, special treatment is implemented + * in pmap_fault(). Interrups are disabled here to make it + * without any interruption as quick as possible. + */ + cspr = disable_interrupts(PSR_I | PSR_F); + pte1_clear(pte1p); + pmap_tlb_flush_pte1(pmap, va, npte1); + pte1_store(pte1p, npte1); + restore_interrupts(cspr); + } +} +#else +static void +pmap_change_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t va, + pt1_entry_t npte1) +{ + + if (pmap == kernel_pmap) { + mtx_lock_spin(&allpmaps_lock); + pmap_update_pte1_kernel(va, npte1); + mtx_unlock_spin(&allpmaps_lock); + } else { + register_t cspr; + + /* + * Use break-before-make approach for changing userland + * mappings. It's absolutely safe in UP case when interrupts + * are disabled. + */ + cspr = disable_interrupts(PSR_I | PSR_F); + pte1_clear(pte1p); + pmap_tlb_flush_pte1(pmap, va, npte1); + pte1_store(pte1p, npte1); + restore_interrupts(cspr); + } +} +#endif + /* * Tries to promote the NPTE2_IN_PT2, contiguous 4KB page mappings that are * within a single page table page (PT2) to a single 1MB page mapping. @@ -3303,8 +3471,8 @@ pmap_promote_pte1(pmap_t pmap, pt1_entry ("%s: PT2 page's pindex is wrong", __func__)); /* - * Get pte1 from pte2 format. - */ + * Get pte1 from pte2 format. + */ npte1 = (fpte2 & PTE1_FRAME) | ATTR_TO_L1(fpte2) | PTE1_V; /* @@ -3314,19 +3482,9 @@ pmap_promote_pte1(pmap_t pmap, pt1_entry pmap_pv_promote_pte1(pmap, va, pte1_pa(npte1)); /* - * Map the section. - */ - if (pmap == kernel_pmap) - pmap_kenter_pte1(va, npte1); - else - pte1_store(pte1p, npte1); - /* - * Flush old small mappings. We call single pmap_tlb_flush() in - * pmap_demote_pte1() and pmap_remove_pte1(), so we must be sure that - * no small mappings survive. We assume that given pmap is current and - * don't play game with PTE2_NG. + * Promote the mappings. */ - pmap_tlb_flush_range(pmap, pte1_trunc(va), PTE1_SIZE); + pmap_change_pte1(pmap, pte1p, va, npte1); pmap_pte1_promotions++; CTR3(KTR_PMAP, "%s: success for va %#x in pmap %p", @@ -3608,17 +3766,7 @@ pmap_demote_pte1(pmap_t pmap, pt1_entry_ * another processor changing the setting of PTE1_A and/or PTE1_NM * between the read above and the store below. */ - if (pmap == kernel_pmap) - pmap_kenter_pte1(va, npte1); - else - pte1_store(pte1p, npte1); - - /* - * Flush old big mapping. The mapping should occupy one and only - * TLB entry. So, pmap_tlb_flush() called with aligned address - * should be sufficient. - */ - pmap_tlb_flush(pmap, pte1_trunc(va)); + pmap_change_pte1(pmap, pte1p, va, npte1); /* * Demote the pv entry. This depends on the earlier demotion @@ -6205,6 +6353,18 @@ pmap_fault(pmap_t pmap, vm_offset_t far, */ PMAP_LOCK(pmap); +#ifdef SMP + /* + * Special treatment due to break-before-make approach done when + * pte1 is updated for userland mapping during section promotion or + * demotion. If not catched here, pmap_enter() can find a section + * mapping on faulting address. That is not allowed. + */ + if (idx == FAULT_TRAN_L1 && usermode && cp15_ats1cur_check(far) == 0) { + PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); + } +#endif /* * Accesss bits for page and section. Note that the entry * is not in TLB yet, so TLB flush is not necessary. From owner-svn-src-all@freebsd.org Fri Apr 22 07:29:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC5BDB1892D; Fri, 22 Apr 2016 07:29:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D92319B1; Fri, 22 Apr 2016 07:29:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M7Tc67025069; Fri, 22 Apr 2016 07:29:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M7Tcfg025068; Fri, 22 Apr 2016 07:29:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604220729.u3M7Tcfg025068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 Apr 2016 07:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298461 - head/sys/contrib/rdma/krping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 07:29:39 -0000 Author: hselasky Date: Fri Apr 22 07:29:38 2016 New Revision: 298461 URL: https://svnweb.freebsd.org/changeset/base/298461 Log: Fix for printf() compile warning when fast_reg.length is 64-bit. Changing fast_reg.length to 64 bits is planned in the future. Krping uses 32-bit lengths internally. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Fri Apr 22 06:42:50 2016 (r298460) +++ head/sys/contrib/rdma/krping/krping.c Fri Apr 22 07:29:38 2016 (r298461) @@ -890,7 +890,7 @@ static u32 krping_rdma_rkey(struct krpin post_inv, cb->fastreg_wr.wr.fast_reg.rkey, cb->fastreg_wr.wr.fast_reg.page_shift, - cb->fastreg_wr.wr.fast_reg.length, + (unsigned)cb->fastreg_wr.wr.fast_reg.length, (uintmax_t)cb->fastreg_wr.wr.fast_reg.iova_start, cb->fastreg_wr.wr.fast_reg.page_list_len); From owner-svn-src-all@freebsd.org Fri Apr 22 07:51:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7834EB18FBC; Fri, 22 Apr 2016 07:51:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 459CE1316; Fri, 22 Apr 2016 07:51:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M7pcrP033613; Fri, 22 Apr 2016 07:51:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M7pcUO033612; Fri, 22 Apr 2016 07:51:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604220751.u3M7pcUO033612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 07:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298462 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 07:51:39 -0000 Author: ngie Date: Fri Apr 22 07:51:38 2016 New Revision: 298462 URL: https://svnweb.freebsd.org/changeset/base/298462 Log: Return `ret` in op_ifentry(..) to mute a -Wunused-but-set-variable warning This will also now detect error conditions with value->var.subs[sub - 1] == LEAF_ifPhysAddress where `string_get(..)` could fail if iifp->physaddr and/or iifp->physaddrlen were deemed invalid. MFC after: 2 weeks CID: 1006551 Reported by: Coverity, gcc Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Directory Properties: head/ (props changed) Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Fri Apr 22 07:29:38 2016 (r298461) +++ head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Fri Apr 22 07:51:38 2016 (r298462) @@ -356,7 +356,7 @@ op_ifentry(struct snmp_context *ctx, str value->v.oid = ifp->spec_oid; break; } - return (SNMP_ERR_NOERROR); + return (ret); } /* From owner-svn-src-all@freebsd.org Fri Apr 22 07:55:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2E05B180D3; Fri, 22 Apr 2016 07:55:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0F1016E1; Fri, 22 Apr 2016 07:55:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id n1so38986404pfn.2; Fri, 22 Apr 2016 00:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=PkPZ/mWRZbyv4trXLfnGg6kr4DJmRmiYAE8Z3D889Ew=; b=meLHMwtmKcX1XT4QnLZLGhVqhr3KSIJUT1UGMgSzRjF7VaCN+BjffxJYDtNdFFGj1o XDokrTRL+N1VPsuV3+9DYn1l1GZDJetJGt/i50tfXQHWvMIjuYAV8BFDKKERJQA9S9e6 G+dHFRz5FW/QxxMn5sh2X10/Yul+Ni5zEEI2lk5nekAkcIcyglxE0IEMQaq9aBGAQPks i44qwOddJHd8tGYSWZaS1cb2zxAnfnvCJVKVIIDVgNvblpDZeGhvHEymBRu3tDq2e7jS XgCrq8XLfyiTvIOvPkl/M/5gJh2WK9wmqGw62FfYZHDIcJBnOIWhwliv7B6cK/VMDKZD Y+Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=PkPZ/mWRZbyv4trXLfnGg6kr4DJmRmiYAE8Z3D889Ew=; b=auhvwdD8iJge8zdFOmCZF5nQH8HB2WxrLx2f/mPW2DpGDiGXzQcut8lJZ3XNyDKPnc ZzbUyc3j7UgqSOBrXy4ht3uWls04O6xDy3hftwIR66qjzNYP7HN/9kgIKFdE2vFB7Exw 3tpgo7DlC5GB4xpz1GOoh+IcuC1L0IWQM+nDBPncS9M4ikk/issQaSOU1nzLD4DSiX3f mSCvK3caqWzT01cIfODrfPnuSq01/iv66m8Wfd7qqs08R1npWiwIhI6Ho0Mmk3DGDTjp JrgZSzOrojlP/pNqqbkLmpkqoX2WaCBJ+nIutZIPy9OaBGEcQZXcmQ07uQRcOKWR40GN sZ+g== X-Gm-Message-State: AOPr4FVGZ22RhoTXVMdA27w216Qo8S+cGy+6Pgvk//iR1HBnusEvg7jl+ZWLfOONXyaUBQ== X-Received: by 10.98.100.200 with SMTP id y191mr26654911pfb.84.1461311702483; Fri, 22 Apr 2016 00:55:02 -0700 (PDT) Received: from [192.168.20.7] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id 187sm6115064pff.66.2016.04.22.00.55.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Apr 2016 00:55:01 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298462 - head/contrib/bsnmp/snmp_mibII From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201604220751.u3M7pcUO033612@repo.freebsd.org> Date: Fri, 22 Apr 2016 00:55:00 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3CEC0CBF-09FC-430E-B92F-E554CE66648B@gmail.com> References: <201604220751.u3M7pcUO033612@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 07:55:03 -0000 > On Apr 22, 2016, at 00:51, Garrett Cooper wrote: >=20 > Author: ngie > Date: Fri Apr 22 07:51:38 2016 > New Revision: 298462 > URL: https://svnweb.freebsd.org/changeset/base/298462 >=20 > Log: > Return `ret` in op_ifentry(..) to mute a -Wunused-but-set-variable = warning >=20 > This will also now detect error conditions with > value->var.subs[sub - 1] =3D=3D LEAF_ifPhysAddress where = `string_get(..)` > could fail if iifp->physaddr and/or iifp->physaddrlen were deemed > invalid. >=20 > MFC after: 2 weeks > CID: 1006551 > Reported by: Coverity, gcc > Sponsored by: EMC / Isilon Storage Division I pulled up the wrong CID. Coverity didn=E2=80=99t actually complain = about this =E2=80=94 just gcc. Thanks, -Ngie= From owner-svn-src-all@freebsd.org Fri Apr 22 08:09:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1781B189A3; Fri, 22 Apr 2016 08:09:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F2FC1F7F; Fri, 22 Apr 2016 08:09:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M89RYO036980; Fri, 22 Apr 2016 08:09:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M89RtR036979; Fri, 22 Apr 2016 08:09:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604220809.u3M89RtR036979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 08:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298463 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 08:09:28 -0000 Author: ngie Date: Fri Apr 22 08:09:27 2016 New Revision: 298463 URL: https://svnweb.freebsd.org/changeset/base/298463 Log: Add FEATURE knob for testing for UFS extended attribute kernel support Support can be verified via `feature_present("ufs_extattr")`, etc. Differential Revision: https://reviews.freebsd.org/D6053 MFC after: 2 weeks Relnotes: yes Reviewed by: asomers, kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ufs/ufs/ufs_extattr.c Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Fri Apr 22 07:51:38 2016 (r298462) +++ head/sys/ufs/ufs/ufs_extattr.c Fri Apr 22 08:09:27 2016 (r298463) @@ -69,6 +69,8 @@ __FBSDID("$FreeBSD$"); #ifdef UFS_EXTATTR +FEATURE(ufs_extattr, "ufs extended attribute support"); + static MALLOC_DEFINE(M_UFS_EXTATTR, "ufs_extattr", "ufs extended attribute"); static int ufs_extattr_sync = 0; From owner-svn-src-all@freebsd.org Fri Apr 22 08:11:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF580B18B02; Fri, 22 Apr 2016 08:11:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB3811D0; Fri, 22 Apr 2016 08:11:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M8BQsd039072; Fri, 22 Apr 2016 08:11:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M8BQ7n039071; Fri, 22 Apr 2016 08:11:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604220811.u3M8BQ7n039071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 08:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298464 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 08:11:27 -0000 Author: ngie Date: Fri Apr 22 08:11:26 2016 New Revision: 298464 URL: https://svnweb.freebsd.org/changeset/base/298464 Log: Use `sizeof(*uuser)` instead of `sizeof(struct usm_user)` for consistency with the rest of the users in the file No functional change MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/main.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Fri Apr 22 08:09:27 2016 (r298463) +++ head/contrib/bsnmp/snmpd/main.c Fri Apr 22 08:11:26 2016 (r298464) @@ -2813,7 +2813,7 @@ usm_new_user(uint8_t *eid, uint32_t elen if ((uuser = (struct usm_user *)malloc(sizeof(*uuser))) == NULL) return (NULL); - memset(uuser, 0, sizeof(struct usm_user)); + memset(uuser, 0, sizeof(*uuser)); strlcpy(uuser->suser.sec_name, uname, SNMP_ADM_STR32_SIZ); memcpy(uuser->user_engine_id, eid, elen); uuser->user_engine_len = elen; From owner-svn-src-all@freebsd.org Fri Apr 22 08:49:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44EB8B17D80; Fri, 22 Apr 2016 08:49:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11EF018B6; Fri, 22 Apr 2016 08:49:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M8np1s049091; Fri, 22 Apr 2016 08:49:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M8npX1049090; Fri, 22 Apr 2016 08:49:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604220849.u3M8npX1049090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Apr 2016 08:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298465 - stable/10/sys/ddb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 08:49:52 -0000 Author: kib Date: Fri Apr 22 08:49:50 2016 New Revision: 298465 URL: https://svnweb.freebsd.org/changeset/base/298465 Log: MFC r298043: Avoid NULL pointer dereference. Modified: stable/10/sys/ddb/db_ps.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ddb/db_ps.c ============================================================================== --- stable/10/sys/ddb/db_ps.c Fri Apr 22 08:11:26 2016 (r298464) +++ stable/10/sys/ddb/db_ps.c Fri Apr 22 08:49:50 2016 (r298465) @@ -181,7 +181,8 @@ db_ps(db_expr_t addr, boolean_t hasaddr, strlcat(state, "V", sizeof(state)); if (p->p_flag & P_SYSTEM || p->p_lock > 0) strlcat(state, "L", sizeof(state)); - if (p->p_session != NULL && SESS_LEADER(p)) + if (p->p_pgrp != NULL && p->p_session != NULL && + SESS_LEADER(p)) strlcat(state, "s", sizeof(state)); /* Cheated here and didn't compare pgid's. */ if (p->p_flag & P_CONTROLT) From owner-svn-src-all@freebsd.org Fri Apr 22 08:56:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ECE9B180E0; Fri, 22 Apr 2016 08:56:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F00D51D2E; Fri, 22 Apr 2016 08:56:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3M8umFf052174; Fri, 22 Apr 2016 08:56:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3M8umD8052173; Fri, 22 Apr 2016 08:56:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604220856.u3M8umD8052173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Apr 2016 08:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298466 - stable/9/sys/ddb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 08:56:49 -0000 Author: kib Date: Fri Apr 22 08:56:47 2016 New Revision: 298466 URL: https://svnweb.freebsd.org/changeset/base/298466 Log: MFC r298043: Avoid NULL pointer dereference. Modified: stable/9/sys/ddb/db_ps.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ddb/db_ps.c ============================================================================== --- stable/9/sys/ddb/db_ps.c Fri Apr 22 08:49:50 2016 (r298465) +++ stable/9/sys/ddb/db_ps.c Fri Apr 22 08:56:47 2016 (r298466) @@ -181,7 +181,8 @@ db_ps(db_expr_t addr, boolean_t hasaddr, strlcat(state, "V", sizeof(state)); if (p->p_flag & P_SYSTEM || p->p_lock > 0) strlcat(state, "L", sizeof(state)); - if (p->p_session != NULL && SESS_LEADER(p)) + if (p->p_pgrp != NULL && p->p_session != NULL && + SESS_LEADER(p)) strlcat(state, "s", sizeof(state)); /* Cheated here and didn't compare pgid's. */ if (p->p_flag & P_CONTROLT) From owner-svn-src-all@freebsd.org Fri Apr 22 12:48:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FC9DB18210; Fri, 22 Apr 2016 12:48:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 694CB19A7; Fri, 22 Apr 2016 12:48:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MCmrad024149; Fri, 22 Apr 2016 12:48:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MCmr2B024148; Fri, 22 Apr 2016 12:48:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604221248.u3MCmr2B024148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Apr 2016 12:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298469 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 12:48:54 -0000 Author: avg Date: Fri Apr 22 12:48:53 2016 New Revision: 298469 URL: https://svnweb.freebsd.org/changeset/base/298469 Log: MFC r297709: zio write issue threads should have lower (numerically greater) priority Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Apr 22 09:46:22 2016 (r298468) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Apr 22 12:48:53 2016 (r298469) @@ -930,7 +930,7 @@ spa_taskqs_init(spa_t *spa, zio_type_t t * than the other taskqs. */ if (t == ZIO_TYPE_WRITE && q == ZIO_TASKQ_ISSUE) - pri--; + pri++; tq = taskq_create_proc(name, value, pri, 50, INT_MAX, spa->spa_proc, flags); From owner-svn-src-all@freebsd.org Fri Apr 22 12:49:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8076B1825D; Fri, 22 Apr 2016 12:49:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EF9C1A9D; Fri, 22 Apr 2016 12:49:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MCn00V024203; Fri, 22 Apr 2016 12:49:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MCn0Fc024202; Fri, 22 Apr 2016 12:49:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604221249.u3MCn0Fc024202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Apr 2016 12:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298470 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 12:49:02 -0000 Author: avg Date: Fri Apr 22 12:49:00 2016 New Revision: 298470 URL: https://svnweb.freebsd.org/changeset/base/298470 Log: MFC r297709: zio write issue threads should have lower (numerically greater) priority Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Apr 22 12:48:53 2016 (r298469) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Apr 22 12:49:00 2016 (r298470) @@ -902,7 +902,7 @@ spa_taskqs_init(spa_t *spa, zio_type_t t * than the other taskqs. */ if (t == ZIO_TYPE_WRITE && q == ZIO_TASKQ_ISSUE) - pri--; + pri++; tq = taskq_create_proc(name, value, pri, 50, INT_MAX, spa->spa_proc, flags); From owner-svn-src-all@freebsd.org Fri Apr 22 12:51:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43D60B18419; Fri, 22 Apr 2016 12:51:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 207001EAE; Fri, 22 Apr 2016 12:51:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MCpu5n026954; Fri, 22 Apr 2016 12:51:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MCpugW026951; Fri, 22 Apr 2016 12:51:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604221251.u3MCpugW026951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Apr 2016 12:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298471 - vendor-sys/illumos/dist/uts/common/sys/fs vendor/illumos/dist/lib/libzfs/common vendor/illumos/dist/lib/libzfs_core/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 12:51:57 -0000 Author: avg Date: Fri Apr 22 12:51:55 2016 New Revision: 298471 URL: https://svnweb.freebsd.org/changeset/base/298471 Log: 6052 decouple lzc_create() from the implementation details illumos/illumos-gate@26455f9efcf9b1e44937d4d86d1ce37b006f25a9 https://github.com/illumos/illumos-gate/commit/26455f9efcf9b1e44937d4d86d1ce37b006f25a9 https://www.illumos.org/issues/6052 At the moment type parameter of lzc_create() is of dmu_objset_type_t type. That exposes an implementation detail and requires sys/fs/zfs.h to be included in libzfs_core.h creating unnecessary coupling between libzfs_core interface and ZFS internals. I think that dmu_objset_type_t should be replaced with a libzfs_core enumeration of supported dataset types. For ABI reasons the new enumeration could be bit-compatible with dmu_objset_type_t. For example: typedef enum { LZC_DST_ZFS = 2, LZC_DST_ZVOL } lzc_dataset_type_t; Reviewed by: Matthew Ahrens Approved by: Richard Lowe Author: Andriy Gapon Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Fri Apr 22 12:49:00 2016 (r298470) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Fri Apr 22 12:51:55 2016 (r298471) @@ -3152,7 +3152,7 @@ zfs_create(libzfs_handle_t *hdl, const c uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); char errbuf[1024]; uint64_t zoned; - dmu_objset_type_t ost; + enum lzc_dataset_type ost; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot create '%s'"), path); @@ -3179,9 +3179,9 @@ zfs_create(libzfs_handle_t *hdl, const c } if (type == ZFS_TYPE_VOLUME) - ost = DMU_OST_ZVOL; + ost = LZC_DATSET_TYPE_ZVOL; else - ost = DMU_OST_ZFS; + ost = LZC_DATSET_TYPE_ZFS; /* open zpool handle for prop validation */ char pool_path[MAXNAMELEN]; Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Fri Apr 22 12:49:00 2016 (r298470) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Fri Apr 22 12:51:55 2016 (r298471) @@ -171,11 +171,11 @@ out: } int -lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props) +lzc_create(const char *fsname, enum lzc_dataset_type type, nvlist_t *props) { int error; nvlist_t *args = fnvlist_alloc(); - fnvlist_add_int32(args, "type", type); + fnvlist_add_int32(args, "type", (dmu_objset_type_t)type); if (props != NULL) fnvlist_add_nvlist(args, "props", props); error = lzc_ioctl(ZFS_IOC_CREATE, fsname, args, NULL); Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Fri Apr 22 12:49:00 2016 (r298470) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Fri Apr 22 12:51:55 2016 (r298471) @@ -30,7 +30,6 @@ #include #include #include -#include #ifdef __cplusplus extern "C" { @@ -39,8 +38,16 @@ extern "C" { int libzfs_core_init(void); void libzfs_core_fini(void); +/* + * NB: this type should be kept binary compatible with dmu_objset_type_t. + */ +enum lzc_dataset_type { + LZC_DATSET_TYPE_ZFS = 2, + LZC_DATSET_TYPE_ZVOL +}; + int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **); -int lzc_create(const char *, dmu_objset_type_t, nvlist_t *); +int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *); int lzc_clone(const char *, const char *, nvlist_t *); int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **); int lzc_bookmark(nvlist_t *, nvlist_t **); From owner-svn-src-all@freebsd.org Fri Apr 22 12:51:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D91CB18416; Fri, 22 Apr 2016 12:51:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B808E1EAD; Fri, 22 Apr 2016 12:51:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MCpthO026946; Fri, 22 Apr 2016 12:51:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MCpt24026945; Fri, 22 Apr 2016 12:51:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604221251.u3MCpt24026945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Apr 2016 12:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298471 - vendor-sys/illumos/dist/uts/common/sys/fs vendor/illumos/dist/lib/libzfs/common vendor/illumos/dist/lib/libzfs_core/common X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 12:51:57 -0000 Author: avg Date: Fri Apr 22 12:51:55 2016 New Revision: 298471 URL: https://svnweb.freebsd.org/changeset/base/298471 Log: 6052 decouple lzc_create() from the implementation details illumos/illumos-gate@26455f9efcf9b1e44937d4d86d1ce37b006f25a9 https://github.com/illumos/illumos-gate/commit/26455f9efcf9b1e44937d4d86d1ce37b006f25a9 https://www.illumos.org/issues/6052 At the moment type parameter of lzc_create() is of dmu_objset_type_t type. That exposes an implementation detail and requires sys/fs/zfs.h to be included in libzfs_core.h creating unnecessary coupling between libzfs_core interface and ZFS internals. I think that dmu_objset_type_t should be replaced with a libzfs_core enumeration of supported dataset types. For ABI reasons the new enumeration could be bit-compatible with dmu_objset_type_t. For example: typedef enum { LZC_DST_ZFS = 2, LZC_DST_ZVOL } lzc_dataset_type_t; Reviewed by: Matthew Ahrens Approved by: Richard Lowe Author: Andriy Gapon Modified: vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Changes in other areas also in this revision: Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Modified: vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Fri Apr 22 12:49:00 2016 (r298470) +++ vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Fri Apr 22 12:51:55 2016 (r298471) @@ -54,6 +54,10 @@ typedef enum { ZFS_TYPE_BOOKMARK = (1 << 4) } zfs_type_t; +/* + * NB: lzc_dataset_type should be updated whenever a new objset type is added, + * if it represents a real type of a dataset that can be created from userland. + */ typedef enum dmu_objset_type { DMU_OST_NONE, DMU_OST_META, From owner-svn-src-all@freebsd.org Fri Apr 22 13:00:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BB47B1877C; Fri, 22 Apr 2016 13:00:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2CBA1383; Fri, 22 Apr 2016 13:00:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MD0SoP027445; Fri, 22 Apr 2016 13:00:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MD0RnC027441; Fri, 22 Apr 2016 13:00:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604221300.u3MD0RnC027441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Apr 2016 13:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298472 - in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/sys/fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 13:00:29 -0000 Author: avg Date: Fri Apr 22 13:00:27 2016 New Revision: 298472 URL: https://svnweb.freebsd.org/changeset/base/298472 Log: MFV r298471: 6052 decouple lzc_create() from the implementation details illumos/illumos-gate@26455f9efcf9b1e44937d4d86d1ce37b006f25a9 https://github.com/illumos/illumos-gate/commit/26455f9efcf9b1e44937d4d86d1ce37b006f25a9 https://www.illumos.org/issues/6052 At the moment type parameter of lzc_create() is of dmu_objset_type_t type. That exposes an implementation detail and requires sys/fs/zfs.h to be included in libzfs_core.h creating unnecessary coupling between libzfs_core interface and ZFS internals. I think that dmu_objset_type_t should be replaced with a libzfs_core enumeration of supported dataset types. For ABI reasons the new enumeration could be bit-compatible with dmu_objset_type_t. For example: typedef enum { LZC_DST_ZFS = 2, LZC_DST_ZVOL } lzc_dataset_type_t; Reviewed by: Matthew Ahrens Approved by: Richard Lowe Author: Andriy Gapon MFC after: 2 weeks Sponsored by: ClusterHQ Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Apr 22 12:51:55 2016 (r298471) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Apr 22 13:00:27 2016 (r298472) @@ -3226,7 +3226,7 @@ zfs_create(libzfs_handle_t *hdl, const c uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); char errbuf[1024]; uint64_t zoned; - dmu_objset_type_t ost; + enum lzc_dataset_type ost; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot create '%s'"), path); @@ -3253,9 +3253,9 @@ zfs_create(libzfs_handle_t *hdl, const c } if (type == ZFS_TYPE_VOLUME) - ost = DMU_OST_ZVOL; + ost = LZC_DATSET_TYPE_ZVOL; else - ost = DMU_OST_ZFS; + ost = LZC_DATSET_TYPE_ZFS; /* open zpool handle for prop validation */ char pool_path[MAXNAMELEN]; Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Apr 22 12:51:55 2016 (r298471) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Apr 22 13:00:27 2016 (r298472) @@ -218,11 +218,11 @@ out: } int -lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props) +lzc_create(const char *fsname, enum lzc_dataset_type type, nvlist_t *props) { int error; nvlist_t *args = fnvlist_alloc(); - fnvlist_add_int32(args, "type", type); + fnvlist_add_int32(args, "type", (dmu_objset_type_t)type); if (props != NULL) fnvlist_add_nvlist(args, "props", props); error = lzc_ioctl(ZFS_IOC_CREATE, fsname, args, NULL); Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Fri Apr 22 12:51:55 2016 (r298471) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Fri Apr 22 13:00:27 2016 (r298472) @@ -30,7 +30,6 @@ #include #include #include -#include #ifdef __cplusplus extern "C" { @@ -39,8 +38,16 @@ extern "C" { int libzfs_core_init(void); void libzfs_core_fini(void); +/* + * NB: this type should be kept binary compatible with dmu_objset_type_t. + */ +enum lzc_dataset_type { + LZC_DATSET_TYPE_ZFS = 2, + LZC_DATSET_TYPE_ZVOL +}; + int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **); -int lzc_create(const char *, dmu_objset_type_t, nvlist_t *); +int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *); int lzc_clone(const char *, const char *, nvlist_t *); int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **); int lzc_bookmark(nvlist_t *, nvlist_t **); Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Fri Apr 22 12:51:55 2016 (r298471) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Fri Apr 22 13:00:27 2016 (r298472) @@ -57,6 +57,10 @@ typedef enum { ZFS_TYPE_BOOKMARK = (1 << 4) } zfs_type_t; +/* + * NB: lzc_dataset_type should be updated whenever a new objset type is added, + * if it represents a real type of a dataset that can be created from userland. + */ typedef enum dmu_objset_type { DMU_OST_NONE, DMU_OST_META, From owner-svn-src-all@freebsd.org Fri Apr 22 13:44:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C904B178C7; Fri, 22 Apr 2016 13:44:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 396021FF5; Fri, 22 Apr 2016 13:44:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MDiCkk042559; Fri, 22 Apr 2016 13:44:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MDiCqC042558; Fri, 22 Apr 2016 13:44:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604221344.u3MDiCqC042558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Apr 2016 13:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298473 - head/sys/cddl/dev/dtrace/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 13:44:13 -0000 Author: avg Date: Fri Apr 22 13:44:12 2016 New Revision: 298473 URL: https://svnweb.freebsd.org/changeset/base/298473 Log: lahf/sahf are supported on some amd64 processors While the instructions were not included into the original instruction set, their support can be indicated by a special feature bit. For example: CPU: AMD Phenom(tm) II X4 955 Processor (3214.71-MHz K8-class CPU) ... AMD Features2=0x37ff Clang 3.8 uses lahf/sahf as a faster alternative to pushf/popf where possible. MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/x86/dis_tables.c Modified: head/sys/cddl/dev/dtrace/x86/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/x86/dis_tables.c Fri Apr 22 13:00:27 2016 (r298472) +++ head/sys/cddl/dev/dtrace/x86/dis_tables.c Fri Apr 22 13:44:12 2016 (r298473) @@ -1931,7 +1931,7 @@ const instable_t dis_distable[16][16] = /* [9,0] */ TNS("nop",NORM), TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), /* [9,4] */ TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), /* [9,8] */ TNS("cXtX",CBW), TNS("cXtX",CWD), TNSx("lcall",SO), TNS("fwait",NORM), -/* [9,C] */ TSZy("pushf",IMPLMEM,4),TSZy("popf",IMPLMEM,4), TNSx("sahf",NORM), TNSx("lahf",NORM), +/* [9,C] */ TSZy("pushf",IMPLMEM,4),TSZy("popf",IMPLMEM,4), TNS("sahf",NORM), TNS("lahf",NORM), }, { /* [A,0] */ TNS("movb",OA), TS("mov",OA), TNS("movb",AO), TS("mov",AO), /* [A,4] */ TNSZ("movsb",SD,1), TS("movs",SD), TNSZ("cmpsb",SD,1), TS("cmps",SD), From owner-svn-src-all@freebsd.org Fri Apr 22 15:04:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CC18B198EF; Fri, 22 Apr 2016 15:04:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D31C21EF4; Fri, 22 Apr 2016 15:04:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MF4leF066961; Fri, 22 Apr 2016 15:04:47 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MF4lAX066960; Fri, 22 Apr 2016 15:04:47 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604221504.u3MF4lAX066960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 22 Apr 2016 15:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298474 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 15:04:48 -0000 Author: br Date: Fri Apr 22 15:04:46 2016 New Revision: 298474 URL: https://svnweb.freebsd.org/changeset/base/298474 Log: Correct the event queue initialization. This fixes operation on Rocket Core. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/riscv/locore.S Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Fri Apr 22 13:44:12 2016 (r298473) +++ head/sys/riscv/riscv/locore.S Fri Apr 22 15:04:46 2016 (r298474) @@ -73,18 +73,19 @@ sd t1, 8(t0) /* zero used */ mv t2, t0 mv t3, t0 - li t5, (HTIF_RING_SIZE - HTIF_RING_ENTRY_SZ) + li t5, (HTIF_RING_SIZE) li t6, 0 add t4, t0, t5 1: - addi t3, t3, 24 /* pointer to next */ - beq t3, t4, 2f /* finish */ - sd t3, 16(t2) /* store pointer */ - addi t2, t2, 24 /* next entry */ - addi t6, t6, 1 /* counter */ + addi t3, t3, HTIF_RING_ENTRY_SZ /* pointer to next */ + beq t3, t4, 2f /* finish */ + sd t3, 16(t2) /* store pointer */ + addi t2, t2, HTIF_RING_ENTRY_SZ /* next entry */ + addi t6, t6, 1 /* counter */ j 1b 2: - sd t0, 16(t3) /* last -> first */ + addi t3, t3, -HTIF_RING_ENTRY_SZ + sd t0, 16(t3) /* last -> first */ li t2, (HTIF_RING_SIZE) add s0, t0, t2 From owner-svn-src-all@freebsd.org Fri Apr 22 15:12:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 574FDB19B73; Fri, 22 Apr 2016 15:12:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2787414E0; Fri, 22 Apr 2016 15:12:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MFC5Qj067948; Fri, 22 Apr 2016 15:12:05 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MFC5vH067947; Fri, 22 Apr 2016 15:12:05 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604221512.u3MFC5vH067947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 22 Apr 2016 15:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298476 - head/sys/riscv/htif X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 15:12:06 -0000 Author: br Date: Fri Apr 22 15:12:05 2016 New Revision: 298476 URL: https://svnweb.freebsd.org/changeset/base/298476 Log: Add memory barriers (fence instructions) so the data wrotten by hardware to physical address now can be read by VA. This fixes operation on Rocket Core (FPGA). Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/htif/htif_block.c Modified: head/sys/riscv/htif/htif_block.c ============================================================================== --- head/sys/riscv/htif/htif_block.c Fri Apr 22 15:08:50 2016 (r298475) +++ head/sys/riscv/htif/htif_block.c Fri Apr 22 15:12:05 2016 (r298476) @@ -115,6 +115,7 @@ htif_blk_intr(void *arg, uint64_t entry) data = HTIF_DEV_DATA(entry); if (sc->curtag == data) { + wmb(); sc->cmd_done = 1; wakeup(&sc->intr_chan); } else { @@ -198,6 +199,7 @@ htif_blk_task(void *arg) { struct htif_blk_request req __aligned(HTIF_ALIGN); struct htif_blk_softc *sc; + uint64_t req_paddr; struct bio *bp; uint64_t paddr; uint64_t cmd; @@ -217,11 +219,13 @@ htif_blk_task(void *arg) if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { HTIF_BLK_LOCK(sc); + rmb(); req.offset = (bp->bio_pblkno * sc->disk->d_sectorsize); req.size = bp->bio_bcount; paddr = vtophys(bp->bio_data); KASSERT(paddr != 0, ("paddr is 0")); req.addr = paddr; + sc->curtag++; req.tag = sc->curtag; cmd = sc->index; @@ -230,9 +234,9 @@ htif_blk_task(void *arg) cmd |= (HTIF_CMD_READ << HTIF_CMD_SHIFT); else cmd |= (HTIF_CMD_WRITE << HTIF_CMD_SHIFT); - paddr = vtophys(&req); - KASSERT(paddr != 0, ("paddr is 0")); - cmd |= paddr; + req_paddr = vtophys(&req); + KASSERT(req_paddr != 0, ("req_paddr is 0")); + cmd |= req_paddr; sc->cmd_done = 0; htif_command(cmd); From owner-svn-src-all@freebsd.org Fri Apr 22 16:16:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FA2FB194EE; Fri, 22 Apr 2016 16:16:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D2471B8F; Fri, 22 Apr 2016 16:16:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MGFxr9088376; Fri, 22 Apr 2016 16:15:59 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MGFxCM088374; Fri, 22 Apr 2016 16:15:59 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604221615.u3MGFxCM088374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 22 Apr 2016 16:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298477 - in head/sys: conf riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 16:16:00 -0000 Author: br Date: Fri Apr 22 16:15:58 2016 New Revision: 298477 URL: https://svnweb.freebsd.org/changeset/base/298477 Log: Clear the DDR memory. This should be done by bootloaders, but they have no such feature yet. This fixes operation on Rocket Core and lowRISC. Modified: head/sys/conf/options.riscv head/sys/riscv/riscv/locore.S Modified: head/sys/conf/options.riscv ============================================================================== --- head/sys/conf/options.riscv Fri Apr 22 15:12:05 2016 (r298476) +++ head/sys/conf/options.riscv Fri Apr 22 16:15:58 2016 (r298477) @@ -2,3 +2,4 @@ RISCV opt_global.h VFP opt_global.h +DDR_CLEAR_SIZE opt_global.h Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Fri Apr 22 15:12:05 2016 (r298476) +++ head/sys/riscv/riscv/locore.S Fri Apr 22 16:15:58 2016 (r298477) @@ -126,6 +126,17 @@ _start: csrr a0, mhartid bnez a0, mpentry +#if defined(DDR_CLEAR_SIZE) + /* Clear DDR memory */ + la t0, _end + li t1, DDR_CLEAR_SIZE +1: + sd zero, 0(t0) + addi t0, t0, 8 + bltu t0, t1, 1b + /* End */ +#endif + /* Build event queue for current core */ build_ring From owner-svn-src-all@freebsd.org Fri Apr 22 16:20:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACAF9B1962B; Fri, 22 Apr 2016 16:20:59 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D8501DF8; Fri, 22 Apr 2016 16:20:59 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MGKwnv088585; Fri, 22 Apr 2016 16:20:58 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MGKwB6088584; Fri, 22 Apr 2016 16:20:58 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201604221620.u3MGKwB6088584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 22 Apr 2016 16:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298478 - head/sys/boot/pc98/libpc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 16:20:59 -0000 Author: allanjude Date: Fri Apr 22 16:20:58 2016 New Revision: 298478 URL: https://svnweb.freebsd.org/changeset/base/298478 Log: Fix more pc98 build issues re: bcache change Reported by: bz, emaste Modified: head/sys/boot/pc98/libpc98/biosdisk.c Modified: head/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosdisk.c Fri Apr 22 16:15:58 2016 (r298477) +++ head/sys/boot/pc98/libpc98/biosdisk.c Fri Apr 22 16:20:58 2016 (r298478) @@ -737,13 +737,13 @@ bd_strategy(void *devdata, int rw, daddr char *buf, size_t *rsize) { struct bcache_devdata bcd; - struct i386_devdesc *dev = f->f_devdata; + struct i386_devdesc *dev = devdata; struct open_disk *od = (struct open_disk *)(dev->d_kind.biosdisk.data); bcd.dv_strategy = bd_realstrategy; bcd.dv_devdata = devdata; bcd.dv_cache = BD(dev).bd_bcache; - return(bcache_strategy(&bcd, od->od_unit, rw, dblk+od->od_boff, offset, + return(bcache_strategy(&bcd, rw, dblk+od->od_boff, offset, size, buf, rsize)); } From owner-svn-src-all@freebsd.org Fri Apr 22 16:26:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6979AB19974; Fri, 22 Apr 2016 16:26:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34BDF13D8; Fri, 22 Apr 2016 16:26:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MGQrGk091611; Fri, 22 Apr 2016 16:26:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MGQr1w091608; Fri, 22 Apr 2016 16:26:53 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604221626.u3MGQr1w091608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 22 Apr 2016 16:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298479 - in head/sys: dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/cores/pci dev/bhnd/siba modules/bhnd/cores/bhnd_pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 16:26:54 -0000 Author: adrian Date: Fri Apr 22 16:26:53 2016 New Revision: 298479 URL: https://svnweb.freebsd.org/changeset/base/298479 Log: [bhnd] Add a common bhnd_pci driver shared by both bhnd_pcib and bhnd_pci_hostb This extracts common code from bhndb_pci, bhnd_pcib, and bhnd_pci_hostb into a simpler shared bhnd_pci base driver, and should enable SoC-side implementation of bhnd_pcib root complex support. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D5763 Added: head/sys/dev/bhnd/cores/pci/bhnd_pci_hostbvar.h (contents, props changed) Deleted: head/sys/dev/bhnd/cores/pci/mdio_pcie.c head/sys/dev/bhnd/cores/pci/mdio_pciereg.h head/sys/dev/bhnd/cores/pci/mdio_pcievar.h Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndb/bhndb_pcivar.h head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/pci/bhnd_pci.c head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c head/sys/dev/bhnd/cores/pci/bhnd_pcib.c head/sys/dev/bhnd/cores/pci/bhnd_pcibvar.h head/sys/dev/bhnd/cores/pci/bhnd_pcireg.h head/sys/dev/bhnd/cores/pci/bhnd_pcivar.h head/sys/dev/bhnd/siba/siba_bhndb.c head/sys/modules/bhnd/cores/bhnd_pci/Makefile Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Fri Apr 22 16:20:58 2016 (r298478) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Fri Apr 22 16:26:53 2016 (r298479) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Landon Fuller + * Copyright (c) 2015-2016 Landon Fuller * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,27 +37,11 @@ __FBSDID("$FreeBSD$"); * bus (e.g. bcma or siba) via a Broadcom PCI core configured in end-point * mode. * - * This driver handles all interactions with the PCI bridge core. On the - * bridged bhnd bus, the PCI core device will be claimed by a simple - * bhnd_hostb driver. + * This driver handles all host-level PCI interactions with a PCI/PCIe bridge + * core operating in endpoint mode. On the bridged bhnd bus, the PCI core + * device will be managed by a bhnd_pci_hostb driver. */ -// Quirk TODO -// WARs for the following are not yet implemented: -// - BHND_PCI_QUIRK_SBINTVEC -// - BHND_PCIE_QUIRK_ASPM_OVR -// - BHND_PCIE_QUIRK_SERDES_NOPLLDOWN -// Quirks (and WARs) for the following are not yet defined: -// - Power savings via MDIO BLK1/PWR_MGMT3 on PCIe hwrev 15-20, 21-22 -// - WOWL PME enable/disable -// - 4360 PCIe SerDes Tx amplitude/deemphasis (vendor Apple, boards -// BCM94360X51P2, BCM94360X51A). -// - PCI latency timer (boards CB2_4321_BOARD, CB2_4321_AG_BOARD) -// - Max SerDes TX drive strength (vendor Apple, pcie >= rev10, -// board BCM94322X9) -// - 700mV SerDes TX drive strength (chipid BCM4331, boards BCM94331X19, -// BCM94331X28, BCM94331X29B, BCM94331X19C) - #include #include #include @@ -72,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "bhndb_pcireg.h" #include "bhndb_pcivar.h" @@ -86,128 +69,8 @@ static int bhndb_pci_compat_setregwin(st static int bhndb_pci_fast_setregwin(struct bhndb_pci_softc *, const struct bhndb_regwin *, bhnd_addr_t); -static uint32_t bhndb_pcie_read_proto_reg(struct bhndb_pci_softc *sc, - uint32_t addr); -static void bhndb_pcie_write_proto_reg(struct bhndb_pci_softc *sc, - uint32_t addr, uint32_t val); - static void bhndb_init_sromless_pci_config(struct bhndb_pci_softc *sc); -static int bhndb_pci_wars_register_access(struct bhndb_pci_softc *sc); -static int bhndb_pci_wars_early_once(struct bhndb_pci_softc *sc); -static int bhndb_pci_wars_hwup(struct bhndb_pci_softc *sc); -static int bhndb_pci_wars_hwdown(struct bhndb_pci_softc *sc); - -static uint32_t bhndb_pci_discover_quirks(struct bhndb_pci_softc *, - const struct bhndb_pci_id *); - -static const struct bhndb_pci_id *bhndb_pci_find_core_id( - struct bhnd_core_info *core); -/* - * Supported PCI bridge cores. - * - * This table defines quirks specific to core hwrev ranges; see also - * bhndb_pci_discover_quirks() for additional quirk detection. - */ -static const struct bhndb_pci_id bhndb_pci_ids[] = { - /* PCI */ - { BHND_COREID_PCI, BHND_PCI_REGFMT_PCI, - (struct bhnd_device_quirk[]) { - { BHND_HWREV_GTE (0), - BHNDB_PCI_QUIRK_EXT_CLOCK_GATING | - BHNDB_PCI_QUIRK_SBTOPCI2_PREF_BURST }, - - { BHND_HWREV_RANGE (0, 5), - BHNDB_PCI_QUIRK_SBINTVEC }, - - { BHND_HWREV_GTE (11), - BHNDB_PCI_QUIRK_SBTOPCI2_READMULTI | - BHNDB_PCI_QUIRK_CLKRUN_DSBL }, - - BHND_DEVICE_QUIRK_END - } - }, - - /* PCI Gen 1 */ - { BHND_COREID_PCIE, BHND_PCI_REGFMT_PCIE, - (struct bhnd_device_quirk[]) { - { BHND_HWREV_EQ (0), - BHNDB_PCIE_QUIRK_SDR9_L0s_HANG }, - - { BHND_HWREV_RANGE (0, 1), - BHNDB_PCIE_QUIRK_UR_STATUS_FIX }, - - { BHND_HWREV_EQ (1), - BHNDB_PCIE_QUIRK_PCIPM_REQEN }, - - { BHND_HWREV_RANGE (3, 5), - BHNDB_PCIE_QUIRK_ASPM_OVR | - BHNDB_PCIE_QUIRK_SDR9_POLARITY | - BHNDB_PCIE_QUIRK_SDR9_NO_FREQRETRY }, - - { BHND_HWREV_LTE (6), - BHNDB_PCIE_QUIRK_L1_IDLE_THRESH }, - - { BHND_HWREV_GTE (6), - BHNDB_PCIE_QUIRK_SPROM_L23_PCI_RESET }, - - { BHND_HWREV_EQ (7), - BHNDB_PCIE_QUIRK_SERDES_NOPLLDOWN }, - - { BHND_HWREV_GTE (8), - BHNDB_PCIE_QUIRK_L1_TIMER_PERF }, - - { BHND_HWREV_GTE (10), - BHNDB_PCIE_QUIRK_SD_C22_EXTADDR }, - - BHND_DEVICE_QUIRK_END - } - }, - - { BHND_COREID_INVALID, BHND_PCI_REGFMT_PCI } -}; - - -/* quirk flag convenience macros */ -#define BHNDB_PCI_QUIRK(_sc, _name) \ - ((_sc)->quirks & BHNDB_PCI_QUIRK_ ## _name) -#define BHNDB_PCIE_QUIRK(_sc, _name) \ - ((_sc)->quirks & BHNDB_PCIE_QUIRK_ ## _name) - -#define BHNDB_PCI_ASSERT_QUIRK(_sc, name) \ - KASSERT(BHNDB_PCI_QUIRK((_sc), name), ("quirk " __STRING(_name) " not set")) -#define BHNDB_PCIE_ASSERT_QUIRK(_sc, name) \ - KASSERT(BHNDB_PCIE_QUIRK((_sc), name), ("quirk " __STRING(_name) " not set")) - - -/* bus_(read|write)_* convenience macros */ -#define BHNDB_PCI_READ_2(_sc, _reg) \ - bus_read_2((_sc)->mem_res, (_sc)->mem_off + (_reg)) -#define BHNDB_PCI_READ_4(_sc, _reg) \ - bus_read_4((_sc)->mem_res, (_sc)->mem_off + (_reg)) - -#define BHNDB_PCI_WRITE_2(_sc, _reg, _val) \ - bus_write_2((_sc)->mem_res, (_sc)->mem_off + (_reg), (_val)) -#define BHNDB_PCI_WRITE_4(_sc, _reg, _val) \ - bus_write_4((_sc)->mem_res, (_sc)->mem_off + (_reg), (_val)) - - -/* BHNDB_PCI_REG_* convenience macros */ -#define BPCI_REG_EXTRACT(_rv, _a) BHND_PCI_REG_EXTRACT(_rv, BHND_ ## _a) -#define BPCI_REG_INSERT(_rv, _a, _v) BHND_PCI_REG_INSERT(_rv, BHND_ ## _a, _v) - -#define BPCI_COMMON_REG_EXTRACT(_r, _a) \ - BHND_PCI_COMMON_REG_EXTRACT(sc->regfmt, _r, _a) - -#define BPCI_COMMON_REG_INSERT(_r, _a, _v) \ - BHND_PCI_COMMON_REG_INSERT(sc->regfmt, _r, _a, _v) - -#define BPCI_COMMON_REG(_name) \ - BHND_PCI_COMMON_REG(sc->regfmt, _name) - -#define BPCI_COMMON_REG_OFFSET(_base, _offset) \ - (BPCI_COMMON_REG(_base) + BPCI_COMMON_REG(_offset)) - /** * Default bhndb_pci implementation of device_probe(). * @@ -250,14 +113,8 @@ bhndb_pci_attach(device_t dev) if (pci_find_cap(device_get_parent(dev), PCIY_EXPRESS, ®) == 0) sc->pci_devclass = BHND_DEVCLASS_PCIE; - /* Determine the basic set of applicable quirks. This will be updated - * in bhndb_pci_init_full_config() once the PCI device core has - * been enumerated. */ - sc->quirks = bhndb_pci_discover_quirks(sc, NULL); - - /* Using the discovered quirks, apply any WARs required for basic - * register access. */ - if ((error = bhndb_pci_wars_register_access(sc))) + /* Enable clocks (if supported by this hardware) */ + if ((error = bhndb_enable_pci_clocks(sc))) return (error); /* Use siba(4)-compatible regwin handling until we know @@ -280,438 +137,108 @@ bhndb_pci_attach(device_t dev) return (0); } -/** - * Initialize the full bridge configuration. - * - * This is called during the DEVICE_ATTACH() process by the bridged bhndb(4) - * bus, prior to probe/attachment of child cores. - * - * At this point, we can introspect the enumerated cores, find our host - * bridge device, and apply any bridge-level hardware workarounds required - * for proper operation of the bridged device cores. - */ static int bhndb_pci_init_full_config(device_t dev, device_t child, - const struct bhndb_hw_priority *prio_table) + const struct bhndb_hw_priority *hw_prio_table) { - struct bhnd_core_info core; - const struct bhndb_pci_id *id; - struct bhndb_pci_softc *sc; - struct bhndb_region *pcir; - bhnd_addr_t pcir_addr; - bhnd_size_t pcir_size; - int error; + struct bhndb_pci_softc *sc; + int error; sc = device_get_softc(dev); - /* Let bhndb perform full discovery and initialization of the - * available register windows and bridge resources. */ - if ((error = bhndb_generic_init_full_config(dev, child, prio_table))) + /* Let our parent perform standard initialization first */ + if ((error = bhndb_generic_init_full_config(dev, child, hw_prio_table))) return (error); - /* - * Identify our PCI bridge core, its register family, and any - * applicable hardware quirks. - */ - KASSERT(sc->bhndb.hostb_dev, - ("missing hostb device\n")); - - core = bhnd_get_core_info(sc->bhndb.hostb_dev); - id = bhndb_pci_find_core_id(&core); - if (id == NULL) { - device_printf(dev, "%s %s hostb core is not recognized\n", - bhnd_vendor_name(core.vendor), bhnd_core_name(&core)); - } - - sc->regfmt = id->regfmt; - - /* Now that we've identified the PCI bridge core, we can determine the - * full set of device quirks */ - sc->quirks = bhndb_pci_discover_quirks(sc, id); - - /* - * Determine and save a reference to the bhndb resource and offset - * at which the bridge core's device registers are mapped. - * - * All known bhnd(4) hardware provides a fixed static mapping of - * the PCI core's registers. If this changes in the future -- which - * is unlikely -- this driver will need to be adjusted to use - * dynamic register windows. - */ - - /* Find base address and size of the PCI core's register block. */ - error = bhnd_get_region_addr(sc->bhndb.hostb_dev, BHND_PORT_DEVICE, 0, - 0, &pcir_addr, &pcir_size); - if (error) { - device_printf(dev, - "failed to locate PCI core registers\n"); - return (error); - } - - /* Find the bhndb_region that statically maps this block */ - pcir = bhndb_find_resource_region(sc->bhndb.bus_res, pcir_addr, - pcir_size); - if (pcir == NULL || pcir->static_regwin == NULL) { - device_printf(dev, - "missing static PCI core register window\n"); - return (ENXIO); - } - - /* Save borrowed reference to the mapped PCI core registers */ - sc->mem_off = pcir->static_regwin->win_offset; - sc->mem_res = bhndb_find_regwin_resource(sc->bhndb.bus_res, - pcir->static_regwin); - if (sc->mem_res == NULL || !(rman_get_flags(sc->mem_res) & RF_ACTIVE)) { - device_printf(dev, - "no active resource maps the PCI core register window\n"); - return (ENXIO); - } - - /* Configure a direct bhnd_resource wrapper that we can pass to - * bhnd_resource APIs */ - sc->bhnd_mem_res = (struct bhnd_resource) { - .res = sc->mem_res, - .direct = true - }; - - /* - * Attach MMIO device (if this is a PCIe device), which is used for - * access to the PCIe SerDes required by the quirk workarounds. - */ - if (sc->pci_devclass == BHND_DEVCLASS_PCIE) { - sc->mdio = BUS_ADD_CHILD(dev, 0, - devclass_get_name(bhnd_mdio_pci_devclass), 0); - if (sc->mdio == NULL) - return (ENXIO); - - error = bus_set_resource(sc->mdio, SYS_RES_MEMORY, 0, - rman_get_start(sc->mem_res) + sc->mem_off + - BHND_PCIE_MDIO_CTL, sizeof(uint32_t)*2); - if (error) { - device_printf(dev, "failed to set MDIO resource\n"); - return (error); - } - - if ((error = device_probe_and_attach(sc->mdio))) { - device_printf(dev, "failed to attach MDIO device\n"); - return (error); - } - } - - /* Apply any early one-time quirk workarounds */ - if ((error = bhndb_pci_wars_early_once(sc))) - return (error); - - /* Apply attach-time quirk workarounds, required before the bridged - * bhnd(4) bus itself performs a full attach(). */ - if ((error = bhndb_pci_wars_hwup(sc))) - return (error); - - return (0); -} - -/** - * Apply any hardware workarounds that must be executed prior to attempting - * register access on the bridged chipset. - * - * This must be called very early in attach() or resume(), after the basic - * set of applicable device quirks has been determined. - */ -static int -bhndb_pci_wars_register_access(struct bhndb_pci_softc *sc) -{ - int error; - - if (BHNDB_PCI_QUIRK(sc, EXT_CLOCK_GATING)) { - if ((error = bhndb_enable_pci_clocks(sc))) { - device_printf(sc->dev, "failed to enable clocks\n"); - return (error); - } - } - - return (0); -} - -/** - * Apply any hardware work-arounds that must be executed exactly once, early in - * the attach process. - * - * This must be called after core enumeration and discovery of all applicable - * quirks, but prior to probe/attach of any cores, parsing of - * SPROM, etc. - */ -static int -bhndb_pci_wars_early_once(struct bhndb_pci_softc *sc) -{ - /* Determine correct polarity by observing the attach-time PCIe PHY - * link status. This is used later to reset/force the SerDes - * polarity */ - if (BHNDB_PCIE_QUIRK(sc, SDR9_POLARITY)) { - uint32_t st; - bool inv; - - - st = bhndb_pcie_read_proto_reg(sc, BHND_PCIE_PLP_STATUSREG); - inv = ((st & BHND_PCIE_PLP_POLARITY_INV) != 0); - sc->sdr9_quirk_polarity.inv = inv; - } - - return (0); -} - -/** - * Apply any hardware workarounds that are required upon attach or resume - * of the bridge device. - */ -static int -bhndb_pci_wars_hwup(struct bhndb_pci_softc *sc) -{ - /* Note that the order here matters; these work-arounds - * should not be re-ordered without careful review of their - * interdependencies */ - - /* Fix up any PoR defaults on SROMless devices */ + /* Fix-up power on defaults for SROM-less devices. */ bhndb_init_sromless_pci_config(sc); - /* Enable PCI prefetch/burst/readmulti flags */ - if (BHNDB_PCI_QUIRK(sc, SBTOPCI2_PREF_BURST) || - BHNDB_PCI_QUIRK(sc, SBTOPCI2_READMULTI)) - { - uint32_t sbp2; - sbp2 = BHNDB_PCI_READ_4(sc, BHND_PCI_SBTOPCI2); - - if (BHNDB_PCI_QUIRK(sc, SBTOPCI2_PREF_BURST)) - sbp2 |= (BHND_PCI_SBTOPCI_PREF|BHND_PCI_SBTOPCI_BURST); - - if (BHNDB_PCI_QUIRK(sc, SBTOPCI2_READMULTI)) - sbp2 |= BHND_PCI_SBTOPCI_RC_READMULTI; - - BHNDB_PCI_WRITE_4(sc, BHND_PCI_SBTOPCI2, sbp2); - } - - /* Disable PCI CLKRUN# */ - if (BHNDB_PCI_QUIRK(sc, CLKRUN_DSBL)) { - uint32_t ctl; - - ctl = BHNDB_PCI_READ_4(sc, BHND_PCI_CLKRUN_CTL); - ctl |= BHND_PCI_CLKRUN_DSBL; - BHNDB_PCI_WRITE_4(sc, BHND_PCI_CLKRUN_CTL, ctl); - } - - /* Enable TLP unmatched address handling work-around */ - if (BHNDB_PCIE_QUIRK(sc, UR_STATUS_FIX)) { - uint32_t wrs; - wrs = bhndb_pcie_read_proto_reg(sc, BHND_PCIE_TLP_WORKAROUNDSREG); - wrs |= BHND_PCIE_TLP_WORKAROUND_URBIT; - bhndb_pcie_write_proto_reg(sc, BHND_PCIE_TLP_WORKAROUNDSREG, wrs); - } - - /* Adjust SerDes CDR tuning to ensure that CDR is stable before sending - * data during L0s to L0 exit transitions. */ - if (BHNDB_PCIE_QUIRK(sc, SDR9_L0s_HANG)) { - uint16_t sdv; - - /* Set RX track/acquire timers to 2.064us/40.96us */ - sdv = BPCI_REG_INSERT(0, PCIE_SDR9_RX_TIMER1_LKTRK, (2064/16)); - sdv = BPCI_REG_INSERT(sdv, PCIE_SDR9_RX_TIMER1_LKACQ, - (40960/1024)); - MDIO_WRITEREG(sc->mdio, BHND_PCIE_PHY_SDR9_TXRX, - BHND_PCIE_SDR9_RX_TIMER1, sdv); - - /* Apply CDR frequency workaround */ - sdv = BHND_PCIE_SDR9_RX_CDR_FREQ_OVR_EN; - sdv = BPCI_REG_INSERT(sdv, PCIE_SDR9_RX_CDR_FREQ_OVR, 0x0); - MDIO_WRITEREG(sc->mdio, BHND_PCIE_PHY_SDR9_TXRX, - BHND_PCIE_SDR9_RX_CDR, sdv); - - /* Apply CDR BW tunings */ - sdv = 0; - sdv = BPCI_REG_INSERT(sdv, PCIE_SDR9_RX_CDRBW_INTGTRK, 0x2); - sdv = BPCI_REG_INSERT(sdv, PCIE_SDR9_RX_CDRBW_INTGACQ, 0x4); - sdv = BPCI_REG_INSERT(sdv, PCIE_SDR9_RX_CDRBW_PROPTRK, 0x6); - sdv = BPCI_REG_INSERT(sdv, PCIE_SDR9_RX_CDRBW_PROPACQ, 0x6); - MDIO_WRITEREG(sc->mdio, BHND_PCIE_PHY_SDR9_TXRX, - BHND_PCIE_SDR9_RX_CDRBW, sdv); - } - - /* Force correct SerDes polarity */ - if (BHNDB_PCIE_QUIRK(sc, SDR9_POLARITY)) { - uint16_t rxctl; - - rxctl = MDIO_READREG(sc->mdio, BHND_PCIE_PHY_SDR9_TXRX, - BHND_PCIE_SDR9_RX_CTRL); - - rxctl |= BHND_PCIE_SDR9_RX_CTRL_FORCE; - if (sc->sdr9_quirk_polarity.inv) - rxctl |= BHND_PCIE_SDR9_RX_CTRL_POLARITY_INV; - else - rxctl &= ~BHND_PCIE_SDR9_RX_CTRL_POLARITY_INV; - - MDIO_WRITEREG(sc->mdio, BHND_PCIE_PHY_SDR9_TXRX, - BHND_PCIE_SDR9_RX_CTRL, rxctl); - } - - /* Disable startup retry on PLL frequency detection failure */ - if (BHNDB_PCIE_QUIRK(sc, SDR9_NO_FREQRETRY)) { - uint16_t pctl; - - pctl = MDIO_READREG(sc->mdio, BHND_PCIE_PHY_SDR9_PLL, - BHND_PCIE_SDR9_PLL_CTRL); - - pctl &= ~BHND_PCIE_SDR9_PLL_CTRL_FREQDET_EN; - MDIO_WRITEREG(sc->mdio, BHND_PCIE_PHY_SDR9_PLL, - BHND_PCIE_SDR9_PLL_CTRL, pctl); - } - - /* Explicitly enable PCI-PM */ - if (BHNDB_PCIE_QUIRK(sc, PCIPM_REQEN)) { - uint32_t lcreg; - lcreg = bhndb_pcie_read_proto_reg(sc, BHND_PCIE_DLLP_LCREG); - lcreg |= BHND_PCIE_DLLP_LCREG_PCIPM_EN; - bhndb_pcie_write_proto_reg(sc, BHND_PCIE_DLLP_LCREG, lcreg); - } - - /* Adjust L1 timer to fix slow L1->L0 transitions */ - if (BHNDB_PCIE_QUIRK(sc, L1_IDLE_THRESH)) { - uint32_t pmt; - pmt = bhndb_pcie_read_proto_reg(sc, BHND_PCIE_DLLP_PMTHRESHREG); - pmt = BPCI_REG_INSERT(pmt, PCIE_L1THRESHOLDTIME, - BHND_PCIE_L1THRESHOLD_WARVAL); - bhndb_pcie_write_proto_reg(sc, BHND_PCIE_DLLP_PMTHRESHREG, pmt); - } - - /* Extend L1 timer for better performance. - * TODO: We could enable/disable this on demand for better power - * savings if we tie this to HT clock request handling */ - if (BHNDB_PCIE_QUIRK(sc, L1_TIMER_PERF)) { - uint32_t pmt; - pmt = bhndb_pcie_read_proto_reg(sc, BHND_PCIE_DLLP_PMTHRESHREG); - pmt |= BHND_PCIE_ASPMTIMER_EXTEND; - bhndb_pcie_write_proto_reg(sc, BHND_PCIE_DLLP_PMTHRESHREG, pmt); - } - - /* Enable L23READY_EXIT_NOPRST if not already set in SPROM. */ - if (BHNDB_PCIE_QUIRK(sc, SPROM_L23_PCI_RESET)) { - bus_size_t reg; - uint16_t cfg; - - /* Fetch the misc cfg flags from SPROM */ - reg = BHND_PCIE_SPROM_SHADOW + BHND_PCIE_SRSH_PCIE_MISC_CONFIG; - cfg = BHNDB_PCI_READ_2(sc, reg); - - /* Write EXIT_NOPRST flag if not already set in SPROM */ - if (!(cfg & BHND_PCIE_SRSH_L23READY_EXIT_NOPRST)) { - cfg |= BHND_PCIE_SRSH_L23READY_EXIT_NOPRST; - BHNDB_PCI_WRITE_2(sc, reg, cfg); - } - } - - return (0); -} - -/** - * Apply any hardware workarounds that are required upon resume of the - * bridge device. - * - * This must be called before any bridged bhnd(4) cores have been resumed. - */ -static int -bhndb_pci_wars_hwresume(struct bhndb_pci_softc *sc) -{ - int error; - - /* Nothing is possible without register access */ - if ((error = bhndb_pci_wars_register_access(sc))) - return (error); - - /* Apply the general hwup workarounds */ - return (bhndb_pci_wars_hwup(sc)); -} - -/** - * Apply any hardware workarounds that are required upon detach or suspend - * of the bridge device. - */ -static int -bhndb_pci_wars_hwdown(struct bhndb_pci_softc *sc) -{ - int error; - - /* Reduce L1 timer for better power savings. - * TODO: We could enable/disable this on demand for better power - * savings if we tie this to HT clock request handling */ - if (BHNDB_PCIE_QUIRK(sc, L1_TIMER_PERF)) { - uint32_t pmt; - pmt = bhndb_pcie_read_proto_reg(sc, BHND_PCIE_DLLP_PMTHRESHREG); - pmt &= ~BHND_PCIE_ASPMTIMER_EXTEND; - bhndb_pcie_write_proto_reg(sc, BHND_PCIE_DLLP_PMTHRESHREG, pmt); - } - - /* Disable clocks */ - if (BHNDB_PCI_QUIRK(sc, EXT_CLOCK_GATING)) { - if ((error = bhndb_disable_pci_clocks(sc))) { - device_printf(sc->dev, "failed to disable clocks\n"); - return (error); - } - } - return (0); } /* * On devices without a SROM, the PCI(e) cores will be initialized with - * their Power-on-Reset defaults; this can leave the the BAR0 PCI windows - * potentially mapped to the wrong core index. + * their Power-on-Reset defaults; this can leave two of the BAR0 PCI windows + * mapped to the wrong core. * - * This function updates the PCI core's BAR0 PCI configuration to point at the + * This function updates the SROM shadow to point the BAR0 windows at the * current PCI core. * - * Applies to all PCI/PCIe revisions. Must be applied before bus devices - * are probed/attached or the SPROM is parsed. + * Applies to all PCI/PCIe revisions. */ static void bhndb_init_sromless_pci_config(struct bhndb_pci_softc *sc) { - bus_size_t sprom_addr; - u_int sprom_core_idx; - u_int pci_core_idx; - uint16_t val; + struct bhndb_resources *bres; + const struct bhndb_hwcfg *cfg; + const struct bhndb_regwin *win; + struct resource *core_regs; + bus_size_t srom_offset; + u_int pci_cidx, sprom_cidx; + uint16_t val; + + bres = sc->bhndb.bus_res; + cfg = bres->cfg; + + if (bhnd_get_vendor(sc->bhndb.hostb_dev) != BHND_MFGID_BCM) + return; + + switch (bhnd_get_device(sc->bhndb.hostb_dev)) { + case BHND_COREID_PCI: + srom_offset = BHND_PCI_SRSH_PI_OFFSET; + break; + case BHND_COREID_PCIE: + srom_offset = BHND_PCIE_SRSH_PI_OFFSET; + break; + default: + device_printf(sc->dev, "unsupported PCI host bridge device\n"); + return; + } + + /* Locate the static register window mapping the PCI core */ + win = bhndb_regwin_find_core(cfg->register_windows, sc->pci_devclass, + 0, BHND_PORT_DEVICE, 0, 0); + if (win == NULL) { + device_printf(sc->dev, "missing PCI core register window\n"); + return; + } + + /* Fetch the resource containing the register window */ + core_regs = bhndb_find_regwin_resource(bres, win); + if (core_regs == NULL) { + device_printf(sc->dev, "missing PCI core register resource\n"); + return; + } /* Fetch the SPROM's configured core index */ - sprom_addr = BPCI_COMMON_REG_OFFSET(SPROM_SHADOW, SRSH_PI_OFFSET); - val = BHNDB_PCI_READ_2(sc, sprom_addr); + val = bus_read_2(core_regs, win->win_offset + srom_offset); + sprom_cidx = (val & BHND_PCI_SRSH_PI_MASK) >> BHND_PCI_SRSH_PI_SHIFT; /* If it doesn't match host bridge's core index, update the index * value */ - sprom_core_idx = BPCI_COMMON_REG_EXTRACT(val, SRSH_PI); - pci_core_idx = bhnd_get_core_index(sc->bhndb.hostb_dev); - - if (sprom_core_idx != pci_core_idx) { - val = BPCI_COMMON_REG_INSERT(val, SRSH_PI, pci_core_idx); - BHNDB_PCI_WRITE_2(sc, sprom_addr, val); + pci_cidx = bhnd_get_core_index(sc->bhndb.hostb_dev); + if (sprom_cidx != pci_cidx) { + val &= ~BHND_PCI_SRSH_PI_MASK; + val |= (pci_cidx << BHND_PCI_SRSH_PI_SHIFT); + bus_write_2(core_regs, + win->win_offset + srom_offset, val); } } static int -bhndb_pci_detach(device_t dev) +bhndb_pci_resume(device_t dev) { struct bhndb_pci_softc *sc; int error; sc = device_get_softc(dev); - - if ((error = bhndb_generic_detach(dev))) - return (error); - - /* Apply any hardware workarounds. This may disable the clock, and - * thus must be called *after* any children have been detached. */ - if ((error = bhndb_pci_wars_hwdown(sc))) + + /* Enable clocks (if supported by this hardware) */ + if ((error = bhndb_enable_pci_clocks(sc))) return (error); - /* Disable PCI bus mastering */ - pci_disable_busmaster(device_get_parent(dev)); - - return (0); + /* Perform resume */ + return (bhndb_generic_resume(dev)); } static int @@ -721,35 +248,34 @@ bhndb_pci_suspend(device_t dev) int error; sc = device_get_softc(dev); - - if ((error = bhndb_generic_suspend(dev))) - return (error); - - /* Apply any hardware workarounds. This may disable the clock, and - * thus must be called *after* any children have been suspended. */ - if ((error = bhndb_pci_wars_hwdown(sc))) + + /* Disable clocks (if supported by this hardware) */ + if ((error = bhndb_disable_pci_clocks(sc))) return (error); - return (0); + /* Perform suspend */ + return (bhndb_generic_suspend(dev)); } static int -bhndb_pci_resume(device_t dev) +bhndb_pci_detach(device_t dev) { struct bhndb_pci_softc *sc; int error; sc = device_get_softc(dev); - /* Apply any resume workarounds; these may be required for bridged - * device access, and thus must be called *before* any children are - * resumed. */ - if ((error = bhndb_pci_wars_hwresume(sc))) + /* Disable clocks (if supported by this hardware) */ + if ((error = bhndb_disable_pci_clocks(sc))) return (error); - if ((error = bhndb_generic_resume(dev))) + /* Perform detach */ + if ((error = bhndb_generic_detach(dev))) return (error); + /* Disable PCI bus mastering */ + pci_disable_busmaster(device_get_parent(dev)); + return (0); } @@ -826,54 +352,14 @@ bhndb_pci_fast_setregwin(struct bhndb_pc return (0); } - /** - * Read a 32-bit PCIe TLP/DLLP/PLP protocol register. + * Enable externally managed clocks, if required. * - * @param sc The bhndb_pci driver state. - * @param addr The protocol register offset. - */ -static uint32_t -bhndb_pcie_read_proto_reg(struct bhndb_pci_softc *sc, uint32_t addr) -{ - uint32_t val; - - KASSERT(bhnd_get_class(sc->bhndb.hostb_dev) == BHND_DEVCLASS_PCIE, - ("not a pcie device!")); - - BHNDB_LOCK(&sc->bhndb); - BHNDB_PCI_WRITE_4(sc, BHND_PCIE_IND_ADDR, addr); - val = BHNDB_PCI_READ_4(sc, BHND_PCIE_IND_DATA); - BHNDB_UNLOCK(&sc->bhndb); - - return (val); -} - -/** - * Write a 32-bit PCIe TLP/DLLP/PLP protocol register value. - * - * @param sc The bhndb_pci driver state. - * @param addr The protocol register offset. - * @param val The value to write to @p addr. - */ -static void -bhndb_pcie_write_proto_reg(struct bhndb_pci_softc *sc, uint32_t addr, - uint32_t val) -{ - KASSERT(bhnd_get_class(sc->bhndb.hostb_dev) == BHND_DEVCLASS_PCIE, - ("not a pcie device!")); - - BHNDB_LOCK(&sc->bhndb); - BHNDB_PCI_WRITE_4(sc, BHND_PCIE_IND_ADDR, addr); - BHNDB_PCI_WRITE_4(sc, BHND_PCIE_IND_DATA, val); - BHNDB_UNLOCK(&sc->bhndb); -} - - -/** - * Enable externally managed clocks. - * - * Quirk Required: EXT_CLOCK_GATING + * Some PCI chipsets (BCM4306, possibly others) chips do not support + * the idle low-power clock. Clocking must be bootstrapped at + * attach/resume by directly adjusting GPIO registers exposed in the + * PCI config space, and correspondingly, explicitly shutdown at + * detach/suspend. * * @param sc Bridge driver state. */ @@ -885,7 +371,9 @@ bhndb_enable_pci_clocks(struct bhndb_pci uint32_t gpio_flags; uint16_t pci_status; - BHNDB_PCI_ASSERT_QUIRK(sc, EXT_CLOCK_GATING); + /* Only supported and required on PCI devices */ + if (sc->pci_devclass != BHND_DEVCLASS_PCI) + return (0); pci_parent = device_get_parent(sc->dev); @@ -921,9 +409,7 @@ bhndb_enable_pci_clocks(struct bhndb_pci } /** - * Disable externally managed clocks. - * - * Quirk Required: EXT_CLOCK_GATING + * Disable externally managed clocks, if required. * * @param sc Bridge driver state. */ @@ -933,7 +419,9 @@ bhndb_disable_pci_clocks(struct bhndb_pc device_t parent_dev; uint32_t gpio_out, gpio_en; - BHNDB_PCI_ASSERT_QUIRK(sc, EXT_CLOCK_GATING); + /* Only supported and required on PCI devices */ + if (sc->pci_devclass != BHND_DEVCLASS_PCI) + return (0); parent_dev = device_get_parent(sc->dev); @@ -957,111 +445,13 @@ bhndb_disable_pci_clocks(struct bhndb_pc return (0); } - -/** - * Find the identification table entry for a core descriptor. - * - * @param sc bhndb PCI driver state. - */ -static const struct bhndb_pci_id * -bhndb_pci_find_core_id(struct bhnd_core_info *core) -{ - const struct bhndb_pci_id *id; - - for (id = bhndb_pci_ids; id->device != BHND_COREID_INVALID; id++) { - if (core->vendor == BHND_MFGID_BCM && - core->device == id->device) - return (id); - } - - return (NULL); -} - -/** - * Return all quirks known to be applicable to the host bridge. - * - * If the PCI bridge core has not yet been identified, no core-specific - * quirk flags will be returned. This function may be called again to - * rediscover applicable quirks after the host bridge core has been - * identified. - * - * @param sc bhndb PCI driver state. - * @param id The host bridge core's identification table entry, or NULL - * if the host bridge core has not yet been identified. - * - * @return Returns the set of quirks applicable to the current hardware. - */ -static uint32_t -bhndb_pci_discover_quirks(struct bhndb_pci_softc *sc, - const struct bhndb_pci_id *id) -{ - struct bhnd_device_quirk *qt; - uint32_t quirks; - uint8_t hwrev; - - quirks = BHNDB_PCI_QUIRK_NONE; - - /* Determine any device class-specific quirks */ - switch (sc->pci_devclass) { - case BHND_DEVCLASS_PCI: - /* All PCI devices require external clock gating */ - sc->quirks |= BHNDB_PCI_QUIRK_EXT_CLOCK_GATING; - break; - default: - break; - } - - // TODO: Additional quirk matching - - /* Determine any PCI core hwrev-specific device quirks */ - if (id != NULL) { - hwrev = bhnd_get_hwrev(sc->bhndb.hostb_dev); - for (qt = id->quirks; qt->quirks != 0; qt++) { - if (bhnd_hwrev_matches(hwrev, &qt->hwrev)) - quirks |= qt->quirks; - } - } - - - return (quirks); -} - -/* - * Support for attaching the PCIe-Gen1 MDIO driver to a parent bhndb PCIe - * bridge device. - */ -static int -bhndb_mdio_pcie_probe(device_t dev) -{ - device_quiet(dev); - return (BUS_PROBE_NOWILDCARD); -} - -static int -bhndb_mdio_pcie_attach(device_t dev) -{ - struct bhndb_pci_softc *psc; - psc = device_get_softc(device_get_parent(dev)); - return (bhnd_mdio_pcie_attach(dev, - &psc->bhnd_mem_res, -1, - psc->mem_off + BHND_PCIE_MDIO_CTL, - (psc->quirks & BHNDB_PCIE_QUIRK_SD_C22_EXTADDR) != 0)); -} - -static device_method_t bhnd_mdio_pcie_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, bhndb_mdio_pcie_probe), - DEVMETHOD(device_attach, bhndb_mdio_pcie_attach), - DEVMETHOD_END -}; - static device_method_t bhndb_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bhndb_pci_probe), DEVMETHOD(device_attach, bhndb_pci_attach), - DEVMETHOD(device_detach, bhndb_pci_detach), - DEVMETHOD(device_suspend, bhndb_pci_suspend), DEVMETHOD(device_resume, bhndb_pci_resume), + DEVMETHOD(device_suspend, bhndb_pci_suspend), + DEVMETHOD(device_detach, bhndb_pci_detach), /* BHNDB interface */ DEVMETHOD(bhndb_init_full_config, bhndb_pci_init_full_config), @@ -1073,12 +463,6 @@ static device_method_t bhndb_pci_methods DEFINE_CLASS_1(bhndb, bhndb_pci_driver, bhndb_pci_methods, sizeof(struct bhndb_pci_softc), bhndb_driver); -DEFINE_CLASS_1(bhnd_mdio_pci, bhndb_mdio_pcie_driver, bhnd_mdio_pcie_methods, - sizeof(struct bhnd_mdio_pcie_softc), bhnd_mdio_pcie_driver); - -DRIVER_MODULE(bhnd_mdio_pcie, bhndb, bhndb_mdio_pcie_driver, - bhnd_mdio_pci_devclass, NULL, NULL); - MODULE_VERSION(bhndb_pci, 1); MODULE_DEPEND(bhndb_pci, bhnd_pci, 1, 1, 1); MODULE_DEPEND(bhndb_pci, pci, 1, 1, 1); Modified: head/sys/dev/bhnd/bhndb/bhndb_pcivar.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pcivar.h Fri Apr 22 16:20:58 2016 (r298478) +++ head/sys/dev/bhnd/bhndb/bhndb_pcivar.h Fri Apr 22 16:26:53 2016 (r298479) @@ -32,10 +32,6 @@ #ifndef _BHND_BHNDB_PCIVAR_H_ #define _BHND_BHNDB_PCIVAR_H_ -#include - -#include - #include "bhndbvar.h" /* @@ -52,191 +48,11 @@ struct bhndb_pci_softc; typedef int (*bhndb_pci_set_regwin_t)(struct bhndb_pci_softc *sc, const struct bhndb_regwin *rw, bhnd_addr_t addr); - -/** - * PCI bridge core identification table. - */ -struct bhndb_pci_id { - uint16_t device; /**< bhnd device ID */ - bhnd_pci_regfmt_t regfmt; /**< register format */ - struct bhnd_device_quirk *quirks; /**< quirks table */ -}; - struct bhndb_pci_softc { struct bhndb_softc bhndb; /**< parent softc */ device_t dev; /**< bridge device */ bhnd_devclass_t pci_devclass; /**< PCI core's devclass */ bhndb_pci_set_regwin_t set_regwin; /**< regwin handler */ - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 22 16:27:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0894EB19A03; Fri, 22 Apr 2016 16:27:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C79411794; Fri, 22 Apr 2016 16:27:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MGRZsa091794; Fri, 22 Apr 2016 16:27:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MGRZ3f091793; Fri, 22 Apr 2016 16:27:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604221627.u3MGRZ3f091793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 22 Apr 2016 16:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298480 - head/sys/dev/bhnd/bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 16:27:37 -0000 Author: adrian Date: Fri Apr 22 16:27:35 2016 New Revision: 298480 URL: https://svnweb.freebsd.org/changeset/base/298480 Log: [bhnd] Update bhndb format strings to match long -> rman_res_t size change. Does what it says on the tin; this unbreaks 32-bit builds. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D5764 Modified: head/sys/dev/bhnd/bhndb/bhndb.c Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Fri Apr 22 16:26:53 2016 (r298479) +++ head/sys/dev/bhnd/bhndb/bhndb.c Fri Apr 22 16:27:35 2016 (r298480) @@ -757,7 +757,7 @@ bhndb_suspend_resource(device_t dev, dev } if (BHNDB_DEBUG(PRIO)) - device_printf(child, "suspend resource type=%d 0x%lx+0x%lx\n", + device_printf(child, "suspend resource type=%d 0x%jx+0x%jx\n", type, rman_get_start(r), rman_get_size(r)); /* Release the resource's window reference */ @@ -785,7 +785,7 @@ bhndb_resume_resource(device_t dev, devi return (0); if (BHNDB_DEBUG(PRIO)) - device_printf(child, "resume resource type=%d 0x%lx+0x%lx\n", + device_printf(child, "resume resource type=%d 0x%jx+0x%jx\n", type, rman_get_start(r), rman_get_size(r)); return (bhndb_try_activate_resource(sc, rman_get_device(r), type, From owner-svn-src-all@freebsd.org Fri Apr 22 16:28:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66D8EB19AAA; Fri, 22 Apr 2016 16:28:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 386301991; Fri, 22 Apr 2016 16:28:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MGSfpG091875; Fri, 22 Apr 2016 16:28:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MGSfT7091874; Fri, 22 Apr 2016 16:28:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604221628.u3MGSfT7091874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 22 Apr 2016 16:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298481 - head/sys/dev/bhnd/bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 16:28:42 -0000 Author: adrian Date: Fri Apr 22 16:28:41 2016 New Revision: 298481 URL: https://svnweb.freebsd.org/changeset/base/298481 Log: [bhnd] use correct bus deallocation method Submitted by: Mizhka Zhilin Differential Revision: https://reviews.freebsd.org/D5647 Modified: head/sys/dev/bhnd/bhndb/bhndb.c Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Fri Apr 22 16:27:35 2016 (r298480) +++ head/sys/dev/bhnd/bhndb/bhndb.c Fri Apr 22 16:28:41 2016 (r298481) @@ -1928,7 +1928,7 @@ static device_method_t bhndb_methods[] = DEVMETHOD(bhnd_bus_is_hostb_device, bhndb_is_hostb_device), DEVMETHOD(bhnd_bus_get_chipid, bhndb_get_chipid), DEVMETHOD(bhnd_bus_activate_resource, bhndb_activate_bhnd_resource), - DEVMETHOD(bhnd_bus_activate_resource, bhndb_deactivate_bhnd_resource), + DEVMETHOD(bhnd_bus_deactivate_resource, bhndb_deactivate_bhnd_resource), DEVMETHOD(bhnd_bus_read_1, bhndb_bus_read_1), DEVMETHOD(bhnd_bus_read_2, bhndb_bus_read_2), DEVMETHOD(bhnd_bus_read_4, bhndb_bus_read_4), From owner-svn-src-all@freebsd.org Fri Apr 22 16:57:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54326B1832A; Fri, 22 Apr 2016 16:57:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1396C16FC; Fri, 22 Apr 2016 16:57:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MGvhm5000707; Fri, 22 Apr 2016 16:57:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MGvgbV000700; Fri, 22 Apr 2016 16:57:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604221657.u3MGvgbV000700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 22 Apr 2016 16:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298482 - in head/sys: amd64/amd64 amd64/linux amd64/linux32 compat/linux dev/cxgbe/tom i386/linux vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 16:57:44 -0000 Author: pfg Date: Fri Apr 22 16:57:42 2016 New Revision: 298482 URL: https://svnweb.freebsd.org/changeset/base/298482 Log: Cleanup redundant parenthesis from existing howmany()/roundup() macro uses. Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linux/linux_file.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/i386/linux/linux_sysvec.c head/sys/vm/vm_radix.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Apr 22 16:28:41 2016 (r298481) +++ head/sys/amd64/amd64/pmap.c Fri Apr 22 16:57:42 2016 (r298482) @@ -676,7 +676,7 @@ allocpages(vm_paddr_t *firstaddr, int n) CTASSERT(powerof2(NDMPML4E)); /* number of kernel PDP slots */ -#define NKPDPE(ptpgs) howmany((ptpgs), NPDEPG) +#define NKPDPE(ptpgs) howmany(ptpgs, NPDEPG) static void nkpt_init(vm_paddr_t addr) Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Fri Apr 22 16:28:41 2016 (r298481) +++ head/sys/amd64/linux/linux_sysvec.c Fri Apr 22 16:57:42 2016 (r298482) @@ -346,7 +346,7 @@ linux_copyout_strings(struct image_param destp = (caddr_t)arginfo - SPARE_USRSPACE - roundup(sizeof(canary), sizeof(char *)) - roundup(execpath_len, sizeof(char *)) - - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *)); if (execpath_len != 0) { imgp->execpathp = (uintptr_t)arginfo - execpath_len; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Fri Apr 22 16:28:41 2016 (r298481) +++ head/sys/amd64/linux32/linux32_sysvec.c Fri Apr 22 16:57:42 2016 (r298482) @@ -862,7 +862,7 @@ linux_copyout_strings(struct image_param destp = (caddr_t)arginfo - SPARE_USRSPACE - roundup(sizeof(canary), sizeof(char *)) - roundup(execpath_len, sizeof(char *)) - - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *)); if (execpath_len != 0) { imgp->execpathp = (uintptr_t)arginfo - execpath_len; Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Apr 22 16:28:41 2016 (r298481) +++ head/sys/compat/linux/linux_file.c Fri Apr 22 16:57:42 2016 (r298482) @@ -305,11 +305,10 @@ struct l_dirent64 { * at least glibc-2.7 requires it. That is why l_dirent is padded with 2 bytes. */ #define LINUX_RECLEN(namlen) \ - roundup((offsetof(struct l_dirent, d_name) + (namlen) + 2), \ - sizeof(l_ulong)) + roundup(offsetof(struct l_dirent, d_name) + (namlen) + 2, sizeof(l_ulong)) #define LINUX_RECLEN64(namlen) \ - roundup((offsetof(struct l_dirent64, d_name) + (namlen) + 1), \ + roundup(offsetof(struct l_dirent64, d_name) + (namlen) + 1, \ sizeof(uint64_t)) #define LINUX_MAXRECLEN max(LINUX_RECLEN(LINUX_NAME_MAX), \ Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Fri Apr 22 16:28:41 2016 (r298481) +++ head/sys/dev/cxgbe/tom/t4_tom.c Fri Apr 22 16:57:42 2016 (r298482) @@ -129,7 +129,7 @@ alloc_toepcb(struct vi_info *vi, int txq * units of 16 byte. Calculate the maximum work requests possible. */ txsd_total = tx_credits / - howmany((sizeof(struct fw_ofld_tx_data_wr) + 1), 16); + howmany(sizeof(struct fw_ofld_tx_data_wr) + 1, 16); if (txqid < 0) txqid = (arc4random() % vi->nofldtxq) + vi->first_ofld_txq; Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Fri Apr 22 16:28:41 2016 (r298481) +++ head/sys/i386/linux/linux_sysvec.c Fri Apr 22 16:57:42 2016 (r298482) @@ -320,7 +320,7 @@ linux_copyout_strings(struct image_param destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform - roundup(sizeof(canary), sizeof(char *)) - roundup(execpath_len, sizeof(char *)) - - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *)); /* * install LINUX_PLATFORM Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Fri Apr 22 16:28:41 2016 (r298481) +++ head/sys/vm/vm_radix.c Fri Apr 22 16:57:42 2016 (r298482) @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); #define VM_RADIX_COUNT (1 << VM_RADIX_WIDTH) #define VM_RADIX_MASK (VM_RADIX_COUNT - 1) #define VM_RADIX_LIMIT \ - (howmany((sizeof(vm_pindex_t) * NBBY), VM_RADIX_WIDTH) - 1) + (howmany(sizeof(vm_pindex_t) * NBBY, VM_RADIX_WIDTH) - 1) /* Flag bits stored in node pointers. */ #define VM_RADIX_ISLEAF 0x1 From owner-svn-src-all@freebsd.org Fri Apr 22 17:02:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E3FB18616; Fri, 22 Apr 2016 17:02:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1203B1C02; Fri, 22 Apr 2016 17:02:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CE18CB93A; Fri, 22 Apr 2016 13:02:36 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298426 - head/sys/dev/fdc Date: Fri, 22 Apr 2016 09:43:47 -0700 Message-ID: <4396944.pMOIsoy4We@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <57191F7F.4010900@selasky.org> References: <201604211837.u3LIbalm092252@repo.freebsd.org> <57191F7F.4010900@selasky.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 22 Apr 2016 13:02:36 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 17:02:38 -0000 On Thursday, April 21, 2016 08:44:15 PM Hans Petter Selasky wrote: > On 04/21/16 20:37, John Baldwin wrote: > > - tsleep(fdc, PRIBIO, "fdcrst", hz); > > + if (cold) > > + DELAY(1000000); > > + else > > + tsleep(fdc, PRIBIO, "fdcrst", hz); > > Hi, > > pause() and pause_sbt() does exactly this, checking for "cold" and using > DELAY(). Yes, I know. In theory though the driver interrupt could fire during normal operation aborting the sleep, so the wait channel for the !cold case is actually there for a reason it seems. (That is, in the !cold case the driver might terminate the sleep early which you can't do with pause.) -- John Baldwin From owner-svn-src-all@freebsd.org Fri Apr 22 17:02:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42D2BB1863F; Fri, 22 Apr 2016 17:02:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E81011D64; Fri, 22 Apr 2016 17:02:48 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MH2mxr003543; Fri, 22 Apr 2016 17:02:48 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MH2lR7003539; Fri, 22 Apr 2016 17:02:47 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604221702.u3MH2lR7003539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 Apr 2016 17:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298483 - in head: etc/mtree usr.sbin/extattr usr.sbin/extattr/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 17:02:49 -0000 Author: asomers Date: Fri Apr 22 17:02:47 2016 New Revision: 298483 URL: https://svnweb.freebsd.org/changeset/base/298483 Log: Add ATF tests for usr.sbin/extattr Add ATF tests for the existing behavior of setextattr, rmextattr, lsextattr, and getextattr. Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D5889 Added: head/usr.sbin/extattr/tests/ head/usr.sbin/extattr/tests/Makefile (contents, props changed) head/usr.sbin/extattr/tests/extattr_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.sbin/extattr/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Fri Apr 22 16:57:42 2016 (r298482) +++ head/etc/mtree/BSD.tests.dist Fri Apr 22 17:02:47 2016 (r298483) @@ -640,6 +640,8 @@ usr.sbin etcupdate .. + extattr + .. fstyp .. makefs Modified: head/usr.sbin/extattr/Makefile ============================================================================== --- head/usr.sbin/extattr/Makefile Fri Apr 22 16:57:42 2016 (r298482) +++ head/usr.sbin/extattr/Makefile Fri Apr 22 17:02:47 2016 (r298483) @@ -11,4 +11,10 @@ MLINKS+= rmextattr.8 setextattr.8 MLINKS+= rmextattr.8 getextattr.8 MLINKS+= rmextattr.8 lsextattr.8 +.include + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.sbin/extattr/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/extattr/tests/Makefile Fri Apr 22 17:02:47 2016 (r298483) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH= extattr_test + +.include Added: head/usr.sbin/extattr/tests/extattr_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/extattr/tests/extattr_test.sh Fri Apr 22 17:02:47 2016 (r298483) @@ -0,0 +1,290 @@ +# +# Copyright (c) 2016 Spectra Logic Corp +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +atf_test_case bad_namespace +bad_namespace_head() { + atf_set "descr" "Can't set attributes for nonexistent namespaces" +} +bad_namespace_body() { + touch foo + atf_check -s not-exit:0 -e match:"Invalid argument" \ + setextattr badnamespace myattr X foo + atf_check -s not-exit:0 -e match:"Invalid argument" \ + lsextattr -q badnamespace foo +} + +atf_test_case hex +hex_head() { + atf_set "descr" "Set and get attribute values in hexadecimal" +} +hex_body() { + touch foo + atf_check -s exit:0 -o empty setextattr user myattr1 XYZ foo + atf_check -s exit:0 -o inline:"58 59 5a\n" \ + getextattr -qx user myattr1 foo +} + +atf_test_case long_name +long_name_head() { + atf_set "descr" "A maximum length attribute name" +} +long_name_body() { + # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965 + atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names" + + ATTRNAME=`jot -b X -s "" 255 0` + touch foo + atf_check -s exit:0 -o empty setextattr user $ATTRNAME myvalue foo + atf_check -s exit:0 -o inline:"${ATTRNAME}\n" lsextattr -q user foo + atf_check -s exit:0 -o inline:"myvalue\n" \ + getextattr -q user ${ATTRNAME} foo + atf_check -s exit:0 -o empty rmextattr user ${ATTRNAME} foo + atf_check -s exit:0 -o empty lsextattr -q user foo +} + +atf_test_case noattrs +noattrs_head() { + atf_set "descr" "A file with no extended attributes" +} +noattrs_body() { + touch foo + atf_check -s exit:0 -o empty lsextattr -q user foo +} + +atf_test_case nonexistent_file +nonexistent_file_head() { + atf_set "descr" "A file that does not exist" +} +nonexistent_file_body() { + atf_check -s exit:1 -e match:"No such file or directory" \ + lsextattr user foo + atf_check -s exit:1 -e match:"No such file or directory" \ + setextattr user myattr myvalue foo + atf_check -s exit:1 -e match:"No such file or directory" \ + getextattr user myattr foo + atf_check -s exit:1 -e match:"No such file or directory" \ + rmextattr user myattr foo +} + +atf_test_case null +null_head() { + atf_set "descr" "NUL-terminate an attribute value" +} +null_body() { + touch foo + atf_check -s exit:0 -o empty setextattr -n user myattr myvalue foo + atf_check -s exit:0 -o inline:"myvalue\0\n" getextattr -q user myattr foo +} + +atf_test_case one_user_attr +one_user_attr_head() { + atf_set "descr" "A file with one extended attribute" +} +one_user_attr_body() { + touch foo + atf_check -s exit:0 -o empty setextattr user myattr myvalue foo + atf_check -s exit:0 -o inline:"myattr\n" lsextattr -q user foo + atf_check -s exit:0 -o inline:"myvalue\n" getextattr -q user myattr foo + atf_check -s exit:0 -o empty rmextattr user myattr foo + atf_check -s exit:0 -o empty lsextattr -q user foo +} + +atf_test_case one_system_attr +one_system_attr_head() { + atf_set "descr" "A file with one extended attribute" + atf_set "require.user" "root" +} +one_system_attr_body() { + touch foo + atf_check -s exit:0 -o empty setextattr system myattr myvalue foo + atf_check -s exit:0 -o inline:"myattr\n" lsextattr -q system foo + atf_check -s exit:0 -o inline:"myvalue\n" getextattr -q system myattr foo + atf_check -s exit:0 -o empty rmextattr system myattr foo + atf_check -s exit:0 -o empty lsextattr -q system foo +} + +atf_test_case stringify +stringify_head() { + atf_set "descr" "Stringify the output of getextattr" +} +stringify_body() { + touch foo + atf_check -s exit:0 -o empty setextattr user myattr "my value" foo + atf_check -s exit:0 -o inline:"\"my\\\040value\"\n" \ + getextattr -qs user myattr foo +} + +atf_test_case symlink +symlink_head() { + atf_set "descr" "A symlink to an ordinary file" +} +symlink_body() { + touch foo + ln -s foo foolink + atf_check -s exit:0 -o empty setextattr user myattr myvalue foolink + atf_check -s exit:0 -o inline:"myvalue\n" \ + getextattr -q user myattr foolink + atf_check -s exit:0 -o inline:"myvalue\n" getextattr -q user myattr foo +} + +atf_test_case symlink_nofollow +symlink_nofollow_head() { + atf_set "descr" "Operating directly on a symlink" +} +symlink_nofollow_body() { + touch foo + ln -s foo foolink + # Check that with -h we can operate directly on the link + atf_check -s exit:0 -o empty setextattr -h user myattr myvalue foolink + atf_check -s exit:0 -o inline:"myvalue\n" \ + getextattr -qh user myattr foolink + atf_check -s exit:1 -e match:"Attribute not found" \ + getextattr user myattr foolink + atf_check -s exit:1 -e match:"Attribute not found" \ + getextattr user myattr foo + + # Check that with -h we cannot operate on the destination file + atf_check -s exit:0 -o empty setextattr user otherattr othervalue foo + atf_check -s exit:1 getextattr -qh user otherattr foolink +} + +atf_test_case system_and_user_attrs +system_and_user_attrs_head() { + atf_set "descr" "A file with both system and user extended attributes" + atf_set "require.user" "root" +} +system_and_user_attrs_body() { + touch foo + atf_check -s exit:0 -o empty setextattr user userattr userval foo + atf_check -s exit:0 -o empty setextattr system sysattr sysval foo + atf_check -s exit:0 -o inline:"userattr\n" lsextattr -q user foo + atf_check -s exit:0 -o inline:"sysattr\n" lsextattr -q system foo + + atf_check -s exit:0 -o inline:"userval\n" getextattr -q user userattr foo + atf_check -s exit:0 -o inline:"sysval\n" getextattr -q system sysattr foo + atf_check -s exit:0 -o empty rmextattr user userattr foo + atf_check -s exit:0 -o empty rmextattr system sysattr foo + atf_check -s exit:0 -o empty lsextattr -q user foo + atf_check -s exit:0 -o empty lsextattr -q system foo +} + +atf_test_case two_files +two_files_head() { + atf_set "descr" "Manipulate two files" +} +two_files_body() { + touch foo bar + atf_check -s exit:0 -o empty setextattr user myattr myvalue foo bar + atf_check -s exit:0 -o inline:"foo\tmyattr\nbar\tmyattr\n" \ + lsextattr user foo bar + atf_check -s exit:0 \ + -o inline:"foo\tmyvalue\nbar\tmyvalue\n" \ + getextattr user myattr foo bar + atf_check -s exit:0 -o empty rmextattr user myattr foo bar + atf_check -s exit:0 -o empty lsextattr -q user foo bar +} + +atf_test_case two_files_force +two_files_force_head() { + atf_set "descr" "Manipulate two files. The first does not exist" +} +two_files_force_body() { + touch bar + atf_check -s exit:1 -e match:"No such file or directory" \ + setextattr user myattr myvalue foo bar + atf_check -s exit:0 -e ignore setextattr -f user myattr myvalue foo bar + atf_check -s exit:1 -e match:"No such file or directory" \ + lsextattr user foo bar + atf_check -s exit:0 -e ignore -o inline:"bar\tmyattr\n" \ + lsextattr -f user foo bar + atf_check -s exit:1 -e match:"No such file or directory" \ + getextattr user myattr foo bar + atf_check -s exit:0 -e ignore \ + -o inline:"bar\tmyvalue\n" \ + getextattr -f user myattr foo bar + atf_check -s exit:1 -e match:"No such file or directory" \ + rmextattr user myattr foo bar + atf_check -s exit:0 -e ignore \ + rmextattr -f user myattr foo bar + atf_check -s exit:0 -o empty lsextattr -q user bar +} + +atf_test_case two_user_attrs +two_user_attrs_head() { + atf_set "descr" "A file with two extended attributes" +} +two_user_attrs_body() { + touch foo + atf_check -s exit:0 -o empty setextattr user myattr1 myvalue1 foo + atf_check -s exit:0 -o empty setextattr user myattr2 myvalue2 foo + # lsextattr could return the attributes in any order, so we must be + # careful how we compare them. + raw_output=`lsextattr -q user foo` || atf_fail "lsextattr failed" + tabless_output=`printf "%s %s" ${raw_output}` + if [ "myattr1 myattr2" != "${tabless_output}" -a \ + "myattr2 myattr1" != "${tabless_output}" ]; then + atf_fail "lsextattr printed ${tabless_output}" + fi + atf_check -s exit:0 -o inline:"myvalue1\n" getextattr -q user myattr1 foo + atf_check -s exit:0 -o inline:"myvalue2\n" getextattr -q user myattr2 foo + atf_check -s exit:0 -o empty rmextattr user myattr2 foo + atf_check -s exit:0 -o empty rmextattr user myattr1 foo + atf_check -s exit:0 -o empty lsextattr -q user foo +} + +atf_test_case unprivileged_user_cannot_set_system_attr +unprivileged_user_cannot_set_system_attr_head() { + atf_set "descr" "Unprivileged users can't set system attributes" + atf_set "require.user" "unprivileged" +} +unprivileged_user_cannot_set_system_attr_body() { + touch foo + atf_check -s exit:1 -e match:"Operation not permitted" \ + setextattr system myattr myvalue foo +} + + +atf_init_test_cases() { + # TODO: add test cases for verbose output (without -q) + atf_add_test_case bad_namespace + atf_add_test_case hex + atf_add_test_case long_name + atf_add_test_case noattrs + atf_add_test_case nonexistent_file + atf_add_test_case null + atf_add_test_case symlink_nofollow + atf_add_test_case one_user_attr + atf_add_test_case one_system_attr + atf_add_test_case stringify + atf_add_test_case symlink + atf_add_test_case symlink_nofollow + atf_add_test_case system_and_user_attrs + atf_add_test_case two_files + atf_add_test_case two_files_force + atf_add_test_case two_user_attrs + atf_add_test_case unprivileged_user_cannot_set_system_attr +} From owner-svn-src-all@freebsd.org Fri Apr 22 17:05:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 514E6B187FB for ; Fri, 22 Apr 2016 17:05:54 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16E6E1FA7 for ; Fri, 22 Apr 2016 17:05:54 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id d62so31303003iof.2 for ; Fri, 22 Apr 2016 10:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=sender:subject:mime-version:from:in-reply-to:date:cc:message-id :references:to; bh=WpEQwitrhMa3wVLWcIg10+btBl/FF9K6tEVZ100zZbU=; b=IOa8KGWa+M2gs0z6GxDqQGo7czs0RCdgJnod2Cy/UMMI12z395q/ykJeevd5Pu/U0H ER5CHIGvlKhxaOJyDj0jSFhuBKiU+5ZdmxCv7Ztk8sKY2wDMRbsDABn25ybc7dx5grwK Y7f5SPuUHwUB2IBztUJ3oFWzyjkAu2+YqalZJ3sdu4ekUDjd4Bs7KD3PYlJ0H+UU6nJf dkWqi705JdFXTWpaqnypt+PoZOY6FA0eXNX1Tyy9LC03kOEU/4qbHCseeVYhT21QKUqa 8dK05qAGtPyVWjxK3/rPTuYDwTRhpCp/87Mc8jfaRL0DDNLZ0BA7kt2s9z7QRjdiZoxw h7/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:from:in-reply-to :date:cc:message-id:references:to; bh=WpEQwitrhMa3wVLWcIg10+btBl/FF9K6tEVZ100zZbU=; b=OZYaNh1TfxFaDtP59Jz9qnpVj/GMoAbTVo+5dpGWUJWg/dom3np9QuZmGAQ+lU+UxM 8mb3/+HhfsAF1R/e9ErOpP4bp4OO/MF9Y20njOwtYAlAkm8y20aiehgQ2Yvy7txtJ8bA 7docBjqxY42S2NHVWLDJYeLjEYDq1piKNbMgV9HKxWnb5VmCxOn2JPDfeJ5BBU/UYdap WwoPbUJVJ305suaR2id/kC5SsztOIOiSuiXcA+4tXBwT+erBDvWOA6OmSkh94f00j0+V zX3pfxdmo8pnGSAkTDVI+EnODh8H+xRFJZQrwxFhVepS26VjE1Yn2Mos2jZ80dmmhxHT 37lQ== X-Gm-Message-State: AOPr4FUAw/b5B39XCJSc48D9stsk40RVa1AcTmZChchYlWRa/b2+5uGwKx+M08VEwhxb4g== X-Received: by 10.107.25.68 with SMTP id 65mr26833768ioz.98.1461344753215; Fri, 22 Apr 2016 10:05:53 -0700 (PDT) Received: from mac-wired.nflx.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id b202sm4408850ioe.27.2016.04.22.10.05.52 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Apr 2016 10:05:52 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r298426 - head/sys/dev/fdc Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_39A524B2-C0A8-46A3-A843-86423F5BF027"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.2 From: Warner Losh In-Reply-To: <4396944.pMOIsoy4We@ralph.baldwin.cx> Date: Fri, 22 Apr 2016 11:05:50 -0600 Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <6FBAFEC9-B22D-407A-A2DB-D0B37D519E57@bsdimp.com> References: <201604211837.u3LIbalm092252@repo.freebsd.org> <57191F7F.4010900@selasky.org> <4396944.pMOIsoy4We@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 17:05:54 -0000 --Apple-Mail=_39A524B2-C0A8-46A3-A843-86423F5BF027 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 22, 2016, at 10:43 AM, John Baldwin wrote: >=20 > On Thursday, April 21, 2016 08:44:15 PM Hans Petter Selasky wrote: >> On 04/21/16 20:37, John Baldwin wrote: >>> - tsleep(fdc, PRIBIO, "fdcrst", hz); >>> + if (cold) >>> + DELAY(1000000); >>> + else >>> + tsleep(fdc, PRIBIO, "fdcrst", hz); >>=20 >> Hi, >>=20 >> pause() and pause_sbt() does exactly this, checking for "cold" and = using >> DELAY(). >=20 > Yes, I know. In theory though the driver interrupt could fire during > normal operation aborting the sleep, so the wait channel for the !cold > case is actually there for a reason it seems. (That is, in the !cold = case > the driver might terminate the sleep early which you can't do with = pause.) Most of the sleeps in the fdc driver are more of a timeout waiting for = the interrupt to fire sorts of things. Post an action to the drive, and = tsleep for a second or until that action is done and you can get on with the next = thing. I=E2=80=99ll admit to being lazy and not checking this specific one, but = it=E2=80=99s a general design pattern in this driver... Warner --Apple-Mail=_39A524B2-C0A8-46A3-A843-86423F5BF027 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXGlnvAAoJEGwc0Sh9sBEA9vsP/RmTVZy2U/fxgYHsnR89KxF7 SdkYENBKQz0USTznb/lv/ObsYDW9RxvVhtWbeyNJ+uvGb4ghOYrnbJuHhe0XHCZ9 0zotRQSKtkBM5F0RFNz9TYjBZfd2EsqTF7Nn0AU895yGKQIl0/MfOpP2XykvuvGs WyDKZF6mXQr5eQTjtL80EZb+StAn2rg0BwmbShrfsad6MwfcRYJ5chzliENpUc+y ULcsfzr/Dmwpa/LnR88JHK9IqXWKNWWgm4xmiOkRUa6yJf3CKUSkhD9Eoz7CV8gg nX+1am+yrqDJiB3W6ufE6wdWO4i0eBStnUuRJgJQfJsceNciNmIw0fv14atutV50 Ro+rEOgzSmxScuocQiU8ruxUcVPRyq5awMW05kwX4+hp3JjBmQwmo8EYB6TB0Hcn 74pNZnYKuVDqyzFpNojEwO0qmo2Y0tkg8fQO3D0e63a2/R4zQwPtk9vN0zSenB21 XaNKQjocvE5F2HZ4bRI/rbe6jntFgtNyPZ7EZDTQkymzr7TZEyxdfFTKq5f3CHwg xnMGKZ5lGRN5WiVYDmQE9GfdZZI4y6soC6tw/7NgDl2tNfwYLW56PV1SpS5Ova5i Mpfse1A3+IOLcz3oz2v4nRcNXHWc7D6LNXrUlOeuPjdKUrDtRcWeJr2HwhYYxOxE 7vVKLuoWLnvX7APFA2gP =RTJj -----END PGP SIGNATURE----- --Apple-Mail=_39A524B2-C0A8-46A3-A843-86423F5BF027-- From owner-svn-src-all@freebsd.org Fri Apr 22 17:51:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF910B1996C; Fri, 22 Apr 2016 17:51:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FCFB1670; Fri, 22 Apr 2016 17:51:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MHpJDQ018784; Fri, 22 Apr 2016 17:51:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MHpJln018780; Fri, 22 Apr 2016 17:51:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604221751.u3MHpJln018780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 Apr 2016 17:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298484 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 17:51:20 -0000 Author: jhb Date: Fri Apr 22 17:51:19 2016 New Revision: 298484 URL: https://svnweb.freebsd.org/changeset/base/298484 Log: Optionally return the output capabilities list from _OSC. Both of the callers were expecting the input cap_set to be modified. This fixes them to request cap_set to be updated with the returned buffer. Reviewed by: jkim Differential Revision: https://reviews.freebsd.org/D6040 Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Apr 22 17:02:47 2016 (r298483) +++ head/sys/dev/acpica/acpi.c Fri Apr 22 17:51:19 2016 (r298484) @@ -2482,10 +2482,12 @@ acpi_AppendBufferResource(ACPI_BUFFER *b ACPI_STATUS acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid, int revision, int count, - uint32_t *caps) + uint32_t *caps_in, uint32_t *caps_out, bool query) { - ACPI_OBJECT arg[4]; + ACPI_OBJECT arg[4], *ret; ACPI_OBJECT_LIST arglist; + ACPI_BUFFER buf; + ACPI_STATUS status; arglist.Pointer = arg; arglist.Count = 4; @@ -2497,9 +2499,25 @@ acpi_EvaluateOSC(ACPI_HANDLE handle, uin arg[2].Type = ACPI_TYPE_INTEGER; arg[2].Integer.Value = count; arg[3].Type = ACPI_TYPE_BUFFER; - arg[3].Buffer.Length = count * sizeof(*caps); - arg[3].Buffer.Pointer = (uint8_t *)caps; - return (AcpiEvaluateObject(handle, "_OSC", &arglist, NULL)); + arg[3].Buffer.Length = count * sizeof(*caps_in); + arg[3].Buffer.Pointer = (uint8_t *)caps_in; + caps_in[0] = query ? 1 : 0; + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + status = AcpiEvaluateObjectTyped(handle, "_OSC", &arglist, &buf, + ACPI_TYPE_BUFFER); + if (ACPI_FAILURE(status)) + return (status); + if (caps_out != NULL) { + ret = buf.Pointer; + if (ret->Buffer.Length != count * sizeof(*caps_out)) { + AcpiOsFree(buf.Pointer); + return (AE_BUFFER_OVERFLOW); + } + bcopy(ret->Buffer.Pointer, caps_out, ret->Buffer.Length); + } + AcpiOsFree(buf.Pointer); + return (status); } /* Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Fri Apr 22 17:02:47 2016 (r298483) +++ head/sys/dev/acpica/acpi_cpu.c Fri Apr 22 17:51:19 2016 (r298484) @@ -388,9 +388,9 @@ acpi_cpu_attach(device_t dev) * Intel Processor Vendor-Specific ACPI Interface Specification. */ if (sc->cpu_features) { - cap_set[0] = 0; cap_set[1] = sc->cpu_features; - status = acpi_EvaluateOSC(sc->cpu_handle, cpu_oscuuid, 1, 2, cap_set); + status = acpi_EvaluateOSC(sc->cpu_handle, cpu_oscuuid, 1, 2, cap_set, + cap_set, false); if (ACPI_SUCCESS(status)) { if (cap_set[0] != 0) device_printf(dev, "_OSC returned status %#x\n", cap_set[0]); Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Fri Apr 22 17:02:47 2016 (r298483) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Fri Apr 22 17:51:19 2016 (r298484) @@ -306,9 +306,6 @@ acpi_pcib_osc(struct acpi_hpcib_softc *s 0x96, 0x57, 0x74, 0x41, 0xc0, 0x3d, 0xd7, 0x66 }; - /* Query Support Flag */ - cap_set[0] = 0; - /* Support Field: Extended PCI Config Space, MSI */ cap_set[1] = 0x11; @@ -316,7 +313,7 @@ acpi_pcib_osc(struct acpi_hpcib_softc *s cap_set[2] = 0; status = acpi_EvaluateOSC(sc->ap_handle, pci_host_bridge_uuid, 1, - nitems(cap_set), cap_set); + nitems(cap_set), cap_set, cap_set, false); if (ACPI_FAILURE(status)) { if (status == AE_NOT_FOUND) return; @@ -328,7 +325,6 @@ acpi_pcib_osc(struct acpi_hpcib_softc *s if (cap_set[0] != 0) { device_printf(sc->ap_dev, "_OSC returned error %#x\n", cap_set[0]); - return; } } Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Fri Apr 22 17:02:47 2016 (r298483) +++ head/sys/dev/acpica/acpivar.h Fri Apr 22 17:51:19 2016 (r298484) @@ -336,7 +336,8 @@ ACPI_STATUS acpi_FindIndexedResource(ACP ACPI_STATUS acpi_AppendBufferResource(ACPI_BUFFER *buf, ACPI_RESOURCE *res); ACPI_STATUS acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid, - int revision, int count, uint32_t *caps); + int revision, int count, uint32_t *caps_in, + uint32_t *caps_out, bool query); ACPI_STATUS acpi_OverrideInterruptLevel(UINT32 InterruptNumber); ACPI_STATUS acpi_SetIntrModel(int model); int acpi_ReqSleepState(struct acpi_softc *sc, int state); From owner-svn-src-all@freebsd.org Fri Apr 22 18:05:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A60CB19E15; Fri, 22 Apr 2016 18:05:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEBFA1E4F; Fri, 22 Apr 2016 18:05:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MI5Znw021928; Fri, 22 Apr 2016 18:05:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MI5Ypw021918; Fri, 22 Apr 2016 18:05:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604221805.u3MI5Ypw021918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 18:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298485 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 18:05:37 -0000 Author: ngie Date: Fri Apr 22 18:05:34 2016 New Revision: 298485 URL: https://svnweb.freebsd.org/changeset/base/298485 Log: Fix up pointer issues with lib/libkvm In particular, - avoid dereferencing NULL pointers - test pointers against NULL, not 0 - test for errout == NULL in the top-level functions (kvm_open, kvm_openfiles, kvm_open2, etc) - Replace a realloc and free on failure with reallocf Found with: devel/cocchinelle Differential Revision: https://reviews.freebsd.org/D5954 MFC after: 1 week Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libkvm/kvm.c head/lib/libkvm/kvm_amd64.c head/lib/libkvm/kvm_arm.c head/lib/libkvm/kvm_i386.c head/lib/libkvm/kvm_minidump_aarch64.c head/lib/libkvm/kvm_minidump_amd64.c head/lib/libkvm/kvm_minidump_arm.c head/lib/libkvm/kvm_minidump_i386.c head/lib/libkvm/kvm_minidump_mips.c head/lib/libkvm/kvm_proc.c Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm.c Fri Apr 22 18:05:34 2016 (r298485) @@ -379,12 +379,12 @@ _kvm_open(kvm_t *kd, const char *uf, con kd->vmfd = -1; kd->pmfd = -1; kd->nlfd = -1; - kd->vmst = 0; - kd->procbase = 0; - kd->argspc = 0; - kd->argv = 0; + kd->vmst = NULL; + kd->procbase = NULL; + kd->argspc = NULL; + kd->argv = NULL; - if (uf == 0) + if (uf == NULL) uf = getbootfile(); else if (strlen(uf) >= MAXPATHLEN) { _kvm_err(kd, kd->program, "exec file name too long"); @@ -394,7 +394,7 @@ _kvm_open(kvm_t *kd, const char *uf, con _kvm_err(kd, kd->program, "bad flags arg"); goto failed; } - if (mf == 0) + if (mf == NULL) mf = _PATH_MEM; if ((kd->pmfd = open(mf, flag | O_CLOEXEC, 0)) < 0) { @@ -471,7 +471,7 @@ failed: /* * Copy out the error if doing sane error semantics. */ - if (errout != 0) + if (errout != NULL) strlcpy(errout, kd->errbuf, _POSIX2_LINE_MAX); (void)kvm_close(kd); return (0); @@ -484,7 +484,9 @@ kvm_openfiles(const char *uf, const char kvm_t *kd; if ((kd = calloc(1, sizeof(*kd))) == NULL) { - (void)strlcpy(errout, strerror(errno), _POSIX2_LINE_MAX); + if (errout != NULL) + (void)strlcpy(errout, strerror(errno), + _POSIX2_LINE_MAX); return (0); } return (_kvm_open(kd, uf, mf, flag, errout)); @@ -513,7 +515,9 @@ kvm_open2(const char *uf, const char *mf kvm_t *kd; if ((kd = calloc(1, sizeof(*kd))) == NULL) { - (void)strlcpy(errout, strerror(errno), _POSIX2_LINE_MAX); + if (errout != NULL) + (void)strlcpy(errout, strerror(errno), + _POSIX2_LINE_MAX); return (0); } kd->resolve_symbol = resolver; Modified: head/lib/libkvm/kvm_amd64.c ============================================================================== --- head/lib/libkvm/kvm_amd64.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm_amd64.c Fri Apr 22 18:05:34 2016 (r298485) @@ -118,7 +118,7 @@ _amd64_initvtop(kvm_t *kd) amd64_pml4e_t *PML4; kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst)); - if (kd->vmst == 0) { + if (kd->vmst == NULL) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } @@ -153,6 +153,10 @@ _amd64_initvtop(kvm_t *kd) } pa = le64toh(pa); PML4 = _kvm_malloc(kd, AMD64_PAGE_SIZE); + if (PML4 == NULL) { + _kvm_err(kd, kd->program, "cannot allocate PML4"); + return (-1); + } if (kvm_read2(kd, pa, PML4, AMD64_PAGE_SIZE) != AMD64_PAGE_SIZE) { _kvm_err(kd, kd->program, "cannot read KPML4phys"); return (-1); @@ -188,7 +192,7 @@ _amd64_vatop(kvm_t *kd, kvaddr_t va, off * If we are initializing (kernel page table descriptor pointer * not yet set) then return pa == va to avoid infinite recursion. */ - if (vm->PML4 == 0) { + if (vm->PML4 == NULL) { s = _kvm_pa2off(kd, va, pa); if (s == 0) { _kvm_err(kd, kd->program, Modified: head/lib/libkvm/kvm_arm.c ============================================================================== --- head/lib/libkvm/kvm_arm.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm_arm.c Fri Apr 22 18:05:34 2016 (r298485) @@ -117,7 +117,7 @@ _arm_initvtop(kvm_t *kd) } vm = _kvm_malloc(kd, sizeof(*vm)); - if (vm == 0) { + if (vm == NULL) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } @@ -168,6 +168,10 @@ _arm_initvtop(kvm_t *kd) return (-1); } l1pt = _kvm_malloc(kd, ARM_L1_TABLE_SIZE); + if (l1pt == NULL) { + _kvm_err(kd, kd->program, "cannot allocate l1pt"); + return (-1); + } if (kvm_read2(kd, pa, l1pt, ARM_L1_TABLE_SIZE) != ARM_L1_TABLE_SIZE) { _kvm_err(kd, kd->program, "cannot read l1pt"); free(l1pt); Modified: head/lib/libkvm/kvm_i386.c ============================================================================== --- head/lib/libkvm/kvm_i386.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm_i386.c Fri Apr 22 18:05:34 2016 (r298485) @@ -162,6 +162,10 @@ _i386_initvtop(kvm_t *kd) } pa = le32toh(pa); PTD = _kvm_malloc(kd, 4 * I386_PAGE_SIZE); + if (PTD == NULL) { + _kvm_err(kd, kd->program, "cannot allocate PTD"); + return (-1); + } for (i = 0; i < 4; i++) { if (kvm_read2(kd, pa + (i * sizeof(pa64)), &pa64, sizeof(pa64)) != sizeof(pa64)) { @@ -195,6 +199,10 @@ _i386_initvtop(kvm_t *kd) } pa = le32toh(pa); PTD = _kvm_malloc(kd, I386_PAGE_SIZE); + if (PTD == NULL) { + _kvm_err(kd, kd->program, "cannot allocate PTD"); + return (-1); + } if (kvm_read2(kd, pa, PTD, I386_PAGE_SIZE) != I386_PAGE_SIZE) { _kvm_err(kd, kd->program, "cannot read PTD"); return (-1); @@ -228,7 +236,7 @@ _i386_vatop(kvm_t *kd, kvaddr_t va, off_ * If we are initializing (kernel page table descriptor pointer * not yet set) then return pa == va to avoid infinite recursion. */ - if (PTD == 0) { + if (PTD == NULL) { s = _kvm_pa2off(kd, va, pa); if (s == 0) { _kvm_err(kd, kd->program, @@ -318,7 +326,7 @@ _i386_vatop_pae(kvm_t *kd, kvaddr_t va, * If we are initializing (kernel page table descriptor pointer * not yet set) then return pa == va to avoid infinite recursion. */ - if (PTD == 0) { + if (PTD == NULL) { s = _kvm_pa2off(kd, va, pa); if (s == 0) { _kvm_err(kd, kd->program, Modified: head/lib/libkvm/kvm_minidump_aarch64.c ============================================================================== --- head/lib/libkvm/kvm_minidump_aarch64.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm_minidump_aarch64.c Fri Apr 22 18:05:34 2016 (r298485) @@ -81,7 +81,7 @@ _aarch64_minidump_initvtop(kvm_t *kd) off_t off; vmst = _kvm_malloc(kd, sizeof(*vmst)); - if (vmst == 0) { + if (vmst == NULL) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } Modified: head/lib/libkvm/kvm_minidump_amd64.c ============================================================================== --- head/lib/libkvm/kvm_minidump_amd64.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm_minidump_amd64.c Fri Apr 22 18:05:34 2016 (r298485) @@ -81,7 +81,7 @@ _amd64_minidump_initvtop(kvm_t *kd) off_t off; vmst = _kvm_malloc(kd, sizeof(*vmst)); - if (vmst == 0) { + if (vmst == NULL) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } Modified: head/lib/libkvm/kvm_minidump_arm.c ============================================================================== --- head/lib/libkvm/kvm_minidump_arm.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm_minidump_arm.c Fri Apr 22 18:05:34 2016 (r298485) @@ -84,7 +84,7 @@ _arm_minidump_initvtop(kvm_t *kd) off_t off; vmst = _kvm_malloc(kd, sizeof(*vmst)); - if (vmst == 0) { + if (vmst == NULL) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } Modified: head/lib/libkvm/kvm_minidump_i386.c ============================================================================== --- head/lib/libkvm/kvm_minidump_i386.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm_minidump_i386.c Fri Apr 22 18:05:34 2016 (r298485) @@ -81,7 +81,7 @@ _i386_minidump_initvtop(kvm_t *kd) off_t off; vmst = _kvm_malloc(kd, sizeof(*vmst)); - if (vmst == 0) { + if (vmst == NULL) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } Modified: head/lib/libkvm/kvm_minidump_mips.c ============================================================================== --- head/lib/libkvm/kvm_minidump_mips.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm_minidump_mips.c Fri Apr 22 18:05:34 2016 (r298485) @@ -89,7 +89,7 @@ _mips_minidump_initvtop(kvm_t *kd) off_t off; vmst = _kvm_malloc(kd, sizeof(*vmst)); - if (vmst == 0) { + if (vmst == NULL) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Fri Apr 22 17:51:19 2016 (r298484) +++ head/lib/libkvm/kvm_proc.c Fri Apr 22 18:05:34 2016 (r298485) @@ -544,7 +544,7 @@ kvm_getprocs(kvm_t *kd, int op, int arg, size += size / 10; kd->procbase = (struct kinfo_proc *) _kvm_realloc(kd, kd->procbase, size); - if (kd->procbase == 0) + if (kd->procbase == NULL) return (0); osize = size; st = sysctl(mib, temp_op == KERN_PROC_ALL || @@ -614,7 +614,7 @@ liveout: } size = nprocs * sizeof(struct kinfo_proc); kd->procbase = (struct kinfo_proc *)_kvm_malloc(kd, size); - if (kd->procbase == 0) + if (kd->procbase == NULL) return (0); nprocs = kvm_deadprocs(kd, op, arg, nl[1].n_value, @@ -637,21 +637,19 @@ liveout: void _kvm_freeprocs(kvm_t *kd) { - if (kd->procbase) { - free(kd->procbase); - kd->procbase = 0; - } + + free(kd->procbase); + kd->procbase = NULL; } void * _kvm_realloc(kvm_t *kd, void *p, size_t n) { - void *np = (void *)realloc(p, n); + void *np; - if (np == 0) { - free(p); + np = reallocf(p, n); + if (np == NULL) _kvm_err(kd, kd->program, "out of memory"); - } return (np); } @@ -672,7 +670,7 @@ kvm_argv(kvm_t *kd, const struct kinfo_p if (!ISALIVE(kd)) { _kvm_err(kd, kd->program, "cannot read user space from dead kernel"); - return (0); + return (NULL); } if (nchr == 0 || nchr > ARG_MAX) @@ -681,7 +679,7 @@ kvm_argv(kvm_t *kd, const struct kinfo_p buf = malloc(nchr); if (buf == NULL) { _kvm_err(kd, kd->program, "cannot allocate memory"); - return (0); + return (NULL); } buflen = nchr; argc = 32; @@ -706,12 +704,11 @@ kvm_argv(kvm_t *kd, const struct kinfo_p * to the requested len. */ if (errno != ENOMEM || bufsz != (size_t)buflen) - return (0); + return (NULL); buf[bufsz - 1] = '\0'; errno = 0; - } else if (bufsz == 0) { - return (0); - } + } else if (bufsz == 0) + return (NULL); i = 0; p = buf; do { From owner-svn-src-all@freebsd.org Fri Apr 22 18:16:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 397FFB1822C; Fri, 22 Apr 2016 18:16:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08C521393; Fri, 22 Apr 2016 18:16:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MIGDX6024921; Fri, 22 Apr 2016 18:16:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MIGCgK024913; Fri, 22 Apr 2016 18:16:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604221816.u3MIGCgK024913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 Apr 2016 18:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298486 - in head/sys: ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/include/rdma sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 18:16:14 -0000 Author: hselasky Date: Fri Apr 22 18:16:12 2016 New Revision: 298486 URL: https://svnweb.freebsd.org/changeset/base/298486 Log: More fixes for using IPv6 addresses with RDMA: - Added check that the SCOPE ID is only restored for IPv6 linklocal addresses. - Changes made by r237263 in the "cma_bind_addr()" function did not check if the socket address was of type IPv6 and used the IPv4 socket address for IPv6 addresses. This caused the function to fail. Fixed this. - In the "rdma_gid2ip()" function and some other places the "sin6_len" and "sin6_scope_id" fields were not set for IPv6 socket addresses. Fixed this. - The scope ID is not stored as part of the GID entries and must be passed as an argument to "rdma_gid2ip()". - Added new method to "struct ib_device" which returns a pointer to the network interface which belongs to the given infiniband device. This is needed to be able to get the scope ID for IPv6 addresses via the associated ethernet interface. - Added convenience function, "rdma_get_ipv6_scope_id()", to get the scope ID for IPv6 addresses. - Implemented new "get_netdev" method for mlx4ib. Other IB controller drivers which want to support IPv6 addresses needs to implement this aswell. - Bumped the FreeBSD version due to changing "struct ib_device". Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/addr.c head/sys/ofed/drivers/infiniband/core/cma.c head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c head/sys/ofed/drivers/infiniband/core/verbs.c head/sys/ofed/drivers/infiniband/hw/mlx4/main.c head/sys/ofed/include/rdma/ib_addr.h head/sys/ofed/include/rdma/ib_verbs.h head/sys/sys/param.h Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Fri Apr 22 18:05:34 2016 (r298485) +++ head/sys/ofed/drivers/infiniband/core/addr.c Fri Apr 22 18:16:12 2016 (r298486) @@ -43,6 +43,7 @@ #include #include #include +#include MODULE_AUTHOR("Sean Hefty"); @@ -417,7 +418,8 @@ done: #ifdef INET6 if (scope_id < 256) { sin6 = (struct sockaddr_in6 *)src_in; - SCOPE_ID_RESTORE(scope_id, sin6); + if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) + SCOPE_ID_RESTORE(scope_id, sin6); sin6 = (struct sockaddr_in6 *)dst_in; SCOPE_ID_RESTORE(scope_id, sin6); } @@ -554,7 +556,7 @@ static void resolve_cb(int status, struc } int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, union ib_gid *dgid, u8 *dmac, - u16 *vlan_id) + u16 *vlan_id, u32 scope_id) { int ret = 0; struct rdma_dev_addr dev_addr; @@ -568,11 +570,11 @@ int rdma_addr_find_dmac_by_grh(union ib_ } sgid_addr, dgid_addr; - ret = rdma_gid2ip(&sgid_addr._sockaddr, sgid); + ret = rdma_gid2ip(&sgid_addr._sockaddr, sgid, scope_id); if (ret) return ret; - ret = rdma_gid2ip(&dgid_addr._sockaddr, dgid); + ret = rdma_gid2ip(&dgid_addr._sockaddr, dgid, scope_id); if (ret) return ret; @@ -598,7 +600,23 @@ int rdma_addr_find_dmac_by_grh(union ib_ } EXPORT_SYMBOL(rdma_addr_find_dmac_by_grh); -int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id) +u32 rdma_get_ipv6_scope_id(struct ib_device *ib, u8 port_num) +{ +#ifdef INET6 + struct ifnet *ifp; + if (ib->get_netdev == NULL) + return (-1U); + ifp = ib->get_netdev(ib, port_num); + if (ifp == NULL) + return (-1U); + return (in6_getscopezone(ifp, IPV6_ADDR_SCOPE_LINKLOCAL)); +#else + return (-1U); +#endif +} + +int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id, + u32 scope_id) { int ret = 0; struct rdma_dev_addr dev_addr; @@ -608,8 +626,7 @@ int rdma_addr_find_smac_by_sgid(union ib struct sockaddr_in6 _sockaddr_in6; } gid_addr; - ret = rdma_gid2ip(&gid_addr._sockaddr, sgid); - + ret = rdma_gid2ip(&gid_addr._sockaddr, sgid, scope_id); if (ret) return ret; memset(&dev_addr, 0, sizeof(dev_addr)); Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Fri Apr 22 18:05:34 2016 (r298485) +++ head/sys/ofed/drivers/infiniband/core/cma.c Fri Apr 22 18:16:12 2016 (r298486) @@ -689,8 +689,11 @@ static int cma_modify_qp_rtr(struct rdma == RDMA_TRANSPORT_IB && rdma_port_get_link_layer(id_priv->id.device, id_priv->id.port_num) == IB_LINK_LAYER_ETHERNET) { - ret = rdma_addr_find_smac_by_sgid(&sgid, qp_attr.smac, NULL); + u32 scope_id = rdma_get_ipv6_scope_id(id_priv->id.device, + id_priv->id.port_num); + ret = rdma_addr_find_smac_by_sgid(&sgid, qp_attr.smac, NULL, + scope_id); if (ret) goto out; } @@ -931,11 +934,13 @@ static void cma_save_net_info(struct rdm ip4->sin_family = listen4->sin_family; ip4->sin_addr.s_addr = dst->ip4.addr; ip4->sin_port = listen4->sin_port; + ip4->sin_len = sizeof(struct sockaddr_in); ip4 = (struct sockaddr_in *) &addr->dst_addr; ip4->sin_family = listen4->sin_family; ip4->sin_addr.s_addr = src->ip4.addr; ip4->sin_port = port; + ip4->sin_len = sizeof(struct sockaddr_in); break; case 6: listen6 = (struct sockaddr_in6 *) &listen_addr->src_addr; @@ -943,11 +948,15 @@ static void cma_save_net_info(struct rdm ip6->sin6_family = listen6->sin6_family; ip6->sin6_addr = dst->ip6; ip6->sin6_port = listen6->sin6_port; + ip6->sin6_len = sizeof(struct sockaddr_in6); + ip6->sin6_scope_id = listen6->sin6_scope_id; ip6 = (struct sockaddr_in6 *) &addr->dst_addr; ip6->sin6_family = listen6->sin6_family; ip6->sin6_addr = src->ip6; ip6->sin6_port = port; + ip6->sin6_len = sizeof(struct sockaddr_in6); + ip6->sin6_scope_id = listen6->sin6_scope_id; break; default: break; @@ -1431,16 +1440,19 @@ static int cma_req_handler(struct ib_cm_ goto err3; if (is_iboe && !is_sidr) { + u32 scope_id = rdma_get_ipv6_scope_id(cm_id->device, + ib_event->param.req_rcvd.port); + if (ib_event->param.req_rcvd.primary_path != NULL) rdma_addr_find_smac_by_sgid( &ib_event->param.req_rcvd.primary_path->sgid, - psmac, NULL); + psmac, NULL, scope_id); else psmac = NULL; if (ib_event->param.req_rcvd.alternate_path != NULL) rdma_addr_find_smac_by_sgid( &ib_event->param.req_rcvd.alternate_path->sgid, - palt_smac, NULL); + palt_smac, NULL, scope_id); else palt_smac = NULL; } @@ -2296,22 +2308,47 @@ static int cma_bind_addr(struct rdma_cm_ { if (!src_addr || !src_addr->sa_family) { src_addr = (struct sockaddr *) &id->route.addr.src_addr; - if ((src_addr->sa_family = dst_addr->sa_family) == AF_INET6) { + src_addr->sa_family = dst_addr->sa_family; +#ifdef INET6 + if (dst_addr->sa_family == AF_INET6) { ((struct sockaddr_in6 *) src_addr)->sin6_scope_id = ((struct sockaddr_in6 *) dst_addr)->sin6_scope_id; } +#endif } if (!cma_any_addr(src_addr)) return rdma_bind_addr(id, src_addr); else { - struct sockaddr_in addr_in; + union { +#ifdef INET + struct sockaddr_in in; +#endif +#ifdef INET6 + struct sockaddr_in6 in6; +#endif + } addr; - memset(&addr_in, 0, sizeof addr_in); - addr_in.sin_family = dst_addr->sa_family; - addr_in.sin_len = sizeof addr_in; - return rdma_bind_addr(id, (struct sockaddr *) &addr_in); + switch(dst_addr->sa_family) { +#ifdef INET + case AF_INET: + memset(&addr.in, 0, sizeof(addr.in)); + addr.in.sin_family = dst_addr->sa_family; + addr.in.sin_len = sizeof(addr.in); + return rdma_bind_addr(id, (struct sockaddr *)&addr.in); +#endif +#ifdef INET6 + case AF_INET6: + memset(&addr.in6, 0, sizeof(addr.in6)); + addr.in6.sin6_family = dst_addr->sa_family; + addr.in6.sin6_len = sizeof(addr.in6); + addr.in6.sin6_scope_id = + ((struct sockaddr_in6 *)dst_addr)->sin6_scope_id; + return rdma_bind_addr(id, (struct sockaddr *)&addr.in6); +#endif + default: + return -EINVAL; + } } - } int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr, Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Fri Apr 22 18:05:34 2016 (r298485) +++ head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Fri Apr 22 18:16:12 2016 (r298486) @@ -2094,11 +2094,11 @@ static ssize_t __uverbs_modify_qp(struct } else { ret = rdma_addr_find_dmac_by_grh(&sgid, dgid, attr->ah_attr.dmac, - &attr->vlan_id); + &attr->vlan_id, -1U); if (ret) goto out; ret = rdma_addr_find_smac_by_sgid(&sgid, attr->smac, - NULL); + NULL, -1U); if (ret) goto out; } Modified: head/sys/ofed/drivers/infiniband/core/verbs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/verbs.c Fri Apr 22 18:05:34 2016 (r298485) +++ head/sys/ofed/drivers/infiniband/core/verbs.c Fri Apr 22 18:16:12 2016 (r298486) @@ -207,8 +207,10 @@ int ib_init_ah_from_wc(struct ib_device memcpy(ah_attr->dmac, wc->smac, ETH_ALEN); ah_attr->vlan_id = wc->vlan_id; } else { + u32 scope_id = rdma_get_ipv6_scope_id(device, port_num); ret = rdma_addr_find_dmac_by_grh(&grh->dgid, &grh->sgid, - ah_attr->dmac, &ah_attr->vlan_id); + ah_attr->dmac, &ah_attr->vlan_id, + scope_id); if (ret) return ret; } Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Fri Apr 22 18:05:34 2016 (r298485) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Fri Apr 22 18:16:12 2016 (r298486) @@ -1620,6 +1620,12 @@ free: kfree(gw); } +static struct net_device *mlx4_ib_get_netdev(struct ib_device *device, u8 port_num) +{ + struct mlx4_ib_dev *ibdev = to_mdev(device); + return mlx4_get_protocol_dev(ibdev->dev, MLX4_PROT_ETH, port_num); +} + static void reset_gids_task(struct work_struct *work) { struct update_gid_work *gw = @@ -2353,6 +2359,7 @@ static void *mlx4_ib_add(struct mlx4_dev ibdev->ib_dev.attach_mcast = mlx4_ib_mcg_attach; ibdev->ib_dev.detach_mcast = mlx4_ib_mcg_detach; ibdev->ib_dev.process_mad = mlx4_ib_process_mad; + ibdev->ib_dev.get_netdev = mlx4_ib_get_netdev; ibdev->ib_dev.ioctl = mlx4_ib_ioctl; ibdev->ib_dev.query_values = mlx4_ib_query_values; Modified: head/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- head/sys/ofed/include/rdma/ib_addr.h Fri Apr 22 18:05:34 2016 (r298485) +++ head/sys/ofed/include/rdma/ib_addr.h Fri Apr 22 18:16:12 2016 (r298486) @@ -105,9 +105,10 @@ void rdma_addr_cancel(struct rdma_dev_ad int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev, const unsigned char *dst_dev_addr); -int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id); +int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id, + u32 scope_id); int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, union ib_gid *dgid, u8 *smac, - u16 *vlan_id); + u16 *vlan_id, u32 scope_id); static inline int ip_addr_size(struct sockaddr *addr) { @@ -164,7 +165,8 @@ static inline int rdma_ip2gid(struct soc } /* Important - sockaddr should be a union of sockaddr_in and sockaddr_in6 */ -static inline int rdma_gid2ip(struct sockaddr *out, union ib_gid *gid) +static inline int rdma_gid2ip(struct sockaddr *out, union ib_gid *gid, + uint32_t scope_id) { if (ipv6_addr_v4mapped((struct in6_addr *)gid)) { struct sockaddr_in *out_in = (struct sockaddr_in *)out; @@ -175,12 +177,18 @@ static inline int rdma_gid2ip(struct soc } else { struct sockaddr_in6 *out_in = (struct sockaddr_in6 *)out; memset(out_in, 0, sizeof(*out_in)); + out_in->sin6_len = sizeof(*out_in); out_in->sin6_family = AF_INET6; memcpy(&out_in->sin6_addr.s6_addr, gid->raw, 16); + if (scope_id < 256 && + IN6_IS_SCOPE_LINKLOCAL(&out_in->sin6_addr)) + out_in->sin6_scope_id = scope_id; } return 0; } +u32 rdma_get_ipv6_scope_id(struct ib_device *ib, u8 port_num); + /* This func is called only in loopback ip address (127.0.0.1) * case in which sgid is not relevant */ Modified: head/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- head/sys/ofed/include/rdma/ib_verbs.h Fri Apr 22 18:05:34 2016 (r298485) +++ head/sys/ofed/include/rdma/ib_verbs.h Fri Apr 22 18:16:12 2016 (r298486) @@ -1655,6 +1655,14 @@ struct ib_device { struct ib_port_attr *port_attr); enum rdma_link_layer (*get_link_layer)(struct ib_device *device, u8 port_num); + /* When calling get_netdev, the HW vendor's driver should return the + * net device of device @device at port @port_num. The function + * is called in rtnl_lock. The HW vendor's device driver must guarantee + * to return NULL before the net device has reached + * NETDEV_UNREGISTER_FINAL state. + */ + struct net_device *(*get_netdev)(struct ib_device *device, + u8 port_num); int (*query_gid)(struct ib_device *device, u8 port_num, int index, union ib_gid *gid); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Apr 22 18:05:34 2016 (r298485) +++ head/sys/sys/param.h Fri Apr 22 18:16:12 2016 (r298486) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100105 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100106 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Apr 22 20:31:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7649CB193C6; Fri, 22 Apr 2016 20:31:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40A101815; Fri, 22 Apr 2016 20:31:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MKVTJX066410; Fri, 22 Apr 2016 20:31:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MKVTXl066409; Fri, 22 Apr 2016 20:31:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604222031.u3MKVTXl066409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 22 Apr 2016 20:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298487 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 20:31:30 -0000 Author: bdrewery Date: Fri Apr 22 20:31:29 2016 New Revision: 298487 URL: https://svnweb.freebsd.org/changeset/base/298487 Log: Fix error when SRCCONF is empty. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.sys.mk Modified: head/share/mk/src.sys.mk ============================================================================== --- head/share/mk/src.sys.mk Fri Apr 22 18:16:12 2016 (r298486) +++ head/share/mk/src.sys.mk Fri Apr 22 20:31:29 2016 (r298487) @@ -8,7 +8,9 @@ .if !defined(_WITHOUT_SRCCONF) # Allow user to configure things that only effect src tree builds. SRCCONF?= /etc/src.conf -.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_) +.if !empty(SRCCONF) && \ + (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && \ + !target(_srcconf_included_) # Validate that the user didn't try setting an env-only variable in # their src.conf. This benefits from already including bsd.mkopt.mk. From owner-svn-src-all@freebsd.org Fri Apr 22 21:26:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D33B18499; Fri, 22 Apr 2016 21:26:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39A5D1072; Fri, 22 Apr 2016 21:26:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MLQFtq082111; Fri, 22 Apr 2016 21:26:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MLQFNV082110; Fri, 22 Apr 2016 21:26:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604222126.u3MLQFNV082110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 21:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298488 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:26:16 -0000 Author: ngie Date: Fri Apr 22 21:26:15 2016 New Revision: 298488 URL: https://svnweb.freebsd.org/changeset/base/298488 Log: MFC r298303: Remove trailing whitespace and use `nitems(mib)` instead of `2` when calling sysctl(3) Modified: stable/10/lib/libc/gen/getpagesize.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getpagesize.c ============================================================================== --- stable/10/lib/libc/gen/getpagesize.c Fri Apr 22 20:31:29 2016 (r298487) +++ stable/10/lib/libc/gen/getpagesize.c Fri Apr 22 21:26:15 2016 (r298488) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); int getpagesize() { - int mib[2]; + int mib[2]; static int value; size_t size; int error; @@ -68,7 +68,7 @@ getpagesize() mib[0] = CTL_HW; mib[1] = HW_PAGESIZE; size = sizeof value; - if (sysctl(mib, 2, &value, &size, NULL, 0) == -1) + if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) == -1) return (-1); return (value); From owner-svn-src-all@freebsd.org Fri Apr 22 21:28:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D16FB1857F; Fri, 22 Apr 2016 21:28:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EEEC11F3; Fri, 22 Apr 2016 21:28:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MLSoNI082276; Fri, 22 Apr 2016 21:28:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MLSoGM082275; Fri, 22 Apr 2016 21:28:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604222128.u3MLSoGM082275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 21:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298489 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:28:51 -0000 Author: ngie Date: Fri Apr 22 21:28:50 2016 New Revision: 298489 URL: https://svnweb.freebsd.org/changeset/base/298489 Log: MFstable/10 r298488: MFC r298303: Remove trailing whitespace and use `nitems(mib)` instead of `2` when calling sysctl(3) Modified: stable/9/lib/libc/gen/getpagesize.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/getpagesize.c ============================================================================== --- stable/9/lib/libc/gen/getpagesize.c Fri Apr 22 21:26:15 2016 (r298488) +++ stable/9/lib/libc/gen/getpagesize.c Fri Apr 22 21:28:50 2016 (r298489) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); int getpagesize() { - int mib[2]; + int mib[2]; static int value; size_t size; int error; @@ -68,7 +68,7 @@ getpagesize() mib[0] = CTL_HW; mib[1] = HW_PAGESIZE; size = sizeof value; - if (sysctl(mib, 2, &value, &size, NULL, 0) == -1) + if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) == -1) return (-1); return (value); From owner-svn-src-all@freebsd.org Fri Apr 22 21:30:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 038DEB1863D; Fri, 22 Apr 2016 21:30:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B010E1389; Fri, 22 Apr 2016 21:30:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MLUghP082439; Fri, 22 Apr 2016 21:30:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MLUgGq082437; Fri, 22 Apr 2016 21:30:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604222130.u3MLUgGq082437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 21:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298490 - stable/10/tests/sys/file X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:30:44 -0000 Author: ngie Date: Fri Apr 22 21:30:42 2016 New Revision: 298490 URL: https://svnweb.freebsd.org/changeset/base/298490 Log: MFC r298024,r298196: r298024: Set test_argv to NULL, not 0, if not executing a specific test r298196: Minor cosmetic cleanup - Remove spurious trailing whitespace in licensing header - Remove unnecessary semi-colon after comment Modified: stable/10/tests/sys/file/flock_helper.c stable/10/tests/sys/file/newfileops_on_fork_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/file/flock_helper.c ============================================================================== --- stable/10/tests/sys/file/flock_helper.c Fri Apr 22 21:28:50 2016 (r298489) +++ stable/10/tests/sys/file/flock_helper.c Fri Apr 22 21:30:42 2016 (r298490) @@ -1566,7 +1566,7 @@ main(int argc, const char *argv[]) } else { testnum = 0; test_argc = 0; - test_argv = 0; + test_argv = NULL; } sa.sa_handler = ignore_alarm; Modified: stable/10/tests/sys/file/newfileops_on_fork_test.c ============================================================================== --- stable/10/tests/sys/file/newfileops_on_fork_test.c Fri Apr 22 21:28:50 2016 (r298489) +++ stable/10/tests/sys/file/newfileops_on_fork_test.c Fri Apr 22 21:30:42 2016 (r298490) @@ -3,7 +3,7 @@ * All rights reserved. * * This software was developed at the University of Cambridge Computer - * Laboratory with support from a grant from Google, Inc. + * Laboratory with support from a grant from Google, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -115,7 +115,7 @@ main(__unused int argc, __unused char *a err(-1, "listen"); if (pthread_create(&accept_thread, NULL, do_accept, NULL) != 0) err(-1, "pthread_create"); - sleep(1); /* Easier than using a CV. */; + sleep(1); /* Easier than using a CV. */ do_fork(); exit(0); } From owner-svn-src-all@freebsd.org Fri Apr 22 21:32:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B34BB1879E; Fri, 22 Apr 2016 21:32:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CA891734; Fri, 22 Apr 2016 21:32:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MLW11j083177; Fri, 22 Apr 2016 21:32:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MLW1jx083176; Fri, 22 Apr 2016 21:32:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604222132.u3MLW1jx083176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 22 Apr 2016 21:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298491 - stable/10/lib/msun/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:32:02 -0000 Author: ngie Date: Fri Apr 22 21:32:01 2016 New Revision: 298491 URL: https://svnweb.freebsd.org/changeset/base/298491 Log: MFC r297836: Fix appending -O0 to CFLAGS The previous method would completely nerf CFLAGS once bsd.progs.mk had recursed into the per-PROG logic and make the CFLAGS for tap testcases to -O0, instead of appending to CFLAGS for all of the tap testcases. Modified: stable/10/lib/msun/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/tests/Makefile ============================================================================== --- stable/10/lib/msun/tests/Makefile Fri Apr 22 21:30:42 2016 (r298490) +++ stable/10/lib/msun/tests/Makefile Fri Apr 22 21:32:01 2016 (r298491) @@ -58,9 +58,9 @@ TAP_TESTS_C+= next_test TAP_TESTS_C+= rem_test TAP_TESTS_C+= trig_test -.for t in ${TAP_TESTS_C} -CFLAGS.$t+= -O0 -.endfor +.if !empty(PROG) && !empty(TAP_TESTS_C:M${PROG}) +CFLAGS+= -O0 +.endif CSTD= c99 From owner-svn-src-all@freebsd.org Fri Apr 22 21:32:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F164B1881F; Fri, 22 Apr 2016 21:32:25 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.fer.hr", Issuer "TERENA SSL CA 3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23F7919D1; Fri, 22 Apr 2016 21:32:24 +0000 (UTC) (envelope-from zec@fer.hr) Received: from x23 (31.147.120.67) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.3.279.2; Fri, 22 Apr 2016 23:31:09 +0200 Date: Fri, 22 Apr 2016 23:31:37 +0200 From: Marko Zec To: Ruslan Bukin CC: , , Subject: Re: svn commit: r298477 - in head/sys: conf riscv/riscv Message-ID: <20160422233137.7f37bb47@x23> In-Reply-To: <201604221615.u3MGFxCM088374@repo.freebsd.org> References: <201604221615.u3MGFxCM088374@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [31.147.120.67] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:32:25 -0000 On Fri, 22 Apr 2016 16:15:59 +0000 Ruslan Bukin wrote: > Author: br > Date: Fri Apr 22 16:15:58 2016 > New Revision: 298477 > URL: https://svnweb.freebsd.org/changeset/base/298477 > > Log: > Clear the DDR memory. This should be done by bootloaders, > but they have no such feature yet. > > This fixes operation on Rocket Core and lowRISC. > > Modified: > head/sys/conf/options.riscv > head/sys/riscv/riscv/locore.S > > Modified: head/sys/conf/options.riscv > ============================================================================== > --- head/sys/conf/options.riscv Fri Apr 22 15:12:05 > 2016 (r298476) +++ head/sys/conf/options.riscv Fri Apr > 22 16:15:58 2016 (r298477) @@ -2,3 +2,4 @@ > > RISCV opt_global.h > VFP opt_global.h > +DDR_CLEAR_SIZE opt_global.h > > Modified: head/sys/riscv/riscv/locore.S > ============================================================================== > --- head/sys/riscv/riscv/locore.S Fri Apr 22 15:12:05 > 2016 (r298476) +++ head/sys/riscv/riscv/locore.S Fri > Apr 22 16:15:58 2016 (r298477) @@ -126,6 +126,17 @@ _start: > csrr a0, mhartid > bnez a0, mpentry > > +#if defined(DDR_CLEAR_SIZE) > + /* Clear DDR memory */ > + la t0, _end > + li t1, DDR_CLEAR_SIZE > +1: > + sd zero, 0(t0) > + addi t0, t0, 8 > + bltu t0, t1, 1b Usually _end appears to be (double) word aligned, but that happens out of pure luck, since compilers do not provide firm guarantees about _end's alignment (at least gcc doesn't, as far as I know). So depending on which kind of RV this code would run, sometimes it may end up doing a lot of traps emulating unaligned access in software, or worse... Hence it would't hurt to check for _end's alignment first and do a few byte-by-byte bzero()ing if needed, before proceeding a dword pace. > + /* End */ > +#endif > + > /* Build event queue for current core */ > build_ring > > From owner-svn-src-all@freebsd.org Fri Apr 22 21:33:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25452B1889B; Fri, 22 Apr 2016 21:33:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6CA61B7C; Fri, 22 Apr 2016 21:33:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MLXCnv085249; Fri, 22 Apr 2016 21:33:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MLXCTb085248; Fri, 22 Apr 2016 21:33:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604222133.u3MLXCTb085248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 22 Apr 2016 21:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298492 - stable/10/usr.sbin/kldxref X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:33:13 -0000 Author: emaste Date: Fri Apr 22 21:33:11 2016 New Revision: 298492 URL: https://svnweb.freebsd.org/changeset/base/298492 Log: MFC r275940 (imp): Bump the largest record we can cope with from 1k to 8k. Other users of the hints file don't have any real limits, and longer records will need to be written shortly. Modified: stable/10/usr.sbin/kldxref/kldxref.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/kldxref/kldxref.c ============================================================================== --- stable/10/usr.sbin/kldxref/kldxref.c Fri Apr 22 21:32:01 2016 (r298491) +++ stable/10/usr.sbin/kldxref/kldxref.c Fri Apr 22 21:33:11 2016 (r298492) @@ -53,7 +53,7 @@ #include "ef.h" -#define MAXRECSIZE 1024 +#define MAXRECSIZE 8192 #define check(val) if ((error = (val)) != 0) break static int dflag; /* do not create a hint file, only write on stdout */ From owner-svn-src-all@freebsd.org Fri Apr 22 21:38:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C799B1898B; Fri, 22 Apr 2016 21:38:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6EE11D69; Fri, 22 Apr 2016 21:38:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MLcbhQ085527; Fri, 22 Apr 2016 21:38:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MLcbwE085524; Fri, 22 Apr 2016 21:38:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604222138.u3MLcbwE085524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 22 Apr 2016 21:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298493 - in stable/10: sys/boot/common sys/sys usr.sbin/kldxref X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:38:39 -0000 Author: emaste Date: Fri Apr 22 21:38:37 2016 New Revision: 298493 URL: https://svnweb.freebsd.org/changeset/base/298493 Log: MFC r277205 (imp): Reserve and ignore the a new module metadata type MDT_PNP_INFO for associating an optional PNP hint table with this module. In the future, when these are added, these changes will silently ignore the new type they would otherwise warn about. It will always be safe to ignore this data. Get this into the builds today for some future proofing. Modified: stable/10/sys/boot/common/load_elf_obj.c stable/10/sys/sys/module.h stable/10/usr.sbin/kldxref/kldxref.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/load_elf_obj.c ============================================================================== --- stable/10/sys/boot/common/load_elf_obj.c Fri Apr 22 21:33:11 2016 (r298492) +++ stable/10/sys/boot/common/load_elf_obj.c Fri Apr 22 21:38:37 2016 (r298493) @@ -412,6 +412,7 @@ __elfN(obj_parse_modmetadata)(struct pre modcnt++; break; case MDT_MODULE: + case MDT_PNP_INFO: break; default: printf("unknown type %d\n", md.md_type); Modified: stable/10/sys/sys/module.h ============================================================================== --- stable/10/sys/sys/module.h Fri Apr 22 21:33:11 2016 (r298492) +++ stable/10/sys/sys/module.h Fri Apr 22 21:38:37 2016 (r298493) @@ -35,6 +35,7 @@ #define MDT_DEPEND 1 /* argument is a module name */ #define MDT_MODULE 2 /* module declaration */ #define MDT_VERSION 3 /* module version(s) */ +#define MDT_PNP_INFO 4 /* Plug and play hints record */ #define MDT_STRUCT_VERSION 1 /* version of metadata structure */ #define MDT_SETNAME "modmetadata_set" Modified: stable/10/usr.sbin/kldxref/kldxref.c ============================================================================== --- stable/10/usr.sbin/kldxref/kldxref.c Fri Apr 22 21:33:11 2016 (r298492) +++ stable/10/usr.sbin/kldxref/kldxref.c Fri Apr 22 21:38:37 2016 (r298493) @@ -172,6 +172,10 @@ parse_entry(struct mod_metadata *md, con record_string(kldname); } break; + case MDT_PNP_INFO: + if (dflag) { + printf(" pnp info for bus %s\n", cval); + } default: warnx("unknown metadata record %d in file %s", md->md_type, kldname); } From owner-svn-src-all@freebsd.org Fri Apr 22 21:40:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AF07B18A93 for ; Fri, 22 Apr 2016 21:40:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5C3D1EEA for ; Fri, 22 Apr 2016 21:40:07 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: b6e95894-08d2-11e6-b8f9-33a5b3560672 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Fri, 22 Apr 2016 21:39:38 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u3MLdw8h044801; Fri, 22 Apr 2016 15:39:58 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1461361198.1191.39.camel@freebsd.org> Subject: Re: svn commit: r298477 - in head/sys: conf riscv/riscv From: Ian Lepore To: Marko Zec , Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 22 Apr 2016 15:39:58 -0600 In-Reply-To: <20160422233137.7f37bb47@x23> References: <201604221615.u3MGFxCM088374@repo.freebsd.org> <20160422233137.7f37bb47@x23> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:40:08 -0000 On Fri, 2016-04-22 at 23:31 +0200, Marko Zec wrote: > On Fri, 22 Apr 2016 16:15:59 +0000 > Ruslan Bukin wrote: > > > Author: br > > Date: Fri Apr 22 16:15:58 2016 > > New Revision: 298477 > > URL: https://svnweb.freebsd.org/changeset/base/298477 > > > > Log: > > Clear the DDR memory. This should be done by bootloaders, > > but they have no such feature yet. > > > > This fixes operation on Rocket Core and lowRISC. > > > > Modified: > > head/sys/conf/options.riscv > > head/sys/riscv/riscv/locore.S > > > > Modified: head/sys/conf/options.riscv > > ============================================================================== > > --- head/sys/conf/options.riscv> > > > Fri Apr 22 15:12:05 > > 2016> > > > (r298476) +++ head/sys/conf/options.riscv> > > > Fri Apr > > 22 16:15:58 2016> > > > (r298477) @@ -2,3 +2,4 @@ > > > > RISCV> > > > > > > > > > opt_global.h > > VFP> > > > > > > > > > opt_global.h > > +DDR_CLEAR_SIZE> > > > > > > > opt_global.h > > > > Modified: head/sys/riscv/riscv/locore.S > > ============================================================================== > > --- head/sys/riscv/riscv/locore.S> > > > Fri Apr 22 15:12:05 > > 2016> > > > (r298476) +++ head/sys/riscv/riscv/locore.S> > > > Fri > > Apr 22 16:15:58 2016> > > > (r298477) @@ -126,6 +126,17 @@ _start: > > > > > > csrr> > > > a0, mhartid > > > > > > bnez> > > > a0, mpentry > > > > +#if defined(DDR_CLEAR_SIZE) > > +> > > > /* Clear DDR memory */ > > +> > > > la> > > > t0, _end > > +> > > > li> > > > t1, DDR_CLEAR_SIZE > > +1: > > +> > > > sd> > > > zero, 0(t0) > > +> > > > addi> > > > t0, t0, 8 > > +> > > > bltu> > > > t0, t1, 1b > > Usually _end appears to be (double) word aligned, but that happens out > of pure luck, since compilers do not provide firm guarantees about > _end's alignment (at least gcc doesn't, as far as I know). > > So depending on which kind of RV this code would run, sometimes it may > end up doing a lot of traps emulating unaligned access in software, or > worse... > > Hence it would't hurt to check for _end's alignment first and do a few > byte-by-byte bzero()ing if needed, before proceeding a dword pace. > > All of our kernel linker scripts ensure that _end is aligned correctly for the platform, except powerpc and powerpc64. I'm not sure if it's just not required for those, or maybe it's an oversight that has been harmless so far. -- Ian From owner-svn-src-all@freebsd.org Fri Apr 22 21:43:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3AD1B18C18; Fri, 22 Apr 2016 21:43:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C54911281; Fri, 22 Apr 2016 21:43:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MLhjx8088577; Fri, 22 Apr 2016 21:43:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MLhjbW088576; Fri, 22 Apr 2016 21:43:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604222143.u3MLhjbW088576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 22 Apr 2016 21:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298494 - stable/10/usr.sbin/kldxref X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:43:46 -0000 Author: emaste Date: Fri Apr 22 21:43:44 2016 New Revision: 298494 URL: https://svnweb.freebsd.org/changeset/base/298494 Log: MFC r288490: Add debug file extension to kldxref(8) After r288176 [in head] kernel debug files have the extension .debug. They also moved [in head] to /usr/lib/debug/boot/kernel by default so in the normal case kldxref does not encounter them. A src.conf(5) setting may be used to continue installing them in /boot/kernel though, so have kldxref skip .debug files in addition to .symbols files. Merged this change to avoid warnings when a stable/10 kldxref runs against a head install, perhaps on an upgrade to 11-CURRENT. The change to kernel debug files will not be merged to stable/10. Modified: stable/10/usr.sbin/kldxref/kldxref.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/kldxref/kldxref.c ============================================================================== --- stable/10/usr.sbin/kldxref/kldxref.c Fri Apr 22 21:38:37 2016 (r298493) +++ stable/10/usr.sbin/kldxref/kldxref.c Fri Apr 22 21:43:44 2016 (r298494) @@ -360,9 +360,12 @@ main(int argc, char *argv[]) fwrite(&ival, sizeof(ival), 1, fxref); reccnt = 0; } - /* skip non-files or .symbols entries */ + /* skip non-files and separate debug files */ if (p->fts_info != FTS_F) continue; + if (p->fts_namelen >= 6 && + strcmp(p->fts_name + p->fts_namelen - 6, ".debug") == 0) + continue; if (p->fts_namelen >= 8 && strcmp(p->fts_name + p->fts_namelen - 8, ".symbols") == 0) continue; From owner-svn-src-all@freebsd.org Fri Apr 22 21:45:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91410B18D4C; Fri, 22 Apr 2016 21:45:28 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-32.csi.cam.ac.uk (ppsw-32.csi.cam.ac.uk [131.111.8.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EFAB14AA; Fri, 22 Apr 2016 21:45:27 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from xc1.bsdpad.com ([195.154.136.64]:38758) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1atit5-000GI5-34 (Exim 4.86_36-e07b163) (return-path ); Fri, 22 Apr 2016 22:45:19 +0100 Date: Fri, 22 Apr 2016 22:30:08 +0100 From: Ruslan Bukin To: Marko Zec Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298477 - in head/sys: conf riscv/riscv Message-ID: <20160422213008.GA77800@bsdpad.com> References: <201604221615.u3MGFxCM088374@repo.freebsd.org> <20160422233137.7f37bb47@x23> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160422233137.7f37bb47@x23> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: "R. Bukin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:45:28 -0000 On Fri, Apr 22, 2016 at 11:31:37PM +0200, Marko Zec wrote: > On Fri, 22 Apr 2016 16:15:59 +0000 > Ruslan Bukin wrote: > > > Author: br > > Date: Fri Apr 22 16:15:58 2016 > > New Revision: 298477 > > URL: https://svnweb.freebsd.org/changeset/base/298477 > > > > Log: > > Clear the DDR memory. This should be done by bootloaders, > > but they have no such feature yet. > > > > This fixes operation on Rocket Core and lowRISC. > > > > Modified: > > head/sys/conf/options.riscv > > head/sys/riscv/riscv/locore.S > > > > Modified: head/sys/conf/options.riscv > > ============================================================================== > > --- head/sys/conf/options.riscv Fri Apr 22 15:12:05 > > 2016 (r298476) +++ head/sys/conf/options.riscv Fri Apr > > 22 16:15:58 2016 (r298477) @@ -2,3 +2,4 @@ > > > > RISCV opt_global.h > > VFP opt_global.h > > +DDR_CLEAR_SIZE opt_global.h > > > > Modified: head/sys/riscv/riscv/locore.S > > ============================================================================== > > --- head/sys/riscv/riscv/locore.S Fri Apr 22 15:12:05 > > 2016 (r298476) +++ head/sys/riscv/riscv/locore.S Fri > > Apr 22 16:15:58 2016 (r298477) @@ -126,6 +126,17 @@ _start: > > csrr a0, mhartid > > bnez a0, mpentry > > > > +#if defined(DDR_CLEAR_SIZE) > > + /* Clear DDR memory */ > > + la t0, _end > > + li t1, DDR_CLEAR_SIZE > > +1: > > + sd zero, 0(t0) > > + addi t0, t0, 8 > > + bltu t0, t1, 1b > > Usually _end appears to be (double) word aligned, but that happens out > of pure luck, since compilers do not provide firm guarantees about > _end's alignment (at least gcc doesn't, as far as I know). > > So depending on which kind of RV this code would run, sometimes it may > end up doing a lot of traps emulating unaligned access in software, or > worse... > > Hence it would't hurt to check for _end's alignment first and do a few > byte-by-byte bzero()ing if needed, before proceeding a dword pace. > > You right. Thanks. Anyway I think this commit is wrong in general as we usually require to clear BSS only. I was playing with buggy version of hardware and clearing all the DRR was helpful to get booted. I will check again soon on default hardware and hopefully will get this reverted. thanks Ruslan From owner-svn-src-all@freebsd.org Fri Apr 22 21:49:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5862CB18EAE; Fri, 22 Apr 2016 21:49:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 396E017C7; Fri, 22 Apr 2016 21:49:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 00491B94A; Fri, 22 Apr 2016 17:49:48 -0400 (EDT) From: John Baldwin To: Garrett Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r298491 - stable/10/lib/msun/tests Date: Fri, 22 Apr 2016 14:49:43 -0700 Message-ID: <1686086.xOFMeakFfv@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604222132.u3MLW1jx083176@repo.freebsd.org> References: <201604222132.u3MLW1jx083176@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 22 Apr 2016 17:49:48 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:49:49 -0000 On Friday, April 22, 2016 09:32:01 PM Garrett Cooper wrote: > Author: ngie > Date: Fri Apr 22 21:32:01 2016 > New Revision: 298491 > URL: https://svnweb.freebsd.org/changeset/base/298491 > > Log: > MFC r297836: > > Fix appending -O0 to CFLAGS > > The previous method would completely nerf CFLAGS once bsd.progs.mk had > recursed into the per-PROG logic and make the CFLAGS for tap testcases > to -O0, instead of appending to CFLAGS for all of the tap testcases. Eh, Bryan replied to the commit that put this into HEAD saying it was a no-op but you didn't reply. Shouldn't you address that first before MFC'ing? -- John Baldwin From owner-svn-src-all@freebsd.org Fri Apr 22 21:53:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 638EDB19045; Fri, 22 Apr 2016 21:53:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com [IPv6:2a00:1450:4010:c04::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D50DD1BCE; Fri, 22 Apr 2016 21:53:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x22f.google.com with SMTP id jj5so3826648lbc.0; Fri, 22 Apr 2016 14:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=az4hXxJR6UoNjrSq0fqkvvoYlCE0IO4HHPZzdVf0F6M=; b=WHUUgcLCcbWqtoJQlW3mEgDKaqYVf1uUO7Cardl5L8aGcjtpiq+3EK0l9qzz6tt8qZ vVJtNnjgk99nH64VivAjEtVYH8AIkXYrGSUPAJIem3SAMKVIUQrx6Mjqt6bJUHv2zYfF iiddm6LUlvKQis9uQ2XJQ9llUSCfW2Z8wZSU80VwJvUnJIToPP/X2aUIAAXAN5+oagny icGV6FYb5o2Is2qSA4hfZPLcIDp2Fj9hbwHQadHALodFDtghIGIRI2kLB4vRZV01Vf1y hx7mIxbxAWRk+hfMwW5y7jMioTvm/arn81nEcBXb5cFjQlGDGiEJhY17dMqgeNicc5lg FRxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=az4hXxJR6UoNjrSq0fqkvvoYlCE0IO4HHPZzdVf0F6M=; b=cxoMPSjHRDqe7uXC2RnmhTxkhMfiVEy+VdP1um5TzfNsrGpIfTJ71wDP/MVpTRpxkU yVpMBtgTtdcK+gTOjGX1wXxE/CU7+C63YeXVqsxb1d9pv1VKmB3QBvN8ULwHVLCN9vfj IVfJv5lfnKttRQOZ4wzD84iXEgepCExMgg8rN/0Dg02FL2Jk4NDkdgAfs1KfSKkI4S7g 6ZcOnDSVvKsWLoHrz5Jai+7E2YEAnrKRxblame3mKvfEXgOzLEJmesOayzF4rvuNrnUo us3KGAE8mCiA6O2U38A1lB1vWun6t+E8X55usGPNvWUlLiGJk/yyyA51otbmQf/l9j0A EHrg== X-Gm-Message-State: AOPr4FWcMOr+ruSSLBqJW+N+NYO9ZVV+juwEkx/oAKU+BhG95Eq2C0OsB4LD/UtZaGEk4luM8bBN8RDxIbhXIg== MIME-Version: 1.0 X-Received: by 10.112.189.1 with SMTP id ge1mr9438185lbc.9.1461362004947; Fri, 22 Apr 2016 14:53:24 -0700 (PDT) Received: by 10.112.236.33 with HTTP; Fri, 22 Apr 2016 14:53:24 -0700 (PDT) In-Reply-To: <1686086.xOFMeakFfv@ralph.baldwin.cx> References: <201604222132.u3MLW1jx083176@repo.freebsd.org> <1686086.xOFMeakFfv@ralph.baldwin.cx> Date: Fri, 22 Apr 2016 14:53:24 -0700 Message-ID: Subject: Re: svn commit: r298491 - stable/10/lib/msun/tests From: Ngie Cooper To: John Baldwin Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 21:53:28 -0000 On Fri, Apr 22, 2016 at 2:49 PM, John Baldwin wrote: > On Friday, April 22, 2016 09:32:01 PM Garrett Cooper wrote: >> Author: ngie >> Date: Fri Apr 22 21:32:01 2016 >> New Revision: 298491 >> URL: https://svnweb.freebsd.org/changeset/base/298491 >> >> Log: >> MFC r297836: >> >> Fix appending -O0 to CFLAGS >> >> The previous method would completely nerf CFLAGS once bsd.progs.mk had >> recursed into the per-PROG logic and make the CFLAGS for tap testcases >> to -O0, instead of appending to CFLAGS for all of the tap testcases. > > Eh, Bryan replied to the commit that put this into HEAD saying it was a > no-op but you didn't reply. Shouldn't you address that first before MFC'ing? Yeah, I should have... I'll do that now. From owner-svn-src-all@freebsd.org Fri Apr 22 22:02:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB5AB1935C; Fri, 22 Apr 2016 22:02:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0F72111D; Fri, 22 Apr 2016 22:02:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lf0-x22a.google.com with SMTP id g184so86840601lfb.3; Fri, 22 Apr 2016 15:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=RgfTTkbh3oRzCegvitFIH3Z6R/LdMWof+Q196m1OLdU=; b=BdCwqBAKr3xcOO9SrhhUUAn0JCoVZVV9sZcgrI9oGbTGsiicmVfLUkm0hChBGDt93L Klg0h1xtJhrHQM3KsYJ3vKvP3r0Iq6KKnB5R2vH7gHpoZedb+v5RPXnT7TVIqVVF6iDX g+KnxTwHz+THUZZaNr3A2TbjtqAFMUM/Sh8V7RjG3VoXeRq2l00+TnHwrQkTdnONrlLy IR0tdmxcG2xDcjsq5GqvZTpHIdlB/zkCwIgyNbhKQambV2RK2NiUIQspyore5woen7XQ juSkTL5GZX9zvCISKri96f5XiB1Gp3+CHRo3ZZ6YQyQkv7K+104bdA9bTzcV4efNcsxh begg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=RgfTTkbh3oRzCegvitFIH3Z6R/LdMWof+Q196m1OLdU=; b=YXffC3aWiX85/Wkza7w5v0+SsXRUHn2VR1/qXY1Kcth2zUX2Bt/EcqHP1bK8VYU5gX IfDKLe1j0n1HV41UDCACoAhTqz6kZg9HIZWoAU5xqxdIJ9ZeIDiHyxfz19vneYSmxBaU 2NqhU+dejC5KKC7E20ht/V+FcSP4TS7MaSqUsr3P8vCeTan3PtJm4efbVjYVdqpEWhlc 4DfFIVUiViVJWVTnAdACie27xunSIrGc2jEEDmk/15kBrRozm1PLQEc3nm5Wg1CnF3av 30DbvThlmbHexI8kpyvJLzh2nICkgO4iLXh76zHJhP5/V4lSt51znIcQ+py0EDNUMg+B h1LA== X-Gm-Message-State: AOPr4FVPGCSBc0n+P4HQaqGJschN0oa31yD0e5JSYRG1BwvGhgF/ZEtRMfNtTm6iCzKlkvHG15W1lbkEXhALxA== MIME-Version: 1.0 X-Received: by 10.25.78.204 with SMTP id c195mr8196462lfb.21.1461362534770; Fri, 22 Apr 2016 15:02:14 -0700 (PDT) Received: by 10.112.236.33 with HTTP; Fri, 22 Apr 2016 15:02:14 -0700 (PDT) In-Reply-To: <570C6BD4.5030609@FreeBSD.org> References: <201604112115.u3BLFmN9003703@repo.freebsd.org> <570C6BD4.5030609@FreeBSD.org> Date: Fri, 22 Apr 2016 15:02:14 -0700 Message-ID: Subject: Re: svn commit: r297836 - head/lib/msun/tests From: Ngie Cooper To: Bryan Drewery Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 22:02:17 -0000 On Mon, Apr 11, 2016 at 8:30 PM, Bryan Drewery wrote= : > On 4/11/2016 2:15 PM, Garrett Cooper wrote: >> Author: ngie >> Date: Mon Apr 11 21:15:48 2016 >> New Revision: 297836 >> URL: https://svnweb.freebsd.org/changeset/base/297836 >> >> Log: >> Fix appending -O0 to CFLAGS > > This seems to be a NOP. > >> >> The previous method would completely nerf CFLAGS once bsd.progs.mk had > > I'm not seeing 'completely nerf' in a diff: >> -/usr/local/bin/ccache cc -O2 -pipe -DHAVE_FENV_H -D__HAVE_LONG_DOUBLE -= DLDBL_PREC=3D64 -O0 -g -std=3Diso9899:1999 -fstack-protector-strong -Wno-= unknown-pragmas -fcolor-diagnostics -Qunused-arguments -c /root/git/free= bsd/lib/msun/tests/nearbyint_test.c -o nearbyint_test.o >> -cc -O2 -pipe -DHAVE_FENV_H -D__HAVE_LONG_DOUBLE -DLDBL_PREC=3D64 -O0 -g= -std=3Diso9899:1999 -fstack-protector-strong -Wno-unknown-pragmas -fcolor-= diagnostics -Qunused-arguments -o nearbyint_test.full nearbyint_test.o -= lm >> +/usr/local/bin/ccache cc -O2 -pipe -DHAVE_FENV_H -D__HAVE_LONG_DOUBLE -= O0 -DLDBL_PREC=3D64 -g -std=3Diso9899:1999 -fstack-protector-strong -Wno-= unknown-pragmas -fcolor-diagnostics -Qunused-arguments -c /root/git/free= bsd/lib/msun/tests/nearbyint_test.c -o nearbyint_test.o >> +cc -O2 -pipe -DHAVE_FENV_H -D__HAVE_LONG_DOUBLE -O0 -DLDBL_PREC=3D64 -g= -std=3Diso9899:1999 -fstack-protector-strong -Wno-unknown-pragmas -fcolor-= diagnostics -Qunused-arguments -o nearbyint_test.full nearbyint_test.o -= lm > > It's simply moving it earlier, since it comes before the CFLAGS+=3D-DLDBL= _PREC > > I diff'd the entire output and all were the same as this. > > Am I missing something? What prompted me to do this (and brought me to this incorrect conclusion) originally is that I was trying to figure out why make -VCFLAGS.fminmax_test wasn't outputting -O* the way I thought it would. After doing some digging, yes... it was a silly nop :(... in retrospect (jhb was right) I shouldn't have MFCed it :/. I'll "revert" the change in the next go-around with this Makefile.. Thanks, -Ngie From owner-svn-src-all@freebsd.org Sat Apr 23 01:22:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D18DB182BA; Sat, 23 Apr 2016 01:22:06 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 177231FA4; Sat, 23 Apr 2016 01:22:06 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N1M5e9054843; Sat, 23 Apr 2016 01:22:05 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N1M5a0054841; Sat, 23 Apr 2016 01:22:05 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201604230122.u3N1M5a0054841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 23 Apr 2016 01:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298495 - in head/sys/fs: nfs nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 01:22:06 -0000 Author: rmacklem Date: Sat Apr 23 01:22:04 2016 New Revision: 298495 URL: https://svnweb.freebsd.org/changeset/base/298495 Log: Fix a LOR in the NFSv4.1 server. The ordering of acquisition of the state and session mutexes was reversed in two cases executed when an NFSv4.1 client created/freed a session. Since clients will typically do this only when mounting and dismounting, the likelyhood of causing a deadlock was low but possible. This can only occur for NFSv4.1 mounts, since the others do not use sessions. This was detected while testing the pNFS server/client where the client crashed during dismounting. The patch also reorders the unlocks, although that isn't necessary for correct operation. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfsrvstate.h head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfs/nfsrvstate.h ============================================================================== --- head/sys/fs/nfs/nfsrvstate.h Fri Apr 22 21:43:44 2016 (r298494) +++ head/sys/fs/nfs/nfsrvstate.h Sat Apr 23 01:22:04 2016 (r298495) @@ -113,7 +113,7 @@ struct nfsclient { * Structure for an NFSv4.1 session. * Locking rules for this structure. * To add/delete one of these structures from the lists, you must lock - * both: NFSLOCKSESSION(session hashhead) and NFSLOCKSTATE() in that order. + * both: NFSLOCKSTATE() and NFSLOCKSESSION(session hashhead) in that order. * To traverse the lists looking for one of these, you must hold one * of these two locks. * The exception is if the thread holds the exclusive root sleep lock. Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Apr 22 21:43:44 2016 (r298494) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Apr 23 01:22:04 2016 (r298495) @@ -624,13 +624,13 @@ nfsrv_getclient(nfsquad_t clientid, int NFSBCOPY(sessid, nsep->sess_cbsess.nfsess_sessionid, NFSX_V4SESSIONID); shp = NFSSESSIONHASH(nsep->sess_sessionid); + NFSLOCKSTATE(); NFSLOCKSESSION(shp); LIST_INSERT_HEAD(&shp->list, nsep, sess_hash); - NFSLOCKSTATE(); LIST_INSERT_HEAD(&clp->lc_session, nsep, sess_list); nsep->sess_clp = clp; - NFSUNLOCKSTATE(); NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); } } } else if (clp->lc_flags & LCL_NEEDSCONFIRM) { @@ -5923,6 +5923,7 @@ nfsrv_freesession(struct nfsdsession *se struct nfssessionhash *shp; int i; + NFSLOCKSTATE(); if (sep == NULL) { shp = NFSSESSIONHASH(sessionid); NFSLOCKSESSION(shp); @@ -5932,18 +5933,17 @@ nfsrv_freesession(struct nfsdsession *se NFSLOCKSESSION(shp); } if (sep != NULL) { - NFSLOCKSTATE(); sep->sess_refcnt--; if (sep->sess_refcnt > 0) { - NFSUNLOCKSTATE(); NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); return (0); } LIST_REMOVE(sep, sess_hash); LIST_REMOVE(sep, sess_list); - NFSUNLOCKSTATE(); } NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); if (sep == NULL) return (NFSERR_BADSESSION); for (i = 0; i < NFSV4_SLOTS; i++) From owner-svn-src-all@freebsd.org Sat Apr 23 01:22:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3FFBB182ED; Sat, 23 Apr 2016 01:22:13 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0D4F10E0; Sat, 23 Apr 2016 01:22:13 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N1MCeO054893; Sat, 23 Apr 2016 01:22:12 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N1MCcJ054892; Sat, 23 Apr 2016 01:22:12 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604230122.u3N1MCcJ054892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Sat, 23 Apr 2016 01:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298496 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 01:22:14 -0000 Author: davidcs Date: Sat Apr 23 01:22:12 2016 New Revision: 298496 URL: https://svnweb.freebsd.org/changeset/base/298496 Log: Remove Unused/Dead Code MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Sat Apr 23 01:22:04 2016 (r298495) +++ head/sys/dev/bxe/bxe.c Sat Apr 23 01:22:12 2016 (r298496) @@ -4429,115 +4429,6 @@ bxe_ifmedia_status(struct ifnet *ifp, st } } -static int -bxe_ioctl_nvram(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - struct bxe_nvram_data nvdata_base; - struct bxe_nvram_data *nvdata; - int len; - int error = 0; - - copyin(ifr->ifr_data, &nvdata_base, sizeof(nvdata_base)); - - len = (sizeof(struct bxe_nvram_data) + - nvdata_base.len - - sizeof(uint32_t)); - - if (len > sizeof(struct bxe_nvram_data)) { - if ((nvdata = (struct bxe_nvram_data *) - malloc(len, M_DEVBUF, - (M_NOWAIT | M_ZERO))) == NULL) { - BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed priv_op 0x%x " - " len = 0x%x\n", priv_op, len); - return (1); - } - memcpy(nvdata, &nvdata_base, sizeof(struct bxe_nvram_data)); - } else { - nvdata = &nvdata_base; - } - - if (priv_op == BXE_IOC_RD_NVRAM) { - BLOGD(sc, DBG_IOCTL, "IOC_RD_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - error = bxe_nvram_read(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - copyout(nvdata, ifr->ifr_data, len); - } else { /* BXE_IOC_WR_NVRAM */ - BLOGD(sc, DBG_IOCTL, "IOC_WR_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - copyin(ifr->ifr_data, nvdata, len); - error = bxe_nvram_write(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - } - - if (len > sizeof(struct bxe_nvram_data)) { - free(nvdata, M_DEVBUF); - } - - return (error); -} - -static int -bxe_ioctl_stats_show(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - const size_t str_size = (BXE_NUM_ETH_STATS * STAT_NAME_LEN); - const size_t stats_size = (BXE_NUM_ETH_STATS * sizeof(uint64_t)); - caddr_t p_tmp; - uint32_t *offset; - int i; - - switch (priv_op) - { - case BXE_IOC_STATS_SHOW_NUM: - memset(ifr->ifr_data, 0, sizeof(union bxe_stats_show_data)); - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.num = - BXE_NUM_ETH_STATS; - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.len = - STAT_NAME_LEN; - return (0); - - case BXE_IOC_STATS_SHOW_STR: - memset(ifr->ifr_data, 0, str_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - strcpy(p_tmp, bxe_eth_stats_arr[i].string); - p_tmp += STAT_NAME_LEN; - } - return (0); - - case BXE_IOC_STATS_SHOW_CNT: - memset(ifr->ifr_data, 0, stats_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - offset = ((uint32_t *)&sc->eth_stats + - bxe_eth_stats_arr[i].offset); - switch (bxe_eth_stats_arr[i].size) { - case 4: - *((uint64_t *)p_tmp) = (uint64_t)*offset; - break; - case 8: - *((uint64_t *)p_tmp) = HILO_U64(*offset, *(offset + 1)); - break; - default: - *((uint64_t *)p_tmp) = 0; - } - p_tmp += sizeof(uint64_t); - } - return (0); - - default: - return (-1); - } -} - static void bxe_handle_chip_tq(void *context, int pending) @@ -4578,8 +4469,6 @@ bxe_ioctl(if_t ifp, { struct bxe_softc *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *)data; - struct bxe_nvram_data *nvdata; - uint32_t priv_op; int mask = 0; int reinit = 0; int error = 0; @@ -4768,36 +4657,6 @@ bxe_ioctl(if_t ifp, error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; - case SIOCGPRIVATE_0: - copyin(ifr->ifr_data, &priv_op, sizeof(priv_op)); - - switch (priv_op) - { - case BXE_IOC_RD_NVRAM: - case BXE_IOC_WR_NVRAM: - nvdata = (struct bxe_nvram_data *)ifr->ifr_data; - BLOGD(sc, DBG_IOCTL, - "Received Private NVRAM ioctl addr=0x%x size=%u\n", - nvdata->offset, nvdata->len); - error = bxe_ioctl_nvram(sc, priv_op, ifr); - break; - - case BXE_IOC_STATS_SHOW_NUM: - case BXE_IOC_STATS_SHOW_STR: - case BXE_IOC_STATS_SHOW_CNT: - BLOGD(sc, DBG_IOCTL, "Received Private Stats ioctl (%d)\n", - priv_op); - error = bxe_ioctl_stats_show(sc, priv_op, ifr); - break; - - default: - BLOGW(sc, "Received Private Unknown ioctl (%d)\n", priv_op); - error = EINVAL; - break; - } - - break; - default: BLOGD(sc, DBG_IOCTL, "Received Unknown Ioctl (cmd=%lu)\n", (command & 0xff)); From owner-svn-src-all@freebsd.org Sat Apr 23 04:19:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11AD0B19677; Sat, 23 Apr 2016 04:19:44 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D26E61A57; Sat, 23 Apr 2016 04:19:43 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N4Jgi4007015; Sat, 23 Apr 2016 04:19:42 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N4JgV0007014; Sat, 23 Apr 2016 04:19:42 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604230419.u3N4JgV0007014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Sat, 23 Apr 2016 04:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298497 - head/sys/mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 04:19:44 -0000 Author: sgalabov Date: Sat Apr 23 04:19:42 2016 New Revision: 298497 URL: https://svnweb.freebsd.org/changeset/base/298497 Log: Minor pinctrl fixes for Mediatek/Ralink Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6041 Modified: head/sys/mips/mediatek/mtk_pinctrl.h Modified: head/sys/mips/mediatek/mtk_pinctrl.h ============================================================================== --- head/sys/mips/mediatek/mtk_pinctrl.h Sat Apr 23 01:22:12 2016 (r298496) +++ head/sys/mips/mediatek/mtk_pinctrl.h Sat Apr 23 04:19:42 2016 (r298497) @@ -168,7 +168,7 @@ DECL_FUNC(mt7628_i2s_func) = { }; DECL_FUNC(mt7628_uart0_func) = { - FUNC("uart", 0), FUNC("gpio", 1), FUNC("-", 2), FUNC("-", 3) + FUNC("uart0", 0), FUNC("gpio", 1), FUNC("-", 2), FUNC("-", 3) }; DECL_FUNC(mt7628_sd_func) = { @@ -188,11 +188,11 @@ DECL_FUNC(mt7628_i2c_func) = { }; DECL_FUNC(mt7628_uart1_func) = { - FUNC("uart", 0), FUNC("gpio", 1), FUNC("pwm", 2), FUNC("sw r", 3) + FUNC("uart1", 0), FUNC("gpio", 1), FUNC("pwm", 2), FUNC("sw r", 3) }; DECL_FUNC(mt7628_uart2_func) = { - FUNC("uart", 0), FUNC("gpio", 1), FUNC("pwm", 2), FUNC("sdxc", 3) + FUNC("uart2", 0), FUNC("gpio", 1), FUNC("pwm", 2), FUNC("sdxc", 3) }; DECL_FUNC(mt7628_pwm0_func) = { From owner-svn-src-all@freebsd.org Sat Apr 23 04:21:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F655B197DD; Sat, 23 Apr 2016 04:21:19 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 378BA1CC0; Sat, 23 Apr 2016 04:21:19 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N4LI5i009724; Sat, 23 Apr 2016 04:21:18 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N4LIJF009723; Sat, 23 Apr 2016 04:21:18 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604230421.u3N4LIJF009723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Sat, 23 Apr 2016 04:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298498 - head/sys/mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 04:21:19 -0000 Author: sgalabov Date: Sat Apr 23 04:21:18 2016 New Revision: 298498 URL: https://svnweb.freebsd.org/changeset/base/298498 Log: Introduce palmbus for Mediatek/Ralink SoCs This allows us to get closer to OpenWRT DTS files and minimize the diffs a little more. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6042 Added: head/sys/mips/mediatek/palmbus.c (contents, props changed) Added: head/sys/mips/mediatek/palmbus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mediatek/palmbus.c Sat Apr 23 04:21:18 2016 (r298498) @@ -0,0 +1,81 @@ +/*- + * Copyright (c) 2016 Stanislav Galabov. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +/* + * Driver for Mediatek/Ralink Palmbus + * + * Currently the only reason for the existence of this driver is so that we can + * minimize the changes required to the upstream DTS files we use. + * Otherwise palmbus is a very simple subclass of our simplebus and the only + * difference between the two is the actual value of the compatible property. + */ + +static int +palmbus_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!(ofw_bus_is_compatible(dev, "palmbus") && + ofw_bus_has_prop(dev, "ranges")) && + (ofw_bus_get_type(dev) == NULL || strcmp(ofw_bus_get_type(dev), + "soc") != 0)) + return (ENXIO); + + device_set_desc(dev, "MTK Palmbus"); + + return (0); +} + +static device_method_t palmbus_methods[] = { + DEVMETHOD(device_probe, palmbus_probe), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(palmbus, palmbus_driver, palmbus_methods, + sizeof(struct simplebus_softc), simplebus_driver); +static devclass_t palmbus_devclass; +EARLY_DRIVER_MODULE(palmbus, ofwbus, palmbus_driver, palmbus_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(palmbus, 1); From owner-svn-src-all@freebsd.org Sat Apr 23 04:22:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CB7CB1986E; Sat, 23 Apr 2016 04:22:39 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49D671FDC; Sat, 23 Apr 2016 04:22:39 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N4Mc3B009827; Sat, 23 Apr 2016 04:22:38 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N4Mc9m009826; Sat, 23 Apr 2016 04:22:38 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604230422.u3N4Mc9m009826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Sat, 23 Apr 2016 04:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298499 - head/sys/mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 04:22:39 -0000 Author: sgalabov Date: Sat Apr 23 04:22:38 2016 New Revision: 298499 URL: https://svnweb.freebsd.org/changeset/base/298499 Log: Use cpu_establish_hardintr in mtk_intr_gic This allows us to come closer to OpenWRT vanilla DTS files. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6045 Modified: head/sys/mips/mediatek/mtk_intr_gic.c Modified: head/sys/mips/mediatek/mtk_intr_gic.c ============================================================================== --- head/sys/mips/mediatek/mtk_intr_gic.c Sat Apr 23 04:21:18 2016 (r298498) +++ head/sys/mips/mediatek/mtk_intr_gic.c Sat Apr 23 04:22:38 2016 (r298499) @@ -95,7 +95,6 @@ struct mtk_gic_softc { static struct resource_spec mtk_gic_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Registers */ - { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Parent interrupt 1 */ { -1, 0 } }; @@ -104,15 +103,8 @@ static struct ofw_compat_data compat_dat { NULL, 0 } }; -#if 0 -#define READ4(_sc, _reg) \ - bus_space_read_4((_sc)->bst, (_sc)->bsh, _reg) -#define WRITE4(_sc, _reg, _val) \ - bus_space_write_4((_sc)->bst, (_sc)->bsh, _reg, _val) -#else #define READ4(_sc, _reg) bus_read_4((_sc)->gic_res[0], (_reg)) #define WRITE4(_sc, _reg, _val) bus_write_4((_sc)->gic_res[0], (_reg), (_val)) -#endif static int mtk_gic_probe(device_t dev) @@ -226,12 +218,9 @@ mtk_gic_attach(device_t dev) goto cleanup; } - if (bus_setup_intr(dev, sc->gic_res[1], INTR_TYPE_CLK, - mtk_gic_intr, NULL, sc, &sc->gic_intrhand)) { - device_printf(dev, "could not setup irq handler\n"); - intr_pic_deregister(dev, xref); - goto cleanup; - } + cpu_establish_hardintr("gic", mtk_gic_intr, NULL, sc, 0, INTR_TYPE_CLK, + NULL); + return (0); cleanup: From owner-svn-src-all@freebsd.org Sat Apr 23 04:24:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D856DB1993A; Sat, 23 Apr 2016 04:24:32 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFD68117F; Sat, 23 Apr 2016 04:24:32 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N4OVkc009941; Sat, 23 Apr 2016 04:24:31 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N4OVwr009932; Sat, 23 Apr 2016 04:24:31 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604230424.u3N4OVwr009932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Sat, 23 Apr 2016 04:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298500 - head/sys/boot/fdt/dts/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 04:24:32 -0000 Author: sgalabov Date: Sat Apr 23 04:24:30 2016 New Revision: 298500 URL: https://svnweb.freebsd.org/changeset/base/298500 Log: Reduce the FreeBSD specific DTS files for Mediatek/Ralink The introduction of palmbus and previous work allows us to cut the differences between FreeBSD and OpenWRT DTS files a bit further. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6043 Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi head/sys/boot/fdt/dts/mips/fbsd-mt7620n.dtsi head/sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt2880.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt3050.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt3352.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi head/sys/boot/fdt/dts/mips/fbsd-rt5350.dtsi Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi Sat Apr 23 04:22:38 2016 (r298499) +++ head/sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi Sat Apr 23 04:24:30 2016 (r298500) @@ -1,13 +1,9 @@ /* $FreeBSD$ */ / { - - /* - * FreeBSD's stdin and stdout, so we can have a console - */ - chosen { - stdin = &uartlite; - stdout = &uartlite; + /* Specify alias for serial0 so we have a working console */ + aliases { + serial0 = "/palmbus@10000000/uartlite@c00"; }; /* @@ -18,22 +14,9 @@ #clock-cells = <1>; }; - palmbus@10000000 { - /* - * Make palmbus compatible to our simplebus - */ - compatible = "simple-bus"; - - /* - * Reference uartlite@c00 as uartlite, so we can address it - * within the chosen node above - */ - uartlite: uartlite@c00 {}; - }; - + /* Specify the clocks node for the usbphy */ usbphy: usbphy { clocks = <&clkctrl 22 &clkctrl 25>; - clock-names = "host", "device"; }; pcie@10140000 { Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7620n.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-mt7620n.dtsi Sat Apr 23 04:22:38 2016 (r298499) +++ head/sys/boot/fdt/dts/mips/fbsd-mt7620n.dtsi Sat Apr 23 04:24:30 2016 (r298500) @@ -1,13 +1,9 @@ /* $FreeBSD$ */ / { - - /* - * FreeBSD's stdin and stdout, so we can have a console - */ - chosen { - stdin = &uartlite; - stdout = &uartlite; + /* Specify alias for serial0 so we have a working console */ + aliases { + serial0 = "/palmbus@10000000/uartlite@c00"; }; /* @@ -18,21 +14,8 @@ #clock-cells = <1>; }; - palmbus@10000000 { - /* - * Make palmbus compatible to our simplebus - */ - compatible = "simple-bus"; - - /* - * Reference uartlite@c00 as uartlite, so we can address it - * within the chosen node above - */ - uartlite: uartlite@c00 {}; - }; - + /* Specify the clocks node for the usbphy */ usbphy: usbphy { clocks = <&clkctrl 22 &clkctrl 25>; - clock-names = "host", "device"; }; }; Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi Sat Apr 23 04:22:38 2016 (r298499) +++ head/sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi Sat Apr 23 04:24:30 2016 (r298500) @@ -1,13 +1,9 @@ /* $FreeBSD$ */ / { - - /* - * FreeBSD's stdin and stdout, so we can have a console - */ - chosen { - stdin = &uartlite; - stdout = &uartlite; + /* Specify alias for serial0 so we have a working console */ + aliases { + serial0 = "/palmbus@1E000000/uartlite@c00"; }; /* @@ -18,33 +14,8 @@ #clock-cells = <1>; }; - gic: interrupt-controller@1fbc0000 { - /* - * OpenWRT does not define the GIC interrupt, but we need it - * for now, at least until we re-work our GIC driver - */ - interrupt-parent = <&cpuintc>; - interrupts = <2>; - }; - palmbus@1E000000 { - /* - * Make palmbus compatible to our simplebus - */ - compatible = "simple-bus"; - - /* - * Reference uartlite@c00 as uartlite, so we can address it - * within the chosen node above - */ - uartlite: uartlite@c00 { - /* - * Mark uartlite as compatible to mtk,ns16550a instead - * of simply ns16550a so we can autodetect the UART - * clock - */ - compatible = "mtk,ns16550a"; - }; + uartlite@c00 { clock-frequency = <50000000>; }; gpio@600 { /* @@ -62,17 +33,17 @@ gpio0: bank@0 { reg = <0x0 0x100>; - interrupts = ; + interrupts = <0 6 4>; }; gpio1: bank@1 { reg = <0x0 0x100>; - interrupts = ; + interrupts = <0 6 4>; }; gpio2: bank@2 { reg = <0x0 0x100>; - interrupts = ; + interrupts = <0 6 4>; }; }; }; Modified: head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi Sat Apr 23 04:22:38 2016 (r298499) +++ head/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi Sat Apr 23 04:24:30 2016 (r298500) @@ -1,13 +1,9 @@ /* $FreeBSD$ */ / { - - /* - * FreeBSD's stdin and stdout, so we can have a console - */ - chosen { - stdin = &uartlite; - stdout = &uartlite; + /* Specify alias for serial0 so we have a working console */ + aliases { + serial0 = "/palmbus@10000000/uart2@e00"; }; /* @@ -19,23 +15,9 @@ }; palmbus@10000000 { - /* - * Make palmbus compatible to our simplebus - */ - compatible = "simple-bus"; - - /* - * Reference uart2@e00 as uartlite, so we can address it - * within the chosen node above - */ - uartlite: uart2@e00 { - /* - * Mark uartlite as compatible to mtk,ns16550a instead - * of simply ns16550a so we can autodetect the UART - * clock - */ - compatible = "mtk,ns16550a"; - }; + uartlite@c00 { clock-frequency = <40000000>; }; + uart1@d00 { clock-frequency = <40000000>; }; + uart2@e00 { clock-frequency = <40000000>; }; gpio@600 { /* @@ -66,9 +48,9 @@ }; }; + /* Specify the clocks node for the usbphy */ usbphy: usbphy@10120000 { clocks = <&clkctrl 22 &clkctrl 25>; - clock-names = "host", "device"; }; pcie@10140000 { Modified: head/sys/boot/fdt/dts/mips/fbsd-rt2880.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-rt2880.dtsi Sat Apr 23 04:22:38 2016 (r298499) +++ head/sys/boot/fdt/dts/mips/fbsd-rt2880.dtsi Sat Apr 23 04:24:30 2016 (r298500) @@ -1,13 +1,9 @@ /* $FreeBSD$ */ / { - - /* - * FreeBSD's stdin and stdout, so we can have a console - */ - chosen { - stdin = &uartlite; - stdout = &uartlite; + /* Specify alias for serial0 so we have a working console */ + aliases { + serial0 = "/palmbus@300000/uartlite@c00"; }; /* @@ -17,17 +13,4 @@ compatible = "ralink,rt2880-clock"; #clock-cells = <1>; }; - - palmbus@300000 { - /* - * Make palmbus compatible to our simplebus - */ - compatible = "simple-bus"; - - /* - * Reference uartlite@c00 as uartlite, so we can address it - * within the chosen node above - */ - uartlite: uartlite@c00 {}; - }; }; Modified: head/sys/boot/fdt/dts/mips/fbsd-rt3050.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-rt3050.dtsi Sat Apr 23 04:22:38 2016 (r298499) +++ head/sys/boot/fdt/dts/mips/fbsd-rt3050.dtsi Sat Apr 23 04:24:30 2016 (r298500) @@ -1,13 +1,9 @@ /* $FreeBSD$ */ / { - - /* - * FreeBSD's stdin and stdout, so we can have a console - */ - chosen { - stdin = &uartlite; - stdout = &uartlite; + /* Specify alias for serial0 so we have a working console */ + aliases { + serial0 = "/palmbus@10000000/uartlite@c00"; }; /* @@ -18,24 +14,10 @@ #clock-cells = <1>; }; - palmbus@10000000 { - /* - * Make palmbus compatible to our simplebus - */ - compatible = "simple-bus"; - - /* - * Reference uartlite@c00 as uartlite, so we can address it - * within the chosen node above - */ - uartlite: uartlite@c00 {}; - }; - + /* Specify the USB PHY */ usbphy: usbphy { compatible = "ralink,rt3050-usbphy"; resets = <&rstctrl 22>; - reset-names = "otg"; clocks = <&clkctrl 18>; - clock-names = "otg"; }; }; Modified: head/sys/boot/fdt/dts/mips/fbsd-rt3352.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-rt3352.dtsi Sat Apr 23 04:22:38 2016 (r298499) +++ head/sys/boot/fdt/dts/mips/fbsd-rt3352.dtsi Sat Apr 23 04:24:30 2016 (r298500) @@ -1,13 +1,9 @@ /* $FreeBSD$ */ / { - - /* - * FreeBSD's stdin and stdout, so we can have a console - */ - chosen { - stdin = &uartlite; - stdout = &uartlite; + /* Specify alias for serial0 so we have a working console */ + aliases { + serial0 = "/palmbus@10000000/uartlite@c00"; }; /* @@ -18,21 +14,8 @@ #clock-cells = <1>; }; - palmbus@10000000 { - /* - * Make palmbus compatible to our simplebus - */ - compatible = "simple-bus"; - - /* - * Reference uartlite@c00 as uartlite, so we can address it - * within the chosen node above - */ - uartlite: uartlite@c00 {}; - }; - + /* Specify the clocks node for the usbphy */ usbphy { clocks = <&clkctrl 18 &clkctrl 20>; - clock-names = "host", "device"; }; }; Modified: head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi Sat Apr 23 04:22:38 2016 (r298499) +++ head/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi Sat Apr 23 04:24:30 2016 (r298500) @@ -1,13 +1,9 @@ /* $FreeBSD$ */ / { - - /* - * FreeBSD's stdin and stdout, so we can have a console - */ - chosen { - stdin = &uartlite; - stdout = &uartlite; + /* Specify alias for serial0 so we have a working console */ + aliases { + serial0 = "/palmbus@10000000/uartlite@c00"; }; /* @@ -18,19 +14,7 @@ #clock-cells = <1>; }; - palmbus@10000000 { - /* - * Make palmbus compatible to our simplebus - */ - compatible = "simple-bus"; - - /* - * Reference uartlite@c00 as uartlite, so we can address it - * within the chosen node above - */ - uartlite: uartlite@c00 {}; - }; - + /* Specify the clocks node for the usbphy */ usbphy: usbphy { clocks = <&clkctrl 22 &clkctrl 25>; clock-names = "host", "device"; Modified: head/sys/boot/fdt/dts/mips/fbsd-rt5350.dtsi ============================================================================== --- head/sys/boot/fdt/dts/mips/fbsd-rt5350.dtsi Sat Apr 23 04:22:38 2016 (r298499) +++ head/sys/boot/fdt/dts/mips/fbsd-rt5350.dtsi Sat Apr 23 04:24:30 2016 (r298500) @@ -1,13 +1,9 @@ /* $FreeBSD$ */ / { - - /* - * FreeBSD's stdin and stdout, so we can have a console - */ - chosen { - stdin = &uartlite; - stdout = &uartlite; + /* Specify alias for serial0 so we have a working console */ + aliases { + serial0 = "/palmbus@10000000/uartlite@c00"; }; /* @@ -18,21 +14,8 @@ #clock-cells = <1>; }; - palmbus@10000000 { - /* - * Make palmbus compatible to our simplebus - */ - compatible = "simple-bus"; - - /* - * Reference uartlite@c00 as uartlite, so we can address it - * within the chosen node above - */ - uartlite: uartlite@c00 {}; - }; - + /* Specify the clocks node for the USB PHY */ usbphy { clocks = <&clkctrl 18>; - clock-names = "host"; }; }; From owner-svn-src-all@freebsd.org Sat Apr 23 04:27:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A5AAB199FC; Sat, 23 Apr 2016 04:27:02 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB401323; Sat, 23 Apr 2016 04:27:02 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N4R1lg010065; Sat, 23 Apr 2016 04:27:01 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N4R1DS010064; Sat, 23 Apr 2016 04:27:01 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201604230427.u3N4R1DS010064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Sat, 23 Apr 2016 04:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298501 - head/sys/mips/mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 04:27:02 -0000 Author: sgalabov Date: Sat Apr 23 04:27:01 2016 New Revision: 298501 URL: https://svnweb.freebsd.org/changeset/base/298501 Log: Remove uart_dev_mtk_ns8250 The purpose of this file was to simply detect the UART speed before attaching the actual ns8250 driver so that we don't have to specify the UART speed in DTS files. However, OpenWRT DTS files specify ns16550a as a compatible string in their DTS files and this makes the original ns8250 driver attach to the device. So we would have to edit the DTS files anyway and since this is only the case for MT7621 and MT7628/MT7688 for now, it's better to just add the clock-frequency property to those (UART is always clocked by the same clock in both these SoCs, so that's fine) instead of having a separate driver and still having to change the DTS files. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6044 Deleted: head/sys/mips/mediatek/uart_dev_mtk_ns8250.c Modified: head/sys/mips/mediatek/files.mediatek Modified: head/sys/mips/mediatek/files.mediatek ============================================================================== --- head/sys/mips/mediatek/files.mediatek Sat Apr 23 04:24:30 2016 (r298500) +++ head/sys/mips/mediatek/files.mediatek Sat Apr 23 04:27:01 2016 (r298501) @@ -11,7 +11,6 @@ mips/mediatek/mtk_intr_v1.c optional m mips/mediatek/mtk_intr_v2.c optional mtk_intr_v2 mips/mediatek/mtk_intr_gic.c optional mtk_intr_gic mips/mediatek/uart_dev_mtk.c optional uart uart_dev_mtk -mips/mediatek/uart_dev_mtk_ns8250.c optional uart uart_ns8250 mips/mediatek/mtk_spi_v1.c optional spibus mtk_spi_v1 mips/mediatek/mtk_spi_v2.c optional spibus mtk_spi_v2 mips/mediatek/mtk_usb_phy.c optional usb mtk_usb_phy From owner-svn-src-all@freebsd.org Sat Apr 23 06:31:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D870B19CE5; Sat, 23 Apr 2016 06:31:47 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6011E13DC; Sat, 23 Apr 2016 06:31:47 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N6VklA048344; Sat, 23 Apr 2016 06:31:46 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N6Vkkc048343; Sat, 23 Apr 2016 06:31:46 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201604230631.u3N6Vkkc048343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 23 Apr 2016 06:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298502 - head/sys/geom/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 06:31:47 -0000 Author: sobomax Date: Sat Apr 23 06:31:46 2016 New Revision: 298502 URL: https://svnweb.freebsd.org/changeset/base/298502 Log: o Fix handling of images with compression block sizes comparable to MAXPHYS. o Improve debug somewhat; o Convert "BUG BUG BUG message" into a proper KASSERT. Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Sat Apr 23 04:27:01 2016 (r298501) +++ head/sys/geom/uzip/g_uzip.c Sat Apr 23 06:31:46 2016 (r298502) @@ -102,10 +102,9 @@ SYSCTL_UINT(_kern_geom_uzip, OID_AUTO, d printf a; \ } #define DPRINTF_BRNG(lvl, bcn, ecn, a) \ - if (bcn >= ecn) { \ - printf("DPRINTF_BRNG: invalid range (%ju, %ju), BUG BUG " \ - "BUG!\n", (uintmax_t)bcn, (uintmax_t)ecn); \ - } else if (((lvl) <= g_uzip_debug) || \ + KASSERT(bcn < ecn, ("DPRINTF_BRNG: invalid range (%ju, %ju)", \ + (uintmax_t)bcn, (uintmax_t)ecn)); \ + if (((lvl) <= g_uzip_debug) || \ BLK_IN_RANGE(g_uzip_debug_block, bcn, \ (intmax_t)ecn - (intmax_t)bcn)) { \ printf a; \ @@ -274,10 +273,15 @@ g_uzip_request(struct g_geom *gp, struct bp2->bio_length = TLEN_2_BLEN(sc, pp, bp2, end_blk - 1); if (bp2->bio_length <= MAXPHYS) break; - + if (end_blk == (start_blk + 1)) { + break; + } end_blk--; } + DPRINTF(GUZ_DBG_IO, ("%s/%s: bp2->bio_length = %jd\n", + __func__, gp->name, (intmax_t)bp2->bio_length)); + bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); if (bp2->bio_data == NULL) { g_destroy_bio(bp2); From owner-svn-src-all@freebsd.org Sat Apr 23 07:09:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8781B1953C; Sat, 23 Apr 2016 07:09:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 728611504; Sat, 23 Apr 2016 07:09:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N79NBB063035; Sat, 23 Apr 2016 07:09:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N79N4R063031; Sat, 23 Apr 2016 07:09:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604230709.u3N79N4R063031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 23 Apr 2016 07:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298503 - in stable/10: kerberos5/lib/libroken share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 07:09:24 -0000 Author: ngie Date: Sat Apr 23 07:09:23 2016 New Revision: 298503 URL: https://svnweb.freebsd.org/changeset/base/298503 Log: MFC r297282,r297456,r298012,r298013,r298014: r297282 (by bdrewery): We don't have a CPPFLAGS, COPTS or CPUFLAGS. r297456 (by bdrewery): We don't support DPLIBS. r298012: Add DEBUG_FLAGS to PROG_VARS and STRIP to PROG_OVERRIDE_VARS This will allow the variables [*] to be overridden on a per-PROG basis, which is useful when controlling "stripping" behavior for some tests that require debug symbols or to be unstripped DEBUG_FLAGS (similar to CFLAGS) supports appending, whereas STRIP is an override *: Due to how STRIP is defined in bsd.own.mk (in addition to bsd.lib.mk and bsd.prog.mk), and the fact that bsd.test.mk pulls in bsd.own.mk first, overriding STRIP doesn't work today. A follow up commit is pending to "rectify" this after additional testing is done. Discussed with: bdrewery r298013: Commit documentation change for r298012 Requested by: bdrewery r298014: Regenerate the list of bsd.progs.mk supported variables Prefix with dashes (unordered list) and put one variable on each line (to avoid future conflicts) Done via the following one-liner: > sh -c 'for i in $(make -C tests/sys/aio PROG=foo -VPROG_VARS:O); do printf "\t\t- $i\n"; done' Modified: stable/10/kerberos5/lib/libroken/Makefile stable/10/share/mk/bsd.README stable/10/share/mk/bsd.prog.mk stable/10/share/mk/bsd.progs.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/lib/libroken/Makefile ============================================================================== --- stable/10/kerberos5/lib/libroken/Makefile Sat Apr 23 06:31:46 2016 (r298502) +++ stable/10/kerberos5/lib/libroken/Makefile Sat Apr 23 07:09:23 2016 (r298503) @@ -77,7 +77,6 @@ SRCS= base64.c \ write_pid.c \ xfree.c -CPPFLAGS+= -DBUILD_ROKEN_LIB CFLAGS+=-I${KRB5DIR}/lib/roken -I. CLEANFILES= roken.h Modified: stable/10/share/mk/bsd.README ============================================================================== --- stable/10/share/mk/bsd.README Sat Apr 23 06:31:46 2016 (r298502) +++ stable/10/share/mk/bsd.README Sat Apr 23 07:09:23 2016 (r298503) @@ -262,9 +262,26 @@ PROGS_CXX PROG and PROGS_CXX in one Make LDADD.foo= -lutil SRCS.bar= bar_src.c - The supported variables are BINDIR BINGRP BINMODE BINOWN - CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS DPSRCS LDADD - LDFLAGS MAN MLINKS PROGNAME SRCS. + The supported variables are: + - BINDIR + - BINGRP + - BINMODE + - BINOWN + - CFLAGS + - CXXFLAGS + - DEBUG_FLAGS + - DPADD + - DPSRCS + - LDADD + - LDFLAGS + - LINKS + - MAN + - MLINKS + - NO_WERROR + - PROGNAME + - SRCS + - STRIP + - WARNS PROGNAME The name that the above program will be installed as, if different from ${PROG}. Modified: stable/10/share/mk/bsd.prog.mk ============================================================================== --- stable/10/share/mk/bsd.prog.mk Sat Apr 23 06:31:46 2016 (r298502) +++ stable/10/share/mk/bsd.prog.mk Sat Apr 23 07:09:23 2016 (r298503) @@ -7,6 +7,7 @@ # XXX The use of COPTS in modern makefiles is discouraged. .if defined(COPTS) +.warning COPTS should be CFLAGS. CFLAGS+=${COPTS} .endif Modified: stable/10/share/mk/bsd.progs.mk ============================================================================== --- stable/10/share/mk/bsd.progs.mk Sat Apr 23 06:31:46 2016 (r298502) +++ stable/10/share/mk/bsd.progs.mk Sat Apr 23 07:09:23 2016 (r298503) @@ -34,8 +34,8 @@ UPDATE_DEPENDFILE_PROG?= no .if defined(PROG) # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ - PROGNAME SRCS WARNS -PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD LINKS \ + PROGNAME SRCS STRIP WARNS +PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD LDADD LIBADD LINKS \ LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} .if empty(${PROG_OVERRIDE_VARS:M$v}) From owner-svn-src-all@freebsd.org Sat Apr 23 07:23:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAEF0B19B07; Sat, 23 Apr 2016 07:23:45 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CED21E20; Sat, 23 Apr 2016 07:23:45 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N7NiuR069022; Sat, 23 Apr 2016 07:23:44 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N7NhNb069008; Sat, 23 Apr 2016 07:23:43 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201604230723.u3N7NhNb069008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 23 Apr 2016 07:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298504 - head/usr.bin/mkuzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 07:23:45 -0000 Author: sobomax Date: Sat Apr 23 07:23:43 2016 New Revision: 298504 URL: https://svnweb.freebsd.org/changeset/base/298504 Log: Improve performance in a few key areas: o Split the compression across several worker threads. By default, "several" matches number of CPUs, capped at 24 for sanity when running on a very big hardwares. Provide option to set that number manually; o Fix bug inherited from the mkulzma (R.I.P) which degraded already slow LZMA compression even further by calling function to release compression state after processing each block. It is neither documented as required nor actually required by the LZMA library. This caused spree of system calls to release memory and then map it again for every block. LZMA compression is more than 2x faster after this change alone; o Record time it takes to do compression and report throughput achieved. o Add simple first-level 256 entry hash table for de-dup code, so it's not becoming a bottleneck at big files. Added: head/usr.bin/mkuzip/mkuz_blk.c (contents, props changed) head/usr.bin/mkuzip/mkuz_blk.h (contents, props changed) head/usr.bin/mkuzip/mkuz_blk_chain.h (contents, props changed) head/usr.bin/mkuzip/mkuz_cfg.h (contents, props changed) head/usr.bin/mkuzip/mkuz_conveyor.c (contents, props changed) head/usr.bin/mkuzip/mkuz_conveyor.h (contents, props changed) head/usr.bin/mkuzip/mkuz_format.h (contents, props changed) head/usr.bin/mkuzip/mkuz_fqueue.c (contents, props changed) head/usr.bin/mkuzip/mkuz_fqueue.h (contents, props changed) head/usr.bin/mkuzip/mkuz_time.c (contents, props changed) head/usr.bin/mkuzip/mkuz_time.h (contents, props changed) Modified: head/usr.bin/mkuzip/Makefile head/usr.bin/mkuzip/mkuz_blockcache.c head/usr.bin/mkuzip/mkuz_blockcache.h head/usr.bin/mkuzip/mkuz_lzma.c head/usr.bin/mkuzip/mkuz_lzma.h head/usr.bin/mkuzip/mkuz_zlib.c head/usr.bin/mkuzip/mkuz_zlib.h head/usr.bin/mkuzip/mkuzip.8 head/usr.bin/mkuzip/mkuzip.c head/usr.bin/mkuzip/mkuzip.h Modified: head/usr.bin/mkuzip/Makefile ============================================================================== --- head/usr.bin/mkuzip/Makefile Sat Apr 23 07:09:23 2016 (r298503) +++ head/usr.bin/mkuzip/Makefile Sat Apr 23 07:23:43 2016 (r298504) @@ -2,8 +2,11 @@ PROG= mkuzip MAN= mkuzip.8 -SRCS= mkuzip.c mkuz_blockcache.c mkuz_lzma.c mkuz_zlib.c +SRCS= mkuzip.c mkuz_blockcache.c mkuz_lzma.c mkuz_zlib.c mkuz_conveyor.c \ + mkuz_blk.c mkuz_fqueue.c mkuz_time.c -LIBADD= z md lzma +#CFLAGS+= -DMKUZ_DEBUG + +LIBADD= z md lzma pthread .include Added: head/usr.bin/mkuzip/mkuz_blk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_blk.c Sat Apr 23 07:23:43 2016 (r298504) @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2004-2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "mkuzip.h" +#include "mkuz_blk.h" + +struct mkuz_blk * +mkuz_blk_ctor(size_t blen) +{ + struct mkuz_blk *rval; + + rval = mkuz_safe_zmalloc(sizeof(struct mkuz_blk) + blen); + rval->alen = blen; + rval->br_offset = OFFSET_UNDEF; + return (rval); +} Added: head/usr.bin/mkuzip/mkuz_blk.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_blk.h Sat Apr 23 07:23:43 2016 (r298504) @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2004-2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define OFFSET_UNDEF UINT64_MAX + +struct mkuz_blk_info { + uint64_t offset; + size_t len; + uint32_t blkno; + unsigned char digest[16]; +}; + +#define MKUZ_BLK_EOF (void *)0x1 +#define MKUZ_BLK_MORE (void *)0x2 + +struct mkuz_blk { + struct mkuz_blk_info info; + size_t alen; + uint64_t br_offset; + unsigned char data[]; +}; + +struct mkuz_blk *mkuz_blk_ctor(size_t); Added: head/usr.bin/mkuzip/mkuz_blk_chain.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_blk_chain.h Sat Apr 23 07:23:43 2016 (r298504) @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +struct mkuz_blk; +struct mkuz_bchain_link; + +struct mkuz_bchain_link { + struct mkuz_blk *this; + struct mkuz_bchain_link *prev; +}; Modified: head/usr.bin/mkuzip/mkuz_blockcache.c ============================================================================== --- head/usr.bin/mkuzip/mkuz_blockcache.c Sat Apr 23 07:09:23 2016 (r298503) +++ head/usr.bin/mkuzip/mkuz_blockcache.c Sat Apr 23 07:23:43 2016 (r298504) @@ -22,97 +22,107 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * */ #include __FBSDID("$FreeBSD$"); -#include #include -#include #include #include #include #include #if defined(MKUZ_DEBUG) +# include # include #endif #include "mkuz_blockcache.h" +#include "mkuz_blk.h" -struct mkuz_blkcache { - struct mkuz_blkcache_hit hit; - off_t data_offset; - unsigned char digest[16]; - struct mkuz_blkcache *next; +struct mkuz_blkcache_itm { + struct mkuz_blk_info hit; + struct mkuz_blkcache_itm *next; }; -static struct mkuz_blkcache blkcache; +static struct mkuz_blkcache { + struct mkuz_blkcache_itm first[256]; +} blkcache; static int -verify_match(int fd, off_t data_offset, void *data, ssize_t len, - struct mkuz_blkcache *bcep) +verify_match(int fd, const struct mkuz_blk *cbp, struct mkuz_blkcache_itm *bcep) { void *vbuf; ssize_t rlen; int rval; rval = -1; - vbuf = malloc(len); + vbuf = malloc(cbp->info.len); if (vbuf == NULL) { goto e0; } - if (lseek(fd, bcep->data_offset, SEEK_SET) < 0) { + if (lseek(fd, bcep->hit.offset, SEEK_SET) < 0) { goto e1; } - rlen = read(fd, vbuf, len); - if (rlen != len) { + rlen = read(fd, vbuf, cbp->info.len); + if (rlen < 0 || (unsigned)rlen != cbp->info.len) { goto e2; } - rval = (memcmp(data, vbuf, len) == 0) ? 1 : 0; + rval = (memcmp(cbp->data, vbuf, cbp->info.len) == 0) ? 1 : 0; e2: - lseek(fd, data_offset, SEEK_SET); + lseek(fd, cbp->info.offset, SEEK_SET); e1: free(vbuf); e0: return (rval); } -struct mkuz_blkcache_hit * -mkuz_blkcache_regblock(int fd, uint32_t blkno, off_t offset, ssize_t len, - void *data) +#define I2J(x) ((intmax_t)(x)) +#define U2J(x) ((uintmax_t)(x)) + +static unsigned char +digest_fold(const unsigned char *mdigest) { - struct mkuz_blkcache *bcep; - MD5_CTX mcontext; - off_t data_offset; - unsigned char mdigest[16]; - int rval; + int i; + unsigned char rval; - data_offset = lseek(fd, 0, SEEK_CUR); - if (data_offset < 0) { - return (NULL); + rval = mdigest[0]; + for (i = 1; i < 16; i++) { + rval = rval ^ mdigest[i]; } - MD5Init(&mcontext); - MD5Update(&mcontext, data, len); - MD5Final(mdigest, &mcontext); - if (blkcache.hit.len == 0) { - bcep = &blkcache; + return (rval); +} + +struct mkuz_blk_info * +mkuz_blkcache_regblock(int fd, const struct mkuz_blk *bp) +{ + struct mkuz_blkcache_itm *bcep; + int rval; + unsigned char h; + +#if defined(MKUZ_DEBUG) + assert((unsigned)lseek(fd, 0, SEEK_CUR) == bp->info.offset); +#endif + h = digest_fold(bp->info.digest); + if (blkcache.first[h].hit.len == 0) { + bcep = &blkcache.first[h]; } else { - for (bcep = &blkcache; bcep != NULL; bcep = bcep->next) { - if (bcep->hit.len != len) + for (bcep = &blkcache.first[h]; bcep != NULL; bcep = bcep->next) { + if (bcep->hit.len != bp->info.len) continue; - if (memcmp(mdigest, bcep->digest, sizeof(mdigest)) == 0) { + if (memcmp(bp->info.digest, bcep->hit.digest, + sizeof(bp->info.digest)) == 0) { break; } } if (bcep != NULL) { - rval = verify_match(fd, data_offset, data, len, bcep); + rval = verify_match(fd, bp, bcep); if (rval == 1) { #if defined(MKUZ_DEBUG) - fprintf(stderr, "cache hit %d, %d, %d\n", - (int)bcep->hit.offset, (int)data_offset, (int)len); + fprintf(stderr, "cache hit %jd, %jd, %jd, %jd\n", + I2J(bcep->hit.blkno), I2J(bcep->hit.offset), + I2J(bp->info.offset), I2J(bp->info.len)); #endif return (&bcep->hit); } @@ -126,17 +136,13 @@ mkuz_blkcache_regblock(int fd, uint32_t warn("verify_match"); return (NULL); } - bcep = malloc(sizeof(struct mkuz_blkcache)); + bcep = malloc(sizeof(struct mkuz_blkcache_itm)); if (bcep == NULL) return (NULL); - memset(bcep, '\0', sizeof(struct mkuz_blkcache)); - bcep->next = blkcache.next; - blkcache.next = bcep; + memset(bcep, '\0', sizeof(struct mkuz_blkcache_itm)); + bcep->next = blkcache.first[h].next; + blkcache.first[h].next = bcep; } - memcpy(bcep->digest, mdigest, sizeof(mdigest)); - bcep->data_offset = data_offset; - bcep->hit.offset = offset; - bcep->hit.len = len; - bcep->hit.blkno = blkno; + bcep->hit = bp->info; return (NULL); } Modified: head/usr.bin/mkuzip/mkuz_blockcache.h ============================================================================== --- head/usr.bin/mkuzip/mkuz_blockcache.h Sat Apr 23 07:09:23 2016 (r298503) +++ head/usr.bin/mkuzip/mkuz_blockcache.h Sat Apr 23 07:23:43 2016 (r298504) @@ -26,11 +26,6 @@ * $FreeBSD$ */ -struct mkuz_blkcache_hit { - uint64_t offset; - ssize_t len; - uint32_t blkno; -}; +struct mkuz_blk; -struct mkuz_blkcache_hit *mkuz_blkcache_regblock(int, uint32_t, off_t, ssize_t, - void *); +struct mkuz_blk_info *mkuz_blkcache_regblock(int, const struct mkuz_blk *); Added: head/usr.bin/mkuzip/mkuz_cfg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_cfg.h Sat Apr 23 07:23:43 2016 (r298504) @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +struct mkuz_conveyor; + +struct mkuz_cfg { + int fdr; + int fdw; + int verbose; + int no_zcomp; + int en_dedup; + int nworkers; + int blksz; + const struct mkuz_format *handler; +}; Added: head/usr.bin/mkuzip/mkuz_conveyor.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_conveyor.c Sat Apr 23 07:23:43 2016 (r298504) @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2004-2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#if defined(MKUZ_DEBUG) +# include +#endif + +#include "mkuz_conveyor.h" +#include "mkuz_cfg.h" +#include "mkuzip.h" +#include "mkuz_format.h" +#include "mkuz_blk.h" +#include "mkuz_fqueue.h" +#include "mkuz_blk_chain.h" + +static void compute_digest(struct mkuz_blk *); + +struct cw_args { + struct mkuz_conveyor *cvp; + struct mkuz_cfg *cfp; +}; + +static void * +cworker(void *p) +{ + struct cw_args *cwp; + struct mkuz_cfg *cfp; + struct mkuz_blk *oblk, *iblk; + struct mkuz_conveyor *cvp; + void *c_ctx; + + cwp = (struct cw_args *)p; + cfp = cwp->cfp; + cvp = cwp->cvp; + free(cwp); + c_ctx = cfp->handler->f_init(cfp->blksz); + for (;;) { + iblk = mkuz_fqueue_deq(cvp->wrk_queue); + if (iblk == MKUZ_BLK_EOF) { + /* Let other threads to see the EOF block */ + mkuz_fqueue_enq(cvp->wrk_queue, iblk); + break; + } + if (cfp->no_zcomp == 0 && + mkuz_memvcmp(iblk->data, '\0', iblk->info.len) != 0) { + /* All zeroes block */ + oblk = mkuz_blk_ctor(0); + } else { + oblk = cfp->handler->f_compress(c_ctx, iblk); + if (cfp->en_dedup != 0) { + compute_digest(oblk); + } + } + oblk->info.blkno = iblk->info.blkno; + mkuz_fqueue_enq(cvp->results, oblk); + free(iblk); + } + return (NULL); +} + +static void +compute_digest(struct mkuz_blk *bp) +{ + MD5_CTX mcontext; + + MD5Init(&mcontext); + MD5Update(&mcontext, bp->data, bp->info.len); + MD5Final(bp->info.digest, &mcontext); +} + +struct mkuz_conveyor * +mkuz_conveyor_ctor(struct mkuz_cfg *cfp) +{ + struct mkuz_conveyor *cp; + struct cw_args *cwp; + int i, r; + + cp = mkuz_safe_zmalloc(sizeof(struct mkuz_conveyor) + + (sizeof(pthread_t) * cfp->nworkers)); + + cp->wrk_queue = mkuz_fqueue_ctor(1); + cp->results = mkuz_fqueue_ctor(1); + + for (i = 0; i < cfp->nworkers; i++) { + cwp = mkuz_safe_zmalloc(sizeof(struct cw_args)); + cwp->cfp = cfp; + cwp->cvp = cp; + r = pthread_create(&cp->wthreads[i], NULL, cworker, (void *)cwp); + if (r != 0) { + errx(1, "mkuz_conveyor_ctor: pthread_create() failed"); + /* Not reached */ + } + } + return (cp); +} Added: head/usr.bin/mkuzip/mkuz_conveyor.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_conveyor.h Sat Apr 23 07:23:43 2016 (r298504) @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +struct mkuz_fifo_queue; + +#define ITEMS_PER_WORKER 4 + +#define MAX_WORKERS_AUTO 24 + +struct mkuz_conveyor { + /* + * Work items are places in here, and picked up by workers in a FIFO + * fashion. + */ + struct mkuz_fifo_queue *wrk_queue; + /* + * Results are dropped into this FIFO and consumer is buzzed to pick them + * up + */ + struct mkuz_fifo_queue *results; + + pthread_t wthreads[]; +}; + +struct mkuz_cfg; + +struct mkuz_conveyor *mkuz_conveyor_ctor(struct mkuz_cfg *); Added: head/usr.bin/mkuzip/mkuz_format.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_format.h Sat Apr 23 07:23:43 2016 (r298504) @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define DEFINE_RAW_METHOD(func, rval, args...) typedef rval (*func##_t)(args) + +DEFINE_RAW_METHOD(f_init, void *, uint32_t); +DEFINE_RAW_METHOD(f_compress, struct mkuz_blk *, void *, const struct mkuz_blk *); + +struct mkuz_format { + const char *magic; + const char *default_sufx; + f_init_t f_init; + f_compress_t f_compress; +}; Added: head/usr.bin/mkuzip/mkuz_fqueue.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_fqueue.c Sat Apr 23 07:23:43 2016 (r298504) @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2004-2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#if defined(MKUZ_DEBUG) +# include +#endif + +#include "mkuzip.h" +#include "mkuz_fqueue.h" +#include "mkuz_conveyor.h" +#include "mkuz_blk.h" +#include "mkuz_blk_chain.h" + +struct mkuz_fifo_queue * +mkuz_fqueue_ctor(int wakeup_len) +{ + struct mkuz_fifo_queue *fqp; + + fqp = mkuz_safe_zmalloc(sizeof(struct mkuz_fifo_queue)); + fqp->wakeup_len = wakeup_len; + if (pthread_mutex_init(&fqp->mtx, NULL) != 0) { + errx(1, "pthread_mutex_init() failed"); + } + if (pthread_cond_init(&fqp->cvar, NULL) != 0) { + errx(1, "pthread_cond_init() failed"); + } + return (fqp); +} + +void +mkuz_fqueue_enq(struct mkuz_fifo_queue *fqp, struct mkuz_blk *bp) +{ + struct mkuz_bchain_link *ip; + + ip = mkuz_safe_zmalloc(sizeof(struct mkuz_bchain_link)); + ip->this = bp; + + pthread_mutex_lock(&fqp->mtx); + if (fqp->first != NULL) { + fqp->first->prev = ip; + } else { + fqp->last = ip; + } + fqp->first = ip; + fqp->length += 1; + if (fqp->length >= fqp->wakeup_len) { + pthread_cond_signal(&fqp->cvar); + } + pthread_mutex_unlock(&fqp->mtx); +} + +#if defined(NOTYET) +int +mkuz_fqueue_enq_all(struct mkuz_fifo_queue *fqp, struct mkuz_bchain_link *cip_f, + struct mkuz_bchain_link *cip_l, int clen) +{ + int rval; + + pthread_mutex_lock(&fqp->mtx); + if (fqp->first != NULL) { + fqp->first->prev = cip_l; + } else { + fqp->last = cip_l; + } + fqp->first = cip_f; + fqp->length += clen; + rval = fqp->length; + if (fqp->length >= fqp->wakeup_len) { + pthread_cond_signal(&fqp->cvar); + } + pthread_mutex_unlock(&fqp->mtx); + return (rval); +} +#endif + +static int +mkuz_fqueue_check(struct mkuz_fifo_queue *fqp, cmp_cb_t cmp_cb, void *cap) +{ + struct mkuz_bchain_link *ip; + + for (ip = fqp->last; ip != NULL; ip = ip->prev) { + if (cmp_cb(ip->this, cap)) { + return (1); + } + } + return (0); +} + +struct mkuz_blk * +mkuz_fqueue_deq_when(struct mkuz_fifo_queue *fqp, cmp_cb_t cmp_cb, void *cap) +{ + struct mkuz_bchain_link *ip, *newlast, *newfirst, *mip; + struct mkuz_blk *bp; + + pthread_mutex_lock(&fqp->mtx); + while (fqp->last == NULL || !mkuz_fqueue_check(fqp, cmp_cb, cap)) { + pthread_cond_wait(&fqp->cvar, &fqp->mtx); + } + if (cmp_cb(fqp->last->this, cap)) { + mip = fqp->last; + fqp->last = mip->prev; + if (fqp->last == NULL) { +#if defined(MKUZ_DEBUG) + assert(fqp->length == 1); +#endif + fqp->first = NULL; + } + } else { +#if defined(MKUZ_DEBUG) + assert(fqp->length > 1); +#endif + newfirst = newlast = fqp->last; + mip = NULL; + for (ip = fqp->last->prev; ip != NULL; ip = ip->prev) { + if (cmp_cb(ip->this, cap)) { + mip = ip; + continue; + } + newfirst->prev = ip; + newfirst = ip; + } + newfirst->prev = NULL; + fqp->first = newfirst; + fqp->last = newlast; + } + fqp->length -= 1; + pthread_mutex_unlock(&fqp->mtx); + bp = mip->this; + free(mip); + + return bp; +} + +struct mkuz_blk * +mkuz_fqueue_deq(struct mkuz_fifo_queue *fqp) +{ + struct mkuz_bchain_link *ip; + struct mkuz_blk *bp; + + pthread_mutex_lock(&fqp->mtx); + while (fqp->last == NULL) { + pthread_cond_wait(&fqp->cvar, &fqp->mtx); + } +#if defined(MKUZ_DEBUG) + assert(fqp->length > 0); +#endif + ip = fqp->last; + fqp->last = ip->prev; + if (fqp->last == NULL) { +#if defined(MKUZ_DEBUG) + assert(fqp->length == 1); +#endif + fqp->first = NULL; + } + fqp->length -= 1; + pthread_mutex_unlock(&fqp->mtx); + bp = ip->this; + free(ip); + + return bp; +} + +#if defined(NOTYET) +struct mkuz_bchain_link * +mkuz_fqueue_deq_all(struct mkuz_fifo_queue *fqp, int *rclen) +{ + struct mkuz_bchain_link *rchain; + + pthread_mutex_lock(&fqp->mtx); + while (fqp->last == NULL) { + pthread_cond_wait(&fqp->cvar, &fqp->mtx); + } +#if defined(MKUZ_DEBUG) + assert(fqp->length > 0); +#endif + rchain = fqp->last; + fqp->first = fqp->last = NULL; + *rclen = fqp->length; + fqp->length = 0; + pthread_mutex_unlock(&fqp->mtx); + return (rchain); +} +#endif Added: head/usr.bin/mkuzip/mkuz_fqueue.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkuzip/mkuz_fqueue.h Sat Apr 23 07:23:43 2016 (r298504) @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2004-2016 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +struct mkuz_fifo_queue { + pthread_mutex_t mtx; + pthread_cond_t cvar; + struct mkuz_bchain_link *first; + struct mkuz_bchain_link *last; + int length; + int wakeup_len; +}; + +struct mkuz_blk; +struct mkuz_bchain_link; + +DEFINE_RAW_METHOD(cmp_cb, int, const struct mkuz_blk *, void *); + +struct mkuz_fifo_queue *mkuz_fqueue_ctor(int); +void mkuz_fqueue_enq(struct mkuz_fifo_queue *, struct mkuz_blk *); +struct mkuz_blk *mkuz_fqueue_deq(struct mkuz_fifo_queue *); +struct mkuz_blk *mkuz_fqueue_deq_when(struct mkuz_fifo_queue *, cmp_cb_t, void *); +#if defined(NOTYET) +struct mkuz_bchain_link *mkuz_fqueue_deq_all(struct mkuz_fifo_queue *, int *); +int mkuz_fqueue_enq_all(struct mkuz_fifo_queue *, struct mkuz_bchain_link *, + struct mkuz_bchain_link *, int); +#endif Modified: head/usr.bin/mkuzip/mkuz_lzma.c ============================================================================== --- head/usr.bin/mkuzip/mkuz_lzma.c Sat Apr 23 07:09:23 2016 (r298503) +++ head/usr.bin/mkuzip/mkuz_lzma.c Sat Apr 23 07:23:43 2016 (r298504) @@ -23,7 +23,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * */ #include @@ -37,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include "mkuzip.h" #include "mkuz_lzma.h" +#include "mkuz_blk.h" #define USED_BLOCKSIZE DEV_BSIZE @@ -44,15 +44,16 @@ struct mkuz_lzma { lzma_filter filters[2]; lzma_options_lzma opt_lzma; lzma_stream strm; - char *obuf; uint32_t blksz; }; -static struct mkuz_lzma ulzma = {.strm = LZMA_STREAM_INIT}; +static const lzma_stream lzma_stream_init = LZMA_STREAM_INIT; void * mkuz_lzma_init(uint32_t blksz) { + struct mkuz_lzma *ulp; + if (blksz % USED_BLOCKSIZE != 0) { errx(1, "cluster size should be multiple of %d", USED_BLOCKSIZE); @@ -62,27 +63,34 @@ mkuz_lzma_init(uint32_t blksz) errx(1, "cluster size is too large"); /* Not reached */ } - ulzma.obuf = mkuz_safe_malloc(blksz * 2); + ulp = mkuz_safe_zmalloc(sizeof(struct mkuz_lzma)); /* Init lzma encoder */ - if (lzma_lzma_preset(&ulzma.opt_lzma, LZMA_PRESET_DEFAULT)) + ulp->strm = lzma_stream_init; + if (lzma_lzma_preset(&ulp->opt_lzma, LZMA_PRESET_DEFAULT)) errx(1, "Error loading LZMA preset"); - ulzma.filters[0].id = LZMA_FILTER_LZMA2; - ulzma.filters[0].options = &ulzma.opt_lzma; - ulzma.filters[1].id = LZMA_VLI_UNKNOWN; + ulp->filters[0].id = LZMA_FILTER_LZMA2; + ulp->filters[0].options = &ulp->opt_lzma; + ulp->filters[1].id = LZMA_VLI_UNKNOWN; - ulzma.blksz = blksz; + ulp->blksz = blksz; - return (ulzma.obuf); + return (void *)ulp; } -void -mkuz_lzma_compress(const char *ibuf, uint32_t *destlen) +struct mkuz_blk * +mkuz_lzma_compress(void *p, const struct mkuz_blk *iblk) { lzma_ret ret; + struct mkuz_blk *rval; + struct mkuz_lzma *ulp; + + ulp = (struct mkuz_lzma *)p; + + rval = mkuz_blk_ctor(ulp->blksz * 2); - ret = lzma_stream_encoder(&ulzma.strm, ulzma.filters, LZMA_CHECK_CRC32); + ret = lzma_stream_encoder(&ulp->strm, ulp->filters, LZMA_CHECK_CRC32); if (ret != LZMA_OK) { if (ret == LZMA_MEMLIMIT_ERROR) errx(1, "can't compress data: LZMA_MEMLIMIT_ERROR"); @@ -90,21 +98,24 @@ mkuz_lzma_compress(const char *ibuf, uin errx(1, "can't compress data: LZMA compressor ERROR"); } - ulzma.strm.next_in = ibuf; - ulzma.strm.avail_in = ulzma.blksz; - ulzma.strm.next_out = ulzma.obuf; - ulzma.strm.avail_out = ulzma.blksz * 2; + ulp->strm.next_in = iblk->data; + ulp->strm.avail_in = ulp->blksz; + ulp->strm.next_out = rval->data; + ulp->strm.avail_out = rval->alen; - ret = lzma_code(&ulzma.strm, LZMA_FINISH); + ret = lzma_code(&ulp->strm, LZMA_FINISH); if (ret != LZMA_STREAM_END) { /* Error */ errx(1, "lzma_code FINISH failed, code=%d, pos(in=%zd, " - "out=%zd)", ret, (ulzma.blksz - ulzma.strm.avail_in), - (ulzma.blksz * 2 - ulzma.strm.avail_out)); + "out=%zd)", ret, (ulp->blksz - ulp->strm.avail_in), + (ulp->blksz * 2 - ulp->strm.avail_out)); } - lzma_end(&ulzma.strm); +#if 0 + lzma_end(&ulp->strm); +#endif - *destlen = (ulzma.blksz * 2) - ulzma.strm.avail_out; + rval->info.len = rval->alen - ulp->strm.avail_out; + return (rval); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 23 07:28:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E882AB19BF2; Sat, 23 Apr 2016 07:28:33 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA5831FF3; Sat, 23 Apr 2016 07:28:33 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N7SWiJ069225; Sat, 23 Apr 2016 07:28:32 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N7SWre069224; Sat, 23 Apr 2016 07:28:32 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201604230728.u3N7SWre069224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 23 Apr 2016 07:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298505 - head/usr.bin/mkuzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 07:28:34 -0000 Author: sobomax Date: Sat Apr 23 07:28:32 2016 New Revision: 298505 URL: https://svnweb.freebsd.org/changeset/base/298505 Log: GC duplicate define. Modified: head/usr.bin/mkuzip/mkuz_format.h Modified: head/usr.bin/mkuzip/mkuz_format.h ============================================================================== --- head/usr.bin/mkuzip/mkuz_format.h Sat Apr 23 07:23:43 2016 (r298504) +++ head/usr.bin/mkuzip/mkuz_format.h Sat Apr 23 07:28:32 2016 (r298505) @@ -26,8 +26,6 @@ * $FreeBSD$ */ -#define DEFINE_RAW_METHOD(func, rval, args...) typedef rval (*func##_t)(args) - DEFINE_RAW_METHOD(f_init, void *, uint32_t); DEFINE_RAW_METHOD(f_compress, struct mkuz_blk *, void *, const struct mkuz_blk *); From owner-svn-src-all@freebsd.org Sat Apr 23 07:36:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1C2AB19E0D; Sat, 23 Apr 2016 07:36:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C82A13C4; Sat, 23 Apr 2016 07:36:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N7aD4Q072182; Sat, 23 Apr 2016 07:36:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N7aDRf072180; Sat, 23 Apr 2016 07:36:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604230736.u3N7aDRf072180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Apr 2016 07:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298506 - in stable/10/sys/x86: include x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 07:36:14 -0000 Author: kib Date: Sat Apr 23 07:36:13 2016 New Revision: 298506 URL: https://svnweb.freebsd.org/changeset/base/298506 Log: MFC r298101: Add x86 CPU features definitions published in the Intel SDM rev. 58. Modified: stable/10/sys/x86/include/specialreg.h stable/10/sys/x86/x86/identcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/include/specialreg.h ============================================================================== --- stable/10/sys/x86/include/specialreg.h Sat Apr 23 07:28:32 2016 (r298505) +++ stable/10/sys/x86/include/specialreg.h Sat Apr 23 07:36:13 2016 (r298506) @@ -331,6 +331,7 @@ */ #define CPUID_STDEXT_FSGSBASE 0x00000001 #define CPUID_STDEXT_TSC_ADJUST 0x00000002 +#define CPUID_STDEXT_SGX 0x00000004 #define CPUID_STDEXT_BMI1 0x00000008 #define CPUID_STDEXT_HLE 0x00000010 #define CPUID_STDEXT_AVX2 0x00000020 @@ -340,7 +341,10 @@ #define CPUID_STDEXT_ERMS 0x00000200 #define CPUID_STDEXT_INVPCID 0x00000400 #define CPUID_STDEXT_RTM 0x00000800 +#define CPUID_STDEXT_PQM 0x00001000 +#define CPUID_STDEXT_NFPUSG 0x00002000 #define CPUID_STDEXT_MPX 0x00004000 +#define CPUID_STDEXT_PQE 0x00008000 #define CPUID_STDEXT_AVX512F 0x00010000 #define CPUID_STDEXT_RDSEED 0x00040000 #define CPUID_STDEXT_ADX 0x00080000 @@ -353,6 +357,16 @@ #define CPUID_STDEXT_SHA 0x20000000 /* + * CPUID instruction 7 Structured Extended Features, leaf 0 ecx info + */ +#define CPUID_STDEXT2_PREFETCHWT1 0x00000001 +#define CPUID_STDEXT2_UMIP 0x00000004 +#define CPUID_STDEXT2_PKU 0x00000008 +#define CPUID_STDEXT2_OSPKE 0x00000010 +#define CPUID_STDEXT2_RDPID 0x00400000 +#define CPUID_STDEXT2_SGXLC 0x40000000 + +/* * CPUID manufacturers identifiers */ #define AMD_VENDOR_ID "AuthenticAMD" Modified: stable/10/sys/x86/x86/identcpu.c ============================================================================== --- stable/10/sys/x86/x86/identcpu.c Sat Apr 23 07:28:32 2016 (r298505) +++ stable/10/sys/x86/x86/identcpu.c Sat Apr 23 07:36:13 2016 (r298506) @@ -888,6 +888,7 @@ printcpuinfo(void) /* RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE */ "\001FSGSBASE" "\002TSCADJ" + "\003SGX" /* Bit Manipulation Instructions */ "\004BMI1" /* Hardware Lock Elision */ @@ -907,9 +908,9 @@ printcpuinfo(void) "\014RTM" "\015PQM" "\016NFPUSG" - "\020PQE" /* Intel Memory Protection Extensions */ "\017MPX" + "\020PQE" /* AVX512 Foundation */ "\021AVX512F" /* Enhanced NRBG */ @@ -932,8 +933,11 @@ printcpuinfo(void) cpu_stdext_feature2, "\020" "\001PREFETCHWT1" + "\003UMIP" "\004PKU" "\005OSPKE" + "\027RDPID" + "\037SGXLC" ); } @@ -1880,7 +1884,10 @@ print_INTEL_TLB(u_int data) printf("Instruction TLB: 4 KByte pages, fully associative, 48 entries\n"); break; case 0x63: - printf("Data TLB: 1 GByte pages, 4-way set associative, 4 entries\n"); + printf("Data TLB: 2 MByte or 4 MByte pages, 4-way set associative, 32 entries and a separate array with 1 GByte pages, 4-way set associative, 4 entries\n"); + break; + case 0x64: + printf("Data TLB: 4 KBytes pages, 4-way set associative, 512 entries\n"); break; case 0x66: printf("1st-level data cache: 8 KB, 4-way set associative, sectored cache, 64 byte line size\n"); @@ -1996,6 +2003,9 @@ print_INTEL_TLB(u_int data) case 0xc3: printf("Shared 2nd-Level TLB: 4 KByte /2 MByte pages, 6-way associative, 1536 entries. Also 1GBbyte pages, 4-way, 16 entries\n"); break; + case 0xc4: + printf("DTLB: 2M/4M Byte pages, 4-way associative, 32 entries\n"); + break; case 0xca: printf("Shared 2nd-Level TLB: 4 KByte pages, 4-way associative, 512 entries\n"); break; From owner-svn-src-all@freebsd.org Sat Apr 23 08:10:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8A39B19956; Sat, 23 Apr 2016 08:10:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4E2E1150; Sat, 23 Apr 2016 08:10:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N8A4i7081382; Sat, 23 Apr 2016 08:10:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N8A4YH081381; Sat, 23 Apr 2016 08:10:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604230810.u3N8A4YH081381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 23 Apr 2016 08:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298507 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 08:10:06 -0000 Author: ngie Date: Sat Apr 23 08:10:04 2016 New Revision: 298507 URL: https://svnweb.freebsd.org/changeset/base/298507 Log: Fix looking for "UTC" at start of ptr by using strnmp instead of improperly unrolled equivalent CID: 1347118 MFC after: 1 week Reported by: Coverity Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat Apr 23 07:36:13 2016 (r298506) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat Apr 23 08:10:04 2016 (r298507) @@ -440,8 +440,8 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'UTC' - optional */ ptr = endptr + 1; - if (*ptr == 'U' && *(ptr + 1) == 'T' && *(ptr + 1) == 'C') - ptr += 3; + if (strncmp(ptr, "UTC", strlen("UTC")) == 0) + ptr += strlen("UTC"); /* '+/-' */ if (*ptr == '-' || *ptr == '+') { From owner-svn-src-all@freebsd.org Sat Apr 23 09:15:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E96D6B1ACD2; Sat, 23 Apr 2016 09:15:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC9531D3B; Sat, 23 Apr 2016 09:15:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3N9FwqW002266; Sat, 23 Apr 2016 09:15:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3N9Fw5l002264; Sat, 23 Apr 2016 09:15:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604230915.u3N9Fw5l002264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 23 Apr 2016 09:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298508 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 09:16:00 -0000 Author: tuexen Date: Sat Apr 23 09:15:58 2016 New Revision: 298508 URL: https://svnweb.freebsd.org/changeset/base/298508 Log: Remove a function, which is not used anymore. Modified: head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Apr 23 08:10:04 2016 (r298507) +++ head/sys/netinet/sctputil.c Sat Apr 23 09:15:58 2016 (r298508) @@ -4594,159 +4594,6 @@ sctp_add_to_readq(struct sctp_inpcb *inp } } - -int -sctp_append_to_readq(struct sctp_inpcb *inp, - struct sctp_tcb *stcb, - struct sctp_queued_to_read *control, - struct mbuf *m, - int end, - int ctls_cumack, - struct sockbuf *sb) -{ - /* - * A partial delivery API event is underway. OR we are appending on - * the reassembly queue. - * - * If PDAPI this means we need to add m to the end of the data. - * Increase the length in the control AND increment the sb_cc. - * Otherwise sb is NULL and all we need to do is put it at the end - * of the mbuf chain. - */ - int len = 0; - struct mbuf *mm, *tail = NULL, *prev = NULL; - - if (inp) { - SCTP_INP_READ_LOCK(inp); - } - if (control == NULL) { -get_out: - if (inp) { - SCTP_INP_READ_UNLOCK(inp); - } - return (-1); - } - if (inp && (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ)) { - SCTP_INP_READ_UNLOCK(inp); - return (0); - } - if (control->end_added) { - /* huh this one is complete? */ - goto get_out; - } - mm = m; - if (mm == NULL) { - goto get_out; - } - while (mm) { - if (SCTP_BUF_LEN(mm) == 0) { - /* Skip mbufs with NO lenght */ - if (prev == NULL) { - /* First one */ - m = sctp_m_free(mm); - mm = m; - } else { - SCTP_BUF_NEXT(prev) = sctp_m_free(mm); - mm = SCTP_BUF_NEXT(prev); - } - continue; - } - prev = mm; - len += SCTP_BUF_LEN(mm); - if (sb) { - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { - sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBALLOC, SCTP_BUF_LEN(mm)); - } - sctp_sballoc(stcb, sb, mm); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { - sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0); - } - } - mm = SCTP_BUF_NEXT(mm); - } - if (prev) { - tail = prev; - } else { - /* Really there should always be a prev */ - if (m == NULL) { - /* Huh nothing left? */ -#ifdef INVARIANTS - panic("Nothing left to add?"); -#else - goto get_out; -#endif - } - tail = m; - } - if (control->tail_mbuf) { - /* append */ - SCTP_BUF_NEXT(control->tail_mbuf) = m; - control->tail_mbuf = tail; - } else { - /* nothing there */ -#ifdef INVARIANTS - if (control->data != NULL) { - panic("This should NOT happen"); - } -#endif - control->data = m; - control->tail_mbuf = tail; - } - atomic_add_int(&control->length, len); - if (end) { - /* message is complete */ - if (stcb && (control == stcb->asoc.control_pdapi)) { - stcb->asoc.control_pdapi = NULL; - } - control->held_length = 0; - control->end_added = 1; - } - if (stcb == NULL) { - control->do_not_ref_stcb = 1; - } - /* - * When we are appending in partial delivery, the cum-ack is used - * for the actual pd-api highest tsn on this mbuf. The true cum-ack - * is populated in the outbound sinfo structure from the true cumack - * if the association exists... - */ - control->sinfo_tsn = control->sinfo_cumtsn = ctls_cumack; - if (inp) { - SCTP_INP_READ_UNLOCK(inp); - } - if (inp && inp->sctp_socket) { - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { - SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); - } else { -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; - - so = SCTP_INP_SO(inp); - if (stcb) { - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - } - SCTP_SOCKET_LOCK(so, 1); - if (stcb) { - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - } - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - SCTP_SOCKET_UNLOCK(so, 1); - return (0); - } -#endif - sctp_sorwakeup(inp, inp->sctp_socket); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif - } - } - return (0); -} - - - /*************HOLD THIS COMMENT FOR PATCH FILE OF *************ALTERNATE ROUTING CODE */ Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sat Apr 23 08:10:04 2016 (r298507) +++ head/sys/netinet/sctputil.h Sat Apr 23 09:15:58 2016 (r298508) @@ -128,16 +128,6 @@ sctp_add_to_readq(struct sctp_inpcb *inp #endif ); -int -sctp_append_to_readq(struct sctp_inpcb *inp, - struct sctp_tcb *stcb, - struct sctp_queued_to_read *control, - struct mbuf *m, - int end, - int new_cumack, - struct sockbuf *sb); - - void sctp_iterator_worker(void); uint32_t sctp_get_prev_mtu(uint32_t); From owner-svn-src-all@freebsd.org Sat Apr 23 09:23:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32C33B1AEC3; Sat, 23 Apr 2016 09:23:36 +0000 (UTC) (envelope-from luke.tw@gmail.com) Received: from mail-yw0-x22d.google.com (mail-yw0-x22d.google.com [IPv6:2607:f8b0:4002:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2F78113D; Sat, 23 Apr 2016 09:23:35 +0000 (UTC) (envelope-from luke.tw@gmail.com) Received: by mail-yw0-x22d.google.com with SMTP id t10so146009023ywa.0; Sat, 23 Apr 2016 02:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TBuDV+yKHY6ooy+RXAYiAE/SOyE7IBh6lI6L0lqSR10=; b=fVYgQCpNhxM+0/lTnuE0Vlh7GEkM+BT9SdpElUZWNPL1/2VL2jcJy26JOHoc5JofY9 x5CpJARE5w5gWDmc1C+CWnuzzkraXp47KQxKXJPLrDBuuXOO10Q7UmENbxdRRxg8TagW UtJWGQR7wYErTYQ4V85knE14TBu2alVKoSdS9hcQkvZArcqVpoVESrd4oKe4K+SNseCO gtKAgJHlZyUAhBBkY3i2P4LKIUdtxRAqSVvHUFGiSZQOsQLfWzwwQsDzVKqAazD9mEam YJUVnxnNYi/j/Mf0Vy49NBUk4tjnmx/lPT3yLLJqpPgkiADZuz8akyQAHqgLEtcETROR 3VVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TBuDV+yKHY6ooy+RXAYiAE/SOyE7IBh6lI6L0lqSR10=; b=OECGURo7lE8pyc9dbMz+hH44WZytfq3dKqj5pqlvHB6pLRTkX1QfnuWXs9MyDF27rd CgfB6CXkP5xs2YZhftp+NLHcKri/VWvSYnFFsTrr1kdXL6fsUiSdvY9Ya9XSLo/Iipiy xiytykuzyZQUPXGzbubDdAGAZMdQkcDLowl2Xr3aolYZ9Q2X/a9hJisEZ7HejryrA68T cer0vG60kiSXyLY7p4avpvywl6lSRuMYkIsDPpWyal5ox4bevPTfI7taOvmaePc5Ge85 sjibeSlwZEDU6in9+5jUqsZrBRsUVJC+QCBvPyPjNHAtpY9H9788Z85RPhCbBApVD1RR sO8Q== X-Gm-Message-State: AOPr4FVm1fd3dyA1pZqM+EkesI7tXtsOVFTEQ5hqoLKxjwqQhU6yR2c020FfHFUlOOhD2OJbwiuGol/VNeWcug== X-Received: by 10.129.158.87 with SMTP id v84mr16390702ywg.282.1461403414853; Sat, 23 Apr 2016 02:23:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.59.80 with HTTP; Sat, 23 Apr 2016 02:23:05 -0700 (PDT) In-Reply-To: <201604220343.u3M3h69m058753@repo.freebsd.org> References: <201604220343.u3M3h69m058753@repo.freebsd.org> From: luke Date: Sat, 23 Apr 2016 17:23:05 +0800 Message-ID: Subject: Re: svn commit: r298443 - head/usr.bin/stat To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 09:23:36 -0000 On Fri, Apr 22, 2016 at 11:43 AM, Marcelo Araujo wrote: > Author: araujo > Date: Fri Apr 22 03:43:06 2016 > New Revision: 298443 > URL: https://svnweb.freebsd.org/changeset/base/298443 > > Log: > Use macro MAX() from sys/param.h. > > MFC after: 2 weeks. > > Modified: > head/usr.bin/stat/stat.c > > Modified: head/usr.bin/stat/stat.c > > ============================================================================== > --- head/usr.bin/stat/stat.c Fri Apr 22 03:37:27 2016 (r298442) > +++ head/usr.bin/stat/stat.c Fri Apr 22 03:43:06 2016 (r298443) > @@ -1025,7 +1025,7 @@ format1(const struct stat *st, > * > * Nanoseconds: long. > */ > - (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ? 9 : > prec); > + (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec)); > (void)strcat(lfmt, tmp); > > /* > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > Hi, Should this be MIN() ? (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9)); -- Chang-Hsien Tsai From owner-svn-src-all@freebsd.org Sat Apr 23 10:06:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0ED16B190D5; Sat, 23 Apr 2016 10:06:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B616C144F; Sat, 23 Apr 2016 10:06:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NA6vgW017442; Sat, 23 Apr 2016 10:06:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NA6vcu017441; Sat, 23 Apr 2016 10:06:57 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604231006.u3NA6vcu017441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 23 Apr 2016 10:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298509 - stable/10/usr.sbin/inetd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 10:06:59 -0000 Author: bapt Date: Sat Apr 23 10:06:57 2016 New Revision: 298509 URL: https://svnweb.freebsd.org/changeset/base/298509 Log: MFC: r298111 r298114 Directly set the O_CLOEXEC flags via the open(2) attributes Use the SOCK_CLOEXEC flags in the socket(2) 'type' attribute instead of calling fcntl(2) Sponsored by: Essen Hackathon Modified: stable/10/usr.sbin/inetd/inetd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/inetd/inetd.c ============================================================================== --- stable/10/usr.sbin/inetd/inetd.c Sat Apr 23 09:15:58 2016 (r298508) +++ stable/10/usr.sbin/inetd/inetd.c Sat Apr 23 10:06:57 2016 (r298509) @@ -539,15 +539,10 @@ main(int argc, char **argv) (void)setenv("inetd_dummy", dummy, 1); } - if (pipe(signalpipe) != 0) { + if (pipe2(signalpipe, O_CLOEXEC) != 0) { syslog(LOG_ERR, "pipe: %m"); exit(EX_OSERR); } - if (fcntl(signalpipe[0], F_SETFD, FD_CLOEXEC) < 0 || - fcntl(signalpipe[1], F_SETFD, FD_CLOEXEC) < 0) { - syslog(LOG_ERR, "signalpipe: fcntl (F_SETFD, FD_CLOEXEC): %m"); - exit(EX_OSERR); - } FD_SET(signalpipe[0], &allsock); #ifdef SANITY_CHECK nsock++; @@ -1256,7 +1251,9 @@ setup(struct servtab *sep) { int on = 1; - if ((sep->se_fd = socket(sep->se_family, sep->se_socktype, 0)) < 0) { + /* Set all listening sockets to close-on-exec. */ + if ((sep->se_fd = socket(sep->se_family, + sep->se_socktype | SOCK_CLOEXEC, 0)) < 0) { if (debug) warn("socket failed on %s/%s", sep->se_service, sep->se_proto); @@ -1264,13 +1261,6 @@ setup(struct servtab *sep) sep->se_service, sep->se_proto); return; } - /* Set all listening sockets to close-on-exec. */ - if (fcntl(sep->se_fd, F_SETFD, FD_CLOEXEC) < 0) { - syslog(LOG_ERR, "%s/%s: fcntl (F_SETFD, FD_CLOEXEC): %m", - sep->se_service, sep->se_proto); - close(sep->se_fd); - return; - } #define turnon(fd, opt) \ setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (on)) if (strcmp(sep->se_proto, "tcp") == 0 && (options & SO_DEBUG) && From owner-svn-src-all@freebsd.org Sat Apr 23 10:10:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD80B19205; Sat, 23 Apr 2016 10:10:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 219CF170A; Sat, 23 Apr 2016 10:10:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NAATol017616; Sat, 23 Apr 2016 10:10:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NAATcj017615; Sat, 23 Apr 2016 10:10:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604231010.u3NAATcj017615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 23 Apr 2016 10:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298510 - stable/10/usr.bin/script X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 10:10:30 -0000 Author: bapt Date: Sat Apr 23 10:10:29 2016 New Revision: 298510 URL: https://svnweb.freebsd.org/changeset/base/298510 Log: MFC: 298112 Directly set the O_CLOEXEC flags via the open(2) attributes Sponsored by: Essen Hackathon Modified: stable/10/usr.bin/script/script.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/script/script.c ============================================================================== --- stable/10/usr.bin/script/script.c Sat Apr 23 10:06:57 2016 (r298509) +++ stable/10/usr.bin/script/script.c Sat Apr 23 10:10:29 2016 (r298510) @@ -158,17 +158,14 @@ main(int argc, char *argv[]) asprintf(&fmfname, "%s.filemon", fname); if (!fmfname) err(1, "%s.filemon", fname); - if ((fm_fd = open("/dev/filemon", O_RDWR)) == -1) + if ((fm_fd = open("/dev/filemon", O_RDWR | O_CLOEXEC)) == -1) err(1, "open(\"/dev/filemon\", O_RDWR)"); - if ((fm_log = open(fmfname, O_WRONLY | O_CREAT | O_TRUNC, + if ((fm_log = open(fmfname, + O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1) err(1, "open(%s)", fmfname); if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0) err(1, "Cannot set filemon log file descriptor"); - - /* Set up these two fd's to close on exec. */ - (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC); - (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC); } if (pflg) From owner-svn-src-all@freebsd.org Sat Apr 23 11:04:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81BB9B1A42D; Sat, 23 Apr 2016 11:04:46 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36B591FEB; Sat, 23 Apr 2016 11:04:46 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NB4jFK035333; Sat, 23 Apr 2016 11:04:45 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NB4jmP035331; Sat, 23 Apr 2016 11:04:45 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201604231104.u3NB4jmP035331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Sat, 23 Apr 2016 11:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298511 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 11:04:46 -0000 Author: brueffer Date: Sat Apr 23 11:04:45 2016 New Revision: 298511 URL: https://svnweb.freebsd.org/changeset/base/298511 Log: Improve upon r296618 to keep lines < 80 characters. Pointed out by: jhb Sponsored by: Essen Hackathon 2016 Modified: head/share/man/man9/bus_adjust_resource.9 head/share/man/man9/bus_alloc_resource.9 Modified: head/share/man/man9/bus_adjust_resource.9 ============================================================================== --- head/share/man/man9/bus_adjust_resource.9 Sat Apr 23 10:10:29 2016 (r298510) +++ head/share/man/man9/bus_adjust_resource.9 Sat Apr 23 11:04:45 2016 (r298511) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 10, 2016 +.Dd April 23, 2016 .Dt BUS_ADJUST_RESOURCE 9 .Os .Sh NAME @@ -41,7 +41,10 @@ .In sys/rman.h .In machine/resource.h .Ft int -.Fn bus_adjust_resource "device_t dev" "int type" "struct resource *r" "rman_res_t start" "rman_res_t end" +.Fo bus_adjust_resource +.Fa "device_t dev" "int type" "struct resource *r" +.Fa "rman_res_t start" "rman_res_t end" +.Fc .Sh DESCRIPTION This function is used to ask the parent bus to adjust the resource range assigned to an allocated resource. Modified: head/share/man/man9/bus_alloc_resource.9 ============================================================================== --- head/share/man/man9/bus_alloc_resource.9 Sat Apr 23 10:10:29 2016 (r298510) +++ head/share/man/man9/bus_alloc_resource.9 Sat Apr 23 11:04:45 2016 (r298511) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 10, 2016 +.Dd April 23, 2016 .Dt BUS_ALLOC_RESOURCE 9 .Os .Sh NAME @@ -51,7 +51,9 @@ .Ft struct resource * .Fn bus_alloc_resource_any "device_t dev" "int type" "int *rid" "u_int flags" .Ft struct resource * -.Fn bus_alloc_resource_anywhere "device_t dev" "int type" "int *rid" "rman_res_t count" "u_int flags" +.Fo bus_alloc_resource_anywhere +.Fa "device_t dev" "int type" "int *rid" "rman_res_t count" "u_int flags" +.Fc .Sh DESCRIPTION This is an easy interface to the resource-management functions. It hides the indirection through the parent's method table. From owner-svn-src-all@freebsd.org Sat Apr 23 13:24:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ED53B123C4; Sat, 23 Apr 2016 13:24:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F2AA1E96; Sat, 23 Apr 2016 13:24:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NDOjPp078093; Sat, 23 Apr 2016 13:24:45 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NDOjOl078090; Sat, 23 Apr 2016 13:24:45 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604231324.u3NDOjOl078090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 23 Apr 2016 13:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298512 - in head: . etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 13:24:46 -0000 Author: bapt Date: Sat Apr 23 13:24:45 2016 New Revision: 298512 URL: https://svnweb.freebsd.org/changeset/base/298512 Log: Remove mroute6d rc script It is directly available via ports (pim6dd which provides the needed rc script) Reported by: lme Sponsored by: Essen Hackathon 2016 Deleted: head/etc/rc.d/mroute6d Modified: head/ObsoleteFiles.inc head/etc/rc.d/Makefile head/etc/rc.d/NETWORKING Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Apr 23 11:04:45 2016 (r298511) +++ head/ObsoleteFiles.inc Sat Apr 23 13:24:45 2016 (r298512) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160423: remove mroute6d +OLD_FILES+=etc/rc.d/mroute6d # 20160419: rename units.lib -> definitions.units OLD_FILES+=usr/share/misc/units.lib # 20160419: remove Big5HKSCS locales Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Apr 23 11:04:45 2016 (r298511) +++ head/etc/rc.d/Makefile Sat Apr 23 13:24:45 2016 (r298512) @@ -72,7 +72,6 @@ FILES= DAEMON \ mdconfig \ mdconfig2 \ mountd \ - mroute6d \ msgs \ natd \ netif \ Modified: head/etc/rc.d/NETWORKING ============================================================================== --- head/etc/rc.d/NETWORKING Sat Apr 23 11:04:45 2016 (r298511) +++ head/etc/rc.d/NETWORKING Sat Apr 23 13:24:45 2016 (r298512) @@ -5,7 +5,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netwait netoptions routing ppp ipfw stf -# REQUIRE: defaultroute routed route6d mroute6d resolv bridge +# REQUIRE: defaultroute routed route6d resolv bridge # REQUIRE: static_arp static_ndp # This is a dummy dependency, for services which require networking From owner-svn-src-all@freebsd.org Sat Apr 23 13:59:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1D5BB12C9E; Sat, 23 Apr 2016 13:59:19 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8E061FD8; Sat, 23 Apr 2016 13:59:19 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NDxIto087396; Sat, 23 Apr 2016 13:59:18 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NDxIO5087393; Sat, 23 Apr 2016 13:59:18 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201604231359.u3NDxIO5087393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 23 Apr 2016 13:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298513 - in head/sys/arm/allwinner: . a31 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 13:59:20 -0000 Author: jmcneill Date: Sat Apr 23 13:59:18 2016 New Revision: 298513 URL: https://svnweb.freebsd.org/changeset/base/298513 Log: Add support for Allwinner A31/A31S R-GPIO (CPUs-PORT) controller. Submitted by: Emmanuel Vadot Reviewed by: jmcneill Differential Revision: https://reviews.freebsd.org/D5930 Added: head/sys/arm/allwinner/a31/a31_r_padconf.c (contents, props changed) Modified: head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a31/files.a31 Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Sat Apr 23 13:24:45 2016 (r298512) +++ head/sys/arm/allwinner/a10_gpio.c Sat Apr 23 13:59:18 2016 (r298513) @@ -54,49 +54,26 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include "gpio_if.h" -/* - * A10 have 9 banks of gpio. - * 32 pins per bank: - * PA0 - PA17 | PB0 - PB23 | PC0 - PC24 - * PD0 - PD27 | PE0 - PE31 | PF0 - PF5 - * PG0 - PG9 | PH0 - PH27 | PI0 - PI12 - */ - #define A10_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) -#define A10_GPIO_NONE 0 -#define A10_GPIO_PULLUP 1 -#define A10_GPIO_PULLDOWN 2 - -#define A10_GPIO_INPUT 0 -#define A10_GPIO_OUTPUT 1 +#define A10_GPIO_NONE 0 +#define A10_GPIO_PULLUP 1 +#define A10_GPIO_PULLDOWN 2 -#define AW_GPIO_DRV_MASK 0x3 -#define AW_GPIO_PUD_MASK 0x3 +#define A10_GPIO_INPUT 0 +#define A10_GPIO_OUTPUT 1 -static struct ofw_compat_data compat_data[] = { - {"allwinner,sun4i-a10-pinctrl", 1}, - {"allwinner,sun7i-a20-pinctrl", 1}, - {"allwinner,sun6i-a31-pinctrl", 1}, - {"allwinner,sun6i-a31s-pinctrl", 1}, - {NULL, 0} -}; +#define AW_GPIO_DRV_MASK 0x3 +#define AW_GPIO_PUD_MASK 0x3 -struct a10_gpio_softc { - device_t sc_dev; - device_t sc_busdev; - struct mtx sc_mtx; - struct resource * sc_mem_res; - struct resource * sc_irq_res; - bus_space_tag_t sc_bst; - bus_space_handle_t sc_bsh; - void * sc_intrhand; - const struct allwinner_padconf * padconf; -}; +#define AW_PINCTRL 1 +#define AW_R_PINCTRL 2 /* Defined in a10_padconf.c */ #ifdef SOC_ALLWINNER_A10 @@ -118,6 +95,41 @@ extern const struct allwinner_padconf a3 extern const struct allwinner_padconf a31s_padconf; #endif +#if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) +extern const struct allwinner_padconf a31_r_padconf; +#endif + +static struct ofw_compat_data compat_data[] = { +#ifdef SOC_ALLWINNER_A10 + {"allwinner,sun4i-a10-pinctrl", (uintptr_t)&a10_padconf}, +#endif +#ifdef SOC_ALLWINNER_A20 + {"allwinner,sun7i-a20-pinctrl", (uintptr_t)&a20_padconf}, +#endif +#ifdef SOC_ALLWINNER_A31 + {"allwinner,sun6i-a31-pinctrl", (uintptr_t)&a31_padconf}, +#endif +#ifdef SOC_ALLWINNER_A31S + {"allwinner,sun6i-a31s-pinctrl", (uintptr_t)&a31s_padconf}, +#endif +#if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) + {"allwinner,sun6i-a31-r-pinctrl", (uintptr_t)&a31_r_padconf}, +#endif + {NULL, 0} +}; + +struct a10_gpio_softc { + device_t sc_dev; + device_t sc_busdev; + struct mtx sc_mtx; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + void * sc_intrhand; + const struct allwinner_padconf * padconf; +}; + #define A10_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) #define A10_GPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) #define A10_GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) @@ -526,9 +538,11 @@ a10_gpio_probe(device_t dev) static int a10_gpio_attach(device_t dev) { - int rid; + int rid, error; phandle_t gpio; struct a10_gpio_softc *sc; + clk_t clk; + hwreset_t rst; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -561,29 +575,23 @@ a10_gpio_attach(device_t dev) goto fail; /* Use the right pin data for the current SoC */ - switch (allwinner_soc_type()) { -#ifdef SOC_ALLWINNER_A10 - case ALLWINNERSOC_A10: - sc->padconf = &a10_padconf; - break; -#endif -#ifdef SOC_ALLWINNER_A20 - case ALLWINNERSOC_A20: - sc->padconf = &a20_padconf; - break; -#endif -#ifdef SOC_ALLWINNER_A31 - case ALLWINNERSOC_A31: - sc->padconf = &a31_padconf; - break; -#endif -#ifdef SOC_ALLWINNER_A31S - case ALLWINNERSOC_A31S: - sc->padconf = &a31s_padconf; - break; -#endif - default: - return (ENOENT); + sc->padconf = (struct allwinner_padconf *)ofw_bus_search_compatible(dev, + compat_data)->ocd_data; + + if (hwreset_get_by_ofw_idx(dev, 0, &rst) == 0) { + error = hwreset_deassert(rst); + if (error != 0) { + device_printf(dev, "cannot de-assert reset\n"); + return (error); + } + } + + if (clk_get_by_ofw_index(dev, 0, &clk) == 0) { + error = clk_enable(clk); + if (error != 0) { + device_printf(dev, "could not enable clock\n"); + return (error); + } } sc->sc_busdev = gpiobus_attach_bus(dev); Added: head/sys/arm/allwinner/a31/a31_r_padconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a31/a31_r_padconf.c Sat Apr 23 13:59:18 2016 (r298513) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) + +const static struct allwinner_pins a31_r_pins[] = { + {"PL0", 0, 0, {"gpio_in", "gpio_out", "s_twi", "s_p2wi", NULL, NULL, NULL, NULL}}, + {"PL1", 0, 1, {"gpio_in", "gpio_out", "s_twi", "s_p2wi", NULL, NULL, NULL, NULL}}, + {"PL2", 0, 2, {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, NULL, NULL}}, + {"PL3", 0, 3, {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, NULL, NULL}}, + {"PL4", 0, 4, {"gpio_in", "gpio_out", "s_ir", NULL, NULL, NULL, NULL, NULL}}, + {"PL5", 0, 5, {"gpio_in", "gpio_out", "pl_eint0", "s_jtag", NULL, NULL, NULL, NULL}}, + {"PL6", 0, 6, {"gpio_in", "gpio_out", "pl_eint1", "s_jtag", NULL, NULL, NULL, NULL}}, + {"PL7", 0, 7, {"gpio_in", "gpio_out", "pl_eint2", "s_jtag", NULL, NULL, NULL, NULL}}, + {"PL8", 0, 8, {"gpio_in", "gpio_out", "pl_eint3", "s_jtag", NULL, NULL, NULL, NULL}}, + + {"PM0", 1, 0, {"gpio_in", "gpio_out", "pm_eint0", NULL, NULL, NULL, NULL, NULL}}, + {"PM1", 1, 1, {"gpio_in", "gpio_out", "pm_eint1", NULL, NULL, NULL, NULL, NULL}}, + {"PM2", 1, 2, {"gpio_in", "gpio_out", "pm_eint2", "1wire", NULL, NULL, NULL, NULL}}, + {"PM3", 1, 3, {"gpio_in", "gpio_out", "pm_eint3", NULL, NULL, NULL, NULL, NULL}}, + {"PM4", 1, 4, {"gpio_in", "gpio_out", "pm_eint4", NULL, NULL, NULL, NULL, NULL}}, + {"PM5", 1, 5, {"gpio_in", "gpio_out", "pm_eint5", NULL, NULL, NULL, NULL, NULL}}, + {"PM6", 1, 6, {"gpio_in", "gpio_out", "pm_eint6", NULL, NULL, NULL, NULL, NULL}}, + {"PM7", 1, 7, {"gpio_in", "gpio_out", "pm_eint7", "rtc", NULL, NULL, NULL, NULL}}, +}; + +const struct allwinner_padconf a31_r_padconf = { + .npins = nitems(a31_r_pins), + .pins = a31_r_pins, +}; + +#endif Modified: head/sys/arm/allwinner/a31/files.a31 ============================================================================== --- head/sys/arm/allwinner/a31/files.a31 Sat Apr 23 13:24:45 2016 (r298512) +++ head/sys/arm/allwinner/a31/files.a31 Sat Apr 23 13:59:18 2016 (r298513) @@ -1,4 +1,5 @@ # $FreeBSD$ arm/allwinner/a31/a31_padconf.c standard +arm/allwinner/a31/a31_r_padconf.c standard arm/allwinner/a31/a31s_padconf.c standard From owner-svn-src-all@freebsd.org Sat Apr 23 16:11:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 931E1B1A5AC; Sat, 23 Apr 2016 16:11:05 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3216F1289; Sat, 23 Apr 2016 16:11:05 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NGB4Fo027773; Sat, 23 Apr 2016 16:11:04 GMT (envelope-from lme@FreeBSD.org) Received: (from lme@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NGAsKl027648; Sat, 23 Apr 2016 16:10:54 GMT (envelope-from lme@FreeBSD.org) Message-Id: <201604231610.u3NGAsKl027648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lme set sender to lme@FreeBSD.org using -f From: Lars Engels Date: Sat, 23 Apr 2016 16:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298514 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 16:11:05 -0000 Author: lme (ports committer) Date: Sat Apr 23 16:10:54 2016 New Revision: 298514 URL: https://svnweb.freebsd.org/changeset/base/298514 Log: - Add descriptions to most of the rc scripts. Those are mostly taken from their daemon's manpage and probably improved. - Consistently use "filesystem" not "file system". Approved by: bapt, brueffer Differential Revision: D452 Modified: head/etc/rc.d/FILESYSTEMS head/etc/rc.d/abi head/etc/rc.d/amd head/etc/rc.d/apm head/etc/rc.d/apmd head/etc/rc.d/auditd head/etc/rc.d/auditdistd head/etc/rc.d/automountd head/etc/rc.d/autounmountd head/etc/rc.d/bgfsck head/etc/rc.d/bluetooth head/etc/rc.d/bootparams head/etc/rc.d/bridge head/etc/rc.d/bsnmpd head/etc/rc.d/bthidd head/etc/rc.d/ccd head/etc/rc.d/cleanvar head/etc/rc.d/cleartmp head/etc/rc.d/cron head/etc/rc.d/ctld head/etc/rc.d/ddb head/etc/rc.d/defaultroute head/etc/rc.d/devd head/etc/rc.d/devfs head/etc/rc.d/dhclient head/etc/rc.d/dmesg head/etc/rc.d/dumpon head/etc/rc.d/fsck head/etc/rc.d/ftp-proxy head/etc/rc.d/ftpd head/etc/rc.d/gbde head/etc/rc.d/geli head/etc/rc.d/geli2 head/etc/rc.d/growfs head/etc/rc.d/gssd head/etc/rc.d/hastd head/etc/rc.d/hcsecd head/etc/rc.d/hostapd head/etc/rc.d/hostid head/etc/rc.d/hostid_save head/etc/rc.d/hostname head/etc/rc.d/inetd head/etc/rc.d/ip6addrctl head/etc/rc.d/ipfilter head/etc/rc.d/ipfs head/etc/rc.d/ipfw head/etc/rc.d/ipmon head/etc/rc.d/ipnat head/etc/rc.d/ipsec head/etc/rc.d/iscsictl head/etc/rc.d/iscsid head/etc/rc.d/jail head/etc/rc.d/kadmind head/etc/rc.d/kdc head/etc/rc.d/keyserv head/etc/rc.d/kfd head/etc/rc.d/kld head/etc/rc.d/kldxref head/etc/rc.d/kpasswdd head/etc/rc.d/ldconfig head/etc/rc.d/local head/etc/rc.d/local_unbound head/etc/rc.d/localpkg head/etc/rc.d/lockd head/etc/rc.d/lpd head/etc/rc.d/mdconfig head/etc/rc.d/mdconfig2 head/etc/rc.d/mixer head/etc/rc.d/motd head/etc/rc.d/mountcritlocal head/etc/rc.d/mountcritremote head/etc/rc.d/mountd head/etc/rc.d/mountlate head/etc/rc.d/moused head/etc/rc.d/msgs head/etc/rc.d/natd head/etc/rc.d/netif head/etc/rc.d/netoptions head/etc/rc.d/netwait head/etc/rc.d/newsyslog head/etc/rc.d/nfscbd head/etc/rc.d/nfsclient head/etc/rc.d/nfsd head/etc/rc.d/nfsuserd head/etc/rc.d/nisdomain head/etc/rc.d/nscd head/etc/rc.d/nsswitch head/etc/rc.d/ntpd head/etc/rc.d/ntpdate head/etc/rc.d/pf head/etc/rc.d/pflog head/etc/rc.d/pfsync head/etc/rc.d/power_profile head/etc/rc.d/powerd head/etc/rc.d/ppp head/etc/rc.d/pppoed head/etc/rc.d/pwcheck head/etc/rc.d/quota head/etc/rc.d/random head/etc/rc.d/rarpd head/etc/rc.d/rctl head/etc/rc.d/resolv head/etc/rc.d/rfcomm_pppd_server head/etc/rc.d/root head/etc/rc.d/route6d head/etc/rc.d/routed head/etc/rc.d/routing head/etc/rc.d/rpcbind head/etc/rc.d/rtadvd head/etc/rc.d/rtsold head/etc/rc.d/rwho head/etc/rc.d/savecore head/etc/rc.d/sdpd head/etc/rc.d/securelevel head/etc/rc.d/sendmail head/etc/rc.d/sppp head/etc/rc.d/sshd head/etc/rc.d/statd head/etc/rc.d/static_arp head/etc/rc.d/stf head/etc/rc.d/swap head/etc/rc.d/swaplate head/etc/rc.d/syscons head/etc/rc.d/sysctl head/etc/rc.d/syslogd head/etc/rc.d/timed head/etc/rc.d/tmp head/etc/rc.d/ugidfw head/etc/rc.d/utx head/etc/rc.d/var head/etc/rc.d/virecover head/etc/rc.d/watchdogd head/etc/rc.d/wpa_supplicant head/etc/rc.d/ypbind head/etc/rc.d/yppasswdd head/etc/rc.d/ypserv head/etc/rc.d/ypset head/etc/rc.d/ypxfrd head/etc/rc.d/zfs head/etc/rc.d/zvol Modified: head/etc/rc.d/FILESYSTEMS ============================================================================== --- head/etc/rc.d/FILESYSTEMS Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/FILESYSTEMS Sat Apr 23 16:10:54 2016 (r298514) @@ -6,7 +6,7 @@ # PROVIDE: FILESYSTEMS # REQUIRE: root mountcritlocal cleanvar zfs -# This is a dummy dependency, for services which require file systems +# This is a dummy dependency, for services which require filesystems # to be mounted before starting. It also serves as the default early / # late divider; after this point, rc.d directories are rescanned to -# catch scripts from other file systems than /. +# catch scripts from other filesystems than /. Modified: head/etc/rc.d/abi ============================================================================== --- head/etc/rc.d/abi Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/abi Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="abi" +desc="Enable foreign ABIs" start_cmd="${name}_start" stop_cmd=":" Modified: head/etc/rc.d/amd ============================================================================== --- head/etc/rc.d/amd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/amd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="amd" +desc="Automatically mount filesystems" rcvar="amd_enable" command="/usr/sbin/${name}" start_precmd="amd_precmd" Modified: head/etc/rc.d/apm ============================================================================== --- head/etc/rc.d/apm Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/apm Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="apm" +desc="Advanced power management" rcvar="apm_enable" start_precmd="apm_precmd" command="/usr/sbin/${name}" Modified: head/etc/rc.d/apmd ============================================================================== --- head/etc/rc.d/apmd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/apmd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="apmd" +desc="Advanced power management daemon" rcvar="apmd_enable" command="/usr/sbin/${name}" start_precmd="apmd_prestart" Modified: head/etc/rc.d/auditd ============================================================================== --- head/etc/rc.d/auditd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/auditd Sat Apr 23 16:10:54 2016 (r298514) @@ -13,6 +13,7 @@ . /etc/rc.subr name="auditd" +desc="Audit daemon" stop_cmd="auditd_stop" command="/usr/sbin/${name}" rcvar="auditd_enable" Modified: head/etc/rc.d/auditdistd ============================================================================== --- head/etc/rc.d/auditdistd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/auditdistd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="auditdistd" +desc="Audit trail files distribution daemon" rcvar="${name}_enable" pidfile="/var/run/${name}.pid" command="/usr/sbin/${name}" Modified: head/etc/rc.d/automountd ============================================================================== --- head/etc/rc.d/automountd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/automountd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="automountd" +desc="daemon handling autofs mount requests" rcvar="autofs_enable" pidfile="/var/run/${name}.pid" command="/usr/sbin/${name}" Modified: head/etc/rc.d/autounmountd ============================================================================== --- head/etc/rc.d/autounmountd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/autounmountd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="autounmountd" +desc="daemon unmounting automounted filesystems" rcvar="autofs_enable" pidfile="/var/run/${name}.pid" command="/usr/sbin/${name}" Modified: head/etc/rc.d/bgfsck ============================================================================== --- head/etc/rc.d/bgfsck Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/bgfsck Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="background_fsck" +desc="Run fsck in background" rcvar="background_fsck" start_cmd="bgfsck_start" start_precmd="bgfsck_start_precmd" Modified: head/etc/rc.d/bluetooth ============================================================================== --- head/etc/rc.d/bluetooth Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/bluetooth Sat Apr 23 16:10:54 2016 (r298514) @@ -33,6 +33,7 @@ . /etc/rc.subr name="bluetooth" +desc="Bluetooth setup script" rcvar= start_cmd="bluetooth_start" stop_cmd="bluetooth_stop" Modified: head/etc/rc.d/bootparams ============================================================================== --- head/etc/rc.d/bootparams Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/bootparams Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="bootparamd" +desc="Boot parameter daemon" rcvar="bootparamd_enable" required_files="/etc/bootparams" command="/usr/sbin/${name}" Modified: head/etc/rc.d/bridge ============================================================================== --- head/etc/rc.d/bridge Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/bridge Sat Apr 23 16:10:54 2016 (r298514) @@ -33,6 +33,7 @@ . /etc/network.subr name="bridge" +desc="Network bridge setup" start_cmd="bridge_start" stop_cmd="bridge_stop" cmd="" Modified: head/etc/rc.d/bsnmpd ============================================================================== --- head/etc/rc.d/bsnmpd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/bsnmpd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="bsnmpd" +desc="Simple and extensible SNMP daemon" rcvar="bsnmpd_enable" command="/usr/sbin/${name}" Modified: head/etc/rc.d/bthidd ============================================================================== --- head/etc/rc.d/bthidd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/bthidd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="bthidd" +desc="Bluetooth HID daemon" rcvar="bthidd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/ccd ============================================================================== --- head/etc/rc.d/ccd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ccd Sat Apr 23 16:10:54 2016 (r298514) @@ -9,6 +9,7 @@ . /etc/rc.subr name="ccd" +desc"Concatenated disks setup" start_cmd="ccd_start" stop_cmd=":" Modified: head/etc/rc.d/cleanvar ============================================================================== --- head/etc/rc.d/cleanvar Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/cleanvar Sat Apr 23 16:10:54 2016 (r298514) @@ -9,6 +9,7 @@ . /etc/rc.subr name="cleanvar" +desc="Purge /var directory" rcvar="cleanvar_enable" start_precmd="${name}_prestart" Modified: head/etc/rc.d/cleartmp ============================================================================== --- head/etc/rc.d/cleartmp Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/cleartmp Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="cleartmp" +desc="Purge /tmp directory" # Disguise rcvar for the start method to run irrespective of its setting. rcvar1="clear_tmp_enable" start_cmd="${name}_start" Modified: head/etc/rc.d/cron ============================================================================== --- head/etc/rc.d/cron Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/cron Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="cron" +desc="Daemon to execute scheduled commands" rcvar="cron_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/ctld ============================================================================== --- head/etc/rc.d/ctld Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ctld Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="ctld" +desc="CAM Target Layer / iSCSI target daemon" rcvar="ctld_enable" pidfile="/var/run/${name}.pid" command="/usr/sbin/${name}" Modified: head/etc/rc.d/ddb ============================================================================== --- head/etc/rc.d/ddb Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ddb Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="ddb" +desc="DDB kernel debugger" rcvar="ddb_enable" command="/sbin/${name}" start_precmd="ddb_prestart" Modified: head/etc/rc.d/defaultroute ============================================================================== --- head/etc/rc.d/defaultroute Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/defaultroute Sat Apr 23 16:10:54 2016 (r298514) @@ -13,6 +13,7 @@ . /etc/network.subr name="defaultroute" +desc="Setup default router" start_cmd="defaultroute_start" stop_cmd=":" Modified: head/etc/rc.d/devd ============================================================================== --- head/etc/rc.d/devd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/devd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="devd" +desc="Device state change daemon" rcvar="devd_enable" command="/sbin/${name}" Modified: head/etc/rc.d/devfs ============================================================================== --- head/etc/rc.d/devfs Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/devfs Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="devfs" +desc="Device filesystem" start_cmd='devfs_start' stop_cmd=':' Modified: head/etc/rc.d/dhclient ============================================================================== --- head/etc/rc.d/dhclient Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/dhclient Sat Apr 23 16:10:54 2016 (r298514) @@ -12,6 +12,7 @@ ifn="$2" name="dhclient" +desc="Dynamic Host Configuration Protocol (DHCP) client" rcvar= pidfile="/var/run/${name}.${ifn}.pid" start_precmd="dhclient_prestart" Modified: head/etc/rc.d/dmesg ============================================================================== --- head/etc/rc.d/dmesg Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/dmesg Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="dmesg" +desc="Save kernel boot messages to disk" rcvar="dmesg_enable" dmesg_file="/var/run/dmesg.boot" start_cmd="do_dmesg" Modified: head/etc/rc.d/dumpon ============================================================================== --- head/etc/rc.d/dumpon Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/dumpon Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="dumpon" +desc="Dump kernel corefiles from swap to disk" start_cmd="dumpon_start" stop_cmd="dumpon_stop" Modified: head/etc/rc.d/fsck ============================================================================== --- head/etc/rc.d/fsck Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/fsck Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="fsck" +desc="Run file system checks" start_cmd="fsck_start" stop_cmd=":" Modified: head/etc/rc.d/ftp-proxy ============================================================================== --- head/etc/rc.d/ftp-proxy Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ftp-proxy Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="ftpproxy" +desc="Internet File Transfer Protocol proxy daemon" rcvar="ftpproxy_enable" command="/usr/sbin/ftp-proxy" Modified: head/etc/rc.d/ftpd ============================================================================== --- head/etc/rc.d/ftpd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ftpd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="ftpd" +desc="Internet File Transfer Protocol daemon" rcvar="ftpd_enable" command="/usr/libexec/${name}" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/gbde ============================================================================== --- head/etc/rc.d/gbde Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/gbde Sat Apr 23 16:10:54 2016 (r298514) @@ -12,6 +12,7 @@ . /etc/rc.subr name="gbde" +desc="GEOM Based Disk Encryption" start_precmd="find_gbde_devices start" stop_precmd="find_gbde_devices stop" start_cmd="gbde_start" Modified: head/etc/rc.d/geli ============================================================================== --- head/etc/rc.d/geli Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/geli Sat Apr 23 16:10:54 2016 (r298514) @@ -33,6 +33,7 @@ . /etc/rc.subr name="geli" +desc="GELI disk encryption" start_precmd='[ -n "$(geli_make_list)" ]' start_cmd="geli_start" stop_cmd="geli_stop" Modified: head/etc/rc.d/geli2 ============================================================================== --- head/etc/rc.d/geli2 Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/geli2 Sat Apr 23 16:10:54 2016 (r298514) @@ -34,6 +34,7 @@ . /etc/rc.subr name="geli2" +name="GELI disk encryption" start_cmd="geli2_start" stop_cmd=":" Modified: head/etc/rc.d/growfs ============================================================================== --- head/etc/rc.d/growfs Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/growfs Sat Apr 23 16:10:54 2016 (r298514) @@ -41,6 +41,7 @@ . /etc/rc.subr name="growfs" +desc="Grow root partition to fill device" start_cmd="growfs_start" stop_cmd=":" rcvar="growfs_enable" Modified: head/etc/rc.d/gssd ============================================================================== --- head/etc/rc.d/gssd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/gssd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name=gssd +desc="Generic Security Services Daemon" rcvar=gssd_enable load_rc_config $name Modified: head/etc/rc.d/hastd ============================================================================== --- head/etc/rc.d/hastd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/hastd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="hastd" +desc="Highly Available Storage daemon" rcvar="hastd_enable" pidfile="/var/run/${name}.pid" command="/sbin/${name}" Modified: head/etc/rc.d/hcsecd ============================================================================== --- head/etc/rc.d/hcsecd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/hcsecd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="hcsecd" +desc="Control link keys and PIN codes for Bluetooth devices" rcvar="hcsecd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/hostapd ============================================================================== --- head/etc/rc.d/hostapd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/hostapd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="hostapd" +desc="Authenticator for IEEE 802.11 networks" command="/usr/sbin/${name}" ifn="$2" Modified: head/etc/rc.d/hostid ============================================================================== --- head/etc/rc.d/hostid Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/hostid Sat Apr 23 16:10:54 2016 (r298514) @@ -35,6 +35,7 @@ . /etc/rc.subr name="hostid" +desc="Generate a unique host ID" start_cmd="hostid_start" stop_cmd=":" reset_cmd="hostid_reset" Modified: head/etc/rc.d/hostid_save ============================================================================== --- head/etc/rc.d/hostid_save Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/hostid_save Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="hostid_save" +desc="Save unique host ID to disk" start_cmd="hostid_save" stop_cmd=":" rcvar="hostid_enable" Modified: head/etc/rc.d/hostname ============================================================================== --- head/etc/rc.d/hostname Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/hostname Sat Apr 23 16:10:54 2016 (r298514) @@ -34,6 +34,7 @@ . /etc/network.subr name="hostname" +desc="Set the system\'s hostname" start_cmd="hostname_start" stop_cmd=":" Modified: head/etc/rc.d/inetd ============================================================================== --- head/etc/rc.d/inetd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/inetd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="inetd" +desc="Internet \"super-server\"" rcvar="inetd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/ip6addrctl ============================================================================== --- head/etc/rc.d/ip6addrctl Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ip6addrctl Sat Apr 23 16:10:54 2016 (r298514) @@ -12,6 +12,7 @@ . /etc/network.subr name="ip6addrctl" +desc="configure address selection policy for IPv6 and IPv4" rcvar="ip6addrctl_enable" start_cmd="ip6addrctl_start" stop_cmd="ip6addrctl_stop" Modified: head/etc/rc.d/ipfilter ============================================================================== --- head/etc/rc.d/ipfilter Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ipfilter Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="ipfilter" +desc="IP packet filter" rcvar="ipfilter_enable" load_rc_config $name stop_precmd="test -f ${ipfilter_rules} -o -f ${ipv6_ipfilter_rules}" Modified: head/etc/rc.d/ipfs ============================================================================== --- head/etc/rc.d/ipfs Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ipfs Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="ipfs" +desc="Saves and restores information for NAT and state tables" rcvar="ipfs_enable" start_cmd="ipfs_start" stop_cmd="ipfs_stop" Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ipfw Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/network.subr name="ipfw" +desc="Firewall, traffic shaper, packet scheduler, in-kernel NAT" rcvar="firewall_enable" start_cmd="ipfw_start" start_precmd="ipfw_prestart" Modified: head/etc/rc.d/ipmon ============================================================================== --- head/etc/rc.d/ipmon Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ipmon Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="ipmon" +desc="Monitors /dev/ipl for logged packets" rcvar="ipmon_enable" command="/sbin/${name}" start_precmd="ipmon_precmd" Modified: head/etc/rc.d/ipnat ============================================================================== --- head/etc/rc.d/ipnat Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ipnat Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="ipnat" +desc="user interface to the NAT subsystem" rcvar="ipnat_enable" load_rc_config $name start_cmd="ipnat_start" Modified: head/etc/rc.d/ipsec ============================================================================== --- head/etc/rc.d/ipsec Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ipsec Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="ipsec" +desc="Internet Protocol Security protocol" rcvar="ipsec_enable" start_precmd="ipsec_prestart" start_cmd="ipsec_start" Modified: head/etc/rc.d/iscsictl ============================================================================== --- head/etc/rc.d/iscsictl Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/iscsictl Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="iscsictl" +desc="iSCSI initiator management utility" rcvar="iscsictl_enable" command="/usr/bin/${name}" command_args="${iscsictl_flags}" Modified: head/etc/rc.d/iscsid ============================================================================== --- head/etc/rc.d/iscsid Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/iscsid Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="iscsid" +desc="iSCSI initiator daemon" rcvar="iscsid_enable" pidfile="/var/run/${name}.pid" command="/usr/sbin/${name}" Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/jail Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="jail" +desc="Manage system jails" rcvar="jail_enable" start_cmd="jail_start" Modified: head/etc/rc.d/kadmind ============================================================================== --- head/etc/rc.d/kadmind Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/kadmind Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name=kadmind +desc="Server for administrative access to Kerberos database" rcvar=${name}_enable required_vars=kdc_enable start_precmd=${name}_start_precmd Modified: head/etc/rc.d/kdc ============================================================================== --- head/etc/rc.d/kdc Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/kdc Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name=kdc +desc="Kerberos 5 server" rcvar=${name}_enable start_precmd=${name}_start_precmd Modified: head/etc/rc.d/keyserv ============================================================================== --- head/etc/rc.d/keyserv Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/keyserv Sat Apr 23 16:10:54 2016 (r298514) @@ -13,6 +13,7 @@ . /etc/rc.subr name="keyserv" +desc="Server for storing private encryption keys" rcvar="keyserv_enable" command="/usr/sbin/${name}" start_precmd="keyserv_prestart" Modified: head/etc/rc.d/kfd ============================================================================== --- head/etc/rc.d/kfd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/kfd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name=kfd +desc="Receive forwarded tickets" rcvar=${name}_enable start_precmd=${name}_start_precmd Modified: head/etc/rc.d/kld ============================================================================== --- head/etc/rc.d/kld Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/kld Sat Apr 23 16:10:54 2016 (r298514) @@ -33,6 +33,7 @@ . /etc/rc.subr name="kld" +desc="Load kernel modules" start_cmd="${name}_start" stop_cmd=':' Modified: head/etc/rc.d/kldxref ============================================================================== --- head/etc/rc.d/kldxref Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/kldxref Sat Apr 23 16:10:54 2016 (r298514) @@ -12,6 +12,7 @@ rcvar="kldxref_enable" name="kldxref" +desc="Generate hints for the kernel loader" stop_cmd=":" start_cmd="kldxref_start" Modified: head/etc/rc.d/kpasswdd ============================================================================== --- head/etc/rc.d/kpasswdd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/kpasswdd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name=kpasswdd +desc="Kerberos 5 password changing" rcvar=${name}_enable required_vars=kdc_enable start_precmd=${name}_start_precmd Modified: head/etc/rc.d/ldconfig ============================================================================== --- head/etc/rc.d/ldconfig Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ldconfig Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="ldconfig" +desc="Configure the shared library cache" ldconfig_command="/sbin/ldconfig" start_cmd="ldconfig_start" stop_cmd=":" Modified: head/etc/rc.d/local ============================================================================== --- head/etc/rc.d/local Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/local Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="local" +desc="Run /etc/rc.local and /etc/shutdown.local" start_cmd="local_start" stop_cmd="local_stop" Modified: head/etc/rc.d/local_unbound ============================================================================== --- head/etc/rc.d/local_unbound Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/local_unbound Sat Apr 23 16:10:54 2016 (r298514) @@ -11,7 +11,7 @@ . /etc/rc.subr name="local_unbound" -desc="local caching forwarding resolver" +desc="Local caching forwarding resolver" rcvar="local_unbound_enable" command="/usr/sbin/unbound" Modified: head/etc/rc.d/localpkg ============================================================================== --- head/etc/rc.d/localpkg Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/localpkg Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="localpkg" +desc="Run local init scripts" start_cmd="pkg_start" stop_cmd="pkg_stop" Modified: head/etc/rc.d/lockd ============================================================================== --- head/etc/rc.d/lockd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/lockd Sat Apr 23 16:10:54 2016 (r298514) @@ -12,6 +12,7 @@ . /etc/rc.subr name="lockd" +desc="NFS file locking daemon" rcvar=rpc_lockd_enable command="/usr/sbin/rpc.${name}" start_precmd='lockd_precmd' Modified: head/etc/rc.d/lpd ============================================================================== --- head/etc/rc.d/lpd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/lpd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="lpd" +desc="Line printer spooler daemon" rcvar="lpd_enable" command="/usr/sbin/${name}" required_files="/etc/printcap" Modified: head/etc/rc.d/mdconfig ============================================================================== --- head/etc/rc.d/mdconfig Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/mdconfig Sat Apr 23 16:10:54 2016 (r298514) @@ -33,6 +33,7 @@ . /etc/rc.subr name="mdconfig" +desc="Create and control memory disks" stop_cmd="mdconfig_stop" start_cmd="mdconfig_start" start_precmd='[ -n "${_mdconfig_list}" ]' Modified: head/etc/rc.d/mdconfig2 ============================================================================== --- head/etc/rc.d/mdconfig2 Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/mdconfig2 Sat Apr 23 16:10:54 2016 (r298514) @@ -34,6 +34,7 @@ . /etc/rc.subr name="mdconfig2" +desc="Create and control memory disks" stop_cmd="mdconfig2_stop" start_cmd="mdconfig2_start" start_precmd='[ -n "${_mdconfig2_list}" ]' Modified: head/etc/rc.d/mixer ============================================================================== --- head/etc/rc.d/mixer Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/mixer Sat Apr 23 16:10:54 2016 (r298514) @@ -34,6 +34,7 @@ . /etc/rc.subr name="mixer" +desc="Save and restore soundcard mixer values" rcvar="mixer_enable" stop_cmd="mixer_stop" start_cmd="mixer_start" Modified: head/etc/rc.d/motd ============================================================================== --- head/etc/rc.d/motd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/motd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="motd" +desc="Update /etc/motd" rcvar="update_motd" start_cmd="motd_start" stop_cmd=":" Modified: head/etc/rc.d/mountcritlocal ============================================================================== --- head/etc/rc.d/mountcritlocal Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/mountcritlocal Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="mountcritlocal" +desc="Mount critical local filesystems" start_cmd="mountcritlocal_start" stop_cmd=sync @@ -28,7 +29,7 @@ mountcritlocal_start() esac # Mount everything except nfs filesystems. - check_startmsgs && echo -n 'Mounting local file systems:' + check_startmsgs && echo -n 'Mounting local filesystems:' mount_excludes='no' for i in ${netfs_types}; do fstype=${i%:*} Modified: head/etc/rc.d/mountcritremote ============================================================================== --- head/etc/rc.d/mountcritremote Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/mountcritremote Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="mountcritremote" +desc="Mount critical remote filesystems" stop_cmd=":" start_cmd="mountcritremote_start" start_precmd="mountcritremote_precmd" @@ -40,7 +41,7 @@ mountcritremote_start() '') ;; *) - echo -n 'Mounting NFS file systems:' + echo -n 'Mounting NFS filesystems:' mount -a -t nfs echo '.' ;; @@ -63,7 +64,7 @@ mountcritremote_start() case "`mount -d -a -t ${fstype}`" in *mount_${fstype}*) - echo -n "Mounting ${fsdecr} file systems:" + echo -n "Mounting ${fsdecr} filesystems:" mount -a -t ${fstype} echo '.' ;; Modified: head/etc/rc.d/mountd ============================================================================== --- head/etc/rc.d/mountd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/mountd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="mountd" +desc="Service remote NFS mount requests" rcvar="mountd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/mountlate ============================================================================== --- head/etc/rc.d/mountlate Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/mountlate Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="mountlate" +desc="Mount filesystems with \"late\" option from /etc/fstab" start_cmd="mountlate_start" stop_cmd=":" @@ -21,7 +22,7 @@ mountlate_start() # Mount "late" filesystems. # err=0 - echo -n 'Mounting late file systems:' + echo -n 'Mounting late filesystems:' mount -a -L err=$? echo '.' Modified: head/etc/rc.d/moused ============================================================================== --- head/etc/rc.d/moused Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/moused Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="moused" +desc="Mouse daemon" rcvar="moused_enable" command="/usr/sbin/${name}" start_cmd="moused_start" Modified: head/etc/rc.d/msgs ============================================================================== --- head/etc/rc.d/msgs Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/msgs Sat Apr 23 16:10:54 2016 (r298514) @@ -9,6 +9,7 @@ . /etc/rc.subr name="msgs" +desc="Make a bounds file for msgs(1)" start_cmd="msgs_start" stop_cmd=":" Modified: head/etc/rc.d/natd ============================================================================== --- head/etc/rc.d/natd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/natd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/network.subr name="natd" +desc="Network Address Translation daemon" rcvar="natd_enable" command="/sbin/${name}" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/netif Sat Apr 23 16:10:54 2016 (r298514) @@ -34,6 +34,7 @@ . /etc/network.subr name="netif" +desc="Network interface setup" rcvar="${name}_enable" start_cmd="netif_start" stop_cmd="netif_stop" Modified: head/etc/rc.d/netoptions ============================================================================== --- head/etc/rc.d/netoptions Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/netoptions Sat Apr 23 16:10:54 2016 (r298514) @@ -12,6 +12,7 @@ . /etc/network.subr name="netoptions" +desc="Network options setup" start_cmd="netoptions_start" stop_cmd=: Modified: head/etc/rc.d/netwait ============================================================================== --- head/etc/rc.d/netwait Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/netwait Sat Apr 23 16:10:54 2016 (r298514) @@ -21,6 +21,7 @@ . /etc/rc.subr name="netwait" +desc="Wait for network devices or the network being up" rcvar="netwait_enable" start_cmd="${name}_start" Modified: head/etc/rc.d/newsyslog ============================================================================== --- head/etc/rc.d/newsyslog Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/newsyslog Sat Apr 23 16:10:54 2016 (r298514) @@ -9,6 +9,7 @@ . /etc/rc.subr name="newsyslog" +desc="Logfile rotation" rcvar="newsyslog_enable" required_files="/etc/newsyslog.conf" command="/usr/sbin/${name}" Modified: head/etc/rc.d/nfscbd ============================================================================== --- head/etc/rc.d/nfscbd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/nfscbd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="nfscbd" +desc="NFSv4 client side callback daemon" rcvar="nfscbd_enable" command="/usr/sbin/${name}" sig_stop="USR1" Modified: head/etc/rc.d/nfsclient ============================================================================== --- head/etc/rc.d/nfsclient Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/nfsclient Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="nfsclient" +desc="NFS client setup" rcvar="nfs_client_enable" start_cmd="nfsclient_start" stop_cmd="unmount_all" Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/nfsd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="nfsd" +desc="Remote NFS server" rcvar="nfs_server_enable" command="/usr/sbin/${name}" Modified: head/etc/rc.d/nfsuserd ============================================================================== --- head/etc/rc.d/nfsuserd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/nfsuserd Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="nfsuserd" +desc="Load user and group information into the kernel for NFSv4 services and support manage-gids for all NFS versions" rcvar="nfsuserd_enable" command="/usr/sbin/${name}" sig_stop="USR1" Modified: head/etc/rc.d/nisdomain ============================================================================== --- head/etc/rc.d/nisdomain Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/nisdomain Sat Apr 23 16:10:54 2016 (r298514) @@ -33,6 +33,7 @@ . /etc/rc.subr name="nisdomain" +desc="Set NIS domain name" start_cmd="nisdomain_start" stop_cmd=":" Modified: head/etc/rc.d/nscd ============================================================================== --- head/etc/rc.d/nscd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/nscd Sat Apr 23 16:10:54 2016 (r298514) @@ -19,6 +19,7 @@ . /etc/rc.subr name="nscd" +desc="Name-service caching daemon" rcvar="nscd_enable" command=/usr/sbin/nscd Modified: head/etc/rc.d/nsswitch ============================================================================== --- head/etc/rc.d/nsswitch Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/nsswitch Sat Apr 23 16:10:54 2016 (r298514) @@ -33,6 +33,7 @@ . /etc/rc.subr name="nsswitch" +desc="Name-service switch" start_cmd="nsswitch_start" stop_cmd=":" Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ntpd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="ntpd" +desc="Network Time Protocol daemon" rcvar="ntpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/ntpdate ============================================================================== --- head/etc/rc.d/ntpdate Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ntpdate Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="ntpdate" +desc="Set the date and time via NTP" rcvar="ntpdate_enable" stop_cmd=":" start_cmd="ntpdate_start" Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/pf Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="pf" +desc="Packet filter" rcvar="pf_enable" load_rc_config $name start_cmd="pf_start" Modified: head/etc/rc.d/pflog ============================================================================== --- head/etc/rc.d/pflog Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/pflog Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="pflog" +desc="Packet filter logging interface" rcvar="pflog_enable" command="/sbin/pflogd" pidfile="/var/run/pflogd.pid" Modified: head/etc/rc.d/pfsync ============================================================================== --- head/etc/rc.d/pfsync Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/pfsync Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="pfsync" +desc="Packet filter state table sychronisation interface" rcvar="pfsync_enable" start_precmd="pfsync_prestart" start_cmd="pfsync_start" Modified: head/etc/rc.d/power_profile ============================================================================== --- head/etc/rc.d/power_profile Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/power_profile Sat Apr 23 16:10:54 2016 (r298514) @@ -15,6 +15,7 @@ . /etc/rc.subr name="power_profile" +desc="Modify the power profile based on AC line state" stop_cmd=':' LOGGER="logger -t power_profile -p daemon.notice" Modified: head/etc/rc.d/powerd ============================================================================== --- head/etc/rc.d/powerd Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/powerd Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="powerd" +desc="Modify the power profile based on AC line state" rcvar="powerd_enable" command="/usr/sbin/${name}" stop_postcmd=powerd_poststop Modified: head/etc/rc.d/ppp ============================================================================== --- head/etc/rc.d/ppp Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/ppp Sat Apr 23 16:10:54 2016 (r298514) @@ -10,6 +10,7 @@ . /etc/rc.subr name="ppp" +desc="Point to Point Protocol" rcvar="ppp_enable" command="/usr/sbin/${name}" start_cmd="ppp_start" Modified: head/etc/rc.d/pppoed ============================================================================== --- head/etc/rc.d/pppoed Sat Apr 23 13:59:18 2016 (r298513) +++ head/etc/rc.d/pppoed Sat Apr 23 16:10:54 2016 (r298514) @@ -11,6 +11,7 @@ . /etc/rc.subr name="pppoed" +desc="Handle incoming PPP over Ethernet connections" rcvar="pppoed_enable" start_cmd="pppoed_start" # XXX stop_cmd will not be straightforward Modified: head/etc/rc.d/pwcheck ============================================================================== --- head/etc/rc.d/pwcheck Sat Apr 23 13:59:18 2016 (r298513) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 23 16:19:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04ECEB1A6A4; Sat, 23 Apr 2016 16:19:36 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D479D182E; Sat, 23 Apr 2016 16:19:35 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NGJZQH030660; Sat, 23 Apr 2016 16:19:35 GMT (envelope-from lme@FreeBSD.org) Received: (from lme@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NGJYKD030657; Sat, 23 Apr 2016 16:19:34 GMT (envelope-from lme@FreeBSD.org) Message-Id: <201604231619.u3NGJYKD030657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lme set sender to lme@FreeBSD.org using -f From: Lars Engels Date: Sat, 23 Apr 2016 16:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298515 - in head: etc share/examples/csh share/man/man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 16:19:36 -0000 Author: lme (ports committer) Date: Sat Apr 23 16:19:34 2016 New Revision: 298515 URL: https://svnweb.freebsd.org/changeset/base/298515 Log: - Add two new subcommands to rc.subr: "describe" shows an rc script's description "extracommands" shows an rc script's non-standard commands like "reload", "configtest", "keygen", etc - Update the rc(8) manpage and the tcsh(1) completion examples to reflect these changes Approved by: bapt Sponsored by: Essen Linuxhotel Hackathon 2016 Differential Revision: D452 Modified: head/etc/rc.subr head/share/examples/csh/dot.cshrc head/share/man/man8/rc.8 Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Apr 23 16:10:54 2016 (r298514) +++ head/etc/rc.subr Sat Apr 23 16:19:34 2016 (r298515) @@ -844,6 +844,10 @@ check_startmsgs() # # enabled Return true if the service is enabled. # +# describe Show the service's description +# +# extracommands Show the service's extra commands +# # Variables available to methods, and after run_rc_command() has # completed: # @@ -912,7 +916,7 @@ run_rc_command() eval _override_command=\$${name}_program command=${_override_command:-$command} - _keywords="start stop restart rcvar enabled $extra_commands" + _keywords="start stop restart rcvar enabled describe extracommands $extra_commands" rc_pid= _pidcmd= _procname=${procname:-${command}} @@ -962,12 +966,13 @@ run_rc_command() if [ "$_elem" != "$rc_arg" ]; then continue fi - # if ${rcvar} is set, $1 is not "rcvar" + # if ${rcvar} is set, $1 is not "rcvar" and not "describe" # and ${rc_pid} is not set, then run # checkyesno ${rcvar} # and return if that failed # - if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" != "stop" ] || + if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" != "stop" \ + -a "$rc_arg" != "describe" ] || [ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z "${rc_pid}" ]; then if ! checkyesno ${rcvar}; then if [ -n "${rc_quiet}" ]; then @@ -1004,6 +1009,16 @@ run_rc_command() case "$rc_arg" in # default operations... + describe) + if [ -n "$desc" ]; then + echo "$desc" + fi + ;; + + extracommands) + echo "$extra_commands" + ;; + status) _run_rc_precmd || return 1 if [ -n "$rc_pid" ]; then Modified: head/share/examples/csh/dot.cshrc ============================================================================== --- head/share/examples/csh/dot.cshrc Sat Apr 23 16:10:54 2016 (r298514) +++ head/share/examples/csh/dot.cshrc Sat Apr 23 16:19:34 2016 (r298515) @@ -98,7 +98,7 @@ complete rsync "c,*:/,F:/," \ complete scp "c,*:/,F:/," \ "c,*:,F:$HOME," \ 'c/*@/$hosts/:/' -complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/' +complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar describe extracommands onestart onestop oneextracommands)/' complete svn 'C@file:///@`'"${HOME}/etc/tcsh/complete.d/svn"'`@@' \ 'n@ls@(file:/// svn+ssh:// svn://)@@' \ 'n@help@(add blame cat checkout cleanup commit copy delete export help import info list ls lock log merge mkdir move propdel \ Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Sat Apr 23 16:10:54 2016 (r298514) +++ head/share/man/man8/rc.8 Sat Apr 23 16:19:34 2016 (r298515) @@ -323,6 +323,10 @@ If the script starts a process (rather t operation), show the status of the process. Otherwise it is not necessary to support this argument. Defaults to displaying the process ID of the program (if running). +.It Cm describe +Print a short description of what the script does. +.It Cm extracommands +Print the script's non-standard commands. .It Cm poll If the script starts a process (rather than performing a one-off operation), wait for the command to exit. From owner-svn-src-all@freebsd.org Sat Apr 23 16:23:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8675B1A889; Sat, 23 Apr 2016 16:23:02 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7540A1DAA; Sat, 23 Apr 2016 16:23:02 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NGN13W033438; Sat, 23 Apr 2016 16:23:01 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NGN19a033437; Sat, 23 Apr 2016 16:23:01 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604231623.u3NGN19a033437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sat, 23 Apr 2016 16:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298516 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 16:23:02 -0000 Author: jamie Date: Sat Apr 23 16:23:01 2016 New Revision: 298516 URL: https://svnweb.freebsd.org/changeset/base/298516 Log: Don't remove the /var/run/jail_name.id file if a jail fails to start. This messes up ezjail (and possibly others), when attempting to start a jail that already exists. PR: 208806 Reviewed by: tj MFC after: 5 days Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Sat Apr 23 16:19:34 2016 (r298515) +++ head/etc/rc.d/jail Sat Apr 23 16:23:01 2016 (r298516) @@ -489,7 +489,6 @@ jail_start() if _jid=$($jail_jls -j $_j jid); then echo "$_jid" > /var/run/jail_${_j}.id else - rm -f /var/run/jail_${_j}.id echo " cannot start jail " \ "\"${_hostname:-${_j}}\": " fi @@ -513,7 +512,6 @@ jail_start() _jid=$($jail_jls -j $_j jid) echo $_jid > /var/run/jail_${_j}.id else - rm -f /var/run/jail_${_j}.id echo " cannot start jail " \ "\"${_hostname:-${_j}}\": " cat $_tmp From owner-svn-src-all@freebsd.org Sat Apr 23 16:59:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C8B9B1A0BB; Sat, 23 Apr 2016 16:59:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBDE111F5; Sat, 23 Apr 2016 16:59:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id c189so6988994pfb.3; Sat, 23 Apr 2016 09:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6fIQBeNrRijax7X6thS6PseDkmrq+UkMCdrKrbaZ2Vw=; b=HyqP5Yz5LufvsHMGkCdAkaHsyG8Ga48TOW/8BueK1mrNdhT0feb/11U64aBLlSb6w9 pW9cAKTTnjS7NEYoLzToTlqPWAHMuw31IQ3uChMW/cqRYsaKqHUaGNvMIglIVoVFlqVx AmpFTGTn9f4z8jnL3re8nHwv76L+ejHRyWXj+5JNVF9nuT3j4mA64hoiK5k9l8X6qFbd HGTFPZ4bVzGya69h5e5w/aZyLp4FhdWuazjuM8DUVkLgBPwcwQI5DQHRtGQdW79XVIo0 j7QgxnU7xMpijGhrsBY58ekuUBP9Xm8PjxBg/k29HWKKjeLjv+utpVeroKgAPcjeh+40 UVKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6fIQBeNrRijax7X6thS6PseDkmrq+UkMCdrKrbaZ2Vw=; b=CqaG5UN3uERvF6o9ibWf8F8pLv5IfgKEyb6+LoaxjiQMd9PtL0CF972Jr9C1TVbzD5 RUWnJ9GQAMui7yYPsrF8bc/ERLgjSnLV8WLFXBEK0jQ00TP8YrsKd+SjXjaj75CBB84n N4cw+C9yApXKTSSEDPeKOdMWKQvEbjBLT6xpHp0672ESifEaK3us8PdFEK5OkSQWZo0P fstFv7qrPQAoXtXe+/6Y+g4apQPSI4vAHXJrK63gra4F0V9Ab5e59rmKtvLkNv3CJTYw HF6wDvgMTImFKnkAHPEa5eCtIsNQPn4yqVi6sPskrwgOdknZgJ+NPja8w13P8NjI7mmD gV+w== X-Gm-Message-State: AOPr4FVmqWa4roaEzfKijYei2EnvYWrcis4uKrG9n4Oc196HxoSAmzBnak4HYZ6TVTXAjw== X-Received: by 10.98.100.71 with SMTP id y68mr900385pfb.84.1461430771508; Sat, 23 Apr 2016 09:59:31 -0700 (PDT) Received: from [192.168.20.14] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id 187sm16432076pff.66.2016.04.23.09.59.29 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Apr 2016 09:59:29 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r298443 - head/usr.bin/stat From: NGie Cooper X-Mailer: iPhone Mail (13E238) In-Reply-To: Date: Sat, 23 Apr 2016 09:59:28 -0700 Cc: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <175A396C-408E-4505-A878-A7F1B6519A63@gmail.com> References: <201604220343.u3M3h69m058753@repo.freebsd.org> To: luke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 16:59:32 -0000 > On Apr 23, 2016, at 02:23, luke wrote: ... > Hi, > > Should this be MIN() ? > > (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9)); Yes. From owner-svn-src-all@freebsd.org Sat Apr 23 17:04:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D06A2B1A469; Sat, 23 Apr 2016 17:04:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22a.google.com (mail-pf0-x22a.google.com [IPv6:2607:f8b0:400e:c00::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A30711A48; Sat, 23 Apr 2016 17:04:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22a.google.com with SMTP id 206so2721880pfu.0; Sat, 23 Apr 2016 10:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=a1fi440k6nfL4r/eQAlPCW7xqod2lpUT8yBoCxwA6e0=; b=pzz1n4Tx9aSNgjkeZRIOk4VRiGrNbThU2ZbMP7z2Me3RROQ7iLMdtg+iyHHE/CO2H0 +WSEqjdhIo9OW/X7a4k9KpojoLw1xGWxFRnndqxo0BhkZ8TwTo+a1GZuqApeiy8CIiBb aMl54iBSNtpbl3EJA6/q2rs8Txfu3eJK1fsvmisAYbTL0w5FBohDKYxa6I3dTx0JQZni BM6j7VBvy2YH6GTJeJA048OFWpumOQbZQwaBzx7n30Zi9pcab00Cu6Wqo/PcUTEF9KQq /IRVTJrTPvW3n01eLGdFj/mTkYuDHRD9SyHaDevXZGTdj7ihjTsd3zXVJp88R2goDjxk QFvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=a1fi440k6nfL4r/eQAlPCW7xqod2lpUT8yBoCxwA6e0=; b=RaSTWCuxf56UyP8LzmptmEOMHTSidBYBwKYYzMcKWCS22EMuGESkpNHoLpisIY8ys8 jjlGrPPhmeYYpMqgd6X3axUeFhfYTyzndPWehlNOyTSIEYEhsi0dUdpUXxG1ir01bZn8 FqyqiSk1lLUSo5nC4yefeLT7QK1FUmCX3pLCAO+D6kxb6nAc4FeO7bGIRsUhTShJSgOx 2x04JIQSj5fTA/+pWJOsPxhNQSnYdSCJBmLQPb4jJGXl2DGF0d4B7OOQznbtowc710J2 nmKdrKq2hzB8Uw9vr98OPFfsGyoNm9zeqLoQlh8UqMuKir1XN/n1N+9PNGPbPoqwlBCn qzoA== X-Gm-Message-State: AOPr4FXGvXI2JFoEQuKhNVvrxV3TjNg3bw5XKn0TsNjwlq4NxZ5iz8PC6+LJwROErunv7A== X-Received: by 10.98.27.129 with SMTP id b123mr34193218pfb.111.1461431056175; Sat, 23 Apr 2016 10:04:16 -0700 (PDT) Received: from ?IPv6:2601:601:d00:8fa9:f58d:620c:5248:c8de? ([2601:601:d00:8fa9:f58d:620c:5248:c8de]) by smtp.gmail.com with ESMTPSA id d13sm15832530pfd.80.2016.04.23.10.04.14 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Apr 2016 10:04:14 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r298515 - in head: etc share/examples/csh share/man/man8 From: NGie Cooper X-Mailer: iPhone Mail (13E238) In-Reply-To: <201604231619.u3NGJYKD030657@repo.freebsd.org> Date: Sat, 23 Apr 2016 10:04:14 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201604231619.u3NGJYKD030657@repo.freebsd.org> To: Lars Engels X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 17:04:16 -0000 > On Apr 23, 2016, at 09:19, Lars Engels wrote: >=20 > Author: lme (ports committer) > Date: Sat Apr 23 16:19:34 2016 > New Revision: 298515 > URL: https://svnweb.freebsd.org/changeset/base/298515 >=20 > Log: > - Add two new subcommands to rc.subr: > "describe" shows an rc script's description > "extracommands" shows an rc script's non-standard commands like "reload= ", "configtest", "keygen", etc > - Update the rc(8) manpage and the tcsh(1) completion examples to reflect= these changes >=20 > Approved by: bapt > Sponsored by: Essen Linuxhotel Hackathon 2016 > Differential Revision: D452 >=20 > Modified: > head/etc/rc.subr > head/share/examples/csh/dot.cshrc > head/share/man/man8/rc.8 ... > Modified: head/share/man/man8/rc.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/share/man/man8/rc.8 Sat Apr 23 16:10:54 2016 (r298514) > +++ head/share/man/man8/rc.8 Sat Apr 23 16:19:34 2016 (r298515) > @@ -323,6 +323,10 @@ If the script starts a process (rather t > operation), show the status of the process. > Otherwise it is not necessary to support this argument. > Defaults to displaying the process ID of the program (if running). > +.It Cm describe > +Print a short description of what the script does. > +.It Cm extracommands > +Print the script's non-standard commands. > .It Cm poll > If the script starts a process (rather than performing a one-off > operation), wait for the command to exit. Bump .Dd?= From owner-svn-src-all@freebsd.org Sat Apr 23 17:09:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E652DB1A540; Sat, 23 Apr 2016 17:09:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7BB01CB1; Sat, 23 Apr 2016 17:09:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NH9eHI046723; Sat, 23 Apr 2016 17:09:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NH9e6Q046722; Sat, 23 Apr 2016 17:09:40 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604231709.u3NH9e6Q046722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 23 Apr 2016 17:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298517 - head/share/man/man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 17:09:42 -0000 Author: bapt Date: Sat Apr 23 17:09:40 2016 New Revision: 298517 URL: https://svnweb.freebsd.org/changeset/base/298517 Log: Bump the date of the manpage after r298515 Sponsored by: Essen Hackathon 2016 Modified: head/share/man/man8/rc.8 Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Sat Apr 23 16:23:01 2016 (r298516) +++ head/share/man/man8/rc.8 Sat Apr 23 17:09:40 2016 (r298517) @@ -31,7 +31,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 25, 2013 +.Dd April 23, 2016 .Dt RC 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Sat Apr 23 18:29:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0110B1A8C8; Sat, 23 Apr 2016 18:29:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81691178A; Sat, 23 Apr 2016 18:29:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NISxO9071203; Sat, 23 Apr 2016 18:28:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NISxgi071202; Sat, 23 Apr 2016 18:28:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604231828.u3NISxgi071202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 23 Apr 2016 18:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298518 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 18:29:00 -0000 Author: pfg Date: Sat Apr 23 18:28:59 2016 New Revision: 298518 URL: https://svnweb.freebsd.org/changeset/base/298518 Log: ext2_htree_release(): prevent signed integer overflow in a loop. h_levels_num, as most data structs in ext2fs, is unsigned so the index that addresses it has to be unsigned as well. To get to overflow here we would probably be considering a degenerate case though. MFC after: 5 days Modified: head/sys/fs/ext2fs/ext2_htree.c Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Sat Apr 23 17:09:40 2016 (r298517) +++ head/sys/fs/ext2fs/ext2_htree.c Sat Apr 23 18:28:59 2016 (r298518) @@ -191,7 +191,7 @@ ext2_htree_set_limit(struct ext2fs_htree static void ext2_htree_release(struct ext2fs_htree_lookup_info *info) { - int i; + u_int i; for (i = 0; i < info->h_levels_num; i++) { struct buf *bp = info->h_levels[i].h_bp; From owner-svn-src-all@freebsd.org Sat Apr 23 20:29:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03AAFB1A289; Sat, 23 Apr 2016 20:29:57 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF9011D89; Sat, 23 Apr 2016 20:29:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NKTtSo008240; Sat, 23 Apr 2016 20:29:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NKTtei008235; Sat, 23 Apr 2016 20:29:55 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201604232029.u3NKTtei008235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 23 Apr 2016 20:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298519 - in head/sys: compat/svr4 dev/streams modules/streams modules/svr4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 20:29:57 -0000 Author: dchagin Date: Sat Apr 23 20:29:55 2016 New Revision: 298519 URL: https://svnweb.freebsd.org/changeset/base/298519 Log: Fix streams and svr4 module dependency. Both modules are complaining about undefined symbol svr4_delete_socket which was moved from streams to the svr4 module in r160558 that created a two-way dependency between them. PR: 208464 Submitted by: Kristoffer Eriksson Reported by: Kristoffer Eriksson MFC after: 2 week Modified: head/sys/compat/svr4/svr4_socket.c head/sys/compat/svr4/svr4_sysvec.c head/sys/dev/streams/streams.c head/sys/modules/streams/Makefile head/sys/modules/svr4/Makefile Modified: head/sys/compat/svr4/svr4_socket.c ============================================================================== --- head/sys/compat/svr4/svr4_socket.c Sat Apr 23 18:28:59 2016 (r298518) +++ head/sys/compat/svr4/svr4_socket.c Sat Apr 23 20:29:55 2016 (r298519) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct svr4_sockcache_entry { struct proc *p; /* Process for the socket */ @@ -170,6 +171,19 @@ svr4_delete_socket(p, fp) mtx_unlock(&svr4_sockcache_lock); } +struct svr4_strm * +svr4_stream_get(fp) + struct file *fp; +{ + struct socket *so; + + if (fp == NULL || fp->f_type != DTYPE_SOCKET) + return NULL; + + so = fp->f_data; + return so->so_emuldata; +} + void svr4_purge_sockcache(arg, p) void *arg; Modified: head/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- head/sys/compat/svr4/svr4_sysvec.c Sat Apr 23 18:28:59 2016 (r298518) +++ head/sys/compat/svr4/svr4_sysvec.c Sat Apr 23 20:29:55 2016 (r298519) @@ -310,4 +310,4 @@ static moduledata_t svr4_elf_mod = { 0 }; DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_DEPEND(svr4elf, streams, 1, 1, 1); +MODULE_VERSION(svr4elf, 1); Modified: head/sys/dev/streams/streams.c ============================================================================== --- head/sys/dev/streams/streams.c Sat Apr 23 18:28:59 2016 (r298518) +++ head/sys/dev/streams/streams.c Sat Apr 23 20:29:55 2016 (r298519) @@ -169,6 +169,7 @@ static moduledata_t streams_mod = { }; DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); MODULE_VERSION(streams, 1); +MODULE_DEPEND(streams, svr4elf, 1, 1, 1); /* * We only need open() and close() routines. open() calls socreate() @@ -321,19 +322,6 @@ svr4_ptm_alloc(td) } -struct svr4_strm * -svr4_stream_get(fp) - struct file *fp; -{ - struct socket *so; - - if (fp == NULL || fp->f_type != DTYPE_SOCKET) - return NULL; - - so = fp->f_data; - return so->so_emuldata; -} - static int svr4_soo_close(struct file *fp, struct thread *td) { Modified: head/sys/modules/streams/Makefile ============================================================================== --- head/sys/modules/streams/Makefile Sat Apr 23 18:28:59 2016 (r298518) +++ head/sys/modules/streams/Makefile Sat Apr 23 20:29:55 2016 (r298519) @@ -5,10 +5,6 @@ KMOD= streams SRCS= streams.c -EXPORT_SYMS= svr4_str_initialized \ - svr4_stream_get \ - svr4_delete_socket - .if defined(DEBUG) CFLAGS+= -DDEBUG_SVR4 .endif Modified: head/sys/modules/svr4/Makefile ============================================================================== --- head/sys/modules/svr4/Makefile Sat Apr 23 18:28:59 2016 (r298518) +++ head/sys/modules/svr4/Makefile Sat Apr 23 20:29:55 2016 (r298519) @@ -8,6 +8,7 @@ SRCS= svr4_sysent.c svr4_sysvec.c opt_co svr4_termios.c svr4_stream.c svr4_socket.c svr4_sockio.c \ svr4_machdep.c svr4_resource.c svr4_ipc.c OBJS= svr4_locore.o +EXPORT_SYMS= svr4_delete_socket SRCS+= opt_ktrace.h opt_sysvipc.h From owner-svn-src-all@freebsd.org Sat Apr 23 20:31:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7895DB1A434; Sat, 23 Apr 2016 20:31:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E34F11B0; Sat, 23 Apr 2016 20:31:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NKVI7Q008985; Sat, 23 Apr 2016 20:31:18 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NKVIVH008984; Sat, 23 Apr 2016 20:31:18 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201604232031.u3NKVIVH008984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 23 Apr 2016 20:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298520 - head/sys/compat/svr4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 20:31:19 -0000 Author: dchagin Date: Sat Apr 23 20:31:18 2016 New Revision: 298520 URL: https://svnweb.freebsd.org/changeset/base/298520 Log: Allow to build svr4 module with SYSV support separatelly from the kernel build. PR: 208464 Reported by: Kristoffer Eriksson MFC after: 2 week Modified: head/sys/compat/svr4/svr4_ipc.c Modified: head/sys/compat/svr4/svr4_ipc.c ============================================================================== --- head/sys/compat/svr4/svr4_ipc.c Sat Apr 23 20:29:55 2016 (r298519) +++ head/sys/compat/svr4/svr4_ipc.c Sat Apr 23 20:31:18 2016 (r298520) @@ -86,14 +86,10 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(const struct svr4_ipc_perm *, struct ipc_perm *); static void bsd_to_svr4_ipc_perm(const struct ipc_perm *, struct svr4_ipc_perm *); -#endif - -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(const struct semid_ds *, struct svr4_semid_ds *); static void svr4_to_bsd_semid_ds(const struct svr4_semid_ds *, @@ -101,9 +97,6 @@ static void svr4_to_bsd_semid_ds(const s static int svr4_semop(struct thread *, void *); static int svr4_semget(struct thread *, void *); static int svr4_semctl(struct thread *, void *); -#endif - -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(const struct msqid_ds *, struct svr4_msqid_ds *); static void svr4_to_bsd_msqid_ds(const struct svr4_msqid_ds *, @@ -112,9 +105,6 @@ static int svr4_msgsnd(struct thread *, static int svr4_msgrcv(struct thread *, void *); static int svr4_msgget(struct thread *, void *); static int svr4_msgctl(struct thread *, void *); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(const struct shmid_ds *, struct svr4_shmid_ds *); static void svr4_to_bsd_shmid_ds(const struct svr4_shmid_ds *, @@ -123,9 +113,6 @@ static int svr4_shmat(struct thread *, v static int svr4_shmdt(struct thread *, void *); static int svr4_shmget(struct thread *, void *); static int svr4_shmctl(struct thread *, void *); -#endif - -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(spp, bpp) @@ -154,9 +141,7 @@ bsd_to_svr4_ipc_perm(bpp, spp) spp->mode = bpp->mode; spp->seq = bpp->seq; } -#endif -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(bds, sds) const struct semid_ds *bds; @@ -331,10 +316,7 @@ svr4_sys_semsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); -#endif -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(bds, sds) const struct msqid_ds *bds; @@ -421,7 +403,7 @@ svr4_msgrcv(td, v) return sys_msgrcv(td, &ap); } - + struct svr4_sys_msgget_args { int what; svr4_key_t key; @@ -504,10 +486,6 @@ svr4_sys_msgsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(bds, sds) @@ -657,7 +635,7 @@ svr4_shmctl(td, v) default: return (EINVAL); } - + error = kern_shmctl(td, uap->shmid, cmd, &bs, &bufsize); if (error) return (error); @@ -697,4 +675,5 @@ svr4_sys_shmsys(td, uap) } MODULE_DEPEND(svr4elf, sysvshm, 1, 1, 1); -#endif /* SYSVSHM */ +MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); +MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); From owner-svn-src-all@freebsd.org Sat Apr 23 20:45:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E91B9B1A9AF; Sat, 23 Apr 2016 20:45:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B92A11E37; Sat, 23 Apr 2016 20:45:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NKj9Ur014766; Sat, 23 Apr 2016 20:45:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NKj9tC014765; Sat, 23 Apr 2016 20:45:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604232045.u3NKj9tC014765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 23 Apr 2016 20:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298521 - head/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 20:45:11 -0000 Author: pfg Date: Sat Apr 23 20:45:09 2016 New Revision: 298521 URL: https://svnweb.freebsd.org/changeset/base/298521 Log: regex: prevent two improbable signed integer overflows. In matcher() we used an integer to index nsub of type size_t. In print() we used an integer to index nstates of type sopno, typedef'd long. In both cases the indexes never take negative values. Match the types to avoid any error. MFC after: 5 days Modified: head/lib/libc/regex/engine.c Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Sat Apr 23 20:31:18 2016 (r298520) +++ head/lib/libc/regex/engine.c Sat Apr 23 20:45:09 2016 (r298521) @@ -154,7 +154,7 @@ matcher(struct re_guts *g, int eflags) { const char *endp; - int i; + size_t i; struct match mv; struct match *m = &mv; const char *dp = NULL; @@ -1108,7 +1108,7 @@ print(struct match *m, FILE *d) { struct re_guts *g = m->g; - int i; + sopno i; int first = 1; if (!(m->eflags®_TRACE)) From owner-svn-src-all@freebsd.org Sat Apr 23 20:45:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9688CB1AA18; Sat, 23 Apr 2016 20:45:53 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 690BC1FA5; Sat, 23 Apr 2016 20:45:53 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NKjqPg014831; Sat, 23 Apr 2016 20:45:52 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NKjq9j014830; Sat, 23 Apr 2016 20:45:52 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201604232045.u3NKjq9j014830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sat, 23 Apr 2016 20:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298522 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 20:45:53 -0000 Author: bcr (doc committer) Date: Sat Apr 23 20:45:52 2016 New Revision: 298522 URL: https://svnweb.freebsd.org/changeset/base/298522 Log: The default value of MINFREE is defined to be 8% in ufs/ffs/fs.h and not 10%. The newfs(8) and tunefs(8) man pages had this change already, but fs(5) did not. This change makes it consistent again. Bump Dd. PR: 204929 Submitted by: amutu@amutu.com MFC after: 3 days Sponsored by: Essen Linuxhotel Hackathon 2016 Modified: head/share/man/man5/fs.5 Modified: head/share/man/man5/fs.5 ============================================================================== --- head/share/man/man5/fs.5 Sat Apr 23 20:45:09 2016 (r298521) +++ head/share/man/man5/fs.5 Sat Apr 23 20:45:52 2016 (r298522) @@ -28,7 +28,7 @@ .\" @(#)fs.5 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd October 31, 2006 +.Dd April 23, 2016 .Dt FS 5 .Os .Sh NAME @@ -262,7 +262,7 @@ however severe performance degradations file system is run at greater than 90% full; thus the default value of .Fa fs_minfree -is 10%. +is 8%. .Pp Empirically the best trade-off between block fragmentation and overall disk utilization at a loading of 90% comes with a @@ -274,10 +274,10 @@ The element specifies whether the file system should try to minimize the time spent allocating blocks, or if it should attempt to minimize the space fragmentation on the disk. -If the value of fs_minfree (see above) is less than 10%, +If the value of fs_minfree (see above) is less than 8%, then the file system defaults to optimizing for space to avoid running out of full sized blocks. -If the value of minfree is greater than or equal to 10%, +If the value of minfree is greater than or equal to 8%, fragmentation is unlikely to be problematical, and the file system defaults to optimizing for time. .Pp From owner-svn-src-all@freebsd.org Sat Apr 23 20:47:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F792B1AB29; Sat, 23 Apr 2016 20:47:21 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 39FE31224; Sat, 23 Apr 2016 20:47:20 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u3NKlEIW048625 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 23 Apr 2016 20:47:17 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u3NKlDWW003894 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 23 Apr 2016 23:47:13 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.2/Submit) id u3NKlDPC003893; Sat, 23 Apr 2016 23:47:13 +0300 (MSK) (envelope-from dchagin) Date: Sat, 23 Apr 2016 23:47:13 +0300 From: Chagin Dmitry To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298482 - in head/sys: amd64/amd64 amd64/linux amd64/linux32 compat/linux dev/cxgbe/tom i386/linux vm Message-ID: <20160423204713.GA3850@chd.heemeyer.club> References: <201604221657.u3MGvgbV000700@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201604221657.u3MGvgbV000700@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 20:47:21 -0000 On Fri, Apr 22, 2016 at 04:57:42PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Apr 22 16:57:42 2016 > New Revision: 298482 > URL: https://svnweb.freebsd.org/changeset/base/298482 > > Log: > Cleanup redundant parenthesis from existing howmany()/roundup() macro uses. > > Modified: > head/sys/amd64/amd64/pmap.c > head/sys/amd64/linux/linux_sysvec.c > head/sys/amd64/linux32/linux32_sysvec.c > head/sys/compat/linux/linux_file.c > head/sys/dev/cxgbe/tom/t4_tom.c > head/sys/i386/linux/linux_sysvec.c > head/sys/vm/vm_radix.c > MFC? From owner-svn-src-all@freebsd.org Sat Apr 23 20:56:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB22FB1ADD7 for ; Sat, 23 Apr 2016 20:56:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm49.bullet.mail.bf1.yahoo.com (nm49.bullet.mail.bf1.yahoo.com [216.109.114.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6648118CA for ; Sat, 23 Apr 2016 20:56:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461444556; bh=65dHAkj+LlPOTmbSN19bPWLg03MdBKB0SyyWgxnUj2U=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=VElSbxSDrTMO8abjSIJrvYVeBkh5rtV8yi7rK/1kagpBZ896+JbUD9VpVPApTEipIj3CMRNf0kGA3oSLSK8vK2Vd//qNCj/cavoPR0HTnPH6AYTphO2TbbzlmyWFnP0puj+ZXVQ0J4ferywJpOoC4royv2hxIeSY5HM3sREKGnuckIC8AXZ/EZTfWaL+/8xifJv0KXfIEkNu7JyX8VyjRRa6V0DXUSdmh/vSToKzEAYLIe38V1Bdoee7YwKbmgnPQQFYgU13BaVPNeqGSUtEuiSIvoionyrVyvm07KP7NTWcExL1IqK/gG21Vgbc7jlj71yOAb9UAQzRGvS0uoZiCg== Received: from [66.196.81.170] by nm49.bullet.mail.bf1.yahoo.com with NNFMP; 23 Apr 2016 20:49:16 -0000 Received: from [98.139.211.192] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 23 Apr 2016 20:49:16 -0000 Received: from [127.0.0.1] by smtp201.mail.bf1.yahoo.com with NNFMP; 23 Apr 2016 20:49:16 -0000 X-Yahoo-Newman-Id: 659614.57233.bm@smtp201.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: jvoN8IgVM1kQPqXjudUk95LqzZ2FCB.Kn0x9i0NfUoNa5O. 1vJ4odnwWdir0ogWCRettSGY1dLkvtNQ.Btlz5ZrO3PtTvIv3CtzWHF8dkJo MlBx_NSwMNW_kiq_UwDodbxBoe5RtwNxZMKxAQCw2TlKZH.idCGCYgHcTiJI _6oFhg8l_HQYiF0ZzHmWSJDnPHUkJQ_oNh3n0vqlGN_FJyQ8Lo6aznE8aueO jVlFldRaeydBhDFJ_.HPBOxq6Oa7GJUCc8MOTEyop.E4y3cGDH7uptB7meFI LlHdcnAk.5eaGi4HwsVDOEQ7Qw7ETqML4Gj2wj769gi31B2VWba4bmclgdR9 sAl5c39fHOsY3BIfQUAF6yaIEGOLEJPDckxa7VPFlsvds8JUrD6KDon1v6tC _AcBBIqFV0BTL2RPGFXNJl6PBGN4VXAXboAjVGK7dHwxv1xk0nozT5hcwJsa JhVhbfB.ivxtGiEty72fKb46FZb8Pb2IFNhcIWzBoMwYaGnqJG2WtYiNO3KA sg2cTcKQWxeoOg9PYVarwSvE1hR3Lip.F X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298482 - in head/sys: amd64/amd64 amd64/linux amd64/linux32 compat/linux dev/cxgbe/tom i386/linux vm To: Chagin Dmitry References: <201604221657.u3MGvgbV000700@repo.freebsd.org> <20160423204713.GA3850@chd.heemeyer.club> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <2c07066a-5f59-6ae1-7bfe-ec485973770f@FreeBSD.org> Date: Sat, 23 Apr 2016 15:49:26 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160423204713.GA3850@chd.heemeyer.club> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 20:56:40 -0000 On 04/23/16 15:47, Chagin Dmitry wrote: > On Fri, Apr 22, 2016 at 04:57:42PM +0000, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Fri Apr 22 16:57:42 2016 >> New Revision: 298482 >> URL: https://svnweb.freebsd.org/changeset/base/298482 >> >> Log: >> Cleanup redundant parenthesis from existing howmany()/roundup() macro uses. >> >> Modified: >> head/sys/amd64/amd64/pmap.c >> head/sys/amd64/linux/linux_sysvec.c >> head/sys/amd64/linux32/linux32_sysvec.c >> head/sys/compat/linux/linux_file.c >> head/sys/dev/cxgbe/tom/t4_tom.c >> head/sys/i386/linux/linux_sysvec.c >> head/sys/vm/vm_radix.c >> > MFC? > I was not planning to but I understand that can ease maintenance. 5 days. Pedro. From owner-svn-src-all@freebsd.org Sat Apr 23 21:18:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9EBBB1A192; Sat, 23 Apr 2016 21:18:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6F1310C5; Sat, 23 Apr 2016 21:18:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NLIjtI023777; Sat, 23 Apr 2016 21:18:45 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NLIjVc023776; Sat, 23 Apr 2016 21:18:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201604232118.u3NLIjVc023776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 23 Apr 2016 21:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298523 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 21:18:47 -0000 Author: rmacklem Date: Sat Apr 23 21:18:45 2016 New Revision: 298523 URL: https://svnweb.freebsd.org/changeset/base/298523 Log: Allow the NFSv4 server to reply NFSERR_WRONGSEC for the SetClientID operation. It was reported via email that a Linux client couldn't do a Kerberized NFS mount when only "sec=krb5" was specified for the exports. The Linux client attempted a mount via krb5i and the server replied NFSERR_SERVERFAULT. Although NFSERR_WRONGSEC isn't listed as an error for SetClientID, I think it is the correct reply, so this patch enables that. I do not know if this fixes the mount attempt, but adding "krb5i" to the list of allowed security flavours does allow the mount to work. Reported by: joef@spectralogic.com MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdsubs.c Modified: head/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsubs.c Sat Apr 23 20:45:52 2016 (r298522) +++ head/sys/fs/nfsserver/nfs_nfsdsubs.c Sat Apr 23 21:18:45 2016 (r298523) @@ -1144,6 +1144,7 @@ static short nfsv4err_setclientid[] = { NFSERR_INVAL, NFSERR_RESOURCE, NFSERR_SERVERFAULT, + NFSERR_WRONGSEC, 0, }; From owner-svn-src-all@freebsd.org Sat Apr 23 22:32:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C942B1A25D; Sat, 23 Apr 2016 22:32:00 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0D0010A1; Sat, 23 Apr 2016 22:31:59 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NMVxpX047304; Sat, 23 Apr 2016 22:31:59 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NMVxdJ047303; Sat, 23 Apr 2016 22:31:59 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201604232231.u3NMVxdJ047303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sat, 23 Apr 2016 22:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298524 - head/usr.sbin/jexec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 22:32:00 -0000 Author: bcr (doc committer) Date: Sat Apr 23 22:31:58 2016 New Revision: 298524 URL: https://svnweb.freebsd.org/changeset/base/298524 Log: Define which of the username options (-u/-U) to jexec(8) is the default. Bump Dd. PR: 207587 Submitted by: dewayne@heuristicsystems.com.au MFC after: 3 days Sponsored by: Essen Hackathon 2016 Modified: head/usr.sbin/jexec/jexec.8 Modified: head/usr.sbin/jexec/jexec.8 ============================================================================== --- head/usr.sbin/jexec/jexec.8 Sat Apr 23 21:18:45 2016 (r298523) +++ head/usr.sbin/jexec/jexec.8 Sat Apr 23 22:31:58 2016 (r298524) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jul 11, 2015 +.Dd April 24, 2016 .Dt JEXEC 8 .Os .Sh NAME @@ -59,6 +59,7 @@ and anything from the login class capabi The user name from host environment as whom the .Ar command should run. +This is the default. .It Fl U Ar username The user name from jailed environment as whom the .Ar command From owner-svn-src-all@freebsd.org Sat Apr 23 22:57:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22181B1AA0B; Sat, 23 Apr 2016 22:57:56 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7779108A; Sat, 23 Apr 2016 22:57:55 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3NMvtAK054475; Sat, 23 Apr 2016 22:57:55 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3NMvt2w054474; Sat, 23 Apr 2016 22:57:55 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201604232257.u3NMvt2w054474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sat, 23 Apr 2016 22:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298525 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2016 22:57:56 -0000 Author: wblock (doc committer) Date: Sat Apr 23 22:57:54 2016 New Revision: 298525 URL: https://svnweb.freebsd.org/changeset/base/298525 Log: Add a single example of adding a user that roughly corresponds with the adduser example in the Handbook. MFC after: 1 week Modified: head/usr.sbin/pw/pw.8 Modified: head/usr.sbin/pw/pw.8 ============================================================================== --- head/usr.sbin/pw/pw.8 Sat Apr 23 22:31:58 2016 (r298524) +++ head/usr.sbin/pw/pw.8 Sat Apr 23 22:57:54 2016 (r298525) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2016 +.Dd April 23, 2016 .Dt PW 8 .Os .Sh NAME @@ -954,6 +954,18 @@ Pw default options file .It Pa /var/log/userlog User/group modification logfile .El +.Sh EXAMPLES +Add new user Glurmo Smith (gsmith). +A gsmith login group is created if not already present. +The login shell is set to +.Xr csh 1 . +A new home directory at +.Pa /home/gsmith +is created if it does not already exist. +Finally, a random password is generated and displayed: +.Bd -literal -offset indent +pw useradd -n gsmith -c "Glurmo Smith" -s /bin/csh -m -w random +.Ed .Sh EXIT STATUS The .Nm