From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 00:30:43 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AB80B9C; Sun, 4 Nov 2012 00:30:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 037F28FC12; Sun, 4 Nov 2012 00:30:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA40Ug3V076797; Sun, 4 Nov 2012 00:30:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA40UgXO076793; Sun, 4 Nov 2012 00:30:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211040030.qA40UgXO076793@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 00:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242539 - stable/9/etc/root X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 00:30:43 -0000 Author: eadler Date: Sun Nov 4 00:30:42 2012 New Revision: 242539 URL: http://svn.freebsd.org/changeset/base/242539 Log: MFC r242452: The test fails with "exit 1" if /usr/games/fortune doesn't actually exist. Fix that. PR: conf/71994 Approved by: cperciva (implicit) Modified: stable/9/etc/root/dot.login Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/root/dot.login ============================================================================== --- stable/9/etc/root/dot.login Sun Nov 4 00:30:42 2012 (r242538) +++ stable/9/etc/root/dot.login Sun Nov 4 00:30:42 2012 (r242539) @@ -6,4 +6,4 @@ # # Uncomment to display a random cookie each login: -# [ -x /usr/games/fortune ] && /usr/games/fortune -s +# if ( -x /usr/games/fortune ) /usr/games/fortune -s From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 01:21:50 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48717249; Sun, 4 Nov 2012 01:21:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 282028FC12; Sun, 4 Nov 2012 01:21:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA41LoOp084673; Sun, 4 Nov 2012 01:21:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA41LnGS084649; Sun, 4 Nov 2012 01:21:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211040121.qA41LnGS084649@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 01:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242544 - in stable/9: lib/libc/net lib/libdwarf lib/libpam/modules/pam_krb5 sbin/ddb sbin/natd sys/cam/ctl sys/dev/cxgb sys/dev/e1000 sys/dev/hpt27xx sys/dev/mps sys/dev/oce sys/dev/so... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 01:21:50 -0000 Author: eadler Date: Sun Nov 4 01:21:49 2012 New Revision: 242544 URL: http://svn.freebsd.org/changeset/base/242544 Log: MFC r241844: remove duplicate semicolons where possible. Approved by: cperciva (implicit) Modified: stable/9/lib/libc/net/ip6opt.c stable/9/lib/libdwarf/dwarf_init.c stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c stable/9/sbin/ddb/ddb.c stable/9/sbin/natd/natd.c stable/9/sys/cam/ctl/ctl.c stable/9/sys/dev/cxgb/cxgb_main.c stable/9/sys/dev/e1000/if_lem.c stable/9/sys/dev/hpt27xx/os_bsd.c stable/9/sys/dev/mps/mps_sas.c stable/9/sys/dev/mps/mps_user.c stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/sound/pci/hda/hdaa.c stable/9/sys/kern/sched_ule.c stable/9/sys/mips/rmi/xlr_i2c.c stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c stable/9/sys/ofed/drivers/net/mlx4/en_rx.c stable/9/tools/regression/lib/libc/nss/test-gethostby.c stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c stable/9/usr.sbin/diskinfo/diskinfo.c stable/9/usr.sbin/ppp/radius.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libdwarf/ (props changed) stable/9/lib/libpam/ (props changed) stable/9/sbin/ddb/ (props changed) stable/9/sbin/natd/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/fs/ (props changed) stable/9/tools/regression/lib/libc/ (props changed) stable/9/tools/regression/sockets/ (props changed) stable/9/usr.sbin/diskinfo/ (props changed) stable/9/usr.sbin/ppp/ (props changed) Modified: stable/9/lib/libc/net/ip6opt.c ============================================================================== --- stable/9/lib/libc/net/ip6opt.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/lib/libc/net/ip6opt.c Sun Nov 4 01:21:49 2012 (r242544) @@ -461,7 +461,7 @@ inet6_opt_append(void *extbuf, socklen_t int inet6_opt_finish(void *extbuf, socklen_t extlen, int offset) { - int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0;; + int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0; if (extbuf) { u_int8_t *padp; Modified: stable/9/lib/libdwarf/dwarf_init.c ============================================================================== --- stable/9/lib/libdwarf/dwarf_init.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/lib/libdwarf/dwarf_init.c Sun Nov 4 01:21:49 2012 (r242544) @@ -551,7 +551,7 @@ dwarf_init_info(Dwarf_Debug dbg, Dwarf_E Dwarf_Attribute at; Dwarf_Die die; uint64_t abnum; - uint64_t die_offset = offset;; + uint64_t die_offset = offset; abnum = dwarf_read_uleb128(&d, &offset); Modified: stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c ============================================================================== --- stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Nov 4 01:21:49 2012 (r242544) @@ -633,7 +633,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int if (krbret != 0) { PAM_LOG("Error krb5_cc_get_principal(): %s", krb5_get_err_text(pam_context, krbret)); - retval = PAM_PERM_DENIED;; + retval = PAM_PERM_DENIED; goto cleanup; } Modified: stable/9/sbin/ddb/ddb.c ============================================================================== --- stable/9/sbin/ddb/ddb.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sbin/ddb/ddb.c Sun Nov 4 01:21:49 2012 (r242544) @@ -80,7 +80,7 @@ ddb_readfile(char *filename) argc++; spn = strcspn(argv[0], WHITESP); - argv[1] = argv[0] + spn + strspn(argv[0] + spn, WHITESP);; + argv[1] = argv[0] + spn + strspn(argv[0] + spn, WHITESP); argv[0][spn] = '\0'; if (*argv[1] != '\0') argc++; Modified: stable/9/sbin/natd/natd.c ============================================================================== --- stable/9/sbin/natd/natd.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sbin/natd/natd.c Sun Nov 4 01:21:49 2012 (r242544) @@ -1509,7 +1509,7 @@ static void ParseOption (const char* opt break; case LogIpfwDenied: - logIpfwDenied = yesNoValue;; + logIpfwDenied = yesNoValue; break; case PidFile: Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/cam/ctl/ctl.c Sun Nov 4 01:21:49 2012 (r242544) @@ -480,7 +480,7 @@ ctl_isc_handler_finish_xfer(struct ctl_s memcpy(&ctsio->sense_data, &msg_info->scsi.sense_data, sizeof(ctsio->sense_data)); memcpy(&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - &msg_info->scsi.lbalen, sizeof(msg_info->scsi.lbalen));; + &msg_info->scsi.lbalen, sizeof(msg_info->scsi.lbalen)); STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links); ctl_wakeup_thread(); } @@ -12681,7 +12681,7 @@ ctl_process_done(union ctl_io *io, int h */ memcpy(&msg.scsi.lbalen, &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(msg.scsi.lbalen));; + sizeof(msg.scsi.lbalen)); if (ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg, sizeof(msg), 0) > CTL_HA_STATUS_SUCCESS) { Modified: stable/9/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_main.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/cxgb/cxgb_main.c Sun Nov 4 01:21:49 2012 (r242544) @@ -2984,7 +2984,7 @@ cxgb_extension_ioctl(struct cdev *dev, u break; } case CHELSIO_SET_FILTER: { - struct ch_filter *f = (struct ch_filter *)data;; + struct ch_filter *f = (struct ch_filter *)data; struct filter_info *p; unsigned int nfilters = sc->params.mc5.nfilters; Modified: stable/9/sys/dev/e1000/if_lem.c ============================================================================== --- stable/9/sys/dev/e1000/if_lem.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/e1000/if_lem.c Sun Nov 4 01:21:49 2012 (r242544) @@ -3455,7 +3455,7 @@ lem_free_receive_structures(struct adapt static bool lem_rxeof(struct adapter *adapter, int count, int *done) { - struct ifnet *ifp = adapter->ifp;; + struct ifnet *ifp = adapter->ifp; struct mbuf *mp; u8 status = 0, accept_frame = 0, eop = 0; u16 len, desc_len, prev_len_adj; Modified: stable/9/sys/dev/hpt27xx/os_bsd.c ============================================================================== --- stable/9/sys/dev/hpt27xx/os_bsd.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/hpt27xx/os_bsd.c Sun Nov 4 01:21:49 2012 (r242544) @@ -133,7 +133,7 @@ HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT } HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) { - return (HPT_U32)pci_cfgregread(bus, dev, func, reg, 4);; + return (HPT_U32)pci_cfgregread(bus, dev, func, reg, 4); } void pcicfg_write_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U8 v) { Modified: stable/9/sys/dev/mps/mps_sas.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/mps/mps_sas.c Sun Nov 4 01:21:49 2012 (r242544) @@ -2020,7 +2020,7 @@ mpssas_scsiio_complete(struct mps_softc if (cm->cm_flags & MPS_CM_FLAGS_DATAIN) dir = BUS_DMASYNC_POSTREAD; else if (cm->cm_flags & MPS_CM_FLAGS_DATAOUT) - dir = BUS_DMASYNC_POSTWRITE;; + dir = BUS_DMASYNC_POSTWRITE; bus_dmamap_sync(sc->buffer_dmat, cm->cm_dmamap, dir); bus_dmamap_unload(sc->buffer_dmat, cm->cm_dmamap); } Modified: stable/9/sys/dev/mps/mps_user.c ============================================================================== --- stable/9/sys/dev/mps/mps_user.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/mps/mps_user.c Sun Nov 4 01:21:49 2012 (r242544) @@ -1000,7 +1000,7 @@ mps_user_pass_thru(struct mps_softc *sc, if (cm->cm_flags & MPS_CM_FLAGS_DATAIN) dir = BUS_DMASYNC_POSTREAD; else if (cm->cm_flags & MPS_CM_FLAGS_DATAOUT) - dir = BUS_DMASYNC_POSTWRITE;; + dir = BUS_DMASYNC_POSTWRITE; bus_dmamap_sync(sc->buffer_dmat, cm->cm_dmamap, dir); bus_dmamap_unload(sc->buffer_dmat, cm->cm_dmamap); Modified: stable/9/sys/dev/oce/oce_if.c ============================================================================== --- stable/9/sys/dev/oce/oce_if.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/oce/oce_if.c Sun Nov 4 01:21:49 2012 (r242544) @@ -256,7 +256,7 @@ oce_attach(device_t dev) rc = oce_hw_start(sc); if (rc) - goto lro_free;; + goto lro_free; sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdaa.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/sound/pci/hda/hdaa.c Sun Nov 4 01:21:49 2012 (r242544) @@ -1148,7 +1148,7 @@ hdaa_widget_parse(struct hdaa_widget *w) w->wclass.pin.config = hda_command(dev, HDA_CMD_GET_CONFIGURATION_DEFAULT(0, w->nid)); w->wclass.pin.cap = hda_command(dev, - HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP));; + HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP)); w->wclass.pin.ctrl = hda_command(dev, HDA_CMD_GET_PIN_WIDGET_CTRL(0, nid)); if (HDA_PARAM_PIN_CAP_EAPD_CAP(w->wclass.pin.cap)) { Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/kern/sched_ule.c Sun Nov 4 01:21:49 2012 (r242544) @@ -202,7 +202,7 @@ static struct td_sched td_sched0; */ static int sched_interact = SCHED_INTERACT_THRESH; static int realstathz = 127; -static int tickincr = 8 << SCHED_TICK_SHIFT;; +static int tickincr = 8 << SCHED_TICK_SHIFT; static int sched_slice = 12; #ifdef PREEMPTION #ifdef FULL_PREEMPTION Modified: stable/9/sys/mips/rmi/xlr_i2c.c ============================================================================== --- stable/9/sys/mips/rmi/xlr_i2c.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/mips/rmi/xlr_i2c.c Sun Nov 4 01:21:49 2012 (r242544) @@ -332,7 +332,7 @@ retry: continue; if (pos >= len) - break;; + break; } *sent = len - 1; return 0; Modified: stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Sun Nov 4 01:21:49 2012 (r242544) @@ -723,7 +723,7 @@ void ipoib_mcast_restart_task(struct wor void ipoib_mcast_restart(struct ipoib_dev_priv *priv) { struct ifnet *dev = priv->dev; - struct ifmultiaddr *ifma;; + struct ifmultiaddr *ifma; struct ipoib_mcast *mcast, *tmcast; LIST_HEAD(remove_list); struct ib_sa_mcmember_rec rec; Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 4 01:21:49 2012 (r242544) @@ -101,7 +101,7 @@ u64 mlx4_en_mac_to_u64(u8 *addr) static int mlx4_en_cache_mclist(struct net_device *dev, u64 **mcaddrp) { - struct ifmultiaddr *ifma;; + struct ifmultiaddr *ifma; u64 *mcaddr; int cnt; int i; Modified: stable/9/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Sun Nov 4 01:21:49 2012 (r242544) @@ -405,7 +405,7 @@ static inline int invalid_cqe(struct mlx } if (unlikely(cqe->badfcs_enc & MLX4_CQE_BAD_FCS)) { en_dbg(RX_ERR, priv, "Accepted frame with bad FCS\n"); - return 1;; + return 1; } return 0; Modified: stable/9/tools/regression/lib/libc/nss/test-gethostby.c ============================================================================== --- stable/9/tools/regression/lib/libc/nss/test-gethostby.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/tools/regression/lib/libc/nss/test-gethostby.c Sun Nov 4 01:21:49 2012 (r242544) @@ -565,7 +565,7 @@ hostent_read_snapshot_addr(char *addr, u static int hostent_read_snapshot_func(struct hostent *ht, char *line) { - StringList *sl1, *sl2;; + StringList *sl1, *sl2; char *s, *ps, *ts; int i, rv; Modified: stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c ============================================================================== --- stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c Sun Nov 4 01:21:49 2012 (r242544) @@ -1513,7 +1513,7 @@ t_timestamp_server(int fd1) msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_control = control_un.control; - msg.msg_controllen = sizeof control_un.control;; + msg.msg_controllen = sizeof control_un.control; msg.msg_flags = 0; if (recvmsg_timeout(fd2, &msg, sizeof buf) < 0) Modified: stable/9/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/9/usr.sbin/diskinfo/diskinfo.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/usr.sbin/diskinfo/diskinfo.c Sun Nov 4 01:21:49 2012 (r242544) @@ -335,7 +335,7 @@ speeddisk(int fd, off_t mediasize, u_int TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1; rdsect(fd, b0, sectorsize); T0(); for (i = 0; i < bulk; i++) { Modified: stable/9/usr.sbin/ppp/radius.c ============================================================================== --- stable/9/usr.sbin/ppp/radius.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/usr.sbin/ppp/radius.c Sun Nov 4 01:21:49 2012 (r242544) @@ -784,7 +784,7 @@ radius_Init(struct radius *r) r->mppe.recvkeylen = 0; r->mppe.sendkey = NULL; r->mppe.sendkeylen = 0; - *r->cfg.file = '\0';; + *r->cfg.file = '\0'; log_Printf(LogDEBUG, "Radius: radius_Init\n"); } From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 06:35:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D68F345A; Sun, 4 Nov 2012 06:35:08 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD6018FC08; Sun, 4 Nov 2012 06:35:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA46Z8ke010234; Sun, 4 Nov 2012 06:35:08 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA46Z8Y8010232; Sun, 4 Nov 2012 06:35:08 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211040635.qA46Z8Y8010232@svn.freebsd.org> From: Peter Wemm Date: Sun, 4 Nov 2012 06:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242548 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 06:35:09 -0000 Author: peter Date: Sun Nov 4 06:35:08 2012 New Revision: 242548 URL: http://svn.freebsd.org/changeset/base/242548 Log: MFC r242089: limit of 15 -> 63 logical volumes Modified: stable/9/sys/dev/ciss/cissvar.h Modified: stable/9/sys/dev/ciss/cissvar.h ============================================================================== --- stable/9/sys/dev/ciss/cissvar.h Sun Nov 4 06:24:13 2012 (r242547) +++ stable/9/sys/dev/ciss/cissvar.h Sun Nov 4 06:35:08 2012 (r242548) @@ -46,7 +46,7 @@ typedef STAILQ_HEAD(, ciss_request) cr_q /* * Maximum number of logical drives we support. */ -#define CISS_MAX_LOGICAL 15 +#define CISS_MAX_LOGICAL 63 /* * Maximum number of physical devices we support. From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 11:46:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECDB5189; Sun, 4 Nov 2012 11:46:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D304F8FC08; Sun, 4 Nov 2012 11:46:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4BkHeJ076715; Sun, 4 Nov 2012 11:46:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4BkHjL076713; Sun, 4 Nov 2012 11:46:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211041146.qA4BkHjL076713@svn.freebsd.org> From: Dimitry Andric Date: Sun, 4 Nov 2012 11:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242552 - stable/9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 11:46:18 -0000 Author: dim Date: Sun Nov 4 11:46:17 2012 New Revision: 242552 URL: http://svn.freebsd.org/changeset/base/242552 Log: MFC r236258: For clang, similar to r236137, enable gnu hash generation for dynamic ELF binaries on x86. MFC r238863: Similar to r238472, let clang pass --enable-new-dtags to the linker invocation by default. Also make sure --hash-style=both is passed for the same arches as gcc, e.g. arm, sparc and x86. Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sun Nov 4 09:27:01 2012 (r242551) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sun Nov 4 11:46:17 2012 (r242552) @@ -4760,6 +4760,11 @@ void freebsd::Link::ConstructJob(Compila CmdArgs.push_back("-dynamic-linker"); CmdArgs.push_back("/libexec/ld-elf.so.1"); } + llvm::Triple::ArchType Arch = getToolChain().getArch(); + if (Arch == llvm::Triple::arm || Arch == llvm::Triple::sparc || + Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64) + CmdArgs.push_back("--hash-style=both"); + CmdArgs.push_back("--enable-new-dtags"); } // When building 32-bit code on FreeBSD/amd64, we have to explicitly From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 12:05:55 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 583EE70E; Sun, 4 Nov 2012 12:05:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F4E38FC15; Sun, 4 Nov 2012 12:05:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4C5tEQ080771; Sun, 4 Nov 2012 12:05:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4C5tGE080769; Sun, 4 Nov 2012 12:05:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211041205.qA4C5tGE080769@svn.freebsd.org> From: Dimitry Andric Date: Sun, 4 Nov 2012 12:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242553 - stable/9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 12:05:55 -0000 Author: dim Date: Sun Nov 4 12:05:54 2012 New Revision: 242553 URL: http://svn.freebsd.org/changeset/base/242553 Log: MFC r238864: Similar to what is already done for Linux, make clang not complain about unused -g, -emit-llvm or -w arguments when doing linking. E.g. invoking "clang -g foo.o -o foo" will now be silent. Reported by: Jakub Lach Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sun Nov 4 11:46:17 2012 (r242552) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sun Nov 4 12:05:54 2012 (r242553) @@ -4745,6 +4745,14 @@ void freebsd::Link::ConstructJob(Compila const Driver &D = getToolChain().getDriver(); ArgStringList CmdArgs; + // Silence warning for "clang -g foo.o -o foo" + Args.ClaimAllArgs(options::OPT_g_Group); + // and "clang -emit-llvm foo.o -o foo" + Args.ClaimAllArgs(options::OPT_emit_llvm); + // and for "clang -w foo.o -o foo". Other warning options are already + // handled somewhere else. + Args.ClaimAllArgs(options::OPT_w); + if (!D.SysRoot.empty()) CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot)); From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 13:29:48 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4380F95; Sun, 4 Nov 2012 13:29:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 217088FC0C; Sun, 4 Nov 2012 13:29:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DTmR4097283; Sun, 4 Nov 2012 13:29:48 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DTl4V097278; Sun, 4 Nov 2012 13:29:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041329.qA4DTl4V097278@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242554 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:29:48 -0000 Author: avg Date: Sun Nov 4 13:29:47 2012 New Revision: 242554 URL: http://svn.freebsd.org/changeset/base/242554 Log: MFC r241286,r242135: zfs_mount: taste geom providers for root pool config Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 4 12:05:54 2012 (r242553) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 4 13:29:47 2012 (r242554) @@ -3167,8 +3167,8 @@ spa_create(const char *pool, nvlist_t *n return (0); } -#if defined(sun) #ifdef _KERNEL +#if defined(sun) /* * Get the root pool information from the root disk, then import the root pool * during the system boot up time. @@ -3370,8 +3370,115 @@ out: return (error); } -#endif +#else + +extern int +vdev_geom_read_pool_label(const char *name, nvlist_t **config); + +static nvlist_t * +spa_generate_rootconf(const char *name) +{ + nvlist_t *config; + nvlist_t *nvtop, *nvroot; + uint64_t pgid; + + if (vdev_geom_read_pool_label(name, &config) != 0) + return (NULL); + + /* + * Add this top-level vdev to the child array. + */ + VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, + &nvtop) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID, + &pgid) == 0); + + /* + * Put this pool's top-level vdevs into a root vdev. + */ + VERIFY(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, KM_SLEEP) == 0); + VERIFY(nvlist_add_string(nvroot, ZPOOL_CONFIG_TYPE, + VDEV_TYPE_ROOT) == 0); + VERIFY(nvlist_add_uint64(nvroot, ZPOOL_CONFIG_ID, 0ULL) == 0); + VERIFY(nvlist_add_uint64(nvroot, ZPOOL_CONFIG_GUID, pgid) == 0); + VERIFY(nvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, + &nvtop, 1) == 0); + + /* + * Replace the existing vdev_tree with the new root vdev in + * this pool's configuration (remove the old, add the new). + */ + VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, nvroot) == 0); + nvlist_free(nvroot); + return (config); +} + +int +spa_import_rootpool(const char *name) +{ + spa_t *spa; + vdev_t *rvd, *bvd, *avd = NULL; + nvlist_t *config, *nvtop; + uint64_t txg; + char *pname; + int error; + + /* + * Read the label from the boot device and generate a configuration. + */ + config = spa_generate_rootconf(name); + if (config == NULL) { + cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", + name); + return (EIO); + } + + VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, + &pname) == 0 && strcmp(name, pname) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) == 0); + + mutex_enter(&spa_namespace_lock); + if ((spa = spa_lookup(pname)) != NULL) { + /* + * Remove the existing root pool from the namespace so that we + * can replace it with the correct config we just read in. + */ + spa_remove(spa); + } + spa = spa_add(pname, config, NULL); + spa->spa_is_root = B_TRUE; + spa->spa_import_flags = ZFS_IMPORT_VERBATIM; + + /* + * Build up a vdev tree based on the boot device's label config. + */ + VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, + &nvtop) == 0); + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); + error = spa_config_parse(spa, &rvd, nvtop, NULL, 0, + VDEV_ALLOC_ROOTPOOL); + spa_config_exit(spa, SCL_ALL, FTAG); + if (error) { + mutex_exit(&spa_namespace_lock); + nvlist_free(config); + cmn_err(CE_NOTE, "Can not parse the config for pool '%s'", + pname); + return (error); + } + + error = 0; + spa_history_log_version(spa, LOG_POOL_IMPORT); +out: + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); + vdev_free(rvd); + spa_config_exit(spa, SCL_ALL, FTAG); + mutex_exit(&spa_namespace_lock); + + return (error); +} + #endif /* sun */ +#endif /* * Import a non-root pool into the system. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sun Nov 4 12:05:54 2012 (r242553) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sun Nov 4 13:29:47 2012 (r242554) @@ -419,7 +419,11 @@ extern int spa_get_stats(const char *poo char *altroot, size_t buflen); extern int spa_create(const char *pool, nvlist_t *config, nvlist_t *props, const char *history_str, nvlist_t *zplprops); +#if defined(sun) extern int spa_import_rootpool(char *devpath, char *devid); +#else +extern int spa_import_rootpool(const char *name); +#endif extern int spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags); extern nvlist_t *spa_tryimport(nvlist_t *tryconfig); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 4 12:05:54 2012 (r242553) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 4 13:29:47 2012 (r242554) @@ -175,17 +175,11 @@ vdev_geom_detach(void *arg, int flag __u static uint64_t nvlist_get_guid(nvlist_t *list) { - nvpair_t *elem = NULL; uint64_t value; - while ((elem = nvlist_next_nvpair(list, elem)) != NULL) { - if (nvpair_type(elem) == DATA_TYPE_UINT64 && - strcmp(nvpair_name(elem), "guid") == 0) { - VERIFY(nvpair_value_uint64(elem, &value) == 0); - return (value); - } - } - return (0); + value = 0; + nvlist_lookup_uint64(list, ZPOOL_CONFIG_GUID, &value); + return (value); } static int @@ -223,8 +217,16 @@ vdev_geom_io(struct g_consumer *cp, int return (error); } -static uint64_t -vdev_geom_read_guid(struct g_consumer *cp) +static void +vdev_geom_taste_orphan(struct g_consumer *cp) +{ + + KASSERT(1 == 0, ("%s called while tasting %s.", __func__, + cp->provider->name)); +} + +static int +vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) { struct g_provider *pp; vdev_label_t *label; @@ -232,13 +234,13 @@ vdev_geom_read_guid(struct g_consumer *c size_t buflen; uint64_t psize; off_t offset, size; - uint64_t guid; + uint64_t guid, state, txg; int error, l, len; g_topology_assert_not(); pp = cp->provider; - ZFS_LOG(1, "Reading guid from %s...", pp->name); + ZFS_LOG(1, "Reading config from %s...", pp->name); psize = pp->mediasize; psize = P2ALIGN(psize, (uint64_t)sizeof(vdev_label_t)); @@ -250,8 +252,8 @@ vdev_geom_read_guid(struct g_consumer *c label = kmem_alloc(size, KM_SLEEP); buflen = sizeof(label->vl_vdev_phys.vp_nvlist); + *config = NULL; for (l = 0; l < VDEV_LABELS; l++) { - nvlist_t *config = NULL; offset = vdev_label_offset(psize, l, 0); if ((offset % pp->sectorsize) != 0) @@ -261,27 +263,151 @@ vdev_geom_read_guid(struct g_consumer *c continue; buf = label->vl_vdev_phys.vp_nvlist; - if (nvlist_unpack(buf, buflen, &config, 0) != 0) + if (nvlist_unpack(buf, buflen, config, 0) != 0) continue; - guid = nvlist_get_guid(config); - nvlist_free(config); - if (guid != 0) - break; + if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE, + &state) != 0 || state == POOL_STATE_DESTROYED || + state > POOL_STATE_L2CACHE) { + nvlist_free(*config); + *config = NULL; + continue; + } + + if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE && + (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG, + &txg) != 0 || txg == 0)) { + nvlist_free(*config); + *config = NULL; + continue; + } + + break; } kmem_free(label, size); - if (guid != 0) - ZFS_LOG(1, "guid for %s is %ju", pp->name, (uintmax_t)guid); - return (guid); + return (*config == NULL ? ENOENT : 0); +} + +static int +vdev_geom_check_config(nvlist_t *config, const char *name, uint64_t *best_txg) +{ + uint64_t vdev_guid; + uint64_t txg; + char *pname; + + if (nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, &pname) != 0 || + strcmp(pname, name) != 0) + return (ENOENT); + + ZFS_LOG(1, "found pool: %s", pname); + + txg = 0; + nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg); + if (txg <= *best_txg) + return (ENOENT); + *best_txg = txg; + ZFS_LOG(1, "txg: %ju", (uintmax_t)*best_txg); + + return (0); +} + +static int +vdev_geom_attach_taster(struct g_consumer *cp, struct g_provider *pp) +{ + int error; + + if (pp->flags & G_PF_WITHER) + return (EINVAL); + if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) + return (EINVAL); + g_attach(cp, pp); + error = g_access(cp, 1, 0, 0); + if (error != 0) + g_detach(cp); + return (error); } static void -vdev_geom_taste_orphan(struct g_consumer *cp) +vdev_geom_dettach_taster(struct g_consumer *cp) { + g_access(cp, -1, 0, 0); + g_detach(cp); +} - KASSERT(1 == 0, ("%s called while tasting %s.", __func__, - cp->provider->name)); +int +vdev_geom_read_pool_label(const char *name, nvlist_t **config) +{ + struct g_class *mp; + struct g_geom *gp, *zgp; + struct g_provider *pp; + struct g_consumer *zcp; + nvlist_t *vdev_cfg; + uint64_t best_txg; + int error; + + DROP_GIANT(); + g_topology_lock(); + + zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste"); + /* This orphan function should be never called. */ + zgp->orphan = vdev_geom_taste_orphan; + zcp = g_new_consumer(zgp); + + best_txg = 0; + *config = NULL; + LIST_FOREACH(mp, &g_classes, class) { + if (mp == &zfs_vdev_class) + continue; + LIST_FOREACH(gp, &mp->geom, geom) { + if (gp->flags & G_GEOM_WITHER) + continue; + LIST_FOREACH(pp, &gp->provider, provider) { + if (pp->flags & G_PF_WITHER) + continue; + if (vdev_geom_attach_taster(zcp, pp) != 0) + continue; + g_topology_unlock(); + error = vdev_geom_read_config(zcp, &vdev_cfg); + g_topology_lock(); + vdev_geom_dettach_taster(zcp); + if (error) + continue; + ZFS_LOG(1, "successfully read vdev config"); + + error = vdev_geom_check_config(vdev_cfg, name, + &best_txg); + if (error != 0) { + nvlist_free(vdev_cfg); + continue; + } + nvlist_free(*config); + *config = vdev_cfg; + } + } + } + + g_destroy_consumer(zcp); + g_destroy_geom(zgp); + g_topology_unlock(); + PICKUP_GIANT(); + return (*config == NULL ? ENOENT : 0); +} + +static uint64_t +vdev_geom_read_guid(struct g_consumer *cp) +{ + nvlist_t *config; + uint64_t guid; + + g_topology_assert_not(); + + guid = 0; + if (vdev_geom_read_config(cp, &config) == 0) { + guid = nvlist_get_guid(config); + nvlist_free(config); + } + return (guid); } static struct g_consumer * @@ -308,18 +434,12 @@ vdev_geom_attach_by_guid(uint64_t guid) if (gp->flags & G_GEOM_WITHER) continue; LIST_FOREACH(pp, &gp->provider, provider) { - if (pp->flags & G_PF_WITHER) - continue; - g_attach(zcp, pp); - if (g_access(zcp, 1, 0, 0) != 0) { - g_detach(zcp); + if (vdev_geom_attach_taster(zcp, pp) != 0) continue; - } g_topology_unlock(); pguid = vdev_geom_read_guid(zcp); g_topology_lock(); - g_access(zcp, -1, 0, 0); - g_detach(zcp); + vdev_geom_dettach_taster(zcp); if (pguid != guid) continue; cp = vdev_geom_attach(pp); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 12:05:54 2012 (r242553) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 13:29:47 2012 (r242554) @@ -1523,6 +1523,25 @@ out: } #endif /* OPENSOLARIS_MOUNTROOT */ +static int +getpoolname(const char *osname, char *poolname) +{ + char *p; + + p = strchr(osname, '/'); + if (p == NULL) { + if (strlen(osname) >= MAXNAMELEN) + return (ENAMETOOLONG); + (void) strcpy(poolname, osname); + } else { + if (p - osname >= MAXNAMELEN) + return (ENAMETOOLONG); + (void) strncpy(poolname, osname, p - osname); + poolname[p - osname] = '\0'; + } + return (0); +} + /*ARGSUSED*/ static int zfs_mount(vfs_t *vfsp) @@ -1616,6 +1635,29 @@ zfs_mount(vfs_t *vfsp) goto out; } + /* Initial root mount: try hard to import the requested root pool. */ + if ((vfsp->vfs_flag & MNT_ROOTFS) != 0 && + (vfsp->vfs_flag & MNT_UPDATE) == 0) { + char pname[MAXNAMELEN]; + spa_t *spa; + int prefer_cache; + + error = getpoolname(osname, pname); + if (error) + goto out; + + prefer_cache = 1; + TUNABLE_INT_FETCH("vfs.zfs.rootpool.prefer_cached_config", + &prefer_cache); + mutex_enter(&spa_namespace_lock); + spa = spa_lookup(pname); + mutex_exit(&spa_namespace_lock); + if (!prefer_cache || spa == NULL) { + error = spa_import_rootpool(pname); + if (error) + goto out; + } + } DROP_GIANT(); error = zfs_domount(vfsp, osname); PICKUP_GIANT(); From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 13:32:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 01DF647A; Sun, 4 Nov 2012 13:32:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D38118FC08; Sun, 4 Nov 2012 13:32:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DWGwG097907; Sun, 4 Nov 2012 13:32:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DWGEg097904; Sun, 4 Nov 2012 13:32:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041332.qA4DWGEg097904@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242557 - stable/9/sys/boot/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:32:17 -0000 Author: avg Date: Sun Nov 4 13:32:16 2012 New Revision: 242557 URL: http://svn.freebsd.org/changeset/base/242557 Log: MFC r241299: boot/console: handle consoles that fail to probe Modified: stable/9/sys/boot/common/bootstrap.h stable/9/sys/boot/common/console.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/common/bootstrap.h ============================================================================== --- stable/9/sys/boot/common/bootstrap.h Sun Nov 4 13:31:41 2012 (r242556) +++ stable/9/sys/boot/common/bootstrap.h Sun Nov 4 13:32:16 2012 (r242557) @@ -109,10 +109,10 @@ struct console const char *c_name; const char *c_desc; int c_flags; -#define C_PRESENTIN (1<<0) -#define C_PRESENTOUT (1<<1) -#define C_ACTIVEIN (1<<2) -#define C_ACTIVEOUT (1<<3) +#define C_PRESENTIN (1<<0) /* console can provide input */ +#define C_PRESENTOUT (1<<1) /* console can provide output */ +#define C_ACTIVEIN (1<<2) /* user wants input from console */ +#define C_ACTIVEOUT (1<<3) /* user wants output to console */ void (* c_probe)(struct console *cp); /* set c_flags to match hardware */ int (* c_init)(int arg); /* reinit XXX may need more args */ void (* c_out)(int c); /* emit c */ Modified: stable/9/sys/boot/common/console.c ============================================================================== --- stable/9/sys/boot/common/console.c Sun Nov 4 13:31:41 2012 (r242556) +++ stable/9/sys/boot/common/console.c Sun Nov 4 13:32:16 2012 (r242557) @@ -100,11 +100,12 @@ getchar(void) { int cons; int rv; - + /* Loop forever polling all active consoles */ for(;;) for (cons = 0; consoles[cons] != NULL; cons++) - if ((consoles[cons]->c_flags & C_ACTIVEIN) && + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_ACTIVEIN)) == + (C_PRESENTIN | C_ACTIVEIN) && ((rv = consoles[cons]->c_in()) != -1)) return(rv); } @@ -115,7 +116,8 @@ ischar(void) int cons; for (cons = 0; consoles[cons] != NULL; cons++) - if ((consoles[cons]->c_flags & C_ACTIVEIN) && + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_ACTIVEIN)) == + (C_PRESENTIN | C_ACTIVEIN) && (consoles[cons]->c_ready() != 0)) return(1); return(0); @@ -125,13 +127,14 @@ void putchar(int c) { int cons; - + /* Expand newlines */ if (c == '\n') putchar('\r'); - + for (cons = 0; consoles[cons] != NULL; cons++) - if (consoles[cons]->c_flags & C_ACTIVEOUT) + if ((consoles[cons]->c_flags & (C_PRESENTOUT | C_ACTIVEOUT)) == + (C_PRESENTOUT | C_ACTIVEOUT)) consoles[cons]->c_out(c); } @@ -220,6 +223,10 @@ cons_change(const char *string) if (cons >= 0) { consoles[cons]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; consoles[cons]->c_init(0); + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_PRESENTOUT)) != + (C_PRESENTIN | C_PRESENTOUT)) + printf("console %s failed to initialize\n", + consoles[cons]->c_name); } } From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 13:33:59 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8355DA12; Sun, 4 Nov 2012 13:33:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3938FC08; Sun, 4 Nov 2012 13:33:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DXxZi098350; Sun, 4 Nov 2012 13:33:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DXxBY098348; Sun, 4 Nov 2012 13:33:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041333.qA4DXxBY098348@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242561 - stable/9/sys/boot/i386/libi386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:33:59 -0000 Author: avg Date: Sun Nov 4 13:33:59 2012 New Revision: 242561 URL: http://svn.freebsd.org/changeset/base/242561 Log: MFC r241300: i386 comconsole: don't loop forever if hardware doesn't respond Modified: stable/9/sys/boot/i386/libi386/comconsole.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/libi386/comconsole.c ============================================================================== --- stable/9/sys/boot/i386/libi386/comconsole.c Sun Nov 4 13:33:13 2012 (r242560) +++ stable/9/sys/boot/i386/libi386/comconsole.c Sun Nov 4 13:33:59 2012 (r242561) @@ -63,7 +63,6 @@ static void comc_setup(int speed, int po static int comc_speed_set(struct env_var *ev, int flags, const void *value); -static int comc_started; static int comc_curspeed; static int comc_port = COMPORT; static uint32_t comc_locator; @@ -87,9 +86,6 @@ comc_probe(struct console *cp) int speed, port; uint32_t locator; - /* XXX check the BIOS equipment list? */ - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); - if (comc_curspeed == 0) { comc_curspeed = COMSPEED; /* @@ -137,18 +133,19 @@ comc_probe(struct console *cp) env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set, env_nounset); } + comc_setup(comc_curspeed, comc_port); } static int comc_init(int arg) { - if (comc_started && arg == 0) - return 0; - comc_started = 1; comc_setup(comc_curspeed, comc_port); - return(0); + if ((comconsole.c_flags & (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) + return (CMD_OK); + return (CMD_ERROR); } static void @@ -166,13 +163,13 @@ comc_putchar(int c) static int comc_getchar(void) { - return(comc_ischar() ? inb(comc_port + com_data) : -1); + return (comc_ischar() ? inb(comc_port + com_data) : -1); } static int comc_ischar(void) { - return(inb(comc_port + com_lsr) & LSR_RXRDY); + return (inb(comc_port + com_lsr) & LSR_RXRDY); } static int @@ -185,7 +182,8 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } - if (comc_started && comc_curspeed != speed) + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -203,7 +201,8 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } - if (comc_started && comc_port != port) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_port != port) { comc_setup(comc_curspeed, port); set_hw_console_hint(); } @@ -305,7 +304,8 @@ comc_pcidev_set(struct env_var *ev, int printf("Invalid pcidev\n"); return (CMD_ERROR); } - if (comc_started && comc_locator != locator) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_locator != locator) { error = comc_pcidev_handle(locator); if (error != CMD_OK) return (error); @@ -317,6 +317,8 @@ comc_pcidev_set(struct env_var *ev, int static void comc_setup(int speed, int port) { + static int TRY_COUNT = 1000000; + int tries; comc_curspeed = speed; comc_port = port; @@ -327,9 +329,15 @@ comc_setup(int speed, int port) outb(comc_port + com_cfcr, COMC_FMT); outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); + tries = 0; do inb(comc_port + com_data); - while (inb(comc_port + com_lsr) & LSR_RXRDY); + while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); + + if (tries < TRY_COUNT) + comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); + else + comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); } static int From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 13:37:34 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A905C63; Sun, 4 Nov 2012 13:37:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4B448FC0A; Sun, 4 Nov 2012 13:37:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DbX5q098959; Sun, 4 Nov 2012 13:37:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DbXS4098952; Sun, 4 Nov 2012 13:37:33 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041337.qA4DbXS4098952@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242562 - in stable/9/sys/boot/i386: boot2 btx/btx gptboot zfsboot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:37:34 -0000 Author: avg Date: Sun Nov 4 13:37:33 2012 New Revision: 242562 URL: http://svn.freebsd.org/changeset/base/242562 Log: MFC r241301: add detection of serial console presence to btx and boot2-like blocks Modified: stable/9/sys/boot/i386/boot2/boot2.c stable/9/sys/boot/i386/boot2/lib.h stable/9/sys/boot/i386/boot2/sio.S stable/9/sys/boot/i386/btx/btx/btx.S stable/9/sys/boot/i386/gptboot/gptboot.c stable/9/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/i386/boot2/boot2.c Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/boot2/boot2.c Sun Nov 4 13:37:33 2012 (r242562) @@ -416,8 +416,10 @@ parse() } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) - sio_init(115200 / comspeed); + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } } else { for (q = arg--; *q && *q != '('; q++); if (*q) { Modified: stable/9/sys/boot/i386/boot2/lib.h ============================================================================== --- stable/9/sys/boot/i386/boot2/lib.h Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/boot2/lib.h Sun Nov 4 13:37:33 2012 (r242562) @@ -17,8 +17,8 @@ * $FreeBSD$ */ -void sio_init(int) __attribute__((regparm (3))); -void sio_flush(void); +int sio_init(int) __attribute__((regparm (3))); +int sio_flush(void); void sio_putc(int) __attribute__((regparm (3))); int sio_getc(void); int sio_ischar(void); Modified: stable/9/sys/boot/i386/boot2/sio.S ============================================================================== --- stable/9/sys/boot/i386/boot2/sio.S Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/boot2/sio.S Sun Nov 4 13:37:33 2012 (r242562) @@ -24,7 +24,7 @@ .globl sio_getc .globl sio_ischar -/* void sio_init(int div) */ +/* int sio_init(int div) */ sio_init: pushl %eax movw $SIO_PRT+0x3,%dx # Data format reg @@ -43,12 +43,16 @@ sio_init: pushl %eax call sio_flush ret -/* void sio_flush(void) */ +/* int sio_flush(void) */ -sio_flush.0: call sio_getc.1 # Get character -sio_flush: call sio_ischar # Check for character - jnz sio_flush.0 # Till none - ret # To caller +sio_flush: xorl %eax,%eax # Return value + xorl %ecx,%ecx # Timeout + movb $0x80,%ch # counter +sio_flush.1: call sio_ischar # Check for character + jz sio_flush.2 # Till none + loop sio_flush.1 # or counter is zero + movb $1, %al # Exhausted all tries +sio_flush.2: ret # To caller /* void sio_putc(int c) */ Modified: stable/9/sys/boot/i386/btx/btx/btx.S ============================================================================== --- stable/9/sys/boot/i386/btx/btx/btx.S Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/btx/btx/btx.S Sun Nov 4 13:37:33 2012 (r242562) @@ -812,7 +812,7 @@ putstr: lodsb # Load char .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD /* - * void sio_init(void) + * int sio_init(void) */ sio_init: movw $SIO_PRT+0x3,%dx # Data format reg movb $SIO_FMT|0x80,%al # Set format @@ -828,14 +828,19 @@ sio_init: movw $SIO_PRT+0x3,%dx # Data movb $0x3,%al # Set RTS, outb %al,(%dx) # DTR incl %edx # Line status reg + call sio_getc.1 # Get character /* - * void sio_flush(void) + * int sio_flush(void) */ -sio_flush.0: call sio_getc.1 # Get character -sio_flush: call sio_ischar # Check for character - jnz sio_flush.0 # Till none - ret # To caller +sio_flush: xorl %eax,%eax # Return value + xorl %ecx,%ecx # Timeout + movb $0x80,%ch # counter +sio_flush.1: call sio_ischar # Check for character + jz sio_flush.2 # Till none + loop sio_flush.1 # or counter is zero + movb $1, %al # Exhausted all tries +sio_flush.2: ret # To caller /* * void sio_putc(int c) Modified: stable/9/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/9/sys/boot/i386/gptboot/gptboot.c Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/gptboot/gptboot.c Sun Nov 4 13:37:33 2012 (r242562) @@ -380,8 +380,10 @@ parse(char *cmdstr, int *dskupdated) } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) - sio_init(115200 / comspeed); + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } } else { for (q = arg--; *q && *q != '('; q++); if (*q) { Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/9/sys/boot/i386/zfsboot/zfsboot.c Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/zfsboot/zfsboot.c Sun Nov 4 13:37:33 2012 (r242562) @@ -785,8 +785,10 @@ parse(void) } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) - sio_init(115200 / comspeed); + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } } if (c == '?') { dnode_phys_t dn; From owner-svn-src-stable-9@FreeBSD.ORG Sun Nov 4 13:42:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 99E09E06; Sun, 4 Nov 2012 13:42:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C09D8FC14; Sun, 4 Nov 2012 13:42:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DgJHv099798; Sun, 4 Nov 2012 13:42:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DgJ2t099796; Sun, 4 Nov 2012 13:42:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041342.qA4DgJ2t099796@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242563 - stable/9/sys/dev/acpica X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:42:19 -0000 Author: avg Date: Sun Nov 4 13:42:19 2012 New Revision: 242563 URL: http://svn.freebsd.org/changeset/base/242563 Log: MFC r241538: acpi_thermal: when _ACx is tripped, all _ALi i>= x should be on Modified: stable/9/sys/dev/acpica/acpi_thermal.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_thermal.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_thermal.c Sun Nov 4 13:37:33 2012 (r242562) +++ stable/9/sys/dev/acpica/acpi_thermal.c Sun Nov 4 13:42:19 2012 (r242563) @@ -121,6 +121,8 @@ struct acpi_tz_softc { int tz_cooling_saved_freq; }; +#define TZ_ACTIVE_LEVEL(act) ((act) >= 0 ? (act) : TZ_NUMLEVELS) + #define CPUFREQ_MAX_LEVELS 64 /* XXX cpufreq should export this */ static int acpi_tz_probe(device_t dev); @@ -565,18 +567,21 @@ acpi_tz_monitor(void *Context) } if (newactive != sc->tz_active) { - /* Turn off the cooling devices that are on, if any are */ - if (sc->tz_active != TZ_ACTIVE_NONE) + /* Turn off unneeded cooling devices that are on, if any are */ + for (i = TZ_ACTIVE_LEVEL(sc->tz_active); + i < TZ_ACTIVE_LEVEL(newactive); i++) { acpi_ForeachPackageObject( - (ACPI_OBJECT *)sc->tz_zone.al[sc->tz_active].Pointer, + (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, acpi_tz_switch_cooler_off, sc); - + } /* Turn on cooling devices that are required, if any are */ - if (newactive != TZ_ACTIVE_NONE) { + for (i = TZ_ACTIVE_LEVEL(sc->tz_active) - 1; + i >= TZ_ACTIVE_LEVEL(newactive); i--) { acpi_ForeachPackageObject( - (ACPI_OBJECT *)sc->tz_zone.al[newactive].Pointer, + (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, acpi_tz_switch_cooler_on, sc); } + ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), "switched from %s to %s: %d.%dC\n", acpi_tz_aclevel_string(sc->tz_active), From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 5 01:05:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 047EA3CC; Mon, 5 Nov 2012 01:05:15 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D94048FC0A; Mon, 5 Nov 2012 01:05:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA515E5j093539; Mon, 5 Nov 2012 01:05:14 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA515E2d093530; Mon, 5 Nov 2012 01:05:14 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201211050105.qA515E2d093530@svn.freebsd.org> From: Sean Bruno Date: Mon, 5 Nov 2012 01:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242594 - in stable/9: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 01:05:15 -0000 Author: sbruno Date: Mon Nov 5 01:05:14 2012 New Revision: 242594 URL: http://svnweb.freebsd.org/changeset/base/242594 Log: MFC r241745,241738,241741 Update hwpmc to support the Xeon class of Sandybridge processors. (Model 0x2D /* Per Intel document 253669-044US 08/2012. */) Update man page crossreferences to sandybridge xeon class Remove trailing whitespace. Added: stable/9/lib/libpmc/pmc.sandybridgexeon.3 - copied, changed from r241738, head/lib/libpmc/pmc.sandybridgexeon.3 Modified: stable/9/lib/libpmc/Makefile stable/9/lib/libpmc/libpmc.c stable/9/lib/libpmc/pmc.ivybridge.3 stable/9/lib/libpmc/pmc.sandybridge.3 stable/9/lib/libpmc/pmc.sandybridgeuc.3 stable/9/sys/dev/hwpmc/hwpmc_core.c stable/9/sys/dev/hwpmc/hwpmc_intel.c stable/9/sys/dev/hwpmc/pmc_events.h stable/9/sys/sys/pmc.h Directory Properties: stable/9/lib/libpmc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/lib/libpmc/Makefile ============================================================================== --- stable/9/lib/libpmc/Makefile Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/Makefile Mon Nov 5 01:05:14 2012 (r242594) @@ -39,6 +39,7 @@ MAN+= pmc.corei7.3 MAN+= pmc.corei7uc.3 MAN+= pmc.sandybridge.3 MAN+= pmc.sandybridgeuc.3 +MAN+= pmc.sandybridgexeon.3 MAN+= pmc.westmere.3 MAN+= pmc.westmereuc.3 MAN+= pmc.tsc.3 Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/libpmc.c Mon Nov 5 01:05:14 2012 (r242594) @@ -192,6 +192,11 @@ static const struct pmc_event_descr sand __PMC_EV_ALIAS_SANDYBRIDGE() }; +static const struct pmc_event_descr sandybridge_xeon_event_table[] = +{ + __PMC_EV_ALIAS_SANDYBRIDGE_XEON() +}; + static const struct pmc_event_descr westmere_event_table[] = { __PMC_EV_ALIAS_WESTMERE() @@ -228,6 +233,7 @@ PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOF PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); @@ -265,6 +271,7 @@ PMC_CLASS_TABLE_DESC(core2, IAP, core2, PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); +PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp); @@ -569,6 +576,8 @@ static struct pmc_event_alias core2_alia #define ivybridge_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_aliases core2_aliases #define sandybridge_aliases_without_iaf core2_aliases_without_iaf +#define sandybridge_xeon_aliases core2_aliases +#define sandybridge_xeon_aliases_without_iaf core2_aliases_without_iaf #define westmere_aliases core2_aliases #define westmere_aliases_without_iaf core2_aliases_without_iaf @@ -688,7 +697,7 @@ static struct pmc_masks iap_rsp_mask_i7_ NULLMASK }; -static struct pmc_masks iap_rsp_mask_sb_ib[] = { +static struct pmc_masks iap_rsp_mask_sb_sbx_ib[] = { PMCMASK(REQ_DMND_DATA_RD, (1ULL << 0)), PMCMASK(REQ_DMND_RFO, (1ULL << 1)), PMCMASK(REQ_DMND_IFETCH, (1ULL << 2)), @@ -794,9 +803,10 @@ iap_allocate_pmc(enum pmc_event pe, char } else return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || - cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { + cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { - n = pmc_parse_mask(iap_rsp_mask_sb_ib, p, &rsp); + n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else return (-1); } else @@ -2667,6 +2677,10 @@ pmc_event_names_of_class(enum pmc_class ev = sandybridge_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridge); break; + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + ev = sandybridge_xeon_event_table; + count = PMC_EVENT_TABLE_SIZE(sandybridge_xeon); + break; case PMC_CPU_INTEL_WESTMERE: ev = westmere_event_table; count = PMC_EVENT_TABLE_SIZE(westmere); @@ -2959,6 +2973,9 @@ pmc_init(void) pmc_class_table[n++] = &sandybridgeuc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(sandybridge); break; + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + PMC_MDEP_INIT_INTEL_V2(sandybridge_xeon); + break; case PMC_CPU_INTEL_WESTMERE: pmc_class_table[n++] = &ucf_class_table_descr; pmc_class_table[n++] = &westmereuc_class_table_descr; @@ -3093,6 +3110,10 @@ _pmc_name_of_event(enum pmc_event pe, en ev = sandybridge_event_table; evfence = sandybridge_event_table + PMC_EVENT_TABLE_SIZE(sandybridge); break; + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + ev = sandybridge_xeon_event_table; + evfence = sandybridge_xeon_event_table + PMC_EVENT_TABLE_SIZE(sandybridge_xeon); + break; case PMC_CPU_INTEL_WESTMERE: ev = westmere_event_table; evfence = westmere_event_table + PMC_EVENT_TABLE_SIZE(westmere); Modified: stable/9/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.ivybridge.3 Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/pmc.ivybridge.3 Mon Nov 5 01:05:14 2012 (r242594) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2012 +.Dd October 19, 2012 .Dt PMC.IVYBRIDGE 3 .Os .Sh NAME @@ -856,6 +856,7 @@ Dirty L2 cache lines evicted by the MLC .Xr pmc.corei7uc 3 , .Xr pmc.sandybridge 3 , .Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , .Xr pmc.westmere 3 , .Xr pmc.westmereuc 3 , .Xr pmc.soft 3 , Modified: stable/9/lib/libpmc/pmc.sandybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.sandybridge.3 Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/pmc.sandybridge.3 Mon Nov 5 01:05:14 2012 (r242594) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2012 +.Dd October 19, 2012 .Dt PMC.SANDYBRIDGE 3 .Os .Sh NAME @@ -932,6 +932,7 @@ Split locks in SQ. .Xr pmc.p5 3 , .Xr pmc.p6 3 , .Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , .Xr pmc.soft 3 , .Xr pmc.tsc 3 , .Xr pmc.ucf 3 , Modified: stable/9/lib/libpmc/pmc.sandybridgeuc.3 ============================================================================== --- stable/9/lib/libpmc/pmc.sandybridgeuc.3 Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/pmc.sandybridgeuc.3 Mon Nov 5 01:05:14 2012 (r242594) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2012 +.Dd October 19, 2012 .Dt PMC.SANDYBRIDGEUC 3 .Os .Sh NAME @@ -208,6 +208,7 @@ Counts the number of core-outgoing entri .Xr pmc.p5 3 , .Xr pmc.p6 3 , .Xr pmc.sandybridge 3 , +.Xr pmc.sandybridgexeon 3 , .Xr pmc.soft 3 , .Xr pmc.tsc 3 , .Xr pmc.ucf 3 , Copied and modified: stable/9/lib/libpmc/pmc.sandybridgexeon.3 (from r241738, head/lib/libpmc/pmc.sandybridgexeon.3) ============================================================================== --- head/lib/libpmc/pmc.sandybridgexeon.3 Fri Oct 19 17:01:27 2012 (r241738, copy source) +++ stable/9/lib/libpmc/pmc.sandybridgexeon.3 Mon Nov 5 01:05:14 2012 (r242594) @@ -442,147 +442,147 @@ Set Cmask = 1 to count cycles. .It Li PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW .Pq Event 59H , Umask 0FH Cycles with at least one slow LEA uop allocated. -.It Li PARTIAL_RAT_STALLS.MUL_SINGLE_UOP +.It Li PARTIAL_RAT_STALLS.MUL_SINGLE_UOP .Pq Event 59H , Umask 40H Number of Multiply packed/scalar single precision uops allocated. -.It Li RESOURCE_STALLS2.ALL_FL_EMPTY +.It Li RESOURCE_STALLS2.ALL_FL_EMPTY .Pq Event 5BH , Umask 0CH -Cycles stalled due to free list empty. -.It Li RESOURCE_STALLS2.ALL_PRF_CONTROL +Cycles stalled due to free list empty. +.It Li RESOURCE_STALLS2.ALL_PRF_CONTROL .Pq Event 5BH , Umask 0FH Cycles stalled due to control structures full for physical registers. -.It Li RESOURCE_STALLS2.BOB_FULL +.It Li RESOURCE_STALLS2.BOB_FULL .Pq Event 5BH , Umask 40H -Cycles Allocator is stalled due Branch Order Buffer. -.It Li RESOURCE_STALLS2.OOO_RSRC +Cycles Allocator is stalled due Branch Order Buffer. +.It Li RESOURCE_STALLS2.OOO_RSRC .Pq Event 5BH , Umask 4FH -Cycles stalled due to out of order resources full. -.It Li CPL_CYCLES.RING0 +Cycles stalled due to out of order resources full. +.It Li CPL_CYCLES.RING0 .Pq Event 5CH , Umask 01H -Unhalted core cycles when the thread is in ring 0. -.It Li CPL_CYCLES.RING123 +Unhalted core cycles when the thread is in ring 0. +.It Li CPL_CYCLES.RING123 .Pq Event 5CH , Umask 02H Unhalted core cycles when the thread is not in ring 0. .It Li RS_EVENTS.EMPTY_CYCLES .Pq Event 5EH , Umask 01H -Cycles the RS is empty for the thread. -.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +Cycles the RS is empty for the thread. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD .Pq Event 60H , Umask 01H Offcore outstanding Demand Data Read transactions in SQ to uncore. Set Cmask=1 to count cycles. -.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO .Pq Event 60H , Umask 04H Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to count cycles. -.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD .Pq Event 60H , Umask 08H Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles. -.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION .Pq Event 63H , Umask 01H Cycles in which the L1D and L2 are locked, due to a UC lock or split lock. -.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION .Pq Event 63H , Umask 02H -Cycles in which the L1D is locked. -.It Li IDQ.EMPTY +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY .Pq Event 79H , Umask 02H Counts cycles the IDQ is empty. -.It Li IDQ.MITE_UOPS +.It Li IDQ.MITE_UOPS .Pq Event 79H , Umask 04H Increment each cycle # of uops delivered to IDQ from MITE path. Set Cmask = 1 to count cycles. -.It Li IDQ.DSB_UOPS +.It Li IDQ.DSB_UOPS .Pq Event 79H , Umask 08H Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles. -.It Li IDQ.MS_DSB_UOPS +.It Li IDQ.MS_DSB_UOPS .Pq Event 79H , Umask 10H Increment each cycle # of uops delivered to IDQ when MS busy by DSB. Set Cmask = 1 to count cycles MS is busy. Set Cmask=1 and Edge =1 to count MS activations. -.It Li IDQ.MS_MITE_UOPS +.It Li IDQ.MS_MITE_UOPS .Pq Event 79H , Umask 20H Increment each cycle # of uops delivered to IDQ when MS is busy by MITE. Set Cmask = 1 to count cycles. -.It Li IDQ.MS_UOPS +.It Li IDQ.MS_UOPS .Pq Event 79H , Umask 30H Increment each cycle # of uops delivered to IDQ from MS by either DSB or MITE. Set Cmask = 1 to count cycles. -.It Li ICACHE.MISSES +.It Li ICACHE.MISSES .Pq Event 80H , Umask 02H Number of Instruction Cache, Streaming Buffer and Victim Cache Misses. Includes UC accesses. -.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK .Pq Event 85H , Umask 01H -Misses in all ITLB levels that cause page walks. -.It Li ITLB_MISSES.WALK_COMPLETED +Misses in all ITLB levels that cause page walks. +.It Li ITLB_MISSES.WALK_COMPLETED .Pq Event 85H , Umask 02H Misses in all ITLB levels that cause completed page walks. -.It Li ITLB_MISSES.WALK_DURATION +.It Li ITLB_MISSES.WALK_DURATION .Pq Event 85H , Umask 04H -Cycle PMH is busy with a walk. -.It Li ITLB_MISSES.STLB_HIT +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT .Pq Event 85H , Umask 10H -Number of cache load STLB hits. No page walk. -.It Li ILD_STALL.LCP +Number of cache load STLB hits. No page walk. +.It Li ILD_STALL.LCP .Pq Event 87H , Umask 01H Stalls caused by changing prefix length of the instruction. -.It Li ILD_STALL.IQ_FULL +.It Li ILD_STALL.IQ_FULL .Pq Event 87H , Umask 04H -Stall cycles due to IQ is full. +Stall cycles due to IQ is full. .It Li BR_INST_EXEC.COND .Pq Event 88H , Umask 01H Qualify conditional near branch instructions executed, but not necessarily retired. -.It Li BR_INST_EXEC.DIRECT_JMP +.It Li BR_INST_EXEC.DIRECT_JMP .Pq Event 88H , Umask 02H Qualify all unconditional near branch instructions excluding calls and indirect branches. -.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET .Pq Event 88H , Umask 04H Qualify executed indirect near branch instructions that are not calls nor returns. -.It Li BR_INST_EXEC.RETURN_NEAR +.It Li BR_INST_EXEC.RETURN_NEAR .Pq Event 88H , Umask 08H Qualify indirect near branches that have a return mnemonic. -.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL .Pq Event 88H , Umask 10H Qualify unconditional near call branch instructions, excluding non call branch, executed. -.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL .Pq Event 88H , Umask 20H Qualify indirect near calls, including both register and memory indirect, executed. -.It Li BR_INST_EXEC.NONTAKEN +.It Li BR_INST_EXEC.NONTAKEN .Pq Event 88H , Umask 40H -Qualify non-taken near branches executed. -.It Li BR_INST_EXEC.TAKEN +Qualify non-taken near branches executed. +.It Li BR_INST_EXEC.TAKEN .Pq Event 88H , Umask 80H Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H, 10H, 20H. -.It Li BR_INST_EXE.ALL_BRANCHES +.It Li BR_INST_EXE.ALL_BRANCHES .Pq Event 88H , Umask FFH Counts all near executed branches (not necessarily retired). -.It Li BR_MISP_EXEC.COND +.It Li BR_MISP_EXEC.COND .Pq Event 89H , Umask 01H Qualify conditional near branch instructions mispredicted. -.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET .Pq Event 89H , Umask 04H Qualify mispredicted indirect near branch instructions that are not calls nor returns. @@ -590,144 +590,144 @@ instructions that are not calls nor retu .Pq Event 89H , Umask 08H Qualify mispredicted indirect near branches that have a return mnemonic. -.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL .Pq Event 89H , Umask 10H Qualify mispredicted unconditional near call branch instructions, excluding non call branch, executed. -.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL .Pq Event 89H , Umask 20H Qualify mispredicted indirect near calls, including both register and memory indirect, executed. -.It Li BR_MISP_EXEC.NONTAKEN +.It Li BR_MISP_EXEC.NONTAKEN .Pq Event 89H , Umask 40H Qualify mispredicted non-taken near branches executed,. -.It Li BR_MISP_EXEC.TAKEN +.It Li BR_MISP_EXEC.TAKEN .Pq Event 89H , Umask 80H Qualify mispredicted taken near branches executed. Must combine with 01H,02H, 04H, 08H, 10H, 20H -.It Li BR_MISP_EXEC.ALL_BRANCHES +.It Li BR_MISP_EXEC.ALL_BRANCHES .Pq Event 89H , Umask FFH Counts all near executed branches (not necessarily retired). -.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.It Li IDQ_UOPS_NOT_DELIVERED.CORE .Pq Event 9CH , Umask 01H Count number of non-delivered uops to RAT per thread. -.It Li UOPS_DISPATCHED_PORT.PORT_0 +.It Li UOPS_DISPATCHED_PORT.PORT_0 .Pq Event A1H , Umask 01H -Cycles which a Uop is dispatched on port 0. +Cycles which a Uop is dispatched on port 0. .It Li UOPS_DISPATCHED_PORT.PORT_1 .Pq Event A1H , Umask 02H -Cycles which a Uop is dispatched on port 1. -.It Li UOPS_DISPATCHED_PORT.PORT_2_LD +Cycles which a Uop is dispatched on port 1. +.It Li UOPS_DISPATCHED_PORT.PORT_2_LD .Pq Event A1H , Umask 04H -Cycles which a load uop is dispatched on port 2. -.It Li UOPS_DISPATCHED_PORT.PORT_2_STA +Cycles which a load uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2_STA .Pq Event A1H , Umask 08H Cycles which a store address uop is dispatched on port 2. -.It Li UOPS_DISPATCHED_PORT.PORT_2 +.It Li UOPS_DISPATCHED_PORT.PORT_2 .Pq Event A1H , Umask 0CH -Cycles which a Uop is dispatched on port 2. -.It Li UOPS_DISPATCHED_PORT.PORT_3_LD +Cycles which a Uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_3_LD .Pq Event A1H , Umask 10H -Cycles which a load uop is dispatched on port 3. -.It Li UOPS_DISPATCHED_PORT.PORT_3_STA +Cycles which a load uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3_STA .Pq Event A1H , Umask 20H Cycles which a store address uop is dispatched on port 3. -.It Li UOPS_DISPATCHED_PORT.PORT_3 +.It Li UOPS_DISPATCHED_PORT.PORT_3 .Pq Event A1H , Umask 30H -Cycles which a Uop is dispatched on port 3. +Cycles which a Uop is dispatched on port 3. .It Li UOPS_DISPATCHED_PORT.PORT_4 .Pq Event A1H , Umask 40H Cycles which a Uop is dispatched on port 4. -.It Li UOPS_DISPATCHED_PORT.PORT_5 +.It Li UOPS_DISPATCHED_PORT.PORT_5 .Pq Event A1H , Umask 80H -Cycles which a Uop is dispatched on port 5. -.It Li RESOURCE_STALLS.ANY +Cycles which a Uop is dispatched on port 5. +.It Li RESOURCE_STALLS.ANY .Pq Event A2H , Umask 01H Cycles Allocation is stalled due to Resource Related reason. -.It Li RESOURCE_STALLS.LB +.It Li RESOURCE_STALLS.LB .Pq Event A2H , Umask 01H -Counts the cycles of stall due to lack of load buffers. -.It Li RESOURCE_STALLS.RS +Counts the cycles of stall due to lack of load buffers. +.It Li RESOURCE_STALLS.RS .Pq Event A2H , Umask 04H -Cycles stalled due to no eligible RS entry available. -.It Li RESOURCE_STALLS.SB +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB .Pq Event A2H , Umask 08H Cycles stalled due to no store buffers available. (not including draining form sync). -.It Li RESOURCE_STALLS.ROB +.It Li RESOURCE_STALLS.ROB .Pq Event A2H , Umask 10H -Cycles stalled due to re-order buffer full. -.It Li RESOURCE_STALLS.FCSW +Cycles stalled due to re-order buffer full. +.It Li RESOURCE_STALLS.FCSW .Pq Event A2H , Umask 20H -Cycles stalled due to writing the FPU control word. -.It Li RESOURCE_STALLS.MXCSR +Cycles stalled due to writing the FPU control word. +.It Li RESOURCE_STALLS.MXCSR .Pq Event A2H , Umask 40H Cycles stalled due to the MXCSR register rename occurring to close to a previous MXCSR rename. -.It Li RESOURCE_STALLS.OTHER +.It Li RESOURCE_STALLS.OTHER .Pq Event A2H , Umask 80H Cycles stalled while execution was stalled due to other resource issues. -.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING .Pq Event A3H , Umask 01H Cycles with pending L2 miss loads. Set AnyThread to count per core. -.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING .Pq Event A3H , Umask 02H Cycles with pending L1 cache miss loads.Set AnyThread to count per core. -.It Li CYCLE_ACTIVITY.CYCLES_NO_DISPATCH +.It Li CYCLE_ACTIVITY.CYCLES_NO_DISPATCH .Pq Event A3H , Umask 04H -Cycles of dispatch stalls. Set AnyThread to count per +Cycles of dispatch stalls. Set AnyThread to count per core. -.It Li DSB2MITE_SWITCHES.COUNT +.It Li DSB2MITE_SWITCHES.COUNT .Pq Event ABH , Umask 01H -Number of DSB to MITE switches. -.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES +Number of DSB to MITE switches. +.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES .Pq Event ABH , Umask 02H -Cycles DSB to MITE switches caused delay. -.It Li DSB_FILL.OTHER_CANCEL +Cycles DSB to MITE switches caused delay. +.It Li DSB_FILL.OTHER_CANCEL .Pq Event ACH , Umask 02H Cases of cancelling valid DSB fill not because of exceeding way limit. -.It Li DSB_FILL.EXCEED_DSB_LINES +.It Li DSB_FILL.EXCEED_DSB_LINES .Pq Event ACH , Umask 08H -DSB Fill encountered > 3 DSB lines. -.It Li DSB_FILL.ALL_CANCEL +DSB Fill encountered > 3 DSB lines. +.It Li DSB_FILL.ALL_CANCEL .Pq Event ACH , Umask 0AH Cases of cancelling valid Decode Stream Buffer (DSB) fill not because of exceeding way limit. -.It Li ITLB.ITLB_FLUSH +.It Li ITLB.ITLB_FLUSH .Pq Event AEH , Umask 01H Counts the number of ITLB flushes, includes 4k/2M/4M pages. -.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD .Pq Event B0H , Umask 01H Demand data read requests sent to uncore. -.It Li OFFCORE_REQUESTS.DEMAND_RFO +.It Li OFFCORE_REQUESTS.DEMAND_RFO .Pq Event B0H , Umask 04H Demand RFO read requests sent to uncore, including regular RFOs, locks, ItoM. -.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.It Li OFFCORE_REQUESTS.ALL_DATA_RD .Pq Event B0H , Umask 08H Data read requests sent to uncore (demand and prefetch). -.It Li UOPS_DISPATCHED.THREAD +.It Li UOPS_DISPATCHED.THREAD .Pq Event B1H , Umask 01H Counts total number of uops to be dispatched per- thread each cycle. Set Cmask = 1, INV =1 to count stall cycles. -.It Li UOPS_DISPATCHED.CORE +.It Li UOPS_DISPATCHED.CORE .Pq Event B1H , Umask 02H Counts total number of uops to be dispatched per- core each cycle. -.It Li OFFCORE_REQUESTS_BUFFER.SQ_FULL +.It Li OFFCORE_REQUESTS_BUFFER.SQ_FULL .Pq Event B2H , Umask 01H Offcore requests buffer cannot take more entries for this thread core. @@ -738,47 +738,47 @@ following traits: 1. addressing of the f offset], 2. the offset is between 1 and 2047, 3. the address specified in the base register is in one page and the address [base+offset] is in another page. -.It Li OFF_CORE_RESPONSE_0 +.It Li OFF_CORE_RESPONSE_0 .Pq Event B7H , Umask 01H (Event B7H, Umask 01H) Off-core Response Performance Monitoring; PMC0 only. Requires programming MSR 01A6H -.It Li OFF_CORE_RESPONSE_1 +.It Li OFF_CORE_RESPONSE_1 .Pq Event BBH , Umask 01H (Event BBH, Umask 01H) Off-core Response Performance Monitoring; PMC3 only. Requires programming MSR 01A7H -.It Li TLB_FLUSH.DTLB_THREAD +.It Li TLB_FLUSH.DTLB_THREAD .Pq Event BDH , Umask 01H -DTLB flush attempts of the thread-specific entries. -.It Li TLB_FLUSH.STLB_ANY +DTLB flush attempts of the thread-specific entries. +.It Li TLB_FLUSH.STLB_ANY .Pq Event BDH , Umask 20H -Count number of STLB flush attempts. -.It Li L1D_BLOCKS.BANK_CONFLICT_CYCLES +Count number of STLB flush attempts. +.It Li L1D_BLOCKS.BANK_CONFLICT_CYCLES .Pq Event BFH , Umask 05H Cycles when dispatched loads are cancelled due to L1D bank conflicts with other load ports. -.It Li INST_RETIRED.ANY_P +.It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H -Number of instructions at retirement. -.It Li INST_RETIRED.ALL +Number of instructions at retirement. +.It Li INST_RETIRED.ALL .Pq Event C0H , Umask 01H Precise instruction retired event with HW to reduce effect of PEBS shadow in IP distribution. .It Li OTHER_ASSISTS.ITLB_MISS_RETIRED .Pq Event C1H , Umask 02H -Instructions that experienced an ITLB miss. -.It Li OTHER_ASSISTS.AVX_STORE +Instructions that experienced an ITLB miss. +.It Li OTHER_ASSISTS.AVX_STORE .Pq Event C1H , Umask 08H Number of assists associated with 256-bit AVX store operations. -.It Li OTHER_ASSISTS.AVX_TO_SSE +.It Li OTHER_ASSISTS.AVX_TO_SSE .Pq Event C1H , Umask 10H Number of transitions from AVX-256 to legacy SSE when penalty applicable. -.It Li OTHER_ASSISTS.SSE_TO_AVX +.It Li OTHER_ASSISTS.SSE_TO_AVX .Pq Event C1H , Umask 20H Number of transitions from SSE to AVX-256 when penalty applicable. -.It Li UOPS_RETIRED.ALL +.It Li UOPS_RETIRED.ALL .Pq Event C2H , Umask 01H Counts the number of micro-ops retired, Use cmask=1 and invert to count active cycles or stalled @@ -787,7 +787,7 @@ cycles. .Pq Event C2H , Umask 02H Counts the number of retirement slots used each cycle. -.It Li MACHINE_CLEARS.MEMORY_ORDERING +.It Li MACHINE_CLEARS.MEMORY_ORDERING .Pq Event C3H , Umask 02H Counts the number of machine clears due to memory order conflicts. @@ -795,25 +795,25 @@ memory order conflicts. .Pq Event C3H , Umask 04H Counts the number of times that a program writes to a code section. -.It Li MACHINE_CLEARS.MASKMOV +.It Li MACHINE_CLEARS.MASKMOV .Pq Event C3H , Umask 20H Counts the number of executed AVX masked load operations that refer to an illegal address range with the mask bits set to 0. -.It Li BR_INST_RETIRED.ALL_BRANCH +.It Li BR_INST_RETIRED.ALL_BRANCH .Pq Event C4H , Umask 00H -Branch instructions at retirement. -.It Li BR_INST_RETIRED.CONDITIONAL +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL .Pq Event C4H , Umask 01H Counts the number of conditional branch instructions retired. -.It Li BR_INST_RETIRED.NEAR_CALL +.It Li BR_INST_RETIRED.NEAR_CALL .Pq Event C4H , Umask 02H -Direct and indirect near call instructions retired. -.It Li BR_INST_RETIRED.ALL_BRANCHES +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES .Pq Event C4H , Umask 04H -Counts the number of branch instructions retired. -.It Li BR_INST_RETIRED.NEAR_RETURN +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN .Pq Event C4H , Umask 08H Counts the number of near return instructions retired. @@ -823,16 +823,16 @@ Counts the number of not taken branch in retired. .It Li BR_INST_RETIRED.NEAR_TAKEN .Pq Event C4H , Umask 20H -Number of near taken branches retired. +Number of near taken branches retired. .It Li BR_INST_RETIRED.FAR_BRANCH .Pq Event C4H , Umask 40H -Number of far branches retired. +Number of far branches retired. .It Li BR_MISP_RETIRED.ALL_BRANCHES .Pq Event C5H , Umask 00H -Mispredicted branch instructions at retirement. +Mispredicted branch instructions at retirement. .It Li BR_MISP_RETIRED.CONDITIONAL .Pq Event C5H , Umask 01H -Mispredicted conditional branch instructions retired. +Mispredicted conditional branch instructions retired. .It Li BR_MISP_RETIRED.NEAR_CALL .Pq Event C5H , Umask 02H Direct and indirect mispredicted near call @@ -842,25 +842,25 @@ instructions retired. Mispredicted macro branch instructions retired. .It Li BR_MISP_RETIRED.NOT_TAKEN .Pq Event C5H , Umask 10H -Mispredicted not taken branch instructions retired. +Mispredicted not taken branch instructions retired. .It Li BR_MISP_RETIRED.TAKEN .Pq Event C5H , Umask 20H -Mispredicted taken branch instructions retired. +Mispredicted taken branch instructions retired. .It Li FP_ASSIST.X87_OUTPUT .Pq Event CAH , Umask 02H -Number of X87 assists due to output value. +Number of X87 assists due to output value. .It Li FP_ASSIST.X87_INPUT .Pq Event CAH , Umask 04H -Number of X87 assists due to input value. +Number of X87 assists due to input value. .It Li FP_ASSIST.SIMD_OUTPUT .Pq Event CAH , Umask 08H - Number of SIMD FP assists due to output values. + Number of SIMD FP assists due to output values. .It Li FP_ASSIST.SIMD_INPUT .Pq Event CAH , Umask 10H -Number of SIMD FP assists due to input values. +Number of SIMD FP assists due to input values. .It Li FP_ASSIST.ANY 1EH .Pq Event CAH , Umask -Cycles with any input/output SSE* or FP assists. +Cycles with any input/output SSE* or FP assists. .It Li ROB_MISC_EVENTS.LBR_INSERTS .Pq Event CCH , Umask 20H Count cases of saving new LBR records by @@ -893,27 +893,27 @@ combine with umask 01H, 02H, to produce .Pq Event D0H , Umask Qualify retired memory uops with line split. Must combine with umask 01H, 02H, to produce counts. -.It Li MEM_UOP_RETIRED_ALL +.It Li MEM_UOP_RETIRED_ALL .Pq Event D0H , Umask Qualify any retired memory uops. Must combine with umask 01H, 02H, to produce counts. -.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT +.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT .Pq Event D1H , Umask 01H Retired load uops with L1 cache hits as data sources. -.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT +.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT .Pq Event D1H , Umask 02H Retired load uops with L2 cache hits as data sources. -.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT +.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT .Pq Event D1H , Umask 04H -Retired load uops which data sources were data hits +Retired load uops which data sources were data hits in LLC without snoops required. .It Li MEM_LOAD_UOPS_RETIRED.LLC_MISS .Pq Event D1H , Umask 20H Retired load uops which data sources were data missed LLC (excluding unknown data source). -.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB +.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB .Pq Event D1H , Umask 40H Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to @@ -930,58 +930,58 @@ correct prediction and this is corrected branch handling mechanisms at the front end. .It Li L2_TRANS.DEMAND_DATA_RD .Pq Event F0H , Umask 01H -Demand Data Read requests that access L2 cache. +Demand Data Read requests that access L2 cache. .It Li L2_TRANS.RFO .Pq Event F0H , Umask 02H -RFO requests that access L2 cache. +RFO requests that access L2 cache. .It Li L2_TRANS.CODE_RD .Pq Event F0H , Umask 04H -L2 cache accesses when fetching instructions. +L2 cache accesses when fetching instructions. .It Li L2_TRANS.ALL_PF .Pq Event F0H , Umask 08H -L2 or LLC HW prefetches that access L2 cache. +L2 or LLC HW prefetches that access L2 cache. .It Li L2_TRANS.L1D_WB .Pq Event F0H , Umask 10H -L1D writebacks that access L2 cache. +L1D writebacks that access L2 cache. .It Li L2_TRANS.L2_FILL .Pq Event F0H , Umask 20H -L2 fill requests that access L2 cache. +L2 fill requests that access L2 cache. .It Li L2_TRANS.L2_WB .Pq Event F0H , Umask 40H -L2 writebacks that access L2 cache. +L2 writebacks that access L2 cache. .It Li L2_TRANS.ALL_REQUESTS .Pq Event F0H , Umask 80H -Transactions accessing L2 pipe. +Transactions accessing L2 pipe. .It Li L2_LINES_IN.I .Pq Event F1H , Umask 01H -L2 cache lines in I state filling L2. +L2 cache lines in I state filling L2. .It Li L2_LINES_IN.S .Pq Event F1H , Umask 02H -L2 cache lines in S state filling L2. -.It Li L2_LINES_IN.E +L2 cache lines in S state filling L2. +.It Li L2_LINES_IN.E .Pq Event F1H , Umask 04H -L2 cache lines in E state filling L2. +L2 cache lines in E state filling L2. .It Li L2_LINES-IN.ALL .Pq Event F1H , Umask 07H -L2 cache lines filling L2. +L2 cache lines filling L2. .It Li L2_LINES_OUT.DEMAND_CLEAN .Pq Event F2H , Umask 01H -Clean L2 cache lines evicted by demand. +Clean L2 cache lines evicted by demand. .It Li L2_LINES_OUT.DEMAND_DIRTY .Pq Event F2H , Umask 02H -Dirty L2 cache lines evicted by demand. +Dirty L2 cache lines evicted by demand. .It Li L2_LINES_OUT.PF_CLEAN .Pq Event F2H , Umask 04H -Clean L2 cache lines evicted by L2 prefetch. +Clean L2 cache lines evicted by L2 prefetch. .It Li L2_LINES_OUT.PF_DIRTY .Pq Event F2H , Umask 08H -Dirty L2 cache lines evicted by L2 prefetch. +Dirty L2 cache lines evicted by L2 prefetch. .It Li L2_LINES_OUT.DIRTY_ALL .Pq Event F2H , Umask 0AH -Dirty L2 cache lines filling the L2. +Dirty L2 cache lines filling the L2. .It Li SQ_MISC.SPLIT_LOCK .Pq Event F4H , Umask 10H -Split locks in SQ. +Split locks in SQ. .El .Sh SEE ALSO .Xr pmc 3 , Modified: stable/9/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_core.c Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/sys/dev/hwpmc/hwpmc_core.c Mon Nov 5 01:05:14 2012 (r242594) @@ -558,7 +558,8 @@ struct iap_event_descr { #define IAP_F_WM (1 << 5) /* CPU: Westmere */ #define IAP_F_SB (1 << 6) /* CPU: Sandy Bridge */ #define IAP_F_IB (1 << 7) /* CPU: Ivy Bridge */ -#define IAP_F_FM (1 << 8) /* Fixed mask */ +#define IAP_F_SBX (1 << 8) /* CPU: Sandy Bridge Xeon */ +#define IAP_F_FM (1 << 9) /* Fixed mask */ #define IAP_F_ALLCPUSCORE2 \ (IAP_F_CC | IAP_F_CC2 | IAP_F_CC2E | IAP_F_CA) @@ -598,12 +599,15 @@ static struct iap_event_descr iap_events IAPDESCR(02H_81H, 0x02, 0x81, IAP_F_FM | IAP_F_CA), IAPDESCR(03H_00H, 0x03, 0x00, IAP_F_FM | IAP_F_CC), - IAPDESCR(03H_01H, 0x03, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB), + IAPDESCR(03H_01H, 0x03, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | + IAP_F_SBX), IAPDESCR(03H_02H, 0x03, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX), IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), - IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB), - IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB), + IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | + IAP_F_SBX), IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(04H_00H, 0x04, 0x00, IAP_F_FM | IAP_F_CC), @@ -613,8 +617,10 @@ static struct iap_event_descr iap_events IAPDESCR(04H_08H, 0x04, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(05H_00H, 0x05, 0x00, IAP_F_FM | IAP_F_CC), - IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB), - IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), IAPDESCR(05H_03H, 0x05, 0x03, IAP_F_FM | IAP_F_I7O), IAPDESCR(06H_00H, 0x06, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2 | @@ -627,24 +633,26 @@ static struct iap_event_descr iap_events IAPDESCR(07H_00H, 0x07, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX), IAPDESCR(07H_02H, 0x07, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_03H, 0x07, 0x03, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_06H, 0x07, 0x06, IAP_F_FM | IAP_F_CA), - IAPDESCR(07H_08H, 0x07, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_SB), + IAPDESCR(07H_08H, 0x07, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_SB | + IAP_F_SBX), IAPDESCR(08H_01H, 0x08, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(08H_02H, 0x08, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(08H_04H, 0x08, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_WM | IAP_F_SB), + IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(08H_05H, 0x08, 0x05, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_06H, 0x08, 0x06, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_07H, 0x08, 0x07, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_08H, 0x08, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(08H_09H, 0x08, 0x09, IAP_F_FM | IAP_F_CA), - IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(08H_40H, 0x08, 0x40, IAP_F_FM | IAP_F_I7O), IAPDESCR(08H_80H, 0x08, 0x80, IAP_F_FM | IAP_F_I7), @@ -666,10 +674,11 @@ static struct iap_event_descr iap_events IAPDESCR(0CH_02H, 0x0C, 0x02, IAP_F_FM | IAP_F_CC2), IAPDESCR(0CH_03H, 0x0C, 0x03, IAP_F_FM | IAP_F_CA), - IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB), - IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB), + IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB | IAP_F_SBX), + IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), IAPDESCR(0EH_02H, 0x0E, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(0EH_10H, 0x0E, 0x10, IAP_F_FM | IAP_F_IB), IAPDESCR(0EH_20H, 0x0E, 0x20, IAP_F_FM | IAP_F_IB), @@ -684,19 +693,24 @@ static struct iap_event_descr iap_events IAPDESCR(10H_00H, 0x10, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(10H_01H, 0x10, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM | IAP_F_SB), + IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(10H_02H, 0x10, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(10H_04H, 0x10, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(10H_08H, 0x10, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(10H_10H, 0x10, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), - IAPDESCR(10H_20H, 0x10, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), - IAPDESCR(10H_40H, 0x10, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), - IAPDESCR(10H_80H, 0x10, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAPDESCR(10H_10H, 0x10, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(10H_20H, 0x10, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(10H_40H, 0x10, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(10H_80H, 0x10, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), IAPDESCR(10H_81H, 0x10, 0x81, IAP_F_FM | IAP_F_CA), IAPDESCR(11H_00H, 0x11, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), - IAPDESCR(11H_01H, 0x11, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_SB), - IAPDESCR(11H_02H, 0x11, 0x02, IAP_F_FM | IAP_F_SB), + IAPDESCR(11H_01H, 0x11, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(11H_02H, 0x11, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(11H_81H, 0x11, 0x81, IAP_F_FM | IAP_F_CA), IAPDESCR(12H_00H, 0x12, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), @@ -718,10 +732,11 @@ static struct iap_event_descr iap_events IAPDESCR(14H_00H, 0x14, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(14H_01H, 0x14, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX), IAPDESCR(14H_02H, 0x14, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(17H_01H, 0x17, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAPDESCR(17H_01H, 0x17, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), IAPDESCR(18H_00H, 0x18, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(18H_01H, 0x18, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -743,18 +758,29 @@ static struct iap_event_descr iap_events IAPDESCR(23H, 0x23, IAP_M_CORE, IAP_F_ALLCPUSCORE2), IAPDESCR(24H, 0x24, IAP_M_CORE | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), - IAPDESCR(24H_01H, 0x24, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAPDESCR(24H_01H, 0x24, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), IAPDESCR(24H_02H, 0x24, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(24H_03H, 0x24, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_04H, 0x24, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_08H, 0x24, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_0CH, 0x24, 0x0C, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_10H, 0x24, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_20H, 0x24, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_80H, 0x24, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_C0H, 0x24, 0xC0, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAPDESCR(24H_03H, 0x24, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_04H, 0x24, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_08H, 0x24, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_0CH, 0x24, 0x0C, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_10H, 0x24, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_20H, 0x24, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_80H, 0x24, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 5 07:44:00 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4517BC; Mon, 5 Nov 2012 07:44:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C883A8FC08; Mon, 5 Nov 2012 07:44:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA57i0JO054115; Mon, 5 Nov 2012 07:44:00 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA57i0G5054113; Mon, 5 Nov 2012 07:44:00 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211050744.qA57i0G5054113@svn.freebsd.org> From: Dimitry Andric Date: Mon, 5 Nov 2012 07:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242600 - stable/9/lib/libc++ X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 07:44:01 -0000 Author: dim Date: Mon Nov 5 07:44:00 2012 New Revision: 242600 URL: http://svnweb.freebsd.org/changeset/base/242600 Log: MFC r242472: Fix broken macro checking in the libc++ Makefile, introduced in r241909. This caused -std=c++0x not to be passed to the build by default. Pointy hat to: dim Modified: stable/9/lib/libc++/Makefile Directory Properties: stable/9/lib/libc++/ (props changed) Modified: stable/9/lib/libc++/Makefile ============================================================================== --- stable/9/lib/libc++/Makefile Mon Nov 5 07:08:45 2012 (r242599) +++ stable/9/lib/libc++/Makefile Mon Nov 5 07:44:00 2012 (r242600) @@ -53,7 +53,7 @@ cxxrt_${_S}: WARNS= 0 CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT -.if !defined(CXXFLAGS) || ${CXXFLAGS:M-std=*}" == "" +.if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++0x .endif From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 5 10:42:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2ED69126; Mon, 5 Nov 2012 10:42:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 12DC58FC0A; Mon, 5 Nov 2012 10:42:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5AgVgL081784; Mon, 5 Nov 2012 10:42:31 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5AgVNc081781; Mon, 5 Nov 2012 10:42:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051042.qA5AgVNc081781@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 10:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242606 - stable/9/lib/libfetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 10:42:32 -0000 Author: des Date: Mon Nov 5 10:42:31 2012 New Revision: 242606 URL: http://svnweb.freebsd.org/changeset/base/242606 Log: MFH (r240496): use libmd if and only if OpenSSL is not available Modified: stable/9/lib/libfetch/Makefile stable/9/lib/libfetch/http.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/Makefile ============================================================================== --- stable/9/lib/libfetch/Makefile Mon Nov 5 09:45:37 2012 (r242605) +++ stable/9/lib/libfetch/Makefile Mon Nov 5 10:42:31 2012 (r242606) @@ -16,8 +16,8 @@ CFLAGS+= -DINET6 .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_SSL -DPADD= ${LIBSSL} ${LIBCRYPTO} ${LIBMD} -LDADD= -lssl -lcrypto -lmd +DPADD= ${LIBSSL} ${LIBCRYPTO} +LDADD= -lssl -lcrypto .else DPADD= ${LIBMD} LDADD= -lmd Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Mon Nov 5 09:45:37 2012 (r242605) +++ stable/9/lib/libfetch/http.c Mon Nov 5 10:42:31 2012 (r242606) @@ -76,7 +76,15 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#ifdef WITH_SSL +#include +#define MD5Init(c) MD5_Init(c) +#define MD5Update(c, data, len) MD5_Update(c, data, len) +#define MD5Final(md, c) MD5_Final(md, c) +#else #include +#endif #include #include From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 5 12:41:55 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8818E26; Mon, 5 Nov 2012 12:41:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE1238FC14; Mon, 5 Nov 2012 12:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5Cftfa001129; Mon, 5 Nov 2012 12:41:55 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5CftHF001127; Mon, 5 Nov 2012 12:41:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051241.qA5CftHF001127@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 12:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242609 - stable/9/usr.bin/fetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 12:41:55 -0000 Author: des Date: Mon Nov 5 12:41:55 2012 New Revision: 242609 URL: http://svnweb.freebsd.org/changeset/base/242609 Log: MFH r240496: use libmd if and only if OpenSSL is not available Modified: stable/9/usr.bin/fetch/Makefile Directory Properties: stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/Makefile ============================================================================== --- stable/9/usr.bin/fetch/Makefile Mon Nov 5 10:54:14 2012 (r242608) +++ stable/9/usr.bin/fetch/Makefile Mon Nov 5 12:41:55 2012 (r242609) @@ -4,11 +4,12 @@ PROG= fetch CSTD?= c99 +.if ${MK_OPENSSL} != "no" +DPADD= ${LIBFETCH} ${LIBSSL} ${LIBCRYPTO} +LDADD= -lfetch -lssl -lcrypto +.else DPADD= ${LIBFETCH} ${LIBMD} LDADD= -lfetch -lmd -.if ${MK_OPENSSL} != "no" -DPADD+= ${LIBSSL} ${LIBCRYPTO} -LDADD+= -lssl -lcrypto .endif .include From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 5 12:46:47 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0B3A3A0; Mon, 5 Nov 2012 12:46:47 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80D698FC14; Mon, 5 Nov 2012 12:46:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5CklHU002014; Mon, 5 Nov 2012 12:46:47 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5CklS5002012; Mon, 5 Nov 2012 12:46:47 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051246.qA5CklS5002012@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 12:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242612 - stable/9/usr.bin/fetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 12:46:47 -0000 Author: des Date: Mon Nov 5 12:46:47 2012 New Revision: 242612 URL: http://svnweb.freebsd.org/changeset/base/242612 Log: MFH r236110: revert unauthorized, unnecessary and incorrect commit Modified: stable/9/usr.bin/fetch/fetch.1 Directory Properties: stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/fetch.1 ============================================================================== --- stable/9/usr.bin/fetch/fetch.1 Mon Nov 5 12:42:24 2012 (r242611) +++ stable/9/usr.bin/fetch/fetch.1 Mon Nov 5 12:46:47 2012 (r242612) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2012 Dag-Erling Smørgrav +.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2012 +.Dd September 27, 2011 .Dt FETCH 1 .Os .Sh NAME @@ -214,11 +214,6 @@ When the flag is specified, wait this many seconds between successive retries. .El .Pp -.Ar URL -.Bd -literal - :(//((:)?@)?(:)?)?/()? -.Ed -.Pp If .Nm receives a From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 00:49:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E45173E1; Tue, 6 Nov 2012 00:49:52 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C85628FC0A; Tue, 6 Nov 2012 00:49:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60nqxU033699; Tue, 6 Nov 2012 00:49:52 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60nqfv033694; Tue, 6 Nov 2012 00:49:52 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211060049.qA60nqfv033694@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 6 Nov 2012 00:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242640 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:49:53 -0000 Author: melifaro Date: Tue Nov 6 00:49:52 2012 New Revision: 242640 URL: http://svnweb.freebsd.org/changeset/base/242640 Log: MFC r241406. Do not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is enabled. This eliminates one mtx_lock() per each routing lookup thus improving performance in several cases (routing to directly connected interface or routing to default gateway). Icmp redirects should not be used to provide routing direction nowadays, even for end hosts. Routers should not use them too (and this is explicitly restricted in IPv6, see RFC 4861, clause 8.2). Current commit changes rnh_machaddr function to 'stock' rn_match (and back) for every AF_INET routing table in given VNET instance on drop_redirect sysctl change. This change is part of bigger patch eliminating rte locking. Sponsored by: Yandex LLC Modified: stable/9/sys/netinet/in_rmx.c stable/9/sys/netinet/in_var.h stable/9/sys/netinet/ip_icmp.c stable/9/sys/netinet/ip_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in_rmx.c ============================================================================== --- stable/9/sys/netinet/in_rmx.c Tue Nov 6 00:41:59 2012 (r242639) +++ stable/9/sys/netinet/in_rmx.c Tue Nov 6 00:49:52 2012 (r242640) @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include extern int in_inithead(void **head, int off); @@ -340,6 +342,13 @@ in_rtqdrain(void) VNET_LIST_RUNLOCK_NOSLEEP(); } +void +in_setmatchfunc(struct radix_node_head *rnh, int val) +{ + + rnh->rnh_matchaddr = (val != 0) ? rn_match : in_matroute; +} + static int _in_rt_was_here; /* * Initialize our routing tree. @@ -365,7 +374,7 @@ in_inithead(void **head, int off) rnh = *head; rnh->rnh_addaddr = in_addroute; - rnh->rnh_matchaddr = in_matroute; + in_setmatchfunc(rnh, V_drop_redirect); rnh->rnh_close = in_clsroute; if (_in_rt_was_here == 0 ) { callout_init(&V_rtq_timer, CALLOUT_MPSAFE); Modified: stable/9/sys/netinet/in_var.h ============================================================================== --- stable/9/sys/netinet/in_var.h Tue Nov 6 00:41:59 2012 (r242639) +++ stable/9/sys/netinet/in_var.h Tue Nov 6 00:49:52 2012 (r242640) @@ -422,6 +422,7 @@ inm_acquire_locked(struct in_multi *inm) struct rtentry; struct route; struct ip_moptions; +struct radix_node_head; int imo_multi_filter(const struct ip_moptions *, const struct ifnet *, const struct sockaddr *, const struct sockaddr *); @@ -460,6 +461,7 @@ void in_rtredirect(struct sockaddr *, s struct sockaddr *, int, struct sockaddr *, u_int); int in_rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); +void in_setmatchfunc(struct radix_node_head *, int); #if 0 int in_rt_getifa(struct rt_addrinfo *, u_int fibnum); Modified: stable/9/sys/netinet/ip_icmp.c ============================================================================== --- stable/9/sys/netinet/ip_icmp.c Tue Nov 6 00:41:59 2012 (r242639) +++ stable/9/sys/netinet/ip_icmp.c Tue Nov 6 00:49:52 2012 (r242640) @@ -108,11 +108,7 @@ SYSCTL_VNET_UINT(_net_inet_icmp, OID_AUT &VNET_NAME(icmpmaskfake), 0, "Fake reply to ICMP Address Mask Request packets."); -static VNET_DEFINE(int, drop_redirect) = 0; -#define V_drop_redirect VNET(drop_redirect) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_RW, - &VNET_NAME(drop_redirect), 0, - "Ignore ICMP redirects"); +VNET_DEFINE(int, drop_redirect) = 0; static VNET_DEFINE(int, log_redirect) = 0; #define V_log_redirect VNET(log_redirect) @@ -157,6 +153,39 @@ static void icmp_send(struct mbuf *, str extern struct protosw inetsw[]; +static int +sysctl_net_icmp_drop_redir(SYSCTL_HANDLER_ARGS) +{ + int error, new; + int i; + struct radix_node_head *rnh; + + new = V_drop_redirect; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + new = (new != 0) ? 1 : 0; + + if (new == V_drop_redirect) + return (0); + + for (i = 0; i < rt_numfibs; i++) { + if ((rnh = rt_tables_get_rnh(i, AF_INET)) == NULL) + continue; + RADIX_NODE_HEAD_LOCK(rnh); + in_setmatchfunc(rnh, new); + RADIX_NODE_HEAD_UNLOCK(rnh); + } + + V_drop_redirect = new; + } + + return (error); +} + +SYSCTL_VNET_PROC(_net_inet_icmp, OID_AUTO, drop_redirect, + CTLTYPE_INT|CTLFLAG_RW, 0, 0, + sysctl_net_icmp_drop_redir, "I", "Ignore ICMP redirects"); + /* * Kernel module interface for updating icmpstat. The argument is an index * into icmpstat treated as an array of u_long. While this encodes the Modified: stable/9/sys/netinet/ip_var.h ============================================================================== --- stable/9/sys/netinet/ip_var.h Tue Nov 6 00:41:59 2012 (r242639) +++ stable/9/sys/netinet/ip_var.h Tue Nov 6 00:49:52 2012 (r242640) @@ -187,6 +187,7 @@ VNET_DECLARE(struct socket *, ip_mrouter extern int (*legal_vif_num)(int); extern u_long (*ip_mcast_src)(int); VNET_DECLARE(int, rsvp_on); +VNET_DECLARE(int, drop_redirect); extern struct pr_usrreqs rip_usrreqs; #define V_ipstat VNET(ipstat) @@ -199,6 +200,7 @@ extern struct pr_usrreqs rip_usrreqs; #define V_ip_rsvpd VNET(ip_rsvpd) #define V_ip_mrouter VNET(ip_mrouter) #define V_rsvp_on VNET(rsvp_on) +#define V_drop_redirect VNET(drop_redirect) void inp_freemoptions(struct ip_moptions *); int inp_getmoptions(struct inpcb *, struct sockopt *); From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 00:54:25 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6FA2858B; Tue, 6 Nov 2012 00:54:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 539B78FC08; Tue, 6 Nov 2012 00:54:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60sPuU034707; Tue, 6 Nov 2012 00:54:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60sPZl034705; Tue, 6 Nov 2012 00:54:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211060054.qA60sPZl034705@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 6 Nov 2012 00:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242641 - stable/9/sys/dev/age X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:54:25 -0000 Author: yongari Date: Tue Nov 6 00:54:25 2012 New Revision: 242641 URL: http://svnweb.freebsd.org/changeset/base/242641 Log: MFC r242348: TSO engine of L1 requires a separate DMA descriptor for TCP payload. This means driver has to split a TX buffer into two pieces of TX buffers when the TX buffer contains both ethernet/IP/TCP header and partial TCP payload. The controller does not require all header should be in a TX buffer but driver forced it to compute IP/TCP header size/offset which is required parameter to configure DMA descriptor for TSO. While here, slightly reorder DMA descriptor setup to enhance readability and remove unnecessary code for TSO(upper stack never requests TSO when the frame length is less than or equal to MTU). Reported by: Yamagi Burmeister yamagi dot org> Tested by: Yamagi Burmeister yamagi dot org> Modified: stable/9/sys/dev/age/if_age.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/age/if_age.c ============================================================================== --- stable/9/sys/dev/age/if_age.c Tue Nov 6 00:49:52 2012 (r242640) +++ stable/9/sys/dev/age/if_age.c Tue Nov 6 00:54:25 2012 (r242641) @@ -1495,7 +1495,7 @@ age_encap(struct age_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[AGE_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, ip_off, poff, vtag; + uint32_t cflags, hdrlen, ip_off, poff, vtag; int error, i, nsegs, prod, si; AGE_LOCK_ASSERT(sc); @@ -1562,8 +1562,12 @@ age_encap(struct age_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } - ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); + m = m_pullup(m, poff + (tcp->th_off << 2)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } /* * L1 requires IP/TCP header size and offset as * well as TCP pseudo checksum which complicates @@ -1578,14 +1582,11 @@ age_encap(struct age_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum as NDIS specification said. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; - if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) - tcp->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, - htons((tcp->th_off << 2) + IPPROTO_TCP)); - else - tcp->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + tcp->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } *m_head = m; } @@ -1627,23 +1628,48 @@ age_encap(struct age_softc *sc, struct m } m = *m_head; + /* Configure VLAN hardware tag insertion. */ + if ((m->m_flags & M_VLANTAG) != 0) { + vtag = AGE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); + vtag = ((vtag << AGE_TD_VLAN_SHIFT) & AGE_TD_VLAN_MASK); + cflags |= AGE_TD_INSERT_VLAN_TAG; + } + + desc = NULL; + i = 0; if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - /* Configure TSO. */ - if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) { - /* Not TSO but IP/TCP checksum offload. */ - cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; - /* Clear TSO in order not to set AGE_TD_TSO_HDR. */ - m->m_pkthdr.csum_flags &= ~CSUM_TSO; - } else { - /* Request TSO and set MSS. */ - cflags |= AGE_TD_TSO_IPV4; - cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; - cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << - AGE_TD_TSO_MSS_SHIFT); - } + /* Request TSO and set MSS. */ + cflags |= AGE_TD_TSO_IPV4; + cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; + cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << + AGE_TD_TSO_MSS_SHIFT); /* Set IP/TCP header size. */ cflags |= ip->ip_hl << AGE_TD_IPHDR_LEN_SHIFT; cflags |= tcp->th_off << AGE_TD_TSO_TCPHDR_LEN_SHIFT; + /* + * L1 requires the first buffer should only hold IP/TCP + * header data. TCP payload should be handled in other + * descriptors. + */ + hdrlen = poff + (tcp->th_off << 2); + desc = &sc->age_rdata.age_tx_ring[prod]; + desc->addr = htole64(txsegs[0].ds_addr); + desc->len = htole32(AGE_TX_BYTES(hdrlen) | vtag); + desc->flags = htole32(cflags); + sc->age_cdata.age_tx_cnt++; + AGE_DESC_INC(prod, AGE_TX_RING_CNT); + if (m->m_len - hdrlen > 0) { + /* Handle remaining payload of the 1st fragment. */ + desc = &sc->age_rdata.age_tx_ring[prod]; + desc->addr = htole64(txsegs[0].ds_addr + hdrlen); + desc->len = htole32(AGE_TX_BYTES(m->m_len - hdrlen) | + vtag); + desc->flags = htole32(cflags); + sc->age_cdata.age_tx_cnt++; + AGE_DESC_INC(prod, AGE_TX_RING_CNT); + } + /* Handle remaining fragments. */ + i = 1; } else if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) { /* Configure Tx IP/TCP/UDP checksum offload. */ cflags |= AGE_TD_CSUM; @@ -1657,16 +1683,7 @@ age_encap(struct age_softc *sc, struct m cflags |= ((poff + m->m_pkthdr.csum_data) << AGE_TD_CSUM_XSUMOFFSET_SHIFT); } - - /* Configure VLAN hardware tag insertion. */ - if ((m->m_flags & M_VLANTAG) != 0) { - vtag = AGE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); - vtag = ((vtag << AGE_TD_VLAN_SHIFT) & AGE_TD_VLAN_MASK); - cflags |= AGE_TD_INSERT_VLAN_TAG; - } - - desc = NULL; - for (i = 0; i < nsegs; i++) { + for (; i < nsegs; i++) { desc = &sc->age_rdata.age_tx_ring[prod]; desc->addr = htole64(txsegs[i].ds_addr); desc->len = htole32(AGE_TX_BYTES(txsegs[i].ds_len) | vtag); From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 00:55:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 73CF9794; Tue, 6 Nov 2012 00:55:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A06C8FC14; Tue, 6 Nov 2012 00:55:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60tir5035085; Tue, 6 Nov 2012 00:55:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60ti7W035079; Tue, 6 Nov 2012 00:55:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211060055.qA60ti7W035079@svn.freebsd.org> From: Eitan Adler Date: Tue, 6 Nov 2012 00:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242643 - in stable/9: etc/root share/skel X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:55:44 -0000 Author: eadler Date: Tue Nov 6 00:55:43 2012 New Revision: 242643 URL: http://svnweb.freebsd.org/changeset/base/242643 Log: MFC r242514,r242541: Revert the change that makes less default. Since I've committed this I've receieved roughly an equal amount of email thanking me for making this change and asking me to revert it. I've resisted making this change because new users tend to prefer less over more and these users are the least likely to know how to change the PAGER on their own. Requested by: many Objected to: just as many Decision made by: core ==== Change default prompt to show ~ again for the home directory Approved by: cperciva (implicit) Modified: stable/9/etc/root/dot.cshrc stable/9/share/skel/dot.cshrc Directory Properties: stable/9/etc/ (props changed) stable/9/share/skel/ (props changed) Modified: stable/9/etc/root/dot.cshrc ============================================================================== --- stable/9/etc/root/dot.cshrc Tue Nov 6 00:55:43 2012 (r242642) +++ stable/9/etc/root/dot.cshrc Tue Nov 6 00:55:43 2012 (r242643) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec Modified: stable/9/share/skel/dot.cshrc ============================================================================== --- stable/9/share/skel/dot.cshrc Tue Nov 6 00:55:43 2012 (r242642) +++ stable/9/share/skel/dot.cshrc Tue Nov 6 00:55:43 2012 (r242643) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 01:18:53 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C926626A; Tue, 6 Nov 2012 01:18:53 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC8218FC0C; Tue, 6 Nov 2012 01:18:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA61IrSH039950; Tue, 6 Nov 2012 01:18:53 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA61Ir0u039947; Tue, 6 Nov 2012 01:18:53 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211060118.qA61Ir0u039947@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 6 Nov 2012 01:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242646 - in stable/9/sys: netinet netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:18:53 -0000 Author: melifaro Date: Tue Nov 6 01:18:53 2012 New Revision: 242646 URL: http://svnweb.freebsd.org/changeset/base/242646 Log: MFC r241502, r241884 Cleanup documentation: cloning route support has been removed in r186119. Eliminate code checking if found IPv6 rte is dynamic. IPv6 redirects are using (different) ND-based approach described in RFC 4861. This change is similar to r241406 which conditionally skips the same check in IPv4. This change is part of bigger patch eliminating rte locking. Sponsored by: Yandex LLC. Modified: stable/9/sys/netinet/in_rmx.c stable/9/sys/netinet6/in6_rmx.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in_rmx.c ============================================================================== --- stable/9/sys/netinet/in_rmx.c Tue Nov 6 01:04:46 2012 (r242645) +++ stable/9/sys/netinet/in_rmx.c Tue Nov 6 01:18:53 2012 (r242646) @@ -27,19 +27,6 @@ * SUCH DAMAGE. */ -/* - * This code does two things necessary for the enhanced TCP metrics to - * function in a useful manner: - * 1) It marks all non-host routes as `cloning', thus ensuring that - * every actual reference to such a route actually gets turned - * into a reference to a host route to the specific destination - * requested. - * 2) When such routes lose all their references, it arranges for them - * to be deleted in some random collection of circumstances, so that - * a large quantity of stale routing data is not kept in kernel memory - * indefinitely. See in_rtqtimo() below for the exact mechanism. - */ - #include __FBSDID("$FreeBSD$"); Modified: stable/9/sys/netinet6/in6_rmx.c ============================================================================== --- stable/9/sys/netinet6/in6_rmx.c Tue Nov 6 01:04:46 2012 (r242645) +++ stable/9/sys/netinet6/in6_rmx.c Tue Nov 6 01:18:53 2012 (r242646) @@ -59,19 +59,6 @@ * */ -/* - * This code does two things necessary for the enhanced TCP metrics to - * function in a useful manner: - * 1) It marks all non-host routes as `cloning', thus ensuring that - * every actual reference to such a route actually gets turned - * into a reference to a host route to the specific destination - * requested. - * 2) When such routes lose all their references, it arranges for them - * to be deleted in some random collection of circumstances, so that - * a large quantity of stale routing data is not kept in kernel memory - * indefinitely. See in6_rtqtimo() below for the exact mechanism. - */ - #include __FBSDID("$FreeBSD$"); @@ -111,8 +98,6 @@ extern int in6_inithead(void **head, int extern int in6_detachhead(void **head, int off); #endif -#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */ - /* * Do what we need to do when inserting a route. */ @@ -183,42 +168,8 @@ in6_addroute(void *v_arg, void *n_arg, s return (ret); } -/* - * This code is the inverse of in6_clsroute: on first reference, if we - * were managing the route, stop doing so and set the expiration timer - * back off again. - */ -static struct radix_node * -in6_matroute(void *v_arg, struct radix_node_head *head) -{ - struct radix_node *rn = rn_match(v_arg, head); - struct rtentry *rt = (struct rtentry *)rn; - - if (rt) { - RT_LOCK(rt); - if (rt->rt_flags & RTPRF_OURS) { - rt->rt_flags &= ~RTPRF_OURS; - rt->rt_rmx.rmx_expire = 0; - } - RT_UNLOCK(rt); - } - return rn; -} - SYSCTL_DECL(_net_inet6_ip6); -static VNET_DEFINE(int, rtq_reallyold6) = 60*60; - /* one hour is ``really old'' */ -#define V_rtq_reallyold6 VNET(rtq_reallyold6) -SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RTEXPIRE, rtexpire, CTLFLAG_RW, - &VNET_NAME(rtq_reallyold6) , 0, ""); - -static VNET_DEFINE(int, rtq_minreallyold6) = 10; - /* never automatically crank down to less */ -#define V_rtq_minreallyold6 VNET(rtq_minreallyold6) -SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, - &VNET_NAME(rtq_minreallyold6) , 0, ""); - static VNET_DEFINE(int, rtq_toomany6) = 128; /* 128 cached routes is ``too many'' */ #define V_rtq_toomany6 VNET(rtq_toomany6) @@ -236,122 +187,6 @@ struct rtqk_arg { }; /* - * Get rid of old routes. When draining, this deletes everything, even when - * the timeout is not expired yet. When updating, this makes sure that - * nothing has a timeout longer than the current value of rtq_reallyold6. - */ -static int -in6_rtqkill(struct radix_node *rn, void *rock) -{ - struct rtqk_arg *ap = rock; - struct rtentry *rt = (struct rtentry *)rn; - int err; - - RADIX_NODE_HEAD_WLOCK_ASSERT(ap->rnh); - - if (rt->rt_flags & RTPRF_OURS) { - ap->found++; - - if (ap->draining || rt->rt_rmx.rmx_expire <= time_uptime) { - if (rt->rt_refcnt > 0) - panic("rtqkill route really not free"); - - err = in6_rtrequest(RTM_DELETE, - (struct sockaddr *)rt_key(rt), - rt->rt_gateway, rt_mask(rt), - rt->rt_flags|RTF_RNH_LOCKED, 0, - rt->rt_fibnum); - if (err) { - log(LOG_WARNING, "in6_rtqkill: error %d", err); - } else { - ap->killed++; - } - } else { - if (ap->updating - && (rt->rt_rmx.rmx_expire - time_uptime - > V_rtq_reallyold6)) { - rt->rt_rmx.rmx_expire = time_uptime - + V_rtq_reallyold6; - } - ap->nextstop = lmin(ap->nextstop, - rt->rt_rmx.rmx_expire); - } - } - - return 0; -} - -#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */ -static VNET_DEFINE(int, rtq_timeout6) = RTQ_TIMEOUT; -static VNET_DEFINE(struct callout, rtq_timer6); - -#define V_rtq_timeout6 VNET(rtq_timeout6) -#define V_rtq_timer6 VNET(rtq_timer6) - -static void -in6_rtqtimo_one(struct radix_node_head *rnh) -{ - struct rtqk_arg arg; - static time_t last_adjusted_timeout = 0; - - arg.found = arg.killed = 0; - arg.rnh = rnh; - arg.nextstop = time_uptime + V_rtq_timeout6; - arg.draining = arg.updating = 0; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in6_rtqkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - - /* - * Attempt to be somewhat dynamic about this: - * If there are ``too many'' routes sitting around taking up space, - * then crank down the timeout, and see if we can't make some more - * go away. However, we make sure that we will never adjust more - * than once in rtq_timeout6 seconds, to keep from cranking down too - * hard. - */ - if ((arg.found - arg.killed > V_rtq_toomany6) - && (time_uptime - last_adjusted_timeout >= V_rtq_timeout6) - && V_rtq_reallyold6 > V_rtq_minreallyold6) { - V_rtq_reallyold6 = 2*V_rtq_reallyold6 / 3; - if (V_rtq_reallyold6 < V_rtq_minreallyold6) { - V_rtq_reallyold6 = V_rtq_minreallyold6; - } - - last_adjusted_timeout = time_uptime; -#ifdef DIAGNOSTIC - log(LOG_DEBUG, "in6_rtqtimo: adjusted rtq_reallyold6 to %d", - V_rtq_reallyold6); -#endif - arg.found = arg.killed = 0; - arg.updating = 1; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in6_rtqkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - } -} - -static void -in6_rtqtimo(void *rock) -{ - CURVNET_SET_QUIET((struct vnet *) rock); - struct radix_node_head *rnh; - struct timeval atv; - u_int fibnum; - - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = rt_tables_get_rnh(fibnum, AF_INET6); - if (rnh != NULL) - in6_rtqtimo_one(rnh); - } - - atv.tv_usec = 0; - atv.tv_sec = V_rtq_timeout6; - callout_reset(&V_rtq_timer6, tvtohz(&atv), in6_rtqtimo, rock); - CURVNET_RESTORE(); -} - -/* * Age old PMTUs. */ struct mtuex_arg { @@ -440,12 +275,9 @@ in6_inithead(void **head, int off) rnh = *head; rnh->rnh_addaddr = in6_addroute; - rnh->rnh_matchaddr = in6_matroute; if (V__in6_rt_was_here == 0) { - callout_init(&V_rtq_timer6, CALLOUT_MPSAFE); callout_init(&V_rtq_mtutimer, CALLOUT_MPSAFE); - in6_rtqtimo(curvnet); /* kick off timeout first time */ in6_mtutimo(curvnet); /* kick off timeout first time */ V__in6_rt_was_here = 1; } @@ -458,7 +290,6 @@ int in6_detachhead(void **head, int off) { - callout_drain(&V_rtq_timer6); callout_drain(&V_rtq_mtutimer); return (1); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 01:49:56 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9B60A13; Tue, 6 Nov 2012 01:49:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CCEF38FC0A; Tue, 6 Nov 2012 01:49:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA61ntJX045844; Tue, 6 Nov 2012 01:49:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA61ntqS045842; Tue, 6 Nov 2012 01:49:55 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201211060149.qA61ntqS045842@svn.freebsd.org> From: Glen Barber Date: Tue, 6 Nov 2012 01:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242648 - stable/9/share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:49:56 -0000 Author: gjb (doc,ports committer) Date: Tue Nov 6 01:49:55 2012 New Revision: 242648 URL: http://svnweb.freebsd.org/changeset/base/242648 Log: MFC r240588: Update release(7) to reflect changes from r240586 and r240587: - Remove cvs(1) references. - Remove CVS* environment references. - Add default entries for the default SVNROOT for the Ports Collection, and Documentation Project. - While here, update 'SGML-based documentation' to 'XML-based', since the recent SGML->XML conversion. - Update an example providing SVNROOT environment usage. Modified: stable/9/share/man/man7/release.7 Directory Properties: stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/release.7 ============================================================================== --- stable/9/share/man/man7/release.7 Tue Nov 6 01:29:26 2012 (r242647) +++ stable/9/share/man/man7/release.7 Tue Nov 6 01:49:55 2012 (r242648) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2012 +.Dd September 16, 2012 .Dt RELEASE 7 .Os .Sh NAME @@ -105,11 +105,7 @@ environment in It then checks out the src tree specified by .Ar svn-branch using -.Xr svn 1 -and (optionally) the ports and documentation trees using -.Xr csup 1 -or -.Xr cvs 1 . +.Xr svn 1 . Once the various source trees have been obtained, it executes .Dq Li "make release" within the @@ -122,33 +118,19 @@ release media. .Pp Environment variables: .Bl -tag -width ".Cm MAKE_FLAGS" -.It Ev CVSUP_HOST -The CVSUP server to use for the doc and ports trees. One of -.Ev CVSUP_HOST -or -.Ev CVSROOT -must be specified for ports and documentation to be included in the release. -.It Ev CVSROOT -The location of the -.Fx -CVS repository to use for the doc and ports trees. One of -.Ev CVSUP_HOST -or -.Ev CVSROOT -must be specified for ports and documentation to be included in the release. -.It Ev CVS_TAG -If the variable -.Ev CVS_TAG -is set, that tag will be used for CVS checkouts (doc and ports), otherwise -.Ic generate-release.sh -will use HEAD. .It Ev MAKE_FLAGS This environment variable can be set to pass flags (e.g. -j) to .Xr make 1 when invoked by the script. .It Ev SVNROOT -The location of the FreeBSD SVN source repository. Defaults to -.Pa svn://svn.freebsd.org/base . +The location of the FreeBSD SVN source, doc, and ports repositories. +Defaults to +.Pa svn://svn.freebsd.org/base +for the source tree, +.Pa svn://svn.freebsd.org/ports/head +for the Ports Collection, and +.Pa svn://svn.freebsd.org/doc/head +for the Documentation Project source. .It Ev RELSTRING Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64). Defaults to the output of @@ -246,7 +228,7 @@ If defined, the Ports Collection will be .It Va NOSRC If set, do not include system source code in the release. .It Va NODOC -If defined, the SGML-based documentation from the +If defined, the XML-based documentation from the .Fx Documentation Project will not be built. However, the @@ -317,7 +299,7 @@ The following sequence of commands can b in a clean environment, including ports and documentation: .Bd -literal -offset indent cd /usr/src/release -export CVSUP_HOST=cvsupN.freebsd.org +export SVNROOT=svn://svn.freebsd.org/base sh generate-release.sh head /local3/release .Ed .Pp @@ -326,7 +308,6 @@ After running these commands, all prepar directory. .Sh SEE ALSO .Xr cc 1 , -.Xr cvs 1 , .Xr install 1 , .Xr make 1 , .Xr svn 1 Pq Pa ports/devel/subversion-freebsd , @@ -376,7 +357,7 @@ was overhauled and the wrapper script introduced to support the introduction of a new installer. .Pp At near 1000 revisions spread over multiple branches, the -.Xr cvs 1 +.Xr svn 1 log of .Pa src/release/Makefile contains a vivid historical record of some From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 01:53:25 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD659BB9; Tue, 6 Nov 2012 01:53:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91A918FC14; Tue, 6 Nov 2012 01:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA61rPTV046650; Tue, 6 Nov 2012 01:53:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA61rPTu046645; Tue, 6 Nov 2012 01:53:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211060153.qA61rPTu046645@svn.freebsd.org> From: Alexander Motin Date: Tue, 6 Nov 2012 01:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242649 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:53:25 -0000 Author: mav Date: Tue Nov 6 01:53:25 2012 New Revision: 242649 URL: http://svnweb.freebsd.org/changeset/base/242649 Log: MFC r241329: Make graid command line a bit more friendly by allowing volume name or provider name to be specified instead of geom name (first argument in all subcommands except label). In most cases there is only one array used any way, so it is not really useful to make user type ugly geom names like Intel-f0bdf223 or SiI-732c2b9448cf. Though they can be used in some cases. Sponsored by: iXsystems, Inc. Modified: stable/9/sys/geom/raid/g_raid_ctl.c stable/9/sys/geom/raid/md_ddf.c stable/9/sys/geom/raid/md_intel.c stable/9/sys/geom/raid/md_promise.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid_ctl.c ============================================================================== --- stable/9/sys/geom/raid/g_raid_ctl.c Tue Nov 6 01:49:55 2012 (r242648) +++ stable/9/sys/geom/raid/g_raid_ctl.c Tue Nov 6 01:53:25 2012 (r242649) @@ -51,7 +51,10 @@ g_raid_find_node(struct g_class *mp, con { struct g_raid_softc *sc; struct g_geom *gp; + struct g_provider *pp; + struct g_raid_volume *vol; + /* Look for geom with specified name. */ LIST_FOREACH(gp, &mp->geom, geom) { sc = gp->softc; if (sc == NULL) @@ -61,6 +64,35 @@ g_raid_find_node(struct g_class *mp, con if (strcasecmp(sc->sc_name, name) == 0) return (sc); } + + /* Look for provider with specified name. */ + LIST_FOREACH(gp, &mp->geom, geom) { + sc = gp->softc; + if (sc == NULL) + continue; + if (sc->sc_stopping != 0) + continue; + LIST_FOREACH(pp, &gp->provider, provider) { + if (strcmp(pp->name, name) == 0) + return (sc); + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, name) == 0) + return (sc); + } + } + + /* Look for volume with specified name. */ + LIST_FOREACH(gp, &mp->geom, geom) { + sc = gp->softc; + if (sc == NULL) + continue; + if (sc->sc_stopping != 0) + continue; + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + if (strcmp(vol->v_name, name) == 0) + return (sc); + } + } return (NULL); } Modified: stable/9/sys/geom/raid/md_ddf.c ============================================================================== --- stable/9/sys/geom/raid/md_ddf.c Tue Nov 6 01:49:55 2012 (r242648) +++ stable/9/sys/geom/raid/md_ddf.c Tue Nov 6 01:53:25 2012 (r242649) @@ -2231,7 +2231,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec struct g_consumer *cp; struct g_provider *pp; char arg[16]; - const char *verb, *volname, *levelname, *diskname; + const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; off_t size, sectorsize, strip, offs[DDF_MAX_DISKS_HARD], esize; @@ -2502,8 +2502,12 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec } if (strcmp(verb, "delete") == 0) { + nodename = gctl_get_asciiparam(req, "arg0"); + if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0) + nodename = NULL; + /* Full node destruction. */ - if (*nargs == 1) { + if (*nargs == 1 && nodename != NULL) { /* Check if some volume is still open. */ force = gctl_get_paraml(req, "force", sizeof(*force)); if (force != NULL && *force == 0 && @@ -2521,11 +2525,12 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec } /* Destroy specified volume. If it was last - all node. */ - if (*nargs != 2) { + if (*nargs > 2) { gctl_error(req, "Invalid number of arguments."); return (-1); } - volname = gctl_get_asciiparam(req, "arg1"); + volname = gctl_get_asciiparam(req, + nodename != NULL ? "arg1" : "arg0"); if (volname == NULL) { gctl_error(req, "No volume name."); return (-2); @@ -2535,6 +2540,14 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { if (strcmp(vol->v_name, volname) == 0) break; + pp = vol->v_provider; + if (pp == NULL) + continue; + if (strcmp(pp->name, volname) == 0) + break; + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, volname) == 0) + break; } if (vol == NULL) { i = strtol(volname, &tmp, 10); Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Tue Nov 6 01:49:55 2012 (r242648) +++ stable/9/sys/geom/raid/md_intel.c Tue Nov 6 01:53:25 2012 (r242649) @@ -1461,7 +1461,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct g_consumer *cp; struct g_provider *pp; char arg[16], serial[INTEL_SERIAL_LEN]; - const char *verb, *volname, *levelname, *diskname; + const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; off_t off, size, sectorsize, strip, disk_sectors; @@ -1876,8 +1876,12 @@ g_raid_md_ctl_intel(struct g_raid_md_obj } if (strcmp(verb, "delete") == 0) { + nodename = gctl_get_asciiparam(req, "arg0"); + if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0) + nodename = NULL; + /* Full node destruction. */ - if (*nargs == 1) { + if (*nargs == 1 && nodename != NULL) { /* Check if some volume is still open. */ force = gctl_get_paraml(req, "force", sizeof(*force)); if (force != NULL && *force == 0 && @@ -1895,11 +1899,12 @@ g_raid_md_ctl_intel(struct g_raid_md_obj } /* Destroy specified volume. If it was last - all node. */ - if (*nargs != 2) { + if (*nargs > 2) { gctl_error(req, "Invalid number of arguments."); return (-1); } - volname = gctl_get_asciiparam(req, "arg1"); + volname = gctl_get_asciiparam(req, + nodename != NULL ? "arg1" : "arg0"); if (volname == NULL) { gctl_error(req, "No volume name."); return (-2); @@ -1909,6 +1914,14 @@ g_raid_md_ctl_intel(struct g_raid_md_obj TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { if (strcmp(vol->v_name, volname) == 0) break; + pp = vol->v_provider; + if (pp == NULL) + continue; + if (strcmp(pp->name, volname) == 0) + break; + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, volname) == 0) + break; } if (vol == NULL) { i = strtol(volname, &tmp, 10); Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Tue Nov 6 01:49:55 2012 (r242648) +++ stable/9/sys/geom/raid/md_promise.c Tue Nov 6 01:53:25 2012 (r242649) @@ -1217,7 +1217,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o struct g_consumer *cp; struct g_provider *pp; char arg[16]; - const char *verb, *volname, *levelname, *diskname; + const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; off_t size, sectorsize, strip; @@ -1478,8 +1478,12 @@ g_raid_md_ctl_promise(struct g_raid_md_o } if (strcmp(verb, "delete") == 0) { + nodename = gctl_get_asciiparam(req, "arg0"); + if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0) + nodename = NULL; + /* Full node destruction. */ - if (*nargs == 1) { + if (*nargs == 1 && nodename != NULL) { /* Check if some volume is still open. */ force = gctl_get_paraml(req, "force", sizeof(*force)); if (force != NULL && *force == 0 && @@ -1497,11 +1501,12 @@ g_raid_md_ctl_promise(struct g_raid_md_o } /* Destroy specified volume. If it was last - all node. */ - if (*nargs != 2) { + if (*nargs > 2) { gctl_error(req, "Invalid number of arguments."); return (-1); } - volname = gctl_get_asciiparam(req, "arg1"); + volname = gctl_get_asciiparam(req, + nodename != NULL ? "arg1" : "arg0"); if (volname == NULL) { gctl_error(req, "No volume name."); return (-2); @@ -1511,6 +1516,14 @@ g_raid_md_ctl_promise(struct g_raid_md_o TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { if (strcmp(vol->v_name, volname) == 0) break; + pp = vol->v_provider; + if (pp == NULL) + continue; + if (strcmp(pp->name, volname) == 0) + break; + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, volname) == 0) + break; } if (vol == NULL) { i = strtol(volname, &tmp, 10); From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 01:56:39 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0FC8DD6; Tue, 6 Nov 2012 01:56:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9245A8FC0C; Tue, 6 Nov 2012 01:56:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA61ud7K047368; Tue, 6 Nov 2012 01:56:39 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA61udlE047366; Tue, 6 Nov 2012 01:56:39 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201211060156.qA61udlE047366@svn.freebsd.org> From: Glen Barber Date: Tue, 6 Nov 2012 01:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242650 - stable/9/release X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:56:40 -0000 Author: gjb (doc,ports committer) Date: Tue Nov 6 01:56:39 2012 New Revision: 242650 URL: http://svnweb.freebsd.org/changeset/base/242650 Log: MFC r227536, r240967: r227536 (nwhitehorn): Further automate production release generation by naming files the right things and generating checksums. r240967: - Allow cross-architecture builds with 'generate-release.sh', which is set by specifying '-a '. (Only supported for i386 on amd64 and powerpc on powerpc64 currently). - Change how textproc/docproj is installed: o Attempt to install from pkg(8); o Fall back to pkg_add(1) if pkg(8) installation is not successful; o Fall back to installing from ports as last resort. - Ensure the script is run by root[1]. - Get OSVERSION from param.h[1]. Modified: stable/9/release/generate-release.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/generate-release.sh ============================================================================== --- stable/9/release/generate-release.sh Tue Nov 6 01:53:25 2012 (r242649) +++ stable/9/release/generate-release.sh Tue Nov 6 01:56:39 2012 (r242650) @@ -10,23 +10,54 @@ # SVNROOT: SVN URL to FreeBSD source repository (by default, # svn://svn.freebsd.org/base) # MAKE_FLAGS: optional flags to pass to make (e.g. -j) +# RELSTRING: optional base name for media images (e.g. FreeBSD-9.0-RC2-amd64) # # Note: Since this requires a chroot, release cross-builds will not work! # # $FreeBSD$ # +unset B_ARCH +unset ARCH +unset MACHINE_ARCH + +HOST_ARCH=`uname -p` + usage() { - echo "Usage: $0 [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir" + echo "Usage: $0 [-a arch] [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir" + exit 1 +} + +arch_error () +{ + echo "Architecture ${OPTARG} cannot be built on host architecture ${HOST_ARCH}" exit 1 } REVISION= DOCREVISION= PORTSREVISION= -while getopts d:r:p: opt; do +while getopts a:d:r:p: opt; do case $opt in + a) + case "${OPTARG}" in + i386|amd64) + if [ "${HOST_ARCH}" != "amd64" ]; then + arch_error "${OPTARG}" + fi + ;; + powerpc|powerpc64) + if [ "${HOST_ARCH}" != "powerpc64" ]; then + arch_error "${OPTARG}" + fi + ;; + *) + arch_error "${OPTARG}" + ;; + esac + B_ARCH="$OPTARG" + ;; d) DOCREVISION="-r $OPTARG" ;; @@ -43,10 +74,21 @@ while getopts d:r:p: opt; do done shift $(($OPTIND - 1)) +# If target architecture is not specified, use hw.machine_arch +if [ "x${B_ARCH}" == "x" ]; then + B_ARCH="${HOST_ARCH}" +fi +ARCH_FLAGS="ARCH=${B_ARCH} TARGET_ARCH=${B_ARCH}" + if [ $# -lt 2 ]; then usage fi +if [ $(id -u) -ne 0 ]; then + echo "Needs to be run as root." + exit 1 +fi + set -e # Everything must succeed svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src @@ -54,19 +96,88 @@ svn co ${SVNROOT:-svn://svn.freebsd.org/ svn co ${SVNROOT:-svn://svn.freebsd.org/ports}/head $2/usr/ports $PORTSREVISION cd $2/usr/src -make $MAKE_FLAGS buildworld -make installworld distribution DESTDIR=$2 +make $MAKE_FLAGS ${ARCH_FLAGS} buildworld +make $ARCH_FLAGS installworld distribution DESTDIR=$2 mount -t devfs devfs $2/dev trap "umount $2/dev" EXIT # Clean up devfs mount on exit +# Most commands below are run in chroot, so fake getosreldate(3) right now +OSVERSION=$(grep '#define __FreeBSD_version' $2/usr/include/sys/param.h | awk '{print $3}') +export OSVERSION +BRANCH=$(grep '^BRANCH=' $2/usr/src/sys/conf/newvers.sh | awk -F\= '{print $2}') +BRANCH=`echo ${BRANCH} | sed -e 's,",,g'` +REVISION=$(grep '^REVISION=' $2/usr/src/sys/conf/newvers.sh | awk -F\= '{print $2}') +REVISION=`echo ${REVISION} | sed -e 's,",,g'` +OSRELEASE="${REVISION}-${BRANCH}" + +pkgng_install_docports () +{ + # Attempt to install docproj port from pkgng package. + chroot ${CHROOTDIR} /bin/sh -c 'env ASSUME_ALWAYS_YES=1 /usr/sbin/pkg install -y docproj-nojadetex' + # Check if docproj was installed, since pkg(8) returns '0' if unable + # to install a package from the repository. If it is not installed, + # fallback to installing using pkg_add(1). + chroot ${CHROOTDIR} /bin/sh -c '/usr/sbin/pkg info -q docproj-nojadetex' || \ + pkgadd_install_docports +} + +build_compat9_port () +{ + chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/misc/compat9x BATCH=yes install clean' +} + +pkgadd_install_docports () +{ + # Attempt to install docproj package with pkg_add(1). + # If not successful, build the docproj port. + if [ "${REVISION}" == "10.0" ]; then + # Packages for 10-CURRENT are still located in the 9-CURRENT + # directory. Override environment to use correct package + # location if building for 10-CURRENT. + PACKAGESITE="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/Latest/" + export PACKAGESITE + PACKAGEROOT="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/" + export PACKAGEROOT + PKG_PATH="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/All/" + export PKG_PATH + build_compat9_port + fi + chroot ${CHROOTDIR} /bin/sh -c '/usr/sbin/pkg_add -r docproj-nojadetex' || \ + build_docports +} + +build_docports() +{ + # Could not install textproc/docproj from pkg(8) or pkg_add(1). Build + # the port as final fallback. + chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/textproc/docproj BATCH=yes WITH_JADETEX=no WITHOUT_X11=yes WITHOUT_PYTHON=yes install clean' || \ + { echo "*** Could not build the textproj/docproj port. Exiting."; exit 2; } +} + if [ -d $2/usr/doc ]; then cp /etc/resolv.conf $2/etc/resolv.conf # Install docproj to build release documentation - chroot $2 /bin/sh -c '(export ASSUME_ALWAYS_YES=1 && /usr/sbin/pkg install -y docproj) || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' + CHROOTDIR="$2" + set +e + pkgng_install_docports "${CHROOTDIR}" + set -e fi -chroot $2 make -C /usr/src $MAKE_FLAGS buildworld buildkernel -chroot $2 make -C /usr/src/release release +chroot $2 make -C /usr/src $MAKE_FLAGS ${ARCH_FLAGS} buildworld buildkernel +chroot $2 make -C /usr/src/release ${ARCH_FLAGS} release chroot $2 make -C /usr/src/release install DESTDIR=/R +if [ "x${OSVERSION}" == "x" ]; then + OSRELEASE=`chroot $2 uname -r` +fi + +: ${RELSTRING=`chroot $2 uname -s`-${OSRELEASE}-${B_ARCH}} + +cd $2/R +for i in release.iso bootonly.iso memstick; do + mv $i $RELSTRING-$i +done +sha256 $RELSTRING-* > CHECKSUM.SHA256 +md5 $RELSTRING-* > CHECKSUM.MD5 + From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 01:59:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55284F5E for ; Tue, 6 Nov 2012 01:59:54 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id B7BC58FC16 for ; Tue, 6 Nov 2012 01:59:53 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so5814257lag.13 for ; Mon, 05 Nov 2012 17:59:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=cEycR+PYmBsM+avbMOCHxdRZ02MbCHT4qxGfCeWonro=; b=rNoX0OCvU1DGRrhudjqm+oLHHdyF3PGDJoeuoO8JInLXZA1iBoGzj/itFjWq2A3auH irrAJNSLwtjBK2aeDA8MUZ6xwre86xcMSrwTUpYrspAp0Rdm4KpvNK7zW0/TvvbWUN9f aL244pi+r2FKjMl3wuZkvrP7ou10cYHe78ADw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=cEycR+PYmBsM+avbMOCHxdRZ02MbCHT4qxGfCeWonro=; b=gC8Yi3pCO5e0tDBkV/6hUDETQHTaN5HtQX/G+Hl0Bt7YsuDEsXSUxD1EgLy5uY6e9t IkFiCa8i+32ZAvSazLTs9YBdb3AfMqqx3DXrmzXq+HLrUYa2Qn9S3PqgkzFYx9TGPlJM qVtrpRZ0mlVKYodwHGpXGcV+d21iuW+2qXy+KYRfDl+CX5LEbCn46CKIpndj2iLdGGBg H9BKavU1Sx1pcM1okHMvWW82j2Nfqa27SYHfwqNi1MPZZi9oKL/5aXT/VTB8CnJZBZKU x5FOBduoCk1UmBg5dLVHTuTaVqvlLyNlJtCeia6mSJbdLmFV6TGoDKKseV7UGf8l/WKh ug9A== Received: by 10.112.13.140 with SMTP id h12mr4799995lbc.12.1352167192202; Mon, 05 Nov 2012 17:59:52 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Mon, 5 Nov 2012 17:59:21 -0800 (PST) In-Reply-To: <201211060149.qA61ntqS045842@svn.freebsd.org> References: <201211060149.qA61ntqS045842@svn.freebsd.org> From: Eitan Adler Date: Mon, 5 Nov 2012 20:59:21 -0500 X-Google-Sender-Auth: psaeluAfxBP_FARg5sMOG8nLTBM Message-ID: Subject: Re: svn commit: r242648 - stable/9/share/man/man7 To: Glen Barber Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnb/RxTK70Ah6jiUku0U5uycJdCksoAq+HpnIxDjkO/FqgezbYjkg3D5egLPcqiL/9yyjTY Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:59:54 -0000 On 5 November 2012 20:49, Glen Barber wrote: > Author: gjb (doc,ports committer) > Date: Tue Nov 6 01:49:55 2012 > New Revision: 242648 > URL: http://svnweb.freebsd.org/changeset/base/242648 > > Log: > MFC r240588: > > Update release(7) to reflect changes from r240586 and r240587: > > - Remove cvs(1) references. > - Remove CVS* environment references. > - Add default entries for the default SVNROOT for the Ports > Collection, and Documentation Project. > - While here, update 'SGML-based documentation' to 'XML-based', > since the recent SGML->XML conversion. > - Update an example providing SVNROOT environment usage. Thanks! -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 02:05:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F73626D; Tue, 6 Nov 2012 02:05:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id 4455D8FC12; Tue, 6 Nov 2012 02:05:24 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:2:2:0:100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 4805A23F645; Mon, 5 Nov 2012 21:05:22 -0500 (EST) Date: Mon, 5 Nov 2012 21:05:19 -0500 From: Glen Barber To: Eitan Adler Subject: Re: svn commit: r242648 - stable/9/share/man/man7 Message-ID: <20121106020519.GA1372@glenbarber.us> References: <201211060149.qA61ntqS045842@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 02:05:24 -0000 --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 05, 2012 at 08:59:21PM -0500, Eitan Adler wrote: > > Log: > > MFC r240588: > > > > Update release(7) to reflect changes from r240586 and r240587: > > > > - Remove cvs(1) references. > > - Remove CVS* environment references. > > - Add default entries for the default SVNROOT for the Ports > > Collection, and Documentation Project. > > - While here, update 'SGML-based documentation' to 'XML-based', > > since the recent SGML->XML conversion. > > - Update an example providing SVNROOT environment usage. >=20 > Thanks! >=20 Sorry for the delay on this... Glen --+HP7ph2BbKc20aGI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQmHBfAAoJEFJPDDeguUajR5cIAJQ94bPzzLjxeZmFHgvZompr 2OxOvNLUuja6OyQMhm8PWF5qTuN0j6atIigm9eURnahZDfsv3n78K9u6kV/I5APv ALxK9yVRtpC3Yjf7gqcgi45SzUQnmq5Ua6IjzL4udDwuH66+BK2AaMVnWsQN7Bc7 Ddxv0UiYrjCUv5dSDLTPPHTs1InWX1df0LFTZjT0ija0UDbiF1tZyq1ny0Q8FzEN Z27icplyZgybDCpKWEcwzV+Fv3EaoBWnWCJkyGLNWGcrbeL5+KVeYV6e+gjsukJq TLo3TgM7RDLV9Fr0pK/HcZ3YUTuMFrtKZi7YlsR8huS4/Vo0c7bPt+pjD4O2e4g= =bEoG -----END PGP SIGNATURE----- --+HP7ph2BbKc20aGI-- From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 02:19:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 038846BA; Tue, 6 Nov 2012 02:19:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DC5288FC15; Tue, 6 Nov 2012 02:19:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA62JpiM052170; Tue, 6 Nov 2012 02:19:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA62Jp9B052168; Tue, 6 Nov 2012 02:19:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211060219.qA62Jp9B052168@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 6 Nov 2012 02:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242652 - stable/9/sys/dev/ale X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 02:19:52 -0000 Author: yongari Date: Tue Nov 6 02:19:51 2012 New Revision: 242652 URL: http://svnweb.freebsd.org/changeset/base/242652 Log: MFC r241340: Fix typo. Check against number of allocated MSI-X vectors. There is no ale(4) controller that supports MSI-X so this is not real issue. PR: kern/171825 Modified: stable/9/sys/dev/ale/if_ale.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ale/if_ale.c ============================================================================== --- stable/9/sys/dev/ale/if_ale.c Tue Nov 6 02:08:09 2012 (r242651) +++ stable/9/sys/dev/ale/if_ale.c Tue Nov 6 02:19:51 2012 (r242652) @@ -551,7 +551,7 @@ ale_attach(device_t dev) if (msix_disable == 0 || msi_disable == 0) { if (msix_disable == 0 && msixc == ALE_MSIX_MESSAGES && pci_alloc_msix(dev, &msixc) == 0) { - if (msic == ALE_MSIX_MESSAGES) { + if (msixc == ALE_MSIX_MESSAGES) { device_printf(dev, "Using %d MSIX messages.\n", msixc); sc->ale_flags |= ALE_FLAG_MSIX; From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 07:46:07 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 939DCA22; Tue, 6 Nov 2012 07:46:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 775588FC1B; Tue, 6 Nov 2012 07:46:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA67k7UK011872; Tue, 6 Nov 2012 07:46:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA67k7JU011870; Tue, 6 Nov 2012 07:46:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211060746.qA67k7JU011870@svn.freebsd.org> From: Dimitry Andric Date: Tue, 6 Nov 2012 07:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242657 - stable/9/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 07:46:07 -0000 Author: dim Date: Tue Nov 6 07:46:07 2012 New Revision: 242657 URL: http://svnweb.freebsd.org/changeset/base/242657 Log: MFC r242380: Pull in r165377 from upstream llvm trunk: X86: fcmov doesn't handle all possible EFLAGS, fall back to a branch for the others. Otherwise it will try to use SSE patterns and fail horribly if sse is disabled. Fixes PR14035. This should fix the following assertion failure: Assertion failed: (Reg >= X86::FP0 && Reg <= X86::FP6 && "Expected FP register!"), function getFPReg, file contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp, line 330. which can show up when compiling contrib/compiler-rt, using -march=i686 through -march=pentium3 (CPU's which do support fcmov, but don't support SSE2). Modified: stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Tue Nov 6 06:19:11 2012 (r242656) +++ stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Tue Nov 6 07:46:07 2012 (r242657) @@ -443,6 +443,11 @@ def CMOV_GR16 : I<0, Pseudo, "#CMOV_GR16* PSEUDO!", [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2, imm:$cond, EFLAGS))]>; +} // Predicates = [NoCMov] + +// fcmov doesn't handle all possible EFLAGS, provide a fallback if there is no +// SSE1. +let Predicates = [FPStackf32] in def CMOV_RFP32 : I<0, Pseudo, (outs RFP32:$dst), (ins RFP32:$src1, RFP32:$src2, i8imm:$cond), @@ -450,6 +455,9 @@ def CMOV_RFP32 : I<0, Pseudo, [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2, imm:$cond, EFLAGS))]>; +// fcmov doesn't handle all possible EFLAGS, provide a fallback if there is no +// SSE2. +let Predicates = [FPStackf64] in def CMOV_RFP64 : I<0, Pseudo, (outs RFP64:$dst), (ins RFP64:$src1, RFP64:$src2, i8imm:$cond), @@ -464,7 +472,6 @@ def CMOV_RFP80 : I<0, Pseudo, [(set RFP80:$dst, (X86cmov RFP80:$src1, RFP80:$src2, imm:$cond, EFLAGS))]>; -} // Predicates = [NoCMov] } // UsesCustomInserter = 1, Uses = [EFLAGS] From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 11:56:16 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 791E4132 for ; Tue, 6 Nov 2012 11:56:16 +0000 (UTC) (envelope-from FreeBSD@nagilum.org) Received: from mo6-p00-ob.rzone.de (mo6-p00-ob.rzone.de [IPv6:2a01:238:20a:202:5300::1]) by mx1.freebsd.org (Postfix) with ESMTP id C49D58FC19 for ; Tue, 6 Nov 2012 11:56:15 +0000 (UTC) X-RZG-AUTH: :O2kGeEG7b/pS1EO4THa/nJdkGexqY2koBVOK1IEPiZ6uSkEMG05qYmSsddWNogGEcA== X-RZG-CLASS-ID: mo00 Received: from cakebox.homeunix.net (164-010-186-093.dialin.vsenet.de [93.186.10.164]) by smtp.strato.de (jorabe mo8) (RZmta 31.1 DYNA|AUTH) with (DHE-RSA-AES256-SHA encrypted) ESMTPA id f07c8doA6B6vsW for ; Tue, 6 Nov 2012 12:56:14 +0100 (CET) Received: from cakebox.homeunix.net (localhost [127.0.0.1]) by cakebox.homeunix.net (Postfix) with ESMTP id 415DE679C8 for ; Tue, 6 Nov 2012 12:56:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on cakebox.tis X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.4 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 Received: by cakebox.homeunix.net (Postfix, from userid 80) id 95503679C7; Tue, 6 Nov 2012 12:55:57 +0100 (CET) Received: from bbnwebdproxy3.europe.hp.net (bbnwebdproxy3.europe.hp.net [15.195.185.83]) by cakebox.homeunix.net (Horde Framework) with HTTP; Tue, 06 Nov 2012 12:55:57 +0100 Date: Tue, 06 Nov 2012 12:55:56 +0100 Message-ID: <20121106125556.Horde.rAUjZ5k8pphQmPrM49nBhR0@cakebox.homeunix.net> From: FreeBSD@nagilum.org To: svn-src-stable-9@freebsd.org Subject: Re: svn commit: r242643 - in stable/9: etc/root share/skel References: <201211060055.qA60ti7W035079@svn.freebsd.org> In-Reply-To: <201211060055.qA60ti7W035079@svn.freebsd.org> User-Agent: Internet Messaging Program (IMP) H4 (5.0.23) Content-Type: text/plain; charset=iso-8859-15; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 11:56:16 -0000 +1 for less ;) Zitat von Eitan Adler : > Author: eadler > Date: Tue Nov 6 00:55:43 2012 > New Revision: 242643 > URL: http://svnweb.freebsd.org/changeset/base/242643 > > Log: > MFC r242514,r242541: > > Revert the change that makes less default. > > Since I've committed this I've receieved roughly an equal > amount of email thanking me for making this change > and asking me to revert it. > > I've resisted making this change because > new users tend to prefer less over more > and these users are the least likely to know > how to change the PAGER on their own. > > Requested by: many > Objected to: just as many > Decision made by: core > > ==== > Change default prompt to show ~ again for the home directory > > Approved by: cperciva (implicit) > > Modified: > stable/9/etc/root/dot.cshrc > stable/9/share/skel/dot.cshrc > Directory Properties: > stable/9/etc/ (props changed) > stable/9/share/skel/ (props changed) > > Modified: stable/9/etc/root/dot.cshrc > ============================================================================== > --- stable/9/etc/root/dot.cshrc Tue Nov 6 00:55:43 2012 (r242642) > +++ stable/9/etc/root/dot.cshrc Tue Nov 6 00:55:43 2012 (r242643) > @@ -18,7 +18,7 @@ umask 22 > set path = (/sbin /bin /usr/sbin /usr/bin /usr/games > /usr/local/sbin /usr/local/bin $HOME/bin) > > setenv EDITOR vi > -setenv PAGER less > +setenv PAGER more > setenv BLOCKSIZE K > > if ($?prompt) then > @@ -26,7 +26,7 @@ if ($?prompt) then > if ($uid == 0) then > set user = root > endif > - set prompt = "%n@%m:%/ %# " > + set prompt = "%n@%m:%~ %# " > set promptchars = "%#" > > set filec > > Modified: stable/9/share/skel/dot.cshrc > ============================================================================== > --- stable/9/share/skel/dot.cshrc Tue Nov 6 00:55:43 2012 (r242642) > +++ stable/9/share/skel/dot.cshrc Tue Nov 6 00:55:43 2012 (r242643) > @@ -18,7 +18,7 @@ umask 22 > set path = (/sbin /bin /usr/sbin /usr/bin /usr/games > /usr/local/sbin /usr/local/bin $HOME/bin) > > setenv EDITOR vi > -setenv PAGER less > +setenv PAGER more > setenv BLOCKSIZE K > > if ($?prompt) then > @@ -26,7 +26,7 @@ if ($?prompt) then > if ($uid == 0) then > set user = root > endif > - set prompt = "%n@%m:%/ %# " > + set prompt = "%n@%m:%~ %# " > set promptchars = "%#" > > set filec > _______________________________________________ > svn-src-stable-9@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 > To unsubscribe, send any mail to "svn-src-stable-9-unsubscribe@freebsd.org" From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 21:16:46 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7235AD78; Tue, 6 Nov 2012 21:16:46 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5826C8FC0C; Tue, 6 Nov 2012 21:16:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6LGkaD051975; Tue, 6 Nov 2012 21:16:46 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6LGk1B051973; Tue, 6 Nov 2012 21:16:46 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201211062116.qA6LGk1B051973@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 6 Nov 2012 21:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242674 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 21:16:46 -0000 Author: gavin Date: Tue Nov 6 21:16:45 2012 New Revision: 242674 URL: http://svnweb.freebsd.org/changeset/base/242674 Log: Merge r242396 from head: Genericise the (out of date) instructions from moving from stable to current. Modified: stable/9/UPDATING (contents, props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Tue Nov 6 21:07:04 2012 (r242673) +++ stable/9/UPDATING Tue Nov 6 21:16:45 2012 (r242674) @@ -1423,7 +1423,7 @@ COMMON ITEMS: - To upgrade in-place from 8.x-stable to current + To upgrade in-place from stable to current ---------------------------------------------- make buildworld [9] From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 21:53:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B88389C; Tue, 6 Nov 2012 21:53:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5FDB78FC18; Tue, 6 Nov 2012 21:53:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6LrH9A061270; Tue, 6 Nov 2012 21:53:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6LrHaP061267; Tue, 6 Nov 2012 21:53:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201211062153.qA6LrHaP061267@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 6 Nov 2012 21:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242677 - stable/9/sys/powerpc/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 21:53:17 -0000 Author: nwhitehorn Date: Tue Nov 6 21:53:17 2012 New Revision: 242677 URL: http://svnweb.freebsd.org/changeset/base/242677 Log: MFC r240860: Move the prototype for savectx from cpu.h to pcb.h, as it is on other platforms, as well as putting it in an #ifdef KERNEL block. Modified: stable/9/sys/powerpc/include/cpu.h stable/9/sys/powerpc/include/pcb.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/include/cpu.h ============================================================================== --- stable/9/sys/powerpc/include/cpu.h Tue Nov 6 21:48:45 2012 (r242676) +++ stable/9/sys/powerpc/include/cpu.h Tue Nov 6 21:53:17 2012 (r242677) @@ -98,7 +98,4 @@ void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *); -/* XXX the following should not be here. */ -void savectx(struct pcb *) __returns_twice; - #endif /* _MACHINE_CPU_H_ */ Modified: stable/9/sys/powerpc/include/pcb.h ============================================================================== --- stable/9/sys/powerpc/include/pcb.h Tue Nov 6 21:48:45 2012 (r242676) +++ stable/9/sys/powerpc/include/pcb.h Tue Nov 6 21:53:17 2012 (r242677) @@ -89,6 +89,7 @@ extern struct pmap *curpm; extern struct proc *fpuproc; void makectx(struct trapframe *, struct pcb *); +void savectx(struct pcb *) __returns_twice; #endif #endif /* _MACHINE_PCB_H_ */ From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 21:54:45 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78ECAA56; Tue, 6 Nov 2012 21:54:45 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE018FC14; Tue, 6 Nov 2012 21:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6Lsjbq061658; Tue, 6 Nov 2012 21:54:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6LsjlM061656; Tue, 6 Nov 2012 21:54:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201211062154.qA6LsjlM061656@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 6 Nov 2012 21:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242678 - stable/9/sys/powerpc/powermac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 21:54:45 -0000 Author: nwhitehorn Date: Tue Nov 6 21:54:45 2012 New Revision: 242678 URL: http://svnweb.freebsd.org/changeset/base/242678 Log: MFC r242315: Work around broken device tree on last-generation PowerPC iMacs (PowerMac12,1), which have a mac-io MPIC cell that indifies itself as the root PIC despite the actual root PIC being on the northbridge. No CPC945 systems have a mac-io PIC that does anything so just don't attach on CPC945 (U4) systems. Modified: stable/9/sys/powerpc/powermac/openpic_macio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/powermac/openpic_macio.c ============================================================================== --- stable/9/sys/powerpc/powermac/openpic_macio.c Tue Nov 6 21:53:17 2012 (r242677) +++ stable/9/sys/powerpc/powermac/openpic_macio.c Tue Nov 6 21:54:45 2012 (r242678) @@ -94,6 +94,10 @@ openpic_macio_probe(device_t dev) if (strcmp(type, "open-pic") != 0) return (ENXIO); + /* On some U4 systems, there is a phantom MPIC in the mac-io cell */ + if (OF_finddevice("/u4") != (phandle_t)-1) + return (ENXIO); + device_set_desc(dev, OPENPIC_DEVSTR); return (0); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 6 22:46:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 829FFFAA; Tue, 6 Nov 2012 22:46:11 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66BD78FC08; Tue, 6 Nov 2012 22:46:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6MkBL5074586; Tue, 6 Nov 2012 22:46:11 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6MkBwl074584; Tue, 6 Nov 2012 22:46:11 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201211062246.qA6MkBwl074584@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 6 Nov 2012 22:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242679 - stable/9/share/syscons/keymaps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 22:46:11 -0000 Author: gavin Date: Tue Nov 6 22:46:11 2012 New Revision: 242679 URL: http://svnweb.freebsd.org/changeset/base/242679 Log: Merge r241866 from head: Add German, French, Portuguese and Spanish names for the Spanish Dvorak keymap. Modified: stable/9/share/syscons/keymaps/INDEX.keymaps Directory Properties: stable/9/share/syscons/keymaps/ (props changed) Modified: stable/9/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- stable/9/share/syscons/keymaps/INDEX.keymaps Tue Nov 6 21:54:45 2012 (r242678) +++ stable/9/share/syscons/keymaps/INDEX.keymaps Tue Nov 6 22:46:11 2012 (r242679) @@ -381,6 +381,10 @@ ru.koi8-r.win.kbd:es:Ruso koi8-r (winkey ru.koi8-r.win.kbd:uk:òÏÓ¦ÊÓØËÁ koi8-r (winkeys) spanish.dvorak.kbd:en:Spanish Dvorak +spanish.dvorak.kbd:de:Spanisch Dvorak +spanish.dvorak.kbd:fr:Espagnol Dvorak +spanish.dvorak.kbd:pt:Espanhol Dvorak +spanish.dvorak.kbd:es:Español Dvorak spanish.iso.kbd:en:Spanish ISO-8859-1 spanish.iso.kbd:de:Spanisch ISO-8859-1 From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 7 00:30:26 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7959EA7; Wed, 7 Nov 2012 00:30:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB4318FC08; Wed, 7 Nov 2012 00:30:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA70UPXb001402; Wed, 7 Nov 2012 00:30:25 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA70UPYu001396; Wed, 7 Nov 2012 00:30:25 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201211070030.qA70UPYu001396@svn.freebsd.org> From: Sean Bruno Date: Wed, 7 Nov 2012 00:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242685 - in stable/9: lib/libpmc sys/dev/hwpmc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 00:30:26 -0000 Author: sbruno Date: Wed Nov 7 00:30:25 2012 New Revision: 242685 URL: http://svnweb.freebsd.org/changeset/base/242685 Log: MFC r241974 Cleanup and rename some variables in libpmc and hwpmc. Testing MFC of merge to root of stable/9 with peter@ lurking. Modified: stable/9/lib/libpmc/libpmc.c stable/9/lib/libpmc/pmc.ivybridge.3 stable/9/lib/libpmc/pmc.sandybridge.3 stable/9/lib/libpmc/pmc.sandybridgexeon.3 stable/9/sys/dev/hwpmc/pmc_events.h Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libpmc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/lib/libpmc/libpmc.c Wed Nov 7 00:30:25 2012 (r242685) @@ -718,7 +718,7 @@ static struct pmc_masks iap_rsp_mask_sb_ PMCMASK(RES_SUPPLIER_LLC_HITS, (1ULL << 20)), PMCMASK(RES_SUPPLIER_LLC_HITF, (1ULL << 21)), PMCMASK(RES_SUPPLIER_LOCAL, (1ULL << 22)), - PMCMASK(RES_SNOOP_SNPI_NONE, (1ULL << 31)), + PMCMASK(RES_SNOOP_SNP_NONE, (1ULL << 31)), PMCMASK(RES_SNOOP_SNP_NO_NEEDED,(1ULL << 32)), PMCMASK(RES_SNOOP_SNP_MISS, (1ULL << 33)), PMCMASK(RES_SNOOP_HIT_NO_FWD, (1ULL << 34)), Modified: stable/9/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.ivybridge.3 Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/lib/libpmc/pmc.ivybridge.3 Wed Nov 7 00:30:25 2012 (r242685) @@ -135,7 +135,7 @@ S-state. F-state. .It Li RES_SUPPLIER_LOCAL Local DRAM Controller. -.It Li RES_SNOOP_SNPI_NONE +.It Li RES_SNOOP_SNP_NONE No details on snoop-related information. .It Li RES_SNOOP_SNP_NO_NEEDED No snoop was needed to satisfy the request. Modified: stable/9/lib/libpmc/pmc.sandybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.sandybridge.3 Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/lib/libpmc/pmc.sandybridge.3 Wed Nov 7 00:30:25 2012 (r242685) @@ -138,7 +138,7 @@ S-state. F-state. .It Li RES_SUPPLIER_LOCAL Local DRAM Controller. -.It Li RES_SNOOP_SNPI_NONE +.It Li RES_SNOOP_SNP_NONE No details on snoop-related information. .It Li RES_SNOOP_SNP_NO_NEEDED No snoop was needed to satisfy the request. Modified: stable/9/lib/libpmc/pmc.sandybridgexeon.3 ============================================================================== --- stable/9/lib/libpmc/pmc.sandybridgexeon.3 Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/lib/libpmc/pmc.sandybridgexeon.3 Wed Nov 7 00:30:25 2012 (r242685) @@ -135,7 +135,7 @@ S-state. F-state. .It Li RES_SUPPLIER_LOCAL Local DRAM Controller. -.It Li RES_SNOOP_SNPI_NONE +.It Li RES_SNOOP_SNP_NONE No details on snoop-related information. .It Li RES_SNOOP_SNP_NO_NEEDED No snoop was needed to satisfy the request. Modified: stable/9/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/9/sys/dev/hwpmc/pmc_events.h Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/sys/dev/hwpmc/pmc_events.h Wed Nov 7 00:30:25 2012 (r242685) @@ -2640,7 +2640,7 @@ __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_C __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_DURATION", IAP_EVENT_49H_04H) \ __PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT", IAP_EVENT_49H_10H) \ __PMC_EV_ALIAS("LOAD_HIT_PRE.SW_PF", IAP_EVENT_4CH_01H) \ -__PMC_EV_ALIAS("LOAD_HIT_PER.HW_PF", IAP_EVENT_4CH_02H) \ +__PMC_EV_ALIAS("LOAD_HIT_PRE.HW_PF", IAP_EVENT_4CH_02H) \ __PMC_EV_ALIAS("HW_PRE_REQ.DL1_MISS", IAP_EVENT_4EH_02H) \ __PMC_EV_ALIAS("L1D.REPLACEMENT", IAP_EVENT_51H_01H) \ __PMC_EV_ALIAS("L1D.ALLOCATED_IN_M", IAP_EVENT_51H_02H) \ @@ -2777,7 +2777,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", IAP_EVENT_D2H_08H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", IAP_EVENT_D4H_02H) \ __PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H) \ -__PMC_EV_ALIAS("L2_TRANS.RF0", IAP_EVENT_F0H_02H) \ +__PMC_EV_ALIAS("L2_TRANS.RFO", IAP_EVENT_F0H_02H) \ __PMC_EV_ALIAS("L2_TRANS.CODE_RD", IAP_EVENT_F0H_04H) \ __PMC_EV_ALIAS("L2_TRANS.ALL_PF", IAP_EVENT_F0H_08H) \ __PMC_EV_ALIAS("L2_TRANS.L1D_WB", IAP_EVENT_F0H_10H) \ @@ -2787,7 +2787,7 @@ __PMC_EV_ALIAS("L2_TRANS.ALL_REQUESTS", __PMC_EV_ALIAS("L2_LINES_IN.I", IAP_EVENT_F1H_01H) \ __PMC_EV_ALIAS("L2_LINES_IN.S", IAP_EVENT_F1H_02H) \ __PMC_EV_ALIAS("L2_LINES_IN.E", IAP_EVENT_F1H_04H) \ -__PMC_EV_ALIAS("L2_LINES-IN.ALL", IAP_EVENT_F1H_07H) \ +__PMC_EV_ALIAS("L2_LINES_IN.ALL", IAP_EVENT_F1H_07H) \ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_CLEAN", IAP_EVENT_F2H_01H) \ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_DIRTY", IAP_EVENT_F2H_02H) \ __PMC_EV_ALIAS("L2_LINES_OUT.PF_CLEAN", IAP_EVENT_F2H_04H) \ @@ -2855,7 +2855,7 @@ __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_C __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_DURATION", IAP_EVENT_49H_04H) \ __PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT", IAP_EVENT_49H_10H) \ __PMC_EV_ALIAS("LOAD_HIT_PRE.SW_PF", IAP_EVENT_4CH_01H) \ -__PMC_EV_ALIAS("LOAD_HIT_PER.HW_PF", IAP_EVENT_4CH_02H) \ +__PMC_EV_ALIAS("LOAD_HIT_PRE.HW_PF", IAP_EVENT_4CH_02H) \ __PMC_EV_ALIAS("HW_PRE_REQ.DL1_MISS", IAP_EVENT_4EH_02H) \ __PMC_EV_ALIAS("L1D.REPLACEMENT", IAP_EVENT_51H_01H) \ __PMC_EV_ALIAS("L1D.ALLOCATED_IN_M", IAP_EVENT_51H_02H) \ @@ -3005,7 +3005,7 @@ __PMC_EV_ALIAS("L2_TRANS.ALL_REQUESTS", __PMC_EV_ALIAS("L2_LINES_IN.I", IAP_EVENT_F1H_01H) \ __PMC_EV_ALIAS("L2_LINES_IN.S", IAP_EVENT_F1H_02H) \ __PMC_EV_ALIAS("L2_LINES_IN.E", IAP_EVENT_F1H_04H) \ -__PMC_EV_ALIAS("L2_LINES-IN.ALL", IAP_EVENT_F1H_07H) \ +__PMC_EV_ALIAS("L2_LINES_IN.ALL", IAP_EVENT_F1H_07H) \ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_CLEAN", IAP_EVENT_F2H_01H) \ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_DIRTY", IAP_EVENT_F2H_02H) \ __PMC_EV_ALIAS("L2_LINES_OUT.PF_CLEAN", IAP_EVENT_F2H_04H) \ From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 7 00:40:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C19C81D1; Wed, 7 Nov 2012 00:40:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A746B8FC08; Wed, 7 Nov 2012 00:40:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA70e1mF003606; Wed, 7 Nov 2012 00:40:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA70e1R7003604; Wed, 7 Nov 2012 00:40:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211070040.qA70e1R7003604@svn.freebsd.org> From: Eitan Adler Date: Wed, 7 Nov 2012 00:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242686 - stable/9/games/fortune/fortune X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 00:40:01 -0000 Author: eadler Date: Wed Nov 7 00:40:01 2012 New Revision: 242686 URL: http://svnweb.freebsd.org/changeset/base/242686 Log: MFC r242576: Prefer the use of stdbool to custom defines. Approved by: cperciva (implicit) Modified: stable/9/games/fortune/fortune/fortune.c Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/fortune/fortune.c ============================================================================== --- stable/9/games/fortune/fortune/fortune.c Wed Nov 7 00:30:25 2012 (r242685) +++ stable/9/games/fortune/fortune/fortune.c Wed Nov 7 00:40:01 2012 (r242686) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -62,9 +63,8 @@ __FBSDID("$FreeBSD$"); #include "strfile.h" #include "pathnames.h" -#define TRUE 1 -#define FALSE 0 -#define bool short +#define TRUE true +#define FALSE false #define MINW 6 /* minimum wait if desired */ #define CPERS 20 /* # of chars for each sec */ From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 7 00:41:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F002E349; Wed, 7 Nov 2012 00:41:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D3E408FC08; Wed, 7 Nov 2012 00:41:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA70f72G003912; Wed, 7 Nov 2012 00:41:07 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA70f7CW003909; Wed, 7 Nov 2012 00:41:07 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211070041.qA70f7CW003909@svn.freebsd.org> From: Eitan Adler Date: Wed, 7 Nov 2012 00:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242687 - stable/9/games/fortune/fortune X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 00:41:08 -0000 Author: eadler Date: Wed Nov 7 00:41:07 2012 New Revision: 242687 URL: http://svnweb.freebsd.org/changeset/base/242687 Log: MFC r242577: Make OK_TO_WRITE_TO_DISK an envrionment variable instead of a compile time option. While here, don't differ based on the existence of LOCK_EX which doesn't seem to have ever made a difference on FreeBSD. Approved by: cperciva (implicit) Modified: stable/9/games/fortune/fortune/fortune.6 stable/9/games/fortune/fortune/fortune.c Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/fortune/fortune.6 ============================================================================== --- stable/9/games/fortune/fortune/fortune.6 Wed Nov 7 00:40:01 2012 (r242686) +++ stable/9/games/fortune/fortune/fortune.6 Wed Nov 7 00:41:07 2012 (r242687) @@ -170,6 +170,9 @@ looks for data files. If not set it will default to .Pa /usr/games/fortune . If none of the directories specified exist, it will print a warning and exit. +.It Ev FORTUNE_SAVESTATE +If set, fortune will save some state about what fortune +it was up to on disk. .El .Sh FILES .Bl -tag -width ".Pa /usr/share/games/fortune/*" Modified: stable/9/games/fortune/fortune/fortune.c ============================================================================== --- stable/9/games/fortune/fortune/fortune.c Wed Nov 7 00:40:01 2012 (r242686) +++ stable/9/games/fortune/fortune/fortune.c Wed Nov 7 00:41:07 2012 (r242687) @@ -107,6 +107,7 @@ bool Offend = FALSE; /* offensive fortu bool All_forts = FALSE; /* any fortune allowed */ bool Equal_probs = FALSE; /* scatter un-allocted prob equally */ bool Match = FALSE; /* dump fortunes matching a pattern */ +static bool WriteToDisk = false; /* use files on disk to save state */ #ifdef DEBUG bool Debug = FALSE; /* print debug messages */ #endif @@ -170,9 +171,10 @@ static regex_t Re_pat; int main(int argc, char *argv[]) { -#ifdef OK_TO_WRITE_DISK int fd; -#endif /* OK_TO_WRITE_DISK */ + + if (getenv("FORTUNE_SAVESTATE") != NULL) + WriteToDisk = true; (void) setlocale(LC_ALL, ""); @@ -190,26 +192,22 @@ main(int argc, char *argv[]) display(Fortfile); -#ifdef OK_TO_WRITE_DISK - if ((fd = creat(Fortfile->posfile, 0666)) < 0) { - perror(Fortfile->posfile); - exit(1); + if (WriteToDisk) { + if ((fd = creat(Fortfile->posfile, 0666)) < 0) { + perror(Fortfile->posfile); + exit(1); + } + /* + * if we can, we exclusive lock, but since it isn't very + * important, we just punt if we don't have easy locking + * available. + */ + flock(fd, LOCK_EX); + write(fd, (char *) &Fortfile->pos, sizeof Fortfile->pos); + if (!Fortfile->was_pos_file) + chmod(Fortfile->path, 0666); + flock(fd, LOCK_UN); } -#ifdef LOCK_EX - /* - * if we can, we exclusive lock, but since it isn't very - * important, we just punt if we don't have easy locking - * available. - */ - (void) flock(fd, LOCK_EX); -#endif /* LOCK_EX */ - write(fd, (char *) &Fortfile->pos, sizeof Fortfile->pos); - if (!Fortfile->was_pos_file) - (void) chmod(Fortfile->path, 0666); -#ifdef LOCK_EX - (void) flock(fd, LOCK_UN); -#endif /* LOCK_EX */ -#endif /* OK_TO_WRITE_DISK */ if (Wait) { if (Fort_len == 0) (void) fortlen(); @@ -587,9 +585,8 @@ over: fp->next = *head; *head = fp; } -#ifdef OK_TO_WRITE_DISK - fp->was_pos_file = (access(fp->posfile, W_OK) >= 0); -#endif /* OK_TO_WRITE_DISK */ + if (WriteToDisk) + fp->was_pos_file = (access(fp->posfile, W_OK) >= 0); return (TRUE); } @@ -691,10 +688,9 @@ all_forts(FILEDESC *fp, char *offensive) obscene->name = ++sp; obscene->datfile = datfile; obscene->posfile = posfile; - obscene->read_tbl = FALSE; -#ifdef OK_TO_WRITE_DISK - obscene->was_pos_file = (access(obscene->posfile, W_OK) >= 0); -#endif /* OK_TO_WRITE_DISK */ + obscene->read_tbl = false; + if (WriteToDisk) + obscene->was_pos_file = (access(obscene->posfile, W_OK) >= 0); } /* @@ -824,12 +820,13 @@ is_fortfile(const char *file, char **dat else free(datfile); if (posp != NULL) { -#ifdef OK_TO_WRITE_DISK - *posp = copy(file, (unsigned int) (strlen(file) + 4)); /* +4 for ".dat" */ - (void) strcat(*posp, ".pos"); -#else - *posp = NULL; -#endif /* OK_TO_WRITE_DISK */ + if (WriteToDisk) { + *posp = copy(file, (unsigned int) (strlen(file) + 4)); /* +4 for ".dat" */ + strcat(*posp, ".pos"); + } + else { + *posp = NULL; + } } DPRINTF(2, (stderr, "TRUE\n")); @@ -1110,23 +1107,21 @@ open_dat(FILEDESC *fp) void get_pos(FILEDESC *fp) { -#ifdef OK_TO_WRITE_DISK int fd; -#endif /* OK_TO_WRITE_DISK */ assert(fp->read_tbl); if (fp->pos == POS_UNKNOWN) { -#ifdef OK_TO_WRITE_DISK - if ((fd = open(fp->posfile, O_RDONLY)) < 0 || - read(fd, &fp->pos, sizeof fp->pos) != sizeof fp->pos) + if (WriteToDisk) { + if ((fd = open(fp->posfile, O_RDONLY)) < 0 || + read(fd, &fp->pos, sizeof fp->pos) != sizeof fp->pos) + fp->pos = arc4random_uniform(fp->tbl.str_numstr); + else if (fp->pos >= fp->tbl.str_numstr) + fp->pos %= fp->tbl.str_numstr; + if (fd >= 0) + close(fd); + } + else fp->pos = arc4random_uniform(fp->tbl.str_numstr); - else if (fp->pos >= fp->tbl.str_numstr) - fp->pos %= fp->tbl.str_numstr; - if (fd >= 0) - (void) close(fd); -#else - fp->pos = arc4random_uniform(fp->tbl.str_numstr); -#endif /* OK_TO_WRITE_DISK */ } if (++(fp->pos) >= fp->tbl.str_numstr) fp->pos -= fp->tbl.str_numstr; From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 7 16:52:02 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34385C74; Wed, 7 Nov 2012 16:52:02 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1F2C8FC08; Wed, 7 Nov 2012 16:52:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7Gq1ga067271; Wed, 7 Nov 2012 16:52:01 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7Gq1aU067269; Wed, 7 Nov 2012 16:52:01 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211071652.qA7Gq1aU067269@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 7 Nov 2012 16:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242699 - stable/9/sys/dev/md X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 16:52:02 -0000 Author: jh Date: Wed Nov 7 16:52:01 2012 New Revision: 242699 URL: http://svnweb.freebsd.org/changeset/base/242699 Log: MFC r238991: Disallow sectorsize larger than MAXPHYS and mediasize smaller than sectorsize. PR: 169947 Modified: stable/9/sys/dev/md/md.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/md/md.c ============================================================================== --- stable/9/sys/dev/md/md.c Wed Nov 7 16:34:09 2012 (r242698) +++ stable/9/sys/dev/md/md.c Wed Nov 7 16:52:01 2012 (r242699) @@ -1081,7 +1081,7 @@ mdcreate_swap(struct md_s *sc, struct md * Range check. Disallow negative sizes or any size less then the * size of a page. Then round to a page. */ - if (sc->mediasize == 0 || (sc->mediasize % PAGE_SIZE) != 0) + if (sc->mediasize <= 0 || (sc->mediasize % PAGE_SIZE) != 0) return (EDOM); /* @@ -1122,6 +1122,7 @@ xmdctlioctl(struct cdev *dev, u_long cmd struct md_ioctl *mdio; struct md_s *sc; int error, i; + unsigned sectsize; if (md_debug) printf("mdctlioctl(%s %lx %p %x %p)\n", @@ -1150,6 +1151,12 @@ xmdctlioctl(struct cdev *dev, u_long cmd default: return (EINVAL); } + if (mdio->md_sectorsize == 0) + sectsize = DEV_BSIZE; + else + sectsize = mdio->md_sectorsize; + if (sectsize > MAXPHYS || mdio->md_mediasize < sectsize) + return (EINVAL); if (mdio->md_options & MD_AUTOUNIT) sc = mdnew(-1, &error, mdio->md_type); else { @@ -1162,10 +1169,7 @@ xmdctlioctl(struct cdev *dev, u_long cmd if (mdio->md_options & MD_AUTOUNIT) mdio->md_unit = sc->unit; sc->mediasize = mdio->md_mediasize; - if (mdio->md_sectorsize == 0) - sc->sectorsize = DEV_BSIZE; - else - sc->sectorsize = mdio->md_sectorsize; + sc->sectorsize = sectsize; error = EDOOFUS; switch (sc->type) { case MD_MALLOC: From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 8 02:06:28 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1A64F43; Thu, 8 Nov 2012 02:06:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA5A98FC0A; Thu, 8 Nov 2012 02:06:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA826Rat054541; Thu, 8 Nov 2012 02:06:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA826RiN054539; Thu, 8 Nov 2012 02:06:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211080206.qA826RiN054539@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 8 Nov 2012 02:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242739 - stable/9/sys/dev/ti X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 02:06:28 -0000 Author: yongari Date: Thu Nov 8 02:06:27 2012 New Revision: 242739 URL: http://svnweb.freebsd.org/changeset/base/242739 Log: MFC r242425: Remove TCP/UDP checksum offloading feature for IP fragmented datagrams. Traditionally upper stack fragmented packets without computing TCP/UDP checksum and these datagrams were passed to driver. But there are chances that other packets slip into the interface queue in SMP world. If this happens firmware running on MIPS 4000 processor in the controller would see mixed packets and it shall send out corrupted packets. While I'm here simplify checksum offloading setup. Modified: stable/9/sys/dev/ti/if_ti.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ti/if_ti.c ============================================================================== --- stable/9/sys/dev/ti/if_ti.c Thu Nov 8 02:01:04 2012 (r242738) +++ stable/9/sys/dev/ti/if_ti.c Thu Nov 8 02:06:27 2012 (r242739) @@ -127,7 +127,7 @@ __FBSDID("$FreeBSD$"); #include -#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS) +#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) /* * We can only turn on header splitting if we're using extended receive * BDs. @@ -3083,16 +3083,10 @@ ti_encap(struct ti_softc *sc, struct mbu m = *m_head; csum_flags = 0; - if (m->m_pkthdr.csum_flags) { - if (m->m_pkthdr.csum_flags & CSUM_IP) - csum_flags |= TI_BDFLAG_IP_CKSUM; - if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) - csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; - if (m->m_flags & M_LASTFRAG) - csum_flags |= TI_BDFLAG_IP_FRAG_END; - else if (m->m_flags & M_FRAG) - csum_flags |= TI_BDFLAG_IP_FRAG; - } + if (m->m_pkthdr.csum_flags & CSUM_IP) + csum_flags |= TI_BDFLAG_IP_CKSUM; + if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) + csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; frag = sc->ti_tx_saved_prodidx; for (i = 0; i < nseg; i++) { From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 8 02:23:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29A1D832; Thu, 8 Nov 2012 02:23:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D0AC8FC0A; Thu, 8 Nov 2012 02:23:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA82Np5F090901; Thu, 8 Nov 2012 02:23:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA82Np45090899; Thu, 8 Nov 2012 02:23:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211080223.qA82Np45090899@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Nov 2012 02:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242741 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 02:23:52 -0000 Author: kib Date: Thu Nov 8 02:23:51 2012 New Revision: 242741 URL: http://svnweb.freebsd.org/changeset/base/242741 Log: MFC r242556: Order the enumeration of the MNT_ flags to be the same as the order of their definitions. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Thu Nov 8 02:08:42 2012 (r242740) +++ stable/9/sys/kern/vfs_subr.c Thu Nov 8 02:23:51 2012 (r242741) @@ -3018,11 +3018,11 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_SYNCHRONOUS); MNT_FLAG(MNT_NOEXEC); MNT_FLAG(MNT_NOSUID); + MNT_FLAG(MNT_NFS4ACLS); MNT_FLAG(MNT_UNION); MNT_FLAG(MNT_ASYNC); MNT_FLAG(MNT_SUIDDIR); MNT_FLAG(MNT_SOFTDEP); - MNT_FLAG(MNT_SUJ); MNT_FLAG(MNT_NOSYMFOLLOW); MNT_FLAG(MNT_GJOURNAL); MNT_FLAG(MNT_MULTILABEL); @@ -3030,7 +3030,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_NOATIME); MNT_FLAG(MNT_NOCLUSTERR); MNT_FLAG(MNT_NOCLUSTERW); - MNT_FLAG(MNT_NFS4ACLS); + MNT_FLAG(MNT_SUJ); MNT_FLAG(MNT_EXRDONLY); MNT_FLAG(MNT_EXPORTED); MNT_FLAG(MNT_DEFEXPORTED); From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 8 02:29:16 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEDF39FB; Thu, 8 Nov 2012 02:29:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 991198FC0C; Thu, 8 Nov 2012 02:29:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA82TGqA002899; Thu, 8 Nov 2012 02:29:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA82TGnX002894; Thu, 8 Nov 2012 02:29:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211080229.qA82TGnX002894@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Nov 2012 02:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242742 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 02:29:17 -0000 Author: kib Date: Thu Nov 8 02:29:16 2012 New Revision: 242742 URL: http://svnweb.freebsd.org/changeset/base/242742 Log: MFC r242559: Add decoding of the missed VI_ and VV_ flags to ddb "show vnode" command. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Thu Nov 8 02:23:51 2012 (r242741) +++ stable/9/sys/kern/vfs_subr.c Thu Nov 8 02:29:16 2012 (r242742) @@ -2878,6 +2878,8 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VV_ISTTY", sizeof(buf)); if (vp->v_vflag & VV_NOSYNC) strlcat(buf, "|VV_NOSYNC", sizeof(buf)); + if (vp->v_vflag & VV_ETERNALDEV) + strlcat(buf, "|VV_ETERNALDEV", sizeof(buf)); if (vp->v_vflag & VV_CACHEDLABEL) strlcat(buf, "|VV_CACHEDLABEL", sizeof(buf)); if (vp->v_vflag & VV_TEXT) @@ -2894,9 +2896,11 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VV_DELETED", sizeof(buf)); if (vp->v_vflag & VV_MD) strlcat(buf, "|VV_MD", sizeof(buf)); - flags = vp->v_vflag & ~(VV_ROOT | VV_ISTTY | VV_NOSYNC | + if (vp->v_vflag & VV_FORCEINSMQ) + strlcat(buf, "|VV_FORCEINSMQ", sizeof(buf)); + flags = vp->v_vflag & ~(VV_ROOT | VV_ISTTY | VV_NOSYNC | VV_ETERNALDEV | VV_CACHEDLABEL | VV_TEXT | VV_COPYONWRITE | VV_SYSTEM | VV_PROCDEP | - VV_NOKNOTE | VV_DELETED | VV_MD); + VV_NOKNOTE | VV_DELETED | VV_MD | VV_FORCEINSMQ); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VV(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); @@ -2909,12 +2913,14 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VI_DOOMED", sizeof(buf)); if (vp->v_iflag & VI_FREE) strlcat(buf, "|VI_FREE", sizeof(buf)); + if (vp->v_iflag & VI_ACTIVE) + strlcat(buf, "|VI_ACTIVE", sizeof(buf)); if (vp->v_iflag & VI_DOINGINACT) strlcat(buf, "|VI_DOINGINACT", sizeof(buf)); if (vp->v_iflag & VI_OWEINACT) strlcat(buf, "|VI_OWEINACT", sizeof(buf)); flags = vp->v_iflag & ~(VI_MOUNT | VI_AGE | VI_DOOMED | VI_FREE | - VI_DOINGINACT | VI_OWEINACT); + VI_ACTIVE | VI_DOINGINACT | VI_OWEINACT); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VI(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 8 13:40:46 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C27FE2A1; Thu, 8 Nov 2012 13:40:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A72718FC0C; Thu, 8 Nov 2012 13:40:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8DekjC082301; Thu, 8 Nov 2012 13:40:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8DekYp082300; Thu, 8 Nov 2012 13:40:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211081340.qA8DekYp082300@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 8 Nov 2012 13:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242768 - stable/9/lib/libc/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:40:46 -0000 Author: jilles Date: Thu Nov 8 13:40:46 2012 New Revision: 242768 URL: http://svnweb.freebsd.org/changeset/base/242768 Log: MFC r242429: fcntl(2): Fix typos in name of constant "F_DUP2FD_CLOEXEC". Modified: stable/9/lib/libc/sys/fcntl.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/fcntl.2 ============================================================================== --- stable/9/lib/libc/sys/fcntl.2 Thu Nov 8 13:36:19 2012 (r242767) +++ stable/9/lib/libc/sys/fcntl.2 Thu Nov 8 13:40:46 2012 (r242768) @@ -94,7 +94,7 @@ It is functionally equivalent to .Bd -literal -offset indent dup2(fd, arg) .Ed -.It Dv F_DU2PFD_CLOEXEC +.It Dv F_DUP2FD_CLOEXEC Like .Dv F_DUP2FD , but the @@ -104,7 +104,7 @@ flag associated with the new file descri The .Dv F_DUP2FD and -.Dv F_DUP2DF_CLOEXEC +.Dv F_DUP2FD_CLOEXEC constants are not portable, so they should not be used if portability is needed. Use From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 8 13:47:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 963F09E8; Thu, 8 Nov 2012 13:47:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 77FC18FC0A; Thu, 8 Nov 2012 13:47:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8DlWUC083955; Thu, 8 Nov 2012 13:47:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8DlWLq083954; Thu, 8 Nov 2012 13:47:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211081347.qA8DlWLq083954@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 8 Nov 2012 13:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242771 - stable/9/lib/libc/stdio X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:47:32 -0000 Author: jilles Date: Thu Nov 8 13:47:32 2012 New Revision: 242771 URL: http://svnweb.freebsd.org/changeset/base/242771 Log: MFC r242460: fopen(3): Mention that the "x" mode option is from C11. Modified: stable/9/lib/libc/stdio/fopen.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/fopen.3 ============================================================================== --- stable/9/lib/libc/stdio/fopen.3 Thu Nov 8 13:43:20 2012 (r242770) +++ stable/9/lib/libc/stdio/fopen.3 Thu Nov 8 13:47:32 2012 (r242771) @@ -267,7 +267,11 @@ and .Fn freopen functions conform to -.St -isoC . +.St -isoC , +with the exception of the +.Dq Li x +mode option which conforms to +.St -isoC-2011 . The .Fn fdopen function From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 8 16:04:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEB46288; Thu, 8 Nov 2012 16:04:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93BC78FC0A; Thu, 8 Nov 2012 16:04:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8G4W8s006875; Thu, 8 Nov 2012 16:04:32 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8G4WV5006871; Thu, 8 Nov 2012 16:04:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211081604.qA8G4WV5006871@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 8 Nov 2012 16:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242774 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 16:04:32 -0000 Author: hselasky Date: Thu Nov 8 16:04:32 2012 New Revision: 242774 URL: http://svnweb.freebsd.org/changeset/base/242774 Log: MFC r238551 and r239617: Add support for Intel Panther/Lynx Point XHCI port routing. Modified: stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/controller/xhci.h stable/9/sys/dev/usb/controller/xhci_pci.c stable/9/sys/dev/usb/controller/xhcireg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Nov 8 13:50:33 2012 (r242773) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Nov 8 16:04:32 2012 (r242774) @@ -84,14 +84,17 @@ __FBSDID("$FreeBSD$"); ((uint8_t *)&(((struct xhci_softc *)0)->sc_bus)))) #ifdef USB_DEBUG -static int xhcidebug = 0; +static int xhcidebug; +static int xhciroute; SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, &xhcidebug, 0, "Debug level"); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW, + &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); - +TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); #endif #define XHCI_INTR_ENDPT 1 @@ -177,6 +180,16 @@ xhci_dump_device(struct xhci_softc *sc, } #endif +uint32_t +xhci_get_port_route(void) +{ +#ifdef USB_DEBUG + return (0xFFFFFFFFU ^ ((uint32_t)xhciroute)); +#else + return (0xFFFFFFFFU); +#endif +} + static void xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) { Modified: stable/9/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.h Thu Nov 8 13:50:33 2012 (r242773) +++ stable/9/sys/dev/usb/controller/xhci.h Thu Nov 8 16:04:32 2012 (r242774) @@ -490,6 +490,7 @@ struct xhci_softc { /* prototypes */ +uint32_t xhci_get_port_route(void); usb_error_t xhci_halt_controller(struct xhci_softc *); usb_error_t xhci_init(struct xhci_softc *, device_t); usb_error_t xhci_start_controller(struct xhci_softc *); Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Thu Nov 8 13:50:33 2012 (r242773) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Thu Nov 8 16:04:32 2012 (r242774) @@ -101,6 +101,8 @@ xhci_pci_match(device_t self) case 0x1e318086: return ("Intel Panther Point USB 3.0 controller"); + case 0x8c318086: + return ("Intel Lynx Point USB 3.0 controller"); default: break; @@ -245,6 +247,7 @@ static int xhci_pci_take_controller(device_t self) { struct xhci_softc *sc = device_get_softc(self); + uint32_t device_id = pci_get_devid(self); uint32_t cparams; uint32_t eecp; uint32_t eec; @@ -285,5 +288,13 @@ xhci_pci_take_controller(device_t self) usb_pause_mtx(NULL, hz / 100); /* wait 10ms */ } } + + /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ + if (device_id == 0x1e318086 /* Panther Point */ || + device_id == 0x8c318086 /* Lynx Point */) { + uint32_t temp = xhci_get_port_route(); + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); + } return (0); } Modified: stable/9/sys/dev/usb/controller/xhcireg.h ============================================================================== --- stable/9/sys/dev/usb/controller/xhcireg.h Thu Nov 8 13:50:33 2012 (r242773) +++ stable/9/sys/dev/usb/controller/xhcireg.h Thu Nov 8 16:04:32 2012 (r242774) @@ -34,6 +34,9 @@ #define PCI_USB_REV_3_0 0x30 /* USB 3.0 */ #define PCI_XHCI_FLADJ 0x61 /* RW frame length adjust */ +#define PCI_XHCI_INTEL_XUSB2PR 0xD0 /* Intel USB2 Port Routing */ +#define PCI_XHCI_INTEL_USB3_PSSEN 0xD8 /* Intel USB3 Port SuperSpeed Enable */ + /* XHCI capability registers */ #define XHCI_CAPLENGTH 0x00 /* RO capability */ #define XHCI_RESERVED 0x01 /* Reserved */ From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 8 16:13:53 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09531665; Thu, 8 Nov 2012 16:13:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF3628FC12; Thu, 8 Nov 2012 16:13:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8GDq4n008462; Thu, 8 Nov 2012 16:13:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8GDqM0008439; Thu, 8 Nov 2012 16:13:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211081613.qA8GDqM0008439@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 8 Nov 2012 16:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242775 - in stable/9/sys/dev/usb: . controller input serial storage wlan X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 16:13:53 -0000 Author: hselasky Date: Thu Nov 8 16:13:51 2012 New Revision: 242775 URL: http://svnweb.freebsd.org/changeset/base/242775 Log: MFC r240750, r241987 and r242126: Add missing CTLFLAG_TUN flag to tunable sysctls in the USB stack. Adjust timing parameters of FULL/LOW/HIGH speed USB enumeration and make these timing parameters tunable. This patch will fix enumeration with some USB devices. Fix a typo. Modified: stable/9/sys/dev/usb/controller/ehci.c stable/9/sys/dev/usb/controller/ohci.c stable/9/sys/dev/usb/controller/uhci.c stable/9/sys/dev/usb/controller/usb_controller.c stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/input/ukbd.c stable/9/sys/dev/usb/serial/usb_serial.c stable/9/sys/dev/usb/storage/umass.c stable/9/sys/dev/usb/usb.h stable/9/sys/dev/usb/usb_debug.c stable/9/sys/dev/usb/usb_debug.h stable/9/sys/dev/usb/usb_dev.c stable/9/sys/dev/usb/usb_device.c stable/9/sys/dev/usb/usb_generic.c stable/9/sys/dev/usb/usb_hub.c stable/9/sys/dev/usb/usb_process.c stable/9/sys/dev/usb/usb_request.c stable/9/sys/dev/usb/wlan/if_uath.c stable/9/sys/dev/usb/wlan/if_upgt.c stable/9/sys/dev/usb/wlan/if_urtw.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/ehci.c Thu Nov 8 16:13:51 2012 (r242775) @@ -95,20 +95,20 @@ static int ehciiaadbug = 0; static int ehcilostintrbug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ehcidebug, 0, "Debug level"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW, - &ehcinohighspeed, 0, "Disable High Speed USB"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW, - &ehciiaadbug, 0, "Enable doorbell bug workaround"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW, - &ehcilostintrbug, 0, "Enable lost interrupt bug workaround"); - TUNABLE_INT("hw.usb.ehci.debug", &ehcidebug); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW | CTLFLAG_TUN, + &ehcinohighspeed, 0, "Disable High Speed USB"); TUNABLE_INT("hw.usb.ehci.no_hs", &ehcinohighspeed); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW | CTLFLAG_TUN, + &ehciiaadbug, 0, "Enable doorbell bug workaround"); TUNABLE_INT("hw.usb.ehci.iaadbug", &ehciiaadbug); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW | CTLFLAG_TUN, + &ehcilostintrbug, 0, "Enable lost interrupt bug workaround"); TUNABLE_INT("hw.usb.ehci.lostintrbug", &ehcilostintrbug); + static void ehci_dump_regs(ehci_softc_t *sc); static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh); @@ -3369,7 +3369,7 @@ ehci_roothub_exec(struct usb_device *ude /* Wait for reset to complete. */ usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_root_reset_delay)); /* Terminate reset sequence. */ if (!(sc->sc_flags & EHCI_SCFLG_NORESTERM)) Modified: stable/9/sys/dev/usb/controller/ohci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ohci.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/ohci.c Thu Nov 8 16:13:51 2012 (r242775) @@ -81,9 +81,8 @@ __FBSDID("$FreeBSD$"); static int ohcidebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); -SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ohcidebug, 0, "ohci debug level"); - TUNABLE_INT("hw.usb.ohci.debug", &ohcidebug); static void ohci_dumpregs(ohci_softc_t *); @@ -2344,7 +2343,7 @@ ohci_roothub_exec(struct usb_device *ude for (v = 0;; v++) { if (v < 12) { usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_root_reset_delay)); if ((OREAD4(sc, port) & UPS_RESET) == 0) { break; Modified: stable/9/sys/dev/usb/controller/uhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/uhci.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/uhci.c Thu Nov 8 16:13:51 2012 (r242775) @@ -86,12 +86,11 @@ static int uhcidebug = 0; static int uhcinoloop = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, "USB uhci"); -SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uhcidebug, 0, "uhci debug level"); -SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW, - &uhcinoloop, 0, "uhci noloop"); - TUNABLE_INT("hw.usb.uhci.debug", &uhcidebug); +SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW | CTLFLAG_TUN, + &uhcinoloop, 0, "uhci noloop"); TUNABLE_INT("hw.usb.uhci.loop", &uhcinoloop); static void uhci_dumpregs(uhci_softc_t *sc); @@ -2393,7 +2392,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_ UWRITE2(sc, port, x | UHCI_PORTSC_PR); usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_root_reset_delay)); DPRINTFN(4, "uhci port %d reset, status0 = 0x%04x\n", index, UREAD2(sc, port)); @@ -2421,7 +2420,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_ for (lim = 0; lim < 12; lim++) { usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_reset_delay)); x = UREAD2(sc, port); Modified: stable/9/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/9/sys/dev/usb/controller/usb_controller.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/usb_controller.c Thu Nov 8 16:13:51 2012 (r242775) @@ -86,7 +86,7 @@ SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug static int usb_no_boot_wait = 0; TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); -SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, +SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RD|CTLFLAG_TUN, &usb_no_boot_wait, 0, "No USB device enumerate waiting at boot."); static int usb_no_suspend_wait = 0; Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Nov 8 16:13:51 2012 (r242775) @@ -88,12 +88,11 @@ static int xhcidebug; static int xhciroute; SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &xhcidebug, 0, "Debug level"); -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW, - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); - TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, + &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); #endif Modified: stable/9/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/9/sys/dev/usb/input/ukbd.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/input/ukbd.c Thu Nov 8 16:13:51 2012 (r242775) @@ -94,12 +94,11 @@ static int ukbd_debug = 0; static int ukbd_no_leds = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB ukbd"); -SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ukbd_debug, 0, "Debug level"); -SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW, - &ukbd_no_leds, 0, "Disables setting of keyboard leds"); - TUNABLE_INT("hw.usb.ukbd.debug", &ukbd_debug); +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW | CTLFLAG_TUN, + &ukbd_no_leds, 0, "Disables setting of keyboard leds"); TUNABLE_INT("hw.usb.ukbd.no_leds", &ukbd_no_leds); #endif Modified: stable/9/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/9/sys/dev/usb/serial/usb_serial.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/serial/usb_serial.c Thu Nov 8 16:13:51 2012 (r242775) @@ -127,13 +127,13 @@ static int ucom_cons_baud = 9600; static struct ucom_softc *ucom_cons_softc = NULL; TUNABLE_INT("hw.usb.ucom.cons_unit", &ucom_cons_unit); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW | CTLFLAG_TUN, &ucom_cons_unit, 0, "console unit number"); TUNABLE_INT("hw.usb.ucom.cons_subunit", &ucom_cons_subunit); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RW | CTLFLAG_TUN, &ucom_cons_subunit, 0, "console subunit number"); TUNABLE_INT("hw.usb.ucom.cons_baud", &ucom_cons_baud); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW | CTLFLAG_TUN, &ucom_cons_baud, 0, "console baud rate"); static usb_proc_callback_t ucom_cfg_start_transfers; Modified: stable/9/sys/dev/usb/storage/umass.c ============================================================================== --- stable/9/sys/dev/usb/storage/umass.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/storage/umass.c Thu Nov 8 16:13:51 2012 (r242775) @@ -166,9 +166,8 @@ __FBSDID("$FreeBSD$"); static int umass_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass"); -SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &umass_debug, 0, "umass debug level"); - TUNABLE_INT("hw.usb.umass.debug", &umass_debug); #else #define DIF(...) do { } while (0) Modified: stable/9/sys/dev/usb/usb.h ============================================================================== --- stable/9/sys/dev/usb/usb.h Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb.h Thu Nov 8 16:13:51 2012 (r242775) @@ -93,31 +93,29 @@ MALLOC_DECLARE(M_USBHC); #define USB_POWER_MODE_SUSPEND 3 /* force suspend */ #define USB_POWER_MODE_RESUME 4 /* force resume */ -#if 0 /* These are the values from the USB specification. */ -#define USB_PORT_RESET_DELAY 10 /* ms */ -#define USB_PORT_ROOT_RESET_DELAY 50 /* ms */ -#define USB_PORT_RESET_RECOVERY 10 /* ms */ -#define USB_PORT_POWERUP_DELAY 100 /* ms */ -#define USB_PORT_RESUME_DELAY 20 /* ms */ -#define USB_SET_ADDRESS_SETTLE 2 /* ms */ -#define USB_RESUME_DELAY (20*5) /* ms */ -#define USB_RESUME_WAIT 10 /* ms */ -#define USB_RESUME_RECOVERY 10 /* ms */ -#define USB_EXTRA_POWER_UP_TIME 0 /* ms */ -#else +#define USB_PORT_RESET_DELAY_SPEC 10 /* ms */ +#define USB_PORT_ROOT_RESET_DELAY_SPEC 50 /* ms */ +#define USB_PORT_RESET_RECOVERY_SPEC 10 /* ms */ +#define USB_PORT_POWERUP_DELAY_SPEC 100 /* ms */ +#define USB_PORT_RESUME_DELAY_SPEC 20 /* ms */ +#define USB_SET_ADDRESS_SETTLE_SPEC 2 /* ms */ +#define USB_RESUME_DELAY_SPEC (20*5) /* ms */ +#define USB_RESUME_WAIT_SPEC 10 /* ms */ +#define USB_RESUME_RECOVERY_SPEC 10 /* ms */ +#define USB_EXTRA_POWER_UP_TIME_SPEC 0 /* ms */ + /* Allow for marginal and non-conforming devices. */ -#define USB_PORT_RESET_DELAY 50 /* ms */ -#define USB_PORT_ROOT_RESET_DELAY 250 /* ms */ -#define USB_PORT_RESET_RECOVERY 250 /* ms */ -#define USB_PORT_POWERUP_DELAY 300 /* ms */ -#define USB_PORT_RESUME_DELAY (20*2) /* ms */ -#define USB_SET_ADDRESS_SETTLE 10 /* ms */ -#define USB_RESUME_DELAY (50*5) /* ms */ -#define USB_RESUME_WAIT 50 /* ms */ -#define USB_RESUME_RECOVERY 50 /* ms */ -#define USB_EXTRA_POWER_UP_TIME 20 /* ms */ -#endif +#define USB_PORT_RESET_DELAY 50 /* ms */ +#define USB_PORT_ROOT_RESET_DELAY 250 /* ms */ +#define USB_PORT_RESET_RECOVERY 250 /* ms */ +#define USB_PORT_POWERUP_DELAY 300 /* ms */ +#define USB_PORT_RESUME_DELAY (20*2) /* ms */ +#define USB_SET_ADDRESS_SETTLE 10 /* ms */ +#define USB_RESUME_DELAY (50*5) /* ms */ +#define USB_RESUME_WAIT 50 /* ms */ +#define USB_RESUME_RECOVERY 50 /* ms */ +#define USB_EXTRA_POWER_UP_TIME 20 /* ms */ #define USB_MIN_POWER 100 /* mA */ #define USB_MAX_POWER 500 /* mA */ Modified: stable/9/sys/dev/usb/usb_debug.c ============================================================================== --- stable/9/sys/dev/usb/usb_debug.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_debug.c Thu Nov 8 16:13:51 2012 (r242775) @@ -63,11 +63,59 @@ int usb_debug = 0; SYSCTL_NODE(_hw, OID_AUTO, usb, CTLFLAG_RW, 0, "USB debugging"); -SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.debug", &usb_debug); +#ifdef USB_DEBUG +/* + * Sysctls to modify timings/delays + */ +static SYSCTL_NODE(_hw_usb, OID_AUTO, timings, CTLFLAG_RW, 0, "Timings"); +static int usb_timings_sysctl_handler(SYSCTL_HANDLER_ARGS); + +TUNABLE_INT("hw.usb.timings.port_reset_delay", (int *)&usb_port_reset_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_reset_delay, sizeof(usb_port_reset_delay), + usb_timings_sysctl_handler, "IU", "Port Reset Delay"); +TUNABLE_INT("hw.usb.timings.port_root_reset_delay", (int *)&usb_port_root_reset_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_root_reset_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_root_reset_delay, sizeof(usb_port_root_reset_delay), + usb_timings_sysctl_handler, "IU", "Root Port Reset Delay"); +TUNABLE_INT("hw.usb.timings.port_reset_recovery", (int *)&usb_port_reset_recovery); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_recovery, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_reset_recovery, sizeof(usb_port_reset_recovery), + usb_timings_sysctl_handler, "IU", "Port Reset Recovery"); +TUNABLE_INT("hw.usb.timings.port_powerup_delay", (int *)&usb_port_powerup_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_powerup_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_powerup_delay, sizeof(usb_port_powerup_delay), + usb_timings_sysctl_handler, "IU", "Port PowerUp Delay"); +TUNABLE_INT("hw.usb.timings.port_resume_delay", (int *)&usb_port_resume_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_resume_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_resume_delay, sizeof(usb_port_resume_delay), + usb_timings_sysctl_handler, "IU", "Port Resume Delay"); +TUNABLE_INT("hw.usb.timings.set_address_settle", (int *)&usb_set_address_settle); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, set_address_settle, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_set_address_settle, sizeof(usb_set_address_settle), + usb_timings_sysctl_handler, "IU", "Set Address Settle"); +TUNABLE_INT("hw.usb.timings.resume_delay", (int *)&usb_resume_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_resume_delay, sizeof(usb_resume_delay), + usb_timings_sysctl_handler, "IU", "Resume Delay"); +TUNABLE_INT("hw.usb.timings.resume_wait", (int *)&usb_resume_wait); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_wait, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_resume_wait, sizeof(usb_resume_wait), + usb_timings_sysctl_handler, "IU", "Resume Wait"); +TUNABLE_INT("hw.usb.timings.resume_recovery", (int *)&usb_resume_recovery); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_recovery, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_resume_recovery, sizeof(usb_resume_recovery), + usb_timings_sysctl_handler, "IU", "Resume Recovery"); +TUNABLE_INT("hw.usb.timings.extra_power_up_time", (int *)&usb_extra_power_up_time); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, extra_power_up_time, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_extra_power_up_time, sizeof(usb_extra_power_up_time), + usb_timings_sysctl_handler, "IU", "Extra PowerUp Time"); +#endif + /*------------------------------------------------------------------------* * usb_dump_iface * @@ -174,3 +222,87 @@ usb_dump_xfer(struct usb_xfer *xfer) xfer->endpoint->edesc->bEndpointAddress, xfer->endpoint->edesc->bmAttributes); } + +#ifdef USB_DEBUG +unsigned int usb_port_reset_delay = USB_PORT_RESET_DELAY; +unsigned int usb_port_root_reset_delay = USB_PORT_ROOT_RESET_DELAY; +unsigned int usb_port_reset_recovery = USB_PORT_RESET_RECOVERY; +unsigned int usb_port_powerup_delay = USB_PORT_POWERUP_DELAY; +unsigned int usb_port_resume_delay = USB_PORT_RESUME_DELAY; +unsigned int usb_set_address_settle = USB_SET_ADDRESS_SETTLE; +unsigned int usb_resume_delay = USB_RESUME_DELAY; +unsigned int usb_resume_wait = USB_RESUME_WAIT; +unsigned int usb_resume_recovery = USB_RESUME_RECOVERY; +unsigned int usb_extra_power_up_time = USB_EXTRA_POWER_UP_TIME; + +/*------------------------------------------------------------------------* + * usb_timings_sysctl_handler + * + * This function updates timings variables, adjusting them where necessary. + *------------------------------------------------------------------------*/ +static int usb_timings_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + int error = 0; + unsigned int val; + + /* + * Attempt to get a coherent snapshot by making a copy of the data. + */ + if (arg1) + val = *(unsigned int *)arg1; + else + val = arg2; + error = SYSCTL_OUT(req, &val, sizeof(int)); + if (error || !req->newptr) + return (error); + + if (!arg1) + return EPERM; + + error = SYSCTL_IN(req, &val, sizeof(unsigned int)); + if (error) + return (error); + + /* + * Now make sure the values are decent, and certainly no lower than + * what the USB spec prescribes. + */ + unsigned int *p = (unsigned int *)arg1; + if (p == &usb_port_reset_delay) { + if (val < USB_PORT_RESET_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_port_root_reset_delay) { + if (val < USB_PORT_ROOT_RESET_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_port_reset_recovery) { + if (val < USB_PORT_RESET_RECOVERY_SPEC) + return (EINVAL); + } else if (p == &usb_port_powerup_delay) { + if (val < USB_PORT_POWERUP_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_port_resume_delay) { + if (val < USB_PORT_RESUME_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_set_address_settle) { + if (val < USB_SET_ADDRESS_SETTLE_SPEC) + return (EINVAL); + } else if (p == &usb_resume_delay) { + if (val < USB_RESUME_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_resume_wait) { + if (val < USB_RESUME_WAIT_SPEC) + return (EINVAL); + } else if (p == &usb_resume_recovery) { + if (val < USB_RESUME_RECOVERY_SPEC) + return (EINVAL); + } else if (p == &usb_extra_power_up_time) { + if (val < USB_EXTRA_POWER_UP_TIME_SPEC) + return (EINVAL); + } else { + /* noop */ + } + + *p = val; + return 0; +} +#endif Modified: stable/9/sys/dev/usb/usb_debug.h ============================================================================== --- stable/9/sys/dev/usb/usb_debug.h Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_debug.h Thu Nov 8 16:13:51 2012 (r242775) @@ -59,4 +59,28 @@ void usb_dump_queue(struct usb_endpoint void usb_dump_endpoint(struct usb_endpoint *ep); void usb_dump_xfer(struct usb_xfer *xfer); +#ifdef USB_DEBUG +extern unsigned int usb_port_reset_delay; +extern unsigned int usb_port_root_reset_delay; +extern unsigned int usb_port_reset_recovery; +extern unsigned int usb_port_powerup_delay; +extern unsigned int usb_port_resume_delay; +extern unsigned int usb_set_address_settle; +extern unsigned int usb_resume_delay; +extern unsigned int usb_resume_wait; +extern unsigned int usb_resume_recovery; +extern unsigned int usb_extra_power_up_time; +#else +#define usb_port_reset_delay USB_PORT_RESET_DELAY +#define usb_port_root_reset_delay USB_PORT_ROOT_RESET_DELAY +#define usb_port_reset_recovery USB_PORT_RESET_RECOVERY +#define usb_port_powerup_delay USB_PORT_POWERUP_DELAY +#define usb_port_resume_delay USB_PORT_RESUME_DELAY +#define usb_set_address_settle USB_SET_ADDRESS_SETTLE +#define usb_resume_delay USB_RESUME_DELAY +#define usb_resume_wait USB_RESUME_WAIT +#define usb_resume_recovery USB_RESUME_RECOVERY +#define usb_extra_power_up_time USB_EXTRA_POWER_UP_TIME +#endif + #endif /* _USB_DEBUG_H_ */ Modified: stable/9/sys/dev/usb/usb_dev.c ============================================================================== --- stable/9/sys/dev/usb/usb_dev.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_dev.c Thu Nov 8 16:13:51 2012 (r242775) @@ -82,9 +82,8 @@ static int usb_fifo_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, dev, CTLFLAG_RW, 0, "USB device"); -SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_fifo_debug, 0, "Debug Level"); - TUNABLE_INT("hw.usb.dev.debug", &usb_fifo_debug); #endif Modified: stable/9/sys/dev/usb/usb_device.c ============================================================================== --- stable/9/sys/dev/usb/usb_device.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_device.c Thu Nov 8 16:13:51 2012 (r242775) @@ -111,7 +111,7 @@ static void usb_cdev_free(struct usb_dev int usb_template = 0; TUNABLE_INT("hw.usb.usb_template", &usb_template); -SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW | CTLFLAG_TUN, &usb_template, 0, "Selected USB device side template"); /* English is default language */ @@ -120,11 +120,11 @@ static int usb_lang_id = 0x0009; static int usb_lang_mask = 0x00FF; TUNABLE_INT("hw.usb.usb_lang_id", &usb_lang_id); -SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_id, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_id, CTLFLAG_RW | CTLFLAG_TUN, &usb_lang_id, 0, "Preferred USB language ID"); TUNABLE_INT("hw.usb.usb_lang_mask", &usb_lang_mask); -SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_mask, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_mask, CTLFLAG_RW | CTLFLAG_TUN, &usb_lang_mask, 0, "Preferred USB language mask"); static const char* statestr[USB_STATE_MAX] = { Modified: stable/9/sys/dev/usb/usb_generic.c ============================================================================== --- stable/9/sys/dev/usb/usb_generic.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_generic.c Thu Nov 8 16:13:51 2012 (r242775) @@ -127,9 +127,8 @@ struct usb_fifo_methods usb_ugen_methods static int ugen_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ugen, CTLFLAG_RW, 0, "USB generic"); -SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW, &ugen_debug, +SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ugen_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.ugen.debug", &ugen_debug); #endif Modified: stable/9/sys/dev/usb/usb_hub.c ============================================================================== --- stable/9/sys/dev/usb/usb_hub.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_hub.c Thu Nov 8 16:13:51 2012 (r242775) @@ -77,9 +77,8 @@ static int uhub_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uhub, CTLFLAG_RW, 0, "USB HUB"); -SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW, &uhub_debug, 0, +SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uhub_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.uhub.debug", &uhub_debug); #endif @@ -415,7 +414,7 @@ repeat: /* wait for maximum device power up time */ usb_pause_mtx(NULL, - USB_MS_TO_TICKS(USB_PORT_POWERUP_DELAY)); + USB_MS_TO_TICKS(usb_port_powerup_delay)); /* reset port, which implies enabling it */ @@ -979,7 +978,7 @@ uhub_attach(device_t dev) /* get power delay */ pwrdly = ((hubdesc20.bPwrOn2PwrGood * UHD_PWRON_FACTOR) + - USB_EXTRA_POWER_UP_TIME); + usb_extra_power_up_time); /* get complete HUB descriptor */ if (nports >= 8) { @@ -1024,7 +1023,7 @@ uhub_attach(device_t dev) /* get power delay */ pwrdly = ((hubdesc30.bPwrOn2PwrGood * UHD_PWRON_FACTOR) + - USB_EXTRA_POWER_UP_TIME); + usb_extra_power_up_time); /* get complete HUB descriptor */ if (nports >= 8) { @@ -1053,7 +1052,7 @@ uhub_attach(device_t dev) /* default number of ports */ nports = 1; /* default power delay */ - pwrdly = ((10 * UHD_PWRON_FACTOR) + USB_EXTRA_POWER_UP_TIME); + pwrdly = ((10 * UHD_PWRON_FACTOR) + usb_extra_power_up_time); break; } if (nports == 0) { @@ -2261,7 +2260,7 @@ usb_dev_resume_peer(struct usb_device *u } /* resume settle time */ - usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); + usb_pause_mtx(NULL, USB_MS_TO_TICKS(usb_port_resume_delay)); if (bus->methods->device_resume != NULL) { /* resume USB device on the USB controller */ @@ -2414,7 +2413,7 @@ repeat: NULL, udev->port_no, UHF_PORT_SUSPEND); /* resume settle time */ - usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); + usb_pause_mtx(NULL, USB_MS_TO_TICKS(usb_port_resume_delay)); } DPRINTF("Suspend was cancelled!\n"); return; Modified: stable/9/sys/dev/usb/usb_process.c ============================================================================== --- stable/9/sys/dev/usb/usb_process.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_process.c Thu Nov 8 16:13:51 2012 (r242775) @@ -82,9 +82,8 @@ static int usb_pcount; static int usb_proc_debug; SYSCTL_NODE(_hw_usb, OID_AUTO, proc, CTLFLAG_RW, 0, "USB process"); -SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RW, &usb_proc_debug, 0, +SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_proc_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.proc.debug", &usb_proc_debug); #endif Modified: stable/9/sys/dev/usb/usb_request.c ============================================================================== --- stable/9/sys/dev/usb/usb_request.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_request.c Thu Nov 8 16:13:51 2012 (r242775) @@ -73,21 +73,13 @@ SYSCTL_INT(_hw_usb, OID_AUTO, no_cs_fail &usb_no_cs_fail, 0, "USB clear stall failures are ignored, if set"); #ifdef USB_DEBUG -static int usb_pr_poll_delay = USB_PORT_RESET_DELAY; -static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY; - -SYSCTL_INT(_hw_usb, OID_AUTO, pr_poll_delay, CTLFLAG_RW, - &usb_pr_poll_delay, 0, "USB port reset poll delay in ms"); -SYSCTL_INT(_hw_usb, OID_AUTO, pr_recovery_delay, CTLFLAG_RW, - &usb_pr_recovery_delay, 0, "USB port reset recovery delay in ms"); - #ifdef USB_REQ_DEBUG /* The following structures are used in connection to fault injection. */ struct usb_ctrl_debug { int bus_index; /* target bus */ int dev_index; /* target address */ int ds_fail; /* fail data stage */ - int ss_fail; /* fail data stage */ + int ss_fail; /* fail status stage */ int ds_delay; /* data stage delay in ms */ int ss_delay; /* status stage delay in ms */ int bmRequestType_value; @@ -788,12 +780,6 @@ usbd_req_reset_port(struct usb_device *u uint16_t status; uint16_t change; -#ifdef USB_DEBUG - uint16_t pr_poll_delay; - uint16_t pr_recovery_delay; - -#endif - DPRINTF("\n"); /* clear any leftover port reset changes first */ @@ -808,29 +794,12 @@ usbd_req_reset_port(struct usb_device *u if (err) goto done; #ifdef USB_DEBUG - /* range check input parameters */ - pr_poll_delay = usb_pr_poll_delay; - if (pr_poll_delay < 1) { - pr_poll_delay = 1; - } else if (pr_poll_delay > 1000) { - pr_poll_delay = 1000; - } - pr_recovery_delay = usb_pr_recovery_delay; - if (pr_recovery_delay > 1000) { - pr_recovery_delay = 1000; - } #endif n = 0; while (1) { -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); - n += pr_poll_delay; -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); - n += USB_PORT_RESET_DELAY; -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_delay)); + n += usb_port_reset_delay; err = usbd_req_get_port_status(udev, mtx, &ps, port); if (err) goto done; @@ -872,13 +841,8 @@ usbd_req_reset_port(struct usb_device *u err = USB_ERR_TIMEOUT; goto done; } -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay)); -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_RECOVERY)); -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_recovery)); done: DPRINTFN(2, "port %d reset returning error=%s\n", @@ -909,12 +873,6 @@ usbd_req_warm_reset_port(struct usb_devi uint16_t status; uint16_t change; -#ifdef USB_DEBUG - uint16_t pr_poll_delay; - uint16_t pr_recovery_delay; - -#endif - DPRINTF("\n"); err = usbd_req_get_port_status(udev, mtx, &ps, port); @@ -944,30 +902,11 @@ usbd_req_warm_reset_port(struct usb_devi if (err) goto done; -#ifdef USB_DEBUG - /* range check input parameters */ - pr_poll_delay = usb_pr_poll_delay; - if (pr_poll_delay < 1) { - pr_poll_delay = 1; - } else if (pr_poll_delay > 1000) { - pr_poll_delay = 1000; - } - pr_recovery_delay = usb_pr_recovery_delay; - if (pr_recovery_delay > 1000) { - pr_recovery_delay = 1000; - } -#endif n = 0; while (1) { -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); - n += pr_poll_delay; -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); - n += USB_PORT_RESET_DELAY; -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_delay)); + n += usb_port_reset_delay; err = usbd_req_get_port_status(udev, mtx, &ps, port); if (err) goto done; @@ -1001,13 +940,8 @@ usbd_req_warm_reset_port(struct usb_devi err = USB_ERR_TIMEOUT; goto done; } -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay)); -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_RECOVERY)); -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_recovery)); done: DPRINTFN(2, "port %d warm reset returning error=%s\n", @@ -1566,7 +1500,7 @@ usbd_req_set_address(struct usb_device * done: /* allow device time to set new address */ usb_pause_mtx(mtx, - USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); + USB_MS_TO_TICKS(usb_set_address_settle)); return (err); } Modified: stable/9/sys/dev/usb/wlan/if_uath.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_uath.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/wlan/if_uath.c Thu Nov 8 16:13:51 2012 (r242775) @@ -114,7 +114,7 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_hw_usb, OID_AUTO, uath, CTLFLAG_RW, 0, "USB Atheros"); static int uath_countrycode = CTRY_DEFAULT; /* country code */ -SYSCTL_INT(_hw_usb_uath, OID_AUTO, countrycode, CTLFLAG_RW, &uath_countrycode, +SYSCTL_INT(_hw_usb_uath, OID_AUTO, countrycode, CTLFLAG_RW | CTLFLAG_TUN, &uath_countrycode, 0, "country code"); TUNABLE_INT("hw.usb.uath.countrycode", &uath_countrycode); static int uath_regdomain = 0; /* regulatory domain */ @@ -123,7 +123,7 @@ SYSCTL_INT(_hw_usb_uath, OID_AUTO, regdo #ifdef UATH_DEBUG int uath_debug = 0; -SYSCTL_INT(_hw_usb_uath, OID_AUTO, debug, CTLFLAG_RW, &uath_debug, 0, +SYSCTL_INT(_hw_usb_uath, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uath_debug, 0, "uath debug level"); TUNABLE_INT("hw.usb.uath.debug", &uath_debug); enum { Modified: stable/9/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgt.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/wlan/if_upgt.c Thu Nov 8 16:13:51 2012 (r242775) @@ -75,7 +75,7 @@ SYSCTL_NODE(_hw, OID_AUTO, upgt, CTLFLAG #ifdef UPGT_DEBUG int upgt_debug = 0; -SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RW, &upgt_debug, +SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &upgt_debug, 0, "control debugging printfs"); TUNABLE_INT("hw.upgt.debug", &upgt_debug); enum { Modified: stable/9/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_urtw.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/wlan/if_urtw.c Thu Nov 8 16:13:51 2012 (r242775) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW, 0, "USB Realtek 8187L"); #ifdef URTW_DEBUG int urtw_debug = 0; -SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RW, &urtw_debug, 0, +SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &urtw_debug, 0, "control debugging printfs"); TUNABLE_INT("hw.usb.urtw.debug", &urtw_debug); enum { @@ -89,7 +89,7 @@ enum { } while (0) #endif static int urtw_preamble_mode = URTW_PREAMBLE_MODE_LONG; -SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RW | CTLFLAG_TUN, &urtw_preamble_mode, 0, "set the preable mode (long or short)"); TUNABLE_INT("hw.usb.urtw.preamble_mode", &urtw_preamble_mode); From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 8 16:17:53 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B1E6822; Thu, 8 Nov 2012 16:17:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 56CD48FC15; Thu, 8 Nov 2012 16:17:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8GHrtN009242; Thu, 8 Nov 2012 16:17:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8GHrmw009240; Thu, 8 Nov 2012 16:17:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211081617.qA8GHrmw009240@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 8 Nov 2012 16:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242776 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 16:17:53 -0000 Author: hselasky Date: Thu Nov 8 16:17:52 2012 New Revision: 242776 URL: http://svnweb.freebsd.org/changeset/base/242776 Log: MFC r242523: Allow using the embedded EHCI host controller in Freescale SoCs by adding the missing bits. See ehci_fsl.c for their use. Modified: stable/9/sys/dev/usb/controller/ehci.c stable/9/sys/dev/usb/controller/ehci.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.c Thu Nov 8 16:13:51 2012 (r242775) +++ stable/9/sys/dev/usb/controller/ehci.c Thu Nov 8 16:17:52 2012 (r242776) @@ -332,14 +332,18 @@ ehci_init(ehci_softc_t *sc) sc->sc_noport = EHCI_HCS_N_PORTS(sparams); sc->sc_bus.usbrev = USB_REV_2_0; - /* Reset the controller */ - DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); - - err = ehci_hcreset(sc); - if (err) { - device_printf(sc->sc_bus.bdev, "reset timeout\n"); - return (err); + if (!(sc->sc_flags & EHCI_SCFLG_DONTRESET)) { + /* Reset the controller */ + DPRINTF("%s: resetting\n", + device_get_nameunit(sc->sc_bus.bdev)); + + err = ehci_hcreset(sc); + if (err) { + device_printf(sc->sc_bus.bdev, "reset timeout\n"); + return (err); + } } + /* * use current frame-list-size selection 0: 1024*4 bytes 1: 512*4 * bytes 2: 256*4 bytes 3: unknown Modified: stable/9/sys/dev/usb/controller/ehci.h ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.h Thu Nov 8 16:13:51 2012 (r242775) +++ stable/9/sys/dev/usb/controller/ehci.h Thu Nov 8 16:17:52 2012 (r242776) @@ -345,6 +345,8 @@ typedef struct ehci_softc { #define EHCI_SCFLG_TT 0x0020 /* transaction translator present */ #define EHCI_SCFLG_LOSTINTRBUG 0x0040 /* workaround for VIA / ATI chipsets */ #define EHCI_SCFLG_IAADBUG 0x0080 /* workaround for nVidia chipsets */ +#define EHCI_SCFLG_DONTRESET 0x0100 /* don't reset ctrl. in ehci_init() */ +#define EHCI_SCFLG_DONEINIT 0x1000 /* ehci_init() has been called. */ uint8_t sc_offs; /* offset to operational registers */ uint8_t sc_doorbell_disable; /* set on doorbell failure */ From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 9 00:35:55 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABFF4B7D; Fri, 9 Nov 2012 00:35:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90F2A8FC15; Fri, 9 Nov 2012 00:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA90ZtkZ058377; Fri, 9 Nov 2012 00:35:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA90ZtVR058374; Fri, 9 Nov 2012 00:35:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211090035.qA90ZtVR058374@svn.freebsd.org> From: Eitan Adler Date: Fri, 9 Nov 2012 00:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242810 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 00:35:55 -0000 Author: eadler Date: Fri Nov 9 00:35:55 2012 New Revision: 242810 URL: http://svnweb.freebsd.org/changeset/base/242810 Log: MFC r242462: 10 years too late add support for "2.88MB 3.5in Extra High Density" floppies. Its unlikely that anyone actually uses these or cares about these anymore, since we support other floppy types and this change doesn't hurt - just add it. PR: conf/40777 Arrival-Date: Fri Jul 19 08:50:02 PDT 2002 Approved by: cperciva (implicit) Modified: stable/9/etc/disktab Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/disktab ============================================================================== --- stable/9/etc/disktab Fri Nov 9 00:35:54 2012 (r242809) +++ stable/9/etc/disktab Fri Nov 9 00:35:55 2012 (r242810) @@ -42,6 +42,12 @@ fd1440|floppy|floppy3|3in|3.5in High Den :pa#2880:oa#0:ba#4096:fa#512:\ :pc#2880:oc#0:bc#4096:fc#512: +fd2880|2.88MB 3.5in Extra High Density Floppy:\ + :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\ + :pa#5760:oa#0:ba#4096:fa#512:\ + :pb#5760:ob#0:bb#4096:fa#512:\ + :pc#5760:oc#0:bb#4096:fa#512: + # # Stressed floppy-formats. No guarantees given. # From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 9 06:58:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8C5A427C; Fri, 9 Nov 2012 06:58:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BDBB8FC08; Fri, 9 Nov 2012 06:58:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA96wOEc015810; Fri, 9 Nov 2012 06:58:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA96wON4015808; Fri, 9 Nov 2012 06:58:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211090658.qA96wON4015808@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 Nov 2012 06:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242819 - stable/9/sys/dev/usb/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 06:58:24 -0000 Author: hselasky Date: Fri Nov 9 06:58:23 2012 New Revision: 242819 URL: http://svnweb.freebsd.org/changeset/base/242819 Log: MFC r238466 and r242777: Implement non-PHY support in the udav driver. Modified: stable/9/sys/dev/usb/net/if_udav.c stable/9/sys/dev/usb/net/if_udavreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/if_udav.c ============================================================================== --- stable/9/sys/dev/usb/net/if_udav.c Fri Nov 9 05:44:34 2012 (r242818) +++ stable/9/sys/dev/usb/net/if_udav.c Fri Nov 9 06:58:23 2012 (r242819) @@ -181,6 +181,15 @@ static const struct usb_ether_methods ud .ue_mii_sts = udav_ifmedia_status, }; +static const struct usb_ether_methods udav_ue_methods_nophy = { + .ue_attach_post = udav_attach_post, + .ue_start = udav_start, + .ue_init = udav_init, + .ue_stop = udav_stop, + .ue_setmulti = udav_setmulti, + .ue_setpromisc = udav_setpromisc, +}; + #ifdef USB_DEBUG static int udav_debug = 0; @@ -206,7 +215,8 @@ static const STRUCT_USB_HOST_ID udav_dev {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, /* Kontron AG USB Ethernet */ {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, - {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, + UDAV_FLAG_NO_PHY)}, }; static void @@ -259,11 +269,20 @@ udav_attach(device_t dev) goto detach; } + /* + * The JP1082 has an unusable PHY and provides no link information. + */ + if (sc->sc_flags & UDAV_FLAG_NO_PHY) { + ue->ue_methods = &udav_ue_methods_nophy; + sc->sc_flags |= UDAV_FLAG_LINK; + } else { + ue->ue_methods = &udav_ue_methods; + } + ue->ue_sc = sc; ue->ue_dev = dev; ue->ue_udev = uaa->device; ue->ue_mtx = &sc->sc_mtx; - ue->ue_methods = &udav_ue_methods; error = uether_ifattach(ue); if (error) { @@ -712,7 +731,8 @@ udav_stop(struct usb_ether *ue) UDAV_LOCK_ASSERT(sc, MA_OWNED); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - sc->sc_flags &= ~UDAV_FLAG_LINK; + if (!(sc->sc_flags & UDAV_FLAG_NO_PHY)) + sc->sc_flags &= ~UDAV_FLAG_LINK; /* * stop all the transfers, if not already stopped: Modified: stable/9/sys/dev/usb/net/if_udavreg.h ============================================================================== --- stable/9/sys/dev/usb/net/if_udavreg.h Fri Nov 9 05:44:34 2012 (r242818) +++ stable/9/sys/dev/usb/net/if_udavreg.h Fri Nov 9 06:58:23 2012 (r242819) @@ -159,6 +159,7 @@ struct udav_softc { int sc_flags; #define UDAV_FLAG_LINK 0x0001 #define UDAV_FLAG_EXT_PHY 0x0040 +#define UDAV_FLAG_NO_PHY 0x0080 }; #define UDAV_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 9 07:05:29 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5797B557; Fri, 9 Nov 2012 07:05:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3BFD58FC19; Fri, 9 Nov 2012 07:05:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA975TE6017026; Fri, 9 Nov 2012 07:05:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA975T4J017021; Fri, 9 Nov 2012 07:05:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211090705.qA975T4J017021@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 Nov 2012 07:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242820 - in stable/9/sys/dev: atkbdc isci/scil usb/serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 07:05:29 -0000 Author: hselasky Date: Fri Nov 9 07:05:28 2012 New Revision: 242820 URL: http://svnweb.freebsd.org/changeset/base/242820 Log: MFC r240743 and r234418: Fix some typos. Modified: stable/9/sys/dev/atkbdc/psm.c stable/9/sys/dev/isci/scil/scic_sds_phy.c stable/9/sys/dev/usb/serial/uftdi_reg.h stable/9/sys/dev/usb/serial/umodem.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/atkbdc/psm.c ============================================================================== --- stable/9/sys/dev/atkbdc/psm.c Fri Nov 9 06:58:23 2012 (r242819) +++ stable/9/sys/dev/atkbdc/psm.c Fri Nov 9 07:05:28 2012 (r242820) @@ -2454,7 +2454,7 @@ proc_mmanplus(struct psm_softc *sc, pack { /* - * PS2++ protocl packet + * PS2++ protocol packet * * b7 b6 b5 b4 b3 b2 b1 b0 * byte 1: * 1 p3 p2 1 * * * @@ -3738,7 +3738,7 @@ enable_mmanplus(KBDC kbdc, struct psm_so return (FALSE); /* - * PS2++ protocl, packet type 0 + * PS2++ protocol, packet type 0 * * b7 b6 b5 b4 b3 b2 b1 b0 * byte 1: * 1 p3 p2 1 * * * Modified: stable/9/sys/dev/isci/scil/scic_sds_phy.c ============================================================================== --- stable/9/sys/dev/isci/scil/scic_sds_phy.c Fri Nov 9 06:58:23 2012 (r242819) +++ stable/9/sys/dev/isci/scil/scic_sds_phy.c Fri Nov 9 07:05:28 2012 (r242820) @@ -2317,7 +2317,7 @@ void scic_sds_phy_stopped_state_enter( * entering the SCI_BASE_PHY_STATE_STARTING. * - This function sets the state handlers for the phy object base state * machine starting state. - * - The SCU hardware is requested to start OOB/SN on this protocl engine. + * - The SCU hardware is requested to start OOB/SN on this protocol engine. * - The phy starting substate machine is started. * - If the previous state was the ready state then the * SCIC_SDS_CONTROLLER is informed that the phy has gone link down. Modified: stable/9/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi_reg.h Fri Nov 9 06:58:23 2012 (r242819) +++ stable/9/sys/dev/usb/serial/uftdi_reg.h Fri Nov 9 07:05:28 2012 (r242820) @@ -176,7 +176,7 @@ enum { * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_FLOW_CTRL * wValue: Xoff/Xon - * wIndex: Protocol/Port - hIndex is protocl / lIndex is port + * wIndex: Protocol/Port - hIndex is protocol / lIndex is port * wLength: 0 * Data: None * Modified: stable/9/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/9/sys/dev/usb/serial/umodem.c Fri Nov 9 06:58:23 2012 (r242819) +++ stable/9/sys/dev/usb/serial/umodem.c Fri Nov 9 07:05:28 2012 (r242820) @@ -139,7 +139,7 @@ static const STRUCT_USB_HOST_ID umodem_d }; /* - * As speeds for umodem deivces increase, these numbers will need to + * As speeds for umodem devices increase, these numbers will need to * be increased. They should be good for G3 speeds and below. * * TODO: The TTY buffers should be increased! From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 9 07:12:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BC9D74F; Fri, 9 Nov 2012 07:12:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40BB48FC0A; Fri, 9 Nov 2012 07:12:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA97CWIU018291; Fri, 9 Nov 2012 07:12:32 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA97CVUE018286; Fri, 9 Nov 2012 07:12:31 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211090712.qA97CVUE018286@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 Nov 2012 07:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242821 - in stable/9/sys/dev/usb: . quirk storage X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 07:12:32 -0000 Author: hselasky Date: Fri Nov 9 07:12:31 2012 New Revision: 242821 URL: http://svnweb.freebsd.org/changeset/base/242821 Log: MFC r241432, r242628 and r242364: Remove ancient mass storage gone checks. Add some more mass storage related quirks. Improve auto-quirk detection for mass storage devices. Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/quirk/usb_quirk.h stable/9/sys/dev/usb/storage/umass.c stable/9/sys/dev/usb/usb_msctest.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Fri Nov 9 07:12:31 2012 (r242821) @@ -390,6 +390,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(SONY, PORTABLE_HDD_V2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(STMICRO, ST72682, 0x0000, 0xffff, UQ_MSC_NO_PREVENT_ALLOW), USB_QUIRK(SUPERTOP, IDE, 0x0000, 0xffff, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(TAUGA, CAMERAMATE, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), @@ -517,6 +518,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_MSC_NO_GETMAXLUN] = "UQ_MSC_NO_GETMAXLUN", [UQ_MSC_NO_INQUIRY] = "UQ_MSC_NO_INQUIRY", [UQ_MSC_NO_INQUIRY_EVPD] = "UQ_MSC_NO_INQUIRY_EVPD", + [UQ_MSC_NO_PREVENT_ALLOW] = "UQ_MSC_NO_PREVENT_ALLOW", [UQ_MSC_NO_SYNC_CACHE] = "UQ_MSC_NO_SYNC_CACHE", [UQ_MSC_SHUTTLE_INIT] = "UQ_MSC_SHUTTLE_INIT", [UQ_MSC_ALT_IFACE_1] = "UQ_MSC_ALT_IFACE_1", Modified: stable/9/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.h Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/quirk/usb_quirk.h Fri Nov 9 07:12:31 2012 (r242821) @@ -75,6 +75,7 @@ enum { UQ_MSC_NO_GETMAXLUN, /* does not support get max LUN */ UQ_MSC_NO_INQUIRY, /* fake generic inq response */ UQ_MSC_NO_INQUIRY_EVPD, /* does not support inq EVPD */ + UQ_MSC_NO_PREVENT_ALLOW, /* does not support medium removal */ UQ_MSC_NO_SYNC_CACHE, /* does not support sync cache */ UQ_MSC_SHUTTLE_INIT, /* requires Shuttle init sequence */ UQ_MSC_ALT_IFACE_1, /* switch to alternate interface 1 */ Modified: stable/9/sys/dev/usb/storage/umass.c ============================================================================== --- stable/9/sys/dev/usb/storage/umass.c Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/storage/umass.c Fri Nov 9 07:12:31 2012 (r242821) @@ -174,8 +174,6 @@ TUNABLE_INT("hw.usb.umass.debug", &umass #define DPRINTF(...) do { } while (0) #endif -#define UMASS_GONE ((struct umass_softc *)1) - #define UMASS_BULK_SIZE (1 << 17) #define UMASS_CBI_DIAGNOSTIC_CMDLEN 12 /* bytes */ #define UMASS_MAX_CMDLEN MAX(12, CAM_MAX_CDBLEN) /* bytes */ @@ -363,6 +361,8 @@ typedef uint8_t (umass_transform_t)(stru * result. */ #define NO_SYNCHRONIZE_CACHE 0x4000 + /* Device does not support 'PREVENT/ALLOW MEDIUM REMOVAL'. */ +#define NO_PREVENT_ALLOW 0x8000 struct umass_softc { @@ -833,6 +833,8 @@ umass_probe_proto(device_t dev, struct u quirks |= NO_INQUIRY; if (usb_test_quirk(uaa, UQ_MSC_NO_INQUIRY_EVPD)) quirks |= NO_INQUIRY_EVPD; + if (usb_test_quirk(uaa, UQ_MSC_NO_PREVENT_ALLOW)) + quirks |= NO_PREVENT_ALLOW; if (usb_test_quirk(uaa, UQ_MSC_NO_SYNC_CACHE)) quirks |= NO_SYNCHRONIZE_CACHE; if (usb_test_quirk(uaa, UQ_MSC_SHUTTLE_INIT)) @@ -2108,7 +2110,7 @@ umass_cam_detach_sim(struct umass_softc if (sc->sc_sim != NULL) { if (xpt_bus_deregister(cam_sim_path(sc->sc_sim))) { /* accessing the softc is not possible after this */ - sc->sc_sim->softc = UMASS_GONE; + sc->sc_sim->softc = NULL; cam_sim_free(sc->sc_sim, /* free_devq */ TRUE); } else { panic("%s: CAM layer is busy\n", @@ -2127,63 +2129,11 @@ umass_cam_action(struct cam_sim *sim, un { struct umass_softc *sc = (struct umass_softc *)sim->softc; - if (sc == UMASS_GONE || - (sc != NULL && !usbd_device_attached(sc->sc_udev))) { + if (sc == NULL) { ccb->ccb_h.status = CAM_SEL_TIMEOUT; xpt_done(ccb); return; } - /* - * Verify, depending on the operation to perform, that we either got - * a valid sc, because an existing target was referenced, or - * otherwise the SIM is addressed. - * - * This avoids bombing out at a printf and does give the CAM layer some - * sensible feedback on errors. - */ - switch (ccb->ccb_h.func_code) { - case XPT_SCSI_IO: - case XPT_RESET_DEV: - case XPT_GET_TRAN_SETTINGS: - case XPT_SET_TRAN_SETTINGS: - case XPT_CALC_GEOMETRY: - /* the opcodes requiring a target. These should never occur. */ - if (sc == NULL) { - DPRINTF(sc, UDMASS_GEN, "%s:%d:%d:%d:func_code 0x%04x: " - "Invalid target (target needed)\n", - DEVNAME_SIM, cam_sim_path(sc->sc_sim), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun, - ccb->ccb_h.func_code); - - ccb->ccb_h.status = CAM_TID_INVALID; - xpt_done(ccb); - goto done; - } - break; - case XPT_PATH_INQ: - case XPT_NOOP: - /* - * The opcodes sometimes aimed at a target (sc is valid), - * sometimes aimed at the SIM (sc is invalid and target is - * CAM_TARGET_WILDCARD) - */ - if ((sc == NULL) && - (ccb->ccb_h.target_id != CAM_TARGET_WILDCARD)) { - DPRINTF(sc, UDMASS_SCSI, "%s:%d:%d:%d:func_code 0x%04x: " - "Invalid target (no wildcard)\n", - DEVNAME_SIM, cam_sim_path(sc->sc_sim), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun, - ccb->ccb_h.func_code); - - ccb->ccb_h.status = CAM_TID_INVALID; - xpt_done(ccb); - goto done; - } - break; - default: - /* XXX Hm, we should check the input parameters */ - break; - } /* Perform the requested action */ switch (ccb->ccb_h.func_code) { @@ -2299,6 +2249,13 @@ umass_cam_action(struct cam_sim *sim, un if (sc->sc_quirks & FORCE_SHORT_INQUIRY) { ccb->csio.dxfer_len = SHORT_INQUIRY_LENGTH; } + } else if (sc->sc_transfer.cmd_data[0] == PREVENT_ALLOW) { + if (sc->sc_quirks & NO_PREVENT_ALLOW) { + ccb->csio.scsi_status = SCSI_STATUS_OK; + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + goto done; + } } else if (sc->sc_transfer.cmd_data[0] == SYNCHRONIZE_CACHE) { if (sc->sc_quirks & NO_SYNCHRONIZE_CACHE) { ccb->csio.scsi_status = SCSI_STATUS_OK; @@ -2447,7 +2404,7 @@ umass_cam_poll(struct cam_sim *sim) { struct umass_softc *sc = (struct umass_softc *)sim->softc; - if (sc == UMASS_GONE) + if (sc == NULL) return; DPRINTF(sc, UDMASS_SCSI, "CAM poll\n"); Modified: stable/9/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/9/sys/dev/usb/usb_msctest.c Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/usb_msctest.c Fri Nov 9 07:12:31 2012 (r242821) @@ -664,8 +664,11 @@ usb_msc_auto_quirk(struct usb_device *ud if (sid_type == 0x00) is_no_direct = 0; break; - } else if (err != ERR_CSW_FAILED) - break; /* non retryable error */ + } else if (err != ERR_CSW_FAILED) { + DPRINTF("Device is not responding " + "properly to SCSI INQUIRY command.\n"); + goto error; /* non retryable error */ + } usb_pause_mtx(NULL, hz); } Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/usbdevs Fri Nov 9 07:12:31 2012 (r242821) @@ -3945,6 +3945,7 @@ product STELERA E1012 0x1012 3G modem /* STMicroelectronics products */ product STMICRO BIOCPU 0x2016 Biometric Coprocessor product STMICRO COMMUNICATOR 0x7554 USB Communicator +product STMICRO ST72682 0xfada USB 2.0 Flash drive controller /* STSN products */ product STSN STSN0001 0x0001 Internet Access Device From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 9 07:29:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88C71E4C; Fri, 9 Nov 2012 07:29:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC828FC13; Fri, 9 Nov 2012 07:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA97TBeN021067; Fri, 9 Nov 2012 07:29:11 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA97TBOj021065; Fri, 9 Nov 2012 07:29:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211090729.qA97TBOj021065@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 Nov 2012 07:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242822 - in stable/9/sys/dev: sound/usb usb usb/quirk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 07:29:11 -0000 Author: hselasky Date: Fri Nov 9 07:29:11 2012 New Revision: 242822 URL: http://svnweb.freebsd.org/changeset/base/242822 Log: MFC r242127, r240078, r240609, r241988, r242129, r242223, r242438, r242453, r242455 and r242458: Add full support for Fast Track Ultra 8R from M-audio. Implement support for USB Audio v2.0. Remove some redundant USB audio v1.0 debug data. Use lsusb instead. Implement support for the so-called USB feedback endpoint for USB audio devices. Export all mixer nodes into dev.pcm.X.mixer.Y sysctl nodes. PR: usb/171254 Modified: stable/9/sys/dev/sound/usb/uaudio.c stable/9/sys/dev/sound/usb/uaudioreg.h stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Fri Nov 9 07:12:31 2012 (r242821) +++ stable/9/sys/dev/sound/usb/uaudio.c Fri Nov 9 07:29:11 2012 (r242822) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR uaudio_debug #include @@ -115,22 +116,39 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def #endif #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ -#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ -#define UAUDIO_RECURSE_LIMIT 24 /* rounds */ +#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ +#define UAUDIO_RECURSE_LIMIT 255 /* rounds */ #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) #define UAUDIO_MAX_CHAN(x) (x) +union uaudio_asid { + const struct usb_audio_streaming_interface_descriptor *v1; + const struct usb_audio20_streaming_interface_descriptor *v2; +}; + +union uaudio_asf1d { + const struct usb_audio_streaming_type1_descriptor *v1; + const struct usb_audio20_streaming_type1_descriptor *v2; +}; + +union uaudio_sed { + const struct usb_audio_streaming_endpoint_descriptor *v1; + const struct usb_audio20_streaming_endpoint_descriptor *v2; +}; + struct uaudio_mixer_node { + const char *name; + int32_t minval; int32_t maxval; -#define MIX_MAX_CHAN 8 +#define MIX_MAX_CHAN 16 int32_t wValue[MIX_MAX_CHAN]; /* using nchan */ uint32_t mul; uint32_t ctl; - uint16_t wData[MIX_MAX_CHAN]; /* using nchan */ + int wData[MIX_MAX_CHAN]; /* using nchan */ uint16_t wIndex; uint8_t update[(MIX_MAX_CHAN + 7) / 8]; @@ -149,6 +167,9 @@ struct uaudio_mixer_node { #define MAX_SELECTOR_INPUT_PIN 256 uint8_t slctrtype[MAX_SELECTOR_INPUT_PIN]; uint8_t class; + uint8_t val_default; + + uint8_t desc[64]; struct uaudio_mixer_node *next; }; @@ -161,12 +182,10 @@ struct uaudio_chan { struct mtx *pcm_mtx; /* lock protecting this structure */ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; - struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; - const struct usb_audio_streaming_interface_descriptor *p_asid; - const struct usb_audio_streaming_type1_descriptor *p_asf1d; - const struct usb_audio_streaming_endpoint_descriptor *p_sed; + struct usb_xfer *xfer[UAUDIO_NCHANBUFS + 1]; + union uaudio_asf1d p_asf1d; + union uaudio_sed p_sed; const usb_endpoint_descriptor_audio_t *p_ed1; - const usb_endpoint_descriptor_audio_t *p_ed2; const struct uaudio_format *p_fmt; uint8_t *buf; /* pointer to buffer */ @@ -192,6 +211,13 @@ struct uaudio_chan { uint8_t valid; uint8_t iface_index; uint8_t iface_alt_index; + uint8_t channels; + + uint8_t last_sync_time; + uint8_t last_sync_state; +#define UAUDIO_SYNC_NONE 0 +#define UAUDIO_SYNC_MORE 1 +#define UAUDIO_SYNC_LESS 2 }; #define UMIDI_CABLES_MAX 16 /* units */ @@ -242,13 +268,23 @@ struct umidi_chan { uint8_t single_command; }; +struct uaudio_search_result { + uint8_t bit_input[(256 + 7) / 8]; + uint8_t bit_output[(256 + 7) / 8]; + uint8_t recurse_level; + uint8_t id_max; + uint8_t is_input; +}; + struct uaudio_softc { struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; struct uaudio_chan sc_rec_chan; struct uaudio_chan sc_play_chan; struct umidi_chan sc_midi_chan; + struct uaudio_search_result sc_mixer_clocks; + struct mtx *sc_mixer_lock; struct usb_device *sc_udev; struct usb_xfer *sc_mixer_xfer[1]; struct uaudio_mixer_node *sc_mixer_root; @@ -273,24 +309,28 @@ struct uaudio_softc { uint8_t sc_uq_au_vendor_class:1; }; -struct uaudio_search_result { - uint8_t bit_input[(256 + 7) / 8]; - uint8_t bit_output[(256 + 7) / 8]; - uint8_t bit_visited[(256 + 7) / 8]; - uint8_t recurse_level; - uint8_t id_max; -}; - struct uaudio_terminal_node { union { const struct usb_descriptor *desc; - const struct usb_audio_input_terminal *it; - const struct usb_audio_output_terminal *ot; - const struct usb_audio_mixer_unit_0 *mu; - const struct usb_audio_selector_unit *su; - const struct usb_audio_feature_unit *fu; - const struct usb_audio_processing_unit_0 *pu; - const struct usb_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it_v1; + const struct usb_audio_output_terminal *ot_v1; + const struct usb_audio_mixer_unit_0 *mu_v1; + const struct usb_audio_selector_unit *su_v1; + const struct usb_audio_feature_unit *fu_v1; + const struct usb_audio_processing_unit_0 *pu_v1; + const struct usb_audio_extension_unit_0 *eu_v1; + const struct usb_audio20_clock_source_unit *csrc_v2; + const struct usb_audio20_clock_selector_unit_0 *csel_v2; + const struct usb_audio20_clock_multiplier_unit *cmul_v2; + const struct usb_audio20_input_terminal *it_v2; + const struct usb_audio20_output_terminal *ot_v2; + const struct usb_audio20_mixer_unit_0 *mu_v2; + const struct usb_audio20_selector_unit *su_v2; + const struct usb_audio20_feature_unit *fu_v2; + const struct usb_audio20_sample_rate_unit *ru_v2; + const struct usb_audio20_processing_unit_0 *pu_v2; + const struct usb_audio20_extension_unit_0 *eu_v2; + const struct usb_audio20_effect_unit *ef_v2; } u; struct uaudio_search_result usr; struct uaudio_terminal_node *root; @@ -303,7 +343,7 @@ struct uaudio_format { const char *description; }; -static const struct uaudio_format uaudio_formats[] = { +static const struct uaudio_format uaudio10_formats[] = { {UA_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, {UA_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, @@ -321,6 +361,24 @@ static const struct uaudio_format uaudio {0, 0, 0, NULL} }; +static const struct uaudio_format uaudio20_formats[] = { + + {UA20_FMT_PCM, 8, AFMT_S8, "8-bit S-LE PCM"}, + {UA20_FMT_PCM, 16, AFMT_S16_LE, "16-bit S-LE PCM"}, + {UA20_FMT_PCM, 24, AFMT_S24_LE, "24-bit S-LE PCM"}, + {UA20_FMT_PCM, 32, AFMT_S32_LE, "32-bit S-LE PCM"}, + + {UA20_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, + {UA20_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, + {UA20_FMT_PCM8, 24, AFMT_U24_LE, "24-bit U-LE PCM"}, + {UA20_FMT_PCM8, 32, AFMT_U32_LE, "32-bit U-LE PCM"}, + + {UA20_FMT_ALAW, 8, AFMT_A_LAW, "8-bit A-Law"}, + {UA20_FMT_MULAW, 8, AFMT_MU_LAW, "8-bit mu-Law"}, + + {0, 0, 0, NULL} +}; + #define UAC_OUTPUT 0 #define UAC_INPUT 1 #define UAC_EQUAL 2 @@ -341,23 +399,23 @@ static device_attach_t uaudio_attach; static device_detach_t uaudio_detach; static usb_callback_t uaudio_chan_play_callback; +static usb_callback_t uaudio_chan_play_sync_callback; static usb_callback_t uaudio_chan_record_callback; +static usb_callback_t uaudio_chan_record_sync_callback; static usb_callback_t uaudio_mixer_write_cfg_callback; static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; -static void uaudio_chan_fill_info_sub(struct uaudio_softc *, - struct usb_device *, uint32_t, uint8_t, uint8_t); -static void uaudio_chan_fill_info(struct uaudio_softc *, - struct usb_device *); -static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_ctl(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_input(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); -static void uaudio_mixer_add_output(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); +/* ==== USB mixer ==== */ + +static int uaudio_mixer_sysctl_handler(SYSCTL_HANDLER_ARGS); +static void uaudio_mixer_ctl_free(struct uaudio_softc *); +static void uaudio_mixer_register_sysctl(struct uaudio_softc *, device_t); +static void uaudio_mixer_reload_all(struct uaudio_softc *); +static void uaudio_mixer_controls_create_ftu(struct uaudio_softc *); + +/* ==== USB audio v1.0 ==== */ + static void uaudio_mixer_add_mixer(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_selector(struct uaudio_softc *, @@ -378,25 +436,56 @@ static uint16_t uaudio_mixer_determine_c struct uaudio_mixer_node *); static uint16_t uaudio_mixer_feature_name(const struct uaudio_terminal_node *, struct uaudio_mixer_node *); -static const struct uaudio_terminal_node *uaudio_mixer_get_input( - const struct uaudio_terminal_node *, uint8_t); -static const struct uaudio_terminal_node *uaudio_mixer_get_output( - const struct uaudio_terminal_node *, uint8_t); static void uaudio_mixer_find_inputs_sub(struct uaudio_terminal_node *, const uint8_t *, uint8_t, struct uaudio_search_result *); -static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, - uint8_t, uint8_t, struct uaudio_search_result *); +static const void *uaudio_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); +static int uaudio_mixer_get(struct usb_device *, uint16_t, uint8_t, + struct uaudio_mixer_node *); + +/* ==== USB audio v2.0 ==== */ + +static void uaudio20_mixer_add_mixer(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_selector(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_feature(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static struct usb_audio20_cluster uaudio20_mixer_get_cluster(uint8_t, + const struct uaudio_terminal_node *); +static uint16_t uaudio20_mixer_determine_class(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static uint16_t uaudio20_mixer_feature_name(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static void uaudio20_mixer_find_inputs_sub(struct uaudio_terminal_node *, + const uint8_t *, uint8_t, struct uaudio_search_result *); +static const void *uaudio20_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio20_set_speed(struct usb_device *, uint8_t, + uint8_t, uint32_t); + +/* USB audio v1.0 and v2.0 */ + +static void uaudio_chan_fill_info_sub(struct uaudio_softc *, + struct usb_device *, uint32_t, uint8_t, uint8_t); +static void uaudio_chan_fill_info(struct uaudio_softc *, + struct usb_device *); +static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, + struct uaudio_mixer_node *); +static void uaudio_mixer_add_ctl(struct uaudio_softc *, + struct uaudio_mixer_node *); static void uaudio_mixer_fill_info(struct uaudio_softc *, struct usb_device *, void *); -static uint16_t uaudio_mixer_get(struct usb_device *, uint8_t, - struct uaudio_mixer_node *); static void uaudio_mixer_ctl_set(struct uaudio_softc *, struct uaudio_mixer_node *, uint8_t, int32_t val); -static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); static int uaudio_mixer_signext(uint8_t, int); static int uaudio_mixer_bsd2value(struct uaudio_mixer_node *, int32_t val); -static const void *uaudio_mixer_verify_desc(const void *, uint32_t); static void uaudio_mixer_init(struct uaudio_softc *); +static const struct uaudio_terminal_node *uaudio_mixer_get_input( + const struct uaudio_terminal_node *, uint8_t); +static const struct uaudio_terminal_node *uaudio_mixer_get_output( + const struct uaudio_terminal_node *, uint8_t); +static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, + uint8_t, uint8_t, struct uaudio_search_result *); static uint8_t umidi_convert_to_usb(struct umidi_sub_chan *, uint8_t, uint8_t); static struct umidi_sub_chan *umidi_sub_by_fifo(struct usb_fifo *); static void umidi_start_read(struct usb_fifo *); @@ -413,13 +502,10 @@ static int umidi_detach(device_t dev); #ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc( const usb_endpoint_descriptor_audio_t *); -static void uaudio_mixer_dump_cluster(uint8_t, - const struct uaudio_terminal_node *); -static const char *uaudio_mixer_get_terminal_name(uint16_t); #endif static const struct usb_config - uaudio_cfg_record[UAUDIO_NCHANBUFS] = { + uaudio_cfg_record[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -439,10 +525,20 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_record_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_record_sync_callback, + }, }; static const struct usb_config - uaudio_cfg_play[UAUDIO_NCHANBUFS] = { + uaudio_cfg_play[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -462,6 +558,16 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_play_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_play_sync_callback, + }, }; static const struct usb_config @@ -555,7 +661,8 @@ uaudio_probe(device_t dev) /* lookup non-standard device */ if (uaa->info.bInterfaceClass != UICLASS_AUDIO) { - if (usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS) == 0) + if (uaa->info.bInterfaceClass != UICLASS_VENDOR || + usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS) == 0) return (ENXIO); } @@ -614,30 +721,43 @@ uaudio_attach(device_t dev) id = usbd_get_interface_descriptor(uaa->iface); - uaudio_chan_fill_info(sc, uaa->device); - + /* must fill mixer info before channel info */ uaudio_mixer_fill_info(sc, uaa->device, id); + /* fill channel info */ + uaudio_chan_fill_info(sc, uaa->device); + DPRINTF("audio rev %d.%02x\n", sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); + if (sc->sc_mixer_count == 0) { + if (uaa->info.idVendor == USB_VENDOR_MAUDIO && + (uaa->info.idProduct == USB_PRODUCT_MAUDIO_FASTTRACKULTRA || + uaa->info.idProduct == USB_PRODUCT_MAUDIO_FASTTRACKULTRA8R)) { + DPRINTF("Generating mixer descriptors\n"); + uaudio_mixer_controls_create_ftu(sc); + } + } + DPRINTF("%d mixer controls\n", sc->sc_mixer_count); if (sc->sc_play_chan.valid) { - device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", + device_printf(dev, "Play: %d Hz, %d ch, %s format, " + "2x8ms buffer.\n", sc->sc_play_chan.sample_rate, - sc->sc_play_chan.p_asf1d->bNrChannels, + sc->sc_play_chan.channels, sc->sc_play_chan.p_fmt->description); } else { device_printf(dev, "No playback.\n"); } if (sc->sc_rec_chan.valid) { - device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", + device_printf(dev, "Record: %d Hz, %d ch, %s format, " + "2x8ms buffer.\n", sc->sc_rec_chan.sample_rate, - sc->sc_rec_chan.p_asf1d->bNrChannels, + sc->sc_rec_chan.channels, sc->sc_rec_chan.p_fmt->description); } else { device_printf(dev, "No recording.\n"); @@ -679,6 +799,10 @@ uaudio_attach(device_t dev) DPRINTF("child attach failed\n"); goto detach; } + + /* reload all mixer settings */ + uaudio_mixer_reload_all(sc); + return (0); /* success */ detach: @@ -714,9 +838,8 @@ uaudio_attach_sub(device_t dev, kobj_cla */ uaudio_pcm_setflags(dev, SD_F_SOFTPCMVOL); } - if (mixer_init(dev, mixer_class, sc)) { + if (mixer_init(dev, mixer_class, sc)) goto detach; - } sc->sc_mixer_init = 1; snprintf(status, sizeof(status), "at ? %s", PCM_KLDSTRING(snd_uaudio)); @@ -738,6 +861,8 @@ uaudio_attach_sub(device_t dev, kobj_cla } pcm_setstatus(dev, status); + uaudio_mixer_register_sysctl(sc, dev); + return (0); /* success */ detach: @@ -779,9 +904,9 @@ uaudio_detach(device_t dev) * any. */ if (sc->sc_play_chan.valid) - usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS + 1); if (sc->sc_rec_chan.valid) - usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS + 1); if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); @@ -791,6 +916,10 @@ uaudio_detach(device_t dev) umidi_detach(dev); + /* free mixer data */ + + uaudio_mixer_ctl_free(sc); + return (0); } @@ -857,28 +986,88 @@ uaudio_record_fix_fs(usb_endpoint_descri } } +static usb_error_t +uaudio20_check_rate(struct usb_device *udev, uint8_t iface_no, + uint8_t clockid, uint32_t rate) +{ + struct usb_device_request req; + usb_error_t error; + uint8_t data[255]; + uint16_t actlen; + uint16_t rates; + uint16_t x; + + DPRINTFN(6, "ifaceno=%d clockid=%d rate=%u\n", + iface_no, clockid, rate); + + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = UA20_CS_RANGE; + USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); + USETW2(req.wIndex, clockid, iface_no); + USETW(req.wLength, 255); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = data[0] | (data[1] << 8); + actlen = (actlen - 2) / 12; + + if (rates > actlen) { + DPRINTF("Too many rates\n"); + rates = actlen; + } + + for (x = 0; x != rates; x++) { + uint32_t min = UGETDW(data + 2 + (12 * x)); + uint32_t max = UGETDW(data + 6 + (12 * x)); + uint32_t res = UGETDW(data + 10 + (12 * x)); + + if (res == 0) { + DPRINTF("Zero residue\n"); + res = 1; + } + + if (min > max) { + DPRINTF("Swapped max and min\n"); + uint32_t temp; + temp = min; + min = max; + max = temp; + } + + if (rate >= min && rate <= max && + (((rate - min) % res) == 0)) { + return (0); + } + } + return (USB_ERR_INVAL); +} + static void uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, uint32_t rate, uint8_t channels, uint8_t bit_resolution) { struct usb_descriptor *desc = NULL; - const struct usb_audio_streaming_interface_descriptor *asid = NULL; - const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; - const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; + union uaudio_asid asid = { NULL }; + union uaudio_asf1d asf1d = { NULL }; + union uaudio_sed sed = { NULL }; usb_endpoint_descriptor_audio_t *ed1 = NULL; - const usb_endpoint_descriptor_audio_t *ed2 = NULL; + const struct usb_audio_control_descriptor *acdp = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; - const struct uaudio_format *p_fmt; + const struct uaudio_format *p_fmt = NULL; struct uaudio_chan *chan; uint16_t curidx = 0xFFFF; uint16_t lastidx = 0xFFFF; uint16_t alt_index = 0; - uint16_t wFormat; + uint16_t audio_rev = 0; + uint16_t x; uint8_t ep_dir; uint8_t bChannels; uint8_t bBitResolution; - uint8_t x; uint8_t audio_if = 0; uint8_t uma_if_class; @@ -923,171 +1112,264 @@ uaudio_chan_fill_info_sub(struct uaudio_ sc->sc_midi_chan.valid = 1; } } - asid = NULL; - asf1d = NULL; + asid.v1 = NULL; + asf1d.v1 = NULL; ed1 = NULL; - ed2 = NULL; - sed = NULL; + sed.v1 = NULL; } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + + if (audio_if == 0) { + if ((acdp == NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && + (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && + (desc->bLength >= sizeof(*acdp))) { + acdp = (void *)desc; + audio_rev = UGETW(acdp->bcdADC); + } + + /* + * Don't collect any USB audio descriptors if + * this is not an USB audio stream interface. + */ + continue; + } + + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*asid))) { - if (asid == NULL) { - asid = (void *)desc; + (asid.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asid.v2)) { + asid.v2 = (void *)desc; + } + } else { + if (desc->bLength >= sizeof(*asid.v1)) { + asid.v1 = (void *)desc; + } } } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == FORMAT_TYPE) && - (desc->bLength >= sizeof(*asf1d))) { - if (asf1d == NULL) { - asf1d = (void *)desc; - if (asf1d->bFormatType != FORMAT_TYPE_I) { - DPRINTFN(11, "ignored bFormatType = %d\n", - asf1d->bFormatType); - asf1d = NULL; - continue; - } - if (asf1d->bLength < (sizeof(*asf1d) + - ((asf1d->bSamFreqType == 0) ? 6 : - (asf1d->bSamFreqType * 3)))) { - DPRINTFN(11, "'asf1d' descriptor is too short\n"); - asf1d = NULL; - continue; + (asf1d.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asf1d.v2)) + asf1d.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*asf1d.v1)) { + asf1d.v1 = (void *)desc; + + if (asf1d.v1->bFormatType != FORMAT_TYPE_I) { + DPRINTFN(11, "ignored bFormatType = %d\n", + asf1d.v1->bFormatType); + asf1d.v1 = NULL; + continue; + } + if (desc->bLength < (sizeof(*asf1d.v1) + + ((asf1d.v1->bSamFreqType == 0) ? 6 : + (asf1d.v1->bSamFreqType * 3)))) { + DPRINTFN(11, "invalid descriptor, " + "too short\n"); + asf1d.v1 = NULL; + continue; + } } } } if ((desc->bDescriptorType == UDESC_ENDPOINT) && - (desc->bLength >= UEP_MINSIZE)) { - if (ed1 == NULL) { - ed1 = (void *)desc; - if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { - ed1 = NULL; - } + (desc->bLength >= UEP_MINSIZE) && + (ed1 == NULL)) { + ed1 = (void *)desc; + if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { + ed1 = NULL; + continue; } } - if ((desc->bDescriptorType == UDESC_CS_ENDPOINT) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_ENDPOINT) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*sed))) { - if (sed == NULL) { - sed = (void *)desc; + (sed.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*sed.v2)) + sed.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*sed.v1)) + sed.v1 = (void *)desc; } } - if (audio_if && asid && asf1d && ed1 && sed) { + if (asid.v1 == NULL || asf1d.v1 == NULL || + ed1 == NULL || sed.v1 == NULL) { + /* need more descriptors */ + continue; + } + + ep_dir = UE_GET_DIR(ed1->bEndpointAddress); - ep_dir = UE_GET_DIR(ed1->bEndpointAddress); + /* We ignore sync endpoint information until further. */ - /* We ignore sync endpoint information until further. */ + if (audio_rev >= UAUDIO_VERSION_30) { + goto next_ep; + } else if (audio_rev >= UAUDIO_VERSION_20) { - wFormat = UGETW(asid->wFormatTag); - bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); - bBitResolution = asf1d->bBitResolution; + uint32_t dwFormat; + uint8_t bSubslotSize; - if (asf1d->bSamFreqType == 0) { + dwFormat = UGETDW(asid.v2->bmFormats); + bChannels = asid.v2->bNrChannels; + bBitResolution = asf1d.v2->bBitResolution; + bSubslotSize = asf1d.v2->bSubslotSize; + + if (bBitResolution != (bSubslotSize * 8)) { + DPRINTF("Invalid bSubslotSize\n"); + goto next_ep; + } + + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + + for (p_fmt = uaudio20_formats; + p_fmt->wFormat != 0; p_fmt++) { + if ((p_fmt->wFormat & dwFormat) && + (p_fmt->bPrecision == bBitResolution)) + break; + } + + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; + } + + for (x = 0; x != 256; x++) { + if (ep_dir == UE_DIR_OUT) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } + + DPRINTF("Checking clock ID=%d\n", x); + + if (uaudio20_check_rate(udev, + sc->sc_mixer_iface_no, x, rate)) { + DPRINTF("Unsupported sampling " + "rate, id=%d\n", x); + goto next_ep; + } + } + } else { + uint16_t wFormat; + + wFormat = UGETW(asid.v1->wFormatTag); + bChannels = UAUDIO_MAX_CHAN(asf1d.v1->bNrChannels); + bBitResolution = asf1d.v1->bBitResolution; + + if (asf1d.v1->bSamFreqType == 0) { DPRINTFN(16, "Sample rate: %d-%dHz\n", - UA_SAMP_LO(asf1d), UA_SAMP_HI(asf1d)); + UA_SAMP_LO(asf1d.v1), + UA_SAMP_HI(asf1d.v1)); - if ((rate >= UA_SAMP_LO(asf1d)) && - (rate <= UA_SAMP_HI(asf1d))) { + if ((rate >= UA_SAMP_LO(asf1d.v1)) && + (rate <= UA_SAMP_HI(asf1d.v1))) goto found_rate; - } } else { - for (x = 0; x < asf1d->bSamFreqType; x++) { + for (x = 0; x < asf1d.v1->bSamFreqType; x++) { DPRINTFN(16, "Sample rate = %dHz\n", - UA_GETSAMP(asf1d, x)); + UA_GETSAMP(asf1d.v1, x)); - if (rate == UA_GETSAMP(asf1d, x)) { + if (rate == UA_GETSAMP(asf1d.v1, x)) goto found_rate; - } } } - - audio_if = 0; - continue; + goto next_ep; found_rate: - - for (p_fmt = uaudio_formats; - p_fmt->wFormat; - p_fmt++) { + for (p_fmt = uaudio10_formats; + p_fmt->wFormat != 0; p_fmt++) { if ((p_fmt->wFormat == wFormat) && - (p_fmt->bPrecision == bBitResolution)) { - goto found_format; - } + (p_fmt->bPrecision == bBitResolution)) + break; + } + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; } - audio_if = 0; - continue; - - found_format: - - if ((bChannels == channels) && - (bBitResolution == bit_resolution)) { + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + } - chan = (ep_dir == UE_DIR_IN) ? - &sc->sc_rec_chan : - &sc->sc_play_chan; + chan = (ep_dir == UE_DIR_IN) ? + &sc->sc_rec_chan : &sc->sc_play_chan; - if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) { + if (chan->valid != 0 || + usbd_get_iface(udev, curidx) == NULL) { + DPRINTF("Channel already exists or " + "interface is not valid\n"); + goto next_ep; + } - chan->valid = 1; + chan->valid = 1; #ifdef USB_DEBUG - uaudio_chan_dump_ep_desc(ed1); - uaudio_chan_dump_ep_desc(ed2); - - if (sed->bmAttributes & UA_SED_FREQ_CONTROL) { - DPRINTFN(2, "FREQ_CONTROL\n"); - } - if (sed->bmAttributes & UA_SED_PITCH_CONTROL) { - DPRINTFN(2, "PITCH_CONTROL\n"); - } + uaudio_chan_dump_ep_desc(ed1); #endif - DPRINTF("Sample rate = %dHz, channels = %d, " - "bits = %d, format = %s\n", rate, channels, - bit_resolution, p_fmt->description); - - chan->sample_rate = rate; - chan->p_asid = asid; - chan->p_asf1d = asf1d; - chan->p_ed1 = ed1; - chan->p_ed2 = ed2; - chan->p_fmt = p_fmt; - chan->p_sed = sed; - chan->iface_index = curidx; - chan->iface_alt_index = alt_index; - - if (ep_dir == UE_DIR_IN) - chan->usb_cfg = - uaudio_cfg_record; - else - chan->usb_cfg = - uaudio_cfg_play; - - chan->sample_size = (( - UAUDIO_MAX_CHAN(chan->p_asf1d->bNrChannels) * - chan->p_asf1d->bBitResolution) / 8); - - if (ep_dir == UE_DIR_IN && - usbd_get_speed(udev) == USB_SPEED_FULL) { - uaudio_record_fix_fs(ed1, - chan->sample_size * (rate / 1000), - chan->sample_size * (rate / 4000)); - } + DPRINTF("Sample rate = %dHz, channels = %d, " + "bits = %d, format = %s\n", rate, channels, + bit_resolution, p_fmt->description); + + chan->sample_rate = rate; + chan->p_asf1d = asf1d; + chan->p_ed1 = ed1; + chan->p_fmt = p_fmt; + chan->p_sed = sed; + chan->iface_index = curidx; + chan->iface_alt_index = alt_index; - if (sc->sc_sndstat_valid) { - sbuf_printf(&sc->sc_sndstat, "\n\t" - "mode %d.%d:(%s) %dch, %d/%dbit, %s, %dHz", - curidx, alt_index, - (ep_dir == UE_DIR_IN) ? "input" : "output", - asf1d->bNrChannels, asf1d->bBitResolution, - asf1d->bSubFrameSize * 8, - p_fmt->description, rate); - } - } - } - audio_if = 0; - continue; - } + if (ep_dir == UE_DIR_IN) + chan->usb_cfg = uaudio_cfg_record; + else + chan->usb_cfg = uaudio_cfg_play; + + chan->sample_size = (UAUDIO_MAX_CHAN(channels) * + p_fmt->bPrecision) / 8; + chan->channels = channels; + + if (ep_dir == UE_DIR_IN && + usbd_get_speed(udev) == USB_SPEED_FULL) { + uaudio_record_fix_fs(ed1, + chan->sample_size * (rate / 1000), + chan->sample_size * (rate / 4000)); + } + + if (sc->sc_sndstat_valid != 0) { + sbuf_printf(&sc->sc_sndstat, "\n\t" + "mode %d.%d:(%s) %dch, %dbit, %s, %dHz", + curidx, alt_index, + (ep_dir == UE_DIR_IN) ? "input" : "output", + channels, p_fmt->bPrecision, + p_fmt->description, rate); + } + + next_ep: + sed.v1 = NULL; + ed1 = NULL; } } @@ -1137,7 +1419,7 @@ uaudio_chan_fill_info(struct uaudio_soft * disable surround setups on FULL-speed USB * by default */ - channels = 2; + channels = 4; break; default: channels = 16; @@ -1177,72 +1459,186 @@ done: } static void -uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error) +uaudio_chan_play_sync_callback(struct usb_xfer *xfer, usb_error_t error) { struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; - uint32_t total; - uint32_t blockcount; - uint32_t n; - uint32_t offset; + uint8_t buf[4]; + uint64_t temp; + int len; int actlen; - int sumlen; - - usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); + int nframes; - if (ch->end == ch->start) { - DPRINTF("no buffer!\n"); - return; - } + usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: -tr_transferred: - if (actlen < sumlen) { - DPRINTF("short transfer, " - "%d of %d bytes\n", actlen, sumlen); - } - chn_intr(ch->pcm_ch); - case USB_ST_SETUP: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 9 19:31:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6123A544; Fri, 9 Nov 2012 19:31:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 455198FC08; Fri, 9 Nov 2012 19:31:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9JVWiw041024; Fri, 9 Nov 2012 19:31:32 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9JVWGv041023; Fri, 9 Nov 2012 19:31:32 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211091931.qA9JVWGv041023@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 9 Nov 2012 19:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242836 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:31:32 -0000 Author: mjg Date: Fri Nov 9 19:31:31 2012 New Revision: 242836 URL: http://svnweb.freebsd.org/changeset/base/242836 Log: MFC r242680: Fix possible spurious sbunlock in sctp_sorecvmsg. Approved by: trasz (mentor) Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Fri Nov 9 18:56:27 2012 (r242835) +++ stable/9/sys/netinet/sctputil.c Fri Nov 9 19:31:31 2012 (r242836) @@ -5264,10 +5264,10 @@ sctp_sorecvmsg(struct socket *so, rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); } error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); - sockbuf_lock = 1; if (error) { goto release_unlocked; } + sockbuf_lock = 1; restart: From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 9 19:32:38 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 624736B9; Fri, 9 Nov 2012 19:32:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4817B8FC14; Fri, 9 Nov 2012 19:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9JWcHv041244; Fri, 9 Nov 2012 19:32:38 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9JWc1D041242; Fri, 9 Nov 2012 19:32:38 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211091932.qA9JWc1D041242@svn.freebsd.org> From: Dimitry Andric Date: Fri, 9 Nov 2012 19:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242837 - stable/9/lib/libpmc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:32:38 -0000 Author: dim Date: Fri Nov 9 19:32:37 2012 New Revision: 242837 URL: http://svnweb.freebsd.org/changeset/base/242837 Log: MFC r242622: Fix a few warnings from newer clang 3.2 in libpmc, about comparing enum pmc_event values against integer constants which fall outside the enum range. Reviewed by: fabient, sbruno Modified: stable/9/lib/libpmc/libpmc.c Directory Properties: stable/9/lib/libpmc/ (props changed) Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Fri Nov 9 19:31:31 2012 (r242836) +++ stable/9/lib/libpmc/libpmc.c Fri Nov 9 19:32:37 2012 (r242837) @@ -2261,7 +2261,7 @@ soft_allocate_pmc(enum pmc_event pe, cha (void)ctrspec; (void)pmc_config; - if (pe < PMC_EV_SOFT_FIRST || pe > PMC_EV_SOFT_LAST) + if ((int)pe < PMC_EV_SOFT_FIRST || (int)pe > PMC_EV_SOFT_LAST) return (-1); pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); @@ -3168,7 +3168,7 @@ _pmc_name_of_event(enum pmc_event pe, en } else if (pe == PMC_EV_TSC_TSC) { ev = tsc_event_table; evfence = tsc_event_table + PMC_EVENT_TABLE_SIZE(tsc); - } else if (pe >= PMC_EV_SOFT_FIRST && pe <= PMC_EV_SOFT_LAST) { + } else if ((int)pe >= PMC_EV_SOFT_FIRST && (int)pe <= PMC_EV_SOFT_LAST) { ev = soft_event_table; evfence = soft_event_table + soft_event_info.pm_nevent; } From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 9 19:35:46 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEC7E9C0; Fri, 9 Nov 2012 19:35:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98EED8FC12; Fri, 9 Nov 2012 19:35:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9JZkp1041782; Fri, 9 Nov 2012 19:35:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9JZkXF041781; Fri, 9 Nov 2012 19:35:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211091935.qA9JZkXF041781@svn.freebsd.org> From: Dimitry Andric Date: Fri, 9 Nov 2012 19:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242838 - stable/9/sys/contrib/ngatm/netnatm/msg X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:35:46 -0000 Author: dim Date: Fri Nov 9 19:35:46 2012 New Revision: 242838 URL: http://svnweb.freebsd.org/changeset/base/242838 Log: MFC r242623: In sys/contrib/ngatm/netnatm/msg/uni_ie.c, fix a few warnings from newer versions of clang 3.2, about comparing enum uni_cause values against integer constants which fall outside the enum range. No functional change. Modified: stable/9/sys/contrib/ngatm/netnatm/msg/uni_ie.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/contrib/ngatm/netnatm/msg/uni_ie.c ============================================================================== --- stable/9/sys/contrib/ngatm/netnatm/msg/uni_ie.c Fri Nov 9 19:32:37 2012 (r242837) +++ stable/9/sys/contrib/ngatm/netnatm/msg/uni_ie.c Fri Nov 9 19:35:46 2012 (r242838) @@ -869,7 +869,7 @@ UNI_DECLARE_CAUSE_VALUES enum uni_diag uni_diag(enum uni_cause cause, enum uni_coding code) { - if (cause >= 128) + if ((int)cause >= 128) return (UNI_DIAG_NONE); if (code == UNI_CODING_NET) @@ -925,9 +925,9 @@ print_cause(struct unicx *cx, struct uni if (uni_print_iehdr("cause", &ie->h, cx)) return; - if (ie->cause < 128 && tab1[ie->cause].str) + if ((int)ie->cause < 128 && tab1[ie->cause].str) strcpy(buf, tab1[ie->cause].str); - else if (ie->cause < 128 && tab2 != NULL && tab2[ie->cause].str != NULL) + else if ((int)ie->cause < 128 && tab2 != NULL && tab2[ie->cause].str != NULL) strcpy(buf, tab2[ie->cause].str); else { sprintf(buf, "UNKNOWN-%u", ie->cause); @@ -1059,7 +1059,7 @@ check_cause(struct uni_ie_cause *ie, str const struct causetab *ptr; - if (ie->cause >= 128) + if ((int)ie->cause >= 128) return (-1); switch (ie->loc) { From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 10 00:36:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21A44FE1; Sat, 10 Nov 2012 00:36:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 068FA8FC12; Sat, 10 Nov 2012 00:36:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA0areK091148; Sat, 10 Nov 2012 00:36:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA0arDU091147; Sat, 10 Nov 2012 00:36:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211100036.qAA0arDU091147@svn.freebsd.org> From: Dimitry Andric Date: Sat, 10 Nov 2012 00:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242843 - stable/9/usr.bin/clang/clang X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 00:36:54 -0000 Author: dim Date: Sat Nov 10 00:36:53 2012 New Revision: 242843 URL: http://svnweb.freebsd.org/changeset/base/242843 Log: MFC r242707: Belatedly add links from /usr/bin/clang to /usr/bin/CC, like it has been done for g++. Modified: stable/9/usr.bin/clang/clang/Makefile Directory Properties: stable/9/usr.bin/clang/ (props changed) Modified: stable/9/usr.bin/clang/clang/Makefile ============================================================================== --- stable/9/usr.bin/clang/clang/Makefile Sat Nov 10 00:32:47 2012 (r242842) +++ stable/9/usr.bin/clang/clang/Makefile Sat Nov 10 00:36:53 2012 (r242843) @@ -20,9 +20,11 @@ MLINKS= clang.1 clang++.1 \ .if ${MK_CLANG_IS_CC} != "no" LINKS+= ${BINDIR}/clang ${BINDIR}/cc \ ${BINDIR}/clang ${BINDIR}/c++ \ + ${BINDIR}/clang ${BINDIR}/CC \ ${BINDIR}/clang ${BINDIR}/cpp MLINKS+= clang.1 cc.1 \ clang.1 c++.1 \ + clang.1 CC.1 \ clang.1 cpp.1 .endif From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 10 12:04:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DB2C86A; Sat, 10 Nov 2012 12:04:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 591918FC12; Sat, 10 Nov 2012 12:04:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAC43gZ001975; Sat, 10 Nov 2012 12:04:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAC43Xe001973; Sat, 10 Nov 2012 12:04:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101204.qAAC43Xe001973@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242856 - in stable/9/sys: amd64/pci i386/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:04:03 -0000 Author: avg Date: Sat Nov 10 12:04:02 2012 New Revision: 242856 URL: http://svnweb.freebsd.org/changeset/base/242856 Log: MFC r241540: pciereg_cfg*: use assembly to access the mem-mapped cfg space Modified: stable/9/sys/amd64/pci/pci_cfgreg.c stable/9/sys/i386/pci/pci_cfgreg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/pci/pci_cfgreg.c ============================================================================== --- stable/9/sys/amd64/pci/pci_cfgreg.c Sat Nov 10 11:55:52 2012 (r242855) +++ stable/9/sys/amd64/pci/pci_cfgreg.c Sat Nov 10 12:04:02 2012 (r242856) @@ -295,6 +295,13 @@ pcie_cfgregopen(uint64_t base, uint8_t m return (1); } +/* + * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h + * have a requirement that all accesses to the memory mapped PCI configuration + * space are done using AX class of registers. + * Since other vendors do not currently have any contradicting requirements + * the AMD access pattern is applied universally. + */ #define PCIE_VADDR(base, reg, bus, slot, func) \ ((base) + \ ((((bus) & 0xff) << 20) | \ @@ -317,13 +324,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - data = *(volatile uint32_t *)(va); + __asm __volatile("mov %1, %%eax" : "=a" (data) + : "m" (*(uint32_t *)va)); break; case 2: - data = *(volatile uint16_t *)(va); + __asm __volatile("movzwl %1, %%eax" : "=a" (data) + : "m" (*(uint16_t *)va)); break; case 1: - data = *(volatile uint8_t *)(va); + __asm __volatile("movzbl %1, %%eax" : "=a" (data) + : "m" (*(uint8_t *)va)); break; } @@ -344,13 +354,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - *(volatile uint32_t *)(va) = data; + __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + : "a" (data)); break; case 2: - *(volatile uint16_t *)(va) = data; + __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) + : "a" (data)); break; case 1: - *(volatile uint8_t *)(va) = data; + __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) + : "a" (data)); break; } } Modified: stable/9/sys/i386/pci/pci_cfgreg.c ============================================================================== --- stable/9/sys/i386/pci/pci_cfgreg.c Sat Nov 10 11:55:52 2012 (r242855) +++ stable/9/sys/i386/pci/pci_cfgreg.c Sat Nov 10 12:04:02 2012 (r242856) @@ -652,6 +652,14 @@ pciereg_findelem(vm_paddr_t papage) return (elem); } +/* + * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h + * have a requirement that all accesses to the memory mapped PCI configuration + * space are done using AX class of registers. + * Since other vendors do not currently have any contradicting requirements + * the AMD access pattern is applied universally. + */ + static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, unsigned bytes) @@ -673,13 +681,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - data = *(volatile uint32_t *)(va); + __asm __volatile("mov %1, %%eax" : "=a" (data) + : "m" (*(uint32_t *)va)); break; case 2: - data = *(volatile uint16_t *)(va); + __asm __volatile("movzwl %1, %%eax" : "=a" (data) + : "m" (*(uint16_t *)va)); break; case 1: - data = *(volatile uint8_t *)(va); + __asm __volatile("movzbl %1, %%eax" : "=a" (data) + : "m" (*(uint8_t *)va)); break; } @@ -707,13 +718,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - *(volatile uint32_t *)(va) = data; + __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + : "a" (data)); break; case 2: - *(volatile uint16_t *)(va) = data; + __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) + : "a" (data)); break; case 1: - *(volatile uint8_t *)(va) = data; + __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) + : "a" (data)); break; } From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 10 12:06:25 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05BFAB5C; Sat, 10 Nov 2012 12:06:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE8088FC13; Sat, 10 Nov 2012 12:06:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAC6OwQ002538; Sat, 10 Nov 2012 12:06:24 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAC6O8I002537; Sat, 10 Nov 2012 12:06:24 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101206.qAAC6O8I002537@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242858 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:06:25 -0000 Author: avg Date: Sat Nov 10 12:06:24 2012 New Revision: 242858 URL: http://svnweb.freebsd.org/changeset/base/242858 Log: MFC r241773: zfs: wait in arc_lowmem only if curproc == pageproc Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 12:04:22 2012 (r242857) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 12:06:24 2012 (r242858) @@ -3718,8 +3718,16 @@ arc_lowmem(void *arg __unused, int howto mutex_enter(&arc_reclaim_thr_lock); needfree = 1; cv_signal(&arc_reclaim_thr_cv); - while (needfree) - msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + + /* + * It is unsafe to block here in arbitrary threads, because we can come + * here from ARC itself and may hold ARC locks and thus risk a deadlock + * with ARC reclaim thread. + */ + if (curproc == pageproc) { + while (needfree) + msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + } mutex_exit(&arc_reclaim_thr_lock); mutex_exit(&arc_lowmem_lock); } From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 10 12:08:06 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A12A1E2F; Sat, 10 Nov 2012 12:08:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 871058FC08; Sat, 10 Nov 2012 12:08:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAC86pK003094; Sat, 10 Nov 2012 12:08:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAC86HQ003093; Sat, 10 Nov 2012 12:08:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101208.qAAC86HQ003093@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242860 - stable/9/sys/dev/cpuctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:08:06 -0000 Author: avg Date: Sat Nov 10 12:08:06 2012 New Revision: 242860 URL: http://svnweb.freebsd.org/changeset/base/242860 Log: MFC r242565: cpuctl_do_cpuid: explicitly use ecx=0 for cpuid call Modified: stable/9/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/9/sys/dev/cpuctl/cpuctl.c Sat Nov 10 12:06:36 2012 (r242859) +++ stable/9/sys/dev/cpuctl/cpuctl.c Sat Nov 10 12:08:06 2012 (r242860) @@ -204,7 +204,7 @@ cpuctl_do_cpuid(int cpu, cpuctl_cpuid_ar oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); - do_cpuid(data->level, data->data); + cpuid_count(data->level, 0, data->data); restore_cpu(oldcpu, is_bound, td); return (0); }