From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 28 01:25:12 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6165106566C; Sun, 28 Feb 2010 01:25:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA5C38FC14; Sun, 28 Feb 2010 01:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1S1PCHM030898; Sun, 28 Feb 2010 01:25:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1S1PCQd030895; Sun, 28 Feb 2010 01:25:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002280125.o1S1PCQd030895@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 28 Feb 2010 01:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204438 - in stable/8/sys/ia64: ia64 include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2010 01:25:12 -0000 Author: marcel Date: Sun Feb 28 01:25:12 2010 New Revision: 204438 URL: http://svn.freebsd.org/changeset/base/204438 Log: MFC rev 204182: Remove pm_active from struct pmap as it serves no purpose. Modified: stable/8/sys/ia64/ia64/pmap.c stable/8/sys/ia64/include/pmap.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/ia64/ia64/pmap.c ============================================================================== --- stable/8/sys/ia64/ia64/pmap.c Sat Feb 27 23:42:32 2010 (r204437) +++ stable/8/sys/ia64/ia64/pmap.c Sun Feb 28 01:25:12 2010 (r204438) @@ -453,7 +453,6 @@ pmap_bootstrap() PMAP_LOCK_INIT(kernel_pmap); for (i = 0; i < 5; i++) kernel_pmap->pm_rid[i] = 0; - kernel_pmap->pm_active = 1; TAILQ_INIT(&kernel_pmap->pm_pvlist); PCPU_SET(md.current_pmap, kernel_pmap); @@ -662,7 +661,6 @@ pmap_pinit(struct pmap *pmap) PMAP_LOCK_INIT(pmap); for (i = 0; i < 5; i++) pmap->pm_rid[i] = pmap_allocate_rid(); - pmap->pm_active = 0; TAILQ_INIT(&pmap->pm_pvlist); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); return (1); @@ -2246,8 +2244,6 @@ pmap_switch(pmap_t pm) prevpm = PCPU_GET(md.current_pmap); if (prevpm == pm) goto out; - if (prevpm != NULL) - atomic_clear_32(&prevpm->pm_active, PCPU_GET(cpumask)); if (pm == NULL) { for (i = 0; i < 5; i++) { ia64_set_rr(IA64_RR_BASE(i), @@ -2258,7 +2254,6 @@ pmap_switch(pmap_t pm) ia64_set_rr(IA64_RR_BASE(i), (pm->pm_rid[i] << 8)|(PAGE_SHIFT << 2)|1); } - atomic_set_32(&pm->pm_active, PCPU_GET(cpumask)); } PCPU_SET(md.current_pmap, pm); ia64_srlz_d(); Modified: stable/8/sys/ia64/include/pmap.h ============================================================================== --- stable/8/sys/ia64/include/pmap.h Sat Feb 27 23:42:32 2010 (r204437) +++ stable/8/sys/ia64/include/pmap.h Sun Feb 28 01:25:12 2010 (r204438) @@ -76,7 +76,6 @@ struct pmap { struct mtx pm_mtx; TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ u_int32_t pm_rid[5]; /* base RID for pmap */ - int pm_active; /* active flag */ struct pmap_statistics pm_stats; /* pmap statistics */ }; From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 28 06:07:53 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4BB0106566C; Sun, 28 Feb 2010 06:07:53 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D46958FC15; Sun, 28 Feb 2010 06:07:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1S67riI092848; Sun, 28 Feb 2010 06:07:53 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1S67rvK092846; Sun, 28 Feb 2010 06:07:53 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002280607.o1S67rvK092846@svn.freebsd.org> From: Matt Jacob Date: Sun, 28 Feb 2010 06:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204442 - stable/8/sys/dev/isp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2010 06:07:54 -0000 Author: mjacob Date: Sun Feb 28 06:07:53 2010 New Revision: 204442 URL: http://svn.freebsd.org/changeset/base/204442 Log: MFC of 204384: Fix misallocation error in target mode Modified: stable/8/sys/dev/isp/isp_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/isp/isp_pci.c ============================================================================== --- stable/8/sys/dev/isp/isp_pci.c Sun Feb 28 04:12:29 2010 (r204441) +++ stable/8/sys/dev/isp/isp_pci.c Sun Feb 28 06:07:53 2010 (r204442) @@ -1529,7 +1529,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) } isp->isp_xffree = isp->isp_xflist; #ifdef ISP_TARGET_MODE - len = sizeof (isp_hdl_t *) * isp->isp_maxcmds; + len = sizeof (isp_hdl_t) * isp->isp_maxcmds; isp->isp_tgtlist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); if (isp->isp_tgtlist == NULL) { free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 28 11:14:29 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE5B11065674; Sun, 28 Feb 2010 11:14:29 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3F818FC17; Sun, 28 Feb 2010 11:14:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1SBETCo061001; Sun, 28 Feb 2010 11:14:29 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1SBETTq060998; Sun, 28 Feb 2010 11:14:29 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002281114.o1SBETTq060998@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 28 Feb 2010 11:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204444 - in stable/8: sbin/devfs share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2010 11:14:30 -0000 Author: gavin Date: Sun Feb 28 11:14:29 2010 New Revision: 204444 URL: http://svn.freebsd.org/changeset/base/204444 Log: Merge r204166 from head: Document the interaction between /etc/devfs.conf and /etc/defaults/devfs.conf PR: docs/117308 Submitted by: Mel (partially) Modified: stable/8/sbin/devfs/devfs.8 stable/8/share/man/man5/devfs.rules.5 Directory Properties: stable/8/sbin/devfs/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/sbin/devfs/devfs.8 ============================================================================== --- stable/8/sbin/devfs/devfs.8 Sun Feb 28 06:16:41 2010 (r204443) +++ stable/8/sbin/devfs/devfs.8 Sun Feb 28 11:14:29 2010 (r204444) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2008 +.Dd February 21, 2010 .Dt DEVFS 8 .Os .Sh NAME @@ -196,6 +196,9 @@ Apply all the rules in ruleset number to the node. This does not necessarily result in any changes to the node (e.g., if none of the rules in the included ruleset match). +Include commands in the referenced +.Ar ruleset +are not resolved. .It Cm mode Ar filemode Set the file mode to .Ar filemode , @@ -243,7 +246,9 @@ configuration file. .It Pa /etc/devfs.rules Local .Nm -configuration file. +configuration file. Rulesets in here override those in +.Pa /etc/defaults/devfs.rules +with the same ruleset number, otherwise the two files are effectively merged. .It Pa /etc/devfs.conf Boot-time .Nm Modified: stable/8/share/man/man5/devfs.rules.5 ============================================================================== --- stable/8/share/man/man5/devfs.rules.5 Sun Feb 28 06:16:41 2010 (r204443) +++ stable/8/share/man/man5/devfs.rules.5 Sun Feb 28 11:14:29 2010 (r204444) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2006 +.Dd February 21, 2010 .Dt DEVFS.RULES 5 .Os .Sh NAME @@ -83,8 +83,16 @@ devfs_system_ruleset="localrules" .Ed .Sh FILES .Bl -tag -compact -.It Pa /etc/devfs.rules .It Pa /etc/defaults/devfs.rules +Default +.Nm +configuration file. +.It Pa /etc/devfs.rules +Local +.Nm +configuration file. Rulesets in here override those in +.Pa /etc/defaults/devfs.rules +with the same ruleset number, otherwise the two files are effectively merged. .El .Sh EXAMPLES To make all the partitions of From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 28 14:04:20 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1591065670; Sun, 28 Feb 2010 14:04:20 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF5738FC1C; Sun, 28 Feb 2010 14:04:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1SE4KxQ098445; Sun, 28 Feb 2010 14:04:20 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1SE4KA0098443; Sun, 28 Feb 2010 14:04:20 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002281404.o1SE4KA0098443@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 28 Feb 2010 14:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204448 - stable/8/bin/ls X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2010 14:04:21 -0000 Author: jh Date: Sun Feb 28 14:04:20 2010 New Revision: 204448 URL: http://svn.freebsd.org/changeset/base/204448 Log: MFC r203665: Make sure that FTS_COMFOLLOW is not set when the -P option is in effect. Otherwise the -i option will show the inode number of the referenced file for symbolic links given on the command line. Similarly, the file color was printed according to the link target in colorized output. PR: bin/102394 Modified: stable/8/bin/ls/ls.c Directory Properties: stable/8/bin/ls/ (props changed) Modified: stable/8/bin/ls/ls.c ============================================================================== --- stable/8/bin/ls/ls.c Sun Feb 28 13:31:29 2010 (r204447) +++ stable/8/bin/ls/ls.c Sun Feb 28 14:04:20 2010 (r204448) @@ -113,6 +113,7 @@ static int f_listdir; /* list actual di static int f_listdot; /* list files beginning with . */ static int f_noautodot; /* do not automatically enable -A for root */ int f_longform; /* long listing format */ +static int f_nofollow; /* don't follow symbolic link arguments */ int f_nonprint; /* show unprintables as ? */ static int f_nosort; /* don't sort output */ int f_notabs; /* don't use tab-separated multi-col output */ @@ -234,6 +235,7 @@ main(int argc, char *argv[]) break; case 'H': fts_options |= FTS_COMFOLLOW; + f_nofollow = 0; break; case 'G': setenv("CLICOLOR", "", 1); @@ -241,11 +243,13 @@ main(int argc, char *argv[]) case 'L': fts_options &= ~FTS_PHYSICAL; fts_options |= FTS_LOGICAL; + f_nofollow = 0; break; case 'P': fts_options &= ~FTS_COMFOLLOW; fts_options &= ~FTS_LOGICAL; fts_options |= FTS_PHYSICAL; + f_nofollow = 1; break; case 'R': f_recursive = 1; @@ -396,10 +400,10 @@ main(int argc, char *argv[]) fts_options |= FTS_NOSTAT; /* - * If not -F, -d or -l options, follow any symbolic links listed on + * If not -F, -P, -d or -l options, follow any symbolic links listed on * the command line. */ - if (!f_longform && !f_listdir && !f_type) + if (!f_nofollow && !f_longform && !f_listdir && !f_type) fts_options |= FTS_COMFOLLOW; /* From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 28 21:28:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 050FB106566B; Sun, 28 Feb 2010 21:28:25 +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 E6F5D8FC0C; Sun, 28 Feb 2010 21:28:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1SLSOTa097516; Sun, 28 Feb 2010 21:28:24 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1SLSO9i097514; Sun, 28 Feb 2010 21:28:24 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201002282128.o1SLSO9i097514@svn.freebsd.org> From: Andriy Gapon Date: Sun, 28 Feb 2010 21:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204482 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2010 21:28:25 -0000 Author: avg Date: Sun Feb 28 21:28:24 2010 New Revision: 204482 URL: http://svn.freebsd.org/changeset/base/204482 Log: MFC r203061: KASSERT contract of return value of interrupt filter X-MFCto7 after: 1 week Modified: stable/8/sys/kern/kern_intr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/kern/kern_intr.c ============================================================================== --- stable/8/sys/kern/kern_intr.c Sun Feb 28 21:23:50 2010 (r204481) +++ stable/8/sys/kern/kern_intr.c Sun Feb 28 21:28:24 2010 (r204482) @@ -1378,6 +1378,12 @@ intr_event_handle(struct intr_event *ie, ret = ih->ih_filter(frame); else ret = ih->ih_filter(ih->ih_argument); + KASSERT(ret == FILTER_STRAY || + ((ret & (FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) != 0 && + (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) == 0), + ("%s: incorrect return value %#x from %s", __func__, ret, + ih->ih_name)); + /* * Wrapper handler special handling: * @@ -1546,7 +1552,11 @@ intr_filter_loop(struct intr_event *ie, thread_only = 1; continue; } - + KASSERT(ret == FILTER_STRAY || + ((ret & (FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) != 0 && + (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) == 0), + ("%s: incorrect return value %#x from %s", __func__, ret, + ih->ih_name)); if (ret & FILTER_STRAY) continue; else { From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 28 21:30:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80149106566C; Sun, 28 Feb 2010 21:30:46 +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 6EC328FC17; Sun, 28 Feb 2010 21:30:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1SLUk0b098063; Sun, 28 Feb 2010 21:30:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1SLUktG098061; Sun, 28 Feb 2010 21:30:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201002282130.o1SLUktG098061@svn.freebsd.org> From: Andriy Gapon Date: Sun, 28 Feb 2010 21:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204483 - stable/8/sys/dev/acpica X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2010 21:30:46 -0000 Author: avg Date: Sun Feb 28 21:30:46 2010 New Revision: 204483 URL: http://svn.freebsd.org/changeset/base/204483 Log: MFC r203430: acpi_cpu: correct capabilities arguments for Processor _OSC Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Sun Feb 28 21:28:24 2010 (r204482) +++ stable/8/sys/dev/acpica/acpi_cpu.c Sun Feb 28 21:30:46 2010 (r204483) @@ -378,7 +378,8 @@ acpi_cpu_attach(device_t dev) arg[3].Type = ACPI_TYPE_BUFFER; arg[3].Buffer.Length = sizeof(cap_set); /* Capabilities buffer */ arg[3].Buffer.Pointer = (uint8_t *)cap_set; - cap_set[0] = 0; + cap_set[0] = 0; /* status */ + cap_set[1] = sc->cpu_features; AcpiEvaluateObject(sc->cpu_handle, "_OSC", &arglist, NULL); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 28 21:43:48 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36E82106566B; Sun, 28 Feb 2010 21:43: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 0ACCF8FC08; Sun, 28 Feb 2010 21:43:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1SLhlgF001196; Sun, 28 Feb 2010 21:43:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1SLhlUe001194; Sun, 28 Feb 2010 21:43:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201002282143.o1SLhlUe001194@svn.freebsd.org> From: Andriy Gapon Date: Sun, 28 Feb 2010 21:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204485 - stable/8/sys/dev/acpica X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2010 21:43:48 -0000 Author: avg Date: Sun Feb 28 21:43:47 2010 New Revision: 204485 URL: http://svn.freebsd.org/changeset/base/204485 Log: MFC r203546: acpi_cpu: prefer _OSC over _PDC Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Sun Feb 28 21:32:10 2010 (r204484) +++ stable/8/sys/dev/acpica/acpi_cpu.c Sun Feb 28 21:43:47 2010 (r204485) @@ -345,28 +345,11 @@ acpi_cpu_attach(device_t dev) } /* - * CPU capabilities are specified as a buffer of 32-bit integers: - * revision, count, and one or more capabilities. The revision of - * "1" is not specified anywhere but seems to match Linux. + * CPU capabilities are specified in + * Intel Processor Vendor-Specific ACPI Interface Specification. */ if (sc->cpu_features) { arglist.Pointer = arg; - arglist.Count = 1; - arg[0].Type = ACPI_TYPE_BUFFER; - arg[0].Buffer.Length = sizeof(cap_set); - arg[0].Buffer.Pointer = (uint8_t *)cap_set; - cap_set[0] = 1; /* revision */ - cap_set[1] = 1; /* number of capabilities integers */ - cap_set[2] = sc->cpu_features; - AcpiEvaluateObject(sc->cpu_handle, "_PDC", &arglist, NULL); - - /* - * On some systems we need to evaluate _OSC so that the ASL - * loads the _PSS and/or _PDC methods at runtime. - * - * TODO: evaluate failure of _OSC. - */ - arglist.Pointer = arg; arglist.Count = 4; arg[0].Type = ACPI_TYPE_BUFFER; arg[0].Buffer.Length = sizeof(cpu_oscuuid); @@ -380,7 +363,22 @@ acpi_cpu_attach(device_t dev) arg[3].Buffer.Pointer = (uint8_t *)cap_set; cap_set[0] = 0; /* status */ cap_set[1] = sc->cpu_features; - AcpiEvaluateObject(sc->cpu_handle, "_OSC", &arglist, NULL); + status = AcpiEvaluateObject(sc->cpu_handle, "_OSC", &arglist, NULL); + if (ACPI_SUCCESS(status)) { + if (cap_set[0] != 0) + device_printf(dev, "_OSC returned status %#x\n", cap_set[0]); + } + else { + arglist.Pointer = arg; + arglist.Count = 1; + arg[0].Type = ACPI_TYPE_BUFFER; + arg[0].Buffer.Length = sizeof(cap_set); + arg[0].Buffer.Pointer = (uint8_t *)cap_set; + cap_set[0] = 1; /* revision */ + cap_set[1] = 1; /* number of capabilities integers */ + cap_set[2] = sc->cpu_features; + AcpiEvaluateObject(sc->cpu_handle, "_PDC", &arglist, NULL); + } } /* Probe for Cx state support. */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 28 22:25:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0481B106564A; Sun, 28 Feb 2010 22:25:40 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E53518FC13; Sun, 28 Feb 2010 22:25:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1SMPdHW010757; Sun, 28 Feb 2010 22:25:39 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1SMPdaE010750; Sun, 28 Feb 2010 22:25:39 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201002282225.o1SMPdaE010750@svn.freebsd.org> From: Joerg Wunsch Date: Sun, 28 Feb 2010 22:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204491 - stable/8/sys/dev/ieee488 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2010 22:25:40 -0000 Author: joerg Date: Sun Feb 28 22:25:39 2010 New Revision: 204491 URL: http://svn.freebsd.org/changeset/base/204491 Log: MFC r203360 GPIB overhaul, part #2: make the tnt4882 driver work with the newer TNT5004 IC. This involved a major rewrite of a number of things, as this chip no longer supports the NAT7210 legacy mode but requires the host to use the (more modern) FIFO mode. In theory, this also ought to work on the older TNT4882C chip. I'll probably add this as optional support (perhaps by a device.hints flag) later on. By now, FIFO mode is *only* activates iff a TNT5004 chip has been detected (where the old code didn't work at all), while everything else is supposed to use the old code. Added: stable/8/sys/dev/ieee488/tnt4882.h - copied unchanged from r203360, head/sys/dev/ieee488/tnt4882.h Modified: stable/8/sys/dev/ieee488/ibfoo.c stable/8/sys/dev/ieee488/pcii.c stable/8/sys/dev/ieee488/tnt4882.c stable/8/sys/dev/ieee488/upd7210.c stable/8/sys/dev/ieee488/upd7210.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ieee488/ibfoo.c ============================================================================== --- stable/8/sys/dev/ieee488/ibfoo.c Sun Feb 28 22:09:09 2010 (r204490) +++ stable/8/sys/dev/ieee488/ibfoo.c Sun Feb 28 22:25:39 2010 (r204491) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2005 Poul-Henning Kamp + * Copyright (c) 2010 Joerg Wunsch * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,6 +55,7 @@ __FBSDID("$FreeBSD$"); #define UPD7210_SW_DRIVER #include +#include static MALLOC_DEFINE(M_IBFOO, "IBFOO", "IBFOO"); @@ -94,7 +97,10 @@ struct ibfoo { PIO_IDATA, PIO_ODATA, PIO_CMD, - DMA_IDATA + DMA_IDATA, + FIFO_IDATA, + FIFO_ODATA, + FIFO_CMD } mode; struct timeval deadline; @@ -170,7 +176,7 @@ ib_set_errno(struct ibarg *ap, int errno } static int -gpib_ib_irq(struct upd7210 *u, int intr __unused) +gpib_ib_irq(struct upd7210 *u, int isr_3) { struct ibfoo *ib; @@ -211,11 +217,53 @@ gpib_ib_irq(struct upd7210 *u, int intr if (!(u->rreg[ISR1] & IXR1_ENDRX)) return (0); break; + case FIFO_IDATA: + if (!(isr_3 & 0x15)) + return (0); + while (ib->buflen != 0 && (isr_3 & 0x04 /* NEF */) != 0) { + *ib->buf = bus_read_1(u->reg_res[0], fifob); + ib->buf++; + ib->buflen--; + isr_3 = bus_read_1(u->reg_res[0], isr3); + } + if ((isr_3 & 0x01) != 0 /* xfr done */ || + (u->rreg[ISR1] & IXR1_ENDRX) != 0 || + ib->buflen == 0) + break; + if (isr_3 & 0x10) + /* xfr stopped */ + bus_write_1(u->reg_res[0], cmdr, 0x04); /* GO */ + upd7210_wr(u, AUXMR, AUXMR_RFD); + return (1); + case FIFO_CMD: + case FIFO_ODATA: + if (!(isr_3 & 0x19)) + return (0); + if (ib->buflen == 0) + /* xfr DONE */ + break; + while (ib->buflen != 0 && (isr_3 & 0x08 /* NFF */) != 0) { + bus_write_1(u->reg_res[0], fifob, *ib->buf); + ib->buf++; + ib->buflen--; + isr_3 = bus_read_1(u->reg_res[0], isr3); + } + if (isr_3 & 0x10) + /* xfr stopped */ + bus_write_1(u->reg_res[0], cmdr, 0x04); /* GO */ + if (ib->buflen == 0) + /* no more NFF interrupts wanted */ + bus_write_1(u->reg_res[0], imr3, 0x11); /* STOP IE, DONE IE */ + return (1); default: return (0); } upd7210_wr(u, IMR1, 0); upd7210_wr(u, IMR2, 0); + if (u->use_fifo) { + bus_write_1(u->reg_res[0], imr3, 0x00); + bus_write_1(u->reg_res[0], cmdr, 0x22); /* soft RESET */ + } ib->mode = BUSY; wakeup(&ib->buflen); return (1); @@ -227,6 +275,7 @@ gpib_ib_timeout(void *arg) struct upd7210 *u; struct ibfoo *ib; struct timeval tv; + u_int isr_3; u = arg; ib = u->ibfoo; @@ -241,7 +290,11 @@ gpib_ib_timeout(void *arg) if (ib->mode > BUSY) { upd7210_rd(u, ISR1); upd7210_rd(u, ISR2); - gpib_ib_irq(u, 2); + if (u->use_fifo) + isr_3 = bus_read_1(u->reg_res[0], isr3); + else + isr_3 = 0; + gpib_ib_irq(u, isr_3); } if (ib->mode != IDLE && timevalisset(&ib->deadline)) { getmicrouptime(&tv); @@ -249,6 +302,10 @@ gpib_ib_timeout(void *arg) ib_had_timeout(ib->ap); upd7210_wr(u, IMR1, 0); upd7210_wr(u, IMR2, 0); + if (u->use_fifo) { + bus_write_1(u->reg_res[0], imr3, 0x00); + bus_write_1(u->reg_res[0], cmdr, 0x22); /* soft RESET */ + } ib->mode = BUSY; wakeup(&ib->buflen); } @@ -280,6 +337,8 @@ gpib_ib_wait_xfer(struct upd7210 *u, str ib->buf = NULL; upd7210_wr(u, IMR1, 0); upd7210_wr(u, IMR2, 0); + if (u->use_fifo) + bus_write_1(u->reg_res[0], imr3, 0x00); } static void @@ -335,15 +394,31 @@ pio_cmd(struct upd7210 *u, u_char *cmd, ib->wrh = NULL; } mtx_lock(&u->mutex); - ib->mode = PIO_CMD; ib->buf = cmd; ib->buflen = len; - upd7210_wr(u, IMR2, IXR2_CO); - - gpib_ib_irq(u, 1); + if (u->use_fifo) { + /* TNT5004 or TNT4882 in FIFO mode */ + ib->mode = FIFO_CMD; + upd7210_wr(u, AUXMR, 0x51); /* holdoff immediately */ + bus_write_1(u->reg_res[0], cmdr, 0x10); /* reset FIFO */ + bus_write_1(u->reg_res[0], cfg, 0x80); /* CMD, xfer OUT, 8-bit FIFO */ + bus_write_1(u->reg_res[0], imr3, 0x19); /* STOP IE, NFF IE, DONE IE */ + bus_write_1(u->reg_res[0], cnt0, -len); + bus_write_1(u->reg_res[0], cnt1, (-len) >> 8); + bus_write_1(u->reg_res[0], cnt2, (-len) >> 16); + bus_write_1(u->reg_res[0], cnt3, (-len) >> 24); + bus_write_1(u->reg_res[0], cmdr, 0x04); /* GO */ + } else { + ib->mode = PIO_CMD; + upd7210_wr(u, IMR2, IXR2_CO); + gpib_ib_irq(u, 0); + } gpib_ib_wait_xfer(u, ib); + if (u->use_fifo) + bus_write_1(u->reg_res[0], cmdr, 0x08); /* STOP */ + mtx_unlock(&u->mutex); return (len - ib->buflen); } @@ -358,13 +433,32 @@ pio_odata(struct upd7210 *u, u_char *dat if (len == 0) return (0); mtx_lock(&u->mutex); - ib->mode = PIO_ODATA; ib->buf = data; ib->buflen = len; - upd7210_wr(u, IMR1, IXR1_DO); + if (u->use_fifo) { + /* TNT5004 or TNT4882 in FIFO mode */ + ib->mode = FIFO_ODATA; + bus_write_1(u->reg_res[0], cmdr, 0x10); /* reset FIFO */ + if (ib->doeoi) + bus_write_1(u->reg_res[0], cfg, 0x08); /* CCEN */ + else + bus_write_1(u->reg_res[0], cfg, 0x00); /* xfer OUT, 8-bit FIFO */ + bus_write_1(u->reg_res[0], imr3, 0x19); /* STOP IE, NFF IE, DONE IE */ + bus_write_1(u->reg_res[0], cnt0, -len); + bus_write_1(u->reg_res[0], cnt1, (-len) >> 8); + bus_write_1(u->reg_res[0], cnt2, (-len) >> 16); + bus_write_1(u->reg_res[0], cnt3, (-len) >> 24); + bus_write_1(u->reg_res[0], cmdr, 0x04); /* GO */ + } else { + ib->mode = PIO_ODATA; + upd7210_wr(u, IMR1, IXR1_DO); + } gpib_ib_wait_xfer(u, ib); + if (u->use_fifo) + bus_write_1(u->reg_res[0], cmdr, 0x08); /* STOP */ + mtx_unlock(&u->mutex); return (len - ib->buflen); } @@ -377,13 +471,30 @@ pio_idata(struct upd7210 *u, u_char *dat ib = u->ibfoo; mtx_lock(&u->mutex); - ib->mode = PIO_IDATA; ib->buf = data; ib->buflen = len; - upd7210_wr(u, IMR1, IXR1_DI); + if (u->use_fifo) { + /* TNT5004 or TNT4882 in FIFO mode */ + ib->mode = FIFO_IDATA; + bus_write_1(u->reg_res[0], cmdr, 0x10); /* reset FIFO */ + bus_write_1(u->reg_res[0], cfg, 0x20); /* xfer IN, 8-bit FIFO */ + bus_write_1(u->reg_res[0], cnt0, -len); + bus_write_1(u->reg_res[0], cnt1, (-len) >> 8); + bus_write_1(u->reg_res[0], cnt2, (-len) >> 16); + bus_write_1(u->reg_res[0], cnt3, (-len) >> 24); + bus_write_1(u->reg_res[0], cmdr, 0x04); /* GO */ + upd7210_wr(u, AUXMR, AUXMR_RFD); + bus_write_1(u->reg_res[0], imr3, 0x15); /* STOP IE, NEF IE, DONE IE */ + } else { + ib->mode = PIO_IDATA; + upd7210_wr(u, IMR1, IXR1_DI); + } gpib_ib_wait_xfer(u, ib); + if (u->use_fifo) + bus_write_1(u->reg_res[0], cmdr, 0x08); /* STOP */ + mtx_unlock(&u->mutex); return (len - ib->buflen); } @@ -832,6 +943,12 @@ gpib_ib_open(struct cdev *dev, int oflag upd7210_wr(u, AUXMR, C_AUXB + 3); upd7210_wr(u, AUXMR, C_AUXE + 0); upd7210_wr(u, AUXMR, AUXMR_PON); + if (u->use_fifo) { + bus_write_1(u->reg_res[0], imr3, 0x00); + bus_write_1(u->reg_res[0], cmdr, 0x22); /* soft reset */ + bus_write_1(u->reg_res[0], cmdr, 0x03); /* set system + * controller bit */ + } upd7210_wr(u, AUXMR, AUXMR_CIFC); DELAY(100); upd7210_wr(u, AUXMR, AUXMR_SIFC); @@ -864,6 +981,11 @@ gpib_ib_close(struct cdev *dev, int ofla ibdebug = 0; upd7210_wr(u, IMR1, 0x00); upd7210_wr(u, IMR2, 0x00); + if (u->use_fifo) { + bus_write_1(u->reg_res[0], imr3, 0x00); + bus_write_1(u->reg_res[0], cmdr, 0x02); /* clear system + * controller bit */ + } upd7210_wr(u, AUXMR, AUXMR_CRST); DELAY(10000); mtx_unlock(&u->mutex); Modified: stable/8/sys/dev/ieee488/pcii.c ============================================================================== --- stable/8/sys/dev/ieee488/pcii.c Sun Feb 28 22:09:09 2010 (r204490) +++ stable/8/sys/dev/ieee488/pcii.c Sun Feb 28 22:25:39 2010 (r204491) @@ -238,6 +238,7 @@ pcii_attach(device_t dev) sc->upd7210.reg_offset[rid] = 0; } sc->upd7210.irq_clear_res = sc->res[10]; + sc->upd7210.use_fifo = 0; if (sc->res[1] == NULL) sc->upd7210.dmachan = -1; @@ -245,7 +246,9 @@ pcii_attach(device_t dev) sc->upd7210.dmachan = rman_get_start(sc->res[1]); upd7210attach(&sc->upd7210); - return (error); + device_printf(dev, "attached gpib%d\n", sc->upd7210.unit); + + return (0); } DRIVER_MODULE(pcii, isa, pcii_driver, pcii_devclass, 0, 0); Modified: stable/8/sys/dev/ieee488/tnt4882.c ============================================================================== --- stable/8/sys/dev/ieee488/tnt4882.c Sun Feb 28 22:09:09 2010 (r204490) +++ stable/8/sys/dev/ieee488/tnt4882.c Sun Feb 28 22:25:39 2010 (r204491) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2005 Poul-Henning Kamp + * Copyright (c) 2010 Joerg Wunsch * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,6 +47,7 @@ #define UPD7210_HW_DRIVER 1 #include +#include struct tnt_softc { int foo; @@ -62,55 +64,6 @@ static struct resource_spec tnt_res_spec { -1, 0 } }; -enum tnt4882reg { - dir = 0x00, - cdor = 0x00, - isr1 = 0x02, - imr1 = 0x02, - isr2 = 0x04, - imr2 = 0x04, - accwr = 0x05, - spsr = 0x06, - spmr = 0x06, - intr = 0x07, - adsr = 0x08, - admr = 0x08, - cnt2 = 0x09, - cptr = 0x0a, - auxmr = 0x0a, - tauxcr = 0x0a, /* 9914 mode register */ - cnt3 = 0x0b, - adr0 = 0x0c, - adr = 0x0c, - hssel = 0x0d, - adr1 = 0x0e, - eosr = 0x0e, - sts1 = 0x10, - cfg = 0x10, - dsr = 0x11, - sh_cnt = 0x11, - imr3 = 0x12, - hier = 0x13, - cnt0 = 0x14, - misc = 0x15, - cnt1 = 0x16, - csr = 0x17, - keyreg = 0x17, - fifob = 0x18, - fifoa = 0x19, - isr3 = 0x1a, - ccr = 0x1a, - sasr = 0x1b, - dcr = 0x1b, - sts2 = 0x1c, - cmdr = 0x1c, - isr0 = 0x1d, - imr0 = 0x1d, - timer = 0x1e, - bsr = 0x1f, - bcr = 0x1f -}; - struct tst { enum {RD, WT, xDELAY, END} action; @@ -276,6 +229,7 @@ tnt_attach(device_t dev) { struct tnt_softc *sc; int error, i; + uint8_t version; sc = device_get_softc(dev); @@ -286,7 +240,7 @@ tnt_attach(device_t dev) error = bus_setup_intr(dev, sc->res[2], INTR_TYPE_MISC | INTR_MPSAFE, NULL, upd7210intr, &sc->upd7210, &sc->intr_handler); - /* Necessary magic for MITE */ + /* IO Device Window Base Size Register (IODWBSR) */ bus_write_4(sc->res[0], 0xc0, rman_get_start(sc->res[1]) | 0x80); tst_exec(sc, tst_reset, "Reset"); @@ -298,6 +252,18 @@ tnt_attach(device_t dev) tst_exec(sc, tst_count0_1, "COUNT0:1"); tst_exec(sc, tst_reset, "Reset"); + version = bus_read_1(sc->res[1], csr); + version = (version >> 4) & 0x0f; + device_printf(dev, "Chip version 0x%02x (TNT%s)\n", + version, + version >= 4? "5004 or above": "4882"); + if (version >= 4) { + device_printf(dev, "Forcing FIFO mode\n"); + sc->upd7210.use_fifo = 1; + } else { + sc->upd7210.use_fifo = 0; + } + /* pass 7210 interrupts through */ bus_write_1(sc->res[1], imr3, 0x02); @@ -313,6 +279,11 @@ tnt_attach(device_t dev) sc->upd7210.irq_clear_res = NULL; upd7210attach(&sc->upd7210); + device_printf(dev, "attached gpib%d\n", sc->upd7210.unit); + + if (sc->upd7210.use_fifo) + bus_write_1(sc->res[0], hssel, 0x01); /* one-chip mode */ + return (0); } Copied: stable/8/sys/dev/ieee488/tnt4882.h (from r203360, head/sys/dev/ieee488/tnt4882.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/ieee488/tnt4882.h Sun Feb 28 22:25:39 2010 (r204491, copy of r203360, head/sys/dev/ieee488/tnt4882.h) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2010 Joerg Wunsch + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +enum tnt4882reg { + dir = 0x00, + cdor = 0x00, + isr1 = 0x02, + imr1 = 0x02, + isr2 = 0x04, + imr2 = 0x04, + accwr = 0x05, + spsr = 0x06, + spmr = 0x06, + intr = 0x07, + adsr = 0x08, + admr = 0x08, + cnt2 = 0x09, + cptr = 0x0a, + auxmr = 0x0a, + tauxcr = 0x0a, /* 9914 mode register */ + cnt3 = 0x0b, + adr0 = 0x0c, + adr = 0x0c, + hssel = 0x0d, + adr1 = 0x0e, + eosr = 0x0e, + sts1 = 0x10, + cfg = 0x10, + dsr = 0x11, + sh_cnt = 0x11, + imr3 = 0x12, + hier = 0x13, + cnt0 = 0x14, + misc = 0x15, + cnt1 = 0x16, + csr = 0x17, + keyreg = 0x17, + fifob = 0x18, + fifoa = 0x19, + isr3 = 0x1a, + ccr = 0x1a, + sasr = 0x1b, + dcr = 0x1b, + sts2 = 0x1c, + cmdr = 0x1c, + isr0 = 0x1d, + imr0 = 0x1d, + timer = 0x1e, + bsr = 0x1f, + bcr = 0x1f +}; + Modified: stable/8/sys/dev/ieee488/upd7210.c ============================================================================== --- stable/8/sys/dev/ieee488/upd7210.c Sun Feb 28 22:09:09 2010 (r204490) +++ stable/8/sys/dev/ieee488/upd7210.c Sun Feb 28 22:25:39 2010 (r204491) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #define UPD7210_HW_DRIVER #define UPD7210_SW_DRIVER #include +#include static MALLOC_DEFINE(M_GPIB, "GPIB", "GPIB"); @@ -90,15 +91,20 @@ upd7210_wr(struct upd7210 *u, enum upd72 void upd7210intr(void *arg) { - u_int isr1, isr2; + u_int isr_1, isr_2, isr_3; struct upd7210 *u; u = arg; mtx_lock(&u->mutex); - isr1 = upd7210_rd(u, ISR1); - isr2 = upd7210_rd(u, ISR2); - if (isr1 != 0 || isr2 != 0) { - if (u->busy == 0 || u->irq == NULL || !u->irq(u, 1)) { + isr_1 = upd7210_rd(u, ISR1); + isr_2 = upd7210_rd(u, ISR2); + if (u->use_fifo) { + isr_3 = bus_read_1(u->reg_res[0], isr3); + } else { + isr_3 = 0; + } + if (isr_1 != 0 || isr_2 != 0 || isr_3 != 0) { + if (u->busy == 0 || u->irq == NULL || !u->irq(u, isr_3)) { #if 0 printf("upd7210intr [%02x %02x %02x", upd7210_rd(u, DIR), isr1, isr2); @@ -168,17 +174,38 @@ upd7210_goto_standby(struct upd7210 *u) /* Unaddressed Listen Only mode */ static int -gpib_l_irq(struct upd7210 *u, int intr __unused) +gpib_l_irq(struct upd7210 *u, int isr_3) { int i; + int have_data = 0; - if (u->rreg[ISR1] & 1) { + if (u->use_fifo) { + /* TNT5004 or TNT4882 in FIFO mode */ + if (isr_3 & 0x04) { + /* FIFO not empty */ + i = bus_read_1(u->reg_res[0], fifob); + have_data = 1; + bus_write_1(u->reg_res[0], cnt0, -1); + bus_write_1(u->reg_res[0], cnt1, (-1) >> 8); + bus_write_1(u->reg_res[0], cnt2, (-1) >> 16); + bus_write_1(u->reg_res[0], cnt3, (-1) >> 24); + bus_write_1(u->reg_res[0], cmdr, 0x04); /* GO */ + } + } else if (u->rreg[ISR1] & 1) { i = upd7210_rd(u, DIR); + have_data = 1; + } + + if (have_data) { u->buf[u->buf_wp++] = i; u->buf_wp &= (u->bufsize - 1); i = (u->buf_rp + u->bufsize - u->buf_wp) & (u->bufsize - 1); - if (i < 8) - upd7210_wr(u, IMR1, 0); + if (i < 8) { + if (u->use_fifo) + bus_write_1(u->reg_res[0], imr3, 0x00); + else + upd7210_wr(u, IMR1, 0); + } wakeup(u->buf); return (1); } @@ -206,15 +233,28 @@ gpib_l_open(struct cdev *dev, int oflags u->buf_wp = 0; u->buf_rp = 0; - upd7210_wr(u, AUXMR, AUXMR_CRST); + upd7210_wr(u, AUXMR, AUXMR_CRST); /* chip reset */ DELAY(10000); - upd7210_wr(u, AUXMR, C_ICR | 8); + upd7210_wr(u, AUXMR, C_ICR | 8); /* 8 MHz clock */ DELAY(1000); - upd7210_wr(u, ADR, 0x60); - upd7210_wr(u, ADR, 0xe0); - upd7210_wr(u, ADMR, 0x70); - upd7210_wr(u, AUXMR, AUXMR_PON); - upd7210_wr(u, IMR1, 0x01); + upd7210_wr(u, ADR, 0x60); /* ADR0: disable listener and talker 0 */ + upd7210_wr(u, ADR, 0xe0); /* ADR1: disable listener and talker 1 */ + upd7210_wr(u, ADMR, 0x70); /* listen-only (lon) */ + upd7210_wr(u, AUXMR, AUXMR_PON); /* immediate execute power-on (pon) */ + if (u->use_fifo) { + /* TNT5004 or TNT4882 in FIFO mode */ + bus_write_1(u->reg_res[0], cmdr, 0x10); /* reset FIFO */ + bus_write_1(u->reg_res[0], cfg, 0x20); /* xfer IN, 8-bit FIFO */ + bus_write_1(u->reg_res[0], cnt0, -1); + bus_write_1(u->reg_res[0], cnt1, (-1) >> 8); + bus_write_1(u->reg_res[0], cnt2, (-1) >> 16); + bus_write_1(u->reg_res[0], cnt3, (-1) >> 24); + bus_write_1(u->reg_res[0], cmdr, 0x04); /* GO */ + bus_write_1(u->reg_res[0], imr3, 0x04); /* NEF IE */ + } else { + /* µPD7210/NAT7210, or TNT4882 in non-FIFO mode */ + upd7210_wr(u, IMR1, 0x01); /* data in interrupt enable */ + } return (0); } @@ -227,6 +267,11 @@ gpib_l_close(struct cdev *dev, int oflag mtx_lock(&u->mutex); u->busy = 0; + if (u->use_fifo) { + /* TNT5004 or TNT4882 in FIFO mode */ + bus_write_1(u->reg_res[0], cmdr, 0x22); /* soft RESET */ + bus_write_1(u->reg_res[0], imr3, 0x00); + } upd7210_wr(u, AUXMR, AUXMR_CRST); DELAY(10000); upd7210_wr(u, IMR1, 0x00); @@ -271,8 +316,12 @@ gpib_l_read(struct cdev *dev, struct uio u->buf_rp += z; u->buf_rp &= (u->bufsize - 1); } - if (u->wreg[IMR1] == 0) - upd7210_wr(u, IMR1, 0x01); + if (u->use_fifo) { + bus_write_1(u->reg_res[0], imr3, 0x04); /* NFF IE */ + } else { + if (u->wreg[IMR1] == 0) + upd7210_wr(u, IMR1, 0x01); + } mtx_unlock(&u->mutex); return (error); } Modified: stable/8/sys/dev/ieee488/upd7210.h ============================================================================== --- stable/8/sys/dev/ieee488/upd7210.h Sun Feb 28 22:09:09 2010 (r204490) +++ stable/8/sys/dev/ieee488/upd7210.h Sun Feb 28 22:25:39 2010 (r204491) @@ -53,6 +53,7 @@ struct upd7210 { u_int reg_offset[8]; int dmachan; int unit; + int use_fifo; /* private stuff */ struct mtx mutex; From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 00:35:30 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCF6A106566C; Mon, 1 Mar 2010 00:35:30 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAC7D8FC16; Mon, 1 Mar 2010 00:35:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o210ZUcJ039544; Mon, 1 Mar 2010 00:35:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o210ZUot039542; Mon, 1 Mar 2010 00:35:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003010035.o210ZUot039542@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 1 Mar 2010 00:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204495 - stable/8/sys/boot/powerpc/ofw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 00:35:30 -0000 Author: nwhitehorn Date: Mon Mar 1 00:35:30 2010 New Revision: 204495 URL: http://svn.freebsd.org/changeset/base/204495 Log: MFC r204129: Enable NETIF_OPEN_CLOSE_ONCE on PowerPC OFW. This fixes netbooting on PowerPC Book-S hardware, which had been broken for a very long time. Submitted by: Andreas Tobler Modified: stable/8/sys/boot/powerpc/ofw/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/boot/powerpc/ofw/Makefile ============================================================================== --- stable/8/sys/boot/powerpc/ofw/Makefile Mon Mar 1 00:27:55 2010 (r204494) +++ stable/8/sys/boot/powerpc/ofw/Makefile Mon Mar 1 00:35:30 2010 (r204495) @@ -56,6 +56,11 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../.. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif +# Avoid the open-close-dance for every file access as some firmwares perform +# an auto-negotiation on every open of the network interface and thus causes +# netbooting to take horribly long. +CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE + # Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 00:38:21 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CAEF106564A; Mon, 1 Mar 2010 00:38:21 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 304A78FC15; Mon, 1 Mar 2010 00:38:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o210cLdY040207; Mon, 1 Mar 2010 00:38:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o210cLnA040205; Mon, 1 Mar 2010 00:38:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003010038.o210cLnA040205@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 1 Mar 2010 00:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204496 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 00:38:21 -0000 Author: nwhitehorn Date: Mon Mar 1 00:38:20 2010 New Revision: 204496 URL: http://svn.freebsd.org/changeset/base/204496 Log: MFC r204197: Allow user programs to execute mfpvr instructions. Linux allows this, and some math-related software like GMP expects to be able to use it to pick a target appropriately. Reported by: Jakob van Santen Modified: stable/8/sys/powerpc/aim/trap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/powerpc/aim/trap.c ============================================================================== --- stable/8/sys/powerpc/aim/trap.c Mon Mar 1 00:35:30 2010 (r204495) +++ stable/8/sys/powerpc/aim/trap.c Mon Mar 1 00:38:20 2010 (r204496) @@ -82,6 +82,7 @@ static void printtrap(u_int vector, stru int user); static int trap_pfault(struct trapframe *frame, int user); static int fix_unaligned(struct thread *td, struct trapframe *frame); +static int ppc_instr_emulate(struct trapframe *frame); static int handle_onfault(struct trapframe *frame); static void syscall(struct trapframe *frame); @@ -211,7 +212,9 @@ trap(struct trapframe *frame) /* Identify the trap reason */ if (frame->srr1 & EXC_PGM_TRAP) sig = SIGTRAP; - else + else if (ppc_instr_emulate(frame) == 0) + frame->srr0 += 4; + else sig = SIGILL; break; @@ -632,3 +635,21 @@ fix_unaligned(struct thread *td, struct return -1; } + +static int +ppc_instr_emulate(struct trapframe *frame) +{ + uint32_t instr; + int reg; + + instr = fuword32((void *)frame->srr0); + + if ((instr & 0xfc1fffff) == 0x7c1f42a6) { /* mfpvr */ + reg = (instr & ~0xfc1fffff) >> 21; + frame->fixreg[reg] = mfpvr(); + return (0); + } + + return (-1); +} + From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 11:33:09 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D78661065673; Mon, 1 Mar 2010 11:33:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C60CF8FC0A; Mon, 1 Mar 2010 11:33:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o21BX9cX085782; Mon, 1 Mar 2010 11:33:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o21BX9i4085780; Mon, 1 Mar 2010 11:33:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003011133.o21BX9i4085780@svn.freebsd.org> From: Alexander Motin Date: Mon, 1 Mar 2010 11:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204514 - stable/8/sys/dev/mpt X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 11:33:10 -0000 Author: mav Date: Mon Mar 1 11:33:09 2010 New Revision: 204514 URL: http://svn.freebsd.org/changeset/base/204514 Log: MFC r204356: Store path for rescan to the right place. This should fix panic on boot, introduced by r203108. Modified: stable/8/sys/dev/mpt/mpt_raid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Mon Mar 1 10:43:12 2010 (r204513) +++ stable/8/sys/dev/mpt/mpt_raid.c Mon Mar 1 11:33:09 2010 (r204514) @@ -690,7 +690,6 @@ mpt_raid_thread(void *arg) if (mpt->raid_rescan != 0) { union ccb *ccb; - struct cam_path *path; int error; mpt->raid_rescan = 0; @@ -699,7 +698,7 @@ mpt_raid_thread(void *arg) ccb = xpt_alloc_ccb(); MPT_LOCK(mpt); - error = xpt_create_path(&path, xpt_periph, + error = xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(mpt->phydisk_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (error != CAM_REQ_CMP) { From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 17:36:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3D1C1065673; Mon, 1 Mar 2010 17:36:45 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B52D8FC1A; Mon, 1 Mar 2010 17:36:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o21Hajjc066951; Mon, 1 Mar 2010 17:36:45 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o21HajXe066942; Mon, 1 Mar 2010 17:36:45 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201003011736.o21HajXe066942@svn.freebsd.org> From: Matt Jacob Date: Mon, 1 Mar 2010 17:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204524 - stable/8/sys/dev/isp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 17:36:46 -0000 Author: mjacob Date: Mon Mar 1 17:36:45 2010 New Revision: 204524 URL: http://svn.freebsd.org/changeset/base/204524 Log: MFC of 204397: fix problems with fast posting handles Modified: stable/8/sys/dev/isp/isp.c stable/8/sys/dev/isp/isp_freebsd.c stable/8/sys/dev/isp/isp_library.c stable/8/sys/dev/isp/isp_library.h stable/8/sys/dev/isp/isp_pci.c stable/8/sys/dev/isp/isp_target.c stable/8/sys/dev/isp/ispmbox.h stable/8/sys/dev/isp/ispreg.h Modified: stable/8/sys/dev/isp/isp.c ============================================================================== --- stable/8/sys/dev/isp/isp.c Mon Mar 1 17:20:04 2010 (r204523) +++ stable/8/sys/dev/isp/isp.c Mon Mar 1 17:36:45 2010 (r204524) @@ -108,10 +108,11 @@ static const uint8_t alpa_map[] = { * Local function prototypes. */ static int isp_parse_async(ispsoftc_t *, uint16_t); +static int isp_parse_async_fc(ispsoftc_t *, uint16_t); static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *); static void isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); -static void isp_fastpost_complete(ispsoftc_t *, uint16_t); +static void isp_fastpost_complete(ispsoftc_t *, uint32_t); static int isp_mbox_continue(ispsoftc_t *); static void isp_scsi_init(ispsoftc_t *); static void isp_scsi_channel_init(ispsoftc_t *, int); @@ -1334,23 +1335,24 @@ isp_scsi_init(ispsoftc_t *isp) } /* - * Turn on Fast Posting, LVD transitions + * Turn on LVD transitions for ULTRA2 or better and other features * - * Ultra2 F/W always has had fast posting (and LVD transitions) - * - * Ultra and older (i.e., SBus) cards may not. It's just safer - * to assume not for them. + * Now that we have 32 bit handles, don't do any fast posting + * any more. For Ultra2/Ultra3 cards, we can turn on 32 bit RIO + * operation or use fast posting. To be conservative, we'll only + * do this for Ultra3 cards now because the other cards are so + * rare for this author to find and test with. */ MBSINIT(&mbs, MBOX_SET_FW_FEATURES, MBLOGALL, 0); if (IS_ULTRA2(isp)) mbs.param[1] |= FW_FEATURE_LVD_NOTIFY; -#ifndef ISP_NO_RIO - if (IS_ULTRA2(isp) || IS_1240(isp)) - mbs.param[1] |= FW_FEATURE_RIO_16BIT; -#else - if (IS_ULTRA2(isp) || IS_1240(isp)) +#ifdef ISP_NO_RIO + if (IS_ULTRA3(isp)) mbs.param[1] |= FW_FEATURE_FAST_POST; +#else + if (IS_ULTRA3(isp)) + mbs.param[1] |= FW_FEATURE_RIO_32BIT; #endif if (mbs.param[1] != 0) { uint16_t sfeat = mbs.param[1]; @@ -1604,25 +1606,15 @@ isp_fibre_init(ispsoftc_t *isp) } if (IS_2200(isp)) { /* - * There seems to just be too much breakage here - * with RIO and Fast Posting- it probably actually - * works okay but this driver is messing it up. - * This card is really ancient by now, so let's - * just opt for safety and not use the feature. + * We can't have Fast Posting any more- we now + * have 32 bit handles. + * + * RIO seemed to have to much breakage. + * + * Just opt for safety. */ -#if 0 - if (ISP_FW_NEWER_THAN(isp, 1, 17, 0)) { - icbp->icb_xfwoptions |= ICBXOPT_RIO_16BIT; - icbp->icb_fwoptions &= ~ICBOPT_FAST_POST; - icbp->icb_racctimer = 4; - icbp->icb_idelaytimer = 8; - } else { - icbp->icb_fwoptions |= ICBOPT_FAST_POST; - } -#else icbp->icb_xfwoptions &= ~ICBXOPT_RIO_16BIT; icbp->icb_fwoptions &= ~ICBOPT_FAST_POST; -#endif } else { /* * QLogic recommends that FAST Posting be turned @@ -4860,7 +4852,7 @@ again: */ if (sema) { fmbox: - if (mbox & 0x4000) { + if (mbox & MBOX_COMMAND_COMPLETE) { isp->isp_intmboxc++; if (isp->isp_mboxbsy) { int obits = isp->isp_obits; @@ -4880,10 +4872,13 @@ again: } else { isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", mbox); } - } else if (isp_parse_async(isp, mbox) < 0) { - return; + } else { + i = IS_FC(isp)? isp_parse_async_fc(isp, mbox) : isp_parse_async(isp, mbox); + if (i < 0) { + return; + } } - if ((IS_FC(isp) && mbox != ASYNC_RIO_RESP) || isp->isp_state != ISP_RUNSTATE) { + if ((IS_FC(isp) && mbox != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { goto out; } } @@ -5065,9 +5060,9 @@ again: req_status_flags = sp->req_status_flags; req_state_flags = sp->req_state_flags; resid = sp->req_resid; - } else if (etype == RQSTYPE_RIO2) { - isp_rio2_t *rio = (isp_rio2_t *)qe; - isp_get_rio2(isp, (isp_rio2_t *) hp, rio); + } else if (etype == RQSTYPE_RIO1) { + isp_rio1_t *rio = (isp_rio1_t *) qe; + isp_get_rio1(isp, (isp_rio1_t *) hp, rio); if (isp->isp_dblev & ISP_LOGDEBUG1) { isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, rio); } @@ -5079,6 +5074,10 @@ again: } ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ continue; + } else if (etype == RQSTYPE_RIO2) { + isp_prt(isp, ISP_LOGERR, "dropping RIO2 response\n"); + ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ + continue; } else { /* * Somebody reachable via isp_handle_other_response @@ -5391,40 +5390,35 @@ out: * Support routines. */ -#define GET_24XX_BUS(isp, chan, msg) \ - if (IS_24XX(isp)) { \ - chan = ISP_READ(isp, OUTMAILBOX3) & 0xff; \ - if (chan >= isp->isp_nchan) { \ - isp_prt(isp, ISP_LOGERR, "bogus channel %u for %s at line %d", chan, msg, __LINE__); \ - break; \ - } \ - } - +/* + * Parse an ASYNC mailbox complete + * + * Return non-zero if the event has been acknowledged. + */ static int isp_parse_async(ispsoftc_t *isp, uint16_t mbox) { - int rval = 0; - int pattern = 0; - uint16_t chan; + int acked = 0; + uint32_t h1 = 0, h2 = 0; + uint16_t chan = 0; - if (IS_DUALBUS(isp)) { - chan = ISP_READ(isp, OUTMAILBOX6); - } else { - chan = 0; + /* + * Pick up the channel, but not if this is a ASYNC_RIO32_2, + * where Mailboxes 6/7 have the second handle. + */ + if (mbox != ASYNC_RIO32_2) { + if (IS_DUALBUS(isp)) { + chan = ISP_READ(isp, OUTMAILBOX6); + } } isp_prt(isp, ISP_LOGDEBUG2, "Async Mbox 0x%x", mbox); switch (mbox) { case ASYNC_BUS_RESET: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_BUS_RESET for FC card"); - break; - } ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif isp_async(isp, ISPASYNC_BUS_RESET, chan); @@ -5432,10 +5426,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ case ASYNC_SYSTEM_ERROR: isp->isp_dead = 1; isp->isp_state = ISP_CRASHED; - if (IS_FC(isp)) { - FCPARAM(isp, chan)->isp_loopstate = LOOP_NIL; - FCPARAM(isp, chan)->isp_fwstate = FW_CONFIG_WAIT; - } /* * Were we waiting for a mailbox command to complete? * If so, it's dead, so wake up the waiter. @@ -5450,7 +5440,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ * restart the firmware */ isp_async(isp, ISPASYNC_FW_CRASH); - rval = -1; + acked = 1; break; case ASYNC_RQS_XFER_ERR: @@ -5462,17 +5452,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ break; case ASYNC_QWAKEUP: -#ifdef ISP_TARGET_MODE - if (IS_24XX(isp)) { - isp_prt(isp, ISP_LOGERR, "ATIO Queue Transfer Error"); - break; - } -#endif - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_QWAKEUP for FC card"); - break; - } /* * We've just been notified that the Queue has woken up. * We don't need to be chatty about this- just unlatch things @@ -5482,82 +5461,45 @@ isp_parse_async(ispsoftc_t *isp, uint16_ break; case ASYNC_TIMEOUT_RESET: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_TIMEOUT_RESET for FC card"); - break; - } - isp_prt(isp, ISP_LOGWARN, - "timeout initiated SCSI bus reset of chan %d", chan); + isp_prt(isp, ISP_LOGWARN, "timeout initiated SCSI bus reset of chan %d", chan); ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif break; case ASYNC_DEVICE_RESET: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL DEVICE_RESET for FC card"); - break; - } isp_prt(isp, ISP_LOGINFO, "device reset on chan %d", chan); ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif break; case ASYNC_EXTMSG_UNDERRUN: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_EXTMSG_UNDERRUN for FC card"); - break; - } isp_prt(isp, ISP_LOGWARN, "extended message underrun"); break; case ASYNC_SCAM_INT: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_SCAM_INT for FC card"); - break; - } isp_prt(isp, ISP_LOGINFO, "SCAM interrupt"); break; case ASYNC_HUNG_SCSI: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_HUNG_SCSI for FC card"); - break; - } - isp_prt(isp, ISP_LOGERR, - "stalled SCSI Bus after DATA Overrun"); + isp_prt(isp, ISP_LOGERR, "stalled SCSI Bus after DATA Overrun"); /* XXX: Need to issue SCSI reset at this point */ break; case ASYNC_KILLED_BUS: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_KILLED_BUS for FC card"); - break; - } isp_prt(isp, ISP_LOGERR, "SCSI Bus reset after DATA Overrun"); break; case ASYNC_BUS_TRANSIT: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_BUS_TRANSIT for FC card"); - break; - } mbox = ISP_READ(isp, OUTMAILBOX2); - switch (mbox & 0x1c00) { + switch (mbox & SXP_PINS_MODE_MASK) { case SXP_PINS_LVD_MODE: isp_prt(isp, ISP_LOGINFO, "Transition to LVD mode"); SDPARAM(isp, chan)->isp_diffmode = 0; @@ -5590,70 +5532,142 @@ isp_parse_async(ispsoftc_t *isp, uint16_ ISP_SET_SENDMARKER(isp, chan, 1); break; - case ASYNC_RIO5: - pattern = 0xce; /* outgoing mailbox regs 1-3, 6-7 */ + case ASYNC_CMD_CMPLT: + case ASYNC_RIO32_1: + if (!IS_ULTRA3(isp)) { + isp_prt(isp, ISP_LOGERR, "unexpected fast posting completion"); + break; + } + /* FALLTHROUGH */ + h1 = (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1); + break; + + case ASYNC_RIO32_2: + h1 = (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1); + h2 = (ISP_READ(isp, OUTMAILBOX7) << 16) | ISP_READ(isp, OUTMAILBOX6); + break; + + case ASYNC_RIO16_5: + case ASYNC_RIO16_4: + case ASYNC_RIO16_3: + case ASYNC_RIO16_2: + case ASYNC_RIO16_1: + isp_prt(isp, ISP_LOGERR, "unexpected 16 bit RIO handle"); + break; + default: + isp_prt(isp, ISP_LOGWARN, "%s: unhandled async code 0x%x", __func__, mbox); + break; + } + + if (h1 || h2) { + isp_prt(isp, ISP_LOGDEBUG3, "fast post/rio completion of 0x%08x", h1); + isp_fastpost_complete(isp, h1); + if (h2) { + isp_prt(isp, ISP_LOGDEBUG3, "fast post/rio completion of 0x%08x", h2); + isp_fastpost_complete(isp, h2); + if (isp->isp_fpcchiwater < 2) { + isp->isp_fpcchiwater = 2; + } + } else { + if (isp->isp_fpcchiwater < 1) { + isp->isp_fpcchiwater = 1; + } + } + } else { + isp->isp_intoasync++; + } + return (acked); +} + +#define GET_24XX_BUS(isp, chan, msg) \ + if (IS_24XX(isp)) { \ + chan = ISP_READ(isp, OUTMAILBOX3) & 0xff; \ + if (chan >= isp->isp_nchan) { \ + isp_prt(isp, ISP_LOGERR, "bogus channel %u for %s at line %d", chan, msg, __LINE__); \ + break; \ + } \ + } + + +static int +isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox) +{ + int acked = 0; + uint16_t chan; + + if (IS_DUALBUS(isp)) { + chan = ISP_READ(isp, OUTMAILBOX6); + } else { + chan = 0; + } + isp_prt(isp, ISP_LOGDEBUG2, "Async Mbox 0x%x", mbox); + + switch (mbox) { + case ASYNC_SYSTEM_ERROR: + isp->isp_dead = 1; + isp->isp_state = ISP_CRASHED; + FCPARAM(isp, chan)->isp_loopstate = LOOP_NIL; + FCPARAM(isp, chan)->isp_fwstate = FW_CONFIG_WAIT; + /* + * Were we waiting for a mailbox command to complete? + * If so, it's dead, so wake up the waiter. + */ + if (isp->isp_mboxbsy) { + isp->isp_obits = 1; + isp->isp_mboxtmp[0] = MBOX_HOST_INTERFACE_ERROR; + MBOX_NOTIFY_COMPLETE(isp); + } + /* + * It's up to the handler for isp_async to reinit stuff and + * restart the firmware + */ + isp_async(isp, ISPASYNC_FW_CRASH); + acked = 1; break; - case ASYNC_RIO4: - pattern = 0x4e; /* outgoing mailbox regs 1-3, 6 */ + case ASYNC_RQS_XFER_ERR: + isp_prt(isp, ISP_LOGERR, "Request Queue Transfer Error"); break; - case ASYNC_RIO3: - pattern = 0x0e; /* outgoing mailbox regs 1-3 */ + case ASYNC_RSP_XFER_ERR: + isp_prt(isp, ISP_LOGERR, "Response Queue Transfer Error"); break; - case ASYNC_RIO2: - pattern = 0x06; /* outgoing mailbox regs 1-2 */ + case ASYNC_QWAKEUP: +#ifdef ISP_TARGET_MODE + if (IS_24XX(isp)) { + isp_prt(isp, ISP_LOGERR, "ATIO Queue Transfer Error"); + break; + } +#endif + isp_prt(isp, ISP_LOGERR, "%s: unexpected ASYNC_QWAKEUP code", __func__); break; - case ASYNC_RIO1: case ASYNC_CMD_CMPLT: - pattern = 0x02; /* outgoing mailbox regs 1 */ + isp_fastpost_complete(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1)); + if (isp->isp_fpcchiwater < 1) { + isp->isp_fpcchiwater = 1; + } break; - case ASYNC_RIO_RESP: - return (rval); + case ASYNC_RIOZIO_STALL: + break; case ASYNC_CTIO_DONE: - { #ifdef ISP_TARGET_MODE - int handle; - if (IS_SCSI(isp) || IS_24XX(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad ASYNC_CTIO_DONE for %s cards", - IS_SCSI(isp)? "SCSI" : "24XX"); - break; - } - handle = - (ISP_READ(isp, OUTMAILBOX2) << 16) | - (ISP_READ(isp, OUTMAILBOX1)); - if (isp_target_async(isp, handle, mbox)) { - rval = -1; + if (isp_target_async(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1), mbox)) { + acked = 1; } else { - /* count it as a fast posting intr */ isp->isp_fphccmplt++; } #else - if (IS_SCSI(isp) || IS_24XX(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad ASYNC_CTIO_DONE for %s cards", - IS_SCSI(isp)? "SCSI" : "24XX"); - break; - } - isp_prt(isp, ISP_LOGINFO, "Fast Posting CTIO done"); - isp->isp_fphccmplt++; /* count it as a fast posting intr */ + isp_prt(isp, ISP_LOGWARN, "unexpected ASYNC CTIO done"); #endif break; - } case ASYNC_LIP_ERROR: case ASYNC_LIP_F8: case ASYNC_LIP_OCCURRED: case ASYNC_PTPMODE: - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad LIP event for SCSI cards"); - break; - } /* * These are broadcast events that have to be sent across * all active channels. @@ -5673,7 +5687,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_LIP, chan); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif /* @@ -5708,11 +5722,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ break; case ASYNC_LOOP_UP: - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad LOOP UP event for SCSI cards"); - break; - } /* * This is a broadcast event that has to be sent across * all active channels. @@ -5732,18 +5741,13 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_LOOP_UP, chan); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif } break; case ASYNC_LOOP_DOWN: - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad LOOP DOWN event for SCSI cards"); - break; - } /* * This is a broadcast event that has to be sent across * all active channels. @@ -5762,18 +5766,13 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_LOOP_DOWN, chan); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif } break; case ASYNC_LOOP_RESET: - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad LIP RESET event for SCSI cards"); - break; - } /* * This is a broadcast event that has to be sent across * all active channels. @@ -5792,7 +5791,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_LOOP_RESET, chan); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif } @@ -5801,11 +5800,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ case ASYNC_PDB_CHANGED: { int nphdl, nlstate, reason; - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad PDB CHANGED event for SCSI cards"); - break; - } /* * We *should* get a channel out of the 24XX, but we don't seem * to get more than a PDB CHANGED on channel 0, so turn it into @@ -5828,8 +5822,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ ISP_SET_SENDMARKER(isp, chan, 1); fcp->isp_loopstate = LOOP_PDB_RCVD; ISP_MARK_PORTDB(isp, chan, 1); - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, - ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason); + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason); } break; } @@ -5837,11 +5830,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ { int lochan, hichan; - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad CHANGE NOTIFY event for SCSI cards"); - break; - } if (ISP_FW_NEWER_THAN(isp, 4, 0, 25) && ISP_CAP_MULTI_ID(isp)) { GET_24XX_BUS(isp, chan, "ASYNC_CHANGE_NOTIFY"); lochan = chan; @@ -5863,8 +5851,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ fcp->isp_loopstate = LOOP_PDB_RCVD; } ISP_MARK_PORTDB(isp, chan, 1); - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, - ISPASYNC_CHANGE_SNS); + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_SNS); } break; } @@ -5874,8 +5861,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ * This only applies to 2100 amd 2200 cards */ if (!IS_2200(isp) && !IS_2100(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad card for ASYNC_CONNMODE event"); + isp_prt(isp, ISP_LOGWARN, "bad card for ASYNC_CONNMODE event"); break; } chan = 0; @@ -5909,8 +5895,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ "Unknown connection mode (0x%x)", mbox); break; } - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, - ISPASYNC_CHANGE_OTHER); + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_OTHER); FCPARAM(isp, chan)->sendmarker = 1; FCPARAM(isp, chan)->isp_fwstate = FW_CONFIG_WAIT; FCPARAM(isp, chan)->isp_loopstate = LOOP_LIP_RCVD; @@ -5920,8 +5905,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ if (IS_24XX(isp)) { isp_prt(isp, ISP_LOGWARN, "Receive Error"); } else { - isp_prt(isp, ISP_LOGWARN, - "Unknown Async Code 0x%x", mbox); + isp_prt(isp, ISP_LOGWARN, "unexpected ASYNC_RCV_ERR"); } break; case ASYNC_RJT_SENT: /* same as ASYNC_QFULL_SENT */ @@ -5937,29 +5921,10 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_prt(isp, ISP_LOGWARN, "Unknown Async Code 0x%x", mbox); break; } - - if (pattern) { - int i, nh; - uint16_t handles[16]; - - for (nh = 0, i = 1; i < MAX_MAILBOX(isp); i++) { - if ((pattern & (1 << i)) == 0) { - continue; - } - handles[nh++] = ISP_READ(isp, MBOX_OFF(i)); - } - for (i = 0; i < nh; i++) { - isp_fastpost_complete(isp, handles[i]); - isp_prt(isp, ISP_LOGDEBUG3, - "fast post completion of %u", handles[i]); - } - if (isp->isp_fpcchiwater < nh) { - isp->isp_fpcchiwater = nh; - } - } else { + if (mbox != ASYNC_CTIO_DONE && mbox != ASYNC_CMD_CMPLT) { isp->isp_intoasync++; } - return (rval); + return (acked); } /* @@ -6591,7 +6556,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, i } static void -isp_fastpost_complete(ispsoftc_t *isp, uint16_t fph) +isp_fastpost_complete(ispsoftc_t *isp, uint32_t fph) { XS_T *xs; @@ -7679,7 +7644,6 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c fcp->isp_fwoptions |= ICBOPT_FAIRNESS; fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE; fcp->isp_fwoptions |= ICBOPT_HARD_ADDRESS; - fcp->isp_fwoptions |= ICBOPT_FAST_POST; if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) { fcp->isp_fwoptions |= ICBOPT_FULL_DUPLEX; } Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Mon Mar 1 17:20:04 2010 (r204523) +++ stable/8/sys/dev/isp/isp_freebsd.c Mon Mar 1 17:36:45 2010 (r204524) @@ -2304,7 +2304,8 @@ isp_handle_platform_ctio(ispsoftc_t *isp uint32_t tval, handle; /* - * CTIO, CTIO2 and CTIO7 are close enough.... + * CTIO handles are 16 bits. + * CTIO2 and CTIO7 are 32 bits. */ if (IS_SCSI(isp)) { Modified: stable/8/sys/dev/isp/isp_library.c ============================================================================== --- stable/8/sys/dev/isp/isp_library.c Mon Mar 1 17:20:04 2010 (r204523) +++ stable/8/sys/dev/isp/isp_library.c Mon Mar 1 17:36:45 2010 (r204524) @@ -668,7 +668,7 @@ isp_clear_commands(ispsoftc_t *isp) ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO2; } else { ct_entry_t *ctio = (ct_entry_t *) local; - ctio->ct_syshandle = hdp->handle & 0xffff; + ctio->ct_syshandle = hdp->handle; ctio->ct_status = CT_HBA_RESET & 0xff; ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO; } @@ -1132,17 +1132,36 @@ isp_get_24xx_abrt(ispsoftc_t *isp, isp24 void +isp_get_rio1(ispsoftc_t *isp, isp_rio1_t *r1src, isp_rio1_t *r1dst) +{ + const int lim = sizeof (r1dst->req_handles) / sizeof (r1dst->req_handles[0]); + int i; + isp_get_hdr(isp, &r1src->req_header, &r1dst->req_header); + if (r1dst->req_header.rqs_seqno > lim) { + r1dst->req_header.rqs_seqno = lim; + } + for (i = 0; i < r1dst->req_header.rqs_seqno; i++) { + ISP_IOXGET_32(isp, &r1src->req_handles[i], r1dst->req_handles[i]); + } + while (i < lim) { + r1dst->req_handles[i++] = 0; + } +} + +void isp_get_rio2(ispsoftc_t *isp, isp_rio2_t *r2src, isp_rio2_t *r2dst) { + const int lim = sizeof (r2dst->req_handles) / sizeof (r2dst->req_handles[0]); int i; + isp_get_hdr(isp, &r2src->req_header, &r2dst->req_header); - if (r2dst->req_header.rqs_seqno > 30) { - r2dst->req_header.rqs_seqno = 30; + if (r2dst->req_header.rqs_seqno > lim) { + r2dst->req_header.rqs_seqno = lim; } for (i = 0; i < r2dst->req_header.rqs_seqno; i++) { ISP_IOXGET_16(isp, &r2src->req_handles[i], r2dst->req_handles[i]); } - while (i < 30) { + while (i < lim) { r2dst->req_handles[i++] = 0; } } @@ -2240,7 +2259,13 @@ isp_allocate_xs_tgt(ispsoftc_t *isp, voi hdp->cmd = xs; hdp->handle = (hdp - isp->isp_tgtlist); hdp->handle |= (ISP_HANDLE_TARGET << ISP_HANDLE_USAGE_SHIFT); - hdp->handle |= (isp->isp_seqno++ << ISP_HANDLE_SEQ_SHIFT); + /* + * Target handles for SCSI cards are only 16 bits, so + * sequence number protection will be ommitted. + */ + if (IS_FC(isp)) { + hdp->handle |= (isp->isp_seqno++ << ISP_HANDLE_SEQ_SHIFT); + } *handlep = hdp->handle; return (0); } Modified: stable/8/sys/dev/isp/isp_library.h ============================================================================== --- stable/8/sys/dev/isp/isp_library.h Mon Mar 1 17:20:04 2010 (r204523) +++ stable/8/sys/dev/isp/isp_library.h Mon Mar 1 17:36:45 2010 (r204524) @@ -108,6 +108,7 @@ void isp_put_cont64_req(ispsoftc_t *, is void isp_get_response(ispsoftc_t *, ispstatusreq_t *, ispstatusreq_t *); void isp_get_24xx_response(ispsoftc_t *, isp24xx_statusreq_t *, isp24xx_statusreq_t *); void isp_get_24xx_abrt(ispsoftc_t *, isp24xx_abrt_t *, isp24xx_abrt_t *); +void isp_get_rio1(ispsoftc_t *, isp_rio1_t *, isp_rio1_t *); void isp_get_rio2(ispsoftc_t *, isp_rio2_t *, isp_rio2_t *); void isp_put_icb(ispsoftc_t *, isp_icb_t *, isp_icb_t *); void isp_put_icb_2400(ispsoftc_t *, isp_icb_2400_t *, isp_icb_2400_t *); Modified: stable/8/sys/dev/isp/isp_pci.c ============================================================================== --- stable/8/sys/dev/isp/isp_pci.c Mon Mar 1 17:20:04 2010 (r204523) +++ stable/8/sys/dev/isp/isp_pci.c Mon Mar 1 17:36:45 2010 (r204524) @@ -1068,8 +1068,7 @@ isp_pci_rd_isr(ispsoftc_t *isp, uint32_t } static int -isp_pci_rd_isr_2300(ispsoftc_t *isp, uint32_t *isrp, - uint16_t *semap, uint16_t *mbox0p) +isp_pci_rd_isr_2300(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbox0p) { uint32_t hccr; uint32_t r2hisr; @@ -1096,7 +1095,7 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin return (1); case ISPR2HST_RIO_16: *isrp = r2hisr & 0xffff; - *mbox0p = ASYNC_RIO1; + *mbox0p = ASYNC_RIO16_1; *semap = 1; return (1); case ISPR2HST_FPOST: @@ -1118,21 +1117,17 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin hccr = ISP_READ(isp, HCCR); if (hccr & HCCR_PAUSE) { ISP_WRITE(isp, HCCR, HCCR_RESET); - isp_prt(isp, ISP_LOGERR, - "RISC paused at interrupt (%x->%x)", hccr, - ISP_READ(isp, HCCR)); + isp_prt(isp, ISP_LOGERR, "RISC paused at interrupt (%x->%x)", hccr, ISP_READ(isp, HCCR)); ISP_WRITE(isp, BIU_ICR, 0); } else { - isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", - r2hisr); + isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", r2hisr); } return (0); } } static int -isp_pci_rd_isr_2400(ispsoftc_t *isp, uint32_t *isrp, - uint16_t *semap, uint16_t *mbox0p) +isp_pci_rd_isr_2400(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbox0p) { uint32_t r2hisr; @@ -1177,8 +1172,7 @@ isp_pci_rd_reg(ispsoftc_t *isp, int rego * We will assume that someone has paused the RISC processor. */ oldconf = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); - BXW2(isp, IspVirt2Off(isp, BIU_CONF1), - oldconf | BIU_PCI_CONF1_SXP); + BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf | BIU_PCI_CONF1_SXP); MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); } rv = BXR2(isp, IspVirt2Off(isp, regoff)); Modified: stable/8/sys/dev/isp/isp_target.c ============================================================================== --- stable/8/sys/dev/isp/isp_target.c Mon Mar 1 17:20:04 2010 (r204523) +++ stable/8/sys/dev/isp/isp_target.c Mon Mar 1 17:36:45 2010 (r204524) @@ -826,7 +826,9 @@ isp_target_async(ispsoftc_t *isp, int bu ct_entry_t *ct = (ct_entry_t *) storage; ct->ct_header.rqs_entry_type = RQSTYPE_CTIO; ct->ct_status = CT_OK; - ct->ct_fwhandle = bus; + ct->ct_syshandle = bus; + /* we skip fwhandle here */ + ct->ct_fwhandle = 0; ct->ct_flags = CT_SENDSTATUS; } isp_async(isp, ISPASYNC_TARGET_ACTION, storage); Modified: stable/8/sys/dev/isp/ispmbox.h ============================================================================== --- stable/8/sys/dev/isp/ispmbox.h Mon Mar 1 17:20:04 2010 (r204523) +++ stable/8/sys/dev/isp/ispmbox.h Mon Mar 1 17:36:45 2010 (r204524) @@ -223,6 +223,8 @@ #define ASYNC_SECURITY_UPDATE 0x801B #define ASYNC_CMD_CMPLT 0x8020 #define ASYNC_CTIO_DONE 0x8021 +#define ASYNC_RIO32_1 0x8021 +#define ASYNC_RIO32_2 0x8022 #define ASYNC_IP_XMIT_DONE 0x8022 #define ASYNC_IP_RECV_DONE 0x8023 #define ASYNC_IP_BROADCAST 0x8024 @@ -230,19 +232,19 @@ #define ASYNC_IP_RCVQ_EMPTY 0x8026 #define ASYNC_IP_RECV_DONE_ALIGNED 0x8027 #define ASYNC_PTPMODE 0x8030 -#define ASYNC_RIO1 0x8031 -#define ASYNC_RIO2 0x8032 -#define ASYNC_RIO3 0x8033 -#define ASYNC_RIO4 0x8034 -#define ASYNC_RIO5 0x8035 +#define ASYNC_RIO16_1 0x8031 +#define ASYNC_RIO16_2 0x8032 +#define ASYNC_RIO16_3 0x8033 +#define ASYNC_RIO16_4 0x8034 +#define ASYNC_RIO16_5 0x8035 #define ASYNC_CONNMODE 0x8036 #define ISP_CONN_LOOP 1 #define ISP_CONN_PTP 2 #define ISP_CONN_BADLIP 3 #define ISP_CONN_FATAL 4 #define ISP_CONN_LOOPBACK 5 -#define ASYNC_RIO_RESP 0x8040 -#define ASYNC_RIO_COMP 0x8042 +#define ASYNC_RIOZIO_STALL 0x8040 /* there's a RIO/ZIO entry that hasn't been serviced */ +#define ASYNC_RIO32_2_2200 0x8042 /* same as ASYNC_RIO32_2, but for 2100/2200 */ #define ASYNC_RCV_ERR 0x8048 /* @@ -860,7 +862,7 @@ typedef struct { (ISP_CAP_MULTI_ID(isp) ? tag : 0) /* - * Reduced Interrupt Operation Response Queue Entreis + * Reduced Interrupt Operation Response Queue Entries */ typedef struct { Modified: stable/8/sys/dev/isp/ispreg.h ============================================================================== --- stable/8/sys/dev/isp/ispreg.h Mon Mar 1 17:20:04 2010 (r204523) +++ stable/8/sys/dev/isp/ispreg.h Mon Mar 1 17:36:45 2010 (r204524) @@ -677,13 +677,13 @@ typedef struct { #define SXP_PINS_LVD_MODE 0x1000 #define SXP_PINS_HVD_MODE 0x0800 #define SXP_PINS_SE_MODE 0x0400 +#define SXP_PINS_MODE_MASK (SXP_PINS_LVD_MODE|SXP_PINS_HVD_MODE|SXP_PINS_SE_MODE) /* The above have to be put together with the DIFFM pin to make sense */ #define ISP1080_LVD_MODE (SXP_PINS_LVD_MODE) #define ISP1080_HVD_MODE (SXP_PINS_HVD_MODE|SXP_PINS_DIFF_MODE) #define ISP1080_SE_MODE (SXP_PINS_SE_MODE) -#define ISP1080_MODE_MASK \ - (SXP_PINS_LVD_MODE|SXP_PINS_HVD_MODE|SXP_PINS_SE_MODE|SXP_PINS_DIFF_MODE) +#define ISP1080_MODE_MASK (SXP_PINS_MODE_MASK|SXP_PINS_DIFF_MODE) /* * RISC and Host Command and Control Block Register Offsets From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 19:16:34 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6234106566C; Mon, 1 Mar 2010 19:16:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B25828FC1F; Mon, 1 Mar 2010 19:16:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o21JGY6n092329; Mon, 1 Mar 2010 19:16:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o21JGYkb092322; Mon, 1 Mar 2010 19:16:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003011916.o21JGYkb092322@svn.freebsd.org> From: Alexander Motin Date: Mon, 1 Mar 2010 19:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204528 - in stable/8: . contrib/top lib/libusb sbin/atacontrol sbin/camcontrol sys/cam sys/dev/ata tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/ath/common tools... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 19:16:34 -0000 Author: mav Date: Mon Mar 1 19:16:34 2010 New Revision: 204528 URL: http://svn.freebsd.org/changeset/base/204528 Log: MFC r204195: Improve output for controllers that doesn't report SATA speed. Modified: stable/8/sbin/atacontrol/atacontrol.c stable/8/sbin/camcontrol/camcontrol.c stable/8/sys/cam/cam_xpt.c stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/ata-pci.c stable/8/sys/dev/ata/ata-sata.c Directory Properties: stable/8/ (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zdb/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/cpio/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/one-true-awk/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/msun/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/release/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/mk/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/tools/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/sbin/atacontrol/atacontrol.c ============================================================================== --- stable/8/sbin/atacontrol/atacontrol.c Mon Mar 1 19:12:40 2010 (r204527) +++ stable/8/sbin/atacontrol/atacontrol.c Mon Mar 1 19:16:34 2010 (r204528) @@ -72,6 +72,7 @@ satarev2str(int mode) case 1: return "SATA 1.5Gb/s"; case 2: return "SATA 3Gb/s"; case 3: return "SATA 6Gb/s"; + case 0xff: return "SATA"; default: return "???"; } } Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Mon Mar 1 19:12:40 2010 (r204527) +++ stable/8/sbin/camcontrol/camcontrol.c Mon Mar 1 19:16:34 2010 (r204528) @@ -1022,6 +1022,8 @@ camxferrate(struct cam_device *device) printf(" ("); if (sata->valid & CTS_SATA_VALID_REVISION) printf("SATA %d.x, ", sata->revision); + else + printf("SATA, "); if (sata->valid & CTS_SATA_VALID_MODE) printf("%s, ", ata_mode2string(sata->mode)); if ((sata->valid & CTS_SATA_VALID_ATAPI) && sata->atapi != 0) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Mon Mar 1 19:12:40 2010 (r204527) +++ stable/8/sys/cam/cam_xpt.c Mon Mar 1 19:16:34 2010 (r204528) @@ -1214,6 +1214,8 @@ xpt_announce_periph(struct cam_periph *p printf(" ("); if (sata->valid & CTS_SATA_VALID_REVISION) printf("SATA %d.x, ", sata->revision); + else + printf("SATA, "); if (sata->valid & CTS_SATA_VALID_MODE) printf("%s, ", ata_mode2string(sata->mode)); if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0) Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Mon Mar 1 19:12:40 2010 (r204527) +++ stable/8/sys/dev/ata/ata-all.c Mon Mar 1 19:16:34 2010 (r204528) @@ -1160,6 +1160,7 @@ ata_satarev2str(int rev) case 1: return "SATA 1.5Gb/s"; case 2: return "SATA 3Gb/s"; case 3: return "SATA 6Gb/s"; + case 0xff: return "SATA"; default: return "???"; } } @@ -1536,6 +1537,7 @@ ataaction(struct cam_sim *sim, union ccb if (ch->flags & ATA_SATA) { cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.sata.valid = 0; cts->xport_specific.sata.mode = d->mode; cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE; cts->xport_specific.sata.bytecount = d->bytecount; @@ -1543,14 +1545,20 @@ ataaction(struct cam_sim *sim, union ccb if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { cts->xport_specific.sata.revision = ATA_GETREV(dev, ccb->ccb_h.target_id); - } else + if (cts->xport_specific.sata.revision != 0xff) { + cts->xport_specific.sata.valid |= + CTS_SATA_VALID_REVISION; + } + } else { cts->xport_specific.sata.revision = d->revision; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + } cts->xport_specific.sata.atapi = d->atapi; cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; } else { cts->transport = XPORT_ATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.ata.valid = 0; cts->xport_specific.ata.mode = d->mode; cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; cts->xport_specific.ata.bytecount = d->bytecount; Modified: stable/8/sys/dev/ata/ata-pci.c ============================================================================== --- stable/8/sys/dev/ata/ata-pci.c Mon Mar 1 19:12:40 2010 (r204527) +++ stable/8/sys/dev/ata/ata-pci.c Mon Mar 1 19:16:34 2010 (r204528) @@ -714,10 +714,14 @@ static int ata_pcichannel_getrev(device_t dev, int target) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); - if (ctlr->getrev) - return (ctlr->getrev(dev, target)); - else + if (ch->flags & ATA_SATA) { + if (ctlr->getrev) + return (ctlr->getrev(dev, target)); + else + return (0xff); + } else return (0); } Modified: stable/8/sys/dev/ata/ata-sata.c ============================================================================== --- stable/8/sys/dev/ata/ata-sata.c Mon Mar 1 19:12:40 2010 (r204527) +++ stable/8/sys/dev/ata/ata-sata.c Mon Mar 1 19:16:34 2010 (r204528) @@ -223,7 +223,7 @@ ata_sata_getrev(device_t dev, int target if (ch->r_io[ATA_SSTATUS].res) return ((ATA_IDX_INL(ch, ATA_SSTATUS) & 0x0f0) >> 4); - return (0); + return (0xff); } int From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 19:19:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDF5F106567A; Mon, 1 Mar 2010 19:19:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBFF18FC2A; Mon, 1 Mar 2010 19:19:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o21JJU7s093065; Mon, 1 Mar 2010 19:19:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o21JJUp0093060; Mon, 1 Mar 2010 19:19:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003011919.o21JJUp0093060@svn.freebsd.org> From: Alexander Motin Date: Mon, 1 Mar 2010 19:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204529 - in stable/8/sys/cam: . ata scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 19:19:31 -0000 Author: mav Date: Mon Mar 1 19:19:30 2010 New Revision: 204529 URL: http://svn.freebsd.org/changeset/base/204529 Log: MFC r204220, r204353: Virtualize transport part of periph announcement. Modified: stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt_internal.h stable/8/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Mon Mar 1 19:16:34 2010 (r204528) +++ stable/8/sys/cam/ata/ata_xpt.c Mon Mar 1 19:19:30 2010 (r204529) @@ -178,11 +178,13 @@ static void ata_dev_async(u_int32_t asy struct cam_ed *device, void *async_arg); static void ata_action(union ccb *start_ccb); +static void ata_announce_periph(struct cam_periph *periph); static struct xpt_xport ata_xport = { .alloc_device = ata_alloc_device, .action = ata_action, .async = ata_dev_async, + .announce = ata_announce_periph, }; struct xpt_xport * @@ -1641,3 +1643,82 @@ ata_dev_async(u_int32_t async_code, stru } } +static void +ata_announce_periph(struct cam_periph *periph) +{ + struct ccb_pathinq cpi; + struct ccb_trans_settings cts; + struct cam_path *path = periph->path; + u_int speed; + u_int mb; + + mtx_assert(periph->sim->mtx, MA_OWNED); + + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + xpt_action((union ccb*)&cts); + if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + return; + /* Ask the SIM for its base transfer speed */ + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); + cpi.ccb_h.func_code = XPT_PATH_INQ; + xpt_action((union ccb *)&cpi); + /* Report connection speed */ + speed = cpi.base_transfer_speed; + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &cts.xport_specific.ata; + + if (ata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(ata->mode); + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { + struct ccb_trans_settings_sata *sata = + &cts.xport_specific.sata; + + if (sata->valid & CTS_SATA_VALID_REVISION) + speed = ata_revision2speed(sata->revision); + } + mb = speed / 1000; + if (mb > 0) + printf("%s%d: %d.%03dMB/s transfers", + periph->periph_name, periph->unit_number, + mb, speed % 1000); + else + printf("%s%d: %dKB/s transfers", periph->periph_name, + periph->unit_number, speed); + /* Report additional information about connection */ + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &cts.xport_specific.ata; + + printf(" ("); + if (ata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(ata->mode)); + if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) + printf("ATAPI %dbytes, ", ata->atapi); + if (ata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO %dbytes", ata->bytecount); + printf(")"); + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { + struct ccb_trans_settings_sata *sata = + &cts.xport_specific.sata; + + printf(" ("); + if (sata->valid & CTS_SATA_VALID_REVISION) + printf("SATA %d.x, ", sata->revision); + else + printf("SATA, "); + if (sata->valid & CTS_SATA_VALID_MODE) + printf("%s, ", ata_mode2string(sata->mode)); + if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0) + printf("ATAPI %dbytes, ", sata->atapi); + if (sata->valid & CTS_SATA_VALID_BYTECOUNT) + printf("PIO %dbytes", sata->bytecount); + printf(")"); + } + printf("\n"); +} + Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Mon Mar 1 19:16:34 2010 (r204528) +++ stable/8/sys/cam/cam_xpt.c Mon Mar 1 19:19:30 2010 (r204529) @@ -1060,20 +1060,10 @@ xpt_remove_periph(struct cam_periph *per void xpt_announce_periph(struct cam_periph *periph, char *announce_string) { - struct ccb_pathinq cpi; - struct ccb_trans_settings cts; - struct cam_path *path; - u_int speed; - u_int freq; - u_int mb; + struct cam_path *path = periph->path; mtx_assert(periph->sim->mtx, MA_OWNED); - path = periph->path; - /* - * To ensure that this is printed in one piece, - * mask out CAM interrupts. - */ printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", periph->periph_name, periph->unit_number, path->bus->sim->sim_name, @@ -1084,157 +1074,26 @@ xpt_announce_periph(struct cam_periph *p path->device->lun_id); printf("%s%d: ", periph->periph_name, periph->unit_number); if (path->device->protocol == PROTO_SCSI) - scsi_print_inquiry(&path->device->inq_data); + scsi_print_inquiry(&path->device->inq_data); else if (path->device->protocol == PROTO_ATA || path->device->protocol == PROTO_SATAPM) ata_print_ident(&path->device->ident_data); else - printf("Unknown protocol device\n"); + printf("Unknown protocol device\n"); if (bootverbose && path->device->serial_num_len > 0) { /* Don't wrap the screen - print only the first 60 chars */ printf("%s%d: Serial Number %.60s\n", periph->periph_name, periph->unit_number, path->device->serial_num); } - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); - cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - xpt_action((union ccb*)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - return; - } - - /* Ask the SIM for its base transfer speed */ - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); - - speed = cpi.base_transfer_speed; - freq = 0; - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) { - struct ccb_trans_settings_spi *spi = - &cts.xport_specific.spi; - - if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0 - && spi->sync_offset != 0) { - freq = scsi_calc_syncsrate(spi->sync_period); - speed = freq; - } - if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) - speed *= (0x01 << spi->bus_width); - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) { - struct ccb_trans_settings_fc *fc = - &cts.xport_specific.fc; - - if (fc->valid & CTS_FC_VALID_SPEED) - speed = fc->bitrate; - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SAS) { - struct ccb_trans_settings_sas *sas = - &cts.xport_specific.sas; - - if (sas->valid & CTS_SAS_VALID_SPEED) - speed = sas->bitrate; - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = - &cts.xport_specific.ata; - - if (ata->valid & CTS_ATA_VALID_MODE) - speed = ata_mode2speed(ata->mode); - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { - struct ccb_trans_settings_sata *sata = - &cts.xport_specific.sata; - - if (sata->valid & CTS_SATA_VALID_REVISION) - speed = ata_revision2speed(sata->revision); - } - - mb = speed / 1000; - if (mb > 0) - printf("%s%d: %d.%03dMB/s transfers", - periph->periph_name, periph->unit_number, - mb, speed % 1000); - else - printf("%s%d: %dKB/s transfers", periph->periph_name, - periph->unit_number, speed); - /* Report additional information about SPI connections */ - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) { - struct ccb_trans_settings_spi *spi; - - spi = &cts.xport_specific.spi; - if (freq != 0) { - printf(" (%d.%03dMHz%s, offset %d", freq / 1000, - freq % 1000, - (spi->ppr_options & MSG_EXT_PPR_DT_REQ) != 0 - ? " DT" : "", - spi->sync_offset); - } - if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0 - && spi->bus_width > 0) { - if (freq != 0) { - printf(", "); - } else { - printf(" ("); - } - printf("%dbit)", 8 * (0x01 << spi->bus_width)); - } else if (freq != 0) { - printf(")"); - } - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) { - struct ccb_trans_settings_fc *fc; - - fc = &cts.xport_specific.fc; - if (fc->valid & CTS_FC_VALID_WWNN) - printf(" WWNN 0x%llx", (long long) fc->wwnn); - if (fc->valid & CTS_FC_VALID_WWPN) - printf(" WWPN 0x%llx", (long long) fc->wwpn); - if (fc->valid & CTS_FC_VALID_PORT) - printf(" PortID 0x%x", fc->port); - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = - &cts.xport_specific.ata; - - printf(" ("); - if (ata->valid & CTS_ATA_VALID_MODE) - printf("%s, ", ata_mode2string(ata->mode)); - if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) - printf("ATAPI %dbytes, ", ata->atapi); - if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf("PIO %dbytes", ata->bytecount); - printf(")"); - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { - struct ccb_trans_settings_sata *sata = - &cts.xport_specific.sata; - - printf(" ("); - if (sata->valid & CTS_SATA_VALID_REVISION) - printf("SATA %d.x, ", sata->revision); - else - printf("SATA, "); - if (sata->valid & CTS_SATA_VALID_MODE) - printf("%s, ", ata_mode2string(sata->mode)); - if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0) - printf("ATAPI %dbytes, ", sata->atapi); - if (sata->valid & CTS_SATA_VALID_BYTECOUNT) - printf("PIO %dbytes", sata->bytecount); - printf(")"); - } + /* Announce transport details. */ + (*(path->bus->xport->announce))(periph); + /* Announce command queueing. */ if (path->device->inq_flags & SID_CmdQue || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) { - printf("\n%s%d: Command Queueing enabled", + printf("%s%d: Command Queueing enabled\n", periph->periph_name, periph->unit_number); } - printf("\n"); - - /* - * We only want to print the caller's announce string if they've - * passed one in.. - */ + /* Announce caller's details if they've passed in. */ if (announce_string != NULL) printf("%s%d: %s\n", periph->periph_name, periph->unit_number, announce_string); Modified: stable/8/sys/cam/cam_xpt_internal.h ============================================================================== --- stable/8/sys/cam/cam_xpt_internal.h Mon Mar 1 19:16:34 2010 (r204528) +++ stable/8/sys/cam/cam_xpt_internal.h Mon Mar 1 19:19:30 2010 (r204529) @@ -44,8 +44,7 @@ typedef void (*xpt_dev_async_func)(u_int struct cam_et *target, struct cam_ed *device, void *async_arg); -typedef void (*xpt_announce_periph_func)(struct cam_periph *periph, - char *announce_string); +typedef void (*xpt_announce_periph_func)(struct cam_periph *periph); struct xpt_xport { xpt_alloc_device_func alloc_device; Modified: stable/8/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_xpt.c Mon Mar 1 19:16:34 2010 (r204528) +++ stable/8/sys/cam/scsi/scsi_xpt.c Mon Mar 1 19:19:30 2010 (r204529) @@ -552,11 +552,13 @@ static void scsi_dev_async(u_int32_t as struct cam_ed *device, void *async_arg); static void scsi_action(union ccb *start_ccb); +static void scsi_announce_periph(struct cam_periph *periph); static struct xpt_xport scsi_xport = { .alloc_device = scsi_alloc_device, .action = scsi_action, .async = scsi_dev_async, + .announce = scsi_announce_periph, }; struct xpt_xport * @@ -2414,3 +2416,100 @@ scsi_dev_async(u_int32_t async_code, str } } +static void +scsi_announce_periph(struct cam_periph *periph) +{ + struct ccb_pathinq cpi; + struct ccb_trans_settings cts; + struct cam_path *path = periph->path; + u_int speed; + u_int freq; + u_int mb; + + mtx_assert(periph->sim->mtx, MA_OWNED); + + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + xpt_action((union ccb*)&cts); + if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + return; + /* Ask the SIM for its base transfer speed */ + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); + cpi.ccb_h.func_code = XPT_PATH_INQ; + xpt_action((union ccb *)&cpi); + /* Report connection speed */ + speed = cpi.base_transfer_speed; + freq = 0; + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) { + struct ccb_trans_settings_spi *spi = + &cts.xport_specific.spi; + + if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0 + && spi->sync_offset != 0) { + freq = scsi_calc_syncsrate(spi->sync_period); + speed = freq; + } + if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) + speed *= (0x01 << spi->bus_width); + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc = + &cts.xport_specific.fc; + + if (fc->valid & CTS_FC_VALID_SPEED) + speed = fc->bitrate; + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SAS) { + struct ccb_trans_settings_sas *sas = + &cts.xport_specific.sas; + + if (sas->valid & CTS_SAS_VALID_SPEED) + speed = sas->bitrate; + } + mb = speed / 1000; + if (mb > 0) + printf("%s%d: %d.%03dMB/s transfers", + periph->periph_name, periph->unit_number, + mb, speed % 1000); + else + printf("%s%d: %dKB/s transfers", periph->periph_name, + periph->unit_number, speed); + /* Report additional information about SPI connections */ + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) { + struct ccb_trans_settings_spi *spi; + + spi = &cts.xport_specific.spi; + if (freq != 0) { + printf(" (%d.%03dMHz%s, offset %d", freq / 1000, + freq % 1000, + (spi->ppr_options & MSG_EXT_PPR_DT_REQ) != 0 + ? " DT" : "", + spi->sync_offset); + } + if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0 + && spi->bus_width > 0) { + if (freq != 0) { + printf(", "); + } else { + printf(" ("); + } + printf("%dbit)", 8 * (0x01 << spi->bus_width)); + } else if (freq != 0) { + printf(")"); + } + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc; + + fc = &cts.xport_specific.fc; + if (fc->valid & CTS_FC_VALID_WWNN) + printf(" WWNN 0x%llx", (long long) fc->wwnn); + if (fc->valid & CTS_FC_VALID_WWPN) + printf(" WWPN 0x%llx", (long long) fc->wwpn); + if (fc->valid & CTS_FC_VALID_PORT) + printf(" PortID 0x%x", fc->port); + } + printf("\n"); +} + From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 19:32:34 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C06C7106564A; Mon, 1 Mar 2010 19:32:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFE708FC16; Mon, 1 Mar 2010 19:32:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o21JWYIo096051; Mon, 1 Mar 2010 19:32:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o21JWYn5096049; Mon, 1 Mar 2010 19:32:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003011932.o21JWYn5096049@svn.freebsd.org> From: Alexander Motin Date: Mon, 1 Mar 2010 19:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204530 - stable/8/sys/cam X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 19:32:34 -0000 Author: mav Date: Mon Mar 1 19:32:34 2010 New Revision: 204530 URL: http://svn.freebsd.org/changeset/base/204530 Log: MFC r204253: Make xpt_rescan() more correct, as it was before r197208: do not use XPT_SCAN_LUN for wildcard LUN, fall back to XPT_SCAN_BUS. Modified: stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Mon Mar 1 19:19:30 2010 (r204529) +++ stable/8/sys/cam/cam_xpt.c Mon Mar 1 19:32:34 2010 (r204530) @@ -861,7 +861,8 @@ xpt_rescan(union ccb *ccb) struct ccb_hdr *hdr; /* Prepare request */ - if(ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD) + if (ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD || + ccb->ccb_h.path->device->lun_id == CAM_LUN_WILDCARD) ccb->ccb_h.func_code = XPT_SCAN_BUS; else ccb->ccb_h.func_code = XPT_SCAN_LUN; From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 19:36:19 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81034106564A; Mon, 1 Mar 2010 19:36:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55F658FC1B; Mon, 1 Mar 2010 19:36:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o21JaJAd096893; Mon, 1 Mar 2010 19:36:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o21JaJd7096890; Mon, 1 Mar 2010 19:36:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003011936.o21JaJd7096890@svn.freebsd.org> From: Alexander Motin Date: Mon, 1 Mar 2010 19:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204531 - in stable/8/sys: cam/ata sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 19:36:19 -0000 Author: mav Date: Mon Mar 1 19:36:19 2010 New Revision: 204531 URL: http://svn.freebsd.org/changeset/base/204531 Log: MFC r204354: Make PUIS detection more strict. Previous implementation caused false positives on VMWare's virtual CD-ROMs. Modified: stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/sys/ata.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Mon Mar 1 19:32:34 2010 (r204530) +++ stable/8/sys/cam/ata/ata_xpt.c Mon Mar 1 19:36:19 2010 (r204531) @@ -788,11 +788,10 @@ noerror: ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); /* Device may need spin-up before IDENTIFY become valid. */ - if ((ident_buf->config & ATA_RESP_INCOMPLETE) || - ((ident_buf->support.command2 & ATA_SUPPORT_STANDBY) && - (ident_buf->enabled.command2 & ATA_SUPPORT_STANDBY) && - (ident_buf->support.command2 & ATA_SUPPORT_SPINUP) && - softc->spinup == 0)) { + if ((ident_buf->specconf == 0x37c8 || + ident_buf->specconf == 0x738c) && + ((ident_buf->config & ATA_RESP_INCOMPLETE) || + softc->spinup == 0)) { PROBE_SET_ACTION(softc, PROBE_SPINUP); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); Modified: stable/8/sys/sys/ata.h ============================================================================== --- stable/8/sys/sys/ata.h Mon Mar 1 19:32:34 2010 (r204530) +++ stable/8/sys/sys/ata.h Mon Mar 1 19:36:19 2010 (r204531) @@ -51,7 +51,7 @@ struct ata_params { #define ATA_RESP_INCOMPLETE 0x0004 /*001*/ u_int16_t cylinders; /* # of cylinders */ - u_int16_t reserved2; +/*002*/ u_int16_t specconf; /* specific configuration */ /*003*/ u_int16_t heads; /* # heads */ u_int16_t obsolete4; u_int16_t obsolete5; From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 19:43:26 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7B7E106566B; Mon, 1 Mar 2010 19:43:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A70978FC14; Mon, 1 Mar 2010 19:43:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o21JhQ3s098581; Mon, 1 Mar 2010 19:43:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o21JhQxt098579; Mon, 1 Mar 2010 19:43:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003011943.o21JhQxt098579@svn.freebsd.org> From: Alexander Motin Date: Mon, 1 Mar 2010 19:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204532 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 19:43:26 -0000 Author: mav Date: Mon Mar 1 19:43:26 2010 New Revision: 204532 URL: http://svn.freebsd.org/changeset/base/204532 Log: MFC r204351: Fix bug in headphones audio redirection using separate DAC. It was exposed by removing channel duplication during multichannel audio implementation. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Mon Mar 1 19:36:19 2010 (r204531) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Mon Mar 1 19:43:26 2010 (r204532) @@ -86,7 +86,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20100122_0141" +#define HDA_DRV_TEST_REV "20100226_0142" SND_DECLARE_FILE("$FreeBSD$"); @@ -3503,7 +3503,7 @@ hdac_stream_setup(struct hdac_chan *ch) /* If HP redirection is enabled, but failed to use same DAC, make last DAC to duplicate first one. */ - if (as->hpredir >= 0 && i == as->pincnt) { + if (as->fakeredir && i == (as->pincnt - 1)) { c = (ch->sid << 4); } else { if (map >= 0) /* Map known speaker setups. */ From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 19:48:11 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D78F51065670; Mon, 1 Mar 2010 19:48:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A631E8FC1F; Mon, 1 Mar 2010 19:48:11 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 55AD646B52; Mon, 1 Mar 2010 14:48:11 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 80BA38A021; Mon, 1 Mar 2010 14:48:10 -0500 (EST) From: John Baldwin To: Alexander Motin Date: Mon, 1 Mar 2010 14:41:42 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201003011916.o21JGYkb092322@svn.freebsd.org> In-Reply-To: <201003011916.o21JGYkb092322@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003011441.42742.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 01 Mar 2010 14:48:10 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r204528 - in stable/8: . contrib/top lib/libusb sbin/atacontrol sbin/camcontrol sys/cam sys/dev/ata tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/ath/common tools... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 19:48:12 -0000 On Monday 01 March 2010 2:16:34 pm Alexander Motin wrote: > Author: mav > Date: Mon Mar 1 19:16:34 2010 > New Revision: 204528 > URL: http://svn.freebsd.org/changeset/base/204528 > > Log: > MFC r204195: > Improve output for controllers that doesn't report SATA speed. > > Modified: > stable/8/sbin/atacontrol/atacontrol.c > stable/8/sbin/camcontrol/camcontrol.c > stable/8/sys/cam/cam_xpt.c > stable/8/sys/dev/ata/ata-all.c > stable/8/sys/dev/ata/ata-pci.c > stable/8/sys/dev/ata/ata-sata.c For future reference, it would probably be best to do these as three separate merges (to sbin/atacontrol, sbin/camcontrol, and sys) and then do one commit, at least to avoid extra mergeinfo churn. -- John Baldwin From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 1 21:04:01 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BD5F1065670; Mon, 1 Mar 2010 21:04:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79F2C8FC12; Mon, 1 Mar 2010 21:04:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o21L41Ht016754; Mon, 1 Mar 2010 21:04:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o21L41sc016752; Mon, 1 Mar 2010 21:04:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003012104.o21L41sc016752@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Mar 2010 21:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204535 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 21:04:01 -0000 Author: jhb Date: Mon Mar 1 21:04:01 2010 New Revision: 204535 URL: http://svn.freebsd.org/changeset/base/204535 Log: MFC: Fix spelling of EACCES. Modified: stable/8/share/man/man9/namei.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/namei.9 ============================================================================== --- stable/8/share/man/man9/namei.9 Mon Mar 1 20:42:29 2010 (r204534) +++ stable/8/share/man/man9/namei.9 Mon Mar 1 21:04:01 2010 (r204535) @@ -333,7 +333,7 @@ or an entire pathname exceeded 1023 char .It Bq Er ENOENT A component of the specified pathname does not exist, or the pathname is an empty string. -.It Bq Er ACCES +.It Bq Er EACCES An attempt is made to access a file in a way forbidden by its file access permissions. .It Bq Er ELOOP From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 2 01:56:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B701065673; Tue, 2 Mar 2010 01:56:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F1648FC19; Tue, 2 Mar 2010 01:56:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o221utmE084199; Tue, 2 Mar 2010 01:56:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o221utje084185; Tue, 2 Mar 2010 01:56:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003020156.o221utje084185@svn.freebsd.org> From: Xin LI Date: Tue, 2 Mar 2010 01:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204546 - in stable/8: . lib share/man/man4 share/man/man4/man4.i386 sys/amd64/conf sys/compat/x86bios sys/conf sys/contrib/x86emu sys/dev/atkbdc sys/dev/dpms sys/dev/fb sys/dev/pci sys... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2010 01:56:55 -0000 Author: delphij Date: Tue Mar 2 01:56:55 2010 New Revision: 204546 URL: http://svn.freebsd.org/changeset/base/204546 Log: MFC x86emu/x86bios emulator and make previously i386 only dpms and vesa framebuffer driver, etc. work on FreeBSD/amd64. A significant amount of improvements were done by jkim@ during the recent months to make vesa(4) work better, over the initial code import. This work is based on OpenBSD's x86emu implementation and contributed by paradox and swell.k at gmail com. Hopefully I have stolen all their work to 8-STABLE :) All bugs in this commit are mine, as usual. Added: stable/8/share/man/man4/dpms.4 - copied unchanged from r197025, head/share/man/man4/dpms.4 stable/8/sys/compat/x86bios/ - copied from r197444, head/sys/compat/x86bios/ stable/8/sys/contrib/x86emu/ - copied from r197009, head/sys/contrib/x86emu/ stable/8/sys/dev/dpms/ - copied from r197021, head/sys/dev/dpms/ stable/8/sys/dev/dpms/dpms.c - copied, changed from r197022, head/sys/dev/dpms/dpms.c stable/8/sys/dev/fb/vesa.c - copied, changed from r197022, head/sys/dev/fb/vesa.c stable/8/sys/dev/fb/vesa.h - copied, changed from r197022, head/sys/dev/fb/vesa.h stable/8/sys/modules/x86bios/ - copied from r197383, head/sys/modules/x86bios/ stable/8/sys/modules/x86emu/ - copied from r197019, head/sys/modules/x86emu/ Deleted: stable/8/share/man/man4/man4.i386/dpms.4 stable/8/sys/i386/include/pc/vesa.h stable/8/sys/i386/isa/dpms.c stable/8/sys/i386/isa/vesa.c Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/lib/Makefile (contents, props changed) stable/8/share/man/man4/Makefile stable/8/share/man/man4/syscons.4 stable/8/sys/amd64/conf/NOTES stable/8/sys/compat/x86bios/x86bios.c stable/8/sys/compat/x86bios/x86bios.h stable/8/sys/conf/NOTES stable/8/sys/conf/files stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/conf/options stable/8/sys/conf/options.amd64 stable/8/sys/contrib/x86emu/x86emu.c (contents, props changed) stable/8/sys/contrib/x86emu/x86emu.h (contents, props changed) stable/8/sys/dev/atkbdc/atkbd.c stable/8/sys/dev/fb/s3_pci.c stable/8/sys/dev/fb/vga.c stable/8/sys/dev/fb/vgareg.h stable/8/sys/dev/pci/vga_pci.c stable/8/sys/dev/syscons/scvesactl.c stable/8/sys/dev/syscons/scvgarndr.c stable/8/sys/dev/syscons/scvidctl.c stable/8/sys/dev/syscons/syscons.c stable/8/sys/dev/syscons/syscons.h stable/8/sys/i386/conf/NOTES stable/8/sys/isa/vga_isa.c stable/8/sys/modules/Makefile stable/8/sys/modules/dpms/Makefile stable/8/sys/modules/vesa/Makefile stable/8/sys/modules/x86bios/Makefile stable/8/sys/sys/fbio.h stable/8/sys/sys/param.h Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Tue Mar 2 01:45:02 2010 (r204545) +++ stable/8/ObsoleteFiles.inc Tue Mar 2 01:56:55 2010 (r204546) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100301: vesa and dpms promoted to be i386/amd64 common +OLD_FILES+=usr/include/machine/pc/vesa.h +OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz # 20091218: removal of rc.early(8) link OLD_FILES+=usr/share/man/man8/rc.early.8.gz # 20091027: pselect.3 implemented as syscall Modified: stable/8/lib/Makefile ============================================================================== --- stable/8/lib/Makefile Tue Mar 2 01:45:02 2010 (r204545) +++ stable/8/lib/Makefile Tue Mar 2 01:56:55 2010 (r204546) @@ -112,6 +112,7 @@ _libsmb= libsmb _libncp= libncp .endif _libsmb= libsmb +_libvgl= libvgl .endif .if ${MACHINE_ARCH} == "powerpc" Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Tue Mar 2 01:45:02 2010 (r204545) +++ stable/8/share/man/man4/Makefile Tue Mar 2 01:56:55 2010 (r204546) @@ -86,6 +86,7 @@ MAN= aac.4 \ digi.4 \ disc.4 \ divert.4 \ + ${_dpms.4} \ dpt.4 \ dummynet.4 \ ed.4 \ @@ -622,6 +623,7 @@ _amdtemp.4= amdtemp.4 _asmc.4= asmc.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 +_dpms.4= dpms.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 Copied: stable/8/share/man/man4/dpms.4 (from r197025, head/share/man/man4/dpms.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/dpms.4 Tue Mar 2 01:56:55 2010 (r204546, copy of r197025, head/share/man/man4/dpms.4) @@ -0,0 +1,58 @@ +.\" Copyright (c) 2008 Yahoo!, Inc. +.\" All rights reserved. +.\" Written by: John Baldwin +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the author nor the names of any co-contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 23, 2008 +.Dt DPMS 4 +.Os +.Sh NAME +.Nm dpms +.Nd VESA BIOS DPMS driver +.Sh SYNOPSIS +.Cd "device dpms" +.Sh DESCRIPTION +The +.Nm +driver uses the VESA BIOS to manage an external display during suspend and +resume. +When the machine suspends, +the +.Nm +driver turns the external display off. +When the machine resumes, +it restores the display to its state when the driver was first loaded. +.Sh SEE ALSO +.Xr acpi_video 4 +.Sh BUGS +.Pp +The VESA BIOS DPMS calls do not provide any way to identify a particular +display or adapter to manipulate. +As a result, +this driver may have unexpected results on systems with multiple displays +and/or adapters. Modified: stable/8/share/man/man4/syscons.4 ============================================================================== --- stable/8/share/man/man4/syscons.4 Tue Mar 2 01:45:02 2010 (r204545) +++ stable/8/share/man/man4/syscons.4 Tue Mar 2 01:56:55 2010 (r204546) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2006 +.Dd September 10, 2009 .Dt SYSCONS 4 .Os .Sh NAME @@ -325,7 +325,7 @@ This mode is useful on some laptop compu most other systems, and it adds substantial amount of code to syscons. If this option is NOT defined, you can reduce the kernel size a lot. See the -.Dv VESA800X600 +.Dv VESAMODE flag below. .It Dv SC_TWOBUTTON_MOUSE If you have a two button mouse, you may want to add this option @@ -426,15 +426,15 @@ or else at the loader prompt (see .\".It bit 6 (QUIET_BELL) .\"This option suppresses the bell, whether audible or visual, .\"if it is rung in a background virtual terminal. -.It 0x0080 (VESA800X600) -This option puts the video card in the VESA 800x600 pixel, 16 color -mode. -It may be useful for laptop computers for which the 800x600 mode -is otherwise unsupported by the X server. +.It 0x0080 (VESAMODE) +This option puts the video card in the VESA mode specified by higher +16 bits of the flags during kernel initialization. Note that in order for this flag to work, the kernel must be compiled with the .Dv SC_PIXEL_MODE option explained above. +A list of the available mode can be obtained via +.Xr vidcontrol 1 . .\"Note also that the ``copy-and-paste'' function is not currently supported .\"in this mode and the mouse pointer will not be displayed. .It 0x0100 (AUTODETECT_KBD) Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Tue Mar 2 01:45:02 2010 (r204545) +++ stable/8/sys/amd64/conf/NOTES Tue Mar 2 01:56:55 2010 (r204546) @@ -154,6 +154,17 @@ options AGP_DEBUG ##################################################################### # HARDWARE DEVICE CONFIGURATION +# To include support for VGA VESA video modes +options VESA + +# Turn on extra debugging checks and output for VESA support. +options VESA_DEBUG + +device dpms # DPMS suspend & resume via VESA BIOS + +# x86 real mode BIOS emulator, required by atkbdc/dpms/vesa +options X86BIOS + # # Optional devices: # @@ -213,6 +224,9 @@ options VGA_WIDTH90 # support 90 colum # Debugging. options VGA_DEBUG +# Linear framebuffer driver for S3 VESA 1.2 cards. Works on top of VESA. +device s3pci + # 3Dfx Voodoo Graphics, Voodoo II /dev/3dfx CDEV support. This will create # the /dev/3dfx0 device to work with glide implementations. This should get # linked to /dev/3dfx and /dev/voodoo. Note that this is not the same as Modified: stable/8/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Wed Sep 23 20:49:14 2009 (r197444) +++ stable/8/sys/compat/x86bios/x86bios.c Tue Mar 2 01:56:55 2010 (r204546) @@ -1,6 +1,28 @@ /*- - * Written by paradox - * Public domain. + * Copyright (c) 2009 Alex Keda + * Copyright (c) 2009 Jung-uk Kim + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include @@ -9,29 +31,164 @@ __FBSDID("$FreeBSD$"); #include "opt_x86bios.h" #include +#include #include #include +#include #include #include +#include +#include + +#include +#include +#include + +#include +#include + +#include #include #include -#include +#define X86BIOS_PAGE_SIZE 0x00001000 /* 4K */ -#include -#include -#include +#define X86BIOS_IVT_SIZE 0x00000500 /* 1K + 256 (BDA) */ +#define X86BIOS_SEG_SIZE 0x00010000 /* 64K */ +#define X86BIOS_MEM_SIZE 0x00100000 /* 1M */ + +#define X86BIOS_IVT_BASE 0x00000000 +#define X86BIOS_RAM_BASE 0x00001000 +#define X86BIOS_ROM_BASE 0x000a0000 /* XXX EBDA? */ + +#define X86BIOS_ROM_SIZE (X86BIOS_MEM_SIZE - X86BIOS_ROM_BASE) -u_char *pbiosMem = NULL; -static u_char *pbiosStack = NULL; +#define X86BIOS_PAGES (X86BIOS_MEM_SIZE / X86BIOS_PAGE_SIZE) -int busySegMap[5]; +#define X86BIOS_R_DS _pad1 +#define X86BIOS_R_SS _pad2 static struct x86emu x86bios_emu; static struct mtx x86bios_lock; +static void *x86bios_ivt; +static void *x86bios_rom; +static void *x86bios_seg; + +static vm_offset_t *x86bios_map; + +static vm_paddr_t x86bios_seg_phys; + +SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging"); +static int x86bios_trace_call; +TUNABLE_INT("debug.x86bios.call", &x86bios_trace_call); +SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RW, &x86bios_trace_call, 0, + "Trace far function calls"); +static int x86bios_trace_int; +TUNABLE_INT("debug.x86bios.int", &x86bios_trace_int); +SYSCTL_INT(_debug_x86bios, OID_AUTO, int, CTLFLAG_RW, &x86bios_trace_int, 0, + "Trace software interrupt handlers"); + +static void * +x86bios_get_pages(uint32_t offset, size_t size) +{ + int i; + + if (offset + size > X86BIOS_MEM_SIZE) + return (NULL); + + i = offset / X86BIOS_PAGE_SIZE; + if (x86bios_map[i] != 0) + return ((void *)(x86bios_map[i] + offset - + i * X86BIOS_PAGE_SIZE)); + + return (NULL); +} + +static void +x86bios_set_pages(vm_offset_t va, vm_paddr_t pa, size_t size) +{ + int i, j; + + for (i = pa / X86BIOS_PAGE_SIZE, j = 0; + j < howmany(size, X86BIOS_PAGE_SIZE); i++, j++) + x86bios_map[i] = va + j * X86BIOS_PAGE_SIZE; +} + +static uint8_t +x86bios_emu_rdb(struct x86emu *emu, uint32_t addr) +{ + uint8_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + return (*va); +} + +static uint16_t +x86bios_emu_rdw(struct x86emu *emu, uint32_t addr) +{ + uint16_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + return (le16toh(*va)); +} + +static uint32_t +x86bios_emu_rdl(struct x86emu *emu, uint32_t addr) +{ + uint32_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + return (le32toh(*va)); +} + +static void +x86bios_emu_wrb(struct x86emu *emu, uint32_t addr, uint8_t val) +{ + uint8_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + *va = val; +} + +static void +x86bios_emu_wrw(struct x86emu *emu, uint32_t addr, uint16_t val) +{ + uint16_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + *va = htole16(val); +} + +static void +x86bios_emu_wrl(struct x86emu *emu, uint32_t addr, uint32_t val) +{ + uint32_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + *va = htole32(val); +} + static uint8_t x86bios_emu_inb(struct x86emu *emu, uint16_t port) { @@ -40,6 +197,7 @@ x86bios_emu_inb(struct x86emu *emu, uint return (0); if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); + return (inb(port)); } @@ -49,6 +207,7 @@ x86bios_emu_inw(struct x86emu *emu, uint if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); + return (inw(port)); } @@ -58,6 +217,7 @@ x86bios_emu_inl(struct x86emu *emu, uint if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); + return (inl(port)); } @@ -69,6 +229,7 @@ x86bios_emu_outb(struct x86emu *emu, uin return; if (port >= 0x80 && port < 0x88) /* POST status register */ return; + outb(port, val); } @@ -78,6 +239,7 @@ x86bios_emu_outw(struct x86emu *emu, uin if (port >= 0x80 && port < 0x88) /* POST status register */ return; + outw(port, val); } @@ -87,44 +249,245 @@ x86bios_emu_outl(struct x86emu *emu, uin if (port >= 0x80 && port < 0x88) /* POST status register */ return; + outl(port, val); } +static void +x86bios_emu_get_intr(struct x86emu *emu, int intno) +{ + uint16_t *sp; + uint32_t iv; + + emu->x86.R_SP -= 6; + + sp = (uint16_t *)((vm_offset_t)x86bios_seg + emu->x86.R_SP); + sp[0] = htole16(emu->x86.R_IP); + sp[1] = htole16(emu->x86.R_CS); + sp[2] = htole16(emu->x86.R_FLG); + + iv = x86bios_get_intr(intno); + emu->x86.R_IP = iv & 0x000f; + emu->x86.R_CS = (iv >> 12) & 0xffff; + emu->x86.R_FLG &= ~(F_IF | F_TF); +} + +void * +x86bios_alloc(uint32_t *offset, size_t size) +{ + void *vaddr; + + if (offset == NULL || size == 0) + return (NULL); + + vaddr = contigmalloc(size, M_DEVBUF, M_NOWAIT, X86BIOS_RAM_BASE, + X86BIOS_ROM_BASE, X86BIOS_PAGE_SIZE, 0); + if (vaddr != NULL) { + *offset = vtophys(vaddr); + x86bios_set_pages((vm_offset_t)vaddr, *offset, size); + } + + return (vaddr); +} + void -x86biosCall(struct x86regs *regs, int intno) +x86bios_free(void *addr, size_t size) { + vm_paddr_t paddr; - if (intno < 0 || intno > 255) + if (addr == NULL || size == 0) + return; + + paddr = vtophys(addr); + if (paddr < X86BIOS_RAM_BASE || paddr >= X86BIOS_ROM_BASE || + paddr % X86BIOS_PAGE_SIZE != 0) return; + bzero(x86bios_map + paddr / X86BIOS_PAGE_SIZE, + sizeof(*x86bios_map) * howmany(size, X86BIOS_PAGE_SIZE)); + contigfree(addr, size, M_DEVBUF); +} + +void +x86bios_init_regs(struct x86regs *regs) +{ + + bzero(regs, sizeof(*regs)); + regs->X86BIOS_R_DS = regs->X86BIOS_R_SS = x86bios_seg_phys >> 4; +} + +void +x86bios_call(struct x86regs *regs, uint16_t seg, uint16_t off) +{ + + if (x86bios_map == NULL) + return; + + if (x86bios_trace_call) + printf("Calling 0x%05x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + (seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); + mtx_lock_spin(&x86bios_lock); + memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); + x86emu_exec_call(&x86bios_emu, seg, off); + memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); + mtx_unlock_spin(&x86bios_lock); + + if (x86bios_trace_call) + printf("Exiting 0x%05x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + (seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); +} + +uint32_t +x86bios_get_intr(int intno) +{ + uint32_t *iv; + + iv = (uint32_t *)((vm_offset_t)x86bios_ivt + intno * 4); + + return (le32toh(*iv)); +} + +void +x86bios_intr(struct x86regs *regs, int intno) +{ + + if (intno < 0 || intno > 255) + return; + + if (x86bios_map == NULL) + return; + if (x86bios_trace_int) + printf("Calling int 0x%x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + intno, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); + + mtx_lock_spin(&x86bios_lock); memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); x86emu_exec_intr(&x86bios_emu, intno); memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); - mtx_unlock_spin(&x86bios_lock); + + if (x86bios_trace_int) + printf("Exiting int 0x%x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + intno, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); +} + +void * +x86bios_offset(uint32_t offset) +{ + + return (x86bios_get_pages(offset, 1)); } void * -x86biosOffs(uint32_t offs) +x86bios_get_orm(uint32_t offset) { + uint8_t *p; + + /* Does the shadow ROM contain BIOS POST code for x86? */ + p = x86bios_offset(offset); + if (p == NULL || p[0] != 0x55 || p[1] != 0xaa || p[3] != 0xe9) + return (NULL); - return (pbiosMem + offs); + return (p); +} + +int +x86bios_match_device(uint32_t offset, device_t dev) +{ + uint8_t *p; + uint16_t device, vendor; + uint8_t class, progif, subclass; + + /* Does the shadow ROM contain BIOS POST code for x86? */ + p = x86bios_get_orm(offset); + if (p == NULL) + return (0); + + /* Does it contain PCI data structure? */ + p += le16toh(*(uint16_t *)(p + 0x18)); + if (bcmp(p, "PCIR", 4) != 0 || + le16toh(*(uint16_t *)(p + 0x0a)) < 0x18 || *(p + 0x14) != 0) + return (0); + + /* Does it match the vendor, device, and classcode? */ + vendor = le16toh(*(uint16_t *)(p + 0x04)); + device = le16toh(*(uint16_t *)(p + 0x06)); + progif = *(p + 0x0d); + subclass = *(p + 0x0e); + class = *(p + 0x0f); + if (vendor != pci_get_vendor(dev) || device != pci_get_device(dev) || + class != pci_get_class(dev) || subclass != pci_get_subclass(dev) || + progif != pci_get_progif(dev)) + return (0); + + return (1); +} + +static __inline int +x86bios_map_mem(void) +{ + + x86bios_ivt = pmap_mapbios(X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE); + if (x86bios_ivt == NULL) + return (1); + x86bios_rom = pmap_mapdev(X86BIOS_ROM_BASE, X86BIOS_ROM_SIZE); + if (x86bios_rom == NULL) { + pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); + return (1); + } + x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_WAITOK, + X86BIOS_RAM_BASE, X86BIOS_ROM_BASE, X86BIOS_PAGE_SIZE, 0); + x86bios_seg_phys = vtophys(x86bios_seg); + + return (0); +} + +static __inline void +x86bios_unmap_mem(void) +{ + + pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); + pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE); + contigfree(x86bios_seg, X86BIOS_SEG_SIZE, M_DEVBUF); } static void x86bios_init(void *arg __unused) { - int offs; + int i; mtx_init(&x86bios_lock, "x86bios lock", NULL, MTX_SPIN); - /* Can pbiosMem be NULL here? */ - pbiosMem = pmap_mapbios(0x0, MAPPED_MEMORY_SIZE); + if (x86bios_map_mem() != 0) + return; - memset(&x86bios_emu, 0, sizeof(x86bios_emu)); - x86emu_init_default(&x86bios_emu); + x86bios_map = malloc(sizeof(*x86bios_map) * X86BIOS_PAGES, M_DEVBUF, + M_WAITOK | M_ZERO); + x86bios_set_pages((vm_offset_t)x86bios_ivt, X86BIOS_IVT_BASE, + X86BIOS_IVT_SIZE); + x86bios_set_pages((vm_offset_t)x86bios_rom, X86BIOS_ROM_BASE, + X86BIOS_ROM_SIZE); + x86bios_set_pages((vm_offset_t)x86bios_seg, x86bios_seg_phys, + X86BIOS_SEG_SIZE); + + bzero(&x86bios_emu, sizeof(x86bios_emu)); + + x86bios_emu.emu_rdb = x86bios_emu_rdb; + x86bios_emu.emu_rdw = x86bios_emu_rdw; + x86bios_emu.emu_rdl = x86bios_emu_rdl; + x86bios_emu.emu_wrb = x86bios_emu_wrb; + x86bios_emu.emu_wrw = x86bios_emu_wrw; + x86bios_emu.emu_wrl = x86bios_emu_wrl; x86bios_emu.emu_inb = x86bios_emu_inb; x86bios_emu.emu_inw = x86bios_emu_inw; @@ -133,23 +496,24 @@ x86bios_init(void *arg __unused) x86bios_emu.emu_outw = x86bios_emu_outw; x86bios_emu.emu_outl = x86bios_emu_outl; - x86bios_emu.mem_base = (char *)pbiosMem; - x86bios_emu.mem_size = 1024 * 1024; - - memset(busySegMap, 0, sizeof(busySegMap)); - - pbiosStack = x86biosAlloc(1, &offs); + for (i = 0; i < 256; i++) + x86bios_emu._x86emu_intrTab[i] = x86bios_emu_get_intr; } static void x86bios_uninit(void *arg __unused) { + vm_offset_t *map = x86bios_map; - x86biosFree(pbiosStack, 1); + mtx_lock_spin(&x86bios_lock); + if (x86bios_map != NULL) { + free(x86bios_map, M_DEVBUF); + x86bios_map = NULL; + } + mtx_unlock_spin(&x86bios_lock); - if (pbiosMem) - pmap_unmapdev((vm_offset_t)pbiosMem, - MAPPED_MEMORY_SIZE); + if (map != NULL) + x86bios_unmap_mem(); mtx_destroy(&x86bios_lock); } @@ -157,7 +521,6 @@ x86bios_uninit(void *arg __unused) static int x86bios_modevent(module_t mod __unused, int type, void *data __unused) { - int err = 0; switch (type) { case MOD_LOAD: @@ -167,11 +530,10 @@ x86bios_modevent(module_t mod __unused, x86bios_uninit(NULL); break; default: - err = ENOTSUP; - break; + return (ENOTSUP); } - return (err); + return (0); } static moduledata_t x86bios_mod = { Modified: stable/8/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Wed Sep 23 20:49:14 2009 (r197444) +++ stable/8/sys/compat/x86bios/x86bios.h Tue Mar 2 01:56:55 2010 (r204546) @@ -1,48 +1,73 @@ /*- - * Written by paradox - * Public domain. + * Copyright (c) 2009 Alex Keda + * All rights reserved. * - * x86 registers were borrowed from x86emu.h x86emu_regs.h - * for compatability. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ +/* + * x86 registers were borrowed from x86emu.h x86emu_regs.h + * for compatability. + */ #ifndef _X86BIOS_H_ -#define _X86BIOS_H_ +#define _X86BIOS_H_ -#include #include #include +#include #ifdef __BIG_ENDIAN__ struct x86_register32 { - uint32_t e_reg; + uint32_t e_reg; }; struct x86_register16 { - uint16_t filler0; - uint16_t x_reg; + uint16_t filler0; + uint16_t x_reg; }; struct x86_register8 { - uint8_t filler0, filler1; - uint8_t h_reg, l_reg; + uint8_t filler0; + uint8_t filler1; + uint8_t h_reg; + uint8_t l_reg; }; #else /* !__BIG_ENDIAN__ */ struct x86_register32 { - uint32_t e_reg; + uint32_t e_reg; }; struct x86_register16 { - uint16_t x_reg; + uint16_t x_reg; }; struct x86_register8 { - uint8_t l_reg, h_reg; + uint8_t l_reg; + uint8_t h_reg; }; #endif /* __BIG_ENDIAN__ */ @@ -54,85 +79,78 @@ union x86_register { }; struct x86regs { - uint16_t register_cs; - uint16_t register_ds; + uint16_t _pad0; /* CS */ + uint16_t _pad1; /* DS */ uint16_t register_es; uint16_t register_fs; uint16_t register_gs; - uint16_t register_ss; + uint16_t _pad2; /* SS */ uint32_t register_flags; union x86_register register_a; union x86_register register_b; union x86_register register_c; union x86_register register_d; - union x86_register register_sp; + union x86_register _pad3; /* SP */ union x86_register register_bp; union x86_register register_si; union x86_register register_di; - union x86_register register_ip; }; typedef struct x86regs x86regs_t; /* 8 bit registers */ -#define R_AH register_a.I8_reg.h_reg -#define R_AL register_a.I8_reg.l_reg -#define R_BH register_b.I8_reg.h_reg -#define R_BL register_b.I8_reg.l_reg -#define R_CH register_c.I8_reg.h_reg -#define R_CL register_c.I8_reg.l_reg -#define R_DH register_d.I8_reg.h_reg -#define R_DL register_d.I8_reg.l_reg +#define R_AH register_a.I8_reg.h_reg +#define R_AL register_a.I8_reg.l_reg +#define R_BH register_b.I8_reg.h_reg +#define R_BL register_b.I8_reg.l_reg +#define R_CH register_c.I8_reg.h_reg +#define R_CL register_c.I8_reg.l_reg +#define R_DH register_d.I8_reg.h_reg +#define R_DL register_d.I8_reg.l_reg /* 16 bit registers */ -#define R_AX register_a.I16_reg.x_reg -#define R_BX register_b.I16_reg.x_reg -#define R_CX register_c.I16_reg.x_reg -#define R_DX register_d.I16_reg.x_reg +#define R_AX register_a.I16_reg.x_reg +#define R_BX register_b.I16_reg.x_reg +#define R_CX register_c.I16_reg.x_reg +#define R_DX register_d.I16_reg.x_reg /* 32 bit extended registers */ -#define R_EAX register_a.I32_reg.e_reg -#define R_EBX register_b.I32_reg.e_reg -#define R_ECX register_c.I32_reg.e_reg -#define R_EDX register_d.I32_reg.e_reg +#define R_EAX register_a.I32_reg.e_reg +#define R_EBX register_b.I32_reg.e_reg +#define R_ECX register_c.I32_reg.e_reg +#define R_EDX register_d.I32_reg.e_reg /* special registers */ -#define R_SP register_sp.I16_reg.x_reg -#define R_BP register_bp.I16_reg.x_reg -#define R_SI register_si.I16_reg.x_reg -#define R_DI register_di.I16_reg.x_reg -#define R_IP register_ip.I16_reg.x_reg -#define R_FLG register_flags +#define R_BP register_bp.I16_reg.x_reg +#define R_SI register_si.I16_reg.x_reg +#define R_DI register_di.I16_reg.x_reg +#define R_FLG register_flags /* special registers */ -#define R_ESP register_sp.I32_reg.e_reg -#define R_EBP register_bp.I32_reg.e_reg -#define R_ESI register_si.I32_reg.e_reg -#define R_EDI register_di.I32_reg.e_reg -#define R_EIP register_ip.I32_reg.e_reg -#define R_EFLG register_flags +#define R_EBP register_bp.I32_reg.e_reg +#define R_ESI register_si.I32_reg.e_reg +#define R_EDI register_di.I32_reg.e_reg +#define R_EFLG register_flags /* segment registers */ -#define R_CS register_cs -#define R_DS register_ds -#define R_SS register_ss -#define R_ES register_es -#define R_FS register_fs -#define R_GS register_gs - -#define SEG_ADDR(x) (((x) >> 4) & 0x00F000) -#define SEG_OFF(x) ((x) & 0x0FFFF) -#define FARP(x) ((le32toh(x) & 0xffff) + ((le32toh(x) >> 12) & 0xffff00)) +#define R_ES register_es +#define R_FS register_fs +#define R_GS register_gs -#define MAPPED_MEMORY_SIZE 0xc00000 -#define PAGE_RESERV (4096*5) +#define X86BIOS_PHYSTOSEG(x) (((x) >> 4) & 0xffff) +#define X86BIOS_PHYSTOOFF(x) ((x) & 0x000f) __BEGIN_DECLS -void x86biosCall(struct x86regs *regs, int intno); -void *x86biosAlloc(int count, int *segs); -void x86biosFree(void *pbuf, int count); -void *x86biosOffs(uint32_t offs); +void *x86bios_alloc(uint32_t *offset, size_t size); +void x86bios_call(struct x86regs *regs, uint16_t seg, uint16_t off); +void x86bios_free(void *addr, size_t size); +uint32_t x86bios_get_intr(int intno); +void *x86bios_get_orm(uint32_t offset); +void x86bios_init_regs(struct x86regs *regs); +void x86bios_intr(struct x86regs *regs, int intno); +int x86bios_match_device(uint32_t offset, device_t dev); +void *x86bios_offset(uint32_t offset); __END_DECLS #endif /* !_X86BIOS_H_ */ Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Tue Mar 2 01:45:02 2010 (r204545) +++ stable/8/sys/conf/NOTES Tue Mar 2 01:56:55 2010 (r204546) @@ -2821,3 +2821,4 @@ options AAC_DEBUG # Debugging levels: ##options BKTR_ALLOC_PAGES=(217*4+1) options BROOKTREE_ALLOC_PAGES=(217*4+1) options MAXFILES=999 + Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Tue Mar 2 01:45:02 2010 (r204545) +++ stable/8/sys/conf/files Tue Mar 2 01:56:55 2010 (r204546) @@ -2893,4 +2893,3 @@ dev/xen/netfront/netfront.c optional xen dev/xen/xenpci/xenpci.c optional xenpci dev/xen/xenpci/evtchn.c optional xenpci dev/xen/xenpci/machine_reboot.c optional xenpci - Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Mar 2 01:45:02 2010 (r204545) +++ stable/8/sys/conf/files.amd64 Tue Mar 2 01:56:55 2010 (r204546) @@ -163,6 +163,7 @@ dev/atkbdc/atkbdc_subr.c optional atkbdc dev/atkbdc/psm.c optional psm atkbdc dev/coretemp/coretemp.c optional coretemp dev/cpuctl/cpuctl.c optional cpuctl +dev/dpms/dpms.c optional dpms # There are no systems with isa slots, so all ed isa entries should go.. dev/ed/if_ed_3c503.c optional ed isa ed_3c503 dev/ed/if_ed_isa.c optional ed isa @@ -170,6 +171,8 @@ dev/ed/if_ed_wd80x3.c optional ed isa dev/ed/if_ed_hpp.c optional ed isa ed_hpp dev/ed/if_ed_sic.c optional ed isa ed_sic dev/fb/fb.c optional fb | vga +dev/fb/s3_pci.c optional s3pci +dev/fb/vesa.c optional vga vesa dev/fb/vga.c optional vga dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis @@ -220,6 +223,7 @@ dev/sio/sio_puc.c optional sio puc dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scterm-teken.c optional sc +dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc dev/syscons/teken/teken.c optional sc @@ -294,3 +298,8 @@ i386/cpufreq/p4tcc.c optional cpufreq # libkern/memmove.c standard libkern/memset.c standard +# +# x86 real mode BIOS emulator, required by atkbdc/dpms/vesa +# +compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa +contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Tue Mar 2 01:45:02 2010 (r204545) +++ stable/8/sys/conf/files.i386 Tue Mar 2 01:56:55 2010 (r204546) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 2 07:48:13 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15996106566C; Tue, 2 Mar 2010 07:48:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 041478FC0C; Tue, 2 Mar 2010 07:48:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o227mCLY062358; Tue, 2 Mar 2010 07:48:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o227mCcI062356; Tue, 2 Mar 2010 07:48:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003020748.o227mCcI062356@svn.freebsd.org> From: Xin LI Date: Tue, 2 Mar 2010 07:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204560 - stable/8/share/man/man4/man4.i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2010 07:48:13 -0000 Author: delphij Date: Tue Mar 2 07:48:12 2010 New Revision: 204560 URL: http://svn.freebsd.org/changeset/base/204560 Log: MFC r197042: remove dpms.4. Modified: stable/8/share/man/man4/man4.i386/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/man4.i386/Makefile ============================================================================== --- stable/8/share/man/man4/man4.i386/Makefile Tue Mar 2 07:44:38 2010 (r204559) +++ stable/8/share/man/man4/man4.i386/Makefile Tue Mar 2 07:48:12 2010 (r204560) @@ -10,7 +10,6 @@ MAN= aic.4 \ cs.4 \ ct.4 \ ctau.4 \ - dpms.4 \ cx.4 \ ep.4 \ ex.4 \ From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 2 10:05:20 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAFA0106566B; Tue, 2 Mar 2010 10:05:20 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EC248FC16; Tue, 2 Mar 2010 10:05:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o22A5KFm093162; Tue, 2 Mar 2010 10:05:20 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o22A5KJW093160; Tue, 2 Mar 2010 10:05:20 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003021005.o22A5KJW093160@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 2 Mar 2010 10:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204567 - stable/8/share/zoneinfo X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2010 10:05:20 -0000 Author: edwin Date: Tue Mar 2 10:05:20 2010 New Revision: 204567 URL: http://svn.freebsd.org/changeset/base/204567 Log: MFC of r204566, tzdata2010c: Paraguay changes its DST schedule, postponing the March rule to April and modifying the October date. Modified: stable/8/share/zoneinfo/southamerica Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/southamerica ============================================================================== --- stable/8/share/zoneinfo/southamerica Tue Mar 2 10:03:06 2010 (r204566) +++ stable/8/share/zoneinfo/southamerica Tue Mar 2 10:05:20 2010 (r204567) @@ -1,5 +1,5 @@ #
-# @(#)southamerica	8.40
+# @(#)southamerica	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1364,8 +1364,24 @@ Rule	Para	2002	2003	-	Sep	Sun>=1	0:00	1:
 # Decree 1,867 (2004-03-05)
 # From Carlos Raul Perasso via Jesper Norgaard Welen (2006-10-13)
 # 
