Re: svn commit: r241755 - head/lib/msun/src

2012-10-19 Thread Bruce Evans

On Fri, 19 Oct 2012, Warner Losh wrote:


Log:
 Document the methods used to compute logf. Taken and edited from the
 double version, with adaptations for the differences between it and
 the float version.


Please back this out.

This was intentionally left out.  It is painful to maintain large
comments that should be identical for all precisions.  Double precision
is primary, and only comments that depend on the precision should be
given in other precisions, except for short comments to to right of
coulde whose non-duplication would just give larger diffs.  If you
want to duplicate them, then they would often have to be quadruplicated
in 4 files for the 4 supported precisions:
- double precision
- float precision
- long double with MANT_DIG = 64 and 16 other bits
- long double with MANT_DIG = 113 and 15 other bits
Only 4 now, but there could easily be variations for long doubles.

log* will be replaced by my version soon.  One of the organizational
things that I'm currently struggling with is how not to duplicate the
comments in them.  Currently I duplicate then in 4 files, and don't
quite duplicate then in a 5th file for optimized float precision.
Maintaining them has been very painful.  They are about 3 times as large
as the comments here, and have more and more-delicate precision-dependent
details, so trimming them is harder than here.  They do cover all of
log*(), log1p*(), log2*() and log10*() in the same file, so there is
not as much duplication as for the different e_log*.c files.

