Re: svn commit: r256768 - head/sbin/ifconfig

2013-10-20 Thread Dag-Erling Smørgrav
Adrian Chadd  
> ... erm, this could break many existing scripts that stupidly(!) just
> try adding an interface to a group to see if it's already there.

Why would you do that instead of "ifconfig -g group | grep -w iface"?
And is it really more important than being able to restart an interface?

> Is the ifconfig error behavour in this instance documented anywhere?

No.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r256782 - in head/sys/dev/usb: . serial

2013-10-20 Thread Gavin Atkinson
Author: gavin
Date: Sun Oct 20 11:19:37 2013
New Revision: 256782
URL: http://svnweb.freebsd.org/changeset/base/256782

Log:
  Add 26 new device IDs to uslcom(4).  This brings us in sync with Linux
  v3.12 rc5.
  
  MFC after:3 days

Modified:
  head/sys/dev/usb/serial/uslcom.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/uslcom.c
==
--- head/sys/dev/usb/serial/uslcom.cSun Oct 20 10:02:04 2013
(r256781)
+++ head/sys/dev/usb/serial/uslcom.cSun Oct 20 11:19:37 2013
(r256782)
@@ -252,15 +252,37 @@ static const STRUCT_USB_HOST_ID uslcom_d
 USLCOM_DEV(JABLOTRON, PC60B),
 USLCOM_DEV(KAMSTRUP, OPTICALEYE),
 USLCOM_DEV(KAMSTRUP, MBUS_250D),
+USLCOM_DEV(LAKESHORE, 121),
+USLCOM_DEV(LAKESHORE, 218A),
+USLCOM_DEV(LAKESHORE, 219),
+USLCOM_DEV(LAKESHORE, 233),
+USLCOM_DEV(LAKESHORE, 235),
+USLCOM_DEV(LAKESHORE, 335),
+USLCOM_DEV(LAKESHORE, 336),
+USLCOM_DEV(LAKESHORE, 350),
+USLCOM_DEV(LAKESHORE, 371),
+USLCOM_DEV(LAKESHORE, 411),
+USLCOM_DEV(LAKESHORE, 425),
+USLCOM_DEV(LAKESHORE, 455A),
+USLCOM_DEV(LAKESHORE, 465),
+USLCOM_DEV(LAKESHORE, 475A),
+USLCOM_DEV(LAKESHORE, 625A),
+USLCOM_DEV(LAKESHORE, 642A),
+USLCOM_DEV(LAKESHORE, 648),
+USLCOM_DEV(LAKESHORE, 737),
+USLCOM_DEV(LAKESHORE, 776),
 USLCOM_DEV(LINKINSTRUMENTS, MSO19),
 USLCOM_DEV(LINKINSTRUMENTS, MSO28),
 USLCOM_DEV(LINKINSTRUMENTS, MSO28_2),
 USLCOM_DEV(MEI, CASHFLOW_SC),
 USLCOM_DEV(MEI, S2000),
+USLCOM_DEV(NETGEAR, M4100),
 USLCOM_DEV(OWEN, AC4),
+USLCOM_DEV(OWL, CM_160),
 USLCOM_DEV(PHILIPS, ACE1001),
 USLCOM_DEV(PLX, CA42),
 USLCOM_DEV(RENESAS, RX610),
+USLCOM_DEV(SEL, C662),
 USLCOM_DEV(SILABS, AC_SERV_CAN),
 USLCOM_DEV(SILABS, AC_SERV_CIS),
 USLCOM_DEV(SILABS, AC_SERV_IBUS),
@@ -293,6 +315,7 @@ static const STRUCT_USB_HOST_ID uslcom_d
 USLCOM_DEV(SILABS, HELICOM),
 USLCOM_DEV(SILABS, IMS_USB_RS422),
 USLCOM_DEV(SILABS, INFINITY_MIC),
+USLCOM_DEV(SILABS, INGENI_ZIGBEE),
 USLCOM_DEV(SILABS, INSYS_MODEM),
 USLCOM_DEV(SILABS, IRZ_SG10),
 USLCOM_DEV(SILABS, KYOCERA_GPS),
@@ -300,6 +323,7 @@ static const STRUCT_USB_HOST_ID uslcom_d
 USLCOM_DEV(SILABS, LIPOWSKY_JTAG),
 USLCOM_DEV(SILABS, LIPOWSKY_LIN),
 USLCOM_DEV(SILABS, MC35PU),
+USLCOM_DEV(SILABS, MMB_ZIGBEE),
 USLCOM_DEV(SILABS, MJS_TOSLINK),
 USLCOM_DEV(SILABS, MSD_DASHHAWK),
 USLCOM_DEV(SILABS, MULTIPLEX_RC),
@@ -316,6 +340,7 @@ static const STRUCT_USB_HOST_ID uslcom_d
 USLCOM_DEV(SILABS, USBPULSE100),
 USLCOM_DEV(SILABS, USBSCOPE50),
 USLCOM_DEV(SILABS, USBWAVE12),
+USLCOM_DEV(SILABS, V_PREON32),
 USLCOM_DEV(SILABS, VSTABI),
 USLCOM_DEV(SILABS, WAVIT),
 USLCOM_DEV(SILABS, WMRBATT),
@@ -330,6 +355,7 @@ static const STRUCT_USB_HOST_ID uslcom_d
 USLCOM_DEV(VAISALA, CABLE),
 USLCOM_DEV(WAGO, SERVICECABLE),
 USLCOM_DEV(WAVESENSE, JAZZ),
+USLCOM_DEV(WESTMOUNTAIN, RIGBLASTER_ADVANTAGE),
 USLCOM_DEV(WIENERPLEINBAUS, PL512),
 USLCOM_DEV(WIENERPLEINBAUS, RCM),
 USLCOM_DEV(WIENERPLEINBAUS, MPOD),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSun Oct 20 10:02:04 2013(r256781)
+++ head/sys/dev/usb/usbdevsSun Oct 20 11:19:37 2013(r256782)
@@ -569,6 +569,7 @@ vendor FALCOM   0x0f94  Falcom Wireless Co
 vendor RIM 0x0fca  Research In Motion
 vendor DYNASTREAM  0x0fcf  Dynastream Innovations
 vendor LARSENBRUSGAARD 0x0fd8  Larsen and Brusgaard
+vendor OWL 0x0fde  OWL
 vendor KONTRON 0x0fe6  Kontron AG
 vendor QUALCOMM0x1004  Qualcomm
 vendor APACER  0x1005  Apacer
@@ -695,6 +696,7 @@ vendor QUALCOMMINC  0x19d2  Qualcomm, Inco
 vendor BAYER   0x1a79  Bayer
 vendor WCH20x1a86  QinHeng Electronics
 vendor STELERA 0x1a8d  Stelera Wireless
+vendor SEL 0x1adb  Schweitzer Engineering Laboratories
 vendor CORSAIR 0x1b1c  Corsair
 vendor MATRIXORBITAL   0x1b3d  Matrix Orbital
 vendor OVISLINK0x1b75  OvisLink
@@ -715,6 +717,7 @@ vendor METAGEEK20x1dd5  MetaGeek
 vendor ALINK   0x1e0e  Alink
 vendor AIRTIES 0x1eda  AirTies
 vendor FESTO   0x1e29  Festo
+vendor LAKESHORE   0x1fb9  Lake Shore Cryotronics, Inc.
 vendor VERTEX  0x1fe7  Vertex Wireless Co., Ltd.
 vendor DLINK   0x2001  D-Link
 vendor PLANEX2 0x2019  Planex Communications
@@ -730,6 +733,7 @@ vendor VIALABS  0x2109  VIA Labs
 vendor ERICSSON0x2282  Ericsson
 vendor MOTOROLA2   0x22b8  Motorola
 vendor WETELECOM   0x22de  WeTelecom
+vendor WESTMOUNTAIN0x2405  West Mountain Radio
 vendor TRIPPLITE   0x2478  Tripp-Lite
 vendor HIROSE  0x2631 

svn commit: r256787 - head

2013-10-20 Thread Antoine Brodin
Author: antoine
Date: Sun Oct 20 13:41:42 2013
New Revision: 256787
URL: http://svnweb.freebsd.org/changeset/base/256787

Log:
  Add more obsolete files

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sun Oct 20 12:59:54 2013(r256786)
+++ head/ObsoleteFiles.inc  Sun Oct 20 13:41:42 2013(r256787)
@@ -271,6 +271,7 @@ OLD_FILES+=usr/share/man/man8/dnssec-key
 OLD_FILES+=usr/share/man/man8/dnssec-revoke.8.gz
 OLD_FILES+=usr/share/man/man8/dnssec-settime.8.gz
 OLD_FILES+=usr/share/man/man8/dnssec-signzone.8.gz
+OLD_FILES+=usr/share/man/man8/dnssec-verify.8.gz
 OLD_FILES+=usr/share/man/man8/genrandom.8.gz
 OLD_FILES+=usr/share/man/man8/isc-hmac-fixup.8.gz
 OLD_FILES+=usr/share/man/man8/lwresd.8.gz
@@ -305,6 +306,8 @@ OLD_DIRS+=var/named/var/run
 OLD_DIRS+=var/named/var/run/named
 OLD_DIRS+=var/named/var/stats
 OLD_DIRS+=var/run/named
+# 20130923: example moved
+OLD_FILES+=usr/share/examples/bsdconfig/browse_packages.sh
 # 20130908: libssh becomes private
 OLD_FILES+=usr/lib/libssh.a
 OLD_FILES+=usr/lib/libssh.so
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256788 - head/sys/powerpc/pseries

2013-10-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct 20 14:01:09 2013
New Revision: 256788
URL: http://svnweb.freebsd.org/changeset/base/256788

Log:
  Add multicast filter control.

Modified:
  head/sys/powerpc/pseries/phyp_llan.c

Modified: head/sys/powerpc/pseries/phyp_llan.c
==
--- head/sys/powerpc/pseries/phyp_llan.cSun Oct 20 13:41:42 2013
(r256787)
+++ head/sys/powerpc/pseries/phyp_llan.cSun Oct 20 14:01:09 2013
(r256788)
@@ -60,6 +60,11 @@ __FBSDID("$FreeBSD$");
 #define LLAN_MAX_TX_PACKETS100
 #define LLAN_RX_BUF_LEN8*PAGE_SIZE
 