-Rule	Para	2004	max	-	Oct	Sun>=15	0:00	1:00	S
-Rule	Para	2005	max	-	Mar	Sun>=8	0:00	0	-
+Rule	Para	2004	2009	-	Oct	Sun>=15	0:00	1:00	S
+Rule	Para	2005	2009	-	Mar	Sun>=8	0:00	0	-
+# From Carlos Raul Perasso (2010-02-18):
+# By decree number 3958 issued yesterday (
+# 
+# http://www.presidencia.gov.py/v1/wp-content/uploads/2010/02/decreto3958.pdf
+# 
+# )
+# Paraguay changes its DST schedule, postponing the March rule to April and
+# modifying the October date. The decree reads:
+# ...
+# Art. 1. It is hereby established that from the second Sunday of the month of
+# April of this year (2010), the official time is to be set back 60 minutes,
+# and that on the first Sunday of the month of October, it is to be set
+# forward 60 minutes, in all the territory of the Paraguayan Republic.
+# ...
+Rule	Para	2010	max	-	Oct	Sun<=7	0:00	1:00	S
+Rule	Para	2010	max	-	Apr	Sun>=8	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Asuncion	-3:50:40 -	LMT	1890

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  2 10:32:34 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A7254106564A;
	Tue,  2 Mar 2010 10:32:34 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 959E48FC18;
	Tue,  2 Mar 2010 10:32:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o22AWY1n099377;
	Tue, 2 Mar 2010 10:32:34 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o22AWYO6099375;
	Tue, 2 Mar 2010 10:32:34 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201003021032.o22AWYO6099375@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 2 Mar 2010 10:32:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204572 - stable/8/sys/kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 02 Mar 2010 10:32:34 -0000

