Re: svn commit: r281536 - head/sys/netpfil/pf

2015-04-15 Thread Gleb Smirnoff
On Tue, Apr 14, 2015 at 07:07:37PM +, Kristof Provost wrote:
K Author: kp
K Date: Tue Apr 14 19:07:37 2015
K New Revision: 281536
K URL: https://svnweb.freebsd.org/changeset/base/281536
K 
K Log:
K   pf: Fix forwarding detection
K   
K   If the direction is not PF_OUT we can never be forwarding. Some input 
packets
K   have rcvif != ifp (looped back packets), which lead us to ip6_forward() 
inbound
K   packets, causing panics.
K   
K   Equally, we need to ensure that packets were really received and not 
locally
K   generated before trying to ip6_forward() them.
K   
K   Differential Revision: https://reviews.freebsd.org/D2286
K   Approved by:   gnn(mentor)
K 
K Modified:
K   head/sys/netpfil/pf/pf.c
K 
K Modified: head/sys/netpfil/pf/pf.c
K 
==
K --- head/sys/netpfil/pf/pf.c Tue Apr 14 18:57:50 2015(r281535)
K +++ head/sys/netpfil/pf/pf.c Tue Apr 14 19:07:37 2015(r281536)
K @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str
K  
K  M_ASSERTPKTHDR(m);
K  
K -if (ifp != m-m_pkthdr.rcvif)
K +if (dir == PF_OUT  m-m_pkthdr.rcvif  ifp != m-m_pkthdr.rcvif)
K  fwdir = PF_FWD;

The ifp argument to pf_test6() is always not NULL, so the (m-m_pkthdr.rcvif)
conjunct is extraneous.

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


Re: svn commit: r281541 - head/sys/netinet

2015-04-15 Thread Gleb Smirnoff
On Wed, Apr 15, 2015 at 12:57:21AM +, Adrian Chadd wrote:
A Author: adrian
A Date: Wed Apr 15 00:57:21 2015
A New Revision: 281541
A URL: https://svnweb.freebsd.org/changeset/base/281541
A 
A Log:
A   Fix RSS build - netisr input / NETISR_IP_DIRECT is used here.
A
A Modified:
A   head/sys/netinet/ip_reass.c
A 
A Modified: head/sys/netinet/ip_reass.c
A 
==
A --- head/sys/netinet/ip_reass.c  Wed Apr 15 00:07:21 2015
(r281540)
A +++ head/sys/netinet/ip_reass.c  Wed Apr 15 00:57:21 2015
(r281541)
A @@ -47,6 +47,7 @@ __FBSDID($FreeBSD$);
A  #include sys/sysctl.h
A  
A  #include net/rss_config.h
A +#include net/netisr.h
A  #include net/vnet.h
A  
A  #include netinet/in.h

The include should go under #ifdef RSS then.

Why do we actually have RSS a non default option?

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


Re: svn commit: r281548 - in head/sys: kern sys

2015-04-15 Thread Slawa Olhovchenkov
On Wed, Apr 15, 2015 at 08:13:53AM +, Konstantin Belousov wrote:

   The soft RLIMIT_STACK is auto-increased if possible, to satisfy the
   binary' request.

Is this good way (self-modify limits)?
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r281536 - head/sys/netpfil/pf

2015-04-15 Thread Kristof Provost
On 2015-04-15 15:53:02 (+0300), Gleb Smirnoff gleb...@freebsd.org wrote:
 On Tue, Apr 14, 2015 at 07:07:37PM +, Kristof Provost wrote:
 K Author: kp
 K Date: Tue Apr 14 19:07:37 2015
 K New Revision: 281536
 K URL: https://svnweb.freebsd.org/changeset/base/281536
 K 
 K Log:
 K   pf: Fix forwarding detection
 K   
 K   If the direction is not PF_OUT we can never be forwarding. Some input 
 packets
 K   have rcvif != ifp (looped back packets), which lead us to ip6_forward() 
 inbound
 K   packets, causing panics.
 K   
 K   Equally, we need to ensure that packets were really received and not 
 locally
 K   generated before trying to ip6_forward() them.
 K   
 K   Differential Revision:   https://reviews.freebsd.org/D2286
 K   Approved by: gnn(mentor)
 K 
 K Modified:
 K   head/sys/netpfil/pf/pf.c
 K 
 K Modified: head/sys/netpfil/pf/pf.c
 K 
 ==
 K --- head/sys/netpfil/pf/pf.c   Tue Apr 14 18:57:50 2015
 (r281535)
 K +++ head/sys/netpfil/pf/pf.c   Tue Apr 14 19:07:37 2015
 (r281536)
 K @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str
 K  
 KM_ASSERTPKTHDR(m);
 K  
 K -  if (ifp != m-m_pkthdr.rcvif)
 K +  if (dir == PF_OUT  m-m_pkthdr.rcvif  ifp != m-m_pkthdr.rcvif)
 Kfwdir = PF_FWD;
 
 The ifp argument to pf_test6() is always not NULL, so the (m-m_pkthdr.rcvif)
 conjunct is extraneous.
 
m-pkthdr.rcvif can be NULL though (e.g. when this is a locally
generated packet). In that case we don't want to forward, which we'd end
up doing because, as you say, ifp won't be NULL.

(In other words: If m-pkthdr.rcvif is NULL we don't forward, even if
ifp != m-pkthdr.rcvif.)

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


svn commit: r281556 - head/libexec/rtld-elf/aarch64

2015-04-15 Thread Andrew Turner
Author: andrew
Date: Wed Apr 15 14:20:12 2015
New Revision: 281556
URL: https://svnweb.freebsd.org/changeset/base/281556

Log:
  Use the correct value to get the offset of the objects tls data.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/libexec/rtld-elf/aarch64/reloc.c

Modified: head/libexec/rtld-elf/aarch64/reloc.c
==
--- head/libexec/rtld-elf/aarch64/reloc.c   Wed Apr 15 14:20:03 2015
(r281555)
+++ head/libexec/rtld-elf/aarch64/reloc.c   Wed Apr 15 14:20:12 2015
(r281556)
@@ -161,7 +161,7 @@ rtld_tlsdesc_handle_locked(struct tls_da
if (def == NULL)
rtld_die();
 
-   tlsdesc-index = defobj-tlsindex + def-st_value + rela-r_addend;
+   tlsdesc-index = defobj-tlsoffset + def-st_value + rela-r_addend;
 
return (tlsdesc-index);
 }