Another organizational problem is how to organize the functions.  I
currently have 4 primary interfaces per file (should have a couple
more for kernels), and 1 file for each precision, and currently use
inlines and ifdefs to avoid these inlines, but the inlines are
not properly optimized for all cases of interest, and break debugging
in most cases, so I plan to switch to more macro hackery (like multiple
#include __FILE__'s with ifdefs to select what is compiled for each
#include) .  Even more macro hackery would let me put support for all
precisions in the same files, so duplicated comments would be even less
useful, but the precision-dependent ones would be even harder to write
and read.

We are developing inverse trig functions, and handle the comments and
other things by generating code for all precisions from the double
precision case.  Large comments are stripped as part of the generation.
This is easier to write but not so good to read.  This is only feasible
because the code is not very precision-dependent.


Modified: head/lib/msun/src/e_logf.c
==
--- head/lib/msun/src/e_logf.c  Fri Oct 19 22:21:01 2012(r241754)
+++ head/lib/msun/src/e_logf.c  Fri Oct 19 22:46:48 2012(r241755)
@@ -19,6 +19,57 @@ __FBSDID("$FreeBSD$");
#include "math.h"
#include "math_private.h"

+/* __ieee754_log(x)


Here the comment doesn't even match the code.  This is __ieee754_logf(x),
not __ieee754_log().  Technically, this is a comment that depends on the
precision, so it should be given separately, but the differences for type
suffixes are especially painful to maintain in comments and especially
useless to document in comments.


+ * Return the logrithm of x


This duplicates e_log.c to a fault.  Fixing this spelling error would
require touching multiple files.


+ *
+ * Method :
+ *   1. Argument Reduction: find k and f such that
+ *  x = 2^k * (1+f),
+ * where  sqrt(2)/2 < 1+f < sqrt(2) .
+ *
+ *   2. Approximation of log(1+f).
+ *  Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
+ *   = 2s + 2/3 s**3 + 2/5 s**5 + .,
+ *   = 2s + s*R


Nothing new here.  I don't want to see it again.


+ *  We use a special Reme algorithm on [0,0.1716] to generate
+ *  a polynomial of degree 8 to approximate R The maximum error
+ *  of this polynomial approximation is bounded by 2**-34.24. In
+ *  other words,


Lots more spelling and grammar errors.  I'm not sure if the correct spelling
is Remez or Remes, but I'm sure it isn't Reme.  One sentence break is
missing a "." and the others are consistently too short.

The 2**-34.24 number is precision-dependent and is documented in more
completely below using my automatically generated comment that gives a
consistent format.  (I haven't merged this improvement back into e_log.c.)
Now there is duplication even within the same file :-(.


+ *  2  4  6  8
+ *  R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s


The number of coeffs is indeed precision-dependent, but uninteresting.
My constent format for poly coeffs doesn't mention them in comments.
It is enough to spell the constants for them in a consistent way
(consistent across all sources, not just log*).


+ *  (the values of Lg1 to Lg7 are listed in the program)


Here the comment doesn't even match the code.  There is no Lg5 to
Lg7 for float precis

svn commit: r241759 - head/sys/dev/mps

2012-10-19 Thread John W. De Boskey
Author: jwd
Date: Fri Oct 19 23:42:45 2012
New Revision: 241759
URL: http://svn.freebsd.org/changeset/base/241759

Log:
  Don't lose the 255'th disk behind the initiator.
  
  Reviewed by:  ken@
  MFC after:1 month

Modified:
  head/sys/dev/mps/mps_sas.c

Modified: head/sys/dev/mps/mps_sas.c
==
--- head/sys/dev/mps/mps_sas.c  Fri Oct 19 23:10:55 2012(r241758)
+++ head/sys/dev/mps/mps_sas.c  Fri Oct 19 23:42:45 2012(r241759)
@@ -918,7 +918,7 @@ mpssas_action(struct cam_sim *sim, union
cpi->hba_eng_cnt = 0;
cpi->max_target = sassc->sc->facts->MaxTargets - 1;
cpi->max_lun = 255;
-   cpi->initiator_id = 255;
+   cpi->initiator_id = sassc->sc->facts->MaxTargets - 1;
strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
strncpy(cpi->hba_vid, "LSILogic", HBA_IDLEN);
strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241758 - head/sys/dev/pci

2012-10-19 Thread Warner Losh
Author: imp
Date: Fri Oct 19 23:10:55 2012
New Revision: 241758
URL: http://svn.freebsd.org/changeset/base/241758

Log:
  Add missing Extended Capability ID Numbers from PCIe 3.0.

Modified:
  head/sys/dev/pci/pcireg.h

Modified: head/sys/dev/pci/pcireg.h
==
--- head/sys/dev/pci/pcireg.h   Fri Oct 19 22:48:22 2012(r241757)
+++ head/sys/dev/pci/pcireg.h   Fri Oct 19 23:10:55 2012(r241758)
@@ -132,25 +132,35 @@
 /* Extended Capability Identification Numbers */
 
 #definePCIZ_AER0x0001  /* Advanced Error Reporting */
-#definePCIZ_VC 0x0002  /* Virtual Channel */
+#definePCIZ_VC 0x0002  /* Virtual Channel if MFVC Ext Cap not 
set */
 #definePCIZ_SERNUM 0x0003  /* Device Serial Number */
 #definePCIZ_PWRBDGT0x0004  /* Power Budgeting */
 #definePCIZ_RCLINK_DCL 0x0005  /* Root Complex Link Declaration */
 #definePCIZ_RCLINK_CTL 0x0006  /* Root Complex Internal Link Control */
 #definePCIZ_RCEC_ASSOC 0x0007  /* Root Complex Event Collector 
Association */
 #definePCIZ_MFVC   0x0008  /* Multi-Function Virtual Channel */
+#definePCIZ_VC20x0009  /* Virtual Channel if MFVC Ext Cap set 
*/
 #definePCIZ_RCRB   0x000a  /* RCRB Header */
 #definePCIZ_VENDOR 0x000b  /* Vendor Unique */
+#definePCIZ_CAC0x000c  /* Configuration Access Correction -- 
obsolete */
 #definePCIZ_ACS0x000d  /* Access Control Services */
 #definePCIZ_ARI0x000e  /* Alternative Routing-ID 
Interpretation */
 #definePCIZ_ATS0x000f  /* Address Translation Services */
 #definePCIZ_SRIOV  0x0010  /* Single Root IO Virtualization */
+#definePCIZ_MRIOV  0x0011  /* Multiple Root IO Virtualization */
 #definePCIZ_MULTICAST  0x0012  /* Multicast */
+#definePCIZ_PAGE_REQ   0x0013  /* Page Request */
+#definePCIZ_AMD0x0014  /* Reserved for AMD */
 #definePCIZ_RESIZE_BAR 0x0015  /* Resizable BAR */
 #definePCIZ_DPA0x0016  /* Dynamic Power Allocation */
 #definePCIZ_TPH_REQ0x0017  /* TPH Requester */
 #definePCIZ_LTR0x0018  /* Latency Tolerance Reporting */
 #definePCIZ_SEC_PCIE   0x0019  /* Secondary PCI Express */
+#definePCIZ_PMUX   0x001a  /* Protocol Multiplexing */
+#definePCIZ_PASID  0x001b  /* Process Address Space ID */
+#definePCIZ_LN_REQ 0x001c  /* LN Requester */
+#definePCIZ_DPC0x001d  /* Downstream Porto Containment */
+#definePCIZ_L1PM   0x001e  /* L1 PM Substates */
 
 /* config registers for header type 0 devices */
 
@@ -183,7 +193,7 @@
 #definePCIM_CIS_ASI_ROM7
 #definePCIM_CIS_ADDR_MASK  0x0ff8
 #definePCIM_CIS_ROM_MASK   0xf000
-#define PCIM_CIS_CONFIG_MASK   0xff
+#definePCIM_CIS_CONFIG_MASK0xff
 #definePCIR_SUBVEND_0  0x2c
 #definePCIR_SUBDEV_0   0x2e
 #definePCIR_BIOS   0x30
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241757 - head/usr.sbin/pciconf

2012-10-19 Thread Warner Losh
Author: imp
Date: Fri Oct 19 22:48:22 2012
New Revision: 241757
URL: http://svn.freebsd.org/changeset/base/241757

Log:
  Indent ecaps the same way we indent caps.
  
  MFC after:3 days

Modified:
  head/usr.sbin/pciconf/cap.c

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Fri Oct 19 22:47:44 2012(r241756)
+++ head/usr.sbin/pciconf/cap.c Fri Oct 19 22:48:22 2012(r241757)
@@ -660,7 +660,7 @@ list_ecaps(int fd, struct pci_conf *p)
if (ecap == 0x || ecap == 0)
return;
for (;;) {
-   printf("ecap %04x[%03x] = ", PCI_EXTCAP_ID(ecap), ptr);
+   printf("ecap %04x[%03x] = ", PCI_EXTCAP_ID(ecap), ptr);
switch (PCI_EXTCAP_ID(ecap)) {
case PCIZ_AER:
ecap_aer(fd, p, ptr, PCI_EXTCAP_VER(ecap));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241756 - head/lib/msun/src

2012-10-19 Thread Warner Losh
Author: imp
Date: Fri Oct 19 22:47:44 2012
New Revision: 241756
URL: http://svn.freebsd.org/changeset/base/241756

Log:
  Document the method used to compute expf.  Taken from exp, with
  changes to reflect differences in computation between the two.

Modified:
  head/lib/msun/src/e_expf.c

Modified: head/lib/msun/src/e_expf.c
==
--- head/lib/msun/src/e_expf.c  Fri Oct 19 22:46:48 2012(r241755)
+++ head/lib/msun/src/e_expf.c  Fri Oct 19 22:47:44 2012(r241756)
@@ -21,6 +21,68 @@ __FBSDID("$FreeBSD$");
 #include "math.h"
 #include "math_private.h"
 
+/* __ieee754_expf
+ * Returns the exponential of x.
+ *
+ * Method
+ *   1. Argument reduction:
+ *  Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.
+ *  Given x, find r and integer k such that
+ *
+ *   x = k*ln2 + r,  |r| <= 0.5*ln2.  
+ *
+ *  Here r will be represented as r = hi-lo for better 
+ *  accuracy.
+ *
+ *   2. Approximation of exp(r) by a special rational function on
+ *  the interval [0,0.34658]:
+ *  Write
+ *  R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ...
+ *  We use a special Remes algorithm on [0,0.34658] to generate 
+ *  a polynomial of degree 2 to approximate R. The maximum error 
+ *  of this polynomial approximation is bounded by 2**-27. In
+ *  other words,
+ *  R(z) ~ 2.0 + P1*z + P2*z*z
+ *  (where z=r*r, and the values of P1 and P2 are listed below)
+ *  and
+ *  |  2  | -27
+ *  | 2.0+P1*z+P2*z   -  R(z) | <= 2 
+ *  | |
+ *  The computation of expf(r) thus becomes
+ * 2*r
+ * expf(r) = 1 + ---
+ *R - r
+ * r*R1(r)
+ * = 1 + r + --- (for better accuracy)
+ *2 - R1(r)
+ *  where
+ *   2   4
+ *  R1(r) = r - (P1*r  + P2*r)
+ *  
+ *   3. Scale back to obtain expf(x):
+ *  From step 1, we have
+ * expf(x) = 2^k * expf(r)
+ *
+ * Special cases:
+ *  expf(INF) is INF, exp(NaN) is NaN;
+ *  expf(-INF) is 0, and
+ *  for finite argument, only exp(0)=1 is exact.
+ *
+ * Accuracy:
+ *  according to an error analysis, the error is always less than
+ *  0.5013 ulp (unit in the last place).
+ *
+ * Misc. info.
+ *  For IEEE float
+ *  if x >  8.8721679688e+01 then exp(x) overflow
+ *  if x < -1.0397208405e+02 then exp(x) underflow
+ *
+ * Constants:
+ * The hexadecimal values are the intended ones for the following 
+ * constants. The decimal values may be used, provided that the 
+ * compiler will convert from decimal to binary accurately enough
+ * to produce the hexadecimal values shown.
+ */
 static const float
 one= 1.0,
 halF[2]= {0.5,-0.5,},
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241755 - head/lib/msun/src

2012-10-19 Thread Warner Losh
Author: imp
Date: Fri Oct 19 22:46:48 2012
New Revision: 241755
URL: http://svn.freebsd.org/changeset/base/241755

Log:
  Document the methods used to compute logf. Taken and edited from the
  double version, with adaptations for the differences between it and
  the float version.

Modified:
  head/lib/msun/src/e_logf.c

Modified: head/lib/msun/src/e_logf.c
==
--- head/lib/msun/src/e_logf.c  Fri Oct 19 22:21:01 2012(r241754)
+++ head/lib/msun/src/e_logf.c  Fri Oct 19 22:46:48 2012(r241755)
@@ -19,6 +19,57 @@ __FBSDID("$FreeBSD$");
 #include "math.h"
 #include "math_private.h"
 
+/* __ieee754_log(x)
+ * Return the logrithm of x
+ *
+ * Method :  
+ *   1. Argument Reduction: find k and f such that 
+ *  x = 2^k * (1+f), 
+ * where  sqrt(2)/2 < 1+f < sqrt(2) .
+ *
+ *   2. Approximation of log(1+f).
+ *  Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
+ *   = 2s + 2/3 s**3 + 2/5 s**5 + .,
+ *   = 2s + s*R
+ *  We use a special Reme algorithm on [0,0.1716] to generate 
+ *  a polynomial of degree 8 to approximate R The maximum error 
+ *  of this polynomial approximation is bounded by 2**-34.24. In
+ *  other words,
+ *  2  4  6  8
+ *  R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s
+ *  (the values of Lg1 to Lg7 are listed in the program)
+ *  and
+ *  |  2  8   | -34.24
+ *  | Lg1*s +...+Lg4*s-  R(z) | <= 2 
+ *  | |
+ *  Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
+ *  In order to guarantee error in log below 1ulp, we compute log
+ *  by
+ *  log(1+f) = f - s*(f - R)(if f is not too large)
+ *  log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy)
+ *
+ *  3. Finally,  log(x) = k*ln2 + log(1+f).  
+ *  = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
+ * Here ln2 is split into two floating point number: 
+ *  ln2_hi + ln2_lo,
+ * where n*ln2_hi is always exact for |n| < 2000.
+ *
+ * Special cases:
+ *  log(x) is NaN with signal if x < 0 (including -INF) ; 
+ *  log(+INF) is +INF; log(0) is -INF with signal;
+ *  log(NaN) is that NaN with no signal.
+ *
+ * Accuracy:
+ *  according to an error analysis, the error is always less than
+ *  1 ulp (unit in the last place).
+ *
+ * Constants:
+ * The hexadecimal values are the intended ones for the following 
+ * constants. The decimal values may be used, provided that the 
+ * compiler will convert from decimal to binary accurately enough 
+ * to produce the hexadecimal values shown.
+ */
+
 static const float
 ln2_hi =   6.9313812256e-01,   /* 0x3f317180 */
 ln2_lo =   9.0580006145e-06,   /* 0x3717f7d1 */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r241754 - in head: contrib/mdocml etc/mtree lib/libmandoc usr.bin/mandoc

2012-10-19 Thread Glen Barber
On Fri, Oct 19, 2012 at 10:21:02PM +, Ulrich Spoerlein wrote:
> Author: uqs
> Date: Fri Oct 19 22:21:01 2012
> New Revision: 241754
> URL: http://svn.freebsd.org/changeset/base/241754
> 
> Log:
>   Merge mandoc from vendor into contrib and provide the necessary Makefile 
> glue.
>   

This is fantastic!  Thank you!

Glen



pgpCOYA8wNgpz.pgp
Description: PGP signature


svn commit: r241754 - in head: contrib/mdocml etc/mtree lib/libmandoc usr.bin/mandoc

2012-10-19 Thread Ulrich Spoerlein
Author: uqs
Date: Fri Oct 19 22:21:01 2012
New Revision: 241754
URL: http://svn.freebsd.org/changeset/base/241754

Log:
  Merge mandoc from vendor into contrib and provide the necessary Makefile glue.
  
  It's not yet connected to the build.

Added:
  head/contrib/mdocml/
 - copied from r241675, vendor/mdocml/dist/
  head/contrib/mdocml/config.h   (contents, props changed)
  head/lib/libmandoc/
  head/lib/libmandoc/Makefile   (contents, props changed)
  head/usr.bin/mandoc/
  head/usr.bin/mandoc/Makefile   (contents, props changed)
Deleted:
  head/contrib/mdocml/Makefile
  head/contrib/mdocml/TODO
  head/contrib/mdocml/apropos.1
  head/contrib/mdocml/apropos.c
  head/contrib/mdocml/apropos_db.c
  head/contrib/mdocml/apropos_db.h
  head/contrib/mdocml/catman.8
  head/contrib/mdocml/catman.c
  head/contrib/mdocml/cgi.c
  head/contrib/mdocml/config.h.post
  head/contrib/mdocml/config.h.pre
  head/contrib/mdocml/demandoc.1
  head/contrib/mdocml/demandoc.c
  head/contrib/mdocml/index.css
  head/contrib/mdocml/index.sgml
  head/contrib/mdocml/man-cgi.css
  head/contrib/mdocml/man.cgi.7
  head/contrib/mdocml/mandocdb.8
  head/contrib/mdocml/mandocdb.c
  head/contrib/mdocml/mandocdb.h
  head/contrib/mdocml/manpath.c
  head/contrib/mdocml/manpath.h
  head/contrib/mdocml/preconv.1
  head/contrib/mdocml/preconv.c
  head/contrib/mdocml/test-fgetln.c
  head/contrib/mdocml/test-getsubopt.c
  head/contrib/mdocml/test-mmap.c
  head/contrib/mdocml/test-strlcat.c
  head/contrib/mdocml/test-strlcpy.c
  head/contrib/mdocml/test-strptime.c
  head/contrib/mdocml/whatis.1
Modified:
  head/etc/mtree/BSD.usr.dist

Added: head/contrib/mdocml/config.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/mdocml/config.hFri Oct 19 22:21:01 2012
(r241754)
@@ -0,0 +1,58 @@
+#ifndefMANDOC_CONFIG_H
+#defineMANDOC_CONFIG_H
+
+#if defined(__linux__) || defined(__MINT__)
+# define _GNU_SOURCE /* strptime(), getsubopt() */
+#endif
+
+#include 
+
+#define HAVE_FGETLN
+#define HAVE_STRPTIME
+#define HAVE_GETSUBOPT
+#define HAVE_STRLCAT
+#define HAVE_MMAP
+#define HAVE_STRLCPY
+
+#include 
+
+#if !defined(__BEGIN_DECLS)
+#  ifdef __cplusplus
+#  define  __BEGIN_DECLS   extern "C" {
+#  else
+#  define  __BEGIN_DECLS
+#  endif
+#endif
+#if !defined(__END_DECLS)
+#  ifdef __cplusplus
+#  define  __END_DECLS }
+#  else
+#  define  __END_DECLS
+#  endif
+#endif
+
+#if defined(__APPLE__)
+# define htobe32(x) OSSwapHostToBigInt32(x)
+# define betoh32(x) OSSwapBigToHostInt32(x)
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# define betoh64(x) OSSwapBigToHostInt64(x)
+#elif defined(__linux__)
+# define betoh32(x) be32toh(x)
+# define betoh64(x) be64toh(x)
+#endif
+
+#ifndef HAVE_STRLCAT
+extern size_tstrlcat(char *, const char *, size_t);
+#endif
+#ifndef HAVE_STRLCPY
+extern size_tstrlcpy(char *, const char *, size_t);
+#endif
+#ifndef HAVE_GETSUBOPT
+extern int   getsubopt(char **, char * const *, char **);
+extern char *suboptarg;
+#endif
+#ifndef HAVE_FGETLN
+extern char *fgetln(FILE *, size_t *);
+#endif
+
+#endif /* MANDOC_CONFIG_H */

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Fri Oct 19 22:07:40 2012(r241753)
+++ head/etc/mtree/BSD.usr.dist Fri Oct 19 22:21:01 2012(r241754)
@@ -944,6 +944,8 @@
 man9
 ..
 ..
+mdocml
+..
 misc
 fonts
 ..

Added: head/lib/libmandoc/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libmandoc/Makefile Fri Oct 19 22:21:01 2012(r241754)
@@ -0,0 +1,20 @@
+# $FreeBSD$
+
+MDOCMLDIR= ${.CURDIR}/../../contrib/mdocml
+.PATH: ${MDOCMLDIR}
+
+LIB=   mandoc
+#NO_PIC=
+INTERNALLIB=
+MAN=   mandoc.3
+SRCS=  arch.c att.c chars.c \
+   compat_fgetln.c compat_getsubopt.c compat_strlcat.c compat_strlcpy.c \
+   eqn.c lib.c man.c man_hash.c man_macro.c man_validate.c mandoc.c \
+   mdoc.c mdoc_argv.c mdoc_hash.c mdoc_macro.c mdoc_validate.c \
+   msec.c read.c roff.c st.c \
+   tbl.c tbl_data.c tbl_layout.c tbl_opts.c vol.c
+
+WARNS?=3
+CFLAGS+= -DHAVE_CONFIG_H -DVERSION="\"1.12.1\""
+
+.include 

Added: head/usr.bin/mandoc/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/mandoc/MakefileFri Oct 19 22:21:01 2012
(r241754)
@@ -0,0 +1,22 @@
+# $FreeBSD$
+
+MDOCMLDIR= ${.CURDIR}/../../contrib/mdocml
+LIBMANDOC= ${.OBJDIR}/../../lib/libmandoc/libmandoc.a
+.PATH: ${MDOCMLDIR}
+
+PROG=  mandoc
+FILES= example.style.css external.png style.c

svn commit: r241753 - head/sys/dev/tws

2012-10-19 Thread Xin LI
Author: delphij
Date: Fri Oct 19 22:07:40 2012
New Revision: 241753
URL: http://svn.freebsd.org/changeset/base/241753

Log:
  Integrate changes from LSI vendor driver 10.80.00.005 to FreeBSD.
  
  PR:   kern/172833
  Submitted by: "Charles O'Donnell" 
  MFC after:1 week

Modified:
  head/sys/dev/tws/tws.c
  head/sys/dev/tws/tws.h
  head/sys/dev/tws/tws_cam.c
  head/sys/dev/tws/tws_hdm.h
  head/sys/dev/tws/tws_user.c

Modified: head/sys/dev/tws/tws.c
==
--- head/sys/dev/tws/tws.c  Fri Oct 19 20:13:08 2012(r241752)
+++ head/sys/dev/tws/tws.c  Fri Oct 19 22:07:40 2012(r241753)
@@ -405,6 +405,8 @@ tws_detach(device_t dev)
 free(sc->reqs, M_TWS);
 free(sc->sense_bufs, M_TWS);
 free(sc->scan_ccb, M_TWS);
+if (sc->ioctl_data_mem)
+bus_dmamem_free(sc->data_tag, sc->ioctl_data_mem, 
sc->ioctl_data_map);
 free(sc->aen_q.q, M_TWS);
 free(sc->trace_q.q, M_TWS);
 mtx_destroy(&sc->q_lock);
@@ -609,6 +611,11 @@ tws_init(struct tws_softc *sc)
 TWS_TRACE_DEBUG(sc, "ccb malloc failed", 0, sc->is64bit);
 return(ENOMEM);
 }
+if (bus_dmamem_alloc(sc->data_tag, (void **)&sc->ioctl_data_mem,
+(BUS_DMA_NOWAIT | BUS_DMA_ZERO), &sc->ioctl_data_map)) {
+device_printf(sc->tws_dev, "Cannot allocate ioctl data mem\n");
+return(ENOMEM);
+}
 
 if ( !tws_ctlr_ready(sc) )
 if( !tws_ctlr_reset(sc) )

Modified: head/sys/dev/tws/tws.h
==
--- head/sys/dev/tws/tws.h  Fri Oct 19 20:13:08 2012(r241752)
+++ head/sys/dev/tws/tws.h  Fri Oct 19 22:07:40 2012(r241753)
@@ -65,7 +65,7 @@ MALLOC_DECLARE(M_TWS);
 extern int tws_queue_depth;
 
 
-#define TWS_DRIVER_VERSION_STRING "10.80.00.003"
+#define TWS_DRIVER_VERSION_STRING "10.80.00.005"
 #define TWS_MAX_NUM_UNITS 65 
 #define TWS_MAX_NUM_LUNS  16
 #define TWS_MAX_IRQS  2
@@ -247,7 +247,7 @@ struct tws_softc {
 struct mtx io_lock;   /* IO  lock */
 struct tws_ioctl_lock ioctl_lock; /* ioctl lock */ 
 u_int32_t seq_id; /* Sequence id */
-int chan; /* wait channel */
+void *chan;   /* IOCTL req wait channel */
 struct tws_circular_q aen_q;  /* aen q */
 struct tws_circular_q trace_q;/* trace q */
 struct tws_stats stats;   /* I/O stats */
@@ -260,6 +260,8 @@ struct tws_softc {
 void *dma_mem;/* pointer to dmable memory */
 u_int64_t dma_mem_phys;   /* phy addr */
 bus_dma_tag_t data_tag;   /* data DMA tag */
+void *ioctl_data_mem; /* ioctl dmable memory */
+bus_dmamap_t ioctl_data_map;  /* ioctl data map */
 struct tws_request *reqs; /* pointer to requests */
 struct tws_sense *sense_bufs; /* pointer to sense buffers */
 boolean obfl_q_overrun;   /* OBFL overrun flag  */

Modified: head/sys/dev/tws/tws_cam.c
==
--- head/sys/dev/tws/tws_cam.c  Fri Oct 19 20:13:08 2012(r241752)
+++ head/sys/dev/tws/tws_cam.c  Fri Oct 19 22:07:40 2012(r241753)
@@ -970,6 +970,7 @@ tws_map_request(struct tws_softc *sc, st
 if (error == EINPROGRESS) {
 TWS_TRACE(sc, "in progress", 0, error);
 tws_freeze_simq(sc, req);
+error = 0;  // EINPROGRESS is not a fatal error.
 } 
 } else { /* no data involved */
 error = tws_submit_command(sc, req);
@@ -989,6 +990,10 @@ tws_dmamap_data_load_cbfn(void *arg, bus
 struct tws_cmd_generic *gcmd;
 
 
+if ( error ) {
+TWS_TRACE(sc, "SOMETHING BAD HAPPENED! error = %d\n", error, 0);
+}
+
 if ( error == EFBIG ) {
 TWS_TRACE(sc, "not enough data segs", 0, nseg);
 req->error_code = error;
@@ -1010,12 +1015,12 @@ tws_dmamap_data_load_cbfn(void *arg, bus
 gcmd = &req->cmd_pkt->cmd.pkt_g.generic;
 sgl_ptr = (u_int32_t *)(gcmd) + gcmd->size;
 gcmd->size += sgls * 
-  ((req->sc->is64bit && !tws_use_32bit_sgls) ? 4 :2 );
+  ((req->sc->is64bit && !tws_use_32bit_sgls) ? 4 : 2 );
 tws_fill_sg_list(req->sc, (void *)segs, sgl_ptr, sgls);
 
 } else {
 tws_fill_sg_list(req->sc, (void *)segs, 
-  (void *)req->cmd_pkt->cmd.pkt_a.sg_list, sgls);
+  (void *)&(req->cmd_pkt->cmd.pkt_a.sg_list), sgls);
 req->cmd_pkt->cmd.pkt_a.lun_h4__sgl_entries |= sgls ;
 }
 }
@@ -1318,10 +1323,7 @@ tws_reinit(void *arg)
 
 tws_turn_on_interrupts(sc);
 
-if ( sc->chan ) {
-sc->chan = 0;
-wakeup_one((v

Re: svn commit: r241737 - in head: bin/date bin/ed libexec/rtld-aout sbin/camcontrol sbin/geom/core usr.bin/at usr.bin/calendar usr.bin/chat usr.bin/ctlstat usr.bin/elfdump usr.bin/fetch usr.bin/finge

2012-10-19 Thread Ed Schouten
Hi John,

2012/10/19 John Baldwin :
> The fw_* changes here probably wasn't the right way to fix this.  The
> variables should be static.  The problem is that 'scan_firmware()' is
> duplicated and should probably be reduced to a single copy.

Good catch! Will fix!

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


svn commit: r241752 - head/share/mk

2012-10-19 Thread Marcel Moolenaar
Author: marcel
Date: Fri Oct 19 20:13:08 2012
New Revision: 241752
URL: http://svn.freebsd.org/changeset/base/241752

Log:
  Improve upon the previous commit to fix the yacc rule.
  1.  Have the resulting C file depend on the resulting H
  file as it should be. Touch the C file to make sure
  the C file is newer than the H file to keep make
  happy.
  2.  Apply the same fix to the other instance of .ORDER,
  missed in the previous commit.

Modified:
  head/share/mk/bsd.dep.mk

Modified: head/share/mk/bsd.dep.mk
==
--- head/share/mk/bsd.dep.mkFri Oct 19 19:56:17 2012(r241751)
+++ head/share/mk/bsd.dep.mkFri Oct 19 20:13:08 2012(r241752)
@@ -95,16 +95,17 @@ CLEANFILES+= ${_LC}
 SRCS:= ${SRCS:S/${_YSRC}/${_YC}/}
 CLEANFILES+= ${_YC}
 .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h)
-.ORDER: ${_YC} y.tab.h
-${_YC} y.tab.h: ${_YSRC}
+y.tab.h: ${_YSRC}
${YACC} ${YFLAGS} ${.ALLSRC}
+${_YC}: y.tab.h
cp y.tab.c ${_YC}
 CLEANFILES+= y.tab.c y.tab.h
 .elif !empty(YFLAGS:M-d)
 .for _YH in ${_YC:R}.h
-${_YH}: ${_YC}
-${_YC}: ${_YSRC}
+${_YH}: ${_YSRC}
${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
+${_YC}: ${_YH}
+   @touch ${.TARGET}
 SRCS+= ${_YH}
 CLEANFILES+= ${_YH}
 .endfor
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241751 - head/usr.bin/bmake

2012-10-19 Thread Marcel Moolenaar
Author: marcel
Date: Fri Oct 19 19:56:17 2012
New Revision: 241751
URL: http://svn.freebsd.org/changeset/base/241751

Log:
  Fix a bootstrapping problem where the first bmake (built by FreeBSD's
  make) ended up being built with -DFORCE_MACHINE. This broke the lib32
  built for amd64 & powerpc64.
  This fix is comes with the next import of bmake, but is committed here
  and now to minimize the exposure to the bug.
  
  Submitted by: Simon Gerraty 

Modified:
  head/usr.bin/bmake/Makefile

Modified: head/usr.bin/bmake/Makefile
==
--- head/usr.bin/bmake/Makefile Fri Oct 19 19:28:35 2012(r241750)
+++ head/usr.bin/bmake/Makefile Fri Oct 19 19:56:17 2012(r241751)
@@ -81,10 +81,9 @@ SUBDIR=  PSD.doc
 .endif
 .endif
 
+.if defined(.PARSEDIR) 
+# we cannot rely on anything but bmake to parse this correctly.
 .if empty(isBSD44:M${OS})
-# XXX not sure if we still want this given that configure
-# lets us force or not the definition of MACHINE.
-CFLAGS_main.o+= "-DFORCE_MACHINE=\"${MACHINE}\""
 MANTARGET=cat
 INSTALL?=${srcdir}/install-sh
 .if (${MACHINE} == "sun386")
@@ -95,7 +94,7 @@ SRCS+= sigcompat.c
 CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART
 .endif
 .endif
-.if defined(.PARSEDIR)
+
 .if make(obj) || make(clean)
 SUBDIR+= unit-tests
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241750 - head/sys/dev/netmap

2012-10-19 Thread Ed Maste
Author: emaste
Date: Fri Oct 19 19:28:35 2012
New Revision: 241750
URL: http://svn.freebsd.org/changeset/base/241750

Log:
  Use M_NOWAIT when calling malloc with a lock held.
  
  The check for a NULL return was already in place so I assume this was just
  an oversight.

Modified:
  head/sys/dev/netmap/netmap_mem2.c

Modified: head/sys/dev/netmap/netmap_mem2.c
==
--- head/sys/dev/netmap/netmap_mem2.c   Fri Oct 19 19:27:33 2012
(r241749)
+++ head/sys/dev/netmap/netmap_mem2.c   Fri Oct 19 19:28:35 2012
(r241750)
@@ -595,7 +595,7 @@ netmap_finalize_obj_allocator(struct net
 #ifdef linux
p->lut = vmalloc(n);
 #else
-   p->lut = malloc(n, M_NETMAP, M_WAITOK | M_ZERO);
+   p->lut = malloc(n, M_NETMAP, M_NOWAIT | M_ZERO);
 #endif
if (p->lut == NULL) {
D("Unable to create lookup table (%d bytes) for '%s'", n, 
p->name);
@@ -604,7 +604,7 @@ netmap_finalize_obj_allocator(struct net
 
/* Allocate the bitmap */
n = (p->objtotal + 31) / 32;
-   p->bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, M_WAITOK | M_ZERO);
+   p->bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, M_NOWAIT | M_ZERO);
if (p->bitmap == NULL) {
D("Unable to create bitmap (%d entries) for allocator '%s'", n,
p->name);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241748 - head/sys/dev/acpica

2012-10-19 Thread John Baldwin
Author: jhb
Date: Fri Oct 19 19:17:43 2012
New Revision: 241748
URL: http://svn.freebsd.org/changeset/base/241748

Log:
  When checking to see if a video output's _ADR matches an entry in the
  parent adapter's _DOD list, only check the low 16 bits of both _ADR and
  _DOD.  The language in the ACPI spec seems to indicate that the _ADR values
  should exactly match the entries in _DOD.  However, I assume that the
  masking added to _DOD values was added to work around some known busted
  machines (the commit history doesn't indicate either way), and the ACPI
  spec does require that the low 16 bits are unique for all video outputs,
  so only check the low 16 bits should be fine.
  
  This fixes recognition of video outputs that use the new standardized
  device ID scheme in ACPI 3.0 that set bit 31 such as certain Dell laptops.
  
  Tested by:Juergen Lock  nox  jelal kn-bremen de
  MFC after:3 days

Modified:
  head/sys/dev/acpica/acpi_video.c

Modified: head/sys/dev/acpica/acpi_video.c
==
--- head/sys/dev/acpica/acpi_video.cFri Oct 19 18:50:19 2012
(r241747)
+++ head/sys/dev/acpica/acpi_video.cFri Oct 19 19:17:43 2012
(r241748)
@@ -906,7 +906,8 @@ vid_enum_outputs_subr(ACPI_HANDLE handle
 
for (i = 0; i < argset->dod_pkg->Package.Count; i++) {
if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 &&
-   (val & DOD_DEVID_MASK_FULL) == adr) {
+   (val & DOD_DEVID_MASK_FULL) ==
+   (adr & DOD_DEVID_MASK_FULL)) {
argset->callback(handle, val, argset->context);
argset->count++;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r241701 - in head/usr.sbin/bsdconfig: . include share

2012-10-19 Thread Devin Teske

On Oct 19, 2012, at 10:02 AM, Alexey Dokuchaev wrote:

> On Fri, Oct 19, 2012 at 08:22:36AM -0700, Devin Teske wrote:
>> On Oct 18, 2012, at 10:54 PM, Alexey Dokuchaev wrote:
>>> How come that new dialog(1) lacks functionality of the old one?
>> 
>> SVN r217309 brought in cdialog to replace our the [unmaintained] dialog.
>> 
>> cdialog is different, but mostly compatible with its predecessor.
> 
> Ah, I guess it might explain the shitty colors I see on newish FreeBSD
> screenshots of dialog(1).
> 

I actually prefer the colors in cdialog (more specifically, I prefer the 
lack-of-yellow!).

Whenever I want a reminder of bad colors, I run "sade" (which links against the 
old libdialog now named lib*o*dialog).

When I'm on the physical console, I don't have nearly as much trouble with the 
yellow color used both for the title bar and for the hline at the bottom, but 
when I'm (say) ssh'd from Mac OS X, that text is just completely unreadable to 
me.

I'm curious about how others feel about the use of yellow (specifically that 
old dialog(1)/libdialog used it a lot and new cdialog-based dialog(1)/libdialog 
doesn't use it hardly at all).

I for one embrace my new cdialog overlord.


>> The benefits of cdialog far out-weigh the few problems that were reported
>> (and then quickly fixed).
> 
> OK, but do we plan to retain the look of original dialog(1)?
> 

It is possible to change the colorings by first creating (if you don't already 
have one) a ~/.dialogrc by executing the below command:

dialog --create-rc ~/.dialogrc

followed by editing said file.

So while the default look and feel has changed, it's possible to customize it 
to your liking.

HINT: I bet if you ran the above command on FreeBSD-8 or lower, it would make 
dialog(1) in FreeBSD-9 and higher look like its predecessor.
-- 
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241745 - head/lib/libpmc

2012-10-19 Thread Joel Dahl
Author: joel (doc committer)
Date: Fri Oct 19 18:30:50 2012
New Revision: 241745
URL: http://svn.freebsd.org/changeset/base/241745

Log:
  Remove trailing whitespace.

Modified:
  head/lib/libpmc/pmc.sandybridgexeon.3

Modified: head/lib/libpmc/pmc.sandybridgexeon.3
==
--- head/lib/libpmc/pmc.sandybridgexeon.3   Fri Oct 19 18:11:17 2012
(r241744)
+++ head/lib/libpmc/pmc.sandybridgexeon.3   Fri Oct 19 18:30:50 2012
(r241745)
@@ -442,147 +442,147 @@ Set Cmask = 1 to count cycles.
 .It Li PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW
 .Pq Event 59H , Umask 0FH
 Cycles with at least one slow LEA uop allocated.
-.It Li PARTIAL_RAT_STALLS.MUL_SINGLE_UOP 
+.It Li PARTIAL_RAT_STALLS.MUL_SINGLE_UOP
 .Pq Event 59H , Umask 40H
 Number of Multiply packed/scalar single precision
 uops allocated.
-.It Li RESOURCE_STALLS2.ALL_FL_EMPTY 
+.It Li RESOURCE_STALLS2.ALL_FL_EMPTY
 .Pq Event 5BH , Umask 0CH
-Cycles stalled due to free list empty.  
-.It Li RESOURCE_STALLS2.ALL_PRF_CONTROL 
+Cycles stalled due to free list empty.
+.It Li RESOURCE_STALLS2.ALL_PRF_CONTROL
 .Pq Event 5BH , Umask 0FH
 Cycles stalled due to control structures full for
 physical registers.
-.It Li RESOURCE_STALLS2.BOB_FULL 
+.It Li RESOURCE_STALLS2.BOB_FULL
 .Pq Event 5BH , Umask 40H
-Cycles Allocator is stalled due Branch Order Buffer.  
-.It Li RESOURCE_STALLS2.OOO_RSRC 
+Cycles Allocator is stalled due Branch Order Buffer.
+.It Li RESOURCE_STALLS2.OOO_RSRC
 .Pq Event 5BH , Umask 4FH
-Cycles stalled due to out of order resources full.  
-.It Li CPL_CYCLES.RING0 
+Cycles stalled due to out of order resources full.
+.It Li CPL_CYCLES.RING0
 .Pq Event 5CH , Umask 01H
-Unhalted core cycles when the thread is in ring 0.  
-.It Li CPL_CYCLES.RING123 
+Unhalted core cycles when the thread is in ring 0.
+.It Li CPL_CYCLES.RING123
 .Pq Event 5CH , Umask 02H
 Unhalted core cycles when the thread is not in ring
 0.
 .It Li RS_EVENTS.EMPTY_CYCLES
 .Pq Event 5EH , Umask 01H
-Cycles the RS is empty for the thread.  
-.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD 
+Cycles the RS is empty for the thread.
+.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD
 .Pq Event 60H , Umask 01H
 Offcore outstanding Demand Data Read
 transactions in SQ to uncore. Set Cmask=1 to count
 cycles.
-.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO 
+.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO
 .Pq Event 60H , Umask 04H
 Offcore outstanding RFO store transactions in SQ to
 uncore. Set Cmask=1 to count cycles.
-.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD 
+.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD
 .Pq Event 60H , Umask 08H
 Offcore outstanding cacheable data read
 transactions in SQ to uncore. Set Cmask=1 to count
 cycles.
-.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION 
+.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION
 .Pq Event 63H , Umask 01H
 Cycles in which the L1D and L2 are locked, due to a
 UC lock or split lock.
-.It Li LOCK_CYCLES.CACHE_LOCK_DURATION 
+.It Li LOCK_CYCLES.CACHE_LOCK_DURATION
 .Pq Event 63H , Umask 02H
-Cycles in which the L1D is locked.  
-.It Li IDQ.EMPTY 
+Cycles in which the L1D is locked.
+.It Li IDQ.EMPTY
 .Pq Event 79H , Umask 02H
 Counts cycles the IDQ is empty.
-.It Li IDQ.MITE_UOPS 
+.It Li IDQ.MITE_UOPS
 .Pq Event 79H , Umask 04H
 Increment each cycle # of uops delivered to IDQ
 from MITE path.
 Set Cmask = 1 to count cycles.
-.It Li IDQ.DSB_UOPS 
+.It Li IDQ.DSB_UOPS
 .Pq Event 79H , Umask 08H
 Increment each cycle. # of uops delivered to IDQ
 from DSB path.
 Set Cmask = 1 to count cycles.
-.It Li IDQ.MS_DSB_UOPS 
+.It Li IDQ.MS_DSB_UOPS
 .Pq Event 79H , Umask 10H
 Increment each cycle # of uops delivered to IDQ
 when MS busy by DSB. Set Cmask = 1 to count
 cycles MS is busy. Set Cmask=1 and Edge =1 to
 count MS activations.
-.It Li IDQ.MS_MITE_UOPS 
+.It Li IDQ.MS_MITE_UOPS
 .Pq Event 79H , Umask 20H
 Increment each cycle # of uops delivered to IDQ
 when MS is busy by MITE. Set Cmask = 1 to count
 cycles.
-.It Li IDQ.MS_UOPS 
+.It Li IDQ.MS_UOPS
 .Pq Event 79H , Umask 30H
 Increment each cycle # of uops delivered to IDQ
 from MS by either DSB or MITE. Set Cmask = 1 to
 count cycles.
-.It Li ICACHE.MISSES 
+.It Li ICACHE.MISSES
 .Pq Event 80H , Umask 02H
 Number of Instruction Cache, Streaming Buffer and
 Victim Cache Misses. Includes UC accesses.
-.It Li ITLB_MISSES.MISS_CAUSES_A_WALK 
+.It Li ITLB_MISSES.MISS_CAUSES_A_WALK
 .Pq Event 85H , Umask 01H
-Misses in all ITLB levels that cause page walks.  
-.It Li ITLB_MISSES.WALK_COMPLETED 
+Misses in all ITLB levels that cause page walks.
+.It Li ITLB_MISSES.WALK_COMPLETED
 .Pq Event 85H , Umask 02H
 Misses in all ITLB levels that cause completed page
 walks.
-.It Li ITLB_MISSES.WALK_DURATION 
+.It Li ITLB_MISSES.WALK_DURATION
 .Pq Event 85H , Umask 04H
-Cycle PMH is busy with a walk.  
-.It Li ITLB_MISSES.STLB_HIT 
+Cycle PMH is busy with a walk.
+.It Li ITLB_MISSES.STLB_HIT
 .Pq Event 85H , Umask 1

svn commit: r241741 - head/lib/libpmc

2012-10-19 Thread Sean Bruno
Author: sbruno
Date: Fri Oct 19 17:21:10 2012
New Revision: 241741
URL: http://svn.freebsd.org/changeset/base/241741

Log:
  Update man page crossreferences to sandybridge xeon class
  
  MFC after:2 weeks

Modified:
  head/lib/libpmc/pmc.ivybridge.3
  head/lib/libpmc/pmc.sandybridge.3
  head/lib/libpmc/pmc.sandybridgeuc.3

Modified: head/lib/libpmc/pmc.ivybridge.3
==
--- head/lib/libpmc/pmc.ivybridge.3 Fri Oct 19 17:12:55 2012
(r241740)
+++ head/lib/libpmc/pmc.ivybridge.3 Fri Oct 19 17:21:10 2012
(r241741)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 24, 2012
+.Dd October 19, 2012
 .Dt PMC.IVYBRIDGE 3
 .Os
 .Sh NAME
@@ -855,6 +855,7 @@ Dirty L2 cache lines evicted by the MLC 
 .Xr pmc.corei7uc 3 ,
 .Xr pmc.sandybridge 3 ,
 .Xr pmc.sandybridgeuc 3 ,
+.Xr pmc.sandybridgexeon 3 ,
 .Xr pmc.westmere 3 ,
 .Xr pmc.westmereuc 3 ,
 .Xr pmc.soft 3 ,

Modified: head/lib/libpmc/pmc.sandybridge.3
==
--- head/lib/libpmc/pmc.sandybridge.3   Fri Oct 19 17:12:55 2012
(r241740)
+++ head/lib/libpmc/pmc.sandybridge.3   Fri Oct 19 17:21:10 2012
(r241741)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 12, 2012
+.Dd October 19, 2012
 .Dt PMC.SANDYBRIDGE 3
 .Os
 .Sh NAME
@@ -932,6 +932,7 @@ Split locks in SQ.
 .Xr pmc.p5 3 ,
 .Xr pmc.p6 3 ,
 .Xr pmc.sandybridgeuc 3 ,
+.Xr pmc.sandybridgexeon 3 ,
 .Xr pmc.soft 3 ,
 .Xr pmc.tsc 3 ,
 .Xr pmc.ucf 3 ,

Modified: head/lib/libpmc/pmc.sandybridgeuc.3
==
--- head/lib/libpmc/pmc.sandybridgeuc.3 Fri Oct 19 17:12:55 2012
(r241740)
+++ head/lib/libpmc/pmc.sandybridgeuc.3 Fri Oct 19 17:21:10 2012
(r241741)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 12, 2012
+.Dd October 19, 2012
 .Dt PMC.SANDYBRIDGEUC 3
 .Os
 .Sh NAME
@@ -208,6 +208,7 @@ Counts the number of core-outgoing entri
 .Xr pmc.p5 3 ,
 .Xr pmc.p6 3 ,
 .Xr pmc.sandybridge 3 ,
+.Xr pmc.sandybridgexeon 3 ,
 .Xr pmc.soft 3 ,
 .Xr pmc.tsc 3 ,
 .Xr pmc.ucf 3 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241740 - head/sys/sparc64/sparc64

2012-10-19 Thread Marius Strobl
Author: marius
Date: Fri Oct 19 17:12:55 2012
New Revision: 241740
URL: http://svn.freebsd.org/changeset/base/241740

Log:
  - Remove an unused header.
  - Don't waste a delay slot.
  
  MFC after:3 days

Modified:
  head/sys/sparc64/sparc64/interrupt.S

Modified: head/sys/sparc64/sparc64/interrupt.S
==
--- head/sys/sparc64/sparc64/interrupt.SFri Oct 19 17:03:50 2012
(r241739)
+++ head/sys/sparc64/sparc64/interrupt.SFri Oct 19 17:12:55 2012
(r241740)
@@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -84,13 +83,13 @@ ENTRY(intr_vector)
 * The 2nd word points to code to execute and the 3rd is an argument
 * to pass.  Jump to it.
 */
-   brnz,pt %g3, 1f
+   brnz,a,pt %g3, 1f
+srlx   %g3, 60, %g6
/*
 * NB: Zeus CPUs set some undocumented bits in the first data word.
 */
-and%g3, IV_MAX - 1, %g3
jmpl%g4, %g0
-nop
+and%g3, IV_MAX - 1, %g3
/* NOTREACHED */
 
/*
@@ -99,8 +98,7 @@ ENTRY(intr_vector)
 * 4 bits of the 1st data word specify a priority, and the 2nd and
 * 3rd a function and argument.
 */
-1: srlx%g3, 60, %g6
-   brnz,a,pn %g6, 2f
+1: brnz,a,pn %g6, 2f
 clr%g3
 
/*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241739 - head/sys/conf

2012-10-19 Thread Marius Strobl
Author: marius
Date: Fri Oct 19 17:03:50 2012
New Revision: 241739
URL: http://svn.freebsd.org/changeset/base/241739

Log:
  Fix kernel build with options ZFS after r240868.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Oct 19 17:01:27 2012(r241738)
+++ head/sys/conf/files Fri Oct 19 17:03:50 2012(r241739)
@@ -214,6 +214,7 @@ cddl/contrib/opensolaris/uts/common/fs/z
 cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c   
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c  
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c 
optional zfs compile-with "${ZFS_C}"
+cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c  
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c   
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c 
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c
optional zfs compile-with "${ZFS_C}"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r241701 - in head/usr.sbin/bsdconfig: . include share

2012-10-19 Thread Alexey Dokuchaev
On Fri, Oct 19, 2012 at 08:22:36AM -0700, Devin Teske wrote:
> On Oct 18, 2012, at 10:54 PM, Alexey Dokuchaev wrote:
> > How come that new dialog(1) lacks functionality of the old one?
> 
> SVN r217309 brought in cdialog to replace our the [unmaintained] dialog.
> 
> cdialog is different, but mostly compatible with its predecessor.

Ah, I guess it might explain the shitty colors I see on newish FreeBSD
screenshots of dialog(1).

> The benefits of cdialog far out-weigh the few problems that were reported
> (and then quickly fixed).

OK, but do we plan to retain the look of original dialog(1)?

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


svn commit: r241738 - in head: lib/libpmc sys/dev/hwpmc sys/sys

2012-10-19 Thread Sean Bruno
Author: sbruno
Date: Fri Oct 19 17:01:27 2012
New Revision: 241738
URL: http://svn.freebsd.org/changeset/base/241738

Log:
  Update hwpmc to support the Xeon class of Sandybridge processors.
  (Model 0x2D /* Per Intel document 253669-044US 08/2012. */)
  
  Add manpage to document all the goodness that is available in this
  processor model.
  
  No support for uncore events at this time.
  
  Submitted by: hiren panchasara 
  Reviewed by:  jimharris@ fabient@
  Obtained from:Yahoo! Inc.
  MFC after:  2 weeks

Added:
  head/lib/libpmc/pmc.sandybridgexeon.3   (contents, props changed)
Modified:
  head/lib/libpmc/Makefile
  head/lib/libpmc/libpmc.c
  head/sys/dev/hwpmc/hwpmc_core.c
  head/sys/dev/hwpmc/hwpmc_intel.c
  head/sys/dev/hwpmc/pmc_events.h
  head/sys/sys/pmc.h

Modified: head/lib/libpmc/Makefile
==
--- head/lib/libpmc/MakefileFri Oct 19 14:49:42 2012(r241737)
+++ head/lib/libpmc/MakefileFri Oct 19 17:01:27 2012(r241738)
@@ -39,6 +39,7 @@ MAN+= pmc.corei7.3
 MAN+=  pmc.corei7uc.3
 MAN+=  pmc.sandybridge.3
 MAN+=  pmc.sandybridgeuc.3 
+MAN+=  pmc.sandybridgexeon.3   
 MAN+=  pmc.westmere.3
 MAN+=  pmc.westmereuc.3
 MAN+=  pmc.tsc.3

Modified: head/lib/libpmc/libpmc.c
==
--- head/lib/libpmc/libpmc.cFri Oct 19 14:49:42 2012(r241737)
+++ head/lib/libpmc/libpmc.cFri Oct 19 17:01:27 2012(r241738)
@@ -193,6 +193,11 @@ static const struct pmc_event_descr sand
__PMC_EV_ALIAS_SANDYBRIDGE()
 };
 
+static const struct pmc_event_descr sandybridge_xeon_event_table[] = 
+{
+   __PMC_EV_ALIAS_SANDYBRIDGE_XEON()
+};
+
 static const struct pmc_event_descr westmere_event_table[] =
 {
__PMC_EV_ALIAS_WESTMERE()
@@ -229,6 +234,7 @@ PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOF
 PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, 
PMC_CLASS_UCF, PMC_CLASS_UCP);
 PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, 
PMC_CLASS_UCF, PMC_CLASS_UCP);
+PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, 
PMC_CLASS_TSC);
 PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, 
PMC_CLASS_UCF, PMC_CLASS_UCP);
 PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC);
@@ -267,6 +273,7 @@ PMC_CLASS_TABLE_DESC(core2, IAP, core2, 
 PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap);
 PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap);
 PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap);
+PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap);
 PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap);
 PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf);
 PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp);
@@ -572,6 +579,8 @@ static struct pmc_event_alias core2_alia
 #define ivybridge_aliases_without_iaf  core2_aliases_without_iaf
 #define sandybridge_aliasescore2_aliases
 #define sandybridge_aliases_without_iafcore2_aliases_without_iaf
+#define sandybridge_xeon_aliases   core2_aliases
+#define sandybridge_xeon_aliases_without_iaf   core2_aliases_without_iaf
 #define westmere_aliases   core2_aliases
 #define westmere_aliases_without_iaf   core2_aliases_without_iaf
 
@@ -691,7 +700,7 @@ static struct pmc_masks iap_rsp_mask_i7_
NULLMASK
 };
 
