svn commit: r227699 - head/sys/dev/sfxge

2011-11-19 Thread Philip Paeps
Author: philip
Date: Sat Nov 19 09:13:58 2011
New Revision: 227699
URL: http://svn.freebsd.org/changeset/base/227699

Log:
  sfxge: Fix if_baudrate reports
  
  This field is supposed to be set to the interface bit rate, but for some
  reason I thought it was denominated in kilobits.  Multiply the values up
  accordingly, taking care to saturate rather than overflow on 32-bit
  architectures.
  
  Submitted by: Ben Hutchings 
  MFC after:3 weeks

Modified:
  head/sys/dev/sfxge/sfxge_port.c

Modified: head/sys/dev/sfxge/sfxge_port.c
==
--- head/sys/dev/sfxge/sfxge_port.c Sat Nov 19 07:52:39 2011
(r227698)
+++ head/sys/dev/sfxge/sfxge_port.c Sat Nov 19 09:13:58 2011
(r227699)
@@ -31,6 +31,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 
@@ -219,14 +220,14 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE
 
 #endif /* SFXGE_HAVE_PAUSE_MEDIAOPTS */
 
-static const int sfxge_link_speed_kbit[EFX_LINK_NMODES] = {
-   [EFX_LINK_10HDX]= 1,
-   [EFX_LINK_10FDX]= 1,
-   [EFX_LINK_100HDX]   = 10,
-   [EFX_LINK_100FDX]   = 10,
-   [EFX_LINK_1000HDX]  = 100,
-   [EFX_LINK_1000FDX]  = 100,
-   [EFX_LINK_1FDX] = 1000,
+static const u_long sfxge_link_baudrate[EFX_LINK_NMODES] = {
+   [EFX_LINK_10HDX]= IF_Mbps(10),
+   [EFX_LINK_10FDX]= IF_Mbps(10),
+   [EFX_LINK_100HDX]   = IF_Mbps(100),
+   [EFX_LINK_100FDX]   = IF_Mbps(100),
+   [EFX_LINK_1000HDX]  = IF_Gbps(1),
+   [EFX_LINK_1000FDX]  = IF_Gbps(1),
+   [EFX_LINK_1FDX] = MIN(IF_Gbps(10ULL), ULONG_MAX),
 };
 
 void
@@ -245,7 +246,7 @@ sfxge_mac_link_update(struct sfxge_softc
/* Push link state update to the OS */
link_state = (port->link_mode != EFX_LINK_DOWN ?
  LINK_STATE_UP : LINK_STATE_DOWN);
-   sc->ifnet->if_baudrate = sfxge_link_speed_kbit[port->link_mode];
+   sc->ifnet->if_baudrate = sfxge_link_baudrate[port->link_mode];
if_link_state_change(sc->ifnet, link_state);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227700 - head/sys/dev/sfxge

2011-11-19 Thread Philip Paeps
Author: philip
Date: Sat Nov 19 09:16:52 2011
New Revision: 227700
URL: http://svn.freebsd.org/changeset/base/227700

Log:
  sfxge: Remove interrupt self-test code
  
  It's not currently used; it didn't build on 32-bit and the previous build fix
  is incorrect.  If we really implement self-tests we can do this again
  properly.
  
  Submitted by: Ben Hutchings 
  MFC after:3 weeks

Modified:
  head/sys/dev/sfxge/sfxge.h
  head/sys/dev/sfxge/sfxge_intr.c

Modified: head/sys/dev/sfxge/sfxge.h
==
--- head/sys/dev/sfxge/sfxge.h  Sat Nov 19 09:13:58 2011(r227699)
+++ head/sys/dev/sfxge/sfxge.h  Sat Nov 19 09:16:52 2011(r227700)
@@ -144,7 +144,6 @@ struct sfxge_intr {
int n_alloc;
int type;
efsys_mem_t status;
-   uint64_tmask;
uint32_tzero_count;
 };
 

Modified: head/sys/dev/sfxge/sfxge_intr.c
==
--- head/sys/dev/sfxge/sfxge_intr.c Sat Nov 19 09:13:58 2011
(r227699)
+++ head/sys/dev/sfxge/sfxge_intr.c Sat Nov 19 09:16:52 2011
(r227700)
@@ -65,15 +65,9 @@ sfxge_intr_line_filter(void *arg)
KASSERT(intr->type == EFX_INTR_LINE,
("intr->type != EFX_INTR_LINE"));
 
-   if (intr->state != SFXGE_INTR_STARTED &&
-   intr->state != SFXGE_INTR_TESTING)
+   if (intr->state != SFXGE_INTR_STARTED)
return FILTER_STRAY;
 
-   if (intr->state == SFXGE_INTR_TESTING) {
-   intr->mask |= 1;/* only one interrupt */
-   return FILTER_HANDLED;
-   }
-
(void)efx_intr_status_line(enp, &fatal, &qmask);
 
if (fatal) {
@@ -137,21 +131,9 @@ sfxge_intr_message(void *arg)
KASSERT(intr->type == EFX_INTR_MESSAGE,
("intr->type != EFX_INTR_MESSAGE"));
 
-   if (intr->state != SFXGE_INTR_STARTED &&
-   intr->state != SFXGE_INTR_TESTING)
+   if (intr->state != SFXGE_INTR_STARTED)
return;
 
-   if (intr->state == SFXGE_INTR_TESTING) {
-   uint64_t mask;
-
-   do {
-   mask = intr->mask;
-   } while (atomic_cmpset_ptr(&intr->mask, mask,
-   mask | (1 << index)) == 0);
-
-   return;
-   }
-
(void)efx_intr_status_message(enp, index, &fatal);
 
if (fatal) {
@@ -447,7 +429,6 @@ sfxge_intr_stop(struct sfxge_softc *sc)
intr->state = SFXGE_INTR_INITIALIZED;
 
/* Disable interrupts at the NIC */
-   intr->mask = 0;
efx_intr_disable(sc->enp);
 
/* Disable interrupts at the bus */
@@ -480,13 +461,11 @@ sfxge_intr_start(struct sfxge_softc *sc)
if ((rc = sfxge_intr_bus_enable(sc)) != 0)
goto fail;
 
-   intr->state = SFXGE_INTR_TESTING;
+   intr->state = SFXGE_INTR_STARTED;
 
/* Enable interrupts at the NIC */
efx_intr_enable(sc->enp);
 
-   intr->state = SFXGE_INTR_STARTED;
-
return (0);
 
 fail:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227701 - in head/sys: arm/xscale/ixp425 dev/ahci dev/ata dev/gpio dev/mvs dev/ppbus dev/ppc dev/siba dev/siis dev/usb kern sys

2011-11-19 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Nov 19 10:11:50 2011
New Revision: 227701
URL: http://svn.freebsd.org/changeset/base/227701

Log:
  Move the device_delete_all_children() function from usb_util.c
  to kern/subr_bus.c. Simplify this function so that it no longer
  depends on malloc() to execute. Identify a few other places where
  it makes sense to use device_delete_all_children().
  
  MFC after:1 week

Modified:
  head/sys/arm/xscale/ixp425/avila_ata.c
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ata/ata-disk.c
  head/sys/dev/ata/ata-pci.c
  head/sys/dev/gpio/gpiobus.c
  head/sys/dev/mvs/mvs_pci.c
  head/sys/dev/mvs/mvs_soc.c
  head/sys/dev/ppbus/ppbconf.c
  head/sys/dev/ppc/ppc.c
  head/sys/dev/siba/siba_core.c
  head/sys/dev/siis/siis.c
  head/sys/dev/usb/usb_util.c
  head/sys/dev/usb/usb_util.h
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h

Modified: head/sys/arm/xscale/ixp425/avila_ata.c
==
--- head/sys/arm/xscale/ixp425/avila_ata.c  Sat Nov 19 09:16:52 2011
(r227700)
+++ head/sys/arm/xscale/ixp425/avila_ata.c  Sat Nov 19 10:11:50 2011
(r227701)
@@ -259,17 +259,11 @@ static int
 ata_avila_detach(device_t dev)
 {
struct ata_avila_softc *sc = device_get_softc(dev);
-   device_t *children;
-   int nc;
 
/* XXX quiesce gpio? */
 
/* detach & delete all children */
-   if (device_get_children(dev, &children, &nc) == 0) {
-   if (nc > 0)
-   device_delete_child(dev, children[0]);
-   free(children, M_TEMP);
-   }
+   device_delete_all_children(dev);
 
bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih);
bus_release_resource(dev, SYS_RES_IRQ, sc->sc_rid, sc->sc_irq);

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cSat Nov 19 09:16:52 2011(r227700)
+++ head/sys/dev/ahci/ahci.cSat Nov 19 10:11:50 2011(r227701)
@@ -515,15 +515,11 @@ static int
 ahci_detach(device_t dev)
 {
struct ahci_controller *ctlr = device_get_softc(dev);
-   device_t *children;
-   int nchildren, i;
+   int i;
 
/* Detach & delete all children */
-   if (!device_get_children(dev, &children, &nchildren)) {
-   for (i = 0; i < nchildren; i++)
-   device_delete_child(dev, children[i]);
-   free(children, M_TEMP);
-   }
+   device_delete_all_children(dev);
+
/* Free interrupts. */
for (i = 0; i < ctlr->numirqs; i++) {
if (ctlr->irqs[i].r_irq) {

Modified: head/sys/dev/ata/ata-disk.c
==
--- head/sys/dev/ata/ata-disk.c Sat Nov 19 09:16:52 2011(r227700)
+++ head/sys/dev/ata/ata-disk.c Sat Nov 19 10:11:50 2011(r227701)
@@ -172,8 +172,6 @@ ad_detach(device_t dev)
 {
 struct ad_softc *adp = device_get_ivars(dev);
 struct ata_device *atadev = device_get_softc(dev);
-device_t *children;
-int nchildren, i;
 
 /* check that we have a valid disk to detach */
 if (!device_get_ivars(dev))
@@ -183,12 +181,7 @@ ad_detach(device_t dev)
 callout_drain(&atadev->spindown_timer);
 
 /* detach & delete all children */
-if (!device_get_children(dev, &children, &nchildren)) {
-   for (i = 0; i < nchildren; i++)
-   if (children[i])
-   device_delete_child(dev, children[i]);
-   free(children, M_TEMP);
-}
+device_delete_all_children(dev);
 
 /* destroy disk from the system so we don't get any further requests */
 disk_destroy(adp->disk);

Modified: head/sys/dev/ata/ata-pci.c
==
--- head/sys/dev/ata/ata-pci.c  Sat Nov 19 09:16:52 2011(r227700)
+++ head/sys/dev/ata/ata-pci.c  Sat Nov 19 10:11:50 2011(r227701)
@@ -136,15 +136,10 @@ int
 ata_pci_detach(device_t dev)
 {
 struct ata_pci_controller *ctlr = device_get_softc(dev);
-device_t *children;
-int nchildren, i;
 
 /* detach & delete all children */
-if (!device_get_children(dev, &children, &nchildren)) {
-   for (i = 0; i < nchildren; i++)
-   device_delete_child(dev, children[i]);
-   free(children, M_TEMP);
-}
+device_delete_all_children(dev);
+
 if (ctlr->r_irq) {
bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle);
bus_release_resource(dev, SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq);

Modified: head/sys/dev/gpio/gpiobus.c
==
--- head/sys/dev/gpio/gpiobus.c Sat Nov 19 09:16:52 2011(r227700)
+++ head/sys/dev/gpio/gpiobus.c Sat Nov 19 10:11:50 2011(r227701)
@@ -219,8 +219,7 @@ static int
 gpiobus_detach(device_t dev)
 {
struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev);
-   in

svn commit: r227702 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2011-11-19 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Nov 19 10:24:46 2011
New Revision: 227702
URL: http://svn.freebsd.org/changeset/base/227702

Log:
  MFC r226620:
  
  Update per-thread I/O statistics collection in ZFS.
  This allows to see processes I/O activity in 'top -m io' output.
  
  PRkern/156218
  Reported by:  Marcus Reid 
  Patch by: avg
  Approved by:  re (kib)

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c  Sat Nov 
19 10:11:50 2011(r227701)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c  Sat Nov 
19 10:24:46 2011(r227702)
@@ -627,6 +627,10 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio
} else if (db->db_state == DB_UNCACHED) {
spa_t *spa = dn->dn_objset->os_spa;
 
+#ifdef _KERNEL
+   curthread->td_ru.ru_inblock++;
+#endif
+
if (zio == NULL)
zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL);
dbuf_read_impl(db, zio, &flags);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c   Sat Nov 
19 10:11:50 2011(r227701)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c   Sat Nov 
19 10:24:46 2011(r227702)
@@ -397,9 +397,12 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn,
return (EIO);
}
/* initiate async i/o */
-   if (read) {
+   if (read)
(void) dbuf_read(db, zio, dbuf_flags);
-   }
+#ifdef _KERNEL
+   else
+   curthread->td_ru.ru_oublock++;
+#endif
dbp[i] = &db->db;
}
rw_exit(&dn->dn_struct_rwlock);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227703 - in stable/9/cddl/contrib/opensolaris: cmd/zdb head lib/libzpool/common

2011-11-19 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Nov 19 10:26:34 2011
New Revision: 227703
URL: http://svn.freebsd.org/changeset/base/227703

Log:
  MFC r226613,r226615,r226616:
  
  r226613:
  
  libzpool task_alloc: pass only valid flags to kmem_alloc
  
  tqflags may contain other flags besided those that are suitable for
  kmem_alloc == umem_alloc
  
  Submitted by: avg
  
  r226615:
  
  thr_create: new_thread_ID may be NULL
  
  Submitted by: avg
  
  r226616:
  
  zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS
  
  Submitted by: avg
  
  Approved by:  re (kib)

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  stable/9/cddl/contrib/opensolaris/head/thread.h
  stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 19 10:24:46 
2011(r227702)
+++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 19 10:26:34 
2011(r227703)
@@ -2190,8 +2190,10 @@ dump_block_stats(spa_t *spa)
 */
(void) bpobj_iterate_nofree(&spa->spa_deferred_bpobj,
count_block_cb, &zcb, NULL);
-   (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
-   count_block_cb, &zcb, NULL);
+   if (spa_version(spa) >= SPA_VERSION_DEADLISTS) {
+   (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
+   count_block_cb, &zcb, NULL);
+   }
 
if (dump_opt['c'] > 1)
flags |= TRAVERSE_PREFETCH_DATA;

Modified: stable/9/cddl/contrib/opensolaris/head/thread.h
==
--- stable/9/cddl/contrib/opensolaris/head/thread.h Sat Nov 19 10:24:46 
2011(r227702)
+++ stable/9/cddl/contrib/opensolaris/head/thread.h Sat Nov 19 10:26:34 
2011(r227703)
@@ -76,6 +76,7 @@ static __inline int
 thr_create(void *stack_base, size_t stack_size, void *(*start_func) (void*),
 void *arg, long flags, thread_t *new_thread_ID)
 {
+   pthread_t dummy;
int ret;
 
assert(stack_base == NULL);
@@ -85,9 +86,12 @@ thr_create(void *stack_base, size_t stac
pthread_attr_t attr;
pthread_attr_init(&attr);
 
-   if(flags & THR_DETACHED)
+   if (flags & THR_DETACHED)
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
+   if (new_thread_ID == NULL)
+   new_thread_ID = &dummy;
+
/* This function ignores the THR_BOUND flag, since NPTL doesn't seem to 
support PTHREAD_SCOPE_PROCESS */
 
ret = pthread_create(new_thread_ID, &attr, start_func, arg);

Modified: stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
==
--- stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c   Sat Nov 
19 10:24:46 2011(r227702)
+++ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c   Sat Nov 
19 10:26:34 2011(r227703)
@@ -87,7 +87,7 @@ again:if ((t = tq->tq_freelist) != NULL
}
mutex_exit(&tq->tq_lock);
 
-   t = kmem_alloc(sizeof (task_t), tqflags);
+   t = kmem_alloc(sizeof (task_t), tqflags & KM_SLEEP);
 
mutex_enter(&tq->tq_lock);
if (t != NULL)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227704 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2011-11-19 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Nov 19 10:28:06 2011
New Revision: 227704
URL: http://svn.freebsd.org/changeset/base/227704

Log:
  MFC r226617:
  
  zfs vdev_file_io_start: validate vdev before using vdev_tsd
  
  vdev_tsd can be NULL for certain vdev states.
  At least in userland testing with ztest.
  
  Submitted by: avg
  Approved by:  re (kib)

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 
19 10:26:34 2011(r227703)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 
19 10:28:06 2011(r227704)
@@ -153,17 +153,19 @@ static int
 vdev_file_io_start(zio_t *zio)
 {
vdev_t *vd = zio->io_vd;
-   vdev_file_t *vf = vd->vdev_tsd;
-   vnode_t *vp = vf->vf_vnode;
+   vdev_file_t *vf;
+   vnode_t *vp;
ssize_t resid;
 
-   if (zio->io_type == ZIO_TYPE_IOCTL) {
-   /* XXPOLICY */
-   if (!vdev_readable(vd)) {
-   zio->io_error = ENXIO;
-   return (ZIO_PIPELINE_CONTINUE);
-   }
+   if (!vdev_readable(vd)) {
+   zio->io_error = ENXIO;
+   return (ZIO_PIPELINE_CONTINUE);
+   }
+
+   vf = vd->vdev_tsd;
+   vp = vf->vf_vnode;
 
+   if (zio->io_type == ZIO_TYPE_IOCTL) {
switch (zio->io_cmd) {
case DKIOCFLUSHWRITECACHE:
zio->io_error = VOP_FSYNC(vp, FSYNC | FDSYNC,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227705 - in stable/9: sys/boot/common sys/boot/zfs sys/cddl/boot/zfs tools/tools/zfsboottest

2011-11-19 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Nov 19 10:49:03 2011
New Revision: 227705
URL: http://svn.freebsd.org/changeset/base/227705

Log:
  MFC r226549,r226550,r226551,r226552,r226553,r226554,r226568,r226569,r226611,
  r226612:
  
  r226549:
  
  Remove redundant size calculation.
  
  r226550:
  
  Initialize 'rc' properly before using it. This error could lead to infinite
  loop when data reconstruction was needed.
  
  r226551:
  
  Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs.
  
  r226552:
  
  Never pass NULL block pointer when reading. This is neither expected nor
  handled by lower layers like vdev_raidz, which uses bp for checksum
  verification. This bug could lead to NULL pointer reference and resets
  during boot.
  
  r226553:
  
  Always pass data size for checksum verification function, as using
  physical block size declared in bp may not always be what we want.
  For example in case of gang block header physical block size declared
  in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum
  calculation failed. This bug could lead to accessing unallocated
  memory and resets/failures during boot.
  
  r226554:
  
  Fix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT
  is not.
  
  r226568:
  
  - Correctly read gang header from raidz.
  - Decompress assembled gang block data if compressed.
  - Verify checksum of a gang header.
  - Verify checksum of assembled gang block data.
  - Verify checksum of uber block.
  
  Submitted by: avg
  
  r226569:
  
  With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would
  never call disk_openmbr().
  
  Submitted by: avg
  
  r226611:
  
  - Allow to specify multiple files to check, eg.
  
zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel 
/boot/zfsloader
  
  - Instead of printing file's content calculate MD5 hash of the file,
so it can be easly compared to the hash calculated via file system.
  - Some other minor improvements.
  
  r226612:
  
  Because ZFS boot code was very fragile in the past and real PITA to debug,
  introduce zfsboottest.sh script that will verify if it will be possible to 
boot
  from the given pool.
  
# zfsboottest.sh system
  
  Where "system" is pool name of the pool we want to boot from.
  
  What is being verified by the script:
  - Does the pool exist?
  - Does it have bootfs property configured?
  - Is mountpoint property of the boot dataset set to 'legacy'?
  
  Dataset configured in bootfs property has to be mounted to perform more
  checks:
  - Does the /boot directory in boot dataset exist?
  - Is this dataset configured as root file system in /etc/fstab or set
in vfs.root.mountfrom variable in /boot/loader.conf?
  
  By using zfsboottest tool the script will read all the files in /boot
  directory using ZFS boot code and calculate their checksums.
  Then, it will walk /boot directory using find(1) though regular file sytem
  and also read all the files in /boot directory and calculate their checksums.
  If any of the files cannot be looked up, read or checksum is invalid it will
  be reported and booting off of this pool is probably not possible.
  
  Some additional checks may be interesting as well. For example if the disks
  contain proper pmbr and gptzfsboot code or if all expected files in /boot/
  are present.
  
  When upgrading FreeBSD, one should snapshot datasets that contain operating
  system, upgrade (install new world and kernel) and use zfsboottest.sh to 
verify
  if it will be possible to boot from new configuration. If all is good one
  should upgrade boot blocks, by eg.:
  
# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
  
  If something is wrong, one should rollback datasets and report the problems.
  
  Approved by:  re (kib)

Added:
  stable/9/tools/tools/zfsboottest/zfsboottest.sh
 - copied unchanged from r226612, 
head/tools/tools/zfsboottest/zfsboottest.sh
Modified:
  stable/9/sys/boot/common/disk.c
  stable/9/sys/boot/zfs/zfsimpl.c
  stable/9/sys/cddl/boot/zfs/zfssubr.c
  stable/9/tools/tools/zfsboottest/Makefile
  stable/9/tools/tools/zfsboottest/zfsboottest.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/tools/tools/zfsboottest/   (props changed)

Modified: stable/9/sys/boot/common/disk.c
=

svn commit: r227706 - in head/sys: dev/usb kern

2011-11-19 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Nov 19 11:17:27 2011
New Revision: 227706
URL: http://svn.freebsd.org/changeset/base/227706

Log:
  Simplify the usb_pause_mtx() function by factoring out the generic parts
  to the kernel's pause() function. The pause() function can now be used
  when cold != 0. Also assert that the timeout in system ticks must be
  positive.
  
  Suggested by: Bruce Evans
  MFC after:1 week

Modified:
  head/sys/dev/usb/usb_util.c
  head/sys/kern/kern_synch.c

Modified: head/sys/dev/usb/usb_util.c
==
--- head/sys/dev/usb/usb_util.c Sat Nov 19 10:49:03 2011(r227705)
+++ head/sys/dev/usb/usb_util.c Sat Nov 19 11:17:27 2011(r227706)
@@ -115,33 +115,21 @@ device_set_usb_desc(device_t dev)
  *
  * This function will delay the code by the passed number of system
  * ticks. The passed mutex "mtx" will be dropped while waiting, if
- * "mtx" is not NULL.
+ * "mtx" is different from NULL.
  **/
 void
-usb_pause_mtx(struct mtx *mtx, int _ticks)
+usb_pause_mtx(struct mtx *mtx, int timo)
 {
if (mtx != NULL)
mtx_unlock(mtx);
 
-   if (cold) {
-   /* convert to milliseconds */
-   _ticks = (_ticks * 1000) / hz;
-   /* convert to microseconds, rounded up */
-   _ticks = (_ticks + 1) * 1000;
-   DELAY(_ticks);
-
-   } else {
-
-   /*
-* Add one to the number of ticks so that we don't return
-* too early!
-*/
-   _ticks++;
-
-   if (pause("USBWAIT", _ticks)) {
-   /* ignore */
-   }
-   }
+   /*
+* Add one tick to the timeout so that we don't return too
+* early! Note that pause() will assert that the passed
+* timeout is positive and non-zero!
+*/
+   pause("USBWAIT", timo + 1);
+
if (mtx != NULL)
mtx_lock(mtx);
 }

Modified: head/sys/kern/kern_synch.c
==
--- head/sys/kern/kern_synch.c  Sat Nov 19 10:49:03 2011(r227705)
+++ head/sys/kern/kern_synch.c  Sat Nov 19 11:17:27 2011(r227706)
@@ -325,16 +325,34 @@ msleep_spin(void *ident, struct mtx *mtx
 }
 
 /*
- * pause() is like tsleep() except that the intention is to not be
- * explicitly woken up by another thread.  Instead, the current thread
- * simply wishes to sleep until the timeout expires.  It is
- * implemented using a dummy wait channel.
+ * pause() is almost like tsleep() except that the intention is to not
+ * be explicitly woken up by another thread. Instead, the current
+ * thread simply wishes to sleep until the timeout expires.  It is
+ * implemented using a dummy wait channel. During cold bootup pause()
+ * will use the DELAY() function instead of tsleep() to wait the given
+ * number of system ticks. The passed "timo" argument must not be
+ * negative and also greater than zero.
  */
 int
 pause(const char *wmesg, int timo)
 {
 
-   KASSERT(timo != 0, ("pause: timeout required"));
+   KASSERT(timo > 0, ("pause: a positive and non-zero "
+   "timeout is required"));
+
+   if (cold) {
+   /*
+* We delay one HZ at a time to avoid overflowing the
+* DELAY() argument:
+*/
+   while (timo >= hz) {
+   DELAY(100);
+   timo -= hz;
+   }
+   if (timo > 0)
+   DELAY(timo * tick);
+   return (0);
+   }
return (tsleep(&pause_wchan, 0, wmesg, timo));
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227707 - releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2011-11-19 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Nov 19 11:42:19 2011
New Revision: 227707
URL: http://svn.freebsd.org/changeset/base/227707

Log:
  MFC r226620:
  
  Update per-thread I/O statistics collection in ZFS.
  This allows to see processes I/O activity in 'top -m io' output.
  
  PRkern/156218
  Reported by:  Marcus Reid 
  Patch by: avg
  Approved by:  re (kib)

Modified:
  releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
Directory Properties:
  releng/9.0/sys/   (props changed)
  releng/9.0/sys/amd64/include/xen/   (props changed)
  releng/9.0/sys/boot/   (props changed)
  releng/9.0/sys/boot/i386/efi/   (props changed)
  releng/9.0/sys/boot/ia64/efi/   (props changed)
  releng/9.0/sys/boot/ia64/ski/   (props changed)
  releng/9.0/sys/boot/powerpc/boot1.chrp/   (props changed)
  releng/9.0/sys/boot/powerpc/ofw/   (props changed)
  releng/9.0/sys/cddl/contrib/opensolaris/   (props changed)
  releng/9.0/sys/conf/   (props changed)
  releng/9.0/sys/contrib/dev/acpica/   (props changed)
  releng/9.0/sys/contrib/octeon-sdk/   (props changed)
  releng/9.0/sys/contrib/pf/   (props changed)
  releng/9.0/sys/contrib/x86emu/   (props changed)

Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==
--- releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.cSat Nov 
19 11:17:27 2011(r227706)
+++ releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.cSat Nov 
19 11:42:19 2011(r227707)
@@ -627,6 +627,10 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio
} else if (db->db_state == DB_UNCACHED) {
spa_t *spa = dn->dn_objset->os_spa;
 
+#ifdef _KERNEL
+   curthread->td_ru.ru_inblock++;
+#endif
+
if (zio == NULL)
zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL);
dbuf_read_impl(db, zio, &flags);

Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==
--- releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Nov 
19 11:17:27 2011(r227706)
+++ releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Nov 
19 11:42:19 2011(r227707)
@@ -397,9 +397,12 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn,
return (EIO);
}
/* initiate async i/o */
-   if (read) {
+   if (read)
(void) dbuf_read(db, zio, dbuf_flags);
-   }
+#ifdef _KERNEL
+   else
+   curthread->td_ru.ru_oublock++;
+#endif
dbp[i] = &db->db;
}
rw_exit(&dn->dn_struct_rwlock);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227708 - releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2011-11-19 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Nov 19 11:43:18 2011
New Revision: 227708
URL: http://svn.freebsd.org/changeset/base/227708

Log:
  MFC r226617:
  
  zfs vdev_file_io_start: validate vdev before using vdev_tsd
  
  vdev_tsd can be NULL for certain vdev states.
  At least in userland testing with ztest.
  
  Submitted by: avg
  Approved by:  re (kib)

Modified:
  releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
Directory Properties:
  releng/9.0/sys/   (props changed)
  releng/9.0/sys/amd64/include/xen/   (props changed)
  releng/9.0/sys/boot/   (props changed)
  releng/9.0/sys/boot/i386/efi/   (props changed)
  releng/9.0/sys/boot/ia64/efi/   (props changed)
  releng/9.0/sys/boot/ia64/ski/   (props changed)
  releng/9.0/sys/boot/powerpc/boot1.chrp/   (props changed)
  releng/9.0/sys/boot/powerpc/ofw/   (props changed)
  releng/9.0/sys/cddl/contrib/opensolaris/   (props changed)
  releng/9.0/sys/conf/   (props changed)
  releng/9.0/sys/contrib/dev/acpica/   (props changed)
  releng/9.0/sys/contrib/octeon-sdk/   (props changed)
  releng/9.0/sys/contrib/pf/   (props changed)
  releng/9.0/sys/contrib/x86emu/   (props changed)

Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
==
--- releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c   
Sat Nov 19 11:42:19 2011(r227707)
+++ releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c   
Sat Nov 19 11:43:18 2011(r227708)
@@ -153,17 +153,19 @@ static int
 vdev_file_io_start(zio_t *zio)
 {
vdev_t *vd = zio->io_vd;
-   vdev_file_t *vf = vd->vdev_tsd;
-   vnode_t *vp = vf->vf_vnode;
+   vdev_file_t *vf;
+   vnode_t *vp;
ssize_t resid;
 
-   if (zio->io_type == ZIO_TYPE_IOCTL) {
-   /* XXPOLICY */
-   if (!vdev_readable(vd)) {
-   zio->io_error = ENXIO;
-   return (ZIO_PIPELINE_CONTINUE);
-   }
+   if (!vdev_readable(vd)) {
+   zio->io_error = ENXIO;
+   return (ZIO_PIPELINE_CONTINUE);
+   }
+
+   vf = vd->vdev_tsd;
+   vp = vf->vf_vnode;
 
+   if (zio->io_type == ZIO_TYPE_IOCTL) {
switch (zio->io_cmd) {
case DKIOCFLUSHWRITECACHE:
zio->io_error = VOP_FSYNC(vp, FSYNC | FDSYNC,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227709 - in releng/9.0/cddl/contrib/opensolaris: cmd/zdb head lib/libzpool/common

2011-11-19 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Nov 19 11:44:20 2011
New Revision: 227709
URL: http://svn.freebsd.org/changeset/base/227709

Log:
  MFC r226613,r226615,r226616:
  
  r226613:
  
  libzpool task_alloc: pass only valid flags to kmem_alloc
  
  tqflags may contain other flags besided those that are suitable for
  kmem_alloc == umem_alloc
  
  Submitted by: avg
  
  r226615:
  
  thr_create: new_thread_ID may be NULL
  
  Submitted by: avg
  
  r226616:
  
  zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS
  
  Submitted by: avg
  
  Approved by:  re (kib)

Modified:
  releng/9.0/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  releng/9.0/cddl/contrib/opensolaris/head/thread.h
  releng/9.0/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
Directory Properties:
  releng/9.0/cddl/contrib/opensolaris/   (props changed)

Modified: releng/9.0/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- releng/9.0/cddl/contrib/opensolaris/cmd/zdb/zdb.c   Sat Nov 19 11:43:18 
2011(r227708)
+++ releng/9.0/cddl/contrib/opensolaris/cmd/zdb/zdb.c   Sat Nov 19 11:44:20 
2011(r227709)
@@ -2190,8 +2190,10 @@ dump_block_stats(spa_t *spa)
 */
(void) bpobj_iterate_nofree(&spa->spa_deferred_bpobj,
count_block_cb, &zcb, NULL);
-   (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
-   count_block_cb, &zcb, NULL);
+   if (spa_version(spa) >= SPA_VERSION_DEADLISTS) {
+   (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
+   count_block_cb, &zcb, NULL);
+   }
 
if (dump_opt['c'] > 1)
flags |= TRAVERSE_PREFETCH_DATA;

Modified: releng/9.0/cddl/contrib/opensolaris/head/thread.h
==
--- releng/9.0/cddl/contrib/opensolaris/head/thread.h   Sat Nov 19 11:43:18 
2011(r227708)
+++ releng/9.0/cddl/contrib/opensolaris/head/thread.h   Sat Nov 19 11:44:20 
2011(r227709)
@@ -76,6 +76,7 @@ static __inline int
 thr_create(void *stack_base, size_t stack_size, void *(*start_func) (void*),
 void *arg, long flags, thread_t *new_thread_ID)
 {
+   pthread_t dummy;
int ret;
 
assert(stack_base == NULL);
@@ -85,9 +86,12 @@ thr_create(void *stack_base, size_t stac
pthread_attr_t attr;
pthread_attr_init(&attr);
 
-   if(flags & THR_DETACHED)
+   if (flags & THR_DETACHED)
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
+   if (new_thread_ID == NULL)
+   new_thread_ID = &dummy;
+
/* This function ignores the THR_BOUND flag, since NPTL doesn't seem to 
support PTHREAD_SCOPE_PROCESS */
 
ret = pthread_create(new_thread_ID, &attr, start_func, arg);

Modified: releng/9.0/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
==
--- releng/9.0/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sat Nov 
19 11:43:18 2011(r227708)
+++ releng/9.0/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sat Nov 
19 11:44:20 2011(r227709)
@@ -87,7 +87,7 @@ again:if ((t = tq->tq_freelist) != NULL
}
mutex_exit(&tq->tq_lock);
 
-   t = kmem_alloc(sizeof (task_t), tqflags);
+   t = kmem_alloc(sizeof (task_t), tqflags & KM_SLEEP);
 
mutex_enter(&tq->tq_lock);
if (t != NULL)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227710 - in releng/9.0: sys/boot/common sys/boot/zfs sys/cddl/boot/zfs tools/tools/zfsboottest

2011-11-19 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Nov 19 11:47:15 2011
New Revision: 227710
URL: http://svn.freebsd.org/changeset/base/227710

Log:
  MFC r226549,r226550,r226551,r226552,r226553,r226554,r226568,r226569,r226611,
  r226612:
  
  r226549:
  
  Remove redundant size calculation.
  
  r226550:
  
  Initialize 'rc' properly before using it. This error could lead to infinite
  loop when data reconstruction was needed.
  
  r226551:
  
  Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs.
  
  r226552:
  
  Never pass NULL block pointer when reading. This is neither expected nor
  handled by lower layers like vdev_raidz, which uses bp for checksum
  verification. This bug could lead to NULL pointer reference and resets
  during boot.
  
  r226553:
  
  Always pass data size for checksum verification function, as using
  physical block size declared in bp may not always be what we want.
  For example in case of gang block header physical block size declared
  in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum
  calculation failed. This bug could lead to accessing unallocated
  memory and resets/failures during boot.
  
  r226554:
  
  Fix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT
  is not.
  
  r226568:
  
  - Correctly read gang header from raidz.
  - Decompress assembled gang block data if compressed.
  - Verify checksum of a gang header.
  - Verify checksum of assembled gang block data.
  - Verify checksum of uber block.
  
  Submitted by: avg
  
  r226569:
  
  With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would
  never call disk_openmbr().
  
  Submitted by: avg
  
  r226611:
  
  - Allow to specify multiple files to check, eg.
  
zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel 
/boot/zfsloader
  
  - Instead of printing file's content calculate MD5 hash of the file,
so it can be easly compared to the hash calculated via file system.
  - Some other minor improvements.
  
  r226612:
  
  Because ZFS boot code was very fragile in the past and real PITA to debug,
  introduce zfsboottest.sh script that will verify if it will be possible to 
boot
  from the given pool.
  
# zfsboottest.sh system
  
  Where "system" is pool name of the pool we want to boot from.
  
  What is being verified by the script:
  - Does the pool exist?
  - Does it have bootfs property configured?
  - Is mountpoint property of the boot dataset set to 'legacy'?
  
  Dataset configured in bootfs property has to be mounted to perform more
  checks:
  - Does the /boot directory in boot dataset exist?
  - Is this dataset configured as root file system in /etc/fstab or set
in vfs.root.mountfrom variable in /boot/loader.conf?
  
  By using zfsboottest tool the script will read all the files in /boot
  directory using ZFS boot code and calculate their checksums.
  Then, it will walk /boot directory using find(1) though regular file sytem
  and also read all the files in /boot directory and calculate their checksums.
  If any of the files cannot be looked up, read or checksum is invalid it will
  be reported and booting off of this pool is probably not possible.
  
  Some additional checks may be interesting as well. For example if the disks
  contain proper pmbr and gptzfsboot code or if all expected files in /boot/
  are present.
  
  When upgrading FreeBSD, one should snapshot datasets that contain operating
  system, upgrade (install new world and kernel) and use zfsboottest.sh to 
verify
  if it will be possible to boot from new configuration. If all is good one
  should upgrade boot blocks, by eg.:
  
# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
  
  If something is wrong, one should rollback datasets and report the problems.
  
  Approved by:  re (kib)

Added:
  releng/9.0/tools/tools/zfsboottest/zfsboottest.sh
 - copied unchanged from r226612, 
head/tools/tools/zfsboottest/zfsboottest.sh
Modified:
  releng/9.0/sys/boot/common/disk.c
  releng/9.0/sys/boot/zfs/zfsimpl.c
  releng/9.0/sys/cddl/boot/zfs/zfssubr.c
  releng/9.0/tools/tools/zfsboottest/Makefile
  releng/9.0/tools/tools/zfsboottest/zfsboottest.c
Directory Properties:
  releng/9.0/sys/   (props changed)
  releng/9.0/sys/amd64/include/xen/   (props changed)
  releng/9.0/sys/boot/   (props changed)
  releng/9.0/sys/boot/i386/efi/   (props changed)
  releng/9.0/sys/boot/ia64/efi/   (props changed)
  releng/9.0/sys/boot/ia64/ski/   (props changed)
  releng/9.0/sys/boot/powerpc/boot1.chrp/   (props changed)
  releng/9.0/sys/boot/powerpc/ofw/   (props changed)
  releng/9.0/sys/cddl/contrib/opensolaris/   (props changed)
  releng/9.0/sys/conf/   (props changed)
  releng/9.0/sys/contrib/dev/acpica/   (props changed)
  releng/9.0/sys/contrib/octeon-sdk/   (props changed)
  releng/9.0/sys/contrib/pf/   (props changed)
  releng/9.0/sys/contrib/x86emu/   (props changed)
  releng/9.0/tools/tools/zfsboottest/   (props changed)

Modified: releng/9.0/sys/boot/com

svn commit: r227711 - in stable/9: share/man/man9 sys/dev/ofw sys/kern sys/powerpc/powerpc sys/sys

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 12:55:32 2011
New Revision: 227711
URL: http://svn.freebsd.org/changeset/base/227711

Log:
  MFC: r227537
  
  As it turns out, r186347 actually is insufficient to avoid the use of the
  curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style
  curthread implementation on sparc64, crashing the kernel in its early
  cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the
  things we need for that, which leads to a chicken-and-egg problem). What
  happens is that due to the fact that the idea of r210623 actually is to
  allow the compiler to cache invocations of curthread, it factors out
  obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to
  before the branch based on kobj_mutex_inited when compiling the kernel
  without the debugging options. So change kobj_class_compile_static(9)
  to just never acquire kobj_mtx, effectively restricting it to its
  documented use, and add a kobj_init_static(9) for initializing objects
  using a class compiled with the former and that also avoids using mutex(9)
  (and malloc(9)). Also assert in both of these functions that they are
  used in their intended way only.
  While at it, inline kobj_register_method() and kobj_unregister_method()
  as there wasn't much point for factoring them out in the first place
  and so that a reader of the code has to figure out the locking for
  fewer functions missing a KOBJ_ASSERT.
  Tested on powerpc{,64} by andreast.
  
  Reviewed by:  nwhitehorn (earlier version), jhb
  Approved by:  re (kib)

Modified:
  stable/9/share/man/man9/Makefile
  stable/9/share/man/man9/kobj.9
  stable/9/sys/dev/ofw/openfirm.c
  stable/9/sys/kern/subr_kobj.c
  stable/9/sys/powerpc/powerpc/platform.c
  stable/9/sys/powerpc/powerpc/pmap_dispatch.c
  stable/9/sys/sys/kobj.h
Directory Properties:
  stable/9/share/man/man9/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/share/man/man9/Makefile
==
--- stable/9/share/man/man9/MakefileSat Nov 19 11:47:15 2011
(r227710)
+++ stable/9/share/man/man9/MakefileSat Nov 19 12:55:32 2011
(r227711)
@@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \
kobj.9 kobj_class_free.9 \
kobj.9 kobj_create.9 \
kobj.9 kobj_delete.9 \
-   kobj.9 kobj_init.9
+   kobj.9 kobj_init.9 \
+   kobj.9 kobj_init_static.9
 MLINKS+=kproc.9 kproc_create.9 \
kproc.9 kproc_exit.9 \
kproc.9 kproc_resume.9 \

Modified: stable/9/share/man/man9/kobj.9
==
--- stable/9/share/man/man9/kobj.9  Sat Nov 19 11:47:15 2011
(r227710)
+++ stable/9/share/man/man9/kobj.9  Sat Nov 19 12:55:32 2011
(r227711)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 4, 2000
+.Dd November 14, 2011
 .Dt KOBJ 9
 .Os
 .Sh NAME
@@ -48,6 +48,8 @@
 .Ft void
 .Fn kobj_init "kobj_t obj" "kobj_class_t cls"
 .Ft void
+.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls"
+.Ft void
 .Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype"
 .Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size"
 .Sh DESCRIPTION
@@ -88,10 +90,14 @@ Objects created in this way should be fr
 Clients which would like to manage the allocation of memory
 themselves should call
 .Fn kobj_init
+or
+.Fn kobj_init_static
 with a pointer to the memory for the object and the class which
 implements it.
 It is also possible to use
 .Fn kobj_init
+and
+.Fn kobj_init_static
 to change the class for an object.
 This should be done with care as the classes must agree on the layout
 of the object.
@@ -109,13 +115,19 @@ A client should not normally need to cal
 will automatically be compiled the first time it is used.
 If a class is to be used before
 .Xr malloc 9
-is initialised,
+and
+.Xr mutex 9
+are initialised,
 then
 .Fn kobj_class_compile_static
 should be called with the class and a pointer to a statically
 allocated
 .Vt kobj_ops
 structure before the class is used to initialise any objects.
+In that case, also
+.Fn kobj_init_static
+should be used instead of
+.Fn kobj_init .
 .Pp
 To define a class, first define a simple array of
 .Vt kobj_method_t .

Modified: stable/9/sys/dev/ofw/openfirm.c

svn commit: r227712 - in releng/9.0: share/man/man9 sys/dev/ofw sys/kern sys/powerpc/powerpc sys/sys

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 12:55:34 2011
New Revision: 227712
URL: http://svn.freebsd.org/changeset/base/227712

Log:
  MFC: r227537
  
  As it turns out, r186347 actually is insufficient to avoid the use of the
  curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style
  curthread implementation on sparc64, crashing the kernel in its early
  cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the
  things we need for that, which leads to a chicken-and-egg problem). What
  happens is that due to the fact that the idea of r210623 actually is to
  allow the compiler to cache invocations of curthread, it factors out
  obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to
  before the branch based on kobj_mutex_inited when compiling the kernel
  without the debugging options. So change kobj_class_compile_static(9)
  to just never acquire kobj_mtx, effectively restricting it to its
  documented use, and add a kobj_init_static(9) for initializing objects
  using a class compiled with the former and that also avoids using mutex(9)
  (and malloc(9)). Also assert in both of these functions that they are
  used in their intended way only.
  While at it, inline kobj_register_method() and kobj_unregister_method()
  as there wasn't much point for factoring them out in the first place
  and so that a reader of the code has to figure out the locking for
  fewer functions missing a KOBJ_ASSERT.
  Tested on powerpc{,64} by andreast.
  
  Reviewed by:  nwhitehorn (earlier version), jhb
  Approved by:  re (kib)

Modified:
  releng/9.0/share/man/man9/Makefile
  releng/9.0/share/man/man9/kobj.9
  releng/9.0/sys/dev/ofw/openfirm.c
  releng/9.0/sys/kern/subr_kobj.c
  releng/9.0/sys/powerpc/powerpc/platform.c
  releng/9.0/sys/powerpc/powerpc/pmap_dispatch.c
  releng/9.0/sys/sys/kobj.h
Directory Properties:
  releng/9.0/share/man/man9/   (props changed)
  releng/9.0/sys/   (props changed)
  releng/9.0/sys/amd64/include/xen/   (props changed)
  releng/9.0/sys/boot/   (props changed)
  releng/9.0/sys/boot/i386/efi/   (props changed)
  releng/9.0/sys/boot/ia64/efi/   (props changed)
  releng/9.0/sys/boot/ia64/ski/   (props changed)
  releng/9.0/sys/boot/powerpc/boot1.chrp/   (props changed)
  releng/9.0/sys/boot/powerpc/ofw/   (props changed)
  releng/9.0/sys/cddl/contrib/opensolaris/   (props changed)
  releng/9.0/sys/conf/   (props changed)
  releng/9.0/sys/contrib/dev/acpica/   (props changed)
  releng/9.0/sys/contrib/octeon-sdk/   (props changed)
  releng/9.0/sys/contrib/pf/   (props changed)
  releng/9.0/sys/contrib/x86emu/   (props changed)

Modified: releng/9.0/share/man/man9/Makefile
==
--- releng/9.0/share/man/man9/Makefile  Sat Nov 19 12:55:32 2011
(r227711)
+++ releng/9.0/share/man/man9/Makefile  Sat Nov 19 12:55:34 2011
(r227712)
@@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \
kobj.9 kobj_class_free.9 \
kobj.9 kobj_create.9 \
kobj.9 kobj_delete.9 \
-   kobj.9 kobj_init.9
+   kobj.9 kobj_init.9 \
+   kobj.9 kobj_init_static.9
 MLINKS+=kproc.9 kproc_create.9 \
kproc.9 kproc_exit.9 \
kproc.9 kproc_resume.9 \

Modified: releng/9.0/share/man/man9/kobj.9
==
--- releng/9.0/share/man/man9/kobj.9Sat Nov 19 12:55:32 2011
(r227711)
+++ releng/9.0/share/man/man9/kobj.9Sat Nov 19 12:55:34 2011
(r227712)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 4, 2000
+.Dd November 14, 2011
 .Dt KOBJ 9
 .Os
 .Sh NAME
@@ -48,6 +48,8 @@
 .Ft void
 .Fn kobj_init "kobj_t obj" "kobj_class_t cls"
 .Ft void
+.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls"
+.Ft void
 .Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype"
 .Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size"
 .Sh DESCRIPTION
@@ -88,10 +90,14 @@ Objects created in this way should be fr
 Clients which would like to manage the allocation of memory
 themselves should call
 .Fn kobj_init
+or
+.Fn kobj_init_static
 with a pointer to the memory for the object and the class which
 implements it.
 It is also possible to use
 .Fn kobj_init
+and
+.Fn kobj_init_static
 to change the class for an object.
 This should be done with care as the classes must agree on the layout
 of the object.
@@ -109,13 +115,19 @@ A client should not normally need to cal
 will automatically be compiled the first time it is used.
 If a class is to be used before
 .Xr malloc 9
-is initialised,
+and
+.Xr mutex 9
+are initialised,
 then
 .Fn kobj_class_compile_static
 should be called with the class and a pointer to a statically
 allocated
 .Vt kobj_ops
 structure before the class is used to initialise any objects.
+In that case, also
+.Fn kobj_init_static
+should be used instead of
+.Fn kobj_init .
 .Pp
 To define a class, first define a simple array of
 .Vt kobj_method_t .

Modified: releng/9.0/sys/dev/o

svn commit: r227713 - in stable/8: share/man/man9 sys/dev/ofw sys/kern sys/powerpc/powerpc sys/sys

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 13:03:14 2011
New Revision: 227713
URL: http://svn.freebsd.org/changeset/base/227713

Log:
  MFC: r227537
  
  As it turns out, r186347 actually is insufficient to avoid the use of the
  curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style
  curthread implementation on sparc64, crashing the kernel in its early
  cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the
  things we need for that, which leads to a chicken-and-egg problem). What
  happens is that due to the fact that the idea of r210623 actually is to
  allow the compiler to cache invocations of curthread, it factors out
  obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to
  before the branch based on kobj_mutex_inited when compiling the kernel
  without the debugging options. So change kobj_class_compile_static(9)
  to just never acquire kobj_mtx, effectively restricting it to its
  documented use, and add a kobj_init_static(9) for initializing objects
  using a class compiled with the former and that also avoids using mutex(9)
  (and malloc(9)). Also assert in both of these functions that they are
  used in their intended way only.
  While at it, inline kobj_register_method() and kobj_unregister_method()
  as there wasn't much point for factoring them out in the first place
  and so that a reader of the code has to figure out the locking for
  fewer functions missing a KOBJ_ASSERT.
  Tested on powerpc{,64} by andreast.
  
  Reviewed by:  nwhitehorn (earlier version), jhb

Modified:
  stable/8/share/man/man9/Makefile
  stable/8/share/man/man9/kobj.9
  stable/8/sys/dev/ofw/openfirm.c
  stable/8/sys/kern/subr_kobj.c
  stable/8/sys/powerpc/powerpc/platform.c
  stable/8/sys/powerpc/powerpc/pmap_dispatch.c
  stable/8/sys/sys/kobj.h
Directory Properties:
  stable/8/share/man/man9/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/share/man/man9/Makefile
==
--- stable/8/share/man/man9/MakefileSat Nov 19 12:55:34 2011
(r227712)
+++ stable/8/share/man/man9/MakefileSat Nov 19 13:03:14 2011
(r227713)
@@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \
kobj.9 kobj_class_free.9 \
kobj.9 kobj_create.9 \
kobj.9 kobj_delete.9 \
-   kobj.9 kobj_init.9
+   kobj.9 kobj_init.9 \
+   kobj.9 kobj_init_static.9
 MLINKS+=kproc.9 kproc_create.9 \
kproc.9 kthread_create.9 \
kproc.9 kproc_exit.9 \

Modified: stable/8/share/man/man9/kobj.9
==
--- stable/8/share/man/man9/kobj.9  Sat Nov 19 12:55:34 2011
(r227712)
+++ stable/8/share/man/man9/kobj.9  Sat Nov 19 13:03:14 2011
(r227713)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 4, 2000
+.Dd November 14, 2011
 .Dt KOBJ 9
 .Os
 .Sh NAME
@@ -48,6 +48,8 @@
 .Ft void
 .Fn kobj_init "kobj_t obj" "kobj_class_t cls"
 .Ft void
+.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls"
+.Ft void
 .Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype"
 .Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size"
 .Sh DESCRIPTION
@@ -88,10 +90,14 @@ Objects created in this way should be fr
 Clients which would like to manage the allocation of memory
 themselves should call
 .Fn kobj_init
+or
+.Fn kobj_init_static
 with a pointer to the memory for the object and the class which
 implements it.
 It is also possible to use
 .Fn kobj_init
+and
+.Fn kobj_init_static
 to change the class for an object.
 This should be done with care as the classes must agree on the layout
 of the object.
@@ -109,13 +115,19 @@ A client should not normally need to cal
 will automatically be compiled the first time it is used.
 If a class is to be used before
 .Xr malloc 9
-is initialised,
+and
+.Xr mutex 9
+are initialised,
 then
 .Fn kobj_class_compile_static
 should be called with the class and a pointer to a statically
 allocated
 .Vt kobj_ops
 structure before the class is used to initialise any objects.
+In that case, also
+.Fn kobj_init_static
+should be used instead of
+.Fn kobj_init .
 .Pp
 To define a class, first define a simple array of
 .Vt kobj_method_t .

Modified: stable/8/sys/dev/ofw/openfirm.c
==
--- stable/8/sys/dev/ofw/openfirm.c Sat Nov 19 12:55:34 2011
(r227712)
+++ stable/8/sys/dev/ofw/openfirm.c Sat Nov 19 13:03:14 2011
(r227713)
@@ -121,7 +121,7 @@ OF_init(void *cookie)
 * then statically initialize the OFW object.
 */
kobj_class_compile_static(ofw_def_impl, &ofw_kernel_kops);
-   kobj_init((kobj_t)ofw_obj, ofw_def_impl);
+   kobj_init_stat

svn commit: r227714 - stable/9/sys/sparc64/include

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 13:03:59 2011
New Revision: 227714
URL: http://svn.freebsd.org/changeset/base/227714

Log:
  MFC: r227539
  
  Define curthread as an inline function that loads the thread pointer
  directly from g7, the pcpu pointer. This guarantees correct behavior
  when the thread migrates to a different CPU.
  Commit message stolen from r205431. Additional testing by Peter Jeremy.
  
  Approved by:  re (kib)

Modified:
  stable/9/sys/sparc64/include/pcpu.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/sparc64/include/pcpu.h
==
--- stable/9/sys/sparc64/include/pcpu.h Sat Nov 19 13:03:14 2011
(r227713)
+++ stable/9/sys/sparc64/include/pcpu.h Sat Nov 19 13:03:59 2011
(r227714)
@@ -74,6 +74,16 @@ register struct pcpu *pcpup __asm__(__XS
 
 #definePCPU_GET(member)(pcpup->pc_ ## member)
 
+static __inline __pure2 struct thread *
+__curthread(void)
+{
+   struct thread *td;
+
+   __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td));
+   return (td);
+}
+#definecurthread   (__curthread())
+
 /*
  * XXX The implementation of this operation should be made atomic
  * with respect to preemption.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227715 - releng/9.0/sys/sparc64/include

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 13:04:17 2011
New Revision: 227715
URL: http://svn.freebsd.org/changeset/base/227715

Log:
  MFC: r227539
  
  Define curthread as an inline function that loads the thread pointer
  directly from g7, the pcpu pointer. This guarantees correct behavior
  when the thread migrates to a different CPU.
  Commit message stolen from r205431. Additional testing by Peter Jeremy.
  
  Approved by:  re (kib)

Modified:
  releng/9.0/sys/sparc64/include/pcpu.h
Directory Properties:
  releng/9.0/sys/   (props changed)
  releng/9.0/sys/amd64/include/xen/   (props changed)
  releng/9.0/sys/boot/   (props changed)
  releng/9.0/sys/boot/i386/efi/   (props changed)
  releng/9.0/sys/boot/ia64/efi/   (props changed)
  releng/9.0/sys/boot/ia64/ski/   (props changed)
  releng/9.0/sys/boot/powerpc/boot1.chrp/   (props changed)
  releng/9.0/sys/boot/powerpc/ofw/   (props changed)
  releng/9.0/sys/cddl/contrib/opensolaris/   (props changed)
  releng/9.0/sys/conf/   (props changed)
  releng/9.0/sys/contrib/dev/acpica/   (props changed)
  releng/9.0/sys/contrib/octeon-sdk/   (props changed)
  releng/9.0/sys/contrib/pf/   (props changed)
  releng/9.0/sys/contrib/x86emu/   (props changed)

Modified: releng/9.0/sys/sparc64/include/pcpu.h
==
--- releng/9.0/sys/sparc64/include/pcpu.h   Sat Nov 19 13:03:59 2011
(r227714)
+++ releng/9.0/sys/sparc64/include/pcpu.h   Sat Nov 19 13:04:17 2011
(r227715)
@@ -74,6 +74,16 @@ register struct pcpu *pcpup __asm__(__XS
 
 #definePCPU_GET(member)(pcpup->pc_ ## member)
 
+static __inline __pure2 struct thread *
+__curthread(void)
+{
+   struct thread *td;
+
+   __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td));
+   return (td);
+}
+#definecurthread   (__curthread())
+
 /*
  * XXX The implementation of this operation should be made atomic
  * with respect to preemption.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227716 - stable/8/sys/sparc64/include

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 13:29:55 2011
New Revision: 227716
URL: http://svn.freebsd.org/changeset/base/227716

Log:
  MFC: r227539
  
  Define curthread as an inline function that loads the thread pointer
  directly from g7, the pcpu pointer. This guarantees correct behavior
  when the thread migrates to a different CPU.
  Commit message stolen from r205431. Additional testing by Peter Jeremy.

Modified:
  stable/8/sys/sparc64/include/pcpu.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/sparc64/include/pcpu.h
==
--- stable/8/sys/sparc64/include/pcpu.h Sat Nov 19 13:04:17 2011
(r227715)
+++ stable/8/sys/sparc64/include/pcpu.h Sat Nov 19 13:29:55 2011
(r227716)
@@ -73,6 +73,16 @@ register struct pcpu *pcpup __asm__(__XS
 
 #definePCPU_GET(member)(pcpup->pc_ ## member)
 
+static __inline __pure2 struct thread *
+__curthread(void)
+{
+   struct thread *td;
+
+   __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td));
+   return (td);
+}
+#definecurthread   (__curthread())
+
 /*
  * XXX The implementation of this operation should be made atomic
  * with respect to preemption.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227720 - stable/8/sys/sparc64/sbus

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 13:33:24 2011
New Revision: 227720
URL: http://svn.freebsd.org/changeset/base/227720

Log:
  MFC: r227578
  
  Fix compilation with DEBUG defined.

Modified:
  stable/8/sys/sparc64/sbus/lsi64854.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/sparc64/sbus/lsi64854.c
==
--- stable/8/sys/sparc64/sbus/lsi64854.cSat Nov 19 13:33:22 2011
(r227719)
+++ stable/8/sys/sparc64/sbus/lsi64854.cSat Nov 19 13:33:24 2011
(r227720)
@@ -561,7 +561,7 @@ lsi64854_scsi_intr(void *arg)
 
DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n",
__func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM),
-   (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ?
+   (nsc->sc_features & NCR_F_LARGEXFER) != 0 ?
NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid));
 
if (dmasize != 0) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227718 - stable/9/sys/sparc64/sbus

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 13:33:21 2011
New Revision: 227718
URL: http://svn.freebsd.org/changeset/base/227718

Log:
  MFC: r227578
  
  Fix compilation with DEBUG defined.
  
  Approved by:  re (kib)

Modified:
  stable/9/sys/sparc64/sbus/lsi64854.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/sparc64/sbus/lsi64854.c
==
--- stable/9/sys/sparc64/sbus/lsi64854.cSat Nov 19 13:30:12 2011
(r227717)
+++ stable/9/sys/sparc64/sbus/lsi64854.cSat Nov 19 13:33:21 2011
(r227718)
@@ -561,7 +561,7 @@ lsi64854_scsi_intr(void *arg)
 
DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n",
__func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM),
-   (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ?
+   (nsc->sc_features & NCR_F_LARGEXFER) != 0 ?
NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid));
 
if (dmasize != 0) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227719 - releng/9.0/sys/sparc64/sbus

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 13:33:22 2011
New Revision: 227719
URL: http://svn.freebsd.org/changeset/base/227719

Log:
  MFC: r227578
  
  Fix compilation with DEBUG defined.
  
  Approved by:  re (kib)

Modified:
  releng/9.0/sys/sparc64/sbus/lsi64854.c
Directory Properties:
  releng/9.0/sys/   (props changed)
  releng/9.0/sys/amd64/include/xen/   (props changed)
  releng/9.0/sys/boot/   (props changed)
  releng/9.0/sys/boot/i386/efi/   (props changed)
  releng/9.0/sys/boot/ia64/efi/   (props changed)
  releng/9.0/sys/boot/ia64/ski/   (props changed)
  releng/9.0/sys/boot/powerpc/boot1.chrp/   (props changed)
  releng/9.0/sys/boot/powerpc/ofw/   (props changed)
  releng/9.0/sys/cddl/contrib/opensolaris/   (props changed)
  releng/9.0/sys/conf/   (props changed)
  releng/9.0/sys/contrib/dev/acpica/   (props changed)
  releng/9.0/sys/contrib/octeon-sdk/   (props changed)
  releng/9.0/sys/contrib/pf/   (props changed)
  releng/9.0/sys/contrib/x86emu/   (props changed)

Modified: releng/9.0/sys/sparc64/sbus/lsi64854.c
==
--- releng/9.0/sys/sparc64/sbus/lsi64854.c  Sat Nov 19 13:33:21 2011
(r227718)
+++ releng/9.0/sys/sparc64/sbus/lsi64854.c  Sat Nov 19 13:33:22 2011
(r227719)
@@ -561,7 +561,7 @@ lsi64854_scsi_intr(void *arg)
 
DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n",
__func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM),
-   (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ?
+   (nsc->sc_features & NCR_F_LARGEXFER) != 0 ?
NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid));
 
if (dmasize != 0) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227721 - stable/7/sys/sparc64/sbus

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 13:33:30 2011
New Revision: 227721
URL: http://svn.freebsd.org/changeset/base/227721

Log:
  MFC: r227578
  
  Fix compilation with DEBUG defined.

Modified:
  stable/7/sys/sparc64/sbus/lsi64854.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/sbus/lsi64854.c
==
--- stable/7/sys/sparc64/sbus/lsi64854.cSat Nov 19 13:33:24 2011
(r227720)
+++ stable/7/sys/sparc64/sbus/lsi64854.cSat Nov 19 13:33:30 2011
(r227721)
@@ -568,7 +568,7 @@ lsi64854_scsi_intr(void *arg)
 
DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n",
__func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM),
-   (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ?
+   (nsc->sc_features & NCR_F_LARGEXFER) != 0 ?
NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid));
 
if (dmasize != 0) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227717 - stable/7/sys/sparc64/include

2011-11-19 Thread Marius Strobl
Author: marius
Date: Sat Nov 19 13:30:12 2011
New Revision: 227717
URL: http://svn.freebsd.org/changeset/base/227717

Log:
  MFC: r227539
  
  Define curthread as an inline function that loads the thread pointer
  directly from g7, the pcpu pointer. This guarantees correct behavior
  when the thread migrates to a different CPU.
  Commit message stolen from r205431. Additional testing by Peter Jeremy.

Modified:
  stable/7/sys/sparc64/include/pcpu.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/include/pcpu.h
==
--- stable/7/sys/sparc64/include/pcpu.h Sat Nov 19 13:29:55 2011
(r227716)
+++ stable/7/sys/sparc64/include/pcpu.h Sat Nov 19 13:30:12 2011
(r227717)
@@ -71,6 +71,16 @@ register struct pcpu *pcpup __asm__(__XS
 
 #definePCPU_GET(member)(pcpup->pc_ ## member)
 
+static __inline __pure2 struct thread *
+__curthread(void)
+{
+   struct thread *td;
+
+   __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td));
+   return (td);
+}
+#definecurthread   (__curthread())
+
 /*
  * XXX The implementation of this operation should be made atomic
  * with respect to preemption.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227722 - head/sys/mips/nlm/hal

2011-11-19 Thread Jayachandran C.
Author: jchandra
Date: Sat Nov 19 14:06:15 2011
New Revision: 227722
URL: http://svn.freebsd.org/changeset/base/227722

Log:
  Whitespace fixes in XLP HAL files.
  
  Also fixup a macro in iomap.h

Modified:
  head/sys/mips/nlm/hal/bridge.h
  head/sys/mips/nlm/hal/cop2.h
  head/sys/mips/nlm/hal/cpucontrol.h
  head/sys/mips/nlm/hal/haldefs.h
  head/sys/mips/nlm/hal/iomap.h
  head/sys/mips/nlm/hal/mips-extns.h
  head/sys/mips/nlm/hal/mmu.h
  head/sys/mips/nlm/hal/pcibus.h
  head/sys/mips/nlm/hal/uart.h

Modified: head/sys/mips/nlm/hal/bridge.h
==
--- head/sys/mips/nlm/hal/bridge.h  Sat Nov 19 13:33:30 2011
(r227721)
+++ head/sys/mips/nlm/hal/bridge.h  Sat Nov 19 14:06:15 2011
(r227722)
@@ -30,7 +30,7 @@
  */
 
 #ifndef __NLM_HAL_BRIDGE_H__
-#define __NLM_HAL_BRIDGE_H__
+#define__NLM_HAL_BRIDGE_H__
 
 /**
 * @file_name mio.h
@@ -44,141 +44,141 @@
  * These registers start after the PCIe header, which has 0x40
  * standard entries
  */
-#define BRIDGE_MODE0x00
-#define BRIDGE_PCI_CFG_BASE0x01
-#define BRIDGE_PCI_CFG_LIMIT   0x02
-#define BRIDGE_PCIE_CFG_BASE   0x03
-#define BRIDGE_PCIE_CFG_LIMIT  0x04
-#define BRIDGE_BUSNUM_BAR0 0x05
-#define BRIDGE_BUSNUM_BAR1 0x06
-#define BRIDGE_BUSNUM_BAR2 0x07
-#define BRIDGE_BUSNUM_BAR3 0x08
-#define BRIDGE_BUSNUM_BAR4 0x09
-#define BRIDGE_BUSNUM_BAR5 0x0a
-#define BRIDGE_BUSNUM_BAR6 0x0b
-#define BRIDGE_FLASH_BAR0  0x0c
-#define BRIDGE_FLASH_BAR1  0x0d
-#define BRIDGE_FLASH_BAR2  0x0e
-#define BRIDGE_FLASH_BAR3  0x0f
-#define BRIDGE_FLASH_LIMIT00x10
-#define BRIDGE_FLASH_LIMIT10x11
-#define BRIDGE_FLASH_LIMIT20x12
-#define BRIDGE_FLASH_LIMIT30x13
-
-#define BRIDGE_DRAM_BAR(i) (0x14 + (i))
-#define BRIDGE_DRAM_BAR0   0x14
-#define BRIDGE_DRAM_BAR1   0x15
-#define BRIDGE_DRAM_BAR2   0x16
-#define BRIDGE_DRAM_BAR3   0x17
-#define BRIDGE_DRAM_BAR4   0x18
-#define BRIDGE_DRAM_BAR5   0x19
-#define BRIDGE_DRAM_BAR6   0x1a
-#define BRIDGE_DRAM_BAR7   0x1b
-
-#define BRIDGE_DRAM_LIMIT(i)   (0x1c + (i))
-#define BRIDGE_DRAM_LIMIT0 0x1c
-#define BRIDGE_DRAM_LIMIT1 0x1d
-#define BRIDGE_DRAM_LIMIT2 0x1e
-#define BRIDGE_DRAM_LIMIT3 0x1f
-#define BRIDGE_DRAM_LIMIT4 0x20
-#define BRIDGE_DRAM_LIMIT5 0x21
-#define BRIDGE_DRAM_LIMIT6 0x22
-#define BRIDGE_DRAM_LIMIT7 0x23
-
-#define BRIDGE_DRAM_NODE_TRANSLN0  0x24
-#define BRIDGE_DRAM_NODE_TRANSLN1  0x25
-#define BRIDGE_DRAM_NODE_TRANSLN2  0x26
-#define BRIDGE_DRAM_NODE_TRANSLN3  0x27
-#define BRIDGE_DRAM_NODE_TRANSLN4  0x28
-#define BRIDGE_DRAM_NODE_TRANSLN5  0x29
-#define BRIDGE_DRAM_NODE_TRANSLN6  0x2a
-#define BRIDGE_DRAM_NODE_TRANSLN7  0x2b
-#define BRIDGE_DRAM_CHNL_TRANSLN0  0x2c
-#define BRIDGE_DRAM_CHNL_TRANSLN1  0x2d
-#define BRIDGE_DRAM_CHNL_TRANSLN2  0x2e
-#define BRIDGE_DRAM_CHNL_TRANSLN3  0x2f
-#define BRIDGE_DRAM_CHNL_TRANSLN4  0x30
-#define BRIDGE_DRAM_CHNL_TRANSLN5  0x31
-#define BRIDGE_DRAM_CHNL_TRANSLN6  0x32
-#define BRIDGE_DRAM_CHNL_TRANSLN7  0x33
-#define BRIDGE_PCIEMEM_BASE0   0x34
-#define BRIDGE_PCIEMEM_BASE1   0x35
-#define BRIDGE_PCIEMEM_BASE2   0x36
-#define BRIDGE_PCIEMEM_BASE3   0x37
-#define BRIDGE_PCIEMEM_LIMIT0  0x38
-#define BRIDGE_PCIEMEM_LIMIT1  0x39
-#define BRIDGE_PCIEMEM_LIMIT2  0x3a
-#define BRIDGE_PCIEMEM_LIMIT3  0x3b
-#define BRIDGE_PCIEIO_BASE00x3c
-#define BRIDGE_PCIEIO_BASE10x3d
-#define BRIDGE_PCIEIO_BASE20x3e
-#define BRIDGE_PCIEIO_BASE30x3f
-#define BRIDGE_PCIEIO_LIMIT0   0x40
-#define BRIDGE_PCIEIO_LIMIT1   0x41
-#define BRIDGE_PCIEIO_LIMIT2   0x42
-#define BRIDGE_PCIEIO_LIMIT3   0x43
-#define BRIDGE_PCIEMEM_BASE4   0x44
-#define BRIDGE_PCIEMEM_BASE5   0x45
-#define BRIDGE_PCIEMEM_BASE6   0x46
-#define BRIDGE_PCIEMEM_LIMIT4  0x47
-#define BRIDGE_PCIEMEM_LIMIT5  0x48
-#define BRIDGE_PCIEMEM_LIMIT6  0x49
-#define BRIDGE_PCIEIO_BASE40x4a
-#define BRIDGE_PCIEIO_BASE50x4b
-#define BRIDGE_PCIEIO_BASE60x4c
-#define BRIDGE_PCIEIO_LIMIT4   0x4d
-#define BRIDGE_PCIEIO_LIMIT5   0x4e
-#define BRIDGE_PCIEIO_LIMIT6   0x4f
-#define BRIDGE_NBU_EVENT_CNT_CTL   0x50
-#define BRIDGE_EVNTCTR1_LOW0x51
-#define BRIDGE_EVNTCTR1_HI 0x52
-#define BRIDGE_EVNT_CNT_CTL2   0x53
-#define BRIDGE_EVNTCTR2_LOW0x54
-#define

svn commit: r227723 - in head/sys: conf kern sys

2011-11-19 Thread Lawrence Stewart
Author: lstewart
Date: Sat Nov 19 14:10:16 2011
New Revision: 227723
URL: http://svn.freebsd.org/changeset/base/227723

Log:
  Core structure and functions to support a feed-forward clock within the 
kernel.
  Implement ffcounter, a monotonically increasing cumulative counter on top of 
the
  active timecounter. Provide low-level functions to read the ffcounter and
  convert it to absolute time or a time interval in seconds using the current
  ffclock estimates, which track the drift of the oscillator. Add a ring of
  fftimehands to track passing of time on each kernel tick and pick up updates 
of
  ffclock estimates.
  
  Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
  Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward
  Clock Synchronization Algorithms" project.
  
  For more information, see http://www.synclab.org/radclock/
  
  Submitted by: Julien Ridoux (jridoux at unimelb edu au)

Added:
  head/sys/sys/_ffcounter.h   (contents, props changed)
  head/sys/sys/timeffc.h   (contents, props changed)
Modified:
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/kern/kern_tc.c
  head/sys/kern/subr_rtc.c

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Sat Nov 19 14:06:15 2011(r227722)
+++ head/sys/conf/NOTES Sat Nov 19 14:10:16 2011(r227723)
@@ -1186,6 +1186,14 @@ options  HZ=100
 
 optionsPPS_SYNC
 
+# Enable support for generic feed-forward clocks in the kernel.
+# The feed-forward clock support is an alternative to the feedback oriented
+# ntpd/system clock approach, and is to be used with a feed-forward
+# synchronization algorithm such as the RADclock:
+# More info here: http://www.synclab.org/radclock
+
+optionsFFCLOCK
+
 
 #
 # SCSI DEVICES

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Sat Nov 19 14:06:15 2011(r227722)
+++ head/sys/conf/options   Sat Nov 19 14:10:16 2011(r227723)
@@ -80,6 +80,7 @@ COMPRESS_USER_CORES opt_core.h
 CY_PCI_FASTINTR
 DEADLKRES  opt_watchdog.h
 DIRECTIO
+FFCLOCK
 FULL_PREEMPTIONopt_sched.h
 IPI_PREEMPTION opt_sched.h
 GEOM_AES   opt_geom.h

Modified: head/sys/kern/kern_tc.c
==
--- head/sys/kern/kern_tc.c Sat Nov 19 14:06:15 2011(r227722)
+++ head/sys/kern/kern_tc.c Sat Nov 19 14:10:16 2011(r227723)
@@ -5,18 +5,32 @@
  * can do whatever you want with this stuff. If we meet some day, and you think
  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
  * 
+ *
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Julien Ridoux at the University
+ * of Melbourne under sponsorship from the FreeBSD Foundation.
  */
 
 #include 
 __FBSDID("$FreeBSD$");
 
 #include "opt_ntp.h"
+#include "opt_ffclock.h"
 
 #include 
 #include 
+#ifdef FFCLOCK
+#include 
+#include 
+#endif
 #include 
 #include 
 #include 
+#ifdef FFCLOCK
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -300,6 +314,425 @@ getmicrotime(struct timeval *tvp)
} while (gen == 0 || gen != th->th_generation);
 }
 
+#ifdef FFCLOCK
+/*
+ * Support for feed-forward synchronization algorithms. This is heavily 
inspired
+ * by the timehands mechanism but kept independent from it. *_windup() 
functions
+ * have some connection to avoid accessing the timecounter hardware more than
+ * necessary.
+ */
+
+/* Feed-forward clock estimates kept updated by the synchronization daemon. */
+struct ffclock_estimate ffclock_estimate;
+struct bintime ffclock_boottime;   /* Feed-forward boot time estimate. */
+uint32_t ffclock_status;   /* Feed-forward clock status. */
+int8_t ffclock_updated;/* New estimates are available. 
*/
+struct mtx ffclock_mtx;/* Mutex on ffclock_estimate. */
+
+struct fftimehands {
+   struct ffclock_estimate cest;
+   struct bintime  tick_time;
+   struct bintime  tick_time_lerp;
+   ffcounter   tick_ffcount;
+   uint64_tperiod_lerp;
+   volatile uint8_tgen;
+   struct fftimehands  *next;
+};
+
+#defineNUM_ELEMENTS(x) (sizeof(x) / sizeof(*x))
+
+static struct fftimehands ffth[10];
+static struct fftimehands *volatile fftimehands = ffth;
+
+static void
+ffclock_init(void)
+{
+   struct fftimehands *cur;
+   struct fftimehands *last;
+
+   memset(ffth, 0, sizeof(ffth));
+
+   last = ffth + NUM_ELEMENTS(ffth) - 1;
+   for (cur = ffth; cur < last; cur++)
+   cur->next = cur + 1;

svn commit: r227724 - head/sys/mips/mips

2011-11-19 Thread Jayachandran C.
Author: jchandra
Date: Sat Nov 19 14:14:35 2011
New Revision: 227724
URL: http://svn.freebsd.org/changeset/base/227724

Log:
  Fixup cache flush definitions for XLP
  
  mco_icache_sync_range was earlier set to mipsNN_icache_sync_range_index_32
  which is not necessary, revert this.
  Also, the data cache is coherent so write back is not really needed. This
  change is experimental.

Modified:
  head/sys/mips/mips/cache.c

Modified: head/sys/mips/mips/cache.c
==
--- head/sys/mips/mips/cache.c  Sat Nov 19 14:10:16 2011(r227723)
+++ head/sys/mips/mips/cache.c  Sat Nov 19 14:14:35 2011(r227724)
@@ -101,13 +101,8 @@ mips_config_cache(struct mips_cpuinfo * 
break;
case 32:
mips_cache_ops.mco_icache_sync_all = mipsNN_icache_sync_all_32;
-#ifdef CPU_NLM
-   mips_cache_ops.mco_icache_sync_range =
-   mipsNN_icache_sync_range_index_32;
-#else
mips_cache_ops.mco_icache_sync_range =
mipsNN_icache_sync_range_32;
-#endif
mips_cache_ops.mco_icache_sync_range_index =
mipsNN_icache_sync_range_index_32;
break;
@@ -155,18 +150,23 @@ mips_config_cache(struct mips_cpuinfo * 
mips_cache_ops.mco_pdcache_wbinv_all =
mips_cache_ops.mco_intern_pdcache_wbinv_all =
mipsNN_pdcache_wbinv_all_32;
-#ifdef CPU_NLM
-   mips_cache_ops.mco_pdcache_wbinv_range =
-   mipsNN_pdcache_wbinv_range_index_32;
+#if defined(CPU_RMI) || defined(CPU_NLM)
+   mips_cache_ops.mco_pdcache_wbinv_range = cache_noop;
 #else
mips_cache_ops.mco_pdcache_wbinv_range =
mipsNN_pdcache_wbinv_range_32;
 #endif
+#if defined(CPU_RMI) || defined(CPU_NLM)
+   mips_cache_ops.mco_pdcache_wbinv_range_index =
+   mips_cache_ops.mco_intern_pdcache_wbinv_range_index = 
cache_noop;
+   mips_cache_ops.mco_pdcache_inv_range = cache_noop;
+#else
mips_cache_ops.mco_pdcache_wbinv_range_index =
mips_cache_ops.mco_intern_pdcache_wbinv_range_index =
mipsNN_pdcache_wbinv_range_index_32;
mips_cache_ops.mco_pdcache_inv_range =
mipsNN_pdcache_inv_range_32;
+#endif
 #if defined(CPU_RMI) || defined(CPU_NLM)
mips_cache_ops.mco_pdcache_wb_range =
mips_cache_ops.mco_intern_pdcache_wb_range = cache_noop;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227725 - in head/sys/mips: conf nlm

2011-11-19 Thread Jayachandran C.
Author: jchandra
Date: Sat Nov 19 14:33:14 2011
New Revision: 227725
URL: http://svn.freebsd.org/changeset/base/227725

Log:
  Fix USB compilation, and add USB options to XLP conf
  
  Remove obsolete header file included in usb_init.c

Modified:
  head/sys/mips/conf/std.XLP
  head/sys/mips/nlm/usb_init.c

Modified: head/sys/mips/conf/std.XLP
==
--- head/sys/mips/conf/std.XLP  Sat Nov 19 14:14:35 2011(r227724)
+++ head/sys/mips/conf/std.XLP  Sat Nov 19 14:33:14 2011(r227725)
@@ -76,6 +76,14 @@ device   scbus
 #deviceata
 #deviceatadisk
 
+# USB
+device usb # USB Bus (required)
+device ehci# EHCI PCI->USB interface (USB 2.0)
+#options   USB_DEBUG   # enable debug msgs
+#deviceugen# Generic
+#deviceuhid# "Human Interface Devices"
+device umass   # Requires scbus and da
+
 optionsFDT
 optionsFDT_DTB_STATIC
 makeoptionsFDT_DTS_FILE=xlp-basic.dts

Modified: head/sys/mips/nlm/usb_init.c
==
--- head/sys/mips/nlm/usb_init.cSat Nov 19 14:14:35 2011
(r227724)
+++ head/sys/mips/nlm/usb_init.cSat Nov 19 14:33:14 2011
(r227725)
@@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 
 #include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227726 - head/sys/boot/i386/loader

2011-11-19 Thread Martin Wilke
Author: miwi
Date: Sat Nov 19 14:42:06 2011
New Revision: 227726
URL: http://svn.freebsd.org/changeset/base/227726

Log:
  - Whitespaces fixed only
  
  Approved by:  rwatson (mentor)

Modified:
  head/sys/boot/i386/loader/Makefile

Modified: head/sys/boot/i386/loader/Makefile
==
--- head/sys/boot/i386/loader/Makefile  Sat Nov 19 14:33:14 2011
(r227725)
+++ head/sys/boot/i386/loader/Makefile  Sat Nov 19 14:42:06 2011
(r227726)
@@ -56,7 +56,7 @@ CFLAGS+=  -DLOADER_GZIP_SUPPORT
 CFLAGS+=   -DLOADER_GPT_SUPPORT
 .endif
 
-# Always add MI sources 
+# Always add MI sources
 .PATH: ${.CURDIR}/../../common
 .include   "${.CURDIR}/../../common/Makefile.inc"
 CFLAGS+=   -I${.CURDIR}/../../common
@@ -101,7 +101,7 @@ FILES=  ${LOADER}
 FILESMODE_${LOADER}= ${BINMODE} -b
 
 .if !defined(LOADER_ONLY)
-.PATH: ${.CURDIR}/../../forth 
+.PATH: ${.CURDIR}/../../forth
 FILES+=loader.help loader.4th support.4th loader.conf
 FILES+= screen.4th frames.4th beastie.4th
 FILES+= brand.4th check-password.4th color.4th delay.4th
@@ -117,7 +117,7 @@ FILES+= menu.rc
 .endif
 
 # XXX crt0.o needs to be first for pxeboot(8) to work
-OBJS=  ${BTXCRT} 
+OBJS=  ${BTXCRT}
 
 DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND}
 LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2011-11-19 Thread Martin Wilke
Author: miwi
Date: Sat Nov 19 14:44:29 2011
New Revision: 227727
URL: http://svn.freebsd.org/changeset/base/227727

Log:
  - Add new loader_logo orbbw to default.conf
  
  PR:   162608
  Submitted by: manolis
  Approved by:  rwatson (mentor)
  MFC after:3 Days

Modified:
  head/sys/boot/forth/loader.conf

Modified: head/sys/boot/forth/loader.conf
==
--- head/sys/boot/forth/loader.conf Sat Nov 19 14:42:06 2011
(r227726)
+++ head/sys/boot/forth/loader.conf Sat Nov 19 14:44:29 2011
(r227727)
@@ -47,7 +47,7 @@ bitmap_type="splash_image_data" # and pl
# escape to the loader prompt, set to
# "NO" to disable autobooting
 #beastie_disable="NO"  # Turn the beastie boot menu on and off
-#loader_logo="fbsdbw"  # Desired logo: fbsdbw, beastiebw, beastie, none
+#loader_logo="orbbw"   # Desired logo: orbbw, orb, fbsdbw, beastiebw, 
beastie, none
 #comconsole_speed="9600"   # Set the current serial console speed
 #console="vidconsole"  # A comma separated list of console(s)
 #currdev="disk1s1a"# Set the current device
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227728 - head/sys/mips/nlm

2011-11-19 Thread Jayachandran C.
Author: jchandra
Date: Sat Nov 19 15:01:09 2011
New Revision: 227728
URL: http://svn.freebsd.org/changeset/base/227728

Log:
  Remvoe unused file
  
  mips/nlm/uart_cpu_xlp.c has replaced uart_bus_xlp_iodi.c

Deleted:
  head/sys/mips/nlm/uart_bus_xlp_iodi.c
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227729 - head/sys/mips/nlm

2011-11-19 Thread Jayachandran C.
Author: jchandra
Date: Sat Nov 19 15:08:49 2011
New Revision: 227729
URL: http://svn.freebsd.org/changeset/base/227729

Log:
  Remove unused variable ubase.
  
  This vaiable is initialized but not used.

Modified:
  head/sys/mips/nlm/uart_pci_xlp.c

Modified: head/sys/mips/nlm/uart_pci_xlp.c
==
--- head/sys/mips/nlm/uart_pci_xlp.cSat Nov 19 15:01:09 2011
(r227728)
+++ head/sys/mips/nlm/uart_pci_xlp.cSat Nov 19 15:08:49 2011
(r227729)
@@ -69,13 +69,11 @@ static int
 uart_soc_probe(device_t dev)
 {
struct uart_softc *sc;
-   uint64_t ubase;
 
if (pci_get_vendor(dev) != PCI_VENDOR_NETLOGIC ||
pci_get_device(dev) != PCI_DEVICE_ID_NLM_UART)
return (ENXIO);
 
-   ubase = nlm_get_uart_regbase(0, 0);
sc = device_get_softc(dev);
sc->sc_class = &uart_ns8250_class;
device_set_desc(dev, "Netlogic SoC UART");
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227730 - in head/sys: arm/conf arm/mv boot/fdt/dts dev/cesa

2011-11-19 Thread Rafal Jaworowski
Author: raj
Date: Sat Nov 19 16:30:06 2011
New Revision: 227730
URL: http://svn.freebsd.org/changeset/base/227730

Log:
  Initial version of cesa(4) driver for Marvell crypto engine and security
  accelerator.
  
  The following algorithms and schemes are supported:
   - 3DES, AES, DES
   - MD5, SHA1
  
  Obtained from:Semihalf
  Written by:   Piotr Ziecik

Added:
  head/sys/dev/cesa/
  head/sys/dev/cesa/cesa.c   (contents, props changed)
  head/sys/dev/cesa/cesa.h   (contents, props changed)
Modified:
  head/sys/arm/conf/DB-88F6XXX
  head/sys/arm/conf/SHEEVAPLUG
  head/sys/arm/mv/files.mv
  head/sys/boot/fdt/dts/db88f6281.dts
  head/sys/boot/fdt/dts/sheevaplug.dts

Modified: head/sys/arm/conf/DB-88F6XXX
==
--- head/sys/arm/conf/DB-88F6XXXSat Nov 19 15:08:49 2011
(r227729)
+++ head/sys/arm/conf/DB-88F6XXXSat Nov 19 16:30:06 2011
(r227730)
@@ -66,6 +66,10 @@ device   mii
 device e1000phy
 device bpf
 
+device cesa# Marvell security engine
+device crypto
+device cryptodev
+
 # USB
 optionsUSB_DEBUG   # enable debug msgs
 device usb

Modified: head/sys/arm/conf/SHEEVAPLUG
==
--- head/sys/arm/conf/SHEEVAPLUGSat Nov 19 15:08:49 2011
(r227729)
+++ head/sys/arm/conf/SHEEVAPLUGSat Nov 19 16:30:06 2011
(r227730)
@@ -60,6 +60,10 @@ options  HZ=1000
 optionsDEVICE_POLLING
 device vlan
 
+device cesa# Marvell security engine
+device crypto
+device cryptodev
+
 # USB
 optionsUSB_DEBUG   # enable debug msgs
 device usb

Modified: head/sys/arm/mv/files.mv
==
--- head/sys/arm/mv/files.mvSat Nov 19 15:08:49 2011(r227729)
+++ head/sys/arm/mv/files.mvSat Nov 19 16:30:06 2011(r227730)
@@ -28,6 +28,7 @@ arm/mv/mv_sata.c  optionalata | atamvsa
 arm/mv/timer.c standard
 arm/mv/twsi.c  optionaliicbus
 
+dev/cesa/cesa.coptionalcesa
 dev/mge/if_mge.c   optionalmge
 dev/mvs/mvs_soc.c  optionalmvs
 dev/uart/uart_dev_ns8250.c optionaluart

Modified: head/sys/boot/fdt/dts/db88f6281.dts
==
--- head/sys/boot/fdt/dts/db88f6281.dts Sat Nov 19 15:08:49 2011
(r227729)
+++ head/sys/boot/fdt/dts/db88f6281.dts Sat Nov 19 16:30:06 2011
(r227730)
@@ -239,6 +239,8 @@
reg = <0x3 0x1>;
interrupts = <22>;
interrupt-parent = <&PIC>;
+
+   sram-handle = <&SRAM>;
};
 
usb@5 {

Modified: head/sys/boot/fdt/dts/sheevaplug.dts
==
--- head/sys/boot/fdt/dts/sheevaplug.dtsSat Nov 19 15:08:49 2011
(r227729)
+++ head/sys/boot/fdt/dts/sheevaplug.dtsSat Nov 19 16:30:06 2011
(r227730)
@@ -236,6 +236,8 @@
reg = <0x3 0x1>;
interrupts = <22>;
interrupt-parent = <&PIC>;
+
+   sram-handle = <&SRAM>;
};
 
usb@5 {

Added: head/sys/dev/cesa/cesa.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/cesa/cesa.cSat Nov 19 16:30:06 2011(r227730)
@@ -0,0 +1,1614 @@
+/*-
+ * Copyright (C) 2009-2011 Semihalf.
+ * 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;

svn commit: r227731 - head/share/misc

2011-11-19 Thread Michael Scheidell
Author: scheidell (ports committer)
Date: Sat Nov 19 16:47:26 2011
New Revision: 227731
URL: http://svn.freebsd.org/changeset/base/227731

Log:
  - Add myself
  
  Approved by:  gabor(mentor)

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

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotSat Nov 19 16:30:06 2011
(r227730)
+++ head/share/misc/committers-ports.dotSat Nov 19 16:47:26 2011
(r227731)
@@ -162,6 +162,7 @@ romain [label="Romain Tartiere\nromain@F
 sahil [label="Sahil Tandon\nsa...@freebsd.org\n2010/04/11"]
 sat [label="Andrew Pantyukhin\n...@freebsd.org\n2006/05/06"]
 sbz [label="Sofian Brabez\n...@freebsd.org\n2011/03/14"]
+scheidell [label="Michael Scheidell\nscheid...@freebsd.org\n2011/11/06"]
 sem [label="Sergey Matveychuk\n...@freebsd.org\n2004/07/07"]
 sergei [label="Sergei Kolobov\nser...@freebsd.org\n2003/10/21"]
 shaun [label="Shaun Amott\nsh...@freebsd.org\n2006/06/19"]
@@ -269,6 +270,7 @@ flz -> romain
 gabor -> lippe
 gabor -> pgj
 gabor -> stephen
+gabor -> scheidell
 
 garga -> acm
 garga -> alepulver
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227732 - stable/9/share/man/man4

2011-11-19 Thread Christian Brueffer
Author: brueffer
Date: Sat Nov 19 16:54:58 2011
New Revision: 227732
URL: http://svn.freebsd.org/changeset/base/227732

Log:
  MFC: r227465, r227515
  
  - Grammar and mdoc cleanup.
  - Remove list nesting in the hardware notes section, thus making it
compatible with the hardware notes generation script.
  
  Approved by:  re (kib)

Modified:
  stable/9/share/man/man4/mvs.4
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/mvs.4
==
--- stable/9/share/man/man4/mvs.4   Sat Nov 19 16:47:26 2011
(r227731)
+++ stable/9/share/man/man4/mvs.4   Sat Nov 19 16:54:58 2011
(r227732)
@@ -109,7 +109,8 @@ hardware command queues (up to 31 comman
 Native Command Queuing, SATA interface Power Management, device hot-plug
 and Message Signaled Interrupts.
 .Pp
-Same hardware is also supported by atamarvell and ataadaptec drivers from
+The same hardware is also supported by the atamarvell and ataadaptec
+drivers from the
 .Xr ata 4
 subsystem.
 If both drivers are loaded at the same time, this one will be
@@ -118,9 +119,9 @@ given precedence as the more functional 
 The
 .Nm
 driver supports the following controllers:
-.Bl -tag -compact
-.It Gen-I (SATA 1.5Gbps):
-.Bl -bullet -compact
+.Pp
+Gen-I (SATA 1.5Gbps):
+.Bl -bullet -compact -offset "xx"
 .It
 88SX5040
 .It
@@ -130,8 +131,9 @@ driver supports the following controller
 .It
 88SX5081
 .El
-.It Gen-II (SATA 3Gbps, NCQ, PMP):
-.Bl -bullet -compact
+.Pp
+Gen-II (SATA 3Gbps, NCQ, PMP):
+.Bl -bullet -compact -offset "xx"
 .It
 88SX6040
 .It
@@ -141,8 +143,9 @@ driver supports the following controller
 .It
 88SX6081
 .El
-.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS):
-.Bl -bullet -compact
+.Pp
+Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS):
+.Bl -bullet -compact -offset "xx"
 .It
 88SX6042
 .It
@@ -154,11 +157,10 @@ driver supports the following controller
 .It
 MV78100 SoC
 .El
-.El
-Note, that this hardware supports command queueing and FIS-based switching
-only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one
-for each port.
 .Pp
+Note, that this hardware supports command queueing and FIS-based switching
+only for ATA DMA commands.
+ATAPI and non-DMA ATA commands executed one by one for each port.
 .Sh SEE ALSO
 .Xr ada 4 ,
 .Xr ata 4 ,
@@ -172,4 +174,4 @@ The
 driver first appeared in
 .Fx 8.1 .
 .Sh AUTHORS
-.An Alexander Motin Aq m...@freebsd.org .
+.An Alexander Motin Aq m...@freebsd.org
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227733 - releng/9.0/share/man/man4

2011-11-19 Thread Christian Brueffer
Author: brueffer
Date: Sat Nov 19 16:59:23 2011
New Revision: 227733
URL: http://svn.freebsd.org/changeset/base/227733

Log:
  MFC: r227465, r227515
  
  - Grammar and mdoc cleanup.
  - Remove list nesting in the hardware notes section, thus making it
compatible with the hardware notes generation script.
  
  Approved by:re (kib)

Modified:
  releng/9.0/share/man/man4/mvs.4
Directory Properties:
  releng/9.0/share/man/man4/   (props changed)

Modified: releng/9.0/share/man/man4/mvs.4
==
--- releng/9.0/share/man/man4/mvs.4 Sat Nov 19 16:54:58 2011
(r227732)
+++ releng/9.0/share/man/man4/mvs.4 Sat Nov 19 16:59:23 2011
(r227733)
@@ -109,7 +109,8 @@ hardware command queues (up to 31 comman
 Native Command Queuing, SATA interface Power Management, device hot-plug
 and Message Signaled Interrupts.
 .Pp
-Same hardware is also supported by atamarvell and ataadaptec drivers from
+The same hardware is also supported by the atamarvell and ataadaptec
+drivers from the
 .Xr ata 4
 subsystem.
 If both drivers are loaded at the same time, this one will be
@@ -118,9 +119,9 @@ given precedence as the more functional 
 The
 .Nm
 driver supports the following controllers:
-.Bl -tag -compact
-.It Gen-I (SATA 1.5Gbps):
-.Bl -bullet -compact
+.Pp
+Gen-I (SATA 1.5Gbps):
+.Bl -bullet -compact -offset "xx"
 .It
 88SX5040
 .It
@@ -130,8 +131,9 @@ driver supports the following controller
 .It
 88SX5081
 .El
-.It Gen-II (SATA 3Gbps, NCQ, PMP):
-.Bl -bullet -compact
+.Pp
+Gen-II (SATA 3Gbps, NCQ, PMP):
+.Bl -bullet -compact -offset "xx"
 .It
 88SX6040
 .It
@@ -141,8 +143,9 @@ driver supports the following controller
 .It
 88SX6081
 .El
-.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS):
-.Bl -bullet -compact
+.Pp
+Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS):
+.Bl -bullet -compact -offset "xx"
 .It
 88SX6042
 .It
@@ -154,11 +157,10 @@ driver supports the following controller
 .It
 MV78100 SoC
 .El
-.El
-Note, that this hardware supports command queueing and FIS-based switching
-only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one
-for each port.
 .Pp
+Note, that this hardware supports command queueing and FIS-based switching
+only for ATA DMA commands.
+ATAPI and non-DMA ATA commands executed one by one for each port.
 .Sh SEE ALSO
 .Xr ada 4 ,
 .Xr ata 4 ,
@@ -172,4 +174,4 @@ The
 driver first appeared in
 .Fx 8.1 .
 .Sh AUTHORS
-.An Alexander Motin Aq m...@freebsd.org .
+.An Alexander Motin Aq m...@freebsd.org
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227734 - stable/8/share/man/man4

2011-11-19 Thread Christian Brueffer
Author: brueffer
Date: Sat Nov 19 17:01:11 2011
New Revision: 227734
URL: http://svn.freebsd.org/changeset/base/227734

Log:
  MFC: r227465, r227515
  
  - Grammar and mdoc cleanup.
  - Remove list nesting in the hardware notes section, thus making it
compatible with the hardware notes generation script.

Modified:
  stable/8/share/man/man4/mvs.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/mvs.4
==
--- stable/8/share/man/man4/mvs.4   Sat Nov 19 16:59:23 2011
(r227733)
+++ stable/8/share/man/man4/mvs.4   Sat Nov 19 17:01:11 2011
(r227734)
@@ -110,7 +110,8 @@ hardware command queues (up to 31 comman
 Native Command Queuing, SATA interface Power Management, device hot-plug
 and Message Signaled Interrupts.
 .Pp
-Same hardware is also supported by atamarvell and ataadaptec drivers from
+The same hardware is also supported by the atamarvell and ataadaptec
+drivers from the
 .Xr ata 4
 subsystem.
 If both drivers are loaded at the same time, this one will be
@@ -119,9 +120,9 @@ given precedence as the more functional 
 The
 .Nm
 driver supports the following controllers:
-.Bl -tag -compact
-.It Gen-I (SATA 1.5Gbps):
-.Bl -bullet -compact
+.Pp
+Gen-I (SATA 1.5Gbps):
+.Bl -bullet -compact -offset "xx"
 .It
 88SX5040
 .It
@@ -131,8 +132,9 @@ driver supports the following controller
 .It
 88SX5081
 .El
-.It Gen-II (SATA 3Gbps, NCQ, PMP):
-.Bl -bullet -compact
+.Pp
+Gen-II (SATA 3Gbps, NCQ, PMP):
+.Bl -bullet -compact -offset "xx"
 .It
 88SX6040
 .It
@@ -142,8 +144,9 @@ driver supports the following controller
 .It
 88SX6081
 .El
-.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS):
-.Bl -bullet -compact
+.Pp
+Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS):
+.Bl -bullet -compact -offset "xx"
 .It
 88SX6042
 .It
@@ -155,11 +158,10 @@ driver supports the following controller
 .It
 MV78100 SoC
 .El
-.El
-Note, that this hardware supports command queueing and FIS-based switching
-only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one
-for each port.
 .Pp
+Note, that this hardware supports command queueing and FIS-based switching
+only for ATA DMA commands.
+ATAPI and non-DMA ATA commands executed one by one for each port.
 .Sh SEE ALSO
 .Xr ada 4 ,
 .Xr ata 4 ,
@@ -173,4 +175,4 @@ The
 driver first appeared in
 .Fx 8.1 .
 .Sh AUTHORS
-.An Alexander Motin Aq m...@freebsd.org .
+.An Alexander Motin Aq m...@freebsd.org
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227735 - in head/contrib/llvm/tools/clang: include/clang/Basic lib/Sema

2011-11-19 Thread Dimitry Andric
Author: dim
Date: Sat Nov 19 17:09:36 2011
New Revision: 227735
URL: http://svn.freebsd.org/changeset/base/227735

Log:
  Pull in r144110 from upstream clang trunk:
  
  Mark the overloaded atomic builtins as having custom type checking,
  which they do. This avoids all of the default argument promotions that
  we (1) don't want, and (2) undo during that custom type checking, and
  makes sure that we don't run into trouble during template
  instantiation. Fixes llvm/clang PR11320.
  
  MFC after:1 week

Modified:
  head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def
  head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp

Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def
==
--- head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def  Sat Nov 
19 17:01:11 2011(r227734)
+++ head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def  Sat Nov 
19 17:09:36 2011(r227735)
@@ -480,111 +480,111 @@ BUILTIN(__builtin_alloca, "v*z"   , "n")
 // FIXME: These assume that char -> i8, short -> i16, int -> i32,
 // long long -> i64.
 
-BUILTIN(__sync_fetch_and_add, "v.", "")
-BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "n")
-BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "n")
-BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "n")
-BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "n")
-
-BUILTIN(__sync_fetch_and_sub, "v.", "")
-BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "n")
-BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "n")
-BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "n")
-BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "n")
-
-BUILTIN(__sync_fetch_and_or, "v.", "")
-BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "n")
-BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "n")
-BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "n")
-BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "n")
-
-BUILTIN(__sync_fetch_and_and, "v.", "")
-BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "n")
-BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "n")
-BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "n")
-BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "n")
-
-BUILTIN(__sync_fetch_and_xor, "v.", "")
-BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "n")
-BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "n")
-BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "n")
-BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "n")
-
-
-BUILTIN(__sync_add_and_fetch, "v.", "")
-BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "n")
-BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "n")
-BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "n")
-BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
-
-BUILTIN(__sync_sub_and_fetch, "v.", "")
-BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "n")
-BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "n")
-BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "n")
-BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
-
-BUILTIN(__sync_or_and_fetch, "v.", "")
-BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "n")
-BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "n")
-BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "n")
-BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
-
-BUILTIN(__sync_and_and_fetch, "v.", "")
-BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "n")
-BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "n")
-BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "n")
-BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
-
-BUILTIN(__sync_xor_and_fetch, "v.", "")
-BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "n")
-BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "n")
-BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "n")
-BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "n")
-BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
-
-BUILTIN(__sync_bool_compare_and_swap, "v.", "")
-BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "n")
-BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss.", "n")
-BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii.", "n")
-BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi.", "n")
-BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi.", "n")
-
-BUILTIN(__sync_val_compare_and_swap, "v.", "")
-BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc.", "n")
-BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss.", "n")
-BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii.", "n")
-BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "n")
-BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "n")
-
-BUILTIN(__sync_lock_test_and_set, "v.", "")
-BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "n")
-BUILTIN(__sync_lock_test_and_set_

svn commit: r227736 - head/contrib/llvm/tools/clang/include/clang/Basic

2011-11-19 Thread Dimitry Andric
Author: dim
Date: Sat Nov 19 17:15:20 2011
New Revision: 227736
URL: http://svn.freebsd.org/changeset/base/227736

Log:
  Pull in r144237 from upstream clang trunk:
  
  Fix the signature of __sigsetjmp and sigsetjmp.  This eliminates
  incorrect warnings about the prototypes of these functions.
  
  MFC after:1 week

Modified:
  head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def

Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def
==
--- head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def  Sat Nov 
19 17:09:36 2011(r227735)
+++ head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def  Sat Nov 
19 17:15:20 2011(r227736)
@@ -679,9 +679,9 @@ LIBBUILTIN(vfork, "i","fj", 
 // it here to avoid having two identical LIBBUILTIN entries.
 #undef setjmp
 LIBBUILTIN(_setjmp, "iJ", "fj",   "setjmp.h", ALL_LANGUAGES)
-LIBBUILTIN(__sigsetjmp, "iJi","fj",   "setjmp.h", ALL_LANGUAGES)
+LIBBUILTIN(__sigsetjmp, "iSJi",   "fj",   "setjmp.h", ALL_LANGUAGES)
 LIBBUILTIN(setjmp, "iJ",  "fj",   "setjmp.h", ALL_LANGUAGES)
-LIBBUILTIN(sigsetjmp, "iJi",  "fj",   "setjmp.h", ALL_LANGUAGES)
+LIBBUILTIN(sigsetjmp, "iSJi", "fj",   "setjmp.h", ALL_LANGUAGES)
 LIBBUILTIN(setjmp_syscall, "iJ",  "fj",   "setjmp.h", ALL_LANGUAGES)
 LIBBUILTIN(savectx, "iJ", "fj",   "setjmp.h", ALL_LANGUAGES)
 LIBBUILTIN(qsetjmp, "iJ", "fj",   "setjmp.h", ALL_LANGUAGES)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227737 - in head/contrib/llvm/tools/clang: include/clang/AST include/clang/Basic include/clang/Serialization lib/AST lib/Sema lib/Serialization

2011-11-19 Thread Dimitry Andric
Author: dim
Date: Sat Nov 19 18:01:14 2011
New Revision: 227737
URL: http://svn.freebsd.org/changeset/base/227737

Log:
  Pull in r144505 from upstream clang trunk:
  
  Fix the signature of the getcontext builtin, eliminating incorrect
  warnings about its prototype.
  
  This also adds a -W(no-)builtin-requires-header option, which can be
  used to enable or disable warnings of this kind.
  
  MFC after:1 week

Modified:
  head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h
  head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def
  head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td
  head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
  head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h
  head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp
  head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
  head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp

Modified: head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h
==
--- head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.hSat Nov 
19 17:15:20 2011(r227736)
+++ head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.hSat Nov 
19 18:01:14 2011(r227737)
@@ -229,6 +229,9 @@ class ASTContext : public llvm::RefCount
   /// \brief The type for the C sigjmp_buf type.
   TypeDecl *sigjmp_bufDecl;
 
+  /// \brief The type for the C ucontext_t type.
+  TypeDecl *ucontext_tDecl;
+
   /// \brief Type for the Block descriptor for Blocks CodeGen.
   ///
   /// Since this is only used for generation of debug info, it is not
@@ -955,6 +958,18 @@ public:
 return QualType();
   }
 
+  /// \brief Set the type for the C ucontext_t type.
+  void setucontext_tDecl(TypeDecl *ucontext_tDecl) {
+this->ucontext_tDecl = ucontext_tDecl;
+  }
+
+  /// \brief Retrieve the C ucontext_t type.
+  QualType getucontext_tType() const {
+if (ucontext_tDecl)
+  return getTypeDeclType(ucontext_tDecl);
+return QualType();
+  }
+
   /// \brief The result type of logical operations, '<', '>', '!=', etc.
   QualType getLogicalOperationType() const {
 return getLangOptions().CPlusPlus ? BoolTy : IntTy;
@@ -1099,7 +1114,8 @@ public:
   enum GetBuiltinTypeError {
 GE_None,  //< No error
 GE_Missing_stdio, //< Missing a type from 
-GE_Missing_setjmp //< Missing a type from 
+GE_Missing_setjmp,//< Missing a type from 
+GE_Missing_ucontext   //< Missing a type from 
   };
 
   /// GetBuiltinType - Return the type for the specified builtin.  If 

Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def
==
--- head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def  Sat Nov 
19 17:15:20 2011(r227736)
+++ head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def  Sat Nov 
19 18:01:14 2011(r227737)
@@ -39,6 +39,7 @@
 //  P -> FILE
 //  J -> jmp_buf
 //  SJ -> sigjmp_buf
+//  K -> ucontext_t
 //  . -> "...".  This may only occur at the end of the function list.
 //
 // Types may be prefixed with the following modifiers:
@@ -685,7 +686,7 @@ LIBBUILTIN(sigsetjmp, "iSJi", "fj", 
 LIBBUILTIN(setjmp_syscall, "iJ",  "fj",   "setjmp.h", ALL_LANGUAGES)
 LIBBUILTIN(savectx, "iJ", "fj",   "setjmp.h", ALL_LANGUAGES)
 LIBBUILTIN(qsetjmp, "iJ", "fj",   "setjmp.h", ALL_LANGUAGES)
-LIBBUILTIN(getcontext, "iJ",  "fj",   "setjmp.h", ALL_LANGUAGES)
+LIBBUILTIN(getcontext, "iK*", "fj",   "setjmp.h", ALL_LANGUAGES)
 
 LIBBUILTIN(_longjmp, "vJi",   "fr","setjmp.h", ALL_LANGUAGES)
 LIBBUILTIN(siglongjmp, "vSJi","fr","setjmp.h", ALL_LANGUAGES)

Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td
==
--- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td   
Sat Nov 19 17:15:20 2011(r227736)
+++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td   
Sat Nov 19 18:01:14 2011(r227737)
@@ -26,6 +26,7 @@ def : DiagGroup<"attributes">;
 def : DiagGroup<"bad-function-cast">;
 def Availability : DiagGroup<"availability">;
 def BoolConversions : DiagGroup<"bool-conversions">;
+def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
 def CXXCompat: DiagGroup<"c++-compat">;
 def CastAlign : DiagGroup<"cast-align">;
 def : DiagGroup<"cast-qual">;

Modified: 
head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
==
--- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
Sat Nov 19 17:15:20 2011(r227736)
+++ head/contrib/llvm/tools/clang/inc

svn commit: r227738 - head/sbin/ifconfig

2011-11-19 Thread Gleb Smirnoff
Author: glebius
Date: Sat Nov 19 19:06:08 2011
New Revision: 227738
URL: http://svn.freebsd.org/changeset/base/227738

Log:
  For unknown reason, since rev 1.1 of ifconfig.c, sin_family isn't
  set properly for the mask argument.
  
  Since I'd like to improve argument sanity checking in kernel
  side, in in_control(), fix this.

Modified:
  head/sbin/ifconfig/af_inet.c

Modified: head/sbin/ifconfig/af_inet.c
==
--- head/sbin/ifconfig/af_inet.cSat Nov 19 18:01:14 2011
(r227737)
+++ head/sbin/ifconfig/af_inet.cSat Nov 19 19:06:08 2011
(r227738)
@@ -104,8 +104,7 @@ in_getaddr(const char *s, int which)
struct netent *np;
 
sin->sin_len = sizeof(*sin);
-   if (which != MASK)
-   sin->sin_family = AF_INET;
+   sin->sin_family = AF_INET;
 
if (which == ADDR) {
char *p = NULL;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227739 - in head: . contrib/binutils/ld/emulparams contrib/gcc/config/rs6000 contrib/llvm/tools/clang/lib/Driver gnu/usr.bin/binutils/ld sys/boot/ofw sys/boot/powerpc sys/boot/uboot

2011-11-19 Thread Andreas Tobler
Author: andreast
Date: Sat Nov 19 19:25:57 2011
New Revision: 227739
URL: http://svn.freebsd.org/changeset/base/227739

Log:
  Rename the linker emulation name for powerpc and powerc64. This is needed that
  we can also use the upstream binutils linker where we have to have a unique
  name for the FreeBSD emulation.

Added:
  head/contrib/binutils/ld/emulparams/elf64ppc_fbsd.sh   (contents, props 
changed)
Modified:
  head/Makefile.inc1
  head/contrib/gcc/config/rs6000/freebsd.h
  head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
  head/gnu/usr.bin/binutils/ld/Makefile.powerpc
  head/gnu/usr.bin/binutils/ld/Makefile.powerpc64
  head/sys/boot/ofw/Makefile.inc
  head/sys/boot/powerpc/Makefile.inc
  head/sys/boot/uboot/Makefile.inc

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Nov 19 19:06:08 2011(r227738)
+++ head/Makefile.inc1  Sat Nov 19 19:25:57 2011(r227739)
@@ -291,7 +291,7 @@ LIB32CPUFLAGS=  -mcpu=powerpc
 LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE}
 .endif
 LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc \
-   LD="${LD} -m elf32ppc"
+   LD="${LD} -m elf32ppc_fbsd"
 .endif
 
 

Added: head/contrib/binutils/ld/emulparams/elf64ppc_fbsd.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/binutils/ld/emulparams/elf64ppc_fbsd.shSat Nov 19 
19:25:57 2011(r227739)
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf64ppc.sh
+. ${srcdir}/emulparams/elf_fbsd.sh
+

Modified: head/contrib/gcc/config/rs6000/freebsd.h
==
--- head/contrib/gcc/config/rs6000/freebsd.hSat Nov 19 19:06:08 2011
(r227738)
+++ head/contrib/gcc/config/rs6000/freebsd.hSat Nov 19 19:25:57 2011
(r227739)
@@ -193,7 +193,7 @@ extern int dot_symbols;
 #undef LINK_OS_FREEBSD_SPEC
 #defineASM_DEFAULT_SPEC"-mppc%{!m32:64}"
 #defineASM_SPEC"%{m32:-a32}%{!m32:-a64} " SVR4_ASM_SPEC
-#defineLINK_OS_FREEBSD_SPEC"%{m32:-melf32ppc}%{!m32:-melf64ppc} " 
LINK_OS_FREEBSD_SPEC_DEF
+#defineLINK_OS_FREEBSD_SPEC
"%{m32:-melf32ppc_fbsd}%{!m32:-melf64ppc_fbsd} " LINK_OS_FREEBSD_SPEC_DEF
 #endif
 
 /* _init and _fini functions are built from bits spread across many

Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==
--- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Sat Nov 19 19:06:08 
2011(r227738)
+++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Sat Nov 19 19:25:57 
2011(r227739)
@@ -3926,7 +3926,7 @@ void freebsd::Link::ConstructJob(Compila
 
   if (getToolChain().getArchName() == "powerpc") {
 CmdArgs.push_back("-m");
-CmdArgs.push_back("elf32ppc");
+CmdArgs.push_back("elf32ppc_fbsd");
   }
 
   if (Output.isFilename()) {

Modified: head/gnu/usr.bin/binutils/ld/Makefile.powerpc
==
--- head/gnu/usr.bin/binutils/ld/Makefile.powerpc   Sat Nov 19 19:06:08 
2011(r227738)
+++ head/gnu/usr.bin/binutils/ld/Makefile.powerpc   Sat Nov 19 19:25:57 
2011(r227739)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-NATIVE_EMULATION=  elf32ppc
+NATIVE_EMULATION=  elf32ppc_fbsd
 
 SRCS+= e${NATIVE_EMULATION}.c
 CLEANFILES+=   e${NATIVE_EMULATION}.c

Modified: head/gnu/usr.bin/binutils/ld/Makefile.powerpc64
==
--- head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 Sat Nov 19 19:06:08 
2011(r227738)
+++ head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 Sat Nov 19 19:25:57 
2011(r227739)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-NATIVE_EMULATION=  elf64ppc
+NATIVE_EMULATION=  elf64ppc_fbsd
 
 SRCS+= e${NATIVE_EMULATION}.c
 CLEANFILES+=   e${NATIVE_EMULATION}.c
@@ -11,7 +11,7 @@ e${NATIVE_EMULATION}.c: emulparams/${NAT
${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
${NATIVE_EMULATION} ""  no ${NATIVE_EMULATION} ${TARGET_TUPLE}
 
-PPC32_EMULATION= elf32ppc
+PPC32_EMULATION= elf32ppc_fbsd
 _ppc32_path=   \"${TOOLS_PREFIX}/usr/lib32\"
 EMS+=  ${PPC32_EMULATION}
 .for ext in ${ELF_SCR_EXT}

Modified: head/sys/boot/ofw/Makefile.inc
==
--- head/sys/boot/ofw/Makefile.inc  Sat Nov 19 19:06:08 2011
(r227738)
+++ head/sys/boot/ofw/Makefile.inc  Sat Nov 19 19:25:57 2011
(r227739)
@@ -2,7 +2,7 @@
 
 .if ${MACHINE_ARCH} == "powerpc64"
 CFLAGS+=   -m32 -mcpu=powerpc
-LDFLAGS+=  -m elf32ppc
+LDFLAGS+=  -m elf32ppc_fbsd
 .endif
 
 .include "../Makefile.inc"

Modified: head/sys/boot/powerpc/Makefile.inc
===

svn commit: r227740 - head/sys/dev/ath

2011-11-19 Thread Adrian Chadd
Author: adrian
Date: Sat Nov 19 21:05:31 2011
New Revision: 227740
URL: http://svn.freebsd.org/changeset/base/227740

Log:
  Begin breaking apart the receive setup/stop path in preparation for more
  "correct" handling of frames in the RX pending queue during interface
  transitions.
  
  * ath_stoprecv() doesn't blank out the descriptor list - that's what
ath_startrecv() does. So, change a comment to reflect that.
  
  * ath_stoprecv() does include a large (3ms) delay to let pending DMA
complete. However, I'm under the impression that the stopdma hal
method does check for a bit in the PCU to indicate DMA has stopped.
So, to help with fast abort and restart, modify ath_stoprecv() to take
a flag which indicates whether this is needed.
  
  * Modify the uses of ath_stoprecv() to pass in a flag to support the
existing behaviour (ie, do the delay.)
  
  * Remove some duplicate PCU teardown code (which wasn't shutting down DMA,
so it wasn't entirely correct..) and replace it with a call to
ath_stoprecv(sc, 0) - which disables the DELAY call.
  
  The upshoot of this is now channel change doesn't simply drop completed
  frames on the floor, but instead it cleanly handles those frames.
  It still discards pending TX frames in the software and hardware queues
  as there's no (current) logic which forcibly recalculates the rate control
  information (or whether they're appropriate to be on the TX queue after
  a channel change), that'll come later.
  
  This still doesn't stop all the sources of queue stalls but it does
  tidy up some of the code duplication.
  
  To be complete, queue stalls now occur during normal behaviour -
  they only occur after some kind of broken behaviour causes an interface
  or node flush, upsetting the TX/RX BAW. Subsequent commits will
  incrementally fix these and other related issues.
  
  Sponsored by: Hobnob, Inc.

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

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Sat Nov 19 19:25:57 2011(r227739)
+++ head/sys/dev/ath/if_ath.c   Sat Nov 19 21:05:31 2011(r227740)
@@ -188,7 +188,7 @@ static void ath_tx_proc_q0123(void *, in
 static voidath_tx_proc(void *, int);
 static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *);
 static voidath_draintxq(struct ath_softc *, ATH_RESET_TYPE reset_type);
-static voidath_stoprecv(struct ath_softc *);
+static voidath_stoprecv(struct ath_softc *, int);
 static int ath_startrecv(struct ath_softc *);
 static voidath_chan_change(struct ath_softc *, struct ieee80211_channel *);
 static voidath_scan_start(struct ieee80211com *);
@@ -1153,7 +1153,7 @@ ath_vap_delete(struct ieee80211vap *vap)
ath_hal_intrset(ah, 0); /* disable interrupts */
ath_draintxq(sc, ATH_RESET_DEFAULT);/* stop hw xmit 
side */
/* XXX Do all frames from all vaps/nodes need draining here? */
-   ath_stoprecv(sc);   /* stop recv side */
+   ath_stoprecv(sc, 1);/* stop recv side */
}
 
ieee80211_vap_detach(vap);
@@ -1849,7 +1849,7 @@ ath_stop_locked(struct ifnet *ifp)
}
ath_draintxq(sc, ATH_RESET_DEFAULT);
if (!sc->sc_invalid) {
-   ath_stoprecv(sc);
+   ath_stoprecv(sc, 1);
ath_hal_phydisable(ah);
} else
sc->sc_rxlink = NULL;
@@ -1943,11 +1943,11 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T
ATH_PCU_UNLOCK(sc);
 
/*
-* XXX should now wait for pending TX/RX to complete
-* and block future ones from occuring.
+* Should now wait for pending TX/RX to complete
+* and block future ones from occuring. This needs to be
+* done before the TX queue is drained.
 */
ath_txrx_stop(sc);
-
ath_draintxq(sc, reset_type);   /* stop xmit side */
 
/*
@@ -1955,19 +1955,9 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T
 * not, stop the PCU and handle what's in the RX queue.
 * That way frames aren't dropped which shouldn't be.
 */
-   ath_hal_stoppcurecv(ah);
-   ath_hal_setrxfilter(ah, 0);
+   ath_stoprecv(sc, (reset_type != ATH_RESET_NOLOSS));
ath_rx_proc(sc, 0);
 
-   /*
-* If we're not doing a noloss reset, now call ath_stoprecv().
-* This fully stops all of the RX machinery and flushes whatever
-* frames are in the RX ring buffer. Hopefully all completed
-* frames have been handled at this point.
-*/
-   if (reset_type != ATH_RESET_NOLOSS)
-   ath_stoprecv(sc);   /* stop recv side */
-
ath_settkipmic(sc); /* configure TKIP MIC handling */
/* NB: indicate channel change so we 

svn commit: r227741 - head/sys/dev/ath/ath_hal/ar5416

2011-11-19 Thread Adrian Chadd
Author: adrian
Date: Sat Nov 19 21:12:35 2011
New Revision: 227741
URL: http://svn.freebsd.org/changeset/base/227741

Log:
  Add some (totally untested!) code to correctly set the RF half/quarter
  mode configuration registers. This is apparently required for correct
  behaviour, but also requires the chip to actually officially support it.
  
  Sponsored by: Hobnob, Inc.

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

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Sat Nov 19 21:05:31 
2011(r227740)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Sat Nov 19 21:12:35 
2011(r227741)
@@ -724,6 +724,20 @@ ar5416SetRfMode(struct ath_hal *ah, cons
rfMode |= IEEE80211_IS_CHAN_5GHZ(chan) ?
AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ;
}
+
+   /*
+* Set half/quarter mode flags if required.
+*
+* This doesn't change the IFS timings at all; that needs to
+* be done as part of the MAC setup.  Similarly, the PLL
+* configuration also needs some changes for the half/quarter
+* rate clock.
+*/
+   if (IEEE80211_IS_CHAN_HALF(chan))
+   rfMode |= AR_PHY_MODE_HALF;
+   else if (IEEE80211_IS_CHAN_QUARTER(chan))
+   rfMode |= AR_PHY_MODE_QUARTER;
+
OS_REG_WRITE(ah, AR_PHY_MODE, rfMode);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227742 - head/release/doc/en_US.ISO8859-1/hardware

2011-11-19 Thread Christian Brueffer
Author: brueffer
Date: Sat Nov 19 22:14:08 2011
New Revision: 227742
URL: http://svn.freebsd.org/changeset/base/227742

Log:
  Add 2010 and 2011 copyrights.

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.sgml

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml
==
--- head/release/doc/en_US.ISO8859-1/hardware/article.sgml  Sat Nov 19 
21:12:35 2011(r227741)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml  Sat Nov 19 
22:14:08 2011(r227742)
@@ -30,6 +30,8 @@
   2007
   2008
   2009
+  2010
+  2011
   mailto:d...@freebsd.org";>The &os; Documentation 
Project
 
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227743 - in head/sys/fs: nfs nfsclient

2011-11-19 Thread Rick Macklem
Author: rmacklem
Date: Sun Nov 20 00:39:15 2011
New Revision: 227743
URL: http://svn.freebsd.org/changeset/base/227743

Log:
  Post r223774 the NFSv4 client never uses the linked list with the
  head nfsc_defunctlockowner. This patch simply removes the code that
  loops through this always empty list, since the code no longer does
  anything useful. It should not have any effect on the client's
  behaviour.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfs/nfsclstate.h
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfs/nfsclstate.h
==
--- head/sys/fs/nfs/nfsclstate.hSat Nov 19 22:14:08 2011
(r227742)
+++ head/sys/fs/nfs/nfsclstate.hSun Nov 20 00:39:15 2011
(r227743)
@@ -48,7 +48,6 @@ struct nfsclclient {
struct nfsclownerhead   nfsc_owner;
struct nfscldeleghead   nfsc_deleg;
struct nfscldeleghash   nfsc_deleghash[NFSCLDELEGHASHSIZE];
-   struct nfscllockownerhead nfsc_defunctlockowner;
struct nfsv4lock nfsc_lock;
struct proc *nfsc_renewthread;
struct nfsmount *nfsc_nmp;

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==
--- head/sys/fs/nfsclient/nfs_clstate.c Sat Nov 19 22:14:08 2011
(r227742)
+++ head/sys/fs/nfsclient/nfs_clstate.c Sun Nov 20 00:39:15 2011
(r227743)
@@ -699,7 +699,6 @@ nfscl_getcl(vnode_t vp, struct ucred *cr
 {
struct nfsclclient *clp;
struct nfsclclient *newclp = NULL;
-   struct nfscllockowner *lp, *nlp;
struct mount *mp;
struct nfsmount *nmp;
char uuid[HOSTUUIDLEN];
@@ -744,7 +743,6 @@ nfscl_getcl(vnode_t vp, struct ucred *cr
TAILQ_INIT(&clp->nfsc_deleg);
for (i = 0; i < NFSCLDELEGHASHSIZE; i++)
LIST_INIT(&clp->nfsc_deleghash[i]);
-   LIST_INIT(&clp->nfsc_defunctlockowner);
clp->nfsc_flags = NFSCLFLAGS_INITED;
clp->nfsc_clientidrev = 1;
clp->nfsc_cbident = nfscl_nextcbident();
@@ -793,11 +791,6 @@ nfscl_getcl(vnode_t vp, struct ucred *cr
NFSUNLOCKCLSTATE();
return (EACCES);
}
-   /* get rid of defunct lockowners */
-   LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list,
-   nlp) {
-   nfscl_freelockowner(lp, 0);
-   }
/*
 * If RFC3530 Sec. 14.2.33 is taken literally,
 * NFSERR_CLIDINUSE will be returned persistently for the
@@ -1537,13 +1530,6 @@ nfscl_cleanclient(struct nfsclclient *cl
 {
struct nfsclowner *owp, *nowp;
struct nfsclopen *op, *nop;
-   struct nfscllockowner *lp, *nlp;
-
-
-   /* get rid of defunct lockowners */
-   LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list, nlp) {
-   nfscl_freelockowner(lp, 0);
-   }
 
/* Now, all the OpenOwners, etc. */
LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) {
@@ -1717,12 +1703,6 @@ nfscl_cleanup_common(struct nfsclclient 
}
owp = nowp;
}
-
-   /* and check the defunct list */
-   LIST_FOREACH(lp, &clp->nfsc_defunctlockowner, nfsl_list) {
-   if (!NFSBCMP(lp->nfsl_owner, own, NFSV4CL_LOCKNAMELEN))
-   lp->nfsl_defunct = 1;
-   }
 }
 
 #if defined(APPLEKEXT) || defined(__FreeBSD__)
@@ -1735,7 +1715,6 @@ static void
 nfscl_cleanupkext(struct nfsclclient *clp)
 {
struct nfsclowner *owp, *nowp;
-   struct nfscllockowner *lp;
 
NFSPROCLISTLOCK();
NFSLOCKCLSTATE();
@@ -1743,12 +1722,6 @@ nfscl_cleanupkext(struct nfsclclient *cl
if (nfscl_procdoesntexist(owp->nfsow_owner))
nfscl_cleanup_common(clp, owp->nfsow_owner);
}
-
-   /* and check the defunct list */
-   LIST_FOREACH(lp, &clp->nfsc_defunctlockowner, nfsl_list) {
-   if (nfscl_procdoesntexist(lp->nfsl_owner))
-   lp->nfsl_defunct = 1;
-   }
NFSUNLOCKCLSTATE();
NFSPROCLISTUNLOCK();
 }
@@ -1905,11 +1878,6 @@ nfscl_recover(struct nfsclclient *clp, s
NFSUNLOCKREQ();
splx(s);
 
-   /* get rid of defunct lockowners */
-   LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list, nlp) {
-   nfscl_freelockowner(lp, 0);
-   }
-
/*
 * Now, mark all delegations "need reclaim".
 */
@@ -2157,7 +2125,6 @@ nfscl_recover(struct nfsclclient *clp, s
 APPLESTATIC int
 nfscl_hasexpired(struct nfsclclient *clp, u_int32_t clidrev, NFSPROC_T *p)
 {
-   struct nfscllockowner *lp, *nlp;
struct nfsmount *nmp;
struct ucred *cred;
int igotlock = 0, error, trycnt;
@@ -2207,12 +2174,6 @@ nfscl_hasexpired(struct

svn commit: r227744 - head/sys/fs/nfsclient

2011-11-19 Thread Rick Macklem
Author: rmacklem
Date: Sun Nov 20 01:18:47 2011
New Revision: 227744
URL: http://svn.freebsd.org/changeset/base/227744

Log:
  Since the nfscl_cleanup() function isn't used by the FreeBSD NFSv4 client,
  delete the code and fix up the related comments. This should not have
  any functional effect on the client.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==
--- head/sys/fs/nfsclient/nfs_clstate.c Sun Nov 20 00:39:15 2011
(r227743)
+++ head/sys/fs/nfsclient/nfs_clstate.c Sun Nov 20 01:18:47 2011
(r227744)
@@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$");
  * the granularity of the OpenOwner, then code must be added to
  * serialize Ops on the OpenOwner.)
  * - When to get rid of OpenOwners and LockOwners.
- *   - When a process exits, it calls nfscl_cleanup(), which goes
- * through the client list looking for all Open and Lock Owners.
+ *   - The function nfscl_cleanup_common() is executed after a process exits.
+ * It goes through the client list looking for all Open and Lock Owners.
  * When one is found, it is marked "defunct" or in the case of
  * an OpenOwner without any Opens, freed.
  * The renew thread scans for defunct Owners and gets rid of them,
@@ -1630,33 +1630,9 @@ nfscl_expireclient(struct nfsclclient *c
}
 }
 
-#ifndef__FreeBSD__
 /*
- * Called from exit() upon process termination.
- */
-APPLESTATIC void
-nfscl_cleanup(NFSPROC_T *p)
-{
-   struct nfsclclient *clp;
-   u_int8_t own[NFSV4CL_LOCKNAMELEN];
-
-   if (!nfscl_inited)
-   return;
-   nfscl_filllockowner(p->td_proc, own, F_POSIX);
-
-   NFSLOCKCLSTATE();
-   /*
-* Loop through all the clientids, looking for the OpenOwners.
-*/
-   LIST_FOREACH(clp, &nfsclhead, nfsc_list)
-   nfscl_cleanup_common(clp, own);
-   NFSUNLOCKCLSTATE();
-}
-#endif /* !__FreeBSD__ */
-
-/*
- * Common code used by nfscl_cleanup() and nfscl_cleanupkext().
- * Must be called with CLSTATE lock held.
+ * This function must be called after the process represented by "own" has
+ * exited. Must be called with CLSTATE lock held.
  */
 static void
 nfscl_cleanup_common(struct nfsclclient *clp, u_int8_t *own)
@@ -1707,9 +1683,7 @@ nfscl_cleanup_common(struct nfsclclient 
 
 #if defined(APPLEKEXT) || defined(__FreeBSD__)
 /*
- * Simulate the call nfscl_cleanup() by looking for open owners associated
- * with processes that no longer exist, since a call to nfscl_cleanup()
- * can't be patched into exit().
+ * Find open/lock owners for processes that have exited.
  */
 static void
 nfscl_cleanupkext(struct nfsclclient *clp)
@@ -2556,8 +2530,8 @@ tryagain:
 
 #if defined(APPLEKEXT) || defined(__FreeBSD__)
/*
-* Simulate the calls to nfscl_cleanup() when a process
-* exits, since the call can't be patched into exit().
+* Call nfscl_cleanupkext() once per second to check for
+* open/lock owners where the process has exited.
 */
{
struct timespec mytime;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r227745 - in head/sys: conf kern sys

2011-11-19 Thread Lawrence Stewart
Author: lstewart
Date: Sun Nov 20 01:20:50 2011
New Revision: 227745
URL: http://svn.freebsd.org/changeset/base/227745

Log:
  Provide high-level functions to access the feed-forward absolute and 
difference
  clocks. Each routine can output an upper bound on the absolute time or time
  interval requested. Different flavours of absolute time can be requested, for
  example with or without leap seconds, monotonic or not, etc.
  
  Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
  Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward
  Clock Synchronization Algorithms" project.
  
  For more information, see http://www.synclab.org/radclock/
  
  Submitted by: Julien Ridoux (jridoux at unimelb edu au)

Added:
  head/sys/kern/kern_ffclock.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/sys/timeffc.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sun Nov 20 01:18:47 2011(r227744)
+++ head/sys/conf/files Sun Nov 20 01:20:50 2011(r227745)
@@ -2341,6 +2341,7 @@ kern/kern_event.c standard
 kern/kern_exec.c   standard
 kern/kern_exit.c   standard
 kern/kern_fail.c   standard
+kern/kern_ffclock.coptional ffclock
 kern/kern_fork.c   standard
 kern/kern_gzio.c   optional gzio
 kern/kern_hhook.c  standard

Added: head/sys/kern/kern_ffclock.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/kern/kern_ffclock.cSun Nov 20 01:20:50 2011
(r227745)
@@ -0,0 +1,129 @@
+/*-
+ * Copyright (c) 2011 The University of Melbourne
+ * All rights reserved.
+ *
+ * This software was developed by Julien Ridoux at the University of Melbourne
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * 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.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+
+extern struct ffclock_estimate ffclock_estimate;
+extern struct bintime ffclock_boottime;
+
+/*
+ * Feed-forward clock absolute time. This should be the preferred way to read
+ * the feed-forward clock for "wall-clock" type time. The flags allow to 
compose
+ * various flavours of absolute time (e.g. with or without leap seconds taken
+ * into account). If valid pointers are provided, the ffcounter value and an
+ * upper bound on clock error associated with the bintime are provided.
+ * NOTE: use ffclock_convert_abs() to differ the conversion of a ffcounter 
value
+ * read earlier.
+ */
+void
+ffclock_abstime(ffcounter *ffcount, struct bintime *bt,
+struct bintime *error_bound, uint32_t flags)
+{
+   struct ffclock_estimate cest;
+   ffcounter ffc;
+   ffcounter update_ffcount;
+   ffcounter ffdelta_error;
+
+   /* Get counter and corresponding time. */
+   if ((flags & FFCLOCK_FAST) == FFCLOCK_FAST)
+   ffclock_last_tick(&ffc, bt, flags);
+   else {
+   ffclock_read_counter(&ffc);
+   ffclock_convert_abs(ffc, bt, flags);
+   }
+
+   /* Current ffclock estimate, use update_ffcount as generation number. */
+   do {
+   update_ffcount = ffclock_estimate.update_ffcount;
+   bcopy(&ffclock_estimate, &cest, sizeof(struct 
ffclock_estimate));
+   } while (update_ffcount != ffclock_estimate.update_ffcount);
+
+   /*
+* Leap second adjustment. Total as seen by synchronisation algorithm
+* since it started. cest.leapsec_next is the ffcounter prediction of
+* when the next le

svn commit: r227746 - head/sys/sys

2011-11-19 Thread Lawrence Stewart
Author: lstewart
Date: Sun Nov 20 01:48:22 2011
New Revision: 227746
URL: http://svn.freebsd.org/changeset/base/227746

Log:
  Fix a whitespace nit.
  
  Submitted by: Julien Ridoux (jridoux at unimelb edu au)

Modified:
  head/sys/sys/timeffc.h

Modified: head/sys/sys/timeffc.h
==
--- head/sys/sys/timeffc.h  Sun Nov 20 01:20:50 2011(r227745)
+++ head/sys/sys/timeffc.h  Sun Nov 20 01:48:22 2011(r227746)
@@ -71,7 +71,7 @@ struct ffclock_estimate {
  * time by ffclock_convert_abs().
  * FAST:do not read the hardware counter, return feed-forward clock time
  *  at last tick. The time returned has the resolution of the kernel
- *   tick (1/hz [s]).
+ *  tick (1/hz [s]).
  * LERP:linear interpolation of ffclock time to guarantee monotonic time.
  * LEAPSEC: include leap seconds.
  * UPTIME:  removes time of boot.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r227487 - head/include

2011-11-19 Thread Bruce Evans

On Mon, 14 Nov 2011, David Schultz wrote:


On Mon, Nov 14, 2011, David Chisnall wrote:

On 14 Nov 2011, at 18:02, David Schultz wrote:


On Mon, Nov 14, 2011, Dimitry Andric wrote:

On 2011-11-14 09:21, Stefan Farfeleder wrote:

On Sun, Nov 13, 2011 at 04:18:48PM +, David Chisnall wrote:

Author: theraven
Date: Sun Nov 13 16:18:48 2011
New Revision: 227487
URL: http://svn.freebsd.org/changeset/base/227487

Log:
 The spec says that FILE must be defined in wchar.h, but it wasn't.  It
 is now.  Also hide some macros in C++ mode that will break C++
 namespaced calls.

 Approved by:   dim (mentor)


I think this change is wrong. Whic spec are you referring to? C99
defines FILE only in 7.19.1#2 (stdio.h). In other headers FILE is used
as parameter type for functions but that does not mean it is exported to
user space.


Also, this change doesn't even declare `FILE'.  It only declares an
incomplete struct for `FILE', just like the old version except for
a different spelling which gives namespace pollution that was carefully
avoided.


http://pubs.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html


Just another bug in POSIX.  Another bug in it is its wording, which
is either too fuzzy or too strict.  It says that FILE is defined (sic)
as "described in ".  If this is interpreted strictly, then
it says that  must declare FILE completely iff 
declares it completely.  FILE should be opaque, so it should not be
declared completely in either, but FreeBSD still supports old optimized
inline or macro versions for a few of the interfaces in , so
it must declare FILE completely in .  Thus POSIX strictly
requires FILE to be declared completely in  too.  But nothing
in  needs to dereference FILE, so  doesn't need to
declare it completely.  I doubt that POSIX is so broken as to require
this intentionally.


It's a niggling detail, but that's an extension to the C standard,
so properly speaking, it belongs in an
 #if __POSIX_VISIBLE >= 200809 || XSI_VISIBLE
(or something like that).  The formals were struct __sFILE *
instead of FILE * for that reason -- see r103177.

P.S. You're looking at a very old version of POSIX.  Check out:
http://pubs.opengroup.org/onlinepubs/9699919799/


Too hard to search using lynx.


The C99 and C1x specifications both seem to require stdio.h to be included 
before wchar.h.  I think this therefore places including wchar.h and not 
stdio.h in the category of undefined (or, at least, not defined) behaviour, so 
we are free to do anything in this case.  I would say that accepting the code 
and working as the programmer expected is the least harmful thing to do here.  
This is what Darwin libc does (actually, it #includes stdio.h in wchar.h).


Just another bug in Darwin.  FreeBSD had the full namespace pollution
from  too, until this was fixed in r103177.


The C99 standard has plenty of examples of programs including
 but not .  The latter is only required to call
the functions that take a FILE * parameter.  It's mostly an


Not even that in FreeBSD (but C99 and portability requires it).  The
functions can be called without knowing a complete declaration of FILE
or anything else in .  E.g., getwc(NULL), or more usefully,
getwc(fp) where fp is a FILE * passed as a parameter to the function
that calls getwc().  This depends on the implementation detail that
none of the functions dereferences FILE *.  If we want to punish
unportable callers that don't include  strictly before including
 and using one of the functions, perhaps that can be arranged.


academic point because no sane programmer would ever create a new
type named FILE, but FreeBSD actually did right by C99 before you
reverted r103177.


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


svn commit: r227747 - in head/sys: kern sys

2011-11-19 Thread Lawrence Stewart
Author: lstewart
Date: Sun Nov 20 05:32:12 2011
New Revision: 227747
URL: http://svn.freebsd.org/changeset/base/227747

Log:
  - Provide a sysctl interface to change the active system clock at runtime.
  
  - Wrap [get]{bin,nano,micro}[up]time() functions of sys/time.h to allow
requesting time from either the feedback or the feed-forward clock. If a
feedback (e.g. ntpd) and feed-forward (e.g. radclock) daemon are both 
running
on the system, both kernel clocks are updated but only one serves time.
  
  - Add similar wrappers for the feed-forward difference clock.
  
  Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
  Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward
  Clock Synchronization Algorithms" project.
  
  For more information, see http://www.synclab.org/radclock/
  
  Submitted by: Julien Ridoux (jridoux at unimelb edu au)

Modified:
  head/sys/kern/kern_ffclock.c
  head/sys/kern/kern_tc.c
  head/sys/sys/timeffc.h

Modified: head/sys/kern/kern_ffclock.c
==
--- head/sys/kern/kern_ffclock.cSun Nov 20 01:48:22 2011
(r227746)
+++ head/sys/kern/kern_ffclock.cSun Nov 20 05:32:12 2011
(r227747)
@@ -31,6 +31,8 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -127,3 +129,215 @@ ffclock_difftime(ffcounter ffdelta, stru
bintime_mul(error_bound, err_rate * (uint64_t)18446744073709LL);
}
 }
+
+/*
+ * Sysctl for the Feed-Forward Clock.
+ */
+
+static int ffclock_version = 2;
+SYSCTL_NODE(_kern, OID_AUTO, ffclock, CTLFLAG_RW, 0,
+"Feed-Forward Clock Support");
+SYSCTL_INT(_kern_ffclock, OID_AUTO, version, CTLFLAG_RD, &ffclock_version, 0,
+"Version of Feed-Forward Clock Support");
+
+/*
+ * Sysctl to select which clock is read when calling any of the
+ * [get]{bin,nano,micro}[up]time() functions.
+ */
+char *sysclocks[] = {"feedback", "feed-forward"};
+
+#defineNUM_SYSCLOCKS (sizeof(sysclocks) / sizeof(*sysclocks))
+
+/* Report or change the active timecounter hardware. */
+static int
+sysctl_kern_ffclock_choice(SYSCTL_HANDLER_ARGS)
+{
+   struct sbuf *s;
+   int clk, error;
+
+   s = sbuf_new_for_sysctl(NULL, NULL, 16 * NUM_SYSCLOCKS, req);
+   if (s == NULL)
+   return (ENOMEM);
+
+   for (clk = 0; clk < NUM_SYSCLOCKS; clk++) {
+   sbuf_cat(s, sysclocks[clk]);
+   if (clk + 1 < NUM_SYSCLOCKS)
+   sbuf_cat(s, " ");
+   }
+   error = sbuf_finish(s);
+   sbuf_delete(s);
+
+   return (error);
+}
+
+SYSCTL_PROC(_kern_ffclock, OID_AUTO, choice, CTLTYPE_STRING | CTLFLAG_RD,
+0, 0, sysctl_kern_ffclock_choice, "A", "Clock paradigms available");
+
+extern int sysclock_active;
+
+static int
+sysctl_kern_ffclock_active(SYSCTL_HANDLER_ARGS)
+{
+   char newclock[32];
+   int error;
+
+   switch (sysclock_active) {
+   case SYSCLOCK_FBCK:
+   strlcpy(newclock, sysclocks[SYSCLOCK_FBCK], sizeof(newclock));
+   break;
+   case SYSCLOCK_FFWD:
+   strlcpy(newclock, sysclocks[SYSCLOCK_FFWD], sizeof(newclock));
+   break;
+   }
+
+   error = sysctl_handle_string(oidp, &newclock[0], sizeof(newclock), req);
+   if (error != 0 || req->newptr == NULL)
+   return (error);
+   if (strncmp(newclock, sysclocks[SYSCLOCK_FBCK],
+   sizeof(sysclocks[SYSCLOCK_FBCK])) == 0)
+   sysclock_active = SYSCLOCK_FBCK;
+   else if (strncmp(newclock, sysclocks[SYSCLOCK_FFWD],
+   sizeof(sysclocks[SYSCLOCK_FFWD])) == 0)
+   sysclock_active = SYSCLOCK_FFWD;
+   else
+   return (EINVAL);
+
+   return (error);
+}
+
+SYSCTL_PROC(_kern_ffclock, OID_AUTO, active, CTLTYPE_STRING | CTLFLAG_RW,
+0, 0, sysctl_kern_ffclock_active, "A", "Kernel clock selected");
+
+/*
+ * High level functions to access the Feed-Forward Clock.
+ */
+void
+ffclock_bintime(struct bintime *bt)
+{
+
+   ffclock_abstime(NULL, bt, NULL, FFCLOCK_LERP | FFCLOCK_LEAPSEC);
+}
+
+void
+ffclock_nanotime(struct timespec *tsp)
+{
+   struct bintime bt;
+
+   ffclock_abstime(NULL, &bt, NULL, FFCLOCK_LERP | FFCLOCK_LEAPSEC);
+   bintime2timespec(&bt, tsp);
+}
+
+void
+ffclock_microtime(struct timeval *tvp)
+{
+   struct bintime bt;
+
+   ffclock_abstime(NULL, &bt, NULL, FFCLOCK_LERP | FFCLOCK_LEAPSEC);
+   bintime2timeval(&bt, tvp);
+}
+
+void
+ffclock_getbintime(struct bintime *bt)
+{
+
+   ffclock_abstime(NULL, bt, NULL,
+   FFCLOCK_LERP | FFCLOCK_LEAPSEC | FFCLOCK_FAST);
+}
+
+void
+ffclock_getnanotime(struct timespec *tsp)
+{
+   struct bintime bt;
+
+   ffclock_abstime(NULL, &bt, NULL,
+   FFCLOCK_LERP | FFCLOCK_LEAPSEC | FFCLOCK_FAST);
+   bintime2timespec(&bt, tsp);
+}
+
+void
+ffclock_getmicrotime(struct timeval *tvp)
+{
+