svn commit: r235975 - head/usr.bin/gprof

2012-05-25 Thread Grzegorz Bernacki
Author: gber
Date: Fri May 25 06:48:42 2012
New Revision: 235975
URL: http://svn.freebsd.org/changeset/base/235975

Log:
  Fix resolving symbol names on ARM.
  
  On ARM, binutils are adding '$a' symbols in the symbol table for
  every function (in addition to normal symbol). When gprof(1) looks
  up symbol name, it often reads '$a' instead of proper function name,
  because it find it first. With this fix, when read symbol name
  begins with '$' and previous symbol has the same address, it will
  use previous symbol name (which is proper function name).
  
  Obtained from:Semihalf

Modified:
  head/usr.bin/gprof/lookup.c

Modified: head/usr.bin/gprof/lookup.c
==
--- head/usr.bin/gprof/lookup.c Fri May 25 06:41:08 2012(r235974)
+++ head/usr.bin/gprof/lookup.c Fri May 25 06:48:42 2012(r235975)
@@ -66,6 +66,12 @@ nllookup( address )
printf( [nllookup] %d (%d) probes\n , probes , nname-1 );
}
 #  endif /* DEBUG */
+#if defined(__arm__)
+   if (nl[middle].name[0] == '$' 
+   nl[middle-1].value == nl[middle].value)
+   middle--;
+#endif
+
return nl[ middle ];
}
if ( nl[ middle ].value  address ) {
___
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: r235978 - head/sys/kern

2012-05-25 Thread Andriy Gapon
Author: avg
Date: Fri May 25 07:32:26 2012
New Revision: 235978
URL: http://svn.freebsd.org/changeset/base/235978

Log:
  device_add_child: protect against child device with no driver but fixed unit 
number
  
  This combination doesn't make sense, unit numbers should be hardwired
  only in context of a known driver.  The wildcard devices should have
  wildcard unit numbers.
  
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cFri May 25 07:25:30 2012(r235977)
+++ head/sys/kern/subr_bus.cFri May 25 07:32:26 2012(r235978)
@@ -1810,6 +1810,8 @@ device_add_child_ordered(device_t dev, u
 
PDEBUG((%s at %s with order %u as unit %d,
name, DEVICENAME(dev), order, unit));
+   KASSERT(name != NULL || unit == -1,
+   (child device with wildcard name and specific unit number));
 
child = make_device(dev, name, unit);
if (child == 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: r235979 - head/sys/netgraph

2012-05-25 Thread Gleb Smirnoff
Author: glebius
Date: Fri May 25 07:46:24 2012
New Revision: 235979
URL: http://svn.freebsd.org/changeset/base/235979

Log:
  Revert my local not yet properly tested changes, that leaked in
  with r235923.

Modified:
  head/sys/netgraph/ng_mppc.c

Modified: head/sys/netgraph/ng_mppc.c
==
--- head/sys/netgraph/ng_mppc.c Fri May 25 07:32:26 2012(r235978)
+++ head/sys/netgraph/ng_mppc.c Fri May 25 07:46:24 2012(r235979)
@@ -98,6 +98,15 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, n
 /* Key length */
 #define KEYLEN(b)  (((b)  MPPE_128) ? 16 : 8)
 
+/*
+ * When packets are lost with MPPE, we may have to re-key arbitrarily
+ * many times to 'catch up' to the new jumped-ahead sequence number.
+ * Since this can be expensive, we pose a limit on how many re-keyings
+ * we will do at one time to avoid a possible D.O.S. vulnerability.
+ * This should instead be a configurable parameter.
+ */
+#define MPPE_MAX_REKEY 1000
+
 /* MPPC packet header bits */
 #define MPPC_FLAG_FLUSHED  0x8000  /* xmitter reset state */
 #define MPPC_FLAG_RESTART  0x4000  /* compress history restart */
@@ -632,22 +641,20 @@ ng_mppc_decompress(node_p node, struct m
 #endif
 #ifdef NETGRAPH_MPPC_ENCRYPTION
if ((d-cfg.bits  MPPE_BITS) != 0) {
-   u_int rekey;
- 
-   /* How many times are we going to have to re-key? */
-   rekey = ((d-cfg.bits  MPPE_STATELESS) != 0) ?
-   numLost : (numLost / (MPPE_UPDATE_MASK + 1));
-   if (rekey  1000)
-   log(LOG_ERR, %s: %d packets dropped, 
-  node [%x]\n, __func__, numLost,
-  node-nd_ID);
-
-   /*
-* When packets are lost or re-ordered with MPPE,
-* we may have to re-key up to 0xfff times to 'catch
-* up' to the new jumped-ahead sequence number. Yep,
-* this is heavy, but what else can we do?
-*/
+   u_int rekey;
+
+   /* How many times are we going to have to re-key? */
+   rekey = ((d-cfg.bits  MPPE_STATELESS) != 0) ?
+   numLost : (numLost / (MPPE_UPDATE_MASK + 1));
+   if (rekey  MPPE_MAX_REKEY) {
+   log(LOG_ERR, %s: too many (%d) packets
+dropped, disabling node %p!,
+   __func__, numLost, node);
+   priv-recv.cfg.enable = 0;
+   goto failed;
+   }
+
+   /* Re-key as necessary to catch up to peer */
while (d-cc != cc) {
if ((d-cfg.bits  MPPE_STATELESS) != 0
|| (d-cc  MPPE_UPDATE_MASK)
___
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: r235980 - head/sys/cam/scsi

2012-05-25 Thread Alexander Motin
Author: mav
Date: Fri May 25 07:57:17 2012
New Revision: 235980
URL: http://svn.freebsd.org/changeset/base/235980

Log:
  Remove sleep() from invalidate call in ses driver, waiting for daemon
  process exit. Instead use CAM's standard reference counting to prevent
  periph going away until process won't complete. I think that sleep in
  single CAM SWI thread is not a good idea and may lead to deadlocks if
  daemon process waits for some command completion. Combined with recent
  patch avoiding use of CAM SWI for ATA it just causes panics because of
  sleeps prohibited in interrupt thread context.

Modified:
  head/sys/cam/scsi/scsi_enc.c

Modified: head/sys/cam/scsi/scsi_enc.c
==
--- head/sys/cam/scsi/scsi_enc.cFri May 25 07:46:24 2012
(r235979)
+++ head/sys/cam/scsi/scsi_enc.cFri May 25 07:57:17 2012
(r235980)
@@ -136,15 +136,8 @@ enc_oninvalidate(struct cam_periph *peri
 */
enc-enc_flags |= ENC_FLAG_SHUTDOWN;
if (enc-enc_daemon != NULL) {
-   /* Signal and wait for the ses daemon to terminate. */
+   /* Signal the ses daemon to terminate. */
wakeup(enc-enc_daemon);
-   /*
-* We're called with the SIM mutex held, but we're dropping
-* the update mutex here on sleep.  So we have to manually
-* drop the SIM mutex.
-*/
-   cam_periph_sleep(enc-periph, enc-enc_daemon,
-PUSER, thtrm, 0);
}
callout_drain(enc-status_updater);
 
@@ -839,6 +832,7 @@ enc_daemon(void *arg)
}
enc-enc_daemon = NULL;
cam_periph_unlock(enc-periph);
+   cam_periph_release(enc-periph);
kproc_exit(0);
 }
 
@@ -849,6 +843,9 @@ enc_kproc_init(enc_softc_t *enc)
 
callout_init_mtx(enc-status_updater, enc-periph-sim-mtx, 0);
 
+   if (cam_periph_acquire(enc-periph) != CAM_REQ_CMP)
+   return (ENXIO);
+
result = kproc_create(enc_daemon, enc, enc-enc_daemon, /*flags*/0,
  /*stackpgs*/0, enc_daemon%d,
  enc-periph-unit_number);
@@ -857,7 +854,8 @@ enc_kproc_init(enc_softc_t *enc)
cam_periph_lock(enc-periph);
enc-enc_vec.poll_status(enc);
cam_periph_unlock(enc-periph);
-   }
+   } else
+   cam_periph_release(enc-periph);
return (result);
 }
  
@@ -955,7 +953,7 @@ enc_ctor(struct cam_periph *periph, void
err = enc_kproc_init(enc);
if (err) {
xpt_print(periph-path,
- error %d string enc_daemon\n, err);
+ error %d starting enc_daemon\n, err);
goto out;
}
}
___
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: r235981 - head/sys/netinet

2012-05-25 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 08:17:59 2012
New Revision: 235981
URL: http://svn.freebsd.org/changeset/base/235981

Log:
  In case forwarding is turned on for a given address family, refuse to
  queue the packet for LRO and tell the driver to directly pass it on.
  This avoids re-assembly and later re-fragmentation problems when
  forwarding.
  
  It's not the best solution but the simplest and most effective for
  the moment.
  
  Should have been done:ages ago
  Discussed with and by:many
  MFC after:3 days

Modified:
  head/sys/netinet/tcp_lro.c

Modified: head/sys/netinet/tcp_lro.c
==
--- head/sys/netinet/tcp_lro.c  Fri May 25 07:57:17 2012(r235980)
+++ head/sys/netinet/tcp_lro.c  Fri May 25 08:17:59 2012(r235981)
@@ -51,9 +51,12 @@ __FBSDID($FreeBSD$);
 #include netinet/in.h
 #include netinet/ip6.h
 #include netinet/ip.h
+#include netinet/ip_var.h
 #include netinet/tcp.h
 #include netinet/tcp_lro.h
 
+#include netinet6/ip6_var.h
+
 #include machine/in_cksum.h
 
 #ifndef LRO_ENTRIES
@@ -369,6 +372,10 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
switch (eh_type) {
 #ifdef INET6
case ETHERTYPE_IPV6:
+   if (V_ip6_forwarding != 0) {
+   /* XXX-BZ stats but changing lro_ctrl is a problem. */
+   return (TCP_LRO_CANNOT);
+   }
l3hdr = ip6 = (struct ip6_hdr *)(eh + 1);
error = tcp_lro_rx_ipv6(lc, m, ip6, th);
if (error != 0)
@@ -379,6 +386,10 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
 #endif
 #ifdef INET
case ETHERTYPE_IP:
+   if (V_ipforwarding != 0) {
+   /* XXX-BZ stats but changing lro_ctrl is a problem. */
+   return (TCP_LRO_CANNOT);
+   }
l3hdr = ip4 = (struct ip *)(eh + 1);
error = tcp_lro_rx_ipv4(lc, m, ip4, th);
if (error != 0)
___
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: r235929 - in head/lib/libc/powerpc: . gen

2012-05-25 Thread Konstantin Belousov
On Thu, May 24, 2012 at 08:12:46PM +, Marcel Moolenaar wrote:
 Author: marcel
 Date: Thu May 24 20:12:46 2012
 New Revision: 235929
 URL: http://svn.freebsd.org/changeset/base/235929
 
 Log:
   Allow building for the PowerPC EABI by providing a dummy __eabi()
   function. The purpose of the __eabi() function is to set up the
   runtime and is called first thing by main(). The runtime is already
   set up for us prior to caling main, so there's nothing to do for
   us in the EABI case.
 
 Added:
   head/lib/libc/powerpc/gen/eabi.S   (contents, props changed)
 Modified:
   head/lib/libc/powerpc/Symbol.map
   head/lib/libc/powerpc/gen/Makefile.inc
 
 Modified: head/lib/libc/powerpc/Symbol.map
 ==
 --- head/lib/libc/powerpc/Symbol.map  Thu May 24 20:00:58 2012
 (r235928)
 +++ head/lib/libc/powerpc/Symbol.map  Thu May 24 20:12:46 2012
 (r235929)
 @@ -11,6 +11,7 @@ FBSD_1.0 {
   /* PSEUDO syscalls */
   _exit;
  
 + __eabi;
   _mcount;
   _setjmp;
   _longjmp;
I think the symbol should have been added to FBSD_1.3 version.


pgpvwsr1Fwhu2.pgp
Description: PGP signature


svn commit: r235982 - head/sys/cam/ata

2012-05-25 Thread Alexander Motin
Author: mav
Date: Fri May 25 08:30:09 2012
New Revision: 235982
URL: http://svn.freebsd.org/changeset/base/235982

Log:
  Add tunable/sysctl kern.cam.pmp.hide_special, controlling whether special
  PMP ports such as PMP configuration or SEMB should be exposed or hidden.
  These ports were always hidden before as useless and sometimes promatic.
  But with updated ses driver supporting SEMB it is no longer so straight.
  Keep ports hidden by default to avoid probe request ttimeouts if SEP is
  not connected to PMP's SEMB via I2C, that is very often situation.

Modified:
  head/sys/cam/ata/ata_pmp.c

Modified: head/sys/cam/ata/ata_pmp.c
==
--- head/sys/cam/ata/ata_pmp.c  Fri May 25 08:17:59 2012(r235981)
+++ head/sys/cam/ata/ata_pmp.c  Fri May 25 08:30:09 2012(r235982)
@@ -126,8 +126,13 @@ static voidpmpdone(struct cam_periph *
 #definePMP_DEFAULT_RETRY   1
 #endif
 
+#ifndefPMP_DEFAULT_HIDE_SPECIAL
+#definePMP_DEFAULT_HIDE_SPECIAL1
+#endif
+
 static int pmp_retry_count = PMP_DEFAULT_RETRY;
 static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT;
+static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL;
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0,
 CAM Direct Access Disk driver);
@@ -137,6 +142,9 @@ TUNABLE_INT(kern.cam.pmp.retry_count, 
 SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW,
pmp_default_timeout, 0, Normal I/O timeout (in seconds));
 TUNABLE_INT(kern.cam.pmp.default_timeout, pmp_default_timeout);
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW,
+   pmp_hide_special, 0, Hide extra ports);
+TUNABLE_INT(kern.cam.pmp.hide_special, pmp_hide_special);
 
 static struct periph_driver pmpdriver =
 {
@@ -583,23 +591,33 @@ pmpdone(struct cam_periph *periph, union
(ataio-res.lba_mid  16) +
(ataio-res.lba_low  8) +
ataio-res.sector_count;
-   /* This PMP declares 6 ports, while only 5 of them are real.
-* Port 5 is enclosure management bridge port, which has 
implementation
-* problems, causing probe faults. Hide it for now. */
-   if (softc-pm_pid == 0x37261095  softc-pm_ports == 6)
-   softc-pm_ports = 5;
-   /* This PMP declares 7 ports, while only 5 of them are real.
-* Port 5 is some fake Config  Disk with 640 sectors size,
-* port 6 is enclosure management bridge port.
-* Both fake ports has implementation problems, causing
-* probe faults. Hide them for now. */
-   if (softc-pm_pid == 0x47261095  softc-pm_ports == 7)
-   softc-pm_ports = 5;
-   /* These PMPs declare one more port then actually have,
-* for configuration purposes. Hide it for now. */
-   if (softc-pm_pid == 0x57231095 || softc-pm_pid == 0x57331095 
||
-   softc-pm_pid == 0x57341095 || softc-pm_pid == 0x57441095)
-   softc-pm_ports--;
+   if (pmp_hide_special) {
+   /*
+* This PMP declares 6 ports, while only 5 of them
+* are real. Port 5 is a SEMB port, probing which
+* causes timeouts if external SEP is not connected
+* to PMP over I2C.
+*/
+   if (softc-pm_pid == 0x37261095  softc-pm_ports == 6)
+   softc-pm_ports = 5;
+
+   /*
+* This PMP declares 7 ports, while only 5 of them
+* are real. Port 5 is a fake Config  Disk with
+* 640 sectors size. Port 6 is a SEMB port.
+*/
+   if (softc-pm_pid == 0x47261095  softc-pm_ports == 7)
+   softc-pm_ports = 5;
+
+   /*
+* These PMPs have extra configuration port.
+*/
+   if (softc-pm_pid == 0x57231095 ||
+   softc-pm_pid == 0x57331095 ||
+   softc-pm_pid == 0x57341095 ||
+   softc-pm_pid == 0x57441095)
+   softc-pm_ports--;
+   }
printf(%s%d: %d fan-out ports\n,
periph-periph_name, periph-unit_number,
softc-pm_ports);
___
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: r235859 - in head/sys: i386/conf modules

2012-05-25 Thread Niclas Zeising
On 2012-05-24 11:33, Niclas Zeising wrote:
 On 2012-05-24 11:26, Konstantin Belousov wrote:
 On Wed, May 23, 2012 at 11:37:29PM +0200, Niclas Zeising wrote:
 On 05/23/12 23:07, Konstantin Belousov wrote:
 Author: kib
 Date: Wed May 23 21:07:01 2012
 New Revision: 235859
 URL: http://svn.freebsd.org/changeset/base/235859

 Log:
   Enable drm2 modules build.

   Sponsored by:The FreeBSD Foundation
   MFC after:   1 month

 Modified:
   head/sys/i386/conf/XEN
   head/sys/modules/Makefile


 Hi!
 Thank you very much for all your work!
 With this commit, is there any need for any patches from you, or have 
 they all been incorporated by now? Perhaps a note in UPDATING would be 
 good, at least to make people more aware of the fact that GEM/KMS 
 finally has come to FreeBSD as well.  An update to the wiki might be 
 good as well.  I can help you with patches and updating the wiki, just 
 let me know.
 Once again, a big thank you!

 ATM no more patches are needed to run new driver.

 I do not see a need in any UPDATING entry, since nothing should have
 been changed for users who did not used my patch before.

 Wiki ought to get complete rewrite, I might get time to do it at the end
 of week.
 
 Hi!
 Thank you for the clarifications!
 
 Regards!

Hi!
Would it be possible to bump the FreeBSD version to reflect this commit?
 It would be helpful when working with the xorg ports, amongst other things.
Thanks!
Regards!
-- 
Niclas Zeising
___
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: r235984 - in head/sys/fs: hpfs ntfs

2012-05-25 Thread Gleb Kurtsou
Author: gleb
Date: Fri May 25 09:16:59 2012
New Revision: 235984
URL: http://svn.freebsd.org/changeset/base/235984

Log:
  Use C99-style initialization for struct dirent in preparation for
  changing the structure.
  
  Sponsored by: Google Summer of Code 2011

Modified:
  head/sys/fs/hpfs/hpfs_vnops.c
  head/sys/fs/ntfs/ntfs_vnops.c

Modified: head/sys/fs/hpfs/hpfs_vnops.c
==
--- head/sys/fs/hpfs/hpfs_vnops.c   Fri May 25 08:55:59 2012
(r235983)
+++ head/sys/fs/hpfs/hpfs_vnops.c   Fri May 25 09:16:59 2012
(r235984)
@@ -797,10 +797,21 @@ hpfs_de_uiomove (
 }
 
 
-static struct dirent hpfs_de_dot =
-   { 0, sizeof(struct dirent), DT_DIR, 1, . };
-static struct dirent hpfs_de_dotdot =
-   { 0, sizeof(struct dirent), DT_DIR, 2, .. };
+static struct dirent hpfs_de_dot = {
+   .d_fileno = 0,
+   .d_reclen = sizeof(struct dirent),
+   .d_type = DT_DIR,
+   .d_namlen = 1,
+   .d_name = .
+};
+static struct dirent hpfs_de_dotdot = {
+   .d_fileno = 0,
+   .d_reclen = sizeof(struct dirent),
+   .d_type = DT_DIR,
+   .d_namlen = 2,
+   .d_name = ..
+};
+
 int
 hpfs_readdir(ap)
struct vop_readdir_args /* {

Modified: head/sys/fs/ntfs/ntfs_vnops.c
==
--- head/sys/fs/ntfs/ntfs_vnops.c   Fri May 25 08:55:59 2012
(r235983)
+++ head/sys/fs/ntfs/ntfs_vnops.c   Fri May 25 09:16:59 2012
(r235984)
@@ -493,8 +493,13 @@ ntfs_readdir(ap)
 
/* Simulate . in every dir except ROOT */
if( ip-i_number != NTFS_ROOTINO ) {
-   struct dirent dot = { NTFS_ROOTINO,
-   sizeof(struct dirent), DT_DIR, 1, . };
+   struct dirent dot = {
+   .d_fileno = NTFS_ROOTINO,
+   .d_reclen = sizeof(struct dirent),
+   .d_type = DT_DIR,
+   .d_namlen = 1,
+   .d_name = .
+   };
 
if( uio-uio_offset  sizeof(struct dirent) ) {
dot.d_fileno = ip-i_number;
@@ -508,8 +513,13 @@ ntfs_readdir(ap)
 
/* Simulate .. in every dir including ROOT */
if( uio-uio_offset  2 * sizeof(struct dirent) ) {
-   struct dirent dotdot = { NTFS_ROOTINO,
-   sizeof(struct dirent), DT_DIR, 2, .. };
+   struct dirent dotdot = {
+   .d_fileno = NTFS_ROOTINO,
+   .d_reclen = sizeof(struct dirent),
+   .d_type = DT_DIR,
+   .d_namlen = 2,
+   .d_name = ..
+   };
 
error = uiomove((char *)dotdot,sizeof(struct dirent),uio);
if(error)
___
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: r235985 - head/sys/netinet

2012-05-25 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 09:24:45 2012
New Revision: 235985
URL: http://svn.freebsd.org/changeset/base/235985

Log:
  MFp4 bz_ipv6_fast:
  
Properly protect the inp read access when handling the control code.
In the past this was expensive but given the rlock it's not so much
anymore.
  
Spotted while:  optimizing udp6
Discussed with: rwatson (a few months ago)
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==
--- head/sys/netinet/udp_usrreq.c   Fri May 25 09:16:59 2012
(r235984)
+++ head/sys/netinet/udp_usrreq.c   Fri May 25 09:24:45 2012
(r235985)
@@ -971,12 +971,14 @@ udp_output(struct inpcb *inp, struct mbu
}
 
src.sin_family = 0;
+   INP_RLOCK(inp);
if (control != NULL) {
/*
 * XXX: Currently, we assume all the optional information is
 * stored in a single mbuf.
 */
if (control-m_next) {
+   INP_RUNLOCK(inp);
m_freem(control);
m_freem(m);
return (EINVAL);
@@ -1018,6 +1020,7 @@ udp_output(struct inpcb *inp, struct mbu
m_freem(control);
}
if (error) {
+   INP_RUNLOCK(inp);
m_freem(m);
return (error);
}
@@ -1039,7 +1042,6 @@ udp_output(struct inpcb *inp, struct mbu
 * XXXRW: Check that hash locking update here is correct.
 */
sin = (struct sockaddr_in *)addr;
-   INP_RLOCK(inp);
if (sin != NULL 
(inp-inp_laddr.s_addr == INADDR_ANY  inp-inp_lport == 0)) {
INP_RUNLOCK(inp);
___
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: r235986 - head/sys/netinet6

2012-05-25 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 09:27:16 2012
New Revision: 235986
URL: http://svn.freebsd.org/changeset/base/235986

Log:
  MFp4 bz_ipv6_fast:
  
Use M_ZERO with malloc rather than calling bzero() ourselves.
  
Change if () panic() checks to KASSERT()s as they are only
catching invariants in code flow but not dependent on network
input/output.
  
Move initial assigments indirecting pointers after the lock
has been aquired.
  
Passing layer boundries, reset M_PROTOFLAGS.
  
Remove a NULL assignment before free.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Fri May 25 09:24:45 2012(r235985)
+++ head/sys/netinet6/nd6.c Fri May 25 09:27:16 2012(r235986)
@@ -174,9 +174,7 @@ nd6_ifattach(struct ifnet *ifp)
 {
struct nd_ifinfo *nd;
 
-   nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK);
-   bzero(nd, sizeof(*nd));
-
+   nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK|M_ZERO);
nd-initialized = 1;
 
nd-chlim = IPV6_DEFHLIM;
@@ -284,10 +282,9 @@ nd6_option(union nd_opts *ndopts)
struct nd_opt_hdr *nd_opt;
int olen;
 
-   if (ndopts == NULL)
-   panic(ndopts == NULL in nd6_option);
-   if (ndopts-nd_opts_last == NULL)
-   panic(uninitialized ndopts in nd6_option);
+   KASSERT(ndopts != NULL, (%s: ndopts == NULL, __func__));
+   KASSERT(ndopts-nd_opts_last != NULL, (%s: uninitialized ndopts,
+   __func__));
if (ndopts-nd_opts_search == NULL)
return NULL;
if (ndopts-nd_opts_done)
@@ -335,10 +332,9 @@ nd6_options(union nd_opts *ndopts)
struct nd_opt_hdr *nd_opt;
int i = 0;
 
-   if (ndopts == NULL)
-   panic(ndopts == NULL in nd6_options);
-   if (ndopts-nd_opts_last == NULL)
-   panic(uninitialized ndopts in nd6_options);
+   KASSERT(ndopts != NULL, (%s: ndopts == NULL, __func__));
+   KASSERT(ndopts-nd_opts_last != NULL, (%s: uninitialized ndopts,
+   __func__));
if (ndopts-nd_opts_search == NULL)
return 0;
 
@@ -1174,11 +1170,13 @@ done:
 void
 nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info)
 {
-   struct sockaddr_in6 *gateway = (struct sockaddr_in6 *)rt-rt_gateway;
+   struct sockaddr_in6 *gateway;
struct nd_defrouter *dr;
-   struct ifnet *ifp = rt-rt_ifp;
+   struct ifnet *ifp;
 
RT_LOCK_ASSERT(rt);
+   gateway = (struct sockaddr_in6 *)rt-rt_gateway;
+   ifp = rt-rt_ifp;
 
switch (req) {
case RTM_ADD:
@@ -1547,10 +1545,8 @@ nd6_cache_lladdr(struct ifnet *ifp, stru
 
IF_AFDATA_UNLOCK_ASSERT(ifp);
 
-   if (ifp == NULL)
-   panic(ifp == NULL in nd6_cache_lladdr);
-   if (from == NULL)
-   panic(from == NULL in nd6_cache_lladdr);
+   KASSERT(ifp != NULL, (%s: ifp == NULL, __func__));
+   KASSERT(from != NULL, (%s: from == NULL, __func__));
 
/* nothing must be updated for unspecified address */
if (IN6_IS_ADDR_UNSPECIFIED(from))
@@ -2074,6 +2070,8 @@ nd6_output_lle(struct ifnet *ifp, struct
}
return (error);
}
+   /* Reset layer specific mbuf flags to avoid confusing lower layers. */
+   m-m_flags = ~(M_PROTOFLAGS);  
if ((ifp-if_flags  IFF_LOOPBACK) != 0) {
return ((*ifp-if_output)(origifp, m, (struct sockaddr *)dst,
NULL));
@@ -2239,7 +2237,6 @@ clear_llinfo_pqueue(struct llentry *ln)
 
for (m_hold = ln-la_hold; m_hold; m_hold = m_hold_next) {
m_hold_next = m_hold-m_nextpkt;
-   m_hold-m_nextpkt = NULL;
m_freem(m_hold);
}
 
___
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: r235987 - head/usr.bin/sort

2012-05-25 Thread Gabor Kovesdan
Author: gabor
Date: Fri May 25 09:30:16 2012
New Revision: 235987
URL: http://svn.freebsd.org/changeset/base/235987

Log:
  - Only use multi-threading for large files
  - Do not use mmap() by default; it can be enabled by --mmap
  - Add some minor optimizations for -u
  - Update manual page according to the changes
  
  Submitted by: Oleg Moskalenko oleg.moskale...@citrix.com

Modified:
  head/usr.bin/sort/bwstring.c
  head/usr.bin/sort/file.c
  head/usr.bin/sort/file.h
  head/usr.bin/sort/radixsort.c
  head/usr.bin/sort/sort.1.in
  head/usr.bin/sort/sort.c
  head/usr.bin/sort/sort.h

Modified: head/usr.bin/sort/bwstring.c
==
--- head/usr.bin/sort/bwstring.cFri May 25 09:27:16 2012
(r235986)
+++ head/usr.bin/sort/bwstring.cFri May 25 09:30:16 2012
(r235987)
@@ -499,6 +499,22 @@ bwsfgetln(FILE *f, size_t *len, bool zer
}
return (bwssbdup(ret, *len));
 
+   } else if (!zero_ended  (MB_CUR_MAX == 1)) {
+   char *ret;
+
+   ret = fgetln(f, len);
+
+   if (ret == NULL) {
+   if (!feof(f))
+   err(2, NULL);
+   return (NULL);
+   }
+   if (*len  0) {
+   if (ret[*len - 1] == '\n')
+   --(*len);
+   }
+   return (bwscsbdup(ret, *len));
+
} else {
wchar_t c = 0;
 

Modified: head/usr.bin/sort/file.c
==
--- head/usr.bin/sort/file.cFri May 25 09:27:16 2012(r235986)
+++ head/usr.bin/sort/file.cFri May 25 09:30:16 2012(r235987)
@@ -53,6 +53,8 @@ __FBSDID($FreeBSD$);
 unsigned long long free_memory = 100;
 unsigned long long available_free_memory = 100;
 
+bool use_mmap;
+
 const char *tmpdir = /var/tmp;
 const char *compress_program;
 
@@ -404,23 +406,21 @@ sort_list_dump(struct sort_list *l, cons
err(2, NULL);
 
if (l-list) {
-   struct sort_list_item *last_printed_item;
size_t i;
-
-   last_printed_item = NULL;
-
-   for (i = 0; i  l-count; i++) {
-   struct sort_list_item *item;
-
-   item = l-list[i];
-
-   if (!(sort_opts_vals.uflag) ||
-   (last_printed_item == NULL) ||
-   list_coll(last_printed_item, item)) {
-   bwsfwrite(item-str, f,
+   if (!(sort_opts_vals.uflag)) {
+   for (i = 0; i  l-count; ++i)
+   bwsfwrite(l-list[i]-str, f,
sort_opts_vals.zflag);
-   if (sort_opts_vals.uflag)
+   } else {
+   struct sort_list_item *last_printed_item = NULL;
+   struct sort_list_item *item;
+   for (i = 0; i  l-count; ++i) {
+   item = l-list[i];
+   if ((last_printed_item == NULL) ||
+   list_coll(last_printed_item, 
item)) {
+   bwsfwrite(item-str, f, 
sort_opts_vals.zflag);
last_printed_item = item;
+   }
}
}
}
@@ -657,7 +657,7 @@ file_reader_init(const char *fsrc)
 
ret-fname = sort_strdup(fsrc);
 
-   if (strcmp(fsrc, -)  (compress_program == NULL)) {
+   if (strcmp(fsrc, -)  (compress_program == NULL)  use_mmap) {
 
do {
struct stat stat_buf;
@@ -1539,7 +1539,9 @@ mt_sort(struct sort_list *list,
 const char* fn)
 {
 #if defined(SORT_THREADS)
-   if (nthreads  2 || list-count  nthreads) {
+   if (nthreads  2 || list-count  MT_SORT_THRESHOLD) {
+   size_t nthreads_save = nthreads;
+   nthreads = 1;
 #endif
/* if single thread or small data, do simple sort */
sort_func(list-list, list-count,
@@ -1547,6 +1549,7 @@ mt_sort(struct sort_list *list,
(int(*)(const void *, const void *)) list_coll);
sort_list_dump(list, fn);
 #if defined(SORT_THREADS)
+   nthreads = nthreads_save;
} else {
/* multi-threaded sort */
struct sort_list **parts;
@@ -1590,7 +1593,18 @@ mt_sort(struct sort_list *list,
pthread_attr_init(attr);

Re: svn commit: r235918 - head/sys/geom/label

2012-05-25 Thread Edward Tomasz Napierała

Wiadomość napisana przez Andriy Gapon w dniu 25 maj 2012, o godz. 09:20:

 on 24/05/2012 19:48 Edward Tomasz Napierala said the following:
 Author: trasz
 Date: Thu May 24 16:48:33 2012
 New Revision: 235918
 URL: http://svn.freebsd.org/changeset/base/235918
 
 Log:
  Make g_label(4) ignore provider size when looking for UFS labels.
  Without it, it fails to create labels for filesystems resized by
  growfs(8).
 
  PR: kern/165962
  Submitted by:   Olivier Cochard-Labbe olivier at cochard dot me
 
 Was this change discussed somewhere?  Reviewed even?
 
 I was once curious why the size check was there and there was a very valid
 reason to have it:
 http://lists.freebsd.org/pipermail/freebsd-geom/2009-April/003473.html
 Has anything changed?

Nope, I just didn't investigate it enough.  I'm testing a fix by Jung-uk Kim;
if it works, I'll commit it, otherwise I'll revert it.  In any case, I'll
add a comment describing why it's there.  Sorry for the breakage.

-- 
If you cut off my head, what would I say?  Me and my head, or me and my body?

___
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: r235988 - in head/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common i386/boot2 i386/gptboot pc98/boot2 powerpc/boot1.chrp sparc64/boot1

2012-05-25 Thread Gleb Kurtsou
Author: gleb
Date: Fri May 25 09:36:39 2012
New Revision: 235988
URL: http://svn.freebsd.org/changeset/base/235988

Log:
  Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent
  unnecessary 64-bit math on 32-bit machines.
  
  Sponsored by: Google Summer of Code 2011

Modified:
  head/sys/boot/arm/at91/boot2/boot2.c
  head/sys/boot/arm/ixp425/boot2/boot2.c
  head/sys/boot/common/ufsread.c
  head/sys/boot/i386/boot2/boot2.c
  head/sys/boot/i386/gptboot/gptboot.c
  head/sys/boot/pc98/boot2/boot2.c
  head/sys/boot/powerpc/boot1.chrp/boot1.c
  head/sys/boot/sparc64/boot1/boot1.c

Modified: head/sys/boot/arm/at91/boot2/boot2.c
==
--- head/sys/boot/arm/at91/boot2/boot2.cFri May 25 09:30:16 2012
(r235987)
+++ head/sys/boot/arm/at91/boot2/boot2.cFri May 25 09:36:39 2012
(r235988)
@@ -95,7 +95,6 @@ static uint8_t dsk_meta;
 
 static void load(void);
 static int parse(void);
-static int xfsread(ino_t, void *, size_t);
 static int dskread(void *, unsigned, unsigned);
 #ifdef FIXUP_BOOT_DRV
 static void fixup_boot_drv(caddr_t, int, int, int);
@@ -111,7 +110,7 @@ static void fixup_boot_drv(caddr_t, int,
 #endif
 
 static inline int
-xfsread(ino_t inode, void *buf, size_t nbyte)
+xfsread(ufs_ino_t inode, void *buf, size_t nbyte)
 {
if ((size_t)fsread(inode, buf, nbyte) != nbyte)
return -1;
@@ -154,7 +153,7 @@ int
 main(void)
 {
int autoboot, c = 0;
-   ino_t ino;
+   ufs_ino_t ino;
 
dmadat = (void *)(0x2000 + (16  20));
board_init();
@@ -199,7 +198,7 @@ load(void)
Elf32_Ehdr eh;
static Elf32_Phdr ep[2];
caddr_t p;
-   ino_t ino;
+   ufs_ino_t ino;
uint32_t addr;
int i, j;
 #ifdef FIXUP_BOOT_DRV

Modified: head/sys/boot/arm/ixp425/boot2/boot2.c
==
--- head/sys/boot/arm/ixp425/boot2/boot2.c  Fri May 25 09:30:16 2012
(r235987)
+++ head/sys/boot/arm/ixp425/boot2/boot2.c  Fri May 25 09:36:39 2012
(r235988)
@@ -98,7 +98,6 @@ static int disk_layout;
 
 static void load(void);
 static int parse(void);
-static int xfsread(ino_t, void *, size_t);
 static int dskread(void *, unsigned, unsigned);
 static int drvread(void *, unsigned, unsigned);
 #ifdef FIXUP_BOOT_DRV
@@ -114,7 +113,7 @@ static void fixup_boot_drv(caddr_t, int,
 #endif
 
 static inline int
-xfsread(ino_t inode, void *buf, size_t nbyte)
+xfsread(ufs_ino_t inode, void *buf, size_t nbyte)
 {
if ((size_t)fsread(inode, buf, nbyte) != nbyte)
return -1;
@@ -158,7 +157,7 @@ main(void)
 {
const char *bt;
int autoboot, c = 0;
-   ino_t ino;
+   ufs_ino_t ino;
 
dmadat = (void *)(0x1c);
p_memset((char *)dmadat, 0, 32 * 1024);
@@ -207,7 +206,7 @@ load(void)
Elf32_Ehdr eh;
static Elf32_Phdr ep[2];
caddr_t p;
-   ino_t ino;
+   ufs_ino_t ino;
uint32_t addr;
int i, j;
 #ifdef FIXUP_BOOT_DRV

Modified: head/sys/boot/common/ufsread.c
==
--- head/sys/boot/common/ufsread.c  Fri May 25 09:30:16 2012
(r235987)
+++ head/sys/boot/common/ufsread.c  Fri May 25 09:36:39 2012
(r235988)
@@ -58,6 +58,8 @@ __FBSDID($FreeBSD$);
 #define cgbase(fs, c)   ((ufs2_daddr_t)((fs)-fs_fpg * (c)))
 #endif
 
+typedefuint32_tufs_ino_t;
+
 /*
  * We use 4k `virtual' blocks for filesystem data, whatever the actual
  * filesystem block size. FFS blocks are always a multiple of 4k.
@@ -85,14 +87,14 @@ struct dmadat {
 };
 static struct dmadat *dmadat;
 
-static ino_t lookup(const char *);
-static ssize_t fsread(ino_t, void *, size_t);
+static ufs_ino_t lookup(const char *);
+static ssize_t fsread(ufs_ino_t, void *, size_t);
 
 static uint8_t ls, dsk_meta;
 static uint32_t fs_off;
 
 static __inline uint8_t
-fsfind(const char *name, ino_t * ino)
+fsfind(const char *name, ufs_ino_t * ino)
 {
static char buf[DEV_BSIZE];
struct direct *d;
@@ -116,12 +118,12 @@ fsfind(const char *name, ino_t * ino)
return 0;
 }
 
-static ino_t
+static ufs_ino_t
 lookup(const char *path)
 {
static char name[MAXNAMLEN + 1];
const char *s;
-   ino_t ino;
+   ufs_ino_t ino;
ssize_t n;
uint8_t dt;
 
@@ -163,7 +165,7 @@ static int sblock_try[] = SBLOCKSEARCH;
 #endif
 
 static ssize_t
-fsread(ino_t inode, void *buf, size_t nbyte)
+fsread(ufs_ino_t inode, void *buf, size_t nbyte)
 {
 #ifndef UFS2_ONLY
static struct ufs1_dinode dp1;
@@ -173,7 +175,7 @@ fsread(ino_t inode, void *buf, size_t nb
static struct ufs2_dinode dp2;
 #endif
static struct fs fs;
-   static ino_t inomap;
+   static ufs_ino_t inomap;
char *blkbuf;
void *indbuf;
char *s;

Modified: 

svn commit: r235989 - head/sys/geom/label

2012-05-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri May 25 10:08:48 2012
New Revision: 235989
URL: http://svn.freebsd.org/changeset/base/235989

Log:
  Revert r235918 for now and add comment explaining the reason for the
  size check.

Modified:
  head/sys/geom/label/g_label_ufs.c

Modified: head/sys/geom/label/g_label_ufs.c
==
--- head/sys/geom/label/g_label_ufs.c   Fri May 25 09:36:39 2012
(r235988)
+++ head/sys/geom/label/g_label_ufs.c   Fri May 25 10:08:48 2012
(r235989)
@@ -81,10 +81,16 @@ g_label_ufs_taste_common(struct g_consum
fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE, NULL);
if (fs == NULL)
continue;
-   /* Check for magic */
-   if (fs-fs_magic == FS_UFS1_MAGIC  fs-fs_fsize  0) {
+   /* Check for magic. We also need to check if file system size 
is equal
+* to providers size, because sysinstall(8) used to bogusly put 
first
+* partition at offset 0 instead of 16, and glabel/ufs would 
find file
+* system on slice instead of partition.
+*/
+   if (fs-fs_magic == FS_UFS1_MAGIC  fs-fs_fsize  0 
+   pp-mediasize / fs-fs_fsize == fs-fs_old_size) {
/* Valid UFS1. */
-   } else if (fs-fs_magic == FS_UFS2_MAGIC  fs-fs_fsize  0) {
+   } else if (fs-fs_magic == FS_UFS2_MAGIC  fs-fs_fsize  0 
+   pp-mediasize / fs-fs_fsize == fs-fs_size) {
/* Valid UFS2. */
} else {
g_free(fs);
___
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: r235859 - in head/sys: i386/conf modules

2012-05-25 Thread Konstantin Belousov
On Fri, May 25, 2012 at 10:32:12AM +0200, Niclas Zeising wrote:
 Hi!
 Would it be possible to bump the FreeBSD version to reflect this commit?
  It would be helpful when working with the xorg ports, amongst other things.
 Thanks!
 Regards!
 -- 
There is absolutely no use for version bump. Port builds (libdrm, mesa
and ddx) do not depend on any base system headers or libraries. They
come with private copies of the ABI headers.


pgpfpuE1xz9yC.pgp
Description: PGP signature


svn commit: r235990 - head/sys/netinet

2012-05-25 Thread Michael Tuexen
Author: tuexen
Date: Fri May 25 11:14:08 2012
New Revision: 235990
URL: http://svn.freebsd.org/changeset/base/235990

Log:
  Undefine SCTP_PACKED before including sctp_uio.h, which doesn't
  use it. Spotted by Irene Ruengeler.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp.h

Modified: head/sys/netinet/sctp.h
==
--- head/sys/netinet/sctp.h Fri May 25 10:08:48 2012(r235989)
+++ head/sys/netinet/sctp.h Fri May 25 11:14:08 2012(r235990)
@@ -556,6 +556,8 @@ struct sctp_error_unrecognized_chunk {
 #define SCTP_SMALLEST_PMTU 512 /* smallest pmtu allowed when disabling PMTU
 * discovery */
 
+#undef SCTP_PACKED
+
 #include netinet/sctp_uio.h
 
 /* This dictates the size of the packet
@@ -607,7 +609,4 @@ struct sctp_error_unrecognized_chunk {
 #define SCTP_LOG_AT_SEND_2_OUTQ0x0800
 #define SCTP_LOG_TRY_ADVANCE   0x1000
 
-
-#undef SCTP_PACKED
-
 #endif /* !_NETINET_SCTP_H_ */
___
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: r235994 - head/sys/sparc64/conf

2012-05-25 Thread Marius Strobl
Author: marius
Date: Fri May 25 14:52:05 2012
New Revision: 235994
URL: http://svn.freebsd.org/changeset/base/235994

Log:
  Merge from x86: r232521
  
  Exclude USB drivers (except umass and ukbd) from main kernel image.

Modified:
  head/sys/sparc64/conf/GENERIC

Modified: head/sys/sparc64/conf/GENERIC
==
--- head/sys/sparc64/conf/GENERIC   Fri May 25 14:49:51 2012
(r235993)
+++ head/sys/sparc64/conf/GENERIC   Fri May 25 14:52:05 2012
(r235994)
@@ -234,35 +234,8 @@ device uhci# UHCI PCI-USB 
interface
 device ohci# OHCI PCI-USB interface
 device ehci# EHCI PCI-USB interface (USB 2.0)
 device usb # USB Bus (required)
-#deviceudbp# USB Double Bulk Pipe devices (needs 
netgraph)
-device uhid# Human Interface Devices
 device ukbd# Keyboard
-device ulpt# Printer
 device umass   # Disks/Mass storage - Requires scbus and da
-device ums # Mouse
-device urio# Diamond Rio 500 MP3 player
-# USB Serial devices
-device uark# Technologies ARK3116 based serial adapters
-device ubsa# Belkin F5U103 and compatible serial adapters
-device uftdi   # For FTDI usb serial adapters
-device uipaq   # Some WinCE based devices
-device uplcom  # Prolific PL-2303 serial adapters
-device uslcom  # SI Labs CP2101/CP2102 serial adapters
-device uvisor  # Visor and Palm devices
-device uvscom  # USB serial support for DDI pocket's PHS
-# USB Ethernet, requires miibus
-device aue # ADMtek USB Ethernet
-device axe # ASIX Electronics USB Ethernet
-device cdce# Generic USB over Ethernet
-device cue # CATC USB Ethernet
-device kue # Kawasaki LSI USB Ethernet
-device rue # RealTek RTL8150 USB Ethernet
-device udav# Davicom DM9601E USB
-# USB Wireless
-device rum # Ralink Technology RT2501USB wireless NICs
-device uath# Atheros AR5523 wireless NICs
-device ural# Ralink Technology RT2500USB wireless NICs
-device zyd # ZyDAS zd1211/zd1211b wireless NICs
 
 # FireWire support
 device firewire# FireWire bus code
@@ -278,4 +251,3 @@ device  sound   # Generic sound driver 
(r
 device snd_audiocs # Crystal Semiconductor CS4231
 device snd_es137x  # Ensoniq AudioPCI ES137x
 device snd_t4dwave # Acer Labs M5451
-device snd_uaudio  # USB Audio
___
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: r235999 - head/sys/dev/mii

2012-05-25 Thread Rafal Jaworowski
Author: raj
Date: Fri May 25 15:05:17 2012
New Revision: 235999
URL: http://svn.freebsd.org/changeset/base/235999

Log:
  More Cicada/Vitesse PHY ids.
  
  Obtained from:Semihalf

Modified:
  head/sys/dev/mii/ciphy.c
  head/sys/dev/mii/miidevs

Modified: head/sys/dev/mii/ciphy.c
==
--- head/sys/dev/mii/ciphy.cFri May 25 14:57:02 2012(r235998)
+++ head/sys/dev/mii/ciphy.cFri May 25 15:05:17 2012(r235999)
@@ -91,8 +91,10 @@ static const struct mii_phydesc ciphys[]
MII_PHY_DESC(xxCICADA, CS8201B),
MII_PHY_DESC(xxCICADA, CS8204),
MII_PHY_DESC(xxCICADA, VSC8211),
+   MII_PHY_DESC(xxCICADA, VSC8221),
MII_PHY_DESC(xxCICADA, CS8244),
MII_PHY_DESC(xxVITESSE, VSC8601),
+   MII_PHY_DESC(xxVITESSE, VSC8641),
MII_PHY_END
 };
 
@@ -368,8 +370,10 @@ ciphy_fixup(struct mii_softc *sc)
 
break;
case MII_MODEL_xxCICADA_VSC8211:
+   case MII_MODEL_xxCICADA_VSC8221:
case MII_MODEL_xxCICADA_CS8244:
case MII_MODEL_xxVITESSE_VSC8601:
+   case MII_MODEL_xxVITESSE_VSC8641:
break;
default:
device_printf(sc-mii_dev, unknown CICADA PHY model %x\n,

Modified: head/sys/dev/mii/miidevs
==
--- head/sys/dev/mii/miidevsFri May 25 14:57:02 2012(r235998)
+++ head/sys/dev/mii/miidevsFri May 25 15:05:17 2012(r235999)
@@ -52,7 +52,7 @@ oui AMD   0x1a
Advanced Micro Devic
 oui BROADCOM   0x001018Broadcom Corporation
 oui BROADCOM2  0x000af7Broadcom Corporation
 oui BROADCOM3  0x001be9Broadcom Corporation
-oui CICADA 0x0003F1Cicada Semiconductor
+oui CICADA 0x0003f1Cicada Semiconductor
 oui DAVICOM0x00606eDavicom Semiconductor
 oui ENABLESEMI 0x0010ddEnable Semiconductor
 oui ICPLUS 0x0090c3IC Plus Corp.
@@ -71,6 +71,7 @@ oui SEEQ  0x00a07dSeeq Technology
 oui SIS0x00e006Silicon Integrated 
Systems
 oui TI 0x080028Texas Instruments
 oui TSC0x00c039TDK Semiconductor
+oui VITESSE0x0001c1Vitesse Semiconductor
 oui XAQTI  0x00e0aeXaQti Corp.
 
 /* Some Intel 82553's use an alternative OUI. */
@@ -190,6 +191,7 @@ model xxBROADCOM_ALT1 BCM5906   0x0004 BCM
 model xxCICADA CS8201  0x0001 Cicada CS8201 10/100/1000TX PHY
 model xxCICADA CS8204  0x0004 Cicada CS8204 10/100/1000TX PHY
 model xxCICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY
+model xxCICADA VSC8221 0x0015 Cicada CS8201 10/100/1000TX PHY
 model xxCICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY
 model xxCICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY
 model xxCICADA CS8244  0x002c Cicada CS8244 10/100/1000TX PHY
@@ -318,5 +320,8 @@ model TI TNETE2101  0x0003 TNETE2101 med
 model xxTSC 78Q21200x0014 78Q2120 10/100 media interface
 model xxTSC 78Q21210x0015 78Q2121 100BASE-TX media interface
 
+/* Vitesse Semiconductor */
+model xxVITESSE VSC86410x0003 Vitesse VSC8641 10/100/1000TX PHY
+
 /* XaQti Corp. PHYs */
 model xxXAQTI XMACII   0x XaQti Corp. XMAC II gigabit interface
___
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: r236000 - head/sys/powerpc/powerpc

2012-05-25 Thread Rafal Jaworowski
Author: raj
Date: Fri May 25 15:13:55 2012
New Revision: 236000
URL: http://svn.freebsd.org/changeset/base/236000

Log:
  Missing vm_paddr_t bits which should have been part of r235936.

Modified:
  head/sys/powerpc/powerpc/mmu_if.m

Modified: head/sys/powerpc/powerpc/mmu_if.m
==
--- head/sys/powerpc/powerpc/mmu_if.m   Fri May 25 15:05:17 2012
(r235999)
+++ head/sys/powerpc/powerpc/mmu_if.m   Fri May 25 15:13:55 2012
(r236000)
@@ -761,7 +761,7 @@ METHOD void cpu_bootstrap {
  */
 METHOD void * mapdev {
mmu_t   _mmu;
-   vm_offset_t _pa;
+   vm_paddr_t  _pa;
vm_size_t   _size;
 };
 
@@ -818,7 +818,7 @@ METHOD void unmapdev {
  *
  * @retval pa  physical address corresponding to mapping
  */
-METHOD vm_offset_t kextract {
+METHOD vm_paddr_t kextract {
mmu_t   _mmu;
vm_offset_t _va;
 };
@@ -833,7 +833,7 @@ METHOD vm_offset_t kextract {
 METHOD void kenter {
mmu_t   _mmu;
vm_offset_t _va;
-   vm_offset_t _pa;
+   vm_paddr_t  _pa;
 };
 
 /**
@@ -860,7 +860,7 @@ METHOD void kenter_attr {
  */
 METHOD boolean_t dev_direct_mapped {
mmu_t   _mmu;
-   vm_offset_t _pa;
+   vm_paddr_t  _pa;
vm_size_t   _size;
 };
 
___
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: r236000 - head/sys/powerpc/powerpc

2012-05-25 Thread Nathan Whitehorn

On 05/25/12 10:13, Rafal Jaworowski wrote:

Author: raj
Date: Fri May 25 15:13:55 2012
New Revision: 236000
URL: http://svn.freebsd.org/changeset/base/236000

Log:
   Missing vm_paddr_t bits which should have been part of r235936.


I think you also need equivalent changes to aim/mmu_oea64.c.
-Nathan


Modified:
   head/sys/powerpc/powerpc/mmu_if.m

Modified: head/sys/powerpc/powerpc/mmu_if.m
==
--- head/sys/powerpc/powerpc/mmu_if.m   Fri May 25 15:05:17 2012
(r235999)
+++ head/sys/powerpc/powerpc/mmu_if.m   Fri May 25 15:13:55 2012
(r236000)
@@ -761,7 +761,7 @@ METHOD void cpu_bootstrap {
   */
  METHOD void * mapdev {
mmu_t   _mmu;
-   vm_offset_t _pa;
+   vm_paddr_t  _pa;
vm_size_t   _size;
  };

@@ -818,7 +818,7 @@ METHOD void unmapdev {
   *
   * @retval pa physical address corresponding to mapping
   */
-METHOD vm_offset_t kextract {
+METHOD vm_paddr_t kextract {
mmu_t   _mmu;
vm_offset_t _va;
  };
@@ -833,7 +833,7 @@ METHOD vm_offset_t kextract {
  METHOD void kenter {
mmu_t   _mmu;
vm_offset_t _va;
-   vm_offset_t _pa;
+   vm_paddr_t  _pa;
  };

  /**
@@ -860,7 +860,7 @@ METHOD void kenter_attr {
   */
  METHOD boolean_t dev_direct_mapped {
mmu_t   _mmu;
-   vm_offset_t _pa;
+   vm_paddr_t  _pa;
vm_size_t   _size;
  };



___
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: r236006 - head/lib/libc/powerpc

2012-05-25 Thread Marcel Moolenaar
Author: marcel
Date: Fri May 25 16:30:42 2012
New Revision: 236006
URL: http://svn.freebsd.org/changeset/base/236006

Log:
  Doh... Don't add __eabi to an old version tag (i.e. FBSD_1.0). Add it to the
  current one (= FBSD_1.3).
  
  Pointed out by: kib

Modified:
  head/lib/libc/powerpc/Symbol.map

Modified: head/lib/libc/powerpc/Symbol.map
==
--- head/lib/libc/powerpc/Symbol.mapFri May 25 16:09:06 2012
(r236005)
+++ head/lib/libc/powerpc/Symbol.mapFri May 25 16:30:42 2012
(r236006)
@@ -11,7 +11,6 @@ FBSD_1.0 {
/* PSEUDO syscalls */
_exit;
 
-   __eabi;
_mcount;
_setjmp;
_longjmp;
@@ -39,6 +38,10 @@ FBSD_1.0 {
vfork;
 };
 
+FBSD_1.3 {
+   __eabi;
+};
+
 FBSDprivate_1.0 {
/* PSEUDO syscalls */
__sys_getlogin;
___
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: r236009 - head/sys/dev/ath/ath_hal/ar5416

2012-05-25 Thread Adrian Chadd
Author: adrian
Date: Fri May 25 16:45:56 2012
New Revision: 236009
URL: http://svn.freebsd.org/changeset/base/236009

Log:
  * According to the reference code, AR_WA_D3_L1_DISBABLE is bit 14.
  * Add some other WAR bits (very usefully described too) in preparation for
porting over some suspend/resume fixes from ath9k/Atheros.
  
  Obtained from:Qualcomm Atheros

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Fri May 25 16:40:31 2012
(r236008)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Fri May 25 16:45:56 2012
(r236009)
@@ -253,11 +253,15 @@
 #defineAR_MAC_LED_ASSOC_PEND   0x2 /* STA is trying to associate */
 #defineAR_MAC_LED_ASSOC_S  10
 
+#defineAR_WA_BIT6  0x0040
+#defineAR_WA_BIT7  0x0080
+#defineAR_WA_D3_L1_DISABLE 0x4000  /* */
 #defineAR_WA_UNTIE_RESET_EN0x8000  /* ena PCI reset to POR 
*/
 #defineAR_WA_RESET_EN  0x0004  /* ena 
AR_WA_UNTIE_RESET_EN */
 #defineAR_WA_ANALOG_SHIFT  0x0010
 #defineAR_WA_POR_SHORT 0x0020  /* PCIE phy reset 
control */
-#defineAR_WA_D3_L1_DISABLE 0x0080  /* bit 23 */
+#defineAR_WA_BIT22 0x0040
+#defineAR_WA_BIT23 0x0080
 
 #defineAR_WA_DEFAULT   0x073f
 #defineAR9280_WA_DEFAULT   0x0040073b  /* disable bit 2, see 
commit */
___
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: r236000 - head/sys/powerpc/powerpc

2012-05-25 Thread Rafal Jaworowski

On 2012-05-25, at 17:28, Nathan Whitehorn wrote:

 On 05/25/12 10:13, Rafal Jaworowski wrote:
 Author: raj
 Date: Fri May 25 15:13:55 2012
 New Revision: 236000
 URL: http://svn.freebsd.org/changeset/base/236000
 
 Log:
   Missing vm_paddr_t bits which should have been part of r235936.
 
 I think you also need equivalent changes to aim/mmu_oea64.c.

Yes, but the GENERIC64 build appears currently broken, so I could not compile 
test it.

Rafal

___
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: r236013 - head/cddl/contrib/opensolaris/cmd/zfs

2012-05-25 Thread Pawel Jakub Dawidek
Author: pjd
Date: Fri May 25 17:19:30 2012
New Revision: 236013
URL: http://svn.freebsd.org/changeset/base/236013

Log:
  Correct error message.
  
  MFC after:3 days

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cFri May 25 17:15:53 
2012(r236012)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cFri May 25 17:19:30 
2012(r236013)
@@ -3168,7 +3168,7 @@ zfs_do_rename(int argc, char **argv)
}
 
if (flags.nounmount  parents) {
-   (void) fprintf(stderr, gettext(-u and -r options are mutually 
+   (void) fprintf(stderr, gettext(-u and -p options are mutually 
exclusive\n));
usage(B_FALSE);
}
___
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: r236017 - head/sys/dev/ath/ath_hal/ar5416

2012-05-25 Thread Adrian Chadd
Author: adrian
Date: Fri May 25 17:53:57 2012
New Revision: 236017
URL: http://svn.freebsd.org/changeset/base/236017

Log:
  Add some AR5416/AR5418 WAR's for power-on and suspend/resume:
  
  * Now that ah_configPCIE is called for both power on and suspend/resume,
make sure the right bit(s) are cleared and set when suspending and
resuming.  Specifically:
  
+ force disable/enable the PCIe PHY upon suspend/resume;
+ reprogram the PCIe WAR register when resuming and upon power-on.
  
  * Add a recipe which powers down any PCIe PHY hardware inside the AR5416
(which is the PCI variant) to save on power.  I have (currently) no way
to test exactly how much power is saved, if any.
  
  Tested on:
  
  * AR5416 cardbus - although unfortunately pccard/cbb/cardbus currently
detaches the NIC upon suspend, I don't think it's a proper test case.
  
  * AR5418 PCIe attached to expresscard - since we're not doing PCIe APSM,
it's also not likely a full/good test case.
  
  In both instances I went through a handful of suspend/resume cycles and
  ensured that the STA vap reassociated correctly.
  
  TODO:
  
  * Setup a laptop to simply sit in a suspend/resume loop, making sure that
the NIC always correctly comes back;
  
  * Start doing suspend/resume tests with actual traffic going on in the
background, as I bet this process is all quite racy at the present;
  
  * Test adhoc/hostap mode, just to be completely sure it's working correctly;
  
  * See if I can jury rig an external power source to an AR5416 to test out
whether ah_disablePCIE() works.
  
  Obtained from:Qualcomm Atheros

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 17:50:50 
2012(r236016)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 17:53:57 
2012(r236017)
@@ -468,18 +468,63 @@ ar5416AttachPCIE(struct ath_hal *ah)
 static void
 ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off)
 {
-   if (AH_PRIVATE(ah)-ah_ispcie  !restore) {
+
+   /* This is only applicable for AR5418 (AR5416 PCIe) */
+   if (! AH_PRIVATE(ah)-ah_ispcie)
+   return;
+
+   if (! restore) {
ath_hal_ini_write(ah, AH5416(ah)-ah_ini_pcieserdes, 1, 0);
OS_DELAY(1000);
-   OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA);
+   }
+
+   if (power_off) {/* Power-off */
+   /* clear bit 19 to disable L1 */
+   OS_REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA);
+   } else {/* Power-on */
+   /* Set default WAR values for Owl */
OS_REG_WRITE(ah, AR_WA, AR_WA_DEFAULT);
+
+   /* set bit 19 to allow forcing of pcie core into L1 state */
+   OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA);
}
 }
 
+/*
+ * Disable PCIe PHY if PCIe isn't used.
+ */
 static void
 ar5416DisablePCIE(struct ath_hal *ah)
 {
-   /* XXX TODO */
+
+   /* PCIe? Don't */
+   if (AH_PRIVATE(ah)-ah_ispcie)
+   return;
+
+   /* .. Only applicable for AR5416v2 or later */
+   if (! (AR_SREV_OWL(ah)  AR_SREV_OWL_20_OR_LATER(ah)))
+   return;
+
+   OS_REG_WRITE_BUFFER_ENABLE(ah);
+
+   /*
+* Disable the PCIe PHY.
+*/
+   OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00);
+   OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924);
+   OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x2829);
+   OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x57160824);
+   OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x25980579);
+   OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x);
+   OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x1aaabe40);
+   OS_REG_WRITE(ah, AR_PCIE_SERDES, 0xbe105554);
+   OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x000e1007);
+
+   /* Load the new settings */
+   OS_REG_WRITE(ah, AR_PCIE_SERDES2, 0x);
+
+   OS_REG_WRITE_BUFFER_FLUSH(ah);
+   OS_REG_WRITE_BUFFER_DISABLE(ah);
 }
 
 static void
___
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: r236000 - head/sys/powerpc/powerpc

2012-05-25 Thread Rafal Jaworowski

On 2012-05-25, at 19:06, Rafal Jaworowski wrote:

 
 On 2012-05-25, at 17:28, Nathan Whitehorn wrote:
 
 On 05/25/12 10:13, Rafal Jaworowski wrote:
 Author: raj
 Date: Fri May 25 15:13:55 2012
 New Revision: 236000
 URL: http://svn.freebsd.org/changeset/base/236000
 
 Log:
  Missing vm_paddr_t bits which should have been part of r235936.
 
 I think you also need equivalent changes to aim/mmu_oea64.c.
 
 Yes, but the GENERIC64 build appears currently broken, so I could not compile 
 test it.

Sorry for the noise, I had some old powerpc64 build env locally, the build is 
fine. I'll commit the vm_paddr_t fix shortly.

Rafal

___
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: r236019 - head/sys/powerpc/aim

2012-05-25 Thread Rafal Jaworowski
Author: raj
Date: Fri May 25 18:17:26 2012
New Revision: 236019
URL: http://svn.freebsd.org/changeset/base/236019

Log:
  Fix physical address type to vm_paddr_t also for powerpc64.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cFri May 25 17:56:27 2012
(r236018)
+++ head/sys/powerpc/aim/mmu_oea64.cFri May 25 18:17:26 2012
(r236019)
@@ -306,7 +306,7 @@ boolean_t moea64_is_modified(mmu_t, vm_p
 boolean_t moea64_is_prefaultable(mmu_t, pmap_t, vm_offset_t);
 boolean_t moea64_is_referenced(mmu_t, vm_page_t);
 boolean_t moea64_ts_referenced(mmu_t, vm_page_t);
-vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int);
+vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int);
 boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t);
 int moea64_page_wired_mappings(mmu_t, vm_page_t);
 void moea64_pinit(mmu_t, pmap_t);
@@ -324,14 +324,14 @@ void moea64_zero_page_area(mmu_t, vm_pag
 void moea64_zero_page_idle(mmu_t, vm_page_t);
 void moea64_activate(mmu_t, struct thread *);
 void moea64_deactivate(mmu_t, struct thread *);
-void *moea64_mapdev(mmu_t, vm_offset_t, vm_size_t);
+void *moea64_mapdev(mmu_t, vm_paddr_t, vm_size_t);
 void *moea64_mapdev_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t);
 void moea64_unmapdev(mmu_t, vm_offset_t, vm_size_t);
-vm_offset_t moea64_kextract(mmu_t, vm_offset_t);
+vm_paddr_t moea64_kextract(mmu_t, vm_offset_t);
 void moea64_page_set_memattr(mmu_t, vm_page_t m, vm_memattr_t ma);
 void moea64_kenter_attr(mmu_t, vm_offset_t, vm_offset_t, vm_memattr_t ma);
-void moea64_kenter(mmu_t, vm_offset_t, vm_offset_t);
-boolean_t moea64_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t);
+void moea64_kenter(mmu_t, vm_offset_t, vm_paddr_t);
+boolean_t moea64_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t);
 static void moea64_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t);
 
 static mmu_method_t moea64_methods[] = {
@@ -1641,7 +1641,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_
 }
 
 void
-moea64_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa)
+moea64_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa)
 {
 
moea64_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT);
@@ -1651,7 +1651,7 @@ moea64_kenter(mmu_t mmu, vm_offset_t va,
  * Extract the physical page address associated with the given kernel virtual
  * address.
  */
-vm_offset_t
+vm_paddr_t
 moea64_kextract(mmu_t mmu, vm_offset_t va)
 {
struct  pvo_entry *pvo;
@@ -1692,8 +1692,8 @@ moea64_kremove(mmu_t mmu, vm_offset_t va
  * first usable address after the mapped region.
  */
 vm_offset_t
-moea64_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start,
-vm_offset_t pa_end, int prot)
+moea64_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start,
+vm_paddr_t pa_end, int prot)
 {
vm_offset_t sva, va;
 
@@ -2440,7 +2440,7 @@ moea64_clear_bit(mmu_t mmu, vm_page_t m,
 }
 
 boolean_t
-moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size)
+moea64_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size)
 {
struct pvo_entry *pvo, key;
vm_offset_t ppa;
@@ -2493,7 +2493,7 @@ moea64_mapdev_attr(mmu_t mmu, vm_offset_
 }
 
 void *
-moea64_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size)
+moea64_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size)
 {
 
return moea64_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT);
___
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: r235847 - in head/sys/modules/drm2: . drm2 i915kms

2012-05-25 Thread Cy Schubert
In message 201205231710.q4nhan9s085...@svn.freebsd.org, Konstantin 
Belousov w
rites:
 Author: kib
 Date: Wed May 23 17:10:22 2012
 New Revision: 235847
 URL: http://svn.freebsd.org/changeset/base/235847
 
 Log:
   The drm2 modules makefiles commit.
   Still not attached to the build.
   
   Sponsored by:   The FreeBSD Foundation
   MFC after:  1 month
 

Thank you.


-- 
Cheers,
Cy Schubert cy.schub...@komquats.com
FreeBSD UNIX:  c...@freebsd.org   Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
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: r236020 - head/sbin/init

2012-05-25 Thread Jilles Tjoelker
Author: jilles
Date: Fri May 25 19:45:01 2012
New Revision: 236020
URL: http://svn.freebsd.org/changeset/base/236020

Log:
  init: Remove unnecessary 2-second delay before calling reboot(2).

Modified:
  head/sbin/init/init.c

Modified: head/sbin/init/init.c
==
--- head/sbin/init/init.c   Fri May 25 18:17:26 2012(r236019)
+++ head/sbin/init/init.c   Fri May 25 19:45:01 2012(r236020)
@@ -646,8 +646,6 @@ single_user(void)
if (Reboot) {
/* Instead of going single user, let's reboot the machine */
sync();
-   alarm(2);
-   pause();
reboot(howto);
_exit(0);
}
___
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: r236023 - in head/sys: geom/part sys

2012-05-25 Thread Marcel Moolenaar
Author: marcel
Date: Fri May 25 20:33:34 2012
New Revision: 236023
URL: http://svn.freebsd.org/changeset/base/236023

Log:
  Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes.
  The gpart alias for these partition types is freebsd-nandfs.

Modified:
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part.h
  head/sys/geom/part/g_part_apm.c
  head/sys/geom/part/g_part_bsd.c
  head/sys/geom/part/g_part_gpt.c
  head/sys/geom/part/g_part_vtoc8.c
  head/sys/sys/apm.h
  head/sys/sys/disklabel.h
  head/sys/sys/gpt.h
  head/sys/sys/vtoc.h

Modified: head/sys/geom/part/g_part.c
==
--- head/sys/geom/part/g_part.c Fri May 25 19:57:01 2012(r236022)
+++ head/sys/geom/part/g_part.c Fri May 25 20:33:34 2012(r236023)
@@ -83,6 +83,7 @@ struct g_part_alias_list {
{ fat32, G_PART_ALIAS_MS_FAT32 },
{ freebsd, G_PART_ALIAS_FREEBSD },
{ freebsd-boot, G_PART_ALIAS_FREEBSD_BOOT },
+   { freebsd-nandfs, G_PART_ALIAS_FREEBSD_NANDFS },
{ freebsd-swap, G_PART_ALIAS_FREEBSD_SWAP },
{ freebsd-ufs, G_PART_ALIAS_FREEBSD_UFS },
{ freebsd-vinum, G_PART_ALIAS_FREEBSD_VINUM },

Modified: head/sys/geom/part/g_part.h
==
--- head/sys/geom/part/g_part.h Fri May 25 19:57:01 2012(r236022)
+++ head/sys/geom/part/g_part.h Fri May 25 20:33:34 2012(r236023)
@@ -46,6 +46,7 @@ enum g_part_alias {
G_PART_ALIAS_EFI,   /* A EFI system partition entry. */
G_PART_ALIAS_FREEBSD,   /* A BSD labeled partition entry. */
G_PART_ALIAS_FREEBSD_BOOT,  /* A FreeBSD boot partition entry. */
+   G_PART_ALIAS_FREEBSD_NANDFS,/* A FreeBSD nandfs partition entry. */
G_PART_ALIAS_FREEBSD_SWAP,  /* A swap partition entry. */
G_PART_ALIAS_FREEBSD_UFS,   /* A UFS/UFS2 file system entry. */
G_PART_ALIAS_FREEBSD_VINUM, /* A Vinum partition entry. */

Modified: head/sys/geom/part/g_part_apm.c
==
--- head/sys/geom/part/g_part_apm.c Fri May 25 19:57:01 2012
(r236022)
+++ head/sys/geom/part/g_part_apm.c Fri May 25 20:33:34 2012
(r236023)
@@ -159,6 +159,11 @@ apm_parse_type(const char *type, char *b
strcpy(buf, APM_ENT_TYPE_FREEBSD);
return (0);
}
+   alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS);
+   if (!strcasecmp(type, alias)) {
+   strcpy(buf, APM_ENT_TYPE_FREEBSD_NANDFS);
+   return (0);
+   }
alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP);
if (!strcasecmp(type, alias)) {
strcpy(buf, APM_ENT_TYPE_FREEBSD_SWAP);
@@ -485,6 +490,8 @@ g_part_apm_type(struct g_part_table *bas
return (g_part_alias_name(G_PART_ALIAS_APPLE_UFS));
if (!strcmp(type, APM_ENT_TYPE_FREEBSD))
return (g_part_alias_name(G_PART_ALIAS_FREEBSD));
+   if (!strcmp(type, APM_ENT_TYPE_FREEBSD_NANDFS))
+   return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS));
if (!strcmp(type, APM_ENT_TYPE_FREEBSD_SWAP))
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP));
if (!strcmp(type, APM_ENT_TYPE_FREEBSD_UFS))

Modified: head/sys/geom/part/g_part_bsd.c
==
--- head/sys/geom/part/g_part_bsd.c Fri May 25 19:57:01 2012
(r236022)
+++ head/sys/geom/part/g_part_bsd.c Fri May 25 20:33:34 2012
(r236023)
@@ -126,6 +126,11 @@ bsd_parse_type(const char *type, uint8_t
*fstype = (u_int)lt;
return (0);
}
+   alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS);
+   if (!strcasecmp(type, alias)) {
+   *fstype = FS_NANDFS;
+   return (0);
+   }
alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP);
if (!strcasecmp(type, alias)) {
*fstype = FS_SWAP;
@@ -450,6 +455,8 @@ g_part_bsd_type(struct g_part_table *bas
 
entry = (struct g_part_bsd_entry *)baseentry;
type = entry-part.p_fstype;
+   if (type == FS_NANDFS)
+   return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS));
if (type == FS_SWAP)
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP));
if (type == FS_BSDFFS)

Modified: head/sys/geom/part/g_part_gpt.c
==
--- head/sys/geom/part/g_part_gpt.c Fri May 25 19:57:01 2012
(r236022)
+++ head/sys/geom/part/g_part_gpt.c Fri May 25 20:33:34 2012
(r236023)
@@ -155,6 +155,7 @@ static struct uuid gpt_uuid_bios_boot = 
 static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI;
 static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD;
 

svn commit: r236024 - head/sys/boot/fdt/dts

2012-05-25 Thread Rafal Jaworowski
Author: raj
Date: Fri May 25 20:43:38 2012
New Revision: 236024
URL: http://svn.freebsd.org/changeset/base/236024

Log:
  Import DTS files for the upcoming DPAA QorIQ (PowerPC) support.
  
- P2041RDB
- P3041DS
- P5020DS
  
  Obtained from:Freescale

Added:
  head/sys/boot/fdt/dts/p2041rdb.dts   (contents, props changed)
  head/sys/boot/fdt/dts/p2041si.dtsi   (contents, props changed)
  head/sys/boot/fdt/dts/p3041si.dtsi   (contents, props changed)
  head/sys/boot/fdt/dts/p5020ds.dts   (contents, props changed)
  head/sys/boot/fdt/dts/p5020si.dtsi   (contents, props changed)
Modified:
  head/sys/boot/fdt/dts/p3041ds.dts

Added: head/sys/boot/fdt/dts/p2041rdb.dts
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/fdt/dts/p2041rdb.dts  Fri May 25 20:43:38 2012
(r236024)
@@ -0,0 +1,490 @@
+/*
+ * P2041RDB Device Tree Source
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Freescale Semiconductor nor the
+ *   names of its contributors may be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License (GPL) as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``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 Freescale Semiconductor 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/ p2041si.dtsi
+
+/ {
+   model = fsl,P2041RDB;
+   compatible = fsl,P2041RDB;
+   #address-cells = 2;
+   #size-cells = 2;
+   interrupt-parent = mpic;
+
+   aliases {
+   phy_rgmii_0 = phy_rgmii_0;
+   phy_rgmii_1 = phy_rgmii_1;
+   phy_sgmii_2 = phy_sgmii_2;
+   phy_sgmii_3 = phy_sgmii_3;
+   phy_sgmii_4 = phy_sgmii_4;
+   phy_sgmii_1c = phy_sgmii_1c;
+   phy_sgmii_1d = phy_sgmii_1d;
+   phy_sgmii_1e = phy_sgmii_1e;
+   phy_sgmii_1f = phy_sgmii_1f;
+   phy_xgmii_2 = phy_xgmii_2;
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x 0x 0x 0x8000;
+   };
+
+   dcsr: dcsr@f {
+   ranges = 0x 0xf 0x 0x01008000;
+   };
+
+   bman-portals@ff400 {
+   bman-portal@0 {
+   cpu-handle = cpu0;
+   };
+   bman-portal@4000 {
+   cpu-handle = cpu1;
+   };
+   bman-portal@8000 {
+   cpu-handle = cpu2;
+   };
+   bman-portal@c000 {
+   cpu-handle = cpu3;
+   };
+   bman-portal@1 {
+   };
+   bman-portal@14000 {
+   };
+   bman-portal@18000 {
+   };
+   bman-portal@1c000 {
+   };
+   bman-portal@2 {
+   };
+   bman-portal@24000 {
+   };
+
+   buffer-pool@0 {
+   compatible = fsl,p2041-bpool, fsl,bpool;
+   fsl,bpid = 0;
+   fsl,bpool-cfg = 0 0x100 0 1 0 0x100;
+   };
+   };
+
+   qman-portals@ff420 {
+   qportal0: qman-portal@0 {
+   cpu-handle = cpu0;
+   fsl,qman-pool-channels = qpool1 qpool2 qpool3
+ qpool4 qpool5 qpool6
+

svn commit: r236025 - head/sys/powerpc/include

2012-05-25 Thread Rafal Jaworowski
Author: raj
Date: Fri May 25 21:12:24 2012
New Revision: 236025
URL: http://svn.freebsd.org/changeset/base/236025

Log:
  Update HID defines for E500mc and E5500 CPU cores.
  
  Obtained from:Freescale, Semihalf

Modified:
  head/sys/powerpc/include/hid.h

Modified: head/sys/powerpc/include/hid.h
==
--- head/sys/powerpc/include/hid.h  Fri May 25 20:43:38 2012
(r236024)
+++ head/sys/powerpc/include/hid.h  Fri May 25 21:12:24 2012
(r236025)
@@ -78,6 +78,8 @@
 #define HID0_E500_SEL_TBCLK0x2000 /* Select Time Base clock */
 #define HID0_E500_MAS7UPDEN0x0080 /* Enable MAS7 update (e500v2) */
 
+#define HID0_E500MC_L2MMU_MHD  0x4000 /* L2MMU Multiple Hit Detection */
+
 #define HID0_BITMASK   \
 \20  \
 \040EMCP\037DBP\036EBA\035EBD\034BCLK\033EICE\032ECLK\031PAR \
@@ -105,6 +107,20 @@
 \027NAP\025DPM\023TG\022HANGDETECT\021NHR\020INORDER \
 \016TBCTRL\015TBEN\012CIABREN\011HDICEEN\001ENATTN   
 
+#define HID0_E500MC_BITMASK\
+\20  \
+\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7 \
+\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15   \
+\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23 \
+\010EN_MAS7_UPDATE\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI
+
+#define HID0_E5500_BITMASK \
+\20  \
+\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7 \
+\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15   \
+\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23 \
+\010b24\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI
+
 /*
  *  HID0 bit definitions per cpu model
  *
@@ -142,6 +158,40 @@
  *  30 -   -   -   NOPDST  NOPDST  NOPDST  NOPDST  -
  *  31 NOOPTI  -   NOOPTI  NOPTI   NOPTI   NOPTI   NOPTI   NOPTI
  *
+ * bit e500mc  e5500
+ *   0 EMCPEMCP
+ *   1 EN_L2MMU_MHDEN_L2MMU_MHD
+ *   2 -   -
+ *   3 -   -
+ *   4 -   -
+ *   5 -   -
+ *   6 -   -
+ *   7 -   -
+ *   8 -   -
+ *   9 -   -
+ *  10 -   -
+ *  11 -   -
+ *  12 -   -
+ *  13 -   -
+ *  14 -   -
+ *  15 -   -
+ *  16 -   -
+ *  17 -   -
+ *  18 -   -
+ *  19 -   -
+ *  20 -   -
+ *  21 -   -
+ *  22 -   -
+ *  23 -   -
+ *  24 EN_MAS7_UPDATE  -
+ *  25 DCFADCFA
+ *  26 -   -
+ *  27 CIGLSO  CIGLSO
+ *  28 -   -
+ *  29 -   -
+ *  30 -   -
+ *  31 NOPTI   NOPTI
+ *
  *  604: ECP = Enable cache parity checking
  *  604: SIE = Serial instruction execution disable
  * 7450: TBEN = Time Base Enable
@@ -160,6 +210,9 @@
 
 #define HID0_E500_DEFAULT_SET  (HID0_EMCP | HID0_E500_TBEN)
 #define HID1_E500_DEFAULT_SET  (HID1_E500_ABE | HID1_E500_ASTME)
+#define HID0_E500MC_DEFAULT_SET(HID0_EMCP | HID0_E500MC_L2MMU_MHD | \
+HID0_E500_MAS7UPDEN)
+#define HID0_E5500_DEFAULT_SET (HID0_EMCP | HID0_E500MC_L2MMU_MHD)
 
 #define HID5_970_DCBZ_SIZE_HI  0x0080UL/* dcbz does a 32-byte store */
 #define HID4_970_DISABLE_LG_PG 0x0004ULL   /* disables large pages */
___
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: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern

2012-05-25 Thread Ed Schouten
Author: ed
Date: Fri May 25 21:50:48 2012
New Revision: 236026
URL: http://svn.freebsd.org/changeset/base/236026

Log:
  Remove use of non-ISO-C integer types from system call tables.
  
  These files already use ISO-C-style integer types, so make them less
  inconsistent by preferring the standard types.

Modified:
  head/sys/amd64/linux32/syscalls.master
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master

Modified: head/sys/amd64/linux32/syscalls.master
==
--- head/sys/amd64/linux32/syscalls.master  Fri May 25 21:12:24 2012
(r236025)
+++ head/sys/amd64/linux32/syscalls.master  Fri May 25 21:50:48 2012
(r236026)
@@ -54,8 +54,8 @@
l_int mode); }
 9  AUE_LINKSTD { int linux_link(char *path, char *to); }
 10 AUE_UNLINK  STD { int linux_unlink(char *path); }
-11 AUE_EXECVE  STD { int linux_execve(char *path, u_int32_t *argp, 
\
-   u_int32_t *envp); }
+11 AUE_EXECVE  STD { int linux_execve(char *path, uint32_t *argp, \
+   uint32_t *envp); }
 12 AUE_CHDIR   STD { int linux_chdir(char *path); }
 13 AUE_NULLSTD { int linux_time(l_time_t *tm); }
 14 AUE_MKNOD   STD { int linux_mknod(char *path, l_int mode, \

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Fri May 25 21:12:24 2012
(r236025)
+++ head/sys/compat/freebsd32/syscalls.master   Fri May 25 21:50:48 2012
(r236026)
@@ -104,9 +104,9 @@
int flags); }
 28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, struct msghdr32 
*msg, \
int flags); }
-29 AUE_RECVFROMSTD { int freebsd32_recvfrom(int s, u_int32_t buf, \
-   u_int32_t len, int flags, u_int32_t from, \
-   u_int32_t fromlenaddr); }
+29 AUE_RECVFROMSTD { int freebsd32_recvfrom(int s, uint32_t buf, \
+   uint32_t len, int flags, uint32_t from, \
+   uint32_t fromlenaddr); }
 30 AUE_ACCEPT  NOPROTO { int accept(int s, caddr_t name, \
int *anamelen); }
 31 AUE_GETPEERNAME NOPROTO { int getpeername(int fdes, caddr_t asa, \
@@ -152,7 +152,7 @@
 58 AUE_READLINKNOPROTO { ssize_t readlink(char *path, char *buf, \
size_t count); }
 59 AUE_EXECVE  STD { int freebsd32_execve(char *fname, \
-   u_int32_t *argv, u_int32_t *envv); }
+   uint32_t *argv, uint32_t *envv); }
 60 AUE_UMASK   NOPROTO { int umask(int newmask); } umask \
umask_args int
 61 AUE_CHROOT  NOPROTO { int chroot(char *path); }
@@ -325,10 +325,10 @@
 172AUE_NULLUNIMPL  nosys
 173AUE_PREAD   COMPAT6 { ssize_t freebsd32_pread(int fd, void *buf, \
size_t nbyte, int pad, \
-   u_int32_t offset1, u_int32_t offset2); }
+   uint32_t offset1, uint32_t offset2); }
 174AUE_PWRITE  COMPAT6 { ssize_t freebsd32_pwrite(int fd, \
const void *buf, size_t nbyte, int pad, \
-   u_int32_t offset1, u_int32_t offset2); }
+   uint32_t offset1, uint32_t offset2); }
 175AUE_NULLUNIMPL  nosys
 176AUE_NTP_ADJTIME NOPROTO { int ntp_adjtime(struct timex *tp); }
 177AUE_NULLUNIMPL  sfork (BSD/OS 2.x)
@@ -363,21 +363,21 @@
char *buf, u_int count, int32_t *basep); }
 197AUE_MMAPCOMPAT6 { caddr_t freebsd32_mmap(caddr_t addr, \
size_t len, int prot, int flags, int fd, \
-   int pad, u_int32_t pos1, u_int32_t pos2); }
+   int pad, uint32_t pos1, uint32_t pos2); }
 198AUE_NULLNOPROTO { int nosys(void); } __syscall \
__syscall_args int
 199AUE_LSEEK   COMPAT6 { off_t freebsd32_lseek(int fd, int pad, \
-   u_int32_t offset1, u_int32_t offset2, \
+   uint32_t offset1, uint32_t offset2, \
int whence); }
 200AUE_TRUNCATECOMPAT6 { int freebsd32_truncate(char *path, \
-   int pad, u_int32_t length1, \
-   u_int32_t length2); }
+   int pad, 

svn commit: r236027 - in head/sys: amd64/linux32 compat/freebsd32 kern sys

2012-05-25 Thread Ed Schouten
Author: ed
Date: Fri May 25 21:52:57 2012
New Revision: 236027
URL: http://svn.freebsd.org/changeset/base/236027

Log:
  Regenerate system call tables.

Modified:
  head/sys/amd64/linux32/linux32_proto.h
  head/sys/amd64/linux32/linux32_syscall.h
  head/sys/amd64/linux32/linux32_syscalls.c
  head/sys/amd64/linux32/linux32_sysent.c
  head/sys/amd64/linux32/linux32_systrace_args.c
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/amd64/linux32/linux32_proto.h
==
--- head/sys/amd64/linux32/linux32_proto.h  Fri May 25 21:50:48 2012
(r236026)
+++ head/sys/amd64/linux32/linux32_proto.h  Fri May 25 21:52:57 2012
(r236027)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 
2012-04-16 23:16:18Z jkim 
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 
2012-05-25 21:50:48Z ed 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -60,8 +60,8 @@ struct linux_unlink_args {
 };
 struct linux_execve_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
-   char argp_l_[PADL_(u_int32_t *)]; u_int32_t * argp; char 
argp_r_[PADR_(u_int32_t *)];
-   char envp_l_[PADL_(u_int32_t *)]; u_int32_t * envp; char 
envp_r_[PADR_(u_int32_t *)];
+   char argp_l_[PADL_(uint32_t *)]; uint32_t * argp; char 
argp_r_[PADR_(uint32_t *)];
+   char envp_l_[PADL_(uint32_t *)]; uint32_t * envp; char 
envp_r_[PADR_(uint32_t *)];
 };
 struct linux_chdir_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];

Modified: head/sys/amd64/linux32/linux32_syscall.h
==
--- head/sys/amd64/linux32/linux32_syscall.hFri May 25 21:50:48 2012
(r236026)
+++ head/sys/amd64/linux32/linux32_syscall.hFri May 25 21:52:57 2012
(r236027)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 
2012-04-16 23:16:18Z jkim 
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 
2012-05-25 21:50:48Z ed 
  */
 
 #defineLINUX_SYS_exit  1

Modified: head/sys/amd64/linux32/linux32_syscalls.c
==
--- head/sys/amd64/linux32/linux32_syscalls.c   Fri May 25 21:50:48 2012
(r236026)
+++ head/sys/amd64/linux32/linux32_syscalls.c   Fri May 25 21:52:57 2012
(r236027)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 
2012-04-16 23:16:18Z jkim 
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 
2012-05-25 21:50:48Z ed 
  */
 
 const char *linux_syscallnames[] = {

Modified: head/sys/amd64/linux32/linux32_sysent.c
==
--- head/sys/amd64/linux32/linux32_sysent.c Fri May 25 21:50:48 2012
(r236026)
+++ head/sys/amd64/linux32/linux32_sysent.c Fri May 25 21:52:57 2012
(r236027)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 
2012-04-16 23:16:18Z jkim 
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 
2012-05-25 21:50:48Z ed 
  */
 
 #include opt_compat.h

Modified: head/sys/amd64/linux32/linux32_systrace_args.c
==
--- head/sys/amd64/linux32/linux32_systrace_args.c  Fri May 25 21:50:48 
2012(r236026)
+++ head/sys/amd64/linux32/linux32_systrace_args.c  Fri May 25 21:52:57 
2012(r236027)
@@ -94,8 +94,8 @@ systrace_args(int sysnum, void *params, 
case 11: {
struct linux_execve_args *p = params;
uarg[0] = (intptr_t) p-path; /* char * */
-   uarg[1] = (intptr_t) p-argp; /* u_int32_t * */
-   uarg[2] = (intptr_t) p-envp; /* u_int32_t * */
+   uarg[1] = (intptr_t) p-argp; /* uint32_t * */
+   uarg[2] = (intptr_t) p-envp; /* uint32_t * */
*n_args = 3;
break;
}
@@ -2401,10 +2401,10 @@ systrace_entry_setargdesc(int sysnum, in
p = char *;
break;
case 1:
-

svn commit: r236028 - head/lib/libkiconv

2012-05-25 Thread Gabor Kovesdan
Author: gabor
Date: Fri May 25 22:07:13 2012
New Revision: 236028
URL: http://svn.freebsd.org/changeset/base/236028

Log:
  - Add support for BSD iconv when it is build into libc
  
  PR:   bin/162670
  Submitted by: Jan Beich jbe...@tormail.net
  MFC after:2 weeks

Modified:
  head/lib/libkiconv/Makefile
  head/lib/libkiconv/xlat16_iconv.c

Modified: head/lib/libkiconv/Makefile
==
--- head/lib/libkiconv/Makefile Fri May 25 21:52:57 2012(r236027)
+++ head/lib/libkiconv/Makefile Fri May 25 22:07:13 2012(r236028)
@@ -17,4 +17,8 @@ CFLAGS+=  -I${.CURDIR}/../../sys
 
 WARNS?=1
 
+.if !defined(MK_ICONV)
+CFLAGS+=   -DICONV_DLOPEN
+.endif
+
 .include bsd.lib.mk

Modified: head/lib/libkiconv/xlat16_iconv.c
==
--- head/lib/libkiconv/xlat16_iconv.c   Fri May 25 21:52:57 2012
(r236027)
+++ head/lib/libkiconv/xlat16_iconv.c   Fri May 25 22:07:13 2012
(r236028)
@@ -60,10 +60,18 @@ struct xlat16_table {
 static struct xlat16_table kiconv_xlat16_open(const char *, const char *, int);
 static int chklocale(int, const char *);
 
+#ifdef ICONV_DLOPEN
 static int my_iconv_init(void);
 static iconv_t (*my_iconv_open)(const char *, const char *);
 static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *);
 static int (*my_iconv_close)(iconv_t);
+#else
+#include iconv.h
+#define my_iconv_init() 0
+#define my_iconv_open iconv_open
+#define my_iconv iconv
+#define my_iconv_close iconv_close
+#endif
 static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, 
size_t *);
 
 int
@@ -310,6 +318,7 @@ chklocale(int category, const char *code
return (error);
 }
 
+#ifdef ICONV_DLOPEN
 static int
 my_iconv_init(void)
 {
@@ -327,6 +336,7 @@ my_iconv_init(void)
 
return (0);
 }
+#endif
 
 static size_t
 my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf,
___
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: r236036 - head/sys/dev/ath

2012-05-25 Thread Adrian Chadd
Author: adrian
Date: Sat May 26 01:34:36 2012
New Revision: 236036
URL: http://svn.freebsd.org/changeset/base/236036

Log:
  Remove an unneeded field from ath_buf.

Modified:
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_athvar.h
==
--- head/sys/dev/ath/if_athvar.hSat May 26 01:33:07 2012
(r236035)
+++ head/sys/dev/ath/if_athvar.hSat May 26 01:34:36 2012
(r236036)
@@ -238,7 +238,6 @@ struct ath_buf {
int bfs_txpower;/* tx power */
int bfs_txantenna;  /* TX antenna config */
enum ieee80211_protmode bfs_protmode;
-   HAL_11N_RATE_SERIES bfs_rc11n[ATH_RC_NUM];  /* 11n TX 
series */
int bfs_ctsrate;/* CTS rate */
int bfs_ctsduration;/* CTS duration (pre-11n NICs) */
struct ath_rc_series bfs_rc[ATH_RC_NUM];/* non-11n TX 
series */
___
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: r236038 - head/sys/dev/ath

2012-05-25 Thread Adrian Chadd
Author: adrian
Date: Sat May 26 01:35:11 2012
New Revision: 236038
URL: http://svn.freebsd.org/changeset/base/236038

Log:
  Avoid using hard-coded numbers here.

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

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cSat May 26 01:35:09 2012
(r236037)
+++ head/sys/dev/ath/if_ath_tx.cSat May 26 01:35:11 2012
(r236038)
@@ -3580,7 +3580,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
int nframes = 0, nbad = 0, nf;
int pktlen;
/* XXX there's too much on the stack? */
-   struct ath_rc_series rc[4];
+   struct ath_rc_series rc[ATH_RC_NUM];
int txseq;
 
DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, %s: called; hwq_depth=%d\n,
___
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: r236039 - head/sys/dev/ath/ath_hal/ar9002

2012-05-25 Thread Adrian Chadd
Author: adrian
Date: Sat May 26 01:36:25 2012
New Revision: 236039
URL: http://svn.freebsd.org/changeset/base/236039

Log:
  Add the AR9280 workarounds for PCIe suspend/resume.
  
  These aren't strictly needed at the moment as we're not doing APSM
  and forcing the NIC in and out of network sleep.  But, they don't hurt.
  
  Tested:
  
  * AR9280 (mini-PCIe)
  
  Obtained from:Qualcomm Atheros, Linux ath9k

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 26 01:35:11 
2012(r236038)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 26 01:36:25 
2012(r236039)
@@ -420,18 +420,68 @@ bad:
 static void
 ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off)
 {
+   uint32_t val;
+
if (AH_PRIVATE(ah)-ah_ispcie  !restore) {
ath_hal_ini_write(ah, AH5416(ah)-ah_ini_pcieserdes, 1, 0);
OS_DELAY(1000);
+   }
+
+
+   /*
+* Set PCIe workaround bits
+*
+* NOTE:
+*
+* In Merlin and Kite, bit 14 in WA register (disable L1) should only
+* be set when device enters D3 and be cleared when device comes back
+* to D0.
+*/
+   if (power_off) {/* Power-off */
+   OS_REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA);
+
+   val = OS_REG_READ(ah, AR_WA);
+
+   /*
+* Disable bit 6 and 7 before entering D3 to prevent
+* system hang.
+*/
+   val = ~(AR_WA_BIT6 | AR_WA_BIT7);
+
+   /*
+* XXX Not sure, is specified in the reference HAL.
+*/
+   val |= AR_WA_BIT22;
+
+   /*
+* See above: set AR_WA_D3_L1_DISABLE when entering D3 state.
+*
+* XXX The reference HAL does it this way - it only sets
+* AR_WA_D3_L1_DISABLE if it's set in AR9280_WA_DEFAULT,
+* which it (currently) isn't.  So the following statement
+* is currently a NOP.
+*/
+   if (AR9280_WA_DEFAULT  AR_WA_D3_L1_DISABLE)
+   val |= AR_WA_D3_L1_DISABLE;
+
+   OS_REG_WRITE(ah, AR_WA, val);
+   } else {/* Power-on */
+   val = AR9280_WA_DEFAULT;
+
+   /*
+* See note above: make sure L1_DISABLE is not set.
+*/
+   val = (~AR_WA_D3_L1_DISABLE);
+   OS_REG_WRITE(ah, AR_WA, val);
+
+   /* set bit 19 to allow forcing of pcie core into L1 state */
OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA);
-   OS_REG_WRITE(ah, AR_WA, AR9280_WA_DEFAULT);
}
 }
 
 static void
 ar9280DisablePCIE(struct ath_hal *ah)
 {
-   /* XXX TODO */
 }
 
 static void
___
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: r236042 - head/lib/libc/sys

2012-05-25 Thread Konstantin Belousov
Author: kib
Date: Sat May 26 05:25:55 2012
New Revision: 236042
URL: http://svn.freebsd.org/changeset/base/236042

Log:
  Clarify the SEEK_HOLE description, it repositions the file pointer.
  
  MFC after:  3 days

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

Modified: head/lib/libc/sys/lseek.2
==
--- head/lib/libc/sys/lseek.2   Sat May 26 01:55:51 2012(r236041)
+++ head/lib/libc/sys/lseek.2   Sat May 26 05:25:55 2012(r236042)
@@ -28,7 +28,7 @@
 .\ @(#)lseek.28.3 (Berkeley) 4/19/94
 .\ $FreeBSD$
 .\
-.Dd April 5, 2007
+.Dd May 26, 2012
 .Dt LSEEK 2
 .Os
 .Sh NAME
@@ -92,9 +92,9 @@ If
 .Fa whence
 is
 .Dv SEEK_HOLE ,
-the offset of the start of the next hole greater than or equal to the supplied
-.Fa offset
-is returned.
+the offset is set to the start of the next hole greater than or equal
+to the supplied
+.Fa offset .
 The definition of a hole is provided below.
 .It
 If
___
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: r236043 - in head/sys: kern sys

2012-05-25 Thread Konstantin Belousov
Author: kib
Date: Sat May 26 05:28:47 2012
New Revision: 236043
URL: http://svn.freebsd.org/changeset/base/236043

Log:
  Add a vn_bmap_seekhole(9) vnode helper which can be used by any
  filesystem which supports VOP_BMAP(9) to implement SEEK_HOLE/SEEK_DATA
  commands for lseek(2).
  
  MFC after:2 weeks

Modified:
  head/sys/kern/vfs_vnops.c
  head/sys/sys/vnode.h

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Sat May 26 05:25:55 2012(r236042)
+++ head/sys/kern/vfs_vnops.c   Sat May 26 05:28:47 2012(r236043)
@@ -1466,3 +1466,56 @@ vn_pages_remove(struct vnode *vp, vm_pin
vm_object_page_remove(object, start, end, 0);
VM_OBJECT_UNLOCK(object);
 }
+
+int
+vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred)
+{
+   struct vattr va;
+   daddr_t bn, bnp;
+   uint64_t bsize;
+   off_t noff;
+   int error;
+
+   KASSERT(cmd == FIOSEEKHOLE || cmd == FIOSEEKDATA,
+   (Wrong command %lu, cmd));
+
+   if (vn_lock(vp, LK_SHARED) != 0)
+   return (EBADF);
+   if (vp-v_type != VREG) {
+   error = ENOTTY;
+   goto unlock;
+   }
+   error = VOP_GETATTR(vp, va, cred);
+   if (error != 0)
+   goto unlock;
+   noff = *off;
+   if (noff = va.va_size) {
+   error = ENXIO;
+   goto unlock;
+   }
+   bsize = vp-v_mount-mnt_stat.f_iosize;
+   for (bn = noff / bsize; noff  va.va_size; bn++, noff += bsize) {
+   error = VOP_BMAP(vp, bn, NULL, bnp, NULL, NULL);
+   if (error == EOPNOTSUPP) {
+   error = ENOTTY;
+   goto unlock;
+   }
+   if ((bnp == -1  cmd == FIOSEEKHOLE) ||
+   (bnp != -1  cmd == FIOSEEKDATA)) {
+   noff = bn * bsize;
+   if (noff  *off)
+   noff = *off;
+   goto unlock;
+   }
+   }
+   if (noff  va.va_size)
+   noff = va.va_size;
+   /* noff == va.va_size. There is an implicit hole at the end of file. */
+   if (cmd == FIOSEEKDATA)
+   error = ENXIO;
+unlock:
+   VOP_UNLOCK(vp, 0);
+   if (error == 0)
+   *off = noff;
+   return (error);
+}

Modified: head/sys/sys/vnode.h
==
--- head/sys/sys/vnode.hSat May 26 05:25:55 2012(r236042)
+++ head/sys/sys/vnode.hSat May 26 05:28:47 2012(r236043)
@@ -640,6 +640,8 @@ voidvunref(struct vnode *);
 void   vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3);
 #define vprint(label, vp) vn_printf((vp), %s\n, (label))
 intvrecycle(struct vnode *vp);
+intvn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off,
+   struct ucred *cred);
 intvn_close(struct vnode *vp,
int flags, struct ucred *file_cred, struct thread *td);
 void   vn_finished_write(struct mount *mp);
___
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: r236044 - head/sys/ufs/ufs

2012-05-25 Thread Konstantin Belousov
Author: kib
Date: Sat May 26 05:29:53 2012
New Revision: 236044
URL: http://svn.freebsd.org/changeset/base/236044

Log:
  Implement SEEK_HOLE/SEEK_DATA for UFS.
  
  MFC after:2 weeks

Modified:
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cSat May 26 05:28:47 2012
(r236043)
+++ head/sys/ufs/ufs/ufs_vnops.cSat May 26 05:29:53 2012
(r236044)
@@ -48,6 +48,7 @@ __FBSDID($FreeBSD$);
 #include sys/namei.h
 #include sys/kernel.h
 #include sys/fcntl.h
+#include sys/filio.h
 #include sys/stat.h
 #include sys/bio.h
 #include sys/buf.h
@@ -102,6 +103,7 @@ static int ufs_chown(struct vnode *, uid
 static vop_close_t ufs_close;
 static vop_create_tufs_create;
 static vop_getattr_t   ufs_getattr;
+static vop_ioctl_t ufs_ioctl;
 static vop_link_t  ufs_link;
 static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct 
componentname *);
 static vop_markatime_t ufs_markatime;
@@ -2504,6 +2506,9 @@ ufs_pathconf(ap)
*ap-a_retval = 0;
 #endif
break;
+   case _PC_MIN_HOLE_SIZE:
+   *ap-a_retval = ap-a_vp-v_mount-mnt_stat.f_iosize;
+   break;
case _PC_ASYNC_IO:
/* _PC_ASYNC_IO should have been handled by upper layers. */
KASSERT(0, (_PC_ASYNC_IO should not get here));
@@ -2737,6 +2742,20 @@ bad:
return (error);
 }
 
+static int
+ufs_ioctl(struct vop_ioctl_args *ap)
+{
+
+   switch (ap-a_command) {
+   case FIOSEEKDATA:
+   case FIOSEEKHOLE:
+   return (vn_bmap_seekhole(ap-a_vp, ap-a_command,
+   (off_t *)ap-a_data, ap-a_cred));
+   default:
+   return (ENOTTY);
+   }
+}
+
 /* Global vfs data structures for ufs. */
 struct vop_vector ufs_vnodeops = {
.vop_default =  default_vnodeops,
@@ -2751,6 +2770,7 @@ struct vop_vector ufs_vnodeops = {
.vop_create =   ufs_create,
.vop_getattr =  ufs_getattr,
.vop_inactive = ufs_inactive,
+   .vop_ioctl =ufs_ioctl,
.vop_link = ufs_link,
.vop_lookup =   vfs_cache_lookup,
.vop_markatime =ufs_markatime,
___
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