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

2012-11-15 Thread Matthew D. Fuller
On Thu, Nov 15, 2012 at 06:07:27PM +1100 I heard the voice of
Bruce Evans, and lo! it spake thus:
 
 Maybe malloc() would be faster with MALLOC_PRODUCTION.  I use
 /etc/malloc.conf - aj locally.  freefall doesn't have
 /etc/malloc.conf.  MALLOC_OPTIONS no longer works, and MALLOC_CONF
 is too large for me to understand, so I don't know how to turn off
 non-production features dynamically.

FWIW, I suspected MALLOC_PRODUCTION in some massive slowdowns I see
from time to time on my -CURRENT box.  Most vividly around running
portupgrade-related bits (portupgrade, pkgdb, etc).  I got annoyed by
it enough a few weeks ago to write up a quickie to bang malloc()
around and see what happened.  Attached, just for grins.

It allocates a big array, frees every other element, allocates
another, frees every other, hops back and forth filling in the holes,
then hopes around free'ing everything.  Doesn't put anything in the
pages, just allocates, so it doesn't call on the VM subsystem for
much.  i.e., just beat the snot out of malloc  ;)  Here are some
quick comparative runs on two systems I have here locally, one running
stable/9 (late Jun), the other head (mid Oct).  Same binary on both,
so it's not a compiler difference either.

stable/9:
1.594u 0.142s 0:01.73 100.0%5+2767k 0+0io 0pf+0w
1.586u 0.157s 0:01.74 99.4% 5+2792k 0+0io 0pf+0w
1.567u 0.156s 0:01.72 99.4% 5+2786k 0+0io 0pf+0w
1.583u 0.211s 0:01.79 100.0%5+2783k 0+0io 0pf+0w
1.599u 0.126s 0:01.72 99.4% 5+2786k 0+0io 0pf+0w

head:
12.748u 0.165s 0:12.91 99.9%5+167k 0+0io 0pf+0w
12.755u 0.157s 0:12.91 99.9%5+167k 0+0io 0pf+0w
12.778u 0.157s 0:12.94 99.8%5+167k 0+0io 0pf+0w
12.657u 0.204s 0:12.86 99.9%5+167k 0+0io 0pf+0w
12.733u 0.173s 0:12.98 99.3%5+167k 0+0io 0pf+0w


Neither system is entirely quiescent, but they're both largely idle.
The CPU's are from the same model series, though the -CURRENT box is
500MHz faster, and has faster memory.  So, yeah, it's a safe bet that
non-_PRODUCTION malloc() can hurt you quite a lot when you're
malloc()-heavy.


-- 
Matthew Fuller (MF4839)   |  fulle...@over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
   On the Internet, nobody can hear you scream.
___
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-15 Thread Simon J. Gerraty
I aim to import bmake-20121109 soon (once I sort out svn 1.7.7 bug), 
will loook at this as well.

On Wed, 14 Nov 2012 19:27:49 +, Chris Rees writes:
  I was kicking the tires on this and noticed bmake is dynamically linked.
 
  Can you change it to being statically linked?
___
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: r243030 - in head/sys/mips: include mips

2012-11-15 Thread Aleksandr Rybalko
On Wed, 14 Nov 2012 17:33:01 + (UTC)
Alan Cox a...@freebsd.org wrote:

 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.

Many thanks Alan!

No I able to store 8MB fw image on tmpfs. Bot only once :)

 
 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.h  Wed Nov 14 17:23:48 2012
 (r243029)
 +++ head/sys/mips/include/pmap.h  Wed 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.c  Wed Nov 14 17:23:48 2012
 (r243029)
 +++ head/sys/mips/mips/uma_machdep.c  Wed 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);


-- 
Aleksandr Rybalko r...@ddteam.net
___
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: r243069 - head/sys/kern

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

Log:
  Fix bug in r242852 that prevented CPU from becoming idle if kernel built
  without SMP support.

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==
--- head/sys/kern/sched_ule.c   Thu Nov 15 07:48:44 2012(r243068)
+++ head/sys/kern/sched_ule.c   Thu Nov 15 14:10:51 2012(r243069)
@@ -2636,8 +2636,10 @@ sched_idletd(void *dummy)
if (tdq_idled(tdq) == 0)
continue;
}
-#endif
switchcnt = tdq-tdq_switchcnt + tdq-tdq_oldswitchcnt;
+#else
+   oldswitchcnt = switchcnt;
+#endif
/*
 * If we're switching very frequently, spin while checking
 * for load rather than entering a low power state that 
___
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: r243070 - head/sys/kern

2012-11-15 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Nov 15 14:11:34 2012
New Revision: 243070
URL: http://svnweb.freebsd.org/changeset/base/243070

Log:
  Fix kassert that's not really valid for %CPU accounting.  The problem
  here is race between decaying the resource usage in containers, and updating
  per-process usage; basically, the former may cause per-container usage
  to get smaller than per-process usage.
  
  Submitted by: Rudo Tomori

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Thu Nov 15 14:10:51 2012(r243069)
+++ head/sys/kern/kern_racct.c  Thu Nov 15 14:11:34 2012(r243070)
@@ -403,7 +403,7 @@ racct_sub_racct(struct racct *dest, cons
 * Update resource usage in dest.
 */
