Re: svn commit: r257184 - in head/sys/dev: mii usb/net xl

2013-10-27 Thread Gleb Smirnoff
On Sat, Oct 26, 2013 at 06:57:04PM -0700, Adrian Chadd wrote:
A> hm, so none of the modified PHYs nor their consumers will get upset?
A> Eg, if the NIC is down, is touching the PHY registers going to be a
A> problem?

The IFF_UP was always an administrative flag. I believe drivers initialize
all their resources before being set an address with SIOCSIFADDR.

If a driver doesn't, then the previous code still was racy.

Anyway, I am going to handle any fallouts.


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


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

2013-10-27 Thread Hans Petter Selasky
Author: hselasky
Date: Sun Oct 27 10:09:53 2013
New Revision: 257206
URL: http://svnweb.freebsd.org/changeset/base/257206

Log:
  Fix a deadlock when trying to power off a USB device. The deadlock
  happens because the code in question is trying to modify the parent
  USB port registers outside the USB explore thread.
  
  MFC after:3 days

Modified:
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c

Modified: head/sys/dev/usb/usb_dev.c
==
--- head/sys/dev/usb/usb_dev.c  Sun Oct 27 04:59:18 2013(r257205)
+++ head/sys/dev/usb/usb_dev.c  Sun Oct 27 10:09:53 2013(r257206)
@@ -1099,7 +1099,7 @@ usb_ioctl(struct cdev *dev, u_long cmd, 
 
/* Wait for re-enumeration, if any */
 
-   while (f->udev->re_enumerate_wait != 0) {
+   while (f->udev->re_enumerate_wait != USB_RE_ENUM_DONE) {
 
usb_unref_device(cpd, &refs);
 

Modified: head/sys/dev/usb/usb_device.h
==
--- head/sys/dev/usb/usb_device.h   Sun Oct 27 04:59:18 2013
(r257205)
+++ head/sys/dev/usb/usb_device.h   Sun Oct 27 10:09:53 2013
(r257206)
@@ -238,6 +238,9 @@ struct usb_device {
uint8_t driver_added_refcount;  /* our driver added generation count */
uint8_t power_mode; /* see USB_POWER_XXX */
uint8_t re_enumerate_wait;  /* set if re-enum. is in progress */
+#defineUSB_RE_ENUM_DONE0
+#defineUSB_RE_ENUM_START   1
+#defineUSB_RE_ENUM_PWR_OFF 2
uint8_t ifaces_max; /* number of interfaces present */
uint8_t endpoints_max;  /* number of endpoints present */
 

Modified: head/sys/dev/usb/usb_generic.c
==
--- head/sys/dev/usb/usb_generic.c  Sun Oct 27 04:59:18 2013
(r257205)
+++ head/sys/dev/usb/usb_generic.c  Sun Oct 27 10:09:53 2013
(r257206)
@@ -1762,16 +1762,11 @@ ugen_set_power_mode(struct usb_fifo *f, 
 
switch (mode) {
case USB_POWER_MODE_OFF:
-   /* get the device unconfigured */
-   err = ugen_set_config(f, USB_UNCONFIG_INDEX);
-   if (err) {
-   DPRINTFN(0, "Could not unconfigure "
-   "device (ignored)\n");
+   if (udev->flags.usb_mode == USB_MODE_HOST &&
+   udev->re_enumerate_wait == USB_RE_ENUM_DONE) {
+   udev->re_enumerate_wait = USB_RE_ENUM_PWR_OFF;
}
-
-   /* clear port enable */
-   err = usbd_req_clear_port_feature(udev->parent_hub,
-   NULL, udev->port_no, UHF_PORT_ENABLE);
+   /* set power mode will wake up the explore thread */
break;
 
case USB_POWER_MODE_ON:
@@ -1819,9 +1814,9 @@ ugen_set_power_mode(struct usb_fifo *f, 
 
/* if we are powered off we need to re-enumerate first */
if (old_mode == USB_POWER_MODE_OFF) {
-   if (udev->flags.usb_mode == USB_MODE_HOST) {
-   if (udev->re_enumerate_wait == 0)
-   udev->re_enumerate_wait = 1;
+   if (udev->flags.usb_mode == USB_MODE_HOST &&
+   udev->re_enumerate_wait == USB_RE_ENUM_DONE) {
+   udev->re_enumerate_wait = USB_RE_ENUM_START;
}
/* set power mode will wake up the explore thread */
}

Modified: head/sys/dev/usb/usb_hub.c
==
--- head/sys/dev/usb/usb_hub.c  Sun Oct 27 04:59:18 2013(r257205)
+++ head/sys/dev/usb/usb_hub.c  Sun Oct 27 10:09:53 2013(r257206)
@@ -248,7 +248,8 @@ uhub_explore_sub(struct uhub_softc *sc, 
uint8_t do_unlock;

do_unlock = usbd_enum_lock(child);
-   if (child->re_enumerate_wait) {
+   switch (child->re_enumerate_wait) {
+   case USB_RE_ENUM_START:
err = usbd_set_config_index(child,
USB_UNCONFIG_INDEX);
if (err != 0) {
@@ -263,8 +264,33 @@ uhub_explore_sub(struct uhub_softc *sc, 
err = usb_probe_and_attach(child,
USB_IFACE_INDEX_ANY);
}
-   child->re_enumerate_wait = 0;
+   child->re_enumerate_wait = USB_RE_ENUM_DONE;
err = 0;
+   break;
+
+   case USB_RE_ENUM_PWR_OFF:
+   /* get the device unconfigured */
+   err = usbd_set_config_index(child,
+   USB_UNCONFIG_INDEX);
+

Re: svn commit: r257133 - head/sys/dev/iwn

2013-10-27 Thread Stefan Farfeleder
On Fri, Oct 25, 2013 at 07:44:54PM +, Adrian Chadd wrote:
> Author: adrian
> Date: Fri Oct 25 19:44:53 2013
> New Revision: 257133
> URL: http://svnweb.freebsd.org/changeset/base/257133
> 
> Log:
>   Temporarily disable multi-rate retry (link quality) and eliminate rate
>   index lookups.
>   
>   * My recent(ish) change to iwn(4) and the net80211 rate control API to
> support 11n rates broke the link quality table use.  So, until I or
> someone else decides to fix it, let's just disable it for now.
>   
>   * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function.
>   
>   * Eliminate two uses of the net80211 rate index lookup functions - they
> are only for legacy rates and they're not needed here.
>   
>   This fixes some invalid looking rate control TX issues that showed up
>   on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look
>   like DMA related issues.
>   
>   Tested:
>   
>   * 4965, STA mode
>   * 5100, STA mode

Hi Adrian,

this change completely broke iwn for me. It's a

iwn0:  mem 0xf1ffe000-0xf1ff irq 17 at device 0.0 on 
pci12

built-in device in a Dell Precision m4400.

With this change, wpa_supplicant cannot associate any longer. In the
logs I see every few seconds

Oct 27 10:57:37 mole wpa_supplicant[2256]: wlan0: Trying to associate with 
xx:xx:xx:xx:xx:xx (SSID='xx' freq=2427 MHz)
Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: Authentication with 
xx:xx:xx:xx:xx:xx timed out.
Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: CTRL-EVENT-DISCONNECTED 
bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1

If I revert just this revision based on a r257155 checkout, it works
again.

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


svn commit: r257207 - head/lib/msun/arm

2013-10-27 Thread Andrew Turner
Author: andrew
Date: Sun Oct 27 10:44:22 2013
New Revision: 257207
URL: http://svnweb.freebsd.org/changeset/base/257207

Log:
  Update the hard-float version of the fenv functions to use the VFP unit.
  Any other floating-point unit is unsupported on ARM.

Modified:
  head/lib/msun/arm/fenv.h

Modified: head/lib/msun/arm/fenv.h
==
--- head/lib/msun/arm/fenv.hSun Oct 27 10:09:53 2013(r257206)
+++ head/lib/msun/arm/fenv.hSun Oct 27 10:44:22 2013(r257207)
@@ -44,14 +44,27 @@ typedef __uint32_t  fexcept_t;
 #defineFE_OVERFLOW 0x0004
 #defineFE_UNDERFLOW0x0008
 #defineFE_INEXACT  0x0010
+#ifdef __ARM_PCS_VFP
+#defineFE_DENORMAL 0x0080
+#defineFE_ALL_EXCEPT   (FE_DIVBYZERO | FE_INEXACT | \
+FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW | FE_DENORMAL)
+#else
 #defineFE_ALL_EXCEPT   (FE_DIVBYZERO | FE_INEXACT | \
 FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
+#endif
 
 /* Rounding modes */
+#ifdef __ARM_PCS_VFP
+#defineFE_TONEAREST0x
+#defineFE_UPWARD   0x0040
+#defineFE_DOWNWARD 0x0080
+#defineFE_TOWARDZERO   0x00c0
+#else
 #defineFE_TONEAREST0x
 #defineFE_TOWARDZERO   0x0001
 #defineFE_UPWARD   0x0002
 #defineFE_DOWNWARD 0x0003
+#endif
 #define_ROUND_MASK (FE_TONEAREST | FE_DOWNWARD | \
 FE_UPWARD | FE_TOWARDZERO)
 __BEGIN_DECLS
@@ -61,10 +74,12 @@ extern const fenv_t __fe_dfl_env;
 #defineFE_DFL_ENV  (&__fe_dfl_env)
 
 /* We need to be able to map status flag positions to mask flag positions */
-#define _FPUSW_SHIFT   16
+#ifndef __ARM_PCS_VFP
+#define_FPUSW_SHIFT16
 #define_ENABLE_MASK(FE_ALL_EXCEPT << _FPUSW_SHIFT)
+#endif
 
-#ifndefARM_HARD_FLOAT
+#ifndef __ARM_PCS_VFP
 
 int feclearexcept(int __excepts);
 int fegetexceptflag(fexcept_t *__flagp, int __excepts);
@@ -78,19 +93,19 @@ int feholdexcept(fenv_t *__envp);
 int fesetenv(const fenv_t *__envp);
 int feupdateenv(const fenv_t *__envp);
 
-#else  /* ARM_HARD_FLOAT */
+#else  /* __ARM_PCS_VFP */
 
-#define__rfs(__fpsr)   __asm __volatile("rfs %0" : "=r" (*(__fpsr)))
-#define__wfs(__fpsr)   __asm __volatile("wfs %0" : : "r" (__fpsr))
+#definevmrs_fpscr(__r) __asm __volatile("vmrs %0, fpscr" : "=&r"(__r))
+#definevmsr_fpscr(__r) __asm __volatile("vmsr fpscr, %0" : : "r"(__r))
 
 __fenv_static inline int
 feclearexcept(int __excepts)
 {
fexcept_t __fpsr;
 
-   __rfs(&__fpsr);
+   vmrs_fpscr(__fpsr);
__fpsr &= ~__excepts;
-   __wfs(__fpsr);
+   vmsr_fpscr(__fpsr);
return (0);
 }
 
@@ -99,7 +114,7 @@ fegetexceptflag(fexcept_t *__flagp, int 
 {
fexcept_t __fpsr;
 
-   __rfs(&__fpsr);
+   vmrs_fpscr(__fpsr);
*__flagp = __fpsr & __excepts;
return (0);
 }
@@ -109,10 +124,10 @@ fesetexceptflag(const fexcept_t *__flagp
 {
fexcept_t __fpsr;
 
-   __rfs(&__fpsr);
+   vmrs_fpscr(__fpsr);
__fpsr &= ~__excepts;
__fpsr |= *__flagp & __excepts;
-   __wfs(__fpsr);
+   vmsr_fpscr(__fpsr);
return (0);
 }
 
@@ -130,34 +145,36 @@ fetestexcept(int __excepts)
 {
fexcept_t __fpsr;
 
-   __rfs(&__fpsr);
+   vmrs_fpscr(__fpsr);
return (__fpsr & __excepts);
 }
 
 __fenv_static inline int
 fegetround(void)
 {
+   fenv_t __fpsr;
 
-   /*
-* Apparently, the rounding mode is specified as part of the
-* instruction format on ARM, so the dynamic rounding mode is
-* indeterminate.  Some FPUs may differ.
-*/
-   return (-1);
+   vmrs_fpscr(__fpsr);
+   return (__fpsr & _ROUND_MASK);
 }
 
 __fenv_static inline int
 fesetround(int __round)
 {
+   fenv_t __fpsr;
 
-   return (-1);
+   vmrs_fpscr(__fpsr);
+   __fpsr &= ~(_ROUND_MASK);
+   __fpsr |= __round;
+   vmsr_fpscr(__fpsr);
+   return (0);
 }
 
 __fenv_static inline int
 fegetenv(fenv_t *__envp)
 {
 
-   __rfs(__envp);
+   vmrs_fpscr(*__envp);
return (0);
 }
 
@@ -166,10 +183,10 @@ feholdexcept(fenv_t *__envp)
 {
fenv_t __env;
 
-   __rfs(&__env);
+   vmrs_fpscr(__env);
*__envp = __env;
-   __env &= ~(FE_ALL_EXCEPT | _ENABLE_MASK);
-   __wfs(__env);
+   __env &= ~(FE_ALL_EXCEPT);
+   vmsr_fpscr(__env);
return (0);
 }
 
@@ -177,7 +194,7 @@ __fenv_static inline int
 fesetenv(const fenv_t *__envp)
 {
 
-   __wfs(*__envp);
+   vmsr_fpscr(*__envp);
return (0);
 }
 
@@ -186,8 +203,8 @@ feupdateenv(const fenv_t *__envp)
 {
fexcept_t __fpsr;
 
-   __rfs(&__fpsr);
-   __wfs(*__envp);
+   vmrs_fpscr(__fpsr);
+   vmsr_fpscr(*__envp);
feraiseexcept(__fpsr & FE_ALL_EXCEPT);
return (0);
 }

svn commit: r257209 - head/sys/powerpc/include

2013-10-27 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct 27 14:03:51 2013
New Revision: 257209
URL: http://svnweb.freebsd.org/changeset/base/257209

Log:
  Turn on VM_KMEM_SIZE_SCALE on 32-bit as well as 64-bit PowerPC.
  
  Requested by: alc
  MFC after:1 month

Modified:
  head/sys/powerpc/include/vmparam.h

Modified: head/sys/powerpc/include/vmparam.h
==
--- head/sys/powerpc/include/vmparam.h  Sun Oct 27 10:51:34 2013
(r257208)
+++ head/sys/powerpc/include/vmparam.h  Sun Oct 27 14:03:51 2013
(r257209)
@@ -112,6 +112,7 @@
 
 #defineVM_MIN_KERNEL_ADDRESS   KERNBASE
 #defineVM_MAX_KERNEL_ADDRESS   0xf800
+#defineVM_MAX_SAFE_KERNEL_ADDRESS  VM_MAX_KERNEL_ADDRESS
 
 #endif /* AIM/E500 */
 
@@ -175,14 +176,21 @@ struct pmap_physseg {
 #defineVM_KMEM_SIZE(12 * 1024 * 1024)
 #endif
 
-#ifdef __powerpc64__
+/*
+ * How many physical pages per KVA page allocated.
+ * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX)
+ * is the total KVA space allocated for kmem_map.
+ */
 #ifndef VM_KMEM_SIZE_SCALE
-#define VM_KMEM_SIZE_SCALE  (3)
+#define VM_KMEM_SIZE_SCALE (3)
 #endif
 
+/*
+ * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space.
+ */
 #ifndef VM_KMEM_SIZE_MAX
-#define VM_KMEM_SIZE_MAX0x1c000  /* 7 GB */
-#endif
+#define VM_KMEM_SIZE_MAX   ((VM_MAX_SAFE_KERNEL_ADDRESS - \
+VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
 #endif
 
 #defineZERO_REGION_SIZE(64 * 1024) /* 64KB */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257210 - head/sys/boot/arm/uboot

2013-10-27 Thread Andrew Turner
Author: andrew
Date: Sun Oct 27 14:27:11 2013
New Revision: 257210
URL: http://svnweb.freebsd.org/changeset/base/257210

Log:
  Always build ubldr as a soft-float binary as there is no support for VFP
  this early on in the boot process.

Modified:
  head/sys/boot/arm/uboot/Makefile

Modified: head/sys/boot/arm/uboot/Makefile
==
--- head/sys/boot/arm/uboot/MakefileSun Oct 27 14:03:51 2013
(r257209)
+++ head/sys/boot/arm/uboot/MakefileSun Oct 27 14:27:11 2013
(r257210)
@@ -90,7 +90,7 @@ CFLAGS+=  -I.
 
 CLEANFILES+=   vers.c loader.help
 
-CFLAGS+=   -ffreestanding
+CFLAGS+=   -ffreestanding -msoft-float
 
 LDFLAGS=   -nostdlib -static
 LDFLAGS+=  -T ldscript.generated
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257212 - in head/cddl: contrib/opensolaris/cmd/lockstat usr.sbin/lockstat

2013-10-27 Thread Mark Johnston
Author: markj
Date: Sun Oct 27 16:01:11 2013
New Revision: 257212
URL: http://svnweb.freebsd.org/changeset/base/257212

Log:
  Convert the lockstat(1) man page to mdoc and make sure that it gets
  installed. Additionally, remove Solaris-specific sections and references,
  and replace example outputs with output from lockstat on FreeBSD, since
  lockstat's output contains stack traces.
  
  This change also removes some examples that don't seem to work properly on
  FreeBSD. The examples should be re-added when lockstat is fixed.
  
  Reported by:  avg
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
  head/cddl/usr.sbin/lockstat/Makefile

Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
==
--- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1   Sun Oct 27 
15:14:27 2013(r257211)
+++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1   Sun Oct 27 
16:01:11 2013(r257212)
@@ -2,7 +2,7 @@
 .\" CDDL HEADER START
 .\"
 .\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").  
+.\" Common Development and Distribution License (the "License").
 .\" You may not use this file except in compliance with the License.
 .\"
 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
@@ -18,858 +18,382 @@
 .\"
 .\" CDDL HEADER END
 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
-.TH lockstat 1M "28 Feb 2008" "SunOS 5.11" "System Administration Commands"
-.SH NAME
-lockstat \- report kernel lock and profiling statistics
-.SH SYNOPSIS
-.LP
-.nf
-\fBlockstat\fR [\fB-ACEHI\fR] [\fB-e\fR \fIevent_list\fR] [\fB-i\fR 
\fIrate\fR] 
-[\fB-b\fR | \fB-t\fR | \fB-h\fR | \fB-s\fR \fIdepth\fR] [\fB-n\fR 
\fInrecords\fR] 
-[\fB-l\fR \fIlock\fR [, \fIsize\fR]] [\fB-d\fR \fIduration\fR] 
-[\fB-f\fR \fIfunction\fR [, \fIsize\fR]] [\fB-T\fR] [\fB-ckgwWRpP\fR] 
[\fB-D\fR \fIcount\fR] 
-[\fB-o\fR \fIfilename\fR] [\fB-x\fR \fIopt\fR [=val]] \fIcommand\fR 
[\fIargs\fR]
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fBlockstat\fR utility gathers and displays kernel locking and profiling 
statistics. \fBlockstat\fR allows you to specify which events to watch (for 
example, spin on adaptive mutex, block on read access to rwlock due to waiting 
writers, and so forth) how much
-data to gather for each event, and how to display the data. By default, 
\fBlockstat\fR monitors all lock contention events, gathers frequency and 
timing data about those events, and displays the data in decreasing frequency 
order, so that the most common events appear first.
-.sp
-.LP
-\fBlockstat\fR gathers data until the specified command completes. For 
example, to gather statistics for a fixed-time interval, use \fBsleep\fR(1) as
-the command, as follows:
-.sp
-.LP
-\fBexample#\fR \fBlockstat\fR \fBsleep\fR \fB5\fR
-.sp
-.LP
-When the \fB-I\fR option is specified, \fBlockstat\fR establishes a 
per-processor high-level periodic interrupt source to gather profiling data. 
The interrupt handler simply generates a \fBlockstat\fR event whose caller is 
the interrupted PC (program counter).
-The profiling event is just like any other \fBlockstat\fR event, so all of the 
normal \fBlockstat\fR options are applicable.
-.sp
-.LP
-\fBlockstat\fR relies on DTrace to modify the running kernel's text to 
intercept events of interest. This imposes a small but measurable overhead on 
all system activity, so access to \fBlockstat\fR is restricted to super-user by 
default. The system administrator
-can permit other users to use \fBlockstat\fR by granting them additional 
DTrace privileges. Refer to the \fISolaris Dynamic Tracing Guide\fR for more 
information about DTrace security features.
-.SH OPTIONS
-.sp
-.LP
-The following options are supported: 
-.SS "Event Selection"
-.sp
-.LP
-If no event selection options are specified, the default is \fB-C\fR.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-A\fR\fR
-.ad
-.sp .6
-.RS 4n
-Watch all lock events. \fB-A\fR is equivalent to \fB-CH\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-C\fR\fR
-.ad
-.sp .6
-.RS 4n
-Watch contention events. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-E\fR\fR
-.ad
-.sp .6
-.RS 4n
+.\"
+.\" $FreeBSD$
+.\"
+.Dd October 24, 2013
+.Dt LOCKSTAT 1
+.Os
+.Sh NAME
+.Nm lockstat
+.Nd report kernel lock and profiling statistics
+.Sh SYNOPSIS
+.Nm
+.Op Fl ACEHI
+.Op Fl e Ar event-list
+.Op Fl i Ar rate
+.Op Fl b | t | h | s Ar depth
+.Op Fl n Ar num-records
+.Op Fl l Ar lock Oo Ns , Ns Ar size Oc
+.Op Fl d Ar duration
+.Op Fl f Ar function Oo Ns , Ns Ar size Oc
+.Op Fl T
+.Op Fl ckgwWRpP
+.Op Fl D Ar count
+.Op Fl o filename
+.Op Fl x Ar opt Oo Ns = Ns Ar val Oc
+.Ar command
+.Op Oo Ar args Oc
+.Sh DESCRIPTION
+The
+.Nm
+utility gathers and displays kernel locking and profiling statistics.
+.Nm
+allows you to specify which events to watch (for example, spin on adaptive
+mutex, 

Re: svn commit: r257184 - in head/sys/dev: mii usb/net xl

2013-10-27 Thread Adrian Chadd
Cool.

Just make sure you check the odd ones like USB, where ejecting may
occur during or just before the callout runs, and the callout tries
accessing registers that aren't there.

Sure the previous was racy, but it may have been "not racy enough" to
cause most people to never see a panic.



-adrian


On 27 October 2013 00:19, Gleb Smirnoff  wrote:
> On Sat, Oct 26, 2013 at 06:57:04PM -0700, Adrian Chadd wrote:
> A> hm, so none of the modified PHYs nor their consumers will get upset?
> A> Eg, if the NIC is down, is touching the PHY registers going to be a
> A> problem?
>
> The IFF_UP was always an administrative flag. I believe drivers initialize
> all their resources before being set an address with SIOCSIFADDR.
>
> If a driver doesn't, then the previous code still was racy.
>
> Anyway, I am going to handle any fallouts.
>
>
> --
> Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257133 - head/sys/dev/iwn

2013-10-27 Thread Adrian Chadd
Hm, ok.

Can you compile it with IWN_DEBUG and IEEE80211_DEBUG, then do this:

sysctl dev.iwn.0.debug=0x1
wlandebug +rate

I'd like to see what the selected rate is and what the logged reason
for failing to transmit is.

I have a 5100 and it works totally fine for me.

Thanks!



-adrian


On 27 October 2013 03:11, Stefan Farfeleder  wrote:
> On Fri, Oct 25, 2013 at 07:44:54PM +, Adrian Chadd wrote:
>> Author: adrian
>> Date: Fri Oct 25 19:44:53 2013
>> New Revision: 257133
>> URL: http://svnweb.freebsd.org/changeset/base/257133
>>
>> Log:
>>   Temporarily disable multi-rate retry (link quality) and eliminate rate
>>   index lookups.
>>
>>   * My recent(ish) change to iwn(4) and the net80211 rate control API to
>> support 11n rates broke the link quality table use.  So, until I or
>> someone else decides to fix it, let's just disable it for now.
>>
>>   * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function.
>>
>>   * Eliminate two uses of the net80211 rate index lookup functions - they
>> are only for legacy rates and they're not needed here.
>>
>>   This fixes some invalid looking rate control TX issues that showed up
>>   on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look
>>   like DMA related issues.
>>
>>   Tested:
>>
>>   * 4965, STA mode
>>   * 5100, STA mode
>
> Hi Adrian,
>
> this change completely broke iwn for me. It's a
>
> iwn0:  mem 0xf1ffe000-0xf1ff irq 17 at device 0.0 
> on pci12
>
> built-in device in a Dell Precision m4400.
>
> With this change, wpa_supplicant cannot associate any longer. In the
> logs I see every few seconds
>
> Oct 27 10:57:37 mole wpa_supplicant[2256]: wlan0: Trying to associate with 
> xx:xx:xx:xx:xx:xx (SSID='xx' freq=2427 MHz)
> Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: Authentication with 
> xx:xx:xx:xx:xx:xx timed out.
> Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: CTRL-EVENT-DISCONNECTED 
> bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1
>
> If I revert just this revision based on a r257155 checkout, it works
> again.
>
> Stefan
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257213 - head/cddl/contrib/opensolaris/cmd/lockstat

2013-10-27 Thread Mark Johnston
Author: markj
Date: Sun Oct 27 16:18:48 2013
New Revision: 257213
URL: http://svnweb.freebsd.org/changeset/base/257213

Log:
  If the initial attempt to open /dev/ksyms fails, kldload the ksyms module
  and retry.

Modified:
  head/cddl/contrib/opensolaris/cmd/lockstat/sym.c

Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c
==
--- head/cddl/contrib/opensolaris/cmd/lockstat/sym.cSun Oct 27 16:01:11 
2013(r257212)
+++ head/cddl/contrib/opensolaris/cmd/lockstat/sym.cSun Oct 27 16:18:48 
2013(r257213)
@@ -179,8 +179,19 @@ symtab_init(void)
size_t  sz;
 #endif
 
+#if defined(__FreeBSD__)
+   if ((fd = open("/dev/ksyms", O_RDONLY)) == -1) {
+   if (errno == ENOENT && modfind("ksyms") == -1) {
+   kldload("ksyms");
+   fd = open("/dev/ksyms", O_RDONLY);
+   }
+   if (fd == -1)
+   return (-1);
+   }
+#else
if ((fd = open("/dev/ksyms", O_RDONLY)) == -1)
return (-1);
+#endif
 
 #if defined(sun)
(void) elf_version(EV_CURRENT);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257214 - head/sys/kern

2013-10-27 Thread Konstantin Belousov
Author: kib
Date: Sun Oct 27 16:20:52 2013
New Revision: 257214
URL: http://svnweb.freebsd.org/changeset/base/257214

Log:
  When reentering kdb, typically due to a bug causing trap or assert in
  the code executed in the context of debugger, do not be ashamed to
  inform loudly about the re-entry.  Also, print the backtrace before
  obliterating current stack with longjmp, allowing the operator to see
  a place which caused the bug.
  
  The change should make it less mysterious debugging the ddb itself.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/subr_kdb.c

Modified: head/sys/kern/subr_kdb.c
==
--- head/sys/kern/subr_kdb.cSun Oct 27 16:18:48 2013(r257213)
+++ head/sys/kern/subr_kdb.cSun Oct 27 16:20:52 2013(r257214)
@@ -503,6 +503,8 @@ kdb_reenter(void)
if (!kdb_active || kdb_jmpbufp == NULL)
return;
 
+   printf("KDB: reentering\n");
+   kdb_backtrace();
longjmp(kdb_jmpbufp, 1);
/* NOTREACHED */
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257215 - in head: contrib/libpcap etc/mtree include sys/contrib/altq/altq sys/net sys/netpfil/ipfw sys/netpfil/pf

2013-10-27 Thread Gleb Smirnoff
Author: glebius
Date: Sun Oct 27 16:25:57 2013
New Revision: 257215
URL: http://svnweb.freebsd.org/changeset/base/257215

Log:
  Move new pf includes to the pf directory. The pfvar.h remain
  in net, to avoid compatibility breakage for no sake.
  
  The future plan is to split most of non-kernel parts of
  pfvar.h into pf.h, and then make pfvar.h a kernel only
  include breaking compatibility.
  
  Discussed with:   bz

Added:
  head/sys/netpfil/pf/pf.h
 - copied unchanged from r257214, head/sys/net/pf.h
  head/sys/netpfil/pf/pf_altq.h
 - copied unchanged from r257189, head/sys/net/pf_altq.h
  head/sys/netpfil/pf/pf_mtag.h
 - copied unchanged from r257189, head/sys/net/pf_mtag.h
Deleted:
  head/sys/net/pf.h
  head/sys/net/pf_altq.h
  head/sys/net/pf_mtag.h
Modified:
  head/contrib/libpcap/grammar.y
  head/etc/mtree/BSD.include.dist
  head/include/Makefile
  head/sys/contrib/altq/altq/altq_cbq.c
  head/sys/contrib/altq/altq/altq_hfsc.c
  head/sys/contrib/altq/altq/altq_priq.c
  head/sys/contrib/altq/altq/altq_red.c
  head/sys/contrib/altq/altq/altq_rio.c
  head/sys/contrib/altq/altq/altq_subr.c
  head/sys/net/if_ethersubr.c
  head/sys/net/pfvar.h
  head/sys/netpfil/ipfw/ip_fw2.c
  head/sys/netpfil/pf/pf.c
  head/sys/netpfil/pf/pf_lb.c
  head/sys/netpfil/pf/pf_norm.c

Modified: head/contrib/libpcap/grammar.y
==
--- head/contrib/libpcap/grammar.y  Sun Oct 27 16:20:52 2013
(r257214)
+++ head/contrib/libpcap/grammar.y  Sun Oct 27 16:25:57 2013
(r257215)
@@ -56,7 +56,7 @@ struct rtentry;
 #include "gencode.h"
 #ifdef HAVE_NET_PFVAR_H
 #include 
-#include 
+#include 
 #include 
 #endif
 #include "ieee80211.h"

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Sun Oct 27 16:20:52 2013
(r257214)
+++ head/etc/mtree/BSD.include.dist Sun Oct 27 16:25:57 2013
(r257215)
@@ -289,6 +289,10 @@
 sig
 ..
 ..
+netpfil
+pf
+..
+..
 netsmb
 ..
 nfs

Modified: head/include/Makefile
==
--- head/include/Makefile   Sun Oct 27 16:20:52 2013(r257214)
+++ head/include/Makefile   Sun Oct 27 16:25:57 2013(r257215)
@@ -288,6 +288,13 @@ symlinks:
${DESTDIR}${INCLUDEDIR}/netinet; \
done
 .endif
+.if ${MK_PF} != "no"
+   cd ${.CURDIR}/../sys/netpfil/pf; \
+   for h in *.h; do \
+   ln -fs ../../../../sys/netpfil/pf/$$h \
+   ${DESTDIR}${INCLUDEDIR}/netpfil/pf; \
+   done
+.endif
cd ${.CURDIR}/../sys/crypto; \
for h in rijndael/rijndael.h; do \
ln -fs ../../../sys/crypto/$$h \

Modified: head/sys/contrib/altq/altq/altq_cbq.c
==
--- head/sys/contrib/altq/altq/altq_cbq.c   Sun Oct 27 16:20:52 2013
(r257214)
+++ head/sys/contrib/altq/altq/altq_cbq.c   Sun Oct 27 16:25:57 2013
(r257215)
@@ -57,9 +57,9 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #ifdef ALTQ3_COMPAT

Modified: head/sys/contrib/altq/altq/altq_hfsc.c
==
--- head/sys/contrib/altq/altq/altq_hfsc.c  Sun Oct 27 16:20:52 2013
(r257214)
+++ head/sys/contrib/altq/altq/altq_hfsc.c  Sun Oct 27 16:25:57 2013
(r257215)
@@ -69,9 +69,9 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #ifdef ALTQ3_COMPAT

Modified: head/sys/contrib/altq/altq/altq_priq.c
==
--- head/sys/contrib/altq/altq/altq_priq.c  Sun Oct 27 16:20:52 2013
(r257214)
+++ head/sys/contrib/altq/altq/altq_priq.c  Sun Oct 27 16:25:57 2013
(r257215)
@@ -54,9 +54,9 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #ifdef ALTQ3_COMPAT
 #include 

Modified: head/sys/contrib/altq/altq/altq_red.c
==
--- head/sys/contrib/altq/altq/altq_red.c   Sun Oct 27 16:20:52 2013
(r257214)
+++ head/sys/contrib/altq/altq/altq_red.c   Sun Oct 27 16:25:57 2013
(r257215)
@@ -95,9 +95,9 @@
 #include 
 #endif
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #ifdef ALTQ3_COMPAT

Modified: head/sys/contrib/altq/altq/altq_rio.c
==
--- head/sys/contrib/altq/altq/altq_rio.c   Sun Oct 27 16:20:52 2013
(r257214)
+++ head/sys/contrib/altq/altq/altq_rio.c 

Re: svn commit: r257199 - in head/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv mv/orion rockchip sa11x0 samsung/exynos tegra ti ti/omap4/pandaboard versatile xilinx xscale/i803

2013-10-27 Thread Bruce Evans

On Sun, 27 Oct 2013, Ian Lepore wrote:


Log:
 Remove all #include  from arm code.  It's already
 included by vm/pmap.h, which is a prerequisite for arm/machine/pmap.h
 so there's no reason to ever include it directly.

 Thanks to alc@ for pointing this out.


I noticed this style bug in the recent commit, but didn't complain before.

Including machine/pmap.h directly is unwarranted chumminess with the
implementation.  When vm/pmap.h is also included, it less than that.

The chumminess is merely unwarranted in just a few cases.  vm/map.h
is not includable in some asm files.  machine/pmap.h is includable in
asm files, but shouldn't be on some arches.  genassym should be used.
The hack of including machine/pmap.h is currently used in 5 asm files
(essentially the same 2: 2 on i386 cloned to amd64 and 1 of these
cloned to xen/i386).  All file counts are for /sys.

In 2004, there were:
-   2 .c files that include  only machine/pmap.h (chummy)
-  20 .c files that include vm/pmap.h and machine/pmap.h (less than that)
- 231 .c files that include vm/pmap.h only   (correct)

The style bugs have expanded exponentially since then of course :-(.  In
-current before this comment, there are:
-   9 .c files that include  only machine/pmap.h (chummy)
-  80 .c files that include vm/pmap.h and machine/pmap.h (less than that)
- 421 .c files that include vm/pmap.h only   (correct)

The files with mere unwarranted chumminess are 2 in sparc64 (in 2004 and
now), 6 in mips (now) and 1 in powerpc (now).  MD files can reasonably
use only the  level, but there is no reason to avoid the vm
level for just pmap. The 9 files that avoid vm for pmap use vm includes
for most other things.

These file counts by grep don't show the complexities from nested pollution.
machine/pmap.h is now included nested in 7 headers.  This is pollution
except in vm/vmap.h.  vm/pmap.h is now included in 32 headers.  This is
gross pollution in vm/vm_page.h.  It is perhaps needed in sys/user.h,
where it is marked as a mistake by XXX.  The others are mostly for drivers
doing bad things like using vtophys().

Similarly for many other nested includes, except it is usually not so
clear that the machine includes should only be included directly in 1
place.


Modified: head/sys/arm/allwinner/a10_machdep.c
==
--- head/sys/arm/allwinner/a10_machdep.cSat Oct 26 23:41:11 2013
(r257198)
+++ head/sys/arm/allwinner/a10_machdep.cSun Oct 27 00:51:46 2013
(r257199)
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
#include 
#include  /* For trapframe_t, used in  */
#include 
-#include 

#include 


Some other style bugs are visible in the patch.

Saying what an include is for is a bogus "come from" comment.  Such comments
are usually rotten, and the above is no exception.  trapframe_t is a
style bug (an "opaque" type that must be visible to use it) that still
exists (only arm has it, at least now).  But arm/machine/machdep.h doesn't
use it now.  I don't know if machine/machdep.h needed to use it.  But the
optimization of passing full trap frames without copying them has been lost
because it depended on undefined behaviour in C.  Everything now passes
pointers to trap frames instead.  arm/machine/machdep.h spells the pointers
correctly as "struct trapframe *" after forward-declaring an incomplete
"struct trapframe", so it doesn't actually use trapframe_t.  Perhaps the
include is now included for some unclaimed reason.

arm spells "struct trapframe" correctly in 45 places.  It uses trapframe_t
in 29 places.  6 of these are for the same false "come from" comment.

machine/frame.h is still included nested in too many headers.  arm is not
worse than i386 here.


Modified: head/sys/arm/arm/minidump_machdep.c
==
--- head/sys/arm/arm/minidump_machdep.c Sat Oct 26 23:41:11 2013
(r257198)
+++ head/sys/arm/arm/minidump_machdep.c Sun Oct 27 00:51:46 2013
(r257199)
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
#endif
#include 
#include 
-#include 
#include 
#include 
#include 


Missing blank line before the  includes.  There order is improved.


Modified: head/sys/arm/arm/nexus.c
==
--- head/sys/arm/arm/nexus.cSat Oct 26 23:41:11 2013(r257198)
+++ head/sys/arm/arm/nexus.cSun Oct 27 00:51:46 2013(r257199)
@@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
#include 
#include 
#include 
-#include 

#include 
#include 


This also fixes the misplaced blank line.  The order of the 2 
includes visible is still backwards.


--- head/sys/arm/freescale/imx/imx_machdep.cSat Oct 26 23:41:11 2013
(r257198)
+++ head/sys/arm/freescale/imx/imx_machdep.cSun Oct 27 00:51:46 2013
(r257199)
@@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
#include 
#include  /* For trapframe_t, us

svn commit: r257216 - head/sys/amd64/amd64

2013-10-27 Thread Konstantin Belousov
Author: kib
Date: Sun Oct 27 16:31:12 2013
New Revision: 257216
URL: http://svnweb.freebsd.org/changeset/base/257216

Log:
  Several small fixes for the amd64 minidump code.
  
  In report_progress(), use nitems(progress_track) instead of manually
  hard-coding array size.  Wrap long line.
  
  In blk_write(), code verifies that ptr and pa cannot be non-zero
  simultaneously.  The later check for the page-alignment of the ptr
  argument never triggers due to pa != 0 always implying ptr == NULL.  I
  believe that the intent was to ensure that physicall address passed is
  page-aligned, since the address is (temporary) mapped for the duration
  of the page write.
  
  Clear the progress_track.visited fields when starting minidump.  If
  minidump is restarted or taken second time during the system lifetime,
  progress is not printed otherwise, making operator suspectible to the
  dump status.
  
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/minidump_machdep.c

Modified: head/sys/amd64/amd64/minidump_machdep.c
==
--- head/sys/amd64/amd64/minidump_machdep.c Sun Oct 27 16:25:57 2013
(r257215)
+++ head/sys/amd64/amd64/minidump_machdep.c Sun Oct 27 16:31:12 2013
(r257216)
@@ -127,8 +127,9 @@ report_progress(size_t progress, size_t 
int sofar, i;
 
sofar = 100 - ((progress * 100) / dumpsize);
-   for (i = 0; i < 10; i++) {
-   if (sofar < progress_track[i].min_per || sofar > 
progress_track[i].max_per)
+   for (i = 0; i < nitems(progress_track); i++) {
+   if (sofar < progress_track[i].min_per ||
+   sofar > progress_track[i].max_per)
continue;
if (progress_track[i].visited)
return;
@@ -157,8 +158,8 @@ blk_write(struct dumperinfo *di, char *p
printf("cant have both va and pa!\n");
return (EINVAL);
}
-   if (pa != 0 && (((uintptr_t)ptr) % PAGE_SIZE) != 0) {
-   printf("address not page aligned\n");
+   if uintptr_t)pa) % PAGE_SIZE) != 0) {
+   printf("address not page aligned %p\n", ptr);
return (EINVAL);
}
if (ptr != NULL) {
@@ -230,6 +231,8 @@ minidumpsys(struct dumperinfo *di)
  retry:
retry_count++;
counter = 0;
+   for (i = 0; i < nitems(progress_track); i++)
+   progress_track[i].visited = 0;
/* Walk page table pages, set bits in vm_page_dump */
pmapsize = 0;
for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + nkpt * NBPDR,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257199 - in head/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv mv/orion rockchip sa11x0 samsung/exynos tegra ti ti/omap4/pandaboard versatile xilinx xscale/i803

2013-10-27 Thread Ian Lepore
On Mon, 2013-10-28 at 03:07 +1100, Bruce Evans wrote:
> 
> > Modified: head/sys/arm/allwinner/a10_machdep.c
> > ==
> > --- head/sys/arm/allwinner/a10_machdep.c  Sat Oct 26 23:41:11 2013  
> >   (r257198)
> > +++ head/sys/arm/allwinner/a10_machdep.c  Sun Oct 27 00:51:46 2013  
> >   (r257199)
> > @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
> > #include 
> > #include  /* For trapframe_t, used in  
> > */
> > #include 
> > -#include 
> >
> > #include 
> 
> Some other style bugs are visible in the patch.
> 
> Saying what an include is for is a bogus "come from" comment.  Such comments
> are usually rotten, and the above is no exception.  trapframe_t is a
> style bug (an "opaque" type that must be visible to use it) that still
> exists (only arm has it, at least now).  But arm/machine/machdep.h doesn't
> use it now.  I don't know if machine/machdep.h needed to use it.  But the
> optimization of passing full trap frames without copying them has been lost
> because it depended on undefined behaviour in C.  Everything now passes
> pointers to trap frames instead.  arm/machine/machdep.h spells the pointers
> correctly as "struct trapframe *" after forward-declaring an incomplete
> "struct trapframe", so it doesn't actually use trapframe_t.  Perhaps the
> include is now included for some unclaimed reason.
> 
> 
The "come from" comment bogosity was mine, although the trapframe_t
unhappiness came first.  I had at one time started flagged them as a
baby step towards cleaning them all up, then did nothing for months.
You may have noticed that I finally finished the job of eliminating
frame.h from most of the places that didn't actually need it in r257200.

While doing that, I noticed a whole lot of other includes in arm source
code that just aren't needed (things like cpu.h and intr.h in virtually
every file).  So much of our arm code gets created by wholesale pasting
some other code and then hacking.  That's not completely invalid, I do
it myself sometimes, but I generally start by commenting out most of the
includes, then uncomment until it compiles.

I didn't realize only arm had a trapframe_t.  Now I'm inclined to just
seek and destroy the remnants of it.

-- Ian


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


svn commit: r257217 - in head/sys/arm: arm include

2013-10-27 Thread Ian Lepore
Author: ian
Date: Sun Oct 27 17:09:23 2013
New Revision: 257217
URL: http://svnweb.freebsd.org/changeset/base/257217

Log:
  Remove the last dregs of trapframe_t.  It turns out only arm was using
  this type, so remove it to make arm code more consistant with other
  platforms.  Thanks to bde@ for pointing out only arm used trapframe_t.

Modified:
  head/sys/arm/arm/cpufunc.c
  head/sys/arm/arm/trap.c
  head/sys/arm/arm/undefined.c
  head/sys/arm/arm/vm_machdep.c
  head/sys/arm/include/frame.h

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Sun Oct 27 16:31:12 2013(r257216)
+++ head/sys/arm/arm/cpufunc.c  Sun Oct 27 17:09:23 2013(r257217)
@@ -1721,7 +1721,7 @@ int
 early_abort_fixup(arg)
void *arg;
 {
-   trapframe_t *frame = arg;
+   struct trapframe *frame = arg;
u_int fault_pc;
u_int fault_instruction;
int saved_lr = 0;
@@ -1862,7 +1862,7 @@ int
 late_abort_fixup(arg)
void *arg;
 {
-   trapframe_t *frame = arg;
+   struct trapframe *frame = arg;
u_int fault_pc;
u_int fault_instruction;
int saved_lr = 0;

Modified: head/sys/arm/arm/trap.c
==
--- head/sys/arm/arm/trap.c Sun Oct 27 16:31:12 2013(r257216)
+++ head/sys/arm/arm/trap.c Sun Oct 27 17:09:23 2013(r257217)
@@ -123,8 +123,8 @@ __FBSDID("$FreeBSD$");
 #endif
 
 
-void swi_handler(trapframe_t *);
-void undefinedinstruction(trapframe_t *);
+void swi_handler(struct trapframe *);
+void undefinedinstruction(struct trapframe *);
 
 #include 
 #include 
@@ -145,13 +145,17 @@ struct ksig {
u_long code;
 };
 struct data_abort {
-   int (*func)(trapframe_t *, u_int, u_int, struct thread *, struct ksig 
*);
+   int (*func)(struct trapframe *, u_int, u_int, struct thread *, 
+   struct ksig *);
const char *desc;
 };
 
-static int dab_fatal(trapframe_t *, u_int, u_int, struct thread *, struct ksig 
*);
-static int dab_align(trapframe_t *, u_int, u_int, struct thread *, struct ksig 
*);
-static int dab_buserr(trapframe_t *, u_int, u_int, struct thread *, struct 
ksig *);
+static int dab_fatal(struct trapframe *, u_int, u_int, struct thread *,
+struct ksig *);
+static int dab_align(struct trapframe *, u_int, u_int, struct thread *,
+struct ksig *);
+static int dab_buserr(struct trapframe *, u_int, u_int, struct thread *,
+struct ksig *);
 
 static const struct data_abort data_aborts[] = {
{dab_fatal, "Vector Exception"},
@@ -196,7 +200,8 @@ call_trapsignal(struct thread *td, int s
 }
 
 static __inline int
-data_abort_fixup(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, 
struct ksig *ksig)
+data_abort_fixup(struct trapframe *tf, u_int fsr, u_int far, struct thread *td,
+struct ksig *ksig)
 {
 #ifdef CPU_ABORT_FIXUP_REQUIRED
int error;
@@ -226,7 +231,7 @@ data_abort_fixup(trapframe_t *tf, u_int 
 }
 
 void
-data_abort_handler(trapframe_t *tf)
+data_abort_handler(struct trapframe *tf)
 {
struct vm_map *map;
struct pcb *pcb;
@@ -482,7 +487,8 @@ out:
  * Note: If 'l' is NULL, we assume we're dealing with a prefetch abort.
  */
 static int
-dab_fatal(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct 
ksig *ksig)
+dab_fatal(struct trapframe *tf, u_int fsr, u_int far, struct thread *td,
+struct ksig *ksig)
 {
const char *mode;
 
@@ -538,7 +544,8 @@ dab_fatal(trapframe_t *tf, u_int fsr, u_
  * deliver a bus error to the process.
  */
 static int
-dab_align(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct 
ksig *ksig)
+dab_align(struct trapframe *tf, u_int fsr, u_int far, struct thread *td,
+struct ksig *ksig)
 {
 
/* Alignment faults are always fatal if they occur in kernel mode */
@@ -586,7 +593,8 @@ dab_align(trapframe_t *tf, u_int fsr, u_
  * In all other cases, these data aborts are considered fatal.
  */
 static int
-dab_buserr(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct 
ksig *ksig)
+dab_buserr(struct trapframe *tf, u_int fsr, u_int far, struct thread *td,
+struct ksig *ksig)
 {
struct pcb *pcb = td->td_pcb;
 
@@ -607,7 +615,7 @@ dab_buserr(trapframe_t *tf, u_int fsr, u
 * If the current trapframe is at the top of the kernel stack,
 * the fault _must_ have come from user mode.
 */
-   if (tf != ((trapframe_t *)pcb->un_32.pcb32_sp) - 1) {
+   if (tf != ((struct trapframe *)pcb->un_32.pcb32_sp) - 1) {
/*
 * Kernel mode. We're either about to die a
 * spectacular death, or pcb_onfault will come
@@ -660,7 +668,7 @@ dab_buserr(trapframe_t *tf, u_int fsr, u
 }
 
 static __inline int
-prefetch_abort_fixup(trapframe_t *tf, struct ksig *ksig)
+prefetch_abort_fixu

svn commit: r257218 - head/sys/contrib/ipfilter/netinet

2013-10-27 Thread Gleb Smirnoff
Author: glebius
Date: Sun Oct 27 17:12:31 2013
New Revision: 257218
URL: http://svnweb.freebsd.org/changeset/base/257218

Log:
  Include lock.h before mutex.h.

Modified:
  head/sys/contrib/ipfilter/netinet/ip_compat.h

Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
==
--- head/sys/contrib/ipfilter/netinet/ip_compat.h   Sun Oct 27 17:09:23 
2013(r257217)
+++ head/sys/contrib/ipfilter/netinet/ip_compat.h   Sun Oct 27 17:12:31 
2013(r257218)
@@ -146,6 +146,7 @@ struct  ether_addr {
 # endif /* _KERNEL */
 
 #  include 
+#  include 
 #  include 
 #defineKRWLOCK_FILL_SZ 56
 #defineKMUTEX_FILL_SZ  56
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257219 - head/sys/net

2013-10-27 Thread Gleb Smirnoff
Author: glebius
Date: Sun Oct 27 17:14:33 2013
New Revision: 257219
URL: http://svnweb.freebsd.org/changeset/base/257219

Log:
  Almost all if_clone consumers do not care about if_clone_event.
  Do not force them to include sys/eventhandler.h. Those who
  utilize EVENTHANDLER(9), will see the declaration.

Modified:
  head/sys/net/if_clone.h

Modified: head/sys/net/if_clone.h
==
--- head/sys/net/if_clone.h Sun Oct 27 17:12:31 2013(r257218)
+++ head/sys/net/if_clone.h Sun Oct 27 17:14:33 2013(r257219)
@@ -58,9 +58,11 @@ int  ifc_name2unit(const char *name, int 
 intifc_alloc_unit(struct if_clone *, int *);
 void   ifc_free_unit(struct if_clone *, int);
 
+#ifdef SYS_EVENTHANDLER_H
 /* Interface clone event. */
 typedef void (*if_clone_event_handler_t)(void *, struct if_clone *);
 EVENTHANDLER_DECLARE(if_clone_event, if_clone_event_handler_t);
+#endif
 
 /* The below interfaces used only by net/if.c. */
 void   if_clone_init(void);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257220 - head/sys/net

2013-10-27 Thread Gleb Smirnoff
Author: glebius
Date: Sun Oct 27 17:27:06 2013
New Revision: 257220
URL: http://svnweb.freebsd.org/changeset/base/257220

Log:
  Provide forward declaration for struct ifnet. Consumers
  of this header don't need contents of struct.

Modified:
  head/sys/net/if_media.h

Modified: head/sys/net/if_media.h
==
--- head/sys/net/if_media.h Sun Oct 27 17:14:33 2013(r257219)
+++ head/sys/net/if_media.h Sun Oct 27 17:27:06 2013(r257220)
@@ -54,6 +54,8 @@
 
 #include 
 
+struct ifnet;
+
 /*
  * Driver callbacks for media status and change requests.
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257200 - in head/sys/arm: allwinner allwinner/a20 arm at91 broadcom/bcm2835 econa freescale/imx include lpc mv rockchip samsung/exynos tegra ti ti/am335x ti/omap4 ti/twl versatile xil

2013-10-27 Thread Bruce Evans

On Sun, 27 Oct 2013, Ian Lepore wrote:


Log:
 Remove #include  from all the arm code that doesn't
 really need it.  That would be almost everywhere it was included.  Add
 it in a couple files that really do need it and were previously getting
 it by accident via another header.


Oops, I complained too soon about style bugs attached to these includes
in another reply.  Removing the includes also removes most of the
collateral style bugs.

How do you find the files that _really_ do need it?  Nested pollution
makes this difficult.  tools/kerninclude barely works.  When I tried
to reduce nested pollution, I used a predecessor of tools/kerninclude
that was more usable because it was more localized, but it got other
things wrong.


Modified: head/sys/arm/include/undefined.h
==
--- head/sys/arm/include/undefined.hSun Oct 27 00:51:46 2013
(r257199)
+++ head/sys/arm/include/undefined.hSun Oct 27 01:34:10 2013
(r257200)
@@ -52,7 +52,9 @@

#include 

-typedef int (*undef_handler_t) (unsigned int, unsigned int, trapframe_t *, 
int);
+struct trapframe;
+
+typedef int (*undef_handler_t) (unsigned int, unsigned int, struct trapframe 
*, int);

#define FP_COPROC   1
#define FP_COPROC2  2


Other uses of the trapframe_t style bug reqiore more editing.

This adds a style bug (extra blank line which separates the forward
declaration from its one use).

Old style bugs remaining in the main changed line include:
- not using u_int (perhaps it should be foo_t)
- gnu style parentheses
- long line

I don't like extensive use of typedefs to obfuscate function pointers,
even without the style bug of declaring a typedef for the pointer and
not a typedef for the function.  We use typedefs for function pointers
because the syntax for a function pointer is complicated, not primarily
to hide the type.  Here the pointer is used only a few times so repeating
the declaration would be clearer.  However, if the typedef were for the
function then it could be used more.  Now, most of the few uses are for
a public function that seems to be never called:
- install_coproc_handler() is declared in this header and its declaration
  uses the typedef
- install_coproc_handler() is defined in arm/undefined.c and its definition
  uses the typedef
- install_coproc_handler() seems to be never called.  The installation
  function that is actually called is install_coproc_handler_static().
  This was apparently originally a static internal for
  install_coproc_handler().  It is still named with 'static' and is still
  used internally but is now public and used externally.
- a critical struct declaration in this header also uses the typedef.
  install_coproc_handler_static() takes a pointer to this struct as an
  arg so its callers don't need the typedef.  Since the typedef is for
  a pointer and not a function, it cannot be used in forward declarations
  of handlers.  Even if the typedef were for a function, C syntax wouldn't
  allow using it in definitions of handlers.
So the typedef ends up being used once in used code and twice in unused code.

Old style bugs visible in unchanged lines:
- space instead of tab after #define.

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


Re: svn commit: r257203 - head/sys/arm/arm

2013-10-27 Thread Bruce Evans

On Sun, 27 Oct 2013, Ian Lepore wrote:


Log:
 Eliminate a compiler warning about extraneous parens.


Wow, what flags give these warnings?

Next I'll ask for -Wexcessive-braces, -Wbogus-cast and -Wno-sloppy-format.


Modified: head/sys/arm/arm/busdma_machdep.c
==
--- head/sys/arm/arm/busdma_machdep.c   Sun Oct 27 03:24:46 2013
(r257202)
+++ head/sys/arm/arm/busdma_machdep.c   Sun Oct 27 03:29:38 2013
(r257203)
@@ -807,7 +807,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma
bus_addr_t curaddr;
bus_size_t sgsize;

-   if ((map->pagesneeded == 0)) {
+   if (map->pagesneeded == 0) {
CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d",
dmat->lowaddr, dmat->boundary, dmat->alignment);
CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d",


Formats for CTR*s are extremely bogus and can't be handled by -Wformat
or -Wno-sloppy-format.  If it did, then -Wno-sloppy-format would complain
about printing unsigned longs (bus_addr_t's) using %d format even if
-Wformat wouldn't because unsigned longs have the same size as ints.
CTR*() is actually not variadic, but converts all args to u_long, so %d
and %p cannot work without further magic to convert back to the original
type.  I never been able to find this magic and suspect it doesn't exist.
I think the format strings are not used in the kernel.  They are used with
gross type mismatches in ktrdump unless all the format specifiers in them
are %lu or similar: ktrdump just does:

fprintf(out, desc, parms[0], parms[1], parms[2], parms[3],
parms[4], parms[5]);

It parses the format string using a primitive parser but doesn't rewrite
any of the types or args except to replace kernel pointers to strings
by user pointers to copies of the strings.  Integer and pointer args
remain in parms[] as u_longs from the kernel conversion, and are then
printed with the format specifiers in the CTR*() calls which almost
never match the u_long.  Most of the kernel conversions to u_long are
automatic, but sometimes bogus casts (which might match neither the
format specifier nor u_long) are used to defeat the type checking in
automatic conversions.  If the original types are 64 bits, then passing
them as u_long's just doesn't work and some CTR*() calls use extremely
ugly code with bogus casts in it to split the 64 into two.

The undefined behaviour in ktrdump can be fixed fairly easily by rewriting
all the integer format specifiers to %lu or %ld.  %p needs to be left as
itself since %p format is too different from %lu format.  But without
format checking, the formats will often be too broken to be displayed
correctly.  %d in the above is a bad format for addresses anyway.  %jx
is always wrong in MI code -- it works if u_long == uintmax_t, but on
32-bit arches with large values in the original type uintmax_t, it
indicates that the programmer doesn't know that CTR*() will truncate
to u_long.

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


Re: svn commit: r252010 - head/sys/geom/mirror

2013-10-27 Thread Slawa Olhovchenkov
On Wed, Jun 19, 2013 at 09:52:32PM +, Scott Long wrote:

> Author: scottl
> Date: Wed Jun 19 21:52:32 2013
> New Revision: 252010
> URL: http://svnweb.freebsd.org/changeset/base/252010
> 
> Log:
>   Mark geom_mirror as capable of unmapped i/o

Can you add capable of unmapped i/o to geom_stripe?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257221 - head/sys/kern

2013-10-27 Thread Konstantin Belousov
Author: kib
Date: Sun Oct 27 18:52:09 2013
New Revision: 257221
URL: http://svnweb.freebsd.org/changeset/base/257221

Log:
  Fix typo.
  
  MFC after:3 days

Modified:
  head/sys/kern/subr_param.c

Modified: head/sys/kern/subr_param.c
==
--- head/sys/kern/subr_param.c  Sun Oct 27 17:27:06 2013(r257220)
+++ head/sys/kern/subr_param.c  Sun Oct 27 18:52:09 2013(r257221)
@@ -344,7 +344,7 @@ init_param2(long physpages)
 }
 
 /*
- * Sysctl stringiying handler for kern.vm_guest.
+ * Sysctl stringifying handler for kern.vm_guest.
  */
 static int
 sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257203 - head/sys/arm/arm

2013-10-27 Thread Ian Lepore
On Mon, 2013-10-28 at 04:42 +1100, Bruce Evans wrote:
> On Sun, 27 Oct 2013, Ian Lepore wrote:
> 
> > Log:
> >  Eliminate a compiler warning about extraneous parens.
> 
> Wow, what flags give these warnings?

--- busdma_machdep.o ---
/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: 
warning: equality comparison with extraneous parentheses 
[-Wparentheses-equality]
if ((map->pagesneeded == 0)) {
 ~^~~~
/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: 
note: remove extraneous parentheses around the comparison to silence this 
warning
if ((map->pagesneeded == 0)) {
~ ^   ~
/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: 
note: use '=' to turn this equality comparison into an assignment
if ((map->pagesneeded == 0)) {
  ^~
  =

That's what the compiler had to say about it.  I guess in somebody's
mind if it's a probable error to have done 

  if (testandassign = something)

and somehow it's less probably an error to have done

  if ((testandassign = something))

then surely the converse must also be true and double parens not
syntactically necessary in either case must be indicative of error in
one of the cases.

The warning doesn't bother me as much as the two useless notes that
follow it (which are annoying when combined with my editor's feature of
parsing compiler output and jumping to the next error point in the
code).  I've notice clang is particularly chatty, with things like
suggesting what you might have meant when you spell a variable name
wrong.  Before long it's going to be like RPG and COBOL where it's
willing to assume what you meant and try to generate runnable code in
the face of almost any error.

I probably date myself with references to RPG and COBOL, but it does
bring back fond memories of slapping a boilerplate header on every
interoffice memo issued by management and running it through the cobol
compiler, and grading them on whether their memos generated runnable
code or so many errors the compiler gave up.

-- Ian


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


Re: svn commit: r257200 - in head/sys/arm: allwinner allwinner/a20 arm at91 broadcom/bcm2835 econa freescale/imx include lpc mv rockchip samsung/exynos tegra ti ti/am335x ti/omap4 ti/twl versatile xil

2013-10-27 Thread Ian Lepore
On Mon, 2013-10-28 at 04:01 +1100, Bruce Evans wrote:
> On Sun, 27 Oct 2013, Ian Lepore wrote:
> 
> > Log:
> >  Remove #include  from all the arm code that doesn't
> >  really need it.  That would be almost everywhere it was included.  Add
> >  it in a couple files that really do need it and were previously getting
> >  it by accident via another header.
> 
> Oops, I complained too soon about style bugs attached to these includes
> in another reply.  Removing the includes also removes most of the
> collateral style bugs.
> 
> How do you find the files that _really_ do need it?  Nested pollution
> makes this difficult.  tools/kerninclude barely works.  When I tried
> to reduce nested pollution, I used a predecessor of tools/kerninclude
> that was more usable because it was more localized, but it got other
> things wrong.

Mostly by brute force and a fast machine for compiling.  I removed it
from pretty much everywhere it appeared except the few places I knew
were legit (such as arm/trap.c), then added it back as needed to get a
clean compile.  At one point I realized that a place where it was
included from within another header was really required[1] and I had to
backtrack a bit, do that, then re-iterate forward.  Luckily that didn't
happen until most of the arm tree had compiled without frame.h being
included from any other .h.  I've had this brute force method break down
completely with more complex situations, but it went pretty quickly with
this one.

[1] Really required given the way other code is structured now.  There's
a macro in cpu.h that expands to derefence trapframe, and that macro is
used in kern/something.c.  Maybe that macro could be a function, but I
didn't want to sidetrack and review the performance implications of that
change at the time.

-- Ian


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


Re: svn commit: r257199 - in head/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv mv/orion rockchip sa11x0 samsung/exynos tegra ti ti/omap4/pandaboard versatile xilinx xscale/i803

2013-10-27 Thread Bruce Evans

On Sun, 27 Oct 2013, Ian Lepore wrote:


While doing that, I noticed a whole lot of other includes in arm source
code that just aren't needed (things like cpu.h and intr.h in virtually
every file).  So much of our arm code gets created by wholesale pasting
some other code and then hacking.  That's not completely invalid, I do
it myself sometimes, but I generally start by commenting out most of the
includes, then uncomment until it compiles.


Including cpu.h is an especially large style bug.  It is for MD
implementations of MI interfaces (mostly function-line ones; simple
macros are mostly in *param.h).  Thus it should be very small and
rarely used, especially in MD code.  Since the interfaces are MI,
they can be extern and declared in MI headers unless they are macros
or inlines.  Since MD code can get at the details directly, it shouldn't
use these MI interfaces much, and the only includes of cpu.h in MD code
should be to help implement it.

cpu.h was almost completely cleaned up on x86.  It has regressed a bit
with get_cyclecount() and xen.  The complexity and divergence of the
implementations of the relatively trivial and unimportant interface
get_cyclecount() as an inline or macro shows why you shouldn't
micro-optimize many MI interfaces with inline functions or macros.

arm cpu.h is a bit smaller than i386 cpu.h so it should be included a
bit less.  It has the following easy-to-fix (?) obvious bugs:

duplicated across all arches for at least some interfaces:
- declarations of cpu_halt, swi_vm (?!) and fork_trampoline().  These
  are extern, and should always be extern.  Since they are MI, they
  should be declared in an MI header.  They are also unsorted here.
- bad MI implementation of get_cyclecount().  (Not all implementations
  are bad or duplicated.)  There should be a way to default to an MI
  interfaces for some things, and use a less bad one here and for other
  places that use bad ones.

arm-specific:
- declarations of arm_boot_params, arm_vector_init(), identify_arm_cpu(),
  initarm().  Obviously not MI interfaces, and also not used to implement
  MI interfaces, so they don't belong here.
- badaddr_read().  Not obviously not an MI interface, but not in any other
  cpu.h, so cannot be called from MI code, so it doesn't belong here.

arm cpu.h is missing a few interaces that i386 has, e.g., cpu_exec(). 
Therefore, these must be impossible to call from MI code, so they are

misplaced on i386.  Actually, cpu_exec() is never used.  It is only
defined on amd64 and i386.  sparc64 has an XXX comment in exec_setregs()
saying that it doesn't exist.

Most interfaces named cpu_foo() are MI, and IIRC the declarations of
many are misplaced in MD headers, but most have never been misplaced
in cpu.h because they never were inlines or macros.  The cpu_ prefix
for functions should probably be reserved for MI interfaces, and it
might be worth using a variation of it for ones that should be extern.
It isn't used very much in i386/include/.  Older interfaces like
fork_trampoline() use even more inconsistent names.  cpu_exec() should
probably exist instead of exec_setregs() (unless multiple MD calls
are needed for multiple stages of exec).  exec_setregs() should have
a cpu_ prefix.

After removing the garbage, there are just 7 interfaces implemented
in arm cpu.h (btext and etext could also use an MI default.  This
reduces to 5).   can be about as simple as
 used to be before it was complicated by compiler
builtins.  It is possible to document this many interfaces! :-)
However, it is hard to document all the symbols needed to implement
these 5 interfaces.  armreg.h is included for just PSR_MODE and
PSR32_MODE and brings an undocumented number of other symbols.
But armreg.h doesn't include enough pollution to actually work --
it uses frame pointers but doesn't include frame.h.  It is unclear
how the MI code that includes it manages to include frame.h.  This
is one case where nested includes are almost justified -- cpu.h is
supposed to be self-sufficient so that MI code that uses it doesn't
need to know about the MD headers that it depends on.  i386 cpu.h
includes psl.h, frame.h and also segments.h.  segments.h seems to
be unused pollution.

TRAPF_USERMODE() is missing parenthesization of 'frame'.

Further cleaning for i386 cpu.h:

- cpu_swapin(): like cpu_exec() except sparc64 doesn't mention it.
- cpu_ops: highly MD; shouldn't have a cpu_ prefix or be declared here.
- cpu_reset(): like cpu_halt(); correct prefix, but should never be
  optimized to a macro or inline here.  Unlike cpu_halt(), it is not
  used for normal shutdowns and is needed mainly by ddb.  arm declares
  it in cpufunc.h.  This is wrong for many reasons.  It is only declared
  there and not implemented.  cpufunc.h is for access to special CPU
  instructions, preferably only 1 instruction per function.  I shouldn't
  have named it cpu*.h.

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.fre

svn commit: r257222 - head/lib/libproc

2013-10-27 Thread Mark Johnston
Author: markj
Date: Sun Oct 27 20:39:10 2013
New Revision: 257222
URL: http://svnweb.freebsd.org/changeset/base/257222

Log:
  Clean up the debug printing in libproc a bit. In particular:
  
  * Don't print any error messages to stderr unless DEBUG is defined.
  * Add a DPRINTFX macro for use when errno isn't set.
  * Print the error string from libelf when appropriate.

Modified:
  head/lib/libproc/_libproc.h
  head/lib/libproc/proc_bkpt.c
  head/lib/libproc/proc_create.c
  head/lib/libproc/proc_regs.c
  head/lib/libproc/proc_sym.c
  head/lib/libproc/proc_util.c

Modified: head/lib/libproc/_libproc.h
==
--- head/lib/libproc/_libproc.h Sun Oct 27 18:52:09 2013(r257221)
+++ head/lib/libproc/_libproc.h Sun Oct 27 20:39:10 2013(r257222)
@@ -49,7 +49,9 @@ struct proc_handle {
 };
 
 #ifdef DEBUG
-#define DPRINTF(...)   warn(__VA_ARGS__)
+#defineDPRINTF(...)warn(__VA_ARGS__)
+#defineDPRINTFX(...)   warnx(__VA_ARGS__)
 #else
-#define DPRINTF(...)
+#defineDPRINTF(...)
+#defineDPRINTFX(...)
 #endif

Modified: head/lib/libproc/proc_bkpt.c
==
--- head/lib/libproc/proc_bkpt.cSun Oct 27 18:52:09 2013
(r257221)
+++ head/lib/libproc/proc_bkpt.cSun Oct 27 20:39:10 2013
(r257222)
@@ -78,8 +78,8 @@ proc_bkptset(struct proc_handle *phdl, u
piod.piod_addr = &paddr;
piod.piod_len  = BREAKPOINT_INSTR_SZ;
if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
-   DPRINTF("ERROR: couldn't read instruction at address 0x%" 
PRIuPTR,
-   address);
+   DPRINTF("ERROR: couldn't read instruction at address 0x%"
+   PRIuPTR, address);
return (-1);
}
*saved = paddr;
@@ -93,8 +93,8 @@ proc_bkptset(struct proc_handle *phdl, u
piod.piod_addr = &paddr;
piod.piod_len  = BREAKPOINT_INSTR_SZ;
if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
-   warn("ERROR: couldn't write instruction at address 0x%" PRIuPTR,
-   address);
+   DPRINTF("ERROR: couldn't write instruction at address 0x%"
+   PRIuPTR, address);
return (-1);
}
 
@@ -113,7 +113,7 @@ proc_bkptdel(struct proc_handle *phdl, u
errno = ENOENT;
return (-1);
}
-   DPRINTF("removing breakpoint at 0x%lx\n", address);
+   DPRINTFX("removing breakpoint at 0x%lx\n", address);
/*
 * Overwrite the breakpoint instruction that we setup previously.
 */
@@ -124,8 +124,8 @@ proc_bkptdel(struct proc_handle *phdl, u
piod.piod_addr = &paddr;
piod.piod_len  = BREAKPOINT_INSTR_SZ;
if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
-   DPRINTF("ERROR: couldn't write instruction at address 0x%" 
PRIuPTR,
-   address);
+   DPRINTF("ERROR: couldn't write instruction at address 0x%"
+   PRIuPTR, address);
return (-1);
}
  
@@ -153,12 +153,12 @@ proc_bkptexec(struct proc_handle *phdl, 
int status;
 
if (proc_regget(phdl, REG_PC, &pc) < 0) {
-   warn("ERROR: couldn't get PC register");
+   DPRINTFX("ERROR: couldn't get PC register");
return (-1);
}
proc_bkptregadj(&pc);
if (proc_bkptdel(phdl, pc, saved) < 0) {
-   warn("ERROR: couldn't delete breakpoint");
+   DPRINTFX("ERROR: couldn't delete breakpoint");
return (-1);
}
/*
@@ -167,13 +167,13 @@ proc_bkptexec(struct proc_handle *phdl, 
 */
proc_regset(phdl, REG_PC, pc);
if (ptrace(PT_STEP, proc_getpid(phdl), (caddr_t)1, 0) < 0) {
-   warn("ERROR: ptrace step failed");
+   DPRINTFX("ERROR: ptrace step failed");
return (-1);
}
proc_wstatus(phdl);
status = proc_getwstat(phdl);
if (!WIFSTOPPED(status)) {
-   warn("ERROR: don't know why process stopped");
+   DPRINTFX("ERROR: don't know why process stopped");
return (-1);
}
/*
@@ -181,7 +181,7 @@ proc_bkptexec(struct proc_handle *phdl, 
 * the same as the one that we were passed in.
 */
if (proc_bkptset(phdl, pc, &samesaved) < 0) {
-   warn("ERROR: couldn't restore breakpoint");
+   DPRINTFX("ERROR: couldn't restore breakpoint");
return (-1);
}
assert(samesaved == saved);

Modified: head/lib/libproc/proc_create.c
==
--- head/lib/libproc/proc_create.c  Sun Oct 27 18:52:09 2013
(r257221)
+++ head/lib/libproc/proc_create.c   

svn commit: r257223 - head/sys/netpfil/pf

2013-10-27 Thread Baptiste Daroussin
Author: bapt
Date: Sun Oct 27 20:44:42 2013
New Revision: 257223
URL: http://svnweb.freebsd.org/changeset/base/257223

Log:
  Import pf.c 1.635 and pf_lb.c 1.4 from OpenBSD
  
  Stricter state checking for ICMP and ICMPv6 packets: include the ICMP type
  
  in one port of the state key, using the type to determine which
  side should be the id, and which should be the type. Also:
  - Handle ICMP6 messages which are typically sent to multicast
addresses but recieve unicast replies, by doing fallthrough lookups
against the correct multicast address.  - Clear up some mistaken
assumptions in the PF code:
  - Not all ICMP packets have an icmp_id, so simulate
one based on other data if we can, otherwise set it to 0.
- Don't modify the icmp id field in NAT unless it's echo
- Use the full range of possible id's when NATing icmp6 echoy
  
  Difference with OpenBSD version:
  - C99ify the new code
  - WITHOUT_INET6 safe
  
  Reviewed by:  glebius
  Obtained from:OpenBSD

Modified:
  head/sys/netpfil/pf/pf.c
  head/sys/netpfil/pf/pf_lb.c

Modified: head/sys/netpfil/pf/pf.c
==
--- head/sys/netpfil/pf/pf.cSun Oct 27 20:39:10 2013(r257222)
+++ head/sys/netpfil/pf/pf.cSun Oct 27 20:44:42 2013(r257223)
@@ -210,6 +210,8 @@ static void  pf_change_ap(struct pf_add
u_int16_t, u_int8_t, sa_family_t);
 static int  pf_modulate_sack(struct mbuf *, int, struct pf_pdesc *,
struct tcphdr *, struct pf_state_peer *);
+static int  pf_icmp_mapping(struct pf_pdesc *, uint8_t, int *,
+   int *, uint16_t *, uint16_t *);
 static void pf_change_icmp(struct pf_addr *, u_int16_t *,
struct pf_addr *, struct pf_addr *, u_int16_t,
u_int16_t *, u_int16_t *, u_int16_t *,
@@ -256,6 +258,10 @@ static int  pf_test_state_tcp(struct pf
 static int  pf_test_state_udp(struct pf_state **, int,
struct pfi_kif *, struct mbuf *, int,
void *, struct pf_pdesc *);
+static int  pf_icmp_state_lookup(struct pf_state_key_cmp *,
+   struct pf_pdesc *, struct pf_state **, struct mbuf 
*,
+   int, struct pfi_kif *, uint16_t, uint16_t,
+   int, int *, int);
 static int  pf_test_state_icmp(struct pf_state **, int,
struct pfi_kif *, struct mbuf *, int,
void *, struct pf_pdesc *, u_short *);
@@ -304,6 +310,8 @@ VNET_DECLARE(int, pf_end_threads);
 
 VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]);
 
+enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK };
+
 #definePACKET_LOOPED(pd)   ((pd)->pf_mtag &&   
\
 (pd)->pf_mtag->flags & PF_PACKET_LOOPED)
 
@@ -2018,6 +2026,155 @@ pf_change_a6(struct pf_addr *a, u_int16_
 }
 #endif /* INET6 */
 
+static int
+pf_icmp_mapping(struct pf_pdesc *pd, uint8_t type,
+int *icmp_dir, int *multi, uint16_t *icmpid, uint16_t *icmptype)
+{
+   /*
+* ICMP types marked with PF_OUT are typically responses to
+* PF_IN, and will match states in the opposite direction.
+* PF_IN ICMP types need to match a state with that type.
+*/
+   *icmp_dir = PF_OUT;
+   *multi = PF_ICMP_MULTI_LINK;
+   /* Queries (and responses) */
+   switch (type) {
+   case ICMP_ECHO:
+   *icmp_dir = PF_IN;
+   case ICMP_ECHOREPLY:
+   *icmptype = ICMP_ECHO;
+   *icmpid = pd->hdr.icmp->icmp_id;
+   break;
+
+   case ICMP_TSTAMP:
+   *icmp_dir = PF_IN;
+   case ICMP_TSTAMPREPLY:
+   *icmptype = ICMP_TSTAMP;
+   *icmpid = 0; /* Time is not a secret. */
+   break;
+
+   case ICMP_IREQ:
+   *icmp_dir = PF_IN;
+   case ICMP_IREQREPLY:
+   *icmptype = ICMP_IREQ;
+   *icmpid = 0; /* Nothing sane to match on! */
+   break;
+
+   case ICMP_MASKREQ:
+   *icmp_dir = PF_IN;
+   case ICMP_MASKREPLY:
+   *icmptype = ICMP_MASKREQ;
+   *icmpid = 0; /* Nothing sane to match on! */
+   break;
+
+   case ICMP_IPV6_WHEREAREYOU:
+   *icmp_dir = PF_IN;
+   case ICMP_IPV6_IAMHERE:
+   *icmptype = ICMP_IPV6_WHEREAREYOU;
+   *icmpid = 0; /* Nothing sane to match on! */
+   break;
+
+   case ICMP_MOBILE_REGREQUEST:
+   *icmp_dir = PF_IN;
+   case ICMP_MOBILE_REGREPLY:
+   *icmptype = ICMP_MOBILE_REGREQUEST;
+   *icmpid = 0; /* Nothing sane to match on! */
+   break;
+
+   case ICMP_ROUTERSOLICIT:
+

svn commit: r257224 - head/sys/netpfil/pf

2013-10-27 Thread Baptiste Daroussin
Author: bapt
Date: Sun Oct 27 20:52:09 2013
New Revision: 257224
URL: http://svnweb.freebsd.org/changeset/base/257224

Log:
  Improt pf.c 1.636 from OpenBSD
  
  Original log:
  Make sure pd2 has a pointer to the icmp header in the payload; fixes
  panic seen with some some icmp types in icmp error message payloads.
  
  Obtained from:OpenBSD

Modified:
  head/sys/netpfil/pf/pf.c

Modified: head/sys/netpfil/pf/pf.c
==
--- head/sys/netpfil/pf/pf.cSun Oct 27 20:44:42 2013(r257223)
+++ head/sys/netpfil/pf/pf.cSun Oct 27 20:52:09 2013(r257224)
@@ -4994,7 +4994,7 @@ pf_test_state_icmp(struct pf_state **sta
return (PF_DROP);
}
 
-   icmpid = iih.icmp_id;
+   pd2.hdr.icmp = &iih;
pf_icmp_mapping(&pd2, iih.icmp_type,
&icmp_dir, &multi, &virtual_id, &virtual_type);
 
@@ -5049,6 +5049,7 @@ pf_test_state_icmp(struct pf_state **sta
return (PF_DROP);
}
 
+   pd2.hdr.icmp6 = &iih;
pf_icmp_mapping(&pd2, iih.icmp6_type,
&icmp_dir, &multi, &virtual_id, &virtual_type);
ret = pf_icmp_state_lookup(&key, &pd2, state, m,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257225 - head/sys/netpfil/pf

2013-10-27 Thread Baptiste Daroussin
Author: bapt
Date: Sun Oct 27 20:56:23 2013
New Revision: 257225
URL: http://svnweb.freebsd.org/changeset/base/257225

Log:
  Import pf.c 1.638 from OpenBSD
  
  Original log:
  Some ICMP types that also have icmp_id, pointed out by markus@
  
  Obtained from:OpenBSD

Modified:
  head/sys/netpfil/pf/pf.c

Modified: head/sys/netpfil/pf/pf.c
==
--- head/sys/netpfil/pf/pf.cSun Oct 27 20:52:09 2013(r257224)
+++ head/sys/netpfil/pf/pf.cSun Oct 27 20:56:23 2013(r257225)
@@ -2050,21 +2050,21 @@ pf_icmp_mapping(struct pf_pdesc *pd, uin
*icmp_dir = PF_IN;
case ICMP_TSTAMPREPLY:
*icmptype = ICMP_TSTAMP;
-   *icmpid = 0; /* Time is not a secret. */
+   *icmpid = pd->hdr.icmp->icmp_id;
break;
 
case ICMP_IREQ:
*icmp_dir = PF_IN;
case ICMP_IREQREPLY:
*icmptype = ICMP_IREQ;
-   *icmpid = 0; /* Nothing sane to match on! */
+   *icmpid = pd->hdr.icmp->icmp_id;
break;
 
case ICMP_MASKREQ:
*icmp_dir = PF_IN;
case ICMP_MASKREPLY:
*icmptype = ICMP_MASKREQ;
-   *icmpid = 0; /* Nothing sane to match on! */
+   *icmpid = pd->hdr.icmp->icmp_id;
break;
 
case ICMP_IPV6_WHEREAREYOU:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257226 - head/usr.sbin/edquota

2013-10-27 Thread Jilles Tjoelker
Author: jilles
Date: Sun Oct 27 21:06:17 2013
New Revision: 257226
URL: http://svnweb.freebsd.org/changeset/base/257226

Log:
  edquota: Don't pass fd for temporary file to editor.
  
  The editor opens the temporary file by name.

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

Modified: head/usr.sbin/edquota/edquota.c
==
--- head/usr.sbin/edquota/edquota.c Sun Oct 27 20:56:23 2013
(r257225)
+++ head/usr.sbin/edquota/edquota.c Sun Oct 27 21:06:17 2013
(r257226)
@@ -284,7 +284,7 @@ main(int argc, char *argv[])
freeprivs(protoprivs);
exit(0);
}
-   tmpfd = mkstemp(tmpfil);
+   tmpfd = mkostemp(tmpfil, O_CLOEXEC);
fchown(tmpfd, getuid(), getgid());
if (tflag) {
if ((protoprivs = getprivs(0, quotatype, fspath)) != NULL) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257227 - head/sbin/pfctl

2013-10-27 Thread Baptiste Daroussin
Author: bapt
Date: Sun Oct 27 21:07:37 2013
New Revision: 257227
URL: http://svnweb.freebsd.org/changeset/base/257227

Log:
  Import pf_print_state.c 1.54 from OpenBSD
  
  Original log:
  pfctl -ss printed state levels for ICMPv6. Disable this the same
  way it has already been done for ICMPv4.
  
  Difference with OpenBSD:
  - WITHOUT_INET6 safe
  
  Obtained from:OpenBSD

Modified:
  head/sbin/pfctl/pf_print_state.c

Modified: head/sbin/pfctl/pf_print_state.c
==
--- head/sbin/pfctl/pf_print_state.cSun Oct 27 21:06:17 2013
(r257226)
+++ head/sbin/pfctl/pf_print_state.cSun Oct 27 21:07:37 2013
(r257227)
@@ -285,8 +285,13 @@ print_state(struct pfsync_state *s, int 
const char *states[] = PFUDPS_NAMES;
 
printf("   %s:%s\n", states[src->state], states[dst->state]);
+#ifndef INET6
} else if (s->proto != IPPROTO_ICMP && src->state < PFOTHERS_NSTATES &&
dst->state < PFOTHERS_NSTATES) {
+#else
+   } else if (s->proto != IPPROTO_ICMP && s->proto != IPPROTO_ICMPV6 &&
+   src->state < PFOTHERS_NSTATES && dst->state < PFOTHERS_NSTATES) {
+#endif
/* XXX ICMP doesn't really have state levels */
const char *states[] = PFOTHERS_NAMES;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257217 - in head/sys/arm: arm include

2013-10-27 Thread Bruce Evans

On Sun, 27 Oct 2013, Ian Lepore wrote:


Log:
 Remove the last dregs of trapframe_t.  It turns out only arm was using
 this type, so remove it to make arm code more consistant with other
 platforms.  Thanks to bde@ for pointing out only arm used trapframe_t.


Thanks.

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


Re: svn commit: r252010 - head/sys/geom/mirror

2013-10-27 Thread Alexander Motin

On 27.10.2013 20:36, Slawa Olhovchenkov wrote:

On Wed, Jun 19, 2013 at 09:52:32PM +, Scott Long wrote:


Author: scottl
Date: Wed Jun 19 21:52:32 2013
New Revision: 252010
URL: http://svnweb.freebsd.org/changeset/base/252010

Log:
   Mark geom_mirror as capable of unmapped i/o


Can you add capable of unmapped i/o to geom_stripe?


I've added support for unmapped I/O for STRIPE and CONCAT as part of my 
GEOM direct dispatch commit (r256880). I've forgot to mention it in the 
commit message.


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


Re: svn commit: r252010 - head/sys/geom/mirror

2013-10-27 Thread Slawa Olhovchenkov
On Mon, Oct 28, 2013 at 12:27:02AM +0200, Alexander Motin wrote:

> On 27.10.2013 20:36, Slawa Olhovchenkov wrote:
> > On Wed, Jun 19, 2013 at 09:52:32PM +, Scott Long wrote:
> >
> >> Author: scottl
> >> Date: Wed Jun 19 21:52:32 2013
> >> New Revision: 252010
> >> URL: http://svnweb.freebsd.org/changeset/base/252010
> >>
> >> Log:
> >>Mark geom_mirror as capable of unmapped i/o
> >
> > Can you add capable of unmapped i/o to geom_stripe?
> 
> I've added support for unmapped I/O for STRIPE and CONCAT as part of my 
> GEOM direct dispatch commit (r256880). I've forgot to mention it in the 
> commit message.

Thanks!
Can I direct applay this commit to 10.x?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r252010 - head/sys/geom/mirror

2013-10-27 Thread Alexander Motin

On 27.10.2013 23:32, Slawa Olhovchenkov wrote:

On Mon, Oct 28, 2013 at 12:27:02AM +0200, Alexander Motin wrote:


On 27.10.2013 20:36, Slawa Olhovchenkov wrote:

On Wed, Jun 19, 2013 at 09:52:32PM +, Scott Long wrote:


Author: scottl
Date: Wed Jun 19 21:52:32 2013
New Revision: 252010
URL: http://svnweb.freebsd.org/changeset/base/252010

Log:
Mark geom_mirror as capable of unmapped i/o


Can you add capable of unmapped i/o to geom_stripe?


I've added support for unmapped I/O for STRIPE and CONCAT as part of my
GEOM direct dispatch commit (r256880). I've forgot to mention it in the
commit message.


Thanks!
Can I direct applay this commit to 10.x?


You may wish/need to pick up some other nearby commits of mine too. I've 
tested that at some point, but then cut the big patch into several 
commits separated by few days. I plan to merge it all to 10/9-STABLE 
after 10.0 cycle complete.


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


svn commit: r257228 - in head/sys: arm/arm ia64/ia64 kern mips/mips powerpc/powerpc sparc64/include sys x86/x86

2013-10-27 Thread Konstantin Belousov
Author: kib
Date: Sun Oct 27 21:39:16 2013
New Revision: 257228
URL: http://svnweb.freebsd.org/changeset/base/257228

Log:
  Add bus_dmamap_load_ma() function to load map with the array of
  vm_pages.  Provide trivial implementation which forwards the load to
  _bus_dmamap_load_phys() page by page.  Right now all architectures use
  bus_dmamap_load_ma_triv().
  
  Tested by:pho (as part of the functional patch)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 month

Modified:
  head/sys/arm/arm/busdma_machdep-v6.c
  head/sys/arm/arm/busdma_machdep.c
  head/sys/ia64/ia64/busdma_machdep.c
  head/sys/kern/subr_bus_dma.c
  head/sys/mips/mips/busdma_machdep.c
  head/sys/powerpc/powerpc/busdma_machdep.c
  head/sys/sparc64/include/bus_dma.h
  head/sys/sys/bus_dma.h
  head/sys/x86/x86/busdma_machdep.c

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==
--- head/sys/arm/arm/busdma_machdep-v6.cSun Oct 27 21:07:37 2013
(r257227)
+++ head/sys/arm/arm/busdma_machdep-v6.cSun Oct 27 21:39:16 2013
(r257228)
@@ -975,6 +975,16 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat
return (0);
 }
 
+int
+_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map,
+struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags,
+bus_dma_segment_t *segs, int *segp)
+{
+
+   return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags,
+   segs, segp));
+}
+
 /*
  * Utility function to load a linear buffer.  segp contains
  * the starting segment on entrace, and the ending segment on exit.

Modified: head/sys/arm/arm/busdma_machdep.c
==
--- head/sys/arm/arm/busdma_machdep.c   Sun Oct 27 21:07:37 2013
(r257227)
+++ head/sys/arm/arm/busdma_machdep.c   Sun Oct 27 21:39:16 2013
(r257228)
@@ -992,6 +992,17 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat
}
return (0);
 }
+
+int
+_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map,
+struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags,
+bus_dma_segment_t *segs, int *segp)
+{
+
+   return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags,
+   segs, segp));
+}
+
 /*
  * Utility function to load a linear buffer.  segp contains
  * the starting segment on entrance, and the ending segment on exit.

Modified: head/sys/ia64/ia64/busdma_machdep.c
==
--- head/sys/ia64/ia64/busdma_machdep.c Sun Oct 27 21:07:37 2013
(r257227)
+++ head/sys/ia64/ia64/busdma_machdep.c Sun Oct 27 21:39:16 2013
(r257228)
@@ -658,6 +658,17 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat
 */
return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */
 }
+
+int
+_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map,
+struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags,
+bus_dma_segment_t *segs, int *segp)
+{
+
+   return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags,
+   segs, segp));
+}
+
 /*
  * Utility function to load a linear buffer.  segp contains
  * the starting segment on entrace, and the ending segment on exit.

Modified: head/sys/kern/subr_bus_dma.c
==
--- head/sys/kern/subr_bus_dma.cSun Oct 27 21:07:37 2013
(r257227)
+++ head/sys/kern/subr_bus_dma.cSun Oct 27 21:39:16 2013
(r257228)
@@ -124,24 +124,33 @@ static int
 _bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio,
 int *nsegs, int flags)
 {
-   vm_paddr_t paddr;
-   bus_size_t len, tlen;
-   int error, i, ma_offs;
+   int error;
 
if ((bio->bio_flags & BIO_UNMAPPED) == 0) {
error = _bus_dmamap_load_buffer(dmat, map, bio->bio_data,
bio->bio_bcount, kernel_pmap, flags, NULL, nsegs);
-   return (error);
+   } else {
+   error = _bus_dmamap_load_ma(dmat, map, bio->bio_ma,
+   bio->bio_bcount, bio->bio_ma_offset, flags, NULL, nsegs);
}
+   return (error);
+}
+
+int
+bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, bus_dmamap_t map,
+struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags,
+bus_dma_segment_t *segs, int *segp)
+{
+   vm_paddr_t paddr;
+   bus_size_t len;
+   int error, i;
 
error = 0;
-   tlen = bio->bio_bcount;
-   ma_offs = bio->bio_ma_offset;
for (i = 0; tlen > 0; i++, tlen -= len) {
len = min(PAGE_SIZE - ma_offs, tlen);
-   paddr = VM_PAGE_TO_PHYS(bio->bio_ma[i]) + ma_offs;
+   paddr = VM_PAGE_TO_PHYS(ma[i]) + ma_offs;
error = _bus_dmamap_load_phys(dmat, map, paddr, len,
-   flags, NULL, nsegs);
+   flags, segs, segp);
  

Re: svn commit: r257203 - head/sys/arm/arm

2013-10-27 Thread Bruce Evans

On Sun, 27 Oct 2013, Ian Lepore wrote:


On Mon, 2013-10-28 at 04:42 +1100, Bruce Evans wrote:

On Sun, 27 Oct 2013, Ian Lepore wrote:


Log:
 Eliminate a compiler warning about extraneous parens.


Wow, what flags give these warnings?


--- busdma_machdep.o ---
/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: 
warning: equality comparison with extraneous parentheses 
[-Wparentheses-equality]
   if ((map->pagesneeded == 0)) {
~^~~~


Ahh.  I guess what I really want is -Wredundant-parentheses
-Wredundant-braces ...  The parser can easily tell what is redundant
than what is bogus since bogusness depends on style and too many
suboptions would be required to specify styles
(-Wparentheses[-operator][-context].

Oops, the parser easily can't do this right because macro parameters
must usually have redundant parentheses and C parsers are specified
to act as if on the output of the preprocessor so they can't easily
either have a special case to ignore these redundant parentheses or
know that they aren't in the unpreprocessed source so they should be
ignored.


/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: 
note: remove extraneous parentheses around the comparison to silence this 
warning
   if ((map->pagesneeded == 0)) {
   ~ ^   ~
/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: 
note: use '=' to turn this equality comparison into an assignment
   if ((map->pagesneeded == 0)) {
 ^~
 =

That's what the compiler had to say about it.  I guess in somebody's
mind if it's a probable error to have done
...


This expression could be the result of a macro

#define ISZERO(x)   ((x) == 0)

which for if (ISZERO(map->pagesneeded)) expands to almost the above.  I
guess clang warns excessively about this.


The warning doesn't bother me as much as the two useless notes that
follow it (which are annoying when combined with my editor's feature of
parsing compiler output and jumping to the next error point in the
code).  I've notice clang is particularly chatty, with things like
suggesting what you might have meant when you spell a variable name
wrong.  Before long it's going to be like RPG and COBOL where it's
willing to assume what you meant and try to generate runnable code in
the face of almost any error.


The verbose prettyprinted output can be annoying.  If clang would print
its man page then I might know its options so I could turn it off :-).


I probably date myself with references to RPG and COBOL, but it does
bring back fond memories of slapping a boilerplate header on every
interoffice memo issued by management and running it through the cobol
compiler, and grading them on whether their memos generated runnable
code or so many errors the compiler gave up.


I started late enough to not touch these or spend more than 2 years on
accounting-related software.

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


svn commit: r257230 - in head/sys: conf x86/include x86/x86

2013-10-27 Thread Konstantin Belousov
Author: kib
Date: Sun Oct 27 22:05:10 2013
New Revision: 257230
URL: http://svnweb.freebsd.org/changeset/base/257230

Log:
  Add a virtual table for the busdma methods on x86, to allow different
  busdma implementations to coexist.  Copy busdma_machdep.c to
  busdma_bounce.c, which is still a single implementation of the busdma
  interface on x86 for now.  The busdma_machdep.c only contains common
  and dispatch code.
  
  Tested by:pho (as part of the larger patch)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 month

Added:
  head/sys/x86/include/busdma_impl.h   (contents, props changed)
  head/sys/x86/x86/busdma_bounce.c
 - copied, changed from r257229, head/sys/x86/x86/busdma_machdep.c
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/conf/files.pc98
  head/sys/x86/x86/busdma_machdep.c

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Sun Oct 27 21:49:52 2013(r257229)
+++ head/sys/conf/files.amd64   Sun Oct 27 22:05:10 2013(r257230)
@@ -541,6 +541,7 @@ x86/isa/nmi.c   standard
 x86/isa/orm.c  optionalisa
 x86/pci/pci_bus.c  optionalpci
 x86/pci/qpi.c  optionalpci
+x86/x86/busdma_bounce.cstandard
 x86/x86/busdma_machdep.c   standard
 x86/x86/dump_machdep.c standard
 x86/x86/fdt_machdep.c  optionalfdt

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Sun Oct 27 21:49:52 2013(r257229)
+++ head/sys/conf/files.i386Sun Oct 27 22:05:10 2013(r257230)
@@ -564,6 +564,7 @@ x86/isa/nmi.c   standard
 x86/isa/orm.c  optional isa
 x86/pci/pci_bus.c  optional pci
 x86/pci/qpi.c  optional pci
+x86/x86/busdma_bounce.cstandard
 x86/x86/busdma_machdep.c   standard
 x86/x86/dump_machdep.c standard
 x86/x86/fdt_machdep.c  optional fdt

Modified: head/sys/conf/files.pc98
==
--- head/sys/conf/files.pc98Sun Oct 27 21:49:52 2013(r257229)
+++ head/sys/conf/files.pc98Sun Oct 27 22:05:10 2013(r257230)
@@ -247,6 +247,7 @@ x86/isa/atpic.c optional atpic  
 x86/isa/clock.cstandard
 x86/isa/isa.c  optional isa
 x86/pci/pci_bus.c  optional pci
+x86/x86/busdma_bounce.cstandard
 x86/x86/busdma_machdep.c   standard
 x86/x86/dump_machdep.c standard
 x86/x86/intr_machdep.c standard

Added: head/sys/x86/include/busdma_impl.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/x86/include/busdma_impl.h  Sun Oct 27 22:05:10 2013
(r257230)
@@ -0,0 +1,97 @@
+/*-
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov 
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef__X86_BUSDMA_IMPL_H
+#define__X86_BUSDMA_IMPL_H
+
+struct bus_dma_tag_common {
+   struct bus_dma_impl *impl;
+   struct bus_dma_tag_common *parent;
+   bus_size_talignment;
+   bus_addr_tboundary;
+   bus_addr_tlowaddr;
+   bus_addr_thighaddr;
+   bus_dma_filter_t *filter;
+   void *filte

Re: svn commit: r257203 - head/sys/arm/arm

2013-10-27 Thread Jilles Tjoelker
On Mon, Oct 28, 2013 at 08:43:37AM +1100, Bruce Evans wrote:
> On Sun, 27 Oct 2013, Ian Lepore wrote:

> >On Mon, 2013-10-28 at 04:42 +1100, Bruce Evans wrote:
> >>On Sun, 27 Oct 2013, Ian Lepore wrote:
> >>
> >>>Log:
> >>> Eliminate a compiler warning about extraneous parens.
> >>
> >>Wow, what flags give these warnings?

> >--- busdma_machdep.o ---
> >/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: 
> >warning: equality comparison with extraneous parentheses 
> >[-Wparentheses-equality]
> >   if ((map->pagesneeded == 0)) {
> >~^~~~

> Ahh.  I guess what I really want is -Wredundant-parentheses
> -Wredundant-braces ...  The parser can easily tell what is redundant
> than what is bogus since bogusness depends on style and too many
> suboptions would be required to specify styles
> (-Wparentheses[-operator][-context].

> Oops, the parser easily can't do this right because macro parameters
> must usually have redundant parentheses and C parsers are specified
> to act as if on the output of the preprocessor so they can't easily
> either have a special case to ignore these redundant parentheses or
> know that they aren't in the unpreprocessed source so they should be
> ignored.

> >/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: 
> >note: remove extraneous parentheses around the comparison to silence this 
> >warning
> >   if ((map->pagesneeded == 0)) {
> >   ~ ^   ~
> >/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: 
> >note: use '=' to turn this equality comparison into an assignment
> >   if ((map->pagesneeded == 0)) {
> > ^~
> > =

> >That's what the compiler had to say about it.  I guess in somebody's
> >mind if it's a probable error to have done
> >...

> This expression could be the result of a macro

> #define   ISZERO(x)   ((x) == 0)

> which for if (ISZERO(map->pagesneeded)) expands to almost the above.  I
> guess clang warns excessively about this.

Clang takes advantage of its internal preprocessor to suppress certain
warnings in results of macro expansion. In fact, this is what makes
-Wparentheses-equality possible at all. It does not violate the C
standard, since it is only used to decide whether to issue certain
warnings and does not affect the semantics of the code.

This check breaks down when the internal preprocessor is not used, such
as with ccache.

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


svn commit: r257231 - head/sys/arm/include

2013-10-27 Thread Olivier Houchard
Author: cognet
Date: Sun Oct 27 22:15:50 2013
New Revision: 257231
URL: http://svnweb.freebsd.org/changeset/base/257231

Log:
  Make sure the PCB is aligned on 8 bytes, we may use ldrd/strd to access it,
  which may have strong alignment requirements.

Modified:
  head/sys/arm/include/pcb.h

Modified: head/sys/arm/include/pcb.h
==
--- head/sys/arm/include/pcb.h  Sun Oct 27 22:05:10 2013(r257230)
+++ head/sys/arm/include/pcb.h  Sun Oct 27 22:15:50 2013(r257231)
@@ -81,7 +81,11 @@ struct pcb {
struct  pcb_arm32 un_32;
struct vfp_state pcb_vfpstate;  /* VP/NEON state */
u_int pcb_vfpcpu;   /* VP/NEON last cpu */
-};
+} __aligned(8); /* 
+* We need the PCB to be aligned on 8 bytes, as we may
+* access it using ldrd/strd, and some CPUs require it
+* to by aligned on 8 bytes.
+*/
 
 /*
  * No additional data for core dumps.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257233 - head/lib/csu/arm

2013-10-27 Thread Olivier Houchard
Author: cognet
Date: Sun Oct 27 23:48:59 2013
New Revision: 257233
URL: http://svnweb.freebsd.org/changeset/base/257233

Log:
  Use the size of the MACHINE_ARCH string instead of sizeof(uint32_t). It can
  happen sizeof(MACHINE_ARCH) is more than 4 bytes, and bad things would
  happen. This should make the ctors being called again on armeb.

Modified:
  head/lib/csu/arm/crt1.c

Modified: head/lib/csu/arm/crt1.c
==
--- head/lib/csu/arm/crt1.c Sun Oct 27 22:18:27 2013(r257232)
+++ head/lib/csu/arm/crt1.c Sun Oct 27 23:48:59 2013(r257233)
@@ -123,7 +123,7 @@ static const struct {
chardesc[sizeof(MACHINE_ARCH)];
 } archtag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = {
.namesz = sizeof(NOTE_FREEBSD_VENDOR),
-   .descsz = sizeof(int32_t),
+   .descsz = sizeof(MACHINE_ARCH),
.type = ARCH_NOTETYPE,
.name = NOTE_FREEBSD_VENDOR,
.desc = MACHINE_ARCH
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257234 - head/usr.bin/procstat

2013-10-27 Thread Mark Johnston
Author: markj
Date: Mon Oct 28 00:20:30 2013
New Revision: 257234
URL: http://svnweb.freebsd.org/changeset/base/257234

Log:
  With r247602, the "c" flag is no longer printed as a file descriptor flag.
  
  Reviewed by:  pjd
  MFC after:3 days

Modified:
  head/usr.bin/procstat/procstat.1

Modified: head/usr.bin/procstat/procstat.1
==
--- head/usr.bin/procstat/procstat.1Sun Oct 27 23:48:59 2013
(r257233)
+++ head/usr.bin/procstat/procstat.1Mon Oct 28 00:20:30 2013
(r257234)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 17, 2013
+.Dd October 27, 2013
 .Dt PROCSTAT 1
 .Os
 .Sh NAME
@@ -225,8 +225,6 @@ non-blocking
 direct I/O
 .It l
 lock held
-.It c
-descriptor is a capability
 .El
 .Pp
 If the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257235 - head/lib/libproc

2013-10-27 Thread Mark Johnston
Author: markj
Date: Mon Oct 28 01:41:59 2013
New Revision: 257235
URL: http://svnweb.freebsd.org/changeset/base/257235

Log:
  Remove an incorrect debug printf.

Modified:
  head/lib/libproc/proc_sym.c

Modified: head/lib/libproc/proc_sym.c
==
--- head/lib/libproc/proc_sym.c Mon Oct 28 00:20:30 2013(r257234)
+++ head/lib/libproc/proc_sym.c Mon Oct 28 01:41:59 2013(r257235)
@@ -460,7 +460,6 @@ proc_name2sym(struct proc_handle *p, con
 * Then look up the string name in STRTAB (.dynstr)
 */
if ((data = elf_getdata(dynsymscn, NULL))) {
-   DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1));
i = 0;
while (gelf_getsym(data, i++, &sym) != NULL) {
s = elf_strptr(e, dynsymstridx, sym.st_name);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257236 - head/sys/dev/lmc

2013-10-27 Thread Sean Bruno
Author: sbruno
Date: Mon Oct 28 02:36:34 2013
New Revision: 257236
URL: http://svnweb.freebsd.org/changeset/base/257236

Log:
  Quiesce warning -Wmissing-variable-declarations from buildworld, which is
  slightly unnerving.
  
  In file included from ioctl.c:48:
  /var/tmp/home/sbruno/bsd/head/tmp/usr/include/dev/lmc/if_lmc.h:939:13:
  warning: no previous extern declaration for non-static variable 'ssi_cables'
  [-Wmissing-variable-declarations]
  const char *ssi_cables[] =

Modified:
  head/sys/dev/lmc/if_lmc.h

Modified: head/sys/dev/lmc/if_lmc.h
==
--- head/sys/dev/lmc/if_lmc.h   Mon Oct 28 01:41:59 2013(r257235)
+++ head/sys/dev/lmc/if_lmc.h   Mon Oct 28 02:36:34 2013(r257236)
@@ -936,7 +936,7 @@ struct ioctl
 #define IOCTL_RESET_CNTRS54/* reset event counters*/
 
 /* storage for these strings is allocated here! */
-const char *ssi_cables[] =
+static const char *ssi_cables[] =
   {
   "V.10/EIA423",
   "V.11/EIA530A",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257239 - head/gnu/usr.bin/binutils/ld

2013-10-27 Thread Eygene Ryabinkin
Author: rea (ports committer)
Date: Mon Oct 28 05:55:47 2013
New Revision: 257239
URL: http://svnweb.freebsd.org/changeset/base/257239

Log:
  Correct ld(1) manual page for --no-add-needed set as default after r253839
  
  Approved by:  dim
  MFC after:2 weeks

Modified:
  head/gnu/usr.bin/binutils/ld/ld.1

Modified: head/gnu/usr.bin/binutils/ld/ld.1
==
--- head/gnu/usr.bin/binutils/ld/ld.1   Mon Oct 28 04:41:49 2013
(r257238)
+++ head/gnu/usr.bin/binutils/ld/ld.1   Mon Oct 28 05:55:47 2013
(r257239)
@@ -929,20 +929,6 @@ the default behaviour of the linker, bef
 behaviour from release 2.14 onwards is to reject such input files, and
 so the \fB\-\-accept\-unknown\-input\-arch\fR option has been added to
 restore the old behaviour.
-.IP "\fB\-\-as\-needed\fR" 4
-.IX Item "--as-needed"
-.PD 0
-.IP "\fB\-\-no\-as\-needed\fR" 4
-.IX Item "--no-as-needed"
-.PD
-This option affects \s-1ELF\s0 \s-1DT_NEEDED\s0 tags for dynamic libraries 
mentioned
-on the command line after the \fB\-\-as\-needed\fR option.  Normally,
-the linker will add a \s-1DT_NEEDED\s0 tag for each dynamic library mentioned
-on the command line, regardless of whether the library is actually
-needed.  \fB\-\-as\-needed\fR causes \s-1DT_NEEDED\s0 tags to only be emitted
-for libraries that satisfy some symbol reference from regular objects
-which is undefined at the point that the library was linked.
-\&\fB\-\-no\-as\-needed\fR restores the default behaviour.
 .IP "\fB\-\-add\-needed\fR" 4
 .IX Item "--add-needed"
 .PD 0
@@ -951,11 +937,25 @@ which is undefined at the point that the
 .PD
 This option affects the treatment of dynamic libraries from \s-1ELF\s0
 \&\s-1DT_NEEDED\s0 tags in dynamic libraries mentioned on the command line 
after
-the \fB\-\-no\-add\-needed\fR option.  Normally, the linker will add
-a \s-1DT_NEEDED\s0 tag for each dynamic library from \s-1DT_NEEDED\s0 tags.
-\&\fB\-\-no\-add\-needed\fR causes \s-1DT_NEEDED\s0 tags will never be emitted
-for those libraries from \s-1DT_NEEDED\s0 tags. \fB\-\-add\-needed\fR restores
-the default behaviour.
+the \fB\-\-add\-needed\fR option.  Normally, the linker will not copy
+a \s-1DT_NEEDED\s0 tags from each dynamic library to the produced output 
object.
+\&\fB\-\-add\-needed\fR makes linker to copy \s-1DT_NEEDED\s0 tags from all
+dynamic libraries mentioned after this flag.
+\fB\-\-no\-add\-needed\fR restores the default behaviour.
+.IP "\fB\-\-as\-needed\fR" 4
+.IX Item "--as-needed"
+.PD 0
+.IP "\fB\-\-no\-as\-needed\fR" 4
+.IX Item "--no-as-needed"
+.PD
+This option affects \s-1ELF\s0 \s-1DT_NEEDED\s0 tags for dynamic
+libraries mentioned on the command line after the \fB\-\-as\-needed\fR
+option when \fB\-\-add\-needed\fR is in effect.
+In such a case \fB\-\-as\-needed\fR causes \s-1DT_NEEDED\s0 tags
+to only be emitted for libraries that satisfy some symbol reference
+from regular objects which is undefined at the point that the library
+was linked.
+\&\fB\-\-no\-as\-needed\fR restores the default behaviour.
 .IP "\fB\-assert\fR \fIkeyword\fR" 4
 .IX Item "-assert keyword"
 This option is ignored for SunOS compatibility.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"