svn commit: r352273 - stable/12/share/mk

2019-09-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Sep 13 05:54:09 2019
New Revision: 352273
URL: https://svnweb.freebsd.org/changeset/base/352273

Log:
  Use file destdir for stage_as sets
  
  We cannot use file (without :T) to name targets
  but we can use the destination directory (with / replaced by _)
  This has the benefit of minimizing the targets created.
  
  MFC r351954
  
  Reviewed by:  bdrewery
  Differential Revision:https://reviews.freebsd.org//D21283

Modified:
  stable/12/share/mk/bsd.files.mk

Modified: stable/12/share/mk/bsd.files.mk
==
--- stable/12/share/mk/bsd.files.mk Fri Sep 13 01:14:58 2019
(r352272)
+++ stable/12/share/mk/bsd.files.mk Fri Sep 13 05:54:09 2019
(r352273)
@@ -37,7 +37,6 @@ ${group}GRP=  ${SHAREGRP}
 ${group}MODE?= ${SHAREMODE}
 ${group}DIR?=  BINDIR
 STAGE_SETS+=   ${group:C,[/*],_,g}
-STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR}
 
 .if defined(NO_ROOT)
 .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*}
@@ -57,6 +56,7 @@ DIRS+=${group}DIR
 _${group}DIR=  ${group}DIR
 .endif
 
+STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR}}
 
 .for file in ${${group}}
 ${group}OWN_${file}?=  ${${group}OWN}
@@ -97,11 +97,16 @@ ${group}NAME_${file}?=  ${${group}NAME}
 .else
 ${group}NAME_${file}?= ${file:T}
 .endif # defined(${group}NAME)
-STAGE_AS_SETS+=${file}
 STAGE_AS_${file}= ${${group}NAME_${file}}
-# XXX {group}OWN,GRP,MODE
-STAGE_DIR.${file}= ${STAGE_OBJTOP}${${group}DIR_${file}}
-stage_as.${file}: ${file}
+# we cannot use file safely as a set name
+# since we cannot? apply :T
+# but we can use the ${group}DIR_${file}
+# as a set - meta.stage.mk will :O:u for us
+# we need to expand ${group}DIR_${file} and replace
+# all '/' and '*' with '_' to make a safe target name.
+STAGE_AS_SETS+=${${_${group}DIR_${file}}:C,[/*],_,g}
+STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= 
${STAGE_OBJTOP}${${group}DIR_${file}}
+stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
 _${group}INS1_${file}: installdirs-${_${group}DIR_${file}} _${group}INS_${file}
@@ -118,12 +123,16 @@ realinstall: installfiles
 .ORDER: beforeinstall installfiles
 
 .if ${MK_STAGING} != "no"
+.if ${FILESGROUPS:@g@${$g}@} != ""
 .if !empty(STAGE_SETS)
 buildfiles: stage_files
 STAGE_TARGETS+= stage_files
+stage_files:
 .if !empty(STAGE_AS_SETS)
 buildfiles: stage_as
 STAGE_TARGETS+= stage_as
+stage_as:
+.endif
 .endif
 .endif
 .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"


Re: svn commit: r352248 - head/usr.sbin/ntp/libntp

2019-09-12 Thread John Baldwin
On 9/12/19 6:53 PM, Ian Lepore wrote:
> On Thu, 2019-09-12 at 15:46 +, Baptiste Daroussin wrote:
>> Author: bapt
>> Date: Thu Sep 12 15:46:58 2019
>> New Revision: 352248
>> URL: https://svnweb.freebsd.org/changeset/base/352248
>>
>> Log:
>>   Get the readline header from the installed header instead of the from the 
>> source
>>   location.
>>   
> 
> How can this possibly be right?  One of the hallmarks of our build
> system is that it is self-contained in the sense that it uses the
> sources to build the sources, not sources or files from the host
> machine being used to do the build.

I think the issue is that the readline compat headers are installed at
/usr/include/edit/readline/foo.h, so you need the equivalent of
-I/usr/include/edit.  If there was a way to make -I honor --sysroot (e.g.
-I=/usr/include/edit) then that might be the cleaner way to handle this.

-- 
John Baldwin
___
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: r352272 - stable/12/sys/dev/cxgbe/tom

2019-09-12 Thread Navdeep Parhar
Author: np
Date: Fri Sep 13 01:14:58 2019
New Revision: 352272
URL: https://svnweb.freebsd.org/changeset/base/352272

Log:
  MFC r351445:
  
  whitespace nit.

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_listen.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/tom/t4_listen.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_listen.c Fri Sep 13 01:12:17 2019
(r352271)
+++ stable/12/sys/dev/cxgbe/tom/t4_listen.c Fri Sep 13 01:14:58 2019
(r352272)
@@ -1034,7 +1034,7 @@ get_l2te_for_nexthop(struct port_info *pi, struct ifne
struct l2t_entry *e;
struct sockaddr_in6 sin6;
struct sockaddr *dst = (void *)
- 
+
if (inc->inc_flags & INC_ISIPV6) {
struct nhop6_basic nh6;
 
___
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: r352271 - in stable/12/sys/dev/cxgbe: . cxgbei iw_cxgbe tom

2019-09-12 Thread Navdeep Parhar
Author: np
Date: Fri Sep 13 01:12:17 2019
New Revision: 352271
URL: https://svnweb.freebsd.org/changeset/base/352271

Log:
  MFC r351540, r351590
  
  r351540:
  cxgbe/t4_tom: Initialize all TOE connection parameters in one place.
  Remove now-redundant items from toepcb and synq_entry and the code to
  support them.
  
  Let the driver calculate tx_align, rx_coalesce, and sndbuf by default.
  
  Reviewed by:  jhb@
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D21387
  
  r351590:
  cxgbe/t4_tom: Use the correct value of sndbuf in AIO Tx.
  
  This should have been part of r351540.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
  stable/12/sys/dev/cxgbe/iw_cxgbe/qp.c
  stable/12/sys/dev/cxgbe/t4_main.c
  stable/12/sys/dev/cxgbe/tom/t4_connect.c
  stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
  stable/12/sys/dev/cxgbe/tom/t4_ddp.c
  stable/12/sys/dev/cxgbe/tom/t4_listen.c
  stable/12/sys/dev/cxgbe/tom/t4_tls.c
  stable/12/sys/dev/cxgbe/tom/t4_tom.c
  stable/12/sys/dev/cxgbe/tom/t4_tom.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
==
--- stable/12/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Fri Sep 13 01:07:19 2019
(r352270)
+++ stable/12/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Fri Sep 13 01:12:17 2019
(r352271)
@@ -696,7 +696,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd)
ISCSI_DATA_DIGEST_SIZE;
}
so->so_options |= SO_NO_DDP;
-   toep->ulp_mode = ULP_MODE_ISCSI;
+   toep->params.ulp_mode = ULP_MODE_ISCSI;
toep->ulpcb = icc;
 
send_iscsi_flowc_wr(icc->sc, toep, ci->max_tx_pdu_len);

Modified: stable/12/sys/dev/cxgbe/iw_cxgbe/qp.c
==
--- stable/12/sys/dev/cxgbe/iw_cxgbe/qp.c   Fri Sep 13 01:07:19 2019
(r352270)
+++ stable/12/sys/dev/cxgbe/iw_cxgbe/qp.c   Fri Sep 13 01:12:17 2019
(r352271)
@@ -1415,7 +1415,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw
ret = c4iw_wait_for_reply(rdev, >com.wr_wait, ep->hwtid,
qhp->wq.sq.qid, ep->com.so, __func__);
 
-   toep->ulp_mode = ULP_MODE_RDMA;
+   toep->params.ulp_mode = ULP_MODE_RDMA;
free_ird(rhp, qhp->attr.max_ird);
 
return ret;

Modified: stable/12/sys/dev/cxgbe/t4_main.c
==
--- stable/12/sys/dev/cxgbe/t4_main.c   Fri Sep 13 01:07:19 2019
(r352270)
+++ stable/12/sys/dev/cxgbe/t4_main.c   Fri Sep 13 01:12:17 2019
(r352271)
@@ -6231,15 +6231,15 @@ t4_sysctls(struct adapter *sc)
"(-1 = default, 0 = reno, 1 = tahoe, 2 = newreno, "
"3 = highspeed)");
 
-   sc->tt.sndbuf = 256 * 1024;
+   sc->tt.sndbuf = -1;
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "sndbuf", CTLFLAG_RW,
-   >tt.sndbuf, 0, "max hardware send buffer size");
+   >tt.sndbuf, 0, "hardware send buffer");
 
sc->tt.ddp = 0;
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ddp", CTLFLAG_RW,
>tt.ddp, 0, "DDP allowed");
 
-   sc->tt.rx_coalesce = 1;
+   sc->tt.rx_coalesce = -1;
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce",
CTLFLAG_RW, >tt.rx_coalesce, 0, "receive coalescing");
 
@@ -6251,7 +6251,7 @@ t4_sysctls(struct adapter *sc)
CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_tls_rx_ports,
"I", "TCP ports that use inline TLS+TOE RX");
 
-   sc->tt.tx_align = 1;
+   sc->tt.tx_align = -1;
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_align",
CTLFLAG_RW, >tt.tx_align, 0, "chop and align payload");
 

Modified: stable/12/sys/dev/cxgbe/tom/t4_connect.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_connect.cFri Sep 13 01:07:19 2019
(r352270)
+++ stable/12/sys/dev/cxgbe/tom/t4_connect.cFri Sep 13 01:12:17 2019
(r352271)
@@ -102,7 +102,7 @@ do_act_establish(struct sge_iq *iq, const struct rss_h
make_established(toep, be32toh(cpl->snd_isn) - 1,
be32toh(cpl->rcv_isn) - 1, cpl->tcp_opt);
 
-   if (toep->ulp_mode == ULP_MODE_TLS)
+   if (ulp_mode(toep) == ULP_MODE_TLS)
tls_establish(toep);
 
 done:
@@ -165,96 +165,6 @@ do_act_open_rpl(struct sge_iq *iq, const struct rss_he
return (0);
 }
 
-/*
- * Options2 for active open.
- */
-static uint32_t
-calc_opt2a(struct socket *so, struct toepcb *toep,
-const struct offload_settings *s)
-{
-   struct tcpcb 

svn commit: r352268 - stable/12/sys/dev/cxgbe/tom

2019-09-12 Thread Navdeep Parhar
Author: np
Date: Fri Sep 13 00:58:33 2019
New Revision: 352268
URL: https://svnweb.freebsd.org/changeset/base/352268

Log:
  MFC r351524:
  
  cxgbe/t4_tom: Limit work requests with immediate payload to a single
  descriptor.  The per-tid tx credits are in demand during active Tx and
  it's best not to use too many just for payload.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Sep 13 00:53:09 2019
(r352267)
+++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Sep 13 00:58:33 2019
(r352268)
@@ -562,7 +562,7 @@ t4_close_conn(struct adapter *sc, struct toepcb *toep)
 static inline int
 max_imm_payload(int tx_credits)
 {
-   const int n = 2;/* Use only up to 2 desc for imm. data WR */
+   const int n = 1;/* Use no more than one desc for imm. data WR */
 
KASSERT(tx_credits >= 0 &&
tx_credits <= MAX_OFLD_TX_CREDITS,
___
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: r352267 - stable/12/sys/dev/cxgbe/tom

2019-09-12 Thread Navdeep Parhar
Author: np
Date: Fri Sep 13 00:53:09 2019
New Revision: 352267
URL: https://svnweb.freebsd.org/changeset/base/352267

Log:
  MFC r351446:
  
  cxgbe/t4_tom: Any invalid scaling factor in the hardware's wsf field
  implies that window scaling is not in use.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_listen.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/tom/t4_listen.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_listen.c Thu Sep 12 21:12:39 2019
(r352266)
+++ stable/12/sys/dev/cxgbe/tom/t4_listen.c Fri Sep 13 00:53:09 2019
(r352267)
@@ -994,7 +994,7 @@ t4opt_to_tcpopt(const struct tcp_options *t4opt, struc
to->to_mss = be16toh(t4opt->mss);
}
 
-   if (t4opt->wsf) {
+   if (t4opt->wsf > 0 && t4opt->wsf < 15) {
to->to_flags |= TOF_SCALE;
to->to_wscale = t4opt->wsf;
}
___
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: r351226 - head/sbin/ping

2019-09-12 Thread Alan Somers
On Mon, Aug 19, 2019 at 11:54 AM Alan Somers  wrote:

> Author: asomers
> Date: Mon Aug 19 17:54:40 2019
> New Revision: 351226
> URL: https://svnweb.freebsd.org/changeset/base/351226
>
> Log:
>   Fix uninitialized variable warnings when MK_CASPER=no
>
>   Submitted by: Ján Sučan 
>   MFC after:2 weeks
>   Sponsored by: Google, inc. (Google Summer of Code 2019)
>   Differential Revision:https://reviews.freebsd.org/D21322
>
> Modified:
>   head/sbin/ping/ping.c
>

Correction: the commit message should've said "unused variable warnings",
not "uninitialized variable warnings".
-Alan
___
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: r352266 - stable/12/sys/compat/linuxkpi/common/include/linux

2019-09-12 Thread Johannes Lundberg
Author: johalun
Date: Thu Sep 12 21:12:39 2019
New Revision: 352266
URL: https://svnweb.freebsd.org/changeset/base/352266

Log:
  MFC r345103:
  Implement more PCI speed related functions and macros in the LinuxKPI.
  
  Submitted by: Johannes Lundberg 
  Sponsored by: Limelight Networks
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/include/linux/pci.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/pci.hThu Sep 12 
20:46:46 2019(r352265)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/pci.hThu Sep 12 
21:12:39 2019(r352266)
@@ -139,10 +139,13 @@ struct pci_device_id {
 #definePCI_EXP_TYPE_RC_EC  PCIEM_TYPE_ROOT_EC  /* Root 
Complex Event Collector */
 #definePCI_EXP_LNKCAP_SLS_2_5GB 0x01   /* Supported Link Speed 2.5GT/s 
*/
 #definePCI_EXP_LNKCAP_SLS_5_0GB 0x02   /* Supported Link Speed 5.0GT/s 
*/
+#definePCI_EXP_LNKCAP_SLS_8_0GB 0x04   /* Supported Link Speed 8.0GT/s 
*/
+#definePCI_EXP_LNKCAP_SLS_16_0GB 0x08  /* Supported Link Speed 
16.0GT/s */
 #definePCI_EXP_LNKCAP_MLW  0x03f0  /* Maximum Link Width */
 #definePCI_EXP_LNKCAP2_SLS_2_5GB 0x02  /* Supported Link Speed 2.5GT/s 
*/
 #definePCI_EXP_LNKCAP2_SLS_5_0GB 0x04  /* Supported Link Speed 5.0GT/s 
*/
 #definePCI_EXP_LNKCAP2_SLS_8_0GB 0x08  /* Supported Link Speed 8.0GT/s 
*/
+#definePCI_EXP_LNKCAP2_SLS_16_0GB 0x10 /* Supported Link Speed 
16.0GT/s */
 
 #define PCI_EXP_LNKCTL_HAWDPCIEM_LINK_CTL_HAWD
 #define PCI_EXP_LNKCAP_CLKPM   0x0004
@@ -157,10 +160,19 @@ enum pci_bus_speed {
PCIE_SPEED_2_5GT,
PCIE_SPEED_5_0GT,
PCIE_SPEED_8_0GT,
+   PCIE_SPEED_16_0GT,
 };
 
 enum pcie_link_width {
-   PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
+   PCIE_LNK_WIDTH_RESRV= 0x00,
+   PCIE_LNK_X1 = 0x01,
+   PCIE_LNK_X2 = 0x02,
+   PCIE_LNK_X4 = 0x04,
+   PCIE_LNK_X8 = 0x08,
+   PCIE_LNK_X12= 0x0c,
+   PCIE_LNK_X16= 0x10,
+   PCIE_LNK_X32= 0x20,
+   PCIE_LNK_WIDTH_UNKNOWN  = 0xff,
 };
 
 typedef int pci_power_t;
@@ -889,6 +901,67 @@ static inline int
 pci_num_vf(struct pci_dev *dev)
 {
return (0);
+}
+
+static inline enum pci_bus_speed
+pcie_get_speed_cap(struct pci_dev *dev)
+{
+   device_t root;
+   uint32_t lnkcap, lnkcap2;
+   int error, pos;
+
+   root = device_get_parent(dev->dev.bsddev);
+   if (root == NULL)
+   return (PCI_SPEED_UNKNOWN);
+   root = device_get_parent(root);
+   if (root == NULL)
+   return (PCI_SPEED_UNKNOWN);
+   root = device_get_parent(root);
+   if (root == NULL)
+   return (PCI_SPEED_UNKNOWN);
+
+   if (pci_get_vendor(root) == PCI_VENDOR_ID_VIA ||
+   pci_get_vendor(root) == PCI_VENDOR_ID_SERVERWORKS)
+   return (PCI_SPEED_UNKNOWN);
+
+   if ((error = pci_find_cap(root, PCIY_EXPRESS, )) != 0)
+   return (PCI_SPEED_UNKNOWN);
+
+   lnkcap2 = pci_read_config(root, pos + PCIER_LINK_CAP2, 4);
+
+   if (lnkcap2) {  /* PCIe r3.0-compliant */
+   if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_2_5GB)
+   return (PCIE_SPEED_2_5GT);
+   if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_5_0GB)
+   return (PCIE_SPEED_5_0GT);
+   if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB)
+   return (PCIE_SPEED_8_0GT);
+   if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_16_0GB)
+   return (PCIE_SPEED_16_0GT);
+   } else {/* pre-r3.0 */
+   lnkcap = pci_read_config(root, pos + PCIER_LINK_CAP, 4);
+   if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB)
+   return (PCIE_SPEED_2_5GT);
+   if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB)
+   return (PCIE_SPEED_5_0GT);
+   if (lnkcap & PCI_EXP_LNKCAP_SLS_8_0GB)
+   return (PCIE_SPEED_8_0GT);
+   if (lnkcap & PCI_EXP_LNKCAP_SLS_16_0GB)
+   return (PCIE_SPEED_16_0GT);
+   }
+   return (PCI_SPEED_UNKNOWN);
+}
+
+static inline enum pcie_link_width
+pcie_get_width_cap(struct pci_dev *dev)
+{
+   uint32_t lnkcap;
+
+   pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, );
+   if (lnkcap)
+   return ((lnkcap & PCI_EXP_LNKCAP_MLW) >> 4);
+
+   return (PCIE_LNK_WIDTH_UNKNOWN);
 }
 
 #endif /* _LINUX_PCI_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: r352265 - head/contrib/mtree