+#define LLAN_BUFDESC_VALID (1ULL << 63)
+#define LLAN_ADD_MULTICAST 0x1
+#define LLAN_DEL_MULTICAST 0x2
+#define LLAN_CLEAR_MULTICAST   0x3
+
 struct llan_xfer {
struct mbuf *rx_mbuf;
bus_dmamap_t rx_dmamap;
@@ -113,6 +118,7 @@ static int  llan_ioctl(struct ifnet *ifp,
 static voidllan_rx_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs,
int err);
 static int llan_add_rxbuf(struct llan_softc *sc, struct llan_xfer *rx);
+static int llan_set_multicast(struct llan_softc *sc);
 
 static devclass_t   llan_devclass;
 static device_method_t  llan_methods[] = {
@@ -249,7 +255,7 @@ llan_init(void *xsc)
sc->rx_dma_slot = 0;
sc->rx_valid_val = 1;
 
-   rx_buf_desc = (1UL << 63); /* valid */
+   rx_buf_desc = LLAN_BUFDESC_VALID;
rx_buf_desc |= (sc->rx_buf_len << 32);
rx_buf_desc |= sc->rx_buf_phys;
memcpy(&macaddr, sc->mac_address, 8);
@@ -307,7 +313,7 @@ llan_add_rxbuf(struct llan_softc *sc, st
 
bus_dmamap_sync(sc->rxbuf_dma_tag, rx->rx_dmamap, BUS_DMASYNC_PREREAD);
 
-   rx->rx_bufdesc = (1UL << 63); /* valid */
+   rx->rx_bufdesc = LLAN_BUFDESC_VALID;
rx->rx_bufdesc |= (((uint64_t)segs[0].ds_len) << 32);
rx->rx_bufdesc |= segs[0].ds_addr;
error = phyp_hcall(H_ADD_LOGICAL_LAN_BUFFER, sc->unit, rx->rx_bufdesc);
@@ -376,7 +382,7 @@ llan_send_packet(void *xsc, bus_dma_segm
bzero(bufdescs, sizeof(bufdescs));
 
for (i = 0; i < nsegs; i++) {
-   bufdescs[i] = (1UL << 63); /* valid */
+   bufdescs[i] = LLAN_BUFDESC_VALID;
bufdescs[i] |= (((uint64_t)segs[i].ds_len) << 32);
bufdescs[i] |= segs[i].ds_addr;
}
@@ -442,11 +448,50 @@ llan_start(struct ifnet *ifp)
 }
 
 static int
+llan_set_multicast(struct llan_softc *sc)
+{
+   struct ifnet *ifp = sc->ifp;
+   struct ifmultiaddr *inm;
+   uint64_t macaddr;
+
+   mtx_assert(&sc->io_lock, MA_OWNED);
+
+   phyp_hcall(H_MULTICAST_CTRL, sc->unit, LLAN_CLEAR_MULTICAST, 0);
+
+   if_maddr_rlock(ifp);
+   TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
+   if (inm->ifma_addr->sa_family != AF_LINK)
+   continue;
+
+   memcpy((uint8_t *)&macaddr + 2,
+   LLADDR((struct sockaddr_dl *)inm->ifma_addr), 6);
+   phyp_hcall(H_MULTICAST_CTRL, sc->unit, LLAN_ADD_MULTICAST,
+   macaddr);
+   }
+   if_maddr_runlock(ifp);
+
+   return (0);
+}
+
+static int
 llan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 {
-   int err;
+   int err = 0;
+   struct llan_softc *sc = ifp->if_softc;
 
-   err = ether_ioctl(ifp, cmd, data);
+   switch (cmd) {
+   case SIOCADDMULTI:
+   case SIOCDELMULTI:
+   mtx_lock(&sc->io_lock);
+   if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+   llan_set_multicast(sc);
+   mtx_unlock(&sc->io_lock);
+   break;
+   case SIOCSIFFLAGS:
+   default:
+   err = ether_ioctl(ifp, cmd, data);
+   break;
+   }
 
return (err);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256790 - head/contrib/binutils/gas/config

2013-10-20 Thread Andrew Turner
Author: andrew
Date: Sun Oct 20 15:13:32 2013
New Revision: 256790
URL: http://svnweb.freebsd.org/changeset/base/256790

Log:
  Merge from projects/arm_eabi_vfp r255380:
  
  Fix the VCVT instruction. It must round towards zero when converting from
  a floating-point to an integer value. This was not the case causing issues
  when printing certain values.
  
  There is a VCVTR instruction that will round depending on the current
  rounding mode. We don't yet support this instruction, or setting the
  rounding mode.

Modified:
  head/contrib/binutils/gas/config/tc-arm.c

Modified: head/contrib/binutils/gas/config/tc-arm.c
==
--- head/contrib/binutils/gas/config/tc-arm.c   Sun Oct 20 14:52:14 2013
(r256789)
+++ head/contrib/binutils/gas/config/tc-arm.c   Sun Oct 20 15:13:32 2013
(r256790)
@@ -12660,14 +12660,14 @@ do_vfp_nsyn_cvt (enum neon_shape rs, int
   /* Conversions without bitshift.  */
   const char *enc[] =
 {
-  "ftosis",
-  "ftouis",
+  "ftosizs",
+  "ftouizs",
   "fsitos",
   "fuitos",
   "fcvtsd",
   "fcvtds",
-  "ftosid",
-  "ftouid",
+  "ftosizd",
+  "ftouizd",
   "fsitod",
   "fuitod"
 };
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256792 - in head/sys: conf powerpc/aim powerpc/booke powerpc/powerpc

2013-10-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct 20 16:14:03 2013
New Revision: 256792
URL: http://svnweb.freebsd.org/changeset/base/256792

Log:
  Unify the AIM and Book-E vm_machdep.c implementations, which previously
  differed only with respect to the AIM version not following style(9) and
  some additional features for 64-bit systems and machines with direct maps
  in the AIM implementation that are no-ops on Book-E (at least for now).

Added:
  head/sys/powerpc/powerpc/vm_machdep.c
 - copied, changed from r256769, head/sys/powerpc/aim/vm_machdep.c
Deleted:
  head/sys/powerpc/aim/vm_machdep.c
  head/sys/powerpc/booke/vm_machdep.c
Modified:
  head/sys/conf/files.powerpc

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Sun Oct 20 15:24:44 2013(r256791)
+++ head/sys/conf/files.powerpc Sun Oct 20 16:14:03 2013(r256792)
@@ -101,7 +101,6 @@ powerpc/aim/swtch32.S   optionalaim powe
 powerpc/aim/swtch64.S  optionalaim powerpc64
 powerpc/aim/trap.c optionalaim
 powerpc/aim/uma_machdep.c  optionalaim
-powerpc/aim/vm_machdep.c   optionalaim
 powerpc/booke/clock.c  optionalbooke
 powerpc/booke/copyinout.c  optionalbooke
 powerpc/booke/interrupt.c  optionalbooke
@@ -113,7 +112,6 @@ powerpc/booke/platform_bare.c   optionalm
 powerpc/booke/pmap.c   optionalbooke
 powerpc/booke/swtch.S  optionalbooke
 powerpc/booke/trap.c   optionalbooke
-powerpc/booke/vm_machdep.c optionalbooke
 powerpc/cpufreq/dfs.c  optionalcpufreq
 powerpc/cpufreq/pcr.c  optionalcpufreq aim
 powerpc/fpu/fpu_add.c  optionalfpu_emu powerpc
@@ -214,6 +212,7 @@ powerpc/powerpc/suswintr.c  standard
 powerpc/powerpc/syncicache.c   standard
 powerpc/powerpc/sys_machdep.c  standard
 powerpc/powerpc/uio_machdep.c  standard
+powerpc/powerpc/vm_machdep.c   standard
 powerpc/ps3/ehci_ps3.c optionalps3 ehci
 powerpc/ps3/ohci_ps3.c optionalps3 ohci
 powerpc/ps3/if_glc.c   optionalps3 glc

Copied and modified: head/sys/powerpc/powerpc/vm_machdep.c (from r256769, 
head/sys/powerpc/aim/vm_machdep.c)
==
--- head/sys/powerpc/aim/vm_machdep.c   Sat Oct 19 10:00:51 2013
(r256769, copy source)
+++ head/sys/powerpc/powerpc/vm_machdep.c   Sun Oct 20 16:14:03 2013
(r256792)
@@ -108,7 +108,7 @@
  */
 
 #ifndef NSFBUFS
-#define NSFBUFS (512 + maxusers * 16)
+#define NSFBUFS(512 + maxusers * 16)
 #endif
 
 static int nsfbufs;
@@ -205,7 +205,9 @@ cpu_fork(struct thread *td1, struct proc
#else
pcb->pcb_lr = (register_t)fork_trampoline;
#endif
+   #ifdef AIM
pcb->pcb_cpu.aim.usr_vsid = 0;
+   #endif
 
/* Setup to release spin count in fork_exit(). */
td2->td_md.md_spinlock_count = 1;
@@ -223,12 +225,9 @@ cpu_fork(struct thread *td1, struct proc
  * This is needed to make kernel threads stay in kernel mode.
  */
 void
-cpu_set_fork_handler(td, func, arg)
-   struct thread *td;
-   void (*func)(void *);
-   void *arg;
+cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg)
 {
-   struct  callframe *cf;
+   struct callframe *cf;
 
CTR4(KTR_PROC, "%s called with td=%p func=%p arg=%p",
__func__, td, func, arg);
@@ -240,9 +239,9 @@ cpu_set_fork_handler(td, func, arg)
 }
 
 void
-cpu_exit(td)
-   register struct thread *td;
+cpu_exit(struct thread *td)
 {
+
 }
 
 /*
@@ -251,29 +250,29 @@ cpu_exit(td)
 static void
 sf_buf_init(void *arg)
 {
-struct sf_buf *sf_bufs;
-vm_offset_t sf_base;
-int i;
+   struct sf_buf *sf_bufs;
+   vm_offset_t sf_base;
+   int i;
 
/* Don't bother on systems with a direct map */
-
if (hw_direct_map)
return;
 
-nsfbufs = NSFBUFS;
-TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs);
+   nsfbufs = NSFBUFS;
+   TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs);
 
-sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask);
-TAILQ_INIT(&sf_buf_freelist);
-sf_base = kva_alloc(nsfbufs * PAGE_SIZE);
-sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, M_NOWAIT | 
M_ZERO);
-
-for (i = 0; i < nsfbufs; i++) {
-sf_bufs[i].kva = sf_base + i * PAGE_SIZE;
-TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry);
-}
-sf_buf_alloc_want = 0;
-mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF);
+   sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask);
+   TAILQ_INIT(&sf_buf_freelist);
+   sf_base = kva_alloc(nsfbufs * PAGE_SIZE);
+   sf_bufs = ma

svn commit: r256793 - in head/sys: conf powerpc/aim powerpc/booke powerpc/powerpc

2013-10-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct 20 16:37:03 2013
New Revision: 256793
URL: http://svnweb.freebsd.org/changeset/base/256793

Log:
  Replace the two almost-exactly-identical AIM and Book-E clock.c
  implementations with a single one after the application of a very small
  amount of #ifdef.

Added:
  head/sys/powerpc/powerpc/clock.c
 - copied, changed from r256769, head/sys/powerpc/aim/clock.c
Deleted:
  head/sys/powerpc/aim/clock.c
  head/sys/powerpc/booke/clock.c
Modified:
  head/sys/conf/files.powerpc
  head/sys/powerpc/aim/machdep.c

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Sun Oct 20 16:14:03 2013(r256792)
+++ head/sys/conf/files.powerpc Sun Oct 20 16:37:03 2013(r256793)
@@ -85,7 +85,6 @@ libkern/qdivrem.c optionalpowerpc
 libkern/ucmpdi2.c  optionalpowerpc
 libkern/udivdi3.c  optionalpowerpc
 libkern/umoddi3.c  optionalpowerpc
-powerpc/aim/clock.coptionalaim
 powerpc/aim/copyinout.coptionalaim
 powerpc/aim/interrupt.coptionalaim
 powerpc/aim/locore.S   optionalaim no-obj
@@ -101,7 +100,6 @@ powerpc/aim/swtch32.S   optionalaim powe
 powerpc/aim/swtch64.S  optionalaim powerpc64
 powerpc/aim/trap.c optionalaim
 powerpc/aim/uma_machdep.c  optionalaim
-powerpc/booke/clock.c  optionalbooke
 powerpc/booke/copyinout.c  optionalbooke
 powerpc/booke/interrupt.c  optionalbooke
 powerpc/booke/locore.S optionalbooke no-obj
@@ -178,6 +176,7 @@ powerpc/powerpc/autoconf.c  standard
 powerpc/powerpc/bcopy.cstandard
 powerpc/powerpc/bus_machdep.c  standard
 powerpc/powerpc/busdma_machdep.c standard
+powerpc/powerpc/clock.cstandard
 powerpc/powerpc/copystr.c  standard
 powerpc/powerpc/cpu.c  standard
 powerpc/powerpc/db_disasm.coptionalddb

Modified: head/sys/powerpc/aim/machdep.c
==
--- head/sys/powerpc/aim/machdep.c  Sun Oct 20 16:14:03 2013
(r256792)
+++ head/sys/powerpc/aim/machdep.c  Sun Oct 20 16:37:03 2013
(r256793)
@@ -646,14 +646,6 @@ cpu_flush_dcache(void *ptr, size_t len)
/* TBD */
 }
 
-void
-cpu_initclocks(void)
-{
-
-   decr_tc_init();
-   cpu_initclocks_bsp();
-}
-
 /*
  * Shutdown the CPU as much as possible.
  */

Copied and modified: head/sys/powerpc/powerpc/clock.c (from r256769, 
head/sys/powerpc/aim/clock.c)
==
--- head/sys/powerpc/aim/clock.cSat Oct 19 10:00:51 2013
(r256769, copy source)
+++ head/sys/powerpc/powerpc/clock.cSun Oct 20 16:37:03 2013
(r256793)
@@ -119,6 +119,14 @@ decr_intr(struct trapframe *frame)
 
(*decr_counts[curcpu])++;
 
