svn commit: r243068 - stable/9/sys/dev/xen/netback

2012-11-14 Thread Dimitry Andric
Author: dim
Date: Thu Nov 15 07:48:44 2012
New Revision: 243068
URL: http://svnweb.freebsd.org/changeset/base/243068

Log:
  MFC r242889 (by rdivacky):
  
Change the XNB_ASSERT from a statement expression to do-while(0) as its
result is never used.
  
  MFC r242934:
  
Redo r242889, now using the method from projects/amd64_xen_pv r240747.
  
Reminded by:kib

Modified:
  stable/9/sys/dev/xen/netback/netback_unit_tests.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/xen/netback/netback_unit_tests.c
==
--- stable/9/sys/dev/xen/netback/netback_unit_tests.c   Thu Nov 15 07:36:38 
2012(r243067)
+++ stable/9/sys/dev/xen/netback/netback_unit_tests.c   Thu Nov 15 07:48:44 
2012(r243068)
@@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$");
 #defineTOSTRING(x) STRINGIFY(x)
 
 /**
- * Writes an error message to buffer if cond is false, and returns true
- * iff the assertion failed.  Note the implied parameters buffer and
+ * Writes an error message to buffer if cond is false
+ * Note the implied parameters buffer and
  * buflen
  */
 #defineXNB_ASSERT(cond) ({ 
\
@@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
strlcat(_buffer, ":" TOSTRING(__LINE__) \
  " Assertion Error: " #cond "\n", _buflen);\
}   \
- ! passed; })
+   })
 
 
 /**
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243067 - stable/9/sys/i386/xen

2012-11-14 Thread Dimitry Andric
Author: dim
Date: Thu Nov 15 07:36:38 2012
New Revision: 243067
URL: http://svnweb.freebsd.org/changeset/base/243067

Log:
  MFC r242931:
  
  Fix a minor warning in sys/i386/xen/clock.c.

Modified:
  stable/9/sys/i386/xen/clock.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/i386/xen/clock.c
==
--- stable/9/sys/i386/xen/clock.c   Thu Nov 15 06:58:18 2012
(r243066)
+++ stable/9/sys/i386/xen/clock.c   Thu Nov 15 07:36:38 2012
(r243067)
@@ -516,7 +516,7 @@ startrtclock()
__cpu_khz = 100ULL << 32;
info = &HYPERVISOR_shared_info->vcpu_info[0].time;
 
-   do_div(__cpu_khz, info->tsc_to_system_mul);
+   (void)do_div(__cpu_khz, info->tsc_to_system_mul);
if ( info->tsc_shift < 0 )
cpu_khz = __cpu_khz << -info->tsc_shift;
else
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r242102 - in head: contrib/bmake usr.bin/bmake

2012-11-14 Thread Bruce Evans

On Wed, 14 Nov 2012, Chris Rees wrote:


On 14 Nov 2012 18:49, "Konstantin Belousov"  wrote:


On Wed, Nov 14, 2012 at 09:28:23AM -0800, David O'Brien wrote:

On Thu, Oct 25, 2012 at 11:18:06PM +, Simon J. Gerraty wrote:

Log:
  Merge bmake-20121010


Hi Simon,
I was kicking the tires on this and noticed bmake is dynamically linked.

Can you change it to being statically linked?

This issue most recently came up in freebsd-current.  See thread pieces


http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033460.html



http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033472.html



http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033473.html


As you see, I prefer to not introduce new statically linked binaries into

base.

If, for unfortunate turns of events, bmake is changed to be statically

linked,

please obey WITH_SHARED_TOOLCHAIN.


Or a /rescue/bmake for when speed is a concern would also be acceptable.


Yes, the big rescue executable is probably even better than dynamic linkage
for pessimizing speeds.  Sizes on freefall now:

%text  data bss dec hex filename
%  130265  19889992  142245   22ba5 /bin/sh
% 5256762133964 2220464 7611190  742336 /rescue/sh
% -r--r--r--  1 root  wheel  3738610 Nov 11 06:48 /usr/lib/libc.a

The dynamically-linked /bin/sh is deceptively small, although it is larger
than the statically linked /bin/sh in FreeBSD-1 for few new features.
When executed, it expands to 16.5MB with 10MB RSS.  I don't know how much
of that is malloc bloat that wouldn't need to be copied on fork, but it
is a lot just to map.  /rescue/sh starts at 5MB and expands to 15.5MB with
9.25MB when executed.  So it is slightly smaller, and its slowness is
determined by its non-locality.  Perhaps its non-locality is not as good
for pessimization as libc's.

I don't use dynamic linkage of course.  /bin/sh is bloated by static
linkage (or rather libc) in the FreeBSD-~5.2 that I usually run:

   textdata bss dec hex filename
 6496238192   64056  721871   b03cf /bin/sh

but this "only" expands to 864K with 580K RSS when executed.  This can be
forked a little faster than 10MB RSS.   In practice the timings for

time whatever/sh -c 'for i in $(jot 1000 1); do echo -n; done'

are:

freefall /bin/sh:6.93 real 1.69 user 5.16 sys
freefall /rescue/sh: 6.86 real 1.65 user 5.13 sys
local/bin/sh:0.21 real 0.01 user 0.18 sys

freefall:
FreeBSD 10.0-CURRENT #4 r242881M: Sun Nov 11 05:30:05 UTC 2012
r...@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL amd64
CPU: Intel(R) Xeon(R) CPU   X5650  @ 2.67GHz (2666.82-MHz K8-class CPU)
  Origin = "GenuineIntel"  Id = 0x206c2  Family = 0x6  Model = 0x2c  Stepping = 
2

local:
FreeBSD 5.2-CURRENT #4395: Sun Apr  8 12:15:03 EST 2012
b...@besplex.bde.org:/c/obj/usr/src/sys/compile/BESPLEX.fw
...
CPU: AMD Athlon(tm) 64 Processor 3200+ (2010.05-MHz 686-class CPU)
  Origin = "AuthenticAMD"  Id = 0xf48  Stepping = 8

freefall may be pessimized by INVARIANTS.  It is pessimized by /bin/echo
being dynamically linked.  Normally shells use builtin echo so the speed
of /bin/echo is unimportant.  There is also some strangeness in the timing
for /bin/echo specifically.  Changing 'echo -n' to
'/bin/rm -f /etc/nonesuch' or /usr/bin/true reduces the times on freefall
by almost a factor of 2, although rm is larger and has to do more:

freefall:
   textdata bss dec hex filename
   2661 540   83209 c89 /bin/echo
  11026 884 152   120622f1e /bin/rm
   1420 484   81912 778 /usr/bin/true
(all dynamically linked to libc only.  truss verifies that rm does a little
more).
freefall /bin/shecho: 6.93 real 1.69 user 5.16 sys
freefall /bin/shrm:   3.83 real 0.91 user 2.84 sys
freefall /bin/shtrue: 3.68 real 0.75 user 2.85 sys
freefall /rescue/sh echo: 6.86 real 1.65 user 5.13 sys
freefall /rescue/sh rm:   3.69 real 0.83 user 2.78 sys
freefall /rescue/sh true: 3.67 real 0.85 user 2.74 sys
local/bin/shecho: 0.21 real 0.01 user 0.18 sys
local/bin/shrm:   0.22 real 0.02 user 0.19 sys
local/bin/shtrue: 0.18 real 0.01 user 0.17 sys
local:
   textdata bss dec hex filename
  11926  60 768   1275431d2 /bin/echo
 3807586752   61772  449282   6db02 /bin/rm
   1639  40 6042283 8eb /usr/bin/true
(all statically linked.  I managed to debloat crtso and libc enough for
/usr/bin/true to be small.  The sources for /bin/echo are excessively
optimized for space in the executable -- they have contortions to avoid
using printf.  But this is useless in -current, since crtso and libc
drag in printf, so that the null program int main(){} has size:

freefall (amd64):
   textdata bss dec hex filename
 316370   12156   55184  383710   5dade null-static
   1452 484   81944 798 null-dyna

svn commit: r243066 - head/sys/conf

2012-11-14 Thread Rui Paulo
Author: rpaulo
Date: Thu Nov 15 06:58:18 2012
New Revision: 243066
URL: http://svnweb.freebsd.org/changeset/base/243066

Log:
  Enable back the clang warning in if_ath.c.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Nov 15 06:04:39 2012(r243065)
+++ head/sys/conf/files Thu Nov 15 06:58:18 2012(r243066)
@@ -701,9 +701,8 @@ dev/ath/if_ath_pci.coptional ath_pci p
 dev/ath/if_ath_ahb.c   optional ath_ahb \
compile-with "${NORMAL_C} -I$S/dev/ath"
 #
-# XXX Work around clang warning, until maintainer approves fix.
 dev/ath/if_ath.c   optional ath \
-   compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} -I$S/dev/ath"
+   compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_beacon.coptional ath \
compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_debug.c optional ath \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243065 - stable/8/sys/dev/sound/pci/hda

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 06:04:39 2012
New Revision: 243065
URL: http://svnweb.freebsd.org/changeset/base/243065

Log:
  MFC r242417:
  ASUS EeePC 1001px has strange variant of ALC269 CODEC, that mutes speaker
  if unused in that configuration mixer at NID 15 is muted.  Probably CODEC
  incorrectly reports its internal connections.  Hide that muter from the
  driver to avoid muting and make built-in speaker work.
  
  There are several different CODECs sharing this ID and I have not enough
  information about them and the bug to implement more universal solution.

Modified:
  stable/8/sys/dev/sound/pci/hda/hdaa_patches.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/pci/   (props changed)

Modified: stable/8/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- stable/8/sys/dev/sound/pci/hda/hdaa_patches.c   Thu Nov 15 06:03:14 
2012(r243064)
+++ stable/8/sys/dev/sound/pci/hda/hdaa_patches.c   Thu Nov 15 06:04:39 
2012(r243065)
@@ -541,6 +541,21 @@ hdaa_patch(struct hdaa_devinfo *devinfo)
if (w != NULL)
w->connsenable[0] = 0;
break;
+   case HDA_CODEC_ALC269:
+   /*
+* ASUS EeePC 1001px has strange variant of ALC269 CODEC,
+* that mutes speaker if unused mixer at NID 15 is muted.
+* Probably CODEC incorrectly reports internal connections.
+* Hide that muter from the driver.  There are several CODECs
+* sharing this ID and I have not enough information about
+* them to implement more universal solution.
+*/
+   if (subid == 0x84371043) {
+   w = hdaa_widget_get(devinfo, 15);
+   if (w != NULL)
+   w->param.inamp_cap = 0;
+   }
+   break;
case HDA_CODEC_CX20582:
case HDA_CODEC_CX20583:
case HDA_CODEC_CX20584:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243064 - stable/9/sys/dev/sound/pci/hda

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 06:03:14 2012
New Revision: 243064
URL: http://svnweb.freebsd.org/changeset/base/243064

Log:
  MFC r242417:
  ASUS EeePC 1001px has strange variant of ALC269 CODEC, that mutes speaker
  if unused in that configuration mixer at NID 15 is muted.  Probably CODEC
  incorrectly reports its internal connections.  Hide that muter from the
  driver to avoid muting and make built-in speaker work.
  
  There are several different CODECs sharing this ID and I have not enough
  information about them and the bug to implement more universal solution.

Modified:
  stable/9/sys/dev/sound/pci/hda/hdaa_patches.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- stable/9/sys/dev/sound/pci/hda/hdaa_patches.c   Thu Nov 15 05:58:37 
2012(r243063)
+++ stable/9/sys/dev/sound/pci/hda/hdaa_patches.c   Thu Nov 15 06:03:14 
2012(r243064)
@@ -541,6 +541,21 @@ hdaa_patch(struct hdaa_devinfo *devinfo)
if (w != NULL)
w->connsenable[0] = 0;
break;
+   case HDA_CODEC_ALC269:
+   /*
+* ASUS EeePC 1001px has strange variant of ALC269 CODEC,
+* that mutes speaker if unused mixer at NID 15 is muted.
+* Probably CODEC incorrectly reports internal connections.
+* Hide that muter from the driver.  There are several CODECs
+* sharing this ID and I have not enough information about
+* them to implement more universal solution.
+*/
+   if (subid == 0x84371043) {
+   w = hdaa_widget_get(devinfo, 15);
+   if (w != NULL)
+   w->param.inamp_cap = 0;
+   }
+   break;
case HDA_CODEC_CX20582:
case HDA_CODEC_CX20583:
case HDA_CODEC_CX20584:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243063 - stable/8/sys/dev/sound/pci/hda

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 05:58:37 2012
New Revision: 243063
URL: http://svnweb.freebsd.org/changeset/base/243063

Log:
  MFC r242357:
  Set all pins initial connection status to unknown (2) and then update it
  with the real value in regular way if sensing is supported.  This fixes
  minor inconsistency when playback redirection appeared in undefined state
  on boot if headphones were not connected.

Modified:
  stable/8/sys/dev/sound/pci/hda/hdaa.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/pci/   (props changed)

Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c
==
--- stable/8/sys/dev/sound/pci/hda/hdaa.c   Thu Nov 15 05:57:20 2012
(r243062)
+++ stable/8/sys/dev/sound/pci/hda/hdaa.c   Thu Nov 15 05:58:37 2012
(r243063)
@@ -400,7 +400,7 @@ hdaa_presence_handler(struct hdaa_widget
struct hdaa_devinfo *devinfo = w->devinfo;
struct hdaa_audio_as *as;
uint32_t res;
-   int connected;
+   int connected, old;
 
if (w->enable == 0 || w->type !=
HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX)
@@ -414,19 +414,22 @@ hdaa_presence_handler(struct hdaa_widget
connected = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0;
if (devinfo->quirks & HDAA_QUIRK_SENSEINV)
connected = !connected;
-   if (connected == w->wclass.pin.connected)
+   old = w->wclass.pin.connected;
+   if (connected == old)
return;
w->wclass.pin.connected = connected;
HDA_BOOTVERBOSE(
-   device_printf(devinfo->dev,
-   "Pin sense: nid=%d sence=0x%08x (%sconnected)\n",
-   w->nid, res, !w->wclass.pin.connected ? "dis" : "");
+   if (connected || old != 2) {
+   device_printf(devinfo->dev,
+   "Pin sense: nid=%d sence=0x%08x (%sconnected)\n",
+   w->nid, res, !connected ? "dis" : "");
+   }
);
 
as = &devinfo->as[w->bindas];
if (as->hpredir >= 0 && as->pins[15] == w->nid)
hdaa_hpredir_handler(w);
-   if (as->dir == HDAA_CTL_IN)
+   if (as->dir == HDAA_CTL_IN && old != 2)
hdaa_autorecsrc_handler(as, w);
 }
 
@@ -1151,6 +1154,7 @@ hdaa_widget_parse(struct hdaa_widget *w)
HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP));
w->wclass.pin.ctrl = hda_command(dev,
HDA_CMD_GET_PIN_WIDGET_CTRL(0, nid));
+   w->wclass.pin.connected = 2;
if (HDA_PARAM_PIN_CAP_EAPD_CAP(w->wclass.pin.cap)) {
w->param.eapdbtl = hda_command(dev,
HDA_CMD_GET_EAPD_BTL_ENABLE(0, nid));
@@ -1238,10 +1242,6 @@ hdaa_widget_postprocess(struct hdaa_widg
}
strlcat(w->name, HDA_CONNS[conn], sizeof(w->name));
strlcat(w->name, ")", sizeof(w->name));
-
-   if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 
0 ||
-   (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 
0)
-   w->wclass.pin.connected = 2;
}
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243062 - stable/9/sys/dev/sound/pci/hda

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 05:57:20 2012
New Revision: 243062
URL: http://svnweb.freebsd.org/changeset/base/243062

Log:
  MFC r242357:
  Set all pins initial connection status to unknown (2) and then update it
  with the real value in regular way if sensing is supported.  This fixes
  minor inconsistency when playback redirection appeared in undefined state
  on boot if headphones were not connected.

Modified:
  stable/9/sys/dev/sound/pci/hda/hdaa.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c
