svn commit: r253480 - head/sys/dev/bge

2013-07-20 Thread Pyun YongHyeon
Author: yongari
Date: Sat Jul 20 07:09:50 2013
New Revision: 253480
URL: http://svnweb.freebsd.org/changeset/base/253480

Log:
  Setup the PCIE Fast Training Sequence (FTS) value to prevent
  transmit hangs for 57766 and non Ax versions of 57765.
  While here, correct definition of BGE_CHIPREV_57765_AX.

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bge/if_bgereg.h

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Sat Jul 20 03:55:56 2013(r253479)
+++ head/sys/dev/bge/if_bge.c   Sat Jul 20 07:09:50 2013(r253480)
@@ -1796,6 +1796,20 @@ bge_chipinit(struct bge_softc *sc)
pci_write_config(sc-bge_dev, BGE_PCI_MSI_DATA + 2, val, 2);
}
 
+   if (sc-bge_asicrev == BGE_ASICREV_BCM57765 ||
+   sc-bge_asicrev == BGE_ASICREV_BCM57766) {
+   /*
+* For the 57766 and non Ax versions of 57765, bootcode
+* needs to setup the PCIE Fast Training Sequence (FTS)
+* value to prevent transmit hangs.
+*/
+   if (sc-bge_chiprev != BGE_CHIPREV_57765_AX) {
+   CSR_WRITE_4(sc, BGE_CPMU_PADRNG_CTL,
+   CSR_READ_4(sc, BGE_CPMU_PADRNG_CTL) |
+   BGE_CPMU_PADRNG_CTL_RDIV2);
+   }
+   }
+
/*
 * Set up the PCI DMA control register.
 */

Modified: head/sys/dev/bge/if_bgereg.h
==
--- head/sys/dev/bge/if_bgereg.hSat Jul 20 03:55:56 2013
(r253479)
+++ head/sys/dev/bge/if_bgereg.hSat Jul 20 07:09:50 2013
(r253480)
@@ -378,6 +378,7 @@
 #defineBGE_CHIPREV_5717_AX 0x57170
 #defineBGE_CHIPREV_5717_BX 0x57171
 #defineBGE_CHIPREV_5761_AX 0x57611
+#defineBGE_CHIPREV_57765_AX0x577850
 #defineBGE_CHIPREV_5784_AX 0x57841
 
 /* PCI DMA Read/Write Control register */
@@ -1289,6 +1290,7 @@
 #defineBGE_CPMU_MUTEX_REQ  0x365C
 #defineBGE_CPMU_MUTEX_GNT  0x3660
 #defineBGE_CPMU_PHY_STRAP  0x3664
+#defineBGE_CPMU_PADRNG_CTL 0x3668
 
 /* Central Power Management Unit (CPMU) register */
 #defineBGE_CPMU_CTRL_LINK_IDLE_MODE0x0200
@@ -1328,6 +1330,9 @@
 /* CPMU GPHY Strap register */
 #defineBGE_CPMU_PHY_STRAP_IS_SERDES0x0020
 
+/* CPMU Padring Control register */
+#defineBGE_CPMU_PADRNG_CTL_RDIV2   0x0004
+
 /*
  * Mbuf Cluster Free registers (has nothing to do with BSD mbufs)
  */
___
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: r253481 - head/sys/dev/mii

2013-07-20 Thread Pyun YongHyeon
Author: yongari
Date: Sat Jul 20 07:24:01 2013
New Revision: 253481
URL: http://svnweb.freebsd.org/changeset/base/253481

Log:
  Recognize BCM5725C PHY.

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

Modified: head/sys/dev/mii/brgphy.c
==
--- head/sys/dev/mii/brgphy.c   Sat Jul 20 07:09:50 2013(r253480)
+++ head/sys/dev/mii/brgphy.c   Sat Jul 20 07:24:01 2013(r253481)
@@ -147,6 +147,7 @@ static const struct mii_phydesc brgphys[
MII_PHY_DESC(BROADCOM3, BCM5720C),
MII_PHY_DESC(BROADCOM3, BCM57765),
MII_PHY_DESC(BROADCOM3, BCM57780),
+   MII_PHY_DESC(BROADCOM4, BCM5725C),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906),
MII_PHY_END
 };
@@ -932,6 +933,8 @@ brgphy_reset(struct mii_softc *sc)
return;
}
break;
+   case MII_OUI_BROADCOM4:
+   return;
}
 
ifp = sc-mii_pdata-mii_ifp;

Modified: head/sys/dev/mii/miidevs
==
--- head/sys/dev/mii/miidevsSat Jul 20 07:09:50 2013(r253480)
+++ head/sys/dev/mii/miidevsSat Jul 20 07:24:01 2013(r253481)
@@ -52,6 +52,7 @@ oui AMD   0x1a
Advanced Micro Devic
 oui BROADCOM   0x001018Broadcom Corporation
 oui BROADCOM2  0x000af7Broadcom Corporation
 oui BROADCOM3  0x001be9Broadcom Corporation
+oui BROADCOM4  0x18c086Broadcom Corporation
 oui CICADA 0x0003f1Cicada Semiconductor
 oui DAVICOM0x00606eDavicom Semiconductor
 oui ENABLESEMI 0x0010ddEnable Semiconductor
@@ -186,6 +187,7 @@ model BROADCOM3 BCM5717C0x0020 BCM5717C
 model BROADCOM3 BCM5719C   0x0022 BCM5719C 1000BASE-T media interface
 model BROADCOM3 BCM57765   0x0024 BCM57765 1000BASE-T media interface
 model BROADCOM3 BCM5720C   0x0036 BCM5720C 1000BASE-T media interface
+model BROADCOM4 BCM5725C   0x0038 BCM5725C 1000BASE-T media interface
 model xxBROADCOM_ALT1 BCM5906  0x0004 BCM5906 10/100baseTX media interface
 
 /* Cicada Semiconductor PHYs (now owned by Vitesse?) */
___
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: r253482 - in head: contrib/ipfilter sys/contrib/ipfilter

2013-07-20 Thread Cy Schubert
Author: cy
Date: Sat Jul 20 07:29:19 2013
New Revision: 253482
URL: http://svnweb.freebsd.org/changeset/base/253482

Log:
  As per the developers handbook (5.3.1 step 1), bootstrap svn:mergeinfo on
  the ipfilter directories in the main tree to the last commit made to
  the ipfilter trees in the vendor branches (r253468) which flattened the
  ipfilter vendor trees.
  
  Now that this step is complete, we are free to import new sources into the
  ipfilter vendor trees.
  
  Approved by:  glebius (Mentor)

Modified:
Directory Properties:
  head/contrib/ipfilter/   (props changed)
  head/sys/contrib/ipfilter/   (props changed)
___
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: r253483 - head/sys/dev/bge

2013-07-20 Thread Pyun YongHyeon
Author: yongari
Date: Sat Jul 20 07:58:03 2013
New Revision: 253483
URL: http://svnweb.freebsd.org/changeset/base/253483

Log:
  Add support for upcoming BCM5725 (ASIC 5762) controller.  This is a
  new 1Gb server controller chip that will be going into production
  soon.
  BCM5725 combines MAC with triple-speed PHY, a Network Controller
  Sideband Interface (NC-SI) and on-chip memory buffer in a single
  device.  BCM5725 has an Application Processing Engine (APE) that is
  capable of on-chip management and offloading features.  BCM5725
  supports high-precision clock, time stamp registers for
  receive/transmit packets and programmable trigger inputs and
  watchdog timeouts. These new features are not yet supported by
  bge(4).
  Many thanks to Broadcom for continuing to support FreeBSD!
  
  Submitted by: Geans Pin geanspin@Broacom (initial version)
  Reviewed by:  Geans Pin geanspin@Broacom
  H/W donated by:   Broadcom

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bge/if_bgereg.h

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Sat Jul 20 07:29:19 2013(r253482)
+++ head/sys/dev/bge/if_bge.c   Sat Jul 20 07:58:03 2013(r253483)
@@ -176,6 +176,8 @@ static const struct bge_type {
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5721 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5722 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5723 },
+   { BCOM_VENDORID,BCOM_DEVICEID_BCM5725 },
+   { BCOM_VENDORID,BCOM_DEVICEID_BCM5727 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5750 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5750M },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5751 },
@@ -195,6 +197,7 @@ static const struct bge_type {
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5761E },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5761S },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5761SE },
+   { BCOM_VENDORID,BCOM_DEVICEID_BCM5762 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5764 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5780 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5780S },
@@ -310,6 +313,7 @@ static const struct bge_revision {
{ BGE_CHIPID_BCM5722_A0,BCM5722 A0 },
{ BGE_CHIPID_BCM5761_A0,BCM5761 A0 },
{ BGE_CHIPID_BCM5761_A1,BCM5761 A1 },
+   { BGE_CHIPID_BCM5762_A0,BCM5762 A0 },
{ BGE_CHIPID_BCM5784_A0,BCM5784 A0 },
{ BGE_CHIPID_BCM5784_A1,BCM5784 A1 },
/* 5754 and 5787 share the same ASIC ID */
@@ -354,6 +358,7 @@ static const struct bge_revision bge_maj
{ BGE_ASICREV_BCM5717,  unknown BCM5717 },
{ BGE_ASICREV_BCM5719,  unknown BCM5719 },
{ BGE_ASICREV_BCM5720,  unknown BCM5720 },
+   { BGE_ASICREV_BCM5762,  unknown BCM5762 },
 
{ 0, NULL }
 };
@@ -1885,8 +1890,9 @@ bge_chipinit(struct bge_softc *sc)
 * a status tag update and leave interrupts permanently
 * disabled.
 */