Author: kib
Date: Tue Mar  2 10:32:34 2010
New Revision: 204572
URL: http://svn.freebsd.org/changeset/base/204572

Log:
  MFC r204412:
  Fix several style issues.
  Define make_dev_credv() as static to match declaration.

Modified:
  stable/8/sys/kern/kern_conf.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/kern/kern_conf.c
==============================================================================
--- stable/8/sys/kern/kern_conf.c	Tue Mar  2 10:12:17 2010	(r204571)
+++ stable/8/sys/kern/kern_conf.c	Tue Mar  2 10:32:34 2010	(r204572)
@@ -655,7 +655,7 @@ prep_cdevsw(struct cdevsw *devsw)
 		cdevsw_free_devlocked(dsw2);
 }
 
-struct cdev *
+static struct cdev *
 make_dev_credv(int flags, struct cdevsw *devsw, int unit,
     struct ucred *cr, uid_t uid,
     gid_t gid, int mode, const char *fmt, va_list ap)
@@ -953,7 +953,8 @@ clone_setup(struct clonedevs **cdp)
 }
 
 int
-clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **dp, int extra)
+clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up,
+    struct cdev **dp, int extra)
 {
 	struct clonedevs *cd;
 	struct cdev *dev, *ndev, *dl, *de;
@@ -1124,6 +1125,7 @@ destroy_dev_sched_cbl(struct cdev *dev, 
 int
 destroy_dev_sched_cb(struct cdev *dev, void (*cb)(void *), void *arg)
 {
+
 	dev_lock();
 	return (destroy_dev_sched_cbl(dev, cb, arg));
 }
@@ -1131,6 +1133,7 @@ destroy_dev_sched_cb(struct cdev *dev, v
 int
 destroy_dev_sched(struct cdev *dev)
 {
+
 	return (destroy_dev_sched_cb(dev, NULL, NULL));
 }
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  2 10:41:35 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 09EA8106564A;
	Tue,  2 Mar 2010 10:41:35 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EC6E78FC17;
	Tue,  2 Mar 2010 10:41:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o22AfYUU001562;
	Tue, 2 Mar 2010 10:41:34 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o22AfYqc001560;
	Tue, 2 Mar 2010 10:41:34 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201003021041.o22AfYqc001560@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 2 Mar 2010 10:41:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204573 - stable/8/sys/vm
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 02 Mar 2010 10:41:35 -0000

Author: kib
Date: Tue Mar  2 10:41:34 2010
New Revision: 204573
URL: http://svn.freebsd.org/changeset/base/204573

Log:
  MFC r204415:
  Update comment for vm_page_alloc(9), listing all acceptable flags [1].
  Note that the function does not sleep, it can block.

Modified:
  stable/8/sys/vm/vm_page.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/vm/vm_page.c
==============================================================================
--- stable/8/sys/vm/vm_page.c	Tue Mar  2 10:32:34 2010	(r204572)
+++ stable/8/sys/vm/vm_page.c	Tue Mar  2 10:41:34 2010	(r204573)
@@ -1020,8 +1020,13 @@ vm_page_cache_transfer(vm_object_t orig_
  *	VM_ALLOC_SYSTEM		system *really* needs a page
  *	VM_ALLOC_INTERRUPT	interrupt time request
  *	VM_ALLOC_ZERO		zero page
+ *	VM_ALLOC_WIRED		wire the allocated page
+ *	VM_ALLOC_NOOBJ		page is not associated with a vm object
+ *	VM_ALLOC_NOBUSY		do not set the page busy
+ *	VM_ALLOC_IFNOTCACHED	return NULL, do not reactivate if the page
+ *				is cached
  *
- *	This routine may not block.
+ *	This routine may not sleep.
  */
 vm_page_t
 vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req)

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  2 11:00:11 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 53C1F1065670;
	Tue,  2 Mar 2010 11:00:11 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 27A088FC13;
	Tue,  2 Mar 2010 11:00:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o22B0BW5007509;
	Tue, 2 Mar 2010 11:00:11 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o22B0BoI007508;
	Tue, 2 Mar 2010 11:00:11 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201003021100.o22B0BoI007508@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 2 Mar 2010 11:00:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204575 - stable/8/share/man/man9
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 02 Mar 2010 11:00:11 -0000

Author: kib
Date: Tue Mar  2 11:00:10 2010
New Revision: 204575
URL: http://svn.freebsd.org/changeset/base/204575

Log:
  MFC r204416:
  Update man page for vm_page_alloc(9).

Modified:
  stable/8/share/man/man9/vm_page_alloc.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/vm_page_alloc.9
==============================================================================
--- stable/8/share/man/man9/vm_page_alloc.9	Tue Mar  2 10:43:41 2010	(r204574)
+++ stable/8/share/man/man9/vm_page_alloc.9	Tue Mar  2 11:00:10 2010	(r204575)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 13, 2001
+.Dd February 27, 2010
 .Dt VM_PAGE_ALLOC 9
 .Os
 .Sh NAME
@@ -48,16 +48,26 @@ within
 .Fa object .
 It is assumed that a page has not already been allocated at
 .Fa pindex .
-The page returned is inserted into the object, but is not inserted
-into the pmap.
+The page returned is inserted into the object, unless
+.Dv VM_ALLOC_NOOBJ
+is specified in the
+.Fa page_req ,
+but is not inserted into a pmap.
+The page may exists in the vm object cache, in which case it will
+be reactivated instead, moving from the cache into the object page list.
 .Pp
 .Fn vm_page_alloc
-will not block.
+will not sleep.
 .Pp
 Its arguments are:
 .Bl -tag -width ".Fa page_req"
 .It Fa object
 The VM object to allocate the page for.
+The
+.Fa object
+must be locked if
+.Dv VM_ALLOC_NOOBJ
+is not specified.
 .It Fa pindex
 The index into the object at which the page should be inserted.
 .It Fa page_req
@@ -82,12 +92,24 @@ than zero.
 .It Dv VM_ALLOC_ZERO
 Indicate a preference for a pre-zeroed page.
 There is no guarantee that the page thus returned will be zeroed, but
-it will be marked as such.
+it will be marked by
+.Dv PG_ZERO
+flag if it is zeroed.
 .It Dv VM_ALLOC_NOOBJ
-The page is associated with an unmanaged memory region, that is, there
-is no backing VM object.
-This is typically used to allocate pages within the kernel virtual
-address space.
+Do not associate the allocated page with a vm object.
+The
+.Fa object
+argument is ignored.
+.It Dv VM_ALLOC_NOBUSY
+The page returned will not be busied.
+.It Dv VM_ALLOC_WIRED
+The returned page is wired.
+.It Dv VM_ALLOC_IFNOTCACHED
+Only allocate the page if it is not cached in the
+.Fa object .
+If the page at the specified
+.Fa pindex
+is cached, NULL is returned instead.
 .El
 .El
 .Sh RETURN VALUES

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  2 13:13:13 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 301AE106567A;
	Tue,  2 Mar 2010 13:13:13 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1CA268FC25;
	Tue,  2 Mar 2010 13:13:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o22DDD6P037550;
	Tue, 2 Mar 2010 13:13:13 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o22DDCEF037523;
	Tue, 2 Mar 2010 13:13:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003021313.o22DDCEF037523@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 2 Mar 2010 13:13:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204580 - in stable/8/sys: conf dev/ath/ath_hal
	dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5416 modules/ath
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 02 Mar 2010 13:13:13 -0000

Author: rpaulo
Date: Tue Mar  2 13:13:12 2010
New Revision: 204580
URL: http://svn.freebsd.org/changeset/base/204580

Log:
  MFC r197948 r203156 r203158 r203159 r203680 r203682 r203750 r203882 r203930
      r203933 r203959 r204521 r204578:
  
  Atheros AR9285 support.

Added:
  stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
     - copied unchanged from r197948, head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
  stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h
     - copied, changed from r197948, head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h
  stable/8/sys/dev/ath/ath_hal/ar5416/ar9285.c
     - copied unchanged from r203930, head/sys/dev/ath/ath_hal/ar5416/ar9285.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar9285.h
     - copied unchanged from r203930, head/sys/dev/ath/ath_hal/ar5416/ar9285.h
  stable/8/sys/dev/ath/ath_hal/ar5416/ar9285.ini
     - copied unchanged from r203159, head/sys/dev/ath/ath_hal/ar5416/ar9285.ini
  stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c
     - copied, changed from r203930, head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c
     - copied unchanged from r203930, head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar9285v2.ini
     - copied unchanged from r203159, head/sys/dev/ath/ath_hal/ar5416/ar9285v2.ini
Modified:
  stable/8/sys/conf/files
  stable/8/sys/dev/ath/ath_hal/ah.h
  stable/8/sys/dev/ath/ath_hal/ah_eeprom_v14.h
  stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.h
  stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
  stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_power.c
  stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c
  stable/8/sys/dev/ath/ath_hal/ar5212/ar5212reg.h
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416.h
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_eeprom.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_keycache.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_phy.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_power.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416desc.h
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416phy.h
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
  stable/8/sys/dev/ath/ath_hal/ar5416/ar9280.h
  stable/8/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c
  stable/8/sys/modules/ath/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/conf/files	Tue Mar  2 13:13:12 2010	(r204580)
@@ -554,6 +554,9 @@ dev/ath/ath_hal/ah_eeprom_v3.c	optional 
 dev/ath/ath_hal/ah_eeprom_v14.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_hal/ah_eeprom_v4k.c \
+	optional ath_hal | ath_ar9285 \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ath_hal/ah_regdomain.c	optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 # ar5210
@@ -600,104 +603,124 @@ dev/ath/ath_hal/ar5211/ar5211_xmit.c		op
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar5212
 dev/ath/ath_hal/ar5212/ar5212_ani.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_attach.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_beacon.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_eeprom.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_gpio.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_interrupts.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_keycache.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_misc.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_phy.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_power.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_recv.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_reset.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_rfgain.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5212/ar5212_xmit.c \
-	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
+	ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar5416 (depends on ar5212)
 dev/ath/ath_hal/ar5416/ar5416_ani.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_attach.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_beacon.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_cal.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_cal_iq.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_eeprom.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_gpio.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_interrupts.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_keycache.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_misc.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_phy.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_power.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_recv.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_reset.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar5416_xmit.c \
-	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \
+	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar9160 (depends on ar5416)
 dev/ath/ath_hal/ar5416/ar9160_attach.c optional ath_hal | ath_ar9160 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ar9280 (depends on ar5416)
-dev/ath/ath_hal/ar5416/ar9280_attach.c optional ath_hal | ath_ar9280 \
+dev/ath/ath_hal/ar5416/ar9280_attach.c optional ath_hal | ath_ar9280 | \
+	ath_ar9285 \ 
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+# ar9285 (depends on ar5416 and ar9280)
+dev/ath/ath_hal/ar5416/ar9285_attach.c optional ath_hal | ath_ar9285 \ 
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar9285_reset.c optional ath_hal | ath_ar9285 \ 
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # rf backends
 dev/ath/ath_hal/ar5212/ar2316.c	optional ath_rf2316 \
@@ -716,7 +739,9 @@ dev/ath/ath_hal/ar5212/ar5413.c	optional
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar5416/ar2133.c optional ath_hal | ath_ar5416 | ath_ar9160 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
-dev/ath/ath_hal/ar5416/ar9280.c optional ath_hal | ath_ar9280 \
+dev/ath/ath_hal/ar5416/ar9280.c optional ath_hal | ath_ar9280 | ath_ar9285 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar5416/ar9285.c optional ath_hal | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 # ath rate control algorithms
 dev/ath/ath_rate/amrr/amrr.c	optional ath_rate_amrr \

Modified: stable/8/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ah.h	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ah.h	Tue Mar  2 13:13:12 2010	(r204580)
@@ -638,7 +638,11 @@ struct ath_hal {
 			HAL_BOOL longCal, HAL_BOOL *isCalDone);
 	HAL_BOOL  __ahdecl(*ah_resetCalValid)(struct ath_hal *,
 			const struct ieee80211_channel *);
+	HAL_BOOL  __ahdecl(*ah_setTxPower)(struct ath_hal *,
+	    		const struct ieee80211_channel *, uint16_t *);
 	HAL_BOOL  __ahdecl(*ah_setTxPowerLimit)(struct ath_hal *, uint32_t);
+	HAL_BOOL  __ahdecl(*ah_setBoardValues)(struct ath_hal *,
+	    		const struct ieee80211_channel *);
 
 	/* Transmit functions */
 	HAL_BOOL  __ahdecl(*ah_updateTxTrigLevel)(struct ath_hal*,

Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v14.h
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v14.h	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v14.h	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ah_eeprom_v14.h,v 1.3 2008/11/10 04:08:00 sam Exp $
+ * $FreeBSD$
  */
 #ifndef _AH_EEPROM_V14_H_
 #define _AH_EEPROM_V14_H_
@@ -76,6 +76,7 @@
 #define AR5416_EEPMISC_BIG_ENDIAN    	0x01
 #define FREQ2FBIN(x,y) 			((y) ? ((x) - 2300) : (((x) - 4800) / 5))
 #define AR5416_MAX_CHAINS            	3
+#define	AR5416_PWR_TABLE_OFFSET_DB	-5
 #define AR5416_ANT_16S               	25
 
 #define AR5416_NUM_ANT_CHAIN_FIELDS     7

Copied: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c (from r197948, head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c	Tue Mar  2 13:13:12 2010	(r204580, copy of r197948, head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c)
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2009 Rui Paulo 
+ * Copyright (c) 2008 Sam Leffler, Errno Consulting
+ * Copyright (c) 2008 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+#include "opt_ah.h"
+
+#include "ah.h"
+#include "ah_internal.h"
+#include "ah_eeprom_v14.h"
+#include "ah_eeprom_v4k.h"
+
+static HAL_STATUS
+v4kEepromGet(struct ath_hal *ah, int param, void *val)
+{
+#define	CHAN_A_IDX	0
+#define	CHAN_B_IDX	1
+#define	IS_VERS(op, v)	((pBase->version & AR5416_EEP_VER_MINOR_MASK) op (v))
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+	const MODAL_EEP4K_HEADER *pModal = &ee->ee_base.modalHeader;
+	const BASE_EEP4K_HEADER  *pBase  = &ee->ee_base.baseEepHeader;
+	uint32_t sum;
+	uint8_t *macaddr;
+	int i;
+
+	switch (param) {
+        case AR_EEP_NFTHRESH_5:
+		*(int16_t *)val = pModal[0].noiseFloorThreshCh[0];
+		return HAL_OK;
+        case AR_EEP_NFTHRESH_2:
+		*(int16_t *)val = pModal[1].noiseFloorThreshCh[0];
+		return HAL_OK;
+        case AR_EEP_MACADDR:		/* Get MAC Address */
+		sum = 0;
+		macaddr = val;
+		for (i = 0; i < 6; i++) {
+			macaddr[i] = pBase->macAddr[i];
+			sum += pBase->macAddr[i];
+		}
+		if (sum == 0 || sum == 0xffff*3) {
+			HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad mac address %s\n",
+			    __func__, ath_hal_ether_sprintf(macaddr));
+			return HAL_EEBADMAC;
+		}
+		return HAL_OK;
+        case AR_EEP_REGDMN_0:
+		return pBase->regDmn[0];
+        case AR_EEP_REGDMN_1:
+		return pBase->regDmn[1];
+        case AR_EEP_OPCAP:
+		return pBase->deviceCap;
+        case AR_EEP_OPMODE:
+		return pBase->opCapFlags;
+        case AR_EEP_RFSILENT:
+		return pBase->rfSilent;
+	case AR_EEP_OB_5:
+		return pModal[CHAN_A_IDX].ob;
+    	case AR_EEP_DB_5:
+		return pModal[CHAN_A_IDX].db;
+    	case AR_EEP_OB_2:
+		return pModal[CHAN_B_IDX].ob;
+    	case AR_EEP_DB_2:
+		return pModal[CHAN_B_IDX].db;
+	case AR_EEP_TXMASK:
+		return pBase->txMask;
+	case AR_EEP_RXMASK:
+		return pBase->rxMask;
+	case AR_EEP_RXGAIN_TYPE:
+		return AR5416_EEP_RXGAIN_ORIG;
+	case AR_EEP_TXGAIN_TYPE:
+		return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ?
+		    pBase->txGainType : AR5416_EEP_TXGAIN_ORIG;
+#if 0
+	case AR_EEP_OL_PWRCTRL:
+		HALASSERT(val == AH_NULL);
+		return pBase->openLoopPwrCntl ?  HAL_OK : HAL_EIO;
+#endif
+	case AR_EEP_AMODE:
+		HALASSERT(val == AH_NULL);
+		return pBase->opCapFlags & AR5416_OPFLAGS_11A ?
+		    HAL_OK : HAL_EIO;
+	case AR_EEP_BMODE:
+	case AR_EEP_GMODE:
+		HALASSERT(val == AH_NULL);
+		return pBase->opCapFlags & AR5416_OPFLAGS_11G ?
+		    HAL_OK : HAL_EIO;
+	case AR_EEP_32KHZCRYSTAL:
+	case AR_EEP_COMPRESS:
+	case AR_EEP_FASTFRAME:		/* XXX policy decision, h/w can do it */
+	case AR_EEP_WRITEPROTECT:	/* NB: no write protect bit */
+		HALASSERT(val == AH_NULL);
+		/* fall thru... */
+	case AR_EEP_MAXQCU:		/* NB: not in opCapFlags */
+	case AR_EEP_KCENTRIES:		/* NB: not in opCapFlags */
+		return HAL_EIO;
+	case AR_EEP_AES:
+	case AR_EEP_BURST:
+        case AR_EEP_RFKILL:
+	case AR_EEP_TURBO5DISABLE:
+	case AR_EEP_TURBO2DISABLE:
+		HALASSERT(val == AH_NULL);
+		return HAL_OK;
+	case AR_EEP_ANTGAINMAX_2:
+		*(int8_t *) val = ee->ee_antennaGainMax[1];
+		return HAL_OK;
+	case AR_EEP_ANTGAINMAX_5:
+		*(int8_t *) val = ee->ee_antennaGainMax[0];
+		return HAL_OK;
+        default:
+		HALASSERT(0);
+		return HAL_EINVAL;
+	}
+#undef IS_VERS
+#undef CHAN_A_IDX
+#undef CHAN_B_IDX
+}
+
+static HAL_BOOL
+v4kEepromSet(struct ath_hal *ah, int param, int v)
+{
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+
+	switch (param) {
+	case AR_EEP_ANTGAINMAX_2:
+		ee->ee_antennaGainMax[1] = (int8_t) v;
+		return HAL_OK;
+	case AR_EEP_ANTGAINMAX_5:
+		ee->ee_antennaGainMax[0] = (int8_t) v;
+		return HAL_OK;
+	}
+	return HAL_EINVAL;
+}
+
+static HAL_BOOL
+v4kEepromDiag(struct ath_hal *ah, int request,
+     const void *args, uint32_t argsize, void **result, uint32_t *resultsize)
+{
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+
+	switch (request) {
+	case HAL_DIAG_EEPROM:
+		*result = &ee->ee_base;
+		*resultsize = sizeof(ee->ee_base);
+		return AH_TRUE;
+	}
+	return AH_FALSE;
+}
+
+/* Do structure specific swaps if Eeprom format is non native to host */
+static void
+eepromSwap(struct ar5416eeprom_4k *ee)
+{
+	uint32_t integer, i;
+	uint16_t word;
+	MODAL_EEP4K_HEADER *pModal;
+
+	/* convert Base Eep header */
+	word = __bswap16(ee->baseEepHeader.length);
+	ee->baseEepHeader.length = word;
+
+	word = __bswap16(ee->baseEepHeader.checksum);
+	ee->baseEepHeader.checksum = word;
+
+	word = __bswap16(ee->baseEepHeader.version);
+	ee->baseEepHeader.version = word;
+
+	word = __bswap16(ee->baseEepHeader.regDmn[0]);
+	ee->baseEepHeader.regDmn[0] = word;
+
+	word = __bswap16(ee->baseEepHeader.regDmn[1]);
+	ee->baseEepHeader.regDmn[1] = word;
+
+	word = __bswap16(ee->baseEepHeader.rfSilent);
+	ee->baseEepHeader.rfSilent = word;
+
+	word = __bswap16(ee->baseEepHeader.blueToothOptions);
+	ee->baseEepHeader.blueToothOptions = word; 
+
+	word = __bswap16(ee->baseEepHeader.deviceCap);
+	ee->baseEepHeader.deviceCap = word;
+
+	/* convert Modal Eep header */
+	pModal = &ee->modalHeader;
+
+	/* XXX linux/ah_osdep.h only defines __bswap32 for BE */
+	integer = __bswap32(pModal->antCtrlCommon);
+	pModal->antCtrlCommon = integer;
+
+	for (i = 0; i < AR5416_4K_MAX_CHAINS; i++) {
+		integer = __bswap32(pModal->antCtrlChain[i]);
+		pModal->antCtrlChain[i] = integer;
+	}
+
+	for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) {
+		word = __bswap16(pModal->spurChans[i].spurChan);
+		pModal->spurChans[i].spurChan = word;
+	}
+}
+
+static uint16_t 
+v4kEepromGetSpurChan(struct ath_hal *ah, int ix, HAL_BOOL is2GHz)
+{ 
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+	
+	HALASSERT(0 <= ix && ix <  AR5416_EEPROM_MODAL_SPURS);
+	HALASSERT(is2GHz);
+	return ee->ee_base.modalHeader.spurChans[ix].spurChan;
+}
+
+/**************************************************************************
+ * fbin2freq
+ *
+ * Get channel value from binary representation held in eeprom
+ * RETURNS: the frequency in MHz
+ */
+static uint16_t
+fbin2freq(uint8_t fbin, HAL_BOOL is2GHz)
+{
+	/*
+	 * Reserved value 0xFF provides an empty definition both as
+	 * an fbin and as a frequency - do not convert
+	 */
+	if (fbin == AR5416_BCHAN_UNUSED)
+		return fbin;
+	return (uint16_t)((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin));
+}
+
+/*
+ * Copy EEPROM Conformance Testing Limits contents 
+ * into the allocated space
+ */
+/* USE CTLS from chain zero */ 
+#define CTL_CHAIN	0 
+
+static void
+v4kEepromReadCTLInfo(struct ath_hal *ah, HAL_EEPROM_v4k *ee)
+{
+	RD_EDGES_POWER *rep = ee->ee_rdEdgesPower;
+	int i, j;
+	
+	HALASSERT(AR5416_NUM_CTLS <= sizeof(ee->ee_rdEdgesPower)/NUM_EDGES);
+
+	for (i = 0; ee->ee_base.ctlIndex[i] != 0 && i < AR5416_4K_NUM_CTLS; i++) {
+		for (j = 0; j < NUM_EDGES; j ++) {
+			/* XXX Confirm this is the right thing to do when an invalid channel is stored */
+			if (ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel == AR5416_BCHAN_UNUSED) {
+				rep[j].rdEdge = 0;
+				rep[j].twice_rdEdgePower = 0;
+				rep[j].flag = 0;
+			} else {
+				rep[j].rdEdge = fbin2freq(
+				    ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel,
+				    (ee->ee_base.ctlIndex[i] & CTL_MODE_M) != CTL_11A);
+				rep[j].twice_rdEdgePower = MS(ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].tPowerFlag, CAL_CTL_EDGES_POWER);
+				rep[j].flag = MS(ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].tPowerFlag, CAL_CTL_EDGES_FLAG) != 0;
+			}
+		}
+		rep += NUM_EDGES;
+	}
+	ee->ee_numCtls = i;
+	HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM,
+	    "%s Numctls = %u\n",__func__,i);
+}
+
+/*
+ * Reclaim any EEPROM-related storage.
+ */
+static void
+v4kEepromDetach(struct ath_hal *ah)
+{
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+
+	ath_hal_free(ee);
+	AH_PRIVATE(ah)->ah_eeprom = AH_NULL;
+}
+
+#define owl_get_eep_ver(_ee)   \
+    (((_ee)->ee_base.baseEepHeader.version >> 12) & 0xF)
+#define owl_get_eep_rev(_ee)   \
+    (((_ee)->ee_base.baseEepHeader.version) & 0xFFF)
+
+HAL_STATUS
+ath_hal_v4kEepromAttach(struct ath_hal *ah)
+{
+#define	NW(a)	(sizeof(a) / sizeof(uint16_t))
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+	uint16_t *eep_data, magic;
+	HAL_BOOL need_swap;
+	u_int w, off, len;
+	uint32_t sum;
+
+	HALASSERT(ee == AH_NULL);
+ 
+	if (!ath_hal_eepromRead(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
+		HALDEBUG(ah, HAL_DEBUG_ANY,
+		    "%s Error reading Eeprom MAGIC\n", __func__);
+		return HAL_EEREAD;
+	}
+	HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n",
+	    __func__, magic);
+	if (magic != AR5416_EEPROM_MAGIC) {
+		HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n");
+		return HAL_EEMAGIC;
+	}
+
+	ee = ath_hal_malloc(sizeof(HAL_EEPROM_v4k));
+	if (ee == AH_NULL) {
+		/* XXX message */
+		return HAL_ENOMEM;
+	}
+
+	eep_data = (uint16_t *)&ee->ee_base;
+	for (w = 0; w < NW(struct ar5416eeprom_4k); w++) {
+		off = owl_eep_start_loc + w;	/* NB: AP71 starts at 0 */
+		if (!ath_hal_eepromRead(ah, off, &eep_data[w])) {
+			HALDEBUG(ah, HAL_DEBUG_ANY,
+			    "%s eeprom read error at offset 0x%x\n",
+			    __func__, off);
+			return HAL_EEREAD;
+		}
+	}
+	/* Convert to eeprom native eeprom endian format */
+	if (isBigEndian()) {
+		for (w = 0; w < NW(struct ar5416eeprom_4k); w++)
+			eep_data[w] = __bswap16(eep_data[w]);
+	}
+
+	/*
+	 * At this point, we're in the native eeprom endian format
+	 * Now, determine the eeprom endian by looking at byte 26??
+	 */
+	need_swap = ((ee->ee_base.baseEepHeader.eepMisc & AR5416_EEPMISC_BIG_ENDIAN) != 0) ^ isBigEndian();
+	if (need_swap) {
+		HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM,
+		    "Byte swap EEPROM contents.\n");
+		len = __bswap16(ee->ee_base.baseEepHeader.length);
+	} else {
+		len = ee->ee_base.baseEepHeader.length;
+	}
+	len = AH_MIN(len, sizeof(struct ar5416eeprom_4k)) / sizeof(uint16_t);
+	
+	/* Apply the checksum, done in native eeprom format */
+	/* XXX - Need to check to make sure checksum calculation is done
+	 * in the correct endian format.  Right now, it seems it would
+	 * cast the raw data to host format and do the calculation, which may
+	 * not be correct as the calculation may need to be done in the native
+	 * eeprom format 
+	 */
+	sum = 0;
+	for (w = 0; w < len; w++) {
+		sum ^= eep_data[w];
+	}
+	/* Check CRC - Attach should fail on a bad checksum */
+	if (sum != 0xffff) {
+		HALDEBUG(ah, HAL_DEBUG_ANY,
+		    "Bad EEPROM checksum 0x%x (Len=%u)\n", sum, len);
+		return HAL_EEBADSUM;
+	}
+
+	if (need_swap)
+		eepromSwap(&ee->ee_base);	/* byte swap multi-byte data */
+
+	/* swap words 0+2 so version is at the front */
+	magic = eep_data[0];
+	eep_data[0] = eep_data[2];
+	eep_data[2] = magic;
+
+	HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM,
+	    "%s Eeprom Version %u.%u\n", __func__,
+	    owl_get_eep_ver(ee), owl_get_eep_rev(ee));
+
+	/* NB: must be after all byte swapping */
+	if (owl_get_eep_ver(ee) != AR5416_EEP_VER) {
+		HALDEBUG(ah, HAL_DEBUG_ANY,
+		    "Bad EEPROM version 0x%x\n", owl_get_eep_ver(ee));
+		return HAL_EEBADSUM;
+	}
+
+	v4kEepromReadCTLInfo(ah, ee);		/* Get CTLs */
+
+	AH_PRIVATE(ah)->ah_eeprom = ee;
+	AH_PRIVATE(ah)->ah_eeversion = ee->ee_base.baseEepHeader.version;
+	AH_PRIVATE(ah)->ah_eepromDetach = v4kEepromDetach;
+	AH_PRIVATE(ah)->ah_eepromGet = v4kEepromGet;
+	AH_PRIVATE(ah)->ah_eepromSet = v4kEepromSet;
+	AH_PRIVATE(ah)->ah_getSpurChan = v4kEepromGetSpurChan;
+	AH_PRIVATE(ah)->ah_eepromDiag = v4kEepromDiag;
+	return HAL_OK;
+#undef NW
+}

