Re: svn commit: r368130 - in head: share/man/man4 sys/dev/ftwd sys/modules sys/modules/ftwd

2020-11-29 Thread Poul-Henning Kamp

Rodney W. Grimes writes:

> > Added: head/share/man/man4/ftwd.4
> > ==
> > --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> > +++ head/share/man/man4/ftwd.4  Sat Nov 28 22:34:33 2020
> > (r368130)
> > @@ -0,0 +1,66 @@
> > +.\"
> > +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> > +.\"
> > +.\" Copyright (c) 2012 Bjoern A. Zeeb 
> > +.\" Copyright (c) 2019 Andriy Gapon 
>
> This appears to be a new file, perhaps cloned from some place else?
> And later you assert that you wrote this manual page,
> so shouldn't you also be the copyright holder?

I started out with the itwb.4 page, and replaced a few lines of
text, but all the markup, the order of things etc. etc, is from
itwb.4.

So ftwd.4 is indisputably a "derivative work" and therefore i left
the copyrights from the original in.

My own contribution hardly rises to the level of a protectable work,
"mere recitation of facts" do not rise to the "original work"
threshold, so I did not add myself to the copyright.

> > +This manual page was written by
> > +.An Poul-Henning Kamp Aq Mt p...@freebsd.org .
>
> Here you claim you wrote it...

... so that people reading the manual page know who to bother.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368130 - in head: share/man/man4 sys/dev/ftwd sys/modules sys/modules/ftwd

2020-11-28 Thread Poul-Henning Kamp
Author: phk
Date: Sat Nov 28 22:34:33 2020
New Revision: 368130
URL: https://svnweb.freebsd.org/changeset/base/368130

Log:
  Add watchdog(9) driver for the Fintek F81803 SuperIO chip

Added:
  head/share/man/man4/ftwd.4   (contents, props changed)
  head/sys/dev/ftwd/
  head/sys/dev/ftwd/ftwd.c   (contents, props changed)
  head/sys/modules/ftwd/
  head/sys/modules/ftwd/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileSat Nov 28 18:09:16 2020
(r368129)
+++ head/share/man/man4/MakefileSat Nov 28 22:34:33 2020
(r368130)
@@ -158,6 +158,7 @@ MAN=aac.4 \
ffclock.4 \
filemon.4 \
firewire.4 \
+   ${_ftwd.4} \
full.4 \
fwe.4 \
fwip.4 \
@@ -785,6 +786,7 @@ _chvgpio.4= chvgpio.4
 _coretemp.4=   coretemp.4
 _cpuctl.4= cpuctl.4
 _dpms.4=   dpms.4
+_ftwd.4=   ftwd.4
 _hpt27xx.4=hpt27xx.4
 _hptiop.4= hptiop.4
 _hptmv.4=  hptmv.4

Added: head/share/man/man4/ftwd.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/ftwd.4  Sat Nov 28 22:34:33 2020(r368130)
@@ -0,0 +1,66 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2012 Bjoern A. Zeeb 
+.\" Copyright (c) 2019 Andriy Gapon 
+.\"
+.\" 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$
+.\"
+.Dd November 26, 2020
+.Dt FTWD 4
+.Os
+.Sh NAME
+.Nm ftwd
+.Nd Fintek F81803 watchdog timer
+.Sh SYNOPSIS
+To compile this driver into the kernel, place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device superio"
+.Cd "device ftwd"
+.Ed
+.Pp
+Alternatively, to load the driver as a module at boot time, place the following
+line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+ftwd_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides
+.Xr watchdog 4
+support for the watchdog timer in the Fintek F81803 chip.
+.Sh SEE ALSO
+.Xr superio 4 ,
+.Xr watchdog 4 ,
+.Xr device.hints 5 ,
+.Xr watchdog 8 ,
+.Xr watchdogd 8 ,
+.Xr watchdog 9
+.Sh AUTHORS
+.An -nosplit
+This manual page was written by
+.An Poul-Henning Kamp Aq Mt p...@freebsd.org .

Added: head/sys/dev/ftwd/ftwd.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/ftwd/ftwd.cSat Nov 28 22:34:33 2020(r368130)
@@ -0,0 +1,157 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2020 Poul-Henning Kamp
+ *
+ * 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 

svn commit: r368052 - head/sys/dev/superio

2020-11-25 Thread Poul-Henning Kamp
Author: phk
Date: Thu Nov 26 07:34:20 2020
New Revision: 368052
URL: https://svnweb.freebsd.org/changeset/base/368052

Log:
  Add support for Fintek F81803 SuperIO chip
  
  Reviewed by:  avg

Modified:
  head/sys/dev/superio/superio.c
  head/sys/dev/superio/superio.h

Modified: head/sys/dev/superio/superio.c
==
--- head/sys/dev/superio/superio.c  Thu Nov 26 07:31:30 2020
(r368051)
+++ head/sys/dev/superio/superio.c  Thu Nov 26 07:34:20 2020
(r368052)
@@ -233,9 +233,29 @@ static const struct sio_conf_methods nvt_conf_methods 
.vendor = SUPERIO_VENDOR_NUVOTON
 };
 
+static void
+fintek_conf_enter(struct resource* res, uint16_t port)
+{
+   bus_write_1(res, 0, 0x87);
+   bus_write_1(res, 0, 0x87);
+}
+
+static void
+fintek_conf_exit(struct resource* res, uint16_t port)
+{
+   bus_write_1(res, 0, 0xaa);
+}
+
+static const struct sio_conf_methods fintek_conf_methods = {
+   .enter = fintek_conf_enter,
+   .exit = fintek_conf_exit,
+   .vendor = SUPERIO_VENDOR_FINTEK
+};
+
 static const struct sio_conf_methods * const methods_table[] = {
_conf_methods,
_conf_methods,
+   _conf_methods,
NULL
 };
 
@@ -261,6 +281,11 @@ const struct sio_device nct5104_devices[] = {
{ .type = SUPERIO_DEV_NONE },
 };
 
+const struct sio_device fintek_devices[] = {
+   { .ldn = 7, .type = SUPERIO_DEV_WDT },
+   { .type = SUPERIO_DEV_NONE },
+};
+
 static const struct {
superio_vendor_tvendor;
uint16_tdevid;
@@ -410,6 +435,11 @@ static const struct {
.descr = "Nuvoton NCT6795",
.devices = nvt_devices,
},
+   {
+   .vendor = SUPERIO_VENDOR_FINTEK, .devid = 0x1210, .mask = 0xff,
+   .descr = "Fintek F81803",
+   .devices = fintek_devices,
+   },
{ 0, 0 }
 };
 