-   if (sc-bge_asicrev != BGE_ASICREV_BCM5717 
-   sc-bge_asicrev != BGE_ASICREV_BCM57765)
+   if (!BGE_IS_57765_PLUS(sc) 
+   sc-bge_asicrev != BGE_ASICREV_BCM5717 
+   sc-bge_asicrev != BGE_ASICREV_BCM5762)
dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA;
}
pci_write_config(sc-bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4);
@@ -1895,7 +1901,8 @@ bge_chipinit(struct bge_softc *sc)
 * Set up general mode register.
 */
mode_ctl = bge_dma_swap_options(sc);
-   if (sc-bge_asicrev == BGE_ASICREV_BCM5720) {
+   if (sc-bge_asicrev == BGE_ASICREV_BCM5720 ||
+   sc-bge_asicrev == BGE_ASICREV_BCM5762) {
/* Retain Host-2-BMC settings written by APE firmware. */
mode_ctl |= CSR_READ_4(sc, BGE_MODE_CTL) 
(BGE_MODECTL_BYTESWAP_B2HRX_DATA |
@@ -1953,7 +1960,7 @@ bge_blockinit(struct bge_softc *sc)
struct bge_rcb *rcb;
bus_size_t vrcb;
bge_hostaddr taddr;
-   uint32_t dmactl, val;
+   uint32_t dmactl, rdmareg, val;
int i, limit;
 
/*
@@ -2224,6 +2231,11 @@ bge_blockinit(struct bge_softc *sc)
if (!BGE_IS_5705_PLUS(sc))
/* 5700 to 5704 had 16 send rings. */
limit = BGE_TX_RINGS_EXTSSRAM_MAX;
+   else if (BGE_IS_57765_PLUS(sc) ||
+   sc-bge_asicrev == BGE_ASICREV_BCM5762)
+   limit = 2;
+   else if (BGE_IS_5717_PLUS(sc))
+   limit = 4;
else
limit = 1;
vrcb = BGE_MEMWIN_START + BGE_SEND_RING_RCB;
@@ -2262,6 +2274,7 @@ bge_blockinit(struct bge_softc *sc)
} else if (!BGE_IS_5705_PLUS(sc))
limit = BGE_RX_RINGS_MAX;
else if 

svn commit: r253489 - head/sys/arm/include

2013-07-20 Thread Andrew Turner
Author: andrew
Date: Sat Jul 20 09:24:48 2013
New Revision: 253489
URL: http://svnweb.freebsd.org/changeset/base/253489

Log:
  Start adding support to build bits of our code using the Thumb-2
  instruction set. Thumb-2 requires an if-then instruction to implement
  conditional codes.
  
  When building for ARM mode the it-then instructions do not generate any
  assembled instruction as per the ARMv7-A Architecture Reference Manual, and
  are safe to use.
  
  While this allows the atomic instructions to be built, it doesn't mean we
  fully support Thumb code. It works in small tests, but is still known to
  fail in a large number of places.
  
  While here add a check for the armv6t2 architecture.

Modified:
  head/sys/arm/include/atomic.h

Modified: head/sys/arm/include/atomic.h
==
--- head/sys/arm/include/atomic.h   Sat Jul 20 09:18:47 2013
(r253488)
+++ head/sys/arm/include/atomic.h   Sat Jul 20 09:24:48 2013
(r253489)
@@ -52,8 +52,8 @@
 #define dsb()  __asm __volatile(dsb : : : memory)
 #define dmb()  __asm __volatile(dmb : : : memory)
 #elif defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) || \
-  defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) || \
-  defined (__ARM_ARCH_6ZK__)
+  defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6T2__) || \
+  defined (__ARM_ARCH_6Z__) || defined (__ARM_ARCH_6ZK__)
 #define isb()  __asm __volatile(mcr p15, 0, %0, c7, c5, 4 : : r (0) : 
memory)
 #define dsb()  __asm __volatile(mcr p15, 0, %0, c7, c10, 4 : : r (0) : 
memory)
 #define dmb()  __asm __volatile(mcr p15, 0, %0, c7, c10, 5 : : r (0) : 
memory)
@@ -81,11 +81,12 @@
  * out of asm.h so it can be used in both asm and C code. - kientzle@
  */
 #if defined (__ARM_ARCH_7__) || \
-   defined (__ARM_ARCH_7A__) || \
-   defined (__ARM_ARCH_6__) || \
-   defined (__ARM_ARCH_6J__) || \
-   defined (__ARM_ARCH_6K__) || \
-   defined (__ARM_ARCH_6Z__) || \
+   defined (__ARM_ARCH_7A__)  || \
+   defined (__ARM_ARCH_6__)   || \
+   defined (__ARM_ARCH_6J__)  || \
+   defined (__ARM_ARCH_6K__)  || \
+   defined (__ARM_ARCH_6T2__) || \
+   defined (__ARM_ARCH_6Z__)  || \
defined (__ARM_ARCH_6ZK__)
 static __inline void
 __do_dmb(void)
@@ -137,6 +138,7 @@ atomic_set_32(volatile uint32_t *address
orr %0, %0, %3\n
strex %1, %0, [%2]\n
cmp %1, #0\n
+   it ne\n
bne1b\n
   : =r (tmp), +r (tmp2)
   , +r (address), +r (setmask) : : cc, memory);
@@ -152,6 +154,7 @@ atomic_set_long(volatile u_long *address
orr %0, %0, %3\n
strex %1, %0, [%2]\n
cmp %1, #0\n
+   it ne\n
bne1b\n
   : =r (tmp), +r (tmp2)
   , +r (address), +r (setmask) : : cc, memory);
@@ -167,6 +170,7 @@ atomic_clear_32(volatile uint32_t *addre
bic %0, %0, %3\n
strex %1, %0, [%2]\n
cmp %1, #0\n
+   it ne\n
bne1b\n
   : =r (tmp), +r (tmp2)
   ,+r (address), +r (setmask) : : cc, memory);
@@ -181,6 +185,7 @@ atomic_clear_long(volatile u_long *addre
bic %0, %0, %3\n
strex %1, %0, [%2]\n
cmp %1, #0\n
+   it ne\n
bne1b\n
   : =r (tmp), +r (tmp2)
   ,+r (address), +r (setmask) : : cc, memory);
@@ -193,12 +198,14 @@ atomic_cmpset_32(volatile u_int32_t *p, 

__asm __volatile(1: ldrex %0, [%1]\n
 cmp %0, %2\n
+it ne\n
 movne %0, #0\n
 bne 2f\n
 strex %0, %3, [%1]\n
 cmp %0, #0\n
-bne   1b\n
+ite eq\n
 moveq %0, #1\n
+bne   1b\n
 2:
 : =r (ret)
 ,+r (p), +r (cmpval), +r (newval) : : cc,
@@ -213,12 +220,14 @@ atomic_cmpset_long(volatile u_long *p, v

__asm __volatile(1: ldrex %0, [%1]\n
 cmp %0, %2\n
+itt ne\n
 movne %0, #0\n
 bne 2f\n
 strex %0, %3, [%1]\n
 cmp %0, #0\n
-bne   1b\n
+ite eq\n
 moveq %0, #1\n
+ 

svn commit: r253493 - head/sys/netinet

2013-07-20 Thread Michael Tuexen
Author: tuexen
Date: Sat Jul 20 13:14:59 2013
New Revision: 253493
URL: http://svnweb.freebsd.org/changeset/base/253493

Log:
  Allow the code to be compiled without warnings for any combination
  of INET, INET6 and SCTP_DEBUG defines.
  The issue was reported by Lally Singh.
  
  MFC after: 2 weeks

Modified:
  head/sys/netinet/sctp_asconf.c

Modified: head/sys/netinet/sctp_asconf.c
==
--- head/sys/netinet/sctp_asconf.c  Sat Jul 20 13:13:28 2013
(r253492)
+++ head/sys/netinet/sctp_asconf.c  Sat Jul 20 13:14:59 2013
(r253493)
@@ -1191,7 +1191,6 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *
 uint16_t type)
 {
struct sctp_asconf_addr *aa, *aa_next;
-   struct sockaddr *sa;
 
/* make sure the request isn't already in the queue */
TAILQ_FOREACH_SAFE(aa, stcb-asoc.asconf_queue, next, aa_next) {
@@ -1255,7 +1254,6 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *
struct sockaddr_in6 *sin6;
 
sin6 = (struct sockaddr_in6 *)ifa-address.sa;
-   sa = (struct sockaddr *)sin6;
aa-ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS;
aa-ap.addrp.ph.param_length = (sizeof(struct 
sctp_ipv6addr_param));
aa-ap.aph.ph.param_length = sizeof(struct 
sctp_asconf_paramhdr) +
@@ -1271,7 +1269,6 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *
struct sockaddr_in *sin;
 
sin = (struct sockaddr_in *)ifa-address.sa;
-   sa = (struct sockaddr *)sin;
aa-ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS;
aa-ap.addrp.ph.param_length = (sizeof(struct 
sctp_ipv4addr_param));
aa-ap.aph.ph.param_length = sizeof(struct 
sctp_asconf_paramhdr) +
@@ -1294,13 +1291,13 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *
if (SCTP_BASE_SYSCTL(sctp_debug_on)  SCTP_DEBUG_ASCONF2) {
if (type == SCTP_ADD_IP_ADDRESS) {
SCTP_PRINTF(asconf_queue_mgmt: inserted asconf 
ADD_IP_ADDRESS: );
-   SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, sa);
+   SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, ifa-address.sa);
} else if (type == SCTP_DEL_IP_ADDRESS) {
SCTP_PRINTF(asconf_queue_mgmt: appended asconf 
DEL_IP_ADDRESS: );
-   SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, sa);
+   SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, ifa-address.sa);
} else {
SCTP_PRINTF(asconf_queue_mgmt: appended asconf 
SET_PRIM_ADDR: );
-   SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, sa);
+   SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, ifa-address.sa);
}
}
 #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: r253494 - in head/sys: compat/freebsd32 kern sys