+#ifdef BOOKE
+   /*
+* Interrupt handler must reset DIS to avoid getting another
+* interrupt once EE is enabled.
+*/
+   mtspr(SPR_TSR, TSR_DIS);
+#endif
+
if (s->mode == 1) {
/*
 * Based on the actual time delay since the last decrementer
@@ -141,6 +149,14 @@ decr_intr(struct trapframe *frame)
}
 }
 
+void
+cpu_initclocks(void)
+{
+
+   decr_tc_init();
+   cpu_initclocks_bsp();
+}
+
 /*
  * BSP early initialization.
  */
@@ -207,11 +223,13 @@ decr_tc_init(void)
  * Event timer start method.
  */
 static int
-decr_et_start(struct eventtimer *et,
-sbintime_t first, sbintime_t period)
+decr_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
 {
struct decr_state *s = DPCPU_PTR(decr_state);
uint32_t fdiv;
+#ifdef BOOKE
+   uint32_t tcr;
+#endif
 
if (period != 0) {
s->mode = 1;
@@ -220,12 +238,25 @@ decr_et_start(struct eventtimer *et,
s->mode = 2;
s->div = 0;
}
-   if (first != 0) {
+   if (first != 0)
fdiv = (decr_et.et_frequency * first) >> 32;
-   } else
+   else
fdiv = s->div;
 
+#ifdef BOOKE
+   tcr = mfspr(SPR_TCR);
+   tcr |= TCR_DIE;
+   if (s->mode == 1) {
+   mtspr(SPR_DECAR, s->div);
+   tcr |= TCR_ARE;
+   } else
+   tcr &= ~TCR_ARE;
mtdec(fdiv);
+   mtspr(SPR_TCR, tcr);
+#else
+   mtdec(fdiv);
+#endif
+
return (0);
 }
 
@@ -236,10 +267,19 @@ static int
 decr_et_stop(struct eventtimer *et)
 {
struct decr_state *s = DPCPU_PTR(decr_state);
+#ifdef BOOKE
+   uint32_t tcr;
+#endif
 
s->mode = 0;
s->div = 0x7fff;
+#ifdef BOOKE
+   tcr = mfspr(SPR_TCR);
+   tcr &= ~(TCR_DIE | TCR_ARE);
+   mtspr(SPR_TCR, tcr);
+#el

svn commit: r256798 - head/sys/dev/fdt

2013-10-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct 20 18:38:19 2013
New Revision: 256798
URL: http://svnweb.freebsd.org/changeset/base/256798

Log:
  Some nexus devices add wildcard children. Since fdtbus_probe returned
  BUS_PROBE_DEFAULT, it would attach to them all, producing both many
  fdtbus instances and preventing other devices from attaching. Instead
  return BUS_PROBE_NOWILDCARD, which exists for exactly this purpose.

Modified:
  head/sys/dev/fdt/fdtbus.c

Modified: head/sys/dev/fdt/fdtbus.c
==
--- head/sys/dev/fdt/fdtbus.c   Sun Oct 20 18:13:06 2013(r256797)
+++ head/sys/dev/fdt/fdtbus.c   Sun Oct 20 18:38:19 2013(r256798)
@@ -161,7 +161,7 @@ fdtbus_probe(device_t dev)
device_set_desc(dev, "FDT main bus");
if (!bootverbose)
device_quiet(dev);
-   return (BUS_PROBE_DEFAULT);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256799 - in head/sys: conf powerpc/aim powerpc/mpc85xx powerpc/powerpc

2013-10-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct 20 18:40:55 2013
New Revision: 256799
URL: http://svnweb.freebsd.org/changeset/base/256799

Log:
  Since the PS3 port was committed, the AIM nexus device works perfectly fine
  on all PowerPC platforms, whether or not they have Open Firmware. Remove
  some more duplication and have there be only one nexus driver.

Added:
  head/sys/powerpc/powerpc/nexus.c
 - copied unchanged from r256769, head/sys/powerpc/aim/nexus.c
Deleted:
  head/sys/powerpc/aim/nexus.c
  head/sys/powerpc/mpc85xx/nexus.c
Modified:
  head/sys/conf/files.powerpc

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Sun Oct 20 18:38:19 2013(r256798)
+++ head/sys/conf/files.powerpc Sun Oct 20 18:40:55 2013(r256799)
@@ -94,7 +94,6 @@ powerpc/aim/mmu_oea64.c   optionalaim
 powerpc/aim/moea64_if.moptionalaim
 powerpc/aim/moea64_native.coptionalaim
 powerpc/aim/mp_cpudep.coptionalaim smp
-powerpc/aim/nexus.coptionalaim
 powerpc/aim/slb.c  optionalaim powerpc64
 powerpc/aim/swtch32.S  optionalaim powerpc
 powerpc/aim/swtch64.S  optionalaim powerpc64
@@ -133,7 +132,6 @@ powerpc/mpc85xx/i2c.c   optionaliicbus f
 powerpc/mpc85xx/isa.c  optionalmpc85xx isa
 powerpc/mpc85xx/lbc.c  optionalmpc85xx
 powerpc/mpc85xx/mpc85xx.c  optionalmpc85xx
-powerpc/mpc85xx/nexus.coptionalmpc85xx
 powerpc/mpc85xx/pci_fdt.c  optionalpci mpc85xx
 powerpc/ofw/ofw_cpu.c  optionalaim
 powerpc/ofw/ofw_machdep.c  optionalaim
@@ -196,6 +194,7 @@ powerpc/powerpc/iommu_if.m  standard
 powerpc/powerpc/mem.c  optionalmem
 powerpc/powerpc/mmu_if.m   standard
 powerpc/powerpc/mp_machdep.c   optionalsmp
+powerpc/powerpc/nexus.cstandard
 powerpc/powerpc/openpic.c  standard
 powerpc/powerpc/openpic_fdt.c  optionalfdt
 powerpc/powerpc/pic_if.m   standard

Copied: head/sys/powerpc/powerpc/nexus.c (from r256769, 
head/sys/powerpc/aim/nexus.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/powerpc/powerpc/nexus.cSun Oct 20 18:40:55 2013
(r256799, copy of r256769, head/sys/powerpc/aim/nexus.c)
@@ -0,0 +1,527 @@
+/*-
+ * Copyright 1998 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.  M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. 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.
+ */
+/*-
+ * Copyright 2001 by Thomas Moestl .  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 LIA

svn commit: r256800 - head/usr.bin/pathchk

2013-10-20 Thread Jilles Tjoelker
Author: jilles
Date: Sun Oct 20 20:10:31 2013
New Revision: 256800
URL: http://svnweb.freebsd.org/changeset/base/256800

Log:
  pathchk: Ensure bytes >= 128 are considered non-portable characters.
  
  This was not broken on architectures such as ARM where char is unsigned.
  
  Also, remove the first non-portable character from the output. POSIX does
  not require this, and printing the first byte may yield an invalid byte
  sequence with UTF-8.
  
  PR:   bin/165988
  Reported by:  Nicolas Rachinsky

Modified:
  head/usr.bin/pathchk/pathchk.c

Modified: head/usr.bin/pathchk/pathchk.c
==
--- head/usr.bin/pathchk/pathchk.c  Sun Oct 20 18:40:55 2013
(r256799)
+++ head/usr.bin/pathchk/pathchk.c  Sun Oct 20 20:10:31 2013
(r256800)
@@ -98,7 +98,7 @@ check(const char *path)
 {
struct stat sb;
long complen, namemax, pathmax, svnamemax;
-   int badch, last;
+   int last;
char *end, *p, *pathd;
 
if ((pathd = strdup(path)) == NULL)
@@ -142,9 +142,9 @@ check(const char *path)
goto bad;
}
 
-   if (pflag && (badch = portable(p)) >= 0) {
+   if (pflag && !portable(p)) {
warnx("%s: %s: component contains non-portable "
-   "character `%c'", path, p, badch);
+   "character", path, p);
goto bad;
}
 
@@ -183,8 +183,7 @@ bad:free(pathd);
 }
 
 /*
- * Check whether a path component contains only portable characters. Return
- * the first non-portable character found.
+ * Check whether a path component contains only portable characters.
  */
 static int
 portable(const char *path)
@@ -197,7 +196,7 @@ portable(const char *path)
 
s = strspn(path, charset);
if (path[s] != '\0')
-   return (path[s]);
+   return (0);
 
-   return (-1);
+   return (1);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256801 - head/sys/ufs/ffs

2013-10-20 Thread Kirk McKusick
Author: mckusick
Date: Sun Oct 20 20:41:38 2013
New Revision: 256801
URL: http://svnweb.freebsd.org/changeset/base/256801

Log:
  First of several cleanups to soft dependency implementation.
  Convert three functions exported from ffs_softdep.c to static
  functions as they are not used outside of ffs_softdep.c.
  
  No functional change.
  
  Tested by:Peter Holm and Scott Long
  Sponsored by: Netflix

Modified:
  head/sys/ufs/ffs/ffs_extern.h
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_extern.h
==
--- head/sys/ufs/ffs/ffs_extern.h   Sun Oct 20 20:10:31 2013
(r256800)
+++ head/sys/ufs/ffs/ffs_extern.h   Sun Oct 20 20:41:38 2013
(r256801)
@@ -152,9 +152,7 @@ voidsoftdep_setup_sbupdate(struct ufsmo
 void   softdep_fsync_mountdev(struct vnode *);
 intsoftdep_sync_metadata(struct vnode *);
 intsoftdep_sync_buf(struct vnode *, struct buf *, int);
-int softdep_process_worklist(struct mount *, int);
 int softdep_fsync(struct vnode *);
-intsoftdep_waitidle(struct mount *);
 intsoftdep_prealloc(struct vnode *, int);
 intsoftdep_journal_lookup(struct mount *, struct vnode **);
 void   softdep_journal_freeblocks(struct inode *, struct ucred *, off_t, int);

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 20 20:10:31 2013
(r256800)
+++ head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 20 20:41:38 2013
(r256801)
@@ -812,6 +812,8 @@ struct jextent {
  * Internal function prototypes.
  */
 static void softdep_error(char *, int);
+static int softdep_process_worklist(struct mount *, int);
+static int softdep_waitidle(struct mount *);
 static void drain_output(struct vnode *);
 static struct buf *getdirtybuf(struct buf *, struct rwlock *, int);
 static void clear_remove(void);
@@ -926,7 +928,7 @@ static  inline void setup_freeindir(struc
 static inline struct freeblks *newfreeblks(struct mount *, struct inode *);
 static void freeblks_free(struct ufsmount *, struct freeblks *, int);
 static void indir_trunc(struct freework *, ufs2_daddr_t, ufs_lbn_t);
-ufs2_daddr_t blkcount(struct fs *, ufs2_daddr_t, off_t);
+static ufs2_daddr_t blkcount(struct fs *, ufs2_daddr_t, off_t);
 static int trunc_check_buf(struct buf *, int *, ufs_lbn_t, int, int);
 static void trunc_dependencies(struct inode *, struct freeblks *, ufs_lbn_t,
int, int);
@@ -1563,7 +1565,7 @@ wait_worklist(wk, wmesg)
  * ordering ensures that no new  triples will be generated
  * until all the old ones have been purged from the dependency lists.
  */
-int 
+static int 
 softdep_process_worklist(mp, full)
struct mount *mp;
int full;
@@ -1909,7 +1911,7 @@ softdep_flushworklist(oldmnt, countp, td
return (error);
 }
 
-int
+static int
 softdep_waitidle(struct mount *mp)
 {
struct ufsmount *ump;
@@ -6225,7 +6227,7 @@ complete_trunc_indir(freework)
  * Calculate the number of blocks we are going to release where datablocks
  * is the current total and length is the new file size.
  */
-ufs2_daddr_t
+static ufs2_daddr_t
 blkcount(fs, datablocks, length)
struct fs *fs;
ufs2_daddr_t datablocks;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256802 - head/lib/libc/gen

2013-10-20 Thread Jilles Tjoelker
Author: jilles
Date: Sun Oct 20 20:50:17 2013
New Revision: 256802
URL: http://svnweb.freebsd.org/changeset/base/256802

Log:
  popen(): Try to prevent inappropriate fd passing even if 'e' is not used.
  
  Even though not all race conditions can be fixed if the 'e' option is not
  used, still fix some race conditions using pipe2():
  
  * Prevent both ends of the pipe from leaking to a concurrent popen().
  
  * Prevent the child process's end of the pipe from leaking to any concurrent
fork and exec.
  
  This change also simplifies the code.

Modified:
  head/lib/libc/gen/popen.c

Modified: head/lib/libc/gen/popen.c
==
--- head/lib/libc/gen/popen.c   Sun Oct 20 20:41:38 2013(r256801)
+++ head/lib/libc/gen/popen.c   Sun Oct 20 20:50:17 2013(r256802)
@@ -90,7 +90,7 @@ popen(command, type)
(type[1] && (type[1] != 'e' || type[2])))
return (NULL);
}
-   if ((cloexec ? pipe2(pdes, O_CLOEXEC) : pipe(pdes)) < 0)
+   if (pipe2(pdes, O_CLOEXEC) < 0)
return (NULL);
 
if ((cur = malloc(sizeof(struct pid))) == NULL) {
@@ -123,29 +123,20 @@ popen(command, type)
 * the compiler is free to corrupt all the local
 * variables.
 */
-   if (!cloexec)
-   (void)_close(pdes[0]);
if (pdes[1] != STDOUT_FILENO) {
(void)_dup2(pdes[1], STDOUT_FILENO);
-   if (!cloexec)
-   (void)_close(pdes[1]);
if (twoway)
(void)_dup2(STDOUT_FILENO, 
STDIN_FILENO);
} else if (twoway && (pdes[1] != STDIN_FILENO)) {
(void)_dup2(pdes[1], STDIN_FILENO);
-   if (cloexec)
-   (void)_fcntl(pdes[1], F_SETFD, 0);
-   } else if (cloexec)
+   (void)_fcntl(pdes[1], F_SETFD, 0);
+   } else
(void)_fcntl(pdes[1], F_SETFD, 0);
} else {
if (pdes[0] != STDIN_FILENO) {
(void)_dup2(pdes[0], STDIN_FILENO);
-   if (!cloexec)
-   (void)_close(pdes[0]);
-   } else if (cloexec)
+   } else
(void)_fcntl(pdes[0], F_SETFD, 0);
-   if (!cloexec)
-   (void)_close(pdes[1]);
}
SLIST_FOREACH(p, &pidlist, next)
(void)_close(fileno(p->fp));
@@ -171,6 +162,14 @@ popen(command, type)
SLIST_INSERT_HEAD(&pidlist, cur, next);
THREAD_UNLOCK();
 
+   /*
+* To guard against undesired fd passing with concurrent calls,
+* only clear the close-on-exec flag after linking the file into
+* the list which will cause an explicit close.
+*/
+   if (!cloexec)
+   (void)_fcntl(*type == 'r' ? pdes[0] : pdes[1], F_SETFD, 0);
+
return (iop);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256803 - in head/sys/ufs: ffs ufs

2013-10-20 Thread Kirk McKusick
Author: mckusick
Date: Sun Oct 20 20:52:07 2013
New Revision: 256803
URL: http://svnweb.freebsd.org/changeset/base/256803

Log:
  Second of several cleanups to soft dependency implementation.
  Delete two unused functions in ffs_sofdep.c.
  
  No functional change.
  
  Tested by:Peter Holm and Scott Long
  Sponsored by: Netflix

Modified:
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ufs/ufs_extern.h

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 20 20:50:17 2013
(r256802)
+++ head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 20 20:52:07 2013
(r256803)
@@ -521,14 +521,6 @@ softdep_slowdown(vp)
panic("softdep_slowdown called");
 }
 
-void
-softdep_releasefile(ip)
-   struct inode *ip;   /* inode with the zero effective link count */
-{
-
-   panic("softdep_releasefile called");
-}
-
 int
 softdep_request_cleanup(fs, vp, cred, resource)
struct fs *fs;
@@ -4695,32 +4687,6 @@ softdep_revert_create(dp, ip)
 }
 
 /*
- * Called to release the journal structures created by a failed dotdot link
- * creation.  Adjusts nlinkdelta for non-journaling softdep.
- */
-void
-softdep_revert_dotdot_link(dp, ip)
-   struct inode *dp;
-   struct inode *ip;
-{
-   struct inodedep *inodedep;
-   struct jaddref *jaddref;
-   struct vnode *dvp;
-
-   dvp = ITOV(dp);
-   ACQUIRE_LOCK(&lk);
-   inodedep = inodedep_lookup_ip(dp);
-   if (DOINGSUJ(dvp)) {
-   jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst,
-   inoreflst);
-   KASSERT(jaddref->ja_parent == ip->i_number,
-   ("softdep_revert_dotdot_link: addref parent mismatch"));
-   cancel_jaddref(jaddref, inodedep, &inodedep->id_inowait);
-   }
-   FREE_LOCK(&lk);
-}
-
-/*
  * Called to release the journal structures created by a failed link
  * addition.  Adjusts nlinkdelta for non-journaling softdep.
  */

Modified: head/sys/ufs/ufs/ufs_extern.h
==
--- head/sys/ufs/ufs/ufs_extern.h   Sun Oct 20 20:50:17 2013
(r256802)
+++ head/sys/ufs/ufs/ufs_extern.h   Sun Oct 20 20:52:07 2013
(r256803)
@@ -98,7 +98,6 @@ void  softdep_setup_remove(struct buf *,s
 void   softdep_setup_directory_change(struct buf *, struct inode *,
struct inode *, ino_t, int);
 void   softdep_change_linkcnt(struct inode *);
-void   softdep_releasefile(struct inode *);
 intsoftdep_slowdown(struct vnode *);
 void   softdep_setup_create(struct inode *, struct inode *);
 void   softdep_setup_dotdot_link(struct inode *, struct inode *);
@@ -107,7 +106,6 @@ voidsoftdep_setup_mkdir(struct inode *,
 void   softdep_setup_rmdir(struct inode *, struct inode *);
 void   softdep_setup_unlink(struct inode *, struct inode *);
 void   softdep_revert_create(struct inode *, struct inode *);
-void   softdep_revert_dotdot_link(struct inode *, struct inode *);
 void   softdep_revert_link(struct inode *, struct inode *);
 void   softdep_revert_mkdir(struct inode *, struct inode *);
 void   softdep_revert_rmdir(struct inode *, struct inode *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256804 - in head/sys: arm/freescale/imx boot/fdt/dts

2013-10-20 Thread Ian Lepore
Author: ian
Date: Sun Oct 20 21:03:15 2013
New Revision: 256804
URL: http://svnweb.freebsd.org/changeset/base/256804

Log:
  Switch to using the standard uart console driver instead of the special
  driver for early boot debugging.

Modified:
  head/sys/arm/freescale/imx/files.imx53
  head/sys/boot/fdt/dts/digi-ccwmx53.dts

Modified: head/sys/arm/freescale/imx/files.imx53
==
--- head/sys/arm/freescale/imx/files.imx53  Sun Oct 20 20:52:07 2013
(r256803)
+++ head/sys/arm/freescale/imx/files.imx53  Sun Oct 20 21:03:15 2013
(r256804)
@@ -12,8 +12,11 @@ arm/freescale/imx/imx53_machdep.cstanda
 arm/freescale/imx/common.c standard
 arm/freescale/imx/bus_space.c  standard
 
-# Dummy serial console
-arm/freescale/imx/console.cstandard
+# Special serial console for debuging early boot code
+#arm/freescale/imx/console.c   standard
+
+# UART driver (includes serial console support)
+dev/uart/uart_dev_imx.coptional uart
 
 # TrustZone Interrupt Controller
 arm/freescale/imx/tzic.c   standard
@@ -33,9 +36,6 @@ arm/freescale/imx/imx51_ccm.c standard
 # i.MX5xx PATA controller
 dev/ata/chipsets/ata-fsl.c optional imxata
 
-# UART driver
-#dev/uart/uart_dev_imx.c   optional uart
-
 # USB join controller (1 OTG, 3 EHCI)
 dev/usb/controller/ehci_imx.c  optional ehci
 

Modified: head/sys/boot/fdt/dts/digi-ccwmx53.dts
==
--- head/sys/boot/fdt/dts/digi-ccwmx53.dts  Sun Oct 20 20:52:07 2013
(r256803)
+++ head/sys/boot/fdt/dts/digi-ccwmx53.dts  Sun Oct 20 21:03:15 2013
(r256804)
@@ -70,9 +70,9 @@
};
 
/* UART1, console */
-   UART1: serial@53fbc000 {
+   console: serial@53fbc000 {
status = "okay";
-   clock-frequency = <300>; /* XXX */
+   clock-frequency = <0>; /* won't load w/o this */
};
 
clock@53fd4000 {
@@ -111,13 +111,12 @@
};
 
aliases {
-   UART1 = &UART1;
SSI2 = &SSI2;
};
 
chosen {
bootargs = "-v";
-   stdin = "UART1";
-   stdout = "UART1";
+   stdin  = &console;
+   stdout = &console;
};
 };
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256805 - head/lib/libc/gen

2013-10-20 Thread Jilles Tjoelker
Author: jilles
Date: Sun Oct 20 21:04:44 2013
New Revision: 256805
URL: http://svnweb.freebsd.org/changeset/base/256805

Log:
  syslog: Use SOCK_CLOEXEC instead of separate fcntl() call.

Modified:
  head/lib/libc/gen/syslog.c

Modified: head/lib/libc/gen/syslog.c
==
--- head/lib/libc/gen/syslog.c  Sun Oct 20 21:03:15 2013(r256804)
+++ head/lib/libc/gen/syslog.c  Sun Oct 20 21:04:44 2013(r256805)
@@ -341,9 +341,9 @@ connectlog(void)
struct sockaddr_un SyslogAddr;  /* AF_UNIX address of local logger */
 
if (LogFile == -1) {
-   if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
+   if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC,
+   0)) == -1)
return;
-   (void)_fcntl(LogFile, F_SETFD, FD_CLOEXEC);
}
if (LogFile != -1 && status == NOCONN) {
SyslogAddr.sun_len = sizeof(SyslogAddr);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256806 - in head/sys: arm/freescale/imx dev/ffec

2013-10-20 Thread Ian Lepore
Author: ian
Date: Sun Oct 20 21:07:38 2013
New Revision: 256806
URL: http://svnweb.freebsd.org/changeset/base/256806

Log:
  Add a driver for the Freescale Fast Ethernet Controller found on various
  Freescale SoCs including the i.MX series.  This also works for the newer
  SoCs with the ENET gigabit controller, but doesn't use any of the new
  hardware features other than enabling gigabit speed.

Added:
  head/sys/dev/ffec/
  head/sys/dev/ffec/if_ffec.c   (contents, props changed)
  head/sys/dev/ffec/if_ffecreg.h   (contents, props changed)
Modified:
  head/sys/arm/freescale/imx/files.imx53

Modified: head/sys/arm/freescale/imx/files.imx53
==
--- head/sys/arm/freescale/imx/files.imx53  Sun Oct 20 21:04:44 2013
(r256805)
+++ head/sys/arm/freescale/imx/files.imx53  Sun Oct 20 21:07:38 2013
(r256806)
@@ -49,3 +49,6 @@ dev/ofw/ofw_iicbus.c  optional fsliic
 # IPU - Image Processing Unit (frame buffer also)
 arm/freescale/imx/imx51_ipuv3.coptional sc
 
+# Fast Ethernet Controller
+dev/ffec/if_ffec.c optional ffec
+

Added: head/sys/dev/ffec/if_ffec.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/ffec/if_ffec.c Sun Oct 20 21:07:38 2013(r256806)
@@ -0,0 +1,1740 @@
+/*-
+ * Copyright (c) 2013 Ian Lepore 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * Driver for Freescale Fast Ethernet Controller, found on imx-series SoCs 
among
+ * others.  Also works for the ENET Gigibit controller found on imx6 and imx28,
+ * but the driver doesn't currently use any of the ENET advanced features other
+ * than enabling gigabit.
+ *
+ * The interface name 'fec' is already taken by netgraph's Fast Etherchannel
+ * (netgraph/ng_fec.c), so we use 'ffec'.
+ *
+ * Requires an FDT entry with at least these properties:
+ *   fec: ethernet@02188000 {
+ *  compatible = "fsl,imxNN-fec";
+ *  reg = <0x02188000 0x4000>;
+ *  interrupts = <150 151>;
+ *  phy-mode = "rgmii";
+ *  phy-disable-preamble; // optional
+ *   };
+ * The second interrupt number is for IEEE-1588, and is not currently used; it
+ * need not be present.  phy-mode must be one of: "mii", "rmii", "rgmii".
+ * There is also an optional property, phy-disable-preamble, which if present
+ * will disable the preamble bits, cutting the size of each mdio transaction
+ * (and thus the busy-wait time) in half.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "miibus_if.h"
+
+/*
+ * Driver data and defines.
+ */
+#defineRX_DESC_COUNT   64
+#defineRX_DESC_SIZE(sizeof(struct ffec_hwdesc) * RX_DESC_COUNT)
+#defineTX_DESC_COUNT   64
+#defineTX_DESC_SIZE(sizeof(struct ffec_hwdesc) * TX_DESC_COUNT)
+
+#defineWATCHDOG_TIMEOUT_SECS   5
+#defineSTATS_HARVEST_INTERVAL  3
+
+struct ffec_bufmap {
+   struct mbuf *mbuf;
+   bus_dmamap_tmap;
+};
+
+enum {
+   PHY_CONN_UNKNOWN,
+   PHY_CONN_MII,
+   PHY_CONN_RMII,
+   PHY_CONN_RGMII
+};
+
+enum {
+   FECTYPE_GENERIC,
+   FECTYPE_IMX51,
+   FECTYPE_IMX53,
+   FECTYPE_IMX6,
+};
+
+struct ffec_softc {
+   device_tdev;
+   device_t  

svn commit: r256808 - head/sys/ufs/ffs

2013-10-20 Thread Kirk McKusick
Author: mckusick
Date: Sun Oct 20 21:11:40 2013
New Revision: 256808
URL: http://svnweb.freebsd.org/changeset/base/256808

Log:
  Third of several cleanups to soft dependency implementation.
  Ensure that softdep_unmount() and softdep_setup_sbupdate()
  only get called for filesystems running with soft dependencies.
  
  No functional change.
  
  Tested by:Peter Holm and Scott Long
  Sponsored by: Netflix

Modified:
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 20 21:11:36 2013
(r256807)
+++ head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 20 21:11:40 2013
(r256808)
@@ -13686,6 +13686,17 @@ DB_SHOW_COMMAND(mkdirs, db_show_mkdirs)
}
 }
 
