From owner-svn-src-head@freebsd.org Tue Jun 12 22:17:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2AA41003481; Tue, 12 Jun 2018 22:17:19 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B1AD7C862; Tue, 12 Jun 2018 22:17:19 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-245-183.albq.qwest.net [67.0.245.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 1293C1941DB; Tue, 12 Jun 2018 14:23:12 +0000 (UTC) Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split To: Oliver Pinter , Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805221435.w4MEZXnW041963@repo.freebsd.org> From: Sean Bruno Openpgp: preference=signencrypt Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7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S73MM120mM7ao9AQUeWiSle/H0UCK7xPOzC/aeUC4oygDQKAfkkNbCNTo3+A qDjBRA8qx0e9a/QjDL+RFgD4L5kLT4tToY8T8HaBp8h03LBfk510IaI8oL/Jg7vpM3PDtJMW tUi2H+yNFmL3NfM2oBToWKLFsoP54f/eeeImrNnrlLjLHPzqS+/9apgYqX2Jwiv3tHBc4FTO GuY8VvF7BpixJs8Pc2RUuCfSyodrp1YG1kRGlXAH0cqwwr0Zmk4+7dZvtVQMCl6kS6q1+84q JwtItxS2eXSEA4NO0sQ3BXUywANh Message-ID: Date: Tue, 12 Jun 2018 16:17:14 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sJBJrMrAtpdioyyrg472gI7eVqhCn4n92" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 22:17:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sJBJrMrAtpdioyyrg472gI7eVqhCn4n92 Content-Type: multipart/mixed; boundary="pfgT0y1F5MMDZXd5biKShu31qZap67Jf3"; protected-headers="v1" From: Sean Bruno To: Oliver Pinter , Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split References: <201805221435.w4MEZXnW041963@repo.freebsd.org> In-Reply-To: --pfgT0y1F5MMDZXd5biKShu31qZap67Jf3 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 06/12/18 16:05, Oliver Pinter wrote: > On 5/22/18, Ed Maste wrote: >> Author: emaste >> Date: Tue May 22 14:35:33 2018 >> New Revision: 334046 >> URL: https://svnweb.freebsd.org/changeset/base/334046 >> >> Log: >> intel-ucode-split: add -n flag to skip creating output files >> >> Sponsored by: The FreeBSD Foundation >> >> Modified: >> head/tools/tools/intel-ucode-split/intel-ucode-split.c >=20 > Hi! >=20 > Could you please MFC the intel-ucode-split related commits to 11-STABLE= ? >=20 >=20 > Thanks, > op >=20 Do you need it in base for some reason? This code is already in the devcpu-data port and is used when the port is built. Its not needed for anything AFAIK. sean >> >> Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.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/tools/tools/intel-ucode-split/intel-ucode-split.c Tue May 22 >> 14:26:58 2018 (r334045) >> +++ head/tools/tools/intel-ucode-split/intel-ucode-split.c Tue May 22 >> 14:35:33 2018 (r334046) >> @@ -112,7 +112,7 @@ static void >> usage(void) >> { >> >> - printf("ucode-split [-v] microcode_file\n"); >> + printf("ucode-split [-nv] microcode_file\n"); >> exit(1); >> } >> >> @@ -124,11 +124,14 @@ main(int argc, char *argv[]) >> size_t len, resid; >> ssize_t rv; >> int c, ifd, ofd; >> - bool vflag; >> + bool nflag, vflag; >> >> - vflag =3D false; >> - while ((c =3D getopt(argc, argv, "v")) !=3D -1) { >> + nflag =3D vflag =3D false; >> + while ((c =3D getopt(argc, argv, "nv")) !=3D -1) { >> switch (c) { >> + case 'n': >> + nflag =3D true; >> + break; >> case 'v': >> vflag =3D true; >> break; >> @@ -166,40 +169,48 @@ main(int argc, char *argv[]) >> if (vflag) >> dump_header(&hdr); >> >> - sig_str =3D format_signature(hdr.processor_signature); >> - asprintf(&output_file, "%s.%02x", sig_str, >> - hdr.processor_flags & 0xff); >> - free(sig_str); >> - if (output_file =3D=3D NULL) >> - err(1, "asprintf"); >> - ofd =3D open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600); >> - if (ofd < 0) >> - err(1, "open"); >> - >> - /* Write header. */ >> - rv =3D write(ofd, &hdr, sizeof(hdr)); >> - if (rv < (ssize_t)sizeof(hdr)) >> - err(1, "write"); >> - >> - /* Copy data. */ >> resid =3D (hdr.total_size !=3D 0 ? hdr.total_size : 2048) - >> sizeof(hdr); >> if (resid > 1 << 24) /* Arbitrary chosen maximum size. */ >> errx(1, "header total_size too large"); >> - while (resid > 0) { >> - len =3D resid < bufsize ? resid : bufsize; >> - rv =3D read(ifd, buf, len); >> - if (rv < 0) >> - err(1, "read"); >> - else if (rv < (ssize_t)len) >> - errx(1, "truncated microcode data"); >> - if (write(ofd, buf, len) < (ssize_t)len) >> + >> + if (nflag) { >> + if (lseek(ifd, resid, SEEK_CUR) =3D=3D -1) >> + err(1, "lseek"); >> + printf("\n"); >> + } else { >> + sig_str =3D format_signature(hdr.processor_signature); >> + asprintf(&output_file, "%s.%02x", sig_str, >> + hdr.processor_flags & 0xff); >> + free(sig_str); >> + if (output_file =3D=3D NULL) >> + err(1, "asprintf"); >> + ofd =3D open(output_file, O_WRONLY | O_CREAT | O_TRUNC, >> + 0600); >> + if (ofd < 0) >> + err(1, "open"); >> +=09 >> + /* Write header. */ >> + rv =3D write(ofd, &hdr, sizeof(hdr)); >> + if (rv < (ssize_t)sizeof(hdr)) >> err(1, "write"); >> - resid -=3D len; >> +=09 >> + /* Copy data. */ >> + while (resid > 0) { >> + len =3D resid < bufsize ? resid : bufsize; >> + rv =3D read(ifd, buf, len); >> + if (rv < 0) >> + err(1, "read"); >> + else if (rv < (ssize_t)len) >> + errx(1, "truncated microcode data"); >> + if (write(ofd, buf, len) < (ssize_t)len) >> + err(1, "write"); >> + resid -=3D len; >> + } >> + if (vflag) >> + printf("written to %s\n\n", output_file); >> + close(ofd); >> + free(output_file); >> } >> - if (vflag) >> - printf("written to %s\n\n", output_file); >> - close(ofd); >> - free(output_file); >> } >> } >> _______________________________________________ >> 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= " >> >=20 >=20 --pfgT0y1F5MMDZXd5biKShu31qZap67Jf3-- --sJBJrMrAtpdioyyrg472gI7eVqhCn4n92 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlsgRmpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LanLwgAyfodKf0OCwxfPJooFyED2AhTsPGAaVpjn4pQ477mU4+4jZMOvI8b6XXk zIjahFpP6QLj2e8rne1OpHY7SwbGFZ+xVfPhu5PSOTcwcXxndNVcbYxaG9GpehiY CArkMvyqmg05hawaK/Zz2vJ3o/LNOxhYLP+XBjCLC/zUycdrjFkBo8VPjzFitvvg okxl6r7ERYqKmxXul9UoRC8MZ3xNG7q6i51yM6EXZuE2AGvA69w7pHKh+6MgUmVf o12N0GWWpE/WTUstMXNTL7hZ8e+8d5uwORDBOEmbq3P4vQloUMvfwKXPlb7suKZ2 bRh07eaJQt4LPPkZWjFWv1kZiFJ6YQ== =Ebyp -----END PGP SIGNATURE----- --sJBJrMrAtpdioyyrg472gI7eVqhCn4n92--