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

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sun Jun 16 05:12:17 2019
New Revision: 349099
URL: https://svnweb.freebsd.org/changeset/base/349099

Log:
  symlinkat(2) is not covered.

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

Modified: head/share/man/man4/filemon.4
==
--- head/share/man/man4/filemon.4   Sun Jun 16 03:06:05 2019
(r349098)
+++ head/share/man/man4/filemon.4   Sun Jun 16 05:12:17 2019
(r349099)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 22, 2016
+.Dd June 15, 2019
 .Dt FILEMON 4
 .Os
 .Sh NAME
@@ -79,8 +79,7 @@ The next log entry may be lacking an absolute path or 
 .It Ql L
 .Xr link 2 ,
 .Xr linkat 2 ,
-.Xr symlink 2 ,
-.Xr symlinkat 2
+.Xr symlink 2
 .It Ql M
 .Xr rename 2
 .It Ql R
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349098 - head/sys/dev/atkbdc

2019-06-15 Thread Philip Paeps
Author: philip
Date: Sun Jun 16 03:06:05 2019
New Revision: 349098
URL: https://svnweb.freebsd.org/changeset/base/349098

Log:
  Add macOS-like three finger drag trackpad gesture to psm(4)
  
  Submitted by: Yan Ka Chiu 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D20648

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Sun Jun 16 01:23:45 2019(r349097)
+++ head/sys/dev/atkbdc/psm.c   Sun Jun 16 03:06:05 2019(r349098)
@@ -236,6 +236,7 @@ typedef struct synapticsinfo {
int  softbutton3_x;
int  max_x;
int  max_y;
+   int  three_finger_drag;
int  natural_scroll;
 } synapticsinfo_t;
 
@@ -572,6 +573,7 @@ enum {
SYNAPTICS_SYSCTL_SOFTBUTTONS_Y =SYN_OFFSET(softbuttons_y),
SYNAPTICS_SYSCTL_SOFTBUTTON2_X =SYN_OFFSET(softbutton2_x),
SYNAPTICS_SYSCTL_SOFTBUTTON3_X =SYN_OFFSET(softbutton3_x),
+   SYNAPTICS_SYSCTL_THREE_FINGER_DRAG =SYN_OFFSET(three_finger_drag),
SYNAPTICS_SYSCTL_NATURAL_SCROLL =   SYN_OFFSET(natural_scroll),
 #defineSYNAPTICS_SYSCTL_LAST   SYNAPTICS_SYSCTL_NATURAL_SCROLL
 };
@@ -3785,6 +3787,7 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i
int vscroll_hor_area, vscroll_ver_area;
int two_finger_scroll;
int max_x, max_y;
+   int three_finger_drag;
 
/* Read sysctl. */
/* XXX Verify values? */
@@ -3799,7 +3802,7 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i
two_finger_scroll = sc->syninfo.two_finger_scroll;
max_x = sc->syninfo.max_x;
max_y = sc->syninfo.max_y;
-
+   three_finger_drag = sc->syninfo.three_finger_drag;
/* Read current absolute position. */
x0 = f->x;
y0 = f->y;
@@ -3888,8 +3891,8 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i
~MOUSE_BUTTON1DOWN) | center_button;
}
 
-   /* If in tap-hold, add the recorded button. */
-   if (gest->in_taphold)
+   /* If in tap-hold or three fingers, add the recorded button. */
+   if (gest->in_taphold || (nfingers == 3 && three_finger_drag))
ms->button |= gest->tap_button;
 
/*
@@ -5755,6 +5758,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS)
return (EINVAL);
break;
 case SYNAPTICS_SYSCTL_TOUCHPAD_OFF:
+   case SYNAPTICS_SYSCTL_THREE_FINGER_DRAG:
case SYNAPTICS_SYSCTL_NATURAL_SCROLL:
if (arg < 0 || arg > 1)
return (EINVAL);
@@ -6147,6 +6151,14 @@ synaptics_sysctl_create_tree(struct psm_softc *sc, con
sc, SYNAPTICS_SYSCTL_TOUCHPAD_OFF,
synaptics_sysctl, "I",
"Turn off touchpad");
+
+   sc->syninfo.three_finger_drag = 0;
+   SYSCTL_ADD_PROC(>syninfo.sysctl_ctx,
+   SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO,
+   "three_finger_drag", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+   sc, SYNAPTICS_SYSCTL_THREE_FINGER_DRAG,
+   synaptics_sysctl, "I",
+   "Enable dragging with three fingers");
 
/* hw.psm.synaptics.natural_scroll. */
sc->syninfo.natural_scroll = 0;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349097 - head/sys/arm/conf

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sun Jun 16 01:23:45 2019
New Revision: 349097
URL: https://svnweb.freebsd.org/changeset/base/349097

Log:
  Build SoC-specific modules with GENERIC for the SoCs that have them.

Modified:
  head/sys/arm/conf/GENERIC

Modified: head/sys/arm/conf/GENERIC
==
--- head/sys/arm/conf/GENERIC   Sun Jun 16 01:22:44 2019(r349096)
+++ head/sys/arm/conf/GENERIC   Sun Jun 16 01:23:45 2019(r349097)
@@ -285,3 +285,8 @@ makeoptions MODULES_EXTRA+="dtb/omap4"
 makeoptionsMODULES_EXTRA+="dtb/rpi"
 makeoptionsMODULES_EXTRA+="dtb/zynq"
 
+# SOC-specific modules
+makeoptionsMODULES_EXTRA+="allwinner"
+makeoptionsMODULES_EXTRA+="arm_ti"
+makeoptionsMODULES_EXTRA+="imx"
+
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349096 - in head/sys/modules: arm_ti arm_ti/am335x_ehrpwm arm_ti/ti_i2c ti

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sun Jun 16 01:22:44 2019
New Revision: 349096
URL: https://svnweb.freebsd.org/changeset/base/349096

Log:
  Add module makefiles for Texas Instruments ARM SoCs.
  
  The natural place to look for them based on how other SoCs are organized
  would be sys/modules/ti, but that's already taken.  Drop a clue into
  modules/ti/Makefile directing people to modules/arm_ti if they're looking
  for ARM modules.

Added:
  head/sys/modules/arm_ti/
  head/sys/modules/arm_ti/Makefile   (contents, props changed)
  head/sys/modules/arm_ti/am335x_ehrpwm/
  head/sys/modules/arm_ti/am335x_ehrpwm/Makefile   (contents, props changed)
  head/sys/modules/arm_ti/ti_i2c/
  head/sys/modules/arm_ti/ti_i2c/Makefile   (contents, props changed)
Modified:
  head/sys/modules/ti/Makefile

Added: head/sys/modules/arm_ti/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/arm_ti/MakefileSun Jun 16 01:22:44 2019
(r349096)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+# Build modules specific to Texas Instruments ARM SoCs.
+
+SUBDIR = \
+   ../am335x_dmtpps \
+   am335x_ehrpwm \
+   ti_i2c \
+   
+.include 

Added: head/sys/modules/arm_ti/am335x_ehrpwm/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/arm_ti/am335x_ehrpwm/Makefile  Sun Jun 16 01:22:44 
2019(r349096)
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/arm/ti/am335x
+
+KMOD=  am335x_ehrpwm
+SRCS=  am335x_ehrpwm.c
+
+# Generated files...
+SRCS+= \
+   bus_if.h \
+   device_if.h \
+   ofw_bus_if.h \
+   pwmbus_if.h \
+
+.include 
+

Added: head/sys/modules/arm_ti/ti_i2c/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/arm_ti/ti_i2c/Makefile Sun Jun 16 01:22:44 2019
(r349096)
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/arm/ti
+
+KMOD=  ti_i2c
+SRCS=  ti_i2c.c
+
+SRCS+= \
+   bus_if.h \
+   device_if.h \
+   iicbus_if.h \
+   ofw_bus_if.h \
+
+.include 

Modified: head/sys/modules/ti/Makefile
==
--- head/sys/modules/ti/MakefileSun Jun 16 01:05:53 2019
(r349095)
+++ head/sys/modules/ti/MakefileSun Jun 16 01:22:44 2019
(r349096)
@@ -1,4 +1,6 @@
 # $FreeBSD$
+# Module for Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD.
+# Modules for Texas Instruments ARM SoCs are located in sys/modules/arm_ti.
 
 .PATH: ${SRCTOP}/sys/dev/ti
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349095 - head/sys/arm/conf

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sun Jun 16 01:05:53 2019
New Revision: 349095
URL: https://svnweb.freebsd.org/changeset/base/349095

Log:
  Split the dtb MODULES_EXTRA line to a series of += lines, making it easier
  to maintain and keep in alphabetical order, and paving the way for adding
  some other modules that aren't dtb-related.

Modified:
  head/sys/arm/conf/GENERIC

Modified: head/sys/arm/conf/GENERIC
==
--- head/sys/arm/conf/GENERIC   Sun Jun 16 00:53:09 2019(r349094)
+++ head/sys/arm/conf/GENERIC   Sun Jun 16 01:05:53 2019(r349095)
@@ -277,4 +277,11 @@ device aw_thermal  # Allwinner Thermal 
Sensor Controll
 
 # Flattened Device Tree
 optionsFDT # Configure using FDT/DTB data
-makeoptionsMODULES_EXTRA="dtb/allwinner dtb/am335x dtb/imx6 dtb/nvidia 
dtb/rpi dtb/zynq dtb/omap4"
+makeoptionsMODULES_EXTRA+="dtb/allwinner"
+makeoptionsMODULES_EXTRA+="dtb/am335x"
+makeoptionsMODULES_EXTRA+="dtb/imx6"
+makeoptionsMODULES_EXTRA+="dtb/nvidia"
+makeoptionsMODULES_EXTRA+="dtb/omap4"
+makeoptionsMODULES_EXTRA+="dtb/rpi"
+makeoptionsMODULES_EXTRA+="dtb/zynq"
+
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349094 - in head/sys/modules: . pwm pwm/pwmbus pwm/pwmc

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sun Jun 16 00:53:09 2019
New Revision: 349094
URL: https://svnweb.freebsd.org/changeset/base/349094

Log:
  Add module makefiles for pwm.

Added:
  head/sys/modules/pwm/
  head/sys/modules/pwm/Makefile   (contents, props changed)
  head/sys/modules/pwm/pwmbus/
  head/sys/modules/pwm/pwmbus/Makefile   (contents, props changed)
  head/sys/modules/pwm/pwmc/
  head/sys/modules/pwm/pwmc/Makefile   (contents, props changed)
Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Sun Jun 16 00:43:05 2019(r349093)
+++ head/sys/modules/Makefile   Sun Jun 16 00:53:09 2019(r349094)
@@ -299,6 +299,7 @@ SUBDIR= \
${_pst} \
pty  \
puc \
+   pwm \
${_qlxge} \
${_qlxgb} \
${_qlxgbe} \

Added: head/sys/modules/pwm/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/pwm/Makefile   Sun Jun 16 00:53:09 2019
(r349094)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+# Modules for dev/pwm drivers.
+
+SUBDIR = \
+   pwmbus \
+   pwmc \
+   
+.include 

Added: head/sys/modules/pwm/pwmbus/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/pwm/pwmbus/MakefileSun Jun 16 00:53:09 2019
(r349094)
@@ -0,0 +1,20 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/pwm
+
+KMOD=  pwmbus
+SRCS=  pwmbus.c
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_pwm.c ofw_bus_if.h
+.endif
+
+# Generated files...
+SRCS+= \
+   bus_if.h \
+   device_if.h \
+   opt_platform.h \
+   pwmbus_if.c \
+   pwmbus_if.h \
+
+.include 

Added: head/sys/modules/pwm/pwmc/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/pwm/pwmc/Makefile  Sun Jun 16 00:53:09 2019
(r349094)
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/pwm
+KMOD=  pwmc
+SRCS=  pwmc.c
+
+# Generated files...
+SRCS+= \
+   bus_if.h \
+   device_if.h \
+   opt_platform.h \
+   pwmbus_if.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349093 - head/sys/dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sun Jun 16 00:43:05 2019
New Revision: 349093
URL: https://svnweb.freebsd.org/changeset/base/349093

