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

2013-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Feb 13 08:20:29 2013
New Revision: 246752
URL: http://svnweb.freebsd.org/changeset/base/246752

Log:
  Add specific supported revision of D-Link DWA-140 rev B1, B2.
  
  Submitted by: PseudoCylon
  MFC after:1 week

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

Modified: head/share/man/man4/run.4
==
--- head/share/man/man4/run.4   Wed Feb 13 07:32:09 2013(r246751)
+++ head/share/man/man4/run.4   Wed Feb 13 08:20:29 2013(r246752)
@@ -129,7 +129,7 @@ driver supports the following wireless a
 .It Corega CG-WLUSB300AGN
 .It Corega CG-WLUSB300GNM
 .It D-Link DWA-130 rev B1
-.It D-Link DWA-140
+.It D-Link DWA-140 rev B1, B2
 .It DrayTek Vigor N61
 .It Edimax EW-7711UAn
 .It Edimax EW-7711UTn
___
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: r246753 - in head/sys/dev/usb: . serial

2013-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Feb 13 08:28:27 2013
New Revision: 246753
URL: http://svnweb.freebsd.org/changeset/base/246753

Log:
  Add new USB ID to FTDI driver.
  
  MFC after:1 week
  PR:   kern/175893
  Submitted by: Tomek

Modified:
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/uftdi.c
==
--- head/sys/dev/usb/serial/uftdi.c Wed Feb 13 08:20:29 2013
(r246752)
+++ head/sys/dev/usb/serial/uftdi.c Wed Feb 13 08:28:27 2013
(r246753)
@@ -378,6 +378,7 @@ static const STRUCT_USB_HOST_ID uftdi_de
UFTDI_DEV(FTDI, IPLUS2, UFTDI_TYPE_AUTO),
UFTDI_DEV(FTDI, IRTRANS, UFTDI_TYPE_AUTO),
UFTDI_DEV(FTDI, KBS, UFTDI_TYPE_8U232AM),
+   UFTDI_DEV(FTDI, KTLINK, UFTDI_TYPE_8U232AM),
UFTDI_DEV(FTDI, LENZ_LIUSB, UFTDI_TYPE_AUTO),
UFTDI_DEV(FTDI, LK202, UFTDI_TYPE_8U232AM),
UFTDI_DEV(FTDI, LK204, UFTDI_TYPE_8U232AM),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsWed Feb 13 08:20:29 2013(r246752)
+++ head/sys/dev/usb/usbdevsWed Feb 13 08:28:27 2013(r246753)
@@ -1717,6 +1717,7 @@ product FTDI 232H 0x6014  FTDI compatibl
 product FTDI SERIAL_2232D  0x9e90  FT2232D Dual port Serial
 product FTDI SERIAL_4232H  0x6011  FT4232H Quad port Serial
 product FTDI BEAGLEBONE0xa6d0  BeagleBone
+product FTDI KTLINK0xbbe2  KT-LINK Embedded Hackers Multitool
 product FTDI TURTELIZER2   0xbdc8  egnite Turtelizer 2 JTAG/RS232 Adapter
 /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */
 product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi
___
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: r246706 - head/lib/libc/arm/aeabi

2013-02-13 Thread Andrew Turner
On Tue, 12 Feb 2013 08:32:23 -0600
Nathan Whitehorn  wrote:

> A related question to these commits: are EABI binaries incompatible
> with systems built for OABI? And vice versa? If so, should we mint a
> new MACHINE_ARCH for ARM EABI (or OABI, I guess)? The usual
> implication of sharing a uname -p string is that systems can run each
> other's binaries -- that being broken is a strong argument for a new
> value. -Nathan

Yes OABI and EABI are binary incompatible. The plan is to kill off OABI
at some stage in the future when EABI is ready. At some time in the
future I plan on flipping the switch to make EABI the default but keep
OABI around to allow people a chance to update.

I am relying on ARM being a Tier 2 platform to change the ABI such that
we break backward compatibility without changing uname -p. I have the
start of a compat layer in the EABI project branch however never
finished it. If people are interested in updating this compatibility
layer I can point them at the code.

The other point is backwards compatibility should only be an issue for
ARMv4 and ARMv5 as these are the only cores we have support for on the
any of the current release branches. ARMv6 and ARMv7 is added to 10 and
there has not been an MFC to any of the stable branches. Because of
this I have even less hesitation to stitch the ABI for
TARGET_ARCH=armv6.

In summary my plan is:
< 9: No change
>= 10: Switch to EABI and remove or depricate OABI

Andrew
___
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: r246757 - stable/9/sys/kern

2013-02-13 Thread Sergey Kandaurov
Author: pluknet
Date: Wed Feb 13 10:16:58 2013
New Revision: 246757
URL: http://svnweb.freebsd.org/changeset/base/246757

Log:
  MFC r246412:
Prezero the acl structure which is to be copied to usermode, to avoid
leakage of the previous content of padding and unitialized fields.

Modified:
  stable/9/sys/kern/vfs_acl.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/vfs_acl.c
==
--- stable/9/sys/kern/vfs_acl.c Wed Feb 13 09:20:55 2013(r246756)
+++ stable/9/sys/kern/vfs_acl.c Wed Feb 13 10:16:58 2013(r246757)
@@ -247,7 +247,7 @@ vacl_get_acl(struct thread *td, struct v
struct acl *inkernelacl;
int error;
 
-   inkernelacl = acl_alloc(M_WAITOK);
+   inkernelacl = acl_alloc(M_WAITOK | M_ZERO);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 #ifdef MAC
error = mac_vnode_check_getacl(td->td_ucred, vp, type);
___
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: r246758 - stable/8/sys/kern

2013-02-13 Thread Sergey Kandaurov
Author: pluknet
Date: Wed Feb 13 10:18:26 2013
New Revision: 246758
URL: http://svnweb.freebsd.org/changeset/base/246758

Log:
  MFC r246412:
Prezero the acl structure which is to be copied to usermode, to avoid
leakage of the previous content of padding and unitialized fields.

Modified:
  stable/8/sys/kern/vfs_acl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/vfs_acl.c
==
--- stable/8/sys/kern/vfs_acl.c Wed Feb 13 10:16:58 2013(r246757)
+++ stable/8/sys/kern/vfs_acl.c Wed Feb 13 10:18:26 2013(r246758)
@@ -246,7 +246,7 @@ vacl_get_acl(struct thread *td, struct v
struct acl *inkernelacl;
int error;
 
-   inkernelacl = acl_alloc(M_WAITOK);
+   inkernelacl = acl_alloc(M_WAITOK | M_ZERO);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 #ifdef MAC
error = mac_vnode_check_getacl(td->td_ucred, vp, type);
___
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: r246759 - in head/sys: dev/usb dev/usb/controller sys

2013-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Feb 13 12:35:17 2013
New Revision: 246759
URL: http://svnweb.freebsd.org/changeset/base/246759

Log:
  Resolve a LOR after r246616. Protect control requests using the USB device
  enumeration lock. Make sure all callers of usbd_enum_lock() check the return
  value. Remove the control transfer specific lock. Bump the FreeBSD version
  number, hence external USB modules may need to be recompiled due to a USB
  device structure change.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_dev.h
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_handle_request.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_request.c
  head/sys/sys/param.h

Modified: head/sys/dev/usb/controller/usb_controller.c
==
--- head/sys/dev/usb/controller/usb_controller.cWed Feb 13 10:18:26 
2013(r246758)
+++ head/sys/dev/usb/controller/usb_controller.cWed Feb 13 12:35:17 
2013(r246759)
@@ -427,6 +427,7 @@ usb_bus_suspend(struct usb_proc_msg *pm)
struct usb_bus *bus;
struct usb_device *udev;
usb_error_t err;
+   uint8_t do_unlock;
 
bus = ((struct usb_bus_msg *)pm)->bus;
udev = bus->devices[USB_ROOT_HUB_ADDR];
@@ -447,7 +448,7 @@ usb_bus_suspend(struct usb_proc_msg *pm)
 
bus_generic_shutdown(bus->bdev);
 
-   usbd_enum_lock(udev);
+   do_unlock = usbd_enum_lock(udev);
 
err = usbd_set_config_index(udev, USB_UNCONFIG_INDEX);
if (err)
@@ -464,7 +465,8 @@ usb_bus_suspend(struct usb_proc_msg *pm)
if (bus->methods->set_hw_power_sleep != NULL)
(bus->methods->set_hw_power_sleep) (bus, USB_HW_POWER_SUSPEND);
 
-   usbd_enum_unlock(udev);
+   if (do_unlock)
+   usbd_enum_unlock(udev);
 
USB_BUS_LOCK(bus);
 }
@@ -480,6 +482,7 @@ usb_bus_resume(struct usb_proc_msg *pm)
struct usb_bus *bus;
struct usb_device *udev;
usb_error_t err;
+   uint8_t do_unlock;
 
bus = ((struct usb_bus_msg *)pm)->bus;
udev = bus->devices[USB_ROOT_HUB_ADDR];
@@ -489,7 +492,7 @@ usb_bus_resume(struct usb_proc_msg *pm)
 
USB_BUS_UNLOCK(bus);
 
-   usbd_enum_lock(udev);
+   do_unlock = usbd_enum_lock(udev);
 #if 0
DEVMETHOD(usb_take_controller, NULL);   /* dummy */
 #endif
@@ -523,7 +526,8 @@ usb_bus_resume(struct usb_proc_msg *pm)
"attach root HUB\n");
}
 