Copied and modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h (from r197948, head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h)
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h	Sat Oct 10 22:29:34 2009	(r197948, copy source)
+++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h	Tue Mar  2 13:13:12 2010	(r204580)
@@ -39,8 +39,6 @@
 #define AR5416_4K_NUM_CTLS              12
 #define AR5416_4K_NUM_BAND_EDGES       	4
 #define AR5416_4K_NUM_PD_GAINS         	2
-#define AR5416_4K_PD_GAINS_IN_MASK     	4
-#define AR5416_4K_PD_GAIN_ICEPTS        5
 #define AR5416_4K_MAX_CHAINS           	1
 
 /*
@@ -127,8 +125,8 @@ typedef struct CalCtlData4k {
 } __packed CAL_CTL_DATA_4K;
 
 typedef struct calDataPerFreq4k {
-	uint8_t		pwrPdg[AR5416_4K_NUM_PD_GAINS][AR5416_4K_PD_GAIN_ICEPTS];
-	uint8_t		vpdPdg[AR5416_4K_NUM_PD_GAINS][AR5416_4K_PD_GAIN_ICEPTS];
+	uint8_t		pwrPdg[AR5416_4K_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
+	uint8_t		vpdPdg[AR5416_4K_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
 } __packed CAL_DATA_PER_FREQ_4K;
 
 struct ar5416eeprom_4k {

Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.h
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.h	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.h	Tue Mar  2 13:13:12 2010	(r204580)
@@ -327,6 +327,9 @@ struct ath_hal_5212 {
 	uint16_t	*ah_pcdacTable;
 	u_int		ah_pcdacTableSize;
 	uint16_t	ah_ratesArray[16];
+
+	uint8_t		ah_txTrigLev;		/* current Tx trigger level */
+	uint8_t		ah_maxTxTrigLev;	/* max tx trigger level */
 };
 #define	AH5212(_ah)	((struct ath_hal_5212 *)(_ah))
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -248,6 +248,9 @@ ar5212InitState(struct ath_hal_5212 *ahp
 	ahp->ah_acktimeout = (u_int) -1;
 	ahp->ah_ctstimeout = (u_int) -1;
 	ahp->ah_sifstime = (u_int) -1;
+	ahp->ah_txTrigLev = INIT_TX_FIFO_THRESHOLD,
+	ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD,
+
 	OS_MEMCPY(&ahp->ah_bssidmask, defbssidmask, IEEE80211_ADDR_LEN);
 #undef N
 }

Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_power.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_power.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_power.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5212_power.c,v 1.4 2008/11/10 04:08:03 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -38,8 +38,8 @@ static HAL_BOOL
 ar5212SetPowerModeAwake(struct ath_hal *ah, int setChip)
 {
 #define	AR_SCR_MASK \
-    (AR_SCR_SLDUR|AR_SCR_SLE|AR_SCR_SLE|AR_SCR_SLDTP|AR_SCR_SLDWP|\
-     AR_SCR_SLEPOL|AR_SCR_MIBIE)
+    (AR_SCR_SLDUR|AR_SCR_SLE|AR_SCR_SLDTP|AR_SCR_SLDWP|\
+     AR_SCR_SLEPOL|AR_SCR_MIBIE|AR_SCR_UNKNOWN)
 #define	POWER_UP_TIME	2000
 	uint32_t scr, val;
 	int i;

Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -48,16 +48,19 @@ ar5212UpdateTxTrigLevel(struct ath_hal *
 	uint32_t txcfg, curLevel, newLevel;
 	HAL_INT omask;
 
+	if (ahp->ah_txTrigLev >= ahp->ah_maxTxTrigLev)
+		return AH_FALSE;
+
 	/*
 	 * Disable interrupts while futzing with the fifo level.
 	 */
-	omask = ar5212SetInterrupts(ah, ahp->ah_maskReg &~ HAL_INT_GLOBAL);
+	omask = ah->ah_setInterrupts(ah, ahp->ah_maskReg &~ HAL_INT_GLOBAL);
 
 	txcfg = OS_REG_READ(ah, AR_TXCFG);
 	curLevel = MS(txcfg, AR_FTRIG);
 	newLevel = curLevel;
 	if (bIncTrigLevel) {		/* increase the trigger level */
-		if (curLevel < MAX_TX_FIFO_THRESHOLD)
+		if (curLevel < ahp->ah_maxTxTrigLev)
 			newLevel++;
 	} else if (curLevel > MIN_TX_FIFO_THRESHOLD)
 		newLevel--;
@@ -66,8 +69,10 @@ ar5212UpdateTxTrigLevel(struct ath_hal *
 		OS_REG_WRITE(ah, AR_TXCFG,
 			(txcfg &~ AR_FTRIG) | SM(newLevel, AR_FTRIG));
 
+	ahp->ah_txTrigLev = newLevel;
+
 	/* re-enable chip interrupts */
-	ar5212SetInterrupts(ah, omask);
+	ah->ah_setInterrupts(ah, omask);
 
 	return (newLevel != curLevel);
 }

Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212reg.h
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212reg.h	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212reg.h	Tue Mar  2 13:13:12 2010	(r204580)
@@ -700,6 +700,7 @@
 #define	AR_SCR_SLDWP		0x00080000 /* sleep duration write policy */
 #define	AR_SCR_SLEPOL		0x00100000 /* sleep policy mode */
 #define	AR_SCR_MIBIE		0x00200000 /* sleep perf cntrs MIB intr ena */
+#define	AR_SCR_UNKNOWN		0x00400000
 
 #define	AR_INTPEND_TRUE		0x00000001 /* interrupt pending */
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416.h
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416.h	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416.h	Tue Mar  2 13:13:12 2010	(r204580)
@@ -21,6 +21,7 @@
 
 #include "ar5212/ar5212.h"
 #include "ar5416_cal.h"
+#include "ah_eeprom_v14.h"	/* for CAL_TARGET_POWER_* */
 
 #define	AR5416_MAGIC	0x20065416
 
@@ -44,6 +45,7 @@ typedef struct {
 #define	AR5416_CCA_MAX_GOOD_VALUE	-85
 #define	AR5416_CCA_MAX_HIGH_VALUE	-62
 #define	AR5416_CCA_MIN_BAD_VALUE	-140
+#define	AR9285_CCA_MAX_GOOD_VALUE	-118
 
 #define AR5416_SPUR_RSSI_THRESH		40
 
@@ -178,12 +180,27 @@ extern	HAL_RFGAIN ar5416GetRfgain(struct
 extern	HAL_BOOL ar5416Disable(struct ath_hal *ah);
 extern	HAL_BOOL ar5416ChipReset(struct ath_hal *ah,
 		const struct ieee80211_channel *);
+extern	HAL_BOOL ar5416SetBoardValues(struct ath_hal *,
+		const struct ieee80211_channel *);
 extern	HAL_BOOL ar5416SetResetReg(struct ath_hal *, uint32_t type);
 extern	HAL_BOOL ar5416SetTxPowerLimit(struct ath_hal *ah, uint32_t limit);
+extern	HAL_BOOL ar5416SetTransmitPower(struct ath_hal *,
+    		const struct ieee80211_channel *, uint16_t *);
 extern	HAL_BOOL ar5416GetChipPowerLimits(struct ath_hal *ah,
 		struct ieee80211_channel *chan);
 extern	void ar5416GetChannelCenters(struct ath_hal *,
 		const struct ieee80211_channel *chan, CHAN_CENTERS *centers);
+extern	void ar5416GetTargetPowers(struct ath_hal *ah, 
+		const struct ieee80211_channel *chan,
+		CAL_TARGET_POWER_HT *powInfo,
+		uint16_t numChannels, CAL_TARGET_POWER_HT *pNewPower,
+		uint16_t numRates, HAL_BOOL isHt40Target);
+extern	void ar5416GetTargetPowersLeg(struct ath_hal *ah, 
+		const struct ieee80211_channel *chan,
+		CAL_TARGET_POWER_LEG *powInfo,
+		uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower,
+		uint16_t numRates, HAL_BOOL isExtTarget);
+
 
 extern	HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q);
 extern	HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds,

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -183,7 +183,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
 
 		if (level >= params->maxNoiseImmunityLevel) {
 			HALDEBUG(ah, HAL_DEBUG_ANY,
-			    "%s: level out of range (%u > %u)\n",
+			    "%s: immunity level out of range (%u > %u)\n",
 			    __func__, level, params->maxNoiseImmunityLevel);
 			return AH_FALSE;
 		}
@@ -267,7 +267,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
 
 		if (level >= params->maxFirstepLevel) {
 			HALDEBUG(ah, HAL_DEBUG_ANY,
-			    "%s: level out of range (%u > %u)\n",
+			    "%s: firstep level out of range (%u > %u)\n",
 			    __func__, level, params->maxFirstepLevel);
 			return AH_FALSE;
 		}
@@ -285,7 +285,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
 
 		if (level >= params->maxSpurImmunityLevel) {
 			HALDEBUG(ah, HAL_DEBUG_ANY,
-			    "%s: level out of range (%u > %u)\n",
+			    "%s: spur immunity level out of range (%u > %u)\n",
 			    __func__, level, params->maxSpurImmunityLevel);
 			return AH_FALSE;
 		}

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -89,6 +89,8 @@ ar5416InitState(struct ath_hal_5416 *ahp
 	ah->ah_perCalibrationN		= ar5416PerCalibrationN,
 	ah->ah_resetCalValid		= ar5416ResetCalValid,
 	ah->ah_setTxPowerLimit		= ar5416SetTxPowerLimit;
+	ah->ah_setTxPower		= ar5416SetTransmitPower;
+	ah->ah_setBoardValues		= ar5416SetBoardValues;
 
 	/* Transmit functions */
 	ah->ah_stopTxDma		= ar5416StopTxDma;

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_beacon.c,v 1.8 2008/11/11 01:03:12 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_cal_adcdc.c,v 1.2 2008/11/11 17:43:23 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_cal_adcgain.c,v 1.2 2008/11/11 17:43:23 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_cal_iq.c,v 1.2 2008/11/11 17:43:23 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_eeprom.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_eeprom.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_eeprom.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_eeprom.c,v 1.6 2008/11/10 04:08:04 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -146,7 +146,9 @@ ar5416GpioGet(struct ath_hal *ah, uint32
 	 * Read output value for all gpio's, shift it,
 	 * and verify whether the specific bit is set.
 	 */
-	if (AR_SREV_MERLIN_10_OR_LATER(ah))
+	if (AR_SREV_KITE_10_OR_LATER(ah))
+		bits = MS(OS_REG_READ(ah, AR_GPIO_IN_OUT), AR9285_GPIO_IN_VAL);
+	else if (AR_SREV_MERLIN_10_OR_LATER(ah))
 		bits = MS(OS_REG_READ(ah, AR_GPIO_IN_OUT), AR928X_GPIO_IN_VAL);
 	else
 		bits = MS(OS_REG_READ(ah, AR_GPIO_IN_OUT), AR_GPIO_IN_VAL);

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_keycache.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_keycache.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_keycache.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_keycache.c,v 1.3 2008/11/10 04:08:04 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_misc.c,v 1.12 2008/11/27 22:30:07 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -30,7 +30,7 @@
 #include "ar5416/ar5416phy.h"
 
 /*
- * Return the wireless modes (a,b,g,t) supported by hardware.
+ * Return the wireless modes (a,b,g,n,t) supported by hardware.
  *
  * This value is what is actually supported by the hardware
  * and is unaffected by regulatory/country code settings.

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_phy.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_phy.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_phy.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_phy.c,v 1.4 2008/11/27 22:30:08 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_power.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_power.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_power.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_power.c,v 1.6 2008/11/11 00:11:30 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_recv.c,v 1.7 2008/11/11 20:46:06 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Tue Mar  2 12:59:42 2010	(r204579)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Tue Mar  2 13:13:12 2010	(r204580)
@@ -45,9 +45,6 @@ static void ar5416InitIMR(struct ath_hal
 static void ar5416InitQoS(struct ath_hal *ah);
 static void ar5416InitUserSettings(struct ath_hal *ah);
 
-static HAL_BOOL ar5416SetTransmitPower(struct ath_hal *ah, 
-	const struct ieee80211_channel *chan, uint16_t *rfXpdGain);
-
 #if 0
 static HAL_BOOL	ar5416ChannelChange(struct ath_hal *, const struct ieee80211_channel *);
 #endif
@@ -56,7 +53,6 @@ static void ar5416SetDeltaSlope(struct a
 static HAL_BOOL ar5416SetResetPowerOn(struct ath_hal *ah);
 static HAL_BOOL ar5416SetReset(struct ath_hal *ah, int type);
 static void ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan);
-static HAL_BOOL ar5416SetBoardValues(struct ath_hal *, const struct ieee80211_channel *);
 static HAL_BOOL ar5416SetPowerPerRateTable(struct ath_hal *ah,
 	struct ar5416eeprom *pEepData, 
 	const struct ieee80211_channel *chan, int16_t *ratesArray,
@@ -69,14 +65,6 @@ static HAL_BOOL ar5416SetPowerCalTable(s
 	int16_t *pTxPowerIndexOffset);
 static uint16_t ar5416GetMaxEdgePower(uint16_t freq,
 	CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz);
-static void ar5416GetTargetPowers(struct ath_hal *ah, 
-	const struct ieee80211_channel *chan, CAL_TARGET_POWER_HT *powInfo,
-	uint16_t numChannels, CAL_TARGET_POWER_HT *pNewPower,
-	uint16_t numRates, HAL_BOOL isHt40Target);
-static void ar5416GetTargetPowersLeg(struct ath_hal *ah, 
-	const struct ieee80211_channel *chan, CAL_TARGET_POWER_LEG *powInfo,
-	uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower,
-	uint16_t numRates, HAL_BOOL isExtTarget);
 
 static int16_t interpolate(uint16_t target, uint16_t srcLeft,
 	uint16_t srcRight, int16_t targetLeft, int16_t targetRight);
@@ -224,7 +212,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 	OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask);
 
 	/* Setup the transmit power values. */
-	if (!ar5416SetTransmitPower(ah, chan, rfXpdGain)) {
+	if (!ah->ah_setTxPower(ah, chan, rfXpdGain)) {
 		HALDEBUG(ah, HAL_DEBUG_ANY,
 		    "%s: error init'ing transmit power\n", __func__);
 		FAIL(HAL_EIO);
@@ -245,7 +233,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 	AH5416(ah)->ah_spurMitigate(ah, chan);
 
 	/* Setup board specific options for EEPROM version 3 */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  2 16:25:07 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 912581065670;
	Tue,  2 Mar 2010 16:25:07 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 801978FC13;
	Tue,  2 Mar 2010 16:25:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o22GP7Vf079758;
	Tue, 2 Mar 2010 16:25:07 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o22GP73c079756;
	Tue, 2 Mar 2010 16:25:07 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201003021625.o22GP73c079756@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Tue, 2 Mar 2010 16:25:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204583 - stable/8/etc/rc.d
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 02 Mar 2010 16:25:07 -0000

Author: ume
Date: Tue Mar  2 16:25:07 2010
New Revision: 204583
URL: http://svn.freebsd.org/changeset/base/204583

Log:
  MFC 204427: Add the shutdown KEYWORD.

Modified:
  stable/8/etc/rc.d/rtsold
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/rc.d/rtsold
==============================================================================
--- stable/8/etc/rc.d/rtsold	Tue Mar  2 16:24:16 2010	(r204582)
+++ stable/8/etc/rc.d/rtsold	Tue Mar  2 16:25:07 2010	(r204583)
@@ -6,7 +6,7 @@
 # PROVIDE: rtsold
 # REQUIRE: netif
 # BEFORE: NETWORKING
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  2 16:29:08 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 88547106564A;
	Tue,  2 Mar 2010 16:29:08 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 762C38FC29;
	Tue,  2 Mar 2010 16:29:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o22GT8GK080677;
	Tue, 2 Mar 2010 16:29:08 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o22GT8eH080671;
	Tue, 2 Mar 2010 16:29:08 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201003021629.o22GT8eH080671@svn.freebsd.org>
From: Alan Cox 
Date: Tue, 2 Mar 2010 16:29:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204584 - in stable/8/sys: amd64/amd64 i386/i386 kern
	sys
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 02 Mar 2010 16:29:08 -0000

Author: alc
Date: Tue Mar  2 16:29:08 2010
New Revision: 204584
URL: http://svn.freebsd.org/changeset/base/204584

Log:
  MFC r204420
    When running as a guest operating system, the FreeBSD kernel must assume
    that the virtual machine monitor has enabled machine check exceptions.
    Unfortunately, on AMD Family 10h processors the machine check hardware
    has a bug (Erratum 383) that can result in a false machine check exception
    when a superpage promotion occurs.  Thus, I am disabling superpage
    promotion when the FreeBSD kernel is running as a guest operating system
    on an AMD Family 10h processor.

Modified:
  stable/8/sys/amd64/amd64/pmap.c
  stable/8/sys/i386/i386/pmap.c
  stable/8/sys/kern/subr_param.c
  stable/8/sys/sys/systm.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/8/sys/amd64/amd64/pmap.c	Tue Mar  2 16:25:07 2010	(r204583)
+++ stable/8/sys/amd64/amd64/pmap.c	Tue Mar  2 16:29:08 2010	(r204584)
@@ -654,6 +654,15 @@ pmap_init(void)
 	pv_entry_high_water = 9 * (pv_entry_max / 10);
 
 	/*
+	 * Disable large page mappings by default if the kernel is running in
+	 * a virtual machine on an AMD Family 10h processor.  This is a work-
+	 * around for Erratum 383.
+	 */
+	if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD &&
+	    CPUID_TO_FAMILY(cpu_id) == 0x10)
+		pg_ps_enabled = 0;
+
+	/*
 	 * Are large page mappings enabled?
 	 */
 	TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled);

Modified: stable/8/sys/i386/i386/pmap.c
==============================================================================
--- stable/8/sys/i386/i386/pmap.c	Tue Mar  2 16:25:07 2010	(r204583)
+++ stable/8/sys/i386/i386/pmap.c	Tue Mar  2 16:29:08 2010	(r204584)
@@ -678,6 +678,15 @@ pmap_init(void)
 	pv_entry_high_water = 9 * (pv_entry_max / 10);
 
 	/*
+	 * Disable large page mappings by default if the kernel is running in
+	 * a virtual machine on an AMD Family 10h processor.  This is a work-
+	 * around for Erratum 383.
+	 */
+	if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD &&
+	    CPUID_TO_FAMILY(cpu_id) == 0x10)
+		pg_ps_enabled = 0;
+
+	/*
 	 * Are large page mappings enabled?
 	 */
 	TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled);

Modified: stable/8/sys/kern/subr_param.c
==============================================================================
--- stable/8/sys/kern/subr_param.c	Tue Mar  2 16:25:07 2010	(r204583)
+++ stable/8/sys/kern/subr_param.c	Tue Mar  2 16:29:08 2010	(r204584)
@@ -74,10 +74,6 @@ __FBSDID("$FreeBSD$");
 #define	MAXFILES (maxproc * 2)
 #endif
 
-/* Values of enum VM_GUEST members are used as indices in 
- * vm_guest_sysctl_names */
-enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN };
-
 static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS);
 
 int	hz;
@@ -137,6 +133,10 @@ SYSCTL_PROC(_kern, OID_AUTO, vm_guest, C
  */
 struct	buf *swbuf;
 
+/*
+ * The elements of this array are ordered based upon the values of the
+ * corresponding enum VM_GUEST members.
+ */
 static const char *const vm_guest_sysctl_names[] = {
 	"none",
 	"generic",

Modified: stable/8/sys/sys/systm.h
==============================================================================
--- stable/8/sys/sys/systm.h	Tue Mar  2 16:25:07 2010	(r204583)
+++ stable/8/sys/sys/systm.h	Tue Mar  2 16:29:08 2010	(r204584)
@@ -65,6 +65,9 @@ extern int bootverbose;		/* nonzero to p
 
 extern int maxusers;		/* system tune hint */
 extern int ngroups_max;		/* max # of supplemental groups */
+extern int vm_guest;		/* Running as virtual machine guest? */
+
+enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN };
 
 #ifdef	INVARIANTS		/* The option is always available */
 #define	KASSERT(exp,msg) do {						\

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  2 18:38:01 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B27C106564A;
	Tue,  2 Mar 2010 18:38:01 +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 098918FC13;
	Tue,  2 Mar 2010 18:38:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o22Ic0bk009926;
	Tue, 2 Mar 2010 18:38:00 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o22Ic0OP009924;
	Tue, 2 Mar 2010 18:38:00 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201003021838.o22Ic0OP009924@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 2 Mar 2010 18:38:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204592 - stable/8/gnu/usr.bin/gdb/kgdb
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 02 Mar 2010 18:38:01 -0000

Author: avg
Date: Tue Mar  2 18:38:00 2010
New Revision: 204592
URL: http://svn.freebsd.org/changeset/base/204592

Log:
  MFC r203823: kgdb: initialize n_type field of nlist entry for kvm_nlist

Modified:
  stable/8/gnu/usr.bin/gdb/kgdb/kthr.c
Directory Properties:
  stable/8/gnu/usr.bin/gdb/kgdb/   (props changed)

Modified: stable/8/gnu/usr.bin/gdb/kgdb/kthr.c
==============================================================================
--- stable/8/gnu/usr.bin/gdb/kgdb/kthr.c	Tue Mar  2 17:40:48 2010	(r204591)
+++ stable/8/gnu/usr.bin/gdb/kgdb/kthr.c	Tue Mar  2 18:38:00 2010	(r204592)
@@ -58,6 +58,7 @@ kgdb_lookup(const char *sym)
 {
 	struct nlist nl[2];
 
+	nl[0].n_type = N_UNDF;
 	nl[0].n_name = (char *)(uintptr_t)sym;
 	nl[1].n_name = NULL;
 	if (kvm_nlist(kvm, nl) != 0)

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar  3 16:06:43 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ACF7D106564A;
	Wed,  3 Mar 2010 16:06:43 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9BB4A8FC12;
	Wed,  3 Mar 2010 16:06:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o23G6hdb097762;
	Wed, 3 Mar 2010 16:06:43 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o23G6hHs097760;
	Wed, 3 Mar 2010 16:06:43 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201003031606.o23G6hHs097760@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 3 Mar 2010 16:06:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204637 - stable/8/bin/sh
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 03 Mar 2010 16:06:43 -0000

Author: jh
Date: Wed Mar  3 16:06:43 2010
New Revision: 204637
URL: http://svn.freebsd.org/changeset/base/204637

Log:
  MFC r204276:
  
  Fix expansion of \W in prompt strings when the working directory is "/".
  The prompt string was truncated after \W when the working directory was "/".
  
  PR:		bin/89410

Modified:
  stable/8/bin/sh/parser.c
Directory Properties:
  stable/8/bin/sh/   (props changed)

Modified: stable/8/bin/sh/parser.c
==============================================================================
--- stable/8/bin/sh/parser.c	Wed Mar  3 15:43:26 2010	(r204636)
+++ stable/8/bin/sh/parser.c	Wed Mar  3 16:06:43 2010	(r204637)
@@ -1631,7 +1631,7 @@ getprompt(void *unused __unused)
 			case 'w':
 				ps[i] = '\0';
 				getcwd(&ps[i], PROMPTLEN - i);
-				if (*fmt == 'W') {
+				if (*fmt == 'W' && ps[i + 1] != '\0') {
 					/* Final path component only. */
 					trim = 1;
 					for (j = i; ps[j] != '\0'; j++)

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar  3 19:11:39 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F15FE106564A;
	Wed,  3 Mar 2010 19:11:39 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DFBEA8FC0C;
	Wed,  3 Mar 2010 19:11:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o23JBdcQ039584;
	Wed, 3 Mar 2010 19:11:39 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o23JBdkE039582;
	Wed, 3 Mar 2010 19:11:39 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201003031911.o23JBdkE039582@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 3 Mar 2010 19:11:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204651 - stable/8/sys/dev/ata/chipsets
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 03 Mar 2010 19:11:40 -0000

Author: mav
Date: Wed Mar  3 19:11:39 2010
New Revision: 204651
URL: http://svn.freebsd.org/changeset/base/204651

Log:
  MFC r204210, r204216:
  Add Intel PCH SATA controller IDs.

Modified:
  stable/8/sys/dev/ata/chipsets/ata-intel.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-intel.c	Wed Mar  3 18:49:15 2010	(r204650)
+++ stable/8/sys/dev/ata/chipsets/ata-intel.c	Wed Mar  3 19:11:39 2010	(r204651)
@@ -140,6 +140,22 @@ ata_intel_probe(device_t dev)
      { ATA_I82801JI_AH,  0, INTEL_AHCI, 0, ATA_SA300, "ICH10" },
      { ATA_I82801JI_R1,  0, INTEL_AHCI, 0, ATA_SA300, "ICH10" },
      { ATA_I82801JI_S2,  0, INTEL_AHCI, 0, ATA_SA300, "ICH10" },
+     { 0x3a208086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a218086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a228086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a238086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a248086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a258086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a268086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a278086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a288086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a298086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a2a8086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a2b8086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a2c8086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a2d8086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a2e8086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
+     { 0x3a2f8086,       0, INTEL_AHCI, 0, ATA_SA300, "PCH" },
      { ATA_I31244,       0,          0, 2, ATA_SA150, "31244" },
      { ATA_ISCH,         0,          0, 1, ATA_UDMA5, "SCH" },
      { 0, 0, 0, 0, 0, 0}};

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar  3 19:12:54 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25252106566C;
	Wed,  3 Mar 2010 19:12:54 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 144388FC13;
	Wed,  3 Mar 2010 19:12:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o23JCrG4039898;
	Wed, 3 Mar 2010 19:12:53 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o23JCrvG039896;
	Wed, 3 Mar 2010 19:12:53 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201003031912.o23JCrvG039896@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 3 Mar 2010 19:12:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204652 - stable/8/sys/dev/ata
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 03 Mar 2010 19:12:54 -0000

Author: mav
Date: Wed Mar  3 19:12:53 2010
New Revision: 204652
URL: http://svn.freebsd.org/changeset/base/204652

Log:
  MFC r204250:
  Fix recursive lock attempt on hot-plug event in non-ATA_CAM mode.

Modified:
  stable/8/sys/dev/ata/ata-all.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/dev/ata/ata-all.c
==============================================================================
--- stable/8/sys/dev/ata/ata-all.c	Wed Mar  3 19:11:39 2010	(r204651)
+++ stable/8/sys/dev/ata/ata-all.c	Wed Mar  3 19:12:53 2010	(r204652)
@@ -289,15 +289,13 @@ static void
 ata_conn_event(void *context, int dummy)
 {
 	device_t dev = (device_t)context;
-	struct ata_channel *ch = device_get_softc(dev);
 #ifdef ATA_CAM
+	struct ata_channel *ch = device_get_softc(dev);
 	union ccb *ccb;
-#endif
 
 	mtx_lock(&ch->state_mtx);
 	ata_reinit(dev);
 	mtx_unlock(&ch->state_mtx);
-#ifdef ATA_CAM
 	if ((ccb = xpt_alloc_ccb()) == NULL)
 		return;
 	if (xpt_create_path(&ccb->ccb_h.path, NULL,
@@ -307,6 +305,8 @@ ata_conn_event(void *context, int dummy)
 		return;
 	}
 	xpt_rescan(ccb);
+#else
+	ata_reinit(dev);
 #endif
 }
 

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar  3 19:14:05 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 704C4106566B;
	Wed,  3 Mar 2010 19:14:05 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5EC638FC1A;
	Wed,  3 Mar 2010 19:14:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o23JE5N0040205;
	Wed, 3 Mar 2010 19:14:05 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o23JE5Ut040202;
	Wed, 3 Mar 2010 19:14:05 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201003031914.o23JE5Ut040202@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 3 Mar 2010 19:14:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204653 - in stable/8/sys/dev/ata: . chipsets
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 03 Mar 2010 19:14:05 -0000

Author: mav
Date: Wed Mar  3 19:14:05 2010
New Revision: 204653
URL: http://svn.freebsd.org/changeset/base/204653

Log:
  MFC r204509:
  - Add ALI M5228 PATA ID.
  - Add missed DMA initialization for ALI SATA chips.

Modified:
  stable/8/sys/dev/ata/ata-pci.h
  stable/8/sys/dev/ata/chipsets/ata-acerlabs.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/dev/ata/ata-pci.h
==============================================================================
--- stable/8/sys/dev/ata/ata-pci.h	Wed Mar  3 19:12:53 2010	(r204652)
+++ stable/8/sys/dev/ata/ata-pci.h	Wed Mar  3 19:14:05 2010	(r204653)
@@ -84,6 +84,7 @@ struct ata_pci_controller {
 
 #define ATA_ACER_LABS_ID        0x10b9
 #define ATA_ALI_1533            0x153310b9
+#define ATA_ALI_5228            0x522810b9
 #define ATA_ALI_5229            0x522910b9
 #define ATA_ALI_5281            0x528110b9
 #define ATA_ALI_5287            0x528710b9

Modified: stable/8/sys/dev/ata/chipsets/ata-acerlabs.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-acerlabs.c	Wed Mar  3 19:12:53 2010	(r204652)
+++ stable/8/sys/dev/ata/chipsets/ata-acerlabs.c	Wed Mar  3 19:14:05 2010	(r204653)
@@ -79,6 +79,7 @@ ata_ali_probe(device_t dev)
      { ATA_ALI_5288, 0x00, 4, ALI_SATA, ATA_SA300, "M5288" },
      { ATA_ALI_5287, 0x00, 4, ALI_SATA, ATA_SA150, "M5287" },
      { ATA_ALI_5281, 0x00, 2, ALI_SATA, ATA_SA150, "M5281" },
+     { ATA_ALI_5228, 0xc5, 0, ALI_NEW,  ATA_UDMA6, "M5228" },
      { ATA_ALI_5229, 0xc5, 0, ALI_NEW,  ATA_UDMA6, "M5229" },
      { ATA_ALI_5229, 0xc4, 0, ALI_NEW,  ATA_UDMA5, "M5229" },
      { ATA_ALI_5229, 0xc2, 0, ALI_NEW,  ATA_UDMA4, "M5229" },
@@ -208,7 +209,7 @@ ata_ali_sata_ch_attach(device_t dev)
 	    io = res->bars[0];
 	    ctlio = res->bars[1];
     }
-		
+    ata_pci_dmainit(dev);
     for (i = ATA_DATA; i <= ATA_COMMAND; i ++) {
 	ch->r_io[i].res = io;
 	ch->r_io[i].offset = i + (unit10 ? 8 : 0);

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar  3 20:06:51 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55C27106566B;
	Wed,  3 Mar 2010 20:06:51 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A5598FC20;
	Wed,  3 Mar 2010 20:06:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o23K6oLY052234;
	Wed, 3 Mar 2010 20:06:50 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o23K6of8052232;
	Wed, 3 Mar 2010 20:06:50 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003032006.o23K6of8052232@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 3 Mar 2010 20:06:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204658 - stable/8/sys/modules/ath
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 03 Mar 2010 20:06:51 -0000

Author: rpaulo
Date: Wed Mar  3 20:06:50 2010
New Revision: 204658
URL: http://svn.freebsd.org/changeset/base/204658

Log:
  MFC 204656:
  	Add missing ar9285_reset.c file.

Modified:
  stable/8/sys/modules/ath/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/modules/ath/Makefile
==============================================================================
--- stable/8/sys/modules/ath/Makefile	Wed Mar  3 20:06:09 2010	(r204657)
+++ stable/8/sys/modules/ath/Makefile	Wed Mar  3 20:06:50 2010	(r204658)
@@ -91,7 +91,7 @@ SRCS+=	ah_eeprom_v14.c \
 SRCS+=	ar9160_attach.c
 # RF backend for 5416 and 9160
 SRCS+=	ar2133.c
-SRCS+=	ar9285.c ar9285_attach.c
+SRCS+=	ar9285.c ar9285_reset.c ar9285_attach.c
 
 # NB: rate control is bound to the driver by symbol names so only pick one
 .if ${ATH_RATE} == "sample"

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar  3 20:08:12 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E4A5106566C;
	Wed,  3 Mar 2010 20:08:12 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C9D78FC0A;
	Wed,  3 Mar 2010 20:08:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o23K8CBu052581;
	Wed, 3 Mar 2010 20:08:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o23K8CUf052579;
	Wed, 3 Mar 2010 20:08:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003032008.o23K8CUf052579@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 3 Mar 2010 20:08:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204659 - stable/8/sys/modules/ath
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 03 Mar 2010 20:08:12 -0000

Author: rpaulo
Date: Wed Mar  3 20:08:12 2010
New Revision: 204659
URL: http://svn.freebsd.org/changeset/base/204659

Log:
  Add ar9280.c and ar9280_attach.c.

Modified:
  stable/8/sys/modules/ath/Makefile

Modified: stable/8/sys/modules/ath/Makefile
==============================================================================
--- stable/8/sys/modules/ath/Makefile	Wed Mar  3 20:06:50 2010	(r204658)
+++ stable/8/sys/modules/ath/Makefile	Wed Mar  3 20:08:12 2010	(r204659)
@@ -91,6 +91,7 @@ SRCS+=	ah_eeprom_v14.c \
 SRCS+=	ar9160_attach.c
 # RF backend for 5416 and 9160
 SRCS+=	ar2133.c
+SRCS+=	ar9280.c ar9280_attach.c
 SRCS+=	ar9285.c ar9285_reset.c ar9285_attach.c
 
 # NB: rate control is bound to the driver by symbol names so only pick one

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar  3 20:28:35 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D726D106566B;
	Wed,  3 Mar 2010 20:28:35 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C5EEE8FC17;
	Wed,  3 Mar 2010 20:28:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o23KSZCf057092;
	Wed, 3 Mar 2010 20:28:35 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o23KSZDj057090;
	Wed, 3 Mar 2010 20:28:35 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003032028.o23KSZDj057090@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 3 Mar 2010 20:28:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204660 - stable/8/sys/modules/ath
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 03 Mar 2010 20:28:36 -0000

Author: rpaulo
Date: Wed Mar  3 20:28:35 2010
New Revision: 204660
URL: http://svn.freebsd.org/changeset/base/204660

Log:
  Add ah_eeprom_v4k.c

Modified:
  stable/8/sys/modules/ath/Makefile

Modified: stable/8/sys/modules/ath/Makefile
==============================================================================
--- stable/8/sys/modules/ath/Makefile	Wed Mar  3 20:08:12 2010	(r204659)
+++ stable/8/sys/modules/ath/Makefile	Wed Mar  3 20:28:35 2010	(r204660)
@@ -83,6 +83,7 @@ SRCS+=	ar5413.c
 #
 .PATH:	${.CURDIR}/../../dev/ath/ath_hal/ar5416
 SRCS+=	ah_eeprom_v14.c \
+	ah_eeprom_v4k.c \
 	ar5416_ani.c ar5416_attach.c ar5416_beacon.c ar5416_cal.c \
 	ar5416_cal_iq.c ar5416_cal_adcgain.c ar5416_cal_adcdc.c \
 	ar5416_eeprom.c ar5416_gpio.c ar5416_interrupts.c ar5416_keycache.c \

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar  3 21:47:25 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD9D31065673;
	Wed,  3 Mar 2010 21:47:25 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BC7CD8FC12;
	Wed,  3 Mar 2010 21:47:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o23LlPVi075161;
	Wed, 3 Mar 2010 21:47:25 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o23LlP4k075159;
	Wed, 3 Mar 2010 21:47:25 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <201003032147.o23LlP4k075159@svn.freebsd.org>
From: Brooks Davis 
Date: Wed, 3 Mar 2010 21:47:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204671 - stable/8/lib/libc/rpc
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 03 Mar 2010 21:47:25 -0000

Author: brooks
Date: Wed Mar  3 21:47:25 2010
New Revision: 204671
URL: http://svn.freebsd.org/changeset/base/204671

Log:
  MFC r201959
  
  Use the correct types to store uids and gids in the credential cache and
  eliminate an inappropriate use of NGROUPS.

Modified:
  stable/8/lib/libc/rpc/svc_auth_des.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/rpc/svc_auth_des.c
==============================================================================
--- stable/8/lib/libc/rpc/svc_auth_des.c	Wed Mar  3 21:46:51 2010	(r204670)
+++ stable/8/lib/libc/rpc/svc_auth_des.c	Wed Mar  3 21:47:25 2010	(r204671)
@@ -449,10 +449,10 @@ cache_spot(key, name, timestamp)
 #define INVALID		-1 	/* grouplen, if cache entry is invalid */
 
 struct bsdcred {
-	short uid;		/* cached uid */
-	short gid;		/* cached gid */
-	short grouplen;	/* length of cached groups */
-	short groups[NGROUPS];	/* cached groups */
+	uid_t uid;		/* cached uid */
+	gid_t gid;		/* cached gid */
+	int grouplen;	/* length of cached groups */
+	gid_t groups[NGRPS];	/* cached groups */
 };
 
 /*

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar  4 07:08:01 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E28B8106566C;
	Thu,  4 Mar 2010 07:08:01 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D166E8FC17;
	Thu,  4 Mar 2010 07:08:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o24781H5000845;
	Thu, 4 Mar 2010 07:08:01 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o247816w000843;
	Thu, 4 Mar 2010 07:08:01 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201003040708.o247816w000843@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 4 Mar 2010 07:08:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204699 - stable/8/bin/kill
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 04 Mar 2010 07:08:02 -0000

Author: kib
Date: Thu Mar  4 07:08:01 2010
New Revision: 204699
URL: http://svn.freebsd.org/changeset/base/204699

Log:
  MFC r204308:
  Do not restrict the allowed signals that can be specified by number
  to the list of signals that has symbolic name. It was impossible to
  send rt signals with kill(1) due to the check.

Modified:
  stable/8/bin/kill/kill.c
Directory Properties:
  stable/8/bin/kill/   (props changed)

Modified: stable/8/bin/kill/kill.c
==============================================================================
--- stable/8/bin/kill/kill.c	Thu Mar  4 07:07:22 2010	(r204698)
+++ stable/8/bin/kill/kill.c	Thu Mar  4 07:08:01 2010	(r204699)
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
 			numsig = strtol(*argv, &ep, 10);
 			if (!**argv || *ep)
 				errx(1, "illegal signal number: %s", *argv);
-			if (numsig < 0 || numsig >= sys_nsig)
+			if (numsig < 0)
 				nosig(*argv);
 		} else
 			nosig(*argv);

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar  4 07:12:44 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5071106566C;
	Thu,  4 Mar 2010 07:12:44 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D39248FC0C;
	Thu,  4 Mar 2010 07:12:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o247Ciqu001953;
	Thu, 4 Mar 2010 07:12:44 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o247Ci53001951;
	Thu, 4 Mar 2010 07:12:44 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201003040712.o247Ci53001951@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 4 Mar 2010 07:12:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204700 - stable/8/lib/libc/gen
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 04 Mar 2010 07:12:45 -0000

Author: kib
Date: Thu Mar  4 07:12:44 2010
New Revision: 204700
URL: http://svn.freebsd.org/changeset/base/204700

Log:
  MFC r204307:
  Make pause(3) implementation not depended on the legacy sigcompat.c
  interfaces. Do not block rt signals during and after pause(3) calls.
  Use private libc namespace to call proper methods.

Modified:
  stable/8/lib/libc/gen/pause.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/gen/pause.c
==============================================================================
--- stable/8/lib/libc/gen/pause.c	Thu Mar  4 07:08:01 2010	(r204699)
+++ stable/8/lib/libc/gen/pause.c	Thu Mar  4 07:12:44 2010	(r204700)
@@ -33,8 +33,10 @@ static char sccsid[] = "@(#)pause.c	8.1 
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 
 /*
  * Backwards compatible pause.
@@ -42,7 +44,11 @@ __FBSDID("$FreeBSD$");
 int
 __pause()
 {
-	return sigpause(sigblock(0L));
+	sigset_t oset;
+
+	if (_sigprocmask(SIG_BLOCK, NULL, &oset) == -1)
+		return (-1);
+	return (_sigsuspend(&oset));
 }
 __weak_reference(__pause, pause);
 __weak_reference(__pause, _pause);

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar  4 19:35:23 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E790C106566C;
	Thu,  4 Mar 2010 19:35:22 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D45E68FC17;
	Thu,  4 Mar 2010 19:35:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o24JZM1c068026;
	Thu, 4 Mar 2010 19:35:22 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o24JZMt5068022;
	Thu, 4 Mar 2010 19:35:22 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <201003041935.o24JZMt5068022@svn.freebsd.org>
From: Brooks Davis 
Date: Thu, 4 Mar 2010 19:35:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204724 - in stable/8/sys: conf rpc/rpcsec_gss
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 04 Mar 2010 19:35:23 -0000

Author: brooks
Date: Thu Mar  4 19:35:22 2010
New Revision: 204724
URL: http://svn.freebsd.org/changeset/base/204724

Log:
  MFC r201853:
  
  Make options KGSSAPI build and add it to NOTES.
  
  rpcsec_gss_prot.c:
    Use kernel printf and headers.
  
  vc_rpcsec_gss.c:
    Use a local RPCAUTH_UNIXGIDS definition for 16 instead of using NGROUPS.

Modified:
  stable/8/sys/conf/NOTES
  stable/8/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c
  stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/conf/NOTES
==============================================================================
--- stable/8/sys/conf/NOTES	Thu Mar  4 17:48:40 2010	(r204723)
+++ stable/8/sys/conf/NOTES	Thu Mar  4 19:35:22 2010	(r204724)
@@ -978,6 +978,7 @@ options 	NFSSERVER		#Network File System
 options 	NFSLOCKD		#Network Lock Manager
 options 	NFSCL			#experimental NFS client with NFSv4
 options 	NFSD			#experimental NFS server with NFSv4
+options 	KGSSAPI			#Kernel GSSAPI implementaion
 
 # NT File System. Read-mostly, see mount_ntfs(8) for details.
 # For a full read-write NTFS support consider sysutils/fusefs-ntfs

Modified: stable/8/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c
==============================================================================
--- stable/8/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c	Thu Mar  4 17:48:40 2010	(r204723)
+++ stable/8/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c	Thu Mar  4 19:35:22 2010	(r204724)
@@ -307,7 +307,7 @@ xdr_rpc_gss_unwrap_data(struct mbuf **re
 }
 
 #ifdef DEBUG
-#include 
+#include 
 
 void
 rpc_gss_log_debug(const char *fmt, ...)
@@ -315,9 +315,9 @@ rpc_gss_log_debug(const char *fmt, ...)
 	va_list ap;
 
 	va_start(ap, fmt);
-	fprintf(stderr, "rpcsec_gss: ");
-	vfprintf(stderr, fmt, ap);
-	fprintf(stderr, "\n");
+	printf("rpcsec_gss: ");
+	vprintf(fmt, ap);
+	printf("\n");
 	va_end(ap);
 }
 
@@ -328,7 +328,7 @@ rpc_gss_log_status(const char *m, gss_OI
 	gss_buffer_desc msg;
 	int msg_ctx = 0;
 
-	fprintf(stderr, "rpcsec_gss: %s: ", m);
+	printf("rpcsec_gss: %s: ", m);
 	
 	gss_display_status(&min, maj_stat, GSS_C_GSS_CODE, GSS_C_NULL_OID,
 			   &msg_ctx, &msg);

Modified: stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==============================================================================
--- stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c	Thu Mar  4 17:48:40 2010	(r204723)
+++ stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c	Thu Mar  4 19:35:22 2010	(r204724)
@@ -121,6 +121,9 @@ enum svc_rpc_gss_client_state {
 };
 
 #define SVC_RPC_GSS_SEQWINDOW	128
+#ifndef RPCAUTH_UNIXGIDS
+#define RPCAUTH_UNIXGIDS	16
+#endif
 
 struct svc_rpc_gss_clientid {
 	unsigned long		ci_hostid;
@@ -147,7 +150,7 @@ struct svc_rpc_gss_client {
 	int			cl_rpcflavor;	/* RPC pseudo sec flavor */
 	bool_t			cl_done_callback; /* TRUE after call */
 	void			*cl_cookie;	/* user cookie from callback */
-	gid_t			cl_gid_storage[NGROUPS];
+	gid_t			cl_gid_storage[RPCAUTH_UNIXGIDS];
 	gss_OID			cl_mech;	/* mechanism */
 	gss_qop_t		cl_qop;		/* quality of protection */
 	uint32_t		cl_seqlast;	/* sequence window origin */
@@ -735,7 +738,7 @@ svc_rpc_gss_build_ucred(struct svc_rpc_g
 	uc->gid = 65534;
 	uc->gidlist = client->cl_gid_storage;
 
-	numgroups = NGROUPS;
+	numgroups = RPCAUTH_UNIXGIDS;
 	maj_stat = gss_pname_to_unix_cred(&min_stat, name, client->cl_mech,
 	    &uc->uid, &uc->gid, &numgroups, &uc->gidlist[0]);
 	if (GSS_ERROR(maj_stat))
@@ -932,7 +935,7 @@ svc_rpc_gss_accept_sec_context(struct sv
 			    "",
 			    client->cl_rawcred.client_principal->name,
 			    mechname.length, (char *)mechname.value,
-			    client->cl_qop, client->rawcred.service);
+			    client->cl_qop, client->cl_rawcred.service);
 
 			gss_release_buffer(&min_stat, &mechname);
 		}

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar  4 20:03:26 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AF2481065672;
	Thu,  4 Mar 2010 20:03:26 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 823118FC17;
	Thu,  4 Mar 2010 20:03:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o24K3QMo074412;
	Thu, 4 Mar 2010 20:03:26 GMT (envelope-from raj@svn.freebsd.org)
Received: (from raj@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o24K3QEv074409;
	Thu, 4 Mar 2010 20:03:26 GMT (envelope-from raj@svn.freebsd.org)
Message-Id: <201003042003.o24K3QEv074409@svn.freebsd.org>
From: Rafal Jaworowski 
Date: Thu, 4 Mar 2010 20:03:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204727 - stable/8/sys/boot/powerpc/uboot
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 04 Mar 2010 20:03:26 -0000

Author: raj
Date: Thu Mar  4 20:03:26 2010
New Revision: 204727
URL: http://svn.freebsd.org/changeset/base/204727

Log:
  MFC r204315
  
  Enable U-Boot storage for PowerPC. While there fix loader(8) help file name.

Modified:
  stable/8/sys/boot/powerpc/uboot/Makefile
  stable/8/sys/boot/powerpc/uboot/conf.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/boot/powerpc/uboot/Makefile
==============================================================================
--- stable/8/sys/boot/powerpc/uboot/Makefile	Thu Mar  4 19:56:08 2010	(r204726)
+++ stable/8/sys/boot/powerpc/uboot/Makefile	Thu Mar  4 20:03:26 2010	(r204727)
@@ -9,8 +9,8 @@ NO_MAN=
 # Architecture-specific loader code
 SRCS=		start.S conf.c vers.c
 
-LOADER_DISK_SUPPORT?=	no
-LOADER_UFS_SUPPORT?=	no
+LOADER_DISK_SUPPORT?=	yes
+LOADER_UFS_SUPPORT?=	yes
 LOADER_CD9660_SUPPORT?=	no
 LOADER_EXT2FS_SUPPORT?=	no
 LOADER_NET_SUPPORT?=	yes
@@ -85,11 +85,11 @@ LDADD=		${LIBFICL} ${LIBUBOOT} -lstand
 vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
 	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
 
-${PROG}.help: help.common help.uboot
+loader.help: help.common help.uboot
 	cat ${.ALLSRC} | \
 	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
 
 .PATH: ${.CURDIR}/../../forth
-FILES=	${PROG}.help
+FILES=	loader.help
 
 .include 

Modified: stable/8/sys/boot/powerpc/uboot/conf.c
==============================================================================
--- stable/8/sys/boot/powerpc/uboot/conf.c	Thu Mar  4 19:56:08 2010	(r204726)
+++ stable/8/sys/boot/powerpc/uboot/conf.c	Thu Mar  4 20:03:26 2010	(r204727)
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
 /* Exported for libstand */
 struct devsw *devsw[] = {
 #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT)
-    &uboot_disk,
+    &uboot_storage,
 #endif
 #if defined(LOADER_NET_SUPPORT)
     &netdev,

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar  4 20:08:00 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 47DC4106566C;
	Thu,  4 Mar 2010 20:08:00 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B0988FC14;
	Thu,  4 Mar 2010 20:08:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o24K80N9075488;
	Thu, 4 Mar 2010 20:08:00 GMT (envelope-from raj@svn.freebsd.org)
Received: (from raj@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o24K7xEj075486;
	Thu, 4 Mar 2010 20:07:59 GMT (envelope-from raj@svn.freebsd.org)
Message-Id: <201003042007.o24K7xEj075486@svn.freebsd.org>
From: Rafal Jaworowski 
Date: Thu, 4 Mar 2010 20:07:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204728 - stable/8/sys/boot/uboot/common
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 04 Mar 2010 20:08:00 -0000

Author: raj
Date: Thu Mar  4 20:07:59 2010
New Revision: 204728
URL: http://svn.freebsd.org/changeset/base/204728

Log:
  MFC r204316
  
  Let loader(8) for U-Boot use default storage more flexibly.
  
  Obtained from:	Semihalf

Modified:
  stable/8/sys/boot/uboot/common/main.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/boot/uboot/common/main.c
==============================================================================
--- stable/8/sys/boot/uboot/common/main.c	Thu Mar  4 20:03:26 2010	(r204727)
+++ stable/8/sys/boot/uboot/common/main.c	Thu Mar  4 20:07:59 2010	(r204728)
@@ -117,6 +117,7 @@ main(void)
 {
 	struct api_signature *sig = NULL;
 	int i;
+	struct open_file f;
 
 	if (!api_search_sig(&sig))
 		return (-1);
@@ -168,18 +169,28 @@ main(void)
 	printf("(%s, %s)\n", bootprog_maker, bootprog_date);
 	meminfo();
 
-	/* XXX only support netbooting for now */
-	for (i = 0; devsw[i] != NULL; i++)
+	for (i = 0; devsw[i] != NULL; i++) {
+		printf("\nDevice %d: %s\n", i, devsw[i]->dv_name);
+
+		currdev.d_dev = devsw[i];
+		currdev.d_type = currdev.d_dev->dv_type;
+		currdev.d_unit = 0;
+
+		if (strncmp(devsw[i]->dv_name, "disk",
+		    strlen(devsw[i]->dv_name)) == 0) {
+			f.f_devdata = &currdev;
+			currdev.d_disk.pnum = 0;
+			if (devsw[i]->dv_open(&f,&currdev) == 0)
+				break;
+		}
+
 		if (strncmp(devsw[i]->dv_name, "net",
 		    strlen(devsw[i]->dv_name)) == 0)
 			break;
+	}
 
 	if (devsw[i] == NULL)
-		panic("no network devices?!");
-
-	currdev.d_dev = devsw[i];
-	currdev.d_type = currdev.d_dev->dv_type;
-	currdev.d_unit = 0;
+		panic("No boot device found!");
 
 	env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev),
 	    uboot_setcurrdev, env_nounset);

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar  4 20:12:12 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E20661065670;
	Thu,  4 Mar 2010 20:12:12 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CF71E8FC17;
	Thu,  4 Mar 2010 20:12:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o24KCCRY076463;
	Thu, 4 Mar 2010 20:12:12 GMT (envelope-from raj@svn.freebsd.org)
Received: (from raj@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o24KCCOx076461;
	Thu, 4 Mar 2010 20:12:12 GMT (envelope-from raj@svn.freebsd.org)
Message-Id: <201003042012.o24KCCOx076461@svn.freebsd.org>
From: Rafal Jaworowski 
Date: Thu, 4 Mar 2010 20:12:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204729 - stable/8/sys/boot/uboot/lib
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 04 Mar 2010 20:12:13 -0000

Author: raj
Date: Thu Mar  4 20:12:12 2010
New Revision: 204729
URL: http://svn.freebsd.org/changeset/base/204729

Log:
  MFC r204317
  
  Fix handling of GPT disk partition index.
  
  Obtained from:	Semihalf

Modified:
  stable/8/sys/boot/uboot/lib/disk.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/boot/uboot/lib/disk.c
==============================================================================
--- stable/8/sys/boot/uboot/lib/disk.c	Thu Mar  4 20:07:59 2010	(r204728)
+++ stable/8/sys/boot/uboot/lib/disk.c	Thu Mar  4 20:12:12 2010	(r204729)
@@ -376,6 +376,14 @@ stor_open_gpt(struct open_dev *od, struc
 	}
 
 	dev->d_disk.ptype = PTYPE_GPT;
+	/*
+	 * If index of partition to open (dev->d_disk.pnum) is not defined
+	 * we set it to the index of the first existing partition. This
+	 * handles cases when only a disk device is specified (without full
+	 * partition information) by the caller.
+	 */
+	if ((od->od_nparts > 0) && (dev->d_disk.pnum == 0))
+		dev->d_disk.pnum = od->od_partitions[0].gp_index;
 
 	for (i = 0; i < od->od_nparts; i++)
 		if (od->od_partitions[i].gp_index == dev->d_disk.pnum)

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar  4 20:22:48 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D891106566B;
	Thu,  4 Mar 2010 20:22:48 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5B18B8FC18;
	Thu,  4 Mar 2010 20:22:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o24KMm1c078900;
	Thu, 4 Mar 2010 20:22:48 GMT (envelope-from raj@svn.freebsd.org)
Received: (from raj@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o24KMmfu078898;
	Thu, 4 Mar 2010 20:22:48 GMT (envelope-from raj@svn.freebsd.org)
Message-Id: <201003042022.o24KMmfu078898@svn.freebsd.org>
From: Rafal Jaworowski 
Date: Thu, 4 Mar 2010 20:22:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204730 - stable/8/sys/arm/mv
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 04 Mar 2010 20:22:48 -0000

Author: raj
Date: Thu Mar  4 20:22:48 2010
New Revision: 204730
URL: http://svn.freebsd.org/changeset/base/204730

Log:
  MFC r204283
  
  Do not force verbose and single mode in non-metadata boot case.
  
  We want to go multi-user by default also in case of booting without
  loader(8).

Modified:
  stable/8/sys/arm/mv/mv_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/arm/mv/mv_machdep.c
==============================================================================
--- stable/8/sys/arm/mv/mv_machdep.c	Thu Mar  4 20:12:12 2010	(r204729)
+++ stable/8/sys/arm/mv/mv_machdep.c	Thu Mar  4 20:22:48 2010	(r204730)
@@ -407,8 +407,7 @@ initarm(void *mdp, void *unused __unused
 		}
 		availmem_regions_sz = i;
 	} else {
-		/* Fall back to hardcoded boothowto flags and metadata. */
-		boothowto = RB_VERBOSE | RB_SINGLE;
+		/* Fall back to hardcoded metadata. */
 		lastaddr = fake_preload_metadata();
 
 		/*

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  5 00:31:03 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B555106566C;
	Fri,  5 Mar 2010 00:31:03 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B9828FC17;
	Fri,  5 Mar 2010 00:31:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o250V38w035048;
	Fri, 5 Mar 2010 00:31:03 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o250V3am035045;
	Fri, 5 Mar 2010 00:31:03 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003050031.o250V3am035045@svn.freebsd.org>
From: Xin LI 
Date: Fri, 5 Mar 2010 00:31:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204743 - stable/8/sbin/dump
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 05 Mar 2010 00:31:03 -0000

Author: delphij
Date: Fri Mar  5 00:31:03 2010
New Revision: 204743
URL: http://svn.freebsd.org/changeset/base/204743

Log:
  MFC r203459:
  
  Plug two memory leaks in error case.

Modified:
  stable/8/sbin/dump/itime.c
  stable/8/sbin/dump/main.c
Directory Properties:
  stable/8/sbin/dump/   (props changed)

Modified: stable/8/sbin/dump/itime.c
==============================================================================
--- stable/8/sbin/dump/itime.c	Thu Mar  4 23:30:57 2010	(r204742)
+++ stable/8/sbin/dump/itime.c	Fri Mar  5 00:31:03 2010	(r204743)
@@ -106,8 +106,10 @@ readdumptimes(FILE *df)
 
 	for (;;) {
 		dtwalk = (struct dumptime *)calloc(1, sizeof (struct dumptime));
-		if (getrecord(df, &(dtwalk->dt_value)) < 0)
+		if (getrecord(df, &(dtwalk->dt_value)) < 0) {
+			free(dtwalk);
 			break;
+		}
 		nddates++;
 		SLIST_INSERT_HEAD(&dthead, dtwalk, dt_list);
 	}

Modified: stable/8/sbin/dump/main.c
==============================================================================
--- stable/8/sbin/dump/main.c	Thu Mar  4 23:30:57 2010	(r204742)
+++ stable/8/sbin/dump/main.c	Fri Mar  5 00:31:03 2010	(r204743)
@@ -767,7 +767,8 @@ obsolete(int *argcp, char **argvp[])
 	if (flags) {
 		*p = '\0';
 		*nargv++ = flagsp;
-	}
+	} else
+		free(flagsp);
 
 	/* Copy remaining arguments. */
 	while ((*nargv++ = *argv++));

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  5 00:32:22 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67DD41065702;
	Fri,  5 Mar 2010 00:32:22 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 584DF8FC17;
	Fri,  5 Mar 2010 00:32:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o250WM0s035422;
	Fri, 5 Mar 2010 00:32:22 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o250WMxH035419;
	Fri, 5 Mar 2010 00:32:22 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003050032.o250WMxH035419@svn.freebsd.org>
From: Xin LI 
Date: Fri, 5 Mar 2010 00:32:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204744 - stable/8/sbin/iscontrol
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 05 Mar 2010 00:32:22 -0000

Author: delphij
Date: Fri Mar  5 00:32:22 2010
New Revision: 204744
URL: http://svn.freebsd.org/changeset/base/204744

Log:
  MFC r203460:
  
  pukeText is an internal function so define it as static rather than
  exporting it.

Modified:
  stable/8/sbin/iscontrol/iscontrol.h
  stable/8/sbin/iscontrol/pdu.c
Directory Properties:
  stable/8/sbin/iscontrol/   (props changed)

Modified: stable/8/sbin/iscontrol/iscontrol.h
==============================================================================
--- stable/8/sbin/iscontrol/iscontrol.h	Fri Mar  5 00:31:03 2010	(r204743)
+++ stable/8/sbin/iscontrol/iscontrol.h	Fri Mar  5 00:32:22 2010	(r204744)
@@ -144,7 +144,6 @@ int	addText(pdu_t *pp, char *fmt, ...);
 void	freePDU(pdu_t *pp);
 int	xmitpdu(isess_t *sess, pdu_t *pp);
 int	recvpdu(isess_t *sess, pdu_t *pp);
-void	pukeText(char *it, pdu_t *pp);
 
 int	lookup(token_t *tbl, char *m);
 

Modified: stable/8/sbin/iscontrol/pdu.c
==============================================================================
--- stable/8/sbin/iscontrol/pdu.c	Fri Mar  5 00:31:03 2010	(r204743)
+++ stable/8/sbin/iscontrol/pdu.c	Fri Mar  5 00:32:22 2010	(r204744)
@@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$");
 #include "iscsi.h"
 #include "iscontrol.h"
 
+static void	pukeText(char *it, pdu_t *pp);
+
 int
 xmitpdu(isess_t *sess, pdu_t *pp)
 {
@@ -153,7 +155,7 @@ freePDU(pdu_t *pp)
      pp->ds_size = pp->ds_len = 0;
 }
 
-void
+static void
 pukeText(char *it, pdu_t *pp)
 {
      char	*ptr;

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  5 00:33:06 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2A4E1106564A;
	Fri,  5 Mar 2010 00:33:06 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A58A8FC1E;
	Fri,  5 Mar 2010 00:33:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o250X51F035661;
	Fri, 5 Mar 2010 00:33:05 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o250X5eN035659;
	Fri, 5 Mar 2010 00:33:05 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003050033.o250X5eN035659@svn.freebsd.org>
From: Xin LI 
Date: Fri, 5 Mar 2010 00:33:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204745 - stable/8/sbin/mount_nfs
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 05 Mar 2010 00:33:06 -0000

Author: delphij
Date: Fri Mar  5 00:33:05 2010
New Revision: 204745
URL: http://svn.freebsd.org/changeset/base/204745

Log:
  MFC r203461:
  
  static'ify function prototypes and convert K&R to ANSI.

Modified:
  stable/8/sbin/mount_nfs/mount_nfs.c
Directory Properties:
  stable/8/sbin/mount_nfs/   (props changed)

Modified: stable/8/sbin/mount_nfs/mount_nfs.c
==============================================================================
--- stable/8/sbin/mount_nfs/mount_nfs.c	Fri Mar  5 00:32:22 2010	(r204744)
+++ stable/8/sbin/mount_nfs/mount_nfs.c	Fri Mar  5 00:33:05 2010	(r204745)
@@ -130,20 +130,19 @@ enum tryret {
 	TRYRET_LOCALERR		/* Local failure. */
 };
 
-int	fallback_mount(struct iovec *iov, int iovlen, int mntflags);
-int	sec_name_to_num(char *sec);
-char	*sec_num_to_name(int num);
-int	getnfsargs(char *, struct iovec **iov, int *iovlen);
+static int	fallback_mount(struct iovec *iov, int iovlen, int mntflags);
+static int	sec_name_to_num(char *sec);
+static char	*sec_num_to_name(int num);
+static int	getnfsargs(char *, struct iovec **iov, int *iovlen);
 /* void	set_rpc_maxgrouplist(int); */
-struct netconfig *getnetconf_cached(const char *netid);
-const char	*netidbytype(int af, int sotype);
-void	usage(void) __dead2;
-int	xdr_dir(XDR *, char *);
-int	xdr_fh(XDR *, struct nfhret *);
-enum tryret nfs_tryproto(struct addrinfo *ai, char *hostp, char *spec,
+static struct netconfig *getnetconf_cached(const char *netid);
+static const char	*netidbytype(int af, int sotype);
+static void	usage(void) __dead2;
+static int	xdr_dir(XDR *, char *);
+static int	xdr_fh(XDR *, struct nfhret *);
+static enum tryret nfs_tryproto(struct addrinfo *ai, char *hostp, char *spec,
     char **errstr, struct iovec **iov, int *iovlen);
-enum tryret returncode(enum clnt_stat stat, struct rpc_err *rpcerr);
-extern int getosreldate(void);
+static enum tryret returncode(enum clnt_stat stat, struct rpc_err *rpcerr);
 
 int
 main(int argc, char *argv[])
@@ -476,7 +475,7 @@ copyopt(struct iovec **newiov, int *newi
  *      passing NFS mount options to nmount() as individual
  *      parameters.  It should be eventually be removed.
  */
-int
+static int
 fallback_mount(struct iovec *iov, int iovlen, int mntflags)
 {
 	struct nfs_args args = {
@@ -663,7 +662,7 @@ fallback_mount(struct iovec *iov, int io
 	return nmount(newiov, newiovlen, mntflags);
 }
 
-int
+static int
 sec_name_to_num(char *sec)
 {
 	if (!strcmp(sec, "krb5"))
@@ -677,7 +676,7 @@ sec_name_to_num(char *sec)
 	return (-1);
 }
 
-char *
+static char *
 sec_num_to_name(int flavor)
 {
 	switch (flavor) {
@@ -693,7 +692,7 @@ sec_num_to_name(int flavor)
 	return (NULL);
 }
 
-int
+static int
 getnfsargs(char *spec, struct iovec **iov, int *iovlen)
 {
 	struct addrinfo hints, *ai_nfs, *ai;
@@ -849,7 +848,7 @@ getnfsargs(char *spec, struct iovec **io
  * In all error cases, *errstr will be set to a statically-allocated string
  * describing the error.
  */
-enum tryret
+static enum tryret
 nfs_tryproto(struct addrinfo *ai, char *hostp, char *spec, char **errstr,
     struct iovec **iov, int *iovlen)
 {
@@ -1071,7 +1070,7 @@ tryagain:
  * Catagorise a RPC return status and error into an `enum tryret'
  * return code.
  */
-enum tryret
+static enum tryret
 returncode(enum clnt_stat stat, struct rpc_err *rpcerr)
 {
 	switch (stat) {
@@ -1106,7 +1105,7 @@ returncode(enum clnt_stat stat, struct r
  *
  * XXX there should be a library function for this.
  */
-const char *
+static const char *
 netidbytype(int af, int sotype)
 {
 	struct nc_protos *p;
@@ -1126,7 +1125,7 @@ netidbytype(int af, int sotype)
  * Otherwise it behaves just like getnetconfigent(), so nc_*error()
  * work on failure.
  */
-struct netconfig *
+static struct netconfig *
 getnetconf_cached(const char *netid)
 {
 	static struct nc_entry {
@@ -1154,13 +1153,13 @@ getnetconf_cached(const char *netid)
 /*
  * xdr routines for mount rpc's
  */
-int
+static int
 xdr_dir(XDR *xdrsp, char *dirp)
 {
 	return (xdr_string(xdrsp, &dirp, MNTPATHLEN));
 }
 
-int
+static int
 xdr_fh(XDR *xdrsp, struct nfhret *np)
 {
 	int i;
@@ -1206,8 +1205,8 @@ xdr_fh(XDR *xdrsp, struct nfhret *np)
 	return (0);
 }
 
-void
-usage()
+static void
+usage(void)
 {
 	(void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
 "usage: mount_nfs [-23bcdiLlNPsTU] [-a maxreadahead] [-D deadthresh]",

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  5 22:40:32 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 018411065670;
	Fri,  5 Mar 2010 22:40:32 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AC15B8FC08;
	Fri,  5 Mar 2010 22:40:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o25MeVKR033719;
	Fri, 5 Mar 2010 22:40:31 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o25MeV8k033711;
	Fri, 5 Mar 2010 22:40:31 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201003052240.o25MeV8k033711@svn.freebsd.org>
From: Fabien Thomas 
Date: Fri, 5 Mar 2010 22:40:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204774 - stable/8/usr.sbin/pmcstat
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 05 Mar 2010 22:40:32 -0000

Author: fabient
Date: Fri Mar  5 22:40:31 2010
New Revision: 204774
URL: http://svn.freebsd.org/changeset/base/204774

Log:
  MFC 203790:
  - Reorganize code in 'plugin' to share log processing.
  - Kcachegrind (calltree) support with assembly/source
    code mapping and call count estimator (-F).
  - Top mode for calltree and callgraph plugin (-T).

Added:
  stable/8/usr.sbin/pmcstat/pmcpl_annotate.c
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcpl_annotate.c
  stable/8/usr.sbin/pmcstat/pmcpl_annotate.h
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcpl_annotate.h
  stable/8/usr.sbin/pmcstat/pmcpl_callgraph.c
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcpl_callgraph.c
  stable/8/usr.sbin/pmcstat/pmcpl_callgraph.h
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcpl_callgraph.h
  stable/8/usr.sbin/pmcstat/pmcpl_calltree.c
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcpl_calltree.c
  stable/8/usr.sbin/pmcstat/pmcpl_calltree.h
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcpl_calltree.h
  stable/8/usr.sbin/pmcstat/pmcpl_gprof.c
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcpl_gprof.c
  stable/8/usr.sbin/pmcstat/pmcpl_gprof.h
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcpl_gprof.h
  stable/8/usr.sbin/pmcstat/pmcstat_log.h
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcstat_log.h
  stable/8/usr.sbin/pmcstat/pmcstat_top.h
     - copied unchanged from r203790, head/usr.sbin/pmcstat/pmcstat_top.h
Modified:
  stable/8/usr.sbin/pmcstat/Makefile
  stable/8/usr.sbin/pmcstat/pmcstat.8
  stable/8/usr.sbin/pmcstat/pmcstat.c
  stable/8/usr.sbin/pmcstat/pmcstat.h
  stable/8/usr.sbin/pmcstat/pmcstat_log.c
Directory Properties:
  stable/8/usr.sbin/pmcstat/   (props changed)

Modified: stable/8/usr.sbin/pmcstat/Makefile
==============================================================================
--- stable/8/usr.sbin/pmcstat/Makefile	Fri Mar  5 21:39:16 2010	(r204773)
+++ stable/8/usr.sbin/pmcstat/Makefile	Fri Mar  5 22:40:31 2010	(r204774)
@@ -6,10 +6,11 @@ PROG=	pmcstat
 MAN=	pmcstat.8
 
 DPADD=	${LIBELF} ${LIBKVM} ${LIBPMC} ${LIBM}
-LDADD=	-lelf -lkvm -lpmc -lm
+LDADD=	-lelf -lkvm -lpmc -lm -lncurses
 
 WARNS?=	6
 
-SRCS=	pmcstat.c pmcstat.h pmcstat_log.c
+SRCS=	pmcstat.c pmcstat.h pmcstat_log.c \
+pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c pmcpl_calltree.c
 
 .include 

Copied: stable/8/usr.sbin/pmcstat/pmcpl_annotate.c (from r203790, head/usr.sbin/pmcstat/pmcpl_annotate.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/usr.sbin/pmcstat/pmcpl_annotate.c	Fri Mar  5 22:40:31 2010	(r204774, copy of r203790, head/usr.sbin/pmcstat/pmcpl_annotate.c)
@@ -0,0 +1,111 @@
+/*-
+ * Copyright (c) 2005-2007, Joseph Koshy
+ * Copyright (c) 2007 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by A. Joseph Koshy under
+ * sponsorship from the FreeBSD Foundation and Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Transform a hwpmc(4) log into human readable form, and into
+ * gprof(1) compatible profiles.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "pmcstat.h"
+#include "pmcstat_log.h"
+#include "pmcpl_annotate.h"
+
+/*
+ * Record a callchain.
+ */
+
+void
+pmcpl_annotate_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr,
+    uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu)
+{
+	struct pmcstat_pcmap *map;
+	struct pmcstat_symbol *sym;
+	uintfptr_t newpc;
+	struct pmcstat_image *image;
+
+	(void) pmcr; (void) nsamples; (void) usermode; (void) cpu;
+
+	map = pmcstat_process_find_map(usermode ? pp : pmcstat_kernproc, cc[0]);
+	if (map == NULL) {
+		/* Unknown offset. */
+		pmcstat_stats.ps_samples_unknown_offset++;
+		return;
+	}
+
+	assert(cc[0] >= map->ppm_lowpc && cc[0] < map->ppm_highpc);
+
+	image = map->ppm_image;
+	newpc = cc[0] - (map->ppm_lowpc +
+		(image->pi_vaddr - image->pi_start));
+	sym = pmcstat_symbol_search(image, newpc);
+	if (sym == NULL)
+		return;
+
+	fprintf(args.pa_graphfile, "%p %s 0x%jx 0x%jx\n",
+		(void *)cc[0],
+		pmcstat_string_unintern(sym->ps_name),
+		(uintmax_t)(sym->ps_start +
+		image->pi_vaddr), (uintmax_t)(sym->ps_end +
+		image->pi_vaddr));
+}

Copied: stable/8/usr.sbin/pmcstat/pmcpl_annotate.h (from r203790, head/usr.sbin/pmcstat/pmcpl_annotate.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/usr.sbin/pmcstat/pmcpl_annotate.h	Fri Mar  5 22:40:31 2010	(r204774, copy of r203790, head/usr.sbin/pmcstat/pmcpl_annotate.h)
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2005-2007, Joseph Koshy
+ * Copyright (c) 2007 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by A. Joseph Koshy under
+ * sponsorship from the FreeBSD Foundation and Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef	_PMCSTAT_PL_ANNOTATE_H_
+#define	_PMCSTAT_PL_ANNOTATE_H_
+
+/* Function prototypes */
+void pmcpl_annotate_process(
+    struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr,
+    uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu);
+
+#endif	/* _PMCSTAT_PL_ANNOTATE_H_ */

Copied: stable/8/usr.sbin/pmcstat/pmcpl_callgraph.c (from r203790, head/usr.sbin/pmcstat/pmcpl_callgraph.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/usr.sbin/pmcstat/pmcpl_callgraph.c	Fri Mar  5 22:40:31 2010	(r204774, copy of r203790, head/usr.sbin/pmcstat/pmcpl_callgraph.c)
@@ -0,0 +1,682 @@
+/*-
+ * Copyright (c) 2005-2007, Joseph Koshy
+ * Copyright (c) 2007 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by A. Joseph Koshy under
+ * sponsorship from the FreeBSD Foundation and Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Transform a hwpmc(4) log into human readable form, and into
+ * gprof(1) compatible profiles.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "pmcstat.h"
+#include "pmcstat_log.h"
+#include "pmcstat_top.h"
+#include "pmcpl_callgraph.h"
+
+/* Get the sample value in percent related to nsamples. */
+#define PMCPL_CG_COUNTP(a) \
+	((a)->pcg_count * 100.0 / nsamples)
+
+/*
+ * The toplevel CG nodes (i.e., with rank == 0) are placed in a hash table.
+ */
+
+struct pmcstat_cgnode_hash_list pmcstat_cgnode_hash[PMCSTAT_NHASH];
+int pmcstat_cgnode_hash_count;
+
+static pmcstat_interned_string pmcstat_previous_filename_printed;
+
+static struct pmcstat_cgnode *
+pmcstat_cgnode_allocate(struct pmcstat_image *image, uintfptr_t pc)
+{
+	struct pmcstat_cgnode *cg;
+
+	if ((cg = malloc(sizeof(*cg))) == NULL)
+		err(EX_OSERR, "ERROR: Cannot allocate callgraph node");
+
+	cg->pcg_image = image;
+	cg->pcg_func = pc;
+
+	cg->pcg_count = 0;
+	cg->pcg_nchildren = 0;
+	LIST_INIT(&cg->pcg_children);
+
+	return (cg);
+}
+
+/*
+ * Free a node and its children.
+ */
+static void
+pmcstat_cgnode_free(struct pmcstat_cgnode *cg)
+{
+	struct pmcstat_cgnode *cgc, *cgtmp;
+
+	LIST_FOREACH_SAFE(cgc, &cg->pcg_children, pcg_sibling, cgtmp)
+		pmcstat_cgnode_free(cgc);
+	free(cg);
+}
+
+/*
+ * Look for a callgraph node associated with pmc `pmcid' in the global
+ * hash table that corresponds to the given `pc' value in the process
+ * `pp'.
+ */
+static struct pmcstat_cgnode *
+pmcstat_cgnode_hash_lookup_pc(struct pmcstat_process *pp, pmc_id_t pmcid,
+    uintfptr_t pc, int usermode)
+{
+	struct pmcstat_pcmap *ppm;
+	struct pmcstat_symbol *sym;
+	struct pmcstat_image *image;
+	struct pmcstat_cgnode *cg;
+	struct pmcstat_cgnode_hash *h;
+	uintfptr_t loadaddress;
+	unsigned int i, hash;
+
+	ppm = pmcstat_process_find_map(usermode ? pp : pmcstat_kernproc, pc);
+	if (ppm == NULL)
+		return (NULL);
+
+	image = ppm->ppm_image;
+
+	loadaddress = ppm->ppm_lowpc + image->pi_vaddr - image->pi_start;
+	pc -= loadaddress;	/* Convert to an offset in the image. */
+
+	/*
+	 * Try determine the function at this offset.  If we can't
+	 * find a function round leave the `pc' value alone.
+	 */
+	if ((sym = pmcstat_symbol_search(image, pc)) != NULL)
+		pc = sym->ps_start;
+
+	for (hash = i = 0; i < sizeof(uintfptr_t); i++)
+		hash += (pc >> i) & 0xFF;
+
+	hash &= PMCSTAT_HASH_MASK;
+
+	cg = NULL;
+	LIST_FOREACH(h, &pmcstat_cgnode_hash[hash], pch_next)
+	{
+		if (h->pch_pmcid != pmcid)
+			continue;
+
+		cg = h->pch_cgnode;
+
+		assert(cg != NULL);
+
+		if (cg->pcg_image == image && cg->pcg_func == pc)
+			return (cg);
+	}
+
+	/*
+	 * We haven't seen this (pmcid, pc) tuple yet, so allocate a
+	 * new callgraph node and a new hash table entry for it.
+	 */
+	cg = pmcstat_cgnode_allocate(image, pc);
+	if ((h = malloc(sizeof(*h))) == NULL)
+		err(EX_OSERR, "ERROR: Could not allocate callgraph node");
+
+	h->pch_pmcid = pmcid;
+	h->pch_cgnode = cg;
+	LIST_INSERT_HEAD(&pmcstat_cgnode_hash[hash], h, pch_next);
+
+	pmcstat_cgnode_hash_count++;
+
+	return (cg);
+}
+
+/*
+ * Compare two callgraph nodes for sorting.
+ */
+static int
+pmcstat_cgnode_compare(const void *a, const void *b)
+{
+	const struct pmcstat_cgnode *const *pcg1, *const *pcg2, *cg1, *cg2;
+
+	pcg1 = (const struct pmcstat_cgnode *const *) a;
+	cg1 = *pcg1;
+	pcg2 = (const struct pmcstat_cgnode *const *) b;
+	cg2 = *pcg2;
+
+	/* Sort in reverse order */
+	if (cg1->pcg_count < cg2->pcg_count)
+		return (1);
+	if (cg1->pcg_count > cg2->pcg_count)
+		return (-1);
+	return (0);
+}
+
+/*
+ * Find (allocating if a needed) a callgraph node in the given
+ * parent with the same (image, pcoffset) pair.
+ */
+
+static struct pmcstat_cgnode *
+pmcstat_cgnode_find(struct pmcstat_cgnode *parent, struct pmcstat_image *image,
+    uintfptr_t pcoffset)
+{
+	struct pmcstat_cgnode *child;
+
+	LIST_FOREACH(child, &parent->pcg_children, pcg_sibling) {
+		if (child->pcg_image == image &&
+		    child->pcg_func == pcoffset)
+			return (child);
+	}
+
+	/*
+	 * Allocate a new structure.
+	 */
+
+	child = pmcstat_cgnode_allocate(image, pcoffset);
+
+	/*
+	 * Link it into the parent.
+	 */
+	LIST_INSERT_HEAD(&parent->pcg_children, child, pcg_sibling);
+	parent->pcg_nchildren++;
+
+	return (child);
+}
+
+/*
+ * Print one callgraph node.  The output format is:
+ *
+ * indentation %(parent's samples) #nsamples function@object
+ */
+static void
+pmcstat_cgnode_print(struct pmcstat_cgnode *cg, int depth, uint32_t total)
+{
+	uint32_t n;
+	const char *space;
+	struct pmcstat_symbol *sym;
+	struct pmcstat_cgnode **sortbuffer, **cgn, *pcg;
+
+	space = " ";
+
+	if (depth > 0)
+		(void) fprintf(args.pa_graphfile, "%*s", depth, space);
+
+	if (cg->pcg_count == total)
+		(void) fprintf(args.pa_graphfile, "100.0%% ");
+	else
+		(void) fprintf(args.pa_graphfile, "%05.2f%% ",
+		    100.0 * cg->pcg_count / total);
+
+	n = fprintf(args.pa_graphfile, " [%u] ", cg->pcg_count);
+
+	/* #samples is a 12 character wide field. */
+	if (n < 12)
+		(void) fprintf(args.pa_graphfile, "%*s", 12 - n, space);
+
+	if (depth > 0)
+		(void) fprintf(args.pa_graphfile, "%*s", depth, space);
+
+	sym = pmcstat_symbol_search(cg->pcg_image, cg->pcg_func);
+	if (sym)
+		(void) fprintf(args.pa_graphfile, "%s",
+		    pmcstat_string_unintern(sym->ps_name));
+	else
+		(void) fprintf(args.pa_graphfile, "%p",
+		    (void *) (cg->pcg_image->pi_vaddr + cg->pcg_func));
+
+	if (pmcstat_previous_filename_printed !=
+	    cg->pcg_image->pi_fullpath) {
+		pmcstat_previous_filename_printed = cg->pcg_image->pi_fullpath;
+		(void) fprintf(args.pa_graphfile, " @ %s\n",
+		    pmcstat_string_unintern(
+		    pmcstat_previous_filename_printed));
+	} else
+		(void) fprintf(args.pa_graphfile, "\n");
+
+	if (cg->pcg_nchildren == 0)
+		return;
+
+	if ((sortbuffer = (struct pmcstat_cgnode **)
+		malloc(sizeof(struct pmcstat_cgnode *) *
+		    cg->pcg_nchildren)) == NULL)
+		err(EX_OSERR, "ERROR: Cannot print callgraph");
+	cgn = sortbuffer;
+
+	LIST_FOREACH(pcg, &cg->pcg_children, pcg_sibling)
+	    *cgn++ = pcg;
+
+	assert(cgn - sortbuffer == (int) cg->pcg_nchildren);
+
+	qsort(sortbuffer, cg->pcg_nchildren, sizeof(struct pmcstat_cgnode *),
+	    pmcstat_cgnode_compare);
+
+	for (cgn = sortbuffer, n = 0; n < cg->pcg_nchildren; n++, cgn++)
+		pmcstat_cgnode_print(*cgn, depth+1, cg->pcg_count);
+
+	free(sortbuffer);
+}
+
+/*
+ * Record a callchain.
+ */
+
+void
+pmcpl_cg_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr,
+    uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu)
+{
+	uintfptr_t pc, loadaddress;
+	uint32_t n;
+	struct pmcstat_image *image;
+	struct pmcstat_pcmap *ppm;
+	struct pmcstat_symbol *sym;
+	struct pmcstat_cgnode *parent, *child;
+	struct pmcstat_process *km;
+	pmc_id_t pmcid;
+
+	(void) cpu;
+
+	/*
+	 * Find the callgraph node recorded in the global hash table
+	 * for this (pmcid, pc).
+	 */
+
+	pc = cc[0];
+	pmcid = pmcr->pr_pmcid;
+	parent = pmcstat_cgnode_hash_lookup_pc(pp, pmcid, pc, usermode);
+	if (parent == NULL) {
+		pmcstat_stats.ps_callchain_dubious_frames++;
+		return;
+	}
+
+	parent->pcg_count++;
+
+	/*
+	 * For each return address in the call chain record, subject
+	 * to the maximum depth desired.
+	 * - Find the image associated with the sample.  Stop if there
+	 *   there is no valid image at that address.
+	 * - Find the function that overlaps the return address.
+	 * - If found: use the start address of the function.
+	 *   If not found (say an object's symbol table is not present or
+	 *   is incomplete), round down to th gprof bucket granularity.
+	 * - Convert return virtual address to an offset in the image.
+	 * - Look for a child with the same {offset,image} tuple,
+	 *   inserting one if needed.
+	 * - Increment the count of occurrences of the child.
+	 */
+	km = pmcstat_kernproc;
+
+	for (n = 1; n < (uint32_t) args.pa_graphdepth && n < nsamples; n++,
+	    parent = child) {
+		pc = cc[n];
+
+		ppm = pmcstat_process_find_map(usermode ? pp : km, pc);
+		if (ppm == NULL) {
+			/* Detect full frame capture (kernel + user). */
+			if (!usermode) {
+				ppm = pmcstat_process_find_map(pp, pc);
+				if (ppm != NULL)
+					km = pp;
+			}
+		}
+		if (ppm == NULL)
+			return;
+
+		image = ppm->ppm_image;
+		loadaddress = ppm->ppm_lowpc + image->pi_vaddr -
+		    image->pi_start;
+		pc -= loadaddress;
+
+		if ((sym = pmcstat_symbol_search(image, pc)) != NULL)
+			pc = sym->ps_start;
+
+		child = pmcstat_cgnode_find(parent, image, pc);
+		child->pcg_count++;
+	}
+}
+
+/*
+ * Printing a callgraph for a PMC.
+ */
+static void
+pmcstat_callgraph_print_for_pmcid(struct pmcstat_pmcrecord *pmcr)
+{
+	int n, nentries;
+	uint32_t nsamples;
+	pmc_id_t pmcid;
+	struct pmcstat_cgnode **sortbuffer, **cgn;
+	struct pmcstat_cgnode_hash *pch;
+
+	/*
+	 * We pull out all callgraph nodes in the top-level hash table
+	 * with a matching PMC id.  We then sort these based on the
+	 * frequency of occurrence.  Each callgraph node is then
+	 * printed.
+	 */
+
+	nsamples = 0;
+	pmcid = pmcr->pr_pmcid;
+	if ((sortbuffer = (struct pmcstat_cgnode **)
+	    malloc(sizeof(struct pmcstat_cgnode *) *
+	    pmcstat_cgnode_hash_count)) == NULL)
+		err(EX_OSERR, "ERROR: Cannot sort callgraph");
+	cgn = sortbuffer;
+
+	for (n = 0; n < PMCSTAT_NHASH; n++)
+		LIST_FOREACH(pch, &pmcstat_cgnode_hash[n], pch_next)
+		    if (pch->pch_pmcid == pmcid) {
+			    nsamples += pch->pch_cgnode->pcg_count;
+			    *cgn++ = pch->pch_cgnode;
+		    }
+
+	nentries = cgn - sortbuffer;
+	assert(nentries <= pmcstat_cgnode_hash_count);
+
+	if (nentries == 0) {
+		free(sortbuffer);
+		return;
+	}
+
+	qsort(sortbuffer, nentries, sizeof(struct pmcstat_cgnode *),
+	    pmcstat_cgnode_compare);
+
+	(void) fprintf(args.pa_graphfile,
+	    "@ %s [%u samples]\n\n",
+	    pmcstat_string_unintern(pmcr->pr_pmcname),
+	    nsamples);
+
+	for (cgn = sortbuffer, n = 0; n < nentries; n++, cgn++) {
+		pmcstat_previous_filename_printed = NULL;
+		pmcstat_cgnode_print(*cgn, 0, nsamples);
+		(void) fprintf(args.pa_graphfile, "\n");
+	}
+
+	free(sortbuffer);
+}
+
+/*
+ * Print out callgraphs.
+ */
+
+static void
+pmcstat_callgraph_print(void)
+{
+	struct pmcstat_pmcrecord *pmcr;
+
+	LIST_FOREACH(pmcr, &pmcstat_pmcs, pr_next)
+	    pmcstat_callgraph_print_for_pmcid(pmcr);
+}
+
+static void
+pmcstat_cgnode_topprint(struct pmcstat_cgnode *cg,
+    int depth, uint32_t nsamples)
+{
+	int v_attrs, vs_len, ns_len, width, len, n, nchildren;
+	float v;
+	char ns[30], vs[10];
+	struct pmcstat_symbol *sym;
+	struct pmcstat_cgnode **sortbuffer, **cgn, *pcg;
+
+	(void) depth;
+
+	/* Format value. */
+	v = PMCPL_CG_COUNTP(cg);
+	snprintf(vs, sizeof(vs), "%.1f", v);
+	v_attrs = PMCSTAT_ATTRPERCENT(v);
+
+	/* Format name. */
+	sym = pmcstat_symbol_search(cg->pcg_image, cg->pcg_func);
+	if (sym != NULL) {
+		snprintf(ns, sizeof(ns), "%s",
+		    pmcstat_string_unintern(sym->ps_name));
+	} else
+		snprintf(ns, sizeof(ns), "%p",
+		    (void *)cg->pcg_func);
+
+	PMCSTAT_ATTRON(v_attrs);
+	PMCSTAT_PRINTW("%5.5s", vs);
+	PMCSTAT_ATTROFF(v_attrs);
+	PMCSTAT_PRINTW(" %-10.10s %-20.20s",
+	    pmcstat_string_unintern(cg->pcg_image->pi_name),
+	    ns);
+
+	nchildren = cg->pcg_nchildren;
+	if (nchildren == 0) {
+		PMCSTAT_PRINTW("\n");
+		return;
+	}
+
+	width = pmcstat_displaywidth - 40;
+
+	if ((sortbuffer = (struct pmcstat_cgnode **)
+		malloc(sizeof(struct pmcstat_cgnode *) *
+		    nchildren)) == NULL)
+		err(EX_OSERR, "ERROR: Cannot print callgraph");
+	cgn = sortbuffer;
+
+	LIST_FOREACH(pcg, &cg->pcg_children, pcg_sibling)
+	    *cgn++ = pcg;
+
+	assert(cgn - sortbuffer == (int)nchildren);
+
+	qsort(sortbuffer, nchildren, sizeof(struct pmcstat_cgnode *),
+	    pmcstat_cgnode_compare);
+
+	/* Count how many callers. */
+	for (cgn = sortbuffer, n = 0; n < nchildren; n++, cgn++) {
+		pcg = *cgn;
+
+		v = PMCPL_CG_COUNTP(pcg);
+		if (v < pmcstat_threshold)
+			break;
+	}
+	nchildren = n;
+
+	for (cgn = sortbuffer, n = 0; n < nchildren; n++, cgn++) {
+		pcg = *cgn;
+
+		/* Format value. */
+		if (nchildren > 1) {
+			v = PMCPL_CG_COUNTP(pcg);
+			vs_len = snprintf(vs, sizeof(vs), ":%.1f", v);
+			v_attrs = PMCSTAT_ATTRPERCENT(v);
+		} else
+			vs_len = 0;
+
+		/* Format name. */
+		sym = pmcstat_symbol_search(pcg->pcg_image, pcg->pcg_func);
+		if (sym != NULL) {
+			ns_len = snprintf(ns, sizeof(ns), "%s",
+			    pmcstat_string_unintern(sym->ps_name));
+		} else
+			ns_len = snprintf(ns, sizeof(ns), "%p",
+			    (void *)pcg->pcg_func);
+
+		len = ns_len + vs_len + 1;
+		if (width - len < 0) {
+			PMCSTAT_PRINTW("...");
+			break;
+		}
+		width -= len;
+
+		PMCSTAT_PRINTW(" %s", ns);
+		if (nchildren > 1) {
+			PMCSTAT_ATTRON(v_attrs);
+			PMCSTAT_PRINTW("%s", vs);
+			PMCSTAT_ATTROFF(v_attrs);
+		}
+	}
+	PMCSTAT_PRINTW("\n");
+	free(sortbuffer);
+}
+
+/*
+ * Top mode display.
+ */
+
+void
+pmcpl_cg_topdisplay(void)
+{
+	int n, nentries;
+	uint32_t nsamples;
+	struct pmcstat_cgnode **sortbuffer, **cgn;
+	struct pmcstat_cgnode_hash *pch;
+	struct pmcstat_pmcrecord *pmcr;
+
+	pmcr = pmcstat_pmcindex_to_pmcr(pmcstat_pmcinfilter);
+
+	/*
+	 * We pull out all callgraph nodes in the top-level hash table
+	 * with a matching PMC index.  We then sort these based on the
+	 * frequency of occurrence.  Each callgraph node is then
+	 * printed.
+	 */
+
+	nsamples = 0;
+
+	if ((sortbuffer = (struct pmcstat_cgnode **)
+	    malloc(sizeof(struct pmcstat_cgnode *) *
+	    pmcstat_cgnode_hash_count)) == NULL)
+		err(EX_OSERR, "ERROR: Cannot sort callgraph");
+	cgn = sortbuffer;
+
+	for (n = 0; n < PMCSTAT_NHASH; n++)
+		LIST_FOREACH(pch, &pmcstat_cgnode_hash[n], pch_next)
+		    if (pmcr == NULL || pch->pch_pmcid == pmcr->pr_pmcid) {
+			    nsamples += pch->pch_cgnode->pcg_count;
+			    *cgn++ = pch->pch_cgnode;
+		    }
+
+	nentries = cgn - sortbuffer;
+	assert(nentries <= pmcstat_cgnode_hash_count);
+
+	if (nentries == 0) {
+		free(sortbuffer);
+		return;
+	}
+
+	qsort(sortbuffer, nentries, sizeof(struct pmcstat_cgnode *),
+	    pmcstat_cgnode_compare);
+
+	PMCSTAT_PRINTW("%5.5s %-10.10s %-20.20s %s\n",
+	    "%SAMP", "IMAGE", "FUNCTION", "CALLERS");
+
+	nentries = min(pmcstat_displayheight - 2, nentries);
+
+	for (cgn = sortbuffer, n = 0; n < nentries; n++, cgn++) {
+		if (PMCPL_CG_COUNTP(*cgn) < pmcstat_threshold)
+			break;
+		pmcstat_cgnode_topprint(*cgn, 0, nsamples);
+	}
+
+	free(sortbuffer);
+}
+
+/*
+ * Handle top mode keypress.
+ */
+
+int
+pmcpl_cg_topkeypress(int c, WINDOW *w)
+{
+
+	(void) c; (void) w;
+
+	return 0;
+}
+
+int
+pmcpl_cg_init(void)
+{
+	int i;
+
+	pmcstat_cgnode_hash_count = 0;
+	pmcstat_previous_filename_printed = NULL;
+
+	for (i = 0; i < PMCSTAT_NHASH; i++) {
+		LIST_INIT(&pmcstat_cgnode_hash[i]);
+	}
+
+	return (0);
+}
+
+void
+pmcpl_cg_shutdown(FILE *mf)
+{
+	int i;
+	struct pmcstat_cgnode_hash *pch, *pchtmp;
+
+	(void) mf;
+
+	if (args.pa_flags & FLAG_DO_CALLGRAPHS)
+		pmcstat_callgraph_print();
+
+	/*
+	 * Free memory.
+	 */
+	for (i = 0; i < PMCSTAT_NHASH; i++) {
+		LIST_FOREACH_SAFE(pch, &pmcstat_cgnode_hash[i], pch_next,
+		    pchtmp) {
+			pmcstat_cgnode_free(pch->pch_cgnode);
+			LIST_REMOVE(pch, pch_next);
+			free(pch);
+		}
+	}
+}
+

Copied: stable/8/usr.sbin/pmcstat/pmcpl_callgraph.h (from r203790, head/usr.sbin/pmcstat/pmcpl_callgraph.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/usr.sbin/pmcstat/pmcpl_callgraph.h	Fri Mar  5 22:40:31 2010	(r204774, copy of r203790, head/usr.sbin/pmcstat/pmcpl_callgraph.h)
@@ -0,0 +1,67 @@
+/*-
+ * Copyright (c) 2005-2007, Joseph Koshy
+ * Copyright (c) 2007 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by A. Joseph Koshy under
+ * sponsorship from the FreeBSD Foundation and Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef	_PMCSTAT_PL_CALLGRAPH_H_
+#define	_PMCSTAT_PL_CALLGRAPH_H_
+
+/*
+ * Each call graph node is tracked by a pmcstat_cgnode struct.
+ */
+
+struct pmcstat_cgnode {
+	struct pmcstat_image	*pcg_image;
+	uintfptr_t		pcg_func;
+	uint32_t		pcg_count;
+	uint32_t		pcg_nchildren;
+	LIST_ENTRY(pmcstat_cgnode) pcg_sibling;
+	LIST_HEAD(,pmcstat_cgnode) pcg_children;
+};
+
+struct pmcstat_cgnode_hash {
+	struct pmcstat_cgnode  *pch_cgnode;
+	pmc_id_t		pch_pmcid;
+	LIST_ENTRY(pmcstat_cgnode_hash) pch_next;
+};
+extern LIST_HEAD(pmcstat_cgnode_hash_list, pmcstat_cgnode_hash) pmcstat_cgnode_hash[PMCSTAT_NHASH];
+extern int pmcstat_cgnode_hash_count;
+
+/* Function prototypes */
+int pmcpl_cg_init(void);
+void pmcpl_cg_shutdown(FILE *mf);
+void pmcpl_cg_process(
+    struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr,
+    uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu);
+int pmcpl_cg_topkeypress(int c, WINDOW *w);
+void pmcpl_cg_topdisplay(void);
+void pmcpl_cg_configure(char *opt);
+
+#endif	/* _PMCSTAT_PL_CALLGRAPH_H_ */

Copied: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c (from r203790, head/usr.sbin/pmcstat/pmcpl_calltree.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/usr.sbin/pmcstat/pmcpl_calltree.c	Fri Mar  5 22:40:31 2010	(r204774, copy of r203790, head/usr.sbin/pmcstat/pmcpl_calltree.c)
@@ -0,0 +1,1000 @@
+/*-
+ * Copyright (c) 2009, Fabien Thomas
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Process hwpmc(4) samples as calltree.
+ *
+ * Output file format compatible with Kcachegrind (kdesdk).
+ * Handle top mode with a sorted tree display.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "pmcstat.h"
+#include "pmcstat_log.h"
+#include "pmcstat_top.h"
+#include "pmcpl_calltree.h"
+
+#define PMCPL_CT_GROWSIZE	4
+
+static pmcstat_interned_string pmcpl_ct_prevfn;
+
+static int pmcstat_skiplink = 0;
+
+struct pmcpl_ct_node;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  5 22:52:41 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF9151065673;
	Fri,  5 Mar 2010 22:52:41 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DD9428FC0C;
	Fri,  5 Mar 2010 22:52:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o25MqfFm036734;
	Fri, 5 Mar 2010 22:52:41 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o25MqfYK036732;
	Fri, 5 Mar 2010 22:52:41 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201003052252.o25MqfYK036732@svn.freebsd.org>
From: Fabien Thomas 
Date: Fri, 5 Mar 2010 22:52:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204779 - stable/8/usr.sbin/pmcstat
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 05 Mar 2010 22:52:42 -0000

Author: fabient
Date: Fri Mar  5 22:52:41 2010
New Revision: 204779
URL: http://svn.freebsd.org/changeset/base/204779

Log:
  MFC 204329 partially:
  Fixed dependencies (make checkdpadd).

Modified:
  stable/8/usr.sbin/pmcstat/Makefile
Directory Properties:
  stable/8/usr.sbin/pmcstat/   (props changed)

Modified: stable/8/usr.sbin/pmcstat/Makefile
==============================================================================
--- stable/8/usr.sbin/pmcstat/Makefile	Fri Mar  5 22:48:34 2010	(r204778)
+++ stable/8/usr.sbin/pmcstat/Makefile	Fri Mar  5 22:52:41 2010	(r204779)
@@ -5,7 +5,7 @@
 PROG=	pmcstat
 MAN=	pmcstat.8
 
-DPADD=	${LIBELF} ${LIBKVM} ${LIBPMC} ${LIBM}
+DPADD=	${LIBELF} ${LIBKVM} ${LIBPMC} ${LIBM} ${LIBNCURSES}
 LDADD=	-lelf -lkvm -lpmc -lm -lncurses
 
 WARNS?=	6

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  6 12:35:33 2010
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE4D3106564A;
	Sat,  6 Mar 2010 12:35:33 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B77B8FC1B;
	Sat,  6 Mar 2010 12:35:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o26CZX4p023666;
	Sat, 6 Mar 2010 12:35:33 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o26CZXN1023664;
	Sat, 6 Mar 2010 12:35:33 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201003061235.o26CZXN1023664@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 6 Mar 2010 12:35:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204796 - stable/8/sys/kern
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 06 Mar 2010 12:35:33 -0000

Author: kib
Date: Sat Mar  6 12:35:33 2010
New Revision: 204796
URL: http://svn.freebsd.org/changeset/base/204796

Log:
  MFC r204413:
  For kinfo_proc in kp->ki_siglist, return the set of the signals pending
  in the process queue when gathering information for the process, and set
  of signals pending for the thread, when gathering information for the
  thread.

Modified:
  stable/8/sys/kern/kern_proc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/kern/kern_proc.c
==============================================================================
--- stable/8/sys/kern/kern_proc.c	Sat Mar  6 11:07:17 2010	(r204795)
+++ stable/8/sys/kern/kern_proc.c	Sat Mar  6 12:35:33 2010	(r204796)
@@ -829,9 +829,10 @@ fill_kinfo_proc_only(struct proc *p, str
 }
 
 /*
- * Fill in information that is thread specific.  Must be called with p_slock
- * locked.  If 'preferthread' is set, overwrite certain process-related
- * fields that are maintained for both threads and processes.
+ * Fill in information that is thread specific.  Must be called with
+ * target process locked.  If 'preferthread' is set, overwrite certain
+ * process-related fields that are maintained for both threads and
+ * processes.
  */
 static void
 fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread)
@@ -900,7 +901,8 @@ fill_kinfo_thread(struct thread *td, str
 	/* We can't get this anymore but ps etc never used it anyway. */
 	kp->ki_rqindex = 0;
 
-	SIGSETOR(kp->ki_siglist, td->td_siglist);
+	if (preferthread)
+		kp->ki_siglist = td->td_siglist;
 	kp->ki_sigmask = td->td_sigmask;
 	thread_unlock(td);
 }