for (i = 0; i = RACCT_MAX; i++) {
-   if (!RACCT_IS_SLOPPY(i)) {
+   if (!RACCT_IS_SLOPPY(i)  !RACCT_IS_DECAYING(i)) {
KASSERT(dest-r_resources[i] = 0,
(racct propagation meltdown: dest  0));
KASSERT(src-r_resources[i] = 0,
@@ -414,7 +414,8 @@ racct_sub_racct(struct racct *dest, cons
if (RACCT_CAN_DROP(i)) {
dest-r_resources[i] -= src-r_resources[i];
if (dest-r_resources[i]  0) {
-   KASSERT(RACCT_IS_SLOPPY(i),
+   KASSERT(RACCT_IS_SLOPPY(i) ||
+   RACCT_IS_DECAYING(i),
(racct_sub_racct: usage  0));
dest-r_resources[i] = 0;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243071 - head

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:05:47 2012
New Revision: 243071
URL: http://svnweb.freebsd.org/changeset/base/243071

Log:
  Finish removing obsolete man pages (add them to ObsoleteFiles.inc)
  
  Submitted by: many
  Approved by:  cperciva
  MFC after:3 days

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Nov 15 14:11:34 2012(r243070)
+++ head/ObsoleteFiles.inc  Thu Nov 15 15:05:47 2012(r243071)
@@ -40,6 +40,10 @@
 
 # 20121114: zpool-features manual page moved from section 5 to 7
 OLD_FILES+=usr/share/man/man5/zpool-features.5.gz
+# 20121022: remove harp, hfa and idt man page
+OLD_FILES+=share/man/man4/harp.4
+OLD_FILES+=share/man/man4/hfa.4
+OLD_FILES+=share/man/man4/idt.4
 # 20121022: VFS_LOCK_GIANT elimination
 OLD_FILES+=usr/share/man/man9/VFS_LOCK_GIANT.9.gz
 OLD_FILES+=usr/share/man/man9/VFS_UNLOCK_GIANT.9.gz
___
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: r243073 - head/share/termcap

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:05:54 2012
New Revision: 243073
URL: http://svnweb.freebsd.org/changeset/base/243073

Log:
  Some software, notably dialog(1), can understand back-tab, which is
  typically bound to Shift-Tab. syscons produces ^]]Z for Shift-Tab, like
  many VT100-like terminal (emulators). The plain xterm does not produce
  this sequence, but ^I for both Tab and Shift-Tab.
  
  PR:   conf/162787
  PR:   bin/151229
  Submitted by: Stefan Bethke s...@lassitu.de
  Submitted by: Bruce Cran br...@cran.org.uk
  Approved by:  cperciva
  MFC after:3 days

Modified:
  head/share/termcap/termcap.src

Modified: head/share/termcap/termcap.src
==
--- head/share/termcap/termcap.src  Thu Nov 15 15:05:51 2012
(r243072)
+++ head/share/termcap/termcap.src  Thu Nov 15 15:05:54 2012
(r243073)
@@ -2825,7 +2825,7 @@ xterm-basic|modern xterm common:\
:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\
:cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\
:ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E:\
-   :kD=\E[3~:kb=^H:ke=\E[?1l\E:ks=\E[?1h\E=:le=^H:md=\E[1m:\
+   :kD=\E[3~:kb=^H:ke=\E[?1l\E:ks=\E[?1h\E=:kB=\E[Z:le=^H:md=\E[1m:\
:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\
:rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E:sc=\E7:se=\E[27m:sf=^J:\
:so=\E[7m:sr=\EM:st=\EH:\
___
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: r243072 - head/bin/mv

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:05:51 2012
New Revision: 243072
URL: http://svnweb.freebsd.org/changeset/base/243072

Log:
  Follow the behavior as specified in POSIX:
  
  if (exists AND (NOT f_option) AND
((not_writable AND input_is_terminal) OR i_option))
prompt
  
  in particular, add the test for input_is_terminal
  
  PR:   bin/173039
  Submitted by: Mark Johnston mark...@gmail.com
  Approved by:  cperciva
  MFC after:3 days

Modified:
  head/bin/mv/mv.c

Modified: head/bin/mv/mv.c
==
--- head/bin/mv/mv.cThu Nov 15 15:05:47 2012(r243071)
+++ head/bin/mv/mv.cThu Nov 15 15:05:51 2012(r243072)
@@ -199,7 +199,7 @@ do_move(const char *from, const char *to
} else if (iflg) {
(void)fprintf(stderr, overwrite %s? %s, to, YESNO);
ask = 1;
-   } else if (access(to, W_OK)  !stat(to, sb)) {
+   } else if (access(to, W_OK)  !stat(to, sb)  
isatty(STDIN_FILENO)) {
strmode(sb.st_mode, modep);
(void)fprintf(stderr, override %s%s%s/%s for %s? %s,
modep + 1, modep[9] == ' ' ?  :  ,
___
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: r243074 - head/usr.sbin/ndiscvt

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:05:57 2012
New Revision: 243074
URL: http://svnweb.freebsd.org/changeset/base/243074

Log:
  Add a missing check for fread
  
  Approved by:  cperciva
  MFC after:3 days

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

Modified: head/usr.sbin/ndiscvt/ndiscvt.c
==
--- head/usr.sbin/ndiscvt/ndiscvt.c Thu Nov 15 15:05:54 2012
(r243073)
+++ head/usr.sbin/ndiscvt/ndiscvt.c Thu Nov 15 15:05:57 2012
(r243074)
@@ -325,6 +325,8 @@ main(int argc, char *argv[])
rewind (fp);
img = calloc(fsize, 1);
n = fread (img, fsize, 1, fp);
+   if (n == 0)
+   err(1, reading .SYS file '%s' failed, sysfile);
 
fclose(fp);
 
___
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: r243075 - head/usr.bin/bc

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:06:00 2012
New Revision: 243075
URL: http://svnweb.freebsd.org/changeset/base/243075

Log:
  Make definition match declaration
  
  Approved by:  cperciva
  MFC after:3 days

Modified:
  head/usr.bin/bc/bc.y

Modified: head/usr.bin/bc/bc.y
==
--- head/usr.bin/bc/bc.yThu Nov 15 15:05:57 2012(r243074)
+++ head/usr.bin/bc/bc.yThu Nov 15 15:06:00 2012(r243075)
@@ -1084,7 +1084,7 @@ escape(const char *str)
 }
 
 /* ARGSUSED */
-void
+static void
 sigchld(int signo)
 {
pid_t pid;
___
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: r243076 - head/usr.sbin/chkgrp

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:06:03 2012
New Revision: 243076
URL: http://svnweb.freebsd.org/changeset/base/243076

Log:
  Check the range of the gid
  
  Approved by:  cperciva
  MFC after:1 week

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

Modified: head/usr.sbin/chkgrp/chkgrp.c
==
--- head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:06:00 2012
(r243075)
+++ head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:06:03 2012
(r243076)
@@ -30,7 +30,10 @@
 __FBSDID($FreeBSD$);
 
 #include err.h
+#include errno.h
 #include ctype.h
+#include limits.h
+#include stdint.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -150,6 +153,18 @@ main(int argc, char *argv[])
warnx(%s: line %d: GID is not numeric, gfn, n);
e++;
}
+
+   /* check the range of the group id */
+   errno = 0;
+   unsigned long groupid = strtoul(f[2], NULL, 10);
+   if (errno != 0) {
+   warnx(%s: line %d: strtoul failed, gfn, n);
+   }
+   else if (groupid  GID_MAX) {
+   warnx(%s: line %d: group id is too large ( %ju),
+ gfn, n, (uintmax_t)GID_MAX);
+   e++;
+   }

 #if 0
/* entry is correct, so print it */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243077 - head/usr.sbin/chkgrp

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:06:06 2012
New Revision: 243077
URL: http://svnweb.freebsd.org/changeset/base/243077

Log:
  Fix error code if file isn't readable.
  
  Approved by:  cperciva
  MFC after:1 week

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

Modified: head/usr.sbin/chkgrp/chkgrp.c
==
--- head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:06:03 2012
(r243076)
+++ head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:06:06 2012
(r243077)
@@ -73,7 +73,7 @@ main(int argc, char *argv[])
 
 /* open group file */
 if ((gf = fopen(gfn, r)) == NULL)
-   err(EX_IOERR, %s, gfn); /* XXX - is IO_ERR the correct exit code? */
+   err(EX_NOINPUT, %s, gfn);
 
 /* check line by line */
 while (++n) {
___
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: r243078 - head/sys/dev/mfi

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:06:09 2012
New Revision: 243078
URL: http://svnweb.freebsd.org/changeset/base/243078

Log:
  Add deviceid to the disk output on boot to help debugging.
  
  PR:   kern/173290
  Submitted by: Steven Hartland steven.hartl...@multiplay.co.uk
  Approved by:  cperciva
  MFC after:1 week

Modified:
  head/sys/dev/mfi/mfi_syspd.c

Modified: head/sys/dev/mfi/mfi_syspd.c
==
--- head/sys/dev/mfi/mfi_syspd.cThu Nov 15 15:06:06 2012
(r243077)
+++ head/sys/dev/mfi/mfi_syspd.cThu Nov 15 15:06:09 2012
(r243078)
@@ -122,8 +122,8 @@ mfi_syspd_attach(device_t dev)
break;
}
mtx_unlock(sc-pd_controller-mfi_io_lock);
-   device_printf(dev, %juMB (%ju sectors) SYSPD volume\n,
- sectors / (1024 * 1024 / secsize), sectors);
+   device_printf(dev, %juMB (%ju sectors) SYSPD volume (deviceid: %d)\n,
+ sectors / (1024 * 1024 / secsize), sectors, sc-pd_id);
sc-pd_disk = disk_alloc();
sc-pd_disk-d_drv1 = sc;
sc-pd_disk-d_maxsize = sc-pd_controller-mfi_max_io * secsize;
___
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: r243079 - head/usr.bin/ministat

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:06:12 2012
New Revision: 243079
URL: http://svnweb.freebsd.org/changeset/base/243079

Log:
  Add option to suppress just the plot in ministat while still retaining
  the relative comparison (i.e., useful part).
  
  Approved by:  cperciva
  MFC after:3 days

Modified:
  head/usr.bin/ministat/ministat.1
  head/usr.bin/ministat/ministat.c

Modified: head/usr.bin/ministat/ministat.1
==
--- head/usr.bin/ministat/ministat.1Thu Nov 15 15:06:09 2012
(r243078)
+++ head/usr.bin/ministat/ministat.1Thu Nov 15 15:06:12 2012
(r243079)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 28, 2010
+.Dd November 10, 2012
 .Dt MINISTAT 1
 .Os
 .Sh NAME
@@ -33,7 +33,7 @@
 .Nd statistics utility
 .Sh SYNOPSIS
 .Nm
-.Op Fl ns
+.Op Fl Ans
 .Op Fl C Ar column
 .Op Fl c Ar confidence_level
 .Op Fl d Ar delimiter
@@ -47,6 +47,9 @@ in the specified files or, if no file is
 .Pp
 The options are as follows:
 .Bl -tag -width Fl
+.It Fl A
+Just report the statistics of the input and relative comparisons,
+suppress the ASCII-art plot.
 .It Fl n
 Just report the raw statistics of the input, suppress the ASCII-art plot
 and the relative comparisons.

Modified: head/usr.bin/ministat/ministat.c
==
--- head/usr.bin/ministat/ministat.cThu Nov 15 15:06:09 2012
(r243078)
+++ head/usr.bin/ministat/ministat.cThu Nov 15 15:06:12 2012
(r243079)
@@ -509,7 +509,7 @@ usage(char const *whine)
 
fprintf(stderr, %s\n, whine);
fprintf(stderr,
-   Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] 
[-ns] [-w width] [file [file ...]]\n);
+   Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] 
[-Ans] [-w width] [file [file ...]]\n);
fprintf(stderr, \tconfidence = {);
for (i = 0; i  NCONF; i++) {
fprintf(stderr, %s%g%%,
@@ -517,6 +517,7 @@ usage(char const *whine)
studentpct[i]);
}
fprintf(stderr, }\n);
+   fprintf(stderr, \t-A : print statistics only. suppress the graph.\n);
fprintf(stderr, \t-C : column number to extract (starts and defaults 
to 1)\n);
fprintf(stderr, \t-d : delimiter(s) string, default to \ \\t\\n);
fprintf(stderr, \t-n : print summary statistics only, no 
graph/test\n);
@@ -538,6 +539,7 @@ main(int argc, char **argv)
int flag_s = 0;
int flag_n = 0;
int termwidth = 74;
+   int suppress_plot = 0;
 
if (isatty(STDOUT_FILENO)) {
struct winsize wsz;
@@ -550,8 +552,11 @@ main(int argc, char **argv)
}
 
ci = -1;
-   while ((c = getopt(argc, argv, C:c:d:snw:)) != -1)
+   while ((c = getopt(argc, argv, AC:c:d:snw:)) != -1)
switch (c) {
+   case 'A':
+   suppress_plot = 1;
+   break;
case 'C':
column = strtol(optarg, p, 10);
if (p != NULL  *p != '\0')
@@ -610,7 +615,7 @@ main(int argc, char **argv)
for (i = 0; i  nds; i++) 
printf(%c %s\n, symbol[i+1], ds[i]-name);
 
-   if (!flag_n) {
+   if (!flag_n  !suppress_plot) {
SetupPlot(termwidth, flag_s, nds);
for (i = 0; i  nds; i++)
DimPlot(ds[i]);
___
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: r243080 - head/etc/rc.d

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:06:15 2012
New Revision: 243080
URL: http://svnweb.freebsd.org/changeset/base/243080

Log:
  Only pass ip[46].addr when _addrl contains a value
  
  Submitted by: crees
  Reviewed by:  Mike Jakubik mike.jaku...@intertainservices.com
  Approved by:  cperciva
  MFC after:2 weeks

Modified:
  head/etc/rc.d/jail

Modified: head/etc/rc.d/jail
==
--- head/etc/rc.d/jail  Thu Nov 15 15:06:12 2012(r243079)
+++ head/etc/rc.d/jail  Thu Nov 15 15:06:15 2012(r243080)
@@ -656,7 +656,8 @@ jail_start()
done
 
eval ${_setfib} jail -n ${_jail} ${_flags} -i -c 
path=${_rootdir} host.hostname=${_hostname} \
-   ip4.addr=\${_addrl}\ ip6.addr=\${_addr6l}\ 
${_parameters} command=${_exec_start}  ${_tmp_jail} 21 \
+   ${_addrl:+ip4.addr=\${_addrl}\} 
${_addr6l:+ip6.addr=\${_addr6l}\} \
+   ${_parameters} command=${_exec_start}  ${_tmp_jail} 
21 \
/dev/null
 
if [ $? -eq 0 ] ; then
___
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: r243081 - head/usr.bin/chpass

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:06:18 2012
New Revision: 243081
URL: http://svnweb.freebsd.org/changeset/base/243081

Log:
  Avoid possible null deref if ypclnt_new returns null
  
  PR:   bin/172979
  Submitted by: Erik Cederstrand e...@cederstrand.dk
  Approved by:  cperciva
  MFC after:3 days

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

Modified: head/usr.bin/chpass/chpass.c
==
--- head/usr.bin/chpass/chpass.cThu Nov 15 15:06:15 2012
(r243080)
+++ head/usr.bin/chpass/chpass.cThu Nov 15 15:06:18 2012
(r243081)
@@ -241,8 +241,11 @@ main(int argc, char *argv[])
 #ifdef YP
case _PWF_NIS:
ypclnt = ypclnt_new(yp_domain, passwd.byname, yp_host);
-   if (ypclnt == NULL ||
-   ypclnt_connect(ypclnt) == -1 ||
+   if (ypclnt == NULL) {
+   warnx(ypclnt_new failed);
+   exit(1);
+   }
+   if (ypclnt_connect(ypclnt) == -1 ||
ypclnt_passwd(ypclnt, pw, password) == -1) {
warnx(%s, ypclnt-error);
ypclnt_free(ypclnt);
___
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: r243082 - head/sbin/umount

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:06:21 2012
New Revision: 243082
URL: http://svnweb.freebsd.org/changeset/base/243082

Log:
  Fix memory leak in umount.c
  
  PR:   bin/172553
  Submitted by: Erik Cederstrand e...@cederstrand.dk
  Approved by:  cperciva
  MFC after:3 days

Modified:
  head/sbin/umount/umount.c

Modified: head/sbin/umount/umount.c
==
--- head/sbin/umount/umount.c   Thu Nov 15 15:06:18 2012(r243081)
+++ head/sbin/umount/umount.c   Thu Nov 15 15:06:21 2012(r243082)
@@ -359,8 +359,10 @@ umountfs(struct statfs *sfs)
do_rpc = 1;
}
 
-   if (!namematch(ai))
+   if (!namematch(ai)) {
+   free(orignfsdirname);
return (1);
+   }
/* First try to unmount using the file system ID. */
snprintf(fsidbuf, sizeof(fsidbuf), FSID:%d:%d, sfs-f_fsid.val[0],
sfs-f_fsid.val[1]);
@@ -369,13 +371,16 @@ umountfs(struct statfs *sfs)
if (errno != ENOENT || sfs-f_fsid.val[0] != 0 ||
sfs-f_fsid.val[1] != 0)
warn(unmount of %s failed, sfs-f_mntonname);
-   if (errno != ENOENT)
+   if (errno != ENOENT) {
+   free(orignfsdirname);
return (1);
+   }
/* Compatibility for old kernels. */
if (sfs-f_fsid.val[0] != 0 || sfs-f_fsid.val[1] != 0)
warnx(retrying using path instead of file system ID);
if (unmount(sfs-f_mntonname, fflag) != 0) {
warn(unmount of %s failed, sfs-f_mntonname);
+   free(orignfsdirname);
return (1);
}
}
@@ -393,6 +398,7 @@ umountfs(struct statfs *sfs)
if (clp  == NULL) {
warnx(%s: %s, hostp,
clnt_spcreateerror(MOUNTPROG));
+   free(orignfsdirname);
return (1);
}
clp-cl_auth = authsys_create_default();
@@ -403,6 +409,7 @@ umountfs(struct statfs *sfs)
if (clnt_stat != RPC_SUCCESS) {
warnx(%s: %s, hostp,
clnt_sperror(clp, RPCMNT_UMOUNT));
+   free(orignfsdirname);
return (1);
}
/*
@@ -415,10 +422,10 @@ umountfs(struct statfs *sfs)
hostp, nfsdirname);
free_mtab();
}
-   free(orignfsdirname);
auth_destroy(clp-cl_auth);
clnt_destroy(clp);
}
+   free(orignfsdirname);
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243083 - head/usr.sbin/chkgrp

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:06:24 2012
New Revision: 243083
URL: http://svnweb.freebsd.org/changeset/base/243083

Log:
  Be declarative about if an error has occured.
  
  Fixes overflow on very large group files with lots of errors. This is
  unlikely to occur in practice.
  
  Approved by:  cperciva
  MFC after:1 week

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

Modified: head/usr.sbin/chkgrp/chkgrp.c
==
--- head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:06:21 2012
(r243082)
+++ head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:06:24 2012
(r243083)
@@ -81,7 +81,7 @@ main(int argc, char *argv[])
break;
if (len  0  line[len - 1] != '\n') {
warnx(%s: line %d: no newline character, gfn, n);
-   e++;
+   e = 1;
}
while (len  isspace(line[len-1]))
len--;
@@ -114,14 +114,14 @@ main(int argc, char *argv[])
 warnx(%s: line %d: missing field(s), gfn, n);
for ( ; k  4; k++)
f[k] = empty;
-e++;
+e = 1;
 }
 
for (cp = f[0] ; *cp ; cp++) {
if (!isalnum(*cp)  *cp != '.'  *cp != '_'  *cp != '-' 
(cp  f[0] || *cp != '+')) {
warnx(%s: line %d: '%c' invalid character, gfn, n, *cp);
-   e++;
+   e = 1;
}
}
 
@@ -129,14 +129,14 @@ main(int argc, char *argv[])
if (!isalnum(*cp)  *cp != '.'  *cp != '_'  *cp != '-' 
*cp != ',') {
warnx(%s: line %d: '%c' invalid character, gfn, n, *cp);
-   e++;
+   e = 1;
}
}
 
/* check if fourth field ended with a colon */
if (i  len) {
warnx(%s: line %d: too many fields, gfn, n);
-   e++;
+   e = 1;
}

/* check that none of the fields contain whitespace */
@@ -144,14 +144,14 @@ main(int argc, char *argv[])
if (strcspn(f[k],  \t) != strlen(f[k])) {
warnx(%s: line %d: field %d contains whitespace,
  gfn, n, k+1);
-   e++;
+   e = 1;
}
}
 
/* check that the GID is numeric */
if (strspn(f[2], 0123456789) != strlen(f[2])) {
warnx(%s: line %d: GID is not numeric, gfn, n);
-   e++;
+   e = 1;
}
 
/* check the range of the group id */
@@ -163,7 +163,7 @@ main(int argc, char *argv[])
else if (groupid  GID_MAX) {
warnx(%s: line %d: group id is too large ( %ju),
  gfn, n, (uintmax_t)GID_MAX);
-   e++;
+   e = 1;
}

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


svn commit: r243084 - head/usr.sbin/chkgrp

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:16:50 2012
New Revision: 243084
URL: http://svnweb.freebsd.org/changeset/base/243084

Log:
  Add support for a -q flag.  While here make the custom argument parsing
  use getopt instead of hacking on it more.  This change also fixes the
  method of silencing the compiler warning about gfn being used
  uninitialized.
  
  Approved by:  cperciva
  MFC after:1 week

Modified:
  head/usr.sbin/chkgrp/chkgrp.8
  head/usr.sbin/chkgrp/chkgrp.c

Modified: head/usr.sbin/chkgrp/chkgrp.8
==
--- head/usr.sbin/chkgrp/chkgrp.8   Thu Nov 15 15:06:24 2012
(r243083)
+++ head/usr.sbin/chkgrp/chkgrp.8   Thu Nov 15 15:16:50 2012
(r243084)
@@ -34,6 +34,7 @@
 .Nd check the syntax of the group file
 .Sh SYNOPSIS
 .Nm
+.Op Fl q
 .Op Ar groupfile
 .Sh DESCRIPTION
 The
@@ -47,6 +48,12 @@ contains whitespace, and that the third 
 numeric.
 It will also check for invalid characters in the group names
 and group members.
+The following options are available:
+.Bl -tag -width indent
+.It Fl q
+This option disables printing of text when the group format
+is correct.
+.El
 .Sh FILES
 .Bl -tag -width /etc/group -compact
 .It Pa /etc/group

Modified: head/usr.sbin/chkgrp/chkgrp.c
==
--- head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:06:24 2012
(r243083)
+++ head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:16:50 2012
(r243084)
@@ -37,11 +37,12 @@ __FBSDID($FreeBSD$);
 #include stdio.h
 #include stdlib.h
 #include string.h
+#include unistd.h
 #include sysexits.h
 
 static char empty[] = { 0 };
 
-static void
+static void __dead2
 usage(void)
 {
 fprintf(stderr, usage: chkgrp [groupfile]\n);
@@ -53,24 +54,33 @@ main(int argc, char *argv[])
 {
 unsigned int i;
 size_t len;
+int quiet;
+int ch;
 int n = 0, k, e = 0;
 char *line, *f[4], *p;
 const char *cp, *gfn;
 FILE *gf;
 
-/* check arguments */
-switch (argc) {
-case 1:
-   gfn = /etc/group;
-   break;
-case 2:
-   gfn = argv[1];
-   break;
-default:
-   gfn = NULL; /* silence compiler */
-   usage();
+quiet = 0;
+while ((ch = getopt(argc, argv, q)) != -1) {
+   switch (ch) {
+   case 'q':
+   quiet = 1;
+   break;
+   case '?':
+   default:
+   printf(hello\n);
+   usage();
+   }
 }
 
+if (optind == argc)
+   gfn = /etc/group;
+else if (optind == argc - 1)
+   gfn = argv[optind];
+else
+   usage();
+
 /* open group file */
 if ((gf = fopen(gfn, r)) == NULL)
err(EX_NOINPUT, %s, gfn);
@@ -178,7 +188,7 @@ main(int argc, char *argv[])
 
 /* done */
 fclose(gf);
-if (e == 0)
+if (e == 0  quiet == 0)
printf(%s is fine\n, gfn);
 exit(e ? EX_DATAERR : EX_OK);
 }
___
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: r243084 - head/usr.sbin/chkgrp

2012-11-15 Thread Eitan Adler
On 15 November 2012 10:16, Eitan Adler ead...@freebsd.org wrote:

 +   printf(hello\n);
oops - grabbed the wrong commit - fixing now



-- 
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


svn commit: r243085 - head/usr.sbin/chkgrp

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 15:21:58 2012
New Revision: 243085
URL: http://svnweb.freebsd.org/changeset/base/243085

Log:
  This wasn't supposed to be in there - I committed the wrong patch.
  
  Approved by: cperciva (implicit)

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

Modified: head/usr.sbin/chkgrp/chkgrp.c
==
--- head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:16:50 2012
(r243084)
+++ head/usr.sbin/chkgrp/chkgrp.c   Thu Nov 15 15:21:58 2012
(r243085)
@@ -69,7 +69,6 @@ main(int argc, char *argv[])
break;
case '?':
default:
-   printf(hello\n);
usage();
}
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r243076 - head/usr.sbin/chkgrp

2012-11-15 Thread Konstantin Belousov
On Thu, Nov 15, 2012 at 03:06:03PM +, Eitan Adler wrote:
 Author: eadler
 Date: Thu Nov 15 15:06:03 2012
 New Revision: 243076
 URL: http://svnweb.freebsd.org/changeset/base/243076
 
 Log:
   Check the range of the gid
   
   Approved by:cperciva
   MFC after:  1 week
 
 Modified:
   head/usr.sbin/chkgrp/chkgrp.c
 
 Modified: head/usr.sbin/chkgrp/chkgrp.c
 ==
 --- head/usr.sbin/chkgrp/chkgrp.c Thu Nov 15 15:06:00 2012
 (r243075)
 +++ head/usr.sbin/chkgrp/chkgrp.c Thu Nov 15 15:06:03 2012
 (r243076)
 @@ -30,7 +30,10 @@
  __FBSDID($FreeBSD$);
  
  #include err.h
 +#include errno.h
  #include ctype.h
 +#include limits.h
 +#include stdint.h
  #include stdio.h
  #include stdlib.h
  #include string.h
 @@ -150,6 +153,18 @@ main(int argc, char *argv[])
   warnx(%s: line %d: GID is not numeric, gfn, n);
   e++;
   }
 +
 + /* check the range of the group id */
 + errno = 0;
 + unsigned long groupid = strtoul(f[2], NULL, 10);
And this violates style.
The checks for strtoul failure are not exhaustive.

 + if (errno != 0) {
 + warnx(%s: line %d: strtoul failed, gfn, n);
 + }
 + else if (groupid  GID_MAX) {
 + warnx(%s: line %d: group id is too large ( %ju),
 +   gfn, n, (uintmax_t)GID_MAX);
 + e++;
 + }
   
  #if 0
   /* entry is correct, so print it */


pgpihrDFv7YB2.pgp
Description: PGP signature


svn commit: r243086 - stable/9/etc

2012-11-15 Thread Nick Hibma
Author: n_hibma
Date: Thu Nov 15 15:48:40 2012
New Revision: 243086
URL: http://svnweb.freebsd.org/changeset/base/243086

Log:
  MFC r242784:
Not only load pccard_ether settings, also load network settings. This
is only a problem when a /etc/rc.conf.d/network file is being used.
  
PR: conf/160373
Submitted by:   n_hibma

Modified:
  stable/9/etc/pccard_ether
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/pccard_ether
==
--- stable/9/etc/pccard_ether   Thu Nov 15 15:21:58 2012(r243085)
+++ stable/9/etc/pccard_ether   Thu Nov 15 15:48:40 2012(r243086)
@@ -123,4 +123,5 @@ else
 fi
 
 load_rc_config pccard_ether
+load_rc_config network
 run_rc_command $args
___
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: r243087 - stable/8/etc

2012-11-15 Thread Nick Hibma
Author: n_hibma
Date: Thu Nov 15 15:49:37 2012
New Revision: 243087
URL: http://svnweb.freebsd.org/changeset/base/243087

Log:
  MFC 242784:
Not only load pccard_ether settings, also load network settings. This
is only a problem when a /etc/rc.conf.d/network file is being used.
  
PR: conf/160373
Submitted by:   n_hibma

Modified:
  stable/8/etc/pccard_ether
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/pccard_ether
==
--- stable/8/etc/pccard_ether   Thu Nov 15 15:48:40 2012(r243086)
+++ stable/8/etc/pccard_ether   Thu Nov 15 15:49:37 2012(r243087)
@@ -123,4 +123,5 @@ else
 fi
 
 load_rc_config pccard_ether
+load_rc_config network
 run_rc_command $args
___
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: r243088 - head/sys/kern

2012-11-15 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Nov 15 15:55:49 2012
New Revision: 243088
URL: http://svnweb.freebsd.org/changeset/base/243088

Log:
  Improve KASSERT messages in racct, to make it clear which resource
  caused the problem.
  
  Submitted by: mjg

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Thu Nov 15 15:49:37 2012(r243087)
+++ head/sys/kern/kern_racct.c  Thu Nov 15 15:55:49 2012(r243088)
@@ -385,9 +385,11 @@ racct_add_racct(struct racct *dest, cons
 */
for (i = 0; i = RACCT_MAX; i++) {
KASSERT(dest-r_resources[i] = 0,
-   (racct propagation meltdown: dest  0));
+   (%s: resource %d propagation meltdown: dest  0,
+   __func__, i));
KASSERT(src-r_resources[i] = 0,
-   (racct propagation meltdown: src  0));
+   (%s: resource %d propagation meltdown: src  0,
+   __func__, i));
dest-r_resources[i] += src-r_resources[i];
}
 }
@@ -405,18 +407,21 @@ racct_sub_racct(struct racct *dest, cons
for (i = 0; i = RACCT_MAX; i++) {
if (!RACCT_IS_SLOPPY(i)  !RACCT_IS_DECAYING(i)) {
KASSERT(dest-r_resources[i] = 0,
-   (racct propagation meltdown: dest  0));
+   (%s: resource %d propagation meltdown: dest  0,
+   __func__, i));
KASSERT(src-r_resources[i] = 0,
-   (racct propagation meltdown: src  0));
+   (%s: resource %d propagation meltdown: src  0,
+   __func__, i));
KASSERT(src-r_resources[i] = dest-r_resources[i],
-   (racct propagation meltdown: src  dest));
+   (%s: resource %d propagation meltdown: src  dest,
+   __func__, i));
}
if (RACCT_CAN_DROP(i)) {
dest-r_resources[i] -= src-r_resources[i];
if (dest-r_resources[i]  0) {
KASSERT(RACCT_IS_SLOPPY(i) ||
RACCT_IS_DECAYING(i),
-   (racct_sub_racct: usage  0));
+   (%s: resource %d usage  0, __func__, i));
dest-r_resources[i] = 0;
}
}
@@ -487,7 +492,7 @@ racct_alloc_resource(struct racct *racct
racct-r_resources[resource] += amount;
if (racct-r_resources[resource]  0) {
KASSERT(RACCT_IS_SLOPPY(resource) || 
RACCT_IS_DECAYING(resource),
-   (racct_alloc_resource: usage  0));
+   (%s: resource %d usage  0, __func__, resource));
racct-r_resources[resource] = 0;
}

@@ -633,7 +638,7 @@ racct_set_locked(struct proc *p, int res
diff_cred = diff_proc;
 #ifdef notyet
KASSERT(diff_proc = 0 || RACCT_CAN_DROP(resource),
-   (racct_set: usage of non-droppable resource %d dropping,
+   (%s: usage of non-droppable resource %d dropping, __func__,
 resource));
 #endif
 #ifdef RCTL
@@ -782,12 +787,12 @@ racct_sub(struct proc *p, int resource, 
 */
PROC_LOCK_ASSERT(p, MA_OWNED);
KASSERT(RACCT_CAN_DROP(resource),
-   (racct_sub: called for non-droppable resource %d, resource));
+   (%s: called for non-droppable resource %d, __func__, resource));
 
mtx_lock(racct_lock);
KASSERT(amount = p-p_racct-r_resources[resource],
-   (racct_sub: freeing %ju of resource %d, which is more 
-than allocated %jd for %s (pid %d), amount, resource,
+   (%s: freeing %ju of resource %d, which is more 
+than allocated %jd for %s (pid %d), __func__, amount, resource,
(intmax_t)p-p_racct-r_resources[resource], p-p_comm, p-p_pid));
 
racct_alloc_resource(p-p_racct, resource, -amount);
@@ -805,7 +810,7 @@ racct_sub_cred_locked(struct ucred *cred
 
 #ifdef notyet
KASSERT(RACCT_CAN_DROP(resource),
-   (racct_sub_cred: called for resource %d which can not drop,
+   (%s: called for resource %d which can not drop, __func__,
 resource));
 #endif
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r243076 - head/usr.sbin/chkgrp

2012-11-15 Thread Eitan Adler
On 15 November 2012 10:30, Konstantin Belousov kostik...@gmail.com wrote:
 On Thu, Nov 15, 2012 at 03:06:03PM +, Eitan Adler wrote:
 Author: eadler
 Date: Thu Nov 15 15:06:03 2012
 New Revision: 243076
 URL: http://svnweb.freebsd.org/changeset/base/243076

 Log:
   Check the range of the gid

   Approved by:cperciva
   MFC after:  1 week

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

 Modified: head/usr.sbin/chkgrp/chkgrp.c
 ==
 --- head/usr.sbin/chkgrp/chkgrp.c Thu Nov 15 15:06:00 2012
 (r243075)
 +++ head/usr.sbin/chkgrp/chkgrp.c Thu Nov 15 15:06:03 2012
 (r243076)
 @@ -30,7 +30,10 @@
  __FBSDID($FreeBSD$);

  #include err.h
 +#include errno.h
  #include ctype.h
 +#include limits.h
 +#include stdint.h
  #include stdio.h
  #include stdlib.h
  #include string.h
 @@ -150,6 +153,18 @@ main(int argc, char *argv[])
   warnx(%s: line %d: GID is not numeric, gfn, n);
   e++;
   }
 +
 + /* check the range of the group id */
 + errno = 0;
 + unsigned long groupid = strtoul(f[2], NULL, 10);
 And this violates style.
 The checks for strtoul failure are not exhaustive.

from the strtoul man page:


...  In all cases, errno is set to ERANGE.
If no conversion could be performed, 0 is returned and
the global variable errno is set to EINVAL (the last feature is not por-
table across all platforms).
===

What is missing? Is there a case where strtoul fails but errno == 0 ?


-- 
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: r243076 - head/usr.sbin/chkgrp

2012-11-15 Thread Bruce Evans

On Thu, 15 Nov 2012, Eitan Adler wrote:


On 15 November 2012 10:30, Konstantin Belousov kostik...@gmail.com wrote:

On Thu, Nov 15, 2012 at 03:06:03PM +, Eitan Adler wrote:

Author: eadler
Date: Thu Nov 15 15:06:03 2012
New Revision: 243076
URL: http://svnweb.freebsd.org/changeset/base/243076

Log:
  Check the range of the gid

  Approved by:cperciva
  MFC after:  1 week

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

Modified: head/usr.sbin/chkgrp/chkgrp.c
==
--- head/usr.sbin/chkgrp/chkgrp.c Thu Nov 15 15:06:00 2012(r243075)
+++ head/usr.sbin/chkgrp/chkgrp.c Thu Nov 15 15:06:03 2012(r243076)
@@ -30,7 +30,10 @@
 __FBSDID($FreeBSD$);

 #include err.h
+#include errno.h
 #include ctype.h
+#include limits.h
+#include stdint.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -150,6 +153,18 @@ main(int argc, char *argv[])
  warnx(%s: line %d: GID is not numeric, gfn, n);
  e++;
  }
+
+ /* check the range of the group id */
+ errno = 0;
+ unsigned long groupid = strtoul(f[2], NULL, 10);

And this violates style.


I see about 5 style violations here and 5 in other lines.


The checks for strtoul failure are not exhaustive.


from the strtoul man page:


...  In all cases, errno is set to ERANGE.
If no conversion could be performed, 0 is returned and
the global variable errno is set to EINVAL (the last feature is not por-
table across all platforms).
===

What is missing? Is there a case where strtoul fails but errno == 0 ?


strtoul(1garbage, NULL, 10) succeeds and returns value 1, but the input
is garbage.

As the man page says, the EINVAL feature is unportable.  It is almost
useless, since to detect garbage after the number you have to pass an
endptr to strtoul(), and then the check for no conversion (that is,
for garbage at the beginning) is just as easy as the check for garbage
at the end.

The error handling is poor.  First, warnx() is used instead of warn() so
as to not tell the user about the errno that we are depending on.  Fully
correct and laborious strto*() error reporting has to use warnx() only
for the case(s) where the input is garbage but strtoul() doesn't set
errno.  High quality strto*() error reporting also avoids using
strerror(errno) in other cases to get a uniform style of error messages.
The only portable other case is ERANGE for a range error.  strerror(errno)
is quite good for that.  However, we do another range check later and
should use the same error message for both.  strerror(EINVAL) is cryptic
for garbage at the beginning of the input as well as unportable.  Second,
we continue using the garbage value after detecting that it is garbage.

strtonum() and expand_number() handle some of these problems internally
but create others.  For example, if you don't like the error string created
by strtonum(), then you have to parse it to see what it says in order to
write a better one.  This is much more work than doing your own range
checking.

Bruce
___
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: r243091 - head/share/man/man4

2012-11-15 Thread Joel Dahl
Author: joel (doc committer)
Date: Thu Nov 15 16:54:14 2012
New Revision: 243091
URL: http://svnweb.freebsd.org/changeset/base/243091

Log:
  Remove trailing whitespace.

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

Modified: head/share/man/man4/lagg.4
==
--- head/share/man/man4/lagg.4  Thu Nov 15 16:42:12 2012(r243090)
+++ head/share/man/man4/lagg.4  Thu Nov 15 16:54:14 2012(r243091)
@@ -92,7 +92,7 @@ This is an alias for
 .Ic loadbalance
 mode.
 .It Ic lacp
-Supports the IEEE 802.1AX (formerly 802.3ad) Link Aggregation Control Protocol 
+Supports the IEEE 802.1AX (formerly 802.3ad) Link Aggregation Control Protocol
 (LACP) and the Marker Protocol.
 LACP will negotiate a set of aggregable links with the peer in to one or more
 Link Aggregated 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: r243092 - stable/9/sys/kern

2012-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Thu Nov 15 18:05:30 2012
New Revision: 243092
URL: http://svnweb.freebsd.org/changeset/base/243092

Log:
  MFC r243022:
  small style fix

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

Modified: stable/9/sys/kern/kern_prot.c
==
--- stable/9/sys/kern/kern_prot.c   Thu Nov 15 16:54:14 2012
(r243091)
+++ stable/9/sys/kern/kern_prot.c   Thu Nov 15 18:05:30 2012
(r243092)
@@ -2085,7 +2085,7 @@ sys_getlogin(struct thread *td, struct g
SESS_UNLOCK(p-p_session);
PROC_UNLOCK(p);
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: r243093 - stable/8/sys/kern

2012-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Thu Nov 15 18:05:34 2012
New Revision: 243093
URL: http://svnweb.freebsd.org/changeset/base/243093

Log:
  MFC r243022:
  small style fix

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

Modified: stable/8/sys/kern/kern_prot.c
==
--- stable/8/sys/kern/kern_prot.c   Thu Nov 15 18:05:30 2012
(r243092)
+++ stable/8/sys/kern/kern_prot.c   Thu Nov 15 18:05:34 2012
(r243093)
@@ -2066,7 +2066,7 @@ getlogin(struct thread *td, struct getlo
SESS_UNLOCK(p-p_session);
PROC_UNLOCK(p);
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: r243094 - stable/7/sys/kern

2012-11-15 Thread Baptiste Daroussin
Author: bapt
Date: Thu Nov 15 18:05:38 2012
New Revision: 243094
URL: http://svnweb.freebsd.org/changeset/base/243094

Log:
  MFC r243022:
  small style fix

Modified:
  stable/7/sys/kern/kern_prot.c
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/kern/kern_prot.c
==
--- stable/7/sys/kern/kern_prot.c   Thu Nov 15 18:05:34 2012
(r243093)
+++ stable/7/sys/kern/kern_prot.c   Thu Nov 15 18:05:38 2012
(r243094)
@@ -1938,7 +1938,7 @@ getlogin(struct thread *td, struct getlo
SESS_UNLOCK(p-p_session);
PROC_UNLOCK(p);
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: r243095 - head/sys/dev/agp

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 18:49:17 2012
New Revision: 243095
URL: http://svnweb.freebsd.org/changeset/base/243095

Log:
  Remove unneeded header from agp: opt_bus.h
  
  Tested with make universe
  
  Approved by:  cperciva
  MFC after:1 week

Modified:
  head/sys/dev/agp/agp.c
  head/sys/dev/agp/agp_ali.c
  head/sys/dev/agp/agp_amd.c
  head/sys/dev/agp/agp_amd64.c
  head/sys/dev/agp/agp_apple.c
  head/sys/dev/agp/agp_ati.c
  head/sys/dev/agp/agp_i810.c
  head/sys/dev/agp/agp_intel.c
  head/sys/dev/agp/agp_nvidia.c
  head/sys/dev/agp/agp_sis.c
  head/sys/dev/agp/agp_via.c

Modified: head/sys/dev/agp/agp.c
==
--- head/sys/dev/agp/agp.c  Thu Nov 15 18:05:38 2012(r243094)
+++ head/sys/dev/agp/agp.c  Thu Nov 15 18:49:17 2012(r243095)
@@ -28,7 +28,6 @@
 __FBSDID($FreeBSD$);
 
 #include opt_agp.h
-#include opt_bus.h
 
 #include sys/param.h
 #include sys/systm.h

Modified: head/sys/dev/agp/agp_ali.c
==
--- head/sys/dev/agp/agp_ali.c  Thu Nov 15 18:05:38 2012(r243094)
+++ head/sys/dev/agp/agp_ali.c  Thu Nov 15 18:49:17 2012(r243095)
@@ -27,8 +27,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-#include opt_bus.h
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/malloc.h

Modified: head/sys/dev/agp/agp_amd.c
==
--- head/sys/dev/agp/agp_amd.c  Thu Nov 15 18:05:38 2012(r243094)
+++ head/sys/dev/agp/agp_amd.c  Thu Nov 15 18:49:17 2012(r243095)
@@ -27,8 +27,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-#include opt_bus.h
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/malloc.h

Modified: head/sys/dev/agp/agp_amd64.c
==
--- head/sys/dev/agp/agp_amd64.cThu Nov 15 18:05:38 2012
(r243094)
+++ head/sys/dev/agp/agp_amd64.cThu Nov 15 18:49:17 2012
(r243095)
@@ -27,8 +27,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-#include opt_bus.h
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/malloc.h

Modified: head/sys/dev/agp/agp_apple.c
==
--- head/sys/dev/agp/agp_apple.cThu Nov 15 18:05:38 2012
(r243094)
+++ head/sys/dev/agp/agp_apple.cThu Nov 15 18:49:17 2012
(r243095)
@@ -27,8 +27,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-#include opt_bus.h
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/malloc.h

Modified: head/sys/dev/agp/agp_ati.c
==
--- head/sys/dev/agp/agp_ati.c  Thu Nov 15 18:05:38 2012(r243094)
+++ head/sys/dev/agp/agp_ati.c  Thu Nov 15 18:49:17 2012(r243095)
@@ -29,8 +29,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-#include opt_bus.h
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/malloc.h

Modified: head/sys/dev/agp/agp_i810.c
==
--- head/sys/dev/agp/agp_i810.c Thu Nov 15 18:05:38 2012(r243094)
+++ head/sys/dev/agp/agp_i810.c Thu Nov 15 18:49:17 2012(r243095)
@@ -40,8 +40,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-#include opt_bus.h
-
 #if 0
 #defineKTR_AGP_I810KTR_DEV
 #else

Modified: head/sys/dev/agp/agp_intel.c
==
--- head/sys/dev/agp/agp_intel.cThu Nov 15 18:05:38 2012
(r243094)
+++ head/sys/dev/agp/agp_intel.cThu Nov 15 18:49:17 2012
(r243095)
@@ -27,8 +27,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-#include opt_bus.h
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/malloc.h

Modified: head/sys/dev/agp/agp_nvidia.c
==
--- head/sys/dev/agp/agp_nvidia.c   Thu Nov 15 18:05:38 2012
(r243094)
+++ head/sys/dev/agp/agp_nvidia.c   Thu Nov 15 18:49:17 2012
(r243095)
@@ -32,8 +32,6 @@ __FBSDID($FreeBSD$);
  * NVIDIA nForce/nForce2 AGPGART Linux Kernel Patch.
  */
 
-#include opt_bus.h
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/malloc.h

Modified: head/sys/dev/agp/agp_sis.c
==
--- head/sys/dev/agp/agp_sis.c  Thu Nov 15 18:05:38 2012(r243094)
+++ head/sys/dev/agp/agp_sis.c  Thu Nov 15 18:49:17 2012(r243095)
@@ -27,8 +27,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-#include opt_bus.h
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/malloc.h

Modified: head/sys/dev/agp/agp_via.c
==
--- head/sys/dev/agp/agp_via.c  Thu 

Re: svn commit: r243076 - head/usr.sbin/chkgrp

2012-11-15 Thread Eitan Adler
On 15 November 2012 11:52, Bruce Evans b...@optusnet.com.au wrote:
 strtoul(1garbage, NULL, 10) succeeds and returns value 1, but the input
 is garbage.

This case is covered earlier
160 /* check that the GID is numeric */
161 if (strspn(f[2], 0123456789) != strlen(f[2])) {
162 warnx(%s: line %d: GID is not numeric, gfn, n);

 As the man page says, the EINVAL feature is unportable.  It is almost
 useless, since to detect garbage after the number you have to pass an
 endptr to strtoul(), and then the check for no conversion (that is,
 for garbage at the beginning) is just as easy as the check for garbage
 at the end.

This patch doesn't care about EINVAL or ERANGE. It just cares strtoul
returned an error.
I even considered just ignoring the error case because the data is
mostly sanity checked prior.


-- 
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: r243076 - head/usr.sbin/chkgrp

2012-11-15 Thread Konstantin Belousov
On Thu, Nov 15, 2012 at 01:52:46PM -0500, Eitan Adler wrote:
 On 15 November 2012 11:52, Bruce Evans b...@optusnet.com.au wrote:
  strtoul(1garbage, NULL, 10) succeeds and returns value 1, but the input
  is garbage.
 
 This case is covered earlier
 160 /* check that the GID is numeric */
 161 if (strspn(f[2], 0123456789) != strlen(f[2])) {
 162 warnx(%s: line %d: GID is not numeric, gfn, n);
So this code shall be removed, if you are introducing strtoul() to check
for errors at all.

 
  As the man page says, the EINVAL feature is unportable.  It is almost
  useless, since to detect garbage after the number you have to pass an
  endptr to strtoul(), and then the check for no conversion (that is,
  for garbage at the beginning) is just as easy as the check for garbage
  at the end.
 
 This patch doesn't care about EINVAL or ERANGE. It just cares strtoul
 returned an error.
 I even considered just ignoring the error case because the data is
 mostly sanity checked prior.
 
 
 -- 
 Eitan Adler
 Source, Ports, Doc committer
 Bugmeister, Ports Security teams


pgpihrnUBdMdS.pgp
Description: PGP signature


Re: svn commit: r243095 - head/sys/dev/agp

2012-11-15 Thread Konstantin Belousov
On Thu, Nov 15, 2012 at 06:49:17PM +, Eitan Adler wrote:
 Author: eadler
 Date: Thu Nov 15 18:49:17 2012
 New Revision: 243095
 URL: http://svnweb.freebsd.org/changeset/base/243095
 
 Log:
   Remove unneeded header from agp: opt_bus.h
   
   Tested with make universe
make universe cannot prove anything about usefulness of the removed include,
just because *_opt.h files contains only defines, which are used later
by the code like
#ifdef OPTION
do something
#endif.

If you are removing the option include, the module Makefile should be
adjusted too.


pgpqE9uiBH7bi.pgp
Description: PGP signature


svn commit: r243097 - stable/9/usr.bin/ktrdump

2012-11-15 Thread Navdeep Parhar
Author: np
Date: Thu Nov 15 19:27:11 2012
New Revision: 243097
URL: http://svnweb.freebsd.org/changeset/base/243097

Log:
  MFC r242378:
  Catch up with r238925.  ktr_entries may not be a power of 2.

Modified:
  stable/9/usr.bin/ktrdump/ktrdump.c
Directory Properties:
  stable/9/usr.bin/ktrdump/   (props changed)

Modified: stable/9/usr.bin/ktrdump/ktrdump.c
==
--- stable/9/usr.bin/ktrdump/ktrdump.c  Thu Nov 15 19:23:39 2012
(r243096)
+++ stable/9/usr.bin/ktrdump/ktrdump.c  Thu Nov 15 19:27:11 2012
(r243097)
@@ -218,7 +218,7 @@ main(int ac, char **av)
 * Now tear through the trace buffer.
 */
if (!iflag)
-   i = (index - 1)  (entries - 1);
+   i = (index - 1) % entries;
tlast = -1;
for (;;) {
if (buf[i].ktr_desc == NULL)
@@ -286,7 +286,7 @@ next:   if ((c = *p++) == '\0')
if (!iflag) {
if (i == index)
break;
-   i = (i - 1)  (entries - 1);
+   i = (i - 1) % entries;
} else {
if (++i == entries)
break;
___
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: r243098 - stable/9/sys/dev/cxgbe/tom

2012-11-15 Thread Navdeep Parhar
Author: np
Date: Thu Nov 15 19:45:04 2012
New Revision: 243098
URL: http://svnweb.freebsd.org/changeset/base/243098

Log:
  MFC r242666, r242671.
  
  r242666:
  Remove the tid from the software table (and bump down the in-use
  counter) when the syncache doesn't want the driver to reply to an
  incoming SYN.  This fixes a harmless bug where tids_in_use would
  go out of sync with the hardware counter.
  
  r242671:
  Make sure the inp hasn't been dropped before trying to access its socket
  and tcpcb.

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

Modified: stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c  Thu Nov 15 19:27:11 2012
(r243097)
+++ stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c  Thu Nov 15 19:45:04 2012
(r243098)
@@ -982,7 +982,6 @@ do_abort_req(struct sge_iq *iq, const st
struct sge_wrq *ofld_txq = toep-ofld_txq;
struct inpcb *inp;
struct tcpcb *tp;
-   struct socket *so;
 #ifdef INVARIANTS
unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl)));
 #endif
@@ -1008,7 +1007,6 @@ do_abort_req(struct sge_iq *iq, const st
INP_WLOCK(inp);
 
tp = intotcpcb(inp);
-   so = inp-inp_socket;
 
CTR6(KTR_CXGBE,
%s: tid %d (%s), toep_flags 0x%x, inp_flags 0x%x, status %d,
@@ -1026,10 +1024,16 @@ do_abort_req(struct sge_iq *iq, const st
}
toep-flags |= TPF_ABORT_SHUTDOWN;
 
-   so_error_set(so, abort_status_to_errno(tp, cpl-status));
-   tp = tcp_close(tp);
-   if (tp == NULL)
-   INP_WLOCK(inp); /* re-acquire */
+   if ((inp-inp_flags  (INP_DROPPED | INP_TIMEWAIT)) == 0) {
+   struct socket *so = inp-inp_socket;
+
+   if (so != NULL)
+   so_error_set(so, abort_status_to_errno(tp,
+   cpl-status));
+   tp = tcp_close(tp);
+   if (tp == NULL)
+   INP_WLOCK(inp); /* re-acquire */
+   }
 
final_cpl_received(toep);
 done:

Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c
==
--- stable/9/sys/dev/cxgbe/tom/t4_listen.c  Thu Nov 15 19:27:11 2012
(r243097)
+++ stable/9/sys/dev/cxgbe/tom/t4_listen.c  Thu Nov 15 19:45:04 2012
(r243098)
@@ -1202,6 +1202,7 @@ do_pass_accept_req(struct sge_iq *iq, co
if (m)
m-m_pkthdr.rcvif = ifp;
 
+   remove_tid(sc, synqe-tid);
release_synqe(synqe);   /* about to exit function */
free(wr, M_CXGBE);
REJECT_PASS_ACCEPT();
___
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: r243100 - head/sys/modules/agp

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 20:25:09 2012
New Revision: 243100
URL: http://svnweb.freebsd.org/changeset/base/243100

Log:
  Finish removing unneeded header from agp: opt_bus.h
  
  Approved by:  cperciva
  MFC after:1 week

Modified:
  head/sys/modules/agp/Makefile

Modified: head/sys/modules/agp/Makefile
==
--- head/sys/modules/agp/Makefile   Thu Nov 15 20:06:07 2012
(r243099)
+++ head/sys/modules/agp/Makefile   Thu Nov 15 20:25:09 2012
(r243100)
@@ -18,7 +18,7 @@ SRCS+=agp_amd64.c agp_i810.c agp_via.c
 SRCS+=  agp_apple.c
 .endif
 SRCS+= device_if.h bus_if.h agp_if.h pci_if.h
-SRCS+= opt_agp.h opt_bus.h
+SRCS+= opt_agp.h
 MFILES=kern/device_if.m kern/bus_if.m dev/agp/agp_if.m dev/pci/pci_if.m
 WERROR=
 
___
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: r243095 - head/sys/dev/agp

2012-11-15 Thread Eitan Adler
On 15 November 2012 14:22, Konstantin Belousov kostik...@gmail.com wrote:
 On Thu, Nov 15, 2012 at 06:49:17PM +, Eitan Adler wrote:
 Author: eadler
 Date: Thu Nov 15 18:49:17 2012
 New Revision: 243095
 URL: http://svnweb.freebsd.org/changeset/base/243095

 Log:
   Remove unneeded header from agp: opt_bus.h

   Tested with make universe
 make universe cannot prove anything about usefulness of the removed include,
 just because *_opt.h files contains only defines, which are used later
 by the code like

This is a good point. In this case I had done the manual review as
well.  make universe was an additional check.

 If you are removing the option include, the module Makefile should be
 adjusted too.

:-\  I had sent this to Colin but forgot to include it in my final commit.



-- 
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


svn commit: r243101 - head/etc

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Thu Nov 15 20:37:38 2012
New Revision: 243101
URL: http://svnweb.freebsd.org/changeset/base/243101

Log:
  Using set -x produces output on stderr instead of stdout.
  It also doesn't work with make -s.
  Prefer the use of builtin make features.
  
  PR:   misc/126312
  Reported by:  Nejc Skoberne n...@skoberne.net
  Submitted by: bdrewery
  Approved by:  cperciva
  MFC after:1 week

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu Nov 15 20:25:09 2012(r243100)
+++ head/etc/Makefile   Thu Nov 15 20:37:38 2012(r243101)
@@ -220,8 +220,7 @@ distribution:
cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
 .if ${MK_BIND_MTREE} != no
-   @if [ ! -e ${DESTDIR}/etc/namedb ]; then \
-   set -x; \
+   if [ ! -e ${DESTDIR}/etc/namedb ]; then \
ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
fi
 .endif
@@ -267,9 +266,8 @@ distribution:
 .if ${MK_MAIL} != no
cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
${ETCMAIL} ${DESTDIR}/etc/mail
-   @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
+   if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
  ! -f ${DESTDIR}/etc/aliases ]; then \
-   set -x; \
ln -s mail/aliases ${DESTDIR}/etc/aliases; \
fi
 .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: r243102 - head/cddl/contrib/opensolaris/cmd/zpool

2012-11-15 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Nov 15 20:50:18 2012
New Revision: 243102
URL: http://svnweb.freebsd.org/changeset/base/243102

Log:
  Sort SEE ALSO xrefs by the manual section number and add a missing comma.

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Nov 15 20:37:38 
2012(r243101)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Nov 15 20:50:18 
2012(r243102)
@@ -1927,8 +1927,8 @@ Discarded approximately 29 seconds of tr
 .Ed
 .El
 .Sh SEE ALSO
+.Xr zpool-features 7 ,
 .Xr zfs 8
-.Xr zpool-features 7
 .Sh AUTHORS
 This manual page is a
 .Xr mdoc 7
___
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: r243104 - head/bin/df

2012-11-15 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Nov 15 21:22:50 2012
New Revision: 243104
URL: http://svnweb.freebsd.org/changeset/base/243104

Log:
  Fix section number for pstat and swapinfo cross references.
  
  MFC after:3 days

Modified:
  head/bin/df/df.1

Modified: head/bin/df/df.1
==
--- head/bin/df/df.1Thu Nov 15 20:51:57 2012(r243103)
+++ head/bin/df/df.1Thu Nov 15 21:22:50 2012(r243104)
@@ -166,9 +166,7 @@ is set, the block counts will be display
 .El
 .Sh SEE ALSO
 .Xr lsvfs 1 ,
-.Xr pstat 1 ,
 .Xr quota 1 ,
-.Xr swapinfo 1 ,
 .Xr fstatfs 2 ,
 .Xr getfsstat 2 ,
 .Xr statfs 2 ,
@@ -176,7 +174,9 @@ is set, the block counts will be display
 .Xr localeconv 3 ,
 .Xr fstab 5 ,
 .Xr mount 8 ,
-.Xr quot 8
+.Xr pstat 8 ,
+.Xr quot 8 ,
+.Xr swapinfo 8
 .Sh STANDARDS
 With the exception of most options,
 the
___
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: r243105 - in vendor/NetBSD/bmake/dist: . unit-tests

2012-11-15 Thread Simon J. Gerraty
Author: sjg
Date: Thu Nov 15 22:01:30 2012
New Revision: 243105
URL: http://svnweb.freebsd.org/changeset/base/243105

Log:
  Import bmake-2012 - pick up fix for .ORDER
  
  Approved by:  marcel (mentor)

Added:
  vendor/NetBSD/bmake/dist/unit-tests/order
Modified:
  vendor/NetBSD/bmake/dist/ChangeLog
  vendor/NetBSD/bmake/dist/FILES
  vendor/NetBSD/bmake/dist/Makefile.in
  vendor/NetBSD/bmake/dist/cond.c
  vendor/NetBSD/bmake/dist/make.c
  vendor/NetBSD/bmake/dist/unit-tests/Makefile.in
  vendor/NetBSD/bmake/dist/unit-tests/test.exp

Modified: vendor/NetBSD/bmake/dist/ChangeLog
==
--- vendor/NetBSD/bmake/dist/ChangeLog  Thu Nov 15 21:22:50 2012
(r243104)
+++ vendor/NetBSD/bmake/dist/ChangeLog  Thu Nov 15 22:01:30 2012
(r243105)
@@ -1,3 +1,28 @@
+2012-11-11  Simon J. Gerraty  s...@bad.crufty.net
+
+   * Makefile.in (MAKE_VERSION): 2012
+ fix generation of bmake.cat1
+
+2012-11-09  Simon J. Gerraty  s...@bad.crufty.net
+
+   * Makefile.in (MAKE_VERSION): 20121109
+ Merge with NetBSD make, pick up
+ o make.c: MakeBuildChild: return 0 so search continues if a
+   .ORDER dependency is detected.
+ o unit-tests/order: test the above
+   
+2012-11-02  Simon J. Gerraty  s...@bad.crufty.net
+
+   * Makefile.in (MAKE_VERSION): 20121102
+ Merge with NetBSD make, pick up
+ o cond.c: allow cond_state[] to grow.
+   In meta mode with a very large tree, we can hit the limit
+   while processing dirdeps.
+   
+2012-10-25  Simon J. Gerraty  s...@bad.crufty.net
+
+   * Makefile.in: we need to use ${srcdir} not ${.CURDIR}
+
 2012-10-10  Simon J. Gerraty  s...@bad.crufty.net
 
* Makefile.in (MAKE_VERSION): 20121010

Modified: vendor/NetBSD/bmake/dist/FILES
==
--- vendor/NetBSD/bmake/dist/FILES  Thu Nov 15 21:22:50 2012
(r243104)
+++ vendor/NetBSD/bmake/dist/FILES  Thu Nov 15 22:01:30 2012
(r243105)
@@ -110,6 +110,7 @@ unit-tests/modmisc
 unit-tests/modorder
 unit-tests/modts
 unit-tests/modword
+unit-tests/order
 unit-tests/phony-end
 unit-tests/posix
 unit-tests/qequals

Modified: vendor/NetBSD/bmake/dist/Makefile.in
==
--- vendor/NetBSD/bmake/dist/Makefile.inThu Nov 15 21:22:50 2012
(r243104)
+++ vendor/NetBSD/bmake/dist/Makefile.inThu Nov 15 22:01:30 2012
(r243105)
@@ -1,7 +1,7 @@
 #  $NetBSD: Makefile,v 1.56 2012/05/30 21:54:23 sjg Exp $
 #  @(#)Makefile5.2 (Berkeley) 12/28/90
 
-#  $Id: Makefile.in,v 1.174 2012/10/10 18:46:24 sjg Exp $
+#  $Id: Makefile.in,v 1.178 2012/11/15 16:48:59 sjg Exp $
 
 PROG=  bmake
 SRCS=  arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
@@ -21,7 +21,7 @@ srcdir= @srcdir@
 CC?= @CC@
 
 # Base version on src date
-MAKE_VERSION= 20121010
+MAKE_VERSION= 2012
 MACHINE=@machine@
 MACHINE_ARCH=@machine_arch@
 DEFAULT_SYS_PATH = @default_sys_path@
@@ -114,7 +114,7 @@ ${MAN}: make.1 my.history
@echo making ${PROG}.1
@sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
-e '/^.Sh HISTORY/rmy.history' \
-   -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${.CURDIR}/make.1  $@
+   -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1  $@
 
 .endif
 

Modified: vendor/NetBSD/bmake/dist/cond.c
==
--- vendor/NetBSD/bmake/dist/cond.c Thu Nov 15 21:22:50 2012
(r243104)
+++ vendor/NetBSD/bmake/dist/cond.c Thu Nov 15 22:01:30 2012
(r243105)
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $  */
+/* $NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $;
+static char rcsid[] = $NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp 
$;
 #else
 #include sys/cdefs.h
 #ifndef lint
 #if 0
 static char sccsid[] = @(#)cond.c 8.2 (Berkeley) 1/2/94;
 #else
-__RCSID($NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $);
+__RCSID($NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -1227,7 +1227,8 @@ do_Cond_EvalExpression(Boolean *value)
 int
 Cond_Eval(char *line)
 {
-#defineMAXIF  128  /* maximum depth of .if'ing */
+#defineMAXIF  128  /* maximum depth of .if'ing */
+#defineMAXIF_BUMP  32  /* how much to grow by */
 enum if_states {
IF_ACTIVE,  /* .if or .elif part active */
ELSE_ACTIVE,/* .else part active */
@@ -1235,7 +1236,8 @@ Cond_Eval(char *line)
   

svn commit: r243106 - vendor/NetBSD/bmake/bmake-20121111

2012-11-15 Thread Simon J. Gerraty
Author: sjg
Date: Thu Nov 15 22:05:18 2012
New Revision: 243106
URL: http://svnweb.freebsd.org/changeset/base/243106

Log:
  Tag bmake-2012
  
  Approved by:  marcel (mentor)

Added:
  vendor/NetBSD/bmake/bmake-2012/
 - copied from r243105, vendor/NetBSD/bmake/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: r243107 - head/sys/arm/arm

2012-11-15 Thread Olivier Houchard
Author: cognet
Date: Thu Nov 15 22:31:23 2012
New Revision: 243107
URL: http://svnweb.freebsd.org/changeset/base/243107

Log:
  Use the inner shareable variations of flush/invalidate functions for SMP.
  
  Submitted by: Giovanni Trematerra gianni at freebsd DOT org

Modified:
  head/sys/arm/arm/cpufunc_asm_armv7.S

Modified: head/sys/arm/arm/cpufunc_asm_armv7.S
==
--- head/sys/arm/arm/cpufunc_asm_armv7.SThu Nov 15 22:05:18 2012
(r243106)
+++ head/sys/arm/arm/cpufunc_asm_armv7.SThu Nov 15 22:31:23 2012
(r243107)
@@ -70,7 +70,11 @@ ENTRY(armv7_setttb)

orr r0, r0, #PT_ATTR
mcr p15, 0, r0, c2, c0, 0   /* Translation Table Base Register 0 
(TTBR0) */
+#ifdef SMP
+   mcr p15, 0, r0, c8, c3, 0   /* invalidate I+D TLBs Inner Shareable*/
+#else
mcr p15, 0, r0, c8, c7, 0   /* invalidate I+D TLBs */
+#endif
dsb
isb
RET
@@ -78,11 +82,12 @@ ENTRY(armv7_setttb)
 ENTRY(armv7_tlb_flushID)
dsb
 #ifdef SMP
-   mcr p15, 0, r0, c8, c3, 0
+   mcr p15, 0, r0, c8, c3, 0   /* flush I+D tlb */
+   mcr p15, 0, r0, c7, c1, 6   /* flush BTB */
 #else
mcr p15, 0, r0, c8, c7, 0   /* flush I+D tlb */
-#endif
mcr p15, 0, r0, c7, c5, 6   /* flush BTB */
+#endif
dsb
isb
mov pc, lr
@@ -91,11 +96,12 @@ ENTRY(armv7_tlb_flushID_SE)
ldr r1, .Lpage_mask
bic r0, r0, r1
 #ifdef SMP
-   mcr p15, 0, r0, c8, c3, 1   /* flush D tlb single entry */
+   mcr p15, 0, r0, c8, c3, 1   /* flush D tlb single entry Inner 
Shareable*/
+   mcr p15, 0, r0, c7, c1, 6   /* flush BTB Inner Shareable */
 #else
mcr p15, 0, r0, c8, c7, 1   /* flush D tlb single entry */
-#endif
mcr p15, 0, r0, c7, c5, 6   /* flush BTB */
+#endif
dsb
isb
mov pc, lr
@@ -155,7 +161,11 @@ Finished:
 ENTRY(armv7_idcache_wbinv_all)
stmdb   sp!, {lr}
bl armv7_dcache_wbinv_all
+#ifdef SMP
+   mcr p15, 0, r0, c7, c1, 0   /* Invalidate all I caches to PoU 
(ICIALLUIS) */
+#else
mcr p15, 0, r0, c7, c5, 0   /* Invalidate all I caches to PoU 
(ICIALLU) */
+#endif
dsb
isb
ldmia   sp!, {lr}
@@ -251,7 +261,11 @@ ENTRY(armv7_context_switch)
orr r0, r0, #PT_ATTR

mcr p15, 0, r0, c2, c0, 0   /* set the new TTB */
+#ifdef SMP
+   mcr p15, 0, r0, c8, c3, 0   /* and flush the I+D tlbs Inner 
Sharable */
+#else
mcr p15, 0, r0, c8, c7, 0   /* and flush the I+D tlbs */
+#endif
dsb
isb
RET
___
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: r243108 - head/sys/arm/arm

2012-11-15 Thread Olivier Houchard
Author: cognet
Date: Thu Nov 15 23:49:07 2012
New Revision: 243108
URL: http://svnweb.freebsd.org/changeset/base/243108

Log:
  Remove a useless printf

Modified:
  head/sys/arm/arm/busdma_machdep-v6.c

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==
--- head/sys/arm/arm/busdma_machdep-v6.cThu Nov 15 22:31:23 2012
(r243107)
+++ head/sys/arm/arm/busdma_machdep-v6.cThu Nov 15 23:49:07 2012
(r243108)
@@ -1463,7 +1463,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_
struct bounce_zone *bz;
struct bounce_page *bpage;
 
-   printf(add bounce page\n);
KASSERT(dmat-bounce_zone != NULL, (no bounce zone in dma tag));
KASSERT(map != NULL,
(add_bounce_page: bad map %p, map));
___
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: r243109 - head/sys/arm/arm

2012-11-15 Thread Olivier Houchard
Author: cognet
Date: Fri Nov 16 00:14:02 2012
New Revision: 243109
URL: http://svnweb.freebsd.org/changeset/base/243109

Log:
  Don't forget to unlock the pmap lock on failure.

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Thu Nov 15 23:49:07 2012(r243108)
+++ head/sys/arm/arm/pmap-v6.c  Fri Nov 16 00:14:02 2012(r243109)
@@ -2361,8 +2361,10 @@ pmap_change_attr(vm_offset_t sva, vm_siz
 * Only supported on kernel virtual addresses, including the direct
 * map but excluding the recursive map.
 */
-   if (base  DMAP_MIN_ADDRESS)
+   if (base  DMAP_MIN_ADDRESS) {
+   PMAP_UNLOCK(kernel_pmap);
return (EINVAL);
+   }
 #endif
for (tmpva = base; tmpva  base + size; ) {
next_bucket = L2_NEXT_BUCKET(tmpva);
@@ -2377,8 +2379,10 @@ pmap_change_attr(vm_offset_t sva, vm_siz
 
ptep = l2b-l2b_kva[l2pte_index(tmpva)];
 
-   if (*ptep == 0)
+   if (*ptep == 0) {
+   PMAP_UNLOCK(kernel_pmap);
return(EINVAL);
+   }
 
pte = *ptep ~ L2_S_CACHE_MASK;
cpu_idcache_wbinv_range(tmpva, PAGE_SIZE);
___
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: r243110 - head/sys/dev/cxgbe/tom

2012-11-15 Thread Navdeep Parhar
Author: np
Date: Fri Nov 16 00:21:54 2012
New Revision: 243110
URL: http://svnweb.freebsd.org/changeset/base/243110

Log:
  cxgbe/tom: Plug mbuf leak.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/tom/t4_listen.c

Modified: head/sys/dev/cxgbe/tom/t4_listen.c
==
--- head/sys/dev/cxgbe/tom/t4_listen.c  Fri Nov 16 00:14:02 2012
(r243109)
+++ head/sys/dev/cxgbe/tom/t4_listen.c  Fri Nov 16 00:21:54 2012
(r243110)
@@ -559,8 +559,10 @@ t4_syncache_respond(struct toedev *tod, 
struct tcphdr *th = (void *)(ip + 1);
 
wr = (struct wrqe *)atomic_readandclear_ptr(synqe-wr);
-   if (wr == NULL)
+   if (wr == NULL) {
+   m_freem(m);
return (EALREADY);
+   }
 
bzero(to, sizeof(to));
tcp_dooptions(to, (void *)(th + 1), (th-th_off  2) - sizeof(*th),
___
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: r243112 - in head/usr.sbin/bsdconfig: . console diskmgmt docsinstall dot mouse networking password security share startup timezone ttys usermgmt

2012-11-15 Thread Devin Teske
Author: dteske
Date: Fri Nov 16 00:59:11 2012
New Revision: 243112
URL: http://svnweb.freebsd.org/changeset/base/243112

Log:
  Replicate a feature from sysinstall documented in
  stable/9/usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
  
  If /usr/sbin/sysinstall is linked to another filename, say
  `/usr/local/bin/configPackages', then the basename will be used
  as an implicit command name.
  
  To get a list of modules you can link to, see `bsdconfig -h' output.
  
  Approved by:  adrian (co-mentor) (implicit)

Modified:
  head/usr.sbin/bsdconfig/bsdconfig
  head/usr.sbin/bsdconfig/console/console
  head/usr.sbin/bsdconfig/console/font
  head/usr.sbin/bsdconfig/console/keymap
  head/usr.sbin/bsdconfig/console/repeat
  head/usr.sbin/bsdconfig/console/saver
  head/usr.sbin/bsdconfig/console/screenmap
  head/usr.sbin/bsdconfig/console/ttys
  head/usr.sbin/bsdconfig/diskmgmt/diskmgmt
  head/usr.sbin/bsdconfig/docsinstall/docsinstall
  head/usr.sbin/bsdconfig/dot/dot
  head/usr.sbin/bsdconfig/mouse/disable
  head/usr.sbin/bsdconfig/mouse/enable
  head/usr.sbin/bsdconfig/mouse/flags
  head/usr.sbin/bsdconfig/mouse/mouse
  head/usr.sbin/bsdconfig/mouse/port
  head/usr.sbin/bsdconfig/mouse/type
  head/usr.sbin/bsdconfig/networking/defaultrouter
  head/usr.sbin/bsdconfig/networking/devices
  head/usr.sbin/bsdconfig/networking/hostname
  head/usr.sbin/bsdconfig/networking/nameservers
  head/usr.sbin/bsdconfig/networking/networking
  head/usr.sbin/bsdconfig/password/password
  head/usr.sbin/bsdconfig/security/kern_securelevel
  head/usr.sbin/bsdconfig/security/security
  head/usr.sbin/bsdconfig/share/common.subr
  head/usr.sbin/bsdconfig/startup/misc
  head/usr.sbin/bsdconfig/startup/rcadd
  head/usr.sbin/bsdconfig/startup/rcconf
  head/usr.sbin/bsdconfig/startup/rcdelete
  head/usr.sbin/bsdconfig/startup/rcedit
  head/usr.sbin/bsdconfig/startup/rcvar
  head/usr.sbin/bsdconfig/startup/startup
  head/usr.sbin/bsdconfig/timezone/timezone
  head/usr.sbin/bsdconfig/ttys/ttys
  head/usr.sbin/bsdconfig/usermgmt/groupadd
  head/usr.sbin/bsdconfig/usermgmt/groupdel
  head/usr.sbin/bsdconfig/usermgmt/groupedit
  head/usr.sbin/bsdconfig/usermgmt/groupinput
  head/usr.sbin/bsdconfig/usermgmt/useradd
  head/usr.sbin/bsdconfig/usermgmt/userdel
  head/usr.sbin/bsdconfig/usermgmt/useredit
  head/usr.sbin/bsdconfig/usermgmt/userinput
  head/usr.sbin/bsdconfig/usermgmt/usermgmt

Modified: head/usr.sbin/bsdconfig/bsdconfig
==
--- head/usr.sbin/bsdconfig/bsdconfig   Fri Nov 16 00:23:23 2012
(r243111)
+++ head/usr.sbin/bsdconfig/bsdconfig   Fri Nov 16 00:59:11 2012
(r243112)
@@ -202,6 +202,16 @@ dialog_menu_main()
  MAIN
 
 #
+# If $0 is not bsdconfig, interpret it as a keyword to a menuitem
+#
+if [ $pgm != bsdconfig ] 
+   indexfile=$( f_index_file $pgm ) 
+   cmd=$( f_index_menusel_command $indexfile $pgm )
+then
+   exec $cmd $@ || exit 1
+fi
+
+#
 # Process command-line arguments
 #
 while getopts hSX flag; do
@@ -244,51 +254,18 @@ if [ $1 ]; then
esac
 
#
-   # Find the INDEX (possibly i18n) claiming this keyword
+   # Find the INDEX (possibly i18n) claiming this keyword and get the
+   # command to execute from the menu_selection line.
#
-   lang=${LANG:-$LC_ALL}
-   if [ $lang ]; then
-   sel=$( grep ^menu_selection=\$1| */INDEX.$lang \
-   2 /dev/null | tail -1 )
-
-   # Fall-back to non-i18n sources if nothing was found
-   [ $sel ] ||
-   sel=$( grep ^menu_selection=\$1| */INDEX | tail -1 )
-   else
-   sel=$( grep ^menu_selection=\$1| */INDEX | tail -1 )
-   fi
-
-   #
-   # If no matches, display usage (which shows valid keywords)
-   #
-   if [ ! $sel ]; then
+   if ! { indexfile=$( f_index_file $1 ) 
+  cmd=$( f_index_menusel_command $indexfile $1 )
+   }; then
+   # no matches, display usage (which shows valid keywords)
f_err %s: %s: $msg_not_found\n $pgm $1
usage
fi
 
-   #
-   # The command to execute is after the pipe-character (|) in the
-   # menu_selection property of the INDEX file for the menuitem.
-   #
-   cmd=${sel#*|}
-   cmd=${cmd%\}
-   if [ ! $cmd ]; then
-   echo $pgm: $1: $msg_not_found
-   usage
-   fi
shift
-
-   #
-   # If the command pathname is not fully qualified fix-up/force to be
-   # relative to the menuitem directory.
-   #
-   case $cmd in
-   /*) : already fully qualified ;;
-   *)
-   dir=${sel%%/*}
-   cmd=$dir/$cmd
-   esac
-
exec $cmd ${USE_XDIALOG:+-X} $@ || exit 1
 fi
 

Modified: head/usr.sbin/bsdconfig/console/console

svn commit: r243113 - head/share/man/man7

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Fri Nov 16 01:22:56 2012
New Revision: 243113
URL: http://svnweb.freebsd.org/changeset/base/243113

Log:
  Remove quite a bit of stale data from the tuning.7
  While here fix some style issues.
  
  Submitted by: many (via the SystemTuning wiki page)
  Approved by:  bcr (mentor)
  MFC after:3 days

Modified:
  head/share/man/man7/tuning.7

Modified: head/share/man/man7/tuning.7
==
--- head/share/man/man7/tuning.7Fri Nov 16 00:59:11 2012
(r243112)
+++ head/share/man/man7/tuning.7Fri Nov 16 01:22:56 2012
(r243113)
@@ -23,50 +23,26 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd May 11, 2012
+.Dd October 20, 2012
 .Dt TUNING 7
 .Os
 .Sh NAME
 .Nm tuning
 .Nd performance tuning under FreeBSD
 .Sh SYSTEM SETUP - DISKLABEL, NEWFS, TUNEFS, SWAP
-When using
-.Xr bsdlabel 8
-or
-.Xr sysinstall 8
-to lay out your file systems on a hard disk it is important to remember
-that hard drives can transfer data much more quickly from outer tracks
-than they can from inner tracks.
-To take advantage of this you should
-try to pack your smaller file systems and swap closer to the outer tracks,
-follow with the larger file systems, and end with the largest file systems.
-It is also important to size system standard file systems such that you
-will not be forced to resize them later as you scale the machine up.
-I usually create, in order, a 128M root, 1G swap, 128M
-.Pa /var ,
-128M
-.Pa /var/tmp ,
-3G
-.Pa /usr ,
-and use any remaining space for
-.Pa /home .
-.Pp
-You should typically size your swap space to approximately 2x main memory
-for systems with less than 2GB of RAM, or approximately 1x main memory
+The swap partition should typically be approximately 2x the size of
+main memory
+for systems with less than 4GB of RAM, or approximately equal to
+the size of main memory
 if you have more.
-If you do not have a lot of RAM, though, you will generally want a lot
-more swap.
-It is not recommended that you configure any less than
-256M of swap on a system and you should keep in mind future memory
+Keep in mind future memory
 expansion when sizing the swap partition.
-The kernel's VM paging algorithms are tuned to perform best when there is
-at least 2x swap versus main memory.
 Configuring too little swap can lead
 to inefficiencies in the VM page scanning code as well as create issues
 later on if you add more memory to your machine.
-Finally, on larger systems
+On larger systems
 with multiple SCSI disks (or multiple IDE disks operating on different
-controllers), we strongly recommend that you configure swap on each drive.
+controllers), configure swap on each drive.
 The swap partitions on the drives should be approximately the same size.
 The kernel can handle arbitrary sizes but
 internal data structures scale to 4 times the largest swap partition.
@@ -79,100 +55,7 @@ little, swap space is the saving grace o
 and even if you do not normally use much swap, it can give you more time to
 recover from a runaway program before being forced to reboot.
 .Pp
-How you size your
-.Pa /var
-partition depends heavily on what you intend to use the machine for.
-This
-partition is primarily used to hold mailboxes, the print spool, and log
-files.
-Some people even make
-.Pa /var/log
-its own partition (but except for extreme cases it is not worth the waste
-of a partition ID).
-If your machine is intended to act as a mail
-or print server,
-or you are running a heavily visited web server, you should consider
-creating a much larger partition \(en perhaps a gig or more.
-It is very easy
-to underestimate log file storage requirements.
-.Pp
-Sizing
-.Pa /var/tmp
-depends on the kind of temporary file usage you think you will need.
-128M is
-the minimum we recommend.
-Also note that sysinstall will create a
-.Pa /tmp
-directory.
-Dedicating a partition for temporary file storage is important for
-two reasons: first, it reduces the possibility of file system corruption
-in a crash, and second it reduces the chance of a runaway process that
-fills up
-.Oo Pa /var Oc Ns Pa /tmp
-from blowing up more critical subsystems (mail,
-logging, etc).
-Filling up
-.Oo Pa /var Oc Ns Pa /tmp
-is a very common problem to have.
-.Pp
-In the old days there were differences between
-.Pa /tmp
-and
-.Pa /var/tmp ,
-but the introduction of
-.Pa /var
-(and
-.Pa /var/tmp )
-led to massive confusion
-by program writers so today programs haphazardly use one or the
-other and thus no real distinction can be made between the two.
-So it makes sense to have just one temporary directory and
-softlink to it from the other
-.Pa tmp
-directory locations.
-However you handle
-.Pa /tmp ,
-the one thing you do not want to do is leave it sitting
-on the root partition where it might cause root to fill up or possibly
-corrupt root in a crash/reboot situation.
-.Pp
-The
-.Pa /usr
-partition holds the bulk of the files required to support the system and
-a 

svn commit: r243114 - head/sys/boot/forth

2012-11-15 Thread Devin Teske
Author: dteske
Date: Fri Nov 16 01:24:11 2012
New Revision: 243114
URL: http://svnweb.freebsd.org/changeset/base/243114

Log:
  + This patch does not change user experience or functionality
  + Cleanup syntax, slim-down code, and make things more readable
  + Introduce new +c! operator and ilk to reduce heap usage/allocations
  + Add safemode_enabled? safemode_enable and safemode_disable functions
  + Add singleuser_enabled? singleuser_enable singleuser_disable functions
  + Add verbose_enabled? verbose_enable and verbose_disable functions
  + Centralize strings (also to reduce heap usage)
  
  Reviewed by:  peterj, adrian (co-mentor)
  Approved by:  adrian (co-mentor)

Modified:
  head/sys/boot/forth/menu-commands.4th
  head/sys/boot/forth/menu.4th

Modified: head/sys/boot/forth/menu-commands.4th
==
--- head/sys/boot/forth/menu-commands.4th   Fri Nov 16 01:22:56 2012
(r243113)
+++ head/sys/boot/forth/menu-commands.4th   Fri Nov 16 01:24:11 2012
(r243114)
@@ -31,6 +31,10 @@ include /boot/menusets.4th
 variable kernel_state
 variable root_state
 
+\ 
+\ ACPI
+\ 
+
 : acpi_enable ( -- )
s set acpi_load=YES evaluate \ XXX deprecated but harmless
s set hint.acpi.0.disabled=0 evaluate
@@ -58,9 +62,38 @@ variable root_state
TRUE \ loop menu again
 ;
 
+\ 
+\ Safe Mode
+\ 
+
+: safemode_enabled? ( -- flag )
+   s kern.smp.disabled getenv -1  dup if
+   swap drop ( c-addr flag -- flag )
+   then
+;
+
+: safemode_enable ( -- )
+   s set kern.smp.disabled=1 evaluate
+   s set hw.ata.ata_dma=0 evaluate
+   s set hw.ata.atapi_dma=0 evaluate
+   s set hw.ata.wc=0 evaluate
+   s set hw.eisa_slots=0 evaluate
+   s set kern.eventtimer.periodic=1 evaluate
+   s set kern.geom.part.check_integrity=0 evaluate
+;
+
+: safemode_disable ( -- )
+   s kern.smp.disabled unsetenv
+   s hw.ata.ata_dma unsetenv
+   s hw.ata.atapi_dma unsetenv
+   s hw.ata.wc unsetenv
+   s hw.eisa_slots unsetenv
+   s kern.eventtimer.periodic unsetenv
+   s kern.geom.part.check_integrity unsetenv
+;
+
 : init_safemode ( N -- N )
-   s kern.smp.disabled getenv -1  if
-   drop ( n c-addr -- n ) \ unused
+   safemode_enabled? if
toggle_menuitem ( n -- n )
then
 ;
@@ -70,25 +103,10 @@ variable root_state
 
\ Now we're going to make the change effective
 
-   s toggle_stateN @  \ base name of toggle state var
-   -rot 2dup 12 + c! rot\ replace 'N' with ASCII numeral
-
-   evaluate 0= if
-   s kern.smp.disabled unsetenv
-   s hw.ata.ata_dma unsetenv
-   s hw.ata.atapi_dma unsetenv
-   s hw.ata.wc unsetenv
-   s hw.eisa_slots unsetenv
-   s kern.eventtimer.periodic unsetenv
-   s kern.geom.part.check_integrity unsetenv
+   dup toggle_stateN @ 0= if
+   safemode_disable
else
-   s set kern.smp.disabled=1 evaluate
-   s set hw.ata.ata_dma=0 evaluate
-   s set hw.ata.atapi_dma=0 evaluate
-   s set hw.ata.wc=0 evaluate
-   s set hw.eisa_slots=0 evaluate
-   s set kern.eventtimer.periodic=1 evaluate
-   s set kern.geom.part.check_integrity=0 evaluate
+   safemode_enable
then
 
menu-redraw
@@ -96,9 +114,26 @@ variable root_state
TRUE \ loop menu again
 ;
 
+\ 
+\ Single User Mode
+\ 
+
+: singleuser_enabled? ( -- flag )
+   s boot_single getenv -1  dup if
+   swap drop ( c-addr flag -- flag )
+   then
+;
+
+: singleuser_enable ( -- )
+   s set boot_single=YES evaluate
+;
+
+: singleuser_disable ( -- )
+   s boot_single unsetenv
+;
+
 : init_singleuser ( N -- N )
-   s boot_single getenv -1  if
-   drop ( n c-addr -- n ) \ unused
+   singleuser_enabled? if
toggle_menuitem ( n -- n )
then
 ;
@@ -109,21 +144,35 @@ variable root_state
 
\ Now we're going to make the change effective
 
-   s toggle_stateN @  \ base name of toggle state var
-   -rot 2dup 12 + c! rot\ replace 'N' with ASCII numeral
-
-   evaluate 0= if
-   s boot_single unsetenv
+   dup toggle_stateN @ 0= if
+   singleuser_disable
else
-   s set boot_single=YES evaluate
+   singleuser_enable
then
 
TRUE \ loop menu again
 ;
 
+\ 
+\ Verbose Boot
+\ 
+
+: verbose_enabled? ( -- flag )
+   s boot_verbose getenv -1  dup if
+   swap drop ( c-addr flag -- flag )
+   then
+;
+
+: verbose_enable ( -- )
+   s set boot_verbose=YES evaluate
+;
+
+: verbose_disable ( -- )
+   s boot_verbose unsetenv
+;
+
 : init_verbose ( N -- N )
-   s boot_verbose getenv -1  if
-   drop ( n c-addr -- n ) \ unused
+   

svn commit: r243115 - in head: contrib/bmake contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests

2012-11-15 Thread Simon J. Gerraty
Author: sjg
Date: Fri Nov 16 01:37:25 2012
New Revision: 243115
URL: http://svnweb.freebsd.org/changeset/base/243115

Log:
  Merge bmake-2012
  Also pay attention to MK_SHARED_TOOLCHAIN.
  
  Approved by:  marcel (mentor)

Added:
  head/contrib/bmake/unit-tests/order
 - copied unchanged from r243106, vendor/NetBSD/bmake/dist/unit-tests/order
Modified:
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/FILES
  head/contrib/bmake/Makefile.in
  head/contrib/bmake/cond.c
  head/contrib/bmake/make.c
  head/contrib/bmake/unit-tests/Makefile.in
  head/contrib/bmake/unit-tests/test.exp
  head/usr.bin/bmake/Makefile
  head/usr.bin/bmake/Makefile.inc
  head/usr.bin/bmake/unit-tests/Makefile
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==
--- head/contrib/bmake/ChangeLogFri Nov 16 01:24:11 2012
(r243114)
+++ head/contrib/bmake/ChangeLogFri Nov 16 01:37:25 2012
(r243115)
@@ -1,3 +1,28 @@
+2012-11-11  Simon J. Gerraty  s...@bad.crufty.net
+
+   * Makefile.in (MAKE_VERSION): 2012
+ fix generation of bmake.cat1
+
+2012-11-09  Simon J. Gerraty  s...@bad.crufty.net
+
+   * Makefile.in (MAKE_VERSION): 20121109
+ Merge with NetBSD make, pick up
+ o make.c: MakeBuildChild: return 0 so search continues if a
+   .ORDER dependency is detected.
+ o unit-tests/order: test the above
+   
+2012-11-02  Simon J. Gerraty  s...@bad.crufty.net
+
+   * Makefile.in (MAKE_VERSION): 20121102
+ Merge with NetBSD make, pick up
+ o cond.c: allow cond_state[] to grow.
+   In meta mode with a very large tree, we can hit the limit
+   while processing dirdeps.
+   
+2012-10-25  Simon J. Gerraty  s...@bad.crufty.net
+
+   * Makefile.in: we need to use ${srcdir} not ${.CURDIR}
+
 2012-10-10  Simon J. Gerraty  s...@bad.crufty.net
 
* Makefile.in (MAKE_VERSION): 20121010

Modified: head/contrib/bmake/FILES
==
--- head/contrib/bmake/FILESFri Nov 16 01:24:11 2012(r243114)
+++ head/contrib/bmake/FILESFri Nov 16 01:37:25 2012(r243115)
@@ -110,6 +110,7 @@ unit-tests/modmisc
 unit-tests/modorder
 unit-tests/modts
 unit-tests/modword
+unit-tests/order
 unit-tests/phony-end
 unit-tests/posix
 unit-tests/qequals

Modified: head/contrib/bmake/Makefile.in
==
--- head/contrib/bmake/Makefile.in  Fri Nov 16 01:24:11 2012
(r243114)
+++ head/contrib/bmake/Makefile.in  Fri Nov 16 01:37:25 2012
(r243115)
@@ -1,7 +1,7 @@
 #  $NetBSD: Makefile,v 1.56 2012/05/30 21:54:23 sjg Exp $
 #  @(#)Makefile5.2 (Berkeley) 12/28/90
 
-#  $Id: Makefile.in,v 1.174 2012/10/10 18:46:24 sjg Exp $
+#  $Id: Makefile.in,v 1.178 2012/11/15 16:48:59 sjg Exp $
 
 PROG=  bmake
 SRCS=  arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
@@ -21,7 +21,7 @@ srcdir= @srcdir@
 CC?= @CC@
 
 # Base version on src date
-MAKE_VERSION= 20121010
+MAKE_VERSION= 2012
 MACHINE=@machine@
 MACHINE_ARCH=@machine_arch@
 DEFAULT_SYS_PATH = @default_sys_path@
@@ -114,7 +114,7 @@ ${MAN}: make.1 my.history
@echo making ${PROG}.1
@sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
-e '/^.Sh HISTORY/rmy.history' \
-   -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${.CURDIR}/make.1  $@
+   -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1  $@
 
 .endif
 

Modified: head/contrib/bmake/cond.c
==
--- head/contrib/bmake/cond.c   Fri Nov 16 01:24:11 2012(r243114)
+++ head/contrib/bmake/cond.c   Fri Nov 16 01:37:25 2012(r243115)
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $  */
+/* $NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $;
+static char rcsid[] = $NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp 
$;
 #else
 #include sys/cdefs.h
 #ifndef lint
 #if 0
 static char sccsid[] = @(#)cond.c 8.2 (Berkeley) 1/2/94;
 #else
-__RCSID($NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $);
+__RCSID($NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -1227,7 +1227,8 @@ do_Cond_EvalExpression(Boolean *value)
 int
 Cond_Eval(char *line)
 {
-#defineMAXIF  128  /* maximum depth of .if'ing */
+#defineMAXIF  128  /* maximum depth of .if'ing */
+#defineMAXIF_BUMP  32  /* how much to grow by */
 enum if_states {
IF_ACTIVE,  

svn commit: r243116 - head/lib/libc/gen

2012-11-15 Thread Greg Lehey
Author: grog
Date: Fri Nov 16 01:41:42 2012
New Revision: 243116
URL: http://svnweb.freebsd.org/changeset/base/243116

Log:
  Complete man page.
  
  MFC after:2 weeks

Modified:
  head/lib/libc/gen/getbsize.3

Modified: head/lib/libc/gen/getbsize.3
==
--- head/lib/libc/gen/getbsize.3Fri Nov 16 01:37:25 2012
(r243115)
+++ head/lib/libc/gen/getbsize.3Fri Nov 16 01:41:42 2012
(r243116)
@@ -28,12 +28,12 @@
 .\ @(#)getbsize.3 8.1 (Berkeley) 6/4/93
 .\ $FreeBSD$
 .\
-.Dd June 4, 1993
+.Dd November 16, 2012
 .Dt GETBSIZE 3
 .Os
 .Sh NAME
 .Nm getbsize
-.Nd get user block size
+.Nd get preferred block size
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
@@ -43,11 +43,31 @@
 .Sh DESCRIPTION
 The
 .Fn getbsize
-function determines the user's preferred block size based on the value of the
-.Dq BLOCKSIZE
-environment variable; see
-.Xr environ 7
-for details on its use and format.
+function returns a preferred block size for reporting by system utilities
+.Xr df 1 ,
+.Xr du 1 ,
+.Xr ls 1
+and
+.Xr systat 1 ,
+based on the value of the
+.En BLOCKSIZE
+environment variable.
+.En BLOCKSIZE
+may be specified directly in bytes, or in multiples of a kilobyte by
+specifying a number followed by ``K'' or ``k'', in multiples of a
+megabyte by specifying a number followed by ``M'' or ``m'' or in
+multiples of a gigabyte by specifying a number followed by ``G'' or
+``g''.
+Multiples must be integers.
+.Pp
+Valid values of
+.En BLOCKSIZE
+are 512 bytes to 1 gigabyte.
+Sizes less than 512 bytes are rounded up to 512 bytes, and sizes
+greater than 1 GB are rounded down to 1 GB.
+In each case
+.Fn getbsize
+produces a warning message.
 .Pp
 The
 .Fn getbsize
@@ -61,10 +81,6 @@ terminating null).
 The memory referenced by
 .Fa blocksizep
 is filled in with block size, in bytes.
-.Pp
-If the user's block size is unreasonable, a warning message is
-written to standard error and the returned information reflects
-a block size of 512 bytes.
 .Sh SEE ALSO
 .Xr df 1 ,
 .Xr du 1 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243117 - head/share/man/man7

2012-11-15 Thread Greg Lehey
Author: grog
Date: Fri Nov 16 01:43:23 2012
New Revision: 243117
URL: http://svnweb.freebsd.org/changeset/base/243117

Log:
  Move detailed description of BLOCKSIZE to getbsize(3).
  
  MFC after:2 weeks.

Modified:
  head/share/man/man7/environ.7

Modified: head/share/man/man7/environ.7
==
--- head/share/man/man7/environ.7   Fri Nov 16 01:41:42 2012
(r243116)
+++ head/share/man/man7/environ.7   Fri Nov 16 01:43:23 2012
(r243117)
@@ -56,13 +56,9 @@ The size of the block units used by seve
 .Xr du 1
 and
 .Xr ls 1 .
-.Ev BLOCKSIZE
-may be specified in units of a byte by specifying a number,
-in units of a kilobyte by specifying a number followed by ``K'' or
-``k'', in units of a megabyte by specifying a number followed by ``M''
-or ``m'' and in units of a gigabyte by specifying a number followed
-by ``G'' or ``g''.
-Sizes less than 512 bytes or greater than a gigabyte are ignored.
+This variable is processed by the
+.Xr getbsize 3
+function.
 .It Ev COLUMNS
 The user's preferred width in column positions for the terminal.
 Utilities such as
@@ -259,6 +255,7 @@ built-in command in
 .Xr execve 2 ,
 .Xr execle 3 ,
 .Xr getenv 3 ,
+.Xr getbsize 3 ,
 .Xr setenv 3 ,
 .Xr setlocale 3 ,
 .Xr system 3 ,
___
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: r243118 - in stable/9: share/man/man4 sys/dev/ata

2012-11-15 Thread Alexander Motin
Author: mav
Date: Fri Nov 16 02:26:23 2012
New Revision: 243118
URL: http://svnweb.freebsd.org/changeset/base/243118

Log:
  MFC r241144, r241160:
  Implement SATA revision (speed) control for legacy SATA controller for
  both boot (via loader tunables) and run-time (via `camcontrol negotiate`).
  Tested to work at least on NVIDIA MCP55 chipset.

Modified:
  stable/9/share/man/man4/ata.4
  stable/9/sys/dev/ata/ata-all.c
  stable/9/sys/dev/ata/ata-all.h
  stable/9/sys/dev/ata/ata-sata.c
Directory Properties:
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/share/man/man4/ata.4
==
--- stable/9/share/man/man4/ata.4   Fri Nov 16 01:43:23 2012
(r243117)
+++ stable/9/share/man/man4/ata.4   Fri Nov 16 02:26:23 2012
(r243118)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 18, 2012
+.Dd October 3, 2012
 .Dt ATA 4
 .Os
 .Sh NAME
@@ -99,7 +99,7 @@ set to 0 to disable the 80pin cable chec
 set to 1 to allow Message Signalled Interrupts (MSI) to be used by the
 specified PCI ATA controller, if supported.
 .It Va hint.ata.X.devX.mode
-limits the initial ATA mode for the specified device on specified the channel.
+limits the initial ATA mode for the specified device on the specified channel.
 .It Va hint.ata.X.mode
 limits the initial ATA mode for every device on the specified channel.
 .It Va hint.ata.X.pm_level
@@ -118,6 +118,12 @@ The host initiates a PARTIAL PM state tr
 host initiates SLUMBER PM state transition every time port becomes idle.
 .El
 Modes 2 and 3 are only supported for AHCI.
+.It Va hint.ata. Ns Ar X Ns Va .dev Ns Ar X Ns Va .sata_rev
+limits the initial SATA revision (speed) for the specified device
+on the specified channel.
+Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps.
+.It Va hint.ata. Ns Ar X Ns Va .sata_rev
+Same, but for every device on the specified channel.
 .El
 .Sh DESCRIPTION
 The

Modified: stable/9/sys/dev/ata/ata-all.c
==
--- stable/9/sys/dev/ata/ata-all.c  Fri Nov 16 01:43:23 2012
(r243117)
+++ stable/9/sys/dev/ata/ata-all.c  Fri Nov 16 02:26:23 2012
(r243118)
@@ -172,6 +172,15 @@ ata_attach(device_t dev)
 TASK_INIT(ch-conntask, 0, ata_conn_event, dev);
 #ifdef ATA_CAM
for (i = 0; i  16; i++) {
+   ch-user[i].revision = 0;
+   snprintf(buf, sizeof(buf), dev%d.sata_rev, i);
+   if (resource_int_value(device_get_name(dev),
+   device_get_unit(dev), buf, mode) != 0 
+   resource_int_value(device_get_name(dev),
+   device_get_unit(dev), sata_rev, mode) != 0)
+   mode = -1;
+   if (mode = 0)
+   ch-user[i].revision = mode;
ch-user[i].mode = 0;
snprintf(buf, sizeof(buf), dev%d.mode, i);
if (resource_string_value(device_get_name(dev),

Modified: stable/9/sys/dev/ata/ata-all.h
==
--- stable/9/sys/dev/ata/ata-all.h  Fri Nov 16 01:43:23 2012
(r243117)
+++ stable/9/sys/dev/ata/ata-all.h  Fri Nov 16 02:26:23 2012
(r243118)
@@ -142,6 +142,7 @@
 #define ATA_SC_SPD_NO_SPEED 0x
 #define ATA_SC_SPD_SPEED_GEN1   0x0010
 #define ATA_SC_SPD_SPEED_GEN2   0x0020
+#define ATA_SC_SPD_SPEED_GEN3   0x0040
 
 #define ATA_SC_IPM_MASK 0x0f00
 #define ATA_SC_IPM_NONE 0x

Modified: stable/9/sys/dev/ata/ata-sata.c
==
--- stable/9/sys/dev/ata/ata-sata.c Fri Nov 16 01:43:23 2012
(r243117)
+++ stable/9/sys/dev/ata/ata-sata.c Fri Nov 16 02:26:23 2012
(r243118)
@@ -152,8 +152,16 @@ int
 ata_sata_phy_reset(device_t dev, int port, int quick)
 {
 struct ata_channel *ch = device_get_softc(dev);
-int loop, retry;
-uint32_t val;
+int loop, retry, sata_rev;
+uint32_t val, val1;
+
+#ifdef ATA_CAM
+sata_rev = ch-user[port  0 ? 0 : port].revision;
+if (sata_rev  0)
+   quick = 0;
+#else
+sata_rev = 0;
+#endif
 
 if (quick) {
if (ata_sata_scr_read(ch, port, ATA_SCONTROL, val))
@@ -173,9 +181,18 @@ ata_sata_phy_reset(device_t dev, int por
device_printf(dev, p%d: hard reset ...\n, port);
}
 }
+if (sata_rev == 1)
+   val1 = ATA_SC_SPD_SPEED_GEN1;
+else if (sata_rev == 2)
+   val1 = ATA_SC_SPD_SPEED_GEN2;
+else if (sata_rev == 3)
+   val1 = ATA_SC_SPD_SPEED_GEN3;
+else
+   val1 = 0;
 for (retry = 0; retry  10; retry++) {
for (loop = 0; loop  10; loop++) {
-   if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET))
+  

svn commit: r243120 - in stable/8: share/man/man4 sys/dev/ahci sys/dev/ata sys/dev/ata/chipsets

2012-11-15 Thread Alexander Motin
Author: mav
Date: Fri Nov 16 02:55:03 2012
New Revision: 243120
URL: http://svnweb.freebsd.org/changeset/base/243120

Log:
  MFC r232380:
  Fix names of some Marvell SATA chips. It looks like chips with proprietary
  interface supported by mvs(4) are 88SX, while AHCI-like chips are 88SE.
  
  PR:   kern/165271

Modified:
  stable/8/share/man/man4/ahci.4
  stable/8/share/man/man4/ata.4
  stable/8/sys/dev/ahci/ahci.c
  stable/8/sys/dev/ata/ata-pci.h
  stable/8/sys/dev/ata/chipsets/ata-ahci.c
  stable/8/sys/dev/ata/chipsets/ata-marvell.c
Directory Properties:
  stable/8/share/man/man4/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/ahci/   (props changed)
  stable/8/sys/dev/ata/   (props changed)

Modified: stable/8/share/man/man4/ahci.4
==
--- stable/8/share/man/man4/ahci.4  Fri Nov 16 02:53:03 2012
(r243119)
+++ stable/8/share/man/man4/ahci.4  Fri Nov 16 02:55:03 2012
(r243120)
@@ -148,7 +148,7 @@ subclass 6 (SATA) and programming interf
 .Pp
 Also, in cooperation with atamarvell and atajmicron drivers of ata(4),
 it supports AHCI part of legacy-PATA + AHCI-SATA combined controllers,
-such as JMicron JMB36x and Marvell 88SX61xx.
+such as JMicron JMB36x and Marvell 88SE61xx.
 .Sh FILES
 .Bl -tag -width /dev/led/ahcich*.locate
 .It Pa /dev/led/ahcich*.act

Modified: stable/8/share/man/man4/ata.4
==
--- stable/8/share/man/man4/ata.4   Fri Nov 16 02:53:03 2012
(r243119)
+++ stable/8/share/man/man4/ata.4   Fri Nov 16 02:55:03 2012
(r243120)
@@ -161,8 +161,8 @@ IT8211F, IT8212F, IT8213F.
 .It JMicron:
 JMB360, JMB361, JMB363, JMB365, JMB366, JMB368.
 .It Marvell
-88SX5040, 88SX5041, 88SX5080, 88SX5081, 88SX6041, 88SX6042, 88SX6081, 88SX6101,
-88SX6102, 88SX6111, 88SX6121, 88SX6141, 88SX6145, 88SX7042.
+88SX5040, 88SX5041, 88SX5080, 88SX5081, 88SX6041, 88SX6042, 88SX6081, 88SE6101,
+88SE6102, 88SE6111, 88SE6121, 88SE6141, 88SE6145, 88SX7042.
 .It National:
 SC1100.
 .It NetCell:

Modified: stable/8/sys/dev/ahci/ahci.c
==
--- stable/8/sys/dev/ahci/ahci.cFri Nov 16 02:53:03 2012
(r243119)
+++ stable/8/sys/dev/ahci/ahci.cFri Nov 16 02:55:03 2012
(r243120)
@@ -188,13 +188,13 @@ static struct {
{0x2365197b, 0x00, JMicron JMB365,AHCI_Q_NOFORCE},
{0x2366197b, 0x00, JMicron JMB366,AHCI_Q_NOFORCE},
{0x2368197b, 0x00, JMicron JMB368,AHCI_Q_NOFORCE},
-   {0x61ab, 0x00, Marvell 88SX6111,  AHCI_Q_NOFORCE | AHCI_Q_1CH |
+   {0x61ab, 0x00, Marvell 88SE6111,  AHCI_Q_NOFORCE | AHCI_Q_1CH |
AHCI_Q_EDGEIS},
-   {0x612111ab, 0x00, Marvell 88SX6121,  AHCI_Q_NOFORCE | AHCI_Q_2CH |
+   {0x612111ab, 0x00, Marvell 88SE6121,  AHCI_Q_NOFORCE | AHCI_Q_2CH |
AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
-   {0x614111ab, 0x00, Marvell 88SX6141,  AHCI_Q_NOFORCE | AHCI_Q_4CH |
+   {0x614111ab, 0x00, Marvell 88SE6141,  AHCI_Q_NOFORCE | AHCI_Q_4CH |
AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
-   {0x614511ab, 0x00, Marvell 88SX6145,  AHCI_Q_NOFORCE | AHCI_Q_4CH |
+   {0x614511ab, 0x00, Marvell 88SE6145,  AHCI_Q_NOFORCE | AHCI_Q_4CH |
AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
{0x91201b4b, 0x00, Marvell 88SE912x,  AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES},
{0x91231b4b, 0x11, Marvell 88SE912x,  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},

Modified: stable/8/sys/dev/ata/ata-pci.h
==
--- stable/8/sys/dev/ata/ata-pci.h  Fri Nov 16 02:53:03 2012
(r243119)
+++ stable/8/sys/dev/ata/ata-pci.h  Fri Nov 16 02:55:03 2012
(r243120)
@@ -281,12 +281,12 @@ struct ata_pci_controller {
 #define ATA_M88SX6042   0x604211ab
 #define ATA_M88SX6081   0x608111ab
 #define ATA_M88SX7042   0x704211ab
-#define ATA_M88SX6101   0x610111ab
-#define ATA_M88SX6102   0x610211ab
-#define ATA_M88SX6111   0x61ab
-#define ATA_M88SX6121   0x612111ab
-#define ATA_M88SX6141   0x614111ab
-#define ATA_M88SX6145   0x614511ab
+#define ATA_M88SE6101   0x610111ab
+#define ATA_M88SE6102   0x610211ab
+#define ATA_M88SE6111   0x61ab
+#define ATA_M88SE6121   0x612111ab
+#define ATA_M88SE6141   0x614111ab
+#define ATA_M88SE6145   0x614511ab
 #define ATA_MARVELL2_ID 0x1b4b
 
 #define ATA_MICRON_ID   0x1042

Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c
==
--- stable/8/sys/dev/ata/chipsets/ata-ahci.cFri Nov 16 02:53:03 2012
(r243119)
+++ 

svn commit: r243124 - in stable/8: share/man/man4 sys/dev/ata

2012-11-15 Thread Alexander Motin
Author: mav
Date: Fri Nov 16 03:02:07 2012
New Revision: 243124
URL: http://svnweb.freebsd.org/changeset/base/243124

Log:
  MFC r241144, r241160:
  Implement SATA revision (speed) control for legacy SATA controller for
  both boot (via loader tunables) and run-time (via `camcontrol negotiate`).
  Tested to work at least on NVIDIA MCP55 chipset.

Modified:
  stable/8/share/man/man4/ata.4
  stable/8/sys/dev/ata/ata-all.c
  stable/8/sys/dev/ata/ata-all.h
  stable/8/sys/dev/ata/ata-sata.c
Directory Properties:
  stable/8/share/man/man4/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/ata/   (props changed)

Modified: stable/8/share/man/man4/ata.4
==
--- stable/8/share/man/man4/ata.4   Fri Nov 16 03:00:25 2012
(r243123)
+++ stable/8/share/man/man4/ata.4   Fri Nov 16 03:02:07 2012
(r243124)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 18, 2012
+.Dd October 3, 2012
 .Dt ATA 4
 .Os
 .Sh NAME
@@ -108,7 +108,7 @@ can cause data loss on power failures an
 set to 1 to allow Message Signalled Interrupts (MSI) to be used by
 specified PCI ATA controller, if supported.
 .It Va hint.ata.X.devX.mode
-limits initial ATA mode for specified device on specified channel.
+limits the initial ATA mode for the specified device on the specified channel.
 .It Va hint.ata.X.mode
 limits initial ATA mode for every device on specified channel.
 .It Va hint.ata.X.pm_level
@@ -126,6 +126,12 @@ host initiates PARTIAL PM state transiti
 host initiates SLUMBER PM state transition every time port becomes idle.
 .El
 Modes 2 and 3 are implemented only for AHCI driver now.
+.It Va hint.ata. Ns Ar X Ns Va .dev Ns Ar X Ns Va .sata_rev
+limits the initial SATA revision (speed) for the specified device
+on the specified channel.
+Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps.
+.It Va hint.ata. Ns Ar X Ns Va .sata_rev
+Same, but for every device on the specified channel.
 .El
 .Sh DESCRIPTION
 The

Modified: stable/8/sys/dev/ata/ata-all.c
==
--- stable/8/sys/dev/ata/ata-all.c  Fri Nov 16 03:00:25 2012
(r243123)
+++ stable/8/sys/dev/ata/ata-all.c  Fri Nov 16 03:02:07 2012
(r243124)
@@ -171,6 +171,15 @@ ata_attach(device_t dev)
 TASK_INIT(ch-conntask, 0, ata_conn_event, dev);
 #ifdef ATA_CAM
for (i = 0; i  16; i++) {
+   ch-user[i].revision = 0;
+   snprintf(buf, sizeof(buf), dev%d.sata_rev, i);
+   if (resource_int_value(device_get_name(dev),
+   device_get_unit(dev), buf, mode) != 0 
+   resource_int_value(device_get_name(dev),
+   device_get_unit(dev), sata_rev, mode) != 0)
+   mode = -1;
+   if (mode = 0)
+   ch-user[i].revision = mode;
ch-user[i].mode = 0;
snprintf(buf, sizeof(buf), dev%d.mode, i);
if (resource_string_value(device_get_name(dev),

Modified: stable/8/sys/dev/ata/ata-all.h
==
--- stable/8/sys/dev/ata/ata-all.h  Fri Nov 16 03:00:25 2012
(r243123)
+++ stable/8/sys/dev/ata/ata-all.h  Fri Nov 16 03:02:07 2012
(r243124)
@@ -142,6 +142,7 @@
 #define ATA_SC_SPD_NO_SPEED 0x
 #define ATA_SC_SPD_SPEED_GEN1   0x0010
 #define ATA_SC_SPD_SPEED_GEN2   0x0020
+#define ATA_SC_SPD_SPEED_GEN3   0x0040
 
 #define ATA_SC_IPM_MASK 0x0f00
 #define ATA_SC_IPM_NONE 0x

Modified: stable/8/sys/dev/ata/ata-sata.c
==
--- stable/8/sys/dev/ata/ata-sata.c Fri Nov 16 03:00:25 2012
(r243123)
+++ stable/8/sys/dev/ata/ata-sata.c Fri Nov 16 03:02:07 2012
(r243124)
@@ -152,8 +152,16 @@ int
 ata_sata_phy_reset(device_t dev, int port, int quick)
 {
 struct ata_channel *ch = device_get_softc(dev);
-int loop, retry;
-uint32_t val;
+int loop, retry, sata_rev;
+uint32_t val, val1;
+
+#ifdef ATA_CAM
+sata_rev = ch-user[port  0 ? 0 : port].revision;
+if (sata_rev  0)
+   quick = 0;
+#else
+sata_rev = 0;
+#endif
 
 if (quick) {
if (ata_sata_scr_read(ch, port, ATA_SCONTROL, val))
@@ -173,9 +181,18 @@ ata_sata_phy_reset(device_t dev, int por
device_printf(dev, p%d: hard reset ...\n, port);
}
 }
+if (sata_rev == 1)
+   val1 = ATA_SC_SPD_SPEED_GEN1;
+else if (sata_rev == 2)
+   val1 = ATA_SC_SPD_SPEED_GEN2;
+else if (sata_rev == 3)
+   val1 = ATA_SC_SPD_SPEED_GEN3;
+else
+   val1 = 0;
 for (retry = 0; retry  10; retry++) {
for (loop = 0; loop  10; loop++) {
-   if (ata_sata_scr_write(ch, port, 

svn commit: r243125 - in stable/9/sys/dev/ata: . chipsets

2012-11-15 Thread Alexander Motin
Author: mav
Date: Fri Nov 16 03:04:30 2012
New Revision: 243125
URL: http://svnweb.freebsd.org/changeset/base/243125

Log:
  MFC r242156:
  Implement CAM_ATAIO_NEEDRESULT (fetching full set of result registers) for
  ata(4) driver in ATA_CAM mode.  That slighty improves error reporting and
  also should fix `smartctl -l scterc /dev/adaX` operation.

Modified:
  stable/9/sys/dev/ata/ata-all.c
  stable/9/sys/dev/ata/ata-all.h
  stable/9/sys/dev/ata/ata-lowlevel.c
  stable/9/sys/dev/ata/chipsets/ata-ahci.c
  stable/9/sys/dev/ata/chipsets/ata-siliconimage.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/ata/ata-all.c
==
--- stable/9/sys/dev/ata/ata-all.c  Fri Nov 16 03:02:07 2012
(r243124)
+++ stable/9/sys/dev/ata/ata-all.c  Fri Nov 16 03:04:30 2012
(r243125)
@@ -1492,6 +1492,8 @@ ata_cam_begin_transaction(device_t dev, 
request-u.ata.lba |= ((uint64_t)ccb-ataio.cmd.lba_high  16) 
|
  ((uint64_t)ccb-ataio.cmd.lba_mid  8) |
   (uint64_t)ccb-ataio.cmd.lba_low;
+   if (ccb-ataio.cmd.flags  CAM_ATAIO_NEEDRESULT)
+   request-flags |= ATA_R_NEEDRESULT;
if ((ccb-ccb_h.flags  CAM_DIR_MASK) != CAM_DIR_NONE 
ccb-ataio.cmd.flags  CAM_ATAIO_DMA)
request-flags |= ATA_R_DMA;

Modified: stable/9/sys/dev/ata/ata-all.h
==
--- stable/9/sys/dev/ata/ata-all.h  Fri Nov 16 03:02:07 2012
(r243124)
+++ stable/9/sys/dev/ata/ata-all.h  Fri Nov 16 03:04:30 2012
(r243125)
@@ -397,6 +397,7 @@ struct ata_request {
 #define ATA_R_REQUEUE   0x0400
 #define ATA_R_THREAD0x0800
 #define ATA_R_DIRECT0x1000
+#define ATA_R_NEEDRESULT0x2000
 
 #define ATA_R_ATAPI16   0x0001
 #define ATA_R_ATAPI_INTR0x0002

Modified: stable/9/sys/dev/ata/ata-lowlevel.c
==
--- stable/9/sys/dev/ata/ata-lowlevel.c Fri Nov 16 03:02:07 2012
(r243124)
+++ stable/9/sys/dev/ata/ata-lowlevel.c Fri Nov 16 03:04:30 2012
(r243125)
@@ -116,6 +116,7 @@ ata_begin_transaction(struct ata_request
} while (request-status  ATA_S_BUSY  timeout--);
if (request-status  ATA_S_ERROR)
request-error = ATA_IDX_INB(ch, ATA_ERROR);
+   ch-hw.tf_read(request);
goto begin_finished;
}
 
@@ -253,8 +254,9 @@ ata_end_transaction(struct ata_request *
if (request-flags  ATA_R_TIMEOUT)
goto end_finished;
 
-   /* on control commands read back registers to the request struct */
-   if (request-flags  ATA_R_CONTROL) {
+   /* Read back registers to the request struct. */
+   if ((request-status  ATA_S_ERROR) ||
+   (request-flags  (ATA_R_CONTROL | ATA_R_NEEDRESULT))) {
ch-hw.tf_read(request);
}
 
@@ -332,6 +334,12 @@ ata_end_transaction(struct ata_request *
else if (!(request-flags  ATA_R_TIMEOUT))
request-donecount = request-bytecount;
 
+   /* Read back registers to the request struct. */
+   if ((request-status  ATA_S_ERROR) ||
+   (request-flags  (ATA_R_CONTROL | ATA_R_NEEDRESULT))) {
+   ch-hw.tf_read(request);
+   }
+
/* release SG list etc */
ch-dma.unload(request);
 

Modified: stable/9/sys/dev/ata/chipsets/ata-ahci.c
==
--- stable/9/sys/dev/ata/chipsets/ata-ahci.cFri Nov 16 03:02:07 2012
(r243124)
+++ stable/9/sys/dev/ata/chipsets/ata-ahci.cFri Nov 16 03:04:30 2012
(r243125)
@@ -555,8 +555,10 @@ ata_ahci_end_transaction(struct ata_requ
 if (request-status  ATA_S_ERROR)  
request-error = tf_data  8;
 
-/* on control commands read back registers to the request struct */
-if (request-flags  ATA_R_CONTROL) {
+/* Read back registers to the request struct. */
+if ((request-flags  ATA_R_ATAPI) == 0 
+   ((request-status  ATA_S_ERROR) ||
+(request-flags  (ATA_R_CONTROL | ATA_R_NEEDRESULT {
u_int8_t *fis = ch-dma.work + ATA_AHCI_FB_OFFSET + 0x40;
 
request-u.ata.count = fis[12] | ((u_int16_t)fis[13]  8);

Modified: stable/9/sys/dev/ata/chipsets/ata-siliconimage.c
==
--- stable/9/sys/dev/ata/chipsets/ata-siliconimage.cFri Nov 16 03:02:07 
2012(r243124)
+++ stable/9/sys/dev/ata/chipsets/ata-siliconimage.cFri Nov 16 03:04:30 
2012(r243125)
@@ -658,8 +658,10 @@ 

svn commit: r243126 - in stable/8/sys/dev/ata: . chipsets

2012-11-15 Thread Alexander Motin
Author: mav
Date: Fri Nov 16 03:05:27 2012
New Revision: 243126
URL: http://svnweb.freebsd.org/changeset/base/243126

Log:
  MFC r242156:
  Implement CAM_ATAIO_NEEDRESULT (fetching full set of result registers) for
  ata(4) driver in ATA_CAM mode.  That slighty improves error reporting and
  also should fix `smartctl -l scterc /dev/adaX` operation.

Modified:
  stable/8/sys/dev/ata/ata-all.c
  stable/8/sys/dev/ata/ata-all.h
  stable/8/sys/dev/ata/ata-lowlevel.c
  stable/8/sys/dev/ata/chipsets/ata-ahci.c
  stable/8/sys/dev/ata/chipsets/ata-siliconimage.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/ata/   (props changed)

Modified: stable/8/sys/dev/ata/ata-all.c
==
--- stable/8/sys/dev/ata/ata-all.c  Fri Nov 16 03:04:30 2012
(r243125)
+++ stable/8/sys/dev/ata/ata-all.c  Fri Nov 16 03:05:27 2012
(r243126)
@@ -1491,6 +1491,8 @@ ata_cam_begin_transaction(device_t dev, 
request-u.ata.lba |= ((uint64_t)ccb-ataio.cmd.lba_high  16) 
|
  ((uint64_t)ccb-ataio.cmd.lba_mid  8) |
   (uint64_t)ccb-ataio.cmd.lba_low;
+   if (ccb-ataio.cmd.flags  CAM_ATAIO_NEEDRESULT)
+   request-flags |= ATA_R_NEEDRESULT;
if ((ccb-ccb_h.flags  CAM_DIR_MASK) != CAM_DIR_NONE 
ccb-ataio.cmd.flags  CAM_ATAIO_DMA)
request-flags |= ATA_R_DMA;

Modified: stable/8/sys/dev/ata/ata-all.h
==
--- stable/8/sys/dev/ata/ata-all.h  Fri Nov 16 03:04:30 2012
(r243125)
+++ stable/8/sys/dev/ata/ata-all.h  Fri Nov 16 03:05:27 2012
(r243126)
@@ -397,6 +397,7 @@ struct ata_request {
 #define ATA_R_REQUEUE   0x0400
 #define ATA_R_THREAD0x0800
 #define ATA_R_DIRECT0x1000
+#define ATA_R_NEEDRESULT0x2000
 
 #define ATA_R_ATAPI16   0x0001
 #define ATA_R_ATAPI_INTR0x0002

Modified: stable/8/sys/dev/ata/ata-lowlevel.c
==
--- stable/8/sys/dev/ata/ata-lowlevel.c Fri Nov 16 03:04:30 2012
(r243125)
+++ stable/8/sys/dev/ata/ata-lowlevel.c Fri Nov 16 03:05:27 2012
(r243126)
@@ -116,6 +116,7 @@ ata_begin_transaction(struct ata_request
} while (request-status  ATA_S_BUSY  timeout--);
if (request-status  ATA_S_ERROR)
request-error = ATA_IDX_INB(ch, ATA_ERROR);
+   ch-hw.tf_read(request);
goto begin_finished;
}
 
@@ -253,8 +254,9 @@ ata_end_transaction(struct ata_request *
if (request-flags  ATA_R_TIMEOUT)
goto end_finished;
 
-   /* on control commands read back registers to the request struct */
-   if (request-flags  ATA_R_CONTROL) {
+   /* Read back registers to the request struct. */
+   if ((request-status  ATA_S_ERROR) ||
+   (request-flags  (ATA_R_CONTROL | ATA_R_NEEDRESULT))) {
ch-hw.tf_read(request);
}
 
@@ -332,6 +334,12 @@ ata_end_transaction(struct ata_request *
else if (!(request-flags  ATA_R_TIMEOUT))
request-donecount = request-bytecount;
 
+   /* Read back registers to the request struct. */
+   if ((request-status  ATA_S_ERROR) ||
+   (request-flags  (ATA_R_CONTROL | ATA_R_NEEDRESULT))) {
+   ch-hw.tf_read(request);
+   }
+
/* release SG list etc */
ch-dma.unload(request);
 

Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c
==
--- stable/8/sys/dev/ata/chipsets/ata-ahci.cFri Nov 16 03:04:30 2012
(r243125)
+++ stable/8/sys/dev/ata/chipsets/ata-ahci.cFri Nov 16 03:05:27 2012
(r243126)
@@ -555,8 +555,10 @@ ata_ahci_end_transaction(struct ata_requ
 if (request-status  ATA_S_ERROR)  
request-error = tf_data  8;
 
-/* on control commands read back registers to the request struct */
-if (request-flags  ATA_R_CONTROL) {
+/* Read back registers to the request struct. */
+if ((request-flags  ATA_R_ATAPI) == 0 
+   ((request-status  ATA_S_ERROR) ||
+(request-flags  (ATA_R_CONTROL | ATA_R_NEEDRESULT {
u_int8_t *fis = ch-dma.work + ATA_AHCI_FB_OFFSET + 0x40;
 
request-u.ata.count = fis[12] | ((u_int16_t)fis[13]  8);

Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c
==
--- stable/8/sys/dev/ata/chipsets/ata-siliconimage.cFri Nov 16 03:04:30 
2012(r243125)
+++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.cFri Nov 16 03:05:27 
2012

svn commit: r243127 - stable/9/sys/dev/ata

2012-11-15 Thread Alexander Motin
Author: mav
Date: Fri Nov 16 03:07:27 2012
New Revision: 243127
URL: http://svnweb.freebsd.org/changeset/base/243127

Log:
  MFC r242422:
  Only four specific ATA PIO commands transfer several sectors per DRQ block
  (interrupt).  All other ATA PIO commands transfer one sector or 512 bytes
  at one time.  Hardcode these exceptions in ata(4) with ATA_CAM option.
  This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.

Modified:
  stable/9/sys/dev/ata/ata-all.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/ata/ata-all.c
==
--- stable/9/sys/dev/ata/ata-all.c  Fri Nov 16 03:05:27 2012
(r243126)
+++ stable/9/sys/dev/ata/ata-all.c  Fri Nov 16 03:07:27 2012
(r243127)
@@ -1501,6 +1501,14 @@ ata_cam_begin_transaction(device_t dev, 
request-flags |= ATA_R_READ;
if ((ccb-ccb_h.flags  CAM_DIR_MASK) == CAM_DIR_OUT)
request-flags |= ATA_R_WRITE;
+   if (ccb-ataio.cmd.command == ATA_READ_MUL ||
+   ccb-ataio.cmd.command == ATA_READ_MUL48 ||
+   ccb-ataio.cmd.command == ATA_WRITE_MUL ||
+   ccb-ataio.cmd.command == ATA_WRITE_MUL48) {
+   request-transfersize = min(request-bytecount,
+   ch-curr[ccb-ccb_h.target_id].bytecount);
+   } else
+   request-transfersize = min(request-bytecount, 512);
} else {
request-data = ccb-csio.data_ptr;
request-bytecount = ccb-csio.dxfer_len;
@@ -1517,9 +1525,9 @@ ata_cam_begin_transaction(device_t dev, 
request-flags |= ATA_R_READ;
if ((ccb-ccb_h.flags  CAM_DIR_MASK) == CAM_DIR_OUT)
request-flags |= ATA_R_WRITE;
+   request-transfersize = min(request-bytecount,
+   ch-curr[ccb-ccb_h.target_id].bytecount);
}
-   request-transfersize = min(request-bytecount,
-   ch-curr[ccb-ccb_h.target_id].bytecount);
request-retries = 0;
request-timeout = (ccb-ccb_h.timeout + 999) / 1000;
callout_init_mtx(request-callout, ch-state_mtx, 
CALLOUT_RETURNUNLOCKED);
___
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: r243128 - stable/8/sys/dev/ata

2012-11-15 Thread Alexander Motin
Author: mav
Date: Fri Nov 16 03:08:23 2012
New Revision: 243128
URL: http://svnweb.freebsd.org/changeset/base/243128

Log:
  MFC r242422:
  Only four specific ATA PIO commands transfer several sectors per DRQ block
  (interrupt).  All other ATA PIO commands transfer one sector or 512 bytes
  at one time.  Hardcode these exceptions in ata(4) with ATA_CAM option.
  This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.

Modified:
  stable/8/sys/dev/ata/ata-all.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/ata/   (props changed)

Modified: stable/8/sys/dev/ata/ata-all.c
==
--- stable/8/sys/dev/ata/ata-all.c  Fri Nov 16 03:07:27 2012
(r243127)
+++ stable/8/sys/dev/ata/ata-all.c  Fri Nov 16 03:08:23 2012
(r243128)
@@ -1500,6 +1500,14 @@ ata_cam_begin_transaction(device_t dev, 
request-flags |= ATA_R_READ;
if ((ccb-ccb_h.flags  CAM_DIR_MASK) == CAM_DIR_OUT)
request-flags |= ATA_R_WRITE;
+   if (ccb-ataio.cmd.command == ATA_READ_MUL ||
+   ccb-ataio.cmd.command == ATA_READ_MUL48 ||
+   ccb-ataio.cmd.command == ATA_WRITE_MUL ||
+   ccb-ataio.cmd.command == ATA_WRITE_MUL48) {
+   request-transfersize = min(request-bytecount,
+   ch-curr[ccb-ccb_h.target_id].bytecount);
+   } else
+   request-transfersize = min(request-bytecount, 512);
} else {
request-data = ccb-csio.data_ptr;
request-bytecount = ccb-csio.dxfer_len;
@@ -1516,9 +1524,9 @@ ata_cam_begin_transaction(device_t dev, 
request-flags |= ATA_R_READ;
if ((ccb-ccb_h.flags  CAM_DIR_MASK) == CAM_DIR_OUT)
request-flags |= ATA_R_WRITE;
+   request-transfersize = min(request-bytecount,
+   ch-curr[ccb-ccb_h.target_id].bytecount);
}
-   request-transfersize = min(request-bytecount,
-   ch-curr[ccb-ccb_h.target_id].bytecount);
request-retries = 0;
request-timeout = (ccb-ccb_h.timeout + 999) / 1000;
callout_init_mtx(request-callout, ch-state_mtx, 
CALLOUT_RETURNUNLOCKED);
___
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: r243129 - head/bin/df

2012-11-15 Thread Greg Lehey
Author: grog
Date: Fri Nov 16 03:33:34 2012
New Revision: 243129
URL: http://svnweb.freebsd.org/changeset/base/243129

Log:
  Update man pages and clarify a number of options.
  Rework block count calculations to work correctly with small block sizes.
  
  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.1Fri Nov 16 03:08:23 2012(r243128)
+++ head/bin/df/df.1Fri Nov 16 03:33:34 2012(r243129)
@@ -29,7 +29,7 @@
 .\ @(#)df.1   8.3 (Berkeley) 5/8/95
 .\ $FreeBSD$
 .\
-.Dd March 3, 2012
+.Dd November 16, 2012
 .Dt DF 1
 .Os
 .Sh NAME
@@ -50,7 +50,8 @@ displays statistics about the amount of 
 or on the file system of which
 .Ar file
 is a part.
-Values are displayed in 512-byte per block counts.
+By default block counts are displayed with an assumed block size of
+512 bytes.
 If neither a file or a file system operand is specified,
 statistics for all mounted file systems are displayed
 (subject to the
@@ -65,46 +66,54 @@ Show all mount points, including those t
 flag.
 This is implied for file systems specified on the command line.
 .It Fl b
-Use 512-byte blocks rather than the default.
-This overrides the
+Explicitly use 512 byte blocks, overriding any
 .Ev BLOCKSIZE
 specification from the environment.
+This is the same as the
+.Fl P
+option.
+The
+.Fl k
+option overrides this option.
 .It Fl c
 Display a grand total.
 .It Fl g
-Use 1073741824-byte (1-Gbyte) blocks rather than the default.
-This overrides the
+Use 1073741824 byte (1 Gibibyte) blocks rather than the default.
+This overrides any
 .Ev BLOCKSIZE
 specification from the environment.
 .It Fl H
 .Dq Human-readable
 output.
-Use unit suffixes: Byte, Kilobyte, Megabyte,
-Gigabyte, Terabyte and Petabyte in order to reduce the number of
-digits to four or fewer using base 10 for sizes.
+Use unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte, Tebibyte and
+Pebibyte (based on powers of 1024) in order to reduce the number of
+digits to four or fewer.
 .It Fl h
 .Dq Human-readable
 output.
 Use unit suffixes: Byte, Kilobyte, Megabyte,
-Gigabyte, Terabyte and Petabyte in order to reduce the number of
-digits to four or fewer using base 2 for sizes.
-Inodes statistics, if enabled with
-.Fl i ,
-are always printed in base 10.
+Gigabyte, Terabyte and Petabyte (based on powers of 1000) in order to
+reduce the number of
+digits to four or fewer.
 .It Fl i
-Include statistics on the number of free inodes.
+Include statistics on the number of free and used inodes.
+In conjunction with the
+.Fl h
+or
+.Fl H
+options, the number of inodes is scaled by powers of 1000.
 .It Fl k
-Use 1024-byte (1-Kbyte) blocks rather than the default.
+Use 1024 byte (1 Kibibyte) blocks rather than the default.
 This overrides the
-.Ev BLOCKSIZE
-specification from the environment and the
 .Fl P
-option.
+option and any
+.Ev BLOCKSIZE
+specification from the environment.
 .It Fl l
 Only display information about locally-mounted file systems.
 .It Fl m
-Use 1048576-byte (1-Mbyte) blocks rather than the default.
-This overrides the
+Use 1048576 byte (1 Mebibyte) blocks rather than the default.
+This overrides any
 .Ev BLOCKSIZE
 specification from the environment.
 .It Fl n
@@ -117,10 +126,12 @@ When this option is specified,
 will not request new statistics from the file systems, but will respond
 with the possibly stale statistics that were previously obtained.
 .It Fl P
-Use POSIX compliant output of 512-byte blocks rather than the default.
-This overrides the
+Explicitly use 512 byte blocks, overriding any
 .Ev BLOCKSIZE
 specification from the environment.
+This is the same as the
+.Fl b
+option.
 The
 .Fl k
 option overrides this option.
@@ -160,9 +171,18 @@ option has no effect.
 .Sh ENVIRONMENT
 .Bl -tag -width BLOCKSIZE
 .It Ev BLOCKSIZE
-If the environment variable
-.Ev BLOCKSIZE
-is set, the block counts will be displayed in units of that size block.
+Specifies the units in which to report block counts.
+This uses
+.Xr getbsize 3 ,
+which allows units of bytes or numbers scaled with the letters
+.Em k
+(for multiples of 1024 bytes),
+.Em m
+(for multiples of 1048576 bytes) or
+.Em g
+(for gibibytes).
+The allowed range is 512 bytes to 1 GB.
+If the value is outside, it will be set to the appropriate limit.
 .El
 .Sh SEE ALSO
 .Xr lsvfs 1 ,
@@ -170,13 +190,12 @@ is set, the block counts will be display
 .Xr fstatfs 2 ,
 .Xr getfsstat 2 ,
 .Xr statfs 2 ,
+.Xr getbsize 3 ,
 .Xr getmntinfo 3 ,
 .Xr localeconv 3 ,
 .Xr fstab 5 ,
 .Xr mount 8 ,
-.Xr pstat 8 ,
-.Xr quot 8 ,
-.Xr swapinfo 8
+.Xr quot 8 .
 .Sh STANDARDS
 With the exception of most options,
 the
@@ -200,3 +219,13 @@ flag is ignored if a file or file system
 Also, if a mount
 point is not accessible by the user, it is possible that the file system
 information could be stale.
+.Pp
+The
+.Fl b
+and
+.Fl P
+options are identical.
+The former 

svn commit: r243130 - head/etc/root

2012-11-15 Thread Eitan Adler
Author: eadler
Date: Fri Nov 16 04:25:35 2012
New Revision: 243130
URL: http://svnweb.freebsd.org/changeset/base/243130

Log:
  dot.login is supposed to be for bourne shell, not csh
  
  Pointyhat to: me
  Approved by: cperciva (implicit)

Modified:
  head/etc/root/dot.login

Modified: head/etc/root/dot.login
==
--- head/etc/root/dot.login Fri Nov 16 03:33:34 2012(r243129)
+++ head/etc/root/dot.login Fri Nov 16 04:25:35 2012(r243130)
@@ -6,4 +6,4 @@
 #
 
 # Uncomment to display a random cookie each login:
-# if ( -x /usr/games/fortune ) /usr/games/fortune -s
+# [ -x /usr/games/fortune ]  /usr/games/fortune -s
___
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: r243131 - head/sys/vm

2012-11-15 Thread Konstantin Belousov
Author: kib
Date: Fri Nov 16 05:49:56 2012
New Revision: 243131
URL: http://svnweb.freebsd.org/changeset/base/243131

Log:
  Explicitely state that M_USE_RESERVE requires M_NOWAIT, using assertion.
  
  Reviewed by:  alc
  MFC after:2 weeks

Modified:
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Fri Nov 16 04:25:35 2012(r243130)
+++ head/sys/vm/vm_page.h   Fri Nov 16 05:49:56 2012(r243131)
@@ -353,6 +353,9 @@ malloc2vm_flags(int malloc_flags)
 {
int pflags;
 
+   KASSERT((malloc_flags  M_USE_RESERVE) == 0 ||
+   (malloc_flags  M_NOWAIT) != 0,
+   (M_USE_RESERVE requires M_NOWAIT));
pflags = (malloc_flags  M_USE_RESERVE) != 0 ? VM_ALLOC_INTERRUPT :
VM_ALLOC_SYSTEM;
if ((malloc_flags  M_ZERO) != 0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243132 - in head/sys: amd64/amd64 arm/arm sparc64/sparc64 vm

2012-11-15 Thread Konstantin Belousov
Author: kib
Date: Fri Nov 16 05:55:56 2012
New Revision: 243132
URL: http://svnweb.freebsd.org/changeset/base/243132

Log:
  Move the declaration of vm_phys_paddr_to_vm_page() from vm/vm_page.h
  to vm/vm_phys.h, where it belongs.
  
  Requested and reviewed by:alc
  MFC after:2 weeks

Modified:
  head/sys/amd64/amd64/minidump_machdep.c
  head/sys/arm/arm/pmap.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/vm/device_pager.c
  head/sys/vm/sg_pager.c
  head/sys/vm/vm_page.h
  head/sys/vm/vm_phys.h

Modified: head/sys/amd64/amd64/minidump_machdep.c
==
--- head/sys/amd64/amd64/minidump_machdep.c Fri Nov 16 05:49:56 2012
(r243131)
+++ head/sys/amd64/amd64/minidump_machdep.c Fri Nov 16 05:55:56 2012
(r243132)
@@ -40,6 +40,7 @@ __FBSDID($FreeBSD$);
 #include sys/watchdog.h
 #include vm/vm.h
 #include vm/vm_page.h
+#include vm/vm_phys.h
 #include vm/pmap.h
 #include machine/atomic.h
 #include machine/elf.h

Modified: head/sys/arm/arm/pmap.c
==
--- head/sys/arm/arm/pmap.c Fri Nov 16 05:49:56 2012(r243131)
+++ head/sys/arm/arm/pmap.c Fri Nov 16 05:55:56 2012(r243132)
@@ -165,6 +165,7 @@ __FBSDID($FreeBSD$);
 #include vm/vm_map.h
 #include vm/vm_page.h
 #include vm/vm_pageout.h
+#include vm/vm_phys.h
 #include vm/vm_extern.h
 
 #include machine/md_var.h

Modified: head/sys/sparc64/sparc64/pmap.c
==
--- head/sys/sparc64/sparc64/pmap.c Fri Nov 16 05:49:56 2012
(r243131)
+++ head/sys/sparc64/sparc64/pmap.c Fri Nov 16 05:55:56 2012
(r243132)
@@ -83,6 +83,7 @@ __FBSDID($FreeBSD$);
 #include vm/vm_extern.h
 #include vm/vm_pageout.h
 #include vm/vm_pager.h
+#include vm/vm_phys.h
 
 #include machine/cache.h
 #include machine/frame.h

Modified: head/sys/vm/device_pager.c
==
--- head/sys/vm/device_pager.c  Fri Nov 16 05:49:56 2012(r243131)
+++ head/sys/vm/device_pager.c  Fri Nov 16 05:55:56 2012(r243132)
@@ -51,6 +51,7 @@ __FBSDID($FreeBSD$);
 #include vm/vm_object.h
 #include vm/vm_page.h
 #include vm/vm_pager.h
+#include vm/vm_phys.h
 #include vm/uma.h
 
 static void dev_pager_init(void);

Modified: head/sys/vm/sg_pager.c
==
--- head/sys/vm/sg_pager.c  Fri Nov 16 05:49:56 2012(r243131)
+++ head/sys/vm/sg_pager.c  Fri Nov 16 05:55:56 2012(r243132)
@@ -42,6 +42,7 @@ __FBSDID($FreeBSD$);
 #include vm/vm_object.h
 #include vm/vm_page.h
 #include vm/vm_pager.h
+#include vm/vm_phys.h
 #include vm/uma.h
 
 static vm_object_t sg_pager_alloc(void *, vm_ooffset_t, vm_prot_t,

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Fri Nov 16 05:49:56 2012(r243131)
+++ head/sys/vm/vm_page.h   Fri Nov 16 05:55:56 2012(r243132)
@@ -324,8 +324,6 @@ extern long first_page; /* first physi
 
 #define VM_PAGE_TO_PHYS(entry) ((entry)-phys_addr)
 
-vm_page_t vm_phys_paddr_to_vm_page(vm_paddr_t pa);
-
 vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa);
 
 /* page allocation classes: */

Modified: head/sys/vm/vm_phys.h
==
--- head/sys/vm/vm_phys.h   Fri Nov 16 05:49:56 2012(r243131)
+++ head/sys/vm/vm_phys.h   Fri Nov 16 05:55:56 2012(r243132)
@@ -64,6 +64,7 @@ vm_page_t vm_phys_fictitious_to_vm_page(
 void vm_phys_free_contig(vm_page_t m, u_long npages);
 void vm_phys_free_pages(vm_page_t m, int order);
 void vm_phys_init(void);
+vm_page_t vm_phys_paddr_to_vm_page(vm_paddr_t pa);
 void vm_phys_set_pool(int pool, vm_page_t m, int order);
 boolean_t vm_phys_unfree_page(vm_page_t m);
 boolean_t vm_phys_zero_pages_idle(void);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r243130 - head/etc/root

2012-11-15 Thread Jan Beich
Eitan Adler ead...@freebsd.org writes:

 Author: eadler
 Date: Fri Nov 16 04:25:35 2012
 New Revision: 243130
 URL: http://svnweb.freebsd.org/changeset/base/243130

 Log:
   dot.login is supposed to be for bourne shell, not csh

Can you explain better or point to the reference? sh(1) mentions
~/.profile while csh(1) mentions ~/.login for commands executed
once per login.

Besides, dot.login is not installed WITHOUT_TCSH.

  # /usr/src/etc/Makefile
  .if ${MK_TCSH} != no
  cd ${.CURDIR}/root; \
  ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
  dot.cshrc ${DESTDIR}/root/.cshrc; \
  ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
  dot.login ${DESTDIR}/root/.login; \
  rm -f ${DESTDIR}/.cshrc; \
  ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
  .endif

   
   Pointyhat to: me
   Approved by: cperciva (implicit)

 Modified:
   head/etc/root/dot.login

 Modified: head/etc/root/dot.login
 ==
 --- head/etc/root/dot.login   Fri Nov 16 03:33:34 2012(r243129)
 +++ head/etc/root/dot.login   Fri Nov 16 04:25:35 2012(r243130)
 @@ -6,4 +6,4 @@
  #
  
  # Uncomment to display a random cookie each login:
 -# if ( -x /usr/games/fortune ) /usr/games/fortune -s
 +# [ -x /usr/games/fortune ]  /usr/games/fortune -s
___
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: r243133 - in head/sys: compat/freebsd32 kern

2012-11-15 Thread Konstantin Belousov
Author: kib
Date: Fri Nov 16 06:22:14 2012
New Revision: 243133
URL: http://svnweb.freebsd.org/changeset/base/243133

Log:
  Style fixes for r242958.
  
  Reported and reviewed by: bde
  MFC after:28 days

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/kern_exit.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Fri Nov 16 05:55:56 2012
(r243132)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Fri Nov 16 06:22:14 2012
(r243133)
@@ -193,13 +193,11 @@ freebsd32_wait6(struct thread *td, struc
wrup = wru;
else
wrup = NULL;
-
if (uap-info != NULL) {
sip = si;
bzero(sip, sizeof(*sip));
} else
sip = NULL;
-
error = kern_wait6(td, uap-idtype, uap-id, status, uap-options,
wrup, sip);
if (error != 0)

Modified: head/sys/kern/kern_exit.c
==
--- head/sys/kern/kern_exit.c   Fri Nov 16 05:55:56 2012(r243132)
+++ head/sys/kern/kern_exit.c   Fri Nov 16 06:22:14 2012(r243133)
@@ -710,10 +710,10 @@ int
 sys_wait6(struct thread *td, struct wait6_args *uap)
 {
struct __wrusage wru, *wrup;
-   siginfo_t  si, *sip;
-   int error, status;
+   siginfo_t si, *sip;
idtype_t idtype;
id_t id;
+   int error, status;
 
idtype = uap-idtype;
id = uap-id;
@@ -932,7 +932,6 @@ proc_to_reap(struct thread *td, struct p
default:
PROC_UNLOCK(p);
return (0);
-   break;
}
 
if (p_canwait(td, p)) {
@@ -962,7 +961,7 @@ proc_to_reap(struct thread *td, struct p
PROC_SLOCK(p);
 
if (siginfo != NULL) {
-   bzero (siginfo, sizeof (*siginfo));
+   bzero(siginfo, sizeof(*siginfo));
siginfo-si_errno = 0;
 
/*
@@ -1046,8 +1045,8 @@ kern_wait(struct thread *td, pid_t pid, 
else
wrup = NULL;
/*
-*  For backward compatibility we implicitly add flags WEXITED
-*  and WTRAPPED here.
+* For backward compatibility we implicitly add flags WEXITED
+* and WTRAPPED here.
 */
options |= WEXITED | WTRAPPED;
ret = kern_wait6(td, idtype, id, status, options, wrup, NULL);
@@ -1069,8 +1068,7 @@ kern_wait6(struct thread *td, idtype_t i
 
q = td-td_proc;
 
-   if ((pid_t)id == WAIT_MYPGRP 
-   (idtype == P_PID || idtype == P_PGID)) {
+   if ((pid_t)id == WAIT_MYPGRP  (idtype == P_PID || idtype == P_PGID)) {
id = (id_t)q-p_pgid;
idtype = P_PGID;
}
___
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: r243134 - head/sys/sys

2012-11-15 Thread Konstantin Belousov
Author: kib
Date: Fri Nov 16 06:25:20 2012
New Revision: 243134
URL: http://svnweb.freebsd.org/changeset/base/243134

Log:
  Alphabetically reorder the forward-declarations of the structures.
  Add the declaration for enum idtype, to be used later.
  
  Reported and reviewed by: bde
  MFC after:28 days

Modified:
  head/sys/sys/syscallsubr.h

Modified: head/sys/sys/syscallsubr.h
==
--- head/sys/sys/syscallsubr.h  Fri Nov 16 06:22:14 2012(r243133)
+++ head/sys/sys/syscallsubr.h  Fri Nov 16 06:25:20 2012(r243134)
@@ -35,25 +35,26 @@
 #include sys/mount.h
 
 struct file;
+enum idtype;
 struct itimerval;
 struct image_args;
 struct jail;
+struct kevent;
+struct kevent_copyops;
+struct kld_file_stat;
+struct ksiginfo;
 struct mbuf;
 struct msghdr;
 struct msqid_ds;
+struct ogetdirentries_args;
 struct rlimit;
 struct rusage;
-struct __wrusage;
 union semun;
+struct sendfile_args;
 struct sockaddr;
 struct stat;
-struct kevent;
-struct kevent_copyops;
-struct kld_file_stat;
-struct ksiginfo;
-struct sendfile_args;
 struct thr_param;
-struct ogetdirentries_args;
+struct __wrusage;
 
 intkern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg,
u_int buflen);
___
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: r243135 - head/sys/sys

2012-11-15 Thread Konstantin Belousov
Author: kib
Date: Fri Nov 16 06:29:52 2012
New Revision: 243135
URL: http://svnweb.freebsd.org/changeset/base/243135

Log:
  Move the definition of the idtype_t from sys/types.h to sys/wait.h.
  Fix the bug, use #if __BSD_VISIBLE instead of #if defined(__BSD_VISIBLE),
  since __BSD_VISIBLE is always defined.
  Reformat the comments from the Solaris style to KNF.
  
  Reported and reviewed by: bde
  MFC after:28 days

Modified:
  head/sys/sys/syscallsubr.h
  head/sys/sys/types.h
  head/sys/sys/wait.h

Modified: head/sys/sys/syscallsubr.h
==
--- head/sys/sys/syscallsubr.h  Fri Nov 16 06:25:20 2012(r243134)
+++ head/sys/sys/syscallsubr.h  Fri Nov 16 06:29:52 2012(r243135)
@@ -236,7 +236,7 @@ int kern_utimesat(struct thread *td, int
enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg);
 intkern_wait(struct thread *td, pid_t pid, int *status, int options,
struct rusage *rup);
-intkern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status,
+intkern_wait6(struct thread *td, enum idtype idtype, id_t id, int *status,
int options, struct __wrusage *wrup, siginfo_t *sip);
 intkern_writev(struct thread *td, int fd, struct uio *auio);
 intkern_socketpair(struct thread *td, int domain, int type, int protocol,

Modified: head/sys/sys/types.h
==
--- head/sys/sys/types.hFri Nov 16 06:25:20 2012(r243134)
+++ head/sys/sys/types.hFri Nov 16 06:29:52 2012(r243135)
@@ -141,46 +141,6 @@ typedef__id_t  id_t;   /* can hold a 
uid
 #define_ID_T_DECLARED
 #endif
 
-#ifndef _IDTYPE_T_DECLARED
-
-typedef enum
-#if defined(__BSD_VISIBLE)
-   idtype  /* pollutes XPG4.2 namespace */
-#endif
-   {
-   /*
-* These names were mostly lifted from Solaris source code and
-* still use Solaris style naming to avoid breaking any
-* OpenSolaris code which has been ported to FreeBSD.  There
-* is no clear FreeBSD counterpart for all of the names, but
-* some have a clear correspondence to FreeBSD entities.
-*/
-   P_PID,  /* A process identifier.*/
-   P_PPID, /* A parent process identifier. */
-   P_PGID, /* A process group identifier.  */
-   P_SID,  /* A session identifier.*/
-   P_CID,  /* A scheduling class identifier.   */
-   P_UID,  /* A user identifier.   */
-   P_GID,  /* A group identifier.  */
-   P_ALL,  /* All processes.   */
-   P_LWPID,/* An LWP identifier.   */
-   P_TASKID,   /* A task identifier.   */
-   P_PROJID,   /* A project identifier.*/
-   P_POOLID,   /* A pool identifier.   */
-   P_JAILID,   /* A zone identifier.   */
-   P_CTID, /* A (process) contract identifier. */
-   P_CPUID,/* CPU identifier.  */
-   P_PSETID/* Processor set identifier */
-} idtype_t;/* The type of id_t we are using.   */
-
-#if defined(__BSD_VISIBLE)
-#defineP_ZONEIDP_JAILID
-#endif
-
-#define_IDTYPE_T_DECLARED
-#endif
-
-
 #ifndef _INO_T_DECLARED
 typedef__ino_t ino_t;  /* inode number */
 #define_INO_T_DECLARED

Modified: head/sys/sys/wait.h
==
--- head/sys/sys/wait.h Fri Nov 16 06:25:20 2012(r243134)
+++ head/sys/sys/wait.h Fri Nov 16 06:29:52 2012(r243135)
@@ -88,6 +88,46 @@
 #defineWLINUXCLONE 0x8000  /* Wait for kthread spawned from 
linux_clone. */
 #endif
 
+#ifndef _IDTYPE_T_DECLARED
+typedef enum
+#if __BSD_VISIBLE
+   idtype  /* pollutes XPG4.2 namespace */
+#endif
+   {
+   /*
+* These names were mostly lifted from Solaris source code and
+* still use Solaris style naming to avoid breaking any
+* OpenSolaris code which has been ported to FreeBSD.  There
+* is no clear FreeBSD counterpart for all of the names, but
+* some have a clear correspondence to FreeBSD entities.
+*
+* The numerical values are kept synchronized with the Solaris
+* values.
+*/
+   P_PID,  /* A process identifier. */
+   P_PPID, /* A parent process identifier. */
+   P_PGID, /* A process group identifier. */
+   P_SID,  /* A session identifier. */
+   P_CID,  /* A scheduling class identifier. */
+   P_UID,   

svn commit: r243136 - head/sys/kern

2012-11-15 Thread Konstantin Belousov
Author: kib
Date: Fri Nov 16 06:32:38 2012
New Revision: 243136
URL: http://svnweb.freebsd.org/changeset/base/243136

Log:
  Restore the proper handling of the pid 0 for waitpid(2).
  Fix the style around.
  
  Reported and reviewed by: bde (previous version)
  MFC after:28 days

Modified:
  head/sys/kern/kern_exit.c

Modified: head/sys/kern/kern_exit.c
==
--- head/sys/kern/kern_exit.c   Fri Nov 16 06:29:52 2012(r243135)
+++ head/sys/kern/kern_exit.c   Fri Nov 16 06:32:38 2012(r243136)
@@ -1024,6 +1024,7 @@ kern_wait(struct thread *td, pid_t pid, 
 struct rusage *rusage)
 {
struct __wrusage wru, *wrup;
+   struct proc *q;
idtype_t idtype;
id_t id;
int ret;
@@ -1031,12 +1032,16 @@ kern_wait(struct thread *td, pid_t pid, 
if (pid == WAIT_ANY) {
idtype = P_ALL;
id = 0;
-   }
-   else if (pid = 0) {
+   } else if (pid == WAIT_MYPGRP) {
+   idtype = P_PGID;
+   q = td-td_proc;
+   PROC_LOCK(q);
+   id = (id_t)q-p_pgid;
+   PROC_UNLOCK(q);
+   } else if (pid  0) {
idtype = P_PGID;
id = (id_t)-pid;
-   }
-   else {
+   } else {
idtype = P_PID;
id = (id_t)pid;
}
___
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: r243137 - head/share/man/man9

2012-11-15 Thread Alan Cox
Author: alc
Date: Fri Nov 16 06:40:40 2012
New Revision: 243137
URL: http://svnweb.freebsd.org/changeset/base/243137

Log:
  M_USE_RESERVE is no longer deprecated.  It is once again supported.
  
  Reviewed by:  kib

Modified:
  head/share/man/man9/malloc.9

Modified: head/share/man/man9/malloc.9
==
--- head/share/man/man9/malloc.9Fri Nov 16 06:32:38 2012
(r243136)
+++ head/share/man/man9/malloc.9Fri Nov 16 06:40:40 2012
(r243137)
@@ -29,7 +29,7 @@
 .\ $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $
 .\ $FreeBSD$
 .\
-.Dd January 28, 2012
+.Dd November 15, 2012
 .Dt MALLOC 9
 .Os
 .Sh NAME
@@ -153,13 +153,12 @@ if
 .Dv M_WAITOK
 is specified.
 .It Dv M_USE_RESERVE
-Indicates that the system can dig into its reserve in order to obtain the
-requested memory.
-This option used to be called
-.Dv M_KERNEL
-but has been renamed to something more obvious.
-This option has been deprecated and is slowly being removed from the kernel,
-and so should not be used with any new programming.
+Indicates that the system can use its reserve of memory to satisfy the
+request.
+This option should only be used in combination with 
+.Dv M_NOWAIT
+when an allocation failure cannot be tolerated by the caller without
+catastrophic effects on the system.
 .El
 .Pp
 Exactly one of either
___
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: r243138 - head/sys/dev/sound/pcm

2012-11-15 Thread Alexander Motin
Author: mav
Date: Fri Nov 16 07:05:57 2012
New Revision: 243138
URL: http://svnweb.freebsd.org/changeset/base/243138

Log:
  For some more completeness add matrixes for 3.1 and 7.0 channel setups.

Modified:
  head/sys/dev/sound/pcm/channel.c
  head/sys/dev/sound/pcm/feeder_matrix.c
  head/sys/dev/sound/pcm/matrix.h
  head/sys/dev/sound/pcm/matrix_map.h

Modified: head/sys/dev/sound/pcm/channel.c
==
--- head/sys/dev/sound/pcm/channel.cFri Nov 16 06:40:40 2012
(r243137)
+++ head/sys/dev/sound/pcm/channel.cFri Nov 16 07:05:57 2012
(r243138)
@@ -1037,12 +1037,14 @@ static const struct {
{ 2.0,  2, stereo, SND_CHN_MATRIX_2_0 },
{ 2.1, NULL, NULL, SND_CHN_MATRIX_2_1 },
{ 3.0,  3, NULL, SND_CHN_MATRIX_3_0 },
+   { 3.1, NULL, NULL, SND_CHN_MATRIX_3_1 },
{ 4.0,  4,   quad, SND_CHN_MATRIX_4_0 },
{ 4.1, NULL, NULL, SND_CHN_MATRIX_4_1 },
{ 5.0,  5, NULL, SND_CHN_MATRIX_5_0 },
{ 5.1,  6, NULL, SND_CHN_MATRIX_5_1 },
{ 6.0, NULL, NULL, SND_CHN_MATRIX_6_0 },
{ 6.1,  7, NULL, SND_CHN_MATRIX_6_1 },
+   { 7.0, NULL, NULL, SND_CHN_MATRIX_7_0 },
{ 7.1,  8, NULL, SND_CHN_MATRIX_7_1 },
{  NULL, NULL, NULL, SND_CHN_MATRIX_UNKNOWN }
 };

Modified: head/sys/dev/sound/pcm/feeder_matrix.c
==
--- head/sys/dev/sound/pcm/feeder_matrix.c  Fri Nov 16 06:40:40 2012
(r243137)
+++ head/sys/dev/sound/pcm/feeder_matrix.c  Fri Nov 16 07:05:57 2012
(r243138)
@@ -86,12 +86,14 @@ static struct pcmchan_matrix feeder_matr
[SND_CHN_MATRIX_2_0] = SND_CHN_MATRIX_MAP_2_0,
[SND_CHN_MATRIX_2_1] = SND_CHN_MATRIX_MAP_2_1,
[SND_CHN_MATRIX_3_0] = SND_CHN_MATRIX_MAP_3_0,
+   [SND_CHN_MATRIX_3_1] = SND_CHN_MATRIX_MAP_3_1,
[SND_CHN_MATRIX_4_0] = SND_CHN_MATRIX_MAP_4_0,
[SND_CHN_MATRIX_4_1] = SND_CHN_MATRIX_MAP_4_1,
[SND_CHN_MATRIX_5_0] = SND_CHN_MATRIX_MAP_5_0,
[SND_CHN_MATRIX_5_1] = SND_CHN_MATRIX_MAP_5_1,
[SND_CHN_MATRIX_6_0] = SND_CHN_MATRIX_MAP_6_0,
[SND_CHN_MATRIX_6_1] = SND_CHN_MATRIX_MAP_6_1,
+   [SND_CHN_MATRIX_7_0] = SND_CHN_MATRIX_MAP_7_0,
[SND_CHN_MATRIX_7_1] = SND_CHN_MATRIX_MAP_7_1
 };
 

Modified: head/sys/dev/sound/pcm/matrix.h
==
--- head/sys/dev/sound/pcm/matrix.h Fri Nov 16 06:40:40 2012
(r243137)
+++ head/sys/dev/sound/pcm/matrix.h Fri Nov 16 07:05:57 2012
(r243138)
@@ -134,29 +134,31 @@
 #define SND_CHN_MATRIX_3_0 3
 #define SND_CHN_MATRIX_3   SND_CHN_MATRIX_3_0
 
-/* 4 @ 4.0 Quadraphonic */
-#define SND_CHN_MATRIX_4_0 4
+/* 4 @ 3.1 (lfe), 4.0 (Quadraphonic, DEFAULT) */
+#define SND_CHN_MATRIX_3_1 4
+#define SND_CHN_MATRIX_4_0 5
 #define SND_CHN_MATRIX_4   SND_CHN_MATRIX_4_0
 
 /* 5 @ 4.1 (lfe), 5.0 (center, DEFAULT) */
-#define SND_CHN_MATRIX_4_1 5
-#define SND_CHN_MATRIX_5_0 6
+#define SND_CHN_MATRIX_4_1 6
+#define SND_CHN_MATRIX_5_0 7
 #define SND_CHN_MATRIX_5   SND_CHN_MATRIX_5_0
 
 /* 6 @ 5.1 (lfe, DEFAULT), 6.0 (rear center) */
-#define SND_CHN_MATRIX_5_1 7
-#define SND_CHN_MATRIX_6_0 8
+#define SND_CHN_MATRIX_5_1 8
+#define SND_CHN_MATRIX_6_0 9
 #define SND_CHN_MATRIX_6   SND_CHN_MATRIX_5_1
 
-/* 7 @ 6.1 (lfe) */
-#define SND_CHN_MATRIX_6_1 9
+/* 7 @ 6.1 (lfe, DEFAULT), 7.0 */
+#define SND_CHN_MATRIX_6_1 10
+#define SND_CHN_MATRIX_7_0 11
 #define SND_CHN_MATRIX_7   SND_CHN_MATRIX_6_1
 
 /* 8 @ 7.1 (lfe) */
-#define SND_CHN_MATRIX_7_1 10
+#define SND_CHN_MATRIX_7_1 12
 #define SND_CHN_MATRIX_8   SND_CHN_MATRIX_7_1
 
-#define SND_CHN_MATRIX_MAX 11
+#define SND_CHN_MATRIX_MAX 13
 
 #define SND_CHN_MATRIX_BEGIN   SND_CHN_MATRIX_1_0
 #define SND_CHN_MATRIX_END SND_CHN_MATRIX_7_1

Modified: head/sys/dev/sound/pcm/matrix_map.h
==
--- head/sys/dev/sound/pcm/matrix_map.h Fri Nov 16 06:40:40 2012
(r243137)
+++ head/sys/dev/sound/pcm/matrix_map.h Fri Nov 16 07:05:57 2012
(r243138)
@@ -195,6 +195,49 @@
-1, -1, -1, -1, -1, -1, -1, -1, -1  }   \
 }
 
+#define SND_CHN_MATRIX_MAP_3_1 {   \
+   .id = SND_CHN_MATRIX_3_1,   \
+   .channels = 4,  \
+   .ext = 1,   \
+   .map = {\
+   /* Left */  \
+   [0] = { \

svn commit: r243139 - in stable/9/sys/amd64: amd64 include

2012-11-15 Thread Konstantin Belousov
Author: kib
Date: Fri Nov 16 07:07:00 2012
New Revision: 243139
URL: http://svnweb.freebsd.org/changeset/base/243139

Log:
  MFC r242432:
  Provide the reading and display of the Standard Extended Features,
  introduced with the IvyBridge CPUs.  Provide the definitions for new
  bits in CR3 and CR4 registers.

Modified:
  stable/9/sys/amd64/amd64/identcpu.c
  stable/9/sys/amd64/amd64/initcpu.c
  stable/9/sys/amd64/include/md_var.h
  stable/9/sys/amd64/include/specialreg.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/amd64/amd64/identcpu.c
==
--- stable/9/sys/amd64/amd64/identcpu.c Fri Nov 16 07:05:57 2012
(r243138)
+++ stable/9/sys/amd64/amd64/identcpu.c Fri Nov 16 07:07:00 2012
(r243139)
@@ -384,6 +384,18 @@ printcpuinfo(void)
);
}
 
+   if (cpu_stdext_feature != 0) {
+   printf(\n  Standard Extended Features=0x%b,
+   cpu_stdext_feature,
+  \020
+  \001GSFSBASE
+  \002TSCADJ
+  \010SMEP
+  \012ENHMOVSB
+  \013INVPCID
+  );
+   }
+
if (via_feature_rng != 0 || via_feature_xcrypt != 0)
print_via_padlock_info();
 
@@ -501,6 +513,11 @@ identify_cpu(void)
}
}
 
+   if (cpu_high = 7) {
+   cpuid_count(7, 0, regs);
+   cpu_stdext_feature = regs[1];
+   }
+
if (cpu_vendor_id == CPU_VENDOR_INTEL ||
cpu_vendor_id == CPU_VENDOR_AMD ||
cpu_vendor_id == CPU_VENDOR_CENTAUR) {

Modified: stable/9/sys/amd64/amd64/initcpu.c
==
--- stable/9/sys/amd64/amd64/initcpu.c  Fri Nov 16 07:05:57 2012
(r243138)
+++ stable/9/sys/amd64/amd64/initcpu.c  Fri Nov 16 07:07:00 2012
(r243139)
@@ -72,6 +72,7 @@ u_int cpu_vendor_id;  /* CPU vendor ID *
 u_int  cpu_fxsr;   /* SSE enabled */
 u_int  cpu_mxcsr_mask; /* Valid bits in mxcsr */
 u_int  cpu_clflush_line_size = 32;
+u_int  cpu_stdext_feature;
 u_int  cpu_max_ext_state_size;
 
 SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD,

Modified: stable/9/sys/amd64/include/md_var.h
==
--- stable/9/sys/amd64/include/md_var.h Fri Nov 16 07:05:57 2012
(r243138)
+++ stable/9/sys/amd64/include/md_var.h Fri Nov 16 07:07:00 2012
(r243139)
@@ -48,6 +48,7 @@ externu_int   amd_pminfo;
 extern u_int   via_feature_rng;
 extern u_int   via_feature_xcrypt;
 extern u_int   cpu_clflush_line_size;
+extern u_int   cpu_stdext_feature;
 extern u_int   cpu_fxsr;
 extern u_int   cpu_high;
 extern u_int   cpu_id;

Modified: stable/9/sys/amd64/include/specialreg.h
==
--- stable/9/sys/amd64/include/specialreg.h Fri Nov 16 07:05:57 2012
(r243138)
+++ stable/9/sys/amd64/include/specialreg.h Fri Nov 16 07:07:00 2012
(r243139)
@@ -52,6 +52,8 @@
 #defineCR0_NW  0x2000  /* Not Write-through */
 #defineCR0_CD  0x4000  /* Cache Disable */
 
+#defineCR3_PCID_SAVE 0x8000
+
 /*
  * Bits in PPro special registers
  */
@@ -66,7 +68,10 @@
 #defineCR4_PCE 0x0100  /* Performance monitoring counter 
enable */
 #defineCR4_FXSR 0x0200 /* Fast FPU save/restore used by OS */
 #defineCR4_XMM 0x0400  /* enable SIMD/MMX2 to use except 16 */
+#defineCR4_FSGSBASE 0x0001 /* Enable FS/GS BASE accessing 
instructions */
+#defineCR4_PCIDE 0x0002/* Enable Context ID */
 #defineCR4_XSAVE 0x0004/* XSETBV/XGETBV */
+#defineCR4_SMEP 0x0010 /* Supervisor-Mode Execution Prevention 
*/
 
 /*
  * Bits in AMD64 special registers.  EFER is 64 bits wide.
@@ -261,6 +266,12 @@
 #defineAMDID_COREID_SIZE   0xf000
 #defineAMDID_COREID_SIZE_SHIFT 12
 
+#defineCPUID_STDEXT_FSGSBASE   0x0001
+#defineCPUID_STDEXT_TSC_ADJUST 0x0002
+#defineCPUID_STDEXT_SMEP   0x0080
+#defineCPUID_STDEXT_ENH_MOVSB  0x0200
+#defineCPUID_STDEXT_INVPCID0x0400
+
 /*
  * CPUID manufacturers identifiers
  */
___
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