-   usbd_enum_unlock(udev);
+   if (do_unlock)
+   usbd_enum_unlock(udev);
 
USB_BUS_LOCK(bus);
 }
@@ -539,6 +543,7 @@ usb_bus_shutdown(struct usb_proc_msg *pm
struct usb_bus *bus;
struct usb_device *udev;
usb_error_t err;
+   uint8_t do_unlock;
 
bus = ((struct usb_bus_msg *)pm)->bus;
udev = bus->devices[USB_ROOT_HUB_ADDR];
@@ -550,7 +555,7 @@ usb_bus_shutdown(struct usb_proc_msg *pm
 
bus_generic_shutdown(bus->bdev);
 
-   usbd_enum_lock(udev);
+   do_unlock = usbd_enum_lock(udev);
 
err = usbd_set_config_index(udev, USB_UNCONFIG_INDEX);
if (err)
@@ -567,7 +572,8 @@ usb_bus_shutdown(struct usb_proc_msg *pm
if (bus->methods->set_hw_power_sleep != NULL)
(bus->methods->set_hw_power_sleep) (bus, USB_HW_POWER_SHUTDOWN);
 
-   usbd_enum_unlock(udev);
+   if (do_unlock)
+   usbd_enum_unlock(udev);
 
USB_BUS_LOCK(bus);
 }

Modified: head/sys/dev/usb/usb_dev.c
==
--- head/sys/dev/usb/usb_dev.c  Wed Feb 13 10:18:26 2013(r246758)
+++ head/sys/dev/usb/usb_dev.c  Wed Feb 13 12:35:17 2013(r246759)
@@ -218,10 +218,10 @@ usb_ref_device(struct usb_cdev_privdata 
mtx_unlock(&usb_ref_lock);
 
/*
-* We need to grab the sx-lock before grabbing the
-* FIFO refs to avoid deadlock at detach!
+* We need to grab the enumeration SX-lock before
+* grabbing the FIFO refs to avoid deadlock at detach!
 */
-   usbd_enum_lock(cpd->udev);
+   crd->do_unlock = usbd_enum_lock(cpd->udev);
 
mtx_lock(&usb_ref_lock);
 
@@ -282,9 +282,10 @@ usb_ref_device(struct usb_cdev_privdata 
return (0);
 
 error:
-   if (crd->is_uref) {
+   if (crd->do_unlock)
usbd_enum_unlock(cpd->udev);
 
+   if (crd->is_uref) {
if (--(cpd->udev->refcount) == 0) {
cv_signal(&cpd->udev->ref_cv);
}
@@ -336,7 +337,7 @@ usb_unref_device(struct usb_cdev_privdat
 
DPRINTFN(2, "cpd=%p is_uref=%d\n", cpd, crd->is_uref);
 
-   if (crd->is_uref)
+   if (crd->do_unlock)
usbd_enum_unlock(cpd->udev);
 
   

Re: svn commit: r246706 - head/lib/libc/arm/aeabi

2013-02-13 Thread Nathan Whitehorn
On 02/13/13 03:25, Andrew Turner wrote:
> On Tue, 12 Feb 2013 08:32:23 -0600
> Nathan Whitehorn  wrote:
> 
>> A related question to these commits: are EABI binaries incompatible
>> with systems built for OABI? And vice versa? If so, should we mint a
>> new MACHINE_ARCH for ARM EABI (or OABI, I guess)? The usual
>> implication of sharing a uname -p string is that systems can run each
>> other's binaries -- that being broken is a strong argument for a new
>> value. -Nathan
> 
> Yes OABI and EABI are binary incompatible. The plan is to kill off OABI
> at some stage in the future when EABI is ready. At some time in the
> future I plan on flipping the switch to make EABI the default but keep
> OABI around to allow people a chance to update.
> 
> I am relying on ARM being a Tier 2 platform to change the ABI such that
> we break backward compatibility without changing uname -p. I have the
> start of a compat layer in the EABI project branch however never
> finished it. If people are interested in updating this compatibility
> layer I can point them at the code.
> 
> The other point is backwards compatibility should only be an issue for
> ARMv4 and ARMv5 as these are the only cores we have support for on the
> any of the current release branches. ARMv6 and ARMv7 is added to 10 and
> there has not been an MFC to any of the stable branches. Because of
> this I have even less hesitation to stitch the ABI for
> TARGET_ARCH=armv6.
> 
> In summary my plan is:
> < 9: No change
>> = 10: Switch to EABI and remove or depricate OABI
> 
> Andrew
> 

That all makes sense. Thanks for the explanation! If OABI were staying
around indefinitely, I think there would be a point to having a new
uname but not if it will be deprecated soon.
-Nathan
___
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: r246760 - stable/9/sys/x86/x86

2013-02-13 Thread Konstantin Belousov
Author: kib
Date: Wed Feb 13 13:55:54 2013
New Revision: 246760
URL: http://svnweb.freebsd.org/changeset/base/246760

Log:
  MFC r246116:
  Reduce default shift used to calculate the max frequency for the TSC
  timecounter to 1, and correspondingly increase the precision of the
  gettimeofday(2) and related functions in the default configuration.
  
  MFC r246212:
  Remove the (shift > 0) condition when selecting the get_timecount()
  implementation.

Modified:
  stable/9/sys/x86/x86/tsc.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/x86/x86/tsc.c
==
--- stable/9/sys/x86/x86/tsc.c  Wed Feb 13 12:35:17 2013(r246759)
+++ stable/9/sys/x86/x86/tsc.c  Wed Feb 13 13:55:54 2013(r246760)
@@ -67,6 +67,11 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, 
 TUNABLE_INT("kern.timecounter.smp_tsc", &smp_tsc);
 #endif
 
+static int tsc_shift = 1;
+SYSCTL_INT(_kern_timecounter, OID_AUTO, tsc_shift, CTLFLAG_RDTUN,
+&tsc_shift, 0, "Shift to pre-apply for the maximum TSC frequency");
+TUNABLE_INT("kern.timecounter.tsc_shift", &tsc_shift);
+
 static int tsc_disabled;
 SYSCTL_INT(_machdep, OID_AUTO, disable_tsc, CTLFLAG_RDTUN, &tsc_disabled, 0,
 "Disable x86 Time Stamp Counter");
@@ -399,12 +404,12 @@ comp_smp_tsc(void *arg)
 }
 
 static int
-test_smp_tsc(void)
+test_tsc(void)
 {
uint32_t *data, *tsc;
u_int i, size;
 
-   if (!smp_tsc && !tsc_is_invariant)
+   if ((!smp_tsc && !tsc_is_invariant) || vm_guest)
return (-100);
size = (mp_maxid + 1) * 3;
data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK);
@@ -444,6 +449,19 @@ test_smp_tsc(void)
 
 #undef N
 
+#else
+
+/*
+ * The function is not called, it is provided to avoid linking failure
+ * on uniprocessor kernel.
+ */
+static int
+test_tsc(void)
+{
+
+   return (0);
+}
+
 #endif /* SMP */
 
 static void
@@ -492,41 +510,37 @@ init_TSC_tc(void)
goto init;
}
 
-#ifdef SMP
/*
-* We can not use the TSC in SMP mode unless the TSCs on all CPUs are
-* synchronized.  If the user is sure that the system has synchronized
-* TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value.
-* We also limit the frequency even lower to avoid "temporal anomalies"
-* as much as possible.  The TSC seems unreliable in virtualized SMP
+* We can not use the TSC in SMP mode unless the TSCs on all CPUs
+* are synchronized.  If the user is sure that the system has
+* synchronized TSCs, set kern.timecounter.smp_tsc tunable to a
+* non-zero value.  The TSC seems unreliable in virtualized SMP
 * environments, so it is set to a negative quality in those cases.
 */
-   if (smp_cpus > 1) {
-   if (vm_guest != 0) {
-   tsc_timecounter.tc_quality = -100;
-   } else {
-   tsc_timecounter.tc_quality = test_smp_tsc();
-   max_freq >>= 8;
-   }
-   } else
-#endif
-   if (tsc_is_invariant)
+   if (mp_ncpus > 1)
+   tsc_timecounter.tc_quality = test_tsc();
+   else if (tsc_is_invariant)
tsc_timecounter.tc_quality = 1000;
+   max_freq >>= tsc_shift;
 
 init:
-   for (shift = 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++)
+   for (shift = 0; shift <= 31 && (tsc_freq >> shift) > max_freq; shift++)
;
+   if ((cpu_feature & CPUID_SSE2) != 0 && mp_ncpus > 1) {
+   if (cpu_vendor_id == CPU_VENDOR_AMD) {
+   tsc_timecounter.tc_get_timecount = shift > 0 ?
+   tsc_get_timecount_low_mfence :
+   tsc_get_timecount_mfence;
+   } else {
+   tsc_timecounter.tc_get_timecount = shift > 0 ?
+   tsc_get_timecount_low_lfence :
+   tsc_get_timecount_lfence;
+   }
+   } else {
+   tsc_timecounter.tc_get_timecount = shift > 0 ?
+   tsc_get_timecount_low : tsc_get_timecount;
+   }
if (shift > 0) {
-   if (cpu_feature & CPUID_SSE2) {
-   if (cpu_vendor_id == CPU_VENDOR_AMD) {
-   tsc_timecounter.tc_get_timecount =
-   tsc_get_timecount_low_mfence;
-   } else {
-   tsc_timecounter.tc_get_timecount =
-   tsc_get_timecount_low_lfence;
-   }
-   } else
-   tsc_timecounter.tc_get_timecount = 
tsc_get_timecount_low;
tsc_timecounter.tc_name = "TSC-low";
if (bootverbose)
printf("TSC timecounter discards lower %d bit(s)\n",

Re: svn commit: r246706 - head/lib/libc/arm/aeabi

2013-02-13 Thread Konstantin Belousov
On Wed, Feb 13, 2013 at 10:25:46PM +1300, Andrew Turner wrote:
> On Tue, 12 Feb 2013 08:32:23 -0600
> Nathan Whitehorn  wrote:
> 
> > A related question to these commits: are EABI binaries incompatible
> > with systems built for OABI? And vice versa? If so, should we mint a
> > new MACHINE_ARCH for ARM EABI (or OABI, I guess)? The usual
> > implication of sharing a uname -p string is that systems can run each
> > other's binaries -- that being broken is a strong argument for a new
> > value. -Nathan
> 
> Yes OABI and EABI are binary incompatible. The plan is to kill off OABI
> at some stage in the future when EABI is ready. At some time in the
> future I plan on flipping the switch to make EABI the default but keep
> OABI around to allow people a chance to update.
> 
> I am relying on ARM being a Tier 2 platform to change the ABI such that
> we break backward compatibility without changing uname -p. I have the
> start of a compat layer in the EABI project branch however never
> finished it. If people are interested in updating this compatibility
> layer I can point them at the code.
> 
> The other point is backwards compatibility should only be an issue for
> ARMv4 and ARMv5 as these are the only cores we have support for on the
> any of the current release branches. ARMv6 and ARMv7 is added to 10 and
> there has not been an MFC to any of the stable branches. Because of
> this I have even less hesitation to stitch the ABI for
> TARGET_ARCH=armv6.
> 
> In summary my plan is:
> < 9: No change
> >= 10: Switch to EABI and remove or depricate OABI

Does the ABI change happen for the interfaces exported both by usermode
components and kernel, or only usermode components ? Or, does the kernel
exported ABI supports both OABI and EABI ?


pgpMo1gfimiwF.pgp
Description: PGP signature


svn commit: r246763 - in head: lib/libc/sys sys/kern

2013-02-13 Thread Ian Lepore
Author: ian
Date: Wed Feb 13 15:09:16 2013
New Revision: 246763
URL: http://svnweb.freebsd.org/changeset/base/246763

Log:
  Make the F_READAHEAD option to fcntl(2) work as documented:  a value of zero
  now disables read-ahead.  It used to effectively restore the system default
  readahead hueristic if it had been changed; a negative value now restores
  the default.
  
  Reviewed by:  kib

Modified:
  head/lib/libc/sys/fcntl.2
  head/sys/kern/kern_descrip.c

Modified: head/lib/libc/sys/fcntl.2
==
--- head/lib/libc/sys/fcntl.2   Wed Feb 13 14:57:54 2013(r246762)
+++ head/lib/libc/sys/fcntl.2   Wed Feb 13 15:09:16 2013(r246763)
@@ -28,7 +28,7 @@
 .\" @(#)fcntl.28.2 (Berkeley) 1/12/94
 .\" $FreeBSD$
 .\"
-.Dd July 27, 2012
+.Dd February 8, 2013
 .Dt FCNTL 2
 .Os
 .Sh NAME
@@ -171,7 +171,7 @@ argument,
 which is rounded up to the nearest block size.
 A zero value in
 .Fa arg
-turns off read ahead.
+turns off read ahead, a negative value restores the system default.
 .It Dv F_RDAHEAD
 Equivalent to Darwin counterpart which sets read ahead amount of 128KB
 when the third argument,

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cWed Feb 13 14:57:54 2013
(r246762)
+++ head/sys/kern/kern_descrip.cWed Feb 13 15:09:16 2013
(r246763)
@@ -776,7 +776,7 @@ kern_fcntl(struct thread *td, int fd, in
}
fhold(fp);
FILEDESC_SUNLOCK(fdp);
-   if (arg != 0) {
+   if (arg >= 0) {
vp = fp->f_vnode;
error = vn_lock(vp, LK_SHARED);
if (error != 0) {
___
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: r246764 - head/sys/conf

2013-02-13 Thread Ian Lepore
Author: ian
Date: Wed Feb 13 15:13:47 2013
New Revision: 246764
URL: http://svnweb.freebsd.org/changeset/base/246764

Log:
  Add a dependency so that when compiling in a static dtb, the kernel gets
  re-linked after changing the .dts source.
  
  Reviewed by:  cognet, arm@

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Feb 13 15:09:16 2013(r246763)
+++ head/sys/conf/files Wed Feb 13 15:13:47 2013(r246764)
@@ -1294,7 +1294,8 @@ dev/fb/splash.c   optional splash
 dev/fdt/fdt_common.c   optional fdt
 dev/fdt/fdt_pci.c  optional fdt pci
 dev/fdt/fdt_slicer.c   optional fdt cfi | fdt nand
-dev/fdt/fdt_static_dtb.S   optional fdt fdt_dtb_static
+dev/fdt/fdt_static_dtb.S   optional fdt fdt_dtb_static \
+   dependency  "$S/boot/fdt/dts/${FDT_DTS_FILE}"
 dev/fdt/fdtbus.c   optional fdt
 dev/fdt/simplebus.coptional fdt
 dev/fe/if_fe.c optional fe
___
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: r246765 - head/sys/dev/usb/wlan

2013-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Feb 13 15:43:15 2013
New Revision: 246765
URL: http://svnweb.freebsd.org/changeset/base/246765

Log:
  Remove unused variable.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_upgtvar.h

Modified: head/sys/dev/usb/wlan/if_upgt.c
==
--- head/sys/dev/usb/wlan/if_upgt.c Wed Feb 13 15:13:47 2013
(r246764)
+++ head/sys/dev/usb/wlan/if_upgt.c Wed Feb 13 15:43:15 2013
(r246765)
@@ -1567,7 +1567,6 @@ upgt_tx_done(struct upgt_softc *sc, uint
data_tx->ni = NULL;
data_tx->addr = 0;
data_tx->m = NULL;
-   data_tx->use = 0;
 
DPRINTF(sc, UPGT_DEBUG_TX_PROC,
"TX done: memaddr=0x%08x, status=0x%04x, rssi=%d, ",

Modified: head/sys/dev/usb/wlan/if_upgtvar.h
==
--- head/sys/dev/usb/wlan/if_upgtvar.h  Wed Feb 13 15:13:47 2013
(r246764)
+++ head/sys/dev/usb/wlan/if_upgtvar.h  Wed Feb 13 15:43:15 2013
(r246765)
@@ -352,7 +352,6 @@ struct upgt_data {
struct ieee80211_node   *ni;
struct mbuf *m;
uint32_t addr;
-   uint8_t  use;
STAILQ_ENTRY(upgt_data)  next;
 };
 typedef STAILQ_HEAD(, upgt_data) upgt_datahead;
___
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: r246766 - in head: include lib/libc/string

2013-02-13 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Wed Feb 13 15:46:33 2013
New Revision: 246766
URL: http://svnweb.freebsd.org/changeset/base/246766

Log:
  Add strchrnul(), a GNU function similar to strchr(), except that it returns
  a pointer to the end of the string, rather than NULL, if the character was
  not found.
  
  Approved by:  theraven

Added:
  head/lib/libc/string/strchrnul.c   (contents, props changed)
Modified:
  head/include/string.h
  head/lib/libc/string/Makefile.inc
  head/lib/libc/string/Symbol.map
  head/lib/libc/string/strchr.3

Modified: head/include/string.h
==
--- head/include/string.h   Wed Feb 13 15:43:15 2013(r246765)
+++ head/include/string.h   Wed Feb 13 15:46:33 2013(r246766)
@@ -74,6 +74,9 @@ char  *strcasestr(const char *, const cha
 #endif
 char   *strcat(char * __restrict, const char * __restrict);
 char   *strchr(const char *, int) __pure;
+#if defined(_GNU_SOURCE)
+char   *strchrnul(const char*, int) __pure;
+#endif
 int strcmp(const char *, const char *) __pure;
 int strcoll(const char *, const char *);
 char   *strcpy(char * __restrict, const char * __restrict);

Modified: head/lib/libc/string/Makefile.inc
==
--- head/lib/libc/string/Makefile.inc   Wed Feb 13 15:43:15 2013
(r246765)
+++ head/lib/libc/string/Makefile.inc   Wed Feb 13 15:46:33 2013
(r246766)
@@ -10,9 +10,9 @@ MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffs
memccpy.c memchr.c memrchr.c memcmp.c \
memcpy.c memmem.c memmove.c memset.c \
stpcpy.c stpncpy.c strcasecmp.c \
-   strcat.c strcasestr.c strchr.c strcmp.c strcoll.c strcpy.c strcspn.c \
-   strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c strncat.c \
-   strncmp.c strncpy.c strndup.c strnlen.c strnstr.c \
+   strcat.c strcasestr.c strchr.c strchrnul.c strcmp.c strcoll.c strcpy.c\
+   strcspn.c strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c \
+   strncat.c strncmp.c strncpy.c strndup.c strnlen.c strnstr.c \
strpbrk.c strrchr.c strsep.c strsignal.c strspn.c strstr.c strtok.c \
strxfrm.c swab.c wcpcpy.c wcpncpy.c wcscasecmp.c wcscat.c \
wcschr.c wcscmp.c wcscoll.c wcscpy.c wcscspn.c wcsdup.c \

Modified: head/lib/libc/string/Symbol.map
==
--- head/lib/libc/string/Symbol.map Wed Feb 13 15:43:15 2013
(r246765)
+++ head/lib/libc/string/Symbol.map Wed Feb 13 15:46:33 2013
(r246766)
@@ -94,6 +94,7 @@ FBSD_1.1 {
 FBSD_1.3 {
strcasecmp_l;
strcasestr_l;
+   strchrnul;
strncasecmp_l;
wcswidth_l;
wcwidth_l;

Modified: head/lib/libc/string/strchr.3
==
--- head/lib/libc/string/strchr.3   Wed Feb 13 15:43:15 2013
(r246765)
+++ head/lib/libc/string/strchr.3   Wed Feb 13 15:46:33 2013
(r246766)
@@ -32,11 +32,11 @@
 .\" @(#)strchr.3   8.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd April 19, 1994
+.Dd February 13, 2013
 .Dt STRCHR 3
 .Os
 .Sh NAME
-.Nm strchr , strrchr
+.Nm strchr , strrchr , strchrnul
 .Nd locate character in string
 .Sh LIBRARY
 .Lb libc
@@ -46,6 +46,8 @@
 .Fn strchr "const char *s" "int c"
 .Ft "char *"
 .Fn strrchr "const char *s" "int c"
+.Ft "char *"
+.Fn strchrnul "const char *s" "int c"
 .Sh DESCRIPTION
 The
 .Fn strchr
@@ -69,6 +71,18 @@ function is identical to
 .Fn strchr
 except it locates the last occurrence of
 .Fa c .
+.Pp
+The
+.Fn strchrnul
+function is identical to
+.Fn strchr
+except that if
+.Fa c
+is not found in
+.Fa s
+a pointer to the terminating
+.Ql \e0
+is returned.
 .Sh RETURN VALUES
 The functions
 .Fn strchr
@@ -77,6 +91,11 @@ and
 return a pointer to the located character, or
 .Dv NULL
 if the character does not appear in the string.
+.Pp
+.Fn strchrnul
+returns a pointer to the terminating
+.Ql \e0
+if the character does not appear in the string.
 .Sh SEE ALSO
 .Xr memchr 3 ,
 .Xr memmem 3 ,
@@ -94,3 +113,11 @@ and
 .Fn strrchr
 conform to
 .St -isoC .
+The
+.Fn strchrnul
+is a GNU extension .
+.Sh History
+The
+.Fn strchrnul
+function first appeared in glibc 2.1.1 and was added in
+.Fx 10.0 .

Added: head/lib/libc/string/strchrnul.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/string/strchrnul.cWed Feb 13 15:46:33 2013
(r246766)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Niclas Zeising
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of con

Re: svn commit: r246614 - head/sys/dev/usb/wlan

2013-02-13 Thread John Baldwin
On Tuesday, February 12, 2013 2:43:32 am Hans Petter Selasky wrote:
> On Monday 11 February 2013 17:33:02 John Baldwin wrote:
> > On Sunday, February 10, 2013 5:36:17 am Hans Petter Selasky wrote:
> > > Author: hselasky
> > > Date: Sun Feb 10 10:36:16 2013
> > > New Revision: 246614
> > > URL: http://svnweb.freebsd.org/changeset/base/246614
> > > 
> > > Log:
> > >   - Streamline detach logic in wlan drivers, so that
> > >   
> > > freed memory cannot be used during detach.
> > >   
> > >   - Remove all panic() calls from the urtw driver because
> > >   
> > > panic() is not appropriate here.
> > >   
> > >   - Remove redundant checks for device detached in
> > >   
> > > device detach callbacks.
> > >   
> > >   - Use DEVMETHOD_END to mark end of device methods.
> > 
> > Using a detached flag to bail from ioctl generally means you are doing
> > things wrong in detach.  The correct solution is to always detach your
> > ifnet first, then start tearing down other state.  In general with device
> > detach routines the first order of business is removing external
> > references such as character devices, ifnets, etc. and only start shutting
> > down the hardware and releasing state once those steps have completed.
> 
> Hi,
> 
> What I can do to solve the problem is to lock a mutex while detaching. Is 
the 
> ifnet detach routine non-blocking?
> 
> Why do I say that? It is because we are in a chicken-egg situation. USB is 
> feeding data into ifnet and ifnet is feeding data into USB. Each stack is 
> running under its own lock. The current approach is:
> 
> 1) Stop data traffic in both directions
> 2) Make sure no more init happens (ioctl fix)
> 3) Free USB and IFNET.
> 
> I see currently no way I can atomically stop all traffic and prevent futher 
> init at the same time, while holding a single mutex. Do you?

You shouldn't call routines that can drain like if_detach() or destroy_dev() 
or the like while holding any mutexes period.  I think you need a 0) step 
which is "detach external consumers" including cdev's (destroy_dev()) and 
ifnet's (if_detach).  Once both of those routines have finished, you can then
proceed with actually stopping device operation, and 2) is not needed as it 
can't happen once 0) has finished.

When a device has both an ifnet and a cdev you may need something to handle 
the case of one part being dead but not the other.  For now you can call
if_detach() first as it doesn't sleep (though that is a bug).  The real fix 
for this case (and things like tun(4) can need this as well) is to have a way 
to call just the non-blocking parts of things like if_detach() and 
destroy_dev() first to mark the relevant portions as dead and then follow 
those with blocking calls that do the drain.  This is all part of step 0 
though.

-- 
John Baldwin
___
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: r246614 - head/sys/dev/usb/wlan

2013-02-13 Thread Hans Petter Selasky
Hi,

On Wednesday 13 February 2013 16:53:02 John Baldwin wrote:
> You shouldn't call routines that can drain like if_detach() or
> destroy_dev()  or the like while holding any mutexes period.  I think you
> need a 0) step which is "detach external consumers" including cdev's
> (destroy_dev()) and ifnet's (if_detach).  Once both of those routines have
> finished, you can then proceed with actually stopping device operation,
> and 2) is not needed as it can't happen once 0) has finished.
> 

Right.

> When a device has both an ifnet and a cdev you may need something to
> handle  the case of one part being dead but not the other.  For now you
> can call if_detach() first as it doesn't sleep (though that is a
> bug).  The real fix for this case (and things like tun(4) can need this as
> well) is to have a way to call just the non-blocking parts of things like
> if_detach() and destroy_dev() first to mark the relevant portions as dead
> and then follow those with blocking calls that do the drain.  This is all
> part of step 0 though.

I feel this is out of my area. Can you push the right people to make such a 
change in the IFNET code and I can update the USB part.

--HPS
___
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: r246763 - in head: lib/libc/sys sys/kern

2013-02-13 Thread Benjamin Kaduk
On Wed, Feb 13, 2013 at 10:09 AM, Ian Lepore  wrote:

> Author: ian
> Date: Wed Feb 13 15:09:16 2013
> New Revision: 246763
> URL: http://svnweb.freebsd.org/changeset/base/246763
>
> Modified: head/lib/libc/sys/fcntl.2
>
> ==
> --- head/lib/libc/sys/fcntl.2   Wed Feb 13 14:57:54 2013(r246762)
> +++ head/lib/libc/sys/fcntl.2   Wed Feb 13 15:09:16 2013(r246763)
> @@ -171,7 +171,7 @@ argument,
>  which is rounded up to the nearest block size.
>  A zero value in
>  .Fa arg
> -turns off read ahead.
> +turns off read ahead, a negative value restores the system default.
>

Comma splice?

-Ben


>  .It Dv F_RDAHEAD
>  Equivalent to Darwin counterpart which sets read ahead amount of 128KB
>  when the third argument,
>
___
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: r246768 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-02-13 Thread Xin LI
Author: delphij
Date: Wed Feb 13 17:30:54 2013
New Revision: 246768
URL: http://svnweb.freebsd.org/changeset/base/246768

Log:
  Restore De Bruijn algorithm for sparc64 where the compiler rely on a
  library function for __builtin_c?z.
  
  Tested by:Michael Moll 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c   Wed Feb 13 
17:03:35 2013(r246767)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c   Wed Feb 13 
17:30:54 2013(r246768)
@@ -238,6 +238,16 @@ lz4_decompress(void *s_start, void *d_st
 #endif
 
 /*
+ * FreeBSD: can't use GCC's __builtin_ctz when using sparc64 because
+ * gcc currently rely on libcompiler_rt.
+ *
+ * TODO: revisit this when situation changes.
+ */
+#if defined(__sparc64__)
+#defineLZ4_FORCE_SW_BITCOUNT
+#endif
+
+/*
  * Compiler Options
  */
 #if __STDC_VERSION__ >= 199901L/* C99 */
@@ -378,9 +388,38 @@ static inline int
 LZ4_NbCommonBytes(register U64 val)
 {
 #if defined(LZ4_BIG_ENDIAN)
+#if !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_clzll(val) >> 3);
 #else
+   int r;
+   if (!(val >> 32)) {
+   r = 4;
+   } else {
+   r = 0;
+   val >>= 32;
+   }
+   if (!(val >> 16)) {
+   r += 2;
+   val >>= 8;
+   } else {
+   val >>= 24;
+   }
+   r += (!val);
+   return (r);
+#endif
+#else
+#if !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_ctzll(val) >> 3);
+#else
+   static const int DeBruijnBytePos[64] =
+   { 0, 0, 0, 0, 0, 1, 1, 2, 0, 3, 1, 3, 1, 4, 2, 7, 0, 2, 3, 6, 1, 5,
+   3, 5, 1, 3, 4, 4, 2, 5, 6, 7, 7, 0, 1, 2, 3, 3, 4, 6, 2, 6, 5,
+   5, 3, 4, 5, 6, 7, 1, 2, 4, 6, 4,
+   4, 5, 7, 2, 6, 5, 7, 6, 7, 7
+   };
+   return DeBruijnBytePos[((U64) ((val & -val) * 0x0218A392CDABBD3F)) >>
+   58];
+#endif
 #endif
 }
 
@@ -390,9 +429,33 @@ static inline int
 LZ4_NbCommonBytes(register U32 val)
 {
 #if defined(LZ4_BIG_ENDIAN)
+#if !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_clz(val) >> 3);
 #else
+   int r;
+   if (!(val >> 16)) {
+   r = 2;
+   val >>= 8;
+   } else {
+   r = 0;
+   val >>= 24;
+   }
+   r += (!val);
+   return (r);
+#endif
+#else
+#if !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_ctz(val) >> 3);
+#else
+   static const int DeBruijnBytePos[32] = {
+   0, 0, 3, 0, 3, 1, 3, 0,
+   3, 2, 2, 1, 3, 2, 0, 1,
+   3, 3, 1, 2, 2, 2, 2, 0,
+   3, 1, 2, 0, 1, 0, 1, 1
+   };
+   return DeBruijnBytePos[((U32) ((val & -(S32) val) * 0x077CB531U)) >>
+   27];
+#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"


Re: svn commit: r246763 - in head: lib/libc/sys sys/kern

2013-02-13 Thread Ian Lepore
On Wed, 2013-02-13 at 11:24 -0500, Benjamin Kaduk wrote:
> On Wed, Feb 13, 2013 at 10:09 AM, Ian Lepore  wrote:
> 
> > Author: ian
> > Date: Wed Feb 13 15:09:16 2013
> > New Revision: 246763
> > URL: http://svnweb.freebsd.org/changeset/base/246763
> >
> > Modified: head/lib/libc/sys/fcntl.2
> >
> > ==
> > --- head/lib/libc/sys/fcntl.2   Wed Feb 13 14:57:54 2013(r246762)
> > +++ head/lib/libc/sys/fcntl.2   Wed Feb 13 15:09:16 2013(r246763)
> > @@ -171,7 +171,7 @@ argument,
> >  which is rounded up to the nearest block size.
> >  A zero value in
> >  .Fa arg
> > -turns off read ahead.
> > +turns off read ahead, a negative value restores the system default.
> >
> 
> Comma splice?

Perhaps.  The two clauses are independent in the grammatical sense, but
conceptually not so much.  I had initially written a semicolon, but then
I pondered and changed it, mainly because I tend to over-use semicolons,
so I often reflexively remove them if I stop to think about it.

My concern was keeping the second occurance of the word "value"
conceptually coupled with the first use of it in the sentence; that's
why I didn't use a separate sentence.

Do you think a semicolon is better?

-- Ian


___
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: r246706 - head/lib/libc/arm/aeabi

2013-02-13 Thread Andrew Turner
On Wed, 13 Feb 2013 16:00:06 +0200
Konstantin Belousov  wrote:

> On Wed, Feb 13, 2013 at 10:25:46PM +1300, Andrew Turner wrote:
> > On Tue, 12 Feb 2013 08:32:23 -0600
> > Nathan Whitehorn  wrote:
> > 
> > > A related question to these commits: are EABI binaries
> > > incompatible with systems built for OABI? And vice versa? If so,
> > > should we mint a new MACHINE_ARCH for ARM EABI (or OABI, I
> > > guess)? The usual implication of sharing a uname -p string is
> > > that systems can run each other's binaries -- that being broken
> > > is a strong argument for a new value. -Nathan
> > 
> > Yes OABI and EABI are binary incompatible. The plan is to kill off
> > OABI at some stage in the future when EABI is ready. At some time
> > in the future I plan on flipping the switch to make EABI the
> > default but keep OABI around to allow people a chance to update.
> > 
> > I am relying on ARM being a Tier 2 platform to change the ABI such
> > that we break backward compatibility without changing uname -p. I
> > have the start of a compat layer in the EABI project branch however
> > never finished it. If people are interested in updating this
> > compatibility layer I can point them at the code.
> > 
> > The other point is backwards compatibility should only be an issue
> > for ARMv4 and ARMv5 as these are the only cores we have support for
> > on the any of the current release branches. ARMv6 and ARMv7 is
> > added to 10 and there has not been an MFC to any of the stable
> > branches. Because of this I have even less hesitation to stitch the
> > ABI for TARGET_ARCH=armv6.
> > 
> > In summary my plan is:
> > < 9: No change
> > >= 10: Switch to EABI and remove or depricate OABI
> 
> Does the ABI change happen for the interfaces exported both by
> usermode components and kernel, or only usermode components ? Or,
> does the kernel exported ABI supports both OABI and EABI ?

The ABI change happens on both interfaces.

The kernel only exposes a single ABI. For a kernel built with EABI it
will be EABI. I started a compat layer to export OABI on EABI kernels
however never finished it. If someone is interested in finishing it I
can point them to the code.

Andrew
___
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: r246766 - in head: include lib/libc/string

2013-02-13 Thread Konstantin Belousov
On Wed, Feb 13, 2013 at 03:46:33PM +, Niclas Zeising wrote:
> Author: zeising (doc,ports committer)
> Date: Wed Feb 13 15:46:33 2013
> New Revision: 246766
> URL: http://svnweb.freebsd.org/changeset/base/246766
> 
> Log:
>   Add strchrnul(), a GNU function similar to strchr(), except that it returns
>   a pointer to the end of the string, rather than NULL, if the character was
>   not found.
>   
>   Approved by:theraven
> 
> Added:
>   head/lib/libc/string/strchrnul.c   (contents, props changed)
> Modified:
>   head/include/string.h
>   head/lib/libc/string/Makefile.inc
>   head/lib/libc/string/Symbol.map
>   head/lib/libc/string/strchr.3
> 
> Modified: head/include/string.h
> ==
> --- head/include/string.h Wed Feb 13 15:43:15 2013(r246765)
> +++ head/include/string.h Wed Feb 13 15:46:33 2013(r246766)
> @@ -74,6 +74,9 @@ char*strcasestr(const char *, const cha
>  #endif
>  char *strcat(char * __restrict, const char * __restrict);
>  char *strchr(const char *, int) __pure;
> +#if defined(_GNU_SOURCE)
> +char *strchrnul(const char*, int) __pure;
> +#endif
The GNU_SOURCE namespace is not present on the FreeBSD.  We use
#if __BSD_VISIBLE
namespace delineation for the extensions not covered by any standard
namespaces supported by the FreeBSD headers.

The only place in the system where system-native headers do check for
_GNU_SOURCE, the code also checks for _BSD_SOURCE.


pgpkIqCe3VvMH.pgp
Description: PGP signature


Re: svn commit: r246614 - head/sys/dev/usb/wlan

2013-02-13 Thread John Baldwin
On Wednesday, February 13, 2013 11:04:58 am Hans Petter Selasky wrote:
> Hi,
> 
> On Wednesday 13 February 2013 16:53:02 John Baldwin wrote:
> > You shouldn't call routines that can drain like if_detach() or
> > destroy_dev()  or the like while holding any mutexes period.  I think you
> > need a 0) step which is "detach external consumers" including cdev's
> > (destroy_dev()) and ifnet's (if_detach).  Once both of those routines have
> > finished, you can then proceed with actually stopping device operation,
> > and 2) is not needed as it can't happen once 0) has finished.
> > 
> 
> Right.
> 
> > When a device has both an ifnet and a cdev you may need something to
> > handle  the case of one part being dead but not the other.  For now you
> > can call if_detach() first as it doesn't sleep (though that is a
> > bug).  The real fix for this case (and things like tun(4) can need this as
> > well) is to have a way to call just the non-blocking parts of things like
> > if_detach() and destroy_dev() first to mark the relevant portions as dead
> > and then follow those with blocking calls that do the drain.  This is all
> > part of step 0 though.
> 
> I feel this is out of my area. Can you push the right people to make such a 
> change in the IFNET code and I can update the USB part.

For now because if_detach() is broken I think you can just call 
ether_ifdetach() and then destroy_dev().

-- 
John Baldwin
___
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: r246675 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-02-13 Thread Pawel Jakub Dawidek
On Mon, Feb 11, 2013 at 01:59:57PM +, Martin Matuska wrote:
> Author: mm
> Date: Mon Feb 11 13:59:57 2013
> New Revision: 246675
> URL: http://svnweb.freebsd.org/changeset/base/246675
> 
> Log:
>   MFV r246394:
>   Add tunable to allow block allocation on degraded vdevs.
>   
>   Illumos ZFS issues:
> 3507 Tunable to allow block allocation even on degraded vdevs
>   
>   References:
> https://www.illumos.org/issues/3507
>   
>   MFC after:  2 weeks
> 
> Modified:
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
> Directory Properties:
>   head/sys/cddl/contrib/opensolaris/   (props changed)
> 
> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
> ==
> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.cMon Feb 
> 11 13:57:03 2013(r246674)
> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.cMon Feb 
> 11 13:59:57 2013(r246675)
> @@ -21,6 +21,7 @@
>  /*
>   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights 
> reserved.
>   * Copyright (c) 2012 by Delphix. All rights reserved.
> + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
>   */
>  
>  #include 
> @@ -97,6 +98,15 @@ int metaslab_prefetch_limit = SPA_DVAS_P
>  int metaslab_smo_bonus_pct = 150;
>  
>  /*
> + * Should we be willing to write data to degraded vdevs?
> + */
> +boolean_t zfs_write_to_degraded = B_FALSE;
> +SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RW,

Please use CTLFLAG_RWTUN flag here.

> +&zfs_write_to_degraded, 0,
> +"Allow writing data to degraded vdevs");

BTW. Those two lines fit into 80 chars just fine.

> +TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded);

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl


pgpwpegytG5Ic.pgp
Description: PGP signature


svn commit: r246769 - in vendor-crypto/openssl/dist: . apps crypto crypto/aes/asm crypto/asn1 crypto/bio crypto/bn crypto/bn/asm crypto/camellia/asm crypto/cms crypto/conf crypto/des crypto/ec cryp...

2013-02-13 Thread Jung-uk Kim
Author: jkim
Date: Wed Feb 13 22:15:56 2013
New Revision: 246769
URL: http://svnweb.freebsd.org/changeset/base/246769

Log:
  Import OpenSSL 1.0.1e.
  
  Approved by:  secteam (delphij, simon), benl (silence)

Added:
  vendor-crypto/openssl/dist/crypto/evp/evp_cnf.c   (contents, props changed)
  vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_verify_recover.pod   
(contents, props changed)
 - copied, changed from r246684, 
vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_verifyrecover.pod
  vendor-crypto/openssl/dist/ssl/s3_cbc.c   (contents, props changed)
Deleted:
  vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_verifyrecover.pod
Modified:
  vendor-crypto/openssl/dist/CHANGES
  vendor-crypto/openssl/dist/Configure
  vendor-crypto/openssl/dist/FAQ
  vendor-crypto/openssl/dist/FREEBSD-upgrade
  vendor-crypto/openssl/dist/Makefile
  vendor-crypto/openssl/dist/Makefile.org
  vendor-crypto/openssl/dist/NEWS
  vendor-crypto/openssl/dist/PROBLEMS
  vendor-crypto/openssl/dist/README
  vendor-crypto/openssl/dist/apps/apps.c
  vendor-crypto/openssl/dist/apps/ca.c
  vendor-crypto/openssl/dist/apps/cms.c
  vendor-crypto/openssl/dist/apps/dgst.c
  vendor-crypto/openssl/dist/apps/dhparam.c
  vendor-crypto/openssl/dist/apps/dsaparam.c
  vendor-crypto/openssl/dist/apps/genrsa.c
  vendor-crypto/openssl/dist/apps/ocsp.c
  vendor-crypto/openssl/dist/apps/s_cb.c
  vendor-crypto/openssl/dist/apps/s_client.c
  vendor-crypto/openssl/dist/apps/s_server.c
  vendor-crypto/openssl/dist/apps/speed.c
  vendor-crypto/openssl/dist/apps/srp.c
  vendor-crypto/openssl/dist/apps/verify.c
  vendor-crypto/openssl/dist/apps/x509.c
  vendor-crypto/openssl/dist/crypto/aes/asm/aes-mips.pl
  vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl
  vendor-crypto/openssl/dist/crypto/aes/asm/aes-x86_64.pl
  vendor-crypto/openssl/dist/crypto/aes/asm/aesni-sha1-x86_64.pl
  vendor-crypto/openssl/dist/crypto/aes/asm/aesni-x86_64.pl
  vendor-crypto/openssl/dist/crypto/aes/asm/bsaes-x86_64.pl
  vendor-crypto/openssl/dist/crypto/aes/asm/vpaes-x86_64.pl
  vendor-crypto/openssl/dist/crypto/asn1/a_strex.c
  vendor-crypto/openssl/dist/crypto/asn1/a_verify.c
  vendor-crypto/openssl/dist/crypto/asn1/x_pubkey.c
  vendor-crypto/openssl/dist/crypto/bio/bss_dgram.c
  vendor-crypto/openssl/dist/crypto/bn/asm/mips.pl
  vendor-crypto/openssl/dist/crypto/bn/asm/modexp512-x86_64.pl
  vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-gf2m.pl
  vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont.pl
  vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont5.pl
  vendor-crypto/openssl/dist/crypto/bn/bn_div.c
  vendor-crypto/openssl/dist/crypto/bn/bn_gcd.c
  vendor-crypto/openssl/dist/crypto/bn/bn_lcl.h
  vendor-crypto/openssl/dist/crypto/camellia/asm/cmll-x86_64.pl
  vendor-crypto/openssl/dist/crypto/cms/cms_cd.c
  vendor-crypto/openssl/dist/crypto/cms/cms_enc.c
  vendor-crypto/openssl/dist/crypto/cms/cms_lib.c
  vendor-crypto/openssl/dist/crypto/conf/conf_mall.c
  vendor-crypto/openssl/dist/crypto/cryptlib.c
  vendor-crypto/openssl/dist/crypto/cryptlib.h
  vendor-crypto/openssl/dist/crypto/crypto.h
  vendor-crypto/openssl/dist/crypto/des/set_key.c
  vendor-crypto/openssl/dist/crypto/des/str2key.c
  vendor-crypto/openssl/dist/crypto/ec/ec.h
  vendor-crypto/openssl/dist/crypto/ec/ec_key.c
  vendor-crypto/openssl/dist/crypto/ec/ec_pmeth.c
  vendor-crypto/openssl/dist/crypto/ec/ecp_mont.c
  vendor-crypto/openssl/dist/crypto/ec/ectest.c
  vendor-crypto/openssl/dist/crypto/ecdh/Makefile
  vendor-crypto/openssl/dist/crypto/ecdh/ech_key.c
  vendor-crypto/openssl/dist/crypto/ecdh/ech_lib.c
  vendor-crypto/openssl/dist/crypto/ecdsa/ecs_lib.c
  vendor-crypto/openssl/dist/crypto/err/err_all.c
  vendor-crypto/openssl/dist/crypto/evp/Makefile
  vendor-crypto/openssl/dist/crypto/evp/digest.c
  vendor-crypto/openssl/dist/crypto/evp/e_aes.c
  vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha1.c
  vendor-crypto/openssl/dist/crypto/evp/evp.h
  vendor-crypto/openssl/dist/crypto/evp/evp_err.c
  vendor-crypto/openssl/dist/crypto/evp/m_dss.c
  vendor-crypto/openssl/dist/crypto/evp/m_dss1.c
  vendor-crypto/openssl/dist/crypto/evp/m_sha1.c
  vendor-crypto/openssl/dist/crypto/evp/p_sign.c
  vendor-crypto/openssl/dist/crypto/evp/p_verify.c
  vendor-crypto/openssl/dist/crypto/md4/md4_dgst.c
  vendor-crypto/openssl/dist/crypto/md4/md4_locl.h
  vendor-crypto/openssl/dist/crypto/md5/asm/md5-x86_64.pl
  vendor-crypto/openssl/dist/crypto/md5/md5_locl.h
  vendor-crypto/openssl/dist/crypto/mdc2/mdc2dgst.c
  vendor-crypto/openssl/dist/crypto/mem.c
  vendor-crypto/openssl/dist/crypto/modes/asm/ghash-x86.pl
  vendor-crypto/openssl/dist/crypto/modes/asm/ghash-x86_64.pl
  vendor-crypto/openssl/dist/crypto/modes/gcm128.c
  vendor-crypto/openssl/dist/crypto/objects/o_names.c
  vendor-crypto/openssl/dist/crypto/ocsp/ocsp_vfy.c
  vendor-crypto/openssl/dist/crypto/opensslv.h
  vendor-crypto/openssl/dist/crypto/pem/pem_all.c
  vendor-crypto/openssl/dist/crypto/pem/pem_lib.c
  vendor-crypto/openssl/dist/crypto/pem/

svn commit: r246770 - vendor-crypto/openssl/1.0.1e

2013-02-13 Thread Jung-uk Kim
Author: jkim
Date: Wed Feb 13 22:17:05 2013
New Revision: 246770
URL: http://svnweb.freebsd.org/changeset/base/246770

Log:
  Tag OpenSSL 1.0.1e.

Added:
  vendor-crypto/openssl/1.0.1e/
 - copied from r246769, vendor-crypto/openssl/dist/
___
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: r246771 - head/crypto/openssl/doc/apps

2013-02-13 Thread Jung-uk Kim
Author: jkim
Date: Wed Feb 13 22:38:20 2013
New Revision: 246771
URL: http://svnweb.freebsd.org/changeset/base/246771

Log:
  Change "the  the" to "the".  It is a continuation of r226436 and missed in
  r237658.
  
  Approved by:  benl (maintainer, implicit)

Modified:
  head/crypto/openssl/doc/apps/dgst.pod

Modified: head/crypto/openssl/doc/apps/dgst.pod
==
--- head/crypto/openssl/doc/apps/dgst.pod   Wed Feb 13 22:17:05 2013
(r246770)
+++ head/crypto/openssl/doc/apps/dgst.pod   Wed Feb 13 22:38:20 2013
(r246771)
@@ -91,7 +91,7 @@ The output is either "Verification OK" o
 
 =item B<-prverify filename>
 
-verify the signature using the  the private key in "filename".
+verify the signature using the private key in "filename".
 
 =item B<-signature filename>
 
___
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: r246773 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-02-13 Thread Martin Matuska
Author: mm
Date: Wed Feb 13 23:11:25 2013
New Revision: 246773
URL: http://svnweb.freebsd.org/changeset/base/246773

Log:
  Change vfs.zfs.write_to_degraded from CTLFLAG_RW to CTLFLAG_RWTUN
  
  Suggested by: pjd

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c  Wed Feb 
13 23:07:20 2013(r246772)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c  Wed Feb 
13 23:11:25 2013(r246773)
@@ -101,9 +101,8 @@ int metaslab_smo_bonus_pct = 150;
  * Should we be willing to write data to degraded vdevs?
  */
 boolean_t zfs_write_to_degraded = B_FALSE;
-SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RW,
-&zfs_write_to_degraded, 0,
-"Allow writing data to degraded vdevs");
+SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RWTUN,
+&zfs_write_to_degraded, 0, "Allow writing data to degraded vdevs");
 TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded);
 
 /*
___
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: r246675 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-02-13 Thread Martin Matuska
On 13.2.2013 23:08, Pawel Jakub Dawidek wrote:
> On Mon, Feb 11, 2013 at 01:59:57PM +, Martin Matuska wrote:
>> Author: mm
>> Date: Mon Feb 11 13:59:57 2013
>> New Revision: 246675
>> URL: http://svnweb.freebsd.org/changeset/base/246675
>>
>> Log:
>>   MFV r246394:
>>   Add tunable to allow block allocation on degraded vdevs.
>>   
>>   Illumos ZFS issues:
>> 3507 Tunable to allow block allocation even on degraded vdevs
>>   
>>   References:
>> https://www.illumos.org/issues/3507
>>   
>>   MFC after: 2 weeks
>>
>> Modified:
>>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
>> Directory Properties:
>>   head/sys/cddl/contrib/opensolaris/   (props changed)
>>
>> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
>> ==
>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c   Mon Feb 
>> 11 13:57:03 2013(r246674)
>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c   Mon Feb 
>> 11 13:59:57 2013(r246675)
>> @@ -21,6 +21,7 @@
>>  /*
>>   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights 
>> reserved.
>>   * Copyright (c) 2012 by Delphix. All rights reserved.
>> + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
>>   */
>>  
>>  #include 
>> @@ -97,6 +98,15 @@ int metaslab_prefetch_limit = SPA_DVAS_P
>>  int metaslab_smo_bonus_pct = 150;
>>  
>>  /*
>> + * Should we be willing to write data to degraded vdevs?
>> + */
>> +boolean_t zfs_write_to_degraded = B_FALSE;
>> +SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RW,
> Please use CTLFLAG_RWTUN flag here.
>
>> +&zfs_write_to_degraded, 0,
>> +"Allow writing data to degraded vdevs");
> BTW. Those two lines fit into 80 chars just fine.
>
>> +TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded);

