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


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


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


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: 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: 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: 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: 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 syslog.h
 
-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


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


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 hiren.panchas...@gmail.com
  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 = 

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


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 machine/asi.h
 #include machine/asmacros.h
 #include machine/intr_machdep.h
-#include machine/ktr.h
 #include machine/pstate.h
 #include machine/ver.h
 
@@ -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


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: 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: 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 cao bus net
  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((void *)sc-chan);
-}
+

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


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


+