@@ -472,6 +502,10 @@ superio_detect(device_t dev, bool claim, struct siosc 
devid = sio_readw(res, 0x20);
revid = sio_read(res, 0x22);
} else if (methods_table[m]->vendor == SUPERIO_VENDOR_NUVOTON) {
+   devid = sio_read(res, 0x20);
+   revid = sio_read(res, 0x21);
+   devid = (devid << 8) | revid;
+   } else if (methods_table[m]->vendor == SUPERIO_VENDOR_FINTEK) {
devid = sio_read(res, 0x20);
revid = sio_read(res, 0x21);
devid = (devid << 8) | revid;

Modified: head/sys/dev/superio/superio.h
==
--- head/sys/dev/superio/superio.h  Thu Nov 26 07:31:30 2020
(r368051)
+++ head/sys/dev/superio/superio.h  Thu Nov 26 07:34:20 2020
(r368052)
@@ -34,6 +34,7 @@ typedef enum superio_vendor {
SUPERIO_VENDOR_NONE,
SUPERIO_VENDOR_ITE,
SUPERIO_VENDOR_NUVOTON,
+   SUPERIO_VENDOR_FINTEK,
SUPERIO_VENDOR_MAX
 } superio_vendor_t;
 
@@ -58,7 +59,7 @@ device_t superio_find_dev(device_t superio, superio_de
 int ldn);
 
 enum superio_ivars {
-   SUPERIO_IVAR_LDN =  10600,
+   SUPERIO_IVAR_LDN =  10600,
SUPERIO_IVAR_TYPE,
SUPERIO_IVAR_IOBASE,
SUPERIO_IVAR_IOBASE2,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r365952 - head/contrib/libexecinfo

2020-09-21 Thread Poul-Henning Kamp
Author: phk
Date: Mon Sep 21 16:43:38 2020
New Revision: 365952
URL: https://svnweb.freebsd.org/changeset/base/365952

Log:
  Pull in fix from upstream NetBSD rev. 1.5:
  
  If Unwind_Backtrace is broken, ctx.n will still contain ~0, and we will
  return that which poor behavior for the user, so return 0 instead.
  We could document ~0 to be an error, but that would deviate from the
  Linux behavior which is not desirable. Noted by Poul-Henning Kamp
  
  PR:   209842

Modified:
  head/contrib/libexecinfo/unwind.c

Modified: head/contrib/libexecinfo/unwind.c
==
--- head/contrib/libexecinfo/unwind.c   Mon Sep 21 15:53:41 2020
(r365951)
+++ head/contrib/libexecinfo/unwind.c   Mon Sep 21 16:43:38 2020
(r365952)
@@ -67,7 +67,9 @@ backtrace(void **arr, size_t len)
ctx.n = (size_t)~0;
 
_Unwind_Backtrace(tracer, );
-   if (ctx.n != (size_t)~0 && ctx.n > 0)
+   if (ctx.n == (size_t)~0)
+   ctx.n = 0;
+   else if (ctx.n > 0)
ctx.arr[--ctx.n] = NULL;/* Skip frame below __start */
 
return ctx.n;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360841 - head/sbin/recoverdisk

2020-05-09 Thread Poul-Henning Kamp
Author: phk
Date: Sat May  9 10:55:34 2020
New Revision: 360841
URL: https://svnweb.freebsd.org/changeset/base/360841

Log:
  Don't send clear screen until we are committed to run.

Modified:
  head/sbin/recoverdisk/recoverdisk.c

Modified: head/sbin/recoverdisk/recoverdisk.c
==
--- head/sbin/recoverdisk/recoverdisk.c Sat May  9 10:30:06 2020
(r360840)
+++ head/sbin/recoverdisk/recoverdisk.c Sat May  9 10:55:34 2020
(r360841)
@@ -153,7 +153,6 @@ set_verbose(void)
 
if (!isatty(STDIN_FILENO) || ioctl(STDIN_FILENO, TIOCGWINSZ, ))
return;
-   printf("\x1b[2J");
verbose = 1;
t0 = time(NULL);
 }
@@ -538,6 +537,8 @@ main(int argc, char * const argv[])
sz = 0;
if (!verbose)
report_header(0);
+   else
+   printf("\x1b[2J");
n = 0;
for (;;) {
lp = TAILQ_FIRST();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359563 - head/sbin/recoverdisk

2020-04-02 Thread Poul-Henning Kamp
Author: phk
Date: Thu Apr  2 15:17:53 2020
New Revision: 359563
URL: https://svnweb.freebsd.org/changeset/base/359563

Log:
  Add two options to recoverdisk(1) inspired by a recent
  data-archæology project:
  
  -u pattern
  
  Fill unread parts of the output with pattern.
  Default pattern is "_UNREAD_", empty pattern disables.
  
  -v
  
  Fancy status reporting using ANSI escapes and UTF-8

Modified:
  head/sbin/recoverdisk/Makefile
  head/sbin/recoverdisk/recoverdisk.1
  head/sbin/recoverdisk/recoverdisk.c

Modified: head/sbin/recoverdisk/Makefile
==
--- head/sbin/recoverdisk/Makefile  Thu Apr  2 13:52:54 2020
(r359562)
+++ head/sbin/recoverdisk/Makefile  Thu Apr  2 15:17:53 2020
(r359563)
@@ -3,6 +3,10 @@
 PACKAGE=runtime
 PROG=  recoverdisk
 
+LDFLAGS += -lm
+
+WARNS?=6
+
 .include 
 
 test:  ${PROG}

Modified: head/sbin/recoverdisk/recoverdisk.1
==
--- head/sbin/recoverdisk/recoverdisk.1 Thu Apr  2 13:52:54 2020
(r359562)
+++ head/sbin/recoverdisk/recoverdisk.1 Thu Apr  2 15:17:53 2020
(r359563)
@@ -35,6 +35,8 @@
 .Op Fl b Ar bigsize
 .Op Fl r Ar readlist
 .Op Fl s Ar interval
+.Op Fl u Ar pattern
+.Op Fl v
 .Op Fl w Ar writelist
 .Ar source
 .Op Ar destination
@@ -68,6 +70,13 @@ Read the list of blocks and block sizes to read from t
 How often we should update the writelist file while things go OK.
 The default is 60 and the unit is "progress messages" so if things
 go well, this is the same as once per minute.
+.It Fl u Ar pattern
+By default blocks which encounter read errors will be filled with
+the pattern "_UNREAD_" in the output file.  This option can be
+used to specify another pattern.  Nothing gets written if the string
+is empty.
+.It Fl v
+Enables nicer status report using ANSI escapes and UTF-8.
 .It Fl w Ar writelist
 Write the list of remaining blocks to read to the specified file if
 .Nm

Modified: head/sbin/recoverdisk/recoverdisk.c
==
--- head/sbin/recoverdisk/recoverdisk.c Thu Apr  2 13:52:54 2020
(r359562)
+++ head/sbin/recoverdisk/recoverdisk.c Thu Apr  2 15:17:53 2020
(r359563)
@@ -15,21 +15,27 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-static volatile sig_atomic_t aborting = 0;
-static size_t bigsize = 1024 * 1024;
-static size_t medsize;
-static size_t minsize = 512;
+/* Safe printf into a fixed-size buffer */
+#define bprintf(buf, fmt, ...)  \
+   do {\
+   int ibprintf;   \
+   ibprintf = snprintf(buf, sizeof buf, fmt, __VA_ARGS__); \
+   assert(ibprintf >= 0 && ibprintf < (int)sizeof buf);\
+   } while (0)
 
 struct lump {
off_t   start;
@@ -38,9 +44,249 @@ struct lump {
TAILQ_ENTRY(lump)   list;
 };
 
+struct period {
+   time_t  t0;
+   time_t  t1;
+   charstr[20];
+   off_t   bytes_read;
+   TAILQ_ENTRY(period) list;
+};
+TAILQ_HEAD(period_head, period);
+
+static volatile sig_atomic_t aborting = 0;
+static int verbose = 0;
+static size_t bigsize = 1024 * 1024;
+static size_t medsize;
+static size_t minsize = 512;
+static off_t tot_size;
+static off_t done_size;
+static char *input;
+static char *wworklist = NULL;
+static char *rworklist = NULL;
+static const char *unreadable_pattern = "_UNREAD_";
+static const int write_errors_are_fatal = 1;
+static int fdr, fdw;
+
 static TAILQ_HEAD(, lump) lumps = TAILQ_HEAD_INITIALIZER(lumps);
+static struct period_head minute = TAILQ_HEAD_INITIALIZER(minute);
+static struct period_head quarter = TAILQ_HEAD_INITIALIZER(quarter);
+static struct period_head hour = TAILQ_HEAD_INITIALIZER(quarter);
+static struct period_head day = TAILQ_HEAD_INITIALIZER(quarter);
 
+/**/
+
 static void
+report_good_read2(time_t now, size_t bytes, struct period_head *ph, time_t dt)
+{
+   struct period *pp;
+   const char *fmt;
+   struct tm tm1;
+
+   pp = TAILQ_FIRST(ph);
+   if (pp == NULL || pp->t1 < now) {
+   pp = calloc(sizeof *pp, 1L);
+   assert(pp != NULL);
+   pp->t0 = (now / dt) * dt;
+   pp->t1 = (now / dt + 1) * dt;
+   assert(localtime_r(>t0, ) != NULL);
+   if (dt < 86400)
+   fmt = "%H:%M";
+   else
+   fmt = "%d%b";
+   assert(strftime(pp->str, sizeof pp->str, fmt, ) != 0);
+ 

svn commit: r357465 - head/usr.bin/ministat

2020-02-03 Thread Poul-Henning Kamp
Author: phk
Date: Mon Feb  3 20:46:31 2020
New Revision: 357465
URL: https://svnweb.freebsd.org/changeset/base/357465

Log:
  Minor cleanups to allow handing vast datasets.
  
  Submitted by: dds

Modified:
  head/usr.bin/ministat/ministat.c

Modified: head/usr.bin/ministat/ministat.c
==
--- head/usr.bin/ministat/ministat.cMon Feb  3 19:36:24 2020
(r357464)
+++ head/usr.bin/ministat/ministat.cMon Feb  3 20:46:31 2020
(r357465)
@@ -142,9 +142,9 @@ static char symbol[MAX_DS] = { ' ', 'x', '+', '*', '%'
 struct dataset {
char *name;
double  *points;
-   unsigned lpoints;
+   size_t lpoints;
double sy, syy;
-   unsigned n;
+   size_t n;
 };
 
 static struct dataset *
@@ -202,7 +202,7 @@ Avg(const struct dataset *ds)
 static double
 Median(const struct dataset *ds)
 {
-   const unsigned m = ds->n / 2;
+   const size_t m = ds->n / 2;
 
if ((ds->n % 2) == 0)
return ((ds->points[m] + (ds->points[m - 1])) / 2);
@@ -212,13 +212,13 @@ Median(const struct dataset *ds)
 static double
 Var(struct dataset *ds)
 {
-   unsigned n;
+   size_t z;
const double a = Avg(ds);
 
if (isnan(ds->syy)) {
ds->syy = 0.0;
-   for (n = 0; n < ds->n; n++)
-   ds->syy += (ds->points[n] - a) * (ds->points[n] - a);
+   for (z = 0; z < ds->n; z++)
+   ds->syy += (ds->points[z] - a) * (ds->points[z] - a);
}
 
return (ds->syy / (ds->n - 1.0));
@@ -242,7 +242,7 @@ static void
 Vitals(struct dataset *ds, int flag)
 {
 
-   printf("%c %3d %13.8g %13.8g %13.8g %13.8g %13.8g", symbol[flag],
+   printf("%c %3zu %13.8g %13.8g %13.8g %13.8g %13.8g", symbol[flag],
ds->n, Min(ds), Max(ds), Median(ds), Avg(ds), Stddev(ds));
printf("\n");
 }
@@ -252,13 +252,13 @@ Relative(struct dataset *ds, struct dataset *rs, int c
 {
double spool, s, d, e, t;
double re;
-   int i;
+   size_t z;
 
-   i = ds->n + rs->n - 2;
-   if (i > NSTUDENT)
+   z = ds->n + rs->n - 2;
+   if (z > NSTUDENT)
t = student[0][confidx];
else
-   t = student[i][confidx];
+   t = student[z][confidx];
spool = (ds->n - 1) * Var(ds) + (rs->n - 1) * Var(rs);
spool /= ds->n + rs->n - 2;
spool = sqrt(spool);
@@ -272,7 +272,6 @@ Relative(struct dataset *ds, struct dataset *rs, int c
re = t * sqrt(re);
 
if (fabs(d) > e) {
-
printf("Difference at %.1f%% confidence\n", 
studentpct[confidx]);
printf("%g +/- %g\n", d, e);
printf("%g%% +/- %g%%\n", d * 100 / Avg(rs), re * 100 / 
Avg(rs));
@@ -290,7 +289,7 @@ struct plot {
int width;
 
double  x0, dx;
-   int height;
+   size_t  height;
char*data;
char**bar;
int separate_bars;
@@ -343,9 +342,11 @@ static void
 PlotSet(struct dataset *ds, int val)
 {
struct plot *pl;
-   int i, j, m, x;
-   unsigned n;
+   int i, x;
+   size_t m, j, z;
+   size_t n;
int bar;
+   double av, sd;
 
pl = 
if (pl->span == 0)
@@ -370,6 +371,7 @@ PlotSet(struct dataset *ds, int val)
m = 1;
i = -1;
j = 0;
+   /* Set m to max(j) + 1, to allocate required memory */
for (n = 0; n < ds->n; n++) {
x = (ds->points[n] - pl->x0) / pl->dx;
if (x == i) {
@@ -400,18 +402,20 @@ PlotSet(struct dataset *ds, int val)
}
pl->data[j * pl->width + x] |= val;
}
-   if (!isnan(Stddev(ds))) {
-   x = ((Avg(ds) - Stddev(ds)) - pl->x0) / pl->dx;
-   m = ((Avg(ds) + Stddev(ds)) - pl->x0) / pl->dx;
+   av = Avg(ds);
+   sd = Stddev(ds);
+   if (!isnan(sd)) {
+   x = ((av - sd) - pl->x0) / pl->dx;
+   m = ((av + sd) - pl->x0) / pl->dx;
pl->bar[bar][m] = '|';
pl->bar[bar][x] = '|';
-   for (i = x + 1; i < m; i++)
-   if (pl->bar[bar][i] == 0)
-   pl->bar[bar][i] = '_';
+   for (z = x + 1; z < m; z++)
+   if (pl->bar[bar][z] == 0)
+   pl->bar[bar][z] = '_';
}
x = (Median(ds) - pl->x0) / pl->dx;
pl->bar[bar][x] = 'M';
-   x = (Avg(ds) - pl->x0) / pl->dx;
+   x = (av - pl->x0) / pl->dx;
pl->bar[bar][x] = 'A';
 }
 
@@ -420,6 +424,7 @@ DumpPlot(void)
 {
struct plot *pl;
int i, j, k;
+   size_t z;
 
pl = 
if (pl->span == 0) {
@@ -432,10 +437,10 @@ DumpPlot(void)
putchar('-');
putchar('+');
putchar('\n');
- 

Re: svn commit: r356185 - in head: lib/geom lib/geom/sched sys/geom sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/sys

2019-12-30 Thread Poul-Henning Kamp

In message 
, Warner 
Losh writes:

>I never enabled it because I never had a good car size as the default. I'm
>guessing  it's somewhere on the order of 2 times the queue size in
>hardware, but with modern drives I think phk might be right and that
>disabling disksort entirely might be optimal, or close to optimal.

I think that is a given for SSDs.

For disks I fear it would be a model-by-model determination.

The situation is quite different for "traditional" and shingled
drives for instance, or if, God forbid, the rumours are true and
we'll see IBM3380-style dual head assemblies in the market again.

I guess the kernel could turn the disksort on/off a few times and
only leave it on if it improves things.

But first, Somebody Should™ benchmark to see if disksort *ever* is an
improvement on contemporary disks.

Poul-Henning

PS: If somebody really want to improve disk- and ssd- performance, the
low-hanging fruit is to write a log-structured storage engine under
UFS, to make life easier for flash-adaptation layers and shingling
drives.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys

2019-12-10 Thread Poul-Henning Kamp

In message , John Baldwin 
writes:
>On 12/10/19 2:09 PM, Hans Petter Selasky wrote:
>> On 2019-12-10 22:58, John Baldwin wrote:
>>>   While here, add  to the manpage.
>> 
>> FYI:
>> 
>> Linux guys eliminated the "void *c_arg" in their timer implementation by 
>> using container_of() to get callback argument. We could possibly do the 
>> same!
>
>You mean passing the pointer to the callout itself and using that to get to the
>relevant pointer?

Before we start using macro-magic of that caliber, we should
consider how/if it will impact the strength of static analysis.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354251 - head/tools/tools/nanobsd

2019-11-02 Thread Poul-Henning Kamp
Author: phk
Date: Sat Nov  2 10:15:34 2019
New Revision: 354251
URL: https://svnweb.freebsd.org/changeset/base/354251

Log:
  If /usr/obj is a symlink, cpio(1) needs persuation to DTRT.

Modified:
  head/tools/tools/nanobsd/defaults.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shSat Nov  2 10:14:15 2019
(r354250)
+++ head/tools/tools/nanobsd/defaults.shSat Nov  2 10:15:34 2019
(r354251)
@@ -193,6 +193,9 @@ NANO_DATADIR=""
 SRCCONF=/dev/null
 SRC_ENV_CONF=/dev/null
 
+# Comment this out if /usr/obj is a symlink
+# CPIO_SYMLINK=--insecure
+
 ###
 #
 # The functions which do the real work.
@@ -523,7 +526,7 @@ setup_nanobsd ( ) (
if [ -d usr/local/etc ] ; then
(
cd usr/local/etc
-   find . -print | cpio -dumpl ../../../etc/local
+   find . -print | cpio ${CPIO_SYMLINK} -dumpl ../../../etc/local
cd ..
rm -xrf etc
)
@@ -542,7 +545,7 @@ setup_nanobsd ( ) (
# we use hard links so we have them both places.
# the files in /$d will be hidden by the mount.
mkdir -p conf/base/$d conf/default/$d
-   find $d -print | cpio -dumpl conf/base/
+   find $d -print | cpio ${CPIO_SYMLINK} -dumpl conf/base/
done
 
echo "$NANO_RAM_ETCSIZE" > conf/base/etc/md_size
@@ -623,7 +626,7 @@ populate_slice ( ) (
if [ -n "${dir}" -a -d "${dir}" ]; then
echo "Populating ${lbl} from ${dir}"
cd "${dir}"
-   find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio 
-dumpv ${mnt}
+   find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio 
${CPIO_SYMLINK} -dumpv ${mnt}
fi
df -i ${mnt}
nano_umount ${mnt}
@@ -731,7 +734,7 @@ cust_allow_ssh_root ( ) (
 
 cust_install_files ( ) (
cd "${NANO_TOOLS}/Files"
-   find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio -Ldumpv 
${NANO_WORLDDIR}
+   find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio 
${CPIO_SYMLINK} -Ldumpv ${NANO_WORLDDIR}
 
if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; 
then
CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354250 - head/tools/tools/gensnmpdef

2019-11-02 Thread Poul-Henning Kamp
Author: phk
Date: Sat Nov  2 10:14:15 2019
New Revision: 354250
URL: https://svnweb.freebsd.org/changeset/base/354250

Log:
  Mention that ports/net-mgmt/libsmi is required

Modified:
  head/tools/tools/gensnmpdef/Makefile

Modified: head/tools/tools/gensnmpdef/Makefile
==
--- head/tools/tools/gensnmpdef/MakefileSat Nov  2 09:50:36 2019
(r354249)
+++ head/tools/tools/gensnmpdef/MakefileSat Nov  2 10:14:15 2019
(r354250)
@@ -1,4 +1,6 @@
 # $FreeBSD$
+#
+# NB: Install ports/net-mgmt/libsmi
 
 .PATH: ${SRCTOP}/contrib/bsnmp/gensnmpdef
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r353718 - head/usr.bin/ministat

2019-10-18 Thread Poul-Henning Kamp
Author: phk
Date: Fri Oct 18 07:55:01 2019
New Revision: 353718
URL: https://svnweb.freebsd.org/changeset/base/353718

Log:
  Improve the way we calculate variance to reduce the rounding errors
  when variance is small relative to data points.
  
  Now [0, 1, 2] shows same standard deviation as [10, ...1, ...2]
  
  Also:  Various nitpickery from my own tree.

Modified:
  head/usr.bin/ministat/ministat.c

Modified: head/usr.bin/ministat/ministat.c
==
--- head/usr.bin/ministat/ministat.cFri Oct 18 03:38:02 2019
(r353717)
+++ head/usr.bin/ministat/ministat.cFri Oct 18 07:55:01 2019
(r353718)
@@ -18,6 +18,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -31,7 +32,7 @@ __FBSDID("$FreeBSD$");
 #define NSTUDENT 100
 #define NCONF 6
 static double const studentpct[] = { 80, 90, 95, 98, 99, 99.5 };
-static double student[NSTUDENT + 1][NCONF] = {
+static double const student[NSTUDENT + 1][NCONF] = {
 /* inf */  {   1.282,  1.645,  1.960,  2.326,  2.576,  3.090  },
 /* 1. */   {   3.078,  6.314,  12.706, 31.821, 63.657, 318.313  },
 /* 2. */   {   1.886,  2.920,  4.303,  6.965,  9.925,  22.327  },
@@ -152,8 +153,11 @@ NewSet(void)
struct dataset *ds;
 
ds = calloc(1, sizeof *ds);
+   assert(ds != NULL);
ds->lpoints = 10;
ds->points = calloc(sizeof *ds->points, ds->lpoints);
+   assert(ds->points != NULL);
+   ds->syy = NAN;
return(ds);
 }
 
@@ -166,55 +170,58 @@ AddPoint(struct dataset *ds, double a)
dp = ds->points;
ds->lpoints *= 4;
ds->points = calloc(sizeof *ds->points, ds->lpoints);
+   assert(ds->points != NULL);
memcpy(ds->points, dp, sizeof *dp * ds->n);
free(dp);
}
ds->points[ds->n++] = a;
ds->sy += a;
-   ds->syy += a * a;
 }
 
 static double
-Min(struct dataset *ds)
+Min(const struct dataset *ds)
 {
 
return (ds->points[0]);
 }
 
 static double
-Max(struct dataset *ds)
+Max(const struct dataset *ds)
 {
 
return (ds->points[ds->n -1]);
 }
 
 static double
-Avg(struct dataset *ds)
+Avg(const struct dataset *ds)
 {
 
return(ds->sy / ds->n);
 }
 
 static double
-Median(struct dataset *ds)
+Median(const struct dataset *ds)
 {
+   const unsigned m = ds->n / 2;
+
if ((ds->n % 2) == 0)
-   return ((ds->points[ds->n / 2] + (ds->points[(ds->n / 2) - 1])) 
/ 2);
-   else
-   return (ds->points[ds->n / 2]);
+   return ((ds->points[m] + (ds->points[m - 1])) / 2);
+   return (ds->points[m]);
 }
 
 static double
 Var(struct dataset *ds)
 {
+   unsigned n;
+   const double a = Avg(ds);
 
-   /*
-* Due to limited precision it is possible that sy^2/n > syy,
-* but variance cannot actually be negative.
-*/
-   if (ds->syy <= ds->sy * ds->sy / ds->n)
-   return (0);
-   return (ds->syy - ds->sy * ds->sy / ds->n) / (ds->n - 1.0);
+   if (isnan(ds->syy)) {
+   ds->syy = 0.0;
+   for (n = 0; n < ds->n; n++)
+   ds->syy += (ds->points[n] - a) * (ds->points[n] - a);
+   }
+
+   return (ds->syy / (ds->n - 1.0));
 }
 
 static double
@@ -265,7 +272,7 @@ Relative(struct dataset *ds, struct dataset *rs, int c
re = t * sqrt(re);
 
if (fabs(d) > e) {
-   
+
printf("Difference at %.1f%% confidence\n", 
studentpct[confidx]);
printf("%g +/- %g\n", d, e);
printf("%g%% +/- %g%%\n", d * 100 / Avg(rs), re * 100 / 
Avg(rs));
@@ -349,13 +356,17 @@ PlotSet(struct dataset *ds, int val)
else
bar = 0;
 
-   if (pl->bar == NULL)
+   if (pl->bar == NULL) {
pl->bar = calloc(sizeof(char *), pl->num_datasets);
+   assert(pl->bar != NULL);
+   }
+
if (pl->bar[bar] == NULL) {
pl->bar[bar] = malloc(pl->width);
+   assert(pl->bar[bar] != NULL);
memset(pl->bar[bar], 0, pl->width);
}
-   
+
m = 1;
i = -1;
j = 0;
@@ -373,6 +384,7 @@ PlotSet(struct dataset *ds, int val)
m += 1;
if (m > pl->height) {
pl->data = realloc(pl->data, pl->width * m);
+   assert(pl->data != NULL);
memset(pl->data + pl->height * pl->width, 0,
(m - pl->height) * pl->width);
}
@@ -477,6 +489,7 @@ ReadSet(FILE *f, const char *n, int column, const char
 
s = NewSet();
s->name = strdup(n);
+   assert(s->name != NULL);
line = 0;
while (fgets(buf, sizeof buf, f) != NULL) {
line++;
@@ -619,7 +632,10 @@ main(int argc, char **argv)
nds = argc;
for (i = 

svn commit: r346369 - head/sbin/md5

2019-09-03 Thread Poul-Henning Kamp
Author: phk
Date: Fri Apr 19 06:49:46 2019
New Revision: 346369
URL: https://svnweb.freebsd.org/changeset/base/346369

Log:
  Close filedescriptors when done with them.

Modified:
  head/sbin/md5/md5.c

Modified: head/sbin/md5/md5.c
==
--- head/sbin/md5/md5.c Fri Apr 19 03:47:59 2019(r346368)
+++ head/sbin/md5/md5.c Fri Apr 19 06:49:46 2019(r346369)
@@ -247,7 +247,9 @@ main(int argc, char *argv[])
err(1, "capsicum");
 #endif
}
-   if ((p = Algorithm[digest].Fd(fd, buf)) == NULL) {
+   p = Algorithm[digest].Fd(fd, buf);
+   (void)close(fd);
+   if (p == NULL) {
warn("%s", *argv);
failed++;
} else {


___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r350550 - head/share/mk

2019-08-06 Thread Poul-Henning Kamp

In message <20190806165614.ga41...@freebsd.org>, Glen Barber writes:

>In my opinion, those that want the non-reproducible metadata included in
>output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their
>src.conf.  Turning off a sane default for the benefit of what I suspect
>is likely a short list of use cases feels like a step in the wrong
>direction.

Seconded.


-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r350436 - in head/sys: amd64/conf arm/arm conf i386/conf kern sys

2019-07-30 Thread Poul-Henning Kamp

In message <201907300513.x6u5dgjs004...@repo.freebsd.org>, Xin LI writes:

>URL: https://svnweb.freebsd.org/changeset/base/350436
>
>Log:
>  Remove gzip'ed a.out support.

Backstory:

http://phk.freebsd.dk/sagas/gzipaout/

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349939 - head/sys/dev/usb/serial

2019-07-12 Thread Poul-Henning Kamp
Author: phk
Date: Fri Jul 12 09:02:12 2019
New Revision: 349939
URL: https://svnweb.freebsd.org/changeset/base/349939

Log:
  Support multiple serial ports per device.
  
  Enable this for the NovAtel OEMv2 GPS receiver.
  
  Not fixed:  The receiver shows up as "" in the device
  tree, because that is literally what the descriptor-string is.
  
  Reviewed by:  hselasky@

Modified:
  head/sys/dev/usb/serial/ugensa.c

Modified: head/sys/dev/usb/serial/ugensa.c
==
--- head/sys/dev/usb/serial/ugensa.cFri Jul 12 06:19:25 2019
(r349938)
+++ head/sys/dev/usb/serial/ugensa.cFri Jul 12 09:02:12 2019
(r349939)
@@ -70,6 +70,7 @@
 #defineUGENSA_CONFIG_INDEX 0
 #defineUGENSA_IFACE_INDEX  0
 #defineUGENSA_IFACE_MAX8   /* exclusivly */
+#defineUGENSA_PORT_MAX 8   /* exclusivly */
 
 enum {
UGENSA_BULK_DT_WR,
@@ -84,11 +85,11 @@ struct ugensa_sub_softc {
 
 struct ugensa_softc {
struct ucom_super_softc sc_super_ucom;
-   struct ucom_softc sc_ucom[UGENSA_IFACE_MAX];
-   struct ugensa_sub_softc sc_sub[UGENSA_IFACE_MAX];
+   struct ucom_softc sc_ucom[UGENSA_PORT_MAX];
+   struct ugensa_sub_softc sc_sub[UGENSA_PORT_MAX];
 
struct mtx sc_mtx;
-   uint8_t sc_niface;
+   uint8_t sc_nports;
 };
 
 /* prototypes */
@@ -154,12 +155,13 @@ static driver_t ugensa_driver = {
.size = sizeof(struct ugensa_softc),
 };
 
+/* Driver-info is max number of serial ports per interface */
 static const STRUCT_USB_HOST_ID ugensa_devs[] = {
-   {USB_VPI(USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220, 0)},
-   {USB_VPI(USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CDMA_MODEM1, 0)},
-   {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 0)},
-   {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 0)},
-   {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 0)},
+   {USB_VPI(USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220, 1)},
+   {USB_VPI(USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CDMA_MODEM1, 1)},
+   {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 1)},
+   {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 1)},
+   {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 3)},
 };
 
 DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 0);
@@ -192,65 +194,68 @@ ugensa_attach(device_t dev)
struct ugensa_softc *sc = device_get_softc(dev);
struct ugensa_sub_softc *ssc;
struct usb_interface *iface;
+   struct usb_config xfer_config[UGENSA_N_TRANSFER];
int32_t error;
uint8_t iface_index;
-   int x, cnt;
+   int x, maxports;
 
+   maxports = USB_GET_DRIVER_INFO(uaa);
device_set_usb_desc(dev);
mtx_init(>sc_mtx, "ugensa", NULL, MTX_DEF);
ucom_ref(>sc_super_ucom);
 
-   /* Figure out how many interfaces this device has got */
-   for (cnt = 0; cnt < UGENSA_IFACE_MAX; cnt++) {
-   if ((usbd_get_endpoint(uaa->device, cnt, ugensa_xfer_config + 
0) == NULL) ||
-   (usbd_get_endpoint(uaa->device, cnt, ugensa_xfer_config + 
1) == NULL)) {
-   /* we have reached the end */
-   break;
-   }
-   }
+   for (iface_index = UGENSA_IFACE_INDEX; iface_index < UGENSA_IFACE_MAX; 
iface_index++) {
 
-   if (cnt == 0) {
-   device_printf(dev, "No interfaces\n");
-   goto detach;
-   }
-   for (x = 0; x < cnt; x++) {
-   iface = usbd_get_iface(uaa->device, x);
-   if (iface->idesc->bInterfaceClass != UICLASS_VENDOR)
+   iface = usbd_get_iface(uaa->device, iface_index);
+   if (iface == NULL || iface->idesc->bInterfaceClass != 
UICLASS_VENDOR)
/* Not a serial port, most likely a SD reader */
continue;
 
-   ssc = sc->sc_sub + sc->sc_niface;
-   ssc->sc_ucom_ptr = sc->sc_ucom + sc->sc_niface;
+   /* Loop over all endpoints pairwise */
+   for (x = 0; x < maxports && sc->sc_nports < UGENSA_PORT_MAX; 
x++) {
 
-   iface_index = (UGENSA_IFACE_INDEX + x);
-   error = usbd_transfer_setup(uaa->device,
-   _index, ssc->sc_xfer, ugensa_xfer_config,
-   UGENSA_N_TRANSFER, ssc, >sc_mtx);
+   ssc = sc->sc_sub + sc->sc_nports;
+   ssc->sc_ucom_ptr = sc->sc_ucom + sc->sc_nports;
 
-   if (error) {
-   device_printf(dev, "allocating USB "
-   "transfers failed\n");
-   goto detach;
-   }
-   /* clear stall at first run */
-   mtx_lock(>sc_mtx);
-   usbd_xfer_set_stall(ssc->sc_xfer[UGENSA_BULK_DT_WR]);
-   

svn commit: r346369 - head/sbin/md5

2019-04-19 Thread Poul-Henning Kamp
Author: phk
Date: Fri Apr 19 06:49:46 2019
New Revision: 346369
URL: https://svnweb.freebsd.org/changeset/base/346369

Log:
  Close filedescriptors when done with them.

Modified:
  head/sbin/md5/md5.c

Modified: head/sbin/md5/md5.c
==
--- head/sbin/md5/md5.c Fri Apr 19 03:47:59 2019(r346368)
+++ head/sbin/md5/md5.c Fri Apr 19 06:49:46 2019(r346369)
@@ -247,7 +247,9 @@ main(int argc, char *argv[])
err(1, "capsicum");
 #endif
}
-   if ((p = Algorithm[digest].Fd(fd, buf)) == NULL) {
+   p = Algorithm[digest].Fd(fd, buf);
+   (void)close(fd);
+   if (p == NULL) {
warn("%s", *argv);
failed++;
} else {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r345138 - head/share/man/man9

2019-03-15 Thread Poul-Henning Kamp

In message , Andrew Gallatin 
writes:
>On 3/14/19 11:36 PM, Rodney W. Grimes wrote:
>> [ Charset UTF-8 unsupported, converting... ]
>>> On Thu, 14 Mar 2019 at 22:39, Rodney W. Grimes
>>>  wrote:
>>>>
>>>> 4. There is no easy way to show
>>>> "changed byte at offset 0x432 from 0xef to 0xfe"
>> 
>> How do we represent Copyright and License in such objects?
>> This is an issue that is totally left out of even .uu version.

I am pretty sure that some of the .uu files had copyrights in them
at various points, but yes, good point.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r345138 - head/share/man/man9

2019-03-15 Thread Poul-Henning Kamp

In message <201903150152.x2f1q34w027...@gndrsh.dnsmgr.net>, "Rodney W. Grimes" 
writes:

>> The first versions of CTM used diff -e and ed(1) to transmit changes,
>> and that choked up on binary files.  We didn't have patch in the
>> tree back then.

>patch has always been in the tree.
>https://github.com/sergev/4.4BSD-Lite2/tree/master/usr/src/usr.bin/patch

Yes, in *that* tree, but it was not always in *our* tree, particularly
not in the strange time between 1.1.5.1 and 2.0.

Trust me: if it had been, I would not have used diff-e+ed(1)


-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r345138 - head/share/man/man9

2019-03-14 Thread Poul-Henning Kamp

In message 
, Ed Maste writes:
>On Thu, 14 Mar 2019 at 14:55, Rodney W. Grimes

>Doing some archaeology, the first instance of a uuencoded file I can
>find is r1796, "Got rid of a couple of binary files by uuencoding.  49
>more to go." There's no explanation of why the change was made.

I am pretty sure that we discussed the question of binary files in
the tree on either core@ or hackers@ (not much difference back
then), but that probably predates the "Dont mount the projects mail
archives on /tmp/something" incident.

The first versions of CTM used diff -e and ed(1) to transmit changes,
and that choked up on binary files.  We didn't have patch in the
tree back then.

I can't answer definitively if modern CTM has any such restrictions,
but I would not expect so, either way, it should not matter.

>> We should also note that if they are already in uuencode state
>> to leave them in uuencode state, or do we intened to convert
>> them on next commit, or ???
>
>Good point, converting existing .uu files to binary is just
>unnecessary churn and is not recommended. If someone is going to make
>a change it can be done with the next update.

Agreed.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344243 - head/stand/lua

2019-02-18 Thread Poul-Henning Kamp

In message <0d51ac98-0e84-4e66-b552-ce9d4a7ef...@freebsd.org>, Devin Teske 
writes:

>Uh, no. I only clear regions of the screen by positioning the cursor using
>ANSI escape sequences and then drawing spaces. [...]

One thing the loader should do, is clear any scrolling regions which may
have been left behind, for instance after a panic.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344059 - head/share/man/man4

2019-02-12 Thread Poul-Henning Kamp
Author: phk
Date: Tue Feb 12 21:06:07 2019
New Revision: 344059
URL: https://svnweb.freebsd.org/changeset/base/344059

Log:
  Point people to SMP(4) for CPU<->domain mapping.

Modified:
  head/share/man/man4/numa.4

Modified: head/share/man/man4/numa.4
==
--- head/share/man/man4/numa.4  Tue Feb 12 20:12:41 2019(r344058)
+++ head/share/man/man4/numa.4  Tue Feb 12 21:06:07 2019(r344059)
@@ -77,6 +77,9 @@ The
 .Xr cpuset 1
 tool is available for starting processes with a non-default
 policy, or to change the policy of an existing thread or process.
+See
+.Xr SMP 4
+for information about CPU to domain mapping.
 .Pp
 Systems with non-uniform access to I/O devices may mark those devices
 with the local VM domain identifier.
@@ -117,6 +120,7 @@ Policy information is available in both struct thread 
 .Xr cpuset 1 ,
 .Xr cpuset_getaffinity 2 ,
 .Xr cpuset_setaffinity 2 ,
+.Xr SMP 4 ,
 .Xr bus_get_domain 9
 .Sh HISTORY
 .Nm
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342152 - head/sbin/mdconfig

2018-12-16 Thread Poul-Henning Kamp
Author: phk
Date: Sun Dec 16 18:10:55 2018
New Revision: 342152
URL: https://svnweb.freebsd.org/changeset/base/342152

Log:
  Make (no)ro an alias for (no)readonly

Modified:
  head/sbin/mdconfig/mdconfig.c

Modified: head/sbin/mdconfig/mdconfig.c
==
--- head/sbin/mdconfig/mdconfig.c   Sun Dec 16 08:58:14 2018
(r342151)
+++ head/sbin/mdconfig/mdconfig.c   Sun Dec 16 18:10:55 2018
(r342152)
@@ -193,6 +193,10 @@ main(int argc, char **argv)
mdio.md_options |= MD_READONLY;
else if (!strcmp(optarg, "noreadonly"))
mdio.md_options &= ~MD_READONLY;
+   else if (!strcmp(optarg, "ro"))
+   mdio.md_options |= MD_READONLY;
+   else if (!strcmp(optarg, "noro"))
+   mdio.md_options &= ~MD_READONLY;
else if (!strcmp(optarg, "reserve"))
mdio.md_options |= MD_RESERVE;
else if (!strcmp(optarg, "noreserve"))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341803 - head/libexec/rc

2018-12-11 Thread Poul-Henning Kamp

In message <20181212071210.l...@besplex.bde.org>, Bruce Evans writes:

>But software bloat is now outrunning CPU speed increases.  Some bandwidths
>for reading 1 byte at a time run today on the same 2GHz CPU i386 UP hardware
>
>linux-2.1.128 kernel built in 1998: 2500k/sec
>linux-2.4.0t8 kernel built in 2000: 1720k/sec
>linux-2.6.10  kernel built in 2004: 1540k/sec
>FreeBSD-4 kernel built in 2007:  680k/sec
>FreeBSD-~5.2  kernel built in 2018:  700k/sec
>FreeBSD-11kernel built in 2018:  720k/sec (SMP kernel)
>FreeBSD-pre12 kernel built in 2018:  540k/sec (SMP kernel)
>FreeBSD-13kernel built in 2018:  170k/sec (SMP kernel)

It is not just software bloat, it is also caused by the deeper and
deeper pile of kludges between what goes for a "CPU" these days and
what counts as "RAM".

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341682 - head/sys/sys

2018-12-11 Thread Poul-Henning Kamp

In message 
, Warner Losh writes:

>We haven't ever supported SMP on i486, to my knowledge.

There were never any usable i486 SMP hardware.

The i486 CPU was not designed to do SMP so getting two CPUs to talk
together (IPIs and all that) required a lot of glue-logic, which
never got chip-ified.

A few prototypes were built, but nothing ever reached production,
least of all HP's 1000xi486 chip "mainfram" project.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r340187 - head/sys/geom

2018-11-07 Thread Poul-Henning Kamp

In message 
, Warner Losh writes:

>BIO_FLUSH is primarily done to force ordering points, 

Originally BIO_FLUSH was defined the way it is, to make it possible
to flush an isolated specified range on providers which support that
so that fsync(2) could be implemented that way.

I can't remember the exact semantics of the two "magic" flush
operations (off=0,len=0) and (off=end,len=0) but they were different
from each other in some important aspect (Pawel?)

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339529 - head/sys/teken

2018-10-21 Thread Poul-Henning Kamp
Author: phk
Date: Sun Oct 21 08:29:36 2018
New Revision: 339529
URL: https://svnweb.freebsd.org/changeset/base/339529

Log:
  Implement ECMA-48 "REP", some Linuxen have started emitting them recently.
  
  Approved by:  ed

Modified:
  head/sys/teken/gensequences
  head/sys/teken/sequences
  head/sys/teken/teken.h
  head/sys/teken/teken_subr.h

Modified: head/sys/teken/gensequences
==
--- head/sys/teken/gensequences Sun Oct 21 07:56:58 2018(r339528)
+++ head/sys/teken/gensequences Sun Oct 21 08:29:36 2018(r339529)
@@ -158,6 +158,7 @@ for (p in l_prefix_name) {
 
if (l_prefix_name[p] != "teken_state_init") {
print "";
+   print "\tt->t_last = 0;";
print "\tteken_state_switch(t, teken_state_init);";
}
print "}";

Modified: head/sys/teken/sequences
==
--- head/sys/teken/sequencesSun Oct 21 07:56:58 2018(r339528)
+++ head/sys/teken/sequencesSun Oct 21 08:29:36 2018(r339529)
@@ -114,3 +114,6 @@ C25VTSW Cons25 switch virtual terminal  
^[ [ z  r
 
 # VT52 compatibility
 #DECID VT52 DECID  ^[ Z
+
+# ECMA-48
+REPRepeat last graphic char^[ [ b  n

Modified: head/sys/teken/teken.h
==
--- head/sys/teken/teken.h  Sun Oct 21 07:56:58 2018(r339528)
+++ head/sys/teken/teken.h  Sun Oct 21 08:29:36 2018(r339529)
@@ -157,6 +157,7 @@ struct __teken {
 
unsigned int t_utf8_left;
teken_char_t t_utf8_partial;
+   teken_char_t t_last;
 
unsigned int t_curscs;
teken_scs_t *t_saved_curscs;

Modified: head/sys/teken/teken_subr.h
==
--- head/sys/teken/teken_subr.h Sun Oct 21 07:56:58 2018(r339528)
+++ head/sys/teken/teken_subr.h Sun Oct 21 08:29:36 2018(r339529)
@@ -796,10 +796,11 @@ teken_subr_primary_device_attributes(const teken_t *t,
 }
 
 static void
-teken_subr_do_putchar(const teken_t *t, const teken_pos_t *tp, teken_char_t c,
+teken_subr_do_putchar(teken_t *t, const teken_pos_t *tp, teken_char_t c,
 int width)
 {
 
+   t->t_last = c;
if (t->t_stateflags & TS_INSERT &&
tp->tp_col < t->t_winsize.tp_col - width) {
teken_rect_t ctr;
@@ -1332,3 +1333,12 @@ teken_subr_vertical_position_absolute(teken_t *t, unsi
t->t_stateflags &= ~TS_WRAPPED;
teken_funcs_cursor(t);
 }
+
+static void
+teken_subr_repeat_last_graphic_char(teken_t *t, unsigned int rpts)
+{
+
+   for (; t->t_last != 0 && rpts > 0; rpts--)
+   teken_subr_regular_character(t, t->t_last);
+}
+
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339527 - head/sys/dev/usb

2018-10-21 Thread Poul-Henning Kamp
Author: phk
Date: Sun Oct 21 07:32:35 2018
New Revision: 339527
URL: https://svnweb.freebsd.org/changeset/base/339527

Log:
  Add Lenovo USB-C and TB3 docks

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSun Oct 21 07:30:26 2018(r339526)
+++ head/sys/dev/usb/usbdevsSun Oct 21 07:32:35 2018(r339527)
@@ -2762,6 +2762,8 @@ product LEADTEK 9531  0x2101  9531 GPS
 product LENOVO GIGALAN 0x304b  USB 3.0 Ethernet
 product LENOVO ETHERNET0x7203  USB 2.0 Ethernet
 product LENOVO RTL8153 0x7205  USB 3.0 Ethernet
+product LENOVO TBT3LAN 0x3069  LAN port in Thinkpad TB3 dock
+product LENOVO USBCLAN 0x3062  LAN port in Thinkpad USB-C dock
 
 /* Lexar products */
 product LEXAR JUMPSHOT 0x0001  jumpSHOT CompactFlash Reader
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339526 - head/lib/libc/sys

2018-10-21 Thread Poul-Henning Kamp
Author: phk
Date: Sun Oct 21 07:30:26 2018
New Revision: 339526
URL: https://svnweb.freebsd.org/changeset/base/339526

Log:
  Update example to something people less than 40 years old have heard about.

Modified:
  head/lib/libc/sys/recv.2

Modified: head/lib/libc/sys/recv.2
==
--- head/lib/libc/sys/recv.2Sun Oct 21 06:52:10 2018(r339525)
+++ head/lib/libc/sys/recv.2Sun Oct 21 07:30:26 2018(r339526)
@@ -260,13 +260,8 @@ struct cmsghdr {
 };
 .Ed
 .Pp
-As an example, one could use this to learn of changes in the data-stream
-in XNS/SPP, or in ISO, to obtain user-connection-request data by requesting
-a
-.Fn recvmsg
-with no data buffer provided immediately after an
-.Fn accept
-system call.
+As an example, the SO_TIMESTAMP socket option returns a reception
+timestamp for UDP packets.
 .Pp
 With
 .Dv AF_UNIX
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339530 - head/sys/dev/usb/net

2018-10-21 Thread Poul-Henning Kamp
Author: phk
Date: Sun Oct 21 09:36:12 2018
New Revision: 339530
URL: https://svnweb.freebsd.org/changeset/base/339530

Log:
  Recognize LAN in Lenovo USB-C and TB3 docks

Modified:
  head/sys/dev/usb/net/if_ure.c

Modified: head/sys/dev/usb/net/if_ure.c
==
--- head/sys/dev/usb/net/if_ure.c   Sun Oct 21 08:29:36 2018
(r339529)
+++ head/sys/dev/usb/net/if_ure.c   Sun Oct 21 09:36:12 2018
(r339530)
@@ -68,6 +68,8 @@ SYSCTL_INT(_hw_usb_ure, OID_AUTO, debug, CTLFLAG_RWTUN
 static const STRUCT_USB_HOST_ID ure_devs[] = {
 #defineURE_DEV(v,p,i)  { USB_VPI(USB_VENDOR_##v, 
USB_PRODUCT_##v##_##p, i) }
URE_DEV(LENOVO, RTL8153, 0),
+   URE_DEV(LENOVO, TBT3LAN, 0),
+   URE_DEV(LENOVO, USBCLAN, 0),
URE_DEV(NVIDIA, RTL8153, 0),
URE_DEV(REALTEK, RTL8152, URE_FLAG_8152),
URE_DEV(REALTEK, RTL8153, 0),
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r264378 - head/sys/geom/part

2018-10-08 Thread Poul-Henning Kamp

In message , John Baldwin 
writes:
>On 4/12/14 1:28 PM, Marcel Moolenaar wrote:

>Also, while we may want to create sane layouts by default, we
>should probably always provide a way to create less-sane layouts that are
>still conformant to the spec.  I do wonder if this kind of default
>preference shouldn't belong in the userspace gpart tool rather than the
>kernel and the kernel should create any compliant layout as requested by
>userland instead.

Seconded.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r337566 - head/tools/tools/sysbuild

2018-08-10 Thread Poul-Henning Kamp
Author: phk
Date: Fri Aug 10 06:28:25 2018
New Revision: 337566
URL: https://svnweb.freebsd.org/changeset/base/337566

Log:
  Make distribution now happens from top of source tree.
  
  Silence debugging output

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==
--- head/tools/tools/sysbuild/sysbuild.sh   Fri Aug 10 06:11:04 2018
(r337565)
+++ head/tools/tools/sysbuild/sysbuild.sh   Fri Aug 10 06:28:25 2018
(r337566)
@@ -204,7 +204,7 @@ ports_recurse() (
echo "Missing port $d ($t) (fl $fl) (bd $bd)" 
1>&2
continue
fi
-   echo "Flavored port $d ($t) (fl $fl) (bd $bd)" 1>&2
+   # echo "Flavored port $d ($t) (fl $fl) (bd $bd)" 1>&2
d=$bd
fi
d=`cd /usr/ports && cd $d && /bin/pwd`
@@ -549,7 +549,7 @@ log_it Installworld
> ${SBMNT}/_.iw 2>&1
 
 log_it distribution
-(cd /usr/src/etc && make -m /usr/src/share/mk distribution DESTDIR=${SBMNT} 
${SRCCONF} ) \
+(cd /usr/src && make -m /usr/src/share/mk distribution DESTDIR=${SBMNT} 
${SRCCONF} ) \
> ${SBMNT}/_.dist 2>&1
 
 log_it Installkernel
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r336113 - head/usr.bin/gzip

2018-07-08 Thread Poul-Henning Kamp

In message <201807082239.w68mdxwd053...@repo.freebsd.org>, "Pedro F. Giffuni" 
writes:

>  New version:
>  
>  usize = buf[4];
>  usize |= (unsigned int)buf[5] << 8;
>  usize |= (unsigned int)buf[6] << 16;
>  usize |= (unsigned int)buf[7] << 24;

Why not use the functions in endian.h ?

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r335091 - head/sbin/nvmecontrol

2018-06-14 Thread Poul-Henning Kamp

In message 
, Warner 
Losh writes:

>The year of first publication of the work;

Please be aware that "year of first publicaiton of the work" is a
surprising tricky legal concept, because neither "first", "publication"
or "the work" means what a normal or sane person would expect.

>But this only required for works published before March 1, 1989. It later
>states:
>
>"Copyright notice is optional for unpublished works, foreign works, or
>works published on or after March 1, 1989. When notice is optional,
>copyright owners can use any form of notice they wish."

This is just about the worst legal advise one can imagine, because
US still runs a system of "Copyright Registration" and there is a
lot riding on having done so "promptly" if you ever get into a
lawsuit, and if you don't affix a notice it gets even worse.

>The project wishes date ranges. :)

I support that, for data-archaeological reasons, but the publication
year cannot just be updated willy nilly.

A notice of "2014-2017" literally means "Some individual parts,
each of which clear the 'substantial' threshold, were published in
2014, others in 2015, others again in 2016 and some in 2017"

This is why "2014-2017" is significantly different from "2014,2016-2017".

It is also important to understand that Copyright cannot be "renewed"
this way unless the changes are 'substantial' enough, which probably
means they have to clear the 'derivative work' threshold to be safe.

But there is no guidance to be found *anywhere* what it takes for
source code to clear any of those thresholds, because nobody has
gone to court on that question yet.

And nobody is likely to do so in the next three decades, because
almost no software has fallen out of copyright, and no software
will do so in the next three decades (All Hail Mickey!)

The legal advice I have received is that one should "probably not"
update the publication year unless the changes amount to "a rewrite",
but updating *a little* too aggressively will probably only be
"harmless error" due to the total absense of statute text and case
law.

Nobody want to guess what the situation is for "live works", under
which countinous software development (probably) falls, and when
you start talking about changing maintainers, your friendly copyright
lawyer will get that glazed "Thank goodness the lawsuits wont start
until I'm dead" look.

And of course all this gets much more "interesting" if APIs can
truly be copyrighted, because then we need to find out what "an API"
is in the first place.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334669 - head/sys/sys

2018-06-05 Thread Poul-Henning Kamp

In message <1528232004.63685.25.ca...@freebsd.org>, Ian Lepore writes:
>On Tue, 2018-06-05 at 20:34 +, Eric van Gyzen wrote:

>>   (((flags) & M_WAITOK) || _malloc_item != NULL)
>
>This is a sad sad thing. Treating (bits & flagconstants) as boolean has
>a long long history in C. Surely there are literally thousand of
>occurrances in freebsd code already, so why did this one get flagged?

FlexeLint also gets its knickers in a twist about this kind of construct
and as far as I can tell the origin of that particular interpretation
comes out of the MISRA C rules.

In FlexeLint that specific check can be disabled, and I would imagine
Coverity has a similar tweakable setting.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334275 - head/lib/libc/string

2018-05-28 Thread Poul-Henning Kamp

In message <20180528155019.w2...@besplex.bde.org>, Bruce Evans writes:

>Note that assert() can't be used in signal handlers since it is required
>to print to stderr due to C not having any output methods except stdio.

That is precisly why I added abort2(2) more than 10 years ago.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: Deorbiting i386

2018-05-25 Thread Poul-Henning Kamp

In message <52678325-8265-4333-8c4f-2c8d53c82...@theravensnest.org>, David 
Chisnall writes:
>On 25 May 2018, at 05:27, Maxim Sobolev <sobo...@freebsd.org> wrote:
>> 
>> The idea looks very inmature and short-sighted to me. i386 is here to 
>stay not as a server/desktop platform but as an embedded/low power/low 
>cost platform for at least 5-10 years to come. There are plenty of 
>applications in the world that don't need > 3gb of memory space and have 
>no use for extra bits (and extra silicon) to function.
>
>This argument seems very odd to me.  If you are targeting the embedded 
>space, it is far easier to build a low-power chip that targets the 
>x86-64 ISA than the x86-32 ISA.

Any company doing so would also have to consider IP/patent/licensing factors.

That said, the main reason why i386 is still doing surprisingly
well in the embedded space, is that there are still truckloads of
"legacy" software running under MS-DOS and similar, and it works
well enough that "a simple hardware upgrade" is enough to satisfy
contingency planning.

For FreeBSD that market centers on the "Soekris Segment"

Most of the chips in those platforms are EOL'ed now, Soekris has
moved into the audio-homeopathy market, and PCengines are also
phasing out their x86 kit.

That sucks for the people running other operating systems,
but various taiwanese companies produce usable HW.

Anything written moderately competent using FreeBSD on i386 can be
trivially ported to amd64, if the new hardware supports that, or
to an entirely different 32bit arch arch like arm or mips.

So absolutely:  Kill i386 once 12 has been branched.

Poul-Henning

... Who ran Win3.11 a couple of years ago because of Vladimir Putin.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r333880 - head/sys/kern

2018-05-19 Thread Poul-Henning Kamp

In message <201805192056.w4jkumb8017...@pdx.rh.cn85.dnsmgr.net>, "Rodney W. 
Grimes" writes:
>> 
>> In message 
>> 

Re: svn commit: r333880 - head/sys/kern

2018-05-19 Thread Poul-Henning Kamp

In message 

Re: svn commit: r333393 - head/sys/contrib/ipfilter/netinet

2018-05-09 Thread Poul-Henning Kamp

In message <4065288.o9qkffz...@ralph.baldwin.cx>, John Baldwin writes:

>Hmm, normal FreeBSD style here is to use /* FALLTHROUGH */, and there are
>three other instances of that style in ipfilter already (and none others
>using this comment style).

Not to mention that code analysis tools like lint, FlexeLint, Coverity etc
expect /* FALLTHROUGH */ comments.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r333310 - head/sys/sys

2018-05-06 Thread Poul-Henning Kamp
Author: phk
Date: Sun May  6 21:22:46 2018
New Revision: 10
URL: https://svnweb.freebsd.org/changeset/base/10

Log:
  With the fall-back hack for lint gone, I have no copyright claim on this file.

Modified:
  head/sys/sys/_stdarg.h

Modified: head/sys/sys/_stdarg.h
==
--- head/sys/sys/_stdarg.h  Sun May  6 20:34:13 2018(r09)
+++ head/sys/sys/_stdarg.h  Sun May  6 21:22:46 2018(r10)
@@ -2,7 +2,6 @@
  * SPDX-License-Identifier: BSD-3-Clause
  *
  * Copyright (c) 2002 David E. O'Brien.  All rights reserved.
- * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332297 - in head/sys/teken: . libteken

2018-04-08 Thread Poul-Henning Kamp
Author: phk
Date: Sun Apr  8 19:23:50 2018
New Revision: 332297
URL: https://svnweb.freebsd.org/changeset/base/332297

Log:
  Pedantic polishing of code to please FlexeLint.
  
  Approved by:  ed

Modified:
  head/sys/teken/libteken/teken.3
  head/sys/teken/teken.c
  head/sys/teken/teken.h
  head/sys/teken/teken_scs.h
  head/sys/teken/teken_subr.h
  head/sys/teken/teken_subr_compat.h
  head/sys/teken/teken_wcwidth.h

Modified: head/sys/teken/libteken/teken.3
==
--- head/sys/teken/libteken/teken.3 Sun Apr  8 19:11:25 2018
(r332296)
+++ head/sys/teken/libteken/teken.3 Sun Apr  8 19:23:50 2018
(r332297)
@@ -43,25 +43,25 @@
 .Ft void
 .Fn teken_set_winsize "teken_t *t" "const teken_pos_t *size"
 .Ft const teken_pos_t *
-.Fn teken_get_cursor "teken_t *t"
+.Fn teken_get_cursor "const teken_t *t"
 .Ft void
 .Fn teken_set_cursor "teken_t *t" "const teken_pos_t *pos"
 .Ft const teken_attr_t *
-.Fn teken_get_curattr "teken_t *t"
+.Fn teken_get_curattr "const teken_t *t"
 .Ft void
 .Fn teken_set_curattr "teken_t *t" "const teken_attr_t *attr"
 .Ft const teken_attr_t *
-.Fn teken_get_defattr "teken_t *t"
+.Fn teken_get_defattr "const teken_t *t"
 .Ft void
 .Fn teken_set_defattr "teken_t *t" "const teken_attr_t *attr"
 .Ft const char *
-.Fn teken_get_sequence "teken_t *t" "unsigned int id"
+.Fn teken_get_sequence "const teken_t *t" "unsigned int id"
 .Ft teken_color_t
 .Fn teken_256to16 "teken_color_t color"
 .Ft teken_color_t
 .Fn teken_256to8 "teken_color_t color"
 .Ft void
-.Fn teken_get_defattr_cons25 "teken_t *t" "int *fg" "int *bg"
+.Fn teken_get_defattr_cons25 "const teken_t *t" "int *fg" "int *bg"
 .Ft void
 .Fn teken_set_8bit "teken_t *t"
 .Ft void

Modified: head/sys/teken/teken.c
==
--- head/sys/teken/teken.c  Sun Apr  8 19:11:25 2018(r332296)
+++ head/sys/teken/teken.c  Sun Apr  8 19:23:50 2018(r332297)
@@ -73,35 +73,38 @@ static teken_state_tteken_state_init;
  */
 
 static inline void
-teken_funcs_bell(teken_t *t)
+teken_funcs_bell(const teken_t *t)
 {
 
+   teken_assert(t->t_funcs->tf_bell != NULL);
t->t_funcs->tf_bell(t->t_softc);
 }
 
 static inline void
-teken_funcs_cursor(teken_t *t)
+teken_funcs_cursor(const teken_t *t)
 {
 
teken_assert(t->t_cursor.tp_row < t->t_winsize.tp_row);
teken_assert(t->t_cursor.tp_col < t->t_winsize.tp_col);
 
+   teken_assert(t->t_funcs->tf_cursor != NULL);
t->t_funcs->tf_cursor(t->t_softc, >t_cursor);
 }
 
 static inline void
-teken_funcs_putchar(teken_t *t, const teken_pos_t *p, teken_char_t c,
+teken_funcs_putchar(const teken_t *t, const teken_pos_t *p, teken_char_t c,
 const teken_attr_t *a)
 {
 
teken_assert(p->tp_row < t->t_winsize.tp_row);
teken_assert(p->tp_col < t->t_winsize.tp_col);
 
+   teken_assert(t->t_funcs->tf_putchar != NULL);
t->t_funcs->tf_putchar(t->t_softc, p, c, a);
 }
 
 static inline void
-teken_funcs_fill(teken_t *t, const teken_rect_t *r,
+teken_funcs_fill(const teken_t *t, const teken_rect_t *r,
 const teken_char_t c, const teken_attr_t *a)
 {
 
@@ -110,11 +113,12 @@ teken_funcs_fill(teken_t *t, const teken_rect_t *r,
teken_assert(r->tr_end.tp_col > r->tr_begin.tp_col);
teken_assert(r->tr_end.tp_col <= t->t_winsize.tp_col);
 
+   teken_assert(t->t_funcs->tf_fill != NULL);
t->t_funcs->tf_fill(t->t_softc, r, c, a);
 }
 
 static inline void
-teken_funcs_copy(teken_t *t, const teken_rect_t *r, const teken_pos_t *p)
+teken_funcs_copy(const teken_t *t, const teken_rect_t *r, const teken_pos_t *p)
 {
 
teken_assert(r->tr_end.tp_row > r->tr_begin.tp_row);
@@ -124,20 +128,23 @@ teken_funcs_copy(teken_t *t, const teken_rect_t *r, co
teken_assert(p->tp_row + (r->tr_end.tp_row - r->tr_begin.tp_row) <= 
t->t_winsize.tp_row);
teken_assert(p->tp_col + (r->tr_end.tp_col - r->tr_begin.tp_col) <= 
t->t_winsize.tp_col);
 
+   teken_assert(t->t_funcs->tf_copy != NULL);
t->t_funcs->tf_copy(t->t_softc, r, p);
 }
 
 static inline void
-teken_funcs_param(teken_t *t, int cmd, unsigned int value)
+teken_funcs_param(const teken_t *t, int cmd, unsigned int value)
 {
 
+   teken_assert(t->t_funcs->tf_param != NULL);
t->t_funcs->tf_param(t->t_softc, cmd, value);
 }
 
 static inline void
-teken_funcs_respond(teken_t *t, const void *buf, size_t len)
+teken_funcs_respond(const teken_t *t, const void *buf, size_t len)
 {
 
+   teken_assert(t->t_funcs->tf_respond != NULL);
t->t_funcs->tf_respond(t->t_softc, buf, len);
 }
 
@@ -290,7 +297,7 @@ teken_input(teken_t *t, const void *buf, size_t len)
 }
 
 const teken_pos_t *
-teken_get_cursor(teken_t *t)
+teken_get_cursor(const teken_t *t)
 {
 
return (>t_cursor);
@@ -308,7 +315,7 @@ teken_set_cursor(teken_t *t, const teken_pos_t *p)
 }
 
 const teken_attr_t *

Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-30 Thread Poul-Henning Kamp

In message <20180130105812.d1de09e0d4ac88934d776...@bidouilliste.com>, Emmanuel
 Vadot writes:
>On Tue, 30 Jan 2018 09:47:57 +

> I don't think that we want to load it by default as it would mean that
>some GPIO are now unusable as they are pwm pins now.

So the essential architectural question seems to be:

Can we load the pwm overlay by default, but still use the
PWM-pins for something else until/if the pwm driver is kldloaded ?

If not, we're right back to FreeBSD 1.x semantics again.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-30 Thread Poul-Henning Kamp

In message <20180130094251.ga85...@bluezbox.com>, Oleksandr Tymoshenko writes:
>Poul-Henning Kamp (p...@phk.freebsd.dk) wrote:

>> But only if you add pwm.dtbo to config.txt and reboot, because
>> I see nothing indicating that we will put it there in the
>> release images we (may start to) produce ?
>
>No. We're going to add them in our release image. That's what
>I meant by "working with Glen and Brad".

Ok, that was a bit more understated than I could decode.

(My understanding until now was that you would have to do
that by hand if you wanted to use PWM.)

If the pwm overlay is going to be loaded by default, then I
have no objection to removing the ignore-disable hack.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-30 Thread Poul-Henning Kamp

In message <20180130025048.ga76...@bluezbox.com>, Oleksandr Tymoshenko writes:

>> You seem to have skipped the bit about "without reboot" ?
>
>No I haven't. config.txt is parsed by VC firmware on boot time
>and pwm.dtbo is applied even before boot loader kicks in. When
>kernel starts pwm node has pinctl information ready and status
>property is set to "okay". So if you download next available image,
>flash and boot it and run kldload bcm2835_pwm it will give you
>working PWM device out of the box without reboot.

But only if you add pwm.dtbo to config.txt and reboot, because
I see nothing indicating that we will put it there in the
release images we (may start to) produce ?

>I don't think we have designated reference platform at the moment,
>but it's a good idea to have one. Pi's platform is too weird to
>be reference. TI's AM335x or iMX would be a good candidate I think
>They are complex enough to illustrate all the concepts yet not super
>complex.

I fully agree that RPi should *not* be our reference platform.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-29 Thread Poul-Henning Kamp

In message <20180129132736.ga66...@bluezbox.com>, Oleksandr Tymoshenko writes:

>> If I pick a RPI[23] out of the box, download a FreeBSD image,
>> put the card in and play around, I should be able to put a
>> LED in a breadboard and configure a line for PWM or attach
>> an I2C or SPI device without reboot between every single
>> experiment.
>
>No problem. We include pwm.dtbo in our snapshot and config.txt.
>We have PWM running out of the box. Problem solved, no need for
>any hacks. I'll gladly work with Glen and Brad to get this
>functionality in snapshots/builds.

You seem to have skipped the bit about "without reboot" ?

>Raspberry Pi and other hobbyist ARM boards are basically Lego.
>They can be turned into multiple things and that's their selling
>point. They're hackers' toys.

That's *exactly* why I want us to support them better.

>You ignored my question: what would be authoritative source for this
>kind of info? World is not perfect, FreeBSD/arm support is not perfect.
>We have limited resources. Where we should apply them to guide
>new contributors?

At the very least have some place to point developers for a
resonably up-to-date idea of what the FDT related architecture
in FreeBSD is.

Either documentation or source code (preferably with a bit of
contextual comments) on our chosen reference platform.  (Source
code on ref-platform is probably more robust, as there is a
better chance that it will be kept current.)

>You also ignored my question about clkman fix. Provided you have
>all the documentation you need [...]

I don't.  The information for the PWM case was based on an affine
transform of information for the GPIO clock some shrewed guesses
and finally in-lab measurement of what actually transpired when I
frobbed registers.

But more importantly, I have no idea what servies *a* clock
manager offers, through which apis and to what clients and
at what level of abstraction and flexibility ?

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-29 Thread Poul-Henning Kamp

In message <20180129063950.ga59...@bluezbox.com>, Oleksandr Tymoshenko writes:

>PWM drivers: https://reviews.freebsd.org/D14104

I'll test this in my next timeslot.

>We do not include these
>overlays in official snapshots and I think this should be fixed.

That's one of the details I ran into:  The DTS for the DTB
in the RaspBSD.org images is not in our tree.

Even if they are vendor-supplied, should they be in our tree for
reasons of completeness/documentation/reproducible builds etc. ?

>Summary: adding ofw_bus_status_okay check in probe method doesn't
>require any additional functionality, ignoring it is inconsistent
>with majority of FDT-based drivers' behavior.  There is trivial
>way to enable PWM device in platform-conformant way. Will you
>please commit fix for this bug? 

I prefer an architectural discussion about how we *want* this to
work in the long run first.

My input:

If I pick a RPI[23] out of the box, download a FreeBSD image,
put the card in and play around, I should be able to put a
LED in a breadboard and configure a line for PWM or attach
an I2C or SPI device without reboot between every single
experiment.

If I mount any kind of "cape" board, requiring a reboot is
a perfectly reasonable requirement (not to mention it being
sane ESD procedure.)

That may indicate an overall model where we distinguish between
"overlays loaded at boottime" and "no overlays loaded at
boot time" and behave more liberally in the second case.

Or maybe we just need a well hidden but powerful switch that
lets people say "God, Root, What difference?"

The crucial point is that we gain no friends or favours by enforcing
needless cumbersome procedures, like reboots, just because there
may some times be dangers without it, because very often the dangerous
things people want to do is getting their job done or develop
and improve FreeBSD.

I kindly point you to the wisdom of Kernighans "There is no
escape" critique of PASCAL.

(Service message to the non-ancient developers:  That this bit of
advice came from the bloke who had read Kernighan and therefore
implemented "kern.geom.debugflags=0x10" to defeat the consistency
protections in his new-fangled GEOM subsystem, even if it was
dangerous - and he never once regretted it.)

>All these best practices and guidelines are unwriteen, and
>they're not always implemented on older platforms. And it's the
>problem from which this situation has risen.

With the added cherry on top that RPi is a horrible platform which
nobody loves - except thousands of teachers, students, hackers and
other potential FreeBSD recruits.

Poul-Henning

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-29 Thread Poul-Henning Kamp

In message 

Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-28 Thread Poul-Henning Kamp

In message 

Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-28 Thread Poul-Henning Kamp

In message <8d8ae9d10058fd72ce3ec467181c9...@megadrive.org>, Emmanuel Vadot 
writes:

>  Sometimes it makes sense to reboot.

Yes, *sometimes* it does.

But *always* demanding reboot makes no sense ever.

>  Reference platform doesn't make much sense in the embedded world.

A reference platform which peple can look at to find out what the
software architecture is supposed to be, in the near total absense of
documentation for said software architecture makes a lot of sense.

>  I'm not upset at you for not using, I'm "upset" at you for not wanting 
>to make the effort to implement them. Some are hard, some are easy.

FreeBSD is a hobby for me these days, that implied a certain amount
of enjoyment and limited time.

Trying to guess what software architecture you want to be written,
based on the non-existent documentation and with no reference-platform
to look at, and then implementing it on a SOC where the hardware
documentation spans the gamut from from missing over mangled to
misleading, does not qualify as "enjoyment" for me and it certainly
is not something I have time for.

>  What's funny though is that even with a pinctrl and clock management, 
>we still don't have what is necessary to implement what you want 
>(kldloading a driver and directly use pwm). For that we need overlays at 
>runtime, pinmuxing at runtime and probably other things too.

I'm amazed if those things are not already part of our ambition ?

>  This is where I (and probably) other don't agree, this is backward.
>  We must implement first proper pinctrl driver and clock management 
>  instead of introduce hacks.

Who exactly are "We" ?

You indicated that you are not going to do it.

I can't because I don't know what it is that I am supposed to write.

Nobody else seems to be inclined to do it either.

So RPi as a platform is just in limbo forever ?

And where does this "Spanish Inquisition" road end?

Why are gpio and spi allowed to exist on the RPi platform?  Or is
your next demand going to be that they also be removed pending a
hypothetical pinctrl driver ?

>  I think we are both adults (not sure for me or if I want to be one but 
>let's pretend that I am), so let me ask you one more time to backout 
>your commit and let's work together to extend arm support toward what 
>you want to do.

Empathetically NO!

(But feel free to ask me again, if my driver ever in any way prevents
you from committing your changes to the RPi platform.)

Poul-Henning

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-27 Thread Poul-Henning Kamp

In message 
<canczdfrqg+k_3ih8qpm-1v-wbudbwfutg5lp+zn1htkcquc...@mail.gmail.com>, Warner 
Losh writes:

>> The moment the correct infrastructure appears on the RPi platform,
>> if it ever does, I will change my driver to use that infrastructure.
>
>The root of the problem is that we have the right infrastructure...
>Everywhere except RPi. It needs a proper pinmux/pinctl driver. That's the
>next step in fixing this issue. If you don't want to be part of fixing
>that, then get out of the way.

My driver is not built into any kernels, you have to kldload it AND
configure it via sysctls before it can possibly get in the way of
anything, so yes:  I am out of the way.

>The next step, though, is to bring the RPI's infrastructure up to speed
>with the rest of the arm ports... That's where time is best spent,
>honestly. Fighting a never ending series of one-off kludges is doomed to
>failure.

I don't think the two evenings I spent in my lap measuring and
figuring out what the datasheet didn't say and said wrong about the
PWM hardware is a failure just because a couple of hardware
unrelated lines of source code needs to be changed at a later date.

>We're there on
>boot on every other armv7/arm64 platform, just not there incrementally at
>runtime. Some work would be needed to make that happen, but I think I have a
>reasonable design that I've started to socialize... You're welcome to join in
>in making it happen, if you like

With the limited time I have available, I will.

Poul-Henning

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-27 Thread Poul-Henning Kamp

In message <20180127210801.37b8001125dd0a2c92372...@bidouilliste.com>, Emmanuel 
Vadot writes:

> - We have a commiter that commited something for his own need: he
>wanted to use the pwm on his rpi, coded a driver (this part is good)
>but feel that the standard we were using was crap and commited his work
>without talking with arm developper on what the proper way to do it was.

First, as a general rule, I think you should leave it to me to
express what I think and feel, because you truly suck at it.

FDT may or may not be the right technology to use, I take no position
on that, because I am not the one doing all the work to implement
it, and I certainly don't propose to do the work to come up with
an alternative.

> - Now we have a crappy driver in the tree.

1. Hardly our first

2. "Crappy driver" is not pass/fail, we grade that on a curve.

3. You confuse "I don't like" with "crappy"

> - We still have this driver that doesn't follow the standard we said we
>want to adhere to.

And part of that decision, clearly explained for all who participated
in making it, was that we should time-warp back to FreeBSD 1.X where
hardware changes always required a reboot ?

Right, I didn't think so...

Maybe we *also* need to make some decisions about *how* we want
this FDT stuff to work for us in practice?

My summary of the situation:

Everybody I have communicated with over the last couple of months
have given me clear indication that nothing significant will happen
on the RPi platform, which people see as inferior and not worth
the/any effort.

I don't entirely agree about that, I think RPi is a platform we
as project ignore at our peril, so I have started to do a little
bit of an effort, as I find time and information for it.

You keep yelling at me for not adhering to an entirely undocumented
design vision, which we don't even have a single compliant reference
platform for yet.

The stuff (clock manager, pin manager, runtime overlays) you are
upset about me not using, does not exist on the RPi platform in
FreeBSD at this point in time, which is why I don't use them.

There is no documentation anywhere to be found, how to implement
these hypothetical pieces of code, which is why I don't implement
them.

I am quite tempted to quote Gen. Patton on you and say "Lead me,
Follow me, or get out of my way", but that would be a bit too rude.

Instead I will repeat what I have already said to you several times:

The moment the correct infrastructure appears on the RPi platform,
if it ever does, I will change my driver to use that infrastructure.

Until then, you are wasting everybodys time pointing accusingly
into your book of unwritten rules.

Poul-Henning

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-23 Thread Poul-Henning Kamp

In message 
<canczdfrh0nhq7cbkq_genedzo+b3g4ttacezpgh11sr+82e...@mail.gmail.com>, Warner 
Losh writes:
>--089e08222b4ce7f8a4056372a0d5

>I'm actually thinking the right thing is to remove the checks everywhere.
>
>We then create  a couple of new simplebus methods:

+1

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-22 Thread Poul-Henning Kamp

In message 

Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-22 Thread Poul-Henning Kamp

In message <canczdfqwxb+w1bxcruv2bhyruj4joq5j0fqom+f4gz7+kpk...@mail.gmail.com>
, Warner Losh writes:

>This represents a partial understanding of what's required. It's base level
>only. Don't mistake it for full understanding of what needs to be done.

I would love not to, but learning "what needs to be done" have so
far eluded me, apart from some people pointing out that "somebody
should write XYZ" for severely underdocumented values of XYZ.

And now I *really* think this thread should end...

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-22 Thread Poul-Henning Kamp

In message 

Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-22 Thread Poul-Henning Kamp

In message <52374125.ogxafgl...@ralph.baldwin.cx>, John Baldwin writes:

>Create the corresponding device_t but device_disable() it when there
>is a disabled property.

That also removes a couple of boilerplate lines from all FDT device
drivers.

>A user can then use 'devctl enable ' to enable
>it before (or even after) loading a device driver.

That would work for me.

I wonder if it would be too noisy if we allowed ->probe() to run
on disabled devices and reported something like:

"foobar0: Matched disabled device <...>"

(without calling ->attach())

That way you would know you loaded the right driver, rather
than have to guess.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-22 Thread Poul-Henning Kamp

In message <20180122153003.664e1613bbf70ab49c5c1...@bidouilliste.com>, Emmanuel
 Vadot writes:

>[...] there is no way to
>know what the user will do so every node not used by the SBC must be
>disabled.

[...] until the user explicitly tells us, for instance with the command:

kldload /boot/kernel/bcm283x_pwm.ko

I'm not sure who was the first to run 386BSD on a laptop 25 years
ago, I was certainly one of the first five.

Ever since then our explicit goal has been to *not* require reboots
for reconfiguration, unless there was no way to avoid it.  Nothing
you or the "DT guys" can say, can convince me that we should reverse
that course.

I don't care how it works, but enabling and using PWM on an
out-of-the-box RPi should not require a reboot.

Over

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-22 Thread Poul-Henning Kamp

In message <20180122145117.08173be547f5dd6fef296...@bidouilliste.com>, Emmanuel
 Vadot writes:

> Using the same logic as before one could have a script starting some
>pwm stuff (or simply using /etc/sysctl.conf)
> Also this is not how DT is suppose to work, if the status ==
>'disabled' no driver should attach.

That doesn't make *any* UX sense.

"disabled" indicates that it can be enabled, and there is absolutely
no reason to force users to reboot, when all that stands between
them and using their hardware is a random setting in a file.

Explicitly kldload'ing a device-driver is as clear a "Enable it, please"
instruction as you can get from the user.

If you want to lock down this DT-device because some other
device/pin-mux/whatever makes its use impossible, then
status should not be "disabled" but "locked" or "impossible".

In particular it is *horrible* UX, that you kldload a device-driver
for hardware you know is there, and it just silently doesn't do
anything.  At the very least it should give a diagnostic.

Maybe something like:

"For no good reason this device is disabled, google for
an hour, try to come up with a device tree overlay, reboot
to install it and see if you get lucky."

:-)

>> > Can you please revert this part ?
>> 
>> Once I find out how to get similar behaviour, ie: kldload without
>> having to reboot to load a DT-overlay.
>
> Nobody is working on that right now (that I know of).

Let me know when it works, and I'll remove my hack then.

In the meantime, don't load bcm283x_pwm if you don't plan on
using the PWM on GPIO12 on your RPI[23].

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-22 Thread Poul-Henning Kamp

In message <20180122135905.203e19ce94510854777df...@bidouilliste.com>, Emmanuel
 Vadot writes:

>> +#if 0
>> +// XXX: default state is disabled in RPI3 DTB, assume for now
>> +// XXX: that people want the PWM to work if the KLD this module.
>>  if (!ofw_bus_status_okay(dev))
>>  return (ENXIO);
>> +#endif
>
> This is really bad, one need to use overlay to enable the node.
> Leaving this I will predict that in the near futur you will have
>someone complaining that he set to load the module at boot, unplug is
>pwm testing gear and plug another type of HAT and that it makes funny
>thing.

As long as you don't set any of dev.pwm.0.* sysctls, the bcm283x_pwm
driver doesn't do anything, so that situation is harmless.

> Can you please revert this part ?

Once I find out how to get similar behaviour, ie: kldload without
having to reboot to load a DT-overlay.

My preference would be that DT-overlays could be compiled into
kmods, but I'm fine with any reasonable commahd that can load
an overlay without a reboot.

Or alternatively, a command which will change the "status=disable"
to "status=okay" in the already loaded DT ?

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-22 Thread Poul-Henning Kamp

In message <20180122094629.f292f9f239174f0865b04...@bidouilliste.com>, Emmanuel
 Vadot writes:

>> + * Copyright (C) 2013-2015 Daisuke Aoyama <aoy...@peach.ne.jp>
>
> Was is based on some file ?
> Also someone will probably complain about SDPX tag here :)

Yes, I grabbed the blurp from a nearby file and forgot to edit it,
it's fixed now.

>> +if (unit != BCM_PWM_CLKSRC) {
>> +device_printf(sc->sc_dev,
>> +"Unsupported unit 0x%x", unit);
>> +return (0);
>> +}
>
> Uhg, this is ... ugly ...

Yes, very much so.

> The proper way will be to introduce a real clock manager exposing a
>clock domain and clocks using the extres/clk framework.

Yes, Somebody[tm] should really do that[1], just like Somebody[tm] should
write drivers for all sorts of other stuff on all sorts of platforms.

Eventually Somebody[tm] may even get around to that, but in the
meantime people who play with FreeBSD on Rpi's can at least get
the PWM output to work.

Poul-Henning

[1] Are you tired of Nice & Accurate[tm] chip documentation which
leaves no room for creativity and exploration?

Do you love to extrapolate and second-guess chip-designers mental
process from random snippets of incompetently written code ?

If so, you may find welcome relief trying to write a device driver
for the "BCM283x - Documentation - Scmockumentation!" family of
devices!

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r328260 - head/sys/modules/bcm283x_clkman

2018-01-22 Thread Poul-Henning Kamp
Author: phk
Date: Mon Jan 22 08:33:59 2018
New Revision: 328260
URL: https://svnweb.freebsd.org/changeset/base/328260

Log:
  Forgot to add the skeleton BCM283x Clock Manager
  
  Reminded by:  lwhsu

Added:
  head/sys/modules/bcm283x_clkman/
  head/sys/modules/bcm283x_clkman/Makefile   (contents, props changed)

Added: head/sys/modules/bcm283x_clkman/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/bcm283x_clkman/MakefileMon Jan 22 08:33:59 2018
(r328260)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/arm/broadcom/bcm2835/
+
+KMOD=  bcm283x_clkman
+SRCS=  bcm2835_clkman.c
+
+EXPORT_SYMS=   bcm2835_clkman_set_frequency
+
+SRCS+= bus_if.h device_if.h ofw_bus_if.h
+
+.include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r328259 - in head: share/man/man4 sys/arm/broadcom/bcm2835

2018-01-21 Thread Poul-Henning Kamp

In message <20180122074837.ga39...@freebsd.org>, Alexey Dokuchaev writes:

>These changes look unrelated to the manual page.  Is this intended?

Actually they're not unrelated, I spotted the units-error while writing
the manual page.

>On a related note, this code contains a number of style bugs, you might
>want to do a quick sweep on fixing them.

There will probably be other revisions to this code and I'll fold them
in as I find them.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r328259 - in head: share/man/man4 sys/arm/broadcom/bcm2835

2018-01-21 Thread Poul-Henning Kamp
Author: phk
Date: Mon Jan 22 07:43:54 2018
New Revision: 328259
URL: https://svnweb.freebsd.org/changeset/base/328259

Log:
  Add skeleton manual page for bcm283x_pwm
  
  (Feel free to improve this)

Added:
  head/share/man/man4/bcm283x_pwm.4   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/sys/arm/broadcom/bcm2835/bcm2835_clkman.c

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileMon Jan 22 07:15:24 2018
(r328258)
+++ head/share/man/man4/MakefileMon Jan 22 07:43:54 2018
(r328259)
@@ -78,6 +78,7 @@ MAN=  aac.4 \
axe.4 \
axge.4 \
bce.4 \
+   ${_bcm283x_pwm.4} \
bcma.4 \
bfe.4 \
bge.4 \
@@ -881,6 +882,10 @@ _vmm.4=vmm.4
 
 .if ${MACHINE_CPUARCH} == "mips"
 _nvram2env.4=  nvram2env.4
+.endif
+
+.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
+_bcm283x_pwm.4=  bcm283x_pwm.4
 .endif
 
 .if exists(${.CURDIR}/man4.${MACHINE_CPUARCH})

Added: head/share/man/man4/bcm283x_pwm.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/bcm283x_pwm.4   Mon Jan 22 07:43:54 2018
(r328259)
@@ -0,0 +1,97 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2017 Poul-Henning Kamp <p...@freebsd.org>
+.\" 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 ``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 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$
+.\"
+.Dd January 22, 2017
+.Dt BCM283X_PWM 4
+.Os
+.Sh NAME
+.Nm bcm283x_pwm
+.Nd bcm283x_pwm - driver for Raspberry Pi 2/3 PWM
+.Sh SYNOPSIS
+.Cd "kldload bcm283x_clkman"
+.Cd "kldload bcm283x_pwm"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides access to the PWM engine on GPIO12 of Rpi 2 and 3 hardware.
+.Pp
+The PWM hardware is controlled via the
+.Xr sysctl 8
+interface:
+.Bd -literal
+dev.pwm.0.mode: 1
+dev.pwm.0.freq: 12500
+dev.pwm.0.ratio: 2500
+dev.pwm.0.period: 1
+dev.pwm.0.pwm_freq: 12500
+.Ed
+.Bl -tag -width ".Va dev.pwm.0.mode"
+.It Va dev.pwm.0.mode
+Three modes exist, 0=off, 1=PWM, 2=N/M.
+The N/M mode is a first order delta-sigma mode, which makes a quite
+handy DAC output with a trivial RC lowpass filter.
+.Pp
+.It Va dev.pwm.0.freq
+The input frequency to the PWM hardware in Hz.
+Minmum frequency is 123 kHz, maximum frequency is 125 MHz.
+.It Va dev.pwm.0.period
+The period length in cycles.
+In PWM mode, the output frequency will be
+(
+.Va dev.pwm.0.freq
+/
+.Va dev.pwm.0.period .
+)
+In N/M mode this is the 'M'
+.It Va dev.pwm.0.ratio
+The "on" period in cycles.
+In PWM mode, to get a 25% dutycycle, set this to 25% of
+.Va dev.pwm.0.period .
+In N/M mode this is the 'N'
+.It Va dev.pwm.0.pwm_freq
+The calculated PWM output frequency in PWM mode.
+.El
+.Pp
+.Sh NOTES
+Currently the
+.Nm
+driver ignores the 'status="disabled"' flag in the DTB, assuming that
+if you load the driver, you want it to work.
+.Sh SEE ALSO
+.Xr sysctl 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 12.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver and this manual page were written by
+.An Poul-Henning Kamp Aq Mt p...@freebsd.org .

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_clkman.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_clkman.c  Mon Jan 22 07:15:24 
2018(r328258)
+++ head/sys/arm/broadcom/bcm

svn commit: r328258 - head/sys/arm/broadcom/bcm2835

2018-01-21 Thread Poul-Henning Kamp
Author: phk
Date: Mon Jan 22 07:15:24 2018
New Revision: 328258
URL: https://svnweb.freebsd.org/changeset/base/328258

Log:
  Forgot to edit copy copyright blurb.

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_clkman.c
  head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_clkman.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_clkman.c  Mon Jan 22 07:10:30 
2018(r328257)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_clkman.c  Mon Jan 22 07:15:24 
2018(r328258)
@@ -1,6 +1,7 @@
 /*-
- * Copyright (C) 2013-2015 Daisuke Aoyama <aoy...@peach.ne.jp>
- * All rights reserved.
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2017 Poul-Henning Kamp <p...@freebsd.org>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Mon Jan 22 07:10:30 2018
(r328257)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Mon Jan 22 07:15:24 2018
(r328258)
@@ -1,7 +1,7 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
- * Copyright (c) 2017 Poul-Henning Kamp <p...@freebsd.org>
+ * Copyright (c) 2017 Poul-Henning Kamp <p...@freebsd.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r328257 - in head/sys: arm/broadcom/bcm2835 dts/arm modules

2018-01-21 Thread Poul-Henning Kamp
!= BCM_PWM_CLKSRC) {
+   device_printf(sc->sc_dev,
+   "Unsupported unit 0x%x", unit);
+   return (0);
+   }
+
+   W_CMCLK(sc, unit, 6);
+   for (i = 0; i < 10; i++) {
+   u = R_CMCLK(sc, unit);
+   if (!(u&0x80))
+   break;
+   DELAY(1000);
+   }
+   if (u & 0x80) {
+   device_printf(sc->sc_dev,
+   "Failed to stop clock for unit 0x%x", unit);
+   return (0);
+   }
+   if (hz == 0)
+   return (0);
+
+   u = 5/hz;
+   if (u < 4) {
+   device_printf(sc->sc_dev,
+   "Frequency too high for unit 0x%x (max: 125MHz)",
+   unit);
+   return (0);
+   }
+   if (u > 0xfff) {
+   device_printf(sc->sc_dev,
+   "Frequency too low for unit 0x%x (min: 123Hz)",
+   unit);
+   return (0);
+   }
+   hz = 5/u;
+   W_CMDIV(sc, unit, u << 12);
+
+   W_CMCLK(sc, unit, 0x16);
+   for (i = 0; i < 10; i++) {
+   u = R_CMCLK(sc, unit);
+   if ((u&0x80))
+   break;
+   DELAY(1000);
+   }
+   if (!(u & 0x80)) {
+   device_printf(sc->sc_dev,
+   "Failed to start clock for unit 0x%x", unit);
+   return (0);
+   }
+   return (hz);
+}
+
+static int
+bcm2835_clkman_detach(device_t dev)
+{
+   struct bcm2835_clkman_softc *sc;
+
+   bus_generic_detach(dev);
+
+   sc = device_get_softc(dev);
+   if (sc->sc_m_res)
+   bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_m_res);
+
+   return (0);
+}
+
+static device_method_t bcm2835_clkman_methods[] = {
+   /* Device interface */
+   DEVMETHOD(device_probe, bcm2835_clkman_probe),
+   DEVMETHOD(device_attach,bcm2835_clkman_attach),
+   DEVMETHOD(device_detach,bcm2835_clkman_detach),
+
+   DEVMETHOD_END
+};
+
+static devclass_t bcm2835_clkman_devclass;
+static driver_t bcm2835_clkman_driver = {
+   "bcm2835_clkman",
+   bcm2835_clkman_methods,
+   sizeof(struct bcm2835_clkman_softc),
+};
+
+DRIVER_MODULE(bcm2835_clkman, simplebus, bcm2835_clkman_driver,
+bcm2835_clkman_devclass, 0, 0);
+MODULE_VERSION(bcm2835_clkman, 1);

Added: head/sys/arm/broadcom/bcm2835/bcm2835_clkman.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_clkman.h  Mon Jan 22 07:10:30 
2018(r328257)
@@ -0,0 +1,43 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2017 Poul-Henning Kamp <p...@freebsd.org>
+ *
+ * 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$
+ */
+
+#ifndef_BCM2835_CLKMAN_H_
+#define_BCM2835_CLKMAN_H_
+
+// Offset into BAR0 for unit
+enum bcm2835_clksrc {
+   BCM_GPIO0_CLKSRC =  0x70,
+   BCM_GPIO1_CLKSRC =  0x78,
+   BCM_GPIO2_CLKSRC =  0x80,
+   BCM_PWM_CLKSRC =0xa0,
+};
+
+uint32_t bcm2835_clkman_set_frequency(device_t, uint32_t, uint32_t);
+
+#endif /* _BCM2835_CLKMAN_H_ */

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Mon Jan 22 06:00:45 2018
(r328256)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Mon Jan 22 07:10:30 2018
(r328257)
@@ -42,12 +4

svn commit: r328223 - in head/sys: arm/broadcom/bcm2835 modules modules/bcm283x_pwm modules/rpi_pwm

2018-01-21 Thread Poul-Henning Kamp
Author: phk
Date: Sun Jan 21 21:27:41 2018
New Revision: 328223
URL: https://svnweb.freebsd.org/changeset/base/328223

Log:
  Rename rpi_pwm to bcm283x_pwm, and build it on armv[67] and arm64.
  
  Truncate ratio if period is lowered.
  
  Tested on Rpi2 and Rpi3.
  
  Rpi3 requires DTB->DTS->edit->DTB hack

Added:
  head/sys/modules/bcm283x_pwm/
 - copied from r328222, head/sys/modules/rpi_pwm/
Deleted:
  head/sys/modules/rpi_pwm/
Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c
  head/sys/modules/Makefile
  head/sys/modules/bcm283x_pwm/Makefile

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Sun Jan 21 21:09:08 2018
(r328222)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Sun Jan 21 21:27:41 2018
(r328223)
@@ -160,6 +160,8 @@ bcm_pwm_reconf(struct bcm_pwm_softc *sc)
 
/* Config PWM */
W_RNG(sc, sc->period);
+   if (sc->ratio > sc->period)
+   sc->ratio = sc->period;
W_DAT(sc, sc->ratio);
 
/* Start PWM */

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Sun Jan 21 21:09:08 2018(r328222)
+++ head/sys/modules/Makefile   Sun Jan 21 21:27:41 2018(r328223)
@@ -60,6 +60,7 @@ SUBDIR=   \
${_autofs} \
${_auxio} \
${_bce} \
+   ${_bcm283x_pwm} \
bfe \
bge \
bhnd \
@@ -804,6 +805,10 @@ _cloudabi32=   cloudabi32
 _cloudabi64=   cloudabi64
 .endif
 
+.endif
+
+.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
+_bcm283x_pwm=  bcm283x_pwm
 .endif
 
 .if ${MACHINE_ARCH:Marmv[67]*} != ""

Modified: head/sys/modules/bcm283x_pwm/Makefile
==
--- head/sys/modules/rpi_pwm/Makefile   Sun Jan 21 21:09:08 2018
(r328222)
+++ head/sys/modules/bcm283x_pwm/Makefile   Sun Jan 21 21:27:41 2018
(r328223)
@@ -2,7 +2,7 @@
 
 .PATH: ${SRCTOP}/sys/arm/broadcom/bcm2835/
 
-KMOD=  rpi_pwm
+KMOD=  bcm283x_pwm
 SRCS=  bcm2835_pwm.c
 
 SRCS+= bus_if.h device_if.h ofw_bus_if.h
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r327976 - in head/sys: arm/broadcom/bcm2835 dts/arm modules/rpi_pwm

2018-01-14 Thread Poul-Henning Kamp
Author: phk
Date: Sun Jan 14 20:36:21 2018
New Revision: 327976
URL: https://svnweb.freebsd.org/changeset/base/327976

Log:
  Add a rudimentary PWM driver for the RaspberryPi.
  
  Control is through sysctl, only GPIO12 supported.
  
  bootverbose creates sysctls for direct mangling of relevant registers.
  
  Only tested on RPI2

Added:
  head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c   (contents, props changed)
  head/sys/modules/rpi_pwm/
  head/sys/modules/rpi_pwm/Makefile   (contents, props changed)
Modified:
  head/sys/dts/arm/bcm2836.dtsi

Added: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Sun Jan 14 20:36:21 2018
(r327976)
@@ -0,0 +1,439 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2017 Poul-Henning Kamp <p...@freebsd.org>
+ * 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 
+
+static struct ofw_compat_data compat_data[] = {
+   {"broadcom,bcm2835-pwm",1},
+   {"brcm,bcm2835-pwm",1},
+   {NULL,  0}
+};
+
+struct bcm_pwm_softc {
+   device_tsc_dev;
+
+   struct resource *   sc_mem_res;
+   bus_space_tag_t sc_m_bst;
+   bus_space_handle_t  sc_m_bsh;
+
+   struct resource *   sc_clk_res;
+   bus_space_tag_t sc_c_bst;
+   bus_space_handle_t  sc_c_bsh;
+
+   uint32_tfreq;
+   uint32_tperiod;
+   uint32_tratio;
+   uint32_tmode;
+
+};
+
+#define BCM_PWM_MEM_WRITE(_sc, _off, _val) \
+bus_space_write_4(_sc->sc_m_bst, _sc->sc_m_bsh, _off, _val)
+#define BCM_PWM_MEM_READ(_sc, _off)\
+bus_space_read_4(_sc->sc_m_bst, _sc->sc_m_bsh, _off)
+#define BCM_PWM_CLK_WRITE(_sc, _off, _val) \
+bus_space_write_4(_sc->sc_c_bst, _sc->sc_c_bsh, _off, _val)
+#define BCM_PWM_CLK_READ(_sc, _off)\
+bus_space_read_4(_sc->sc_c_bst, _sc->sc_c_bsh, _off)
+
+#define W_CTL(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x00, _val)
+#define R_CTL(_sc) BCM_PWM_MEM_READ(_sc, 0x00)
+#define W_STA(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x04, _val)
+#define R_STA(_sc) BCM_PWM_MEM_READ(_sc, 0x04)
+#define W_RNG(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x10, _val)
+#define R_RNG(_sc) BCM_PWM_MEM_READ(_sc, 0x10)
+#define W_DAT(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x14, _val)
+#define R_DAT(_sc) BCM_PWM_MEM_READ(_sc, 0x14)
+
+#define W_CMCLK(_sc, _val) BCM_PWM_CLK_WRITE(_sc, 0x00, 0x5a00 | (_val))
+#define R_CMCLK(_sc) BCM_PWM_CLK_READ(_sc, 0x00)
+#define W_CMDIV(_sc, _val) BCM_PWM_CLK_WRITE(_sc, 0x04, 0x5a00 | (_val))
+#define R_CMDIV(_s) BCM_PWM_CLK_READ(_sc, 0x04)
+
+static int
+bcm_pwm_reconf(struct bcm_pwm_softc *sc)
+{
+   int i;
+   uint32_t u;
+   device_t gpio;
+
+   /* Disable PWM */
+   W_CTL(sc, 0);
+
+   /* Stop PWM clock */
+   W_CMCLK(sc, 6);
+   for (i = 0; i < 10; i++) {
+   u = R_CMCLK(sc);
+   if (!(u&0x80))
+   break;
+   DELAY(1000);
+   }
+   if (u&0x80) {
+   device_printf(sc->sc_dev, "Failed to stop clock\n");
+   return(EIO);
+   }
+
+

Re: svn commit: r327086 - head/sys/dev/lmc

2018-01-04 Thread Poul-Henning Kamp

In message <3f4a7247-e711-c65a-d973-c929ac872...@freebsd.org>, Stefan Esser 
writes:
>Am 04.01.18 um 00:41 schrieb Pedro Giffuni:

>It appears to be a strange beast that uses the Ethernet chip to generate a
>bit stream which is then converted to HDLC. Not sure whether these were used
>for Frame Relay or to connect to the British X.25 JANET, a few decades ago.
>Perhaps also to connect to SS7 signaling networks?

They were actually pretty versatile, we used them both for "blank"
E1 and Nx64 scenarios, and I know they were used for Frame Relay
several places in US.

I don't think they could do SS7 or ISDN like the MUSYCC chip could.

But nobody uses T1/E1/T3/E3 lines any more for anything...

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r327086 - head/sys/dev/lmc

2018-01-04 Thread Poul-Henning Kamp

In message <CANCZdfrQEm5V7Uq2E9ie52bmg6kg+jotX=95byf7hs7hqjd...@mail.gmail.com>
, Warner Losh writes:

>Deleting lmc(4) is probably the appropriate fix.

>Inc is for very old interconnect to telco... So maybe that's safe to delete.

As the guy who put lmc(4) in the tree I concur.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r327515 - head/sys/sys

2018-01-03 Thread Poul-Henning Kamp
Author: phk
Date: Wed Jan  3 09:33:59 2018
New Revision: 327515
URL: https://svnweb.freebsd.org/changeset/base/327515

Log:
  Eliminate a paranthesis which is both unneeded and causing trouble.

Modified:
  head/sys/sys/_stdarg.h

Modified: head/sys/sys/_stdarg.h
==
--- head/sys/sys/_stdarg.h  Wed Jan  3 09:08:32 2018(r327514)
+++ head/sys/sys/_stdarg.h  Wed Jan  3 09:33:59 2018(r327515)
@@ -61,7 +61,7 @@
   #if __ISO_C_VISIBLE >= 1999
 #define va_copy(dst, src) ((dst) = (src))
   #endif
-  #define va_arg(ap, type) (*(((type)*)(((ap) += sizeof(type)) - 
sizeof(type
+  #define va_arg(ap, type) (*((type*)(((ap) += sizeof(type)) - sizeof(type
   #define va_end(ap) ((void)0)
 #endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r327345 - head/tools/tools/sysbuild

2017-12-29 Thread Poul-Henning Kamp
Author: phk
Date: Fri Dec 29 15:38:43 2017
New Revision: 327345
URL: https://svnweb.freebsd.org/changeset/base/327345

Log:
  Add a crude workaround for ports with flavors

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==
--- head/tools/tools/sysbuild/sysbuild.sh   Fri Dec 29 15:04:49 2017
(r327344)
+++ head/tools/tools/sysbuild/sysbuild.sh   Fri Dec 29 15:38:43 2017
(r327345)
@@ -196,13 +196,20 @@ ports_recurse() (
echo "$t" >> /tmp/_.plist.tdone
for d
do
+   fl=""
if [ ! -d $d ] ; then
-   echo "Missing port $d ($t)" 1>&2
-   continue
+   fl=FLAVOR=`expr $d : '.*@\(.*\)'`
+   bd=`expr $d : '\(.*\)@.*'`
+   if [ ! -d $bd ] ; then
+   echo "Missing port $d ($t) (fl $fl) (bd $bd)" 
1>&2
+   continue
+   fi
+   echo "Flavored port $d ($t) (fl $fl) (bd $bd)" 1>&2
+   d=$bd
fi
d=`cd /usr/ports && cd $d && /bin/pwd`
if [ ! -f $d/Makefile ] ; then
-   echo "Missing port $d" 1>&2
+   echo "Missing port (Makefile) $d" 1>&2
continue
fi
if [ "x$t" != "x." ] ; then
@@ -216,7 +223,7 @@ ports_recurse() (
(
cd $d
l=""
-   for a in `ports_make -V _UNIFIED_DEPENDS`
+   for a in `ports_make -V _UNIFIED_DEPENDS $fl`
do
x=`expr "$a" : '.*:\(.*\)'`
l="${l} ${x}"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r327182 - in head/sys: arm/include arm64/include sys x86/include

2017-12-25 Thread Poul-Henning Kamp
Author: phk
Date: Mon Dec 25 20:54:00 2017
New Revision: 327182
URL: https://svnweb.freebsd.org/changeset/base/327182

Log:
  Introduce an architecture-agnostic  to reduce
  platform divergence.
  
  Only architectures which pass arguments in registers (mips)
  and platforms which use really weird compilers (any?) would
  need to augment the contents of 
  
  Convert x86, arm and arm64 architectures to use 

Added:
  head/sys/sys/_stdarg.h   (contents, props changed)
Modified:
  head/sys/arm/include/stdarg.h
  head/sys/arm64/include/stdarg.h
  head/sys/x86/include/stdarg.h

Modified: head/sys/arm/include/stdarg.h
==
--- head/sys/arm/include/stdarg.h   Mon Dec 25 19:49:05 2017
(r327181)
+++ head/sys/arm/include/stdarg.h   Mon Dec 25 20:54:00 2017
(r327182)
@@ -1,9 +1,7 @@
 /*-
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: BSD-2-Clause
  *
- * Copyright (c) 2002 David E. O'Brien.  All rights reserved.
- * Copyright (c) 1991, 1993
- * The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 2017 Poul-Henning Kamp.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -13,14 +11,11 @@
  * 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 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
+ * 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 REGENTS OR CONTRIBUTORS BE LIABLE
+ * 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)
@@ -29,55 +24,16 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * @(#)stdarg.h8.1 (Berkeley) 6/10/93
  * $FreeBSD$
  */
 
 #ifndef _MACHINE_STDARG_H_
 #define_MACHINE_STDARG_H_
 
-#include 
-#include 
+#include 
 
-#ifndef _VA_LIST_DECLARED
-#define_VA_LIST_DECLARED
-typedef__va_list   va_list;
+#ifndef va_start
+  #error this file needs to be ported to your compiler
 #endif
-
-#ifdef __GNUCLIKE_BUILTIN_STDARG
-
-#defineva_start(ap, last) \
-   __builtin_va_start((ap), (last))
-
-#defineva_arg(ap, type) \
-   __builtin_va_arg((ap), type)
-
-#if __ISO_C_VISIBLE >= 1999
-#defineva_copy(dest, src) \
-   __builtin_va_copy((dest), (src))
-#endif
-
-#defineva_end(ap) \
-   __builtin_va_end(ap)
-
-#else  /* !__GNUCLIKE_BUILTIN_STDARG */
-
-#define__va_size(type) \
-   (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
-
-#ifdef __GNUCLIKE_BUILTIN_NEXT_ARG
-#define va_start(ap, last) \
-   ((ap) = (va_list)__builtin_next_arg(last))
-#else  /* !__GNUCLIKE_BUILTIN_NEXT_ARG */
-#defineva_start(ap, last) \
-   ((ap) = (va_list)&(last) + __va_size(last))
-#endif /* __GNUCLIKE_BUILTIN_NEXT_ARG */
-
-#defineva_arg(ap, type) \
-   (*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
-
-#defineva_end(ap)
-
-#endif /* __GNUCLIKE_BUILTIN_STDARG */
 
 #endif /* !_MACHINE_STDARG_H_ */

Modified: head/sys/arm64/include/stdarg.h
==
--- head/sys/arm64/include/stdarg.h Mon Dec 25 19:49:05 2017
(r327181)
+++ head/sys/arm64/include/stdarg.h Mon Dec 25 20:54:00 2017
(r327182)
@@ -1,8 +1,8 @@
 /*-
- * Copyright (c) 2002 David E. O'Brien.  All rights reserved.
- * Copyright (c) 1991, 1993
- * The Regents of the University of California.  All rights reserved.
+ * SPDX-License-Identifier: BSD-2-Clause
  *
+ * Copyright (c) 2017 Poul-Henning Kamp.  All rights reserved.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -11,14 +11,11 @@
  * 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 t

Re: svn commit: r326731 - head/sys/ufs/ffs

2017-12-09 Thread Poul-Henning Kamp

In message 
<CANCZdfrQPSey1h+X_09GNJaeZqsZh6FmDXe6avO66qKEfAL=p...@mail.gmail.com>, Warner 
Losh writes:

>That would be strange given that BIO_ORDERED is @gibbs baby ?
>
>Nah... I wrote the iosched code... and I find the concept somewhat flawed
>since it is at the disk level, not the partition level, so it winds up
>interfering with mixed traffic. And it really only makes sense for writes,
>but it affects reads. And it is a poor fit to Ata semantics, and not a lot
>better for scsi. And for nvme it creates a bottleneck in hardware carefully
>designed to be free of bottlenecks...

Don't take my comment as an endorsement of BIO_ORDERED...

I think ordering is strictly a consumer responsibility for exactly
(and then some) of the reasons you mention.

"End to end principle in systems design" and all that...

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r326731 - head/sys/ufs/ffs

2017-12-09 Thread Poul-Henning Kamp

In message 
<canczdfrslkpwj_yvp-8k+wcjkpgqdvjzbcjgtfxcgby7_6q...@mail.gmail.com>, Warner 
Losh writes:

>I also noticed that gsched doesn't take BIO_ORDERED into account when
>sorting requests. Isilon has an I/O scheduler which has this problem
>too
>
>I think the cam iosched ignores it too.

That would be strange given that BIO_ORDERED is @gibbs baby ?

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r326246 - head/lib/libc/stdio

2017-11-27 Thread Poul-Henning Kamp
Author: phk
Date: Mon Nov 27 09:57:37 2017
New Revision: 326246
URL: https://svnweb.freebsd.org/changeset/base/326246

Log:
  Truncate negative lengths to zero

Modified:
  head/lib/libc/stdio/xprintf_hexdump.c

Modified: head/lib/libc/stdio/xprintf_hexdump.c
==
--- head/lib/libc/stdio/xprintf_hexdump.c   Mon Nov 27 04:24:48 2017
(r326245)
+++ head/lib/libc/stdio/xprintf_hexdump.c   Mon Nov 27 09:57:37 2017
(r326246)
@@ -50,6 +50,7 @@ int
 __printf_render_hexdump(struct __printf_io *io, const struct printf_info *pi, 
const void *const *arg)
 {
unsigned char *p;
+   int i;
unsigned u, l, j, a;
char buf[100], *q;
int ret;
@@ -59,7 +60,10 @@ __printf_render_hexdump(struct __printf_io *io, const 
else
l = 16;
p = *((unsigned char **)arg[0]);
-   u = *((unsigned *)arg[1]);
+   i = *((int *)arg[1]);
+   if (i < 0)
+   i = 0;
+   u = i;
 
ret = 0;
a = 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r318903 - head/tools/tools/sysbuild

2017-05-25 Thread Poul-Henning Kamp
Author: phk
Date: Thu May 25 21:59:19 2017
New Revision: 318903
URL: https://svnweb.freebsd.org/changeset/base/318903

Log:
  Try to keep up with the ports system Makefiles.

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==
--- head/tools/tools/sysbuild/sysbuild.sh   Thu May 25 21:41:06 2017
(r318902)
+++ head/tools/tools/sysbuild/sysbuild.sh   Thu May 25 21:59:19 2017
(r318903)
@@ -95,6 +95,9 @@ PORTS_WE_WANT='
 
 PORTS_OPTS="BATCH=YES A4=yes"
 
+PORTS_WITHOUT=""
+PORTS_WITH=""
+
 CONFIGFILES='
 '
 
@@ -174,6 +177,9 @@ log_it() (
 
 ###
 
+ports_make() {
+   make $* WITH="${PORTS_WITH}" WITHOUT="${PORTS_WITHOUT}" ${PORTS_OPTS}
+}
 
 ports_recurse() (
cd /usr/ports
@@ -191,7 +197,7 @@ ports_recurse() (
for d
do
if [ ! -d $d ] ; then
-   echo "Missing port $d" 1>&2
+   echo "Missing port $d ($t)" 1>&2
continue
fi
d=`cd /usr/ports && cd $d && /bin/pwd`
@@ -210,15 +216,12 @@ ports_recurse() (
(
cd $d
l=""
-   for a in `make -V _UNIFIED_DEPENDS ${PORTS_OPTS}`
+   for a in `ports_make -V _UNIFIED_DEPENDS`
do
x=`expr "$a" : '.*:\(.*\)'`
l="${l} ${x}"
done
ports_recurse $d $l
-   # -> _UNIFIED_DEPENDS
-   #ports_recurse $d `make -V _DEPEND_DIRS ${PORTS_OPTS}`
-   #ports_recurse $d `make all-depends-list`
)
echo "$d" >> /tmp/_.plist
fi
@@ -242,14 +245,14 @@ ports_build() (
do
b=`echo $p | tr / _`
t=`echo $p | sed "s,${pd},,"`
-   pn=`cd $p && make package-name ${PORTS_OPTS}`
+   pn=`cd $p && ports_make package-name`
 
if [ "x`basename $p`" == "xpkg" ] ; then
log_it "Very Special: $t ($pn)"
 
(
cd $p
-   make clean all install ${PORTS_OPTS}
+   ports_make clean all install 
) > _.$b 2>&1 < /dev/null
continue
fi
@@ -270,7 +273,7 @@ ports_build() (
fi
fi
 
-   miss=`(cd $p ; make missing ${PORTS_OPTS}) || true`
+   miss=`(cd $p ; ports_make missing) || true`
 
if [ "x${miss}" != "x" ] ; then
log_it "NB: MISSING for $p:" $miss
@@ -280,15 +283,16 @@ ports_build() (
(
set +e
cd $p
-   make clean ${PORTS_OPTS}
-   if make install ${PORTS_OPTS} ; then
+   ports_make clean
+   if ports_make install ; then
if [ "x${PKG_DIR}" != "x" ] ; then
-   make package ${PORTS_OPTS}
+   ports_make package
fi
else
log_it FAIL build $p
fi
-   make clean ${PORTS_OPTS}
+   ports_make clean
+
) > _.$b 2>&1 < /dev/null
done
 )
@@ -309,15 +313,15 @@ ports_prefetch() (
b=`echo $p | tr / _`
(
cd $p
-   if make checksum $PORTS_OPTS ; then
+   if ports_make checksum ; then
rm -f /${ldir}/_.prefetch.$b
echo "OK $p" >> /${ldir}/_.prefetch
exit 0
fi
-   make distclean
-   make checksum $PORTS_OPTS || true
+   ports_make distclean
+   ports_make checksum || true
 
-   if make checksum $PORTS_OPTS > /dev/null 2>&1 ; then
+   if ports_make checksum > /dev/null 2>&1 ; then
rm -f /${ldir}/_.prefetch.$b
echo "OK $p" >> /${ldir}/_.prefetch
else
@@ -472,8 +476,7 @@ ln -s /freebsd/${SRC_PATH} /usr/src
 if $do_world ; then
if [ "x${OBJ_PATH}" != "x" ] ; then
rm -rf /usr/obj
-   mkdir -p /freebsd/${OBJ_PATH}
-   ln -s /freebsd/${OBJ_PATH} /usr/obj
+   (cd /freebsd && mkdir -p ${OBJ_PATH} && ln -s 

svn commit: r317771 - head/usr.sbin/pkg

2017-05-03 Thread Poul-Henning Kamp
Author: phk
Date: Wed May  3 20:41:26 2017
New Revision: 317771
URL: https://svnweb.freebsd.org/changeset/base/317771

Log:
  Flush stdout before yes/no confirmations, to force question
  through pipes/tee(1)/whatever

Modified:
  head/usr.sbin/pkg/pkg.c

Modified: head/usr.sbin/pkg/pkg.c
==
--- head/usr.sbin/pkg/pkg.c Wed May  3 20:26:59 2017(r317770)
+++ head/usr.sbin/pkg/pkg.c Wed May  3 20:41:26 2017(r317771)
@@ -946,6 +946,7 @@ pkg_query_yes_no(void)
 {
int ret, c;
 
+   fflush(stdout);
c = getchar();
 
if (c == 'y' || c == 'Y')
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r316132 - head/sys/boot/i386/boot2

2017-03-29 Thread Poul-Henning Kamp

In message <7448826.asyms2t...@ralph.baldwin.cx>, John Baldwin writes:
>On Wednesday, March 29, 2017 09:30:03 AM Ngie Cooper wrote:

>> Log:
>>   Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to 
>> sys/boot/i386/zfsboot/...
>>   
>>   This is being done to make it easier to change in the future--this action 
>> might be
>>   needed sooner rather than later because of gcc 6.3.0 bailing, stating that 
>> there
>>   is negative free space left (deficit) in the boot2 bootloader.
>>   
>>   MFC after: 2 months
>>   Sponsored by:  Dell EMC Isilon
>
>This can't be changed.  It's baked into the BSD disklabel format.

No it is not, it is baked into FFS, and for UFS2 0, 8, 64 and 256K works.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r316064 - head/sys/boot/i386/boot2

2017-03-28 Thread Poul-Henning Kamp

In message <201703281555.v2sftosu005...@pdx.rh.cn85.dnsmgr.net>, "Rodney W. Gri
mes" writes:

>I think we still have an 8k size limit on boot1 for ffs/(ufs1 or ufs2)

Having a former release-engineer & disk-I/O renovator on the UFS2
team took care of that:  We tried to be future compatible, and UFS2
will look four different places for the superblock: +64k, +8k, +0k
and +256k, (the latter named SBLOCK_PIGGY because somebody senior
thought even 64k was an outrageous waste of space :-)

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309790 - head/sys/dev/usb

2016-12-10 Thread Poul-Henning Kamp
Author: phk
Date: Sat Dec 10 09:10:48 2016
New Revision: 309790
URL: https://svnweb.freebsd.org/changeset/base/309790

Log:
  Add Genesys Logic USB hub.
  
  Make two other USB hub descriptions more precise.

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSat Dec 10 06:27:45 2016(r309789)
+++ head/sys/dev/usb/usbdevsSat Dec 10 09:10:48 2016(r309790)
@@ -1240,7 +1240,7 @@ product ATHEROS2 AR9170   0x9170  AR9170
 
 /* Atmel Comp. products */
 product ATMEL STK541   0x2109  Zigbee Controller
-product ATMEL UHB124   0x3301  UHB124 hub
+product ATMEL UHB124   0x3301  AT43301 USB 1.1 Hub
 product ATMEL DWL120   0x7603  DWL-120 Wireless Adapter
 product ATMEL BW0020x7605  BW002 Wireless Adapter
 product ATMEL WL1130USB0x7613  WL-1130 USB
@@ -2174,7 +2174,8 @@ product GENERALINSTMNTS SB51000x5100  SU
 /* Genesys Logic products */
 product GENESYS GL620USB   0x0501  GL620USB Host-Host interface
 product GENESYS GL650  0x0604  GL650 HUB
-product GENESYS GL606  0x0606  USB 2.0 HUB
+product GENESYS GL606  0x0606  GL606 USB 2.0 HUB
+product GENESYS GL850G 0x0608  GL850G USB 2.0 HUB
 product GENESYS GL641USB   0x0700  GL641USB CompactFlash Card Reader
 product GENESYS GL641USB2IDE_2 0x0701  GL641USB USB-IDE Bridge No 2
 product GENESYS GL641USB2IDE   0x0702  GL641USB USB-IDE Bridge
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309025 - head/usr.sbin/fifolog/lib

2016-11-22 Thread Poul-Henning Kamp
Author: phk
Date: Tue Nov 22 22:10:58 2016
New Revision: 309025
URL: https://svnweb.freebsd.org/changeset/base/309025

Log:
  Pass the correct size argument to ioctl(DIOCGSECTORSIZE)

Modified:
  head/usr.sbin/fifolog/lib/fifolog_create.c

Modified: head/usr.sbin/fifolog/lib/fifolog_create.c
==
--- head/usr.sbin/fifolog/lib/fifolog_create.c  Tue Nov 22 21:02:35 2016
(r309024)
+++ head/usr.sbin/fifolog/lib/fifolog_create.c  Tue Nov 22 22:10:58 2016
(r309025)
@@ -45,6 +45,7 @@ fifolog_create(const char *fn, off_t siz
 {
int i, fd;
ssize_t u;
+   u_int uu;
off_t ms;
struct stat st;
char *buf;
@@ -79,7 +80,8 @@ fifolog_create(const char *fn, off_t siz
}
 
/* For raw disk with larger sectors: use 1 sector */
-   i = ioctl(fd, DIOCGSECTORSIZE, );
+   i = ioctl(fd, DIOCGSECTORSIZE, );
+   u = uu;
if (i == 0 && (u > recsize || (recsize % u) != 0))
recsize = u;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308877 - head/tools/tools/sysbuild

2016-11-20 Thread Poul-Henning Kamp
Author: phk
Date: Sun Nov 20 10:01:21 2016
New Revision: 308877
URL: https://svnweb.freebsd.org/changeset/base/308877

Log:
  Attempt package build even if dependencies seems to be missing

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==
--- head/tools/tools/sysbuild/sysbuild.sh   Sun Nov 20 09:11:21 2016
(r308876)
+++ head/tools/tools/sysbuild/sysbuild.sh   Sun Nov 20 10:01:21 2016
(r308877)
@@ -273,8 +273,7 @@ ports_build() (
miss=`(cd $p ; make missing ${PORTS_OPTS}) || true`
 
if [ "x${miss}" != "x" ] ; then
-   log_it "MISSING for $p:" $miss
-   continue
+   log_it "NB: MISSING for $p:" $miss
fi
 
log_it "build $pn ($p)"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302452 - head/tools/tools/sysbuild

2016-07-08 Thread Poul-Henning Kamp
Author: phk
Date: Fri Jul  8 20:33:20 2016
New Revision: 302452
URL: https://svnweb.freebsd.org/changeset/base/302452

Log:
  Add missing PORTS_OPTS to two make commands

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==
--- head/tools/tools/sysbuild/sysbuild.sh   Fri Jul  8 20:30:20 2016
(r302451)
+++ head/tools/tools/sysbuild/sysbuild.sh   Fri Jul  8 20:33:20 2016
(r302452)
@@ -242,7 +242,7 @@ ports_build() (
do
b=`echo $p | tr / _`
t=`echo $p | sed "s,${pd},,"`
-   pn=`cd $p && make package-name`
+   pn=`cd $p && make package-name ${PORTS_OPTS}`
 
if [ "x`basename $p`" == "xpkg" ] ; then
log_it "Very Special: $t ($pn)"
@@ -289,7 +289,7 @@ ports_build() (
else
log_it FAIL build $p
fi
-   make clean
+   make clean ${PORTS_OPTS}
) > _.$b 2>&1 < /dev/null
done
 )
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302256 - head/sbin/natd

2016-06-28 Thread Poul-Henning Kamp
Author: phk
Date: Tue Jun 28 20:10:30 2016
New Revision: 302256
URL: https://svnweb.freebsd.org/changeset/base/302256

Log:
  Do not coredump if the packet is too long in the global (non-interface
  associated) instance.
  
  The result is that the packet is dropped without an indication
  that smaller MTU is advisable, which is not optimal, but better
  than a NULL pointer deref.
  
  Approved by:  re (glebius)

Modified:
  head/sbin/natd/natd.c

Modified: head/sbin/natd/natd.c
==
--- head/sbin/natd/natd.c   Tue Jun 28 19:53:16 2016(r302255)
+++ head/sbin/natd/natd.c   Tue Jun 28 20:10:30 2016(r302256)
@@ -618,7 +618,7 @@ static void DoGlobal (int fd)

if (wrote != bytes) {
 
-   if (errno == EMSGSIZE) {
+   if (errno == EMSGSIZE && mip != NULL) {
 
if (mip->ifMTU != -1)
SendNeedFragIcmp (icmpSock,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297737 - head/tools/tools/nanobsd

2016-04-09 Thread Poul-Henning Kamp
Author: phk
Date: Sat Apr  9 10:53:21 2016
New Revision: 297737
URL: https://svnweb.freebsd.org/changeset/base/297737

Log:
  Create /usr/local/etc before filling things into it.
  
  Only run mtree if the NANO_CUST_FILES_MTREE is nonempty
  
  Also umount the packages on non-signal failure

Modified:
  head/tools/tools/nanobsd/defaults.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shSat Apr  9 10:51:07 2016
(r297736)
+++ head/tools/tools/nanobsd/defaults.shSat Apr  9 10:53:21 2016
(r297737)
@@ -915,7 +915,7 @@ cust_install_files ( ) (
cd "${NANO_TOOLS}/Files"
find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv 
${NANO_WORLDDIR}
 
-   if [ -f ${NANO_CUST_FILES_MTREE} ]; then
+   if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; 
then
CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE}
fi
 )
@@ -925,6 +925,7 @@ cust_install_files ( ) (
 
 cust_pkgng ( ) (
 
+   mkdir -p ${NANO_WORLDDIR}/usr/local/etc
local PKG_CONF="${NANO_WORLDDIR}/usr/local/etc/pkg.conf"
local PKGCMD="env ASSUME_ALWAYS_YES=YES 
PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none /usr/sbin/pkg"
 
@@ -956,7 +957,7 @@ cust_pkgng ( ) (
mkdir -p ${NANO_WORLDDIR}/_.p
mount -t nullfs -o noatime -o ro ${NANO_PACKAGE_DIR} 
${NANO_WORLDDIR}/_.p
 
-   trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15
+   trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15 
EXIT
 
# Install packages
todo="$(echo "${NANO_PACKAGE_LIST}" | awk '{ print NF }')"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297039 - head/sys/x86/x86

2016-03-27 Thread Poul-Henning Kamp

In message <20160328033624.n...@besplex.bde.org>, Bruce Evans writes:

>Of course the details are machine-dependent.  My oldest system on which I
>discovered PLL-like behaviour was from late 1997.  The PLL might not have
>been in standard bus chips then.  It had a K5 (?) running at 233 MHz.
>The ratio of the TSC to the i8254 was precisely 196.

Which means the PLL probably was 49:3 from the 14.31818 MHz xtal to
233.8636 MHz CPU frequncy.

>Newer systems have much higher resolution so the ratios are rarely integers.

PLL's in EMI-spec'ed environments are never unity ratio because that
would needlessly add to the EMI trouble.

>It should be, but isn't in practice.

The RTC was only expected to be better than the other timers,
in the very long run - weeks to years.  In particular, most of
the RTC xtals run 20-40K hotter than their turn-over point ~23C,
so they keep awful time while the system is running.

(The 32.768kHz xtals are designed for wristwatches where you
body-temperature keeps them at stable temperature.  Don't take
your wrist-watch off at night if you want it to precise.)

>The i8254 is supposed
>to run at precisely 1193182 Hz but usually has an inaccuracy of 10-50 Hz.

50PPM is a very common crystal spec, that would be +/- 60Hz.

(merging emails here)

>> A very important and relevant detail here is that the *only*
>> clock/counter which has a standardized frequency *is* the i8254
>> counter.
>
>Not even the ACPI timer?

Not that I'm aware of.  In most cases it runs at 14.31818 MHz, but
I've seen it as low as 1MHz and as high as 25 MHz.

>> The RTC *crystal* may not even exist, [...]
>
>It can give a precision of 1/32K seconds fairly easily (but with lots of
>overhead) by interrupting at 32 KHz.  1KHz is sometimes used for profiling.

Only if the 32.768 kHz RTC xtal exists.  These days silicon oscillators
are gaining ground in that segment.

> Jitter is what I'm most worried about for virtual systems.
> Jitter is quite good for a hardware RTC. [...]
> Its hardware jitter is insignificant compared with the jitter
> from interrupt latency.

If interrupts are involved their latency+jitter will overshadow
any other noise source, if nothing else because of the quantization
to clock/bus frequencies.

Jitter on the raw xtal is in picoseconds if not femtoseconds, as
it needs to be when you PLL it up to GHz.

>> Usually the errors will be magnificient, so a trivial sanity-check will
>> catch them.  Don't leave home without it.
>
>But then you have the problem of handling them.  There might be just 1
>timecounter source that is emulated correctly, but you don't know which
>it is.  There might be none.

Indeed:  One clock or three, never two.

John R. Vig's famous tutorial is the ultimate collection of wisdom
about care and feeding of quartz:

    http://www.ieee-uffc.org/frequency-control/learning-vig-tut.asp

Highly recommended.


-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297039 - head/sys/x86/x86

2016-03-27 Thread Poul-Henning Kamp

In message <20160327130706.ga1...@kib.kiev.ua>, Konstantin Belousov writes:

>> I haven't seen a single (hardware) system since I started measuring
>> this 15-20 yeas ago on which the i8524 is not fed from the same clock
>> as the TSC.

A very important and relevant detail here is that the *only*
clock/counter which has a standardized frequency *is* the i8254
counter.

>RTC needs its own dedicated crystal.

The RTC *crystal* may not even exist, only the RTC itself which may
be driven by gremlins on a threadmill for all we care.

Besides, getting hold of *precise* timing from the RTC is a nightmare,
it's not meant to be used for that.

>I was not able to find any specifications for allowed jitter in PCH PLLs,
>but I would expect that above IDT chips have much better stability than
>something in overheating PCH.

Jitter requirements are pretty tight for anything you're going to
PLL into the GHz range, but any quartz crystal is going to have much
better phase-noise spec than anything we can measure in the digital
noise of a modern computer.

(Often the PLL chips modulate the quartz to spread out EMI spurs,
look for "spread-spectrum" settings.)

>> > some hypervisors start offering modes where old ISA peripherals
>> > are not emulated, 

How do they expect people to run MS Flight Simulator then ?  :-)

>I think we have no choice but do something for ISA/LPC-less configurations.
>We could even trust CPU report about its frequency as the last resort.

Usually the errors will be magnificient, so a trivial sanity-check will
catch them.  Don't leave home without it.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297146 - head/tools/tools/nanobsd

2016-03-21 Thread Poul-Henning Kamp
Author: phk
Date: Mon Mar 21 08:30:58 2016
New Revision: 297146
URL: https://svnweb.freebsd.org/changeset/base/297146

Log:
  Unquote NANO_PACKAGE_LIST so that it actually can be a list and so
  that the default value of "*" works.

Modified:
  head/tools/tools/nanobsd/defaults.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shMon Mar 21 08:03:50 2016
(r297145)
+++ head/tools/tools/nanobsd/defaults.shMon Mar 21 08:30:58 2016
(r297146)
@@ -916,7 +916,7 @@ cust_pkgng ( ) (
mkdir -p ${NANO_WORLDDIR}/Pkg
(
cd "${NANO_PACKAGE_DIR}"
-   find "${NANO_PACKAGE_LIST}" -print |
+   find ${NANO_PACKAGE_LIST} -print |
cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
)
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r292058 - head/sbin/geom/class/part

2015-12-12 Thread Poul-Henning Kamp

In message <20151212121209.ga60...@freebsd.org>, Alexey Dokuchaev writes:

>+1, I'm also used to "dd'ing zeros" trick.

The modern way to do that is to reinitialize the on-drive encryption
to a new key.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289627 - head/etc/rc.d

2015-10-20 Thread Poul-Henning Kamp
Author: phk
Date: Tue Oct 20 12:49:38 2015
New Revision: 289627
URL: https://svnweb.freebsd.org/changeset/base/289627

Log:
  Allow osreldate and osrelease to be set per jail

Modified:
  head/etc/rc.d/jail

Modified: head/etc/rc.d/jail
==
--- head/etc/rc.d/jail  Tue Oct 20 12:27:59 2015(r289626)
+++ head/etc/rc.d/jail  Tue Oct 20 12:49:38 2015(r289627)
@@ -243,6 +243,8 @@ parse_options()
 
extract_var $_j set_hostname_allow allow.set_hostname YN NO
extract_var $_j sysvipc_allow allow.sysvipc YN NO
+   extract_var $_j osreldate osreldate
+   extract_var $_j osrelease osrelease
for _p in $_parameters; do
echo "  ${_p%\;};"
done
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289116 - head/share/man/man4

2015-10-10 Thread Poul-Henning Kamp
Author: phk
Date: Sat Oct 10 17:32:06 2015
New Revision: 289116
URL: https://svnweb.freebsd.org/changeset/base/289116

Log:
  Remove a double "as well as"

Modified:
  head/share/man/man4/vtnet.4

Modified: head/share/man/man4/vtnet.4
==
--- head/share/man/man4/vtnet.4 Sat Oct 10 14:43:46 2015(r289115)
+++ head/share/man/man4/vtnet.4 Sat Oct 10 17:32:06 2015(r289116)
@@ -52,9 +52,9 @@ device driver provides support for VirtI
 If the hypervisor advertises the appreciate features, the
 .Nm
 driver supports TCP/UDP checksum offload for both transmit and receive,
-TCP segmentation offload (TSO), TCP large receive offload (LRO), and
-hardware VLAN tag stripping/insertion features, as well as a multicast
-hash filter, as well as Jumbo Frames (up to 9216 bytes), which can be
+TCP segmentation offload (TSO), TCP large receive offload (LRO),
+hardware VLAN tag stripping/insertion features, a multicast hash filter,
+as well as Jumbo Frames (up to 9216 bytes), which can be
 configured via the interface MTU setting.
 Selecting an MTU larger than 1500 bytes with the
 .Xr ifconfig 8
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r288484 - head/sys/kern

2015-10-02 Thread Poul-Henning Kamp
Author: phk
Date: Fri Oct  2 09:23:14 2015
New Revision: 288484
URL: https://svnweb.freebsd.org/changeset/base/288484

Log:
  Fail the sbuf if vsnprintf(3) fails.

Modified:
  head/sys/kern/subr_sbuf.c

Modified: head/sys/kern/subr_sbuf.c
==
--- head/sys/kern/subr_sbuf.c   Fri Oct  2 09:03:28 2015(r288483)
+++ head/sys/kern/subr_sbuf.c   Fri Oct  2 09:23:14 2015(r288484)
@@ -623,6 +623,10 @@ sbuf_vprintf(struct sbuf *s, const char 
va_copy(ap_copy, ap);
len = vsnprintf(>s_buf[s->s_len], SBUF_FREESPACE(s) + 1,
fmt, ap_copy);
+   if (len < 0) {
+   s->s_error = errno;
+   return (-1);
+   }
va_end(ap_copy);
 
if (SBUF_FREESPACE(s) >= len)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r288212 - head/sbin/natd

2015-09-25 Thread Poul-Henning Kamp
Author: phk
Date: Fri Sep 25 07:37:00 2015
New Revision: 288212
URL: https://svnweb.freebsd.org/changeset/base/288212

Log:
  Fix two cases where "const" were washed off pointers with strchr(3)

Modified:
  head/sbin/natd/natd.c

Modified: head/sbin/natd/natd.c
==
--- head/sbin/natd/natd.c   Fri Sep 25 07:27:23 2015(r288211)
+++ head/sbin/natd/natd.c   Fri Sep 25 07:37:00 2015(r288212)
@@ -124,7 +124,7 @@ static void StrToAddr (const char* str, 
 static u_short  StrToPort (const char* str, const char* proto);
 static int  StrToPortRange (const char* str, const char* proto, port_range 
*portRange);
 static int StrToProto (const char* str);
-static int  StrToAddrAndPortRange (const char* str, struct in_addr* addr, 
char* proto, port_range *portRange);
+static int  StrToAddrAndPortRange (char* str, struct in_addr* addr, char* 
proto, port_range *portRange);
 static voidParseArgs (int argc, char** argv);
 static voidSetupPunchFW(const char *strValue);
 static voidSetupSkinnyPort(const char *strValue);
@@ -1896,7 +1896,7 @@ u_short StrToPort (const char* str, cons
 
 int StrToPortRange (const char* str, const char* proto, port_range *portRange)
 {
-   char*   sep;
+   const char* sep;
struct servent* sp;
char*   end;
u_short loPort;
@@ -1938,7 +1938,8 @@ int StrToPortRange (const char* str, con
 }
 
 
-int StrToProto (const char* str)
+static int
+StrToProto (const char* str)
 {
if (!strcmp (str, "tcp"))
return IPPROTO_TCP;
@@ -1949,7 +1950,8 @@ int StrToProto (const char* str)
errx (1, "unknown protocol %s. Expected tcp or udp", str);
 }
 
-int StrToAddrAndPortRange (const char* str, struct in_addr* addr, char* proto, 
port_range *portRange)
+static int
+StrToAddrAndPortRange (char* str, struct in_addr* addr, char* proto, 
port_range *portRange)
 {
char*   ptr;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r286904 - head/tools/tools/sysbuild

2015-08-18 Thread Poul-Henning Kamp
Author: phk
Date: Tue Aug 18 20:19:48 2015
New Revision: 286904
URL: https://svnweb.freebsd.org/changeset/base/286904

Log:
  Update sysbuild to new ports infrastructure.

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==
--- head/tools/tools/sysbuild/sysbuild.sh   Tue Aug 18 20:13:36 2015
(r286903)
+++ head/tools/tools/sysbuild/sysbuild.sh   Tue Aug 18 20:19:48 2015
(r286904)
@@ -80,6 +80,8 @@ fi
 # serial console ?
 SERCONS=false
 
+PKG_DIR=/usr/ports/packages/All
+
 # Remotely mounted distfiles
 # REMOTEDISTFILES=fs:/rdonly/distfiles
 
@@ -174,6 +176,7 @@ log_it() (
 
 
 ports_recurse() (
+   cd /usr/ports
t=$1
shift
if [ x$t = x. ] ; then
@@ -191,6 +194,7 @@ ports_recurse() (
echo Missing port $d 12
continue
fi
+   d=`cd /usr/ports  cd $d  /bin/pwd`
if [ ! -f $d/Makefile ] ; then
echo Missing port $d 12
continue
@@ -205,7 +209,16 @@ ports_recurse() (
else
(
cd $d
-   ports_recurse $d `make -V _DEPEND_DIRS ${PORTS_OPTS}`
+   l=
+   for a in `make -V _UNIFIED_DEPENDS ${PORTS_OPTS}`
+   do
+   x=`expr $a : '.*:\(.*\)'`
+   l=${l} ${x}
+   done
+   ports_recurse $d $l
+   # - _UNIFIED_DEPENDS
+   #ports_recurse $d `make -V _DEPEND_DIRS ${PORTS_OPTS}`
+   #ports_recurse $d `make all-depends-list`
)
echo $d  /tmp/_.plist
fi
@@ -223,11 +236,12 @@ ports_build() (
mkdir -p ${PKG_DIR}
fi
 
+   pd=`cd /usr/ports  /bin/pwd`
# Now build  install them
for p in `cat /tmp/_.plist`
do
b=`echo $p | tr / _`
-   t=`echo $p | sed 's,/usr/ports/,,'`
+   t=`echo $p | sed s,${pd},,`
pn=`cd $p  make package-name`
 
if [ x`basename $p` == xpkg ] ; then
@@ -471,10 +485,13 @@ fi
 
 for i in ${PORTS_WE_WANT}
 do
+   (
+   cd /usr/ports
if [ ! -d $i ]  ; then
echo Port $i not found 12
exit 2
fi
+   )
 done
 
 export PORTS_WE_WANT
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276208 - in head/sys: amd64/conf conf

2014-12-25 Thread Poul-Henning Kamp
Author: phk
Date: Thu Dec 25 17:50:04 2014
New Revision: 276208
URL: https://svnweb.freebsd.org/changeset/base/276208

Log:
  Use compiled in default keymaps which are available both in syscons and vt.

Modified:
  head/sys/amd64/conf/NOTES
  head/sys/conf/NOTES

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Thu Dec 25 17:28:26 2014(r276207)
+++ head/sys/amd64/conf/NOTES   Thu Dec 25 17:50:04 2014(r276208)
@@ -215,7 +215,7 @@ hint.atkbd.0.irq=1
 
 # Options for atkbd:
 optionsATKBD_DFLT_KEYMAP   # specify the built-in keymap
-makeoptionsATKBD_DFLT_KEYMAP=jp.106
+makeoptionsATKBD_DFLT_KEYMAP=fr.dvorak
 
 # `flags' for atkbd:
 #   0x01Force detection of keyboard, else we always assume a keyboard

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Thu Dec 25 17:28:26 2014(r276207)
+++ head/sys/conf/NOTES Thu Dec 25 17:50:04 2014(r276208)
@@ -2785,7 +2785,7 @@ options   U3G_DEBUG
 
 # options for ukbd:
 optionsUKBD_DFLT_KEYMAP# specify the built-in keymap
-makeoptionsUKBD_DFLT_KEYMAP=it.iso
+makeoptionsUKBD_DFLT_KEYMAP=jp.pc98
 
 # options for uplcom:
 optionsUPLCOM_INTR_INTERVAL=100# interrupt pipe interval
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276210 - head/tools/tools/sysbuild

2014-12-25 Thread Poul-Henning Kamp
Author: phk
Date: Thu Dec 25 17:54:22 2014
New Revision: 276210
URL: https://svnweb.freebsd.org/changeset/base/276210

Log:
  Create the PKG_DIR if it is missing

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==
--- head/tools/tools/sysbuild/sysbuild.sh   Thu Dec 25 17:53:43 2014
(r276209)
+++ head/tools/tools/sysbuild/sysbuild.sh   Thu Dec 25 17:54:22 2014
(r276210)
@@ -219,6 +219,10 @@ ports_build() (
 
ports_recurse . $PORTS_WE_WANT 
 
+   if [ x${PKG_DIR} != x ] ; then
+   mkdir -p ${PKG_DIR}
+   fi
+
# Now build  install them
for p in `cat /tmp/_.plist`
do
@@ -231,9 +235,7 @@ ports_build() (
 
(
cd $p
-   make clean ${PORTS_OPTS}
-   make all ${PORTS_OPTS}
-   make install ${PORTS_OPTS}
+   make clean all install ${PORTS_OPTS}
)  _.$b 21  /dev/null
continue
fi
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276214 - in head: . include lib share/man/man4 share/mk sys/conf sys/dev/ieee488 tools/build/mk tools/build/options

2014-12-25 Thread Poul-Henning Kamp
Author: phk
Date: Thu Dec 25 20:15:13 2014
New Revision: 276214
URL: https://svnweb.freebsd.org/changeset/base/276214

Log:
  Deorbit the IEEE-488/GPIB support.

Deleted:
  head/share/man/man4/gpib.4
  head/share/man/man4/pcii.4
  head/share/man/man4/tnt4882.4
  head/sys/dev/ieee488/ibfoo.c
  head/sys/dev/ieee488/ibfoo_int.h
  head/sys/dev/ieee488/pcii.c
  head/sys/dev/ieee488/tnt4882.c
  head/sys/dev/ieee488/tnt4882.h
  head/sys/dev/ieee488/ugpib.h
  head/sys/dev/ieee488/upd7210.c
  head/sys/dev/ieee488/upd7210.h
  head/tools/build/options/WITHOUT_GPIB
Modified:
  head/ObsoleteFiles.inc
  head/include/Makefile
  head/lib/Makefile
  head/share/man/man4/Makefile
  head/share/mk/src.opts.mk
  head/sys/conf/NOTES
  head/sys/conf/files
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Dec 25 19:22:02 2014(r276213)
+++ head/ObsoleteFiles.inc  Thu Dec 25 20:15:13 2014(r276214)
@@ -38,6 +38,29 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20141226: Remove gpib/ieee488
+OLD_FILES+=usr/include/dev/ieee488/ibfoo_int.h
+OLD_FILES+=usr/include/dev/ieee488/tnt4882.h
+OLD_FILES+=usr/include/dev/ieee488/ugpib.h
+OLD_FILES+=usr/include/dev/ieee488/upd7210.h
+OLD_DIRS+=usr/include/dev/ieee488
+OLD_FILES+=usr/include/gpib/gpib.h
+OLD_DIRS+=usr/include/gpib
+OLD_FILES+=usr/lib/libgpib.a
+OLD_FILES+=usr/lib/libgpib_p.a
+OLD_FILES+=usr/lib/libgpib.so
+OLD_LIBS+=usr/lib/libgpib.so.3
+OLD_FILES+=usr/lib/libgpib_p.a
+OLD_FILES+=share/man/man4/pcii.4.gz
+OLD_FILES+=share/man/man4/gpib.4.gz
+OLD_FILES+=share/man/man4/tnt4882.4.gz
+.if ${TARGET_ARCH} == amd64 || ${TARGET_ARCH} == powerpc64
+OLD_FILES+=usr/lib32/libgpib.a
+OLD_FILES+=usr/lib32/libgpib_p.a
+OLD_FILES+=usr/lib32/libgpib.so
+OLD_LIBS+=usr/lib32/libgpib.so.3
+.endif
+
 # 20141224: libxo moved to /lib
 OLD_LIBS+=usr/lib/libxo.so.0
 # 20141223: remove in6_gif.h, in_gif.h and if_stf.h

Modified: head/include/Makefile
==
--- head/include/Makefile   Thu Dec 25 19:22:02 2014(r276213)
+++ head/include/Makefile   Thu Dec 25 20:15:13 2014(r276214)
@@ -42,7 +42,7 @@ LDIRS=bsm cam geom net net80211 netgrap
 LSUBDIRS=  cam/ata cam/scsi \
dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \
dev/hwpmc \
-   dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \
+   dev/ic dev/iicbus dev/io dev/lmc dev/mfi dev/nvme \
dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
fs/cuse \
@@ -63,10 +63,6 @@ LSUBSUBDIRS= dev/mpt/mpilib
 _dev_powermac_nvram=   dev/powermac_nvram
 .endif
 
-.if ${MK_GPIB} != no
-_dev_ieee488=  dev/ieee488
-.endif
-
 .if ${MK_GSSAPI} != no
 SUBDIR+=   gssapi
 INCS+= gssapi.h

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Thu Dec 25 19:22:02 2014(r276213)
+++ head/lib/Makefile   Thu Dec 25 20:15:13 2014(r276214)
@@ -52,7 +52,6 @@ SUBDIR=   ${SUBDIR_ORDERED} \
libfetch \
libfigpar \
libgeom \
-   ${_libgpib} \
libgpio \
${_libgssapi} \
${_librpcsec_gss} \
@@ -195,10 +194,6 @@ _cuse= libcuse
 _libelftc= libelftc
 .endif
 
-.if ${MK_GPIB} != no
-_libgpib=  libgpib
-.endif
-
 .if ${MK_GSSAPI} != no
 _libgssapi=libgssapi
 _librpcsec_gss=librpcsec_gss

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Dec 25 19:22:02 2014
(r276213)
+++ head/share/man/man4/MakefileThu Dec 25 20:15:13 2014
(r276214)
@@ -156,7 +156,6 @@ MAN=aac.4 \
geom_uncompress.4 \
geom_uzip.4 \
gif.4 \
-   gpib.4 \
gpio.4 \
gpioiic.4 \
gpioled.4 \
@@ -372,7 +371,6 @@ MAN=aac.4 \
pci.4 \
pcib.4 \
pcic.4 \
-   pcii.4 \
pcm.4 \
pcn.4 \
${_pf.4} \
@@ -495,7 +493,6 @@ MAN=aac.4 \
ti.4 \
timecounters.4 \
tl.4 \
-   tnt4882.4 \
${_tpm.4} \
trm.4 \
tty.4 \

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Thu Dec 25 19:22:02 2014(r276213)
+++ head/share/mk/src.opts.mk   Thu Dec 25 20:15:13 2014(r276214)
@@ -85,7 +85,6 @@ __DEFAULT_YES_OPTIONS = \
 GDB \
 GNU \
 GNU_GREP_COMPAT \
-GPIB \
 GPIO \
 GPL_DTC \
 GROFF \

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES 

svn commit: r275355 - head/tools/tools/sysbuild

2014-12-01 Thread Poul-Henning Kamp
Author: phk
Date: Mon Dec  1 10:17:23 2014
New Revision: 275355
URL: https://svnweb.freebsd.org/changeset/base/275355

Log:
  Face the fact that we have no idea where the ports tree really lives.

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==
--- head/tools/tools/sysbuild/sysbuild.sh   Mon Dec  1 08:14:25 2014
(r275354)
+++ head/tools/tools/sysbuild/sysbuild.sh   Mon Dec  1 10:17:23 2014
(r275355)
@@ -226,8 +226,7 @@ ports_build() (
t=`echo $p | sed 's,/usr/ports/,,'`
pn=`cd $p  make package-name`
 
-   if [ x$p == x/usr/ports/ports-mgmt/pkg -o \
-x$p == x/freebsd/ports/ports-mgmt/pkg ] ; then
+   if [ x`basename $p` == xpkg ] ; then
log_it Very Special: $t ($pn)
 
(
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r275384 - head/tools/tools/nanobsd

2014-12-01 Thread Poul-Henning Kamp
Author: phk
Date: Mon Dec  1 22:39:35 2014
New Revision: 275384
URL: https://svnweb.freebsd.org/changeset/base/275384

Log:
  Make this work with pkgng, and allow PORTS_OPTS to be passed in

Modified:
  head/tools/tools/nanobsd/fill_pkg.sh

Modified: head/tools/tools/nanobsd/fill_pkg.sh
==
--- head/tools/tools/nanobsd/fill_pkg.shMon Dec  1 22:37:36 2014
(r275383)
+++ head/tools/tools/nanobsd/fill_pkg.shMon Dec  1 22:39:35 2014
(r275384)
@@ -57,8 +57,8 @@ ports_recurse() (
else
(
cd $d
-   rd=`make -V RUN_DEPENDS`
-   ld=`make -V LIB_DEPENDS`
+   rd=`make -V RUN_DEPENDS ${PORTS_OPTS}`
+   ld=`make -V LIB_DEPENDS ${PORTS_OPTS}`

for x in $rd $ld
do
@@ -84,8 +84,8 @@ done
 for i in `cat $PL`
 do
p=`(cd $i  make -V PKGNAME)`
-   if [ -f $NANO_PKG_DUMP/$p.tbz ] ; then
-   ln -s $NANO_PKG_DUMP/$p.tbz $NANO_PACKAGE_DIR
+   if [ -f $NANO_PKG_DUMP/$p.t[bx]z ] ; then
+   ln -s $NANO_PKG_DUMP/$p.t[bx]z $NANO_PACKAGE_DIR
else
echo Package $p misssing in $NANO_PKG_DUMP 12
exit 1
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


  1   2   3   >