2019-09-12 Thread Bryan Drewery
Author: bdrewery
Date: Thu Sep 12 20:46:46 2019
New Revision: 352265
URL: https://svnweb.freebsd.org/changeset/base/352265

Log:
  mtree -O: Fix not descending on hash collisions
  
  MFC after:2 weeks
  Obtained from:NetBSD (nakayama)

Modified:
  head/contrib/mtree/only.c

Modified: head/contrib/mtree/only.c
==
--- head/contrib/mtree/only.c   Thu Sep 12 20:15:04 2019(r352264)
+++ head/contrib/mtree/only.c   Thu Sep 12 20:46:46 2019(r352265)
@@ -1,4 +1,4 @@
-/* $NetBSD: only.c,v 1.2 2013/02/05 00:59:03 christos Exp $*/
+/* $NetBSD: only.c,v 1.3 2017/09/07 04:04:13 nakayama Exp $*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #include 
 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: only.c,v 1.2 2013/02/05 00:59:03 christos Exp $");
+__RCSID("$NetBSD: only.c,v 1.3 2017/09/07 04:04:13 nakayama Exp $");
 #endif
 
 #include 
@@ -89,11 +89,14 @@ static void
 hash_insert(char *str, uint32_t h)
 {
struct hentry *e;
+   char *x;
 
if ((e = malloc(sizeof(*e))) == NULL)
mtree_err("memory allocation error");
+   if ((x = strdup(str)) == NULL)
+   mtree_err("memory allocation error");
 
-   e->str = str;
+   e->str = x;
e->hash = h;
e->next = table[h];
table[h] = e;
@@ -110,10 +113,7 @@ fill(char *str)
 
*ptr = '\0';
if (!hash_find(str, )) {
-   char *x = strdup(str);
-   if (x == NULL)
-   mtree_err("memory allocation error");
-   hash_insert(x, h);
+   hash_insert(str, h);
fill(str);
}
*ptr = '/';
@@ -135,6 +135,7 @@ load_only(const char *fname)
err(1, "Duplicate entry %s", line);
hash_insert(line, h);
fill(line);
+   free(line);
}
 
fclose(fp);
___
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: r352264 - stable/12/sys/compat/linuxkpi/common/include/linux

2019-09-12 Thread Johannes Lundberg
Author: johalun
Date: Thu Sep 12 20:15:04 2019
New Revision: 352264
URL: https://svnweb.freebsd.org/changeset/base/352264

Log:
  MFC r345100:
  Implement task_euid() and get_task_state() function macros in the LinuxKPI.
  
  Submitted by: Johannes Lundberg 
  Sponsored by: Limelight Networks
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/include/linux/sched.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sched.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/sched.h  Thu Sep 12 
18:53:29 2019(r352263)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/sched.h  Thu Sep 12 
20:15:04 2019(r352264)
@@ -96,7 +96,9 @@ struct task_struct {
 #defineget_pid(x)  (x)
 #defineput_pid(x)  do { } while (0)
 #definecurrent_euid()  (curthread->td_ucred->cr_uid)
+#definetask_euid(task) ((task)->task_thread->td_ucred->cr_uid)
 
+#defineget_task_state(task)atomic_read(&(task)->state)
 #defineset_task_state(task, x) atomic_set(&(task)->state, (x))
 #define__set_task_state(task, x)   ((task)->state.counter = (x))
 #defineset_current_state(x)set_task_state(current, 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"


Re: svn commit: r352231 - head/lib/libc/sys

2019-09-12 Thread Ian Lepore
On Thu, 2019-09-12 at 13:02 -0700, Cy Schubert wrote:
> In message <
> 63cf915c92b92b07e19337849269ec6bd0dc0d1b.ca...@freebsd.org>, 
> Ian Le
> pore writes:
> > On Wed, 2019-09-11 at 19:48 +, Alan Somers wrote:
> > > Author: asomers
> > > Date: Wed Sep 11 19:48:32 2019
> > > New Revision: 352231
> > > URL: https://svnweb.freebsd.org/changeset/base/352231
> > > 
> > > Log:
> > >   getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable
> > >   
> > >   When SO_TIMESTAMP is set, the kernel will attempt to attach a
> > > timestamp a
> > 
> > s
> > >   ancillary data to each IP datagram that is received on the
> > > socket. Howeve
> > 
> > r,
> > >   it may fail, for example due to insufficient memory. In that
> > > case the
> > >   packet will still be received but not timestamp will be
> > > attached.
> > >   
> > >   Reviewed by:kib
> > >   MFC after:  3 days
> > >   Differential Revision:  https://reviews.freebsd.org/D21607
> > > 
> > > Modified:
> > >   head/lib/libc/sys/getsockopt.2
> > > 
> > > Modified: head/lib/libc/sys/getsockopt.2
> > > =
> > > ==
> > 
> > ===
> > > --- head/lib/libc/sys/getsockopt.2Wed Sep 11 19:29:40
> > > 2019  (r35223
> > 
> > 0)
> > > +++ head/lib/libc/sys/getsockopt.2Wed Sep 11 19:48:32
> > > 2019  (r35223
> > 
> > 1)
> > > @@ -28,7 +28,7 @@
> > >  .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95
> > >  .\" $FreeBSD$
> > >  .\"
> > > -.Dd February 10, 2019
> > > +.Dd September 11, 2019
> > >  .Dt GETSOCKOPT 2
> > >  .Os
> > >  .Sh NAME
> > > @@ -431,7 +431,8 @@ option is enabled on a
> > >  .Dv SOCK_DGRAM
> > >  socket, the
> > >  .Xr recvmsg 2
> > > -call will return a timestamp corresponding to when the datagram
> > > was receiv
> > 
> > ed.
> > > +call may return a timestamp corresponding to when the datagram
> > > was receive
> > 
> > d.
> > > +However, it may not, for example due to a resource shortage.
> > >  The
> > >  .Va msg_control
> > >  field in the
> > > 
> > 
> > So I guess this actually happened to someone... is it a common
> > thing
> > for the timestamp to fail?  I ask because ntpd relies on
> > SO_TIMESTAMP
> > and if this situation really happens and can persist for a long
> > time,
> > ntpd would effectively stop working.
> 
> This reminds me, something that's been on my plate for a couple of
> weeks. 
> Our NTP upline pinged me a few weeks ago regarding IEEE 1588 driver
> support 
> for NICs with hardware support. Linux already has it. I was told
> that 
> someone hrtr has attempted this but that the results weren't
> optimal. 
> That's all I know. Should I open discussion on arch@?

It's something I've been wanting to do for a while, and something that
would be helpful at $work, so a discussion on it sounds like a good
idea.

-- Ian

___
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: r352231 - head/lib/libc/sys

2019-09-12 Thread Cy Schubert
In message <63cf915c92b92b07e19337849269ec6bd0dc0d1b.ca...@freebsd.org>, 
Ian Le
pore writes:
> On Wed, 2019-09-11 at 19:48 +, Alan Somers wrote:
> > Author: asomers
> > Date: Wed Sep 11 19:48:32 2019
> > New Revision: 352231
> > URL: https://svnweb.freebsd.org/changeset/base/352231
> > 
> > Log:
> >   getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable
> >   
> >   When SO_TIMESTAMP is set, the kernel will attempt to attach a timestamp a
> s
> >   ancillary data to each IP datagram that is received on the socket. Howeve
> r,
> >   it may fail, for example due to insufficient memory. In that case the
> >   packet will still be received but not timestamp will be attached.
> >   
> >   Reviewed by:  kib
> >   MFC after:3 days
> >   Differential Revision:https://reviews.freebsd.org/D21607
> > 
> > Modified:
> >   head/lib/libc/sys/getsockopt.2
> > 
> > Modified: head/lib/libc/sys/getsockopt.2
> > ===
> ===
> > --- head/lib/libc/sys/getsockopt.2  Wed Sep 11 19:29:40 2019(r35223
> 0)
> > +++ head/lib/libc/sys/getsockopt.2  Wed Sep 11 19:48:32 2019(r35223
> 1)
> > @@ -28,7 +28,7 @@
> >  .\" @(#)getsockopt.2   8.4 (Berkeley) 5/2/95
> >  .\" $FreeBSD$
> >  .\"
> > -.Dd February 10, 2019
> > +.Dd September 11, 2019
> >  .Dt GETSOCKOPT 2
> >  .Os
> >  .Sh NAME
> > @@ -431,7 +431,8 @@ option is enabled on a
> >  .Dv SOCK_DGRAM
> >  socket, the
> >  .Xr recvmsg 2
> > -call will return a timestamp corresponding to when the datagram was receiv
> ed.
> > +call may return a timestamp corresponding to when the datagram was receive
> d.
> > +However, it may not, for example due to a resource shortage.
> >  The
> >  .Va msg_control
> >  field in the
> > 
>
> So I guess this actually happened to someone... is it a common thing
> for the timestamp to fail?  I ask because ntpd relies on SO_TIMESTAMP
> and if this situation really happens and can persist for a long time,
> ntpd would effectively stop working.

This reminds me, something that's been on my plate for a couple of weeks. 
Our NTP upline pinged me a few weeks ago regarding IEEE 1588 driver support 
for NICs with hardware support. Linux already has it. I was told that 
someone hrtr has attempted this but that the results weren't optimal. 
That's all I know. Should I open discussion on arch@?


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
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: r352231 - head/lib/libc/sys

2019-09-12 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Wed, 2019-09-11 at 15:55 -0600, Alan Somers wrote:
> > On Wed, Sep 11, 2019 at 3:50 PM Ian Lepore  wrote:
> > 
> > > On Wed, 2019-09-11 at 19:48 +, Alan Somers wrote:
> > > > Author: asomers
> > > > Date: Wed Sep 11 19:48:32 2019
> > > > New Revision: 352231
> > > > URL: https://svnweb.freebsd.org/changeset/base/352231
> > > > 
> > > > Log:
> > > >   getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable
> > > > 
> > > >   When SO_TIMESTAMP is set, the kernel will attempt to attach a
> > > 
> > > timestamp as
> > > >   ancillary data to each IP datagram that is received on the socket.
> > > 
> > > However,
> > > >   it may fail, for example due to insufficient memory. In that case the
> > > >   packet will still be received but not timestamp will be attached.
> > > > 
> > > >   Reviewed by:kib
> > > >   MFC after:  3 days
> > > >   Differential Revision:  https://reviews.freebsd.org/D21607
> > > > 
> > > > Modified:
> > > >   head/lib/libc/sys/getsockopt.2
> > > > 
> > > > Modified: head/lib/libc/sys/getsockopt.2
> > > > 
> > > 
> > > ==
> > > > --- head/lib/libc/sys/getsockopt.2Wed Sep 11 19:29:40 2019
> > > 
> > > (r352230)
> > > > +++ head/lib/libc/sys/getsockopt.2Wed Sep 11 19:48:32 2019
> > > 
> > > (r352231)
> > > > @@ -28,7 +28,7 @@
> > > >  .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95
> > > >  .\" $FreeBSD$
> > > >  .\"
> > > > -.Dd February 10, 2019
> > > > +.Dd September 11, 2019
> > > >  .Dt GETSOCKOPT 2
> > > >  .Os
> > > >  .Sh NAME
> > > > @@ -431,7 +431,8 @@ option is enabled on a
> > > >  .Dv SOCK_DGRAM
> > > >  socket, the
> > > >  .Xr recvmsg 2
> > > > -call will return a timestamp corresponding to when the datagram was
> > > 
> > > received.
> > > > +call may return a timestamp corresponding to when the datagram was
> > > 
> > > received.
> > > > +However, it may not, for example due to a resource shortage.
> > > >  The
> > > >  .Va msg_control
> > > >  field in the
> > > > 
> > > 
> > > So I guess this actually happened to someone... is it a common thing
> > > for the timestamp to fail?  I ask because ntpd relies on SO_TIMESTAMP
> > > and if this situation really happens and can persist for a long time,
> > > ntpd would effectively stop working.
> > > 
> > > -- Ian
> > > 
> > 
> > pho discovered how to trigger it.  If you start 50 ping processes
> > simultaneously, sometimes a few will fail.  Will ntpd be ok with a single
> > failure, as long as the timestamp is received correctly in a subsequent
> > packet?
> > -Alan
> 
> Yeah, nptd is resilient to missing data and intermittent comms, within
> reason.  If it goes hours without getting a timestamp, system time
> would start to drift.  Running 50 concurrent pings sounds like
> something that won't come up in the real world. :)

I would think this is worth investigation, as the 50 pings are
most likely not the only trigger event for this problem.

> -- Ian
-- 
Rod Grimes rgri...@freebsd.org
___
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: r352248 - head/usr.sbin/ntp/libntp

2019-09-12 Thread Cy Schubert
In message <54c8efce3064f685c1948546bebaccc5f56a09c1.ca...@freebsd.org>, 
Ian Le
pore writes:
> On Thu, 2019-09-12 at 15:46 +, Baptiste Daroussin wrote:
> > Author: bapt
> > Date: Thu Sep 12 15:46:58 2019
> > New Revision: 352248
> > URL: https://svnweb.freebsd.org/changeset/base/352248
> > 
> > Log:
> >   Get the readline header from the installed header instead of the from the
>  source
> >   location.
> >   
>
> How can this possibly be right?  One of the hallmarks of our build
> system is that it is self-contained in the sense that it uses the
> sources to build the sources, not sources or files from the host
> machine being used to do the build.
>
> -- Ian
>

This is correct: use $DESTDIR if $SYSROOT is undefined. liebedit should 
already be installed in $SYSROOT by the time we get here. I'd prefer that 
we simply bail if $SYSROOT is undefined.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


> >   With newer import of libedit, the path to be able to access
> > readline/readline.h
> >   will also include header which name will conflict with some
> > expected by ntp in
> >   another path and end up breaking the build.
> > 
> > Modified:
> >   head/usr.sbin/ntp/libntp/Makefile
> > 
> > Modified: head/usr.sbin/ntp/libntp/Makefile
> > =
> > =
> > --- head/usr.sbin/ntp/libntp/Makefile   Thu Sep 12 15:44:53 2019
>   (r352
> > 247)
> > +++ head/usr.sbin/ntp/libntp/Makefile   Thu Sep 12 15:46:58 2019
>   (r352
> > 248)
> > @@ -79,7 +79,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \
> > -I${SRCTOP}/contrib/ntp/lib/isc/pthreads/include \
> > -I${SRCTOP}/contrib/ntp/sntp/libopts \
> > -I${SRCTOP}/lib/libc/${MACHINE_ARCH} \
> > -   -I${SRCTOP}/lib/libedit/edit \
> > +   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit \
> > -I${.CURDIR:H} \
> > -I${.CURDIR}/
> >  
> > 
>
>


___
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: r352263 - in head: etc/mtree usr.sbin/jail usr.sbin/jail/tests

2019-09-12 Thread Michael Zhilin
Author: mizhka
Date: Thu Sep 12 18:53:29 2019
New Revision: 352263
URL: https://svnweb.freebsd.org/changeset/base/352263

Log:
  [jail] removal by jid doesn't trigger pre/post stop scripts
  
  This commit fixes bug: command "jail -r" didn't trigger pre/post stop
  commands (and others) defined in config file if jid is specified insted of
  name. Also it adds basic tests for usr.sbin/jail to avoid regression.
  
  Reviewed by:  jamie, kevans, ray
  MFC after:  5 days
  Differential Revision: https://reviews.freebsd.org/D21328

Added:
  head/usr.sbin/jail/tests/
  head/usr.sbin/jail/tests/Makefile   (contents, props changed)
  head/usr.sbin/jail/tests/commands.jail.conf   (contents, props changed)
  head/usr.sbin/jail/tests/jail_basic_test.sh   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/usr.sbin/jail/Makefile
  head/usr.sbin/jail/state.c

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Thu Sep 12 18:51:59 2019
(r352262)
+++ head/etc/mtree/BSD.tests.dist   Thu Sep 12 18:53:29 2019
(r352263)
@@ -1082,6 +1082,8 @@
 ..
 fstyp
 ..
+jail
+..
 makefs
 ..
 mixer

Modified: head/usr.sbin/jail/Makefile
==
--- head/usr.sbin/jail/Makefile Thu Sep 12 18:51:59 2019(r352262)
+++ head/usr.sbin/jail/Makefile Thu Sep 12 18:53:29 2019(r352263)
@@ -24,4 +24,7 @@ CFLAGS+= -DINET
 
 CLEANFILES= y.output
 
+HAS_TESTS=
+SUBDIR.${MK_TESTS}+= tests
+
 .include 

Modified: head/usr.sbin/jail/state.c
==
--- head/usr.sbin/jail/state.c  Thu Sep 12 18:51:59 2019(r352262)
+++ head/usr.sbin/jail/state.c  Thu Sep 12 18:53:29 2019(r352263)
@@ -44,7 +44,7 @@ static void dep_add(struct cfjail *from, struct cfjail
 static int cmp_jailptr(const void *a, const void *b);
 static int cmp_jailptr_name(const void *a, const void *b);
 static struct cfjail *find_jail(const char *name);
-static int running_jid(const char *name, int flags);
+static struct cfjail *running_jail(const char *name, int flags);
 
 static struct cfjail **jails_byname;
 static size_t njails;
@@ -72,7 +72,7 @@ dep_setup(int docf)
if ((j = TAILQ_FIRST()) &&
(p = j->intparams[IP_DEPEND])) {
TAILQ_FOREACH(s, >val, tq) {
-   if (running_jid(s->s, 0) < 0) {
+   if (running_jail(s->s, 0) == NULL) {
warnx("depends on nonexistent jail "
"\"%s\"", s->s);
j->flags |= JF_FAILED;
@@ -369,11 +369,7 @@ start_state(const char *target, int docf, unsigned sta
j = find_jail(target);
if (j == NULL && state == JF_STOP) {
/* Allow -[rR] to specify a currently running jail. */
-   if ((jid = running_jid(target, JAIL_DYING)) > 0) {
-   j = add_jail();
-   j->name = estrdup(target);
-   j->jid = jid;
-   }
+   j = running_jail(target, JAIL_DYING);
}
if (j == NULL) {
warnx("\"%s\" not found", target);
@@ -446,6 +442,9 @@ static struct cfjail *
 find_jail(const char *name)
 {
struct cfjail **jp;
+   
+   if (jails_byname == NULL)
+   return NULL;
 
jp = bsearch(name, jails_byname, njails, sizeof(struct cfjail *),
cmp_jailptr_name);
@@ -453,26 +452,43 @@ find_jail(const char *name)
 }
 
 /*
- * Return the named jail's jid if it is running, and -1 if it isn't.
+ * Return jail if it is running, and NULL if it isn't.
  */
-static int
-running_jid(const char *name, int flags)
+static struct cfjail *
+running_jail(const char *name, int flags)
 {
-   struct iovec jiov[2];
+   struct iovec jiov[4];
+   struct cfjail *jail;
char *ep;
-   int jid;
-
+   char jailname[MAXHOSTNAMELEN];
+   int jid, ret, len;
+   
if ((jid = strtol(name, , 10)) && !*ep) {
-   jiov[0].iov_base = __DECONST(char *, "jid");
-   jiov[0].iov_len = sizeof("jid");
-   jiov[1].iov_base = 
-   jiov[1].iov_len = sizeof(jid);
+   memset(jailname,0,sizeof(jailname));
+   len = sizeof(jailname);
} else {
-   jiov[0].iov_base = __DECONST(char *, "name");
-   jiov[0].iov_len = sizeof("name");
-   jiov[1].iov_len = strlen(name) + 1;
-   jiov[1].iov_base = alloca(jiov[1].iov_len);
-   strcpy(jiov[1].iov_base, name);
+  

svn commit: r352262 - head/contrib/mtree

2019-09-12 Thread Bryan Drewery
Author: bdrewery
Date: Thu Sep 12 18:51:59 2019
New Revision: 352262
URL: https://svnweb.freebsd.org/changeset/base/352262

Log:
  mtree -c: Fix username logic when getlogin(3) fails.
  
  Obtained from:NetBSD (Credit to Sascha Wildner with DragonFlyBSD)
  MFC after:2 weeks

Modified:
  head/contrib/mtree/create.c

Modified: head/contrib/mtree/create.c
==
--- head/contrib/mtree/create.c Thu Sep 12 18:44:48 2019(r352261)
+++ head/contrib/mtree/create.c Thu Sep 12 18:51:59 2019(r352262)
@@ -117,7 +117,7 @@ cwalk(FILE *fp)
host[sizeof(host) - 1] = '\0';
if ((user = getlogin()) == NULL) {
struct passwd *pw;
-   user = (pw = getpwuid(getuid())) == NULL ? pw->pw_name :
+   user = (pw = getpwuid(getuid())) != NULL ? pw->pw_name :
"";
}
 
___
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: r352261 - in head: contrib/mtree contrib/netbsd-tests/usr.sbin/mtree usr.sbin/fmtree

2019-09-12 Thread Bryan Drewery
Author: bdrewery
Date: Thu Sep 12 18:44:48 2019
New Revision: 352261
URL: https://svnweb.freebsd.org/changeset/base/352261

Log:
  mtree: Fix -f -f not considering type changes.
  
  This only lists the changed type and not other attributes so that it
  matches the behavior of -C as done in r66747 for fmtree. The NetBSD
  -ff implementation was copied from fmtree.
  
  Reviewed by:  imp
  MFC after:2 weeks
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D21623

Modified:
  head/contrib/mtree/specspec.c
  head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh
  head/usr.sbin/fmtree/specspec.c

Modified: head/contrib/mtree/specspec.c
==
--- head/contrib/mtree/specspec.c   Thu Sep 12 18:37:26 2019
(r352260)
+++ head/contrib/mtree/specspec.c   Thu Sep 12 18:44:48 2019
(r352261)
@@ -145,7 +145,7 @@ compare_nodes(NODE *n1, NODE *n2, char const *path)
return (1);
}
if (n1->type != n2->type) {
-   differs = 0;
+   differs = F_TYPE;
mismatch(n1, n2, differs, path);
return (1);
}

Modified: head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh
==
--- head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh Thu Sep 12 18:37:26 
2019(r352260)
+++ head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh Thu Sep 12 18:44:48 
2019(r352261)
@@ -411,7 +411,42 @@ netbsd6_nonemptydir_body() 
FLAVOR=netbsd6 nonemptydir_body
 }
 
+atf_test_case mtree_specspec_type
+mtree_specspec_type_head()
+{
+   atf_set "descr" "Test that spec comparisons detect type changes"
+}
 
+mtree_specspec_type_body()
+{
+   mkdir testdir
+
+   touch testdir/bar
+   mtree -c -p testdir > mtree1.spec
+
+   if [ ! -f mtree1.spec ]; then
+   atf_fail "mtree failed"
+   fi
+
+   rm -f testdir/bar
+   ln -s foo testdir/bar
+   # uid change is expected to be ignored as done in -C
+   chown -h operator testdir/bar
+   mtree -c -p testdir > mtree2.spec
+
+   if [ ! -f mtree2.spec ]; then
+   atf_fail "mtree failed"
+   fi
+
+   atf_check -s ignore -o save:output \
+   -x "mtree -f mtree1.spec -f mtree2.spec"
+
+   if ! cut -f 3 output | egrep -q "bar file" || \
+   ! cut -f 3 output | egrep -q "bar link"; then
+   atf_fail "mtree did not detect type change"
+   fi
+}
+
 atf_init_test_cases()
 {
atf_add_test_case mtree_create
@@ -423,6 +458,7 @@ atf_init_test_cases()
atf_add_test_case mtree_ignore
atf_add_test_case mtree_merge
atf_add_test_case mtree_nonemptydir
+   atf_add_test_case mtree_specspec_type
 
atf_add_test_case netbsd6_create
atf_add_test_case netbsd6_check

Modified: head/usr.sbin/fmtree/specspec.c
==
--- head/usr.sbin/fmtree/specspec.c Thu Sep 12 18:37:26 2019
(r352260)
+++ head/usr.sbin/fmtree/specspec.c Thu Sep 12 18:44:48 2019
(r352261)
@@ -132,7 +132,7 @@ compare_nodes(NODE *n1, NODE *n2, char const *path)
return (1);
}
if (n1->type != n2->type) {
-   differs = 0;
+   differs = F_TYPE;
mismatch(n1, n2, differs, path);
return (1);
}
___
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: r352260 - head/sys/dev/ral

2019-09-12 Thread Michael Zhilin
Author: mizhka
Date: Thu Sep 12 18:37:26 2019
New Revision: 352260
URL: https://svnweb.freebsd.org/changeset/base/352260

Log:
  [Bug 240473] add support of Ralink RT5390R Wireless Card
  
  This commit adds PCI ID of Ralink RT5390R into ids table of driver ral.
  Tests show stability of card during day. Network speed is reasonable (
  around several megabytes per second).
  
  PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240473
  Reported by:  zetrotrack...@gmail.com
  Reviewed by:  ray
  Approved by:  ray
  MFC after:5 days
  Differential Revision:  https://reviews.freebsd.org/D21604

Modified:
  head/sys/dev/ral/if_ral_pci.c

Modified: head/sys/dev/ral/if_ral_pci.c
==
--- head/sys/dev/ral/if_ral_pci.c   Thu Sep 12 18:14:44 2019
(r352259)
+++ head/sys/dev/ral/if_ral_pci.c   Thu Sep 12 18:37:26 2019
(r352260)
@@ -100,6 +100,7 @@ static const struct ral_pci_ident ral_pci_ids[] = {
{ 0x1814, 0x5390, "Ralink Technology RT5390" },
{ 0x1814, 0x5392, "Ralink Technology RT5392" },
{ 0x1814, 0x539a, "Ralink Technology RT5390" },
+   { 0x1814, 0x539b, "Ralink Technology RT5390" },
{ 0x1814, 0x539f, "Ralink Technology RT5390" },
{ 0x1a3b, 0x1059, "AWT RT2890" },
{ 0, 0, NULL }
___
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: r352259 - head/sys/modules

2019-09-12 Thread Ed Maste
Author: emaste
Date: Thu Sep 12 18:14:44 2019
New Revision: 352259
URL: https://svnweb.freebsd.org/changeset/base/352259

Log:
  arm64: connect Linuxulator to the build
  
  More work needs to be done, but it is capable of running basic
  statically or dynamically linked Linux/arm64 binaries.
  
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Thu Sep 12 17:42:37 2019(r352258)
+++ head/sys/modules/Makefile   Thu Sep 12 18:14:44 2019(r352259)
@@ -207,9 +207,6 @@ SUBDIR= \
libiconv \
libmchain \
lindebugfs \
-   ${_linux} \
-   ${_linux_common} \
-   ${_linux64} \
linuxkpi \
${_lio} \
lpt \
@@ -466,10 +463,22 @@ SUBDIR+=  iscsi_initiator
 SUBDIR+=   fdt
 .endif
 
+# Linuxulator
 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
 ${MACHINE_CPUARCH} == "i386"
 SUBDIR+=   linprocfs
 SUBDIR+=   linsysfs
+.endif
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+SUBDIR+=   linux
+.endif
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
+SUBDIR+=   linux64
+SUBDIR+=   linux_common
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+${MACHINE_CPUARCH} == "i386"
 _ena=  ena
 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
 _ibcore=   ibcore
@@ -590,7 +599,6 @@ _if_ndis=   if_ndis
 _io=   io
 _ix=   ix
 _ixv=  ixv
-_linux=linux
 .if ${MK_SOURCELESS_UCODE} != "no"
 _lio=  lio
 .endif
@@ -692,8 +700,6 @@ _efirt= efirt
 _iavf= iavf
 _ioat= ioat
 _ixl=  ixl
-_linux64=  linux64
-_linux_common= linux_common
 _nvdimm=   nvdimm
 _pms=  pms
 _qlxge=qlxge
___
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: r352248 - head/usr.sbin/ntp/libntp

2019-09-12 Thread Ian Lepore
On Thu, 2019-09-12 at 15:46 +, Baptiste Daroussin wrote:
> Author: bapt
> Date: Thu Sep 12 15:46:58 2019
> New Revision: 352248
> URL: https://svnweb.freebsd.org/changeset/base/352248
> 
> Log:
>   Get the readline header from the installed header instead of the from the 
> source
>   location.
>   

How can this possibly be right?  One of the hallmarks of our build
system is that it is self-contained in the sense that it uses the
sources to build the sources, not sources or files from the host
machine being used to do the build.

-- Ian

>   With newer import of libedit, the path to be able to access
> readline/readline.h
>   will also include header which name will conflict with some
> expected by ntp in
>   another path and end up breaking the build.
> 
> Modified:
>   head/usr.sbin/ntp/libntp/Makefile
> 
> Modified: head/usr.sbin/ntp/libntp/Makefile
> =
> =
> --- head/usr.sbin/ntp/libntp/Makefile Thu Sep 12 15:44:53 2019(r352
> 247)
> +++ head/usr.sbin/ntp/libntp/Makefile Thu Sep 12 15:46:58 2019(r352
> 248)
> @@ -79,7 +79,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \
>   -I${SRCTOP}/contrib/ntp/lib/isc/pthreads/include \
>   -I${SRCTOP}/contrib/ntp/sntp/libopts \
>   -I${SRCTOP}/lib/libc/${MACHINE_ARCH} \
> - -I${SRCTOP}/lib/libedit/edit \
> + -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit \
>   -I${.CURDIR:H} \
>   -I${.CURDIR}/
>  
> 

___
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: r352258 - head/sbin/camcontrol

2019-09-12 Thread Alexander Motin
Author: mav
Date: Thu Sep 12 17:42:37 2019
New Revision: 352258
URL: https://svnweb.freebsd.org/changeset/base/352258

Log:
  Remove Tagged Command Queuing feature reporting.
  
  I never saw those devices myself, FreeBSD never supported them, and it is
  officially obsolete since ACS-2 specification.
  
  MFC after:3 days

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Thu Sep 12 17:20:51 2019
(r352257)
+++ head/sbin/camcontrol/camcontrol.c   Thu Sep 12 17:42:37 2019
(r352258)
@@ -1600,16 +1600,6 @@ atacapprint(struct ata_params *parm)
printf("flush cache%s   %s\n",
parm->support.command2 & ATA_SUPPORT_FLUSHCACHE ? "yes" : "no",
parm->enabled.command2 & ATA_SUPPORT_FLUSHCACHE ? "yes" : "no");
-   printf("overlap%s\n",
-   parm->capabilities1 & ATA_SUPPORT_OVERLAP ? "yes" : "no");
-   printf("Tagged Command Queuing (TCQ)   %s   %s",
-   parm->support.command2 & ATA_SUPPORT_QUEUED ? "yes" : "no",
-   parm->enabled.command2 & ATA_SUPPORT_QUEUED ? "yes" : "no");
-   if (parm->support.command2 & ATA_SUPPORT_QUEUED) {
-   printf("%d tags\n",
-   ATA_QUEUE_LEN(parm->queue) + 1);
-   } else
-   printf("\n");
printf("Native Command Queuing (NCQ)   ");
if (atasata(parm) && (parm->satacapabilities & ATA_SUPPORT_NCQ)) {
printf("yes %d tags\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: r352257 - head/sbin/camcontrol

2019-09-12 Thread Alexander Motin
Author: mav
Date: Thu Sep 12 17:20:51 2019
New Revision: 352257
URL: https://svnweb.freebsd.org/changeset/base/352257

Log:
  Report Trusted Computing feature set support.
  
  It practically means the device is SED.
  
  MFC after:3 days

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Thu Sep 12 16:47:38 2019
(r352256)
+++ head/sbin/camcontrol/camcontrol.c   Thu Sep 12 17:20:51 2019
(r352257)
@@ -1717,6 +1717,9 @@ atacapprint(struct ata_params *parm)
} else {
printf("no\n");
}
+   printf("Trusted Computing  %s\n",
+   ((parm->tcg & 0xc000) == 0x4000) && (parm->tcg & ATA_SUPPORT_TCG) ?
+   "yes" : "no");
printf("encrypts all user data %s\n",
parm->support3 & ATA_ENCRYPTS_ALL_USER_DATA ? "yes" : "no");
printf("Sanitize   ");
___
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: r352256 - head/sys/kern

2019-09-12 Thread Mark Johnston
Author: markj
Date: Thu Sep 12 16:47:38 2019
New Revision: 352256
URL: https://svnweb.freebsd.org/changeset/base/352256

Log:
  Remove a redundant NULL pointer check in cpuset_modify_domain().
  
  cpuset_getroot() is guaranteed to return a non-NULL pointer.
  
  Reported by:  Mark Millard 
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_cpuset.c

Modified: head/sys/kern/kern_cpuset.c
==
--- head/sys/kern/kern_cpuset.c Thu Sep 12 16:45:07 2019(r352255)
+++ head/sys/kern/kern_cpuset.c Thu Sep 12 16:47:38 2019(r352256)
@@ -796,7 +796,7 @@ cpuset_modify_domain(struct cpuset *set, struct domain
/*
 * Verify that we have access to this set of domains.
 */
-   if (root && !domainset_valid(dset, domain)) {
+   if (!domainset_valid(dset, domain)) {
error = EINVAL;
goto out;
}
___
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: r352255 - head/lib/csu/powerpc64

2019-09-12 Thread Leandro Lupori
Author: luporl
Date: Thu Sep 12 16:45:07 2019
New Revision: 352255
URL: https://svnweb.freebsd.org/changeset/base/352255

Log:
  [PPC64] Add ifunc support in libcsu
  
  When ifuncs are used in statically linked binaries, the C runtime
  must perform the needed dynamic relocations, to make calls to ifuncs
  work correctly.
  
  Reviewed by:  jhibbits
  Differential Revision:https://reviews.freebsd.org/D21070

Added:
  head/lib/csu/powerpc64/reloc.c   (contents, props changed)
Modified:
  head/lib/csu/powerpc64/Makefile
  head/lib/csu/powerpc64/crt1.c

Modified: head/lib/csu/powerpc64/Makefile
==
--- head/lib/csu/powerpc64/Makefile Thu Sep 12 16:28:30 2019
(r352254)
+++ head/lib/csu/powerpc64/Makefile Thu Sep 12 16:45:07 2019
(r352255)
@@ -5,9 +5,9 @@
 SRCS=  crt1.c crti.S crtn.S
 OBJS=  ${SRCS:N*.h:R:S/$/.o/g}
 OBJS+= crtsavres.o Scrt1.o gcrt1.o
-CFLAGS+=   -I${.CURDIR:H}/common \
+CFLAGS+=   -I${.CURDIR} -I${.CURDIR:H}/common \
-I${SRCTOP}/lib/libc/include \
-   -mlongcall -DCRT_IRELOC_SUPPRESS
+   -mlongcall -DCRT_IRELOC_RELA
 
 FILES= ${OBJS}
 FILESMODE= ${LIBMODE}

Modified: head/lib/csu/powerpc64/crt1.c
==
--- head/lib/csu/powerpc64/crt1.c   Thu Sep 12 16:28:30 2019
(r352254)
+++ head/lib/csu/powerpc64/crt1.c   Thu Sep 12 16:45:07 2019
(r352255)
@@ -45,7 +45,12 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
 
+static uint32_t cpu_features;
+static uint32_t cpu_features2;
+
 #include "libc_private.h"
 #include "crtbrand.c"
 #include "ignore_init.c"
@@ -65,6 +70,30 @@ extern int etext;
 
 struct ps_strings *__ps_strings;
 
+static void
+init_cpu_features(char **env)
+{
+   const Elf_Auxinfo *aux;
+
+   /* Find the auxiliary vector on the stack. */
+   while (*env++ != 0) /* Skip over environment, and NULL terminator */
+   ;
+   aux = (const Elf_Auxinfo *)env;
+
+   /* Digest the auxiliary vector. */
+   for (;  aux->a_type != AT_NULL; aux++) {
+   switch (aux->a_type) {
+   case AT_HWCAP:
+   cpu_features = (uint32_t)aux->a_un.a_val;
+   break;
+   case AT_HWCAP2:
+   cpu_features2 = (uint32_t)aux->a_un.a_val;
+   break;
+   }
+   }
+}
+
+
 /* The entry function. */
 /*
  * First 5 arguments are specified by the PowerPC SVR4 ABI.
@@ -84,8 +113,11 @@ _start(int argc, char **argv, char **env,
 
if (&_DYNAMIC != NULL)
atexit(cleanup);
-   else
+   else {
+   init_cpu_features(env);
+   process_irelocs();
_init_tls();
+   }
 
 #ifdef GCRT
atexit(_mcleanup);

Added: head/lib/csu/powerpc64/reloc.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/csu/powerpc64/reloc.c  Thu Sep 12 16:45:07 2019
(r352255)
@@ -0,0 +1,43 @@
+/*-
+ * Copyright (c) 2019 Leandro Lupori
+ *
+ * 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.
+ *
+ * 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$");
+
+static void
+crt1_handle_rela(const Elf_Rela *r)
+{
+   typedef Elf_Addr (*ifunc_resolver_t)(
+   uint32_t, uint32_t, uint64_t, uint64_t,
+   uint64_t, uint64_t, uint64_t, uint64_t);
+   Elf_Addr *ptr, *where, target;
+
+   switch (ELF_R_TYPE(r->r_info)) {
+   case R_PPC_IRELATIVE:
+   ptr = (Elf_Addr *)r->r_addend;
+   where = (Elf_Addr *)r->r_offset;
+   target = ((ifunc_resolver_t)ptr)(cpu_features, cpu_features2,
+   0, 0, 0, 0, 0, 0);
+   *where = target;
+   

svn commit: r352254 - stable/12

2019-09-12 Thread Alan Somers
Author: asomers
Date: Thu Sep 12 16:28:30 2019
New Revision: 352254
URL: https://svnweb.freebsd.org/changeset/base/352254

Log:
  Record mergeinfo for r352232

Modified:
Directory Properties:
  stable/12/   (props changed)
___
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: r352253 - in head/sys: kern vm

2019-09-12 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Sep 12 16:26:59 2019
New Revision: 352253
URL: https://svnweb.freebsd.org/changeset/base/352253

Log:
  Use REFCOUNT_COUNT() to obtain refcount where appropriate.
  Refcount waiting will set some flag bits in the refcount value.
  Make sure these bits get cleared by using the REFCOUNT_COUNT()
  macro to obtain the actual refcount.
  
  Differential Revision:https://reviews.freebsd.org/D21620
  Reviewed by:  kib@, markj@
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/kern/vfs_bio.c
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_swapout.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Thu Sep 12 16:23:22 2019(r352252)
+++ head/sys/kern/vfs_bio.c Thu Sep 12 16:26:59 2019(r352253)
@@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2842,9 +2843,9 @@ vfs_vmio_iodone(struct buf *bp)
bool bogus;
 
obj = bp->b_bufobj->bo_object;
-   KASSERT(obj->paging_in_progress >= bp->b_npages,
+   KASSERT(REFCOUNT_COUNT(obj->paging_in_progress) >= bp->b_npages,
("vfs_vmio_iodone: paging in progress(%d) < b_npages(%d)",
-   obj->paging_in_progress, bp->b_npages));
+   REFCOUNT_COUNT(obj->paging_in_progress), bp->b_npages));
 
vp = bp->b_vp;
KASSERT(vp->v_holdcnt > 0,

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Thu Sep 12 16:23:22 2019(r352252)
+++ head/sys/vm/vm_fault.c  Thu Sep 12 16:26:59 2019(r352253)
@@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -339,7 +340,7 @@ vm_fault_restore_map_lock(struct faultstate *fs)
 {
 
VM_OBJECT_ASSERT_WLOCKED(fs->first_object);
-   MPASS(fs->first_object->paging_in_progress > 0);
+   MPASS(REFCOUNT_COUNT(fs->first_object->paging_in_progress) > 0);
 
if (!vm_map_trylock_read(fs->map)) {
VM_OBJECT_WUNLOCK(fs->first_object);
@@ -394,7 +395,7 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro
 
MPASS(fs->object == fs->first_object);
VM_OBJECT_ASSERT_WLOCKED(fs->first_object);
-   MPASS(fs->first_object->paging_in_progress > 0);
+   MPASS(REFCOUNT_COUNT(fs->first_object->paging_in_progress) > 0);
MPASS(fs->first_object->backing_object == NULL);
MPASS(fs->lookup_still_valid);
 

Modified: head/sys/vm/vm_object.c
==
--- head/sys/vm/vm_object.c Thu Sep 12 16:23:22 2019(r352252)
+++ head/sys/vm/vm_object.c Thu Sep 12 16:26:59 2019(r352253)
@@ -195,9 +195,9 @@ vm_object_zdtor(void *mem, int size, void *arg)
("object %p has reservations",
object));
 #endif
-   KASSERT(object->paging_in_progress == 0,
+   KASSERT(REFCOUNT_COUNT(object->paging_in_progress) == 0,
("object %p paging_in_progress = %d",
-   object, object->paging_in_progress));
+   object, REFCOUNT_COUNT(object->paging_in_progress)));
KASSERT(object->resident_page_count == 0,
("object %p resident_page_count = %d",
object, object->resident_page_count));
@@ -395,7 +395,7 @@ vm_object_pip_wait(vm_object_t object, char *waitid)
 
VM_OBJECT_ASSERT_WLOCKED(object);
 
-   while (object->paging_in_progress) {
+   while (REFCOUNT_COUNT(object->paging_in_progress) > 0) {
VM_OBJECT_WUNLOCK(object);
refcount_wait(>paging_in_progress, waitid, PVM);
VM_OBJECT_WLOCK(object);
@@ -408,7 +408,7 @@ vm_object_pip_wait_unlocked(vm_object_t object, char *
 
VM_OBJECT_ASSERT_UNLOCKED(object);
 
-   while (object->paging_in_progress)
+   while (REFCOUNT_COUNT(object->paging_in_progress) > 0)
refcount_wait(>paging_in_progress, waitid, PVM);
 }
 
@@ -577,7 +577,7 @@ vm_object_deallocate(vm_object_t object)
 
robject->ref_count++;
 retry:
-   if (robject->paging_in_progress) {
+   if 
(REFCOUNT_COUNT(robject->paging_in_progress) > 0) {
VM_OBJECT_WUNLOCK(object);
vm_object_pip_wait(robject,
"objde1");
@@ -586,7 +586,7 @@ retry:
VM_OBJECT_WLOCK(object);
goto retry;
}
-   } else if (object->paging_in_progress) {
+  

svn commit: r352252 - stable/12/sbin/ping6

2019-09-12 Thread Alan Somers
Author: asomers
Date: Thu Sep 12 16:23:22 2019
New Revision: 352252
URL: https://svnweb.freebsd.org/changeset/base/352252

Log:
  MFC r351172:
  
  ping6: Raise WARNS level to 6
  
  Submitted by: Ján Sučan 
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21260

Modified:
  stable/12/sbin/ping6/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ping6/Makefile
==
--- stable/12/sbin/ping6/Makefile   Thu Sep 12 16:20:03 2019
(r352251)
+++ stable/12/sbin/ping6/Makefile   Thu Sep 12 16:23:22 2019
(r352252)
@@ -7,7 +7,6 @@ PROG=   ping6
 MAN=   ping6.8
 
 CFLAGS+=-DIPSEC -DKAME_SCOPEID
-WARNS?=3
 
 BINOWN=root
 BINMODE=4555
___
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: r352251 - head/sys/sys

2019-09-12 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Sep 12 16:20:03 2019
New Revision: 352251
URL: https://svnweb.freebsd.org/changeset/base/352251

Log:
  Use %u instead of %d to print unsigned integer.
  While at it remove an empty line.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/sys/refcount.h

Modified: head/sys/sys/refcount.h
==
--- head/sys/sys/refcount.h Thu Sep 12 15:57:49 2019(r352250)
+++ head/sys/sys/refcount.h Thu Sep 12 16:20:03 2019(r352251)
@@ -85,11 +85,10 @@ refcount_acquire(volatile u_int *count)
 static __inline void
 refcount_acquiren(volatile u_int *count, u_int n)
 {
-
u_int old;
 
KASSERT(n < REFCOUNT_SATURATION_VALUE / 2,
-   ("refcount_acquiren: n %d too large", n));
+   ("refcount_acquiren: n=%u too large", n));
old = atomic_fetchadd_int(count, n);
if (__predict_false(REFCOUNT_SATURATED(old)))
_refcount_update_saturated(count);
@@ -115,7 +114,8 @@ refcount_releasen(volatile u_int *count, u_int n)
u_int old;
 
KASSERT(n < REFCOUNT_SATURATION_VALUE / 2,
-   ("refcount_releasen: n %d too large", n));
+   ("refcount_releasen: n=%u too large", n));
+
atomic_thread_fence_rel();
old = atomic_fetchadd_int(count, -n);
if (__predict_false(n >= REFCOUNT_COUNT(old) ||
___
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: r352250 - head/sys/sys

2019-09-12 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Sep 12 15:57:49 2019
New Revision: 352250
URL: https://svnweb.freebsd.org/changeset/base/352250

Log:
  Fix for undefined behaviour.
  Left shift of 1 by 31 places cannot be represented in type 'int'.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/sys/refcount.h

Modified: head/sys/sys/refcount.h
==
--- head/sys/sys/refcount.h Thu Sep 12 15:50:14 2019(r352249)
+++ head/sys/sys/refcount.h Thu Sep 12 15:57:49 2019(r352250)
@@ -39,7 +39,7 @@
 #defineKASSERT(exp, msg)   /* */
 #endif
 
-#defineREFCOUNT_WAITER (1 << 31) /* Refcount has 
waiter. */
+#defineREFCOUNT_WAITER (1U << 31) /* Refcount has 
waiter. */
 #defineREFCOUNT_SATURATION_VALUE   (3U << 29)
 
 #defineREFCOUNT_SATURATED(val) (((val) & (1U << 30)) != 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: r352249 - head/gnu/usr.bin/gdb

2019-09-12 Thread Baptiste Daroussin
Author: bapt
Date: Thu Sep 12 15:50:14 2019
New Revision: 352249
URL: https://svnweb.freebsd.org/changeset/base/352249

Log:
  Get the readline header from the installed header instead of the from the 
source
  location.

Modified:
  head/gnu/usr.bin/gdb/Makefile.inc

Modified: head/gnu/usr.bin/gdb/Makefile.inc
==
--- head/gnu/usr.bin/gdb/Makefile.inc   Thu Sep 12 15:46:58 2019
(r352248)
+++ head/gnu/usr.bin/gdb/Makefile.inc   Thu Sep 12 15:50:14 2019
(r352249)
@@ -45,7 +45,7 @@ CFLAGS+= -I${CNTRB_GDB}/gdb/config
 CFLAGS+= -I${CNTRB_BU}/include
 CFLAGS+= -I${CNTRB_GDB}/include
 CFLAGS+= -I${CNTRB_BU}/bfd
-CFLAGS+= -I${SRCTOP}/lib/libedit/edit
+CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
 
 GENSRCS+= nm.h tm.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: r352248 - head/usr.sbin/ntp/libntp

2019-09-12 Thread Baptiste Daroussin
Author: bapt
Date: Thu Sep 12 15:46:58 2019
New Revision: 352248
URL: https://svnweb.freebsd.org/changeset/base/352248

Log:
  Get the readline header from the installed header instead of the from the 
source
  location.
  
  With newer import of libedit, the path to be able to access 
readline/readline.h
  will also include header which name will conflict with some expected by ntp in
  another path and end up breaking the build.

Modified:
  head/usr.sbin/ntp/libntp/Makefile

Modified: head/usr.sbin/ntp/libntp/Makefile
==
--- head/usr.sbin/ntp/libntp/Makefile   Thu Sep 12 15:44:53 2019
(r352247)
+++ head/usr.sbin/ntp/libntp/Makefile   Thu Sep 12 15:46:58 2019
(r352248)
@@ -79,7 +79,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \
-I${SRCTOP}/contrib/ntp/lib/isc/pthreads/include \
-I${SRCTOP}/contrib/ntp/sntp/libopts \
-I${SRCTOP}/lib/libc/${MACHINE_ARCH} \
-   -I${SRCTOP}/lib/libedit/edit \
+   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit \
-I${.CURDIR:H} \
-I${.CURDIR}/
 
___
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: r352247 - in head/usr.sbin/ntp: ntpdc ntpq

2019-09-12 Thread Baptiste Daroussin
Author: bapt
Date: Thu Sep 12 15:44:53 2019
New Revision: 352247
URL: https://svnweb.freebsd.org/changeset/base/352247

Log:
  Remove useless extra definition of libedit flags
  
  Note that all the line editor part is done in the libntp

Modified:
  head/usr.sbin/ntp/ntpdc/Makefile
  head/usr.sbin/ntp/ntpq/Makefile

Modified: head/usr.sbin/ntp/ntpdc/Makefile
==
--- head/usr.sbin/ntp/ntpdc/MakefileThu Sep 12 15:36:48 2019
(r352246)
+++ head/usr.sbin/ntp/ntpdc/MakefileThu Sep 12 15:44:53 2019
(r352247)
@@ -18,8 +18,6 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \
-I${.CURDIR:H} -I${.CURDIR}
 
 LIBADD=edit ntp m opts pthread
-CFLAGS+=   -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
-   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
 
 .if ${MK_OPENSSL} != "no"
 LIBADD+=   crypto

Modified: head/usr.sbin/ntp/ntpq/Makefile
==
--- head/usr.sbin/ntp/ntpq/Makefile Thu Sep 12 15:36:48 2019
(r352246)
+++ head/usr.sbin/ntp/ntpq/Makefile Thu Sep 12 15:44:53 2019
(r352247)
@@ -28,9 +28,6 @@ LIBADD+=  crypto
 LIBADD+=   md
 .endif
 
-CFLAGS+=   -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
-   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
-
 CLEANFILES+= .version version.c
 
 version.c:
___
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: r352246 - head/sys/net

2019-09-12 Thread Kyle Evans
Author: kevans
Date: Thu Sep 12 15:36:48 2019
New Revision: 352246
URL: https://svnweb.freebsd.org/changeset/base/352246

Log:
  SIOCSIFNAME: Do nothing if we're not actually changing
  
  Instead of throwing EEXIST, just succeed if the name isn't actually
  changing. We don't need to trigger departure or any of that because there's
  no change from consumers' perspective.
  
  PR:   240539
  Reviewed by:  brooks
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D21618

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Thu Sep 12 14:34:46 2019(r352245)
+++ head/sys/net/if.c   Thu Sep 12 15:36:48 2019(r352246)
@@ -2716,6 +2716,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data,
if (strlen(new_name) == IFNAMSIZ-1)
return (EINVAL);
}
+   if (strcmp(new_name, ifp->if_xname) == 0)
+   break;
if (ifunit(new_name) != NULL)
return (EEXIST);
 
___
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: r352245 - head/sys/kern

2019-09-12 Thread Kyle Evans
Author: kevans
Date: Thu Sep 12 14:34:46 2019
New Revision: 352245
URL: https://svnweb.freebsd.org/changeset/base/352245

Log:
  Follow up r352244: kenv: tighten up assertions
  
  As I like to forget: static kenv var formatting is actually such that an
  empty environment would be double null bytes. We should make sure that a
  non-zero buffer has at least enough for this, though most of the current
  usage is with a 4k buffer.

Modified:
  head/sys/kern/kern_environment.c

Modified: head/sys/kern/kern_environment.c
==
--- head/sys/kern/kern_environment.cThu Sep 12 13:51:43 2019
(r352244)
+++ head/sys/kern/kern_environment.cThu Sep 12 14:34:46 2019
(r352245)
@@ -250,7 +250,15 @@ init_static_kenv(char *buf, size_t len)
char *eval;
 
KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized"));
-   KASSERT(len == 0 || *buf == '\0',
+   /*
+* Suitably sized means it must be able to hold at least one empty
+* variable, otherwise things go belly up if a kern_getenv call is
+* made without a prior call to kern_setenv as we have a malformed
+* environment.
+*/
+   KASSERT(len == 0 || len >= 2,
+   ("kenv: static env must be initialized or suitably sized"));
+   KASSERT(len == 0 || (*buf == '\0' && *(buf + 1) == '\0'),
("kenv: sized buffer must be initially empty"));
 
/*
___
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: r352244 - head/sys/kern

2019-09-12 Thread Kyle Evans
Author: kevans
Date: Thu Sep 12 13:51:43 2019
New Revision: 352244
URL: https://svnweb.freebsd.org/changeset/base/352244

Log:
  kenv: assert that an empty static buffer passed in is "empty"
  
  Garbage in the passed-in buffer can cause problems if any attempts to read
  the kenv are inadvertently made between init_static_kenv and the first
  kern_setenv -- assuming there is one.
  
  This is cheap and easy, so do it. This also helps rule out some class of
  bugs as one tries to debug; tunables fetch from the static environment up
  until SI_SUB_KMEM + 1, and many of these buffers are global ~4k buffers that
  rely on BSS clearing while others just grab a page of free memory and use it
  (e.g. xen).

Modified:
  head/sys/kern/kern_environment.c

Modified: head/sys/kern/kern_environment.c
==
--- head/sys/kern/kern_environment.cThu Sep 12 12:33:09 2019
(r352243)
+++ head/sys/kern/kern_environment.cThu Sep 12 13:51:43 2019
(r352244)
@@ -250,6 +250,8 @@ init_static_kenv(char *buf, size_t len)
char *eval;
 
KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized"));
+   KASSERT(len == 0 || *buf == '\0',
+   ("kenv: sized buffer must be initially empty"));
 
/*
 * We may be called twice, with the second call needed to relocate
___
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: r352243 - head/sys/dev/ichiic

2019-09-12 Thread Vladimir Kondratyev
Author: wulf
Date: Thu Sep 12 12:33:09 2019
New Revision: 352243
URL: https://svnweb.freebsd.org/changeset/base/352243

Log:
  ig4(4): Fix SDA HOLD time set too low on Skylake controllers
  
  Execution of "Soft reset" command (IG4_REG_RESETS_SKL) at controller init
  stage sets SDA_HOLD register value to 0x0001 which is often too low for
  normal operation.
  
  Set SDA_HOLD back to 28 after reset to restore controller functionality.
  
  PR:   240339
  Reported by:  imp, GregV, et al.
  MFC after:3 days

Modified:
  head/sys/dev/ichiic/ig4_iic.c

Modified: head/sys/dev/ichiic/ig4_iic.c
==
--- head/sys/dev/ichiic/ig4_iic.c   Thu Sep 12 08:54:48 2019
(r352242)
+++ head/sys/dev/ichiic/ig4_iic.c   Thu Sep 12 12:33:09 2019
(r352243)
@@ -590,6 +590,8 @@ ig4iic_attach(ig4iic_softc_t *sc)
reg_write(sc, IG4_REG_SS_SCL_LCNT, 125);
reg_write(sc, IG4_REG_FS_SCL_HCNT, 100);
reg_write(sc, IG4_REG_FS_SCL_LCNT, 125);
+   if (sc->version == IG4_SKYLAKE)
+   reg_write(sc, IG4_REG_SDA_HOLD, 28);
 
/*
 * Use a threshold of 1 so we get interrupted on each character,
___
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: r351188 - in head/sys: kern sys

2019-09-12 Thread Hans Petter Selasky

On 2019-08-18 13:43, Jeff Roberson wrote:

Author: jeff
Date: Sun Aug 18 11:43:58 2019
New Revision: 351188
URL: https://svnweb.freebsd.org/changeset/base/351188

Log:
   Add a blocking wait bit to refcount.  This allows refs to be used as a simple
   barrier.
   
   Reviewed by:	markj, kib

   Discussed with:  jhb
   Sponsored by:Netflix
   Differential Revision:   https://reviews.freebsd.org/D21254

Modified:
   head/sys/kern/kern_synch.c
   head/sys/sys/refcount.h



Hi,

I would like to decouple the wait/wakeup logic from the release 
function, if possible. The main objection here is that we are woken up 
before any destructor is executed. Also this function is not Giant safe 
and does neither assert that it can sleep.


--HPS
___
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: r352242 - in head: contrib/gdb/gdb contrib/gdb/gdb/cli gnu/usr.bin/gdb/kgdb

2019-09-12 Thread Baptiste Daroussin
Author: bapt
Date: Thu Sep 12 08:54:48 2019
New Revision: 352242
URL: https://svnweb.freebsd.org/changeset/base/352242

Log:
  Remove usesless readline compat includes which will reinclude readline.h
  itself.
  
  This simplifies the upcoming update to newer libedit.

Modified:
  head/contrib/gdb/gdb/cli/cli-cmds.c
  head/contrib/gdb/gdb/cli/cli-setshow.c
  head/contrib/gdb/gdb/event-top.c
  head/contrib/gdb/gdb/top.c
  head/contrib/gdb/gdb/tracepoint.c
  head/gnu/usr.bin/gdb/kgdb/trgt.c

Modified: head/contrib/gdb/gdb/cli/cli-cmds.c
==
--- head/contrib/gdb/gdb/cli/cli-cmds.c Thu Sep 12 06:26:22 2019
(r352241)
+++ head/contrib/gdb/gdb/cli/cli-cmds.c Thu Sep 12 08:54:48 2019
(r352242)
@@ -21,7 +21,6 @@
 
 #include "defs.h"
 #include "readline/readline.h"
-#include "readline/tilde.h"
 #include "completer.h"
 #include "target.h" /* For baud_rate, remote_debug and remote_timeout */
 #include "gdb_wait.h"  /* For shell escape implementation */

Modified: head/contrib/gdb/gdb/cli/cli-setshow.c
==
--- head/contrib/gdb/gdb/cli/cli-setshow.c  Thu Sep 12 06:26:22 2019
(r352241)
+++ head/contrib/gdb/gdb/cli/cli-setshow.c  Thu Sep 12 08:54:48 2019
(r352242)
@@ -18,7 +18,6 @@
Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
-#include "readline/tilde.h"
 #include "value.h"
 #include 
 #include "gdb_string.h"

Modified: head/contrib/gdb/gdb/event-top.c
==
--- head/contrib/gdb/gdb/event-top.cThu Sep 12 06:26:22 2019
(r352241)
+++ head/contrib/gdb/gdb/event-top.cThu Sep 12 08:54:48 2019
(r352242)
@@ -34,7 +34,6 @@
 
 /* readline include files */
 #include "readline/readline.h"
-#include "readline/history.h"
 
 /* readline defines this.  */
 #undef savestring

Modified: head/contrib/gdb/gdb/top.c
==
--- head/contrib/gdb/gdb/top.c  Thu Sep 12 06:26:22 2019(r352241)
+++ head/contrib/gdb/gdb/top.c  Thu Sep 12 08:54:48 2019(r352242)
@@ -48,7 +48,6 @@
 
 /* readline include files */
 #include "readline/readline.h"
-#include "readline/history.h"
 
 /* readline defines this.  */
 #undef savestring

Modified: head/contrib/gdb/gdb/tracepoint.c
==
--- head/contrib/gdb/gdb/tracepoint.c   Thu Sep 12 06:26:22 2019
(r352241)
+++ head/contrib/gdb/gdb/tracepoint.c   Thu Sep 12 08:54:48 2019
(r352242)
@@ -45,7 +45,6 @@
 
 /* readline include files */
 #include "readline/readline.h"
-#include "readline/history.h"
 
 /* readline defines this.  */
 #undef savestring

Modified: head/gnu/usr.bin/gdb/kgdb/trgt.c
==
--- head/gnu/usr.bin/gdb/kgdb/trgt.cThu Sep 12 06:26:22 2019
(r352241)
+++ head/gnu/usr.bin/gdb/kgdb/trgt.cThu Sep 12 08:54:48 2019
(r352242)
@@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #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"


svn commit: r352241 - in stable/12/stand/ficl: . softwords

2019-09-12 Thread Toomas Soome
Author: tsoome
Date: Thu Sep 12 06:26:22 2019
New Revision: 352241
URL: https://svnweb.freebsd.org/changeset/base/352241

Log:
  MFC r351865, r351837:
  ficl: add xemit word
  ficl: add uIsGreater word (needed for xemit)
  
  We need xemit to support userboot.so loading images from CURRENT.

Modified:
  stable/12/stand/ficl/softwords/softcore.fr
  stable/12/stand/ficl/words.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/ficl/softwords/softcore.fr
==
--- stable/12/stand/ficl/softwords/softcore.fr  Thu Sep 12 06:20:20 2019
(r352240)
+++ stable/12/stand/ficl/softwords/softcore.fr  Thu Sep 12 06:26:22 2019
(r352241)
@@ -199,6 +199,14 @@ set-current   \ stop hiding words
a-addr 0  b-addr b-u  strcat
;
 
+: xemit ( xchar -- )
+   dup 0x80 u< if emit exit then \ special case ASCII
+   0 swap 0x3F
+   begin 2dup u> while
+   2/ >r dup 0x3F and 0x80 or swap 6 rshift r>
+   repeat 0x7F xor 2* or
+   begin dup 0x80 u< 0= while emit repeat drop
+   ;
 
 previous   \ lose hidden words from search order
 

Modified: stable/12/stand/ficl/words.c
==
--- stable/12/stand/ficl/words.cThu Sep 12 06:20:20 2019
(r352240)
+++ stable/12/stand/ficl/words.cThu Sep 12 06:26:22 2019
(r352241)
@@ -1930,6 +1930,18 @@ static void isGreater(FICL_VM *pVM)
 return;
 }
 
+static void uIsGreater(FICL_VM *pVM)
+{
+FICL_UNS u1, u2;
+#if FICL_ROBUST > 1
+vmCheckStack(pVM, 2, 1);
+#endif
+u2 = stackPopUNS(pVM->pStack);
+u1 = stackPopUNS(pVM->pStack);
+PUSHINT(FICL_BOOL(u1 > u2));
+return;
+}
+
 static void bitwiseAnd(FICL_VM *pVM)
 {
 CELL x, y;
@@ -4975,6 +4987,7 @@ void ficlCompileCore(FICL_SYSTEM *pSys)
 dictAppendWord(dp, "type",  type,   FW_DEFAULT);
 dictAppendWord(dp, "u.",uDot,   FW_DEFAULT);
 dictAppendWord(dp, "u<",uIsLess,FW_DEFAULT);
+dictAppendWord(dp, "u>",uIsGreater, FW_DEFAULT);
 dictAppendWord(dp, "um*",   umStar, FW_DEFAULT);
 dictAppendWord(dp, "um/mod",umSlashMod, FW_DEFAULT);
 dictAppendWord(dp, "unloop",unloopCo,   FW_COMPILE);
___
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: r352240 - in stable/11/stand/ficl: . softwords

2019-09-12 Thread Toomas Soome
Author: tsoome
Date: Thu Sep 12 06:20:20 2019
New Revision: 352240
URL: https://svnweb.freebsd.org/changeset/base/352240

Log:
  MFC r351865, r351837:
  ficl: add xemit word
  ficl: add uIsGreater word (needed for xemit)
  
  We need xemit to support userboot.so loading images from CURRENT.

Modified:
  stable/11/stand/ficl/softwords/softcore.fr
  stable/11/stand/ficl/words.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/ficl/softwords/softcore.fr
==
--- stable/11/stand/ficl/softwords/softcore.fr  Thu Sep 12 00:33:01 2019
(r352239)
+++ stable/11/stand/ficl/softwords/softcore.fr  Thu Sep 12 06:20:20 2019
(r352240)
@@ -199,6 +199,14 @@ set-current   \ stop hiding words
a-addr 0  b-addr b-u  strcat
;
 
+: xemit ( xchar -- )
+   dup 0x80 u< if emit exit then \ special case ASCII
+   0 swap 0x3F
+   begin 2dup u> while
+   2/ >r dup 0x3F and 0x80 or swap 6 rshift r>
+   repeat 0x7F xor 2* or
+   begin dup 0x80 u< 0= while emit repeat drop
+   ;
 
 previous   \ lose hidden words from search order
 

Modified: stable/11/stand/ficl/words.c
==
--- stable/11/stand/ficl/words.cThu Sep 12 00:33:01 2019
(r352239)
+++ stable/11/stand/ficl/words.cThu Sep 12 06:20:20 2019
(r352240)
@@ -1930,6 +1930,18 @@ static void isGreater(FICL_VM *pVM)
 return;
 }
 
+static void uIsGreater(FICL_VM *pVM)
+{
+FICL_UNS u1, u2;
+#if FICL_ROBUST > 1
+vmCheckStack(pVM, 2, 1);
+#endif
+u2 = stackPopUNS(pVM->pStack);
+u1 = stackPopUNS(pVM->pStack);
+PUSHINT(FICL_BOOL(u1 > u2));
+return;
+}
+
 static void bitwiseAnd(FICL_VM *pVM)
 {
 CELL x, y;
@@ -4975,6 +4987,7 @@ void ficlCompileCore(FICL_SYSTEM *pSys)
 dictAppendWord(dp, "type",  type,   FW_DEFAULT);
 dictAppendWord(dp, "u.",uDot,   FW_DEFAULT);
 dictAppendWord(dp, "u<",uIsLess,FW_DEFAULT);
+dictAppendWord(dp, "u>",uIsGreater, FW_DEFAULT);
 dictAppendWord(dp, "um*",   umStar, FW_DEFAULT);
 dictAppendWord(dp, "um/mod",umSlashMod, FW_DEFAULT);
 dictAppendWord(dp, "unloop",unloopCo,   FW_COMPILE);
___
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"