Changed.
Thanks

-- 
Martin Matuska
FreeBSD committer
http://blog.vx.sk

___
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: r246774 - head/sys/amd64/vmm

2013-02-13 Thread Neel Natu
Author: neel
Date: Wed Feb 13 23:22:17 2013
New Revision: 246774
URL: http://svnweb.freebsd.org/changeset/base/246774

Log:
  Requests for invalid CPUID leaves should map to the highest known leaf 
instead.
  
  Reviewed by:  grehan
  Obtained from:NetApp

Modified:
  head/sys/amd64/vmm/x86.c

Modified: head/sys/amd64/vmm/x86.c
==
--- head/sys/amd64/vmm/x86.cWed Feb 13 23:11:25 2013(r246773)
+++ head/sys/amd64/vmm/x86.cWed Feb 13 23:22:17 2013(r246774)
@@ -54,8 +54,6 @@ x86_emulate_cpuid(struct vm *vm, int vcp
unsigned intfunc, regs[4];
enum x2apic_state x2apic_state;
 
-   func = *eax;
-
/*
 * Requests for invalid CPUID levels should map to the highest
 * available level instead.
@@ -70,6 +68,8 @@ x86_emulate_cpuid(struct vm *vm, int vcp
*eax = cpu_high;
}
 
+   func = *eax;
+
/*
 * In general the approach used for CPU topology is to
 * advertise a flat topology where all CPUs are packages with
___
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: r246775 - in stable/9: lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/ia64/sys lib/libc/mips/sys lib/libc/powerpc lib/libc/powerpc/sys lib/libc/powerpc64 lib/libc/powerp...

2013-02-13 Thread Konstantin Belousov
Author: kib
Date: Wed Feb 13 23:25:11 2013
New Revision: 246775
URL: http://svnweb.freebsd.org/changeset/base/246775

Log:
  MFC r246117:
  Rework the __vdso_* symbols attributes to only make the symbols weak,
  but use normal references instead of weak. This makes the statically
  linked binaries to use fast gettimeofday(2) by forcing the linker to
  resolve references and providing the neccessary functions.

Added:
  stable/9/lib/libc/arm/sys/__vdso_gettc.c
 - copied unchanged from r246117, head/lib/libc/arm/sys/__vdso_gettc.c
  stable/9/lib/libc/ia64/sys/__vdso_gettc.c
 - copied unchanged from r246117, head/lib/libc/ia64/sys/__vdso_gettc.c
  stable/9/lib/libc/mips/sys/__vdso_gettc.c
 - copied unchanged from r246117, head/lib/libc/mips/sys/__vdso_gettc.c
  stable/9/lib/libc/powerpc/sys/__vdso_gettc.c
 - copied unchanged from r246117, head/lib/libc/powerpc/sys/__vdso_gettc.c
  stable/9/lib/libc/powerpc64/sys/__vdso_gettc.c
 - copied unchanged from r246117, head/lib/libc/powerpc64/sys/__vdso_gettc.c
  stable/9/lib/libc/sparc64/sys/__vdso_gettc.c
 - copied unchanged from r246117, head/lib/libc/sparc64/sys/__vdso_gettc.c
Modified:
  stable/9/lib/libc/amd64/sys/__vdso_gettc.c
  stable/9/lib/libc/arm/sys/Makefile.inc
  stable/9/lib/libc/i386/sys/__vdso_gettc.c
  stable/9/lib/libc/ia64/sys/Makefile.inc
  stable/9/lib/libc/mips/sys/Makefile.inc
  stable/9/lib/libc/powerpc/Makefile.inc
  stable/9/lib/libc/powerpc64/Makefile.inc
  stable/9/lib/libc/sparc64/Makefile.inc
  stable/9/lib/libc/sys/__vdso_gettimeofday.c
  stable/9/lib/libc/sys/gettimeofday.c
  stable/9/sys/sys/vdso.h
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/lib/libc/amd64/sys/__vdso_gettc.c
==
--- stable/9/lib/libc/amd64/sys/__vdso_gettc.c  Wed Feb 13 23:22:17 2013
(r246774)
+++ stable/9/lib/libc/amd64/sys/__vdso_gettc.c  Wed Feb 13 23:25:11 2013
(r246775)
@@ -27,9 +27,11 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include "libc_private.h"
 
 static u_int
 __vdso_gettc_low(const struct vdso_timehands *th)
@@ -41,9 +43,18 @@ __vdso_gettc_low(const struct vdso_timeh
return (rv);
 }
 
+#pragma weak __vdso_gettc
 u_int
 __vdso_gettc(const struct vdso_timehands *th)
 {
 
return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32());
 }
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+   return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk)));
+}

Modified: stable/9/lib/libc/arm/sys/Makefile.inc
==
--- stable/9/lib/libc/arm/sys/Makefile.inc  Wed Feb 13 23:22:17 2013
(r246774)
+++ stable/9/lib/libc/arm/sys/Makefile.inc  Wed Feb 13 23:25:11 2013
(r246775)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+SRCS+= __vdso_gettc.c
+
 MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S 
syscall.S
 
 # Don't generate default code for these syscalls:

Copied: stable/9/lib/libc/arm/sys/__vdso_gettc.c (from r246117, 
head/lib/libc/arm/sys/__vdso_gettc.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/lib/libc/arm/sys/__vdso_gettc.cWed Feb 13 23:25:11 2013
(r246775, copy of r246117, head/lib/libc/arm/sys/__vdso_gettc.c)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#i

svn commit: r246778 - head/usr.sbin/nfsd

2013-02-13 Thread Xin LI
Author: delphij
Date: Thu Feb 14 01:01:53 2013
New Revision: 246778
URL: http://svnweb.freebsd.org/changeset/base/246778

Log:
  Use static for all functions that do not need to be exported.
  
  MFC after:2 weeks

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

Modified: head/usr.sbin/nfsd/nfsd.c
==
--- head/usr.sbin/nfsd/nfsd.c   Thu Feb 14 00:56:39 2013(r246777)
+++ head/usr.sbin/nfsd/nfsd.c   Thu Feb 14 01:01:53 2013(r246778)
@@ -105,20 +105,20 @@ static struct option longopts[] = {
{ NULL, 0, NULL, 0}
 };
 
-void   cleanup(int);
-void   child_cleanup(int);
-void   killchildren(void);
-void   nfsd_exit(int);
-void   nonfs(int);
-void   reapchild(int);
-intsetbindhost(struct addrinfo **ia, const char *bindhost,
-   struct addrinfo hints);
-void   start_server(int);
-void   unregistration(void);
-void   usage(void);
-void   open_stable(int *, int *);
-void   copy_stable(int, int);
-void   backup_stable(int);
+static voidcleanup(int);
+static voidchild_cleanup(int);
+static voidkillchildren(void);
+static voidnfsd_exit(int);
+static voidnonfs(int);
+static voidreapchild(int);
+static int setbindhost(struct addrinfo **ia, const char *bindhost,
+   struct addrinfo hints);
+static voidstart_server(int);
+static voidunregistration(void);
+static voidusage(void);
+static voidopen_stable(int *, int *);
+static voidcopy_stable(int, int);
+static voidbackup_stable(int);
 
 /*
  * Nfs server daemon mostly just a user context for nfssvc()
@@ -844,7 +844,7 @@ main(int argc, char **argv)
}
 }
 
-int
+static int
 setbindhost(struct addrinfo **ai, const char *bindhost, struct addrinfo hints)
 {
int ecode;
@@ -890,20 +890,20 @@ setbindhost(struct addrinfo **ai, const 
return (0);
 }
 
-void
+static void
 usage(void)
 {
(void)fprintf(stderr, "%s", getopt_usage);
exit(1);
 }
 
-void
+static void
 nonfs(__unused int signo)
 {
syslog(LOG_ERR, "missing system call: NFS not available");
 }
 
-void
+static void
 reapchild(__unused int signo)
 {
pid_t pid;
@@ -916,7 +916,7 @@ reapchild(__unused int signo)
}
 }
 
-void
+static void
 unregistration(void)
 {
if ((!rpcb_unset(NFS_PROGRAM, 2, NULL)) ||
@@ -924,7 +924,7 @@ unregistration(void)
syslog(LOG_ERR, "rpcb_unset failed");
 }
 
-void
+static void
 killchildren(void)
 {
int i;
@@ -938,7 +938,7 @@ killchildren(void)
 /*
  * Cleanup master after SIGUSR1.
  */
-void
+static void
 cleanup(__unused int signo)
 {
nfsd_exit(0);
@@ -947,13 +947,13 @@ cleanup(__unused int signo)
 /*
  * Cleanup child after SIGUSR1.
  */
-void
+static void
 child_cleanup(__unused int signo)
 {
exit(0);
 }
 
-void
+static void
 nfsd_exit(int status)
 {
killchildren();
@@ -984,7 +984,7 @@ get_tuned_nfsdcount(void)
return tuned_nfsdcnt;
 }
 
-void
+static void
 start_server(int master)
 {
char principal[MAXHOSTNAMELEN + 5];
@@ -1066,7 +1066,7 @@ start_server(int master)
 /*
  * Open the stable restart file and return the file descriptor for it.
  */
-void
+static void
 open_stable(int *stable_fdp, int *backup_fdp)
 {
int stable_fd, backup_fd = -1, ret;
@@ -1118,7 +1118,7 @@ open_stable(int *stable_fdp, int *backup
 /*
  * Copy the stable restart file to the backup or vice versa.
  */
-void
+static void
 copy_stable(int from_fd, int to_fd)
 {
int cnt, ret;
@@ -1146,7 +1146,7 @@ copy_stable(int from_fd, int to_fd)
 /*
  * Back up the stable restart file when indicated by the kernel.
  */
-void
+static void
 backup_stable(__unused int signo)
 {
 
___
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: r246780 - head/usr.sbin/nfsd

2013-02-13 Thread Xin LI
Author: delphij
Date: Thu Feb 14 01:25:14 2013
New Revision: 246780
URL: http://svnweb.freebsd.org/changeset/base/246780

Log:
  Abstract out setting of nfsdcnt and consistently use MAXNFSDCNT when the
  proposed value is too high and DEFNFSDCNT when proposed value is too low.
  
  MFC after:2 weeks

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

Modified: head/usr.sbin/nfsd/nfsd.c
==
--- head/usr.sbin/nfsd/nfsd.c   Thu Feb 14 01:20:26 2013(r246779)
+++ head/usr.sbin/nfsd/nfsd.c   Thu Feb 14 01:25:14 2013(r246780)
@@ -119,6 +119,7 @@ static void usage(void);
 static voidopen_stable(int *, int *);
 static voidcopy_stable(int, int);
 static voidbackup_stable(int);
+static voidset_nfsdcnt(int);
 
 /*
  * Nfs server daemon mostly just a user context for nfssvc()
@@ -178,8 +179,7 @@ main(int argc, char **argv)
bindanyflag = 1;
break;
case 'n':
-   nfsdcnt_set = 1;
-   nfsdcnt = atoi(optarg);
+   set_nfsdcnt(atoi(optarg));
break;
case 'h':
bindhostc++;
@@ -235,15 +235,8 @@ main(int argc, char **argv)
 */
if (argc > 1)
usage();
-   if (argc == 1) {
-   nfsdcnt_set = 1;
-   nfsdcnt = atoi(argv[0]);
-   if (nfsdcnt < 1 || nfsdcnt > MAXNFSDCNT) {
-   warnx("nfsd count %d; reset to %d", nfsdcnt,
-   DEFNFSDCNT);
-   nfsdcnt = DEFNFSDCNT;
-   }
-   }
+   if (argc == 1)
+   set_nfsdcnt(atoi(argv[0]));
 
/*
 * Unless the "-o" option was specified, try and run "nfsd".
@@ -429,16 +422,6 @@ main(int argc, char **argv)
}
 
if (!new_syscall) {
-   if (nfsdcnt < 1) {
-   warnx("nfsd count too low %d; reset to %d", nfsdcnt,
-   DEFNFSDCNT);
-   nfsdcnt = DEFNFSDCNT;
-   }
-   if (nfsdcnt > MAXNFSDCNT) {
-   warnx("nfsd count too high %d; reset to %d", nfsdcnt,
-   DEFNFSDCNT);
-   nfsdcnt = MAXNFSDCNT;
-   }
/* If we use UDP only, we start the last server below. */
srvcnt = tcpflag ? nfsdcnt : nfsdcnt - 1;
for (i = 0; i < srvcnt; i++) {
@@ -891,6 +874,23 @@ setbindhost(struct addrinfo **ai, const 
 }
 
 static void
+set_nfsdcnt(int proposed)
+{
+
+   if (proposed < 1) {
+   warnx("nfsd count too low %d; reset to %d", proposed,
+   DEFNFSDCNT);
+   nfsdcnt = DEFNFSDCNT;
+   } else if (proposed > MAXNFSDCNT) {
+   warnx("nfsd count too high %d; truncated to %d", proposed,
+   MAXNFSDCNT);
+   nfsdcnt = MAXNFSDCNT;
+   } else
+   nfsdcnt = proposed;
+   nfsdcnt_set = 1;
+}
+
+static void
 usage(void)
 {
(void)fprintf(stderr, "%s", getopt_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: r246781 - head/usr.sbin/nfsd

2013-02-13 Thread Xin LI
Author: delphij
Date: Thu Feb 14 02:00:41 2013
New Revision: 246781
URL: http://svnweb.freebsd.org/changeset/base/246781

Log:
  Simplify r243637 and make sure that nfsdargs.{min,max}threads are always set
  to meaningful value:
  
   - When nfsdcnt is set, it dictates all values;
   - Otherwise, nfsdargs.minthreads is set to user specified value, or the
 automatically detected value if there is no one specified;
 nfsdargs.maxthreads is set to the user specified value, or the value
 of nfsdargs.minthreads if there is no one specified; when it is smaller
 than nfsdargs.minthreads, the latter's value is always used.
  
  MFC after:2 weeks

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

Modified: head/usr.sbin/nfsd/nfsd.c
==
--- head/usr.sbin/nfsd/nfsd.c   Thu Feb 14 01:25:14 2013(r246780)
+++ head/usr.sbin/nfsd/nfsd.c   Thu Feb 14 02:00:41 2013(r246781)
@@ -1014,26 +1014,13 @@ start_server(int master)
}
nfsdargs.principal = principal;
 
-   if (minthreads_set) {
-   nfsdargs.minthreads = minthreads;
-   if (!maxthreads_set)
-   nfsdargs.maxthreads = minthreads;
-   }
-   if (maxthreads_set) {
-   nfsdargs.maxthreads = maxthreads;
-   if (!minthreads_set)
-   nfsdargs.minthreads = maxthreads;
-   }
-   if (nfsdcnt_set) {
-   nfsdargs.minthreads = nfsdcnt;
-   nfsdargs.maxthreads = nfsdcnt;
-   }
-   if (!minthreads_set && !maxthreads_set && !nfsdcnt_set) {
-   int tuned_nfsdcnt;
-
-   tuned_nfsdcnt = get_tuned_nfsdcount();
-   nfsdargs.minthreads = tuned_nfsdcnt;
-   nfsdargs.maxthreads = tuned_nfsdcnt;
+   if (nfsdcnt_set)
+   nfsdargs.minthreads = nfsdargs.maxthreads = nfsdcnt;
+   else {
+   nfsdargs.minthreads = minthreads_set ? minthreads : 
get_tuned_nfsdcount();
+   nfsdargs.maxthreads = maxthreads_set ? maxthreads : 
nfsdargs.minthreads;
+   if (nfsdargs.maxthreads < nfsdargs.minthreads)
+   nfsdargs.maxthreads = nfsdargs.minthreads;
}
error = nfssvc(nfssvc_nfsd, &nfsdargs);
if (error < 0 && errno == EAUTH) {
___
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"