-static struct pmc_masks iap_rsp_mask_sb_ib[] = {
+static struct pmc_masks iap_rsp_mask_sb_sbx_ib[] = {
PMCMASK(REQ_DMND_DATA_RD,   (1ULL <<  0)),
PMCMASK(REQ_DMND_RFO,   (1ULL <<  1)),
PMCMASK(REQ_DMND_IFETCH,(1ULL <<  2)),
@@ -797,9 +806,10 @@ iap_allocate_pmc(enum pmc_event pe, char
} else
return (-1);
} else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE ||
-   cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) {
+   cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON ||
+   cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) {
if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) {
-   n = pmc_parse_mask(iap_rsp_mask_sb_ib, p, &rsp);
+   n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, 
&rsp);
} else
return (-1);
} else
@@ -2678,6 +2688,10 @@ pmc_event_names_of_class(enum pmc_class 
ev = sandybridge_event_table;
count = PMC_EVENT_TABLE_SIZE(sandybridge);
break;
+   case PMC_CPU_INTEL_SANDYBRIDGE_XEON:
+   ev = sandybridge_xeon_event_table;
+   count = PMC_EVENT_TABLE_SIZE(sandybridge_xeon);

Re: svn commit: r241737 - in head: bin/date bin/ed libexec/rtld-aout sbin/camcontrol sbin/geom/core usr.bin/at usr.bin/calendar usr.bin/chat usr.bin/ctlstat usr.bin/elfdump usr.bin/fetch usr.bin/finge

2012-10-19 Thread John Baldwin
On Friday, October 19, 2012 10:49:43 am Ed Schouten wrote:
> Author: ed
> Date: Fri Oct 19 14:49:42 2012
> New Revision: 241737
> URL: http://svn.freebsd.org/changeset/base/241737
> 
> Log:
>   More -Wmissing-variable-declarations fixes.
>   
>   In addition to adding `static' where possible:
>   
>   - usr.sbin/mfiutil: Put global variables in mfiutil.h.

The fw_* changes here probably wasn't the right way to fix this.  The 
variables should be static.  The problem is that 'scan_firmware()' is
duplicated and should probably be reduced to a single copy.

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


Re: svn commit: r241701 - in head/usr.sbin/bsdconfig: . include share

2012-10-19 Thread Devin Teske

On Oct 18, 2012, at 10:54 PM, Alexey Dokuchaev wrote:

> On Thu, Oct 18, 2012 at 06:43:54PM +, Devin Teske wrote:
>> NOTE: In FreeBSD-9 and higher, dialog(1) does not support the F1 hook, so
>> the mechanism for providing help to the user had to be changed to a button.
> 
> How come that new dialog(1) lacks functionality of the old one?
> 

SVN r217309 brought in cdialog to replace our the [unmaintained] dialog.

cdialog is different, but mostly compatible with its predecessor.

The benefits of cdialog far out-weigh the few problems that were reported (and 
then quickly fixed).

Most importantly, cdialog is actively maintained while its predecessor (in 
FreeBSD-8.x and older) is not.
-- 
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241737 - in head: bin/date bin/ed libexec/rtld-aout sbin/camcontrol sbin/geom/core usr.bin/at usr.bin/calendar usr.bin/chat usr.bin/ctlstat usr.bin/elfdump usr.bin/fetch usr.bin/finger...

2012-10-19 Thread Ed Schouten
Author: ed
Date: Fri Oct 19 14:49:42 2012
New Revision: 241737
URL: http://svn.freebsd.org/changeset/base/241737

Log:
  More -Wmissing-variable-declarations fixes.
  
  In addition to adding `static' where possible:
  
  - bin/date: Move `retval' into extern.h to make it visible to date.c.
  - bin/ed: Move globally used variables into ed.h.
  - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
  - usr.bin/calendar: Remove unneeded variables.
  - usr.bin/chat: Make `line' local instead of global.
  - usr.bin/elfdump: Comment out unneeded function.
  - usr.bin/rlogin: Use _Noreturn instead of __dead2.
  - usr.bin/tset: Pull `Ospeed' into extern.h.
  - usr.sbin/mfiutil: Put global variables in mfiutil.h.
  - usr.sbin/pkg: Remove unused `os_corres'.
  - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.

Modified:
  head/bin/date/extern.h
  head/bin/date/netdate.c
  head/bin/ed/buf.c
  head/bin/ed/ed.h
  head/bin/ed/io.c
  head/bin/ed/re.c
  head/libexec/rtld-aout/shlib.c
  head/sbin/camcontrol/camcontrol.c
  head/sbin/camcontrol/camcontrol.h
  head/sbin/camcontrol/fwdownload.c
  head/sbin/camcontrol/modeedit.c
  head/sbin/geom/core/geom.c
  head/usr.bin/at/privs.h
  head/usr.bin/calendar/calendar.c
  head/usr.bin/calendar/dates.c
  head/usr.bin/calendar/day.c
  head/usr.bin/calendar/io.c
  head/usr.bin/chat/chat.c
  head/usr.bin/ctlstat/ctlstat.c
  head/usr.bin/elfdump/elfdump.c
  head/usr.bin/fetch/fetch.c
  head/usr.bin/finger/finger.c
  head/usr.bin/gencat/gencat.c
  head/usr.bin/grep/grep.c
  head/usr.bin/grep/regex/xmalloc.c
  head/usr.bin/gzip/zuncompress.c
  head/usr.bin/msgs/msgs.c
  head/usr.bin/ncal/ncal.c
  head/usr.bin/rlogin/rlogin.c
  head/usr.bin/rpcgen/rpc_main.c
  head/usr.bin/rpcgen/rpc_svcout.c
  head/usr.bin/rpcgen/rpc_util.c
  head/usr.bin/sort/sort.c
  head/usr.bin/stat/stat.c
  head/usr.bin/tftp/main.c
  head/usr.bin/tset/extern.h
  head/usr.bin/tset/map.c
  head/usr.bin/tset/term.c
  head/usr.sbin/acpi/acpidump/acpi.c
  head/usr.sbin/acpi/acpidump/acpi_user.c
  head/usr.sbin/cpucontrol/cpucontrol.c
  head/usr.sbin/ctladm/ctladm.c
  head/usr.sbin/ctladm/util.c
  head/usr.sbin/gpioctl/gpioctl.c
  head/usr.sbin/ip6addrctl/ip6addrctl.c
  head/usr.sbin/mfiutil/mfi_flash.c
  head/usr.sbin/mfiutil/mfi_show.c
  head/usr.sbin/mfiutil/mfiutil.c
  head/usr.sbin/mfiutil/mfiutil.h
  head/usr.sbin/nfscbd/nfscbd.c
  head/usr.sbin/nfsd/nfsd.c
  head/usr.sbin/pkg/elf_tables.h
  head/usr.sbin/pkg_install/version/perform.c
  head/usr.sbin/pmccontrol/pmccontrol.c
  head/usr.sbin/pmcstat/pmcpl_calltree.c
  head/usr.sbin/pmcstat/pmcstat.c
  head/usr.sbin/pmcstat/pmcstat_log.c
  head/usr.sbin/pmcstat/pmcstat_log.h
  head/usr.sbin/quotaon/quotaon.c
  head/usr.sbin/repquota/repquota.c
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/bin/date/extern.h
==
--- head/bin/date/extern.h  Fri Oct 19 14:29:03 2012(r241736)
+++ head/bin/date/extern.h  Fri Oct 19 14:49:42 2012(r241737)
@@ -30,4 +30,6 @@
  * $FreeBSD$
  */
 
+extern int retval;
+
 intnetsettime(time_t);

Modified: head/bin/date/netdate.c
==
--- head/bin/date/netdate.c Fri Oct 19 14:29:03 2012(r241736)
+++ head/bin/date/netdate.c Fri Oct 19 14:49:42 2012(r241737)
@@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$");
 #defineWAITACK 2   /* seconds */
 #defineWAITDATEACK 5   /* seconds */
 
-extern int retval;
-
 /*
  * Set the date in the machines controlled by timedaemons by communicating the
  * new date to the local timedaemon.  If the timedaemon is in the master state,

Modified: head/bin/ed/buf.c
==
--- head/bin/ed/buf.c   Fri Oct 19 14:29:03 2012(r241736)
+++ head/bin/ed/buf.c   Fri Oct 19 14:49:42 2012(r241737)
@@ -185,9 +185,6 @@ get_addressed_line_node(long n)
return lp;
 }
 
-
-extern int newline_added;
-
 static char sfn[15] = "";  /* scratch file name */
 
 /* open_sbuf: open scratch file */

Modified: head/bin/ed/ed.h
==
--- head/bin/ed/ed.hFri Oct 19 14:29:03 2012(r241736)
+++ head/bin/ed/ed.hFri Oct 19 14:49:42 2012(r241737)
@@ -277,3 +277,9 @@ extern int lineno;
 extern long second_addr;
 extern long u_addr_last;
 extern long u_current_addr;
+extern long rows;
+extern int cols;
+extern int newline_added;
+extern int des;
+extern int scripted;
+extern int patlock;

Modified: head/bin/ed/io.c
==
--- head/bin/ed/io.cFri Oct 19 14:29:03 2012(r241736)
+++ head/bin/ed/io.cFri Oct 19 14:49:42 2012(r241737)
@@ -30,9 +30,6 @@ __FBSDID("$FreeBSD$");
 
 #include "ed.h"
 
-

svn commit: r241736 - in head: sbin/natd usr.bin/logger usr.sbin/syslogd

2012-10-19 Thread Ed Schouten
Author: ed
Date: Fri Oct 19 14:29:03 2012
New Revision: 241736
URL: http://svn.freebsd.org/changeset/base/241736

Log:
  Add missing const keywords.

Modified:
  head/sbin/natd/natd.c
  head/usr.bin/logger/logger.c
  head/usr.sbin/syslogd/syslogd.c

Modified: head/sbin/natd/natd.c
==
--- head/sbin/natd/natd.c   Fri Oct 19 14:00:03 2012(r241735)
+++ head/sbin/natd/natd.c   Fri Oct 19 14:29:03 2012(r241736)
@@ -1330,7 +1330,7 @@ static void ParseOption (const char* opt
struct in_addr  addrValue;
int max;
char*   end;
-   CODE*   fac_record = NULL;
+   const CODE* fac_record = NULL;
 /*
  * Find option from table.
  */

Modified: head/usr.bin/logger/logger.c
==
--- head/usr.bin/logger/logger.cFri Oct 19 14:00:03 2012
(r241735)
+++ head/usr.bin/logger/logger.cFri Oct 19 14:29:03 2012
(r241736)
@@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$");
 #defineSYSLOG_NAMES
 #include 
 
-static int decode(char *, CODE *);
+static int decode(char *, const CODE *);
 static int pencode(char *);
 static voidlogmessage(int, const char *, const char *, const char *,
   const char *);
@@ -271,9 +271,9 @@ pencode(char *s)
 }
 
 static int
-decode(char *name, CODE *codetab)
+decode(char *name, const CODE *codetab)
 {
-   CODE *c;
+   const CODE *c;
 
if (isdigit(*name))
return (atoi(name));

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Fri Oct 19 14:00:03 2012
(r241735)
+++ head/usr.sbin/syslogd/syslogd.c Fri Oct 19 14:29:03 2012
(r241736)
@@ -312,7 +312,7 @@ static void cfline(const char *, struct 
 static const char *cvthname(struct sockaddr *);
 static voiddeadq_enter(pid_t, const char *);
 static int deadq_remove(pid_t);
-static int decode(const char *, CODE *);
+static int decode(const char *, const CODE *);
 static voiddie(int);
 static voiddodie(int);
 static voiddofsync(void);
@@ -1123,7 +1123,7 @@ fprintlog(struct filed *f, int flags, co
char p_n[5];/* Hollow laugh */
 
if (LogFacPri > 1) {
- CODE *c;
+ const CODE *c;
 
  for (c = facilitynames; c->c_name; c++) {
if (c->c_val == fac) {
@@ -2029,9 +2029,9 @@ cfline(const char *line, struct filed *f
  *  Decode a symbolic name to a numeric value
  */
 static int
-decode(const char *name, CODE *codetab)
+decode(const char *name, const CODE *codetab)
 {
-   CODE *c;
+   const CODE *c;
char *p, buf[40];
 
if (isdigit(*name))
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241735 - head/sys/netinet

2012-10-19 Thread Andrey Zonov
Author: zont
Date: Fri Oct 19 14:00:03 2012
New Revision: 241735
URL: http://svn.freebsd.org/changeset/base/241735

Log:
  - Update cachelimit after hashsize and bucketlimit were set.
  
  Reported by:  az
  Reviewed by:  melifaro
  Approved by:  kib (mentor)
  MFC after:1 week

Modified:
  head/sys/netinet/tcp_hostcache.c

Modified: head/sys/netinet/tcp_hostcache.c
==
--- head/sys/netinet/tcp_hostcache.cFri Oct 19 13:32:37 2012
(r241734)
+++ head/sys/netinet/tcp_hostcache.cFri Oct 19 14:00:03 2012
(r241735)
@@ -174,6 +174,7 @@ static MALLOC_DEFINE(M_HOSTCACHE, "hostc
 void
 tcp_hc_init(void)
 {
+   u_int cache_limit;
int i;
 
/*
@@ -182,23 +183,27 @@ tcp_hc_init(void)
V_tcp_hostcache.cache_count = 0;
V_tcp_hostcache.hashsize = TCP_HOSTCACHE_HASHSIZE;
V_tcp_hostcache.bucket_limit = TCP_HOSTCACHE_BUCKETLIMIT;
-   V_tcp_hostcache.cache_limit =
-   V_tcp_hostcache.hashsize * V_tcp_hostcache.bucket_limit;
V_tcp_hostcache.expire = TCP_HOSTCACHE_EXPIRE;
V_tcp_hostcache.prune = TCP_HOSTCACHE_PRUNE;
 
TUNABLE_INT_FETCH("net.inet.tcp.hostcache.hashsize",
&V_tcp_hostcache.hashsize);
-   TUNABLE_INT_FETCH("net.inet.tcp.hostcache.cachelimit",
-   &V_tcp_hostcache.cache_limit);
-   TUNABLE_INT_FETCH("net.inet.tcp.hostcache.bucketlimit",
-   &V_tcp_hostcache.bucket_limit);
if (!powerof2(V_tcp_hostcache.hashsize)) {
printf("WARNING: hostcache hash size is not a power of 2.\n");
V_tcp_hostcache.hashsize = TCP_HOSTCACHE_HASHSIZE; /* default */
}
V_tcp_hostcache.hashmask = V_tcp_hostcache.hashsize - 1;
 
+   TUNABLE_INT_FETCH("net.inet.tcp.hostcache.bucketlimit",
+   &V_tcp_hostcache.bucket_limit);
+
+   cache_limit = V_tcp_hostcache.hashsize * V_tcp_hostcache.bucket_limit;
+   V_tcp_hostcache.cache_limit = cache_limit;
+   TUNABLE_INT_FETCH("net.inet.tcp.hostcache.cachelimit",
+   &V_tcp_hostcache.cache_limit);
+   if (V_tcp_hostcache.cache_limit > cache_limit)
+   V_tcp_hostcache.cache_limit = cache_limit;
+
/*
 * Allocate the hash table.
 */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241734 - head/sys/sparc64/sparc64

2012-10-19 Thread Marius Strobl
Author: marius
Date: Fri Oct 19 13:32:37 2012
New Revision: 241734
URL: http://svn.freebsd.org/changeset/base/241734

Log:
  Let SCHED_ULE give affinity to the CPU the tick interrupt triggered on
  when running tick_process(), similarly to what the x86 equivalents of
  this function do, however employing the less racy sequence also used in
  intr_event_handle().
  
  MFC after:3 days

Modified:
  head/sys/sparc64/sparc64/tick.c

Modified: head/sys/sparc64/sparc64/tick.c
==
--- head/sys/sparc64/sparc64/tick.c Fri Oct 19 13:26:40 2012
(r241733)
+++ head/sys/sparc64/sparc64/tick.c Fri Oct 19 13:32:37 2012
(r241734)
@@ -245,14 +245,16 @@ tick_process(struct trapframe *tf)
struct trapframe *oldframe;
struct thread *td;
 
+   td = curthread;
+   td->td_intr_nesting_level++;
critical_enter();
if (tick_et.et_active) {
-   td = curthread;
oldframe = td->td_intr_frame;
td->td_intr_frame = tf;
tick_et.et_event_cb(&tick_et, tick_et.et_arg);
td->td_intr_frame = oldframe;
}
+   td->td_intr_nesting_level--;
critical_exit();
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241733 - in head/sys/dev: cxgb/ulp/tom cxgbe cxgbe/tom

2012-10-19 Thread Ed Schouten
Author: ed
Date: Fri Oct 19 13:26:40 2012
New Revision: 241733
URL: http://svn.freebsd.org/changeset/base/241733

Log:
  Prefer __containerof() over __member2struct().
  
  The former works better with qualifiers, but also properly type checks
  the input pointer.

Modified:
  head/sys/dev/cxgb/ulp/tom/cxgb_tom.h
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_l2t.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom.h
==
--- head/sys/dev/cxgb/ulp/tom/cxgb_tom.hFri Oct 19 13:05:51 2012
(r241732)
+++ head/sys/dev/cxgb/ulp/tom/cxgb_tom.hFri Oct 19 13:26:40 2012
(r241733)
@@ -142,7 +142,8 @@ void t3_process_tid_release_list(void *d
 static inline struct tom_data *
 t3_tomdata(struct toedev *tod)
 {
-   return (member2struct(tom_data, tod, tod));
+
+   return (__containerof(tod, struct tom_data, tod));
 }
 
 union listen_entry {

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hFri Oct 19 13:05:51 2012
(r241732)
+++ head/sys/dev/cxgbe/adapter.hFri Oct 19 13:26:40 2012
(r241733)
@@ -435,7 +435,7 @@ static inline struct sge_rxq *
 iq_to_rxq(struct sge_iq *iq)
 {
 
-   return (member2struct(sge_rxq, iq, iq));
+   return (__containerof(iq, struct sge_rxq, iq));
 }
 
 
@@ -450,7 +450,7 @@ static inline struct sge_ofld_rxq *
 iq_to_ofld_rxq(struct sge_iq *iq)
 {
 
-   return (member2struct(sge_ofld_rxq, iq, iq));
+   return (__containerof(iq, struct sge_ofld_rxq, iq));
 }
 #endif
 

Modified: head/sys/dev/cxgbe/t4_l2t.h
==
--- head/sys/dev/cxgbe/t4_l2t.h Fri Oct 19 13:05:51 2012(r241732)
+++ head/sys/dev/cxgbe/t4_l2t.h Fri Oct 19 13:26:40 2012(r241733)
@@ -94,7 +94,7 @@ int do_l2t_write_rpl(struct sge_iq *, co
 static inline void
 t4_l2t_release(struct l2t_entry *e)
 {
-   struct l2t_data *d = member2struct(l2t_data, l2tab[e->idx], e);
+   struct l2t_data *d = __containerof(e, struct l2t_data, l2tab[e->idx]);
 
if (atomic_fetchadd_int(&e->refcnt, -1) == 1)
atomic_add_int(&d->nfree, 1);

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cFri Oct 19 13:05:51 2012
(r241732)
+++ head/sys/dev/cxgbe/t4_main.cFri Oct 19 13:26:40 2012
(r241733)
@@ -3057,8 +3057,8 @@ t4_register_an_handler(struct adapter *s
 static int
 fw_msg_not_handled(struct adapter *sc, const __be64 *rpl)
 {
-   __be64 *r = __DECONST(__be64 *, rpl);
-   struct cpl_fw6_msg *cpl = member2struct(cpl_fw6_msg, data, r);
+   const struct cpl_fw6_msg *cpl =
+   __containerof(rpl, struct cpl_fw6_msg, data[0]);
 
 #ifdef INVARIANTS
panic("%s: fw_msg type %d", __func__, cpl->type);

Modified: head/sys/dev/cxgbe/tom/t4_tom.h
==
--- head/sys/dev/cxgbe/tom/t4_tom.h Fri Oct 19 13:05:51 2012
(r241732)
+++ head/sys/dev/cxgbe/tom/t4_tom.h Fri Oct 19 13:26:40 2012
(r241733)
@@ -205,7 +205,7 @@ static inline struct tom_data *
 tod_td(struct toedev *tod)
 {
 
-   return (member2struct(tom_data, tod, tod));
+   return (__containerof(tod, struct tom_data, tod));
 }
 
 static inline struct adapter *
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241731 - in head: contrib/libc-pwcache include lib/libc/gen

2012-10-19 Thread Brooks Davis
Author: brooks
Date: Fri Oct 19 12:44:22 2012
New Revision: 241731
URL: http://svn.freebsd.org/changeset/base/241731

Log:
  Replace our version of the pwcache(3) API with NetBSD's implementation.
  
  This adds two features:
   * uid_from_user() and gid_from_group() as the reverse of user_from_uid()
 and groups_from_gid().
   * pwcache_userdb() and pwcache_groupdb() which allow alternative lookup
 functions to be used.  For example lookups from passwd and group
 databases in a non-standard location.

Added:
  head/contrib/libc-pwcache/
 - copied from r241235, vendor/NetBSD/libc-pwcache/dist/
Deleted:
  head/lib/libc/gen/pwcache.3
  head/lib/libc/gen/pwcache.c
Modified:
  head/contrib/libc-pwcache/pwcache.3   (contents, props changed)
  head/contrib/libc-pwcache/pwcache.c   (contents, props changed)
  head/contrib/libc-pwcache/pwcache.h   (contents, props changed)
  head/include/grp.h
  head/include/pwd.h
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/gen/Symbol.map

Modified: head/contrib/libc-pwcache/pwcache.3
==
--- vendor/NetBSD/libc-pwcache/dist/pwcache.3   Fri Oct  5 20:19:28 2012
(r241235)
+++ head/contrib/libc-pwcache/pwcache.3 Fri Oct 19 12:44:22 2012
(r241731)
@@ -1,4 +1,5 @@
 .\"$NetBSD: pwcache.3,v 1.17 2008/05/02 18:11:04 martin Exp $
+.\"$FreeBSD$
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"The Regents of the University of California.  All rights reserved.
@@ -55,7 +56,7 @@
 .\"
 .\" @(#)pwcache.3  8.1 (Berkeley) 6/9/93
 .\"
-.Dd January 24, 2002
+.Dd October 19, 2012
 .Dt PWCACHE 3
 .Os
 .Sh NAME
@@ -217,4 +218,6 @@ The
 and
 .Fn pwcache_groupdb
 functions first appeared in
-.Nx 1.6 .
+.Nx 1.6
+and
+.Fx 10.0 .

Modified: head/contrib/libc-pwcache/pwcache.c
==
--- vendor/NetBSD/libc-pwcache/dist/pwcache.c   Fri Oct  5 20:19:28 2012
(r241235)
+++ head/contrib/libc-pwcache/pwcache.c Fri Oct 19 12:44:22 2012
(r241731)
@@ -77,6 +77,7 @@ static char sccsid[] = "@(#)cache.c   8.1 
 __RCSID("$NetBSD: pwcache.c,v 1.31 2010/03/23 20:28:59 drochner Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
+__FBSDID("$FreeBSD$");
 
 #include "namespace.h"
 
@@ -91,6 +92,8 @@ __RCSID("$NetBSD: pwcache.c,v 1.31 2010/
 #include 
 #include 
 
+#define_DIAGASSERT(x)  assert((x))
+
 #if HAVE_NBTOOL_CONFIG_H
 /* XXX Now, re-apply the renaming that we undid above. */
 #definegroup_from_gid  __nbcompat_group_from_gid

Modified: head/contrib/libc-pwcache/pwcache.h
==
--- vendor/NetBSD/libc-pwcache/dist/pwcache.h   Fri Oct  5 20:19:28 2012
(r241235)
+++ head/contrib/libc-pwcache/pwcache.h Fri Oct 19 12:44:22 2012
(r241731)
@@ -1,4 +1,5 @@
 /* $NetBSD: pwcache.h,v 1.5 2003/11/10 08:51:51 wiz Exp $  */
+/* $FreeBSD$   */
 
 /*-
  * Copyright (c) 1992 Keith Muller.

Modified: head/include/grp.h
==
--- head/include/grp.h  Fri Oct 19 12:28:26 2012(r241730)
+++ head/include/grp.h  Fri Oct 19 12:44:22 2012(r241731)
@@ -69,6 +69,10 @@ struct group *getgrgid(gid_t);
 struct group   *getgrnam(const char *);
 #if __BSD_VISIBLE
 const char *group_from_gid(gid_t, int);
+int gid_from_group(const char *, gid_t *);
+int pwcache_groupdb(int (*)(int), void (*)(void),
+   struct group * (*)(const char *),
+   struct group * (*)(gid_t));
 #endif
 #if __BSD_VISIBLE || __XSI_VISIBLE
 /* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */

Modified: head/include/pwd.h
==
--- head/include/pwd.h  Fri Oct 19 12:28:26 2012(r241730)
+++ head/include/pwd.h  Fri Oct 19 12:44:22 2012(r241731)
@@ -165,6 +165,10 @@ int getpwuid_r(uid_t, struct passwd *,
 int getpwent_r(struct passwd *, char *, size_t, struct passwd **);
 int setpassent(int);
 const char *user_from_uid(uid_t, int);
+int uid_from_user(const char *, uid_t *);
+int pwcache_userdb(int (*)(int), void (*)(void),
+   struct passwd * (*)(const char *),
+   struct passwd * (*)(uid_t));
 #endif
 __END_DECLS
 

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Fri Oct 19 12:28:26 2012
(r241730)
+++ head/lib/libc/gen/Makefile.inc  Fri Oct 19 12:44:22 2012
(r241731)
@@ -24,7 +24,7 @@ SRCS+=  __getosreldate.c __xuname.c \
lockf.c lrand48.c mrand48.c nftw.c nice.c \
nlist.c nrand48.c opendir.c \
pause.c pmadvise.c popen.c posix_spawn.c \
-   psignal.c pututxline.c p

svn commit: r241730 - head/usr.bin/top

2012-10-19 Thread John Baldwin
Author: jhb
Date: Fri Oct 19 12:28:26 2012
New Revision: 241730
URL: http://svn.freebsd.org/changeset/base/241730

Log:
  Correct the order of the MFU and MRU labels.  I had reversed them.
  
  Submitted by: Nikolay Denev  ndenev gmail
  Pointy hat to:jhb
  MFC after:3 days

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==
--- head/usr.bin/top/machine.c  Fri Oct 19 12:16:29 2012(r241729)
+++ head/usr.bin/top/machine.c  Fri Oct 19 12:28:26 2012(r241730)
@@ -178,7 +178,7 @@ char *memorynames[] = {
 
 int arc_stats[7];
 char *arcnames[] = {
-   "K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K Other",
+   "K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other",
NULL
 };
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241729 - head/sys/kern

2012-10-19 Thread Andre Oppermann
Author: andre
Date: Fri Oct 19 12:16:29 2012
New Revision: 241729
URL: http://svn.freebsd.org/changeset/base/241729

Log:
  Move socket UMA zone initialization functionality together into
  one place.

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Fri Oct 19 11:01:39 2012(r241728)
+++ head/sys/kern/uipc_socket.c Fri Oct 19 12:16:29 2012(r241729)
@@ -173,11 +173,8 @@ static struct filterops sowrite_filtops 
.f_event = filt_sowrite,
 };
 
-uma_zone_t socket_zone;
 so_gen_t   so_gencnt;  /* generation count for sockets */
 
-intmaxsockets;
-
 MALLOC_DEFINE(M_SONAME, "soname", "socket name");
 MALLOC_DEFINE(M_PCB, "pcb", "protocol control block");
 
@@ -230,6 +227,9 @@ SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLA
  * Initialize the socket subsystem and set up the socket
  * memory allocator.
  */
+uma_zone_t socket_zone;
+intmaxsockets;
+
 static void
 socket_zone_change(void *tag)
 {
@@ -250,6 +250,19 @@ socket_init(void *tag)
 SYSINIT(socket, SI_SUB_PROTO_DOMAININIT, SI_ORDER_ANY, socket_init, NULL);
 
 /*
+ * Initialise maxsockets.  This SYSINIT must be run after
+ * tunable_mbinit().
+ */
+static void
+init_maxsockets(void *ignored)
+{
+
+   TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets);
+   maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters));
+}
+SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL);
+
+/*
  * Sysctl to get and set the maximum global sockets limit.  Notify protocols
  * of the change so that they can update their dependent limits as required.
  */
@@ -273,25 +286,11 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS)
}
return (error);
 }
-
 SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, CTLTYPE_INT|CTLFLAG_RW,
 &maxsockets, 0, sysctl_maxsockets, "IU",
 "Maximum number of sockets avaliable");
 
 /*
- * Initialise maxsockets.  This SYSINIT must be run after
- * tunable_mbinit().
- */
-static void
-init_maxsockets(void *ignored)
-{
-
-   TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets);
-   maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters));
-}
-SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL);
-
-/*
  * Socket operation routines.  These routines are called by the routines in
  * sys_socket.c or from a system process, and implement the semantics of
  * socket operations by switching out to the protocol specific routines.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2012-10-19 Thread Joel Dahl
Author: joel (doc committer)
Date: Fri Oct 19 10:38:32 2012
New Revision: 241727
URL: http://svn.freebsd.org/changeset/base/241727

Log:
  Fix minor whitespace issues.

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

Modified: head/share/man/man4/est.4
==
--- head/share/man/man4/est.4   Fri Oct 19 10:15:32 2012(r241726)
+++ head/share/man/man4/est.4   Fri Oct 19 10:38:32 2012(r241727)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 18 , 2012
+.Dd October 18, 2012
 .Dt EST 4
 .Os
 .Sh NAME
@@ -88,8 +88,8 @@ For example
 .Va cpu0 .
 .It Va dev.est.%d.freq_settings .
 The valid frequencies that are allowed by this CPU and their step values.
-.It dev.est.0.freq_settings: 2201/45000 2200/45000 2000/39581 1900/37387 
-1800/34806 1700/32703 1600/30227 1500/28212 1400/25828 1300/23900 1200/21613 
+.It dev.est.0.freq_settings: 2201/45000 2200/45000 2000/39581 1900/37387
+1800/34806 1700/32703 1600/30227 1500/28212 1400/25828 1300/23900 1200/21613
 1100/19775 1000/17582 900/15437 800/13723
 .Pp
 .El
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241726 - head/sys/kern

2012-10-19 Thread Andre Oppermann
Author: andre
Date: Fri Oct 19 10:15:32 2012
New Revision: 241726
URL: http://svn.freebsd.org/changeset/base/241726

Log:
  Move UMA socket zone initialization from uipc_domain.c to uipc_socket.c
  into one place next to its other related functions to avoid confusion.

Modified:
  head/sys/kern/uipc_domain.c
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_domain.c
==
--- head/sys/kern/uipc_domain.c Fri Oct 19 10:07:55 2012(r241725)
+++ head/sys/kern/uipc_domain.c Fri Oct 19 10:15:32 2012(r241726)
@@ -239,28 +239,11 @@ domain_add(void *data)
mtx_unlock(&dom_mtx);
 }
 
-static void
-socket_zone_change(void *tag)
-{
-
-   uma_zone_set_max(socket_zone, maxsockets);
-}
-
 /* ARGSUSED*/
 static void
 domaininit(void *dummy)
 {
 
-   /*
-* Before we do any setup, make sure to initialize the
-* zone allocator we get struct sockets from.
-*/
-   socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL,
-   NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
-   uma_zone_set_max(socket_zone, maxsockets);
-   EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL,
-   EVENTHANDLER_PRI_FIRST);
-
if (max_linkhdr < 16)   /* XXX */
max_linkhdr = 16;
 

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Fri Oct 19 10:07:55 2012(r241725)
+++ head/sys/kern/uipc_socket.c Fri Oct 19 10:15:32 2012(r241726)
@@ -227,6 +227,29 @@ MTX_SYSINIT(so_global_mtx, &so_global_mt
 SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLAG_RW, 0, "IPC");
 
 /*
+ * Initialize the socket subsystem and set up the socket
+ * memory allocator.
+ */
+static void
+socket_zone_change(void *tag)
+{
+
+   uma_zone_set_max(socket_zone, maxsockets);
+}
+
+static void
+socket_init(void *tag)
+{
+
+socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL,
+NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+uma_zone_set_max(socket_zone, maxsockets);
+EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL,
+EVENTHANDLER_PRI_FIRST);
+}
+SYSINIT(socket, SI_SUB_PROTO_DOMAININIT, SI_ORDER_ANY, socket_init, NULL);
+
+/*
  * Sysctl to get and set the maximum global sockets limit.  Notify protocols
  * of the change so that they can update their dependent limits as required.
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r241688 - head/sys/net

2012-10-19 Thread Andre Oppermann

On 18.10.2012 16:11, Gleb Smirnoff wrote:

On Thu, Oct 18, 2012 at 02:08:26PM +, Andre Oppermann wrote:
A> Author: andre
A> Date: Thu Oct 18 14:08:26 2012
A> New Revision: 241688
A> URL: http://svn.freebsd.org/changeset/base/241688
A>
A> Log:
A>   Use LOG_WARNING level in in_attachdomain1() instead of printf().
A>
A>   Submitted by:   vijju.singh-at-gmail.com
A>
A> Modified:
A>   head/sys/net/if.c
A>
A> Modified: head/sys/net/if.c
A> 
==
A> --- head/sys/net/if.c Thu Oct 18 13:57:28 2012(r241687)
A> +++ head/sys/net/if.c Thu Oct 18 14:08:26 2012(r241688)
A> @@ -711,8 +711,8 @@ if_attachdomain1(struct ifnet *ifp)
A>   return;
A>   if (ifp->if_afdata_initialized >= domain_init_status) {
A>   IF_AFDATA_UNLOCK(ifp);
A> - printf("if_attachdomain called more than once on %s\n",
A> - ifp->if_xname);
A> + log(LOG_WARNING, "if_attachdomain called more than once "
A> + "on %s\n", ifp->if_xname);
A>   return;
A>   }
A>   ifp->if_afdata_initialized = domain_init_status;

It'll be even more perfect if done as

"%s called more than once on %s\n", __func__, ifp->if_xname


Thanks, done in r241725.


And do we need "\n" for log(9)?


Yes.

--
Andre

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


svn commit: r241725 - head/sys/net

2012-10-19 Thread Andre Oppermann
Author: andre
Date: Fri Oct 19 10:07:55 2012
New Revision: 241725
URL: http://svn.freebsd.org/changeset/base/241725

Log:
  Update to previous r241688 to use __func__ instead of spelled out function
  name in log(9) message.
  
  Suggested by: glebius

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Fri Oct 19 10:04:43 2012(r241724)
+++ head/sys/net/if.c   Fri Oct 19 10:07:55 2012(r241725)
@@ -711,8 +711,8 @@ if_attachdomain1(struct ifnet *ifp)
return;
if (ifp->if_afdata_initialized >= domain_init_status) {
IF_AFDATA_UNLOCK(ifp);
-   log(LOG_WARNING, "if_attachdomain called more than once "
-   "on %s\n", ifp->if_xname);
+   log(LOG_WARNING, "%s called more than once on %s\n",
+   __func__, ifp->if_xname);
return;
}
ifp->if_afdata_initialized = domain_init_status;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241724 - head/sys/sys

2012-10-19 Thread Andre Oppermann
Author: andre
Date: Fri Oct 19 10:04:43 2012
New Revision: 241724
URL: http://svn.freebsd.org/changeset/base/241724

Log:
  Remove splimp() comment from sysinit table and attribute SI_SUB_PROTO_BEGIN
  and SI_SUB_PROTO_END to VNET related initializations.
  
  MFC after:3 days

Modified:
  head/sys/sys/kernel.h

Modified: head/sys/sys/kernel.h
==
--- head/sys/sys/kernel.h   Fri Oct 19 09:41:45 2012(r241723)
+++ head/sys/sys/kernel.h   Fri Oct 19 10:04:43 2012(r241724)
@@ -84,12 +84,6 @@ extern int ticks;
  * The SI_SUB_SWAP values represent a value used by
  * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent
  * order to support porting.
- *
- * The SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END bracket a range of
- * initializations to take place at splimp().  This is a historical
- * wart that should be removed -- probably running everything at
- * splimp() until the first init that doesn't want it is the correct
- * fix.  They are currently present to ensure historical behavior.
  */
 enum sysinit_sub_id {
SI_SUB_DUMMY= 0x000,/* not executed; for linker*/
@@ -147,12 +141,12 @@ enum sysinit_sub_id {
SI_SUB_P1003_1B = 0x6E0,/* P1003.1B realtime */
SI_SUB_PSEUDO   = 0x700,/* pseudo devices*/
SI_SUB_EXEC = 0x740,/* execve() handlers */
-   SI_SUB_PROTO_BEGIN  = 0x800,/* XXX: set splimp (kludge)*/
+   SI_SUB_PROTO_BEGIN  = 0x800,/* VNET initialization */
SI_SUB_PROTO_IF = 0x840,/* interfaces*/
SI_SUB_PROTO_DOMAININIT = 0x860,/* domain registration system */
SI_SUB_PROTO_DOMAIN = 0x880,/* domains (address families?)*/
SI_SUB_PROTO_IFATTACHDOMAIN = 0x881,/* domain dependent 
data init*/
-   SI_SUB_PROTO_END= 0x8ff,/* XXX: set splx (kludge)*/
+   SI_SUB_PROTO_END= 0x8ff,/* VNET helper functions */
SI_SUB_KPROF= 0x900,/* kernel profiling*/
SI_SUB_KICK_SCHEDULER   = 0xa00,/* start the timeout events*/
SI_SUB_INT_CONFIG_HOOKS = 0xa80,/* Interrupts enabled config */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r241723 - head/sys/dev/netmap

2012-10-19 Thread Gleb Smirnoff
Author: glebius
Date: Fri Oct 19 09:41:45 2012
New Revision: 241723
URL: http://svn.freebsd.org/changeset/base/241723

Log:
  Fix build.

Modified:
  head/sys/dev/netmap/netmap.c

Modified: head/sys/dev/netmap/netmap.c
==
--- head/sys/dev/netmap/netmap.cFri Oct 19 08:53:07 2012
(r241722)
+++ head/sys/dev/netmap/netmap.cFri Oct 19 09:41:45 2012
(r241723)
@@ -507,8 +507,8 @@ netmap_mmap_single(struct cdev *cdev, vm
 {
vm_object_t obj;
 
-   D("cdev %p foff %d size %d objp %p prot %d", cdev, *foff,
-   objsize, objp, prot);
+   D("cdev %p foff %jd size %jd objp %p prot %d", cdev,
+   (intmax_t )*foff, (intmax_t )objsize, objp, prot);
obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff,
 curthread->td_ucred);
ND("returns obj %p", obj);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"