Log:
  This code no longer uses fdt/ofw stuff, no need to include ofw headers.

Modified:
  head/sys/dev/pwm/pwmbus.c

Modified: head/sys/dev/pwm/pwmbus.c
==
--- head/sys/dev/pwm/pwmbus.c   Sun Jun 16 00:32:19 2019(r349092)
+++ head/sys/dev/pwm/pwmbus.c   Sun Jun 16 00:43:05 2019(r349093)
@@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-#include 
-
 #include 
 
 #include "pwmbus_if.h"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349092 - head/sys/dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sun Jun 16 00:32:19 2019
New Revision: 349092
URL: https://svnweb.freebsd.org/changeset/base/349092

Log:
  Make channel number unsigned, and spell unsigned int u_int.  This should
  have been part of r349088.

Modified:
  head/sys/dev/pwm/pwmc.h

Modified: head/sys/dev/pwm/pwmc.h
==
--- head/sys/dev/pwm/pwmc.h Sun Jun 16 00:27:11 2019(r349091)
+++ head/sys/dev/pwm/pwmc.h Sun Jun 16 00:32:19 2019(r349092)
@@ -34,9 +34,9 @@
 #definePWM_POLARITY_INVERTED   (1 << 0)
 
 struct pwm_state {
-   int channel;
-   unsigned intperiod;
-   unsigned intduty;
+   u_int   channel;
+   u_int   period;
+   u_int   duty;
uint32_tflags;
boolenable;
 };
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349091 - head/sys/modules/allwinner/aw_pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sun Jun 16 00:27:11 2019
New Revision: 349091
URL: https://svnweb.freebsd.org/changeset/base/349091

Log:
  The pwm interface was replaced with pwmbus, include the right header file.

Modified:
  head/sys/modules/allwinner/aw_pwm/Makefile

Modified: head/sys/modules/allwinner/aw_pwm/Makefile
==
--- head/sys/modules/allwinner/aw_pwm/Makefile  Sat Jun 15 23:11:34 2019
(r349090)
+++ head/sys/modules/allwinner/aw_pwm/Makefile  Sun Jun 16 00:27:11 2019
(r349091)
@@ -10,6 +10,6 @@ SRCS+=\
clknode_if.h \
device_if.h \
ofw_bus_if.h \
-   pwm_if.h
+   pwmbus_if.h
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349088 - in head: sys/arm/allwinner sys/dev/pwm usr.sbin/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 23:02:09 2019
New Revision: 349088
URL: https://svnweb.freebsd.org/changeset/base/349088

Log:
  Make pwm channel numbers unsigned.

Modified:
  head/sys/arm/allwinner/aw_pwm.c
  head/sys/dev/pwm/pwmbus.c
  head/sys/dev/pwm/pwmbus.h
  head/sys/dev/pwm/pwmbus_if.m
  head/sys/dev/pwm/pwmc.c
  head/usr.sbin/pwm/pwm.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==
--- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 23:00:23 2019
(r349087)
+++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 23:02:09 2019
(r349088)
@@ -226,7 +226,7 @@ aw_pwm_detach(device_t dev)
 }
 
 static int
-aw_pwm_channel_count(device_t dev, int *nchannel)
+aw_pwm_channel_count(device_t dev, u_int *nchannel)
 {
 
*nchannel = 1;
@@ -235,7 +235,7 @@ aw_pwm_channel_count(device_t dev, int *nchannel)
 }
 
 static int
