svn commit: r234829 - head/lib/libc/sys

2012-04-30 Thread Robert Watson
Author: rwatson
Date: Mon Apr 30 07:32:39 2012
New Revision: 234829
URL: http://svn.freebsd.org/changeset/base/234829

Log:
  The returned file descriptor from pdfork(2) is via fdp, not pidp.
  
  Submitted by: Norman Hardy
  MFC after:3 days

Modified:
  head/lib/libc/sys/pdfork.2

Modified: head/lib/libc/sys/pdfork.2
==
--- head/lib/libc/sys/pdfork.2  Mon Apr 30 06:54:44 2012(r234828)
+++ head/lib/libc/sys/pdfork.2  Mon Apr 30 07:32:39 2012(r234829)
@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (c) 2009-2010 Robert N. M. Watson
+.\" Copyright (c) 2009-2010, 2012 Robert N. M. Watson
 .\" All rights reserved.
 .\"
 .\" This software was developed at the University of Cambridge Computer
@@ -57,7 +57,7 @@ a variant of
 .Xr fork 2 ,
 which, if successful, returns a process descriptor in the integer pointed to
 by
-.Fa pidp .
+.Fa fdp .
 Processes created via
 .Fn pdfork
 will not cause
___
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: r234830 - head/lib/libc/sys

2012-04-30 Thread Robert Watson
Author: rwatson
Date: Mon Apr 30 08:00:52 2012
New Revision: 234830
URL: http://svn.freebsd.org/changeset/base/234830

Log:
  fix a further typo in the pdfork(2) man page.
  
  Submitted by: Norman Hardy
  MFC after:3 days

Modified:
  head/lib/libc/sys/pdfork.2

Modified: head/lib/libc/sys/pdfork.2
==
--- head/lib/libc/sys/pdfork.2  Mon Apr 30 07:32:39 2012(r234829)
+++ head/lib/libc/sys/pdfork.2  Mon Apr 30 08:00:52 2012(r234830)
@@ -76,7 +76,7 @@ This option is not permitted in Capsicum
 .El
 .Pp
 .Fn pdgetpid
-queries the process ID (PID) if the process descriptor
+queries the process ID (PID) in the process descriptor
 .Fa fd .
 .Pp
 .Fn pdkill
___
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: r234831 - head/sys/dev/cxgbe

2012-04-30 Thread Navdeep Parhar
Author: np
Date: Mon Apr 30 08:44:10 2012
New Revision: 234831
URL: http://svn.freebsd.org/changeset/base/234831

Log:
  Make sure that the firmware version is available in
  dev.t4nex.X.firmware_version even if the driver fails to attach
  properly.  At least it'll be easy to tell what we're dealing with.
  
  MFC after:1 week

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Apr 30 08:00:52 2012
(r234830)
+++ head/sys/dev/cxgbe/t4_main.cMon Apr 30 08:44:10 2012
(r234831)
@@ -1449,6 +1449,11 @@ prep_firmware(struct adapter *sc)
 
/* Check firmware version and install a different one if necessary */
rc = t4_check_fw_version(sc);
+   snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u",
+   G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
+   G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
+   G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
+   G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
if (rc != 0) {
uint32_t v = 0;
 
@@ -1505,6 +1510,12 @@ prep_firmware(struct adapter *sc)
} else {
/* refresh */
(void) t4_check_fw_version(sc);
+   snprintf(sc->fw_version,
+   sizeof(sc->fw_version), "%u.%u.%u.%u",
+   G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
+   G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
+   G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
+   G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
}
}
}
@@ -1548,11 +1559,6 @@ prep_firmware(struct adapter *sc)
goto done;  /* error message displayed already */
}
 
-   snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u",
-   G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
-   G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
-   G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
-   G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
sc->flags |= FW_OK;
 
 done:
___
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: r234832 - head/sys/netinet

2012-04-30 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 30 08:44:21 2012
New Revision: 234832
URL: http://svn.freebsd.org/changeset/base/234832