@@ -206,7 +206,7 @@ reloc_plt(Obj_Entry *obj)
case R_AARCH64_TLSDESC:
if (ELF_R_SYM(rela-r_info) == 0) {
where[0] = (Elf_Addr)_rtld_tlsdesc;
-   where[1] = obj-tlsindex + rela-r_addend;
+   where[1] = obj-tlsoffset + rela-r_addend;
} else {
where[0] = (Elf_Addr)_rtld_tlsdesc_dynamic;
where[1] = (Elf_Addr)reloc_tlsdesc_alloc(obj,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2015-04-15 Thread Andrew Turner
Author: andrew
Date: Wed Apr 15 14:18:25 2015
New Revision: 281554
URL: https://svnweb.freebsd.org/changeset/base/281554

Log:
  Ensure the userland thread and floating-point state has been saved before
  copying the pcb. These values may have been changed just before the call
  to fork and without a call to cpu_switch, where they would have been saved.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/arm64/arm64/vm_machdep.c
==
--- head/sys/arm64/arm64/vm_machdep.c   Wed Apr 15 11:48:41 2015
(r281553)
+++ head/sys/arm64/arm64/vm_machdep.c   Wed Apr 15 14:18:25 2015
(r281554)
@@ -47,6 +47,10 @@ __FBSDID($FreeBSD$);
 #include machine/pcb.h
 #include machine/frame.h
 
+#ifdef VFP
+#include machine/vfp.h
+#endif
+
 /*
  * Finish a fork operation, with process p2 nearly set up.
  * Copy and update the pcb, set up the stack so that the child
@@ -61,6 +65,19 @@ cpu_fork(struct thread *td1, struct proc
if ((flags  RFPROC) == 0)
return;
 
+   if (td1 == curthread) {
+   /*
+* Save the tpidr_el0 and the vfp state, these normally happen
+* in cpu_switch, but if userland changes these then forks
+* this may not have happened.
+*/
+   td1-td_pcb-pcb_tpidr_el0 = READ_SPECIALREG(tpidr_el0);
+#ifdef VFP
+   if ((td1-td_pcb-pcb_fpflags  PCB_FP_STARTED) != 0)
+   vfp_save_state(td1);
+#endif
+   }
+
pcb2 = (struct pcb *)(td2-td_kstack +
td2-td_kstack_pages * PAGE_SIZE) - 1;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r281536 - head/sys/netpfil/pf

2015-04-15 Thread Gleb Smirnoff
On Wed, Apr 15, 2015 at 03:25:56PM +0200, Kristof Provost wrote:
K On 2015-04-15 15:53:02 (+0300), Gleb Smirnoff gleb...@freebsd.org wrote:
K  On Tue, Apr 14, 2015 at 07:07:37PM +, Kristof Provost wrote:
K  K Author: kp
K  K Date: Tue Apr 14 19:07:37 2015
K  K New Revision: 281536
K  K URL: https://svnweb.freebsd.org/changeset/base/281536
K  K 
K  K Log:
K  K   pf: Fix forwarding detection
K  K   
K  K   If the direction is not PF_OUT we can never be forwarding. Some input 
packets
K  K   have rcvif != ifp (looped back packets), which lead us to 
ip6_forward() inbound
K  K   packets, causing panics.
K  K   
K  K   Equally, we need to ensure that packets were really received and not 
locally
K  K   generated before trying to ip6_forward() them.
K  K   
K  K   Differential Revision:https://reviews.freebsd.org/D2286
K  K   Approved by:  gnn(mentor)
K  K 
K  K Modified:
K  K   head/sys/netpfil/pf/pf.c
K  K 
K  K Modified: head/sys/netpfil/pf/pf.c
K  K 
==
K  K --- head/sys/netpfil/pf/pf.cTue Apr 14 18:57:50 2015
(r281535)
K  K +++ head/sys/netpfil/pf/pf.cTue Apr 14 19:07:37 2015
(r281536)
K  K @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str
K  K  
K  K M_ASSERTPKTHDR(m);
K  K  
K  K -   if (ifp != m-m_pkthdr.rcvif)
K  K +   if (dir == PF_OUT  m-m_pkthdr.rcvif  ifp != 
m-m_pkthdr.rcvif)
K  K fwdir = PF_FWD;
K  
K  The ifp argument to pf_test6() is always not NULL, so the 
(m-m_pkthdr.rcvif)
K  conjunct is extraneous.
K  
K m-pkthdr.rcvif can be NULL though (e.g. when this is a locally
K generated packet). In that case we don't want to forward, which we'd end
K up doing because, as you say, ifp won't be NULL.
K 
K (In other words: If m-pkthdr.rcvif is NULL we don't forward, even if
K ifp != m-pkthdr.rcvif.)

I'm sorry! My braino.

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


svn commit: r281558 - head/sys/net

2015-04-15 Thread George V. Neville-Neil
Author: gnn
Date: Wed Apr 15 14:46:45 2015
New Revision: 281558
URL: https://svnweb.freebsd.org/changeset/base/281558

Log:
  Minor change to the macros to make sure that if an AF is passed that is 
neither AF_INET6 nor AF_INET that we don't touch random bits of memory.
  
  Differential Revision:https://reviews.freebsd.org/D2291

Modified:
  head/sys/net/pfvar.h

Modified: head/sys/net/pfvar.h
==
--- head/sys/net/pfvar.hWed Apr 15 14:30:07 2015(r281557)
+++ head/sys/net/pfvar.hWed Apr 15 14:46:45 2015(r281558)
@@ -192,21 +192,20 @@ extern struct rwlock pf_rules_lock;
 
 #define PF_AEQ(a, b, c) \
((c == AF_INET  (a)-addr32[0] == (b)-addr32[0]) || \
-   ((a)-addr32[3] == (b)-addr32[3]  \
+   (c == AF_INET6  (a)-addr32[3] == (b)-addr32[3]  \
(a)-addr32[2] == (b)-addr32[2]  \
(a)-addr32[1] == (b)-addr32[1]  \
(a)-addr32[0] == (b)-addr32[0])) \
 
 #define PF_ANEQ(a, b, c) \
-   ((c == AF_INET  (a)-addr32[0] != (b)-addr32[0]) || \
-   ((a)-addr32[3] != (b)-addr32[3] || \
-   (a)-addr32[2] != (b)-addr32[2] || \
+   ((a)-addr32[0] != (b)-addr32[0] || \
(a)-addr32[1] != (b)-addr32[1] || \
-   (a)-addr32[0] != (b)-addr32[0])) \
+   (a)-addr32[2] != (b)-addr32[2] || \
+   (a)-addr32[3] != (b)-addr32[3]) \
 
 #define PF_AZERO(a, c) \
((c == AF_INET  !(a)-addr32[0]) || \
-   (!(a)-addr32[0]  !(a)-addr32[1]  \
+   (c == AF_INET6  !(a)-addr32[0]  !(a)-addr32[1]  \
!(a)-addr32[2]  !(a)-addr32[3] )) \
 
 #define PF_MATCHA(n, a, m, b, f) \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2015-04-15 Thread Andrew Turner
Author: andrew
Date: Wed Apr 15 14:30:07 2015
New Revision: 281557
URL: https://svnweb.freebsd.org/changeset/base/281557

Log:
  Enter a critical section when storing the vfp registers, we don't want to
  be preempted here as this will enter back into this function, but the
  hardware could be in an inconsistant state, and the vfp unit will be off
  when switced back to this function.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/arm64/arm64/vfp.c
==
--- head/sys/arm64/arm64/vfp.c  Wed Apr 15 14:20:12 2015(r281556)
+++ head/sys/arm64/arm64/vfp.c  Wed Apr 15 14:30:07 2015(r281557)
@@ -88,41 +88,42 @@ vfp_save_state(struct thread *td)
uint64_t fpcr, fpsr;
uint32_t cpacr;
 
+   critical_enter();
/*
 * Only store the registers if the VFP is enabled,
 * i.e. return if we are trapping on FP access.
 */
cpacr = READ_SPECIALREG(cpacr_el1);
-   if ((cpacr  CPACR_FPEN_MASK) != CPACR_FPEN_TRAP_NONE)
-   return;
-
-   vfp_state = td-td_pcb-pcb_vfp;
-   __asm __volatile(
-   mrs%0, fpcr\n
-   mrs%1, fpsr\n
-   stpq0,  q1,  [%2, #16 *  0]\n
-   stpq2,  q3,  [%2, #16 *  2]\n
-   stpq4,  q5,  [%2, #16 *  4]\n
-   stpq6,  q7,  [%2, #16 *  6]\n
-   stpq8,  q9,  [%2, #16 *  8]\n
-   stpq10, q11, [%2, #16 * 10]\n
-   stpq12, q13, [%2, #16 * 12]\n
-   stpq14, q15, [%2, #16 * 14]\n
-   stpq16, q17, [%2, #16 * 16]\n
-   stpq18, q19, [%2, #16 * 18]\n
-   stpq20, q21, [%2, #16 * 20]\n
-   stpq22, q23, [%2, #16 * 22]\n
-   stpq24, q25, [%2, #16 * 24]\n
-   stpq26, q27, [%2, #16 * 26]\n
-   stpq28, q29, [%2, #16 * 28]\n
-   stpq30, q31, [%2, #16 * 30]\n
-   : =r(fpcr), =r(fpsr) : r(vfp_state));
+   if ((cpacr  CPACR_FPEN_MASK) == CPACR_FPEN_TRAP_NONE) {
+   vfp_state = td-td_pcb-pcb_vfp;
+   __asm __volatile(
+   mrs%0, fpcr\n
+   mrs%1, fpsr\n
+   stpq0,  q1,  [%2, #16 *  0]\n
+   stpq2,  q3,  [%2, #16 *  2]\n
+   stpq4,  q5,  [%2, #16 *  4]\n
+   stpq6,  q7,  [%2, #16 *  6]\n
+   stpq8,  q9,  [%2, #16 *  8]\n
+   stpq10, q11, [%2, #16 * 10]\n
+   stpq12, q13, [%2, #16 * 12]\n
+   stpq14, q15, [%2, #16 * 14]\n
+   stpq16, q17, [%2, #16 * 16]\n
+   stpq18, q19, [%2, #16 * 18]\n
+   stpq20, q21, [%2, #16 * 20]\n
+   stpq22, q23, [%2, #16 * 22]\n
+   stpq24, q25, [%2, #16 * 24]\n
+   stpq26, q27, [%2, #16 * 26]\n
+   stpq28, q29, [%2, #16 * 28]\n
+   stpq30, q31, [%2, #16 * 30]\n
+   : =r(fpcr), =r(fpsr) : r(vfp_state));
 
-   td-td_pcb-pcb_fpcr = fpcr;
-   td-td_pcb-pcb_fpsr = fpsr;
+   td-td_pcb-pcb_fpcr = fpcr;
+   td-td_pcb-pcb_fpsr = fpsr;
 
-   dsb();
-   vfp_disable();
+   dsb();
+   vfp_disable();
+   }
+   critical_exit();
 }
 
 void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r280327 - in head/sys: kern vm

2015-04-15 Thread Bryan Drewery
On 3/27/2015 9:41 PM, Don Lewis wrote:
 I was not seeing this problem on my older package builder running
 10.1-STABLE.  Since this problem has not shown up on the FreeBSD package
 building cluster, I got suspicious that the change was quite recent.
 
 This old gcc bug report:
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14940 led me to suspect
 mmap().
 
 The old gcc source file /usr/src/contrib/gcc/ggc-common.c does a couple
 of mmap() calls.   Tne first is in mmap_gt_pch_get_address() where a
 NULL first argument is used.  The address that gets returned is stashed
 away and the region is unmapped.  Then a later call in
 mmap_gt_pch_use_address() passes this saved  address to mmap() as a
 hint.  It expects the mapped region to get mapped to the same base
 address.  If this does not happen, the above error is the result.
 
 If I go back to kernel source r280326, which immediately preceeds the
 above commit, I am able to successfully build openjdk7.
 
 I recommend that any machines in the ports cluster being used to build
 packages for FreeBSD 8 and 9 avoid upgrading past r280326 until this
 issue is resolved.  I have not observed any problems building packages
 for FreeBSD 10 and 11.
 

I've committed a change to openjdk7/8 to disable PCH for GCC.

filezilla and aegisub apparently use PCH as well. I still need to test
and fix them.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r281559 - head/sys/kern

2015-04-15 Thread Neel Natu
Author: neel
Date: Wed Apr 15 16:22:05 2015
New Revision: 281559
URL: https://svnweb.freebsd.org/changeset/base/281559

Log:
  Fix handling of BUS_PROBE_NOWILDCARD in 'device_probe_child()'.
  
  Device probe value of BUS_PROBE_NOWILDCARD should be treated specially only
  if the device has a fixed devclass. Otherwise it should be interpreted just
  as if the driver doesn't want to claim the device.
  
  Prior to this change a device that was not claimed explicitly by its driver
  would remain attached to the driver that returned BUS_PROBE_NOWILDCARD.
  This would bump up the reference on 'driver-refs' and its 'dev-ops' would
  point to the 'driver-ops'. When the driver is subsequently unloaded the
  'dev-ops-cls' is left pointing to freed memory.
  
  This fixes an easily reproducible #GP fault caused by loading and unloading
  vmm.ko multiple times.
  
  Differential Revision:https://reviews.freebsd.org/D2294
  Reviewed by:  imp, jhb
  Discussed with:   rstone
  Reported by:  Leon Dang (ld...@nahannisys.com)
  MFC after:2 weeks

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cWed Apr 15 14:46:45 2015(r281558)
+++ head/sys/kern/subr_bus.cWed Apr 15 16:22:05 2015(r281559)
@@ -2113,6 +2113,16 @@ device_probe_child(device_t dev, device_
}
 
/*
+* Probes that return BUS_PROBE_NOWILDCARD or lower
+* only match on devices whose driver was explicitly
+* specified.
+*/
+   if (result = BUS_PROBE_NOWILDCARD 
+   !(child-flags  DF_FIXEDCLASS)) {
+   result = ENXIO;
+   }
+
+   /*
 * The driver returned an error so it
 * certainly doesn't match.
 */
@@ -2127,14 +2137,6 @@ device_probe_child(device_t dev, device_
 * of pri for the first match.
 */
if (best == NULL || result  pri) {
-   /*
-* Probes that return BUS_PROBE_NOWILDCARD
-* or lower only match on devices whose
-* driver was explicitly specified.
-*/
-   if (result = BUS_PROBE_NOWILDCARD 
-   !(child-flags  DF_FIXEDCLASS))
-   continue;
best = dl;
pri = result;
continue;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281560 - in stable/10/sys: amd64/amd64 i386/i386 x86/x86

2015-04-15 Thread John Baldwin
Author: jhb
Date: Wed Apr 15 16:52:34 2015
New Revision: 281560
URL: https://svnweb.freebsd.org/changeset/base/281560

Log:
  MFC 278325,280866:
  Revert the IPI startup sequence to match what is described in the
  Intel Multiprocessor Specification v1.4.  The Intel SDM claims that
  
  278325:
  Revert the IPI startup sequence to match what is described in the
  Intel Multiprocessor Specification v1.4.  The Intel SDM claims that
  the INIT IPIs here are invalid, but other systems follow the MP
  spec instead.
  
  While here, fix the IPI wait routine to accept a timeout in microseconds
  instead of a raw spin count, and don't spin forever during AP startup.
  Instead, panic if a STARTUP IPI is not delivered after 20 us.
  
  280866:
  Wait 100 microseconds for a local APIC to dispatch each startup-related IPI
  rather than 20.  The MP 1.4 specification states in Appendix B.2:
  
A period of 20 microseconds should be sufficient for IPI dispatch to
 complete under normal operating conditions.
  
  (Note that this appears to be separate from the 10 millisecond (INIT) and
  200 microsecond (STARTUP) waits after the IPIs are dispatched.)  The
  Intel SDM is silent on this issue as far as I can tell.
  
  At least some hardware requires 60 microseconds as noted in the PR, so
  bump this to 100 to be on the safe side.
  
  PR:   196542, 197756

Modified:
  stable/10/sys/amd64/amd64/mp_machdep.c
  stable/10/sys/i386/i386/mp_machdep.c
  stable/10/sys/x86/x86/local_apic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/mp_machdep.c
==
--- stable/10/sys/amd64/amd64/mp_machdep.c  Wed Apr 15 16:22:05 2015
(r281559)
+++ stable/10/sys/amd64/amd64/mp_machdep.c  Wed Apr 15 16:52:34 2015
(r281560)
@@ -1067,14 +1067,27 @@ ipi_startup(int apic_id, int vector)
 {
 
/*
+* This attempts to follow the algorithm described in the
+* Intel Multiprocessor Specification v1.4 in section B.4.
+* For each IPI, we allow the local APIC ~20us to deliver the
+* IPI.  If that times out, we panic.
+*/
+
+   /*
 * first we do an INIT IPI: this INIT IPI might be run, resetting
 * and running the target CPU. OR this INIT IPI might be latched (P5
 * bug), CPU waiting for STARTUP IPI. OR this INIT IPI might be
 * ignored.
 */
-   lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE |
+   lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_LEVEL |
APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id);
-   lapic_ipi_wait(-1);
+   lapic_ipi_wait(100);
+
+   /* Explicitly deassert the INIT IPI. */
+   lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_LEVEL |
+   APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT,
+   apic_id);
+
DELAY(1);   /* wait ~10mS */
 
/*
@@ -1086,9 +1099,11 @@ ipi_startup(int apic_id, int vector)
 * will run.
 */
lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE |
-   APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP |
+   APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP |
vector, apic_id);
-   lapic_ipi_wait(-1);
+   if (!lapic_ipi_wait(100))
+   panic(Failed to deliver first STARTUP IPI to APIC %d,
+   apic_id);
DELAY(200); /* wait ~200uS */
 
/*
@@ -1098,9 +1113,12 @@ ipi_startup(int apic_id, int vector)
 * recognized after hardware RESET or INIT IPI.
 */
lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE |
-   APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP |
+   APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP |
vector, apic_id);
-   lapic_ipi_wait(-1);
+   if (!lapic_ipi_wait(100))
+   panic(Failed to deliver second STARTUP IPI to APIC %d,
+   apic_id);
+
DELAY(200); /* wait ~200uS */
 }
 

Modified: stable/10/sys/i386/i386/mp_machdep.c
==
--- stable/10/sys/i386/i386/mp_machdep.cWed Apr 15 16:22:05 2015
(r281559)
+++ stable/10/sys/i386/i386/mp_machdep.cWed Apr 15 16:52:34 2015
(r281560)
@@ -1140,14 +1140,27 @@ ipi_startup(int apic_id, int vector)
 {
 
/*
+* This attempts to follow the algorithm described in the
+* Intel Multiprocessor Specification v1.4 in section B.4.
+* For each IPI, we allow the local APIC ~20us to deliver the
+* IPI.  If that times out, we panic.
+*/
+
+   /*
 * first we do an INIT IPI: this INIT IPI might be run, resetting
 * and running the target CPU. OR this INIT IPI might be latched (P5
 * bug), CPU 

svn commit: r281561 - head/usr.sbin/bhyve

2015-04-15 Thread Tycho Nightingale
Author: tychon
Date: Wed Apr 15 18:49:03 2015
New Revision: 281561
URL: https://svnweb.freebsd.org/changeset/base/281561

Log:
  Prior to aborting due to an ioport error, it is always interesting to
  see what the guest's %rip is.
  
  Reviewed by:  grehan

Modified:
  head/usr.sbin/bhyve/bhyverun.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Wed Apr 15 16:52:34 2015
(r281560)
+++ head/usr.sbin/bhyve/bhyverun.c  Wed Apr 15 18:49:03 2015
(r281561)
@@ -325,8 +325,10 @@ vmexit_inout(struct vmctx *ctx, struct v
 
error = emulate_inout(ctx, vcpu, vme, strictio);
if (error) {
-   fprintf(stderr, Unhandled %s%c 0x%04x\n, in ? in : out,
-   bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port);
+   fprintf(stderr, Unhandled %s%c 0x%04x at 0x%lx\n,
+   in ? in : out,
+   bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'),
+   port, vmexit-rip);
return (VMEXIT_ABORT);
} else {
return (VMEXIT_CONTINUE);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Adrian Chadd
cc1: warnings being treated as errors
/usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:
In function 'iconv_catgets':
/usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599:
warning: passing argument 2 of 'dl_iconv' from incompatible pointer
type




-adrian


On 15 April 2015 at 02:09, Tijl Coosemans t...@freebsd.org wrote:
 Author: tijl
 Date: Wed Apr 15 09:09:20 2015
 New Revision: 281550
 URL: https://svnweb.freebsd.org/changeset/base/281550

 Log:
   Remove the const qualifier from iconv(3) to comply with POSIX:
   http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

   Adjust all code that calls iconv.

   PR:   199099
   Exp-run by:   antoine
   MFC after:2 weeks

 Modified:
   head/UPDATING
   head/bin/csh/config.h
   head/contrib/smbfs/include/netsmb/smb_lib.h
   head/contrib/smbfs/lib/smb/nls.c
   head/contrib/smbfs/lib/smb/print.c
   head/contrib/smbfs/lib/smb/rq.c
   head/include/iconv.h
   head/lib/libarchive/Makefile
   head/lib/libc/iconv/__iconv.c
   head/lib/libc/iconv/bsd_iconv.c
   head/lib/libc/iconv/citrus_iconv.h
   head/lib/libc/iconv/citrus_iconv_local.h
   head/lib/libc/iconv/citrus_none.c
   head/lib/libc/iconv/citrus_stdenc.h
   head/lib/libc/iconv/citrus_stdenc_local.h
   head/lib/libc/iconv/citrus_stdenc_template.h
   head/lib/libc/iconv/iconv-internal.h
   head/lib/libc/iconv/iconv.3
   head/lib/libc/iconv/iconv.c
   head/lib/libc/iconv/iconv_compat.c
   head/lib/libc/locale/cXXrtomb_iconv.h
   head/lib/libc/locale/mbrtocXX_iconv.h
   head/lib/libiconv_modules/BIG5/citrus_big5.c
   head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
   head/lib/libiconv_modules/EUC/citrus_euc.c
   head/lib/libiconv_modules/EUCTW/citrus_euctw.c
   head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c
   head/lib/libiconv_modules/HZ/citrus_hz.c
   head/lib/libiconv_modules/ISO2022/citrus_iso2022.c
   head/lib/libiconv_modules/JOHAB/citrus_johab.c
   head/lib/libiconv_modules/MSKanji/citrus_mskanji.c
   head/lib/libiconv_modules/UES/citrus_ues.c
   head/lib/libiconv_modules/UTF1632/citrus_utf1632.c
   head/lib/libiconv_modules/UTF7/citrus_utf7.c
   head/lib/libiconv_modules/UTF8/citrus_utf8.c
   head/lib/libiconv_modules/VIQR/citrus_viqr.c
   head/lib/libiconv_modules/ZW/citrus_zw.c
   head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c
   head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
   head/lib/libkiconv/xlat16_iconv.c
   head/sys/sys/param.h
   head/usr.bin/iconv/iconv.c

 Modified: head/UPDATING
 ==
 --- head/UPDATING   Wed Apr 15 08:16:34 2015(r281549)
 +++ head/UPDATING   Wed Apr 15 09:09:20 2015(r281550)
 @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 disable the most expensive debugging functionality run
 ln -s 'abort:false,junk:false' /etc/malloc.conf.)

 +20150415:
 +   The const qualifier has been removed from iconv(3) to comply with
 +   POSIX.  The ports tree is aware of this from r384038 onwards.
 +
  20150324:
 From legacy ata(4) driver was removed support for SATA controllers
 supported by more functional drivers ahci(4), siis(4) and mvs(4).

 Modified: head/bin/csh/config.h
 ==
 --- head/bin/csh/config.h   Wed Apr 15 08:16:34 2015(r281549)
 +++ head/bin/csh/config.h   Wed Apr 15 09:09:20 2015(r281550)
 @@ -198,7 +198,7 @@
  #define HAVE_WCWIDTH 1

  /* Define as const if the declaration of iconv() needs const. */
 -#define ICONV_CONST const
 +#define ICONV_CONST

  /* Support NLS. */
  #define NLS 1

 Modified: head/contrib/smbfs/include/netsmb/smb_lib.h
 ==
 --- head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 08:16:34 2015  
   (r281549)
 +++ head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 09:09:20 2015  
   (r281550)
 @@ -191,7 +191,7 @@ int  smb_ctx_readrc(struct smb_ctx *);
  int  smb_ctx_resolve(struct smb_ctx *);
  int  smb_ctx_setflags(struct smb_ctx *, int, int, int);

 -int  smb_smb_open_print_file(struct smb_ctx *, int, int, const char *, 
 smbfh*);
 +int  smb_smb_open_print_file(struct smb_ctx *, int, int, char *, smbfh*);
  int  smb_smb_close_print_file(struct smb_ctx *, smbfh);

  int  smb_read(struct smb_ctx *, smbfh, off_t, size_t, char *);
 @@ -204,8 +204,8 @@ int  smb_rq_init(struct smb_ctx *, u_cha
  void smb_rq_done(struct smb_rq *);
  void smb_rq_wend(struct smb_rq *);
  int  smb_rq_simple(struct smb_rq *);
 -int  smb_rq_dmem(struct mbdata *, const char *, size_t);
 -int  smb_rq_dstring(struct mbdata *, const char *);
 +int  smb_rq_dmem(struct mbdata *, char *, size_t);
 +int  smb_rq_dstring(struct mbdata *, char *);

  int  smb_t2_request(struct smb_ctx *, int, int, const char *,
 int, void *, int

Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Peter Wemm
On Wednesday, April 15, 2015 11:29:19 AM Adrian Chadd wrote:
 cc1: warnings being treated as errors
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/s
 h.func.c: In function 'iconv_catgets':
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/s
 h.func.c:2599: warning: passing argument 2 of 'dl_iconv' from incompatible
 pointer type
 
 -adrian
 
 On 15 April 2015 at 02:09, Tijl Coosemans t...@freebsd.org wrote:
  Author: tijl
  Date: Wed Apr 15 09:09:20 2015
  New Revision: 281550
  URL: https://svnweb.freebsd.org/changeset/base/281550
  
  Log:
Remove the const qualifier from iconv(3) to comply with POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

Adjust all code that calls iconv.

[Massive commit diff quote trimmed]

This is one of those unfortunate things.  A mistake was made during the 
standards process that wasn't caught untill too late.  It was corrected, but 
not until the damage was done.  The short version is that in the posix spec, 
the man page had the wrong type (and made no sense), but the actual code 
definition in the include file spec was correct.

So, a bunch of OS's used the text description as the source of truth.  
Ports/libiconv is one.

Others requested a formal clarification and the posix committee specifically 
said the include file spec (which makes sense) is the correct one and updated 
the man page to match the include file.  Linux glibc uses the correct form.

When I originally pulled the trigger I used the incorrect ports/libiconv form 
because I didn't know any better and regretted it since.

I'm glad the mistake has been fixed.  However, this is a gift that keeps on 
giving.  There will be loose ends like the warning above turning up in odd 
places for some time.  We'll just have to deal with it, a bit of whackamole 
will be required.  :(

-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246

signature.asc
Description: This is a digitally signed message part.


svn commit: r281563 - head/usr.sbin/freebsd-update

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Wed Apr 15 20:55:43 2015
New Revision: 281563
URL: https://svnweb.freebsd.org/changeset/base/281563

Log:
  Fix syntax errors in conditions for new features in freebsd-update
  
  Differential Revision:https://reviews.freebsd.org/D1550
  Submitted by: kmoore
  Approved by:  delphij
  Obtained from:PCBSD
  MFC after:1 week
  X-MFC-With:   279571
  Sponsored by: ScaleEngine Inc.

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Apr 15 20:16:31 
2015(r281562)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Apr 15 20:55:43 
2015(r281563)
@@ -690,7 +690,7 @@ fetch_check_params () {
fi
 
# Check that we have updates ready to install
-   if [ -f ${BDHASH}-install/kerneldone  $FORCEFETCH -eq 0 ]; then
+   if [ -f ${BDHASH}-install/kerneldone -a $FORCEFETCH -eq 0 ]; then
echo You have a partially completed upgrade pending
echo Run '$0 install' first.
echo Run '$0 fetch -F' to proceed anyway.
@@ -3220,7 +3220,7 @@ get_params () {
 # Fetch command.  Make sure that we're being called
 # interactively, then run fetch_check_params and fetch_run
 cmd_fetch () {
-   if [ ! -t 0  $NOTTYOK -eq 0 ]; then
+   if [ ! -t 0 -a $NOTTYOK -eq 0 ]; then
echo -n `basename $0` fetch should not 
echo be run non-interactively.
echo Run `basename $0` cron instead.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281562 - in head/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nfsserver fs/nullfs kern sys ufs/ffs

2015-04-15 Thread Rick Macklem
Author: rmacklem
Date: Wed Apr 15 20:16:31 2015
New Revision: 281562
URL: https://svnweb.freebsd.org/changeset/base/281562

Log:
  File systems that do not use the buffer cache (such as ZFS) must
  use VOP_FSYNC() to perform the NFS server's Commit operation.
  This patch adds a mnt_kern_flag called MNTK_USES_BCACHE which
  is set by file systems that use the buffer cache. If this flag
  is not set, the NFS server always does a VOP_FSYNC().
  This should be ok for old file system modules that do not set
  MNTK_USES_BCACHE, since calling VOP_FSYNC() is correct, although
  it might not be optimal for file systems that use the buffer cache.
  
  Reviewed by:  kib
  MFC after:2 weeks

Modified:
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/fuse/fuse_vfsops.c
  head/sys/fs/msdosfs/msdosfs_vfsops.c
  head/sys/fs/nandfs/nandfs_vfsops.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nullfs/null_vfsops.c
  head/sys/kern/vfs_subr.c
  head/sys/sys/mount.h
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==
--- head/sys/fs/ext2fs/ext2_vfsops.cWed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/ext2fs/ext2_vfsops.cWed Apr 15 20:16:31 2015
(r281562)
@@ -675,7 +675,8 @@ ext2_mountfs(struct vnode *devvp, struct
 * Initialize filesystem stat information in mount struct.
 */
MNT_ILOCK(mp);
-   mp-mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED;
+   mp-mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED |
+   MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
return (0);
 out:

Modified: head/sys/fs/fuse/fuse_vfsops.c
==
--- head/sys/fs/fuse/fuse_vfsops.c  Wed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/fuse/fuse_vfsops.c  Wed Apr 15 20:16:31 2015
(r281562)
@@ -337,6 +337,7 @@ fuse_vfsop_mount(struct mount *mp)
MNT_ILOCK(mp);
mp-mnt_data = data;
mp-mnt_flag |= MNT_LOCAL;
+   mp-mnt_kern_flag |= MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
/* We need this here as this slot is used by getnewvnode() */
mp-mnt_stat.f_iosize = PAGE_SIZE;

Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
==
--- head/sys/fs/msdosfs/msdosfs_vfsops.cWed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/msdosfs/msdosfs_vfsops.cWed Apr 15 20:16:31 2015
(r281562)
@@ -759,6 +759,7 @@ mountmsdosfs(struct vnode *devvp, struct
mp-mnt_stat.f_fsid.val[1] = mp-mnt_vfc-vfc_typenum;
MNT_ILOCK(mp);
mp-mnt_flag |= MNT_LOCAL;
+   mp-mnt_kern_flag |= MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
 
if (pmp-pm_flags  MSDOSFS_LARGEFS)

Modified: head/sys/fs/nandfs/nandfs_vfsops.c
==
--- head/sys/fs/nandfs/nandfs_vfsops.c  Wed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/nandfs/nandfs_vfsops.c  Wed Apr 15 20:16:31 2015
(r281562)
@@ -1391,6 +1391,7 @@ nandfs_mountfs(struct vnode *devvp, stru
nmp-nm_ronly = ronly;
MNT_ILOCK(mp);
mp-mnt_flag |= MNT_LOCAL;
+   mp-mnt_kern_flag |= MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
nmp-nm_nandfsdev = nandfsdev;
/* Add our mountpoint */

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==
--- head/sys/fs/nfsclient/nfs_clvfsops.cWed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/nfsclient/nfs_clvfsops.cWed Apr 15 20:16:31 2015
(r281562)
@@ -1198,7 +1198,8 @@ nfs_mount(struct mount *mp)
 out:
if (!error) {
MNT_ILOCK(mp);
-   mp-mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF;
+   mp-mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF |
+   MNTK_USES_BCACHE;
MNT_IUNLOCK(mp);
}
return (error);

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cWed Apr 15 18:49:03 2015
(r281561)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cWed Apr 15 20:16:31 2015
(r281562)
@@ -1270,8 +1270,11 @@ nfsvno_fsync(struct vnode *vp, u_int64_t
 * file is done.  At this time VOP_FSYNC does not accept offset and
 * byte count parameters so call VOP_FSYNC the whole file for now.
 * The same is true for NFSv4: RFC 3530 Sec. 14.2.3.
+* File systems that do not use the buffer cache (as indicated
+* by MNTK_USES_BCACHE not being set) must use VOP_FSYNC().
 */
-   if (cnt == 0 || cnt  MAX_COMMIT_COUNT) {
+   if (cnt == 0 || cnt  

Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Tijl Coosemans
On Wed, 15 Apr 2015 11:29:19 -0700 Adrian Chadd adr...@freebsd.org wrote:
 cc1: warnings being treated as errors
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:
 In function 'iconv_catgets':
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599:
 warning: passing argument 2 of 'dl_iconv' from incompatible pointer
 type

Does embedded mean that WITHOUT_ICONV is defined?
Can you try the attached patch?Index: bin/csh/iconv_stub.h
===
--- bin/csh/iconv_stub.h	(revision 281561)
+++ bin/csh/iconv_stub.h	(working copy)
@@ -30,7 +30,7 @@
 #define _ICONV_H_
 
 typedef void *iconv_t;
-typedef size_t dl_iconv_t(iconv_t, const char **, size_t *, char **, size_t *);
+typedef size_t dl_iconv_t(iconv_t, char **, size_t *, char **, size_t *);
 typedef int dl_iconv_close_t(iconv_t);
 
 extern iconv_t dl_iconv_open(const char *, const char *);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org

svn commit: r281566 - stable/10/usr.sbin/bluetooth/bthidd

2015-04-15 Thread Raphael Kubo da Costa
Author: rakuco (ports committer)
Date: Wed Apr 15 22:02:52 2015
New Revision: 281566
URL: https://svnweb.freebsd.org/changeset/base/281566

Log:
  MFC r281116.
  
  bthidd: Consider usage ranges when dealing with array inputs.
  
  So far, we were always using HID_USAGE() to determine the Usage ID of a
  certain HID report input item. This does not work as intended if a field
  is an array and the allowed usages are specified with a usage range, as
  HID_USAGE() will return 0. We need to use the field value as an index in
  the usage range list in this case instead.
  
  This makes the volume keys in a Microsoft Bluetooth Mobile Keyboard
  5000 be properly recognized. The relevant part of the HID report looks
  like this:
  
0xA1, 0x01,// Collection (Application)
0x85, 0x07,//   Report ID (7)
0x05, 0x0C,//   Usage Page (Consumer)
0x19, 0x00,//   Usage Minimum (Unassigned)
0x2A, 0xFF, 0x03,  //   Usage Maximum (0x03FF)
0x95, 0x01,//   Report Count (1)
0x75, 0x10,//   Report Size (16)
0x15, 0x00,//   Logical Minimum (0)
0x27, 0xFF, 0x03, 0x00, 0x00,  //   Logical Maximum (1023)
0x81, 0x00,//   Input (Data,Array,Abs,No Wrap,Linear,Preferred
   //   State,No Null Position)
  
  When a key such as volume down is pressed, the following data is
  transferred through Interrupt In:
  
0x07 0xEA 0x00
  
  Differential Revision:https://reviews.freebsd.org/D2229

Modified:
  stable/10/usr.sbin/bluetooth/bthidd/hid.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bluetooth/bthidd/hid.c
==
--- stable/10/usr.sbin/bluetooth/bthidd/hid.c   Wed Apr 15 21:48:06 2015
(r281565)
+++ stable/10/usr.sbin/bluetooth/bthidd/hid.c   Wed Apr 15 22:02:52 2015
(r281566)
@@ -165,9 +165,21 @@ hid_interrupt(bthid_session_p s, uint8_t
continue;
 
page = HID_PAGE(h.usage);
-   usage = HID_USAGE(h.usage);
val = hid_get_data(data, h);
 
+   /*
+* When the input field is an array and the usage is specified
+* with a range instead of an ID, we have to derive the actual
+* usage by using the item value as an index in the usage range
+* list.
+*/
+   if ((h.flags  HIO_VARIABLE)) {
+   usage = HID_USAGE(h.usage);
+   } else {
+   const uint32_t usage_offset = val - h.logical_minimum;
+   usage = HID_USAGE(h.usage_minimum + usage_offset);
+   }
+
switch (page) {
case HUP_GENERIC_DESKTOP:
switch (usage) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281564 - in stable/10/sys/dev/mps: . mpi

2015-04-15 Thread Stephen McConnell
Author: slm
Date: Wed Apr 15 21:47:15 2015
New Revision: 281564
URL: https://svnweb.freebsd.org/changeset/base/281564

Log:
  MFI r257381:
  Adjust to handle either a 32-bit or 64-bit lun_id_t in printf.
  
  MFC r266615:
  Increase taskqueue thread priority from idle to PRIBIO.
  
  MFC r279253:
  - Copyright to Avago
  - SSU changes
  - SATA ID timeout handling (PR 191348)
  - reset handling changes
  - Bump version to 20.00.00.00-fbsd
  
  MFC r279695:
  Change that should have been done with r279253

Modified:
  stable/10/sys/dev/mps/mpi/mpi2.h
  stable/10/sys/dev/mps/mpi/mpi2_cnfg.h
  stable/10/sys/dev/mps/mpi/mpi2_hbd.h
  stable/10/sys/dev/mps/mpi/mpi2_history.txt
  stable/10/sys/dev/mps/mpi/mpi2_init.h
  stable/10/sys/dev/mps/mpi/mpi2_ioc.h
  stable/10/sys/dev/mps/mpi/mpi2_ra.h
  stable/10/sys/dev/mps/mpi/mpi2_raid.h
  stable/10/sys/dev/mps/mpi/mpi2_sas.h
  stable/10/sys/dev/mps/mpi/mpi2_targ.h
  stable/10/sys/dev/mps/mpi/mpi2_tool.h
  stable/10/sys/dev/mps/mpi/mpi2_type.h
  stable/10/sys/dev/mps/mps.c
  stable/10/sys/dev/mps/mps_config.c
  stable/10/sys/dev/mps/mps_ioctl.h
  stable/10/sys/dev/mps/mps_mapping.c
  stable/10/sys/dev/mps/mps_mapping.h
  stable/10/sys/dev/mps/mps_pci.c
  stable/10/sys/dev/mps/mps_sas.c
  stable/10/sys/dev/mps/mps_sas.h
  stable/10/sys/dev/mps/mps_sas_lsi.c
  stable/10/sys/dev/mps/mps_user.c
  stable/10/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mps/mpi/mpi2.h
==
--- stable/10/sys/dev/mps/mpi/mpi2.hWed Apr 15 20:55:43 2015
(r281563)
+++ stable/10/sys/dev/mps/mpi/mpi2.hWed Apr 15 21:47:15 2015
(r281564)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2006-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,13 +24,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2012 LSI Corporation.
+ *  Copyright (c) 2006-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2.h

Modified: stable/10/sys/dev/mps/mpi/mpi2_cnfg.h
==
--- stable/10/sys/dev/mps/mpi/mpi2_cnfg.h   Wed Apr 15 20:55:43 2015
(r281563)
+++ stable/10/sys/dev/mps/mpi/mpi2_cnfg.h   Wed Apr 15 21:47:15 2015
(r281564)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2006-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,13 +24,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2012 LSI Corporation.
+ *  Copyright (c) 2006-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_cnfg.h

Modified: stable/10/sys/dev/mps/mpi/mpi2_hbd.h
==
--- stable/10/sys/dev/mps/mpi/mpi2_hbd.hWed Apr 15 20:55:43 2015
(r281563)
+++ stable/10/sys/dev/mps/mpi/mpi2_hbd.hWed Apr 15 21:47:15 2015
(r281564)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2009-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,13 +24,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2009-2012 LSI Corporation.
+ *  Copyright (c) 2009-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_hbd.h

Modified: stable/10/sys/dev/mps/mpi/mpi2_history.txt
==
--- stable/10/sys/dev/mps/mpi/mpi2_history.txt  Wed Apr 15 20:55:43 2015
(r281563)
+++ stable/10/sys/dev/mps/mpi/mpi2_history.txt  Wed Apr 15 21:47:15 2015
(r281564)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2000-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS 

svn commit: r281569 - stable/9/usr.sbin/bluetooth/bthidd

2015-04-15 Thread Raphael Kubo da Costa
Author: rakuco (ports committer)
Date: Wed Apr 15 22:17:16 2015
New Revision: 281569
URL: https://svnweb.freebsd.org/changeset/base/281569

Log:
  MFC r281146.
  
  bthidd: Remove unused macros from hid.c.
  
  ASIZE() was never used, and min() stopped being used in r207812.
  
  Differential Revision:https://reviews.freebsd.org/D2230
  Reviewed by:  emax
  Approved by:  emax

Modified:
  stable/9/usr.sbin/bluetooth/bthidd/hid.c
Directory Properties:
  stable/9/usr.sbin/bluetooth/bthidd/   (props changed)

Modified: stable/9/usr.sbin/bluetooth/bthidd/hid.c
==
--- stable/9/usr.sbin/bluetooth/bthidd/hid.cWed Apr 15 22:15:23 2015
(r281568)
+++ stable/9/usr.sbin/bluetooth/bthidd/hid.cWed Apr 15 22:17:16 2015
(r281569)
@@ -48,12 +48,6 @@
 #include bthidd.h
 #include kbd.h
 
-#undef min
-#definemin(x, y)   (((x)  (y))? (x) : (y))
-
-#undef ASIZE
-#defineASIZE(a)(sizeof(a)/sizeof(a[0]))
-
 /*
  * Process data from control channel
  */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281567 - stable/10/usr.sbin/bluetooth/bthidd

2015-04-15 Thread Raphael Kubo da Costa
Author: rakuco (ports committer)
Date: Wed Apr 15 22:07:51 2015
New Revision: 281567
URL: https://svnweb.freebsd.org/changeset/base/281567

Log:
  MFC r281146.
  
  bthidd: Remove unused macros from hid.c.
  
  ASIZE() was never used, and min() stopped being used in r207812.
  
  Differential Revision:https://reviews.freebsd.org/D2230
  Reviewed by:  emax
  Approved by:  emax

Modified:
  stable/10/usr.sbin/bluetooth/bthidd/hid.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bluetooth/bthidd/hid.c
==
--- stable/10/usr.sbin/bluetooth/bthidd/hid.c   Wed Apr 15 22:02:52 2015
(r281566)
+++ stable/10/usr.sbin/bluetooth/bthidd/hid.c   Wed Apr 15 22:07:51 2015
(r281567)
@@ -48,12 +48,6 @@
 #include bthidd.h
 #include kbd.h
 
-#undef min
-#definemin(x, y)   (((x)  (y))? (x) : (y))
-
-#undef ASIZE
-#defineASIZE(a)(sizeof(a)/sizeof(a[0]))
-
 /*
  * Process data from control channel
  */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2015-04-15 Thread Xin LI
Author: delphij
Date: Wed Apr 15 21:48:06 2015
New Revision: 281565
URL: https://svnweb.freebsd.org/changeset/base/281565

Log:
  Verify if the saved hostid is still the same and update if
  it was changed.
  
  Sponsored by: iXsystems, Inc.
  Obtained from:FreeNAS (trueos commit 0abb740)

Modified:
  head/etc/rc.d/hostid_save

Modified: head/etc/rc.d/hostid_save
==
--- head/etc/rc.d/hostid_save   Wed Apr 15 21:47:15 2015(r281564)
+++ head/etc/rc.d/hostid_save   Wed Apr 15 21:48:06 2015(r281565)
@@ -16,12 +16,19 @@ rcvar=hostid_enable
 
 hostid_save()
 {
-   if [ ! -r ${hostid_file} ]; then
-   $SYSCTL_N kern.hostuuid  ${hostid_file}
-   if [ $? -ne 0 ]; then
-   warn could not store hostuuid in ${hostid_file}.
+   current_hostid=`$SYSCTL_N kern.hostuuid`
+
+   if [ -r ${hostid_file} ]; then
+   read saved_hostid  ${hostid_file}
+   if [ ${saved_hostid} = ${current_hostid} ]; then
+   exit 0
fi
fi
+
+   echo ${current_hostid}  ${hostid_file}
+   if [ $? -ne 0 ]; then
+   warn could not store hostuuid in ${hostid_file}.
+   fi
 }
 
 load_rc_config $name
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281568 - stable/9/usr.sbin/bluetooth/bthidd

2015-04-15 Thread Raphael Kubo da Costa
Author: rakuco (ports committer)
Date: Wed Apr 15 22:15:23 2015
New Revision: 281568
URL: https://svnweb.freebsd.org/changeset/base/281568

Log:
  MFC r281116.
  
  bthidd: Consider usage ranges when dealing with array inputs.
  
  So far, we were always using HID_USAGE() to determine the Usage ID of a
  certain HID report input item. This does not work as intended if a field
  is an array and the allowed usages are specified with a usage range, as
  HID_USAGE() will return 0. We need to use the field value as an index in
  the usage range list in this case instead.
  
  This makes the volume keys in a Microsoft Bluetooth Mobile Keyboard
  5000 be properly recognized. The relevant part of the HID report looks
  like this:
  
0xA1, 0x01,// Collection (Application)
0x85, 0x07,//   Report ID (7)
0x05, 0x0C,//   Usage Page (Consumer)
0x19, 0x00,//   Usage Minimum (Unassigned)
0x2A, 0xFF, 0x03,  //   Usage Maximum (0x03FF)
0x95, 0x01,//   Report Count (1)
0x75, 0x10,//   Report Size (16)
0x15, 0x00,//   Logical Minimum (0)
0x27, 0xFF, 0x03, 0x00, 0x00,  //   Logical Maximum (1023)
0x81, 0x00,//   Input (Data,Array,Abs,No Wrap,Linear,Preferred
   //   State,No Null Position)
  
  When a key such as volume down is pressed, the following data is
  transferred through Interrupt In:
  
0x07 0xEA 0x00
  
  Differential Revision:https://reviews.freebsd.org/D2229
  Reviewed by:  emax
  Approved by:  emax

Modified:
  stable/9/usr.sbin/bluetooth/bthidd/hid.c
Directory Properties:
  stable/9/usr.sbin/bluetooth/bthidd/   (props changed)

Modified: stable/9/usr.sbin/bluetooth/bthidd/hid.c
==
--- stable/9/usr.sbin/bluetooth/bthidd/hid.cWed Apr 15 22:07:51 2015
(r281567)
+++ stable/9/usr.sbin/bluetooth/bthidd/hid.cWed Apr 15 22:15:23 2015
(r281568)
@@ -165,9 +165,21 @@ hid_interrupt(bthid_session_p s, uint8_t
continue;
 
page = HID_PAGE(h.usage);
-   usage = HID_USAGE(h.usage);
val = hid_get_data(data, h);
 
+   /*
+* When the input field is an array and the usage is specified
+* with a range instead of an ID, we have to derive the actual
+* usage by using the item value as an index in the usage range
+* list.
+*/
+   if ((h.flags  HIO_VARIABLE)) {
+   usage = HID_USAGE(h.usage);
+   } else {
+   const uint32_t usage_offset = val - h.logical_minimum;
+   usage = HID_USAGE(h.usage_minimum + usage_offset);
+   }
+
switch (page) {
case HUP_GENERIC_DESKTOP:
switch (usage) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281575 - stable/10/usr.bin/man

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Thu Apr 16 00:37:05 2015
New Revision: 281575
URL: https://svnweb.freebsd.org/changeset/base/281575

Log:
  MFC: r272135, r272174
Update man(1) to list the different sections of the manual
  
  Approved by:  eadler (mentor, implicit)
  Sponsored by: ScaleEngine Inc.

Modified:
  stable/10/usr.bin/man/man.1
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/man/man.1
==
--- stable/10/usr.bin/man/man.1 Thu Apr 16 00:34:41 2015(r281574)
+++ stable/10/usr.bin/man/man.1 Thu Apr 16 00:37:05 2015(r281575)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 3, 2011
+.Dd September 26, 2014
 .Dt MAN 1
 .Os
 .Sh NAME
@@ -58,6 +58,28 @@ is provided,
 .Nm
 restricts the search to the specific section of the manual.
 .Pp
+The sections of the manual are:
+.Bl -enum -offset indent -compact
+.It
+.Fx General Commands Manual
+.It
+.Fx System Calls Manual
+.It
+.Fx Library Functions Manual
+.It
+.Fx Kernel Interfaces Manual
+.It
+.Fx File Formats Manual
+.It
+.Fx Games Manual
+.It
+.Fx Miscellaneous Information Manual
+.It
+.Fx System Manager's Manual
+.It
+.Fx Kernel Developer's Manual
+.El
+.Pp
 Options that
 .Nm
 understands:
@@ -318,6 +340,14 @@ Local configuration files.
 .Sh SEE ALSO
 .Xr apropos 1 ,
 .Xr intro 1 ,
+.Xr intro 2 ,
+.Xr intro 3 ,
+.Xr intro 4 ,
+.Xr intro 5 ,
+.Xr intro 6 ,
+.Xr intro 7 ,
+.Xr intro 8 ,
+.Xr intro 9 ,
 .Xr locale 1 ,
 .Xr manpath 1 ,
 .Xr nroff 1 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281581 - head/usr.sbin/vidcontrol

2015-04-15 Thread Ed Maste
Author: emaste
Date: Thu Apr 16 01:47:05 2015
New Revision: 281581
URL: https://svnweb.freebsd.org/changeset/base/281581

Log:
  vidcontrol: make size argument optional again for syscons
  
  r273544 changed the -f option allow no arguments in vt mode (used to
  reset the font back to the default), but broke the optionality of the
  size argument for syscons. Drop the required argument from syscons'
  optstring for -f so the optional argument handler works the same way
  for both syscons and vt.
  
  Reported by:  bde
  Sponsored by: The FreeBSD Foundation

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

Modified: head/usr.sbin/vidcontrol/vidcontrol.c
==
--- head/usr.sbin/vidcontrol/vidcontrol.c   Thu Apr 16 00:44:59 2015
(r281580)
+++ head/usr.sbin/vidcontrol/vidcontrol.c   Thu Apr 16 01:47:05 2015
(r281581)
@@ -1343,7 +1343,7 @@ main(int argc, char **argv)
if (vt4_mode)
opts = b:Cc:fg:h:Hi:M:m:pPr:S:s:T:t:x;
else
-   opts = b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x;
+   opts = b:Cc:dfg:h:Hi:l:LM:m:pPr:S:s:T:t:x;
 
while ((opt = getopt(argc, argv, opts)) != -1)
switch(opt) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281570 - stable/10/lib/libc/string

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Thu Apr 16 00:24:21 2015
New Revision: 281570
URL: https://svnweb.freebsd.org/changeset/base/281570

Log:
  MFC: r266671, r266725:
Merge strcspn.3 into strspn.3 and clarify the explaination
  
  Approved by:  eadler (mentor, implicit)
  Sponsored by: ScaleEngine Inc.

Deleted:
  stable/10/lib/libc/string/strcspn.3
Modified:
  stable/10/lib/libc/string/Makefile.inc
  stable/10/lib/libc/string/strspn.3
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/string/Makefile.inc
==
--- stable/10/lib/libc/string/Makefile.inc  Wed Apr 15 22:17:16 2015
(r281569)
+++ stable/10/lib/libc/string/Makefile.inc  Thu Apr 16 00:24:21 2015
(r281570)
@@ -30,7 +30,7 @@ SYM_MAPS+=${.CURDIR}/string/Symbol.map
 
 MAN+=  bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \
memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \
-   strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strdup.3 strerror.3 \
+   strchr.3 strcmp.3 strcoll.3 strcpy.3 strdup.3 strerror.3 \
string.3 strlcpy.3 strlen.3 strmode.3 strpbrk.3 strsep.3 \
strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 wcscoll.3 wcstok.3 \
wcswidth.3 wcsxfrm.3 wmemchr.3
@@ -60,6 +60,7 @@ MLINKS+=strerror.3 perror.3 \
strerror.3 sys_nerr.3
 MLINKS+=strlcpy.3 strlcat.3
 MLINKS+=strlen.3 strnlen.3
+MLINKS+=strspn.3 strcspn.3
 MLINKS+=strstr.3 strcasestr.3 \
strstr.3 strnstr.3 \
strstr.3 strcasestr_l.3

Modified: stable/10/lib/libc/string/strspn.3
==
--- stable/10/lib/libc/string/strspn.3  Wed Apr 15 22:17:16 2015
(r281569)
+++ stable/10/lib/libc/string/strspn.3  Thu Apr 16 00:24:21 2015
(r281570)
@@ -32,11 +32,12 @@
 .\ @(#)strspn.3   8.1 (Berkeley) 6/4/93
 .\ $FreeBSD$
 .\
-.Dd June 4, 1993
+.Dd May 24, 2014
 .Dt STRSPN 3
 .Os
 .Sh NAME
-.Nm strspn
+.Nm strspn ,
+.Nm strcspn
 .Nd span a string
 .Sh LIBRARY
 .Lb libc
@@ -44,6 +45,8 @@
 .In string.h
 .Ft size_t
 .Fn strspn const char *s const char *charset
+.Ft size_t
+.Fn strcspn const char *s const char *charset
 .Sh DESCRIPTION
 The
 .Fn strspn
@@ -54,22 +57,44 @@ as long as the characters from
 .Fa s
 occur in the null-terminated string
 .Fa charset .
-In other words, it computes the string array index in
-.Fa s
+In other words, it computes the string array index
 of the first character of
 .Fa s
 which is not in
 .Fa charset ,
 else the index of the first null character.
+.Pp
+The
+.Fn strcspn
+function
+spans the initial part of the null-terminated string
+.Fa s
+as long as the characters from
+.Fa s
+.Sy do not 
+occur in the null-terminated string
+.Fa charset
+.Po it spans the
+.Sy complement
+of
+.Fa charset
+.Pc .
+In other words, it computes the string array index
+of the first character of
+.Fa s
+which is also in
+.Fa charset ,
+else the index of the first null character.
 .Sh RETURN VALUES
 The
 .Fn strspn
-function
-returns the number of characters spanned.
+and
+.Fn strcspn
+functions
+return the number of characters spanned.
 .Sh SEE ALSO
 .Xr memchr 3 ,
 .Xr strchr 3 ,
-.Xr strcspn 3 ,
 .Xr strpbrk 3 ,
 .Xr strrchr 3 ,
 .Xr strsep 3 ,
@@ -79,6 +104,8 @@ returns the number of characters spanned
 .Sh STANDARDS
 The
 .Fn strspn
-function
-conforms to
+and
+.Fn strcspn
+functions
+conform to
 .St -isoC .
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281577 - stable/10/sbin/reboot

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Thu Apr 16 00:39:16 2015
New Revision: 281577
URL: https://svnweb.freebsd.org/changeset/base/281577

Log:
  MFC: r280191:
Document that nextboot(8) doesn't work as expected with ZFS
  
  Approved by:  eadler (mentor, implicit)
  Sponsored by: ScaleEngine Inc.

Modified:
  stable/10/sbin/reboot/nextboot.8
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/reboot/nextboot.8
==
--- stable/10/sbin/reboot/nextboot.8Thu Apr 16 00:37:11 2015
(r281576)
+++ stable/10/sbin/reboot/nextboot.8Thu Apr 16 00:39:16 2015
(r281577)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 31, 2012
+.Dd March 17, 2015
 .Dt NEXTBOOT 8
 .Os
 .Sh NAME
@@ -130,3 +130,9 @@ It is also my first attempt to write in 
 Finally, it does some evil things like writing to the file system before it
 has been checked.
 If it scrambles your file system, do not blame me.
+.Pp
+.Xr loader 8
+is only able to read ZFS, not write to it.
+.Pa nextboot.conf
+will NOT be reset in case of a kernel boot failure.
+
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281573 - stable/10/sbin/ifconfig

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Thu Apr 16 00:31:51 2015
New Revision: 281573
URL: https://svnweb.freebsd.org/changeset/base/281573

Log:
  MFC: r266774:
improve ifconfig(8) man page by describing special behaviour of -l ether
  
  MFC: r267141:
Style cleanups on ifconfig.8
  
  Approved by:  eadler (mentor, implicit)
  Sponsored by: ScaleEngine Inc.

Modified:
  stable/10/sbin/ifconfig/ifconfig.8
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/ifconfig/ifconfig.8
==
--- stable/10/sbin/ifconfig/ifconfig.8  Thu Apr 16 00:29:49 2015
(r281572)
+++ stable/10/sbin/ifconfig/ifconfig.8  Thu Apr 16 00:31:51 2015
(r281573)
@@ -141,13 +141,13 @@ The link-level
 .Pq Dq link
 address
 is specified as a series of colon-separated hex digits.
-This can be used to
-e.g.,\ set a new MAC address on an ethernet interface, though the
-mechanism used is not ethernet-specific.
+This can be used to, for example,
+set a new MAC address on an Ethernet interface, though the
+mechanism used is not Ethernet specific.
 If the interface is already
 up when this option is used, it will be briefly brought down and
 then brought back up again in order to ensure that the receive
-filter in the underlying ethernet hardware is properly reprogrammed.
+filter in the underlying Ethernet hardware is properly reprogrammed.
 .It Ar address_family
 Specify the
 address family
@@ -174,6 +174,18 @@ and
 .Dq lladdr
 are synonyms for
 .Dq link .
+When using the
+.Fl l
+flag, the
+.Dq ether
+address family has special meaning and is no longer synonymous with
+.Dq link
+or
+.Dq lladdr .
+Specifying
+.Fl l Dq ether
+will list only Ethernet interfaces, excluding all other interface types,
+including the loopback interface.
 .It Ar dest_address
 Specify the address of the correspondent on the other end
 of a point to point link.
@@ -700,7 +712,8 @@ Clear a flag
 .Cm defaultif .
 .It Cm ifdisabled
 Set a flag to disable all of IPv6 network communications on the
-specified interface.  Note that if there are already configured IPv6
+specified interface.
+Note that if there are already configured IPv6
 addresses on that interface, all of them are marked as
 .Dq tentative
 and DAD will be performed when this flag is cleared.
@@ -1139,7 +1152,8 @@ specifies the number of beacon intervals
 and must be in the range 1 to 15.
 By default DTIM is 1 (i.e., DTIM occurs at each beacon).
 .It Cm quiet
-Enable the use of quiet IE.  Hostap will use this to silence other
+Enable the use of quiet IE.
+Hostap will use this to silence other
 stations to reduce interference for radar detection when
 operating on 5GHz frequency and doth support is enabled.
 Use
@@ -1154,9 +1168,11 @@ scheduled quiet intervals defined by Qui
 Set the QUIET
 .Ar count
 to the number of TBTTs until the beacon interval during which the
-next quiet interval shall start.  A value of 1 indicates the quiet
+next quiet interval shall start.
+A value of 1 indicates the quiet
 interval will start during the beacon interval starting at the next
-TBTT. A value 0 is reserved.
+TBTT.
+A value 0 is reserved.
 .It Cm quiet_offset Ar offset
 Set the QUIET
 .Ar offset
@@ -2406,7 +2422,8 @@ Another name for the
 parameter.
 .It Cm accept_rev_ethip_ver
 Set a flag to accept both correct EtherIP packets and ones
-with reversed version field.  Enabled by default.
+with reversed version field.
+Enabled by default.
 This is for backward compatibility with
 .Fx 6.1 ,
 6.2, 6.3, 7.0, and 7.1.
@@ -2415,7 +2432,8 @@ Clear a flag
 .Cm accept_rev_ethip_ver .
 .It Cm send_rev_ethip_ver
 Set a flag to send EtherIP packets with reversed version
-field intentionally.  Disabled by default.
+field intentionally.
+Disabled by default.
 This is for backward compatibility with
 .Fx 6.1 ,
 6.2, 6.3, 7.0, and 7.1.
@@ -2498,7 +2516,7 @@ pseudo-interface.
 The
 .Xr vlan 4
 interface is assigned a
-copy of the parent interface's flags and the parent's ethernet address.
+copy of the parent interface's flags and the parent's Ethernet address.
 The
 .Cm vlandev
 and
@@ -2618,6 +2636,11 @@ The
 .Fl l
 flag may be used to list all available interfaces on the system, with
 no other additional information.
+If an
+.Ar address_family
+is specified, only interfaces of that type will be listed.
+.Fl l Dq ether
+will list only Ethernet adapters, excluding the loopback interface.
 Use of this flag is mutually exclusive
 with all other flags and commands, except for
 .Fl d
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281583 - head/sys/net

2015-04-15 Thread Marcelo Araujo
Author: araujo (ports committer)
Date: Thu Apr 16 02:44:37 2015
New Revision: 281583
URL: https://svnweb.freebsd.org/changeset/base/281583

Log:
  Remove duplicate header entry.

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cThu Apr 16 02:24:40 2015(r281582)
+++ head/sys/net/route.cThu Apr 16 02:44:37 2015(r281583)
@@ -43,7 +43,6 @@
 
 #include sys/param.h
 #include sys/systm.h
-#include sys/syslog.h
 #include sys/malloc.h
 #include sys/mbuf.h
 #include sys/socket.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281571 - stable/10/share/man/man4

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Thu Apr 16 00:27:53 2015
New Revision: 281571
URL: https://svnweb.freebsd.org/changeset/base/281571

Log:
  MFC: r280301:
Fix grammar in epair(4) man page
  
  Approved by:  eadler (mentor, implicit)
  Sponsored by: ScaleEngine Inc.

Modified:
  stable/10/share/man/man4/epair.4
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/epair.4
==
--- stable/10/share/man/man4/epair.4Thu Apr 16 00:24:21 2015
(r281570)
+++ stable/10/share/man/man4/epair.4Thu Apr 16 00:27:53 2015
(r281571)
@@ -28,7 +28,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 26, 2009
+.Dd March 18, 2015
 .Dt EPAIR 4
 .Os
 .Sh NAME
@@ -89,14 +89,16 @@ that is only guaranteed to be unique wit
 To change the default addresses one may use the SIOCSIFADDR ioctl(2) or
 ifconfig(8) utility.
 .Pp
-The basic intend is to provide connectivity between two virtual
+The basic intent is to provide connectivity between two virtual
 network stack instances.
-When connected to a
-.Xr if_bridge 4
+When connected to an
+.Xr if_bridge 4 ,
 one end of the interface pair can also be part of another (virtual) LAN.
-As with any other Ethernet interface one can configure
+As with any other Ethernet interface,
+.Nm epair
+can have a
 .Xr vlan 4
-support on top of it.
+configured on top of it.
 .Sh SEE ALSO
 .Xr ioctl 2 ,
 .Xr altq 4 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281579 - stable/10/contrib/ee

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Thu Apr 16 00:44:05 2015
New Revision: 281579
URL: https://svnweb.freebsd.org/changeset/base/281579

Log:
  MFC: r277328:
Fix minor syntax and grammar errors in the markup of the ee(1) man page
  
  Approved by:  eadler (mentor, implicit)
  Sponsored by: ScaleEngine Inc.

Modified:
  stable/10/contrib/ee/ee.1
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/ee/ee.1
==
--- stable/10/contrib/ee/ee.1   Thu Apr 16 00:39:20 2015(r281578)
+++ stable/10/contrib/ee/ee.1   Thu Apr 16 00:44:05 2015(r281579)
@@ -329,8 +329,8 @@ A window showing the keyboard operations
 displayed or not.
 .IP \fBemacs keys\fR
 Control keys may be given bindings similar to emacs, or not.
-.IP \f16 bit characters\fR
-Toggles whether sixteen bit characters are handled as one 16-bit quantities or 
+.IP \fB16 bit characters\fR
+Toggles whether sixteen bit characters are handled as one 16-bit quantity or 
 two 8-bit quantities.  This works primarily with the Chinese Big 5 code set.
 .RE
 .PP
@@ -461,7 +461,7 @@ Turns off display of eight bit character
 value inside angle brackets, e.g., 220).
 .IP \fB16bit\fR
 Turns on handling of 16-bit characters.
-.IP \fbno16bit\fR
+.IP \fBno16bit\fR
 Turns off handling of 16-bit characters.
 .IP \fBemacs\fR
 Turns on emacs key bindings.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Adrian Chadd
adrian@adrian-hackbox:~/work/freebsd/embedded/head/src % cat
../root/make.conf.mips
MALLOC_PRODUCTION=
adrian@adrian-hackbox:~/work/freebsd/embedded/head/src % cat
../root/src.conf.mips
WITHOUT_KERBEROS=YES
WITHOUT_KERBEROS_SUPPORT=YES
WITHOUT_NIS=YES
WITHOUT_NDIS=YES
WITHOUT_IPX=YES
WITHOUT_ATM=YES
WITHOUT_ICONV=YES
WITHOUT_CLANG_IS_CC=YES
WITHOUT_CASPER=YES
WITHOUT_CAPSICUM=YES
WITHOUT_TESTS=YES

On 15 April 2015 at 12:04, Tijl Coosemans t...@freebsd.org wrote:
 On Wed, 15 Apr 2015 11:29:19 -0700 Adrian Chadd adr...@freebsd.org wrote:
 cc1: warnings being treated as errors
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:
 In function 'iconv_catgets':
 /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599:
 warning: passing argument 2 of 'dl_iconv' from incompatible pointer
 type

 Does embedded mean that WITHOUT_ICONV is defined?
 Can you try the attached patch?
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281572 - stable/10/games/fortune/datfiles

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Thu Apr 16 00:29:49 2015
New Revision: 281572
URL: https://svnweb.freebsd.org/changeset/base/281572

Log:
  MFC: r269089:
Update the freebsd-tips example to use drill instead of dig since bind 
is no longer in base
  
  Approved by:  eadler (mentor, implicit)
  Sponsored by: ScaleEngine Inc.

Modified:
  stable/10/games/fortune/datfiles/freebsd-tips
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/games/fortune/datfiles/freebsd-tips
==
--- stable/10/games/fortune/datfiles/freebsd-tips   Thu Apr 16 00:27:53 
2015(r281571)
+++ stable/10/games/fortune/datfiles/freebsd-tips   Thu Apr 16 00:29:49 
2015(r281572)
@@ -231,10 +231,10 @@ is running FreeBSD at the time) to quick
 To erase a line you've written at the command prompt, use Ctrl-U.
-- Dru gene...@istar.ca
 %
-To find out the hostname associated with an IP address, use
+To find the hostname associated with an IP address, use
 
-   dig -x IP_address
-   -- Dru gene...@istar.ca
+   drill -x IP_address
+   -- Allan Jude allanj...@freebsd.org
 %
 To obtain a neat PostScript rendering of a manual page, use ``-t'' switch
 of the man(1) utility: ``man -t topic''.  For example:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281574 - in stable/10/usr.bin: jot lam rs

2015-04-15 Thread Allan Jude
Author: allanjude (doc committer)
Date: Thu Apr 16 00:34:41 2015
New Revision: 281574
URL: https://svnweb.freebsd.org/changeset/base/281574

Log:
  MFC: r281209:
Fix missing AUTHOR section for jot(1), rs(1), and lam(1)
  
  Approved by:  eadler (mentor, implicit)
  Sponsored by: ScaleEngine Inc.

Modified:
  stable/10/usr.bin/jot/jot.1
  stable/10/usr.bin/lam/lam.1
  stable/10/usr.bin/rs/rs.1
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/jot/jot.1
==
--- stable/10/usr.bin/jot/jot.1 Thu Apr 16 00:31:51 2015(r281573)
+++ stable/10/usr.bin/jot/jot.1 Thu Apr 16 00:34:41 2015(r281574)
@@ -28,7 +28,7 @@
 .\@(#)jot.1   8.1 (Berkeley) 6/6/93
 .\ $FreeBSD$
 .\
-.Dd June 2, 2010
+.Dd April 7, 2015
 .Dt JOT 1
 .Os
 .Sh NAME
@@ -324,3 +324,5 @@ The
 .Nm
 utility first appeared in
 .Bx 4.2 .
+.Sh AUTHORS
+.An John A. Kunze

Modified: stable/10/usr.bin/lam/lam.1
==
--- stable/10/usr.bin/lam/lam.1 Thu Apr 16 00:31:51 2015(r281573)
+++ stable/10/usr.bin/lam/lam.1 Thu Apr 16 00:34:41 2015(r281574)
@@ -28,7 +28,7 @@
 .\@(#)lam.1   8.1 (Berkeley) 6/6/93
 .\ $FreeBSD$
 .\
-.Dd August 12, 2004
+.Dd April 7, 2015
 .Dt LAM 1
 .Os
 .Sh NAME
@@ -136,6 +136,8 @@ The
 .Nm
 utility first appeared in
 .Bx 4.2 .
+.Sh AUTHORS
+.An John A. Kunze
 .Sh BUGS
 The
 .Nm

Modified: stable/10/usr.bin/rs/rs.1
==
--- stable/10/usr.bin/rs/rs.1   Thu Apr 16 00:31:51 2015(r281573)
+++ stable/10/usr.bin/rs/rs.1   Thu Apr 16 00:34:41 2015(r281574)
@@ -28,7 +28,7 @@
 .\@(#)rs.18.2 (Berkeley) 12/30/93
 .\ $FreeBSD$
 .\
-.Dd February 25, 2011
+.Dd April 7, 2015
 .Dt RS 1
 .Os
 .Sh NAME
@@ -222,6 +222,8 @@ The
 .Nm
 utility first appeared in
 .Bx 4.2 .
+.Sh AUTHORS
+.An John A. Kunze
 .Sh BUGS
 .Bl -item
 .It
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281584 - in head/contrib/pjdfstest/tests: open truncate

2015-04-15 Thread Garrett Cooper
Author: ngie
Date: Thu Apr 16 03:35:47 2015
New Revision: 281584
URL: https://svnweb.freebsd.org/changeset/base/281584

Log:
  Fix race when testing for ETXTBSY writing to ${n0} (process image) by making
  sure the process has been started beforehand with pgrep
  
  pkill the process afterwards to make sure it's dead when the unlink is run
  (not strictly required, but I was being conservative)
  
  MFC after: 1 week
  Reviewed by: Darius O'Conner, mjohnston
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/pjdfstest/tests/open/20.t
  head/contrib/pjdfstest/tests/truncate/11.t

Modified: head/contrib/pjdfstest/tests/open/20.t
==
--- head/contrib/pjdfstest/tests/open/20.t  Thu Apr 16 02:44:37 2015
(r281583)
+++ head/contrib/pjdfstest/tests/open/20.t  Thu Apr 16 03:35:47 2015
(r281584)
@@ -14,7 +14,11 @@ n0=`namegen`
 
 cp -pf `which sleep` ${n0}
 ./${n0} 3 
+while ! pkill -0 -f ./${n0}; do
+   sleep 0.1
+done
 expect ETXTBSY open ${n0} O_WRONLY
 expect ETXTBSY open ${n0} O_RDWR
 expect ETXTBSY open ${n0} O_RDONLY,O_TRUNC
+pkill -9 -f ./${n0}
 expect 0 unlink ${n0}

Modified: head/contrib/pjdfstest/tests/truncate/11.t
==
--- head/contrib/pjdfstest/tests/truncate/11.t  Thu Apr 16 02:44:37 2015
(r281583)
+++ head/contrib/pjdfstest/tests/truncate/11.t  Thu Apr 16 03:35:47 2015
(r281584)
@@ -14,5 +14,9 @@ n0=`namegen`
 
 cp -pf `which sleep` ${n0}
 ./${n0} 3 
+while ! pkill -0 -f ./${n0}; do
+   sleep 0.1
+done
 expect ETXTBSY truncate ${n0} 123
+pkill -9 -f ./${n0}
 expect 0 unlink ${n0}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC

2015-04-15 Thread Adrian Chadd
Yes, that patch does the job.


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


svn commit: r281582 - head/usr.bin/lockf

2015-04-15 Thread Bryan Drewery
Author: bdrewery
Date: Thu Apr 16 02:24:40 2015
New Revision: 281582
URL: https://svnweb.freebsd.org/changeset/base/281582

Log:
  Remove extra flags from r250462.
  
  MFC after:1 week

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

Modified: head/usr.bin/lockf/lockf.c
==
--- head/usr.bin/lockf/lockf.c  Thu Apr 16 01:47:05 2015(r281581)
+++ head/usr.bin/lockf/lockf.c  Thu Apr 16 02:24:40 2015(r281582)
@@ -169,7 +169,7 @@ acquire_lock(const char *name, int flags
 {
int fd;
 
-   if ((fd = open(name, flags|O_RDONLY|O_EXLOCK|flags, 0666)) == -1) {
+   if ((fd = open(name, O_RDONLY|O_EXLOCK|flags, 0666)) == -1) {
if (errno == EAGAIN || errno == EINTR)
return (-1);
err(EX_CANTCREAT, cannot open %s, name);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r281131 - head/etc

2015-04-15 Thread Baptiste Daroussin
On Wed, Apr 15, 2015 at 07:33:24AM +0200, Jan Beich wrote:
 Baptiste Daroussin b...@freebsd.org writes:
 
  Log:
Enforce LC_COLLATE=C until we do support proper UTF-8 collation
 [...]
  -   :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\
  +   :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:LC_COLLATE=C:\
 
 Did you mean to append value to :setenv instead of defining
 a separate capability?

Oups fixed, thanks.

Bapt


pgpVEEnT9bI6T.pgp
Description: PGP signature


svn commit: r281545 - stable/10/sys/x86/iommu

2015-04-15 Thread Konstantin Belousov
Author: kib
Date: Wed Apr 15 06:56:51 2015
New Revision: 281545
URL: https://svnweb.freebsd.org/changeset/base/281545

Log:
  MFC r281254:
  Account for the offset of the page run when allocating the
  dmar_map_entry.

Modified:
  stable/10/sys/x86/iommu/busdma_dmar.c
  stable/10/sys/x86/iommu/intel_dmar.h
  stable/10/sys/x86/iommu/intel_gas.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/x86/iommu/busdma_dmar.c
==
--- stable/10/sys/x86/iommu/busdma_dmar.c   Wed Apr 15 05:24:39 2015
(r281544)
+++ stable/10/sys/x86/iommu/busdma_dmar.c   Wed Apr 15 06:56:51 2015
(r281545)
@@ -459,6 +459,7 @@ dmar_bus_dmamap_load_something1(struct b
bus_size_t buflen1;
int error, idx, gas_flags, seg;
 
+   KASSERT(offset  DMAR_PAGE_SIZE, (offset %d, offset));
if (segs == NULL)
segs = tag-segments;
ctx = tag-ctx;
@@ -473,7 +474,6 @@ dmar_bus_dmamap_load_something1(struct b
}
buflen1 = buflen  tag-common.maxsegsz ?
tag-common.maxsegsz : buflen;
-   buflen -= buflen1;
size = round_page(offset + buflen1);
 
/*
@@ -484,7 +484,7 @@ dmar_bus_dmamap_load_something1(struct b
if (seg + 1  tag-common.nsegments)
gas_flags |= DMAR_GM_CANSPLIT;
 
-   error = dmar_gas_map(ctx, tag-common, size,
+   error = dmar_gas_map(ctx, tag-common, size, offset,
DMAR_MAP_ENTRY_READ | DMAR_MAP_ENTRY_WRITE,
gas_flags, ma + idx, entry);
if (error != 0)
@@ -503,6 +503,10 @@ dmar_bus_dmamap_load_something1(struct b
(uintmax_t)size, (uintmax_t)entry-start,
(uintmax_t)entry-end));
}
+   if (offset + buflen1  size)
+   buflen1 = size - offset;
+   if (buflen1  tag-common.maxsegsz)
+   buflen1 = tag-common.maxsegsz;
 
KASSERT(((entry-start + offset)  (tag-common.alignment - 1))
== 0,
@@ -516,15 +520,16 @@ dmar_bus_dmamap_load_something1(struct b
(uintmax_t)entry-start, (uintmax_t)entry-end,
(uintmax_t)tag-common.lowaddr,
(uintmax_t)tag-common.highaddr));
-   KASSERT(dmar_test_boundary(entry-start, entry-end -
-   entry-start, tag-common.boundary),
+   KASSERT(dmar_test_boundary(entry-start + offset, buflen1,
+   tag-common.boundary),
(boundary failed: ctx %p start 0x%jx end 0x%jx 
boundary 0x%jx, ctx, (uintmax_t)entry-start,
(uintmax_t)entry-end, (uintmax_t)tag-common.boundary));
KASSERT(buflen1 = tag-common.maxsegsz,
(segment too large: ctx %p start 0x%jx end 0x%jx 
-   maxsegsz 0x%jx, ctx, (uintmax_t)entry-start,
-   (uintmax_t)entry-end, (uintmax_t)tag-common.maxsegsz));
+   buflen1 0x%jx maxsegsz 0x%jx, ctx,
+   (uintmax_t)entry-start, (uintmax_t)entry-end,
+   (uintmax_t)buflen1, (uintmax_t)tag-common.maxsegsz));
 
DMAR_CTX_LOCK(ctx);
TAILQ_INSERT_TAIL(map-map_entries, entry, dmamap_link);
@@ -538,6 +543,7 @@ dmar_bus_dmamap_load_something1(struct b
idx += OFF_TO_IDX(trunc_page(offset + buflen1));
offset += buflen1;
offset = DMAR_PAGE_MASK;
+   buflen -= buflen1;
}
if (error == 0)
*segp = seg;

Modified: stable/10/sys/x86/iommu/intel_dmar.h
==
--- stable/10/sys/x86/iommu/intel_dmar.hWed Apr 15 05:24:39 2015
(r281544)
+++ stable/10/sys/x86/iommu/intel_dmar.hWed Apr 15 06:56:51 2015
(r281545)
@@ -289,7 +289,7 @@ struct dmar_map_entry *dmar_gas_alloc_en
 void dmar_gas_free_entry(struct dmar_ctx *ctx, struct dmar_map_entry *entry);
 void dmar_gas_free_space(struct dmar_ctx *ctx, struct dmar_map_entry *entry);
 int dmar_gas_map(struct dmar_ctx *ctx, const struct bus_dma_tag_common *common,
-dmar_gaddr_t size, u_int eflags, u_int flags, vm_page_t *ma,
+dmar_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma,
 struct dmar_map_entry **res);
 void dmar_gas_free_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry);
 int dmar_gas_map_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry,

Modified: stable/10/sys/x86/iommu/intel_gas.c
==
--- stable/10/sys/x86/iommu/intel_gas.c Wed Apr 15 05:24:39 2015
(r281544)
+++ stable/10/sys/x86/iommu/intel_gas.c Wed Apr 15 06:56:51 

svn commit: r281546 - head/etc

2015-04-15 Thread Baptiste Daroussin
Author: bapt
Date: Wed Apr 15 06:57:47 2015
New Revision: 281546
URL: https://svnweb.freebsd.org/changeset/base/281546

Log:
  Correctly set LC_COLLATE into setenv
  
  Submitted by: jbeich

Modified:
  head/etc/login.conf

Modified: head/etc/login.conf
==
--- head/etc/login.conf Wed Apr 15 06:56:51 2015(r281545)
+++ head/etc/login.conf Wed Apr 15 06:57:47 2015(r281546)
@@ -26,7 +26,7 @@ default:\
:passwd_format=sha512:\
:copyright=/etc/COPYRIGHT:\
:welcome=/etc/motd:\
-   :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:LC_COLLATE=C:\
+   :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,LC_COLLATE=C:\
:path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin 
~/bin:\
:nologin=/var/run/nologin:\
:cputime=unlimited:\
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281547 - stable/10/sys/i386/include

2015-04-15 Thread Konstantin Belousov
Author: kib
Date: Wed Apr 15 06:59:53 2015
New Revision: 281547
URL: https://svnweb.freebsd.org/changeset/base/281547

Log:
  MFC r281272:
  Explain that vm_page_array is mapped to describe the memory, not the
  memory itself.  Provide the formula to calculate the number of
  required page tables.  Correct the size of the struct vm_page for
  non-PAE case.

Modified:
  stable/10/sys/i386/include/pmap.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/i386/include/pmap.h
==
--- stable/10/sys/i386/include/pmap.h   Wed Apr 15 06:57:47 2015
(r281546)
+++ stable/10/sys/i386/include/pmap.h   Wed Apr 15 06:59:53 2015
(r281547)
@@ -122,13 +122,18 @@
  */
 #define VADDR(pdi, pti) ((vm_offset_t)(((pdi)PDRSHIFT)|((pti)PAGE_SHIFT)))
 
-/* Initial number of kernel page tables. */
+/*
+ * The initial number of kernel page table pages that are constructed
+ * by locore must be sufficient to map vm_page_array.  That number can
+ * be calculated as follows:
+ * max_phys / PAGE_SIZE * sizeof(struct vm_page) / NBPDR
+ * PAE:  max_phys 16G, sizeof(vm_page) 76, NBPDR 2M, 152 page table pages.
+ * Non-PAE:  max_phys 4G,  sizeof(vm_page) 68, NBPDR 4M, 18 page table pages.
+ */
 #ifndef NKPT
 #ifdef PAE
-/* 152 page tables needed to map 16G (76B struct vm_page, 2M page tables). */
 #defineNKPT240
 #else
-/* 18 page tables needed to map 4G (72B struct vm_page, 4M page tables). */
 #defineNKPT30
 #endif
 #endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281548 - in head/sys: kern sys

2015-04-15 Thread Konstantin Belousov
Author: kib
Date: Wed Apr 15 08:13:53 2015
New Revision: 281548
URL: https://svnweb.freebsd.org/changeset/base/281548

Log:
  Implement support for binary to requesting specific stack size for the
  initial thread.  It is read by the ELF image activator as the virtual
  size of the PT_GNU_STACK program header entry, and can be specified by
  the linker option -z stack-size in newer binutils.
  
  The soft RLIMIT_STACK is auto-increased if possible, to satisfy the
  binary' request.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_resource.c
  head/sys/sys/imgact.h

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Wed Apr 15 06:59:53 2015(r281547)
+++ head/sys/kern/imgact_elf.c  Wed Apr 15 08:13:53 2015(r281548)
@@ -782,6 +782,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i
if (__elfN(nxstack))
imgp-stack_prot =
__elfN(trans_prot)(phdr[i].p_flags);
+   imgp-stack_sz = phdr[i].p_memsz;
break;
}
}

Modified: head/sys/kern/kern_exec.c
==
--- head/sys/kern/kern_exec.c   Wed Apr 15 06:59:53 2015(r281547)
+++ head/sys/kern/kern_exec.c   Wed Apr 15 08:13:53 2015(r281548)
@@ -1009,6 +1009,7 @@ exec_new_vmspace(imgp, sv)
struct proc *p = imgp-proc;
struct vmspace *vmspace = p-p_vmspace;
vm_object_t obj;
+   struct rlimit rlim_stack;
vm_offset_t sv_minuser, stack_addr;
vm_map_t map;
u_long ssiz;
@@ -1058,10 +1059,22 @@ exec_new_vmspace(imgp, sv)
}
 
/* Allocate a new stack */
-   if (sv-sv_maxssiz != NULL)
+   if (imgp-stack_sz != 0) {
+   ssiz = imgp-stack_sz;
+   PROC_LOCK(p);
+   lim_rlimit(p, RLIMIT_STACK, rlim_stack);
+   PROC_UNLOCK(p);
+   if (ssiz  rlim_stack.rlim_max)
+   ssiz = rlim_stack.rlim_max;
+   if (ssiz  rlim_stack.rlim_cur) {
+   rlim_stack.rlim_cur = ssiz;
+   kern_setrlimit(curthread, RLIMIT_STACK, rlim_stack);
+   }
+   } else if (sv-sv_maxssiz != NULL) {
ssiz = *sv-sv_maxssiz;
-   else
+   } else {
ssiz = maxssiz;
+   }
stack_addr = sv-sv_usrstack - ssiz;
error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz,
obj != NULL  imgp-stack_prot != 0 ? imgp-stack_prot :

Modified: head/sys/kern/kern_resource.c
==
--- head/sys/kern/kern_resource.c   Wed Apr 15 06:59:53 2015
(r281547)
+++ head/sys/kern/kern_resource.c   Wed Apr 15 08:13:53 2015
(r281548)
@@ -745,7 +745,12 @@ kern_proc_setrlimit(struct thread *td, s
if (newlim != NULL)
lim_free(oldlim);
 
-   if (which == RLIMIT_STACK) {
+   if (which == RLIMIT_STACK 
+   /*
+* Skip calls from exec_new_vmspace(), done when stack is
+* not mapped yet.
+*/
+   (td != curthread || (p-p_flag  P_INEXEC) == 0)) {
/*
 * Stack is allocated to the max at exec time with only
 * rlim_cur bytes accessible.  If stack limit is going

Modified: head/sys/sys/imgact.h
==
--- head/sys/sys/imgact.h   Wed Apr 15 06:59:53 2015(r281547)
+++ head/sys/sys/imgact.h   Wed Apr 15 08:13:53 2015(r281548)
@@ -80,6 +80,7 @@ struct image_params {
unsigned long pagesizes;
int pagesizeslen;
vm_prot_t stack_prot;
+   u_long stack_sz;
 };
 
 #ifdef _KERNEL
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DECH...

2015-04-15 Thread Tijl Coosemans
Author: tijl
Date: Wed Apr 15 09:09:20 2015
New Revision: 281550
URL: https://svnweb.freebsd.org/changeset/base/281550

Log:
  Remove the const qualifier from iconv(3) to comply with POSIX:
  http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html
  
  Adjust all code that calls iconv.
  
  PR:   199099
  Exp-run by:   antoine
  MFC after:2 weeks

Modified:
  head/UPDATING
  head/bin/csh/config.h
  head/contrib/smbfs/include/netsmb/smb_lib.h
  head/contrib/smbfs/lib/smb/nls.c
  head/contrib/smbfs/lib/smb/print.c
  head/contrib/smbfs/lib/smb/rq.c
  head/include/iconv.h
  head/lib/libarchive/Makefile
  head/lib/libc/iconv/__iconv.c
  head/lib/libc/iconv/bsd_iconv.c
  head/lib/libc/iconv/citrus_iconv.h
  head/lib/libc/iconv/citrus_iconv_local.h
  head/lib/libc/iconv/citrus_none.c
  head/lib/libc/iconv/citrus_stdenc.h
  head/lib/libc/iconv/citrus_stdenc_local.h
  head/lib/libc/iconv/citrus_stdenc_template.h
  head/lib/libc/iconv/iconv-internal.h
  head/lib/libc/iconv/iconv.3
  head/lib/libc/iconv/iconv.c
  head/lib/libc/iconv/iconv_compat.c
  head/lib/libc/locale/cXXrtomb_iconv.h
  head/lib/libc/locale/mbrtocXX_iconv.h
  head/lib/libiconv_modules/BIG5/citrus_big5.c
  head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
  head/lib/libiconv_modules/EUC/citrus_euc.c
  head/lib/libiconv_modules/EUCTW/citrus_euctw.c
  head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c
  head/lib/libiconv_modules/HZ/citrus_hz.c
  head/lib/libiconv_modules/ISO2022/citrus_iso2022.c
  head/lib/libiconv_modules/JOHAB/citrus_johab.c
  head/lib/libiconv_modules/MSKanji/citrus_mskanji.c
  head/lib/libiconv_modules/UES/citrus_ues.c
  head/lib/libiconv_modules/UTF1632/citrus_utf1632.c
  head/lib/libiconv_modules/UTF7/citrus_utf7.c
  head/lib/libiconv_modules/UTF8/citrus_utf8.c
  head/lib/libiconv_modules/VIQR/citrus_viqr.c
  head/lib/libiconv_modules/ZW/citrus_zw.c
  head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c
  head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
  head/lib/libkiconv/xlat16_iconv.c
  head/sys/sys/param.h
  head/usr.bin/iconv/iconv.c

Modified: head/UPDATING
==
--- head/UPDATING   Wed Apr 15 08:16:34 2015(r281549)
+++ head/UPDATING   Wed Apr 15 09:09:20 2015(r281550)
@@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
ln -s 'abort:false,junk:false' /etc/malloc.conf.)
 
+20150415:
+   The const qualifier has been removed from iconv(3) to comply with
+   POSIX.  The ports tree is aware of this from r384038 onwards.
+
 20150324:
From legacy ata(4) driver was removed support for SATA controllers
supported by more functional drivers ahci(4), siis(4) and mvs(4).

Modified: head/bin/csh/config.h
==
--- head/bin/csh/config.h   Wed Apr 15 08:16:34 2015(r281549)
+++ head/bin/csh/config.h   Wed Apr 15 09:09:20 2015(r281550)
@@ -198,7 +198,7 @@
 #define HAVE_WCWIDTH 1
 
 /* Define as const if the declaration of iconv() needs const. */
-#define ICONV_CONST const
+#define ICONV_CONST
 
 /* Support NLS. */
 #define NLS 1

Modified: head/contrib/smbfs/include/netsmb/smb_lib.h
==
--- head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 08:16:34 2015
(r281549)
+++ head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 09:09:20 2015
(r281550)
@@ -191,7 +191,7 @@ int  smb_ctx_readrc(struct smb_ctx *);
 int  smb_ctx_resolve(struct smb_ctx *);
 int  smb_ctx_setflags(struct smb_ctx *, int, int, int);
 
-int  smb_smb_open_print_file(struct smb_ctx *, int, int, const char *, smbfh*);
+int  smb_smb_open_print_file(struct smb_ctx *, int, int, char *, smbfh*);
 int  smb_smb_close_print_file(struct smb_ctx *, smbfh);
 
 int  smb_read(struct smb_ctx *, smbfh, off_t, size_t, char *);
@@ -204,8 +204,8 @@ int  smb_rq_init(struct smb_ctx *, u_cha
 void smb_rq_done(struct smb_rq *);
 void smb_rq_wend(struct smb_rq *);
 int  smb_rq_simple(struct smb_rq *);
-int  smb_rq_dmem(struct mbdata *, const char *, size_t);
-int  smb_rq_dstring(struct mbdata *, const char *);
+int  smb_rq_dmem(struct mbdata *, char *, size_t);
+int  smb_rq_dstring(struct mbdata *, char *);
 
 int  smb_t2_request(struct smb_ctx *, int, int, const char *,
int, void *, int, void *, int *, void *, int *, void *);
@@ -246,10 +246,10 @@ extern u_char nls_lower[256], nls_upper[
 
 int   nls_setrecode(const char *, const char *);
 int   nls_setlocale(const char *);
-char* nls_str_toext(char *, const char *);
-char* nls_str_toloc(char *, const char *);
-void* nls_mem_toext(void *, const void *, int);
-void* nls_mem_toloc(void *, const void *, int);
+char* nls_str_toext(char *, char *);
+char* nls_str_toloc(char *, char *);
+void* nls_mem_toext(void *, void *, int

svn commit: r281551 - in head/sys: compat/freebsd32 compat/linprocfs kern sys

2015-04-15 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Apr 15 09:13:11 2015
New Revision: 281551
URL: https://svnweb.freebsd.org/changeset/base/281551

Log:
  Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). This
  adds missing jail and MAC checks.
  
  Differential Revision:https://reviews.freebsd.org/D2193
  Reviewed by:  kib@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/linprocfs/linprocfs.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/syscallsubr.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Wed Apr 15 09:09:20 2015
(r281550)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Wed Apr 15 09:13:11 2015
(r281551)
@@ -253,9 +253,8 @@ freebsd4_freebsd32_getfsstat(struct thre
 
count = uap-bufsize / sizeof(struct statfs32);
size = count * sizeof(struct statfs);
-   error = kern_getfsstat(td, buf, size, UIO_SYSSPACE, uap-flags);
+   error = kern_getfsstat(td, buf, size, count, UIO_SYSSPACE, 
uap-flags);
if (size  0) {
-   count = td-td_retval[0];
sp = buf;
while (count  0  error == 0) {
copy_statfs(sp, stat32);
@@ -266,6 +265,8 @@ freebsd4_freebsd32_getfsstat(struct thre
}
free(buf, M_TEMP);
}
+   if (error == 0)
+   td-td_retval[0] = count;
return (error);
 }
 #endif

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Wed Apr 15 09:09:20 2015
(r281550)
+++ head/sys/compat/linprocfs/linprocfs.c   Wed Apr 15 09:13:11 2015
(r281551)
@@ -53,10 +53,10 @@ __FBSDID($FreeBSD$);
 #include sys/filedesc.h
 #include sys/jail.h
 #include sys/kernel.h
+#include sys/limits.h
 #include sys/linker.h
 #include sys/lock.h
 #include sys/malloc.h
-#include sys/mount.h
 #include sys/msg.h
 #include sys/mutex.h
 #include sys/namei.h
@@ -67,6 +67,7 @@ __FBSDID($FreeBSD$);
 #include sys/sem.h
 #include sys/smp.h
 #include sys/socket.h
+#include sys/syscallsubr.h
 #include sys/sysctl.h
 #include sys/systm.h
 #include sys/time.h
@@ -326,11 +327,12 @@ static int
 linprocfs_domtab(PFS_FILL_ARGS)
 {
struct nameidata nd;
-   struct mount *mp;
const char *lep;
char *dlep, *flep, *mntto, *mntfrom, *fstype;
size_t lep_len;
int error;
+   struct statfs *buf, *sp;
+   size_t count;
 
/* resolve symlinks etc. in the emulation tree prefix */
NDINIT(nd, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path, td);
@@ -344,20 +346,26 @@ linprocfs_domtab(PFS_FILL_ARGS)
}
lep_len = strlen(lep);
 
-   mtx_lock(mountlist_mtx);
-   error = 0;
-   TAILQ_FOREACH(mp, mountlist, mnt_list) {
+   buf = NULL;
+   error = kern_getfsstat(td, buf, SIZE_T_MAX, count,
+   UIO_SYSSPACE, MNT_WAIT);
+   if (error != 0) {
+   free(buf, M_TEMP);
+   free(flep, M_TEMP);
+   return (error);
+   }
+
+   for (sp = buf; count  0; sp++, count--) {
/* determine device name */
-   mntfrom = mp-mnt_stat.f_mntfromname;
+   mntfrom = sp-f_mntfromname;
 
/* determine mount point */
-   mntto = mp-mnt_stat.f_mntonname;
-   if (strncmp(mntto, lep, lep_len) == 0 
-   mntto[lep_len] == '/')
+   mntto = sp-f_mntonname;
+   if (strncmp(mntto, lep, lep_len) == 0  mntto[lep_len] == '/')
mntto += lep_len;
 
/* determine fs type */
-   fstype = mp-mnt_stat.f_fstypename;
+   fstype = sp-f_fstypename;
if (strcmp(fstype, pn-pn_info-pi_name) == 0)
mntfrom = fstype = proc;
else if (strcmp(fstype, procfs) == 0)
@@ -365,16 +373,16 @@ linprocfs_domtab(PFS_FILL_ARGS)
 
if (strcmp(fstype, linsysfs) == 0) {
sbuf_printf(sb, /sys %s sysfs %s, mntto,
-   mp-mnt_stat.f_flags  MNT_RDONLY ? ro : rw);
+   sp-f_flags  MNT_RDONLY ? ro : rw);
} else {
/* For Linux msdosfs is called vfat */
if (strcmp(fstype, msdosfs) == 0)
fstype = vfat;
sbuf_printf(sb, %s %s %s %s, mntfrom, mntto, fstype,
-   mp-mnt_stat.f_flags  MNT_RDONLY ? ro : rw);
+   sp-f_flags  MNT_RDONLY ? ro : rw);
}
 #define ADD_OPTION(opt, name) \
-   if (mp-mnt_stat.f_flags  (opt)) sbuf_printf(sb, , name);
+   if (sp-f_flags  (opt)) sbuf_printf(sb, , name);

svn commit: r281549 - head/libexec/rtld-elf

2015-04-15 Thread Konstantin Belousov
Author: kib
Date: Wed Apr 15 08:16:34 2015
New Revision: 281549
URL: https://svnweb.freebsd.org/changeset/base/281549

Log:
  Implement support -z global linker option.  It marks the shared object
  as always participating in the global symbols namespace, regardless of
  the way the object was brought into the process address space.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cWed Apr 15 08:13:53 2015
(r281548)
+++ head/libexec/rtld-elf/rtld.cWed Apr 15 08:16:34 2015
(r281549)
@@ -1158,8 +1158,8 @@ digest_dynamic1(Obj_Entry *obj, int earl
obj-z_noopen = true;
if ((dynp-d_un.d_val  DF_1_ORIGIN)  trust)
obj-z_origin = true;
-   /*if (dynp-d_un.d_val  DF_1_GLOBAL)
-   XXX ;*/
+   if (dynp-d_un.d_val  DF_1_GLOBAL)
+   obj-z_global = true;
if (dynp-d_un.d_val  DF_1_BIND_NOW)
obj-bind_now = true;
if (dynp-d_un.d_val  DF_1_NODELETE)
@@ -1790,22 +1790,35 @@ init_dag(Obj_Entry *root)
 }
 
 static void
-process_nodelete(Obj_Entry *root)
+process_z(Obj_Entry *root)
 {
const Objlist_Entry *elm;
+   Obj_Entry *obj;
 
/*
-* Walk over object DAG and process every dependent object that
-* is marked as DF_1_NODELETE. They need to grow their own DAG,
-* which then should have its reference upped separately.
+* Walk over object DAG and process every dependent object
+* that is marked as DF_1_NODELETE or DF_1_GLOBAL. They need
+* to grow their own DAG.
+*
+* For DF_1_GLOBAL, DAG is required for symbol lookups in
+* symlook_global() to work.
+*
+* For DF_1_NODELETE, the DAG should have its reference upped.
 */
STAILQ_FOREACH(elm, root-dagmembers, link) {
-   if (elm-obj != NULL  elm-obj-z_nodelete 
-   !elm-obj-ref_nodel) {
-   dbg(obj %s nodelete, elm-obj-path);
-   init_dag(elm-obj);
-   ref_dag(elm-obj);
-   elm-obj-ref_nodel = true;
+   obj = elm-obj;
+   if (obj == NULL)
+   continue;
+   if (obj-z_nodelete  !obj-ref_nodel) {
+   dbg(obj %s -z nodelete, obj-path);
+   init_dag(obj);
+   ref_dag(obj);
+   obj-ref_nodel = true;
+   }
+   if (obj-z_global  objlist_find(list_global, obj) == NULL) {
+   dbg(obj %s -z global, obj-path);
+   objlist_push_tail(list_global, obj);
+   init_dag(obj);
}
}
 }
@@ -3044,13 +3057,13 @@ dlopen_object(const char *name, int fd, 
initlist_add_objects(obj, obj-next, initlist);
}
/*
-* Process all no_delete objects here, given them own
-* DAGs to prevent their dependencies from being unloaded.
-* This has to be done after we have loaded all of the
-* dependencies, so that we do not miss any.
+* Process all no_delete or global objects here, given
+* them own DAGs to prevent their dependencies from being
+* unloaded.  This has to be done after we have loaded all
+* of the dependencies, so that we do not miss any.
 */
if (obj != NULL)
-   process_nodelete(obj);
+   process_z(obj);
} else {
/*
 * Bump the reference counts for objects on this DAG.  If

Modified: head/libexec/rtld-elf/rtld.h
==
--- head/libexec/rtld-elf/rtld.hWed Apr 15 08:13:53 2015
(r281548)
+++ head/libexec/rtld-elf/rtld.hWed Apr 15 08:16:34 2015
(r281549)
@@ -264,6 +264,7 @@ typedef struct Struct_Obj_Entry {
 bool z_loadfltr : 1;   /* Immediately load filtees */
 bool z_interpose : 1;  /* Interpose all objects but main */
 bool z_nodeflib : 1;   /* Don't search default library path */
+bool z_global : 1; /* Make the object global */
 bool ref_nodel : 1;/* Refcount increased to prevent 
dlclose */
 bool init_scanned: 1;  /* Object is already on init list. */
 bool on_fini_list: 1;  /* Object is already on fini list. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r281552 - head/sys/sys

2015-04-15 Thread Tijl Coosemans
Author: tijl
Date: Wed Apr 15 09:39:52 2015
New Revision: 281552
URL: https://svnweb.freebsd.org/changeset/base/281552

Log:
  Point to the right location where __FreeBSD_version numbers are documented.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed Apr 15 09:13:11 2015(r281551)
+++ head/sys/sys/param.hWed Apr 15 09:39:52 2015(r281552)
@@ -50,7 +50,7 @@
  * there.
  * Currently this lives here in the doc/ repository:
  *
- * head/en_US.ISO8859-1/books/porters-handbook/book.xml
+ * head/en_US.ISO8859-1/books/porters-handbook/versions/chapter.xml
  *
  * scheme is:  majortwo digit minorRxx
  * 'R' is in the range 0 to 4 if this is a release branch or
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org