-aw_pwm_channel_config(device_t dev, int channel, unsigned int period, unsigned 
int duty)
+aw_pwm_channel_config(device_t dev, u_int channel, u_int period, u_int duty)
 {
struct aw_pwm_softc *sc;
uint64_t period_freq, duty_freq;
@@ -298,7 +298,7 @@ aw_pwm_channel_config(device_t dev, int channel, unsig
 }
 
 static int
-aw_pwm_channel_get_config(device_t dev, int channel, unsigned int *period, 
unsigned int *duty)
+aw_pwm_channel_get_config(device_t dev, u_int channel, u_int *period, u_int 
*duty)
 {
struct aw_pwm_softc *sc;
 
@@ -311,7 +311,7 @@ aw_pwm_channel_get_config(device_t dev, int channel, u
 }
 
 static int
-aw_pwm_channel_enable(device_t dev, int channel, bool enable)
+aw_pwm_channel_enable(device_t dev, u_int channel, bool enable)
 {
struct aw_pwm_softc *sc;
uint32_t reg;
@@ -335,7 +335,7 @@ aw_pwm_channel_enable(device_t dev, int channel, bool 
 }
 
 static int
-aw_pwm_channel_is_enabled(device_t dev, int channel, bool *enabled)
+aw_pwm_channel_is_enabled(device_t dev, u_int channel, bool *enabled)
 {
struct aw_pwm_softc *sc;
 

Modified: head/sys/dev/pwm/pwmbus.c
==
--- head/sys/dev/pwm/pwmbus.c   Sat Jun 15 23:00:23 2019(r349087)
+++ head/sys/dev/pwm/pwmbus.c   Sat Jun 15 23:02:09 2019(r349088)
@@ -57,7 +57,7 @@ struct pwmbus_softc {
device_tdev;
device_tparent;
 
-   int nchannels;
+   u_int   nchannels;
 };
 
 static int
@@ -103,43 +103,43 @@ pwmbus_detach(device_t dev)
 }
 
 static int
-pwmbus_channel_config(device_t dev, int chan, u_int period, u_int duty)
+pwmbus_channel_config(device_t dev, u_int chan, u_int period, u_int duty)
 {
return (PWMBUS_CHANNEL_CONFIG(device_get_parent(dev), chan, period, 
duty));
 }
 
 static int
-pwmbus_channel_get_config(device_t dev, int chan, u_int *period, u_int *duty)
+pwmbus_channel_get_config(device_t dev, u_int chan, u_int *period, u_int *duty)
 {
return (PWMBUS_CHANNEL_GET_CONFIG(device_get_parent(dev), chan, period, 
duty));
 }
 
 static int
-pwmbus_channel_get_flags(device_t dev, int chan, uint32_t *flags)
+pwmbus_channel_get_flags(device_t dev, u_int chan, uint32_t *flags)
 {
return (PWMBUS_CHANNEL_GET_FLAGS(device_get_parent(dev), chan, flags));
 }
 
 static int
-pwmbus_channel_enable(device_t dev, int chan, bool enable)
+pwmbus_channel_enable(device_t dev, u_int chan, bool enable)
 {
return (PWMBUS_CHANNEL_ENABLE(device_get_parent(dev), chan, enable));
 }
 
 static int
-pwmbus_channel_set_flags(device_t dev, int chan, uint32_t flags)
+pwmbus_channel_set_flags(device_t dev, u_int chan, uint32_t flags)
 {
return (PWMBUS_CHANNEL_SET_FLAGS(device_get_parent(dev), chan, flags));
 }
 
 static int
-pwmbus_channel_is_enabled(device_t dev, int chan, bool *enable)
+pwmbus_channel_is_enabled(device_t dev, u_int chan, bool *enable)
 {
return (PWMBUS_CHANNEL_IS_ENABLED(device_get_parent(dev), chan, 
enable));
 }
 
 static int
-pwmbus_channel_count(device_t dev, int *nchannel)
+pwmbus_channel_count(device_t dev, u_int *nchannel)
 {
return (PWMBUS_CHANNEL_COUNT(device_get_parent(dev), nchannel));
 }

Modified: head/sys/dev/pwm/pwmbus.h
==
--- head/sys/dev/pwm/pwmbus.h   Sat Jun 15 23:00:23 2019(r349087)
+++ head/sys/dev/pwm/pwmbus.h   Sat Jun 15 23:02:09 2019(r349088)
@@ -34,7 +34,7 @@
 
 struct pwm_channel {
device_tdev;
-   int channel;
+   u_int   channel;
uint64_tperiod;
uint64_tduty;
uint32_tflags;

Modified: head/sys/dev/pwm/pwmbus_if.m
==
--- head/sys/dev/pwm/pwmbus_if.mSat Jun 15 23:00:23 2019
(r349087)
+++ head/sys/dev/pwm/pwmbus_if.mSat Jun 15 23:02:09 2019
(r349088)
@@ -33,14 +33,14 @@ INTERFACE pwmbus;
 
 

svn commit: r349086 - in head/sys: arm/allwinner conf dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 22:25:39 2019
New Revision: 349086
URL: https://svnweb.freebsd.org/changeset/base/349086

Log:
  Restructure the pwm device hirearchy and interfaces.
  
  The pwm and pwmbus interfaces were nearly identical, this merges them into a
  single pwmbus interface.  The pwmbus driver now implements the pwmbus
  interface by simply passing all calls through to its parent (the hardware
  driver).  The channel_count method moves from pwm to pwmbus, and the
  get_bus method is deleted (just no longer needed).
  
  The net effect is that the interface for doing pwm stuff is now the same
  regardless of whether you're a child of pwmbus, or some random driver
  elsewhere in the hierarchy that is bypassing the pwmbus layer and is talking
  directly to the hardware driver via cross-hierarchy connections established
  using fdt data.
  
  The pwmc driver is now a child of pwmbus, instead of being its sibling
  (that's why the get_bus method is no longer needed; pwmc now gets the
  device_t of the bus using device_get_parent()).

Deleted:
  head/sys/dev/pwm/pwm_if.m
Modified:
  head/sys/arm/allwinner/aw_pwm.c
  head/sys/conf/files
  head/sys/dev/pwm/ofw_pwm.c
  head/sys/dev/pwm/pwmbus.c
  head/sys/dev/pwm/pwmbus.h
  head/sys/dev/pwm/pwmbus_if.m
  head/sys/dev/pwm/pwmc.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==
--- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:51:55 2019
(r349085)
+++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 22:25:39 2019
(r349086)
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include "pwm_if.h"
+#include "pwmbus_if.h"
 
 #defineAW_PWM_CTRL 0x00
 #define AW_PWM_CTRL_PRESCALE_MASK  0xF
@@ -346,28 +346,18 @@ aw_pwm_channel_is_enabled(device_t dev, int channel, b
return (0);
 }
 
-static device_t
-aw_pwm_get_bus(device_t dev)
-{
-   struct aw_pwm_softc *sc;
-
-   sc = device_get_softc(dev);
-
-   return (sc->busdev);
-}
 static device_method_t aw_pwm_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, aw_pwm_probe),
DEVMETHOD(device_attach,aw_pwm_attach),
DEVMETHOD(device_detach,aw_pwm_detach),
 
-   /* pwm interface */
-   DEVMETHOD(pwm_get_bus,  aw_pwm_get_bus),
-   DEVMETHOD(pwm_channel_count,aw_pwm_channel_count),
-   DEVMETHOD(pwm_channel_config,   aw_pwm_channel_config),
-   DEVMETHOD(pwm_channel_get_config,   aw_pwm_channel_get_config),
-   DEVMETHOD(pwm_channel_enable,   aw_pwm_channel_enable),
-   DEVMETHOD(pwm_channel_is_enabled,   aw_pwm_channel_is_enabled),
+   /* pwmbus interface */
+   DEVMETHOD(pwmbus_channel_count, aw_pwm_channel_count),
+   DEVMETHOD(pwmbus_channel_config,aw_pwm_channel_config),
+   DEVMETHOD(pwmbus_channel_get_config,aw_pwm_channel_get_config),
+   DEVMETHOD(pwmbus_channel_enable,aw_pwm_channel_enable),
+   DEVMETHOD(pwmbus_channel_is_enabled,aw_pwm_channel_is_enabled),
 
DEVMETHOD_END
 };

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Jun 15 21:51:55 2019(r349085)
+++ head/sys/conf/files Sat Jun 15 22:25:39 2019(r349086)
@@ -2702,7 +2702,6 @@ dev/puc/puc_pccard.c  optional puc pccard
 dev/puc/puc_pci.c  optional puc pci
 dev/pwm/pwmc.c optional pwm | pwmc
 dev/pwm/pwmbus.c   optional pwm | pwmbus
-dev/pwm/pwm_if.m   optional pwm | pwmbus
 dev/pwm/pwmbus_if.moptional pwm | pwmbus
 dev/pwm/ofw_pwm.c  optional pwm fdt | pwmbus fdt
 dev/quicc/quicc_core.c optional quicc

Modified: head/sys/dev/pwm/ofw_pwm.c
==
--- head/sys/dev/pwm/ofw_pwm.c  Sat Jun 15 21:51:55 2019(r349085)
+++ head/sys/dev/pwm/ofw_pwm.c  Sat Jun 15 22:25:39 2019(r349086)
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include "pwm_if.h"
+#include "pwmbus_if.h"
 
 int
 pwm_get_by_ofw_propidx(device_t consumer, phandle_t node,
@@ -58,12 +58,6 @@ pwm_get_by_ofw_propidx(device_t consumer, phandle_t no
 
channel.dev = OF_device_from_xref(xref);
if (channel.dev == NULL) {
-   OF_prop_free(cells);
-   return (ENODEV);
-   }
-
-   channel.busdev = PWM_GET_BUS(channel.dev);
-   if (channel.busdev == NULL) {
OF_prop_free(cells);
return (ENODEV);
}

Modified: head/sys/dev/pwm/pwmbus.c
==
--- head/sys/dev/pwm/pwmbus.c   Sat Jun 15 21:51:55 2019(r349085)
+++ head/sys/dev/pwm/pwmbus.c   Sat Jun 15 22:25:39 2019(r349086)
@@ -47,7 +47,6 

svn commit: r349085 - head/sys/dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 21:51:55 2019
New Revision: 349085
URL: https://svnweb.freebsd.org/changeset/base/349085

Log:
  Destroy the cdev on device detach.  Also, make the driver and devclass
  static, because nothing outside this file needs them.

Modified:
  head/sys/dev/pwm/pwmc.c

Modified: head/sys/dev/pwm/pwmc.c
==
--- head/sys/dev/pwm/pwmc.c Sat Jun 15 21:36:14 2019(r349084)
+++ head/sys/dev/pwm/pwmc.c Sat Jun 15 21:51:55 2019(r349085)
@@ -137,6 +137,10 @@ pwmc_attach(device_t dev)
 static int
 pwmc_detach(device_t dev)
 {
+   struct pwmc_softc *sc;
+ 
+   sc = device_get_softc(dev);
+   destroy_dev(sc->pwm_dev);
 
return (0);
 }
@@ -150,12 +154,12 @@ static device_method_t pwmc_methods[] = {
DEVMETHOD_END
 };
 
-driver_t pwmc_driver = {
+static driver_t pwmc_driver = {
"pwmc",
pwmc_methods,
sizeof(struct pwmc_softc),
 };
-devclass_t pwmc_devclass;
+static devclass_t pwmc_devclass;
 
 DRIVER_MODULE(pwmc, pwm, pwmc_driver, pwmc_devclass, 0, 0);
 MODULE_VERSION(pwmc, 1);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349084 - in head/sys: arm/allwinner dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 21:36:14 2019
New Revision: 349084
URL: https://svnweb.freebsd.org/changeset/base/349084

Log:
  Rename the channel_max method to channel_count, because that's what it's
  returning.  (If the channel count is 2, then the max channel number is 1.)

Modified:
  head/sys/arm/allwinner/aw_pwm.c
  head/sys/dev/pwm/pwm_if.m
  head/sys/dev/pwm/pwmbus.c
  head/sys/dev/pwm/pwmc.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==
--- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:31:04 2019
(r349083)
+++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:36:14 2019
(r349084)
@@ -226,7 +226,7 @@ aw_pwm_detach(device_t dev)
 }
 
 static int
-aw_pwm_channel_max(device_t dev, int *nchannel)
+aw_pwm_channel_count(device_t dev, int *nchannel)
 {
 
*nchannel = 1;
@@ -363,7 +363,7 @@ static device_method_t aw_pwm_methods[] = {
 
/* pwm interface */
DEVMETHOD(pwm_get_bus,  aw_pwm_get_bus),
-   DEVMETHOD(pwm_channel_max,  aw_pwm_channel_max),
+   DEVMETHOD(pwm_channel_count,aw_pwm_channel_count),
DEVMETHOD(pwm_channel_config,   aw_pwm_channel_config),
DEVMETHOD(pwm_channel_get_config,   aw_pwm_channel_get_config),
DEVMETHOD(pwm_channel_enable,   aw_pwm_channel_enable),

Modified: head/sys/dev/pwm/pwm_if.m
==
--- head/sys/dev/pwm/pwm_if.m   Sat Jun 15 21:31:04 2019(r349083)
+++ head/sys/dev/pwm/pwm_if.m   Sat Jun 15 21:36:14 2019(r349084)
@@ -100,7 +100,7 @@ METHOD int channel_is_enabled {
 #
 # Get the number of channels
 #
-METHOD int channel_max {
+METHOD int channel_count {
device_t dev;
int *nchannel;
 };

Modified: head/sys/dev/pwm/pwmbus.c
==
--- head/sys/dev/pwm/pwmbus.c   Sat Jun 15 21:31:04 2019(r349083)
+++ head/sys/dev/pwm/pwmbus.c   Sat Jun 15 21:36:14 2019(r349084)
@@ -78,7 +78,7 @@ pwmbus_attach(device_t dev)
sc->busdev = dev;
sc->dev = device_get_parent(dev);
 
-   if (PWM_CHANNEL_MAX(sc->dev, >nchannels) != 0 ||
+   if (PWM_CHANNEL_COUNT(sc->dev, >nchannels) != 0 ||
sc->nchannels == 0)
return (ENXIO);
 

Modified: head/sys/dev/pwm/pwmc.c
==
--- head/sys/dev/pwm/pwmc.c Sat Jun 15 21:31:04 2019(r349083)
+++ head/sys/dev/pwm/pwmc.c Sat Jun 15 21:36:14 2019(r349084)
@@ -67,7 +67,7 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
switch (cmd) {
case PWMMAXCHANNEL:
nchannel = -1;
-   rv = PWM_CHANNEL_MAX(sc->pdev, );
+   rv = PWM_CHANNEL_COUNT(sc->pdev, );
bcopy(, data, sizeof(nchannel));
break;
case PWMSETSTATE:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349083 - head/sys/arm/allwinner

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 21:31:04 2019
New Revision: 349083
URL: https://svnweb.freebsd.org/changeset/base/349083

Log:
  Give the aw_pwm driver a module version.

Modified:
  head/sys/arm/allwinner/aw_pwm.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==
--- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:19:23 2019
(r349082)
+++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:31:04 2019
(r349083)
@@ -381,4 +381,5 @@ static driver_t aw_pwm_driver = {
 static devclass_t aw_pwm_devclass;
 
 DRIVER_MODULE(aw_pwm, simplebus, aw_pwm_driver, aw_pwm_devclass, 0, 0);
+MODULE_VERSION(aw_pwm, 1);
 SIMPLEBUS_PNP_INFO(compat_data);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349082 - head/sys/dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 21:19:23 2019
New Revision: 349082
URL: https://svnweb.freebsd.org/changeset/base/349082

Log:
  Spell unsigned int as u_int and channel as chan; eliminates the need to wrap
  some long lines.

Modified:
  head/sys/dev/pwm/pwmbus.c

Modified: head/sys/dev/pwm/pwmbus.c
==
--- head/sys/dev/pwm/pwmbus.c   Sat Jun 15 20:54:33 2019(r349081)
+++ head/sys/dev/pwm/pwmbus.c   Sat Jun 15 21:19:23 2019(r349082)
@@ -101,81 +101,81 @@ pwmbus_detach(device_t dev)
 }
 
 static int
-pwmbus_channel_config(device_t bus, int channel, unsigned int period, unsigned 
int duty)
+pwmbus_channel_config(device_t bus, int chan, u_int period, u_int duty)
 {
struct pwmbus_softc *sc;
 
sc = device_get_softc(bus);
 
-   if (channel > sc->nchannels)
+   if (chan > sc->nchannels)
return (EINVAL);
 
-   return (PWM_CHANNEL_CONFIG(sc->dev, channel, period, duty));
+   return (PWM_CHANNEL_CONFIG(sc->dev, chan, period, duty));
 }
 
 static int
-pwmbus_channel_get_config(device_t bus, int channel, unsigned int *period, 
unsigned int *duty)
+pwmbus_channel_get_config(device_t bus, int chan, u_int *period, u_int *duty)
 {
struct pwmbus_softc *sc;
 
sc = device_get_softc(bus);
 
-   if (channel > sc->nchannels)
+   if (chan > sc->nchannels)
return (EINVAL);
 
-   return (PWM_CHANNEL_GET_CONFIG(sc->dev, channel, period, duty));
+   return (PWM_CHANNEL_GET_CONFIG(sc->dev, chan, period, duty));
 }
 
 static int
-pwmbus_channel_set_flags(device_t bus, int channel, uint32_t flags)
+pwmbus_channel_set_flags(device_t bus, int chan, uint32_t flags)
 {
struct pwmbus_softc *sc;
 
sc = device_get_softc(bus);
 
-   if (channel > sc->nchannels)
+   if (chan > sc->nchannels)
return (EINVAL);
 
-   return (PWM_CHANNEL_SET_FLAGS(sc->dev, channel, flags));
+   return (PWM_CHANNEL_SET_FLAGS(sc->dev, chan, flags));
 }
 
 static int
-pwmbus_channel_get_flags(device_t bus, int channel, uint32_t *flags)
+pwmbus_channel_get_flags(device_t bus, int chan, uint32_t *flags)
 {
struct pwmbus_softc *sc;
 
sc = device_get_softc(bus);
 
-   if (channel > sc->nchannels)
+   if (chan > sc->nchannels)
return (EINVAL);
 
-   return (PWM_CHANNEL_GET_FLAGS(sc->dev, channel, flags));
+   return (PWM_CHANNEL_GET_FLAGS(sc->dev, chan, flags));
 }
 
 static int
-pwmbus_channel_enable(device_t bus, int channel, bool enable)
+pwmbus_channel_enable(device_t bus, int chan, bool enable)
 {
struct pwmbus_softc *sc;
 
sc = device_get_softc(bus);
 
-   if (channel > sc->nchannels)
+   if (chan > sc->nchannels)
return (EINVAL);
 
-   return (PWM_CHANNEL_ENABLE(sc->dev, channel, enable));
+   return (PWM_CHANNEL_ENABLE(sc->dev, chan, enable));
 }
 
 static int
-pwmbus_channel_is_enabled(device_t bus, int channel, bool *enable)
+pwmbus_channel_is_enabled(device_t bus, int chan, bool *enable)
 {
struct pwmbus_softc *sc;
 
sc = device_get_softc(bus);
 
-   if (channel > sc->nchannels)
+   if (chan > sc->nchannels)
return (EINVAL);
 
-   return (PWM_CHANNEL_IS_ENABLED(sc->dev, channel, enable));
+   return (PWM_CHANNEL_IS_ENABLED(sc->dev, chan, enable));
 }
 
 static device_method_t pwmbus_methods[] = {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349081 - head/sys/dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 20:54:33 2019
New Revision: 349081
URL: https://svnweb.freebsd.org/changeset/base/349081

Log:
  Unwrap prototype lines so that return type and function name are on the
  same line.  No functional changes.

Modified:
  head/sys/dev/pwm/pwmbus.h

Modified: head/sys/dev/pwm/pwmbus.h
==
--- head/sys/dev/pwm/pwmbus.h   Sat Jun 15 20:53:26 2019(r349080)
+++ head/sys/dev/pwm/pwmbus.h   Sat Jun 15 20:54:33 2019(r349081)
@@ -43,17 +43,13 @@ struct pwm_channel {
 };
 typedef struct pwm_channel *pwm_channel_t;
 
-int
-pwm_get_by_ofw_propidx(device_t consumer, phandle_t node,
+int pwm_get_by_ofw_propidx(device_t consumer, phandle_t node,
 const char *prop_name, int idx, pwm_channel_t *channel);
-int
-pwm_get_by_ofw_idx(device_t consumer, phandle_t node, int idx,
+int pwm_get_by_ofw_idx(device_t consumer, phandle_t node, int idx,
 pwm_channel_t *out_channel);
-int
-pwm_get_by_ofw_property(device_t consumer, phandle_t node,
+int pwm_get_by_ofw_property(device_t consumer, phandle_t node,
 const char *prop_name, pwm_channel_t *out_channel);
-int
-pwm_get_by_ofw_name(device_t consumer, phandle_t node, const char *name,
+int pwm_get_by_ofw_name(device_t consumer, phandle_t node, const char *name,
 pwm_channel_t *out_channel);
 
 #endif /* _PWMBUS_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349080 - head/sys/dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 20:53:26 2019
New Revision: 349080
URL: https://svnweb.freebsd.org/changeset/base/349080

Log:
  Make pwmbus driver and devclass vars static; they're not mentioned in any
  header file, so they can't be used outside this file anyway.

Modified:
  head/sys/dev/pwm/pwmbus.c

Modified: head/sys/dev/pwm/pwmbus.c
==
--- head/sys/dev/pwm/pwmbus.c   Sat Jun 15 20:25:36 2019(r349079)
+++ head/sys/dev/pwm/pwmbus.c   Sat Jun 15 20:53:26 2019(r349080)
@@ -195,12 +195,12 @@ static device_method_t pwmbus_methods[] = {
DEVMETHOD_END
 };
 
-driver_t pwmbus_driver = {
+static driver_t pwmbus_driver = {
"pwmbus",
pwmbus_methods,
sizeof(struct pwmbus_softc),
 };
-devclass_t pwmbus_devclass;
+static devclass_t pwmbus_devclass;
 
 EARLY_DRIVER_MODULE(pwmbus, pwm, pwmbus_driver, pwmbus_devclass, 0, 0,
   BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349077 - head/sys/arm/ti/am335x

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 20:20:36 2019
New Revision: 349077
URL: https://svnweb.freebsd.org/changeset/base/349077

Log:
  Add a missing #include.  I suspect this used to get included via some header
  pollution that was cleaned up recently, and this file got missed in the
  cleanup because it's not attached to the build unless you specifically
  request this device in a custom kernel config.

Modified:
  head/sys/arm/ti/am335x/am335x_dmtpps.c

Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c
==
--- head/sys/arm/ti/am335x/am335x_dmtpps.c  Sat Jun 15 20:17:00 2019
(r349076)
+++ head/sys/arm/ti/am335x/am335x_dmtpps.c  Sat Jun 15 20:20:36 2019
(r349077)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349076 - head/sys/dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 20:17:00 2019
New Revision: 349076
URL: https://svnweb.freebsd.org/changeset/base/349076

Log:
  Use device_delete_children() instead of a locally-rolled copy of it that
  leaks the device-list memory.

Modified:
  head/sys/dev/pwm/pwmbus.c

Modified: head/sys/dev/pwm/pwmbus.c
==
--- head/sys/dev/pwm/pwmbus.c   Sat Jun 15 20:13:42 2019(r349075)
+++ head/sys/dev/pwm/pwmbus.c   Sat Jun 15 20:17:00 2019(r349076)
@@ -92,20 +92,12 @@ pwmbus_attach(device_t dev)
 static int
 pwmbus_detach(device_t dev)
 {
-   device_t *devlist;
-   int i, rv, ndevs;
+   int rv;
 
-   rv = bus_generic_detach(dev);
-   if (rv != 0)
-   return (rv);
+   if ((rv = bus_generic_detach(dev)) == 0)
+   rv = device_delete_children(dev);
 
-   rv = device_get_children(dev, , );
-   if (rv != 0)
-   return (rv);
-   for (i = 0; i < ndevs; i++)
-   device_delete_child(dev, devlist[i]);
-
-   return (0);
+   return (rv);
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349075 - head/sys/dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 20:13:42 2019
New Revision: 349075
URL: https://svnweb.freebsd.org/changeset/base/349075

Log:
  Remove pwmbus_attach_bus(), it no longer has any callers.  Also remove a
  couple prototypes for functions that never existed (and never will).

Modified:
  head/sys/dev/pwm/pwmbus.c
  head/sys/dev/pwm/pwmbus.h

Modified: head/sys/dev/pwm/pwmbus.c
==
--- head/sys/dev/pwm/pwmbus.c   Sat Jun 15 19:46:59 2019(r349074)
+++ head/sys/dev/pwm/pwmbus.c   Sat Jun 15 20:13:42 2019(r349075)
@@ -61,35 +61,6 @@ struct pwmbus_softc {
int nchannels;
 };
 
-device_t
-pwmbus_attach_bus(device_t dev)
-{
-   device_t busdev;
-#ifdef FDT
-   phandle_t node;
-#endif
-
-   busdev = device_add_child(dev, "pwmbus", -1);
-   if (busdev == NULL) {
-   device_printf(dev, "Cannot add child pwmbus\n");
-   return (NULL);
-   }
-   if (device_add_child(dev, "pwmc", -1) == NULL) {
-   device_printf(dev, "Cannot add pwmc\n");
-   device_delete_child(dev, busdev);
-   return (NULL);
-   }
-
-#ifdef FDT
-   node = ofw_bus_get_node(dev);
-   OF_device_register_xref(OF_xref_from_node(node), dev);
-#endif
-
-   bus_generic_attach(dev);
-
-   return (busdev);
-}
-
 static int
 pwmbus_probe(device_t dev)
 {

Modified: head/sys/dev/pwm/pwmbus.h
==
--- head/sys/dev/pwm/pwmbus.h   Sat Jun 15 19:46:59 2019(r349074)
+++ head/sys/dev/pwm/pwmbus.h   Sat Jun 15 20:13:42 2019(r349075)
@@ -43,10 +43,6 @@ struct pwm_channel {
 };
 typedef struct pwm_channel *pwm_channel_t;
 
-device_t pwmbus_attach_bus(device_t dev);
-int pwmbus_acquire_channel(device_t bus, int channel);
-int pwmbus_release_channel(device_t bus, int channel);
-
 int
 pwm_get_by_ofw_propidx(device_t consumer, phandle_t node,
 const char *prop_name, int idx, pwm_channel_t *channel);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349074 - in head: . etc/mtree include sys/dev/pwm sys/sys usr.sbin/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 19:46:59 2019
New Revision: 349074
URL: https://svnweb.freebsd.org/changeset/base/349074

Log:
  Move/rename the sys/pwm.h header file to dev/pwm/pwmc.h.  The file contains
  ioctl definitions and related datatypes that allow userland control of pwm
  hardware via the pwmc device.  The new name and location better reflects its
  assocation with a single device driver.

Added:
  head/sys/dev/pwm/pwmc.h
 - copied unchanged from r349073, head/sys/sys/pwm.h
Deleted:
  head/sys/sys/pwm.h
Modified:
  head/ObsoleteFiles.inc
  head/etc/mtree/BSD.include.dist
  head/include/Makefile
  head/sys/dev/pwm/pwmc.c
  head/usr.sbin/pwm/pwm.c

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Jun 15 19:43:33 2019(r349073)
+++ head/ObsoleteFiles.inc  Sat Jun 15 19:46:59 2019(r349074)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20190615: sys/pwm.h renamed to dev/pwmc.h
+OLD_FILES+=usr/include/sys/pwm.h
 # 20190612: new clang import which bumps version from 8.0.0 to 8.0.1.
 OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h
 OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/asan_interface.h

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Sat Jun 15 19:43:33 2019
(r349073)
+++ head/etc/mtree/BSD.include.dist Sat Jun 15 19:46:59 2019
(r349074)
@@ -152,6 +152,8 @@
 ..
 ppbus
 ..
+pwm
+..
 smbus
 ..
 speaker

Modified: head/include/Makefile
==
--- head/include/Makefile   Sat Jun 15 19:43:33 2019(r349073)
+++ head/include/Makefile   Sat Jun 15 19:46:59 2019(r349074)
@@ -46,8 +46,8 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \
dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \
dev/hwpmc dev/hyperv \
dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \
-   dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
-   dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \
+   dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \
+   dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \
fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \
fs/procfs fs/smbfs fs/udf fs/unionfs \
geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \

Modified: head/sys/dev/pwm/pwmc.c
==
--- head/sys/dev/pwm/pwmc.c Sat Jun 15 19:43:33 2019(r349073)
+++ head/sys/dev/pwm/pwmc.c Sat Jun 15 19:46:59 2019(r349074)
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "pwmbus_if.h"
 #include "pwm_if.h"

Copied: head/sys/dev/pwm/pwmc.h (from r349073, head/sys/sys/pwm.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/pwm/pwmc.h Sat Jun 15 19:46:59 2019(r349074, copy 
of r349073, head/sys/sys/pwm.h)
@@ -0,0 +1,53 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2018 Emmanuel Vadot 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _PWM_H_
+#define_PWM_H_
+
+#definePWM_POLARITY_INVERTED   (1 << 

svn commit: r349073 - head/sys/dev/pwm

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 19:43:33 2019
New Revision: 349073
URL: https://svnweb.freebsd.org/changeset/base/349073

Log:
  Do not include pwm.h here, it is purely a userland interface file containing
  ioctl defintions for the pwmc driver. It is not part of the pwmbus interface.

Modified:
  head/sys/dev/pwm/pwmbus.h
  head/sys/dev/pwm/pwmbus_if.m

Modified: head/sys/dev/pwm/pwmbus.h
==
--- head/sys/dev/pwm/pwmbus.h   Sat Jun 15 19:16:02 2019(r349072)
+++ head/sys/dev/pwm/pwmbus.h   Sat Jun 15 19:43:33 2019(r349073)
@@ -31,7 +31,6 @@
 #ifndef _PWMBUS_H_
 
 #include 
-#include 
 
 struct pwm_channel {
device_tdev;

Modified: head/sys/dev/pwm/pwmbus_if.m
==
--- head/sys/dev/pwm/pwmbus_if.mSat Jun 15 19:16:02 2019
(r349072)
+++ head/sys/dev/pwm/pwmbus_if.mSat Jun 15 19:43:33 2019
(r349073)
@@ -48,10 +48,6 @@ CODE {
}
 };
 
-HEADER {
-   #include 
-};
-
 #
 # Config the period (Total number of cycle in ns) and
 # the duty (active number of cycle in ns)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349072 - head

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 19:16:02 2019
New Revision: 349072
URL: https://svnweb.freebsd.org/changeset/base/349072

Log:
  Remove pcf8563reg.h, the driver it was associated with was replaced in 2017
  with the nxprtc multi-chip driver.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Jun 15 19:07:03 2019(r349071)
+++ head/ObsoleteFiles.inc  Sat Jun 15 19:16:02 2019(r349072)
@@ -1560,6 +1560,8 @@ OLD_DIRS+=usr/share/openssl/man/en.ISO8859-1/cat1
 OLD_DIRS+=usr/share/openssl/man/en.ISO8859-1/cat3
 # 20170802: ksyms(4) ioctl interface was removed
 OLD_FILES+=usr/include/sys/ksyms.h
+# 20170729: the iicbus/pcf8563 driver is replaced with iicbus/nxprtc
+OLD_FILES+=usr/include/dev/iicbus/pcf8563reg.h
 # 20170722: new clang import which bumps version from 4.0.0 to 5.0.0.
 OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/allocator_interface.h
 OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/asan_interface.h
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r349055 - head/sys/net

2019-06-15 Thread Andrew Gallatin

On 2019-06-15 11:59, Marius Strobl wrote:

On Sat, Jun 15, 2019 at 09:08:05AM -0400, Andrew Gallatin wrote:

On 2019-06-15 07:07, Marius Strobl wrote:

Author: marius
Date: Sat Jun 15 11:07:41 2019
New Revision: 349055



Log:
- Replace unused and only ever written to members of public iflib(9)
  structs with placeholders (in the latter case, IFLIB_MAX_TX_BYTES
  etc. are also only ever used for these write-only members if at all,
  so both these macros and members can just go). Using these spares
  may render it possible to merge certain iflib(9) fixes to stable/12.
  Otherwise, changes extending struct if_irq or struct if_shared_ctx
  in any way would break KBI as instances of these are allocated by
  the driver front-ends (by contrast, struct if_pkt_info as well as
  struct if_softc_ctx instances are provided by iflib(9) and, thus,
  may grow at least at the end without breaking KBI).


Given the above, why replace ipi_tcp_sum in if_pkt_info with a spare?
Given that if_pkt_info can grow, I would also expect it to be able to
shrink.  So I don't quite see why the spare is needed here.

I also worry about carrying the other spares around forever.


Yes, KBI-wise it should be also safe for instances of structures allocated
by iflib(9) to shrink at the end (though shrinking structures usually isn't
a concern when MFCing as such parts may just be omitted); changes altering
the offsets of members would be a problem regarding KBI.
Still, I don't like changing the size of publicly visible structures in
stable branches without a real good reason even if such a change doesn't
strictly break the KBI. So the plan is to MFC the spares but then to get
rid of the ones whose removal doesn't break KBI in head.

Marius



Thanks, that makes sense

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


svn commit: r349070 - head/sys/arm64/arm64

2019-06-15 Thread Alan Cox
Author: alc
Date: Sat Jun 15 17:26:42 2019
New Revision: 349070
URL: https://svnweb.freebsd.org/changeset/base/349070

Log:
  Previously, when pmap_remove_pages() destroyed a dirty superpage mapping,
  it only called vm_page_dirty() on the first of the superpage's constituent
  4KB pages.  This revision corrects that error, calling vm_page_dirty() on
  all of superpage's constituent 4KB pages.
  
  MFC after:3 days

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Sat Jun 15 17:08:39 2019(r349069)
+++ head/sys/arm64/arm64/pmap.c Sat Jun 15 17:26:42 2019(r349070)
@@ -4067,7 +4067,7 @@ pmap_remove_pages(pmap_t pmap)
switch (lvl) {
case 1:
for (mt = m; mt < [L2_SIZE / 
PAGE_SIZE]; mt++)
-   vm_page_dirty(m);
+   vm_page_dirty(mt);
break;
case 2:
vm_page_dirty(m);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r349069 - head/gnu/lib/csu

2019-06-15 Thread Bryan Drewery
On 6/15/2019 10:08 AM, Bryan Drewery wrote:
> Author: bdrewery
> Date: Sat Jun 15 17:08:39 2019
> New Revision: 349069
> URL: https://svnweb.freebsd.org/changeset/base/349069
> 
> Log:
>   csu: Add proper .depend tracking for each object.
>   
>   This doesn't appear to have ever worked. After a .depend is generated
>   there will be duplicate .c dependencies so only use the first one.
>   

Oops. This 2nd paragraph was really from r349067 before some rebasing.


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


svn commit: r349068 - head/share/mk

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun 15 17:08:35 2019
New Revision: 349068
URL: https://svnweb.freebsd.org/changeset/base/349068

Log:
  Allow DEPENDOBJS/DEPENDSRCS to work with only OBJS set and no SRCS.
  
  Default to tracking .depend.* for OBJS rather than SRCS.
  
  This helps cover some special case builds like gnu/lib/csu which
  do more of a PROGS-like thing with bsd.prog.mk.
  
  It is possible this causes out-of-tree Makefiles to have problems if they use
  this pattern:
foo.o: foo.c
${CC} -o ${.TARGET} ${.ALLSRC}
  This may cause multiple source files to be compiled due to finding the
  'foo.o: foo.c' dependency both in the Makefile at the .depend file. Or
  it may try compiling headers. This can be worked around by either of these:
foo.o: foo.c
${CC} -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
  Or
foo.o: foo.c
${CC} -o ${.TARGET} ${.CURDIR}/foo.c
  In the latter case the ${.CURDIR} may need to be a different path. The
  first case covers automatically using .PATH.
  
  Sponsored by: DellEMC

Modified:
  head/share/mk/bsd.dep.mk

Modified: head/share/mk/bsd.dep.mk
==
--- head/share/mk/bsd.dep.mkSat Jun 15 17:08:32 2019(r349067)
+++ head/share/mk/bsd.dep.mkSat Jun 15 17:08:35 2019(r349068)
@@ -173,19 +173,23 @@ ${_D}.nossppico: ${_DSRC} ${SOBJS:S/^${_D}.nossppico$/
 .endif
 .endfor
 .endfor
+.endif # defined(SRCS)
 
-
 .if ${MAKE_VERSION} < 20160220
 DEPEND_MP?=-MP
 .endif
 # Handle OBJS=../somefile.o hacks.  Just replace '/' rather than use :T to
 # avoid collisions.
 DEPEND_FILTER= C,/,_,g
+.if !empty(OBJS)
+DEPENDOBJS+=   ${OBJS}
+.else
 DEPENDSRCS+=   ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc}
 DEPENDSRCS+=   ${DPSRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc}
 .if !empty(DEPENDSRCS)
 DEPENDOBJS+=   ${DEPENDSRCS:${OBJS_SRCS_FILTER:ts:}:S,$,.o,}
 .endif
+.endif # !empty(OBJS)
 .if !empty(DEPENDOBJS)
 DEPENDFILES+=  ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
 .endif
@@ -215,7 +219,6 @@ CFLAGS+=${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS
 .endif
 .endfor
 .endif # !defined(_meta_filemon)
-.endif # defined(SRCS)
 
 .if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.DEPENDFILE} != "/dev/null"
 # Prevent meta.autodep.mk from tracking "local dependencies".
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349065 - head/share/mk

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun 15 17:08:24 2019
New Revision: 349065
URL: https://svnweb.freebsd.org/changeset/base/349065

Log:
  Add various CFLAGS/LDADD overrides for the output target file.
  
  Sponsored by: DellEMC

Modified:
  head/share/mk/bsd.README
  head/share/mk/bsd.sys.mk

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMESat Jun 15 17:08:21 2019(r349064)
+++ head/share/mk/bsd.READMESat Jun 15 17:08:24 2019(r349065)
@@ -125,10 +125,16 @@ The following variables are common:
 
 AFLAGS.${SRC}
Flags dependent on source file name.
+AFLAGS.${TARGET}
+   Flags dependent on output file name.
 ACFLAGS.${SRC}
Flags dependent on source file name.
+ACFLAGS.${TARGET}
+   Flags dependent on output file name.
 CFLAGS.${SRC}
Flags dependent on source file name.
+CFLAGS.${TARGET}
+   Flags dependent on output file name.
 CFLAGS.${COMPILER_TYPE}
Flags dependent on compiler added to CFLAGS.
 CFLAGS.${MACHINE_ARCH}
@@ -142,6 +148,8 @@ CXXFLAGS.${MACHINE_ARCH}
Architectural flags added to CXXFLAGS.
 CXXFLAGS.${SRC}
Flags dependent on source file name.
+CXXFLAGS.${TARGET}
+   Flags dependent on output file name.
 COMPILER_FEATURES
A list of features that the compiler supports. Zero or
more of:
@@ -336,13 +344,22 @@ LDADD Additional loader objects.  Usually 
used for li
 
LDADD=-lutil -lcompat
 
+LDADD.${TAREGT}
+   Loader objects dependent on output file name.
+
 LDFLAGSAdditional loader flags. Passed to the loader via CC,
since that's used to link programs as well, so loader
specific flags need to be prefixed with -Wl, to work.
 
+LDFLAGS.${TARGET}
+   Flags dependent on output file name.
+
 LIBADD Additional libraries.  This is for base system libraries
and is only valid inside of the /usr/src tree.
Use LIBADD=name instead of LDADD=-lname.
+
+LIBADD.${TARGET}
+   Libraries dependent on output file name.
 
 LINKS  The list of binary links; should be full pathnames, the
linked-to file coming first, followed by the linked

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkSat Jun 15 17:08:21 2019(r349064)
+++ head/share/mk/bsd.sys.mkSat Jun 15 17:08:24 2019(r349065)
@@ -234,17 +234,25 @@ DEBUG_FILES_CFLAGS?= -g
 .if ${MK_WARNS} != "no"
 CFLAGS+=   ${CWARNFLAGS:M*} ${CWARNFLAGS.${COMPILER_TYPE}}
 CFLAGS+=   ${CWARNFLAGS.${.IMPSRC:T}}
+CFLAGS+=   ${CWARNFLAGS.${.TARGET:T}}
 .endif
 
 CFLAGS+=${CFLAGS.${COMPILER_TYPE}}
 CXXFLAGS+=  ${CXXFLAGS.${COMPILER_TYPE}}
 
 AFLAGS+=   ${AFLAGS.${.IMPSRC:T}}
+AFLAGS+=   ${AFLAGS.${.TARGET:T}}
 ACFLAGS+=  ${ACFLAGS.${.IMPSRC:T}}
+ACFLAGS+=  ${ACFLAGS.${.TARGET:T}}
 CFLAGS+=   ${CFLAGS.${.IMPSRC:T}}
+CFLAGS+=   ${CFLAGS.${.TARGET:T}}
 CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}}
+CXXFLAGS+= ${CXXFLAGS.${.TARGET:T}}
 
 LDFLAGS+=  ${LDFLAGS.${LINKER_TYPE}}
+LDFLAGS+=  ${LDFLAGS.${.TARGET:T}}
+LDADD+=${LDADD.${.TARGET:T}}
+LIBADD+=   ${LIBADD.${.TARGET:T}}
 
 .if defined(SRCTOP)
 # Prevent rebuilding during install to support read-only objdirs.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349069 - head/gnu/lib/csu

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun 15 17:08:39 2019
New Revision: 349069
URL: https://svnweb.freebsd.org/changeset/base/349069

Log:
  csu: Add proper .depend tracking for each object.
  
  This doesn't appear to have ever worked. After a .depend is generated
  there will be duplicate .c dependencies so only use the first one.
  
  MFC after:2 weeks
  Sponsored by: DellEMC

Modified:
  head/gnu/lib/csu/Makefile

Modified: head/gnu/lib/csu/Makefile
==
--- head/gnu/lib/csu/Makefile   Sat Jun 15 17:08:35 2019(r349068)
+++ head/gnu/lib/csu/Makefile   Sat Jun 15 17:08:39 2019(r349069)
@@ -14,6 +14,7 @@ CCDIR=${SRCTOP}/gnu/usr.bin/cc
 SRCS=  crtstuff.c ${COMMONHDRS}
 OBJS=  crtbegin.o crtend.o crtbeginT.o
 SOBJS= crtbeginS.o crtendS.o
+DEPENDOBJS+=   ${OBJS} ${SOBJS}
 CSTD?= gnu89
 CFLAGS+=   -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3
 CFLAGS.gcc+=   -finhibit-size-directive -fno-toplevel-reorder
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349064 - head/share/mk

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun 15 17:08:21 2019
New Revision: 349064
URL: https://svnweb.freebsd.org/changeset/base/349064

Log:
  Avoid generating DEPENDFILES='.depend.' when there's no DEPENDOBJS.
  
  MFC after:2 weeks
  Sponsored by: DellEMC

Modified:
  head/share/mk/bsd.dep.mk

Modified: head/share/mk/bsd.dep.mk
==
--- head/share/mk/bsd.dep.mkSat Jun 15 17:08:18 2019(r349063)
+++ head/share/mk/bsd.dep.mkSat Jun 15 17:08:21 2019(r349064)
@@ -186,7 +186,9 @@ DEPENDSRCS+=${DPSRCS:M*.[cSC]} ${SRCS:M*.cxx} 
${SRCS:
 .if !empty(DEPENDSRCS)
 DEPENDOBJS+=   ${DEPENDSRCS:${OBJS_SRCS_FILTER:ts:}:S,$,.o,}
 .endif
+.if !empty(DEPENDOBJS)
 DEPENDFILES+=  ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
+.endif
 .if defined(_SKIP_DEPEND)
 # Don't bother statting any .meta files for .depend*
 ${DEPENDOBJS}: .NOMETA
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349062 - in head: bin/csh bin/sh lib/libmagic lib/ncurses/ncurses share/syscons/scrnmaps usr.bin/awk usr.bin/vi/catalog

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun 15 17:08:13 2019
New Revision: 349062
URL: https://svnweb.freebsd.org/changeset/base/349062

Log:
  Fix .depend files to work for build tools.
  
  This is somewhat of a follow-up to r335746.
  
  MFC after:2 weeks
  Sponsored by: DellEMC

Modified:
  head/bin/csh/Makefile
  head/bin/sh/Makefile
  head/lib/libmagic/Makefile
  head/lib/ncurses/ncurses/Makefile
  head/share/syscons/scrnmaps/Makefile
  head/usr.bin/awk/Makefile
  head/usr.bin/vi/catalog/Makefile

Modified: head/bin/csh/Makefile
==
--- head/bin/csh/Makefile   Sat Jun 15 17:08:02 2019(r349061)
+++ head/bin/csh/Makefile   Sat Jun 15 17:08:13 2019(r349062)
@@ -117,6 +117,7 @@ csh.1: tcsh.man
 
 build-tools: gethost
 
+DEPENDOBJS+= gethost
 gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META}
@rm -f ${.TARGET}
${CC:N${CCACHE_BIN}} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \

Modified: head/bin/sh/Makefile
==
--- head/bin/sh/MakefileSat Jun 15 17:08:02 2019(r349061)
+++ head/bin/sh/MakefileSat Jun 15 17:08:13 2019(r349062)
@@ -48,6 +48,7 @@ builtins.h: .NOMETA
 builtins.c builtins.h: mkbuiltins builtins.def
sh ${.CURDIR}/mkbuiltins ${.CURDIR}
 
+DEPENDOBJS+= mknodes mksyntax
 mknodes mksyntax: ${BUILD_TOOLS_META}
 
 .ORDER: nodes.c nodes.h

Modified: head/lib/libmagic/Makefile
==
--- head/lib/libmagic/Makefile  Sat Jun 15 17:08:02 2019(r349061)
+++ head/lib/libmagic/Makefile  Sat Jun 15 17:08:13 2019(r349062)
@@ -41,10 +41,11 @@ magic.mgc: mkmagic magic
${BTOOLSPATH:U.}/mkmagic magic
 
 CLEANFILES+=   mkmagic
+DEPENDOBJS+=   mkmagic
 build-tools: mkmagic
 mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} 
${BUILD_TOOLS_META}
-   ${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} 
${.ALLSRC:N*.h} \
-   ${LDADD}
+   ${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \
+   ${.ALLSRC:N*.h:O:u} ${LDADD}
 
 FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \
${.CURDIR}/config.h

Modified: head/lib/ncurses/ncurses/Makefile
==
--- head/lib/ncurses/ncurses/Makefile   Sat Jun 15 17:08:02 2019
(r349061)
+++ head/lib/ncurses/ncurses/Makefile   Sat Jun 15 17:08:13 2019
(r349062)
@@ -389,6 +389,7 @@ keys.list: MKkeys_list.sh Caps
${NCURSES_DIR}/include/Caps | LC_ALL=C sort > keys.list
 
 # Build tools
+DEPENDOBJS+= make_hash make_keys
 build-tools: make_hash make_keys
 
 make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META}

Modified: head/share/syscons/scrnmaps/Makefile
==
--- head/share/syscons/scrnmaps/MakefileSat Jun 15 17:08:02 2019
(r349061)
+++ head/share/syscons/scrnmaps/MakefileSat Jun 15 17:08:13 2019
(r349062)
@@ -12,6 +12,7 @@ CLEANFILES+= ${SCRMAPS_MK} ${SCRMAPS}
 FILES= ${SCRMAPS}
 FILESDIR= ${SHAREDIR}/syscons/scrnmaps
 
+DEPENDOBJS+= ${SCRMAPS_MK}
 build-tools: ${SCRMAPS_MK}
 
 ${SCRMAPS}: ${.TARGET:R}.mk

Modified: head/usr.bin/awk/Makefile
==
--- head/usr.bin/awk/Makefile   Sat Jun 15 17:08:02 2019(r349061)
+++ head/usr.bin/awk/Makefile   Sat Jun 15 17:08:13 2019(r349062)
@@ -27,6 +27,7 @@ ytab.h: awkgram.c awkgram.h .NOMETA
 proctab.c: maketab
${BTOOLSPATH:U.}/maketab awkgram.h > proctab.c
 
+DEPENDOBJS+= maketab
 build-tools: maketab
 maketab: ytab.h maketab.c ${BUILD_TOOLS_META}
 

Modified: head/usr.bin/vi/catalog/Makefile
==
--- head/usr.bin/vi/catalog/MakefileSat Jun 15 17:08:02 2019
(r349061)
+++ head/usr.bin/vi/catalog/MakefileSat Jun 15 17:08:13 2019
(r349062)
@@ -105,8 +105,8 @@ english.base: dump ${SCAN} #Makefile
sort -nu > $@
 
 
-dump: dump.c ${BUILD_TOOLS_META}
-   ${CC:N${CCACHE_BIN}} -o ${.TARGET} ${.ALLSRC}
+DEPENDOBJS+=   dump
+dump: ${BUILD_TOOLS_META}
 
 CLEANFILES+= dump ${CAT} english.base *.check __ck1 __ck2
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349066 - head/share/mk

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun 15 17:08:28 2019
New Revision: 349066
URL: https://svnweb.freebsd.org/changeset/base/349066

Log:
  META_MODE: Delete build targets that fail.
  
  If a meta mode change is triggered but then the build fails then the
  next build will not retrigger meta mode. This only prevented by
  removing the target on rebuild or on the failure to rebuild.
  
  Sponsored by: DellEMC

Modified:
  head/share/mk/local.sys.mk

Modified: head/share/mk/local.sys.mk
==
--- head/share/mk/local.sys.mk  Sat Jun 15 17:08:24 2019(r349065)
+++ head/share/mk/local.sys.mk  Sat Jun 15 17:08:28 2019(r349066)
@@ -33,6 +33,11 @@ MAKE_PRINT_VAR_ON_ERROR+= \
OBJTOP \
${MAKE_PRINT_VAR_ON_ERROR_XTRAS}
 
+# Meta mode may rebuild targets that then fail. The next build won't detect
+# the meta mode change. Not all targets have a 'rm ${.TARGET}' in them
+# so force it.
+.DELETE_ON_ERROR:
+
 .if ${.MAKE.LEVEL} > 0
 MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH
 .endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349067 - in head: gnu/lib/csu gnu/lib/libgcc gnu/lib/libgcov lib/csu

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun 15 17:08:32 2019
New Revision: 349067
URL: https://svnweb.freebsd.org/changeset/base/349067

Log:
  Support reading in .depend files.
  
  This is for an upcoming change that fixes .depend handling in here.
  It will cause some duplicate sources which need to be trimmed out.
  
  MFC after:2 weeks
  Sponsored by: DellEMC

Modified:
  head/gnu/lib/csu/Makefile
  head/gnu/lib/libgcc/Makefile
  head/gnu/lib/libgcov/Makefile
  head/lib/csu/Makefile.inc

Modified: head/gnu/lib/csu/Makefile
==
--- head/gnu/lib/csu/Makefile   Sat Jun 15 17:08:28 2019(r349066)
+++ head/gnu/lib/csu/Makefile   Sat Jun 15 17:08:32 2019(r349067)
@@ -49,23 +49,23 @@ CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS}
 
 crtbegin.o:${BEGINSRC}
${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
-   -c -o ${.TARGET} ${.ALLSRC:N*.h}
+   -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
 
 crtbeginT.o:   ${BEGINSRC}
${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \
-   -c -o ${.TARGET} ${.ALLSRC:N*.h}
+   -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
 
 crtbeginS.o:   ${BEGINSRC}
${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
-   -c -o ${.TARGET} ${.ALLSRC:N*.h}
+   -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
 
 crtend.o:  ${ENDSRC}
${CC} ${CFLAGS} -g0 -DCRT_END \
-   -c -o ${.TARGET} ${.ALLSRC:N*.h}
+   -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
 
 crtendS.o: ${ENDSRC}
${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
-   -c -o ${.TARGET} ${.ALLSRC:N*.h}
+   -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
 
 COMMONHDRS+=   tm.h tconfig.h options.h
 CLEANFILES+=   ${COMMONHDRS} optionlist cs-tconfig.h cs-tm.h

Modified: head/gnu/lib/libgcc/Makefile
==
--- head/gnu/lib/libgcc/MakefileSat Jun 15 17:08:28 2019
(r349066)
+++ head/gnu/lib/libgcc/MakefileSat Jun 15 17:08:32 2019
(r349067)
@@ -224,11 +224,11 @@ ${T}_OBJS_S = ${${T}_FUNCS:S/$/.pico/}
 SOBJS +=   ${${T}_FUNCS:S/$/.pico/}
 
 ${${T}_OBJS_T}: ${${T}_CFILE} ${COMMONHDRS}
-   ${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
+   ${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]}
 ${${T}_OBJS_P}: ${${T}_CFILE} ${COMMONHDRS}
-   ${CC_P} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
+   ${CC_P} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]}
 ${${T}_OBJS_S}: ${${T}_CFILE} ${COMMONHDRS}
-   ${CC_S} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
+   ${CC_S} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]}
 .endfor
 
 #---
@@ -249,9 +249,9 @@ STAT_OBJS_P =   ${SYMS_ST:S/$/.po/}
 STATICOBJS  =  ${SYMS_ST:S/$/.o/}
 
 ${STAT_OBJS_T}:${STD_CFILE} ${COMMONHDRS}
-   ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
+   ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]}
 ${STAT_OBJS_P}:${STD_CFILE} ${COMMONHDRS}
-   ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
+   ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]}
 
 #---
 #

Modified: head/gnu/lib/libgcov/Makefile
==
--- head/gnu/lib/libgcov/Makefile   Sat Jun 15 17:08:28 2019
(r349066)
+++ head/gnu/lib/libgcov/Makefile   Sat Jun 15 17:08:32 2019
(r349067)
@@ -51,16 +51,16 @@ CLEANFILES+=${COMMONHDRS} cs-tm.h cs-tconfig.h 
option
 ${OBJS} beforedepend: ${COMMONHDRS}
 
 ${OBJS_T}: libgcov.c
-   ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
+   ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]}
 
 .if !defined(NO_PIC)
 ${OBJS_S}: libgcov.c
-   ${CC_S} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
+   ${CC_S} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]}
 .endif
 
 .if ${MK_PROFILE} != "no"
 ${OBJS_P}: libgcov.c
-   ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
+   ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]}
 .endif
 
 .include 

Modified: head/lib/csu/Makefile.inc
==
--- head/lib/csu/Makefile.inc   Sat Jun 15 17:08:28 2019(r349066)
+++ head/lib/csu/Makefile.inc   Sat Jun 15 17:08:32 2019(r349067)
@@ -22,10 +22,11 @@ crtend.o: crtend.c
 crtendS.o: crtend.c
 
 crtbegin.o crtend.o crtbeginT.o:
-   ${CC} ${CFLAGS} -I${.CURDIR} -c -o ${.TARGET} ${.ALLSRC}
+   ${CC} ${CFLAGS} -I${.CURDIR} -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
 
 crtbeginS.o crtendS.o:
-   ${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o ${.TARGET} ${.ALLSRC}
+   ${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o 

svn commit: r349061 - head/share/mk

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun 15 17:08:02 2019
New Revision: 349061
URL: https://svnweb.freebsd.org/changeset/base/349061

Log:
  Don't force OBJS_DEPEND_GUESS headers onto all objects.
  
  This is in the case of not having any .depend.foo.o yet.  Don't force add *.h
  as a dependency for those. They are built in beforebuild already when in
  SRCS/DPSRCS.
  
  This change allows custom rules, like in bin/sh/Makefile for mksyntax, to not
  have cyclic dependency problems when connected to the .depend.* handling.
  
  This is purposely not copied to sys/conf/kern.post.mk as it handles
  generating headers slightly differently.
  
  MFC after:2 weeks
  Sponsored by: DellEMC

Modified:
  head/share/mk/bsd.dep.mk

Modified: head/share/mk/bsd.dep.mk
==
--- head/share/mk/bsd.dep.mkSat Jun 15 16:59:03 2019(r349060)
+++ head/share/mk/bsd.dep.mkSat Jun 15 17:08:02 2019(r349061)
@@ -251,18 +251,17 @@ _depfile= ${.OBJDIR}/${_meta_obj}
 .else
 _depfile=  ${.OBJDIR}/${_dep_obj}
 .endif
-.if !exists(${_depfile})
-${__obj}: ${OBJS_DEPEND_GUESS}
-${__obj}: ${OBJS_DEPEND_GUESS.${__obj}}
-.elif defined(_meta_filemon)
-# For meta mode we still need to know which file to depend on to avoid
-# ambiguous suffix transformation rules from .PATH.  Meta mode does not
-# use .depend files.  We really only need source files, not headers since
-# they are typically in SRCS/beforebuild already.  For target-specific
-# guesses do include headers though since they may not be in SRCS.
+.if !exists(${_depfile}) || defined(_meta_filemon)
+# - Headers are normally built in beforebuild when included in DPSRCS or SRCS.
+#   So we don't need it as a guessed dependency (it may lead to cyclic problems
+#   if custom rules are defined).  The only time this causes a problem is when
+#   'make foo.o' is ran.
+# - For meta mode we still need to know which file to depend on to avoid
+#   ambiguous suffix transformation rules from .PATH.  Meta mode does not
+#   use .depend files when filemon is in use.
 ${__obj}: ${OBJS_DEPEND_GUESS:N*.h}
 ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}}
-.endif # !exists(${_depfile})
+.endif # !exists(${_depfile}) || defined(_meta_filemon)
 .endfor
 
 # Always run 'make depend' to generate dependencies early and to avoid the
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349063 - head/share/mk

2019-06-15 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun 15 17:08:18 2019
New Revision: 349063
URL: https://svnweb.freebsd.org/changeset/base/349063

Log:
  Similar to r335710 avoid ccache when linking a .cc file directly.
  
  Sponsored by: DellEMC

Modified:
  head/share/mk/bsd.suffixes.mk

Modified: head/share/mk/bsd.suffixes.mk
==
--- head/share/mk/bsd.suffixes.mk   Sat Jun 15 17:08:13 2019
(r349062)
+++ head/share/mk/bsd.suffixes.mk   Sat Jun 15 17:08:18 2019
(r349063)
@@ -19,7 +19,7 @@
${CC} -emit-llvm ${IR_CFLAGS} -S ${.IMPSRC} -o ${.TARGET}
 
 .cc .cpp .cxx .C:
-   ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
+   ${CXX:N${CCACHE_BIN}} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o 
${.TARGET}
 
 .cc.o .cpp.o .cxx.o .C.o:
${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349060 - head/sys/arm/allwinner

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 16:59:03 2019
New Revision: 349060
URL: https://svnweb.freebsd.org/changeset/base/349060

Log:
  Handle failure to enable the clock or obtain its frequency.

Modified:
  head/sys/arm/allwinner/aw_pwm.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==
--- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:56:00 2019
(r349059)
+++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:59:03 2019
(r349060)
@@ -150,8 +150,16 @@ aw_pwm_attach(device_t dev)
goto fail;
}
error = clk_enable(sc->clk);
+   if (error != 0) {
+   device_printf(dev, "cannot enable clock\n");
+   goto fail;
+   }
 
error = clk_get_freq(sc->clk, >clk_freq);
+   if (error != 0) {
+   device_printf(dev, "cannot get clock frequency\n");
+   goto fail;
+   }
 
if (bus_alloc_resources(dev, aw_pwm_spec, >res) != 0) {
device_printf(dev, "cannot allocate resources for device\n");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349059 - head/sys/arm/allwinner

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 16:56:00 2019
New Revision: 349059
URL: https://svnweb.freebsd.org/changeset/base/349059

Log:
  Don't call pwmbus_attach_bus(), because it may not be present if this
  driver is compiled into the kernel but pwmbus will be loaded as a module
  when needed (and because of that, pwmbus_attach_bus() is going away in
  the near future).  Instead, just directly do what that function did:
  register the fdt xfef handle, and attach the pwmbus.

Modified:
  head/sys/arm/allwinner/aw_pwm.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==
--- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:36:29 2019
(r349058)
+++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:56:00 2019
(r349059)
@@ -138,6 +138,7 @@ aw_pwm_attach(device_t dev)
struct aw_pwm_softc *sc;
uint64_t clk_freq;
uint32_t reg;
+   phandle_t node;
int error;
 
sc = device_get_softc(dev);
@@ -158,9 +159,6 @@ aw_pwm_attach(device_t dev)
goto fail;
}
 
-   if ((sc->busdev = pwmbus_attach_bus(dev)) == NULL)
-   device_printf(dev, "Cannot attach pwm bus\n");
-
/* Read the configuration left by U-Boot */
reg = AW_PWM_READ(sc, AW_PWM_CTRL);
if (reg & (AW_PWM_CTRL_GATE | AW_PWM_CTRL_EN))
@@ -170,7 +168,7 @@ aw_pwm_attach(device_t dev)
reg &= AW_PWM_CTRL_PRESCALE_MASK;
if (reg > nitems(aw_pwm_clk_prescaler)) {
device_printf(dev, "Bad prescaler %x, cannot guess current 
settings\n", reg);
-   goto out;
+   goto skipcfg;
}
clk_freq = sc->clk_freq / aw_pwm_clk_prescaler[reg];
 
@@ -180,9 +178,18 @@ aw_pwm_attach(device_t dev)
sc->duty = NS_PER_SEC /
(clk_freq / ((reg >> AW_PWM_PERIOD_ACTIVE_SHIFT) & 
AW_PWM_PERIOD_ACTIVE_MASK));
 
-out:
-   return (0);
+skipcfg:
+   /*
+* Note that we don't check for failure to attach pwmbus -- even without
+* it we can still service clients who connect via fdt xref data.
+*/
+   node = ofw_bus_get_node(dev);
+   OF_device_register_xref(OF_xref_from_node(node), dev);
 
+   sc->busdev = device_add_child(dev, "pwmbus", -1);
+
+   return (bus_generic_attach(dev));
+
 fail:
aw_pwm_detach(dev);
return (error);
@@ -196,7 +203,7 @@ aw_pwm_detach(device_t dev)
 
sc = device_get_softc(dev);
 
-   if (((error = bus_generic_detach(sc->dev)) != 0) {
+   if ((error = bus_generic_detach(sc->dev)) != 0) {
device_printf(sc->dev, "cannot detach child devices\n");
return (error);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349058 - head/sys/arm/allwinner

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 16:36:29 2019
New Revision: 349058
URL: https://svnweb.freebsd.org/changeset/base/349058

Log:
  In detach(), check for failure of bus_generic_detach(), only release
  resources if they got allocated (because detach() gets called from attach()
  to handle various failures), and delete the pwmbus child if it got created.

Modified:
  head/sys/arm/allwinner/aw_pwm.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==
--- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:16:29 2019
(r349057)
+++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:36:29 2019
(r349058)
@@ -192,12 +192,20 @@ static int
 aw_pwm_detach(device_t dev)
 {
struct aw_pwm_softc *sc;
+   int error;
 
sc = device_get_softc(dev);
 
-   bus_generic_detach(sc->dev);
+   if (((error = bus_generic_detach(sc->dev)) != 0) {
+   device_printf(sc->dev, "cannot detach child devices\n");
+   return (error);
+   }
 
-   bus_release_resources(dev, aw_pwm_spec, >res);
+   if (sc->busdev != NULL)
+   device_delete_child(dev, sc->busdev);
+
+   if (sc->res != NULL)
+   bus_release_resources(dev, aw_pwm_spec, >res);
 
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349057 - head/sys/conf

2019-06-15 Thread Ian Lepore
Author: ian
Date: Sat Jun 15 16:16:29 2019
New Revision: 349057
URL: https://svnweb.freebsd.org/changeset/base/349057

Log:
  Allow pwm(9) components to be selected individually, while 'device pwm'
  still includes it all.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Jun 15 12:09:22 2019(r349056)
+++ head/sys/conf/files Sat Jun 15 16:16:29 2019(r349057)
@@ -2700,11 +2700,11 @@ dev/puc/puc.c   optional puc
 dev/puc/puc_cfg.c  optional puc
 dev/puc/puc_pccard.c   optional puc pccard
 dev/puc/puc_pci.c  optional puc pci
-dev/pwm/pwmc.c optional pwm
-dev/pwm/pwmbus.c   optional pwm
-dev/pwm/pwm_if.m   optional pwm
-dev/pwm/pwmbus_if.moptional pwm
-dev/pwm/ofw_pwm.c  optional pwm fdt
+dev/pwm/pwmc.c optional pwm | pwmc
+dev/pwm/pwmbus.c   optional pwm | pwmbus
+dev/pwm/pwm_if.m   optional pwm | pwmbus
+dev/pwm/pwmbus_if.moptional pwm | pwmbus
+dev/pwm/ofw_pwm.c  optional pwm fdt | pwmbus fdt
 dev/quicc/quicc_core.c optional quicc
 dev/ral/rt2560.c   optional ral
 dev/ral/rt2661.c   optional ral
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r349055 - head/sys/net

2019-06-15 Thread Marius Strobl
On Sat, Jun 15, 2019 at 09:08:05AM -0400, Andrew Gallatin wrote:
> On 2019-06-15 07:07, Marius Strobl wrote:
> > Author: marius
> > Date: Sat Jun 15 11:07:41 2019
> > New Revision: 349055
> 
> > Log:
> >- Replace unused and only ever written to members of public iflib(9)
> >  structs with placeholders (in the latter case, IFLIB_MAX_TX_BYTES
> >  etc. are also only ever used for these write-only members if at all,
> >  so both these macros and members can just go). Using these spares
> >  may render it possible to merge certain iflib(9) fixes to stable/12.
> >  Otherwise, changes extending struct if_irq or struct if_shared_ctx
> >  in any way would break KBI as instances of these are allocated by
> >  the driver front-ends (by contrast, struct if_pkt_info as well as
> >  struct if_softc_ctx instances are provided by iflib(9) and, thus,
> >  may grow at least at the end without breaking KBI).
> 
> Given the above, why replace ipi_tcp_sum in if_pkt_info with a spare? 
> Given that if_pkt_info can grow, I would also expect it to be able to 
> shrink.  So I don't quite see why the spare is needed here.
> 
> I also worry about carrying the other spares around forever.

Yes, KBI-wise it should be also safe for instances of structures allocated
by iflib(9) to shrink at the end (though shrinking structures usually isn't
a concern when MFCing as such parts may just be omitted); changes altering
the offsets of members would be a problem regarding KBI.
Still, I don't like changing the size of publicly visible structures in
stable branches without a real good reason even if such a change doesn't
strictly break the KBI. So the plan is to MFC the spares but then to get
rid of the ones whose removal doesn't break KBI in head.

Marius

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


Re: svn commit: r349055 - head/sys/net

2019-06-15 Thread Andrew Gallatin

On 2019-06-15 07:07, Marius Strobl wrote:

Author: marius
Date: Sat Jun 15 11:07:41 2019
New Revision: 349055



Log:
   - Replace unused and only ever written to members of public iflib(9)
 structs with placeholders (in the latter case, IFLIB_MAX_TX_BYTES
 etc. are also only ever used for these write-only members if at all,
 so both these macros and members can just go). Using these spares
 may render it possible to merge certain iflib(9) fixes to stable/12.
 Otherwise, changes extending struct if_irq or struct if_shared_ctx
 in any way would break KBI as instances of these are allocated by
 the driver front-ends (by contrast, struct if_pkt_info as well as
 struct if_softc_ctx instances are provided by iflib(9) and, thus,
 may grow at least at the end without breaking KBI).


Given the above, why replace ipi_tcp_sum in if_pkt_info with a spare? 
Given that if_pkt_info can grow, I would also expect it to be able to 
shrink.  So I don't quite see why the spare is needed here.


I also worry about carrying the other spares around forever.

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


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

2019-06-15 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Sat Jun 15 12:09:22 2019
New Revision: 349056
URL: https://svnweb.freebsd.org/changeset/base/349056

Log:
  netmap.4: Fix a typo as FreeBSD Linux is not a thing
  
  Approved by:  src (emaste)
  Event:Berlin Devsummit 2019

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

Modified: head/share/man/man4/netmap.4
==
--- head/share/man/man4/netmap.4Sat Jun 15 11:07:41 2019
(r349055)
+++ head/share/man/man4/netmap.4Sat Jun 15 12:09:22 2019
(r349056)
@@ -40,7 +40,7 @@
 is a framework for extremely fast and efficient packet I/O
 for userspace and kernel clients, and for Virtual Machines.
 It runs on
-.Fx
+.Fx ,
 Linux and some versions of Windows, and supports a variety of
 .Nm netmap ports ,
 including
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349055 - head/sys/net

2019-06-15 Thread Marius Strobl
Author: marius
Date: Sat Jun 15 11:07:41 2019
New Revision: 349055
URL: https://svnweb.freebsd.org/changeset/base/349055

Log:
  - Replace unused and only ever written to members of public iflib(9)
structs with placeholders (in the latter case, IFLIB_MAX_TX_BYTES
etc. are also only ever used for these write-only members if at all,
so both these macros and members can just go). Using these spares
may render it possible to merge certain iflib(9) fixes to stable/12.
Otherwise, changes extending struct if_irq or struct if_shared_ctx
in any way would break KBI as instances of these are allocated by
the driver front-ends (by contrast, struct if_pkt_info as well as
struct if_softc_ctx instances are provided by iflib(9) and, thus,
may grow at least at the end without breaking KBI).
  - Make the pvi_name in struct pci_vendor_info const char * as device
identifiers in hardware lookup tables aren't to be expected to ever
change at runtime.
  - Similarly, make the pci_vendor_info_t of struct if_shared_ctx which
is used to point to the struct pci_vendor_info arrays provided by
the driver front-ends const.
  - Remove the ETH_ADDR_LEN macro from iflib.h; this was duplicating
ETHER_ADDR_LEN of  with iflib(9) actually only
consuming the latter macro.
  - Make the name argument of iflib_io_tqg_attach(9) const, matching
the taskqgroup_attach_cpu(9) this function wraps as well as e. g.
iflib_config_gtask_init(9).
  - Remove the orphaned iflib_qset_lock_get() prototype.
  - Remove some extraneous empty lines.

Modified:
  head/sys/net/iflib.c
  head/sys/net/iflib.h
  head/sys/net/iflib_private.h

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cSat Jun 15 09:45:00 2019(r349054)
+++ head/sys/net/iflib.cSat Jun 15 11:07:41 2019(r349055)
@@ -376,7 +376,6 @@ struct iflib_fl {
uint64_tifl_cl_dequeued;
 #endif
/* implicit pad */
-
bitstr_t*ifl_rx_bitmap;
qidx_t  ifl_fragidx;
/* constant */
@@ -1250,7 +1249,6 @@ iflib_netmap_timer_adjust(if_ctx_t ctx, iflib_txq_t tx
 #define netmap_rx_irq(ifp, qid, budget) (0)
 #define netmap_tx_irq(ifp, qid) do {} while (0)
 #define iflib_netmap_timer_adjust(ctx, txq, reset_on)
-
 #endif
 
 #if defined(__i386__) || defined(__amd64__)
@@ -1537,17 +1535,17 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq, int rid,
 driver_filter_t filter, driver_intr_t handler, void *arg,
 const char *name)
 {
-   int rc, flags;
struct resource *res;
void *tag = NULL;
device_t dev = ctx->ifc_dev;
+   int flags, i, rc;
 
flags = RF_ACTIVE;
if (ctx->ifc_flags & IFC_LEGACY)
flags |= RF_SHAREABLE;
MPASS(rid < 512);
-   irq->ii_rid = rid;
-   res = bus_alloc_resource_any(dev, SYS_RES_IRQ, >ii_rid, flags);
+   i = rid;
+   res = bus_alloc_resource_any(dev, SYS_RES_IRQ, , flags);
if (res == NULL) {
device_printf(dev,
"failed to allocate IRQ for rid %d, name %s.\n", rid, name);
@@ -1569,7 +1567,6 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq, int rid,
return (0);
 }
 
-
 /*
  *
  *  Allocate DMA resources for TX buffers as well as memory for the TX
@@ -4332,12 +4329,10 @@ iflib_led_func(void *arg, int onoff)
 int
 iflib_device_probe(device_t dev)
 {
-   pci_vendor_info_t *ent;
-
-   uint16_tpci_vendor_id, pci_device_id;
-   uint16_tpci_subvendor_id, pci_subdevice_id;
-   uint16_tpci_rev_id;
+   const pci_vendor_info_t *ent;
if_shared_ctx_t sctx;
+   uint16_t pci_device_id, pci_rev_id, pci_subdevice_id, pci_subvendor_id;
+   uint16_t pci_vendor_id;
 
if ((sctx = DEVICE_REGISTER(dev)) == NULL || sctx->isc_magic != 
IFLIB_MAGIC)
return (ENOTSUP);
@@ -4397,8 +4392,6 @@ iflib_reset_qvalues(if_ctx_t ctx)
device_t dev = ctx->ifc_dev;
int i;
 
-   scctx->isc_txrx_budget_bytes_max = IFLIB_MAX_TX_BYTES;
-   scctx->isc_tx_qdepth = IFLIB_DEFAULT_TX_QDEPTH;
if (ctx->ifc_sysctl_ntxqs != 0)
scctx->isc_ntxqsets = ctx->ifc_sysctl_ntxqs;
if (ctx->ifc_sysctl_nrxqs != 0)
@@ -6037,15 +6030,14 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte
struct resource *res;
struct taskqgroup *tqg;
gtask_fn_t *fn;
-   int tqrid;
void *q;
-   int err;
+   int err, tqrid;
 
q = >ifc_rxqs[0];
info = [0].ifr_filter_info;
gtask = [0].ifr_task;
tqg = qgroup_if_io_tqg;
-   tqrid = irq->ii_rid = *rid;
+   tqrid = *rid;
fn = _task_fn_rx;
 
ctx->ifc_flags |= IFC_LEGACY;
@@ -6112,7 +6104,7 @@ iflib_iov_intr_deferred(if_ctx_t ctx)
 }
 
 void

svn commit: r349054 - head/tools/build

2019-06-15 Thread Marius Strobl
Author: marius
Date: Sat Jun 15 09:45:00 2019
New Revision: 349054
URL: https://svnweb.freebsd.org/changeset/base/349054

Log:
  Add  required for libnv to SYSINCS, too, apparently missed
  in r336335.

Modified:
  head/tools/build/Makefile

Modified: head/tools/build/Makefile
==
--- head/tools/build/Makefile   Sat Jun 15 09:30:11 2019(r349053)
+++ head/tools/build/Makefile   Sat Jun 15 09:45:00 2019(r349054)
@@ -70,7 +70,8 @@ SUBDIR=   cross-build
 .endif
 
 # Needed to build config (since it uses libnv)
-SYSINCS+=  ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h
+SYSINCS+=  ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h \
+   ${SRCTOP}/sys/sys/dnv.h
 
 # We want to run the build with only ${WORLDTMP} in $PATH to ensure we don't
 # accidentally run tools that are incompatible but happen to be in $PATH.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349049 - head/usr.bin/vtfontcvt

2019-06-15 Thread Ed Maste
Author: emaste
Date: Sat Jun 15 09:15:58 2019
New Revision: 349049
URL: https://svnweb.freebsd.org/changeset/base/349049

Log:
  vtfontcvt: add comments in add_glyph
  
  During review for PR 205707.
  
  Event:Berlin Devsummit 2019

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

Modified: head/usr.bin/vtfontcvt/vtfontcvt.c
==
--- head/usr.bin/vtfontcvt/vtfontcvt.c  Sat Jun 15 07:23:06 2019
(r349048)
+++ head/usr.bin/vtfontcvt/vtfontcvt.c  Sat Jun 15 09:15:58 2019
(r349049)
@@ -176,6 +176,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, 
glyph_total++;
glyph_count[map_idx]++;
 
+   /* Return existing glyph if we have an identical one. */
hash = fnv_32_buf(bytes, wbytes * height, FNV1_32_INIT) % FONTCVT_NHASH;
SLIST_FOREACH(gl, _hash[hash], g_hash) {
if (memcmp(gl->g_data, bytes, wbytes * height) == 0) {
@@ -184,6 +185,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, 
}
}
 
+   /* Allocate new glyph. */
gl = xmalloc(sizeof *gl);
gl->g_data = xmalloc(wbytes * height);
memcpy(gl->g_data, bytes, wbytes * height);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349048 - head/sbin/fsck_msdosfs

2019-06-15 Thread Xin LI
Author: delphij
Date: Sat Jun 15 07:23:06 2019
New Revision: 349048
URL: https://svnweb.freebsd.org/changeset/base/349048

Log:
  In ask(): override default option if any of alwaysyes/alwaysno/rdonly is
  set.
  
  MFC after:2 weeks

Modified:
  head/sbin/fsck_msdosfs/main.c

Modified: head/sbin/fsck_msdosfs/main.c
==
--- head/sbin/fsck_msdosfs/main.c   Sat Jun 15 06:51:46 2019
(r349047)
+++ head/sbin/fsck_msdosfs/main.c   Sat Jun 15 07:23:06 2019
(r349048)
@@ -129,9 +129,10 @@ ask(int def, const char *fmt, ...)
char prompt[256];
int c;
 
+   if (alwaysyes || alwaysno || rdonly)
+   def = (alwaysyes && !rdonly && !alwaysno);
+
if (preen) {
-   if (rdonly)
-   def = 0;
if (def)
printf("FIXED\n");
return def;
@@ -140,9 +141,9 @@ ask(int def, const char *fmt, ...)
va_start(ap, fmt);
vsnprintf(prompt, sizeof(prompt), fmt, ap);
va_end(ap);
-   if (alwaysyes || rdonly) {
-   printf("%s? %s\n", prompt, rdonly ? "no" : "yes");
-   return !rdonly;
+   if (alwaysyes || alwaysno || rdonly) {
+   printf("%s? %s\n", prompt, def ? "yes" : "no");
+   return def;
}
do {
printf("%s? [yn] ", prompt);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r349047 - head/sbin/fsck_msdosfs

2019-06-15 Thread Xin LI
Author: delphij
Date: Sat Jun 15 06:51:46 2019
New Revision: 349047
URL: https://svnweb.freebsd.org/changeset/base/349047

Log:
  Blankspace.  No actual code change.
  
  MFC after:2 weeks

Modified:
  head/sbin/fsck_msdosfs/boot.c

Modified: head/sbin/fsck_msdosfs/boot.c
==
--- head/sbin/fsck_msdosfs/boot.c   Sat Jun 15 04:30:13 2019
(r349046)
+++ head/sbin/fsck_msdosfs/boot.c   Sat Jun 15 06:51:46 2019
(r349047)
@@ -49,7 +49,7 @@ readboot(int dosfs, struct bootblock *boot)
u_char backup[DOSBOOTBLOCKSIZE];
int ret = FSOK;
int i;
-   
+
if ((size_t)read(dosfs, block, sizeof block) != sizeof block) {
perr("could not read boot block");
return FSFATAL;
@@ -219,7 +219,7 @@ readboot(int dosfs, struct bootblock *boot)
boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) /
boot->bpbSecPerClust;
 
-   if (boot->flags)
+   if (boot->flags & FAT32)
boot->ClustMask = CLUST32_MASK;
else if (boot->NumClusters < (CLUST_RSRVD_MASK))
boot->ClustMask = CLUST12_MASK;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"