+/* exported to ffs_vfsops.c */
+extern void db_print_ffs(struct ufsmount *ump);
+void
+db_print_ffs(struct ufsmount *ump)
+{
+   db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n",
+   ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname,
+   ump->um_devvp, ump->um_fs, ump->softdep_on_worklist,
+   ump->softdep_deps, ump->softdep_req);
+}
+
 #endif /* DDB */
 
 #endif /* SOFTUPDATES */

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==
--- head/sys/ufs/ffs/ffs_vfsops.c   Sun Oct 20 21:11:36 2013
(r256807)
+++ head/sys/ufs/ffs/ffs_vfsops.c   Sun Oct 20 21:11:40 2013
(r256808)
@@ -1286,7 +1286,8 @@ ffs_unmount(mp, mntflags)
fs->fs_pendinginodes = 0;
}
UFS_UNLOCK(ump);
-   softdep_unmount(mp);
+   if (MOUNTEDSOFTDEP(mp))
+   softdep_unmount(mp);
if (fs->fs_ronly == 0 || ump->um_fsckpid > 0) {
fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1;
error = ffs_sbupdate(ump, MNT_WAIT, 0);
@@ -1943,7 +1944,7 @@ ffs_sbupdate(ump, waitfor, suspended)
}
fs->fs_fmod = 0;
fs->fs_time = time_second;
-   if (fs->fs_flags & FS_DOSOFTDEP)
+   if (MOUNTEDSOFTDEP(ump->um_mountp))
softdep_setup_sbupdate(ump, (struct fs *)bp->b_data, bp);
bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize);
ffs_oldfscompat_write((struct fs *)bp->b_data, ump);
@@ -2221,14 +,8 @@ ffs_own_mount(const struct mount *mp)
 
 #ifdef DDB
 