Log:
  Add support for missing gauth_number_of_chunks field. This Bug was
  found by Irene Ruengeler.
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_uio.h
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_uio.h
==
--- head/sys/netinet/sctp_uio.h Mon Apr 30 08:44:10 2012(r234831)
+++ head/sys/netinet/sctp_uio.h Mon Apr 30 08:44:21 2012(r234832)
@@ -660,6 +660,7 @@ struct sctp_authkeyid {
 /* SCTP_PEER_AUTH_CHUNKS / SCTP_LOCAL_AUTH_CHUNKS */
 struct sctp_authchunks {
sctp_assoc_t gauth_assoc_id;
+   uint32_t gauth_number_of_chunks;
uint8_t gauth_chunks[];
 };
 

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Mon Apr 30 08:44:10 2012
(r234831)
+++ head/sys/netinet/sctp_usrreq.c  Mon Apr 30 08:44:21 2012
(r234832)
@@ -2879,6 +2879,7 @@ flags_out:
} else {
/* copy in the chunks */

(void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+   sac->gauth_number_of_chunks = 
(uint32_t) size;
*optsize = sizeof(struct 
sctp_authchunks) + size;
}
SCTP_TCB_UNLOCK(stcb);
@@ -2897,6 +2898,7 @@ flags_out:
} else {
/* copy in the chunks */

(void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+   sac->gauth_number_of_chunks = 
(uint32_t) size;
*optsize = sizeof(struct 
sctp_authchunks) + size;
}
SCTP_INP_RUNLOCK(inp);
@@ -2927,6 +2929,7 @@ flags_out:
} else {
/* copy in the chunks */

(void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+   sac->gauth_number_of_chunks = 
(uint32_t) size;
*optsize = sizeof(struct 
sctp_authchunks) + size;
}
SCTP_TCB_UNLOCK(stcb);
___
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: r233937 - in head/sys: kern net security/mac

2012-04-30 Thread Alexander V. Chernikov

On 28.04.2012 00:42, Adrian Chadd wrote:

Hi Alex,

Hello!


I don't want to be demanding, but would you please consider committing
your fixes?
I've asked glebius@ for the review for a while ago, but it seems it is a 
bit staled..




And if you could, would you please do it as a set of commits, one per
'thing', rather than one big monolithic commit that does half a dozen
different things? That way if there are any further regressions,
I/others could test things out.

Ok, I'll try to commit fixes today.


This is breaking bpf for a few people - ladv causes a crash, wifi also
causes a crash.

Thanks!


Adrian



___
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: r234833 - in head: share/man/man4 sys/dev/cxgbe

2012-04-30 Thread Navdeep Parhar
Author: np
Date: Mon Apr 30 09:46:05 2012
New Revision: 234833
URL: http://svn.freebsd.org/changeset/base/234833

Log:
  Change the default to not use packet counters to generate rx interrupts.
  Rely solely on the timer based mechanism.
  
  Update man page to reflect this change.
  
  MFC after:1 week

Modified:
  head/share/man/man4/cxgbe.4
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/share/man/man4/cxgbe.4
==
--- head/share/man/man4/cxgbe.4 Mon Apr 30 08:44:21 2012(r234832)
+++ head/share/man/man4/cxgbe.4 Mon Apr 30 09:46:05 2012(r234833)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2011, Chelsio Inc
+.\" Copyright (c) 2011-2012, Chelsio Inc
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -145,10 +145,9 @@ dev.cxgbe.X.holdoff_tmr_idx sysctl.
 The packet-count index value to use to delay interrupts.
 The packet-count list has the values 1, 8, 16, and 32 by default
 and the index selects a value from this list.
-The default value is 2 for both 10Gb and 1Gb ports, which means 16
-packets (or the holdoff timer going off) before an interrupt is
-generated.
--1 disables packet counting.
+The default value is -1 for both 10Gb and 1Gb ports, which means packet
+counting is disabled and interrupts are generated based solely on the
+holdoff timer value.
 Different cxgbe interfaces can be assigned different values via the
 dev.cxgbe.X.holdoff_pktc_idx sysctl.
 This sysctl works only when the interface has never been marked up (as done by

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Apr 30 08:44:21 2012
(r234832)
+++ head/sys/dev/cxgbe/t4_main.cMon Apr 30 09:46:05 2012
(r234833)
@@ -174,7 +174,7 @@ TUNABLE_INT("hw.cxgbe.nofldrxq1g", &t4_n
 static int t4_tmr_idx_10g = TMR_IDX_10G;
 TUNABLE_INT("hw.cxgbe.holdoff_timer_idx_10G", &t4_tmr_idx_10g);
 
-#define PKTC_IDX_10G 2
+#define PKTC_IDX_10G (-1)
 static int t4_pktc_idx_10g = PKTC_IDX_10G;
 TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_10G", &t4_pktc_idx_10g);
 
@@ -182,7 +182,7 @@ TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_1
 static int t4_tmr_idx_1g = TMR_IDX_1G;
 TUNABLE_INT("hw.cxgbe.holdoff_timer_idx_1G", &t4_tmr_idx_1g);
 
-#define PKTC_IDX_1G 2
+#define PKTC_IDX_1G (-1)
 static int t4_pktc_idx_1g = PKTC_IDX_1G;
 TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_1G", &t4_pktc_idx_1g);
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Mon Apr 30 08:44:21 2012(r234832)
+++ head/sys/dev/cxgbe/t4_sge.c Mon Apr 30 09:46:05 2012(r234833)
@@ -1420,9 +1420,12 @@ init_iq(struct sge_iq *iq, struct adapte
 
iq->flags = 0;
iq->adapter = sc;
-   iq->intr_params = V_QINTR_TIMER_IDX(tmr_idx) |
-   V_QINTR_CNT_EN(pktc_idx >= 0);
-   iq->intr_pktc_idx = pktc_idx;
+   iq->intr_params = V_QINTR_TIMER_IDX(tmr_idx);
+   iq->intr_pktc_idx = SGE_NCOUNTERS - 1;
+   if (pktc_idx >= 0) {
+   iq->intr_params |= F_QINTR_CNT_EN;
+   iq->intr_pktc_idx = pktc_idx;
+   }
iq->qsize = roundup(qsize, 16); /* See FW_IQ_CMD/iqsize */
iq->esize = max(esize, 16); /* See FW_IQ_CMD/iqesize */
strlcpy(iq->lockname, name, sizeof(iq->lockname));
___
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: r234834 - in head/sys: contrib/pf/net net netinet netinet/ipfw ofed/drivers/infiniband/ulp/ipoib

2012-04-30 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon Apr 30 10:22:23 2012
New Revision: 234834
URL: http://svn.freebsd.org/changeset/base/234834

Log:
  Move several enums and structures required for L2 filtering from 
ip_fw_private.h to ip_fw.h.
  Remove ipfw/ip_fw_private.h header from non-ipfw code.
  
  Approved by:ae(mentor)
  MFC after:  2 weeks

Modified:
  head/sys/contrib/pf/net/pf.c
  head/sys/net/if_bridge.c
  head/sys/net/if_ethersubr.c
  head/sys/netinet/ip_fw.h
  head/sys/netinet/ipfw/ip_fw_private.h
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h

Modified: head/sys/contrib/pf/net/pf.c
==
--- head/sys/contrib/pf/net/pf.cMon Apr 30 09:46:05 2012
(r234833)
+++ head/sys/contrib/pf/net/pf.cMon Apr 30 10:22:23 2012
(r234834)
@@ -122,7 +122,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #ifdef __FreeBSD__
 #include 
-#include  /* XXX: only for DIR_IN/DIR_OUT */
 #endif
 
 #ifndef __FreeBSD__

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cMon Apr 30 09:46:05 2012(r234833)
+++ head/sys/net/if_bridge.cMon Apr 30 10:22:23 2012(r234834)
@@ -132,7 +132,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 
 /*
  * Size of the route hash table.  Must be a power of two.

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Mon Apr 30 09:46:05 2012(r234833)
+++ head/sys/net/if_ethersubr.c Mon Apr 30 10:22:23 2012(r234834)
@@ -72,7 +72,6 @@
 #include 
 #include 
 #include 
-#include 
 #endif
 #ifdef INET6
 #include 

Modified: head/sys/netinet/ip_fw.h
==
--- head/sys/netinet/ip_fw.hMon Apr 30 09:46:05 2012(r234833)
+++ head/sys/netinet/ip_fw.hMon Apr 30 10:22:23 2012(r234834)
@@ -545,6 +545,88 @@ struct ipfw_flow_id {
 
 #define IS_IP6_FLOW_ID(id) ((id)->addr_type == 6)
 
+#ifdef _KERNEL
+/* Return values from ipfw_[ether_]chk() */
+enum {
+   IP_FW_PASS = 0,
+   IP_FW_DENY,
+   IP_FW_DIVERT,
+   IP_FW_TEE,
+   IP_FW_DUMMYNET,
+   IP_FW_NETGRAPH,
+   IP_FW_NGTEE,
+   IP_FW_NAT,
+   IP_FW_REASS,
+};
+
+/*
+ * Hooks sometime need to know the direction of the packet
+ * (divert, dummynet, netgraph, ...)
+ * We use a generic definition here, with bit0-1 indicating the
+ * direction, bit 2 indicating layer2 or 3, bit 3-4 indicating the
+ * specific protocol (if necessary)
+ */
+enum {
+   DIR_MASK =  0x3,
+   DIR_OUT =   0,
+   DIR_IN =1,
+   DIR_FWD =   2,
+   DIR_DROP =  3,
+   PROTO_LAYER2 =  0x4, /* set for layer 2 */
+   /* PROTO_DEFAULT = 0, */
+   PROTO_IPV4 =0x08,
+   PROTO_IPV6 =0x10,
+   PROTO_IFB = 0x0c, /* layer2 + ifbridge */
+   /*  PROTO_OLDBDG =  0x14, unused, old bridge */
+};
+
+/*
+ * Structure for collecting parameters to dummynet for ip6_output forwarding
+ */
+struct _ip6dn_args {
+   struct ip6_pktopts *opt_or;
+   struct route_in6 ro_or;
+   int flags_or;
+   struct ip6_moptions *im6o_or;
+   struct ifnet *origifp_or;
+   struct ifnet *ifp_or;
+   struct sockaddr_in6 dst_or;
+   u_long mtu_or;
+   struct route_in6 ro_pmtu_or;
+};
+
+/*
+ * Arguments for calling ipfw_chk() and dummynet_io(). We put them
+ * all into a structure because this way it is easier and more
+ * efficient to pass variables around and extend the interface.
+ */
+struct ip_fw_args {
+   struct mbuf *m; /* the mbuf chain   */
+   struct ifnet*oif;   /* output interface */
+   struct sockaddr_in *next_hop;   /* forward address  */
+   struct sockaddr_in6 *next_hop6; /* ipv6 forward address */
+
+   /*
+* On return, it points to the matching rule.
+* On entry, rule.slot > 0 means the info is valid and
+* contains the starting rule for an ipfw search.
+* If chain_id == chain->id && slot >0 then jump to that slot.
+* Otherwise, we locate the first rule >= rulenum:rule_id
+*/
+   struct ipfw_rule_ref rule;  /* match/restart info   */
+
+   struct ether_header *eh;/* for bridged packets  */
+
+   struct ipfw_flow_id f_id;   /* grabbed from IP header   */
+   //uint32_t  cookie; /* a cookie depending on rule action */
+   struct inpcb*inp;
+
+   struct _ip6dn_args  dummypar; /* dummynet->ip6_output */
+   struct sockaddr_in hopstore;/* store here if cannot use a pointer */
+};
+
+#endif /* _KERNEL */
+
 /*
  * Dynamic ipfw rule.
  */

Modified: head/sys/netinet/ipfw/ip_fw_private.h
=

svn commit: r234836 - head/lib/libc/stdio

2012-04-30 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Mon Apr 30 11:28:17 2012
New Revision: 234836
URL: http://svn.freebsd.org/changeset/base/234836

Log:
  Remove incorrect __restrict qualifier on several pointers
  
  The typical case was:
  static __inline int
  convert_ccl(FILE *fp, char * __restrict p, [...])
  {
  [...]
  
  if (p == SUPPRESS_PTR) {
[...]
} else {
[...]
}
  
[...]
  }
  
  This qualifier says that the pointer is the only one at that time
  pointing to the resource.
  
  Here, clang considers that "p" will never match "SUPPRESS_PTR" and
  optimize the if{} block out. This leads to segfaults in programs calling
  vfscanf(3) and vfwscanf(3) with just the format string (no arguments
  following it).
  
  The following softwares were reported to abort with segmentation fault
  and this patch fixes it:
  o  cmake
  o  smartd
  o  devel/ORBit2
  
  dim@ opened an LLVM PR to discuss this clang optimization:
  http://llvm.org/bugs/show_bug.cgi?id=12656
  
  Tested by:bsam@

Modified:
  head/lib/libc/stdio/vfscanf.c
  head/lib/libc/stdio/vfwscanf.c

Modified: head/lib/libc/stdio/vfscanf.c
==
--- head/lib/libc/stdio/vfscanf.c   Mon Apr 30 11:14:46 2012
(r234835)
+++ head/lib/libc/stdio/vfscanf.c   Mon Apr 30 11:28:17 2012
(r234836)
@@ -125,7 +125,7 @@ static const mbstate_t initial_mbs;
  */
 
 static __inline int
-convert_char(FILE *fp, char * __restrict p, int width)
+convert_char(FILE *fp, char * p, int width)
 {
int n;
 
@@ -151,7 +151,7 @@ convert_char(FILE *fp, char * __restrict
return (sum);
} else {
size_t r = __fread(p, 1, width, fp);
-   
+
if (r == 0)
return (-1);
return (r);
@@ -179,7 +179,7 @@ convert_wchar(FILE *fp, wchar_t *wcp, in
 }
 
 static __inline int
-convert_ccl(FILE *fp, char * __restrict p, int width, const char *ccltab)
+convert_ccl(FILE *fp, char * p, int width, const char *ccltab)
 {
char *p0;
int n;
@@ -249,7 +249,7 @@ convert_wccl(FILE *fp, wchar_t *wcp, int
 }
 
 static __inline int
-convert_string(FILE *fp, char * __restrict p, int width)
+convert_string(FILE *fp, char * p, int width)
 {
char *p0;
int n;
@@ -387,7 +387,7 @@ parseint(FILE *fp, char * __restrict buf
goto ok;
}
break;
-   
+
/*
 * x ok iff flag still set & 2nd char (or 3rd char if
 * we have a sign).

Modified: head/lib/libc/stdio/vfwscanf.c
==
--- head/lib/libc/stdio/vfwscanf.c  Mon Apr 30 11:14:46 2012
(r234835)
+++ head/lib/libc/stdio/vfwscanf.c  Mon Apr 30 11:28:17 2012
(r234836)
@@ -138,7 +138,7 @@ static const mbstate_t initial_mbs;
  */
 
 static __inline int
-convert_char(FILE *fp, char * __restrict mbp, int width, locale_t locale)
+convert_char(FILE *fp, char * mbp, int width, locale_t locale)
 {
mbstate_t mbs;
size_t nconv;
@@ -179,7 +179,7 @@ convert_wchar(FILE *fp, wchar_t *wcp, in
 }
 
 static __inline int
-convert_ccl(FILE *fp, char * __restrict mbp, int width, const struct ccl *ccl,
+convert_ccl(FILE *fp, char * mbp, int width, const struct ccl *ccl,
 locale_t locale)
 {
mbstate_t mbs;
@@ -237,7 +237,7 @@ convert_wccl(FILE *fp, wchar_t *wcp, int
 }
 
 static __inline int
-convert_string(FILE *fp, char * __restrict mbp, int width, locale_t locale)
+convert_string(FILE *fp, char * mbp, int width, locale_t locale)
 {
mbstate_t mbs;
size_t nconv;
@@ -372,7 +372,7 @@ parseint(FILE *fp, wchar_t *buf, int wid
goto ok;
}
break;
-   
+
/*
 * x ok iff flag still set & 2nd char (or 3rd char if
 * we have a sign).
___
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: r234834 - in head/sys: contrib/pf/net net netinet netinet/ipfw ofed/drivers/infiniband/ulp/ipoib

2012-04-30 Thread Luigi Rizzo
On Mon, Apr 30, 2012 at 10:22:23AM +, Alexander V. Chernikov wrote:
> Author: melifaro
> Date: Mon Apr 30 10:22:23 2012
> New Revision: 234834
> URL: http://svn.freebsd.org/changeset/base/234834
> 
> Log:
>   Move several enums and structures required for L2 filtering from 
> ip_fw_private.h to ip_fw.h.

I would be really grateful if you could revert this back and discuss
what you wanted to achieve with this change other than saving one
entry in the list of includes.

As clearly mentioned in the commit logs

http://svnweb.freebsd.org/base?view=revision&revision=200580

when i did the last revision of the ipfw+dummynet code i tried
to put a strong separation between what is visible in userland
(ip_fw.h and ip_dummynet.h) and kernel specific stuff.
This way changes in the kernel code do not need to affect userland,
modify installed headers and so on.

This is why kernel-specific definitions were put in private files.
We may discuss on the filename, ip_fw_kernel.h may be a better fit,
but merging back kernel and userland defs is a bad design decision.

20-30 years ago there were good reasons to use a single header
for all sorts of definitions: user-only, kernel-only, and kernel-userland API.
Machines were slow, disks were small, portability was not a big deal.

These days none of these conditions apply and keeping things
separate helps maintainance and avoid accidental pollution of
definitions and their misuse.

Besides, keep in mind that ipfw and dummynet are meant to work
on multiple platforms so this change is causing portability troubles.

cheers
luigi

>   Approved by:ae(mentor)
>   MFC after:  2 weeks
> 
> Modified:
>   head/sys/contrib/pf/net/pf.c
>   head/sys/net/if_bridge.c
>   head/sys/net/if_ethersubr.c
>   head/sys/netinet/ip_fw.h
>   head/sys/netinet/ipfw/ip_fw_private.h
>   head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h
> 
> Modified: head/sys/contrib/pf/net/pf.c
> ==
> --- head/sys/contrib/pf/net/pf.c  Mon Apr 30 09:46:05 2012
> (r234833)
> +++ head/sys/contrib/pf/net/pf.c  Mon Apr 30 10:22:23 2012
> (r234834)
> @@ -122,7 +122,6 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #ifdef __FreeBSD__
>  #include 
> -#include  /* XXX: only for DIR_IN/DIR_OUT */
>  #endif
>  
>  #ifndef __FreeBSD__
> 
> Modified: head/sys/net/if_bridge.c
> ==
> --- head/sys/net/if_bridge.c  Mon Apr 30 09:46:05 2012(r234833)
> +++ head/sys/net/if_bridge.c  Mon Apr 30 10:22:23 2012(r234834)
> @@ -132,7 +132,6 @@ __FBSDID("$FreeBSD$");
>  
>  #include 
>  #include 
> -#include 
>  
>  /*
>   * Size of the route hash table.  Must be a power of two.
> 
> Modified: head/sys/net/if_ethersubr.c
> ==
> --- head/sys/net/if_ethersubr.c   Mon Apr 30 09:46:05 2012
> (r234833)
> +++ head/sys/net/if_ethersubr.c   Mon Apr 30 10:22:23 2012
> (r234834)
> @@ -72,7 +72,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #endif
>  #ifdef INET6
>  #include 
> 
> Modified: head/sys/netinet/ip_fw.h
> ==
> --- head/sys/netinet/ip_fw.h  Mon Apr 30 09:46:05 2012(r234833)
> +++ head/sys/netinet/ip_fw.h  Mon Apr 30 10:22:23 2012(r234834)
> @@ -545,6 +545,88 @@ struct ipfw_flow_id {
>  
>  #define IS_IP6_FLOW_ID(id)   ((id)->addr_type == 6)
>  
> +#ifdef _KERNEL
> +/* Return values from ipfw_[ether_]chk() */
> +enum {
> + IP_FW_PASS = 0,
> + IP_FW_DENY,
> + IP_FW_DIVERT,
> + IP_FW_TEE,
> + IP_FW_DUMMYNET,
> + IP_FW_NETGRAPH,
> + IP_FW_NGTEE,
> + IP_FW_NAT,
> + IP_FW_REASS,
> +};
> +
> +/*
> + * Hooks sometime need to know the direction of the packet
> + * (divert, dummynet, netgraph, ...)
> + * We use a generic definition here, with bit0-1 indicating the
> + * direction, bit 2 indicating layer2 or 3, bit 3-4 indicating the
> + * specific protocol (if necessary)
> + */
> +enum {
> + DIR_MASK =  0x3,
> + DIR_OUT =   0,
> + DIR_IN =1,
> + DIR_FWD =   2,
> + DIR_DROP =  3,
> + PROTO_LAYER2 =  0x4, /* set for layer 2 */
> + /* PROTO_DEFAULT = 0, */
> + PROTO_IPV4 =0x08,
> + PROTO_IPV6 =0x10,
> + PROTO_IFB = 0x0c, /* layer2 + ifbridge */
> +   /*PROTO_OLDBDG =  0x14, unused, old bridge */
> +};
> +
> +/*
> + * Structure for collecting parameters to dummynet for ip6_output forwarding
> + */
> +struct _ip6dn_args {
> +   struct ip6_pktopts *opt_or;
> +   struct route_in6 ro_or;
> +   int flags_or;
> +   struct ip6_moptions *im6o_or;
> +   struct ifnet *origifp_or;
> +   struct ifnet *ifp_or;
> +   struct sockaddr_in6 dst_or;
> +   u_long mtu_or;
> +   struct route_in6 ro_pmtu_or;
> +};
> +
> +/*
>

Re: svn commit: r234834 - in head/sys: contrib/pf/net net netinet netinet/ipfw ofed/drivers/infiniband/ulp/ipoib

2012-04-30 Thread Gleb Smirnoff
On Mon, Apr 30, 2012 at 01:48:36PM +0200, Luigi Rizzo wrote:
L> On Mon, Apr 30, 2012 at 10:22:23AM +, Alexander V. Chernikov wrote:
L> > Author: melifaro
L> > Date: Mon Apr 30 10:22:23 2012
L> > New Revision: 234834
L> > URL: http://svn.freebsd.org/changeset/base/234834
L> > 
L> > Log:
L> >   Move several enums and structures required for L2 filtering from 
ip_fw_private.h to ip_fw.h.
L> 
L> I would be really grateful if you could revert this back and discuss
L> what you wanted to achieve with this change other than saving one
L> entry in the list of includes.
L> 
L> As clearly mentioned in the commit logs
L> 
L> http://svnweb.freebsd.org/base?view=revision&revision=200580
L> 
L> when i did the last revision of the ipfw+dummynet code i tried
L> to put a strong separation between what is visible in userland
L> (ip_fw.h and ip_dummynet.h) and kernel specific stuff.
L> This way changes in the kernel code do not need to affect userland,
L> modify installed headers and so on.
L> 
L> This is why kernel-specific definitions were put in private files.
L> We may discuss on the filename, ip_fw_kernel.h may be a better fit,
L> but merging back kernel and userland defs is a bad design decision.
L> 
L> 20-30 years ago there were good reasons to use a single header
L> for all sorts of definitions: user-only, kernel-only, and kernel-userland 
API.
L> Machines were slow, disks were small, portability was not a big deal.
L> 
L> These days none of these conditions apply and keeping things
L> separate helps maintainance and avoid accidental pollution of
L> definitions and their misuse.
L> 
L> Besides, keep in mind that ipfw and dummynet are meant to work
L> on multiple platforms so this change is causing portability troubles.

Can we split ip_fw_private.h to ip_fw_private.h, and ip_fw_var.h? The
former is really private, and the latter is for other kernel modules.

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


svn commit: r234837 - head/lib/libfetch

2012-04-30 Thread Dag-Erling Smorgrav
Author: des
Date: Mon Apr 30 12:11:45 2012
New Revision: 234837
URL: http://svn.freebsd.org/changeset/base/234837

Log:
  Since the socket is non-blocking, it is necessary to use select(2) even
  when there is no timeout, because read(2) will return immediately if there
  is no data waiting in the TCP buffer, causing fetch_read() to busy-loop on
  slow connections.
  
  MFC after:3 weeks
  Noticed by:   Yanhui Shen 

Modified:
  head/lib/libfetch/common.c

Modified: head/lib/libfetch/common.c
==
--- head/lib/libfetch/common.c  Mon Apr 30 11:28:17 2012(r234836)
+++ head/lib/libfetch/common.c  Mon Apr 30 12:11:45 2012(r234837)
@@ -455,11 +455,9 @@ fetch_read(conn_t *conn, char *buf, size
struct timeval now, timeout, delta;
fd_set readfds;
ssize_t rlen, total;
-   int r;
char *start;
 
-   if (fetchTimeout) {
-   FD_ZERO(&readfds);
+   if (fetchTimeout > 0) {
gettimeofday(&timeout, NULL);
timeout.tv_sec += fetchTimeout;
}
@@ -523,23 +521,21 @@ fetch_read(conn_t *conn, char *buf, size
return (-1);
}
// assert(rlen == FETCH_READ_WAIT);
-   while (fetchTimeout && !FD_ISSET(conn->sd, &readfds)) {
+   FD_ZERO(&readfds);
+   while (!FD_ISSET(conn->sd, &readfds)) {
FD_SET(conn->sd, &readfds);
-   gettimeofday(&now, NULL);
-   delta.tv_sec = timeout.tv_sec - now.tv_sec;
-   delta.tv_usec = timeout.tv_usec - now.tv_usec;
-   if (delta.tv_usec < 0) {
-   delta.tv_usec += 100;
-   delta.tv_sec--;
-   }
-   if (delta.tv_sec < 0) {
-   errno = ETIMEDOUT;
-   fetch_syserr();
-   return (-1);
+   if (fetchTimeout > 0) {
+   gettimeofday(&now, NULL);
+   if (!timercmp(&timeout, &now, >)) {
+   errno = ETIMEDOUT;
+   fetch_syserr();
+   return (-1);
+   }
+   timersub(&timeout, &now, &delta);
}
errno = 0;
-   r = select(conn->sd + 1, &readfds, NULL, NULL, &delta);
-   if (r == -1) {
+   if (select(conn->sd + 1, &readfds, NULL, NULL,
+   fetchTimeout > 0 ? &delta : NULL) < 0) {
if (errno == EINTR) {
if (fetchRestartCalls)
continue;
___
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: r234838 - head/lib/libfetch

2012-04-30 Thread Dag-Erling Smorgrav
Author: des
Date: Mon Apr 30 12:12:48 2012
New Revision: 234838
URL: http://svn.freebsd.org/changeset/base/234838

Log:
  Don't reuse credentials if redirected to a different host.
  
  Submitted by: Niels Heinen 
  MFC after:3 weeks

Modified:
  head/lib/libfetch/http.c

Modified: head/lib/libfetch/http.c
==
--- head/lib/libfetch/http.cMon Apr 30 12:11:45 2012(r234837)
+++ head/lib/libfetch/http.cMon Apr 30 12:12:48 2012(r234838)
@@ -1779,7 +1779,9 @@ http_request(struct url *URL, const char
DEBUG(fprintf(stderr, "failed to parse 
new URL\n"));
goto ouch;
}
-   if (!*new->user && !*new->pwd) {
+
+   /* Only copy credentials if the host matches */
+   if (!strcmp(new->host, url->host) && 
!*new->user && !*new->pwd) {
strcpy(new->user, url->user);
strcpy(new->pwd, url->pwd);
}
___
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: r234834 - in head/sys: contrib/pf/net net netinet netinet/ipfw ofed/drivers/infiniband/ulp/ipoib

2012-04-30 Thread Alexander V. Chernikov

On 30.04.2012 15:36, Gleb Smirnoff wrote:

On Mon, Apr 30, 2012 at 01:48:36PM +0200, Luigi Rizzo wrote:
L>  On Mon, Apr 30, 2012 at 10:22:23AM +, Alexander V. Chernikov wrote:
L>  >  Author: melifaro
L>  >  Date: Mon Apr 30 10:22:23 2012
L>  >  New Revision: 234834
L>  >  URL: http://svn.freebsd.org/changeset/base/234834
L>  >
L>  >  Log:
L>  >Move several enums and structures required for L2 filtering from 
ip_fw_private.h to ip_fw.h.
L>
L>  I would be really grateful if you could revert this back and discuss
L>  what you wanted to achieve with this change other than saving one
L>  entry in the list of includes.
Changing something inside ip_fw_private.h (for example, locking  change) 
requires changes in several totally unrelated subsystems, which is 
clearly bad.

L>
L>  As clearly mentioned in the commit logs
L>
L>  http://svnweb.freebsd.org/base?view=revision&revision=200580
Maybe there are some other possibilities documenting preferred layout 
other than commit log? Searching 2+yrs commit history is not the best 
way of finding information.



L>
L>  when i did the last revision of the ipfw+dummynet code i tried
L>  to put a strong separation between what is visible in userland
L>  (ip_fw.h and ip_dummynet.h) and kernel specific stuff.
L>  This way changes in the kernel code do not need to affect userland,
L>  modify installed headers and so on.
L>
L>  This is why kernel-specific definitions were put in private files.
Unfortunately, it is not so obvious (at least for me "ip_fw_ 
_private__.h" looks much like "ipfw private headers, used by ipfw 
subsystem only", not "kernel ipfw specific stuff").

L>  We may discuss on the filename, ip_fw_kernel.h may be a better fit,
Personally I prefer glebius@ suggestion with ip_fw_var.h for such common 
headers.

L>  but merging back kernel and userland defs is a bad design decision.
So should style(9) be updated with "_KERNEL define is bad" line to make 
newcomers aware of this "easy" way ? :)

L>
L>  20-30 years ago there were good reasons to use a single header
L>  for all sorts of definitions: user-only, kernel-only, and kernel-userland 
API.
L>  Machines were slow, disks were small, portability was not a big deal.
L>
L>  These days none of these conditions apply and keeping things
L>  separate helps maintainance and avoid accidental pollution of
L>  definitions and their misuse.
L>
L>  Besides, keep in mind that ipfw and dummynet are meant to work
L>  on multiple platforms so this change is causing portability troubles.

Can we split ip_fw_private.h to ip_fw_private.h, and ip_fw_var.h? The
former is really private, and the latter is for other kernel modules.




___
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: r234834 - in head/sys: contrib/pf/net net netinet netinet/ipfw ofed/drivers/infiniband/ulp/ipoib

2012-04-30 Thread Luigi Rizzo
On Mon, Apr 30, 2012 at 04:17:30PM +0400, Alexander V. Chernikov wrote:
> On 30.04.2012 15:36, Gleb Smirnoff wrote:
> >On Mon, Apr 30, 2012 at 01:48:36PM +0200, Luigi Rizzo wrote:
> >L>  On Mon, Apr 30, 2012 at 10:22:23AM +, Alexander V. Chernikov wrote:
> >L>  >  Author: melifaro
> >L>  >  Date: Mon Apr 30 10:22:23 2012
> >L>  >  New Revision: 234834
> >L>  >  URL: http://svn.freebsd.org/changeset/base/234834
> >L>  >
> >L>  >  Log:
> >L>  >Move several enums and structures required for L2 filtering from 
> >ip_fw_private.h to ip_fw.h.
> >L>
> >L>  I would be really grateful if you could revert this back and discuss
> >L>  what you wanted to achieve with this change other than saving one
> >L>  entry in the list of includes.
> Changing something inside ip_fw_private.h (for example, locking  change) 
> requires changes in several totally unrelated subsystems, which is 
> clearly bad.

There are certainly good reasons to split things even further
(as Gleb suggested) so if you want to follow that route
and have patches for review i will be glad to discuss that.

I am the first one to say that the name ip_fw_private.h is confusing,
but at the time i did not feel brave enough to move from a single
header (ip_fw.h) to the four (ip_fw.h, ip_fw_user.h, ip_fw_kernel.h,
ip_fw_kernel_private.h) that would be needed for proper confinement
of information.

This said, the change you have made introduce a worse form of header
pollution and this is why i am requesting a backout.

> >L>
> >L>  As clearly mentioned in the commit logs
> >L>
> >L>  http://svnweb.freebsd.org/base?view=revision&revision=200580
> Maybe there are some other possibilities documenting preferred layout 
> other than commit log? Searching 2+yrs commit history is not the best 
> way of finding information.

sure, you could have asked people involved with ipfw development
to review this change.

Also don't expect a single policy in style(9) to hold for all
possible situations: the kernel is huge, it has parts that come
from multiple origins in time and space, and sometimes is shared
with other OSs as well. Refactoring (such as your changes) should
keep that in mind.

Let's not make a big deal of this thing: we all make mistakes or
have different opinions on how things should be done, and the only
way to avoid them is to discuss thing in advance, or be open to
resolve things when problems arise. No hard feelings.

cheers
luigi
___
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: r234840 - head/libexec/rtld-elf

2012-04-30 Thread Konstantin Belousov
Author: kib
Date: Mon Apr 30 13:29:21 2012
New Revision: 234840
URL: http://svn.freebsd.org/changeset/base/234840

Log:
  Split the symlook_obj1 into a loop iterating over the ELF object symbol
  hash elements, and a helper matched_symbol() which match the given hash
  entry and request, performing needed type and version checks.
  
  Based on dragonflybsd support for GNU hash by John Marino 
  Reviewed by:  kan
  Tested by:bapt
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cMon Apr 30 13:07:21 2012
(r234839)
+++ head/libexec/rtld-elf/rtld.cMon Apr 30 13:29:21 2012
(r234840)
@@ -1,7 +1,8 @@
 /*-
  * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra.
  * Copyright 2003 Alexander Kabaev .
- * Copyright 2009, 2010, 2011 Konstantin Belousov .
+ * Copyright 2009-2012 Konstantin Belousov .
+ * Copyright 2012 John Marino .
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -149,6 +150,8 @@ static int  object_match_name(const Obj_
 static void ld_utrace_log(int, void *, void *, size_t, int, const char *);
 static void rtld_fill_dl_phdr_info(const Obj_Entry *obj,
 struct dl_phdr_info *phdr_info);
+static bool matched_symbol(SymLook *, const Obj_Entry *, Sym_Match_Result *,
+const unsigned long);
 
 void r_debug_state(struct r_debug *, struct link_map *) __noinline;
 
@@ -3439,28 +3442,15 @@ symlook_obj(SymLook *req, const Obj_Entr
 return (mres);
 }
 
-static int
-symlook_obj1(SymLook *req, const Obj_Entry *obj)
+/* Symbol match routine common to both hash functions */
+static bool
+matched_symbol(SymLook *req, const Obj_Entry *obj, Sym_Match_Result *result,
+const unsigned long symnum)
 {
-unsigned long symnum;
-const Elf_Sym *vsymp;
-Elf_Versym verndx;
-int vcount;
-
-if (obj->buckets == NULL)
-   return (ESRCH);
-
-vsymp = NULL;
-vcount = 0;
-symnum = obj->buckets[req->hash % obj->nbuckets];
-
-for (; symnum != STN_UNDEF; symnum = obj->chains[symnum]) {
+   Elf_Versym verndx;
const Elf_Sym *symp;
const char *strp;
 
-   if (symnum >= obj->nchains)
-   return (ESRCH); /* Bad object */
-
symp = obj->symtab + symnum;
strp = obj->strtab + symp->st_name;
 
@@ -3468,103 +3458,128 @@ symlook_obj1(SymLook *req, const Obj_Ent
case STT_FUNC:
case STT_NOTYPE:
case STT_OBJECT:
+   case STT_COMMON:
case STT_GNU_IFUNC:
-   if (symp->st_value == 0)
-   continue;
+   if (symp->st_value == 0)
+   return (false);
/* fallthrough */
case STT_TLS:
-   if (symp->st_shndx != SHN_UNDEF)
-   break;
+   if (symp->st_shndx != SHN_UNDEF)
+   break;
 #ifndef __mips__
-   else if (((req->flags & SYMLOOK_IN_PLT) == 0) &&
-(ELF_ST_TYPE(symp->st_info) == STT_FUNC))
-   break;
+   else if (((req->flags & SYMLOOK_IN_PLT) == 0) &&
+   (ELF_ST_TYPE(symp->st_info) == STT_FUNC))
+   break;
/* fallthrough */
 #endif
default:
-   continue;
+   return (false);
}
if (req->name[0] != strp[0] || strcmp(req->name, strp) != 0)
-   continue;
+   return (false);
 
if (req->ventry == NULL) {
-   if (obj->versyms != NULL) {
-   verndx = VER_NDX(obj->versyms[symnum]);
-   if (verndx > obj->vernum) {
-   _rtld_error("%s: symbol %s references wrong version %d",
-   obj->path, obj->strtab + symnum, verndx);
-   continue;
-   }
-   /*
-* If we are not called from dlsym (i.e. this is a normal
-* relocation from unversioned binary), accept the symbol
-* immediately if it happens to have first version after
-* this shared object became versioned. Otherwise, if
-* symbol is versioned and not hidden, remember it. If it
-* is the only symbol with this name exported by the
-* shared object, it will be returned as a match at the
-* end of the function. If symbol is global (verndx < 2)
-* accept it unconditionally.
-*/
-   if ((req->flags & SYMLOOK_DLSYM) == 0 &&
- verndx == VER_NDX_GIVEN) {
-   req->sym_out = symp;
-   req->defobj_out = obj;
-   return (0);
-   }
-   else if (verndx >= VER_NDX_GIVEN) {
-   if ((obj->versyms[symnum] & VER_NDX_HIDDEN) == 0) {
-

svn commit: r234841 - in head/libexec/rtld-elf: . amd64 arm i386 ia64 powerpc powerpc64 sparc64

2012-04-30 Thread Konstantin Belousov
Author: kib
Date: Mon Apr 30 13:31:10 2012
New Revision: 234841
URL: http://svn.freebsd.org/changeset/base/234841

Log:
  Add GNU hash support for rtld.
  
  Based on dragonflybsd support for GNU hash by John Marino 
  Reviewed by:  kan
  Tested by:bapt
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/amd64/reloc.c
  head/libexec/rtld-elf/arm/reloc.c
  head/libexec/rtld-elf/i386/reloc.c
  head/libexec/rtld-elf/ia64/reloc.c
  head/libexec/rtld-elf/powerpc/reloc.c
  head/libexec/rtld-elf/powerpc64/reloc.c
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h
  head/libexec/rtld-elf/sparc64/reloc.c

Modified: head/libexec/rtld-elf/amd64/reloc.c
==
--- head/libexec/rtld-elf/amd64/reloc.c Mon Apr 30 13:29:21 2012
(r234840)
+++ head/libexec/rtld-elf/amd64/reloc.c Mon Apr 30 13:31:10 2012
(r234841)
@@ -132,7 +132,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry 
 * limited amounts of stack available so we cannot use alloca().
 */
if (obj != obj_rtld) {
-   cache = calloc(obj->nchains, sizeof(SymCache));
+   cache = calloc(obj->dynsymcount, sizeof(SymCache));
/* No need to check for NULL here */
} else
cache = NULL;

Modified: head/libexec/rtld-elf/arm/reloc.c
==
--- head/libexec/rtld-elf/arm/reloc.c   Mon Apr 30 13:29:21 2012
(r234840)
+++ head/libexec/rtld-elf/arm/reloc.c   Mon Apr 30 13:31:10 2012
(r234841)
@@ -328,7 +328,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry 
 * The dynamic loader may be called from a thread, we have
 * limited amounts of stack available so we cannot use alloca().
 */
-   cache = calloc(obj->nchains, sizeof(SymCache));
+   cache = calloc(obj->dynsymcount, sizeof(SymCache));
/* No need to check for NULL here */
 
rellim = (const Elf_Rel *)((caddr_t)obj->rel + obj->relsize);

Modified: head/libexec/rtld-elf/i386/reloc.c
==
--- head/libexec/rtld-elf/i386/reloc.c  Mon Apr 30 13:29:21 2012
(r234840)
+++ head/libexec/rtld-elf/i386/reloc.c  Mon Apr 30 13:31:10 2012
(r234841)
@@ -133,7 +133,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry 
 * limited amounts of stack available so we cannot use alloca().
 */
if (obj != obj_rtld) {
-   cache = calloc(obj->nchains, sizeof(SymCache));
+   cache = calloc(obj->dynsymcount, sizeof(SymCache));
/* No need to check for NULL here */
} else
cache = NULL;

Modified: head/libexec/rtld-elf/ia64/reloc.c
==
--- head/libexec/rtld-elf/ia64/reloc.c  Mon Apr 30 13:29:21 2012
(r234840)
+++ head/libexec/rtld-elf/ia64/reloc.c  Mon Apr 30 13:31:10 2012
(r234841)
@@ -104,7 +104,7 @@ alloc_fptrs(Obj_Entry *obj, bool mapped)
struct fptr **fptrs;
size_t fbytes;
 
-   fbytes = obj->nchains * sizeof(struct fptr *);
+   fbytes = obj->dynsymcount * sizeof(struct fptr *);
 
/*
 * Avoid malloc, if requested. Happens when relocating
@@ -138,7 +138,7 @@ free_fptrs(Obj_Entry *obj, bool mapped)
if (fptrs == NULL)
return;
 
-   fbytes = obj->nchains * sizeof(struct fptr *);
+   fbytes = obj->dynsymcount * sizeof(struct fptr *);
if (mapped)
munmap(fptrs, fbytes);
else
@@ -348,7 +348,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry 
const Elf_Rela *relalim;
const Elf_Rela *rela;
SymCache *cache;
-   int bytes = obj->nchains * sizeof(SymCache);
+   int bytes = obj->dynsymcount * sizeof(SymCache);
int r = -1;
 
/*

Modified: head/libexec/rtld-elf/powerpc/reloc.c
==
--- head/libexec/rtld-elf/powerpc/reloc.c   Mon Apr 30 13:29:21 2012
(r234840)
+++ head/libexec/rtld-elf/powerpc/reloc.c   Mon Apr 30 13:31:10 2012
(r234841)
@@ -299,7 +299,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry 
 * limited amounts of stack available so we cannot use alloca().
 */
if (obj != obj_rtld) {
-   cache = calloc(obj->nchains, sizeof(SymCache));
+   cache = calloc(obj->dynsymcount, sizeof(SymCache));
/* No need to check for NULL here */
} else
cache = NULL;

Modified: head/libexec/rtld-elf/powerpc64/reloc.c
==
--- head/libexec/rtld-elf/powerpc64/reloc.c Mon Apr 30 13:29:21 2012
(r234840)
+++ head/libexec/rtld-elf/powerpc64/reloc.c Mon Apr 30 13:31:10 2012
(r234841)
@@ -287,7 +287,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Ent

svn commit: r234846 - head/sbin/growfs

2012-04-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 30 16:08:02 2012
New Revision: 234846
URL: http://svn.freebsd.org/changeset/base/234846

Log:
  Improve growfs(8) in a few ways; unfortunately, it's somewhat hard to untangle
  them and commit separately.
  
  1. Rewrite the way growfs(8) finds the device and mount point.  This makes
 it possible to use e.g. "growfs /mnt"; it's also used to display more
 helpful messages.
  
  2. Be more user-friendly, using descriptive messages, like this:
  
 OK to grow filesystem on /dev/md0, mounted on /mnt, from 9.8GB to 20GB? 
[Yes/No]"
  
  3. Allow to specify the size (-s option) just like with mdconfig(8), i.e. with
 postfixes ("mdconfig -s 10g").
  
  4. Reload read-only filesystem after growing.
  
  Reviewed by:  kib, mckusick (earlier version)
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sbin/growfs/Makefile
  head/sbin/growfs/growfs.8
  head/sbin/growfs/growfs.c

Modified: head/sbin/growfs/Makefile
==
--- head/sbin/growfs/Makefile   Mon Apr 30 15:46:41 2012(r234845)
+++ head/sbin/growfs/Makefile   Mon Apr 30 16:08:02 2012(r234846)
@@ -6,12 +6,18 @@
 
 #GFSDBG=
 
+.PATH: ${.CURDIR}/../mount
+
 PROG=   growfs
-SRCS=   growfs.c
+SRCS=   growfs.c getmntopts.c
 MAN=   growfs.8
+CFLAGS+=-I${.CURDIR}/../mount
 
 .if defined(GFSDBG)
 SRCS+=  debug.c
 .endif  
 
+DPADD= ${LIBUTIL}
+LDADD= -lutil
+
 .include   

Modified: head/sbin/growfs/growfs.8
==
--- head/sbin/growfs/growfs.8   Mon Apr 30 15:46:41 2012(r234845)
+++ head/sbin/growfs/growfs.8   Mon Apr 30 16:08:02 2012(r234846)
@@ -37,7 +37,7 @@
 .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $
 .\" $FreeBSD$
 .\"
-.Dd June 29, 2011
+.Dd April 30, 2012
 .Dt GROWFS 8
 .Os
 .Sh NAME
@@ -47,41 +47,20 @@
 .Nm
 .Op Fl Ny
 .Op Fl s Ar size
-.Ar special
+.Ar special | filesystem
 .Sh DESCRIPTION
 The
 .Nm
-utility extends the
-.Xr newfs 8
-program.
-Before starting
-.Nm
-the disk must be labeled to a bigger size using
-.Xr bsdlabel 8 .
-If you wish to grow a file system beyond the boundary of
-the slice it resides in, you must re-size the slice using
-.Xr gpart 8
-before running
-.Nm .
+utility makes it possible to expand an UFS file system.
+Before running
+.Nm
+the partition or slice containing the file system must be extended using
+.Xr gpart 8 .
 If you are using volumes you must enlarge them by using
 .Xr gvinum 8 .
 The
 .Nm
 utility extends the size of the file system on the specified special file.
-Currently
-.Nm
-can only enlarge unmounted file systems.
-Do not try enlarging a mounted file system, your system may panic and you will
-not be able to use the file system any longer.
-Most of the
-.Xr newfs 8
-options cannot be changed by
-.Nm .
-In fact, you can only increase the size of the file system.
-Use
-.Xr tunefs 8
-for other changes.
-.Pp
 The following options are available:
 .Bl -tag -width indent
 .It Fl N
@@ -103,6 +82,13 @@ So use this option with great care!
 Determines the
 .Ar size
 of the file system after enlarging in sectors.
+.Ar Size
+is the number of 512 byte sectors unless suffixed with a
+.Cm b , k , m , g ,
+or
+.Cm t
+which
+denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively.
 This value defaults to the size of the raw partition specified in
 .Ar special
 (in other words,
@@ -110,19 +96,18 @@ This value defaults to the size of the r
 will enlarge the file system to the size of the entire partition).
 .El
 .Sh EXAMPLES
-.Dl growfs -s 4194304 /dev/vinum/testvol
+.Dl growfs -s 2G /dev/ada0p1
 .Pp
 will enlarge
-.Pa /dev/vinum/testvol
+.Pa /dev/ada0p1
 up to 2GB if there is enough space in
-.Pa /dev/vinum/testvol .
+.Pa /dev/ada0p1 .
 .Sh SEE ALSO
-.Xr bsdlabel 8 ,
 .Xr dumpfs 8 ,
 .Xr ffsinfo 8 ,
 .Xr fsck 8 ,
+.Xr fsdb 8 ,
 .Xr gpart 8 ,
-.Xr gvinum 8 ,
 .Xr newfs 8 ,
 .Xr tunefs 8
 .Sh HISTORY
@@ -134,61 +119,12 @@ utility first appeared in
 .An Christoph Herrmann Aq c...@freebsd.org
 .An Thomas-Henning von Kamptz Aq toms...@freebsd.org
 .An The GROWFS team Aq gro...@tomsoft.com
+.An Edward Tomasz Napierala Aq tr...@freebsd.org
 .Sh BUGS
-The
-.Nm
-utility works starting with
-.Fx
-3.x.
-There may be cases on
-.Fx
-3.x only, when
-.Nm
-does not recognize properly whether or not the file system is mounted and
-exits with an error message.
-Then please use
-.Nm
-.Fl y
-if you are sure that the file system is not mounted.
-It is also recommended to always use
-.Xr fsck 8
-after enlarging (just to be on the safe side).
-.Pp
-For enlarging beyond certain limits, it is essential to have some free blocks
-available in the first cylinder group.
-If that space is not available in the first cylinder group, a critical data
-structure has to be relocated into one of the new available cylinder groups.
-On
-.Fx
-3.x this will cause problems with
-.Xr fsck 8
-afterwards.

svn commit: r234847 - head/share/misc

2012-04-30 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Mon Apr 30 16:16:37 2012
New Revision: 234847
URL: http://svn.freebsd.org/changeset/base/234847

Log:
  Add myself.

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Mon Apr 30 16:08:02 2012
(r234846)
+++ head/share/misc/committers-src.dot  Mon Apr 30 16:16:37 2012
(r234847)
@@ -128,6 +128,7 @@ dg [label="David Greenman\n...@freebsd.or
 dim [label="Dimitry Andric\n...@freebsd.org\n2010/08/30"]
 dougb [label="Doug Barton\ndo...@freebsd.org\n2000/10/26"]
 dteske [label="Devin Teske\ndte...@freebsd.org\n2012/04/10"]
+dumbbell [label="Jean-Sebastien Pedron\ndumbb...@freebsd.org\n2004/11/29"]
 dwmalone [label="David Malone\ndwmal...@freebsd.org\n2000/07/11"]
 ed [label="Ed Schouten\n...@freebsd.org\n2008/05/22"]
 edwin [label="Edwin Groothuis\ned...@freebsd.org\n2007/06/25"]
@@ -506,6 +507,7 @@ msmith -> scottl
 murray -> delphij
 
 mux -> cognet
+mux -> dumbbell
 
 netchild -> ariff
 
___
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: r234848 - in head: sbin/geom/class/raid sys/conf sys/geom/raid sys/modules/geom/geom_raid

2012-04-30 Thread Alexander Motin
Author: mav
Date: Mon Apr 30 17:53:02 2012
New Revision: 234848
URL: http://svn.freebsd.org/changeset/base/234848

Log:
  Add to GEOM RAID class module, supporting the DDF metadata format, as
  defined by the SNIA Common RAID Disk Data Format Specification v2.0.
  
  Supports multiple volumes per array and multiple partitions per disk.
  Supports standard big-endian and Adaptec's little-endian byte ordering.
  Supports all single-layer RAID levels. Dual-layer RAID levels except
  RAID10 are not supported now because of GEOM RAID design limitations.
  
  Some work is still to be done, but the present code already manages basic
  interoperation with RAID BIOS of the Adaptec 1430SA SATA RAID controller.
  
  MFC after:1 month
  Sponsored by: iXsystems, Inc.

Added:
  head/sys/geom/raid/md_ddf.c   (contents, props changed)
  head/sys/geom/raid/md_ddf.h   (contents, props changed)
Modified:
  head/sbin/geom/class/raid/graid.8
  head/sys/conf/files
  head/sys/modules/geom/geom_raid/Makefile

Modified: head/sbin/geom/class/raid/graid.8
==
--- head/sbin/geom/class/raid/graid.8   Mon Apr 30 16:16:37 2012
(r234847)
+++ head/sbin/geom/class/raid/graid.8   Mon Apr 30 17:53:02 2012
(r234848)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 19, 2012
+.Dd April 30, 2012
 .Dt GRAID 8
 .Os
 .Sh NAME
@@ -200,6 +200,19 @@ The GEOM RAID class follows a modular de
 formats to be used.
 Support is currently implemented for the following formats:
 .Bl -tag -width "Intel"
+.It DDF
+The format defined by the SNIA Common RAID Disk Data Format v2.0 specification.
+Used by some Adaptec RAID BIOSes and some hardware RAID controllers.
+Because of high format flexibility different implementations support
+different set of features and have different on-disk metadata layouts.
+To provide compatibility, the GEOM RAID class mimics capabilities and
+metadata layout of the first detected DDF array.
+Respecting that, it may support different number of disks per volume,
+volumes per array, partitions per disk, etc.
+The following configurations are supported: RAID0 (2+ disks), RAID1 (2+ disks),
+RAID1E (3+ disks), RAID3 (3+ disks), RAID4 (3+ disks), RAID5 (3+ disks),
+RAID5E (4+ disks), RAID5EE (4+ disks), RAID5R (3+ disks), RAID6 (4+ disks),
+RAIDMDF (5+ disks), RAID10 (4+ disks), SINGLE (1 disk), CONCAT (2+ disks).
 .It Intel
 The format used by Intel RAID BIOS.
 Supports up to two volumes per array.

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Apr 30 16:16:37 2012(r234847)
+++ head/sys/conf/files Mon Apr 30 17:53:02 2012(r234848)
@@ -2396,6 +2396,7 @@ geom/raid/g_raid.coptional geom_raid
 geom/raid/g_raid_ctl.c optional geom_raid
 geom/raid/g_raid_md_if.m   optional geom_raid
 geom/raid/g_raid_tr_if.m   optional geom_raid
+geom/raid/md_ddf.c optional geom_raid
 geom/raid/md_intel.c   optional geom_raid
 geom/raid/md_jmicron.c optional geom_raid
 geom/raid/md_nvidia.c  optional geom_raid

Added: head/sys/geom/raid/md_ddf.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/geom/raid/md_ddf.c Mon Apr 30 17:53:02 2012(r234848)
@@ -0,0 +1,2900 @@
+/*-
+ * Copyright (c) 2012 Alexander Motin 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#inc

svn commit: r234850 - head/usr.bin/m4

2012-04-30 Thread Baptiste Daroussin
Author: bapt
Date: Mon Apr 30 21:02:57 2012
New Revision: 234850
URL: http://svn.freebsd.org/changeset/base/234850

Log:
  Respect mathematical operation order piority with the exponent gnu extension
  
  Obtained from:OpenBSD
  Approved by:  des (mentor)

Modified:
  head/usr.bin/m4/parser.y

Modified: head/usr.bin/m4/parser.y
==
--- head/usr.bin/m4/parser.yMon Apr 30 17:56:49 2012(r234849)
+++ head/usr.bin/m4/parser.yMon Apr 30 21:02:57 2012(r234850)
@@ -17,8 +17,8 @@
  *
  * $FreeBSD$
  */
-#include 
 #include 
+#include 
 #define YYSTYPEint32_t
 extern int32_t end_result;
 extern int yylex(void);
@@ -35,9 +35,9 @@ extern int yyparse(void);
 %left EQ NE
 %left '<' LE '>' GE
 %left LSHIFT RSHIFT
-%right EXPONENT
 %left '+' '-'
 %left '*' '/' '%'
+%right EXPONENT
 %right UMINUS UPLUS '!' '~'
 
 %%
___
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: r234851 - in head: libexec/rtld-elf share/man/man5

2012-04-30 Thread Baptiste Daroussin
Author: bapt
Date: Mon Apr 30 21:26:35 2012
New Revision: 234851
URL: http://svn.freebsd.org/changeset/base/234851

Log:
  Add two special directives to libmap.conf:
  include :
Parse the contents of file before continuing with the current file.
  includedir :
Parse the contents of every file in dir that ends in .conf before continuing
with the current file.
  Any file or directory encountered while processing include or includedir
  directives will be parsed exactly once, even if it is encountered multiple
  times.
  
  Reviewed by:  kib, des
  Approved by:  des (mentor)
  MFC after:1 month

Modified:
  head/libexec/rtld-elf/libmap.c
  head/share/man/man5/libmap.conf.5

Modified: head/libexec/rtld-elf/libmap.c
==
--- head/libexec/rtld-elf/libmap.c  Mon Apr 30 21:02:57 2012
(r234850)
+++ head/libexec/rtld-elf/libmap.c  Mon Apr 30 21:26:35 2012
(r234851)
@@ -2,11 +2,13 @@
  * $FreeBSD$
  */
 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -39,9 +41,17 @@ struct lmp {
TAILQ_ENTRY(lmp) lmp_link;
 };
 
+static TAILQ_HEAD(lmc_list, lmc) lmc_head = TAILQ_HEAD_INITIALIZER(lmc_head);
+struct lmc {
+   char *path;
+   TAILQ_ENTRY(lmc) next;
+};
+
 static int lm_count;
 
 static void lmc_parse(char *, size_t);
+static void lmc_parse_file(char *);
+static void lmc_parse_dir(char *);
 static void lm_add(const char *, const char *, const char *);
 static void lm_free(struct lm_list *);
 static char *lml_find(struct lm_list *, const char *);
@@ -61,37 +71,13 @@ static const char *quickbasename(const c
 int
 lm_init(char *libmap_override)
 {
-   struct stat st;
-   char *lm_map, *p;
-   int fd;
+   char *p;
 
dbg("lm_init(\"%s\")", libmap_override);
TAILQ_INIT(&lmp_head);
 
-   fd = open(_PATH_LIBMAP_CONF, O_RDONLY);
-   if (fd == -1) {
-   dbg("lm_init: open(\"%s\") failed, %s", _PATH_LIBMAP_CONF,
-   rtld_strerror(errno));
-   goto override;
-   }
-   if (fstat(fd, &st) == -1) {
-   close(fd);
-   dbg("lm_init: fstat(\"%s\") failed, %s", _PATH_LIBMAP_CONF,
-   rtld_strerror(errno));
-   goto override;
-   }
-   lm_map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
-   if (lm_map == (const char *)MAP_FAILED) {
-   close(fd);
-   dbg("lm_init: mmap(\"%s\") failed, %s", _PATH_LIBMAP_CONF,
-   rtld_strerror(errno));
-   goto override;
-   }
-   close(fd);
-   lmc_parse(lm_map, st.st_size);
-   munmap(lm_map, st.st_size);
+   lmc_parse_file(_PATH_LIBMAP_CONF);
 
-override:
if (libmap_override) {
/*
 * Do some character replacement to make $LIBMAP look
@@ -116,14 +102,116 @@ override:
 }
 
 static void
+lmc_parse_file(char *path)
+{
+   struct lmc *p;
+   struct stat st;
+   int fd;
+   char *rpath;
+   char *lm_map;
+
+   rpath = realpath(path, NULL);
+   if (rpath == NULL)
+   return;
+
+   TAILQ_FOREACH(p, &lmc_head, next) {
+   if (strcmp(p->path, rpath) == 0) {
+   free(rpath);
+   return;
+   }
+   }
+
+   fd = open(path, O_RDONLY);
+   if (fd == -1) {
+   dbg("lm_init: open(\"%s\") failed, %s", path,
+   rtld_strerror(errno));
+   free(rpath);
+   return;
+   }
+   if (fstat(fd, &st) == -1) {
+   close(fd);
+   dbg("lm_init: fstat(\"%s\") failed, %s", path,
+   rtld_strerror(errno));
+   free(rpath);
+   return;
+   }
+   lm_map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+   if (lm_map == (const char *)MAP_FAILED) {
+   close(fd);
+   dbg("lm_init: mmap(\"%s\") failed, %s", path,
+   rtld_strerror(errno));
+   free(rpath);
+   return;
+   }
+   close(fd);
+   p = xmalloc(sizeof(struct lmc));
+   p->path = rpath;
+   TAILQ_INSERT_HEAD(&lmc_head, p, next);
+   lmc_parse(lm_map, st.st_size);
+   munmap(lm_map, st.st_size);
+}
+
+static void
+lmc_parse_dir(char *idir)
+{
+   DIR *d;
+   struct dirent *dp;
+   struct lmc *p;
+   char conffile[MAXPATHLEN];
+   char *ext;
+   char *rpath;
+
+   rpath = realpath(idir, NULL);
+   if (rpath == NULL)
+   return;
+
+   TAILQ_FOREACH(p, &lmc_head, next) {
+   if (strcmp(p->path, rpath) == 0) {
+   free(rpath);
+   return;
+   }
+   }
+   d = opendir(idir);
+   if (d == NULL) {
+   free(rpath);
+   return;
+   }
+

svn commit: r234852 - head/tools/regression/usr.bin/m4

2012-04-30 Thread Baptiste Daroussin
Author: bapt
Date: Mon Apr 30 22:00:34 2012
New Revision: 234852
URL: http://svn.freebsd.org/changeset/base/234852

Log:
  Import m4 regression tests from OpenBSD
  
  Obtained from:OpenBSD
  Approved by:  des (mentor)

Added:
  head/tools/regression/usr.bin/m4/args.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/args2.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/comments.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/esyscmd.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/eval.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/ff_after_dnl.m4.uu   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/gnueval.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/gnuformat.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/gnupatterns.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/gnupatterns2.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/gnuprefix.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/gnusofterror.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/includes.aux   (contents, props changed)
  head/tools/regression/usr.bin/m4/includes.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/m4wrap3.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/patterns.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/quotes.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/redef.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/regress.args.out   (contents, props changed)
  head/tools/regression/usr.bin/m4/regress.args2.out   (contents, props changed)
  head/tools/regression/usr.bin/m4/regress.comments.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.esyscmd.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.eval.out   (contents, props changed)
  head/tools/regression/usr.bin/m4/regress.ff_after_dnl.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.gnueval.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.gnuformat.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.gnupatterns.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.gnupatterns2.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.gnuprefix.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.gnusofterror.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.gnutranslit2.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.includes.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.m4wrap3.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.patterns.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.quotes.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.redef.out   (contents, props changed)
  head/tools/regression/usr.bin/m4/regress.strangequotes.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.translit.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/regress.translit2.out   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/strangequotes.m4.uu   (contents, props 
changed)
  head/tools/regression/usr.bin/m4/translit.m4   (contents, props changed)
  head/tools/regression/usr.bin/m4/translit2.m4   (contents, props changed)
Deleted:
  head/tools/regression/usr.bin/m4/regress.changecom.in
  head/tools/regression/usr.bin/m4/regress.changecom.out
  head/tools/regression/usr.bin/m4/regress.gchangecom.out
Modified:
  head/tools/regression/usr.bin/m4/Makefile
  head/tools/regression/usr.bin/m4/regress.sh

Modified: head/tools/regression/usr.bin/m4/Makefile
==
--- head/tools/regression/usr.bin/m4/Makefile   Mon Apr 30 21:26:35 2012
(r234851)
+++ head/tools/regression/usr.bin/m4/Makefile   Mon Apr 30 22:00:34 2012
(r234852)
@@ -1,4 +1,4 @@
 # $FreeBSD$
 
 all:
-   @sh ${.CURDIR}/regress.sh ${.CURDIR}
+   @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin 
${.CURDIR}

Added: head/tools/regression/usr.bin/m4/args.m4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/m4/args.m4Mon Apr 30 22:00:34 2012
(r234852)
@@ -0,0 +1,9 @@
+dnl $FreeBSD$
+dnl $OpenBSD: src/regress/usr.bin/m4/args.m4,v 1.1 2001/10/10 23:23:59 espie 
Exp $
+dnl Expanding all arguments
+define(`A', `first form: $@, second form $*')dnl
+define(`B', `C')dnl
+A(1,2,`B')
+dnl indirection means macro can get called with argc == 2 !
+indir(`A',1,2,`B')
+indir(`A')

Added: head/to

svn commit: r234855 - head/contrib/gcc/config/mips

2012-04-30 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Apr 30 22:46:09 2012
New Revision: 234855
URL: http://svn.freebsd.org/changeset/base/234855

Log:
  Unbreak jemalloc build with MALLOC_PRODUCTION set. New jemalloc version
  uncovered MIPS-related gcc bug described in
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33256
  
  The patch was obtained from r128198 in gcc-4_1-branch, which is GPLv2,
  so it's OK to merge it.

Modified:
  head/contrib/gcc/config/mips/mips.c

Modified: head/contrib/gcc/config/mips/mips.c
==
--- head/contrib/gcc/config/mips/mips.c Mon Apr 30 22:06:47 2012
(r234854)
+++ head/contrib/gcc/config/mips/mips.c Mon Apr 30 22:46:09 2012
(r234855)
@@ -1297,6 +1297,20 @@ mips_split_const (rtx x, rtx *base, HOST
   *base = x;
 }
 
+/* Classify symbolic expression X, given that it appears in context
+   CONTEXT.  */
+
+static enum mips_symbol_type
+mips_classify_symbolic_expression (rtx x)
+{
+  HOST_WIDE_INT offset;
+
+  mips_split_const (x, &x, &offset);
+  if (UNSPEC_ADDRESS_P (x))
+return UNSPEC_ADDRESS_TYPE (x);
+
+  return mips_classify_symbol (x);
+}
 
 /* Return true if SYMBOL is a SYMBOL_REF and OFFSET + SYMBOL points
to the same object as SYMBOL, or to the same object_block.  */
@@ -1534,8 +1548,17 @@ mips_classify_address (struct mips_addre
   info->type = ADDRESS_LO_SUM;
   info->reg = XEXP (x, 0);
   info->offset = XEXP (x, 1);
+  /* We have to trust the creator of the LO_SUM to do something vaguely
+sane.  Target-independent code that creates a LO_SUM should also
+create and verify the matching HIGH.  Target-independent code that
+adds an offset to a LO_SUM must prove that the offset will not
+induce a carry.  Failure to do either of these things would be
+a bug, and we are not required to check for it here.  The MIPS
+backend itself should only create LO_SUMs for valid symbolic
+constants, with the high part being either a HIGH or a copy
+of _gp. */
+  info->symbol_type = mips_classify_symbolic_expression (info->offset);
   return (mips_valid_base_register_p (info->reg, mode, strict)
- && mips_symbolic_constant_p (info->offset, &info->symbol_type)
  && mips_symbolic_address_p (info->symbol_type, mode)
  && mips_lo_relocs[info->symbol_type] != 0);
 
@@ -5671,7 +5694,8 @@ print_operand_reloc (FILE *file, rtx op,
   rtx base;
   HOST_WIDE_INT offset;
 
-  if (!mips_symbolic_constant_p (op, &symbol_type) || relocs[symbol_type] == 0)
+  symbol_type = mips_classify_symbolic_expression (op);
+  if (relocs[symbol_type] == 0)
 fatal_insn ("PRINT_OPERAND, invalid operand for relocation", op);
 
   /* If OP uses an UNSPEC address, we want to print the inner symbol.  */
___
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: r234856 - head/cddl/compat/opensolaris/include

2012-04-30 Thread Robert Millan
Author: rmh
Date: Mon Apr 30 23:12:16 2012
New Revision: 234856
URL: http://svn.freebsd.org/changeset/base/234856

Log:
  GNU/kFreeBSD portability fix. This glue  overrides header protection
  in the system-wide version of  by wrapping the #include_next
   within the scope of its own header protection. On FreeBSD this has
  no effect, since both header protections are equivalent. However the GNU 
version
  of  implements a special header protection mechanism which allows it
  to be included multiple times (in different modes).
  
  Simply by moving the #include_next off the header protection, we allow
  system-wide  to implement its own protection policy, whichever that
  may be.

Modified:
  head/cddl/compat/opensolaris/include/stdlib.h

Modified: head/cddl/compat/opensolaris/include/stdlib.h
==
--- head/cddl/compat/opensolaris/include/stdlib.h   Mon Apr 30 22:46:09 
2012(r234855)
+++ head/cddl/compat/opensolaris/include/stdlib.h   Mon Apr 30 23:12:16 
2012(r234856)
@@ -27,11 +27,11 @@
  *
  */
 
+#include_next 
+
 #ifndef _COMPAT_OPENSOLARIS_STDLIB_H_
 #define _COMPAT_OPENSOLARIS_STDLIB_H_
 
-#include_next 
-
 #define getexecnamegetprogname
 
 #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: r234857 - head/share/misc

2012-04-30 Thread John W. De Boskey
Author: jwd
Date: Tue May  1 01:19:56 2012
New Revision: 234857
URL: http://svn.freebsd.org/changeset/base/234857

Log:
  Add myself to this file - it didn't exist last time.
  
  Approved by:  rmacklem (mentor)

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Mon Apr 30 23:12:16 2012
(r234856)
+++ head/share/misc/committers-src.dot  Tue May  1 01:19:56 2012
(r234857)
@@ -177,6 +177,7 @@ jon [label="Jonathan Chen\njon@FreeBSD.o
 jonathan [label="Jonathan Anderson\njonat...@freebsd.org\n2010/10/07"]
 jpaetzel [label="Josh Paetzel\njpaet...@freebsd.org\n2011/01/21"]
 julian [label="Julian Elischer\njul...@freebsd.org\n1993/??/??"]
+jwd [label="John De Boskey\n...@freebsd.org\n2000/05/19"]
 kaiw [label="Kai Wang\nk...@freebsd.org\n2007/09/26"]
 kan [label="Alexander Kabaev\n...@freebsd.org\n2002/07/21"]
 kargl [label="Steven G. Kargl\nka...@freebsd.org\n2011/01/17"]
@@ -438,6 +439,7 @@ jhb -> rnoland
 jkh -> imp
 jkh -> jlemon
 jkh -> joerg
+jkh -> jwd
 jkh -> phk
 jkh -> wes
 jkh -> yar
@@ -541,6 +543,8 @@ pjd -> trociny
 
 rgrimes -> markm
 
+rmacklem -> jwd
+
 rpaulo -> avg
 rpaulo -> bschmidt
 rpaulo -> dim
___
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: r234859 - in head/sys: conf mips/atheros

2012-04-30 Thread Adrian Chadd
Author: adrian
Date: Tue May  1 04:35:53 2012
New Revision: 234859
URL: http://svn.freebsd.org/changeset/base/234859

Log:
  Migrate ARGE_DEBUG to opt_arge.h.
  
  Submitted by: Stefan Bethke 

Modified:
  head/sys/conf/options.mips
  head/sys/mips/atheros/if_arge.c

Modified: head/sys/conf/options.mips
==
--- head/sys/conf/options.mips  Tue May  1 04:01:22 2012(r234858)
+++ head/sys/conf/options.mips  Tue May  1 04:35:53 2012(r234859)
@@ -65,7 +65,7 @@ OCTEON_BOARD_CAPK_0100ND  opt_cvmx.h
 #
 # Options that control the Atheros SoC peripherals
 #
-ARGE_DEBUG opt_global.h
+ARGE_DEBUG opt_arge.h
 
 #
 # Options that control the Ralink RT305xF Etherenet MAC.

Modified: head/sys/mips/atheros/if_arge.c
==
--- head/sys/mips/atheros/if_arge.c Tue May  1 04:01:22 2012
(r234858)
+++ head/sys/mips/atheros/if_arge.c Tue May  1 04:35:53 2012
(r234859)
@@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
 #include "opt_device_polling.h"
 #endif
 
+#include "opt_arge.h"
+
 #include 
 #include 
 #include 
___
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: r234860 - head/sys/boot/uboot/lib

2012-04-30 Thread Tim Kientzle
Author: kientzle
Date: Tue May  1 05:04:49 2012
New Revision: 234860
URL: http://svn.freebsd.org/changeset/base/234860

Log:
  Teach ubldr(8) about simple MBR partitioning.

Modified:
  head/sys/boot/uboot/lib/devicename.c
  head/sys/boot/uboot/lib/disk.c
  head/sys/boot/uboot/lib/libuboot.h

Modified: head/sys/boot/uboot/lib/devicename.c
==
--- head/sys/boot/uboot/lib/devicename.cTue May  1 04:35:53 2012
(r234859)
+++ head/sys/boot/uboot/lib/devicename.cTue May  1 05:04:49 2012
(r234860)
@@ -131,6 +131,10 @@ uboot_parsedev(struct uboot_devdesc **de
*(cp + 1) != ':') {
pnum = strtol(cp + 1, &cp, 10);
ptype = PTYPE_GPT;
+   } else if (*cp == 's' && *(cp + 1) &&
+   *(cp + 1) != ':') {
+   pnum = strtol(cp + 1, &cp, 10);
+   ptype = PTYPE_MBR;
} else {
pnum = *cp - 'a';
ptype = PTYPE_BSDLABEL;
@@ -218,6 +222,9 @@ uboot_fmtdev(void *vdev)
else if (dev->d_kind.disk.ptype == PTYPE_GPT)
cp += sprintf(cp, "p%i",
dev->d_kind.disk.pnum);
+   else if (dev->d_kind.disk.ptype == PTYPE_MBR)
+   cp += sprintf(cp, "s%i",
+   dev->d_kind.disk.pnum);
}
 
strcat(cp, ":");

Modified: head/sys/boot/uboot/lib/disk.c
==
--- head/sys/boot/uboot/lib/disk.c  Tue May  1 04:35:53 2012
(r234859)
+++ head/sys/boot/uboot/lib/disk.c  Tue May  1 05:04:49 2012
(r234860)
@@ -398,6 +398,94 @@ out:
 }
 
 static int
+stor_open_mbr(struct open_dev *od, struct uboot_devdesc *dev)
+{
+   char *buf = NULL;
+   struct dos_partition *dp;
+   int err, i, part;
+
+   od->od_nparts = 0;
+   od->od_partitions = NULL;
+
+   /* Block size must be at least 512 bytes. */
+   if (od->od_bsize < 512)
+   return (ENXIO);
+
+   /* Read MBR */
+   buf = malloc(od->od_bsize);
+   if (!buf) {
+   stor_printf("could not allocate memory for MBR\n");
+   return (ENOMEM);
+   }
+   err = stor_readdev(dev, 0, 1, buf);
+   if (err) {
+   stor_printf("MBR read error=%d\n", err);
+   err = EIO;
+   goto out;
+   }
+
+   /* Check the slice table magic. */
+   if (le16toh(*((uint16_t *)(buf + DOSMAGICOFFSET))) != DOSMAGIC) {
+   err = ENXIO;
+   goto out;
+   }
+
+   /* Save information about partitions. */
+   dp = (struct dos_partition *)(buf + DOSPARTOFF);
+   od->od_partitions = calloc(NDOSPART, sizeof(struct gpt_part));
+   if (!od->od_partitions) {
+   stor_printf("could not allocate memory for MBR partitions\n");
+   err = ENOMEM;
+   goto out;
+   }
+
+   part = 0;
+   for (i = 0; i < NDOSPART; i++) {
+   u_int32_t start = le32dec(&dp[i].dp_start);
+   u_int32_t size = le32dec(&dp[i].dp_size);
+   uuid_t *u = NULL;
+
+   /* Map MBR partition types to GPT partition types. */
+   switch (dp[i].dp_typ) {
+   case DOSPTYP_386BSD:
+   u = &freebsd_ufs;
+   break;
+   /* XXX Other types XXX */
+   }
+
+   if (u) {
+   od->od_partitions[part].gp_type = *u;
+   od->od_partitions[part].gp_index = i + 1;
+   od->od_partitions[part].gp_start = start;
+   od->od_partitions[part].gp_end = start + size;
+   part += 1;
+   }
+   }
+   od->od_nparts = part;
+
+   if (od->od_nparts == 0) {
+   err = EINVAL;
+   goto out;
+   }
+
+   dev->d_disk.ptype = PTYPE_MBR;
+
+   /* XXX Be smarter here? XXX */
+   if (dev->d_disk.pnum == 0)
+   dev->d_disk.pnum = od->od_partitions[0].gp_index;
+
+   for (i = 0; i < od->od_nparts; i++)
+   if (od->od_partitions[i].gp_index == dev->d_disk.pnum)
+   od->od_bstart = od->od_partitions[i].gp_start;
+
+out:
+   if (err && od->od_partitions)
+   free(od->od_partitions);
+   free(buf);
+   return (err);
+}
+
+static int
 stor_open_bsdlabel(struct open_dev *od, struct uboot_devdesc *dev)
 {
char *buf;
@@ -443,7 +531,7 @@ stor_readdev(struct uboot_devdesc *dev, 
lbasize_t real_siz

svn commit: r234861 - in head/sys: conf dev/etherswitch

2012-04-30 Thread Adrian Chadd
Author: adrian
Date: Tue May  1 06:11:38 2012
New Revision: 234861
URL: http://svn.freebsd.org/changeset/base/234861

Log:
  Bring over the first part of the etherswitch framework - an MDIO bus and
  MDIO/MII rendezvous proxy.
  
  * Add an 'mdio' bus, which is the "IO" side of an MII bus (but by design
can be anything which implements the underlying register access API.)
  * Add 'miiproxy' and 'mdioproxy', which provides a rendezvous mechanism
for MII busses to appear hanging off arbitrary busses (ie, that aren't
necessarily a traditional looking MII bus.)
  
  MII busses can now hang off anything that implements an mdiobus.
  
  For the AR71xx SoC, there's one MDIO bus but two MII busses.  So to
  properly support two or more real PHYs, this can be done:
  
# arge0 MDIO bus - there's no arge1 MDIO bus for AR71xx
hint.argemdio.0.at="nexus0"
hint.argemdio.0.maddr=0x1900
hint.argemdio.0.msize=0x1000
hint.argemdio.0.order=0
  
# Create two mdioproxy instances
hint.mdioproxy.0.at="mdio0"
hint.mdioproxy.1.at="mdio0"
  
# .. and with a follow-up patch
hint.arge.0.mdio=mdioproxy0
hint.arge.1.mdio=mdioproxy0
  
  TODO:
  
  * Do a sweep or two and add appropriate locking in mdio/mdioproxy/miiproxy.
  
  Submitted by: Stefan Bethke 
  Reviewed by:  ray

Added:
  head/sys/dev/etherswitch/
  head/sys/dev/etherswitch/mdio.c   (contents, props changed)
  head/sys/dev/etherswitch/mdio.h   (contents, props changed)
  head/sys/dev/etherswitch/mdio_if.m   (contents, props changed)
  head/sys/dev/etherswitch/miiproxy.c   (contents, props changed)
  head/sys/dev/etherswitch/miiproxy.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/conf/kmod.mk

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue May  1 05:04:49 2012(r234860)
+++ head/sys/conf/files Tue May  1 06:11:38 2012(r234861)
@@ -3683,3 +3683,7 @@ dev/xen/netback/netback.c optional xen |
 dev/xen/netfront/netfront.coptional xen | xenhvm
 dev/xen/xenpci/xenpci.coptional xenpci
 dev/xen/xenpci/evtchn.c optional xenpci
+
+dev/etherswitch/mdio_if.m  optional miiproxy
+dev/etherswitch/mdio.c optional miiproxy
+dev/etherswitch/miiproxy.c optional miiproxy

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue May  1 05:04:49 2012(r234860)
+++ head/sys/conf/kmod.mk   Tue May  1 06:11:38 2012(r234861)
@@ -354,7 +354,7 @@ MFILES?= dev/acpica/acpi_if.m dev/acpi_s
kern/bus_if.m kern/clock_if.m \
kern/cpufreq_if.m kern/device_if.m kern/serdev_if.m \
libkern/iconv_converter_if.m opencrypto/cryptodev_if.m \
-   pc98/pc98/canbus_if.m
+   pc98/pc98/canbus_if.m dev/etherswitch/mdio_if.m
 
 .for _srcsrc in ${MFILES}
 .for _ext in c h

Added: head/sys/dev/etherswitch/mdio.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/etherswitch/mdio.c Tue May  1 06:11:38 2012
(r234861)
@@ -0,0 +1,117 @@
+/*-
+ * Copyright (c) 2011-2012 Stefan Bethke.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include "mdio_if.h"
+
+static void
+mdio_identify(driver_t *driver, device_t parent)
+{
+
+   if (device_find_child(parent, mdio_driver.name, -1) == NULL)
+   BUS_ADD_CHILD(parent, 0, mdio_driver.name, -1);
+}
+
+static int
+mdio_probe(device_t dev)
+{
+
+