==
--- stable/9/sys/dev/sound/pci/hda/hdaa.c   Thu Nov 15 05:55:30 2012
(r243061)
+++ stable/9/sys/dev/sound/pci/hda/hdaa.c   Thu Nov 15 05:57:20 2012
(r243062)
@@ -400,7 +400,7 @@ hdaa_presence_handler(struct hdaa_widget
struct hdaa_devinfo *devinfo = w->devinfo;
struct hdaa_audio_as *as;
uint32_t res;
-   int connected;
+   int connected, old;
 
if (w->enable == 0 || w->type !=
HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX)
@@ -414,19 +414,22 @@ hdaa_presence_handler(struct hdaa_widget
connected = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0;
if (devinfo->quirks & HDAA_QUIRK_SENSEINV)
connected = !connected;
-   if (connected == w->wclass.pin.connected)
+   old = w->wclass.pin.connected;
+   if (connected == old)
return;
w->wclass.pin.connected = connected;
HDA_BOOTVERBOSE(
-   device_printf(devinfo->dev,
-   "Pin sense: nid=%d sence=0x%08x (%sconnected)\n",
-   w->nid, res, !w->wclass.pin.connected ? "dis" : "");
+   if (connected || old != 2) {
+   device_printf(devinfo->dev,
+   "Pin sense: nid=%d sence=0x%08x (%sconnected)\n",
+   w->nid, res, !connected ? "dis" : "");
+   }
);
 
as = &devinfo->as[w->bindas];
if (as->hpredir >= 0 && as->pins[15] == w->nid)
hdaa_hpredir_handler(w);
-   if (as->dir == HDAA_CTL_IN)
+   if (as->dir == HDAA_CTL_IN && old != 2)
hdaa_autorecsrc_handler(as, w);
 }
 
@@ -1151,6 +1154,7 @@ hdaa_widget_parse(struct hdaa_widget *w)
HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP));
w->wclass.pin.ctrl = hda_command(dev,
HDA_CMD_GET_PIN_WIDGET_CTRL(0, nid));
+   w->wclass.pin.connected = 2;
if (HDA_PARAM_PIN_CAP_EAPD_CAP(w->wclass.pin.cap)) {
w->param.eapdbtl = hda_command(dev,
HDA_CMD_GET_EAPD_BTL_ENABLE(0, nid));
@@ -1238,10 +1242,6 @@ hdaa_widget_postprocess(struct hdaa_widg
}
strlcat(w->name, HDA_CONNS[conn], sizeof(w->name));
strlcat(w->name, ")", sizeof(w->name));
-
-   if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 
0 ||
-   (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 
0)
-   w->wclass.pin.connected = 2;
}
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243061 - stable/8/sys/dev/sound/pci/hda

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 05:55:30 2012
New Revision: 243061
URL: http://svnweb.freebsd.org/changeset/base/243061

Log:
  MFC r242352:
  Print card and subsystem IDs in verbose logs to help to identify system.
  Hide some less useful messages under debug.

Modified:
  stable/8/sys/dev/sound/pci/hda/hdaa.c
  stable/8/sys/dev/sound/pci/hda/hdaa.h
  stable/8/sys/dev/sound/pci/hda/hdaa_patches.c
  stable/8/sys/dev/sound/pci/hda/hdac.c
  stable/8/sys/dev/sound/pci/hda/hdac.h
  stable/8/sys/dev/sound/pci/hda/hdacc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/pci/   (props changed)

Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c
==
--- stable/8/sys/dev/sound/pci/hda/hdaa.c   Thu Nov 15 05:54:18 2012
(r243060)
+++ stable/8/sys/dev/sound/pci/hda/hdaa.c   Thu Nov 15 05:55:30 2012
(r243061)
@@ -6243,6 +6243,10 @@ hdaa_attach(device_t dev)
devinfo->endnode = devinfo->startnode + devinfo->nodecnt;
 