-static void
-db_print_ffs(struct ufsmount *ump)
-{
-   db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n",
-   ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname,
-   ump->um_devvp, ump->um_fs, ump->softdep_on_worklist,
-   ump->softdep_deps, ump->softdep_req);
-}
+/* defined in ffs_softdep.c */
+extern void db_print_ffs(struct ufsmount *ump);
 
 DB_SHOW_COMMAND(ffs, db_show_ffs)
 {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256809 - in head/sys: arm/conf boot/fdt/dts

2013-10-20 Thread Ian Lepore
Author: ian
Date: Sun Oct 20 21:21:07 2013
New Revision: 256809
URL: http://svnweb.freebsd.org/changeset/base/256809

Log:
  Add configuration for the Freescale i.MX53 Quick Start Board.

Added:
  head/sys/arm/conf/IMX53-QSB   (contents, props changed)
  head/sys/boot/fdt/dts/imx53-qsb.dts   (contents, props changed)

Added: head/sys/arm/conf/IMX53-QSB
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/conf/IMX53-QSB Sun Oct 20 21:21:07 2013(r256809)
@@ -0,0 +1,179 @@
+# Kernel configuration for Freescale i.MX53 Quick Start Board
+#
+# For more information on this file, please read the config(5) manual page,
+# and/or the handbook section on Kernel Configuration Files:
+#
+#
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files.
+# If you are in doubt as to the purpose or necessity of a line, check first
+# in NOTES.
+#
+# $FreeBSD$
+
+ident  IMX53-QSB
+
+include"../freescale/imx/std.imx53"
+
+makeoptionsDEBUG=-g# Build kernel with gdb(1) debug symbols
+#options   DEBUG
+
+optionsHZ=250  # 4ms scheduling quantum
+optionsSCHED_4BSD  # 4BSD scheduler
+#options   PREEMPTION  # Enable kernel thread preemption
+optionsINET# InterNETworking
+optionsINET6   # IPv6 communications protocols
+#options   SCTP# Stream Control Transmission Protocol
+optionsFFS # Berkeley Fast Filesystem
+optionsSOFTUPDATES # Enable FFS soft updates support
+optionsUFS_ACL # Support for access control lists
+optionsUFS_DIRHASH # Improve performance on big directories
+optionsUFS_GJOURNAL# Enable gjournal-based UFS journaling
+#options   MD_ROOT # MD is a potential root device
+optionsNFSCL   # New Network Filesystem Client
+#options   NFSD# New Network Filesystem Server
+optionsNFSLOCKD# Network Lock Manager
+optionsNFS_ROOT# NFS usable as /, requires NFSCL
+optionsMSDOSFS # MSDOS Filesystem
+optionsCD9660  # ISO 9660 Filesystem
+#options   PROCFS  # Process filesystem (requires PSEUDOFS)
+optionsPSEUDOFS# Pseudo-filesystem framework
+optionsTMPFS   # TMP Memory Filesystem
+optionsGEOM_PART_GPT   # GUID Partition Tables.
+optionsGEOM_LABEL  # Provides labelization
+#options   COMPAT_FREEBSD5 # Compatible with FreeBSD5
+#options   COMPAT_FREEBSD6 # Compatible with FreeBSD6
+#options   COMPAT_FREEBSD7 # Compatible with FreeBSD7
+optionsSCSI_DELAY=5000 # Delay (in ms) before probing SCSI
+optionsKTRACE  # ktrace(1) support
+optionsSYSVSHM # SYSV-style shared memory
+optionsSYSVMSG # SYSV-style message queues
+optionsSYSVSEM # SYSV-style semaphores
+options_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time 
extensions
+optionsINCLUDE_CONFIG_FILE # Include this file in kernel
+optionsVFP # vfp/neon
+
+# required for netbooting
+#options   BOOTP
+#options   BOOTP_COMPAT
+#options   BOOTP_NFSROOT
+#options   BOOTP_NFSV3
+#options   BOOTP_WIRED_TO=ue0
+
+#options   ROOTDEVNAME=\"ufs:ada0s2a\"
+
+
+# kernel/memory size reduction
+#options   MUTEX_NOINLINE
+#options   NO_FFS_SNAPSHOT
+#options   NO_SWAPPING
+#options   NO_SYSCTL_DESCR
+#options   RWLOCK_NOINLINE
+
+# Debugging support.  Always need this:
+optionsKDB # Enable kernel debugger support.
+# For minimum debugger support (stable branch) use:
+#options   KDB_TRACE   # Print a stack trace for a panic.
+# For full debugger support use this instead:
+optionsDDB # Support DDB.
+#options   GDB # Support remote GDB.
+#options   DEADLKRES   # Enable the deadlock resolver
+#options   INVARIANTS  # Enable calls of extra sanity checking
+#options   INVARIANT_SUPPORT   # Extra sanity checks of internal 
structures, required by INVARIANTS
+#options   WITN

svn commit: r256812 - head/sys/ufs/ffs

2013-10-20 Thread Kirk McKusick
Author: mckusick
Date: Sun Oct 20 22:21:01 2013
New Revision: 256812
URL: http://svnweb.freebsd.org/changeset/base/256812

Log:
  Fourth of several cleanups to soft dependency implementation.
  Add KASSERTS that soft dependency functions only get called
  for filesystems running with soft dependencies. Calling these
  functions when soft updates are not compiled into the system
  become panic's.
  
  No functional change.
  
  Tested by:Peter Holm and Scott Long
  Sponsored by: Netflix

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 20 21:23:52 2013
(r256811)
+++ head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 20 22:21:01 2013
(r256812)
@@ -138,6 +138,7 @@ softdep_unmount(mp)
struct mount *mp;
 {
 
+   panic("softdep_unmount called");
 }
 
 void
@@ -146,6 +147,8 @@ softdep_setup_sbupdate(ump, fs, bp)
struct fs *fs;
struct buf *bp;
 {
+
+   panic("softdep_setup_sbupdate called");
 }
 
 void
@@ -433,8 +436,6 @@ softdep_prealloc(vp, waitok)
 {
 
panic("%s called", __FUNCTION__);
-
-   return (0);
 }
 
 int
@@ -503,14 +504,14 @@ int
 softdep_sync_metadata(struct vnode *vp)
 {
 
-   return (0);
+   panic("softdep_sync_metadata called");
 }
 
 int
 softdep_sync_buf(struct vnode *vp, struct buf *bp, int waitfor)
 {
 
-   return (0);
+   panic("softdep_sync_buf called");
 }
 
 int
@@ -1851,6 +1852,10 @@ softdep_move_dependencies(oldbp, newbp)
struct worklist *wk, *wktail;
int dirty;
 
+   if ((wk = LIST_FIRST(&oldbp->b_dep)) == NULL)
+   return (0);
+   KASSERT(MOUNTEDSOFTDEP(wk->wk_mp) != 0,
+   ("softdep_move_dependencies called on non-softdep filesystem"));
dirty = 0;
wktail = NULL;
ACQUIRE_LOCK(&lk);
@@ -1946,6 +1951,8 @@ softdep_flushfiles(oldmnt, flags, td)
int error, early, depcount, loopcnt, retry_flush_count, retry;
int morework;
 
+   KASSERT(MOUNTEDSOFTDEP(oldmnt) != 0,
+   ("softdep_flushfiles called on non-softdep filesystem"));
loopcnt = 10;
retry_flush_count = 3;
 retry_flush:
@@ -2497,6 +2504,8 @@ softdep_unmount(mp)
struct mount *mp;
 {
 
+   KASSERT(MOUNTEDSOFTDEP(mp) != 0,
+   ("softdep_unmount called on non-softdep filesystem"));
MNT_ILOCK(mp);
mp->mnt_flag &= ~MNT_SOFTDEP;
if (MOUNTEDSUJ(mp) == 0) {
@@ -2876,6 +2885,8 @@ softdep_prealloc(vp, waitok)
 {
struct ufsmount *ump;
 
+   KASSERT(MOUNTEDSOFTDEP(vp->v_mount) != 0,
+   ("softdep_prealloc called on non-softdep filesystem"));
/*
 * Nothing to do if we are not running journaled soft updates.
 * If we currently hold the snapshot lock, we must avoid handling
@@ -4495,6 +4506,8 @@ softdep_setup_create(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
 
+   KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+   ("softdep_setup_create called on non-softdep filesystem"));
KASSERT(ip->i_nlink == 1,
("softdep_setup_create: Invalid link count."));
dvp = ITOV(dp);
@@ -4526,6 +4539,8 @@ softdep_setup_dotdot_link(dp, ip)
struct vnode *dvp;
struct vnode *vp;
 
+   KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+   ("softdep_setup_dotdot_link called on non-softdep filesystem"));
dvp = ITOV(dp);
vp = ITOV(ip);
jaddref = NULL;
@@ -4560,6 +4575,8 @@ softdep_setup_link(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
 
+   KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+   ("softdep_setup_link called on non-softdep filesystem"));
dvp = ITOV(dp);
jaddref = NULL;
if (DOINGSUJ(dvp))
@@ -4591,6 +4608,8 @@ softdep_setup_mkdir(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
 
+   KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+   ("softdep_setup_mkdir called on non-softdep filesystem"));
dvp = ITOV(dp);
dotaddref = dotdotaddref = NULL;
if (DOINGSUJ(dvp)) {
@@ -4633,6 +4652,8 @@ softdep_setup_rmdir(dp, ip)
 {
struct vnode *dvp;
 
+   KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+   ("softdep_setup_rmdir called on non-softdep filesystem"));
dvp = ITOV(dp);
ACQUIRE_LOCK(&lk);
(void) inodedep_lookup_ip(ip);
@@ -4652,6 +4673,8 @@ softdep_setup_unlink(dp, ip)
 {
struct vnode *dvp;
 
+   KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+   ("softdep_setup_unlink called on non-softdep filesystem"));
dvp = ITOV(dp);
ACQUIRE_LOCK(&lk);
(void) inodedep_lookup_ip(ip);
@@ -4673,6 +4696,8 @@ softdep_revert_create(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
 
+   KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_u

svn commit: r256813 - head/sys/conf

2013-10-20 Thread Justin T. Gibbs
Author: gibbs
Date: Sun Oct 20 22:50:57 2013
New Revision: 256813
URL: http://svnweb.freebsd.org/changeset/base/256813

Log:
  The Xen userland event channel driver isn't complete.  Disabled it
  from the kernel build until it is ready.
  
  sys/conf/files:
Remove the entry for xen/evtchn/evtchn_dev.c so it is not included
in any kernel builds.
  
  Noticed by:   smh

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sun Oct 20 22:21:01 2013(r256812)
+++ head/sys/conf/files Sun Oct 20 22:50:57 2013(r256813)
@@ -3846,7 +3846,6 @@ vm/vm_zeroidle.c  standard
 vm/vnode_pager.c   standard
 xen/gnttab.c   optional xen | xenhvm
 xen/features.c optional xen | xenhvm
-xen/evtchn/evtchn_dev.coptional xen | xenhvm
 xen/xenbus/xenbus_if.m optional xen | xenhvm
 xen/xenbus/xenbus.coptional xen | xenhvm
 xen/xenbus/xenbusb_if.moptional xen | xenhvm
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256814 - head/sys/powerpc/booke

2013-10-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct 20 23:02:16 2013
New Revision: 256814
URL: http://svnweb.freebsd.org/changeset/base/256814

Log:
  Avoid sign overflow if there are more than 2 GB of RAM.

Modified:
  head/sys/powerpc/booke/machdep.c

Modified: head/sys/powerpc/booke/machdep.c
==
--- head/sys/powerpc/booke/machdep.cSun Oct 20 22:50:57 2013
(r256813)
+++ head/sys/powerpc/booke/machdep.cSun Oct 20 23:02:16 2013
(r256814)
@@ -192,7 +192,8 @@ extern int elf32_nxstack;
 static void
 cpu_booke_startup(void *dummy)
 {
-   int indx, size;
+   int indx;
+   unsigned long size;
 
/* Initialise the decrementer-based clock. */
decr_init();
@@ -200,7 +201,7 @@ cpu_booke_startup(void *dummy)
/* Good {morning,afternoon,evening,night}. */
cpu_setup(PCPU_GET(cpuid));
 
-   printf("real memory  = %ld (%ld MB)\n", ptoa(physmem),
+   printf("real memory  = %lu (%ld MB)\n", ptoa(physmem),
ptoa(physmem) / 1048576);
realmem = physmem;
 
@@ -210,7 +211,7 @@ cpu_booke_startup(void *dummy)
for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) {
size = phys_avail[indx + 1] - phys_avail[indx];
 
-   printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n",
+   printf("0x%08x - 0x%08x, %lu bytes (%lu pages)\n",
phys_avail[indx], phys_avail[indx + 1] - 1,
size, size / PAGE_SIZE);
}
@@ -218,7 +219,7 @@ cpu_booke_startup(void *dummy)
 
vm_ksubmap_init(&kmi);
 
-   printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count),
+   printf("avail memory = %lu (%ld MB)\n", ptoa(cnt.v_free_count),
ptoa(cnt.v_free_count) / 1048576);
 
/* Set up buffers, so they can be used to read disk labels. */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256815 - head/sys/dev/uart

2013-10-20 Thread Ian Lepore
Author: ian
Date: Sun Oct 20 23:40:16 2013
New Revision: 256815
URL: http://svnweb.freebsd.org/changeset/base/256815

Log:
  Calculate the baud rate divisor rather than using a hard-coded value.
  
  Submitted by: Steven Lawrance 

Modified:
  head/sys/dev/uart/uart_dev_pl011.c

Modified: head/sys/dev/uart/uart_dev_pl011.c
==
--- head/sys/dev/uart/uart_dev_pl011.c  Sun Oct 20 23:02:16 2013
(r256814)
+++ head/sys/dev/uart/uart_dev_pl011.c  Sun Oct 20 23:40:16 2013
(r256815)
@@ -147,9 +147,6 @@ uart_pl011_param(struct uart_bas *bas, i
break;
}
 
-   /* TODO: Calculate divisors */
-   baud = (0x1 << 16) | 0x28;
-
if (stopbits == 2)
line |= LCR_H_STP2;
else
@@ -164,8 +161,11 @@ uart_pl011_param(struct uart_bas *bas, i
line &=  ~LCR_H_FEN;
ctrl |= (CR_RXE | CR_TXE | CR_UARTEN);
 
-   __uart_setreg(bas, UART_IBRD, ((uint32_t)(baud >> 16)) & IBRD_BDIVINT);
-   __uart_setreg(bas, UART_FBRD, (uint32_t)(baud) & FBRD_BDIVFRAC);
+   if (bas->rclk != 0 && baudrate != 0) {
+   baud = bas->rclk * 4 / baudrate;
+   __uart_setreg(bas, UART_IBRD, ((uint32_t)(baud >> 6)) & 
IBRD_BDIVINT);
+   __uart_setreg(bas, UART_FBRD, (uint32_t)(baud & 0x3F) & 
FBRD_BDIVFRAC);
+   }
 
/* Add config. to line before reenabling UART */
__uart_setreg(bas, UART_LCR_H, (__uart_getreg(bas, UART_LCR_H) &
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256816 - in head/sys: dev/ofw powerpc/ofw

2013-10-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Oct 21 00:04:26 2013
New Revision: 256816
URL: http://svnweb.freebsd.org/changeset/base/256816

Log:
  Allow the OFW interrupt mapping code to work with PCI devices not enumerated
  by Open Firmware, as in the case of FDT.

Modified:
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/powerpc/ofw/ofw_pci.c
  head/sys/powerpc/ofw/ofw_pcib_pci.c
  head/sys/powerpc/ofw/ofw_pcibus.c

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==
--- head/sys/dev/ofw/ofw_bus_subr.c Sun Oct 20 23:40:16 2013
(r256815)
+++ head/sys/dev/ofw/ofw_bus_subr.c Mon Oct 21 00:04:26 2013
(r256816)
@@ -208,7 +208,6 @@ ofw_bus_has_prop(device_t dev, const cha
return (OF_hasprop(node, propname));
 }
 
-#ifndef FDT
 void
 ofw_bus_setup_iinfo(phandle_t node, struct ofw_bus_iinfo *ii, int intrsz)
 {
@@ -246,9 +245,11 @@ ofw_bus_lookup_imap(phandle_t node, stru
KASSERT(regsz >= ii->opi_addrc,
("ofw_bus_lookup_imap: register size too small: %d < %d",
regsz, ii->opi_addrc));
-   rv = OF_getprop(node, "reg", reg, regsz);
-   if (rv < regsz)
-   panic("ofw_bus_lookup_imap: could not get reg property");
+   if (node != -1) {
+   rv = OF_getprop(node, "reg", reg, regsz);
+   if (rv < regsz)
+   panic("ofw_bus_lookup_imap: cannot get reg property");
+   }
return (ofw_bus_search_intrmap(pintr, pintrsz, reg, ii->opi_addrc,
ii->opi_imap, ii->opi_imapsz, ii->opi_imapmsk, maskbuf, mintr,
mintrsz, iparent));
@@ -328,4 +329,4 @@ ofw_bus_search_intrmap(void *intr, int i
}
return (0);
 }
-#endif /* !FDT */
+

Modified: head/sys/powerpc/ofw/ofw_pci.c
==
--- head/sys/powerpc/ofw/ofw_pci.c  Sun Oct 20 23:40:16 2013
(r256815)
+++ head/sys/powerpc/ofw/ofw_pci.c  Mon Oct 21 00:04:26 2013
(r256816)
@@ -246,6 +246,13 @@ ofw_pci_route_interrupt(device_t bus, de
 
sc = device_get_softc(bus);
pintr = pin;
+
+   /* Fabricate imap information in case this isn't an OFW device */
+   bzero(®, sizeof(reg));
+   reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) |
+   (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) |
+   (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT);
+
if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®,
sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr),
&iparent, maskbuf))

Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c
==
--- head/sys/powerpc/ofw/ofw_pcib_pci.c Sun Oct 20 23:40:16 2013
(r256815)
+++ head/sys/powerpc/ofw/ofw_pcib_pci.c Mon Oct 21 00:04:26 2013
(r256816)
@@ -29,6 +29,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -141,6 +142,13 @@ ofw_pcib_pci_route_interrupt(device_t br
ii = &sc->ops_iinfo;
if (ii->opi_imapsz > 0) {
pintr = intpin;
+
+   /* Fabricate imap information if this isn't an OFW device */
+   bzero(®, sizeof(reg));
+   reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) |
+   (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) |
+   (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT);
+
if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®,
sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr),
&iparent, maskbuf)) {

Modified: head/sys/powerpc/ofw/ofw_pcibus.c
==
--- head/sys/powerpc/ofw/ofw_pcibus.c   Sun Oct 20 23:40:16 2013
(r256815)
+++ head/sys/powerpc/ofw/ofw_pcibus.c   Mon Oct 21 00:04:26 2013
(r256816)
@@ -322,20 +322,9 @@ ofw_pcibus_assign_interrupt(device_t dev
if (node == -1) {
/* Non-firmware enumerated child, use standard routing */

-   /*
-* XXX: Right now we don't have anything sensible to do here,
-* since the ofw_imap stuff relies on nodes having a reg
-* property. There exist ways around this, so the ePAPR
-* spec will need to be studied.
-*/
-
-   return (PCI_INVALID_IRQ);
-
-#ifdef NOTYET
intr = pci_get_intpin(child);
return (PCIB_ROUTE_INTERRUPT(device_get_parent(dev), child, 
intr));
-#endif
}

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


svn commit: r256817 - in head/sys/ufs: ffs ufs

2013-10-20 Thread Kirk McKusick
Author: mckusick
Date: Mon Oct 21 00:28:02 2013
New Revision: 256817
URL: http://svnweb.freebsd.org/changeset/base/256817

Log:
  Restructuring of the soft updates code to set it up so that the
  single kernel-wide soft update lock can be replaced with a
  per-filesystem soft-updates lock. This per-filesystem lock will
  allow each filesystem to have its own soft-updates flushing thread
  rather than being limited to a single soft-updates flushing thread
  for the entire kernel.
  
  Move soft update variables out of the ufsmount structure and into
  their own mount_softdeps structure referenced by ufsmount field
  um_softdep.  Eventually the per-filesystem lock will be in this
  structure. For now there is simply a pointer to the kernel-wide
  soft updates lock.
  
  Change all instances of ACQUIRE_LOCK and FREE_LOCK to pass the lock
  pointer in the mount_softdeps structure instead of a pointer to the
  kernel-wide soft-updates lock.
  
  Replace the five hash tables used by soft updates with per-filesystem
  copies of these tables allocated in the mount_softdeps structure.
  
  Several functions that flush dependencies when too many are allocated
  in the kernel used to operate across all filesystems. They are now
  parameterized to flush dependencies from a specified filesystem.
  For now, we stick with the round-robin flushing strategy when the
  kernel as a whole has too many dependencies allocated.
  
  While there are many lines of changes, there should be no functional
  change in the operation of soft updates.
  
  Tested by:Peter Holm and Scott Long
  Sponsored by: Netflix

Modified:
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/softdep.h
  head/sys/ufs/ufs/ufsmount.h

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Mon Oct 21 00:04:26 2013
(r256816)
+++ head/sys/ufs/ffs/ffs_softdep.c  Mon Oct 21 00:28:02 2013
(r256817)
@@ -616,48 +616,6 @@ softdep_freework(wkhd)
 
 FEATURE(softupdates, "FFS soft-updates support");
 
-/*
- * These definitions need to be adapted to the system to which
- * this file is being ported.
- */
-
-#define M_SOFTDEP_FLAGS(M_WAITOK)
-
-#defineD_PAGEDEP   0
-#defineD_INODEDEP  1
-#defineD_BMSAFEMAP 2
-#defineD_NEWBLK3
-#defineD_ALLOCDIRECT   4
-#defineD_INDIRDEP  5
-#defineD_ALLOCINDIR6
-#defineD_FREEFRAG  7
-#defineD_FREEBLKS  8
-#defineD_FREEFILE  9
-#defineD_DIRADD10
-#defineD_MKDIR 11
-#defineD_DIRREM12
-#defineD_NEWDIRBLK 13
-#defineD_FREEWORK  14
-#defineD_FREEDEP   15
-#defineD_JADDREF   16
-#defineD_JREMREF   17
-#defineD_JMVREF18
-#defineD_JNEWBLK   19
-#defineD_JFREEBLK  20
-#defineD_JFREEFRAG 21
-#defineD_JSEG  22
-#defineD_JSEGDEP   23
-#defineD_SBDEP 24
-#defineD_JTRUNC25
-#defineD_JFSYNC26
-#defineD_SENTINEL  27
-#defineD_LAST  D_SENTINEL
-
-unsigned long dep_current[D_LAST + 1];
-unsigned long dep_highuse[D_LAST + 1];
-unsigned long dep_total[D_LAST + 1];
-unsigned long dep_write[D_LAST + 1];
-
 static SYSCTL_NODE(_debug, OID_AUTO, softdep, CTLFLAG_RW, 0,
 "soft updates stats");
 static SYSCTL_NODE(_debug_softdep, OID_AUTO, total, CTLFLAG_RW, 0,
@@ -669,6 +627,11 @@ static SYSCTL_NODE(_debug_softdep, OID_A
 static SYSCTL_NODE(_debug_softdep, OID_AUTO, write, CTLFLAG_RW, 0,
 "current dependencies written");
 
+unsigned long dep_current[D_LAST + 1];
+unsigned long dep_highuse[D_LAST + 1];
+unsigned long dep_total[D_LAST + 1];
+unsigned long dep_write[D_LAST + 1];
+
 #defineSOFTDEP_TYPE(type, str, long)   
\
 static MALLOC_DEFINE(M_ ## type, #str, long);  \
 SYSCTL_ULONG(_debug_softdep_total, OID_AUTO, str, CTLFLAG_RD,  \
@@ -713,6 +676,9 @@ static MALLOC_DEFINE(M_SENTINEL, "sentin
 
 static MALLOC_DEFINE(M_SAVEDINO, "savedino", "Saved inodes");
 static MALLOC_DEFINE(M_JBLOCKS, "jblocks", "Journal block locations");
+static MALLOC_DEFINE(M_MOUNTDATA, "softdep", "Softdep per-mount data");
+
+#define M_SOFTDEP_FLAGS(M_WAITOK)
 
 /* 
  * translate from workitem type to memory type
@@ -749,8 +715,6 @@ static struct malloc_type *memtype[] = {
M_SENTINEL
 };
 
-static LIST_HEAD(mkdirlist, mkdir) mkdirlisthd;
-
 #define DtoM(type) (memtype[type])
 
 /*
@@ -766,51 +730,16 @@ static LIST_HEAD(mkdirlist, mkdir) mkdir
 #defineDOT_OFFSET  offsetof(struct dirtemplate, dot_ino)
 
 /*
- * Forward declarations.
- */
-struct inodedep_hashhead;
-struct newblk_hashhead;
-struct pagedep_hashhead;
-struct bmsafemap_hashhead;
-
-/*
- * Private journaling

svn commit: r256818 - head/sys/powerpc/powerpc

2013-10-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Oct 21 00:58:35 2013
New Revision: 256818
URL: http://svnweb.freebsd.org/changeset/base/256818

Log:
  Fix 80-column line wrapping in a comment.

Modified:
  head/sys/powerpc/powerpc/clock.c

Modified: head/sys/powerpc/powerpc/clock.c
==
--- head/sys/powerpc/powerpc/clock.cMon Oct 21 00:28:02 2013
(r256817)
+++ head/sys/powerpc/powerpc/clock.cMon Oct 21 00:58:35 2013
(r256818)
@@ -167,8 +167,8 @@ decr_init(void)
char buf[32];
 
/*
-* Check the BSP's timebase frequency. Sometimes we can't find the BSP, 
so fall
-* back to the first CPU in this case.
+* Check the BSP's timebase frequency. Sometimes we can't find the BSP,
+* so fall back to the first CPU in this case.
 */
if (platform_smp_get_bsp(&cpu) != 0)
platform_smp_first_cpu(&cpu);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256822 - in head/sys/cddl: contrib/opensolaris/uts/intel/dtrace dev/dtrace/amd64

2013-10-20 Thread Mark Johnston
Author: markj
Date: Mon Oct 21 04:15:55 2013
New Revision: 256822
URL: http://svnweb.freebsd.org/changeset/base/256822

Log:
  When fetching function arguments out of a frame on amd64, explicitly select
  the register based on the argument index rather than relying on the fields
  in struct reg to be in the right order. This assumption is incorrect on
  FreeBSD and generally led to bogus argument values for the sixth argument
  of PID and USDT probes; the first five are passed directly to dtrace_probe()
  via the fasttrap trap handler and so were correctly handled.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Mon Oct 
21 04:00:23 2013(r256821)
+++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Mon Oct 
21 04:15:55 2013(r256822)
@@ -272,7 +272,20 @@ fasttrap_anarg(struct reg *rp, int funct
 * registers.
 */
if (argno < 6)
-   return ((&rp->r_rdi)[argno]);
+   switch (argno) {
+   case 0:
+   return (rp->r_rdi);
+   case 1:
+   return (rp->r_rsi);
+   case 2:
+   return (rp->r_rdx);
+   case 3:
+   return (rp->r_rcx);
+   case 4:
+   return (rp->r_r8);
+   case 5:
+   return (rp->r_r9);
+   }
 
stack = (uintptr_t *)rp->r_rsp;
DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c
==
--- head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Mon Oct 21 04:00:23 2013
(r256821)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Mon Oct 21 04:15:55 2013
(r256822)
@@ -367,7 +367,27 @@ dtrace_getarg(int arg, int aframes)
sizeof (uintptr_t));
 
if (arg <= inreg) {
-   stack = (uintptr_t *)&rp->r_rdi;
+   switch (arg) {
+   case 0:
+   stack = (uintptr_t *)&rp->r_rdi;
+   break;
+   case 1:
+   stack = (uintptr_t *)&rp->r_rsi;
+   break;
+   case 2:
+   stack = (uintptr_t *)&rp->r_rdx;
+   break;
+   case 3:
+   stack = (uintptr_t *)&rp->r_rcx;
+   break;
+   case 4:
+   stack = (uintptr_t *)&rp->r_r8;
+   break;
+   case 5:
+   stack = (uintptr_t *)&rp->r_r9;
+   break;
+   }
+   arg = 0;
} else {
stack = (uintptr_t *)(rp->r_rsp);
arg -= inreg;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256823 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2013-10-20 Thread Jason Evans
Author: jasone
Date: Mon Oct 21 05:10:46 2013
New Revision: 256823
URL: http://svnweb.freebsd.org/changeset/base/256823

Log:
  Update jemalloc to version 3.4.1.

Modified:
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/FREEBSD-upgrade
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/arena.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
  head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h
  head/contrib/jemalloc/include/jemalloc/internal/tcache.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/chunk.c
  head/contrib/jemalloc/src/ctl.c
  head/contrib/jemalloc/src/jemalloc.c

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Mon Oct 21 04:15:55 2013
(r256822)
+++ head/contrib/jemalloc/ChangeLog Mon Oct 21 05:10:46 2013
(r256823)
@@ -6,6 +6,21 @@ found in the git revision history:
 http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git
 git://canonware.com/jemalloc.git
 
+* 3.4.1 (October 20, 2013)
+
+  Bug fixes:
+  - Fix a race in the "arenas.extend" mallctl that could cause memory 
corruption
+of internal data structures and subsequent crashes.
+  - Fix Valgrind integration flaws that caused Valgrind warnings about reads of
+uninitialized memory in:
++ arena chunk headers
++ internal zero-initialized data structures (relevant to tcache and prof
+  code)
+  - Preserve errno during the first allocation.  A readlink(2) call during
+initialization fails unless /etc/malloc.conf exists, so errno was typically
+set during the first allocation prior to this fix.
+  - Fix compilation warnings reported by gcc 4.8.1.
+
 * 3.4.0 (June 2, 2013)
 
   This version is essentially a small bugfix release, but the addition of
@@ -60,7 +75,7 @@ found in the git revision history:
 
   Bug fixes:
   - Fix "arenas.extend" mallctl to output the number of arenas.
-  - Fix chunk_recycyle() to unconditionally inform Valgrind that returned 
memory
+  - Fix chunk_recycle() to unconditionally inform Valgrind that returned memory
 is undefined.
   - Fix build break on FreeBSD related to alloca.h.
 

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Mon Oct 21 04:15:55 2013
(r256822)
+++ head/contrib/jemalloc/FREEBSD-diffs Mon Oct 21 05:10:46 2013
(r256823)
@@ -45,7 +45,7 @@ index abd5e6f..1d7491a 100644
 +  
  
 diff --git a/include/jemalloc/internal/jemalloc_internal.h.in 
b/include/jemalloc/internal/jemalloc_internal.h.in
-index e46ac54..527449d 100644
+index 53c135c..c547339 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in
 +++ b/include/jemalloc/internal/jemalloc_internal.h.in
 @@ -1,5 +1,8 @@
@@ -97,10 +97,10 @@ index de44e14..564d604 100644
  
  bool  malloc_mutex_init(malloc_mutex_t *mutex);
 diff --git a/include/jemalloc/internal/private_namespace.h 
b/include/jemalloc/internal/private_namespace.h
-index 65de316..366676b 100644
+index cdb0b0e..2a98d1f 100644
 --- a/include/jemalloc/internal/private_namespace.h
 +++ b/include/jemalloc/internal/private_namespace.h
-@@ -216,7 +216,6 @@
+@@ -218,7 +218,6 @@
  #define   iralloc JEMALLOC_N(iralloc)
  #define   irallocx JEMALLOC_N(irallocx)
  #define   isalloc JEMALLOC_N(isalloc)
@@ -244,7 +244,7 @@ index 000..e6c8407
 +#endif
 +
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index bc350ed..352c98e 100644
+index ae56db6..1412a5e 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -8,6 +8,10 @@ malloc_tsd_data(, arenas, arena_t *, NULL)

Modified: head/contrib/jemalloc/FREEBSD-upgrade
==
--- head/contrib/jemalloc/FREEBSD-upgrade   Mon Oct 21 04:15:55 2013
(r256822)
+++ head/contrib/jemalloc/FREEBSD-upgrade   Mon Oct 21 05:10:46 2013
(r256823)
@@ -60,7 +60,7 @@ do_extract() {
   local rev=$1
   # Clone.
   rm -rf ${work}
-  git clone git://canonware.com/jemalloc.git ${work}
+  git clone https://github.com/jemalloc/jemalloc.git ${work}
   (
 cd ${work}
 if [ "x${rev}" != "x" ] ; then

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Mon Oct 21 04:15:55 2013
(r256822)
+++ head/contrib/jemalloc/VERSION   Mon Oct 21 05:10:46 2013
(r256823)
@@ -1 +1 @@
-3.4.0-0-g0ed518e5dab789ad2171bb38977a8927e2a26775
+3.4.1-0-g0135fb806e4137dc9cdf152541926a2bc95e33f0

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemallo

svn commit: r256824 - head/sbin/ifconfig

2013-10-20 Thread Gleb Smirnoff
Author: glebius
Date: Mon Oct 21 05:14:00 2013
New Revision: 256824
URL: http://svnweb.freebsd.org/changeset/base/256824

Log:
  Provide a working example line for an interface with 1 address running
  with CARP.
  
  Currently, we've got a problem that interface isn't IFF_UP at the time
  we assign it a redundant address, and the latter gets stuck in INIT state.
  Additional SIOCSIFFLAGS from ifconfig(8) kicks it to a working state.
  
  A proper fix is kernel side and appeared to be non-trivial, not to be
  checked in before 10.0-RELEASE.
  
  Submitted by: Ole Myhre 

Modified:
  head/sbin/ifconfig/ifconfig.8

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Mon Oct 21 05:10:46 2013
(r256823)
+++ head/sbin/ifconfig/ifconfig.8   Mon Oct 21 05:14:00 2013
(r256824)
@@ -28,7 +28,7 @@
 .\" From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd January 10, 2013
+.Dd October 21, 2013
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -2690,7 +2690,7 @@ as a synonym for the canonical form of t
 .Pp
 Configure a single CARP redundant address on igb0, and then switch it
 to be master:
-.Dl # ifconfig igb0 vhid 1 10.0.0.1/24 pass foobar
+.Dl # ifconfig igb0 vhid 1 10.0.0.1/24 pass foobar up
 .Dl # ifconfig igb0 vhid 1 state master
 .Pp
 Configure the interface
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256826 - in head/sys/dev: aic7xxx firewire isp mpt

2013-10-20 Thread Alexander Motin
Author: mav
Date: Mon Oct 21 06:04:39 2013
New Revision: 256826
URL: http://svnweb.freebsd.org/changeset/base/256826

Log:
  Partial MFproject/camlock r256671:
  Fix several target mode SIMs to not blindly clear ccb_h.flags field of
  ATIO CCBs.  Not all CCB flags there belong to them.

Modified:
  head/sys/dev/aic7xxx/aic79xx.c
  head/sys/dev/aic7xxx/aic7xxx.c
  head/sys/dev/firewire/sbp_targ.c
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/mpt/mpt_cam.c

Modified: head/sys/dev/aic7xxx/aic79xx.c
==
--- head/sys/dev/aic7xxx/aic79xx.c  Mon Oct 21 05:57:36 2013
(r256825)
+++ head/sys/dev/aic7xxx/aic79xx.c  Mon Oct 21 06:04:39 2013
(r256826)
@@ -10343,9 +10343,9 @@ ahd_handle_target_cmd(struct ahd_softc *
/* Tag was included */
atio->tag_action = *byte++;
atio->tag_id = *byte++;
-   atio->ccb_h.flags = CAM_TAG_ACTION_VALID;
+   atio->ccb_h.flags |= CAM_TAG_ACTION_VALID;
} else {
-   atio->ccb_h.flags = 0;
+   atio->ccb_h.flags &= ~CAM_TAG_ACTION_VALID;
}
byte++;
 

Modified: head/sys/dev/aic7xxx/aic7xxx.c
==
--- head/sys/dev/aic7xxx/aic7xxx.c  Mon Oct 21 05:57:36 2013
(r256825)
+++ head/sys/dev/aic7xxx/aic7xxx.c  Mon Oct 21 06:04:39 2013
(r256826)
@@ -7843,9 +7843,9 @@ ahc_handle_target_cmd(struct ahc_softc *
/* Tag was included */
atio->tag_action = *byte++;
atio->tag_id = *byte++;
-   atio->ccb_h.flags = CAM_TAG_ACTION_VALID;
+   atio->ccb_h.flags |= CAM_TAG_ACTION_VALID;
} else {
-   atio->ccb_h.flags = 0;
+   atio->ccb_h.flags &= ~CAM_TAG_ACTION_VALID;
}
byte++;
 

Modified: head/sys/dev/firewire/sbp_targ.c
==
--- head/sys/dev/firewire/sbp_targ.cMon Oct 21 05:57:36 2013
(r256825)
+++ head/sys/dev/firewire/sbp_targ.cMon Oct 21 06:04:39 2013
(r256826)
@@ -1483,7 +1483,7 @@ sbp_targ_cmd_handler(struct fw_xfer *xfe
atio->tag_id = orbi->orb_lo;
atio->init_id = orbi->login->id;
 
-   atio->ccb_h.flags = CAM_TAG_ACTION_VALID;
+   atio->ccb_h.flags |= CAM_TAG_ACTION_VALID;
bytes = (u_char *)&orb[5];
if (debug)
printf("%s: %p %02x %02x %02x %02x %02x %02x %02x %02x %02x 
%02x\n",

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Mon Oct 21 05:57:36 2013
(r256825)
+++ head/sys/dev/isp/isp_freebsd.c  Mon Oct 21 06:04:39 2013
(r256826)
@@ -2286,9 +2286,9 @@ isp_handle_platform_atio(ispsoftc_t *isp
atiop->ccb_h.target_id = aep->at_tgt;
atiop->ccb_h.target_lun = aep->at_lun;
if (aep->at_flags & AT_NODISC) {
-   atiop->ccb_h.flags = CAM_DIS_DISCONNECT;
+   atiop->ccb_h.flags |= CAM_DIS_DISCONNECT;
} else {
-   atiop->ccb_h.flags = 0;
+   atiop->ccb_h.flags &= ~CAM_DIS_DISCONNECT;
}
 
if (status & QLTM_SVALID) {
@@ -2456,15 +2456,15 @@ isp_handle_platform_atio2(ispsoftc_t *is
atiop->tag_id = atp->tag;
switch (aep->at_taskflags & ATIO2_TC_ATTR_MASK) {
case ATIO2_TC_ATTR_SIMPLEQ:
-   atiop->ccb_h.flags = CAM_TAG_ACTION_VALID;
+   atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID;
atiop->tag_action = MSG_SIMPLE_Q_TAG;
break;
case ATIO2_TC_ATTR_HEADOFQ:
-   atiop->ccb_h.flags = CAM_TAG_ACTION_VALID;
+   atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID;
atiop->tag_action = MSG_HEAD_OF_Q_TAG;
break;
case ATIO2_TC_ATTR_ORDERED:
-   atiop->ccb_h.flags = CAM_TAG_ACTION_VALID;
+   atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID;
atiop->tag_action = MSG_ORDERED_Q_TAG;
break;
case ATIO2_TC_ATTR_ACAQ:/* ?? */
@@ -2676,15 +2676,15 @@ isp_handle_platform_atio7(ispsoftc_t *is
atiop->tag_id = atp->tag;
switch (aep->at_cmnd.fcp_cmnd_task_attribute & FCP_CMND_TASK_ATTR_MASK) 
{
case FCP_CMND_TASK_ATTR_SIMPLE:
-   atiop->ccb_h.flags = CAM_TAG_ACTION_VALID;
+   atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID;
atiop->tag_action = MSG_SIMPLE_Q_TAG;
break;
case FCP_CMND_TASK_ATTR_HEAD:
-   atiop->ccb_h.flags = CAM_TAG_ACTION_VALID;
+   atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID;
atiop->tag_action = MSG_HEAD_OF_Q_TAG;
break;
case FCP_CMND_TASK_ATTR_ORDERED:
-   atiop->ccb

svn commit: r256827 - in head/sys: dev/re pci

2013-10-20 Thread Pyun YongHyeon
Author: yongari
Date: Mon Oct 21 06:22:20 2013
New Revision: 256827
URL: http://svnweb.freebsd.org/changeset/base/256827

Log:
  Correct MAC revision bits. Previously it always cleared bit 20 and
  bit 21.

Modified:
  head/sys/dev/re/if_re.c
  head/sys/pci/if_rlreg.h

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Mon Oct 21 06:04:39 2013(r256826)
+++ head/sys/dev/re/if_re.c Mon Oct 21 06:22:20 2013(r256827)
@@ -1367,10 +1367,11 @@ re_attach(device_t dev)
break;
default:
device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0x7c80);
+   sc->rl_macrev = hwrev & 0x0070;
hwrev &= RL_TXCFG_HWREV;
break;
}
-   device_printf(dev, "MAC rev. 0x%08x\n", hwrev & 0x0070);
+   device_printf(dev, "MAC rev. 0x%08x\n", sc->rl_macrev);
while (hw_rev->rl_desc != NULL) {
if (hw_rev->rl_rev == hwrev) {
sc->rl_type = hw_rev->rl_type;
@@ -1429,7 +1430,7 @@ re_attach(device_t dev)
sc->rl_flags |= RL_FLAG_MACSLEEP;
/* FALLTHROUGH */
case RL_HWREV_8168C:
-   if ((hwrev & 0x0070) == 0x0020)
+   if (sc->rl_macrev == 0x0020)
sc->rl_flags |= RL_FLAG_MACSLEEP;
/* FALLTHROUGH */
case RL_HWREV_8168CP:

Modified: head/sys/pci/if_rlreg.h
==
--- head/sys/pci/if_rlreg.h Mon Oct 21 06:04:39 2013(r256826)
+++ head/sys/pci/if_rlreg.h Mon Oct 21 06:22:20 2013(r256827)
@@ -877,6 +877,7 @@ struct rl_softc {
bus_dma_tag_t   rl_parent_tag;
uint8_t rl_type;
const struct rl_hwrev   *rl_hwrev;
+   uint32_trl_macrev;
int rl_eecmd_read;
int rl_eewidth;
int rl_expcap;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256828 - in head/sys: dev/re pci

2013-10-20 Thread Pyun YongHyeon
Author: yongari
Date: Mon Oct 21 06:27:20 2013
New Revision: 256828
URL: http://svnweb.freebsd.org/changeset/base/256828

Log:
  Add preliminary support for RTL8106E PCIe FastEthernet.
  
  H/W donated by:   RealTek Semiconductor Corp.

Modified:
  head/sys/dev/re/if_re.c
  head/sys/pci/if_rlreg.h

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Mon Oct 21 06:22:20 2013(r256827)
+++ head/sys/dev/re/if_re.c Mon Oct 21 06:27:20 2013(r256828)
@@ -223,6 +223,7 @@ static const struct rl_hwrev re_hwrevs[]
{ RL_HWREV_8402, RL_8169, "8402", RL_MTU },
{ RL_HWREV_8105E, RL_8169, "8105E", RL_MTU },
{ RL_HWREV_8105E_SPIN1, RL_8169, "8105E", RL_MTU },
+   { RL_HWREV_8106E, RL_8169, "8106E", RL_MTU },
{ RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU },
{ RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU },
{ RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K },
@@ -1409,6 +1410,7 @@ re_attach(device_t dev)
case RL_HWREV_8401E:
case RL_HWREV_8105E:
case RL_HWREV_8105E_SPIN1:
+   case RL_HWREV_8106E:
sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM |
RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT |
RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD;

Modified: head/sys/pci/if_rlreg.h
==
--- head/sys/pci/if_rlreg.h Mon Oct 21 06:22:20 2013(r256827)
+++ head/sys/pci/if_rlreg.h Mon Oct 21 06:27:20 2013(r256828)
@@ -189,6 +189,7 @@
 #defineRL_HWREV_8105E  0x4080
 #defineRL_HWREV_8105E_SPIN10x40C0
 #defineRL_HWREV_8402   0x4400
+#defineRL_HWREV_8106E  0x4480
 #defineRL_HWREV_8168F  0x4800
 #defineRL_HWREV_8411   0x4880
 #defineRL_HWREV_8139   0x6000
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256830 - head/sys/kern

2013-10-20 Thread Alexander Motin
Author: mav
Date: Mon Oct 21 06:44:55 2013
New Revision: 256830
URL: http://svnweb.freebsd.org/changeset/base/256830

Log:
  MFprojects/camlock r256619:
  Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping
  temporary mapped buffer.  That fixes double unmap if biodone() called twice
  for the same BIO (but with different done methods).
  
  Move mapping removal before calling bio_done() method.  I believe that it is
  very wrong to do anything to BIO after reporting completion.  kib@ thinks
  it was done for some forgotten now case when bio_done() method needed mapped
  buffer. But 1) if BIO was sent as unmapped, then IMO done() should be called
  in the same way; 2) IMO there is no guatantee that buffer will be mapped at
  this point at all, for example, if all underlying stack supports unmapped
  I/O, so bio_done() handler can not expect that.

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Mon Oct 21 06:31:56 2013(r256829)
+++ head/sys/kern/vfs_bio.c Mon Oct 21 06:44:55 2013(r256830)
@@ -3557,15 +3557,15 @@ biodone(struct bio *bp)
struct mtx *mtxp;
void (*done)(struct bio *);
vm_offset_t start, end;
-   int transient;
 
if ((bp->bio_flags & BIO_TRANSIENT_MAPPING) != 0) {
+   bp->bio_flags &= ~BIO_TRANSIENT_MAPPING;
+   bp->bio_flags |= BIO_UNMAPPED;
start = trunc_page((vm_offset_t)bp->bio_data);
end = round_page((vm_offset_t)bp->bio_data + bp->bio_length);
-   transient = 1;
-   } else {
-   transient = 0;
-   start = end = 0;
+   pmap_qremove(start, OFF_TO_IDX(end - start));
+   vmem_free(transient_arena, start, end - start);
+   atomic_add_int(&inflight_transient_maps, -1);
}
done = bp->bio_done;
if (done == NULL) {
@@ -3578,11 +3578,6 @@ biodone(struct bio *bp)
bp->bio_flags |= BIO_DONE;
done(bp);
}
-   if (transient) {
-   pmap_qremove(start, OFF_TO_IDX(end - start));
-   vmem_free(transient_arena, start, end - start);
-   atomic_add_int(&inflight_transient_maps, -1);
-   }
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"