2013-07-20 Thread Konstantin Belousov
Author: kib
Date: Sat Jul 20 13:39:41 2013
New Revision: 253494
URL: http://svnweb.freebsd.org/changeset/base/253494

Log:
  id_t is 64bit, provide the compat32 wrapper for clock_getcpuclockid2(2).
  
  Reported and tested by:   Petr Salinger petr.salin...@seznam.cz
  PR:   threads/180652
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/kern_time.c
  head/sys/sys/syscallsubr.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Sat Jul 20 13:14:59 2013
(r253493)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Sat Jul 20 13:39:41 2013
(r253494)
@@ -2332,6 +2332,20 @@ freebsd32_clock_getres(struct thread *td
 }
 
 int
+freebsd32_clock_getcpuclockid2(struct thread *td,
+struct freebsd32_clock_getcpuclockid2_args *uap)
+{
+   clockid_t clk_id;
+   int error;
+
+   error = kern_clock_getcpuclockid2(td, PAIR32TO64(id_t, uap-id),
+   uap-which, clk_id);
+   if (error == 0)
+   error = copyout(clk_id, uap-clock_id, sizeof(clockid_t));
+   return (error);
+}
+
+int
 freebsd32_thr_new(struct thread *td,
  struct freebsd32_thr_new_args *uap)
 {

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Sat Jul 20 13:14:59 2013
(r253493)
+++ head/sys/compat/freebsd32/syscalls.master   Sat Jul 20 13:39:41 2013
(r253494)
@@ -457,8 +457,9 @@
 244AUE_NULLUNIMPL  nosys
 245AUE_NULLUNIMPL  nosys
 246AUE_NULLUNIMPL  nosys
-247AUE_NULLNOPROTO { int clock_getcpuclockid2(id_t id,\
-   int which, clockid_t *clock_id); }
+247AUE_NULLSTD { int freebsd32_clock_getcpuclockid2(\
+   uint32_t id1, uint32_t id2,\
+   int which, clockid_t *clock_id); }
 248AUE_NULLUNIMPL  ntp_gettime
 249AUE_NULLUNIMPL  nosys
 ; syscall numbers initially used in OpenBSD

Modified: head/sys/kern/kern_time.c
==
--- head/sys/kern/kern_time.c   Sat Jul 20 13:14:59 2013(r253493)
+++ head/sys/kern/kern_time.c   Sat Jul 20 13:39:41 2013(r253494)
@@ -183,38 +183,46 @@ int
 sys_clock_getcpuclockid2(struct thread *td, struct clock_getcpuclockid2_args 
*uap)
 {
clockid_t clk_id;
+   int error;
+
+   error = kern_clock_getcpuclockid2(td, uap-id, uap-which, clk_id);
+   if (error == 0)
+   error = copyout(clk_id, uap-clock_id, sizeof(clockid_t));
+   return (error);
+}
+
+int
+kern_clock_getcpuclockid2(struct thread *td, id_t id, int which,
+clockid_t *clk_id)
+{
struct proc *p;
pid_t pid;
lwpid_t tid;
int error;
 
-   switch(uap-which) {
+   switch (which) {
case CPUCLOCK_WHICH_PID:
-   if (uap-id != 0) {
-   p = pfind(uap-id);
+   if (id != 0) {
+   p = pfind(id);
if (p == NULL)
return (ESRCH);
error = p_cansee(td, p);
PROC_UNLOCK(p);
-   if (error)
+   if (error != 0)
return (error);
-   pid = uap-id;
+   pid = id;
} else {
pid = td-td_proc-p_pid;
}
-   clk_id = MAKE_PROCESS_CPUCLOCK(pid);
-   break;
+   *clk_id = MAKE_PROCESS_CPUCLOCK(pid);
+   return (0);
case CPUCLOCK_WHICH_TID:
-   if (uap-id == 0)
-   tid = td-td_tid;
-   else
-   tid = uap-id;
-   clk_id = MAKE_THREAD_CPUCLOCK(tid);
-   break;
+   tid = id == 0 ? td-td_tid : id;
+   *clk_id = MAKE_THREAD_CPUCLOCK(tid);
+   return (0);
default:
return (EINVAL);
}
-   return (copyout(clk_id, uap-clock_id, sizeof(clockid_t)));
 }
 
 #ifndef _SYS_SYSPROTO_H_

Modified: head/sys/sys/syscallsubr.h
==
--- head/sys/sys/syscallsubr.h  Sat Jul 20 13:14:59 2013(r253493)
+++ head/sys/sys/syscallsubr.h  Sat Jul 20 13:39:41 2013(r253494)
@@ -76,6 +76,8 @@ int   kern_chmod(struct thread *td, char *
int mode);
 intkern_chown(struct thread *td, char *path, enum uio_seg pathseg, int uid,
int gid);
+intkern_clock_getcpuclockid2(struct thread *td, id_t id, 

svn commit: r253495 - head/sys/compat/freebsd32

2013-07-20 Thread Konstantin Belousov
Author: kib
Date: Sat Jul 20 13:40:03 2013
New Revision: 253495
URL: http://svnweb.freebsd.org/changeset/base/253495

Log:
  Regenerate

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Sat Jul 20 13:39:41 2013
(r253494)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Sat Jul 20 13:40:03 2013
(r253495)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 251526 
2013-06-08 13:27:57Z glebius 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 
2013-07-20 13:39:41Z kib 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -212,6 +212,12 @@ struct freebsd32_nanosleep_args {
char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 
* rqtp; char rqtp_r_[PADR_(const struct timespec32 *)];
char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; 
char rmtp_r_[PADR_(struct timespec32 *)];
 };
+struct freebsd32_clock_getcpuclockid2_args {
+   char id1_l_[PADL_(uint32_t)]; uint32_t id1; char 
id1_r_[PADR_(uint32_t)];
+   char id2_l_[PADL_(uint32_t)]; uint32_t id2; char 
id2_r_[PADR_(uint32_t)];
+   char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
+   char clock_id_l_[PADL_(clockid_t *)]; clockid_t * clock_id; char 
clock_id_r_[PADR_(clockid_t *)];
+};
 struct freebsd32_aio_read_args {
char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char 
aiocbp_r_[PADR_(struct aiocb32 *)];
 };
@@ -668,6 +674,7 @@ int freebsd32_clock_gettime(struct threa
 intfreebsd32_clock_settime(struct thread *, struct 
freebsd32_clock_settime_args *);
 intfreebsd32_clock_getres(struct thread *, struct 
freebsd32_clock_getres_args *);
 intfreebsd32_nanosleep(struct thread *, struct freebsd32_nanosleep_args *);
+intfreebsd32_clock_getcpuclockid2(struct thread *, struct 
freebsd32_clock_getcpuclockid2_args *);
 intfreebsd32_aio_read(struct thread *, struct freebsd32_aio_read_args *);
 intfreebsd32_aio_write(struct thread *, struct freebsd32_aio_write_args *);
 intfreebsd32_lio_listio(struct thread *, struct freebsd32_lio_listio_args 
*);
@@ -1066,6 +1073,7 @@ int   freebsd7_freebsd32_shmctl(struct thr
 #defineFREEBSD32_SYS_AUE_freebsd32_clock_settime   
AUE_CLOCK_SETTIME
 #defineFREEBSD32_SYS_AUE_freebsd32_clock_getresAUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_nanosleep   AUE_NULL
+#defineFREEBSD32_SYS_AUE_freebsd32_clock_getcpuclockid2AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_aio_readAUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_aio_write   AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_lio_listio  AUE_NULL

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Sat Jul 20 13:39:41 
2013(r253494)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Sat Jul 20 13:40:03 
2013(r253495)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 251526 
2013-06-08 13:27:57Z glebius 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 
2013-07-20 13:39:41Z kib 
  */
 
 #defineFREEBSD32_SYS_syscall   0
@@ -210,7 +210,7 @@
 #defineFREEBSD32_SYS_ffclock_getcounter241
 #defineFREEBSD32_SYS_ffclock_setestimate   242
 #defineFREEBSD32_SYS_ffclock_getestimate   243
-#defineFREEBSD32_SYS_clock_getcpuclockid2  247
+#defineFREEBSD32_SYS_freebsd32_clock_getcpuclockid2247
 #defineFREEBSD32_SYS_minherit  250
 #defineFREEBSD32_SYS_rfork 251
 #defineFREEBSD32_SYS_openbsd_poll  252

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Sat Jul 20 13:39:41 
2013(r253494)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Sat Jul 20 13:40:03 
2013(r253495)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 251526 
2013-06-08 13:27:57Z glebius 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 
2013-07-20 13:39:41Z kib 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -257,7 +257,7 @@ 

svn commit: r253497 - head/sys/dev/drm2/i915

2013-07-20 Thread Konstantin Belousov
Author: kib
Date: Sat Jul 20 13:52:40 2013
New Revision: 253497
URL: http://svnweb.freebsd.org/changeset/base/253497

Log:
  Use the right name for the vm_map_find(9) flag to specify shared
  mapping.  The MAP_SHARED and MAP_INHERIT_SHARE values are identical.
  
  Noted by: alc
  MFC after:3 days

Modified:
  head/sys/dev/drm2/i915/i915_gem.c

Modified: head/sys/dev/drm2/i915/i915_gem.c
==
--- head/sys/dev/drm2/i915/i915_gem.c   Sat Jul 20 13:41:25 2013
(r253496)
+++ head/sys/dev/drm2/i915/i915_gem.c   Sat Jul 20 13:52:40 2013
(r253497)
@@ -1290,7 +1290,7 @@ i915_gem_mmap_ioctl(struct drm_device *d
DRM_UNLOCK(dev);
rv = vm_map_find(map, obj-vm_obj, args-offset, addr, args-size,
VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE,
-   VM_PROT_READ | VM_PROT_WRITE, MAP_SHARED);
+   VM_PROT_READ | VM_PROT_WRITE, MAP_INHERIT_SHARE);
if (rv != KERN_SUCCESS) {
vm_object_deallocate(obj-vm_obj);
error = -vm_mmap_to_errno(rv);
___
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: r253498 - head/sys/fs/fuse

2013-07-20 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jul 20 14:50:35 2013
New Revision: 253498
URL: http://svnweb.freebsd.org/changeset/base/253498

Log:
  fuse: revert birthtime support.
  
  The creation time support breaks the data structures used in linux
  fuse.  libfuse carries it's own header.
  
  Revert the changes for now. We will try to get an agreement with the
  fuse  upstream maintainers to avoid having to patch the library
  headers all the time.

Modified:
  head/sys/fs/fuse/fuse_internal.h
  head/sys/fs/fuse/fuse_kernel.h

Modified: head/sys/fs/fuse/fuse_internal.h
==
--- head/sys/fs/fuse/fuse_internal.hSat Jul 20 13:52:40 2013
(r253497)
+++ head/sys/fs/fuse/fuse_internal.hSat Jul 20 14:50:35 2013
(r253498)
@@ -223,8 +223,6 @@ fuse_internal_attr_fat2vat(struct mount 
 vap-va_mtime.tv_nsec = fat-mtimensec;
 vap-va_ctime.tv_sec  = fat-ctime;
 vap-va_ctime.tv_nsec = fat-ctimensec;
-vap-va_birthtime.tv_sec  = fat-crtime;
-vap-va_birthtime.tv_nsec = fat-crtimensec;
 vap-va_blocksize = PAGE_SIZE;
 vap-va_type = IFTOVT(fat-mode);
 

Modified: head/sys/fs/fuse/fuse_kernel.h
==
--- head/sys/fs/fuse/fuse_kernel.h  Sat Jul 20 13:52:40 2013
(r253497)
+++ head/sys/fs/fuse/fuse_kernel.h  Sat Jul 20 14:50:35 2013
(r253498)
@@ -81,17 +81,16 @@ struct fuse_attr {
__u64   atime;
__u64   mtime;
__u64   ctime;
-   __u64   crtime;
__u32   atimensec;
__u32   mtimensec;
__u32   ctimensec;
-   __u32   crtimensec;
__u32   mode;
__u32   nlink;
__u32   uid;
__u32   gid;
__u32   rdev;
__u32   blksize;
+   __u32   padding;
 };
 
 struct fuse_kstatfs {
@@ -222,7 +221,7 @@ enum fuse_opcode {
 /* The read buffer is required to be at least 8k, but may be much larger */
 #define FUSE_MIN_READ_BUFFER 8192
 
-#define FUSE_COMPAT_ENTRY_OUT_SIZE 128
+#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
 
 struct fuse_entry_out {
__u64   nodeid; /* Inode ID */
@@ -245,7 +244,7 @@ struct fuse_getattr_in {
__u64   fh;
 };
 
-#define FUSE_COMPAT_ATTR_OUT_SIZE 104
+#define FUSE_COMPAT_ATTR_OUT_SIZE 96
 
 struct fuse_attr_out {
__u64   attr_valid; /* Cache timeout for the attributes */
___
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: r253502 - head/sbin/route

2013-07-20 Thread Hiroki Sato
Author: hrs
Date: Sat Jul 20 15:23:42 2013
New Revision: 253502
URL: http://svnweb.freebsd.org/changeset/base/253502

Log:
  Add cast to (void *) to the following cases to suppress warnings by
  -Wcast-align.  These do not increase the alignment requirement:
  
  - rtm = (struct rt_msghdr *)(rtm + rtm-rtm_msglen)
  - struct sockaddr *sa = sa0; sX = (struct sockaddr_X *)sa

Modified:
  head/sbin/route/route.c

Modified: head/sbin/route/route.c
==
--- head/sbin/route/route.c Sat Jul 20 15:09:27 2013(r253501)
+++ head/sbin/route/route.c Sat Jul 20 15:23:42 2013(r253502)
@@ -445,7 +445,7 @@ retry:
(void)printf(Examining routing table from sysctl\n);
seqno = 0;  /* ??? */
for (next = buf; next  lim; next += rtm-rtm_msglen) {
-   rtm = (struct rt_msghdr *)next;
+   rtm = (struct rt_msghdr *)(void *)next;
if (verbose)
print_rtmsg(rtm, rtm-rtm_msglen);
if ((rtm-rtm_flags  RTF_GATEWAY) == 0)
@@ -521,7 +521,7 @@ routename(struct sockaddr *sa)
{
struct in_addr in;
 
-   in = ((struct sockaddr_in *)sa)-sin_addr;
+   in = ((struct sockaddr_in *)(void *)sa)-sin_addr;
cp = NULL;
if (in.s_addr == INADDR_ANY || sa-sa_len  4)
cp = default;
@@ -568,16 +568,16 @@ routename(struct sockaddr *sa)
 
case AF_APPLETALK:
(void)snprintf(line, sizeof(line), atalk %s,
-   atalk_ntoa(((struct sockaddr_at *)sa)-sat_addr));
+   atalk_ntoa(((struct sockaddr_at *)(void *)sa)-sat_addr));
break;
 
case AF_LINK:
-   return (link_ntoa((struct sockaddr_dl *)sa));
+   return (link_ntoa((struct sockaddr_dl *)(void *)sa));
break;
 
default:
{
-   u_short *sp = (u_short *)sa;
+   u_short *sp = (u_short *)(void *)sa;
u_short *splim = sp + ((sa-sa_len + 1)  1);
char *cps = line + sprintf(line, (%d), sa-sa_family);
char *cpe = line + sizeof(line);
@@ -614,7 +614,7 @@ netname(struct sockaddr *sa)
{
struct in_addr in;
 
-   in = ((struct sockaddr_in *)sa)-sin_addr;
+   in = ((struct sockaddr_in *)(void *)sa)-sin_addr;
i = in.s_addr = ntohl(in.s_addr);
if (in.s_addr == 0)
cp = default;
@@ -664,16 +664,16 @@ netname(struct sockaddr *sa)
 
case AF_APPLETALK:
(void)snprintf(line, sizeof(line), atalk %s,
-   atalk_ntoa(((struct sockaddr_at *)sa)-sat_addr));
+   atalk_ntoa(((struct sockaddr_at *)(void *)sa)-sat_addr));
break;
 
case AF_LINK:
-   return (link_ntoa((struct sockaddr_dl *)sa));
+   return (link_ntoa((struct sockaddr_dl *)(void *)sa));
break;
 
default:
{
-   u_short *sp = (u_short *)sa-sa_data;
+   u_short *sp = (u_short *)(void *)sa-sa_data;
u_short *splim = sp + ((sa-sa_len + 1)1);
char *cps = line + sprintf(line, af %d:, sa-sa_family);
char *cpe = line + sizeof(line);
@@ -1160,7 +1160,7 @@ getaddr(int which, char *str, struct hos
case RTA_GATEWAY:
if (nrflags  F_INTERFACE) {
struct ifaddrs *ifap, *ifa;
-   struct sockaddr_dl *sdl0 = (struct sockaddr_dl *)sa;
+   struct sockaddr_dl *sdl0 = (struct sockaddr_dl *)(void 
*)sa;
struct sockaddr_dl *sdl = NULL;
 
if (getifaddrs(ifap))
@@ -1173,7 +1173,7 @@ getaddr(int which, char *str, struct hos
if (strcmp(str, ifa-ifa_name) != 0)
continue;
 
-   sdl = (struct sockaddr_dl *)ifa-ifa_addr;
+   sdl = (struct sockaddr_dl *)(void 
*)ifa-ifa_addr;
}
/* If we found it, then use it */
if (sdl != NULL) {
@@ -1226,15 +1226,14 @@ getaddr(int which, char *str, struct hos
if (q != NULL)
*q++ = '/';
if (which == RTA_DST)
-   return (inet6_makenetandmask((struct sockaddr_in6 *)sa,
-   q));
+   return (inet6_makenetandmask((struct sockaddr_in6 
*)(void *)sa, q));
return (0);
}
 #endif /* INET6 */
 
case AF_APPLETALK:
{
-   struct sockaddr_at *sat = (struct sockaddr_at *)sa;
+   struct sockaddr_at *sat = (struct sockaddr_at *)(void *)sa;
 
if 

svn commit: r253503 - head/sbin/route

2013-07-20 Thread Hiroki Sato
Author: hrs
Date: Sat Jul 20 15:58:43 2013
New Revision: 253503
URL: http://svnweb.freebsd.org/changeset/base/253503

Log:
  Show default for the zero-filled address consistently when nflag == 0.

Modified:
  head/sbin/route/route.c

Modified: head/sbin/route/route.c
==
--- head/sbin/route/route.c Sat Jul 20 15:23:42 2013(r253502)
+++ head/sbin/route/route.c Sat Jul 20 15:58:43 2013(r253503)
@@ -511,10 +511,8 @@ routename(struct sockaddr *sa)
domain[0] = '\0';
}
 
-   if (sa-sa_len == 0) {
-   strcpy(line, default);
-   return (line);
-   }
+   if (sa-sa_len == 0  nflag == 0)
+   return (default);
switch (sa-sa_family) {
 #ifdef INET
case AF_INET:
@@ -523,9 +521,9 @@ routename(struct sockaddr *sa)
 
in = ((struct sockaddr_in *)(void *)sa)-sin_addr;
cp = NULL;
-   if (in.s_addr == INADDR_ANY || sa-sa_len  4)
-   cp = default;
-   if (cp == NULL  !nflag) {
+   if (in.s_addr == INADDR_ANY  nflag == 0)
+   return (default);
+   if (nflag != 0) {
hp = gethostbyaddr((char *)in, sizeof (struct in_addr),
AF_INET);
if (hp != NULL) {
@@ -552,6 +550,10 @@ routename(struct sockaddr *sa)
struct sockaddr_in6 sin6; /* use static var for safety */
int niflags = 0;
 
+   /* Check if the address is ::.  If true, use default. */
+   if (nflag == 0 
+   IN6_IS_ADDR_UNSPECIFIED(((struct sockaddr_in6 *)(void 
*)sa)-sin6_addr))
+   return(default);
memset(sin6, 0, sizeof(sin6));
memcpy(sin6, sa, sa-sa_len);
sin6.sin6_len = sizeof(struct sockaddr_in6);
@@ -1712,13 +1714,8 @@ print_getmsg(struct rt_msghdr *rtm, int 
mask-sa_family = dst-sa_family;   /* XXX */
if (dst)
(void)printf(destination: %s\n, routename(dst));
-   if (mask) {
-   int savenflag = nflag;
-
-   nflag = 1;
+   if (mask)
(void)printf(   mask: %s\n, routename(mask));
-   nflag = savenflag;
-   }
if (gate  rtm-rtm_flags  RTF_GATEWAY)
(void)printf(gateway: %s\n, routename(gate));
if (fib = 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r252646 - head/sys/amd64/amd64

2013-07-20 Thread Jean-Sébastien Pédron
Hello Neel!

With commit r252646, I have a vm_page_dirty: page is invalid! panic
almost each time an X11 application or the X.Org server itself exit.
Everything runs fine if I revert this commit.

FreeBSD is built with the experimental radeonkms driver. As I haven't
seen any other report of this problem, I suppose I do something wrong in
TTM or the driver itself.

Here's the core.txt:
http://people.freebsd.org/~dumbbell/radeonkms/r252646-panic-vm_page_dirty-page-is-invalid.core.txt

Do you have any suggestion about what I should look for?

-- 
Jean-Sébastien Pédron



signature.asc
Description: OpenPGP digital signature


svn commit: r253504 - head/sbin/route

2013-07-20 Thread Hiroki Sato
Author: hrs
Date: Sat Jul 20 16:46:51 2013
New Revision: 253504
URL: http://svnweb.freebsd.org/changeset/base/253504

Log:
  - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_*
as the argument.
  - Reduce unnecessary loop in print_getmsg().

Modified:
  head/sbin/route/route.c

Modified: head/sbin/route/route.c
==
--- head/sbin/route/route.c Sat Jul 20 15:58:43 2013(r253503)
+++ head/sbin/route/route.c Sat Jul 20 16:46:51 2013(r253504)
@@ -825,35 +825,35 @@ newroute(int argc, char **argv)
case K_IFA:
if (!--argc)
usage(NULL);
-   getaddr(RTA_IFA, *++argv, 0, nrflags);
+   getaddr(RTAX_IFA, *++argv, 0, nrflags);
break;
case K_IFP:
if (!--argc)
usage(NULL);
-   getaddr(RTA_IFP, *++argv, 0, nrflags);
+   getaddr(RTAX_IFP, *++argv, 0, nrflags);
break;
case K_GENMASK:
if (!--argc)
usage(NULL);
-   getaddr(RTA_GENMASK, *++argv, 0, nrflags);
+   getaddr(RTAX_GENMASK, *++argv, 0, nrflags);
break;
case K_GATEWAY:
if (!--argc)
usage(NULL);
-   getaddr(RTA_GATEWAY, *++argv, 0, nrflags);
+   getaddr(RTAX_GATEWAY, *++argv, 0, nrflags);
gateway = *argv;
break;
case K_DST:
if (!--argc)
usage(NULL);
-   if (getaddr(RTA_DST, *++argv, hp, nrflags))
+   if (getaddr(RTAX_DST, *++argv, hp, nrflags))
nrflags |= F_ISHOST;
dest = *argv;
break;
case K_NETMASK:
if (!--argc)
usage(NULL);
-   getaddr(RTA_NETMASK, *++argv, 0, nrflags);
+   getaddr(RTAX_NETMASK, *++argv, 0, nrflags);
/* FALLTHROUGH */
case K_NET:
nrflags |= F_FORCENET;
@@ -888,13 +888,13 @@ newroute(int argc, char **argv)
} else {
if ((rtm_addrs  RTA_DST) == 0) {
dest = *argv;
-   if (getaddr(RTA_DST, *argv, hp, nrflags))
+   if (getaddr(RTAX_DST, *argv, hp, nrflags))
nrflags |= F_ISHOST;
} else if ((rtm_addrs  RTA_GATEWAY) == 0) {
gateway = *argv;
-   getaddr(RTA_GATEWAY, *argv, hp, nrflags);
+   getaddr(RTAX_GATEWAY, *argv, hp, nrflags);
} else {
-   getaddr(RTA_NETMASK, *argv, 0, nrflags);
+   getaddr(RTAX_NETMASK, *argv, 0, nrflags);
nrflags |= F_FORCENET;
}
}
@@ -1105,7 +1105,7 @@ inet6_makenetandmask(struct sockaddr_in6
  * returning 1 if a host address, 0 if a network address.
  */
 static int
-getaddr(int which, char *str, struct hostent **hpp, int nrflags)
+getaddr(int idx, char *str, struct hostent **hpp, int nrflags)
 {
struct sockaddr *sa;
 #if defined(INET)
@@ -1130,36 +1130,16 @@ getaddr(int which, char *str, struct hos
aflen = sizeof(struct sockaddr_dl);
 #endif
}
-   rtm_addrs |= which;
+   rtm_addrs |= (1  idx);
 
-   switch (which) {
-   case RTA_DST:
-   sa = (struct sockaddr *)so[RTAX_DST];
-   break;
-   case RTA_GATEWAY:
-   sa = (struct sockaddr *)so[RTAX_GATEWAY];
-   break;
-   case RTA_NETMASK:
-   sa = (struct sockaddr *)so[RTAX_NETMASK];
-   break;
-   case RTA_GENMASK:
-   sa = (struct sockaddr *)so[RTAX_GENMASK];
-   break;
-   case RTA_IFA:
-   sa = (struct sockaddr *)so[RTAX_IFA];
-   break;
-   case RTA_IFP:
-   sa = (struct sockaddr *)so[RTAX_IFP];
-   break;
-   default:
+   if (idx  RTAX_MAX)
usage(internal error);

svn commit: r253505 - head/etc

2013-07-20 Thread Hiroki Sato
Author: hrs
Date: Sat Jul 20 16:58:17 2013
New Revision: 253505
URL: http://svnweb.freebsd.org/changeset/base/253505

Log:
  Fix address range specification with ifconfig(8) options such as:
  
  - inet 192.0.2.1-10 netmask 255.255.255.0 (inet range spec + ifconfig options)
  - inet6 2001:db8:1::1-f prefixlen 60 (inet6 range spec + ifconfig options)
  
  If prefixlen or netmask option is specified with CIDR notation at
  the same time, the option is used.
  
  Tested by:Michael Grimm
  MFC after:3 days

Modified:
  head/etc/network.subr

Modified: head/etc/network.subr
==
--- head/etc/network.subr   Sat Jul 20 16:46:51 2013(r253504)
+++ head/etc/network.subr   Sat Jul 20 16:58:17 2013(r253505)
@@ -721,9 +721,14 @@ ifalias()
 #
 ifalias_expand_addr()
 {
+   local _af _action
 
-   afexists $1 || return
-   ifalias_expand_addr_$1 $2 $3
+   _af=$1
+   _action=$2
+   shift 2
+
+   afexists $_af || return
+   ifalias_expand_addr_$_af $_action $*
 }
 
 # ifalias_expand_addr_inet action addr
@@ -731,19 +736,34 @@ ifalias_expand_addr()
 #
 ifalias_expand_addr_inet()
 {
-   local _action _arg _cidr _cidr_addr
+   local _action _arg _cidr _cidr_addr _exargs
local _ipaddr _plen _range _iphead _iptail _iplow _iphigh _ipcount
local _retstr _c
_action=$1
_arg=$2
+   shift 2
+   _exargs=$*
_retstr=
 
-   case $_action:$_arg in
-   *:*--*) return ;;   # invalid
-   tmp:*)  echo $_arg  return ;; # already expanded
-   tmp:*-*)_action=alias ;;  # to be expanded
-   *:*-*)  ;;  # to be expanded
-   *:*)echo inet $_arg  return ;;# already expanded
+   case $_action:$_arg:$_exargs in
+   *:*--*) return ;;   # invalid
+   tmp:*[0-9]-[0-9]*:*)# to be expanded
+   _action=alias
+   ;;
+   *:*[0-9]-[0-9]*:*)  # to be expanded
+   ;;
+   tmp:*:*netmask*)# already expanded w/ netmask option
+   echo ${_arg%/[0-9]*} $_exargs  return
+   ;;
+   tmp:*:*)# already expanded w/o netmask option
+   echo $_arg $_exargs  return
+   ;;
+   *:*:*netmask*)  # already expanded w/ netmask option
+   echo inet ${_arg%/[0-9]*} $_exargs  return
+   ;;
+   *:*:*)  # already expanded w/o netmask option
+   echo inet $_arg $_exargs  return
+   ;;
esac
 
for _cidr in $_arg; do
@@ -796,7 +816,7 @@ ifalias_expand_addr_inet()
done
 
for _c in $_retstr; do
-   ifalias_expand_addr_inet $_action $_c
+   ifalias_expand_addr_inet $_action $_c $_exargs
done
 }
 
@@ -805,20 +825,35 @@ ifalias_expand_addr_inet()
 #
 ifalias_expand_addr_inet6()
 {
-   local _action _arg _cidr _cidr_addr
+   local _action _arg _cidr _cidr_addr _exargs
local _ipaddr _plen _ipleft _ipright _iplow _iphigh _ipcount
local _ipv4part
local _retstr _c
_action=$1
_arg=$2
+   shift 2
+   _exargs=$*
_retstr=
 
-   case $_action:$_arg in
-   *:*--*) return ;;   # invalid
-   tmp:*)  echo $_arg  return ;;
-   tmp:*-*)_action=alias ;;
-   *:*-*)  ;;
-   *:*)echo inet6 $_arg  return ;;
+   case $_action:$_arg:$_exargs in
+   *:*--*:*)   return ;;   # invalid
+   tmp:*[0-9a-zA-Z]-[0-9a-zA-Z]*:*)# to be expanded
+   _action=alias
+   ;;
+   *:*[0-9a-zA-Z]-[0-9a-zA-Z]*:*)  # to be expanded
+   ;;
+   tmp:*:*prefixlen*)  # already expanded w/ prefixlen option
+   echo ${_arg%/[0-9]*} $_exargs  return
+   ;;
+   tmp:*:*)# already expanded w/o prefixlen option
+   echo $_arg $_exargs  return
+   ;;
+   *:*:*prefixlen*)# already expanded w/ prefixlen option
+   echo inet6 ${_arg%/[0-9]*} $_exargs  return
+   ;;
+   *:*:*)  # already expanded w/o prefixlen option
+   echo inet6 $_arg $_exargs  return
+   ;;
esac
 
for _cidr in $_arg; do
@@ -872,7 +907,7 @@ ifalias_expand_addr_inet6()
fi
 
for _c in $_retstr; do
-   ifalias_expand_addr_inet6 $_action $_c
+   ifalias_expand_addr_inet6 $_action $_c $_exargs
done
else
# v4mapped/v4compat should handle as an IPv4 alias
@@ -888,7 +923,7 @@ ifalias_expand_addr_inet6()
_retstr=`ifalias_expand_addr_inet \
 

Re: svn commit: r252646 - head/sys/amd64/amd64

2013-07-20 Thread Neel Natu
Hi Jean-Sebastien,

On Sat, Jul 20, 2013 at 9:28 AM, Jean-Sébastien Pédron
dumbb...@freebsd.org wrote:
 Hello Neel!

 With commit r252646, I have a vm_page_dirty: page is invalid! panic
 almost each time an X11 application or the X.Org server itself exit.
 Everything runs fine if I revert this commit.

 FreeBSD is built with the experimental radeonkms driver. As I haven't
 seen any other report of this problem, I suppose I do something wrong in
 TTM or the driver itself.

 Here's the core.txt:
 http://people.freebsd.org/~dumbbell/radeonkms/r252646-panic-vm_page_dirty-page-is-invalid.core.txt

 Do you have any suggestion about what I should look for?


I would start looking by looking at the value of the page table entry
in question (this would be 'tpte' in pmap_remove_pages()).

In particular, it would be useful to identify whether this is pointing
to a superpage mapping and if so what page within the superpage is
triggering the vm_page_dirty: page is invalid panic.

The following patch may help to do that (but I haven't actually tested it):

Index: pmap.c
===
--- pmap.c  (revision 253505)
+++ pmap.c  (working copy)
@@ -4379,6 +4379,20 @@
return (rv);
 }

+static void
+pmap_check_valid(vm_page_t m, vm_offset_t va, pt_entry_t tpte)
+{
+   if (m-valid != VM_PAGE_BITS_ALL) {
+   printf(va = %#lx\n, va);
+   printf(tpte = %#lx\n, tpte);
+   printf(m-phys_addr = %#lx\n, m-phys_addr);
+   printf(m-valid = %#x\n, m-valid);
+   printf(m-dirty= %#x\n, m-dirty);
+   printf(m-flags = %x, aflags = %x, oflags = %x\n,
+   m-flags, m-aflags, m-oflags);
+   }
+}
+
 /*
  * Remove all pages from specified address space
  * this aids process exit speeds.  Also, this code
@@ -4469,10 +4483,14 @@
 */
if ((tpte  (PG_M | PG_RW)) == (PG_M | PG_RW)) {
if ((tpte  PG_PS) != 0) {
-   for (mt = m; mt  m[NBPDR / 
PAGE_SIZE]; mt++)
+   for (mt = m; mt  m[NBPDR / 
PAGE_SIZE]; mt++) {
+   pmap_check_valid(mt, 
pv-pv_va, tpte);
vm_page_dirty(mt);
-   } else
+   }
+   } else {
+   pmap_check_valid(m, pv-pv_va, 
tpte);
vm_page_dirty(m);
+   }
}

CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lock, m);

best
Neel

 --
 Jean-Sébastien Pédron

___
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: r253506 - head/sys/fs/nfs

2013-07-20 Thread Rick Macklem
Author: rmacklem
Date: Sat Jul 20 22:35:32 2013
New Revision: 253506
URL: http://svnweb.freebsd.org/changeset/base/253506

Log:
  The NFSv4 server incorrectly assumed that the high order words of
  the attribute bitmap argument would be non-zero. This caused an
  interoperability problem for a recent patch to the Linux NFSv4 client.
  The Linux folks have changed their patch to avoid this, but this
  patch fixes the problem on the server.
  
  Reported and tested by:   Andre Heider (a.hei...@gmail.com)
  MFC after:3 days

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cSat Jul 20 16:58:17 2013
(r253505)
+++ head/sys/fs/nfs/nfs_commonsubs.cSat Jul 20 22:35:32 2013
(r253506)
@@ -761,21 +761,21 @@ nfsrv_getattrbits(struct nfsrv_descript 
error = NFSERR_BADXDR;
goto nfsmout;
}
-   if (cnt  NFSATTRBIT_MAXWORDS) {
+   if (cnt  NFSATTRBIT_MAXWORDS)
outcnt = NFSATTRBIT_MAXWORDS;
-   if (retnotsupp)
-   *retnotsupp = NFSERR_ATTRNOTSUPP;
-   } else {
+   else
outcnt = cnt;
-   }
NFSZERO_ATTRBIT(attrbitp);
if (outcnt  0) {
NFSM_DISSECT(tl, u_int32_t *, outcnt * NFSX_UNSIGNED);
for (i = 0; i  outcnt; i++)
attrbitp-bits[i] = fxdr_unsigned(u_int32_t, *tl++);
}
-   if (cnt  outcnt)
-   error = nfsm_advance(nd, (cnt - outcnt) * NFSX_UNSIGNED, -1);
+   for (i = 0; i  (cnt - outcnt); i++) {
+   NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
+   if (retnotsupp != NULL  *tl != 0)
+   *retnotsupp = NFSERR_ATTRNOTSUPP;
+   }
if (cntp)
*cntp = NFSX_UNSIGNED + (cnt * NFSX_UNSIGNED);
 nfsmout:
___
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: r253507 - head/sys/mips/atheros

2013-07-20 Thread Adrian Chadd
Author: adrian
Date: Sun Jul 21 03:51:24 2013
New Revision: 253507
URL: http://svnweb.freebsd.org/changeset/base/253507

Log:
  Add two new CPU specific definitions - the watchdog clock frequency and
  the UART clock frequency.
  
  The AR933x and AR934x have separate PLL settings for these.

Modified:
  head/sys/mips/atheros/ar71xx_cpudef.h

Modified: head/sys/mips/atheros/ar71xx_cpudef.h
==
--- head/sys/mips/atheros/ar71xx_cpudef.h   Sat Jul 20 22:35:32 2013
(r253506)
+++ head/sys/mips/atheros/ar71xx_cpudef.h   Sun Jul 21 03:51:24 2013
(r253507)
@@ -121,10 +121,14 @@ extern uint32_t u_ar71xx_refclk;
 extern uint32_t u_ar71xx_cpu_freq;
 extern uint32_t u_ar71xx_ahb_freq;
 extern uint32_t u_ar71xx_ddr_freq;
+extern uint32_t u_ar71xx_uart_freq;
+extern uint32_t u_ar71xx_wdt_freq;
 
 static inline uint64_t ar71xx_refclk(void) { return u_ar71xx_refclk; }
 static inline uint64_t ar71xx_cpu_freq(void) { return u_ar71xx_cpu_freq; }
 static inline uint64_t ar71xx_ahb_freq(void) { return u_ar71xx_ahb_freq; }
 static inline uint64_t ar71xx_ddr_freq(void) { return u_ar71xx_ddr_freq; }
- 
+static inline uint64_t ar71xx_uart_freq(void) { return u_ar71xx_uart_freq; }
+static inline uint64_t ar71xx_wdt_freq(void) { return u_ar71xx_wdt_freq; }
+
 #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: r253508 - head/sys/mips/atheros

2013-07-20 Thread Adrian Chadd
Author: adrian
Date: Sun Jul 21 03:52:52 2013
New Revision: 253508
URL: http://svnweb.freebsd.org/changeset/base/253508

Log:
  Initialise the watchdog and UART frequencies.
  
  For all pre-AR933x chips, the frequency is just the APB frequency.
  For the AR933x, the UART frequency is different but we just hacked around
  it.
  
  For the AR934x, there's a different PLL setting for these, so they have
  to be broken out.

Modified:
  head/sys/mips/atheros/ar71xx_chip.c
  head/sys/mips/atheros/ar724x_chip.c
  head/sys/mips/atheros/ar91xx_chip.c
  head/sys/mips/atheros/ar933x_chip.c

Modified: head/sys/mips/atheros/ar71xx_chip.c
==
--- head/sys/mips/atheros/ar71xx_chip.c Sun Jul 21 03:51:24 2013
(r253507)
+++ head/sys/mips/atheros/ar71xx_chip.c Sun Jul 21 03:52:52 2013
(r253508)
@@ -78,6 +78,8 @@ __FBSDID($FreeBSD$);
 uint32_t u_ar71xx_cpu_freq;
 uint32_t u_ar71xx_ahb_freq;
 uint32_t u_ar71xx_ddr_freq;
+uint32_t u_ar71xx_uart_freq;
+uint32_t u_ar71xx_wdt_freq;
 uint32_t u_ar71xx_refclk;
 
 static void
@@ -107,6 +109,8 @@ ar71xx_chip_detect_sys_frequency(void)
 
div = (((pll  AR71XX_AHB_DIV_SHIFT)  AR71XX_AHB_DIV_MASK) + 1) * 2;
u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div;
+   u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div;
+   u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div;
 }
 
 /*

Modified: head/sys/mips/atheros/ar724x_chip.c
==
--- head/sys/mips/atheros/ar724x_chip.c Sun Jul 21 03:51:24 2013
(r253507)
+++ head/sys/mips/atheros/ar724x_chip.c Sun Jul 21 03:52:52 2013
(r253508)
@@ -90,6 +90,8 @@ ar724x_chip_detect_sys_frequency(void)
 
div = (((pll  AR724X_AHB_DIV_SHIFT)  AR724X_AHB_DIV_MASK) + 1) * 2;
u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div;
+   u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div;
+   u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div;
 }
 
 static void

Modified: head/sys/mips/atheros/ar91xx_chip.c
==
--- head/sys/mips/atheros/ar91xx_chip.c Sun Jul 21 03:51:24 2013
(r253507)
+++ head/sys/mips/atheros/ar91xx_chip.c Sun Jul 21 03:52:52 2013
(r253508)
@@ -84,6 +84,8 @@ ar91xx_chip_detect_sys_frequency(void)
 
div = (((pll  AR91XX_AHB_DIV_SHIFT)  AR91XX_AHB_DIV_MASK) + 1) * 2;
u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div;
+   u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div;
+   u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div;
 }
 
 static void

Modified: head/sys/mips/atheros/ar933x_chip.c
==
--- head/sys/mips/atheros/ar933x_chip.c Sun Jul 21 03:51:24 2013
(r253507)
+++ head/sys/mips/atheros/ar933x_chip.c Sun Jul 21 03:52:52 2013
(r253508)
@@ -114,6 +114,10 @@ ar933x_chip_detect_sys_frequency(void)
 AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK) + 1;
u_ar71xx_ahb_freq = freq / t;
}
+
+   /* XXX uart should be the refclk, no? */
+   u_ar71xx_uart_freq = u_ar71xx_ahb_freq;
+   u_ar71xx_wdt_freq = u_ar71xx_ahb_freq;
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r253509 - head/sys/mips/atheros

2013-07-20 Thread Adrian Chadd
Author: adrian
Date: Sun Jul 21 03:54:39 2013
New Revision: 253509
URL: http://svnweb.freebsd.org/changeset/base/253509

Log:
  Use the UART frequency when programming the UART clock.
  
  This allows the 16550 support to work correctly on the upcoming
  AR934x support.

Modified:
  head/sys/mips/atheros/uart_bus_ar71xx.c
  head/sys/mips/atheros/uart_bus_ar933x.c
  head/sys/mips/atheros/uart_cpu_ar71xx.c
  head/sys/mips/atheros/uart_cpu_ar933x.c

Modified: head/sys/mips/atheros/uart_bus_ar71xx.c
==
--- head/sys/mips/atheros/uart_bus_ar71xx.c Sun Jul 21 03:52:52 2013
(r253508)
+++ head/sys/mips/atheros/uart_bus_ar71xx.c Sun Jul 21 03:54:39 2013
(r253509)
@@ -70,7 +70,7 @@ uart_ar71xx_probe(device_t dev)
struct uart_softc *sc;
uint64_t freq;
 
-   freq = ar71xx_ahb_freq();
+   freq = ar71xx_uart_freq();
 
sc = device_get_softc(dev);
sc-sc_sysdev = SLIST_FIRST(uart_sysdevs);

Modified: head/sys/mips/atheros/uart_bus_ar933x.c
==
--- head/sys/mips/atheros/uart_bus_ar933x.c Sun Jul 21 03:52:52 2013
(r253508)
+++ head/sys/mips/atheros/uart_bus_ar933x.c Sun Jul 21 03:54:39 2013
(r253509)
@@ -72,7 +72,7 @@ uart_ar933x_probe(device_t dev)
struct uart_softc *sc;
uint64_t freq;
 
-   freq = ar71xx_refclk();
+   freq = ar71xx_uart_freq();
 
sc = device_get_softc(dev);
sc-sc_sysdev = SLIST_FIRST(uart_sysdevs);

Modified: head/sys/mips/atheros/uart_cpu_ar71xx.c
==
--- head/sys/mips/atheros/uart_cpu_ar71xx.c Sun Jul 21 03:52:52 2013
(r253508)
+++ head/sys/mips/atheros/uart_cpu_ar71xx.c Sun Jul 21 03:54:39 2013
(r253509)
@@ -56,7 +56,7 @@ uart_cpu_getdev(int devtype, struct uart
 {
uint64_t freq;
 
-   freq = ar71xx_ahb_freq();
+   freq = ar71xx_uart_freq();
 
di-ops = uart_getops(uart_ns8250_class);
di-bas.chan = 0;

Modified: head/sys/mips/atheros/uart_cpu_ar933x.c
==
--- head/sys/mips/atheros/uart_cpu_ar933x.c Sun Jul 21 03:52:52 2013
(r253508)
+++ head/sys/mips/atheros/uart_cpu_ar933x.c Sun Jul 21 03:54:39 2013
(r253509)
@@ -58,7 +58,7 @@ uart_cpu_getdev(int devtype, struct uart
 {
uint64_t freq;
 
-   freq = ar71xx_refclk();
+   freq = ar71xx_uart_freq();
 
di-ops = uart_getops(uart_ar933x_class);
di-bas.chan = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r253510 - head/sys/mips/atheros

2013-07-20 Thread Adrian Chadd
Author: adrian
Date: Sun Jul 21 03:55:18 2013
New Revision: 253510
URL: http://svnweb.freebsd.org/changeset/base/253510

Log:
  Teach the GPIO code about the AR934x GPIO register and pin counts.

Modified:
  head/sys/mips/atheros/ar71xx_gpio.c

Modified: head/sys/mips/atheros/ar71xx_gpio.c
==
--- head/sys/mips/atheros/ar71xx_gpio.c Sun Jul 21 03:54:39 2013
(r253509)
+++ head/sys/mips/atheros/ar71xx_gpio.c Sun Jul 21 03:55:18 2013
(r253510)
@@ -50,6 +50,7 @@ __FBSDID($FreeBSD$);
 #include mips/atheros/ar71xx_setup.h
 #include mips/atheros/ar71xx_gpiovar.h
 #include mips/atheros/ar933xreg.h
+#include mips/atheros/ar934xreg.h
 
 #include gpio_if.h
 
@@ -90,13 +91,23 @@ static int ar71xx_gpio_pin_toggle(device
 static void
 ar71xx_gpio_function_enable(struct ar71xx_gpio_softc *sc, uint32_t mask)
 {
-   GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask);
+   if (ar71xx_soc == AR71XX_SOC_AR9341 ||
+   ar71xx_soc == AR71XX_SOC_AR9342 ||
+   ar71xx_soc == AR71XX_SOC_AR9344)
+   GPIO_SET_BITS(sc, AR934X_GPIO_REG_FUNC, mask);
+   else
+   GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask);
 }
 
 static void
 ar71xx_gpio_function_disable(struct ar71xx_gpio_softc *sc, uint32_t mask)
 {
-   GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask);
+   if (ar71xx_soc == AR71XX_SOC_AR9341 ||
+   ar71xx_soc == AR71XX_SOC_AR9342 ||
+   ar71xx_soc == AR71XX_SOC_AR9344)
+   GPIO_CLEAR_BITS(sc, AR934X_GPIO_REG_FUNC, mask);
+   else
+   GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask);
 }
 
 static void
@@ -141,6 +152,10 @@ ar71xx_gpio_pin_max(device_t dev, int *m
case AR71XX_SOC_AR9331:
*maxpin = AR933X_GPIO_COUNT - 1;
break;
+   case AR71XX_SOC_AR9341:
+   case AR71XX_SOC_AR9342:
+   case AR71XX_SOC_AR9344:
+   *maxpin = AR934X_GPIO_COUNT - 1;
default:
*maxpin = AR71XX_GPIO_PINS - 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: r253511 - head/sys/mips/atheros

2013-07-20 Thread Adrian Chadd
Author: adrian
Date: Sun Jul 21 03:56:57 2013
New Revision: 253511
URL: http://svnweb.freebsd.org/changeset/base/253511

Log:
  Implement some initial AR934x support routines.
  
  This code reads the PLL configuration registers and correctly programs
  things so the UART and such can come up.
  
  There's MIPS74k platform issues that need fixing; but this at least brings
  things up enough to echo stuff out the serial port and allow for interactive
  debugging with ddb.
  
  Tested:
  
  * AR71xx SoCs
  * AR933x SoC
  * AR9344 board (DB120)
  
  Obtained from:Qualcomm Atheros; Linux/OpenWRT

Added:
  head/sys/mips/atheros/ar934x_chip.c   (contents, props changed)
  head/sys/mips/atheros/ar934x_chip.h   (contents, props changed)
Modified:
  head/sys/mips/atheros/ar71xx_setup.c
  head/sys/mips/atheros/files.ar71xx

Modified: head/sys/mips/atheros/ar71xx_setup.c
==
--- head/sys/mips/atheros/ar71xx_setup.cSun Jul 21 03:55:18 2013
(r253510)
+++ head/sys/mips/atheros/ar71xx_setup.cSun Jul 21 03:56:57 2013
(r253511)
@@ -53,6 +53,7 @@ __FBSDID($FreeBSD$);
  
 #include mips/atheros/ar71xxreg.h
 #include mips/atheros/ar933xreg.h
+#include mips/atheros/ar934xreg.h
 
 #include mips/atheros/ar71xx_setup.h
 
@@ -62,6 +63,7 @@ __FBSDID($FreeBSD$);
 #include mips/atheros/ar724x_chip.h
 #include mips/atheros/ar91xx_chip.h
 #include mips/atheros/ar933x_chip.h
+#include mips/atheros/ar934x_chip.h
 
 #defineAR71XX_SYS_TYPE_LEN 128
 
@@ -158,6 +160,30 @@ ar71xx_detect_sys_type(void)
ar71xx_cpu_ops = ar933x_chip_def;
break;
 
+   case REV_ID_MAJOR_AR9341:
+   minor = 0;
+   rev = (id  AR934X_REV_ID_REVISION_MASK);
+   chip = 9341;
+   ar71xx_soc = AR71XX_SOC_AR9341;
+   ar71xx_cpu_ops = ar934x_chip_def;
+   break;
+
+   case REV_ID_MAJOR_AR9342:
+   minor = 0;
+   rev = (id  AR934X_REV_ID_REVISION_MASK);
+   chip = 9342;
+   ar71xx_soc = AR71XX_SOC_AR9342;
+   ar71xx_cpu_ops = ar934x_chip_def;
+   break;
+
+   case REV_ID_MAJOR_AR9344:
+   minor = 0;
+   rev = (id  AR934X_REV_ID_REVISION_MASK);
+   chip = 9344;
+   ar71xx_soc = AR71XX_SOC_AR9344;
+   ar71xx_cpu_ops = ar934x_chip_def;
+   break;
+
default:
panic(ar71xx: unknown chip id:0x%08x\n, id);
}

Added: head/sys/mips/atheros/ar934x_chip.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/atheros/ar934x_chip.c Sun Jul 21 03:56:57 2013
(r253511)
@@ -0,0 +1,333 @@
+/*-
+ * Copyright (c) 2013 Adrian Chadd adr...@freebsd.org
+ * 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 sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include opt_ddb.h
+
+#include sys/param.h
+#include sys/conf.h
+#include sys/kernel.h
+#include sys/systm.h
+#include sys/bus.h
+#include sys/cons.h
+#include sys/kdb.h
+#include sys/reboot.h
+
+#include vm/vm.h
+#include vm/vm_page.h
+
+#include net/ethernet.h
+
+#include machine/clock.h
+#include machine/cpu.h
+#include machine/cpuregs.h
+#include machine/hwfunc.h
+#include machine/md_var.h
+#include machine/trap.h
+#include machine/vmparam.h
+
+#include mips/atheros/ar71xxreg.h
+#include mips/atheros/ar934xreg.h
+
+#include mips/atheros/ar71xx_cpudef.h
+#include mips/atheros/ar71xx_setup.h
+
+#include mips/atheros/ar71xx_chip.h
+#include 

svn commit: r253512 - head/sys/mips/conf

2013-07-20 Thread Adrian Chadd
Author: adrian
Date: Sun Jul 21 04:00:48 2013
New Revision: 253512
URL: http://svnweb.freebsd.org/changeset/base/253512

Log:
  Add some initial board support for the AR934x and the Qualcomm Atheros
  DB120 development board.
  
  The AR934x SoCs are a MIPS74k based system with increased RAM addressing
  space, some scratch-pad RAM, an improved gige switch PHY and 2x2 or 3x3
  on-board dual-band wifi.
  
  This support isn't complete by any stretch; it's just enough to bring
  the board up for others to tinker with.  Notably, the MIPS74k support
  is broken.  However it boots enough to echo some basic probe/attach
  messages, before dying somewhere in the TLB code.
  
  Thankyou to Qualcomm Atheros for their continued support of me doing
  open source work with their hardware.
  
  Tested:
  
  * AR9344, mips74k

Added:
  head/sys/mips/conf/AR934X_BASE   (contents, props changed)
  head/sys/mips/conf/AR934X_BASE.hints   (contents, props changed)
  head/sys/mips/conf/DB120   (contents, props changed)
  head/sys/mips/conf/DB120.hints   (contents, props changed)

Added: head/sys/mips/conf/AR934X_BASE
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/AR934X_BASE  Sun Jul 21 04:00:48 2013
(r253512)
@@ -0,0 +1,124 @@
+#
+# AR91XX -- Kernel configuration base file for the Atheros AR913x SoC.
+#
+# This file (and the hints file accompanying it) are not designed to be
+# used by themselves. Instead, users of this file should create a kernel
+# config file which includes this file (which gets the basic hints), then
+# override the default options (adding devices as needed) and adding
+# hints as needed (for example, the GPIO and LAN PHY.)
+#
+# $FreeBSD$
+#
+
+machine mips mips
+ident  AR934X_BASE
+cpuCPU_MIPS4KC
+makeoptionsKERNLOADADDR=0x8005
+optionsHZ=1000
+
+files  ../atheros/files.ar71xx
+hints  AR934X_BASE.hints
+
+makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
+# makeoptions  MODULES_OVERRIDE=random gpio ar71xx if_gif if_gre if_bridge 
bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp 
wlan_rssadapt wlan_amrr ath ath_ahb hwpmc
+makeoptionsMODULES_OVERRIDE=
+
+optionsDDB
+optionsKDB
+optionsALQ
+
+optionsSCHED_4BSD  #4BSD scheduler
+optionsINET#InterNETworking
+#options   INET6   #InterNETworking
+#options   NFSCL   #Network Filesystem Client
+optionsPSEUDOFS#Pseudo-filesystem framework
+options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time 
extensions
+
+# Don't include the SCSI/CAM strings in the default build
+optionsSCSI_NO_SENSE_STRINGS
+optionsSCSI_NO_OP_STRINGS
+
+# .. And no sysctl strings
+optionsNO_SYSCTL_DESCR
+
+# Limit IO size
+optionsNBUF=128
+
+# Limit UMTX hash size
+# options  UMTX_NUM_CHAINS=64
+
+# PMC
+#options   HWPMC_HOOKS
+#devicehwpmc
+#devicehwpmc_mips24k
+
+# options  NFS_LEGACYRPC
+# Debugging for use in -current
+#options   INVARIANTS
+#options   INVARIANT_SUPPORT
+#options   WITNESS
+#options   WITNESS_SKIPSPIN
+optionsFFS #Berkeley Fast Filesystem
+#options   SOFTUPDATES #Enable FFS soft updates support
+#options   UFS_ACL #Support for access control 
lists
+#options   UFS_DIRHASH #Improve performance on big 
directories
+optionsNO_FFS_SNAPSHOT # We don't require snapshot 
support
+
+# Wireless NIC cards
+optionsIEEE80211_DEBUG
+optionsIEEE80211_SUPPORT_MESH
+optionsIEEE80211_SUPPORT_TDMA
+optionsIEEE80211_SUPPORT_SUPERG
+optionsIEEE80211_ALQ   # 802.11 ALQ logging support
+device wlan# 802.11 support
+device wlan_wep# 802.11 WEP support
+device wlan_ccmp   # 802.11 CCMP support
+device wlan_tkip   # 802.11 TKIP support
+device wlan_xauth  # 802.11 hostap support
+
+# ath(4)
+device ath # Atheros network device
+device ath_rate_sample
+device ath_ahb # Atheros host bus glue
+optionsATH_DEBUG
+optionsATH_DIAGAPI
+option ATH_ENABLE_11N
+option AH_DEBUG_ALQ
+
+#deviceath_hal
+device ath_ar9300  # AR9330 HAL; no need for the others
+option AH_DEBUG
+option AH_SUPPORT_AR5416   # 11n HAL support
+option AH_SUPPORT_AR9340   # Chipset 

svn commit: r253513 - head/release

2013-07-20 Thread Glen Barber
Author: gjb
Date: Sun Jul 21 05:23:34 2013
New Revision: 253513
URL: http://svnweb.freebsd.org/changeset/base/253513

Log:
  Create memstick images with the '.img' filename extension.
  
  Requested by: many
  Approved by:  kib (mentor)
  MFC after:3 days
  X-MFC-To: stable/9 only

Modified:
  head/release/Makefile

Modified: head/release/Makefile
==
--- head/release/Makefile   Sun Jul 21 04:00:48 2013(r253512)
+++ head/release/Makefile   Sun Jul 21 05:23:34 2013(r253513)
@@ -4,7 +4,7 @@
 # 
 # User-driven targets:
 #  cdrom: Builds release CD-ROM media (release.iso)
-#  memstick: Builds memory stick image (memstick)
+#  memstick: Builds memory stick image (memstick.img)
 #  ftp: Sets up FTP distribution area (ftp)
 #  release: Build all media and FTP distribution area
 #  install: Copies all release media into ${DESTDIR}
@@ -73,8 +73,8 @@ RELEASE_TARGETS+= cdrom
 IMAGES+=   release.iso bootonly.iso
 .endif
 .if exists(${.CURDIR}/${TARGET}/make-memstick.sh)
-RELEASE_TARGETS+= memstick
-IMAGES+=   memstick
+RELEASE_TARGETS+= memstick.img
+IMAGES+=   memstick.img
 .endif
 
 .include bsd.obj.mk
@@ -167,7 +167,8 @@ release.iso: system
 bootonly.iso: bootonly
sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} 
bootonly
 
-memstick: system
+memstick: memstick.img
+memstick.img: system
sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET}
 
 packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES}
@@ -191,7 +192,7 @@ clean:
rm -f *.txz MANIFEST
rm -f system
rm -rf release bootonly
-   rm -f release.iso bootonly.iso memstick
+   rm -f release.iso bootonly.iso memstick.img
 
 install:
 .if defined(DESTDIR)  !empty(DESTDIR)
___
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