HDA_BOOTVERBOSE(
+   device_printf(dev, "Subsystem ID: 0x%08x\n",
+   hda_get_subsystem_id(dev));
+   );
+   HDA_BOOTHVERBOSE(
device_printf(dev,
"Audio Function Group at nid=%d: %d subnodes %d-%d\n",
nid, devinfo->nodecnt,

Modified: stable/8/sys/dev/sound/pci/hda/hdaa.h
==
--- stable/8/sys/dev/sound/pci/hda/hdaa.h   Thu Nov 15 05:54:18 2012
(r243060)
+++ stable/8/sys/dev/sound/pci/hda/hdaa.h   Thu Nov 15 05:55:30 2012
(r243061)
@@ -260,7 +260,7 @@ struct hdaa_chan {
(((uint32_t)hda_get_vendor_id(devinfo->dev) << 16) +\
hda_get_device_id(devinfo->dev))
 
-#define hdaa_subvendor_id(devinfo) \
+#define hdaa_card_id(devinfo)  \
(((uint32_t)hda_get_subdevice_id(devinfo->dev) << 16) + \
hda_get_subvendor_id(devinfo->dev))
 

Modified: stable/8/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- stable/8/sys/dev/sound/pci/hda/hdaa_patches.c   Thu Nov 15 05:54:18 
2012(r243060)
+++ stable/8/sys/dev/sound/pci/hda/hdaa_patches.c   Thu Nov 15 05:55:30 
2012(r243061)
@@ -139,7 +139,7 @@ hdac_pin_patch(struct hdaa_widget *w)
 
config = orig = w->wclass.pin.config;
id = hdaa_codec_id(w->devinfo);
-   subid = hdaa_subvendor_id(w->devinfo);
+   subid = hdaa_card_id(w->devinfo);
 
/* XXX: Old patches require complete review.
 * Now they may create more problem then solve due to
@@ -392,7 +392,7 @@ hdaa_patch(struct hdaa_devinfo *devinfo)
int i;
 
id = hdaa_codec_id(devinfo);
-   subid = hdaa_subvendor_id(devinfo);
+   subid = hdaa_card_id(devinfo);
 
/*
 * Quirks
@@ -594,7 +594,7 @@ hdaa_patch_direct(struct hdaa_devinfo *d
uint32_t id, subid, val;
 
id = hdaa_codec_id(devinfo);
-   subid = hdaa_subvendor_id(devinfo);
+   subid = hdaa_card_id(devinfo);
 
switch (id) {
case HDA_CODEC_VT1708S_0:

Modified: stable/8/sys/dev/sound/pci/hda/hdac.c
==
--- stable/8/sys/dev/sound/pci/hda/hdac.c   Thu Nov 15 05:54:18 2012
(r243060)
+++ stable/8/sys/dev/sound/pci/hda/hdac.c   Thu Nov 15 05:55:30 2012
(r243061)
@@ -1074,6 +1074,8 @@ hdac_attach(device_t dev)
 
sc = device_get_softc(dev);
HDA_BOOTVERBOSE(
+   device_printf(dev, "PCI card vendor: 0x%04x, device: 0x%04x\n",
+   pci_get_subvendor(dev), pci_get_subdevice(dev));
device_printf(dev, "HDA Driver Revision: %s\n",
HDA_DRV_TEST_REV);
);

Modified: stable/8/sys/dev/sound/pci/hda/hdac.h
==
--- stable/8/sys/dev/sound/pci/hda/hdac.h   Thu Nov 15 05:54:18 2012
(r243060)
+++ stable/8/sys/dev/sound/pci/hda/hdac.h   Thu Nov 15 05:55:30 2012
(r243061)
@@ -666,6 +666,7 @@ HDA_ACCESSOR(revision_id,   REVISION_ID,u
 HDA_ACCESSOR(stepping_id,  STEPPING_ID,uint8_t);
 HDA_ACCESSOR(subvendor_id, SUBVENDOR_ID,   uint16_t);
 HDA_ACCESSOR(subdevice_id, SUBDEVICE_ID,   uint16_t);
+HDA_ACCESSOR(subsystem_id, SUBSYSTEM_ID,   uint32_t);
 HDA_ACCESSOR(node_type,NODE_TYPE,  uint8_t);
 HDA_ACCESSOR(dma_nocache,  DMA_NOCACHE,uint8_t);
 

Modified: stable/8/sys/dev/sound/pci/hda/hdacc.c
==
--- stable/8/sys/dev/sound/pci/hda/hdacc.c  Thu Nov 15 05:

svn commit: r243060 - stable/9/sys/dev/sound/pci/hda

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 05:54:18 2012
New Revision: 243060
URL: http://svnweb.freebsd.org/changeset/base/243060

Log:
  MFC r242352:
  Print card and subsystem IDs in verbose logs to help to identify system.
  Hide some less iseful messages under debug.

Modified:
  stable/9/sys/dev/sound/pci/hda/hdaa.c
  stable/9/sys/dev/sound/pci/hda/hdaa.h
  stable/9/sys/dev/sound/pci/hda/hdaa_patches.c
  stable/9/sys/dev/sound/pci/hda/hdac.c
  stable/9/sys/dev/sound/pci/hda/hdac.h
  stable/9/sys/dev/sound/pci/hda/hdacc.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c
==
--- stable/9/sys/dev/sound/pci/hda/hdaa.c   Thu Nov 15 05:46:02 2012
(r243059)
+++ stable/9/sys/dev/sound/pci/hda/hdaa.c   Thu Nov 15 05:54:18 2012
(r243060)
@@ -6243,6 +6243,10 @@ hdaa_attach(device_t dev)
devinfo->endnode = devinfo->startnode + devinfo->nodecnt;
 
HDA_BOOTVERBOSE(
+   device_printf(dev, "Subsystem ID: 0x%08x\n",
+   hda_get_subsystem_id(dev));
+   );
+   HDA_BOOTHVERBOSE(
device_printf(dev,
"Audio Function Group at nid=%d: %d subnodes %d-%d\n",
nid, devinfo->nodecnt,

Modified: stable/9/sys/dev/sound/pci/hda/hdaa.h
==
--- stable/9/sys/dev/sound/pci/hda/hdaa.h   Thu Nov 15 05:46:02 2012
(r243059)
+++ stable/9/sys/dev/sound/pci/hda/hdaa.h   Thu Nov 15 05:54:18 2012
(r243060)
@@ -260,7 +260,7 @@ struct hdaa_chan {
(((uint32_t)hda_get_vendor_id(devinfo->dev) << 16) +\
hda_get_device_id(devinfo->dev))
 
-#define hdaa_subvendor_id(devinfo) \
+#define hdaa_card_id(devinfo)  \
(((uint32_t)hda_get_subdevice_id(devinfo->dev) << 16) + \
hda_get_subvendor_id(devinfo->dev))
 

Modified: stable/9/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- stable/9/sys/dev/sound/pci/hda/hdaa_patches.c   Thu Nov 15 05:46:02 
2012(r243059)
+++ stable/9/sys/dev/sound/pci/hda/hdaa_patches.c   Thu Nov 15 05:54:18 
2012(r243060)
@@ -139,7 +139,7 @@ hdac_pin_patch(struct hdaa_widget *w)
 
config = orig = w->wclass.pin.config;
id = hdaa_codec_id(w->devinfo);
-   subid = hdaa_subvendor_id(w->devinfo);
+   subid = hdaa_card_id(w->devinfo);
 
/* XXX: Old patches require complete review.
 * Now they may create more problem then solve due to
@@ -392,7 +392,7 @@ hdaa_patch(struct hdaa_devinfo *devinfo)
int i;
 
id = hdaa_codec_id(devinfo);
-   subid = hdaa_subvendor_id(devinfo);
+   subid = hdaa_card_id(devinfo);
 
/*
 * Quirks
@@ -594,7 +594,7 @@ hdaa_patch_direct(struct hdaa_devinfo *d
uint32_t id, subid, val;
 
id = hdaa_codec_id(devinfo);
-   subid = hdaa_subvendor_id(devinfo);
+   subid = hdaa_card_id(devinfo);
 
switch (id) {
case HDA_CODEC_VT1708S_0:

Modified: stable/9/sys/dev/sound/pci/hda/hdac.c
==
--- stable/9/sys/dev/sound/pci/hda/hdac.c   Thu Nov 15 05:46:02 2012
(r243059)
+++ stable/9/sys/dev/sound/pci/hda/hdac.c   Thu Nov 15 05:54:18 2012
(r243060)
@@ -1074,6 +1074,8 @@ hdac_attach(device_t dev)
 
sc = device_get_softc(dev);
HDA_BOOTVERBOSE(
+   device_printf(dev, "PCI card vendor: 0x%04x, device: 0x%04x\n",
+   pci_get_subvendor(dev), pci_get_subdevice(dev));
device_printf(dev, "HDA Driver Revision: %s\n",
HDA_DRV_TEST_REV);
);

Modified: stable/9/sys/dev/sound/pci/hda/hdac.h
==
--- stable/9/sys/dev/sound/pci/hda/hdac.h   Thu Nov 15 05:46:02 2012
(r243059)
+++ stable/9/sys/dev/sound/pci/hda/hdac.h   Thu Nov 15 05:54:18 2012
(r243060)
@@ -666,6 +666,7 @@ HDA_ACCESSOR(revision_id,   REVISION_ID,u
 HDA_ACCESSOR(stepping_id,  STEPPING_ID,uint8_t);
 HDA_ACCESSOR(subvendor_id, SUBVENDOR_ID,   uint16_t);
 HDA_ACCESSOR(subdevice_id, SUBDEVICE_ID,   uint16_t);
+HDA_ACCESSOR(subsystem_id, SUBSYSTEM_ID,   uint32_t);
 HDA_ACCESSOR(node_type,NODE_TYPE,  uint8_t);
 HDA_ACCESSOR(dma_nocache,  DMA_NOCACHE,uint8_t);
 

Modified: stable/9/sys/dev/sound/pci/hda/hdacc.c
==
--- stable/9/sys/dev/sound/pci/hda/hdacc.c  Thu Nov 15 05:46:02 2012
(r243059)
+++ stable/9/sys/dev/sound/pci/hda/hdacc.c  Thu Nov 15 05:5

svn commit: r243059 - stable/8/lib/libusbhid

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 05:46:02 2012
New Revision: 243059
URL: http://svnweb.freebsd.org/changeset/base/243059

Log:
  MFC r240762:
  Restore handling of the third argument (id) of hid_start_parse(), same as
  it is done in NetBSD/OpenBSD, and as it was here before r205728.
  
  I personally think this API or its implementation is incorrect, as it is not
  correct to filter collections based on report ID, as they are orthogonal
  in general case, but I see no harm from supporting this feature.
  
  PR: usb/171810

Modified:
  stable/8/lib/libusbhid/descr.c
  stable/8/lib/libusbhid/parse.c
  stable/8/lib/libusbhid/usbhid.3
Directory Properties:
  stable/8/lib/libusbhid/   (props changed)

Modified: stable/8/lib/libusbhid/descr.c
==
--- stable/8/lib/libusbhid/descr.c  Thu Nov 15 05:44:44 2012
(r243058)
+++ stable/8/lib/libusbhid/descr.c  Thu Nov 15 05:46:02 2012
(r243059)
@@ -68,7 +68,7 @@ hid_get_report_id(int fd)
if ((rep = hid_get_report_desc(fd)) == NULL)
goto use_ioctl;
kindset = 1 << hid_input | 1 << hid_output | 1 << hid_feature;
-   for (d = hid_start_parse(rep, kindset, 0); hid_get_item(d, &h); ) {
+   for (d = hid_start_parse(rep, kindset, -1); hid_get_item(d, &h); ) {
/* Return the first report ID we met. */
if (h.report_ID != 0) {
temp = h.report_ID;

Modified: stable/8/lib/libusbhid/parse.c
==
--- stable/8/lib/libusbhid/parse.c  Thu Nov 15 05:44:44 2012
(r243058)
+++ stable/8/lib/libusbhid/parse.c  Thu Nov 15 05:46:02 2012
(r243059)
@@ -70,6 +70,7 @@ struct hid_data {
uint8_t iusage; /* current "usages_min/max" index */
uint8_t ousage; /* current "usages_min/max" offset */
uint8_t susage; /* usage set flags */
+   int32_t reportid;   /* requested report ID */
 };
 
 /**
@@ -149,7 +150,7 @@ hid_switch_rid(struct hid_data *s, struc
  * hid_start_parse
  **/
 hid_data_t
-hid_start_parse(report_desc_t d, int kindset, int id __unused)
+hid_start_parse(report_desc_t d, int kindset, int id)
 {
struct hid_data *s;
 
@@ -158,6 +159,7 @@ hid_start_parse(report_desc_t d, int kin
s->start = s->p = d->data;
s->end = d->data + d->size;
s->kindset = kindset;
+   s->reportid = id;
return (s);
 }
 
@@ -207,8 +209,8 @@ hid_get_byte(struct hid_data *s, const u
 /**
  * hid_get_item
  **/
-int
-hid_get_item(hid_data_t s, hid_item_t *h)
+static int
+hid_get_item_raw(hid_data_t s, hid_item_t *h)
 {
hid_item_t *c;
unsigned int bTag, bType, bSize;
@@ -509,6 +511,19 @@ hid_get_item(hid_data_t s, hid_item_t *h
 }
 
 int
+hid_get_item(hid_data_t s, hid_item_t *h)
+{
+   int r;
+
+   for (;;) {
+   r = hid_get_item_raw(s, h);
+   if (r <= 0 || s->reportid == -1 || h->report_ID == s->reportid)
+   break;
+   }
+   return (r);
+}
+
+int
 hid_report_size(report_desc_t r, enum hid_kind k, int id)
 {
struct hid_data *d;
@@ -523,7 +538,7 @@ hid_report_size(report_desc_t r, enum hi
 
memset(&h, 0, sizeof h);
for (d = hid_start_parse(r, 1 << k, id); hid_get_item(d, &h); ) {
-   if ((h.report_ID == id || id < 0) && h.kind == k) {
+   if (h.kind == k) {
/* compute minimum */
if (lpos > h.pos)
lpos = h.pos;

Modified: stable/8/lib/libusbhid/usbhid.3
==
--- stable/8/lib/libusbhid/usbhid.3 Thu Nov 15 05:44:44 2012
(r243058)
+++ stable/8/lib/libusbhid/usbhid.3 Thu Nov 15 05:46:02 2012
(r243059)
@@ -144,16 +144,15 @@ fails it will return
 .Ss Descriptor Parsing Functions
 To parse the report descriptor the
 .Fn hid_start_parse
-function should be called with a report descriptor and a set that
-describes which items that are interesting.
+function should be called with a report descriptor, a set that
+describes which items that are interesting, and the desired report
+ID (or -1 to obtain items of all report IDs).
 The set is obtained by OR-ing together values
 .Fa "(1 << k)"
 where
 .Fa k
 is an item of type
 .Vt hid_kind_t .
-The report ID (if present) is given by
-.Fa id .
 The function returns
 .Dv NULL
 if the initialization fails, otherwise an opaque value to be used
___
svn-src-all@freebsd.org m

svn commit: r243058 - stable/9/lib/libusbhid

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 05:44:44 2012
New Revision: 243058
URL: http://svnweb.freebsd.org/changeset/base/243058

Log:
  MFC r240762:
  Restore handling of the third argument (id) of hid_start_parse(), same as
  it is done in NetBSD/OpenBSD, and as it was here before r205728.
  
  I personally think this API or its implementation is incorrect, as it is not
  correct to filter collections based on report ID, as they are orthogonal
  in general case, but I see no harm from supporting this feature.
  
  PR:   usb/171810

Modified:
  stable/9/lib/libusbhid/descr.c
  stable/9/lib/libusbhid/parse.c
  stable/9/lib/libusbhid/usbhid.3
Directory Properties:
  stable/9/lib/libusbhid/   (props changed)

Modified: stable/9/lib/libusbhid/descr.c
==
--- stable/9/lib/libusbhid/descr.c  Thu Nov 15 05:34:14 2012
(r243057)
+++ stable/9/lib/libusbhid/descr.c  Thu Nov 15 05:44:44 2012
(r243058)
@@ -68,7 +68,7 @@ hid_get_report_id(int fd)
if ((rep = hid_get_report_desc(fd)) == NULL)
goto use_ioctl;
kindset = 1 << hid_input | 1 << hid_output | 1 << hid_feature;
-   for (d = hid_start_parse(rep, kindset, 0); hid_get_item(d, &h); ) {
+   for (d = hid_start_parse(rep, kindset, -1); hid_get_item(d, &h); ) {
/* Return the first report ID we met. */
if (h.report_ID != 0) {
temp = h.report_ID;

Modified: stable/9/lib/libusbhid/parse.c
==
--- stable/9/lib/libusbhid/parse.c  Thu Nov 15 05:34:14 2012
(r243057)
+++ stable/9/lib/libusbhid/parse.c  Thu Nov 15 05:44:44 2012
(r243058)
@@ -70,6 +70,7 @@ struct hid_data {
uint8_t iusage; /* current "usages_min/max" index */
uint8_t ousage; /* current "usages_min/max" offset */
uint8_t susage; /* usage set flags */
+   int32_t reportid;   /* requested report ID */
 };
 
 /**
@@ -149,7 +150,7 @@ hid_switch_rid(struct hid_data *s, struc
  * hid_start_parse
  **/
 hid_data_t
-hid_start_parse(report_desc_t d, int kindset, int id __unused)
+hid_start_parse(report_desc_t d, int kindset, int id)
 {
struct hid_data *s;
 
@@ -158,6 +159,7 @@ hid_start_parse(report_desc_t d, int kin
s->start = s->p = d->data;
s->end = d->data + d->size;
s->kindset = kindset;
+   s->reportid = id;
return (s);
 }
 
@@ -207,8 +209,8 @@ hid_get_byte(struct hid_data *s, const u
 /**
  * hid_get_item
  **/
-int
-hid_get_item(hid_data_t s, hid_item_t *h)
+static int
+hid_get_item_raw(hid_data_t s, hid_item_t *h)
 {
hid_item_t *c;
unsigned int bTag, bType, bSize;
@@ -509,6 +511,19 @@ hid_get_item(hid_data_t s, hid_item_t *h
 }
 
 int
+hid_get_item(hid_data_t s, hid_item_t *h)
+{
+   int r;
+
+   for (;;) {
+   r = hid_get_item_raw(s, h);
+   if (r <= 0 || s->reportid == -1 || h->report_ID == s->reportid)
+   break;
+   }
+   return (r);
+}
+
+int
 hid_report_size(report_desc_t r, enum hid_kind k, int id)
 {
struct hid_data *d;
@@ -523,7 +538,7 @@ hid_report_size(report_desc_t r, enum hi
 
memset(&h, 0, sizeof h);
for (d = hid_start_parse(r, 1 << k, id); hid_get_item(d, &h); ) {
-   if ((h.report_ID == id || id < 0) && h.kind == k) {
+   if (h.kind == k) {
/* compute minimum */
if (lpos > h.pos)
lpos = h.pos;

Modified: stable/9/lib/libusbhid/usbhid.3
==
--- stable/9/lib/libusbhid/usbhid.3 Thu Nov 15 05:34:14 2012
(r243057)
+++ stable/9/lib/libusbhid/usbhid.3 Thu Nov 15 05:44:44 2012
(r243058)
@@ -144,16 +144,15 @@ fails it will return
 .Ss Descriptor Parsing Functions
 To parse the report descriptor the
 .Fn hid_start_parse
-function should be called with a report descriptor and a set that
-describes which items that are interesting.
+function should be called with a report descriptor, a set that
+describes which items that are interesting, and the desired report
+ID (or -1 to obtain items of all report IDs).
 The set is obtained by OR-ing together values
 .Fa "(1 << k)"
 where
 .Fa k
 is an item of type
 .Vt hid_kind_t .
-The report ID (if present) is given by
-.Fa id .
 The function returns
 .Dv NULL
 if the initialization fails, otherwise an opaque value to be used
___
svn-src-all@freebsd.org mai

svn commit: r243057 - stable/8/sys/geom/raid

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 05:34:14 2012
New Revision: 243057
URL: http://svnweb.freebsd.org/changeset/base/243057

Log:
  MFC r242314:
  Make GEOM RAID more aggressive in marking volumes as clean on shutdown
  and move that action from shutdown_pre_sync to shutdown_post_sync stage
  to avoid extra flapping.
  
  ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID
  to shutdown gracefully.  To handle that, mark volume as clean just when
  shutdown time comes and there are no active writes.

Modified:
  stable/8/sys/geom/raid/g_raid.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/geom/   (props changed)

Modified: stable/8/sys/geom/raid/g_raid.c
==
--- stable/8/sys/geom/raid/g_raid.c Thu Nov 15 05:33:14 2012
(r243056)
+++ stable/8/sys/geom/raid/g_raid.c Thu Nov 15 05:34:14 2012
(r243057)
@@ -107,8 +107,9 @@ LIST_HEAD(, g_raid_tr_class) g_raid_tr_c
 LIST_HEAD(, g_raid_volume) g_raid_volumes =
 LIST_HEAD_INITIALIZER(g_raid_volumes);
 
-static eventhandler_tag g_raid_pre_sync = NULL;
+static eventhandler_tag g_raid_post_sync = NULL;
 static int g_raid_started = 0;
+static int g_raid_shutdown = 0;
 
 static int g_raid_destroy_geom(struct gctl_req *req, struct g_class *mp,
 struct g_geom *gp);
@@ -878,7 +879,7 @@ g_raid_orphan(struct g_consumer *cp)
G_RAID_EVENT_DISK);
 }
 
-static int
+static void
 g_raid_clean(struct g_raid_volume *vol, int acw)
 {
struct g_raid_softc *sc;
@@ -889,22 +890,21 @@ g_raid_clean(struct g_raid_volume *vol, 
sx_assert(&sc->sc_lock, SX_XLOCKED);
 
 // if ((sc->sc_flags & G_RAID_DEVICE_FLAG_NOFAILSYNC) != 0)
-// return (0);
+// return;
if (!vol->v_dirty)
-   return (0);
+   return;
if (vol->v_writes > 0)
-   return (0);
+   return;
if (acw > 0 || (acw == -1 &&
vol->v_provider != NULL && vol->v_provider->acw > 0)) {
timeout = g_raid_clean_time - (time_uptime - vol->v_last_write);
-   if (timeout > 0)
-   return (timeout);
+   if (!g_raid_shutdown && timeout > 0)
+   return;
}
vol->v_dirty = 0;
G_RAID_DEBUG1(1, sc, "Volume %s marked as clean.",
vol->v_name);
g_raid_write_metadata(sc, vol, NULL, NULL);
-   return (0);
 }
 
 static void
@@ -1517,8 +1517,7 @@ process:
g_raid_disk_done_request(bp);
} else if (rv == EWOULDBLOCK) {
TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) {
-   if (vol->v_writes == 0 && vol->v_dirty)
-   g_raid_clean(vol, -1);
+   g_raid_clean(vol, -1);
if (bioq_first(&vol->v_inflight) == NULL &&
vol->v_tr) {
t.tv_sec = g_raid_idle_threshold / 
100;
@@ -1780,7 +1779,7 @@ g_raid_access(struct g_provider *pp, int
error = ENXIO;
goto out;
}
-   if (dcw == 0 && vol->v_dirty)
+   if (dcw == 0)
g_raid_clean(vol, dcw);
vol->v_provider_open += acr + acw + ace;
/* Handle delayed node destruction. */
@@ -2376,21 +2375,25 @@ g_raid_dumpconf(struct sbuf *sb, const c
 }
 
 static void
-g_raid_shutdown_pre_sync(void *arg, int howto)
+g_raid_shutdown_post_sync(void *arg, int howto)
 {
struct g_class *mp;
struct g_geom *gp, *gp2;
struct g_raid_softc *sc;
+   struct g_raid_volume *vol;
int error;
 
mp = arg;
DROP_GIANT();
g_topology_lock();
+   g_raid_shutdown = 1;
LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) {
if ((sc = gp->softc) == NULL)
continue;
g_topology_unlock();
sx_xlock(&sc->sc_lock);
+   TAILQ_FOREACH(vol, &sc->sc_volumes, v_next)
+   g_raid_clean(vol, -1);
g_cancel_event(sc);
error = g_raid_destroy(sc, G_RAID_DESTROY_DELAYED);
if (error != 0)
@@ -2405,9 +2408,9 @@ static void
 g_raid_init(struct g_class *mp)
 {
 
-   g_raid_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync,
-   g_raid_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST);
-   if (g_raid_pre_sync == NULL)
+   g_raid_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync,
+   g_raid_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST);
+   if (g_raid_post_sync == NULL)
G_RAID_DEBUG(0, "Warning! Cannot register shutdown event.");
g_raid_started = 1;
 }
@@ -2416,8 +2419,8 @@ static void
 g_raid_fini(struct g_class *mp)
 {
 
-   if (g_raid_pre_sync != NULL)
-   EVENTHANDLER_DEREGISTE

svn commit: r243056 - stable/9/sys/geom/raid

2012-11-14 Thread Alexander Motin
Author: mav
Date: Thu Nov 15 05:33:14 2012
New Revision: 243056
URL: http://svnweb.freebsd.org/changeset/base/243056

Log:
  MFC r242314:
  Make GEOM RAID more aggressive in marking volumes as clean on shutdown
  and move that action from shutdown_pre_sync to shutdown_post_sync stage
  to avoid extra flapping.
  
  ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID
  to shutdown gracefully.  To handle that, mark volume as clean just when
  shutdown time comes and there are no active writes.

Modified:
  stable/9/sys/geom/raid/g_raid.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/raid/g_raid.c
==
--- stable/9/sys/geom/raid/g_raid.c Thu Nov 15 04:51:37 2012
(r243055)
+++ stable/9/sys/geom/raid/g_raid.c Thu Nov 15 05:33:14 2012
(r243056)
@@ -108,8 +108,9 @@ LIST_HEAD(, g_raid_tr_class) g_raid_tr_c
 LIST_HEAD(, g_raid_volume) g_raid_volumes =
 LIST_HEAD_INITIALIZER(g_raid_volumes);
 
-static eventhandler_tag g_raid_pre_sync = NULL;
+static eventhandler_tag g_raid_post_sync = NULL;
 static int g_raid_started = 0;
+static int g_raid_shutdown = 0;
 
 static int g_raid_destroy_geom(struct gctl_req *req, struct g_class *mp,
 struct g_geom *gp);
@@ -881,7 +882,7 @@ g_raid_orphan(struct g_consumer *cp)
G_RAID_EVENT_DISK);
 }
 
-static int
+static void
 g_raid_clean(struct g_raid_volume *vol, int acw)
 {
struct g_raid_softc *sc;
@@ -892,22 +893,21 @@ g_raid_clean(struct g_raid_volume *vol, 
sx_assert(&sc->sc_lock, SX_XLOCKED);
 
 // if ((sc->sc_flags & G_RAID_DEVICE_FLAG_NOFAILSYNC) != 0)
-// return (0);
+// return;
if (!vol->v_dirty)
-   return (0);
+   return;
if (vol->v_writes > 0)
-   return (0);
+   return;
if (acw > 0 || (acw == -1 &&
vol->v_provider != NULL && vol->v_provider->acw > 0)) {
timeout = g_raid_clean_time - (time_uptime - vol->v_last_write);
-   if (timeout > 0)
-   return (timeout);
+   if (!g_raid_shutdown && timeout > 0)
+   return;
}
vol->v_dirty = 0;
G_RAID_DEBUG1(1, sc, "Volume %s marked as clean.",
vol->v_name);
g_raid_write_metadata(sc, vol, NULL, NULL);
-   return (0);
 }
 
 static void
@@ -1520,8 +1520,7 @@ process:
g_raid_disk_done_request(bp);
} else if (rv == EWOULDBLOCK) {
TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) {
-   if (vol->v_writes == 0 && vol->v_dirty)
-   g_raid_clean(vol, -1);
+   g_raid_clean(vol, -1);
if (bioq_first(&vol->v_inflight) == NULL &&
vol->v_tr) {
t.tv_sec = g_raid_idle_threshold / 
100;
@@ -1783,7 +1782,7 @@ g_raid_access(struct g_provider *pp, int
error = ENXIO;
goto out;
}
-   if (dcw == 0 && vol->v_dirty)
+   if (dcw == 0)
g_raid_clean(vol, dcw);
vol->v_provider_open += acr + acw + ace;
/* Handle delayed node destruction. */
@@ -2379,21 +2378,25 @@ g_raid_dumpconf(struct sbuf *sb, const c
 }
 
 static void
-g_raid_shutdown_pre_sync(void *arg, int howto)
+g_raid_shutdown_post_sync(void *arg, int howto)
 {
struct g_class *mp;
struct g_geom *gp, *gp2;
struct g_raid_softc *sc;
+   struct g_raid_volume *vol;
int error;
 
mp = arg;
DROP_GIANT();
g_topology_lock();
+   g_raid_shutdown = 1;
LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) {
if ((sc = gp->softc) == NULL)
continue;
g_topology_unlock();
sx_xlock(&sc->sc_lock);
+   TAILQ_FOREACH(vol, &sc->sc_volumes, v_next)
+   g_raid_clean(vol, -1);
g_cancel_event(sc);
error = g_raid_destroy(sc, G_RAID_DESTROY_DELAYED);
if (error != 0)
@@ -2408,9 +2411,9 @@ static void
 g_raid_init(struct g_class *mp)
 {
 
-   g_raid_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync,
-   g_raid_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST);
-   if (g_raid_pre_sync == NULL)
+   g_raid_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync,
+   g_raid_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST);
+   if (g_raid_post_sync == NULL)
G_RAID_DEBUG(0, "Warning! Cannot register shutdown event.");
g_raid_started = 1;
 }
@@ -2419,8 +2422,8 @@ static void
 g_raid_fini(struct g_class *mp)
 {
 
-   if (g_raid_pre_sync != NULL)
-   EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid_pre_sync);

Re: svn commit: r243046 - in head: sys/kern sys/sparc64/include sys/sys usr.bin/ktrdump

2012-11-14 Thread Julian Elischer

On 11/14/12 4:51 PM, Jeff Roberson wrote:

Author: jeff
Date: Thu Nov 15 00:51:57 2012
New Revision: 243046
URL: http://svnweb.freebsd.org/changeset/base/243046

Log:
- Implement run-time expansion of the KTR buffer via sysctl.

on the fly?  ooo!
nice


- Implement a function to ensure that all preempted threads have switched
  back out at least once.  Use this to make sure there are no stale
  references to the old ktr_buf or the lock profiling buffers before
  updating them.
   
   Reviewed by:	marius (sparc64 parts), attilio (earlier patch)

   Sponsored by:EMC / Isilon Storage Division





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


svn commit: r243055 - head/contrib/atf

2012-11-14 Thread Marcel Moolenaar
Author: marcel
Date: Thu Nov 15 04:51:37 2012
New Revision: 243055
URL: http://svnweb.freebsd.org/changeset/base/243055

Log:
  Add ATF update instructions and file exclude list.
  
  Submitted by: Garrett Cooper 

Added:
  head/contrib/atf/FREEBSD-Xlist   (contents, props changed)
  head/contrib/atf/FREEBSD-upgrade   (contents, props changed)

Added: head/contrib/atf/FREEBSD-Xlist
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/atf/FREEBSD-Xlist  Thu Nov 15 04:51:37 2012
(r243055)
@@ -0,0 +1,8 @@
+bootstrap/
+config.log
+config.status
+libtool
+Makefile
+stamp-h1
+*/*/.deps/
+*/.deps/

Added: head/contrib/atf/FREEBSD-upgrade
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/atf/FREEBSD-upgradeThu Nov 15 04:51:37 2012
(r243055)
@@ -0,0 +1,28 @@
+$FreeBSD$
+
+atf
+
+The source code is hosted on GoogleCode as a subcomponent of the Kyua project:
+
+   http://code.google.com/p/kyua/downloads/list
+
+For the contrib directory, the sources were initially prepared like so:
+
+   ./configure --prefix=/ --exec-prefix=/usr --datarootdir=/usr/share
+
+For the contrib directory, files and directories were pruned by:
+
+sh -c 'for F in `cat FREEBSD-Xlist`; do rm -rf ./$F ; done'
+
+You may check if there are any new files that we don't need.
+
+The instructions for importing new release and merging to HEAD can be found
+at FreeBSD wiki:
+
+   http://wiki.freebsd.org/SubversionPrimer/VendorImports
+
+To make local changes to atf, simply patch and commit to the trunk
+branch (aka HEAD).  Never make local changes on the vendor branch.
+
+gcoo...@freebsd.org
+5-August-2012
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243054 - head/contrib/atf/atf-c

2012-11-14 Thread Marcel Moolenaar
Author: marcel
Date: Thu Nov 15 04:42:30 2012
New Revision: 243054
URL: http://svnweb.freebsd.org/changeset/base/243054

Log:
  The *_STR* macros use strcmp() to check their arguments.  Include string.h
  to have this definition available.
  Upstream commit: 1dc1884f778f88811583e6a54610a6d7e421ca63
  
  Submitted by: Garrett Cooper 

Modified:
  head/contrib/atf/atf-c/macros.h

Modified: head/contrib/atf/atf-c/macros.h
==
--- head/contrib/atf/atf-c/macros.h Thu Nov 15 04:39:23 2012
(r243053)
+++ head/contrib/atf/atf-c/macros.h Thu Nov 15 04:42:30 2012
(r243054)
@@ -30,6 +30,8 @@
 #if !defined(ATF_C_MACROS_H)
 #define ATF_C_MACROS_H
 
+#include 
+
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243053 - head/tools/build/mk

2012-11-14 Thread Marcel Moolenaar
Author: marcel
Date: Thu Nov 15 04:39:23 2012
New Revision: 243053
URL: http://svnweb.freebsd.org/changeset/base/243053

Log:
  Don't install atf.test.mk if MK_ATF == no.
  
  Submitted by: Garrett Cooper 

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Nov 15 04:32:55 
2012(r243052)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Nov 15 04:39:23 
2012(r243053)
@@ -133,6 +133,7 @@ OLD_FILES+=usr/share/man/man3/atf-sh-api
 OLD_FILES+=usr/share/man/man4/atf-test-case.4.gz
 OLD_FILES+=usr/share/man/man5/atf-formats.5.gz
 OLD_FILES+=usr/share/man/man7/atf.7.gz
+OLD_FILES+=usr/share/mk/atf.test.mk
 OLD_DIRS+=usr/share/xml/atf
 OLD_FILES+=usr/share/xml/atf/tests-results.dtd
 OLD_DIRS+=usr/share/xsl/atf
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243052 - head/contrib/atf/atf-run

2012-11-14 Thread Marcel Moolenaar
Author: marcel
Date: Thu Nov 15 04:32:55 2012
New Revision: 243052
URL: http://svnweb.freebsd.org/changeset/base/243052

Log:
  Add support for DragonFly and FreeBSD.
  Upstreamed:
  http://code.google.com/p/kyua/issues/detail?id=45
  
  Submitted by: Garrett Cooper 

Modified:
  head/contrib/atf/atf-run/requirements_test.cpp

Modified: head/contrib/atf/atf-run/requirements_test.cpp
==
--- head/contrib/atf/atf-run/requirements_test.cpp  Thu Nov 15 04:29:12 
2012(r243051)
+++ head/contrib/atf/atf-run/requirements_test.cpp  Thu Nov 15 04:32:55 
2012(r243052)
@@ -239,7 +239,8 @@ ATF_TEST_CASE_WITHOUT_HEAD(require_memor
 ATF_TEST_CASE_BODY(require_memory_not_enough) {
 atf::tests::vars_map metadata;
 metadata["require.memory"] = "128t";
-#if defined(__APPLE__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__DragonFly__) || \
+defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
 do_check("Not enough memory; needed 140737488355328, available [0-9]*",
  metadata);
 #else
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243051 - head/contrib/atf/atf-sh

2012-11-14 Thread Marcel Moolenaar
Author: marcel
Date: Thu Nov 15 04:29:12 2012
New Revision: 243051
URL: http://svnweb.freebsd.org/changeset/base/243051

Log:
  Fix typos in description for exp{err,out}_mismatch_head.
  Upstreamed:
  http://code.google.com/p/kyua/issues/detail?id=44
  
  Submitted by: Garrett Cooper 

Modified:
  head/contrib/atf/atf-sh/atf_check_test.sh

Modified: head/contrib/atf/atf-sh/atf_check_test.sh
==
--- head/contrib/atf/atf-sh/atf_check_test.sh   Thu Nov 15 04:24:17 2012
(r243050)
+++ head/contrib/atf/atf-sh/atf_check_test.sh   Thu Nov 15 04:29:12 2012
(r243051)
@@ -54,7 +54,7 @@ atf_test_case expout_mismatch
 expout_mismatch_head()
 {
 atf_set "descr" "Verifies that atf_check prints a diff of the" \
-"stdout and the expected stdout if the two do no" \
+"stdout and the expected stdout of the two do not" \
 "match"
 }
 expout_mismatch_body()
@@ -79,7 +79,7 @@ atf_test_case experr_mismatch
 experr_mismatch_head()
 {
 atf_set "descr" "Verifies that atf_check prints a diff of the" \
-"stderr and the expected stderr if the two do no" \
+"stderr and the expected stderr of the two do not" \
 "match"
 }
 experr_mismatch_body()
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243050 - head/contrib/atf/doc

2012-11-14 Thread Marcel Moolenaar
Author: marcel
Date: Thu Nov 15 04:24:17 2012
New Revision: 243050
URL: http://svnweb.freebsd.org/changeset/base/243050

Log:
  Remove redundant text describing the cleanup routine.
  Upstreamed:
  http://code.google.com/p/kyua/issues/detail?id=43
  
  Submitted by: Garrett Cooper 

Modified:
  head/contrib/atf/doc/atf-test-case.4

Modified: head/contrib/atf/doc/atf-test-case.4
==
--- head/contrib/atf/doc/atf-test-case.4Thu Nov 15 03:39:21 2012
(r243049)
+++ head/contrib/atf/doc/atf-test-case.4Thu Nov 15 04:24:17 2012
(r243050)
@@ -61,7 +61,7 @@ failures.
 This body is only executed if the abstract conditions specified by the
 header are met.
 The
-.Em cleanup routine
+.Em cleanup
 routine is a piece of code always executed after the body, regardless of
 the exit status of the test case.
 It can be used to undo side-effects of the test case.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243049 - head/bin/df

2012-11-14 Thread Greg Lehey
Author: grog
Date: Thu Nov 15 03:39:21 2012
New Revision: 243049
URL: http://svnweb.freebsd.org/changeset/base/243049

Log:
  Add , (comma) option to print sizes grouped and separated by thousands
  using the non-monetary separator returned by localeconv(3), typically
  a comma or period.
  
  MFC after:  14 days

Modified:
  head/bin/df/df.1
  head/bin/df/df.c

Modified: head/bin/df/df.1
==
--- head/bin/df/df.1Thu Nov 15 03:22:50 2012(r243048)
+++ head/bin/df/df.1Thu Nov 15 03:39:21 2012(r243049)
@@ -66,16 +66,14 @@ flag.
 This is implied for file systems specified on the command line.
 .It Fl b
 Use 512-byte blocks rather than the default.
-Note that
-this overrides the
+This overrides the
 .Ev BLOCKSIZE
 specification from the environment.
 .It Fl c
 Display a grand total.
 .It Fl g
 Use 1073741824-byte (1-Gbyte) blocks rather than the default.
-Note that
-this overrides the
+This overrides the
 .Ev BLOCKSIZE
 specification from the environment.
 .It Fl H
@@ -97,16 +95,16 @@ are always printed in base 10.
 Include statistics on the number of free inodes.
 .It Fl k
 Use 1024-byte (1-Kbyte) blocks rather than the default.
-Note that
-this overrides the
+This overrides the
 .Ev BLOCKSIZE
-specification from the environment.
+specification from the environment and the
+.Fl P
+option.
 .It Fl l
 Only display information about locally-mounted file systems.
 .It Fl m
 Use 1048576-byte (1-Mbyte) blocks rather than the default.
-Note that
-this overrides the
+This overrides the
 .Ev BLOCKSIZE
 specification from the environment.
 .It Fl n
@@ -120,9 +118,12 @@ will not request new statistics from the
 with the possibly stale statistics that were previously obtained.
 .It Fl P
 Use POSIX compliant output of 512-byte blocks rather than the default.
-Note that this overrides the
+This overrides the
 .Ev BLOCKSIZE
 specification from the environment.
+The
+.Fl k
+option overrides this option.
 .It Fl t
 Only print out statistics for file systems of the specified types.
 More than one type may be specified in a comma separated list.
@@ -148,6 +149,13 @@ command can be used to find out the type
 that are available on the system.
 .It Fl T
 Include file system type.
+.It Fl ,
+(Comma) Print sizes grouped and separated by thousands using the
+non-monetary separator returned by
+.Xr localeconv 3 ,
+typically a comma or period.
+If no locale is set, or the locale does not have a non-monetary separator, this
+option has no effect.
 .El
 .Sh ENVIRONMENT
 .Bl -tag -width BLOCKSIZE
@@ -165,9 +173,21 @@ is set, the block counts will be display
 .Xr getfsstat 2 ,
 .Xr statfs 2 ,
 .Xr getmntinfo 3 ,
+.Xr localeconv 3 ,
 .Xr fstab 5 ,
 .Xr mount 8 ,
 .Xr quot 8
+.Sh STANDARDS
+With the exception of most options,
+the
+.Nm
+utility conforms to
+.St -p1003.1-2004 ,
+which defines only the
+.Fl k , P
+and
+.Fl t
+options.
 .Sh HISTORY
 A
 .Nm

Modified: head/bin/df/df.c
==
--- head/bin/df/df.cThu Nov 15 03:22:50 2012(r243048)
+++ head/bin/df/df.cThu Nov 15 03:39:21 2012(r243049)
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -95,6 +96,7 @@ imax(int a, int b)
 }
 
 static int aflag = 0, cflag, hflag, iflag, kflag, lflag = 0, nflag, Tflag;
+static int thousands;
 static struct  ufs_args mdev;
 
 int
@@ -111,12 +113,12 @@ main(int argc, char *argv[])
int ch, rv;
 
fstype = "ufs";
-
+   (void)setlocale(LC_ALL, "");
memset(&totalbuf, 0, sizeof(totalbuf));
totalbuf.f_bsize = DEV_BSIZE;
strlcpy(totalbuf.f_mntfromname, "total", MNAMELEN);
vfslist = NULL;
-   while ((ch = getopt(argc, argv, "abcgHhiklmnPt:T")) != -1)
+   while ((ch = getopt(argc, argv, "abcgHhiklmnPt:T,")) != -1)
switch (ch) {
case 'a':
aflag = 1;
@@ -180,6 +182,9 @@ main(int argc, char *argv[])
case 'T':
Tflag = 1;
break;
+   case ',':
+   thousands = 1;
+   break;
case '?':
default:
usage();
@@ -410,10 +415,18 @@ prtstat(struct statfs *sfsp, struct maxw
static int headerlen, timesthrough = 0;
static const char *header;
int64_t used, availblks, inodes;
+   const char *format;
 
if (++timesthrough == 1) {
mwp->mntfrom = imax(mwp->mntfrom, (int)strlen("Filesystem"));
mwp->fstype = imax(mwp->fstype, (int)strlen("Type"));
+   if (thousands) {/* make space for commas */
+   mwp->total += (mwp->total - 1) / 3;
+   mwp->used  += (mwp->used - 1) / 3;
+   mwp->avail += (mwp->avail - 

svn commit: r243048 - head/games/fortune/datfiles

2012-11-14 Thread John-Mark Gurney
Author: jmg
Date: Thu Nov 15 03:22:50 2012
New Revision: 243048
URL: http://svnweb.freebsd.org/changeset/base/243048

Log:
  fix a couple of spelling errors...

Modified:
  head/games/fortune/datfiles/fortunes

Modified: head/games/fortune/datfiles/fortunes
==
--- head/games/fortune/datfiles/fortunesThu Nov 15 03:00:49 2012
(r243047)
+++ head/games/fortune/datfiles/fortunesThu Nov 15 03:22:50 2012
(r243048)
@@ -901,7 +901,7 @@ to add.  This will take at least two wee
"Even that is too much to expect," insisted the manager, "I will be
 satisfied if you simply tell me when the program is complete."
The programmer agreed to this.
-   Several years slated, the manager retired.  On the way to his
+   Several years later, the manager retired.  On the way to his
 retirement lunch, he discovered the programmer asleep at his terminal.
 He had been programming all night.
-- Geoffrey James, "The Tao of Programming"
@@ -7947,7 +7947,7 @@ the same mistake twice without getting n
 A well-known friend is a treasure.
 %
 A well-used door needs no oil on its hinges.
-A swift-flowing steam does no grow stagnant.
+A swift-flowing stream does not grow stagnant.
 Neither sound nor thoughts can travel through a vacuum.
 Software rots if not used.
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243047 - head/sys/dev/ath

2012-11-14 Thread Adrian Chadd
Author: adrian
Date: Thu Nov 15 03:00:49 2012
New Revision: 243047
URL: http://svnweb.freebsd.org/changeset/base/243047

Log:
  Make sure the final descriptor in an aggregate has rate control information.
  
  This was broken by me when merging the 802.11n aggregate descriptor chain
  setup with the default descriptor chain setup, in preparation for supporting
  AR9380 NICs.
  
  The corner case here is quite specific - if you queue an aggregate frame
  with >1 frames in it, and the last subframe has only one descriptor making
  it up, then that descriptor won't have the rate control information
  copied into it. Look at what happens inside ar5416FillTxDesc() if
  both firstSeg and lastSeg are set to 1.
  
  Then when ar5416ProcTxDesc() goes to fill out ts_rate based on the
  transmit index, it looks at the rate control fields in that descriptor
  and dutifully sets it to be 0.
  
  It doesn't happen for non-aggregate frames - if they have one descriptor,
  the first descriptor already has rate control info.
  
  I removed the call to ath_hal_setuplasttxdesc() when I migrated the
  code to use the "new" style aggregate chain routines from the HAL.
  But I missed this particular corner case.
  
  This is a bit inefficient with MIPS boards as it involves a few redundant
  writes into non-cachable memory.  I'll chase that up when it matters.
  
  Tested:
  
   * AR9280 STA mode, TCP iperf traffic
   * Rui Paulo  first reported this and has verified it on
 his AR9160 based AP.
  
  PR:   kern/173636

Modified:
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cThu Nov 15 00:51:57 2012
(r243046)
+++ head/sys/dev/ath/if_ath_tx.cThu Nov 15 03:00:49 2012
(r243047)
@@ -623,6 +623,31 @@ ath_tx_setds_11n(struct ath_softc *sc, s
 */
bf_first->bf_last = bf_prev;
 
+   /*
+* For non-AR9300 NICs, which require the rate control
+* in the final descriptor - let's set that up now.
+*
+* This is because the filltxdesc() HAL call doesn't
+* populate the last segment with rate control information
+* if firstSeg is also true.  For non-aggregate frames
+* that is fine, as the first frame already has rate control
+* info.  But if the last frame in an aggregate has one
+* descriptor, both firstseg and lastseg will be true and
+* the rate info isn't copied.
+*
+* This is inefficient on MIPS/ARM platforms that have
+* non-cachable memory for TX descriptors, but we'll just
+* make do for now.
+*
+* As to why the rate table is stashed in the last descriptor
+* rather than the first descriptor?  Because proctxdesc()
+* is called on the final descriptor in an MPDU or A-MPDU -
+* ie, the one that gets updated by the hardware upon
+* completion.  That way proctxdesc() doesn't need to know
+* about the first _and_ last TX descriptor.
+*/
+   ath_hal_setuplasttxdesc(sc->sc_ah, bf_prev->bf_lastds, ds0);
+
DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: end\n", __func__);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243046 - in head: sys/kern sys/sparc64/include sys/sys usr.bin/ktrdump

2012-11-14 Thread Jeff Roberson
Author: jeff
Date: Thu Nov 15 00:51:57 2012
New Revision: 243046
URL: http://svnweb.freebsd.org/changeset/base/243046

Log:
   - Implement run-time expansion of the KTR buffer via sysctl.
   - Implement a function to ensure that all preempted threads have switched
 back out at least once.  Use this to make sure there are no stale
 references to the old ktr_buf or the lock profiling buffers before
 updating them.
  
  Reviewed by:  marius (sparc64 parts), attilio (earlier patch)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/kern/kern_ktr.c
  head/sys/kern/subr_lock.c
  head/sys/kern/subr_smp.c
  head/sys/sparc64/include/ktr.h
  head/sys/sys/ktr.h
  head/sys/sys/smp.h
  head/usr.bin/ktrdump/ktrdump.c

Modified: head/sys/kern/kern_ktr.c
==
--- head/sys/kern/kern_ktr.cWed Nov 14 22:21:03 2012(r243045)
+++ head/sys/kern/kern_ktr.cThu Nov 15 00:51:57 2012(r243046)
@@ -47,7 +47,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -66,6 +70,9 @@ __FBSDID("$FreeBSD$");
 #defineKTR_ENTRIES 1024
 #endif
 
+/* Limit the allocations to something manageable. */
+#defineKTR_ENTRIES_MAX (8 * 1024 * 1024)
+
 #ifndef KTR_MASK
 #defineKTR_MASK(0)
 #endif
@@ -82,30 +89,31 @@ __FBSDID("$FreeBSD$");
 #defineKTR_CPU PCPU_GET(cpuid)
 #endif
 
-FEATURE(ktr, "Kernel support for KTR kernel tracing facility");
+static MALLOC_DEFINE(M_KTR, "KTR", "KTR");
 
-static SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options");
+FEATURE(ktr, "Kernel support for KTR kernel tracing facility");
 
+volatile int   ktr_idx = 0;
 intktr_mask = KTR_MASK;
+intktr_compile = KTR_COMPILE;
+intktr_entries = KTR_ENTRIES;
+intktr_version = KTR_VERSION;
+struct ktr_entry ktr_buf_init[KTR_ENTRIES];
+struct ktr_entry *ktr_buf = ktr_buf_init;
+cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK);
+static char ktr_cpumask_str[CPUSETBUFSIZ];
+
 TUNABLE_INT("debug.ktr.mask", &ktr_mask);
-SYSCTL_INT(_debug_ktr, OID_AUTO, mask, CTLFLAG_RW,
-&ktr_mask, 0, "Bitmask of KTR event classes for which logging is enabled");
 
-intktr_compile = KTR_COMPILE;
-SYSCTL_INT(_debug_ktr, OID_AUTO, compile, CTLFLAG_RD,
-&ktr_compile, 0, "Bitmask of KTR event classes compiled into the kernel");
+TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask_str, sizeof(ktr_cpumask_str));
 
-intktr_entries = KTR_ENTRIES;
-SYSCTL_INT(_debug_ktr, OID_AUTO, entries, CTLFLAG_RD,
-&ktr_entries, 0, "Number of entries in the KTR buffer");
+static SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options");
 
-intktr_version = KTR_VERSION;
 SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD,
 &ktr_version, 0, "Version of the KTR interface");
 
-cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK);
-static char ktr_cpumask_str[CPUSETBUFSIZ];
-TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask_str, sizeof(ktr_cpumask_str));
+SYSCTL_INT(_debug_ktr, OID_AUTO, compile, CTLFLAG_RD,
+&ktr_compile, 0, "Bitmask of KTR event classes compiled into the kernel");
 
 static void
 ktr_cpumask_initializer(void *dummy __unused)
@@ -145,9 +153,6 @@ SYSCTL_PROC(_debug_ktr, OID_AUTO, cpumas
 sysctl_debug_ktr_cpumask, "S",
 "Bitmask of CPUs on which KTR logging is enabled");
 
-volatile int   ktr_idx = 0;
-struct ktr_entry ktr_buf[KTR_ENTRIES];
-
 static int
 sysctl_debug_ktr_clear(SYSCTL_HANDLER_ARGS)
 {
@@ -159,7 +164,7 @@ sysctl_debug_ktr_clear(SYSCTL_HANDLER_AR
return (error);
 
if (clear) {
-   bzero(ktr_buf, sizeof(ktr_buf));
+   bzero(ktr_buf, sizeof(*ktr_buf) * ktr_entries);
ktr_idx = 0;
}
 
@@ -168,6 +173,67 @@ sysctl_debug_ktr_clear(SYSCTL_HANDLER_AR
 SYSCTL_PROC(_debug_ktr, OID_AUTO, clear, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
 sysctl_debug_ktr_clear, "I", "Clear KTR Buffer");
 
+/*
+ * This is a sysctl proc so that it is serialized as !MPSAFE along with
+ * the other ktr sysctl procs.
+ */
+static int
+sysctl_debug_ktr_mask(SYSCTL_HANDLER_ARGS)
+{
+   int mask, error;
+
+   mask = ktr_mask;
+   error = sysctl_handle_int(oidp, &mask, 0, req);
+   if (error || !req->newptr)
+   return (error);
+   ktr_mask = mask;
+   return (error);
+}
+
+SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
+sysctl_debug_ktr_mask, "I",
+"Bitmask of KTR event classes for which logging is enabled");
+
+static int
+sysctl_debug_ktr_entries(SYSCTL_HANDLER_ARGS)
+{
+   int entries, error, mask;
+   struct ktr_entry *buf, *oldbuf;
+
+   entries = ktr_entries;
+   error = sysctl_handle_int(oidp, &entries, 0, req);
+   if (error || !req->newptr)
+   return (error);
+   if (entries > KTR_ENTRIES_MAX)
+   return (ERANGE

svn commit: r243045 - vendor-sys/acpica/20121114

2012-11-14 Thread Jung-uk Kim
Author: jkim
Date: Wed Nov 14 22:21:03 2012
New Revision: 243045
URL: http://svnweb.freebsd.org/changeset/base/243045

Log:
  Tag ACPICA 20121114.

Added:
  vendor-sys/acpica/20121114/
 - copied from r243044, vendor-sys/acpica/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243044 - in vendor-sys/acpica/dist: . generate/unix/acpibin generate/unix/acpiexec generate/unix/iasl source/common source/compiler source/components/debugger source/components/disasse...

2012-11-14 Thread Jung-uk Kim
Author: jkim
Date: Wed Nov 14 22:20:16 2012
New Revision: 243044
URL: http://svnweb.freebsd.org/changeset/base/243044

Log:
  Import ACPICA 20121114.

Added:
  vendor-sys/acpica/dist/source/components/disassembler/dmdeferred.c   
(contents, props changed)
Modified:
  vendor-sys/acpica/dist/changes.txt
  vendor-sys/acpica/dist/generate/unix/acpibin/Makefile
  vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile
  vendor-sys/acpica/dist/generate/unix/iasl/Makefile
  vendor-sys/acpica/dist/source/common/adfile.c
  vendor-sys/acpica/dist/source/common/adisasm.c
  vendor-sys/acpica/dist/source/common/dmextern.c
  vendor-sys/acpica/dist/source/common/dmrestag.c
  vendor-sys/acpica/dist/source/compiler/aslcompile.c
  vendor-sys/acpica/dist/source/compiler/aslcompiler.h
  vendor-sys/acpica/dist/source/compiler/aslerror.c
  vendor-sys/acpica/dist/source/compiler/aslfiles.c
  vendor-sys/acpica/dist/source/compiler/aslglobal.h
  vendor-sys/acpica/dist/source/compiler/asllisting.c
  vendor-sys/acpica/dist/source/compiler/asllookup.c
  vendor-sys/acpica/dist/source/compiler/aslmain.c
  vendor-sys/acpica/dist/source/compiler/aslstartup.c
  vendor-sys/acpica/dist/source/compiler/dttemplate.c
  vendor-sys/acpica/dist/source/compiler/prutils.c
  vendor-sys/acpica/dist/source/compiler/readme.txt
  vendor-sys/acpica/dist/source/components/debugger/dbfileio.c
  vendor-sys/acpica/dist/source/components/debugger/dbinput.c
  vendor-sys/acpica/dist/source/components/debugger/dbmethod.c
  vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c
  vendor-sys/acpica/dist/source/components/disassembler/dmresrc.c
  vendor-sys/acpica/dist/source/components/disassembler/dmresrcl.c
  vendor-sys/acpica/dist/source/components/disassembler/dmresrcl2.c
  vendor-sys/acpica/dist/source/components/disassembler/dmresrcs.c
  vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c
  vendor-sys/acpica/dist/source/components/executer/exregion.c
  vendor-sys/acpica/dist/source/components/namespace/nsutils.c
  vendor-sys/acpica/dist/source/components/namespace/nsxfname.c
  vendor-sys/acpica/dist/source/components/resources/rscalc.c
  vendor-sys/acpica/dist/source/components/resources/rscreate.c
  vendor-sys/acpica/dist/source/components/resources/rsdump.c
  vendor-sys/acpica/dist/source/components/resources/rslist.c
  vendor-sys/acpica/dist/source/components/resources/rsmisc.c
  vendor-sys/acpica/dist/source/components/resources/rsxface.c
  vendor-sys/acpica/dist/source/components/utilities/utdelete.c
  vendor-sys/acpica/dist/source/components/utilities/utresrc.c
  vendor-sys/acpica/dist/source/components/utilities/utstate.c
  vendor-sys/acpica/dist/source/components/utilities/uttrack.c
  vendor-sys/acpica/dist/source/include/acdisasm.h
  vendor-sys/acpica/dist/source/include/acmacros.h
  vendor-sys/acpica/dist/source/include/acpixf.h
  vendor-sys/acpica/dist/source/include/acrestyp.h
  vendor-sys/acpica/dist/source/include/acutils.h
  vendor-sys/acpica/dist/source/tools/acpibin/abcompare.c
  vendor-sys/acpica/dist/source/tools/acpibin/abmain.c
  vendor-sys/acpica/dist/source/tools/acpibin/acpibin.h
  vendor-sys/acpica/dist/source/tools/acpisrc/acpisrc.h
  vendor-sys/acpica/dist/source/tools/acpisrc/asfile.c
  vendor-sys/acpica/dist/source/tools/acpixtract/acpixtract.c

Modified: vendor-sys/acpica/dist/changes.txt
==
--- vendor-sys/acpica/dist/changes.txt  Wed Nov 14 21:25:55 2012
(r243043)
+++ vendor-sys/acpica/dist/changes.txt  Wed Nov 14 22:20:16 2012
(r243044)
@@ -1,4 +1,94 @@
 
+14 November 2012. Summary of changes for version 20121114:
+
+This release is available at https://www.acpica.org/downloads
+The ACPI 5.0 specification is available at www.acpi.info
+
+1) ACPICA Kernel-resident Subsystem:
+
+Implemented a performance enhancement for ACPI/AML Package objects. This 
+change greatly increases the performance of Package objects within the 
+interpreter. It changes the processing of reference counts for packages by 
+optimizing for the most common case where the package sub-objects are 
+either Integers, Strings, or Buffers. Increases the overall performance of 
+the ASLTS test suite by 1.5X (Increases the Slack Mode performance by 2X.) 
+Chao Guan. ACPICA BZ 943.
+
+Implemented and deployed common macros to extract flag bits from resource 
+descriptors. Improves readability and maintainability of the code. Fixes a 
+problem with the UART serial bus descriptor for the number of data bits 
+flags (was incorrectly 2 bits, should be 3).
+
+Enhanced the ACPI_GETx and ACPI_SETx macros. Improved the implementation 
+of the macros and changed the SETx macros to the style of (destination, 
+source). Also added ACPI_CASTx companion macros. Lv Zheng.
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The 
+debug

Re: svn commit: r243019 - head/sbin/route

2012-11-14 Thread Ben Kaduk
On Wed, Nov 14, 2012 at 11:27 AM, Eitan Adler  wrote:
> On 14 November 2012 11:12, Ben Kaduk  wrote:
>> Andre, they are used (for better or for worse) in a multi-site
>> database synchronization protocol that currently works portably across
>> operating systems.  Removing them would change the semantics of that
>> protocol in a subtle way that might introduce breakage.
>
> Which one?

OpenAFS.  In particular, the logic to determine the sychronization
site for the ubik databases uses classful addressing.

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


svn commit: r243042 - stable/9/sys/conf

2012-11-14 Thread Dimitry Andric
Author: dim
Date: Wed Nov 14 20:32:43 2012
New Revision: 243042
URL: http://svnweb.freebsd.org/changeset/base/243042

Log:
  MFC r242715:
  
For kernel builds with PROFLEVEL >= 1, such as LINT, don't attempt to
use the -falign-functions option if the compiler is clang, as the flag
is not supported.
  
  MFC r242717:
  
For kernel builds with PROFLEVEL >= 2, such as LINT, don't attempt to
use the -mprofiler-epilogue option if the compiler is clang, as the flag
is not supported.  While here, fix up the value indentations.

Modified:
  stable/9/sys/conf/kern.pre.mk
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)

Modified: stable/9/sys/conf/kern.pre.mk
==
--- stable/9/sys/conf/kern.pre.mk   Wed Nov 14 20:27:17 2012
(r243041)
+++ stable/9/sys/conf/kern.pre.mk   Wed Nov 14 20:32:43 2012
(r243042)
@@ -108,12 +108,18 @@ CLANG_NO_IAS= -no-integrated-as
 .endif
 
 .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
-CFLAGS+=   -DGPROF -falign-functions=16
+CFLAGS+=   -DGPROF
+.if ${COMPILER_TYPE} != "clang"
+CFLAGS+=   -falign-functions=16
+.endif
 .if ${PROFLEVEL} >= 2
 CFLAGS+=   -DGPROF4 -DGUPROF
-PROF=  -pg -mprofiler-epilogue
+PROF=  -pg
+.if ${COMPILER_TYPE} != "clang"
+PROF+= -mprofiler-epilogue
+.endif
 .else
-PROF=  -pg
+PROF=  -pg
 .endif
 .endif
 DEFINED_PROF=  ${PROF}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243041 - in stable/9: . share/mk sys/conf

2012-11-14 Thread Dimitry Andric
Author: dim
Date: Wed Nov 14 20:27:17 2012
New Revision: 243041
URL: http://svnweb.freebsd.org/changeset/base/243041

Log:
  MFC r240468 (by brooks):
  
Introduce a new make variable COMPILER_TYPE that specifies what
type of compiler is being used (currently clang or gcc).  COMPILER_TYPE
is set in the new bsd.compiler.mk file based on the value of the CC
variable or, should it prove informative, by running ${CC} --version
and examining the output.
  
To avoid negative performance impacts in the default case and correct
value for COMPILER_TYPE type is determined and passed in the environment
of submake instances while building world.
  
Replace adhoc attempts at determining the compiler type by examining
CC or MK_CLANG_IS_CC with checks of COMPILER_TYPE.  This eliminates
bootstrapping complications when first setting WITH_CLANG_IS_CC.
  
Sponsored by:   DARPA, AFRL
Reviewed by:Yamaya Takashi , imp, linimon
(with some modifications post review)
  
  MFC r242633 (by brooks):
  
Allow CC to be gcc46 or similar by matching gcc*.
  
Don't test the value of the :M matches, either the string matches or does
not.
  
  MFC r242658:
  
Fix typo in bsd.compiler.mk.

Added:
  stable/9/share/mk/bsd.compiler.mk
 - copied, changed from r240468, head/share/mk/bsd.compiler.mk
Modified:
  stable/9/Makefile.inc1   (contents, props changed)
  stable/9/share/mk/Makefile
  stable/9/share/mk/bsd.sys.mk   (contents, props changed)
  stable/9/sys/conf/kern.mk
  stable/9/sys/conf/kern.pre.mk
  stable/9/sys/conf/kmod.mk
Directory Properties:
  stable/9/share/   (props changed)
  stable/9/share/mk/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)

Modified: stable/9/Makefile.inc1
==
--- stable/9/Makefile.inc1  Wed Nov 14 20:01:40 2012(r243040)
+++ stable/9/Makefile.inc1  Wed Nov 14 20:27:17 2012(r243041)
@@ -42,6 +42,7 @@ TARGET_ARCH=${TARGET}
 
 .include 
 .include 
+.include 
 
 # We must do share/info early so that installation of info `dir'
 # entries works correctly.  Do it first since it is less likely to
@@ -230,7 +231,8 @@ BMAKEENV=   INSTALL="sh ${.CURDIR}/tools/i
PATH=${BPATH}:${PATH} \
WORLDTMP=${WORLDTMP} \
VERSION="${VERSION}" \
-   MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
+   MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
+   COMPILER_TYPE=${COMPILER_TYPE}
 BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
${BMAKEENV} ${MAKE} -f Makefile.inc1 \
DESTDIR= \
@@ -265,6 +267,16 @@ WMAKEENV=  ${CROSSENV} \
 .if ${MK_CDDL} == "no"
 WMAKEENV+= NO_CTF=1
 .endif
+.if ${CC:T:Mgcc} == "gcc"
+WMAKE_COMPILER_TYPE=   gcc
+.elif ${CC:T:Mclang} == "clang"
+WMAKE_COMPILER_TYPE=   clang
+.elif ${MK_CLANG_IS_CC} == "no"
+WMAKE_COMPILER_TYPE=   gcc
+.else
+WMAKE_COMPILER_TYPE=   clang
+.endif
+WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE}
 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
 
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
@@ -308,7 +320,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTR
CC="${CC} ${LIB32FLAGS}" \
CXX="${CXX} ${LIB32FLAGS}" \
LIBDIR=/usr/lib32 \
-   SHLIBDIR=/usr/lib32
+   SHLIBDIR=/usr/lib32 \
+   COMPILER_TYPE=${WMAKE_COMPILER_TYPE}
 
 LIB32WMAKE=${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \

Modified: stable/9/share/mk/Makefile
==
--- stable/9/share/mk/Makefile  Wed Nov 14 20:01:40 2012(r243040)
+++ stable/9/share/mk/Makefile  Wed Nov 14 20:27:17 2012(r243041)
@@ -3,7 +3,8 @@
 
 FILES= bsd.README
 FILES+=bsd.arch.inc.mk
-FILES+=bsd.compat.mk bsd.cpu.mk bsd.dep.mk bsd.doc.mk bsd.dtrace.mk
+FILES+=bsd.compat.mk bsd.compiler.mk bsd.cpu.mk
+FILES+=bsd.dep.mk bsd.doc.mk bsd.dtrace.mk
 FILES+=bsd.endian.mk
 FILES+=bsd.files.mk bsd.crunchgen.mk bsd.incs.mk bsd.info.mk 
bsd.init.mk
 FILES+=bsd.kmod.mk

Copied and modified: stable/9/share/mk/bsd.compiler.mk (from r240468, 
head/share/mk/bsd.compiler.mk)
==
--- head/share/mk/bsd.compiler.mk   Thu Sep 13 16:00:46 2012
(r240468, copy source)
+++ stable/9/share/mk/bsd.compiler.mk   Wed Nov 14 20:27:17 2012
(r243041)
@@ -1,20 +1,20 @@
 # $FreeBSD$
 
 .if !defined(COMPILER_TYPE)
-. if ${CC:T:Mgcc} == "gcc"
+. if ${CC:T:Mgcc*}
 COMPILER_TYPE:=gcc  
-. elif ${CC:T:Mclang} == "clang"
+. elif ${CC:T:Mclang}
 COMPILER_TYPE:=clang
 . else
 _COMPIL

svn commit: r243040 - in head/sys: amd64/amd64 arm/arm ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 vm

2012-11-14 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 14 20:01:40 2012
New Revision: 243040
URL: http://svnweb.freebsd.org/changeset/base/243040

Log:
  Flip the semantic of M_NOWAIT to only require the allocation to not
  sleep, and perform the page allocations with VM_ALLOC_SYSTEM
  class. Previously, the allocation was also allowed to completely drain
  the reserve of the free pages, being translated to VM_ALLOC_INTERRUPT
  request class for vm_page_alloc() and similar functions.
  
  Allow the caller of malloc* to request the 'deep drain' semantic by
  providing M_USE_RESERVE flag, now translated to VM_ALLOC_INTERRUPT
  class. Previously, it resulted in less aggressive VM_ALLOC_SYSTEM
  allocation class.
  
  Centralize the translation of the M_* malloc(9) flags in the single
  inline function malloc2vm_flags().
  
  Discussion started by:"Sears, Steven" 
  Reviewed by:  alc, mdf (previous version)
  Tested by:pho (previous version)
  MFC after:2 weeks

Modified:
  head/sys/amd64/amd64/uma_machdep.c
  head/sys/arm/arm/vm_machdep.c
  head/sys/ia64/ia64/uma_machdep.c
  head/sys/mips/mips/uma_machdep.c
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/aim/slb.c
  head/sys/powerpc/aim/uma_machdep.c
  head/sys/sparc64/sparc64/vm_machdep.c
  head/sys/vm/vm_kern.c
  head/sys/vm/vm_page.h

Modified: head/sys/amd64/amd64/uma_machdep.c
==
--- head/sys/amd64/amd64/uma_machdep.c  Wed Nov 14 19:50:21 2012
(r243039)
+++ head/sys/amd64/amd64/uma_machdep.c  Wed Nov 14 20:01:40 2012
(r243040)
@@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -48,12 +49,7 @@ uma_small_alloc(uma_zone_t zone, int byt
int pflags;
 
*flags = UMA_SLAB_PRIV;
-   if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-   pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
-   else
-   pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
-   if (wait & M_ZERO)
-   pflags |= VM_ALLOC_ZERO;
+   pflags = malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
for (;;) {
m = vm_page_alloc(NULL, 0, pflags);
if (m == NULL) {

Modified: head/sys/arm/arm/vm_machdep.c
==
--- head/sys/arm/arm/vm_machdep.c   Wed Nov 14 19:50:21 2012
(r243039)
+++ head/sys/arm/arm/vm_machdep.c   Wed Nov 14 20:01:40 2012
(r243040)
@@ -651,12 +651,7 @@ uma_small_alloc(uma_zone_t zone, int byt
ret = ((void *)kmem_malloc(kmem_map, bytes, M_NOWAIT));
return (ret);
}
-   if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-   pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
-   else
-   pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
-   if (wait & M_ZERO)
-   pflags |= VM_ALLOC_ZERO;
+   pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED;
for (;;) {
m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ);
if (m == NULL) {

Modified: head/sys/ia64/ia64/uma_machdep.c
==
--- head/sys/ia64/ia64/uma_machdep.cWed Nov 14 19:50:21 2012
(r243039)
+++ head/sys/ia64/ia64/uma_machdep.cWed Nov 14 20:01:40 2012
(r243040)
@@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -46,12 +47,7 @@ uma_small_alloc(uma_zone_t zone, int byt
int pflags;
 
*flags = UMA_SLAB_PRIV;
-   if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-   pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
-   else
-   pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
-   if (wait & M_ZERO)
-   pflags |= VM_ALLOC_ZERO;
+   pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED;
 
for (;;) {
m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ);

Modified: head/sys/mips/mips/uma_machdep.c
==
--- head/sys/mips/mips/uma_machdep.cWed Nov 14 19:50:21 2012
(r243039)
+++ head/sys/mips/mips/uma_machdep.cWed Nov 14 20:01:40 2012
(r243040)
@@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -48,13 +49,7 @@ uma_small_alloc(uma_zone_t zone, int byt
void *va;
 
*flags = UMA_SLAB_PRIV;
-
-   if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-   pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
-   else
-   pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
-   if (wait & M_ZERO)
-   pflags |= VM_ALLOC_ZERO;
+   pflags = m

svn commit: r243039 - head/sys/fs/devfs

2012-11-14 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 14 19:50:21 2012
New Revision: 243039
URL: http://svnweb.freebsd.org/changeset/base/243039

Log:
  Remove M_USE_RESERVE from the devfs cdp allocator, which is one of two
  uses of M_USE_RESERVE in the kernel. This allocation is not special.
  
  Reviewed by:  alc
  Tested by:pho
  MFC after:2 weeks

Modified:
  head/sys/fs/devfs/devfs_devs.c

Modified: head/sys/fs/devfs/devfs_devs.c
==
--- head/sys/fs/devfs/devfs_devs.c  Wed Nov 14 19:10:50 2012
(r243038)
+++ head/sys/fs/devfs/devfs_devs.c  Wed Nov 14 19:50:21 2012
(r243039)
@@ -121,7 +121,7 @@ devfs_alloc(int flags)
struct cdev *cdev;
struct timespec ts;
 
-   cdp = malloc(sizeof *cdp, M_CDEVP, M_USE_RESERVE | M_ZERO |
+   cdp = malloc(sizeof *cdp, M_CDEVP, M_ZERO |
((flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK));
if (cdp == NULL)
return (NULL);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r242102 - in head: contrib/bmake usr.bin/bmake

2012-11-14 Thread Chris Rees
On 14 Nov 2012 18:49, "Konstantin Belousov"  wrote:
>
> On Wed, Nov 14, 2012 at 09:28:23AM -0800, David O'Brien wrote:
> > On Thu, Oct 25, 2012 at 11:18:06PM +, Simon J. Gerraty wrote:
> > > Log:
> > >   Merge bmake-20121010
> >
> > Hi Simon,
> > I was kicking the tires on this and noticed bmake is dynamically linked.
> >
> > Can you change it to being statically linked?
> >
> >
> > This issue most recently came up in freebsd-current.  See thread pieces
> >
http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033460.html
> >
http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033472.html
> >
http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033473.html
>
> As you see, I prefer to not introduce new statically linked binaries into
base.
> If, for unfortunate turns of events, bmake is changed to be statically
linked,
> please obey WITH_SHARED_TOOLCHAIN.

Or a /rescue/bmake for when speed is a concern would also be acceptable.

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


svn commit: r243038 - head/sys/fs/smbfs

2012-11-14 Thread Davide Italiano
Author: davide
Date: Wed Nov 14 19:10:50 2012
New Revision: 243038
URL: http://svnweb.freebsd.org/changeset/base/243038

Log:
  Get rid of some old debug code. It provides checks similar to the one
  offered by RedZone so there's no need to keep it.
  
  Sponsored by: iXsystems inc.

Modified:
  head/sys/fs/smbfs/smbfs_node.c
  head/sys/fs/smbfs/smbfs_vnops.c

Modified: head/sys/fs/smbfs/smbfs_node.c
==
--- head/sys/fs/smbfs/smbfs_node.c  Wed Nov 14 18:54:08 2012
(r243037)
+++ head/sys/fs/smbfs/smbfs_node.c  Wed Nov 14 19:10:50 2012
(r243038)
@@ -70,18 +70,8 @@ smbfs_name_alloc(const u_char *name, int
u_char *cp;
 
nmlen++;
-#ifdef SMBFS_NAME_DEBUG
-   cp = malloc(nmlen + 2 + sizeof(int), M_SMBNODENAME, M_WAITOK);
-   *(int*)cp = nmlen;
-   cp += sizeof(int);
-   cp[0] = 0xfc;
-   cp++;
-   bcopy(name, cp, nmlen - 1);
-   cp[nmlen] = 0xfe;
-#else
cp = malloc(nmlen, M_SMBNODENAME, M_WAITOK);
bcopy(name, cp, nmlen - 1);
-#endif
cp[nmlen - 1] = 0;
return cp;
 }
@@ -89,26 +79,8 @@ smbfs_name_alloc(const u_char *name, int
 static void
 smbfs_name_free(u_char *name)
 {
-#ifdef SMBFS_NAME_DEBUG
-   int nmlen, slen;
-   u_char *cp;
 
-   cp = name;
-   cp--;
-   if (*cp != 0xfc)
-   panic("First byte of name entry '%s' corrupted", name);
-   cp -= sizeof(int);
-   nmlen = *(int*)cp;
-   slen = strlen(name) + 1;
-   if (nmlen != slen)
-   panic("Name length mismatch: was %d, now %d name '%s'",
-   nmlen, slen, name);
-   if (name[nmlen] != 0xfe)
-   panic("Last byte of name entry '%s' corrupted\n", name);
-   free(cp, M_SMBNODENAME);
-#else
free(name, M_SMBNODENAME);
-#endif
 }
 
 static int __inline

Modified: head/sys/fs/smbfs/smbfs_vnops.c
==
--- head/sys/fs/smbfs/smbfs_vnops.c Wed Nov 14 18:54:08 2012
(r243037)
+++ head/sys/fs/smbfs/smbfs_vnops.c Wed Nov 14 19:10:50 2012
(r243038)
@@ -1135,18 +1135,6 @@ smbfs_lookup(ap)
SMBFSERR("invalid '..'\n");
return EIO;
}
-#ifdef SMB_VNODE_DEBUG
-   {
-   char *cp, c;
-
-   cp = name + nmlen;
-   c = *cp;
-   *cp = 0;
-   SMBVDEBUG("%d '%s' in '%s' id=d\n", nameiop, name, 
-   VTOSMB(dvp)->n_name);
-   *cp = c;
-   }
-#endif
islastcn = flags & ISLASTCN;
if (islastcn && (mp->mnt_flag & MNT_RDONLY) && (nameiop != LOOKUP))
return EROFS;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243037 - head/sys/dev/aic7xxx/aicasm

2012-11-14 Thread Dimitry Andric
Author: dim
Date: Wed Nov 14 18:54:08 2012
New Revision: 243037
URL: http://svnweb.freebsd.org/changeset/base/243037

Log:
  Fix a bug in aicasm_gram.y, noted by a newer clang 3.2 snapshot: it
  compared an enum scope_type against a yacc-generated define, so the
  condition would always be false.
  
  MFC after:3 days

Modified:
  head/sys/dev/aic7xxx/aicasm/aicasm_gram.y

Modified: head/sys/dev/aic7xxx/aicasm/aicasm_gram.y
==
--- head/sys/dev/aic7xxx/aicasm/aicasm_gram.y   Wed Nov 14 18:52:37 2012
(r243036)
+++ head/sys/dev/aic7xxx/aicasm/aicasm_gram.y   Wed Nov 14 18:54:08 2012
(r243037)
@@ -1076,7 +1076,7 @@ conditional:
last_scope = TAILQ_LAST(&scope_context->inner_scope,
scope_tailq);
if (last_scope == NULL
-|| last_scope->type == T_ELSE) {
+|| last_scope->type == SCOPE_ELSE) {
 
stop("'else if' without leading 'if'", EX_DATAERR);
/* NOTREACHED */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243036 - head/games/fortune/fortune

2012-11-14 Thread Dimitry Andric
Author: dim
Date: Wed Nov 14 18:52:37 2012
New Revision: 243036
URL: http://svnweb.freebsd.org/changeset/base/243036

Log:
  In games/fortune/fortune/fortune.c, make 'Debug' the correct type (it is
  *not* a boolean).
  
  MFC after:3 days

Modified:
  head/games/fortune/fortune/fortune.c

Modified: head/games/fortune/fortune/fortune.c
==
--- head/games/fortune/fortune/fortune.cWed Nov 14 18:51:12 2012
(r243035)
+++ head/games/fortune/fortune/fortune.cWed Nov 14 18:52:37 2012
(r243036)
@@ -109,7 +109,7 @@ static bool Equal_probs = FALSE;/* scat
 static boolMatch = FALSE;  /* dump fortunes matching a pattern */
 static boolWriteToDisk = false;/* use files on disk to save state */
 #ifdef DEBUG
-static boolDebug = FALSE;  /* print debug messages */
+static int Debug = 0;  /* print debug messages */
 #endif
 
 static char*Fortbuf = NULL;/* fortune buffer for -m */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243035 - head/usr.bin/mkcsmapper

2012-11-14 Thread Dimitry Andric
Author: dim
Date: Wed Nov 14 18:51:12 2012
New Revision: 243035
URL: http://svnweb.freebsd.org/changeset/base/243035

Log:
  For mkcsmapper, conditionalize gcc-specific compile flags.
  
  MFC after:3 days

Modified:
  head/usr.bin/mkcsmapper/Makefile.inc

Modified: head/usr.bin/mkcsmapper/Makefile.inc
==
--- head/usr.bin/mkcsmapper/Makefile.incWed Nov 14 18:49:03 2012
(r243034)
+++ head/usr.bin/mkcsmapper/Makefile.incWed Nov 14 18:51:12 2012
(r243035)
@@ -1,7 +1,11 @@
 # $FreeBSD$
 
+.include 
+
 SRCS+= lex.l yacc.y
 CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../mkcsmapper \
 -I${.CURDIR}/../../lib/libc/iconv \
--I${.CURDIR}/../../lib/libiconv_modules/mapper_std \
---param max-inline-insns-single=64
+-I${.CURDIR}/../../lib/libiconv_modules/mapper_std
+.if ${COMPILER_TYPE} == "gcc"
+CFLAGS+= --param max-inline-insns-single=64
+.endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243034 - head/crypto/heimdal/lib/sl

2012-11-14 Thread Dimitry Andric
Author: dim
Date: Wed Nov 14 18:49:03 2012
New Revision: 243034
URL: http://svnweb.freebsd.org/changeset/base/243034

Log:
  In crypto/heimdal/lib/sl/slc-lex.l, don't define YY_NO_INPUT, since
  %option nounput is already specified.
  
  MFC after:3 days

Modified:
  head/crypto/heimdal/lib/sl/slc-lex.l

Modified: head/crypto/heimdal/lib/sl/slc-lex.l
==
--- head/crypto/heimdal/lib/sl/slc-lex.lWed Nov 14 18:43:58 2012
(r243033)
+++ head/crypto/heimdal/lib/sl/slc-lex.lWed Nov 14 18:49:03 2012
(r243034)
@@ -47,8 +47,6 @@ unsigned lineno = 1;
 static void handle_comment(void);
 static char * handle_string(void);
 
-#define YY_NO_UNPUT
-
 #undef ECHO
 
 %}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r242102 - in head: contrib/bmake usr.bin/bmake

2012-11-14 Thread Konstantin Belousov
On Wed, Nov 14, 2012 at 09:28:23AM -0800, David O'Brien wrote:
> On Thu, Oct 25, 2012 at 11:18:06PM +, Simon J. Gerraty wrote:
> > Log:
> >   Merge bmake-20121010
> 
> Hi Simon,
> I was kicking the tires on this and noticed bmake is dynamically linked.
> 
> Can you change it to being statically linked?
> 
> 
> This issue most recently came up in freebsd-current.  See thread pieces
> http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033460.html
> http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033472.html
> http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033473.html

As you see, I prefer to not introduce new statically linked binaries into base.
If, for unfortunate turns of events, bmake is changed to be statically linked,
please obey WITH_SHARED_TOOLCHAIN.


pgpb9jNngLb8L.pgp
Description: PGP signature


svn commit: r243033 - head/sys/fs/smbfs

2012-11-14 Thread Davide Italiano
Author: davide
Date: Wed Nov 14 18:43:58 2012
New Revision: 243033
URL: http://svnweb.freebsd.org/changeset/base/243033

Log:
  Fix the lookup in the DOTDOT case in the same way as other filesystems do,
  i.e. inlining the vn_vget_ino() algorithm.
  
  Sponsored by: iXsystems inc.

Modified:
  head/sys/fs/smbfs/smbfs_vnops.c

Modified: head/sys/fs/smbfs/smbfs_vnops.c
==
--- head/sys/fs/smbfs/smbfs_vnops.c Wed Nov 14 17:44:37 2012
(r243032)
+++ head/sys/fs/smbfs/smbfs_vnops.c Wed Nov 14 18:43:58 2012
(r243033)
@@ -1278,9 +1278,30 @@ smbfs_lookup(ap)
goto out;
}
if (flags & ISDOTDOT) {
+   mp = dvp->v_mount;
+   error = vfs_busy(mp, MBF_NOWAIT);
+   if (error != 0) {
+   vfs_ref(mp);
+   VOP_UNLOCK(dvp, 0);
+   error = vfs_busy(mp, 0);
+   vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
+   vfs_rel(mp);
+   if (error)
+   return (ENOENT);
+   if ((dvp->v_iflag & VI_DOOMED) != 0) {
+   vfs_unbusy(mp);
+   return (ENOENT);
+   }
+   }   
VOP_UNLOCK(dvp, 0);
error = smbfs_nget(mp, dvp, name, nmlen, NULL, &vp);
+   vfs_unbusy(mp);
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
+   if ((dvp->v_iflag & VI_DOOMED) != 0) {
+   if (error == 0)
+   vput(vp);
+   error = ENOENT;
+   }
if (error)
goto out;
*vpp = vp;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243032 - head/include/xlocale

2012-11-14 Thread Dmitry Sivachenko
Author: demon (ports committer)
Date: Wed Nov 14 17:44:37 2012
New Revision: 243032
URL: http://svnweb.freebsd.org/changeset/base/243032

Log:
  Use defined() to test macro definitions.
  
  Approved by:  theraven

Modified:
  head/include/xlocale/_ctype.h

Modified: head/include/xlocale/_ctype.h
==
--- head/include/xlocale/_ctype.h   Wed Nov 14 17:36:06 2012
(r243031)
+++ head/include/xlocale/_ctype.h   Wed Nov 14 17:44:37 2012
(r243032)
@@ -53,7 +53,7 @@ _RuneLocale   *__runes_for_locale(locale_t
 #endif
 
 #ifndef _XLOCALE_INLINE
-#if __GNUC__ && !__GNUC_STDC_INLINE__
+#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
 /* GNU89 inline has nonstandard semantics. */
 #define _XLOCALE_INLINE extern __inline
 #else
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243031 - head/sys/netinet6

2012-11-14 Thread Andrey V. Elsukov
Author: ae
Date: Wed Nov 14 17:36:06 2012
New Revision: 243031
URL: http://svnweb.freebsd.org/changeset/base/243031

Log:
  if_afdata lock was converted from mutex to rwlock a long ago, so we can
  replace IF_AFDATA_LOCK() macro depending to the access type.
  
  Sponsored by: Yandex LLC
  MFC after:1 week

Modified:
  head/sys/netinet6/scope6.c

Modified: head/sys/netinet6/scope6.c
==
--- head/sys/netinet6/scope6.c  Wed Nov 14 17:33:00 2012(r243030)
+++ head/sys/netinet6/scope6.c  Wed Nov 14 17:36:06 2012(r243031)
@@ -121,11 +121,11 @@ scope6_set(struct ifnet *ifp, struct sco
int error = 0;
struct scope6_id *sid = NULL;
 
-   IF_AFDATA_LOCK(ifp);
+   IF_AFDATA_WLOCK(ifp);
sid = SID(ifp);
 
if (!sid) { /* paranoid? */
-   IF_AFDATA_UNLOCK(ifp);
+   IF_AFDATA_WUNLOCK(ifp);
return (EINVAL);
}
 
@@ -148,7 +148,7 @@ scope6_set(struct ifnet *ifp, struct sco
 */
if (i == IPV6_ADDR_SCOPE_INTFACELOCAL &&
idlist->s6id_list[i] != ifp->if_index) {
-   IF_AFDATA_UNLOCK(ifp);
+   IF_AFDATA_WUNLOCK(ifp);
return (EINVAL);
}
 
@@ -160,7 +160,7 @@ scope6_set(struct ifnet *ifp, struct sco
 * IDs, but we check the consistency for
 * safety in later use.
 */
-   IF_AFDATA_UNLOCK(ifp);
+   IF_AFDATA_WUNLOCK(ifp);
return (EINVAL);
}
 
@@ -172,7 +172,7 @@ scope6_set(struct ifnet *ifp, struct sco
sid->s6id_list[i] = idlist->s6id_list[i];
}
}
-   IF_AFDATA_UNLOCK(ifp);
+   IF_AFDATA_WUNLOCK(ifp);
 
return (error);
 }
@@ -180,18 +180,19 @@ scope6_set(struct ifnet *ifp, struct sco
 int
 scope6_get(struct ifnet *ifp, struct scope6_id *idlist)
 {
-   /* We only need to lock the interface's afdata for SID() to work. */
-   IF_AFDATA_LOCK(ifp);
-   struct scope6_id *sid = SID(ifp);
+   struct scope6_id *sid;
 
+   /* We only need to lock the interface's afdata for SID() to work. */
+   IF_AFDATA_RLOCK(ifp);
+   sid = SID(ifp);
if (sid == NULL) {  /* paranoid? */
-   IF_AFDATA_UNLOCK(ifp);
+   IF_AFDATA_RUNLOCK(ifp);
return (EINVAL);
}
 
*idlist = *sid;
 
-   IF_AFDATA_UNLOCK(ifp);
+   IF_AFDATA_RUNLOCK(ifp);
return (0);
 }
 
@@ -408,7 +409,7 @@ in6_setscope(struct in6_addr *in6, struc
u_int32_t zoneid = 0;
struct scope6_id *sid;
 
-   IF_AFDATA_LOCK(ifp);
+   IF_AFDATA_RLOCK(ifp);
 
sid = SID(ifp);
 
@@ -425,12 +426,12 @@ in6_setscope(struct in6_addr *in6, struc
 */
if (IN6_IS_ADDR_LOOPBACK(in6)) {
if (!(ifp->if_flags & IFF_LOOPBACK)) {
-   IF_AFDATA_UNLOCK(ifp);
+   IF_AFDATA_RUNLOCK(ifp);
return (EINVAL);
} else {
if (ret_id != NULL)
*ret_id = 0; /* there's no ambiguity */
-   IF_AFDATA_UNLOCK(ifp);
+   IF_AFDATA_RUNLOCK(ifp);
return (0);
}
}
@@ -457,7 +458,7 @@ in6_setscope(struct in6_addr *in6, struc
zoneid = 0; /* XXX: treat as global. */
break;
}
-   IF_AFDATA_UNLOCK(ifp);
+   IF_AFDATA_RUNLOCK(ifp);
 
if (ret_id != NULL)
*ret_id = zoneid;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243030 - in head/sys/mips: include mips

2012-11-14 Thread Alan Cox
Author: alc
Date: Wed Nov 14 17:33:00 2012
New Revision: 243030
URL: http://svnweb.freebsd.org/changeset/base/243030

Log:
  The function pmap_alloc_direct_page() unconditionally zeroes the returned
  page.  Therefore, it is really inappropriate for use by the function
  uma_small_alloc().  The effect of using it was that every page was zeroed
  at least once and possibly twice if M_ZERO was passed as a "wait" flag.

Modified:
  head/sys/mips/include/pmap.h
  head/sys/mips/mips/pmap.c
  head/sys/mips/mips/uma_machdep.c

Modified: head/sys/mips/include/pmap.h
==
--- head/sys/mips/include/pmap.hWed Nov 14 17:23:48 2012
(r243029)
+++ head/sys/mips/include/pmap.hWed Nov 14 17:33:00 2012
(r243030)
@@ -179,7 +179,6 @@ void pmap_kenter_temporary_free(vm_paddr
 void pmap_flush_pvcache(vm_page_t m);
 int pmap_emulate_modified(pmap_t pmap, vm_offset_t va);
 void pmap_grow_direct_page_cache(void);
-vm_page_t pmap_alloc_direct_page(unsigned int index, int req);
 
 #endif /* _KERNEL */
 

Modified: head/sys/mips/mips/pmap.c
==
--- head/sys/mips/mips/pmap.c   Wed Nov 14 17:23:48 2012(r243029)
+++ head/sys/mips/mips/pmap.c   Wed Nov 14 17:33:00 2012(r243030)
@@ -163,6 +163,7 @@ static vm_page_t pmap_pv_reclaim(pmap_t 
 static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va);
 static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap,
 vm_offset_t va);
+static vm_page_t pmap_alloc_direct_page(unsigned int index, int req);
 static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va,
 vm_page_t m, vm_prot_t prot, vm_page_t mpte);
 static int pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va,
@@ -1041,7 +1042,7 @@ pmap_grow_direct_page_cache()
 #endif
 }
 
-vm_page_t
+static vm_page_t
 pmap_alloc_direct_page(unsigned int index, int req)
 {
vm_page_t m;

Modified: head/sys/mips/mips/uma_machdep.c
==
--- head/sys/mips/mips/uma_machdep.cWed Nov 14 17:23:48 2012
(r243029)
+++ head/sys/mips/mips/uma_machdep.cWed Nov 14 17:33:00 2012
(r243030)
@@ -50,12 +50,14 @@ uma_small_alloc(uma_zone_t zone, int byt
*flags = UMA_SLAB_PRIV;
 
if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-   pflags = VM_ALLOC_INTERRUPT;
+   pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
else
-   pflags = VM_ALLOC_SYSTEM;
+   pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
+   if (wait & M_ZERO)
+   pflags |= VM_ALLOC_ZERO;
 
for (;;) {
-   m = pmap_alloc_direct_page(0, pflags);
+   m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, pflags);
if (m == NULL) {
if (wait & M_NOWAIT)
return (NULL);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r242102 - in head: contrib/bmake usr.bin/bmake

2012-11-14 Thread David O'Brien
On Thu, Oct 25, 2012 at 11:18:06PM +, Simon J. Gerraty wrote:
> Log:
>   Merge bmake-20121010

Hi Simon,
I was kicking the tires on this and noticed bmake is dynamically linked.

Can you change it to being statically linked?


This issue most recently came up in freebsd-current.  See thread pieces
http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033460.html
http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033472.html
http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033473.html

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


svn commit: r243029 - head/sys/netinet6

2012-11-14 Thread Andrey V. Elsukov
Author: ae
Date: Wed Nov 14 17:23:48 2012
New Revision: 243029
URL: http://svnweb.freebsd.org/changeset/base/243029

Log:
  SCOPE6_LOCK protects V_sid_default, no need to acquire it without
  any access to V_sid_default.
  
  Sponsored by: Yandex LLC
  MFC after:1 week

Modified:
  head/sys/netinet6/scope6.c

Modified: head/sys/netinet6/scope6.c
==
--- head/sys/netinet6/scope6.c  Wed Nov 14 17:14:03 2012(r243028)
+++ head/sys/netinet6/scope6.c  Wed Nov 14 17:23:48 2012(r243029)
@@ -139,7 +139,6 @@ scope6_set(struct ifnet *ifp, struct sco
 * interface addresses, routing table entries, PCB entries...
 */
 
-   SCOPE6_LOCK();
for (i = 0; i < 16; i++) {
if (idlist->s6id_list[i] &&
idlist->s6id_list[i] != sid->s6id_list[i]) {
@@ -150,7 +149,6 @@ scope6_set(struct ifnet *ifp, struct sco
if (i == IPV6_ADDR_SCOPE_INTFACELOCAL &&
idlist->s6id_list[i] != ifp->if_index) {
IF_AFDATA_UNLOCK(ifp);
-   SCOPE6_UNLOCK();
return (EINVAL);
}
 
@@ -163,7 +161,6 @@ scope6_set(struct ifnet *ifp, struct sco
 * safety in later use.
 */
IF_AFDATA_UNLOCK(ifp);
-   SCOPE6_UNLOCK();
return (EINVAL);
}
 
@@ -175,7 +172,6 @@ scope6_set(struct ifnet *ifp, struct sco
sid->s6id_list[i] = idlist->s6id_list[i];
}
}
-   SCOPE6_UNLOCK();
IF_AFDATA_UNLOCK(ifp);
 
return (error);
@@ -193,9 +189,7 @@ scope6_get(struct ifnet *ifp, struct sco
return (EINVAL);
}
 
-   SCOPE6_LOCK();
*idlist = *sid;
-   SCOPE6_UNLOCK();
 
IF_AFDATA_UNLOCK(ifp);
return (0);
@@ -442,8 +436,6 @@ in6_setscope(struct in6_addr *in6, struc
}
 
scope = in6_addrscope(in6);
-
-   SCOPE6_LOCK();
switch (scope) {
case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */
zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL];
@@ -465,7 +457,6 @@ in6_setscope(struct in6_addr *in6, struc
zoneid = 0; /* XXX: treat as global. */
break;
}
-   SCOPE6_UNLOCK();
IF_AFDATA_UNLOCK(ifp);
 
if (ret_id != NULL)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243028 - head/sys/netinet6

2012-11-14 Thread Andrey V. Elsukov
Author: ae
Date: Wed Nov 14 17:14:03 2012
New Revision: 243028
URL: http://svnweb.freebsd.org/changeset/base/243028

Log:
  zoneid has unsigned type.
  
  MFC after:1 week

Modified:
  head/sys/netinet6/scope6.c

Modified: head/sys/netinet6/scope6.c
==
--- head/sys/netinet6/scope6.c  Wed Nov 14 14:08:24 2012(r243027)
+++ head/sys/netinet6/scope6.c  Wed Nov 14 17:14:03 2012(r243028)
@@ -388,7 +388,7 @@ sa6_recoverscope(struct sockaddr_in6 *si
zoneid = ntohs(sin6->sin6_addr.s6_addr16[1]);
if (zoneid) {
/* sanity check */
-   if (zoneid < 0 || V_if_index < zoneid)
+   if (V_if_index < zoneid)
return (ENXIO);
if (!ifnet_byindex(zoneid))
return (ENXIO);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r243019 - head/sbin/route

2012-11-14 Thread Eitan Adler
On 14 November 2012 11:12, Ben Kaduk  wrote:
> On Wed, Nov 14, 2012 at 4:32 AM, Gleb Smirnoff  wrote:
>> A> Can the IN_CLASS[A-C]_NET... definitions go away as well?
>>
>> They are defines that don't generate any code.
>>
>> Also, on this mailing list I've promised once not to remove them :)
>
> I'm glad you remember :)

Perhaps a comment indicating they shouldn't be removed should be added?

> Andre, they are used (for better or for worse) in a multi-site
> database synchronization protocol that currently works portably across
> operating systems.  Removing them would change the semantics of that
> protocol in a subtle way that might introduce breakage.

Which one?


-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r243019 - head/sbin/route

2012-11-14 Thread Ben Kaduk
On Wed, Nov 14, 2012 at 4:32 AM, Gleb Smirnoff  wrote:
> A> Can the IN_CLASS[A-C]_NET... definitions go away as well?
>
> They are defines that don't generate any code.
>
> Also, on this mailing list I've promised once not to remove them :)

I'm glad you remember :)

Andre, they are used (for better or for worse) in a multi-site
database synchronization protocol that currently works portably across
operating systems.  Removing them would change the semantics of that
protocol in a subtle way that might introduce breakage.

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


Re: svn commit: r243023 - head/sys/sys

2012-11-14 Thread Ed Schouten
2012/11/14 Baptiste Daroussin :
> Allow usernames up to 32 chars

Thanks!

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


svn commit: r243027 - head/bin/sh

2012-11-14 Thread Jilles Tjoelker
Author: jilles
Date: Wed Nov 14 14:08:24 2012
New Revision: 243027
URL: http://svnweb.freebsd.org/changeset/base/243027

Log:
  sh: Remove an unused variable.

Modified:
  head/bin/sh/input.c
  head/bin/sh/input.h

Modified: head/bin/sh/input.c
==
--- head/bin/sh/input.c Wed Nov 14 12:11:23 2012(r243026)
+++ head/bin/sh/input.c Wed Nov 14 14:08:24 2012(r243027)
@@ -99,7 +99,6 @@ char *parsenextc; /* copy of parsefile-
 MKINIT struct parsefile basepf;/* top level input file */
 char basebuf[BUFSIZ + 1];  /* buffer for top level input file */
 static struct parsefile *parsefile = &basepf;  /* current input file */
-int init_editline = 0; /* editline library initialized? */
 int whichprompt;   /* 1 == PS1, 2 == PS2 */
 
 EditLine *el;  /* cookie for editline package */

Modified: head/bin/sh/input.h
==
--- head/bin/sh/input.h Wed Nov 14 12:11:23 2012(r243026)
+++ head/bin/sh/input.h Wed Nov 14 14:08:24 2012(r243027)
@@ -43,7 +43,6 @@
 extern int plinno;
 extern int parsenleft; /* number of characters left in input buffer */
 extern char *parsenextc;   /* next character in input buffer */
-extern int init_editline;  /* 0 == not setup, 1 == OK, -1 == failed */
 
 struct alias;
 struct parsefile;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243026 - head/sys/arm/arm

2012-11-14 Thread Olivier Houchard
Author: cognet
Date: Wed Nov 14 12:11:23 2012
New Revision: 243026
URL: http://svnweb.freebsd.org/changeset/base/243026

Log:
  Make it clear the L2 ops are filled for any cpu using a PL310 cache, not just
  the omap4.
  
  Spotted out by:   Giovanni Trematerra 

Modified:
  head/sys/arm/arm/cpufunc.c

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Wed Nov 14 11:05:16 2012(r243025)
+++ head/sys/arm/arm/cpufunc.c  Wed Nov 14 12:11:23 2012(r243026)
@@ -1067,7 +1067,8 @@ struct cpu_functions cortexa_cpufuncs = 
armv7_idcache_wbinv_all,/* idcache_wbinv_all*/
armv7_idcache_wbinv_range,  /* idcache_wbinv_range  */

-   /* Note: From OMAP4 the L2 ops are filled in when the
+   /* 
+* Note: For CPUs using the PL310 the L2 ops are filled in when the
 * L2 cache controller is actually enabled.
 */
cpufunc_nullop, /* l2cache_wbinv_all*/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243025 - head/sys/boot/i386/common

2012-11-14 Thread Andriy Gapon
Author: avg
Date: Wed Nov 14 11:05:16 2012
New Revision: 243025
URL: http://svnweb.freebsd.org/changeset/base/243025

Log:
  boot: use packed attribute for edd_params* structures and their substructures
  
  The sole purpose of this change is to make sure that sizeof produces
  "canonical" sizes for these structures.  This is to avoid triggering
  bugs in the BIOSes that properly handle only the canonical values of
  input length provided to INT 13h AH=48h.
  The canonical sizes are: 30 for v2, 66 for v3, etc.
  Buggy BIOS code probably looks like:
  if (input_length > 30) {   /* > v2 */
assume that input length is 66 /* assume v3 or later */
  }
  
  This should fix boot problems at least on Supermicro X8DT6 and possibly
  on P410i Smart Array Controller (as found in e.g. HP DL360 G7).
  
  Reported by:  gnn, np, rstone
  Debugged by:  rstone
  Discussed with:   ae, np, rstone
  MFC after:4 days

Modified:
  head/sys/boot/i386/common/edd.h

Modified: head/sys/boot/i386/common/edd.h
==
--- head/sys/boot/i386/common/edd.h Wed Nov 14 10:59:42 2012
(r243024)
+++ head/sys/boot/i386/common/edd.h Wed Nov 14 11:05:16 2012
(r243025)
@@ -62,7 +62,7 @@ struct edd_params {
uint16_tsector_size;
uint16_tedd_params_seg;
uint16_tedd_params_off;
-};
+} __packed;
 
 struct edd_device_path_v3 {
uint16_tkey;
@@ -74,12 +74,12 @@ struct edd_device_path_v3 {
uint64_tdevice_path;
uint8_t reserved2[1];
uint8_t checksum;
-};
+} __packed;
 
 struct edd_params_v3 {
struct edd_params params;
struct edd_device_path_v3 device_path;
-};
+} __packed;
 
 struct edd_device_path_v4 {
uint16_tkey;
@@ -91,12 +91,12 @@ struct edd_device_path_v4 {
uint64_tdevice_path[2];
uint8_t reserved2[1];
uint8_t checksum;
-};
+} __packed;
 
 struct edd_params_v4 {
struct edd_params params;
struct edd_device_path_v4 device_path;
-};
+} __packed;
 
 #defineEDD_FLAGS_DMA_BOUNDARY_HANDLING 0x0001
 #defineEDD_FLAGS_REMOVABLE_MEDIA   0x0002
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243024 - head/sys/arm/arm

2012-11-14 Thread Olivier Houchard
Author: cognet
Date: Wed Nov 14 10:59:42 2012
New Revision: 243024
URL: http://svnweb.freebsd.org/changeset/base/243024

Log:
  Use the arrmv7 version for flushID too, as it does something different for 
SMP.
  
  Submitted by: Giovanni Trematerra 

Modified:
  head/sys/arm/arm/cpufunc.c

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Wed Nov 14 10:58:12 2012(r243023)
+++ head/sys/arm/arm/cpufunc.c  Wed Nov 14 10:59:42 2012(r243024)
@@ -1047,7 +1047,7 @@ struct cpu_functions cortexa_cpufuncs = 

/* TLB functions */

-   arm11_tlb_flushID,  /* tlb_flushID  */
+   armv7_tlb_flushID,  /* tlb_flushID  */
armv7_tlb_flushID_SE,   /* tlb_flushID_SE   */
arm11_tlb_flushI,   /* tlb_flushI   */
arm11_tlb_flushI_SE,/* tlb_flushI_SE*/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243023 - head/sys/sys

2012-11-14 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 14 10:58:12 2012
New Revision: 243023
URL: http://svnweb.freebsd.org/changeset/base/243023

Log:
  Allow usernames up to 32 chars
  
  PR:   kern/161091 [1],
misc/133926 [2]
  Submitted by: Stephane Lapie  [1],
Chris Dillon  [2]
  Reviewed by:  cognet, kib

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed Nov 14 10:33:12 2012(r243022)
+++ head/sys/sys/param.hWed Nov 14 10:58:12 2012(r243023)
@@ -96,7 +96,7 @@
 
 #defineMAXCOMLEN   19  /* max command name remembered 
*/
 #defineMAXINTERP   PATH_MAX/* max interpreter file name 
length */
-#defineMAXLOGNAME  17  /* max login name length (incl. 
NUL) */
+#defineMAXLOGNAME  33  /* max login name length (incl. 
NUL) */
 #defineMAXUPRC CHILD_MAX   /* max simultaneous processes */
 #defineNCARGS  ARG_MAX /* max bytes for an exec 
function */
 #defineNGROUPS (NGROUPS_MAX+1) /* max number groups */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243022 - head/sys/kern

2012-11-14 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 14 10:33:12 2012
New Revision: 243022
URL: http://svnweb.freebsd.org/changeset/base/243022

Log:
  Style fix
  
  MFC after:1 day

Modified:
  head/sys/kern/kern_prot.c

Modified: head/sys/kern/kern_prot.c
==
--- head/sys/kern/kern_prot.c   Wed Nov 14 10:32:12 2012(r243021)
+++ head/sys/kern/kern_prot.c   Wed Nov 14 10:33:12 2012(r243022)
@@ -2087,7 +2087,7 @@ sys_getlogin(struct thread *td, struct g
if (strlen(login) + 1 > uap->namelen)
return (ERANGE);
error = copyout(login, uap->namebuf, uap->namelen);
-   return(error);
+   return (error);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243021 - head/sys/kern

2012-11-14 Thread Baptiste Daroussin
Author: bapt
Date: Wed Nov 14 10:32:12 2012
New Revision: 243021
URL: http://svnweb.freebsd.org/changeset/base/243021

Log:
  return ERANGE if the buffer is too small to contain the login as documented in
  the manpage
  
  Reviewed by:  cognet, kib
  MFC after:1 month

Modified:
  head/sys/kern/kern_prot.c

Modified: head/sys/kern/kern_prot.c
==
--- head/sys/kern/kern_prot.c   Wed Nov 14 10:06:50 2012(r243020)
+++ head/sys/kern/kern_prot.c   Wed Nov 14 10:32:12 2012(r243021)
@@ -2084,6 +2084,8 @@ sys_getlogin(struct thread *td, struct g
bcopy(p->p_session->s_login, login, uap->namelen);
SESS_UNLOCK(p->p_session);
PROC_UNLOCK(p);
+   if (strlen(login) + 1 > uap->namelen)
+   return (ERANGE);
error = copyout(login, uap->namebuf, uap->namelen);
return(error);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r243020 - stable/9/contrib/tzdata

2012-11-14 Thread Edwin Groothuis
Author: edwin
Date: Wed Nov 14 10:06:50 2012
New Revision: 243020
URL: http://svnweb.freebsd.org/changeset/base/243020

Log:
  Merge of current of 243003, tzdata2012j
  
  - Libya went to Standard Time on 10 November 2012

Modified:
  stable/9/contrib/tzdata/africa
  stable/9/contrib/tzdata/asia
  stable/9/contrib/tzdata/australasia
  stable/9/contrib/tzdata/europe
  stable/9/contrib/tzdata/northamerica
  stable/9/contrib/tzdata/southamerica
Directory Properties:
  stable/9/contrib/tzdata/   (props changed)

Modified: stable/9/contrib/tzdata/africa
==
--- stable/9/contrib/tzdata/africa  Wed Nov 14 08:05:21 2012
(r243019)
+++ stable/9/contrib/tzdata/africa  Wed Nov 14 10:06:50 2012
(r243020)
@@ -4,7 +4,7 @@
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
-# t...@elsie.nci.nih.gov for general use in the future).
+# t...@iana.org for general use in the future).
 
 # From Paul Eggert (2006-03-22):
 #
@@ -424,6 +424,20 @@ Zone   Africa/Monrovia -0:43:08 -  LMT 1882
 
 # Libya
 
+# From Even Scharning (2012-11-10):
+# Libya set their time one hour back at 02:00 on Saturday November 10.
+# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
+# Here is an official source [in Arabic]: http://ls.ly/fb6Yc
+#
+# Steffen Thorsen forwarded a translation (2012-11-10) in
+# http://mm.icann.org/pipermail/tz/2012-November/018451.html
+#
+# From Tim Parenti (2012-11-11):
+# Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1.
+# The DST rules planned for 2013 and onward roughly mirror those of Europe
+# (either two days before them or five days after them, so as to fall on
+# lastFri instead of lastSun).
+
 # Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
 Rule   Libya   1951only-   Oct 14  2:001:00S
 Rule   Libya   1952only-   Jan  1  0:000   -
@@ -438,17 +452,21 @@ Rule  Libya   1986only-   Apr  4  
0:001:00
 Rule   Libya   1986only-   Oct  3  0:000   -
 Rule   Libya   19871989-   Apr  1  0:001:00S
 Rule   Libya   19871989-   Oct  1  0:000   -
+Rule   Libya   1997only-   Apr  4  0:001:00S
+Rule   Libya   1997only-   Oct  4  0:000   -
+Rule   Libya   2013max -   Mar lastFri 1:001:00S
+Rule   Libya   2013max -   Oct lastFri 2:000   -
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Africa/Tripoli  0:52:44 -   LMT 1920
1:00Libya   CE%sT   1959
2:00-   EET 1982
1:00Libya   CE%sT   1990 May  4
-# The following entries are from Shanks & Pottenger;
+# The 1996 and 1997 entries are from Shanks & Pottenger;
 # the IATA SSIM data contain some obvious errors.
2:00-   EET 1996 Sep 30
-   1:00-   CET 1997 Apr  4
-   1:001:00CEST1997 Oct  4
-   2:00-   EET
+   1:00Libya   CE%sT   1997 Oct  4
+   2:00-   EET 2012 Nov 10 2:00
+   1:00Libya   CE%sT
 
 # Madagascar
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]

Modified: stable/9/contrib/tzdata/asia
==
--- stable/9/contrib/tzdata/asiaWed Nov 14 08:05:21 2012
(r243019)
+++ stable/9/contrib/tzdata/asiaWed Nov 14 10:06:50 2012
(r243020)
@@ -4,7 +4,7 @@
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
-# t...@elsie.nci.nih.gov for general use in the future).
+# t...@iana.org for general use in the future).
 
 # From Paul Eggert (2006-03-22):
 #
@@ -1199,7 +1199,6 @@ Rule  Zion2012only-   Mar Fri>=26 
2:001
 Rule   Zion2012only-   Sep 23  2:000   S
 
 # From Ephraim Silverberg (2012-10-18):
-
 # Yesterday, the Interior Ministry Committee, after more than a year
 # past, approved sending the proposed June 2011 changes to the Time
 # Decree Law back to the Knesset for second and third (final) votes
@@ -1212,6 +1211,10 @@ Rule Zion2012only-   Sep 23  
2:000   S
 # later (i.e. at 02:00 the first Monday after October 2).
 # [Rosh Hashana holidays are factored in until 2100.]
 
+# From Ephraim Silverberg (2012-11-05):
+# The Knesset passed today (in second and final readings) the amendment to the
+# Time Decree Law making the changes ... law.
+
 # Rule 

Re: svn commit: r243019 - head/sbin/route

2012-11-14 Thread Gleb Smirnoff
On Wed, Nov 14, 2012 at 10:30:22AM +0100, Andre Oppermann wrote:
A> On 14.11.2012 09:05, Gleb Smirnoff wrote:
A> > Author: glebius
A> > Date: Wed Nov 14 08:05:21 2012
A> > New Revision: 243019
A> > URL: http://svnweb.freebsd.org/changeset/base/243019
A> >
A> > Log:
A> >Remove remnants of classful addressing. These magic transformations
A> >of supplied arguments is not what a modern sysadmin expect.
A> 
A> Can the IN_CLASS[A-C]_NET... definitions go away as well?

They are defines that don't generate any code.

Also, on this mailing list I've promised once not to remove them :)

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


Re: svn commit: r243019 - head/sbin/route

2012-11-14 Thread Andre Oppermann

On 14.11.2012 09:05, Gleb Smirnoff wrote:

Author: glebius
Date: Wed Nov 14 08:05:21 2012
New Revision: 243019
URL: http://svnweb.freebsd.org/changeset/base/243019

Log:
   Remove remnants of classful addressing. These magic transformations
   of supplied arguments is not what a modern sysadmin expect.


Can the IN_CLASS[A-C]_NET... definitions go away as well?

--
Andre

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


svn commit: r243019 - head/sbin/route

2012-11-14 Thread Gleb Smirnoff
Author: glebius
Date: Wed Nov 14 08:05:21 2012
New Revision: 243019
URL: http://svnweb.freebsd.org/changeset/base/243019

Log:
  Remove remnants of classful addressing. These magic transformations
  of supplied arguments is not what a modern sysadmin expect.

Modified:
  head/sbin/route/route.c

Modified: head/sbin/route/route.c
==
--- head/sbin/route/route.c Wed Nov 14 06:37:43 2012(r243018)
+++ head/sbin/route/route.c Wed Nov 14 08:05:21 2012(r243019)
@@ -422,7 +422,7 @@ routename(struct sockaddr *sa)
 
 /*
  * Return the name of the network whose address is given.
- * The address is assumed to be that of a net or subnet, not a host.
+ * The address is assumed to be that of a net, not a host.
  */
 const char *
 netname(struct sockaddr *sa)
@@ -430,9 +430,8 @@ netname(struct sockaddr *sa)
const char *cp = NULL;
static char line[MAXHOSTNAMELEN + 1];
struct netent *np = NULL;
-   u_long net, mask;
u_long i;
-   int n, subnetshift;
+   int n;
 
switch (sa->sa_family) {
 
@@ -444,28 +443,7 @@ netname(struct sockaddr *sa)
if (in.s_addr == 0)
cp = "default";
else if (!nflag) {
-   if (IN_CLASSA(i)) {
-   mask = IN_CLASSA_NET;
-   subnetshift = 8;
-   } else if (IN_CLASSB(i)) {
-   mask = IN_CLASSB_NET;
-   subnetshift = 8;
-   } else {
-   mask = IN_CLASSC_NET;
-   subnetshift = 4;
-   }
-   /*
-* If there are more bits than the standard mask
-* would suggest, subnets must be in use.
-* Guess at the subnet mask, assuming reasonable
-* width subnet fields.
-*/
-   while (in.s_addr & ~mask)
-   mask |= mask >> subnetshift;
-   net = in.s_addr & mask;
-   while ((mask & 1) == 0)
-   mask >>= 1, net >>= 1;
-   np = getnetbyaddr(net, AF_INET);
+   np = getnetbyaddr(i, AF_INET);
if (np != NULL)
cp = np->n_name;
}
@@ -810,30 +788,19 @@ newroute(int argc, char **argv)
 static void
 inet_makenetandmask(u_long net, struct sockaddr_in *sin, u_long bits)
 {
-   u_long addr, mask = 0;
+   u_long mask = 0;
char *cp;
 
rtm_addrs |= RTA_NETMASK;
-   /*
-* XXX: This approach unable to handle 0.0.0.1/32 correctly
-* as inet_network() converts 0.0.0.1 and 1 equally.
-*/
-   if (net <= 0xff)
-   addr = net << IN_CLASSA_NSHIFT;
-   else if (net <= 0x)
-   addr = net << IN_CLASSB_NSHIFT;
-   else if (net <= 0xff)
-   addr = net << IN_CLASSC_NSHIFT;
-   else
-   addr = net;
+
/*
 * If no /xx was specified we must calculate the
 * CIDR address.
 */
-   if ((bits == 0)  && (addr != 0)) {
+   if ((bits == 0) && (net != 0)) {
u_long i, j;
for(i=0,j=0xff; i<4; i++)  {
-   if (addr & j) {
+   if (net & j) {
break;
}
j <<= 8;
@@ -844,7 +811,7 @@ inet_makenetandmask(u_long net, struct s
if (bits != 0)
mask = 0x << (32 - bits);
 
-   sin->sin_addr.s_addr = htonl(addr);
+   sin->sin_addr.s_addr = htonl(net);
sin = &so_mask.sin;
sin->sin_addr.s_addr = htonl(mask);
sin->sin_len = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"