From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 07:08:11 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C459E1065670; Sun, 10 Jan 2010 07:08:11 +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 99A0B8FC14; Sun, 10 Jan 2010 07:08: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 o0A78BOB050332; Sun, 10 Jan 2010 07:08:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A78BqN050330; Sun, 10 Jan 2010 07:08:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001100708.o0A78BqN050330@svn.freebsd.org> From: Xin LI Date: Sun, 10 Jan 2010 07:08: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: r201987 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 07:08:11 -0000 Author: delphij Date: Sun Jan 10 07:08:11 2010 New Revision: 201987 URL: http://svn.freebsd.org/changeset/base/201987 Log: MFC r201756: Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD revision 200726 and 200727). Reviewed by: mm@ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.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) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 10 05:46:19 2010 (r201986) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 10 07:08:11 2010 (r201987) @@ -847,6 +847,12 @@ restore_object(struct restorearg *ra, ob if (err != 0 && err != ENOENT) return (EINVAL); + if (drro->drr_bonuslen) { + data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); + if (ra->err) + return (ra->err); + } + if (err == ENOENT) { /* currently free, want to be allocated */ tx = dmu_tx_create(os); @@ -862,7 +868,6 @@ restore_object(struct restorearg *ra, ob dmu_tx_commit(tx); } else { /* currently allocated, want to be allocated */ - err = dmu_object_reclaim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen); @@ -870,12 +875,6 @@ restore_object(struct restorearg *ra, ob if (err) return (EINVAL); - if (drro->drr_bonuslen) { - data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); - if (ra->err) - return (ra->err); - } - tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, drro->drr_object); err = dmu_tx_assign(tx, TXG_WAIT); From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 07:18:36 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DED81065670; Sun, 10 Jan 2010 07:18:36 +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 3CB748FC12; Sun, 10 Jan 2010 07:18:36 +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 o0A7IaPL052664; Sun, 10 Jan 2010 07:18:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A7IaE9052662; Sun, 10 Jan 2010 07:18:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001100718.o0A7IaE9052662@svn.freebsd.org> From: Xin LI Date: Sun, 10 Jan 2010 07:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201988 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 07:18:36 -0000 Author: delphij Date: Sun Jan 10 07:18:35 2010 New Revision: 201988 URL: http://svn.freebsd.org/changeset/base/201988 Log: MFC r201756: Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD revision 200726 and 200727). Reviewed by: mm@ Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 10 07:08:11 2010 (r201987) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 10 07:18:35 2010 (r201988) @@ -847,6 +847,12 @@ restore_object(struct restorearg *ra, ob if (err != 0 && err != ENOENT) return (EINVAL); + if (drro->drr_bonuslen) { + data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); + if (ra->err) + return (ra->err); + } + if (err == ENOENT) { /* currently free, want to be allocated */ tx = dmu_tx_create(os); @@ -862,7 +868,6 @@ restore_object(struct restorearg *ra, ob dmu_tx_commit(tx); } else { /* currently allocated, want to be allocated */ - err = dmu_object_reclaim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen); @@ -870,12 +875,6 @@ restore_object(struct restorearg *ra, ob if (err) return (EINVAL); - if (drro->drr_bonuslen) { - data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); - if (ra->err) - return (ra->err); - } - tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, drro->drr_object); err = dmu_tx_assign(tx, TXG_WAIT); From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 11:25:35 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 382B01065764; Sun, 10 Jan 2010 11:25: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 2633B8FC08; Sun, 10 Jan 2010 11:25: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 o0ABPZJT011281; Sun, 10 Jan 2010 11:25:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ABPZDw011279; Sun, 10 Jan 2010 11:25:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001101125.o0ABPZDw011279@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 10 Jan 2010 11:25: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: r201994 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 11:25:35 -0000 Author: kib Date: Sun Jan 10 11:25:34 2010 New Revision: 201994 URL: http://svn.freebsd.org/changeset/base/201994 Log: MFC r201743: Give some information on SF_MNOWAIT flag. MFC r201759 (by brueffer): Fix a typo and bump date for the previous commit. MFC r201760: Further fix grammar. Modified: stable/8/lib/libc/sys/sendfile.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/sendfile.2 ============================================================================== --- stable/8/lib/libc/sys/sendfile.2 Sun Jan 10 11:02:10 2010 (r201993) +++ stable/8/lib/libc/sys/sendfile.2 Sun Jan 10 11:25:34 2010 (r201994) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2006 +.Dd January 7, 2010 .Dt SENDFILE 2 .Os .Sh NAME @@ -116,9 +116,17 @@ Busy servers may benefit by transferring block to a separate I/O worker thread. .It .Dv SF_MNOWAIT . -(description missing) +Do not wait for some kernel resource to become available, +in particular, +.Vt mbuf +and +.Vt sf_buf . +The flag does not make the +.Fn sendfile +syscall truly non-blocking, since other resources are still allocated +in a blocking fashion. .It -.Dv SF_SYNC , +.Dv SF_SYNC . .Nm sleeps until the network stack no longer references the VM pages of the file, making subsequent modifications to it safe. From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 13:36:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70FD0106566B; Sun, 10 Jan 2010 13:36:32 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id 196E58FC12; Sun, 10 Jan 2010 13:36:31 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 2E00617015; Sun, 10 Jan 2010 16:36:30 +0300 (MSK) Date: Sun, 10 Jan 2010 16:36:30 +0300 From: Maxim Dounin To: Xin LI Message-ID: <20100110133629.GF1063@mdounin.ru> References: <201001100718.o0A7IaE9052662@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001100718.o0A7IaE9052662@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r201988 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 13:36:32 -0000 Hello! On Sun, Jan 10, 2010 at 07:18:36AM +0000, Xin LI wrote: > Author: delphij > Date: Sun Jan 10 07:18:35 2010 > New Revision: 201988 > URL: http://svn.freebsd.org/changeset/base/201988 > > Log: > MFC r201756: > > Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD > revision 200726 and 200727). For source control onnv-gate uses Mercurial, and this means that revision numbers make sense only for one particular clone. It make sense to record changeset hash instead, which is stable between clones. See here for more details: http://mercurial.selenic.com/wiki/RevisionNumber Just for the record: 7994:7a573dc88b73 8986:45c289aff7c9 Maxim Dounin From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 16:00:01 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01F3A1065670; Sun, 10 Jan 2010 16:00:00 +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 DEF948FC0C; Sun, 10 Jan 2010 16:00: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 o0AG00J2071878; Sun, 10 Jan 2010 16:00:00 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AG00p6071875; Sun, 10 Jan 2010 16:00:00 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001101600.o0AG00p6071875@svn.freebsd.org> From: Fabien Thomas Date: Sun, 10 Jan 2010 16:00: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: r202008 - in stable/8/sys: dev/hwpmc sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:00:02 -0000 Author: fabient Date: Sun Jan 10 16:00:00 2010 New Revision: 202008 URL: http://svn.freebsd.org/changeset/base/202008 Log: MFC 201021: Log process mappings for existing processes at PMC start time. Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c stable/8/sys/sys/pmc.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) Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 15:59:59 2010 (r202007) +++ stable/8/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:00:00 2010 (r202008) @@ -63,6 +63,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include +#include + /* * Types */ @@ -1619,6 +1625,151 @@ pmc_log_kernel_mappings(struct pmc *pm) static void pmc_log_process_mappings(struct pmc_owner *po, struct proc *p) { + vm_map_t map; + struct vnode *vp; + struct vmspace *vm; + vm_map_entry_t entry; + vm_offset_t last_end; + u_int last_timestamp; + struct vnode *last_vp; + vm_offset_t start_addr; + vm_object_t obj, lobj, tobj; + char *fullpath, *freepath; + + last_vp = NULL; + last_end = (vm_offset_t) 0; + fullpath = freepath = NULL; + + if ((vm = vmspace_acquire_ref(p)) == NULL) + return; + + map = &vm->vm_map; + vm_map_lock_read(map); + + for (entry = map->header.next; entry != &map->header; entry = entry->next) { + + if (entry == NULL) { + PMCDBG(LOG,OPS,2, "hwpmc: vm_map entry unexpectedly " + "NULL! pid=%d vm_map=%p\n", p->p_pid, map); + break; + } + + /* + * We only care about executable map entries. + */ + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) || + !(entry->protection & VM_PROT_EXECUTE) || + (entry->object.vm_object == NULL)) { + continue; + } + + obj = entry->object.vm_object; + VM_OBJECT_LOCK(obj); + + /* + * Walk the backing_object list to find the base + * (non-shadowed) vm_object. + */ + for (lobj = tobj = obj; tobj != NULL; tobj = tobj->backing_object) { + if (tobj != obj) + VM_OBJECT_LOCK(tobj); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + lobj = tobj; + } + + /* + * At this point lobj is the base vm_object and it is locked. + */ + if (lobj == NULL) { + PMCDBG(LOG,OPS,2, "hwpmc: lobj unexpectedly NULL! pid=%d " + "vm_map=%p vm_obj=%p\n", p->p_pid, map, obj); + VM_OBJECT_UNLOCK(obj); + continue; + } + + if (lobj->type != OBJT_VNODE || lobj->handle == NULL) { + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_UNLOCK(obj); + continue; + } + + /* + * Skip contiguous regions that point to the same + * vnode, so we don't emit redundant MAP-IN + * directives. + */ + if (entry->start == last_end && lobj->handle == last_vp) { + last_end = entry->end; + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_UNLOCK(obj); + continue; + } + + /* + * We don't want to keep the proc's vm_map or this + * vm_object locked while we walk the pathname, since + * vn_fullpath() can sleep. However, if we drop the + * lock, it's possible for concurrent activity to + * modify the vm_map list. To protect against this, + * we save the vm_map timestamp before we release the + * lock, and check it after we reacquire the lock + * below. + */ + start_addr = entry->start; + last_end = entry->end; + last_timestamp = map->timestamp; + vm_map_unlock_read(map); + + vp = lobj->handle; + vref(vp); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + + VM_OBJECT_UNLOCK(obj); + + freepath = NULL; + pmc_getfilename(vp, &fullpath, &freepath); + last_vp = vp; + vrele(vp); + vp = NULL; + pmclog_process_map_in(po, p->p_pid, start_addr, fullpath); + if (freepath) + free(freepath, M_TEMP); + + vm_map_lock_read(map); + + /* + * If our saved timestamp doesn't match, this means + * that the vm_map was modified out from under us and + * we can't trust our current "entry" pointer. Do a + * new lookup for this entry. If there is no entry + * for this address range, vm_map_lookup_entry() will + * return the previous one, so we always want to go to + * entry->next on the next loop iteration. + * + * There is an edge condition here that can occur if + * there is no entry at or before this address. In + * this situation, vm_map_lookup_entry returns + * &map->header, which would cause our loop to abort + * without processing the rest of the map. However, + * in practice this will never happen for process + * vm_map. This is because the executable's text + * segment is the first mapping in the proc's address + * space, and this mapping is never removed until the + * process exits, so there will always be a non-header + * entry at or before the requested address for + * vm_map_lookup_entry to return. + */ + if (map->timestamp != last_timestamp) + vm_map_lookup_entry(map, last_end - 1, &entry); + } + + vm_map_unlock_read(map); + vmspace_free(vm); + return; } /* @@ -1897,7 +2048,7 @@ pmc_allocate_owner_descriptor(struct pro /* allocate space for N pointers and one descriptor struct */ po = malloc(sizeof(struct pmc_owner), M_PMC, M_WAITOK|M_ZERO); - po->po_sscount = po->po_error = po->po_flags = 0; + po->po_sscount = po->po_error = po->po_flags = po->po_logprocmaps = 0; po->po_file = NULL; po->po_owner = p; po->po_kthread = NULL; @@ -2520,8 +2671,15 @@ pmc_start(struct pmc *pm) po->po_sscount++; } - /* Log mapping information for all processes in the system. */ - pmc_log_all_process_mappings(po); + /* + * Log mapping information for all existing processes in the + * system. Subsequent mappings are logged as they happen; + * see pmc_process_mmap(). + */ + if (po->po_logprocmaps == 0) { + pmc_log_all_process_mappings(po); + po->po_logprocmaps = 1; + } /* * Move to the CPU associated with this Modified: stable/8/sys/sys/pmc.h ============================================================================== --- stable/8/sys/sys/pmc.h Sun Jan 10 15:59:59 2010 (r202007) +++ stable/8/sys/sys/pmc.h Sun Jan 10 16:00:00 2010 (r202008) @@ -750,7 +750,8 @@ struct pmc_owner { struct pmclog_buffer *po_curbuf; /* current log buffer */ struct file *po_file; /* file reference */ int po_error; /* recorded error */ - int po_sscount; /* # SS PMCs owned */ + short po_sscount; /* # SS PMCs owned */ + short po_logprocmaps; /* global mappings done */ }; #define PMC_PO_OWNS_LOGFILE 0x00000001 /* has a log file */ From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 16:04:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45934106568B; Sun, 10 Jan 2010 16:04:33 +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 344AD8FC15; Sun, 10 Jan 2010 16:04: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 o0AG4XUY072981; Sun, 10 Jan 2010 16:04:33 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AG4XR5072979; Sun, 10 Jan 2010 16:04:33 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001101604.o0AG4XR5072979@svn.freebsd.org> From: Fabien Thomas Date: Sun, 10 Jan 2010 16:04: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: r202009 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:04:33 -0000 Author: fabient Date: Sun Jan 10 16:04:32 2010 New Revision: 202009 URL: http://svn.freebsd.org/changeset/base/202009 Log: MFC 201023: * Support the L1D_CACHE_LD event on Core2 processors. * Correct a group of typos: for Core2 programmable events, check user supplied umask values against the correct event descriptor field. Modified: stable/8/sys/dev/hwpmc/hwpmc_core.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) Modified: stable/8/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:00:00 2010 (r202008) +++ stable/8/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:04:32 2010 (r202009) @@ -669,7 +669,7 @@ static struct iap_event_descr iap_events IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUS), IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUS), - IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC), + IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC | IAP_F_CC2), IAPDESCR(40H_21H, 0x40, 0x21, IAP_F_FM | IAP_F_CA), IAPDESCR(41H, 0x41, IAP_M_MESI, IAP_F_CC | IAP_F_CC2), @@ -1419,17 +1419,17 @@ iap_allocate_pmc(int cpu, int ri, struct mask = 0; - if (ie->iap_flags & IAP_M_CORE) { + if (ie->iap_umask & IAP_M_CORE) { if ((c = (config & IAP_F_CORE)) != IAP_CORE_ALL && c != IAP_CORE_THIS) return (EINVAL); mask |= IAP_F_CORE; } - if (ie->iap_flags & IAP_M_AGENT) + if (ie->iap_umask & IAP_M_AGENT) mask |= IAP_F_AGENT; - if (ie->iap_flags & IAP_M_PREFETCH) { + if (ie->iap_umask & IAP_M_PREFETCH) { if ((c = (config & IAP_F_PREFETCH)) == IAP_PREFETCH_RESERVED) @@ -1438,16 +1438,16 @@ iap_allocate_pmc(int cpu, int ri, struct mask |= IAP_F_PREFETCH; } - if (ie->iap_flags & IAP_M_MESI) + if (ie->iap_umask & IAP_M_MESI) mask |= IAP_F_MESI; - if (ie->iap_flags & IAP_M_SNOOPRESPONSE) + if (ie->iap_umask & IAP_M_SNOOPRESPONSE) mask |= IAP_F_SNOOPRESPONSE; - if (ie->iap_flags & IAP_M_SNOOPTYPE) + if (ie->iap_umask & IAP_M_SNOOPTYPE) mask |= IAP_F_SNOOPTYPE; - if (ie->iap_flags & IAP_M_TRANSITION) + if (ie->iap_umask & IAP_M_TRANSITION) mask |= IAP_F_TRANSITION; /* From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 16:08:14 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F06F1065670; Sun, 10 Jan 2010 16:08:14 +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 7DB2F8FC19; Sun, 10 Jan 2010 16:08:14 +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 o0AG8Ex2073893; Sun, 10 Jan 2010 16:08:14 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AG8EUj073891; Sun, 10 Jan 2010 16:08:14 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001101608.o0AG8EUj073891@svn.freebsd.org> From: Fabien Thomas Date: Sun, 10 Jan 2010 16:08:14 +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: r202012 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:08:14 -0000 Author: fabient Date: Sun Jan 10 16:08:14 2010 New Revision: 202012 URL: http://svn.freebsd.org/changeset/base/202012 Log: MFC 201151: Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele(). Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.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) Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:05:05 2010 (r202011) +++ stable/8/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:08:14 2010 (r202012) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1625,6 +1626,7 @@ pmc_log_kernel_mappings(struct pmc *pm) static void pmc_log_process_mappings(struct pmc_owner *po, struct proc *p) { + int locked; vm_map_t map; struct vnode *vp; struct vmspace *vm; @@ -1733,7 +1735,11 @@ pmc_log_process_mappings(struct pmc_owne freepath = NULL; pmc_getfilename(vp, &fullpath, &freepath); last_vp = vp; + + locked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); + VFS_UNLOCK_GIANT(locked); + vp = NULL; pmclog_process_map_in(po, p->p_pid, start_addr, fullpath); if (freepath) From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 16:36:43 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C03911065679; Sun, 10 Jan 2010 16:36:43 +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 AEC898FC19; Sun, 10 Jan 2010 16:36: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 o0AGahuj080266; Sun, 10 Jan 2010 16:36:43 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AGahlB080263; Sun, 10 Jan 2010 16:36:43 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001101636.o0AGahlB080263@svn.freebsd.org> From: Fabien Thomas Date: Sun, 10 Jan 2010 16:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202014 - in stable/7/sys: dev/hwpmc sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:36:43 -0000 Author: fabient Date: Sun Jan 10 16:36:43 2010 New Revision: 202014 URL: http://svn.freebsd.org/changeset/base/202014 Log: MFC 201021: Log process mappings for existing processes at PMC start time. Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c stable/7/sys/sys/pmc.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:30:54 2010 (r202013) +++ stable/7/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:36:43 2010 (r202014) @@ -63,6 +63,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include +#include + /* * Types */ @@ -1622,6 +1628,151 @@ pmc_log_kernel_mappings(struct pmc *pm) static void pmc_log_process_mappings(struct pmc_owner *po, struct proc *p) { + vm_map_t map; + struct vnode *vp; + struct vmspace *vm; + vm_map_entry_t entry; + vm_offset_t last_end; + u_int last_timestamp; + struct vnode *last_vp; + vm_offset_t start_addr; + vm_object_t obj, lobj, tobj; + char *fullpath, *freepath; + + last_vp = NULL; + last_end = (vm_offset_t) 0; + fullpath = freepath = NULL; + + if ((vm = vmspace_acquire_ref(p)) == NULL) + return; + + map = &vm->vm_map; + vm_map_lock_read(map); + + for (entry = map->header.next; entry != &map->header; entry = entry->next) { + + if (entry == NULL) { + PMCDBG(LOG,OPS,2, "hwpmc: vm_map entry unexpectedly " + "NULL! pid=%d vm_map=%p\n", p->p_pid, map); + break; + } + + /* + * We only care about executable map entries. + */ + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) || + !(entry->protection & VM_PROT_EXECUTE) || + (entry->object.vm_object == NULL)) { + continue; + } + + obj = entry->object.vm_object; + VM_OBJECT_LOCK(obj); + + /* + * Walk the backing_object list to find the base + * (non-shadowed) vm_object. + */ + for (lobj = tobj = obj; tobj != NULL; tobj = tobj->backing_object) { + if (tobj != obj) + VM_OBJECT_LOCK(tobj); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + lobj = tobj; + } + + /* + * At this point lobj is the base vm_object and it is locked. + */ + if (lobj == NULL) { + PMCDBG(LOG,OPS,2, "hwpmc: lobj unexpectedly NULL! pid=%d " + "vm_map=%p vm_obj=%p\n", p->p_pid, map, obj); + VM_OBJECT_UNLOCK(obj); + continue; + } + + if (lobj->type != OBJT_VNODE || lobj->handle == NULL) { + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_UNLOCK(obj); + continue; + } + + /* + * Skip contiguous regions that point to the same + * vnode, so we don't emit redundant MAP-IN + * directives. + */ + if (entry->start == last_end && lobj->handle == last_vp) { + last_end = entry->end; + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_UNLOCK(obj); + continue; + } + + /* + * We don't want to keep the proc's vm_map or this + * vm_object locked while we walk the pathname, since + * vn_fullpath() can sleep. However, if we drop the + * lock, it's possible for concurrent activity to + * modify the vm_map list. To protect against this, + * we save the vm_map timestamp before we release the + * lock, and check it after we reacquire the lock + * below. + */ + start_addr = entry->start; + last_end = entry->end; + last_timestamp = map->timestamp; + vm_map_unlock_read(map); + + vp = lobj->handle; + vref(vp); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + + VM_OBJECT_UNLOCK(obj); + + freepath = NULL; + pmc_getfilename(vp, &fullpath, &freepath); + last_vp = vp; + vrele(vp); + vp = NULL; + pmclog_process_map_in(po, p->p_pid, start_addr, fullpath); + if (freepath) + free(freepath, M_TEMP); + + vm_map_lock_read(map); + + /* + * If our saved timestamp doesn't match, this means + * that the vm_map was modified out from under us and + * we can't trust our current "entry" pointer. Do a + * new lookup for this entry. If there is no entry + * for this address range, vm_map_lookup_entry() will + * return the previous one, so we always want to go to + * entry->next on the next loop iteration. + * + * There is an edge condition here that can occur if + * there is no entry at or before this address. In + * this situation, vm_map_lookup_entry returns + * &map->header, which would cause our loop to abort + * without processing the rest of the map. However, + * in practice this will never happen for process + * vm_map. This is because the executable's text + * segment is the first mapping in the proc's address + * space, and this mapping is never removed until the + * process exits, so there will always be a non-header + * entry at or before the requested address for + * vm_map_lookup_entry to return. + */ + if (map->timestamp != last_timestamp) + vm_map_lookup_entry(map, last_end - 1, &entry); + } + + vm_map_unlock_read(map); + vmspace_free(vm); + return; } /* @@ -1900,7 +2051,7 @@ pmc_allocate_owner_descriptor(struct pro /* allocate space for N pointers and one descriptor struct */ po = malloc(sizeof(struct pmc_owner), M_PMC, M_WAITOK|M_ZERO); - po->po_sscount = po->po_error = po->po_flags = 0; + po->po_sscount = po->po_error = po->po_flags = po->po_logprocmaps = 0; po->po_file = NULL; po->po_owner = p; po->po_kthread = NULL; @@ -2523,8 +2674,15 @@ pmc_start(struct pmc *pm) po->po_sscount++; } - /* Log mapping information for all processes in the system. */ - pmc_log_all_process_mappings(po); + /* + * Log mapping information for all existing processes in the + * system. Subsequent mappings are logged as they happen; + * see pmc_process_mmap(). + */ + if (po->po_logprocmaps == 0) { + pmc_log_all_process_mappings(po); + po->po_logprocmaps = 1; + } /* * Move to the CPU associated with this Modified: stable/7/sys/sys/pmc.h ============================================================================== --- stable/7/sys/sys/pmc.h Sun Jan 10 16:30:54 2010 (r202013) +++ stable/7/sys/sys/pmc.h Sun Jan 10 16:36:43 2010 (r202014) @@ -755,7 +755,8 @@ struct pmc_owner { struct pmclog_buffer *po_curbuf; /* current log buffer */ struct file *po_file; /* file reference */ int po_error; /* recorded error */ - int po_sscount; /* # SS PMCs owned */ + short po_sscount; /* # SS PMCs owned */ + short po_logprocmaps; /* global mappings done */ }; #define PMC_PO_OWNS_LOGFILE 0x00000001 /* has a log file */ From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 16:40:15 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 070031065672; Sun, 10 Jan 2010 16:40:15 +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 D18088FC15; Sun, 10 Jan 2010 16:40:14 +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 o0AGeEfE081094; Sun, 10 Jan 2010 16:40:14 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AGeE0r081092; Sun, 10 Jan 2010 16:40:14 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001101640.o0AGeE0r081092@svn.freebsd.org> From: Fabien Thomas Date: Sun, 10 Jan 2010 16:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202015 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:40:15 -0000 Author: fabient Date: Sun Jan 10 16:40:14 2010 New Revision: 202015 URL: http://svn.freebsd.org/changeset/base/202015 Log: MFC 201023: * Support the L1D_CACHE_LD event on Core2 processors. * Correct a group of typos: for Core2 programmable events, check user supplied umask values against the correct event descriptor field. Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:36:43 2010 (r202014) +++ stable/7/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:40:14 2010 (r202015) @@ -669,7 +669,7 @@ static struct iap_event_descr iap_events IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUS), IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUS), - IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC), + IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC | IAP_F_CC2), IAPDESCR(40H_21H, 0x40, 0x21, IAP_F_FM | IAP_F_CA), IAPDESCR(41H, 0x41, IAP_M_MESI, IAP_F_CC | IAP_F_CC2), @@ -1419,17 +1419,17 @@ iap_allocate_pmc(int cpu, int ri, struct mask = 0; - if (ie->iap_flags & IAP_M_CORE) { + if (ie->iap_umask & IAP_M_CORE) { if ((c = (config & IAP_F_CORE)) != IAP_CORE_ALL && c != IAP_CORE_THIS) return (EINVAL); mask |= IAP_F_CORE; } - if (ie->iap_flags & IAP_M_AGENT) + if (ie->iap_umask & IAP_M_AGENT) mask |= IAP_F_AGENT; - if (ie->iap_flags & IAP_M_PREFETCH) { + if (ie->iap_umask & IAP_M_PREFETCH) { if ((c = (config & IAP_F_PREFETCH)) == IAP_PREFETCH_RESERVED) @@ -1438,16 +1438,16 @@ iap_allocate_pmc(int cpu, int ri, struct mask |= IAP_F_PREFETCH; } - if (ie->iap_flags & IAP_M_MESI) + if (ie->iap_umask & IAP_M_MESI) mask |= IAP_F_MESI; - if (ie->iap_flags & IAP_M_SNOOPRESPONSE) + if (ie->iap_umask & IAP_M_SNOOPRESPONSE) mask |= IAP_F_SNOOPRESPONSE; - if (ie->iap_flags & IAP_M_SNOOPTYPE) + if (ie->iap_umask & IAP_M_SNOOPTYPE) mask |= IAP_F_SNOOPTYPE; - if (ie->iap_flags & IAP_M_TRANSITION) + if (ie->iap_umask & IAP_M_TRANSITION) mask |= IAP_F_TRANSITION; /* From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 16:43:45 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0A34106566B; Sun, 10 Jan 2010 16:43:45 +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 900258FC12; Sun, 10 Jan 2010 16:43: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 o0AGhjRX081889; Sun, 10 Jan 2010 16:43:45 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AGhjvT081887; Sun, 10 Jan 2010 16:43:45 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001101643.o0AGhjvT081887@svn.freebsd.org> From: Fabien Thomas Date: Sun, 10 Jan 2010 16:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202016 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:43:45 -0000 Author: fabient Date: Sun Jan 10 16:43:45 2010 New Revision: 202016 URL: http://svn.freebsd.org/changeset/base/202016 Log: MFC 201151: Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele(). Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:40:14 2010 (r202015) +++ stable/7/sys/dev/hwpmc/hwpmc_mod.c Sun Jan 10 16:43:45 2010 (r202016) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1628,6 +1629,7 @@ pmc_log_kernel_mappings(struct pmc *pm) static void pmc_log_process_mappings(struct pmc_owner *po, struct proc *p) { + int locked; vm_map_t map; struct vnode *vp; struct vmspace *vm; @@ -1736,7 +1738,11 @@ pmc_log_process_mappings(struct pmc_owne freepath = NULL; pmc_getfilename(vp, &fullpath, &freepath); last_vp = vp; + + locked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); + VFS_UNLOCK_GIANT(locked); + vp = NULL; pmclog_process_map_in(po, p->p_pid, start_addr, fullpath); if (freepath) From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 16:58:12 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A09D5106566B; Sun, 10 Jan 2010 16:58:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 765728FC08; Sun, 10 Jan 2010 16:58: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 o0AGwCKu085116; Sun, 10 Jan 2010 16:58:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AGwCvw085115; Sun, 10 Jan 2010 16:58:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201001101658.o0AGwCvw085115@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 10 Jan 2010 16:58: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: r202017 - stable/8/tools/regression/bin/sh/expansion X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:58:12 -0000 Author: jilles Date: Sun Jan 10 16:58:12 2010 New Revision: 202017 URL: http://svn.freebsd.org/changeset/base/202017 Log: MFC r210428: sh: Add a regression test that tries out all arithmetic ops. The gaps in the numbering sequence cannot really be avoided, as HEAD changes are not necessarily merged in the same order as they are made (if they are merged at all). Added: stable/8/tools/regression/bin/sh/expansion/arith2.0 - copied unchanged from r201428, head/tools/regression/bin/sh/expansion/arith2.0 Modified: Directory Properties: stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/tools/regression/bin/sh/expansion/arith2.0 (from r201428, head/tools/regression/bin/sh/expansion/arith2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/arith2.0 Sun Jan 10 16:58:12 2010 (r202017, copy of r201428, head/tools/regression/bin/sh/expansion/arith2.0) @@ -0,0 +1,76 @@ +# $FreeBSD$ + +failures=0 + +check() { + if [ $(($1)) != $2 ]; then + failures=$((failures+1)) + echo "For $1, expected $2 actual $(($1))" + fi +} + +# variables +unset v +check "v=2" 2 +check "v" 2 +check "$(($v))" 2 +check "v+=1" 3 +check "v" 3 + +# constants +check "4611686018427387904" 4611686018427387904 +check "0x4000000000000000" 4611686018427387904 +check "0400000000000000000000" 4611686018427387904 +check "0x4Ab0000000000000" 5381801554707742720 + +# try out all operators +v=42 +check "!v" 0 +check "!!v" 1 +check "!0" 1 +check "~0" -1 +check "~(-1)" 0 +check "-0" 0 +check "-v" -42 +check "v*v" 1764 +check "v/2" 21 +check "v%10" 2 +check "v+v" 84 +check "v-4" 38 +check "v<<1" 84 +check "v>>1" 21 +check "v<43" 1 +check "v>42" 0 +check "v<=43" 1 +check "v>=43" 0 +check "v==41" 0 +check "v!=42" 0 +check "v&3" 2 +check "v^3" 41 +check "v|3" 43 +check "v>=40&&v<=44" 1 +check "v<40||v>44" 0 +check "(v=42)&&(v+=1)==43" 1 +check "v" 43 +check "(v=42)&&(v-=1)==41" 1 +check "v" 41 +check "(v=42)&&(v*=2)==84" 1 +check "v" 84 +check "(v=42)&&(v/=10)==4" 1 +check "v" 4 +check "(v=42)&&(v%=10)==2" 1 +check "v" 2 +check "(v=42)&&(v<<=1)==84" 1 +check "v" 84 +check "(v=42)&&(v>>=2)==10" 1 +check "v" 10 +check "(v=42)&&(v&=32)==32" 1 +check "v" 32 +check "(v=42)&&(v^=32)==10" 1 +check "v" 10 +check "(v=42)&&(v|=32)==42" 1 +check "v" 42 + +# missing: ternary, comma + +exit $((failures != 0)) From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 17:40:15 2010 Return-Path: Delivered-To: svn-src-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D50AA106566B; Sun, 10 Jan 2010 17:40:15 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6466A8FC0A; Sun, 10 Jan 2010 17:40:14 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 712F3A5519A; Mon, 11 Jan 2010 01:40:12 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id 9zRp9o0GzZ6g; Mon, 11 Jan 2010 01:39:59 +0800 (CST) Received: from delta.delphij.net (c-69-181-136-105.hsd1.ca.comcast.net [69.181.136.105]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id AAC68A550C0; Mon, 11 Jan 2010 01:39:56 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=frLJyAzcuHwxyV79oCRrGU163RsvS+wJrvdJx2ujl+Cu/kK9jdly2hie4scl/U/vF OmCfwwHBe8XA1r3TIeo0g== Message-ID: <4B4A10E8.9050504@delphij.net> Date: Sun, 10 Jan 2010 09:39:52 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20091220 Thunderbird/3.0 ThunderBrowse/3.2.6.8 MIME-Version: 1.0 To: Maxim Dounin References: <201001100718.o0A7IaE9052662@svn.freebsd.org> <20100110133629.GF1063@mdounin.ru> In-Reply-To: <20100110133629.GF1063@mdounin.ru> X-Enigmail-Version: 1.0 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r201988 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 17:40:16 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010/01/10 05:36, Maxim Dounin wrote: > Hello! > > On Sun, Jan 10, 2010 at 07:18:36AM +0000, Xin LI wrote: > >> Author: delphij >> Date: Sun Jan 10 07:18:35 2010 >> New Revision: 201988 >> URL: http://svn.freebsd.org/changeset/base/201988 >> >> Log: >> MFC r201756: >> >> Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD >> revision 200726 and 200727). > > For source control onnv-gate uses Mercurial, and this means that > revision numbers make sense only for one particular clone. It > make sense to record changeset hash instead, which is stable > between clones. See here for more details: > > http://mercurial.selenic.com/wiki/RevisionNumber > > Just for the record: > > 7994:7a573dc88b73 > 8986:45c289aff7c9 Thanks for the hint, I'll make sure that these information be included next time. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBAgAGBQJLShDoAAoJEATO+BI/yjfBBQ8H/1YjObGpgT9uV7T6P65DNuSa 7sT279l89dafIYcaeBGiCkeajW9mQFM82Z3o3jJ1m4RLrZltoi7IlSzwUmQvs3oY wXOo/58x17N8XFTd2fB0Yxl/ph80hx3tB8G0jb9kqYlQGW+zsMKYyhemUsHUBexs dUu6Pn3bmVpuC1URNBjRaV+oqaLb8PE06+ZBZNJ4/iLSM569Twl+VepON+AIl0M3 JMq/EDB62Ad2pXR8tYNGRU8KVYfjn6AqsNiIQA/dMmBXdx7INmvIU9IU9SpP9ok6 AgBrh8FQqWBGgkaOuA2Tlt2OSeRHRQmSuJNywYPVP8SaaU+LhqoOYEd2l2lE7qU= =go2M -----END PGP SIGNATURE----- From owner-svn-src-stable@FreeBSD.ORG Sun Jan 10 23:51:03 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EB32106566C; Sun, 10 Jan 2010 23:51:03 +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 2AB668FC0A; Sun, 10 Jan 2010 23:51: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 o0ANp3Vt079564; Sun, 10 Jan 2010 23:51:03 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ANp2vJ079555; Sun, 10 Jan 2010 23:51:02 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001102351.o0ANp2vJ079555@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 10 Jan 2010 23:51:02 +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: r202052 - in stable/8/sys: conf ia64/ia64 ia64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 23:51:03 -0000 Author: marcel Date: Sun Jan 10 23:51:02 2010 New Revision: 202052 URL: http://svn.freebsd.org/changeset/base/202052 Log: MFC rev 201269, 201373: o Revamp bus_space access functions (201269). o Change BUS_SPACE_MAXADDR from 2^32-1 to 2^64-1 (201373). Added: stable/8/sys/ia64/ia64/bus_machdep.c - copied unchanged from r201269, head/sys/ia64/ia64/bus_machdep.c Modified: stable/8/sys/conf/files.ia64 stable/8/sys/ia64/ia64/machdep.c stable/8/sys/ia64/ia64/mp_machdep.c stable/8/sys/ia64/ia64/nexus.c stable/8/sys/ia64/ia64/sys_machdep.c stable/8/sys/ia64/include/bus.h stable/8/sys/ia64/include/cpufunc.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) Modified: stable/8/sys/conf/files.ia64 ============================================================================== --- stable/8/sys/conf/files.ia64 Sun Jan 10 23:37:04 2010 (r202051) +++ stable/8/sys/conf/files.ia64 Sun Jan 10 23:51:02 2010 (r202052) @@ -75,6 +75,7 @@ ia64/ia32/ia32_reg.c optional compat_ia ia64/ia32/ia32_signal.c optional compat_ia32 ia64/ia32/ia32_trap.c optional compat_ia32 ia64/ia64/autoconf.c standard +ia64/ia64/bus_machdep.c standard ia64/ia64/busdma_machdep.c standard ia64/ia64/clock.c standard ia64/ia64/context.S standard Copied: stable/8/sys/ia64/ia64/bus_machdep.c (from r201269, head/sys/ia64/ia64/bus_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/ia64/ia64/bus_machdep.c Sun Jan 10 23:51:02 2010 (r202052, copy of r201269, head/sys/ia64/ia64/bus_machdep.c) @@ -0,0 +1,356 @@ +/*- + * Copyright (c) 2009 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +extern u_long ia64_port_base; + +#define __PIO_ADDR(port) \ + (void *)(ia64_port_base | (((port) & 0xfffc) << 10) | ((port) & 0xFFF)) + +uint8_t +bus_space_read_io_1(u_long port) +{ + uint8_t v; + + ia64_mf(); + v = ia64_ld1(__PIO_ADDR(port)); + ia64_mf_a(); + ia64_mf(); + return (v); +} + +uint16_t +bus_space_read_io_2(u_long port) +{ + uint16_t v; + + ia64_mf(); + v = ia64_ld2(__PIO_ADDR(port)); + ia64_mf_a(); + ia64_mf(); + return (v); +} + +uint32_t +bus_space_read_io_4(u_long port) +{ + uint32_t v; + + ia64_mf(); + v = ia64_ld4(__PIO_ADDR(port)); + ia64_mf_a(); + ia64_mf(); + return (v); +} + +#if 0 +uint64_t +bus_space_read_io_8(u_long port) +{ +} +#endif + +void +bus_space_write_io_1(u_long port, uint8_t val) +{ + + ia64_mf(); + ia64_st1(__PIO_ADDR(port), val); + ia64_mf_a(); + ia64_mf(); +} + +void +bus_space_write_io_2(u_long port, uint16_t val) +{ + + ia64_mf(); + ia64_st2(__PIO_ADDR(port), val); + ia64_mf_a(); + ia64_mf(); +} + +void +bus_space_write_io_4(u_long port, uint32_t val) +{ + + ia64_mf(); + ia64_st4(__PIO_ADDR(port), val); + ia64_mf_a(); + ia64_mf(); +} + +#if 0 +void +bus_space_write_io_8(u_long port, uint64_t val) +{ +} +#endif + +void +bus_space_read_multi_io_1(u_long port, uint8_t *ptr, size_t count) +{ + + while (count-- > 0) + *ptr++ = bus_space_read_io_1(port); +} + +void +bus_space_read_multi_io_2(u_long port, uint16_t *ptr, size_t count) +{ + + while (count-- > 0) + *ptr++ = bus_space_read_io_2(port); +} + +void +bus_space_read_multi_io_4(u_long port, uint32_t *ptr, size_t count) +{ + + while (count-- > 0) + *ptr++ = bus_space_read_io_4(port); +} + +#if 0 +void +bus_space_read_multi_io_8(u_long port, uint64_t *ptr, size_t count) +{ +} +#endif + +void +bus_space_write_multi_io_1(u_long port, const uint8_t *ptr, size_t count) +{ + + while (count-- > 0) + bus_space_write_io_1(port, *ptr++); +} + +void +bus_space_write_multi_io_2(u_long port, const uint16_t *ptr, size_t count) +{ + + while (count-- > 0) + bus_space_write_io_2(port, *ptr++); +} + +void +bus_space_write_multi_io_4(u_long port, const uint32_t *ptr, size_t count) +{ + + while (count-- > 0) + bus_space_write_io_4(port, *ptr++); +} + +#if 0 +void +bus_space_write_multi_io_8(u_long port, const uint64_t *ptr, size_t count) +{ +} +#endif + +void +bus_space_read_region_io_1(u_long port, uint8_t *ptr, size_t count) +{ + + while (count-- > 0) { + *ptr++ = bus_space_read_io_1(port); + port += 1; + } +} + +void +bus_space_read_region_io_2(u_long port, uint16_t *ptr, size_t count) +{ + + while (count-- > 0) { + *ptr++ = bus_space_read_io_2(port); + port += 2; + } +} + +void +bus_space_read_region_io_4(u_long port, uint32_t *ptr, size_t count) +{ + + while (count-- > 0) { + *ptr++ = bus_space_read_io_4(port); + port += 4; + } +} + +#if 0 +void bus_space_read_region_io_8(u_long, uint64_t *, size_t); +#endif + +void +bus_space_write_region_io_1(u_long port, const uint8_t *ptr, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_1(port, *ptr++); + port += 1; + } +} + +void +bus_space_write_region_io_2(u_long port, const uint16_t *ptr, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_2(port, *ptr++); + port += 2; + } +} + +void +bus_space_write_region_io_4(u_long port, const uint32_t *ptr, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_4(port, *ptr++); + port += 4; + } +} + +#if 0 +void +bus_space_write_region_io_8(u_long port, const uint64_t *ptr, size_t count) +{ +} +#endif + +void +bus_space_set_region_io_1(u_long port, uint8_t val, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_1(port, val); + port += 1; + } +} + +void +bus_space_set_region_io_2(u_long port, uint16_t val, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_2(port, val); + port += 2; + } +} + +void +bus_space_set_region_io_4(u_long port, uint32_t val, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_4(port, val); + port += 4; + } +} + +#if 0 +void +bus_space_set_region_io_8(u_long port, uint64_t val, size_t count) +{ +} +#endif + +void +bus_space_copy_region_io_1(u_long src, u_long dst, size_t count) +{ + long delta; + uint8_t val; + + if (src < dst) { + src += count - 1; + dst += count - 1; + delta = -1; + } else + delta = 1; + + while (count-- > 0) { + val = bus_space_read_io_1(src); + bus_space_write_io_1(dst, val); + src += delta; + dst += delta; + } +} + +void +bus_space_copy_region_io_2(u_long src, u_long dst, size_t count) +{ + long delta; + uint16_t val; + + if (src < dst) { + src += 2 * (count - 1); + dst += 2 * (count - 1); + delta = -2; + } else + delta = 2; + + while (count-- > 0) { + val = bus_space_read_io_2(src); + bus_space_write_io_2(dst, val); + src += delta; + dst += delta; + } +} + +void +bus_space_copy_region_io_4(u_long src, u_long dst, size_t count) +{ + long delta; + uint32_t val; + + if (src < dst) { + src += 4 * (count - 1); + dst += 4 * (count - 1); + delta = -4; + } else + delta = 4; + + while (count-- > 0) { + val = bus_space_read_io_4(src); + bus_space_write_io_4(dst, val); + src += delta; + dst += delta; + } +} + +#if 0 +void +bus_space_copy_region_io_8(u_long src, u_long dst, size_t count) +{ +} +#endif Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Sun Jan 10 23:37:04 2010 (r202051) +++ stable/8/sys/ia64/ia64/machdep.c Sun Jan 10 23:51:02 2010 (r202052) @@ -930,16 +930,6 @@ ia64_init(void) return (ret); } -void * -ia64_ioport_address(u_int port) -{ - uint64_t addr; - - addr = (port > 0xffff) ? IA64_PHYS_TO_RR6((uint64_t)port) : - ia64_port_base | ((port & 0xfffc) << 10) | (port & 0xFFF); - return ((void *)addr); -} - uint64_t ia64_get_hcdp(void) { Modified: stable/8/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/mp_machdep.c Sun Jan 10 23:37:04 2010 (r202051) +++ stable/8/sys/ia64/ia64/mp_machdep.c Sun Jan 10 23:51:02 2010 (r202052) @@ -366,7 +366,7 @@ ipi_send(struct pcpu *cpu, int ipi) volatile uint64_t *pipi; uint64_t vector; - pipi = __MEMIO_ADDR(ia64_lapic_address | + pipi = (void *)IA64_PHYS_TO_RR6(ia64_lapic_address | ((cpu->pc_md.lid & LID_SAPIC_MASK) >> 12)); vector = (uint64_t)(ipi_vector[ipi] & 0xff); KASSERT(vector != 0, ("IPI %d is not assigned a vector", ipi)); Modified: stable/8/sys/ia64/ia64/nexus.c ============================================================================== --- stable/8/sys/ia64/ia64/nexus.c Sun Jan 10 23:37:04 2010 (r202051) +++ stable/8/sys/ia64/ia64/nexus.c Sun Jan 10 23:51:02 2010 (r202052) @@ -389,26 +389,23 @@ nexus_alloc_resource(device_t bus, devic static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) + struct resource *r) { - vm_paddr_t paddr, psize; + vm_paddr_t paddr; void *vaddr; - /* - * If this is a memory resource, map it into the kernel. - */ + paddr = rman_get_start(r); + switch (type) { case SYS_RES_IOPORT: rman_set_bustag(r, IA64_BUS_SPACE_IO); - rman_set_bushandle(r, rman_get_start(r)); + rman_set_bushandle(r, paddr); break; case SYS_RES_MEMORY: - paddr = rman_get_start(r); - psize = rman_get_size(r); - vaddr = pmap_mapdev(paddr, psize); - rman_set_virtual(r, vaddr); + vaddr = pmap_mapdev(paddr, rman_get_size(r)); rman_set_bustag(r, IA64_BUS_SPACE_MEM); - rman_set_bushandle(r, (bus_space_handle_t) paddr); + rman_set_bushandle(r, (bus_space_handle_t) vaddr); + rman_set_virtual(r, vaddr); break; } return (rman_activate_resource(r)); @@ -488,11 +485,27 @@ nexus_get_reslist(device_t dev, device_t } static int -nexus_set_resource(device_t dev, device_t child, int type, int rid, u_long start, u_long count) +nexus_set_resource(device_t dev, device_t child, int type, int rid, + u_long start, u_long count) { struct nexus_device *ndev = DEVTONX(child); struct resource_list *rl = &ndev->nx_resources; + if (type == SYS_RES_IOPORT && start > (0x10000 - count)) { + /* + * Work around a firmware bug in the HP rx2660, where in ACPI + * an I/O port is really a memory mapped I/O address. The bug + * is in the GAS that describes the address and in particular + * the SpaceId field. The field should not say the address is + * an I/O port when it is in fact an I/O memory address. + */ + if (bootverbose) + printf("%s: invalid port range (%#lx-%#lx); " + "assuming I/O memory range.\n", __func__, start, + start + count - 1); + type = SYS_RES_MEMORY; + } + /* XXX this should return a success/failure indicator */ resource_list_add(rl, type, rid, start, start + count - 1, count); return(0); Modified: stable/8/sys/ia64/ia64/sys_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/sys_machdep.c Sun Jan 10 23:37:04 2010 (r202051) +++ stable/8/sys/ia64/ia64/sys_machdep.c Sun Jan 10 23:51:02 2010 (r202052) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: stable/8/sys/ia64/include/bus.h ============================================================================== --- stable/8/sys/ia64/include/bus.h Sun Jan 10 23:37:04 2010 (r202051) +++ stable/8/sys/ia64/include/bus.h Sun Jan 10 23:51:02 2010 (r202052) @@ -1,3 +1,29 @@ +/*- + * Copyright (c) 2009 Marcel Moolenaar + * 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. + */ + /* $NetBSD: bus.h,v 1.12 1997/10/01 08:25:15 fvdl Exp $ */ /*- @@ -76,38 +102,49 @@ #include /* + * I/O port reads with ia32 semantics. + */ +#define inb bus_space_read_io_1 +#define inw bus_space_read_io_2 +#define inl bus_space_read_io_4 + +#define outb bus_space_write_io_1 +#define outw bus_space_write_io_2 +#define outl bus_space_write_io_4 + +/* * Values for the ia64 bus space tag, not to be used directly by MI code. */ #define IA64_BUS_SPACE_IO 0 /* space is i/o space */ #define IA64_BUS_SPACE_MEM 1 /* space is mem space */ +#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ +#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ + #define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF #define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF #define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFF #define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF #define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF -#define BUS_SPACE_MAXADDR 0xFFFFFFFF +#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFF #define BUS_SPACE_UNRESTRICTED (~0) + /* * Map a region of device bus space into CPU virtual address space. */ - -static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, - bus_size_t size, int flags, - bus_space_handle_t *bshp); - static __inline int -bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, - bus_space_handle_t *bshp) +bus_space_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size __unused, + int flags __unused, bus_space_handle_t *bshp) { - *bshp = addr; + *bshp = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? addr : IA64_PHYS_TO_RR6(addr); return (0); } + /* * Unmap a region of device bus space. */ @@ -123,7 +160,7 @@ bus_space_unmap(bus_space_tag_t bst __un */ static __inline int bus_space_subregion(bus_space_tag_t bst, bus_space_handle_t bsh, - bus_size_t ofs, bus_size_t size, bus_space_handle_t *nbshp) + bus_size_t ofs, bus_size_t size __unused, bus_space_handle_t *nbshp) { *nbshp = bsh + ofs; return (0); @@ -149,12 +186,9 @@ bus_space_free(bus_space_tag_t bst, bus_ /* * Bus read/write barrier method. */ -#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ -#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ - static __inline void -bus_space_barrier(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, - bus_size_t size, int flags) +bus_space_barrier(bus_space_tag_t bst __unused, bus_space_handle_t bsh __unused, + bus_size_t ofs __unused, bus_size_t size __unused, int flags __unused) { ia64_mf_a(); ia64_mf(); @@ -166,40 +200,53 @@ bus_space_barrier(bus_space_tag_t bst, b * tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The * data is returned. */ +uint8_t bus_space_read_io_1(u_long); +uint16_t bus_space_read_io_2(u_long); +uint32_t bus_space_read_io_4(u_long); +uint64_t bus_space_read_io_8(u_long); + static __inline uint8_t bus_space_read_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint8_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - return (ia64_ld1(bsp)); + uint8_t val; + + val = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? bus_space_read_io_1(bsh + ofs) + : ia64_ld1((void *)(bsh + ofs)); + return (val); } static __inline uint16_t bus_space_read_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint16_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - return (ia64_ld2(bsp)); + uint16_t val; + + val = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? bus_space_read_io_2(bsh + ofs) + : ia64_ld2((void *)(bsh + ofs)); + return (val); } static __inline uint32_t bus_space_read_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint32_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - return (ia64_ld4(bsp)); + uint32_t val; + + val = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? bus_space_read_io_4(bsh + ofs) + : ia64_ld4((void *)(bsh + ofs)); + return (val); } static __inline uint64_t bus_space_read_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint64_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - return (ia64_ld8(bsp)); + uint64_t val; + + val = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? bus_space_read_io_8(bsh + ofs) + : ia64_ld8((void *)(bsh + ofs)); + return (val); } @@ -208,44 +255,53 @@ bus_space_read_8(bus_space_tag_t bst, bu * tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The * data is passed by value. */ +void bus_space_write_io_1(u_long, uint8_t); +void bus_space_write_io_2(u_long, uint16_t); +void bus_space_write_io_4(u_long, uint32_t); +void bus_space_write_io_8(u_long, uint64_t); + static __inline void bus_space_write_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) { - uint8_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - ia64_st1(bsp, val); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_io_1(bsh + ofs, val); + else + ia64_st1((void *)(bsh + ofs), val); } static __inline void bus_space_write_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) { - uint16_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - ia64_st2(bsp, val); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_io_2(bsh + ofs, val); + else + ia64_st2((void *)(bsh + ofs), val); } static __inline void bus_space_write_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val) { - uint32_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - ia64_st4(bsp, val); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_io_4(bsh + ofs, val); + else + ia64_st4((void *)(bsh + ofs), val); } static __inline void bus_space_write_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) { - uint64_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - ia64_st8(bsp, val); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_io_8(bsh + ofs, val); + else + ia64_st8((void *)(bsh + ofs), val); } @@ -254,48 +310,61 @@ bus_space_write_8(bus_space_tag_t bst, b * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The * data is returned in the buffer passed by reference. */ +void bus_space_read_multi_io_1(u_long, uint8_t *, size_t); +void bus_space_read_multi_io_2(u_long, uint16_t *, size_t); +void bus_space_read_multi_io_4(u_long, uint32_t *, size_t); +void bus_space_read_multi_io_8(u_long, uint64_t *, size_t); + static __inline void bus_space_read_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - uint8_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - *bufp++ = ia64_ld1(bsp); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_multi_io_1(bsh + ofs, bufp, count); + else { + while (count-- > 0) + *bufp++ = ia64_ld1((void *)(bsh + ofs)); + } } static __inline void bus_space_read_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - uint16_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - *bufp++ = ia64_ld2(bsp); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_multi_io_2(bsh + ofs, bufp, count); + else { + while (count-- > 0) + *bufp++ = ia64_ld2((void *)(bsh + ofs)); + } } static __inline void bus_space_read_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - uint32_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - *bufp++ = ia64_ld4(bsp); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_multi_io_4(bsh + ofs, bufp, count); + else { + while (count-- > 0) + *bufp++ = ia64_ld4((void *)(bsh + ofs)); + } } static __inline void bus_space_read_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - uint64_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - *bufp++ = ia64_ld8(bsp); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_multi_io_8(bsh + ofs, bufp, count); + else { + while (count-- > 0) + *bufp++ = ia64_ld8((void *)(bsh + ofs)); + } } @@ -304,48 +373,61 @@ bus_space_read_multi_8(bus_space_tag_t b * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The * data is read from the buffer passed by reference. */ +void bus_space_write_multi_io_1(u_long, const uint8_t *, size_t); +void bus_space_write_multi_io_2(u_long, const uint16_t *, size_t); +void bus_space_write_multi_io_4(u_long, const uint32_t *, size_t); +void bus_space_write_multi_io_8(u_long, const uint64_t *, size_t); + static __inline void bus_space_write_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - uint8_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - ia64_st1(bsp, *bufp++); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_multi_io_1(bsh + ofs, bufp, count); + else { + while (count-- > 0) + ia64_st1((void *)(bsh + ofs), *bufp++); + } } static __inline void bus_space_write_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - uint16_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - ia64_st2(bsp, *bufp++); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_multi_io_2(bsh + ofs, bufp, count); + else { + while (count-- > 0) + ia64_st2((void *)(bsh + ofs), *bufp++); + } } static __inline void bus_space_write_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - uint32_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - ia64_st4(bsp, *bufp++); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_multi_io_4(bsh + ofs, bufp, count); + else { + while (count-- > 0) + ia64_st4((void *)(bsh + ofs), *bufp++); + } } static __inline void bus_space_write_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - uint64_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - ia64_st8(bsp, *bufp++); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_multi_io_8(bsh + ofs, bufp, count); + else { + while (count-- > 0) + ia64_st8((void *)(bsh + ofs), *bufp++); + } } @@ -355,16 +437,22 @@ bus_space_write_multi_8(bus_space_tag_t * data is written to the buffer passed by reference and read from successive * bus space addresses. Access is unordered. */ +void bus_space_read_region_io_1(u_long, uint8_t *, size_t); +void bus_space_read_region_io_2(u_long, uint16_t *, size_t); +void bus_space_read_region_io_4(u_long, uint32_t *, size_t); +void bus_space_read_region_io_8(u_long, uint64_t *, size_t); + static __inline void bus_space_read_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - uint8_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - *bufp++ = ia64_ld1(bsp); - ofs += 1; + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_region_io_1(bsh + ofs, bufp, count); + else { + uint8_t *bsp = (void *)(bsh + ofs); + while (count-- > 0) + *bufp++ = ia64_ld1(bsp++); } } @@ -372,12 +460,13 @@ static __inline void bus_space_read_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - uint16_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - *bufp++ = ia64_ld2(bsp); - ofs += 2; + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_region_io_2(bsh + ofs, bufp, count); + else { + uint16_t *bsp = (void *)(bsh + ofs); + while (count-- > 0) + *bufp++ = ia64_ld2(bsp++); } } @@ -385,12 +474,13 @@ static __inline void bus_space_read_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - uint32_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - *bufp++ = ia64_ld4(bsp); - ofs += 4; + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_region_io_4(bsh + ofs, bufp, count); + else { + uint32_t *bsp = (void *)(bsh + ofs); + while (count-- > 0) + *bufp++ = ia64_ld4(bsp++); } } @@ -398,12 +488,13 @@ static __inline void bus_space_read_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - uint64_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - *bufp++ = ia64_ld8(bsp); - ofs += 8; + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_region_io_8(bsh + ofs, bufp, count); + else { + uint64_t *bsp = (void *)(bsh + ofs); + while (count-- > 0) + *bufp++ = ia64_ld8(bsp++); } } @@ -414,16 +505,22 @@ bus_space_read_region_8(bus_space_tag_t * data is read from the buffer passed by reference and written to successive * bus space addresses. Access is unordered. */ +void bus_space_write_region_io_1(u_long, const uint8_t *, size_t); +void bus_space_write_region_io_2(u_long, const uint16_t *, size_t); +void bus_space_write_region_io_4(u_long, const uint32_t *, size_t); +void bus_space_write_region_io_8(u_long, const uint64_t *, size_t); + static __inline void bus_space_write_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - uint8_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 02:31:00 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE5BC1065670; Mon, 11 Jan 2010 02:31:00 +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 B8F2D8FC12; Mon, 11 Jan 2010 02:31: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 o0B2V0Oe019541; Mon, 11 Jan 2010 02:31:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B2V0Bm019533; Mon, 11 Jan 2010 02:31:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001110231.o0B2V0Bm019533@svn.freebsd.org> From: Xin LI Date: Mon, 11 Jan 2010 02:31: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: r202059 - in stable/8: cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opens... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 02:31:00 -0000 Author: delphij Date: Mon Jan 11 02:31:00 2010 New Revision: 202059 URL: http://svn.freebsd.org/changeset/base/202059 Log: MFC r201143: Apply OpenSolaris revision 8021:b8fe9660eb2d which brings our zpool to version 14, making it possible for zpools created on OpenSolaris 2009.06 be used on FreeBSD. PR: kern/141800 Submitted by: mm Reviewed by: pjd, trasz Obtained from: OpenSolaris onnv-gate Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/8/sys/cddl/boot/zfs/zfsimpl.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: 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/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) Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jan 11 00:51:25 2010 (r202058) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jan 11 02:31:00 2010 (r202059) @@ -3488,6 +3488,8 @@ zpool_do_upgrade(int argc, char **argv) (void) printf(gettext(" 11 Improved scrub performance\n")); (void) printf(gettext(" 12 Snapshot properties\n")); (void) printf(gettext(" 13 snapused property\n")); + (void) printf(gettext(" 14 passthrough-x aclinherit " + "support\n")); (void) printf(gettext("For more information on a particular " "version, including supported releases, see:\n\n")); (void) printf("http://www.opensolaris.org/os/community/zfs/" Modified: stable/8/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- stable/8/sys/cddl/boot/zfs/zfsimpl.h Mon Jan 11 00:51:25 2010 (r202058) +++ stable/8/sys/cddl/boot/zfs/zfsimpl.h Mon Jan 11 02:31:00 2010 (r202059) @@ -479,13 +479,14 @@ typedef enum { #define SPA_VERSION_11 11ULL #define SPA_VERSION_12 12ULL #define SPA_VERSION_13 13ULL +#define SPA_VERSION_14 14ULL /* * When bumping up SPA_VERSION, make sure GRUB ZFS understand the on-disk * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*}, * and do the appropriate changes. */ -#define SPA_VERSION SPA_VERSION_13 -#define SPA_VERSION_STRING "13" +#define SPA_VERSION SPA_VERSION_14 +#define SPA_VERSION_STRING "14" /* * Symbolic names for the changes that caused a SPA_VERSION switch. @@ -520,6 +521,7 @@ typedef enum { #define SPA_VERSION_DSL_SCRUB SPA_VERSION_11 #define SPA_VERSION_SNAP_PROPS SPA_VERSION_12 #define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13 +#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14 /* * The following are configuration names used in the nvlist describing a pool's Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Jan 11 00:51:25 2010 (r202058) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Jan 11 02:31:00 2010 (r202059) @@ -97,6 +97,7 @@ zfs_prop_init(void) { "restricted", ZFS_ACL_RESTRICTED }, { "passthrough", ZFS_ACL_PASSTHROUGH }, { "secure", ZFS_ACL_RESTRICTED }, /* bkwrd compatability */ + { "passthrough-x", ZFS_ACL_PASSTHROUGH_X }, { NULL } }; @@ -173,7 +174,7 @@ zfs_prop_init(void) "discard | groupmask | passthrough", "ACLMODE", acl_mode_table); register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, - "discard | noallow | restricted | passthrough", + "discard | noallow | restricted | passthrough | passthrough-x", "ACLINHERIT", acl_inherit_table); register_index(ZFS_PROP_COPIES, "copies", 1, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Mon Jan 11 00:51:25 2010 (r202058) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Mon Jan 11 02:31:00 2010 (r202059) @@ -26,8 +26,6 @@ #ifndef _SYS_FS_ZFS_ACL_H #define _SYS_FS_ZFS_ACL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef _KERNEL #include #endif @@ -180,6 +178,7 @@ typedef struct zfs_acl { #define ZFS_ACL_GROUPMASK 2 #define ZFS_ACL_PASSTHROUGH 3 #define ZFS_ACL_RESTRICTED 4 +#define ZFS_ACL_PASSTHROUGH_X 5 struct znode; struct zfsvfs; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Jan 11 00:51:25 2010 (r202058) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Jan 11 02:31:00 2010 (r202059) @@ -1663,7 +1663,8 @@ zfs_ace_can_use(znode_t *zp, uint16_t ac * inherit inheritable ACEs from parent */ static zfs_acl_t * -zfs_acl_inherit(znode_t *zp, zfs_acl_t *paclp, boolean_t *need_chmod) +zfs_acl_inherit(znode_t *zp, zfs_acl_t *paclp, uint64_t mode, + boolean_t *need_chmod) { zfsvfs_t *zfsvfs = zp->z_zfsvfs; void *pacep; @@ -1676,112 +1677,123 @@ zfs_acl_inherit(znode_t *zp, zfs_acl_t * size_t ace_size; void *data1, *data2; size_t data1sz, data2sz; - enum vtype vntype = ZTOV(zp)->v_type; + boolean_t vdir = ZTOV(zp)->v_type == VDIR; + boolean_t vreg = ZTOV(zp)->v_type == VREG; + boolean_t passthrough, passthrough_x, noallow; + + passthrough_x = + zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH_X; + passthrough = passthrough_x || + zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH; + noallow = + zfsvfs->z_acl_inherit == ZFS_ACL_NOALLOW; *need_chmod = B_TRUE; pacep = NULL; aclp = zfs_acl_alloc(paclp->z_version); - if (zfsvfs->z_acl_inherit != ZFS_ACL_DISCARD) { - while (pacep = zfs_acl_next_ace(paclp, pacep, &who, - &access_mask, &iflags, &type)) { + if (zfsvfs->z_acl_inherit == ZFS_ACL_DISCARD) + return (aclp); + while (pacep = zfs_acl_next_ace(paclp, pacep, &who, + &access_mask, &iflags, &type)) { - /* - * don't inherit bogus ACEs - */ - if (!zfs_acl_valid_ace_type(type, iflags)) - continue; + /* + * don't inherit bogus ACEs + */ + if (!zfs_acl_valid_ace_type(type, iflags)) + continue; - if (zfsvfs->z_acl_inherit == ZFS_ACL_NOALLOW && - type == ALLOW) - continue; + if (noallow && type == ALLOW) + continue; - ace_size = aclp->z_ops.ace_size(pacep); + ace_size = aclp->z_ops.ace_size(pacep); - if (!zfs_ace_can_use(zp, iflags)) - continue; + if (!zfs_ace_can_use(zp, iflags)) + continue; - /* - * If owner@, group@, or everyone@ inheritable - * then zfs_acl_chmod() isn't needed. - */ - if (zfsvfs->z_acl_inherit == - ZFS_ACL_PASSTHROUGH && - ((iflags & (ACE_OWNER|ACE_EVERYONE)) || - ((iflags & OWNING_GROUP) == - OWNING_GROUP)) && (vntype == VREG || - (vntype == VDIR && - (iflags & ACE_DIRECTORY_INHERIT_ACE)))) - *need_chmod = B_FALSE; - - aclnode = zfs_acl_node_alloc(ace_size); - list_insert_tail(&aclp->z_acl, aclnode); - acep = aclnode->z_acldata; - zfs_set_ace(aclp, acep, access_mask, type, - who, iflags|ACE_INHERITED_ACE); + /* + * If owner@, group@, or everyone@ inheritable + * then zfs_acl_chmod() isn't needed. + */ + if (passthrough && + ((iflags & (ACE_OWNER|ACE_EVERYONE)) || + ((iflags & OWNING_GROUP) == + OWNING_GROUP)) && (vreg || (vdir && (iflags & + ACE_DIRECTORY_INHERIT_ACE)))) { + *need_chmod = B_FALSE; + + if (!vdir && passthrough_x && + ((mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)) { + access_mask &= ~ACE_EXECUTE; + } + } + + aclnode = zfs_acl_node_alloc(ace_size); + list_insert_tail(&aclp->z_acl, aclnode); + acep = aclnode->z_acldata; + + zfs_set_ace(aclp, acep, access_mask, type, + who, iflags|ACE_INHERITED_ACE); + + /* + * Copy special opaque data if any + */ + if ((data1sz = paclp->z_ops.ace_data(pacep, &data1)) != 0) { + VERIFY((data2sz = aclp->z_ops.ace_data(acep, + &data2)) == data1sz); + bcopy(data1, data2, data2sz); + } + aclp->z_acl_count++; + aclnode->z_ace_count++; + aclp->z_acl_bytes += aclnode->z_size; + newflags = aclp->z_ops.ace_flags_get(acep); + + if (vdir) + aclp->z_hints |= ZFS_INHERIT_ACE; + + if ((iflags & ACE_NO_PROPAGATE_INHERIT_ACE) || !vdir) { + newflags &= ~ALL_INHERIT; + aclp->z_ops.ace_flags_set(acep, + newflags|ACE_INHERITED_ACE); + zfs_restricted_update(zfsvfs, aclp, acep); + continue; + } + + ASSERT(vdir); + + newflags = aclp->z_ops.ace_flags_get(acep); + if ((iflags & (ACE_FILE_INHERIT_ACE | + ACE_DIRECTORY_INHERIT_ACE)) != + ACE_FILE_INHERIT_ACE) { + aclnode2 = zfs_acl_node_alloc(ace_size); + list_insert_tail(&aclp->z_acl, aclnode2); + acep2 = aclnode2->z_acldata; + zfs_set_ace(aclp, acep2, + access_mask, type, who, + iflags|ACE_INHERITED_ACE); + newflags |= ACE_INHERIT_ONLY_ACE; + aclp->z_ops.ace_flags_set(acep, newflags); + newflags &= ~ALL_INHERIT; + aclp->z_ops.ace_flags_set(acep2, + newflags|ACE_INHERITED_ACE); /* * Copy special opaque data if any */ - if ((data1sz = paclp->z_ops.ace_data(pacep, + if ((data1sz = aclp->z_ops.ace_data(acep, &data1)) != 0) { - VERIFY((data2sz = aclp->z_ops.ace_data(acep, + VERIFY((data2sz = + aclp->z_ops.ace_data(acep2, &data2)) == data1sz); - bcopy(data1, data2, data2sz); + bcopy(data1, data2, data1sz); } aclp->z_acl_count++; - aclnode->z_ace_count++; + aclnode2->z_ace_count++; aclp->z_acl_bytes += aclnode->z_size; - newflags = aclp->z_ops.ace_flags_get(acep); - - if (vntype == VDIR) - aclp->z_hints |= ZFS_INHERIT_ACE; - - if ((iflags & ACE_NO_PROPAGATE_INHERIT_ACE) || - (vntype != VDIR)) { - newflags &= ~ALL_INHERIT; - aclp->z_ops.ace_flags_set(acep, - newflags|ACE_INHERITED_ACE); - zfs_restricted_update(zfsvfs, aclp, acep); - continue; - } - - ASSERT(vntype == VDIR); - - newflags = aclp->z_ops.ace_flags_get(acep); - if ((iflags & (ACE_FILE_INHERIT_ACE | - ACE_DIRECTORY_INHERIT_ACE)) != - ACE_FILE_INHERIT_ACE) { - aclnode2 = zfs_acl_node_alloc(ace_size); - list_insert_tail(&aclp->z_acl, aclnode2); - acep2 = aclnode2->z_acldata; - zfs_set_ace(aclp, acep2, - access_mask, type, who, - iflags|ACE_INHERITED_ACE); - newflags |= ACE_INHERIT_ONLY_ACE; - aclp->z_ops.ace_flags_set(acep, newflags); - newflags &= ~ALL_INHERIT; - aclp->z_ops.ace_flags_set(acep2, - newflags|ACE_INHERITED_ACE); - - /* - * Copy special opaque data if any - */ - if ((data1sz = aclp->z_ops.ace_data(acep, - &data1)) != 0) { - VERIFY((data2sz = - aclp->z_ops.ace_data(acep2, - &data2)) == data1sz); - bcopy(data1, data2, data1sz); - } - aclp->z_acl_count++; - aclnode2->z_ace_count++; - aclp->z_acl_bytes += aclnode->z_size; - zfs_restricted_update(zfsvfs, aclp, acep2); - } else { - newflags |= ACE_INHERIT_ONLY_ACE; - aclp->z_ops.ace_flags_set(acep, - newflags|ACE_INHERITED_ACE); - } + zfs_restricted_update(zfsvfs, aclp, acep2); + } else { + newflags |= ACE_INHERIT_ONLY_ACE; + aclp->z_ops.ace_flags_set(acep, + newflags|ACE_INHERITED_ACE); } } return (aclp); @@ -1876,7 +1888,7 @@ zfs_perm_init(znode_t *zp, znode_t *pare mutex_enter(&parent->z_acl_lock); VERIFY(0 == zfs_acl_node_read(parent, &paclp, B_FALSE)); mutex_exit(&parent->z_acl_lock); - aclp = zfs_acl_inherit(zp, paclp, &need_chmod); + aclp = zfs_acl_inherit(zp, paclp, mode, &need_chmod); zfs_acl_free(paclp); } else { aclp = zfs_acl_alloc(zfs_acl_version_zp(zp)); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Jan 11 00:51:25 2010 (r202058) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Jan 11 02:31:00 2010 (r202059) @@ -1491,6 +1491,14 @@ zfs_set_prop_nvlist(const char *name, nv if (zpl_earlier_version(name, ZPL_VERSION_FUID)) return (ENOTSUP); break; + + case ZFS_PROP_ACLINHERIT: + if (nvpair_type(elem) == DATA_TYPE_UINT64 && + nvpair_value_uint64(elem, &intval) == 0) + if (intval == ZFS_ACL_PASSTHROUGH_X && + zfs_earlier_version(name, + SPA_VERSION_PASSTHROUGH_X)) + return (ENOTSUP); } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Jan 11 00:51:25 2010 (r202058) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Jan 11 02:31:00 2010 (r202059) @@ -253,13 +253,14 @@ typedef enum zfs_cache_type { #define SPA_VERSION_11 11ULL #define SPA_VERSION_12 12ULL #define SPA_VERSION_13 13ULL +#define SPA_VERSION_14 14ULL /* * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*}, * and do the appropriate changes. */ -#define SPA_VERSION SPA_VERSION_13 -#define SPA_VERSION_STRING "13" +#define SPA_VERSION SPA_VERSION_14 +#define SPA_VERSION_STRING "14" /* * Symbolic names for the changes that caused a SPA_VERSION switch. @@ -294,6 +295,7 @@ typedef enum zfs_cache_type { #define SPA_VERSION_DSL_SCRUB SPA_VERSION_11 #define SPA_VERSION_SNAP_PROPS SPA_VERSION_12 #define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13 +#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14 /* * ZPL version - rev'd whenever an incompatible on-disk format change From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 03:03:54 2010 Return-Path: Delivered-To: svn-src-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6DE71065670; Mon, 11 Jan 2010 03:03:54 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 81FD58FC0A; Mon, 11 Jan 2010 03:03:54 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id BD769A563EF; Mon, 11 Jan 2010 11:03:52 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id 0AtsvO5RSG+S; Mon, 11 Jan 2010 11:03:38 +0800 (CST) Received: from delta.delphij.net (c-69-181-136-105.hsd1.ca.comcast.net [69.181.136.105]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id BAC5CA563C2; Mon, 11 Jan 2010 11:03:36 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=VI67KHstWw4xmagTb95NJO65MyEQTm1/6wHvlXn+dsIPumKO4+wN5MHJcNQ11u0SZ QsT4MoVfob/8tfjlz/l2Q== Message-ID: <4B4A94FF.2070000@delphij.net> Date: Sun, 10 Jan 2010 19:03:27 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20091220 Thunderbird/3.0 ThunderBrowse/3.2.6.8 MIME-Version: 1.0 To: Xin LI References: <201001110231.o0B2V0Bm019533@svn.freebsd.org> In-Reply-To: <201001110231.o0B2V0Bm019533@svn.freebsd.org> X-Enigmail-Version: 1.0 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: r202059 - in stable/8: cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opens... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 03:03:55 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010/01/10 18:31, Xin LI wrote: > Author: delphij > Date: Mon Jan 11 02:31:00 2010 > New Revision: 202059 > URL: http://svn.freebsd.org/changeset/base/202059 > > Log: > MFC r201143: > > Apply OpenSolaris revision 8021:b8fe9660eb2d which brings our zpool > to version 14, making it possible for zpools created on OpenSolaris > 2009.06 be used on FreeBSD. Oh my... This should be 8053:271f44d3de11. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBAgAGBQJLSpT/AAoJEATO+BI/yjfBUEYH/0RbeYvoAaJJCWj9tDQjGsFf BNnZVkYTF9D2FjdUvSMF5xTGjVP1P9Tu9jfHjZUAw0LlVv03u7FtPEhuS1lPTQzz y82MpsqfJnzgGlqivP5BHOOcVMSzRR2vRxq3Ay4dHl5XGxq7pNK9w+49roTTjGeB fA6Gyhp6QGpDl/lnpydb+0oXL0ojEQcCfUgHQEAwGW3iW72igB3yhVw3PTzdRur4 11ifeu4C89WPVvSQhqw1AdQEmnZSuQ0LdF+5qBi7piKMmkU2I9szTqFgyUpBoT54 do8LkIvvHwSfclLaUusa8QdnHSFqB2lLzT4uzbMQQ4EKvXbanflR28XPeOw+TRg= =p+ve -----END PGP SIGNATURE----- From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 05:19:52 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19962106566C; Mon, 11 Jan 2010 05:19:52 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F22338FC14; Mon, 11 Jan 2010 05:19: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 o0B5Jp63060800; Mon, 11 Jan 2010 05:19:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B5Jpvw060795; Mon, 11 Jan 2010 05:19:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001110519.o0B5Jpvw060795@svn.freebsd.org> From: Christian Brueffer Date: Mon, 11 Jan 2010 05:19:51 +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: r202068 - in stable/8/share/man: man7 man9 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 05:19:52 -0000 Author: brueffer Date: Mon Jan 11 05:19:51 2010 New Revision: 202068 URL: http://svn.freebsd.org/changeset/base/202068 Log: MFC: r201538, r201539 Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened almost three years ago in r166794. Add a missing word. Modified: stable/8/share/man/man7/security.7 stable/8/share/man/man9/VFS.9 stable/8/share/man/man9/VFS_CHECKEXP.9 stable/8/share/man/man9/VFS_FHTOVP.9 Directory Properties: stable/8/share/man/man7/ (props changed) stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man7/security.7 ============================================================================== --- stable/8/share/man/man7/security.7 Mon Jan 11 05:05:28 2010 (r202067) +++ stable/8/share/man/man7/security.7 Mon Jan 11 05:19:51 2010 (r202068) @@ -88,7 +88,7 @@ incur on the system under adverse condit Brute-force network attacks are harder to deal with. A spoofed-packet attack, for example, is nearly impossible to stop short of cutting your system off from the Internet. -It may not be able to take your machine down, but it can fill up Internet +It may not be able to take your machine down, but it can fill up your Internet pipe. .Pp A user account compromise is even more common than a DoS attack. Modified: stable/8/share/man/man9/VFS.9 ============================================================================== --- stable/8/share/man/man9/VFS.9 Mon Jan 11 05:05:28 2010 (r202067) +++ stable/8/share/man/man9/VFS.9 Mon Jan 11 05:19:51 2010 (r202068) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd January 4, 2010 .Os .Dt VFS 9 .Sh NAME @@ -53,7 +53,7 @@ rather than implementing empty functions .Xr VFS_SYNC 9 , .Xr VFS_UNMOUNT 9 , .Xr VFS_VGET 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by Modified: stable/8/share/man/man9/VFS_CHECKEXP.9 ============================================================================== --- stable/8/share/man/man9/VFS_CHECKEXP.9 Mon Jan 11 05:05:28 2010 (r202067) +++ stable/8/share/man/man9/VFS_CHECKEXP.9 Mon Jan 11 05:19:51 2010 (r202068) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd January 4, 2010 .Os .Dt VFS_CHECKEXP 9 .Sh NAME @@ -81,7 +81,7 @@ and .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_FHTOVP 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by Modified: stable/8/share/man/man9/VFS_FHTOVP.9 ============================================================================== --- stable/8/share/man/man9/VFS_FHTOVP.9 Mon Jan 11 05:05:28 2010 (r202067) +++ stable/8/share/man/man9/VFS_FHTOVP.9 Mon Jan 11 05:19:51 2010 (r202068) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd January 4, 2010 .Os .Dt VFS_FHTOVP 9 .Sh NAME @@ -76,7 +76,7 @@ The locked vnode for the file will be re .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_CHECKEXP 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 05:26:19 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 192DA106568D; Mon, 11 Jan 2010 05:26:19 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F16408FC16; Mon, 11 Jan 2010 05:26:18 +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 o0B5QIHW062288; Mon, 11 Jan 2010 05:26:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B5QI4a062283; Mon, 11 Jan 2010 05:26:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001110526.o0B5QI4a062283@svn.freebsd.org> From: Christian Brueffer Date: Mon, 11 Jan 2010 05:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202069 - in stable/7/share/man: man7 man9 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 05:26:19 -0000 Author: brueffer Date: Mon Jan 11 05:26:18 2010 New Revision: 202069 URL: http://svn.freebsd.org/changeset/base/202069 Log: MFC: r201538, r201539 Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened almost three years ago in r166794. Add a missing word. Modified: stable/7/share/man/man7/security.7 stable/7/share/man/man9/VFS.9 stable/7/share/man/man9/VFS_CHECKEXP.9 stable/7/share/man/man9/VFS_FHTOVP.9 Directory Properties: stable/7/share/man/man7/ (props changed) stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man7/security.7 ============================================================================== --- stable/7/share/man/man7/security.7 Mon Jan 11 05:19:51 2010 (r202068) +++ stable/7/share/man/man7/security.7 Mon Jan 11 05:26:18 2010 (r202069) @@ -88,7 +88,7 @@ incur on the system under adverse condit Brute-force network attacks are harder to deal with. A spoofed-packet attack, for example, is nearly impossible to stop short of cutting your system off from the Internet. -It may not be able to take your machine down, but it can fill up Internet +It may not be able to take your machine down, but it can fill up your Internet pipe. .Pp A user account compromise is even more common than a DoS attack. Modified: stable/7/share/man/man9/VFS.9 ============================================================================== --- stable/7/share/man/man9/VFS.9 Mon Jan 11 05:19:51 2010 (r202068) +++ stable/7/share/man/man9/VFS.9 Mon Jan 11 05:26:18 2010 (r202069) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd January 4, 2010 .Os .Dt VFS 9 .Sh NAME @@ -53,7 +53,7 @@ rather than implementing empty functions .Xr VFS_SYNC 9 , .Xr VFS_UNMOUNT 9 , .Xr VFS_VGET 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by Modified: stable/7/share/man/man9/VFS_CHECKEXP.9 ============================================================================== --- stable/7/share/man/man9/VFS_CHECKEXP.9 Mon Jan 11 05:19:51 2010 (r202068) +++ stable/7/share/man/man9/VFS_CHECKEXP.9 Mon Jan 11 05:26:18 2010 (r202069) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd January 4, 2010 .Os .Dt VFS_CHECKEXP 9 .Sh NAME @@ -81,7 +81,7 @@ and .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_FHTOVP 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by Modified: stable/7/share/man/man9/VFS_FHTOVP.9 ============================================================================== --- stable/7/share/man/man9/VFS_FHTOVP.9 Mon Jan 11 05:19:51 2010 (r202068) +++ stable/7/share/man/man9/VFS_FHTOVP.9 Mon Jan 11 05:26:18 2010 (r202069) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd January 4, 2010 .Os .Dt VFS_FHTOVP 9 .Sh NAME @@ -76,7 +76,7 @@ The locked vnode for the file will be re .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_CHECKEXP 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 12:32:06 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BDB81065679; Mon, 11 Jan 2010 12:32:06 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AEF68FC15; Mon, 11 Jan 2010 12:32: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 o0BCW6GX060810; Mon, 11 Jan 2010 12:32:06 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BCW6P9060807; Mon, 11 Jan 2010 12:32:06 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001111232.o0BCW6P9060807@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 11 Jan 2010 12:32:06 +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: r202081 - in stable/8: share/man/man4 sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 12:32:06 -0000 Author: ru Date: Mon Jan 11 12:32:06 2010 New Revision: 202081 URL: http://svn.freebsd.org/changeset/base/202081 Log: MFC: r200026,201801: Swap carp(4) log levels. Modified: stable/8/share/man/man4/carp.4 stable/8/sys/netinet/ip_carp.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (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) Modified: stable/8/share/man/man4/carp.4 ============================================================================== --- stable/8/share/man/man4/carp.4 Mon Jan 11 12:31:36 2010 (r202080) +++ stable/8/share/man/man4/carp.4 Mon Jan 11 12:32:06 2010 (r202081) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2006 +.Dd January 5, 2010 .Dt CARP 4 .Os .Sh NAME @@ -118,12 +118,12 @@ See also the first example. Disabled by default. .It Va net.inet.carp.log Value of 0 disables any logging. -Value of 1 enables logging of bad -.Nm -packets. -Values above 1 enable logging state changes of +Value of 1 enables logging state changes of .Nm interfaces. +Values above 1 enable logging of bad +.Nm +packets. Default value is 1. .It Va net.inet.carp.arpbalance Balance local traffic using ARP (see below). Modified: stable/8/sys/netinet/ip_carp.c ============================================================================== --- stable/8/sys/netinet/ip_carp.c Mon Jan 11 12:31:36 2010 (r202080) +++ stable/8/sys/netinet/ip_carp.c Mon Jan 11 12:32:06 2010 (r202081) @@ -550,7 +550,7 @@ carp_input(struct mbuf *m, int hlen) /* check if received on a valid carp interface */ if (m->m_pkthdr.rcvif->if_carp == NULL) { CARPSTATS_INC(carps_badif); - CARP_LOG("carp_input: packet received on non-carp " + CARP_DEBUG("carp_input: packet received on non-carp " "interface: %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -560,7 +560,7 @@ carp_input(struct mbuf *m, int hlen) /* verify that the IP TTL is 255. */ if (ip->ip_ttl != CARP_DFLTTL) { CARPSTATS_INC(carps_badttl); - CARP_LOG("carp_input: received ttl %d != 255i on %s\n", + CARP_DEBUG("carp_input: received ttl %d != 255 on %s\n", ip->ip_ttl, m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -571,7 +571,7 @@ carp_input(struct mbuf *m, int hlen) if (m->m_pkthdr.len < iplen + sizeof(*ch)) { CARPSTATS_INC(carps_badlen); - CARP_LOG("carp_input: received len %zd < " + CARP_DEBUG("carp_input: received len %zd < " "sizeof(struct carp_header) on %s\n", m->m_len - sizeof(struct ip), m->m_pkthdr.rcvif->if_xname); @@ -582,7 +582,7 @@ carp_input(struct mbuf *m, int hlen) if (iplen + sizeof(*ch) < m->m_len) { if ((m = m_pullup(m, iplen + sizeof(*ch))) == NULL) { CARPSTATS_INC(carps_hdrops); - CARP_LOG("carp_input: pullup failed\n"); + CARP_DEBUG("carp_input: pullup failed\n"); return; } ip = mtod(m, struct ip *); @@ -596,7 +596,7 @@ carp_input(struct mbuf *m, int hlen) len = iplen + sizeof(*ch); if (len > m->m_pkthdr.len) { CARPSTATS_INC(carps_badlen); - CARP_LOG("carp_input: packet too short %d on %s\n", + CARP_DEBUG("carp_input: packet too short %d on %s\n", m->m_pkthdr.len, m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -614,7 +614,7 @@ carp_input(struct mbuf *m, int hlen) m->m_data += iplen; if (carp_cksum(m, len - iplen)) { CARPSTATS_INC(carps_badsum); - CARP_LOG("carp_input: checksum failed on %s\n", + CARP_DEBUG("carp_input: checksum failed on %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); return; @@ -643,7 +643,7 @@ carp6_input(struct mbuf **mp, int *offp, /* check if received on a valid carp interface */ if (m->m_pkthdr.rcvif->if_carp == NULL) { CARPSTATS_INC(carps_badif); - CARP_LOG("carp6_input: packet received on non-carp " + CARP_DEBUG("carp6_input: packet received on non-carp " "interface: %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -653,7 +653,7 @@ carp6_input(struct mbuf **mp, int *offp, /* verify that the IP TTL is 255 */ if (ip6->ip6_hlim != CARP_DFLTTL) { CARPSTATS_INC(carps_badttl); - CARP_LOG("carp6_input: received ttl %d != 255 on %s\n", + CARP_DEBUG("carp6_input: received ttl %d != 255 on %s\n", ip6->ip6_hlim, m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -665,7 +665,7 @@ carp6_input(struct mbuf **mp, int *offp, IP6_EXTHDR_GET(ch, struct carp_header *, m, *offp, sizeof(*ch)); if (ch == NULL) { CARPSTATS_INC(carps_badlen); - CARP_LOG("carp6_input: packet size %u too small\n", len); + CARP_DEBUG("carp6_input: packet size %u too small\n", len); return (IPPROTO_DONE); } @@ -674,7 +674,7 @@ carp6_input(struct mbuf **mp, int *offp, m->m_data += *offp; if (carp_cksum(m, sizeof(*ch))) { CARPSTATS_INC(carps_badsum); - CARP_LOG("carp6_input: checksum failed, on %s\n", + CARP_DEBUG("carp6_input: checksum failed, on %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); return (IPPROTO_DONE); @@ -727,7 +727,7 @@ carp_input_c(struct mbuf *m, struct carp CARPSTATS_INC(carps_badver); SC2IFP(sc)->if_ierrors++; CARP_UNLOCK(ifp->if_carp); - CARP_LOG("%s; invalid version %d\n", + CARP_DEBUG("%s; invalid version %d\n", SC2IFP(sc)->if_xname, ch->carp_version); m_freem(m); @@ -739,7 +739,7 @@ carp_input_c(struct mbuf *m, struct carp CARPSTATS_INC(carps_badauth); SC2IFP(sc)->if_ierrors++; CARP_UNLOCK(ifp->if_carp); - CARP_LOG("%s: incorrect hash\n", SC2IFP(sc)->if_xname); + CARP_DEBUG("%s: incorrect hash\n", SC2IFP(sc)->if_xname); m_freem(m); return; } @@ -772,7 +772,7 @@ carp_input_c(struct mbuf *m, struct carp if (timevalcmp(&sc_tv, &ch_tv, >) || timevalcmp(&sc_tv, &ch_tv, ==)) { callout_stop(&sc->sc_ad_tmo); - CARP_DEBUG("%s: MASTER -> BACKUP " + CARP_LOG("%s: MASTER -> BACKUP " "(more frequent advertisement received)\n", SC2IFP(sc)->if_xname); carp_set_state(sc, BACKUP); @@ -787,7 +787,7 @@ carp_input_c(struct mbuf *m, struct carp */ if (carp_opts[CARPCTL_PREEMPT] && timevalcmp(&sc_tv, &ch_tv, <)) { - CARP_DEBUG("%s: BACKUP -> MASTER " + CARP_LOG("%s: BACKUP -> MASTER " "(preempting a slower master)\n", SC2IFP(sc)->if_xname); carp_master_down_locked(sc); @@ -801,7 +801,7 @@ carp_input_c(struct mbuf *m, struct carp */ sc_tv.tv_sec = sc->sc_advbase * 3; if (timevalcmp(&sc_tv, &ch_tv, <)) { - CARP_DEBUG("%s: BACKUP -> MASTER " + CARP_LOG("%s: BACKUP -> MASTER " "(master timed out)\n", SC2IFP(sc)->if_xname); carp_master_down_locked(sc); @@ -1024,7 +1024,7 @@ carp_send_ad_locked(struct carp_softc *s if (in6_setscope(&ip6->ip6_dst, sc->sc_carpdev, NULL) != 0) { SC2IFP(sc)->if_oerrors++; m_freem(m); - CARP_LOG("%s: in6_setscope failed\n", __func__); + CARP_DEBUG("%s: in6_setscope failed\n", __func__); return; } @@ -1385,12 +1385,12 @@ carp_setrun(struct carp_softc *sc, sa_fa #ifdef INET6 carp_send_na(sc); #endif /* INET6 */ - CARP_DEBUG("%s: INIT -> MASTER (preempting)\n", + CARP_LOG("%s: INIT -> MASTER (preempting)\n", SC2IFP(sc)->if_xname); carp_set_state(sc, MASTER); carp_setroute(sc, RTM_ADD); } else { - CARP_DEBUG("%s: INIT -> BACKUP\n", SC2IFP(sc)->if_xname); + CARP_LOG("%s: INIT -> BACKUP\n", SC2IFP(sc)->if_xname); carp_set_state(sc, BACKUP); carp_setroute(sc, RTM_DELETE); carp_setrun(sc, 0); From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 12:35:17 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C707106566C; Mon, 11 Jan 2010 12:35:17 +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 4B60F8FC08; Mon, 11 Jan 2010 12:35:17 +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 o0BCZHen061570; Mon, 11 Jan 2010 12:35:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BCZHlj061564; Mon, 11 Jan 2010 12:35:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001111235.o0BCZHlj061564@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 11 Jan 2010 12:35:17 +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: r202082 - in stable/8/sys: kern sys ufs/ffs vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 12:35:17 -0000 Author: kib Date: Mon Jan 11 12:35:16 2010 New Revision: 202082 URL: http://svn.freebsd.org/changeset/base/202082 Log: MFC r200770: Remove VI_OBJDIRTY and make sure that OBJ_MIGHTBEDIRTY is set only for vnode-backed vm objects. Modified: stable/8/sys/kern/vfs_subr.c stable/8/sys/sys/vnode.h stable/8/sys/ufs/ffs/ffs_rawread.c stable/8/sys/vm/vm_object.c stable/8/sys/vm/vm_object.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) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Mon Jan 11 12:32:06 2010 (r202081) +++ stable/8/sys/kern/vfs_subr.c Mon Jan 11 12:35:16 2010 (r202082) @@ -2697,14 +2697,12 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VI_DOOMED", sizeof(buf)); if (vp->v_iflag & VI_FREE) strlcat(buf, "|VI_FREE", sizeof(buf)); - if (vp->v_iflag & VI_OBJDIRTY) - strlcat(buf, "|VI_OBJDIRTY", sizeof(buf)); if (vp->v_iflag & VI_DOINGINACT) strlcat(buf, "|VI_DOINGINACT", sizeof(buf)); if (vp->v_iflag & VI_OWEINACT) strlcat(buf, "|VI_OWEINACT", sizeof(buf)); flags = vp->v_iflag & ~(VI_MOUNT | VI_AGE | VI_DOOMED | VI_FREE | - VI_OBJDIRTY | VI_DOINGINACT | VI_OWEINACT); + VI_DOINGINACT | VI_OWEINACT); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VI(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); @@ -3198,7 +3196,8 @@ vfs_msync(struct mount *mp, int flags) MNT_ILOCK(mp); MNT_VNODE_FOREACH(vp, mp, mvp) { VI_LOCK(vp); - if ((vp->v_iflag & VI_OBJDIRTY) && + obj = vp->v_object; + if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0 && (flags == MNT_WAIT || VOP_ISLOCKED(vp) == 0)) { MNT_IUNLOCK(mp); if (!vget(vp, Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Mon Jan 11 12:32:06 2010 (r202081) +++ stable/8/sys/sys/vnode.h Mon Jan 11 12:35:16 2010 (r202082) @@ -237,7 +237,6 @@ struct xvnode { #define VI_AGE 0x0040 /* Insert vnode at head of free list */ #define VI_DOOMED 0x0080 /* This vnode is being recycled */ #define VI_FREE 0x0100 /* This vnode is on the freelist */ -#define VI_OBJDIRTY 0x0400 /* object might be dirty */ #define VI_DOINGINACT 0x0800 /* VOP_INACTIVE is in progress */ #define VI_OWEINACT 0x1000 /* Need to call inactive */ Modified: stable/8/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_rawread.c Mon Jan 11 12:32:06 2010 (r202081) +++ stable/8/sys/ufs/ffs/ffs_rawread.c Mon Jan 11 12:35:16 2010 (r202082) @@ -101,6 +101,7 @@ ffs_rawread_sync(struct vnode *vp) int upgraded; struct bufobj *bo; struct mount *mp; + vm_object_t obj; /* Check for dirty mmap, pending writes and dirty buffers */ bo = &vp->v_bufobj; @@ -108,7 +109,8 @@ ffs_rawread_sync(struct vnode *vp) VI_LOCK(vp); if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0 || - (vp->v_iflag & VI_OBJDIRTY) != 0) { + ((obj = vp->v_object) != NULL && + (obj->flags & OBJ_MIGHTBEDIRTY) != 0)) { VI_UNLOCK(vp); BO_UNLOCK(bo); @@ -138,13 +140,12 @@ ffs_rawread_sync(struct vnode *vp) return (EIO); } /* Attempt to msync mmap() regions to clean dirty mmap */ - if ((vp->v_iflag & VI_OBJDIRTY) != 0) { + if ((obj = vp->v_object) != NULL && + (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { VI_UNLOCK(vp); - if (vp->v_object != NULL) { - VM_OBJECT_LOCK(vp->v_object); - vm_object_page_clean(vp->v_object, 0, 0, OBJPC_SYNC); - VM_OBJECT_UNLOCK(vp->v_object); - } + VM_OBJECT_LOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_UNLOCK(obj); } else VI_UNLOCK(vp); Modified: stable/8/sys/vm/vm_object.c ============================================================================== --- stable/8/sys/vm/vm_object.c Mon Jan 11 12:32:06 2010 (r202081) +++ stable/8/sys/vm/vm_object.c Mon Jan 11 12:35:16 2010 (r202082) @@ -773,9 +773,9 @@ vm_object_page_clean(vm_object_t object, int curgeneration; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if (object->type != OBJT_VNODE || - (object->flags & OBJ_MIGHTBEDIRTY) == 0) + if ((object->flags & OBJ_MIGHTBEDIRTY) == 0) return; + KASSERT(object->type == OBJT_VNODE, ("Not a vnode object")); pagerflags = (flags & (OBJPC_SYNC | OBJPC_INVAL)) ? VM_PAGER_PUT_SYNC : VM_PAGER_CLUSTER_OK; pagerflags |= (flags & OBJPC_INVAL) ? VM_PAGER_PUT_INVAL : 0; @@ -875,18 +875,8 @@ vm_object_page_clean(vm_object_t object, pmap_remove_write(p); } - if (clearobjflags && (tstart == 0) && (tend == object->size)) { - struct vnode *vp; - + if (clearobjflags && (tstart == 0) && (tend == object->size)) vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); - if (object->type == OBJT_VNODE && - (vp = (struct vnode *)object->handle) != NULL) { - VI_LOCK(vp); - if (vp->v_iflag & VI_OBJDIRTY) - vp->v_iflag &= ~VI_OBJDIRTY; - VI_UNLOCK(vp); - } - } rescan: curgeneration = object->generation; @@ -2148,18 +2138,12 @@ vm_object_coalesce(vm_object_t prev_obje void vm_object_set_writeable_dirty(vm_object_t object) { - struct vnode *vp; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if ((object->flags & OBJ_MIGHTBEDIRTY) != 0) + if (object->type != OBJT_VNODE || + (object->flags & OBJ_MIGHTBEDIRTY) != 0) return; vm_object_set_flag(object, OBJ_MIGHTBEDIRTY); - if (object->type == OBJT_VNODE && - (vp = (struct vnode *)object->handle) != NULL) { - VI_LOCK(vp); - vp->v_iflag |= VI_OBJDIRTY; - VI_UNLOCK(vp); - } } #include "opt_ddb.h" Modified: stable/8/sys/vm/vm_object.h ============================================================================== --- stable/8/sys/vm/vm_object.h Mon Jan 11 12:32:06 2010 (r202081) +++ stable/8/sys/vm/vm_object.h Mon Jan 11 12:35:16 2010 (r202082) @@ -154,7 +154,7 @@ struct vm_object { #define OBJ_DEAD 0x0008 /* dead objects (during rundown) */ #define OBJ_NOSPLIT 0x0010 /* dont split this object */ #define OBJ_PIPWNT 0x0040 /* paging in progress wanted */ -#define OBJ_MIGHTBEDIRTY 0x0100 /* object might be dirty */ +#define OBJ_MIGHTBEDIRTY 0x0100 /* object might be dirty, only for vnode */ #define OBJ_CLEANING 0x0200 #define OBJ_COLORED 0x1000 /* pg_color is defined */ #define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 18:42:29 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A85E5106568B; Mon, 11 Jan 2010 18:42:29 +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 967CD8FC29; Mon, 11 Jan 2010 18:42: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 o0BIgT0v043545; Mon, 11 Jan 2010 18:42:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BIgTvr043543; Mon, 11 Jan 2010 18:42:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001111842.o0BIgTvr043543@svn.freebsd.org> From: John Baldwin Date: Mon, 11 Jan 2010 18:42: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: r202100 - stable/8/etc/defaults X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 18:42:29 -0000 Author: jhb Date: Mon Jan 11 18:42:29 2010 New Revision: 202100 URL: http://svn.freebsd.org/changeset/base/202100 Log: MFC 201522: Expose the upper 256 ptys in the default devfs rules. I should have updated this when expanding the old pty(4) driver to use 512 ptys by default. This is more important for 7.x. Modified: stable/8/etc/defaults/devfs.rules Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/defaults/devfs.rules ============================================================================== --- stable/8/etc/defaults/devfs.rules Mon Jan 11 18:39:11 2010 (r202099) +++ stable/8/etc/defaults/devfs.rules Mon Jan 11 18:42:29 2010 (r202100) @@ -44,6 +44,14 @@ add path 'ptyP*' unhide add path 'ptyQ*' unhide add path 'ptyR*' unhide add path 'ptyS*' unhide +add path 'ptyl*' unhide +add path 'ptym*' unhide +add path 'ptyn*' unhide +add path 'ptyo*' unhide +add path 'ptyL*' unhide +add path 'ptyM*' unhide +add path 'ptyN*' unhide +add path 'ptyO*' unhide add path 'ttyp*' unhide add path 'ttyq*' unhide add path 'ttyr*' unhide @@ -52,6 +60,14 @@ add path 'ttyP*' unhide add path 'ttyQ*' unhide add path 'ttyR*' unhide add path 'ttyS*' unhide +add path 'ttyl*' unhide +add path 'ttym*' unhide +add path 'ttyn*' unhide +add path 'ttyo*' unhide +add path 'ttyL*' unhide +add path 'ttyM*' unhide +add path 'ttyN*' unhide +add path 'ttyO*' unhide add path ptmx unhide add path pts unhide add path 'pts/*' unhide From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 18:44:42 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 166E5106568B; Mon, 11 Jan 2010 18:44:42 +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 04A658FC1C; Mon, 11 Jan 2010 18:44:42 +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 o0BIif21044074; Mon, 11 Jan 2010 18:44:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BIifA8044072; Mon, 11 Jan 2010 18:44:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001111844.o0BIifA8044072@svn.freebsd.org> From: John Baldwin Date: Mon, 11 Jan 2010 18:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202101 - stable/7/etc/defaults X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 18:44:42 -0000 Author: jhb Date: Mon Jan 11 18:44:41 2010 New Revision: 202101 URL: http://svn.freebsd.org/changeset/base/202101 Log: MFC 201522: Expose the upper 256 ptys in the default devfs rules. I should have updated this when expanding the old pty(4) driver to use 512 ptys by default. This is more important for 7.x. Modified: stable/7/etc/defaults/devfs.rules Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/defaults/devfs.rules ============================================================================== --- stable/7/etc/defaults/devfs.rules Mon Jan 11 18:42:29 2010 (r202100) +++ stable/7/etc/defaults/devfs.rules Mon Jan 11 18:44:41 2010 (r202101) @@ -44,6 +44,14 @@ add path 'ptyP*' unhide add path 'ptyQ*' unhide add path 'ptyR*' unhide add path 'ptyS*' unhide +add path 'ptyl*' unhide +add path 'ptym*' unhide +add path 'ptyn*' unhide +add path 'ptyo*' unhide +add path 'ptyL*' unhide +add path 'ptyM*' unhide +add path 'ptyN*' unhide +add path 'ptyO*' unhide add path 'ttyp*' unhide add path 'ttyq*' unhide add path 'ttyr*' unhide @@ -52,6 +60,14 @@ add path 'ttyP*' unhide add path 'ttyQ*' unhide add path 'ttyR*' unhide add path 'ttyS*' unhide +add path 'ttyl*' unhide +add path 'ttym*' unhide +add path 'ttyn*' unhide +add path 'ttyo*' unhide +add path 'ttyL*' unhide +add path 'ttyM*' unhide +add path 'ttyN*' unhide +add path 'ttyO*' unhide add path 'pts/*' unhide add path 'pty/*' unhide add path fd unhide From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 19:30:24 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 093441065694; Mon, 11 Jan 2010 19:30:24 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAB1F8FC12; Mon, 11 Jan 2010 19:30:23 +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 o0BJUN2M054509; Mon, 11 Jan 2010 19:30:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BJUNkR054505; Mon, 11 Jan 2010 19:30:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201001111930.o0BJUNkR054505@svn.freebsd.org> From: Rick Macklem Date: Mon, 11 Jan 2010 19:30:23 +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: r202106 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 19:30:24 -0000 Author: rmacklem Date: Mon Jan 11 19:30:23 2010 New Revision: 202106 URL: http://svn.freebsd.org/changeset/base/202106 Log: MFC: r201029 When porting the experimental nfs subsystem to the FreeBSD8 krpc, I added 3 functions that were already in the experimental client under different names. This patch deletes the functions in the experimental client and renames the calls to use the other set. (This is just removal of duplicated code and does not fix any bug.) Modified: stable/8/sys/fs/nfsclient/nfs.h stable/8/sys/fs/nfsclient/nfs_clbio.c stable/8/sys/fs/nfsclient/nfs_clvnops.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) Modified: stable/8/sys/fs/nfsclient/nfs.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfs.h Mon Jan 11 19:21:52 2010 (r202105) +++ stable/8/sys/fs/nfsclient/nfs.h Mon Jan 11 19:30:23 2010 (r202106) @@ -67,7 +67,6 @@ int ncl_vinvalbuf(struct vnode *, int, s int ncl_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); -int ncl_msleep(struct thread *, void *, struct mtx *, int, char *, int); void ncl_nhinit(void); void ncl_nhuninit(void); void ncl_nodelock(struct nfsnode *); Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Mon Jan 11 19:21:52 2010 (r202105) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Mon Jan 11 19:30:23 2010 (r202106) @@ -75,101 +75,6 @@ static int nfs_directio_write(struct vno struct ucred *cred, int ioflag); /* - * Any signal that can interrupt an NFS operation in an intr mount - * should be added to this set. SIGSTOP and SIGKILL cannot be masked. - */ -static int nfs_sig_set[] = { - SIGINT, - SIGTERM, - SIGHUP, - SIGKILL, - SIGSTOP, - SIGQUIT -}; - -#ifdef notnow -/* - * Check to see if one of the signals in our subset is pending on - * the process (in an intr mount). - */ -int -ncl_sig_pending(sigset_t set) -{ - int i; - - for (i = 0 ; i < sizeof(nfs_sig_set)/sizeof(int) ; i++) - if (SIGISMEMBER(set, nfs_sig_set[i])) - return (1); - return (0); -} -#endif - -/* - * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also - * used in other places in the NFS client that might tsleep(). - */ -static void -ncl_set_sigmask(struct thread *td, sigset_t *oldset) -{ - sigset_t newset; - int i; - struct proc *p; - - SIGFILLSET(newset); - if (td == NULL) - td = curthread; /* XXX */ - p = td->td_proc; - /* Remove the NFS set of signals from newset */ - PROC_LOCK(p); - mtx_lock(&p->p_sigacts->ps_mtx); - for (i = 0 ; i < sizeof(nfs_sig_set)/sizeof(int) ; i++) { - /* - * But make sure we leave the ones already masked - * by the process, ie. remove the signal from the - * temporary signalmask only if it wasn't already - * in p_sigmask. - */ - if (!SIGISMEMBER(td->td_sigmask, nfs_sig_set[i]) && - !SIGISMEMBER(p->p_sigacts->ps_sigignore, nfs_sig_set[i])) - SIGDELSET(newset, nfs_sig_set[i]); - } - mtx_unlock(&p->p_sigacts->ps_mtx); - PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); -} - -static void -ncl_restore_sigmask(struct thread *td, sigset_t *set) -{ - if (td == NULL) - td = curthread; /* XXX */ - kern_sigprocmask(td, SIG_SETMASK, set, NULL, 0); -} - -/* - * NFS wrapper to msleep(), that shoves a new p_sigmask and restores the - * old one after msleep() returns. - */ -int -ncl_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, char *wmesg, int timo) -{ - sigset_t oldset; - int error; - struct proc *p; - - if ((priority & PCATCH) == 0) - return msleep(ident, mtx, priority, wmesg, timo); - if (td == NULL) - td = curthread; /* XXX */ - ncl_set_sigmask(td, &oldset); - error = msleep(ident, mtx, priority, wmesg, timo); - ncl_restore_sigmask(td, &oldset); - p = td->td_proc; - return (error); -} - -/* * Vnode op for VM getpages. */ int @@ -1356,9 +1261,9 @@ nfs_getcacheblk(struct vnode *vp, daddr_ if (nmp->nm_flag & NFSMNT_INT) { sigset_t oldset; - ncl_set_sigmask(td, &oldset); + newnfs_set_sigmask(td, &oldset); bp = getblk(vp, bn, size, NFS_PCATCH, 0, 0); - ncl_restore_sigmask(td, &oldset); + newnfs_restore_sigmask(td, &oldset); while (bp == NULL) { if (newnfs_sigintr(nmp, td)) return (NULL); @@ -1544,9 +1449,9 @@ again: NFS_DPF(ASYNCIO, ("ncl_asyncio: waiting for mount %p queue to drain\n", nmp)); nmp->nm_bufqwant = TRUE; - error = ncl_msleep(td, &nmp->nm_bufq, &ncl_iod_mutex, - slpflag | PRIBIO, - "nfsaio", slptimeo); + error = newnfs_msleep(td, &nmp->nm_bufq, + &ncl_iod_mutex, slpflag | PRIBIO, "nfsaio", + slptimeo); if (error) { error2 = newnfs_sigintr(nmp, td); if (error2) { Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Mon Jan 11 19:21:52 2010 (r202105) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Mon Jan 11 19:30:23 2010 (r202106) @@ -2708,9 +2708,9 @@ loop: mtx_lock(&np->n_mtx); while (np->n_directio_asyncwr > 0) { np->n_flag |= NFSYNCWAIT; - error = ncl_msleep(td, (caddr_t)&np->n_directio_asyncwr, - &np->n_mtx, slpflag | (PRIBIO + 1), - "nfsfsync", 0); + error = newnfs_msleep(td, &np->n_directio_asyncwr, + &np->n_mtx, slpflag | (PRIBIO + 1), + "nfsfsync", 0); if (error) { if (newnfs_sigintr(nmp, td)) { mtx_unlock(&np->n_mtx); From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 20:32:51 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F0451065672; Mon, 11 Jan 2010 20:32:51 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C7828FC18; Mon, 11 Jan 2010 20:32: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 o0BKWpat068677; Mon, 11 Jan 2010 20:32:51 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BKWpV6068674; Mon, 11 Jan 2010 20:32:51 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001112032.o0BKWpV6068674@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 11 Jan 2010 20:32:51 +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: r202112 - stable/8/sys/dev/mxge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 20:32:51 -0000 Author: gallatin Date: Mon Jan 11 20:32:51 2010 New Revision: 202112 URL: http://svn.freebsd.org/changeset/base/202112 Log: Sync mxge(4) with head: r197391: Add support for TX throttling r198250: Move mxge(4)'s NIC watchdog reset handler from a callout to a taskqueue r198303: Make mxge do a better job recovering from NIC h/w faults r200845: Don't take the driver mutex in mxge_tick() r201758: Remove extraneous semicolons Modified: stable/8/sys/dev/mxge/if_mxge.c stable/8/sys/dev/mxge/if_mxge_var.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) Modified: stable/8/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/8/sys/dev/mxge/if_mxge.c Mon Jan 11 20:23:17 2010 (r202111) +++ stable/8/sys/dev/mxge/if_mxge.c Mon Jan 11 20:32:51 2010 (r202112) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* count xmits ourselves, rather than via drbr */ #define NO_SLOW_STATS @@ -106,6 +107,7 @@ static int mxge_max_slices = 1; static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; static int mxge_always_promisc = 0; static int mxge_initial_mtu = ETHERMTU_JUMBO; +static int mxge_throttle = 0; static char *mxge_fw_unaligned = "mxge_ethp_z8e"; static char *mxge_fw_aligned = "mxge_eth_z8e"; static char *mxge_fw_rss_aligned = "mxge_rss_eth_z8e"; @@ -596,10 +598,13 @@ static int mxge_select_firmware(mxge_softc_t *sc) { int aligned = 0; + int force_firmware = mxge_force_firmware; + if (sc->throttle) + force_firmware = sc->throttle; - if (mxge_force_firmware != 0) { - if (mxge_force_firmware == 1) + if (force_firmware != 0) { + if (force_firmware == 1) aligned = 1; else aligned = 0; @@ -1313,10 +1318,48 @@ mxge_reset(mxge_softc_t *sc, int interru mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC); mxge_change_pause(sc, sc->pause); mxge_set_multicast_list(sc); + if (sc->throttle) { + cmd.data0 = sc->throttle; + if (mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, + &cmd)) { + device_printf(sc->dev, + "can't enable throttle\n"); + } + } return status; } static int +mxge_change_throttle(SYSCTL_HANDLER_ARGS) +{ + mxge_cmd_t cmd; + mxge_softc_t *sc; + int err; + unsigned int throttle; + + sc = arg1; + throttle = sc->throttle; + err = sysctl_handle_int(oidp, &throttle, arg2, req); + if (err != 0) { + return err; + } + + if (throttle == sc->throttle) + return 0; + + if (throttle < MXGE_MIN_THROTTLE || throttle > MXGE_MAX_THROTTLE) + return EINVAL; + + mtx_lock(&sc->driver_mtx); + cmd.data0 = throttle; + err = mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, &cmd); + if (err == 0) + sc->throttle = throttle; + mtx_unlock(&sc->driver_mtx); + return err; +} + +static int mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) { mxge_softc_t *sc; @@ -1508,6 +1551,12 @@ mxge_add_sysctls(mxge_softc_t *sc) "I", "interrupt coalescing delay in usecs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "throttle", + CTLTYPE_INT|CTLFLAG_RW, sc, + 0, mxge_change_throttle, + "I", "transmit throttling"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "flow_control_enabled", CTLTYPE_INT|CTLFLAG_RW, sc, 0, mxge_change_flow_control, @@ -3591,7 +3640,6 @@ mxge_open(mxge_softc_t *sc) #endif sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); return 0; @@ -3612,7 +3660,6 @@ mxge_close(mxge_softc_t *sc, int down) int slice; #endif - callout_stop(&sc->co_hdl); #ifdef IFNET_BUF_RING for (slice = 0; slice < sc->num_slices; slice++) { ss = &sc->ss[slice]; @@ -3691,12 +3738,11 @@ mxge_read_reboot(mxge_softc_t *sc) return (pci_read_config(dev, vs + 0x14, 4)); } -static int -mxge_watchdog_reset(mxge_softc_t *sc, int slice) +static void +mxge_watchdog_reset(mxge_softc_t *sc) { struct pci_devinfo *dinfo; struct mxge_slice_state *ss; - mxge_tx_ring_t *tx; int err, running, s, num_tx_slices = 1; uint32_t reboot; uint16_t cmd; @@ -3723,7 +3769,6 @@ mxge_watchdog_reset(mxge_softc_t *sc, in cmd = pci_read_config(sc->dev, PCIR_COMMAND, 2); if (cmd == 0xffff) { device_printf(sc->dev, "NIC disappeared!\n"); - return (err); } } if ((cmd & PCIM_CMD_BUSMASTEREN) == 0) { @@ -3782,24 +3827,43 @@ mxge_watchdog_reset(mxge_softc_t *sc, in } sc->watchdog_resets++; } else { - tx = &sc->ss[slice].tx; device_printf(sc->dev, - "NIC did not reboot, slice %d ring state:\n", - slice); - device_printf(sc->dev, - "tx.req=%d tx.done=%d, tx.queue_active=%d\n", - tx->req, tx->done, tx->queue_active); - device_printf(sc->dev, "tx.activate=%d tx.deactivate=%d\n", - tx->activate, tx->deactivate); - device_printf(sc->dev, "pkt_done=%d fw=%d\n", - tx->pkt_done, - be32toh(sc->ss->fw_stats->send_done_count)); - device_printf(sc->dev, "not resetting\n"); + "NIC did not reboot, not resetting\n"); + err = 0; } - if (err) + if (err) { device_printf(sc->dev, "watchdog reset failed\n"); + } else { + if (sc->dying == 2) + sc->dying = 0; + callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); + } +} - return (err); +static void +mxge_watchdog_task(void *arg, int pending) +{ + mxge_softc_t *sc = arg; + + + mtx_lock(&sc->driver_mtx); + mxge_watchdog_reset(sc); + mtx_unlock(&sc->driver_mtx); +} + +static void +mxge_warn_stuck(mxge_softc_t *sc, mxge_tx_ring_t *tx, int slice) +{ + tx = &sc->ss[slice].tx; + device_printf(sc->dev, "slice %d struck? ring state:\n", slice); + device_printf(sc->dev, + "tx.req=%d tx.done=%d, tx.queue_active=%d\n", + tx->req, tx->done, tx->queue_active); + device_printf(sc->dev, "tx.activate=%d tx.deactivate=%d\n", + tx->activate, tx->deactivate); + device_printf(sc->dev, "pkt_done=%d fw=%d\n", + tx->pkt_done, + be32toh(sc->ss->fw_stats->send_done_count)); } static int @@ -3823,8 +3887,11 @@ mxge_watchdog(mxge_softc_t *sc) tx->watchdog_req != tx->watchdog_done && tx->done == tx->watchdog_done) { /* check for pause blocking before resetting */ - if (tx->watchdog_rx_pause == rx_pause) - err = mxge_watchdog_reset(sc, i); + if (tx->watchdog_rx_pause == rx_pause) { + mxge_warn_stuck(sc, tx, i); + taskqueue_enqueue(sc->tq, &sc->watchdog_task); + return (ENXIO); + } else device_printf(sc->dev, "Flow control blocking " "xmits, check link partner\n"); @@ -3840,10 +3907,11 @@ mxge_watchdog(mxge_softc_t *sc) return (err); } -static void +static u_long mxge_update_stats(mxge_softc_t *sc) { struct mxge_slice_state *ss; + u_long pkts = 0; u_long ipackets = 0; u_long opackets = 0; #ifdef IFNET_BUF_RING @@ -3865,6 +3933,8 @@ mxge_update_stats(mxge_softc_t *sc) #endif oerrors += ss->oerrors; } + pkts = (ipackets - sc->ifp->if_ipackets); + pkts += (opackets - sc->ifp->if_opackets); sc->ifp->if_ipackets = ipackets; sc->ifp->if_opackets = opackets; #ifdef IFNET_BUF_RING @@ -3873,23 +3943,43 @@ mxge_update_stats(mxge_softc_t *sc) sc->ifp->if_snd.ifq_drops = odrops; #endif sc->ifp->if_oerrors = oerrors; + return pkts; } static void mxge_tick(void *arg) { mxge_softc_t *sc = arg; + u_long pkts = 0; int err = 0; + int running, ticks; + uint16_t cmd; - /* aggregate stats from different slices */ - mxge_update_stats(sc); - if (!sc->watchdog_countdown) { - err = mxge_watchdog(sc); - sc->watchdog_countdown = 4; + ticks = mxge_ticks; + running = sc->ifp->if_drv_flags & IFF_DRV_RUNNING; + if (running) { + /* aggregate stats from different slices */ + pkts = mxge_update_stats(sc); + if (!sc->watchdog_countdown) { + err = mxge_watchdog(sc); + sc->watchdog_countdown = 4; + } + sc->watchdog_countdown--; + } + if (pkts == 0) { + /* ensure NIC did not suffer h/w fault while idle */ + cmd = pci_read_config(sc->dev, PCIR_COMMAND, 2); + if ((cmd & PCIM_CMD_BUSMASTEREN) == 0) { + sc->dying = 2; + taskqueue_enqueue(sc->tq, &sc->watchdog_task); + err = ENXIO; + } + /* look less often if NIC is idle */ + ticks *= 4; } - sc->watchdog_countdown--; + if (err == 0) - callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); + callout_reset(&sc->co_hdl, ticks, mxge_tick, sc); } @@ -4044,6 +4134,7 @@ mxge_ioctl(struct ifnet *ifp, u_long com default: err = ENOTTY; } + return err; } @@ -4070,6 +4161,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type); TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type); TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu); + TUNABLE_INT_FETCH("hw.mxge.throttle", &mxge_throttle); if (sc->lro_cnt != 0) mxge_lro_cnt = sc->lro_cnt; @@ -4087,6 +4179,12 @@ mxge_fetch_tunables(mxge_softc_t *sc) if (mxge_initial_mtu > ETHERMTU_JUMBO || mxge_initial_mtu < ETHER_MIN_LEN) mxge_initial_mtu = ETHERMTU_JUMBO; + + if (mxge_throttle && mxge_throttle > MXGE_MAX_THROTTLE) + mxge_throttle = MXGE_MAX_THROTTLE; + if (mxge_throttle && mxge_throttle < MXGE_MIN_THROTTLE) + mxge_throttle = MXGE_MIN_THROTTLE; + sc->throttle = mxge_throttle; } @@ -4503,6 +4601,17 @@ mxge_attach(device_t dev) sc->dev = dev; mxge_fetch_tunables(sc); + TASK_INIT(&sc->watchdog_task, 1, mxge_watchdog_task, sc); + sc->tq = taskqueue_create_fast("mxge_taskq", M_WAITOK, + taskqueue_thread_enqueue, + &sc->tq); + if (sc->tq == NULL) { + err = ENOMEM; + goto abort_with_nothing; + } + taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->dev)); + err = bus_dma_tag_create(NULL, /* parent */ 1, /* alignment */ 0, /* boundary */ @@ -4519,7 +4628,7 @@ mxge_attach(device_t dev) if (err != 0) { device_printf(sc->dev, "Err %d allocating parent dmat\n", err); - goto abort_with_nothing; + goto abort_with_tq; } ifp = sc->ifp = if_alloc(IFT_ETHER); @@ -4660,6 +4769,7 @@ mxge_attach(device_t dev) ifp->if_transmit = mxge_transmit; ifp->if_qflush = mxge_qflush; #endif + callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); return 0; abort_with_rings: @@ -4681,7 +4791,12 @@ abort_with_lock: if_free(ifp); abort_with_parent_dmat: bus_dma_tag_destroy(sc->parent_dmat); - +abort_with_tq: + if (sc->tq != NULL) { + taskqueue_drain(sc->tq, &sc->watchdog_task); + taskqueue_free(sc->tq); + sc->tq = NULL; + } abort_with_nothing: return err; } @@ -4702,6 +4817,11 @@ mxge_detach(device_t dev) mxge_close(sc, 0); mtx_unlock(&sc->driver_mtx); ether_ifdetach(sc->ifp); + if (sc->tq != NULL) { + taskqueue_drain(sc->tq, &sc->watchdog_task); + taskqueue_free(sc->tq); + sc->tq = NULL; + } callout_drain(&sc->co_hdl); ifmedia_removeall(&sc->media); mxge_dummy_rdma(sc, 0); Modified: stable/8/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/8/sys/dev/mxge/if_mxge_var.h Mon Jan 11 20:23:17 2010 (r202111) +++ stable/8/sys/dev/mxge/if_mxge_var.h Mon Jan 11 20:32:51 2010 (r202112) @@ -261,6 +261,7 @@ struct mxge_softc { int fw_multicast_support; int link_width; int max_mtu; + int throttle; int tx_defrag; int media_flags; int need_media_probe; @@ -269,6 +270,8 @@ struct mxge_softc { int dying; mxge_dma_t dmabench_dma; struct callout co_hdl; + struct taskqueue *tq; + struct task watchdog_task; struct sysctl_oid *slice_sysctl_tree; struct sysctl_ctx_list slice_sysctl_ctx; char *mac_addr_string; @@ -287,6 +290,8 @@ struct mxge_softc { #define MXGE_PCI_REV_Z8ES 1 #define MXGE_XFP_COMPLIANCE_BYTE 131 #define MXGE_SFP_COMPLIANCE_BYTE 3 +#define MXGE_MIN_THROTTLE 416 +#define MXGE_MAX_THROTTLE 4096 #define MXGE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 21:23:59 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E92A9106568B; Mon, 11 Jan 2010 21:23:59 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7B268FC16; Mon, 11 Jan 2010 21:23:59 +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 o0BLNx4C080341; Mon, 11 Jan 2010 21:23:59 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BLNxgM080338; Mon, 11 Jan 2010 21:23:59 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001112123.o0BLNxgM080338@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 11 Jan 2010 21:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202117 - stable/7/sys/dev/mxge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 21:24:00 -0000 Author: gallatin Date: Mon Jan 11 21:23:59 2010 New Revision: 202117 URL: http://svn.freebsd.org/changeset/base/202117 Log: MFC: Merge older mxge(4) fixes/improvements from head: r193250: Set an rx jumbo cluster to the correct size for bus_dmamap_load_mbuf_sg() r194836: Initial mtu r195818: Rename hw.mxge.rss_hash_type -> hw.mxge.rss_hashtype r197391: Add support for TX throttling Modified: stable/7/sys/dev/mxge/if_mxge.c stable/7/sys/dev/mxge/if_mxge_var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Mon Jan 11 21:21:30 2010 (r202116) +++ stable/7/sys/dev/mxge/if_mxge.c Mon Jan 11 21:23:59 2010 (r202117) @@ -99,6 +99,8 @@ static int mxge_ticks; static int mxge_max_slices = 1; static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; static int mxge_always_promisc = 0; +static int mxge_initial_mtu = ETHERMTU_JUMBO; +static int mxge_throttle = 0; static char *mxge_fw_unaligned = "mxge_ethp_z8e"; static char *mxge_fw_aligned = "mxge_eth_z8e"; static char *mxge_fw_rss_aligned = "mxge_rss_eth_z8e"; @@ -589,10 +591,13 @@ static int mxge_select_firmware(mxge_softc_t *sc) { int aligned = 0; + int force_firmware = mxge_force_firmware; + if (sc->throttle) + force_firmware = sc->throttle; - if (mxge_force_firmware != 0) { - if (mxge_force_firmware == 1) + if (force_firmware != 0) { + if (force_firmware == 1) aligned = 1; else aligned = 0; @@ -1300,10 +1305,48 @@ mxge_reset(mxge_softc_t *sc, int interru mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC); mxge_change_pause(sc, sc->pause); mxge_set_multicast_list(sc); + if (sc->throttle) { + cmd.data0 = sc->throttle; + if (mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, + &cmd)) { + device_printf(sc->dev, + "can't enable throttle\n"); + } + } return status; } static int +mxge_change_throttle(SYSCTL_HANDLER_ARGS) +{ + mxge_cmd_t cmd; + mxge_softc_t *sc; + int err; + unsigned int throttle; + + sc = arg1; + throttle = sc->throttle; + err = sysctl_handle_int(oidp, &throttle, arg2, req); + if (err != 0) { + return err; + } + + if (throttle == sc->throttle) + return 0; + + if (throttle < MXGE_MIN_THROTTLE || throttle > MXGE_MAX_THROTTLE) + return EINVAL; + + mtx_lock(&sc->driver_mtx); + cmd.data0 = throttle; + err = mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, &cmd); + if (err == 0) + sc->throttle = throttle; + mtx_unlock(&sc->driver_mtx); + return err; +} + +static int mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) { mxge_softc_t *sc; @@ -1495,6 +1538,12 @@ mxge_add_sysctls(mxge_softc_t *sc) "I", "interrupt coalescing delay in usecs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "throttle", + CTLTYPE_INT|CTLFLAG_RW, sc, + 0, mxge_change_throttle, + "I", "transmit throttling"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "flow_control_enabled", CTLTYPE_INT|CTLFLAG_RW, sc, 0, mxge_change_flow_control, @@ -2206,7 +2255,7 @@ mxge_get_buf_big(struct mxge_slice_state err = ENOBUFS; goto done; } - m->m_len = rx->cl_size; + m->m_len = rx->mlen; err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, seg, &cnt, BUS_DMA_NOWAIT); if (err != 0) { @@ -3240,6 +3289,8 @@ mxge_slice_open(struct mxge_slice_state } ss->rx_big.nbufs = nbufs; ss->rx_big.cl_size = cl_size; + ss->rx_big.mlen = ss->sc->ifp->if_mtu + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + MXGEFW_PAD; for (i = 0; i <= ss->rx_big.mask; i += ss->rx_big.nbufs) { map = ss->rx_big.info[i].map; err = mxge_get_buf_big(ss, map, i); @@ -3840,6 +3891,9 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH("hw.mxge.lro_cnt", &sc->lro_cnt); TUNABLE_INT_FETCH("hw.mxge.always_promisc", &mxge_always_promisc); TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type); + TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type); + TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu); + TUNABLE_INT_FETCH("hw.mxge.throttle", &mxge_throttle); if (sc->lro_cnt != 0) mxge_lro_cnt = sc->lro_cnt; @@ -3854,6 +3908,15 @@ mxge_fetch_tunables(mxge_softc_t *sc) || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) { mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; } + if (mxge_initial_mtu > ETHERMTU_JUMBO || + mxge_initial_mtu < ETHER_MIN_LEN) + mxge_initial_mtu = ETHERMTU_JUMBO; + + if (mxge_throttle && mxge_throttle > MXGE_MAX_THROTTLE) + mxge_throttle = MXGE_MAX_THROTTLE; + if (mxge_throttle && mxge_throttle < MXGE_MIN_THROTTLE) + mxge_throttle = MXGE_MIN_THROTTLE; + sc->throttle = mxge_throttle; } @@ -4414,9 +4477,9 @@ mxge_attach(device_t dev) mxge_media_probe(sc); sc->dying = 0; ether_ifattach(ifp, sc->mac_addr); - /* ether_ifattach sets mtu to 1500 */ - if (ifp->if_capabilities & IFCAP_JUMBO_MTU) - ifp->if_mtu = 9000; + /* ether_ifattach sets mtu to ETHERMTU */ + if (mxge_initial_mtu != ETHERMTU) + mxge_change_mtu(sc, mxge_initial_mtu); mxge_add_sysctls(sc); callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); Modified: stable/7/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/7/sys/dev/mxge/if_mxge_var.h Mon Jan 11 21:21:30 2010 (r202116) +++ stable/7/sys/dev/mxge/if_mxge_var.h Mon Jan 11 21:23:59 2010 (r202117) @@ -120,6 +120,7 @@ typedef struct int cl_size; int alloc_fail; int mask; /* number of rx slots -1 */ + int mlen; } mxge_rx_ring_t; typedef struct @@ -243,6 +244,7 @@ struct mxge_softc { int fw_multicast_support; int link_width; int max_mtu; + int throttle; int tx_defrag; int media_flags; int need_media_probe; @@ -271,6 +273,8 @@ struct mxge_softc { #define MXGE_PCI_REV_Z8ES 1 #define MXGE_XFP_COMPLIANCE_BYTE 131 #define MXGE_SFP_COMPLIANCE_BYTE 3 +#define MXGE_MIN_THROTTLE 416 +#define MXGE_MAX_THROTTLE 4096 #define MXGE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) From owner-svn-src-stable@FreeBSD.ORG Mon Jan 11 21:32:39 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFBB31065670; Mon, 11 Jan 2010 21:32:39 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E2518FC1D; Mon, 11 Jan 2010 21:32: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 o0BLWd3M082284; Mon, 11 Jan 2010 21:32:39 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BLWdcr082281; Mon, 11 Jan 2010 21:32:39 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001112132.o0BLWdcr082281@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 11 Jan 2010 21:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202118 - stable/6/sys/dev/mxge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 21:32:39 -0000 Author: gallatin Date: Mon Jan 11 21:32:39 2010 New Revision: 202118 URL: http://svn.freebsd.org/changeset/base/202118 Log: MFC: Merge older mxge(4) fixes/improvements from head: r193250: Set an rx jumbo cluster to the correct size for bus_dmamap_load_mbuf_sg() r194836: Initial mtu r195818: Rename hw.mxge.rss_hash_type -> hw.mxge.rss_hashtype r197391: Add support for TX throttling. Modified: stable/6/sys/dev/mxge/if_mxge.c stable/6/sys/dev/mxge/if_mxge_var.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/6/sys/dev/mxge/if_mxge.c Mon Jan 11 21:23:59 2010 (r202117) +++ stable/6/sys/dev/mxge/if_mxge.c Mon Jan 11 21:32:39 2010 (r202118) @@ -99,6 +99,8 @@ static int mxge_ticks; static int mxge_max_slices = 1; static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; static int mxge_always_promisc = 0; +static int mxge_initial_mtu = ETHERMTU_JUMBO; +static int mxge_throttle = 0; static char *mxge_fw_unaligned = "mxge_ethp_z8e"; static char *mxge_fw_aligned = "mxge_eth_z8e"; static char *mxge_fw_rss_aligned = "mxge_rss_eth_z8e"; @@ -589,10 +591,13 @@ static int mxge_select_firmware(mxge_softc_t *sc) { int aligned = 0; + int force_firmware = mxge_force_firmware; + if (sc->throttle) + force_firmware = sc->throttle; - if (mxge_force_firmware != 0) { - if (mxge_force_firmware == 1) + if (force_firmware != 0) { + if (force_firmware == 1) aligned = 1; else aligned = 0; @@ -1300,10 +1305,48 @@ mxge_reset(mxge_softc_t *sc, int interru mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC); mxge_change_pause(sc, sc->pause); mxge_set_multicast_list(sc); + if (sc->throttle) { + cmd.data0 = sc->throttle; + if (mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, + &cmd)) { + device_printf(sc->dev, + "can't enable throttle\n"); + } + } return status; } static int +mxge_change_throttle(SYSCTL_HANDLER_ARGS) +{ + mxge_cmd_t cmd; + mxge_softc_t *sc; + int err; + unsigned int throttle; + + sc = arg1; + throttle = sc->throttle; + err = sysctl_handle_int(oidp, &throttle, arg2, req); + if (err != 0) { + return err; + } + + if (throttle == sc->throttle) + return 0; + + if (throttle < MXGE_MIN_THROTTLE || throttle > MXGE_MAX_THROTTLE) + return EINVAL; + + mtx_lock(&sc->driver_mtx); + cmd.data0 = throttle; + err = mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, &cmd); + if (err == 0) + sc->throttle = throttle; + mtx_unlock(&sc->driver_mtx); + return err; +} + +static int mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) { mxge_softc_t *sc; @@ -1495,6 +1538,12 @@ mxge_add_sysctls(mxge_softc_t *sc) "I", "interrupt coalescing delay in usecs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "throttle", + CTLTYPE_INT|CTLFLAG_RW, sc, + 0, mxge_change_throttle, + "I", "transmit throttling"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "flow_control_enabled", CTLTYPE_INT|CTLFLAG_RW, sc, 0, mxge_change_flow_control, @@ -2206,7 +2255,7 @@ mxge_get_buf_big(struct mxge_slice_state err = ENOBUFS; goto done; } - m->m_len = rx->cl_size; + m->m_len = rx->mlen; err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, seg, &cnt, BUS_DMA_NOWAIT); if (err != 0) { @@ -3240,6 +3289,8 @@ mxge_slice_open(struct mxge_slice_state } ss->rx_big.nbufs = nbufs; ss->rx_big.cl_size = cl_size; + ss->rx_big.mlen = ss->sc->ifp->if_mtu + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + MXGEFW_PAD; for (i = 0; i <= ss->rx_big.mask; i += ss->rx_big.nbufs) { map = ss->rx_big.info[i].map; err = mxge_get_buf_big(ss, map, i); @@ -3840,6 +3891,9 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH("hw.mxge.lro_cnt", &sc->lro_cnt); TUNABLE_INT_FETCH("hw.mxge.always_promisc", &mxge_always_promisc); TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type); + TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type); + TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu); + TUNABLE_INT_FETCH("hw.mxge.throttle", &mxge_throttle); if (sc->lro_cnt != 0) mxge_lro_cnt = sc->lro_cnt; @@ -3854,6 +3908,15 @@ mxge_fetch_tunables(mxge_softc_t *sc) || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) { mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; } + if (mxge_initial_mtu > ETHERMTU_JUMBO || + mxge_initial_mtu < ETHER_MIN_LEN) + mxge_initial_mtu = ETHERMTU_JUMBO; + + if (mxge_throttle && mxge_throttle > MXGE_MAX_THROTTLE) + mxge_throttle = MXGE_MAX_THROTTLE; + if (mxge_throttle && mxge_throttle < MXGE_MIN_THROTTLE) + mxge_throttle = MXGE_MIN_THROTTLE; + sc->throttle = mxge_throttle; } @@ -4414,9 +4477,9 @@ mxge_attach(device_t dev) mxge_media_probe(sc); sc->dying = 0; ether_ifattach(ifp, sc->mac_addr); - /* ether_ifattach sets mtu to 1500 */ - if (ifp->if_capabilities & IFCAP_JUMBO_MTU) - ifp->if_mtu = 9000; + /* ether_ifattach sets mtu to ETHERMTU */ + if (mxge_initial_mtu != ETHERMTU) + mxge_change_mtu(sc, mxge_initial_mtu); mxge_add_sysctls(sc); callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); Modified: stable/6/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/6/sys/dev/mxge/if_mxge_var.h Mon Jan 11 21:23:59 2010 (r202117) +++ stable/6/sys/dev/mxge/if_mxge_var.h Mon Jan 11 21:32:39 2010 (r202118) @@ -119,6 +119,7 @@ typedef struct int cl_size; int alloc_fail; int mask; /* number of rx slots -1 */ + int mlen; } mxge_rx_ring_t; typedef struct @@ -242,6 +243,7 @@ struct mxge_softc { int fw_multicast_support; int link_width; int max_mtu; + int throttle; int tx_defrag; int media_flags; int need_media_probe; @@ -270,6 +272,8 @@ struct mxge_softc { #define MXGE_PCI_REV_Z8ES 1 #define MXGE_XFP_COMPLIANCE_BYTE 131 #define MXGE_SFP_COMPLIANCE_BYTE 3 +#define MXGE_MIN_THROTTLE 416 +#define MXGE_MAX_THROTTLE 4096 #define MXGE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 00:04:14 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B3E71065698; Tue, 12 Jan 2010 00:04:14 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D58AC8FC17; Tue, 12 Jan 2010 00:04: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 o0C04D3b016643; Tue, 12 Jan 2010 00:04:13 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C04D2X016641; Tue, 12 Jan 2010 00:04:13 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201001120004.o0C04D2X016641@svn.freebsd.org> From: Qing Li Date: Tue, 12 Jan 2010 00:04:13 +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: r202132 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 00:04:14 -0000 Author: qingli Date: Tue Jan 12 00:04:13 2010 New Revision: 202132 URL: http://svn.freebsd.org/changeset/base/202132 Log: MFC r201544 An existing incomplete ARP entry would expire a subsequent statically configured entry of the same host. This bug was due to the expiration timer was not cancelled when installing the static entry. Since there exist a potential race condition with respect to timer cancellation, simply check for the LLE_STATIC bit inside the expiration function instead of cancelling the active timer. Modified: stable/8/sys/netinet/if_ether.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) Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Mon Jan 11 23:33:30 2010 (r202131) +++ stable/8/sys/netinet/if_ether.c Tue Jan 12 00:04:13 2010 (r202132) @@ -168,17 +168,23 @@ arptimer(void *arg) ifp = lle->lle_tbl->llt_ifp; IF_AFDATA_LOCK(ifp); LLE_WLOCK(lle); - if ((!callout_pending(&lle->la_timer) && - callout_active(&lle->la_timer))) { - (void) llentry_free(lle); - } -#ifdef DIAGNOSTIC + if (lle->la_flags & LLE_STATIC) + LLE_WUNLOCK(lle); else { - struct sockaddr *l3addr = L3_ADDR(lle); - log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle, - inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); - } + if (!callout_pending(&lle->la_timer) && + callout_active(&lle->la_timer)) { + (void) llentry_free(lle); + } +#ifdef DIAGNOSTIC + else { + struct sockaddr *l3addr = L3_ADDR(lle); + log(LOG_INFO, + "arptimer issue: %p, IPv4 address: \"%s\"\n", lle, + inet_ntoa( + ((const struct sockaddr_in *)l3addr)->sin_addr)); + } #endif + } IF_AFDATA_UNLOCK(ifp); } From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 06:00:57 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37DBB106566B; Tue, 12 Jan 2010 06:00:57 +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 2496F8FC13; Tue, 12 Jan 2010 06:00:57 +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 o0C60vFM095121; Tue, 12 Jan 2010 06:00:57 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C60uRI095113; Tue, 12 Jan 2010 06:00:56 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001120600.o0C60uRI095113@svn.freebsd.org> From: Brooks Davis Date: Tue, 12 Jan 2010 06:00:56 +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: r202134 - in stable/8/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 06:00:57 -0000 Author: brooks Date: Tue Jan 12 06:00:56 2010 New Revision: 202134 URL: http://svn.freebsd.org/changeset/base/202134 Log: MFC r201443: Add vlan(4) to all GENERIC kernels. Modified: stable/8/sys/amd64/conf/GENERIC stable/8/sys/i386/conf/GENERIC stable/8/sys/ia64/conf/GENERIC stable/8/sys/pc98/conf/GENERIC stable/8/sys/powerpc/conf/GENERIC stable/8/sys/sparc64/conf/GENERIC stable/8/sys/sun4v/conf/GENERIC 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) Modified: stable/8/sys/amd64/conf/GENERIC ============================================================================== --- stable/8/sys/amd64/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/amd64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -265,6 +265,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: stable/8/sys/i386/conf/GENERIC ============================================================================== --- stable/8/sys/i386/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/i386/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -278,6 +278,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: stable/8/sys/ia64/conf/GENERIC ============================================================================== --- stable/8/sys/ia64/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/ia64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -144,6 +144,7 @@ device kue # Kawasaki LSI USB Ethernet # Various (pseudo) devices device ether # Ethernet support +device vlan # 802.1Q VLAN support device faith # IPv6-to-IPv4 relaying (translation) device gif # IPv6 and IPv4 tunneling device loop # Network loopback Modified: stable/8/sys/pc98/conf/GENERIC ============================================================================== --- stable/8/sys/pc98/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/pc98/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -232,6 +232,7 @@ device xe # Xircom pccard Ethernet device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: stable/8/sys/powerpc/conf/GENERIC ============================================================================== --- stable/8/sys/powerpc/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/powerpc/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -123,6 +123,7 @@ device fxp # Intel EtherExpress PRO/10 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: stable/8/sys/sparc64/conf/GENERIC ============================================================================== --- stable/8/sys/sparc64/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/sparc64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -207,6 +207,7 @@ device ath_rate_sample # SampleRate tx device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: stable/8/sys/sun4v/conf/GENERIC ============================================================================== --- stable/8/sys/sun4v/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/sun4v/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -169,6 +169,7 @@ device bge # Broadcom BCM570xx Gigabit device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 06:04:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F396A106566C; Tue, 12 Jan 2010 06:04:32 +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 E02BA8FC17; Tue, 12 Jan 2010 06:04:32 +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 o0C64Wro095957; Tue, 12 Jan 2010 06:04:32 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C64WmX095949; Tue, 12 Jan 2010 06:04:32 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001120604.o0C64WmX095949@svn.freebsd.org> From: Brooks Davis Date: Tue, 12 Jan 2010 06:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202135 - in stable/7/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 06:04:33 -0000 Author: brooks Date: Tue Jan 12 06:04:32 2010 New Revision: 202135 URL: http://svn.freebsd.org/changeset/base/202135 Log: MFC r201443: Add vlan(4) to all GENERIC kernels. Modified: stable/7/sys/amd64/conf/GENERIC stable/7/sys/i386/conf/GENERIC stable/7/sys/ia64/conf/GENERIC stable/7/sys/pc98/conf/GENERIC stable/7/sys/powerpc/conf/GENERIC stable/7/sys/sparc64/conf/GENERIC stable/7/sys/sun4v/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/conf/GENERIC ============================================================================== --- stable/7/sys/amd64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/amd64/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -254,6 +254,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/i386/conf/GENERIC ============================================================================== --- stable/7/sys/i386/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/i386/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -268,6 +268,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/ia64/conf/GENERIC ============================================================================== --- stable/7/sys/ia64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/ia64/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -143,6 +143,7 @@ device sbp # SCSI over FireWire (need # Various (pseudo) devices device ether # Ethernet support +device vlan # 802.1Q VLAN support device faith # IPv6-to-IPv4 relaying (translation) device gif # IPv6 and IPv4 tunneling device loop # Network loopback Modified: stable/7/sys/pc98/conf/GENERIC ============================================================================== --- stable/7/sys/pc98/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/pc98/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -222,6 +222,7 @@ device xe # Xircom pccard Ethernet device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/powerpc/conf/GENERIC ============================================================================== --- stable/7/sys/powerpc/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/powerpc/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -107,6 +107,7 @@ device fxp # Intel EtherExpress PRO/10 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/sparc64/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -201,6 +201,7 @@ device ath_rate_sample # SampleRate tx device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/sun4v/conf/GENERIC ============================================================================== --- stable/7/sys/sun4v/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/sun4v/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -156,6 +156,7 @@ device bge # Broadcom BCM570xx Gigabit device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 06:09:56 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EB7E1065670; Tue, 12 Jan 2010 06:09:56 +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 7CEA98FC13; Tue, 12 Jan 2010 06:09:56 +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 o0C69upZ097191; Tue, 12 Jan 2010 06:09:56 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C69uvs097189; Tue, 12 Jan 2010 06:09:56 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001120609.o0C69uvs097189@svn.freebsd.org> From: Brooks Davis Date: Tue, 12 Jan 2010 06:09:56 +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: r202136 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 06:09:56 -0000 Author: brooks Date: Tue Jan 12 06:09:56 2010 New Revision: 202136 URL: http://svn.freebsd.org/changeset/base/202136 Log: MFC r201953: Correct the explination text for the kern.ngroups. It reflects the number of supplemental groups, not the total number of groups. Modified: stable/8/sys/kern/kern_mib.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) Modified: stable/8/sys/kern/kern_mib.c ============================================================================== --- stable/8/sys/kern/kern_mib.c Tue Jan 12 06:04:32 2010 (r202135) +++ stable/8/sys/kern/kern_mib.c Tue Jan 12 06:09:56 2010 (r202136) @@ -125,7 +125,8 @@ SYSCTL_INT(_kern, KERN_POSIX1, posix1ver 0, _POSIX_VERSION, "Version of POSIX attempting to comply to"); SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RD, - 0, NGROUPS_MAX, "Maximum number of groups a user can belong to"); + 0, NGROUPS_MAX, + "Maximum number of supplemental groups a user can belong to"); SYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD, 0, 1, "Whether job control is available"); From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 06:11:37 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29A1B106566B; Tue, 12 Jan 2010 06:11:37 +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 17EA58FC08; Tue, 12 Jan 2010 06:11:37 +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 o0C6BaGh097681; Tue, 12 Jan 2010 06:11:36 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C6BaEi097679; Tue, 12 Jan 2010 06:11:36 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001120611.o0C6BaEi097679@svn.freebsd.org> From: Brooks Davis Date: Tue, 12 Jan 2010 06:11:36 +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: r202137 - stable/8/sys/fs/procfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 06:11:37 -0000 Author: brooks Date: Tue Jan 12 06:11:36 2010 New Revision: 202137 URL: http://svn.freebsd.org/changeset/base/202137 Log: MFC r201954: Update the comment on printing group membership to reflect that fact that each group the process is a member of is printed rather than an entry for each group the user could be a member of. Modified: stable/8/sys/fs/procfs/procfs_status.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) Modified: stable/8/sys/fs/procfs/procfs_status.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_status.c Tue Jan 12 06:09:56 2010 (r202136) +++ stable/8/sys/fs/procfs/procfs_status.c Tue Jan 12 06:11:36 2010 (r202137) @@ -82,7 +82,7 @@ procfs_doprocstatus(PFS_FILL_ARGS) sid = sess->s_leader ? sess->s_leader->p_pid : 0; /* comm pid ppid pgid sid tty ctty,sldr start ut st wmsg - euid ruid rgid,egid,groups[1 .. NGROUPS] + euid ruid rgid,egid,groups[1 .. ngroups] */ pc = p->p_comm; From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 06:14:25 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50D0B106566B; Tue, 12 Jan 2010 06:14: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 3ECD28FC0A; Tue, 12 Jan 2010 06:14: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 o0C6EPEC098360; Tue, 12 Jan 2010 06:14:25 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C6EP68098358; Tue, 12 Jan 2010 06:14:25 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001120614.o0C6EP68098358@svn.freebsd.org> From: Brooks Davis Date: Tue, 12 Jan 2010 06:14: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: r202138 - stable/8/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 06:14:25 -0000 Author: brooks Date: Tue Jan 12 06:14:24 2010 New Revision: 202138 URL: http://svn.freebsd.org/changeset/base/202138 Log: MFC r201955: Improve the comment about CMGROUP_MAX. Modified: stable/8/sys/sys/socket.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) Modified: stable/8/sys/sys/socket.h ============================================================================== --- stable/8/sys/sys/socket.h Tue Jan 12 06:11:36 2010 (r202137) +++ stable/8/sys/sys/socket.h Tue Jan 12 06:14:24 2010 (r202138) @@ -483,8 +483,8 @@ struct cmsghdr { #if __BSD_VISIBLE /* * While we may have more groups than this, the cmsgcred struct must - * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow - * this. + * be able to fit in an mbuf and we have historically supported a + * maximum of 16 groups. */ #define CMGROUP_MAX 16 From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 07:33:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6981B106568D; Tue, 12 Jan 2010 07:33:33 +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 57F0F8FC17; Tue, 12 Jan 2010 07:33: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 o0C7XXTf015987; Tue, 12 Jan 2010 07:33:33 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C7XXTN015985; Tue, 12 Jan 2010 07:33:33 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001120733.o0C7XXTN015985@svn.freebsd.org> From: Brooks Davis Date: Tue, 12 Jan 2010 07:33: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: r202140 - stable/8/crypto/heimdal/kcm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 07:33:33 -0000 Author: brooks Date: Tue Jan 12 07:33:33 2010 New Revision: 202140 URL: http://svn.freebsd.org/changeset/base/202140 Log: MFC r201444: The size of credential messages is limited by CMGROUP_MAX rather than NGROUPS. Modified: stable/8/crypto/heimdal/kcm/connect.c Directory Properties: stable/8/crypto/heimdal/ (props changed) Modified: stable/8/crypto/heimdal/kcm/connect.c ============================================================================== --- stable/8/crypto/heimdal/kcm/connect.c Tue Jan 12 07:02:54 2010 (r202139) +++ stable/8/crypto/heimdal/kcm/connect.c Tue Jan 12 07:33:33 2010 (r202140) @@ -149,7 +149,7 @@ update_client_creds(int s, kcm_client *p struct sockcred *sc; memset(&msg, 0, sizeof(msg)); - crmsgsize = CMSG_SPACE(SOCKCREDSIZE(NGROUPS)); + crmsgsize = CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)); if (crmsgsize == 0) return 1 ; From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 18:47:41 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F8871065672; Tue, 12 Jan 2010 18:47:41 +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 0E1318FC14; Tue, 12 Jan 2010 18:47: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 o0CIleCO069478; Tue, 12 Jan 2010 18:47:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CIlewX069476; Tue, 12 Jan 2010 18:47:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001121847.o0CIlewX069476@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Jan 2010 18:47:40 +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: r202164 - stable/8/usr.sbin/arp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 18:47:41 -0000 Author: jhb Date: Tue Jan 12 18:47:40 2010 New Revision: 202164 URL: http://svn.freebsd.org/changeset/base/202164 Log: MFC 201202: Use reallocf() to simplify some logic. Modified: stable/8/usr.sbin/arp/arp.c Directory Properties: stable/8/usr.sbin/arp/ (props changed) Modified: stable/8/usr.sbin/arp/arp.c ============================================================================== --- stable/8/usr.sbin/arp/arp.c Tue Jan 12 18:20:20 2010 (r202163) +++ stable/8/usr.sbin/arp/arp.c Tue Jan 12 18:47:40 2010 (r202164) @@ -499,7 +499,7 @@ search(u_long addr, action_fn *action) { int mib[6]; size_t needed; - char *lim, *buf, *newbuf, *next; + char *lim, *buf, *next; struct rt_msghdr *rtm; struct sockaddr_inarp *sin2; struct sockaddr_dl *sdl; @@ -522,13 +522,9 @@ search(u_long addr, action_fn *action) return 0; buf = NULL; for (;;) { - newbuf = realloc(buf, needed); - if (newbuf == NULL) { - if (buf != NULL) - free(buf); + buf = reallocf(buf, needed); + if (buf == NULL) errx(1, "could not reallocate memory"); - } - buf = newbuf; st = sysctl(mib, 6, buf, &needed, NULL, 0); if (st == 0 || errno != ENOMEM) break; From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 18:47:52 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9774110656C0; Tue, 12 Jan 2010 18:47:52 +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 85ED28FC08; Tue, 12 Jan 2010 18:47:52 +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 o0CIlq25069548; Tue, 12 Jan 2010 18:47:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CIlqw6069546; Tue, 12 Jan 2010 18:47:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001121847.o0CIlqw6069546@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Jan 2010 18:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202165 - stable/7/usr.sbin/arp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 18:47:52 -0000 Author: jhb Date: Tue Jan 12 18:47:52 2010 New Revision: 202165 URL: http://svn.freebsd.org/changeset/base/202165 Log: MFC 201202: Use reallocf() to simplify some logic. Modified: stable/7/usr.sbin/arp/arp.c Directory Properties: stable/7/usr.sbin/arp/ (props changed) Modified: stable/7/usr.sbin/arp/arp.c ============================================================================== --- stable/7/usr.sbin/arp/arp.c Tue Jan 12 18:47:40 2010 (r202164) +++ stable/7/usr.sbin/arp/arp.c Tue Jan 12 18:47:52 2010 (r202165) @@ -472,7 +472,7 @@ search(u_long addr, action_fn *action) { int mib[6]; size_t needed; - char *lim, *buf, *newbuf, *next; + char *lim, *buf, *next; struct rt_msghdr *rtm; struct sockaddr_inarp *sin2; struct sockaddr_dl *sdl; @@ -491,13 +491,9 @@ search(u_long addr, action_fn *action) return 0; buf = NULL; for (;;) { - newbuf = realloc(buf, needed); - if (newbuf == NULL) { - if (buf != NULL) - free(buf); + buf = reallocf(buf, needed); + if (buf == NULL) errx(1, "could not reallocate memory"); - } - buf = newbuf; st = sysctl(mib, 6, buf, &needed, NULL, 0); if (st == 0 || errno != ENOMEM) break; From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 19:55:07 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8D6B106566C; Tue, 12 Jan 2010 19:55:07 +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 964128FC18; Tue, 12 Jan 2010 19:55: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 o0CJt7T7084551; Tue, 12 Jan 2010 19:55:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CJt7Ym084546; Tue, 12 Jan 2010 19:55:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001121955.o0CJt7Ym084546@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Jan 2010 19:55: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: r202167 - in stable/8: etc etc/defaults share/man/man5 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 19:55:07 -0000 Author: jhb Date: Tue Jan 12 19:55:07 2010 New Revision: 202167 URL: http://svn.freebsd.org/changeset/base/202167 Log: MFC 201215: Add support for configuring vlan(4) interfaces as child devices similar to wlan(4) interfaces. vlan(4) interfaces are listed via a new 'vlans_' variable. If a vlan interface is a number, then that number is treated as the vlan tag for the interface and the interface will be named '.'. Otherwise, the vlan tag must be provided via a vlan parameter in a 'create_args_' variable. While I'm here, fix a few nits in rc.conf(5) and mention create_args_ in the description of cloned_interfaces. Modified: stable/8/etc/defaults/rc.conf stable/8/etc/network.subr stable/8/share/man/man5/rc.conf.5 Directory Properties: stable/8/etc/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/etc/defaults/rc.conf ============================================================================== --- stable/8/etc/defaults/rc.conf Tue Jan 12 19:41:07 2010 (r202166) +++ stable/8/etc/defaults/rc.conf Tue Jan 12 19:55:07 2010 (r202167) @@ -198,6 +198,8 @@ ifconfig_lo0="inet 127.0.0.1" # default #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. #ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. +#vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device +#create_arg_vlan0="vlan 102" # vlan tag for vlan0 device #wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device #wlandebug_wlan0="scan+auth+assoc" # Set debug flags with wlanddebug(8) #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. Modified: stable/8/etc/network.subr ============================================================================== --- stable/8/etc/network.subr Tue Jan 12 19:41:07 2010 (r202166) +++ stable/8/etc/network.subr Tue Jan 12 19:55:07 2010 (r202167) @@ -46,7 +46,7 @@ ifn_start() ifconfig_up ${ifn} && cfg=0 ipv4_up ${ifn} && cfg=0 ipx_up ${ifn} && cfg=0 - childif_create ${ifn} + childif_create ${ifn} && cfg=0 return $cfg } @@ -67,7 +67,7 @@ ifn_stop() ipv4_down ${ifn} && cfg=0 ifconfig_down ${ifn} && cfg=0 ifscript_down ${ifn} && cfg=0 - childif_destroy ${ifn} + childif_destroy ${ifn} && cfg=0 return $cfg } @@ -530,7 +530,7 @@ clone_down() # childif_create() { - local cfg child child_wlans create_args debug_flags ifn i + local cfg child child_vlans child_wlans create_args debug_flags ifn i cfg=1 ifn=$1 @@ -559,6 +559,32 @@ childif_create() fi done + # Create vlan interfaces + child_vlans=`get_if_var $ifn vlans_IF` + + if [ -n "${child_vlans}" ]; then + load_kld if_vlan + fi + + for child in ${child_vlans}; do + if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then + child="${ifn}.${child}" + create_args=`get_if_var $child create_args_IF` + ifconfig $child create ${create_args} && cfg=0 + else + create_args="vlandev $ifn `get_if_var $child create_args_IF`" + if expr $child : 'vlan[0-9][0-9]*$' >/dev/null 2>&1; then + ifconfig $child create ${create_args} && cfg=0 + else + i=`ifconfig vlan create ${create_args}` + ifconfig $i name $child && cfg=0 + fi + fi + if autoif $child; then + ifn_start $child + fi + done + return ${cfg} } @@ -566,12 +592,34 @@ childif_create() # childif_destroy() { - local cfg child child_wlans ifn + local cfg child child_vlans child_wlans ifn child_wlans=`get_if_var $ifn wlans_IF` for child in ${child_wlans}; do + if ! ifexists $child; then + continue + fi + if autoif $child; then + ifn_stop $child + fi ifconfig $child destroy && cfg=0 done + + child_vlans=`get_if_var $ifn vlans_IF` + for child in ${child_vlans}; do + if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then + child="${ifn}.${child}" + fi + if ! ifexists $child; then + continue + fi + if autoif $child; then + ifn_stop $child + fi + ifconfig $child destroy && cfg=0 + done + + return ${cfg} } # Create netgraph nodes. Modified: stable/8/share/man/man5/rc.conf.5 ============================================================================== --- stable/8/share/man/man5/rc.conf.5 Tue Jan 12 19:41:07 2010 (r202166) +++ stable/8/share/man/man5/rc.conf.5 Tue Jan 12 19:55:07 2010 (r202167) @@ -1161,6 +1161,45 @@ and variables. .Pp If a +.Va vlans_ Ns Aq Ar interface +variable is set, +a +.Xr vlan 4 +interface will be created for each item in the list with the +.Ar vlandev +argument set to +.Ar interface . +If a vlan interface's name is a number, +then that number is used as the vlan tag and the new vlan interface is +named +.Ar interface . Ns Ar tag . +Otherwise, +the vlan tag must be specified via a +.Va vlan +parameter in the +.Va create_args_ Ns Aq Ar interface +variable. +.Pp +To create a vlan device named +.Li em0.101 +on +.Li em0 +with the vlan tag 101: +.Bd -literal +vlans_em0="101" +.Ed +.Pp +To create a vlan device named +.Li myvlan +on +.Li em0 +with the vlan tag 102: +.Bd -literal +vlans_em0="myvlan" +create_args_myvlan="vlan 102" +.Ed +.Pp +If a .Va wlans_ Ns Aq Ar interface variable is set, an @@ -1227,7 +1266,7 @@ Finally, you can add options in this variable, in addition to the .Pa /etc/start_if. Ns Aq Ar interface file. -For instance, configure an +For instance, to configure an .Xr ath 4 wireless device in station mode with an address obtained via DHCP, using WPA authentication and 802.11b mode, it is @@ -1249,7 +1288,7 @@ This is intended to replace the no longe .Va pccard_ifconfig variable. .Pp -It is also possible to rename interface by doing: +It is also possible to rename an interface by doing: .Bd -literal ifconfig_ed0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" @@ -1286,6 +1325,12 @@ Now this works only for IPv6 link local .It Va cloned_interfaces .Pq Vt str Set to the list of clonable network interfaces to create on this host. +Further cloning arguments may be passed to the +.Xr ifconfig 8 +.Cm create +command for each interface by setting the +.Va create_args_ Ns Aq Ar interface +variable. Entries in .Va cloned_interfaces are automatically appended to From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 20:06:04 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 667DB10656A4; Tue, 12 Jan 2010 20:06:04 +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 53E458FC13; Tue, 12 Jan 2010 20:06:04 +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 o0CK64Ov087060; Tue, 12 Jan 2010 20:06:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CK64Jm087055; Tue, 12 Jan 2010 20:06:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001122006.o0CK64Jm087055@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Jan 2010 20:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202169 - in stable/7: etc etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 20:06:04 -0000 Author: jhb Date: Tue Jan 12 20:06:04 2010 New Revision: 202169 URL: http://svn.freebsd.org/changeset/base/202169 Log: MFC 201215: Add support for configuring vlan(4) interfaces as child devices similar to wlan(4) interfaces. vlan(4) interfaces are listed via a new 'vlans_' variable. If a vlan interface is a number, then that number is treated as the vlan tag for the interface and the interface will be named '.'. Otherwise, the vlan tag must be provided via a vlan parameter in a 'create_args_' variable. While I'm here, fix a few nits in rc.conf(5) and mention create_args_ in the description of cloned_interfaces. The changes for 7.x are a bit larger as they introduce childif_create() and childif_destroy() and move ifn_start() and ifn_stop() from rc.d/netif to network.subr. Modified: stable/7/etc/defaults/rc.conf stable/7/etc/network.subr stable/7/etc/rc.d/netif stable/7/share/man/man5/rc.conf.5 (contents, props changed) Directory Properties: stable/7/etc/ (props changed) stable/7/share/man/man5/ (props changed) Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Tue Jan 12 19:59:54 2010 (r202168) +++ stable/7/etc/defaults/rc.conf Tue Jan 12 20:06:04 2010 (r202169) @@ -192,6 +192,8 @@ ifconfig_lo0="inet 127.0.0.1" # default #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. #ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. +#vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device +#create_arg_vlan0="vlan 102" # vlan tag for vlan0 device #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. # #autobridge_interfaces="bridge0" # List of bridges to check Modified: stable/7/etc/network.subr ============================================================================== --- stable/7/etc/network.subr Tue Jan 12 19:59:54 2010 (r202168) +++ stable/7/etc/network.subr Tue Jan 12 20:06:04 2010 (r202169) @@ -30,6 +30,48 @@ # Requires that rc.conf be loaded first. # +# ifn_start ifn +# Bring up and configure an interface. If some configuration is +# applied print the interface configuration. +# +ifn_start() +{ + local ifn cfg + ifn="$1" + cfg=1 + + [ -z "$ifn" ] && err 1 "ifn_start called without an interface" + + ifscript_up ${ifn} && cfg=0 + ifconfig_up ${ifn} && cfg=0 + ipv4_up ${ifn} && cfg=0 + ipx_up ${ifn} && cfg=0 + childif_create ${ifn} && cfg=0 + + return $cfg +} + +# ifn_stop ifn +# Shutdown and de-configure an interface. If action is taken +# print the interface name. +# +ifn_stop() +{ + local ifn cfg + ifn="$1" + cfg=1 + + [ -z "$ifn" ] && err 1 "ifn_stop called without an interface" + + ipx_down ${ifn} && cfg=0 + ipv4_down ${ifn} && cfg=0 + ifconfig_down ${ifn} && cfg=0 + ifscript_down ${ifn} && cfg=0 + childif_destroy ${ifn} && cfg=0 + + return $cfg +} + # ifconfig_up if # Evaluate ifconfig(8) arguments for interface $if and # run ifconfig(8) with those arguments. It returns 0 if @@ -452,6 +494,70 @@ clone_down() debug "Destroyed clones: ${_list}" } +# childif_create +# Create and configure child interfaces. Return 0 if child +# interfaces are created. +# +childif_create() +{ + local cfg child child_vlans create_args ifn i + cfg=1 + ifn=$1 + + # Create vlan interfaces + child_vlans=`get_if_var $ifn vlans_IF` + + if [ -n "${child_vlans}" ]; then + load_kld if_vlan + fi + + for child in ${child_vlans}; do + if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then + child="${ifn}.${child}" + create_args=`get_if_var $child create_args_IF` + ifconfig $child create ${create_args} && cfg=0 + else + create_args="vlandev $ifn `get_if_var $child create_args_IF`" + if expr $child : 'vlan[0-9][0-9]*$' >/dev/null 2>&1; then + ifconfig $child create ${create_args} && cfg=0 + else + i=`ifconfig vlan create ${create_args}` + ifconfig $i name $child && cfg=0 + fi + fi + if autoif $child; then + ifn_start $child + fi + done + + return ${cfg} +} + +# childif_destroy +# Destroy child interfaces. +# +childif_destroy() +{ + local cfg child child_vlans ifn + cfg=1 + + child_vlans=`get_if_var $ifn vlans_IF` + for child in ${child_vlans}; do + if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then + child="${ifn}.${child}" + fi + if ! ifexists $child; then + continue + fi + if autoif $child; then + ifn_stop $child + fi + ifconfig $child destroy && cfg=0 + done + + return ${cfg} +} + # Create netgraph nodes. # ng_mkpeer() { Modified: stable/7/etc/rc.d/netif ============================================================================== --- stable/7/etc/rc.d/netif Tue Jan 12 19:59:54 2010 (r202168) +++ stable/7/etc/rc.d/netif Tue Jan 12 20:06:04 2010 (r202169) @@ -149,37 +149,5 @@ network_common() debug "The following interfaces were not configured: $_fail" } -ifn_start() -{ - local ifn cfg - ifn="$1" - cfg=1 - - [ -z "$ifn" ] && return 1 - - ifscript_up ${ifn} && cfg=0 - ifconfig_up ${ifn} && cfg=0 - ipv4_up ${ifn} && cfg=0 - ipx_up ${ifn} && cfg=0 - - return $cfg -} - -ifn_stop() -{ - local ifn cfg - ifn="$1" - cfg=1 - - [ -z "$ifn" ] && return 1 - - ipx_down ${ifn} && cfg=0 - ipv4_down ${ifn} && cfg=0 - ifconfig_down ${ifn} && cfg=0 - ifscript_down ${ifn} && cfg=0 - - return $cfg -} - load_rc_config $name run_rc_command $* Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Tue Jan 12 19:59:54 2010 (r202168) +++ stable/7/share/man/man5/rc.conf.5 Tue Jan 12 20:06:04 2010 (r202169) @@ -1149,6 +1149,45 @@ and .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n variables. .Pp +If a +.Va vlans_ Ns Aq Ar interface +variable is set, +a +.Xr vlan 4 +interface will be created for each item in the list with the +.Ar vlandev +argument set to +.Ar interface . +If a vlan interface's name is a number, +then that number is used as the vlan tag and the new vlan interface is +named +.Ar interface . Ns Ar tag . +Otherwise, +the vlan tag must be specified via a +.Va vlan +parameter in the +.Va create_args_ Ns Aq Ar interface +variable. +.Pp +To create a vlan device named +.Li em0.101 +on +.Li em0 +with the vlan tag 101: +.Bd -literal +vlans_em0="101" +.Ed +.Pp +To create a vlan device named +.Li myvlan +on +.Li em0 +with the vlan tag 102: +.Bd -literal +vlans_em0="myvlan" +create_args_myvlan="vlan 102" +.Ed +.Pp If the .Va ifconfig_ Ns Aq Ar interface contains the keyword @@ -1205,7 +1244,7 @@ This is intended to replace the no longe .Va pccard_ifconfig variable. .Pp -It is also possible to rename interface by doing: +It is also possible to rename an interface by doing: .Bd -literal ifconfig_ed0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" @@ -1242,6 +1281,12 @@ Now this works only for IPv6 link local .It Va cloned_interfaces .Pq Vt str Set to the list of clonable network interfaces to create on this host. +Further cloning arguments may be passed to the +.Xr ifconfig 8 +.Cm create +command for each interface by setting the +.Va create_args_ Ns Aq Ar interface +variable. Entries in .Va cloned_interfaces are automatically appended to From owner-svn-src-stable@FreeBSD.ORG Tue Jan 12 22:28:59 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89CDF1065670; Tue, 12 Jan 2010 22:28:59 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77DE58FC17; Tue, 12 Jan 2010 22:28:59 +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 o0CMSx18019024; Tue, 12 Jan 2010 22:28:59 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CMSxxe019022; Tue, 12 Jan 2010 22:28:59 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001122228.o0CMSxxe019022@svn.freebsd.org> From: Christian Brueffer Date: Tue, 12 Jan 2010 22:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202179 - stable/7/share/man/man4/man4.i386 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 22:28:59 -0000 Author: brueffer Date: Tue Jan 12 22:28:59 2010 New Revision: 202179 URL: http://svn.freebsd.org/changeset/base/202179 Log: MFC: r197276 Correct a sysctl name. Modified: stable/7/share/man/man4/man4.i386/acpi_panasonic.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/man4.i386/acpi_panasonic.4 ============================================================================== --- stable/7/share/man/man4/man4.i386/acpi_panasonic.4 Tue Jan 12 22:22:27 2010 (r202178) +++ stable/7/share/man/man4/man4.i386/acpi_panasonic.4 Tue Jan 12 22:28:59 2010 (r202179) @@ -144,7 +144,7 @@ The following MIBs are available: The maximum level of brightness. The value is read only and automatically set according to hardware model. -.It Va hw.acpi.panasonic.lcd_brightness_max +.It Va hw.acpi.panasonic.lcd_brightness_min The minimum level of brightness. The value is read only and automatically set according to hardware model. From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 18:12:22 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 427671065672; Wed, 13 Jan 2010 18:12:22 +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 311598FC17; Wed, 13 Jan 2010 18:12: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 o0DICM93083392; Wed, 13 Jan 2010 18:12:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DICMhH083390; Wed, 13 Jan 2010 18:12:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001131812.o0DICMhH083390@svn.freebsd.org> From: John Baldwin Date: Wed, 13 Jan 2010 18:12: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: r202201 - stable/8/lib/libc/stdtime X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:12:22 -0000 Author: jhb Date: Wed Jan 13 18:12:21 2010 New Revision: 202201 URL: http://svn.freebsd.org/changeset/base/202201 Log: MFC 199607, 200797, 201270, 201669: Use pthread_once() to initialize the thread-local storage for localtime() and gmtime() and _once() to initialize gmt state rather than home-rolled versions using pthread mutex locks. Modified: stable/8/lib/libc/stdtime/localtime.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/stdtime/localtime.c ============================================================================== --- stable/8/lib/libc/stdtime/localtime.c Wed Jan 13 18:09:54 2010 (r202200) +++ stable/8/lib/libc/stdtime/localtime.c Wed Jan 13 18:12:21 2010 (r202201) @@ -235,9 +235,14 @@ static struct state gmtmem; static char lcl_TZname[TZ_STRLEN_MAX + 1]; static int lcl_is_set; -static int gmt_is_set; +static pthread_once_t gmt_once = PTHREAD_ONCE_INIT; static pthread_rwlock_t lcl_rwlock = PTHREAD_RWLOCK_INITIALIZER; -static pthread_mutex_t gmt_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_once_t gmtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t gmtime_key; +static int gmtime_key_error; +static pthread_once_t localtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t localtime_key; +static int localtime_key_error; char * tzname[2] = { wildabbr, @@ -1407,27 +1412,24 @@ struct tm * const tmp; return result; } +static void +localtime_key_init(void) +{ + + localtime_key_error = _pthread_key_create(&localtime_key, free); +} + struct tm * localtime(timep) const time_t * const timep; { - static pthread_mutex_t localtime_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_key_t localtime_key = -1; struct tm *p_tm; - int r; if (__isthreaded != 0) { - if (localtime_key < 0) { - _pthread_mutex_lock(&localtime_mutex); - if (localtime_key < 0) { - if ((r = _pthread_key_create(&localtime_key, - free)) != 0) { - _pthread_mutex_unlock(&localtime_mutex); - errno = r; - return(NULL); - } - } - _pthread_mutex_unlock(&localtime_mutex); + _pthread_once(&localtime_once, localtime_key_init); + if (localtime_key_error != 0) { + errno = localtime_key_error; + return(NULL); } p_tm = _pthread_getspecific(localtime_key); if (p_tm == NULL) { @@ -1464,6 +1466,17 @@ struct tm * tmp; return tmp; } +static void +gmt_init(void) +{ + +#ifdef ALL_STATE + gmtptr = (struct state *) malloc(sizeof *gmtptr); + if (gmtptr != NULL) +#endif /* defined ALL_STATE */ + gmtload(gmtptr); +} + /* ** gmtsub is to gmtime as localsub is to localtime. */ @@ -1476,16 +1489,7 @@ struct tm * const tmp; { register struct tm * result; - _MUTEX_LOCK(&gmt_mutex); - if (!gmt_is_set) { -#ifdef ALL_STATE - gmtptr = (struct state *) malloc(sizeof *gmtptr); - if (gmtptr != NULL) -#endif /* defined ALL_STATE */ - gmtload(gmtptr); - gmt_is_set = TRUE; - } - _MUTEX_UNLOCK(&gmt_mutex); + _once(&gmt_once, gmt_init); result = timesub(timep, offset, gmtptr, tmp); #ifdef TM_ZONE /* @@ -1509,27 +1513,24 @@ struct tm * const tmp; return result; } +static void +gmtime_key_init(void) +{ + + gmtime_key_error = _pthread_key_create(&gmtime_key, free); +} + struct tm * gmtime(timep) const time_t * const timep; { - static pthread_mutex_t gmtime_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_key_t gmtime_key = -1; struct tm *p_tm; - int r; if (__isthreaded != 0) { - if (gmtime_key < 0) { - _pthread_mutex_lock(&gmtime_mutex); - if (gmtime_key < 0) { - if ((r = _pthread_key_create(&gmtime_key, - free)) != 0) { - _pthread_mutex_unlock(&gmtime_mutex); - errno = r; - return(NULL); - } - } - _pthread_mutex_unlock(&gmtime_mutex); + _pthread_once(&gmtime_once, gmtime_key_init); + if (gmtime_key_error != 0) { + errno = gmtime_key_error; + return(NULL); } /* * Changed to follow POSIX.1 threads standard, which From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 18:12:37 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B388310657D5; Wed, 13 Jan 2010 18:12:37 +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 A1F7C8FC28; Wed, 13 Jan 2010 18:12:37 +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 o0DICb3N083492; Wed, 13 Jan 2010 18:12:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DICbJi083490; Wed, 13 Jan 2010 18:12:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001131812.o0DICbJi083490@svn.freebsd.org> From: John Baldwin Date: Wed, 13 Jan 2010 18:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202202 - stable/7/lib/libc/stdtime X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:12:37 -0000 Author: jhb Date: Wed Jan 13 18:12:37 2010 New Revision: 202202 URL: http://svn.freebsd.org/changeset/base/202202 Log: MFC 199607, 200797, 201270, 201669: Use pthread_once() to initialize the thread-local storage for localtime() and gmtime() and _once() to initialize gmt state rather than home-rolled versions using pthread mutex locks. Modified: stable/7/lib/libc/stdtime/localtime.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdtime/localtime.c ============================================================================== --- stable/7/lib/libc/stdtime/localtime.c Wed Jan 13 18:12:21 2010 (r202201) +++ stable/7/lib/libc/stdtime/localtime.c Wed Jan 13 18:12:37 2010 (r202202) @@ -235,9 +235,14 @@ static struct state gmtmem; static char lcl_TZname[TZ_STRLEN_MAX + 1]; static int lcl_is_set; -static int gmt_is_set; +static pthread_once_t gmt_once = PTHREAD_ONCE_INIT; static pthread_rwlock_t lcl_rwlock = PTHREAD_RWLOCK_INITIALIZER; -static pthread_mutex_t gmt_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_once_t gmtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t gmtime_key; +static int gmtime_key_error; +static pthread_once_t localtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t localtime_key; +static int localtime_key_error; char * tzname[2] = { wildabbr, @@ -1407,26 +1412,25 @@ struct tm * const tmp; return result; } +static void +localtime_key_init(void) +{ + + localtime_key_error = _pthread_key_create(&localtime_key, free); +} + struct tm * localtime(timep) const time_t * const timep; { - static pthread_mutex_t localtime_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_key_t localtime_key = -1; struct tm *p_tm; - int r; if (__isthreaded != 0) { - _pthread_mutex_lock(&localtime_mutex); - if (localtime_key < 0) { - if ((r = _pthread_key_create(&localtime_key, free)) - != 0) { - _pthread_mutex_unlock(&localtime_mutex); - errno = r; - return(NULL); - } + _pthread_once(&localtime_once, localtime_key_init); + if (localtime_key_error != 0) { + errno = localtime_key_error; + return(NULL); } - _pthread_mutex_unlock(&localtime_mutex); p_tm = _pthread_getspecific(localtime_key); if (p_tm == NULL) { if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) @@ -1462,6 +1466,17 @@ struct tm * tmp; return tmp; } +static void +gmt_init(void) +{ + +#ifdef ALL_STATE + gmtptr = (struct state *) malloc(sizeof *gmtptr); + if (gmtptr != NULL) +#endif /* defined ALL_STATE */ + gmtload(gmtptr); +} + /* ** gmtsub is to gmtime as localsub is to localtime. */ @@ -1474,16 +1489,7 @@ struct tm * const tmp; { register struct tm * result; - _MUTEX_LOCK(&gmt_mutex); - if (!gmt_is_set) { - gmt_is_set = TRUE; -#ifdef ALL_STATE - gmtptr = (struct state *) malloc(sizeof *gmtptr); - if (gmtptr != NULL) -#endif /* defined ALL_STATE */ - gmtload(gmtptr); - } - _MUTEX_UNLOCK(&gmt_mutex); + _once(&gmt_once, gmt_init); result = timesub(timep, offset, gmtptr, tmp); #ifdef TM_ZONE /* @@ -1507,25 +1513,25 @@ struct tm * const tmp; return result; } +static void +gmtime_key_init(void) +{ + + gmtime_key_error = _pthread_key_create(&gmtime_key, free); +} + struct tm * gmtime(timep) const time_t * const timep; { - static pthread_mutex_t gmtime_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_key_t gmtime_key = -1; struct tm *p_tm; - int r; if (__isthreaded != 0) { - _pthread_mutex_lock(&gmtime_mutex); - if (gmtime_key < 0) { - if ((r = _pthread_key_create(&gmtime_key, free)) != 0) { - _pthread_mutex_unlock(&gmtime_mutex); - errno = r; - return(NULL); - } + _pthread_once(&gmtime_once, gmtime_key_init); + if (gmtime_key_error != 0) { + errno = gmtime_key_error; + return(NULL); } - _pthread_mutex_unlock(&gmtime_mutex); /* * Changed to follow POSIX.1 threads standard, which * is what BSD currently has. From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 19:55:52 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B2E4106566B; Wed, 13 Jan 2010 19:55:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 787018FC2D; Wed, 13 Jan 2010 19:55:52 +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 o0DJtpJA007135; Wed, 13 Jan 2010 19:55:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DJtpF5007130; Wed, 13 Jan 2010 19:55:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001131955.o0DJtpF5007130@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 19:55:51 +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: r202221 - in stable/8/sys/sparc64: pci sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 19:55:52 -0000 Author: marius Date: Wed Jan 13 19:55:51 2010 New Revision: 202221 URL: http://svn.freebsd.org/changeset/base/202221 Log: MFC: 197164 Factor out the duplicated macro for the device type used in the OFW device tree for PCI bridges and add a new one for PCI Express. While at it, take advantage of the former for the rman(9) work- around in jbusppm(4). Modified: stable/8/sys/sparc64/pci/ofw_pci.h stable/8/sys/sparc64/pci/psycho.c stable/8/sys/sparc64/pci/schizo.c stable/8/sys/sparc64/sparc64/jbusppm.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) Modified: stable/8/sys/sparc64/pci/ofw_pci.h ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pci.h Wed Jan 13 19:46:53 2010 (r202220) +++ stable/8/sys/sparc64/pci/ofw_pci.h Wed Jan 13 19:55:51 2010 (r202221) @@ -44,6 +44,10 @@ typedef uint32_t ofw_pci_intr_t; #define OFW_PCI_CS_MEM32 0x02 #define OFW_PCI_CS_MEM64 0x03 +/* OFW device types */ +#define OFW_TYPE_PCI "pci" +#define OFW_TYPE_PCIE "pciex" + struct ofw_pci_ranges { uint32_t cspace; uint32_t child_hi; Modified: stable/8/sys/sparc64/pci/psycho.c ============================================================================== --- stable/8/sys/sparc64/pci/psycho.c Wed Jan 13 19:46:53 2010 (r202220) +++ stable/8/sys/sparc64/pci/psycho.c Wed Jan 13 19:55:51 2010 (r202221) @@ -224,8 +224,6 @@ struct psycho_dma_sync { * providing two PCI buses. */ -#define OFW_PCI_TYPE "pci" - struct psycho_desc { const char *pd_string; int pd_mode; @@ -275,7 +273,7 @@ psycho_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && psycho_get_desc(dev) != NULL) { device_set_desc(dev, "U2P UPA-PCI bridge"); return (0); Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Wed Jan 13 19:46:53 2010 (r202220) +++ stable/8/sys/sparc64/pci/schizo.c Wed Jan 13 19:55:51 2010 (r202221) @@ -209,8 +209,6 @@ struct schizo_dma_sync { #define SCHIZO_ICON_WRITE_8(sc, offs, v) \ SCHIZO_SPC_WRITE_8(STX_ICON, (sc), (offs), (v)) -#define OFW_PCI_TYPE "pci" - struct schizo_desc { const char *sd_string; int sd_mode; @@ -244,7 +242,7 @@ schizo_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && schizo_get_desc(dev) != NULL) { device_set_desc(dev, "Sun Host-PCI bridge"); return (0); Modified: stable/8/sys/sparc64/sparc64/jbusppm.c ============================================================================== --- stable/8/sys/sparc64/sparc64/jbusppm.c Wed Jan 13 19:46:53 2010 (r202220) +++ stable/8/sys/sparc64/sparc64/jbusppm.c Wed Jan 13 19:55:51 2010 (r202221) @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if 1 +#include +#endif + #define JBUSPPM_NREG 2 #define JBUSPPM_DEVID 0 @@ -150,7 +154,7 @@ jbusppm_attach(device_t dev) for (j = 0; j < nchildren; j++) { if (ofw_bus_get_type(children[j]) != NULL && strcmp(ofw_bus_get_type(children[j]), - "pci") == 0 && + OFW_TYPE_PCI) == 0 && ofw_bus_get_compat(children[j]) != NULL && strcmp(ofw_bus_get_compat(children[j]), "pci108e,a801") == 0 && From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 19:56:03 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABBB106576D; Wed, 13 Jan 2010 19:56:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF4E88FC26; Wed, 13 Jan 2010 19:56:02 +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 o0DJu2b2007209; Wed, 13 Jan 2010 19:56:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DJu2e7007204; Wed, 13 Jan 2010 19:56:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001131956.o0DJu2e7007204@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 19:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202222 - in stable/7/sys/sparc64: pci sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 19:56:03 -0000 Author: marius Date: Wed Jan 13 19:56:02 2010 New Revision: 202222 URL: http://svn.freebsd.org/changeset/base/202222 Log: MFC: 197164 Factor out the duplicated macro for the device type used in the OFW device tree for PCI bridges and add a new one for PCI Express. While at it, take advantage of the former for the rman(9) work- around in jbusppm(4). Modified: stable/7/sys/sparc64/pci/ofw_pci.h stable/7/sys/sparc64/pci/psycho.c stable/7/sys/sparc64/pci/schizo.c stable/7/sys/sparc64/sparc64/jbusppm.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pci.h ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pci.h Wed Jan 13 19:55:51 2010 (r202221) +++ stable/7/sys/sparc64/pci/ofw_pci.h Wed Jan 13 19:56:02 2010 (r202222) @@ -44,6 +44,10 @@ typedef uint32_t ofw_pci_intr_t; #define OFW_PCI_CS_MEM32 0x02 #define OFW_PCI_CS_MEM64 0x03 +/* OFW device types */ +#define OFW_TYPE_PCI "pci" +#define OFW_TYPE_PCIE "pciex" + struct ofw_pci_ranges { uint32_t cspace; uint32_t child_hi; Modified: stable/7/sys/sparc64/pci/psycho.c ============================================================================== --- stable/7/sys/sparc64/pci/psycho.c Wed Jan 13 19:55:51 2010 (r202221) +++ stable/7/sys/sparc64/pci/psycho.c Wed Jan 13 19:56:02 2010 (r202222) @@ -225,8 +225,6 @@ struct psycho_dma_sync { * providing two PCI buses. */ -#define OFW_PCI_TYPE "pci" - struct psycho_desc { const char *pd_string; int pd_mode; @@ -276,7 +274,7 @@ psycho_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && psycho_get_desc(dev) != NULL) { device_set_desc(dev, "U2P UPA-PCI bridge"); return (0); Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Wed Jan 13 19:55:51 2010 (r202221) +++ stable/7/sys/sparc64/pci/schizo.c Wed Jan 13 19:56:02 2010 (r202222) @@ -210,8 +210,6 @@ struct schizo_dma_sync { #define SCHIZO_ICON_WRITE_8(sc, offs, v) \ SCHIZO_SPC_WRITE_8(STX_ICON, (sc), (offs), (v)) -#define OFW_PCI_TYPE "pci" - struct schizo_desc { const char *sd_string; int sd_mode; @@ -245,7 +243,7 @@ schizo_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && schizo_get_desc(dev) != NULL) { device_set_desc(dev, "Sun Host-PCI bridge"); return (0); Modified: stable/7/sys/sparc64/sparc64/jbusppm.c ============================================================================== --- stable/7/sys/sparc64/sparc64/jbusppm.c Wed Jan 13 19:55:51 2010 (r202221) +++ stable/7/sys/sparc64/sparc64/jbusppm.c Wed Jan 13 19:56:02 2010 (r202222) @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if 1 +#include +#endif + #define JBUSPPM_NREG 2 #define JBUSPPM_DEVID 0 @@ -150,7 +154,7 @@ jbusppm_attach(device_t dev) for (j = 0; j < nchildren; j++) { if (ofw_bus_get_type(children[j]) != NULL && strcmp(ofw_bus_get_type(children[j]), - "pci") == 0 && + OFW_TYPE_PCI) == 0 && ofw_bus_get_compat(children[j]) != NULL && strcmp(ofw_bus_get_compat(children[j]), "pci108e,a801") == 0 && From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 19:59:13 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA49F106568B; Wed, 13 Jan 2010 19:59:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C72928FC1A; Wed, 13 Jan 2010 19:59: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 o0DJxDiF007985; Wed, 13 Jan 2010 19:59:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DJxDCI007977; Wed, 13 Jan 2010 19:59:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001131959.o0DJxDCI007977@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 19:59:13 +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: r202223 - in stable/8/sys: dev/auxio sparc64/central sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 19:59:14 -0000 Author: marius Date: Wed Jan 13 19:59:13 2010 New Revision: 202223 URL: http://svn.freebsd.org/changeset/base/202223 Log: MFC: r200815, r200816 Provide and consume missing module dependency information. Modified: stable/8/sys/dev/auxio/auxio.c stable/8/sys/sparc64/central/central.c stable/8/sys/sparc64/fhc/fhc.c stable/8/sys/sparc64/pci/apb.c stable/8/sys/sparc64/pci/ofw_pcib.c stable/8/sys/sparc64/sbus/sbus.c stable/8/sys/sparc64/sparc64/nexus.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) Modified: stable/8/sys/dev/auxio/auxio.c ============================================================================== --- stable/8/sys/dev/auxio/auxio.c Wed Jan 13 19:56:02 2010 (r202222) +++ stable/8/sys/dev/auxio/auxio.c Wed Jan 13 19:59:13 2010 (r202223) @@ -56,7 +56,7 @@ */ /* - * AUXIO registers support on the sbus & ebus2, used for the floppy driver + * AUXIO registers support on the SBus & EBus2, used for the floppy driver * and to control the system LED, for the BLINK option. */ @@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$"); #include /* - * on sun4u, auxio exists with one register (LED) on the sbus, and 5 - * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI + * On sun4u, auxio exists with one register (LED) on the SBus, and 5 + * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI * OSCILLATOR, and TEMP SENSE. */ @@ -142,6 +142,7 @@ static driver_t auxio_sbus_driver = { static devclass_t auxio_devclass; DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, sbus, 1, 1, 1); /* EBus */ static device_method_t auxio_ebus_methods[] = { @@ -158,6 +159,7 @@ static driver_t auxio_ebus_driver = { }; DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, ebus, 1, 1, 1); MODULE_VERSION(auxio, 1); #define AUXIO_LOCK_INIT(sc) \ Modified: stable/8/sys/sparc64/central/central.c ============================================================================== --- stable/8/sys/sparc64/central/central.c Wed Jan 13 19:56:02 2010 (r202222) +++ stable/8/sys/sparc64/central/central.c Wed Jan 13 19:59:13 2010 (r202223) @@ -106,6 +106,7 @@ static driver_t central_driver = { static devclass_t central_devclass; DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(central, 1); static int Modified: stable/8/sys/sparc64/fhc/fhc.c ============================================================================== --- stable/8/sys/sparc64/fhc/fhc.c Wed Jan 13 19:56:02 2010 (r202222) +++ stable/8/sys/sparc64/fhc/fhc.c Wed Jan 13 19:59:13 2010 (r202223) @@ -120,8 +120,9 @@ static driver_t fhc_driver = { static devclass_t fhc_devclass; DRIVER_MODULE(fhc, central, fhc_driver, fhc_devclass, 0, 0); -DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0); MODULE_DEPEND(fhc, central, 1, 1, 1); +DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(fhc, 1); static const struct intr_controller fhc_ic = { Modified: stable/8/sys/sparc64/pci/apb.c ============================================================================== --- stable/8/sys/sparc64/pci/apb.c Wed Jan 13 19:56:02 2010 (r202222) +++ stable/8/sys/sparc64/pci/apb.c Wed Jan 13 19:59:13 2010 (r202223) @@ -112,6 +112,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc)); DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(apb, pci, 1, 1, 1); /* APB specific registers */ #define APBR_IOMAP 0xde Modified: stable/8/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:56:02 2010 (r202222) +++ stable/8/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:59:13 2010 (r202223) @@ -94,6 +94,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods, sizeof(struct ofw_pcib_gen_softc)); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); static int ofw_pcib_probe(device_t dev) Modified: stable/8/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/8/sys/sparc64/sbus/sbus.c Wed Jan 13 19:56:02 2010 (r202222) +++ stable/8/sys/sparc64/sbus/sbus.c Wed Jan 13 19:59:13 2010 (r202223) @@ -248,6 +248,7 @@ static driver_t sbus_driver = { static devclass_t sbus_devclass; DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0); +MODULE_DEPEND(sbus, nexus, 1, 1, 1); MODULE_VERSION(sbus, 1); #define OFW_SBUS_TYPE "sbus" Modified: stable/8/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/8/sys/sparc64/sparc64/nexus.c Wed Jan 13 19:56:02 2010 (r202222) +++ stable/8/sys/sparc64/sparc64/nexus.c Wed Jan 13 19:59:13 2010 (r202223) @@ -145,6 +145,7 @@ static devclass_t nexus_devclass; DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +MODULE_VERSION(nexus, 1); static const char *const nexus_excl_name[] = { "aliases", From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 19:59:20 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F3491065769; Wed, 13 Jan 2010 19:59:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1328FC22; Wed, 13 Jan 2010 19:59: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 o0DJxKFU008058; Wed, 13 Jan 2010 19:59:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DJxJba008050; Wed, 13 Jan 2010 19:59:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001131959.o0DJxJba008050@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 19:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202224 - in stable/7/sys: dev/auxio sparc64/central sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 19:59:20 -0000 Author: marius Date: Wed Jan 13 19:59:19 2010 New Revision: 202224 URL: http://svn.freebsd.org/changeset/base/202224 Log: MFC: r200815, r200816 Provide and consume missing module dependency information. Modified: stable/7/sys/dev/auxio/auxio.c stable/7/sys/sparc64/central/central.c stable/7/sys/sparc64/fhc/fhc.c stable/7/sys/sparc64/pci/apb.c stable/7/sys/sparc64/pci/ofw_pcib.c stable/7/sys/sparc64/sbus/sbus.c stable/7/sys/sparc64/sparc64/nexus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/auxio/auxio.c ============================================================================== --- stable/7/sys/dev/auxio/auxio.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/dev/auxio/auxio.c Wed Jan 13 19:59:19 2010 (r202224) @@ -56,7 +56,7 @@ */ /* - * AUXIO registers support on the sbus & ebus2, used for the floppy driver + * AUXIO registers support on the SBus & EBus2, used for the floppy driver * and to control the system LED, for the BLINK option. */ @@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$"); #include /* - * on sun4u, auxio exists with one register (LED) on the sbus, and 5 - * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI + * On sun4u, auxio exists with one register (LED) on the SBus, and 5 + * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI * OSCILLATOR, and TEMP SENSE. */ @@ -142,6 +142,7 @@ static driver_t auxio_sbus_driver = { static devclass_t auxio_devclass; DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, sbus, 1, 1, 1); /* EBus */ static device_method_t auxio_ebus_methods[] = { @@ -158,6 +159,7 @@ static driver_t auxio_ebus_driver = { }; DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, ebus, 1, 1, 1); MODULE_VERSION(auxio, 1); #define AUXIO_LOCK_INIT(sc) \ Modified: stable/7/sys/sparc64/central/central.c ============================================================================== --- stable/7/sys/sparc64/central/central.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/central/central.c Wed Jan 13 19:59:19 2010 (r202224) @@ -105,6 +105,7 @@ static driver_t central_driver = { static devclass_t central_devclass; DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(central, 1); static int Modified: stable/7/sys/sparc64/fhc/fhc.c ============================================================================== --- stable/7/sys/sparc64/fhc/fhc.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/fhc/fhc.c Wed Jan 13 19:59:19 2010 (r202224) @@ -119,8 +119,9 @@ static driver_t fhc_driver = { static devclass_t fhc_devclass; DRIVER_MODULE(fhc, central, fhc_driver, fhc_devclass, 0, 0); -DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0); MODULE_DEPEND(fhc, central, 1, 1, 1); +DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(fhc, 1); static const struct intr_controller fhc_ic = { Modified: stable/7/sys/sparc64/pci/apb.c ============================================================================== --- stable/7/sys/sparc64/pci/apb.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/pci/apb.c Wed Jan 13 19:59:19 2010 (r202224) @@ -113,6 +113,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc)); DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(apb, pci, 1, 1, 1); /* APB specific registers */ #define APBR_IOMAP 0xde Modified: stable/7/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:59:19 2010 (r202224) @@ -95,6 +95,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods, sizeof(struct ofw_pcib_gen_softc)); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); static int ofw_pcib_probe(device_t dev) Modified: stable/7/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/7/sys/sparc64/sbus/sbus.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/sbus/sbus.c Wed Jan 13 19:59:19 2010 (r202224) @@ -247,6 +247,7 @@ static driver_t sbus_driver = { static devclass_t sbus_devclass; DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0); +MODULE_DEPEND(sbus, nexus, 1, 1, 1); MODULE_VERSION(sbus, 1); #define OFW_SBUS_TYPE "sbus" Modified: stable/7/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/nexus.c Wed Jan 13 19:59:13 2010 (r202223) +++ stable/7/sys/sparc64/sparc64/nexus.c Wed Jan 13 19:59:19 2010 (r202224) @@ -145,6 +145,7 @@ static devclass_t nexus_devclass; DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +MODULE_VERSION(nexus, 1); static const char *const nexus_excl_name[] = { "aliases", From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:03:25 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43F7F1065672; Wed, 13 Jan 2010 20:03:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 303E38FC1D; Wed, 13 Jan 2010 20:03: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 o0DK3PbJ009056; Wed, 13 Jan 2010 20:03:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DK3Owe009044; Wed, 13 Jan 2010 20:03:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132003.o0DK3Owe009044@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:03: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: r202225 - in stable/8/sys: dev/auxio sparc64/central sparc64/ebus sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:03:25 -0000 Author: marius Date: Wed Jan 13 20:03:24 2010 New Revision: 202225 URL: http://svn.freebsd.org/changeset/base/202225 Log: MFC: r200874 Enroll these drivers in multipass probing. The motivation behind this is that the JBus to EBus bridges share the interrupt controller of a sibling JBus to PCIe bridge (at least as far as the OFW device tree is concerned, in reality they are part of the same chip) so we have to probe and attach the latter first. That happens to be also the case due to the fact that the JBus to PCIe bridges appear first in the OFW device tree but it doesn't hurt to ensure the right order. Modified: stable/8/sys/dev/auxio/auxio.c stable/8/sys/sparc64/central/central.c stable/8/sys/sparc64/ebus/ebus.c stable/8/sys/sparc64/fhc/fhc.c stable/8/sys/sparc64/pci/apb.c stable/8/sys/sparc64/pci/ofw_pcib.c stable/8/sys/sparc64/pci/ofw_pcibus.c stable/8/sys/sparc64/sbus/dma_sbus.c stable/8/sys/sparc64/sbus/sbus.c stable/8/sys/sparc64/sparc64/nexus.c stable/8/sys/sparc64/sparc64/upa.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) Modified: stable/8/sys/dev/auxio/auxio.c ============================================================================== --- stable/8/sys/dev/auxio/auxio.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/dev/auxio/auxio.c Wed Jan 13 20:03:24 2010 (r202225) @@ -141,7 +141,9 @@ static driver_t auxio_sbus_driver = { }; static devclass_t auxio_devclass; -DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0); +/* The probe order is handled by sbus(4). */ +EARLY_DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0, + BUS_PASS_DEFAULT); MODULE_DEPEND(auxio, sbus, 1, 1, 1); /* EBus */ @@ -158,7 +160,8 @@ static driver_t auxio_ebus_driver = { sizeof(struct auxio_softc) }; -DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0); +EARLY_DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0, + BUS_PASS_DEFAULT); MODULE_DEPEND(auxio, ebus, 1, 1, 1); MODULE_VERSION(auxio, 1); Modified: stable/8/sys/sparc64/central/central.c ============================================================================== --- stable/8/sys/sparc64/central/central.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/central/central.c Wed Jan 13 20:03:24 2010 (r202225) @@ -105,7 +105,8 @@ static driver_t central_driver = { static devclass_t central_devclass; -DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0); +EARLY_DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0, + BUS_PASS_BUS); MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(central, 1); Modified: stable/8/sys/sparc64/ebus/ebus.c ============================================================================== --- stable/8/sys/sparc64/ebus/ebus.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/ebus/ebus.c Wed Jan 13 20:03:24 2010 (r202225) @@ -138,7 +138,8 @@ static driver_t ebus_driver = { static devclass_t ebus_devclass; -DRIVER_MODULE(ebus, pci, ebus_driver, ebus_devclass, 0, 0); +EARLY_DRIVER_MODULE(ebus, pci, ebus_driver, ebus_devclass, 0, 0, + BUS_PASS_BUS); MODULE_DEPEND(ebus, pci, 1, 1, 1); MODULE_VERSION(ebus, 1); Modified: stable/8/sys/sparc64/fhc/fhc.c ============================================================================== --- stable/8/sys/sparc64/fhc/fhc.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/fhc/fhc.c Wed Jan 13 20:03:24 2010 (r202225) @@ -119,9 +119,11 @@ static driver_t fhc_driver = { static devclass_t fhc_devclass; -DRIVER_MODULE(fhc, central, fhc_driver, fhc_devclass, 0, 0); +EARLY_DRIVER_MODULE(fhc, central, fhc_driver, fhc_devclass, 0, 0, + BUS_PASS_BUS); MODULE_DEPEND(fhc, central, 1, 1, 1); -DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0); +EARLY_DRIVER_MODULE(fhc, nexus, fhc_driver, fhc_devclass, 0, 0, + BUS_PASS_BUS); MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(fhc, 1); Modified: stable/8/sys/sparc64/pci/apb.c ============================================================================== --- stable/8/sys/sparc64/pci/apb.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/pci/apb.c Wed Jan 13 20:03:24 2010 (r202225) @@ -111,7 +111,7 @@ static device_method_t apb_methods[] = { static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc)); -DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0); +EARLY_DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0, BUS_PASS_BUS); MODULE_DEPEND(apb, pci, 1, 1, 1); /* APB specific registers */ Modified: stable/8/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 20:03:24 2010 (r202225) @@ -93,7 +93,8 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods, sizeof(struct ofw_pcib_gen_softc)); -DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0); +EARLY_DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0, + BUS_PASS_BUS); MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); static int Modified: stable/8/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 20:03:24 2010 (r202225) @@ -101,7 +101,8 @@ static devclass_t pci_devclass; DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, 1 /* no softc */, pci_driver); -DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0); +EARLY_DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0, + BUS_PASS_BUS); MODULE_VERSION(ofw_pcibus, 1); MODULE_DEPEND(ofw_pcibus, pci, 1, 1, 1); Modified: stable/8/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- stable/8/sys/sparc64/sbus/dma_sbus.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/sbus/dma_sbus.c Wed Jan 13 20:03:24 2010 (r202225) @@ -149,7 +149,13 @@ static driver_t dma_driver = { sizeof(struct dma_softc), }; -DRIVER_MODULE(dma, sbus, dma_driver, dma_devclass, 0, 0); +/* + * The probe order is handled by sbus(4) as we don't want the variants + * with children to be attached earlier than the stand-alone controllers + * in order to generally preserve the OFW device tree order. + */ +EARLY_DRIVER_MODULE(dma, sbus, dma_driver, dma_devclass, 0, 0, + BUS_PASS_DEFAULT); MODULE_DEPEND(dma, sbus, 1, 1, 1); MODULE_VERSION(dma, 1); Modified: stable/8/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/8/sys/sparc64/sbus/sbus.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/sbus/sbus.c Wed Jan 13 20:03:24 2010 (r202225) @@ -247,7 +247,8 @@ static driver_t sbus_driver = { static devclass_t sbus_devclass; -DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0); +EARLY_DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0, + BUS_PASS_BUS); MODULE_DEPEND(sbus, nexus, 1, 1, 1); MODULE_VERSION(sbus, 1); Modified: stable/8/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/8/sys/sparc64/sparc64/nexus.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/sparc64/nexus.c Wed Jan 13 20:03:24 2010 (r202225) @@ -144,7 +144,8 @@ static device_method_t nexus_methods[] = static devclass_t nexus_devclass; DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); -DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, + BUS_PASS_BUS); MODULE_VERSION(nexus, 1); static const char *const nexus_excl_name[] = { Modified: stable/8/sys/sparc64/sparc64/upa.c ============================================================================== --- stable/8/sys/sparc64/sparc64/upa.c Wed Jan 13 19:59:19 2010 (r202224) +++ stable/8/sys/sparc64/sparc64/upa.c Wed Jan 13 20:03:24 2010 (r202225) @@ -151,7 +151,7 @@ static device_method_t upa_methods[] = { static devclass_t upa_devclass; DEFINE_CLASS_0(upa, upa_driver, upa_methods, sizeof(struct upa_softc)); -DRIVER_MODULE(upa, nexus, upa_driver, upa_devclass, 0, 0); +EARLY_DRIVER_MODULE(upa, nexus, upa_driver, upa_devclass, 0, 0, BUS_PASS_BUS); static const struct intr_controller upa_ic = { upa_intr_enable, From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:05:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAA7C1065694; Wed, 13 Jan 2010 20:05:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C03D78FC15; Wed, 13 Jan 2010 20:05:32 +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 o0DK5W25009590; Wed, 13 Jan 2010 20:05:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DK5WrP009588; Wed, 13 Jan 2010 20:05:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132005.o0DK5WrP009588@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:05:32 +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: r202226 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:05:33 -0000 Author: marius Date: Wed Jan 13 20:05:32 2010 New Revision: 202226 URL: http://svn.freebsd.org/changeset/base/202226 Log: MFC: r200876 Make these constants unsigned which is more appropriate. Modified: stable/8/sys/sparc64/include/bus_common.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) Modified: stable/8/sys/sparc64/include/bus_common.h ============================================================================== --- stable/8/sys/sparc64/include/bus_common.h Wed Jan 13 20:03:24 2010 (r202225) +++ stable/8/sys/sparc64/include/bus_common.h Wed Jan 13 20:05:32 2010 (r202226) @@ -39,18 +39,18 @@ #ifndef _MACHINE_BUS_COMMON_H_ #define _MACHINE_BUS_COMMON_H_ -#define INTMAP_V 0x080000000LL /* Interrupt valid (enabled) */ -#define INTMAP_TID_MASK 0x07c000000LL /* UPA target ID */ +#define INTMAP_V 0x080000000ULL /* Interrupt valid (enabled) */ +#define INTMAP_TID_MASK 0x07c000000ULL /* UPA target ID */ #define INTMAP_TID_SHIFT 26 -#define INTMAP_IGN_MASK 0x0000007c0LL /* Interrupt group no. */ +#define INTMAP_IGN_MASK 0x0000007c0ULL /* Interrupt group no. */ #define INTMAP_IGN_SHIFT 6 -#define INTMAP_INO_MASK 0x00000003fLL /* Interrupt number */ +#define INTMAP_INO_MASK 0x00000003fULL /* Interrupt number */ #define INTMAP_INR_MASK (INTMAP_IGN_MASK | INTMAP_INO_MASK) -#define INTMAP_SBUSSLOT_MASK 0x000000018LL /* SBus slot # */ -#define INTMAP_PCIBUS_MASK 0x000000010LL /* PCI bus number (A or B) */ -#define INTMAP_PCISLOT_MASK 0x00000000cLL /* PCI slot # */ -#define INTMAP_PCIINT_MASK 0x000000003LL /* PCI interrupt #A,#B,#C,#D */ -#define INTMAP_OBIO_MASK 0x000000020LL /* Onboard device */ +#define INTMAP_SBUSSLOT_MASK 0x000000018ULL /* SBus slot # */ +#define INTMAP_PCIBUS_MASK 0x000000010ULL /* PCI bus number (A or B) */ +#define INTMAP_PCISLOT_MASK 0x00000000cULL /* PCI slot # */ +#define INTMAP_PCIINT_MASK 0x000000003ULL /* PCI interrupt #A,#B,#C,#D */ +#define INTMAP_OBIO_MASK 0x000000020ULL /* Onboard device */ #define INTIGN(x) (((x) & INTMAP_IGN_MASK) >> INTMAP_IGN_SHIFT) #define INTVEC(x) ((x) & INTMAP_INR_MASK) #define INTSLOT(x) (((x) >> 3) & 0x7) From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:05:36 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16999106568D; Wed, 13 Jan 2010 20:05:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E06098FC13; Wed, 13 Jan 2010 20:05: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 o0DK5ZS9009656; Wed, 13 Jan 2010 20:05:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DK5ZZx009654; Wed, 13 Jan 2010 20:05:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132005.o0DK5ZZx009654@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202227 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:05:36 -0000 Author: marius Date: Wed Jan 13 20:05:35 2010 New Revision: 202227 URL: http://svn.freebsd.org/changeset/base/202227 Log: MFC: r200876 Make these constants unsigned which is more appropriate. Modified: stable/7/sys/sparc64/include/bus_common.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/bus_common.h ============================================================================== --- stable/7/sys/sparc64/include/bus_common.h Wed Jan 13 20:05:32 2010 (r202226) +++ stable/7/sys/sparc64/include/bus_common.h Wed Jan 13 20:05:35 2010 (r202227) @@ -39,18 +39,18 @@ #ifndef _MACHINE_BUS_COMMON_H_ #define _MACHINE_BUS_COMMON_H_ -#define INTMAP_V 0x080000000LL /* Interrupt valid (enabled) */ -#define INTMAP_TID_MASK 0x07c000000LL /* UPA target ID */ +#define INTMAP_V 0x080000000ULL /* Interrupt valid (enabled) */ +#define INTMAP_TID_MASK 0x07c000000ULL /* UPA target ID */ #define INTMAP_TID_SHIFT 26 -#define INTMAP_IGN_MASK 0x0000007c0LL /* Interrupt group no. */ +#define INTMAP_IGN_MASK 0x0000007c0ULL /* Interrupt group no. */ #define INTMAP_IGN_SHIFT 6 -#define INTMAP_INO_MASK 0x00000003fLL /* Interrupt number */ +#define INTMAP_INO_MASK 0x00000003fULL /* Interrupt number */ #define INTMAP_INR_MASK (INTMAP_IGN_MASK | INTMAP_INO_MASK) -#define INTMAP_SBUSSLOT_MASK 0x000000018LL /* SBus slot # */ -#define INTMAP_PCIBUS_MASK 0x000000010LL /* PCI bus number (A or B) */ -#define INTMAP_PCISLOT_MASK 0x00000000cLL /* PCI slot # */ -#define INTMAP_PCIINT_MASK 0x000000003LL /* PCI interrupt #A,#B,#C,#D */ -#define INTMAP_OBIO_MASK 0x000000020LL /* Onboard device */ +#define INTMAP_SBUSSLOT_MASK 0x000000018ULL /* SBus slot # */ +#define INTMAP_PCIBUS_MASK 0x000000010ULL /* PCI bus number (A or B) */ +#define INTMAP_PCISLOT_MASK 0x00000000cULL /* PCI slot # */ +#define INTMAP_PCIINT_MASK 0x000000003ULL /* PCI interrupt #A,#B,#C,#D */ +#define INTMAP_OBIO_MASK 0x000000020ULL /* Onboard device */ #define INTIGN(x) (((x) & INTMAP_IGN_MASK) >> INTMAP_IGN_SHIFT) #define INTVEC(x) ((x) & INTMAP_INR_MASK) #define INTSLOT(x) (((x) >> 3) & 0x7) From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:07:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FC5C106566B; Wed, 13 Jan 2010 20:07:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1A378FC12; Wed, 13 Jan 2010 20:07: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 o0DK7jGf010186; Wed, 13 Jan 2010 20:07:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DK7jfW010184; Wed, 13 Jan 2010 20:07:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132007.o0DK7jfW010184@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:07: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: r202228 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:07:46 -0000 Author: marius Date: Wed Jan 13 20:07:45 2010 New Revision: 202228 URL: http://svn.freebsd.org/changeset/base/202228 Log: MFC: r200878 - Add macros for the states of the interrupt clear registers. - Change INTMAP_VEC() to take an INO as its second argument rather than an INR. The former is what I actually intended with this macro and how it's currently used. Modified: stable/8/sys/sparc64/include/bus_common.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) Modified: stable/8/sys/sparc64/include/bus_common.h ============================================================================== --- stable/8/sys/sparc64/include/bus_common.h Wed Jan 13 20:05:35 2010 (r202227) +++ stable/8/sys/sparc64/include/bus_common.h Wed Jan 13 20:07:45 2010 (r202228) @@ -39,6 +39,10 @@ #ifndef _MACHINE_BUS_COMMON_H_ #define _MACHINE_BUS_COMMON_H_ +#define INTCLR_PENDING 0x000000003ULL /* Interrupt queued to CPU */ +#define INTCLR_RECEIVED 0x000000001ULL /* Interrupt received */ +#define INTCLR_IDLE 0x000000000ULL /* Interrupt idle */ + #define INTMAP_V 0x080000000ULL /* Interrupt valid (enabled) */ #define INTMAP_TID_MASK 0x07c000000ULL /* UPA target ID */ #define INTMAP_TID_SHIFT 26 @@ -60,9 +64,9 @@ (INTMAP_TID((mr), (mid)) | INTMAP_V) #define INTMAP_TID(mr, mid) \ (((mr) & ~INTMAP_TID_MASK) | ((mid) << INTMAP_TID_SHIFT)) -#define INTMAP_VEC(ign, inr) \ +#define INTMAP_VEC(ign, ino) \ ((((ign) << INTMAP_IGN_SHIFT) & INTMAP_IGN_MASK) | \ - ((inr) & INTMAP_INR_MASK)) + ((ino) & INTMAP_INO_MASK)) /* counter-timer support. */ void sparc64_counter_init(const char *name, bus_space_tag_t tag, From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:07:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0EBE1065676; Wed, 13 Jan 2010 20:07:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF92F8FC18; Wed, 13 Jan 2010 20:07: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 o0DK7k4Z010216; Wed, 13 Jan 2010 20:07:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DK7k8K010214; Wed, 13 Jan 2010 20:07:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132007.o0DK7k8K010214@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202229 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:07:47 -0000 Author: marius Date: Wed Jan 13 20:07:46 2010 New Revision: 202229 URL: http://svn.freebsd.org/changeset/base/202229 Log: MFC: r200878 - Add macros for the states of the interrupt clear registers. - Change INTMAP_VEC() to take an INO as its second argument rather than an INR. The former is what I actually intended with this macro and how it's currently used. Modified: stable/7/sys/sparc64/include/bus_common.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/bus_common.h ============================================================================== --- stable/7/sys/sparc64/include/bus_common.h Wed Jan 13 20:07:45 2010 (r202228) +++ stable/7/sys/sparc64/include/bus_common.h Wed Jan 13 20:07:46 2010 (r202229) @@ -39,6 +39,10 @@ #ifndef _MACHINE_BUS_COMMON_H_ #define _MACHINE_BUS_COMMON_H_ +#define INTCLR_PENDING 0x000000003ULL /* Interrupt queued to CPU */ +#define INTCLR_RECEIVED 0x000000001ULL /* Interrupt received */ +#define INTCLR_IDLE 0x000000000ULL /* Interrupt idle */ + #define INTMAP_V 0x080000000ULL /* Interrupt valid (enabled) */ #define INTMAP_TID_MASK 0x07c000000ULL /* UPA target ID */ #define INTMAP_TID_SHIFT 26 @@ -60,9 +64,9 @@ (INTMAP_TID((mr), (mid)) | INTMAP_V) #define INTMAP_TID(mr, mid) \ (((mr) & ~INTMAP_TID_MASK) | ((mid) << INTMAP_TID_SHIFT)) -#define INTMAP_VEC(ign, inr) \ +#define INTMAP_VEC(ign, ino) \ ((((ign) << INTMAP_IGN_SHIFT) & INTMAP_IGN_MASK) | \ - ((inr) & INTMAP_INR_MASK)) + ((ino) & INTMAP_INO_MASK)) /* counter-timer support. */ void sparc64_counter_init(const char *name, bus_space_tag_t tag, From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:32:54 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4867106568B; Wed, 13 Jan 2010 20:32:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1ECB8FC0C; Wed, 13 Jan 2010 20:32: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 o0DKWsDc015935; Wed, 13 Jan 2010 20:32:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKWsI6015933; Wed, 13 Jan 2010 20:32:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132032.o0DKWsI6015933@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:32:54 +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: r202232 - stable/8/sys/sparc64/ebus X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:32:55 -0000 Author: marius Date: Wed Jan 13 20:32:54 2010 New Revision: 202232 URL: http://svn.freebsd.org/changeset/base/202232 Log: MFC: r200879 - Add support for the JBus to EBus bridges which hang off of nexus(4) and are found in sun4u and sun4v machines based on the Fire ASIC. - Initialize the configuration space of the PCI to EBus variant the same way as OpenSolaris does. Modified: stable/8/sys/sparc64/ebus/ebus.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) Modified: stable/8/sys/sparc64/ebus/ebus.c ============================================================================== --- stable/8/sys/sparc64/ebus/ebus.c Wed Jan 13 20:30:16 2010 (r202231) +++ stable/8/sys/sparc64/ebus/ebus.c Wed Jan 13 20:32:54 2010 (r202232) @@ -1,6 +1,7 @@ /*- * Copyright (c) 1999, 2000 Matthew R. Green * Copyright (c) 2001 Thomas Moestl + * Copyright (c) 2009 by Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,7 +34,7 @@ __FBSDID("$FreeBSD$"); /* - * UltraSPARC 5 and beyond EBus support + * Driver for JBus to EBus and PCI to EBus bridges */ #include @@ -43,14 +44,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include #include +#include +#ifndef SUN4V +#include +#endif +#include #include #include @@ -59,11 +63,19 @@ __FBSDID("$FreeBSD$"); #include /* - * The register, ranges and interrupt map properties are identical to the ISA - * ones. + * The register, interrupt map and for the PCI variant also the ranges + * properties are identical to the ISA ones. */ #include +struct ebus_nexus_ranges { + uint32_t child_hi; + uint32_t child_lo; + uint32_t phys_hi; + uint32_t phys_lo; + uint32_t size; +}; + struct ebus_devinfo { struct ofw_bus_devinfo edi_obdinfo; struct resource_list edi_rl; @@ -76,32 +88,45 @@ struct ebus_rinfo { }; struct ebus_softc { - struct isa_ranges *sc_range; + void *sc_range; struct ebus_rinfo *sc_rinfo; + u_int sc_flags; +#define EBUS_PCI (1 << 0) + int sc_nrange; struct ofw_bus_iinfo sc_iinfo; + +#ifndef SUN4V + uint32_t sc_ign; +#endif }; -static device_probe_t ebus_probe; -static device_attach_t ebus_attach; +static device_probe_t ebus_nexus_probe; +static device_attach_t ebus_nexus_attach; +static device_probe_t ebus_pci_probe; +static device_attach_t ebus_pci_attach; static bus_print_child_t ebus_print_child; static bus_probe_nomatch_t ebus_probe_nomatch; static bus_alloc_resource_t ebus_alloc_resource; static bus_release_resource_t ebus_release_resource; +static bus_setup_intr_t ebus_setup_intr; static bus_get_resource_list_t ebus_get_resource_list; static ofw_bus_get_devinfo_t ebus_get_devinfo; -static struct ebus_devinfo *ebus_setup_dinfo(device_t, struct ebus_softc *, - phandle_t); -static void ebus_destroy_dinfo(struct ebus_devinfo *); -static int ebus_print_res(struct ebus_devinfo *); +static int ebus_attach(device_t dev, struct ebus_softc *sc, phandle_t node); +static struct ebus_devinfo *ebus_setup_dinfo(device_t dev, + struct ebus_softc *sc, phandle_t node); +static void ebus_destroy_dinfo(struct ebus_devinfo *edi); +static int ebus_print_res(struct ebus_devinfo *edi); + +static devclass_t ebus_devclass; -static device_method_t ebus_methods[] = { +static device_method_t ebus_nexus_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, ebus_probe), - DEVMETHOD(device_attach, ebus_attach), + DEVMETHOD(device_probe, ebus_nexus_probe), + DEVMETHOD(device_attach, ebus_nexus_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), @@ -113,7 +138,7 @@ static device_method_t ebus_methods[] = DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_release_resource, ebus_release_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_setup_intr, ebus_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_get_resource_list, ebus_get_resource_list), @@ -130,21 +155,80 @@ static device_method_t ebus_methods[] = KOBJMETHOD_END }; -static driver_t ebus_driver = { +static driver_t ebus_nexus_driver = { "ebus", - ebus_methods, + ebus_nexus_methods, sizeof(struct ebus_softc), }; -static devclass_t ebus_devclass; +/* + * NB: we rely on the interrupt controllers of the accompanying PCI-Express + * bridge to be registered as the nexus variant of the EBus bridges doesn't + * employ its own one. + */ +EARLY_DRIVER_MODULE(ebus, nexus, ebus_nexus_driver, ebus_devclass, 0, 0, + BUS_PASS_BUS + 1); +MODULE_DEPEND(ebus, nexus, 1, 1, 1); + +static device_method_t ebus_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ebus_pci_probe), + DEVMETHOD(device_attach, ebus_pci_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), -EARLY_DRIVER_MODULE(ebus, pci, ebus_driver, ebus_devclass, 0, 0, + /* Bus interface */ + DEVMETHOD(bus_print_child, ebus_print_child), + DEVMETHOD(bus_probe_nomatch, ebus_probe_nomatch), + DEVMETHOD(bus_alloc_resource, ebus_alloc_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, ebus_release_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, ebus_get_resource_list), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ebus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + KOBJMETHOD_END +}; + +static driver_t ebus_pci_driver = { + "ebus", + ebus_pci_methods, + sizeof(struct ebus_softc), +}; + +EARLY_DRIVER_MODULE(ebus, pci, ebus_pci_driver, ebus_devclass, 0, 0, BUS_PASS_BUS); MODULE_DEPEND(ebus, pci, 1, 1, 1); MODULE_VERSION(ebus, 1); static int -ebus_probe(device_t dev) +ebus_nexus_probe(device_t dev) +{ + const char* compat; + + compat = ofw_bus_get_compat(dev); + if (compat != NULL && strcmp(ofw_bus_get_name(dev), "ebus") == 0 && + strcmp(compat, "jbus-ebus") == 0) { + device_set_desc(dev, "JBus-EBus bridge"); + return (BUS_PROBE_GENERIC); + } + return (ENXIO); +} + +static int +ebus_pci_probe(device_t dev) { if (pci_get_class(dev) != PCIC_BRIDGE || @@ -158,27 +242,58 @@ ebus_probe(device_t dev) device_set_desc(dev, "PCI-EBus3 bridge"); else return (ENXIO); - return (0); + return (BUS_PROBE_GENERIC); } static int -ebus_attach(device_t dev) +ebus_nexus_attach(device_t dev) +{ + struct ebus_softc *sc; + phandle_t node; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + +#ifndef SUN4V + if (OF_getprop(node, "portid", &sc->sc_ign, + sizeof(sc->sc_ign)) == -1) { + device_printf(dev, "could not determine IGN"); + return (ENXIO); + } +#endif + + sc->sc_nrange = OF_getprop_alloc(node, "ranges", + sizeof(struct ebus_nexus_ranges), &sc->sc_range); + if (sc->sc_nrange == -1) { + printf("%s: could not get ranges property\n", __func__); + return (ENXIO); + } + return (ebus_attach(dev, sc, node)); +} + +static int +ebus_pci_attach(device_t dev) { struct ebus_softc *sc; - struct ebus_devinfo *edi; struct ebus_rinfo *eri; struct resource *res; - device_t cdev; phandle_t node; int i, rnum, rid; sc = device_get_softc(dev); + sc->sc_flags |= EBUS_PCI; + + pci_write_config(dev, PCIR_COMMAND, + pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_SERRESPEN | + PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN, 2); + pci_write_config(dev, PCIR_CACHELNSZ, 16 /* 64 bytes */, 1); + pci_write_config(dev, PCIR_LATTIMER, 64 /* 64 PCI cycles */, 1); node = ofw_bus_get_node(dev); sc->sc_nrange = OF_getprop_alloc(node, "ranges", - sizeof(*sc->sc_range), (void **)&sc->sc_range); + sizeof(struct isa_ranges), &sc->sc_range); if (sc->sc_nrange == -1) { - printf("ebus_attach: could not get ranges property\n"); + printf("%s: could not get ranges property\n", __func__); return (ENXIO); } @@ -188,29 +303,52 @@ ebus_attach(device_t dev) /* For every range, there must be a matching resource. */ for (rnum = 0; rnum < sc->sc_nrange; rnum++) { eri = &sc->sc_rinfo[rnum]; - eri->eri_rtype = ofw_isa_range_restype(&sc->sc_range[rnum]); + eri->eri_rtype = ofw_isa_range_restype( + &((struct isa_ranges *)sc->sc_range)[rnum]); rid = PCIR_BAR(rnum); res = bus_alloc_resource_any(dev, eri->eri_rtype, &rid, RF_ACTIVE); if (res == NULL) { - printf("ebus_attach: failed to allocate range " - "resource!\n"); + printf("%s: failed to allocate range resource!\n", + __func__); goto fail; } eri->eri_res = res; eri->eri_rman.rm_type = RMAN_ARRAY; eri->eri_rman.rm_descr = "EBus range"; if (rman_init(&eri->eri_rman) != 0) { - printf("ebus_attach: failed to initialize rman!"); + printf("%s: failed to initialize rman!", __func__); goto fail; } if (rman_manage_region(&eri->eri_rman, rman_get_start(res), rman_get_end(res)) != 0) { - printf("ebus_attach: failed to register region!"); + printf("%s: failed to register region!", __func__); rman_fini(&eri->eri_rman); goto fail; } } + return (ebus_attach(dev, sc, node)); + + fail: + for (i = rnum; i >= 0; i--) { + eri = &sc->sc_rinfo[i]; + if (i < rnum) + rman_fini(&eri->eri_rman); + if (eri->eri_res != 0) { + bus_release_resource(dev, eri->eri_rtype, + PCIR_BAR(rnum), eri->eri_res); + } + } + free(sc->sc_rinfo, M_DEVBUF); + free(sc->sc_range, M_OFWPROP); + return (ENXIO); +} + +static int +ebus_attach(device_t dev, struct ebus_softc *sc, phandle_t node) +{ + struct ebus_devinfo *edi; + device_t cdev; ofw_bus_setup_iinfo(node, &sc->sc_iinfo, sizeof(ofw_isa_intr_t)); @@ -229,20 +367,6 @@ ebus_attach(device_t dev) device_set_ivars(cdev, edi); } return (bus_generic_attach(dev)); - -fail: - for (i = rnum; i >= 0; i--) { - eri = &sc->sc_rinfo[i]; - if (i < rnum) - rman_fini(&eri->eri_rman); - if (eri->eri_res != 0) { - bus_release_resource(dev, eri->eri_rtype, - PCIR_BAR(rnum), eri->eri_res); - } - } - free(sc->sc_rinfo, M_DEVBUF); - free(sc->sc_range, M_OFWPROP); - return (ENXIO); } static int @@ -274,28 +398,26 @@ ebus_alloc_resource(device_t bus, device struct resource_list_entry *rle = NULL; struct resource *res; struct ebus_rinfo *ri; + struct ebus_nexus_ranges *enr; bus_space_tag_t bt; bus_space_handle_t bh; - int passthrough = (device_get_parent(child) != bus); - int isdefault = (start == 0UL && end == ~0UL); - int ridx, rv; + uint64_t cend, cstart, offset; + int i, isdefault, passthrough, ridx, rv; - sc = (struct ebus_softc *)device_get_softc(bus); + isdefault = (start == 0UL && end == ~0UL); + passthrough = (device_get_parent(child) != bus); + sc = device_get_softc(bus); rl = BUS_GET_RESOURCE_LIST(bus, child); - /* - * Map EBus ranges to PCI ranges. This may include changing the - * allocation type. - */ switch (type) { case SYS_RES_MEMORY: KASSERT(!(isdefault && passthrough), - ("ebus_alloc_resource: passthrough of default alloc")); + ("%s: passthrough of default allocation", __func__)); if (!passthrough) { rle = resource_list_find(rl, type, *rid); if (rle == NULL) return (NULL); KASSERT(rle->res == NULL, - ("ebus_alloc_resource: resource entry is busy")); + ("%s: resource entry is busy", __func__)); if (isdefault) { start = rle->start; count = ulmax(count, rle->count); @@ -303,25 +425,53 @@ ebus_alloc_resource(device_t bus, device } } - (void)ofw_isa_range_map(sc->sc_range, sc->sc_nrange, - &start, &end, &ridx); + res = NULL; + if ((sc->sc_flags & EBUS_PCI) != 0) { + /* + * Map EBus ranges to PCI ranges. This may include + * changing the allocation type. + */ + (void)ofw_isa_range_map(sc->sc_range, sc->sc_nrange, + &start, &end, &ridx); + ri = &sc->sc_rinfo[ridx]; + res = rman_reserve_resource(&ri->eri_rman, start, end, + count, flags, child); + if (res == NULL) + return (NULL); + rman_set_rid(res, *rid); + bt = rman_get_bustag(ri->eri_res); + rman_set_bustag(res, bt); + rv = bus_space_subregion(bt, + rman_get_bushandle(ri->eri_res), + rman_get_start(res) - rman_get_start(ri->eri_res), + count, &bh); + if (rv != 0) { + rman_release_resource(res); + return (NULL); + } + rman_set_bushandle(res, bh); + } else { + /* Map EBus ranges to nexus ranges. */ + for (i = 0; i < sc->sc_nrange; i++) { + enr = &((struct ebus_nexus_ranges *) + sc->sc_range)[i]; + cstart = (((uint64_t)enr->child_hi) << 32) | + enr->child_lo; + cend = cstart + enr->size - 1; + if (start >= cstart && end <= cend) { + offset = + (((uint64_t)enr->phys_hi) << 32) | + enr->phys_lo; + start += offset - cstart; + end += offset - cstart; + res = bus_generic_alloc_resource(bus, + child, type, rid, start, end, + count, flags); + break; + } + } - ri = &sc->sc_rinfo[ridx]; - res = rman_reserve_resource(&ri->eri_rman, start, end, count, - flags, child); - if (res == NULL) - return (NULL); - rman_set_rid(res, *rid); - bt = rman_get_bustag(ri->eri_res); - rman_set_bustag(res, bt); - rv = bus_space_subregion(bt, rman_get_bushandle(ri->eri_res), - rman_get_start(res) - rman_get_start(ri->eri_res), count, - &bh); - if (rv != 0) { - rman_release_resource(res); - return (NULL); } - rman_set_bushandle(res, bh); if (!passthrough) rle->res = res; return (res); @@ -336,34 +486,77 @@ static int ebus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { + struct ebus_softc *sc; struct resource_list *rl; struct resource_list_entry *rle; - int passthrough = (device_get_parent(child) != bus); - int rv; + int passthrough, rv; + passthrough = (device_get_parent(child) != bus); rl = BUS_GET_RESOURCE_LIST(bus, child); switch (type) { case SYS_RES_MEMORY: + sc = device_get_softc(bus); + if ((sc->sc_flags & EBUS_PCI) == 0) + return (resource_list_release(rl, bus, child, type, + rid, res)); if ((rv = rman_release_resource(res)) != 0) return (rv); if (!passthrough) { rle = resource_list_find(rl, type, rid); - KASSERT(rle != NULL, ("ebus_release_resource: " - "resource entry not found!")); - KASSERT(rle->res != NULL, ("ebus_alloc_resource: " - "resource entry is not busy")); + KASSERT(rle != NULL, + ("%s: resource entry not found!", __func__)); + KASSERT(rle->res != NULL, + ("%s: resource entry is not busy", __func__)); rle->res = NULL; } break; case SYS_RES_IRQ: return (resource_list_release(rl, bus, child, type, rid, res)); default: - panic("ebus_release_resource: unsupported resource type %d", - type); + panic("%s: unsupported resource type %d", __func__, type); } return (0); } +static int +ebus_setup_intr(device_t dev, device_t child, struct resource *ires, + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) +{ +#ifndef SUN4V + struct ebus_softc *sc; + u_long vec; + + sc = device_get_softc(dev); + if ((sc->sc_flags & EBUS_PCI) == 0) { + /* + * Make sure the vector is fully specified. This isn't + * necessarily the case with the PCI variant. + */ + vec = rman_get_start(ires); + if (INTIGN(vec) != sc->sc_ign) { + device_printf(dev, + "invalid interrupt vector 0x%lx\n", vec); + return (EINVAL); + } + + /* + * As we rely on the interrupt controllers of the + * accompanying PCI-Express bridge ensure at least + * something is registered for this vector. + */ + if (intr_vectors[vec].iv_ic == NULL) { + device_printf(dev, + "invalid interrupt controller for vector 0x%lx\n", + vec); + return (EINVAL); + } + } +#endif + return (bus_generic_setup_intr(dev, child, ires, flags, filt, intr, + arg, cookiep)); +} + static struct resource_list * ebus_get_resource_list(device_t dev, device_t child) { @@ -385,12 +578,13 @@ ebus_get_devinfo(device_t bus, device_t static struct ebus_devinfo * ebus_setup_dinfo(device_t dev, struct ebus_softc *sc, phandle_t node) { + struct isa_regs reg, *regs; + ofw_isa_intr_t intr, *intrs; struct ebus_devinfo *edi; - struct isa_regs *reg; - ofw_isa_intr_t *intrs; - ofw_pci_intr_t rintr; - u_int64_t start; - int nreg, nintr, i; + uint64_t start; + uint32_t rintr; + int i, nintr, nreg, rv; + uint8_t maskbuf[sizeof(reg) + sizeof(intr)]; edi = malloc(sizeof(*edi), M_DEVBUF, M_ZERO | M_WAITOK); if (ofw_bus_gen_setup_devinfo(&edi->edi_obdinfo, node) != 0) { @@ -398,40 +592,51 @@ ebus_setup_dinfo(device_t dev, struct eb return (NULL); } resource_list_init(&edi->edi_rl); - nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getprop_alloc(node, "reg", sizeof(*regs), (void **)®s); if (nreg == -1) { device_printf(dev, "<%s>: incomplete\n", edi->edi_obdinfo.obd_name); - goto fail; + ebus_destroy_dinfo(edi); + return (NULL); } for (i = 0; i < nreg; i++) { - start = ISA_REG_PHYS(reg + i); - resource_list_add(&edi->edi_rl, SYS_RES_MEMORY, i, - start, start + reg[i].size - 1, reg[i].size); + start = ISA_REG_PHYS(regs + i); + (void)resource_list_add(&edi->edi_rl, SYS_RES_MEMORY, i, + start, start + regs[i].size - 1, regs[i].size); } - free(reg, M_OFWPROP); + free(regs, M_OFWPROP); nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs), (void **)&intrs); + if (nintr == -1) + return (edi); for (i = 0; i < nintr; i++) { - rintr = ofw_isa_route_intr(dev, node, &sc->sc_iinfo, intrs[i]); - if (rintr == PCI_INVALID_IRQ) { + rv = 0; + if ((sc->sc_flags & EBUS_PCI) != 0) { + rintr = ofw_isa_route_intr(dev, node, &sc->sc_iinfo, + intrs[i]); + } else { + intr = intrs[i]; + rv = ofw_bus_lookup_imap(node, &sc->sc_iinfo, ®, + sizeof(reg), &intr, sizeof(intr), &rintr, + sizeof(rintr), maskbuf); +#ifndef SUN4V + if (rv != 0) + rintr = INTMAP_VEC(sc->sc_ign, rintr); +#endif + } + if ((sc->sc_flags & EBUS_PCI) == 0 ? rv == 0 : + rintr == PCI_INVALID_IRQ) { device_printf(dev, "<%s>: could not map EBus interrupt %d\n", edi->edi_obdinfo.obd_name, intrs[i]); - free(intrs, M_OFWPROP); - goto fail; + continue; } - resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i, - rintr, rintr, 1); + (void)resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i, rintr, + rintr, 1); } free(intrs, M_OFWPROP); - return (edi); - -fail: - ebus_destroy_dinfo(edi); - return (NULL); } static void From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:33:01 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC7BD1065704; Wed, 13 Jan 2010 20:33:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC5E48FC13; Wed, 13 Jan 2010 20:33: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 o0DKX0t5016016; Wed, 13 Jan 2010 20:33:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKX0M8016014; Wed, 13 Jan 2010 20:33:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132033.o0DKX0M8016014@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202233 - stable/7/sys/sparc64/ebus X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:33:01 -0000 Author: marius Date: Wed Jan 13 20:33:00 2010 New Revision: 202233 URL: http://svn.freebsd.org/changeset/base/202233 Log: MFC: r200879 - Add support for the JBus to EBus bridges which hang off of nexus(4) and are found in sun4u and sun4v machines based on the Fire ASIC. - Initialize the configuration space of the PCI to EBus variant the same way as OpenSolaris does. Modified: stable/7/sys/sparc64/ebus/ebus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/ebus/ebus.c ============================================================================== --- stable/7/sys/sparc64/ebus/ebus.c Wed Jan 13 20:32:54 2010 (r202232) +++ stable/7/sys/sparc64/ebus/ebus.c Wed Jan 13 20:33:00 2010 (r202233) @@ -1,6 +1,7 @@ /*- * Copyright (c) 1999, 2000 Matthew R. Green * Copyright (c) 2001 Thomas Moestl + * Copyright (c) 2009 by Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,7 +34,7 @@ __FBSDID("$FreeBSD$"); /* - * UltraSPARC 5 and beyond EBus support + * Driver for JBus to EBus and PCI to EBus bridges */ #include @@ -43,14 +44,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include #include +#include +#ifndef SUN4V +#include +#endif +#include #include #include @@ -60,11 +64,19 @@ __FBSDID("$FreeBSD$"); #include /* - * The register, ranges and interrupt map properties are identical to the ISA - * ones. + * The register, interrupt map and for the PCI variant also the ranges + * properties are identical to the ISA ones. */ #include +struct ebus_nexus_ranges { + uint32_t child_hi; + uint32_t child_lo; + uint32_t phys_hi; + uint32_t phys_lo; + uint32_t size; +}; + struct ebus_devinfo { struct ofw_bus_devinfo edi_obdinfo; struct resource_list edi_rl; @@ -77,32 +89,45 @@ struct ebus_rinfo { }; struct ebus_softc { - struct isa_ranges *sc_range; + void *sc_range; struct ebus_rinfo *sc_rinfo; + u_int sc_flags; +#define EBUS_PCI (1 << 0) + int sc_nrange; struct ofw_bus_iinfo sc_iinfo; + +#ifndef SUN4V + uint32_t sc_ign; +#endif }; -static device_probe_t ebus_probe; -static device_attach_t ebus_attach; +static device_probe_t ebus_nexus_probe; +static device_attach_t ebus_nexus_attach; +static device_probe_t ebus_pci_probe; +static device_attach_t ebus_pci_attach; static bus_print_child_t ebus_print_child; static bus_probe_nomatch_t ebus_probe_nomatch; static bus_alloc_resource_t ebus_alloc_resource; static bus_release_resource_t ebus_release_resource; +static bus_setup_intr_t ebus_setup_intr; static bus_get_resource_list_t ebus_get_resource_list; static ofw_bus_get_devinfo_t ebus_get_devinfo; -static struct ebus_devinfo *ebus_setup_dinfo(device_t, struct ebus_softc *, - phandle_t); -static void ebus_destroy_dinfo(struct ebus_devinfo *); -static int ebus_print_res(struct ebus_devinfo *); +static int ebus_attach(device_t dev, struct ebus_softc *sc, phandle_t node); +static struct ebus_devinfo *ebus_setup_dinfo(device_t dev, + struct ebus_softc *sc, phandle_t node); +static void ebus_destroy_dinfo(struct ebus_devinfo *edi); +static int ebus_print_res(struct ebus_devinfo *edi); + +static devclass_t ebus_devclass; -static device_method_t ebus_methods[] = { +static device_method_t ebus_nexus_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, ebus_probe), - DEVMETHOD(device_attach, ebus_attach), + DEVMETHOD(device_probe, ebus_nexus_probe), + DEVMETHOD(device_attach, ebus_nexus_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), @@ -114,7 +139,7 @@ static device_method_t ebus_methods[] = DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_release_resource, ebus_release_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_setup_intr, ebus_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_get_resource_list, ebus_get_resource_list), @@ -130,20 +155,79 @@ static device_method_t ebus_methods[] = KOBJMETHOD_END }; -static driver_t ebus_driver = { +static driver_t ebus_nexus_driver = { "ebus", - ebus_methods, + ebus_nexus_methods, sizeof(struct ebus_softc), }; -static devclass_t ebus_devclass; +/* + * XXX: we rely on the interrupt controllers of the accompanying PCI-Express + * bridge to be registered as the nexus variant of the EBus bridges doesn't + * employ its own one. However, without multipass probing we have no way to + * specify that fact and thus have to rely on the OFW device tree provding an + * appropriate order. + */ +DRIVER_MODULE(ebus, nexus, ebus_nexus_driver, ebus_devclass, 0, 0); +MODULE_DEPEND(ebus, nexus, 1, 1, 1); + +static device_method_t ebus_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ebus_pci_probe), + DEVMETHOD(device_attach, ebus_pci_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, ebus_print_child), + DEVMETHOD(bus_probe_nomatch, ebus_probe_nomatch), + DEVMETHOD(bus_alloc_resource, ebus_alloc_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, ebus_release_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, ebus_get_resource_list), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ebus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), -DRIVER_MODULE(ebus, pci, ebus_driver, ebus_devclass, 0, 0); + KOBJMETHOD_END +}; + +static driver_t ebus_pci_driver = { + "ebus", + ebus_pci_methods, + sizeof(struct ebus_softc), +}; + +DRIVER_MODULE(ebus, pci, ebus_pci_driver, ebus_devclass, 0, 0); MODULE_DEPEND(ebus, pci, 1, 1, 1); MODULE_VERSION(ebus, 1); static int -ebus_probe(device_t dev) +ebus_nexus_probe(device_t dev) +{ + const char* compat; + + compat = ofw_bus_get_compat(dev); + if (compat != NULL && strcmp(ofw_bus_get_name(dev), "ebus") == 0 && + strcmp(compat, "jbus-ebus") == 0) { + device_set_desc(dev, "JBus-EBus bridge"); + return (BUS_PROBE_GENERIC); + } + return (ENXIO); +} + +static int +ebus_pci_probe(device_t dev) { if (pci_get_class(dev) != PCIC_BRIDGE || @@ -157,27 +241,58 @@ ebus_probe(device_t dev) device_set_desc(dev, "PCI-EBus3 bridge"); else return (ENXIO); - return (0); + return (BUS_PROBE_GENERIC); } static int -ebus_attach(device_t dev) +ebus_nexus_attach(device_t dev) +{ + struct ebus_softc *sc; + phandle_t node; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + +#ifndef SUN4V + if (OF_getprop(node, "portid", &sc->sc_ign, + sizeof(sc->sc_ign)) == -1) { + device_printf(dev, "could not determine IGN"); + return (ENXIO); + } +#endif + + sc->sc_nrange = OF_getprop_alloc(node, "ranges", + sizeof(struct ebus_nexus_ranges), &sc->sc_range); + if (sc->sc_nrange == -1) { + printf("%s: could not get ranges property\n", __func__); + return (ENXIO); + } + return (ebus_attach(dev, sc, node)); +} + +static int +ebus_pci_attach(device_t dev) { struct ebus_softc *sc; - struct ebus_devinfo *edi; struct ebus_rinfo *eri; struct resource *res; - device_t cdev; phandle_t node; int i, rnum, rid; sc = device_get_softc(dev); + sc->sc_flags |= EBUS_PCI; + + pci_write_config(dev, PCIR_COMMAND, + pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_SERRESPEN | + PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN, 2); + pci_write_config(dev, PCIR_CACHELNSZ, 16 /* 64 bytes */, 1); + pci_write_config(dev, PCIR_LATTIMER, 64 /* 64 PCI cycles */, 1); node = ofw_bus_get_node(dev); sc->sc_nrange = OF_getprop_alloc(node, "ranges", - sizeof(*sc->sc_range), (void **)&sc->sc_range); + sizeof(struct isa_ranges), &sc->sc_range); if (sc->sc_nrange == -1) { - printf("ebus_attach: could not get ranges property\n"); + printf("%s: could not get ranges property\n", __func__); return (ENXIO); } @@ -187,29 +302,52 @@ ebus_attach(device_t dev) /* For every range, there must be a matching resource. */ for (rnum = 0; rnum < sc->sc_nrange; rnum++) { eri = &sc->sc_rinfo[rnum]; - eri->eri_rtype = ofw_isa_range_restype(&sc->sc_range[rnum]); + eri->eri_rtype = ofw_isa_range_restype( + &((struct isa_ranges *)sc->sc_range)[rnum]); rid = PCIR_BAR(rnum); res = bus_alloc_resource_any(dev, eri->eri_rtype, &rid, RF_ACTIVE); if (res == NULL) { - printf("ebus_attach: failed to allocate range " - "resource!\n"); + printf("%s: failed to allocate range resource!\n", + __func__); goto fail; } eri->eri_res = res; eri->eri_rman.rm_type = RMAN_ARRAY; eri->eri_rman.rm_descr = "EBus range"; if (rman_init(&eri->eri_rman) != 0) { - printf("ebus_attach: failed to initialize rman!"); + printf("%s: failed to initialize rman!", __func__); goto fail; } if (rman_manage_region(&eri->eri_rman, rman_get_start(res), rman_get_end(res)) != 0) { - printf("ebus_attach: failed to register region!"); + printf("%s: failed to register region!", __func__); rman_fini(&eri->eri_rman); goto fail; } } + return (ebus_attach(dev, sc, node)); + + fail: + for (i = rnum; i >= 0; i--) { + eri = &sc->sc_rinfo[i]; + if (i < rnum) + rman_fini(&eri->eri_rman); + if (eri->eri_res != 0) { + bus_release_resource(dev, eri->eri_rtype, + PCIR_BAR(rnum), eri->eri_res); + } + } + free(sc->sc_rinfo, M_DEVBUF); + free(sc->sc_range, M_OFWPROP); + return (ENXIO); +} + +static int +ebus_attach(device_t dev, struct ebus_softc *sc, phandle_t node) +{ + struct ebus_devinfo *edi; + device_t cdev; ofw_bus_setup_iinfo(node, &sc->sc_iinfo, sizeof(ofw_isa_intr_t)); @@ -228,20 +366,6 @@ ebus_attach(device_t dev) device_set_ivars(cdev, edi); } return (bus_generic_attach(dev)); - -fail: - for (i = rnum; i >= 0; i--) { - eri = &sc->sc_rinfo[i]; - if (i < rnum) - rman_fini(&eri->eri_rman); - if (eri->eri_res != 0) { - bus_release_resource(dev, eri->eri_rtype, - PCIR_BAR(rnum), eri->eri_res); - } - } - free(sc->sc_rinfo, M_DEVBUF); - free(sc->sc_range, M_OFWPROP); - return (ENXIO); } static int @@ -273,28 +397,26 @@ ebus_alloc_resource(device_t bus, device struct resource_list_entry *rle = NULL; struct resource *res; struct ebus_rinfo *ri; + struct ebus_nexus_ranges *enr; bus_space_tag_t bt; bus_space_handle_t bh; - int passthrough = (device_get_parent(child) != bus); - int isdefault = (start == 0UL && end == ~0UL); - int ridx, rv; + uint64_t cend, cstart, offset; + int i, isdefault, passthrough, ridx, rv; - sc = (struct ebus_softc *)device_get_softc(bus); + isdefault = (start == 0UL && end == ~0UL); + passthrough = (device_get_parent(child) != bus); + sc = device_get_softc(bus); rl = BUS_GET_RESOURCE_LIST(bus, child); - /* - * Map EBus ranges to PCI ranges. This may include changing the - * allocation type. - */ switch (type) { case SYS_RES_MEMORY: KASSERT(!(isdefault && passthrough), - ("ebus_alloc_resource: passthrough of default alloc")); + ("%s: passthrough of default allocation", __func__)); if (!passthrough) { rle = resource_list_find(rl, type, *rid); if (rle == NULL) return (NULL); KASSERT(rle->res == NULL, - ("ebus_alloc_resource: resource entry is busy")); + ("%s: resource entry is busy", __func__)); if (isdefault) { start = rle->start; count = ulmax(count, rle->count); @@ -302,25 +424,53 @@ ebus_alloc_resource(device_t bus, device } } - (void)ofw_isa_range_map(sc->sc_range, sc->sc_nrange, - &start, &end, &ridx); + res = NULL; + if ((sc->sc_flags & EBUS_PCI) != 0) { + /* + * Map EBus ranges to PCI ranges. This may include + * changing the allocation type. + */ + (void)ofw_isa_range_map(sc->sc_range, sc->sc_nrange, + &start, &end, &ridx); + ri = &sc->sc_rinfo[ridx]; + res = rman_reserve_resource(&ri->eri_rman, start, end, + count, flags, child); + if (res == NULL) + return (NULL); + rman_set_rid(res, *rid); + bt = rman_get_bustag(ri->eri_res); + rman_set_bustag(res, bt); + rv = bus_space_subregion(bt, + rman_get_bushandle(ri->eri_res), + rman_get_start(res) - rman_get_start(ri->eri_res), + count, &bh); + if (rv != 0) { + rman_release_resource(res); + return (NULL); + } + rman_set_bushandle(res, bh); + } else { + /* Map EBus ranges to nexus ranges. */ + for (i = 0; i < sc->sc_nrange; i++) { + enr = &((struct ebus_nexus_ranges *) + sc->sc_range)[i]; + cstart = (((uint64_t)enr->child_hi) << 32) | + enr->child_lo; + cend = cstart + enr->size - 1; + if (start >= cstart && end <= cend) { + offset = + (((uint64_t)enr->phys_hi) << 32) | + enr->phys_lo; + start += offset - cstart; + end += offset - cstart; + res = bus_generic_alloc_resource(bus, + child, type, rid, start, end, + count, flags); + break; + } + } - ri = &sc->sc_rinfo[ridx]; - res = rman_reserve_resource(&ri->eri_rman, start, end, count, - flags, child); - if (res == NULL) - return (NULL); - rman_set_rid(res, *rid); - bt = rman_get_bustag(ri->eri_res); - rman_set_bustag(res, bt); - rv = bus_space_subregion(bt, rman_get_bushandle(ri->eri_res), - rman_get_start(res) - rman_get_start(ri->eri_res), count, - &bh); - if (rv != 0) { - rman_release_resource(res); - return (NULL); } - rman_set_bushandle(res, bh); if (!passthrough) rle->res = res; return (res); @@ -335,34 +485,77 @@ static int ebus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { + struct ebus_softc *sc; struct resource_list *rl; struct resource_list_entry *rle; - int passthrough = (device_get_parent(child) != bus); - int rv; + int passthrough, rv; + passthrough = (device_get_parent(child) != bus); rl = BUS_GET_RESOURCE_LIST(bus, child); switch (type) { case SYS_RES_MEMORY: + sc = device_get_softc(bus); + if ((sc->sc_flags & EBUS_PCI) == 0) + return (resource_list_release(rl, bus, child, type, + rid, res)); if ((rv = rman_release_resource(res)) != 0) return (rv); if (!passthrough) { rle = resource_list_find(rl, type, rid); - KASSERT(rle != NULL, ("ebus_release_resource: " - "resource entry not found!")); - KASSERT(rle->res != NULL, ("ebus_alloc_resource: " - "resource entry is not busy")); + KASSERT(rle != NULL, + ("%s: resource entry not found!", __func__)); + KASSERT(rle->res != NULL, + ("%s: resource entry is not busy", __func__)); rle->res = NULL; } break; case SYS_RES_IRQ: return (resource_list_release(rl, bus, child, type, rid, res)); default: - panic("ebus_release_resource: unsupported resource type %d", - type); + panic("%s: unsupported resource type %d", __func__, type); } return (0); } +static int +ebus_setup_intr(device_t dev, device_t child, struct resource *ires, + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) +{ +#ifndef SUN4V + struct ebus_softc *sc; + u_long vec; + + sc = device_get_softc(dev); + if ((sc->sc_flags & EBUS_PCI) == 0) { + /* + * Make sure the vector is fully specified. This isn't + * necessarily the case with the PCI variant. + */ + vec = rman_get_start(ires); + if (INTIGN(vec) != sc->sc_ign) { + device_printf(dev, + "invalid interrupt vector 0x%lx\n", vec); + return (EINVAL); + } + + /* + * As we rely on the interrupt controllers of the + * accompanying PCI-Express bridge ensure at least + * something is registered for this vector. + */ + if (intr_vectors[vec].iv_ic == NULL) { + device_printf(dev, + "invalid interrupt controller for vector 0x%lx\n", + vec); + return (EINVAL); + } + } +#endif + return (bus_generic_setup_intr(dev, child, ires, flags, filt, intr, + arg, cookiep)); +} + static struct resource_list * ebus_get_resource_list(device_t dev, device_t child) { @@ -384,12 +577,13 @@ ebus_get_devinfo(device_t bus, device_t static struct ebus_devinfo * ebus_setup_dinfo(device_t dev, struct ebus_softc *sc, phandle_t node) { + struct isa_regs reg, *regs; + ofw_isa_intr_t intr, *intrs; struct ebus_devinfo *edi; - struct isa_regs *reg; - ofw_isa_intr_t *intrs; - ofw_pci_intr_t rintr; - u_int64_t start; - int nreg, nintr, i; + uint64_t start; + uint32_t rintr; + int i, nintr, nreg, rv; + uint8_t maskbuf[sizeof(reg) + sizeof(intr)]; edi = malloc(sizeof(*edi), M_DEVBUF, M_ZERO | M_WAITOK); if (ofw_bus_gen_setup_devinfo(&edi->edi_obdinfo, node) != 0) { @@ -397,40 +591,51 @@ ebus_setup_dinfo(device_t dev, struct eb return (NULL); } resource_list_init(&edi->edi_rl); - nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getprop_alloc(node, "reg", sizeof(*regs), (void **)®s); if (nreg == -1) { device_printf(dev, "<%s>: incomplete\n", edi->edi_obdinfo.obd_name); - goto fail; + ebus_destroy_dinfo(edi); + return (NULL); } for (i = 0; i < nreg; i++) { - start = ISA_REG_PHYS(reg + i); - resource_list_add(&edi->edi_rl, SYS_RES_MEMORY, i, - start, start + reg[i].size - 1, reg[i].size); + start = ISA_REG_PHYS(regs + i); + (void)resource_list_add(&edi->edi_rl, SYS_RES_MEMORY, i, + start, start + regs[i].size - 1, regs[i].size); } - free(reg, M_OFWPROP); + free(regs, M_OFWPROP); nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs), (void **)&intrs); + if (nintr == -1) + return (edi); for (i = 0; i < nintr; i++) { - rintr = ofw_isa_route_intr(dev, node, &sc->sc_iinfo, intrs[i]); - if (rintr == PCI_INVALID_IRQ) { + rv = 0; + if ((sc->sc_flags & EBUS_PCI) != 0) { + rintr = ofw_isa_route_intr(dev, node, &sc->sc_iinfo, + intrs[i]); + } else { + intr = intrs[i]; + rv = ofw_bus_lookup_imap(node, &sc->sc_iinfo, ®, + sizeof(reg), &intr, sizeof(intr), &rintr, + sizeof(rintr), maskbuf); +#ifndef SUN4V + if (rv != 0) + rintr = INTMAP_VEC(sc->sc_ign, rintr); +#endif + } + if ((sc->sc_flags & EBUS_PCI) == 0 ? rv == 0 : + rintr == PCI_INVALID_IRQ) { device_printf(dev, "<%s>: could not map EBus interrupt %d\n", edi->edi_obdinfo.obd_name, intrs[i]); - free(intrs, M_OFWPROP); - goto fail; + continue; } - resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i, - rintr, rintr, 1); + (void)resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i, rintr, + rintr, 1); } free(intrs, M_OFWPROP); - return (edi); - -fail: - ebus_destroy_dinfo(edi); - return (NULL); } static void From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:35:28 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13BAB106566B; Wed, 13 Jan 2010 20:35:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 024BD8FC12; Wed, 13 Jan 2010 20:35:28 +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 o0DKZRFm016626; Wed, 13 Jan 2010 20:35:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKZRYc016624; Wed, 13 Jan 2010 20:35:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132035.o0DKZRYc016624@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:35:27 +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: r202234 - stable/8/sys/sparc64/isa X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:35:28 -0000 Author: marius Date: Wed Jan 13 20:35:27 2010 New Revision: 202234 URL: http://svn.freebsd.org/changeset/base/202234 Log: MFC: r200880 - Correct an off-by-one error when calculating the end of a child range. - Spell the PCI TLA in uppercase. Modified: stable/8/sys/sparc64/isa/ofw_isa.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) Modified: stable/8/sys/sparc64/isa/ofw_isa.c ============================================================================== --- stable/8/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:33:00 2010 (r202233) +++ stable/8/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:35:27 2010 (r202234) @@ -79,11 +79,11 @@ ofw_isa_range_map(struct isa_ranges *ran for (i = 0; i < nrange; i++) { r = &range[i]; cstart = ISA_RANGE_CHILD(r); - cend = cstart + r->size; + cend = cstart + r->size - 1; if (*start < cstart || *start > cend) continue; if (*end < cstart || *end > cend) { - panic("ofw_isa_map_iorange: iorange crosses pci " + panic("ofw_isa_map_iorange: iorange crosses PCI " "ranges (%#lx not in %#lx - %#lx)", *end, cstart, cend); } From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:35:37 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA03010657AE; Wed, 13 Jan 2010 20:35:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8C258FC15; Wed, 13 Jan 2010 20:35:37 +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 o0DKZbtH016696; Wed, 13 Jan 2010 20:35:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKZbSf016694; Wed, 13 Jan 2010 20:35:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132035.o0DKZbSf016694@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202235 - stable/7/sys/sparc64/isa X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:35:37 -0000 Author: marius Date: Wed Jan 13 20:35:37 2010 New Revision: 202235 URL: http://svn.freebsd.org/changeset/base/202235 Log: MFC: r200880 - Correct an off-by-one error when calculating the end of a child range. - Spell the PCI TLA in uppercase. Modified: stable/7/sys/sparc64/isa/ofw_isa.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/isa/ofw_isa.c ============================================================================== --- stable/7/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:35:27 2010 (r202234) +++ stable/7/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:35:37 2010 (r202235) @@ -79,11 +79,11 @@ ofw_isa_range_map(struct isa_ranges *ran for (i = 0; i < nrange; i++) { r = &range[i]; cstart = ISA_RANGE_CHILD(r); - cend = cstart + r->size; + cend = cstart + r->size - 1; if (*start < cstart || *start > cend) continue; if (*end < cstart || *end > cend) { - panic("ofw_isa_map_iorange: iorange crosses pci " + panic("ofw_isa_map_iorange: iorange crosses PCI " "ranges (%#lx not in %#lx - %#lx)", *end, cstart, cend); } From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:35:43 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E028106584B; Wed, 13 Jan 2010 20:35:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B7658FC18; Wed, 13 Jan 2010 20:35: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 o0DKZhxx016766; Wed, 13 Jan 2010 20:35:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKZhfb016764; Wed, 13 Jan 2010 20:35:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132035.o0DKZhfb016764@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202236 - stable/6/sys/sparc64/isa X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:35:43 -0000 Author: marius Date: Wed Jan 13 20:35:43 2010 New Revision: 202236 URL: http://svn.freebsd.org/changeset/base/202236 Log: MFC: r200880 - Correct an off-by-one error when calculating the end of a child range. - Spell the PCI TLA in uppercase. Modified: stable/6/sys/sparc64/isa/ofw_isa.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/sparc64/isa/ofw_isa.c ============================================================================== --- stable/6/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:35:37 2010 (r202235) +++ stable/6/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:35:43 2010 (r202236) @@ -79,11 +79,11 @@ ofw_isa_range_map(struct isa_ranges *ran for (i = 0; i < nrange; i++) { r = &range[i]; cstart = ISA_RANGE_CHILD(r); - cend = cstart + r->size; + cend = cstart + r->size - 1; if (*start < cstart || *start > cend) continue; if (*end < cstart || *end > cend) { - panic("ofw_isa_map_iorange: iorange crosses pci " + panic("ofw_isa_map_iorange: iorange crosses PCI " "ranges (%#lx not in %#lx - %#lx)", *end, cstart, cend); } From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:40:49 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D7F8106568D; Wed, 13 Jan 2010 20:40:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B9CC8FC08; Wed, 13 Jan 2010 20:40:49 +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 o0DKenNS018010; Wed, 13 Jan 2010 20:40:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKenF4018008; Wed, 13 Jan 2010 20:40:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132040.o0DKenF4018008@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:40:49 +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: r202237 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:40:49 -0000 Author: marius Date: Wed Jan 13 20:40:49 2010 New Revision: 202237 URL: http://svn.freebsd.org/changeset/base/202237 Log: MFC: r200914 Don't use an out register to hold the vector number across the call of the interrupt handler in intr_fast() as the handler might clobber it (no in-tree handler currently does but an upcoming one will). While at it, tidy the register usage in the interrupt counting code. Modified: stable/8/sys/sparc64/sparc64/interrupt.S 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) Modified: stable/8/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/8/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:35:43 2010 (r202236) +++ stable/8/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:40:49 2010 (r202237) @@ -176,7 +176,7 @@ ENTRY(intr_fast) 3: ldx [%l0 + IR_FUNC], %o0 ldx [%l0 + IR_ARG], %o1 - lduw [%l0 + IR_VEC], %o2 + lduw [%l0 + IR_VEC], %l2 ldx [PCPU(IRFREE)], %l1 stx %l1, [%l0 + IR_NEXT] @@ -188,17 +188,17 @@ ENTRY(intr_fast) call %o0 mov %o1, %o0 - /* intrcnt[intr_countp[%o2]]++ */ - SET(intrcnt, %l7, %l2) /* %l2 = intrcnt */ - prefetcha [%l2] ASI_N, 1 - SET(intr_countp, %l7, %l3) /* %l3 = intr_countp */ - sllx %o2, 1, %l4 /* %l4 = vec << 1 */ - lduh [%l4 + %l3], %l5 /* %l5 = intr_countp[%o2] */ - sllx %l5, 3, %l6 /* %l6 = intr_countp[%o2] << 3 */ - add %l6, %l2, %l7 /* %l7 = intrcnt[intr_countp[%o2]] */ - ldx [%l7], %l2 + /* intrcnt[intr_countp[%l2]]++ */ + SET(intrcnt, %l7, %l3) /* %l3 = intrcnt */ + prefetcha [%l3] ASI_N, 1 + SET(intr_countp, %l7, %l4) /* %l4 = intr_countp */ + sllx %l2, 1, %l2 /* %l2 = vec << 1 */ + lduh [%l4 + %l2], %l4 /* %l4 = intr_countp[%l2] */ + sllx %l4, 3, %l4 /* %l4 = intr_countp[%l2] << 3 */ + add %l4, %l3, %l4 /* %l4 = intrcnt[intr_countp[%l2]] */ + ldx [%l4], %l2 inc %l2 - stx %l2, [%l7] + stx %l2, [%l4] ba,a %xcc, 1b nop From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:40:52 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0341E106568B; Wed, 13 Jan 2010 20:40:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC74B8FC0A; Wed, 13 Jan 2010 20:40: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 o0DKepNv018045; Wed, 13 Jan 2010 20:40:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKepS9018043; Wed, 13 Jan 2010 20:40:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132040.o0DKepS9018043@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202238 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:40:52 -0000 Author: marius Date: Wed Jan 13 20:40:51 2010 New Revision: 202238 URL: http://svn.freebsd.org/changeset/base/202238 Log: MFC: r200914 Don't use an out register to hold the vector number across the call of the interrupt handler in intr_fast() as the handler might clobber it (no in-tree handler currently does but an upcoming one will). While at it, tidy the register usage in the interrupt counting code. Modified: stable/7/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/7/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:40:49 2010 (r202237) +++ stable/7/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:40:51 2010 (r202238) @@ -176,7 +176,7 @@ ENTRY(intr_fast) 3: ldx [%l0 + IR_FUNC], %o0 ldx [%l0 + IR_ARG], %o1 - lduw [%l0 + IR_VEC], %o2 + lduw [%l0 + IR_VEC], %l2 ldx [PCPU(IRFREE)], %l1 stx %l1, [%l0 + IR_NEXT] @@ -188,17 +188,17 @@ ENTRY(intr_fast) call %o0 mov %o1, %o0 - /* intrcnt[intr_countp[%o2]]++ */ - SET(intrcnt, %l7, %l2) /* %l2 = intrcnt */ - prefetcha [%l2] ASI_N, 1 - SET(intr_countp, %l7, %l3) /* %l3 = intr_countp */ - sllx %o2, 1, %l4 /* %l4 = vec << 1 */ - lduh [%l4 + %l3], %l5 /* %l5 = intr_countp[%o2] */ - sllx %l5, 3, %l6 /* %l6 = intr_countp[%o2] << 3 */ - add %l6, %l2, %l7 /* %l7 = intrcnt[intr_countp[%o2]] */ - ldx [%l7], %l2 + /* intrcnt[intr_countp[%l2]]++ */ + SET(intrcnt, %l7, %l3) /* %l3 = intrcnt */ + prefetcha [%l3] ASI_N, 1 + SET(intr_countp, %l7, %l4) /* %l4 = intr_countp */ + sllx %l2, 1, %l2 /* %l2 = vec << 1 */ + lduh [%l4 + %l2], %l4 /* %l4 = intr_countp[%l2] */ + sllx %l4, 3, %l4 /* %l4 = intr_countp[%l2] << 3 */ + add %l4, %l3, %l4 /* %l4 = intrcnt[intr_countp[%l2]] */ + ldx [%l4], %l2 inc %l2 - stx %l2, [%l7] + stx %l2, [%l4] ba,a %xcc, 1b nop From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:41:28 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 311341065670; Wed, 13 Jan 2010 20:41:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F6138FC1C; Wed, 13 Jan 2010 20:41:28 +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 o0DKfSfH018216; Wed, 13 Jan 2010 20:41:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKfSx7018214; Wed, 13 Jan 2010 20:41:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132041.o0DKfSx7018214@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202239 - stable/6/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:41:28 -0000 Author: marius Date: Wed Jan 13 20:41:27 2010 New Revision: 202239 URL: http://svn.freebsd.org/changeset/base/202239 Log: MFC: r200914 Don't use an out register to hold the vector number across the call of the interrupt handler in intr_fast() as the handler might clobber it (no in-tree handler currently does but an upcoming one will). While at it, tidy the register usage in the interrupt counting code. Modified: stable/6/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/6/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:40:51 2010 (r202238) +++ stable/6/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:41:27 2010 (r202239) @@ -175,7 +175,7 @@ ENTRY(intr_fast) 3: ldx [%l0 + IR_FUNC], %o0 ldx [%l0 + IR_ARG], %o1 - lduw [%l0 + IR_VEC], %o2 + lduw [%l0 + IR_VEC], %l2 ldx [PCPU(IRFREE)], %l1 stx %l1, [%l0 + IR_NEXT] @@ -187,17 +187,17 @@ ENTRY(intr_fast) call %o0 mov %o1, %o0 - /* intrcnt[intr_countp[%o2]]++ */ - SET(intrcnt, %l7, %l2) /* %l2 = intrcnt */ - prefetcha [%l2] ASI_N, 1 - SET(intr_countp, %l7, %l3) /* %l3 = intr_countp */ - sllx %o2, 1, %l4 /* %l4 = vec << 1 */ - lduh [%l4 + %l3], %l5 /* %l5 = intr_countp[%o2] */ - sllx %l5, 3, %l6 /* %l6 = intr_countp[%o2] << 3 */ - add %l6, %l2, %l7 /* %l7 = intrcnt[intr_countp[%o2]] */ - ldx [%l7], %l2 + /* intrcnt[intr_countp[%l2]]++ */ + SET(intrcnt, %l7, %l3) /* %l3 = intrcnt */ + prefetcha [%l3] ASI_N, 1 + SET(intr_countp, %l7, %l4) /* %l4 = intr_countp */ + sllx %l2, 1, %l2 /* %l2 = vec << 1 */ + lduh [%l4 + %l2], %l4 /* %l4 = intr_countp[%l2] */ + sllx %l4, 3, %l4 /* %l4 = intr_countp[%l2] << 3 */ + add %l4, %l3, %l4 /* %l4 = intrcnt[intr_countp[%l2]] */ + ldx [%l4], %l2 inc %l2 - stx %l2, [%l7] + stx %l2, [%l4] ba,a %xcc, 1b nop From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:48:43 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF901065676; Wed, 13 Jan 2010 20:48:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFFB98FC18; Wed, 13 Jan 2010 20:48:42 +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 o0DKmgAT019920; Wed, 13 Jan 2010 20:48:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKmg1a019912; Wed, 13 Jan 2010 20:48:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132048.o0DKmg1a019912@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202240 - in stable/6/sys: dev/auxio sparc64/central sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:48:43 -0000 Author: marius Date: Wed Jan 13 20:48:42 2010 New Revision: 202240 URL: http://svn.freebsd.org/changeset/base/202240 Log: MFC: r200815, r200816 Provide and consume missing module dependency information. Modified: stable/6/sys/dev/auxio/auxio.c stable/6/sys/sparc64/central/central.c stable/6/sys/sparc64/fhc/fhc_nexus.c stable/6/sys/sparc64/pci/apb.c stable/6/sys/sparc64/pci/ofw_pcib.c stable/6/sys/sparc64/sbus/sbus.c stable/6/sys/sparc64/sparc64/nexus.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/dev/auxio/auxio.c ============================================================================== --- stable/6/sys/dev/auxio/auxio.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/dev/auxio/auxio.c Wed Jan 13 20:48:42 2010 (r202240) @@ -56,7 +56,7 @@ */ /* - * AUXIO registers support on the sbus & ebus2, used for the floppy driver + * AUXIO registers support on the SBus & EBus2, used for the floppy driver * and to control the system LED, for the BLINK option. */ @@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$"); #include /* - * on sun4u, auxio exists with one register (LED) on the sbus, and 5 - * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI + * On sun4u, auxio exists with one register (LED) on the SBus, and 5 + * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI * OSCILLATOR, and TEMP SENSE. */ @@ -142,6 +142,7 @@ static driver_t auxio_sbus_driver = { static devclass_t auxio_devclass; DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, sbus, 1, 1, 1); /* EBus */ static device_method_t auxio_ebus_methods[] = { @@ -158,6 +159,7 @@ static driver_t auxio_ebus_driver = { }; DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, ebus, 1, 1, 1); MODULE_VERSION(auxio, 1); #define AUXIO_LOCK_INIT(sc) \ Modified: stable/6/sys/sparc64/central/central.c ============================================================================== --- stable/6/sys/sparc64/central/central.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/central/central.c Wed Jan 13 20:48:42 2010 (r202240) @@ -112,6 +112,7 @@ static driver_t central_driver = { static devclass_t central_devclass; DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(central, 1); static int Modified: stable/6/sys/sparc64/fhc/fhc_nexus.c ============================================================================== --- stable/6/sys/sparc64/fhc/fhc_nexus.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/fhc/fhc_nexus.c Wed Jan 13 20:48:42 2010 (r202240) @@ -89,6 +89,7 @@ static driver_t fhc_nexus_driver = { static devclass_t fhc_nexus_devclass; DRIVER_MODULE(fhc, nexus, fhc_nexus_driver, fhc_nexus_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); static int fhc_nexus_probe(device_t dev) Modified: stable/6/sys/sparc64/pci/apb.c ============================================================================== --- stable/6/sys/sparc64/pci/apb.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/pci/apb.c Wed Jan 13 20:48:42 2010 (r202240) @@ -116,6 +116,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc)); DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(apb, pci, 1, 1, 1); /* APB specific registers */ #define APBR_IOMAP 0xde Modified: stable/6/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/6/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 20:48:42 2010 (r202240) @@ -97,6 +97,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods, sizeof(struct ofw_pcib_gen_softc)); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); static int ofw_pcib_probe(device_t dev) Modified: stable/6/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/6/sys/sparc64/sbus/sbus.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/sbus/sbus.c Wed Jan 13 20:48:42 2010 (r202240) @@ -261,6 +261,7 @@ static driver_t sbus_driver = { static devclass_t sbus_devclass; DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0); +MODULE_DEPEND(sbus, nexus, 1, 1, 1); MODULE_VERSION(sbus, 1); #define OFW_SBUS_TYPE "sbus" Modified: stable/6/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/6/sys/sparc64/sparc64/nexus.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/sparc64/nexus.c Wed Jan 13 20:48:42 2010 (r202240) @@ -131,6 +131,7 @@ static driver_t nexus_driver = { static devclass_t nexus_devclass; DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +MODULE_VERSION(nexus, 1); static char *nexus_excl_name[] = { "aliases", From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:51:21 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED88C1065672; Wed, 13 Jan 2010 20:51:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC4258FC14; Wed, 13 Jan 2010 20:51: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 o0DKpLrB020600; Wed, 13 Jan 2010 20:51:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKpLPv020598; Wed, 13 Jan 2010 20:51:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132051.o0DKpLPv020598@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:51: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: r202241 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:51:22 -0000 Author: marius Date: Wed Jan 13 20:51:21 2010 New Revision: 202241 URL: http://svn.freebsd.org/changeset/base/202241 Log: MFC: r200915 Don't probe the bq4802 variant found in Ultra 25 and 45 for now as this chip isn't MC146818 compatible and requires different handlers (but which I can't test due to lack of such hardware). Modified: stable/8/sys/sparc64/sparc64/rtc.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) Modified: stable/8/sys/sparc64/sparc64/rtc.c ============================================================================== --- stable/8/sys/sparc64/sparc64/rtc.c Wed Jan 13 20:48:42 2010 (r202240) +++ stable/8/sys/sparc64/sparc64/rtc.c Wed Jan 13 20:51:21 2010 (r202241) @@ -28,10 +28,11 @@ __FBSDID("$FreeBSD$"); /* - * The `rtc' device is a MC146818 compatible clock found on the ISA - * bus and EBus. The EBus variant actually is the Real-Time Clock - * function of a National Semiconductor PC87317/PC97317 which also - * provides Advanced Power Control functionality. + * The `rtc' device is found on the ISA bus and the EBus. The ISA version + * always is a MC146818 compatible clock while the EBus variant either is the + * MC146818 compatible Real-Time Clock function of a National Semiconductor + * PC87317/PC97317 which also provides Advanced Power Control functionality + * or a Texas Instruments bq4802. */ #include "opt_isa.h" @@ -130,6 +131,10 @@ rtc_ebus_probe(device_t dev) { if (strcmp(ofw_bus_get_name(dev), "rtc") == 0) { + /* The bq4802 is not supported, yet. */ + if (ofw_bus_get_compat(dev) != NULL && + strcmp(ofw_bus_get_compat(dev), "bq4802") == 0) + return (ENXIO); device_set_desc(dev, RTC_DESC); return (0); } From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:51:23 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8427D106566C; Wed, 13 Jan 2010 20:51:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72C248FC0A; Wed, 13 Jan 2010 20:51:23 +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 o0DKpN6N020633; Wed, 13 Jan 2010 20:51:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKpNsq020631; Wed, 13 Jan 2010 20:51:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132051.o0DKpNsq020631@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202242 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:51:23 -0000 Author: marius Date: Wed Jan 13 20:51:23 2010 New Revision: 202242 URL: http://svn.freebsd.org/changeset/base/202242 Log: MFC: r200915 Don't probe the bq4802 variant found in Ultra 25 and 45 for now as this chip isn't MC146818 compatible and requires different handlers (but which I can't test due to lack of such hardware). Modified: stable/7/sys/sparc64/sparc64/rtc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/rtc.c ============================================================================== --- stable/7/sys/sparc64/sparc64/rtc.c Wed Jan 13 20:51:21 2010 (r202241) +++ stable/7/sys/sparc64/sparc64/rtc.c Wed Jan 13 20:51:23 2010 (r202242) @@ -28,10 +28,11 @@ __FBSDID("$FreeBSD$"); /* - * The `rtc' device is a MC146818 compatible clock found on the ISA - * bus and EBus. The EBus variant actually is the Real-Time Clock - * function of a National Semiconductor PC87317/PC97317 which also - * provides Advanced Power Control functionality. + * The `rtc' device is found on the ISA bus and the EBus. The ISA version + * always is a MC146818 compatible clock while the EBus variant either is the + * MC146818 compatible Real-Time Clock function of a National Semiconductor + * PC87317/PC97317 which also provides Advanced Power Control functionality + * or a Texas Instruments bq4802. */ #include "opt_isa.h" @@ -130,6 +131,10 @@ rtc_ebus_probe(device_t dev) { if (strcmp(ofw_bus_get_name(dev), "rtc") == 0) { + /* The bq4802 is not supported, yet. */ + if (ofw_bus_get_compat(dev) != NULL && + strcmp(ofw_bus_get_compat(dev), "bq4802") == 0) + return (ENXIO); device_set_desc(dev, RTC_DESC); return (0); } From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:59:36 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A455B1065670; Wed, 13 Jan 2010 20:59:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92CEB8FC0C; Wed, 13 Jan 2010 20:59:36 +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 o0DKxakL022521; Wed, 13 Jan 2010 20:59:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKxaxR022519; Wed, 13 Jan 2010 20:59:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132059.o0DKxaxR022519@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:59:36 +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: r202244 - stable/8/sys/sun4v/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:59:36 -0000 Author: marius Date: Wed Jan 13 20:59:36 2010 New Revision: 202244 URL: http://svn.freebsd.org/changeset/base/202244 Log: MFC: r200916 Remove devices which are/were only relevant for sun4u. Modified: stable/8/sys/sun4v/conf/NOTES 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) Modified: stable/8/sys/sun4v/conf/NOTES ============================================================================== --- stable/8/sys/sun4v/conf/NOTES Wed Jan 13 20:54:18 2010 (r202243) +++ stable/8/sys/sun4v/conf/NOTES Wed Jan 13 20:59:36 2010 (r202244) @@ -21,37 +21,18 @@ cpu SUN4V device ebus #device isa device pci -device sbus -#device central -device fhc ##################################################################### # HARDWARE DEVICE CONFIGURATION # -# Mandatory devices: -# - -#device eeprom # eeprom (really a front-end for the MK48Txx) -device mk48txx # Mostek MK48Txx clocks -#device rtc # rtc (really a front-end for the MC146818) -device mc146818 # Motorola MC146818 and compatible clocks - -# # Optional devices: # -#device auxio # auxiliary I/O device -#device clkbrd # Clock Board (blinkenlight on Sun Exx00) -#device creator # Creator, Creator3D and Elite3D framebuffers -#device machfb # ATI Mach64 framebuffers - device ofw_console # Open Firmware console device option OFWCONS_POLL_HZ=4 # 20 or more works best on Ultra2 -#device sab # Siemens SAB82532 based serial ports - ##################################################################### # Devices we don't want to deal with From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 20:59:42 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB4B01065757; Wed, 13 Jan 2010 20:59:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971BD8FC0A; Wed, 13 Jan 2010 20:59:42 +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 o0DKxgnp022589; Wed, 13 Jan 2010 20:59:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKxgVt022587; Wed, 13 Jan 2010 20:59:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132059.o0DKxgVt022587@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202245 - stable/7/sys/sun4v/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:59:42 -0000 Author: marius Date: Wed Jan 13 20:59:42 2010 New Revision: 202245 URL: http://svn.freebsd.org/changeset/base/202245 Log: MFC: r200916 Remove devices which are/were only relevant for sun4u. Modified: stable/7/sys/sun4v/conf/NOTES Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sun4v/conf/NOTES ============================================================================== --- stable/7/sys/sun4v/conf/NOTES Wed Jan 13 20:59:36 2010 (r202244) +++ stable/7/sys/sun4v/conf/NOTES Wed Jan 13 20:59:42 2010 (r202245) @@ -21,9 +21,6 @@ cpu SUN4V device ebus #device isa device pci -device sbus -#device central -device fhc ##################################################################### @@ -34,25 +31,14 @@ device fhc # device genclock # Generic clock interface -#device eeprom # eeprom (really a front-end for the MK48Txx) -device mk48txx # Mostek MK48Txx clocks -#device rtc # rtc (really a front-end for the MC146818) -device mc146818 # Motorola MC146818 and compatible clocks # # Optional devices: # -#device auxio # auxiliary I/O device -#device clkbrd # Clock Board (blinkenlight on Sun Exx00) -#device creator # Creator, Creator3D and Elite3D framebuffers -#device machfb # ATI Mach64 framebuffers - device ofw_console # Open Firmware console device option OFWCONS_POLL_HZ=4 # 20 or more works best on Ultra2 -#device sab # Siemens SAB82532 based serial ports - ##################################################################### # Devices we don't want to deal with From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:03:04 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3BF4106566C; Wed, 13 Jan 2010 21:03:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C24668FC19; Wed, 13 Jan 2010 21:03:04 +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 o0DL34KA023445; Wed, 13 Jan 2010 21:03:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DL34Tk023442; Wed, 13 Jan 2010 21:03:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132103.o0DL34Tk023442@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:03:04 +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: r202246 - in stable/8/sys: conf sun4v/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:03:04 -0000 Author: marius Date: Wed Jan 13 21:03:04 2010 New Revision: 202246 URL: http://svn.freebsd.org/changeset/base/202246 Log: MFC: r200917 Hook ebus(4) and isa(4) up to the sun4v LINT build in order to ensure that their compilation doesn't break as they are expected to work as-is now (but aren't actually run-time tested). Modified: stable/8/sys/conf/files.sun4v stable/8/sys/sun4v/conf/NOTES 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) Modified: stable/8/sys/conf/files.sun4v ============================================================================== --- stable/8/sys/conf/files.sun4v Wed Jan 13 20:59:42 2010 (r202245) +++ stable/8/sys/conf/files.sun4v Wed Jan 13 21:03:04 2010 (r202246) @@ -35,6 +35,10 @@ libkern/ffsl.c standard libkern/fls.c standard libkern/flsl.c standard libkern/memmove.c standard +sparc64/ebus/ebus.c optional ebus +sparc64/isa/isa.c optional isa +sparc64/isa/isa_dma.c optional isa +sparc64/isa/ofw_isa.c optional ebus | isa sparc64/sparc64/autoconf.c standard sun4v/sun4v/bus_machdep.c standard sun4v/sun4v/clock.c standard Modified: stable/8/sys/sun4v/conf/NOTES ============================================================================== --- stable/8/sys/sun4v/conf/NOTES Wed Jan 13 20:59:42 2010 (r202245) +++ stable/8/sys/sun4v/conf/NOTES Wed Jan 13 21:03:04 2010 (r202246) @@ -19,7 +19,7 @@ cpu SUN4V # HARDWARE BUS CONFIGURATION device ebus -#device isa +device isa device pci From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:03:06 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 749E1106566B; Wed, 13 Jan 2010 21:03:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 633FE8FC0C; Wed, 13 Jan 2010 21:03: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 o0DL36Vo023479; Wed, 13 Jan 2010 21:03:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DL36gu023476; Wed, 13 Jan 2010 21:03:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132103.o0DL36gu023476@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202247 - in stable/7/sys: conf sun4v/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:03:06 -0000 Author: marius Date: Wed Jan 13 21:03:06 2010 New Revision: 202247 URL: http://svn.freebsd.org/changeset/base/202247 Log: MFC: r200917 Hook ebus(4) and isa(4) up to the sun4v LINT build in order to ensure that their compilation doesn't break as they are expected to work as-is now (but aren't actually run-time tested). Modified: stable/7/sys/conf/files.sun4v stable/7/sys/sun4v/conf/NOTES Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files.sun4v ============================================================================== --- stable/7/sys/conf/files.sun4v Wed Jan 13 21:03:04 2010 (r202246) +++ stable/7/sys/conf/files.sun4v Wed Jan 13 21:03:06 2010 (r202247) @@ -32,6 +32,10 @@ libkern/ffs.c standard libkern/ffsl.c standard libkern/fls.c standard libkern/flsl.c standard +sparc64/ebus/ebus.c optional ebus +sparc64/isa/isa.c optional isa +sparc64/isa/isa_dma.c optional isa +sparc64/isa/ofw_isa.c optional ebus | isa sparc64/sparc64/autoconf.c standard sun4v/sun4v/bus_machdep.c standard sun4v/sun4v/clock.c standard Modified: stable/7/sys/sun4v/conf/NOTES ============================================================================== --- stable/7/sys/sun4v/conf/NOTES Wed Jan 13 21:03:04 2010 (r202246) +++ stable/7/sys/sun4v/conf/NOTES Wed Jan 13 21:03:06 2010 (r202247) @@ -19,7 +19,7 @@ cpu SUN4V # HARDWARE BUS CONFIGURATION device ebus -#device isa +device isa device pci From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:04:56 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B493A1065695; Wed, 13 Jan 2010 21:04:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A369F8FC22; Wed, 13 Jan 2010 21:04:56 +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 o0DL4uQh023937; Wed, 13 Jan 2010 21:04:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DL4uqp023935; Wed, 13 Jan 2010 21:04:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132104.o0DL4uqp023935@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:04:56 +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: r202248 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:04:56 -0000 Author: marius Date: Wed Jan 13 21:04:56 2010 New Revision: 202248 URL: http://svn.freebsd.org/changeset/base/202248 Log: MFC: r200918 Add structures for OFW MSI/MSI-X support. These are identical for both sun4u and sun4v. Modified: stable/8/sys/sparc64/pci/ofw_pci.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) Modified: stable/8/sys/sparc64/pci/ofw_pci.h ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pci.h Wed Jan 13 21:03:06 2010 (r202247) +++ stable/8/sys/sparc64/pci/ofw_pci.h Wed Jan 13 21:04:56 2010 (r202248) @@ -48,6 +48,31 @@ typedef uint32_t ofw_pci_intr_t; #define OFW_TYPE_PCI "pci" #define OFW_TYPE_PCIE "pciex" +struct ofw_pci_msi_addr_ranges { + uint32_t addr32_hi; + uint32_t addr32_lo; + uint32_t addr32_sz; + uint32_t addr64_hi; + uint32_t addr64_lo; + uint32_t addr64_sz; +}; + +#define OFW_PCI_MSI_ADDR_RANGE_32(r) \ + (((uint64_t)(r)->addr32_hi << 32) | (uint64_t)(r)->addr32_lo) +#define OFW_PCI_MSI_ADDR_RANGE_64(r) \ + (((uint64_t)(r)->addr64_hi << 32) | (uint64_t)(r)->addr64_lo) + +struct ofw_pci_msi_eq_to_devino { + uint32_t eq_first; + uint32_t eq_count; + uint32_t devino_first; +}; + +struct ofw_pci_msi_ranges { + uint32_t first; + uint32_t count; +}; + struct ofw_pci_ranges { uint32_t cspace; uint32_t child_hi; From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:05:05 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB4DB10656A7; Wed, 13 Jan 2010 21:05:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F5DB8FC1A; Wed, 13 Jan 2010 21:05:02 +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 o0DL52Uv024009; Wed, 13 Jan 2010 21:05:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DL52do024007; Wed, 13 Jan 2010 21:05:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132105.o0DL52do024007@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202249 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:05:05 -0000 Author: marius Date: Wed Jan 13 21:05:01 2010 New Revision: 202249 URL: http://svn.freebsd.org/changeset/base/202249 Log: MFC: r200918 Add structures for OFW MSI/MSI-X support. These are identical for both sun4u and sun4v. Modified: stable/7/sys/sparc64/pci/ofw_pci.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pci.h ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pci.h Wed Jan 13 21:04:56 2010 (r202248) +++ stable/7/sys/sparc64/pci/ofw_pci.h Wed Jan 13 21:05:01 2010 (r202249) @@ -48,6 +48,31 @@ typedef uint32_t ofw_pci_intr_t; #define OFW_TYPE_PCI "pci" #define OFW_TYPE_PCIE "pciex" +struct ofw_pci_msi_addr_ranges { + uint32_t addr32_hi; + uint32_t addr32_lo; + uint32_t addr32_sz; + uint32_t addr64_hi; + uint32_t addr64_lo; + uint32_t addr64_sz; +}; + +#define OFW_PCI_MSI_ADDR_RANGE_32(r) \ + (((uint64_t)(r)->addr32_hi << 32) | (uint64_t)(r)->addr32_lo) +#define OFW_PCI_MSI_ADDR_RANGE_64(r) \ + (((uint64_t)(r)->addr64_hi << 32) | (uint64_t)(r)->addr64_lo) + +struct ofw_pci_msi_eq_to_devino { + uint32_t eq_first; + uint32_t eq_count; + uint32_t devino_first; +}; + +struct ofw_pci_msi_ranges { + uint32_t first; + uint32_t count; +}; + struct ofw_pci_ranges { uint32_t cspace; uint32_t child_hi; From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:08:58 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 260BD106566B; Wed, 13 Jan 2010 21:08:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13CBB8FC16; Wed, 13 Jan 2010 21:08:58 +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 o0DL8v9u024961; Wed, 13 Jan 2010 21:08:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DL8vpS024959; Wed, 13 Jan 2010 21:08:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132108.o0DL8vpS024959@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202250 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:08:58 -0000 Author: marius Date: Wed Jan 13 21:08:57 2010 New Revision: 202250 URL: http://svn.freebsd.org/changeset/base/202250 Log: MFC: r200920 - Sort the prototypes. - Add macros to ease the access of device configuration space in ofw_pcibus_setup_device(). Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:05:01 2010 (r202249) +++ stable/7/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:08:57 2010 (r202250) @@ -65,10 +65,10 @@ static void ofw_pcibus_setup_device(devi u_int busno, u_int slot, u_int func); /* Methods */ -static device_probe_t ofw_pcibus_probe; static device_attach_t ofw_pcibus_attach; -static pci_assign_interrupt_t ofw_pcibus_assign_interrupt; +static device_probe_t ofw_pcibus_probe; static ofw_bus_get_devinfo_t ofw_pcibus_get_devinfo; +static pci_assign_interrupt_t ofw_pcibus_assign_interrupt; static device_method_t ofw_pcibus_methods[] = { /* Device interface */ @@ -122,6 +122,11 @@ static void ofw_pcibus_setup_device(device_t bridge, uint32_t clock, u_int busno, u_int slot, u_int func) { +#define CS_READ(n, w) \ + PCIB_READ_CONFIG(bridge, busno, slot, func, (n), (w)) +#define CS_WRITE(n, v, w) \ + PCIB_WRITE_CONFIG(bridge, busno, slot, func, (n), (v), (w)) + #ifndef SUN4V uint32_t reg; @@ -136,10 +141,9 @@ ofw_pcibus_setup_device(device_t bridge, * For bridges, we additionally set up the bridge control and the * secondary latency registers. */ - if ((PCIB_READ_CONFIG(bridge, busno, slot, func, PCIR_HDRTYPE, 1) & - PCIM_HDRTYPE) == PCIM_HDRTYPE_BRIDGE) { - reg = PCIB_READ_CONFIG(bridge, busno, slot, func, - PCIR_BRIDGECTL_1, 1); + if ((CS_READ(PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) == + PCIM_HDRTYPE_BRIDGE) { + reg = CS_READ(PCIR_BRIDGECTL_1, 1); #if 0 reg |= PCIB_BCR_MASTER_ABORT_MODE | PCIB_BCR_SERR_ENABLE | #else @@ -149,24 +153,19 @@ ofw_pcibus_setup_device(device_t bridge, #ifdef OFW_PCI_DEBUG device_printf(bridge, "bridge %d/%d/%d: control 0x%x -> 0x%x\n", - busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, - func, PCIR_BRIDGECTL_1, 1), reg); + busno, slot, func, CS_READ(PCIR_BRIDGECTL_1, 1), reg); #endif /* OFW_PCI_DEBUG */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_BRIDGECTL_1, - reg, 1); + CS_WRITE(PCIR_BRIDGECTL_1, reg, 1); reg = OFW_PCI_LATENCY; #ifdef OFW_PCI_DEBUG device_printf(bridge, "bridge %d/%d/%d: latency timer %d -> %d\n", - busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, - func, PCIR_SECLAT_1, 1), reg); + busno, slot, func, CS_READ(PCIR_SECLAT_1, 1), reg); #endif /* OFW_PCI_DEBUG */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_SECLAT_1, - reg, 1); + CS_WRITE(PCIR_SECLAT_1, reg, 1); } else { - reg = PCIB_READ_CONFIG(bridge, busno, slot, func, - PCIR_MINGNT, 1); + reg = CS_READ(PCIR_MINGNT, 1); if (reg != 0) { switch (clock) { case 33000000: @@ -182,10 +181,9 @@ ofw_pcibus_setup_device(device_t bridge, } #ifdef OFW_PCI_DEBUG device_printf(bridge, "device %d/%d/%d: latency timer %d -> %d\n", - busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, func, - PCIR_LATTIMER, 1), reg); + busno, slot, func, CS_READ(PCIR_LATTIMER, 1), reg); #endif /* OFW_PCI_DEBUG */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_LATTIMER, reg, 1); + CS_WRITE(PCIR_LATTIMER, reg, 1); /* * Compute a value to write into the cache line size register. @@ -194,8 +192,7 @@ ofw_pcibus_setup_device(device_t bridge, * reached. Generally, the cache line size is fixed at 64 bytes * by Fireplane/Safari, JBus and UPA. */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_CACHELNSZ, - STRBUF_LINESZ / sizeof(uint32_t), 1); + CS_WRITE(PCIR_CACHELNSZ, STRBUF_LINESZ / sizeof(uint32_t), 1); #endif /* @@ -203,8 +200,10 @@ ofw_pcibus_setup_device(device_t bridge, * it to 255, so that the PCI code will reroute the interrupt if * needed. */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_INTLINE, - PCI_INVALID_IRQ, 1); + CS_WRITE(PCIR_INTLINE, PCI_INVALID_IRQ, 1); + +#undef CS_READ +#undef CS_WRITE } static int From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:08:58 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 558B4106566C; Wed, 13 Jan 2010 21:08:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 439918FC17; Wed, 13 Jan 2010 21:08:58 +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 o0DL8w89024975; Wed, 13 Jan 2010 21:08:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DL8wqN024973; Wed, 13 Jan 2010 21:08:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132108.o0DL8wqN024973@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:08:58 +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: r202251 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:08:58 -0000 Author: marius Date: Wed Jan 13 21:08:57 2010 New Revision: 202251 URL: http://svn.freebsd.org/changeset/base/202251 Log: MFC: r200920 - Sort the prototypes. - Add macros to ease the access of device configuration space in ofw_pcibus_setup_device(). Modified: stable/8/sys/sparc64/pci/ofw_pcibus.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) Modified: stable/8/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:08:57 2010 (r202250) +++ stable/8/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:08:57 2010 (r202251) @@ -64,11 +64,11 @@ static void ofw_pcibus_setup_device(devi u_int busno, u_int slot, u_int func); /* Methods */ -static device_probe_t ofw_pcibus_probe; +static bus_child_pnpinfo_str_t ofw_pcibus_pnpinfo_str; static device_attach_t ofw_pcibus_attach; -static pci_assign_interrupt_t ofw_pcibus_assign_interrupt; +static device_probe_t ofw_pcibus_probe; static ofw_bus_get_devinfo_t ofw_pcibus_get_devinfo; -static bus_child_pnpinfo_str_t ofw_pcibus_pnpinfo_str; +static pci_assign_interrupt_t ofw_pcibus_assign_interrupt; static device_method_t ofw_pcibus_methods[] = { /* Device interface */ @@ -124,6 +124,11 @@ static void ofw_pcibus_setup_device(device_t bridge, uint32_t clock, u_int busno, u_int slot, u_int func) { +#define CS_READ(n, w) \ + PCIB_READ_CONFIG(bridge, busno, slot, func, (n), (w)) +#define CS_WRITE(n, v, w) \ + PCIB_WRITE_CONFIG(bridge, busno, slot, func, (n), (v), (w)) + #ifndef SUN4V uint32_t reg; @@ -138,33 +143,27 @@ ofw_pcibus_setup_device(device_t bridge, * For bridges, we additionally set up the bridge control and the * secondary latency registers. */ - if ((PCIB_READ_CONFIG(bridge, busno, slot, func, PCIR_HDRTYPE, 1) & - PCIM_HDRTYPE) == PCIM_HDRTYPE_BRIDGE) { - reg = PCIB_READ_CONFIG(bridge, busno, slot, func, - PCIR_BRIDGECTL_1, 1); + if ((CS_READ(PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) == + PCIM_HDRTYPE_BRIDGE) { + reg = CS_READ(PCIR_BRIDGECTL_1, 1); reg |= PCIB_BCR_MASTER_ABORT_MODE | PCIB_BCR_SERR_ENABLE | PCIB_BCR_PERR_ENABLE; #ifdef OFW_PCI_DEBUG device_printf(bridge, "bridge %d/%d/%d: control 0x%x -> 0x%x\n", - busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, - func, PCIR_BRIDGECTL_1, 1), reg); + busno, slot, func, CS_READ(PCIR_BRIDGECTL_1, 1), reg); #endif /* OFW_PCI_DEBUG */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_BRIDGECTL_1, - reg, 1); + CS_WRITE(PCIR_BRIDGECTL_1, reg, 1); reg = OFW_PCI_LATENCY; #ifdef OFW_PCI_DEBUG device_printf(bridge, "bridge %d/%d/%d: latency timer %d -> %d\n", - busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, - func, PCIR_SECLAT_1, 1), reg); + busno, slot, func, CS_READ(PCIR_SECLAT_1, 1), reg); #endif /* OFW_PCI_DEBUG */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_SECLAT_1, - reg, 1); + CS_WRITE(PCIR_SECLAT_1, reg, 1); } else { - reg = PCIB_READ_CONFIG(bridge, busno, slot, func, - PCIR_MINGNT, 1); + reg = CS_READ(PCIR_MINGNT, 1); if (reg != 0) { switch (clock) { case 33000000: @@ -180,10 +179,9 @@ ofw_pcibus_setup_device(device_t bridge, } #ifdef OFW_PCI_DEBUG device_printf(bridge, "device %d/%d/%d: latency timer %d -> %d\n", - busno, slot, func, PCIB_READ_CONFIG(bridge, busno, slot, func, - PCIR_LATTIMER, 1), reg); + busno, slot, func, CS_READ(PCIR_LATTIMER, 1), reg); #endif /* OFW_PCI_DEBUG */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_LATTIMER, reg, 1); + CS_WRITE(PCIR_LATTIMER, reg, 1); /* * Compute a value to write into the cache line size register. @@ -192,8 +190,7 @@ ofw_pcibus_setup_device(device_t bridge, * reached. Generally, the cache line size is fixed at 64 bytes * by Fireplane/Safari, JBus and UPA. */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_CACHELNSZ, - STRBUF_LINESZ / sizeof(uint32_t), 1); + CS_WRITE(PCIR_CACHELNSZ, STRBUF_LINESZ / sizeof(uint32_t), 1); #endif /* @@ -201,8 +198,10 @@ ofw_pcibus_setup_device(device_t bridge, * it to 255, so that the PCI code will reroute the interrupt if * needed. */ - PCIB_WRITE_CONFIG(bridge, busno, slot, func, PCIR_INTLINE, - PCI_INVALID_IRQ, 1); + CS_WRITE(PCIR_INTLINE, PCI_INVALID_IRQ, 1); + +#undef CS_READ +#undef CS_WRITE } static int From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:12:28 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39BEF1065696; Wed, 13 Jan 2010 21:12:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C750E8FC17; Wed, 13 Jan 2010 21:12:27 +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 o0DLCRZx025824; Wed, 13 Jan 2010 21:12:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLCRqm025822; Wed, 13 Jan 2010 21:12:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132112.o0DLCRqm025822@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:12:27 +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: r202252 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:12:28 -0000 Author: marius Date: Wed Jan 13 21:12:27 2010 New Revision: 202252 URL: http://svn.freebsd.org/changeset/base/202252 Log: MFC: r200921 - Add quirk handling for ALi M5229, mainly setting the magic "force enable IDE I/O" bit which prevents data access traps with revision 0xc8 in Fire-based machines when pci(4) enables PCIM_CMD_PORTEN. - Like for sun4v also don't add the PCI side of host-PCIe bridges to the bus on sun4u as they don't have configuration space implement there either. Modified: stable/8/sys/sparc64/pci/ofw_pcibus.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) Modified: stable/8/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:08:57 2010 (r202251) +++ stable/8/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:12:27 2010 (r202252) @@ -3,6 +3,7 @@ * Copyright (c) 2000, Michael Smith * Copyright (c) 2000, BSDi * Copyright (c) 2003, Thomas Moestl + * Copyright (c) 2005 - 2009 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,6 +195,22 @@ ofw_pcibus_setup_device(device_t bridge, #endif /* + * Ensure that ALi M5229 report the actual content of PCIR_PROGIF + * and that IDE I/O is force enabled. The former is done in order + * to have unique behavior across revisions as some default to + * hiding bits 4-6 for compliance with PCI 2.3. The latter is done + * as at least revision 0xc8 requires the PCIM_CMD_PORTEN bypass + * to be always enabled as otherwise even enabling PCIM_CMD_PORTEN + * results in an instant data access trap on Fire-based machines. + * Thus these quirks have to be handled before pci(4) adds the maps. + * Note that for older revisions bit 0 of register 0x50 enables the + * internal IDE function instead of force enabling IDE I/O. + */ + if ((CS_READ(PCIR_VENDOR, 2) == 0x10b9 && + CS_READ(PCIR_DEVICE, 2) == 0x5229)) + CS_WRITE(0x50, CS_READ(0x50, 1) | 0x3, 1); + + /* * The preset in the intline register is usually wrong. Reset * it to 255, so that the PCI code will reroute the interrupt if * needed. @@ -222,9 +239,14 @@ ofw_pcibus_attach(device_t dev) domain, busno); node = ofw_bus_get_node(dev); -#ifndef SUN4V - /* Add the PCI side of the HOST-PCI bridge itself to the bus. */ + /* + * Add the PCI side of the host-PCI bridge itself to the bus. + * Note that we exclude the host-PCIe bridges here as these + * have no configuration space implemented themselves. + */ if (strcmp(device_get_name(device_get_parent(pcib)), "nexus") == 0 && + ofw_bus_get_type(pcib) != NULL && + strcmp(ofw_bus_get_type(pcib), OFW_TYPE_PCIE) != 0 && (dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib, domain, busno, 0, 0, sizeof(*dinfo))) != NULL) { if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, node) != 0) @@ -232,7 +254,6 @@ ofw_pcibus_attach(device_t dev) else pci_add_child(dev, (struct pci_devinfo *)dinfo); } -#endif if (OF_getprop(ofw_bus_get_node(pcib), "clock-frequency", &clock, sizeof(clock)) == -1) From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:12:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48E111065698; Wed, 13 Jan 2010 21:12:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 372F78FC1F; Wed, 13 Jan 2010 21:12:32 +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 o0DLCVWo025860; Wed, 13 Jan 2010 21:12:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLCVqo025858; Wed, 13 Jan 2010 21:12:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132112.o0DLCVqo025858@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202253 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:12:32 -0000 Author: marius Date: Wed Jan 13 21:12:31 2010 New Revision: 202253 URL: http://svn.freebsd.org/changeset/base/202253 Log: MFC: r200921 - Add quirk handling for ALi M5229, mainly setting the magic "force enable IDE I/O" bit which prevents data access traps with revision 0xc8 in Fire-based machines when pci(4) enables PCIM_CMD_PORTEN. - Like for sun4v also don't add the PCI side of host-PCIe bridges to the bus on sun4u as they don't have configuration space implement there either. Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:12:27 2010 (r202252) +++ stable/7/sys/sparc64/pci/ofw_pcibus.c Wed Jan 13 21:12:31 2010 (r202253) @@ -3,6 +3,7 @@ * Copyright (c) 2000, Michael Smith * Copyright (c) 2000, BSDi * Copyright (c) 2003, Thomas Moestl + * Copyright (c) 2005 - 2009 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -196,6 +197,22 @@ ofw_pcibus_setup_device(device_t bridge, #endif /* + * Ensure that ALi M5229 report the actual content of PCIR_PROGIF + * and that IDE I/O is force enabled. The former is done in order + * to have unique behavior across revisions as some default to + * hiding bits 4-6 for compliance with PCI 2.3. The latter is done + * as at least revision 0xc8 requires the PCIM_CMD_PORTEN bypass + * to be always enabled as otherwise even enabling PCIM_CMD_PORTEN + * results in an instant data access trap on Fire-based machines. + * Thus these quirks have to be handled before pci(4) adds the maps. + * Note that for older revisions bit 0 of register 0x50 enables the + * internal IDE function instead of force enabling IDE I/O. + */ + if ((CS_READ(PCIR_VENDOR, 2) == 0x10b9 && + CS_READ(PCIR_DEVICE, 2) == 0x5229)) + CS_WRITE(0x50, CS_READ(0x50, 1) | 0x3, 1); + + /* * The preset in the intline register is usually wrong. Reset * it to 255, so that the PCI code will reroute the interrupt if * needed. @@ -224,9 +241,14 @@ ofw_pcibus_attach(device_t dev) domain, busno); node = ofw_bus_get_node(dev); -#ifndef SUN4V - /* Add the PCI side of the HOST-PCI bridge itself to the bus. */ + /* + * Add the PCI side of the host-PCI bridge itself to the bus. + * Note that we exclude the host-PCIe bridges here as these + * have no configuration space implemented themselves. + */ if (strcmp(device_get_name(device_get_parent(pcib)), "nexus") == 0 && + ofw_bus_get_type(pcib) != NULL && + strcmp(ofw_bus_get_type(pcib), OFW_TYPE_PCIE) != 0 && (dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib, domain, busno, 0, 0, sizeof(*dinfo))) != NULL) { if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, node) != 0) @@ -234,7 +256,6 @@ ofw_pcibus_attach(device_t dev) else pci_add_child(dev, (struct pci_devinfo *)dinfo); } -#endif if (OF_getprop(ofw_bus_get_node(pcib), "clock-frequency", &clock, sizeof(clock)) == -1) From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:13:50 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F63610656A3; Wed, 13 Jan 2010 21:13:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E1498FC0C; Wed, 13 Jan 2010 21:13:50 +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 o0DLDocG026223; Wed, 13 Jan 2010 21:13:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLDoGP026221; Wed, 13 Jan 2010 21:13:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132113.o0DLDoGP026221@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:13: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: r202254 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:13:50 -0000 Author: marius Date: Wed Jan 13 21:13:50 2010 New Revision: 202254 URL: http://svn.freebsd.org/changeset/base/202254 Log: MFC: r200922 Fix whitespace according to style(9). Modified: stable/8/sys/sparc64/include/iommureg.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) Modified: stable/8/sys/sparc64/include/iommureg.h ============================================================================== --- stable/8/sys/sparc64/include/iommureg.h Wed Jan 13 21:12:31 2010 (r202253) +++ stable/8/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:50 2010 (r202254) @@ -37,7 +37,7 @@ */ #ifndef _MACHINE_IOMMUREG_H_ -#define _MACHINE_IOMMUREG_H_ +#define _MACHINE_IOMMUREG_H_ /* * UltraSPARC IOMMU registers, common to both the PCI and SBus @@ -61,9 +61,9 @@ #define ISD_LN_TAG_DIAG 0x0900 /* streaming buffer line tag diag 0..15 */ /* streaming buffer control register */ -#define STRBUF_EN 0x0000000000000001UL -#define STRBUF_D 0x0000000000000002UL -#define STRBUF_RR_DIS 0x0000000000000004UL +#define STRBUF_EN 0x0000000000000001UL +#define STRBUF_D 0x0000000000000002UL +#define STRBUF_RR_DIS 0x0000000000000004UL #define IOMMU_MAXADDR(bits) ((1UL << (bits)) - 1) @@ -72,24 +72,24 @@ */ /* Nummber of entries in IOTSB */ #define IOMMUCR_TSBSZ_SHIFT 16 -#define IOMMUCR_TSB1K 0x0000000000000000UL -#define IOMMUCR_TSB2K 0x0000000000010000UL -#define IOMMUCR_TSB4K 0x0000000000020000UL -#define IOMMUCR_TSB8K 0x0000000000030000UL -#define IOMMUCR_TSB16K 0x0000000000040000UL -#define IOMMUCR_TSB32K 0x0000000000050000UL -#define IOMMUCR_TSB64K 0x0000000000060000UL -#define IOMMUCR_TSB128K 0x0000000000070000UL +#define IOMMUCR_TSB1K 0x0000000000000000UL +#define IOMMUCR_TSB2K 0x0000000000010000UL +#define IOMMUCR_TSB4K 0x0000000000020000UL +#define IOMMUCR_TSB8K 0x0000000000030000UL +#define IOMMUCR_TSB16K 0x0000000000040000UL +#define IOMMUCR_TSB32K 0x0000000000050000UL +#define IOMMUCR_TSB64K 0x0000000000060000UL +#define IOMMUCR_TSB128K 0x0000000000070000UL /* Mask for above */ -#define IOMMUCR_TSBMASK 0xfffffffffff8ffffUL +#define IOMMUCR_TSBMASK 0xfffffffffff8ffffUL /* 8K iommu page size */ -#define IOMMUCR_8KPG 0x0000000000000000UL +#define IOMMUCR_8KPG 0x0000000000000000UL /* 64K iommu page size */ -#define IOMMUCR_64KPG 0x0000000000000004UL +#define IOMMUCR_64KPG 0x0000000000000004UL /* Diag enable */ -#define IOMMUCR_DE 0x0000000000000002UL +#define IOMMUCR_DE 0x0000000000000002UL /* Enable IOMMU */ -#define IOMMUCR_EN 0x0000000000000001UL +#define IOMMUCR_EN 0x0000000000000001UL /* * Diagnostic register definitions @@ -97,9 +97,9 @@ #define IOMMU_DTAG_VPNBITS 19 #define IOMMU_DTAG_VPNMASK ((1 << IOMMU_DTAG_VPNBITS) - 1) #define IOMMU_DTAG_VPNSHIFT 13 -#define IOMMU_DTAG_ERRBITS 3 +#define IOMMU_DTAG_ERRBITS 3 #define IOMMU_DTAG_ERRSHIFT 22 -#define IOMMU_DTAG_ERRMASK \ +#define IOMMU_DTAG_ERRMASK \ (((1 << IOMMU_DTAG_ERRBITS) - 1) << IOMMU_DTAG_ERRSHIFT) #define IOMMU_DDATA_PGBITS 21 @@ -114,18 +114,18 @@ /* Entry valid */ #define IOTTE_V 0x8000000000000000UL /* 8K or 64K page? */ -#define IOTTE_64K 0x2000000000000000UL -#define IOTTE_8K 0x0000000000000000UL +#define IOTTE_64K 0x2000000000000000UL +#define IOTTE_8K 0x0000000000000000UL /* Is page streamable? */ -#define IOTTE_STREAM 0x1000000000000000UL +#define IOTTE_STREAM 0x1000000000000000UL /* Accesses to same bus segment? */ #define IOTTE_LOCAL 0x0800000000000000UL /* Let's assume this is correct */ -#define IOTTE_PAMASK 0x000007ffffffe000UL +#define IOTTE_PAMASK 0x000007ffffffe000UL /* Accesses to cacheable space */ -#define IOTTE_C 0x0000000000000010UL +#define IOTTE_C 0x0000000000000010UL /* Writeable */ -#define IOTTE_W 0x0000000000000002UL +#define IOTTE_W 0x0000000000000002UL /* log2 of the IOMMU TTE size */ #define IOTTE_SHIFT 3 @@ -167,14 +167,14 @@ */ #define IOTSB_BASESZ (1024 << IOTTE_SHIFT) -#define IOTSB_VEND (~IO_PAGE_MASK) -#define IOTSB_VSTART(sz) (u_int)(IOTSB_VEND << ((sz) + 10)) +#define IOTSB_VEND (~IO_PAGE_MASK) +#define IOTSB_VSTART(sz) (u_int)(IOTSB_VEND << ((sz) + 10)) -#define MAKEIOTTE(pa,w,c,s) \ +#define MAKEIOTTE(pa, w, c, s) \ (((pa) & IOTTE_PAMASK) | ((w) ? IOTTE_W : 0) | \ ((c) ? IOTTE_C : 0) | ((s) ? IOTTE_STREAM : 0) | \ (IOTTE_V | IOTTE_8K)) -#define IOTSBSLOT(va) \ +#define IOTSBSLOT(va) \ ((u_int)(((vm_offset_t)(va)) - (is->is_dvmabase)) >> IO_PAGE_SHIFT) #endif /* !_MACHINE_IOMMUREG_H_ */ From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:13:51 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7784106566C; Wed, 13 Jan 2010 21:13:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1DB08FC2E; Wed, 13 Jan 2010 21:13: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 o0DLDppT026256; Wed, 13 Jan 2010 21:13:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLDpi1026254; Wed, 13 Jan 2010 21:13:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132113.o0DLDpi1026254@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202255 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:13:52 -0000 Author: marius Date: Wed Jan 13 21:13:51 2010 New Revision: 202255 URL: http://svn.freebsd.org/changeset/base/202255 Log: MFC: r200922 Fix whitespace according to style(9). Modified: stable/7/sys/sparc64/include/iommureg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/iommureg.h ============================================================================== --- stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:50 2010 (r202254) +++ stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:51 2010 (r202255) @@ -37,7 +37,7 @@ */ #ifndef _MACHINE_IOMMUREG_H_ -#define _MACHINE_IOMMUREG_H_ +#define _MACHINE_IOMMUREG_H_ /* * UltraSPARC IOMMU registers, common to both the PCI and SBus @@ -61,9 +61,9 @@ #define ISD_LN_TAG_DIAG 0x0900 /* streaming buffer line tag diag 0..15 */ /* streaming buffer control register */ -#define STRBUF_EN 0x0000000000000001UL -#define STRBUF_D 0x0000000000000002UL -#define STRBUF_RR_DIS 0x0000000000000004UL +#define STRBUF_EN 0x0000000000000001UL +#define STRBUF_D 0x0000000000000002UL +#define STRBUF_RR_DIS 0x0000000000000004UL #define IOMMU_MAXADDR(bits) ((1UL << (bits)) - 1) @@ -72,24 +72,24 @@ */ /* Nummber of entries in IOTSB */ #define IOMMUCR_TSBSZ_SHIFT 16 -#define IOMMUCR_TSB1K 0x0000000000000000UL -#define IOMMUCR_TSB2K 0x0000000000010000UL -#define IOMMUCR_TSB4K 0x0000000000020000UL -#define IOMMUCR_TSB8K 0x0000000000030000UL -#define IOMMUCR_TSB16K 0x0000000000040000UL -#define IOMMUCR_TSB32K 0x0000000000050000UL -#define IOMMUCR_TSB64K 0x0000000000060000UL -#define IOMMUCR_TSB128K 0x0000000000070000UL +#define IOMMUCR_TSB1K 0x0000000000000000UL +#define IOMMUCR_TSB2K 0x0000000000010000UL +#define IOMMUCR_TSB4K 0x0000000000020000UL +#define IOMMUCR_TSB8K 0x0000000000030000UL +#define IOMMUCR_TSB16K 0x0000000000040000UL +#define IOMMUCR_TSB32K 0x0000000000050000UL +#define IOMMUCR_TSB64K 0x0000000000060000UL +#define IOMMUCR_TSB128K 0x0000000000070000UL /* Mask for above */ -#define IOMMUCR_TSBMASK 0xfffffffffff8ffffUL +#define IOMMUCR_TSBMASK 0xfffffffffff8ffffUL /* 8K iommu page size */ -#define IOMMUCR_8KPG 0x0000000000000000UL +#define IOMMUCR_8KPG 0x0000000000000000UL /* 64K iommu page size */ -#define IOMMUCR_64KPG 0x0000000000000004UL +#define IOMMUCR_64KPG 0x0000000000000004UL /* Diag enable */ -#define IOMMUCR_DE 0x0000000000000002UL +#define IOMMUCR_DE 0x0000000000000002UL /* Enable IOMMU */ -#define IOMMUCR_EN 0x0000000000000001UL +#define IOMMUCR_EN 0x0000000000000001UL /* * Diagnostic register definitions @@ -97,9 +97,9 @@ #define IOMMU_DTAG_VPNBITS 19 #define IOMMU_DTAG_VPNMASK ((1 << IOMMU_DTAG_VPNBITS) - 1) #define IOMMU_DTAG_VPNSHIFT 13 -#define IOMMU_DTAG_ERRBITS 3 +#define IOMMU_DTAG_ERRBITS 3 #define IOMMU_DTAG_ERRSHIFT 22 -#define IOMMU_DTAG_ERRMASK \ +#define IOMMU_DTAG_ERRMASK \ (((1 << IOMMU_DTAG_ERRBITS) - 1) << IOMMU_DTAG_ERRSHIFT) #define IOMMU_DDATA_PGBITS 21 @@ -114,18 +114,18 @@ /* Entry valid */ #define IOTTE_V 0x8000000000000000UL /* 8K or 64K page? */ -#define IOTTE_64K 0x2000000000000000UL -#define IOTTE_8K 0x0000000000000000UL +#define IOTTE_64K 0x2000000000000000UL +#define IOTTE_8K 0x0000000000000000UL /* Is page streamable? */ -#define IOTTE_STREAM 0x1000000000000000UL +#define IOTTE_STREAM 0x1000000000000000UL /* Accesses to same bus segment? */ #define IOTTE_LOCAL 0x0800000000000000UL /* Let's assume this is correct */ -#define IOTTE_PAMASK 0x000007ffffffe000UL +#define IOTTE_PAMASK 0x000007ffffffe000UL /* Accesses to cacheable space */ -#define IOTTE_C 0x0000000000000010UL +#define IOTTE_C 0x0000000000000010UL /* Writeable */ -#define IOTTE_W 0x0000000000000002UL +#define IOTTE_W 0x0000000000000002UL /* log2 of the IOMMU TTE size */ #define IOTTE_SHIFT 3 @@ -167,14 +167,14 @@ */ #define IOTSB_BASESZ (1024 << IOTTE_SHIFT) -#define IOTSB_VEND (~IO_PAGE_MASK) -#define IOTSB_VSTART(sz) (u_int)(IOTSB_VEND << ((sz) + 10)) +#define IOTSB_VEND (~IO_PAGE_MASK) +#define IOTSB_VSTART(sz) (u_int)(IOTSB_VEND << ((sz) + 10)) -#define MAKEIOTTE(pa,w,c,s) \ +#define MAKEIOTTE(pa, w, c, s) \ (((pa) & IOTTE_PAMASK) | ((w) ? IOTTE_W : 0) | \ ((c) ? IOTTE_C : 0) | ((s) ? IOTTE_STREAM : 0) | \ (IOTTE_V | IOTTE_8K)) -#define IOTSBSLOT(va) \ +#define IOTSBSLOT(va) \ ((u_int)(((vm_offset_t)(va)) - (is->is_dvmabase)) >> IO_PAGE_SHIFT) #endif /* !_MACHINE_IOMMUREG_H_ */ From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:16:07 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63127106566B; Wed, 13 Jan 2010 21:16:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 507B78FC17; Wed, 13 Jan 2010 21:16: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 o0DLG7A9026843; Wed, 13 Jan 2010 21:16:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLG7I9026839; Wed, 13 Jan 2010 21:16:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132116.o0DLG7I9026839@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:16: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: r202256 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:16:07 -0000 Author: marius Date: Wed Jan 13 21:16:07 2010 New Revision: 202256 URL: http://svn.freebsd.org/changeset/base/202256 Log: MFC: r200923 - Add support for the IOMMUs of Fire JBus to PCIe and Oberon Uranus to PCIe bridges. - Add support for talking the PROM mappings over to the kernel IOTSB just like we do with the kernel TSB in order to allow OFW drivers to continue to work. - Change some members, parameters and variables to unsigned where more appropriate. Modified: stable/8/sys/sparc64/include/iommureg.h stable/8/sys/sparc64/include/iommuvar.h stable/8/sys/sparc64/sparc64/iommu.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) Modified: stable/8/sys/sparc64/include/iommureg.h ============================================================================== --- stable/8/sys/sparc64/include/iommureg.h Wed Jan 13 21:13:51 2010 (r202255) +++ stable/8/sys/sparc64/include/iommureg.h Wed Jan 13 21:16:07 2010 (r202256) @@ -44,10 +44,13 @@ * controllers. */ -/* iommmu registers */ +/* IOMMU registers */ #define IMR_CTL 0x0000 /* IOMMU control register */ #define IMR_TSB 0x0008 /* IOMMU TSB base register */ #define IMR_FLUSH 0x0010 /* IOMMU flush register */ +/* The TTE Cache is Fire and Oberon only. */ +#define IMR_CACHE_FLUSH 0x0100 /* IOMMU TTE cache flush address register */ +#define IMR_CACHE_INVAL 0x0108 /* IOMMU TTE cache invalidate register */ /* streaming buffer registers */ #define ISR_CTL 0x0000 /* streaming buffer control reg */ @@ -70,28 +73,57 @@ /* * control register bits */ -/* Nummber of entries in IOTSB */ +/* Nummber of entries in the IOTSB - pre-Fire only */ +#define IOMMUCR_TSBSZ_MASK 0x0000000000070000UL #define IOMMUCR_TSBSZ_SHIFT 16 -#define IOMMUCR_TSB1K 0x0000000000000000UL -#define IOMMUCR_TSB2K 0x0000000000010000UL -#define IOMMUCR_TSB4K 0x0000000000020000UL -#define IOMMUCR_TSB8K 0x0000000000030000UL -#define IOMMUCR_TSB16K 0x0000000000040000UL -#define IOMMUCR_TSB32K 0x0000000000050000UL -#define IOMMUCR_TSB64K 0x0000000000060000UL -#define IOMMUCR_TSB128K 0x0000000000070000UL -/* Mask for above */ -#define IOMMUCR_TSBMASK 0xfffffffffff8ffffUL -/* 8K iommu page size */ +/* TSB cache snoop enable */ +#define IOMMUCR_SE 0x0000000000000400UL +/* Cache modes - Fire and Oberon */ +#define IOMMUCR_CM_NC_TLB_TBW 0x0000000000000000UL +#define IOMMUCR_CM_LC_NTLB_NTBW 0x0000000000000100UL +#define IOMMUCR_CM_LC_TLB_TBW 0x0000000000000200UL +#define IOMMUCR_CM_C_TLB_TBW 0x0000000000000300UL +/* IOMMU page size - pre-Fire only */ #define IOMMUCR_8KPG 0x0000000000000000UL -/* 64K iommu page size */ #define IOMMUCR_64KPG 0x0000000000000004UL -/* Diag enable */ +/* Bypass enable - Fire and Oberon */ +#define IOMMUCR_BE 0x0000000000000002UL +/* Diagnostic mode enable - pre-Fire only */ #define IOMMUCR_DE 0x0000000000000002UL -/* Enable IOMMU */ +/* IOMMU/translation enable */ #define IOMMUCR_EN 0x0000000000000001UL /* + * TSB base register bits + */ + /* TSB base address */ +#define IOMMUTB_TB_MASK 0x000007ffffffe000UL +#define IOMMUTB_TB_SHIFT 13 +/* IOMMU page size - Fire and Oberon */ +#define IOMMUTB_8KPG 0x0000000000000000UL +#define IOMMUTB_64KPG 0x0000000000000100UL +/* Nummber of entries in the IOTSB - Fire and Oberon */ +#define IOMMUTB_TSBSZ_MASK 0x0000000000000004UL +#define IOMMUTB_TSBSZ_SHIFT 0 + +/* + * TSB size definitions for both control and TSB base register */ +#define IOMMU_TSB1K 0 +#define IOMMU_TSB2K 1 +#define IOMMU_TSB4K 2 +#define IOMMU_TSB8K 3 +#define IOMMU_TSB16K 4 +#define IOMMU_TSB32K 5 +#define IOMMU_TSB64K 6 +#define IOMMU_TSB128K 7 +/* Fire and Oberon */ +#define IOMMU_TSB256K 8 +/* Fire and Oberon */ +#define IOMMU_TSB512K 9 +#define IOMMU_TSBENTRIES(tsbsz) \ + ((1 << (tsbsz)) << (IO_PAGE_SHIFT - IOTTE_SHIFT)) + +/* * Diagnostic register definitions */ #define IOMMU_DTAG_VPNBITS 19 @@ -113,16 +145,16 @@ */ /* Entry valid */ #define IOTTE_V 0x8000000000000000UL -/* 8K or 64K page? */ +/* Page size - pre-Fire only */ #define IOTTE_64K 0x2000000000000000UL #define IOTTE_8K 0x0000000000000000UL -/* Is page streamable? */ +/* Streamable page - streaming buffer equipped variants only */ #define IOTTE_STREAM 0x1000000000000000UL -/* Accesses to same bus segment? */ +/* Accesses to the same bus segment - SBus only */ #define IOTTE_LOCAL 0x0800000000000000UL -/* Let's assume this is correct */ -#define IOTTE_PAMASK 0x000007ffffffe000UL -/* Accesses to cacheable space */ +/* Physical address mask (based on Oberon) */ +#define IOTTE_PAMASK 0x00007fffffffe000UL +/* Accesses to cacheable space - pre-Fire only */ #define IOTTE_C 0x0000000000000010UL /* Writeable */ #define IOTTE_W 0x0000000000000002UL Modified: stable/8/sys/sparc64/include/iommuvar.h ============================================================================== --- stable/8/sys/sparc64/include/iommuvar.h Wed Jan 13 21:13:51 2010 (r202255) +++ stable/8/sys/sparc64/include/iommuvar.h Wed Jan 13 21:16:07 2010 (r202256) @@ -66,10 +66,10 @@ struct iommu_state { int is_tsbsize; /* (r) 0 = 8K, ... */ uint64_t is_pmaxaddr; /* (r) max. physical address */ uint64_t is_dvmabase; /* (r) */ - int64_t is_cr; /* (r) Control reg value */ + uint64_t is_cr; /* (r) Control reg value */ vm_paddr_t is_flushpa[2]; /* (r) */ - volatile int64_t *is_flushva[2]; /* (r, *i) */ + volatile uint64_t *is_flushva[2]; /* (r, *i) */ /* * (i) * When a flush is completed, 64 bytes will be stored at the given @@ -99,11 +99,14 @@ struct iommu_state { /* behavior flags */ u_int is_flags; /* (r) */ #define IOMMU_RERUN_DISABLE (1 << 0) +#define IOMMU_FIRE (1 << 1) +#define IOMMU_FLUSH_CACHE (1 << 2) +#define IOMMU_PRESERVE_PROM (1 << 3) }; /* interfaces for PCI/SBus code */ -void iommu_init(const char *name, struct iommu_state *is, int tsbsize, - uint32_t iovabase, int resvpg); +void iommu_init(const char *name, struct iommu_state *is, u_int tsbsize, + uint32_t iovabase, u_int resvpg); void iommu_reset(struct iommu_state *is); void iommu_decode_fault(struct iommu_state *is, vm_offset_t phys); Modified: stable/8/sys/sparc64/sparc64/iommu.c ============================================================================== --- stable/8/sys/sparc64/sparc64/iommu.c Wed Jan 13 21:13:51 2010 (r202255) +++ stable/8/sys/sparc64/sparc64/iommu.c Wed Jan 13 21:16:07 2010 (r202256) @@ -138,11 +138,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include @@ -212,6 +214,12 @@ static __inline void iommu_tlb_flush(struct iommu_state *is, bus_addr_t va) { + if ((is->is_flags & IOMMU_FIRE) != 0) + /* + * Direct page flushing is not supported and also not + * necessary due to cache snooping. + */ + return; IOMMU_WRITE8(is, is_iommu, IMR_FLUSH, va); } @@ -282,18 +290,19 @@ iommu_map_remq(struct iommu_state *is, b * - create a private DVMA map. */ void -iommu_init(const char *name, struct iommu_state *is, int tsbsize, - uint32_t iovabase, int resvpg) +iommu_init(const char *name, struct iommu_state *is, u_int tsbsize, + uint32_t iovabase, u_int resvpg) { vm_size_t size; vm_offset_t offs; - uint64_t end; + uint64_t end, obpmap, obpptsb, tte; + u_int maxtsbsize, obptsbentries, obptsbsize, slot, tsbentries; int i; /* - * Setup the iommu. + * Setup the IOMMU. * - * The sun4u iommu is part of the PCI or SBus controller so we + * The sun4u IOMMU is part of the PCI or SBus controller so we * will deal with it here.. * * The IOMMU address space always ends at 0xffffe000, but the starting @@ -301,16 +310,30 @@ iommu_init(const char *name, struct iomm * is->is_tsbsize entries, where each entry is 8 bytes. The start of * the map can be calculated by (0xffffe000 << (8 + is->is_tsbsize)). */ - is->is_cr = (tsbsize << IOMMUCR_TSBSZ_SHIFT) | IOMMUCR_EN; + if ((is->is_flags & IOMMU_FIRE) != 0) { + maxtsbsize = IOMMU_TSB512K; + /* + * We enable bypass in order to be able to use a physical + * address for the event queue base. + */ + is->is_cr = IOMMUCR_SE | IOMMUCR_CM_C_TLB_TBW | IOMMUCR_BE; + } else { + maxtsbsize = IOMMU_TSB128K; + is->is_cr = (tsbsize << IOMMUCR_TSBSZ_SHIFT) | IOMMUCR_DE; + } + if (tsbsize > maxtsbsize) + panic("%s: unsupported TSB size ", __func__); + tsbentries = IOMMU_TSBENTRIES(tsbsize); + is->is_cr |= IOMMUCR_EN; is->is_tsbsize = tsbsize; is->is_dvmabase = iovabase; if (iovabase == -1) is->is_dvmabase = IOTSB_VSTART(is->is_tsbsize); size = IOTSB_BASESZ << is->is_tsbsize; - printf("%s: DVMA map: %#lx to %#lx%s\n", name, + printf("%s: DVMA map: %#lx to %#lx %d entries%s\n", name, is->is_dvmabase, is->is_dvmabase + - (size << (IO_PAGE_SHIFT - IOTTE_SHIFT)) - 1, + (size << (IO_PAGE_SHIFT - IOTTE_SHIFT)) - 1, tsbentries, IOMMU_HAS_SB(is) ? ", streaming buffer" : ""); /* @@ -333,12 +356,54 @@ iommu_init(const char *name, struct iomm */ is->is_tsb = contigmalloc(size, M_DEVBUF, M_NOWAIT, 0, ~0UL, PAGE_SIZE, 0); - if (is->is_tsb == 0) + if (is->is_tsb == NULL) panic("%s: contigmalloc failed", __func__); is->is_ptsb = pmap_kextract((vm_offset_t)is->is_tsb); bzero(is->is_tsb, size); /* + * Add the PROM mappings to the kernel IOTSB if desired. + * Note that the firmware of certain Darwin boards doesn't set + * the TSB size correctly. + */ + if ((is->is_flags & IOMMU_FIRE) != 0) + obptsbsize = (IOMMU_READ8(is, is_iommu, IMR_TSB) & + IOMMUTB_TSBSZ_MASK) >> IOMMUTB_TSBSZ_SHIFT; + else + obptsbsize = (IOMMU_READ8(is, is_iommu, IMR_CTL) & + IOMMUCR_TSBSZ_MASK) >> IOMMUCR_TSBSZ_SHIFT; + obptsbentries = IOMMU_TSBENTRIES(obptsbsize); + if (bootverbose) + printf("%s: PROM IOTSB size: %d (%d entries)\n", name, + obptsbsize, obptsbentries); + if ((is->is_flags & IOMMU_PRESERVE_PROM) != 0 && + !(cpu_impl == CPU_IMPL_ULTRASPARCIIi && obptsbsize == 7)) { + if (obptsbentries > tsbentries) + panic("%s: PROM IOTSB entries exceed kernel", + __func__); + obpptsb = IOMMU_READ8(is, is_iommu, IMR_TSB) & + IOMMUTB_TB_MASK; + for (i = 0; i < obptsbentries; i++) { + tte = ldxa(obpptsb + i * 8, ASI_PHYS_USE_EC); + if ((tte & IOTTE_V) == 0) + continue; + slot = tsbentries - obptsbentries + i; + if (bootverbose) + printf("%s: adding PROM IOTSB slot %d " + "(kernel slot %d) TTE: %#lx\n", name, + i, slot, tte); + obpmap = (is->is_dvmabase + slot * IO_PAGE_SIZE) >> + IO_PAGE_SHIFT; + if (rman_reserve_resource(&is->is_dvma_rman, obpmap, + obpmap, IO_PAGE_SIZE >> IO_PAGE_SHIFT, RF_ACTIVE, + NULL) == NULL) + panic("%s: could not reserve PROM IOTSB slot " + "%d (kernel slot %d)", __func__, i, slot); + is->is_tsb[slot] = tte; + } + } + + /* * Initialize streaming buffer, if it is there. */ if (IOMMU_HAS_SB(is)) { @@ -349,7 +414,7 @@ iommu_init(const char *name, struct iomm offs = roundup2((vm_offset_t)is->is_flush, STRBUF_FLUSHSYNC_NBYTES); for (i = 0; i < 2; i++, offs += STRBUF_FLUSHSYNC_NBYTES) { - is->is_flushva[i] = (int64_t *)offs; + is->is_flushva[i] = (uint64_t *)offs; is->is_flushpa[i] = pmap_kextract(offs); } } @@ -368,11 +433,16 @@ iommu_init(const char *name, struct iomm void iommu_reset(struct iommu_state *is) { + uint64_t tsb; int i; - IOMMU_WRITE8(is, is_iommu, IMR_TSB, is->is_ptsb); - /* Enable IOMMU in diagnostic mode */ - IOMMU_WRITE8(is, is_iommu, IMR_CTL, is->is_cr | IOMMUCR_DE); + tsb = is->is_ptsb; + if ((is->is_flags & IOMMU_FIRE) != 0) { + tsb |= is->is_tsbsize; + IOMMU_WRITE8(is, is_iommu, IMR_CACHE_INVAL, ~0ULL); + } + IOMMU_WRITE8(is, is_iommu, IMR_TSB, tsb); + IOMMU_WRITE8(is, is_iommu, IMR_CTL, is->is_cr); for (i = 0; i < 2; i++) { if (is->is_sb[i] != 0) { @@ -386,6 +456,8 @@ iommu_reset(struct iommu_state *is) is->is_sb[i] = 0; } } + + (void)IOMMU_READ8(is, is_iommu, IMR_CTL); } /* @@ -396,7 +468,7 @@ static void iommu_enter(struct iommu_state *is, vm_offset_t va, vm_paddr_t pa, int stream, int flags) { - int64_t tte; + uint64_t tte; KASSERT(va >= is->is_dvmabase, ("%s: va %#lx not in DVMA space", __func__, va)); @@ -423,7 +495,7 @@ iommu_enter(struct iommu_state *is, vm_o static int iommu_remove(struct iommu_state *is, vm_offset_t va, vm_size_t len) { - int streamed = 0; + int slot, streamed = 0; #ifdef IOMMU_DIAG iommu_diag(is, va); @@ -443,6 +515,12 @@ iommu_remove(struct iommu_state *is, vm_ len -= ulmin(len, IO_PAGE_SIZE); IOMMU_SET_TTE(is, va, 0); iommu_tlb_flush(is, va); + if ((is->is_flags & IOMMU_FLUSH_CACHE) != 0) { + slot = IOTSBSLOT(va); + if (len <= IO_PAGE_SIZE || slot % 8 == 7) + IOMMU_WRITE8(is, is_iommu, IMR_CACHE_FLUSH, + is->is_ptsb + slot * 8); + } va += IO_PAGE_SIZE; } return (streamed); @@ -829,12 +907,13 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t bus_dmamap_t map, void *buf, bus_size_t buflen, struct thread *td, int flags, bus_dma_segment_t *segs, int *segp, int align) { - bus_addr_t amask, dvmaddr; + bus_addr_t amask, dvmaddr, dvmoffs; bus_size_t sgsize, esize; vm_offset_t vaddr, voffs; vm_paddr_t curaddr; pmap_t pmap = NULL; int error, firstpg, sgcnt; + u_int slot; KASSERT(buflen != 0, ("%s: buflen == 0!", __func__)); if (buflen > dt->dt_maxsize) @@ -877,8 +956,15 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t buflen -= sgsize; vaddr += sgsize; - iommu_enter(is, trunc_io_page(dvmaddr), trunc_io_page(curaddr), + dvmoffs = trunc_io_page(dvmaddr); + iommu_enter(is, dvmoffs, trunc_io_page(curaddr), (map->dm_flags & DMF_STREAMED) != 0, flags); + if ((is->is_flags & IOMMU_FLUSH_CACHE) != 0) { + slot = IOTSBSLOT(dvmoffs); + if (buflen <= 0 || slot % 8 == 7) + IOMMU_WRITE8(is, is_iommu, IMR_CACHE_FLUSH, + is->is_ptsb + slot * 8); + } /* * Chop the chunk up into segments of at most maxsegsz, but try @@ -1183,6 +1269,8 @@ iommu_diag(struct iommu_state *is, vm_of int i; uint64_t data, tag; + if ((is->is_flags & IOMMU_FIRE) != 0) + return; IS_LOCK_ASSERT(is); IOMMU_WRITE8(is, is_dva, 0, trunc_io_page(va)); membar(StoreStore | StoreLoad); From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:16:13 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF794106575C; Wed, 13 Jan 2010 21:16:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB7ED8FC12; Wed, 13 Jan 2010 21:16: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 o0DLGDeL026913; Wed, 13 Jan 2010 21:16:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLGDEa026909; Wed, 13 Jan 2010 21:16:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132116.o0DLGDEa026909@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202257 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:16:14 -0000 Author: marius Date: Wed Jan 13 21:16:13 2010 New Revision: 202257 URL: http://svn.freebsd.org/changeset/base/202257 Log: MFC: r200923 - Add support for the IOMMUs of Fire JBus to PCIe and Oberon Uranus to PCIe bridges. - Add support for talking the PROM mappings over to the kernel IOTSB just like we do with the kernel TSB in order to allow OFW drivers to continue to work. - Change some members, parameters and variables to unsigned where more appropriate. Modified: stable/7/sys/sparc64/include/iommureg.h stable/7/sys/sparc64/include/iommuvar.h stable/7/sys/sparc64/sparc64/iommu.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/iommureg.h ============================================================================== --- stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:16:07 2010 (r202256) +++ stable/7/sys/sparc64/include/iommureg.h Wed Jan 13 21:16:13 2010 (r202257) @@ -44,10 +44,13 @@ * controllers. */ -/* iommmu registers */ +/* IOMMU registers */ #define IMR_CTL 0x0000 /* IOMMU control register */ #define IMR_TSB 0x0008 /* IOMMU TSB base register */ #define IMR_FLUSH 0x0010 /* IOMMU flush register */ +/* The TTE Cache is Fire and Oberon only. */ +#define IMR_CACHE_FLUSH 0x0100 /* IOMMU TTE cache flush address register */ +#define IMR_CACHE_INVAL 0x0108 /* IOMMU TTE cache invalidate register */ /* streaming buffer registers */ #define ISR_CTL 0x0000 /* streaming buffer control reg */ @@ -70,28 +73,57 @@ /* * control register bits */ -/* Nummber of entries in IOTSB */ +/* Nummber of entries in the IOTSB - pre-Fire only */ +#define IOMMUCR_TSBSZ_MASK 0x0000000000070000UL #define IOMMUCR_TSBSZ_SHIFT 16 -#define IOMMUCR_TSB1K 0x0000000000000000UL -#define IOMMUCR_TSB2K 0x0000000000010000UL -#define IOMMUCR_TSB4K 0x0000000000020000UL -#define IOMMUCR_TSB8K 0x0000000000030000UL -#define IOMMUCR_TSB16K 0x0000000000040000UL -#define IOMMUCR_TSB32K 0x0000000000050000UL -#define IOMMUCR_TSB64K 0x0000000000060000UL -#define IOMMUCR_TSB128K 0x0000000000070000UL -/* Mask for above */ -#define IOMMUCR_TSBMASK 0xfffffffffff8ffffUL -/* 8K iommu page size */ +/* TSB cache snoop enable */ +#define IOMMUCR_SE 0x0000000000000400UL +/* Cache modes - Fire and Oberon */ +#define IOMMUCR_CM_NC_TLB_TBW 0x0000000000000000UL +#define IOMMUCR_CM_LC_NTLB_NTBW 0x0000000000000100UL +#define IOMMUCR_CM_LC_TLB_TBW 0x0000000000000200UL +#define IOMMUCR_CM_C_TLB_TBW 0x0000000000000300UL +/* IOMMU page size - pre-Fire only */ #define IOMMUCR_8KPG 0x0000000000000000UL -/* 64K iommu page size */ #define IOMMUCR_64KPG 0x0000000000000004UL -/* Diag enable */ +/* Bypass enable - Fire and Oberon */ +#define IOMMUCR_BE 0x0000000000000002UL +/* Diagnostic mode enable - pre-Fire only */ #define IOMMUCR_DE 0x0000000000000002UL -/* Enable IOMMU */ +/* IOMMU/translation enable */ #define IOMMUCR_EN 0x0000000000000001UL /* + * TSB base register bits + */ + /* TSB base address */ +#define IOMMUTB_TB_MASK 0x000007ffffffe000UL +#define IOMMUTB_TB_SHIFT 13 +/* IOMMU page size - Fire and Oberon */ +#define IOMMUTB_8KPG 0x0000000000000000UL +#define IOMMUTB_64KPG 0x0000000000000100UL +/* Nummber of entries in the IOTSB - Fire and Oberon */ +#define IOMMUTB_TSBSZ_MASK 0x0000000000000004UL +#define IOMMUTB_TSBSZ_SHIFT 0 + +/* + * TSB size definitions for both control and TSB base register */ +#define IOMMU_TSB1K 0 +#define IOMMU_TSB2K 1 +#define IOMMU_TSB4K 2 +#define IOMMU_TSB8K 3 +#define IOMMU_TSB16K 4 +#define IOMMU_TSB32K 5 +#define IOMMU_TSB64K 6 +#define IOMMU_TSB128K 7 +/* Fire and Oberon */ +#define IOMMU_TSB256K 8 +/* Fire and Oberon */ +#define IOMMU_TSB512K 9 +#define IOMMU_TSBENTRIES(tsbsz) \ + ((1 << (tsbsz)) << (IO_PAGE_SHIFT - IOTTE_SHIFT)) + +/* * Diagnostic register definitions */ #define IOMMU_DTAG_VPNBITS 19 @@ -113,16 +145,16 @@ */ /* Entry valid */ #define IOTTE_V 0x8000000000000000UL -/* 8K or 64K page? */ +/* Page size - pre-Fire only */ #define IOTTE_64K 0x2000000000000000UL #define IOTTE_8K 0x0000000000000000UL -/* Is page streamable? */ +/* Streamable page - streaming buffer equipped variants only */ #define IOTTE_STREAM 0x1000000000000000UL -/* Accesses to same bus segment? */ +/* Accesses to the same bus segment - SBus only */ #define IOTTE_LOCAL 0x0800000000000000UL -/* Let's assume this is correct */ -#define IOTTE_PAMASK 0x000007ffffffe000UL -/* Accesses to cacheable space */ +/* Physical address mask (based on Oberon) */ +#define IOTTE_PAMASK 0x00007fffffffe000UL +/* Accesses to cacheable space - pre-Fire only */ #define IOTTE_C 0x0000000000000010UL /* Writeable */ #define IOTTE_W 0x0000000000000002UL Modified: stable/7/sys/sparc64/include/iommuvar.h ============================================================================== --- stable/7/sys/sparc64/include/iommuvar.h Wed Jan 13 21:16:07 2010 (r202256) +++ stable/7/sys/sparc64/include/iommuvar.h Wed Jan 13 21:16:13 2010 (r202257) @@ -66,10 +66,10 @@ struct iommu_state { int is_tsbsize; /* (r) 0 = 8K, ... */ uint64_t is_pmaxaddr; /* (r) max. physical address */ uint64_t is_dvmabase; /* (r) */ - int64_t is_cr; /* (r) Control reg value */ + uint64_t is_cr; /* (r) Control reg value */ vm_paddr_t is_flushpa[2]; /* (r) */ - volatile int64_t *is_flushva[2]; /* (r, *i) */ + volatile uint64_t *is_flushva[2]; /* (r, *i) */ /* * (i) * When a flush is completed, 64 bytes will be stored at the given @@ -99,11 +99,14 @@ struct iommu_state { /* behavior flags */ u_int is_flags; /* (r) */ #define IOMMU_RERUN_DISABLE (1 << 0) +#define IOMMU_FIRE (1 << 1) +#define IOMMU_FLUSH_CACHE (1 << 2) +#define IOMMU_PRESERVE_PROM (1 << 3) }; /* interfaces for PCI/SBus code */ -void iommu_init(const char *name, struct iommu_state *is, int tsbsize, - uint32_t iovabase, int resvpg); +void iommu_init(const char *name, struct iommu_state *is, u_int tsbsize, + uint32_t iovabase, u_int resvpg); void iommu_reset(struct iommu_state *is); void iommu_decode_fault(struct iommu_state *is, vm_offset_t phys); Modified: stable/7/sys/sparc64/sparc64/iommu.c ============================================================================== --- stable/7/sys/sparc64/sparc64/iommu.c Wed Jan 13 21:16:07 2010 (r202256) +++ stable/7/sys/sparc64/sparc64/iommu.c Wed Jan 13 21:16:13 2010 (r202257) @@ -138,11 +138,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include @@ -212,6 +214,12 @@ static __inline void iommu_tlb_flush(struct iommu_state *is, bus_addr_t va) { + if ((is->is_flags & IOMMU_FIRE) != 0) + /* + * Direct page flushing is not supported and also not + * necessary due to cache snooping. + */ + return; IOMMU_WRITE8(is, is_iommu, IMR_FLUSH, va); } @@ -282,18 +290,19 @@ iommu_map_remq(struct iommu_state *is, b * - create a private DVMA map. */ void -iommu_init(const char *name, struct iommu_state *is, int tsbsize, - uint32_t iovabase, int resvpg) +iommu_init(const char *name, struct iommu_state *is, u_int tsbsize, + uint32_t iovabase, u_int resvpg) { vm_size_t size; vm_offset_t offs; - uint64_t end; + uint64_t end, obpmap, obpptsb, tte; + u_int maxtsbsize, obptsbentries, obptsbsize, slot, tsbentries; int i; /* - * Setup the iommu. + * Setup the IOMMU. * - * The sun4u iommu is part of the PCI or SBus controller so we + * The sun4u IOMMU is part of the PCI or SBus controller so we * will deal with it here.. * * The IOMMU address space always ends at 0xffffe000, but the starting @@ -301,16 +310,30 @@ iommu_init(const char *name, struct iomm * is->is_tsbsize entries, where each entry is 8 bytes. The start of * the map can be calculated by (0xffffe000 << (8 + is->is_tsbsize)). */ - is->is_cr = (tsbsize << IOMMUCR_TSBSZ_SHIFT) | IOMMUCR_EN; + if ((is->is_flags & IOMMU_FIRE) != 0) { + maxtsbsize = IOMMU_TSB512K; + /* + * We enable bypass in order to be able to use a physical + * address for the event queue base. + */ + is->is_cr = IOMMUCR_SE | IOMMUCR_CM_C_TLB_TBW | IOMMUCR_BE; + } else { + maxtsbsize = IOMMU_TSB128K; + is->is_cr = (tsbsize << IOMMUCR_TSBSZ_SHIFT) | IOMMUCR_DE; + } + if (tsbsize > maxtsbsize) + panic("%s: unsupported TSB size ", __func__); + tsbentries = IOMMU_TSBENTRIES(tsbsize); + is->is_cr |= IOMMUCR_EN; is->is_tsbsize = tsbsize; is->is_dvmabase = iovabase; if (iovabase == -1) is->is_dvmabase = IOTSB_VSTART(is->is_tsbsize); size = IOTSB_BASESZ << is->is_tsbsize; - printf("%s: DVMA map: %#lx to %#lx%s\n", name, + printf("%s: DVMA map: %#lx to %#lx %d entries%s\n", name, is->is_dvmabase, is->is_dvmabase + - (size << (IO_PAGE_SHIFT - IOTTE_SHIFT)) - 1, + (size << (IO_PAGE_SHIFT - IOTTE_SHIFT)) - 1, tsbentries, IOMMU_HAS_SB(is) ? ", streaming buffer" : ""); /* @@ -333,12 +356,54 @@ iommu_init(const char *name, struct iomm */ is->is_tsb = contigmalloc(size, M_DEVBUF, M_NOWAIT, 0, ~0UL, PAGE_SIZE, 0); - if (is->is_tsb == 0) + if (is->is_tsb == NULL) panic("%s: contigmalloc failed", __func__); is->is_ptsb = pmap_kextract((vm_offset_t)is->is_tsb); bzero(is->is_tsb, size); /* + * Add the PROM mappings to the kernel IOTSB if desired. + * Note that the firmware of certain Darwin boards doesn't set + * the TSB size correctly. + */ + if ((is->is_flags & IOMMU_FIRE) != 0) + obptsbsize = (IOMMU_READ8(is, is_iommu, IMR_TSB) & + IOMMUTB_TSBSZ_MASK) >> IOMMUTB_TSBSZ_SHIFT; + else + obptsbsize = (IOMMU_READ8(is, is_iommu, IMR_CTL) & + IOMMUCR_TSBSZ_MASK) >> IOMMUCR_TSBSZ_SHIFT; + obptsbentries = IOMMU_TSBENTRIES(obptsbsize); + if (bootverbose) + printf("%s: PROM IOTSB size: %d (%d entries)\n", name, + obptsbsize, obptsbentries); + if ((is->is_flags & IOMMU_PRESERVE_PROM) != 0 && + !(cpu_impl == CPU_IMPL_ULTRASPARCIIi && obptsbsize == 7)) { + if (obptsbentries > tsbentries) + panic("%s: PROM IOTSB entries exceed kernel", + __func__); + obpptsb = IOMMU_READ8(is, is_iommu, IMR_TSB) & + IOMMUTB_TB_MASK; + for (i = 0; i < obptsbentries; i++) { + tte = ldxa(obpptsb + i * 8, ASI_PHYS_USE_EC); + if ((tte & IOTTE_V) == 0) + continue; + slot = tsbentries - obptsbentries + i; + if (bootverbose) + printf("%s: adding PROM IOTSB slot %d " + "(kernel slot %d) TTE: %#lx\n", name, + i, slot, tte); + obpmap = (is->is_dvmabase + slot * IO_PAGE_SIZE) >> + IO_PAGE_SHIFT; + if (rman_reserve_resource(&is->is_dvma_rman, obpmap, + obpmap, IO_PAGE_SIZE >> IO_PAGE_SHIFT, RF_ACTIVE, + NULL) == NULL) + panic("%s: could not reserve PROM IOTSB slot " + "%d (kernel slot %d)", __func__, i, slot); + is->is_tsb[slot] = tte; + } + } + + /* * Initialize streaming buffer, if it is there. */ if (IOMMU_HAS_SB(is)) { @@ -349,7 +414,7 @@ iommu_init(const char *name, struct iomm offs = roundup2((vm_offset_t)is->is_flush, STRBUF_FLUSHSYNC_NBYTES); for (i = 0; i < 2; i++, offs += STRBUF_FLUSHSYNC_NBYTES) { - is->is_flushva[i] = (int64_t *)offs; + is->is_flushva[i] = (uint64_t *)offs; is->is_flushpa[i] = pmap_kextract(offs); } } @@ -368,11 +433,16 @@ iommu_init(const char *name, struct iomm void iommu_reset(struct iommu_state *is) { + uint64_t tsb; int i; - IOMMU_WRITE8(is, is_iommu, IMR_TSB, is->is_ptsb); - /* Enable IOMMU in diagnostic mode */ - IOMMU_WRITE8(is, is_iommu, IMR_CTL, is->is_cr | IOMMUCR_DE); + tsb = is->is_ptsb; + if ((is->is_flags & IOMMU_FIRE) != 0) { + tsb |= is->is_tsbsize; + IOMMU_WRITE8(is, is_iommu, IMR_CACHE_INVAL, ~0ULL); + } + IOMMU_WRITE8(is, is_iommu, IMR_TSB, tsb); + IOMMU_WRITE8(is, is_iommu, IMR_CTL, is->is_cr); for (i = 0; i < 2; i++) { if (is->is_sb[i] != 0) { @@ -386,6 +456,8 @@ iommu_reset(struct iommu_state *is) is->is_sb[i] = 0; } } + + (void)IOMMU_READ8(is, is_iommu, IMR_CTL); } /* @@ -396,7 +468,7 @@ static void iommu_enter(struct iommu_state *is, vm_offset_t va, vm_paddr_t pa, int stream, int flags) { - int64_t tte; + uint64_t tte; KASSERT(va >= is->is_dvmabase, ("%s: va %#lx not in DVMA space", __func__, va)); @@ -423,7 +495,7 @@ iommu_enter(struct iommu_state *is, vm_o static int iommu_remove(struct iommu_state *is, vm_offset_t va, vm_size_t len) { - int streamed = 0; + int slot, streamed = 0; #ifdef IOMMU_DIAG iommu_diag(is, va); @@ -443,6 +515,12 @@ iommu_remove(struct iommu_state *is, vm_ len -= ulmin(len, IO_PAGE_SIZE); IOMMU_SET_TTE(is, va, 0); iommu_tlb_flush(is, va); + if ((is->is_flags & IOMMU_FLUSH_CACHE) != 0) { + slot = IOTSBSLOT(va); + if (len <= IO_PAGE_SIZE || slot % 8 == 7) + IOMMU_WRITE8(is, is_iommu, IMR_CACHE_FLUSH, + is->is_ptsb + slot * 8); + } va += IO_PAGE_SIZE; } return (streamed); @@ -829,12 +907,13 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t bus_dmamap_t map, void *buf, bus_size_t buflen, struct thread *td, int flags, bus_dma_segment_t *segs, int *segp, int align) { - bus_addr_t amask, dvmaddr; + bus_addr_t amask, dvmaddr, dvmoffs; bus_size_t sgsize, esize; vm_offset_t vaddr, voffs; vm_paddr_t curaddr; pmap_t pmap = NULL; int error, firstpg, sgcnt; + u_int slot; KASSERT(buflen != 0, ("%s: buflen == 0!", __func__)); if (buflen > dt->dt_maxsize) @@ -877,8 +956,15 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t buflen -= sgsize; vaddr += sgsize; - iommu_enter(is, trunc_io_page(dvmaddr), trunc_io_page(curaddr), + dvmoffs = trunc_io_page(dvmaddr); + iommu_enter(is, dvmoffs, trunc_io_page(curaddr), (map->dm_flags & DMF_STREAMED) != 0, flags); + if ((is->is_flags & IOMMU_FLUSH_CACHE) != 0) { + slot = IOTSBSLOT(dvmoffs); + if (buflen <= 0 || slot % 8 == 7) + IOMMU_WRITE8(is, is_iommu, IMR_CACHE_FLUSH, + is->is_ptsb + slot * 8); + } /* * Chop the chunk up into segments of at most maxsegsz, but try @@ -1183,6 +1269,8 @@ iommu_diag(struct iommu_state *is, vm_of int i; uint64_t data, tag; + if ((is->is_flags & IOMMU_FIRE) != 0) + return; IS_LOCK_ASSERT(is); IOMMU_WRITE8(is, is_dva, 0, trunc_io_page(va)); membar(StoreStore | StoreLoad); From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:17:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E16D1065670; Wed, 13 Jan 2010 21:17:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C3628FC08; Wed, 13 Jan 2010 21:17: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 o0DLHk5U027317; Wed, 13 Jan 2010 21:17:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLHklI027315; Wed, 13 Jan 2010 21:17:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132117.o0DLHklI027315@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:17: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: r202258 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:17:46 -0000 Author: marius Date: Wed Jan 13 21:17:45 2010 New Revision: 202258 URL: http://svn.freebsd.org/changeset/base/202258 Log: MFC: r200924 Style changes. Modified: stable/8/sys/sparc64/sparc64/ofw_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) Modified: stable/8/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:16:13 2010 (r202257) +++ stable/8/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:17:45 2010 (r202258) @@ -23,7 +23,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + #include __FBSDID("$FreeBSD$"); @@ -64,34 +64,32 @@ OF_getetheraddr(device_t dev, u_char *ad node = OF_peer(0); if (node <= 0 || OF_getprop(node, "idprom", &idp, sizeof(idp)) == -1) - panic("Could not determine the machine ethernet address"); + panic("Could not determine the machine Ethernet address"); bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN); } static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { - uint32_t space; - space = phys_hi; if (strcmp(bus, "ebus") == 0 || strcmp(bus, "isa") == 0) - space &= 0x1; + phys_hi &= 0x1; else if (strcmp(bus, "pci") == 0) - space &= OFW_PCI_PHYS_HI_SPACEMASK; + phys_hi &= OFW_PCI_PHYS_HI_SPACEMASK; /* The phys.hi cells of the other busses only contain space bits. */ - return (space); + return (phys_hi); } /* * Return the physical address and the bus space to use for a node * referenced by its package handle and the index of the register bank - * to decode. Intended to be used to together with sparc64_fake_bustag() + * to decode. Intended to be used to together with sparc64_fake_bustag() * by console drivers in early boot only. * Works by mapping the address of the node's bank given in the address * space of its parent upward in the device tree at each bridge along the * path. * Currently only really deals with max. 64-bit addresses, i.e. addresses - * consisting of max. 2 phys cells (phys.hi and phys.lo). If we encounter + * consisting of max. 2 phys cells (phys.hi and phys.lo). If we encounter * a 3 phys cells address (as with PCI addresses) we assume phys.hi can * be ignored except for the space bits (generally contained in phys.hi) * and treat phys.mid as phys.hi. @@ -109,17 +107,17 @@ OF_decode_addr(phandle_t node, int bank, /* * In general the addresses are contained in the "reg" property - * of a node. The first address in the "reg" property of a PCI + * of a node. The first address in the "reg" property of a PCI * node however is the address of its configuration registers in - * the configuration space of the host bridge. Additional entries - * denote the memory and I/O addresses. For relocatable addresses + * the configuration space of the host bridge. Additional entries + * denote the memory and I/O addresses. For relocatable addresses * the "reg" property contains the BAR, for non-relocatable - * addresses it contains the absolute PCI address. The PCI-only + * addresses it contains the absolute PCI address. The PCI-only * "assigned-addresses" property however always contains the * absolute PCI addresses. * The "assigned-addresses" and "reg" properties are arrays of * address structures consisting of #address-cells 32-bit phys - * cells and #size-cells 32-bit size cells. If a parent lacks + * cells and #size-cells 32-bit size cells. If a parent lacks * the "#address-cells" or "#size-cells" property the default * for #address-cells to use is 2 and for #size-cells 1. */ From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:17:49 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E7E1106566B; Wed, 13 Jan 2010 21:17:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CA2F8FC0A; Wed, 13 Jan 2010 21:17:49 +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 o0DLHnCh027355; Wed, 13 Jan 2010 21:17:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLHnb8027353; Wed, 13 Jan 2010 21:17:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132117.o0DLHnb8027353@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202259 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:17:49 -0000 Author: marius Date: Wed Jan 13 21:17:48 2010 New Revision: 202259 URL: http://svn.freebsd.org/changeset/base/202259 Log: MFC: r200924 Style changes. Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:17:45 2010 (r202258) +++ stable/7/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:17:48 2010 (r202259) @@ -23,7 +23,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + #include __FBSDID("$FreeBSD$"); @@ -65,34 +65,32 @@ OF_getetheraddr(device_t dev, u_char *ad node = OF_peer(0); if (node <= 0 || OF_getprop(node, "idprom", &idp, sizeof(idp)) == -1) - panic("Could not determine the machine ethernet address"); + panic("Could not determine the machine Ethernet address"); bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN); } static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { - uint32_t space; - space = phys_hi; if (strcmp(bus, "ebus") == 0 || strcmp(bus, "isa") == 0) - space &= 0x1; + phys_hi &= 0x1; else if (strcmp(bus, "pci") == 0) - space &= OFW_PCI_PHYS_HI_SPACEMASK; + phys_hi &= OFW_PCI_PHYS_HI_SPACEMASK; /* The phys.hi cells of the other busses only contain space bits. */ - return (space); + return (phys_hi); } /* * Return the physical address and the bus space to use for a node * referenced by its package handle and the index of the register bank - * to decode. Intended to be used to together with sparc64_fake_bustag() + * to decode. Intended to be used to together with sparc64_fake_bustag() * by console drivers in early boot only. * Works by mapping the address of the node's bank given in the address * space of its parent upward in the device tree at each bridge along the * path. * Currently only really deals with max. 64-bit addresses, i.e. addresses - * consisting of max. 2 phys cells (phys.hi and phys.lo). If we encounter + * consisting of max. 2 phys cells (phys.hi and phys.lo). If we encounter * a 3 phys cells address (as with PCI addresses) we assume phys.hi can * be ignored except for the space bits (generally contained in phys.hi) * and treat phys.mid as phys.hi. @@ -110,17 +108,17 @@ OF_decode_addr(phandle_t node, int bank, /* * In general the addresses are contained in the "reg" property - * of a node. The first address in the "reg" property of a PCI + * of a node. The first address in the "reg" property of a PCI * node however is the address of its configuration registers in - * the configuration space of the host bridge. Additional entries - * denote the memory and I/O addresses. For relocatable addresses + * the configuration space of the host bridge. Additional entries + * denote the memory and I/O addresses. For relocatable addresses * the "reg" property contains the BAR, for non-relocatable - * addresses it contains the absolute PCI address. The PCI-only + * addresses it contains the absolute PCI address. The PCI-only * "assigned-addresses" property however always contains the * absolute PCI addresses. * The "assigned-addresses" and "reg" properties are arrays of * address structures consisting of #address-cells 32-bit phys - * cells and #size-cells 32-bit size cells. If a parent lacks + * cells and #size-cells 32-bit size cells. If a parent lacks * the "#address-cells" or "#size-cells" property the default * for #address-cells to use is 2 and for #size-cells 1. */ From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:19:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 984F0106566B; Wed, 13 Jan 2010 21:19:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 867148FC0A; Wed, 13 Jan 2010 21:19: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 o0DLJkiv027876; Wed, 13 Jan 2010 21:19:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLJkIX027874; Wed, 13 Jan 2010 21:19:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132119.o0DLJkIX027874@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:19: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: r202260 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:19:46 -0000 Author: marius Date: Wed Jan 13 21:19:46 2010 New Revision: 202260 URL: http://svn.freebsd.org/changeset/base/202260 Log: MFC: r200925 - By re-arranging the code in OF_decode_addr() somewhat and accepting a bit of a detour we can just iterate through the banks array instead of having to calculate every offset. This change is inspired by the powerpc version of this function. - Add support for the JBus to EBus bridges which hang off of nexus(4). Modified: stable/8/sys/sparc64/sparc64/ofw_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) Modified: stable/8/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:17:48 2010 (r202259) +++ stable/8/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:19:46 2010 (r202260) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2001 by Thomas Moestl . - * Copyright (c) 2005 by Marius Strobl . + * Copyright (c) 2005 - 2009 by Marius Strobl . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -98,11 +98,11 @@ int OF_decode_addr(phandle_t node, int bank, int *space, bus_addr_t *addr) { char name[32]; - uint64_t cend, cstart, end, phys, sz, start; + uint64_t cend, cstart, end, phys, pphys, sz, start; pcell_t addrc, szc, paddrc; phandle_t bus, lbus, pbus; uint32_t banks[10 * 5]; /* 10 PCI banks */ - uint32_t cspace, spc; + uint32_t cspc, pspc, spc; int i, j, nbank; /* @@ -148,17 +148,18 @@ OF_decode_addr(phandle_t node, int bank, nbank /= sizeof(banks[0]) * (addrc + szc); if (bank < 0 || bank > nbank - 1) return (ENXIO); + bank *= addrc + szc; + spc = phys_hi_mask_space(name, banks[bank]); + /* Skip the high cell for 3-cell addresses. */ + bank += addrc - 2; phys = 0; for (i = 0; i < MIN(2, addrc); i++) - phys |= (uint64_t)banks[(addrc + szc) * bank + addrc - 2 + i] << - 32 * (MIN(2, addrc) - i - 1); + phys = ((uint64_t)phys << 32) | banks[bank++]; sz = 0; for (i = 0; i < szc; i++) - sz |= (uint64_t)banks[(addrc + szc) * bank + addrc + i] << - 32 * (szc - i - 1); + sz = ((uint64_t)sz << 32) | banks[bank++]; start = phys; end = phys + sz - 1; - spc = phys_hi_mask_space(name, banks[(addrc + szc) * bank]); /* * Map upward in the device tree at every bridge we encounter @@ -170,7 +171,7 @@ OF_decode_addr(phandle_t node, int bank, * If a bridge doesn't have a "ranges" property no mapping is * necessary at that bridge. */ - cspace = 0; + cspc = 0; lbus = bus; while ((pbus = OF_parent(bus)) != 0) { if (OF_getprop(pbus, "#address-cells", &paddrc, @@ -193,42 +194,40 @@ OF_decode_addr(phandle_t node, int bank, return (ENXIO); } nbank /= sizeof(banks[0]) * (addrc + paddrc + szc); + bank = 0; for (i = 0; i < nbank; i++) { - cspace = phys_hi_mask_space(name, - banks[(addrc + paddrc + szc) * i]); - if (cspace != spc) + cspc = phys_hi_mask_space(name, banks[bank]); + if (cspc != spc) { + bank += addrc + paddrc + szc; continue; + } + /* Skip the high cell for 3-cell addresses. */ + bank += addrc - 2; phys = 0; for (j = 0; j < MIN(2, addrc); j++) - phys |= (uint64_t)banks[ - (addrc + paddrc + szc) * i + - addrc - 2 + j] << - 32 * (MIN(2, addrc) - j - 1); + phys = ((uint64_t)phys << 32) | banks[bank++]; + pspc = banks[bank]; + /* Skip the high cell for 3-cell addresses. */ + bank += paddrc - 2; + pphys = 0; + for (j = 0; j < MIN(2, paddrc); j++) + pphys = + ((uint64_t)pphys << 32) | banks[bank++]; sz = 0; for (j = 0; j < szc; j++) - sz |= (uint64_t)banks[ - (addrc + paddrc + szc) * i + addrc + - paddrc + j] << - 32 * (szc - j - 1); + sz = ((uint64_t)sz << 32) | banks[bank++]; cstart = phys; cend = phys + sz - 1; if (start < cstart || start > cend) continue; if (end < cstart || end > cend) return (ENXIO); - phys = 0; - for (j = 0; j < MIN(2, paddrc); j++) - phys |= (uint64_t)banks[ - (addrc + paddrc + szc) * i + addrc + - paddrc - 2 + j] << - 32 * (MIN(2, paddrc) - j - 1); - start += phys - cstart; - end += phys - cstart; if (OF_getprop(pbus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; - spc = phys_hi_mask_space(name, - banks[(addrc + paddrc + szc) * i + addrc]); + spc = phys_hi_mask_space(name, pspc); + start += pphys - cstart; + end += pphys - cstart; break; } if (i == nbank) @@ -239,8 +238,8 @@ OF_decode_addr(phandle_t node, int bank, bus = pbus; } - /* Done with mapping. Return the bus space as used by FreeBSD. */ *addr = start; + /* Determine the bus space based on the last bus we mapped. */ if (OF_parent(lbus) == 0) { *space = NEXUS_BUS_SPACE; return (0); @@ -248,11 +247,12 @@ OF_decode_addr(phandle_t node, int bank, if (OF_getprop(lbus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; - if (strcmp(name, "central") == 0 || strcmp(name, "upa") == 0) { + if (strcmp(name, "central") == 0 || strcmp(name, "ebus") == 0 || + strcmp(name, "upa") == 0) { *space = NEXUS_BUS_SPACE; return (0); } else if (strcmp(name, "pci") == 0) { - switch (cspace) { + switch (cspc) { case OFW_PCI_PHYS_HI_SPACE_IO: *space = PCI_IO_BUS_SPACE; return (0); From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:19:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6C61065672; Wed, 13 Jan 2010 21:19:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB9258FC0C; Wed, 13 Jan 2010 21:19: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 o0DLJkvC027891; Wed, 13 Jan 2010 21:19:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLJkX3027889; Wed, 13 Jan 2010 21:19:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132119.o0DLJkX3027889@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202261 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:19:47 -0000 Author: marius Date: Wed Jan 13 21:19:46 2010 New Revision: 202261 URL: http://svn.freebsd.org/changeset/base/202261 Log: MFC: r200925 - By re-arranging the code in OF_decode_addr() somewhat and accepting a bit of a detour we can just iterate through the banks array instead of having to calculate every offset. This change is inspired by the powerpc version of this function. - Add support for the JBus to EBus bridges which hang off of nexus(4). Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:19:46 2010 (r202260) +++ stable/7/sys/sparc64/sparc64/ofw_machdep.c Wed Jan 13 21:19:46 2010 (r202261) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2001 by Thomas Moestl . - * Copyright (c) 2005 by Marius Strobl . + * Copyright (c) 2005 - 2009 by Marius Strobl . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,11 +99,11 @@ int OF_decode_addr(phandle_t node, int bank, int *space, bus_addr_t *addr) { char name[32]; - uint64_t cend, cstart, end, phys, sz, start; + uint64_t cend, cstart, end, phys, pphys, sz, start; pcell_t addrc, szc, paddrc; phandle_t bus, lbus, pbus; uint32_t banks[10 * 5]; /* 10 PCI banks */ - uint32_t cspace, spc; + uint32_t cspc, pspc, spc; int i, j, nbank; /* @@ -149,17 +149,18 @@ OF_decode_addr(phandle_t node, int bank, nbank /= sizeof(banks[0]) * (addrc + szc); if (bank < 0 || bank > nbank - 1) return (ENXIO); + bank *= addrc + szc; + spc = phys_hi_mask_space(name, banks[bank]); + /* Skip the high cell for 3-cell addresses. */ + bank += addrc - 2; phys = 0; for (i = 0; i < MIN(2, addrc); i++) - phys |= (uint64_t)banks[(addrc + szc) * bank + addrc - 2 + i] << - 32 * (MIN(2, addrc) - i - 1); + phys = ((uint64_t)phys << 32) | banks[bank++]; sz = 0; for (i = 0; i < szc; i++) - sz |= (uint64_t)banks[(addrc + szc) * bank + addrc + i] << - 32 * (szc - i - 1); + sz = ((uint64_t)sz << 32) | banks[bank++]; start = phys; end = phys + sz - 1; - spc = phys_hi_mask_space(name, banks[(addrc + szc) * bank]); /* * Map upward in the device tree at every bridge we encounter @@ -171,7 +172,7 @@ OF_decode_addr(phandle_t node, int bank, * If a bridge doesn't have a "ranges" property no mapping is * necessary at that bridge. */ - cspace = 0; + cspc = 0; lbus = bus; while ((pbus = OF_parent(bus)) != 0) { if (OF_getprop(pbus, "#address-cells", &paddrc, @@ -194,42 +195,40 @@ OF_decode_addr(phandle_t node, int bank, return (ENXIO); } nbank /= sizeof(banks[0]) * (addrc + paddrc + szc); + bank = 0; for (i = 0; i < nbank; i++) { - cspace = phys_hi_mask_space(name, - banks[(addrc + paddrc + szc) * i]); - if (cspace != spc) + cspc = phys_hi_mask_space(name, banks[bank]); + if (cspc != spc) { + bank += addrc + paddrc + szc; continue; + } + /* Skip the high cell for 3-cell addresses. */ + bank += addrc - 2; phys = 0; for (j = 0; j < MIN(2, addrc); j++) - phys |= (uint64_t)banks[ - (addrc + paddrc + szc) * i + - addrc - 2 + j] << - 32 * (MIN(2, addrc) - j - 1); + phys = ((uint64_t)phys << 32) | banks[bank++]; + pspc = banks[bank]; + /* Skip the high cell for 3-cell addresses. */ + bank += paddrc - 2; + pphys = 0; + for (j = 0; j < MIN(2, paddrc); j++) + pphys = + ((uint64_t)pphys << 32) | banks[bank++]; sz = 0; for (j = 0; j < szc; j++) - sz |= (uint64_t)banks[ - (addrc + paddrc + szc) * i + addrc + - paddrc + j] << - 32 * (szc - j - 1); + sz = ((uint64_t)sz << 32) | banks[bank++]; cstart = phys; cend = phys + sz - 1; if (start < cstart || start > cend) continue; if (end < cstart || end > cend) return (ENXIO); - phys = 0; - for (j = 0; j < MIN(2, paddrc); j++) - phys |= (uint64_t)banks[ - (addrc + paddrc + szc) * i + addrc + - paddrc - 2 + j] << - 32 * (MIN(2, paddrc) - j - 1); - start += phys - cstart; - end += phys - cstart; if (OF_getprop(pbus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; - spc = phys_hi_mask_space(name, - banks[(addrc + paddrc + szc) * i + addrc]); + spc = phys_hi_mask_space(name, pspc); + start += pphys - cstart; + end += pphys - cstart; break; } if (i == nbank) @@ -240,8 +239,8 @@ OF_decode_addr(phandle_t node, int bank, bus = pbus; } - /* Done with mapping. Return the bus space as used by FreeBSD. */ *addr = start; + /* Determine the bus space based on the last bus we mapped. */ if (OF_parent(lbus) == 0) { *space = NEXUS_BUS_SPACE; return (0); @@ -249,11 +248,12 @@ OF_decode_addr(phandle_t node, int bank, if (OF_getprop(lbus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; - if (strcmp(name, "central") == 0 || strcmp(name, "upa") == 0) { + if (strcmp(name, "central") == 0 || strcmp(name, "ebus") == 0 || + strcmp(name, "upa") == 0) { *space = NEXUS_BUS_SPACE; return (0); } else if (strcmp(name, "pci") == 0) { - switch (cspace) { + switch (cspc) { case OFW_PCI_PHYS_HI_SPACE_IO: *space = PCI_IO_BUS_SPACE; return (0); From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:21:29 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CB4B106566C; Wed, 13 Jan 2010 21:21:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61E4A8FC08; Wed, 13 Jan 2010 21:21: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 o0DLLTH6028369; Wed, 13 Jan 2010 21:21:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLLTxF028366; Wed, 13 Jan 2010 21:21:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132121.o0DLLTxF028366@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:21: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: r202262 - stable/8/sys/dev/uart X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:21:29 -0000 Author: marius Date: Wed Jan 13 21:21:29 2010 New Revision: 202262 URL: http://svn.freebsd.org/changeset/base/202262 Log: MFC: r200926 Recognize the NS16552 found in PCIe-based sun4u machines. Modified: stable/8/sys/dev/uart/uart_bus_ebus.c stable/8/sys/dev/uart/uart_cpu_sparc64.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) Modified: stable/8/sys/dev/uart/uart_bus_ebus.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_ebus.c Wed Jan 13 21:19:46 2010 (r202261) +++ stable/8/sys/dev/uart/uart_bus_ebus.c Wed Jan 13 21:21:29 2010 (r202262) @@ -77,7 +77,7 @@ uart_ebus_probe(device_t dev) if (!strcmp(nm, "lom-console") || !strcmp(nm, "su") || !strcmp(nm, "su_pnp") || !strcmp(cmpt, "rsc-console") || !strcmp(cmpt, "rsc-control") || !strcmp(cmpt, "su") || - !strcmp(cmpt, "su16550")) { + !strcmp(cmpt, "su16550") || !strcmp(cmpt, "su16552")) { /* * On AXi and AXmp boards the NS16550 (used to connect * keyboard/mouse) share their IRQ lines with the i8042. Modified: stable/8/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/8/sys/dev/uart/uart_cpu_sparc64.c Wed Jan 13 21:19:46 2010 (r202261) +++ stable/8/sys/dev/uart/uart_cpu_sparc64.c Wed Jan 13 21:21:29 2010 (r202262) @@ -254,7 +254,8 @@ uart_cpu_getdev(int devtype, struct uart addr += range - range * (di->bas.chan - 1); } else if (!strcmp(buf, "lom-console") || !strcmp(buf, "su") || !strcmp(buf, "su_pnp") || !strcmp(compat, "rsc-console") || - !strcmp(compat, "su") || !strcmp(compat, "su16550")) { + !strcmp(compat, "su") || !strcmp(compat, "su16550") || + !strcmp(compat, "su16552")) { class = &uart_ns8250_class; di->bas.chan = 0; } From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:21:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC7FD106568D; Wed, 13 Jan 2010 21:21:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B1858FC0A; Wed, 13 Jan 2010 21:21:32 +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 o0DLLWwZ028406; Wed, 13 Jan 2010 21:21:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLLWxk028403; Wed, 13 Jan 2010 21:21:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132121.o0DLLWxk028403@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202263 - stable/7/sys/dev/uart X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:21:32 -0000 Author: marius Date: Wed Jan 13 21:21:32 2010 New Revision: 202263 URL: http://svn.freebsd.org/changeset/base/202263 Log: MFC: r200926 Recognize the NS16552 found in PCIe-based sun4u machines. Modified: stable/7/sys/dev/uart/uart_bus_ebus.c stable/7/sys/dev/uart/uart_cpu_sparc64.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/uart/uart_bus_ebus.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_ebus.c Wed Jan 13 21:21:29 2010 (r202262) +++ stable/7/sys/dev/uart/uart_bus_ebus.c Wed Jan 13 21:21:32 2010 (r202263) @@ -77,7 +77,7 @@ uart_ebus_probe(device_t dev) if (!strcmp(nm, "lom-console") || !strcmp(nm, "su") || !strcmp(nm, "su_pnp") || !strcmp(cmpt, "rsc-console") || !strcmp(cmpt, "rsc-control") || !strcmp(cmpt, "su") || - !strcmp(cmpt, "su16550")) { + !strcmp(cmpt, "su16550") || !strcmp(cmpt, "su16552")) { /* * On AXi and AXmp boards the NS16550 (used to connect * keyboard/mouse) share their IRQ lines with the i8042. Modified: stable/7/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/7/sys/dev/uart/uart_cpu_sparc64.c Wed Jan 13 21:21:29 2010 (r202262) +++ stable/7/sys/dev/uart/uart_cpu_sparc64.c Wed Jan 13 21:21:32 2010 (r202263) @@ -254,7 +254,8 @@ uart_cpu_getdev(int devtype, struct uart addr += range - range * (di->bas.chan - 1); } else if (!strcmp(buf, "lom-console") || !strcmp(buf, "su") || !strcmp(buf, "su_pnp") || !strcmp(compat, "rsc-console") || - !strcmp(compat, "su") || !strcmp(compat, "su16550")) { + !strcmp(compat, "su") || !strcmp(compat, "su16550") || + !strcmp(compat, "su16552")) { class = &uart_ns8250_class; di->bas.chan = 0; } From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:23:27 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FCE410656A8; Wed, 13 Jan 2010 21:23:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E8658FC22; Wed, 13 Jan 2010 21:23:27 +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 o0DLNRWs028959; Wed, 13 Jan 2010 21:23:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLNRd4028957; Wed, 13 Jan 2010 21:23:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132123.o0DLNRd4028957@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:23:27 +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: r202265 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:23:27 -0000 Author: marius Date: Wed Jan 13 21:23:27 2010 New Revision: 202265 URL: http://svn.freebsd.org/changeset/base/202265 Log: MFC: r200938 - Don't check for a valid interrupt controller on every interrupt in intr_execute_handlers(). If we managed to get here without an associated interrupt controller we have way bigger problems. While at it predict stray vector interrupts as false as they are rather unlikely. - Don't blindly call the clear function of an interrupt controller when adding a handler in inthand_add() as interrupt controllers like the one driven by upa(4) are auto-clearing and thus provide NULL instead. Modified: stable/8/sys/sparc64/sparc64/intr_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) Modified: stable/8/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:22:23 2010 (r202264) +++ stable/8/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:23:27 2010 (r202265) @@ -276,7 +276,7 @@ intr_execute_handlers(void *cookie) struct intr_vector *iv; iv = cookie; - if (iv->iv_ic == NULL || intr_event_handle(iv->iv_event, NULL) != 0) + if (__predict_false(intr_event_handle(iv->iv_event, NULL) != 0)) intr_stray_vector(iv); } @@ -377,7 +377,8 @@ inthand_add(const char *name, int vec, d #endif ic->ic_enable(iv); /* Ensure the interrupt is cleared, it might have triggered before. */ - ic->ic_clear(iv); + if (ic->ic_clear != NULL) + ic->ic_clear(iv); sx_xunlock(&intr_table_lock); return (0); } From owner-svn-src-stable@FreeBSD.ORG Wed Jan 13 21:23:29 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88BDE1065696; Wed, 13 Jan 2010 21:23:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 774588FC0A; Wed, 13 Jan 2010 21:23: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 o0DLNTdj028995; Wed, 13 Jan 2010 21:23:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLNTab028993; Wed, 13 Jan 2010 21:23:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132123.o0DLNTab028993@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 21:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202266 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:23:29 -0000 Author: marius Date: Wed Jan 13 21:23:29 2010 New Revision: 202266 URL: http://svn.freebsd.org/changeset/base/202266 Log: MFC: r200938 - Don't check for a valid interrupt controller on every interrupt in intr_execute_handlers(). If we managed to get here without an associated interrupt controller we have way bigger problems. While at it predict stray vector interrupts as false as they are rather unlikely. - Don't blindly call the clear function of an interrupt controller when adding a handler in inthand_add() as interrupt controllers like the one driven by upa(4) are auto-clearing and thus provide NULL instead. Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:23:27 2010 (r202265) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Wed Jan 13 21:23:29 2010 (r202266) @@ -277,7 +277,7 @@ intr_execute_handlers(void *cookie) struct intr_vector *iv; iv = cookie; - if (iv->iv_ic == NULL || intr_event_handle(iv->iv_event, NULL) != 0) + if (__predict_false(intr_event_handle(iv->iv_event, NULL) != 0)) intr_stray_vector(iv); } @@ -378,7 +378,8 @@ inthand_add(const char *name, int vec, d #endif ic->ic_enable(iv); /* Ensure the interrupt is cleared, it might have triggered before. */ - ic->ic_clear(iv); + if (ic->ic_clear != NULL) + ic->ic_clear(iv); sx_xunlock(&intr_table_lock); return (0); } From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 17:35:07 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6DED106566B; Thu, 14 Jan 2010 17:35:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4F688FC16; Thu, 14 Jan 2010 17:35: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 o0EHZ7JI098763; Thu, 14 Jan 2010 17:35:07 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EHZ7mT098761; Thu, 14 Jan 2010 17:35:07 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201001141735.o0EHZ7mT098761@svn.freebsd.org> From: Rick Macklem Date: Thu, 14 Jan 2010 17:35: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: r202292 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 17:35:07 -0000 Author: rmacklem Date: Thu Jan 14 17:35:07 2010 New Revision: 202292 URL: http://svn.freebsd.org/changeset/base/202292 Log: MFC: r201345 Fix the experimental NFS client so that it can create Unix domain sockets on an NFSv4 mount point. It was generating incorrect XDR in the request for this case. Tested by: infofarmer Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.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) Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Thu Jan 14 17:30:13 2010 (r202291) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Thu Jan 14 17:35:07 2010 (r202292) @@ -1633,10 +1633,15 @@ nfsrpc_mknod(vnode_t dvp, char *name, in return (ENAMETOOLONG); NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp); if (nd->nd_flag & ND_NFSV4) { - NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); - *tl++ = vtonfsv34_type(vtyp); - *tl++ = txdr_unsigned(NFSMAJOR(rdev)); - *tl = txdr_unsigned(NFSMINOR(rdev)); + if (vtyp == VBLK || vtyp == VCHR) { + NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); + *tl++ = vtonfsv34_type(vtyp); + *tl++ = txdr_unsigned(NFSMAJOR(rdev)); + *tl = txdr_unsigned(NFSMINOR(rdev)); + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = vtonfsv34_type(vtyp); + } } (void) nfsm_strtom(nd, name, namelen); if (nd->nd_flag & ND_NFSV3) { From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 20:20:26 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBDE0106566B; Thu, 14 Jan 2010 20:20:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9EF28FC1B; Thu, 14 Jan 2010 20:20: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 o0EKKQSC035270; Thu, 14 Jan 2010 20:20:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKKQGp035267; Thu, 14 Jan 2010 20:20:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142020.o0EKKQGp035267@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 20:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202296 - in stable/7/sys: conf dev/ste modules/ste pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:20:27 -0000 Author: yongari Date: Thu Jan 14 20:20:26 2010 New Revision: 202296 URL: http://svn.freebsd.org/changeset/base/202296 Log: MFC r181739: Move the ste driver from sys/pci to sys/dev/ste. Added: stable/7/sys/dev/ste/ - copied from r181739, head/sys/dev/ste/ Deleted: stable/7/sys/pci/if_ste.c stable/7/sys/pci/if_stereg.h Modified: stable/7/sys/conf/files stable/7/sys/modules/ste/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Thu Jan 14 19:23:41 2010 (r202295) +++ stable/7/sys/conf/files Thu Jan 14 20:20:26 2010 (r202296) @@ -1207,6 +1207,7 @@ dev/spibus/spibus.c optional spibus dev/spibus/spibus_if.m optional spibus dev/sr/if_sr.c optional sr dev/sr/if_sr_pci.c optional sr pci +dev/ste/if_ste.c optional ste pci dev/stg/tmc18c30.c optional stg dev/stg/tmc18c30_isa.c optional stg isa dev/stg/tmc18c30_pccard.c optional stg pccard @@ -2124,7 +2125,6 @@ pci/amdpm.c optional amdpm pci | nfpm pci/amdsmb.c optional amdsmb pci pci/if_mn.c optional mn pci pci/if_rl.c optional rl pci -pci/if_ste.c optional ste pci pci/if_tl.c optional tl pci pci/if_wb.c optional wb pci pci/if_xl.c optional xl pci Modified: stable/7/sys/modules/ste/Makefile ============================================================================== --- stable/7/sys/modules/ste/Makefile Thu Jan 14 19:23:41 2010 (r202295) +++ stable/7/sys/modules/ste/Makefile Thu Jan 14 20:20:26 2010 (r202296) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../pci +.PATH: ${.CURDIR}/../../dev/ste KMOD= if_ste SRCS= if_ste.c device_if.h bus_if.h pci_if.h From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 20:38:41 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC7FD106566C; Thu, 14 Jan 2010 20:38:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9D208FC1D; Thu, 14 Jan 2010 20:38:40 +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 o0EKceh5039474; Thu, 14 Jan 2010 20:38:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKceC4039471; Thu, 14 Jan 2010 20:38:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142038.o0EKceC4039471@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 20:38:40 +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: r202297 - stable/8/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:38:41 -0000 Author: yongari Date: Thu Jan 14 20:38:40 2010 New Revision: 202297 URL: http://svn.freebsd.org/changeset/base/202297 Log: Partial merge r199559: - Add a private timer to drive the transmit watchdog instead of using if_watchdog and if_timer. - Fix some issues in detach for sn(4), ste(4), and ti(4). Primarily this means calling ether_ifdetach() before anything else. Modified: stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/ste/if_stereg.h Modified: stable/8/sys/dev/ste/if_ste.c ============================================================================== --- stable/8/sys/dev/ste/if_ste.c Thu Jan 14 20:20:26 2010 (r202296) +++ stable/8/sys/dev/ste/if_ste.c Thu Jan 14 20:38:40 2010 (r202297) @@ -108,7 +108,7 @@ static int ste_ioctl(struct ifnet *, u_l static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); -static void ste_watchdog(struct ifnet *); +static void ste_watchdog(struct ste_softc *); static int ste_shutdown(device_t); static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, struct mbuf *); @@ -924,7 +924,7 @@ ste_txeof(sc) sc->ste_cdata.ste_tx_cons = idx; if (idx == sc->ste_cdata.ste_tx_prod) - ifp->if_timer = 0; + sc->ste_timer = 0; } static void @@ -960,6 +960,8 @@ ste_stats_update(xsc) } } + if (sc->ste_timer > 0 && --sc->ste_timer == 0) + ste_watchdog(sc); callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); return; @@ -1094,7 +1096,6 @@ ste_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ste_ioctl; ifp->if_start = ste_start; - ifp->if_watchdog = ste_watchdog; ifp->if_init = ste_init; IFQ_SET_MAXLEN(&ifp->if_snd, STE_TX_LIST_CNT - 1); ifp->if_snd.ifq_drv_maxlen = STE_TX_LIST_CNT - 1; @@ -1159,11 +1160,11 @@ ste_detach(dev) /* These should only be active if attach succeeded */ if (device_is_attached(dev)) { + ether_ifdetach(ifp); STE_LOCK(sc); ste_stop(sc); STE_UNLOCK(sc); callout_drain(&sc->ste_stat_callout); - ether_ifdetach(ifp); } if (sc->ste_miibus) device_delete_child(dev, sc->ste_miibus); @@ -1708,7 +1709,7 @@ ste_start_locked(ifp) BPF_MTAP(ifp, cur_tx->ste_mbuf); STE_INC(idx, STE_TX_LIST_CNT); - ifp->if_timer = 5; + sc->ste_timer = 5; } sc->ste_cdata.ste_tx_prod = idx; @@ -1716,13 +1717,12 @@ ste_start_locked(ifp) } static void -ste_watchdog(ifp) - struct ifnet *ifp; +ste_watchdog(struct ste_softc *sc) { - struct ste_softc *sc; + struct ifnet *ifp; - sc = ifp->if_softc; - STE_LOCK(sc); + ifp = sc->ste_ifp; + STE_LOCK_ASSERT(sc); ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); @@ -1736,7 +1736,6 @@ ste_watchdog(ifp) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); - STE_UNLOCK(sc); return; } Modified: stable/8/sys/dev/ste/if_stereg.h ============================================================================== --- stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 20:20:26 2010 (r202296) +++ stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 20:38:40 2010 (r202297) @@ -517,6 +517,7 @@ struct ste_softc { int ste_tx_thresh; u_int8_t ste_link; int ste_if_flags; + int ste_timer; struct ste_chain *ste_tx_prev; struct ste_list_data *ste_ldata; struct ste_chain_data ste_cdata; From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 20:40:37 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2AF8106566B; Thu, 14 Jan 2010 20:40:37 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 916EF8FC0A; Thu, 14 Jan 2010 20:40:37 +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 o0EKebmZ039952; Thu, 14 Jan 2010 20:40:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKebiG039949; Thu, 14 Jan 2010 20:40:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142040.o0EKebiG039949@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 20:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202298 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:40:37 -0000 Author: yongari Date: Thu Jan 14 20:40:37 2010 New Revision: 202298 URL: http://svn.freebsd.org/changeset/base/202298 Log: Partial merge r199559: - Add a private timer to drive the transmit watchdog instead of using if_watchdog and if_timer. - Fix some issues in detach for sn(4), ste(4), and ti(4). Primarily this means calling ether_ifdetach() before anything else. Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 20:38:40 2010 (r202297) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 20:40:37 2010 (r202298) @@ -108,7 +108,7 @@ static int ste_ioctl(struct ifnet *, u_l static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); -static void ste_watchdog(struct ifnet *); +static void ste_watchdog(struct ste_softc *); static int ste_shutdown(device_t); static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, struct mbuf *); @@ -919,7 +919,7 @@ ste_txeof(sc) sc->ste_cdata.ste_tx_cons = idx; if (idx == sc->ste_cdata.ste_tx_prod) - ifp->if_timer = 0; + sc->ste_timer = 0; } static void @@ -955,6 +955,8 @@ ste_stats_update(xsc) } } + if (sc->ste_timer > 0 && --sc->ste_timer == 0) + ste_watchdog(sc); callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); return; @@ -1089,7 +1091,6 @@ ste_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ste_ioctl; ifp->if_start = ste_start; - ifp->if_watchdog = ste_watchdog; ifp->if_init = ste_init; IFQ_SET_MAXLEN(&ifp->if_snd, STE_TX_LIST_CNT - 1); ifp->if_snd.ifq_drv_maxlen = STE_TX_LIST_CNT - 1; @@ -1154,11 +1155,11 @@ ste_detach(dev) /* These should only be active if attach succeeded */ if (device_is_attached(dev)) { + ether_ifdetach(ifp); STE_LOCK(sc); ste_stop(sc); STE_UNLOCK(sc); callout_drain(&sc->ste_stat_callout); - ether_ifdetach(ifp); } if (sc->ste_miibus) device_delete_child(dev, sc->ste_miibus); @@ -1703,7 +1704,7 @@ ste_start_locked(ifp) BPF_MTAP(ifp, cur_tx->ste_mbuf); STE_INC(idx, STE_TX_LIST_CNT); - ifp->if_timer = 5; + sc->ste_timer = 5; } sc->ste_cdata.ste_tx_prod = idx; @@ -1711,13 +1712,12 @@ ste_start_locked(ifp) } static void -ste_watchdog(ifp) - struct ifnet *ifp; +ste_watchdog(struct ste_softc *sc) { - struct ste_softc *sc; + struct ifnet *ifp; - sc = ifp->if_softc; - STE_LOCK(sc); + ifp = sc->ste_ifp; + STE_LOCK_ASSERT(sc); ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); @@ -1731,7 +1731,6 @@ ste_watchdog(ifp) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); - STE_UNLOCK(sc); return; } Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 20:38:40 2010 (r202297) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 20:40:37 2010 (r202298) @@ -517,6 +517,7 @@ struct ste_softc { int ste_tx_thresh; u_int8_t ste_link; int ste_if_flags; + int ste_timer; struct ste_chain *ste_tx_prev; struct ste_list_data *ste_ldata; struct ste_chain_data ste_cdata; From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 20:47:49 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48980106566C; Thu, 14 Jan 2010 20:47:49 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36AD48FC13; Thu, 14 Jan 2010 20:47:49 +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 o0EKlnKu041653; Thu, 14 Jan 2010 20:47:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKlnBc041650; Thu, 14 Jan 2010 20:47:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142047.o0EKlnBc041650@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 20:47:49 +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: r202299 - stable/8/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:47:49 -0000 Author: yongari Date: Thu Jan 14 20:47:49 2010 New Revision: 202299 URL: http://svn.freebsd.org/changeset/base/202299 Log: MFC r200798,200801,200803-200804,200808,200810 r200798: Use ANSI function definations. r200801: o Remove unnecessary return statement. o Remove register keyword. r200803: s/u_intXX_t/uintXX_t/g r200804: Remove trailing white spaces. r200808: style(9) r200810: Sort function prototyes. Modified: stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/ste/if_stereg.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) Modified: stable/8/sys/dev/ste/if_ste.c ============================================================================== --- stable/8/sys/dev/ste/if_ste.c Thu Jan 14 20:40:37 2010 (r202298) +++ stable/8/sys/dev/ste/if_ste.c Thu Jan 14 20:47:49 2010 (r202299) @@ -91,45 +91,44 @@ static struct ste_type ste_devs[] = { { 0, 0, NULL } }; -static int ste_probe(device_t); -static int ste_attach(device_t); -static int ste_detach(device_t); -static void ste_init(void *); -static void ste_init_locked(struct ste_softc *); -static void ste_intr(void *); -static void ste_rxeoc(struct ste_softc *); -static int ste_rxeof(struct ste_softc *); -static void ste_txeoc(struct ste_softc *); -static void ste_txeof(struct ste_softc *); -static void ste_stats_update(void *); -static void ste_stop(struct ste_softc *); -static void ste_reset(struct ste_softc *); -static int ste_ioctl(struct ifnet *, u_long, caddr_t); -static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); -static void ste_start(struct ifnet *); -static void ste_start_locked(struct ifnet *); -static void ste_watchdog(struct ste_softc *); -static int ste_shutdown(device_t); -static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, - struct mbuf *); -static int ste_ifmedia_upd(struct ifnet *); -static void ste_ifmedia_upd_locked(struct ifnet *); -static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); - -static void ste_mii_sync(struct ste_softc *); -static void ste_mii_send(struct ste_softc *, u_int32_t, int); -static int ste_mii_readreg(struct ste_softc *, struct ste_mii_frame *); -static int ste_mii_writereg(struct ste_softc *, struct ste_mii_frame *); -static int ste_miibus_readreg(device_t, int, int); -static int ste_miibus_writereg(device_t, int, int, int); -static void ste_miibus_statchg(device_t); - -static int ste_eeprom_wait(struct ste_softc *); -static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); -static void ste_wait(struct ste_softc *); -static void ste_setmulti(struct ste_softc *); -static int ste_init_rx_list(struct ste_softc *); -static void ste_init_tx_list(struct ste_softc *); +static int ste_attach(device_t); +static int ste_detach(device_t); +static int ste_probe(device_t); +static int ste_shutdown(device_t); + +static int ste_eeprom_wait(struct ste_softc *); +static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); +static int ste_ifmedia_upd(struct ifnet *); +static void ste_ifmedia_upd_locked(struct ifnet *); +static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void ste_init(void *); +static void ste_init_locked(struct ste_softc *); +static int ste_init_rx_list(struct ste_softc *); +static void ste_init_tx_list(struct ste_softc *); +static void ste_intr(void *); +static int ste_ioctl(struct ifnet *, u_long, caddr_t); +static int ste_mii_readreg(struct ste_softc *, struct ste_mii_frame *); +static void ste_mii_send(struct ste_softc *, uint32_t, int); +static void ste_mii_sync(struct ste_softc *); +static int ste_mii_writereg(struct ste_softc *, struct ste_mii_frame *); +static int ste_miibus_readreg(device_t, int, int); +static void ste_miibus_statchg(device_t); +static int ste_miibus_writereg(device_t, int, int, int); +static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, + struct mbuf *); +static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); +static void ste_reset(struct ste_softc *); +static void ste_rxeoc(struct ste_softc *); +static int ste_rxeof(struct ste_softc *); +static void ste_setmulti(struct ste_softc *); +static void ste_start(struct ifnet *); +static void ste_start_locked(struct ifnet *); +static void ste_stats_update(void *); +static void ste_stop(struct ste_softc *); +static void ste_txeoc(struct ste_softc *); +static void ste_txeof(struct ste_softc *); +static void ste_wait(struct ste_softc *); +static void ste_watchdog(struct ste_softc *); #ifdef STE_USEIOSPACE #define STE_RES SYS_RES_IOPORT @@ -194,16 +193,15 @@ SYSCTL_INT(_hw_ste, OID_AUTO, rxsyncs, C #define MII_SET(x) STE_SETBIT1(sc, STE_PHYCTL, x) -#define MII_CLR(x) STE_CLRBIT1(sc, STE_PHYCTL, x) +#define MII_CLR(x) STE_CLRBIT1(sc, STE_PHYCTL, x) /* * Sync the PHYs by setting data bit and strobing the clock 32 times. */ static void -ste_mii_sync(sc) - struct ste_softc *sc; +ste_mii_sync(struct ste_softc *sc) { - register int i; + int i; MII_SET(STE_PHYCTL_MDIR|STE_PHYCTL_MDATA); @@ -213,20 +211,15 @@ ste_mii_sync(sc) MII_CLR(STE_PHYCTL_MCLK); DELAY(1); } - - return; } /* * Clock a series of bits through the MII. */ static void -ste_mii_send(sc, bits, cnt) - struct ste_softc *sc; - u_int32_t bits; - int cnt; +ste_mii_send(struct ste_softc *sc, uint32_t bits, int cnt) { - int i; + int i; MII_CLR(STE_PHYCTL_MCLK); @@ -247,12 +240,9 @@ ste_mii_send(sc, bits, cnt) * Read an PHY register through the MII. */ static int -ste_mii_readreg(sc, frame) - struct ste_softc *sc; - struct ste_mii_frame *frame; - +ste_mii_readreg(struct ste_softc *sc, struct ste_mii_frame *frame) { - int i, ack; + int i, ack; /* * Set up frame for RX. @@ -261,7 +251,7 @@ ste_mii_readreg(sc, frame) frame->mii_opcode = STE_MII_READOP; frame->mii_turnaround = 0; frame->mii_data = 0; - + CSR_WRITE_2(sc, STE_PHYCTL, 0); /* * Turn on data xmit. @@ -299,7 +289,7 @@ ste_mii_readreg(sc, frame) * need to clock through 16 cycles to keep the PHY(s) in sync. */ if (ack) { - for(i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { MII_CLR(STE_PHYCTL_MCLK); DELAY(1); MII_SET(STE_PHYCTL_MCLK); @@ -328,18 +318,15 @@ fail: DELAY(1); if (ack) - return(1); - return(0); + return (1); + return (0); } /* * Write to a PHY register through the MII. */ static int -ste_mii_writereg(sc, frame) - struct ste_softc *sc; - struct ste_mii_frame *frame; - +ste_mii_writereg(struct ste_softc *sc, struct ste_mii_frame *frame) { /* @@ -349,7 +336,7 @@ ste_mii_writereg(sc, frame) frame->mii_stdelim = STE_MII_STARTDELIM; frame->mii_opcode = STE_MII_WRITEOP; frame->mii_turnaround = STE_MII_TURNAROUND; - + /* * Turn on data output. */ @@ -375,16 +362,14 @@ ste_mii_writereg(sc, frame) */ MII_CLR(STE_PHYCTL_MDIR); - return(0); + return (0); } static int -ste_miibus_readreg(dev, phy, reg) - device_t dev; - int phy, reg; +ste_miibus_readreg(device_t dev, int phy, int reg) { - struct ste_softc *sc; - struct ste_mii_frame frame; + struct ste_softc *sc; + struct ste_mii_frame frame; sc = device_get_softc(dev); @@ -397,16 +382,14 @@ ste_miibus_readreg(dev, phy, reg) frame.mii_regaddr = reg; ste_mii_readreg(sc, &frame); - return(frame.mii_data); + return (frame.mii_data); } static int -ste_miibus_writereg(dev, phy, reg, data) - device_t dev; - int phy, reg, data; +ste_miibus_writereg(device_t dev, int phy, int reg, int data) { - struct ste_softc *sc; - struct ste_mii_frame frame; + struct ste_softc *sc; + struct ste_mii_frame frame; sc = device_get_softc(dev); bzero((char *)&frame, sizeof(frame)); @@ -417,15 +400,14 @@ ste_miibus_writereg(dev, phy, reg, data) ste_mii_writereg(sc, &frame); - return(0); + return (0); } static void -ste_miibus_statchg(dev) - device_t dev; +ste_miibus_statchg(device_t dev) { - struct ste_softc *sc; - struct mii_data *mii; + struct ste_softc *sc; + struct mii_data *mii; sc = device_get_softc(dev); @@ -436,30 +418,26 @@ ste_miibus_statchg(dev) } else { STE_CLRBIT2(sc, STE_MACCTL0, STE_MACCTL0_FULLDUPLEX); } - - return; } - + static int -ste_ifmedia_upd(ifp) - struct ifnet *ifp; +ste_ifmedia_upd(struct ifnet *ifp) { - struct ste_softc *sc; + struct ste_softc *sc; sc = ifp->if_softc; STE_LOCK(sc); ste_ifmedia_upd_locked(ifp); STE_UNLOCK(sc); - return(0); + return (0); } static void -ste_ifmedia_upd_locked(ifp) - struct ifnet *ifp; +ste_ifmedia_upd_locked(struct ifnet *ifp) { - struct ste_softc *sc; - struct mii_data *mii; + struct ste_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; STE_LOCK_ASSERT(sc); @@ -474,12 +452,10 @@ ste_ifmedia_upd_locked(ifp) } static void -ste_ifmedia_sts(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +ste_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct ste_softc *sc; - struct mii_data *mii; + struct ste_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; mii = device_get_softc(sc->ste_miibus); @@ -489,15 +465,12 @@ ste_ifmedia_sts(ifp, ifmr) ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; STE_UNLOCK(sc); - - return; } static void -ste_wait(sc) - struct ste_softc *sc; +ste_wait(struct ste_softc *sc) { - register int i; + int i; for (i = 0; i < STE_TIMEOUT; i++) { if (!(CSR_READ_4(sc, STE_DMACTL) & STE_DMACTL_DMA_HALTINPROG)) @@ -506,8 +479,6 @@ ste_wait(sc) if (i == STE_TIMEOUT) device_printf(sc->ste_dev, "command never completed!\n"); - - return; } /* @@ -515,10 +486,9 @@ ste_wait(sc) * it a command. */ static int -ste_eeprom_wait(sc) - struct ste_softc *sc; +ste_eeprom_wait(struct ste_softc *sc) { - int i; + int i; DELAY(1000); @@ -531,10 +501,10 @@ ste_eeprom_wait(sc) if (i == 100) { device_printf(sc->ste_dev, "eeprom failed to come ready\n"); - return(1); + return (1); } - return(0); + return (0); } /* @@ -542,18 +512,13 @@ ste_eeprom_wait(sc) * data is stored in the EEPROM in network byte order. */ static int -ste_read_eeprom(sc, dest, off, cnt, swap) - struct ste_softc *sc; - caddr_t dest; - int off; - int cnt; - int swap; +ste_read_eeprom(struct ste_softc *sc, caddr_t dest, int off, int cnt, int swap) { - int err = 0, i; - u_int16_t word = 0, *ptr; + uint16_t word, *ptr; + int err = 0, i; if (ste_eeprom_wait(sc)) - return(1); + return (1); for (i = 0; i < cnt; i++) { CSR_WRITE_2(sc, STE_EEPROM_CTL, STE_EEOPCODE_READ | (off + i)); @@ -561,24 +526,23 @@ ste_read_eeprom(sc, dest, off, cnt, swap if (err) break; word = CSR_READ_2(sc, STE_EEPROM_DATA); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (swap) *ptr = ntohs(word); else - *ptr = word; + *ptr = word; } - return(err ? 1 : 0); + return (err ? 1 : 0); } static void -ste_setmulti(sc) - struct ste_softc *sc; +ste_setmulti(struct ste_softc *sc) { - struct ifnet *ifp; - int h = 0; - u_int32_t hashes[2] = { 0, 0 }; - struct ifmultiaddr *ifma; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t hashes[2] = { 0, 0 }; + int h; ifp = sc->ste_ifp; if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { @@ -613,8 +577,6 @@ ste_setmulti(sc) CSR_WRITE_2(sc, STE_MAR3, (hashes[1] >> 16) & 0xFFFF); STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_ALLMULTI); STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_MULTIHASH); - - return; } #ifdef DEVICE_POLLING @@ -650,7 +612,7 @@ ste_poll_locked(struct ifnet *ifp, enum ste_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { - u_int16_t status; + uint16_t status; status = CSR_READ_2(sc, STE_ISR_ACK); @@ -675,12 +637,11 @@ ste_poll_locked(struct ifnet *ifp, enum #endif /* DEVICE_POLLING */ static void -ste_intr(xsc) - void *xsc; +ste_intr(void *xsc) { - struct ste_softc *sc; - struct ifnet *ifp; - u_int16_t status; + struct ste_softc *sc; + struct ifnet *ifp; + uint16_t status; sc = xsc; STE_LOCK(sc); @@ -738,8 +699,6 @@ ste_intr(xsc) ste_start_locked(ifp); STE_UNLOCK(sc); - - return; } static void @@ -770,20 +729,19 @@ ste_rxeoc(struct ste_softc *sc) * the higher level protocols. */ static int -ste_rxeof(sc) - struct ste_softc *sc; +ste_rxeof(struct ste_softc *sc) { - struct mbuf *m; - struct ifnet *ifp; - struct ste_chain_onefrag *cur_rx; - int total_len = 0, count=0, rx_npkts = 0; - u_int32_t rxstat; + struct mbuf *m; + struct ifnet *ifp; + struct ste_chain_onefrag *cur_rx; + uint32_t rxstat; + int total_len = 0, count = 0, rx_npkts = 0; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - while((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status) + while ((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status) & STE_RXSTAT_DMADONE) { #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { @@ -824,7 +782,7 @@ ste_rxeof(sc) continue; } - /* No errors; receive the packet. */ + /* No errors; receive the packet. */ m = cur_rx->ste_mbuf; total_len = cur_rx->ste_ptr->ste_status & STE_RXSTAT_FRAMELEN; @@ -858,11 +816,10 @@ ste_rxeof(sc) } static void -ste_txeoc(sc) - struct ste_softc *sc; +ste_txeoc(struct ste_softc *sc) { - u_int8_t txstat; - struct ifnet *ifp; + struct ifnet *ifp; + uint8_t txstat; ifp = sc->ste_ifp; @@ -893,22 +850,19 @@ ste_txeoc(sc) ste_init_locked(sc); CSR_WRITE_2(sc, STE_TX_STATUS, txstat); } - - return; } static void -ste_txeof(sc) - struct ste_softc *sc; +ste_txeof(struct ste_softc *sc) { - struct ste_chain *cur_tx; - struct ifnet *ifp; - int idx; + struct ifnet *ifp; + struct ste_chain *cur_tx; + int idx; ifp = sc->ste_ifp; idx = sc->ste_cdata.ste_tx_cons; - while(idx != sc->ste_cdata.ste_tx_prod) { + while (idx != sc->ste_cdata.ste_tx_prod) { cur_tx = &sc->ste_cdata.ste_tx_chain[idx]; if (!(cur_tx->ste_ptr->ste_ctl & STE_TXCTL_DMADONE)) @@ -928,12 +882,11 @@ ste_txeof(sc) } static void -ste_stats_update(xsc) - void *xsc; +ste_stats_update(void *xsc) { - struct ste_softc *sc; - struct ifnet *ifp; - struct mii_data *mii; + struct ste_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; sc = xsc; STE_LOCK_ASSERT(sc); @@ -963,8 +916,6 @@ ste_stats_update(xsc) if (sc->ste_timer > 0 && --sc->ste_timer == 0) ste_watchdog(sc); callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); - - return; } @@ -973,14 +924,13 @@ ste_stats_update(xsc) * IDs against our list and return a device name if we find a match. */ static int -ste_probe(dev) - device_t dev; +ste_probe(device_t dev) { - struct ste_type *t; + struct ste_type *t; t = ste_devs; - while(t->ste_name != NULL) { + while (t->ste_name != NULL) { if ((pci_get_vendor(dev) == t->ste_vid) && (pci_get_device(dev) == t->ste_did)) { device_set_desc(dev, t->ste_name); @@ -989,7 +939,7 @@ ste_probe(dev) t++; } - return(ENXIO); + return (ENXIO); } /* @@ -997,13 +947,12 @@ ste_probe(dev) * setup and ethernet/BPF attach. */ static int -ste_attach(dev) - device_t dev; +ste_attach(device_t dev) { - struct ste_softc *sc; - struct ifnet *ifp; - int error = 0, rid; - u_char eaddr[6]; + struct ste_softc *sc; + struct ifnet *ifp; + u_char eaddr[6]; + int error = 0, rid; sc = device_get_softc(dev); sc->ste_dev = dev; @@ -1132,7 +1081,7 @@ fail: if (error) ste_detach(dev); - return(error); + return (error); } /* @@ -1143,11 +1092,10 @@ fail: * allocated. */ static int -ste_detach(dev) - device_t dev; +ste_detach(device_t dev) { - struct ste_softc *sc; - struct ifnet *ifp; + struct ste_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->ste_mtx), ("ste mutex not initialized")); @@ -1187,25 +1135,22 @@ ste_detach(dev) mtx_destroy(&sc->ste_mtx); - return(0); + return (0); } static int -ste_newbuf(sc, c, m) - struct ste_softc *sc; - struct ste_chain_onefrag *c; - struct mbuf *m; +ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *c, struct mbuf *m) { - struct mbuf *m_new = NULL; + struct mbuf *m_new = NULL; if (m == NULL) { MGETHDR(m_new, M_DONTWAIT, MT_DATA); if (m_new == NULL) - return(ENOBUFS); + return (ENOBUFS); MCLGET(m_new, M_DONTWAIT); if (!(m_new->m_flags & M_EXT)) { m_freem(m_new); - return(ENOBUFS); + return (ENOBUFS); } m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; } else { @@ -1221,16 +1166,15 @@ ste_newbuf(sc, c, m) c->ste_ptr->ste_frag.ste_addr = vtophys(mtod(m_new, caddr_t)); c->ste_ptr->ste_frag.ste_len = (1536 + ETHER_VLAN_ENCAP_LEN) | STE_FRAG_LAST; - return(0); + return (0); } static int -ste_init_rx_list(sc) - struct ste_softc *sc; +ste_init_rx_list(struct ste_softc *sc) { - struct ste_chain_data *cd; - struct ste_list_data *ld; - int i; + struct ste_chain_data *cd; + struct ste_list_data *ld; + int i; cd = &sc->ste_cdata; ld = sc->ste_ldata; @@ -1238,7 +1182,7 @@ ste_init_rx_list(sc) for (i = 0; i < STE_RX_LIST_CNT; i++) { cd->ste_rx_chain[i].ste_ptr = &ld->ste_rx_list[i]; if (ste_newbuf(sc, &cd->ste_rx_chain[i], NULL) == ENOBUFS) - return(ENOBUFS); + return (ENOBUFS); if (i == (STE_RX_LIST_CNT - 1)) { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; @@ -1255,16 +1199,15 @@ ste_init_rx_list(sc) cd->ste_rx_head = &cd->ste_rx_chain[0]; - return(0); + return (0); } static void -ste_init_tx_list(sc) - struct ste_softc *sc; +ste_init_tx_list(struct ste_softc *sc) { - struct ste_chain_data *cd; - struct ste_list_data *ld; - int i; + struct ste_chain_data *cd; + struct ste_list_data *ld; + int i; cd = &sc->ste_cdata; ld = sc->ste_ldata; @@ -1283,15 +1226,12 @@ ste_init_tx_list(sc) cd->ste_tx_prod = 0; cd->ste_tx_cons = 0; - - return; } static void -ste_init(xsc) - void *xsc; +ste_init(void *xsc) { - struct ste_softc *sc; + struct ste_softc *sc; sc = xsc; STE_LOCK(sc); @@ -1300,11 +1240,10 @@ ste_init(xsc) } static void -ste_init_locked(sc) - struct ste_softc *sc; +ste_init_locked(struct ste_softc *sc) { - int i; - struct ifnet *ifp; + struct ifnet *ifp; + int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; @@ -1394,7 +1333,7 @@ ste_init_locked(sc) /* Disable interrupts if we are polling. */ if (ifp->if_capenable & IFCAP_POLLING) CSR_WRITE_2(sc, STE_IMR, 0); - else + else #endif /* Enable interrupts. */ CSR_WRITE_2(sc, STE_IMR, STE_INTRS); @@ -1408,16 +1347,13 @@ ste_init_locked(sc) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); - - return; } static void -ste_stop(sc) - struct ste_softc *sc; +ste_stop(struct ste_softc *sc) { - int i; - struct ifnet *ifp; + struct ifnet *ifp; + int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; @@ -1432,8 +1368,8 @@ ste_stop(sc) STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); ste_wait(sc); - /* - * Try really hard to stop the RX engine or under heavy RX + /* + * Try really hard to stop the RX engine or under heavy RX * data chip will write into de-allocated memory. */ ste_reset(sc); @@ -1455,15 +1391,12 @@ ste_stop(sc) } bzero(sc->ste_ldata, sizeof(struct ste_list_data)); - - return; } static void -ste_reset(sc) - struct ste_softc *sc; +ste_reset(struct ste_softc *sc) { - int i; + int i; STE_SETBIT4(sc, STE_ASICCTL, STE_ASICCTL_GLOBAL_RESET|STE_ASICCTL_RX_RESET| @@ -1481,25 +1414,20 @@ ste_reset(sc) if (i == STE_TIMEOUT) device_printf(sc->ste_dev, "global reset never completed\n"); - - return; } static int -ste_ioctl(ifp, command, data) - struct ifnet *ifp; - u_long command; - caddr_t data; -{ - struct ste_softc *sc; - struct ifreq *ifr; - struct mii_data *mii; - int error = 0; +ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +{ + struct ste_softc *sc; + struct ifreq *ifr; + struct mii_data *mii; + int error = 0; sc = ifp->if_softc; ifr = (struct ifreq *)data; - switch(command) { + switch (command) { case SIOCSIFFLAGS: STE_LOCK(sc); if (ifp->if_flags & IFF_UP) { @@ -1513,7 +1441,7 @@ ste_ioctl(ifp, command, data) sc->ste_if_flags & IFF_PROMISC) { STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } + } if (ifp->if_drv_flags & IFF_DRV_RUNNING && (ifp->if_flags ^ sc->ste_if_flags) & IFF_ALLMULTI) ste_setmulti(sc); @@ -1547,14 +1475,14 @@ ste_ioctl(ifp, command, data) !(ifp->if_capenable & IFCAP_POLLING)) { error = ether_poll_register(ste_poll, ifp); if (error) - return(error); + return (error); STE_LOCK(sc); /* Disable interrupts */ CSR_WRITE_2(sc, STE_IMR, 0); ifp->if_capenable |= IFCAP_POLLING; STE_UNLOCK(sc); return (error); - + } if (!(ifr->ifr_reqcap & IFCAP_POLLING) && ifp->if_capenable & IFCAP_POLLING) { @@ -1573,19 +1501,16 @@ ste_ioctl(ifp, command, data) break; } - return(error); + return (error); } static int -ste_encap(sc, c, m_head) - struct ste_softc *sc; - struct ste_chain *c; - struct mbuf *m_head; -{ - int frag = 0; - struct ste_frag *f = NULL; - struct mbuf *m; - struct ste_desc *d; +ste_encap(struct ste_softc *sc, struct ste_chain *c, struct mbuf *m_head) +{ + struct mbuf *m; + struct ste_desc *d; + struct ste_frag *f = NULL; + int frag = 0; d = c->ste_ptr; d->ste_ctl = 0; @@ -1623,14 +1548,13 @@ encap_retry: d->ste_frags[frag - 1].ste_len |= STE_FRAG_LAST; d->ste_ctl = 1; - return(0); + return (0); } static void -ste_start(ifp) - struct ifnet *ifp; +ste_start(struct ifnet *ifp) { - struct ste_softc *sc; + struct ste_softc *sc; sc = ifp->if_softc; STE_LOCK(sc); @@ -1639,13 +1563,12 @@ ste_start(ifp) } static void -ste_start_locked(ifp) - struct ifnet *ifp; +ste_start_locked(struct ifnet *ifp) { - struct ste_softc *sc; - struct mbuf *m_head = NULL; - struct ste_chain *cur_tx; - int idx; + struct ste_softc *sc; + struct ste_chain *cur_tx; + struct mbuf *m_head = NULL; + int idx; sc = ifp->if_softc; STE_LOCK_ASSERT(sc); @@ -1658,7 +1581,7 @@ ste_start_locked(ifp) idx = sc->ste_cdata.ste_tx_prod; - while(sc->ste_cdata.ste_tx_chain[idx].ste_mbuf == NULL) { + while (sc->ste_cdata.ste_tx_chain[idx].ste_mbuf == NULL) { /* * We cannot re-use the last (free) descriptor; * the chip may not have read its ste_next yet. @@ -1691,7 +1614,7 @@ ste_start_locked(ifp) /* Set TX polling interval to start TX engine */ CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 64); - + STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); }else{ @@ -1712,14 +1635,12 @@ ste_start_locked(ifp) sc->ste_timer = 5; } sc->ste_cdata.ste_tx_prod = idx; - - return; } static void ste_watchdog(struct ste_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp; ifp = sc->ste_ifp; STE_LOCK_ASSERT(sc); @@ -1736,15 +1657,12 @@ ste_watchdog(struct ste_softc *sc) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); - - return; } static int -ste_shutdown(dev) - device_t dev; +ste_shutdown(device_t dev) { - struct ste_softc *sc; + struct ste_softc *sc; sc = device_get_softc(dev); Modified: stable/8/sys/dev/ste/if_stereg.h ============================================================================== --- stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 20:40:37 2010 (r202298) +++ stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 20:47:49 2010 (r202299) @@ -96,7 +96,7 @@ #define STE_LATE_COLLS 0x75 #define STE_MULTI_COLLS 0x76 -#define STE_SINGLE_COLLS 0x77 +#define STE_SINGLE_COLLS 0x77 #define STE_DMACTL_RXDMA_STOPPED 0x00000001 #define STE_DMACTL_TXDMA_CMPREQ 0x00000002 @@ -386,27 +386,27 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 20:58:20 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22CFE1065676; Thu, 14 Jan 2010 20:58:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11D058FC13; Thu, 14 Jan 2010 20:58: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 o0EKwJBh044102; Thu, 14 Jan 2010 20:58:19 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKwJbX044100; Thu, 14 Jan 2010 20:58:19 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001142058.o0EKwJbX044100@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 14 Jan 2010 20:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202300 - stable/7/sys/dev/mxge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:58:20 -0000 Author: gallatin Date: Thu Jan 14 20:58:19 2010 New Revision: 202300 URL: http://svn.freebsd.org/changeset/base/202300 Log: MFC 202119: Fix reporting of 10G Twinax media Modified: stable/7/sys/dev/mxge/if_mxge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Thu Jan 14 20:47:49 2010 (r202299) +++ stable/7/sys/dev/mxge/if_mxge.c Thu Jan 14 20:58:19 2010 (r202300) @@ -2588,6 +2588,7 @@ static struct mxge_media_type mxge_xfp_m }; static struct mxge_media_type mxge_sfp_media_types[] = { + {IFM_10G_TWINAX, 0, "10GBASE-Twinax"}, {0, (1 << 7), "Reserved"}, {IFM_10G_LRM, (1 << 6), "10GBASE-LRM"}, {IFM_10G_LR, (1 << 5), "10GBASE-LR"}, @@ -2722,7 +2723,7 @@ mxge_media_probe(mxge_softc_t *sc) if (mxge_verbose) device_printf(sc->dev, "%s:%s\n", cage_type, mxge_media_types[0].name); - mxge_set_media(sc, IFM_10G_CX4); + mxge_set_media(sc, mxge_media_types[0].flag); return; } for (i = 1; i < mxge_media_type_entries; i++) { From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 20:59:02 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84CCE10656AA; Thu, 14 Jan 2010 20:59:02 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73E7D8FC1F; Thu, 14 Jan 2010 20:59:02 +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 o0EKx2NB044314; Thu, 14 Jan 2010 20:59:02 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKx2et044312; Thu, 14 Jan 2010 20:59:02 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001142059.o0EKx2et044312@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 14 Jan 2010 20:59:02 +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: r202302 - stable/8/sys/dev/mxge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:59:02 -0000 Author: gallatin Date: Thu Jan 14 20:59:02 2010 New Revision: 202302 URL: http://svn.freebsd.org/changeset/base/202302 Log: MFC 202119: Fix reporting of 10G Twinax media Modified: stable/8/sys/dev/mxge/if_mxge.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) Modified: stable/8/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/8/sys/dev/mxge/if_mxge.c Thu Jan 14 20:58:45 2010 (r202301) +++ stable/8/sys/dev/mxge/if_mxge.c Thu Jan 14 20:59:02 2010 (r202302) @@ -2774,6 +2774,7 @@ static struct mxge_media_type mxge_xfp_m }; static struct mxge_media_type mxge_sfp_media_types[] = { + {IFM_10G_TWINAX, 0, "10GBASE-Twinax"}, {0, (1 << 7), "Reserved"}, {IFM_10G_LRM, (1 << 6), "10GBASE-LRM"}, {IFM_10G_LR, (1 << 5), "10GBASE-LR"}, @@ -2908,7 +2909,7 @@ mxge_media_probe(mxge_softc_t *sc) if (mxge_verbose) device_printf(sc->dev, "%s:%s\n", cage_type, mxge_media_types[0].name); - mxge_set_media(sc, IFM_10G_CX4); + mxge_set_media(sc, mxge_media_types[0].flag); return; } for (i = 1; i < mxge_media_type_entries; i++) { From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 21:10:36 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1799106568B; Thu, 14 Jan 2010 21:10:36 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C08A88FC12; Thu, 14 Jan 2010 21:10:36 +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 o0ELAaCX046971; Thu, 14 Jan 2010 21:10:36 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELAaDx046969; Thu, 14 Jan 2010 21:10:36 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001142110.o0ELAaDx046969@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 14 Jan 2010 21:10:36 +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: r202303 - stable/8/sys/dev/mxge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:10:37 -0000 Author: gallatin Date: Thu Jan 14 21:10:36 2010 New Revision: 202303 URL: http://svn.freebsd.org/changeset/base/202303 Log: MFC r202121: Use better default RSS hash (src + dst, rather than just src port) Modified: stable/8/sys/dev/mxge/if_mxge.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) Modified: stable/8/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/8/sys/dev/mxge/if_mxge.c Thu Jan 14 20:59:02 2010 (r202302) +++ stable/8/sys/dev/mxge/if_mxge.c Thu Jan 14 21:10:36 2010 (r202303) @@ -104,7 +104,7 @@ static int mxge_verbose = 0; static int mxge_lro_cnt = 8; static int mxge_ticks; static int mxge_max_slices = 1; -static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; +static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; static int mxge_always_promisc = 0; static int mxge_initial_mtu = ETHERMTU_JUMBO; static int mxge_throttle = 0; @@ -4175,7 +4175,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) sc->pause = mxge_flow_control; if (mxge_rss_hash_type < MXGEFW_RSS_HASH_TYPE_IPV4 || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) { - mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; + mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; } if (mxge_initial_mtu > ETHERMTU_JUMBO || mxge_initial_mtu < ETHER_MIN_LEN) From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 21:10:41 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C484A1065693; Thu, 14 Jan 2010 21:10:41 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B377C8FC14; Thu, 14 Jan 2010 21:10: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 o0ELAfJM047039; Thu, 14 Jan 2010 21:10:41 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELAffb047037; Thu, 14 Jan 2010 21:10:41 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001142110.o0ELAffb047037@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 14 Jan 2010 21:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202304 - in stable/7/sys/dev: mxge ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:10:41 -0000 Author: gallatin Date: Thu Jan 14 21:10:41 2010 New Revision: 202304 URL: http://svn.freebsd.org/changeset/base/202304 Log: MFC r202121: Use better default RSS hash (src + dst, rather than just src port) Modified: stable/7/sys/dev/mxge/if_mxge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ste/if_ste.c (props changed) stable/7/sys/dev/ste/if_stereg.h (props changed) Modified: stable/7/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Thu Jan 14 21:10:36 2010 (r202303) +++ stable/7/sys/dev/mxge/if_mxge.c Thu Jan 14 21:10:41 2010 (r202304) @@ -97,7 +97,7 @@ static int mxge_verbose = 0; static int mxge_lro_cnt = 8; static int mxge_ticks; static int mxge_max_slices = 1; -static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; +static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; static int mxge_always_promisc = 0; static int mxge_initial_mtu = ETHERMTU_JUMBO; static int mxge_throttle = 0; @@ -3907,7 +3907,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) sc->pause = mxge_flow_control; if (mxge_rss_hash_type < MXGEFW_RSS_HASH_TYPE_IPV4 || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) { - mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; + mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; } if (mxge_initial_mtu > ETHERMTU_JUMBO || mxge_initial_mtu < ETHER_MIN_LEN) From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 21:30:06 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB945106566B; Thu, 14 Jan 2010 21:30:06 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D4878FC17; Thu, 14 Jan 2010 21:30: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 o0ELU6ja051401; Thu, 14 Jan 2010 21:30:06 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELU6YU051398; Thu, 14 Jan 2010 21:30:06 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001142130.o0ELU6YU051398@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 14 Jan 2010 21:30:06 +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: r202305 - stable/8/sys/dev/mxge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:30:07 -0000 Author: gallatin Date: Thu Jan 14 21:30:06 2010 New Revision: 202305 URL: http://svn.freebsd.org/changeset/base/202305 Log: MFC: r202120: Update mxge(4) firmware to 1.4.48b (latest available) from Myricom. Modified: stable/8/sys/dev/mxge/eth_z8e.h stable/8/sys/dev/mxge/ethp_z8e.h stable/8/sys/dev/mxge/rss_eth_z8e.h stable/8/sys/dev/mxge/rss_ethp_z8e.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) Modified: stable/8/sys/dev/mxge/eth_z8e.h ============================================================================== --- stable/8/sys/dev/mxge/eth_z8e.h Thu Jan 14 21:10:41 2010 (r202304) +++ stable/8/sys/dev/mxge/eth_z8e.h Thu Jan 14 21:30:06 2010 (r202305) @@ -28,7033 +28,7255 @@ POSSIBILITY OF SUCH DAMAGE. $FreeBSD$ ***************************************************************************/ -static unsigned int eth_z8e_uncompressed_length = 359956 ; -static unsigned int eth_z8e_length = 112403 ; -static unsigned char eth_z8e[112403 + 1] = - "\x78\x9c\xec\xbd\x7f\x7c\x54\xd5\xb5\x37\xbc\x72\x32\xc0\x24\x8d" - "\x4c\xc4\x48\x47\x44\x1d\x14\xda\xa8\x41\xa2\x62\x8b\x16\x24\x4a" - "\xb4\xd0\xcb\x8f\xa8\x60\xd3\x8a\x26\x68\x82\x41\x23\x44\x88\x10" - "\x30\x64\xc2\x80\x36\xa1\x40\x52\x49\x21\x40\x48\x62\x8b\x82\x2d" - "\x48\x04\xda\xe6\xf6\xa2\x8e\x25\xbe\x1f\x7a\x9b\x64\x62\x5f\xfa" - "\x1a\x7d\xb0\x1d\xb8\x91\xa6\x3c\x01\x46\x32\x90\x31\x99\x99\xfd" - "\x7c\xd7\xde\xe7\x24\x33\xc3\x04\xe5\xf6\x7e\xde\xe7\x9f\xe6\xf3" - "\x99\x9c\x73\xf6\xd9\x7b\xed\xb5\xd7\x5e\x7b\xed\xb5\xf6\x5e\x7b" - "\x1d\xa2\x7f\xe2\x4f\xdb\xd7\xf8\xcf\x14\xff\xd7\xdf\xbf\xfe\xfe" - "\xf5\xf7\xaf\xbf\x7f\xfd\xfd\xeb\xef\x5f\x7f\xff\x77\xfe\xce\x6b" - "\x26\xfa\x43\x25\x51\x8f\xc3\x6c\x75\xd3\xb9\xe2\xad\x9b\x85\x1f" - "\xc9\x31\x6e\x32\x5b\xf9\xaa\xff\xe8\x35\xa4\x6b\x95\x64\xbe\x39" - "\x91\x12\xa6\xed\x24\xaa\x1a\x29\xba\x36\x6f\x11\x9e\xb5\x5b\x44" - "\x57\xfa\x1b\x44\x4d\x63\x89\x36\x8f\x14\x5e\xc0\x99\xef\xa6\x1f" - "\x75\x30\x9c\xb5\x78\xe6\xf7\xeb\x46\x0a\x0f\xd2\x0b\xdd\xf4\xe3" - "\xf9\x9c\xbe\x66\x24\x60\x25\x11\x39\xb6\x08\x5f\x08\x5c\x33\x97" - "\x67\x98\xe9\x63\x24\x3e\xbb\x22\xe0\x30\x8c\x46\xc0\x38\x76\x19" - "\x18\x09\x06\x5e\x5e\x8d\x62\x18\x5e\xb7\x83\xac\x5e\x87\xf3\x5a" - "\x94\xf5\xa2\x4d\xc9\x5c\xb6\x02\x79\x84\x83\x62\x9b\x8a\xfc\x64" - "\xbb\x99\x62\x4e\x51\xdc\x3f\x70\xd5\x70\xfd\x8c\xdb\xbb\x56\x95" - "\x1b\xcb\x30\x50\x36\xa6\xc7\x11\x97\xda\x5f\x16\xb0\x6d\x25\x64" - "\x42\xde\x77\xbc\x9a\x53\x53\x79\x13\xe3\xf4\xbc\x1a\xf2\xce\x37" - "\xf2\xaa\x77\xda\x0c\xfd\xdd\x37\xf0\xae\x28\xfc\x9d\xe9\x35\xfd" - "\x5d\x02\xde\x55\x45\xe0\x67\x72\xf5\xfa\x09\xf5\x30\x2e\x36\x37" - "\xae\x47\xd0\x33\x3a\x6e\x8c\x53\x13\xf2\x97\x72\xfe\x74\x9b\xf0" - "\xcf\xb5\x91\xc4\x85\x69\x87\xbc\xd3\x8f\xd4\xab\xbc\xb8\x1f\xcd" - "\xe5\xf5\x7b\x1b\xee\x65\xba\x5e\xef\xd5\x3d\x8e\xf8\x84\x70\x9c" - "\x88\xf4\x77\x23\xf0\x2e\x39\xfc\xdd\x7b\xa9\xfa\xbb\x6f\xe2\x5d" - "\x7a\xf8\xbb\x18\xa3\x9c\x15\xef\xb2\x8d\x77\xa1\xfd\xa4\x38\xce" - "\x84\xdf\x10\x33\xd1\x50\xfc\x86\x99\x8d\xbe\x5b\x66\x15\x41\xfb" - "\x75\x64\x12\xeb\xb7\x94\x05\x1d\x82\x5c\x45\x3e\xb2\x8d\x22\xfb" - "\x49\x8a\x6f\x03\x5c\xda\xb4\x8a\xcc\xf6\x02\xe1\x73\x15\x75\x51" - "\xab\xa7\x8b\xec\x1e\xd1\xe9\xf2\x5f\xa0\x92\x0b\x64\x76\xf9\xcf" - "\x50\xc9\x8b\x64\x6d\x2a\xfe\x9c\xa2\xf1\x45\x50\x13\x64\x1f\xcd" - "\x65\x3b\xa8\xb5\xa6\x83\xec\x35\xe1\x65\xed\x37\x90\xb5\x05\xcf" - "\xa0\xb9\x85\xf1\x68\xb2\xf9\xc9\x1f\xbf\xa5\xac\x78\x1b\x99\xec" - "\x63\x48\x6b\xc9\x71\xea\xb8\x7c\xa3\x9a\x71\x59\x77\x9a\xcc\xbf" - "\x5c\x88\xbe\x3f\xcd\xf8\xd6\x96\xed\x5f\xe5\xd3\x8e\x58\x67\xd2" - "\x11\xeb\x71\x6a\xb2\x4e\xa1\xa6\xa2\x74\xda\x74\x9a\x12\x8e\xf8" - "\x26\x53\x93\xe9\x61\x8c\x8d\x74\x72\x75\xe1\xde\x16\x40\x1e\x2f" - "\xd9\x96\x13\xfa\xf5\x1b\x65\x55\xcf\x91\xd9\xad\x60\xa2\x3f\xbf" - "\x51\xf5\x41\x21\x11\xd3\x8c\x9f\xa3\xb5\x63\xd9\x75\x64\x05\x7e" - "\x9d\xc0\xe5\x5e\xe0\xd2\x32\xd6\x4a\xa9\xc0\x79\x98\xab\xda\x4f" - "\xa6\x62\x8a\x1b\x64\x4c\x24\x05\x1d\x72\x6c\x76\xd5\x6e\x11\x9d" - "\xcc\x5b\xdd\x2f\x67\x62\x7c\x25\x98\x50\xf7\x2e\xae\x6f\x13\xc6" - "\xa8\xfd\x75\x32\x75\xaf\xc8\x8c\xa9\xdb\x22\x3a\xf0\xce\x66\xbc" - "\x03\xbf\x77\xe0\x7d\xe7\x84\x24\x4a\x74\xf9\xd3\xe8\xfd\xde\x4e" - "\x13\xc3\x18\xee\xa5\x18\x86\x67\x29\xa2\x58\xb4\x67\x08\xf0\xf9" - "\xa2\x0e\xe9\xb7\x20\x1f\xca\xa3\xff\xd7\xef\xe1\xf2\xe2\x9b\x4f" - "\x78\x83\xdf\x7c\xe2\x42\x70\xeb\x13\xdd\x62\xeb\x13\xe7\x03\x5b" - "\x9f\xf8\xc2\xbe\x92\xcc\x81\x6f\x3e\xe1\x69\x2d\x90\x7d\x90\xd8" - "\x5a\x80\x3e\x08\x90\x79\xf5\x19\x4a\x7c\xea\x45\xf4\xbd\xff\x33" - "\x5a\xbd\x88\xac\xc1\xb8\x9d\x69\x2e\xff\x5f\xe8\xa9\x62\x12\xb8" - "\xcf\x88\xd6\xbe\xee\xf8\xda\xa3\x8a\x67\xcd\xdc\xa6\x76\xb7\xf6" - "\x73\x39\x26\x3c\x71\x6f\x1e\xc5\xaf\x19\xbf\x36\xfc\x8e\x89\xf8" - "\xda\x63\xa0\x95\x7d\xf8\x9a\x18\xaa\xed\x25\x9a\x10\xa4\x18\x74" - "\x91\x17\xf8\x27\x0e\x42\xb7\xd1\xc1\xf5\xef\x54\x7e\xbb\x94\x4a" - "\x7a\x7a\xf2\x88\x65\x0a\xcb\x13\x96\x2f\x3d\x8e\xab\xd2\x50\x8f" - "\x53\xf2\xfe\x16\xe1\x15\xf1\xef\x54\x22\xbd\xd3\xfb\x72\x5e\x8c" - "\xe7\xe5\x3c\xad\x3b\xfe\x9d\xcd\xc8\x93\x83\x3c\x3e\x9d\x86\x9d" - "\x0c\x0b\xe3\xc4\x73\x95\x9f\x62\x01\xb3\xe0\x77\x17\xdb\x4d\x3b" - "\xb7\x88\xe3\xc8\xb7\xa1\x1f\x16\x60\x03\x0e\xe8\x7f\x55\xbd\x91" - "\x06\x5a\x77\x6c\x44\x3e\x2e\xef\xf2\xa5\xb1\xdc\x75\xbb\xf2\x3b" - "\xc9\xe2\xa7\x78\xd1\xa7\xea\x43\x9e\x4e\x96\x8f\x57\xf9\x68\x68" - "\x8f\x83\x32\x18\x36\x97\x73\x75\x75\x12\xca\x6d\x16\xf6\x3c\xc8" - "\x25\x9a\xdd\x23\xf2\x62\x20\x8b\x3b\x8e\xa0\xbc\xaa\x7b\xb8\xd9" - "\xc0\x91\xeb\xe0\xbe\x96\x78\x82\x1f\x8e\xe4\xfb\xe8\xaa\x6a\x8a" - "\x45\xb9\xc7\x18\x1e\xc3\x02\x1f\xb8\xd1\xd6\xcd\x47\xf2\x3d\x14" - "\x14\x61\x30\xdd\x3a\xbc\xcc\x30\x78\x48\x17\x80\xc7\xfc\xd7\x84" - "\x32\x57\xd5\x4b\x78\x8f\xfe\x2e\xc8\xf0\x7c\x64\xb2\x49\x7c\x1f" - "\x67\x18\x3d\x2c\xd3\x00\xd3\xb9\xfc\x41\xea\xa2\xe1\x4e\x8f\x3d" - "\x2f\xb6\xb5\x98\x88\xcb\xef\x2f\xe9\x1c\x22\xba\x33\x63\x99\xe7" - "\xf8\xbd\xcb\x7f\x9e\xf3\xbc\x2e\xba\xf3\x62\xaf\xea\x22\x13\xe3" - "\x8c\xf2\x45\x8c\x67\x68\x5f\x3e\xfa\xd0\xe3\x53\xe8\xf1\xf4\x19" - "\xe9\x53\x68\xd6\x03\xd3\xa6\x50\xea\xbd\xe3\x53\xef\xfe\xee\xa4" - "\xbb\x29\xe3\x87\x8f\x4e\xa1\x8c\xd9\x53\xe8\x31\xfc\x32\x1f\x9e" - "\x81\x87\x69\x53\xee\x4c\xfd\xfe\xf8\x8c\x69\x33\x1e\xa2\x47\xe6" - "\xde\x95\x7a\xd7\x5d\xf4\xc0\x43\x33\xef\x4c\x4d\xd5\xaf\x77\xa6" - "\x72\x96\x1f\x4f\x7a\xe8\xb1\xf1\x19\x4b\x97\x14\x2e\x19\x3f\x7b" - "\xc6\xb4\xd0\x39\x31\x39\x70\x31\xc8\x34\xf5\x8a\x73\xd3\x29\x08" - "\x19\x51\x8b\xbe\xc6\xaf\xcb\x59\x72\x12\x63\x3d\x71\x75\x2d\xf7" - "\x91\x94\x93\xc3\x8f\x63\x7c\x9b\x7a\x1c\x96\x75\x6e\x6d\xcb\x24" - "\xa6\x15\xe6\x1e\xe4\xb9\x76\x01\xde\x9d\xd0\x65\xf3\x10\xbc\xdf" - "\x15\xfe\xfe\xea\x22\xbc\xff\x7b\xab\x8d\xc8\x85\x1f\xe8\xeb\x85" - "\xcc\x03\x1d\x3d\xd4\x6d\xcf\x1c\x02\x3e\x8e\x41\x1d\x1d\x18\x83" - "\x6d\x28\xeb\x0e\x19\xdb\x1d\xe8\x87\x36\xdb\x2a\x8a\x3d\x4b\x96" - "\x7f\x6f\x2d\x4c\x23\xee\x0f\x57\xa1\x0e\xe3\x42\x3f\x8c\x78\x09" - "\x03\x7d\x0c\x38\xc7\x14\x9c\xc4\xe4\x10\x39\xe0\x66\x38\x9b\xf0" - "\x4e\x87\x15\x68\x85\x3c\x80\xbc\x7e\x2d\x68\x4f\x26\x11\xbf\xa5" - "\x32\xd8\x97\x2c\xe7\x16\x94\xcb\x36\xf8\x17\xf9\xbd\x4d\x05\xc8" - "\xf7\xcb\xe9\x31\xe8\xef\x18\xcc\x9d\x68\x8b\x25\x1f\x7c\xec\x0d" - "\xae\x7f\xb3\x5d\xf4\x64\x92\x4a\x4b\xdc\x2b\xe2\xf1\xbc\xfe\xcd" - "\x4f\x84\x1d\x69\xab\x64\xda\x3e\x4e\x43\xdf\xc6\xf2\x18\x14\x2f" - "\xcb\xf4\x58\xd0\x62\x0c\xf0\x6b\x0f\x70\xf9\x73\xb2\xfc\x30\xa4" - "\xc5\x20\xef\x27\xc1\xf8\x37\x3f\x05\xaf\x70\x1a\xe6\xf3\x6b\x4b" - "\x01\xef\x7f\x05\x45\x26\x09\xf3\xf9\x46\xdc\x1f\x77\xae\xea\xa2" - "\x53\x05\xa4\xb9\xf1\x2e\x68\x07\xcc\xbe\xfe\xfa\xdb\xb8\x2c\xea" - "\x32\xf5\xf4\xe5\x61\x0e\x4d\x3c\xc6\xba\x40\x80\xf1\x39\xd7\x9f" - "\xc7\xc9\x75\xf2\x38\x46\x5f\x74\xa1\x9f\xe2\x7a\x1c\x57\xcf\x8c" - "\xe8\xa7\x1c\xc0\xf9\x04\x74\x6f\x07\x8c\xc3\xc1\x6e\xd4\x81\x67" - "\xc0\xd5\x74\xb8\x06\x0c\xaf\xe2\x83\xab\x37\x44\xf0\xc1\x43\x80" - "\x7d\x21\xe4\xfd\xde\x88\xf7\xb7\xe2\x7d\xaf\xfe\x1e\xe3\xe9\xea" - "\xe6\x88\xfa\x3b\xf1\x3e\x88\xfa\xbd\x18\x2f\xb1\xa8\x2f\xa3\x96" - "\xf5\xb4\x81\xfc\xfe\xf0\xfc\x23\xac\xdd\x0e\x0b\xcb\x10\x96\x85" - "\x32\x7f\x9d\xce\xab\xaa\xfe\x11\x29\x11\xf9\xc1\xc3\x96\x61\xe0" - "\x07\xbe\x5e\x83\x3c\xc3\x20\x8b\x4c\x98\x37\x8e\x1f\x29\x66\xbd" - "\x6d\xc4\xfc\x88\xfc\xc5\xc8\x37\x8a\xe9\x28\x69\x70\x4e\xd2\x20" - "\x43\xd7\xb3\x78\x2c\x98\x51\xa6\x32\xa2\x4c\x03\xca\xdc\x1c\x54" - "\x74\x8b\xed\xe9\x8e\x5a\xa6\x29\xa2\x4c\x87\xec\x7f\x55\x8f\x89" - "\xf9\xc5\x28\x23\x65\x4b\x5f\x18\x0c\x6e\x1b\xf4\xb1\x6b\xcc\xe1" - "\x30\x92\x3a\x50\xef\x6d\x1b\xd5\x38\xfe\x06\xfa\xfc\x2e\xa4\xfd" - "\x05\x70\x3f\x63\x3e\x61\x5e\x76\x79\x7c\x90\x7d\xd3\x13\xd4\x1c" - "\x7e\xcd\x22\x4b\x31\xf1\xfd\x78\xbe\x67\xd8\xa2\x6f\xa6\xce\xe3" - "\xd7\x2c\xc2\x95\xd3\x65\x9d\x3c\xb6\x44\xdf\xbf\x05\x15\xcc\x6b" - "\x36\x62\x0c\x6a\x78\x0e\xe8\x75\xb4\xe0\x39\x06\xfc\xf9\x29\xe4" - "\x2a\x78\x72\x3a\xf3\xdb\x44\xa4\x7f\xa8\xbf\x7f\x97\xf3\xe3\xfe" - "\x4e\xfd\x9e\xf9\xf2\x53\x9d\x2f\xc1\xe7\x49\xbf\x91\x75\x4b\x5e" - "\x57\xe5\x83\x8a\xaf\xa7\xe1\xdd\xeb\xb8\xce\xc0\x75\x23\xae\x8f" - "\xe0\xba\xc8\x7e\x81\xac\xf6\x00\xf4\x08\xf5\x3c\x0f\xd7\x47\x71" - "\x7d\x00\xd7\xc7\x70\x1d\xcf\xe3\xd2\xb3\x22\x8f\x22\x78\xa2\x2b" - "\xa8\xc6\xe2\x30\xd5\x1f\x49\xa3\xf5\xf1\xa1\xc6\xe7\xb9\x81\x34" - "\xa1\xd2\x34\xc8\xf3\x81\xb4\xbe\xe9\x4c\x97\x0c\xb4\xdd\xc7\xf5" - "\xeb\xe3\x7a\x88\xea\x17\x95\x27\xa8\xca\xe9\x7d\xa7\xa7\xa9\x7c" - "\x31\xa1\x75\xba\xe9\x9a\xe6\x12\xaf\x10\xb8\x36\x32\x5d\x91\x7e" - "\x18\x34\x81\x3e\x73\xcd\x06\xa6\xd3\x40\x7f\x5f\x93\x1c\xd2\xdf" - "\xd0\x67\x93\x7c\xe1\xfd\x9d\x98\xc1\x34\xe3\xfe\x36\xf0\x65\xdc" - "\x31\xa7\xf0\x3c\x35\x54\xe1\x9f\x98\x01\xb9\xde\xc5\x7d\x1f\x5b" - "\xc0\xe3\xe1\xda\xc9\x6e\xda\x25\x65\x22\xbf\xf3\xc6\x1d\x48\xe4" - "\xf2\xb1\xf9\xf2\x5d\x26\xe4\x65\xbb\xf1\x8e\xeb\xe6\x71\x18\x5b" - "\x28\xdf\x15\x1a\xe5\x20\x33\x1b\x64\x59\xcc\x71\x3c\xe7\xf3\xdc" - "\x8d\x39\xb4\x13\x79\xaa\xdd\x74\x55\xe2\x60\xf6\x8d\x28\xdb\x52" - "\x3f\xbe\x94\xb4\x5b\x4a\x69\x88\xcb\x7f\x9c\xe6\xf8\x45\x60\x3c" - "\x51\x9c\xcb\x3f\x99\x6e\x25\xba\xda\xe5\x3f\x46\x68\xf0\x18\x97" - "\xbf\x0a\x73\xe4\x3a\x7e\xff\xfe\x6d\x14\x13\x83\xab\xfd\x76\xd2" - "\x62\x5c\xfe\x5d\x48\x3f\x44\xb7\x90\x29\xe6\xfb\x43\x44\x8f\xcb" - "\x3f\x11\xcf\x85\xf4\xf0\x10\xf1\xb7\xac\x00\x25\xce\x7c\x45\xd8" - "\x5d\xfe\x1c\x7a\xf8\x95\xa0\x70\xf9\x9b\xf1\x2e\x9f\xe6\x04\xbe" - "\x14\x73\x02\x3d\x42\x98\xb7\x34\xcc\x09\x9c\xc3\xfd\xdf\x04\x68" - "\x89\xeb\xfb\xf8\xd9\x85\x0b\xba\xae\x28\xdf\x52\x9f\xb5\x52\xa3" - "\x3e\xcc\x2b\x22\x6e\x4b\x03\xda\xe7\xec\x13\x79\xb1\x98\x13\xde" - "\xef\xeb\xc3\x75\xfd\x96\xf7\xe4\x73\xd9\x96\x36\xc0\x71\xde\x01" - "\xc5\x9f\xf1\x77\xf9\x3b\x28\x0b\xb2\x63\xce\x4a\x8f\x60\xdc\x87" - "\xaf\x11\x34\x67\xe5\xfb\x02\x72\xcb\x32\x67\xa5\x5d\xe0\x9d\x19" - "\xf0\x9c\x2e\x7f\x17\xd7\xd1\x06\x78\x2d\x12\x5e\xd9\x16\x0f\xf2" - "\x7a\x38\x5f\x28\x1c\x86\xc1\x79\xe7\x04\xc8\x82\xfc\x9e\xbe\xf2" - "\x2d\xee\xbe\xf2\xad\x84\x5f\xaa\x88\xdf\xfa\x60\xd0\x91\xf4\x01" - "\xcf\x51\xa2\x6c\x6b\x06\x9e\xb3\xbf\x04\x9f\x48\x3a\x06\x68\x98" - "\x28\xdf\x9a\x81\x3e\x4f\xef\x91\xf8\x6e\x2d\x95\xf8\xae\xdf\x6a" - "\xff\x52\xb6\x63\x6b\x89\x6a\xc7\xd6\xd5\x9c\xee\x05\xdf\xe2\xbe" - "\xde\xab\xde\xd5\xa1\xdc\x5c\x59\xae\x6c\x6b\xbd\x30\x6f\x6d\x00" - "\x0f\xc6\xce\x09\x88\x52\xa6\x21\xe8\x5a\xca\x74\x64\xbb\x05\x75" - "\xd4\x8b\xb8\xad\x0d\xc0\xc7\x89\xf2\x7f\xee\x13\x3c\x6f\x6e\x75" - "\x7f\xa9\x60\xff\x0d\x70\xe6\xf7\x30\x4c\xf3\x56\x37\x60\x79\xfc" - "\x9a\x0d\xf4\x10\xbe\x39\xfe\x35\xfe\xac\x95\x14\xeb\xf2\x7f\x48" - "\xc9\xa5\xa5\x31\xae\xa2\x42\xb4\x73\x03\x60\xe6\xe0\x3d\x5d\x83" - "\xba\xde\x07\x5c\x37\xd7\x87\x3a\x3c\x80\x79\x06\xb0\x72\x18\xa7" - "\x5e\x07\x25\x8a\xf8\x6a\xea\x95\xf8\x55\xdb\x82\x65\xd5\x69\x41" - "\x73\x75\xaa\xc1\x3f\xcc\x3b\x8a\x6e\xcc\x33\xfb\x38\x2d\xd1\xe0" - "\x93\x40\x59\x75\xe2\xed\x44\x89\xb3\xbd\xc2\xcf\xbc\x32\x81\x0a" - "\x62\x5a\xbd\xc7\x40\x6b\x33\xb5\x16\x1c\xa2\xdb\x88\xed\x27\x2f" - "\xb5\x7a\xab\xf0\xbc\x93\x18\xbf\x56\xef\x3a\x6a\xe9\xda\x45\xb3" - "\x0b\xbc\x6b\x02\xe6\xea\xca\x96\xae\x59\x84\xf2\xef\x03\xc7\xe0" - "\x53\x05\xa6\xd2\xd6\x02\x2f\x3f\xdb\x5b\xba\xc0\x9f\x01\x11\xf0" - "\x97\x55\x93\xdf\x5c\x5d\x3f\xfb\x82\xf0\xcc\xea\x2a\x1d\x82\xb4" - "\x3e\x4b\x8c\xf0\x5b\x8a\xec\xa2\xa5\x6b\x03\x3d\x75\x81\x62\x5a" - "\xf2\x0e\x49\x3e\x7d\xaa\xa0\x80\x64\xf9\x0b\x7e\xcb\x93\x5d\xa5" - "\xf4\x64\x1e\x0d\x47\xfe\x73\xcc\xb3\x62\x78\x29\x35\x77\xe4\xd3" - "\xac\x33\xfe\xd8\xd9\x17\xfa\x44\x73\x76\x15\xb5\xe4\x55\x81\x1e" - "\xd5\x36\xb6\x33\x66\x9d\xe9\x16\xb3\x2f\xf4\x88\x96\xbc\x7d\xd4" - "\x9c\x7d\x88\x66\x7e\xee\xb4\x04\xca\xab\x13\x83\x71\xd5\xa9\xc1" - "\xf2\xea\xb4\x40\x5c\x75\xa5\xbf\x1c\xb8\xc4\x55\xd7\x8b\xf5\xdb" - "\x60\xc3\x60\x6e\x97\xfd\xbb\x6d\x38\xee\x6d\xb2\x7f\xcd\xdb\x6c" - "\xa2\x6c\x5b\x5a\x5f\xf9\xb6\x54\xc9\xf7\x71\xdb\x6c\x2e\x3f\xf3" - "\xff\xb6\x34\xe4\x4b\x53\x3c\xb2\x2d\x43\xf1\xfe\xb6\x39\xdc\xaf" - "\xc8\x9b\x8d\x5f\x01\x7e\xd0\x45\xb6\x41\xa7\xa2\xab\x19\x6e\xb0" - "\x6c\x9b\x3b\x68\xde\x86\xf1\xb0\xcd\x03\xbb\x44\x6b\xf5\xee\xa2" - "\x00\x64\x6b\xab\x37\x40\xb3\x5f\xf4\xa1\x6f\xd1\x07\x45\x01\xd0" - "\xf3\x38\x3d\xf5\x22\xd9\x5d\x45\xc7\x49\xbc\x57\xc9\xf4\xb0\xcc" - "\x7e\xf1\x7d\x11\x2c\xdf\xe6\xe6\xf7\xb3\x5f\xb4\xc3\x36\x02\x9c" - "\xb8\x6d\x9e\xe0\xfa\xed\x89\xba\xae\x04\x3c\xb6\x5b\x18\x8f\xbe" - "\x1e\xf0\x18\xe6\x71\x11\xb7\xdd\x86\xb4\xd7\x78\xee\x08\x32\xdf" - "\x95\x6d\xaf\x14\xe6\xed\x9e\x59\x43\x84\x27\xf0\x2a\x49\x1e\x08" - "\xde\x2f\x04\xdb\x5e\x59\x45\x54\x2f\xc7\x54\x60\x54\x29\xca\x79" - "\x44\xf9\xf6\xca\xe0\xfa\x9d\x77\x01\x4e\xac\x58\xc1\x65\x77\xa6" - "\x2a\x9e\xf9\x4c\x8e\x3d\x51\xbe\x33\xf5\xeb\xda\xf9\x3d\x8e\x51" - "\xc5\x6e\x7a\x3b\x93\x65\x1c\xee\xcb\xdc\xb4\x3f\x45\xbf\xaf\x72" - "\x53\xd5\x71\x29\x1f\x21\xe7\x0a\x4a\xe8\xda\xd3\x74\xfd\x74\xd0" - "\x84\x70\x9f\x80\xfb\x99\x73\x6e\x45\xbb\xcb\x3e\xeb\x44\x9f\xf7" - "\xb0\xcc\x11\x8e\x89\xd0\x37\x28\x0d\xed\x35\x8b\x9e\xe4\x04\x11" - "\xbf\x7b\xa1\xe8\xb3\xb2\x2d\x69\xc1\xf3\x70\xd0\x75\x2c\xae\x23" - "\x76\x5e\xa4\x24\xfc\xac\x3b\x1d\xc1\x52\x96\xc9\xb8\x4f\x15\x2b" - "\xac\xf1\x9b\x96\x53\x8a\xc5\x4b\xe6\x3a\x47\x30\xd3\xb2\x26\x91" - "\x6d\xaa\x24\xbe\x17\x8e\x6d\x54\x77\x91\x4c\x3c\xb7\x04\xe3\x50" - "\x5f\x91\x45\x88\x65\xc9\x54\xb7\x14\xf2\xc8\x41\xd6\x3a\x87\x68" - "\x08\xf4\x24\x6b\x8c\xa7\x81\x0b\xe3\x06\x3c\x6f\x00\x9e\xf3\xe7" - "\xad\x4c\xa3\x0f\x8b\x28\xea\x5a\x44\x8f\xe3\xfa\xfe\xf6\x0f\xf2" - "\xbe\xc6\xa0\xc9\x20\xef\x0f\x1b\x74\x1a\xcc\xde\xe7\x71\x1e\xb8" - "\x28\x3c\x15\x8b\x89\x69\x61\xb5\xfb\xc5\x7f\xc1\x26\x29\x2d\x09" - "\xd0\x0d\x73\x56\xde\x24\x5c\x1e\xe1\x74\x15\x9d\x91\xeb\x75\x75" - "\xc8\x53\xe2\x17\x41\xb6\x6f\xd9\xb6\xad\x62\x5b\xb5\x7c\xf7\x74" - "\x51\xbe\x3b\xbd\x7b\xb9\xf0\xd7\x4a\x7b\x74\x74\xaa\x9b\xee\x29" - "\x50\x7d\x53\x6d\xc3\x5c\xd8\xd1\x6d\xde\x9d\x0e\xd8\x57\x33\xec" - "\xd6\x02\xe1\x0c\xc6\xed\x9e\x89\x7c\x98\xff\x7e\x5f\x19\xba\x66" - "\x87\x79\xad\x6b\xdd\x16\x9e\xdb\x46\x63\xfe\xbb\x69\xee\x25\x6b" - "\x42\x72\x75\x91\xd0\x2f\xb6\x81\x45\xc9\x18\x9d\x7d\x8c\xbf\x44" - "\xfc\xd2\xa2\xbf\x1e\x98\x1b\xab\xeb\xbb\x61\x77\xd9\x57\xd3\x68" - "\xf4\xc3\xf5\xa7\x69\xf4\x3f\xec\x45\xe2\x94\x70\x8c\x2e\xfd\xe5" - "\x2a\x1f\x74\x82\xd1\x5e\x37\xad\xc9\x1b\x7c\x6e\x85\x5c\xbc\x28" - "\x3a\x2b\x96\xf7\xd3\xec\xc4\x9c\x95\x41\xc1\xf7\x3c\xce\xea\x90" - "\xce\xf4\xe8\x71\xdc\x30\xd9\xa0\xc5\x20\xf4\x37\x89\xb2\xdd\x99" - "\x4a\x07\xbc\xa1\x46\x38\x04\x39\x6f\xe4\x75\xbc\x1b\x76\x4a\x3d" - "\xa8\x6c\x5b\x6a\x37\xe4\x08\xaf\x77\x40\x67\xf6\x2e\xb3\x0a\x1f" - "\x60\x56\xba\x69\x9c\x5b\xb7\xb3\xbc\x2e\xff\x43\x2c\x53\x52\x07" - "\x5b\x27\x1d\x80\x7f\xe3\xe1\x56\x68\x44\x2c\x93\x84\xf9\xc0\xdc" - "\x12\x85\xb7\x8f\xe1\x3a\x4b\xce\x53\x07\xde\x2f\xf3\x8a\x4e\x51" - "\x76\x60\x3a\xeb\x21\xce\xe5\xbd\x9c\xf6\x2e\x78\x58\x38\x97\x32" - "\x4e\x37\xbe\xeb\xbc\xb1\x97\x4e\x41\xc7\x83\x7e\xe7\x51\x36\xd7" - "\x8d\x7b\x8e\x14\x92\x6e\xc7\xdd\x08\xfb\xef\xdb\x7b\x0c\xbc\x20" - "\x3b\x04\xe8\x8b\xfa\x59\xee\x75\x11\xaf\xa1\x2d\x2b\x16\x3e\xe0" - "\x6a\x43\xde\xb9\x46\x1b\xb8\x7d\xaa\x5d\x37\xe6\x85\xb6\x0b\x38" - "\x78\xa0\x2f\x4b\x1a\x2c\x5b\x49\x66\x9b\xa2\xb5\x99\xdb\xcb\x6d" - "\xe1\x36\xcb\xb6\x40\xbf\xe0\x79\xc5\xe5\xbf\x07\xfa\x97\x4c\x4f" - "\x03\xac\x43\x6e\xfa\x56\xba\xd2\xad\x6e\x94\x7a\x5d\xd4\x7e\x34" - "\x6f\xf5\xd8\xbf\xa4\x1b\xed\x41\x71\xf2\x14\xdd\xc4\x3a\x6d\x2c" - "\x5f\xe5\x9c\xec\x03\xff\x9a\xf7\x8d\xe5\xb9\xd8\x55\x7c\x01\xf2" - "\x5b\xe6\xbd\x06\x79\x3b\x90\xe7\x4e\x3d\xef\x9d\x6a\x7d\x57\x5e" - "\x87\xf1\x15\x73\xf3\x19\xf0\xee\x74\x5e\x93\x00\x9d\x13\x8d\x67" - "\x81\x67\x5c\xd1\x57\xfb\xc6\x46\xc7\x65\xbb\x27\xa8\xc6\x62\x17" - "\xea\xf9\x26\xf3\x94\x7d\x25\x5d\x07\xbe\x3c\x51\xb2\x9a\xae\x61" - "\x7e\x12\x71\xbb\x73\x14\xdd\x6f\xaa\x12\x8e\x52\x72\x41\x7a\x16" - "\x2c\xa7\xeb\x31\xfe\xe6\x9f\xa6\x9b\xde\xca\x2a\xb6\x01\x57\xa2" - "\x8a\xb3\x44\x52\xd6\xc4\xed\xce\x76\xf9\x3f\xa7\xba\xb3\x6c\x6b" - "\xdd\x74\xd4\xe0\x45\xdc\x1f\xbb\x9c\x5c\x00\x5d\x0b\x94\xad\x60" - "\x7b\x80\xd7\xcb\x4e\x92\x2d\x85\xdb\x8b\x5f\x0c\xd2\x6e\x10\x17" - "\xc5\x7c\xc1\xfa\x1b\xe6\x2b\x37\xd9\x32\x71\x2d\x90\x3f\x07\x19" - "\xcf\xd9\xc8\x97\x20\x2e\x06\x39\x4f\x01\xd2\xc6\x0a\x47\x0c\x8f" - "\x89\xc3\x3d\x0e\x5b\x86\x9b\x26\x95\xa9\xbe\xb1\x8d\x66\x58\x83" - "\xe0\x90\x8d\xbe\x25\xe6\x4d\xc0\xfa\x77\x5b\x49\x0c\xe3\xb1\x51" - "\x8e\x0b\xc0\xaa\xd3\x94\x7c\xc6\xdc\x58\x50\xeb\x08\xe6\x41\x16" - "\xe7\x05\xd7\xef\x2f\x95\xf7\xfa\x3b\xc6\x03\x73\x5f\x41\x74\xf8" - "\x07\xe6\x3a\x47\x31\x8f\x8f\x49\x52\x70\x0e\x4c\x77\x8e\x3a\xcd" - "\xcf\xd7\xf2\xb3\xd7\xdc\x50\xea\xaa\x4e\x43\xfd\xa7\x51\xef\x98" - "\x24\x65\x03\x8c\xb9\xb6\x1b\x75\xf4\x38\xc6\x24\xb9\x29\xf9\x90" - "\x5a\x3b\x6c\x28\x1d\x64\xec\x25\xf2\xd8\x69\xa9\x21\x7d\x4c\xdf" - "\xfc\xef\xbc\x8e\x81\x76\x65\x04\xcc\xdb\x0a\x74\xb9\xc1\x76\xd5" - "\x37\x4e\xd2\xcd\x8d\xad\x79\x92\xbf\x35\xa1\x8d\x29\x7c\x3b\xe8" - "\xd1\x78\x7d\x57\x89\xaf\x9b\x1b\x2f\xfd\x8d\xd9\x85\xdf\x21\xfc" - "\x9c\xfa\x73\x33\x7e\x6e\xdc\xa7\x4a\xba\x75\xe7\xc0\xce\xb9\xb9" - "\x11\x73\x7d\x01\x3f\xbb\x69\xcc\x5e\xd1\x3d\x56\x0b\xea\xf7\xb5" - "\x5f\xb0\x8d\x31\xa6\x1d\xf4\xcf\x51\xfd\xc0\x30\x28\x06\x63\x91" - "\x69\x2e\xec\xd5\xc2\xd7\x54\xe2\x65\x9c\xcd\x4d\xd5\x5e\xb2\x7d" - "\x8b\xdb\x7e\x73\xc2\xb2\x6a\xe1\xf1\x82\xf6\x7c\xe5\xb6\x1d\xa9" - "\xf1\x13\xaf\x31\xf7\x38\x6e\x1e\xeb\xa6\xa7\xab\xa4\xcc\x8f\x3f" - "\x50\xc0\xf0\x44\x9c\xe4\x07\x61\xb4\x5d\xc9\xb3\x86\x52\xee\x47" - "\x3c\xff\x08\xed\xb6\x9c\xa5\x9b\x65\x7f\x1e\x41\xdb\x77\x42\xa6" - "\xb0\xed\x54\x27\xe5\xff\xcd\x90\xff\xb6\x26\x63\x3d\x74\x23\xde" - "\xc1\x6e\xea\x6a\xc9\xf3\x11\xc3\x08\x00\x76\x85\x5c\x13\xda\x5f" - "\xba\xba\x4b\xf8\xde\x2f\xe9\x34\x61\x3e\x46\x7f\x37\x94\x72\x9d" - "\x76\xe8\xc1\xce\xc5\xb2\xde\x34\xc8\x2a\x6f\xd4\xfe\xef\xc7\xed" - "\x96\x77\x8f\x8c\x95\x72\x31\x03\x3a\x56\x76\x78\xbf\xdc\x72\x58" - "\xf5\xc9\x2d\xe6\xf0\x3e\xb9\xe5\x30\x7e\x33\xf1\xcb\xc1\xaf\x50" - "\x7f\x0e\xfd\x4d\x0a\xb9\x5f\xd7\xe3\xb8\x25\x1d\x63\xdf\xad\x68" - "\xcd\x69\xc0\x95\x79\xe0\x0b\x32\xb3\xed\xcd\xfb\x0a\x9c\xce\xfc" - "\xca\xe9\x41\xe8\x25\x78\xce\xc4\xfb\x44\x1e\x8b\x15\x41\x0a\x7b" - "\xef\x5a\x07\x9e\x5a\xd5\xcb\xb8\xbf\x25\xd7\x0b\xd6\x94\x95\x31" - "\x1f\x22\xcf\x7c\x8b\xbf\xac\x0c\xf5\x1d\x32\xe8\x87\xb4\x1a\x7e" - "\x1f\x5d\x3f\xb8\xe5\x78\xbf\x1e\x05\xfd\x92\x65\x4b\x17\x8d\xed" - "\x84\xfc\x41\x5f\xed\x2f\x52\xf3\xc6\xd8\x7f\xf0\x33\xe4\xde\x09" - "\xdc\x77\xb4\x40\xbe\xf4\xae\x7f\xf3\x68\x9f\x46\xc3\x7a\x35\x4a" - "\xf3\xaf\xff\x6b\x82\x3f\xbe\xf6\x98\xab\xf3\x10\xb5\xfa\x0f\x90" - "\xed\x39\x09\xe3\x33\x17\xf3\xf3\x4a\x11\xd8\xdf\xbb\x07\xb6\xd6" - "\x39\x27\xe6\xd9\x9b\x4e\xd3\x58\xd9\xf6\x9f\x9e\xc4\x0c\xfe\x94" - "\x84\xad\xd3\xe2\xb3\xce\x4d\x0b\x85\x7f\xd3\x29\x8c\x8f\x3e\x6b" - "\xfc\xc6\x5e\x4a\xd9\xbe\x8a\x52\x6b\x7a\x69\x6c\x6d\x2f\x25\x8b" - "\xbf\x27\x6b\x35\xd0\xb5\x9e\xba\x90\x48\x18\xdf\x99\xc3\x0b\xc8" - "\x5c\xbb\x8a\x64\x9f\x07\xca\xa1\x73\xf9\xa1\x73\x9d\x4b\x66\x39" - "\xd7\xaf\x73\xf5\xf5\xb1\xce\xb5\xfb\xa8\xe2\x8b\xdd\x47\xaf\xca" - "\xa3\x98\x84\x6c\x4a\x04\x7e\xf6\xb3\x34\xf6\x86\x84\x0e\xe8\x7b" - "\x68\xb3\x5b\x6f\x2f\xae\xa9\x96\x3c\x1a\x26\xdb\x0a\xd9\x2b\xca" - "\xf7\x17\x0d\x3a\xa7\x6a\xcc\x3b\x5e\xde\x03\x42\x1b\xc6\xdd\xc3" - "\xfb\x18\x87\x46\xf9\x4c\xcb\x6a\xc0\x77\x48\x2f\x1c\x23\x7c\x48" - "\x1f\xcd\x75\x37\x20\xbd\xc7\x31\x2e\xdd\xad\xbd\xb6\x6b\x30\x79" - "\x6b\x59\x63\xcc\xfb\xe3\x3e\x14\x5a\x29\xeb\xdb\x89\xab\xfd\xc2" - "\xe3\x3a\xcb\x63\x70\x5c\xd3\x9c\x7c\xe1\xb7\x2d\xe6\x3d\xa5\x71" - "\x87\x78\xbf\x8b\xd7\xb9\xdf\x86\x9e\xf2\x55\x7b\x5c\x2c\xfb\xa1" - "\x8f\xdb\x2c\xf9\x80\x09\x7d\x5f\xd8\x93\x29\x5c\xf7\x8e\xae\x77" - "\xf3\xde\xe8\x66\xb9\x0f\x3b\x0e\xfc\xf3\xb0\xd4\xc3\x58\xdf\x63" - "\x19\x08\xbd\xe9\x9a\x53\xf4\xad\x49\x6c\xd7\xf7\x38\xbe\x35\xda" - "\x4d\xd3\x8c\x7d\x3d\xb9\xbf\x8b\x34\xe8\x7f\xe9\xf9\x9c\x56\x38" - "\x86\xac\x85\x36\xd1\x39\x98\xee\x23\xf7\x5c\x35\xfa\x26\xca\xe4" - "\x18\x70\x30\xdf\xfc\xaa\x5b\x9b\x37\x0f\x69\x45\x06\x1c\xe4\xb9" - "\x16\xcf\x65\xfd\x79\x54\x99\xea\x90\x32\xf3\xba\xb5\xdb\x7e\x85" - "\xb4\xbd\x11\x65\x0e\x47\x94\x69\x0e\x29\x53\xaa\xd7\xe3\x8e\x28" - "\xe3\x09\x2f\xf3\x6d\xba\x14\xb7\x6f\x27\x85\x97\xf9\xf6\xd8\x88" - "\x32\x13\x2f\xc5\xed\xdb\xd3\x23\xca\x64\x46\x94\xc9\x0b\xa1\x25" - "\xef\xad\xa6\x22\xad\x38\xa2\xcc\x86\x88\x32\x35\xc6\xf3\x60\x7b" - "\xdc\xcb\x76\x92\x15\x7c\xd9\xc9\xfd\x09\xbd\xbd\xab\x7b\xeb\xf3" - "\x3d\x7a\xd9\xf6\x28\xed\xea\x8a\xa8\xcf\x1f\x5e\x5f\x72\xc2\xa5" - "\xed\x4a\xb6\x85\x97\x49\x4e\x8d\x28\x93\x16\x52\xa6\x5e\xd5\x93" - "\x3c\x37\xa2\x4c\x4e\x44\x99\xc2\x4b\xf9\x2a\xb9\x2c\xa2\x4c\x75" - "\x44\x99\x3d\x5f\x41\x0b\x9e\x8f\x95\x2f\xc2\x48\xd6\x79\x1f\xc4" - "\x5c\x7f\xeb\xd5\x6c\xcb\x60\x2e\xf1\xfc\xb2\xd7\x37\x84\xe7\x14" - "\x9e\x7f\x8e\x14\xf9\xa0\x2f\x25\xfb\xdc\x74\x47\x81\x31\x07\xf1" - "\x3e\x26\x8f\x67\xa5\x2b\x27\xb7\x0f\xa6\x53\x72\x3d\x86\x6f\x02" - "\xd7\x75\x64\x34\xeb\x5e\xb7\xa6\xf7\xeb\xb6\x6a\xbf\x9e\x14\x9c" - "\x5b\xb7\x31\x1c\xae\xbf\x4e\xed\x8f\xc6\xb0\x6e\x7d\xa4\x48\x96" - "\x29\x0a\xd1\x87\xb9\x7e\xef\xa1\x55\x3e\x53\x38\x1e\xb7\x66\x5e" - "\x06\x8f\x04\xe8\x38\x93\x5a\xa1\x7f\xf0\x3e\x50\x4b\x0d\x74\x19" - "\xe8\xef\x8c\xdb\x49\xba\xd5\x2d\x75\xab\xc5\xbd\xc4\xf7\xae\xe2" - "\xfb\xe4\x3e\x91\xd2\x2d\x6f\xb3\x36\xa1\x7e\xd6\xc1\x9b\x0a\xce" - "\x53\xb7\xd4\xff\x59\x07\xbb\xed\xa1\x23\xc5\x1e\xe0\x75\x5b\xa2" - "\xb1\x6f\xea\xa6\xdb\xd2\xa5\xde\x50\x76\x20\x95\xf7\xb0\x78\xdd" - "\xf7\x88\x77\x12\xe7\x01\xff\xdf\x3a\xda\x68\x2f\x6c\x40\x8c\xa9" - "\x5b\xbb\x2e\x47\x33\xd5\x87\xb7\xe5\x87\xf3\xe4\x10\xf0\xca\x6d" - "\xa5\xe1\xfd\x7e\x5b\x65\x78\xbf\xdf\x56\x1f\xce\x93\x1a\x78\xf2" - "\xb6\x43\x11\x65\x9a\x22\xca\x1c\x0b\x29\x53\xa9\xd7\xd3\x19\x51" - "\xc6\x17\x5e\xe6\x76\x73\xc8\x33\xda\x78\xbb\xb5\xdf\x86\x91\x7b" - "\xf2\xb7\x27\x87\x3c\x6b\x55\x52\x7e\xde\x3e\xd9\x48\xe3\x7d\xb4" - "\xda\x2d\x6a\x4f\x58\x87\x97\x19\x31\xde\x39\x7f\x7e\x38\x0e\xb7" - "\x17\x47\xe0\xd0\x3f\xfe\x2b\x94\x0d\xf6\x87\x53\x94\x92\x23\x79" - "\x08\x63\x04\xf3\xf5\x1c\x7e\x06\xac\x6a\xe4\x07\x1d\x6e\x3f\x1c" - "\x01\xaf\x39\x02\xde\xf1\x90\xe7\x44\x3c\x77\x85\xb4\x21\x31\xd6" - "\x2a\xfd\x62\xa0\x8f\xa5\x98\x8c\x74\xb6\x0d\x81\x6f\xa7\x5d\xce" - "\x33\x69\xec\xeb\x30\xe2\x24\xdd\xfe\x05\xdb\x91\x0a\x66\x4a\xe8" - "\xf8\x27\xd5\xae\x94\xf4\x70\x3c\x52\xe6\x86\xe3\x91\x92\x13\xd2" - "\x2e\xaf\x65\x0d\x3d\x62\xf1\x3f\xfa\x23\xd6\x71\xd8\x87\x46\xfa" - "\x1c\xac\x86\x5e\x76\x81\x12\xd9\xd7\xe3\x54\x21\xc5\xba\x8a\x3a" - "\x61\x93\xed\x6e\x1a\x94\x9f\xe2\x0f\xa4\xe9\xfe\x29\xb0\x37\x53" - "\x9a\x0c\x7e\x0c\xae\x3f\x90\x16\x2c\x7f\x3b\x1f\x69\x90\x7f\xb7" - "\x65\xa8\x35\xf6\x7d\x8d\xc2\x9e\x59\x0d\x7a\xc2\xbe\x19\xff\xa1" - "\x6e\x0f\xcc\x65\x9f\x05\xc8\x9e\x4e\xcc\xef\x09\x6a\x7f\x6b\x7c" - "\x42\x08\x5f\x7b\x6d\xab\xa6\x8a\x93\x34\xfe\x23\x9e\xff\x79\x8c" - "\xb2\xef\xc3\x11\xbf\x87\xd8\x86\x76\xf9\x4f\x4b\x1d\x0d\xef\xdb" - "\xf4\xb2\xd3\x43\xca\x7a\x74\x1b\xb7\x93\xdf\x4d\xf0\x93\xe9\x88" - "\xd7\x43\x80\x93\xa4\xf4\xba\xf1\x1f\x1d\xc1\x78\x45\x99\x62\xa3" - "\x0c\xdb\xc3\x5c\xc6\x52\x48\xa6\x3b\x8a\xc9\xe4\x5c\x75\x52\xc2" - "\xd6\xfb\xbe\x93\xf5\x63\x57\x71\x27\xb9\xbc\xed\xbc\x36\x65\x52" - "\x7b\xc9\xe3\xdb\x62\x7d\x64\xee\x2e\x3f\x80\x3e\x19\xdf\x16\x28" - "\x3f\x30\x09\xb8\xc1\xfe\x4a\x91\x72\x2e\x94\x76\x0f\x3d\x94\xf1" - "\xe8\x9c\x59\xe3\x7f\xf8\xe8\x8c\xb9\x0f\xdd\x67\x9b\xbb\xe8\x85" - "\xdc\x9c\xf1\x4b\x5e\x2a\xb4\xad\x58\xba\xa8\x70\xd1\xe2\x67\x6d" - "\xa9\x45\xe3\x8a\x6c\x0b\x0a\xd5\x35\x39\x7f\xc1\xb2\xc2\x29\x7c" - "\x9b\x62\x2b\x58\x9a\xbb\x5c\xde\xde\x1a\x4f\xe1\x40\x16\x15\xe6" - "\x2e\xb5\x8d\xcb\x49\xb1\x3d\xbc\x60\x51\xfe\x4b\x4b\x73\xa3\xc2" - "\xba\xcf\xb6\x34\x77\x69\xee\x82\x1c\xdb\x14\x5b\x2a\x43\x0e\x05" - "\x17\xd2\x9f\xa9\xc6\x3c\xc6\xf3\x57\x85\x43\xb4\xe9\xf3\x99\x5b" - "\xf1\xcf\x1d\xbb\x2e\x9d\xcb\xee\x68\x0c\xe7\xb9\x3b\x8e\x86\xf3" - "\xdc\x1d\xed\x97\xce\x65\x77\x44\xcc\x7f\x77\x44\xcc\x7f\x13\x12" - "\x2e\x9d\xcb\x26\x44\xcc\x7f\x13\x22\xe6\xbf\x09\xfd\xf3\x1f\x78" - "\xc9\xbd\x56\xca\x85\x09\x11\xf3\xdf\x84\x88\xf9\x6f\x42\x61\xc4" - "\xf3\xba\x90\xe7\x6b\xf0\x5c\x15\x3a\x3f\xe2\x79\x97\x31\x3e\x07" - "\xe4\xcb\x84\x46\x23\x0f\xcb\x7a\xc8\xe6\x0e\x3d\x6f\x5b\x48\xde" - "\x4e\x3d\x6f\x47\xff\xf8\x03\x1f\xb1\x8f\x88\xb2\xbb\x53\x67\xb0" - "\x4c\x67\xff\x10\x9e\x9b\x30\x3e\x6e\x3a\x4b\x13\x3e\x60\x58\xcc" - "\xc3\x72\xfd\x70\xeb\x13\x3d\x75\x23\xc8\xcc\x65\xea\x5e\x23\x93" - "\x70\x8c\x3f\x8e\x2b\x21\x2d\x01\x3f\xc8\x94\xd4\x34\xb7\xb6\xb9" - "\x50\xcd\x17\xa9\x95\x52\xdf\x47\x19\x1d\xfe\xcf\xf8\x19\x70\xac" - "\x28\x63\xae\x50\x73\x71\x07\xee\x13\x98\xa7\x51\xde\x24\xb4\x3b" - "\xc6\xe0\x4a\x48\x4b\xc4\x2f\x09\xf0\x2a\x0d\x78\xbc\x0f\x16\x6d" - "\xfc\x47\xae\x2f\xf7\xdb\x7c\x1a\x59\x2a\x1c\xc1\x76\x57\x90\xf5" - "\xea\xd4\x26\xb5\x46\xf0\x66\xa7\x70\xbc\x9f\x59\x87\xf4\xe8\x36" - "\xd2\x9d\xd0\xff\x52\x1b\xd5\xba\xc9\x9d\xe8\xff\x87\x3b\xd4\xda" - "\xe6\x9b\x6c\x23\xf6\x9e\xa2\x3b\xdf\xc0\xb5\x0f\xd7\x72\x03\xbe" - "\x53\xda\xce\x77\xf2\x9a\xc7\x63\x0c\x37\x22\x7d\x32\xe4\x5b\xaf" - "\xc5\x5f\x9a\x19\xe5\x5d\xa6\x70\xc4\x3e\x1a\x25\x9d\x6d\xe9\x5e" - "\x37\xdd\xb9\x8b\xf1\x0d\x49\x2f\x13\x8e\xe1\x73\x39\xbf\x9b\xeb" - "\x43\x99\xc1\x74\x6d\xc3\x1f\x4c\xf9\x5d\xde\x79\x2c\xa2\x1d\x5f" - "\x9e\xa2\xbb\x1e\x51\xed\xb8\x6b\x5f\x44\xdd\x5d\xd1\xdb\x71\x97" - "\x09\xed\xf8\x32\x7a\x3b\xee\xb2\x49\xda\x6a\x68\x8b\x76\xc9\xbb" - "\xc9\x68\xcb\x97\x92\xee\xe1\xe9\x73\x75\x5d\xc8\x0b\x1b\x2c\x11" - "\xef\x64\xd9\xc7\x8a\x07\xfa\x4d\xcf\x57\x6c\xa9\xa6\x8c\x28\x75" - "\x56\x09\xc7\xb0\xc7\xdc\x74\x57\xb3\x84\x33\x90\xbe\x57\xe1\x02" - "\x3a\x69\x92\x4e\x5d\x5c\x6e\xb0\xfe\x36\xec\x12\xb5\xae\x71\x17" - "\x78\xf6\xce\x06\x63\x4d\x72\x59\xb1\xf0\x18\x74\xec\x71\xdc\x6d" - "\x8d\x78\xe7\x0b\x79\x37\x31\xec\xdd\xea\xfe\xf4\x99\x46\xfa\xd7" - "\xeb\xa7\xbb\x8b\x23\xfa\x09\xfd\x33\xf1\xaa\xf0\x76\xdf\xbd\x41" - "\xb5\x0f\x7d\x74\x09\xad\xef\xde\x83\x3e\xea\x8b\xde\x47\x77\x37" - "\x45\xe7\xb5\xbb\x8f\x4b\x78\x23\x28\x1a\x3c\x1f\xfa\xae\x4f\xf2" - "\xa0\xde\x4f\x97\xf6\xcf\xc4\xd1\x46\xff\x7c\xbd\x36\x4e\xcc\x8e" - "\x68\x63\x00\x30\x3e\x53\x6d\xbd\x67\x7c\x04\xec\xa2\xe8\xbc\x38" - "\xb1\x12\xed\x0c\x44\x6f\xe7\xc4\xbd\x83\xf3\xe2\xc4\xa3\x68\x4f" - "\xe0\x52\x5e\x44\xf7\xc9\x32\x14\xad\x8c\x5f\x38\xa2\xd5\x73\x4f" - "\x92\xdd\xcf\x7a\xee\x3d\x33\x79\x0d\x29\x24\x3d\x25\x9c\xff\xd0" - "\x06\x2e\xc7\xf4\xf3\x2b\x39\xcb\xfd\x70\xca\x46\xda\x57\xf1\x64" - "\x8f\xe3\x9e\x0d\x11\xb4\x3a\x77\x8a\xbe\x73\x55\xb7\x16\xb3\x4b" - "\xd1\xeb\x3b\x1f\x45\xe0\xb4\x27\x3a\xbd\xee\x71\x82\x5e\xe7\xa2" - "\xd3\xeb\x9e\xe3\x83\xd3\xeb\x1e\xee\xff\x73\x97\xd2\xeb\x3b\x89" - "\xa1\xf4\x82\xae\x2b\xdb\x77\x8b\x15\xbc\xd1\x97\x25\x78\x0d\x0e" - "\x34\x49\xb4\x80\x57\x54\x99\x2e\x2e\x93\x6e\xf1\x29\x3e\x81\x0e" - "\x69\x3e\x4b\xdf\x49\x31\xc6\xff\xf0\x6a\x1a\x26\xfa\x9e\x10\x80" - "\x17\xc3\xe5\x5c\x45\xe7\x9c\x2e\x7f\x2a\xb1\xfd\x11\x51\x6f\x59" - "\x74\x59\xf0\x9d\x7a\xd0\xf4\xb5\x28\xe9\x8d\xca\x27\xe4\x3b\x9e" - "\x70\x19\xf1\x9d\xb6\xf0\x3e\x02\xdd\x50\x8e\x06\x7c\xda\x2f\xfb" - "\xbb\x7c\x9f\x7d\x37\xed\xd2\x3e\xfb\xee\x09\xd5\x5f\xdf\xfd\x20" - "\x1c\xbf\xef\x66\x46\xef\xaf\xef\x16\x0c\xde\x5f\xdf\xdd\x30\x78" - "\x7f\x7d\x77\x0f\xf7\x97\x9b\xbe\xeb\x0e\x9f\x37\xbe\xeb\x0c\x6f" - "\x2f\xea\x45\x39\xa1\x0d\xbd\x86\x9f\xbf\x6e\xbb\x8d\x1f\xcb\x38" - "\xee\xab\xba\x12\x02\x2f\xc7\x8c\x61\x1c\xaf\x14\xc6\xa0\xb0\x41" - "\xc3\xca\x55\xd1\xf7\x47\xd9\xc6\x6d\xad\x26\xde\x0b\x27\xdb\x8d" - "\xac\xbb\x4f\xfa\x4d\x50\xa3\x76\xdc\x6b\xa7\xe8\xbe\x35\x41\x4d" - "\x2b\x66\x3f\x4b\xe9\x5f\x29\xd7\x10\x26\x35\x87\xf6\x05\xfb\xe2" - "\xb0\x6d\xba\x49\xd9\x4e\x7f\x3b\x45\xf7\xce\x53\xfd\x72\xdf\x82" - "\x70\x3a\x4e\xf2\x44\xef\x97\x7b\xcd\xe8\x97\xbf\x45\xef\x97\x7b" - "\xc7\x0e\xde\x2f\xf7\xa6\xa1\x5f\xfe\x76\xe9\x38\xba\x37\x53\x1f" - "\x47\x6b\xb9\x8c\x6d\x31\xdb\xe3\xf7\xfe\x91\xf3\xe0\x1e\x63\xe4" - "\xde\x77\xf8\xfd\xf8\x2e\x63\x1c\xc9\x32\x1b\x00\x4b\xd6\xaf\xe7" - "\x29\xd3\x61\x84\xc2\x6d\xb0\x74\x45\x1b\x27\xf7\x1e\xe5\xbc\x77" - "\x14\x90\x19\x34\xcc\xdc\xc9\x30\x96\x12\x9d\xa5\xfb\x6e\xe0\x7c" - "\x9c\x7e\x87\x37\x74\x9c\xdc\xeb\x33\xf2\xb1\xac\x53\x79\xef\xf5" - "\x88\x9e\x3c\xe2\x7c\xe1\xb0\xef\xd3\xdb\x3f\x4c\xce\x23\x9c\x9f" - "\xf3\x45\xe4\x99\xae\xc6\xe3\x7d\x1b\xc2\xc7\xe3\x7d\xd9\xe1\xfc" - "\x09\xfa\xa3\x5c\x10\x72\x0e\xf7\x87\x80\xc3\xd7\xe6\xaf\xcb\x8f" - "\xcd\xfb\x8e\x47\x8c\x4d\xf0\xc0\xf7\x56\x2b\x1e\xf8\xde\x93\x11" - "\xb8\x7a\xa3\xf3\xc0\xf7\x12\x06\xe7\x81\xef\x25\x0f\xce\x03\xdf" - "\x4b\x67\x1e\x70\xd3\xf7\x8a\xc3\xc7\xe6\xf7\xe6\x87\xb7\xfd\x3e" - "\xaf\x1a\x9b\x74\xf5\x95\x8c\x4d\xe8\x42\xd7\x0c\x36\x0e\x79\x4c" - "\xa1\xee\x98\xba\x5e\x63\x3f\xe3\x6b\xd1\xcc\x8c\x71\x05\xfc\x26" - "\x27\xf2\x9a\x12\x64\xfc\x24\xa6\x61\xad\x3c\x6b\x33\x79\x6c\x28" - "\x1d\x37\xa9\x73\x2f\x76\xe4\x7d\x8b\xf7\x87\x15\x3d\xa7\xbc\x18" - "\xde\xfe\xc9\xe9\xd1\xe9\x39\x79\x3e\xe8\x69\x8f\x4e\xcf\xc9\x45" - "\x83\xd3\x73\x72\x15\xfb\xec\x5f\x3a\xa6\x26\xef\xb5\x2d\x97\x3a" - "\x8a\x2c\x73\x96\xa6\x0c\xf9\x7a\xf3\xd3\xe4\x8e\xf0\xf9\x69\x72" - "\xf3\x95\xcf\x4f\x53\x92\xa3\xcf\x4f\x53\xd2\xa2\xcf\x4f\x53\x32" - "\xd5\x78\x98\x52\x19\x3e\x1e\xa6\x14\x84\xf3\x04\x68\xf7\x3f\x36" - "\x3f\x4d\x71\x47\x8c\x81\x8a\x53\x74\xff\x02\xe8\x14\xa5\xaa\xdf" - "\xa6\x8e\x8b\xc0\xd1\x1f\xbd\xdf\xee\x4f\x42\xbf\x55\x44\xef\xb7" - "\xfb\x53\x07\xef\xb7\xfb\x67\xa2\xdf\x2a\x2e\xed\xb7\xfb\x73\xae" - "\x5c\xa7\xb8\xbf\x3a\xbc\xcf\xee\x2f\xbd\xf2\x3e\xbb\xff\x78\xf4" - "\x3e\xbb\xdf\x1b\xbd\xcf\xa6\x26\xa8\x3e\x9b\x9a\x1e\xde\x67\x53" - "\xc7\x86\xf7\xd9\x14\xff\x3f\xdb\x67\xe8\x9f\x2e\xe5\x67\x30\xf5" - "\x0d\xd8\xed\xc3\x7a\x1c\x53\x6b\xdc\x94\xa6\xef\xe1\xa6\xa9\xb9" - "\x43\xf5\xe1\x7e\xe4\xa9\xbc\x74\x1e\x98\xda\xa8\xa7\xfd\xf0\xd2" - "\x7e\x98\x7a\x0c\x32\xba\xab\xa9\x58\xee\x6b\xa9\x3e\x64\x9a\x23" - "\x9f\x73\x15\xef\x4d\x4d\xf5\x72\x59\xf4\xb1\x70\xf9\xfc\xc4\x72" - "\x1d\xf9\xbd\x0c\x87\xcf\x2a\x85\xc3\x4a\xb3\x5d\xc9\x1c\x3f\xb8" - "\x6f\xcc\x9b\x5d\xce\x92\xbb\x00\xef\x81\x7b\x14\xaf\xa6\x45\xea" - "\xbf\x75\x78\x17\xa7\xf8\xf4\xc1\xbf\x44\xe0\xb0\x2b\x3a\x9f\xa6" - "\x1d\x46\x1b\xea\xa2\xf3\x69\x5a\xfb\xe0\x7c\x9a\xc6\x32\xb3\x2e" - "\xc4\xf6\x19\xf1\x94\xdf\x1d\x61\xfb\x3c\x60\xb5\x78\x15\xef\x48" - "\x9d\xa8\xfc\x4d\xe8\x1c\x0f\x44\xea\x7f\xe8\x9b\x07\xde\xd5\x71" - "\xfe\x4d\x44\xf9\x41\xf4\xbf\x07\x58\xff\xdb\x1f\x1d\xe7\x07\x2e" - "\xa3\xff\x3d\xc0\xfa\xdf\xfe\x4b\xc7\xd6\x03\xba\xfe\x17\xcd\xc6" - "\x7b\xe0\x78\xf4\xfe\x7f\x20\xa2\xff\x29\xb3\x10\xf6\xb0\x2c\x1f" - "\x96\xef\xc1\xd1\xa1\xf9\xd8\xc7\x88\xf3\x32\x8f\x44\xc9\x3b\x3d" - "\x12\xe6\x20\xf9\x0a\x2e\xe1\x3d\xf6\x89\x8a\xca\x7b\x0f\xd6\xa8" - "\xf1\xf8\xa0\x37\x7c\x3c\x3e\x78\x28\x7c\x3c\x3e\x90\x19\x51\xee" - "\x58\xf8\x7b\xf0\xcf\xff\x98\x8c\x9d\x96\x1e\xc1\x03\xef\x9f\xa2" - "\x69\x1f\x28\x1e\x48\xbf\x2e\x1c\x8f\x69\xf3\xa3\xf3\xc0\xb4\x42" - "\xb4\xff\xfd\xe8\x3c\x30\xad\x72\x70\x1e\x98\xb6\x17\xb4\x7c\x3f" - "\x94\x6f\x1f\x2b\x4e\x1b\x16\x91\xa7\x2d\xba\xcc\x9b\xd6\x19\x7d" - "\x8d\x20\x9d\x14\x8d\xd3\x27\x85\xd3\x38\xdd\x1a\x4e\x43\xb4\xe5" - "\x9f\xa7\x61\xff\x59\xdf\x1e\x47\x7a\xe4\xf8\x77\x9d\xa2\x87\xf4" - "\xf1\xff\x70\x84\xac\x4b\xdf\xa5\x70\x89\xb6\x2e\x92\xce\xf6\xaf" - "\x2b\x3a\x2d\xd3\x8f\x0f\xd2\x66\xf6\x69\x73\x05\x2f\x19\x4b\x0f" - "\x25\x20\xfd\x31\x5e\x0f\xe5\xf5\x90\x5a\xa4\x3f\xe6\x27\xb3\x9c" - "\xaf\xfa\xe7\xa5\x87\xf8\xec\xa5\x60\xfa\x33\xff\x5a\x46\x53\x06" - "\xcf\x41\x8c\x57\x56\xb1\xf4\x59\xb0\xac\x63\x5e\xbf\x99\x79\xfd" - "\x21\xa9\xff\xf1\x3e\x0b\xfb\x03\x5a\x8a\x28\xc3\xe5\xf5\x93\xc1" - "\xef\x9c\x3f\x02\xf6\x06\x1e\x17\x9c\xdf\xc8\xab\xd6\xcd\x4a\x23" - "\x64\xd3\x43\x87\xa2\xf7\xf1\x43\xcd\x83\xf3\xce\x43\x9d\xaa\x9f" - "\x1f\x1e\x1d\xde\xcf\x0f\x43\xff\x1b\x3e\x97\xdb\x0a\x1e\xb8\xa2" - "\x71\x52\x68\x13\x9e\x41\xe5\xfd\xda\x27\xda\x0b\x4a\xe8\xc6\xd3" - "\xf4\xf0\x3a\x59\x9f\x26\x7c\x96\x35\x31\xd4\x24\x65\xc0\xc3\x9f" - "\x48\x3c\x91\x27\xcb\x4f\x9a\x58\xfb\x7c\x3b\xbf\xab\x73\x08\x1f" - "\xf2\xb5\xf1\x9e\x00\x9f\xf5\x03\x2f\x5c\x73\x92\x1e\xde\x19\x56" - "\xde\x44\xe4\x52\x30\xda\xeb\xe4\x78\x7c\xf8\x98\xb1\xa6\xbb\x6e" - "\x10\xff\x20\xe4\xf1\x19\xbe\x0f\xca\xf7\xeb\xe1\x41\xf7\x2f\x19" - "\x27\xf6\x8f\x67\x9c\x2e\x2f\x07\xbe\x3f\xd3\xe0\x5f\xe5\x33\xf9" - "\xfd\xf9\x03\x3e\x79\xdf\xcf\x73\xd3\xf7\x07\x3d\xcf\x11\x3e\x0e" - "\xbe\x5f\x15\x0a\x47\x9d\x77\xff\xfe\x1e\xc3\xaf\x0e\xf7\x87\xbe" - "\x02\x96\x81\xcf\xf1\x08\x7c\xba\xa0\xa7\x34\xe9\x30\x7c\x97\x83" - "\xc1\x7d\xae\x78\x96\xf9\x61\x7a\xe2\xe5\xd6\xfc\x62\xad\x94\xb1" - "\xf9\x12\xde\x9a\x2e\xf5\x25\x86\x71\x79\x1c\xa7\x97\x86\xd9\x16" - "\x72\xef\x9e\xf7\xb6\x66\xcc\x52\xe3\x7e\x46\xc4\x1a\xe1\xf4\x1a" - "\xe9\x37\xa5\x8f\xfb\xa7\xfc\x91\xe3\x60\xfa\x61\x63\x8e\x8e\x48" - "\x3f\x66\x8c\x7b\xd8\xb5\x0c\x37\x62\x9d\x75\xba\x57\x8d\x85\x19" - "\x33\x83\x71\xa1\xf6\xda\x0c\xa9\xff\x19\xeb\xa5\x6e\xe4\x0b\x2f" - "\x37\x23\x62\xfd\x6f\x7a\x8d\x18\x7c\x9d\x3e\x01\xfd\xeb\xe5\xbd" - "\x2d\x75\x76\x78\x46\x71\xc4\x7a\x85\x67\x93\x3c\x27\xfa\x29\xe0" - "\xfe\x40\x97\x7b\x3f\xf8\x22\xa2\xbe\x1a\xfb\x99\xcb\xb5\x7f\xc6" - "\x20\xed\x9f\x31\xd0\xfe\xc5\x12\x6e\xc4\x5a\xe2\x0c\xd9\xfe\xc0" - "\x25\xf2\xef\x07\x09\x90\x5f\x06\xdd\xa0\x73\xff\x20\xd7\xd0\xd5" - "\x79\xfd\x60\x70\x5d\xfd\x07\x03\xeb\x7f\xaa\xdc\xc0\xfa\x9f\x27" - "\x9a\xae\xee\x26\xb9\xb7\x1a\x5e\x77\x99\xa5\x26\x5a\x5b\x7e\x30" - "\xc8\xfa\xdf\x0f\xf4\xf5\xbf\x7f\x4b\x0c\x97\x67\x3f\x68\x0b\xef" - "\xc3\x19\x11\x7d\xf8\x03\x4f\x78\x1f\xce\xa8\xf9\xef\xce\x6b\x3c" - "\x71\xc6\xc6\xc6\x6a\xb1\x31\x5a\x4c\x2c\x5e\xa3\x89\x34\x2c\xd6" - "\x14\x3b\x04\xbf\xa1\xfa\x75\x98\x16\xab\x99\xf0\x1b\xa2\x5f\x87" - "\x46\x3c\x0f\xe3\xb2\xf8\x99\xf4\xeb\x90\x88\xe7\xa1\x5f\xf1\x7e" - "\x98\x5e\xaf\x51\xbf\x29\xe2\x79\xc8\x57\xbc\x1f\xfa\x4f\x96\xa7" - "\x4b\x9e\xc3\xfd\xd0\x66\x2c\x5e\xbe\x20\x7f\x51\x8e\xdc\x2f\xce" - "\xb5\x2d\x78\xe6\x99\xdc\x65\xcb\x6c\x85\x4b\x6c\x0f\x3e\xf0\xe8" - "\x5d\xf7\xd9\xd4\xb6\x73\xfe\x94\x71\x39\xf1\x34\x6b\xc5\x52\x7e" - "\x31\xeb\xb1\x19\x99\xb6\x8c\x07\x1f\x08\x7f\x69\x80\x91\xdb\xcb" - "\x97\x83\x12\x32\xfe\xd2\xca\x47\x12\x6d\x18\x29\x65\x4f\x47\x4b" - "\x3d\x91\x5a\xf3\x78\x64\x41\x33\xb4\x09\xd1\x6b\x17\xce\x9b\x79" - "\x4f\x7f\x96\xf4\x11\x1e\x5f\x5f\x4a\x05\x0b\xf9\xbc\xc9\xac\x3b" - "\xc5\x7b\x1e\xb2\xfd\x80\xb4\x93\xf4\xf8\x8b\x4d\xd0\x6a\xf9\xd9" - "\xd5\xe1\x27\x9b\x9d\xcc\x28\x7f\x35\xde\xc5\x88\xfb\x83\x48\xf3" - "\xea\x3e\xcd\x19\x63\x64\xda\x7b\xa5\x46\x3e\xcb\x29\x9a\xf5\x17" - "\xf1\x9e\x90\xcf\xe2\xfe\x4a\x3d\xdf\xac\xb7\x82\x8e\x99\x79\x2c" - "\x1b\x6a\x5e\x23\x53\xed\x6b\x44\xdb\x46\x90\x79\xdb\x48\x3e\x43" - "\x3f\xab\xc6\xd8\x0b\x2d\xc7\xb3\x9b\x1e\x2f\xe0\xba\x39\x6f\x50" - "\x9b\xf9\x9a\xcc\x3f\x22\x2c\x7f\xf3\xc0\x5e\xec\xac\x1a\x0d\xf9" - "\xe6\x7c\x4e\x16\x5f\x7c\xed\x51\x57\x71\x29\x59\x02\xe2\x8b\x3b" - "\xa6\x53\x4c\x2b\x66\xdf\x95\x7e\xe1\x77\x2e\x3d\x8d\xfa\x67\x5f" - "\x67\x59\x29\xbe\x70\x61\xf4\xcf\xea\xb2\x8b\x4d\x67\xc8\x84\x71" - "\x1d\xe3\x5c\xca\x7e\x0a\xb3\xa9\xf6\x4b\x32\x81\x06\xa3\x4f\xd3" - "\x9c\xd4\xe2\x59\x22\x60\x9f\x45\xa6\xff\x2c\x62\x7f\xc3\xdd\x0b" - "\x37\xfd\x99\x4c\xbf\xee\x2d\xd5\x7a\x85\x95\x8a\x0b\x05\xe4\x86" - "\x20\xbb\x57\xf8\xd8\x5f\xbf\x39\x3b\xc0\x79\x1e\xef\xb1\x5b\xa9" - "\xb5\xd0\x4b\xab\x8f\x0b\x5f\xd9\x9f\x95\x9f\x7f\x4b\x97\x97\xfd" - "\x17\xcd\xab\x67\x51\xec\xa9\x4c\xd2\x5a\xf2\xaa\xc9\x35\xdf\x4b" - "\xc5\xc7\x45\x67\x73\xf6\xe7\xd4\x9a\xd7\x40\x59\xed\xa4\x35\x77" - "\x7c\x46\x32\x3e\xc4\xfa\xbf\xb2\xdf\xa3\x75\xf5\x22\x4e\xbb\x40" - "\xab\x56\xd3\x55\xab\xfe\x42\x16\x57\x67\x3b\xea\x39\x43\x3f\x3e" - "\x46\x31\x80\xa7\xbd\xfc\x19\x59\x5f\xfe\x11\xfb\xf3\xa6\x51\x4d" - "\x09\x59\x85\x3d\x39\xa1\xd7\x9e\x9c\xd8\x2b\x92\x47\xf4\xd8\x93" - "\x93\x5a\x0b\x90\xbf\xe3\x5d\x1a\xde\x4e\x49\xef\x9d\x6e\xd7\xaa" - "\xcf\xd3\x68\xdb\x6c\xee\xff\x39\x29\x35\xe7\x91\x7f\xfd\xc1\xd2" - "\x20\xca\x86\x96\xf1\xc7\x1d\xac\x76\x65\xfa\x28\x08\x58\xd5\xbd" - "\x34\xba\xa6\x97\xac\xc1\xf2\x83\xa5\x4c\x8b\xbe\xf5\x6f\x1e\x85" - "\x2c\x1c\xb6\xff\xe9\x46\x93\xab\xb9\x8b\x5a\xbc\xbd\xd4\x4a\x9f" - "\x92\xab\xe8\xef\xce\x5f\x3f\xdd\x38\x24\x08\xe6\x77\xae\xea\x00" - "\x7c\xc5\x33\xf6\x16\x3e\x97\x58\x4a\x15\x25\x94\x50\xb0\x8a\x86" - "\x9d\x46\xba\xb2\xe9\xb7\x41\xb7\xf9\xbb\x73\x95\xf4\xc1\x7d\xbc" - "\xa0\xa4\x85\x62\x5b\xbd\xd5\xdc\x66\x2d\x10\xff\x57\x72\x79\xdb" - "\xc8\x55\xf0\x37\x67\xd0\xfc\x59\xe7\x86\x20\x99\xf7\x5d\x6c\xd3" - "\x5c\xa6\x8b\xe4\xca\xf4\xd2\xfb\xa8\x5b\xac\xff\x6b\x02\xe4\x55" - "\x5a\xab\xd7\xc7\xe7\x92\x52\x45\xb7\x35\xbe\x62\x29\xa5\xd4\x9e" - "\xa7\xb1\x3b\xcf\x53\xb2\xe8\x49\xd6\xd8\xaf\xf6\xc9\x33\x89\xb4" - "\x13\xd7\x84\x0e\x32\xa3\xbd\xca\xa7\x3a\x4e\xf7\xaf\xed\x4b\xa6" - "\xba\xde\x01\xff\xda\xde\xee\x01\xff\x5a\xf0\x52\x3d\xfb\xd8\x62" - "\x5c\x64\x32\x3f\x57\x9c\x25\xd3\xda\xb3\x44\x77\x94\x6a\x64\x7b" - "\x9a\xcf\x47\x3c\x32\xc4\x95\x73\x46\xde\x9f\xa4\x8c\xc3\xb8\x26" - "\xe0\x17\x83\x31\x20\xd7\xb3\x3b\x74\xbe\x45\x9a\x86\xb4\x37\x70" - "\x8d\xc5\x75\xa7\xbd\x46\x78\x44\xd9\x9e\xd1\xdd\x1a\xc5\x33\xff" - "\x2a\x5f\xde\x3d\xa3\x7b\x1c\x19\xd0\x7f\x72\x93\x0c\x3e\x56\x32" - "\x7d\x56\xfd\xfb\xa7\xce\x70\xbc\x16\x8f\xc4\xa7\x2f\x2f\x86\x63" - "\xb7\xe8\xe9\xc0\x21\x23\xc0\xf5\xa2\x7e\x37\xae\x16\xfc\x30\x2e" - "\x33\x0a\x8d\xb2\xdd\x7d\x79\x5c\xe7\x05\xa4\x0b\x23\x1d\xed\x35" - "\xf1\xbb\x83\xa7\xce\x68\x2a\x4f\xb2\x06\x98\x3e\x1d\x3e\xc6\xfa" - "\xac\x74\x1e\xd3\xdd\x9a\x45\x1c\xc9\x99\x48\x35\x23\x45\xdb\xce" - "\x2d\xa2\x49\x8d\xb5\x47\x26\xb9\x69\xa1\x8d\x71\xc4\xbc\xdd\xb4" - "\x01\xef\x8e\xd8\x88\x98\x2e\x4d\xd9\xec\x3f\xf6\x48\xa6\x9b\xe2" - "\x8f\x87\xb6\x41\x38\xfe\x6d\x3a\xcf\x9d\x6f\x97\x38\x87\x08\x6d" - "\xe6\xf4\x56\x77\x17\xfd\xba\xb7\x73\x88\xfd\x8f\xa4\xb9\xfc\x27" - "\x69\x42\x12\x59\x59\xff\xab\xdb\x22\xdc\xb8\x76\xb2\x3f\x27\xf8" - "\xe4\x86\xd3\xf4\xc8\x1b\xb7\x27\x51\xd2\x9f\x8a\x48\x97\x47\x8f" - "\xbc\x1b\x22\x8f\x1e\x6a\xe9\x68\x0c\x91\x45\xf3\x2e\x5c\x2a\x8b" - "\xe6\x7e\xa1\x64\x91\xf0\x2b\xd9\x13\x70\xeb\xe9\x9f\x45\xa4\xeb" - "\x7e\x21\x73\x3f\x88\x48\xf7\xe9\xe9\xfb\x22\xd2\x3d\x2a\xfd\xb1" - "\x33\x86\xac\x6b\x65\x3c\x56\xb0\xac\x7b\xec\x23\x96\x75\xad\x39" - "\xba\xac\x93\x3e\x86\x8f\xfd\x46\xfc\xa2\x94\xf8\xec\x11\xee\x37" - "\x32\xfe\xe2\x3d\x32\x70\x8f\x43\xda\x2c\x4e\xab\xfc\x94\x4c\xf8" - "\x49\x39\x27\x1c\x33\xf7\xb3\x9c\x63\x19\xc7\x7e\x27\x3b\x46\x8a" - "\xf6\x1d\x5b\xc4\xb1\x9a\x2d\xa2\xb9\xc7\xf1\xe8\x61\x43\xde\xfd" - "\x14\x69\x1b\x90\xf6\x53\xbc\x67\xb9\xc7\x34\x69\xc9\x6c\xe4\x73" - "\xfa\x1d\xe0\xe3\x1c\x4b\x0c\x15\x6c\x02\xcf\xf3\x79\xc0\x75\xa0" - "\xaf\x0b\x32\x89\xcf\x72\xc9\x38\x27\x5a\x2a\x64\x54\x07\x8f\xb7" - "\x91\x6b\x31\xbe\x5c\x45\x9f\x53\x89\x57\x9c\xe6\x73\x71\x8c\x43" - "\xd6\xca\x1f\x70\x1c\x8f\x98\xa6\x3c\x22\xf6\x01\x67\x7f\x15\xc8" - "\x5d\x53\x25\x70\x3a\x92\xcf\x7d\xfd\x18\xec\xff\x6d\xfa\x79\xa4" - "\xc7\x0b\x38\x2e\xd0\x49\x7a\xb4\x0c\xf6\x9d\x8f\xdb\x66\x09\x94" - "\x12\x9f\x5f\xc1\x18\x65\x1b\x2f\x6f\x07\x7e\x95\xc6\x19\x16\x8e" - "\xed\x84\x3c\xae\x76\x1f\x31\xce\x6e\x7a\xf4\x58\x4b\x71\x23\x97" - "\x2f\x62\xda\x08\x87\xdd\x80\x11\x23\xcf\xc0\x38\xc8\xcc\x67\x60" - "\xdc\xf4\x58\x9e\x2c\x1f\xff\xe6\xd1\x96\xf9\x1e\x62\x39\xef\xea" - "\x04\x8c\xe2\x93\x0a\x06\x60\x09\xc8\xfd\xb0\x77\x3a\xfc\xab\x56" - "\x8b\x2f\x00\x3f\x9d\xfb\x8b\xcf\x2d\xf2\xfe\x1a\xe8\x92\xc0\x7e" - "\xf1\x4a\xf7\x7c\xb4\xa5\xee\x53\x22\xfd\xec\x25\xf8\xed\xd1\x66" - "\x3e\x6f\xc4\xe7\x2d\xe5\x59\x4b\x6d\x22\x89\x15\xc9\x09\xfd\xe7" - "\x2d\xff\x7f\x38\x6b\x09\xfa\x5b\x6b\x35\xd1\x00\xfc\x9b\xf9\xbc" - "\x25\xf0\x4f\x61\x3e\xd4\xdb\xd4\xf6\xf3\x1f\x4b\x9a\x27\x71\x1a" - "\x6c\xc5\xa3\x46\xff\x73\x7b\xb9\x2d\x27\xe9\x11\x9f\xd2\x09\x45" - "\x9b\x9b\xe6\xb6\xf1\x7b\xa4\x75\x70\xfe\x09\x90\x63\xae\x9c\x00" - "\xed\x3f\x15\xd0\x2a\x56\x91\x49\xc9\xb4\x79\xff\xe0\xf2\x4a\xa6" - "\xcd\xab\x1f\x90\x69\xf3\x7e\xae\x64\x9a\xa2\xb1\x92\x69\xf3\xca" - "\x95\x4c\x9b\xb7\x46\xee\x83\x41\xa6\xf1\x3b\x96\x6b\x86\x4c\xdb" - "\x39\x52\x1c\x65\xd9\xd1\xe3\x98\x57\x60\xc8\xb6\x8d\x48\x63\xd9" - "\xc1\x38\x2a\x39\xf5\xd8\x51\xf1\xbf\x92\x49\xf9\x19\xf0\x7d\x1e" - "\x9f\x55\xe8\xd4\xef\xd1\x2f\xf3\x4e\x28\x19\x37\xaf\x69\x40\xc6" - "\xcd\x9b\x3e\x50\x96\x65\xdc\xbc\x4f\x94\x8c\x53\xe9\x75\x3f\x66" - "\x19\xf7\xd8\x51\xa6\x81\x0e\x5f\xe3\x35\x3b\x3d\x3f\xe8\xf8\x48" - "\x5b\xa8\x8c\x0b\x1f\x5f\x8f\x8f\x36\x64\x1c\xcb\x36\x3c\xa7\x40" - "\xa6\x49\xdf\x60\x1e\x67\x55\xa0\xb9\x31\xee\xb8\x0f\xb8\xcd\x1c" - "\xff\x87\xe9\x36\xed\x0c\x0d\xd3\xcf\xfd\xe8\xed\x7e\x3c\xcf\xf0" - "\x75\x74\xd3\xbc\x82\x68\x7a\xb3\xa1\xa7\x81\x1f\x6f\x0a\x60\xbc" - "\xb9\x4a\x31\x97\x56\x8b\xd2\x56\xff\x31\x7a\xaa\x90\xb4\x60\xec" - "\xf3\x27\xb8\x6f\x61\x67\x0c\xe5\x2b\xcb\x1e\xcc\xa1\xfb\xb2\xbc" - "\x34\x14\xb6\xf9\x89\x0a\x0d\xef\x8a\xe8\x7b\x21\xef\xfe\xc8\xf5" - "\x84\x94\x1b\x1f\xf2\xee\x73\xa9\xe3\x9d\xe5\xd8\x4f\x8f\x57\x0e" - "\x66\xfb\x5f\x19\x2e\x3f\xbc\x77\x70\x5c\x7e\x38\x6f\x70\x5c\x7e" - "\x28\xf5\x80\xf1\x5d\x14\x03\xdb\xec\xea\xb3\xf4\x43\xb9\x1e\x23" - "\x63\x57\xac\x8d\x5a\xcf\xeb\xfa\xfb\x21\x21\xef\x43\xeb\xfa\x20" - "\x4a\xf9\xd0\xfa\x4e\x5c\x1e\x7e\x66\xcc\xe5\xe1\x67\x8e\xb9\x3c" - "\xfc\xcc\x07\x58\x06\x82\x76\x96\xa0\x16\x9e\xef\x0e\xbf\x1c\x83" - "\x47\xf9\xdc\x1d\xf2\x2d\xd2\xd7\x7c\x4e\xd8\xc7\x48\x5b\x50\x9e" - "\xcd\xda\x84\xf7\x7c\x96\x9c\xe5\x73\xfa\x4a\x22\xb5\x47\xdd\x5f" - "\x66\x67\x24\x6e\xc3\xfd\x06\x6e\xf2\xfd\xbb\x91\xb8\xe1\xfd\xf8" - "\x90\xf7\x9f\x0d\xf4\x7b\xe6\x65\xfd\xeb\x5d\xd5\x44\x1c\x43\xef" - "\x08\xcc\x17\xcc\xc9\x1c\x8f\x4b\x5f\x9f\xf9\xd1\x44\xc8\xf9\xd2" - "\x10\xbf\x5d\xf6\x39\xbb\xa9\xd5\xcb\xe7\x54\xbd\x32\x56\x0a\xda" - "\xf2\x4d\xcc\x27\x23\xf8\xac\x0e\x9f\xdb\xc9\x0a\x64\x68\x2a\x26" - "\xce\x8f\x0a\x8c\xb2\x83\xad\x03\x71\xbd\x7a\x9d\xec\x03\xeb\x45" - "\x99\x5d\x46\x19\x86\xcd\x7e\x94\x98\x07\x6e\x92\x67\x57\xfd\x5d" - "\x2c\x77\xbf\x09\x3d\x79\x84\xaa\x27\x9b\xf4\x7a\x60\xc7\xfe\x30" - "\xe1\x72\x67\x47\x06\x6f\xdf\x8f\x93\xae\xbc\x7d\xa4\xb7\xef\xc7" - "\x19\x5f\xd1\xbe\xcb\xd5\xbb\xe1\xca\xeb\x4d\x34\xea\x3d\x7a\xe5" - "\x74\xfd\xb1\xff\xeb\xd3\x35\x55\xa7\xeb\x13\xa9\x5f\x41\xd7\x28" - "\xf5\x3c\x91\xf3\xf5\xeb\xb1\x19\xf5\x54\x47\xab\x87\xe4\xdf\xa0" - "\xe7\xba\xcc\x46\x6c\x3a\x8e\x0b\xa9\x62\x52\x3d\xe1\x0e\x8d\x9d" - "\xa9\xe2\x45\x3e\xe1\x35\x62\x67\xea\x31\x2c\x31\xb7\xcc\xbf\x3a" - "\xab\x9e\xf5\x11\x11\x74\xd3\xfc\x24\x8e\x7b\x98\xbe\x3a\x34\xc6" - "\xe4\xfc\xe4\xcb\xc5\xec\xe4\x58\x39\x42\x64\xd2\x91\x6a\xe9\x0f" - "\x80\x79\x68\xfe\x02\x3e\x1f\xa0\xf6\x33\xe7\xe7\xab\x31\x39\x3f" - "\xdf\x4d\x4f\x34\x0e\x0e\xe3\x40\xc1\xae\x92\xd4\x21\x83\xf9\xfc" - "\xa3\xfc\x5e\x37\x3d\x2b\xd7\x2f\x03\xeb\x1b\x2a\xc5\x39\xab\x1e" - "\x8b\x2b\x2b\x2e\x24\x56\x18\xe6\xee\xa7\xee\xd5\xcf\x26\x80\x06" - "\xa5\xa0\xe5\xfc\x0e\x83\x06\x46\x3a\xd2\x7c\x06\x0d\xa0\xaf\x24" - "\xb8\xea\xfd\x7c\x76\xc8\xab\xce\x7b\x3f\x79\x83\x28\x3f\x90\xad" - "\x60\x3f\xa9\xf6\x19\xe2\x1b\x2a\xbd\x2f\x5b\x35\xa3\xfc\x58\x9b" - "\xfd\x4b\xe6\x61\x4f\xdc\x81\xec\x1e\xc7\x93\xe9\x06\x7c\xc1\x78" - "\x89\x81\x7c\x75\xd2\x2f\xe9\x49\xf4\xff\x13\x93\x25\x5f\xa3\x0e" - "\x89\xbb\x46\xb1\x41\xe0\x8f\x36\x68\xae\x02\x2f\xeb\xa9\x5d\x01" - "\xb4\x9f\x65\xdd\xa1\xc5\x6e\x13\xe7\x91\xba\xc3\xb9\x64\x4d\xc5" - "\x39\x7b\xf2\xdd\xe0\x39\x8e\xb7\x21\xf1\x4a\x40\x9b\xcd\x8c\x93" - "\x1b\x57\xcf\xcb\xc9\x34\xe7\x02\xe9\xb4\x78\xf2\x8d\x20\xd2\x83" - "\xcb\x06\x70\xa8\x95\x67\x3c\x9e\xec\x34\x70\x08\x72\xfd\x3d\x56" - "\x0d\xba\x18\xd7\xdb\x29\xcf\x59\xa2\xee\x09\x1c\x97\x8a\x63\x59" - "\xac\x48\x26\xc6\xa1\xc7\xf1\xd4\x68\x83\xde\x7a\x19\xa3\x8e\xe6" - "\xa0\xac\x5b\xd1\x46\xd1\xf9\x08\xf4\xc1\xa7\x66\x5e\x4a\xe7\xa7" - "\xb2\x43\xe8\x1c\xcb\x7c\xc5\x6b\x2c\xe8\xa3\x00\xd3\x9b\xf7\x35" - "\x6c\xcb\x59\xaf\x7a\xea\x67\x47\xbc\xd2\xef\x24\x81\xe1\x06\x41" - "\x7f\x86\x01\xb8\xdf\x50\x34\x7e\x6a\x4f\x3f\x8d\x51\xb7\x40\x5f" - "\xac\x55\x67\x52\xd8\xf7\x1d\xb2\xe3\xa9\xa3\xfd\xf5\x30\xae\x76" - "\xab\x16\x14\x56\x8e\x6b\xe7\x61\x5c\x0b\x6d\xc2\xc7\x7a\xa5\xf4" - "\x63\x42\x5b\x0f\x95\xb4\x9b\xa0\x5b\x6a\xb2\xae\xee\x64\xd6\xef" - "\xcd\xf2\x1e\x75\x0d\xc2\xdf\x9f\x70\xec\x38\xa3\x5d\x68\x8b\x99" - "\x79\x0b\xb8\x43\xff\xcb\xbe\x4a\xf2\xcb\x72\xee\xa7\xac\x2f\x38" - "\xcd\xc8\x87\xe7\x0f\x39\x9f\xf1\x8c\x77\xe0\xaf\xac\x57\xd0\xae" - "\x78\xc6\xd3\xc3\xf1\xf2\x64\x9b\xb3\x93\x19\x46\x8f\x23\xab\x32" - "\xac\x9d\x7d\x99\x26\x83\xef\x78\x8f\xa8\xc9\xe6\x93\xb2\x53\xd1" - "\x36\xeb\xb0\x31\x26\xb9\xbc\x1a\x63\x59\x6d\xa1\xbc\xe8\xb5\x0f" - "\xf0\x41\xe1\x18\x32\x9b\x6c\x1c\xef\x2e\xab\x41\xc5\xd5\xcd\xf2" - "\x47\xf6\x17\xbf\xe3\xd8\x70\x3a\x0d\x79\x3c\x25\x9e\xa4\x2c\x0f" - "\xb7\x0d\xef\xd2\x2f\x37\x5f\x72\x8c\x36\x8e\xb7\xb7\x59\x8d\x23" - "\xd0\x65\xc1\xa2\xcd\xea\x7c\x8f\x57\xc5\x48\xcb\x7e\x41\x68\xaf" - "\xcb\xfe\x62\xbf\x3c\x19\x0f\x43\xc6\x9e\xc8\x66\x1f\x37\x31\xbc" - "\xe0\x75\x19\x2b\x51\xf7\xd9\xf3\x34\x15\xf8\x65\x9c\x35\x7b\x21" - "\x9f\x83\xf5\xb3\x4d\x26\x7d\xd2\x8e\x14\xfa\xe9\x31\x1f\xd3\x36" - "\xfb\x30\x9f\x57\xf7\x4a\x5a\x64\x1f\x35\xce\xa8\x73\xdc\x37\x8e" - "\x25\x38\xc1\x4f\xb1\xac\x53\xd8\xec\x1c\x5b\x60\x41\x3d\xeb\x24" - "\x8a\xa6\xe0\x7b\x4d\xb4\x29\x5e\x5e\x70\x35\xc7\x66\x54\xfb\x4b" - "\x27\xc1\xdf\xb1\x7f\x47\xde\x5b\xd5\xba\x8c\x31\xd6\x16\xbc\xce" - "\x7b\x4c\x6e\x1d\x46\x8f\x63\x01\xe6\xff\xf9\x55\x97\x8e\x8b\x05" - "\x57\x1b\x36\x06\x9f\x8b\x53\xfb\x55\x03\xf0\x50\x5e\xae\x4b\x0f" - "\xc8\xa6\x3f\x30\xac\xd2\x4b\xc7\xcc\x82\x2a\x83\x97\x0b\x6e\xe6" - "\x73\xd5\xd9\x99\x5c\xff\x60\x32\x53\xd8\x7f\xc4\xfd\x64\x3e\x65" - "\xa3\xd8\xaf\x3a\x2f\x31\xb0\xff\xb5\xc0\x67\xb4\xc1\xa0\x89\x6a" - "\xc3\xd3\x8f\x74\xc7\xbf\xe9\x19\x68\xfb\xd3\x8f\x48\x5a\x0c\xbc" - "\x2f\x0f\xa1\x0d\x3f\x97\x29\xbe\x7b\x7a\x3a\xf8\x43\x5f\xb3\x51" - "\x69\x22\xfe\xc0\x33\x1c\xa7\x51\xe1\xb8\x88\x0c\x7e\x47\xde\x42" - "\x37\x9d\x4a\x56\xfb\x50\x4f\xa3\xfd\x0b\xda\xf4\x72\xa3\x19\x97" - "\xa8\xed\x0c\xc3\xf1\x19\xe2\x39\x56\xc5\x2d\x78\x26\x86\xf1\xb5" - "\x7d\x8b\xfb\xf8\xe9\x16\xae\x97\x79\x42\xf4\xe5\x0d\xf1\xf6\x25" - "\x53\x77\x5f\x1e\xc6\x4f\xb2\x86\x7a\x20\xff\x3e\x37\xe9\x75\x7a" - "\x0d\x5c\x19\x37\xe8\x8a\xe6\x1e\xb1\x28\x3a\x7d\xb9\x5e\x1e\xef" - "\x7d\x79\xc3\xf0\x33\xe3\x37\xf4\xeb\xce\xc7\xd0\x6b\x3b\x3d\xe5" - "\xfb\xe6\x07\x97\x8b\xa3\x73\xfc\x22\x08\xbb\xa0\xb3\x02\xfc\x3b" - "\x7c\x8d\x93\x86\x7b\x9f\xd4\xb2\x56\x52\x1a\x6c\x5b\x12\x17\xc5" - "\xa4\xda\x20\xae\xcb\xc5\x44\x8e\x47\x8b\xe7\x54\xfd\x39\x85\x9f" - "\xbb\x97\x8b\xf9\x3d\x8e\x67\xf6\x18\x7b\x77\x2a\xf6\xcc\x33\x8d" - "\xfd\x71\x78\x62\x9f\xe0\x73\x3e\x34\xa7\x08\x75\xc4\x3e\xdf\xc9" - "\xf5\x66\xf1\xdc\x81\xfa\x90\x0f\xf3\xff\xfc\x89\x9c\xcf\x13\x7b" - "\xdb\x08\xfc\x92\x07\xd9\xe3\xec\x64\xbc\xba\xe3\xf6\xcd\x37\x70" - "\x1d\xee\x4d\xd3\xbe\x1e\x6e\x39\xe9\x06\x6e\x48\x3f\x5a\xa1\xd2" - "\xfd\x1c\x8b\x8c\x7d\x10\xf1\x3e\xc7\xc0\xd5\xc0\x81\xeb\xe3\x73" - "\x95\x22\x7e\xb7\x8c\xed\xc2\xf5\x79\x5e\xce\xe3\xbc\x95\x06\xbe" - "\x5f\x7d\xf6\x27\x3a\xdd\xdd\x94\x73\x5c\xf1\x64\xce\x71\x63\xfe" - "\xc2\x7d\x67\xf8\x7e\x6f\x4e\x5b\xa4\x2c\x7b\x7a\xc9\x92\xc2\xac" - "\xa5\xb9\x7c\x49\x1e\xf7\xd2\xad\xf1\xa1\x36\x29\xcb\x37\x15\x1b" - "\x20\x97\xcf\x3e\xd1\xe6\x11\xc6\xfe\x65\x6e\xff\xf9\x27\xdd\x4f" - "\x7a\x2a\xeb\xaa\xac\xd3\xe1\xdd\xfc\x0f\x8a\x57\x33\x98\x98\x13" - "\x66\xd2\x06\x93\x9d\x2c\x2f\xba\xe3\x3e\x49\x95\xf4\x28\xf7\xd4" - "\xa3\x5c\xff\xfa\x67\x74\x3f\xb1\xdd\x69\x81\xf5\x07\x9d\xb6\x51" - "\x32\xc6\x91\x76\x70\x55\xbb\xc6\x73\x78\x09\xee\xd9\x76\x92\x7a" - "\x83\x1e\x37\xe7\xbd\xf3\xed\x90\xc3\xb9\x9d\xa2\x7c\x77\x1a\x60" - "\xba\x07\xc5\x21\x64\x8f\x9d\x7d\xb2\x3a\x68\x21\x0d\xba\x1f\x5e" - "\xd6\x50\xaf\xc6\xe1\xc2\x79\x4d\x56\xe2\x33\xa2\x3f\x39\x49\x0b" - "\x1f\x31\x59\x21\x6b\x47\xd1\x6e\xdc\x4b\x5b\x97\xdf\x85\xf5\xd7" - "\x0d\x67\xea\x4d\xb1\x42\x13\x42\xc4\x08\xf5\x47\x26\xfd\x26\x16" - "\x3f\x4d\xc4\xc8\xdd\xa2\x58\x50\x6a\xd8\x50\x13\x59\x86\x27\x98" - "\x6f\xba\x71\xb4\x75\xea\xfd\x93\x27\xd9\x4b\x8a\xc1\xdd\x7e\x9f" - "\x45\x84\xc6\x79\x6a\x6f\x9b\x77\x6b\x29\x49\x7f\x81\xf2\xf6\xb6" - "\x68\xb8\x6e\x74\x88\x02\x3e\x9b\x1b\x8c\xf7\x24\xda\x5f\x22\x6d" - "\x7f\xaf\x5b\xe3\xd8\xc1\x3c\x47\x73\xcc\x32\xe0\x7a\xe2\x7d\xa4" - "\xa1\xfd\x45\xa2\xcc\x93\xa8\xf6\x03\x9f\x1d\x13\x5c\xef\x49\x1c" - "\x80\x6f\x22\x86\x6f\xdf\x46\xda\xae\x92\x4e\xcd\x65\xba\x9f\x5c" - "\x36\x2f\xbd\x8f\xfb\x41\xfa\xb3\x00\xf4\x27\x86\x51\xe7\x08\x96" - "\xd9\xbf\x24\x4d\x3f\x5f\xa7\x9d\xa5\x67\x7f\xd4\x30\x48\x39\x3e" - "\xcf\xda\x1d\xbf\xef\xe6\x1e\xc7\xb3\xe8\xff\xef\x79\xf5\x39\x01" - "\xb2\xeb\x59\xd8\x7f\xb9\xea\x39\x7e\xdf\x98\x6e\x19\xd7\xf2\xd9" - "\x46\x23\x4f\xf4\x79\x81\xd7\x1c\x85\x93\xfb\x55\x5c\xfc\x47\x27" - "\xfb\xee\x0f\xb2\xcf\x3f\xcc\x55\x74\x17\xef\xb3\x0c\x19\xee\xa3" - "\x04\xfb\x05\xd1\x07\xbb\x3d\x09\x6c\xab\x05\x60\x7b\xf9\x2f\x8a" - "\xcc\x96\xae\xf3\xc4\xb1\xfe\x78\xbf\xf6\xed\x85\x7f\xd0\x5c\xbe" - "\x73\x4e\xd7\xba\x20\xb5\x62\x7e\x76\xd5\x9c\x73\xb6\x74\x1d\xc3" - "\x7d\x80\x5a\xe8\x53\x6a\x29\xfa\xb8\x54\xae\x95\xd4\x88\x52\xa6" - "\x73\xdf\x45\x31\xd7\x65\xfa\xff\x88\xe3\xd5\xb3\xac\x00\xdd\x6d" - "\x67\x29\x6f\xcd\x7b\x80\xb3\xff\xaf\x80\x25\x63\x3b\x4d\xa1\xf7" - "\x71\xdf\xe3\xc8\xdb\x60\xc8\x91\xa8\x71\x34\x62\x9c\x1b\x2d\x45" - "\x4f\x6a\x41\xc8\x24\x8e\xc1\x05\x59\x34\x91\xdb\x85\xe7\x54\x7e" - "\xc6\x35\x85\xaf\x96\x35\xce\x9d\x16\xff\x93\x2c\xa3\x32\x59\xfe" - "\x20\x7d\x6e\xdd\x45\x29\xb3\x32\xf4\xe7\x99\xfa\xf3\x74\xfd\x39" - "\x5d\x7f\x4e\xd3\x9f\x27\xf3\xb3\x92\x6d\x8b\x6c\xfd\x72\x57\x1b" - "\xd6\x86\xe7\x54\xa3\x2f\x80\xcf\x55\x96\xa2\xd5\x52\x46\xea\x78" - "\x4c\xd4\xf1\x4a\xd5\x9f\x0d\x7c\x6e\xb0\xf8\x57\xff\x4f\xe1\xd3" - "\x10\x81\x8f\x33\x04\x1f\xb2\x14\xa5\x7d\x1d\x7c\x12\x2d\x1c\xaf" - "\xf9\x9f\xc0\x87\x71\xe1\xb4\x1e\xc7\x73\x69\xe1\xf8\x3c\x97\x61" - "\xe0\x13\x95\xdf\x96\x8b\x4e\x9e\x1f\x96\x5d\x27\x63\x55\x0e\x63" - "\xd9\x5f\xd7\x6b\xc4\x53\x7b\x6e\xc3\xe5\xe2\xa9\x61\x2c\x58\x91" - "\x07\xed\x7f\x6e\xbe\x3e\x0f\x1e\x56\xfa\xd2\x73\x4d\x86\x6f\x0c" - "\xda\xba\xa7\x42\xb5\x75\xef\x3a\x8e\x29\xb6\x92\xae\xb7\x17\x89" - "\x4e\xe8\xff\xff\xd5\x64\xf3\x84\x8d\x81\xfc\xc2\x65\xcb\x5e\xb8" - "\xcf\x96\xbf\x60\x71\xae\x6d\x5c\x8e\x6d\x59\xde\xa2\x85\x85\xb9" - "\xe1\xfb\xc5\x89\x7a\xbc\x7c\xe9\x07\xcf\x3a\x29\x8f\x01\xe6\x7f" - "\xb6\xe3\x95\xef\xe2\xf3\xaf\x08\xc7\x73\x7c\x56\xd6\x5c\xfb\x1a" - "\x99\x78\x8f\xa2\xc7\xf1\xfc\x5c\x63\x4e\x50\xf1\xa1\x29\x46\x4b" - "\x64\x9d\xeb\x79\xd8\xbf\xcf\x76\x85\xa4\x73\xde\x52\x23\x8d\xe1" - "\xeb\xb2\x69\xd8\x49\x7a\x7e\x0c\xd7\x19\x95\x86\x17\x45\x3d\x6c" - "\xdd\x18\xd8\x23\x6c\x1b\x0a\x8e\x1f\xc4\xe7\xcb\x50\x4e\x00\x9f" - "\x8f\x58\xf6\xf2\x37\x20\x94\xee\x2b\x18\xc7\xcf\x51\x66\x17\xd2" - "\x4c\x9b\x90\x17\xfa\x74\x27\x97\x43\x7a\x80\xcf\xf9\x23\xdd\xac" - "\xc7\x44\x42\x5a\xfe\xd5\x7c\x0e\x1f\x69\x89\x21\x69\xe3\x38\x4e" - "\x2f\xd2\x6c\x0a\x5e\xfe\x3d\x4c\x67\x3c\xa7\xe9\x36\x37\xe7\x99" - "\xa1\xd7\x1b\x16\x2f\x8b\xa3\xa8\xdf\x75\x47\xaa\x6d\xee\x63\xdf" - "\x99\x72\xff\x33\x4b\x16\x2f\x8c\x27\x49\xf6\xe4\xd4\xa2\x71\xa9" - "\x77\x15\xdd\x7a\x9f\xad\x20\x37\x77\xa9\x6d\x45\xee\xe2\x42\xdb" - "\x82\x15\x0b\x56\xc6\xd3\xc2\x25\x4b\x9f\xe1\x53\xe4\xdc\x2d\xcb" - "\xb2\x9e\x59\xf8\x2c\x6f\xea\xab\xdc\xf1\x61\xf3\xf1\x5c\x96\x6d" - "\x7a\xdc\x85\xa3\x90\xb9\x3e\x11\xf7\x4e\x36\xee\x39\x16\x91\x15" - "\xd7\x26\xfc\x0e\xe3\xd7\x88\xdf\x31\xfc\xda\x4e\xd3\xd2\x24\x5c" - "\x0f\xf5\x38\xf2\xbd\x86\x5e\x30\xc0\x43\x2f\x98\x0d\x1e\xc2\x3c" - "\x7e\x48\xcd\x6f\x2f\x4c\x6a\xf5\xcb\xf1\xd3\xcf\x53\x15\x17\x07" - "\x78\x4a\xc6\x3b\x64\x9f\x95\xe5\x78\x0f\x1e\x66\x3b\x16\x34\x8f" - "\x63\xba\x9d\xa2\x82\xf1\xb0\xfd\x9b\x39\x16\x08\xae\x4d\xe0\x97" - "\x66\x15\x7f\xe3\x85\x43\xc8\x37\x06\x75\x1c\xd6\xeb\x50\xcf\x23" - "\xc5\x51\xb6\xf3\x4f\xea\xcf\xca\x26\x5e\xf2\x21\xdf\xf3\x55\xdf" - "\x2b\xb2\xb0\xff\x9f\xb2\xad\x8c\x77\x8b\x9f\xd4\xeb\x70\x82\x16" - "\xa5\xb5\x0e\xd1\xbf\xcf\xc1\x6b\x4c\x96\x98\xa9\x02\xf8\x9c\x0b" - "\xc6\x3e\xd1\x2e\xe3\xf4\x95\xf6\x42\x46\xdc\x7d\xb7\xab\x48\xe6" - "\x8f\xe1\x35\xa8\xd9\x05\x22\xc8\x71\x51\x83\xb1\xcf\xb7\x73\x39" - "\x61\x7e\x27\x3b\xb8\xe9\xaa\x34\xa5\x0b\x70\x7c\xb4\xc5\xba\x1f" - "\xa8\xf0\x31\x6d\x4f\x53\xfe\x3f\x94\x3d\xb3\x34\x49\xe9\x59\x8b" - "\xd3\x0d\x5f\x32\x8c\xd1\x64\x3c\xcf\x35\x64\x80\x9b\x16\xdb\x74" - "\xbf\x1f\xa7\x6a\xff\xe2\x0d\xfa\x73\xa3\x8e\x63\x0c\xc7\x7a\x00" - "\xfe\x6d\xdc\x77\xb0\x0d\x1b\x71\x7f\x0c\xf4\x69\x56\xf4\x59\x2c" - "\xd7\x18\xa0\xd7\xf0\xfb\x63\x1c\x77\x1e\xef\x8e\xa9\x38\x0a\x2f" - "\x34\x71\x9b\x07\x7c\x03\x6b\xd2\x40\xbf\x0f\x79\x4f\x0d\x63\xa9" - "\xd1\x75\x91\xc7\xe7\x0b\x4e\xc0\x6b\x30\xe4\x0e\xcb\x99\xac\x00" - "\xc6\xa9\xd4\x4b\x17\xfb\x0d\x79\x33\xc0\x07\x4b\x12\xa3\xc9\x92" - "\x68\xfd\xae\xf7\xcd\x4a\xe1\xc8\x9f\x0b\x9c\x1a\x64\x1f\x70\xdc" - "\xc8\x8b\xfd\xfa\x6f\x9f\x92\x91\x4b\xfa\xf5\x5f\x03\x0f\x8e\x77" - "\xeb\x66\xdc\x7a\xe5\x3e\xa7\x2e\x37\x96\x6c\x30\xe4\x86\x01\xc7" - "\x12\x23\x82\x96\x22\xfc\x2b\xdb\x7d\x9c\xd7\x58\x79\xbe\x94\xfa" - "\x08\xe0\x0c\xbf\xa0\xce\xf8\x04\xcb\x77\x43\xcf\x5d\x92\x0e\x19" - "\x63\x92\x3a\xaa\x23\xff\xd9\x01\x59\xb4\xc4\x1d\x0a\x53\x98\x77" - "\x1f\x67\xb8\x2c\x8f\x58\x27\xc9\x0a\x98\x38\xce\xc6\x71\x7d\x7e" - "\x81\x0c\x2e\x48\x34\x70\x05\x0d\x8f\x1a\xf8\xea\xdf\xf8\x80\x8d" - "\xbd\xa4\x60\x4e\xa0\x8f\x7d\x5d\x9b\x54\x7f\xbe\x28\xe5\x0d\xde" - "\xed\x45\xd9\x99\x6e\x7a\xbe\x5e\x1f\x43\xcd\x28\xbf\xf7\x48\x49" - "\x3a\xf2\x14\xe4\xe9\xfe\x9a\x6d\xe8\xdf\x63\x21\xbc\xff\x64\x88" - "\xbd\x7c\x4c\xf5\xe1\xfd\xa5\x27\xa9\x60\x4f\x48\xba\xde\xb7\x47" - "\x32\x4e\xd2\x8b\x4f\x2a\xdb\x73\x77\x8d\x2a\x5f\x20\x7d\x36\x0d" - "\x1c\x59\x16\xf0\x79\x24\x1e\xe3\x92\xf6\xb2\x8f\x0b\xdc\xc6\x7c" - "\x01\x58\x87\x24\xcd\x47\x8a\xc3\x4c\x27\x15\xcf\x20\xff\x55\x45" - "\xa7\x17\xcd\x61\xb4\xe7\x79\x13\xf5\x30\x9d\x86\xaf\x11\xc1\xe1" - "\xde\x18\x91\xb5\xd2\x24\x63\x37\xf3\x18\xe7\xbd\x09\xf0\x87\xd4" - "\xab\x14\xdd\x5e\x9c\x6e\xd0\xcd\xe8\x3b\xa6\x93\x9b\x0a\x1a\x99" - "\xb6\xe1\x6d\x1c\xd6\x76\xd2\x68\x3b\x68\xca\xeb\xa5\x78\x9e\xaf" - "\x8f\x8b\x66\xe7\x28\xde\x2b\x7f\x61\xc1\x11\xd3\x77\xe8\x48\xd1" - "\x44\x52\xb4\x7d\x11\xf6\xdf\xf3\x66\xd9\x0e\x05\xeb\x28\xd3\x97" - "\xc7\x0a\xf0\x6c\xd7\x63\x0b\xe9\xfe\x1a\x2f\xcc\x87\xbe\xaf\xc6" - "\xf2\x72\x19\x03\x82\xe3\x8b\xb6\x31\x8d\x58\x2e\xf2\x58\xe2\x31" - "\xc0\xe3\x49\xd1\x68\xa9\x29\x84\x46\x4d\x4c\x1f\x9d\x4e\x87\x22" - "\x64\x79\xae\x2d\x7f\x8a\x92\xc5\xb6\xe4\x71\x39\x13\x64\x20\x0f" - "\xdb\xc3\xd3\xee\xb3\x65\x4c\x19\x57\x94\x97\x32\x5b\x5d\xa6\x65" - "\xcc\xe4\x6b\x7c\xb8\xfd\x64\x43\x3d\xf9\xe1\x36\xd8\x8a\x2e\x25" - "\x3f\x96\xae\x73\x93\x5f\xf2\x0d\x6c\xe5\xae\x8a\xf3\x44\x01\xa6" - "\xe1\x62\xf4\x69\xd9\xee\xa2\x39\x90\xc1\x73\x56\x8a\x2f\xeb\x90" - "\xce\x31\x6a\x99\x17\xc1\xf3\x45\x6c\xf3\x7a\xe2\xda\xdb\xf0\xab" - "\xf4\xc4\xed\x9b\xf8\xd0\xad\x76\x01\x58\x6d\x46\x5b\xd8\x2e\x16" - "\x5c\xbe\x48\x04\x98\x2e\x59\x45\xe8\x6f\x94\x63\x1b\x19\xf9\x7c" - "\x98\x03\xd2\x94\x6d\xb8\x0c\xed\xcf\xdf\xa5\xcb\xaf\x0c\x3c\x27" - "\xb9\x29\x55\xe1\xe3\xb0\xf2\xfa\x9c\x29\xb8\xf6\xb6\x47\x61\x03" - "\x54\x1a\x30\x01\x6b\xa8\x1e\x7b\x4e\xc2\xfb\xba\xbe\x82\xc1\xf5" - "\x7b\x0a\x2c\x31\x2a\xce\x1d\xc6\x75\x69\x9d\x16\xcc\xec\xf7\x05" - "\xc0\xbb\xe1\x6b\x12\xd9\x57\x20\x13\xfc\xc6\xb1\x2e\xfb\xdf\x55" - "\x38\x82\xee\x0a\x2d\xe8\x43\xdf\x25\x2a\x9d\xb9\x8b\x65\x26\xec" - "\xcf\x65\x4e\x63\x2e\x93\x73\xa0\x46\xa5\xca\x86\x59\x26\xf7\xf8" - "\xce\x3b\x4c\x04\x39\x3d\xff\xe6\x24\x69\x97\xf8\x82\x8e\x18\x52" - "\xfe\x99\xcb\x7e\x63\xc8\x55\xde\x63\xb1\xac\x11\x1e\x5e\x5f\xb3" - "\xf8\x85\x87\xf7\x5b\xe4\x7c\x41\xa7\xc9\x55\xdc\x53\xca\x71\x48" - "\xa5\xde\x83\x7a\xd5\x5c\x11\x50\x73\x05\xea\x87\x2d\x9f\x8d\x39" - "\x21\xe6\x34\x2d\x5b\xc7\xf8\x33\x6d\x78\x0d\x37\x08\x5a\xb9\x78" - "\x6e\x64\xfa\xc4\xbf\xe5\xe1\x7d\x7e\x6e\xab\xc5\x8f\x36\x87\xb6" - "\x4b\x0b\xba\x37\x39\xd0\x2e\x0d\xed\x2a\x3a\xc3\xe3\xc4\xc7\xfe" - "\x17\x18\x63\x23\x65\xac\x5d\x69\x63\x17\xee\x0a\x6d\x23\xcb\x7c" - "\xd5\x86\xc2\x0f\xa3\xb5\x51\x68\xdc\x46\xa6\x41\xe1\x36\x7d\x8c" - "\x49\x3c\x59\x66\x74\x51\x61\xe6\xf0\x35\xec\xf7\xb0\xbb\x08\x7c" - "\x34\x8d\xfb\x10\x73\x66\x25\xe3\x19\xad\xbf\x18\x9e\x82\xf5\x52" - "\x8e\x65\x4d\x69\x76\x8f\xe3\xa5\xd4\xe8\xf4\x7e\xe9\x91\xcb\xd3" - "\xfb\xa5\x71\x5c\x9e\xf1\x60\x3f\x10\x8b\x1f\x06\x3a\xf8\x16\x36" - "\x5a\x59\xb4\x7a\x87\xaf\xa9\x67\xbc\xa2\xbe\x83\xdc\xe9\xaa\xd0" - "\xe5\x0e\xf8\x50\xcc\xc1\x8f\xe5\x10\x70\x6b\x36\x64\x90\x25\xc6" - "\x16\x2b\x65\x82\x26\x2a\xa3\xc1\xb0\xac\xa9\x64\xbf\x8b\x69\xa8" - "\x3f\xea\x7b\xd0\xd8\x06\x1a\xe5\x05\xd7\xde\x7e\xb3\x25\x86\xa6" - "\x7a\x62\x6f\x8f\xb7\x14\xf9\xc7\x32\x0d\x01\xb3\x08\x63\xf7\x13" - "\xb6\x4d\x55\x6c\xac\xe5\x98\xff\x5f\x95\xeb\x79\x9e\xb8\xdd\x79" - "\x2a\x7e\xd6\xf2\x4c\x37\x6d\x38\x6e\xac\x6b\xe2\x39\xcf\x4d\x9f" - "\xea\xeb\x55\xd7\x6f\x17\xeb\xf7\x41\x5e\x5b\x84\x6d\x95\x05\xba" - "\xe3\x0a\x8e\x43\xae\x89\xf8\x7d\x34\xc0\x27\xca\x27\xc4\xe0\x13" - "\x94\xdf\x13\x9d\x07\x96\xff\xf1\xf2\x3c\xb0\x5c\xee\x17\x33\xdd" - "\x95\x7d\xb2\xdc\x63\xe8\x26\x62\xed\xf5\xdb\x6d\x25\x5c\xff\xf2" - "\x75\xaa\x6e\xa6\x49\x1a\xaf\xd5\xcf\x04\x5d\x4a\x7b\x1c\x2b\x46" - "\x1b\x72\x80\xf9\xc5\x12\xa0\x18\x96\x45\xcc\x2b\x78\x37\x09\x72" - "\xa6\x5a\xad\x21\xee\x6b\x94\xdf\x88\x72\x2c\xb5\x79\xec\x79\x3b" - "\xd8\x87\xd3\x1b\xb7\xdb\x8d\x3c\xf3\xdd\xf4\xdb\xb1\x32\x8f\x79" - "\x77\x3b\x60\x1c\xaf\x1a\x81\x79\x59\xf9\x32\x25\xf0\x98\xe6\xb8" - "\x37\x3c\xae\x91\x96\x04\xbc\x39\x06\x0e\x6c\x9c\x15\x55\xfd\x73" - "\x91\x23\x0d\xb2\x42\xc8\xf9\x10\x73\xd1\xe8\x6e\xd0\xee\xe7\x5a" - "\x70\xcf\xc5\x09\x56\xe2\x36\x5f\x5c\x3b\x6a\xcf\x4f\xee\x20\xd3" - "\xff\x63\x7d\x9a\x0a\xee\xa2\xa4\x35\xdf\x31\xd1\xff\x9e\x44\x1a" - "\xd3\xc1\x4d\x2b\x76\x29\xda\xad\xe8\x30\xfa\xc7\x4d\xcb\x67\x72" - "\x7f\xf0\xfa\xdb\x1c\xbf\xf8\x52\xad\x11\x16\x41\xfe\xe5\x38\xd5" - "\xfb\xa5\x45\x91\xeb\x3e\xac\xc3\xdb\x16\x2d\xb3\xe5\x2c\x59\xb1" - "\x78\xcc\x98\x30\xfb\xc8\x24\xcf\x75\x38\x8a\xac\x6a\x0e\x2d\x9a" - "\x69\xe0\xcd\xba\x08\x9e\xd1\xfe\xa5\x97\xc4\xf9\x9e\x99\xa5\xbb" - "\xee\x66\xa5\xd2\xc0\xfd\x9d\x34\xf3\xce\x90\xc7\xbb\x69\xe6\x5d" - "\x77\x67\x3d\x9a\xbb\x20\x67\x65\x48\xea\x3d\xa1\x6b\x72\x15\xdb" - "\x51\x77\xec\xa8\x07\x21\x2b\x62\x66\xbf\xcc\xf3\xc9\xca\x07\x4a" - "\xfc\xe2\xef\x90\xd7\x93\x30\xc6\xb2\x5a\x0a\xfd\xd4\x02\x59\x26" - "\xae\x67\x19\x3e\x4c\x9d\x57\x83\x0e\x05\xde\xb2\xa0\xed\x1e\xe8" - "\x72\x17\x78\x4d\x06\xe5\x72\x5b\xab\x39\xf6\xec\xbe\xc9\x4a\xaf" - "\x58\x69\x43\xfa\xd5\xb8\xce\xc0\x75\x28\xae\xb3\x6c\x8b\x61\xeb" - "\xb0\x7f\xf0\x72\xf6\x0f\x5e\xc9\x78\xc4\xdc\xe1\x2d\xa5\x3b\x96" - "\xb2\x9e\x5e\xd4\xce\x7a\x87\x9b\x56\x96\xf1\xfe\x00\xe7\x45\x99" - "\x31\xb6\xe7\x28\x95\xaf\x42\xee\xab\xac\xb4\x89\xf2\x7d\x93\xc5" - "\x8e\x4c\xfe\x76\xcb\x58\xa4\xbf\x12\x1b\x73\x82\x62\xad\xc3\xbe" - "\xdf\xe3\x58\x89\xf9\x2f\x57\x8e\x8d\xc1\xbe\xf7\xc6\xba\x06\x8f" - "\xf9\x01\x5d\x04\xba\x20\x74\x91\xac\xa2\xf5\x84\x7b\xd3\x80\x1e" - "\xb2\xb2\xad\x5f\xa7\xd5\x28\x1e\xcf\x6e\x83\xdf\x71\xdf\x65\xf0" - "\x63\x58\x6c\xb0\xc5\x85\xb9\x4b\x73\x73\x6c\xe3\x96\xc5\x53\x48" - "\x64\xb0\xbc\xdc\xc5\xb6\xa5\xb9\x2f\xbe\x94\xbb\x4c\x46\xf5\xe2" - "\xb7\x61\xf3\x79\x92\x88\xff\x75\x81\x71\x66\xc5\x36\x8a\xe9\xb8" - "\xea\x11\x8e\x27\x25\xd6\xff\x9a\x7d\x18\xbb\x94\x2d\xe1\x49\x0e" - "\xb7\x25\x5e\xee\x50\x3a\xdc\xbe\x14\x65\xc7\xbc\xbc\x92\x9f\x4f" - "\xd2\x2a\xff\x40\x0c\xea\x55\xfb\xf8\x3b\x08\x3a\x7d\xda\x7b\x1c" - "\xab\x76\x19\xf4\x71\x53\xb1\x71\x8e\xa0\x4b\xca\x09\xcc\xa5\x90" - "\x73\x61\xf3\xa8\xfa\x9e\xdb\xaa\xbd\xbc\xc7\x2a\xd7\x64\xe3\xf6" - "\xa5\x72\x5d\x0c\xf3\x14\xca\xa3\x1f\x52\x20\x1f\x59\x8e\x95\x19" - "\xf0\x50\x67\x15\xd7\xa7\xdb\x38\xdf\x3c\x4d\x2f\xcb\x3d\xeb\x60" - "\xd9\xbe\x54\x96\x1d\x77\x48\x9d\x03\x70\xe4\x3e\x56\x71\x0a\xeb" - "\x8f\x32\x0e\x3a\x60\xf1\x1a\x2c\x64\x40\x1a\x7f\xfb\x8f\xd3\x54" - "\x5c\xab\x95\xd2\x4f\x10\x75\xc1\x1e\x7a\x39\x67\xc0\x2f\xbb\x38" - "\x85\x75\x4a\x86\xeb\xa6\x97\x93\x19\x9e\x8a\xdb\xf5\x32\x70\x29" - "\xda\x33\xa0\x1b\xbd\xdc\x1c\x62\x73\x01\x1f\x85\xa7\x17\xb8\xc8" - "\x18\x91\xca\x6f\x4e\xb6\x9b\xe5\x64\x95\xde\x76\xa3\x3d\x80\xd7" - "\x0e\x9e\xab\x32\xf6\x5d\xdd\x7a\xbb\x19\x3f\xc6\x3d\x14\x67\x85" - "\xef\x2a\x96\x4b\x18\xc3\xc5\x89\x21\x63\x98\xd7\x5c\x86\x20\x6d" - "\xec\x80\x3f\xee\xaa\xfc\x48\xf9\xf0\xe0\x82\x67\x9e\x67\x23\x7d" - "\x66\x6a\x8a\x8d\x65\x45\xd6\xa3\x0f\x4d\x7b\x3c\x6b\xda\x9c\x79" - "\xb3\xe7\x4a\xff\xfb\xfe\xf7\xe9\x8b\xa3\x67\x08\xe7\xab\x44\xf0" - "\x46\x32\xfa\x6b\xc8\x49\x2a\x71\xab\xf8\xcc\xc5\x7b\xc2\xe3\x33" - "\x17\x3b\xf1\x3b\x8e\x1f\x34\x93\xd5\x6e\xfc\xa0\x47\x96\x1c\xd3" - "\xf9\xa5\x0b\xf8\x1e\x1b\xe0\x97\x12\xb9\xe6\xcd\x7e\x09\x6a\x2d" - "\xb5\x18\xf2\x7f\xd5\xd8\xd0\x77\x03\xb6\xdf\xea\x84\x7e\xdb\xaf" - "\x5f\x16\xac\x9e\x64\xd8\x81\x48\x9b\x08\x1b\x30\x8e\x6d\x40\xb5" - "\xf6\x53\x22\x75\xac\x48\x5b\x6d\xc0\x4e\x33\x93\x61\x03\x72\x6c" - "\x48\xde\xf7\x54\x63\x74\x75\x61\x88\x8d\xe5\x95\xf1\x02\x2f\x2a" - "\x9b\x90\xcb\xc9\xb5\x36\xb3\x27\x89\xd7\x9f\xa1\xd7\x26\x63\x8e" - "\xc7\xbc\xd3\x23\x44\x9c\x27\x49\xc7\xe9\x10\xaf\x47\xb3\xbe\xab" - "\xec\xbd\xe2\x49\x2c\x7f\xc5\xda\x51\x0f\xce\x09\xc8\x58\x6a\x90" - "\xbd\xab\xdb\x07\x78\xae\xc4\xcd\x7d\xc9\x34\x00\x1f\x74\x80\x0e" - "\xa6\x81\x36\x97\x50\x7f\x9b\xf5\x75\x0c\x63\x0d\x43\xd5\x55\x72" - "\x62\xb0\xf6\x45\x6f\x5b\x49\xc6\x57\xb6\x8d\xbf\x99\x83\x71\x61" - "\xb4\xf1\xd2\xf6\x95\x54\x45\xb4\x2f\xf3\xd2\xf6\x95\x34\xf6\xef" - "\xbb\xf4\xaf\x4b\x94\x9c\xe0\x76\x32\x1f\xa0\x9d\x47\x63\xad\xe6" - "\x6f\x85\xdc\xa7\x44\x93\xab\xc3\xd7\x68\xfa\x19\x10\xfb\x3d\x4d" - "\xa3\xa5\x9d\xe6\xdb\xac\x05\xf3\x36\x3b\xf0\xc3\x95\xf5\xec\x01" - "\x5d\x55\xf8\x14\x7e\xf6\x89\x4d\x90\xbd\xbc\xd6\x32\xd8\xd9\x36" - "\xd0\xec\xb8\xb1\x0e\x80\xfb\x76\xb6\x27\xe7\x04\xa6\x0a\x4e\x67" - "\x1a\xc0\x26\xf1\x80\xaf\xda\x95\xde\x66\x5f\xd7\x2f\xb3\xbf\x35" - "\x35\x3b\x76\x0d\xd9\x8e\xd4\xdc\xc5\xe9\x35\xe8\x3b\xb9\x36\x28" - "\xbf\x91\x37\x08\xcc\xac\x40\x1a\x0d\x02\xf7\xb8\x01\x77\xb0\x73" - "\x90\xa1\x69\x4b\x16\xdb\xf2\x16\x2c\xce\x59\xb2\x70\x61\x8a\xed" - "\xa5\xc5\x4f\xe7\x2f\x79\xe6\x79\x16\xfc\xcb\x0a\x5f\xc2\xf8\x95" - "\xe3\x36\x7d\xe6\xcc\xac\x07\xe7\x3d\xf6\xa3\x30\x1d\xc0\x5c\xe9" - "\x08\x96\xc9\x6f\x64\xad\x7d\x6e\x55\x8f\xa3\x14\xfd\xff\x6c\x91" - "\x9a\x6f\x4a\x31\xff\x3f\x93\xa0\x74\xad\x27\x3a\xd5\xd9\xcf\xd2" - "\xc6\x10\xb9\x36\x1c\xcf\x4d\xfc\xad\x83\x81\x35\x90\xd2\xca\x50" - "\x1d\xa2\x5b\x7e\xa7\xae\x74\x97\x11\x07\xa1\x70\x0c\x69\xa6\x31" - "\x95\x54\xa5\x89\x52\x37\x95\x1e\x85\xbd\x78\x1c\xef\x9b\xdc\x94" - "\x57\xad\xdb\x8f\xc7\x79\x8f\x95\xed\xc7\x00\x6c\xc9\x39\x2b\x9d" - "\x53\xb3\x56\xc6\xb0\x0f\xb1\xfc\x6e\x82\xff\xa2\xe8\xe0\x7d\x4e" - "\xde\x33\xe2\xef\x26\x54\x3c\x27\xed\xc9\x58\x99\x07\xf7\x15\xa7" - "\x48\xda\x56\x78\x6f\xab\x3b\x25\xbf\xdd\x08\xfb\x63\xcd\x58\x43" - "\xf7\xb4\xac\xb1\xc9\x33\xa9\x9b\x54\x7f\xb4\x73\x5f\x70\x7d\x59" - "\x2b\x9d\xaa\x0e\xf4\x01\xca\x5a\xd4\xba\xcf\x9a\xf9\x97\x5d\xcf" - "\x8e\x6b\x6f\x1c\x34\x06\xb9\xa3\x74\xd8\x66\x15\xaf\x98\xfd\xe0" - "\x3c\x86\x1f\x16\xfb\x64\x01\xee\xa1\x48\x9f\x2e\xe5\x97\xb0\xa6" - "\xd9\xf0\x07\xc1\x7d\x7b\xbf\xbe\xcc\xdf\xda\x80\x9d\x63\x2b\x59" - "\x33\xf4\x2c\xad\xd9\x56\x37\xc8\xba\xb2\x71\x06\x55\xf7\x9b\x1a" - "\xd6\xe3\x70\x8c\xee\xf7\x25\xc1\x33\x8f\xf1\x01\x7f\x30\xc7\x24" - "\xc3\x9f\x48\xfa\x90\x61\xce\xe2\xef\x79\x9c\x22\xc7\x8f\xe4\xf7" - "\x43\x6e\xe6\x35\x61\x47\x51\x93\xf4\x65\x73\xe4\x84\xe2\xa2\xf0" - "\x70\x8c\xe3\x75\x4b\x7e\x1f\x8a\x4b\xd1\x82\x97\x16\x4d\x28\x5a" - "\xb8\xc8\xf6\x4c\xde\xa2\x82\xac\x45\x32\x6e\xa8\x0c\x49\x5a\xb8" - "\xb2\x80\x57\xe9\x6f\x8d\x8f\x98\x2b\x74\xbf\xb3\x7e\xff\x1a\xe9" - "\x7b\xe6\xf8\x0c\xf4\xd0\x94\xef\xd9\xda\x36\x35\x1f\x3a\x3a\x2f" - "\xf5\xb3\x70\xf8\x0d\x3f\x0b\xf0\x55\x62\x95\x8a\x57\xae\xfb\x66" - "\x30\xdf\xad\x1d\x7d\x69\x99\xb5\xa9\xfd\x7e\x46\xec\xef\xd2\x97" - "\x29\xcf\x08\xc8\xd8\xd2\xaf\x71\xbf\x39\xd6\xb9\x8a\x1e\xe2\x3d" - "\x62\x9d\x9f\xd7\x66\x1b\xfc\x6c\xf8\xa8\x31\x2c\x3e\xa3\x30\xc1" - "\x17\xea\x9f\xb2\xf6\x43\xcc\x2d\xd6\xfe\x76\xbc\xac\x11\xe3\xee" - "\xd5\x9c\x8c\xc7\xae\x48\x3c\x80\xdf\x18\xa4\x87\xf8\xff\x18\xed" - "\x5c\x0b\xfd\x6f\xdd\x25\x3a\xde\x03\x0f\xcd\x84\x32\xb7\x2c\xb7" - "\x30\x9e\xa6\x2d\xc8\xcf\xe7\x71\xbd\x20\x37\xff\xa5\xa5\x4b\x96" - "\x65\x2d\x5a\xbc\x08\xa9\x0f\x2c\xe4\x70\xae\x32\xcb\x7d\xfa\x1b" - "\xdb\xe2\xdc\xdc\x1c\x95\xa4\x77\x43\xf8\xde\x88\xda\xff\x5e\x97" - "\xe6\xa6\x35\xbe\x01\xbd\x65\x5d\xb5\xd0\xd6\x1e\xc7\xef\xef\x72" - "\x4c\x4b\x9d\x62\x5d\x4e\xb8\x5d\xb0\xae\xd0\xe0\x07\xd9\x7f\x76" - "\xf6\x11\x79\xf3\x93\x6e\x21\xf7\x12\xd0\x67\xaf\xfc\x91\xbf\x7b" - "\xea\xa6\x57\x8e\xb2\x3e\x1c\x02\x67\x6f\x3f\x2d\xd7\x3e\x21\xbf" - "\x9b\xc9\xf0\xf8\x7b\x6f\x7c\x36\x1b\xef\xc1\xff\x6b\x4a\x15\xff" - "\xaf\xeb\xe7\xff\x6e\x2d\x16\x36\xce\xba\x4e\x43\x0f\x0e\x1f\x33" - "\xaf\xd0\xa5\x63\x89\x7d\x06\x5f\xb1\x1a\xb4\x35\xfa\x59\xf1\xd6" - "\x2b\xbf\x31\xd6\x26\xeb\xf4\xd8\xe2\x7c\xcf\x65\x59\xc7\x15\xc3" - "\xaf\x9a\xca\x3e\xd0\x27\xe9\x95\x75\x8a\x5f\x5e\xc9\x0e\xf1\xe5" - "\x49\x3c\x4d\xaf\xe8\xf6\xec\x2b\x45\x06\x7e\x68\xe7\x44\x4e\x63" - "\x18\x6a\xec\xaf\x0d\x28\xde\x79\xa5\xc6\xa0\x2d\xdb\x8d\x78\xde" - "\x3b\x30\xa7\xaf\x9b\xc9\x73\x9d\x7e\x36\xbd\x8f\xdb\x0f\x38\x29" - "\x06\x1c\xe4\xc5\xb3\xb9\xc9\xa0\x95\x91\x27\x94\x27\xa6\x2d\x28" - "\x80\x51\xb7\x68\xe1\xc2\xdc\xa5\xcb\x8c\x78\xbd\xc9\x4b\xf2\x73" - "\x54\x7c\xde\xfb\xd0\xfd\x2b\x30\x02\xa7\x70\x88\x5f\xa4\xaa\xdb" - "\x08\x1b\x20\x85\xed\x70\xe9\xef\x25\xf5\xff\xf5\xf7\xd4\xea\xb6" - "\xc0\x49\xfa\xc9\x44\x5c\x21\x0f\x5e\xbd\xa0\xf4\xb2\xb8\x73\x3d" - "\x8e\x57\xf3\x0d\xbd\xac\x7b\xe8\x24\xd8\xd7\xaf\x16\x1b\xdf\x61" - "\x32\x74\x05\x3e\x8b\xe2\x5c\xcc\xb1\xcf\xd7\x6f\x0b\x96\xef\xce" - "\x14\xf1\x5b\xca\xa0\x93\x24\x30\xdf\x5f\xd5\xc5\x71\xd1\x39\x5e" - "\xcc\xab\x47\x59\x97\x61\x59\xc2\x31\xce\x3b\xe8\xd5\x6a\xfe\x76" - "\xb3\x9b\xd6\xd7\x78\xe2\x76\x67\xae\x5b\x45\xe6\x9d\x5b\xe4\xf7" - "\x6f\xdd\x4d\xf5\x4c\xc7\x57\x3b\x3e\x28\x56\xdf\xd3\xe6\xef\x10" - "\x6f\xc4\x3b\xd8\xc3\x0d\xfa\x5a\x72\xbe\xbe\x8e\x97\xdf\xe3\xf8" - "\x09\xf4\xbf\x84\x46\xc5\x97\x5b\xc5\xb7\x4b\xa9\x88\xbf\xcf\xa6" - "\x62\xbd\x34\xd4\x8b\xb2\x6a\xd6\x63\x3c\xd0\x7f\xa0\x67\xbf\x9a" - "\x2f\xca\xab\x49\xc5\x89\x66\xbe\x78\x75\x3e\xb7\x13\xf0\x0a\x79" - "\x7d\x87\xd7\x76\x74\xb8\x85\x6c\xff\x41\x8f\x1b\xcb\xba\x1c\x9e" - "\x33\x82\x17\xcf\xd4\x63\xee\x36\x63\xae\xf2\xe8\xdf\xfd\x99\xcb" - "\x6b\x9e\xc3\xd7\xb8\x31\x17\xdd\x24\xb2\xfc\x89\xbc\xd7\x70\x95" - "\xf1\x5d\x25\x5e\xf7\x04\x6e\x7b\x06\xf6\x10\x50\x1e\x34\x01\x3f" - "\x96\x76\xd0\x4f\xa4\xaf\x3f\xf3\x22\xd3\xae\x17\xf4\xe2\xef\xef" - "\x8a\x8b\x67\x1a\x60\x87\x5e\x75\x8a\x7e\xf2\x39\xd3\x8d\xf7\xfd" - "\xd8\x5f\x07\x69\x16\x8e\x1f\x8d\xfe\xf9\x88\x69\xc6\xb8\x88\xb2" - "\xad\xd9\xfe\x9e\xcc\xef\xf3\x19\x42\x96\x47\xab\x8b\xa1\xfb\x2d" - "\xe4\xb1\x5c\x3e\x8f\xed\x39\xfe\xe6\x07\xdf\xdb\x73\x44\x50\xd2" - "\x7c\x15\xd3\xbc\x7c\xde\xea\x4e\x11\xfc\xd2\x41\xe2\xa8\x97\xe8" - "\x4b\x8d\xfc\x3e\x2d\x86\xf1\xd6\xec\x67\xf8\x9c\x63\x3d\xb9\x8a" - "\xca\x08\xf5\x9a\x37\xad\xa2\x44\x3e\x17\xca\xdf\xb3\x68\xf5\xd6" - "\x50\x6b\x41\x0d\xfd\xa7\xbf\x8a\x9c\xcb\xf9\x9c\x7f\xb9\xff\x4f" - "\x45\x55\xbc\x97\x12\x87\xfb\x77\x6d\x8f\x73\x5d\x65\x55\x7f\x3a" - "\xf6\x67\xfa\x93\xf3\xcf\x64\xfb\xb1\x7c\xde\xd5\x9c\xf9\x9f\xd4" - "\x9c\xf6\x9f\x64\xef\x10\x41\xb6\x09\x4a\x5e\xe0\x3a\xca\x00\xab" - "\x9e\xcf\x53\x26\x06\xbb\xad\xf1\x68\xbf\x69\x4e\x11\x51\xab\xd7" - "\x03\x1e\xfa\x3d\xe3\x38\xae\xf6\x3c\x99\x9d\x8b\xff\x20\xef\x95" - "\xae\x7e\xa6\xde\x95\xd3\xce\x7a\x92\x9f\xcf\x8f\xf2\xde\x13\x74" - "\xdd\x60\x05\xe3\x18\x50\x78\xf3\x77\xa4\x8d\xf2\xd0\xa3\xf4\xf2" - "\x65\x72\x8d\x77\x27\xd3\x03\x38\xb5\xcc\x55\x34\x69\x6e\x07\x4d" - "\x1f\xd7\xe9\x93\x19\x4a\x9f\xb2\x74\xa6\x0f\xc7\x1e\x0c\xa2\xbf" - "\x80\x5b\x1a\x68\x10\x34\xea\x00\xce\x66\x7d\xdd\xce\xbc\xe9\x3c" - "\x25\x38\x17\xf3\xb7\x89\xca\xdf\xb2\x64\x98\xcc\xc1\x8b\x67\x1b" - "\x2a\x2e\x90\x89\xfb\x8d\xd7\xe7\x2b\xe4\x7b\x49\xf3\x0d\xdc\x67" - "\xa1\xdf\x33\x67\x3e\xe4\x6f\x9a\xa3\xbf\xca\x80\xc3\x58\xf4\x55" - "\x3d\x5f\x15\x6f\x57\xb3\x2e\x6f\xec\xe3\x0e\xa4\x83\xb7\xfd\xfc" - "\xdd\x41\xb9\x2e\x51\x3e\x36\x08\xde\x66\x7b\xbe\xf6\x35\x4a\x08" - "\x3a\x5e\xf1\xec\x84\xac\xa9\xc1\x5c\x56\x3b\x82\x12\x79\x2d\x6b" - "\xbb\xf4\x1f\x5e\x9f\x6c\xc8\x9e\xf5\x23\xf9\x4c\x52\xf9\x5c\x4d" - "\x7e\x5f\x6e\x77\x81\xce\xe7\x05\xc8\x33\xd3\x4d\xd7\xee\x52\xf2" - "\x77\x7d\xa6\x31\x96\xa0\x27\x79\x0c\xfe\xc7\xf8\xcc\xf0\x30\xbf" - "\x4b\x3f\x04\x37\x6c\x58\x8b\x60\xdf\xce\x81\x6f\xaa\xad\xaf\x34" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 21:30:22 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E802210656CA; Thu, 14 Jan 2010 21:30:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D62FB8FC14; Thu, 14 Jan 2010 21:30: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 o0ELUMjE051501; Thu, 14 Jan 2010 21:30:22 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELUMr9051498; Thu, 14 Jan 2010 21:30:22 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001142130.o0ELUMr9051498@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 14 Jan 2010 21:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202306 - in stable/7/sys/dev: mxge ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:30:23 -0000 Author: gallatin Date: Thu Jan 14 21:30:22 2010 New Revision: 202306 URL: http://svn.freebsd.org/changeset/base/202306 Log: MFC: r194747,r202120: Update mxge(4) firmware to 1.4.48b (latest available) from Myricom. Modified: stable/7/sys/dev/mxge/eth_z8e.h stable/7/sys/dev/mxge/ethp_z8e.h stable/7/sys/dev/mxge/rss_eth_z8e.h stable/7/sys/dev/mxge/rss_ethp_z8e.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ste/if_ste.c (props changed) stable/7/sys/dev/ste/if_stereg.h (props changed) Modified: stable/7/sys/dev/mxge/eth_z8e.h ============================================================================== --- stable/7/sys/dev/mxge/eth_z8e.h Thu Jan 14 21:30:06 2010 (r202305) +++ stable/7/sys/dev/mxge/eth_z8e.h Thu Jan 14 21:30:22 2010 (r202306) @@ -28,6951 +28,7255 @@ POSSIBILITY OF SUCH DAMAGE. $FreeBSD$ ***************************************************************************/ -static unsigned int eth_z8e_uncompressed_length = 357812 ; -static unsigned int eth_z8e_length = 111096 ; -static unsigned char eth_z8e[111096 + 1] = - "\x78\x9c\xec\xbd\x7f\x78\x54\xd5\xb5\x37\xbe\x72\x32\xc0\x24\x0d" - "\xcc\x88\x29\x1d\x11\x75\x50\xb4\xd1\xf2\x23\x2a\xb6\x68\x41\xa3" - "\x80\xc5\x5e\x7e\xa4\x8a\x6d\xaa\x68\x82\x26\x34\x68\x84\x08\x11" - "\x07\x08\x99\x61\xc0\x36\x41\x20\x51\x02\x44\x08\x49\x6c\x43\x8b" - "\x14\x24\x56\xda\xd2\xb7\x56\xa7\x25\xbe\x0f\xbd\x0d\x19\x6e\xbf" - "\xd0\x37\x57\xf1\x76\xe4\x46\x9a\x72\x13\x18\xc9\x40\xc6\x64\x66" - "\xf6\xfb\x59\x7b\x9f\x93\xcc\x0c\x13\x94\xdb\xfb\x7c\xdf\x7f\x9a" - "\xe7\x99\x9c\x73\xf6\x8f\xb5\xd7\x5e\x7b\xed\xb5\xd7\xda\x3f\xd6" - "\x26\xfa\x07\xfe\xb4\xbd\xbe\x7f\x24\xfb\x3f\xff\xfe\xf9\xf7\xcf" - "\xbf\x7f\xfe\xfd\xf3\xef\x9f\x7f\xff\xfc\xfb\x7f\xf3\x77\x5e\x33" - "\xd1\x1f\xaa\x88\x7a\xdc\x66\x9b\x8f\xba\xde\xd9\xbe\x45\x84\x10" - "\x9c\xe4\x23\xb3\x8d\x9f\xfa\x8f\x5e\x45\xb8\x56\x45\xe6\x1b\xad" - "\x94\x36\x7d\x17\x51\xf5\x28\xd1\xb9\x65\x9b\xf0\xaf\xdb\x26\x3a" - "\x67\xec\x26\x6a\x1e\x47\xb4\x65\x94\x08\x00\xce\x02\x1f\x7d\x7f" - "\x1c\xc3\x59\x87\x6f\x8e\x5f\x3f\x4a\xf8\x11\x5e\x82\xf0\x5a\x0e" - "\x5f\x3b\x0a\xb0\xd2\x89\xdc\xdb\x44\x30\x0a\xae\x99\xf3\x33\xcc" - "\x19\x63\x25\x3e\x8d\x71\x70\x18\xc6\x21\x1f\x3d\x96\x7e\x19\x18" - "\x69\x06\x5e\x01\x8d\x92\x18\x5e\xb7\x9b\x6c\x01\xb7\xe7\xcb\xc8" - "\x1b\x40\x9d\x32\x38\x6f\x25\xd2\x08\x37\x25\x37\x3b\x42\x64\xbf" - "\x91\x92\x4e\x53\xca\xdf\xf1\xd4\xf0\xfc\x88\xeb\xbb\x4e\xe5\x1b" - "\xc7\x30\x90\x37\xa9\xc7\x9d\x92\xd9\x9f\x17\xb0\xed\x65\x64\x42" - "\xda\xb7\x02\x9a\x47\x53\x69\xad\x29\x7a\x5a\x0d\x69\x17\x18\x69" - "\x55\x9c\xf6\x90\x1e\xf7\x25\xc4\x39\x62\xe3\x4c\xaf\xea\x71\x69" - "\x88\xab\x8e\xc3\xcf\xe4\xed\x0d\x11\xca\x61\x5c\xec\x3e\x3c\x0f" - "\xa3\x65\x74\xdc\x18\xa7\x66\xa4\x77\x71\xfa\x19\x76\x11\x9a\x6f" - "\x27\x89\x0b\xd3\x0e\x69\x67\x1d\x6e\x50\x69\xf1\x3e\x86\xf3\xeb" - "\xef\x76\xbc\xcb\x70\xbd\xdc\xab\x7a\xdc\xa9\x69\xb1\x38\x11\xe9" - "\x71\x23\x11\x97\x11\x1b\xf7\x6e\xa6\x1e\xf7\x15\xc4\xcd\x88\x8d" - "\x4b\x32\xf2\xd9\x10\x97\x67\xc4\x45\xb7\x93\xe2\x38\x13\x7e\x43" - "\xcc\x44\x43\xf1\x1b\x66\x36\xda\x6e\xb9\x4d\x44\x9c\xd7\x90\x49" - "\x6c\xd8\xd2\x11\x71\x0b\xf2\x3a\x82\x64\x1f\x4d\xce\x53\x94\x7a" - "\x0c\x70\x69\xf3\x2a\x32\x3b\x8b\x45\xd0\xeb\xe8\xa4\x56\x7f\x27" - "\x39\xfd\xa2\xc3\x1b\xba\x40\x65\x17\xc8\xec\x0d\x75\x51\xd9\xf3" - "\x64\x6b\x2e\xfd\x84\x12\xf1\x45\x44\x13\xe4\x1c\xc3\x79\xdb\xa9" - "\xb5\xb6\x9d\x9c\xb5\xb1\x79\x9d\xd7\x91\xed\x28\xbe\x41\x73\x0b" - "\xe3\xd1\x6c\x0f\x51\x28\x75\x4b\x47\xe9\x6b\x64\x72\x8e\x25\xed" - "\x68\xbe\x47\xc7\xe5\x4b\x35\x8c\xcb\xfa\x33\x64\xfe\xc9\x22\xb4" - "\xfd\x19\xc6\x77\x67\xc7\x81\x55\x41\xed\xb0\x6d\x36\x1d\xb6\x9d" - "\xa4\x66\xdb\x34\x6a\x76\xcc\xa0\xcd\x67\x28\xed\x70\x70\x2a\x35" - "\x9b\x1e\x44\xdf\x98\x41\xde\x4e\xbc\xdb\xc3\x48\x13\x20\xfb\x0a" - "\x42\xbb\x7e\xa9\xbc\xfa\x19\x32\xfb\x14\x4c\xb4\xe7\x97\xaa\x7f" - "\x5f\x42\xc4\x34\xe3\xef\x44\xf5\x58\x7e\x0d\xd9\x80\x5f\x07\x70" - "\xb9\x1b\xb8\x1c\x1d\x67\xa3\x4c\xe0\x3c\xcc\x5b\x13\x22\x53\x29" - "\xa5\x0c\xd2\x27\xd2\x23\x6e\xd9\x37\x3b\xeb\xb6\x89\x0e\xe6\xad" - "\xee\xd5\x39\xe8\x5f\x69\x26\x94\xdd\xc8\xe5\x6d\x46\x1f\x75\xbe" - "\x4e\xa6\xee\x17\x73\x92\xea\xb7\x89\x76\xc4\xd9\x8d\x38\xf0\x7b" - "\x3b\xe2\x3b\x26\xa5\x93\xd5\x1b\xca\xa2\xf7\x7a\x3b\x4c\x0c\x63" - "\x44\x80\x92\x18\x9e\xc5\x41\xc9\xa8\xcf\x10\xe0\xf3\x69\x3d\xc2" - "\x6f\x42\x3a\xe4\x47\xfb\x57\x04\x38\xbf\xf8\xca\xe3\x9f\x46\xbe" - "\xf2\xb8\x3f\xb2\xfd\xf1\xf3\x62\xfb\xe3\xdd\xe1\xed\x8f\x07\x9c" - "\x2b\xc9\x1c\xfe\xca\xe3\x17\x5a\x8b\x65\x1b\x58\x5b\x8b\xd1\x06" - "\x61\x32\xaf\xe9\x22\xeb\x93\xcf\xa3\xed\x43\x1f\xd1\x9a\xc5\x64" - "\x8b\xa4\xec\x68\xf0\x86\x4e\xd0\x93\xa5\x24\xf0\xde\x94\xa8\x7e" - "\xdd\xa9\xb5\x19\x8a\x67\xcd\x5c\xa7\x36\x9f\xf6\xaa\x8f\xcb\xf5" - "\xa7\x34\x66\xe0\x37\x1e\xbf\x4c\xfc\x26\x8b\xd4\xda\xc9\xa0\x95" - "\x73\xc4\xda\x24\xaa\xeb\x25\x9a\x14\xa1\x24\x34\x51\x00\xf8\x5b" - "\x07\xa1\xdb\x98\xc8\x86\x37\x9b\xbe\xea\xa2\xb2\x9e\x9e\x42\x62" - "\x99\xc2\xf2\x84\xe5\x4b\x8f\x7b\x78\x96\x4f\xdb\x62\x97\xbc\xbf" - "\x4d\x04\x44\xea\x9b\x4d\x08\xef\x08\xac\x2e\x4c\xf2\xaf\x2e\xd4" - "\xba\x53\xdf\x7c\x1b\x69\xf2\x91\x26\x47\xa7\x61\x07\xc3\x42\x3f" - "\xf1\x0f\x0f\x51\x32\x60\x16\xff\xfa\x62\x9b\x69\xd7\x36\x71\x12" - "\xe9\x36\xf6\xc3\x02\x6c\xc0\x01\xfd\x87\x37\x18\x61\xa0\x75\xfb" - "\x26\xa4\xe3\xfc\xde\x60\x16\xcb\x5d\x9f\xb7\xa8\x83\x2c\x21\x4a" - "\x15\x7d\xaa\x3c\xa4\xe9\x60\xf9\x38\x3c\x48\x43\x7b\xdc\x94\xcd" - "\xb0\x39\x9f\xb7\xb3\x83\x90\xef\x6d\xe1\x2c\x84\x5c\xa2\xb9\x3d" - "\xa2\x30\x09\xb2\xb8\xfd\x30\xf2\xab\xb2\x47\x98\x0d\x1c\xb9\x0c" - "\x6e\x6b\x89\x27\xf8\xe1\x70\x51\x90\x86\xd7\x50\x32\xf2\x3d\xc2" - "\xf0\x18\x16\xf8\xc0\x87\xba\xbe\x7d\xb8\xc8\x4f\x11\x11\x03\xd3" - "\xa7\xc3\xcb\x89\x81\x87\x70\x01\x78\xcc\x7f\xcd\xc8\x33\xbc\x41" - "\xc2\x7b\xf8\xd7\x11\x86\x17\x24\x93\x5d\xe2\xfb\x5d\x86\xd1\xc3" - "\x32\x0d\x30\x3d\x2b\x1e\xa0\x4e\x1a\xe1\xf1\x3b\x0b\x93\x5b\x4b" - "\x89\x38\xff\x81\xb2\x8e\x21\xa2\x3b\x27\x99\x79\x8e\xe3\xbd\xa1" - "\xf3\x9c\xe6\x75\xd1\x5d\x98\x3c\xbc\x93\x4c\x8c\x33\xf2\x3b\x18" - "\xcf\xe8\xb6\x7c\x78\xe6\x77\xa7\xd1\x9c\xfb\xa7\x4f\xa3\xec\xef" - "\x3d\x8c\x7f\x73\xa7\xd1\x23\xf8\x65\xde\x3d\x21\xf3\xce\x6f\x4c" - "\xb9\x93\x72\x1e\x7c\x08\xa1\xd3\xa7\xdd\x9e\xf9\xad\x09\xd9\xd3" - "\x1f\x9a\x49\xdf\x99\x7f\x47\xe6\x1d\x77\xd0\xfd\x33\x67\xdf\x9e" - "\x99\xa9\x3f\x6f\xcf\xe4\x24\x8f\x4d\x99\xf9\xc8\x84\xec\x65\x4b" - "\x4b\x96\x4e\x98\xfb\xd0\xf4\xd8\xf1\xd0\x16\x59\x11\xa1\x3a\xf0" - "\x86\xe8\x9e\x45\x02\xf2\x01\xfd\xc0\xcf\x7d\xc1\x53\x76\x1e\xfd" - "\xdc\x7a\x73\x3d\xb7\x8f\x94\x91\x23\x4e\xa2\x6f\x9b\x7a\xdc\x16" - "\x17\xe8\x54\xc3\x74\xc2\xb8\x83\x34\xe9\xaf\x21\xee\x63\x5d\x2e" - "\x73\x7c\x43\x5c\xfc\x1a\xc4\x9f\x8e\x8a\xf7\xc4\xc5\x2f\x44\xfc" - "\x7f\xe9\xf1\xa0\xb1\xc5\x17\x1b\x7f\x15\xe4\xfe\x88\x73\x9b\x11" - "\x3f\xa2\x98\x92\x81\xab\x7f\x9d\x1c\xab\xad\xe6\x7e\x3e\x03\x1f" - "\x37\x97\x66\x91\xf8\xc9\xac\x24\xb4\x4b\x12\xc6\x38\xe4\xb3\x14" - "\x82\xdf\x02\x91\xd4\xc6\x29\xa0\x3f\xa9\x30\xeb\x7c\xc1\xdf\x1b" - "\x1a\xef\x16\x4e\x84\xad\x92\x61\x8f\x72\x18\xda\x20\xb9\xa7\xbb" - "\x90\xc4\x6a\x19\x9e\x8c\xf0\x3f\xd6\x33\x0f\x70\xfa\x3e\x99\x7f" - "\x18\xc2\xde\xc0\xf7\xdd\x80\x79\x8f\x0e\x13\xe3\x6e\xfa\x21\xc0" - "\xfb\x66\x44\xe4\x90\x30\x9f\x6b\xc3\xfb\x54\xcf\xaa\x4e\x3a\x5d" - "\x4c\x9a\x0f\x71\x11\x27\x60\xf6\xf5\x97\xef\xe0\xbc\x28\xcb\xd4" - "\xd3\x57\x88\xb1\xce\x5a\xca\x63\x36\xc2\xee\x8e\xc2\xb1\x90\xcb" - "\xe4\xfe\x86\x7a\x77\x83\x26\x29\xa8\x6b\x20\x8e\x26\x56\xce\x53" - "\x29\x79\xba\xf1\x6e\xc0\xc9\x47\x7f\x82\x0c\x21\x8d\xeb\xe0\x1b" - "\x80\xa1\xd3\xf4\xaa\xc9\x71\xf9\xb3\x01\x9b\xfb\x27\xcb\x90\x64" - "\x1f\x59\x82\x46\x3b\xab\x36\xba\x2a\x3f\x36\xfd\xc8\xf1\xdd\x6e" - "\x4b\x12\xd3\x19\xcf\xe1\x48\x33\x0c\x7d\xd8\xc4\xf2\xf6\x70\x29" - "\xeb\x3b\x57\x55\xc7\xc1\x3f\x88\x74\xe9\x8c\xe3\x00\x4e\x96\xa0" - "\xae\x9f\xb4\x23\xbf\x19\x79\x8e\xc4\xe5\xe9\x40\x9e\x31\x42\xe5" - "\x49\x56\xf4\xb9\x24\x4f\x28\x0e\xaf\x31\x92\x76\x1b\x64\x1e\x13" - "\xfa\x60\x7f\x1e\xd9\x27\x63\xcb\xe5\xba\x41\x8f\x19\x99\x15\xc7" - "\x7f\xd0\x31\x2c\xe3\x98\x16\xa2\x6f\xd6\x97\xd0\x06\x77\x20\x6c" - "\x38\xf0\x98\xc6\xed\xc6\x7c\xe7\xf5\x07\x21\x33\x66\xa5\xa9\xb1" - "\x6f\xe4\xeb\x96\x52\xe2\xf7\x09\xfc\xce\xb0\x45\xdf\x6c\x9d\xe7" - "\x46\xbe\x8e\x27\x87\x97\x73\x38\x68\x8b\xb8\x7f\x89\x28\x98\x23" - "\xdf\x87\x2c\xd1\xf0\x1d\xd6\xcb\x18\x82\xef\x24\xe0\x7e\x0f\xe4" - "\x11\x78\x64\x16\xb7\xff\xe4\xd3\x74\xb5\x1e\x7f\xf5\x05\x4e\x8f" - "\xf7\xdb\xf5\xf7\xa4\x58\xbe\xbb\xba\x4b\x96\x2d\x79\x4f\xe5\x8f" - "\x28\x3e\x9b\x8e\xb8\x7f\xc7\xf3\x21\x3c\xdf\xc7\xf3\x3b\x78\xbe" - "\xee\xbc\x40\x36\x67\x18\xe3\xaf\xfa\xde\x84\xe7\xc3\x78\xae\xc4" - "\xf3\x11\x3c\x0b\x98\x5f\x20\x8f\x89\xdb\x18\x6d\xab\x78\x02\xb2" - "\x34\xa2\xfa\xc6\x30\x45\xcb\xab\xe7\xeb\x65\xaa\xfe\x22\xa2\xc2" - "\x54\x3a\x4d\xb5\x9b\x1e\xd6\x37\x8b\xe9\x92\x0d\xf8\x99\x5c\xbe" - "\x0e\x6b\x48\x02\x58\xa6\x04\xb0\x92\xa2\x61\xe1\x69\x2a\x0b\x08" - "\xe1\xa3\x91\x7e\xa6\x2b\xbe\x03\xa0\x09\xf4\x80\x91\xcd\x4c\xa7" - "\x81\xf4\x23\xf3\xa2\xda\x1b\x7a\x60\x7a\x66\x6c\x7b\x5b\x82\x4c" - "\xb3\x4a\x5d\x36\x30\xff\x4b\xbc\x85\xec\x3f\x43\x0d\x9e\x61\x19" - "\xc8\xb4\x48\x2e\xe5\xfe\x90\x0e\xfd\xff\x27\x7e\x86\xc1\x71\x81" - "\x94\x03\x99\x9c\x3f\xd9\x21\xe3\xaa\xa0\x6f\xb4\x19\x71\x5c\x76" - "\x54\xbe\x7d\x46\xbe\x48\x6a\xb5\x55\xe6\x5d\x5e\x98\xcc\x63\x25" - "\x8f\x79\x18\x7b\x3a\x90\xe6\x98\x8f\x86\x5b\x07\xb3\x0b\xfa\xb4" - "\xf4\xdf\x43\xaf\x3c\xdf\xe7\xcc\x20\x51\x5e\x4d\x13\x88\xb4\xf1" - "\x2e\x4a\xf1\x86\x8e\xd3\xbc\x90\x08\xe3\xd7\x97\xe1\xa2\xab\xbc" - "\xa1\x16\xfa\x2a\xd1\x58\x6f\x68\x23\xc6\x98\x12\x8e\x7b\xef\x26" - "\x4a\x4a\xc2\xd3\x79\x1b\x69\x49\xde\xd0\x64\x84\x37\xd2\x4d\x2e" - "\x53\xd2\x83\x2f\x89\x1e\x6f\x68\x2a\xbe\x8b\x68\xc6\x4b\xe2\xaf" - "\xb9\x61\xb2\xce\x1e\x22\x9c\xde\xd0\x6c\x7a\x70\x48\x44\x78\x43" - "\xcd\x88\xcb\xa7\x79\xe1\xcf\xc4\xbc\x70\x8f\x10\xe6\x6a\xeb\xbc" - "\xf0\x39\xbc\xff\x55\x80\xd6\x78\xbe\x27\x58\x97\x9d\x17\x76\x0a" - "\x51\x51\x4d\xb9\x2b\x35\xea\xc3\x38\x29\x52\xaa\xad\x62\x43\xb5" - "\xbd\x4f\x14\x26\x8b\xd4\xea\x1b\xfa\xfa\xf0\xdc\x50\x7d\xbd\xfc" - "\x2e\xaf\xce\x04\x1c\xfb\x04\x17\x74\x3e\xe0\x1e\x81\x9c\xf1\x86" - "\x4e\xa2\x9c\x4f\x68\xde\x4a\xbf\x60\xfc\x47\xac\x15\x78\x7f\x4f" - "\x60\xac\xb4\xcc\x5b\xe9\x14\xb9\x21\x32\x03\xa6\xdd\x1b\xea\x24" - "\x94\x93\x09\x98\x13\x24\xcc\xf2\xea\x6c\xa4\xf5\x73\x3a\x86\x65" - "\xc0\x61\x18\x9c\x76\x5e\x98\x2c\x48\x9f\xdd\x57\x51\x9d\x85\x5f" - "\x1e\x7e\x55\xc8\xfb\xe3\xbe\xd5\x92\x86\x4d\x78\xf7\x7c\x06\x7e" - "\x91\x34\x0c\xd3\x30\xa4\xe5\x31\x78\x46\x8f\xc2\xd7\x27\xf1\xdd" - "\x50\xfd\xd7\xcf\x54\x3d\xfe\x43\xaf\xc7\x47\x1c\x0e\x9e\x1a\x22" - "\x36\x6c\xa5\x80\x53\xc6\x09\xe4\x9b\x2f\xf3\x95\x6f\x85\xfc\xdf" - "\x6a\x05\x7d\x92\xe7\x85\x85\x8b\x69\x08\xba\xba\x98\x8e\x4c\x2b" - "\x51\x81\xf8\x94\xad\xa0\xcf\xd6\x3b\xfa\x2a\xb6\x82\x46\xc0\x25" - "\x75\x6b\xd6\x67\x12\xf6\xd6\xfb\x00\x67\x41\x0f\x97\x67\xde\x9a" - "\x05\x58\xd9\x9f\x69\x76\xd0\x42\x04\xe7\x85\xd6\x86\x72\x57\x52" - "\x72\x06\xb9\x80\xef\x56\xc0\x2a\x42\x1d\xd7\xe3\x39\x1b\xf1\x74" - "\x35\xca\x7a\x0f\x70\xb3\xb8\x3c\x94\x91\x0d\x98\x73\x00\x2b\x9f" - "\x71\xea\x75\x93\x15\xdf\x79\xbd\x0a\x3f\x57\xa4\x7c\x6b\x43\xc4" - "\xbc\xb5\x2a\x9a\x77\x14\xcd\x98\x67\xf6\x73\x98\xd5\xe0\x93\x70" - "\xf9\xd6\xe2\xaf\x11\x59\xe7\x06\x44\x88\x79\x65\x12\x15\x27\xb5" - "\x06\x5a\x28\x37\x64\xa6\xd6\xe2\x83\x74\x1b\xb1\xfd\x11\xa0\xd6" - "\xc0\x46\x7c\xef\xc2\xb3\x84\x8e\x76\x36\x12\xe3\x38\xb7\x38\xb0" - "\x36\x6c\xde\xea\x3f\xda\x39\x93\x90\xff\x3d\xe0\x18\x79\xb2\xd8" - "\xe4\x6a\x2d\x0e\xf0\xb7\xf3\x68\x27\xf8\x33\x2c\xc2\xa1\xf2\xad" - "\x79\x21\xf3\x36\x9a\x7b\x41\xf8\xe7\x74\xba\x86\x20\xac\xcf\x92" - "\x24\x42\x16\x87\x53\x1c\xed\x5c\x4f\x4f\x5e\xa0\xa4\xa3\x85\x07" - "\x25\x9f\x3e\x59\x5c\x4c\x32\xff\x85\x90\xe5\x89\x4e\x17\x3d\x51" - "\x48\x23\x90\xfe\x1c\xf3\xac\x18\xe1\xa2\x96\xf6\x7c\x9a\xd3\x15" - "\x4a\x9e\x7b\xa1\x4f\xb4\xe4\x6d\xa4\xa3\x85\x1b\x99\x1e\x2e\xd6" - "\xd3\xe7\x74\x75\x8b\xb9\x17\x7a\xc4\xd1\xc2\xfd\xd4\x92\x77\x90" - "\x66\x7f\xe2\xb1\x84\x2b\xb6\x16\x47\x52\xb6\x56\x45\x2a\xb6\x36" - "\x84\x2a\xb6\xe6\x85\x53\xb6\xfa\x43\x29\xdb\xa0\xb3\x6d\x2b\x06" - "\xfd\x52\x64\x5b\xa4\x6e\x5b\x82\x77\xbb\x6c\x5f\xf3\x36\x17\x74" - "\x70\xc9\xff\x5e\xd8\xde\xa2\x7c\x5b\x83\x48\xd9\xe6\xea\xab\xd8" - "\x56\xa5\xf8\x13\xdf\xa9\xdb\x1a\x14\xaf\x6c\x6b\x52\x7d\x60\xdb" - "\x01\x6e\x5f\xa4\xf1\xe0\x77\x0c\x3f\xe8\x94\xdb\x33\x01\xf3\x2a" - "\x86\x1f\x31\x6f\xcf\x8c\x94\x6f\xcf\x12\xe6\xed\xd9\x80\xad\xcd" - "\x7d\x3e\x08\x3a\x82\x86\x0e\xd0\x9f\x6d\x23\x47\x18\xdf\x61\x7a" - "\xf2\x79\x72\x7a\x1d\x27\xf1\x7e\x92\xc4\xbb\x55\x34\xf7\x79\xee" - "\x7f\x61\x3c\x9d\x02\x34\xb2\x44\x52\x00\xa7\x02\x70\x52\x00\x67" - "\xc3\xf6\x62\x5d\x36\x03\x8f\xed\x4b\x15\x1e\xdb\x8b\xfb\xfa\x32" - "\x58\xbf\x33\x21\x8d\x0b\xe1\xe7\xe5\x78\xc2\x3c\x58\xbe\xdd\x3f" - "\xe7\x25\xe1\x17\xe6\x9a\xec\xc8\x50\x92\x7d\x29\xf2\xae\x10\xaa" - "\x3f\x75\x82\x87\x47\xbb\x72\x1d\xd4\x20\x2a\xb6\xfb\x45\x4a\x0d" - "\xe0\xef\x78\x15\x70\x92\x85\x94\x47\x3b\xaa\xfa\x2a\x76\x34\xe1" - "\xd7\x30\xd0\x07\x99\x16\x3b\xaa\x62\x6d\xe7\xc4\x76\x73\x8f\xfb" - "\x9a\x16\x1f\xed\x3f\xc6\xb2\x0f\xef\x6d\x3e\x7a\xb3\x51\x7f\x6f" - "\xf7\x51\xb5\xb4\xc1\x59\xe6\x15\x97\xd1\x97\xcf\xd0\xe8\x1a\xd0" - "\x84\xdf\xd3\xf0\x5e\x3b\xef\xd6\xf7\x44\xa4\xfc\x43\x33\x78\xa0" - "\x87\x65\x90\x70\x4f\x66\xf9\x9d\x05\x7b\xc7\x2c\x7a\x32\xd2\x30" - "\x86\x6c\x16\x7d\x36\xb6\xcd\x2c\xf8\x1e\x01\xfa\x8e\xc3\x73\xe4" - "\xae\x8b\x94\x8e\x9f\x6d\x97\x3b\xe2\x62\x59\x8d\xf7\x4c\xf1\xa2" - "\x2d\x75\xf3\x0a\x1a\x6f\x09\x90\xb9\xde\x1d\xc9\xb1\xac\xb5\xb2" - "\x8d\x92\xce\xef\xc2\x5d\x33\xbb\xfe\x22\x99\x78\xcc\x89\xa4\xa0" - "\x3c\x87\x45\x88\xe5\x19\x54\xbf\x0c\xb2\xc9\x4d\xb6\x7a\xb7\x68" - "\x0a\xf7\x64\x68\x8c\xa7\x81\x0b\xe3\x06\x3c\xaf\x03\x9e\xfb\x1e" - "\x5d\x99\x45\xef\x3b\x28\xa1\x6d\xdf\xe3\x1e\xdd\x5f\xff\x41\xe2" - "\x3b\x0d\x9a\x24\x8e\xbf\x36\xcd\xa0\xd3\x60\xf6\x33\xf7\xfb\xf0" - "\x45\xe1\xaf\x5c\x42\x4c\x0b\x9b\x33\x24\xfe\x13\xb2\xd7\x55\x16" - "\xa6\xeb\xe6\xad\xbc\x41\x78\xfd\xc2\xe3\x75\x74\xc9\xf9\xaf\x7a" - "\xa4\x29\x0b\x89\x08\xdb\x8b\x6c\x2b\x56\xb3\xed\x57\xd1\x58\x2c" - "\x2a\x1a\x8b\xba\x57\x88\x50\x9d\xb4\xef\xae\x75\xf9\x68\x72\x93" - "\x6a\x9b\xad\x2e\xe8\x47\xed\xdd\xe6\xc6\x22\xc0\xbe\x8a\x61\xb7" - "\x16\x0b\x4f\x24\xa5\xb1\x04\xe9\xf6\xf8\xe8\x7f\x99\xa3\xe7\xc0" - "\x30\xde\x75\xae\xdf\xc6\x63\xde\xb5\xcd\x3e\xba\xfe\x92\x7a\xa9" - "\xd9\x3a\x42\xbb\xd8\x07\x26\xf9\x92\xf4\x69\x17\xe3\xcf\x8a\x5f" - "\x56\xe2\x68\xa3\xde\xe8\x9b\xd4\x0d\x5b\xc6\xb9\x86\xc6\xa0\x1d" - "\xae\x3d\x43\x63\xee\x76\x3a\xc4\x69\xe1\xbe\xf6\xd8\x4f\x56\x05" - "\xa1\x2b\x8c\x99\xe1\x23\xd7\x9e\xc1\xe8\x26\x58\x4e\x5e\x14\x1d" - "\x95\x2b\xfa\x69\xf6\xf1\xbc\x95\x11\xc1\xef\xdc\xef\xea\x11\xce" - "\xf4\x00\x9c\x8d\x06\x2d\x06\xa1\xbf\x49\x94\x37\xba\x94\x6e\x38" - "\xa6\x53\xb8\x05\x79\xae\xe7\x79\xb1\x31\x4a\x77\x2b\xdf\x56\xd5" - "\x0d\xb9\xc2\xf3\x07\xd0\xb5\x02\xcb\x6d\x22\x08\x98\x3e\x1f\xdd" - "\x9c\x69\xd8\x35\xde\xd0\x4c\x96\x2d\x55\x83\xcd\x3b\x0e\xc0\xbf" - "\x3e\xad\x75\x0c\x29\xb9\x64\x3e\x50\x52\xa6\xf0\x66\x1d\x2e\xc0" - "\xb6\x5c\x3b\xe2\x97\x07\x44\x87\x28\x3f\x50\xb8\x99\xc3\x56\xf4" - "\x72\xd8\x70\x96\x69\x9e\x65\x8c\xd3\xf5\xc3\x3d\xd7\xf7\xd2\x69" - "\xe8\x43\x6c\x03\x2a\xdb\xe8\xba\xe0\xe1\x12\x35\xe7\xd6\xe3\xbe" - "\xce\xe1\xa3\x5b\x82\x06\x5e\x2c\x07\x41\x5f\xa6\xb5\x8b\xfb\x3c" - "\xcf\x49\x2d\x2f\x15\x41\xe0\xea\x42\xda\x46\xa3\x0e\x5c\x3f\x55" - "\xaf\xeb\x0e\x45\xd7\x0b\x38\xf8\xa1\x47\x4b\x1a\x2c\x5f\x49\x66" - "\xbb\xa2\xb5\x99\xeb\xcb\x75\xe1\x3a\xcb\xba\x68\x90\xb7\x18\x67" - "\xbc\xa1\xbb\xa0\x97\xc9\xf0\x86\x1e\xf7\xf5\xd0\xfb\x6e\xae\x56" - "\x3a\xd7\x75\x0e\xa6\x65\xc2\x76\x34\x6f\xcd\x76\x7e\x46\xd7\x3b" - "\x23\xe2\x14\x60\xbe\x02\x3a\x25\xf3\x53\x8e\xd1\x41\xf0\xaf\x79" - "\xef\x6c\x1e\x9b\xbd\xa5\x17\x78\x6c\xe6\xb4\x57\x23\x6d\x3b\xd2" - "\xac\xd5\xd3\xae\x55\xf3\xa5\xf2\x39\x8c\x9f\x18\xab\xe7\x00\x8f" - "\x1a\xb6\xf1\x41\xe7\x4c\xe3\x5b\xe0\x1b\xcf\x6c\x51\xb1\x77\x76" - "\x62\x5c\x20\x5f\x55\x5f\xec\x44\x39\x5f\x61\x9e\x72\xae\xa4\x6b" - "\xc0\x97\x1f\x97\xad\xa1\xab\x99\x9f\x44\x4a\xe3\x46\x45\xf7\xeb" - "\xdb\x85\xdb\x45\x5e\x48\xce\xe2\x15\x74\x2d\xfa\xdf\xfa\x33\x74" - "\xfd\x67\xb9\xa5\x76\xe0\x4a\x54\x79\x96\x94\xac\x49\x69\x2c\x67" - "\x99\x5b\x7f\x96\x6d\xb0\x1b\x6c\x06\x2f\xe2\x7d\xdc\xe5\xe4\x02" - "\xe8\x7a\x4c\xd9\x10\x37\xbc\xc2\xf3\x4f\xa7\xe8\x86\x52\xae\x2f" - "\x7e\x49\x08\x7b\x4e\x5c\x14\x0b\x04\xeb\x73\x18\xb7\x7c\x74\xc3" - "\x1e\x3c\x8f\xc9\x9f\x9b\xf2\xf4\x6f\x0f\xd2\x2d\x10\x17\x23\x9c" - "\x06\xfa\xeb\x0d\x25\xc2\x9d\xc4\x7d\xe2\x1d\x94\xdd\xe0\xa3\x6f" - "\x1c\x51\x6d\x73\x43\x11\xc3\x1a\x04\x07\x0f\xcf\x37\xa8\x79\x06" - "\x7b\x8a\xbd\x2c\x89\xf1\x90\x73\xd8\x0c\xab\x5e\x53\xf2\x39\x02" - "\x5c\xeb\xdc\x91\x42\xc8\xe2\xc2\xc8\x86\x7d\x0d\xf2\x5d\x8f\x63" - "\x3c\x22\x28\x3f\x31\xfc\x03\x25\x9e\xd1\xcc\xe3\xf6\x7c\x05\xe7" - "\x40\xa1\x67\xf4\x19\xfe\x2e\xe0\xef\x80\x79\x7f\x83\xb7\x26\x0b" - "\xe5\x9f\x41\xb9\xf6\x7c\x65\x1b\xd8\x0b\xba\x51\x46\x8f\xdb\x9e" - "\xef\xa3\x0c\x93\x9a\x8b\xdb\xdf\x30\x48\xdf\xb3\x72\xdf\x39\x5a" - "\x4b\x7a\x9f\xbe\x31\x85\xe7\x1b\x50\xaf\xa6\xb0\x79\xdb\x31\x5d" - "\x6e\xb0\xbd\xf5\xa5\x53\x74\xa3\xb9\xb5\x50\xf2\xb7\x26\x34\x7b" - "\xf3\x9b\x11\xbf\xc6\xf3\xa5\x4a\x7c\xdd\x68\xbe\xf4\x67\x0f\x40" - "\x95\x87\x58\x1b\x6b\x55\xdf\x63\xd1\xb3\xc7\x66\xe2\xe7\x92\x74" - "\xeb\xce\x87\xfd\x73\xa3\x39\x92\x82\x36\x29\xe7\x36\xb2\x87\x44" - "\xf7\x38\x2d\xa2\xbf\xd7\x7d\xca\xb6\xc7\xd8\x0c\xd0\xff\xa0\x6a" - "\x07\x86\x41\x49\xe8\x8b\x4c\x73\xe1\xac\x11\xc1\xe6\xb2\x00\x70" - "\x1e\x9b\xd3\x5c\x13\x20\xfb\x2d\x5c\xf7\xb1\x0b\x96\xd7\x08\x7f" - "\x00\xb4\xe7\x27\xd7\xed\x70\x6d\x88\x78\xce\x16\xb0\x60\xff\x2c" - "\x3c\x2e\x65\x7e\xea\x81\x2a\x86\x27\x52\x24\x3f\x08\xa3\xee\x4a" - "\x9e\xed\x6f\xe0\x76\x04\xac\x37\x50\x6f\xcb\x59\x1a\x2b\xdb\xf3" - "\x30\xea\xbe\x0b\x32\x65\x17\xec\xc9\x7a\x29\xff\xc7\x42\xfe\xdb" - "\xd3\x8d\xf9\xc5\x4d\x88\xdb\x84\xb8\xa3\x85\x41\x62\x18\x61\xc0" - "\x96\xf6\x19\xda\x62\x4d\xa7\x08\xbe\x57\xd6\x61\xc2\x78\x8c\xf6" - "\xde\xdf\xc0\x65\x3a\xa1\x17\x7b\x96\x70\xb9\x63\xab\x20\xab\x02" - "\x09\xdb\xbf\x1f\xb7\x9b\x86\x1f\x1e\x27\xe5\x62\x53\x04\xf5\x8f" - "\x6d\x97\x9b\xd2\x54\x9b\xdc\x98\x13\xdb\x26\x37\xa5\x81\xee\x68" - "\xd9\x1b\x0f\xe2\xd7\xac\xbe\xa3\x7f\x37\x96\x47\xbd\x1f\xef\x71" - "\xdf\x58\x0d\x5a\x67\x2a\x5a\x73\x18\x70\x65\x1e\xf8\x94\xcc\x6c" - "\x93\xf3\x3c\x3d\x87\x33\xbf\x72\x78\x04\x7a\x09\x68\xb8\x07\xf1" - "\x56\xee\x8b\x95\x11\x8a\x89\xf7\xae\x07\x4f\xad\xea\x65\xba\x7e" - "\x26\xe7\x11\xd6\x96\x97\x33\x1f\x22\xcf\x3e\x4b\xa8\xbc\xbc\xc7" - "\x7d\x93\xc9\xa0\x1f\xc2\x3a\x39\x3e\xb1\x7e\x70\xd3\xf8\x7e\x3d" - "\x0a\xba\x26\xcb\x96\x4e\x1a\x37\x05\xf2\x07\x6d\xb5\xaf\x46\x8d" - "\x1b\xe3\xee\xe6\x6f\xc8\xbd\x8f\xf1\x3e\xf9\x28\xe4\x4b\xef\x86" - "\xc6\x8c\x3e\x8d\x86\xf5\x6a\x94\x15\xda\xf0\xe1\xf8\x50\x6a\xed" - "\x64\x6f\xc7\x41\x6a\x0d\xfd\x82\xec\xcf\x48\x18\x13\xbc\xcc\xcf" - "\x2b\x45\xf8\x40\xef\x1e\xd8\x71\xe7\x3c\x18\x67\x6f\x38\x43\xe3" - "\x64\xdd\x5f\x3e\x05\x0e\x7e\x52\xc2\xd6\x69\xf1\xa1\x79\xf3\x22" - "\x11\xda\x7c\x9a\xe7\x58\x6c\xa9\x9b\x7a\x69\xfc\x8e\x55\x94\x59" - "\xdb\x4b\xe3\xea\x7a\x29\x43\xfc\x2d\x43\xab\x85\xae\xf5\xe4\x05" - "\x2b\xa1\x7f\xe7\x8c\x28\x26\x73\xdd\x2a\x92\x6d\x1e\xae\x80\xce" - "\x15\x82\xce\x75\x2e\x83\xe5\x5c\xbf\xce\x05\x7d\x16\x3a\x57\xa3" - "\x5f\xf1\x45\xa3\x7f\x78\x21\x25\xa5\xe5\x91\x15\xf8\x39\xcf\xd2" - "\x4d\xcf\xa5\xb5\x43\xdf\x43\x9d\x7d\x7a\x7d\x41\x5f\x97\xa5\x90" - "\x86\xc9\xba\x42\xf6\x8a\x8a\x7d\x35\x83\x8e\xa9\x1a\xf3\x4e\x80" - "\xd7\x54\xb8\x0e\x2f\xf1\xba\xc0\xc1\xd1\x41\xd3\xf2\x5a\xf0\x1d" - "\xc2\x4b\xc6\x8a\x20\xc2\x8b\xb8\xec\x26\x84\xf7\xb8\xc7\x55\xfb" - "\xb4\x2a\xd3\x60\xf2\xd6\xb2\xd6\x18\xf7\x6f\xfe\xb2\xd0\x5c\xac" - "\x73\x17\xaf\x09\x09\xbf\xf7\x2c\xf7\xc1\x9b\xd3\xe7\x15\x89\x90" - "\x7d\x09\xaf\xd1\xdc\x6c\xe2\xf5\x23\x9e\x37\x7e\x13\x7a\xca\xe7" - "\xad\x19\xb1\xec\x87\x5e\xee\xb2\x14\x01\x26\xf4\x7e\xd6\xc9\xbf" - "\x88\xde\xcd\x6b\x8d\x5b\xe4\xba\xe6\xcd\xb3\x7d\x34\x53\x8e\xa3" - "\xac\xef\xb1\x0c\x84\xde\x74\x35\x70\x2a\x87\x9d\x0b\xdb\xf6\xe6" - "\x22\x1f\x3d\x50\xa8\xeb\x70\x72\xbd\x14\x61\xd0\xff\xa6\xef\xe3" - "\xb0\x92\xb1\x64\x2b\xb1\x8b\x8e\xc1\x74\x1f\xb9\x86\xa9\xd1\x57" - "\x90\xe7\xa0\x01\x07\xe3\xcd\xde\x6e\xed\xd1\x47\x11\x76\xc4\x80" - "\x83\x34\x5f\xc6\x77\x5b\x7f\x1a\x95\xa7\x23\x2a\xcf\xa3\xdd\xda" - "\x6d\x7b\x11\x16\x8a\xcd\x73\x4b\x5a\x6c\x9e\x5b\xc6\x44\xe5\x71" - "\xa9\x72\x6e\xc9\x8c\xcb\x93\x15\x97\x27\xfb\x52\xdc\x6e\xc9\x8f" - "\xcb\x53\x12\x97\x67\xfd\xa5\xb8\xdd\x52\x13\x97\x67\x4f\x5c\x9e" - "\x43\x51\xb4\xe4\xb5\x4a\xd8\x81\xb7\xb4\xc4\xe5\x39\x19\x97\xa7" - "\xd3\xf8\x1e\x6c\xcd\x78\xf9\x2e\xb2\x81\x2f\x3b\xb8\x3d\xa1\xb7" - "\x77\x76\x6f\x7f\xb6\x47\xe5\xfd\x6a\xc6\xa5\xf5\xfa\xea\xd4\xd8" - "\xf2\xbe\x3a\x3b\xb6\xbc\xaf\x2e\xb8\xb4\x5e\x5f\x2d\x8e\xcb\xe3" - "\x8a\xcb\x53\x15\x95\xa7\x41\x2f\xa7\x31\x2e\xcf\xc1\xb8\x3c\xcd" - "\x97\xf2\xd5\x57\xdb\xe2\xf2\x74\xc4\xe5\x09\x7e\x0e\x2d\x78\x3c" - "\x56\x6b\xfb\xa3\x58\xe7\x7d\x00\x63\x7d\xc6\x42\xb6\x65\x30\x96" - "\xf8\x7f\xd2\x1b\x1c\xc2\x63\x0a\x8f\x3f\x87\x1d\x41\xe8\x4b\x19" - "\xb3\x7c\x34\xe1\xa0\x31\x06\xf1\xba\x20\xf7\x67\xa5\x2b\x67\x64" - "\x0c\xa6\x53\x72\x39\xc6\x5a\x3f\x97\x75\x78\x0c\xeb\x5e\x19\xd5" - "\xfd\xba\xad\x5a\xff\x26\x1d\xce\xdf\xe5\x7c\x20\xaf\xa9\xa8\xf5" - "\xc6\x24\xd6\xad\x0f\x3b\x64\x9e\x23\x51\xfa\x30\x97\x1f\x38\xb8" - "\x2a\x68\x8a\xc3\x63\xcf\x65\xf0\x48\x83\x8e\x93\xd3\x8a\x51\xaa" - "\x15\xe6\xd2\xd1\x5a\xe8\x32\xd0\xdf\x19\xb7\x53\x74\x6b\xa6\xd4" - "\xad\x96\xf4\x12\xbf\x7b\x4b\xef\x21\x2f\xd2\x28\xdd\xf2\xd6\xc2" - "\x66\x94\x2f\xd7\x4c\x8a\xcf\x53\xb7\xd4\xff\x59\x07\xbb\x75\xeb" - "\xe1\x52\x3f\xf0\xba\x35\xcf\x58\x87\xf4\xd1\xad\xd5\x52\x6f\x28" - "\x3f\x90\x5d\xa7\xaf\x0b\x1d\x0e\x4c\xe1\x34\xe0\xff\x8c\x22\xa3" - "\xbe\xb0\x01\xfd\x48\x3b\xf5\x72\x34\x53\x6d\x78\xeb\x3b\xb1\x3c" - "\x39\x04\xbc\x72\xeb\xb1\xd8\x76\xbf\xd5\x17\xdb\xee\xb7\xfa\x63" - "\x79\x52\x03\x4f\xde\x66\x8a\xcd\x73\x5b\x7a\x6c\x9e\xdb\xc6\x45" - "\xe5\xa9\x52\xe5\xdc\x36\x25\x2e\xcf\xac\xb8\x3c\x39\x51\xdf\xa8" - "\xe3\x6d\x85\xfd\x36\x8c\x5c\xe3\xbe\xcd\x11\xf5\xad\x55\x4b\xf9" - "\x79\xdb\x46\x23\x8c\xd7\x09\xeb\xb6\xa9\x35\x56\x1d\xde\x9e\xb8" - "\xfe\xce\xe9\xdf\x89\xc3\xa1\x25\x0e\x87\xfe\xfe\x5f\xa9\x6c\xb0" - "\x3f\x9c\xa6\xaf\x1d\xd4\xe7\x94\x3b\x31\x5e\xcf\xe3\x6f\xc0\xaa" - "\x41\x7a\xd0\xe1\x6b\x69\xb1\xf0\xbe\x36\x26\x16\xde\xd7\xc6\x47" - "\x7d\x5b\xf1\x3d\x35\xaa\x0e\xd6\x64\x9b\xdc\x67\x02\x7d\xec\x6b" - "\xf3\x8d\x70\xb6\x0d\x81\x6f\x87\x53\x8e\x33\x59\xbc\x77\x60\xe4" - "\x29\xfa\xda\xfd\x6c\x47\xea\x30\xa3\xfb\x3f\xa9\x7a\x7d\xad\x3a" - "\x0e\x8f\xc6\x38\x3c\x0e\x46\xd5\x2b\x60\x59\x4b\xdf\xb1\x84\x1e" - "\xfe\x3e\xeb\x38\xbc\x27\x45\xae\xe1\xaf\x81\x5e\x76\x81\xac\xbc" - "\x77\xe2\x74\x09\x25\x7b\x1d\x1d\xb0\xc9\x1a\x3b\x07\xe5\xa7\xd4" - "\x03\x79\xfa\x7e\x0f\x7b\x8f\x7b\x7c\xba\xc1\x8f\x78\xb7\x83\x17" - "\x1b\xa4\xce\xb3\x61\xaf\x4f\x38\x73\x6a\x40\x47\xd8\x35\x13\x74" - "\x1d\xf5\x40\x09\xf7\x45\xc8\x9c\x0e\x8c\xeb\x69\x6a\xbd\x6b\xfc" - "\xfc\x28\x7e\x0e\xd8\x57\xdd\x27\x4e\xd1\x84\x2f\xf3\xb8\xcf\xfb" - "\x07\xd8\x66\x3e\x1c\xf0\x43\x8f\x3b\x23\xf5\x32\xc4\xa5\xeb\xf9" - "\x36\x46\xe5\xf3\xeb\x76\x6d\x07\xc7\x4d\x0a\x91\x89\xf3\x00\x46" - "\xba\xd2\xe5\x26\x7c\xf9\x30\xfa\x28\xf2\x78\x8c\x3c\x6c\x03\xcb" - "\xf5\x96\x12\x32\x4d\x2c\x25\x93\x67\xd5\x29\x09\x5b\x6f\xef\x0e" - "\xd6\x89\xbd\xa5\x1d\xe4\x0d\xb4\xf1\x7c\x94\xc9\x53\x76\x8a\xe1" - "\xa4\x27\x07\xc9\xdc\x5d\x71\x00\xe3\xd6\x84\xf4\x70\xc5\x81\x1c" - "\xd8\x36\x90\xd1\xe3\xa7\xf2\x9e\x86\x68\x7a\xcd\x9c\x99\xfd\xf0" - "\xbc\x39\x13\xbe\xf7\xf0\x43\xf3\x67\xde\x63\x9f\xbf\xf8\xb9\x82" - "\xfc\x09\x4b\x5f\x28\xb1\xbf\xb8\x6c\x71\xc9\xe2\x25\x3f\xb0\x67" - "\x3a\x6e\x76\xd8\x17\x96\xa8\x67\x46\xd1\xc2\xe5\x25\xd3\xf8\x75" - "\xbc\xbd\x78\x59\xc1\x0a\xf9\x7a\x6b\x2a\xc5\x02\x59\x5c\x52\xb0" - "\xcc\x7e\x73\xfe\x78\xfb\x83\x0b\x17\x17\xbd\xb0\xac\x20\x21\xac" - "\x7b\xec\xcb\x0a\x96\x15\x2c\xcc\xb7\x4f\xb3\x67\x32\xe4\x68\x70" - "\x51\x6d\x98\x69\x8c\x5d\x3c\x66\x55\xba\xc5\x31\x7d\x0c\xf3\x29" - "\x9e\x99\xd0\x71\xe9\xf8\x35\x21\x6e\xfc\x9f\x18\x37\xfe\x4f\x1c" - "\x73\xe9\xf8\x35\x31\x6e\xfc\x9f\x18\x37\xfe\x4f\xcc\xbe\x74\xfc" - "\x9a\x18\x37\xfe\x4f\x8c\x1b\xff\x27\xf6\x8f\xff\xe0\x23\xdf\x3a" - "\x29\x0b\x26\xc6\x8d\xff\x13\xe3\xc6\xff\x89\x87\xe2\xbe\x8f\x44" - "\x7d\x5f\x8d\xef\xb6\xe8\x31\x11\xdf\x1d\x46\x9f\x1c\x90\x29\x13" - "\x43\x46\x1a\x7d\xad\xbe\x5d\xa5\x9d\x94\x1e\x95\xb6\x43\xa5\x9d" - "\xd4\x3f\xfe\xb3\xec\xe0\x7d\x16\xca\xd6\x9e\xb4\x49\xae\x6d\x21" - "\x2f\x8f\x47\xe8\x1b\x37\x9c\xa5\x49\x43\x18\x16\xf3\xb0\x9c\x33" - "\xdc\xfe\x78\x4f\xfd\x48\x32\x73\x9e\xfa\x57\xc9\x24\xdc\x13\xec" - "\x78\x12\xc2\xd2\xf0\x83\x1c\x99\xb4\x1e\xfa\xee\x71\x35\x46\x4c" - "\x3a\x2e\xfb\x15\xf2\xe8\xf0\x4f\xf0\x37\xef\x2d\x40\x1e\x73\xa5" - "\x1a\x7f\xdb\xf1\x9e\xc6\x3c\x8d\xfc\x26\xa1\x4d\x28\xc0\x93\x10" - "\x66\xc5\x2f\x1d\xf0\x8e\x1b\xf0\x78\x4d\x2c\x51\x9f\x4f\x68\xe3" - "\x69\x64\xa9\x74\x47\xda\xbc\x11\xd6\xa3\x33\x4d\x6a\x4e\xa0\x71" - "\x96\x70\xbf\x97\x53\x8f\xf0\xc4\x36\x51\x26\xda\x7f\x52\x50\xc9" - "\x8a\x4c\xe8\x3f\x0f\x8e\x53\x73\x99\x8d\xb3\x20\x5f\x7b\x01\xe7" - "\x13\x3c\xfb\xf0\xfc\xa3\x01\xdf\x23\x6d\xe5\xcc\x7c\xe1\x4e\x7a" - "\x84\xe1\xc6\x85\x97\x42\x9e\xf5\x5a\x42\xae\x9c\x04\x71\x35\xc2" - "\x9d\xfc\x70\x82\xf0\x26\xe8\x08\xbd\x3e\xca\x6c\x67\x7c\xa3\xc2" - "\x8f\x08\xf7\x88\xf9\x9c\xde\xc7\xe5\x21\xcf\x60\xba\xb5\xb1\x9f" - "\x4a\xed\x5b\xbc\x3d\x3d\xae\x1e\x9f\x9d\xa6\xdb\x5f\x51\xf5\xb8" - "\xbd\x2b\xb6\xec\xdb\xc7\x27\xae\xc7\xed\x33\x50\x8f\xcf\x12\xd7" - "\xe3\x76\xb9\xa6\x2a\x34\xd4\x45\xbb\x24\xae\x14\x75\xf9\x4c\xd2" - "\x3d\x36\xbc\x5a\xd7\x7d\x02\xb0\xb9\xac\x88\x93\x79\x1f\x29\x1d" - "\x68\x37\x3d\xdd\x3b\x96\x1a\xca\x4e\x50\xe6\x71\xe1\x1e\xf6\x88" - "\x8f\xee\x90\x36\x64\x54\x78\xa7\xc2\x05\x74\xd2\x98\x4e\xa8\x0f" - "\xf2\x0d\xd6\xde\x86\x1d\xa2\xe6\x31\xee\xc0\xf8\x97\xe9\x37\xe6" - "\x20\x97\x97\x0a\xbf\x41\x47\xc4\xe5\xc4\xc5\x05\xa3\xe2\x4a\x62" - "\xe2\xd6\xf4\x87\x6f\x34\xc2\xbf\x58\x3b\xdd\xf1\x4e\x5c\x3b\xa1" - "\x7d\xee\x9c\x13\x5b\xef\x3b\x5a\x54\xfd\xd0\x46\x97\xd0\xfa\x8e" - "\x0e\xb4\x51\x5f\xe2\x36\xba\xd3\x94\x98\xd7\xee\x1c\x23\xe1\x8d" - "\xa4\x04\xf0\xee\x9c\x82\xb6\xeb\x93\x3c\xa8\xb7\xd3\xa5\xed\x73" - "\xe7\x02\xa3\x7d\xbe\x58\x1d\xef\x6c\x88\xab\x63\xf8\x34\x4d\xbe" - "\x4e\xd5\x75\xf2\x73\x71\xb0\x0f\x25\xe6\xc5\x3b\x8f\xa1\x9e\xe1" - "\x41\xea\xd9\x39\x38\x2f\x4e\xe6\xf9\x81\xf0\xa5\xbc\x38\xd9\xae" - "\xf2\x50\xa2\x3c\x53\x85\x3b\x51\x39\x93\xe7\x3b\x43\xac\xd7\x4e" - "\xde\xc8\x73\x46\x51\xe1\x45\xb1\xfc\x87\x3a\x70\x3e\xa6\x5f\x48" - "\xc9\x58\x6e\x87\xd3\x76\xd2\x3e\x8f\x27\x7b\xdc\x93\x5b\xe2\x68" - "\x75\xee\x34\xdd\x35\xa7\x5b\x4b\x6a\x54\xf4\xfa\xfa\x55\x71\x38" - "\x75\x24\xa6\xd7\x5d\x10\x14\x74\x2e\x31\xbd\xee\x1a\x33\x38\xbd" - "\xee\xe2\xf6\x3f\x77\x29\xbd\xee\xca\x8e\xa6\x17\x74\x5b\x59\xbf" - "\x9b\x6c\xe0\x8d\xbe\x5c\xc1\x73\x6e\xa0\x89\xd5\x02\x5e\x51\x79" - "\x3a\x39\xcf\x7a\x4b\x50\xf1\x09\x74\x46\xf3\x59\xba\xab\xc8\xe8" - "\xff\x23\x6a\x68\x98\xe8\x7b\x5c\x00\x5e\x12\xe7\xf3\x3a\xce\x79" - "\xbc\xa1\x4c\x62\x7b\x23\xae\xdc\x23\x89\x65\xc1\x5d\x3e\xd0\xf4" - "\xd5\x04\xe1\x41\xb5\x37\xe4\xeb\x99\xb1\x32\xe2\xeb\xd6\xd8\x36" - "\x02\xdd\x90\x2f\x6a\x4f\xf8\x65\x7f\x97\x6f\xb3\xaf\xbb\x2e\x6d" - "\xb3\x6f\x8c\x55\xed\xf5\x8d\xa4\x58\xfc\xbe\x5e\x93\xb8\xbd\xbe" - "\xde\x34\x78\x7b\x7d\xbd\x65\xf0\xf6\xfa\x7a\x07\xb7\x97\x8f\xbe" - "\x61\x8f\x1d\x37\xbe\x41\xb1\xf5\x45\xb9\xc8\x27\xb4\xa1\x57\xf3" - "\xf7\x17\xad\xb7\xf1\x63\x19\xc7\x6d\x55\x5f\x46\xe0\xe5\xa4\xb1" - "\x8c\xe3\x95\xc2\x18\x14\x36\x68\x58\xb5\x2a\xf1\x7a\x28\xdb\xb4" - "\xad\x35\xc4\x6b\xdf\x64\xbf\x9e\x75\xf6\x6f\x5c\x88\x68\xd4\x86" - "\x77\xed\x34\xdd\xfd\xfb\x88\xa6\x95\xee\x02\x6e\x6c\x8b\xd6\xc9" - "\x39\x83\x29\x69\xd1\x6d\xb1\x89\xf5\xef\x51\xca\x9e\x40\x7b\xfc" - "\xf5\x34\x4d\xd9\xaa\xda\xe5\xee\xd7\x63\xe9\x38\x25\x33\x71\xbb" - "\x4c\x99\x85\x76\xf9\x6b\xe2\x76\x99\x92\x3f\x78\xbb\x4c\xe1\xbd" - "\x01\x7f\xbd\xb4\x1f\x4d\xa9\xd1\xfb\xd1\x3a\xce\x63\x5f\xc2\xf6" - "\xf7\xdd\x29\x9c\x06\xef\xe8\x23\x53\x3e\xe5\xf8\x09\x9d\x46\x3f" - "\x92\x79\x5a\x00\x4b\x96\xaf\xa7\x39\xa2\xc3\x88\x86\xeb\xb7\x74" - "\x26\xea\x27\x77\xcb\x79\xfe\x89\xc5\x64\x06\x0d\x73\x76\x31\x8c" - "\x65\x44\x67\xe9\xee\x27\x38\x1d\x87\x4f\x0c\x44\xf7\x93\xbb\xa7" - "\x18\xe9\x58\xd6\xe9\x69\x33\x45\x4f\x21\x71\xba\x38\xd8\x7a\xfd" - "\x87\xc9\x71\x84\xd3\x73\xba\xb8\x34\xe5\xaa\x3f\xde\xdd\x12\xdb" - "\x1f\xef\x6e\x88\xe5\xcf\x29\x3c\x3f\x61\x89\x40\xce\x81\x97\x03" - "\xc0\xe1\x0b\xf3\xd7\xe5\xfb\xe6\x3d\x63\xe2\xfa\x26\x78\xe0\x9e" - "\xdf\x29\x1e\xb8\x67\x57\x2c\xae\xf7\x4c\x4e\xcc\x03\xf7\xcc\x1e" - "\x9c\x07\xee\x29\x1c\x9c\x07\xee\x59\xcf\x3c\xe0\xa3\x7b\xde\x89" - "\xed\x9b\xf7\xd4\xc6\xd6\x1d\xe5\xca\xbe\x49\x57\x5d\x49\xdf\x84" - "\x2e\x74\xf5\x60\xfd\x50\xee\x5d\x74\xa3\xbf\xf6\x1a\xeb\x17\x5f" - "\x88\x66\x66\xf4\x2b\xe0\xf7\xcd\x6c\x9e\x43\x82\x8c\x9f\xc2\x34" - "\xac\x93\x67\x55\xbe\x99\x1f\x4d\xc7\xcd\xea\xdc\x88\x13\x69\xff" - "\xce\xeb\xc1\x8a\x9e\x53\xdf\x8a\xad\xff\x37\xd7\x27\xa6\xe7\x37" - "\x6b\x41\x4f\x67\x62\x7a\x7e\xf3\xd0\xe0\xf4\xfc\xe6\x71\xde\xf3" - "\x7e\x69\x9f\xfa\x66\xa7\x7d\x85\xd4\x51\x64\x9e\xb3\x34\x75\xe6" - "\x17\x1b\x9f\xa6\x8e\x8b\x1d\x9f\xa6\xa6\x5d\xf9\xf8\x34\xb5\x30" - "\xf1\xf8\x34\xd5\x95\x78\x7c\x9a\x5a\xa3\xfa\xc3\xd4\x63\xb1\xfd" - "\x61\x6a\x53\x2c\x4f\x80\x76\xff\x63\xe3\xd3\x34\x7b\x5c\x1f\xa8" - "\x3c\x4d\xd3\x5e\x87\x4e\xe1\x52\xed\x76\x6f\x41\x2c\x8e\xd3\xa6" - "\x26\x6e\xb7\x69\xf3\xd1\x6e\x95\x89\xdb\x6d\x5a\xf1\xe0\xed\x36" - "\x6d\x23\xda\xad\xf2\xd2\x76\x9b\xd6\x78\xe5\x3a\xc5\xb4\xb6\xd8" - "\x36\x9b\xe6\xb9\xf2\x36\xbb\x77\x4c\xe2\x36\xbb\x77\x72\xe2\x36" - "\xbb\x77\xb6\x6a\xb3\x7b\xd7\xc7\xb6\xd9\xbd\xf9\xb1\x6d\x06\xba" - "\xfd\x83\x6d\x86\xf6\x99\xad\xf6\x15\xdc\xfb\x09\x6c\xf6\x61\x3d" - "\xee\x7b\x4f\xfa\xe8\xbe\x46\x65\x57\xdf\xa7\xc6\x0e\xd5\x86\x07" - "\x90\xe6\xd8\xa5\xe3\xc0\xbd\x41\x3d\xec\x7b\x97\xb6\xc3\x7d\xe9" - "\x90\xd1\x9d\xcd\xa5\x72\x1d\x4b\xb5\x21\xd3\x1c\xe9\x3c\xab\x78" - "\x2d\xea\xbe\xc9\x9c\x17\x6d\x2c\xbc\xc1\x10\xb1\x5c\x47\xfa\x00" - "\xc3\xe1\xb3\x3e\x71\xb0\xf2\xae\x64\x8c\xbf\xcc\x5e\x98\xd9\x9e" - "\xb2\x3b\x00\x2f\xeb\x05\xc5\xab\xf7\xc5\xeb\xbf\xf5\x88\x7b\x48" - "\xf1\xe9\x03\x5f\x8e\xc3\xa1\x3d\x31\x9f\xde\x17\x42\x1d\xea\x13" - "\xf3\x69\x96\x6d\x70\x3e\xcd\xe2\x33\x35\xf5\x51\xb6\xcf\xc8\x27" - "\x43\xbe\x38\xdb\x27\x2b\xc7\x12\x50\xbc\x23\x75\xa2\x8a\xc6\xd9" - "\x3d\xee\xac\x78\xfd\x0f\x6d\x93\x15\x56\x38\xdf\x7f\x21\x2e\xff" - "\x20\xfa\x5f\x16\xeb\x7f\x07\x06\xc1\xf9\x32\xfa\x5f\x16\xeb\x7f" - "\x07\x2e\xed\x5b\xf7\xeb\xfa\x5f\x22\x1b\xef\xfe\x31\x89\xdb\xff" - "\xfe\xb8\xf6\xa7\x9c\x12\xd8\xc3\x32\x7f\x6c\xba\x05\xd1\xe9\x78" - "\x4f\x11\xa7\x65\x1e\x49\x90\xb6\x3c\x1e\xe6\x20\xe9\x9a\x2e\xe1" - "\x3d\xde\x03\x95\x90\xf7\xee\x3f\xa9\xfa\xe3\x03\x93\x63\xfb\xe3" - "\xfd\x81\xd8\xfe\x98\x55\x13\x9b\xef\x81\xf4\xd8\x78\xf0\xcf\xff" - "\x98\x8c\x7d\x60\x7d\x1c\x0f\xbc\x77\x9a\xa6\x27\x29\x1e\x98\xfe" - "\xfd\x38\x3c\x6a\x13\xf3\xc0\x03\x07\x51\xff\xf7\x12\xf3\xc0\x03" - "\xc7\x06\xe7\x81\x07\x78\x7d\xe9\xbd\x68\xbe\x7d\xa4\x34\x6b\x58" - "\x6c\x9a\xe9\xd6\xc4\x32\x6f\x7a\x46\xe2\x39\x82\xe9\x59\x8a\xc6" - "\xd3\x1d\xb1\x34\x9e\x9e\x13\x4b\x43\xd4\xe5\x1f\xa7\x61\xff\x59" - "\xd9\x1e\xf7\xf4\xf8\xfe\xef\x3d\x4d\x33\xf4\xfe\x3f\xf3\xfe\x38" - "\x1c\xdb\x15\x2e\x89\xe6\x45\x66\xb0\xfd\xeb\x4d\x4c\xcb\x19\x63" - "\x12\xd7\x79\xc6\x64\x8c\x41\xde\xc8\x25\x7d\x69\xc6\x6c\x84\x3f" - "\xc2\x73\xa1\x3c\x1f\x52\x87\xf0\x47\x42\x64\x96\xe3\x55\xff\xb8" - "\x34\xa3\x98\xf7\x97\x30\xfd\x99\x7f\x2d\x63\x28\x9b\xc7\x20\xc6" - "\x2b\xb7\x54\xee\x51\xb0\xac\x67\x5e\xbf\x91\x79\x7d\x86\xd4\xff" - "\x78\x5d\x85\xf7\xff\x59\x1c\x94\xed\x0d\x84\xc8\xe0\x77\x4e\x1f" - "\x07\xbb\x85\xfb\x05\xa7\x37\xd2\xaa\x79\x33\x57\x9c\x6c\x9a\x11" - "\x48\xdc\xc6\x33\xd3\x06\xe7\x9d\x99\x19\xaa\x9d\x67\x2e\x88\x6d" - "\xe7\x99\x59\x11\xf7\x88\xf9\x5c\x57\xf0\xc0\x15\xf5\x93\x12\xbb" - "\xf0\x0f\x2a\xef\xd7\x3d\xde\x56\x5c\x46\xd7\x9f\xa1\x99\xcd\xb2" - "\x3c\x4d\x04\x2d\x6b\x93\xa8\x59\xca\x80\x07\xaf\x91\x78\x22\x4d" - "\x6e\x88\x34\xb1\xee\xd9\x36\x8e\xab\x77\x8b\x20\xd2\x1d\xe3\xf5" - "\x00\x3e\x2b\x07\x5e\xb8\xfa\x14\xcd\xfc\x28\x26\xbf\x89\xc8\xab" - "\x60\xd8\xea\x65\x7f\x7c\x30\xdd\x98\xd3\x5d\x3f\xc8\x7e\x20\xa4" - "\x99\x62\xec\x75\x50\x7b\xbd\x1e\x1c\x3f\xe8\xb8\x0c\x9c\x78\x7f" - "\x3c\xe3\x74\x79\x39\xf0\xe0\x46\x83\x7f\xd5\x1e\xc9\x07\x6b\x07" - "\xf6\xe0\x3d\xb8\x07\x71\xd9\x97\x99\x1b\x8c\xea\x07\x0f\x1e\x8f" - "\x86\xa3\xce\x8b\x3f\xd8\x61\xec\xa3\xc3\x7b\xe0\x73\x60\xe9\xf8" - "\x7c\x6b\x4c\x2c\x3e\xdf\x1a\x0f\x3d\xc5\xa4\x60\x7c\x6b\xca\xe5" - "\x60\x70\x9b\x2b\x9e\x65\x7e\xf8\x56\xf6\xe5\xe6\xfc\x92\x6d\x94" - "\xbd\xe5\x12\xde\xfa\x96\xd4\x97\x18\xc6\xe7\xe0\xe8\x89\xb1\x2d" - "\xe4\x5a\x3d\xaf\x6b\xcd\xda\xa4\xfa\xfd\xac\xb8\x39\xc2\x6f\x9d" - "\x94\xfb\xa4\xf4\x7e\xff\x64\x28\xbe\x1f\x7c\x2b\x64\x8c\xd1\xb1" - "\xe1\xb3\xd2\x8d\x7e\x0f\xbb\x96\xe1\xc6\xcd\xb3\xce\x9a\xac\xfa" - "\xc2\xac\x8d\x91\x94\x68\x7b\x6d\x96\xd4\xff\x8c\xf9\x52\xc4\x4f" - "\x8e\xcb\x17\x37\xff\xf7\xad\x93\x62\xf0\x79\xfa\x34\xb4\x6f\x80" - "\xd7\xb5\xd4\xd9\xdb\x59\xef\xc4\xcd\x57\xf8\x37\xcb\xb3\x96\x1f" - "\x00\xee\x43\xba\xdc\xfb\xf6\xed\x71\xe5\x9d\x74\x76\x5d\xae\xfe" - "\xb3\x06\xa9\xff\x43\x03\xf5\x5f\x22\xe1\xc6\xcd\x25\x3e\x24\xeb" - "\x1f\xbe\x44\xfe\x3d\x34\x1b\xf2\xcb\xa0\x1b\x74\xee\x87\x76\x1b" - "\xba\x3a\xcf\x1f\x0c\xae\xab\x3f\x34\x30\xff\xa7\xf2\x0d\xcc\xff" - "\xf9\x13\xe9\xea\x3e\x3a\x1c\x8a\xd7\xd5\x1f\x3a\x62\xa9\x4d\x58" - "\x97\x41\xe6\xff\x1e\xd2\xe7\xff\xbe\x9d\x1d\x2b\xcf\xbe\x6d\x8d" - "\x6d\xc3\x87\xe2\xda\xf0\xdb\x99\xb1\x6d\x38\xeb\xe4\x7f\x77\x5c" - "\x63\xc5\x2b\x39\x39\x59\x4b\x4e\xd2\x92\x92\x11\x8d\x2a\xd2\xb0" - "\x64\x53\xf2\x10\xfc\x86\xea\xcf\x61\x5a\xb2\x66\xc2\x6f\x88\xfe" - "\x1c\x1a\xf7\x3d\x8c\xf3\xe2\x67\xd2\x9f\x43\xe2\xbe\x87\x7e\x4e" - "\xfc\x30\xbd\x5c\xa3\x7c\x53\xdc\xf7\x90\xcf\x89\x1f\xfa\x0f\xe6" - "\xa7\x4b\xbe\x63\xf7\x9d\x3d\xb4\x64\xc5\xc2\xa2\xc5\xf9\x72\xad" - "\xb8\xc0\xbe\xf0\xe9\xa7\x0b\x96\x2f\xb7\x97\x2c\xb5\x3f\x70\xff" - "\xc3\x77\xdc\x63\x57\x4b\xce\x45\xd3\x6e\xce\x4f\xa5\x39\x2f\x2e" - "\xe3\x88\x39\x8f\x3c\x94\x63\xcf\x7e\xe0\xfe\xd8\x48\x03\x8c\x5c" - "\x5a\xbe\x1c\x94\xa8\xfe\x97\x55\x31\x8a\x68\xe3\x28\x29\x7b\xda" - "\x8f\x36\x10\xa9\x39\x8f\xec\xd7\x5b\x60\x8d\x8a\x5e\xa7\xf0\xdc" - "\xc8\xeb\xf9\xb3\x1f\xe5\x4a\x4c\x68\x70\x51\xf1\x22\x3e\x5f\x32" - "\xfb\x79\xf1\xae\x9f\xec\xdf\x26\xed\x14\x3d\xfa\x56\xf3\x2c\xa4" - "\xc5\xb7\xb7\x3d\x44\x76\x27\x99\x91\xff\x3b\x88\x4b\x12\xf7\x46" - "\x10\x16\xd0\xf7\x30\xcf\x5b\x28\xc3\xde\x75\x19\xe9\x2c\xa7\x69" - "\xce\x97\xc5\xbb\x42\x7e\x8b\x7b\xab\xf4\x74\xb3\xff\x1e\x71\xff" - "\xcb\x1e\x96\x0d\xb5\xaf\x92\xa9\xee\x55\xa2\xd7\x46\x92\xf9\xb5" - "\x51\x7c\x06\x7d\xf6\x49\x63\x1d\xb4\x02\xdf\x3e\x7a\xb4\x89\xcb" - "\xe6\xb4\x11\xed\x5f\xfe\x2c\xd3\x8f\x8c\x4e\x3f\x27\x6d\x60\x1d" - "\x76\xf6\x49\x0d\xe9\xe6\x7d\x42\x96\x60\x6a\x6d\x86\xb7\xd4\x45" - "\x96\xb0\xf8\x74\xe2\x2c\x4a\x6a\x85\x64\x5e\x19\x12\x21\xcf\xb2" - "\x33\x28\x7f\xce\xf7\x2d\x2b\xc5\xa7\x5e\x68\xcf\x73\x3a\x9d\x62" - "\x73\x17\x99\xd0\xaf\x93\x3c\xcb\x78\x8f\xc2\x9c\xac\xba\xcf\xc8" - "\x04\x1a\x8c\x39\x43\x73\x8b\x4b\xe7\x88\xb0\x73\x0e\x99\xfe\xd5" - "\xc1\xfb\x0b\x1b\x37\x6f\xfe\x33\x99\x7e\xde\xeb\xd2\x7a\x85\x8d" - "\x4a\x4b\x44\x87\x60\xdf\x14\x01\x11\xe4\xfd\xf9\x2d\x79\x61\x4e" - "\x53\xd6\xe3\xb4\x51\x6b\x49\x80\xd6\x9c\x14\xc1\xf2\x3f\xab\x7d" - "\xfd\x47\x3b\x03\xbc\x5f\xd1\xbc\x66\x0e\x25\x9f\xce\x21\xed\x68" - "\x61\x0d\x79\x17\x04\xa8\xf4\xa4\xe8\x68\xc9\xfb\x84\x5a\x0b\x9b" - "\x28\xb7\x8d\xb4\x96\xf6\x8f\x48\xfa\x57\xd8\xf0\xa1\xbd\xec\x02" - "\xd9\xd6\x2c\xe6\xb0\x0b\xb4\x6a\x0d\x0d\x5f\x75\x82\x2c\xde\x8e" - "\x36\x94\xd3\x45\x8f\x1d\xa7\x24\xc0\xd3\x56\x7f\x44\xb6\xd5\xdf" - "\xe7\xfd\xbb\x59\x54\x5b\x46\x36\xe1\xcc\x48\xeb\x75\x66\x58\x7b" - "\x45\xc6\xc8\x1e\x67\x46\x7a\x6b\x31\xd2\xb7\xff\x8e\x46\xb4\x51" - "\xfa\xbb\x67\xda\xb4\x9a\xf3\x34\xc6\x3e\x97\xdb\x7f\x6e\x51\xed" - "\x79\xa4\xdf\xd0\xd4\x10\x41\xde\xe8\x3c\xa1\x94\xa6\x43\xde\x9c" - "\x20\x45\x00\xab\xa6\x97\xc6\xd4\xf6\x92\x2d\x52\xd1\xd4\xc0\xb4" - "\xe8\xdb\xd0\x98\x01\x59\x38\xec\xc0\x53\x87\x4c\xde\x96\x4e\x3a" - "\x1a\xe8\xa5\x56\xfa\x80\xbc\x8e\xbf\x79\x7e\xfe\xd4\xa1\x21\x11" - "\x30\xbf\x67\x55\x3b\xe0\x2b\x9e\x71\x1e\xe5\x33\x8e\x2e\xaa\x2c" - "\xa3\xb4\xe2\x55\x34\xec\x0c\xc2\x95\x4d\xbf\x3d\xd3\x1b\xfa\x9b" - "\x67\x95\xdc\x73\xfb\x68\x53\xd9\x51\x4a\x6e\x0d\xd4\xf0\xde\x4e" - "\x2d\x9c\xfa\xa1\xdd\x1b\x38\x46\xde\xe2\xbf\x7a\x22\xe6\x0f\xcd" - "\x1b\x23\x64\xde\x7f\xf1\x98\xe6\x35\x5d\x24\x6f\x4e\x80\xde\x43" - "\xd9\x62\xc3\x87\xbc\xe6\x99\xd5\x1a\x08\xf2\x39\xa4\x4c\xd1\x6d" - "\x4b\xad\x5c\x46\xe3\xeb\xce\xd3\xb8\x5d\xe7\x29\x43\xf4\x64\x68" - "\xbc\x8f\xf6\x89\x2e\x2b\xed\xc2\x33\xad\x9d\xcc\xa8\xaf\xda\x43" - "\x9d\xa2\xef\xa7\xed\xcb\xa0\xfa\xde\x81\xfd\xb4\xbd\xdd\x03\xfb" - "\x69\xc1\x4b\x3e\xde\x53\x8b\x7e\x51\xc3\xfc\x5c\x79\x96\x4c\xeb" - "\xce\x12\x4d\x74\x69\x64\x7f\x8a\xcf\x43\x64\xcf\xf4\xe6\x77\xc9" - "\xf7\x53\x34\x2f\x84\x67\x1a\x7e\x49\xe8\x03\x72\x3e\xbb\x5d\xe7" - "\x5b\x84\x69\x08\xfb\x04\xcf\x64\x3c\x3f\x72\xd6\x0a\xbf\x28\xdf" - "\x3d\xa3\x5b\xa3\x54\xe6\x5f\xb5\x77\x77\xf7\x8c\x1e\xf7\x3c\xe8" - "\x3f\xf9\xf3\x0d\x3e\x56\x32\x7d\xb6\xef\xbd\xd3\x5d\xec\xef\xc4" - "\x2f\xf1\xe9\x2b\x4c\x62\xdf\x27\x7a\x38\xe3\x30\x8d\xcb\x3d\x45" - "\xd9\x76\x3c\x2d\xf8\xa1\x5f\xce\x3b\x68\xe4\xed\xee\x2b\x44\x99" - "\xd9\x77\x21\x5c\x18\xe1\xa8\xaf\x89\xe3\xde\x3e\xdd\xa5\xa9\x34" - "\x19\x1a\x60\x06\x75\xf8\xe8\xeb\xb3\xd7\x73\x9f\xee\xd6\x2c\xe2" - "\x70\xfe\x64\xaa\x1d\x25\x8e\xed\xda\x26\x9a\x55\x5f\xcb\x76\xf8" - "\xa8\x20\x8f\x71\xc4\xb8\xdd\xbc\x11\x71\x87\xed\x44\x4c\x97\xe6" - "\x3c\xde\x2f\x96\x5d\xe3\xa3\xd4\x93\xd1\x75\x10\xee\x6f\x97\xf3" - "\xd8\xf9\x66\x99\x67\x88\xd0\xfe\xa5\xbc\xd5\xd7\x49\x3f\xef\xed" - "\x18\xe2\xfc\x23\x69\xde\xd0\x29\x9a\x94\x4e\x36\xd6\xff\xea\xb7" - "\x09\x1f\x9e\x1d\xbc\x7f\x13\x7c\x72\xdd\x19\xca\xfe\xe4\x6b\xe9" - "\x94\xfe\x27\x58\x63\x4a\x1e\x65\x87\xa3\xe4\xd1\x4b\x47\xdb\x0f" - "\x45\xc9\xa2\x47\xef\xba\x54\x16\xcd\xbf\x5d\xc9\x22\x11\x52\xb2" - "\x27\xec\xd3\xc3\xaf\x8b\x0b\xd7\xf7\x84\xcc\x4f\x8a\x0b\x0f\xaa" - "\xf0\x47\xba\xe2\xc2\xfd\x7a\xf8\x04\x43\xd6\xb5\x32\x1e\x2f\xb2" - "\xac\x7b\xe4\x2a\x96\x75\xad\xf9\xba\xac\x93\x7b\x0a\x1f\xbe\x20" - "\x7e\xec\x22\x3e\x6b\x84\xf7\xa3\x8c\xbf\x78\x97\x0c\xdc\x53\x10" - "\xb6\x89\xc3\xaa\x3e\x20\x13\x7e\x52\xce\x09\xf7\xbf\x9c\x63\x39" - "\xc7\x32\x8e\xf7\x9c\xec\x1c\x25\xda\x76\x6e\x13\xc7\x6b\xb7\x89" - "\x96\x1e\xf7\x77\x42\x86\xbc\x7b\x19\x61\x1b\x11\xf6\x32\xe2\x59" - "\xee\x31\x4d\x8e\xe6\x1c\xe2\xf3\xfa\xed\xe0\xe3\x8d\x96\x24\x2a" - "\xde\x0c\x9e\xe7\xf3\x7f\xeb\x41\x5f\x2f\x64\x12\x9f\xdd\x92\x7e" - "\x42\xb4\x4c\xc8\xa8\x76\xee\x6f\xa3\xd6\xa1\x7f\x79\x1d\x9f\x50" - "\x59\x40\x9c\xe1\x73\x70\x8c\x43\xee\xca\x6f\xf3\xf9\xe4\xa4\xe6" - "\x42\x22\xde\xf3\xcd\x7b\x55\x20\x77\x4d\x55\xc0\xe9\x70\x11\xb7" - "\xf5\xc3\xb0\xff\x6b\xaa\x54\x5b\x3f\xda\xc4\x7e\x75\x4e\xd1\x77" - "\x8e\xc0\xbe\x0b\x72\xdd\x2c\x61\x17\xf1\x79\x15\xf4\x51\xb6\xf1" - "\x0a\x77\xe2\x57\x65\x9c\x59\x61\xdf\x48\x48\xe3\x6d\x0b\x12\xe3" - "\xec\xa3\x87\xd3\x8f\x96\x1e\xe2\xfc\x87\x98\x36\xc2\xed\x34\x60" - "\x24\xc9\x33\x2f\x6e\x32\xf3\x99\x17\xa4\x93\x7b\x41\x45\x6a\x63" - "\xc6\xd1\x05\x7e\x62\x39\xef\xed\x00\x8c\xd2\x53\x0a\x06\x60\x09" - "\xc8\xfd\x98\x38\x1d\xfe\xf0\x35\xe2\x53\xc0\x5f\xcf\xed\xc5\xe7" - "\x14\x79\x7d\x0d\x74\x49\xe3\x7d\xf0\x4a\xf7\x7c\x78\x78\xfd\x07" - "\x44\xfa\x59\x4b\xf0\xdb\xc3\x69\x7c\xbe\x88\xcf\x57\xca\xb3\x95" - "\xda\x64\x12\x2f\x66\xa4\xf5\x9f\xaf\xfc\xff\xe1\x6c\x25\xe8\x6f" - "\xab\xd3\x44\x13\xf0\x4f\xe3\xf3\x95\xc0\xbf\x88\xf9\x50\xaf\x93" - "\x75\xeb\x63\x92\xe6\xf3\x39\x0c\xb6\xe2\x11\xa3\xfd\xb9\xbe\x5c" - "\x17\xc4\x4d\x51\x3a\xa1\x38\xe6\xa3\xf9\x56\x8e\x47\xd8\x38\x4e" - "\x3f\x09\x72\xcc\x9b\x1f\xa6\x03\xa7\xc3\x5a\xe5\x2a\x32\x29\x99" - "\xf6\xe8\xad\x9c\x5f\xc9\xb4\xf9\xbe\x01\x99\x36\xff\x84\x92\x69" - "\x8a\xc6\x4a\xa6\xcd\xff\xa3\x92\x69\xf3\x7f\x2f\xd7\xc1\x20\xd3" - "\x38\x8e\xe5\x9a\x21\xd3\x76\x8d\x12\x47\x58\x76\xf4\xb8\xe7\x37" - "\x19\xb2\x6d\x13\xc2\x58\x76\x30\x8e\x4a\x4e\x3d\x62\x16\x1f\x66" - "\x90\xda\x67\xc0\xef\x85\x7c\x36\xa1\x43\x7f\xe7\x71\x64\xac\x92" - "\x71\x8f\x9a\x06\x64\xdc\xfc\xf2\x81\xbc\x2c\xe3\x1e\xbd\x46\xc9" - "\x38\x15\x5e\xff\x18\xcb\xb8\x47\xcc\x4c\x03\x1d\xbe\xc6\x73\x76" - "\x7a\x7a\xa6\xa3\x35\x5a\xc6\xc5\xf6\xaf\x47\x17\x18\x32\x8e\x65" - "\x1b\xbe\x8b\x20\xd3\xa4\x9f\x2e\xee\x67\xd5\xa0\xb9\xd1\xef\xb8" - "\x0d\xb8\xce\xec\x3f\x87\xe9\x36\xbd\x8b\x86\xe9\xe7\x7c\xf4\x7a" - "\x3f\xba\xc7\xd8\xe7\x08\xfa\x37\x25\xd2\x9b\x0d\x3d\x0d\xfc\x78" - "\x43\x18\xfd\xcd\xeb\xc2\x58\x5a\x23\x5c\xad\xa1\xe3\xf4\x64\x09" - "\x69\x91\xe4\x67\x3f\xe6\xb6\x85\x9d\x31\x94\x9f\x2c\x7b\x30\x86" - "\x76\xe5\x06\x68\x28\x6c\xf3\x8f\x2b\x35\xc4\x39\xe8\x9b\x03\x71" - "\xdf\x95\x7b\x3c\xa3\xf2\x4d\x88\x8a\xbb\x59\xea\x78\x67\xd9\x77" - "\xd2\xa3\xc7\x06\xb3\xfd\xaf\x0c\x97\xef\xae\xbc\x0c\x2e\x5b\x2f" - "\x83\x8b\xd4\x03\x26\x74\x52\x12\x6c\xb3\xab\xce\xd2\x77\xe5\x7c" - "\x8c\xf4\x61\xb1\x2e\x61\x39\x1f\xeb\xf1\x43\xa2\xe2\xa3\xca\xfa" - "\x5e\x52\x82\xfc\x51\xe5\x7d\x6f\xec\xe5\xe1\x7f\xef\xfe\xcf\x81" - "\xbf\xf0\x73\xe0\xaf\x65\x19\x08\xda\x59\x22\x5a\x6c\xba\x89\x21" - "\xd9\x07\x8f\xf0\x39\x3b\xa4\x7b\x43\x9f\xf3\xf9\xd8\x39\x56\xda" - "\x82\xf2\x2c\xd6\x66\xc4\x7b\x43\xed\x52\x3e\xcf\x58\x49\xa4\xd6" - "\xa8\xfb\xf3\x7c\x14\x8f\xdb\x88\x90\x81\x9b\x8c\x0f\xc7\xe3\x86" - "\xf8\x09\x03\xf1\x39\xd7\x0d\xb4\xfb\xf7\x6a\x2e\x33\x2f\x99\xe6" - "\x45\x2c\xfb\xa0\x3b\x0c\xf3\x85\x7d\x9f\x54\xf7\xcf\xcf\xe4\x94" - "\x40\xce\x7b\xa2\xf6\xec\x76\x42\xb6\xdf\xd0\x1a\xe0\x73\xa9\x01" - "\xaa\x54\xf6\xf0\x57\x30\x9e\x8c\xe4\xb3\x39\x7c\x4e\x27\x37\x9c" - "\xad\x29\xdf\x38\x39\x4d\x46\xde\xc1\xe6\x81\xb8\x5c\xbd\x4c\xde" - "\xff\x1a\x40\x9e\x76\x23\x0f\xc3\xe6\x3d\x94\x18\x07\x6e\x90\x67" - "\x55\x43\x9d\x2c\x77\xbf\x02\x3d\x79\xa4\x2a\x27\x8f\x54\x39\xdf" - "\xb7\xf9\xe8\xbb\xb3\x2f\x77\x56\x64\xf0\xfa\x7d\x7f\xfe\x95\xd7" - "\x8f\xf4\xfa\x7d\xbf\xea\x73\xea\x77\xb9\x72\x5b\xae\xbc\x5c\xab" - "\x5e\xee\x63\xe6\x2b\xa7\xeb\x63\x53\xbf\x38\x5d\x33\x75\xba\x3e" - "\x56\xfc\x39\x74\x4d\x54\x4e\xe3\x17\x2f\xc7\x6e\x94\xd3\x96\xa8" - "\x1c\x92\x7f\x83\x9e\xe3\x32\x1b\xbe\xdd\xd8\xaf\xa2\xf2\x15\xf5" - "\xb8\x3d\xda\xf7\xa4\xf2\xb7\xf8\xf8\x64\xc3\xf7\xa4\xee\x03\x12" - "\x63\xcb\xe3\xdf\xc9\x6d\x60\x7d\x44\x44\x7c\xf4\xf8\x7c\xf6\x1b" - "\x38\x63\x4d\xb4\x8f\xc6\xc7\x0b\x2f\xe7\xf3\x92\xfd\xf6\x08\x91" - "\x43\x87\x6b\xe4\x7e\x00\x8c\x43\x8f\xbf\xce\xe7\x01\xd4\x7a\xe6" - "\xe3\xfb\x54\x9f\x7c\x7c\x1f\xca\x0d\x0e\x0e\xe3\x40\x55\x63\x59" - "\xe6\x90\xc1\xf6\xf8\x23\x7f\xa7\x8f\x7e\x20\xe7\x2f\xc3\x1b\xf6" - "\x37\x89\x73\x36\xdd\x47\xd6\x93\x0f\x45\xf9\xf0\xc2\xd8\xfd\xc4" - "\x4a\xfd\x2c\x02\x68\xe0\x02\x2d\x17\x8c\x33\x68\x60\x84\x23\x6c" - "\x8a\x41\x03\xe8\x2b\x69\xde\x86\x10\x9f\x15\x0a\xa8\xf3\xdd\x0b" - "\x9e\x10\x15\x07\xf4\x73\xf4\x0b\xd4\x3a\x43\xea\xfe\xa6\xc0\x6a" - "\x9b\x66\xe4\x1f\x67\x77\x7e\xc6\x3c\xec\x4f\x39\xe0\x02\xac\xf5" - "\x06\x7c\xc1\x78\x89\x81\x74\xf5\x72\x5f\xd2\x02\xb4\xff\x63\xa5" - "\x92\xaf\x51\x86\xc4\x5d\xa3\xe4\x08\xf0\x47\x1d\x34\x6f\x71\x80" - "\xf5\xd4\xce\x30\xea\xcf\xb2\xee\xe0\x12\x9f\x89\xd3\x48\xdd\xe1" - "\x5c\x86\xa6\xfc\x8f\x2d\x08\x47\xce\xb1\x8f\x0d\x89\x57\x1a\xea" - "\x3c\x8b\x71\xf2\xe1\xe9\x5f\x9d\x41\xf3\x2e\x90\x4e\x8b\x05\x9f" - "\x44\x10\x1e\x59\x3e\x80\x43\x9d\x3c\xd3\xf1\x44\x86\x81\x43\x84" - "\xcb\xef\xb1\x69\xd0\xc5\xb8\xdc\x0e\x79\xae\x12\x65\x4f\x62\xff" - "\x54\xec\xbb\xe2\xc5\x0c\x62\x1c\x90\x67\x81\x41\x6f\x3d\x8f\x5e" - "\xc6\x13\x69\x11\x59\xb6\xa2\x8d\xa2\xf3\x61\xe8\x83\x4f\x6c\xbc" - "\x94\xce\x4f\x34\x44\xd1\x39\x99\xf9\x8a\xe7\x58\x80\xff\x34\xa6" - "\x37\xaf\x6b\xd8\x57\xb0\x5e\xf5\xc4\xbf\x1d\x0e\xc8\x7d\x27\x69" - "\x0c\x37\x02\xfa\x33\x0c\xc0\xfd\x92\xa2\xf1\x13\x1d\xfd\x34\x46" - "\xd9\x02\x6d\xb1\x4e\x9d\x41\x91\x3e\xea\x7a\xdc\x4f\x9a\xfb\xcb" - "\x61\x5c\x9d\x36\x2d\x22\x6c\xc4\x73\xaa\x8c\x6b\x89\x5d\x04\x59" - "\xaf\x94\xfb\x98\x50\xd7\x83\x65\x6d\x26\xe8\x96\x9a\x2c\xab\x3b" - "\x83\xf5\x7b\xb3\x7c\x47\x59\x83\xf0\xf7\xdd\xec\xd3\xcd\xa8\x17" - "\xea\x62\x66\xde\x02\xee\xd0\xff\x72\xe7\x48\x7e\x59\xc1\xed\x94" - "\x7b\x3b\x87\x19\xe9\xf0\x3d\x84\xd3\x19\xdf\x88\x03\x7f\x3d\xf9" - "\x3e\xea\x95\xca\x78\xfa\xd9\x6f\x8a\xac\x73\x6e\x21\xc3\x40\x3d" - "\x8e\xc5\xd4\xb3\x2f\xc7\x64\xf0\x1d\xaf\x11\x35\xdb\x83\x52\x76" - "\x2a\xda\x3e\x19\x32\xfa\x24\xe7\x57\x7d\x2c\xd7\x1a\xcd\x8b\x01" - "\xe7\x00\x1f\x94\x8c\x25\xb3\xc9\xce\x7e\xe8\x9e\xd4\xfd\xd2\xe6" - "\x4e\x8d\x6f\x2f\x8e\x63\x1f\x71\x3a\x0d\xb9\x3f\x59\x4f\x51\x6e" - "\x26\xd7\x0d\x71\xeb\x2f\x37\x5e\x1a\x7e\xeb\xb6\xa8\x7e\x04\xba" - "\xe4\xbd\xb1\x45\x9d\xe7\x09\x28\x5f\x69\xb9\xfb\x85\xf6\xba\x6c" - "\x2f\xde\x97\x27\xfd\x5f\x48\x5f\x13\xb9\xbc\xc7\x4d\x8c\x28\x7e" - "\x9d\x7d\x0f\xfa\xf5\x3d\x7b\xfe\xe6\xe2\x90\xf4\xb7\xe6\x2c\xe1" - "\x73\xaf\x21\xb6\xc9\xe4\x9e\xb4\xc3\x25\x21\x7a\x24\x28\x69\x1b" - "\xe2\xf3\xe9\x01\x49\x8b\x3c\xb3\x71\x26\x3d\xc2\xb2\xa0\x27\x87" - "\x26\x85\x28\x99\x75\x0a\xbb\x93\x7d\x09\xe4\xf9\x58\x27\x51\x34" - "\x05\xdf\x6b\xe2\x98\xe2\xe5\xbc\xef\xd4\xf1\xf9\x07\xb9\xbe\x74" - "\x0a\xfc\x9d\xfc\x37\xa4\x5d\xac\xe6\x65\x8c\xbe\x96\xf7\x31\xaf" - "\x31\xf9\x74\x18\x28\x0b\xe3\xff\xe3\xc7\x2f\xed\x17\x79\xdf\x31" - "\x6c\x0c\x3e\x07\xa7\xd6\xab\x06\xe0\x21\xbf\x9c\x97\x1e\x90\x4d" - "\x7f\x60\x58\x9e\x4b\xfb\x4c\xde\x71\x83\x97\x8b\x6f\xe4\x73\xd4" - "\xb9\x35\x5c\xfe\x60\x32\x53\x38\xbf\xcf\xed\x64\x3e\x6d\xa7\xe4" - "\x2f\x7a\x56\xa2\xc7\xbd\x70\x8a\x51\x07\x83\x26\xaa\x0e\x0b\x5f" - "\xe9\x4e\x6d\xcc\x1e\xa8\xfb\xc2\x57\x24\x2d\x06\xe2\xff\x18\x45" - "\x1b\xfe\x3e\xa2\xf8\x6e\x61\x39\xf8\x43\x9f\xb3\x51\x61\x22\xf5" - "\xc0\x3a\xf6\x9f\xa8\x70\x5c\x4c\x06\xbf\x23\xed\x41\x1f\x7d\xd2" - "\xac\xd6\xa1\x16\xa2\xfe\x0b\xad\x7a\xbe\x05\x8c\x4b\xc2\x7a\xc6" - "\xe0\xf8\x54\x16\x8f\xb1\xca\x4f\xc1\x53\xf7\x33\xbe\xf6\x5b\xb8" - "\x8d\x9f\x1a\xce\xe5\x32\x4f\x88\xbe\xc2\x21\x81\xbe\x0c\xea\xee" - "\x2b\x44\xff\xc9\xd0\x7a\xdc\x4f\x41\xfe\xb5\x37\xa8\x32\x9f\x9a" - "\x6c\xe0\xca\xb8\x41\x57\x34\xf7\x88\xc5\x89\xe9\xcb\xe5\x72\x7f" - "\xef\x2b\x1c\x86\x9f\x19\xbf\xa1\x5f\x74\x3c\x86\x5e\xdb\xe1\xaf" - "\xd8\xbb\x3e\xb2\x42\x1c\x99\x17\x12\x11\xd8\x05\x1d\x95\xe0\xdf" - "\x11\x6b\x3d\x34\x22\xf0\x84\x96\xbb\x92\xb2\x60\xdb\x92\xb8\x28" - "\xa6\xd4\x45\xf0\x5c\x21\x26\xb3\x3f\x57\x7c\x67\xea\xdf\xe3\xf9" - "\xbb\x7b\x85\x58\x00\x9c\x3b\x8c\xb5\x3b\xe5\x6b\xe6\xa9\x60\xbf" - "\xdf\x9d\xe4\xc7\xf9\x8c\x0f\xcd\x73\xa0\x8c\xe4\x67\x3b\xb8\xdc" - "\x5c\x1e\x3b\x50\x5e\x8f\xfb\x69\x8c\xff\x8f\x97\x70\x3a\x7f\xf2" - "\x6d\x23\xf1\xcb\x18\x64\x8d\xb3\x83\xf1\xea\x4e\xd9\xbb\xde\xc0" - "\x75\x44\x20\x4b\xfb\x62\xb8\x3d\xbd\xde\xc0\x0d\xe1\x47\x2a\x55" - "\x78\x88\x7d\x91\xf1\x1e\x44\xc4\x37\x1a\xb8\x1a\x38\x70\x79\x7c" - "\x8e\x52\xa4\x36\xe6\xb1\x2f\x17\x2e\x8f\xfd\x0d\x22\xed\x31\x03" - "\xdf\xcf\xe3\xe5\xc1\xe8\x0e\xfb\x7a\x8c\xe2\xc9\xfc\x31\xc6\xf8" - "\x85\xf7\x8c\xd8\xf5\xde\x7c\x6b\xbc\x2c\x7b\x6a\xe9\xd2\x92\xdc" - "\x65\x05\xfc\xc8\xb8\xf9\x85\x5b\x53\xa3\x6d\x52\x96\x6f\xca\x17" - "\x40\x7e\x16\xcf\xff\x6c\x19\x69\xac\x5f\xe6\xbb\x8c\x39\x28\x7d" - "\x9f\xf4\x7d\xac\xab\xb2\x4e\x87\xb8\xda\xdf\x97\xae\x61\x30\x49" - "\x1f\x9b\x49\x1b\x4c\x76\xb2\xbc\xe8\x4e\xf9\x4b\xb6\xa4\x47\x45" - "\x97\x07\xf9\xfa\xe7\x3f\x07\xd9\x27\x56\x18\xde\xd0\xe4\xb3\x8f" - "\x96\x3e\x8d\xb4\xb7\x57\xb5\x69\x3c\x86\x97\xe1\x9d\x6d\x27\xa9" - "\x37\xe8\x7e\x72\xde\x3d\xdf\x06\x39\x5c\x90\x21\x2a\x1a\xa1\xbf" - "\x15\xd8\x07\xc5\x21\x6a\x8d\x9d\xf7\x64\xb5\x53\x41\xd6\xa0\xeb" - "\xe1\xe5\xfb\x3d\xaa\x1f\x16\x6c\x6d\xb6\x11\x9f\x09\xfd\xd1\x29" - "\x2a\x78\xc5\x64\x83\xac\x1d\x4d\x3f\xc3\xbb\xb4\x75\x39\x2e\xa6" - "\xbd\xae\xeb\x6a\x30\x25\x0b\x4d\x08\x91\x24\xd4\x1f\x99\xf4\x97" - "\x64\xfc\x34\x91\x24\x57\x8b\x92\x41\xa9\x61\x43\x4d\x64\x19\x91" - "\x66\xbe\xe1\xfa\x31\xb6\xfb\xee\x9d\x3a\xc5\x59\x56\x0a\xee\x0e" - "\x05\x2d\x22\xda\xaf\xd3\x09\xff\xa3\xb7\xba\x48\xee\x17\xa8\x38" - "\x91\x70\xdf\xc1\x26\xb7\x28\xe6\xb3\xb8\x91\xd4\xae\x4c\xe7\x0b" - "\xa4\x1d\xe8\xf5\x69\xec\x7b\x97\xc7\x68\xf6\xcd\x7c\x8a\x16\x8d" - "\x7d\x0f\x61\xa8\xbf\x43\x94\x77\x65\xaa\xf5\xc0\x45\x0b\x23\x1b" - "\xba\x32\x07\xe0\x9b\x88\xe1\x3b\x5f\x23\xad\xb1\xac\x43\xf3\x9a" - "\xee\x25\xaf\x3d\x40\xef\xe1\x7d\x90\xf6\x2c\x06\xfd\x89\x61\xd4" - "\xbb\x23\xe5\xce\xcf\x48\xd3\xcf\xd6\x69\x67\x69\xd1\x6b\x4d\x83" - "\xe4\xe3\xf3\xab\xdd\xa9\x7b\xbf\xdd\xe3\x5e\x84\xf6\xff\xe6\x64" - "\x7d\x4c\x80\xec\x5a\x04\xfb\xaf\x40\x7d\xa7\xee\x7d\xa8\x5b\xfa" - "\xb7\x5c\x14\x34\xd2\x24\x1e\x17\x78\xce\x51\x78\xb8\x5d\xc5\xc5" - "\xbf\x77\xf0\xde\xfd\x41\xd6\xf9\x87\x79\x1d\x77\xf0\x3a\xcb\x90" - "\x11\x41\x4a\x73\x5e\x10\x7d\xb0\xdb\xd3\xc1\xb6\x5a\x18\xb6\x57" - "\xe8\xa2\xc8\x39\xda\x79\x9e\x5a\x03\xc7\x79\x6d\x36\xe9\xcd\x45" - "\x7f\xd0\xbc\xc1\x73\x1e\xef\xfa\x08\xb5\x62\x7c\xf6\xd6\x9e\xf3" - "\x1c\xed\x3c\x8e\xf7\x30\x1d\xa5\x0f\xe8\xa8\xe3\xff\xb8\xe4\x5c" - "\x49\xad\x70\x31\x9d\xfb\x2e\x8a\xf9\x5e\xd3\x5f\x88\xfd\xbd\xb3" - "\xac\x00\xdd\xed\x67\xe9\x07\xbf\x7f\x17\x70\x0e\xfc\x07\x60\x49" - "\x5f\x4e\xd3\xe8\x3d\xbc\xf7\xb8\x7f\xd0\x62\xc8\x91\x84\x7e\x33" - "\x92\x3c\x9b\x2c\x8e\x27\xb4\x08\x64\x12\xfb\xdc\x82\x2c\x9a\xcc" - "\xf5\xc2\x77\x26\x7f\xe3\x39\x9e\x9f\x96\xb5\x9e\x5d\x96\xd0\x13" - "\x2c\xa3\x72\x58\xfe\x20\x7c\x7e\xfd\x45\x29\xb3\xb2\xf5\xef\xd9" - "\xfa\xf7\x2c\xfd\x7b\x86\xfe\x9d\xa5\x7f\x4f\xe5\x6f\x25\xdb\x0a" - "\xf3\xfa\xe5\xae\x36\xec\x18\xbe\x8b\x8d\xb6\x00\x3e\xc3\x2d\x8e" - "\x35\x52\x46\xea\x78\x4c\xd6\xf1\xca\xd4\xbf\x0d\x7c\xae\xb3\x84" - "\xd6\xfc\x4f\xe1\xe3\x8f\xc5\x67\x31\x45\xe1\x43\x16\x47\xd6\x17" - "\xc1\xc7\x6a\x09\x65\xfd\x43\xf8\x30\x2e\x1c\x86\xf2\x5d\x71\xf8" - "\x54\x19\xf8\x24\xe4\xb7\x15\xa2\x83\xc7\x87\xe5\xd7\x48\x5f\x95" - "\xc3\x58\xf6\xd7\xf7\x1a\xfe\xd3\x16\xb7\x5c\xce\x7f\x1a\xfa\x82" - "\x0d\x69\x50\xff\xc5\xb5\xfa\x38\xf8\x8e\xd2\x97\x9e\x31\x19\x7b" - "\x63\x50\xd7\x3d\x95\xaa\xae\xfb\xd6\xb3\x0f\xb1\x95\x74\xad\xd3" - "\x21\x3a\xa0\xff\xff\x67\xb3\xdd\x1f\xd3\x07\x8a\x4a\x96\x2f\x7f" - "\xee\x1e\x7b\xd1\xc2\x25\x05\xf6\x9b\xf3\xed\xcb\x0b\x17\x2f\x2a" - "\x29\x88\x5d\x2f\xb6\xea\xfe\xe6\xe5\x3e\x78\xd6\x49\xb9\x0f\x30" - "\xff\xb3\x1d\xaf\xf6\x2e\x3e\xf3\xbe\x70\x3f\x93\xc9\x63\x43\xdd" - "\xab\x64\xe2\x35\x0a\xe0\x53\x6d\x8c\x09\xca\x6f\x33\x25\x69\x56" - "\xd6\xb9\x9e\x81\xfd\xfb\x83\xf1\x51\xe1\x9c\xd6\x63\x84\x31\x7c" - "\x5d\x36\x0d\x3b\x45\xcf\x2c\xe4\x32\x13\xd2\xf0\xa2\x68\x80\xad" - "\x9b\x04\x7b\x84\x6d\x43\xc1\xfe\x82\xf8\x7c\x19\xf2\x89\xd3\xf4" - "\xec\x55\x2c\x7b\xf9\x0e\x05\xa5\xfb\x0a\xe0\xf8\xec\xcd\xc8\xd3" - "\x88\x30\xd3\x66\xa4\x85\x3e\xdd\xc1\xf9\x10\x3e\x8d\xcf\xf5\x23" - "\xdc\xac\xfb\x40\xe2\xb0\xef\xf0\xb9\x7b\x84\x59\xa3\xc2\x0a\xd8" - "\x5f\x2f\xc2\xec\x3a\xbc\x17\x98\xce\xf8\xce\xd2\x6d\x6e\x4e\x53" - "\xa1\x97\x1b\x63\x3f\xb1\x2f\xf2\x3b\x26\x66\xda\xe7\x3f\xf2\xf5" - "\x69\xf7\x3e\xbd\x74\xc9\xa2\x54\x92\x64\xcf\xc8\x74\xdc\x9c\x79" - "\x87\xe3\xd6\x7b\xec\xc5\x05\x05\xcb\xec\x2f\x16\x2c\x29\xb1\x2f" - "\x7c\x71\xe1\xca\x54\x5a\xb4\x74\xd9\xd3\x7c\x82\x9c\x9b\x65\x79" - "\xee\xd3\x8b\x7e\xc0\x8b\xfa\x2a\x75\x6a\xcc\x78\x3c\x9f\x65\x9b" - "\xee\x67\xe1\x08\x64\x6e\x50\xa4\xbc\xe9\xc2\x3b\xfb\x1e\xb2\xe1" - "\xd9\x8c\xdf\x3b\xf8\x1d\xc2\xef\x38\x7e\xc7\xce\xd0\xf3\xf3\xf1" - "\x3c\xd8\xe3\x2e\x9a\x6c\xe8\x05\x03\x3c\x54\x34\xcb\xe0\x21\x8c" - "\xe3\x07\xd5\xf8\x56\xe4\x68\x0d\xc9\xfe\xd3\xcf\x53\x95\x17\x07" - "\x78\x4a\xfa\x37\xe4\x3d\x2b\x2b\x10\x0f\x1e\x66\x3b\x16\x34\x4f" - "\x61\xba\x9d\xa6\xa5\xcf\xc1\xf6\x67\xbb\x86\xe7\x81\x9a\xc1\x2f" - "\x2d\xca\xdf\x46\x11\xdb\x42\x63\x51\xc6\x3b\x7a\x19\xea\x7b\x94" - "\x38\xc2\x76\xfe\x29\xfd\x5b\xd9\xc4\x4b\x87\xf0\x3b\x3f\xf5\xb5" - "\x22\x0b\xef\xff\x53\xb6\x95\x11\xf7\xdc\x2e\xbd\x0c\x0f\x68\xe1" - "\xaa\x73\x8b\xa0\x61\x83\xf0\x1c\x93\x25\xe9\x3e\x01\x7c\xce\x45" - "\x92\x1f\x6f\x93\x7e\xf9\x5c\xbd\x90\x11\x77\xde\xe9\x75\xc8\xf4" - "\x49\x3c\x07\x35\xb7\x58\x44\xd8\x2f\x6a\x24\xf9\xd9\x36\xce\x27" - "\xcc\x6f\xba\x22\x9b\x87\x67\x29\x5d\x80\xfd\xa1\x3d\xa7\xef\x03" - "\x15\x41\xa6\xed\x19\x2a\xba\x55\xd9\x33\xcf\xcf\x57\x7a\xd6\x73" - "\xeb\x8d\xbd\x64\xe8\xa3\x19\xf8\xae\x36\x64\x80\x8f\x9e\xcb\xd3" - "\xf7\xfd\x78\x54\xfd\x9f\x6b\xd1\xbf\x0f\xe9\x38\x26\xb1\x6f\x07" - "\xe0\x7f\x8c\xdb\x0e\xb6\xe1\x21\xbc\x1f\x07\x7d\x5a\x14\x7d\x9e" - "\x93\x73\x0c\xd0\x6b\x38\xfe\x38\xf2\x1d\x43\xdc\x71\xe5\x43\xe1" - "\x39\x13\xd7\x79\x60\x6f\x60\x6d\x16\x70\x1d\xc2\x6b\x6a\xe8\x4b" - "\x87\xbc\x17\xb9\x7f\x3e\xc7\xb0\x9b\x0c\xb9\xc3\x72\x26\x37\x8c" - "\x7e\x2a\xf5\xd2\x25\x53\x0d\x79\x33\xc0\x07\x4b\xb2\x13\xc9\x92" - "\x44\xed\xae\xe8\xbf\xe4\x37\xc2\xfd\x6c\x35\x70\x6a\x92\x6d\xc0" - "\x7e\x22\x2f\xf6\xeb\xbf\x7d\x4a\x46\x2e\xe9\xd7\x7f\x0d\x3c\xd8" - "\xdf\xad\x8f\x71\xeb\x95\xeb\x9c\xba\xdc\x58\xd2\x62\xc8\x0d\x03" - "\x8e\x25\x49\x44\x2c\x0e\xfc\x2b\xdf\x6d\xe2\x39\x56\x1e\x2f\xa5" - "\x3e\x02\x38\x23\x2e\xa8\x33\x3e\x91\x8a\xdd\x90\x7f\x4b\xd6\x43" - "\xc6\x98\xa4\x8e\xea\x7e\xf6\x67\x03\xb2\x68\xa9\x3d\x1a\xa6\x30" - "\xef\x36\x31\x5c\x96\x47\xac\x93\xe4\x86\x01\x2b\x65\xb7\x49\x1f" - "\x5f\x20\x83\x97\x66\x1b\xb8\x82\x86\x47\x0c\x7c\xf5\x3b\x32\x8e" - "\xa0\x9c\xa6\x79\xe1\x3e\xde\xeb\xda\xac\xda\xf3\x79\x29\x6f\x10" - "\xb7\x0f\x79\x37\xfa\xe8\x19\x9f\xde\x87\x5a\x90\x7f\xdf\xe1\xb2" - "\x19\x48\xb3\x74\x8f\xbe\x5f\xf3\x18\xda\xf7\x78\x14\xef\xef\x8a" - "\xb2\x97\x8f\xab\x36\xbc\xd7\x75\x8a\x96\x76\x44\x85\xeb\x6d\x7b" - "\x38\xfb\x14\x15\xef\x52\xb6\x67\x63\xb3\xca\x5f\x2c\xf7\x6c\x1a" - "\x38\xb2\x2c\xe0\xf3\x48\xdc\xc7\x25\xed\x65\x1b\x17\xdb\x8d\xf1" - "\x02\xb0\x0e\x4a\x9a\x8f\x12\xef\x30\x9d\x94\x2f\x83\x67\xff\xb7" - "\xa2\x53\xf1\xac\x18\xda\xf3\xb8\x89\x72\x98\x4e\x23\xd6\x8a\xc8" - "\x88\x40\x92\xc8\x5d\x69\x92\xbe\x9b\xb9\x8f\xf3\xda\x04\xf8\x43" - "\xea\x55\x8a\x6e\xc5\xe5\x06\xdd\x8c\xb6\x63\x3a\xf9\x68\x69\x90" - "\x69\x1b\x5b\xc7\x61\xc7\x4e\x19\x75\x07\x4d\x79\xbe\x14\xdf\xb5" - "\x7a\xbf\x68\xf1\x8c\xe6\xb5\xf2\xa2\xd7\x0f\x9b\xbe\x4e\x87\x1d" - "\x93\x49\xd1\xb6\x18\xf6\xdf\x33\xb3\x64\x3d\x14\xac\x23\x4c\x5f" - "\xee\x2b\xa2\x7c\x37\xe9\xbe\x84\x8e\xa8\xfd\x1a\x45\xb5\xa2\x62" - "\xb7\x2c\x93\x69\xd3\xad\x49\x7f\xa2\xc7\x98\x46\x2c\x17\xb9\x2f" - "\x71\x1f\xe0\xfe\xa4\x68\xf4\xfc\x8c\x28\x1a\x35\x33\x7d\x74\x3a" - "\x1d\x8c\x93\xe5\x05\xf6\xa2\x69\x4a\x16\xdb\x33\x6e\xce\x9f\x24" - "\x9d\x78\xd8\x1f\x9c\x7e\x8f\x3d\x7b\xda\xcd\x8e\xc2\xf1\x73\xd5" - "\x63\x7a\xf6\x6c\x7e\xa6\xc6\xda\x4f\x76\x94\xb3\x2f\xd6\x06\x7b" - "\x71\xbc\x92\x1f\xcf\x37\xfb\xa8\x57\xf2\x0d\x6c\xe5\xce\xca\xf3" - "\x44\x61\xa6\xe1\x12\xb4\x69\x79\x63\xc3\x3c\xc8\xe0\x79\x2b\xc5" - "\x67\xf5\x08\x67\x9f\xb4\xcc\x8b\x91\x8a\xc6\x06\xb6\x79\xfd\x29" - "\x27\xfc\xf8\x35\xf9\x53\xf6\x2e\x98\x79\xab\x53\xf4\xb8\x97\x59" - "\x8d\xba\xb0\x5d\x2c\x38\xbf\x43\x84\x99\x2e\xb9\x0e\xb4\x37\xf2" - "\xb1\x8d\x8c\x74\x53\x7c\xb4\xc8\xa5\x6c\xc3\x65\xa8\xff\xb3\xed" - "\xba\xfc\xca\xc6\xf7\x7c\x1f\x4d\x92\xdf\x11\xb7\x8d\xe7\xe7\x4c" - "\x91\x75\xb7\x3d\x0c\x1b\xa0\xc9\x80\x09\x58\x43\x75\x5f\x73\x12" - "\xde\x17\xdd\x2b\x18\xd9\xb0\xbb\xc6\x92\xa4\xfc\xda\xa1\x5f\xbb" - "\xea\xb5\x48\x4e\xff\x5e\x00\xc4\x8d\x58\x6b\xe5\xbd\x02\x39\xe0" - "\x37\x17\xa7\x31\xe2\x2a\xdd\x11\x5f\xa5\x16\x09\xa2\xed\xac\x4a" - "\x67\xee\x64\xb9\x06\xfb\x73\x39\x19\x63\x99\x1c\x03\x35\x72\x29" - "\x1b\x66\xb9\x5c\xe3\x3b\xef\x36\x21\xfe\xf9\xda\x1b\xd3\xa5\x5d" - "\x12\x8c\xb8\x93\x48\xed\xcf\x5c\x76\xc1\x90\xab\xbc\xc6\x62\x59" - "\x2b\xfc\x3c\xbf\x66\x09\x09\x3f\xaf\xb7\xc8\xf1\x82\xce\x90\xb7" - "\xb4\xc7\xc5\x7e\x47\xa5\xde\x83\x72\xd5\x58\x11\x56\x63\x05\xca" - "\x87\x2d\x9f\x87\x31\x21\xe9\x0c\x2d\x6b\x66\xfc\x99\x36\x3c\x87" - "\x1b\x01\xad\xbc\x3c\x36\x32\x7d\x52\x7f\x66\xe3\x75\x7e\xae\xab" - "\x25\x84\x3a\x47\xd7\x4b\x8b\xf8\x36\xbb\x51\x2f\x0d\xf5\x72\x74" - "\x31\xcf\x06\x79\xff\x05\xfa\xd8\x28\xe9\x5b\x57\xda\xd8\xcb\xdb" - "\xa3\xeb\xc8\x32\x5f\xd5\xa1\x64\x48\xa2\x3a\x0a\x8d\xeb\x28\x69" - "\xf0\xef\x7a\x1f\x93\x78\xb2\xcc\xe8\xa4\xe5\xa0\x31\xef\x7b\x68" - "\x6c\x00\x1f\x4d\xe7\x36\xc4\x98\x59\xc5\x78\x26\x6a\x2f\x86\xa7" - "\x60\x95\x34\x5a\xd6\xba\xf2\x7a\xdc\x25\xc5\x89\xe9\x5d\xf2\xca" - "\xe5\xe9\x5d\x52\xc0\xf9\x19\x0f\xde\x07\x62\x09\xc1\x40\x07\xdf" - "\xc2\x46\x2b\x4f\x54\xee\x88\xb5\x0d\x8c\x57\xc2\x38\xc8\x9d\xce" - "\x4a\x5d\xee\x80\x0f\xc5\x3c\xfc\x58\x0e\xf5\xb8\x5f\x48\x33\x64" - "\x90\x25\xc9\x9e\x2c\x65\x82\x26\xaa\x12\xc1\xb0\xac\xad\xe2\x7d" - "\x17\xd3\x51\x7e\xc2\x78\xd0\xd8\x0e\x1a\x55\x45\xd6\x7d\xed\x46" - "\x4b\x12\xdd\xe7\x4f\xfe\x5a\xaa\xc5\x11\x1a\xc7\x34\x04\x4c\x07" - "\xfa\xee\x35\x6c\x9b\x2a\x5f\x58\x2f\x60\xfc\x7f\x49\xfa\x96\xf1" - "\xa7\x34\x56\x29\x7f\x59\x2f\xd4\xf8\x68\x63\x86\x31\xaf\x89\xef" - "\x3d\x3e\xfa\x20\x4d\xf5\xcb\x6b\x77\x88\x0d\x7b\x33\x22\x6e\x8b" - "\xb0\xaf\xb2\x40\x77\x5c\x71\x7f\x44\x64\x68\x22\x75\x6f\xc6\x00" - "\x9f\xa8\x3d\x21\x06\x9f\x20\x7f\x47\x62\x1e\x58\x91\x72\x79\x1e" - "\x78\x41\xae\x17\x33\xdd\x95\x7d\xb2\x22\xd3\xd0\x4d\xc4\xba\x6b" - "\x77\xd8\xcb\xb8\xfc\x17\x9a\x55\xd9\x4c\x93\x2c\x9e\xab\x9f\x0d" - "\xba\xb8\x90\x76\x81\x21\x07\x98\x5f\x2c\x61\x4a\x62\x59\xc4\xbc" - "\x82\x38\x07\xe4\x4c\x9b\x9a\x43\xdc\xeb\x93\x77\x2c\xb9\x9f\xcf" - "\xf3\x3b\x0b\x77\xf2\x1e\xce\x40\xca\x6e\xe8\xfb\x2b\x6a\x7d\xf4" - "\x4b\x25\x8b\xcc\xbb\xc1\x73\xbb\x4d\xd5\x23\x31\x2e\xab\xbd\x4c" - "\x69\xdc\xa7\xd9\xe7\x0d\xf7\x6b\x84\xa5\x03\x6f\xf6\x7f\x03\x1b" - "\x67\x45\xbf\xff\x9b\x88\x3b\x0b\xb2\x42\xc8\xf1\x13\x63\xd1\x98" - "\x6e\xd0\x6e\xab\x16\xd9\x73\x71\x92\x8d\xb8\xce\x17\xd7\x8d\xde" - "\xf3\xa3\x89\x64\xfa\xdf\xb6\xa7\xa8\xf8\x0e\x4a\x5f\xfb\x75\x13" - "\xfd\xd7\x14\xd2\x98\x0e\x3e\x5a\xd1\xae\x68\xf7\xe2\x38\xa3\x7d" - "\x7c\xf4\xc2\x46\x6e\x0f\x9e\x7f\x9b\x17\x12\x9f\xa9\x39\xc2\x17" - "\x21\xff\xf2\x49\xc5\x3f\x7f\x28\x7e\xde\x87\x75\x78\xfb\xe2\xe5" - "\xf6\xfc\xa5\x2f\x2e\x19\x3b\x36\xc6\x3e\x32\xc9\x73\x1d\xee\x17" - "\x73\xd4\x18\xfa\xe2\x46\x03\x6f\xd6\x45\xf0\x8d\xfa\x3f\x5f\x1d" - "\x6f\xcf\xcd\xce\xd5\xb7\xee\xe6\x66\xd2\xc0\xfb\xed\x34\xfb\xf6" - "\xa8\xcf\x3b\x69\xf6\x1d\x77\xe6\x3e\x5c\xb0\x30\x7f\x65\x54\xe8" - "\x5d\xd1\x73\x72\x95\x3b\x50\x76\xf2\xe8\x07\x20\x2b\x92\xe6\xae" - "\xe6\xf1\xc4\xb1\xb6\x2c\x24\xfe\x06\x79\x3d\x05\x7d\x2c\xf7\x68" - "\x49\x88\x8e\x42\x96\x89\x6b\x59\x86\x0f\x53\xe7\xd5\xa0\x43\x81" - "\xb7\x2c\xa8\xbb\x1f\xba\xdc\x05\x9e\x93\x41\xbe\xdd\xad\x35\xec" - "\x6b\x76\x6f\xbe\xd2\x2b\x1c\x79\x08\xbf\x0a\xcf\x0a\x3c\x87\xe2" - "\xb9\xc9\xbe\x04\xb6\x0e\xef\x0f\x5e\xc1\xfb\x83\x1d\x2f\x30\x8d" - "\x26\x06\x5c\x34\x71\x19\xeb\xe9\x0e\x1b\xeb\x1d\x3e\x72\x1c\xe1" - "\xf5\x01\x4e\x8b\xb0\x85\xf6\x67\x28\x93\x9f\x42\xae\xab\x38\xf2" - "\x44\xc5\xde\x7c\xb1\x33\x87\xef\x70\x19\x87\xf0\xf7\x93\x93\x3e" - "\xa6\x64\xdb\xb0\xfb\x7b\xdc\x0e\x8c\x7f\xf9\xb2\xdf\x0e\x76\x5f" - "\x1a\xeb\x1a\xdc\xe7\x07\x74\x11\xe8\x82\xd0\x45\x72\x1d\x1b\x08" - "\xef\xa6\x01\x3d\x64\xa5\xb5\x5f\xa7\xd5\x28\x15\xdf\x76\x83\xdf" - "\xf1\x3e\xde\xe0\xc7\x18\xbf\x60\x4b\x4a\x0a\x96\x15\xe4\xdb\x6f" - "\x5e\x9e\x4a\x51\x5e\xc1\x0a\x0b\x96\xd8\x97\x15\x3c\xff\x42\xc1" - "\x72\xe9\xd1\x8b\x63\x63\xc6\xf3\x74\x91\xba\xa7\xc6\x38\xb3\x62" - "\x1f\xcd\x74\x5c\xf9\x0a\xfb\x92\x12\x1b\xde\xb0\xf1\xba\xa7\xb2" - "\x25\xba\x66\xc5\xda\x12\xab\xc7\x29\x1d\x6e\xef\x7c\x65\xc7\xac" - "\xfa\x0d\x7f\x9f\xa2\x55\x53\x07\x7c\x4e\xaf\xec\xe2\xfb\x0f\x74" - "\xfa\xfc\x19\x78\xb7\x1b\xf4\xf1\xd1\x6a\xe3\x1c\x41\xa7\x94\x13" - "\x18\x4b\x21\xe7\x62\xc6\x51\x75\x1f\xda\x4a\xde\x3b\x90\x2c\xe7" - "\x64\x53\xf6\xe6\x70\x59\x0c\xf3\x34\xf2\xa3\x1d\xe6\x43\x3e\xb2" - "\x1c\x2b\x37\xe0\xa1\xcc\xe3\x5c\x9e\x6e\xe3\x7c\xe5\x0c\xad\x92" - "\x6b\xd6\x91\xf2\xbd\x39\x2c\x3b\x26\x4a\x9d\x03\x70\xe4\x3a\xd6" - "\xea\x22\xd6\x1f\xa5\xdf\x73\xc0\xe2\x39\x58\xc8\x80\x42\xbe\x3b" - "\x8f\xc3\x94\x4f\xab\x95\x53\x78\x9e\x18\x65\x41\x9f\x58\xd5\x38" - "\xb0\x2f\x7b\x75\x11\xeb\x94\x0c\xd7\x47\xab\x0a\x19\x9e\xf2\xd9" - "\xb5\x0a\xba\xf5\x8b\x1d\x03\xba\xd1\xea\xb4\x28\x9b\x0b\xf8\x28" - "\x3c\x03\xc0\x45\xfa\x84\x54\xfb\xe6\x64\xbd\x59\x4e\x56\xeb\x75" - "\x37\xea\xd3\xe3\x5e\x6d\x03\xcf\x1d\x37\xd6\x5d\x7d\x7a\xbd\x19" - "\x3f\xc6\x3d\x1a\x67\x1d\xdf\x19\x8c\x2f\xf2\x65\x47\xf5\x61\x9e" - "\x73\x19\x82\xb0\xfc\x81\xfd\xb8\x2b\xf7\xc5\xcb\x87\x07\x16\x3e" - "\xfd\x2c\x1b\xe9\xb3\x33\xc7\xdb\x59\x56\xe4\x3e\x3c\x73\xfa\x77" - "\x73\xa7\xcf\x7b\x74\xee\x7c\xb9\xff\xbe\x3f\x7e\xc6\x92\xc4\x09" - "\x62\xf9\xca\x0a\xde\xc8\x46\x7b\x0d\x39\x45\x65\x76\xe5\x8f\x79" - "\x75\x47\xac\x3f\x66\xbe\x26\xab\x74\x0c\x7e\x53\x88\xd6\xd8\xf1" - "\x83\x1e\x59\x96\xae\xf3\xcb\xe9\x1e\x77\x69\xfa\x00\xbf\x94\xc9" - "\x39\x6f\xde\x97\xa0\xe6\x52\x4b\x21\xff\x57\xe6\x47\xc7\x0d\xd8" - "\x7e\xa5\xb3\xfb\x6d\xbf\x7e\x59\x50\xea\x30\xec\x40\x84\x2d\x80" - "\x0d\x98\xc2\x36\xa0\x9a\xfb\x29\x93\x3a\x56\xbc\xad\x36\x60\xa7" - "\x99\xc9\xb0\x01\xd9\x17\x24\xaf\x7b\xaa\x3e\x5a\x7a\x30\xca\xc6" - "\x0a\x48\x5f\x81\x17\x95\x4d\xc8\xf9\xe4\x5c\x9b\xb9\x6b\x32\xcf" - "\x3f\x43\xaf\xcd\xc6\x18\x8f\x71\xa7\x47\x88\x94\xae\xc9\x3a\x4e" - "\x01\x9e\x8f\x66\x7d\x57\xd9\x7b\xab\x1d\x2c\x7f\xc5\xba\xd1\x0f" - "\xcc\x0b\x4b\x3f\x6a\x90\xbd\x6b\x6c\x03\x3c\x57\x66\xe7\xb6\x64" - "\x1a\xf8\xa8\x74\x1c\xe8\x60\x1a\xa8\xf3\x9a\xac\xfe\x3a\xeb\xf3" - "\x18\xc6\x1c\x86\x2a\xab\x6c\xec\x60\xf5\x4b\x5c\xb7\x35\x55\x9f" - "\x5b\x37\x37\x0d\xe1\x7e\x61\xd4\xf1\xd2\xfa\xad\x39\x1e\x57\xbf" - "\x9a\x04\xf5\x0b\xf6\xaf\xbb\xf4\xcf\x4b\x94\x8d\xe5\x7a\x32\x1f" - "\xa0\x9e\xe6\x64\x9b\xd9\x1e\xf5\x7e\x4b\x22\xb9\x3a\x62\xad\xa6" - "\x9f\x01\x29\x7b\xa1\x79\x8c\xb4\xd3\x82\x5b\xb4\x48\xe1\x16\x37" - "\x7e\x78\xb2\x9e\x3d\xa0\xab\x8a\xa0\x4e\x93\x92\x66\xc8\x5e\x9e" - "\x6b\x19\xec\x6c\x1b\x68\x76\xd2\x98\x07\xc0\x7b\x1b\xdb\x93\xf3" - "\xc2\xf7\x09\x0e\x67\x1a\xc0\x26\xf1\x83\xaf\xda\x94\xde\x56\xd6" - "\xdc\x2f\xb3\x6f\x99\xea\x4a\x5e\x4b\xf6\xc3\xb5\x77\x70\xf8\x49" - "\xb4\x9d\x9c\x1b\x94\x77\xd7\x0d\x02\x33\x37\x9c\x45\x89\xe1\x3a" - "\xc7\x18\x70\x07\x3b\x07\x19\x1d\xb6\x74\x89\xbd\x70\xe1\x92\xfc" - "\xa5\x8b\x16\x8d\xb7\xbf\xb0\xe4\xa9\xa2\xa5\x4f\x3f\xcb\x82\x7f" - "\x79\xc9\x0b\xe8\xbf\xb2\xdf\xce\x98\x3d\x3b\xf7\x81\x47\x1f\xf9" - "\x7e\x8c\x0e\x60\xae\x72\x47\xca\xe5\x5d\x59\xeb\x9e\x59\x85\x32" - "\xd1\xfe\x8b\x0e\xa9\xf1\xc6\x89\xf1\xff\xa9\xd9\x4a\xd7\x7a\xbc" - "\x43\x9d\xfd\x74\x06\xa3\xe4\xda\x88\x33\xe4\x82\xfe\xe0\xcc\x1a" - "\x98\x03\x71\x1e\x8b\xd6\x21\xba\xe5\x7d\x75\xce\x76\xc3\x0f\x42" - "\xc9\x58\xd2\x4c\x63\xab\xa8\x5a\x13\x2e\x1f\xb9\xcc\xb0\x17\x4f" - "\xf6\xb8\x5d\x26\xe8\x86\x6d\xba\xfd\x78\x92\xd7\x58\xd9\x7e\x0c" - "\xc3\x96\x9c\xb7\xd2\x73\x5f\xee\xca\x24\xde\x43\x2c\xef\x49\x08" - "\x5d\x14\xed\xbc\xce\xc9\x6b\x46\x7c\x4f\x42\xe5\x33\xd2\x9e\x4c" - "\x96\x69\xf0\x5e\x79\x9a\xd4\x3d\x37\x21\xb2\xd7\xe3\xbd\x4e\xda" - "\x1f\xae\x7c\x43\xf7\xb4\xac\xb5\xcb\x33\xa9\x9b\x55\x7b\xb4\x71" - "\x5b\x70\x79\xb9\x2b\x3d\xaa\x0c\xb4\x01\xf2\x5a\xd4\xbc\x8f\xab" - "\xf6\xb2\xf3\xd9\x29\x27\x06\x3b\x1b\x09\x9e\x77\x0d\xdb\xa2\xfc" - "\x13\xf3\x3e\x38\xbf\xb1\x0f\x8b\xf7\x64\x01\x6e\x20\x7e\x4f\x97" - "\xda\x97\xb0\x36\xcd\xd8\x0f\x82\x77\x5b\xbf\xbe\xcc\x77\x6b\xc0" - "\xce\xb1\x97\xad\x1d\x7a\x96\x5c\xff\x5e\x3f\xc8\xbc\xb2\x71\x06" - "\x55\xdf\x37\x35\x0c\x30\xfa\xef\x3f\x16\xf8\xae\x1f\x35\x80\x07" - "\xe2\x1c\xc6\x7e\x22\xb9\x87\x0c\x63\x16\xdf\xdf\x71\x9a\xd6\xbe" - "\x26\xef\x0b\xb9\x91\xe7\x84\xd7\x1e\x6a\x96\x7b\xd9\xd6\x36\x46" - "\xe3\xa2\xf0\x58\x5b\xc0\xf3\x96\x1c\x1f\x8d\x8b\x63\xe1\x0b\x8b" - "\x27\x39\x16\x2d\xb6\x3f\x5d\xb8\xb8\x38\x77\xb1\xf4\x19\x2a\xdd" - "\x91\x96\xac\x2c\xe6\x59\xfa\x5b\x53\xe3\xc6\x0a\x7d\xdf\x59\xff" - "\xfe\x1a\xb9\xf7\xcc\x7d\x1d\xe8\xa1\xa9\xbd\x67\xeb\xac\x6a\x3c" - "\x74\x67\x5c\xba\xcf\xc2\x3d\xd5\xd8\x67\x01\xbe\xb2\x56\x2b\xff" - "\xe4\xfa\xde\x0c\xe6\x3b\xf7\x82\x04\x79\x8a\xfb\xf7\x19\xf1\x7e" - "\x97\xbe\x1c\x79\x46\x40\xfa\x92\x7e\x95\xdb\x6d\x6d\xb3\xd7\x31" - "\x93\x7d\x63\xea\xfc\xec\x6e\x30\xf8\xd9\xd8\xa3\xc6\xb0\xf8\x8c" - "\xc2\xa4\x60\xf4\xfe\x94\x75\x43\x30\xb6\xd8\xfa\xeb\xb1\x5a\x23" - "\xc6\x3d\xa0\x79\x18\x8f\xf6\x78\x3c\x80\xdf\x58\x84\x47\xed\xff" - "\x31\xea\xb9\x0e\xfa\xdf\xba\xfc\x78\x9e\xbb\x7f\xe6\x6c\x28\x73" - "\xcb\x0b\x4a\x52\x69\xfa\xc2\xa2\x22\xee\xd7\x0b\x0b\x8a\x5e\x58" - "\xb6\x74\x79\xee\xe2\x25\x8b\x11\x7a\xff\x22\x76\xe5\x2a\x93\xdc" - "\xa3\xc7\xd8\x97\x14\x14\xe4\xab\x20\xbd\x19\x62\xd7\x46\xd4\xfa" - "\xf7\x3a\xf4\xc3\xb5\x53\x06\xf4\x96\x75\x6d\x42\x5b\x37\x06\xbf" - "\xaf\xca\x3e\x2d\x75\x8a\x75\x8d\xb1\x76\xc1\xba\x83\x06\x3f\xc8" - "\xf6\x73\xf2\x1e\x91\xc6\xbb\xbb\x85\x5c\x4b\x40\x9b\xbd\xc4\x77" - "\x50\x0f\x81\xcd\x62\x66\x7d\x38\x0a\x4e\x67\x3f\x2d\xd7\x3d\xde" - "\xc6\xbc\xc8\xf0\xd0\xdf\x4c\x7c\x36\xbb\xc7\xbd\x1e\xfc\xef\xf2" - "\x28\xfe\x5f\xdf\xcf\xff\xdd\x5a\x32\x6c\x9c\xf5\x19\x86\x1e\x1c" - "\xdb\x67\xd6\x67\x5d\xda\x97\x78\xcf\xe0\xfa\x1c\x83\xb6\x46\x3b" - "\x2b\xde\x5a\x7f\xc1\x98\x9b\xac\xd7\x7d\x89\xf3\x3b\xe7\x65\x1d" - "\x57\x8c\x18\x7e\x1f\xef\x81\x3e\x45\xeb\x9b\x15\xbf\xac\x6f\x88" - "\xda\xcb\x63\x3d\x43\xeb\x3d\xaa\x9d\xd6\x1f\x32\xf0\xf3\xd1\x7a" - "\xd6\x6c\xe4\x1d\x85\xaa\xef\xaf\x9b\xa6\x78\x67\xfd\x49\x83\xb6" - "\x6c\x37\xe2\xbb\x73\x60\x4c\x5f\xb7\x91\xc7\x3a\xfd\x6c\x7a\x1f" - "\xd7\x1f\x70\x8a\x0c\x38\x3d\xee\x97\x50\x7f\x73\xb3\x41\x2b\x23" - "\x4d\x34\x4f\x4c\x5f\x58\x0c\xa3\x6e\xf1\xa2\x45\x05\xcb\x96\x1b" - "\xbe\x7a\x33\x96\x16\xe5\x2b\xdf\xbc\xf7\xa0\xf9\x5f\x44\x0f\x9c" - "\xc6\xee\x7d\x11\xaa\x5e\xe3\x6c\x80\xf1\x6c\x87\xcb\xfd\x5e\x52" - "\xff\xaf\x58\x5b\xa7\xdb\x02\xa7\xe8\x87\x2e\x3c\x21\x0f\x7e\x78" - "\x97\xd2\xcb\x52\xfe\x0b\x38\xed\x33\xf4\xb2\xee\xa1\x53\x60\x5f" - "\xbf\xf4\x8e\x71\xef\x92\xa1\x2b\xf0\x59\x14\xcf\x12\xf6\x75\x5e" - "\xf1\x49\xa4\xa2\xd1\x25\x52\xb7\xf0\xdc\x6e\x1a\xf3\xfd\xf0\x4e" - "\xf6\x83\xce\xfe\x62\x7e\x28\x75\x19\x96\x25\xec\xd3\xbc\x9d\x5e" - "\x6a\xe3\xbb\x8f\x7d\x54\xd1\xe1\x4f\x69\x74\xad\x5f\x45\xe6\x5d" - "\xdb\x44\x3b\xdf\xd7\xda\xdc\xc0\x74\xfc\xe1\xb8\xdf\x97\xaa\xfb" - "\xa8\xf9\x1e\xdf\x4d\x88\x03\x6f\xf9\xf5\xb9\xe4\x6a\x7d\x1e\xaf" - "\x1a\xe9\xa0\xff\xa5\x1d\x52\x7c\xb9\x35\xf7\xab\x2e\x72\xc8\x7b" - "\xd3\xdc\xbc\x0f\x68\x8b\x9f\xcf\xc8\x89\xf2\xad\x79\x8c\x2b\xf4" - "\x19\x3f\xf4\x20\xe4\xdb\x9a\x07\x58\xfb\x22\x15\xfb\x3d\xca\x57" - "\x34\xf3\xc8\x4b\xb5\x5c\x67\x99\x8f\xe7\x0c\xcb\x1b\x6b\xe5\xfd" - "\x6a\x15\x8d\x0e\xbd\xac\x5a\xe8\x75\xb3\x59\xb7\x13\x17\xbb\x1a" - "\xa0\x5b\xf2\x38\xe6\x1f\xb1\xd6\xc7\x3e\xae\x4b\x79\xfe\x73\x44" - "\xe0\x06\x01\x79\x30\x3c\x37\x64\x25\xe3\x3e\x25\x9e\xff\x54\x3a" - "\xd6\x0f\x03\x03\x73\xcd\xc8\x7f\x91\xd2\xc0\x9b\xae\x76\xfa\x91" - "\xdc\xff\xc4\x7c\xc9\x74\xec\x05\xed\x24\xde\x17\xbb\x9a\x60\x93" - "\x0e\x3f\x4d\x3f\xba\x9d\x69\xc8\x6b\x80\xbc\x77\x07\x61\x16\xf6" - "\x23\x7d\x8a\x7e\x74\x1d\xd3\x8f\x61\x89\xf2\x6a\x4f\xa8\x27\xe7" - "\x5b\x7c\x9e\x90\x65\xd3\x9a\x52\xe8\x81\x8b\xb8\x5f\x97\xbf\xce" - "\xb6\x1d\xdf\xf7\xc1\xef\xce\x7c\x11\x91\xf4\x5f\xc5\xf4\x2f\x7f" - "\x7d\x4d\x87\x88\x7c\xe6\x26\x71\x24\x40\xf4\x99\x46\xa1\xa0\x96" - "\xc4\xeb\x25\x9a\xb3\x8b\xcf\x3c\x36\x90\xd7\x51\x4e\x28\xd7\xbc" - "\x79\x15\x59\xf9\x8c\x28\xdf\x65\xd1\x1a\xa8\xa5\xd6\xe2\x5a\xfa" - "\xd7\x50\x35\x79\x56\xf0\x99\xff\x8a\x59\x7f\x72\x54\xf3\xba\x4a" - "\x0a\xde\x53\xec\xdf\xe5\xb2\x7e\xe4\xfb\xd3\xf1\x3f\xd3\x9f\x3c" - "\x7f\x26\xfb\x63\xf2\xdb\xdf\x92\xf3\xaf\xd4\x92\xf5\xaf\xe4\x6c" - "\x17\x11\xb6\x0f\xca\x9e\xe3\x32\xca\x01\xab\x81\xcf\x56\x5a\x23" - "\xdd\xb6\x54\xd4\xdf\x34\xcf\x41\xd4\x1a\xf0\x83\x9f\xfe\x17\xe3" - "\xf8\x7c\xdd\x79\x32\x7b\x96\xfc\x41\xbe\x2b\xbd\xbd\xab\xc1\x9b" - "\xdf\xc6\x3a\x53\x88\xcf\x92\xf2\x3a\x14\xf4\xde\x48\x25\xe3\x18" - "\x56\x78\xf3\x9d\xcc\x46\x7e\xe8\x54\x46\x7e\x79\x56\x7e\x17\xd3" - "\x03\x38\x1d\x9d\xaf\x68\xd2\xd2\x06\x9a\x7e\x57\xa7\x4f\x4e\x34" - "\x7d\x7e\x54\xc5\xf4\x61\x3f\x84\x91\x15\x5d\x0d\xc0\x2d\x0b\x34" - "\x88\x18\x65\x70\xfb\xeb\x73\x78\xe6\xcd\xe7\x29\xcd\xb3\x84\xef" - "\x25\x2a\xbf\x60\xc9\x36\x99\x23\x17\xcf\x36\x55\x5e\x20\x13\xb7" - "\x1b\xcf\xd5\x57\xca\x78\x49\x73\xc9\xf3\xd1\x77\x83\x33\x1f\xf2" - "\xfd\xe0\x68\xaf\x72\xe0\x50\x8c\xb6\x6a\xe0\xa7\xe2\xf3\xad\x79" - "\x7c\xd6\x5e\xd7\xeb\x07\xc2\xc1\xe7\x21\xbe\x7b\x50\xce\x51\x94" - "\x17\x33\x1f\x4b\xdb\x5e\x7b\x29\x73\x17\x64\x4e\xed\xab\x72\x5d" - "\x3b\xad\x6e\x24\x59\x59\x06\xef\x90\x7b\x89\x2b\x4a\x0c\x39\xb4" - "\x61\x14\x9f\x4f\x2a\x6f\xd0\xe4\xdd\x72\x8d\x35\x3a\x7f\xd7\x20" - "\x4d\x8d\x8f\xd2\x4f\x2a\x59\x5c\xd1\x68\xf4\x2b\xe8\x4c\x7e\x83" - "\xf7\x81\xab\xc3\xcf\xfc\x2e\xf7\x24\xf8\x60\xcf\x5a\xe4\x5d\x8a" - "\x03\xf7\xa9\x55\x9c\x34\xf8\x1c\x75\x6b\x62\x99\xc1\xfd\x7b\x30" - "\x9d\x1b\xfa\x5e\x8b\xd8\x99\xc3\xf7\xd5\x53\xda\x5a\xe1\x4f\x6b" - "\xb7\x08\xbe\xa3\x92\xcf\xb6\xf1\xbd\x89\x75\x08\x47\x7c\xd2\xdc" - "\x80\xdf\x02\xfd\x90\xef\x64\x32\x19\xe1\xbc\xd6\xc0\x73\x33\x73" - "\x03\xc2\x3f\x6f\xa5\x85\xef\x76\x1b\x23\xe7\x9f\xf5\xf0\x56\x1b" - "\xaf\x41\xf8\x2d\xa0\x5f\xa8\x1f\x56\x77\x4e\x32\xe3\x89\xb4\xe9" - "\xfd\x69\xbb\x73\x4c\x5e\x87\x2a\x33\x2a\x6c\xc8\x3c\x07\xf2\x72" - "\x7b\xeb\x61\x4a\xaf\xdc\xf0\x4e\xbf\xad\xc4\x3e\xfb\xba\x31\x0e" - "\x2e\xcf\x49\x8a\x74\xe7\x68\x61\xc0\x46\xff\xb1\xca\x3b\xe6\x42" - "\x7e\xfd\x9e\x97\x0e\xc8\x81\x36\x12\x15\x5d\xd9\x48\x67\x62\xb8" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 21:37:41 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F62A106566C; Thu, 14 Jan 2010 21:37:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2ED8FC14; Thu, 14 Jan 2010 21:37: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 o0ELbfOo053193; Thu, 14 Jan 2010 21:37:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELbfir053190; Thu, 14 Jan 2010 21:37:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142137.o0ELbfir053190@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 21:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202308 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:37:41 -0000 Author: yongari Date: Thu Jan 14 21:37:40 2010 New Revision: 202308 URL: http://svn.freebsd.org/changeset/base/202308 Log: MFC r200798,200801,200803-200804,200808,200810 r200798: Use ANSI function definations. r200801: o Remove unnecessary return statement. o Remove register keyword. r200803: s/u_intXX_t/uintXX_t/g r200804: Remove trailing white spaces. r200808: style(9) r200810: Sort function prototyes. Also remove mergeinfo recorded in if_ste.c/if_stereg.h. Modified: stable/7/sys/dev/ste/if_ste.c (contents, props changed) stable/7/sys/dev/ste/if_stereg.h (contents, props changed) Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 21:34:12 2010 (r202307) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 21:37:40 2010 (r202308) @@ -91,45 +91,44 @@ static struct ste_type ste_devs[] = { { 0, 0, NULL } }; -static int ste_probe(device_t); -static int ste_attach(device_t); -static int ste_detach(device_t); -static void ste_init(void *); -static void ste_init_locked(struct ste_softc *); -static void ste_intr(void *); -static void ste_rxeoc(struct ste_softc *); -static void ste_rxeof(struct ste_softc *); -static void ste_txeoc(struct ste_softc *); -static void ste_txeof(struct ste_softc *); -static void ste_stats_update(void *); -static void ste_stop(struct ste_softc *); -static void ste_reset(struct ste_softc *); -static int ste_ioctl(struct ifnet *, u_long, caddr_t); -static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); -static void ste_start(struct ifnet *); -static void ste_start_locked(struct ifnet *); -static void ste_watchdog(struct ste_softc *); -static int ste_shutdown(device_t); -static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, - struct mbuf *); -static int ste_ifmedia_upd(struct ifnet *); -static void ste_ifmedia_upd_locked(struct ifnet *); -static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); - -static void ste_mii_sync(struct ste_softc *); -static void ste_mii_send(struct ste_softc *, u_int32_t, int); -static int ste_mii_readreg(struct ste_softc *, struct ste_mii_frame *); -static int ste_mii_writereg(struct ste_softc *, struct ste_mii_frame *); -static int ste_miibus_readreg(device_t, int, int); -static int ste_miibus_writereg(device_t, int, int, int); -static void ste_miibus_statchg(device_t); - -static int ste_eeprom_wait(struct ste_softc *); -static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); -static void ste_wait(struct ste_softc *); -static void ste_setmulti(struct ste_softc *); -static int ste_init_rx_list(struct ste_softc *); -static void ste_init_tx_list(struct ste_softc *); +static int ste_attach(device_t); +static int ste_detach(device_t); +static int ste_probe(device_t); +static int ste_shutdown(device_t); + +static int ste_eeprom_wait(struct ste_softc *); +static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); +static int ste_ifmedia_upd(struct ifnet *); +static void ste_ifmedia_upd_locked(struct ifnet *); +static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void ste_init(void *); +static void ste_init_locked(struct ste_softc *); +static int ste_init_rx_list(struct ste_softc *); +static void ste_init_tx_list(struct ste_softc *); +static void ste_intr(void *); +static int ste_ioctl(struct ifnet *, u_long, caddr_t); +static int ste_mii_readreg(struct ste_softc *, struct ste_mii_frame *); +static void ste_mii_send(struct ste_softc *, uint32_t, int); +static void ste_mii_sync(struct ste_softc *); +static int ste_mii_writereg(struct ste_softc *, struct ste_mii_frame *); +static int ste_miibus_readreg(device_t, int, int); +static void ste_miibus_statchg(device_t); +static int ste_miibus_writereg(device_t, int, int, int); +static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, + struct mbuf *); +static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); +static void ste_reset(struct ste_softc *); +static void ste_rxeoc(struct ste_softc *); +static void ste_rxeof(struct ste_softc *); +static void ste_setmulti(struct ste_softc *); +static void ste_start(struct ifnet *); +static void ste_start_locked(struct ifnet *); +static void ste_stats_update(void *); +static void ste_stop(struct ste_softc *); +static void ste_txeoc(struct ste_softc *); +static void ste_txeof(struct ste_softc *); +static void ste_wait(struct ste_softc *); +static void ste_watchdog(struct ste_softc *); #ifdef STE_USEIOSPACE #define STE_RES SYS_RES_IOPORT @@ -194,16 +193,15 @@ SYSCTL_INT(_hw_ste, OID_AUTO, rxsyncs, C #define MII_SET(x) STE_SETBIT1(sc, STE_PHYCTL, x) -#define MII_CLR(x) STE_CLRBIT1(sc, STE_PHYCTL, x) +#define MII_CLR(x) STE_CLRBIT1(sc, STE_PHYCTL, x) /* * Sync the PHYs by setting data bit and strobing the clock 32 times. */ static void -ste_mii_sync(sc) - struct ste_softc *sc; +ste_mii_sync(struct ste_softc *sc) { - register int i; + int i; MII_SET(STE_PHYCTL_MDIR|STE_PHYCTL_MDATA); @@ -213,20 +211,15 @@ ste_mii_sync(sc) MII_CLR(STE_PHYCTL_MCLK); DELAY(1); } - - return; } /* * Clock a series of bits through the MII. */ static void -ste_mii_send(sc, bits, cnt) - struct ste_softc *sc; - u_int32_t bits; - int cnt; +ste_mii_send(struct ste_softc *sc, uint32_t bits, int cnt) { - int i; + int i; MII_CLR(STE_PHYCTL_MCLK); @@ -247,12 +240,9 @@ ste_mii_send(sc, bits, cnt) * Read an PHY register through the MII. */ static int -ste_mii_readreg(sc, frame) - struct ste_softc *sc; - struct ste_mii_frame *frame; - +ste_mii_readreg(struct ste_softc *sc, struct ste_mii_frame *frame) { - int i, ack; + int i, ack; /* * Set up frame for RX. @@ -261,7 +251,7 @@ ste_mii_readreg(sc, frame) frame->mii_opcode = STE_MII_READOP; frame->mii_turnaround = 0; frame->mii_data = 0; - + CSR_WRITE_2(sc, STE_PHYCTL, 0); /* * Turn on data xmit. @@ -299,7 +289,7 @@ ste_mii_readreg(sc, frame) * need to clock through 16 cycles to keep the PHY(s) in sync. */ if (ack) { - for(i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { MII_CLR(STE_PHYCTL_MCLK); DELAY(1); MII_SET(STE_PHYCTL_MCLK); @@ -328,18 +318,15 @@ fail: DELAY(1); if (ack) - return(1); - return(0); + return (1); + return (0); } /* * Write to a PHY register through the MII. */ static int -ste_mii_writereg(sc, frame) - struct ste_softc *sc; - struct ste_mii_frame *frame; - +ste_mii_writereg(struct ste_softc *sc, struct ste_mii_frame *frame) { /* @@ -349,7 +336,7 @@ ste_mii_writereg(sc, frame) frame->mii_stdelim = STE_MII_STARTDELIM; frame->mii_opcode = STE_MII_WRITEOP; frame->mii_turnaround = STE_MII_TURNAROUND; - + /* * Turn on data output. */ @@ -375,16 +362,14 @@ ste_mii_writereg(sc, frame) */ MII_CLR(STE_PHYCTL_MDIR); - return(0); + return (0); } static int -ste_miibus_readreg(dev, phy, reg) - device_t dev; - int phy, reg; +ste_miibus_readreg(device_t dev, int phy, int reg) { - struct ste_softc *sc; - struct ste_mii_frame frame; + struct ste_softc *sc; + struct ste_mii_frame frame; sc = device_get_softc(dev); @@ -397,16 +382,14 @@ ste_miibus_readreg(dev, phy, reg) frame.mii_regaddr = reg; ste_mii_readreg(sc, &frame); - return(frame.mii_data); + return (frame.mii_data); } static int -ste_miibus_writereg(dev, phy, reg, data) - device_t dev; - int phy, reg, data; +ste_miibus_writereg(device_t dev, int phy, int reg, int data) { - struct ste_softc *sc; - struct ste_mii_frame frame; + struct ste_softc *sc; + struct ste_mii_frame frame; sc = device_get_softc(dev); bzero((char *)&frame, sizeof(frame)); @@ -417,15 +400,14 @@ ste_miibus_writereg(dev, phy, reg, data) ste_mii_writereg(sc, &frame); - return(0); + return (0); } static void -ste_miibus_statchg(dev) - device_t dev; +ste_miibus_statchg(device_t dev) { - struct ste_softc *sc; - struct mii_data *mii; + struct ste_softc *sc; + struct mii_data *mii; sc = device_get_softc(dev); @@ -436,30 +418,26 @@ ste_miibus_statchg(dev) } else { STE_CLRBIT2(sc, STE_MACCTL0, STE_MACCTL0_FULLDUPLEX); } - - return; } - + static int -ste_ifmedia_upd(ifp) - struct ifnet *ifp; +ste_ifmedia_upd(struct ifnet *ifp) { - struct ste_softc *sc; + struct ste_softc *sc; sc = ifp->if_softc; STE_LOCK(sc); ste_ifmedia_upd_locked(ifp); STE_UNLOCK(sc); - return(0); + return (0); } static void -ste_ifmedia_upd_locked(ifp) - struct ifnet *ifp; +ste_ifmedia_upd_locked(struct ifnet *ifp) { - struct ste_softc *sc; - struct mii_data *mii; + struct ste_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; STE_LOCK_ASSERT(sc); @@ -474,12 +452,10 @@ ste_ifmedia_upd_locked(ifp) } static void -ste_ifmedia_sts(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +ste_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct ste_softc *sc; - struct mii_data *mii; + struct ste_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; mii = device_get_softc(sc->ste_miibus); @@ -489,15 +465,12 @@ ste_ifmedia_sts(ifp, ifmr) ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; STE_UNLOCK(sc); - - return; } static void -ste_wait(sc) - struct ste_softc *sc; +ste_wait(struct ste_softc *sc) { - register int i; + int i; for (i = 0; i < STE_TIMEOUT; i++) { if (!(CSR_READ_4(sc, STE_DMACTL) & STE_DMACTL_DMA_HALTINPROG)) @@ -506,8 +479,6 @@ ste_wait(sc) if (i == STE_TIMEOUT) device_printf(sc->ste_dev, "command never completed!\n"); - - return; } /* @@ -515,10 +486,9 @@ ste_wait(sc) * it a command. */ static int -ste_eeprom_wait(sc) - struct ste_softc *sc; +ste_eeprom_wait(struct ste_softc *sc) { - int i; + int i; DELAY(1000); @@ -531,10 +501,10 @@ ste_eeprom_wait(sc) if (i == 100) { device_printf(sc->ste_dev, "eeprom failed to come ready\n"); - return(1); + return (1); } - return(0); + return (0); } /* @@ -542,18 +512,13 @@ ste_eeprom_wait(sc) * data is stored in the EEPROM in network byte order. */ static int -ste_read_eeprom(sc, dest, off, cnt, swap) - struct ste_softc *sc; - caddr_t dest; - int off; - int cnt; - int swap; +ste_read_eeprom(struct ste_softc *sc, caddr_t dest, int off, int cnt, int swap) { - int err = 0, i; - u_int16_t word = 0, *ptr; + uint16_t word, *ptr; + int err = 0, i; if (ste_eeprom_wait(sc)) - return(1); + return (1); for (i = 0; i < cnt; i++) { CSR_WRITE_2(sc, STE_EEPROM_CTL, STE_EEOPCODE_READ | (off + i)); @@ -561,24 +526,23 @@ ste_read_eeprom(sc, dest, off, cnt, swap if (err) break; word = CSR_READ_2(sc, STE_EEPROM_DATA); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (swap) *ptr = ntohs(word); else - *ptr = word; + *ptr = word; } - return(err ? 1 : 0); + return (err ? 1 : 0); } static void -ste_setmulti(sc) - struct ste_softc *sc; +ste_setmulti(struct ste_softc *sc) { - struct ifnet *ifp; - int h = 0; - u_int32_t hashes[2] = { 0, 0 }; - struct ifmultiaddr *ifma; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t hashes[2] = { 0, 0 }; + int h; ifp = sc->ste_ifp; if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { @@ -613,8 +577,6 @@ ste_setmulti(sc) CSR_WRITE_2(sc, STE_MAR3, (hashes[1] >> 16) & 0xFFFF); STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_ALLMULTI); STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_MULTIHASH); - - return; } #ifdef DEVICE_POLLING @@ -647,7 +609,7 @@ ste_poll_locked(struct ifnet *ifp, enum ste_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { - u_int16_t status; + uint16_t status; status = CSR_READ_2(sc, STE_ISR_ACK); @@ -671,12 +633,11 @@ ste_poll_locked(struct ifnet *ifp, enum #endif /* DEVICE_POLLING */ static void -ste_intr(xsc) - void *xsc; +ste_intr(void *xsc) { - struct ste_softc *sc; - struct ifnet *ifp; - u_int16_t status; + struct ste_softc *sc; + struct ifnet *ifp; + uint16_t status; sc = xsc; STE_LOCK(sc); @@ -734,8 +695,6 @@ ste_intr(xsc) ste_start_locked(ifp); STE_UNLOCK(sc); - - return; } static void @@ -766,20 +725,19 @@ ste_rxeoc(struct ste_softc *sc) * the higher level protocols. */ static void -ste_rxeof(sc) - struct ste_softc *sc; +ste_rxeof(struct ste_softc *sc) { - struct mbuf *m; - struct ifnet *ifp; - struct ste_chain_onefrag *cur_rx; - int total_len = 0, count=0; - u_int32_t rxstat; + struct mbuf *m; + struct ifnet *ifp; + struct ste_chain_onefrag *cur_rx; + uint32_t rxstat; + int total_len = 0, count = 0; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - while((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status) + while ((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status) & STE_RXSTAT_DMADONE) { #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { @@ -820,7 +778,7 @@ ste_rxeof(sc) continue; } - /* No errors; receive the packet. */ + /* No errors; receive the packet. */ m = cur_rx->ste_mbuf; total_len = cur_rx->ste_ptr->ste_status & STE_RXSTAT_FRAMELEN; @@ -853,11 +811,10 @@ ste_rxeof(sc) } static void -ste_txeoc(sc) - struct ste_softc *sc; +ste_txeoc(struct ste_softc *sc) { - u_int8_t txstat; - struct ifnet *ifp; + struct ifnet *ifp; + uint8_t txstat; ifp = sc->ste_ifp; @@ -888,22 +845,19 @@ ste_txeoc(sc) ste_init_locked(sc); CSR_WRITE_2(sc, STE_TX_STATUS, txstat); } - - return; } static void -ste_txeof(sc) - struct ste_softc *sc; +ste_txeof(struct ste_softc *sc) { - struct ste_chain *cur_tx; - struct ifnet *ifp; - int idx; + struct ifnet *ifp; + struct ste_chain *cur_tx; + int idx; ifp = sc->ste_ifp; idx = sc->ste_cdata.ste_tx_cons; - while(idx != sc->ste_cdata.ste_tx_prod) { + while (idx != sc->ste_cdata.ste_tx_prod) { cur_tx = &sc->ste_cdata.ste_tx_chain[idx]; if (!(cur_tx->ste_ptr->ste_ctl & STE_TXCTL_DMADONE)) @@ -923,12 +877,11 @@ ste_txeof(sc) } static void -ste_stats_update(xsc) - void *xsc; +ste_stats_update(void *xsc) { - struct ste_softc *sc; - struct ifnet *ifp; - struct mii_data *mii; + struct ste_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; sc = xsc; STE_LOCK_ASSERT(sc); @@ -958,8 +911,6 @@ ste_stats_update(xsc) if (sc->ste_timer > 0 && --sc->ste_timer == 0) ste_watchdog(sc); callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); - - return; } @@ -968,14 +919,13 @@ ste_stats_update(xsc) * IDs against our list and return a device name if we find a match. */ static int -ste_probe(dev) - device_t dev; +ste_probe(device_t dev) { - struct ste_type *t; + struct ste_type *t; t = ste_devs; - while(t->ste_name != NULL) { + while (t->ste_name != NULL) { if ((pci_get_vendor(dev) == t->ste_vid) && (pci_get_device(dev) == t->ste_did)) { device_set_desc(dev, t->ste_name); @@ -984,7 +934,7 @@ ste_probe(dev) t++; } - return(ENXIO); + return (ENXIO); } /* @@ -992,13 +942,12 @@ ste_probe(dev) * setup and ethernet/BPF attach. */ static int -ste_attach(dev) - device_t dev; +ste_attach(device_t dev) { - struct ste_softc *sc; - struct ifnet *ifp; - int error = 0, rid; - u_char eaddr[6]; + struct ste_softc *sc; + struct ifnet *ifp; + u_char eaddr[6]; + int error = 0, rid; sc = device_get_softc(dev); sc->ste_dev = dev; @@ -1127,7 +1076,7 @@ fail: if (error) ste_detach(dev); - return(error); + return (error); } /* @@ -1138,11 +1087,10 @@ fail: * allocated. */ static int -ste_detach(dev) - device_t dev; +ste_detach(device_t dev) { - struct ste_softc *sc; - struct ifnet *ifp; + struct ste_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->ste_mtx), ("ste mutex not initialized")); @@ -1182,25 +1130,22 @@ ste_detach(dev) mtx_destroy(&sc->ste_mtx); - return(0); + return (0); } static int -ste_newbuf(sc, c, m) - struct ste_softc *sc; - struct ste_chain_onefrag *c; - struct mbuf *m; +ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *c, struct mbuf *m) { - struct mbuf *m_new = NULL; + struct mbuf *m_new = NULL; if (m == NULL) { MGETHDR(m_new, M_DONTWAIT, MT_DATA); if (m_new == NULL) - return(ENOBUFS); + return (ENOBUFS); MCLGET(m_new, M_DONTWAIT); if (!(m_new->m_flags & M_EXT)) { m_freem(m_new); - return(ENOBUFS); + return (ENOBUFS); } m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; } else { @@ -1216,16 +1161,15 @@ ste_newbuf(sc, c, m) c->ste_ptr->ste_frag.ste_addr = vtophys(mtod(m_new, caddr_t)); c->ste_ptr->ste_frag.ste_len = (1536 + ETHER_VLAN_ENCAP_LEN) | STE_FRAG_LAST; - return(0); + return (0); } static int -ste_init_rx_list(sc) - struct ste_softc *sc; +ste_init_rx_list(struct ste_softc *sc) { - struct ste_chain_data *cd; - struct ste_list_data *ld; - int i; + struct ste_chain_data *cd; + struct ste_list_data *ld; + int i; cd = &sc->ste_cdata; ld = sc->ste_ldata; @@ -1233,7 +1177,7 @@ ste_init_rx_list(sc) for (i = 0; i < STE_RX_LIST_CNT; i++) { cd->ste_rx_chain[i].ste_ptr = &ld->ste_rx_list[i]; if (ste_newbuf(sc, &cd->ste_rx_chain[i], NULL) == ENOBUFS) - return(ENOBUFS); + return (ENOBUFS); if (i == (STE_RX_LIST_CNT - 1)) { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; @@ -1250,16 +1194,15 @@ ste_init_rx_list(sc) cd->ste_rx_head = &cd->ste_rx_chain[0]; - return(0); + return (0); } static void -ste_init_tx_list(sc) - struct ste_softc *sc; +ste_init_tx_list(struct ste_softc *sc) { - struct ste_chain_data *cd; - struct ste_list_data *ld; - int i; + struct ste_chain_data *cd; + struct ste_list_data *ld; + int i; cd = &sc->ste_cdata; ld = sc->ste_ldata; @@ -1278,15 +1221,12 @@ ste_init_tx_list(sc) cd->ste_tx_prod = 0; cd->ste_tx_cons = 0; - - return; } static void -ste_init(xsc) - void *xsc; +ste_init(void *xsc) { - struct ste_softc *sc; + struct ste_softc *sc; sc = xsc; STE_LOCK(sc); @@ -1295,11 +1235,10 @@ ste_init(xsc) } static void -ste_init_locked(sc) - struct ste_softc *sc; +ste_init_locked(struct ste_softc *sc) { - int i; - struct ifnet *ifp; + struct ifnet *ifp; + int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; @@ -1389,7 +1328,7 @@ ste_init_locked(sc) /* Disable interrupts if we are polling. */ if (ifp->if_capenable & IFCAP_POLLING) CSR_WRITE_2(sc, STE_IMR, 0); - else + else #endif /* Enable interrupts. */ CSR_WRITE_2(sc, STE_IMR, STE_INTRS); @@ -1403,16 +1342,13 @@ ste_init_locked(sc) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); - - return; } static void -ste_stop(sc) - struct ste_softc *sc; +ste_stop(struct ste_softc *sc) { - int i; - struct ifnet *ifp; + struct ifnet *ifp; + int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; @@ -1427,8 +1363,8 @@ ste_stop(sc) STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); ste_wait(sc); - /* - * Try really hard to stop the RX engine or under heavy RX + /* + * Try really hard to stop the RX engine or under heavy RX * data chip will write into de-allocated memory. */ ste_reset(sc); @@ -1450,15 +1386,12 @@ ste_stop(sc) } bzero(sc->ste_ldata, sizeof(struct ste_list_data)); - - return; } static void -ste_reset(sc) - struct ste_softc *sc; +ste_reset(struct ste_softc *sc) { - int i; + int i; STE_SETBIT4(sc, STE_ASICCTL, STE_ASICCTL_GLOBAL_RESET|STE_ASICCTL_RX_RESET| @@ -1476,25 +1409,20 @@ ste_reset(sc) if (i == STE_TIMEOUT) device_printf(sc->ste_dev, "global reset never completed\n"); - - return; } static int -ste_ioctl(ifp, command, data) - struct ifnet *ifp; - u_long command; - caddr_t data; -{ - struct ste_softc *sc; - struct ifreq *ifr; - struct mii_data *mii; - int error = 0; +ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +{ + struct ste_softc *sc; + struct ifreq *ifr; + struct mii_data *mii; + int error = 0; sc = ifp->if_softc; ifr = (struct ifreq *)data; - switch(command) { + switch (command) { case SIOCSIFFLAGS: STE_LOCK(sc); if (ifp->if_flags & IFF_UP) { @@ -1508,7 +1436,7 @@ ste_ioctl(ifp, command, data) sc->ste_if_flags & IFF_PROMISC) { STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } + } if (ifp->if_drv_flags & IFF_DRV_RUNNING && (ifp->if_flags ^ sc->ste_if_flags) & IFF_ALLMULTI) ste_setmulti(sc); @@ -1542,14 +1470,14 @@ ste_ioctl(ifp, command, data) !(ifp->if_capenable & IFCAP_POLLING)) { error = ether_poll_register(ste_poll, ifp); if (error) - return(error); + return (error); STE_LOCK(sc); /* Disable interrupts */ CSR_WRITE_2(sc, STE_IMR, 0); ifp->if_capenable |= IFCAP_POLLING; STE_UNLOCK(sc); return (error); - + } if (!(ifr->ifr_reqcap & IFCAP_POLLING) && ifp->if_capenable & IFCAP_POLLING) { @@ -1568,19 +1496,16 @@ ste_ioctl(ifp, command, data) break; } - return(error); + return (error); } static int -ste_encap(sc, c, m_head) - struct ste_softc *sc; - struct ste_chain *c; - struct mbuf *m_head; -{ - int frag = 0; - struct ste_frag *f = NULL; - struct mbuf *m; - struct ste_desc *d; +ste_encap(struct ste_softc *sc, struct ste_chain *c, struct mbuf *m_head) +{ + struct mbuf *m; + struct ste_desc *d; + struct ste_frag *f = NULL; + int frag = 0; d = c->ste_ptr; d->ste_ctl = 0; @@ -1618,14 +1543,13 @@ encap_retry: d->ste_frags[frag - 1].ste_len |= STE_FRAG_LAST; d->ste_ctl = 1; - return(0); + return (0); } static void -ste_start(ifp) - struct ifnet *ifp; +ste_start(struct ifnet *ifp) { - struct ste_softc *sc; + struct ste_softc *sc; sc = ifp->if_softc; STE_LOCK(sc); @@ -1634,13 +1558,12 @@ ste_start(ifp) } static void -ste_start_locked(ifp) - struct ifnet *ifp; +ste_start_locked(struct ifnet *ifp) { - struct ste_softc *sc; - struct mbuf *m_head = NULL; - struct ste_chain *cur_tx; - int idx; + struct ste_softc *sc; + struct ste_chain *cur_tx; + struct mbuf *m_head = NULL; + int idx; sc = ifp->if_softc; STE_LOCK_ASSERT(sc); @@ -1653,7 +1576,7 @@ ste_start_locked(ifp) idx = sc->ste_cdata.ste_tx_prod; - while(sc->ste_cdata.ste_tx_chain[idx].ste_mbuf == NULL) { + while (sc->ste_cdata.ste_tx_chain[idx].ste_mbuf == NULL) { /* * We cannot re-use the last (free) descriptor; * the chip may not have read its ste_next yet. @@ -1686,7 +1609,7 @@ ste_start_locked(ifp) /* Set TX polling interval to start TX engine */ CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 64); - + STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); }else{ @@ -1707,14 +1630,12 @@ ste_start_locked(ifp) sc->ste_timer = 5; } sc->ste_cdata.ste_tx_prod = idx; - - return; } static void ste_watchdog(struct ste_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp; ifp = sc->ste_ifp; STE_LOCK_ASSERT(sc); @@ -1731,15 +1652,12 @@ ste_watchdog(struct ste_softc *sc) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); - - return; } static int -ste_shutdown(dev) - device_t dev; +ste_shutdown(device_t dev) { - struct ste_softc *sc; + struct ste_softc *sc; sc = device_get_softc(dev); Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 21:34:12 2010 (r202307) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 21:37:40 2010 (r202308) @@ -96,7 +96,7 @@ #define STE_LATE_COLLS 0x75 #define STE_MULTI_COLLS 0x76 -#define STE_SINGLE_COLLS 0x77 +#define STE_SINGLE_COLLS 0x77 #define STE_DMACTL_RXDMA_STOPPED 0x00000001 #define STE_DMACTL_TXDMA_CMPREQ 0x00000002 @@ -386,27 +386,27 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 21:45:39 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5813C1065672; Thu, 14 Jan 2010 21:45:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45B958FC13; Thu, 14 Jan 2010 21:45: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 o0ELjdxZ055004; Thu, 14 Jan 2010 21:45:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELjdj2055001; Thu, 14 Jan 2010 21:45:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142145.o0ELjdj2055001@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 21:45: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: r202309 - stable/8/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:45:39 -0000 Author: yongari Date: Thu Jan 14 21:45:39 2010 New Revision: 202309 URL: http://svn.freebsd.org/changeset/base/202309 Log: MFC r200853: Add bus_dma(9) and endianness support to ste(4). o Sorted includes and added missing header files. o Added basic endianness support. In theory ste(4) should work on any architectures. o Remove the use of contigmalloc(9), contigfree(9) and vtophys(9). o Added 8 byte alignment limitation of TX/RX descriptor. o Added 1 byte alignment requirement for TX/RX buffers. o ste(4) controllers does not support DAC. Limit DMA address space to be within 32bit address. o Added spare DMA map to gracefully recover from DMA map failure. o Removed dead code for checking STE_RXSTAT_DMADONE bit. The bit was already checked in each iteration of loop so it can't be true. o Added second argument count to ste_rxeof(). It is used to limit number of iterations done in RX handler. ATM polling is the only consumer. o Removed ste_rxeoc() which was added to address RX stuck issue (cvs rev 1.66). Unlike TX descriptors, ST201 supports chaining descriptors to form a ring for RX descriptors. If RX descriptor chaining is not supported it's possible for controller to stop receiving incoming frames once controller pass the end of RX descriptor which in turn requires driver post new RX descriptors to receive more frames. For TX descriptors which does not support chaning, we exactly do manual chaining in driver by concatenating new descriptors to the end of previous TX chain. Maybe the workaround was borrowed from other drivers that does not support RX descriptor chaining, which is not valid for ST201 controllers. I still have no idea how this address RX stuck issue and I can't reproduce the RX stuck issue on DFE-550TX controller. o Removed hw.ste_rxsyncs sysctl as the workaround was removed. o TX/RX side bus_dmamap_load_mbuf_sg(9) support. o Reimplemented optimized ste_encap(). o Simplified TX logic of ste_start_locked(). o Added comments for TFD/RFD requirements. o Increased number of RX descriptors to 128 from 64. 128 gave much better performance than 64 under high network loads. Modified: stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/ste/if_stereg.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) Modified: stable/8/sys/dev/ste/if_ste.c ============================================================================== --- stable/8/sys/dev/ste/if_ste.c Thu Jan 14 21:37:40 2010 (r202308) +++ stable/8/sys/dev/ste/if_ste.c Thu Jan 14 21:45:39 2010 (r202309) @@ -39,14 +39,19 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include #include +#include +#include +#include #include +#include #include +#include #include +#include #include #include #include @@ -55,14 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include - -#include /* for vtophys */ -#include /* for vtophys */ #include #include -#include -#include #include #include @@ -70,13 +69,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" #define STE_USEIOSPACE -#include - MODULE_DEPEND(ste, pci, 1, 1, 1); MODULE_DEPEND(ste, ether, 1, 1, 1); MODULE_DEPEND(ste, miibus, 1, 1, 1); @@ -96,8 +95,12 @@ static int ste_detach(device_t); static int ste_probe(device_t); static int ste_shutdown(device_t); +static int ste_dma_alloc(struct ste_softc *); +static void ste_dma_free(struct ste_softc *); +static void ste_dmamap_cb(void *, bus_dma_segment_t *, int, int); static int ste_eeprom_wait(struct ste_softc *); -static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); +static int ste_encap(struct ste_softc *, struct mbuf **, + struct ste_chain *); static int ste_ifmedia_upd(struct ifnet *); static void ste_ifmedia_upd_locked(struct ifnet *); static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -114,12 +117,10 @@ static int ste_mii_writereg(struct ste_s static int ste_miibus_readreg(device_t, int, int); static void ste_miibus_statchg(device_t); static int ste_miibus_writereg(device_t, int, int, int); -static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, - struct mbuf *); +static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); static void ste_reset(struct ste_softc *); -static void ste_rxeoc(struct ste_softc *); -static int ste_rxeof(struct ste_softc *); +static int ste_rxeof(struct ste_softc *, int); static void ste_setmulti(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); @@ -168,11 +169,6 @@ static devclass_t ste_devclass; DRIVER_MODULE(ste, pci, ste_driver, ste_devclass, 0, 0); DRIVER_MODULE(miibus, ste, miibus_driver, miibus_devclass, 0, 0); -SYSCTL_NODE(_hw, OID_AUTO, ste, CTLFLAG_RD, 0, "if_ste parameters"); - -static int ste_rxsyncs; -SYSCTL_INT(_hw_ste, OID_AUTO, rxsyncs, CTLFLAG_RW, &ste_rxsyncs, 0, ""); - #define STE_SETBIT4(sc, reg, x) \ CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) | (x)) @@ -603,10 +599,7 @@ ste_poll_locked(struct ifnet *ifp, enum STE_LOCK_ASSERT(sc); - sc->rxcycles = count; - if (cmd == POLL_AND_CHECK_STATUS) - ste_rxeoc(sc); - rx_npkts = ste_rxeof(sc); + rx_npkts = ste_rxeof(sc, count); ste_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); @@ -666,10 +659,8 @@ ste_intr(void *xsc) if (!(status & STE_INTRS)) break; - if (status & STE_ISR_RX_DMADONE) { - ste_rxeoc(sc); - ste_rxeof(sc); - } + if (status & STE_ISR_RX_DMADONE) + ste_rxeof(sc, -1); if (status & STE_ISR_TX_DMADONE) ste_txeof(sc); @@ -701,62 +692,40 @@ ste_intr(void *xsc) STE_UNLOCK(sc); } -static void -ste_rxeoc(struct ste_softc *sc) -{ - struct ste_chain_onefrag *cur_rx; - - STE_LOCK_ASSERT(sc); - - if (sc->ste_cdata.ste_rx_head->ste_ptr->ste_status == 0) { - cur_rx = sc->ste_cdata.ste_rx_head; - do { - cur_rx = cur_rx->ste_next; - /* If the ring is empty, just return. */ - if (cur_rx == sc->ste_cdata.ste_rx_head) - return; - } while (cur_rx->ste_ptr->ste_status == 0); - if (sc->ste_cdata.ste_rx_head->ste_ptr->ste_status == 0) { - /* We've fallen behind the chip: catch it. */ - sc->ste_cdata.ste_rx_head = cur_rx; - ++ste_rxsyncs; - } - } -} - /* * A frame has been uploaded: pass the resulting mbuf chain up to * the higher level protocols. */ static int -ste_rxeof(struct ste_softc *sc) +ste_rxeof(struct ste_softc *sc, int count) { struct mbuf *m; struct ifnet *ifp; struct ste_chain_onefrag *cur_rx; uint32_t rxstat; - int total_len = 0, count = 0, rx_npkts = 0; - - STE_LOCK_ASSERT(sc); + int total_len, rx_npkts; ifp = sc->ste_ifp; - while ((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status) - & STE_RXSTAT_DMADONE) { + bus_dmamap_sync(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + cur_rx = sc->ste_cdata.ste_rx_head; + for (rx_npkts = 0; rx_npkts < STE_RX_LIST_CNT; rx_npkts++, + cur_rx = cur_rx->ste_next) { + rxstat = le32toh(cur_rx->ste_ptr->ste_status); + if ((rxstat & STE_RXSTAT_DMADONE) == 0) + break; #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { - if (sc->rxcycles <= 0) + if (count == 0) break; - sc->rxcycles--; + count--; } #endif - if ((STE_RX_LIST_CNT - count) < 3) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - } - - cur_rx = sc->ste_cdata.ste_rx_head; - sc->ste_cdata.ste_rx_head = cur_rx->ste_next; - /* * If an error occurs, update stats, clear the * status word and leave the mbuf cluster in place: @@ -769,22 +738,9 @@ ste_rxeof(struct ste_softc *sc) continue; } - /* - * If there error bit was not set, the upload complete - * bit should be set which means we have a valid packet. - * If not, something truly strange has happened. - */ - if (!(rxstat & STE_RXSTAT_DMADONE)) { - device_printf(sc->ste_dev, - "bad receive status -- packet dropped\n"); - ifp->if_ierrors++; - cur_rx->ste_ptr->ste_status = 0; - continue; - } - /* No errors; receive the packet. */ m = cur_rx->ste_mbuf; - total_len = cur_rx->ste_ptr->ste_status & STE_RXSTAT_FRAMELEN; + total_len = STE_RX_BYTES(rxstat); /* * Try to conjure up a new mbuf cluster. If that @@ -793,7 +749,7 @@ ste_rxeof(struct ste_softc *sc) * result in a lost packet, but there's little else we * can do in this situation. */ - if (ste_newbuf(sc, cur_rx, NULL) == ENOBUFS) { + if (ste_newbuf(sc, cur_rx) != 0) { ifp->if_ierrors++; cur_rx->ste_ptr->ste_status = 0; continue; @@ -806,10 +762,13 @@ ste_rxeof(struct ste_softc *sc) STE_UNLOCK(sc); (*ifp->if_input)(ifp, m); STE_LOCK(sc); + } - cur_rx->ste_ptr->ste_status = 0; - count++; - rx_npkts++; + if (rx_npkts > 0) { + sc->ste_cdata.ste_rx_head = cur_rx; + bus_dmamap_sync(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } return (rx_npkts); @@ -857,27 +816,40 @@ ste_txeof(struct ste_softc *sc) { struct ifnet *ifp; struct ste_chain *cur_tx; + uint32_t txstat; int idx; - ifp = sc->ste_ifp; + STE_LOCK_ASSERT(sc); + ifp = sc->ste_ifp; idx = sc->ste_cdata.ste_tx_cons; + if (idx == sc->ste_cdata.ste_tx_prod) + return; + + bus_dmamap_sync(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + while (idx != sc->ste_cdata.ste_tx_prod) { cur_tx = &sc->ste_cdata.ste_tx_chain[idx]; - - if (!(cur_tx->ste_ptr->ste_ctl & STE_TXCTL_DMADONE)) + txstat = le32toh(cur_tx->ste_ptr->ste_ctl); + if ((txstat & STE_TXCTL_DMADONE) == 0) break; - + bus_dmamap_sync(sc->ste_cdata.ste_tx_tag, cur_tx->ste_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->ste_cdata.ste_tx_tag, cur_tx->ste_map); + KASSERT(cur_tx->ste_mbuf != NULL, + ("%s: freeing NULL mbuf!\n", __func__)); m_freem(cur_tx->ste_mbuf); cur_tx->ste_mbuf = NULL; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_opackets++; - + sc->ste_cdata.ste_tx_cnt--; STE_INC(idx, STE_TX_LIST_CNT); } sc->ste_cdata.ste_tx_cons = idx; - if (idx == sc->ste_cdata.ste_tx_prod) + if (sc->ste_cdata.ste_tx_cnt == 0) sc->ste_timer = 0; } @@ -1012,17 +984,8 @@ ste_attach(device_t dev) goto fail; } - /* Allocate the descriptor queues. */ - sc->ste_ldata = contigmalloc(sizeof(struct ste_list_data), M_DEVBUF, - M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0); - - if (sc->ste_ldata == NULL) { - device_printf(dev, "no memory for list buffers!\n"); - error = ENXIO; + if ((error = ste_dma_alloc(sc)) != 0) goto fail; - } - - bzero(sc->ste_ldata, sizeof(struct ste_list_data)); ifp = sc->ste_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -1128,44 +1091,325 @@ ste_detach(device_t dev) if (ifp) if_free(ifp); - if (sc->ste_ldata) { - contigfree(sc->ste_ldata, sizeof(struct ste_list_data), - M_DEVBUF); - } - + ste_dma_free(sc); mtx_destroy(&sc->ste_mtx); return (0); } +struct ste_dmamap_arg { + bus_addr_t ste_busaddr; +}; + +static void +ste_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct ste_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct ste_dmamap_arg *)arg; + ctx->ste_busaddr = segs[0].ds_addr; +} + static int -ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *c, struct mbuf *m) +ste_dma_alloc(struct ste_softc *sc) { - struct mbuf *m_new = NULL; + struct ste_chain *txc; + struct ste_chain_onefrag *rxc; + struct ste_dmamap_arg ctx; + int error, i; + + /* Create parent DMA tag. */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc->ste_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_parent_tag); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create parent DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Tx descriptor list. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + STE_DESC_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + STE_TX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + STE_TX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_tx_list_tag); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Tx list DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Rx descriptor list. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + STE_DESC_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + STE_RX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + STE_RX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_rx_list_tag); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Rx list DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Tx buffers. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES * STE_MAXFRAGS, /* maxsize */ + STE_MAXFRAGS, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_tx_tag); + if (error != 0) { + device_printf(sc->ste_dev, "could not create Tx DMA tag.\n"); + goto fail; + } - if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) - return (ENOBUFS); - MCLGET(m_new, M_DONTWAIT); - if (!(m_new->m_flags & M_EXT)) { - m_freem(m_new); - return (ENOBUFS); + /* Create DMA tag for Rx buffers. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_rx_tag); + if (error != 0) { + device_printf(sc->ste_dev, "could not create Rx DMA tag.\n"); + goto fail; + } + + /* Allocate DMA'able memory and load the DMA map for Tx list. */ + error = bus_dmamem_alloc(sc->ste_cdata.ste_tx_list_tag, + (void **)&sc->ste_ldata.ste_tx_list, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->ste_cdata.ste_tx_list_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not allocate DMA'able memory for Tx list.\n"); + goto fail; + } + ctx.ste_busaddr = 0; + error = bus_dmamap_load(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, sc->ste_ldata.ste_tx_list, + STE_TX_LIST_SZ, ste_dmamap_cb, &ctx, 0); + if (error != 0 || ctx.ste_busaddr == 0) { + device_printf(sc->ste_dev, + "could not load DMA'able memory for Tx list.\n"); + goto fail; + } + sc->ste_ldata.ste_tx_list_paddr = ctx.ste_busaddr; + + /* Allocate DMA'able memory and load the DMA map for Rx list. */ + error = bus_dmamem_alloc(sc->ste_cdata.ste_rx_list_tag, + (void **)&sc->ste_ldata.ste_rx_list, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->ste_cdata.ste_rx_list_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not allocate DMA'able memory for Rx list.\n"); + goto fail; + } + ctx.ste_busaddr = 0; + error = bus_dmamap_load(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, sc->ste_ldata.ste_rx_list, + STE_RX_LIST_SZ, ste_dmamap_cb, &ctx, 0); + if (error != 0 || ctx.ste_busaddr == 0) { + device_printf(sc->ste_dev, + "could not load DMA'able memory for Rx list.\n"); + goto fail; + } + sc->ste_ldata.ste_rx_list_paddr = ctx.ste_busaddr; + + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < STE_TX_LIST_CNT; i++) { + txc = &sc->ste_cdata.ste_tx_chain[i]; + txc->ste_ptr = NULL; + txc->ste_mbuf = NULL; + txc->ste_next = NULL; + txc->ste_phys = 0; + txc->ste_map = NULL; + error = bus_dmamap_create(sc->ste_cdata.ste_tx_tag, 0, + &txc->ste_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + /* Create DMA maps for Rx buffers. */ + if ((error = bus_dmamap_create(sc->ste_cdata.ste_rx_tag, 0, + &sc->ste_cdata.ste_rx_sparemap)) != 0) { + device_printf(sc->ste_dev, + "could not create spare Rx dmamap.\n"); + goto fail; + } + for (i = 0; i < STE_RX_LIST_CNT; i++) { + rxc = &sc->ste_cdata.ste_rx_chain[i]; + rxc->ste_ptr = NULL; + rxc->ste_mbuf = NULL; + rxc->ste_next = NULL; + rxc->ste_map = NULL; + error = bus_dmamap_create(sc->ste_cdata.ste_rx_tag, 0, + &rxc->ste_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Rx dmamap.\n"); + goto fail; } - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - } else { - m_new = m; - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - m_new->m_data = m_new->m_ext.ext_buf; } - m_adj(m_new, ETHER_ALIGN); +fail: + return (error); +} - c->ste_mbuf = m_new; - c->ste_ptr->ste_status = 0; - c->ste_ptr->ste_frag.ste_addr = vtophys(mtod(m_new, caddr_t)); - c->ste_ptr->ste_frag.ste_len = (1536 + ETHER_VLAN_ENCAP_LEN) | STE_FRAG_LAST; +static void +ste_dma_free(struct ste_softc *sc) +{ + struct ste_chain *txc; + struct ste_chain_onefrag *rxc; + int i; + /* Tx buffers. */ + if (sc->ste_cdata.ste_tx_tag != NULL) { + for (i = 0; i < STE_TX_LIST_CNT; i++) { + txc = &sc->ste_cdata.ste_tx_chain[i]; + if (txc->ste_map != NULL) { + bus_dmamap_destroy(sc->ste_cdata.ste_tx_tag, + txc->ste_map); + txc->ste_map = NULL; + } + } + bus_dma_tag_destroy(sc->ste_cdata.ste_tx_tag); + sc->ste_cdata.ste_tx_tag = NULL; + } + /* Rx buffers. */ + if (sc->ste_cdata.ste_rx_tag != NULL) { + for (i = 0; i < STE_RX_LIST_CNT; i++) { + rxc = &sc->ste_cdata.ste_rx_chain[i]; + if (rxc->ste_map != NULL) { + bus_dmamap_destroy(sc->ste_cdata.ste_rx_tag, + rxc->ste_map); + rxc->ste_map = NULL; + } + } + if (sc->ste_cdata.ste_rx_sparemap != NULL) { + bus_dmamap_destroy(sc->ste_cdata.ste_rx_tag, + sc->ste_cdata.ste_rx_sparemap); + sc->ste_cdata.ste_rx_sparemap = NULL; + } + bus_dma_tag_destroy(sc->ste_cdata.ste_rx_tag); + sc->ste_cdata.ste_rx_tag = NULL; + } + /* Tx descriptor list. */ + if (sc->ste_cdata.ste_tx_list_tag != NULL) { + if (sc->ste_cdata.ste_tx_list_map != NULL) + bus_dmamap_unload(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map); + if (sc->ste_cdata.ste_tx_list_map != NULL && + sc->ste_ldata.ste_tx_list != NULL) + bus_dmamem_free(sc->ste_cdata.ste_tx_list_tag, + sc->ste_ldata.ste_tx_list, + sc->ste_cdata.ste_tx_list_map); + sc->ste_ldata.ste_tx_list = NULL; + sc->ste_cdata.ste_tx_list_map = NULL; + bus_dma_tag_destroy(sc->ste_cdata.ste_tx_list_tag); + sc->ste_cdata.ste_tx_list_tag = NULL; + } + /* Rx descriptor list. */ + if (sc->ste_cdata.ste_rx_list_tag != NULL) { + if (sc->ste_cdata.ste_rx_list_map != NULL) + bus_dmamap_unload(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map); + if (sc->ste_cdata.ste_rx_list_map != NULL && + sc->ste_ldata.ste_rx_list != NULL) + bus_dmamem_free(sc->ste_cdata.ste_rx_list_tag, + sc->ste_ldata.ste_rx_list, + sc->ste_cdata.ste_rx_list_map); + sc->ste_ldata.ste_rx_list = NULL; + sc->ste_cdata.ste_rx_list_map = NULL; + bus_dma_tag_destroy(sc->ste_cdata.ste_rx_list_tag); + sc->ste_cdata.ste_rx_list_tag = NULL; + } + if (sc->ste_cdata.ste_parent_tag != NULL) { + bus_dma_tag_destroy(sc->ste_cdata.ste_parent_tag); + sc->ste_cdata.ste_parent_tag = NULL; + } +} + +static int +ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *rxc) +{ + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int error, nsegs; + + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MCLBYTES; + m_adj(m, ETHER_ALIGN); + + if ((error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_rx_tag, + sc->ste_cdata.ste_rx_sparemap, m, segs, &nsegs, 0)) != 0) { + m_freem(m); + return (error); + } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + if (rxc->ste_mbuf != NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_rx_tag, rxc->ste_map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->ste_cdata.ste_rx_tag, rxc->ste_map); + } + map = rxc->ste_map; + rxc->ste_map = sc->ste_cdata.ste_rx_sparemap; + sc->ste_cdata.ste_rx_sparemap = map; + bus_dmamap_sync(sc->ste_cdata.ste_rx_tag, rxc->ste_map, + BUS_DMASYNC_PREREAD); + rxc->ste_mbuf = m; + rxc->ste_ptr->ste_status = 0; + rxc->ste_ptr->ste_frag.ste_addr = htole32(segs[0].ds_addr); + rxc->ste_ptr->ste_frag.ste_len = htole32(segs[0].ds_len | + STE_FRAG_LAST); return (0); } @@ -1174,30 +1418,31 @@ ste_init_rx_list(struct ste_softc *sc) { struct ste_chain_data *cd; struct ste_list_data *ld; - int i; + int error, i; cd = &sc->ste_cdata; - ld = sc->ste_ldata; - + ld = &sc->ste_ldata; + bzero(ld->ste_rx_list, STE_RX_LIST_SZ); for (i = 0; i < STE_RX_LIST_CNT; i++) { cd->ste_rx_chain[i].ste_ptr = &ld->ste_rx_list[i]; - if (ste_newbuf(sc, &cd->ste_rx_chain[i], NULL) == ENOBUFS) - return (ENOBUFS); + error = ste_newbuf(sc, &cd->ste_rx_chain[i]); + if (error != 0) + return (error); if (i == (STE_RX_LIST_CNT - 1)) { - cd->ste_rx_chain[i].ste_next = - &cd->ste_rx_chain[0]; - ld->ste_rx_list[i].ste_next = - vtophys(&ld->ste_rx_list[0]); + cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; + ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * 0); } else { - cd->ste_rx_chain[i].ste_next = - &cd->ste_rx_chain[i + 1]; - ld->ste_rx_list[i].ste_next = - vtophys(&ld->ste_rx_list[i + 1]); + cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[i + 1]; + ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * (i + 1)); } - ld->ste_rx_list[i].ste_status = 0; } cd->ste_rx_head = &cd->ste_rx_chain[0]; + bus_dmamap_sync(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } @@ -1210,22 +1455,32 @@ ste_init_tx_list(struct ste_softc *sc) int i; cd = &sc->ste_cdata; - ld = sc->ste_ldata; + ld = &sc->ste_ldata; + bzero(ld->ste_tx_list, STE_TX_LIST_SZ); for (i = 0; i < STE_TX_LIST_CNT; i++) { cd->ste_tx_chain[i].ste_ptr = &ld->ste_tx_list[i]; - cd->ste_tx_chain[i].ste_ptr->ste_next = 0; - cd->ste_tx_chain[i].ste_ptr->ste_ctl = 0; - cd->ste_tx_chain[i].ste_phys = vtophys(&ld->ste_tx_list[i]); - if (i == (STE_TX_LIST_CNT - 1)) - cd->ste_tx_chain[i].ste_next = - &cd->ste_tx_chain[0]; - else - cd->ste_tx_chain[i].ste_next = - &cd->ste_tx_chain[i + 1]; + cd->ste_tx_chain[i].ste_mbuf = NULL; + if (i == (STE_TX_LIST_CNT - 1)) { + cd->ste_tx_chain[i].ste_next = &cd->ste_tx_chain[0]; + cd->ste_tx_chain[i].ste_phys = htole32(STE_ADDR_LO( + ld->ste_tx_list_paddr + + (sizeof(struct ste_desc) * 0))); + } else { + cd->ste_tx_chain[i].ste_next = &cd->ste_tx_chain[i + 1]; + cd->ste_tx_chain[i].ste_phys = htole32(STE_ADDR_LO( + ld->ste_tx_list_paddr + + (sizeof(struct ste_desc) * (i + 1)))); + } } + cd->ste_last_tx = NULL; cd->ste_tx_prod = 0; cd->ste_tx_cons = 0; + cd->ste_tx_cnt = 0; + + bus_dmamap_sync(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } static void @@ -1258,7 +1513,7 @@ ste_init_locked(struct ste_softc *sc) } /* Init RX list */ - if (ste_init_rx_list(sc) == ENOBUFS) { + if (ste_init_rx_list(sc) != 0) { device_printf(sc->ste_dev, "initialization failed: no memory for RX buffers\n"); ste_stop(sc); @@ -1303,11 +1558,11 @@ ste_init_locked(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); ste_wait(sc); CSR_WRITE_4(sc, STE_RX_DMALIST_PTR, - vtophys(&sc->ste_ldata->ste_rx_list[0])); + STE_ADDR_LO(sc->ste_ldata.ste_rx_list_paddr)); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_UNSTALL); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_UNSTALL); - /* Set TX polling interval (defer until we TX first packet */ + /* Set TX polling interval(defer until we TX first packet). */ CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 0); /* Load address of the TX list */ @@ -1317,7 +1572,6 @@ ste_init_locked(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); - sc->ste_tx_prev = NULL; /* Enable receiver and transmitter */ CSR_WRITE_2(sc, STE_MACCTL0, 0); @@ -1353,6 +1607,8 @@ static void ste_stop(struct ste_softc *sc) { struct ifnet *ifp; + struct ste_chain_onefrag *cur_rx; + struct ste_chain *cur_tx; int i; STE_LOCK_ASSERT(sc); @@ -1377,20 +1633,28 @@ ste_stop(struct ste_softc *sc) sc->ste_link = 0; for (i = 0; i < STE_RX_LIST_CNT; i++) { - if (sc->ste_cdata.ste_rx_chain[i].ste_mbuf != NULL) { - m_freem(sc->ste_cdata.ste_rx_chain[i].ste_mbuf); - sc->ste_cdata.ste_rx_chain[i].ste_mbuf = NULL; + cur_rx = &sc->ste_cdata.ste_rx_chain[i]; + if (cur_rx->ste_mbuf != NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_rx_tag, + cur_rx->ste_map, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->ste_cdata.ste_rx_tag, + cur_rx->ste_map); + m_freem(cur_rx->ste_mbuf); + cur_rx->ste_mbuf = NULL; } } for (i = 0; i < STE_TX_LIST_CNT; i++) { - if (sc->ste_cdata.ste_tx_chain[i].ste_mbuf != NULL) { - m_freem(sc->ste_cdata.ste_tx_chain[i].ste_mbuf); - sc->ste_cdata.ste_tx_chain[i].ste_mbuf = NULL; + cur_tx = &sc->ste_cdata.ste_tx_chain[i]; + if (cur_tx->ste_mbuf != NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_tx_tag, + cur_tx->ste_map, BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->ste_cdata.ste_tx_tag, + cur_tx->ste_map); + m_freem(cur_tx->ste_mbuf); + cur_tx->ste_mbuf = NULL; } } - - bzero(sc->ste_ldata, sizeof(struct ste_list_data)); } static void @@ -1505,48 +1769,60 @@ ste_ioctl(struct ifnet *ifp, u_long comm } static int -ste_encap(struct ste_softc *sc, struct ste_chain *c, struct mbuf *m_head) +ste_encap(struct ste_softc *sc, struct mbuf **m_head, struct ste_chain *txc) { + struct ste_frag *frag; struct mbuf *m; - struct ste_desc *d; - struct ste_frag *f = NULL; - int frag = 0; - - d = c->ste_ptr; - d->ste_ctl = 0; - -encap_retry: - for (m = m_head, frag = 0; m != NULL; m = m->m_next) { - if (m->m_len != 0) { - if (frag == STE_MAXFRAGS) - break; - f = &d->ste_frags[frag]; - f->ste_addr = vtophys(mtod(m, vm_offset_t)); - f->ste_len = m->m_len; - frag++; - } - } + struct ste_desc *desc; + bus_dma_segment_t txsegs[STE_MAXFRAGS]; + int error, i, nsegs; - if (m != NULL) { - struct mbuf *mn; + STE_LOCK_ASSERT(sc); + M_ASSERTPKTHDR((*m_head)); - /* - * We ran out of segments. We have to recopy this - * mbuf chain first. Bail out if we can't get the - * new buffers. - */ - mn = m_defrag(m_head, M_DONTWAIT); - if (mn == NULL) { - m_freem(m_head); - return ENOMEM; - } - m_head = mn; - goto encap_retry; + error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_tx_tag, + txc->ste_map, *m_head, txsegs, &nsegs, 0); + if (error == EFBIG) { + m = m_collapse(*m_head, M_DONTWAIT, STE_MAXFRAGS); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOMEM); + } + *m_head = m; + error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_tx_tag, + txc->ste_map, *m_head, txsegs, &nsegs, 0); + if (error != 0) { + m_freem(*m_head); + *m_head = NULL; + return (error); + } + } else if (error != 0) + return (error); + if (nsegs == 0) { + m_freem(*m_head); + *m_head = NULL; + return (EIO); + } + bus_dmamap_sync(sc->ste_cdata.ste_tx_tag, txc->ste_map, + BUS_DMASYNC_PREWRITE); + + desc = txc->ste_ptr; + for (i = 0; i < nsegs; i++) { + frag = &desc->ste_frags[i]; + frag->ste_addr = htole32(STE_ADDR_LO(txsegs[i].ds_addr)); + frag->ste_len = htole32(txsegs[i].ds_len); } - - c->ste_mbuf = m_head; - d->ste_frags[frag - 1].ste_len |= STE_FRAG_LAST; - d->ste_ctl = 1; + desc->ste_frags[i - 1].ste_len |= htole32(STE_FRAG_LAST); + /* + * Because we use Tx polling we can't chain multiple + * Tx descriptors here. Otherwise we race with controller. + */ + desc->ste_next = 0; + desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | STE_TXCTL_DMAINTR); + txc->ste_mbuf = *m_head; + STE_INC(sc->ste_cdata.ste_tx_prod, STE_TX_LIST_CNT); + sc->ste_cdata.ste_tx_cnt++; return (0); } @@ -1568,7 +1844,7 @@ ste_start_locked(struct ifnet *ifp) struct ste_softc *sc; struct ste_chain *cur_tx; struct mbuf *m_head = NULL; - int idx; + int enq; sc = ifp->if_softc; STE_LOCK_ASSERT(sc); @@ -1579,62 +1855,56 @@ ste_start_locked(struct ifnet *ifp) if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - idx = sc->ste_cdata.ste_tx_prod; - - while (sc->ste_cdata.ste_tx_chain[idx].ste_mbuf == NULL) { - /* - * We cannot re-use the last (free) descriptor; - * the chip may not have read its ste_next yet. - */ - if (STE_NEXT(idx, STE_TX_LIST_CNT) == - sc->ste_cdata.ste_tx_cons) { + for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) { + if (sc->ste_cdata.ste_tx_cnt == STE_TX_LIST_CNT - 1) { + /* + * Controller may have cached copy of the last used + * next ptr so we have to reserve one TFD to avoid + * TFD overruns. + */ ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } - IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; - - cur_tx = &sc->ste_cdata.ste_tx_chain[idx]; - - if (ste_encap(sc, cur_tx, m_head) != 0) + cur_tx = &sc->ste_cdata.ste_tx_chain[sc->ste_cdata.ste_tx_prod]; + if (ste_encap(sc, &m_head, cur_tx) != 0) { + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); break; - - cur_tx->ste_ptr->ste_next = 0; - - if (sc->ste_tx_prev == NULL) { - cur_tx->ste_ptr->ste_ctl = STE_TXCTL_DMAINTR | 1; - /* Load address of the TX list */ + } + if (sc->ste_cdata.ste_last_tx == NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); ste_wait(sc); - CSR_WRITE_4(sc, STE_TX_DMALIST_PTR, - vtophys(&sc->ste_ldata->ste_tx_list[0])); - - /* Set TX polling interval to start TX engine */ + STE_ADDR_LO(sc->ste_ldata.ste_tx_list_paddr)); CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 64); - STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 21:54:21 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8541065670; Thu, 14 Jan 2010 21:54:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A1D18FC15; Thu, 14 Jan 2010 21:54: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 o0ELsLxD056964; Thu, 14 Jan 2010 21:54:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ELsLLg056961; Thu, 14 Jan 2010 21:54:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142154.o0ELsLLg056961@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 21:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202310 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:54:21 -0000 Author: yongari Date: Thu Jan 14 21:54:20 2010 New Revision: 202310 URL: http://svn.freebsd.org/changeset/base/202310 Log: MFC r200853: Add bus_dma(9) and endianness support to ste(4). o Sorted includes and added missing header files. o Added basic endianness support. In theory ste(4) should work on any architectures. o Remove the use of contigmalloc(9), contigfree(9) and vtophys(9). o Added 8 byte alignment limitation of TX/RX descriptor. o Added 1 byte alignment requirement for TX/RX buffers. o ste(4) controllers does not support DAC. Limit DMA address space to be within 32bit address. o Added spare DMA map to gracefully recover from DMA map failure. o Removed dead code for checking STE_RXSTAT_DMADONE bit. The bit was already checked in each iteration of loop so it can't be true. o Added second argument count to ste_rxeof(). It is used to limit number of iterations done in RX handler. ATM polling is the only consumer. o Removed ste_rxeoc() which was added to address RX stuck issue (cvs rev 1.66). Unlike TX descriptors, ST201 supports chaining descriptors to form a ring for RX descriptors. If RX descriptor chaining is not supported it's possible for controller to stop receiving incoming frames once controller pass the end of RX descriptor which in turn requires driver post new RX descriptors to receive more frames. For TX descriptors which does not support chaning, we exactly do manual chaining in driver by concatenating new descriptors to the end of previous TX chain. Maybe the workaround was borrowed from other drivers that does not support RX descriptor chaining, which is not valid for ST201 controllers. I still have no idea how this address RX stuck issue and I can't reproduce the RX stuck issue on DFE-550TX controller. o Removed hw.ste_rxsyncs sysctl as the workaround was removed. o TX/RX side bus_dmamap_load_mbuf_sg(9) support. o Reimplemented optimized ste_encap(). o Simplified TX logic of ste_start_locked(). o Added comments for TFD/RFD requirements. o Increased number of RX descriptors to 128 from 64. 128 gave much better performance than 64 under high network loads. Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 21:45:39 2010 (r202309) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 21:54:20 2010 (r202310) @@ -39,14 +39,19 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include #include +#include +#include +#include #include +#include #include +#include #include +#include #include #include #include @@ -55,14 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include - -#include /* for vtophys */ -#include /* for vtophys */ #include #include -#include -#include #include #include @@ -70,13 +69,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" #define STE_USEIOSPACE -#include - MODULE_DEPEND(ste, pci, 1, 1, 1); MODULE_DEPEND(ste, ether, 1, 1, 1); MODULE_DEPEND(ste, miibus, 1, 1, 1); @@ -96,8 +95,12 @@ static int ste_detach(device_t); static int ste_probe(device_t); static int ste_shutdown(device_t); +static int ste_dma_alloc(struct ste_softc *); +static void ste_dma_free(struct ste_softc *); +static void ste_dmamap_cb(void *, bus_dma_segment_t *, int, int); static int ste_eeprom_wait(struct ste_softc *); -static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *); +static int ste_encap(struct ste_softc *, struct mbuf **, + struct ste_chain *); static int ste_ifmedia_upd(struct ifnet *); static void ste_ifmedia_upd_locked(struct ifnet *); static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -114,12 +117,10 @@ static int ste_mii_writereg(struct ste_s static int ste_miibus_readreg(device_t, int, int); static void ste_miibus_statchg(device_t); static int ste_miibus_writereg(device_t, int, int, int); -static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *, - struct mbuf *); +static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); static void ste_reset(struct ste_softc *); -static void ste_rxeoc(struct ste_softc *); -static void ste_rxeof(struct ste_softc *); +static void ste_rxeof(struct ste_softc *, int); static void ste_setmulti(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); @@ -168,11 +169,6 @@ static devclass_t ste_devclass; DRIVER_MODULE(ste, pci, ste_driver, ste_devclass, 0, 0); DRIVER_MODULE(miibus, ste, miibus_driver, miibus_devclass, 0, 0); -SYSCTL_NODE(_hw, OID_AUTO, ste, CTLFLAG_RD, 0, "if_ste parameters"); - -static int ste_rxsyncs; -SYSCTL_INT(_hw_ste, OID_AUTO, rxsyncs, CTLFLAG_RW, &ste_rxsyncs, 0, ""); - #define STE_SETBIT4(sc, reg, x) \ CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) | (x)) @@ -600,10 +596,7 @@ ste_poll_locked(struct ifnet *ifp, enum STE_LOCK_ASSERT(sc); - sc->rxcycles = count; - if (cmd == POLL_AND_CHECK_STATUS) - ste_rxeoc(sc); - ste_rxeof(sc); + ste_rxeof(sc, count); ste_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); @@ -662,10 +655,8 @@ ste_intr(void *xsc) if (!(status & STE_INTRS)) break; - if (status & STE_ISR_RX_DMADONE) { - ste_rxeoc(sc); - ste_rxeof(sc); - } + if (status & STE_ISR_RX_DMADONE) + ste_rxeof(sc, -1); if (status & STE_ISR_TX_DMADONE) ste_txeof(sc); @@ -697,62 +688,40 @@ ste_intr(void *xsc) STE_UNLOCK(sc); } -static void -ste_rxeoc(struct ste_softc *sc) -{ - struct ste_chain_onefrag *cur_rx; - - STE_LOCK_ASSERT(sc); - - if (sc->ste_cdata.ste_rx_head->ste_ptr->ste_status == 0) { - cur_rx = sc->ste_cdata.ste_rx_head; - do { - cur_rx = cur_rx->ste_next; - /* If the ring is empty, just return. */ - if (cur_rx == sc->ste_cdata.ste_rx_head) - return; - } while (cur_rx->ste_ptr->ste_status == 0); - if (sc->ste_cdata.ste_rx_head->ste_ptr->ste_status == 0) { - /* We've fallen behind the chip: catch it. */ - sc->ste_cdata.ste_rx_head = cur_rx; - ++ste_rxsyncs; - } - } -} - /* * A frame has been uploaded: pass the resulting mbuf chain up to * the higher level protocols. */ static void -ste_rxeof(struct ste_softc *sc) +ste_rxeof(struct ste_softc *sc, int count) { struct mbuf *m; struct ifnet *ifp; struct ste_chain_onefrag *cur_rx; uint32_t rxstat; - int total_len = 0, count = 0; - - STE_LOCK_ASSERT(sc); + int total_len, rx_npkts; ifp = sc->ste_ifp; - while ((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status) - & STE_RXSTAT_DMADONE) { + bus_dmamap_sync(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + cur_rx = sc->ste_cdata.ste_rx_head; + for (rx_npkts = 0; rx_npkts < STE_RX_LIST_CNT; rx_npkts++, + cur_rx = cur_rx->ste_next) { + rxstat = le32toh(cur_rx->ste_ptr->ste_status); + if ((rxstat & STE_RXSTAT_DMADONE) == 0) + break; #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { - if (sc->rxcycles <= 0) + if (count == 0) break; - sc->rxcycles--; + count--; } #endif - if ((STE_RX_LIST_CNT - count) < 3) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - } - - cur_rx = sc->ste_cdata.ste_rx_head; - sc->ste_cdata.ste_rx_head = cur_rx->ste_next; - /* * If an error occurs, update stats, clear the * status word and leave the mbuf cluster in place: @@ -765,22 +734,9 @@ ste_rxeof(struct ste_softc *sc) continue; } - /* - * If there error bit was not set, the upload complete - * bit should be set which means we have a valid packet. - * If not, something truly strange has happened. - */ - if (!(rxstat & STE_RXSTAT_DMADONE)) { - device_printf(sc->ste_dev, - "bad receive status -- packet dropped\n"); - ifp->if_ierrors++; - cur_rx->ste_ptr->ste_status = 0; - continue; - } - /* No errors; receive the packet. */ m = cur_rx->ste_mbuf; - total_len = cur_rx->ste_ptr->ste_status & STE_RXSTAT_FRAMELEN; + total_len = STE_RX_BYTES(rxstat); /* * Try to conjure up a new mbuf cluster. If that @@ -789,7 +745,7 @@ ste_rxeof(struct ste_softc *sc) * result in a lost packet, but there's little else we * can do in this situation. */ - if (ste_newbuf(sc, cur_rx, NULL) == ENOBUFS) { + if (ste_newbuf(sc, cur_rx) != 0) { ifp->if_ierrors++; cur_rx->ste_ptr->ste_status = 0; continue; @@ -802,12 +758,14 @@ ste_rxeof(struct ste_softc *sc) STE_UNLOCK(sc); (*ifp->if_input)(ifp, m); STE_LOCK(sc); - - cur_rx->ste_ptr->ste_status = 0; - count++; } - return; + if (rx_npkts > 0) { + sc->ste_cdata.ste_rx_head = cur_rx; + bus_dmamap_sync(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } } static void @@ -852,27 +810,40 @@ ste_txeof(struct ste_softc *sc) { struct ifnet *ifp; struct ste_chain *cur_tx; + uint32_t txstat; int idx; - ifp = sc->ste_ifp; + STE_LOCK_ASSERT(sc); + ifp = sc->ste_ifp; idx = sc->ste_cdata.ste_tx_cons; + if (idx == sc->ste_cdata.ste_tx_prod) + return; + + bus_dmamap_sync(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + while (idx != sc->ste_cdata.ste_tx_prod) { cur_tx = &sc->ste_cdata.ste_tx_chain[idx]; - - if (!(cur_tx->ste_ptr->ste_ctl & STE_TXCTL_DMADONE)) + txstat = le32toh(cur_tx->ste_ptr->ste_ctl); + if ((txstat & STE_TXCTL_DMADONE) == 0) break; - + bus_dmamap_sync(sc->ste_cdata.ste_tx_tag, cur_tx->ste_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->ste_cdata.ste_tx_tag, cur_tx->ste_map); + KASSERT(cur_tx->ste_mbuf != NULL, + ("%s: freeing NULL mbuf!\n", __func__)); m_freem(cur_tx->ste_mbuf); cur_tx->ste_mbuf = NULL; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_opackets++; - + sc->ste_cdata.ste_tx_cnt--; STE_INC(idx, STE_TX_LIST_CNT); } sc->ste_cdata.ste_tx_cons = idx; - if (idx == sc->ste_cdata.ste_tx_prod) + if (sc->ste_cdata.ste_tx_cnt == 0) sc->ste_timer = 0; } @@ -1007,17 +978,8 @@ ste_attach(device_t dev) goto fail; } - /* Allocate the descriptor queues. */ - sc->ste_ldata = contigmalloc(sizeof(struct ste_list_data), M_DEVBUF, - M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0); - - if (sc->ste_ldata == NULL) { - device_printf(dev, "no memory for list buffers!\n"); - error = ENXIO; + if ((error = ste_dma_alloc(sc)) != 0) goto fail; - } - - bzero(sc->ste_ldata, sizeof(struct ste_list_data)); ifp = sc->ste_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -1123,44 +1085,325 @@ ste_detach(device_t dev) if (ifp) if_free(ifp); - if (sc->ste_ldata) { - contigfree(sc->ste_ldata, sizeof(struct ste_list_data), - M_DEVBUF); - } - + ste_dma_free(sc); mtx_destroy(&sc->ste_mtx); return (0); } +struct ste_dmamap_arg { + bus_addr_t ste_busaddr; +}; + +static void +ste_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct ste_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct ste_dmamap_arg *)arg; + ctx->ste_busaddr = segs[0].ds_addr; +} + static int -ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *c, struct mbuf *m) +ste_dma_alloc(struct ste_softc *sc) { - struct mbuf *m_new = NULL; + struct ste_chain *txc; + struct ste_chain_onefrag *rxc; + struct ste_dmamap_arg ctx; + int error, i; + + /* Create parent DMA tag. */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc->ste_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_parent_tag); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create parent DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Tx descriptor list. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + STE_DESC_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + STE_TX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + STE_TX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_tx_list_tag); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Tx list DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Rx descriptor list. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + STE_DESC_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + STE_RX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + STE_RX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_rx_list_tag); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Rx list DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for Tx buffers. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES * STE_MAXFRAGS, /* maxsize */ + STE_MAXFRAGS, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_tx_tag); + if (error != 0) { + device_printf(sc->ste_dev, "could not create Tx DMA tag.\n"); + goto fail; + } - if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) - return (ENOBUFS); - MCLGET(m_new, M_DONTWAIT); - if (!(m_new->m_flags & M_EXT)) { - m_freem(m_new); - return (ENOBUFS); + /* Create DMA tag for Rx buffers. */ + error = bus_dma_tag_create( + sc->ste_cdata.ste_parent_tag, /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ste_cdata.ste_rx_tag); + if (error != 0) { + device_printf(sc->ste_dev, "could not create Rx DMA tag.\n"); + goto fail; + } + + /* Allocate DMA'able memory and load the DMA map for Tx list. */ + error = bus_dmamem_alloc(sc->ste_cdata.ste_tx_list_tag, + (void **)&sc->ste_ldata.ste_tx_list, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->ste_cdata.ste_tx_list_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not allocate DMA'able memory for Tx list.\n"); + goto fail; + } + ctx.ste_busaddr = 0; + error = bus_dmamap_load(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, sc->ste_ldata.ste_tx_list, + STE_TX_LIST_SZ, ste_dmamap_cb, &ctx, 0); + if (error != 0 || ctx.ste_busaddr == 0) { + device_printf(sc->ste_dev, + "could not load DMA'able memory for Tx list.\n"); + goto fail; + } + sc->ste_ldata.ste_tx_list_paddr = ctx.ste_busaddr; + + /* Allocate DMA'able memory and load the DMA map for Rx list. */ + error = bus_dmamem_alloc(sc->ste_cdata.ste_rx_list_tag, + (void **)&sc->ste_ldata.ste_rx_list, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->ste_cdata.ste_rx_list_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not allocate DMA'able memory for Rx list.\n"); + goto fail; + } + ctx.ste_busaddr = 0; + error = bus_dmamap_load(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, sc->ste_ldata.ste_rx_list, + STE_RX_LIST_SZ, ste_dmamap_cb, &ctx, 0); + if (error != 0 || ctx.ste_busaddr == 0) { + device_printf(sc->ste_dev, + "could not load DMA'able memory for Rx list.\n"); + goto fail; + } + sc->ste_ldata.ste_rx_list_paddr = ctx.ste_busaddr; + + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < STE_TX_LIST_CNT; i++) { + txc = &sc->ste_cdata.ste_tx_chain[i]; + txc->ste_ptr = NULL; + txc->ste_mbuf = NULL; + txc->ste_next = NULL; + txc->ste_phys = 0; + txc->ste_map = NULL; + error = bus_dmamap_create(sc->ste_cdata.ste_tx_tag, 0, + &txc->ste_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + /* Create DMA maps for Rx buffers. */ + if ((error = bus_dmamap_create(sc->ste_cdata.ste_rx_tag, 0, + &sc->ste_cdata.ste_rx_sparemap)) != 0) { + device_printf(sc->ste_dev, + "could not create spare Rx dmamap.\n"); + goto fail; + } + for (i = 0; i < STE_RX_LIST_CNT; i++) { + rxc = &sc->ste_cdata.ste_rx_chain[i]; + rxc->ste_ptr = NULL; + rxc->ste_mbuf = NULL; + rxc->ste_next = NULL; + rxc->ste_map = NULL; + error = bus_dmamap_create(sc->ste_cdata.ste_rx_tag, 0, + &rxc->ste_map); + if (error != 0) { + device_printf(sc->ste_dev, + "could not create Rx dmamap.\n"); + goto fail; } - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - } else { - m_new = m; - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - m_new->m_data = m_new->m_ext.ext_buf; } - m_adj(m_new, ETHER_ALIGN); +fail: + return (error); +} - c->ste_mbuf = m_new; - c->ste_ptr->ste_status = 0; - c->ste_ptr->ste_frag.ste_addr = vtophys(mtod(m_new, caddr_t)); - c->ste_ptr->ste_frag.ste_len = (1536 + ETHER_VLAN_ENCAP_LEN) | STE_FRAG_LAST; +static void +ste_dma_free(struct ste_softc *sc) +{ + struct ste_chain *txc; + struct ste_chain_onefrag *rxc; + int i; + /* Tx buffers. */ + if (sc->ste_cdata.ste_tx_tag != NULL) { + for (i = 0; i < STE_TX_LIST_CNT; i++) { + txc = &sc->ste_cdata.ste_tx_chain[i]; + if (txc->ste_map != NULL) { + bus_dmamap_destroy(sc->ste_cdata.ste_tx_tag, + txc->ste_map); + txc->ste_map = NULL; + } + } + bus_dma_tag_destroy(sc->ste_cdata.ste_tx_tag); + sc->ste_cdata.ste_tx_tag = NULL; + } + /* Rx buffers. */ + if (sc->ste_cdata.ste_rx_tag != NULL) { + for (i = 0; i < STE_RX_LIST_CNT; i++) { + rxc = &sc->ste_cdata.ste_rx_chain[i]; + if (rxc->ste_map != NULL) { + bus_dmamap_destroy(sc->ste_cdata.ste_rx_tag, + rxc->ste_map); + rxc->ste_map = NULL; + } + } + if (sc->ste_cdata.ste_rx_sparemap != NULL) { + bus_dmamap_destroy(sc->ste_cdata.ste_rx_tag, + sc->ste_cdata.ste_rx_sparemap); + sc->ste_cdata.ste_rx_sparemap = NULL; + } + bus_dma_tag_destroy(sc->ste_cdata.ste_rx_tag); + sc->ste_cdata.ste_rx_tag = NULL; + } + /* Tx descriptor list. */ + if (sc->ste_cdata.ste_tx_list_tag != NULL) { + if (sc->ste_cdata.ste_tx_list_map != NULL) + bus_dmamap_unload(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map); + if (sc->ste_cdata.ste_tx_list_map != NULL && + sc->ste_ldata.ste_tx_list != NULL) + bus_dmamem_free(sc->ste_cdata.ste_tx_list_tag, + sc->ste_ldata.ste_tx_list, + sc->ste_cdata.ste_tx_list_map); + sc->ste_ldata.ste_tx_list = NULL; + sc->ste_cdata.ste_tx_list_map = NULL; + bus_dma_tag_destroy(sc->ste_cdata.ste_tx_list_tag); + sc->ste_cdata.ste_tx_list_tag = NULL; + } + /* Rx descriptor list. */ + if (sc->ste_cdata.ste_rx_list_tag != NULL) { + if (sc->ste_cdata.ste_rx_list_map != NULL) + bus_dmamap_unload(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map); + if (sc->ste_cdata.ste_rx_list_map != NULL && + sc->ste_ldata.ste_rx_list != NULL) + bus_dmamem_free(sc->ste_cdata.ste_rx_list_tag, + sc->ste_ldata.ste_rx_list, + sc->ste_cdata.ste_rx_list_map); + sc->ste_ldata.ste_rx_list = NULL; + sc->ste_cdata.ste_rx_list_map = NULL; + bus_dma_tag_destroy(sc->ste_cdata.ste_rx_list_tag); + sc->ste_cdata.ste_rx_list_tag = NULL; + } + if (sc->ste_cdata.ste_parent_tag != NULL) { + bus_dma_tag_destroy(sc->ste_cdata.ste_parent_tag); + sc->ste_cdata.ste_parent_tag = NULL; + } +} + +static int +ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *rxc) +{ + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int error, nsegs; + + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MCLBYTES; + m_adj(m, ETHER_ALIGN); + + if ((error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_rx_tag, + sc->ste_cdata.ste_rx_sparemap, m, segs, &nsegs, 0)) != 0) { + m_freem(m); + return (error); + } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + if (rxc->ste_mbuf != NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_rx_tag, rxc->ste_map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->ste_cdata.ste_rx_tag, rxc->ste_map); + } + map = rxc->ste_map; + rxc->ste_map = sc->ste_cdata.ste_rx_sparemap; + sc->ste_cdata.ste_rx_sparemap = map; + bus_dmamap_sync(sc->ste_cdata.ste_rx_tag, rxc->ste_map, + BUS_DMASYNC_PREREAD); + rxc->ste_mbuf = m; + rxc->ste_ptr->ste_status = 0; + rxc->ste_ptr->ste_frag.ste_addr = htole32(segs[0].ds_addr); + rxc->ste_ptr->ste_frag.ste_len = htole32(segs[0].ds_len | + STE_FRAG_LAST); return (0); } @@ -1169,30 +1412,31 @@ ste_init_rx_list(struct ste_softc *sc) { struct ste_chain_data *cd; struct ste_list_data *ld; - int i; + int error, i; cd = &sc->ste_cdata; - ld = sc->ste_ldata; - + ld = &sc->ste_ldata; + bzero(ld->ste_rx_list, STE_RX_LIST_SZ); for (i = 0; i < STE_RX_LIST_CNT; i++) { cd->ste_rx_chain[i].ste_ptr = &ld->ste_rx_list[i]; - if (ste_newbuf(sc, &cd->ste_rx_chain[i], NULL) == ENOBUFS) - return (ENOBUFS); + error = ste_newbuf(sc, &cd->ste_rx_chain[i]); + if (error != 0) + return (error); if (i == (STE_RX_LIST_CNT - 1)) { - cd->ste_rx_chain[i].ste_next = - &cd->ste_rx_chain[0]; - ld->ste_rx_list[i].ste_next = - vtophys(&ld->ste_rx_list[0]); + cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; + ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * 0); } else { - cd->ste_rx_chain[i].ste_next = - &cd->ste_rx_chain[i + 1]; - ld->ste_rx_list[i].ste_next = - vtophys(&ld->ste_rx_list[i + 1]); + cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[i + 1]; + ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * (i + 1)); } - ld->ste_rx_list[i].ste_status = 0; } cd->ste_rx_head = &cd->ste_rx_chain[0]; + bus_dmamap_sync(sc->ste_cdata.ste_rx_list_tag, + sc->ste_cdata.ste_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } @@ -1205,22 +1449,32 @@ ste_init_tx_list(struct ste_softc *sc) int i; cd = &sc->ste_cdata; - ld = sc->ste_ldata; + ld = &sc->ste_ldata; + bzero(ld->ste_tx_list, STE_TX_LIST_SZ); for (i = 0; i < STE_TX_LIST_CNT; i++) { cd->ste_tx_chain[i].ste_ptr = &ld->ste_tx_list[i]; - cd->ste_tx_chain[i].ste_ptr->ste_next = 0; - cd->ste_tx_chain[i].ste_ptr->ste_ctl = 0; - cd->ste_tx_chain[i].ste_phys = vtophys(&ld->ste_tx_list[i]); - if (i == (STE_TX_LIST_CNT - 1)) - cd->ste_tx_chain[i].ste_next = - &cd->ste_tx_chain[0]; - else - cd->ste_tx_chain[i].ste_next = - &cd->ste_tx_chain[i + 1]; + cd->ste_tx_chain[i].ste_mbuf = NULL; + if (i == (STE_TX_LIST_CNT - 1)) { + cd->ste_tx_chain[i].ste_next = &cd->ste_tx_chain[0]; + cd->ste_tx_chain[i].ste_phys = htole32(STE_ADDR_LO( + ld->ste_tx_list_paddr + + (sizeof(struct ste_desc) * 0))); + } else { + cd->ste_tx_chain[i].ste_next = &cd->ste_tx_chain[i + 1]; + cd->ste_tx_chain[i].ste_phys = htole32(STE_ADDR_LO( + ld->ste_tx_list_paddr + + (sizeof(struct ste_desc) * (i + 1)))); + } } + cd->ste_last_tx = NULL; cd->ste_tx_prod = 0; cd->ste_tx_cons = 0; + cd->ste_tx_cnt = 0; + + bus_dmamap_sync(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } static void @@ -1253,7 +1507,7 @@ ste_init_locked(struct ste_softc *sc) } /* Init RX list */ - if (ste_init_rx_list(sc) == ENOBUFS) { + if (ste_init_rx_list(sc) != 0) { device_printf(sc->ste_dev, "initialization failed: no memory for RX buffers\n"); ste_stop(sc); @@ -1298,11 +1552,11 @@ ste_init_locked(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); ste_wait(sc); CSR_WRITE_4(sc, STE_RX_DMALIST_PTR, - vtophys(&sc->ste_ldata->ste_rx_list[0])); + STE_ADDR_LO(sc->ste_ldata.ste_rx_list_paddr)); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_UNSTALL); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_UNSTALL); - /* Set TX polling interval (defer until we TX first packet */ + /* Set TX polling interval(defer until we TX first packet). */ CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 0); /* Load address of the TX list */ @@ -1312,7 +1566,6 @@ ste_init_locked(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); - sc->ste_tx_prev = NULL; /* Enable receiver and transmitter */ CSR_WRITE_2(sc, STE_MACCTL0, 0); @@ -1348,6 +1601,8 @@ static void ste_stop(struct ste_softc *sc) { struct ifnet *ifp; + struct ste_chain_onefrag *cur_rx; + struct ste_chain *cur_tx; int i; STE_LOCK_ASSERT(sc); @@ -1372,20 +1627,28 @@ ste_stop(struct ste_softc *sc) sc->ste_link = 0; for (i = 0; i < STE_RX_LIST_CNT; i++) { - if (sc->ste_cdata.ste_rx_chain[i].ste_mbuf != NULL) { - m_freem(sc->ste_cdata.ste_rx_chain[i].ste_mbuf); - sc->ste_cdata.ste_rx_chain[i].ste_mbuf = NULL; + cur_rx = &sc->ste_cdata.ste_rx_chain[i]; + if (cur_rx->ste_mbuf != NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_rx_tag, + cur_rx->ste_map, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->ste_cdata.ste_rx_tag, + cur_rx->ste_map); + m_freem(cur_rx->ste_mbuf); + cur_rx->ste_mbuf = NULL; } } for (i = 0; i < STE_TX_LIST_CNT; i++) { - if (sc->ste_cdata.ste_tx_chain[i].ste_mbuf != NULL) { - m_freem(sc->ste_cdata.ste_tx_chain[i].ste_mbuf); - sc->ste_cdata.ste_tx_chain[i].ste_mbuf = NULL; + cur_tx = &sc->ste_cdata.ste_tx_chain[i]; + if (cur_tx->ste_mbuf != NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_tx_tag, + cur_tx->ste_map, BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->ste_cdata.ste_tx_tag, + cur_tx->ste_map); + m_freem(cur_tx->ste_mbuf); + cur_tx->ste_mbuf = NULL; } } - - bzero(sc->ste_ldata, sizeof(struct ste_list_data)); } static void @@ -1500,48 +1763,60 @@ ste_ioctl(struct ifnet *ifp, u_long comm } static int -ste_encap(struct ste_softc *sc, struct ste_chain *c, struct mbuf *m_head) +ste_encap(struct ste_softc *sc, struct mbuf **m_head, struct ste_chain *txc) { + struct ste_frag *frag; struct mbuf *m; - struct ste_desc *d; - struct ste_frag *f = NULL; - int frag = 0; - - d = c->ste_ptr; - d->ste_ctl = 0; - -encap_retry: - for (m = m_head, frag = 0; m != NULL; m = m->m_next) { - if (m->m_len != 0) { - if (frag == STE_MAXFRAGS) - break; - f = &d->ste_frags[frag]; - f->ste_addr = vtophys(mtod(m, vm_offset_t)); - f->ste_len = m->m_len; - frag++; - } - } + struct ste_desc *desc; + bus_dma_segment_t txsegs[STE_MAXFRAGS]; + int error, i, nsegs; - if (m != NULL) { - struct mbuf *mn; + STE_LOCK_ASSERT(sc); + M_ASSERTPKTHDR((*m_head)); - /* - * We ran out of segments. We have to recopy this - * mbuf chain first. Bail out if we can't get the - * new buffers. - */ - mn = m_defrag(m_head, M_DONTWAIT); - if (mn == NULL) { - m_freem(m_head); - return ENOMEM; - } - m_head = mn; - goto encap_retry; + error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_tx_tag, + txc->ste_map, *m_head, txsegs, &nsegs, 0); + if (error == EFBIG) { + m = m_collapse(*m_head, M_DONTWAIT, STE_MAXFRAGS); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOMEM); + } + *m_head = m; + error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_tx_tag, + txc->ste_map, *m_head, txsegs, &nsegs, 0); + if (error != 0) { + m_freem(*m_head); + *m_head = NULL; + return (error); + } + } else if (error != 0) + return (error); + if (nsegs == 0) { + m_freem(*m_head); + *m_head = NULL; + return (EIO); + } + bus_dmamap_sync(sc->ste_cdata.ste_tx_tag, txc->ste_map, + BUS_DMASYNC_PREWRITE); + + desc = txc->ste_ptr; + for (i = 0; i < nsegs; i++) { + frag = &desc->ste_frags[i]; + frag->ste_addr = htole32(STE_ADDR_LO(txsegs[i].ds_addr)); + frag->ste_len = htole32(txsegs[i].ds_len); } - - c->ste_mbuf = m_head; - d->ste_frags[frag - 1].ste_len |= STE_FRAG_LAST; - d->ste_ctl = 1; + desc->ste_frags[i - 1].ste_len |= htole32(STE_FRAG_LAST); + /* + * Because we use Tx polling we can't chain multiple + * Tx descriptors here. Otherwise we race with controller. + */ + desc->ste_next = 0; + desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | STE_TXCTL_DMAINTR); + txc->ste_mbuf = *m_head; + STE_INC(sc->ste_cdata.ste_tx_prod, STE_TX_LIST_CNT); + sc->ste_cdata.ste_tx_cnt++; return (0); } @@ -1563,7 +1838,7 @@ ste_start_locked(struct ifnet *ifp) struct ste_softc *sc; struct ste_chain *cur_tx; struct mbuf *m_head = NULL; - int idx; + int enq; sc = ifp->if_softc; STE_LOCK_ASSERT(sc); @@ -1574,62 +1849,56 @@ ste_start_locked(struct ifnet *ifp) if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - idx = sc->ste_cdata.ste_tx_prod; - - while (sc->ste_cdata.ste_tx_chain[idx].ste_mbuf == NULL) { - /* - * We cannot re-use the last (free) descriptor; - * the chip may not have read its ste_next yet. - */ - if (STE_NEXT(idx, STE_TX_LIST_CNT) == - sc->ste_cdata.ste_tx_cons) { + for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) { + if (sc->ste_cdata.ste_tx_cnt == STE_TX_LIST_CNT - 1) { + /* + * Controller may have cached copy of the last used + * next ptr so we have to reserve one TFD to avoid + * TFD overruns. + */ ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } - IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; - - cur_tx = &sc->ste_cdata.ste_tx_chain[idx]; - - if (ste_encap(sc, cur_tx, m_head) != 0) + cur_tx = &sc->ste_cdata.ste_tx_chain[sc->ste_cdata.ste_tx_prod]; + if (ste_encap(sc, &m_head, cur_tx) != 0) { + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); break; - - cur_tx->ste_ptr->ste_next = 0; - - if (sc->ste_tx_prev == NULL) { - cur_tx->ste_ptr->ste_ctl = STE_TXCTL_DMAINTR | 1; - /* Load address of the TX list */ + } + if (sc->ste_cdata.ste_last_tx == NULL) { + bus_dmamap_sync(sc->ste_cdata.ste_tx_list_tag, + sc->ste_cdata.ste_tx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); ste_wait(sc); - CSR_WRITE_4(sc, STE_TX_DMALIST_PTR, - vtophys(&sc->ste_ldata->ste_tx_list[0])); - - /* Set TX polling interval to start TX engine */ + STE_ADDR_LO(sc->ste_ldata.ste_tx_list_paddr)); CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 64); - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:00:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64C8E106568F; Thu, 14 Jan 2010 22:00:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 531E98FC1E; Thu, 14 Jan 2010 22:00: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 o0EM0Xe3058500; Thu, 14 Jan 2010 22:00:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EM0Xe1058497; Thu, 14 Jan 2010 22:00:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142200.o0EM0Xe1058497@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:00: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: r202311 - stable/8/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:00:33 -0000 Author: yongari Date: Thu Jan 14 22:00:33 2010 New Revision: 202311 URL: http://svn.freebsd.org/changeset/base/202311 Log: MFC r200854,200856,200865,200873,200875,200877,200884 r200854: Add minimal dealy while ste(4) is waiting for the end of active DMA cycle. r200856: Introduce sc_flags member variable and use it to keep track of link state and PHY related information. Remove ste_link and ste_one_phy variable of softc as it's not used anymore. While I'm here add IFF_DRV_RUNNING check in ste_start_locked(). r200865: Reimplement miibus_statchg method. Don't rely on link state change interrupt. If we want to use link state change interrupt ste(4) should also implement auto-negotiation complete handler as well as various PHY access handling. Now link state change is handled by mii(4) polling so it will automatically update link state UP/DOWN events which in turn make ste(4) usable with lagg(4). r199559 added a private timer to drive watchdog and the timer also used to drive MAC statistics update. Because the MAC statistics update is called whenever statistics counter reaches near-full, it drove watchdog timer too fast such that it caused false watchdog timeouts under heavy TX traffic conditions. Fix the regression by separating ste_stats_update() from driving watchdog timer and introduce a new function ste_tick() that handles periodic job such as driving watchdog, MAC statistics update and link state check etc. While I'm here clear armed watchdog timer in ste_stop(). r200873: Instead of relying on hard resetting of controller to stop receiving incoming traffics, try harder to gracefully stop active DMA cycles and then stop MACs. This is the way what datasheet recommends and seems to work reliably. Resetting controller while active DMAs are in progress is bad thing as we can't predict how DMAs touche allocated TX/RX buffers. This change ensures controller stop state before attempting to release allocated TX/RX buffers. Also update MAC statistics which could have been updated during the wait time of MAC stop. While I'm here remove unnecessary controller resets in various location. ste(4) no longer relies on hard controller reset to stop controller and resetting controller also clears all configured settings which makes it hard to implement WOL in near future. Now resetting a controller is performed in ste_init_locked(). r200875: Prefer memory space register mapping over io space. If memory space mapping fails fall back to old io space mapping. While I'm here use PCIR_BAR macro. r200877: Prefer bus_write_{1,2,4}/bus_read_{1,2,4} to bus_space_write_{1,2,4}/bus_space_read_{1,2,4}. Remove unused ste_bhandle and ste_btag in softc. r200884: Reimplement Tx status error handler as recommended by datasheet. If ste(4) encounter TX underrun or excessive collisions the TX MAC of controller is stalled so driver should wake it up again. TX underrun requires increasing TX threshold value to minimize further TX underruns. Previously ste(4) used to reset controller to recover from TX underrun, excessive collision and reclaiming error. However datasheet says only TX underrun requires resetting entire controller. So implement ste_restart_tx() that restarts TX MAC and do not perform full reset except TX underrun case. Now ste(4) uses CSR_READ_2 instead of CSR_READ_1 to read STE_TX_STATUS register. This way ste(4) will also read frame id value and we can write the same value back to STE_TX_FRAMEID register instead of overwriting it to 0. The datasheet was wrong in write back of STE_TX_STATUS so add some comments why we do so. Also always invoke ste_txeoc() after ste_txeof() in ste_poll as without reading TX status register can stall TX MAC. Modified: stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/ste/if_stereg.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) Modified: stable/8/sys/dev/ste/if_ste.c ============================================================================== --- stable/8/sys/dev/ste/if_ste.c Thu Jan 14 21:54:20 2010 (r202310) +++ stable/8/sys/dev/ste/if_ste.c Thu Jan 14 22:00:33 2010 (r202311) @@ -74,12 +74,13 @@ __FBSDID("$FreeBSD$"); /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" -#define STE_USEIOSPACE - MODULE_DEPEND(ste, pci, 1, 1, 1); MODULE_DEPEND(ste, ether, 1, 1, 1); MODULE_DEPEND(ste, miibus, 1, 1, 1); +/* Define to show Tx error status. */ +#define STE_SHOW_TXERRORS + /* * Various supported device vendors/types and their names. */ @@ -120,25 +121,19 @@ static int ste_miibus_writereg(device_t, static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); static void ste_reset(struct ste_softc *); +static void ste_restart_tx(struct ste_softc *); static int ste_rxeof(struct ste_softc *, int); static void ste_setmulti(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); -static void ste_stats_update(void *); +static void ste_stats_update(struct ste_softc *); static void ste_stop(struct ste_softc *); +static void ste_tick(void *); static void ste_txeoc(struct ste_softc *); static void ste_txeof(struct ste_softc *); static void ste_wait(struct ste_softc *); static void ste_watchdog(struct ste_softc *); -#ifdef STE_USEIOSPACE -#define STE_RES SYS_RES_IOPORT -#define STE_RID STE_PCI_LOIO -#else -#define STE_RES SYS_RES_MEMORY -#define STE_RID STE_PCI_LOMEM -#endif - static device_method_t ste_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ste_probe), @@ -369,7 +364,7 @@ ste_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if ( sc->ste_one_phy && phy != 0 ) + if ((sc->ste_flags & STE_FLAG_ONE_PHY) != 0 && phy != 0) return (0); bzero((char *)&frame, sizeof(frame)); @@ -404,15 +399,49 @@ ste_miibus_statchg(device_t dev) { struct ste_softc *sc; struct mii_data *mii; + struct ifnet *ifp; + uint16_t cfg; sc = device_get_softc(dev); mii = device_get_softc(sc->ste_miibus); + ifp = sc->ste_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; - if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) { - STE_SETBIT2(sc, STE_MACCTL0, STE_MACCTL0_FULLDUPLEX); - } else { - STE_CLRBIT2(sc, STE_MACCTL0, STE_MACCTL0_FULLDUPLEX); + sc->ste_flags &= ~STE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_100_FX: + case IFM_100_T4: + sc->ste_flags |= STE_FLAG_LINK; + default: + break; + } + } + + /* Program MACs with resolved speed/duplex/flow-control. */ + if ((sc->ste_flags & STE_FLAG_LINK) != 0) { + cfg = CSR_READ_2(sc, STE_MACCTL0); + cfg &= ~(STE_MACCTL0_FLOWCTL_ENABLE | STE_MACCTL0_FULLDUPLEX); + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + /* + * ST201 data sheet says driver should enable receiving + * MAC control frames bit of receive mode register to + * receive flow-control frames but the register has no + * such bits. In addition the controller has no ability + * to send pause frames so it should be handled in + * driver. Implementing pause timer handling in driver + * layer is not trivial, so don't enable flow-control + * here. + */ + cfg |= STE_MACCTL0_FULLDUPLEX; + } + CSR_WRITE_2(sc, STE_MACCTL0, cfg); } } @@ -438,7 +467,7 @@ ste_ifmedia_upd_locked(struct ifnet *ifp sc = ifp->if_softc; STE_LOCK_ASSERT(sc); mii = device_get_softc(sc->ste_miibus); - sc->ste_link = 0; + sc->ste_flags &= ~STE_FLAG_LINK; if (mii->mii_instance) { struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) @@ -471,6 +500,7 @@ ste_wait(struct ste_softc *sc) for (i = 0; i < STE_TIMEOUT; i++) { if (!(CSR_READ_4(sc, STE_DMACTL) & STE_DMACTL_DMA_HALTINPROG)) break; + DELAY(1); } if (i == STE_TIMEOUT) @@ -601,6 +631,7 @@ ste_poll_locked(struct ifnet *ifp, enum rx_npkts = ste_rxeof(sc, count); ste_txeof(sc); + ste_txeoc(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); @@ -609,21 +640,11 @@ ste_poll_locked(struct ifnet *ifp, enum status = CSR_READ_2(sc, STE_ISR_ACK); - if (status & STE_ISR_TX_DONE) - ste_txeoc(sc); - - if (status & STE_ISR_STATS_OFLOW) { - callout_stop(&sc->ste_stat_callout); + if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - } - - if (status & STE_ISR_LINKEVENT) - mii_pollstat(device_get_softc(sc->ste_miibus)); - if (status & STE_ISR_HOSTERR) { - ste_reset(sc); + if (status & STE_ISR_HOSTERR) ste_init_locked(sc); - } } return (rx_npkts); } @@ -668,19 +689,11 @@ ste_intr(void *xsc) if (status & STE_ISR_TX_DONE) ste_txeoc(sc); - if (status & STE_ISR_STATS_OFLOW) { - callout_stop(&sc->ste_stat_callout); + if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - } - - if (status & STE_ISR_LINKEVENT) - mii_pollstat(device_get_softc(sc->ste_miibus)); - - if (status & STE_ISR_HOSTERR) { - ste_reset(sc); + if (status & STE_ISR_HOSTERR) ste_init_locked(sc); - } } /* Re-enable interrupts */ @@ -777,41 +790,92 @@ ste_rxeof(struct ste_softc *sc, int coun static void ste_txeoc(struct ste_softc *sc) { + uint16_t txstat; struct ifnet *ifp; - uint8_t txstat; + + STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - while ((txstat = CSR_READ_1(sc, STE_TX_STATUS)) & - STE_TXSTATUS_TXDONE) { - if (txstat & STE_TXSTATUS_UNDERRUN || - txstat & STE_TXSTATUS_EXCESSCOLLS || - txstat & STE_TXSTATUS_RECLAIMERR) { + /* + * STE_TX_STATUS register implements a queue of up to 31 + * transmit status byte. Writing an arbitrary value to the + * register will advance the queue to the next transmit + * status byte. This means if driver does not read + * STE_TX_STATUS register after completing sending more + * than 31 frames the controller would be stalled so driver + * should re-wake the Tx MAC. This is the most severe + * limitation of ST201 based controller. + */ + for (;;) { + txstat = CSR_READ_2(sc, STE_TX_STATUS); + if ((txstat & STE_TXSTATUS_TXDONE) == 0) + break; + if ((txstat & (STE_TXSTATUS_UNDERRUN | + STE_TXSTATUS_EXCESSCOLLS | STE_TXSTATUS_RECLAIMERR | + STE_TXSTATUS_STATSOFLOW)) != 0) { ifp->if_oerrors++; - device_printf(sc->ste_dev, - "transmission error: %x\n", txstat); - - ste_reset(sc); - ste_init_locked(sc); - - if (txstat & STE_TXSTATUS_UNDERRUN && +#ifdef STE_SHOW_TXERRORS + device_printf(sc->ste_dev, "TX error : 0x%b\n", + txstat & 0xFF, STE_ERR_BITS); +#endif + if ((txstat & STE_TXSTATUS_UNDERRUN) != 0 && sc->ste_tx_thresh < STE_PACKET_SIZE) { sc->ste_tx_thresh += STE_MIN_FRAMELEN; + if (sc->ste_tx_thresh > STE_PACKET_SIZE) + sc->ste_tx_thresh = STE_PACKET_SIZE; device_printf(sc->ste_dev, - "tx underrun, increasing tx" + "TX underrun, increasing TX" " start threshold to %d bytes\n", sc->ste_tx_thresh); + /* Make sure to disable active DMA cycles. */ + STE_SETBIT4(sc, STE_DMACTL, + STE_DMACTL_TXDMA_STALL); + ste_wait(sc); + ste_init_locked(sc); + break; } - CSR_WRITE_2(sc, STE_TX_STARTTHRESH, sc->ste_tx_thresh); - CSR_WRITE_2(sc, STE_TX_RECLAIM_THRESH, - (STE_PACKET_SIZE >> 4)); + /* Restart Tx. */ + ste_restart_tx(sc); } - ste_init_locked(sc); + /* + * Advance to next status and ACK TxComplete + * interrupt. ST201 data sheet was wrong here, to + * get next Tx status, we have to write both + * STE_TX_STATUS and STE_TX_FRAMEID register. + * Otherwise controller returns the same status + * as well as not acknowledge Tx completion + * interrupt. + */ CSR_WRITE_2(sc, STE_TX_STATUS, txstat); } } static void +ste_tick(void *arg) +{ + struct ste_softc *sc; + struct mii_data *mii; + + sc = (struct ste_softc *)arg; + + STE_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->ste_miibus); + mii_tick(mii); + /* + * ukphy(4) does not seem to generate CB that reports + * resolved link state so if we know we lost a link, + * explicitly check the link state. + */ + if ((sc->ste_flags & STE_FLAG_LINK) == 0) + ste_miibus_statchg(sc->ste_dev); + ste_stats_update(sc); + ste_watchdog(sc); + callout_reset(&sc->ste_callout, hz, ste_tick, sc); +} + +static void ste_txeof(struct ste_softc *sc) { struct ifnet *ifp; @@ -854,43 +918,18 @@ ste_txeof(struct ste_softc *sc) } static void -ste_stats_update(void *xsc) +ste_stats_update(struct ste_softc *sc) { - struct ste_softc *sc; struct ifnet *ifp; - struct mii_data *mii; - sc = xsc; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - mii = device_get_softc(sc->ste_miibus); - ifp->if_collisions += CSR_READ_1(sc, STE_LATE_COLLS) + CSR_READ_1(sc, STE_MULTI_COLLS) + CSR_READ_1(sc, STE_SINGLE_COLLS); - - if (!sc->ste_link) { - mii_pollstat(mii); - if (mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->ste_link++; - /* - * we don't get a call-back on re-init so do it - * otherwise we get stuck in the wrong link state - */ - ste_miibus_statchg(sc->ste_dev); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - ste_start_locked(ifp); - } - } - - if (sc->ste_timer > 0 && --sc->ste_timer == 0) - ste_watchdog(sc); - callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); } - /* * Probe for a Sundance ST201 chip. Check the PCI vendor and device * IDs against our list and return a device name if we find a match. @@ -937,7 +976,7 @@ ste_attach(device_t dev) if (pci_get_vendor(dev) == DL_VENDORID && pci_get_device(dev) == DL_DEVICEID_DL10050 && pci_get_revid(dev) == 0x12 ) - sc->ste_one_phy = 1; + sc->ste_flags |= STE_FLAG_ONE_PHY; mtx_init(&sc->ste_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); @@ -946,18 +985,23 @@ ste_attach(device_t dev) */ pci_enable_busmaster(dev); - rid = STE_RID; - sc->ste_res = bus_alloc_resource_any(dev, STE_RES, &rid, RF_ACTIVE); - + /* Prefer memory space register mapping over IO space. */ + sc->ste_res_id = PCIR_BAR(1); + sc->ste_res_type = SYS_RES_MEMORY; + sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, + &sc->ste_res_id, RF_ACTIVE); + if (sc->ste_res == NULL) { + sc->ste_res_id = PCIR_BAR(0); + sc->ste_res_type = SYS_RES_IOPORT; + sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, + &sc->ste_res_id, RF_ACTIVE); + } if (sc->ste_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; goto fail; } - sc->ste_btag = rman_get_bustag(sc->ste_res); - sc->ste_bhandle = rman_get_bushandle(sc->ste_res); - /* Allocate interrupt */ rid = 0; sc->ste_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -969,7 +1013,7 @@ ste_attach(device_t dev) goto fail; } - callout_init_mtx(&sc->ste_stat_callout, &sc->ste_mtx, 0); + callout_init_mtx(&sc->ste_callout, &sc->ste_mtx, 0); /* Reset the adapter. */ ste_reset(sc); @@ -1075,7 +1119,7 @@ ste_detach(device_t dev) STE_LOCK(sc); ste_stop(sc); STE_UNLOCK(sc); - callout_drain(&sc->ste_stat_callout); + callout_drain(&sc->ste_callout); } if (sc->ste_miibus) device_delete_child(dev, sc->ste_miibus); @@ -1086,7 +1130,8 @@ ste_detach(device_t dev) if (sc->ste_irq) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ste_irq); if (sc->ste_res) - bus_release_resource(dev, STE_RES, STE_RID, sc->ste_res); + bus_release_resource(dev, sc->ste_res_type, sc->ste_res_id, + sc->ste_res); if (ifp) if_free(ifp); @@ -1504,6 +1549,8 @@ ste_init_locked(struct ste_softc *sc) ifp = sc->ste_ifp; ste_stop(sc); + /* Reset the chip to a known state. */ + ste_reset(sc); /* Init our MAC address */ for (i = 0; i < ETHER_ADDR_LEN; i += 2) { @@ -1600,7 +1647,7 @@ ste_init_locked(struct ste_softc *sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); + callout_reset(&sc->ste_callout, hz, ste_tick, sc); } static void @@ -1609,28 +1656,44 @@ ste_stop(struct ste_softc *sc) struct ifnet *ifp; struct ste_chain_onefrag *cur_rx; struct ste_chain *cur_tx; + uint32_t val; int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - callout_stop(&sc->ste_stat_callout); + callout_stop(&sc->ste_callout); + sc->ste_timer = 0; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); CSR_WRITE_2(sc, STE_IMR, 0); - STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_TX_DISABLE); - STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_RX_DISABLE); - STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_STATS_DISABLE); - STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); - STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); + /* Stop pending DMA. */ + val = CSR_READ_4(sc, STE_DMACTL); + val |= STE_DMACTL_TXDMA_STALL | STE_DMACTL_RXDMA_STALL; + CSR_WRITE_4(sc, STE_DMACTL, val); ste_wait(sc); - /* - * Try really hard to stop the RX engine or under heavy RX - * data chip will write into de-allocated memory. - */ - ste_reset(sc); - - sc->ste_link = 0; + /* Disable auto-polling. */ + CSR_WRITE_1(sc, STE_RX_DMAPOLL_PERIOD, 0); + CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 0); + /* Nullify DMA address to stop any further DMA. */ + CSR_WRITE_4(sc, STE_RX_DMALIST_PTR, 0); + CSR_WRITE_4(sc, STE_TX_DMALIST_PTR, 0); + /* Stop TX/RX MAC. */ + val = CSR_READ_2(sc, STE_MACCTL1); + val |= STE_MACCTL1_TX_DISABLE | STE_MACCTL1_RX_DISABLE | + STE_MACCTL1_STATS_DISABLE; + CSR_WRITE_2(sc, STE_MACCTL1, val); + for (i = 0; i < STE_TIMEOUT; i++) { + DELAY(10); + if ((CSR_READ_2(sc, STE_MACCTL1) & (STE_MACCTL1_TX_DISABLE | + STE_MACCTL1_RX_DISABLE | STE_MACCTL1_STATS_DISABLE)) == 0) + break; + } + if (i == STE_TIMEOUT) + device_printf(sc->ste_dev, "Stopping MAC timed out\n"); + /* Acknowledge any pending interrupts. */ + CSR_READ_2(sc, STE_ISR_ACK); + ste_stats_update(sc); for (i = 0; i < STE_RX_LIST_CNT; i++) { cur_rx = &sc->ste_cdata.ste_rx_chain[i]; @@ -1680,6 +1743,26 @@ ste_reset(struct ste_softc *sc) device_printf(sc->ste_dev, "global reset never completed\n"); } +static void +ste_restart_tx(struct ste_softc *sc) +{ + uint16_t mac; + int i; + + for (i = 0; i < STE_TIMEOUT; i++) { + mac = CSR_READ_2(sc, STE_MACCTL1); + mac |= STE_MACCTL1_TX_ENABLE; + CSR_WRITE_2(sc, STE_MACCTL1, mac); + mac = CSR_READ_2(sc, STE_MACCTL1); + if ((mac & STE_MACCTL1_TX_ENABLED) != 0) + break; + DELAY(10); + } + + if (i == STE_TIMEOUT) + device_printf(sc->ste_dev, "starting Tx failed"); +} + static int ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { @@ -1849,10 +1932,8 @@ ste_start_locked(struct ifnet *ifp) sc = ifp->if_softc; STE_LOCK_ASSERT(sc); - if (!sc->ste_link) - return; - - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || (sc->ste_flags & STE_FLAG_LINK) == 0) return; for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) { @@ -1915,13 +1996,15 @@ ste_watchdog(struct ste_softc *sc) ifp = sc->ste_ifp; STE_LOCK_ASSERT(sc); + if (sc->ste_timer == 0 || --sc->ste_timer) + return; + ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); - ste_txeoc(sc); ste_txeof(sc); + ste_txeoc(sc); ste_rxeof(sc, -1); - ste_reset(sc); ste_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) Modified: stable/8/sys/dev/ste/if_stereg.h ============================================================================== --- stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 21:54:20 2010 (r202310) +++ stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 22:00:33 2010 (r202311) @@ -253,6 +253,11 @@ #define STE_TXSTATUS_TXINTR_REQ 0x40 #define STE_TXSTATUS_TXDONE 0x80 +#define STE_ERR_BITS "\20" \ + "\2RECLAIM\3STSOFLOW" \ + "\4EXCESSCOLLS\5UNDERRUN" \ + "\6INTREQ\7DONE" + #define STE_ISRACK_INTLATCH 0x0001 #define STE_ISRACK_HOSTERR 0x0002 #define STE_ISRACK_TX_DONE 0x0004 @@ -276,10 +281,9 @@ #define STE_IMR_TX_DMADONE 0x0200 #define STE_IMR_RX_DMADONE 0x0400 -#define STE_INTRS \ +#define STE_INTRS \ (STE_IMR_RX_DMADONE|STE_IMR_TX_DMADONE| \ - STE_IMR_TX_DONE|STE_IMR_HOSTERR| \ - STE_IMR_LINKEVENT) + STE_IMR_TX_DONE|STE_IMR_HOSTERR) #define STE_ISR_INTLATCH 0x0001 #define STE_ISR_HOSTERR 0x0002 @@ -466,18 +470,18 @@ struct ste_desc_onefrag { * register space access macros */ #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_4((sc)->ste_res, reg, val) #define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_2((sc)->ste_res, reg, val) #define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_1((sc)->ste_res, reg, val) #define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_4((sc)->ste_res, reg) #define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_2((sc)->ste_res, reg) #define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_1((sc)->ste_res, reg) #define STE_DESC_ALIGN 8 #define STE_RX_LIST_CNT 128 @@ -545,23 +549,24 @@ struct ste_chain_data { struct ste_softc { struct ifnet *ste_ifp; - bus_space_tag_t ste_btag; - bus_space_handle_t ste_bhandle; struct resource *ste_res; + int ste_res_id; + int ste_res_type; struct resource *ste_irq; void *ste_intrhand; struct ste_type *ste_info; device_t ste_miibus; device_t ste_dev; int ste_tx_thresh; - uint8_t ste_link; + int ste_flags; +#define STE_FLAG_ONE_PHY 0x0001 +#define STE_FLAG_LINK 0x8000 int ste_if_flags; int ste_timer; struct ste_list_data ste_ldata; struct ste_chain_data ste_cdata; - struct callout ste_stat_callout; + struct callout ste_callout; struct mtx ste_mtx; - uint8_t ste_one_phy; }; #define STE_LOCK(_sc) mtx_lock(&(_sc)->ste_mtx) From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:04:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD92E106566B; Thu, 14 Jan 2010 22:04:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BD8E8FC0C; Thu, 14 Jan 2010 22:04:32 +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 o0EM4WVU059527; Thu, 14 Jan 2010 22:04:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EM4WIr059524; Thu, 14 Jan 2010 22:04:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142204.o0EM4WIr059524@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202313 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:04:32 -0000 Author: yongari Date: Thu Jan 14 22:04:32 2010 New Revision: 202313 URL: http://svn.freebsd.org/changeset/base/202313 Log: MFC r200854,200856,200865,200873,200875,200877,200884 r200854: Add minimal dealy while ste(4) is waiting for the end of active DMA cycle. r200856: Introduce sc_flags member variable and use it to keep track of link state and PHY related information. Remove ste_link and ste_one_phy variable of softc as it's not used anymore. While I'm here add IFF_DRV_RUNNING check in ste_start_locked(). r200865: Reimplement miibus_statchg method. Don't rely on link state change interrupt. If we want to use link state change interrupt ste(4) should also implement auto-negotiation complete handler as well as various PHY access handling. Now link state change is handled by mii(4) polling so it will automatically update link state UP/DOWN events which in turn make ste(4) usable with lagg(4). r199559 added a private timer to drive watchdog and the timer also used to drive MAC statistics update. Because the MAC statistics update is called whenever statistics counter reaches near-full, it drove watchdog timer too fast such that it caused false watchdog timeouts under heavy TX traffic conditions. Fix the regression by separating ste_stats_update() from driving watchdog timer and introduce a new function ste_tick() that handles periodic job such as driving watchdog, MAC statistics update and link state check etc. While I'm here clear armed watchdog timer in ste_stop(). r200873: Instead of relying on hard resetting of controller to stop receiving incoming traffics, try harder to gracefully stop active DMA cycles and then stop MACs. This is the way what datasheet recommends and seems to work reliably. Resetting controller while active DMAs are in progress is bad thing as we can't predict how DMAs touche allocated TX/RX buffers. This change ensures controller stop state before attempting to release allocated TX/RX buffers. Also update MAC statistics which could have been updated during the wait time of MAC stop. While I'm here remove unnecessary controller resets in various location. ste(4) no longer relies on hard controller reset to stop controller and resetting controller also clears all configured settings which makes it hard to implement WOL in near future. Now resetting a controller is performed in ste_init_locked(). r200875: Prefer memory space register mapping over io space. If memory space mapping fails fall back to old io space mapping. While I'm here use PCIR_BAR macro. r200877: Prefer bus_write_{1,2,4}/bus_read_{1,2,4} to bus_space_write_{1,2,4}/bus_space_read_{1,2,4}. Remove unused ste_bhandle and ste_btag in softc. r200884: Reimplement Tx status error handler as recommended by datasheet. If ste(4) encounter TX underrun or excessive collisions the TX MAC of controller is stalled so driver should wake it up again. TX underrun requires increasing TX threshold value to minimize further TX underruns. Previously ste(4) used to reset controller to recover from TX underrun, excessive collision and reclaiming error. However datasheet says only TX underrun requires resetting entire controller. So implement ste_restart_tx() that restarts TX MAC and do not perform full reset except TX underrun case. Now ste(4) uses CSR_READ_2 instead of CSR_READ_1 to read STE_TX_STATUS register. This way ste(4) will also read frame id value and we can write the same value back to STE_TX_FRAMEID register instead of overwriting it to 0. The datasheet was wrong in write back of STE_TX_STATUS so add some comments why we do so. Also always invoke ste_txeoc() after ste_txeof() in ste_poll as without reading TX status register can stall TX MAC. Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:04:08 2010 (r202312) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:04:32 2010 (r202313) @@ -74,12 +74,13 @@ __FBSDID("$FreeBSD$"); /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" -#define STE_USEIOSPACE - MODULE_DEPEND(ste, pci, 1, 1, 1); MODULE_DEPEND(ste, ether, 1, 1, 1); MODULE_DEPEND(ste, miibus, 1, 1, 1); +/* Define to show Tx error status. */ +#define STE_SHOW_TXERRORS + /* * Various supported device vendors/types and their names. */ @@ -120,25 +121,19 @@ static int ste_miibus_writereg(device_t, static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); static void ste_reset(struct ste_softc *); +static void ste_restart_tx(struct ste_softc *); static void ste_rxeof(struct ste_softc *, int); static void ste_setmulti(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); -static void ste_stats_update(void *); +static void ste_stats_update(struct ste_softc *); static void ste_stop(struct ste_softc *); +static void ste_tick(void *); static void ste_txeoc(struct ste_softc *); static void ste_txeof(struct ste_softc *); static void ste_wait(struct ste_softc *); static void ste_watchdog(struct ste_softc *); -#ifdef STE_USEIOSPACE -#define STE_RES SYS_RES_IOPORT -#define STE_RID STE_PCI_LOIO -#else -#define STE_RES SYS_RES_MEMORY -#define STE_RID STE_PCI_LOMEM -#endif - static device_method_t ste_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ste_probe), @@ -369,7 +364,7 @@ ste_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if ( sc->ste_one_phy && phy != 0 ) + if ((sc->ste_flags & STE_FLAG_ONE_PHY) != 0 && phy != 0) return (0); bzero((char *)&frame, sizeof(frame)); @@ -404,15 +399,49 @@ ste_miibus_statchg(device_t dev) { struct ste_softc *sc; struct mii_data *mii; + struct ifnet *ifp; + uint16_t cfg; sc = device_get_softc(dev); mii = device_get_softc(sc->ste_miibus); + ifp = sc->ste_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; - if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) { - STE_SETBIT2(sc, STE_MACCTL0, STE_MACCTL0_FULLDUPLEX); - } else { - STE_CLRBIT2(sc, STE_MACCTL0, STE_MACCTL0_FULLDUPLEX); + sc->ste_flags &= ~STE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_100_FX: + case IFM_100_T4: + sc->ste_flags |= STE_FLAG_LINK; + default: + break; + } + } + + /* Program MACs with resolved speed/duplex/flow-control. */ + if ((sc->ste_flags & STE_FLAG_LINK) != 0) { + cfg = CSR_READ_2(sc, STE_MACCTL0); + cfg &= ~(STE_MACCTL0_FLOWCTL_ENABLE | STE_MACCTL0_FULLDUPLEX); + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + /* + * ST201 data sheet says driver should enable receiving + * MAC control frames bit of receive mode register to + * receive flow-control frames but the register has no + * such bits. In addition the controller has no ability + * to send pause frames so it should be handled in + * driver. Implementing pause timer handling in driver + * layer is not trivial, so don't enable flow-control + * here. + */ + cfg |= STE_MACCTL0_FULLDUPLEX; + } + CSR_WRITE_2(sc, STE_MACCTL0, cfg); } } @@ -438,7 +467,7 @@ ste_ifmedia_upd_locked(struct ifnet *ifp sc = ifp->if_softc; STE_LOCK_ASSERT(sc); mii = device_get_softc(sc->ste_miibus); - sc->ste_link = 0; + sc->ste_flags &= ~STE_FLAG_LINK; if (mii->mii_instance) { struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) @@ -471,6 +500,7 @@ ste_wait(struct ste_softc *sc) for (i = 0; i < STE_TIMEOUT; i++) { if (!(CSR_READ_4(sc, STE_DMACTL) & STE_DMACTL_DMA_HALTINPROG)) break; + DELAY(1); } if (i == STE_TIMEOUT) @@ -598,6 +628,7 @@ ste_poll_locked(struct ifnet *ifp, enum ste_rxeof(sc, count); ste_txeof(sc); + ste_txeoc(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ste_start_locked(ifp); @@ -606,21 +637,11 @@ ste_poll_locked(struct ifnet *ifp, enum status = CSR_READ_2(sc, STE_ISR_ACK); - if (status & STE_ISR_TX_DONE) - ste_txeoc(sc); - - if (status & STE_ISR_STATS_OFLOW) { - callout_stop(&sc->ste_stat_callout); + if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - } - - if (status & STE_ISR_LINKEVENT) - mii_pollstat(device_get_softc(sc->ste_miibus)); - if (status & STE_ISR_HOSTERR) { - ste_reset(sc); + if (status & STE_ISR_HOSTERR) ste_init_locked(sc); - } } } #endif /* DEVICE_POLLING */ @@ -664,19 +685,11 @@ ste_intr(void *xsc) if (status & STE_ISR_TX_DONE) ste_txeoc(sc); - if (status & STE_ISR_STATS_OFLOW) { - callout_stop(&sc->ste_stat_callout); + if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - } - - if (status & STE_ISR_LINKEVENT) - mii_pollstat(device_get_softc(sc->ste_miibus)); - - if (status & STE_ISR_HOSTERR) { - ste_reset(sc); + if (status & STE_ISR_HOSTERR) ste_init_locked(sc); - } } /* Re-enable interrupts */ @@ -771,41 +784,92 @@ ste_rxeof(struct ste_softc *sc, int coun static void ste_txeoc(struct ste_softc *sc) { + uint16_t txstat; struct ifnet *ifp; - uint8_t txstat; + + STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - while ((txstat = CSR_READ_1(sc, STE_TX_STATUS)) & - STE_TXSTATUS_TXDONE) { - if (txstat & STE_TXSTATUS_UNDERRUN || - txstat & STE_TXSTATUS_EXCESSCOLLS || - txstat & STE_TXSTATUS_RECLAIMERR) { + /* + * STE_TX_STATUS register implements a queue of up to 31 + * transmit status byte. Writing an arbitrary value to the + * register will advance the queue to the next transmit + * status byte. This means if driver does not read + * STE_TX_STATUS register after completing sending more + * than 31 frames the controller would be stalled so driver + * should re-wake the Tx MAC. This is the most severe + * limitation of ST201 based controller. + */ + for (;;) { + txstat = CSR_READ_2(sc, STE_TX_STATUS); + if ((txstat & STE_TXSTATUS_TXDONE) == 0) + break; + if ((txstat & (STE_TXSTATUS_UNDERRUN | + STE_TXSTATUS_EXCESSCOLLS | STE_TXSTATUS_RECLAIMERR | + STE_TXSTATUS_STATSOFLOW)) != 0) { ifp->if_oerrors++; - device_printf(sc->ste_dev, - "transmission error: %x\n", txstat); - - ste_reset(sc); - ste_init_locked(sc); - - if (txstat & STE_TXSTATUS_UNDERRUN && +#ifdef STE_SHOW_TXERRORS + device_printf(sc->ste_dev, "TX error : 0x%b\n", + txstat & 0xFF, STE_ERR_BITS); +#endif + if ((txstat & STE_TXSTATUS_UNDERRUN) != 0 && sc->ste_tx_thresh < STE_PACKET_SIZE) { sc->ste_tx_thresh += STE_MIN_FRAMELEN; + if (sc->ste_tx_thresh > STE_PACKET_SIZE) + sc->ste_tx_thresh = STE_PACKET_SIZE; device_printf(sc->ste_dev, - "tx underrun, increasing tx" + "TX underrun, increasing TX" " start threshold to %d bytes\n", sc->ste_tx_thresh); + /* Make sure to disable active DMA cycles. */ + STE_SETBIT4(sc, STE_DMACTL, + STE_DMACTL_TXDMA_STALL); + ste_wait(sc); + ste_init_locked(sc); + break; } - CSR_WRITE_2(sc, STE_TX_STARTTHRESH, sc->ste_tx_thresh); - CSR_WRITE_2(sc, STE_TX_RECLAIM_THRESH, - (STE_PACKET_SIZE >> 4)); + /* Restart Tx. */ + ste_restart_tx(sc); } - ste_init_locked(sc); + /* + * Advance to next status and ACK TxComplete + * interrupt. ST201 data sheet was wrong here, to + * get next Tx status, we have to write both + * STE_TX_STATUS and STE_TX_FRAMEID register. + * Otherwise controller returns the same status + * as well as not acknowledge Tx completion + * interrupt. + */ CSR_WRITE_2(sc, STE_TX_STATUS, txstat); } } static void +ste_tick(void *arg) +{ + struct ste_softc *sc; + struct mii_data *mii; + + sc = (struct ste_softc *)arg; + + STE_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->ste_miibus); + mii_tick(mii); + /* + * ukphy(4) does not seem to generate CB that reports + * resolved link state so if we know we lost a link, + * explicitly check the link state. + */ + if ((sc->ste_flags & STE_FLAG_LINK) == 0) + ste_miibus_statchg(sc->ste_dev); + ste_stats_update(sc); + ste_watchdog(sc); + callout_reset(&sc->ste_callout, hz, ste_tick, sc); +} + +static void ste_txeof(struct ste_softc *sc) { struct ifnet *ifp; @@ -848,43 +912,18 @@ ste_txeof(struct ste_softc *sc) } static void -ste_stats_update(void *xsc) +ste_stats_update(struct ste_softc *sc) { - struct ste_softc *sc; struct ifnet *ifp; - struct mii_data *mii; - sc = xsc; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - mii = device_get_softc(sc->ste_miibus); - ifp->if_collisions += CSR_READ_1(sc, STE_LATE_COLLS) + CSR_READ_1(sc, STE_MULTI_COLLS) + CSR_READ_1(sc, STE_SINGLE_COLLS); - - if (!sc->ste_link) { - mii_pollstat(mii); - if (mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->ste_link++; - /* - * we don't get a call-back on re-init so do it - * otherwise we get stuck in the wrong link state - */ - ste_miibus_statchg(sc->ste_dev); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - ste_start_locked(ifp); - } - } - - if (sc->ste_timer > 0 && --sc->ste_timer == 0) - ste_watchdog(sc); - callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); } - /* * Probe for a Sundance ST201 chip. Check the PCI vendor and device * IDs against our list and return a device name if we find a match. @@ -931,7 +970,7 @@ ste_attach(device_t dev) if (pci_get_vendor(dev) == DL_VENDORID && pci_get_device(dev) == DL_DEVICEID_DL10050 && pci_get_revid(dev) == 0x12 ) - sc->ste_one_phy = 1; + sc->ste_flags |= STE_FLAG_ONE_PHY; mtx_init(&sc->ste_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); @@ -940,18 +979,23 @@ ste_attach(device_t dev) */ pci_enable_busmaster(dev); - rid = STE_RID; - sc->ste_res = bus_alloc_resource_any(dev, STE_RES, &rid, RF_ACTIVE); - + /* Prefer memory space register mapping over IO space. */ + sc->ste_res_id = PCIR_BAR(1); + sc->ste_res_type = SYS_RES_MEMORY; + sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, + &sc->ste_res_id, RF_ACTIVE); + if (sc->ste_res == NULL) { + sc->ste_res_id = PCIR_BAR(0); + sc->ste_res_type = SYS_RES_IOPORT; + sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, + &sc->ste_res_id, RF_ACTIVE); + } if (sc->ste_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; goto fail; } - sc->ste_btag = rman_get_bustag(sc->ste_res); - sc->ste_bhandle = rman_get_bushandle(sc->ste_res); - /* Allocate interrupt */ rid = 0; sc->ste_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -963,7 +1007,7 @@ ste_attach(device_t dev) goto fail; } - callout_init_mtx(&sc->ste_stat_callout, &sc->ste_mtx, 0); + callout_init_mtx(&sc->ste_callout, &sc->ste_mtx, 0); /* Reset the adapter. */ ste_reset(sc); @@ -1069,7 +1113,7 @@ ste_detach(device_t dev) STE_LOCK(sc); ste_stop(sc); STE_UNLOCK(sc); - callout_drain(&sc->ste_stat_callout); + callout_drain(&sc->ste_callout); } if (sc->ste_miibus) device_delete_child(dev, sc->ste_miibus); @@ -1080,7 +1124,8 @@ ste_detach(device_t dev) if (sc->ste_irq) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ste_irq); if (sc->ste_res) - bus_release_resource(dev, STE_RES, STE_RID, sc->ste_res); + bus_release_resource(dev, sc->ste_res_type, sc->ste_res_id, + sc->ste_res); if (ifp) if_free(ifp); @@ -1498,6 +1543,8 @@ ste_init_locked(struct ste_softc *sc) ifp = sc->ste_ifp; ste_stop(sc); + /* Reset the chip to a known state. */ + ste_reset(sc); /* Init our MAC address */ for (i = 0; i < ETHER_ADDR_LEN; i += 2) { @@ -1594,7 +1641,7 @@ ste_init_locked(struct ste_softc *sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - callout_reset(&sc->ste_stat_callout, hz, ste_stats_update, sc); + callout_reset(&sc->ste_callout, hz, ste_tick, sc); } static void @@ -1603,28 +1650,44 @@ ste_stop(struct ste_softc *sc) struct ifnet *ifp; struct ste_chain_onefrag *cur_rx; struct ste_chain *cur_tx; + uint32_t val; int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - callout_stop(&sc->ste_stat_callout); + callout_stop(&sc->ste_callout); + sc->ste_timer = 0; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); CSR_WRITE_2(sc, STE_IMR, 0); - STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_TX_DISABLE); - STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_RX_DISABLE); - STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_STATS_DISABLE); - STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); - STE_SETBIT2(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); + /* Stop pending DMA. */ + val = CSR_READ_4(sc, STE_DMACTL); + val |= STE_DMACTL_TXDMA_STALL | STE_DMACTL_RXDMA_STALL; + CSR_WRITE_4(sc, STE_DMACTL, val); ste_wait(sc); - /* - * Try really hard to stop the RX engine or under heavy RX - * data chip will write into de-allocated memory. - */ - ste_reset(sc); - - sc->ste_link = 0; + /* Disable auto-polling. */ + CSR_WRITE_1(sc, STE_RX_DMAPOLL_PERIOD, 0); + CSR_WRITE_1(sc, STE_TX_DMAPOLL_PERIOD, 0); + /* Nullify DMA address to stop any further DMA. */ + CSR_WRITE_4(sc, STE_RX_DMALIST_PTR, 0); + CSR_WRITE_4(sc, STE_TX_DMALIST_PTR, 0); + /* Stop TX/RX MAC. */ + val = CSR_READ_2(sc, STE_MACCTL1); + val |= STE_MACCTL1_TX_DISABLE | STE_MACCTL1_RX_DISABLE | + STE_MACCTL1_STATS_DISABLE; + CSR_WRITE_2(sc, STE_MACCTL1, val); + for (i = 0; i < STE_TIMEOUT; i++) { + DELAY(10); + if ((CSR_READ_2(sc, STE_MACCTL1) & (STE_MACCTL1_TX_DISABLE | + STE_MACCTL1_RX_DISABLE | STE_MACCTL1_STATS_DISABLE)) == 0) + break; + } + if (i == STE_TIMEOUT) + device_printf(sc->ste_dev, "Stopping MAC timed out\n"); + /* Acknowledge any pending interrupts. */ + CSR_READ_2(sc, STE_ISR_ACK); + ste_stats_update(sc); for (i = 0; i < STE_RX_LIST_CNT; i++) { cur_rx = &sc->ste_cdata.ste_rx_chain[i]; @@ -1674,6 +1737,26 @@ ste_reset(struct ste_softc *sc) device_printf(sc->ste_dev, "global reset never completed\n"); } +static void +ste_restart_tx(struct ste_softc *sc) +{ + uint16_t mac; + int i; + + for (i = 0; i < STE_TIMEOUT; i++) { + mac = CSR_READ_2(sc, STE_MACCTL1); + mac |= STE_MACCTL1_TX_ENABLE; + CSR_WRITE_2(sc, STE_MACCTL1, mac); + mac = CSR_READ_2(sc, STE_MACCTL1); + if ((mac & STE_MACCTL1_TX_ENABLED) != 0) + break; + DELAY(10); + } + + if (i == STE_TIMEOUT) + device_printf(sc->ste_dev, "starting Tx failed"); +} + static int ste_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { @@ -1843,10 +1926,8 @@ ste_start_locked(struct ifnet *ifp) sc = ifp->if_softc; STE_LOCK_ASSERT(sc); - if (!sc->ste_link) - return; - - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || (sc->ste_flags & STE_FLAG_LINK) == 0) return; for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) { @@ -1909,13 +1990,15 @@ ste_watchdog(struct ste_softc *sc) ifp = sc->ste_ifp; STE_LOCK_ASSERT(sc); + if (sc->ste_timer == 0 || --sc->ste_timer) + return; + ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); - ste_txeoc(sc); ste_txeof(sc); + ste_txeoc(sc); ste_rxeof(sc, -1); - ste_reset(sc); ste_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:04:08 2010 (r202312) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:04:32 2010 (r202313) @@ -253,6 +253,11 @@ #define STE_TXSTATUS_TXINTR_REQ 0x40 #define STE_TXSTATUS_TXDONE 0x80 +#define STE_ERR_BITS "\20" \ + "\2RECLAIM\3STSOFLOW" \ + "\4EXCESSCOLLS\5UNDERRUN" \ + "\6INTREQ\7DONE" + #define STE_ISRACK_INTLATCH 0x0001 #define STE_ISRACK_HOSTERR 0x0002 #define STE_ISRACK_TX_DONE 0x0004 @@ -276,10 +281,9 @@ #define STE_IMR_TX_DMADONE 0x0200 #define STE_IMR_RX_DMADONE 0x0400 -#define STE_INTRS \ +#define STE_INTRS \ (STE_IMR_RX_DMADONE|STE_IMR_TX_DMADONE| \ - STE_IMR_TX_DONE|STE_IMR_HOSTERR| \ - STE_IMR_LINKEVENT) + STE_IMR_TX_DONE|STE_IMR_HOSTERR) #define STE_ISR_INTLATCH 0x0001 #define STE_ISR_HOSTERR 0x0002 @@ -466,18 +470,18 @@ struct ste_desc_onefrag { * register space access macros */ #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_4((sc)->ste_res, reg, val) #define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_2((sc)->ste_res, reg, val) #define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_1((sc)->ste_res, reg, val) #define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_4((sc)->ste_res, reg) #define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_2((sc)->ste_res, reg) #define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_1((sc)->ste_res, reg) #define STE_DESC_ALIGN 8 #define STE_RX_LIST_CNT 128 @@ -545,23 +549,24 @@ struct ste_chain_data { struct ste_softc { struct ifnet *ste_ifp; - bus_space_tag_t ste_btag; - bus_space_handle_t ste_bhandle; struct resource *ste_res; + int ste_res_id; + int ste_res_type; struct resource *ste_irq; void *ste_intrhand; struct ste_type *ste_info; device_t ste_miibus; device_t ste_dev; int ste_tx_thresh; - uint8_t ste_link; + int ste_flags; +#define STE_FLAG_ONE_PHY 0x0001 +#define STE_FLAG_LINK 0x8000 int ste_if_flags; int ste_timer; struct ste_list_data ste_ldata; struct ste_chain_data ste_cdata; - struct callout ste_stat_callout; + struct callout ste_callout; struct mtx ste_mtx; - uint8_t ste_one_phy; }; #define STE_LOCK(_sc) mtx_lock(&(_sc)->ste_mtx) From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:15:51 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98D521065670; Thu, 14 Jan 2010 22:15:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86A918FC13; Thu, 14 Jan 2010 22:15: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 o0EMFpIT062164; Thu, 14 Jan 2010 22:15:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMFpAl062161; Thu, 14 Jan 2010 22:15:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142215.o0EMFpAl062161@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:15:51 +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: r202314 - stable/8/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:15:51 -0000 Author: yongari Date: Thu Jan 14 22:15:51 2010 New Revision: 202314 URL: http://svn.freebsd.org/changeset/base/202314 Log: MFC r200904-200908,200910-200913 r200904: Don't reinitialize controller if driver is already running. This reduces number of link state UP/DOWN changes. r200905: Reimplement controller reset. Datasheet says full reset takes about 1ms. Since we switched to memory register mapping make sure to flush PCI posted write by reading the register again. While I'm here add additional delays in loop while driver waits the completion of the reset. r200906: Overhaul RX filter programming. o Let RX filter handler program promiscuous/multicast filter as well as broadcasting. o Remove unnecessary register access. o Simplify ioctl handler and have set_rxfilter to handle IFF_PROMISC and IFF_ALLMULTI change instead of directly programming the controller. o Removed unnecessary error variable reinitialization in ioctl handler. o Add IFF_DRV_RUNNING check before programming multicast filter. o Configure maximum allowed frame length before enabling MAC. Datasheet didn't say the exact ordering of programming sequence but it looks more natural to set maximum allowed frame length first prior to enabling controller. r200907: Don't report link status if driver is not running. r200908: Report the correct result of mii_mediachg(). Previously it always used to return success without respect to the result. While I'm here use mii_mediachg() in ste_init_locked which allows driver to use currently configured media. ste_ifmedia_upd() is supposed to be called whenever user changes current media settings. r200910: Implement hardware MAC statistics counter support. The counters could be accessed with dev.ste.0.stats sysctl node. r200911: Remove unused duplicated register definition. It seems the definition was made to access STE_ASICCTL register as 16bits but ste(4) always access the register as 32bits so it was never used before. r200912: Correct STE_COUNTDOWN register offset. The datasheet was wrong. r200913: We don't need to generate DMA complete interrupt for every transmitted frames. So request interrupt for every 16th frames. Due to the limitation of hardware we can't suppress the interrupt as driver should have to check TX status register. The TX status register can store up to 31 TX status so driver can't send more than 31 frames without reading TX status register. With this change controller would not generate TX completion interrupt for every frame, so reclaim transmitted frames in ste_tick(). Modified: stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/ste/if_stereg.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) Modified: stable/8/sys/dev/ste/if_ste.c ============================================================================== --- stable/8/sys/dev/ste/if_ste.c Thu Jan 14 22:04:32 2010 (r202313) +++ stable/8/sys/dev/ste/if_ste.c Thu Jan 14 22:15:51 2010 (r202314) @@ -103,7 +103,6 @@ static int ste_eeprom_wait(struct ste_s static int ste_encap(struct ste_softc *, struct mbuf **, struct ste_chain *); static int ste_ifmedia_upd(struct ifnet *); -static void ste_ifmedia_upd_locked(struct ifnet *); static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); static void ste_init(void *); static void ste_init_locked(struct ste_softc *); @@ -123,11 +122,13 @@ static int ste_read_eeprom(struct ste_so static void ste_reset(struct ste_softc *); static void ste_restart_tx(struct ste_softc *); static int ste_rxeof(struct ste_softc *, int); -static void ste_setmulti(struct ste_softc *); +static void ste_rxfilter(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); +static void ste_stats_clear(struct ste_softc *); static void ste_stats_update(struct ste_softc *); static void ste_stop(struct ste_softc *); +static void ste_sysctl_node(struct ste_softc *); static void ste_tick(void *); static void ste_txeoc(struct ste_softc *); static void ste_txeof(struct ste_softc *); @@ -449,31 +450,21 @@ static int ste_ifmedia_upd(struct ifnet *ifp) { struct ste_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; sc = ifp->if_softc; STE_LOCK(sc); - ste_ifmedia_upd_locked(ifp); - STE_UNLOCK(sc); - - return (0); -} - -static void -ste_ifmedia_upd_locked(struct ifnet *ifp) -{ - struct ste_softc *sc; - struct mii_data *mii; - - sc = ifp->if_softc; - STE_LOCK_ASSERT(sc); mii = device_get_softc(sc->ste_miibus); - sc->ste_flags &= ~STE_FLAG_LINK; if (mii->mii_instance) { - struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); + error = mii_mediachg(mii); + STE_UNLOCK(sc); + + return (error); } static void @@ -486,6 +477,10 @@ ste_ifmedia_sts(struct ifnet *ifp, struc mii = device_get_softc(sc->ste_miibus); STE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + STE_UNLOCK(sc); + return; + } mii_pollstat(mii); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; @@ -563,27 +558,33 @@ ste_read_eeprom(struct ste_softc *sc, ca } static void -ste_setmulti(struct ste_softc *sc) +ste_rxfilter(struct ste_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; uint32_t hashes[2] = { 0, 0 }; + uint8_t rxcfg; int h; + STE_LOCK_ASSERT(sc); + ifp = sc->ste_ifp; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_ALLMULTI); - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_MULTIHASH); - return; + rxcfg = CSR_READ_1(sc, STE_RX_MODE); + rxcfg |= STE_RXMODE_UNICAST; + rxcfg &= ~(STE_RXMODE_ALLMULTI | STE_RXMODE_MULTIHASH | + STE_RXMODE_BROADCAST | STE_RXMODE_PROMISC); + if (ifp->if_flags & IFF_BROADCAST) + rxcfg |= STE_RXMODE_BROADCAST; + if ((ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) != 0) { + if ((ifp->if_flags & IFF_ALLMULTI) != 0) + rxcfg |= STE_RXMODE_ALLMULTI; + if ((ifp->if_flags & IFF_PROMISC) != 0) + rxcfg |= STE_RXMODE_PROMISC; + goto chipit; } - /* first, zot all the existing hash bits */ - CSR_WRITE_2(sc, STE_MAR0, 0); - CSR_WRITE_2(sc, STE_MAR1, 0); - CSR_WRITE_2(sc, STE_MAR2, 0); - CSR_WRITE_2(sc, STE_MAR3, 0); - - /* now program new ones */ + rxcfg |= STE_RXMODE_MULTIHASH; + /* Now program new ones. */ if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -597,12 +598,13 @@ ste_setmulti(struct ste_softc *sc) } if_maddr_runlock(ifp); +chipit: CSR_WRITE_2(sc, STE_MAR0, hashes[0] & 0xFFFF); CSR_WRITE_2(sc, STE_MAR1, (hashes[0] >> 16) & 0xFFFF); CSR_WRITE_2(sc, STE_MAR2, hashes[1] & 0xFFFF); CSR_WRITE_2(sc, STE_MAR3, (hashes[1] >> 16) & 0xFFFF); - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_ALLMULTI); - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_MULTIHASH); + CSR_WRITE_1(sc, STE_RX_MODE, rxcfg); + CSR_READ_1(sc, STE_RX_MODE); } #ifdef DEVICE_POLLING @@ -643,8 +645,10 @@ ste_poll_locked(struct ifnet *ifp, enum if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - if (status & STE_ISR_HOSTERR) + if (status & STE_ISR_HOSTERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ste_init_locked(sc); + } } return (rx_npkts); } @@ -692,8 +696,10 @@ ste_intr(void *xsc) if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - if (status & STE_ISR_HOSTERR) + if (status & STE_ISR_HOSTERR) { ste_init_locked(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + } } /* Re-enable interrupts */ @@ -832,6 +838,7 @@ ste_txeoc(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); ste_wait(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ste_init_locked(sc); break; } @@ -870,6 +877,13 @@ ste_tick(void *arg) */ if ((sc->ste_flags & STE_FLAG_LINK) == 0) ste_miibus_statchg(sc->ste_dev); + /* + * Because we are not generating Tx completion + * interrupt for every frame, reclaim transmitted + * buffers here. + */ + ste_txeof(sc); + ste_txeoc(sc); ste_stats_update(sc); ste_watchdog(sc); callout_reset(&sc->ste_callout, hz, ste_tick, sc); @@ -918,16 +932,74 @@ ste_txeof(struct ste_softc *sc) } static void +ste_stats_clear(struct ste_softc *sc) +{ + + STE_LOCK_ASSERT(sc); + + /* Rx stats. */ + CSR_READ_2(sc, STE_STAT_RX_OCTETS_LO); + CSR_READ_2(sc, STE_STAT_RX_OCTETS_HI); + CSR_READ_2(sc, STE_STAT_RX_FRAMES); + CSR_READ_1(sc, STE_STAT_RX_BCAST); + CSR_READ_1(sc, STE_STAT_RX_MCAST); + CSR_READ_1(sc, STE_STAT_RX_LOST); + /* Tx stats. */ + CSR_READ_2(sc, STE_STAT_TX_OCTETS_LO); + CSR_READ_2(sc, STE_STAT_TX_OCTETS_HI); + CSR_READ_2(sc, STE_STAT_TX_FRAMES); + CSR_READ_1(sc, STE_STAT_TX_BCAST); + CSR_READ_1(sc, STE_STAT_TX_MCAST); + CSR_READ_1(sc, STE_STAT_CARRIER_ERR); + CSR_READ_1(sc, STE_STAT_SINGLE_COLLS); + CSR_READ_1(sc, STE_STAT_MULTI_COLLS); + CSR_READ_1(sc, STE_STAT_LATE_COLLS); + CSR_READ_1(sc, STE_STAT_TX_DEFER); + CSR_READ_1(sc, STE_STAT_TX_EXDEFER); + CSR_READ_1(sc, STE_STAT_TX_ABORT); +} + +static void ste_stats_update(struct ste_softc *sc) { struct ifnet *ifp; + struct ste_hw_stats *stats; + uint32_t val; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - ifp->if_collisions += CSR_READ_1(sc, STE_LATE_COLLS) - + CSR_READ_1(sc, STE_MULTI_COLLS) - + CSR_READ_1(sc, STE_SINGLE_COLLS); + stats = &sc->ste_stats; + /* Rx stats. */ + val = (uint32_t)CSR_READ_2(sc, STE_STAT_RX_OCTETS_LO) | + ((uint32_t)CSR_READ_2(sc, STE_STAT_RX_OCTETS_HI)) << 16; + val &= 0x000FFFFF; + stats->rx_bytes += val; + stats->rx_frames += CSR_READ_2(sc, STE_STAT_RX_FRAMES); + stats->rx_bcast_frames += CSR_READ_1(sc, STE_STAT_RX_BCAST); + stats->rx_mcast_frames += CSR_READ_1(sc, STE_STAT_RX_MCAST); + stats->rx_lost_frames += CSR_READ_1(sc, STE_STAT_RX_LOST); + /* Tx stats. */ + val = (uint32_t)CSR_READ_2(sc, STE_STAT_TX_OCTETS_LO) | + ((uint32_t)CSR_READ_2(sc, STE_STAT_TX_OCTETS_HI)) << 16; + val &= 0x000FFFFF; + stats->tx_bytes += val; + stats->tx_frames += CSR_READ_2(sc, STE_STAT_TX_FRAMES); + stats->tx_bcast_frames += CSR_READ_1(sc, STE_STAT_TX_BCAST); + stats->tx_mcast_frames += CSR_READ_1(sc, STE_STAT_TX_MCAST); + stats->tx_carrsense_errs += CSR_READ_1(sc, STE_STAT_CARRIER_ERR); + val = CSR_READ_1(sc, STE_STAT_SINGLE_COLLS); + stats->tx_single_colls += val; + ifp->if_collisions += val; + val = CSR_READ_1(sc, STE_STAT_MULTI_COLLS); + stats->tx_multi_colls += val; + ifp->if_collisions += val; + val += CSR_READ_1(sc, STE_STAT_LATE_COLLS); + stats->tx_late_colls += val; + ifp->if_collisions += val; + stats->tx_frames_defered += CSR_READ_1(sc, STE_STAT_TX_DEFER); + stats->tx_excess_defers += CSR_READ_1(sc, STE_STAT_TX_EXDEFER); + stats->tx_abort += CSR_READ_1(sc, STE_STAT_TX_ABORT); } /* @@ -1027,6 +1099,7 @@ ste_attach(device_t dev) error = ENXIO;; goto fail; } + ste_sysctl_node(sc); if ((error = ste_dma_alloc(sc)) != 0) goto fail; @@ -1543,10 +1616,15 @@ static void ste_init_locked(struct ste_softc *sc) { struct ifnet *ifp; + struct mii_data *mii; int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; + mii = device_get_softc(sc->ste_miibus); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; ste_stop(sc); /* Reset the chip to a known state. */ @@ -1582,24 +1660,11 @@ ste_init_locked(struct ste_softc *sc) /* Set the TX reclaim threshold. */ CSR_WRITE_1(sc, STE_TX_RECLAIM_THRESH, (STE_PACKET_SIZE >> 4)); - /* Set up the RX filter. */ - CSR_WRITE_1(sc, STE_RX_MODE, STE_RXMODE_UNICAST); - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } else { - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } - - /* Set capture broadcast bit to accept broadcast frames. */ - if (ifp->if_flags & IFF_BROADCAST) { - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_BROADCAST); - } else { - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_BROADCAST); - } + /* Accept VLAN length packets */ + CSR_WRITE_2(sc, STE_MAX_FRAMELEN, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); - ste_setmulti(sc); + /* Set up the RX filter. */ + ste_rxfilter(sc); /* Load the address of the RX list. */ STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); @@ -1628,6 +1693,8 @@ ste_init_locked(struct ste_softc *sc) /* Enable stats counters. */ STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_STATS_ENABLE); + /* Clear stats counters. */ + ste_stats_clear(sc); CSR_WRITE_2(sc, STE_ISR, 0xFFFF); #ifdef DEVICE_POLLING @@ -1639,10 +1706,9 @@ ste_init_locked(struct ste_softc *sc) /* Enable interrupts. */ CSR_WRITE_2(sc, STE_IMR, STE_INTRS); - /* Accept VLAN length packets */ - CSR_WRITE_2(sc, STE_MAX_FRAMELEN, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); - - ste_ifmedia_upd_locked(ifp); + sc->ste_flags &= ~STE_FLAG_LINK; + /* Switch to the current media. */ + mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1723,20 +1789,27 @@ ste_stop(struct ste_softc *sc) static void ste_reset(struct ste_softc *sc) { + uint32_t ctl; int i; - STE_SETBIT4(sc, STE_ASICCTL, - STE_ASICCTL_GLOBAL_RESET|STE_ASICCTL_RX_RESET| - STE_ASICCTL_TX_RESET|STE_ASICCTL_DMA_RESET| - STE_ASICCTL_FIFO_RESET|STE_ASICCTL_NETWORK_RESET| - STE_ASICCTL_AUTOINIT_RESET|STE_ASICCTL_HOST_RESET| - STE_ASICCTL_EXTRESET_RESET); - - DELAY(100000); + ctl = CSR_READ_4(sc, STE_ASICCTL); + ctl |= STE_ASICCTL_GLOBAL_RESET | STE_ASICCTL_RX_RESET | + STE_ASICCTL_TX_RESET | STE_ASICCTL_DMA_RESET | + STE_ASICCTL_FIFO_RESET | STE_ASICCTL_NETWORK_RESET | + STE_ASICCTL_AUTOINIT_RESET |STE_ASICCTL_HOST_RESET | + STE_ASICCTL_EXTRESET_RESET; + CSR_WRITE_4(sc, STE_ASICCTL, ctl); + CSR_READ_4(sc, STE_ASICCTL); + /* + * Due to the need of accessing EEPROM controller can take + * up to 1ms to complete the global reset. + */ + DELAY(1000); for (i = 0; i < STE_TIMEOUT; i++) { if (!(CSR_READ_4(sc, STE_ASICCTL) & STE_ASICCTL_RESET_BUSY)) break; + DELAY(10); } if (i == STE_TIMEOUT) @@ -1777,39 +1850,24 @@ ste_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFFLAGS: STE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - ifp->if_flags & IFF_PROMISC && - !(sc->ste_if_flags & IFF_PROMISC)) { - STE_SETBIT1(sc, STE_RX_MODE, - STE_RXMODE_PROMISC); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->ste_if_flags & IFF_PROMISC) { - STE_CLRBIT1(sc, STE_RX_MODE, - STE_RXMODE_PROMISC); - } - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - (ifp->if_flags ^ sc->ste_if_flags) & IFF_ALLMULTI) - ste_setmulti(sc); - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - sc->ste_tx_thresh = STE_TXSTART_THRESH; + if ((ifp->if_flags & IFF_UP) != 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->ste_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + ste_rxfilter(sc); + else ste_init_locked(sc); - } - } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - ste_stop(sc); - } + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + ste_stop(sc); sc->ste_if_flags = ifp->if_flags; STE_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: STE_LOCK(sc); - ste_setmulti(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + ste_rxfilter(sc); STE_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: @@ -1902,7 +1960,11 @@ ste_encap(struct ste_softc *sc, struct m * Tx descriptors here. Otherwise we race with controller. */ desc->ste_next = 0; - desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | STE_TXCTL_DMAINTR); + if ((sc->ste_cdata.ste_tx_prod % STE_TX_INTR_FRAMES) == 0) + desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | + STE_TXCTL_DMAINTR); + else + desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS); txc->ste_mbuf = *m_head; STE_INC(sc->ste_cdata.ste_tx_prod, STE_TX_LIST_CNT); sc->ste_cdata.ste_tx_cnt++; @@ -2005,6 +2067,7 @@ ste_watchdog(struct ste_softc *sc) ste_txeof(sc); ste_txeoc(sc); ste_rxeof(sc, -1); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ste_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2024,3 +2087,70 @@ ste_shutdown(device_t dev) return (0); } + +#define STE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) +#define STE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_QUAD(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) + +static void +ste_sysctl_node(struct ste_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct ste_hw_stats *stats; + + stats = &sc->ste_stats; + ctx = device_get_sysctl_ctx(sc->ste_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ste_dev)); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "STE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + STE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->rx_bytes, "Good octets"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_frames, "Good frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->rx_bcast_frames, "Good broadcast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->rx_mcast_frames, "Good multicast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "lost_frames", + &stats->rx_lost_frames, "Lost frames"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + STE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->tx_bytes, "Good octets"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_frames, "Good frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->tx_bcast_frames, "Good broadcast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->tx_mcast_frames, "Good multicast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "carrier_errs", + &stats->tx_carrsense_errs, "Carrier sense errors"); + STE_SYSCTL_STAT_ADD32(ctx, child, "single_colls", + &stats->tx_single_colls, "Single collisions"); + STE_SYSCTL_STAT_ADD32(ctx, child, "multi_colls", + &stats->tx_multi_colls, "Multiple collisions"); + STE_SYSCTL_STAT_ADD32(ctx, child, "late_colls", + &stats->tx_late_colls, "Late collisions"); + STE_SYSCTL_STAT_ADD32(ctx, child, "defers", + &stats->tx_frames_defered, "Frames with deferrals"); + STE_SYSCTL_STAT_ADD32(ctx, child, "excess_defers", + &stats->tx_excess_defers, "Frames with excessive derferrals"); + STE_SYSCTL_STAT_ADD32(ctx, child, "abort", + &stats->tx_abort, "Aborted frames due to Excessive collisions"); +} + +#undef STE_SYSCTL_STAT_ADD32 +#undef STE_SYSCTL_STAT_ADD64 Modified: stable/8/sys/dev/ste/if_stereg.h ============================================================================== --- stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 22:04:32 2010 (r202313) +++ stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 22:15:51 2010 (r202314) @@ -63,6 +63,7 @@ #define STE_RX_DMABURST_THRESH 0x14 #define STE_RX_DMAURG_THRESH 0x15 #define STE_RX_DMAPOLL_PERIOD 0x16 +#define STE_COUNTDOWN 0x18 #define STE_DEBUGCTL 0x1A #define STE_ASICCTL 0x30 #define STE_EEPROM_DATA 0x34 @@ -75,7 +76,6 @@ #define STE_WAKE_EVENT 0x45 #define STE_TX_STATUS 0x46 #define STE_TX_FRAMEID 0x47 -#define STE_COUNTDOWN 0x48 #define STE_ISR_ACK 0x4A #define STE_IMR 0x4C #define STE_ISR 0x4E @@ -92,11 +92,25 @@ #define STE_MAR1 0x62 #define STE_MAR2 0x64 #define STE_MAR3 0x66 -#define STE_STATS 0x68 -#define STE_LATE_COLLS 0x75 -#define STE_MULTI_COLLS 0x76 -#define STE_SINGLE_COLLS 0x77 +#define STE_STAT_RX_OCTETS_LO 0x68 +#define STE_STAT_RX_OCTETS_HI 0x6A +#define STE_STAT_TX_OCTETS_LO 0x6C +#define STE_STAT_TX_OCTETS_HI 0x6E +#define STE_STAT_TX_FRAMES 0x70 +#define STE_STAT_RX_FRAMES 0x72 +#define STE_STAT_CARRIER_ERR 0x74 +#define STE_STAT_LATE_COLLS 0x75 +#define STE_STAT_MULTI_COLLS 0x76 +#define STE_STAT_SINGLE_COLLS 0x77 +#define STE_STAT_TX_DEFER 0x78 +#define STE_STAT_RX_LOST 0x79 +#define STE_STAT_TX_EXDEFER 0x7A +#define STE_STAT_TX_ABORT 0x7B +#define STE_STAT_TX_BCAST 0x7C +#define STE_STAT_RX_BCAST 0x7D +#define STE_STAT_TX_MCAST 0x7E +#define STE_STAT_RX_MCAST 0x7F #define STE_DMACTL_RXDMA_STOPPED 0x00000001 #define STE_DMACTL_TXDMA_CMPREQ 0x00000002 @@ -199,18 +213,6 @@ #define STE_ASICCTL_SOFTINTR 0x02000000 #define STE_ASICCTL_RESET_BUSY 0x04000000 -#define STE_ASICCTL1_GLOBAL_RESET 0x0001 -#define STE_ASICCTL1_RX_RESET 0x0002 -#define STE_ASICCTL1_TX_RESET 0x0004 -#define STE_ASICCTL1_DMA_RESET 0x0008 -#define STE_ASICCTL1_FIFO_RESET 0x0010 -#define STE_ASICCTL1_NETWORK_RESET 0x0020 -#define STE_ASICCTL1_HOST_RESET 0x0040 -#define STE_ASICCTL1_AUTOINIT_RESET 0x0080 -#define STE_ASICCTL1_EXTRESET_RESET 0x0100 -#define STE_ASICCTL1_SOFTINTR 0x0200 -#define STE_ASICCTL1_RESET_BUSY 0x0400 - #define STE_EECTL_ADDR 0x00FF #define STE_EECTL_OPCODE 0x0300 #define STE_EECTL_BUSY 0x1000 @@ -388,24 +390,23 @@ #define STE_PME_EN 0x0010 #define STE_PME_STATUS 0x8000 - -struct ste_stats { - uint32_t ste_rx_bytes; - uint32_t ste_tx_bytes; - uint16_t ste_tx_frames; - uint16_t ste_rx_frames; - uint8_t ste_carrsense_errs; - uint8_t ste_late_colls; - uint8_t ste_multi_colls; - uint8_t ste_single_colls; - uint8_t ste_tx_frames_defered; - uint8_t ste_rx_lost_frames; - uint8_t ste_tx_excess_defers; - uint8_t ste_tx_abort_excess_colls; - uint8_t ste_tx_bcast_frames; - uint8_t ste_rx_bcast_frames; - uint8_t ste_tx_mcast_frames; - uint8_t ste_rx_mcast_frames; +struct ste_hw_stats { + uint64_t rx_bytes; + uint32_t rx_frames; + uint32_t rx_bcast_frames; + uint32_t rx_mcast_frames; + uint32_t rx_lost_frames; + uint64_t tx_bytes; + uint32_t tx_frames; + uint32_t tx_bcast_frames; + uint32_t tx_mcast_frames; + uint32_t tx_carrsense_errs; + uint32_t tx_single_colls; + uint32_t tx_multi_colls; + uint32_t tx_late_colls; + uint32_t tx_frames_defered; + uint32_t tx_excess_defers; + uint32_t tx_abort; }; struct ste_frag { @@ -493,6 +494,12 @@ struct ste_desc_onefrag { #define STE_ADDR_LO(x) ((uint64_t)(x) & 0xFFFFFFFF) #define STE_ADDR_HI(x) ((uint64_t)(x) >> 32) +/* + * Since Tx status can hold up to 31 status bytes we should + * check Tx status before controller fills it up. Otherwise + * Tx MAC stalls. + */ +#define STE_TX_INTR_FRAMES 16 #define STE_TX_TIMEOUT 5 #define STE_TIMEOUT 1000 #define STE_MIN_FRAMELEN 60 @@ -566,6 +573,7 @@ struct ste_softc { struct ste_list_data ste_ldata; struct ste_chain_data ste_cdata; struct callout ste_callout; + struct ste_hw_stats ste_stats; struct mtx ste_mtx; }; From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:18:56 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F419D106566C; Thu, 14 Jan 2010 22:18:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1D3C8FC1A; Thu, 14 Jan 2010 22:18: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 o0EMItwF062988; Thu, 14 Jan 2010 22:18:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMItSo062985; Thu, 14 Jan 2010 22:18:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142218.o0EMItSo062985@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202315 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:18:56 -0000 Author: yongari Date: Thu Jan 14 22:18:55 2010 New Revision: 202315 URL: http://svn.freebsd.org/changeset/base/202315 Log: MFC r200904-200908,200910-200913 r200904: Don't reinitialize controller if driver is already running. This reduces number of link state UP/DOWN changes. r200905: Reimplement controller reset. Datasheet says full reset takes about 1ms. Since we switched to memory register mapping make sure to flush PCI posted write by reading the register again. While I'm here add additional delays in loop while driver waits the completion of the reset. r200906: Overhaul RX filter programming. o Let RX filter handler program promiscuous/multicast filter as well as broadcasting. o Remove unnecessary register access. o Simplify ioctl handler and have set_rxfilter to handle IFF_PROMISC and IFF_ALLMULTI change instead of directly programming the controller. o Removed unnecessary error variable reinitialization in ioctl handler. o Add IFF_DRV_RUNNING check before programming multicast filter. o Configure maximum allowed frame length before enabling MAC. Datasheet didn't say the exact ordering of programming sequence but it looks more natural to set maximum allowed frame length first prior to enabling controller. r200907: Don't report link status if driver is not running. r200908: Report the correct result of mii_mediachg(). Previously it always used to return success without respect to the result. While I'm here use mii_mediachg() in ste_init_locked which allows driver to use currently configured media. ste_ifmedia_upd() is supposed to be called whenever user changes current media settings. r200910: Implement hardware MAC statistics counter support. The counters could be accessed with dev.ste.0.stats sysctl node. r200911: Remove unused duplicated register definition. It seems the definition was made to access STE_ASICCTL register as 16bits but ste(4) always access the register as 32bits so it was never used before. r200912: Correct STE_COUNTDOWN register offset. The datasheet was wrong. r200913: We don't need to generate DMA complete interrupt for every transmitted frames. So request interrupt for every 16th frames. Due to the limitation of hardware we can't suppress the interrupt as driver should have to check TX status register. The TX status register can store up to 31 TX status so driver can't send more than 31 frames without reading TX status register. With this change controller would not generate TX completion interrupt for every frame, so reclaim transmitted frames in ste_tick(). Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:15:51 2010 (r202314) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:18:55 2010 (r202315) @@ -103,7 +103,6 @@ static int ste_eeprom_wait(struct ste_s static int ste_encap(struct ste_softc *, struct mbuf **, struct ste_chain *); static int ste_ifmedia_upd(struct ifnet *); -static void ste_ifmedia_upd_locked(struct ifnet *); static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *); static void ste_init(void *); static void ste_init_locked(struct ste_softc *); @@ -123,11 +122,13 @@ static int ste_read_eeprom(struct ste_so static void ste_reset(struct ste_softc *); static void ste_restart_tx(struct ste_softc *); static void ste_rxeof(struct ste_softc *, int); -static void ste_setmulti(struct ste_softc *); +static void ste_rxfilter(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); +static void ste_stats_clear(struct ste_softc *); static void ste_stats_update(struct ste_softc *); static void ste_stop(struct ste_softc *); +static void ste_sysctl_node(struct ste_softc *); static void ste_tick(void *); static void ste_txeoc(struct ste_softc *); static void ste_txeof(struct ste_softc *); @@ -449,31 +450,21 @@ static int ste_ifmedia_upd(struct ifnet *ifp) { struct ste_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; sc = ifp->if_softc; STE_LOCK(sc); - ste_ifmedia_upd_locked(ifp); - STE_UNLOCK(sc); - - return (0); -} - -static void -ste_ifmedia_upd_locked(struct ifnet *ifp) -{ - struct ste_softc *sc; - struct mii_data *mii; - - sc = ifp->if_softc; - STE_LOCK_ASSERT(sc); mii = device_get_softc(sc->ste_miibus); - sc->ste_flags &= ~STE_FLAG_LINK; if (mii->mii_instance) { - struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); + error = mii_mediachg(mii); + STE_UNLOCK(sc); + + return (error); } static void @@ -486,6 +477,10 @@ ste_ifmedia_sts(struct ifnet *ifp, struc mii = device_get_softc(sc->ste_miibus); STE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + STE_UNLOCK(sc); + return; + } mii_pollstat(mii); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; @@ -563,27 +558,33 @@ ste_read_eeprom(struct ste_softc *sc, ca } static void -ste_setmulti(struct ste_softc *sc) +ste_rxfilter(struct ste_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; uint32_t hashes[2] = { 0, 0 }; + uint8_t rxcfg; int h; + STE_LOCK_ASSERT(sc); + ifp = sc->ste_ifp; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_ALLMULTI); - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_MULTIHASH); - return; + rxcfg = CSR_READ_1(sc, STE_RX_MODE); + rxcfg |= STE_RXMODE_UNICAST; + rxcfg &= ~(STE_RXMODE_ALLMULTI | STE_RXMODE_MULTIHASH | + STE_RXMODE_BROADCAST | STE_RXMODE_PROMISC); + if (ifp->if_flags & IFF_BROADCAST) + rxcfg |= STE_RXMODE_BROADCAST; + if ((ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) != 0) { + if ((ifp->if_flags & IFF_ALLMULTI) != 0) + rxcfg |= STE_RXMODE_ALLMULTI; + if ((ifp->if_flags & IFF_PROMISC) != 0) + rxcfg |= STE_RXMODE_PROMISC; + goto chipit; } - /* first, zot all the existing hash bits */ - CSR_WRITE_2(sc, STE_MAR0, 0); - CSR_WRITE_2(sc, STE_MAR1, 0); - CSR_WRITE_2(sc, STE_MAR2, 0); - CSR_WRITE_2(sc, STE_MAR3, 0); - - /* now program new ones */ + rxcfg |= STE_RXMODE_MULTIHASH; + /* Now program new ones. */ IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -597,12 +598,13 @@ ste_setmulti(struct ste_softc *sc) } IF_ADDR_UNLOCK(ifp); +chipit: CSR_WRITE_2(sc, STE_MAR0, hashes[0] & 0xFFFF); CSR_WRITE_2(sc, STE_MAR1, (hashes[0] >> 16) & 0xFFFF); CSR_WRITE_2(sc, STE_MAR2, hashes[1] & 0xFFFF); CSR_WRITE_2(sc, STE_MAR3, (hashes[1] >> 16) & 0xFFFF); - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_ALLMULTI); - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_MULTIHASH); + CSR_WRITE_1(sc, STE_RX_MODE, rxcfg); + CSR_READ_1(sc, STE_RX_MODE); } #ifdef DEVICE_POLLING @@ -640,8 +642,10 @@ ste_poll_locked(struct ifnet *ifp, enum if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - if (status & STE_ISR_HOSTERR) + if (status & STE_ISR_HOSTERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ste_init_locked(sc); + } } } #endif /* DEVICE_POLLING */ @@ -688,8 +692,10 @@ ste_intr(void *xsc) if (status & STE_ISR_STATS_OFLOW) ste_stats_update(sc); - if (status & STE_ISR_HOSTERR) + if (status & STE_ISR_HOSTERR) { ste_init_locked(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + } } /* Re-enable interrupts */ @@ -826,6 +832,7 @@ ste_txeoc(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_STALL); ste_wait(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ste_init_locked(sc); break; } @@ -864,6 +871,13 @@ ste_tick(void *arg) */ if ((sc->ste_flags & STE_FLAG_LINK) == 0) ste_miibus_statchg(sc->ste_dev); + /* + * Because we are not generating Tx completion + * interrupt for every frame, reclaim transmitted + * buffers here. + */ + ste_txeof(sc); + ste_txeoc(sc); ste_stats_update(sc); ste_watchdog(sc); callout_reset(&sc->ste_callout, hz, ste_tick, sc); @@ -912,16 +926,74 @@ ste_txeof(struct ste_softc *sc) } static void +ste_stats_clear(struct ste_softc *sc) +{ + + STE_LOCK_ASSERT(sc); + + /* Rx stats. */ + CSR_READ_2(sc, STE_STAT_RX_OCTETS_LO); + CSR_READ_2(sc, STE_STAT_RX_OCTETS_HI); + CSR_READ_2(sc, STE_STAT_RX_FRAMES); + CSR_READ_1(sc, STE_STAT_RX_BCAST); + CSR_READ_1(sc, STE_STAT_RX_MCAST); + CSR_READ_1(sc, STE_STAT_RX_LOST); + /* Tx stats. */ + CSR_READ_2(sc, STE_STAT_TX_OCTETS_LO); + CSR_READ_2(sc, STE_STAT_TX_OCTETS_HI); + CSR_READ_2(sc, STE_STAT_TX_FRAMES); + CSR_READ_1(sc, STE_STAT_TX_BCAST); + CSR_READ_1(sc, STE_STAT_TX_MCAST); + CSR_READ_1(sc, STE_STAT_CARRIER_ERR); + CSR_READ_1(sc, STE_STAT_SINGLE_COLLS); + CSR_READ_1(sc, STE_STAT_MULTI_COLLS); + CSR_READ_1(sc, STE_STAT_LATE_COLLS); + CSR_READ_1(sc, STE_STAT_TX_DEFER); + CSR_READ_1(sc, STE_STAT_TX_EXDEFER); + CSR_READ_1(sc, STE_STAT_TX_ABORT); +} + +static void ste_stats_update(struct ste_softc *sc) { struct ifnet *ifp; + struct ste_hw_stats *stats; + uint32_t val; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; - ifp->if_collisions += CSR_READ_1(sc, STE_LATE_COLLS) - + CSR_READ_1(sc, STE_MULTI_COLLS) - + CSR_READ_1(sc, STE_SINGLE_COLLS); + stats = &sc->ste_stats; + /* Rx stats. */ + val = (uint32_t)CSR_READ_2(sc, STE_STAT_RX_OCTETS_LO) | + ((uint32_t)CSR_READ_2(sc, STE_STAT_RX_OCTETS_HI)) << 16; + val &= 0x000FFFFF; + stats->rx_bytes += val; + stats->rx_frames += CSR_READ_2(sc, STE_STAT_RX_FRAMES); + stats->rx_bcast_frames += CSR_READ_1(sc, STE_STAT_RX_BCAST); + stats->rx_mcast_frames += CSR_READ_1(sc, STE_STAT_RX_MCAST); + stats->rx_lost_frames += CSR_READ_1(sc, STE_STAT_RX_LOST); + /* Tx stats. */ + val = (uint32_t)CSR_READ_2(sc, STE_STAT_TX_OCTETS_LO) | + ((uint32_t)CSR_READ_2(sc, STE_STAT_TX_OCTETS_HI)) << 16; + val &= 0x000FFFFF; + stats->tx_bytes += val; + stats->tx_frames += CSR_READ_2(sc, STE_STAT_TX_FRAMES); + stats->tx_bcast_frames += CSR_READ_1(sc, STE_STAT_TX_BCAST); + stats->tx_mcast_frames += CSR_READ_1(sc, STE_STAT_TX_MCAST); + stats->tx_carrsense_errs += CSR_READ_1(sc, STE_STAT_CARRIER_ERR); + val = CSR_READ_1(sc, STE_STAT_SINGLE_COLLS); + stats->tx_single_colls += val; + ifp->if_collisions += val; + val = CSR_READ_1(sc, STE_STAT_MULTI_COLLS); + stats->tx_multi_colls += val; + ifp->if_collisions += val; + val += CSR_READ_1(sc, STE_STAT_LATE_COLLS); + stats->tx_late_colls += val; + ifp->if_collisions += val; + stats->tx_frames_defered += CSR_READ_1(sc, STE_STAT_TX_DEFER); + stats->tx_excess_defers += CSR_READ_1(sc, STE_STAT_TX_EXDEFER); + stats->tx_abort += CSR_READ_1(sc, STE_STAT_TX_ABORT); } /* @@ -1021,6 +1093,7 @@ ste_attach(device_t dev) error = ENXIO;; goto fail; } + ste_sysctl_node(sc); if ((error = ste_dma_alloc(sc)) != 0) goto fail; @@ -1537,10 +1610,15 @@ static void ste_init_locked(struct ste_softc *sc) { struct ifnet *ifp; + struct mii_data *mii; int i; STE_LOCK_ASSERT(sc); ifp = sc->ste_ifp; + mii = device_get_softc(sc->ste_miibus); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; ste_stop(sc); /* Reset the chip to a known state. */ @@ -1576,24 +1654,11 @@ ste_init_locked(struct ste_softc *sc) /* Set the TX reclaim threshold. */ CSR_WRITE_1(sc, STE_TX_RECLAIM_THRESH, (STE_PACKET_SIZE >> 4)); - /* Set up the RX filter. */ - CSR_WRITE_1(sc, STE_RX_MODE, STE_RXMODE_UNICAST); - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } else { - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } - - /* Set capture broadcast bit to accept broadcast frames. */ - if (ifp->if_flags & IFF_BROADCAST) { - STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_BROADCAST); - } else { - STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_BROADCAST); - } + /* Accept VLAN length packets */ + CSR_WRITE_2(sc, STE_MAX_FRAMELEN, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); - ste_setmulti(sc); + /* Set up the RX filter. */ + ste_rxfilter(sc); /* Load the address of the RX list. */ STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_RXDMA_STALL); @@ -1622,6 +1687,8 @@ ste_init_locked(struct ste_softc *sc) /* Enable stats counters. */ STE_SETBIT2(sc, STE_MACCTL1, STE_MACCTL1_STATS_ENABLE); + /* Clear stats counters. */ + ste_stats_clear(sc); CSR_WRITE_2(sc, STE_ISR, 0xFFFF); #ifdef DEVICE_POLLING @@ -1633,10 +1700,9 @@ ste_init_locked(struct ste_softc *sc) /* Enable interrupts. */ CSR_WRITE_2(sc, STE_IMR, STE_INTRS); - /* Accept VLAN length packets */ - CSR_WRITE_2(sc, STE_MAX_FRAMELEN, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); - - ste_ifmedia_upd_locked(ifp); + sc->ste_flags &= ~STE_FLAG_LINK; + /* Switch to the current media. */ + mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1717,20 +1783,27 @@ ste_stop(struct ste_softc *sc) static void ste_reset(struct ste_softc *sc) { + uint32_t ctl; int i; - STE_SETBIT4(sc, STE_ASICCTL, - STE_ASICCTL_GLOBAL_RESET|STE_ASICCTL_RX_RESET| - STE_ASICCTL_TX_RESET|STE_ASICCTL_DMA_RESET| - STE_ASICCTL_FIFO_RESET|STE_ASICCTL_NETWORK_RESET| - STE_ASICCTL_AUTOINIT_RESET|STE_ASICCTL_HOST_RESET| - STE_ASICCTL_EXTRESET_RESET); - - DELAY(100000); + ctl = CSR_READ_4(sc, STE_ASICCTL); + ctl |= STE_ASICCTL_GLOBAL_RESET | STE_ASICCTL_RX_RESET | + STE_ASICCTL_TX_RESET | STE_ASICCTL_DMA_RESET | + STE_ASICCTL_FIFO_RESET | STE_ASICCTL_NETWORK_RESET | + STE_ASICCTL_AUTOINIT_RESET |STE_ASICCTL_HOST_RESET | + STE_ASICCTL_EXTRESET_RESET; + CSR_WRITE_4(sc, STE_ASICCTL, ctl); + CSR_READ_4(sc, STE_ASICCTL); + /* + * Due to the need of accessing EEPROM controller can take + * up to 1ms to complete the global reset. + */ + DELAY(1000); for (i = 0; i < STE_TIMEOUT; i++) { if (!(CSR_READ_4(sc, STE_ASICCTL) & STE_ASICCTL_RESET_BUSY)) break; + DELAY(10); } if (i == STE_TIMEOUT) @@ -1771,39 +1844,24 @@ ste_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFFLAGS: STE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - ifp->if_flags & IFF_PROMISC && - !(sc->ste_if_flags & IFF_PROMISC)) { - STE_SETBIT1(sc, STE_RX_MODE, - STE_RXMODE_PROMISC); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->ste_if_flags & IFF_PROMISC) { - STE_CLRBIT1(sc, STE_RX_MODE, - STE_RXMODE_PROMISC); - } - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - (ifp->if_flags ^ sc->ste_if_flags) & IFF_ALLMULTI) - ste_setmulti(sc); - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - sc->ste_tx_thresh = STE_TXSTART_THRESH; + if ((ifp->if_flags & IFF_UP) != 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->ste_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + ste_rxfilter(sc); + else ste_init_locked(sc); - } - } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - ste_stop(sc); - } + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + ste_stop(sc); sc->ste_if_flags = ifp->if_flags; STE_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: STE_LOCK(sc); - ste_setmulti(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + ste_rxfilter(sc); STE_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: @@ -1896,7 +1954,11 @@ ste_encap(struct ste_softc *sc, struct m * Tx descriptors here. Otherwise we race with controller. */ desc->ste_next = 0; - desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | STE_TXCTL_DMAINTR); + if ((sc->ste_cdata.ste_tx_prod % STE_TX_INTR_FRAMES) == 0) + desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | + STE_TXCTL_DMAINTR); + else + desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS); txc->ste_mbuf = *m_head; STE_INC(sc->ste_cdata.ste_tx_prod, STE_TX_LIST_CNT); sc->ste_cdata.ste_tx_cnt++; @@ -1999,6 +2061,7 @@ ste_watchdog(struct ste_softc *sc) ste_txeof(sc); ste_txeoc(sc); ste_rxeof(sc, -1); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ste_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2018,3 +2081,70 @@ ste_shutdown(device_t dev) return (0); } + +#define STE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) +#define STE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_QUAD(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) + +static void +ste_sysctl_node(struct ste_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct ste_hw_stats *stats; + + stats = &sc->ste_stats; + ctx = device_get_sysctl_ctx(sc->ste_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ste_dev)); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "STE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + STE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->rx_bytes, "Good octets"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_frames, "Good frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->rx_bcast_frames, "Good broadcast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->rx_mcast_frames, "Good multicast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "lost_frames", + &stats->rx_lost_frames, "Lost frames"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + STE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", + &stats->tx_bytes, "Good octets"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_frames, "Good frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->tx_bcast_frames, "Good broadcast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->tx_mcast_frames, "Good multicast frames"); + STE_SYSCTL_STAT_ADD32(ctx, child, "carrier_errs", + &stats->tx_carrsense_errs, "Carrier sense errors"); + STE_SYSCTL_STAT_ADD32(ctx, child, "single_colls", + &stats->tx_single_colls, "Single collisions"); + STE_SYSCTL_STAT_ADD32(ctx, child, "multi_colls", + &stats->tx_multi_colls, "Multiple collisions"); + STE_SYSCTL_STAT_ADD32(ctx, child, "late_colls", + &stats->tx_late_colls, "Late collisions"); + STE_SYSCTL_STAT_ADD32(ctx, child, "defers", + &stats->tx_frames_defered, "Frames with deferrals"); + STE_SYSCTL_STAT_ADD32(ctx, child, "excess_defers", + &stats->tx_excess_defers, "Frames with excessive derferrals"); + STE_SYSCTL_STAT_ADD32(ctx, child, "abort", + &stats->tx_abort, "Aborted frames due to Excessive collisions"); +} + +#undef STE_SYSCTL_STAT_ADD32 +#undef STE_SYSCTL_STAT_ADD64 Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:15:51 2010 (r202314) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:18:55 2010 (r202315) @@ -63,6 +63,7 @@ #define STE_RX_DMABURST_THRESH 0x14 #define STE_RX_DMAURG_THRESH 0x15 #define STE_RX_DMAPOLL_PERIOD 0x16 +#define STE_COUNTDOWN 0x18 #define STE_DEBUGCTL 0x1A #define STE_ASICCTL 0x30 #define STE_EEPROM_DATA 0x34 @@ -75,7 +76,6 @@ #define STE_WAKE_EVENT 0x45 #define STE_TX_STATUS 0x46 #define STE_TX_FRAMEID 0x47 -#define STE_COUNTDOWN 0x48 #define STE_ISR_ACK 0x4A #define STE_IMR 0x4C #define STE_ISR 0x4E @@ -92,11 +92,25 @@ #define STE_MAR1 0x62 #define STE_MAR2 0x64 #define STE_MAR3 0x66 -#define STE_STATS 0x68 -#define STE_LATE_COLLS 0x75 -#define STE_MULTI_COLLS 0x76 -#define STE_SINGLE_COLLS 0x77 +#define STE_STAT_RX_OCTETS_LO 0x68 +#define STE_STAT_RX_OCTETS_HI 0x6A +#define STE_STAT_TX_OCTETS_LO 0x6C +#define STE_STAT_TX_OCTETS_HI 0x6E +#define STE_STAT_TX_FRAMES 0x70 +#define STE_STAT_RX_FRAMES 0x72 +#define STE_STAT_CARRIER_ERR 0x74 +#define STE_STAT_LATE_COLLS 0x75 +#define STE_STAT_MULTI_COLLS 0x76 +#define STE_STAT_SINGLE_COLLS 0x77 +#define STE_STAT_TX_DEFER 0x78 +#define STE_STAT_RX_LOST 0x79 +#define STE_STAT_TX_EXDEFER 0x7A +#define STE_STAT_TX_ABORT 0x7B +#define STE_STAT_TX_BCAST 0x7C +#define STE_STAT_RX_BCAST 0x7D +#define STE_STAT_TX_MCAST 0x7E +#define STE_STAT_RX_MCAST 0x7F #define STE_DMACTL_RXDMA_STOPPED 0x00000001 #define STE_DMACTL_TXDMA_CMPREQ 0x00000002 @@ -199,18 +213,6 @@ #define STE_ASICCTL_SOFTINTR 0x02000000 #define STE_ASICCTL_RESET_BUSY 0x04000000 -#define STE_ASICCTL1_GLOBAL_RESET 0x0001 -#define STE_ASICCTL1_RX_RESET 0x0002 -#define STE_ASICCTL1_TX_RESET 0x0004 -#define STE_ASICCTL1_DMA_RESET 0x0008 -#define STE_ASICCTL1_FIFO_RESET 0x0010 -#define STE_ASICCTL1_NETWORK_RESET 0x0020 -#define STE_ASICCTL1_HOST_RESET 0x0040 -#define STE_ASICCTL1_AUTOINIT_RESET 0x0080 -#define STE_ASICCTL1_EXTRESET_RESET 0x0100 -#define STE_ASICCTL1_SOFTINTR 0x0200 -#define STE_ASICCTL1_RESET_BUSY 0x0400 - #define STE_EECTL_ADDR 0x00FF #define STE_EECTL_OPCODE 0x0300 #define STE_EECTL_BUSY 0x1000 @@ -388,24 +390,23 @@ #define STE_PME_EN 0x0010 #define STE_PME_STATUS 0x8000 - -struct ste_stats { - uint32_t ste_rx_bytes; - uint32_t ste_tx_bytes; - uint16_t ste_tx_frames; - uint16_t ste_rx_frames; - uint8_t ste_carrsense_errs; - uint8_t ste_late_colls; - uint8_t ste_multi_colls; - uint8_t ste_single_colls; - uint8_t ste_tx_frames_defered; - uint8_t ste_rx_lost_frames; - uint8_t ste_tx_excess_defers; - uint8_t ste_tx_abort_excess_colls; - uint8_t ste_tx_bcast_frames; - uint8_t ste_rx_bcast_frames; - uint8_t ste_tx_mcast_frames; - uint8_t ste_rx_mcast_frames; +struct ste_hw_stats { + uint64_t rx_bytes; + uint32_t rx_frames; + uint32_t rx_bcast_frames; + uint32_t rx_mcast_frames; + uint32_t rx_lost_frames; + uint64_t tx_bytes; + uint32_t tx_frames; + uint32_t tx_bcast_frames; + uint32_t tx_mcast_frames; + uint32_t tx_carrsense_errs; + uint32_t tx_single_colls; + uint32_t tx_multi_colls; + uint32_t tx_late_colls; + uint32_t tx_frames_defered; + uint32_t tx_excess_defers; + uint32_t tx_abort; }; struct ste_frag { @@ -493,6 +494,12 @@ struct ste_desc_onefrag { #define STE_ADDR_LO(x) ((uint64_t)(x) & 0xFFFFFFFF) #define STE_ADDR_HI(x) ((uint64_t)(x) >> 32) +/* + * Since Tx status can hold up to 31 status bytes we should + * check Tx status before controller fills it up. Otherwise + * Tx MAC stalls. + */ +#define STE_TX_INTR_FRAMES 16 #define STE_TX_TIMEOUT 5 #define STE_TIMEOUT 1000 #define STE_MIN_FRAMELEN 60 @@ -566,6 +573,7 @@ struct ste_softc { struct ste_list_data ste_ldata; struct ste_chain_data ste_cdata; struct callout ste_callout; + struct ste_hw_stats ste_stats; struct mtx ste_mtx; }; From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:26:52 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9D5F106566B; Thu, 14 Jan 2010 22:26:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7B998FC1C; Thu, 14 Jan 2010 22:26:52 +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 o0EMQqsB065003; Thu, 14 Jan 2010 22:26:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMQqwk065000; Thu, 14 Jan 2010 22:26:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142226.o0EMQqwk065000@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:26:52 +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: r202318 - stable/8/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:26:52 -0000 Author: yongari Date: Thu Jan 14 22:26:52 2010 New Revision: 202318 URL: http://svn.freebsd.org/changeset/base/202318 Log: MFC r200950,200955,200965-200966,201767-201768 r200950: Implement RX interrupt moderation using one-shot timer interrupt. Unlike TX interrupt, ST201 does not provide any mechanism to suppress RX interrupts. ste(4) can generate more than 70k RX interrupts under heavy RX traffics such that these excessive interrupts make system useless to process other useful things. Maybe this was the major reason why polling support code was introduced to ste(4). The STE_COUNTDOWN register provides a programmable counter that will generate an interrupt upon its expiration. We program STE_DMACTL register to use 3.2us clock rate to drive the counter register. Whenever ste(4) serves RX interrupt, the driver rearm the timer to expire after STE_IM_RX_TIMER_DEFAULT time and disables further generation of RX interrupts. This trick seems to work well and ste(4) generates less than 8k RX interrupts even under 64 bytes UDP torture test. Combined with TX interrupts, the total number of interrupts are less than 10k which looks reasonable on heavily loaded controller. The default RX interrupt moderation time is 150us. Users can change the value at any time with dev.ste.%d.int_rx_mod sysctl node. Setting it 0 effectively disables the RX interrupt moderation feature. Now we have both TX/RX interrupt moderation code so remove loop of interrupt handler which resulted in sub-optimal performance as well as more register accesses. r200955: Add suspend/resume support as well as basic WOL. While I'm here simplify SIOCSIFCAP handler. r200965: Update if_iqdrops in case of RX buffer allocation failure. r200966: ether_ifattach sets if_mtu, remove unnecessary code. r201767: Fix EEPROM access code to return data in host byte order. EEPROM on ST201 always returns 16bits data with little endian format so conversion to host order is required. This change fixes inversed ethernet address on sparc64. r201768: Make sure to store dma address of RX buffer in little endian form. This fixes the last bug which keeps ste(4) from working on sparc64. Modified: stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/ste/if_stereg.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) Modified: stable/8/sys/dev/ste/if_ste.c ============================================================================== --- stable/8/sys/dev/ste/if_ste.c Thu Jan 14 22:21:43 2010 (r202317) +++ stable/8/sys/dev/ste/if_ste.c Thu Jan 14 22:26:52 2010 (r202318) @@ -94,7 +94,9 @@ static struct ste_type ste_devs[] = { static int ste_attach(device_t); static int ste_detach(device_t); static int ste_probe(device_t); +static int ste_resume(device_t); static int ste_shutdown(device_t); +static int ste_suspend(device_t); static int ste_dma_alloc(struct ste_softc *); static void ste_dma_free(struct ste_softc *); @@ -118,11 +120,12 @@ static int ste_miibus_readreg(device_t, static void ste_miibus_statchg(device_t); static int ste_miibus_writereg(device_t, int, int, int); static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); -static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); +static int ste_read_eeprom(struct ste_softc *, uint16_t *, int, int); static void ste_reset(struct ste_softc *); static void ste_restart_tx(struct ste_softc *); static int ste_rxeof(struct ste_softc *, int); static void ste_rxfilter(struct ste_softc *); +static void ste_setwol(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); static void ste_stats_clear(struct ste_softc *); @@ -141,6 +144,8 @@ static device_method_t ste_methods[] = { DEVMETHOD(device_attach, ste_attach), DEVMETHOD(device_detach, ste_detach), DEVMETHOD(device_shutdown, ste_shutdown), + DEVMETHOD(device_suspend, ste_suspend), + DEVMETHOD(device_resume, ste_resume), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), @@ -533,9 +538,8 @@ ste_eeprom_wait(struct ste_softc *sc) * data is stored in the EEPROM in network byte order. */ static int -ste_read_eeprom(struct ste_softc *sc, caddr_t dest, int off, int cnt, int swap) +ste_read_eeprom(struct ste_softc *sc, uint16_t *dest, int off, int cnt) { - uint16_t word, *ptr; int err = 0, i; if (ste_eeprom_wait(sc)) @@ -546,12 +550,8 @@ ste_read_eeprom(struct ste_softc *sc, ca err = ste_eeprom_wait(sc); if (err) break; - word = CSR_READ_2(sc, STE_EEPROM_DATA); - ptr = (uint16_t *)(dest + (i * 2)); - if (swap) - *ptr = ntohs(word); - else - *ptr = word; + *dest = le16toh(CSR_READ_2(sc, STE_EEPROM_DATA)); + dest++; } return (err ? 1 : 0); @@ -659,7 +659,7 @@ ste_intr(void *xsc) { struct ste_softc *sc; struct ifnet *ifp; - uint16_t status; + uint16_t intrs, status; sc = xsc; STE_LOCK(sc); @@ -671,43 +671,67 @@ ste_intr(void *xsc) return; } #endif - - /* See if this is really our interrupt. */ - if (!(CSR_READ_2(sc, STE_ISR) & STE_ISR_INTLATCH)) { + /* Reading STE_ISR_ACK clears STE_IMR register. */ + status = CSR_READ_2(sc, STE_ISR_ACK); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { STE_UNLOCK(sc); return; } - for (;;) { - status = CSR_READ_2(sc, STE_ISR_ACK); + intrs = STE_INTRS; + if (status == 0xFFFF || (status & intrs) == 0) + goto done; - if (!(status & STE_INTRS)) - break; - - if (status & STE_ISR_RX_DMADONE) - ste_rxeof(sc, -1); + if (sc->ste_int_rx_act > 0) { + status &= ~STE_ISR_RX_DMADONE; + intrs &= ~STE_IMR_RX_DMADONE; + } - if (status & STE_ISR_TX_DMADONE) + if ((status & (STE_ISR_SOFTINTR | STE_ISR_RX_DMADONE)) != 0) { + ste_rxeof(sc, -1); + /* + * The controller has no ability to Rx interrupt + * moderation feature. Receiving 64 bytes frames + * from wire generates too many interrupts which in + * turn make system useless to process other useful + * things. Fortunately ST201 supports single shot + * timer so use the timer to implement Rx interrupt + * moderation in driver. This adds more register + * access but it greatly reduces number of Rx + * interrupts under high network load. + */ + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + (sc->ste_int_rx_mod != 0)) { + if ((status & STE_ISR_RX_DMADONE) != 0) { + CSR_WRITE_2(sc, STE_COUNTDOWN, + STE_TIMER_USECS(sc->ste_int_rx_mod)); + intrs &= ~STE_IMR_RX_DMADONE; + sc->ste_int_rx_act = 1; + } else { + intrs |= STE_IMR_RX_DMADONE; + sc->ste_int_rx_act = 0; + } + } + } + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if ((status & STE_ISR_TX_DMADONE) != 0) ste_txeof(sc); - - if (status & STE_ISR_TX_DONE) + if ((status & STE_ISR_TX_DONE) != 0) ste_txeoc(sc); - - if (status & STE_ISR_STATS_OFLOW) + if ((status & STE_ISR_STATS_OFLOW) != 0) ste_stats_update(sc); - - if (status & STE_ISR_HOSTERR) { - ste_init_locked(sc); + if ((status & STE_ISR_HOSTERR) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ste_init_locked(sc); + STE_UNLOCK(sc); + return; } + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + ste_start_locked(ifp); +done: + /* Re-enable interrupts */ + CSR_WRITE_2(sc, STE_IMR, intrs); } - - /* Re-enable interrupts */ - CSR_WRITE_2(sc, STE_IMR, STE_INTRS); - - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - ste_start_locked(ifp); - STE_UNLOCK(sc); } @@ -769,7 +793,7 @@ ste_rxeof(struct ste_softc *sc, int coun * can do in this situation. */ if (ste_newbuf(sc, cur_rx) != 0) { - ifp->if_ierrors++; + ifp->if_iqdrops++; cur_rx->ste_ptr->ste_status = 0; continue; } @@ -1034,8 +1058,8 @@ ste_attach(device_t dev) { struct ste_softc *sc; struct ifnet *ifp; - u_char eaddr[6]; - int error = 0, rid; + uint16_t eaddr[ETHER_ADDR_LEN / 2]; + int error = 0, pmc, rid; sc = device_get_softc(dev); sc->ste_dev = dev; @@ -1093,8 +1117,7 @@ ste_attach(device_t dev) /* * Get station address from the EEPROM. */ - if (ste_read_eeprom(sc, eaddr, - STE_EEADDR_NODE0, 3, 0)) { + if (ste_read_eeprom(sc, eaddr, STE_EEADDR_NODE0, ETHER_ADDR_LEN / 2)) { device_printf(dev, "failed to read station address\n"); error = ENXIO;; goto fail; @@ -1121,7 +1144,6 @@ ste_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ste_ioctl; ifp->if_start = ste_start; @@ -1135,13 +1157,15 @@ ste_attach(device_t dev) /* * Call MI attach routine. */ - ether_ifattach(ifp, eaddr); + ether_ifattach(ifp, (uint8_t *)eaddr); /* * Tell the upper layer(s) we support long frames. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_VLAN_MTU; + if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) + ifp->if_capabilities |= IFCAP_WOL_MAGIC; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -1538,6 +1562,7 @@ ste_init_rx_list(struct ste_softc *sc) struct ste_list_data *ld; int error, i; + sc->ste_int_rx_act = 0; cd = &sc->ste_cdata; ld = &sc->ste_ldata; bzero(ld->ste_rx_list, STE_RX_LIST_SZ); @@ -1548,12 +1573,14 @@ ste_init_rx_list(struct ste_softc *sc) return (error); if (i == (STE_RX_LIST_CNT - 1)) { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; - ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + - (sizeof(struct ste_desc_onefrag) * 0); + ld->ste_rx_list[i].ste_next = + htole32(ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * 0)); } else { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[i + 1]; - ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + - (sizeof(struct ste_desc_onefrag) * (i + 1)); + ld->ste_rx_list[i].ste_next = + htole32(ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * (i + 1))); } } @@ -1617,6 +1644,7 @@ ste_init_locked(struct ste_softc *sc) { struct ifnet *ifp; struct mii_data *mii; + uint8_t val; int i; STE_LOCK_ASSERT(sc); @@ -1651,6 +1679,12 @@ ste_init_locked(struct ste_softc *sc) /* Init TX descriptors */ ste_init_tx_list(sc); + /* Clear and disable WOL. */ + val = CSR_READ_1(sc, STE_WAKE_EVENT); + val &= ~(STE_WAKEEVENT_WAKEPKT_ENB | STE_WAKEEVENT_MAGICPKT_ENB | + STE_WAKEEVENT_LINKEVT_ENB | STE_WAKEEVENT_WAKEONLAN_ENB); + CSR_WRITE_1(sc, STE_WAKE_EVENT, val); + /* Set the TX freethresh value */ CSR_WRITE_1(sc, STE_TX_DMABURST_THRESH, STE_PACKET_SIZE >> 8); @@ -1684,6 +1718,9 @@ ste_init_locked(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); + /* Select 3.2us timer. */ + STE_CLRBIT4(sc, STE_DMACTL, STE_DMACTL_COUNTDOWN_SPEED | + STE_DMACTL_COUNTDOWN_MODE); /* Enable receiver and transmitter */ CSR_WRITE_2(sc, STE_MACCTL0, 0); @@ -1696,6 +1733,7 @@ ste_init_locked(struct ste_softc *sc) /* Clear stats counters. */ ste_stats_clear(sc); + CSR_WRITE_2(sc, STE_COUNTDOWN, 0); CSR_WRITE_2(sc, STE_ISR, 0xFFFF); #ifdef DEVICE_POLLING /* Disable interrupts if we are polling. */ @@ -1733,6 +1771,7 @@ ste_stop(struct ste_softc *sc) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); CSR_WRITE_2(sc, STE_IMR, 0); + CSR_WRITE_2(sc, STE_COUNTDOWN, 0); /* Stop pending DMA. */ val = CSR_READ_4(sc, STE_DMACTL); val |= STE_DMACTL_TXDMA_STALL | STE_DMACTL_RXDMA_STALL; @@ -1842,7 +1881,7 @@ ste_ioctl(struct ifnet *ifp, u_long comm struct ste_softc *sc; struct ifreq *ifr; struct mii_data *mii; - int error = 0; + int error = 0, mask; sc = ifp->if_softc; ifr = (struct ifreq *)data; @@ -1875,31 +1914,31 @@ ste_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: + STE_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING - if (ifr->ifr_reqcap & IFCAP_POLLING && - !(ifp->if_capenable & IFCAP_POLLING)) { - error = ether_poll_register(ste_poll, ifp); - if (error) - return (error); - STE_LOCK(sc); - /* Disable interrupts */ - CSR_WRITE_2(sc, STE_IMR, 0); - ifp->if_capenable |= IFCAP_POLLING; - STE_UNLOCK(sc); - return (error); - - } - if (!(ifr->ifr_reqcap & IFCAP_POLLING) && - ifp->if_capenable & IFCAP_POLLING) { - error = ether_poll_deregister(ifp); - /* Enable interrupts. */ - STE_LOCK(sc); - CSR_WRITE_2(sc, STE_IMR, STE_INTRS); - ifp->if_capenable &= ~IFCAP_POLLING; - STE_UNLOCK(sc); - return (error); + if ((mask & IFCAP_POLLING) != 0 && + (IFCAP_POLLING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_POLLING; + if ((IFCAP_POLLING & ifp->if_capenable) != 0) { + error = ether_poll_register(ste_poll, ifp); + if (error != 0) { + STE_UNLOCK(sc); + break; + } + /* Disable interrupts. */ + CSR_WRITE_2(sc, STE_IMR, 0); + } else { + error = ether_poll_deregister(ifp); + /* Enable interrupts. */ + CSR_WRITE_2(sc, STE_IMR, STE_INTRS); + } } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + STE_UNLOCK(sc); break; default: error = ether_ioctl(ifp, command, data); @@ -2077,12 +2116,50 @@ ste_watchdog(struct ste_softc *sc) static int ste_shutdown(device_t dev) { + + return (ste_suspend(dev)); +} + +static int +ste_suspend(device_t dev) +{ struct ste_softc *sc; sc = device_get_softc(dev); STE_LOCK(sc); ste_stop(sc); + ste_setwol(sc); + STE_UNLOCK(sc); + + return (0); +} + +static int +ste_resume(device_t dev) +{ + struct ste_softc *sc; + struct ifnet *ifp; + int pmc; + uint16_t pmstat; + + sc = device_get_softc(dev); + STE_LOCK(sc); + if (pci_find_extcap(sc->ste_dev, PCIY_PMG, &pmc) == 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->ste_dev, + pmc + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->ste_dev, + pmc + PCIR_POWER_STATUS, pmstat, 2); + } + } + ifp = sc->ste_ifp; + if ((ifp->if_flags & IFF_UP) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ste_init_locked(sc); + } STE_UNLOCK(sc); return (0); @@ -2105,6 +2182,13 @@ ste_sysctl_node(struct ste_softc *sc) ctx = device_get_sysctl_ctx(sc->ste_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ste_dev)); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "int_rx_mod", + CTLFLAG_RW, &sc->ste_int_rx_mod, 0, "ste RX interrupt moderation"); + /* Pull in device tunables. */ + sc->ste_int_rx_mod = STE_IM_RX_TIMER_DEFAULT; + resource_int_value(device_get_name(sc->ste_dev), + device_get_unit(sc->ste_dev), "int_rx_mod", &sc->ste_int_rx_mod); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, NULL, "STE statistics"); parent = SYSCTL_CHILDREN(tree); @@ -2154,3 +2238,35 @@ ste_sysctl_node(struct ste_softc *sc) #undef STE_SYSCTL_STAT_ADD32 #undef STE_SYSCTL_STAT_ADD64 + +static void +ste_setwol(struct ste_softc *sc) +{ + struct ifnet *ifp; + uint16_t pmstat; + uint8_t val; + int pmc; + + STE_LOCK_ASSERT(sc); + + if (pci_find_extcap(sc->ste_dev, PCIY_PMG, &pmc) != 0) { + /* Disable WOL. */ + CSR_READ_1(sc, STE_WAKE_EVENT); + CSR_WRITE_1(sc, STE_WAKE_EVENT, 0); + return; + } + + ifp = sc->ste_ifp; + val = CSR_READ_1(sc, STE_WAKE_EVENT); + val &= ~(STE_WAKEEVENT_WAKEPKT_ENB | STE_WAKEEVENT_MAGICPKT_ENB | + STE_WAKEEVENT_LINKEVT_ENB | STE_WAKEEVENT_WAKEONLAN_ENB); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= STE_WAKEEVENT_MAGICPKT_ENB | STE_WAKEEVENT_WAKEONLAN_ENB; + CSR_WRITE_1(sc, STE_WAKE_EVENT, val); + /* Request PME. */ + pmstat = pci_read_config(sc->ste_dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->ste_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); +} Modified: stable/8/sys/dev/ste/if_stereg.h ============================================================================== --- stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 22:21:43 2010 (r202317) +++ stable/8/sys/dev/ste/if_stereg.h Thu Jan 14 22:26:52 2010 (r202318) @@ -285,7 +285,8 @@ #define STE_INTRS \ (STE_IMR_RX_DMADONE|STE_IMR_TX_DMADONE| \ - STE_IMR_TX_DONE|STE_IMR_HOSTERR) + STE_IMR_TX_DONE|STE_IMR_SOFTINTR| \ + STE_IMR_HOSTERR) #define STE_ISR_INTLATCH 0x0001 #define STE_ISR_HOSTERR 0x0002 @@ -349,6 +350,13 @@ #define STE_PHYCTL_SPEEDSTAT 0x40 #define STE_PHYCTL_LINKSTAT 0x80 +#define STE_TIMER_TICKS 32 +#define STE_TIMER_USECS(x) ((x * 10) / STE_TIMER_TICKS) + +#define STE_IM_RX_TIMER_MIN 0 +#define STE_IM_RX_TIMER_MAX 209712 +#define STE_IM_RX_TIMER_DEFAULT 150 + /* * EEPROM offsets. */ @@ -570,6 +578,8 @@ struct ste_softc { #define STE_FLAG_LINK 0x8000 int ste_if_flags; int ste_timer; + int ste_int_rx_act; + int ste_int_rx_mod; struct ste_list_data ste_ldata; struct ste_chain_data ste_cdata; struct callout ste_callout; From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:29:29 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B6A01065679; Thu, 14 Jan 2010 22:29:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 695D18FC0C; Thu, 14 Jan 2010 22:29: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 o0EMTTRZ065667; Thu, 14 Jan 2010 22:29:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMTTPD065664; Thu, 14 Jan 2010 22:29:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142229.o0EMTTPD065664@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202319 - stable/7/sys/dev/ste X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:29:29 -0000 Author: yongari Date: Thu Jan 14 22:29:29 2010 New Revision: 202319 URL: http://svn.freebsd.org/changeset/base/202319 Log: MFC r200950,200955,200965-200966,201767-201768 r200950: Implement RX interrupt moderation using one-shot timer interrupt. Unlike TX interrupt, ST201 does not provide any mechanism to suppress RX interrupts. ste(4) can generate more than 70k RX interrupts under heavy RX traffics such that these excessive interrupts make system useless to process other useful things. Maybe this was the major reason why polling support code was introduced to ste(4). The STE_COUNTDOWN register provides a programmable counter that will generate an interrupt upon its expiration. We program STE_DMACTL register to use 3.2us clock rate to drive the counter register. Whenever ste(4) serves RX interrupt, the driver rearm the timer to expire after STE_IM_RX_TIMER_DEFAULT time and disables further generation of RX interrupts. This trick seems to work well and ste(4) generates less than 8k RX interrupts even under 64 bytes UDP torture test. Combined with TX interrupts, the total number of interrupts are less than 10k which looks reasonable on heavily loaded controller. The default RX interrupt moderation time is 150us. Users can change the value at any time with dev.ste.%d.int_rx_mod sysctl node. Setting it 0 effectively disables the RX interrupt moderation feature. Now we have both TX/RX interrupt moderation code so remove loop of interrupt handler which resulted in sub-optimal performance as well as more register accesses. r200955: Add suspend/resume support as well as basic WOL. While I'm here simplify SIOCSIFCAP handler. r200965: Update if_iqdrops in case of RX buffer allocation failure. r200966: ether_ifattach sets if_mtu, remove unnecessary code. r201767: Fix EEPROM access code to return data in host byte order. EEPROM on ST201 always returns 16bits data with little endian format so conversion to host order is required. This change fixes inversed ethernet address on sparc64. r201768: Make sure to store dma address of RX buffer in little endian form. This fixes the last bug which keeps ste(4) from working on sparc64. Modified: stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/ste/if_stereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:26:52 2010 (r202318) +++ stable/7/sys/dev/ste/if_ste.c Thu Jan 14 22:29:29 2010 (r202319) @@ -94,7 +94,9 @@ static struct ste_type ste_devs[] = { static int ste_attach(device_t); static int ste_detach(device_t); static int ste_probe(device_t); +static int ste_resume(device_t); static int ste_shutdown(device_t); +static int ste_suspend(device_t); static int ste_dma_alloc(struct ste_softc *); static void ste_dma_free(struct ste_softc *); @@ -118,11 +120,12 @@ static int ste_miibus_readreg(device_t, static void ste_miibus_statchg(device_t); static int ste_miibus_writereg(device_t, int, int, int); static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); -static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); +static int ste_read_eeprom(struct ste_softc *, uint16_t *, int, int); static void ste_reset(struct ste_softc *); static void ste_restart_tx(struct ste_softc *); static void ste_rxeof(struct ste_softc *, int); static void ste_rxfilter(struct ste_softc *); +static void ste_setwol(struct ste_softc *); static void ste_start(struct ifnet *); static void ste_start_locked(struct ifnet *); static void ste_stats_clear(struct ste_softc *); @@ -141,6 +144,8 @@ static device_method_t ste_methods[] = { DEVMETHOD(device_attach, ste_attach), DEVMETHOD(device_detach, ste_detach), DEVMETHOD(device_shutdown, ste_shutdown), + DEVMETHOD(device_suspend, ste_suspend), + DEVMETHOD(device_resume, ste_resume), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), @@ -533,9 +538,8 @@ ste_eeprom_wait(struct ste_softc *sc) * data is stored in the EEPROM in network byte order. */ static int -ste_read_eeprom(struct ste_softc *sc, caddr_t dest, int off, int cnt, int swap) +ste_read_eeprom(struct ste_softc *sc, uint16_t *dest, int off, int cnt) { - uint16_t word, *ptr; int err = 0, i; if (ste_eeprom_wait(sc)) @@ -546,12 +550,8 @@ ste_read_eeprom(struct ste_softc *sc, ca err = ste_eeprom_wait(sc); if (err) break; - word = CSR_READ_2(sc, STE_EEPROM_DATA); - ptr = (uint16_t *)(dest + (i * 2)); - if (swap) - *ptr = ntohs(word); - else - *ptr = word; + *dest = le16toh(CSR_READ_2(sc, STE_EEPROM_DATA)); + dest++; } return (err ? 1 : 0); @@ -655,7 +655,7 @@ ste_intr(void *xsc) { struct ste_softc *sc; struct ifnet *ifp; - uint16_t status; + uint16_t intrs, status; sc = xsc; STE_LOCK(sc); @@ -667,43 +667,67 @@ ste_intr(void *xsc) return; } #endif - - /* See if this is really our interrupt. */ - if (!(CSR_READ_2(sc, STE_ISR) & STE_ISR_INTLATCH)) { + /* Reading STE_ISR_ACK clears STE_IMR register. */ + status = CSR_READ_2(sc, STE_ISR_ACK); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { STE_UNLOCK(sc); return; } - for (;;) { - status = CSR_READ_2(sc, STE_ISR_ACK); + intrs = STE_INTRS; + if (status == 0xFFFF || (status & intrs) == 0) + goto done; - if (!(status & STE_INTRS)) - break; - - if (status & STE_ISR_RX_DMADONE) - ste_rxeof(sc, -1); + if (sc->ste_int_rx_act > 0) { + status &= ~STE_ISR_RX_DMADONE; + intrs &= ~STE_IMR_RX_DMADONE; + } - if (status & STE_ISR_TX_DMADONE) + if ((status & (STE_ISR_SOFTINTR | STE_ISR_RX_DMADONE)) != 0) { + ste_rxeof(sc, -1); + /* + * The controller has no ability to Rx interrupt + * moderation feature. Receiving 64 bytes frames + * from wire generates too many interrupts which in + * turn make system useless to process other useful + * things. Fortunately ST201 supports single shot + * timer so use the timer to implement Rx interrupt + * moderation in driver. This adds more register + * access but it greatly reduces number of Rx + * interrupts under high network load. + */ + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + (sc->ste_int_rx_mod != 0)) { + if ((status & STE_ISR_RX_DMADONE) != 0) { + CSR_WRITE_2(sc, STE_COUNTDOWN, + STE_TIMER_USECS(sc->ste_int_rx_mod)); + intrs &= ~STE_IMR_RX_DMADONE; + sc->ste_int_rx_act = 1; + } else { + intrs |= STE_IMR_RX_DMADONE; + sc->ste_int_rx_act = 0; + } + } + } + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if ((status & STE_ISR_TX_DMADONE) != 0) ste_txeof(sc); - - if (status & STE_ISR_TX_DONE) + if ((status & STE_ISR_TX_DONE) != 0) ste_txeoc(sc); - - if (status & STE_ISR_STATS_OFLOW) + if ((status & STE_ISR_STATS_OFLOW) != 0) ste_stats_update(sc); - - if (status & STE_ISR_HOSTERR) { - ste_init_locked(sc); + if ((status & STE_ISR_HOSTERR) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ste_init_locked(sc); + STE_UNLOCK(sc); + return; } + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + ste_start_locked(ifp); +done: + /* Re-enable interrupts */ + CSR_WRITE_2(sc, STE_IMR, intrs); } - - /* Re-enable interrupts */ - CSR_WRITE_2(sc, STE_IMR, STE_INTRS); - - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - ste_start_locked(ifp); - STE_UNLOCK(sc); } @@ -765,7 +789,7 @@ ste_rxeof(struct ste_softc *sc, int coun * can do in this situation. */ if (ste_newbuf(sc, cur_rx) != 0) { - ifp->if_ierrors++; + ifp->if_iqdrops++; cur_rx->ste_ptr->ste_status = 0; continue; } @@ -1028,8 +1052,8 @@ ste_attach(device_t dev) { struct ste_softc *sc; struct ifnet *ifp; - u_char eaddr[6]; - int error = 0, rid; + uint16_t eaddr[ETHER_ADDR_LEN / 2]; + int error = 0, pmc, rid; sc = device_get_softc(dev); sc->ste_dev = dev; @@ -1087,8 +1111,7 @@ ste_attach(device_t dev) /* * Get station address from the EEPROM. */ - if (ste_read_eeprom(sc, eaddr, - STE_EEADDR_NODE0, 3, 0)) { + if (ste_read_eeprom(sc, eaddr, STE_EEADDR_NODE0, ETHER_ADDR_LEN / 2)) { device_printf(dev, "failed to read station address\n"); error = ENXIO;; goto fail; @@ -1115,7 +1138,6 @@ ste_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ste_ioctl; ifp->if_start = ste_start; @@ -1129,13 +1151,15 @@ ste_attach(device_t dev) /* * Call MI attach routine. */ - ether_ifattach(ifp, eaddr); + ether_ifattach(ifp, (uint8_t *)eaddr); /* * Tell the upper layer(s) we support long frames. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_VLAN_MTU; + if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) + ifp->if_capabilities |= IFCAP_WOL_MAGIC; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -1532,6 +1556,7 @@ ste_init_rx_list(struct ste_softc *sc) struct ste_list_data *ld; int error, i; + sc->ste_int_rx_act = 0; cd = &sc->ste_cdata; ld = &sc->ste_ldata; bzero(ld->ste_rx_list, STE_RX_LIST_SZ); @@ -1542,12 +1567,14 @@ ste_init_rx_list(struct ste_softc *sc) return (error); if (i == (STE_RX_LIST_CNT - 1)) { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; - ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + - (sizeof(struct ste_desc_onefrag) * 0); + ld->ste_rx_list[i].ste_next = + htole32(ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * 0)); } else { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[i + 1]; - ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + - (sizeof(struct ste_desc_onefrag) * (i + 1)); + ld->ste_rx_list[i].ste_next = + htole32(ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * (i + 1))); } } @@ -1611,6 +1638,7 @@ ste_init_locked(struct ste_softc *sc) { struct ifnet *ifp; struct mii_data *mii; + uint8_t val; int i; STE_LOCK_ASSERT(sc); @@ -1645,6 +1673,12 @@ ste_init_locked(struct ste_softc *sc) /* Init TX descriptors */ ste_init_tx_list(sc); + /* Clear and disable WOL. */ + val = CSR_READ_1(sc, STE_WAKE_EVENT); + val &= ~(STE_WAKEEVENT_WAKEPKT_ENB | STE_WAKEEVENT_MAGICPKT_ENB | + STE_WAKEEVENT_LINKEVT_ENB | STE_WAKEEVENT_WAKEONLAN_ENB); + CSR_WRITE_1(sc, STE_WAKE_EVENT, val); + /* Set the TX freethresh value */ CSR_WRITE_1(sc, STE_TX_DMABURST_THRESH, STE_PACKET_SIZE >> 8); @@ -1678,6 +1712,9 @@ ste_init_locked(struct ste_softc *sc) STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); STE_SETBIT4(sc, STE_DMACTL, STE_DMACTL_TXDMA_UNSTALL); ste_wait(sc); + /* Select 3.2us timer. */ + STE_CLRBIT4(sc, STE_DMACTL, STE_DMACTL_COUNTDOWN_SPEED | + STE_DMACTL_COUNTDOWN_MODE); /* Enable receiver and transmitter */ CSR_WRITE_2(sc, STE_MACCTL0, 0); @@ -1690,6 +1727,7 @@ ste_init_locked(struct ste_softc *sc) /* Clear stats counters. */ ste_stats_clear(sc); + CSR_WRITE_2(sc, STE_COUNTDOWN, 0); CSR_WRITE_2(sc, STE_ISR, 0xFFFF); #ifdef DEVICE_POLLING /* Disable interrupts if we are polling. */ @@ -1727,6 +1765,7 @@ ste_stop(struct ste_softc *sc) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); CSR_WRITE_2(sc, STE_IMR, 0); + CSR_WRITE_2(sc, STE_COUNTDOWN, 0); /* Stop pending DMA. */ val = CSR_READ_4(sc, STE_DMACTL); val |= STE_DMACTL_TXDMA_STALL | STE_DMACTL_RXDMA_STALL; @@ -1836,7 +1875,7 @@ ste_ioctl(struct ifnet *ifp, u_long comm struct ste_softc *sc; struct ifreq *ifr; struct mii_data *mii; - int error = 0; + int error = 0, mask; sc = ifp->if_softc; ifr = (struct ifreq *)data; @@ -1869,31 +1908,31 @@ ste_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: + STE_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING - if (ifr->ifr_reqcap & IFCAP_POLLING && - !(ifp->if_capenable & IFCAP_POLLING)) { - error = ether_poll_register(ste_poll, ifp); - if (error) - return (error); - STE_LOCK(sc); - /* Disable interrupts */ - CSR_WRITE_2(sc, STE_IMR, 0); - ifp->if_capenable |= IFCAP_POLLING; - STE_UNLOCK(sc); - return (error); - - } - if (!(ifr->ifr_reqcap & IFCAP_POLLING) && - ifp->if_capenable & IFCAP_POLLING) { - error = ether_poll_deregister(ifp); - /* Enable interrupts. */ - STE_LOCK(sc); - CSR_WRITE_2(sc, STE_IMR, STE_INTRS); - ifp->if_capenable &= ~IFCAP_POLLING; - STE_UNLOCK(sc); - return (error); + if ((mask & IFCAP_POLLING) != 0 && + (IFCAP_POLLING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_POLLING; + if ((IFCAP_POLLING & ifp->if_capenable) != 0) { + error = ether_poll_register(ste_poll, ifp); + if (error != 0) { + STE_UNLOCK(sc); + break; + } + /* Disable interrupts. */ + CSR_WRITE_2(sc, STE_IMR, 0); + } else { + error = ether_poll_deregister(ifp); + /* Enable interrupts. */ + CSR_WRITE_2(sc, STE_IMR, STE_INTRS); + } } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + STE_UNLOCK(sc); break; default: error = ether_ioctl(ifp, command, data); @@ -2071,12 +2110,50 @@ ste_watchdog(struct ste_softc *sc) static int ste_shutdown(device_t dev) { + + return (ste_suspend(dev)); +} + +static int +ste_suspend(device_t dev) +{ struct ste_softc *sc; sc = device_get_softc(dev); STE_LOCK(sc); ste_stop(sc); + ste_setwol(sc); + STE_UNLOCK(sc); + + return (0); +} + +static int +ste_resume(device_t dev) +{ + struct ste_softc *sc; + struct ifnet *ifp; + int pmc; + uint16_t pmstat; + + sc = device_get_softc(dev); + STE_LOCK(sc); + if (pci_find_extcap(sc->ste_dev, PCIY_PMG, &pmc) == 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->ste_dev, + pmc + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->ste_dev, + pmc + PCIR_POWER_STATUS, pmstat, 2); + } + } + ifp = sc->ste_ifp; + if ((ifp->if_flags & IFF_UP) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ste_init_locked(sc); + } STE_UNLOCK(sc); return (0); @@ -2099,6 +2176,13 @@ ste_sysctl_node(struct ste_softc *sc) ctx = device_get_sysctl_ctx(sc->ste_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ste_dev)); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "int_rx_mod", + CTLFLAG_RW, &sc->ste_int_rx_mod, 0, "ste RX interrupt moderation"); + /* Pull in device tunables. */ + sc->ste_int_rx_mod = STE_IM_RX_TIMER_DEFAULT; + resource_int_value(device_get_name(sc->ste_dev), + device_get_unit(sc->ste_dev), "int_rx_mod", &sc->ste_int_rx_mod); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, NULL, "STE statistics"); parent = SYSCTL_CHILDREN(tree); @@ -2148,3 +2232,35 @@ ste_sysctl_node(struct ste_softc *sc) #undef STE_SYSCTL_STAT_ADD32 #undef STE_SYSCTL_STAT_ADD64 + +static void +ste_setwol(struct ste_softc *sc) +{ + struct ifnet *ifp; + uint16_t pmstat; + uint8_t val; + int pmc; + + STE_LOCK_ASSERT(sc); + + if (pci_find_extcap(sc->ste_dev, PCIY_PMG, &pmc) != 0) { + /* Disable WOL. */ + CSR_READ_1(sc, STE_WAKE_EVENT); + CSR_WRITE_1(sc, STE_WAKE_EVENT, 0); + return; + } + + ifp = sc->ste_ifp; + val = CSR_READ_1(sc, STE_WAKE_EVENT); + val &= ~(STE_WAKEEVENT_WAKEPKT_ENB | STE_WAKEEVENT_MAGICPKT_ENB | + STE_WAKEEVENT_LINKEVT_ENB | STE_WAKEEVENT_WAKEONLAN_ENB); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= STE_WAKEEVENT_MAGICPKT_ENB | STE_WAKEEVENT_WAKEONLAN_ENB; + CSR_WRITE_1(sc, STE_WAKE_EVENT, val); + /* Request PME. */ + pmstat = pci_read_config(sc->ste_dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->ste_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); +} Modified: stable/7/sys/dev/ste/if_stereg.h ============================================================================== --- stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:26:52 2010 (r202318) +++ stable/7/sys/dev/ste/if_stereg.h Thu Jan 14 22:29:29 2010 (r202319) @@ -285,7 +285,8 @@ #define STE_INTRS \ (STE_IMR_RX_DMADONE|STE_IMR_TX_DMADONE| \ - STE_IMR_TX_DONE|STE_IMR_HOSTERR) + STE_IMR_TX_DONE|STE_IMR_SOFTINTR| \ + STE_IMR_HOSTERR) #define STE_ISR_INTLATCH 0x0001 #define STE_ISR_HOSTERR 0x0002 @@ -349,6 +350,13 @@ #define STE_PHYCTL_SPEEDSTAT 0x40 #define STE_PHYCTL_LINKSTAT 0x80 +#define STE_TIMER_TICKS 32 +#define STE_TIMER_USECS(x) ((x * 10) / STE_TIMER_TICKS) + +#define STE_IM_RX_TIMER_MIN 0 +#define STE_IM_RX_TIMER_MAX 209712 +#define STE_IM_RX_TIMER_DEFAULT 150 + /* * EEPROM offsets. */ @@ -570,6 +578,8 @@ struct ste_softc { #define STE_FLAG_LINK 0x8000 int ste_if_flags; int ste_timer; + int ste_int_rx_act; + int ste_int_rx_mod; struct ste_list_data ste_ldata; struct ste_chain_data ste_cdata; struct callout ste_callout; From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:33:47 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04DDA106568D; Thu, 14 Jan 2010 22:33:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E81B08FC21; Thu, 14 Jan 2010 22:33: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 o0EMXkTR066676; Thu, 14 Jan 2010 22:33:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMXkIk066674; Thu, 14 Jan 2010 22:33:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142233.o0EMXkIk066674@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:33: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: r202320 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:33:47 -0000 Author: yongari Date: Thu Jan 14 22:33:46 2010 New Revision: 202320 URL: http://svn.freebsd.org/changeset/base/202320 Log: MFC r200958: Document newly added loader tunable/sysctl variable dev.ste.%d.int_rx_mod. While I'm here add .Xr vlan as ste(4) supports long frames. Modified: stable/8/share/man/man4/ste.4 Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (props changed) Modified: stable/8/share/man/man4/ste.4 ============================================================================== --- stable/8/share/man/man4/ste.4 Thu Jan 14 22:29:29 2010 (r202319) +++ stable/8/share/man/man4/ste.4 Thu Jan 14 22:33:46 2010 (r202320) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd December 24, 2009 .Dt STE 4 .Os .Sh NAME @@ -126,6 +126,23 @@ D-Link DFE-550TX .It D-Link DFE-580TX .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.ste.%d.int_rx_mod +Maximum number of time to delay RX interrupts. +The valid range is 0 to 209712 in units of 1us, the default is +150 (150us). +The value 0 effectively disables the RX interrupt moderation. +The resolution of of timer is about 3.2us so finer tuning than +3.2us wouldn't be available. +The interface does not need to be brought down and up again before +a change takes effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "ste%d: couldn't map ports/memory" @@ -171,6 +188,7 @@ the card should be configured correctly. .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr vlan 4 , .Xr ifconfig 8 .Rs .%T Sundance ST201 data sheet From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:34:26 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83852106568F; Thu, 14 Jan 2010 22:34:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9A48FC1F; Thu, 14 Jan 2010 22:34: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 o0EMYO7E066857; Thu, 14 Jan 2010 22:34:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMYOBr066855; Thu, 14 Jan 2010 22:34:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142234.o0EMYOBr066855@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202321 - stable/7/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:34:26 -0000 Author: yongari Date: Thu Jan 14 22:34:24 2010 New Revision: 202321 URL: http://svn.freebsd.org/changeset/base/202321 Log: MFC r200958: Document newly added loader tunable/sysctl variable dev.ste.%d.int_rx_mod. While I'm here add .Xr vlan as ste(4) supports long frames. Modified: stable/7/share/man/man4/ste.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/ste.4 ============================================================================== --- stable/7/share/man/man4/ste.4 Thu Jan 14 22:33:46 2010 (r202320) +++ stable/7/share/man/man4/ste.4 Thu Jan 14 22:34:24 2010 (r202321) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd December 24, 2009 .Dt STE 4 .Os .Sh NAME @@ -126,6 +126,23 @@ D-Link DFE-550TX .It D-Link DFE-580TX .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.ste.%d.int_rx_mod +Maximum number of time to delay RX interrupts. +The valid range is 0 to 209712 in units of 1us, the default is +150 (150us). +The value 0 effectively disables the RX interrupt moderation. +The resolution of of timer is about 3.2us so finer tuning than +3.2us wouldn't be available. +The interface does not need to be brought down and up again before +a change takes effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "ste%d: couldn't map ports/memory" @@ -171,6 +188,7 @@ the card should be configured correctly. .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr vlan 4 , .Xr ifconfig 8 .Rs .%T Sundance ST201 data sheet From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:36:07 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F8DD106566B; Thu, 14 Jan 2010 22:36:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC0D8FC16; Thu, 14 Jan 2010 22:36: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 o0EMa69b067274; Thu, 14 Jan 2010 22:36:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMa6dx067272; Thu, 14 Jan 2010 22:36:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142236.o0EMa6dx067272@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:36:06 +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: r202322 - stable/8/sys/sparc64/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:36:07 -0000 Author: yongari Date: Thu Jan 14 22:36:06 2010 New Revision: 202322 URL: http://svn.freebsd.org/changeset/base/202322 Log: MFC r201769: Enable ste(4). ste(4) should work on all architectures. Modified: stable/8/sys/sparc64/conf/GENERIC 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) Modified: stable/8/sys/sparc64/conf/GENERIC ============================================================================== --- stable/8/sys/sparc64/conf/GENERIC Thu Jan 14 22:34:24 2010 (r202321) +++ stable/8/sys/sparc64/conf/GENERIC Thu Jan 14 22:36:06 2010 (r202322) @@ -181,7 +181,7 @@ device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') #device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -#device ste # Sundance ST201 (D-Link DFE-550TX) +device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet #device tl # Texas Instruments ThunderLAN #device tx # SMC EtherPower II (83c170 ``EPIC'') From owner-svn-src-stable@FreeBSD.ORG Thu Jan 14 22:37:07 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AE5B106566B; Thu, 14 Jan 2010 22:37:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79F9B8FC1F; Thu, 14 Jan 2010 22:37: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 o0EMb7mj067553; Thu, 14 Jan 2010 22:37:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMb7tp067551; Thu, 14 Jan 2010 22:37:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001142237.o0EMb7tp067551@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 22:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202323 - stable/7/sys/sparc64/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:37:07 -0000 Author: yongari Date: Thu Jan 14 22:37:06 2010 New Revision: 202323 URL: http://svn.freebsd.org/changeset/base/202323 Log: MFC r201769: Enable ste(4). ste(4) should work on all architectures. Modified: stable/7/sys/sparc64/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Thu Jan 14 22:36:06 2010 (r202322) +++ stable/7/sys/sparc64/conf/GENERIC Thu Jan 14 22:37:06 2010 (r202323) @@ -176,7 +176,7 @@ device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') #device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -#device ste # Sundance ST201 (D-Link DFE-550TX) +device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet device ti # Alteon Networks Tigon I/II gigabit Ethernet #device tl # Texas Instruments ThunderLAN From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 02:18:09 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 701951065672; Fri, 15 Jan 2010 02:18:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C27F8FC12; Fri, 15 Jan 2010 02:18: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 o0F2I97F016302; Fri, 15 Jan 2010 02:18:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F2I7Q0016300; Fri, 15 Jan 2010 02:18:07 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150218.o0F2I7Q0016300@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 02:18: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: r202327 - stable/8/games/fortune/datfiles X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 02:18:09 -0000 Author: dougb Date: Fri Jan 15 02:18:07 2010 New Revision: 202327 URL: http://svn.freebsd.org/changeset/base/202327 Log: MFC r201601: Remove more duplicates Minor reformatting on a few Modified: stable/8/games/fortune/datfiles/fortunes Directory Properties: stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) Modified: stable/8/games/fortune/datfiles/fortunes ============================================================================== --- stable/8/games/fortune/datfiles/fortunes Fri Jan 15 01:19:58 2010 (r202326) +++ stable/8/games/fortune/datfiles/fortunes Fri Jan 15 02:18:07 2010 (r202327) @@ -1696,14 +1696,6 @@ the Cat. "Then it doesn't matter which way you go," said the Cat. -- Lewis Carroll % - COMMENT - -Oh, life is a glorious cycle of song, -A medley of extemporanea; -And love is thing that can never go wrong; -And I am Marie of Roumania. - -- Dorothy Parker -% Concerning the war in Vietnam, Senator George Aiken of Vermont noted in January, 1966, "I'm not very keen for doves or hawks. I think we need more owls." @@ -1923,22 +1915,6 @@ Christmas tree. The piano is missing. you rent your home and own Firearms, in which case you can go to level 4. The best way to get to level 3 is egg-nog. % - FIGHTING WORDS - -Say my love is easy had, - Say I'm bitten raw with pride, -Say I am too often sad -- - Still behold me at your side. - -Say I'm neither brave nor young, - Say I woo and coddle care, -Say the devil touched my tongue -- - Still you have my heart to wear. - -But say my verses do not scan, - And I get me another man! - -- Dorothy Parker -% "For I perceive that behind this seemingly unrelated sequence of events, there lurks a singular, sinister attitude of mind." @@ -2210,20 +2186,6 @@ full of money before." "Didn't you see it?" "Damn kid had it under his coat." % - Hug O' War - -I will not play at tug o' war. -I'd rather play at hug o' war, -Where everyone hugs -Instead of tugs, -Where everyone giggles -And rolls on the rug, -Where everyone kisses, -And everyone grins, -And everyone cuddles, -And everyone wins. - -- Shel Silverstein -% Human thinking can skip over a great deal, leap over small misunderstandings, can contain ifs and buts in untroubled corners of the mind. But the machine has no corners. Despite all the attempts to @@ -2677,33 +2639,6 @@ right any day." life-style otherwise." -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % - Insofar as I may be heard by anything, which may or may not care -what I say, I ask, if it matters, that you be forgiven for anything you -may have done or failed to do which requires forgiveness. Conversely, if -not forgiveness but something else may be required to insure any possible -benefit for which you may be eligible after the destruction of your body, -I ask this, whatever it may be, be granted or withheld, as the case may be, -in such a manner as to insure your receiving said benefit. I ask this in my -capacity as your elected intermediary between yourself and that which may -not be yourself, but which may have an interest in the matter of your -receiving as much as it is possible for you to receive of this thing, and -which may in some way be influenced by this ceremony. - Amen. - -- Roger Zelazny, "Creatures of Light and Darkness", 1969 -% - INVENTORY -Four be the things I am wiser to know: -Idleness, sorrow, a friend, and a foe. - -Four be the things I'd been better without: -Love, curiosity, freckles, and doubt. - -Three be the things I shall never attain: -Envy, content, and sufficient champagne. - -Three be the things I shall have till I die: -Laughter and hope and a sock in the eye. -% "Is there any point to which you would wish to draw my attention?" "To the curious incident of the dog in the night-time." "The dog did nothing in the night-time." @@ -3983,28 +3918,6 @@ almost succeeded in getting a VAX to thi organization say that each time the machine fails to think it ceases to exist. % - THE LESSER-KNOWN PROGRAMMING LANGUAGES #5: VALGOL -From its modest beginnings in Southern California's San Fernando Valley, -VALGOL is enjoying a dramatic surge of popularity across the industry. - -Here is a sample program: - LIKE, Y*KNOW(I MEAN)START - IF PIZZA = LIKE BITCHEN AND GUY = LIKE TUBULAR AND - VALLEY GIRL = LIKE GRODY**MAX(FERSURE)**2 THEN - FOR I = LIKE 1 TO OH*MAYBE 100 - DO*WAH - (DITTY**2) - BARF(I)=TOTALLY GROSS(OUT) - SURE - LIKE BAG THIS PROGRAM - REALLY - LIKE TOTALLY (Y*KNOW) - IM*SURE - GOTO THE MALL - -When the user makes a syntax error, the interpreter displays the message: - - GAG ME WITH A SPOON!! -% THE LESSER-KNOWN PROGRAMMING LANGUAGES #8: LAIDBACK This language was developed at the Marin County Center for T'ai Chi, @@ -5335,9 +5248,6 @@ that he didn't force you down on the ask -- A plethora of individuals wither expertise in culinary techniques vitiated the potable concoction produced by steeping certain coupestibles. -- Eleemosynary deeds have their initial incidence intramurally. --- Male cadavers are incapable of yielding testimony. --- Individuals who make their abode in vitreous edifices would be well - advised to refrain from catapulting projectiles. % =============== ALL FRESHMEN PLEASE NOTE =============== @@ -11076,9 +10986,6 @@ Armstrong's Collection Law: If the check is truly in the mail, it is surely made out to someone else. % -Arnold's Addendum: - Anything not fitting into these categories causes cancer in rats. -% Arnold's Laws of Documentation: 1.) If it should exist, it doesn't. 2.) If it does exist, it's out of date. @@ -12654,7 +12561,7 @@ Boren's Laws: (2) When in trouble, delegate. (3) When in doubt, mumble. % -boss, n: +Boss, n: According to the Oxford English Dictionary, in the Middle Ages the words "boss" and "botch" were largely synonymous, except that boss, in addition to meaning "a supervisor of workers" also meant "an @@ -12935,7 +12842,7 @@ wrote the program. Fortunately, the second-to-last bug has just been fixed. -- Ray Simard % -bug, n: +Bug, n: An elusive creature living in a program that makes it incorrect. The activity of "debugging", or removing bugs from a program, ends when people get tired of doing it, not when the bugs are removed. @@ -13524,14 +13431,14 @@ only robust persons doing this thing is others who have tried it. -- Ambrose Bierce, "The Devil's Dictionary" % - -Certain passages in several laws have always defied interpretation and the -most inexplicable must be a matter of opinion. A judge of the Court of -Session of Scotland has sent the editors of this book his candidate which -reads, "In the Nuts (unground), (other than ground nuts) Order, the expression -nuts shall have reference to such nuts, other than ground nuts, as would -but for this amending Order not qualify as nuts (unground) (other than ground -nuts) by reason of their being nuts (unground)." +Certain passages in several laws have always defied interpretation and +the most inexplicable must be a matter of opinion. A judge of the Court +of Session of Scotland has sent the editors of this book his candidate +which reads, "In the Nuts (unground), (other than ground nuts) Order, +the expression nuts shall have reference to such nuts, other than ground +nuts, as would but for this amending Order not qualify as nuts +(unground) (other than ground nuts) by reason of their being nuts +(unground)." -- Guinness Book of World Records, 1973 % Certainly the game is rigged. @@ -15057,17 +14964,6 @@ letter, or even 25 cents on a stamp! so post it as many places as you can. -- Emily Postnews Answers Your Questions on Netiquette % -Dear Sir, - I am firmly opposed to the spread of microchips either to the home or -to the office. We have more than enough of them foisted upon us in public -places. They are a disgusting Americanism, and can only result in the farmers -being forced to grow smaller potatoes, which in turn will cause massive un- -employment in the already severely depressed agricultural industry. - Yours faithfully, - Capt. Quinton D'Arcy, J.P. - Sevenoaks - -- Letters To The Editor, The Times of London -% Death before dishonor. But neither before breakfast. % @@ -17838,9 +17734,6 @@ Finagle's Eleventh Law: it happened according to his pet theory. % Finagle's First Law: - If an experiment works, something has gone wrong. -% -Finagle's First Law: To study a subject best, understand it thoroughly before you start. Finagle's Second Law: @@ -18173,9 +18066,6 @@ For children with short attention spans: For courage mounteth with occasion. -- William Shakespeare, "King John" % -For every action, there is an equal and opposite criticism. - -- Harrison -% For every bloke who makes his mark, there's half a dozen waiting to rub it out. -- Andy Capp @@ -19520,17 +19410,6 @@ Your butt is on the menu And the check is in the mail. -- The Piranha Club Anthem, to the tune of "De Camptown Races" % -From the "Guinness Book of World Records", 1973: - -Certain passages in several laws have always defied interpretation and -the most inexplicable must be a matter of opinion. A judge of the -Court of Session of Scotland has sent the editors of this book his -candidate which reads, "In the Nuts (unground), (other than ground -nuts) Order, the expression nuts shall have reference to such nuts, -other than ground nuts, as would but for this amending Order not -qualify as nuts (unground)(other than ground nuts) by reason of their -being nuts (unground)." -% From the moment I picked your book up until I put it down I was convulsed with laughter. Some day I intend reading it. -- Groucho Marx, from "The Book of Insults" @@ -24035,21 +23914,6 @@ I may not be totally perfect, but parts I met a wonderful new man. He's fictional, but you can't have everything. -- Cecelia, "The Purple Rose of Cairo" % -I met him in a swamp down in Dagobah -Where it bubbles all the time like a giant cabinet soda - S-O-D-A soda -I saw the little runt sitting there on a log -I asked him his name and in a raspy voice he said Yoda - Y-O-D-A Yoda, Yo-Yo-Yo-Yo Yoda - -Well I've been around but I ain't never seen -A guy who looks like a Muppet but he's wrinkled and green - Oh my Yoda, Yo-Yo-Yo-Yo Yoda -Well I'm not dumb but I can't understand -How he can raise me in the air just by raising his hand - Oh my Yoda, Yo-Yo-Yo-Yo Yoda, Yo-Yo-Yo-Yo Yoda - -- The STAR WARS Song, to "Lola", by the Kinks -% I met my latest girl friend in a department store. She was looking at clothes, and I was putting Slinkys on the escalators. -- Steven Wright @@ -24524,10 +24388,6 @@ are worth considering, to wit: "When paying tolls, remember that it is necessary to release the quarter a full 3 seconds before passing the basket if you are traveling more than 60 MPH." - -[110.13]: - "When traveling on a one-way street, stay to the right, so as not - to interfere with oncoming traffic." % I suppose some of the variation between Boston drivers and the rest of the country is due to the progressive Massachusetts Driver Education Manual which @@ -24621,12 +24481,6 @@ I think that I shall never see A billboard lovely as a tree. Indeed, unless the billboards fall I'll never see a tree at all. - -- Nash -% -I think that I shall never see -A billboard lovely as a tree. -Perhaps, unless the billboards fall -I'll never see a tree at all. -- Ogden Nash % I think that I shall never see @@ -25892,21 +25746,6 @@ this is the case, then programmers stand software engineers dig each other's graves. -- Unknown % -If I have seen farther than others, it is because I was standing on the -shoulders of giants. - -- Isaac Newton - -In the sciences, we are now uniquely privileged to sit side by side -with the giants on whose shoulders we stand. - -- Gerald Holton - -If I have not seen as far as others, it is because giants were standing -on my shoulders. - -- Hal Abelson - -In computer science, we stand on each other's feet. - -- Brian K. Reid -% If I have to lay an egg for my country, I'll do it. -- Bob Hope % @@ -37634,7 +37473,7 @@ Pardo's First Postulate: fattening. Arnold's Addendum: - Everything else causes cancer in rats. + Anything not fitting into these categories causes cancer in rats. % Parents often talk about the younger generation as if they didn't have much of anything to do with it. @@ -39431,10 +39270,6 @@ A: A dope ring. Q: Why do blondes put their hair in ponytails? A: To cover up the valve stem. - -Q: Why did the blonde get so excited after she finished her jigsaw - puzzle in only 6 months? -A: Because on the box it said "From 2-4 years". % Q: What do you call a blind pre-historic animal? A: Diyathinkhesaurus. @@ -41467,25 +41302,6 @@ Spock: Affirmative. Kirk: Mr. Sulu, go to pass two. Sulu: Aye aye, sir, going to pass two. % -Scratch the disks, dump the core, Shut it down, pull the plug -Roll the tapes across the floor, Give the core an extra tug -And the system is going to crash. And the system is going to crash. -Teletypes smashed to bits. Mem'ry cards, one and all, -Give the scopes some nasty hits Toss out halfway down the hall -And the system is going to crash. And the system is going to crash. -And we've also found Just flip one switch -When you turn the power down, And the lights will cease to twitch -You turn the disk readers into trash. And the tape drives will crumble -Oh, it's so much fun, in a flash. -Now the CPU won't run When the CPU -And the system is going to crash. Can print nothing out but "foo," - The system is going to crash. - -- To The Caissons Go Rolling Along -% -Scratch the disks! -Drop the core! -Roll the tapes across the floor! -% Screw up your courage! You've screwed up everything else. % Scribline, n.: @@ -46662,7 +46478,8 @@ often turn to a related (but infinitely % THE LESSER-KNOWN PROGRAMMING LANGUAGES #14 -- VALGOL - VALGOL is enjoying a dramatic surge of popularity across the + From its modest beginnings in Southern California's San Fernando +Valley VALGOL is enjoying a dramatic surge of popularity across the industry. VALGOL commands include REALLY, LIKE, WELL, and Y*KNOW. Variables are assigned with the =LIKE and =TOTALLY operators. Other operators include the "California booleans", AX and NOWAY. Loops are @@ -48369,9 +48186,6 @@ and peculiar sort of voluntary thinking. The solution of this problem is trivial and is left as an exercise for the reader. % -The solution to a problem changes the nature of the problem. - -- Peer -% The somewhat old and crusty vicar was taking a well-earned retirement from his rather old and crusty parish. As is usual in these cases, a locum was sent to cover the transition period. This particular man was young and @@ -52040,7 +51854,7 @@ yourself and that which may have an inte as much as it is possible for you to receive of this thing, and which may in some way be influenced by this ceremony. Amen. - -- Roger Zelazny, "Creatures of Light and Darkness" + -- Roger Zelazny, "Creatures of Light and Darkness", 1969 % To understand a program you must become both the machine and the program. % @@ -56789,22 +56603,6 @@ I'd LOVE to, but... -- I'm teaching my ferret to yodel. -- My crayons all melted together. % -Why I Can't Go Out With You: - -I'd LOVE to, but ... - -- I have to floss my cat. - -- I've dedicated my life to linguini. - -- I need to spend more time with my blender. - -- it wouldn't be fair to the other Beautiful People. - -- it's my night to pet the dog/ferret/goldfish. - -- I'm going downtown to try on some gloves. - -- I have to check the freshness dates on my dairy products. - -- I'm going down to the bakery to watch the buns rise. - -- I have an appointment with a cuticle specialist. - -- I have some really hard words to look up. - -- I've got a Friends of the Lowly Rutabaga meeting. - -- I promised to help a friend fold road maps. -% Why is it called a funny bone when it hurts so much? % Why is it taking so long for her to bring out all the good in you? @@ -57859,9 +57657,6 @@ a private eye. Yeah, there are more important things in life than money, but they won't go out with you if you don't have any. % -YEAR: - A period of three hundred and sixty-five disappointments. -% Year Name James Bond Book ---- -------------------------------- -------------- ---- 50's James Bond TV Series Barry Nelson From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 02:21:55 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2F081065670; Fri, 15 Jan 2010 02:21:55 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF04B8FC17; Fri, 15 Jan 2010 02:21: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 o0F2LtkE017214; Fri, 15 Jan 2010 02:21:55 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F2Lsto017211; Fri, 15 Jan 2010 02:21:54 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150221.o0F2Lsto017211@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 02:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202328 - stable/7/games/fortune/datfiles X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 02:21:55 -0000 Author: dougb Date: Fri Jan 15 02:21:54 2010 New Revision: 202328 URL: http://svn.freebsd.org/changeset/base/202328 Log: MFC r201601: Remove more duplicates Minor reformatting on a few Modified: stable/7/games/fortune/datfiles/fortunes Directory Properties: stable/7/games/fortune/ (props changed) stable/7/games/fortune/datfiles/ (props changed) stable/7/games/fortune/datfiles/freebsd-tips (props changed) stable/7/games/fortune/fortune/ (props changed) Modified: stable/7/games/fortune/datfiles/fortunes ============================================================================== --- stable/7/games/fortune/datfiles/fortunes Fri Jan 15 02:18:07 2010 (r202327) +++ stable/7/games/fortune/datfiles/fortunes Fri Jan 15 02:21:54 2010 (r202328) @@ -1696,14 +1696,6 @@ the Cat. "Then it doesn't matter which way you go," said the Cat. -- Lewis Carroll % - COMMENT - -Oh, life is a glorious cycle of song, -A medley of extemporanea; -And love is thing that can never go wrong; -And I am Marie of Roumania. - -- Dorothy Parker -% Concerning the war in Vietnam, Senator George Aiken of Vermont noted in January, 1966, "I'm not very keen for doves or hawks. I think we need more owls." @@ -1923,22 +1915,6 @@ Christmas tree. The piano is missing. you rent your home and own Firearms, in which case you can go to level 4. The best way to get to level 3 is egg-nog. % - FIGHTING WORDS - -Say my love is easy had, - Say I'm bitten raw with pride, -Say I am too often sad -- - Still behold me at your side. - -Say I'm neither brave nor young, - Say I woo and coddle care, -Say the devil touched my tongue -- - Still you have my heart to wear. - -But say my verses do not scan, - And I get me another man! - -- Dorothy Parker -% "For I perceive that behind this seemingly unrelated sequence of events, there lurks a singular, sinister attitude of mind." @@ -2210,20 +2186,6 @@ full of money before." "Didn't you see it?" "Damn kid had it under his coat." % - Hug O' War - -I will not play at tug o' war. -I'd rather play at hug o' war, -Where everyone hugs -Instead of tugs, -Where everyone giggles -And rolls on the rug, -Where everyone kisses, -And everyone grins, -And everyone cuddles, -And everyone wins. - -- Shel Silverstein -% Human thinking can skip over a great deal, leap over small misunderstandings, can contain ifs and buts in untroubled corners of the mind. But the machine has no corners. Despite all the attempts to @@ -2677,33 +2639,6 @@ right any day." life-style otherwise." -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % - Insofar as I may be heard by anything, which may or may not care -what I say, I ask, if it matters, that you be forgiven for anything you -may have done or failed to do which requires forgiveness. Conversely, if -not forgiveness but something else may be required to insure any possible -benefit for which you may be eligible after the destruction of your body, -I ask this, whatever it may be, be granted or withheld, as the case may be, -in such a manner as to insure your receiving said benefit. I ask this in my -capacity as your elected intermediary between yourself and that which may -not be yourself, but which may have an interest in the matter of your -receiving as much as it is possible for you to receive of this thing, and -which may in some way be influenced by this ceremony. - Amen. - -- Roger Zelazny, "Creatures of Light and Darkness", 1969 -% - INVENTORY -Four be the things I am wiser to know: -Idleness, sorrow, a friend, and a foe. - -Four be the things I'd been better without: -Love, curiosity, freckles, and doubt. - -Three be the things I shall never attain: -Envy, content, and sufficient champagne. - -Three be the things I shall have till I die: -Laughter and hope and a sock in the eye. -% "Is there any point to which you would wish to draw my attention?" "To the curious incident of the dog in the night-time." "The dog did nothing in the night-time." @@ -3983,28 +3918,6 @@ almost succeeded in getting a VAX to thi organization say that each time the machine fails to think it ceases to exist. % - THE LESSER-KNOWN PROGRAMMING LANGUAGES #5: VALGOL -From its modest beginnings in Southern California's San Fernando Valley, -VALGOL is enjoying a dramatic surge of popularity across the industry. - -Here is a sample program: - LIKE, Y*KNOW(I MEAN)START - IF PIZZA = LIKE BITCHEN AND GUY = LIKE TUBULAR AND - VALLEY GIRL = LIKE GRODY**MAX(FERSURE)**2 THEN - FOR I = LIKE 1 TO OH*MAYBE 100 - DO*WAH - (DITTY**2) - BARF(I)=TOTALLY GROSS(OUT) - SURE - LIKE BAG THIS PROGRAM - REALLY - LIKE TOTALLY (Y*KNOW) - IM*SURE - GOTO THE MALL - -When the user makes a syntax error, the interpreter displays the message: - - GAG ME WITH A SPOON!! -% THE LESSER-KNOWN PROGRAMMING LANGUAGES #8: LAIDBACK This language was developed at the Marin County Center for T'ai Chi, @@ -5335,9 +5248,6 @@ that he didn't force you down on the ask -- A plethora of individuals wither expertise in culinary techniques vitiated the potable concoction produced by steeping certain coupestibles. -- Eleemosynary deeds have their initial incidence intramurally. --- Male cadavers are incapable of yielding testimony. --- Individuals who make their abode in vitreous edifices would be well - advised to refrain from catapulting projectiles. % =============== ALL FRESHMEN PLEASE NOTE =============== @@ -11076,9 +10986,6 @@ Armstrong's Collection Law: If the check is truly in the mail, it is surely made out to someone else. % -Arnold's Addendum: - Anything not fitting into these categories causes cancer in rats. -% Arnold's Laws of Documentation: 1.) If it should exist, it doesn't. 2.) If it does exist, it's out of date. @@ -12654,7 +12561,7 @@ Boren's Laws: (2) When in trouble, delegate. (3) When in doubt, mumble. % -boss, n: +Boss, n: According to the Oxford English Dictionary, in the Middle Ages the words "boss" and "botch" were largely synonymous, except that boss, in addition to meaning "a supervisor of workers" also meant "an @@ -12935,7 +12842,7 @@ wrote the program. Fortunately, the second-to-last bug has just been fixed. -- Ray Simard % -bug, n: +Bug, n: An elusive creature living in a program that makes it incorrect. The activity of "debugging", or removing bugs from a program, ends when people get tired of doing it, not when the bugs are removed. @@ -13524,14 +13431,14 @@ only robust persons doing this thing is others who have tried it. -- Ambrose Bierce, "The Devil's Dictionary" % - -Certain passages in several laws have always defied interpretation and the -most inexplicable must be a matter of opinion. A judge of the Court of -Session of Scotland has sent the editors of this book his candidate which -reads, "In the Nuts (unground), (other than ground nuts) Order, the expression -nuts shall have reference to such nuts, other than ground nuts, as would -but for this amending Order not qualify as nuts (unground) (other than ground -nuts) by reason of their being nuts (unground)." +Certain passages in several laws have always defied interpretation and +the most inexplicable must be a matter of opinion. A judge of the Court +of Session of Scotland has sent the editors of this book his candidate +which reads, "In the Nuts (unground), (other than ground nuts) Order, +the expression nuts shall have reference to such nuts, other than ground +nuts, as would but for this amending Order not qualify as nuts +(unground) (other than ground nuts) by reason of their being nuts +(unground)." -- Guinness Book of World Records, 1973 % Certainly the game is rigged. @@ -15057,17 +14964,6 @@ letter, or even 25 cents on a stamp! so post it as many places as you can. -- Emily Postnews Answers Your Questions on Netiquette % -Dear Sir, - I am firmly opposed to the spread of microchips either to the home or -to the office. We have more than enough of them foisted upon us in public -places. They are a disgusting Americanism, and can only result in the farmers -being forced to grow smaller potatoes, which in turn will cause massive un- -employment in the already severely depressed agricultural industry. - Yours faithfully, - Capt. Quinton D'Arcy, J.P. - Sevenoaks - -- Letters To The Editor, The Times of London -% Death before dishonor. But neither before breakfast. % @@ -17838,9 +17734,6 @@ Finagle's Eleventh Law: it happened according to his pet theory. % Finagle's First Law: - If an experiment works, something has gone wrong. -% -Finagle's First Law: To study a subject best, understand it thoroughly before you start. Finagle's Second Law: @@ -18173,9 +18066,6 @@ For children with short attention spans: For courage mounteth with occasion. -- William Shakespeare, "King John" % -For every action, there is an equal and opposite criticism. - -- Harrison -% For every bloke who makes his mark, there's half a dozen waiting to rub it out. -- Andy Capp @@ -19520,17 +19410,6 @@ Your butt is on the menu And the check is in the mail. -- The Piranha Club Anthem, to the tune of "De Camptown Races" % -From the "Guinness Book of World Records", 1973: - -Certain passages in several laws have always defied interpretation and -the most inexplicable must be a matter of opinion. A judge of the -Court of Session of Scotland has sent the editors of this book his -candidate which reads, "In the Nuts (unground), (other than ground -nuts) Order, the expression nuts shall have reference to such nuts, -other than ground nuts, as would but for this amending Order not -qualify as nuts (unground)(other than ground nuts) by reason of their -being nuts (unground)." -% From the moment I picked your book up until I put it down I was convulsed with laughter. Some day I intend reading it. -- Groucho Marx, from "The Book of Insults" @@ -24035,21 +23914,6 @@ I may not be totally perfect, but parts I met a wonderful new man. He's fictional, but you can't have everything. -- Cecelia, "The Purple Rose of Cairo" % -I met him in a swamp down in Dagobah -Where it bubbles all the time like a giant cabinet soda - S-O-D-A soda -I saw the little runt sitting there on a log -I asked him his name and in a raspy voice he said Yoda - Y-O-D-A Yoda, Yo-Yo-Yo-Yo Yoda - -Well I've been around but I ain't never seen -A guy who looks like a Muppet but he's wrinkled and green - Oh my Yoda, Yo-Yo-Yo-Yo Yoda -Well I'm not dumb but I can't understand -How he can raise me in the air just by raising his hand - Oh my Yoda, Yo-Yo-Yo-Yo Yoda, Yo-Yo-Yo-Yo Yoda - -- The STAR WARS Song, to "Lola", by the Kinks -% I met my latest girl friend in a department store. She was looking at clothes, and I was putting Slinkys on the escalators. -- Steven Wright @@ -24524,10 +24388,6 @@ are worth considering, to wit: "When paying tolls, remember that it is necessary to release the quarter a full 3 seconds before passing the basket if you are traveling more than 60 MPH." - -[110.13]: - "When traveling on a one-way street, stay to the right, so as not - to interfere with oncoming traffic." % I suppose some of the variation between Boston drivers and the rest of the country is due to the progressive Massachusetts Driver Education Manual which @@ -24621,12 +24481,6 @@ I think that I shall never see A billboard lovely as a tree. Indeed, unless the billboards fall I'll never see a tree at all. - -- Nash -% -I think that I shall never see -A billboard lovely as a tree. -Perhaps, unless the billboards fall -I'll never see a tree at all. -- Ogden Nash % I think that I shall never see @@ -25892,21 +25746,6 @@ this is the case, then programmers stand software engineers dig each other's graves. -- Unknown % -If I have seen farther than others, it is because I was standing on the -shoulders of giants. - -- Isaac Newton - -In the sciences, we are now uniquely privileged to sit side by side -with the giants on whose shoulders we stand. - -- Gerald Holton - -If I have not seen as far as others, it is because giants were standing -on my shoulders. - -- Hal Abelson - -In computer science, we stand on each other's feet. - -- Brian K. Reid -% If I have to lay an egg for my country, I'll do it. -- Bob Hope % @@ -37634,7 +37473,7 @@ Pardo's First Postulate: fattening. Arnold's Addendum: - Everything else causes cancer in rats. + Anything not fitting into these categories causes cancer in rats. % Parents often talk about the younger generation as if they didn't have much of anything to do with it. @@ -39431,10 +39270,6 @@ A: A dope ring. Q: Why do blondes put their hair in ponytails? A: To cover up the valve stem. - -Q: Why did the blonde get so excited after she finished her jigsaw - puzzle in only 6 months? -A: Because on the box it said "From 2-4 years". % Q: What do you call a blind pre-historic animal? A: Diyathinkhesaurus. @@ -41467,25 +41302,6 @@ Spock: Affirmative. Kirk: Mr. Sulu, go to pass two. Sulu: Aye aye, sir, going to pass two. % -Scratch the disks, dump the core, Shut it down, pull the plug -Roll the tapes across the floor, Give the core an extra tug -And the system is going to crash. And the system is going to crash. -Teletypes smashed to bits. Mem'ry cards, one and all, -Give the scopes some nasty hits Toss out halfway down the hall -And the system is going to crash. And the system is going to crash. -And we've also found Just flip one switch -When you turn the power down, And the lights will cease to twitch -You turn the disk readers into trash. And the tape drives will crumble -Oh, it's so much fun, in a flash. -Now the CPU won't run When the CPU -And the system is going to crash. Can print nothing out but "foo," - The system is going to crash. - -- To The Caissons Go Rolling Along -% -Scratch the disks! -Drop the core! -Roll the tapes across the floor! -% Screw up your courage! You've screwed up everything else. % Scribline, n.: @@ -46662,7 +46478,8 @@ often turn to a related (but infinitely % THE LESSER-KNOWN PROGRAMMING LANGUAGES #14 -- VALGOL - VALGOL is enjoying a dramatic surge of popularity across the + From its modest beginnings in Southern California's San Fernando +Valley VALGOL is enjoying a dramatic surge of popularity across the industry. VALGOL commands include REALLY, LIKE, WELL, and Y*KNOW. Variables are assigned with the =LIKE and =TOTALLY operators. Other operators include the "California booleans", AX and NOWAY. Loops are @@ -48369,9 +48186,6 @@ and peculiar sort of voluntary thinking. The solution of this problem is trivial and is left as an exercise for the reader. % -The solution to a problem changes the nature of the problem. - -- Peer -% The somewhat old and crusty vicar was taking a well-earned retirement from his rather old and crusty parish. As is usual in these cases, a locum was sent to cover the transition period. This particular man was young and @@ -52040,7 +51854,7 @@ yourself and that which may have an inte as much as it is possible for you to receive of this thing, and which may in some way be influenced by this ceremony. Amen. - -- Roger Zelazny, "Creatures of Light and Darkness" + -- Roger Zelazny, "Creatures of Light and Darkness", 1969 % To understand a program you must become both the machine and the program. % @@ -56789,22 +56603,6 @@ I'd LOVE to, but... -- I'm teaching my ferret to yodel. -- My crayons all melted together. % -Why I Can't Go Out With You: - -I'd LOVE to, but ... - -- I have to floss my cat. - -- I've dedicated my life to linguini. - -- I need to spend more time with my blender. - -- it wouldn't be fair to the other Beautiful People. - -- it's my night to pet the dog/ferret/goldfish. - -- I'm going downtown to try on some gloves. - -- I have to check the freshness dates on my dairy products. - -- I'm going down to the bakery to watch the buns rise. - -- I have an appointment with a cuticle specialist. - -- I have some really hard words to look up. - -- I've got a Friends of the Lowly Rutabaga meeting. - -- I promised to help a friend fold road maps. -% Why is it called a funny bone when it hurts so much? % Why is it taking so long for her to bring out all the good in you? @@ -57859,9 +57657,6 @@ a private eye. Yeah, there are more important things in life than money, but they won't go out with you if you don't have any. % -YEAR: - A period of three hundred and sixty-five disappointments. -% Year Name James Bond Book ---- -------------------------------- -------------- ---- 50's James Bond TV Series Barry Nelson From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 02:55:19 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFC9F10656C1; Fri, 15 Jan 2010 02:55:19 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39CE8FC0C; Fri, 15 Jan 2010 02:55: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 o0F2tJ6U024735; Fri, 15 Jan 2010 02:55:19 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F2tJw7024734; Fri, 15 Jan 2010 02:55:19 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150255.o0F2tJw7024734@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 02:55: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: r202329 - stable/8/games/fortune/datfiles X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 02:55:19 -0000 Author: dougb Date: Fri Jan 15 02:55:19 2010 New Revision: 202329 URL: http://svn.freebsd.org/changeset/base/202329 Log: MFC r201626: - Move potentially offensive quotes I committed recently to fortunes-o. - Reference date. - Be more clear on context. MFC r201764: For the now-infamous Rumsfeld quote: Change "there're" to "there are" which is consistent with the vast majority of on line references. Remove a spurious trailing " Update the citation text with a suggestion from des. Modified: stable/8/games/fortune/datfiles/fortunes-o.real Directory Properties: stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) Modified: stable/8/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/8/games/fortune/datfiles/fortunes-o.real Fri Jan 15 02:21:54 2010 (r202328) +++ stable/8/games/fortune/datfiles/fortunes-o.real Fri Jan 15 02:55:19 2010 (r202329) @@ -663,6 +663,13 @@ posh hotel. "Why, yes, young man," said the gentleman. "Would you bring me a postcard?" % + As we know, there are known knowns. There are things we know we +know. We also know there are known unknowns. That is to say, we know +there are some things we do not know. But there are also unknown +unknowns; the ones we don't know we don't know. + -- United States Secretary of Defense Donald Rumsfeld + 12 February 2002, Regarding the US invasion of Iraq +% "Are pirates an ethnic group? Or are they just people who burn illegal cds?" "Arrrr! We prefer to be called Buccaneer-Americans." @@ -12873,6 +12880,14 @@ Contraception", has been withdrawn after pull it out at the last minute. -- Not the Nine O'Clock News % +The investment community feels very putupon. They feel there is no +reason why they shouldn't earn $1 million to $200 million a year, +and they don't want to be held responsible for the global financial +meltdown. + -- Daniel Fass, Chairman of United States President + Barack Obama's financial-industry fundraising party + 20 October 2009 +% The king arranged a regal marriage for his daughter -- a bond that would unite two great kingdoms. Yet, because the young couple seemed so formal to each other, he posted a spy outside the royal wedding chamber and demanded a full From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 02:58:23 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20B8B1065695; Fri, 15 Jan 2010 02:58:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8E2B8FC1A; Fri, 15 Jan 2010 02:58: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 o0F2wME3025441; Fri, 15 Jan 2010 02:58:22 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F2wMBO025439; Fri, 15 Jan 2010 02:58:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150258.o0F2wMBO025439@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 02:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202330 - stable/7/games/fortune/datfiles X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 02:58:23 -0000 Author: dougb Date: Fri Jan 15 02:58:22 2010 New Revision: 202330 URL: http://svn.freebsd.org/changeset/base/202330 Log: MFC r201626: - Move potentially offensive quotes I committed recently to fortunes-o. - Reference date. - Be more clear on context. MFC r201764: For the now-infamous Rumsfeld quote: Change "there're" to "there are" which is consistent with the vast majority of on line references. Remove a spurious trailing " Update the citation text with a suggestion from des. Modified: stable/7/games/fortune/datfiles/fortunes-o.real Directory Properties: stable/7/games/fortune/ (props changed) stable/7/games/fortune/datfiles/ (props changed) stable/7/games/fortune/datfiles/freebsd-tips (props changed) stable/7/games/fortune/fortune/ (props changed) Modified: stable/7/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/7/games/fortune/datfiles/fortunes-o.real Fri Jan 15 02:55:19 2010 (r202329) +++ stable/7/games/fortune/datfiles/fortunes-o.real Fri Jan 15 02:58:22 2010 (r202330) @@ -663,6 +663,13 @@ posh hotel. "Why, yes, young man," said the gentleman. "Would you bring me a postcard?" % + As we know, there are known knowns. There are things we know we +know. We also know there are known unknowns. That is to say, we know +there are some things we do not know. But there are also unknown +unknowns; the ones we don't know we don't know. + -- United States Secretary of Defense Donald Rumsfeld + 12 February 2002, Regarding the US invasion of Iraq +% "Are pirates an ethnic group? Or are they just people who burn illegal cds?" "Arrrr! We prefer to be called Buccaneer-Americans." @@ -12873,6 +12880,14 @@ Contraception", has been withdrawn after pull it out at the last minute. -- Not the Nine O'Clock News % +The investment community feels very putupon. They feel there is no +reason why they shouldn't earn $1 million to $200 million a year, +and they don't want to be held responsible for the global financial +meltdown. + -- Daniel Fass, Chairman of United States President + Barack Obama's financial-industry fundraising party + 20 October 2009 +% The king arranged a regal marriage for his daughter -- a bond that would unite two great kingdoms. Yet, because the young couple seemed so formal to each other, he posted a spy outside the royal wedding chamber and demanded a full From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 03:03:02 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CED01065694; Fri, 15 Jan 2010 03:03:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4999D8FC1A; Fri, 15 Jan 2010 03:03:02 +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 o0F332vv026647; Fri, 15 Jan 2010 03:03:02 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F332Ov026645; Fri, 15 Jan 2010 03:03:02 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150303.o0F332Ov026645@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:03:02 +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: r202331 - stable/8/etc/rc.d X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:03:02 -0000 Author: dougb Date: Fri Jan 15 03:03:02 2010 New Revision: 202331 URL: http://svn.freebsd.org/changeset/base/202331 Log: MFC r201367, r201370: Virtualize the location of "the configuration directory" instead of hard-coding it to be /etc/namedb Modified: stable/8/etc/rc.d/named Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/named ============================================================================== --- stable/8/etc/rc.d/named Fri Jan 15 02:58:22 2010 (r202330) +++ stable/8/etc/rc.d/named Fri Jan 15 03:03:02 2010 (r202331) @@ -43,19 +43,19 @@ chroot_autoupdate() warn "chroot directory structure not updated" fi - # Create /etc/namedb symlink + # Create (or update) the configuration directory symlink # - if [ ! -L /etc/namedb ]; then - if [ -d /etc/namedb ]; then - warn "named chroot: /etc/namedb is a directory!" - elif [ -e /etc/namedb ]; then - warn "named chroot: /etc/namedb exists!" + if [ ! -L "${named_conf%/*}" ]; then + if [ -d "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} is a directory!" + elif [ -e "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} exists!" else - ln -s ${named_chrootdir}/etc/namedb /etc/namedb + ln -s ${named_confdir} ${named_conf%/*} fi else # Make sure it points to the right place. - ln -shf ${named_chrootdir}/etc/namedb /etc/namedb + ln -shf ${named_confdir} ${named_conf%/*} fi # Mount a devfs in the chroot directory if needed @@ -179,12 +179,12 @@ named_prestart() # Create an rndc.key file for the user if none exists # confgen_command="${command%/named}/rndc-confgen -a -b256 -u $named_uid \ - -c ${named_chrootdir}/etc/namedb/rndc.key" - if [ -s "${named_chrootdir}/etc/namedb/rndc.conf" ]; then + -c ${named_confdir}/rndc.key" + if [ -s "${named_confdir}/rndc.conf" ]; then unset confgen_command fi - if [ -s "${named_chrootdir}/etc/namedb/rndc.key" ]; then - case `stat -f%Su ${named_chrootdir}/etc/namedb/rndc.key` in + if [ -s "${named_confdir}/rndc.key" ]; then + case `stat -f%Su ${named_confdir}/rndc.key` in root|$named_uid) ;; *) $confgen_command ;; esac @@ -198,8 +198,8 @@ named_prestart() warn "named_auto_forward enabled, but no /etc/resolv.conf" # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf ${command%/named}/named-checkconf $named_conf || err 3 'named-checkconf for $named_conf failed' @@ -248,19 +248,19 @@ named_prestart() mv /var/run/naf-resolv.conf /etc/resolv.conf fi - if cmp -s ${named_chrootdir}/etc/namedb/auto_forward.conf \ + if cmp -s ${named_confdir}/auto_forward.conf \ /var/run/auto_forward.conf; then unlink /var/run/auto_forward.conf else - [ -e "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - unlink ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -e "${named_confdir}/auto_forward.conf" ] && + unlink ${named_confdir}/auto_forward.conf mv /var/run/auto_forward.conf \ - ${named_chrootdir}/etc/namedb/auto_forward.conf + ${named_confdir}/auto_forward.conf fi else # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf fi ${command%/named}/named-checkconf $named_conf || @@ -274,5 +274,6 @@ load_rc_config $name required_dirs="$named_chrootdir" # if it is set, it must exist required_files="${named_conf:=/etc/namedb/named.conf}" pidfile="${named_pidfile:-/var/run/named/pid}" +named_confdir="${named_chrootdir}${named_conf%/*}" run_rc_command "$1" From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 03:04:44 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2644E106566B; Fri, 15 Jan 2010 03:04:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13DCD8FC14; Fri, 15 Jan 2010 03:04: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 o0F34hqb027084; Fri, 15 Jan 2010 03:04:43 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F34hbj027082; Fri, 15 Jan 2010 03:04:43 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150304.o0F34hbj027082@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:04: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: r202332 - stable/8/etc/defaults X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:04:44 -0000 Author: dougb Date: Fri Jan 15 03:04:43 2010 New Revision: 202332 URL: http://svn.freebsd.org/changeset/base/202332 Log: MFC r201368: Update named_flags comment regarding not using it for -u and -c Modified: stable/8/etc/defaults/rc.conf Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/defaults/rc.conf ============================================================================== --- stable/8/etc/defaults/rc.conf Fri Jan 15 03:03:02 2010 (r202331) +++ stable/8/etc/defaults/rc.conf Fri Jan 15 03:04:43 2010 (r202332) @@ -252,7 +252,7 @@ inetd_flags="-wW -C 60" # Optional flag named_enable="NO" # Run named, the DNS server (or NO). named_program="/usr/sbin/named" # Path to named, if you want a different one. named_conf="/etc/namedb/named.conf" # Path to the configuration file -#named_flags="-c /etc/namedb/named.conf" # Uncomment for named not in /usr/sbin +#named_flags="" # Use this for flags OTHER than -u and -c named_pidfile="/var/run/named/pid" # Must set this in named.conf as well named_uid="bind" # User to run named as named_chrootdir="/var/named" # Chroot directory (or "" not to auto-chroot it) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 03:05:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BF4810656BF; Fri, 15 Jan 2010 03:05:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 597078FC25; Fri, 15 Jan 2010 03:05: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 o0F35kbE027374; Fri, 15 Jan 2010 03:05:46 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F35kdE027372; Fri, 15 Jan 2010 03:05:46 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150305.o0F35kdE027372@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202333 - stable/7/etc/rc.d X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:05:46 -0000 Author: dougb Date: Fri Jan 15 03:05:46 2010 New Revision: 202333 URL: http://svn.freebsd.org/changeset/base/202333 Log: MFC r201367, r201370: Virtualize the location of "the configuration directory" instead of hard-coding it to be /etc/namedb Modified: stable/7/etc/rc.d/named Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/rc.d/named ============================================================================== --- stable/7/etc/rc.d/named Fri Jan 15 03:04:43 2010 (r202332) +++ stable/7/etc/rc.d/named Fri Jan 15 03:05:46 2010 (r202333) @@ -43,19 +43,19 @@ chroot_autoupdate() warn "chroot directory structure not updated" fi - # Create /etc/namedb symlink + # Create (or update) the configuration directory symlink # - if [ ! -L /etc/namedb ]; then - if [ -d /etc/namedb ]; then - warn "named chroot: /etc/namedb is a directory!" - elif [ -e /etc/namedb ]; then - warn "named chroot: /etc/namedb exists!" + if [ ! -L "${named_conf%/*}" ]; then + if [ -d "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} is a directory!" + elif [ -e "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} exists!" else - ln -s ${named_chrootdir}/etc/namedb /etc/namedb + ln -s ${named_confdir} ${named_conf%/*} fi else # Make sure it points to the right place. - ln -shf ${named_chrootdir}/etc/namedb /etc/namedb + ln -shf ${named_confdir} ${named_conf%/*} fi # Mount a devfs in the chroot directory if needed @@ -179,12 +179,12 @@ named_prestart() # Create an rndc.key file for the user if none exists # confgen_command="${command%/named}/rndc-confgen -a -b256 -u $named_uid \ - -c ${named_chrootdir}/etc/namedb/rndc.key" - if [ -s "${named_chrootdir}/etc/namedb/rndc.conf" ]; then + -c ${named_confdir}/rndc.key" + if [ -s "${named_confdir}/rndc.conf" ]; then unset confgen_command fi - if [ -s "${named_chrootdir}/etc/namedb/rndc.key" ]; then - case `stat -f%Su ${named_chrootdir}/etc/namedb/rndc.key` in + if [ -s "${named_confdir}/rndc.key" ]; then + case `stat -f%Su ${named_confdir}/rndc.key` in root|$named_uid) ;; *) $confgen_command ;; esac @@ -198,8 +198,8 @@ named_prestart() warn "named_auto_forward enabled, but no /etc/resolv.conf" # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf ${command%/named}/named-checkconf $named_conf || err 3 'named-checkconf for $named_conf failed' @@ -248,19 +248,19 @@ named_prestart() mv /var/run/naf-resolv.conf /etc/resolv.conf fi - if cmp -s ${named_chrootdir}/etc/namedb/auto_forward.conf \ + if cmp -s ${named_confdir}/auto_forward.conf \ /var/run/auto_forward.conf; then unlink /var/run/auto_forward.conf else - [ -e "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - unlink ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -e "${named_confdir}/auto_forward.conf" ] && + unlink ${named_confdir}/auto_forward.conf mv /var/run/auto_forward.conf \ - ${named_chrootdir}/etc/namedb/auto_forward.conf + ${named_confdir}/auto_forward.conf fi else # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf fi ${command%/named}/named-checkconf $named_conf || @@ -274,5 +274,6 @@ load_rc_config $name required_dirs="$named_chrootdir" # if it is set, it must exist required_files="${named_conf:=/etc/namedb/named.conf}" pidfile="${named_pidfile:-/var/run/named/pid}" +named_confdir="${named_chrootdir}${named_conf%/*}" run_rc_command "$1" From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 03:06:39 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D9AD106568B; Fri, 15 Jan 2010 03:06:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B5538FC19; Fri, 15 Jan 2010 03:06: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 o0F36duN027617; Fri, 15 Jan 2010 03:06:39 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F36d0t027615; Fri, 15 Jan 2010 03:06:39 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150306.o0F36d0t027615@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202334 - stable/7/etc/defaults X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:06:39 -0000 Author: dougb Date: Fri Jan 15 03:06:39 2010 New Revision: 202334 URL: http://svn.freebsd.org/changeset/base/202334 Log: MFC r201368: Update named_flags comment regarding not using it for -u and -c Modified: stable/7/etc/defaults/rc.conf Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Fri Jan 15 03:05:46 2010 (r202333) +++ stable/7/etc/defaults/rc.conf Fri Jan 15 03:06:39 2010 (r202334) @@ -244,7 +244,7 @@ inetd_flags="-wW -C 60" # Optional flag named_enable="NO" # Run named, the DNS server (or NO). named_program="/usr/sbin/named" # Path to named, if you want a different one. named_conf="/etc/namedb/named.conf" # Path to the configuration file -#named_flags="-c /etc/namedb/named.conf" # Uncomment for named not in /usr/sbin +#named_flags="" # Use this for flags OTHER than -u and -c named_pidfile="/var/run/named/pid" # Must set this in named.conf as well named_uid="bind" # User to run named as named_chrootdir="/var/named" # Chroot directory (or "" not to auto-chroot it) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 03:07:42 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B91AB1065672; Fri, 15 Jan 2010 03:07:42 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A66AA8FC1C; Fri, 15 Jan 2010 03:07:42 +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 o0F37gvq027899; Fri, 15 Jan 2010 03:07:42 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F37g4K027897; Fri, 15 Jan 2010 03:07:42 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150307.o0F37g4K027897@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202335 - stable/6/etc/rc.d X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:07:42 -0000 Author: dougb Date: Fri Jan 15 03:07:42 2010 New Revision: 202335 URL: http://svn.freebsd.org/changeset/base/202335 Log: MFC r201367, r201370: Virtualize the location of "the configuration directory" instead of hard-coding it to be /etc/namedb Modified: stable/6/etc/rc.d/named Directory Properties: stable/6/etc/ (props changed) Modified: stable/6/etc/rc.d/named ============================================================================== --- stable/6/etc/rc.d/named Fri Jan 15 03:06:39 2010 (r202334) +++ stable/6/etc/rc.d/named Fri Jan 15 03:07:42 2010 (r202335) @@ -44,19 +44,19 @@ chroot_autoupdate() warn "chroot directory structure not updated" fi - # Create /etc/namedb symlink + # Create (or update) the configuration directory symlink # - if [ ! -L /etc/namedb ]; then - if [ -d /etc/namedb ]; then - warn "named chroot: /etc/namedb is a directory!" - elif [ -e /etc/namedb ]; then - warn "named chroot: /etc/namedb exists!" + if [ ! -L "${named_conf%/*}" ]; then + if [ -d "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} is a directory!" + elif [ -e "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} exists!" else - ln -s ${named_chrootdir}/etc/namedb /etc/namedb + ln -s ${named_confdir} ${named_conf%/*} fi else # Make sure it points to the right place. - ln -shf ${named_chrootdir}/etc/namedb /etc/namedb + ln -shf ${named_confdir} ${named_conf%/*} fi # Mount a devfs in the chroot directory if needed @@ -180,12 +180,12 @@ named_prestart() # Create an rndc.key file for the user if none exists # confgen_command="${command%/named}/rndc-confgen -a -b256 -u $named_uid \ - -c ${named_chrootdir}/etc/namedb/rndc.key" - if [ -s "${named_chrootdir}/etc/namedb/rndc.conf" ]; then + -c ${named_confdir}/rndc.key" + if [ -s "${named_confdir}/rndc.conf" ]; then unset confgen_command fi - if [ -s "${named_chrootdir}/etc/namedb/rndc.key" ]; then - case `stat -f%Su ${named_chrootdir}/etc/namedb/rndc.key` in + if [ -s "${named_confdir}/rndc.key" ]; then + case `stat -f%Su ${named_confdir}/rndc.key` in root|$named_uid) ;; *) $confgen_command ;; esac @@ -199,8 +199,8 @@ named_prestart() warn "named_auto_forward enabled, but no /etc/resolv.conf" # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf ${command%/named}/named-checkconf $named_conf || err 3 'named-checkconf for $named_conf failed' @@ -249,19 +249,19 @@ named_prestart() mv /var/run/naf-resolv.conf /etc/resolv.conf fi - if cmp -s ${named_chrootdir}/etc/namedb/auto_forward.conf \ + if cmp -s ${named_confdir}/auto_forward.conf \ /var/run/auto_forward.conf; then unlink /var/run/auto_forward.conf else - [ -e "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - unlink ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -e "${named_confdir}/auto_forward.conf" ] && + unlink ${named_confdir}/auto_forward.conf mv /var/run/auto_forward.conf \ - ${named_chrootdir}/etc/namedb/auto_forward.conf + ${named_confdir}/auto_forward.conf fi else # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf fi ${command%/named}/named-checkconf $named_conf || @@ -275,5 +275,6 @@ load_rc_config $name required_dirs="$named_chrootdir" # if it is set, it must exist required_files="${named_conf:=/etc/namedb/named.conf}" pidfile="${named_pidfile:-/var/run/named/pid}" +named_confdir="${named_chrootdir}${named_conf%/*}" run_rc_command "$1" From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 03:10:09 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E690C106566B; Fri, 15 Jan 2010 03:10:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D48AF8FC16; Fri, 15 Jan 2010 03:10: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 o0F3A935028647; Fri, 15 Jan 2010 03:10:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F3A9JF028645; Fri, 15 Jan 2010 03:10:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150310.o0F3A9JF028645@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202336 - stable/6/etc/defaults X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:10:10 -0000 Author: dougb Date: Fri Jan 15 03:10:09 2010 New Revision: 202336 URL: http://svn.freebsd.org/changeset/base/202336 Log: MFC r201368: Update named_flags comment regarding not using it for -u and -c Modified: stable/6/etc/defaults/rc.conf Directory Properties: stable/6/etc/ (props changed) Modified: stable/6/etc/defaults/rc.conf ============================================================================== --- stable/6/etc/defaults/rc.conf Fri Jan 15 03:07:42 2010 (r202335) +++ stable/6/etc/defaults/rc.conf Fri Jan 15 03:10:09 2010 (r202336) @@ -222,7 +222,7 @@ inetd_flags="-wW -C 60" # Optional flag named_enable="NO" # Run named, the DNS server (or NO). named_program="/usr/sbin/named" # Path to named, if you want a different one. named_conf="/etc/namedb/named.conf" # Path to the configuration file -#named_flags="-c /etc/namedb/named.conf" # Uncomment for named not in /usr/sbin +#named_flags="" # Use this for flags OTHER than -u and -c named_pidfile="/var/run/named/pid" # Must set this in named.conf as well named_uid="bind" # User to run named as named_chrootdir="/var/named" # Chroot directory (or "" not to auto-chroot it) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 03:28:47 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 391AC106566C; Fri, 15 Jan 2010 03:28:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 254908FC12; Fri, 15 Jan 2010 03:28:47 +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 o0F3SlXW032977; Fri, 15 Jan 2010 03:28:47 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F3Sl7X032974; Fri, 15 Jan 2010 03:28:47 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150328.o0F3Sl7X032974@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:28: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: r202337 - stable/8/usr.sbin/mergemaster X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:28:47 -0000 Author: dougb Date: Fri Jan 15 03:28:46 2010 New Revision: 202337 URL: http://svn.freebsd.org/changeset/base/202337 Log: MFC r200416: Simplify handling of MTREEFILE relative to DESTDIR Make the message about a missing MTREEFILE combined with -U more informative MFC r200425: Over time things that used to be files/directories/links can change to something else. So add code to detect when things don't match and give the user choices about how to fix it. If we're using -P and something in the above check needs to be moved we need to have the directory there for it, so create it at the beginning and delete empty versions of it at the end. The case where something used to be a file or link and now is supposed to be a directory (e.g., /etc/security) is especially dangerous, so make failure to install a necessary directory in $DESTDIR a fatal error. MFC r200700: In the places where find is used that the user may see the results, first pipe it to sort so that order of processing will be deterministic and like things will be grouped together. MFC r200701: Fix an indentation issue, no functional changes MFC r200708: Fix a problem with how mergemaster handles the hard links for /.cshrc and /.profile. The problem is that install(1) will unlink the old file before it installs the new one, which means that in the best case we have to compare the changes for the old file twice. So, change the logic to first test to see if the link exists, then install the file. Then if the link was there and we're using -i, just create the link in /root and be done with it. Otherwise display the message to the user and give them the option. Because we are now sorting things before doing the comparison we can know conclusively that the files in / should be the sources, and the files in /root will be the targets, so adjust the paths accordingly. While I'm here, split a too-long error message into two lines and just return at the end of handling these files instead of setting the variable that says "do nothing" and then returning at the end of the function anyway. MFC r201291: Add some patches contributed by jhb: 1. Don't prompt the user for "-U but no db" error if we're using -a 2. Add an option to delete stale rc.d files automatically if the user has DELETE_STALE_RC_FILES in their rc file. Lack of command line option for this is not an oversight. 3. Add []'s around the terminal $ for the $FreeBSD$ test for -F For one bug raised by jhb I did a more thorough solution: There were a lot of things that "snuck in" between the end of the test for -r and the start of the comparison. One of them is the creation of the mtree db, as pointed out by jhb. Fix this problem more thoroughly by moving the end of the test down to where it should/used to be, right before the comparison. As a result, indent the interloping code to match. MFC r201292: Document the DELETE_STALE_RC_FILES option introduced in r201291. This is an "rc file only" option by design. While I'm here, update the comments in the example rc file to indicate which command line options they relate to, and correct the defaults for a couple of options. MFC r201293: It's not necessary to include both Op and Fl for command line options included in the text, so use only the latter. Clarify that using -U doesn't make sense in combination with -a MFC r201323: If we are using -p it does not make any sense to even create the MTREENEW file since it will never be used. MFC r201765: Update copyright date Update delete_temproot() to include the error message if it fails, and clean up the places where it's called. If there are no files left in temproot when the comparison is done delete it without prompting. This should make "automated" runs of mergemaster without -a a little easier. Document the new behavior in the man page. Modified: stable/8/usr.sbin/mergemaster/mergemaster.8 stable/8/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/8/usr.sbin/mergemaster/ (props changed) Modified: stable/8/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- stable/8/usr.sbin/mergemaster/mergemaster.8 Fri Jan 15 03:10:09 2010 (r202336) +++ stable/8/usr.sbin/mergemaster/mergemaster.8 Fri Jan 15 03:28:46 2010 (r202337) @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998-2009 Douglas Barton +.\" Copyright (c) 1998-2010 Douglas Barton .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2009 +.Dd January 7, 2010 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -61,10 +61,10 @@ down, populating that environment with t files. You can specify a different source directory with the -.Op Fl m +.Fl m command line option, or specify the destination directory with the -.Op Fl D +.Fl D option. It then compares each file in that environment to its installed counterpart. @@ -91,10 +91,10 @@ compares the files themselves. You can also specify that the script ignore the Id strings and compare every file with the -.Op Fl s +.Fl s option. Using the -.Op Fl F +.Fl F option .Nm will install the new file for you if they differ only by @@ -126,7 +126,7 @@ installing an updated version of this fi probably run .Xr pwd_mkdb 8 with the -.Op Fl p +.Fl p option to rebuild your password databases and recreate .Pa /etc/passwd . @@ -165,6 +165,14 @@ which will be read before Options specified on the command line are updated last, and therefore can override both files. .Pp +When the comparison is done if there are any files remaining +in the temproot directory they will be listed, and if the +.Fl a +option is not in use the user will be given the option of +deleting the temproot directory. +If there are no files remaining in the temproot directory +it will be deleted. +.Pp The options are as follows: .Bl -tag -width Fl .It Fl s @@ -198,11 +206,13 @@ If the directory exists, it creates a new one in a previously non-existent directory. This option unsets the verbose flag, -but is compatible with all other options. +but other than +.Fl U +it is compatible with all other options. Setting -.Op Fl a +.Fl a makes -.Op Fl w +.Fl w superfluous. .It Fl h Display usage and help information. @@ -253,7 +263,7 @@ instead of the default Add the date and time to the name of the temporary root directory. If -.Op Fl t +.Fl t is specified, this option must follow it if you want the date added too. .It Fl u Ar N @@ -320,44 +330,44 @@ with all values commented out: # These are options for mergemaster, with their default values listed # The following options have command line overrides # -# The target architecture (unset by default) +# The target architecture (-A, unset by default) #ARCHSTRING='TARGET_ARCH=' # -# Sourcedir is the directory to do the 'make' in (where the new files are) +# Sourcedir is the directory to do the 'make' in (-m) #SOURCEDIR='/usr/src' # -# Directory to install the temporary root environment into +# Directory to install the temporary root environment into (-t) #TEMPROOT='/var/tmp/temproot' # -# Specify the destination directory for the installed files +# Specify the destination directory for the installed files (-D) #DESTDIR= # -# Strict comparison skips the VCS Id test and compares every file +# Strict comparison skips the VCS Id test and compares every file (-s) #STRICT=no # -# Type of diff, such as unified, context, etc. +# Type of diff, such as unified, context, etc. (-c) #DIFF_FLAG='-u' # -# Install the new file if it differs only by VCS Id ($FreeBSD) +# Install the new file if it differs only by VCS Id ($FreeBSD, -F) #FREEBSD_ID= # -# Verbose mode includes more details and additional checks +# Verbose mode includes more details and additional checks (-v) #VERBOSE= # -# Automatically install files that do not exist on the system already +# Automatically install files that do not exist on the system already (-i) #AUTO_INSTALL= # -# Automatically upgrade files that have not been user modified +# Automatically upgrade files that have not been user modified (-U) #AUTO_UPGRADE= # -# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf -#COMP_CONFS=yes +# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf (-C) +#COMP_CONFS= # -# Preserve files that you replace -#PRESERVE_FILES=yes +# Preserve files that you replace (-P) +#PRESERVE_FILES= #PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S` # -# The umask for mergemaster to compare the default file's modes to +# The umask for mergemaster to compare the default file's modes to (-u) #NEW_UMASK=022 # # The following options have no command line overrides @@ -377,6 +387,9 @@ with all values commented out: # If you set 'yes' above, make sure to include the PATH to your pager #PATH=/bin:/usr/bin:/usr/sbin # +# Delete stale files in /etc/rc.d without prompting +#DELETE_STALE_RC_FILES= +# # Specify the path to scripts to run before the comparison starts, # and/or after the script has finished its work #MM_PRE_COMPARE_SCRIPT= Modified: stable/8/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/8/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 03:10:09 2010 (r202336) +++ stable/8/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 03:28:46 2010 (r202337) @@ -5,7 +5,7 @@ # Compare files created by /usr/src/etc/Makefile (or the directory # the user specifies) with the currently installed copies. -# Copyright 1998-2009 Douglas Barton +# Copyright 1998-2010 Douglas Barton # DougB@FreeBSD.org # $FreeBSD$ @@ -263,7 +263,7 @@ fi # Assign the location of the mtree database # -MTREEDB=${MTREEDB:-/var/db} +MTREEDB=${MTREEDB:-${DESTDIR}/var/db} MTREEFILE="${MTREEDB}/mergemaster.mtree" # Check the command line options @@ -345,18 +345,24 @@ done # Don't force the user to set this in the mergemaster rc file if [ -n "${PRESERVE_FILES}" -a -z "${PRESERVE_FILES_DIR}" ]; then PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S` + mkdir -p ${PRESERVE_FILES_DIR} fi # Check for the mtree database in DESTDIR case "${AUTO_UPGRADE}" in '') ;; # If the option is not set no need to run the test or warn the user *) - if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then + if [ ! -s "${MTREEFILE}" ]; then echo '' - echo "*** Unable to find mtree database. Skipping auto-upgrade on this run." + echo "*** Unable to find mtree database (${MTREEFILE})." + echo " Skipping auto-upgrade on this run." echo " It will be created for the next run when this one is complete." echo '' - press_to_continue + case "${AUTO_RUN}" in + '') + press_to_continue + ;; + esac unset AUTO_UPGRADE fi ;; @@ -463,9 +469,9 @@ MM_MAKE="make ${ARCHSTRING} -m ${SOURCED # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. # -if [ -n "${AUTO_UPGRADE}" -a -s "${DESTDIR}${MTREEFILE}" ]; then +if [ -n "${AUTO_UPGRADE}" -a -s "${MTREEFILE}" ]; then CHANGED=: - for file in `mtree -eqL -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ + for file in `mtree -eqL -f ${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then CHANGED="${CHANGED}${DESTDIR}/${file}:" @@ -505,7 +511,7 @@ CVS_ID_TAG=FreeBSD delete_temproot () { rm -rf "${TEMPROOT}" 2>/dev/null chflags -R 0 "${TEMPROOT}" 2>/dev/null - rm -rf "${TEMPROOT}" || exit 1 + rm -rf "${TEMPROOT}" || { echo "*** Unable to delete ${TEMPROOT}"; exit 1; } } case "${RERUN}" in @@ -536,7 +542,7 @@ case "${RERUN}" in echo '' echo " *** Deleting the old ${TEMPROOT}" echo '' - delete_temproot || exit 1 + delete_temproot unset TEST_TEMP_ROOT ;; [tT]) @@ -663,31 +669,32 @@ case "${RERUN}" in for file in ${IGNORE_FILES}; do test -e ${TEMPROOT}/${file} && unlink ${TEMPROOT}/${file} done - ;; # End of the "RERUN" test -esac -# We really don't want to have to deal with files like login.conf.db, pwd.db, -# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. -# Prompt the user to do so below, as needed. -# -rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd + # We really don't want to have to deal with files like login.conf.db, pwd.db, + # or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. + # Prompt the user to do so below, as needed. + # + rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd -# We only need to compare things like freebsd.cf once -find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null + # We only need to compare things like freebsd.cf once + find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null -# Delete stuff we do not need to keep the mtree database small, -# and to make the actual comparison faster. -find ${TEMPROOT}/usr -type l -delete 2>/dev/null -find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null -find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null + # Delete stuff we do not need to keep the mtree database small, + # and to make the actual comparison faster. + find ${TEMPROOT}/usr -type l -delete 2>/dev/null + find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null + find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null -# Build the mtree database in a temporary location. -MTREENEW=`mktemp -t mergemaster.mtree` -case "${PRE_WORLD}" in -'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null - ;; -*) # We don't want to mess with the mtree database on a pre-world run. - ;; + # Build the mtree database in a temporary location. + case "${PRE_WORLD}" in + '') MTREENEW=`mktemp -t mergemaster.mtree` + mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null + ;; + *) # We don't want to mess with the mtree database on a pre-world run or + # when re-scanning a previously-built tree. + ;; + esac + ;; # End of the "RERUN" test esac # Get ready to start comparing files @@ -818,7 +825,8 @@ mm_install () { if [ -n "${DESTDIR}${INSTALL_DIR}" -a ! -d "${DESTDIR}${INSTALL_DIR}" ]; then DIR_MODE=`find_mode "${TEMPROOT}/${INSTALL_DIR}"` - install -d -o root -g wheel -m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}" + install -d -o root -g wheel -m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}" || + install_error $1 ${DESTDIR}${INSTALL_DIR} fi FILE_MODE=`find_mode "${1}"` @@ -837,32 +845,39 @@ mm_install () { DONT_INSTALL=yes ;; /.cshrc | /.profile) - case "${AUTO_INSTALL}" in - '') - case "${LINK_EXPLAINED}" in - '') - echo " *** Historically BSD derived systems have had a" - echo " hard link from /.cshrc and /.profile to" - echo " their namesakes in /root. Please indicate" - echo " your preference below for bringing your" - echo " installed files up to date." - echo '' - LINK_EXPLAINED=yes - ;; - esac + local st_nlink - echo " Use 'd' to delete the temporary ${COMPFILE}" - echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link" - echo '' - echo " Default is to leave the temporary file to deal with by hand" - echo '' - echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " - read HANDLE_LINK - ;; - *) # Part of AUTO_INSTALL - HANDLE_LINK=l - ;; - esac + # install will unlink the file before it installs the new one, + # so we have to restore/create the link afterwards. + # + st_nlink=0 # In case the file does not yet exist + eval $(stat -s ${DESTDIR}${COMPFILE#.} 2>/dev/null) + + do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" + + if [ -n "${AUTO_INSTALL}" -a $st_nlink -gt 1 ]; then + HANDLE_LINK=l + else + case "${LINK_EXPLAINED}" in + '') + echo " *** Historically BSD derived systems have had a" + echo " hard link from /.cshrc and /.profile to" + echo " their namesakes in /root. Please indicate" + echo " your preference below for bringing your" + echo " installed files up to date." + echo '' + LINK_EXPLAINED=yes + ;; + esac + + echo " Use 'd' to delete the temporary ${COMPFILE}" + echo " Use 'l' to delete the existing ${DESTDIR}/root/${COMPFILE##*/} and create the link" + echo '' + echo " Default is to leave the temporary file to deal with by hand" + echo '' + echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " + read HANDLE_LINK + fi case "${HANDLE_LINK}" in [dD]*) @@ -872,19 +887,19 @@ mm_install () { ;; [lL]*) echo '' - rm -f "${DESTDIR}${COMPFILE#.}" - if ln "${DESTDIR}/root/${COMPFILE##*/}" "${DESTDIR}${COMPFILE#.}"; then + unlink ${DESTDIR}/root/${COMPFILE##*/} + if ln ${DESTDIR}${COMPFILE#.} ${DESTDIR}/root/${COMPFILE##*/}; then echo " *** Link from ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/} installed successfully" - rm "${COMPFILE}" else - echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}, ${COMPFILE} will remain to install by hand" + echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}" + echo " *** ${COMPFILE} will remain for your consideration" fi ;; *) echo " *** ${COMPFILE} will remain for your consideration" ;; esac - DONT_INSTALL=yes + return ;; esac @@ -955,6 +970,12 @@ if [ -z "${PRE_WORLD}" -a -z "${RERUN}" esac sleep 2 ;; + *) + if [ -n "${DELETE_STALE_RC_FILES}" ]; then + echo ' *** Deleting ... ' + rm ${STALE_RC_FILES} + echo ' done.' + fi esac ;; esac @@ -967,7 +988,58 @@ if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; th . "${MM_PRE_COMPARE_SCRIPT}" fi -for COMPFILE in `find . -type f`; do +# Things that were files/directories/links in one version can sometimes +# change to something else in a newer version. So we need to explicitly +# test for this, and warn the user if what we find does not match. +# +for COMPFILE in `find . | sort` ; do + if [ -e "${DESTDIR}${COMPFILE#.}" ]; then + INSTALLED_TYPE=`stat -f '%HT' ${DESTDIR}${COMPFILE#.}` + else + continue + fi + TEMPROOT_TYPE=`stat -f '%HT' $COMPFILE` + + if [ ! "$TEMPROOT_TYPE" = "$INSTALLED_TYPE" ]; then + [ "$COMPFILE" = '.' ] && continue + TEMPROOT_TYPE=`echo $TEMPROOT_TYPE | tr [:upper:] [:lower:]` + INSTALLED_TYPE=`echo $INSTALLED_TYPE | tr [:upper:] [:lower:]` + + echo "*** The installed file ${DESTDIR}${COMPFILE#.} has the type \"$INSTALLED_TYPE\"" + echo " but the new version has the type \"$TEMPROOT_TYPE\"" + echo '' + echo " How would you like to handle this?" + echo '' + echo " Use 'r' to remove ${DESTDIR}${COMPFILE#.}" + case "$TEMPROOT_TYPE" in + 'symbolic link') + TARGET=`readlink $COMPFILE` + echo " and create a link to $TARGET in its place" ;; + *) echo " You will be able to install it as a \"$TEMPROOT_TYPE\"" ;; + esac + echo '' + echo " Use 'i' to ignore this" + echo '' + echo -n " How to proceed? [i] " + read ANSWER + case "$ANSWER" in + [rR]) case "${PRESERVE_FILES}" in + [Yy][Ee][Ss]) + mv ${DESTDIR}${COMPFILE#.} ${PRESERVE_FILES_DIR}/ || exit 1 ;; + *) rm -rf ${DESTDIR}${COMPFILE#.} ;; + esac + case "$TEMPROOT_TYPE" in + 'symbolic link') ln -sf $TARGET ${DESTDIR}${COMPFILE#.} ;; + esac ;; + *) echo '' + echo "*** See the man page about adding ${COMPFILE#.} to the list of IGNORE_FILES" + press_to_continue ;; + esac + echo '' + fi +done + +for COMPFILE in `find . -type f | sort`; do # First, check to see if the file exists in DESTDIR. If not, the # diff_loop function knows how to handle it. @@ -1032,7 +1104,7 @@ for COMPFILE in `find . -type f`; do # If the user chose the -F option, test for that before proceeding # if [ -n "$FREEBSD_ID" ]; then - if diff -q -I'[$]FreeBSD:.*$' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ + if diff -q -I'[$]FreeBSD.*[$]' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ /dev/null 2>&1; then if mm_install "${COMPFILE}"; then echo "*** Updated revision control Id for ${DESTDIR}${COMPFILE#.}" @@ -1061,8 +1133,8 @@ echo "*** Comparison complete" if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" - test -e "${DESTDIR}${MTREEFILE}" && unlink ${DESTDIR}${MTREEFILE} - mv ${MTREENEW} ${DESTDIR}${MTREEFILE} + test -e "${MTREEFILE}" && unlink ${MTREEFILE} + mv ${MTREENEW} ${MTREEFILE} fi echo '' @@ -1070,30 +1142,28 @@ echo '' TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null` if [ -n "${TEST_FOR_FILES}" ]; then echo "*** Files that remain for you to merge by hand:" - find "${TEMPROOT}" -type f -size +0 + find "${TEMPROOT}" -type f -size +0 | sort echo '' -fi - -case "${AUTO_RUN}" in -'') - echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] " - read DEL_TEMPROOT - case "${DEL_TEMPROOT}" in - [yY]*) - if delete_temproot; then - echo " *** ${TEMPROOT} has been deleted" - else - echo " *** Unable to delete ${TEMPROOT}" - fi - ;; - *) - echo " *** ${TEMPROOT} will remain" + case "${AUTO_RUN}" in + '') + echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] " + read DEL_TEMPROOT + case "${DEL_TEMPROOT}" in + [yY]*) + delete_temproot + ;; + *) + echo " *** ${TEMPROOT} will remain" + ;; + esac ;; + *) ;; esac - ;; -*) ;; -esac +else + echo "*** ${TEMPROOT} is empty, deleting" + delete_temproot +fi case "${AUTO_INSTALLED_FILES}" in '') ;; @@ -1268,5 +1338,9 @@ case "${PRE_WORLD}" in ;; esac -exit 0 +if [ -n "${PRESERVE_FILES}" ]; then + find -d $PRESERVE_FILES_DIR -type d -empty -delete 2>/dev/null + rmdir $PRESERVE_FILES_DIR 2>/dev/null +fi +exit 0 From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 03:39:04 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E30D1065670; Fri, 15 Jan 2010 03:39:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE9998FC15; Fri, 15 Jan 2010 03:39: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 o0F3d3R4035299; Fri, 15 Jan 2010 03:39:03 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F3d3V4035296; Fri, 15 Jan 2010 03:39:03 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150339.o0F3d3V4035296@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202338 - stable/7/usr.sbin/mergemaster X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:39:04 -0000 Author: dougb Date: Fri Jan 15 03:39:03 2010 New Revision: 202338 URL: http://svn.freebsd.org/changeset/base/202338 Log: MFC r200416: Simplify handling of MTREEFILE relative to DESTDIR Make the message about a missing MTREEFILE combined with -U more informative MFC r200425: Over time things that used to be files/directories/links can change to something else. So add code to detect when things don't match and give the user choices about how to fix it. If we're using -P and something in the above check needs to be moved we need to have the directory there for it, so create it at the beginning and delete empty versions of it at the end. The case where something used to be a file or link and now is supposed to be a directory (e.g., /etc/security) is especially dangerous, so make failure to install a necessary directory in $DESTDIR a fatal error. MFC r200700: In the places where find is used that the user may see the results, first pipe it to sort so that order of processing will be deterministic and like things will be grouped together. MFC r200701: Fix an indentation issue, no functional changes MFC r200708: Fix a problem with how mergemaster handles the hard links for /.cshrc and /.profile. The problem is that install(1) will unlink the old file before it installs the new one, which means that in the best case we have to compare the changes for the old file twice. So, change the logic to first test to see if the link exists, then install the file. Then if the link was there and we're using -i, just create the link in /root and be done with it. Otherwise display the message to the user and give them the option. Because we are now sorting things before doing the comparison we can know conclusively that the files in / should be the sources, and the files in /root will be the targets, so adjust the paths accordingly. While I'm here, split a too-long error message into two lines and just return at the end of handling these files instead of setting the variable that says "do nothing" and then returning at the end of the function anyway. MFC r201291: Add some patches contributed by jhb: 1. Don't prompt the user for "-U but no db" error if we're using -a 2. Add an option to delete stale rc.d files automatically if the user has DELETE_STALE_RC_FILES in their rc file. Lack of command line option for this is not an oversight. 3. Add []'s around the terminal $ for the $FreeBSD$ test for -F For one bug raised by jhb I did a more thorough solution: There were a lot of things that "snuck in" between the end of the test for -r and the start of the comparison. One of them is the creation of the mtree db, as pointed out by jhb. Fix this problem more thoroughly by moving the end of the test down to where it should/used to be, right before the comparison. As a result, indent the interloping code to match. MFC r201292: Document the DELETE_STALE_RC_FILES option introduced in r201291. This is an "rc file only" option by design. While I'm here, update the comments in the example rc file to indicate which command line options they relate to, and correct the defaults for a couple of options. MFC r201293: It's not necessary to include both Op and Fl for command line options included in the text, so use only the latter. Clarify that using -U doesn't make sense in combination with -a MFC r201323: If we are using -p it does not make any sense to even create the MTREENEW file since it will never be used. MFC r201765: Update copyright date Update delete_temproot() to include the error message if it fails, and clean up the places where it's called. If there are no files left in temproot when the comparison is done delete it without prompting. This should make "automated" runs of mergemaster without -a a little easier. Document the new behavior in the man page. Modified: stable/7/usr.sbin/mergemaster/mergemaster.8 stable/7/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/7/usr.sbin/mergemaster/ (props changed) Modified: stable/7/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- stable/7/usr.sbin/mergemaster/mergemaster.8 Fri Jan 15 03:28:46 2010 (r202337) +++ stable/7/usr.sbin/mergemaster/mergemaster.8 Fri Jan 15 03:39:03 2010 (r202338) @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998-2009 Douglas Barton +.\" Copyright (c) 1998-2010 Douglas Barton .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2009 +.Dd January 7, 2010 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -61,10 +61,10 @@ down, populating that environment with t files. You can specify a different source directory with the -.Op Fl m +.Fl m command line option, or specify the destination directory with the -.Op Fl D +.Fl D option. It then compares each file in that environment to its installed counterpart. @@ -91,10 +91,10 @@ compares the files themselves. You can also specify that the script ignore the Id strings and compare every file with the -.Op Fl s +.Fl s option. Using the -.Op Fl F +.Fl F option .Nm will install the new file for you if they differ only by @@ -126,7 +126,7 @@ installing an updated version of this fi probably run .Xr pwd_mkdb 8 with the -.Op Fl p +.Fl p option to rebuild your password databases and recreate .Pa /etc/passwd . @@ -165,6 +165,14 @@ which will be read before Options specified on the command line are updated last, and therefore can override both files. .Pp +When the comparison is done if there are any files remaining +in the temproot directory they will be listed, and if the +.Fl a +option is not in use the user will be given the option of +deleting the temproot directory. +If there are no files remaining in the temproot directory +it will be deleted. +.Pp The options are as follows: .Bl -tag -width Fl .It Fl s @@ -198,11 +206,13 @@ If the directory exists, it creates a new one in a previously non-existent directory. This option unsets the verbose flag, -but is compatible with all other options. +but other than +.Fl U +it is compatible with all other options. Setting -.Op Fl a +.Fl a makes -.Op Fl w +.Fl w superfluous. .It Fl h Display usage and help information. @@ -253,7 +263,7 @@ instead of the default Add the date and time to the name of the temporary root directory. If -.Op Fl t +.Fl t is specified, this option must follow it if you want the date added too. .It Fl u Ar N @@ -320,44 +330,44 @@ with all values commented out: # These are options for mergemaster, with their default values listed # The following options have command line overrides # -# The target architecture (unset by default) +# The target architecture (-A, unset by default) #ARCHSTRING='TARGET_ARCH=' # -# Sourcedir is the directory to do the 'make' in (where the new files are) +# Sourcedir is the directory to do the 'make' in (-m) #SOURCEDIR='/usr/src' # -# Directory to install the temporary root environment into +# Directory to install the temporary root environment into (-t) #TEMPROOT='/var/tmp/temproot' # -# Specify the destination directory for the installed files +# Specify the destination directory for the installed files (-D) #DESTDIR= # -# Strict comparison skips the VCS Id test and compares every file +# Strict comparison skips the VCS Id test and compares every file (-s) #STRICT=no # -# Type of diff, such as unified, context, etc. +# Type of diff, such as unified, context, etc. (-c) #DIFF_FLAG='-u' # -# Install the new file if it differs only by VCS Id ($FreeBSD) +# Install the new file if it differs only by VCS Id ($FreeBSD, -F) #FREEBSD_ID= # -# Verbose mode includes more details and additional checks +# Verbose mode includes more details and additional checks (-v) #VERBOSE= # -# Automatically install files that do not exist on the system already +# Automatically install files that do not exist on the system already (-i) #AUTO_INSTALL= # -# Automatically upgrade files that have not been user modified +# Automatically upgrade files that have not been user modified (-U) #AUTO_UPGRADE= # -# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf -#COMP_CONFS=yes +# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf (-C) +#COMP_CONFS= # -# Preserve files that you replace -#PRESERVE_FILES=yes +# Preserve files that you replace (-P) +#PRESERVE_FILES= #PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S` # -# The umask for mergemaster to compare the default file's modes to +# The umask for mergemaster to compare the default file's modes to (-u) #NEW_UMASK=022 # # The following options have no command line overrides @@ -377,6 +387,9 @@ with all values commented out: # If you set 'yes' above, make sure to include the PATH to your pager #PATH=/bin:/usr/bin:/usr/sbin # +# Delete stale files in /etc/rc.d without prompting +#DELETE_STALE_RC_FILES= +# # Specify the path to scripts to run before the comparison starts, # and/or after the script has finished its work #MM_PRE_COMPARE_SCRIPT= Modified: stable/7/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/7/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 03:28:46 2010 (r202337) +++ stable/7/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 03:39:03 2010 (r202338) @@ -5,7 +5,7 @@ # Compare files created by /usr/src/etc/Makefile (or the directory # the user specifies) with the currently installed copies. -# Copyright 1998-2009 Douglas Barton +# Copyright 1998-2010 Douglas Barton # DougB@FreeBSD.org # $FreeBSD$ @@ -263,7 +263,7 @@ fi # Assign the location of the mtree database # -MTREEDB=${MTREEDB:-/var/db} +MTREEDB=${MTREEDB:-${DESTDIR}/var/db} MTREEFILE="${MTREEDB}/mergemaster.mtree" # Check the command line options @@ -345,18 +345,24 @@ done # Don't force the user to set this in the mergemaster rc file if [ -n "${PRESERVE_FILES}" -a -z "${PRESERVE_FILES_DIR}" ]; then PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S` + mkdir -p ${PRESERVE_FILES_DIR} fi # Check for the mtree database in DESTDIR case "${AUTO_UPGRADE}" in '') ;; # If the option is not set no need to run the test or warn the user *) - if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then + if [ ! -s "${MTREEFILE}" ]; then echo '' - echo "*** Unable to find mtree database. Skipping auto-upgrade on this run." + echo "*** Unable to find mtree database (${MTREEFILE})." + echo " Skipping auto-upgrade on this run." echo " It will be created for the next run when this one is complete." echo '' - press_to_continue + case "${AUTO_RUN}" in + '') + press_to_continue + ;; + esac unset AUTO_UPGRADE fi ;; @@ -463,9 +469,9 @@ MM_MAKE="make ${ARCHSTRING} -m ${SOURCED # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. # -if [ -n "${AUTO_UPGRADE}" -a -s "${DESTDIR}${MTREEFILE}" ]; then +if [ -n "${AUTO_UPGRADE}" -a -s "${MTREEFILE}" ]; then CHANGED=: - for file in `mtree -eqL -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ + for file in `mtree -eqL -f ${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then CHANGED="${CHANGED}${DESTDIR}/${file}:" @@ -505,7 +511,7 @@ CVS_ID_TAG=FreeBSD delete_temproot () { rm -rf "${TEMPROOT}" 2>/dev/null chflags -R 0 "${TEMPROOT}" 2>/dev/null - rm -rf "${TEMPROOT}" || exit 1 + rm -rf "${TEMPROOT}" || { echo "*** Unable to delete ${TEMPROOT}"; exit 1; } } case "${RERUN}" in @@ -536,7 +542,7 @@ case "${RERUN}" in echo '' echo " *** Deleting the old ${TEMPROOT}" echo '' - delete_temproot || exit 1 + delete_temproot unset TEST_TEMP_ROOT ;; [tT]) @@ -663,31 +669,32 @@ case "${RERUN}" in for file in ${IGNORE_FILES}; do test -e ${TEMPROOT}/${file} && unlink ${TEMPROOT}/${file} done - ;; # End of the "RERUN" test -esac -# We really don't want to have to deal with files like login.conf.db, pwd.db, -# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. -# Prompt the user to do so below, as needed. -# -rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd + # We really don't want to have to deal with files like login.conf.db, pwd.db, + # or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. + # Prompt the user to do so below, as needed. + # + rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd -# We only need to compare things like freebsd.cf once -find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null + # We only need to compare things like freebsd.cf once + find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null -# Delete stuff we do not need to keep the mtree database small, -# and to make the actual comparison faster. -find ${TEMPROOT}/usr -type l -delete 2>/dev/null -find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null -find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null + # Delete stuff we do not need to keep the mtree database small, + # and to make the actual comparison faster. + find ${TEMPROOT}/usr -type l -delete 2>/dev/null + find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null + find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null -# Build the mtree database in a temporary location. -MTREENEW=`mktemp -t mergemaster.mtree` -case "${PRE_WORLD}" in -'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null - ;; -*) # We don't want to mess with the mtree database on a pre-world run. - ;; + # Build the mtree database in a temporary location. + case "${PRE_WORLD}" in + '') MTREENEW=`mktemp -t mergemaster.mtree` + mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null + ;; + *) # We don't want to mess with the mtree database on a pre-world run or + # when re-scanning a previously-built tree. + ;; + esac + ;; # End of the "RERUN" test esac # Get ready to start comparing files @@ -818,7 +825,8 @@ mm_install () { if [ -n "${DESTDIR}${INSTALL_DIR}" -a ! -d "${DESTDIR}${INSTALL_DIR}" ]; then DIR_MODE=`find_mode "${TEMPROOT}/${INSTALL_DIR}"` - install -d -o root -g wheel -m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}" + install -d -o root -g wheel -m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}" || + install_error $1 ${DESTDIR}${INSTALL_DIR} fi FILE_MODE=`find_mode "${1}"` @@ -837,32 +845,39 @@ mm_install () { DONT_INSTALL=yes ;; /.cshrc | /.profile) - case "${AUTO_INSTALL}" in - '') - case "${LINK_EXPLAINED}" in - '') - echo " *** Historically BSD derived systems have had a" - echo " hard link from /.cshrc and /.profile to" - echo " their namesakes in /root. Please indicate" - echo " your preference below for bringing your" - echo " installed files up to date." - echo '' - LINK_EXPLAINED=yes - ;; - esac + local st_nlink - echo " Use 'd' to delete the temporary ${COMPFILE}" - echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link" - echo '' - echo " Default is to leave the temporary file to deal with by hand" - echo '' - echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " - read HANDLE_LINK - ;; - *) # Part of AUTO_INSTALL - HANDLE_LINK=l - ;; - esac + # install will unlink the file before it installs the new one, + # so we have to restore/create the link afterwards. + # + st_nlink=0 # In case the file does not yet exist + eval $(stat -s ${DESTDIR}${COMPFILE#.} 2>/dev/null) + + do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" + + if [ -n "${AUTO_INSTALL}" -a $st_nlink -gt 1 ]; then + HANDLE_LINK=l + else + case "${LINK_EXPLAINED}" in + '') + echo " *** Historically BSD derived systems have had a" + echo " hard link from /.cshrc and /.profile to" + echo " their namesakes in /root. Please indicate" + echo " your preference below for bringing your" + echo " installed files up to date." + echo '' + LINK_EXPLAINED=yes + ;; + esac + + echo " Use 'd' to delete the temporary ${COMPFILE}" + echo " Use 'l' to delete the existing ${DESTDIR}/root/${COMPFILE##*/} and create the link" + echo '' + echo " Default is to leave the temporary file to deal with by hand" + echo '' + echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " + read HANDLE_LINK + fi case "${HANDLE_LINK}" in [dD]*) @@ -872,19 +887,19 @@ mm_install () { ;; [lL]*) echo '' - rm -f "${DESTDIR}${COMPFILE#.}" - if ln "${DESTDIR}/root/${COMPFILE##*/}" "${DESTDIR}${COMPFILE#.}"; then + unlink ${DESTDIR}/root/${COMPFILE##*/} + if ln ${DESTDIR}${COMPFILE#.} ${DESTDIR}/root/${COMPFILE##*/}; then echo " *** Link from ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/} installed successfully" - rm "${COMPFILE}" else - echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}, ${COMPFILE} will remain to install by hand" + echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}" + echo " *** ${COMPFILE} will remain for your consideration" fi ;; *) echo " *** ${COMPFILE} will remain for your consideration" ;; esac - DONT_INSTALL=yes + return ;; esac @@ -955,6 +970,12 @@ if [ -z "${PRE_WORLD}" -a -z "${RERUN}" esac sleep 2 ;; + *) + if [ -n "${DELETE_STALE_RC_FILES}" ]; then + echo ' *** Deleting ... ' + rm ${STALE_RC_FILES} + echo ' done.' + fi esac ;; esac @@ -967,7 +988,58 @@ if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; th . "${MM_PRE_COMPARE_SCRIPT}" fi -for COMPFILE in `find . -type f`; do +# Things that were files/directories/links in one version can sometimes +# change to something else in a newer version. So we need to explicitly +# test for this, and warn the user if what we find does not match. +# +for COMPFILE in `find . | sort` ; do + if [ -e "${DESTDIR}${COMPFILE#.}" ]; then + INSTALLED_TYPE=`stat -f '%HT' ${DESTDIR}${COMPFILE#.}` + else + continue + fi + TEMPROOT_TYPE=`stat -f '%HT' $COMPFILE` + + if [ ! "$TEMPROOT_TYPE" = "$INSTALLED_TYPE" ]; then + [ "$COMPFILE" = '.' ] && continue + TEMPROOT_TYPE=`echo $TEMPROOT_TYPE | tr [:upper:] [:lower:]` + INSTALLED_TYPE=`echo $INSTALLED_TYPE | tr [:upper:] [:lower:]` + + echo "*** The installed file ${DESTDIR}${COMPFILE#.} has the type \"$INSTALLED_TYPE\"" + echo " but the new version has the type \"$TEMPROOT_TYPE\"" + echo '' + echo " How would you like to handle this?" + echo '' + echo " Use 'r' to remove ${DESTDIR}${COMPFILE#.}" + case "$TEMPROOT_TYPE" in + 'symbolic link') + TARGET=`readlink $COMPFILE` + echo " and create a link to $TARGET in its place" ;; + *) echo " You will be able to install it as a \"$TEMPROOT_TYPE\"" ;; + esac + echo '' + echo " Use 'i' to ignore this" + echo '' + echo -n " How to proceed? [i] " + read ANSWER + case "$ANSWER" in + [rR]) case "${PRESERVE_FILES}" in + [Yy][Ee][Ss]) + mv ${DESTDIR}${COMPFILE#.} ${PRESERVE_FILES_DIR}/ || exit 1 ;; + *) rm -rf ${DESTDIR}${COMPFILE#.} ;; + esac + case "$TEMPROOT_TYPE" in + 'symbolic link') ln -sf $TARGET ${DESTDIR}${COMPFILE#.} ;; + esac ;; + *) echo '' + echo "*** See the man page about adding ${COMPFILE#.} to the list of IGNORE_FILES" + press_to_continue ;; + esac + echo '' + fi +done + +for COMPFILE in `find . -type f | sort`; do # First, check to see if the file exists in DESTDIR. If not, the # diff_loop function knows how to handle it. @@ -1032,7 +1104,7 @@ for COMPFILE in `find . -type f`; do # If the user chose the -F option, test for that before proceeding # if [ -n "$FREEBSD_ID" ]; then - if diff -q -I'[$]FreeBSD:.*$' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ + if diff -q -I'[$]FreeBSD.*[$]' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ /dev/null 2>&1; then if mm_install "${COMPFILE}"; then echo "*** Updated revision control Id for ${DESTDIR}${COMPFILE#.}" @@ -1061,8 +1133,8 @@ echo "*** Comparison complete" if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" - test -e "${DESTDIR}${MTREEFILE}" && unlink ${DESTDIR}${MTREEFILE} - mv ${MTREENEW} ${DESTDIR}${MTREEFILE} + test -e "${MTREEFILE}" && unlink ${MTREEFILE} + mv ${MTREENEW} ${MTREEFILE} fi echo '' @@ -1070,30 +1142,28 @@ echo '' TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null` if [ -n "${TEST_FOR_FILES}" ]; then echo "*** Files that remain for you to merge by hand:" - find "${TEMPROOT}" -type f -size +0 + find "${TEMPROOT}" -type f -size +0 | sort echo '' -fi - -case "${AUTO_RUN}" in -'') - echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] " - read DEL_TEMPROOT - case "${DEL_TEMPROOT}" in - [yY]*) - if delete_temproot; then - echo " *** ${TEMPROOT} has been deleted" - else - echo " *** Unable to delete ${TEMPROOT}" - fi - ;; - *) - echo " *** ${TEMPROOT} will remain" + case "${AUTO_RUN}" in + '') + echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] " + read DEL_TEMPROOT + case "${DEL_TEMPROOT}" in + [yY]*) + delete_temproot + ;; + *) + echo " *** ${TEMPROOT} will remain" + ;; + esac ;; + *) ;; esac - ;; -*) ;; -esac +else + echo "*** ${TEMPROOT} is empty, deleting" + delete_temproot +fi case "${AUTO_INSTALLED_FILES}" in '') ;; @@ -1268,5 +1338,9 @@ case "${PRE_WORLD}" in ;; esac -exit 0 +if [ -n "${PRESERVE_FILES}" ]; then + find -d $PRESERVE_FILES_DIR -type d -empty -delete 2>/dev/null + rmdir $PRESERVE_FILES_DIR 2>/dev/null +fi +exit 0 From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 11:26:21 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 461F1106566B; Fri, 15 Jan 2010 11:26:21 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A2958FC08; Fri, 15 Jan 2010 11:26: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 o0FBQLC6056792; Fri, 15 Jan 2010 11:26:21 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FBQLcZ056785; Fri, 15 Jan 2010 11:26:21 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151126.o0FBQLcZ056785@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 11:26: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: r202343 - in stable/8/sys/boot: common pc98 pc98/libpc98 pc98/loader X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 11:26:21 -0000 Author: nyan Date: Fri Jan 15 11:26:20 2010 New Revision: 202343 URL: http://svn.freebsd.org/changeset/base/202343 Log: MFC: revision 201339 and 201340 - Add setting machine type support to the loader. - Don't use 15M-16M area on pc98. It's reserved for some devices. Added: stable/8/sys/boot/pc98/libpc98/libpc98.h - copied unchanged from r201339, head/sys/boot/pc98/libpc98/libpc98.h stable/8/sys/boot/pc98/libpc98/pc98_sys.c - copied unchanged from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c Modified: stable/8/sys/boot/common/module.c stable/8/sys/boot/pc98/Makefile.inc stable/8/sys/boot/pc98/libpc98/Makefile stable/8/sys/boot/pc98/loader/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) Modified: stable/8/sys/boot/common/module.c ============================================================================== --- stable/8/sys/boot/common/module.c Fri Jan 15 07:18:46 2010 (r202342) +++ stable/8/sys/boot/common/module.c Fri Jan 15 11:26:20 2010 (r202343) @@ -351,6 +351,9 @@ file_loadraw(char *type, char *name) char *cp; int fd, got; vm_offset_t laddr; +#ifdef PC98 + struct stat st; +#endif /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { @@ -372,6 +375,14 @@ file_loadraw(char *type, char *name) return(CMD_ERROR); } +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + if (loadaddr < 0x1000000 && + fstat(fd, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif + laddr = loadaddr; for (;;) { /* read in 4k chunks; size is not really important */ @@ -477,6 +488,14 @@ mod_loadkld(const char *kldname, int arg ; do { +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + struct stat st; + if (loadaddr < 0x1000000 && + stat(filename, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif err = file_load(filename, loadaddr, &fp); if (err) break; Modified: stable/8/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/8/sys/boot/pc98/Makefile.inc Fri Jan 15 07:18:46 2010 (r202342) +++ stable/8/sys/boot/pc98/Makefile.inc Fri Jan 15 11:26:20 2010 (r202343) @@ -7,7 +7,7 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -Os + -Os -DPC98 LDFLAGS+= -nostdlib # BTX components Modified: stable/8/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/8/sys/boot/pc98/libpc98/Makefile Fri Jan 15 07:18:46 2010 (r202342) +++ stable/8/sys/boot/pc98/libpc98/Makefile Fri Jan 15 11:26:20 2010 (r202343) @@ -8,7 +8,7 @@ INTERNALLIB= SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c \ comconsole.c devicename.c elf32_freebsd.c \ - i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ + i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c # Enable PXE TFTP or NFS support, not both. Copied: stable/8/sys/boot/pc98/libpc98/libpc98.h (from r201339, head/sys/boot/pc98/libpc98/libpc98.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/pc98/libpc98/libpc98.h Fri Jan 15 11:26:20 2010 (r202343, copy of r201339, head/sys/boot/pc98/libpc98/libpc98.h) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * 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$ + */ + +void set_machine_type(void); Copied: stable/8/sys/boot/pc98/libpc98/pc98_sys.c (from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/pc98/libpc98/pc98_sys.c Fri Jan 15 11:26:20 2010 (r202343, copy of r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#define _KERNEL +#include + +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +void +set_machine_type(void) +{ + int i; + u_long ret, data; + + /* PC98_SYSTEM_PARAMETER (0x501) */ + ret = ((*(u_char *)PTOV(0xA1501)) & 0x08) >> 3; + + /* Wait V-SYNC */ + while (inb(0x60) & 0x20) {} + while (!(inb(0x60) & 0x20)) {} + + /* ANK 'A' font */ + outb(0xa1, 0x00); + outb(0xa3, 0x41); + + /* M_NORMAL, use CG window (all NEC OK) */ + for (i = data = 0; i < 4; i++) + data += *((u_long *)PTOV(0xA4000) + i); /* 0xa4000 */ + if (data == 0x6efc58fc) /* DA data */ + ret |= M_NEC_PC98; + else + ret |= M_EPSON_PC98; + ret |= (inb(0x42) & 0x20) ? M_8M : 0; + + /* PC98_SYSTEM_PARAMETER(0x400) */ + if ((*(u_char *)PTOV(0xA1400)) & 0x80) + ret |= M_NOTE; + if (ret & M_NEC_PC98) { + /* PC98_SYSTEM_PARAMETER(0x458) */ + if ((*(u_char *)PTOV(0xA1458)) & 0x80) + ret |= M_H98; + else + ret |= M_NOT_H98; + } else + ret |= M_NOT_H98; + + (*(u_long *)PTOV(0xA1620)) = ret; +} Modified: stable/8/sys/boot/pc98/loader/main.c ============================================================================== --- stable/8/sys/boot/pc98/loader/main.c Fri Jan 15 07:18:46 2010 (r202342) +++ stable/8/sys/boot/pc98/loader/main.c Fri Jan 15 11:26:20 2010 (r202343) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386/libi386.h" +#include "libpc98/libpc98.h" #include "btxv86.h" #define KARGS_FLAGS_CD 0x1 @@ -81,6 +82,9 @@ main(void) { int i; + /* Set machine type to PC98_SYSTEM_PARAMETER. */ + set_machine_type(); + /* Pick up arguments */ kargs = (void *)__args; initial_howto = kargs->howto; From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 11:28:37 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 086C61065692; Fri, 15 Jan 2010 11:28:37 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8EC68FC13; Fri, 15 Jan 2010 11:28:36 +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 o0FBSa3n057343; Fri, 15 Jan 2010 11:28:36 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FBSa2X057336; Fri, 15 Jan 2010 11:28:36 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151128.o0FBSa2X057336@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 11:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202344 - in stable/7/sys/boot: common pc98 pc98/libpc98 pc98/loader X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 11:28:37 -0000 Author: nyan Date: Fri Jan 15 11:28:36 2010 New Revision: 202344 URL: http://svn.freebsd.org/changeset/base/202344 Log: MFC: revision 201339 and 201340 - Add setting machine type support to the loader. - Don't use 15M-16M area on pc98. It's reserved for some devices. Added: stable/7/sys/boot/pc98/libpc98/libpc98.h - copied unchanged from r201339, head/sys/boot/pc98/libpc98/libpc98.h stable/7/sys/boot/pc98/libpc98/pc98_sys.c - copied unchanged from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c Modified: stable/7/sys/boot/common/module.c stable/7/sys/boot/pc98/Makefile.inc stable/7/sys/boot/pc98/libpc98/Makefile stable/7/sys/boot/pc98/loader/main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/module.c ============================================================================== --- stable/7/sys/boot/common/module.c Fri Jan 15 11:26:20 2010 (r202343) +++ stable/7/sys/boot/common/module.c Fri Jan 15 11:28:36 2010 (r202344) @@ -313,6 +313,9 @@ file_loadraw(char *type, char *name) char *cp; int fd, got; vm_offset_t laddr; +#ifdef PC98 + struct stat st; +#endif /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { @@ -334,6 +337,14 @@ file_loadraw(char *type, char *name) return(CMD_ERROR); } +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + if (loadaddr < 0x1000000 && + fstat(fd, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif + laddr = loadaddr; for (;;) { /* read in 4k chunks; size is not really important */ @@ -439,6 +450,14 @@ mod_loadkld(const char *kldname, int arg ; do { +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + struct stat st; + if (loadaddr < 0x1000000 && + stat(filename, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif err = file_load(filename, loadaddr, &fp); if (err) break; Modified: stable/7/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/7/sys/boot/pc98/Makefile.inc Fri Jan 15 11:26:20 2010 (r202343) +++ stable/7/sys/boot/pc98/Makefile.inc Fri Jan 15 11:28:36 2010 (r202344) @@ -7,7 +7,7 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -Os + -Os -DPC98 LDFLAGS+= -nostdlib # BTX components Modified: stable/7/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/7/sys/boot/pc98/libpc98/Makefile Fri Jan 15 11:26:20 2010 (r202343) +++ stable/7/sys/boot/pc98/libpc98/Makefile Fri Jan 15 11:28:36 2010 (r202344) @@ -7,7 +7,7 @@ INTERNALLIB= SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c biospci.c biossmap.c \ bootinfo.c bootinfo32.c comconsole.c devicename.c elf32_freebsd.c \ - i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ + i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c BOOT_COMCONSOLE_PORT?= 0x238 Copied: stable/7/sys/boot/pc98/libpc98/libpc98.h (from r201339, head/sys/boot/pc98/libpc98/libpc98.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/pc98/libpc98/libpc98.h Fri Jan 15 11:28:36 2010 (r202344, copy of r201339, head/sys/boot/pc98/libpc98/libpc98.h) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * 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$ + */ + +void set_machine_type(void); Copied: stable/7/sys/boot/pc98/libpc98/pc98_sys.c (from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/pc98/libpc98/pc98_sys.c Fri Jan 15 11:28:36 2010 (r202344, copy of r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#define _KERNEL +#include + +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +void +set_machine_type(void) +{ + int i; + u_long ret, data; + + /* PC98_SYSTEM_PARAMETER (0x501) */ + ret = ((*(u_char *)PTOV(0xA1501)) & 0x08) >> 3; + + /* Wait V-SYNC */ + while (inb(0x60) & 0x20) {} + while (!(inb(0x60) & 0x20)) {} + + /* ANK 'A' font */ + outb(0xa1, 0x00); + outb(0xa3, 0x41); + + /* M_NORMAL, use CG window (all NEC OK) */ + for (i = data = 0; i < 4; i++) + data += *((u_long *)PTOV(0xA4000) + i); /* 0xa4000 */ + if (data == 0x6efc58fc) /* DA data */ + ret |= M_NEC_PC98; + else + ret |= M_EPSON_PC98; + ret |= (inb(0x42) & 0x20) ? M_8M : 0; + + /* PC98_SYSTEM_PARAMETER(0x400) */ + if ((*(u_char *)PTOV(0xA1400)) & 0x80) + ret |= M_NOTE; + if (ret & M_NEC_PC98) { + /* PC98_SYSTEM_PARAMETER(0x458) */ + if ((*(u_char *)PTOV(0xA1458)) & 0x80) + ret |= M_H98; + else + ret |= M_NOT_H98; + } else + ret |= M_NOT_H98; + + (*(u_long *)PTOV(0xA1620)) = ret; +} Modified: stable/7/sys/boot/pc98/loader/main.c ============================================================================== --- stable/7/sys/boot/pc98/loader/main.c Fri Jan 15 11:26:20 2010 (r202343) +++ stable/7/sys/boot/pc98/loader/main.c Fri Jan 15 11:28:36 2010 (r202344) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386/libi386.h" +#include "libpc98/libpc98.h" #include "btxv86.h" #define KARGS_FLAGS_CD 0x1 @@ -81,6 +82,9 @@ main(void) { int i; + /* Set machine type to PC98_SYSTEM_PARAMETER. */ + set_machine_type(); + /* Pick up arguments */ kargs = (void *)__args; initial_howto = kargs->howto; From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 11:32:52 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEA9106566C; Fri, 15 Jan 2010 11:32:52 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A828C8FC14; Fri, 15 Jan 2010 11:32:52 +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 o0FBWq6F058317; Fri, 15 Jan 2010 11:32:52 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FBWqmM058310; Fri, 15 Jan 2010 11:32:52 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151132.o0FBWqmM058310@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 11:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202345 - in stable/6/sys/boot: common pc98 pc98/libpc98 pc98/loader X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 11:32:52 -0000 Author: nyan Date: Fri Jan 15 11:32:52 2010 New Revision: 202345 URL: http://svn.freebsd.org/changeset/base/202345 Log: MFC: revision 201339 and 201340 - Add setting machine type support to the loader. - Don't use 15M-16M area on pc98. It's reserved for some devices. Added: stable/6/sys/boot/pc98/libpc98/libpc98.h - copied unchanged from r201339, head/sys/boot/pc98/libpc98/libpc98.h stable/6/sys/boot/pc98/libpc98/pc98_sys.c - copied unchanged from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c Modified: stable/6/sys/boot/common/module.c stable/6/sys/boot/pc98/Makefile.inc stable/6/sys/boot/pc98/libpc98/Makefile stable/6/sys/boot/pc98/loader/main.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/common/module.c ============================================================================== --- stable/6/sys/boot/common/module.c Fri Jan 15 11:28:36 2010 (r202344) +++ stable/6/sys/boot/common/module.c Fri Jan 15 11:32:52 2010 (r202345) @@ -313,6 +313,9 @@ file_loadraw(char *type, char *name) char *cp; int fd, got; vm_offset_t laddr; +#ifdef PC98 + struct stat st; +#endif /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { @@ -334,6 +337,14 @@ file_loadraw(char *type, char *name) return(CMD_ERROR); } +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + if (loadaddr < 0x1000000 && + fstat(fd, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif + laddr = loadaddr; for (;;) { /* read in 4k chunks; size is not really important */ @@ -439,6 +450,14 @@ mod_loadkld(const char *kldname, int arg ; do { +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + struct stat st; + if (loadaddr < 0x1000000 && + stat(filename, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif err = file_load(filename, loadaddr, &fp); if (err) break; Modified: stable/6/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/6/sys/boot/pc98/Makefile.inc Fri Jan 15 11:28:36 2010 (r202344) +++ stable/6/sys/boot/pc98/Makefile.inc Fri Jan 15 11:32:52 2010 (r202345) @@ -7,7 +7,7 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -Os + -Os -DPC98 LDFLAGS+= -nostdlib # BTX components Modified: stable/6/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/6/sys/boot/pc98/libpc98/Makefile Fri Jan 15 11:28:36 2010 (r202344) +++ stable/6/sys/boot/pc98/libpc98/Makefile Fri Jan 15 11:32:52 2010 (r202345) @@ -7,7 +7,7 @@ INTERNALLIB= SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c biospci.c biossmap.c \ bootinfo.c bootinfo32.c comconsole.c devicename.c elf32_freebsd.c \ - i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ + i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c BOOT_COMCONSOLE_PORT?= 0x238 Copied: stable/6/sys/boot/pc98/libpc98/libpc98.h (from r201339, head/sys/boot/pc98/libpc98/libpc98.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/6/sys/boot/pc98/libpc98/libpc98.h Fri Jan 15 11:32:52 2010 (r202345, copy of r201339, head/sys/boot/pc98/libpc98/libpc98.h) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * 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$ + */ + +void set_machine_type(void); Copied: stable/6/sys/boot/pc98/libpc98/pc98_sys.c (from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/6/sys/boot/pc98/libpc98/pc98_sys.c Fri Jan 15 11:32:52 2010 (r202345, copy of r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#define _KERNEL +#include + +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +void +set_machine_type(void) +{ + int i; + u_long ret, data; + + /* PC98_SYSTEM_PARAMETER (0x501) */ + ret = ((*(u_char *)PTOV(0xA1501)) & 0x08) >> 3; + + /* Wait V-SYNC */ + while (inb(0x60) & 0x20) {} + while (!(inb(0x60) & 0x20)) {} + + /* ANK 'A' font */ + outb(0xa1, 0x00); + outb(0xa3, 0x41); + + /* M_NORMAL, use CG window (all NEC OK) */ + for (i = data = 0; i < 4; i++) + data += *((u_long *)PTOV(0xA4000) + i); /* 0xa4000 */ + if (data == 0x6efc58fc) /* DA data */ + ret |= M_NEC_PC98; + else + ret |= M_EPSON_PC98; + ret |= (inb(0x42) & 0x20) ? M_8M : 0; + + /* PC98_SYSTEM_PARAMETER(0x400) */ + if ((*(u_char *)PTOV(0xA1400)) & 0x80) + ret |= M_NOTE; + if (ret & M_NEC_PC98) { + /* PC98_SYSTEM_PARAMETER(0x458) */ + if ((*(u_char *)PTOV(0xA1458)) & 0x80) + ret |= M_H98; + else + ret |= M_NOT_H98; + } else + ret |= M_NOT_H98; + + (*(u_long *)PTOV(0xA1620)) = ret; +} Modified: stable/6/sys/boot/pc98/loader/main.c ============================================================================== --- stable/6/sys/boot/pc98/loader/main.c Fri Jan 15 11:28:36 2010 (r202344) +++ stable/6/sys/boot/pc98/loader/main.c Fri Jan 15 11:32:52 2010 (r202345) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386/libi386.h" +#include "libpc98/libpc98.h" #include "btxv86.h" #define KARGS_FLAGS_CD 0x1 @@ -81,6 +82,9 @@ main(void) { int i; + /* Set machine type to PC98_SYSTEM_PARAMETER. */ + set_machine_type(); + /* Pick up arguments */ kargs = (void *)__args; initial_howto = kargs->howto; From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 12:02:22 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DEF41065676; Fri, 15 Jan 2010 12:02:22 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BC288FC1A; Fri, 15 Jan 2010 12:02: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 o0FC2MZg065069; Fri, 15 Jan 2010 12:02:22 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FC2MLi065067; Fri, 15 Jan 2010 12:02:22 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201001151202.o0FC2MLi065067@svn.freebsd.org> From: Dmitry Morozovsky Date: Fri, 15 Jan 2010 12:02: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: r202348 - stable/8/usr.sbin/ypserv X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:02:22 -0000 Author: marck (doc committer) Date: Fri Jan 15 12:02:22 2010 New Revision: 202348 URL: http://svn.freebsd.org/changeset/base/202348 Log: MFH r201051: To remove a server, one should use double backslash, and half of them are eaten by shell. Fix this. Modified: stable/8/usr.sbin/ypserv/ypinit.sh Directory Properties: stable/8/usr.sbin/ypserv/ (props changed) Modified: stable/8/usr.sbin/ypserv/ypinit.sh ============================================================================== --- stable/8/usr.sbin/ypserv/ypinit.sh Fri Jan 15 12:01:25 2010 (r202347) +++ stable/8/usr.sbin/ypserv/ypinit.sh Fri Jan 15 12:02:22 2010 (r202348) @@ -298,7 +298,7 @@ do echo "Update the list of hosts running YP servers in domain ${DOMAIN}." echo "Master for this domain is ${MASTER_NAME}." echo "" - echo "First verify old servers, type \\ to remove a server." + echo "First verify old servers, type \\\\ to remove a server." echo "Then add new servers, one per line. When done type a ." echo "" echo " master server : ${HOST}" From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 12:07:00 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BDC11065670; Fri, 15 Jan 2010 12:07:00 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 489078FC12; Fri, 15 Jan 2010 12:07: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 o0FC70DV066166; Fri, 15 Jan 2010 12:07:00 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FC704B066164; Fri, 15 Jan 2010 12:07:00 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201001151207.o0FC704B066164@svn.freebsd.org> From: Dmitry Morozovsky Date: Fri, 15 Jan 2010 12:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202349 - stable/7/usr.sbin/ypserv X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:07:00 -0000 Author: marck (doc committer) Date: Fri Jan 15 12:07:00 2010 New Revision: 202349 URL: http://svn.freebsd.org/changeset/base/202349 Log: MFH r201051: To remove a server, one should use double backslash, and half of them are eaten by shell. Fix this. Modified: stable/7/usr.sbin/ypserv/ypinit.sh Directory Properties: stable/7/usr.sbin/ypserv/ (props changed) Modified: stable/7/usr.sbin/ypserv/ypinit.sh ============================================================================== --- stable/7/usr.sbin/ypserv/ypinit.sh Fri Jan 15 12:02:22 2010 (r202348) +++ stable/7/usr.sbin/ypserv/ypinit.sh Fri Jan 15 12:07:00 2010 (r202349) @@ -298,7 +298,7 @@ do echo "Update the list of hosts running YP servers in domain ${DOMAIN}." echo "Master for this domain is ${MASTER_NAME}." echo "" - echo "First verify old servers, type \\ to remove a server." + echo "First verify old servers, type \\\\ to remove a server." echo "Then add new servers, one per line. When done type a ." echo "" echo " master server : ${HOST}" From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 12:07:30 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1F0B1065676; Fri, 15 Jan 2010 12:07:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE1E8FC15; Fri, 15 Jan 2010 12:07: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 o0FC7UQr066303; Fri, 15 Jan 2010 12:07:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FC7U4q066301; Fri, 15 Jan 2010 12:07:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151207.o0FC7U4q066301@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 12:07: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: r202350 - stable/8/sys/boot/sparc64/loader X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:07:30 -0000 Author: marius Date: Fri Jan 15 12:07:30 2010 New Revision: 202350 URL: http://svn.freebsd.org/changeset/base/202350 Log: MFC: r200944 Revert r183628 as with the current ata(4) ATAPI DMA with AcerLabs M5229 appears to be once again fixed. If this happens to return we probably should disable ATAPI DMA in ataacerlabs(4) instead just like the Linux libATA does. Modified: stable/8/sys/boot/sparc64/loader/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) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Fri Jan 15 12:07:00 2010 (r202349) +++ stable/8/sys/boot/sparc64/loader/main.c Fri Jan 15 12:07:30 2010 (r202350) @@ -261,7 +261,6 @@ static int sparc64_autoload(void) { - setenv("hw.ata.atapi_dma", "0", 0); return (0); } From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 12:27:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC0FC106566C; Fri, 15 Jan 2010 12:27:46 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7FE28FC1E; Fri, 15 Jan 2010 12:27: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 o0FCRkqY071045; Fri, 15 Jan 2010 12:27:46 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FCRkfj071041; Fri, 15 Jan 2010 12:27:46 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151227.o0FCRkfj071041@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 12:27: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: r202352 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:27:46 -0000 Author: nyan Date: Fri Jan 15 12:27:46 2010 New Revision: 202352 URL: http://svn.freebsd.org/changeset/base/202352 Log: MFC: revision 201342 Reimplement the boot2 for pc98 completely. It's based on the newest i386's one and has the advantage of: - ELF binary support. - UFS2 filesystem support. - Many FreeBSD slices support on a disk. Added: stable/8/sys/boot/pc98/boot2/boot1.S - copied unchanged from r201342, head/sys/boot/pc98/boot2/boot1.S stable/8/sys/boot/pc98/boot2/boot2.c - copied unchanged from r201342, head/sys/boot/pc98/boot2/boot2.c Deleted: stable/8/sys/boot/pc98/boot2/asm.S stable/8/sys/boot/pc98/boot2/asm.h stable/8/sys/boot/pc98/boot2/bios.S stable/8/sys/boot/pc98/boot2/boot.c stable/8/sys/boot/pc98/boot2/boot.h stable/8/sys/boot/pc98/boot2/boot2.S stable/8/sys/boot/pc98/boot2/dinode.h stable/8/sys/boot/pc98/boot2/disk.c stable/8/sys/boot/pc98/boot2/fs.h stable/8/sys/boot/pc98/boot2/inode.h stable/8/sys/boot/pc98/boot2/io.c stable/8/sys/boot/pc98/boot2/probe_keyboard.c stable/8/sys/boot/pc98/boot2/quota.h stable/8/sys/boot/pc98/boot2/serial.S stable/8/sys/boot/pc98/boot2/serial_16550.S stable/8/sys/boot/pc98/boot2/serial_8251.S stable/8/sys/boot/pc98/boot2/start.S stable/8/sys/boot/pc98/boot2/sys.c stable/8/sys/boot/pc98/boot2/table.c Modified: stable/8/sys/boot/pc98/boot2/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) Modified: stable/8/sys/boot/pc98/boot2/Makefile ============================================================================== --- stable/8/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:17:29 2010 (r202351) +++ stable/8/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:27:46 2010 (r202352) @@ -1,113 +1,104 @@ # $FreeBSD$ -# -PROG= boot -# Order is very important on the SRCS line for this prog -SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S -SRCS+= probe_keyboard.c io.c disk.c sys.c - -BINMODE= 444 -CFLAGS= -Os -mrtd \ - -fno-guess-branch-probability \ - -fno-unit-at-a-time \ - -D_KERNEL -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT} -CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK} -CFLAGS+= -I${.CURDIR}/../../.. -I. - -# By default, if a serial port is going to be used as console, use COM1 -# (aka /dev/ttyd0). -#BOOT_COMCONSOLE_PORT?=0x30 -BOOT_COMCONSOLE_PORT?=0x238 -BOOT_COMCONSOLE_CLK?=16 -BOOT_COMCONSOLE_MODE=0x0c -CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \ - -DCOMCONSOLE_CLK=${BOOT_COMCONSOLE_CLK} \ - -DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE} - -# feature not implemented -BOOT_COMCONSOLE_SPEED?=9600 -CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} - -# Enable code to take the default boot string from a fixed location on the -# disk. See nextboot(8) and README.386BSD for more info. -#CFLAGS+= -DNAMEBLOCK -#CFLAGS+= -DNAMEBLOCK_WRITEBACK - -# Bias the conversion from the BIOS drive number to the FreeBSD unit number -# for hard disks. This may be useful for people booting in a mixed IDE/SCSI -# environment (set BOOT_HD_BIAS to the number of IDE drives). -#CFLAGS+= -DBOOT_HD_BIAS=1 -# -# Details: this only applies if BOOT_HD_BIAS > 0. If the BIOS drive number -# for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to -# be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS). E.g., -# BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:da(0,a) instead of -# 1:wd(1,a). If `da' is given explicitly, then the drive is assumed to be -# SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS). E.g., -# BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a). - -CLEANFILES+= boot.nohdr boot.strip boot.ldr boot1 boot2 sizetest -LDFLAGS+= -N -Ttext 0 -e start -NO_SHARED= YES -NO_MAN= -STRIP= - -# tunable timeout parameter, waiting for keypress, calibrated in ms -BOOTWAIT?= 5000 -# tunable timeout during string input, calibrated in ms -#TIMEOUT?= 30000 - -# Location that boot2 is loaded at -BOOTSEG= 0x1000 - -# Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned -BOOTSTACK= 0xFFF0 - -boot.nohdr: boot - objcopy -S -O binary boot boot.nohdr - ls -l boot.nohdr - -boot.ldr: boot.nohdr - dd if=boot.nohdr of=boot.ldr bs=8192 count=1 conv=sync - -boot1: boot.nohdr - dd if=boot.nohdr of=boot1 bs=512 count=1 - -boot2: boot.nohdr - dd if=boot.nohdr of=boot2 bs=512 skip=1 - @dd if=boot2 skip=14 of=sizetest 2> /dev/null - @if [ -s sizetest ] ; then \ - echo "boot2 is too big" >&2 ; \ - rm boot2 ; \ - exit 2 ; \ - fi - -all: boot.ldr boot1 boot2 - -install: - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - boot.ldr ${DESTDIR}${BINDIR}/boot - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - boot1 boot2 ${DESTDIR}${BINDIR} - -# If it's not there, don't consider it a target -.if exists(${.CURDIR}/../../../pc98/include) -beforedepend ${OBJS}: machine - -machine: - ln -sf ${.CURDIR}/../../../pc98/include machine - -.endif - -.if exists(${.CURDIR}/../../../i386/include) -beforedepend ${OBJS}: i386 +FILES= boot boot1 boot2 -i386: - ln -sf ${.CURDIR}/../../../i386/include i386 +NM?= nm -.endif +BOOT_COMCONSOLE_PORT?= 0x238 +BOOT_COMCONSOLE_SPEED?= 9600 +B2SIOFMT?= 0x3 + +REL1= 0x700 +ORG1= 0 +ORG2= 0x2000 + +# Decide level of UFS support. +BOOT2_UFS?= UFS1_AND_UFS2 +#BOOT2_UFS?= UFS2_ONLY +#BOOT2_UFS?= UFS1_ONLY + +CFLAGS= -Os \ + -fno-guess-branch-probability \ + -fomit-frame-pointer \ + -fno-unit-at-a-time \ + -mno-align-long-strings \ + -mrtd \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ + -D${BOOT2_UFS} \ + -DFLAGS=${BOOT_BOOT1_FLAGS} \ + -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ + -DSIOFMT=${B2SIOFMT} \ + -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ + -I${.CURDIR}/../../.. \ + -I${.CURDIR}/../../i386/boot2 \ + -I${.CURDIR}/../../common \ + -I${.CURDIR}/../btx/lib -I. \ + -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ + -Winline --param max-inline-insns-single=100 + +# Set machine type to PC98_SYSTEM_PARAMETER +#CFLAGS+= -DSET_MACHINE_TYPE + +# Initialize the bi_bios_geom using the BIOS geometry +#CFLAGS+= -DGET_BIOSGEOM + +LDFLAGS=-static -N --gc-sections + +# Pick up ../Makefile.inc early. +.include + +.PATH: ${.CURDIR}/../../i386/boot2 + +CLEANFILES= boot + +boot: boot1 boot2 + cat boot1 boot2 > boot + +CLEANFILES+= boot1 boot1.out boot1.o + +boot1: boot1.out + objcopy -S -O binary boot1.out ${.TARGET} + +boot1.out: boot1.o + ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o + +CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ + boot2.s boot2.s.tmp boot2.h sio.o + +boot2: boot2.ld + @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 + dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync + +boot2.ld: boot2.ldr boot2.bin ${BTXKERN} + btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ + -o ${.TARGET} -P 1 boot2.bin + +boot2.ldr: + dd if=/dev/zero of=${.TARGET} bs=276 count=1 + +boot2.bin: boot2.out + objcopy -S -O binary boot2.out ${.TARGET} + +boot2.out: ${BTXCRT} boot2.o sio.o + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} + +boot2.o: boot2.s + +SRCS= boot2.c boot2.h + +boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c + ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c + sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s + rm -f boot2.s.tmp + +boot2.h: boot1.out + ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T (read|putc)/ \ + { x = $$1 - ORG1; \ + printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \ + ORG1=`printf "%d" ${ORG1}` \ + REL1=`printf "%d" ${REL1}` > ${.TARGET} -CLEANFILES+= machine i386 - -CWARNFLAGS!= ${MAKE} -f bsd.own.mk -f ${.CURDIR}/../../../conf/kern.mk -V CWARNFLAGS .include Copied: stable/8/sys/boot/pc98/boot2/boot1.S (from r201342, head/sys/boot/pc98/boot2/boot1.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/pc98/boot2/boot1.S Fri Jan 15 12:27:46 2010 (r202352, copy of r201342, head/sys/boot/pc98/boot2/boot1.S) @@ -0,0 +1,395 @@ +/*- + * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro + * 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$ + */ + +/* Memory Locations */ + .set STACK_OFF,0x6000 # Stack offset + .set LOAD_SIZE,8192 # Load size + .set DAUA,0x0584 # DA/UA + .set MEM_REL,0x700 # Relocation address + .set MEM_ARG,0x900 # Arguments + .set MEM_BUF,0x8cec # Load area + .set MEM_BTX,0x9000 # BTX start + .set MEM_JMP,0x9010 # BTX entry point + .set MEM_USR,0xa000 # Client start + +/* PC98 machine type from sys/pc98/pc98/pc98_machdep.h */ + .set MEM_SYS, 0xa100 # System common area segment + .set PC98_MACHINE_TYPE, 0x0620 # PC98 machine type + .set EPSON_ID, 0x0624 # EPSON machine id + + .set M_NEC_PC98, 0x0001 + .set M_EPSON_PC98, 0x0002 + .set M_NOT_H98, 0x0010 + .set M_H98, 0x0020 + .set M_NOTE, 0x0040 + .set M_NORMAL, 0x1000 + .set M_8M, 0x8000 + +/* Partition Constants */ + .set PRT_OFF,0x1be # Partition offset + +/* Misc. Constants */ + .set SIZ_PAG,0x1000 # Page size + .set SIZ_SEC,0x200 # Sector size + + .set NSECT,0x10 + + .globl start + .globl read + .globl putc + .code16 + +start: jmp main + +boot_cyl: .org 4 + .ascii "IPL1 " + +main: cld + + /* Setup the stack */ + xor %si,%si + mov %si,%ss + mov $STACK_OFF,%sp + + push %cx + + /* Relocate ourself to MEM_REL */ + push %cs + pop %ds + mov %si,%es + mov $MEM_REL,%di + mov $SIZ_SEC,%cx + rep + movsb + + /* Transfer PC-9801 system common area */ + xor %ax,%ax + mov %ax,%si + mov %ax,%ds + mov %ax,%di + mov $MEM_SYS,%ax + mov %ax,%es + mov $0x0600,%cx + rep + movsb + + /* Transfer EPSON machine type */ + mov $0xfd00,%ax + mov %ax,%ds + mov (0x804),%eax + and $0x00ffffff,%eax + mov %eax,%es:(EPSON_ID) + + /* Set machine type to PC98_SYSTEM_PARAMETER */ +#ifdef SET_MACHINE_TYPE + call set_machine_type +#else + mov $M_NEC_PC98+M_NOT_H98,%eax + mov %eax,%es:(PC98_MACHINE_TYPE) +#endif + + /* Setup graphic screen */ + mov $0x42,%ah /* 640x400 */ + mov $0xc0,%ch + int $0x18 + mov $0x40,%ah /* graph on */ + int $0x18 + + /* Setup text screen */ + mov $0x0a00,%ax /* 80x25 */ + int $0x18 + mov $0x0c,%ah /* text on */ + int $0x18 + mov $0x13,%ah /* cursor home */ + xor %dx,%dx + int $0x18 + mov $0x11,%ah /* cursor on */ + int $0x18 + + /* Setup keyboard */ + mov $0x03,%ah + int $0x18 + + pop %cx + + /* bootstrap passes */ + xor %edi,%edi + mov %di,%ds + mov %di,%es + mov %cs,%bx + cmp $0x1fe0,%bx + jz boot_fd + cmp $0x1fc0,%bx + jnz boot_hd + xor %cx,%cx + mov (DAUA),%al + and $0xf0,%al + cmp $0x30,%al + jz boot_fd + cmp $0x90,%al + jnz boot_hd +boot_fd: xor %cx,%cx + jmp boot_load +boot_hd: test %cx,%cx + jnz boot_load + mov %cs:(boot_cyl),%cx +boot_load: mov %cx,MEM_ARG /* Save cylinder number */ + mov %cx,%di + xor %dx,%dx + mov $LOAD_SIZE,%bx + mov $MEM_BUF,%bp + push %cs + callw read + jc error + + /* Transfer boot2.bin */ + mov $MEM_BTX,%bx + mov 0xa(%bx),%si /* BTX size */ + add %bx,%si /* start of boot2.bin */ + mov $MEM_USR+SIZ_PAG*2,%di + mov $MEM_BTX+(NSECT-1)*SIZ_SEC,%cx + sub %si,%cx + rep + movsb + + /* Enable A20 */ + xor %ax,%ax + outb %al,$0xf2 + mov $0x02,%al + outb %al,$0xf6 + + /* Start BTX */ + ljmp $0x0000,$MEM_JMP + +/* + * Reads sectors from the disk. + * Call with: + * + * %bx - bytes to read + * %cx - cylinder + * %dh - head + * %dl - sector + * %edi - lba + * %es:(%bp) - buffer to read data into + */ +read: xor %ax,%ax + mov %ax,%ds + mov $0x06,%ah + mov (DAUA),%al + mov %ax,%si + and $0xf0,%al + cmp $0x30,%al /* 1.44MB FDD */ + jz read_fd + cmp $0x90,%al /* 1MB FDD */ + jz read_fd + cmp $0xa0,%al /* Is SCSI device? */ + jnz read_load + push %cx + mov %si,%cx + and $0x0f,%cl + inc %cl + mov (0x482),%ah + shr %cl,%ah /* Is SCSI HDD? */ + pop %cx + jc read_load + and $0xff7f,%si /* SCSI MO */ + mov %di,%cx + shr $16,%di + mov %di,%dx + jmp read_load +read_fd: or $0xd000,%si + or $0x0200,%cx + inc %dx +read_load: mov %si,%ax + int $0x1b + lret + +/* + * Print out the error message, wait for a keypress, and then reboot + * the machine. + */ +error: push %cs + pop %ds + mov $msg_eread,%si + call putstr + xor %ax,%ax /* Get keypress */ + int $0x18 + xor %ax,%ax /* CPU reset */ + outb %al,$0xf0 +halt: hlt + jmp halt /* Spin */ + +/* + * Display a null-terminated string. + */ +putstr.0: push %cs + callw putc +putstr: lodsb + test %al,%al + jne putstr.0 + ret + +/* + * Display a single char. + */ +putc: pusha + xor %dx,%dx + mov %dx,%ds + mov MEM_REL+cursor-start,%di + mov $0xa000,%bx + mov %bx,%es + mov $(80*2),%cx + + cmp $0x08,%al + je putc.bs + cmp $0x0d,%al + je putc.cr + cmp $0x0a,%al + je putc.lf + cmp $0x5c,%al /* \ */ + jne 1f + mov $0xfc,%al +1: movb $0xe1,%es:0x2000(%di) + stosw + jmp putc.scr +putc.bs: test %di,%di + jz putc.move + dec %di + dec %di + movb $0xe1,%es:0x2000(%di) + movw $0x20,%es:(%di) + jmp putc.move +putc.cr: mov %di,%ax + div %cx + sub %dx,%di + jmp putc.move +putc.lf: add %cx,%di +putc.scr: cmp $(80*2*25),%di /* Scroll screen */ + jb putc.move + push %ds + mov %bx,%ds + mov $(80*2),%si + xor %di,%di + mov $(80*24/2),%cx + rep + movsl + xor %ax,%ax + mov $0x20,%al + mov $80,%cl + rep + stosw + pop %ds + mov $(80*24*2),%di +putc.move: mov %di,MEM_REL+cursor-start /* Move cursor */ + mov $0x13,%ah + mov %di,%dx + int $0x18 + popa + lret + +cursor: .word 0 + +#ifdef SET_MACHINE_TYPE +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +set_machine_type: + xor %edx,%edx + mov %dx,%ds +// mov $MEM_SYS,%ax +// mov %ax,%es + + /* Wait V-SYNC */ +vsync.1: inb $0x60,%al + test $0x20,%al + jnz vsync.1 +vsync.2: inb $0x60,%al + test $0x20,%al + jz vsync.2 + + /* ANK 'A' font */ + xor %al,%al + outb %al,$0xa1 + mov $0x41,%al + outb %al,$0xa3 + + /* Get 'A' font from CG window */ + push %ds + mov $0xa400,%ax + mov %ax,%ds + xor %eax,%eax + xor %bx,%bx + mov $4,%cx +font.1: add (%bx),%eax + add $4,%bx + loop font.1 + pop %ds + cmp $0x6efc58fc,%eax + jnz m_epson + +m_pc98: or $M_NEC_PC98,%edx + mov $0x0458,%bx + mov (%bx),%al + test $0x80,%al + jz m_not_h98 + or $M_H98,%edx + jmp 1f +m_epson: or $M_EPSON_PC98,%edx +m_not_h98: or $M_NOT_H98,%edx + +1: inb $0x42,%al + test $0x20,%al + jz 1f + or $M_8M,%edx + +1: mov $0x0400,%bx + mov (%bx),%al + test $0x80,%al + jz 1f + or $M_NOTE,%edx + +1: mov $PC98_MACHINE_TYPE,%bx + mov %edx,%es:(%bx) + ret +#endif + +/* Messages */ + +msg_eread: .asciz "Error\r\n" + + .org PRT_OFF,0x90 + +/* Partition table */ + + .fill 0x30,0x1,0x0 + .byte 0x80, 0x00, 0x01, 0x00 + .byte 0xa5, 0xff, 0xff, 0xff + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x50, 0xc3, 0x00, 0x00 + + .word 0xaa55 # Magic number Copied: stable/8/sys/boot/pc98/boot2/boot2.c (from r201342, head/sys/boot/pc98/boot2/boot2.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/pc98/boot2/boot2.c Fri Jan 15 12:27:46 2010 (r202352, copy of r201342, head/sys/boot/pc98/boot2/boot2.c) @@ -0,0 +1,842 @@ +/*- + * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#include "boot2.h" +#include "lib.h" + +#define IO_KEYBOARD 1 +#define IO_SERIAL 2 + +#define SECOND 1 /* Circa that many ticks in a second. */ + +#define RBX_ASKNAME 0x0 /* -a */ +#define RBX_SINGLE 0x1 /* -s */ +/* 0x2 is reserved for log2(RB_NOSYNC). */ +/* 0x3 is reserved for log2(RB_HALT). */ +/* 0x4 is reserved for log2(RB_INITNAME). */ +#define RBX_DFLTROOT 0x5 /* -r */ +#define RBX_KDB 0x6 /* -d */ +/* 0x7 is reserved for log2(RB_RDONLY). */ +/* 0x8 is reserved for log2(RB_DUMP). */ +/* 0x9 is reserved for log2(RB_MINIROOT). */ +#define RBX_CONFIG 0xa /* -c */ +#define RBX_VERBOSE 0xb /* -v */ +#define RBX_SERIAL 0xc /* -h */ +#define RBX_CDROM 0xd /* -C */ +/* 0xe is reserved for log2(RB_POWEROFF). */ +#define RBX_GDB 0xf /* -g */ +#define RBX_MUTE 0x10 /* -m */ +/* 0x11 is reserved for log2(RB_SELFTEST). */ +/* 0x12 is reserved for boot programs. */ +/* 0x13 is reserved for boot programs. */ +#define RBX_PAUSE 0x14 /* -p */ +#define RBX_QUIET 0x15 /* -q */ +#define RBX_NOINTR 0x1c /* -n */ +/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ +#define RBX_DUAL 0x1d /* -D */ +/* 0x1f is reserved for log2(RB_BOOTINFO). */ + +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ + OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ + OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ + OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + +#define PATH_CONFIG "/boot.config" +#define PATH_BOOT3 "/boot/loader" +#define PATH_KERNEL "/boot/kernel/kernel" + +#define ARGS 0x900 +#define NOPT 14 +#define NDEV 3 +#define V86_CY(x) ((x) & PSL_C) +#define V86_ZR(x) ((x) & PSL_Z) + +#define DRV_DISK 0xf0 +#define DRV_UNIT 0x0f + +#define TYPE_AD 0 +#define TYPE_DA 1 +#define TYPE_FD 2 + +#define OPT_SET(opt) (1 << (opt)) +#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) + +extern uint32_t _end; + +static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ +static const unsigned char flags[NOPT] = { + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE +}; + +static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; +static const unsigned char dev_maj[NDEV] = {30, 4, 2}; +static const unsigned char dev_daua[NDEV] = {0x80, 0xa0, 0x90}; + +static struct dsk { + unsigned daua; + unsigned type; + unsigned disk; + unsigned unit; + unsigned head; + unsigned sec; + unsigned slice; + unsigned part; + unsigned start; +} dsk; +static char cmd[512], cmddup[512]; +static char kname[1024]; +static uint32_t opts; +static int comspeed = SIOSPD; +static struct bootinfo bootinfo; +static uint8_t ioctrl = IO_KEYBOARD; + +void exit(int); +static void load(void); +static int parse(void); +static int xfsread(ino_t, void *, size_t); +static int dskread(void *, unsigned, unsigned); +static void printf(const char *,...); +static void putchar(int); +static uint32_t memsize(void); +static int drvread(void *, unsigned); +static int keyhit(unsigned); +static int xputc(int); +static int xgetc(int); +static int getc(int); + +static void memcpy(void *, const void *, int); +static void +memcpy(void *dst, const void *src, int len) +{ + const char *s = src; + char *d = dst; + + while (len--) + *d++ = *s++; +} + +static inline int +strcmp(const char *s1, const char *s2) +{ + for (; *s1 == *s2 && *s1; s1++, s2++); + return (unsigned char)*s1 - (unsigned char)*s2; +} + +#define UFS_SMALL_CGBASE +#include "ufsread.c" + +static inline int +xfsread(ino_t inode, void *buf, size_t nbyte) +{ + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return -1; + } + return 0; +} + +static inline uint32_t +memsize(void) +{ + u_char *p = (u_char *)PTOV(0); + + return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; +} + +static inline void +getstr(void) +{ + char *s; + int c; + + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } + } +} + +static inline void +putc(int c) +{ + + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = PUTCORG; /* call to putc in boot1 */ + v86.eax = c; + v86int(); + v86.ctl = V86_FLAGS; +} + +static inline int +is_scsi_hd(void) +{ + + if ((*(u_char *)PTOV(0x482) >> dsk.unit) & 0x01) + return 1; + + return 0; +} + +static inline void +fix_sector_size(void) +{ + u_char *p; + + p = (u_char *)PTOV(0x460 + dsk.unit * 4); /* SCSI equipment parameter */ + + if ((p[0] & 0x1f) == 7) { /* SCSI MO */ + if (!(p[3] & 0x30)) { /* 256B / sector */ + p[3] |= 0x10; /* forced set 512B / sector */ + p[3 + 0xa1000] |= 0x10; + } + } +} + +static inline uint32_t +get_diskinfo(void) +{ + + if (dsk.disk == 0x30) { /* 1440KB FD */ + /* 80 cylinders, 2 heads, 18 sectors */ + return (80 << 16) | (2 << 8) | 18; + } else if (dsk.disk == 0x90) { /* 1200KB FD */ + /* 80 cylinders, 2 heads, 15 sectors */ + return (80 << 16) | (2 << 8) | 15; + } else if (dsk.disk == 0x80 || is_scsi_hd()) { /* IDE or SCSI HDD */ + v86.addr = 0x1b; + v86.eax = 0x8400 | dsk.daua; + v86int(); + return (v86.ecx << 16) | v86.edx; + } + + /* SCSI MO or CD */ + fix_sector_size(); /* SCSI MO */ + + /* other SCSI devices */ + return (65535 << 16) | (8 << 8) | 32; +} + +static void +set_dsk(void) +{ + uint32_t di; + + di = get_diskinfo(); + + dsk.head = (di >> 8) & 0xff; + dsk.sec = di & 0xff; + dsk.start = 0; +} + +#ifdef GET_BIOSGEOM +static uint32_t +bd_getbigeom(int bunit) +{ + int hds = 0; + int unit = 0x80; /* IDE HDD */ + u_int addr = 0x55d; + + while (unit < 0xa7) { + if (*(u_char *)PTOV(addr) & (1 << (unit & 0x0f))) + if (hds++ == bunit) + break; + + if (unit >= 0xA0) { + int media = ((unsigned *)PTOV(0x460))[unit & 0x0F] & 0x1F; + + if (media == 7 && hds++ == bunit) /* SCSI MO */ + return(0xFFFE0820); /* C:65535 H:8 S:32 */ + } + if (++unit == 0x84) { + unit = 0xA0; /* SCSI HDD */ + addr = 0x482; + } + } + if (unit == 0xa7) + return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ + v86.addr = 0x1b; + v86.eax = 0x8400 | unit; + v86int(); + if (v86.efl & 0x1) + return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ + return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff); +} +#endif + +static int +check_slice(void) +{ + struct pc98_partition *dp; + char *sec; + unsigned i, cyl; + + sec = dmadat->secbuf; + cyl = *(uint16_t *)PTOV(ARGS); + set_dsk(); + + if (dsk.type == TYPE_FD) + return (WHOLE_DISK_SLICE); + if (drvread(sec, DOSBBSECTOR + 1)) + return (WHOLE_DISK_SLICE); /* Read error */ + dp = (void *)(sec + DOSPARTOFF); + for (i = 0; i < NDOSPART; i++) { + if (dp[i].dp_mid == DOSMID_386BSD) { + if (dp[i].dp_scyl <= cyl && cyl <= dp[i].dp_ecyl) + return (BASE_SLICE + i); + } + } + + return (WHOLE_DISK_SLICE); +} + +int +main(void) +{ +#ifdef GET_BIOSGEOM + int i; +#endif + int autoboot; + ino_t ino; + + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.daua = *(uint8_t *)PTOV(0x584); + dsk.disk = dsk.daua & DRV_DISK; + dsk.unit = dsk.daua & DRV_UNIT; + if (dsk.disk == 0x80) + dsk.type = TYPE_AD; + else if (dsk.disk == 0xa0) + dsk.type = TYPE_DA; + else /* if (dsk.disk == 0x30 || dsk.disk == 0x90) */ + dsk.type = TYPE_FD; + dsk.slice = check_slice(); +#ifdef GET_BIOSGEOM + for (i = 0; i < N_BIOS_GEOM; i++) + bootinfo.bi_bios_geom[i] = bd_getbigeom(i); +#endif + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 12:45:23 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE793106566B; Fri, 15 Jan 2010 12:45:23 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 981278FC14; Fri, 15 Jan 2010 12:45:23 +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 o0FCjNxn075140; Fri, 15 Jan 2010 12:45:23 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FCjNqq075136; Fri, 15 Jan 2010 12:45:23 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151245.o0FCjNqq075136@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 12:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202355 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:45:23 -0000 Author: nyan Date: Fri Jan 15 12:45:23 2010 New Revision: 202355 URL: http://svn.freebsd.org/changeset/base/202355 Log: MFC: revision 201342 Reimplement the boot2 for pc98 completely. It's based on the newest i386's one and has the advantage of: - ELF binary support. - UFS2 filesystem support. - Many FreeBSD slices support on a disk. Added: stable/7/sys/boot/pc98/boot2/boot1.S - copied unchanged from r201342, head/sys/boot/pc98/boot2/boot1.S stable/7/sys/boot/pc98/boot2/boot2.c - copied unchanged from r201342, head/sys/boot/pc98/boot2/boot2.c Deleted: stable/7/sys/boot/pc98/boot2/asm.S stable/7/sys/boot/pc98/boot2/asm.h stable/7/sys/boot/pc98/boot2/bios.S stable/7/sys/boot/pc98/boot2/boot.c stable/7/sys/boot/pc98/boot2/boot.h stable/7/sys/boot/pc98/boot2/boot2.S stable/7/sys/boot/pc98/boot2/dinode.h stable/7/sys/boot/pc98/boot2/disk.c stable/7/sys/boot/pc98/boot2/fs.h stable/7/sys/boot/pc98/boot2/inode.h stable/7/sys/boot/pc98/boot2/io.c stable/7/sys/boot/pc98/boot2/probe_keyboard.c stable/7/sys/boot/pc98/boot2/quota.h stable/7/sys/boot/pc98/boot2/serial.S stable/7/sys/boot/pc98/boot2/serial_16550.S stable/7/sys/boot/pc98/boot2/serial_8251.S stable/7/sys/boot/pc98/boot2/start.S stable/7/sys/boot/pc98/boot2/sys.c stable/7/sys/boot/pc98/boot2/table.c Modified: stable/7/sys/boot/pc98/boot2/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/Makefile ============================================================================== --- stable/7/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:42:35 2010 (r202354) +++ stable/7/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:45:23 2010 (r202355) @@ -1,114 +1,104 @@ # $FreeBSD$ -# -PROG= boot -# Order is very important on the SRCS line for this prog -SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S -SRCS+= probe_keyboard.c io.c disk.c sys.c - -BINMODE= 444 -CFLAGS= -Os -mrtd \ - -fno-guess-branch-probability \ - -fno-unit-at-a-time \ - -D_KERNEL -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT} -CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK} -CFLAGS+= ${CWARNFLAGS} -CFLAGS+= -I${.CURDIR}/../../.. -I. - -# By default, if a serial port is going to be used as console, use COM1 -# (aka /dev/ttyd0). -#BOOT_COMCONSOLE_PORT?=0x30 -BOOT_COMCONSOLE_PORT?=0x238 -BOOT_COMCONSOLE_CLK?=16 -BOOT_COMCONSOLE_MODE=0x0c -CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \ - -DCOMCONSOLE_CLK=${BOOT_COMCONSOLE_CLK} \ - -DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE} - -# feature not implemented -BOOT_COMCONSOLE_SPEED?=9600 -CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} - -# Enable code to take the default boot string from a fixed location on the -# disk. See nextboot(8) and README.386BSD for more info. -#CFLAGS+= -DNAMEBLOCK -#CFLAGS+= -DNAMEBLOCK_WRITEBACK - -# Bias the conversion from the BIOS drive number to the FreeBSD unit number -# for hard disks. This may be useful for people booting in a mixed IDE/SCSI -# environment (set BOOT_HD_BIAS to the number of IDE drives). -#CFLAGS+= -DBOOT_HD_BIAS=1 -# -# Details: this only applies if BOOT_HD_BIAS > 0. If the BIOS drive number -# for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to -# be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS). E.g., -# BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:da(0,a) instead of -# 1:wd(1,a). If `da' is given explicitly, then the drive is assumed to be -# SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS). E.g., -# BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a). - -CLEANFILES+= boot.nohdr boot.strip boot.ldr boot1 boot2 sizetest -LDFLAGS+= -N -Ttext 0 -e start -NO_SHARED= YES -NO_MAN= -STRIP= - -# tunable timeout parameter, waiting for keypress, calibrated in ms -BOOTWAIT?= 5000 -# tunable timeout during string input, calibrated in ms -#TIMEOUT?= 30000 - -# Location that boot2 is loaded at -BOOTSEG= 0x1000 - -# Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned -BOOTSTACK= 0xFFF0 - -boot.nohdr: boot - objcopy -S -O binary boot boot.nohdr - ls -l boot.nohdr - -boot.ldr: boot.nohdr - dd if=boot.nohdr of=boot.ldr bs=8192 count=1 conv=sync - -boot1: boot.nohdr - dd if=boot.nohdr of=boot1 bs=512 count=1 - -boot2: boot.nohdr - dd if=boot.nohdr of=boot2 bs=512 skip=1 - @dd if=boot2 skip=14 of=sizetest 2> /dev/null - @if [ -s sizetest ] ; then \ - echo "boot2 is too big" >&2 ; \ - rm boot2 ; \ - exit 2 ; \ - fi - -all: boot.ldr boot1 boot2 - -install: - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - boot.ldr ${DESTDIR}${BINDIR}/boot - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - boot1 boot2 ${DESTDIR}${BINDIR} - -# If it's not there, don't consider it a target -.if exists(${.CURDIR}/../../../pc98/include) -beforedepend ${OBJS}: machine - -machine: - ln -sf ${.CURDIR}/../../../pc98/include machine - -.endif - -.if exists(${.CURDIR}/../../../i386/include) -beforedepend ${OBJS}: i386 +FILES= boot boot1 boot2 -i386: - ln -sf ${.CURDIR}/../../../i386/include i386 +NM?= nm -.endif +BOOT_COMCONSOLE_PORT?= 0x238 +BOOT_COMCONSOLE_SPEED?= 9600 +B2SIOFMT?= 0x3 + +REL1= 0x700 +ORG1= 0 +ORG2= 0x2000 + +# Decide level of UFS support. +BOOT2_UFS?= UFS1_AND_UFS2 +#BOOT2_UFS?= UFS2_ONLY +#BOOT2_UFS?= UFS1_ONLY + +CFLAGS= -Os \ + -fno-guess-branch-probability \ + -fomit-frame-pointer \ + -fno-unit-at-a-time \ + -mno-align-long-strings \ + -mrtd \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ + -D${BOOT2_UFS} \ + -DFLAGS=${BOOT_BOOT1_FLAGS} \ + -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ + -DSIOFMT=${B2SIOFMT} \ + -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ + -I${.CURDIR}/../../.. \ + -I${.CURDIR}/../../i386/boot2 \ + -I${.CURDIR}/../../common \ + -I${.CURDIR}/../btx/lib -I. \ + -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ + -Winline --param max-inline-insns-single=100 + +# Set machine type to PC98_SYSTEM_PARAMETER +#CFLAGS+= -DSET_MACHINE_TYPE + +# Initialize the bi_bios_geom using the BIOS geometry +#CFLAGS+= -DGET_BIOSGEOM + +LDFLAGS=-static -N --gc-sections + +# Pick up ../Makefile.inc early. +.include + +.PATH: ${.CURDIR}/../../i386/boot2 + +CLEANFILES= boot + +boot: boot1 boot2 + cat boot1 boot2 > boot + +CLEANFILES+= boot1 boot1.out boot1.o + +boot1: boot1.out + objcopy -S -O binary boot1.out ${.TARGET} + +boot1.out: boot1.o + ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o + +CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ + boot2.s boot2.s.tmp boot2.h sio.o + +boot2: boot2.ld + @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 + dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync + +boot2.ld: boot2.ldr boot2.bin ${BTXKERN} + btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ + -o ${.TARGET} -P 1 boot2.bin + +boot2.ldr: + dd if=/dev/zero of=${.TARGET} bs=276 count=1 + +boot2.bin: boot2.out + objcopy -S -O binary boot2.out ${.TARGET} + +boot2.out: ${BTXCRT} boot2.o sio.o + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} + +boot2.o: boot2.s + +SRCS= boot2.c boot2.h + +boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c + ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c + sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s + rm -f boot2.s.tmp + +boot2.h: boot1.out + ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T (read|putc)/ \ + { x = $$1 - ORG1; \ + printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \ + ORG1=`printf "%d" ${ORG1}` \ + REL1=`printf "%d" ${REL1}` > ${.TARGET} -CLEANFILES+= machine i386 - -.include "${.CURDIR}/../../../conf/kern.mk" .include Copied: stable/7/sys/boot/pc98/boot2/boot1.S (from r201342, head/sys/boot/pc98/boot2/boot1.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/pc98/boot2/boot1.S Fri Jan 15 12:45:23 2010 (r202355, copy of r201342, head/sys/boot/pc98/boot2/boot1.S) @@ -0,0 +1,395 @@ +/*- + * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro + * 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$ + */ + +/* Memory Locations */ + .set STACK_OFF,0x6000 # Stack offset + .set LOAD_SIZE,8192 # Load size + .set DAUA,0x0584 # DA/UA + .set MEM_REL,0x700 # Relocation address + .set MEM_ARG,0x900 # Arguments + .set MEM_BUF,0x8cec # Load area + .set MEM_BTX,0x9000 # BTX start + .set MEM_JMP,0x9010 # BTX entry point + .set MEM_USR,0xa000 # Client start + +/* PC98 machine type from sys/pc98/pc98/pc98_machdep.h */ + .set MEM_SYS, 0xa100 # System common area segment + .set PC98_MACHINE_TYPE, 0x0620 # PC98 machine type + .set EPSON_ID, 0x0624 # EPSON machine id + + .set M_NEC_PC98, 0x0001 + .set M_EPSON_PC98, 0x0002 + .set M_NOT_H98, 0x0010 + .set M_H98, 0x0020 + .set M_NOTE, 0x0040 + .set M_NORMAL, 0x1000 + .set M_8M, 0x8000 + +/* Partition Constants */ + .set PRT_OFF,0x1be # Partition offset + +/* Misc. Constants */ + .set SIZ_PAG,0x1000 # Page size + .set SIZ_SEC,0x200 # Sector size + + .set NSECT,0x10 + + .globl start + .globl read + .globl putc + .code16 + +start: jmp main + +boot_cyl: .org 4 + .ascii "IPL1 " + +main: cld + + /* Setup the stack */ + xor %si,%si + mov %si,%ss + mov $STACK_OFF,%sp + + push %cx + + /* Relocate ourself to MEM_REL */ + push %cs + pop %ds + mov %si,%es + mov $MEM_REL,%di + mov $SIZ_SEC,%cx + rep + movsb + + /* Transfer PC-9801 system common area */ + xor %ax,%ax + mov %ax,%si + mov %ax,%ds + mov %ax,%di + mov $MEM_SYS,%ax + mov %ax,%es + mov $0x0600,%cx + rep + movsb + + /* Transfer EPSON machine type */ + mov $0xfd00,%ax + mov %ax,%ds + mov (0x804),%eax + and $0x00ffffff,%eax + mov %eax,%es:(EPSON_ID) + + /* Set machine type to PC98_SYSTEM_PARAMETER */ +#ifdef SET_MACHINE_TYPE + call set_machine_type +#else + mov $M_NEC_PC98+M_NOT_H98,%eax + mov %eax,%es:(PC98_MACHINE_TYPE) +#endif + + /* Setup graphic screen */ + mov $0x42,%ah /* 640x400 */ + mov $0xc0,%ch + int $0x18 + mov $0x40,%ah /* graph on */ + int $0x18 + + /* Setup text screen */ + mov $0x0a00,%ax /* 80x25 */ + int $0x18 + mov $0x0c,%ah /* text on */ + int $0x18 + mov $0x13,%ah /* cursor home */ + xor %dx,%dx + int $0x18 + mov $0x11,%ah /* cursor on */ + int $0x18 + + /* Setup keyboard */ + mov $0x03,%ah + int $0x18 + + pop %cx + + /* bootstrap passes */ + xor %edi,%edi + mov %di,%ds + mov %di,%es + mov %cs,%bx + cmp $0x1fe0,%bx + jz boot_fd + cmp $0x1fc0,%bx + jnz boot_hd + xor %cx,%cx + mov (DAUA),%al + and $0xf0,%al + cmp $0x30,%al + jz boot_fd + cmp $0x90,%al + jnz boot_hd +boot_fd: xor %cx,%cx + jmp boot_load +boot_hd: test %cx,%cx + jnz boot_load + mov %cs:(boot_cyl),%cx +boot_load: mov %cx,MEM_ARG /* Save cylinder number */ + mov %cx,%di + xor %dx,%dx + mov $LOAD_SIZE,%bx + mov $MEM_BUF,%bp + push %cs + callw read + jc error + + /* Transfer boot2.bin */ + mov $MEM_BTX,%bx + mov 0xa(%bx),%si /* BTX size */ + add %bx,%si /* start of boot2.bin */ + mov $MEM_USR+SIZ_PAG*2,%di + mov $MEM_BTX+(NSECT-1)*SIZ_SEC,%cx + sub %si,%cx + rep + movsb + + /* Enable A20 */ + xor %ax,%ax + outb %al,$0xf2 + mov $0x02,%al + outb %al,$0xf6 + + /* Start BTX */ + ljmp $0x0000,$MEM_JMP + +/* + * Reads sectors from the disk. + * Call with: + * + * %bx - bytes to read + * %cx - cylinder + * %dh - head + * %dl - sector + * %edi - lba + * %es:(%bp) - buffer to read data into + */ +read: xor %ax,%ax + mov %ax,%ds + mov $0x06,%ah + mov (DAUA),%al + mov %ax,%si + and $0xf0,%al + cmp $0x30,%al /* 1.44MB FDD */ + jz read_fd + cmp $0x90,%al /* 1MB FDD */ + jz read_fd + cmp $0xa0,%al /* Is SCSI device? */ + jnz read_load + push %cx + mov %si,%cx + and $0x0f,%cl + inc %cl + mov (0x482),%ah + shr %cl,%ah /* Is SCSI HDD? */ + pop %cx + jc read_load + and $0xff7f,%si /* SCSI MO */ + mov %di,%cx + shr $16,%di + mov %di,%dx + jmp read_load +read_fd: or $0xd000,%si + or $0x0200,%cx + inc %dx +read_load: mov %si,%ax + int $0x1b + lret + +/* + * Print out the error message, wait for a keypress, and then reboot + * the machine. + */ +error: push %cs + pop %ds + mov $msg_eread,%si + call putstr + xor %ax,%ax /* Get keypress */ + int $0x18 + xor %ax,%ax /* CPU reset */ + outb %al,$0xf0 +halt: hlt + jmp halt /* Spin */ + +/* + * Display a null-terminated string. + */ +putstr.0: push %cs + callw putc +putstr: lodsb + test %al,%al + jne putstr.0 + ret + +/* + * Display a single char. + */ +putc: pusha + xor %dx,%dx + mov %dx,%ds + mov MEM_REL+cursor-start,%di + mov $0xa000,%bx + mov %bx,%es + mov $(80*2),%cx + + cmp $0x08,%al + je putc.bs + cmp $0x0d,%al + je putc.cr + cmp $0x0a,%al + je putc.lf + cmp $0x5c,%al /* \ */ + jne 1f + mov $0xfc,%al +1: movb $0xe1,%es:0x2000(%di) + stosw + jmp putc.scr +putc.bs: test %di,%di + jz putc.move + dec %di + dec %di + movb $0xe1,%es:0x2000(%di) + movw $0x20,%es:(%di) + jmp putc.move +putc.cr: mov %di,%ax + div %cx + sub %dx,%di + jmp putc.move +putc.lf: add %cx,%di +putc.scr: cmp $(80*2*25),%di /* Scroll screen */ + jb putc.move + push %ds + mov %bx,%ds + mov $(80*2),%si + xor %di,%di + mov $(80*24/2),%cx + rep + movsl + xor %ax,%ax + mov $0x20,%al + mov $80,%cl + rep + stosw + pop %ds + mov $(80*24*2),%di +putc.move: mov %di,MEM_REL+cursor-start /* Move cursor */ + mov $0x13,%ah + mov %di,%dx + int $0x18 + popa + lret + +cursor: .word 0 + +#ifdef SET_MACHINE_TYPE +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +set_machine_type: + xor %edx,%edx + mov %dx,%ds +// mov $MEM_SYS,%ax +// mov %ax,%es + + /* Wait V-SYNC */ +vsync.1: inb $0x60,%al + test $0x20,%al + jnz vsync.1 +vsync.2: inb $0x60,%al + test $0x20,%al + jz vsync.2 + + /* ANK 'A' font */ + xor %al,%al + outb %al,$0xa1 + mov $0x41,%al + outb %al,$0xa3 + + /* Get 'A' font from CG window */ + push %ds + mov $0xa400,%ax + mov %ax,%ds + xor %eax,%eax + xor %bx,%bx + mov $4,%cx +font.1: add (%bx),%eax + add $4,%bx + loop font.1 + pop %ds + cmp $0x6efc58fc,%eax + jnz m_epson + +m_pc98: or $M_NEC_PC98,%edx + mov $0x0458,%bx + mov (%bx),%al + test $0x80,%al + jz m_not_h98 + or $M_H98,%edx + jmp 1f +m_epson: or $M_EPSON_PC98,%edx +m_not_h98: or $M_NOT_H98,%edx + +1: inb $0x42,%al + test $0x20,%al + jz 1f + or $M_8M,%edx + +1: mov $0x0400,%bx + mov (%bx),%al + test $0x80,%al + jz 1f + or $M_NOTE,%edx + +1: mov $PC98_MACHINE_TYPE,%bx + mov %edx,%es:(%bx) + ret +#endif + +/* Messages */ + +msg_eread: .asciz "Error\r\n" + + .org PRT_OFF,0x90 + +/* Partition table */ + + .fill 0x30,0x1,0x0 + .byte 0x80, 0x00, 0x01, 0x00 + .byte 0xa5, 0xff, 0xff, 0xff + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x50, 0xc3, 0x00, 0x00 + + .word 0xaa55 # Magic number Copied: stable/7/sys/boot/pc98/boot2/boot2.c (from r201342, head/sys/boot/pc98/boot2/boot2.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/pc98/boot2/boot2.c Fri Jan 15 12:45:23 2010 (r202355, copy of r201342, head/sys/boot/pc98/boot2/boot2.c) @@ -0,0 +1,842 @@ +/*- + * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#include "boot2.h" +#include "lib.h" + +#define IO_KEYBOARD 1 +#define IO_SERIAL 2 + +#define SECOND 1 /* Circa that many ticks in a second. */ + +#define RBX_ASKNAME 0x0 /* -a */ +#define RBX_SINGLE 0x1 /* -s */ +/* 0x2 is reserved for log2(RB_NOSYNC). */ +/* 0x3 is reserved for log2(RB_HALT). */ +/* 0x4 is reserved for log2(RB_INITNAME). */ +#define RBX_DFLTROOT 0x5 /* -r */ +#define RBX_KDB 0x6 /* -d */ +/* 0x7 is reserved for log2(RB_RDONLY). */ +/* 0x8 is reserved for log2(RB_DUMP). */ +/* 0x9 is reserved for log2(RB_MINIROOT). */ +#define RBX_CONFIG 0xa /* -c */ +#define RBX_VERBOSE 0xb /* -v */ +#define RBX_SERIAL 0xc /* -h */ +#define RBX_CDROM 0xd /* -C */ +/* 0xe is reserved for log2(RB_POWEROFF). */ +#define RBX_GDB 0xf /* -g */ +#define RBX_MUTE 0x10 /* -m */ +/* 0x11 is reserved for log2(RB_SELFTEST). */ +/* 0x12 is reserved for boot programs. */ +/* 0x13 is reserved for boot programs. */ +#define RBX_PAUSE 0x14 /* -p */ +#define RBX_QUIET 0x15 /* -q */ +#define RBX_NOINTR 0x1c /* -n */ +/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ +#define RBX_DUAL 0x1d /* -D */ +/* 0x1f is reserved for log2(RB_BOOTINFO). */ + +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ + OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ + OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ + OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + +#define PATH_CONFIG "/boot.config" +#define PATH_BOOT3 "/boot/loader" +#define PATH_KERNEL "/boot/kernel/kernel" + +#define ARGS 0x900 +#define NOPT 14 +#define NDEV 3 +#define V86_CY(x) ((x) & PSL_C) +#define V86_ZR(x) ((x) & PSL_Z) + +#define DRV_DISK 0xf0 +#define DRV_UNIT 0x0f + +#define TYPE_AD 0 +#define TYPE_DA 1 +#define TYPE_FD 2 + +#define OPT_SET(opt) (1 << (opt)) +#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) + +extern uint32_t _end; + +static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ +static const unsigned char flags[NOPT] = { + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE +}; + +static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; +static const unsigned char dev_maj[NDEV] = {30, 4, 2}; +static const unsigned char dev_daua[NDEV] = {0x80, 0xa0, 0x90}; + +static struct dsk { + unsigned daua; + unsigned type; + unsigned disk; + unsigned unit; + unsigned head; + unsigned sec; + unsigned slice; + unsigned part; + unsigned start; +} dsk; +static char cmd[512], cmddup[512]; +static char kname[1024]; +static uint32_t opts; +static int comspeed = SIOSPD; +static struct bootinfo bootinfo; +static uint8_t ioctrl = IO_KEYBOARD; + +void exit(int); +static void load(void); +static int parse(void); +static int xfsread(ino_t, void *, size_t); +static int dskread(void *, unsigned, unsigned); +static void printf(const char *,...); +static void putchar(int); +static uint32_t memsize(void); +static int drvread(void *, unsigned); +static int keyhit(unsigned); +static int xputc(int); +static int xgetc(int); +static int getc(int); + +static void memcpy(void *, const void *, int); +static void +memcpy(void *dst, const void *src, int len) +{ + const char *s = src; + char *d = dst; + + while (len--) + *d++ = *s++; +} + +static inline int +strcmp(const char *s1, const char *s2) +{ + for (; *s1 == *s2 && *s1; s1++, s2++); + return (unsigned char)*s1 - (unsigned char)*s2; +} + +#define UFS_SMALL_CGBASE +#include "ufsread.c" + +static inline int +xfsread(ino_t inode, void *buf, size_t nbyte) +{ + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return -1; + } + return 0; +} + +static inline uint32_t +memsize(void) +{ + u_char *p = (u_char *)PTOV(0); + + return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; +} + +static inline void +getstr(void) +{ + char *s; + int c; + + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } + } +} + +static inline void +putc(int c) +{ + + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = PUTCORG; /* call to putc in boot1 */ + v86.eax = c; + v86int(); + v86.ctl = V86_FLAGS; +} + +static inline int +is_scsi_hd(void) +{ + + if ((*(u_char *)PTOV(0x482) >> dsk.unit) & 0x01) + return 1; + + return 0; +} + +static inline void +fix_sector_size(void) +{ + u_char *p; + + p = (u_char *)PTOV(0x460 + dsk.unit * 4); /* SCSI equipment parameter */ + + if ((p[0] & 0x1f) == 7) { /* SCSI MO */ + if (!(p[3] & 0x30)) { /* 256B / sector */ + p[3] |= 0x10; /* forced set 512B / sector */ + p[3 + 0xa1000] |= 0x10; + } + } +} + +static inline uint32_t +get_diskinfo(void) +{ + + if (dsk.disk == 0x30) { /* 1440KB FD */ + /* 80 cylinders, 2 heads, 18 sectors */ + return (80 << 16) | (2 << 8) | 18; + } else if (dsk.disk == 0x90) { /* 1200KB FD */ + /* 80 cylinders, 2 heads, 15 sectors */ + return (80 << 16) | (2 << 8) | 15; + } else if (dsk.disk == 0x80 || is_scsi_hd()) { /* IDE or SCSI HDD */ + v86.addr = 0x1b; + v86.eax = 0x8400 | dsk.daua; + v86int(); + return (v86.ecx << 16) | v86.edx; + } + + /* SCSI MO or CD */ + fix_sector_size(); /* SCSI MO */ + + /* other SCSI devices */ + return (65535 << 16) | (8 << 8) | 32; +} + +static void +set_dsk(void) +{ + uint32_t di; + + di = get_diskinfo(); + + dsk.head = (di >> 8) & 0xff; + dsk.sec = di & 0xff; + dsk.start = 0; +} + +#ifdef GET_BIOSGEOM +static uint32_t +bd_getbigeom(int bunit) +{ + int hds = 0; + int unit = 0x80; /* IDE HDD */ + u_int addr = 0x55d; + + while (unit < 0xa7) { + if (*(u_char *)PTOV(addr) & (1 << (unit & 0x0f))) + if (hds++ == bunit) + break; + + if (unit >= 0xA0) { + int media = ((unsigned *)PTOV(0x460))[unit & 0x0F] & 0x1F; + + if (media == 7 && hds++ == bunit) /* SCSI MO */ + return(0xFFFE0820); /* C:65535 H:8 S:32 */ + } + if (++unit == 0x84) { + unit = 0xA0; /* SCSI HDD */ + addr = 0x482; + } + } + if (unit == 0xa7) + return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ + v86.addr = 0x1b; + v86.eax = 0x8400 | unit; + v86int(); + if (v86.efl & 0x1) + return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ + return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff); +} +#endif + +static int +check_slice(void) +{ + struct pc98_partition *dp; + char *sec; + unsigned i, cyl; + + sec = dmadat->secbuf; + cyl = *(uint16_t *)PTOV(ARGS); + set_dsk(); + + if (dsk.type == TYPE_FD) + return (WHOLE_DISK_SLICE); + if (drvread(sec, DOSBBSECTOR + 1)) + return (WHOLE_DISK_SLICE); /* Read error */ + dp = (void *)(sec + DOSPARTOFF); + for (i = 0; i < NDOSPART; i++) { + if (dp[i].dp_mid == DOSMID_386BSD) { + if (dp[i].dp_scyl <= cyl && cyl <= dp[i].dp_ecyl) + return (BASE_SLICE + i); + } + } + + return (WHOLE_DISK_SLICE); +} + +int +main(void) +{ +#ifdef GET_BIOSGEOM + int i; +#endif + int autoboot; + ino_t ino; + + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.daua = *(uint8_t *)PTOV(0x584); + dsk.disk = dsk.daua & DRV_DISK; + dsk.unit = dsk.daua & DRV_UNIT; + if (dsk.disk == 0x80) + dsk.type = TYPE_AD; + else if (dsk.disk == 0xa0) + dsk.type = TYPE_DA; + else /* if (dsk.disk == 0x30 || dsk.disk == 0x90) */ + dsk.type = TYPE_FD; + dsk.slice = check_slice(); +#ifdef GET_BIOSGEOM + for (i = 0; i < N_BIOS_GEOM; i++) + bootinfo.bi_bios_geom[i] = bd_getbigeom(i); +#endif + bootinfo.bi_version = BOOTINFO_VERSION; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 12:52:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6898E1065670; Fri, 15 Jan 2010 12:52:46 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54D9C8FC15; Fri, 15 Jan 2010 12:52: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 o0FCqkGH076814; Fri, 15 Jan 2010 12:52:46 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FCqkDT076805; Fri, 15 Jan 2010 12:52:46 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151252.o0FCqkDT076805@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 12:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202356 - stable/6/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:52:46 -0000 Author: nyan Date: Fri Jan 15 12:52:45 2010 New Revision: 202356 URL: http://svn.freebsd.org/changeset/base/202356 Log: MFC: revision 200407 Cleanups the boot2 for pc98. There is no functional change. - Make setting machine type and getting geom conditional for future. - Remove unused RAWBOOT and CDBOOT supports. - Remove unneeded include. - Fix warnings. This change is directly merged into stable/6 because stable/[78] have new boot2. Modified: stable/6/sys/boot/pc98/boot2/Makefile stable/6/sys/boot/pc98/boot2/bios.S stable/6/sys/boot/pc98/boot2/boot.c stable/6/sys/boot/pc98/boot2/boot.h stable/6/sys/boot/pc98/boot2/disk.c stable/6/sys/boot/pc98/boot2/io.c stable/6/sys/boot/pc98/boot2/serial_16550.S stable/6/sys/boot/pc98/boot2/sys.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/pc98/boot2/Makefile ============================================================================== --- stable/6/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:52:45 2010 (r202356) @@ -29,6 +29,12 @@ CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_ BOOT_COMCONSOLE_SPEED?=9600 CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} +# Set machine type to PC98_SYSTEM_PARAMETER +CFLAGS+= -DSET_MACHINE_TYPE + +# Initialize the bi_bios_geom using the BIOS geometry +CFLAGS+= -DGET_BIOSGEOM + # Enable code to take the default boot string from a fixed location on the # disk. See nextboot(8) and README.386BSD for more info. #CFLAGS+= -DNAMEBLOCK Modified: stable/6/sys/boot/pc98/boot2/bios.S ============================================================================== --- stable/6/sys/boot/pc98/boot2/bios.S Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/bios.S Fri Jan 15 12:52:45 2010 (r202356) @@ -91,8 +91,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFT #include "asm.h" .text -#ifndef CDBOOT - /* * PC-9801/PC-9821 SCSI MO booting * 2002/06/05-07/03 Kawanobe Koh @@ -198,98 +196,6 @@ read_end: ret -#else /* CDBOOT */ - - -/* - * int - * getbootspec(struct specpacket *offset) - * - * Read CD-ROM boot specification packet to "offset". - */ -ENTRY(getbootspec) - push %ebp - mov %esp, %ebp - - push %esi - push %ebx - - movw 0x8(%ebp), %si - mov $0x7f, %edx - - /* prot_to_real will set %es to BOOTSEG */ - call EXT(prot_to_real) /* enter real mode */ - movw $0x4b01, %ax /* (do not) terminate disk emulation */ - movb $0x7f, %dl /* any drive */ - - sti - int $0x13 - cli - - /* save return value (actually movw %ax, %bx) */ - mov %eax, %ebx - - data32 - call EXT(real_to_prot) /* back to protected mode */ - - xor %eax, %eax - movb %bh, %al /* return value in %ax */ - - pop %ebx - pop %esi - pop %ebp - - ret - - -/* - * int - * biosreadlba(struct daddrpacket *daddr) - * Read sectors using the BIOS "read extended" function - * BIOS call "INT 0x13 Function 0x42" to read sectors from disk into memory - * Call with %ah = 0x42 - * %dl = drive (0x0 for floppy disk, or emulated CD) - * %ds:%si = ptr to disk address packet - * Return: - * %ah = 0x0 on success; err code on failure - */ - -ENTRY(biosreadlba) - push %ebp - mov %esp, %ebp - - push %ebx - push %esi - - movw 8(%ebp), %si - movl $0, %edx /* emulated CD is always drive 0 */ - - /* prot_to_real will set %es to BOOTSEG */ - call EXT(prot_to_real) /* enter real mode */ - movw $0x4200, %ax /* subfunction */ - movb $0, %dl - - sti - int $0x13 - cli - - /* save return value (actually movw %ax, %bx) */ - mov %eax, %ebx - - data32 - call EXT(real_to_prot) /* back to protected mode */ - - xor %eax, %eax - movb %bh, %al /* return value in %ax */ - - pop %esi - pop %ebx - pop %ebp - - ret - -#endif /* !CDBOOT */ - /* * getc() * BIOS call "INT 18H Function 00H" to read character from keyboard Modified: stable/6/sys/boot/pc98/boot2/boot.c ============================================================================== --- stable/6/sys/boot/pc98/boot2/boot.c Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/boot.c Fri Jan 15 12:52:45 2010 (r202356) @@ -85,12 +85,13 @@ boot(int drive) unsigned char disk_equips; /* Pick up the story from the Bios on geometry of disks */ - +#ifdef GET_BIOSGEOM for(ret = 0; ret < 2; ret ++) { if (*(unsigned char*)V(0xA155d) & (1 << ret)) { bootinfo.bi_bios_geom[ret] = get_diskinfo(ret + 0x80); } } +#endif bootinfo.bi_basemem = memsize(0); bootinfo.bi_extmem = memsize(1); @@ -98,8 +99,10 @@ boot(int drive) gateA20(); +#ifdef SET_MACHINE_TYPE /* set machine type to PC98_SYSTEM_PARAMETER */ machine_check(); +#endif /* * The default boot device is the first partition in the Modified: stable/6/sys/boot/pc98/boot2/boot.h ============================================================================== --- stable/6/sys/boot/pc98/boot2/boot.h Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/boot.h Fri Jan 15 12:52:45 2010 (r202356) @@ -51,7 +51,7 @@ extern int loadflags; extern struct disklabel disklabel; /* asm.S */ -#if ASM_ONLY +#ifdef ASM_ONLY void real_to_prot(void); void prot_to_real(void); #endif @@ -84,9 +84,6 @@ void putchar(int c); void delay1ms(void); int gets(char *buf); int strcmp(const char *s1, const char *s2); -#ifdef CDBOOT -int strcasecmp(const char *s1, const char *s2); -#endif /* !CDBOOT */ void memcpy(const void *from, void *to, size_t len); void twiddle(void); void machine_check(void); Modified: stable/6/sys/boot/pc98/boot2/disk.c ============================================================================== --- stable/6/sys/boot/pc98/boot2/disk.c Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/disk.c Fri Jan 15 12:52:45 2010 (r202356) @@ -87,7 +87,6 @@ devopen(void) di = get_diskinfo(dosdev_copy); spc = (spt = SPT(di)) * HEADS(di); -#ifndef RAWBOOT if ((dosdev_copy & 0xf0) == 0x90) { boff = 0; @@ -119,7 +118,7 @@ devopen(void) boff = dl->d_partitions[part].p_offset - dl->d_partitions[2].p_offset + sector; } -#endif /* RAWBOOT */ + return 0; } Modified: stable/6/sys/boot/pc98/boot2/io.c ============================================================================== --- stable/6/sys/boot/pc98/boot2/io.c Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/io.c Fri Jan 15 12:52:45 2010 (r202356) @@ -162,7 +162,7 @@ delay1ms(void) (void)outb(0x5f,0); /* about 600ns */ } -static __inline int +static int isch(void) { int isc; @@ -182,7 +182,7 @@ isch(void) return (serial_ischar()); } -static __inline unsigned +static unsigned pword(unsigned physaddr) { static int counter = 0; @@ -246,24 +246,6 @@ strcmp(const char *s1, const char *s2) return 1; } -#ifdef CDBOOT -int -strcasecmp(const char *s1, const char *s2) -{ - /* - * We only consider ASCII chars and don't anticipate - * control characters (they are invalid in filenames - * anyway). - */ - while ((*s1 & 0x5f) == (*s2 & 0x5f)) { - if (!*s1++) - return 0; - s2++; - } - return 1; -} -#endif /* !CDBOOT */ - void memcpy(const void *from, void *to, size_t len) { @@ -349,6 +331,7 @@ void putc(int c) outb(0x60, pos >> 8); } +#ifdef SET_MACHINE_TYPE void machine_check(void) { int ret; @@ -394,3 +377,4 @@ void machine_check(void) (*(unsigned long *)V(0xA1620)) = ret; } +#endif Modified: stable/6/sys/boot/pc98/boot2/serial_16550.S ============================================================================== --- stable/6/sys/boot/pc98/boot2/serial_16550.S Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/serial_16550.S Fri Jan 15 12:52:45 2010 (r202356) @@ -67,7 +67,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFT .file "serial.S" -#include #include "asm.h" .text Modified: stable/6/sys/boot/pc98/boot2/sys.c ============================================================================== --- stable/6/sys/boot/pc98/boot2/sys.c Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/sys.c Fri Jan 15 12:52:45 2010 (r202356) @@ -53,10 +53,6 @@ static int mapblock; int poff; -#ifdef RAWBOOT -#define STARTBYTE 8192 /* Where on the media the kernel starts */ -#endif - static int block_map(int file_block); static int find(char *path); @@ -74,7 +70,6 @@ xread(char *addr, int size) } } -#ifndef RAWBOOT void read(char *buffer, int count) { @@ -102,40 +97,6 @@ read(char *buffer, int count) poff += size; } } -#else -void -read(char *buffer, int count) -{ - int cnt, bnum, off, size; - - off = STARTBYTE + poff; - poff += count; - - /* Read any unaligned bit at the front */ - cnt = off & 511; - if (cnt) { - size = 512-cnt; - if (count < size) - size = count; - devread(iobuf, off >> 9, 512); - memcpy(iobuf+cnt, buffer, size); - count -= size; - off += size; - buffer += size; - } - size = count & (~511); - if (size && (off & (~511))) { - devread(buffer, off >> 9, size); - off += size; - count -= size; - buffer += size; - } - if (count) { - devread(iobuf, off >> 9, 512); - memcpy(iobuf, buffer, count); - } -} -#endif static int find(char *path) @@ -263,7 +224,7 @@ openrd(void) biosdrive = biosdrivedigit - '0'; if (biosdrivedigit == '\0') { biosdrive = dosdev & 0x0f; -#if BOOT_HD_BIAS > 0 +#if defined(BOOT_HD_BIAS) && (BOOT_HD_BIAS > 0) /* XXX */ if (maj == 4) biosdrive += BOOT_HD_BIAS; @@ -299,7 +260,6 @@ openrd(void) if (devopen()) return 1; -#ifndef RAWBOOT /***********************************************\ * Load Filesystem info (mount the device) * \***********************************************/ @@ -316,6 +276,6 @@ openrd(void) return -1; } poff = 0; -#endif /* RAWBOOT */ + return 0; } From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 14:20:02 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2C8F106566C; Fri, 15 Jan 2010 14:20:01 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAA018FC0A; Fri, 15 Jan 2010 14:20: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 o0FEK1RN096443; Fri, 15 Jan 2010 14:20:01 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FEK1n0096433; Fri, 15 Jan 2010 14:20:01 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001151420.o0FEK1n0096433@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 15 Jan 2010 14:20: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: r202360 - in stable/8: contrib/one-true-awk usr.bin/awk X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 14:20:02 -0000 Author: ru Date: Fri Jan 15 14:20:01 2010 New Revision: 202360 URL: http://svn.freebsd.org/changeset/base/202360 Log: Update to a 26-Nov-2009 release. Deleted: stable/8/contrib/one-true-awk/mac.code stable/8/usr.bin/awk/b.c.diff stable/8/usr.bin/awk/main.c.diff stable/8/usr.bin/awk/run.c.diff Modified: stable/8/contrib/one-true-awk/FIXES stable/8/contrib/one-true-awk/b.c stable/8/contrib/one-true-awk/lib.c stable/8/contrib/one-true-awk/main.c stable/8/contrib/one-true-awk/makefile stable/8/contrib/one-true-awk/maketab.c stable/8/contrib/one-true-awk/proctab.c stable/8/contrib/one-true-awk/proto.h stable/8/contrib/one-true-awk/run.c stable/8/usr.bin/awk/Makefile Directory Properties: stable/8/contrib/one-true-awk/ (props changed) stable/8/usr.bin/awk/ (props changed) Modified: stable/8/contrib/one-true-awk/FIXES ============================================================================== --- stable/8/contrib/one-true-awk/FIXES Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/contrib/one-true-awk/FIXES Fri Jan 15 14:20:01 2010 (r202360) @@ -25,6 +25,23 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Nov 26, 2009: + fixed a long-standing issue with when FS takes effect. a + change to FS is now noticed immediately for subsequent splits. + + changed the name getline() to awkgetline() to avoid yet another + name conflict somewhere. + +Feb 11, 2009: + temporarily for now defined HAS_ISBLANK, since that seems to + be the best way through the thicket. isblank arrived in C99, + but seems to be arriving at different systems at different + times. + +Oct 8, 2008: + fixed typo in b.c that set tmpvec wrongly. no one had ever + run into the problem, apparently. thanks to alistair crooks. + Oct 23, 2007: minor fix in lib.c: increase inputFS to 100, change malloc for fields to n+1. Modified: stable/8/contrib/one-true-awk/b.c ============================================================================== --- stable/8/contrib/one-true-awk/b.c Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/contrib/one-true-awk/b.c Fri Jan 15 14:20:01 2010 (r202360) @@ -24,6 +24,9 @@ THIS SOFTWARE. /* lasciate ogne speranza, voi ch'intrate. */ +#include +__FBSDID("$FreeBSD$"); + #define DEBUG #include @@ -285,9 +288,21 @@ int quoted(char **pp) /* pick up next th return c; } +static int collate_range_cmp(int a, int b) +{ + static char s[2][2]; + + if ((uschar)a == (uschar)b) + return 0; + s[0][0] = a; + s[1][0] = b; + return (strcoll(s[0], s[1])); +} + char *cclenter(const char *argp) /* add a character class */ { int i, c, c2; + int j; uschar *p = (uschar *) argp; uschar *op, *bp; static uschar *buf = 0; @@ -306,15 +321,18 @@ char *cclenter(const char *argp) /* add c2 = *p++; if (c2 == '\\') c2 = quoted((char **) &p); - if (c > c2) { /* empty; ignore */ + if (collate_range_cmp(c, c2) > 0) { bp--; i--; continue; } - while (c < c2) { + for (j = 0; j < NCHARS; j++) { + if ((collate_range_cmp(c, j) > 0) || + collate_range_cmp(j, c2) > 0) + continue; if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1")) FATAL("out of space for character class [%.10s...] 2", p); - *bp++ = ++c; + *bp++ = j; i++; } continue; @@ -731,6 +749,7 @@ Node *unary(Node *np) * to nelson beebe for the suggestion; let's see if it works everywhere. */ +/* #define HAS_ISBLANK */ #ifndef HAS_ISBLANK int (isblank)(int c) @@ -876,7 +895,7 @@ int cgoto(fa *f, int s, int c) if (q[j] >= maxsetvec) { maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); - tmpset = (int *) realloc(setvec, maxsetvec * sizeof(int)); + tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); if (setvec == 0 || tmpset == 0) overflo("cgoto overflow"); } Modified: stable/8/contrib/one-true-awk/lib.c ============================================================================== --- stable/8/contrib/one-true-awk/lib.c Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/contrib/one-true-awk/lib.c Fri Jan 15 14:20:01 2010 (r202360) @@ -274,6 +274,7 @@ void fldbld(void) /* create fields from } fr = fields; i = 0; /* number of fields accumulated here */ + strcpy(inputFS, *FS); if (strlen(inputFS) > 1) { /* it's a regular expression */ i = refldbld(r, inputFS); } else if ((sep = *inputFS) == ' ') { /* default whitespace */ Modified: stable/8/contrib/one-true-awk/main.c ============================================================================== --- stable/8/contrib/one-true-awk/main.c Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/contrib/one-true-awk/main.c Fri Jan 15 14:20:01 2010 (r202360) @@ -22,7 +22,10 @@ ARISING OUT OF OR IN CONNECTION WITH THE THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20070501"; +#include +__FBSDID("$FreeBSD$"); + +const char *version = "version 20091126 (FreeBSD)"; #define DEBUG #include @@ -58,6 +61,7 @@ int main(int argc, char *argv[]) const char *fs = NULL; setlocale(LC_CTYPE, ""); + setlocale(LC_COLLATE, ""); setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ cmdname = argv[0]; if (argc == 1) { @@ -86,13 +90,18 @@ int main(int argc, char *argv[]) safe = 1; break; case 'f': /* next argument is program filename */ - argc--; - argv++; - if (argc <= 1) - FATAL("no program filename"); - if (npfile >= MAX_PFILE - 1) - FATAL("too many -f options"); - pfile[npfile++] = argv[1]; + if (argv[1][2] != 0) { /* arg is -fsomething */ + if (npfile >= MAX_PFILE - 1) + FATAL("too many -f options"); + pfile[npfile++] = &argv[1][2]; + } else { /* arg is -f something */ + argc--; argv++; + if (argc <= 1) + FATAL("no program filename"); + if (npfile >= MAX_PFILE - 1) + FATAL("too many -f options"); + pfile[npfile++] = argv[1]; + } break; case 'F': /* set field separator */ if (argv[1][2] != 0) { /* arg is -Fsomething */ @@ -111,8 +120,14 @@ int main(int argc, char *argv[]) WARNING("field separator FS is empty"); break; case 'v': /* -v a=1 to be done NOW. one -v for each */ - if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1])) - setclvar(argv[1]); + if (argv[1][2] != 0) { /* arg is -vsomething */ + if (argv[1][2] != 0) + setclvar(&argv[1][2]); + } else { /* arg is -v something */ + argc--; argv++; + if (argc > 1 && isclvar(argv[1])) + setclvar(argv[1]); + } break; case 'd': dbg = atoi(&argv[1][2]); Modified: stable/8/contrib/one-true-awk/makefile ============================================================================== --- stable/8/contrib/one-true-awk/makefile Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/contrib/one-true-awk/makefile Fri Jan 15 14:20:01 2010 (r202360) @@ -31,7 +31,6 @@ CC = gcc -fprofile-arcs -ftest-coverage CC = gcc -Wall -g CC = cc CC = gcc -O4 -CC = gcc -Wall -g YACC = bison -y Modified: stable/8/contrib/one-true-awk/maketab.c ============================================================================== --- stable/8/contrib/one-true-awk/maketab.c Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/contrib/one-true-awk/maketab.c Fri Jan 15 14:20:01 2010 (r202360) @@ -102,7 +102,7 @@ struct xx { CALL, "call", "call" }, { ARG, "arg", "arg" }, { VARNF, "getnf", "NF" }, - { GETLINE, "getline", "getline" }, + { GETLINE, "awkgetline", "getline" }, { 0, "", "" }, }; Modified: stable/8/contrib/one-true-awk/proctab.c ============================================================================== --- stable/8/contrib/one-true-awk/proctab.c Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/contrib/one-true-awk/proctab.c Fri Jan 15 14:20:01 2010 (r202360) @@ -180,7 +180,7 @@ Cell *(*proctab[93])(Node **, int) = { nullproc, /* NUMBER */ nullproc, /* STRING */ nullproc, /* REGEXPR */ - getline, /* GETLINE */ + awkgetline, /* GETLINE */ substr, /* SUBSTR */ split, /* SPLIT */ jump, /* RETURN */ Modified: stable/8/contrib/one-true-awk/proto.h ============================================================================== --- stable/8/contrib/one-true-awk/proto.h Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/contrib/one-true-awk/proto.h Fri Jan 15 14:20:01 2010 (r202360) @@ -149,7 +149,7 @@ extern Cell *call(Node **, int); extern Cell *copycell(Cell *); extern Cell *arg(Node **, int); extern Cell *jump(Node **, int); -extern Cell *getline(Node **, int); +extern Cell *awkgetline(Node **, int); extern Cell *getnf(Node **, int); extern Cell *array(Node **, int); extern Cell *awkdelete(Node **, int); Modified: stable/8/contrib/one-true-awk/run.c ============================================================================== --- stable/8/contrib/one-true-awk/run.c Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/contrib/one-true-awk/run.c Fri Jan 15 14:20:01 2010 (r202360) @@ -22,6 +22,9 @@ ARISING OUT OF OR IN CONNECTION WITH THE THIS SOFTWARE. ****************************************************************/ +#include +__FBSDID("$FreeBSD$"); + #define DEBUG #include #include @@ -388,7 +391,7 @@ Cell *jump(Node **a, int n) /* break, co return 0; /* not reached */ } -Cell *getline(Node **a, int n) /* get next line from specific input */ +Cell *awkgetline(Node **a, int n) /* get next line from specific input */ { /* a[0] is variable, a[1] is operator, a[2] is filename */ Cell *r, *x; extern Cell **fldtab; @@ -653,7 +656,7 @@ Cell *relop(Node **a, int n) /* a[0 < a[ j = x->fval - y->fval; i = j<0? -1: (j>0? 1: 0); } else { - i = strcmp(getsval(x), getsval(y)); + i = strcoll(getsval(x), getsval(y)); } tempfree(x); tempfree(y); @@ -1159,11 +1162,11 @@ Cell *cat(Node **a, int q) /* a[0] cat a x->sval, y->sval); strcpy(s, x->sval); strcpy(s+n1, y->sval); + tempfree(x); tempfree(y); z = gettemp(); z->sval = s; z->tval = STR; - tempfree(x); return(z); } Modified: stable/8/usr.bin/awk/Makefile ============================================================================== --- stable/8/usr.bin/awk/Makefile Fri Jan 15 14:05:06 2010 (r202359) +++ stable/8/usr.bin/awk/Makefile Fri Jan 15 14:20:01 2010 (r202360) @@ -8,6 +8,8 @@ SRCS= awkgram.y b.c lex.c lib.c main.c p CFLAGS+= -DHAS_ISBLANK -I. -I${AWKSRC} -DFOPEN_MAX=64 +WARNS?= 1 + DPADD= ${LIBM} LDADD= -lm @@ -25,10 +27,4 @@ proctab.c: maketab build-tools: maketab maketab: ytab.h ${AWKSRC}/maketab.c -.for f in b.c main.c run.c -${f}: ${AWKSRC}/${f} ${.CURDIR}/${f}.diff - patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${AWKSRC}/${f} -CLEANFILES+= ${f} -.endfor - .include From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 14:24:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 211EB106566B; Fri, 15 Jan 2010 14:24:33 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DE468FC12; Fri, 15 Jan 2010 14:24: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 o0FEOWaw097484; Fri, 15 Jan 2010 14:24:32 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FEOWqj097481; Fri, 15 Jan 2010 14:24:32 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001151424.o0FEOWqj097481@svn.freebsd.org> From: Antoine Brodin Date: Fri, 15 Jan 2010 14:24:32 +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: r202361 - in stable/8: etc/mtree share/examples X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 14:24:33 -0000 Author: antoine Date: Fri Jan 15 14:24:32 2010 New Revision: 202361 URL: http://svn.freebsd.org/changeset/base/202361 Log: MFC r200440 to stable/8: Install firmware(9) examples. Modified: stable/8/etc/mtree/BSD.usr.dist stable/8/share/examples/Makefile Directory Properties: stable/8/etc/ (props changed) stable/8/share/examples/ (props changed) Modified: stable/8/etc/mtree/BSD.usr.dist ============================================================================== --- stable/8/etc/mtree/BSD.usr.dist Fri Jan 15 14:20:01 2010 (r202360) +++ stable/8/etc/mtree/BSD.usr.dist Fri Jan 15 14:24:32 2010 (r202361) @@ -230,6 +230,12 @@ .. dyn_sysctl .. + firmware + fwconsumer + .. + fwimage + .. + .. syscall module .. Modified: stable/8/share/examples/Makefile ============================================================================== --- stable/8/share/examples/Makefile Fri Jan 15 14:20:01 2010 (r202360) +++ stable/8/share/examples/Makefile Fri Jan 15 14:24:32 2010 (r202361) @@ -88,6 +88,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ kld/dyn_sysctl/Makefile \ kld/dyn_sysctl/README \ kld/dyn_sysctl/dyn_sysctl.c \ + kld/firmware/Makefile \ + kld/firmware/README \ + kld/firmware/fwconsumer/Makefile \ + kld/firmware/fwconsumer/fw_consumer.c \ + kld/firmware/fwimage/Makefile \ + kld/firmware/fwimage/firmware.img \ kld/syscall/Makefile \ kld/syscall/module/Makefile \ kld/syscall/module/syscall.c \ From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 14:30:20 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A781065670; Fri, 15 Jan 2010 14:30:20 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A68EB8FC28; Fri, 15 Jan 2010 14:30: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 o0FEUKuT098783; Fri, 15 Jan 2010 14:30:20 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FEUKpR098780; Fri, 15 Jan 2010 14:30:20 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001151430.o0FEUKpR098780@svn.freebsd.org> From: Antoine Brodin Date: Fri, 15 Jan 2010 14:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202362 - in stable/7: etc/mtree share/examples X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 14:30:20 -0000 Author: antoine Date: Fri Jan 15 14:30:20 2010 New Revision: 202362 URL: http://svn.freebsd.org/changeset/base/202362 Log: MFC r200440 to stable/7: Install firmware(9) examples. Modified: stable/7/etc/mtree/BSD.usr.dist stable/7/share/examples/Makefile Directory Properties: stable/7/etc/ (props changed) stable/7/share/examples/ (props changed) Modified: stable/7/etc/mtree/BSD.usr.dist ============================================================================== --- stable/7/etc/mtree/BSD.usr.dist Fri Jan 15 14:24:32 2010 (r202361) +++ stable/7/etc/mtree/BSD.usr.dist Fri Jan 15 14:30:20 2010 (r202362) @@ -238,6 +238,12 @@ .. dyn_sysctl .. + firmware + fwconsumer + .. + fwimage + .. + .. syscall module .. Modified: stable/7/share/examples/Makefile ============================================================================== --- stable/7/share/examples/Makefile Fri Jan 15 14:24:32 2010 (r202361) +++ stable/7/share/examples/Makefile Fri Jan 15 14:30:20 2010 (r202362) @@ -118,6 +118,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ kld/dyn_sysctl/Makefile \ kld/dyn_sysctl/README \ kld/dyn_sysctl/dyn_sysctl.c \ + kld/firmware/Makefile \ + kld/firmware/README \ + kld/firmware/fwconsumer/Makefile \ + kld/firmware/fwconsumer/fw_consumer.c \ + kld/firmware/fwimage/Makefile \ + kld/firmware/fwimage/firmware.img \ kld/syscall/Makefile \ kld/syscall/module/Makefile \ kld/syscall/module/syscall.c \ From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:16:50 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 639751065676; Fri, 15 Jan 2010 15:16:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3732A8FC12; Fri, 15 Jan 2010 15:16:50 +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 o0FFGoJC009340; Fri, 15 Jan 2010 15:16:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFGod0009338; Fri, 15 Jan 2010 15:16:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151516.o0FFGod0009338@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202367 - stable/7/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:16:50 -0000 Author: marius Date: Fri Jan 15 15:16:49 2010 New Revision: 202367 URL: http://svn.freebsd.org/changeset/base/202367 Log: MFC: r177108 (partial) Suppress excessive output while netbooting via loader, unless debugging. Modified: stable/7/sys/boot/common/dev_net.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:10:29 2010 (r202366) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:16:49 2010 (r202367) @@ -245,7 +245,8 @@ net_getparams(sock) printf("net_open: bootparam/whoami RPC failed\n"); return (EIO); } - printf("net_open: client name: %s\n", hostname); + if (debug) + printf("net_open: client name: %s\n", hostname); /* * Ignore the gateway from whoami (unreliable). @@ -259,10 +260,11 @@ net_getparams(sock) } if (smask) { netmask = smask; - printf("net_open: subnet mask: %s\n", intoa(netmask)); + if (debug) + printf("net_open: subnet mask: %s\n", intoa(netmask)); } - if (gateip.s_addr) - printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); + if (gateip.s_addr && debug) + printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); /* Get the root server and pathname. */ if (bp_getfile(sock, "root", &rootip, rootpath)) { @@ -270,7 +272,7 @@ net_getparams(sock) return (EIO); } exit: - /* + /* * If present, strip the server's address off of the rootpath * before passing it along. This allows us to be compatible with * the kernel's diskless (BOOTP_NFSROOT) booting conventions @@ -285,8 +287,10 @@ net_getparams(sock) bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); } - printf("net_open: server addr: %s\n", inet_ntoa(rootip)); - printf("net_open: server path: %s\n", rootpath); + if (debug) { + printf("net_open: server addr: %s\n", inet_ntoa(rootip)); + printf("net_open: server path: %s\n", rootpath); + } d = socktodesc(sock); sprintf(temp, "%6D", d->myea, ":"); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:23:39 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2374106568B; Fri, 15 Jan 2010 15:23:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE2038FC1F; Fri, 15 Jan 2010 15:23:38 +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 o0FFNcp2010889; Fri, 15 Jan 2010 15:23:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFNcZJ010886; Fri, 15 Jan 2010 15:23:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151523.o0FFNcZJ010886@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202368 - stable/7/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:23:39 -0000 Author: marius Date: Fri Jan 15 15:23:38 2010 New Revision: 202368 URL: http://svn.freebsd.org/changeset/base/202368 Log: MFC: r182731 Show info about net devices in loader's 'lsdev' command. While there fix style. Modified: stable/7/sys/boot/common/dev_net.c stable/7/sys/boot/common/devopen.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:16:49 2010 (r202367) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:23:38 2010 (r202368) @@ -1,4 +1,4 @@ -/* +/* * $NetBSD: dev_net.c,v 1.12 1997/12/10 20:38:37 gwr Exp $ */ @@ -90,20 +90,21 @@ static void net_print(int); static int net_getparams(int sock); struct devsw netdev = { - "net", - DEVT_NET, - net_init, - net_strategy, - net_open, - net_close, - noioctl, - net_print + "net", + DEVT_NET, + net_init, + net_strategy, + net_open, + net_close, + noioctl, + net_print }; int net_init(void) { - return 0; + + return (0); } /* @@ -114,76 +115,75 @@ net_init(void) int net_open(struct open_file *f, ...) { - va_list args; - char *devname; /* Device part of file name (or NULL). */ - int error = 0; - - va_start(args, f); - devname = va_arg(args, char*); - va_end(args); - - /* On first open, do netif open, mount, etc. */ - if (netdev_opens == 0) { - /* Find network interface. */ - if (netdev_sock < 0) { - netdev_sock = netif_open(devname); - if (netdev_sock < 0) { - printf("net_open: netif_open() failed\n"); - return (ENXIO); - } - if (debug) - printf("net_open: netif_open() succeeded\n"); - } - if (rootip.s_addr == 0) { - /* Get root IP address, and path, etc. */ - error = net_getparams(netdev_sock); - if (error) { + va_list args; + char *devname; /* Device part of file name (or NULL). */ + int error = 0; + + va_start(args, f); + devname = va_arg(args, char*); + va_end(args); + + /* On first open, do netif open, mount, etc. */ + if (netdev_opens == 0) { + /* Find network interface. */ + if (netdev_sock < 0) { + netdev_sock = netif_open(devname); + if (netdev_sock < 0) { + printf("net_open: netif_open() failed\n"); + return (ENXIO); + } + if (debug) + printf("net_open: netif_open() succeeded\n"); + } + if (rootip.s_addr == 0) { + /* Get root IP address, and path, etc. */ + error = net_getparams(netdev_sock); + if (error) { /* getparams makes its own noise */ - netif_close(netdev_sock); - netdev_sock = -1; - return (error); - } + netif_close(netdev_sock); + netdev_sock = -1; + return (error); + } + } + netdev_opens++; } netdev_opens++; - } - netdev_opens++; - f->f_devdata = &netdev_sock; - return (error); + f->f_devdata = &netdev_sock; + return (error); } int -net_close(f) - struct open_file *f; +net_close(struct open_file *f) { - #ifdef NETIF_DEBUG - if (debug) - printf("net_close: opens=%d\n", netdev_opens); + if (debug) + printf("net_close: opens=%d\n", netdev_opens); #endif - /* On last close, do netif close, etc. */ - f->f_devdata = NULL; - /* Extra close call? */ - if (netdev_opens <= 0) + /* On last close, do netif close, etc. */ + f->f_devdata = NULL; + /* Extra close call? */ + if (netdev_opens <= 0) + return (0); + netdev_opens--; + /* Not last close? */ + if (netdev_opens > 0) + return(0); + rootip.s_addr = 0; + if (netdev_sock >= 0) { + if (debug) + printf("net_close: calling netif_close()\n"); + netif_close(netdev_sock); + netdev_sock = -1; + } return (0); - netdev_opens--; - /* Not last close? */ - if (netdev_opens > 0) - return(0); - rootip.s_addr = 0; - if (netdev_sock >= 0) { - if (debug) - printf("net_close: calling netif_close()\n"); - netif_close(netdev_sock); - netdev_sock = -1; - } - return (0); } int net_strategy() { - return EIO; + + return (EIO); } #define SUPPORT_BOOTP @@ -206,106 +206,118 @@ int try_bootp = 1; extern n_long ip_convertaddr(char *p); static int -net_getparams(sock) - int sock; +net_getparams(int sock) { - char buf[MAXHOSTNAMELEN]; - char temp[FNAME_SIZE]; - struct iodesc *d; - int i; - n_long smask; + char buf[MAXHOSTNAMELEN]; + char temp[FNAME_SIZE]; + struct iodesc *d; + int i; + n_long smask; #ifdef SUPPORT_BOOTP - /* - * Try to get boot info using BOOTP. If we succeed, then - * the server IP address, gateway, and root path will all - * be initialized. If any remain uninitialized, we will - * use RARP and RPC/bootparam (the Sun way) to get them. - */ - if (try_bootp) - bootp(sock, BOOTP_NONE); - if (myip.s_addr != 0) - goto exit; - if (debug) - printf("net_open: BOOTP failed, trying RARP/RPC...\n"); + /* + * Try to get boot info using BOOTP. If we succeed, then + * the server IP address, gateway, and root path will all + * be initialized. If any remain uninitialized, we will + * use RARP and RPC/bootparam (the Sun way) to get them. + */ + if (try_bootp) + bootp(sock, BOOTP_NONE); + if (myip.s_addr != 0) + goto exit; + if (debug) + printf("net_open: BOOTP failed, trying RARP/RPC...\n"); #endif - /* - * Use RARP to get our IP address. This also sets our - * netmask to the "natural" default for our address. - */ - if (rarp_getipaddress(sock)) { - printf("net_open: RARP failed\n"); - return (EIO); - } - printf("net_open: client addr: %s\n", inet_ntoa(myip)); + /* + * Use RARP to get our IP address. This also sets our + * netmask to the "natural" default for our address. + */ + if (rarp_getipaddress(sock)) { + printf("net_open: RARP failed\n"); + return (EIO); + } + printf("net_open: client addr: %s\n", inet_ntoa(myip)); - /* Get our hostname, server IP address, gateway. */ - if (bp_whoami(sock)) { - printf("net_open: bootparam/whoami RPC failed\n"); - return (EIO); - } - if (debug) - printf("net_open: client name: %s\n", hostname); - - /* - * Ignore the gateway from whoami (unreliable). - * Use the "gateway" parameter instead. - */ - smask = 0; - gateip.s_addr = 0; - if (bp_getfile(sock, "gateway", &gateip, buf) == 0) { - /* Got it! Parse the netmask. */ - smask = ip_convertaddr(buf); - } - if (smask) { - netmask = smask; - if (debug) - printf("net_open: subnet mask: %s\n", intoa(netmask)); - } - if (gateip.s_addr && debug) - printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); - - /* Get the root server and pathname. */ - if (bp_getfile(sock, "root", &rootip, rootpath)) { - printf("net_open: bootparam/getfile RPC failed\n"); - return (EIO); - } - exit: - /* - * If present, strip the server's address off of the rootpath - * before passing it along. This allows us to be compatible with - * the kernel's diskless (BOOTP_NFSROOT) booting conventions - */ - for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) - if (rootpath[i] == ':') - break; - if (i && i != FNAME_SIZE && rootpath[i] == ':') { - rootpath[i++] = '\0'; - if (inet_addr(&rootpath[0]) != INADDR_NONE) - rootip.s_addr = inet_addr(&rootpath[0]); - bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); - bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); - } - if (debug) { - printf("net_open: server addr: %s\n", inet_ntoa(rootip)); - printf("net_open: server path: %s\n", rootpath); - } - - d = socktodesc(sock); - sprintf(temp, "%6D", d->myea, ":"); - setenv("boot.netif.ip", inet_ntoa(myip), 1); - setenv("boot.netif.netmask", intoa(netmask), 1); - setenv("boot.netif.gateway", inet_ntoa(gateip), 1); - setenv("boot.netif.hwaddr", temp, 1); - setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); - setenv("boot.nfsroot.path", rootpath, 1); + /* Get our hostname, server IP address, gateway. */ + if (bp_whoami(sock)) { + printf("net_open: bootparam/whoami RPC failed\n"); + return (EIO); + } + if (debug) + printf("net_open: client name: %s\n", hostname); + + /* + * Ignore the gateway from whoami (unreliable). + * Use the "gateway" parameter instead. + */ + smask = 0; + gateip.s_addr = 0; + if (bp_getfile(sock, "gateway", &gateip, buf) == 0) { + /* Got it! Parse the netmask. */ + smask = ip_convertaddr(buf); + } + if (smask) { + netmask = smask; + if (debug) + printf("net_open: subnet mask: %s\n", intoa(netmask)); + } + if (gateip.s_addr && debug) + printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); - return (0); + /* Get the root server and pathname. */ + if (bp_getfile(sock, "root", &rootip, rootpath)) { + printf("net_open: bootparam/getfile RPC failed\n"); + return (EIO); + } +exit: + /* + * If present, strip the server's address off of the rootpath + * before passing it along. This allows us to be compatible with + * the kernel's diskless (BOOTP_NFSROOT) booting conventions + */ + for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) + if (rootpath[i] == ':') + break; + if (i && i != FNAME_SIZE && rootpath[i] == ':') { + rootpath[i++] = '\0'; + if (inet_addr(&rootpath[0]) != INADDR_NONE) + rootip.s_addr = inet_addr(&rootpath[0]); + bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); + bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); + } + if (debug) { + printf("net_open: server addr: %s\n", inet_ntoa(rootip)); + printf("net_open: server path: %s\n", rootpath); + } + + d = socktodesc(sock); + sprintf(temp, "%6D", d->myea, ":"); + setenv("boot.netif.ip", inet_ntoa(myip), 1); + setenv("boot.netif.netmask", intoa(netmask), 1); + setenv("boot.netif.gateway", inet_ntoa(gateip), 1); + setenv("boot.netif.hwaddr", temp, 1); + setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); + setenv("boot.nfsroot.path", rootpath, 1); + + return (0); } static void net_print(int verbose) { - return; + struct netif_driver *drv; + int i, d, cnt; + + cnt = 0; + for (d = 0; netif_drivers[d]; d++) { + drv = netif_drivers[d]; + for (i = 0; i < drv->netif_nifs; i++) { + printf("\t%s%d:", "net", cnt++); + if (verbose) + printf(" (%s%d)", drv->netif_bname, + drv->netif_ifs[i].dif_unit); + } + } + printf("\n"); } Modified: stable/7/sys/boot/common/devopen.c ============================================================================== --- stable/7/sys/boot/common/devopen.c Fri Jan 15 15:16:49 2010 (r202367) +++ stable/7/sys/boot/common/devopen.c Fri Jan 15 15:23:38 2010 (r202368) @@ -35,32 +35,33 @@ __FBSDID("$FreeBSD$"); int devopen(struct open_file *f, const char *fname, const char **file) { - struct devdesc *dev; - int result; + struct devdesc *dev; + int result; - result = archsw.arch_getdev((void **)&dev, fname, file); - if (result) - return (result); + result = archsw.arch_getdev((void **)&dev, fname, file); + if (result) + return (result); - /* point to device-specific data so that device open can use it */ - f->f_devdata = dev; - result = dev->d_dev->dv_open(f, dev); - if (result != 0) { - f->f_devdata = NULL; - free(dev); - return (result); - } + /* point to device-specific data so that device open can use it */ + f->f_devdata = dev; + result = dev->d_dev->dv_open(f, dev); + if (result != 0) { + f->f_devdata = NULL; + free(dev); + return (result); + } - /* reference the devsw entry from the open_file structure */ - f->f_dev = dev->d_dev; - return (0); + /* reference the devsw entry from the open_file structure */ + f->f_dev = dev->d_dev; + return (0); } int devclose(struct open_file *f) { - if (f->f_devdata != NULL) { - free(f->f_devdata); - } - return(0); + + if (f->f_devdata != NULL) { + free(f->f_devdata); + } + return (0); } From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:26:04 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FB091065782; Fri, 15 Jan 2010 15:26:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0ECC8FC14; Fri, 15 Jan 2010 15:26: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 o0FFQ32O011481; Fri, 15 Jan 2010 15:26:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFQ3ig011479; Fri, 15 Jan 2010 15:26:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151526.o0FFQ3ig011479@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202369 - stable/7/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:26:04 -0000 Author: marius Date: Fri Jan 15 15:26:03 2010 New Revision: 202369 URL: http://svn.freebsd.org/changeset/base/202369 Log: MFC: r200945 - Consistently wrap debugging in NETIF_DEBUG. This basically merges NetBSD rev 1.19. - Make the functions match their prototypes regarding static. Modified: stable/7/sys/boot/common/dev_net.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:23:38 2010 (r202368) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:26:03 2010 (r202369) @@ -76,7 +76,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #include "bootstrap.h" +#ifdef NETIF_DEBUG int debug = 0; +#endif static int netdev_sock = -1; static int netdev_opens; @@ -100,7 +102,7 @@ struct devsw netdev = { net_print }; -int +static int net_init(void) { @@ -112,7 +114,7 @@ net_init(void) * This opens the low-level device and sets f->f_devdata. * This is declared with variable arguments... */ -int +static int net_open(struct open_file *f, ...) { va_list args; @@ -132,8 +134,10 @@ net_open(struct open_file *f, ...) printf("net_open: netif_open() failed\n"); return (ENXIO); } +#ifdef NETIF_DEBUG if (debug) - printf("net_open: netif_open() succeeded\n"); + printf("net_open: netif_open() succeeded\n"); +#endif } if (rootip.s_addr == 0) { /* Get root IP address, and path, etc. */ @@ -152,7 +156,7 @@ net_open(struct open_file *f, ...) return (error); } -int +static int net_close(struct open_file *f) { #ifdef NETIF_DEBUG @@ -171,15 +175,17 @@ net_close(struct open_file *f) return(0); rootip.s_addr = 0; if (netdev_sock >= 0) { +#ifdef NETIF_DEBUG if (debug) printf("net_close: calling netif_close()\n"); +#endif netif_close(netdev_sock); netdev_sock = -1; } return (0); } -int +static int net_strategy() { @@ -225,9 +231,11 @@ net_getparams(int sock) bootp(sock, BOOTP_NONE); if (myip.s_addr != 0) goto exit; +#ifdef NETIF_DEBUG if (debug) printf("net_open: BOOTP failed, trying RARP/RPC...\n"); #endif +#endif /* * Use RARP to get our IP address. This also sets our @@ -244,8 +252,10 @@ net_getparams(int sock) printf("net_open: bootparam/whoami RPC failed\n"); return (EIO); } +#ifdef NETIF_DEBUG if (debug) printf("net_open: client name: %s\n", hostname); +#endif /* * Ignore the gateway from whoami (unreliable). @@ -259,11 +269,15 @@ net_getparams(int sock) } if (smask) { netmask = smask; +#ifdef NETIF_DEBUG if (debug) - printf("net_open: subnet mask: %s\n", intoa(netmask)); + printf("net_open: subnet mask: %s\n", intoa(netmask)); +#endif } +#ifdef NETIF_DEBUG if (gateip.s_addr && debug) printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); +#endif /* Get the root server and pathname. */ if (bp_getfile(sock, "root", &rootip, rootpath)) { @@ -286,10 +300,12 @@ exit: bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); } +#ifdef NETIF_DEBUG if (debug) { printf("net_open: server addr: %s\n", inet_ntoa(rootip)); printf("net_open: server path: %s\n", rootpath); } +#endif d = socktodesc(sock); sprintf(temp, "%6D", d->myea, ":"); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:27:17 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7658B1065693; Fri, 15 Jan 2010 15:27:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5788F8FC0A; Fri, 15 Jan 2010 15:27:17 +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 o0FFRHId011823; Fri, 15 Jan 2010 15:27:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFRHAj011821; Fri, 15 Jan 2010 15:27:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151527.o0FFRHAj011821@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:27:17 +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: r202370 - stable/8/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:27:17 -0000 Author: marius Date: Fri Jan 15 15:27:17 2010 New Revision: 202370 URL: http://svn.freebsd.org/changeset/base/202370 Log: MFC: r200945 - Consistently wrap debugging in NETIF_DEBUG. This basically merges NetBSD rev 1.19. - Make the functions match their prototypes regarding static. Modified: stable/8/sys/boot/common/dev_net.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) Modified: stable/8/sys/boot/common/dev_net.c ============================================================================== --- stable/8/sys/boot/common/dev_net.c Fri Jan 15 15:26:03 2010 (r202369) +++ stable/8/sys/boot/common/dev_net.c Fri Jan 15 15:27:17 2010 (r202370) @@ -76,7 +76,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #include "bootstrap.h" +#ifdef NETIF_DEBUG int debug = 0; +#endif static int netdev_sock = -1; static int netdev_opens; @@ -100,7 +102,7 @@ struct devsw netdev = { net_print }; -int +static int net_init(void) { @@ -112,7 +114,7 @@ net_init(void) * This opens the low-level device and sets f->f_devdata. * This is declared with variable arguments... */ -int +static int net_open(struct open_file *f, ...) { va_list args; @@ -132,8 +134,10 @@ net_open(struct open_file *f, ...) printf("net_open: netif_open() failed\n"); return (ENXIO); } +#ifdef NETIF_DEBUG if (debug) - printf("net_open: netif_open() succeeded\n"); + printf("net_open: netif_open() succeeded\n"); +#endif } if (rootip.s_addr == 0) { /* Get root IP address, and path, etc. */ @@ -154,7 +158,7 @@ net_open(struct open_file *f, ...) return (error); } -int +static int net_close(struct open_file *f) { #ifdef NETIF_DEBUG @@ -173,15 +177,17 @@ net_close(struct open_file *f) return(0); rootip.s_addr = 0; if (netdev_sock >= 0) { +#ifdef NETIF_DEBUG if (debug) printf("net_close: calling netif_close()\n"); +#endif netif_close(netdev_sock); netdev_sock = -1; } return (0); } -int +static int net_strategy() { @@ -227,9 +233,11 @@ net_getparams(int sock) bootp(sock, BOOTP_NONE); if (myip.s_addr != 0) goto exit; +#ifdef NETIF_DEBUG if (debug) printf("net_open: BOOTP failed, trying RARP/RPC...\n"); #endif +#endif /* * Use RARP to get our IP address. This also sets our @@ -246,8 +254,10 @@ net_getparams(int sock) printf("net_open: bootparam/whoami RPC failed\n"); return (EIO); } +#ifdef NETIF_DEBUG if (debug) printf("net_open: client name: %s\n", hostname); +#endif /* * Ignore the gateway from whoami (unreliable). @@ -261,11 +271,15 @@ net_getparams(int sock) } if (smask) { netmask = smask; +#ifdef NETIF_DEBUG if (debug) - printf("net_open: subnet mask: %s\n", intoa(netmask)); + printf("net_open: subnet mask: %s\n", intoa(netmask)); +#endif } +#ifdef NETIF_DEBUG if (gateip.s_addr && debug) printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); +#endif /* Get the root server and pathname. */ if (bp_getfile(sock, "root", &rootip, rootpath)) { @@ -288,10 +302,12 @@ exit: bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); } +#ifdef NETIF_DEBUG if (debug) { printf("net_open: server addr: %s\n", inet_ntoa(rootip)); printf("net_open: server path: %s\n", rootpath); } +#endif d = socktodesc(sock); sprintf(temp, "%6D", d->myea, ":"); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:28:57 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8141010656AE; Fri, 15 Jan 2010 15:28:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E9BB8FC14; Fri, 15 Jan 2010 15:28:57 +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 o0FFSv4r012249; Fri, 15 Jan 2010 15:28:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFSvgC012247; Fri, 15 Jan 2010 15:28:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151528.o0FFSvgC012247@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:28:57 +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: r202371 - stable/8/sys/boot/sparc64/loader X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:28:57 -0000 Author: marius Date: Fri Jan 15 15:28:57 2010 New Revision: 202371 URL: http://svn.freebsd.org/changeset/base/202371 Log: MFC: r200946 Execute the cleanup handlers before jumping to the kernel just like the other architectures do. Modified: stable/8/sys/boot/sparc64/loader/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) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Fri Jan 15 15:27:17 2010 (r202370) +++ stable/8/sys/boot/sparc64/loader/main.c Fri Jan 15 15:28:57 2010 (r202371) @@ -386,6 +386,8 @@ __elfN(exec)(struct preloaded_file *fp) pmap_print_tlb_sun4u(); #endif + dev_cleanup(); + entry = e->e_entry; OF_release((void *)heapva, HEAPSZ); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:28:58 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73D6310656B3; Fri, 15 Jan 2010 15:28:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 613CB8FC16; Fri, 15 Jan 2010 15:28:58 +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 o0FFSwM5012279; Fri, 15 Jan 2010 15:28:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFSw86012277; Fri, 15 Jan 2010 15:28:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151528.o0FFSw86012277@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202372 - stable/7/sys/boot/sparc64/loader X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:28:58 -0000 Author: marius Date: Fri Jan 15 15:28:58 2010 New Revision: 202372 URL: http://svn.freebsd.org/changeset/base/202372 Log: MFC: r200946 Execute the cleanup handlers before jumping to the kernel just like the other architectures do. Modified: stable/7/sys/boot/sparc64/loader/main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Fri Jan 15 15:28:57 2010 (r202371) +++ stable/7/sys/boot/sparc64/loader/main.c Fri Jan 15 15:28:58 2010 (r202372) @@ -387,6 +387,8 @@ __elfN(exec)(struct preloaded_file *fp) pmap_print_tlb_sun4u(); #endif + dev_cleanup(); + entry = e->e_entry; OF_release((void *)heapva, HEAPSZ); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:36:13 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2412A1065694; Fri, 15 Jan 2010 15:36:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 114FF8FC1B; Fri, 15 Jan 2010 15:36: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 o0FFaCaa013924; Fri, 15 Jan 2010 15:36:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFaCUY013922; Fri, 15 Jan 2010 15:36:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151536.o0FFaCUY013922@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:36: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: r202373 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:36:13 -0000 Author: marius Date: Fri Jan 15 15:36:12 2010 New Revision: 202373 URL: http://svn.freebsd.org/changeset/base/202373 Log: MFC: r200947 Add missing locking in intr_bind(). Modified: stable/8/sys/sparc64/sparc64/intr_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) Modified: stable/8/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/intr_machdep.c Fri Jan 15 15:28:58 2010 (r202372) +++ stable/8/sys/sparc64/sparc64/intr_machdep.c Fri Jan 15 15:36:12 2010 (r202373) @@ -450,13 +450,19 @@ int intr_bind(int vec, u_char cpu) { struct intr_vector *iv; + int error; if (vec < 0 || vec >= IV_MAX) return (EINVAL); + sx_xlock(&intr_table_lock); iv = &intr_vectors[vec]; - if (iv == NULL) + if (iv == NULL) { + sx_xunlock(&intr_table_lock); return (EINVAL); - return (intr_event_bind(iv->iv_event, cpu)); + } + error = intr_event_bind(iv->iv_event, cpu); + sx_xunlock(&intr_table_lock); + return (error); } /* From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:36:24 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87F4D1065695; Fri, 15 Jan 2010 15:36:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 758B38FC31; Fri, 15 Jan 2010 15:36: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 o0FFaOGx013993; Fri, 15 Jan 2010 15:36:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFaO2v013991; Fri, 15 Jan 2010 15:36:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151536.o0FFaO2v013991@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202374 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:36:24 -0000 Author: marius Date: Fri Jan 15 15:36:24 2010 New Revision: 202374 URL: http://svn.freebsd.org/changeset/base/202374 Log: MFC: r200947 Add missing locking in intr_bind(). Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Fri Jan 15 15:36:12 2010 (r202373) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Fri Jan 15 15:36:24 2010 (r202374) @@ -451,13 +451,19 @@ int intr_bind(int vec, u_char cpu) { struct intr_vector *iv; + int error; if (vec < 0 || vec >= IV_MAX) return (EINVAL); + sx_xlock(&intr_table_lock); iv = &intr_vectors[vec]; - if (iv == NULL) + if (iv == NULL) { + sx_xunlock(&intr_table_lock); return (EINVAL); - return (intr_event_bind(iv->iv_event, cpu)); + } + error = intr_event_bind(iv->iv_event, cpu); + sx_xunlock(&intr_table_lock); + return (error); } /* From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:38:49 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8530810656AA; Fri, 15 Jan 2010 15:38:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 725088FC32; Fri, 15 Jan 2010 15:38:49 +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 o0FFcn98014697; Fri, 15 Jan 2010 15:38:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFcnBr014695; Fri, 15 Jan 2010 15:38:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151538.o0FFcnBr014695@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:38:49 +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: r202377 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:38:49 -0000 Author: marius Date: Fri Jan 15 15:38:49 2010 New Revision: 202377 URL: http://svn.freebsd.org/changeset/base/202377 Log: - Hook up the default implementations of the MSI/MSI-X pcib_if methods so requests may bubble up to a host-PCI bridge driver. - Distinguish between PCI and PCIe bridges in the device description so it's a bit easier to follow what hangs off of what in the dmesg. Unfortunately we can't also tell PCI and PCI-X apart based on the information provided in the OFW device tree. - Add quirk handling for the ALi M5249 found in Fire-based machines which are used as a PCIe-PCIe bridge there. These are obviously subtractive decoding as as they have a PCI-ISA bridge on their secondary side (and likewise don't include the ISA I/O range in their bridge decode) but don't indicate this via the class code. Given that this quirk isn't likely to apply to all ALi M5249 and I have no datasheet for these chips so I could implement a check using the chip specific bits enabling subtractive decoding this quirk handling is added to the MD code rather than the MI one. Modified: stable/8/sys/sparc64/pci/ofw_pcib.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) Modified: stable/8/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcib.c Fri Jan 15 15:38:31 2010 (r202376) +++ stable/8/sys/sparc64/pci/ofw_pcib.c Fri Jan 15 15:38:49 2010 (r202377) @@ -3,6 +3,7 @@ * Copyright (c) 2000 Michael Smith * Copyright (c) 2000 BSDi * Copyright (c) 2001 - 2003 Thomas Moestl + * Copyright (c) 2009 by Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,8 +38,9 @@ __FBSDID("$FreeBSD$"); #include "opt_ofw_pci.h" #include -#include #include +#include +#include #include #include @@ -82,6 +84,11 @@ static device_method_t ofw_pcib_methods[ DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, ofw_pcib_gen_route_interrupt), + DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), + DEVMETHOD(pcib_map_msi, pcib_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), @@ -100,19 +107,49 @@ MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); static int ofw_pcib_probe(device_t dev) { + char desc[sizeof("OFW PCIe-PCIe bridge")]; + const char *dtype, *pbdtype; + +#define ISDTYPE(dtype, type) \ + (((dtype) != NULL) && strcmp((dtype), (type)) == 0) if ((pci_get_class(dev) == PCIC_BRIDGE) && (pci_get_subclass(dev) == PCIS_BRIDGE_PCI) && ofw_bus_get_node(dev) != 0) { - device_set_desc(dev, "OFW PCI-PCI bridge"); + dtype = ofw_bus_get_type(dev); + pbdtype = ofw_bus_get_type(device_get_parent( + device_get_parent(dev))); + snprintf(desc, sizeof(desc), "OFW PCI%s-PCI%s bridge", + ISDTYPE(pbdtype, OFW_TYPE_PCIE) ? "e" : "", + ISDTYPE(dtype, OFW_TYPE_PCIE) ? "e" : ""); + device_set_desc_copy(dev, desc); return (0); } + +#undef ISDTYPE + return (ENXIO); } static int ofw_pcib_attach(device_t dev) { + struct ofw_pcib_gen_softc *sc; + + sc = device_get_softc(dev); + + /* Quirk handling */ + switch (pci_get_devid(dev)) { + /* + * The ALi M5249 found in Fire-based machines by definition must me + * subtractive as they have a ISA bridge on their secondary side but + * don't indicate this in the class code although the ISA I/O range + * isn't included in their bridge decode. + */ + case 0x524910b9: + sc->ops_pcib_sc.flags |= PCIB_SUBTRACTIVE; + break; + } ofw_pcib_gen_setup(dev); pcib_attach_common(dev); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:38:54 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C6941065676; Fri, 15 Jan 2010 15:38:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39B778FC31; Fri, 15 Jan 2010 15:38: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 o0FFcshA014765; Fri, 15 Jan 2010 15:38:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFcseu014763; Fri, 15 Jan 2010 15:38:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151538.o0FFcseu014763@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202378 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:38:54 -0000 Author: marius Date: Fri Jan 15 15:38:53 2010 New Revision: 202378 URL: http://svn.freebsd.org/changeset/base/202378 Log: - Hook up the default implementations of the MSI/MSI-X pcib_if methods so requests may bubble up to a host-PCI bridge driver. - Distinguish between PCI and PCIe bridges in the device description so it's a bit easier to follow what hangs off of what in the dmesg. Unfortunately we can't also tell PCI and PCI-X apart based on the information provided in the OFW device tree. - Add quirk handling for the ALi M5249 found in Fire-based machines which are used as a PCIe-PCIe bridge there. These are obviously subtractive decoding as as they have a PCI-ISA bridge on their secondary side (and likewise don't include the ISA I/O range in their bridge decode) but don't indicate this via the class code. Given that this quirk isn't likely to apply to all ALi M5249 and I have no datasheet for these chips so I could implement a check using the chip specific bits enabling subtractive decoding this quirk handling is added to the MD code rather than the MI one. Modified: stable/7/sys/sparc64/pci/ofw_pcib.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcib.c Fri Jan 15 15:38:49 2010 (r202377) +++ stable/7/sys/sparc64/pci/ofw_pcib.c Fri Jan 15 15:38:53 2010 (r202378) @@ -3,6 +3,7 @@ * Copyright (c) 2000 Michael Smith * Copyright (c) 2000 BSDi * Copyright (c) 2001 - 2003 Thomas Moestl + * Copyright (c) 2009 by Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,8 +38,9 @@ __FBSDID("$FreeBSD$"); #include "opt_ofw_pci.h" #include -#include #include +#include +#include #include #include @@ -83,6 +85,11 @@ static device_method_t ofw_pcib_methods[ DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, ofw_pcib_gen_route_interrupt), + DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), + DEVMETHOD(pcib_map_msi, pcib_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), @@ -100,19 +107,49 @@ MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); static int ofw_pcib_probe(device_t dev) { + char desc[sizeof("OFW PCIe-PCIe bridge")]; + const char *dtype, *pbdtype; + +#define ISDTYPE(dtype, type) \ + (((dtype) != NULL) && strcmp((dtype), (type)) == 0) if ((pci_get_class(dev) == PCIC_BRIDGE) && (pci_get_subclass(dev) == PCIS_BRIDGE_PCI) && ofw_bus_get_node(dev) != 0) { - device_set_desc(dev, "OFW PCI-PCI bridge"); + dtype = ofw_bus_get_type(dev); + pbdtype = ofw_bus_get_type(device_get_parent( + device_get_parent(dev))); + snprintf(desc, sizeof(desc), "OFW PCI%s-PCI%s bridge", + ISDTYPE(pbdtype, OFW_TYPE_PCIE) ? "e" : "", + ISDTYPE(dtype, OFW_TYPE_PCIE) ? "e" : ""); + device_set_desc_copy(dev, desc); return (0); } + +#undef ISDTYPE + return (ENXIO); } static int ofw_pcib_attach(device_t dev) { + struct ofw_pcib_gen_softc *sc; + + sc = device_get_softc(dev); + + /* Quirk handling */ + switch (pci_get_devid(dev)) { + /* + * The ALi M5249 found in Fire-based machines by definition must me + * subtractive as they have a ISA bridge on their secondary side but + * don't indicate this in the class code although the ISA I/O range + * isn't included in their bridge decode. + */ + case 0x524910b9: + sc->ops_pcib_sc.flags |= PCIB_SUBTRACTIVE; + break; + } ofw_pcib_gen_setup(dev); pcib_attach_common(dev); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:40:45 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E5471065692; Fri, 15 Jan 2010 15:40:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2658FC16; Fri, 15 Jan 2010 15:40: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 o0FFej8W015279; Fri, 15 Jan 2010 15:40:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFeiUj015275; Fri, 15 Jan 2010 15:40:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151540.o0FFeiUj015275@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:40: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: r202380 - stable/8/sys/dev/mk48txx X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:40:45 -0000 Author: marius Date: Fri Jan 15 15:40:44 2010 New Revision: 202380 URL: http://svn.freebsd.org/changeset/base/202380 Log: MFC: r201003 Style changes Modified: stable/8/sys/dev/mk48txx/mk48txx.c stable/8/sys/dev/mk48txx/mk48txxreg.h stable/8/sys/dev/mk48txx/mk48txxvar.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) Modified: stable/8/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:39:40 2010 (r202379) +++ stable/8/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:40:44 2010 (r202380) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); /* - * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines. + * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines */ #include @@ -59,17 +59,17 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" -static uint8_t mk48txx_def_nvrd(device_t, int); -static void mk48txx_def_nvwr(device_t, int, uint8_t); -static void mk48txx_watchdog(void *, u_int, int *); +static uint8_t mk48txx_def_nvrd(device_t dev, int off); +static void mk48txx_def_nvwr(device_t dev, int off, uint8_t v); +static void mk48txx_watchdog(void *arg, u_int cmd, int *error); -struct { +static const struct { const char *name; bus_size_t nvramsz; bus_size_t clkoff; - int flags; -#define MK48TXX_EXT_REGISTERS 1 /* Has extended register set */ -} mk48txx_models[] = { + u_int flags; +#define MK48TXX_EXT_REGISTERS 1 /* Has extended register set. */ +} const mk48txx_models[] = { { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, @@ -112,7 +112,7 @@ mk48txx_attach(device_t dev) if (mk48txx_models[i].flags & MK48TXX_EXT_REGISTERS) { mtx_lock(&sc->sc_mtx); - if ((*sc->sc_nvrd)(dev, sc->sc_clkoffset + MK48TXX_FLAGS) & + if ((*sc->sc_nvrd)(dev, sc->sc_clkoffset + MK48TXX_FLAGS) & MK48TXX_FLAGS_BL) { mtx_unlock(&sc->sc_mtx); device_printf(dev, "%s: battery low\n", __func__); @@ -140,7 +140,7 @@ mk48txx_attach(device_t dev) } } - clock_register(dev, 1000000); /* 1 second resolution. */ + clock_register(dev, 1000000); /* 1 second resolution */ if ((sc->sc_flag & MK48TXX_WDOG_REGISTER) && (mk48txx_models[i].flags & MK48TXX_EXT_REGISTERS)) { Modified: stable/8/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:39:40 2010 (r202379) +++ stable/8/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:40:44 2010 (r202380) @@ -59,23 +59,23 @@ * The first bank of eight registers at offset (nvramsz - 16) is * available only on recenter (which?) MK48Txx models. */ -#define MK48TXX_FLAGS 0 /* flags register */ -#define MK48TXX_UNUSED 1 /* unused */ -#define MK48TXX_ASEC 2 /* alarm seconds (0..59; BCD) */ -#define MK48TXX_AMIN 3 /* alarm minutes (0..59; BCD) */ -#define MK48TXX_AHOUR 4 /* alarm hours (0..23; BCD) */ -#define MK48TXX_ADAY 5 /* alarm day in month (1..31; BCD) */ -#define MK48TXX_INTR 6 /* interrupts register */ -#define MK48TXX_WDOG 7 /* watchdog register */ - -#define MK48TXX_ICSR 8 /* control register */ -#define MK48TXX_ISEC 9 /* seconds (0..59; BCD) */ -#define MK48TXX_IMIN 10 /* minutes (0..59; BCD) */ -#define MK48TXX_IHOUR 11 /* hours (0..23; BCD) */ -#define MK48TXX_IWDAY 12 /* weekday (1..7) */ -#define MK48TXX_IDAY 13 /* day in month (1..31; BCD) */ -#define MK48TXX_IMON 14 /* month (1..12; BCD) */ -#define MK48TXX_IYEAR 15 /* year (0..99; BCD) */ +#define MK48TXX_FLAGS 0 /* flags register */ +#define MK48TXX_UNUSED 1 /* unused */ +#define MK48TXX_ASEC 2 /* alarm seconds (0..59; BCD) */ +#define MK48TXX_AMIN 3 /* alarm minutes (0..59; BCD) */ +#define MK48TXX_AHOUR 4 /* alarm hours (0..23; BCD) */ +#define MK48TXX_ADAY 5 /* alarm day in month (1..31; BCD) */ +#define MK48TXX_INTR 6 /* interrupts register */ +#define MK48TXX_WDOG 7 /* watchdog register */ + +#define MK48TXX_ICSR 8 /* control register */ +#define MK48TXX_ISEC 9 /* seconds (0..59; BCD) */ +#define MK48TXX_IMIN 10 /* minutes (0..59; BCD) */ +#define MK48TXX_IHOUR 11 /* hours (0..23; BCD) */ +#define MK48TXX_IWDAY 12 /* weekday (1..7) */ +#define MK48TXX_IDAY 13 /* day in month (1..31; BCD) */ +#define MK48TXX_IMON 14 /* month (1..12; BCD) */ +#define MK48TXX_IYEAR 15 /* year (0..99; BCD) */ /* * Note that some of the bits below that are not in the first eight @@ -84,80 +84,80 @@ */ /* Bits in the flags register (extended only) */ -#define MK48TXX_FLAGS_BL 0x10 /* battery low (read only) */ -#define MK48TXX_FLAGS_AF 0x40 /* alarm flag (read only) */ -#define MK48TXX_FLAGS_WDF 0x80 /* watchdog flag (read only) */ +#define MK48TXX_FLAGS_BL 0x10 /* battery low (read only) */ +#define MK48TXX_FLAGS_AF 0x40 /* alarm flag (read only) */ +#define MK48TXX_FLAGS_WDF 0x80 /* watchdog flag (read only) */ /* Bits in the alarm seconds register (extended only) */ -#define MK48TXX_ASEC_MASK 0x7f /* mask for alarm seconds */ -#define MK48TXX_ASEC_RPT1 0x80 /* alarm repeat mode bit 1 */ +#define MK48TXX_ASEC_MASK 0x7f /* mask for alarm seconds */ +#define MK48TXX_ASEC_RPT1 0x80 /* alarm repeat mode bit 1 */ /* Bits in the alarm minutes register (extended only) */ -#define MK48TXX_AMIN_MASK 0x7f /* mask for alarm minutes */ -#define MK48TXX_AMIN_RPT2 0x80 /* alarm repeat mode bit 2 */ +#define MK48TXX_AMIN_MASK 0x7f /* mask for alarm minutes */ +#define MK48TXX_AMIN_RPT2 0x80 /* alarm repeat mode bit 2 */ /* Bits in the alarm hours register (extended only) */ -#define MK48TXX_AHOUR_MASK 0x3f /* mask for alarm hours */ -#define MK48TXX_AHOUR_RPT3 0x80 /* alarm repeat mode bit 3 */ +#define MK48TXX_AHOUR_MASK 0x3f /* mask for alarm hours */ +#define MK48TXX_AHOUR_RPT3 0x80 /* alarm repeat mode bit 3 */ /* Bits in the alarm day in month register (extended only) */ -#define MK48TXX_ADAY_MASK 0x3f /* mask for alarm day in month */ -#define MK48TXX_ADAY_RPT4 0x80 /* alarm repeat mode bit 4 */ +#define MK48TXX_ADAY_MASK 0x3f /* mask for alarm day in month */ +#define MK48TXX_ADAY_RPT4 0x80 /* alarm repeat mode bit 4 */ /* Bits in the interrupts register (extended only) */ -#define MK48TXX_INTR_ABE 0x20 /* alarm in battery back-up mode */ -#define MK48TXX_INTR_AFE 0x80 /* alarm flag enable */ +#define MK48TXX_INTR_ABE 0x20 /* alarm in battery back-up mode */ +#define MK48TXX_INTR_AFE 0x80 /* alarm flag enable */ /* Bits in the watchdog register (extended only) */ -#define MK48TXX_WDOG_RB_1_16 0x00 /* watchdog resolution 1/16 second */ -#define MK48TXX_WDOG_RB_1_4 0x01 /* watchdog resolution 1/4 second */ -#define MK48TXX_WDOG_RB_1 0x02 /* watchdog resolution 1 second */ -#define MK48TXX_WDOG_RB_4 0x03 /* watchdog resolution 4 seconds */ -#define MK48TXX_WDOG_BMB_MASK 0x7c /* mask for watchdog multiplier */ -#define MK48TXX_WDOG_BMB_SHIFT 2 /* shift for watchdog multiplier */ -#define MK48TXX_WDOG_WDS 0x80 /* watchdog steering bit */ +#define MK48TXX_WDOG_RB_1_16 0x00 /* watchdog resolution 1/16 second */ +#define MK48TXX_WDOG_RB_1_4 0x01 /* watchdog resolution 1/4 second */ +#define MK48TXX_WDOG_RB_1 0x02 /* watchdog resolution 1 second */ +#define MK48TXX_WDOG_RB_4 0x03 /* watchdog resolution 4 seconds */ +#define MK48TXX_WDOG_BMB_MASK 0x7c /* mask for watchdog multiplier */ +#define MK48TXX_WDOG_BMB_SHIFT 2 /* shift for watchdog multiplier */ +#define MK48TXX_WDOG_WDS 0x80 /* watchdog steering bit */ /* Bits in the control register */ -#define MK48TXX_CSR_CALIB_MASK 0x1f /* mask for calibration step width */ -#define MK48TXX_CSR_SIGN 0x20 /* sign of above calibration witdh */ -#define MK48TXX_CSR_READ 0x40 /* want to read (freeze clock) */ -#define MK48TXX_CSR_WRITE 0x80 /* want to write */ +#define MK48TXX_CSR_CALIB_MASK 0x1f /* mask for calibration step width */ +#define MK48TXX_CSR_SIGN 0x20 /* sign of above calibration witdh */ +#define MK48TXX_CSR_READ 0x40 /* want to read (freeze clock) */ +#define MK48TXX_CSR_WRITE 0x80 /* want to write */ /* Bits in the seconds register */ -#define MK48TXX_SEC_MASK 0x7f /* mask for seconds */ -#define MK48TXX_SEC_ST 0x80 /* stop oscillator */ +#define MK48TXX_SEC_MASK 0x7f /* mask for seconds */ +#define MK48TXX_SEC_ST 0x80 /* stop oscillator */ /* Bits in the minutes register */ -#define MK48TXX_MIN_MASK 0x7f /* mask for minutes */ +#define MK48TXX_MIN_MASK 0x7f /* mask for minutes */ /* Bits in the hours register */ -#define MK48TXX_HOUR_MASK 0x3f /* mask for hours */ +#define MK48TXX_HOUR_MASK 0x3f /* mask for hours */ /* Bits in the century/weekday register */ -#define MK48TXX_WDAY_MASK 0x07 /* mask for weekday */ -#define MK48TXX_WDAY_CB 0x10 /* century bit (extended only) */ -#define MK48TXX_WDAY_CB_SHIFT 4 /* shift for century bit */ -#define MK48TXX_WDAY_CEB 0x20 /* century enable bit (extended only) */ -#define MK48TXX_WDAY_FT 0x40 /* frequency test */ +#define MK48TXX_WDAY_MASK 0x07 /* mask for weekday */ +#define MK48TXX_WDAY_CB 0x10 /* century bit (extended only) */ +#define MK48TXX_WDAY_CB_SHIFT 4 /* shift for century bit */ +#define MK48TXX_WDAY_CEB 0x20 /* century enable bit (extended only) */ +#define MK48TXX_WDAY_FT 0x40 /* frequency test */ /* Bits in the day in month register */ -#define MK48TXX_DAY_MASK 0x3f /* mask for day in month */ +#define MK48TXX_DAY_MASK 0x3f /* mask for day in month */ /* Bits in the month register */ -#define MK48TXX_MON_MASK 0x1f /* mask for month */ +#define MK48TXX_MON_MASK 0x1f /* mask for month */ /* Bits in the year register */ -#define MK48TXX_YEAR_MASK 0xff /* mask for year */ +#define MK48TXX_YEAR_MASK 0xff /* mask for year */ /* Model specific NVRAM sizes and clock offsets */ -#define MK48T02_CLKSZ 2048 -#define MK48T02_CLKOFF 0x7f0 +#define MK48T02_CLKSZ 2048 +#define MK48T02_CLKOFF 0x7f0 -#define MK48T08_CLKSZ 8192 -#define MK48T08_CLKOFF 0x1ff0 +#define MK48T08_CLKSZ 8192 +#define MK48T08_CLKOFF 0x1ff0 -#define MK48T18_CLKSZ 8192 -#define MK48T18_CLKOFF 0x1ff0 +#define MK48T18_CLKSZ 8192 +#define MK48T18_CLKOFF 0x1ff0 -#define MK48T59_CLKSZ 8192 -#define MK48T59_CLKOFF 0x1ff0 +#define MK48T59_CLKSZ 8192 +#define MK48T59_CLKOFF 0x1ff0 Modified: stable/8/sys/dev/mk48txx/mk48txxvar.h ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:39:40 2010 (r202379) +++ stable/8/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:40:44 2010 (r202380) @@ -38,8 +38,8 @@ * $FreeBSD$ */ -typedef uint8_t (*mk48txx_nvrd_t)(device_t, int); -typedef void (*mk48txx_nvwr_t)(device_t, int, uint8_t); +typedef uint8_t (*mk48txx_nvrd_t)(device_t dev, int off); +typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); struct mk48txx_softc { bus_space_tag_t sc_bst; /* bus space tag */ @@ -53,17 +53,17 @@ struct mk48txx_softc { bus_size_t sc_clkoffset; /* Offset in NVRAM to clock bits */ u_int sc_year0; /* year counter offset */ u_int sc_flag; /* MD flags */ -#define MK48TXX_NO_CENT_ADJUST 0x0001 /* don't manually adjust century */ -#define MK48TXX_WDOG_REGISTER 0x0002 /* register watchdog */ -#define MK48TXX_WDOG_ENABLE_WDS 0x0004 /* enable watchdog steering bit */ +#define MK48TXX_NO_CENT_ADJUST 0x0001 /* don't manually adjust century */ +#define MK48TXX_WDOG_REGISTER 0x0002 /* register watchdog */ +#define MK48TXX_WDOG_ENABLE_WDS 0x0004 /* enable watchdog steering bit */ mk48txx_nvrd_t sc_nvrd; /* NVRAM/RTC read function */ mk48txx_nvwr_t sc_nvwr; /* NVRAM/RTC write function */ }; /* Chip attach function */ -int mk48txx_attach(device_t); +int mk48txx_attach(device_t dev); /* Methods for the clock interface */ -int mk48txx_gettime(device_t, struct timespec *); -int mk48txx_settime(device_t, struct timespec *); +int mk48txx_gettime(device_t dev, struct timespec *ts); +int mk48txx_settime(device_t dev, struct timespec *ts); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:41:05 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44E9F106568B; Fri, 15 Jan 2010 15:41:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31CBD8FC30; Fri, 15 Jan 2010 15:41: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 o0FFf5A3015387; Fri, 15 Jan 2010 15:41:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFf51t015383; Fri, 15 Jan 2010 15:41:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151541.o0FFf51t015383@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202381 - stable/7/sys/dev/mk48txx X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:41:05 -0000 Author: marius Date: Fri Jan 15 15:41:04 2010 New Revision: 202381 URL: http://svn.freebsd.org/changeset/base/202381 Log: MFC: r201003 Style changes Modified: stable/7/sys/dev/mk48txx/mk48txx.c stable/7/sys/dev/mk48txx/mk48txxreg.h stable/7/sys/dev/mk48txx/mk48txxvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:40:44 2010 (r202380) +++ stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:41:04 2010 (r202381) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); /* - * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines. + * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines */ #include @@ -59,17 +59,17 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" -static uint8_t mk48txx_def_nvrd(device_t, int); -static void mk48txx_def_nvwr(device_t, int, uint8_t); -static void mk48txx_watchdog(void *, u_int, int *); +static uint8_t mk48txx_def_nvrd(device_t dev, int off); +static void mk48txx_def_nvwr(device_t dev, int off, uint8_t v); +static void mk48txx_watchdog(void *arg, u_int cmd, int *error); -struct { +static const struct { const char *name; bus_size_t nvramsz; bus_size_t clkoff; - int flags; -#define MK48TXX_EXT_REGISTERS 1 /* Has extended register set */ -} mk48txx_models[] = { + u_int flags; +#define MK48TXX_EXT_REGISTERS 1 /* Has extended register set. */ +} const mk48txx_models[] = { { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, @@ -112,7 +112,7 @@ mk48txx_attach(device_t dev) if (mk48txx_models[i].flags & MK48TXX_EXT_REGISTERS) { mtx_lock(&sc->sc_mtx); - if ((*sc->sc_nvrd)(dev, sc->sc_clkoffset + MK48TXX_FLAGS) & + if ((*sc->sc_nvrd)(dev, sc->sc_clkoffset + MK48TXX_FLAGS) & MK48TXX_FLAGS_BL) { mtx_unlock(&sc->sc_mtx); device_printf(dev, "%s: battery low\n", __func__); @@ -140,7 +140,7 @@ mk48txx_attach(device_t dev) } } - clock_register(dev, 1000000); /* 1 second resolution. */ + clock_register(dev, 1000000); /* 1 second resolution */ if ((sc->sc_flag & MK48TXX_WDOG_REGISTER) && (mk48txx_models[i].flags & MK48TXX_EXT_REGISTERS)) { Modified: stable/7/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:40:44 2010 (r202380) +++ stable/7/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:41:04 2010 (r202381) @@ -59,23 +59,23 @@ * The first bank of eight registers at offset (nvramsz - 16) is * available only on recenter (which?) MK48Txx models. */ -#define MK48TXX_FLAGS 0 /* flags register */ -#define MK48TXX_UNUSED 1 /* unused */ -#define MK48TXX_ASEC 2 /* alarm seconds (0..59; BCD) */ -#define MK48TXX_AMIN 3 /* alarm minutes (0..59; BCD) */ -#define MK48TXX_AHOUR 4 /* alarm hours (0..23; BCD) */ -#define MK48TXX_ADAY 5 /* alarm day in month (1..31; BCD) */ -#define MK48TXX_INTR 6 /* interrupts register */ -#define MK48TXX_WDOG 7 /* watchdog register */ - -#define MK48TXX_ICSR 8 /* control register */ -#define MK48TXX_ISEC 9 /* seconds (0..59; BCD) */ -#define MK48TXX_IMIN 10 /* minutes (0..59; BCD) */ -#define MK48TXX_IHOUR 11 /* hours (0..23; BCD) */ -#define MK48TXX_IWDAY 12 /* weekday (1..7) */ -#define MK48TXX_IDAY 13 /* day in month (1..31; BCD) */ -#define MK48TXX_IMON 14 /* month (1..12; BCD) */ -#define MK48TXX_IYEAR 15 /* year (0..99; BCD) */ +#define MK48TXX_FLAGS 0 /* flags register */ +#define MK48TXX_UNUSED 1 /* unused */ +#define MK48TXX_ASEC 2 /* alarm seconds (0..59; BCD) */ +#define MK48TXX_AMIN 3 /* alarm minutes (0..59; BCD) */ +#define MK48TXX_AHOUR 4 /* alarm hours (0..23; BCD) */ +#define MK48TXX_ADAY 5 /* alarm day in month (1..31; BCD) */ +#define MK48TXX_INTR 6 /* interrupts register */ +#define MK48TXX_WDOG 7 /* watchdog register */ + +#define MK48TXX_ICSR 8 /* control register */ +#define MK48TXX_ISEC 9 /* seconds (0..59; BCD) */ +#define MK48TXX_IMIN 10 /* minutes (0..59; BCD) */ +#define MK48TXX_IHOUR 11 /* hours (0..23; BCD) */ +#define MK48TXX_IWDAY 12 /* weekday (1..7) */ +#define MK48TXX_IDAY 13 /* day in month (1..31; BCD) */ +#define MK48TXX_IMON 14 /* month (1..12; BCD) */ +#define MK48TXX_IYEAR 15 /* year (0..99; BCD) */ /* * Note that some of the bits below that are not in the first eight @@ -84,80 +84,80 @@ */ /* Bits in the flags register (extended only) */ -#define MK48TXX_FLAGS_BL 0x10 /* battery low (read only) */ -#define MK48TXX_FLAGS_AF 0x40 /* alarm flag (read only) */ -#define MK48TXX_FLAGS_WDF 0x80 /* watchdog flag (read only) */ +#define MK48TXX_FLAGS_BL 0x10 /* battery low (read only) */ +#define MK48TXX_FLAGS_AF 0x40 /* alarm flag (read only) */ +#define MK48TXX_FLAGS_WDF 0x80 /* watchdog flag (read only) */ /* Bits in the alarm seconds register (extended only) */ -#define MK48TXX_ASEC_MASK 0x7f /* mask for alarm seconds */ -#define MK48TXX_ASEC_RPT1 0x80 /* alarm repeat mode bit 1 */ +#define MK48TXX_ASEC_MASK 0x7f /* mask for alarm seconds */ +#define MK48TXX_ASEC_RPT1 0x80 /* alarm repeat mode bit 1 */ /* Bits in the alarm minutes register (extended only) */ -#define MK48TXX_AMIN_MASK 0x7f /* mask for alarm minutes */ -#define MK48TXX_AMIN_RPT2 0x80 /* alarm repeat mode bit 2 */ +#define MK48TXX_AMIN_MASK 0x7f /* mask for alarm minutes */ +#define MK48TXX_AMIN_RPT2 0x80 /* alarm repeat mode bit 2 */ /* Bits in the alarm hours register (extended only) */ -#define MK48TXX_AHOUR_MASK 0x3f /* mask for alarm hours */ -#define MK48TXX_AHOUR_RPT3 0x80 /* alarm repeat mode bit 3 */ +#define MK48TXX_AHOUR_MASK 0x3f /* mask for alarm hours */ +#define MK48TXX_AHOUR_RPT3 0x80 /* alarm repeat mode bit 3 */ /* Bits in the alarm day in month register (extended only) */ -#define MK48TXX_ADAY_MASK 0x3f /* mask for alarm day in month */ -#define MK48TXX_ADAY_RPT4 0x80 /* alarm repeat mode bit 4 */ +#define MK48TXX_ADAY_MASK 0x3f /* mask for alarm day in month */ +#define MK48TXX_ADAY_RPT4 0x80 /* alarm repeat mode bit 4 */ /* Bits in the interrupts register (extended only) */ -#define MK48TXX_INTR_ABE 0x20 /* alarm in battery back-up mode */ -#define MK48TXX_INTR_AFE 0x80 /* alarm flag enable */ +#define MK48TXX_INTR_ABE 0x20 /* alarm in battery back-up mode */ +#define MK48TXX_INTR_AFE 0x80 /* alarm flag enable */ /* Bits in the watchdog register (extended only) */ -#define MK48TXX_WDOG_RB_1_16 0x00 /* watchdog resolution 1/16 second */ -#define MK48TXX_WDOG_RB_1_4 0x01 /* watchdog resolution 1/4 second */ -#define MK48TXX_WDOG_RB_1 0x02 /* watchdog resolution 1 second */ -#define MK48TXX_WDOG_RB_4 0x03 /* watchdog resolution 4 seconds */ -#define MK48TXX_WDOG_BMB_MASK 0x7c /* mask for watchdog multiplier */ -#define MK48TXX_WDOG_BMB_SHIFT 2 /* shift for watchdog multiplier */ -#define MK48TXX_WDOG_WDS 0x80 /* watchdog steering bit */ +#define MK48TXX_WDOG_RB_1_16 0x00 /* watchdog resolution 1/16 second */ +#define MK48TXX_WDOG_RB_1_4 0x01 /* watchdog resolution 1/4 second */ +#define MK48TXX_WDOG_RB_1 0x02 /* watchdog resolution 1 second */ +#define MK48TXX_WDOG_RB_4 0x03 /* watchdog resolution 4 seconds */ +#define MK48TXX_WDOG_BMB_MASK 0x7c /* mask for watchdog multiplier */ +#define MK48TXX_WDOG_BMB_SHIFT 2 /* shift for watchdog multiplier */ +#define MK48TXX_WDOG_WDS 0x80 /* watchdog steering bit */ /* Bits in the control register */ -#define MK48TXX_CSR_CALIB_MASK 0x1f /* mask for calibration step width */ -#define MK48TXX_CSR_SIGN 0x20 /* sign of above calibration witdh */ -#define MK48TXX_CSR_READ 0x40 /* want to read (freeze clock) */ -#define MK48TXX_CSR_WRITE 0x80 /* want to write */ +#define MK48TXX_CSR_CALIB_MASK 0x1f /* mask for calibration step width */ +#define MK48TXX_CSR_SIGN 0x20 /* sign of above calibration witdh */ +#define MK48TXX_CSR_READ 0x40 /* want to read (freeze clock) */ +#define MK48TXX_CSR_WRITE 0x80 /* want to write */ /* Bits in the seconds register */ -#define MK48TXX_SEC_MASK 0x7f /* mask for seconds */ -#define MK48TXX_SEC_ST 0x80 /* stop oscillator */ +#define MK48TXX_SEC_MASK 0x7f /* mask for seconds */ +#define MK48TXX_SEC_ST 0x80 /* stop oscillator */ /* Bits in the minutes register */ -#define MK48TXX_MIN_MASK 0x7f /* mask for minutes */ +#define MK48TXX_MIN_MASK 0x7f /* mask for minutes */ /* Bits in the hours register */ -#define MK48TXX_HOUR_MASK 0x3f /* mask for hours */ +#define MK48TXX_HOUR_MASK 0x3f /* mask for hours */ /* Bits in the century/weekday register */ -#define MK48TXX_WDAY_MASK 0x07 /* mask for weekday */ -#define MK48TXX_WDAY_CB 0x10 /* century bit (extended only) */ -#define MK48TXX_WDAY_CB_SHIFT 4 /* shift for century bit */ -#define MK48TXX_WDAY_CEB 0x20 /* century enable bit (extended only) */ -#define MK48TXX_WDAY_FT 0x40 /* frequency test */ +#define MK48TXX_WDAY_MASK 0x07 /* mask for weekday */ +#define MK48TXX_WDAY_CB 0x10 /* century bit (extended only) */ +#define MK48TXX_WDAY_CB_SHIFT 4 /* shift for century bit */ +#define MK48TXX_WDAY_CEB 0x20 /* century enable bit (extended only) */ +#define MK48TXX_WDAY_FT 0x40 /* frequency test */ /* Bits in the day in month register */ -#define MK48TXX_DAY_MASK 0x3f /* mask for day in month */ +#define MK48TXX_DAY_MASK 0x3f /* mask for day in month */ /* Bits in the month register */ -#define MK48TXX_MON_MASK 0x1f /* mask for month */ +#define MK48TXX_MON_MASK 0x1f /* mask for month */ /* Bits in the year register */ -#define MK48TXX_YEAR_MASK 0xff /* mask for year */ +#define MK48TXX_YEAR_MASK 0xff /* mask for year */ /* Model specific NVRAM sizes and clock offsets */ -#define MK48T02_CLKSZ 2048 -#define MK48T02_CLKOFF 0x7f0 +#define MK48T02_CLKSZ 2048 +#define MK48T02_CLKOFF 0x7f0 -#define MK48T08_CLKSZ 8192 -#define MK48T08_CLKOFF 0x1ff0 +#define MK48T08_CLKSZ 8192 +#define MK48T08_CLKOFF 0x1ff0 -#define MK48T18_CLKSZ 8192 -#define MK48T18_CLKOFF 0x1ff0 +#define MK48T18_CLKSZ 8192 +#define MK48T18_CLKOFF 0x1ff0 -#define MK48T59_CLKSZ 8192 -#define MK48T59_CLKOFF 0x1ff0 +#define MK48T59_CLKSZ 8192 +#define MK48T59_CLKOFF 0x1ff0 Modified: stable/7/sys/dev/mk48txx/mk48txxvar.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:40:44 2010 (r202380) +++ stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:41:04 2010 (r202381) @@ -38,8 +38,8 @@ * $FreeBSD$ */ -typedef uint8_t (*mk48txx_nvrd_t)(device_t, int); -typedef void (*mk48txx_nvwr_t)(device_t, int, uint8_t); +typedef uint8_t (*mk48txx_nvrd_t)(device_t dev, int off); +typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); struct mk48txx_softc { bus_space_tag_t sc_bst; /* bus space tag */ @@ -53,17 +53,17 @@ struct mk48txx_softc { bus_size_t sc_clkoffset; /* Offset in NVRAM to clock bits */ u_int sc_year0; /* year counter offset */ u_int sc_flag; /* MD flags */ -#define MK48TXX_NO_CENT_ADJUST 0x0001 /* don't manually adjust century */ -#define MK48TXX_WDOG_REGISTER 0x0002 /* register watchdog */ -#define MK48TXX_WDOG_ENABLE_WDS 0x0004 /* enable watchdog steering bit */ +#define MK48TXX_NO_CENT_ADJUST 0x0001 /* don't manually adjust century */ +#define MK48TXX_WDOG_REGISTER 0x0002 /* register watchdog */ +#define MK48TXX_WDOG_ENABLE_WDS 0x0004 /* enable watchdog steering bit */ mk48txx_nvrd_t sc_nvrd; /* NVRAM/RTC read function */ mk48txx_nvwr_t sc_nvwr; /* NVRAM/RTC write function */ }; /* Chip attach function */ -int mk48txx_attach(device_t); +int mk48txx_attach(device_t dev); /* Methods for the clock interface */ -int mk48txx_gettime(device_t, struct timespec *); -int mk48txx_settime(device_t, struct timespec *); +int mk48txx_gettime(device_t dev, struct timespec *ts); +int mk48txx_settime(device_t dev, struct timespec *ts); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:42:15 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C95910656F4; Fri, 15 Jan 2010 15:42:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09B0B8FC36; Fri, 15 Jan 2010 15:42:15 +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 o0FFgEEj015725; Fri, 15 Jan 2010 15:42:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFgExa015721; Fri, 15 Jan 2010 15:42:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151542.o0FFgExa015721@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:42:14 +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: r202382 - stable/8/sys/dev/mk48txx X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:42:15 -0000 Author: marius Date: Fri Jan 15 15:42:14 2010 New Revision: 202382 URL: http://svn.freebsd.org/changeset/base/202382 Log: MFC: r201004 Remove clause 3 and 4 from TNF licenses. Obtained from: NetBSD Modified: stable/8/sys/dev/mk48txx/mk48txx.c stable/8/sys/dev/mk48txx/mk48txxreg.h stable/8/sys/dev/mk48txx/mk48txxvar.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) Modified: stable/8/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:41:04 2010 (r202381) +++ stable/8/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:42:14 2010 (r202382) @@ -13,13 +13,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -33,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mk48txx.c,v 1.15 2004/07/05 09:24:31 pk Exp + * $NetBSD: mk48txx.c,v 1.25 2008/04/28 20:23:50 martin Exp $ */ #include Modified: stable/8/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:41:04 2010 (r202381) +++ stable/8/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:42:14 2010 (r202382) @@ -13,13 +13,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -33,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mk48txxreg.h,v 1.7 2003/11/01 22:41:42 tsutsui Exp + * $NetBSD: mk48txxreg.h,v 1.10 2008/04/28 20:23:50 martin Exp $ * * $FreeBSD$ */ Modified: stable/8/sys/dev/mk48txx/mk48txxvar.h ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:41:04 2010 (r202381) +++ stable/8/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:42:14 2010 (r202382) @@ -13,13 +13,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -33,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mk48txxvar.h,v 1.1 2003/11/01 22:41:42 tsutsui Exp + * $NetBSD: mk48txxvar.h,v 1.6 2008/04/28 20:23:50 martin Exp $ * * $FreeBSD$ */ From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:42:17 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0382910656A5; Fri, 15 Jan 2010 15:42:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45CC8FC14; Fri, 15 Jan 2010 15:42:16 +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 o0FFgG16015760; Fri, 15 Jan 2010 15:42:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFgG8U015756; Fri, 15 Jan 2010 15:42:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151542.o0FFgG8U015756@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202383 - stable/7/sys/dev/mk48txx X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:42:17 -0000 Author: marius Date: Fri Jan 15 15:42:16 2010 New Revision: 202383 URL: http://svn.freebsd.org/changeset/base/202383 Log: MFC: r201004 Remove clause 3 and 4 from TNF licenses. Obtained from: NetBSD Modified: stable/7/sys/dev/mk48txx/mk48txx.c stable/7/sys/dev/mk48txx/mk48txxreg.h stable/7/sys/dev/mk48txx/mk48txxvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:42:14 2010 (r202382) +++ stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:42:16 2010 (r202383) @@ -13,13 +13,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -33,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mk48txx.c,v 1.15 2004/07/05 09:24:31 pk Exp + * $NetBSD: mk48txx.c,v 1.25 2008/04/28 20:23:50 martin Exp $ */ #include Modified: stable/7/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:42:14 2010 (r202382) +++ stable/7/sys/dev/mk48txx/mk48txxreg.h Fri Jan 15 15:42:16 2010 (r202383) @@ -13,13 +13,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -33,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mk48txxreg.h,v 1.7 2003/11/01 22:41:42 tsutsui Exp + * $NetBSD: mk48txxreg.h,v 1.10 2008/04/28 20:23:50 martin Exp $ * * $FreeBSD$ */ Modified: stable/7/sys/dev/mk48txx/mk48txxvar.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:42:14 2010 (r202382) +++ stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:42:16 2010 (r202383) @@ -13,13 +13,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -33,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mk48txxvar.h,v 1.1 2003/11/01 22:41:42 tsutsui Exp + * $NetBSD: mk48txxvar.h,v 1.6 2008/04/28 20:23:50 martin Exp $ * * $FreeBSD$ */ From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:47:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 418F0106566C; Fri, 15 Jan 2010 15:47:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DF578FC1B; Fri, 15 Jan 2010 15:47:32 +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 o0FFlWe6017056; Fri, 15 Jan 2010 15:47:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFlWDW017049; Fri, 15 Jan 2010 15:47:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151547.o0FFlWDW017049@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:47:32 +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: r202384 - in stable/8/sys: dev/mk48txx sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:47:32 -0000 Author: marius Date: Fri Jan 15 15:47:31 2010 New Revision: 202384 URL: http://svn.freebsd.org/changeset/base/202384 Log: MFC: r201005, r201371 - Take advantage of bus_{read,write}_*(9). - Set dow = -1 in mk48txx_gettime() because some drivers (for example the NetBSD and OpenBSD mk48txx(4)) don't set it correctly. Modified: stable/8/sys/dev/mk48txx/mk48txx.c stable/8/sys/dev/mk48txx/mk48txxvar.h stable/8/sys/sparc64/sparc64/eeprom.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) Modified: stable/8/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:42:16 2010 (r202383) +++ stable/8/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:47:31 2010 (r202384) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -175,8 +176,16 @@ mk48txx_gettime(device_t dev, struct tim ct.min = FROMBCD(FROMREG(MK48TXX_IMIN, MK48TXX_MIN_MASK)); ct.hour = FROMBCD(FROMREG(MK48TXX_IHOUR, MK48TXX_HOUR_MASK)); ct.day = FROMBCD(FROMREG(MK48TXX_IDAY, MK48TXX_DAY_MASK)); +#if 0 /* Map dow from 1 - 7 to 0 - 6; FROMBCD() isn't necessary here. */ ct.dow = FROMREG(MK48TXX_IWDAY, MK48TXX_WDAY_MASK) - 1; +#else + /* + * Set dow = -1 because some drivers (for example the NetBSD and + * OpenBSD mk48txx(4)) don't set it correctly. + */ + ct.dow = -1; +#endif ct.mon = FROMBCD(FROMREG(MK48TXX_IMON, MK48TXX_MON_MASK)); year = FROMBCD(FROMREG(MK48TXX_IYEAR, MK48TXX_YEAR_MASK)); year += sc->sc_year0; @@ -266,7 +275,7 @@ mk48txx_def_nvrd(device_t dev, int off) struct mk48txx_softc *sc; sc = device_get_softc(dev); - return (bus_space_read_1(sc->sc_bst, sc->sc_bsh, off)); + return (bus_read_1(sc->sc_res, off)); } static void @@ -275,7 +284,7 @@ mk48txx_def_nvwr(device_t dev, int off, struct mk48txx_softc *sc; sc = device_get_softc(dev); - bus_space_write_1(sc->sc_bst, sc->sc_bsh, off, v); + bus_write_1(sc->sc_res, off, v); } static void Modified: stable/8/sys/dev/mk48txx/mk48txxvar.h ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:42:16 2010 (r202383) +++ stable/8/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:47:31 2010 (r202384) @@ -35,8 +35,7 @@ typedef uint8_t (*mk48txx_nvrd_t)(device typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); struct mk48txx_softc { - bus_space_tag_t sc_bst; /* bus space tag */ - bus_space_handle_t sc_bsh; /* bus space handle */ + struct resource *sc_res;/* bus resource */ struct mtx sc_mtx; /* hardware mutex */ eventhandler_tag sc_wet; /* watchdog event handler tag */ Modified: stable/8/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/8/sys/sparc64/sparc64/eeprom.c Fri Jan 15 15:42:16 2010 (r202383) +++ stable/8/sys/sparc64/sparc64/eeprom.c Fri Jan 15 15:47:31 2010 (r202384) @@ -107,7 +107,7 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive static int eeprom_probe(device_t dev) { - + if (strcmp("eeprom", ofw_bus_get_name(dev)) == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); @@ -119,7 +119,6 @@ static int eeprom_attach(device_t dev) { struct mk48txx_softc *sc; - struct resource *res; struct timespec ts; int error, rid; @@ -128,14 +127,13 @@ eeprom_attach(device_t dev) mtx_init(&sc->sc_mtx, "eeprom_mtx", NULL, MTX_DEF); rid = 0; - res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (res == NULL) { + sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_res == NULL) { device_printf(dev, "cannot allocate resources\n"); error = ENXIO; goto fail_mtx; } - sc->sc_bst = rman_get_bustag(res); - sc->sc_bsh = rman_get_bushandle(res); if ((sc->sc_model = ofw_bus_get_model(dev)) == NULL) { device_printf(dev, "cannot determine model\n"); @@ -180,7 +178,7 @@ eeprom_attach(device_t dev) return (0); fail_res: - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->sc_res); fail_mtx: mtx_destroy(&sc->sc_mtx); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 15:47:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5387A1065672; Fri, 15 Jan 2010 15:47:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 401988FC1D; Fri, 15 Jan 2010 15:47:32 +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 o0FFlWh1017059; Fri, 15 Jan 2010 15:47:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFlWFx017053; Fri, 15 Jan 2010 15:47:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151547.o0FFlWFx017053@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202385 - in stable/7/sys: dev/mk48txx sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:47:32 -0000 Author: marius Date: Fri Jan 15 15:47:31 2010 New Revision: 202385 URL: http://svn.freebsd.org/changeset/base/202385 Log: MFC: r201005, r201371 - Take advantage of bus_{read,write}_*(9). - Set dow = -1 in mk48txx_gettime() because some drivers (for example the NetBSD and OpenBSD mk48txx(4)) don't set it correctly. Modified: stable/7/sys/dev/mk48txx/mk48txx.c stable/7/sys/dev/mk48txx/mk48txxvar.h stable/7/sys/sparc64/sparc64/eeprom.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:47:31 2010 (r202384) +++ stable/7/sys/dev/mk48txx/mk48txx.c Fri Jan 15 15:47:31 2010 (r202385) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -175,8 +176,16 @@ mk48txx_gettime(device_t dev, struct tim ct.min = FROMBCD(FROMREG(MK48TXX_IMIN, MK48TXX_MIN_MASK)); ct.hour = FROMBCD(FROMREG(MK48TXX_IHOUR, MK48TXX_HOUR_MASK)); ct.day = FROMBCD(FROMREG(MK48TXX_IDAY, MK48TXX_DAY_MASK)); +#if 0 /* Map dow from 1 - 7 to 0 - 6; FROMBCD() isn't necessary here. */ ct.dow = FROMREG(MK48TXX_IWDAY, MK48TXX_WDAY_MASK) - 1; +#else + /* + * Set dow = -1 because some drivers (for example the NetBSD and + * OpenBSD mk48txx(4)) don't set it correctly. + */ + ct.dow = -1; +#endif ct.mon = FROMBCD(FROMREG(MK48TXX_IMON, MK48TXX_MON_MASK)); year = FROMBCD(FROMREG(MK48TXX_IYEAR, MK48TXX_YEAR_MASK)); year += sc->sc_year0; @@ -266,7 +275,7 @@ mk48txx_def_nvrd(device_t dev, int off) struct mk48txx_softc *sc; sc = device_get_softc(dev); - return (bus_space_read_1(sc->sc_bst, sc->sc_bsh, off)); + return (bus_read_1(sc->sc_res, off)); } static void @@ -275,7 +284,7 @@ mk48txx_def_nvwr(device_t dev, int off, struct mk48txx_softc *sc; sc = device_get_softc(dev); - bus_space_write_1(sc->sc_bst, sc->sc_bsh, off, v); + bus_write_1(sc->sc_res, off, v); } static void Modified: stable/7/sys/dev/mk48txx/mk48txxvar.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:47:31 2010 (r202384) +++ stable/7/sys/dev/mk48txx/mk48txxvar.h Fri Jan 15 15:47:31 2010 (r202385) @@ -35,8 +35,7 @@ typedef uint8_t (*mk48txx_nvrd_t)(device typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); struct mk48txx_softc { - bus_space_tag_t sc_bst; /* bus space tag */ - bus_space_handle_t sc_bsh; /* bus space handle */ + struct resource *sc_res;/* bus resource */ struct mtx sc_mtx; /* hardware mutex */ eventhandler_tag sc_wet; /* watchdog event handler tag */ Modified: stable/7/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/7/sys/sparc64/sparc64/eeprom.c Fri Jan 15 15:47:31 2010 (r202384) +++ stable/7/sys/sparc64/sparc64/eeprom.c Fri Jan 15 15:47:31 2010 (r202385) @@ -107,7 +107,7 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive static int eeprom_probe(device_t dev) { - + if (strcmp("eeprom", ofw_bus_get_name(dev)) == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); @@ -119,7 +119,6 @@ static int eeprom_attach(device_t dev) { struct mk48txx_softc *sc; - struct resource *res; struct timespec ts; int error, rid; @@ -128,14 +127,13 @@ eeprom_attach(device_t dev) mtx_init(&sc->sc_mtx, "eeprom_mtx", NULL, MTX_DEF); rid = 0; - res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (res == NULL) { + sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_res == NULL) { device_printf(dev, "cannot allocate resources\n"); error = ENXIO; goto fail_mtx; } - sc->sc_bst = rman_get_bustag(res); - sc->sc_bsh = rman_get_bushandle(res); if ((sc->sc_model = ofw_bus_get_model(dev)) == NULL) { device_printf(dev, "cannot determine model\n"); @@ -180,7 +178,7 @@ eeprom_attach(device_t dev) return (0); fail_res: - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->sc_res); fail_mtx: mtx_destroy(&sc->sc_mtx); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:21:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97AC31065676; Fri, 15 Jan 2010 16:21:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 845D78FC17; Fri, 15 Jan 2010 16:21:32 +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 o0FGLWHl025017; Fri, 15 Jan 2010 16:21:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGLWhG025014; Fri, 15 Jan 2010 16:21:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151621.o0FGLWhG025014@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202388 - stable/7/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:21:32 -0000 Author: marius Date: Fri Jan 15 16:21:32 2010 New Revision: 202388 URL: http://svn.freebsd.org/changeset/base/202388 Log: MFC: r201007 Add a man page for mk48txx(4). Requested by: n_hibma Obtained from: NetBSD (original version) Added: stable/7/share/man/man4/mk48txx.4 - copied unchanged from r201006, head/share/man/man4/mk48txx.4 Modified: stable/7/share/man/man4/Makefile Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Fri Jan 15 16:04:30 2010 (r202387) +++ stable/7/share/man/man4/Makefile Fri Jan 15 16:21:32 2010 (r202388) @@ -180,6 +180,7 @@ MAN= aac.4 \ meteor.4 \ mfi.4 \ miibus.4 \ + mk48txx.4 \ mlx.4 \ mly.4 \ mmc.4 \ Copied: stable/7/share/man/man4/mk48txx.4 (from r201006, head/share/man/man4/mk48txx.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man4/mk48txx.4 Fri Jan 15 16:21:32 2010 (r202388, copy of r201006, head/share/man/man4/mk48txx.4) @@ -0,0 +1,230 @@ +.\" $NetBSD: mk48txx.4,v 1.16 2009/04/10 17:14:07 joerg Exp $ +.\" +.\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Paul Kranenburg. +.\" +.\" 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 December 25, 2009 +.Dt MK48TXX 4 +.Os +.Sh NAME +.Nm mk48txx +.Nd +.Tn Mostek +time-of-day clock driver +.Sh SYNOPSIS +.In sys/eventhandler.h +.In sys/lock.h +.In sys/mutex.h +.In dev/mk48txx/mk48txxvar.h +.Pp +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device mk48txx" +.Ed +.Sh DESCRIPTION +The +.Nm +driver is a back-end for several models of +.Tn Mostek +time-of-day clock chips. +It provides access methods to retrieve and set date and time for use with the +.Dq Li clock +KOBJ interface. +.Pp +To tie an instance of this device to the system, use the +.Fn mk48txx_attach +function and the mk48txx_softc structure defined as follows: +.Pp +.Ft "int" +.Fn mk48txx_attach "device_t dev" +.Pp +.Bd -literal +typedef uint8_t (*mk48txx_nvrd_t)(device_t dev, int off); +typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); +.Ed +.Bd -literal +struct mk48txx_softc { + struct resource sc_res; + struct mtx sc_mtx; + eventhandler_tag sc_wet; + const char *sc_model; + bus_size_t sc_nvramsz; + bus_size_t sc_clkoffset; + u_int sc_year0; + u_int sc_flag; + mk48txx_nvrd_t sc_nvrd; + mk48txx_nvwr_t sc_nvwr; +}; +.Ed +.Pp +.Bl -tag -width indent +.It Fa sc_res +The bus resource used for accessing the chip's non-volatile memory +.Pq including the clock registers , +which must be supplied by the front-end when using the default access methods +.Pq see below . +Otherwise this member is optional. +.It Fa sc_mtx +The hardware mutex used when accessing the chip's non-volatile memory +.Pq including the clock registers , +which must be initialized with +.Dv MTX_DEF +by the front-end. +.It Fa sc_wet +The event handler tag for the watchdog functionality, +which is registered by the +.Fn mk48txx_attach +function if supported by the chip and specified as part of the +machine-dependent features +.Pq see below . +.It Fa sc_model +The chip model which this instance should serve. +This member must be set to one of +.Dq mk48t02 , +.Dq mk48t08 , +.Dq mk48t18 , +or +.Dq mk48t59 +by the front-end. +.It Fa sc_nvramsz +The size of the non-volatile RAM in the +.Tn Mostek +chip, +which is set by the +.Fn mk48txx_attach +function. +.It Fa sc_clkoffset +The offset into the control registers of the +.Tn Mostek +chip, +which is set by the the +.Fn mk48txx_attach +function. +.It Fa sc_year0 +The year offset to be used with the +.Sq year +counter of the clock, +which must be set by the front-end. +This value is generally dependent on the system configuration in which +the clock device is mounted. +For instance, on +.Tn Sun Microsystems +machines the convention is to have clock's two-digit year represent +the year since 1968. +.It Fa sc_flag +This flag is used to specify machine-dependent features. +The following flags are supported: +.Bl -tag -width ".Dv MK48TXX_WDOG_ENABLE_WDS" +.It Dv MK48TXX_NO_CENT_ADJUST +If the resulting date retrieved with the +.Dq Li clock_gettime() method +would be earlier than January 1, 1970, +the driver will assume that the chip's year counter actually represents a +year in the 21st century. +This behavior can be overridden by setting this flag, +which causes the +.Nm +driver to respect the clock's century bit instead. +.It Dv MK48TXX_WDOG_REGISTER +When this flag is set, +the +.Nm +driver will register as a watchdog via the interface defined in +.Xr 9 watchdog +if supported by the specific chip model. +.It Dv MK48TXX_WDOG_ENABLE_WDS +When this flag is set, +the +.Nm +driver will set the watchdog steering +.Pq WDS +bit when enabling the watchdog functionality of the chip. +enabled +.Pq see the chip documentation for further information regarding the WDS bit . +.El +.It Fa sc_nvread +.It Fa sc_nvwrite +These members specify the access methods for reading respectively writing +clock device registers. +The default, +when +.Dv NULL +is passed as an access method, +is to access the chip memory +.Pq and clock registers +as if they were direct-mapped using the specified bus resource. +.Pp +Otherwise, the driver will call the respective function supplied by the +front-end to perform the access, +passing it the offset +.Va off +of the chip memory +.Pq or clock register +location to be read from or written to, respectively. +.El +.Sh HARDWARE +The following models are supported: +.Pp +.Bl -tag -width indent -offset indent -compact +.It Tn Mostek MK48T02 +.It Tn Mostek MK48T08 +.It Tn Mostek MK48T18 +.It Tn Mostek MK48T59 +.El +.Sh SEE ALSO +.Xr intro 4 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm mk48txx +driver appeared in +.Nx 1.5 . +The first +.Fx +version to include it was +.Fx 5.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written for +.Nx +by +.An Paul Kranenburg +.Aq pk@NetBSD.org . +It was ported to +.Fx +by +.An Thomas Moestl +.Aq tmm@FreeBSD.org +and later on improved by +.An Marius Strobl +.Aq marius@FreeBSD.org . From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:21:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA021065679; Fri, 15 Jan 2010 16:21:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 085318FC1A; Fri, 15 Jan 2010 16:21: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 o0FGLW0e025039; Fri, 15 Jan 2010 16:21:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGLWQr025036; Fri, 15 Jan 2010 16:21:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151621.o0FGLWQr025036@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:21:32 +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: r202389 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:21:33 -0000 Author: marius Date: Fri Jan 15 16:21:32 2010 New Revision: 202389 URL: http://svn.freebsd.org/changeset/base/202389 Log: MFC: r201007 Add a man page for mk48txx(4). Requested by: n_hibma Obtained from: NetBSD (original version) Added: stable/8/share/man/man4/mk48txx.4 - copied unchanged from r201006, head/share/man/man4/mk48txx.4 Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Fri Jan 15 16:21:32 2010 (r202388) +++ stable/8/share/man/man4/Makefile Fri Jan 15 16:21:32 2010 (r202389) @@ -198,6 +198,7 @@ MAN= aac.4 \ meteor.4 \ mfi.4 \ miibus.4 \ + mk48txx.4 \ mld.4 \ mlx.4 \ mly.4 \ Copied: stable/8/share/man/man4/mk48txx.4 (from r201006, head/share/man/man4/mk48txx.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/mk48txx.4 Fri Jan 15 16:21:32 2010 (r202389, copy of r201006, head/share/man/man4/mk48txx.4) @@ -0,0 +1,230 @@ +.\" $NetBSD: mk48txx.4,v 1.16 2009/04/10 17:14:07 joerg Exp $ +.\" +.\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Paul Kranenburg. +.\" +.\" 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 December 25, 2009 +.Dt MK48TXX 4 +.Os +.Sh NAME +.Nm mk48txx +.Nd +.Tn Mostek +time-of-day clock driver +.Sh SYNOPSIS +.In sys/eventhandler.h +.In sys/lock.h +.In sys/mutex.h +.In dev/mk48txx/mk48txxvar.h +.Pp +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device mk48txx" +.Ed +.Sh DESCRIPTION +The +.Nm +driver is a back-end for several models of +.Tn Mostek +time-of-day clock chips. +It provides access methods to retrieve and set date and time for use with the +.Dq Li clock +KOBJ interface. +.Pp +To tie an instance of this device to the system, use the +.Fn mk48txx_attach +function and the mk48txx_softc structure defined as follows: +.Pp +.Ft "int" +.Fn mk48txx_attach "device_t dev" +.Pp +.Bd -literal +typedef uint8_t (*mk48txx_nvrd_t)(device_t dev, int off); +typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); +.Ed +.Bd -literal +struct mk48txx_softc { + struct resource sc_res; + struct mtx sc_mtx; + eventhandler_tag sc_wet; + const char *sc_model; + bus_size_t sc_nvramsz; + bus_size_t sc_clkoffset; + u_int sc_year0; + u_int sc_flag; + mk48txx_nvrd_t sc_nvrd; + mk48txx_nvwr_t sc_nvwr; +}; +.Ed +.Pp +.Bl -tag -width indent +.It Fa sc_res +The bus resource used for accessing the chip's non-volatile memory +.Pq including the clock registers , +which must be supplied by the front-end when using the default access methods +.Pq see below . +Otherwise this member is optional. +.It Fa sc_mtx +The hardware mutex used when accessing the chip's non-volatile memory +.Pq including the clock registers , +which must be initialized with +.Dv MTX_DEF +by the front-end. +.It Fa sc_wet +The event handler tag for the watchdog functionality, +which is registered by the +.Fn mk48txx_attach +function if supported by the chip and specified as part of the +machine-dependent features +.Pq see below . +.It Fa sc_model +The chip model which this instance should serve. +This member must be set to one of +.Dq mk48t02 , +.Dq mk48t08 , +.Dq mk48t18 , +or +.Dq mk48t59 +by the front-end. +.It Fa sc_nvramsz +The size of the non-volatile RAM in the +.Tn Mostek +chip, +which is set by the +.Fn mk48txx_attach +function. +.It Fa sc_clkoffset +The offset into the control registers of the +.Tn Mostek +chip, +which is set by the the +.Fn mk48txx_attach +function. +.It Fa sc_year0 +The year offset to be used with the +.Sq year +counter of the clock, +which must be set by the front-end. +This value is generally dependent on the system configuration in which +the clock device is mounted. +For instance, on +.Tn Sun Microsystems +machines the convention is to have clock's two-digit year represent +the year since 1968. +.It Fa sc_flag +This flag is used to specify machine-dependent features. +The following flags are supported: +.Bl -tag -width ".Dv MK48TXX_WDOG_ENABLE_WDS" +.It Dv MK48TXX_NO_CENT_ADJUST +If the resulting date retrieved with the +.Dq Li clock_gettime() method +would be earlier than January 1, 1970, +the driver will assume that the chip's year counter actually represents a +year in the 21st century. +This behavior can be overridden by setting this flag, +which causes the +.Nm +driver to respect the clock's century bit instead. +.It Dv MK48TXX_WDOG_REGISTER +When this flag is set, +the +.Nm +driver will register as a watchdog via the interface defined in +.Xr 9 watchdog +if supported by the specific chip model. +.It Dv MK48TXX_WDOG_ENABLE_WDS +When this flag is set, +the +.Nm +driver will set the watchdog steering +.Pq WDS +bit when enabling the watchdog functionality of the chip. +enabled +.Pq see the chip documentation for further information regarding the WDS bit . +.El +.It Fa sc_nvread +.It Fa sc_nvwrite +These members specify the access methods for reading respectively writing +clock device registers. +The default, +when +.Dv NULL +is passed as an access method, +is to access the chip memory +.Pq and clock registers +as if they were direct-mapped using the specified bus resource. +.Pp +Otherwise, the driver will call the respective function supplied by the +front-end to perform the access, +passing it the offset +.Va off +of the chip memory +.Pq or clock register +location to be read from or written to, respectively. +.El +.Sh HARDWARE +The following models are supported: +.Pp +.Bl -tag -width indent -offset indent -compact +.It Tn Mostek MK48T02 +.It Tn Mostek MK48T08 +.It Tn Mostek MK48T18 +.It Tn Mostek MK48T59 +.El +.Sh SEE ALSO +.Xr intro 4 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm mk48txx +driver appeared in +.Nx 1.5 . +The first +.Fx +version to include it was +.Fx 5.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written for +.Nx +by +.An Paul Kranenburg +.Aq pk@NetBSD.org . +It was ported to +.Fx +by +.An Thomas Moestl +.Aq tmm@FreeBSD.org +and later on improved by +.An Marius Strobl +.Aq marius@FreeBSD.org . From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:25:17 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E278F1065744; Fri, 15 Jan 2010 16:25:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0A678FC19; Fri, 15 Jan 2010 16:25:17 +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 o0FGPHV2025999; Fri, 15 Jan 2010 16:25:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGPHkY025997; Fri, 15 Jan 2010 16:25:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151625.o0FGPHkY025997@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:25:17 +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: r202391 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:25:18 -0000 Author: marius Date: Fri Jan 15 16:25:17 2010 New Revision: 202391 URL: http://svn.freebsd.org/changeset/base/202391 Log: MFC: r201007 Correct my e-mail address. Modified: stable/8/share/man/man4/gem.4 Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (props changed) Modified: stable/8/share/man/man4/gem.4 ============================================================================== --- stable/8/share/man/man4/gem.4 Fri Jan 15 16:24:58 2010 (r202390) +++ stable/8/share/man/man4/gem.4 Fri Jan 15 16:25:17 2010 (r202391) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd December 25, 2009 .Dt GEM 4 .Os .Sh NAME @@ -150,7 +150,7 @@ by .Aq tmm@FreeBSD.org and later on improved by .An Marius Strobl -.Aq marus@FreeBSD.org . +.Aq marius@FreeBSD.org . The man page was written by .An Thomas Klausner .Aq wiz@NetBSD.org . From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:25:20 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FEFB1065742; Fri, 15 Jan 2010 16:25:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F23738FC1B; Fri, 15 Jan 2010 16:25: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 o0FGPJbd026034; Fri, 15 Jan 2010 16:25:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGPJZ3026032; Fri, 15 Jan 2010 16:25:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151625.o0FGPJZ3026032@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202392 - stable/7/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:25:20 -0000 Author: marius Date: Fri Jan 15 16:25:19 2010 New Revision: 202392 URL: http://svn.freebsd.org/changeset/base/202392 Log: MFC: r201007 Correct my e-mail address. Modified: stable/7/share/man/man4/gem.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/gem.4 ============================================================================== --- stable/7/share/man/man4/gem.4 Fri Jan 15 16:25:17 2010 (r202391) +++ stable/7/share/man/man4/gem.4 Fri Jan 15 16:25:19 2010 (r202392) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd December 25, 2009 .Dt GEM 4 .Os .Sh NAME @@ -150,7 +150,7 @@ by .Aq tmm@FreeBSD.org and later on improved by .An Marius Strobl -.Aq marus@FreeBSD.org . +.Aq marius@FreeBSD.org . The man page was written by .An Thomas Klausner .Aq wiz@NetBSD.org . From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:27:58 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 627001065676; Fri, 15 Jan 2010 16:27:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EC928FC17; Fri, 15 Jan 2010 16:27:58 +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 o0FGRwAZ026699; Fri, 15 Jan 2010 16:27:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGRwS5026694; Fri, 15 Jan 2010 16:27:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151627.o0FGRwS5026694@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:27:58 +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: r202393 - in stable/8/sys: dev/mc146818 sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:27:58 -0000 Author: marius Date: Fri Jan 15 16:27:57 2010 New Revision: 202393 URL: http://svn.freebsd.org/changeset/base/202393 Log: MFC: r201008 Style changes Obtained from: NetBSD (mc146818reg.h) Modified: stable/8/sys/dev/mc146818/mc146818.c stable/8/sys/dev/mc146818/mc146818reg.h stable/8/sys/dev/mc146818/mc146818var.h stable/8/sys/sparc64/sparc64/rtc.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) Modified: stable/8/sys/dev/mc146818/mc146818.c ============================================================================== --- stable/8/sys/dev/mc146818/mc146818.c Fri Jan 15 16:25:19 2010 (r202392) +++ stable/8/sys/dev/mc146818/mc146818.c Fri Jan 15 16:27:57 2010 (r202393) @@ -94,7 +94,7 @@ mc146818_attach(device_t dev) (*sc->sc_mcwrite)(dev, MC_REGB, sc->sc_regb); mtx_unlock_spin(&sc->sc_mtx); - clock_register(dev, 1000000); /* 1 second resolution. */ + clock_register(dev, 1000000); /* 1 second resolution */ return (0); } @@ -116,7 +116,7 @@ mc146818_gettime(device_t dev, struct ti /* * If MC_REGA_UIP is 0 we have at least 244us before the next - * update. If it's 1 an update is imminent. + * update. If it's 1 an update is imminent. */ for (;;) { mtx_lock_spin(&sc->sc_mtx); @@ -260,6 +260,9 @@ mc146818_def_write(device_t dev, u_int r bus_space_write_1(sc->sc_bst, sc->sc_bsh, MC_DATA, val); } +#undef MC_ADDR +#undef MC_DATA + /* * Looks like it's common even across platforms to store the century at * 0x32 in the NVRAM of the mc146818. @@ -283,3 +286,5 @@ mc146818_def_setcent(device_t dev, u_int sc = device_get_softc(dev); (*sc->sc_mcwrite)(dev, MC_CENT, cent); } + +#undef MC_CENT Modified: stable/8/sys/dev/mc146818/mc146818reg.h ============================================================================== --- stable/8/sys/dev/mc146818/mc146818reg.h Fri Jan 15 16:25:19 2010 (r202392) +++ stable/8/sys/dev/mc146818/mc146818reg.h Fri Jan 15 16:27:57 2010 (r202393) @@ -1,17 +1,17 @@ /*- * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. - * + * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU @@ -22,7 +22,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * from: NetBSD: mc146818reg.h,v 1.5 2003/11/02 11:07:45 wiz Exp + * $NetBSD: mc146818reg.h,v 1.9 2006/03/08 23:46:25 lukem Exp $ * * $FreeBSD$ */ @@ -122,8 +122,8 @@ * Periodic Interrupt Rate Select constants (Control register A) */ #define MC_RATE_NONE 0x0 /* No periodic interrupt */ -#define MC_RATE_1 0x1 /* 256 Hz if MC_BASE_32_KHz, else 32768 Hz */ -#define MC_RATE_2 0x2 /* 128 Hz if MC_BASE_32_KHz, else 16384 Hz */ +#define MC_RATE_1 0x1 /* 256 Hz if MC_BASE_32_KHz, else 32768 Hz */ +#define MC_RATE_2 0x2 /* 128 Hz if MC_BASE_32_KHz, else 16384 Hz */ #define MC_RATE_8192_Hz 0x3 /* 122.070 us period */ #define MC_RATE_4096_Hz 0x4 /* 244.141 us period */ #define MC_RATE_2048_Hz 0x5 /* 488.281 us period */ @@ -141,8 +141,8 @@ /* * Time base (divisor select) constants (Control register A) */ -#define MC_BASE_4_MHz 0x00 /* 4MHz crystal */ -#define MC_BASE_1_MHz MC_REGA_DV0 /* 1MHz crystal */ -#define MC_BASE_32_KHz MC_REGA_DV1 /* 32KHz crystal */ +#define MC_BASE_4_MHz 0x00 /* 4 MHz crystal */ +#define MC_BASE_1_MHz MC_REGA_DV0 /* 1 MHz crystal */ +#define MC_BASE_32_KHz MC_REGA_DV1 /* 32 KHz crystal */ #define MC_BASE_NONE (MC_REGA_DV2 | MC_REGA_DV1) /* actually also resets */ #define MC_BASE_RESET (MC_REGA_DV2 | MC_REGA_DV1 | MC_REGA_DV0) Modified: stable/8/sys/dev/mc146818/mc146818var.h ============================================================================== --- stable/8/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:25:19 2010 (r202392) +++ stable/8/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:27:57 2010 (r202393) @@ -38,29 +38,30 @@ struct mc146818_softc { u_char sc_regb; /* register B */ u_int sc_year0; /* year counter offset */ + u_int sc_flag; /* MD flags */ -#define MC146818_NO_CENT_ADJUST 0x0001 /* don't adjust century */ -#define MC146818_BCD 0x0002 /* use BCD mode */ -#define MC146818_12HR 0x0004 /* use AM/PM mode */ +#define MC146818_NO_CENT_ADJUST 0x0001 /* don't adjust century */ +#define MC146818_BCD 0x0002 /* use BCD mode */ +#define MC146818_12HR 0x0004 /* use AM/PM mode */ /* MD chip register read/write functions */ - u_int (*sc_mcread)(device_t, u_int); - void (*sc_mcwrite)(device_t, u_int, u_int); + u_int (*sc_mcread)(device_t dev, u_int reg); + void (*sc_mcwrite)(device_t dev, u_int reg, u_int val); /* MD century get/set functions */ - u_int (*sc_getcent)(device_t); - void (*sc_setcent)(device_t, u_int); + u_int (*sc_getcent)(device_t dev); + void (*sc_setcent)(device_t dev, u_int cent); }; /* Default read/write functions */ -u_int mc146818_def_read(device_t, u_int); -void mc146818_def_write(device_t, u_int, u_int); +u_int mc146818_def_read(device_t dev, u_int reg); +void mc146818_def_write(device_t dev, u_int reg, u_int val); /* Chip attach function */ int mc146818_attach(device_t); /* Methods for the clock interface */ #ifdef notyet -int mc146818_getsecs(device_t, int *); +int mc146818_getsecs(device_t dev, int *secp); #endif -int mc146818_gettime(device_t, struct timespec *); -int mc146818_settime(device_t, struct timespec *); +int mc146818_gettime(device_t dev, struct timespec *ts); +int mc146818_settime(device_t dev, struct timespec *ts); Modified: stable/8/sys/sparc64/sparc64/rtc.c ============================================================================== --- stable/8/sys/sparc64/sparc64/rtc.c Fri Jan 15 16:25:19 2010 (r202392) +++ stable/8/sys/sparc64/sparc64/rtc.c Fri Jan 15 16:27:57 2010 (r202393) @@ -111,7 +111,7 @@ static device_method_t rtc_isa_methods[] DEVMETHOD(clock_gettime, mc146818_gettime), DEVMETHOD(clock_settime, mc146818_settime), - { 0, 0 } + KOBJMETHOD_END }; static driver_t rtc_isa_driver = { @@ -123,8 +123,8 @@ static driver_t rtc_isa_driver = { DRIVER_MODULE(rtc, isa, rtc_isa_driver, rtc_devclass, 0, 0); #endif -static u_int pc87317_getcent(device_t); -static void pc87317_setcent(device_t, u_int); +static u_int pc87317_getcent(device_t dev); +static void pc87317_setcent(device_t dev, u_int cent); static int rtc_ebus_probe(device_t dev) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:28:02 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D19771065670; Fri, 15 Jan 2010 16:28:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE8198FC12; Fri, 15 Jan 2010 16:28:02 +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 o0FGS2gA026739; Fri, 15 Jan 2010 16:28:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGS2lU026734; Fri, 15 Jan 2010 16:28:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151628.o0FGS2lU026734@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202394 - in stable/7/sys: dev/mc146818 sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:28:02 -0000 Author: marius Date: Fri Jan 15 16:28:02 2010 New Revision: 202394 URL: http://svn.freebsd.org/changeset/base/202394 Log: MFC: r201008 Style changes Obtained from: NetBSD (mc146818reg.h) Modified: stable/7/sys/dev/mc146818/mc146818.c stable/7/sys/dev/mc146818/mc146818reg.h stable/7/sys/dev/mc146818/mc146818var.h stable/7/sys/sparc64/sparc64/rtc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mc146818/mc146818.c ============================================================================== --- stable/7/sys/dev/mc146818/mc146818.c Fri Jan 15 16:27:57 2010 (r202393) +++ stable/7/sys/dev/mc146818/mc146818.c Fri Jan 15 16:28:02 2010 (r202394) @@ -94,7 +94,7 @@ mc146818_attach(device_t dev) (*sc->sc_mcwrite)(dev, MC_REGB, sc->sc_regb); mtx_unlock_spin(&sc->sc_mtx); - clock_register(dev, 1000000); /* 1 second resolution. */ + clock_register(dev, 1000000); /* 1 second resolution */ return (0); } @@ -116,7 +116,7 @@ mc146818_gettime(device_t dev, struct ti /* * If MC_REGA_UIP is 0 we have at least 244us before the next - * update. If it's 1 an update is imminent. + * update. If it's 1 an update is imminent. */ for (;;) { mtx_lock_spin(&sc->sc_mtx); @@ -260,6 +260,9 @@ mc146818_def_write(device_t dev, u_int r bus_space_write_1(sc->sc_bst, sc->sc_bsh, MC_DATA, val); } +#undef MC_ADDR +#undef MC_DATA + /* * Looks like it's common even across platforms to store the century at * 0x32 in the NVRAM of the mc146818. @@ -283,3 +286,5 @@ mc146818_def_setcent(device_t dev, u_int sc = device_get_softc(dev); (*sc->sc_mcwrite)(dev, MC_CENT, cent); } + +#undef MC_CENT Modified: stable/7/sys/dev/mc146818/mc146818reg.h ============================================================================== --- stable/7/sys/dev/mc146818/mc146818reg.h Fri Jan 15 16:27:57 2010 (r202393) +++ stable/7/sys/dev/mc146818/mc146818reg.h Fri Jan 15 16:28:02 2010 (r202394) @@ -1,17 +1,17 @@ /*- * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. - * + * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU @@ -22,7 +22,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * from: NetBSD: mc146818reg.h,v 1.5 2003/11/02 11:07:45 wiz Exp + * $NetBSD: mc146818reg.h,v 1.9 2006/03/08 23:46:25 lukem Exp $ * * $FreeBSD$ */ @@ -122,8 +122,8 @@ * Periodic Interrupt Rate Select constants (Control register A) */ #define MC_RATE_NONE 0x0 /* No periodic interrupt */ -#define MC_RATE_1 0x1 /* 256 Hz if MC_BASE_32_KHz, else 32768 Hz */ -#define MC_RATE_2 0x2 /* 128 Hz if MC_BASE_32_KHz, else 16384 Hz */ +#define MC_RATE_1 0x1 /* 256 Hz if MC_BASE_32_KHz, else 32768 Hz */ +#define MC_RATE_2 0x2 /* 128 Hz if MC_BASE_32_KHz, else 16384 Hz */ #define MC_RATE_8192_Hz 0x3 /* 122.070 us period */ #define MC_RATE_4096_Hz 0x4 /* 244.141 us period */ #define MC_RATE_2048_Hz 0x5 /* 488.281 us period */ @@ -141,8 +141,8 @@ /* * Time base (divisor select) constants (Control register A) */ -#define MC_BASE_4_MHz 0x00 /* 4MHz crystal */ -#define MC_BASE_1_MHz MC_REGA_DV0 /* 1MHz crystal */ -#define MC_BASE_32_KHz MC_REGA_DV1 /* 32KHz crystal */ +#define MC_BASE_4_MHz 0x00 /* 4 MHz crystal */ +#define MC_BASE_1_MHz MC_REGA_DV0 /* 1 MHz crystal */ +#define MC_BASE_32_KHz MC_REGA_DV1 /* 32 KHz crystal */ #define MC_BASE_NONE (MC_REGA_DV2 | MC_REGA_DV1) /* actually also resets */ #define MC_BASE_RESET (MC_REGA_DV2 | MC_REGA_DV1 | MC_REGA_DV0) Modified: stable/7/sys/dev/mc146818/mc146818var.h ============================================================================== --- stable/7/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:27:57 2010 (r202393) +++ stable/7/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:28:02 2010 (r202394) @@ -38,29 +38,30 @@ struct mc146818_softc { u_char sc_regb; /* register B */ u_int sc_year0; /* year counter offset */ + u_int sc_flag; /* MD flags */ -#define MC146818_NO_CENT_ADJUST 0x0001 /* don't adjust century */ -#define MC146818_BCD 0x0002 /* use BCD mode */ -#define MC146818_12HR 0x0004 /* use AM/PM mode */ +#define MC146818_NO_CENT_ADJUST 0x0001 /* don't adjust century */ +#define MC146818_BCD 0x0002 /* use BCD mode */ +#define MC146818_12HR 0x0004 /* use AM/PM mode */ /* MD chip register read/write functions */ - u_int (*sc_mcread)(device_t, u_int); - void (*sc_mcwrite)(device_t, u_int, u_int); + u_int (*sc_mcread)(device_t dev, u_int reg); + void (*sc_mcwrite)(device_t dev, u_int reg, u_int val); /* MD century get/set functions */ - u_int (*sc_getcent)(device_t); - void (*sc_setcent)(device_t, u_int); + u_int (*sc_getcent)(device_t dev); + void (*sc_setcent)(device_t dev, u_int cent); }; /* Default read/write functions */ -u_int mc146818_def_read(device_t, u_int); -void mc146818_def_write(device_t, u_int, u_int); +u_int mc146818_def_read(device_t dev, u_int reg); +void mc146818_def_write(device_t dev, u_int reg, u_int val); /* Chip attach function */ int mc146818_attach(device_t); /* Methods for the clock interface */ #ifdef notyet -int mc146818_getsecs(device_t, int *); +int mc146818_getsecs(device_t dev, int *secp); #endif -int mc146818_gettime(device_t, struct timespec *); -int mc146818_settime(device_t, struct timespec *); +int mc146818_gettime(device_t dev, struct timespec *ts); +int mc146818_settime(device_t dev, struct timespec *ts); Modified: stable/7/sys/sparc64/sparc64/rtc.c ============================================================================== --- stable/7/sys/sparc64/sparc64/rtc.c Fri Jan 15 16:27:57 2010 (r202393) +++ stable/7/sys/sparc64/sparc64/rtc.c Fri Jan 15 16:28:02 2010 (r202394) @@ -111,7 +111,7 @@ static device_method_t rtc_isa_methods[] DEVMETHOD(clock_gettime, mc146818_gettime), DEVMETHOD(clock_settime, mc146818_settime), - { 0, 0 } + KOBJMETHOD_END }; static driver_t rtc_isa_driver = { @@ -123,8 +123,8 @@ static driver_t rtc_isa_driver = { DRIVER_MODULE(rtc, isa, rtc_isa_driver, rtc_devclass, 0, 0); #endif -static u_int pc87317_getcent(device_t); -static void pc87317_setcent(device_t, u_int); +static u_int pc87317_getcent(device_t dev); +static void pc87317_setcent(device_t dev, u_int cent); static int rtc_ebus_probe(device_t dev) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:29:40 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA4631065679; Fri, 15 Jan 2010 16:29:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE9BD8FC14; Fri, 15 Jan 2010 16:29:40 +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 o0FGTeNJ027170; Fri, 15 Jan 2010 16:29:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGTeh9027167; Fri, 15 Jan 2010 16:29:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151629.o0FGTeh9027167@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:29:40 +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: r202395 - stable/8/sys/dev/mc146818 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:29:41 -0000 Author: marius Date: Fri Jan 15 16:29:40 2010 New Revision: 202395 URL: http://svn.freebsd.org/changeset/base/202395 Log: MFC: r201009 Remove clause 3 from Izumi Tsutsui's licenses. Obtained from: NetBSD Modified: stable/8/sys/dev/mc146818/mc146818.c stable/8/sys/dev/mc146818/mc146818var.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) Modified: stable/8/sys/dev/mc146818/mc146818.c ============================================================================== --- stable/8/sys/dev/mc146818/mc146818.c Fri Jan 15 16:28:02 2010 (r202394) +++ stable/8/sys/dev/mc146818/mc146818.c Fri Jan 15 16:29:40 2010 (r202395) @@ -9,8 +9,6 @@ * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -23,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mc146818.c,v 1.4 2003/11/24 06:20:40 tsutsui Exp + * $NetBSD: mc146818.c,v 1.16 2008/05/14 13:29:28 tsutsui Exp $ */ #include Modified: stable/8/sys/dev/mc146818/mc146818var.h ============================================================================== --- stable/8/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:28:02 2010 (r202394) +++ stable/8/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:29:40 2010 (r202395) @@ -9,8 +9,6 @@ * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -23,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mc146818var.h,v 1.3 2003/11/24 06:20:40 tsutsui Exp + * $NetBSD: mc146818var.h,v 1.7 2008/05/14 13:29:29 tsutsui Exp $ * * $FreeBSD$ */ From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:29:42 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 098281065670; Fri, 15 Jan 2010 16:29:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D24588FC16; Fri, 15 Jan 2010 16:29: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 o0FGTfKP027201; Fri, 15 Jan 2010 16:29:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGTfiW027198; Fri, 15 Jan 2010 16:29:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151629.o0FGTfiW027198@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202396 - stable/7/sys/dev/mc146818 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:29:42 -0000 Author: marius Date: Fri Jan 15 16:29:41 2010 New Revision: 202396 URL: http://svn.freebsd.org/changeset/base/202396 Log: MFC: r201009 Remove clause 3 from Izumi Tsutsui's licenses. Obtained from: NetBSD Modified: stable/7/sys/dev/mc146818/mc146818.c stable/7/sys/dev/mc146818/mc146818var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mc146818/mc146818.c ============================================================================== --- stable/7/sys/dev/mc146818/mc146818.c Fri Jan 15 16:29:40 2010 (r202395) +++ stable/7/sys/dev/mc146818/mc146818.c Fri Jan 15 16:29:41 2010 (r202396) @@ -9,8 +9,6 @@ * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -23,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mc146818.c,v 1.4 2003/11/24 06:20:40 tsutsui Exp + * $NetBSD: mc146818.c,v 1.16 2008/05/14 13:29:28 tsutsui Exp $ */ #include Modified: stable/7/sys/dev/mc146818/mc146818var.h ============================================================================== --- stable/7/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:29:40 2010 (r202395) +++ stable/7/sys/dev/mc146818/mc146818var.h Fri Jan 15 16:29:41 2010 (r202396) @@ -9,8 +9,6 @@ * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -23,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: mc146818var.h,v 1.3 2003/11/24 06:20:40 tsutsui Exp + * $NetBSD: mc146818var.h,v 1.7 2008/05/14 13:29:29 tsutsui Exp $ * * $FreeBSD$ */ From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:41:11 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DADB61065676; Fri, 15 Jan 2010 16:41:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEF738FC15; Fri, 15 Jan 2010 16:41:10 +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 o0FGfAgF029902; Fri, 15 Jan 2010 16:41:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGfArB029900; Fri, 15 Jan 2010 16:41:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151641.o0FGfArB029900@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202397 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:41:11 -0000 Author: marius Date: Fri Jan 15 16:41:10 2010 New Revision: 202397 URL: http://svn.freebsd.org/changeset/base/202397 Log: MFC: r201126 Account for firmware versions which include the CDMA interrupts in the OFW device tree. Modified: stable/7/sys/sparc64/pci/schizo.c Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:29:41 2010 (r202396) +++ stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:41:10 2010 (r202397) @@ -627,31 +627,44 @@ schizo_attach(device_t dev) /* * According to the Schizo Errata I-13, consistent DMA flushing/ * syncing is FUBAR in version < 5 (i.e. revision < 2.3) bridges, - * so we can't use it and need to live with the consequences. - * With Schizo version >= 5, CDMA flushing/syncing is usable - * but requires the the workaround described in Schizo Errata - * I-23. With Tomatillo and XMITS, CDMA flushing/syncing works - * as expected, Tomatillo version <= 4 (i.e. revision <= 2.3) - * bridges additionally require a block store after a write to - * TOMXMS_PCI_DMA_SYNC_PEND though. + * so we can't use it and need to live with the consequences. With + * Schizo version >= 5, CDMA flushing/syncing is usable but requires + * the workaround described in Schizo Errata I-23. With Tomatillo + * and XMITS, CDMA flushing/syncing works as expected, Tomatillo + * version <= 4 (i.e. revision <= 2.3) bridges additionally require + * a block store after a write to TOMXMS_PCI_DMA_SYNC_PEND though. */ if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || sc->sc_mode == SCHIZO_MODE_TOM || sc->sc_mode == SCHIZO_MODE_XMS) { sc->sc_flags |= SCHIZO_FLAGS_CDMA; if (sc->sc_mode == SCHIZO_MODE_SCZ) { - n = STX_CDMA_A_INO + sc->sc_half; - if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, n), 1) != 0) - panic("%s: failed to add CDMA interrupt", - __func__); - i = schizo_intr_register(sc, n); - if (i != 0) - panic("%s: could not register interrupt " - "controller for CDMA (%d)", __func__, i); - (void)schizo_get_intrmap(sc, n, NULL, - &sc->sc_cdma_clr); sc->sc_cdma_state = SCHIZO_CDMA_STATE_DONE; - schizo_set_intr(sc, 5, n, schizo_cdma); + /* + * Some firmware versions include the CDMA interrupt + * at RID 4 but most don't. With the latter we add + * it ourselves at the spare RID 5. + */ + n = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, + 4)); + if (n == STX_CDMA_A_INO || n == STX_CDMA_B_INO) { + (void)schizo_get_intrmap(sc, n, NULL, + &sc->sc_cdma_clr); + schizo_set_intr(sc, 4, n, schizo_cdma); + } else { + n = STX_CDMA_A_INO + sc->sc_half; + if (bus_set_resource(dev, SYS_RES_IRQ, 5, + INTMAP_VEC(sc->sc_ign, n), 1) != 0) + panic("%s: failed to add CDMA " + "interrupt", __func__); + i = schizo_intr_register(sc, n); + if (i != 0) + panic("%s: could not register " + "interrupt controller for CDMA " + "(%d)", __func__, i); + (void)schizo_get_intrmap(sc, n, NULL, + &sc->sc_cdma_clr); + schizo_set_intr(sc, 5, n, schizo_cdma); + } } if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) sc->sc_flags |= SCHIZO_FLAGS_BSWAR; From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:42:40 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 458ED106566B; Fri, 15 Jan 2010 16:42:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 323188FC0C; Fri, 15 Jan 2010 16:42:40 +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 o0FGgegW030288; Fri, 15 Jan 2010 16:42:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGgeHi030285; Fri, 15 Jan 2010 16:42:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151642.o0FGgeHi030285@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:42:40 +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: r202398 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:42:40 -0000 Author: marius Date: Fri Jan 15 16:42:39 2010 New Revision: 202398 URL: http://svn.freebsd.org/changeset/base/202398 Log: MFC: r201199 - Prefer i and j over i and n for temporary integer variables. - Wrap/shorten too long lines. - Remove a redundant variable and an unnecessary cast in schizo(4). Modified: stable/8/sys/sparc64/pci/psycho.c stable/8/sys/sparc64/pci/schizo.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) Modified: stable/8/sys/sparc64/pci/psycho.c ============================================================================== --- stable/8/sys/sparc64/pci/psycho.c Fri Jan 15 16:41:10 2010 (r202397) +++ stable/8/sys/sparc64/pci/psycho.c Fri Jan 15 16:42:39 2010 (r202398) @@ -181,9 +181,9 @@ struct psycho_dma_sync { void *pds_arg; /* argument for the handler */ void *pds_cookie; /* parent bus int. cookie */ device_t pds_ppb; /* farest PCI-PCI bridge */ - uint8_t pds_bus; /* bus of farest PCI device */ - uint8_t pds_slot; /* slot of farest PCI device */ - uint8_t pds_func; /* func. of farest PCI device */ + uint8_t pds_bus; /* bus of farest PCI dev. */ + uint8_t pds_slot; /* slot of farest PCI dev. */ + uint8_t pds_func; /* func. of farest PCI dev. */ }; #define PSYCHO_READ8(sc, off) \ @@ -205,8 +205,8 @@ struct psycho_dma_sync { * "Hummingbird" is the UltraSPARC IIe onboard UPA to PCI bridge. It's * basically the same as Sabre but without an APB underneath it. * - * "Psycho" and "Psycho+" are dual UPA to PCI bridges. They sit on the UPA bus - * and manage two PCI buses. "Psycho" has two 64-bit 33MHz buses, while + * "Psycho" and "Psycho+" are dual UPA to PCI bridges. They sit on the UPA + * bus and manage two PCI buses. "Psycho" has two 64-bit 33MHz buses, while * "Psycho+" controls both a 64-bit 33Mhz and a 64-bit 66Mhz PCI bus. You * will usually find a "Psycho+" since I don't think the original "Psycho" * ever shipped, and if it did it would be in the U30. @@ -263,7 +263,8 @@ psycho_get_desc(device_t dev) rv = psycho_find_desc(psycho_models, ofw_bus_get_model(dev)); if (rv == NULL) - rv = psycho_find_desc(psycho_compats, ofw_bus_get_compat(dev)); + rv = psycho_find_desc(psycho_compats, + ofw_bus_get_compat(dev)); return (rv); } @@ -295,7 +296,7 @@ psycho_attach(device_t dev) uint32_t dvmabase, prop, prop_array[2]; int32_t rev; u_int rerun, ver; - int i, n; + int i, j; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -461,12 +462,12 @@ psycho_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, PSYCHO_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - n = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (n != PSYCHO_NRANGE) + if (i != PSYCHO_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -474,11 +475,12 @@ psycho_attach(device_t dev) * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (n = 0; n < PSYCHO_NRANGE; n++) { - i = OFW_PCI_RANGE_CS(&range[n]); - if (sc->sc_pci_bh[i] != 0) - panic("%s: duplicate range for space %d", __func__, i); - sc->sc_pci_bh[i] = OFW_PCI_RANGE_PHYS(&range[n]); + for (i = 0; i < PSYCHO_NRANGE; i++) { + j = OFW_PCI_RANGE_CS(&range[i]); + if (sc->sc_pci_bh[j] != 0) + panic("%s: duplicate range for space %d", + __func__, j); + sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -496,8 +498,8 @@ psycho_attach(device_t dev) * vectors. We do this early in order to be able to catch * stray interrupts. */ - for (n = 0; n <= PSYCHO_MAX_INO; n++) { - if (psycho_find_intrmap(sc, n, &intrmap, &intrclr, + for (i = 0; i <= PSYCHO_MAX_INO; i++) { + if (psycho_find_intrmap(sc, i, &intrmap, &intrclr, NULL) == 0) continue; pica = malloc(sizeof(*pica), M_DEVBUF, M_NOWAIT); @@ -515,21 +517,21 @@ psycho_attach(device_t dev) */ device_printf(dev, "intr map (INO %d, %s) %#lx: %#lx, clr: %#lx\n", - n, intrmap <= PSR_PCIB3_INT_MAP ? "PCI" : "OBIO", - (u_long)intrmap, (u_long)PSYCHO_READ8(sc, intrmap), - (u_long)intrclr); - PSYCHO_WRITE8(sc, intrmap, INTMAP_VEC(sc->sc_ign, n)); + i, intrmap <= PSR_PCIB3_INT_MAP ? "PCI" : "OBIO", + (u_long)intrmap, (u_long)PSYCHO_READ8(sc, + intrmap), (u_long)intrclr); + PSYCHO_WRITE8(sc, intrmap, INTMAP_VEC(sc->sc_ign, i)); PSYCHO_WRITE8(sc, intrclr, 0); PSYCHO_WRITE8(sc, intrmap, - INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, n), + INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, i), PCPU_GET(mid))); #endif - i = intr_controller_register(INTMAP_VEC(sc->sc_ign, n), - &psycho_ic, pica); - if (i != 0) + j = intr_controller_register(INTMAP_VEC(sc->sc_ign, + i), &psycho_ic, pica); + if (j != 0) device_printf(dev, "could not register " "interrupt controller for INO %d (%d)\n", - n, i); + i, j); } if (sc->sc_mode == PSYCHO_MODE_PSYCHO) @@ -583,12 +585,12 @@ psycho_attach(device_t dev) sc->sc_pci_dmat->dt_cookie = sc->sc_is; sc->sc_pci_dmat->dt_mt = &iommu_dma_methods; - n = OF_getprop(node, "bus-range", (void *)prop_array, + i = OF_getprop(node, "bus-range", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get bus-range", __func__); - if (n != sizeof(prop_array)) - panic("%s: broken bus-range (%d)", __func__, n); + if (i != sizeof(prop_array)) + panic("%s: broken bus-range (%d)", __func__, i); if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", prop_array[0], prop_array[1], prop_array[0]); @@ -657,15 +659,15 @@ psycho_attach(device_t dev) PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, PCIR_LATTIMER, OFW_PCI_LATENCY, 1); - for (n = PCIR_VENDOR; n < PCIR_STATUS; n += sizeof(uint16_t)) - le16enc(&sc->sc_pci_hpbcfg[n], bus_space_read_2( + for (i = PCIR_VENDOR; i < PCIR_STATUS; i += sizeof(uint16_t)) + le16enc(&sc->sc_pci_hpbcfg[i], bus_space_read_2( sc->sc_pci_cfgt, sc->sc_pci_bh[OFW_PCI_CS_CONFIG], PSYCHO_CONF_OFF(sc->sc_pci_secbus, PCS_DEVICE, - PCS_FUNC, n))); - for (n = PCIR_REVID; n <= PCIR_BIST; n += sizeof(uint8_t)) - sc->sc_pci_hpbcfg[n] = bus_space_read_1(sc->sc_pci_cfgt, + PCS_FUNC, i))); + for (i = PCIR_REVID; i <= PCIR_BIST; i += sizeof(uint8_t)) + sc->sc_pci_hpbcfg[i] = bus_space_read_1(sc->sc_pci_cfgt, sc->sc_pci_bh[OFW_PCI_CS_CONFIG], PSYCHO_CONF_OFF( - sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, n)); + sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, i)); ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(ofw_pci_intr_t)); /* @@ -694,8 +696,8 @@ psycho_set_intr(struct psycho_softc *sc, int rid; rid = index; - sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, - &rid, RF_ACTIVE); + sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_irq_res[index] == NULL && intrmap >= PSR_POWER_INT_MAP) { /* * These interrupts aren't mandatory and not available @@ -704,7 +706,8 @@ psycho_set_intr(struct psycho_softc *sc, return; } if (sc->sc_irq_res[index] == NULL || - INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || + INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != + sc->sc_ign || INTVEC(PSYCHO_READ8(sc, intrmap)) != vec || intr_vectors[vec].iv_ic != &psycho_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], @@ -714,8 +717,8 @@ psycho_set_intr(struct psycho_softc *sc, } static int -psycho_find_intrmap(struct psycho_softc *sc, u_int ino, bus_addr_t *intrmapptr, - bus_addr_t *intrclrptr, bus_addr_t *intrdiagptr) +psycho_find_intrmap(struct psycho_softc *sc, u_int ino, + bus_addr_t *intrmapptr, bus_addr_t *intrclrptr, bus_addr_t *intrdiagptr) { bus_addr_t intrclr, intrmap; uint64_t diag; @@ -875,7 +878,7 @@ psycho_wakeup(void *arg) { struct psycho_softc *sc = arg; - /* Gee, we don't really have a framework to deal with this properly. */ + /* We don't really have a framework to deal with this properly. */ device_printf(sc->sc_dev, "power management wakeup\n"); return (FILTER_HANDLED); } @@ -992,8 +995,8 @@ psycho_read_config(device_t dev, u_int b } static void -psycho_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, - uint32_t val, int width) +psycho_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int width) { struct psycho_softc *sc; bus_space_handle_t bh; @@ -1029,8 +1032,9 @@ psycho_route_interrupt(device_t bridge, sc = device_get_softc(bridge); pintr = pin; - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + maskbuf)) return (mintr); /* * If this is outside of the range for an intpin, it's likely a full @@ -1052,7 +1056,8 @@ psycho_route_interrupt(device_t bridge, intrmap = PSR_PCIA0_INT_MAP + 8 * (pci_get_slot(dev) - 1 + 3 * sc->sc_half); mintr = INTINO(PSYCHO_READ8(sc, intrmap)) + pin - 1; - device_printf(bridge, "guessing interrupt %d for device %d.%d pin %d\n", + device_printf(bridge, + "guessing interrupt %d for device %d.%d pin %d\n", (int)mintr, pci_get_slot(dev), pci_get_function(dev), pin); return (mintr); } @@ -1271,8 +1276,8 @@ psycho_alloc_resource(device_t bus, devi if (start != end) panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, - rid, start, end, count, flags)); + return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, + type, rid, start, end, count, flags)); } switch (type) { case SYS_RES_MEMORY: @@ -1387,7 +1392,8 @@ psycho_alloc_bus_tag(struct psycho_softc { bus_space_tag_t bt; - bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, + M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Fri Jan 15 16:41:10 2010 (r202397) +++ stable/8/sys/sparc64/pci/schizo.c Fri Jan 15 16:42:39 2010 (r202398) @@ -180,9 +180,9 @@ struct schizo_dma_sync { void *sds_cookie; uint64_t sds_syncval; device_t sds_ppb; /* farest PCI-PCI bridge */ - uint8_t sds_bus; /* bus of farest PCI device */ - uint8_t sds_slot; /* slot of farest PCI device */ - uint8_t sds_func; /* func. of farest PCI device */ + uint8_t sds_bus; /* bus of farest PCI dev. */ + uint8_t sds_slot; /* slot of farest PCI dev. */ + uint8_t sds_func; /* func. of farest PCI dev. */ }; #define SCHIZO_PERF_CNT_QLTY 100 @@ -260,7 +260,7 @@ schizo_attach(device_t dev) uint64_t ino_bitmap, reg; phandle_t node; uint32_t prop, prop_array[2]; - int i, mode, n, nrange, rid, tsbsize; + int i, j, mode, rid, tsbsize; sc = device_get_softc(dev); node = ofw_bus_get_node(dev); @@ -289,18 +289,18 @@ schizo_attach(device_t dev) */ sc->sc_half = (bus_get_resource_start(dev, SYS_RES_MEMORY, STX_PCI) >> 20) & 1; - for (n = 0; n < (mode == SCHIZO_MODE_SCZ ? SCZ_NREG : TOM_NREG); - n++) { - rid = n; - sc->sc_mem_res[n] = bus_alloc_resource_any(dev, + for (i = 0; i < (mode == SCHIZO_MODE_SCZ ? SCZ_NREG : TOM_NREG); + i++) { + rid = i; + sc->sc_mem_res[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, (((mode == SCHIZO_MODE_SCZ && ((sc->sc_half == 1 && - n == STX_PCI) || n == STX_CTRL)) || + i == STX_PCI) || i == STX_CTRL)) || (mode == SCHIZO_MODE_TOM && sc->sc_half == 0 && - n == STX_CTRL)) ? RF_SHAREABLE : 0) | RF_ACTIVE); - if (sc->sc_mem_res[n] == NULL) + i == STX_CTRL)) ? RF_SHAREABLE : 0) | RF_ACTIVE); + if (sc->sc_mem_res[i] == NULL) panic("%s: could not allocate register bank %d", - __func__, n); + __func__, i); } /* @@ -333,7 +333,8 @@ schizo_attach(device_t dev) if (OF_getprop(node, "portid", &sc->sc_ign, sizeof(sc->sc_ign)) == -1) panic("%s: could not determine IGN", __func__); - if (OF_getprop(node, "version#", &sc->sc_ver, sizeof(sc->sc_ver)) == -1) + if (OF_getprop(node, "version#", &sc->sc_ver, sizeof(sc->sc_ver)) == + -1) panic("%s: could not determine version", __func__); if (OF_getprop(node, "clock-frequency", &prop, sizeof(prop)) == -1) prop = 33000000; @@ -397,21 +398,21 @@ schizo_attach(device_t dev) * This is complicated by the fact that a pair of Schizo PBMs * shares one IGN. */ - n = OF_getprop(node, "ino-bitmap", (void *)prop_array, + i = OF_getprop(node, "ino-bitmap", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get ino-bitmap", __func__); ino_bitmap = ((uint64_t)prop_array[1] << 32) | prop_array[0]; - for (n = 0; n <= STX_MAX_INO; n++) { - if ((ino_bitmap & (1ULL << n)) == 0) + for (i = 0; i <= STX_MAX_INO; i++) { + if ((ino_bitmap & (1ULL << i)) == 0) continue; - if (n == STX_FB0_INO || n == STX_FB1_INO) + if (i == STX_FB0_INO || i == STX_FB1_INO) /* Leave for upa(4). */ continue; - i = schizo_intr_register(sc, n); - if (i != 0) + j = schizo_intr_register(sc, i); + if (j != 0) device_printf(dev, "could not register interrupt " - "controller for INO %d (%d)\n", n, i); + "controller for INO %d (%d)\n", i, j); } /* @@ -464,9 +465,9 @@ schizo_attach(device_t dev) tsbsize = (x); \ break; \ - n = OF_getprop(node, "virtual-dma", (void *)prop_array, + i = OF_getprop(node, "virtual-dma", (void *)prop_array, sizeof(prop_array)); - if (n == -1 || n != sizeof(prop_array)) + if (i == -1 || i != sizeof(prop_array)) schizo_iommu_init(sc, 7, -1); else { switch (prop_array[1]) { @@ -500,13 +501,12 @@ schizo_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, STX_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), - (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (nrange != STX_NRANGE) + if (i != STX_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -514,11 +514,12 @@ schizo_attach(device_t dev) * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (n = 0; n < STX_NRANGE; n++) { - i = OFW_PCI_RANGE_CS(&range[n]); - if (sc->sc_pci_bh[i] != 0) - panic("%s: duplicate range for space %d", __func__, i); - sc->sc_pci_bh[i] = OFW_PCI_RANGE_PHYS(&range[n]); + for (i = 0; i < STX_NRANGE; i++) { + j = OFW_PCI_RANGE_CS(&range[i]); + if (sc->sc_pci_bh[j] != 0) + panic("%s: duplicate range for space %d", + __func__, j); + sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -541,12 +542,12 @@ schizo_attach(device_t dev) * Get the bus range from the firmware. * NB: Tomatillos don't support PCI bus reenumeration. */ - n = OF_getprop(node, "bus-range", (void *)prop_array, + i = OF_getprop(node, "bus-range", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get bus-range", __func__); - if (n != sizeof(prop_array)) - panic("%s: broken bus-range (%d)", __func__, n); + if (i != sizeof(prop_array)) + panic("%s: broken bus-range (%d)", __func__, i); if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", prop_array[0], prop_array[1], prop_array[0]); @@ -634,7 +635,8 @@ schizo_attach(device_t dev) * a block store after a write to TOMXMS_PCI_DMA_SYNC_PEND though. */ if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || - sc->sc_mode == SCHIZO_MODE_TOM || sc->sc_mode == SCHIZO_MODE_XMS) { + sc->sc_mode == SCHIZO_MODE_TOM || + sc->sc_mode == SCHIZO_MODE_XMS) { sc->sc_flags |= SCHIZO_FLAGS_CDMA; if (sc->sc_mode == SCHIZO_MODE_SCZ) { sc->sc_cdma_state = SCHIZO_CDMA_STATE_DONE; @@ -643,26 +645,26 @@ schizo_attach(device_t dev) * at RID 4 but most don't. With the latter we add * it ourselves at the spare RID 5. */ - n = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, + i = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, 4)); - if (n == STX_CDMA_A_INO || n == STX_CDMA_B_INO) { - (void)schizo_get_intrmap(sc, n, NULL, + if (i == STX_CDMA_A_INO || i == STX_CDMA_B_INO) { + (void)schizo_get_intrmap(sc, i, NULL, &sc->sc_cdma_clr); - schizo_set_intr(sc, 4, n, schizo_cdma); + schizo_set_intr(sc, 4, i, schizo_cdma); } else { - n = STX_CDMA_A_INO + sc->sc_half; + i = STX_CDMA_A_INO + sc->sc_half; if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, n), 1) != 0) + INTMAP_VEC(sc->sc_ign, i), 1) != 0) panic("%s: failed to add CDMA " "interrupt", __func__); - i = schizo_intr_register(sc, n); - if (i != 0) + j = schizo_intr_register(sc, i); + if (j != 0) panic("%s: could not register " "interrupt controller for CDMA " - "(%d)", __func__, i); - (void)schizo_get_intrmap(sc, n, NULL, + "(%d)", __func__, j); + (void)schizo_get_intrmap(sc, i, NULL, &sc->sc_cdma_clr); - schizo_set_intr(sc, 5, n, schizo_cdma); + schizo_set_intr(sc, 5, i, schizo_cdma); } } if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) @@ -690,11 +692,11 @@ schizo_set_intr(struct schizo_softc *sc, int rid; rid = index; - sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, - &rid, RF_ACTIVE); + sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_irq_res[index] == NULL || - INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || - INTINO(vec) != ino || + INTINO(vec = rman_get_start(sc->sc_irq_res[index])) != ino || + INTIGN(vec) != sc->sc_ign || intr_vectors[vec].iv_ic != &schizo_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], INTR_TYPE_MISC | INTR_FAST, handler, NULL, sc, @@ -730,8 +732,8 @@ schizo_intr_register(struct schizo_softc } static int -schizo_get_intrmap(struct schizo_softc *sc, u_int ino, bus_addr_t *intrmapptr, - bus_addr_t *intrclrptr) +schizo_get_intrmap(struct schizo_softc *sc, u_int ino, + bus_addr_t *intrmapptr, bus_addr_t *intrclrptr) { bus_addr_t intrclr, intrmap; uint64_t mr; @@ -965,8 +967,8 @@ schizo_read_config(device_t dev, u_int b } static void -schizo_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, - uint32_t val, int width) +schizo_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int width) { struct schizo_softc *sc; bus_space_handle_t bh; @@ -1001,8 +1003,9 @@ schizo_route_interrupt(device_t bridge, sc = device_get_softc(bridge); pintr = pin; - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + maskbuf)) return (mintr); device_printf(bridge, "could not route pin %d for device %d.%d\n", @@ -1037,8 +1040,8 @@ schizo_dma_sync_stub(void *arg) (void)PCIB_READ_CONFIG(sds->sds_ppb, sds->sds_bus, sds->sds_slot, sds->sds_func, PCIR_VENDOR, 2); - for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_DONE, - SCHIZO_CDMA_STATE_PENDING) == 0;) + for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, + SCHIZO_CDMA_STATE_DONE, SCHIZO_CDMA_STATE_PENDING) == 0;) ; SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, 1); microuptime(&cur); @@ -1295,8 +1298,8 @@ schizo_alloc_resource(device_t bus, devi if (start != end) panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, - rid, start, end, count, flags)); + return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, + type, rid, start, end, count, flags)); } switch (type) { case SYS_RES_MEMORY: @@ -1411,7 +1414,7 @@ schizo_alloc_bus_tag(struct schizo_softc { bus_space_tag_t bt; - bt = (bus_space_tag_t)malloc(sizeof(struct bus_space_tag), M_DEVBUF, + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:43:19 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C92F7106566B; Fri, 15 Jan 2010 16:43:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1A38FC0C; Fri, 15 Jan 2010 16:43: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 o0FGhJBS030462; Fri, 15 Jan 2010 16:43:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGhJMS030459; Fri, 15 Jan 2010 16:43:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151643.o0FGhJMS030459@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202399 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:43:19 -0000 Author: marius Date: Fri Jan 15 16:43:19 2010 New Revision: 202399 URL: http://svn.freebsd.org/changeset/base/202399 Log: MFC: r201199 - Prefer i and j over i and n for temporary integer variables. - Wrap/shorten too long lines. - Remove a redundant variable and an unnecessary cast in schizo(4). Modified: stable/7/sys/sparc64/pci/psycho.c stable/7/sys/sparc64/pci/schizo.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/psycho.c ============================================================================== --- stable/7/sys/sparc64/pci/psycho.c Fri Jan 15 16:42:39 2010 (r202398) +++ stable/7/sys/sparc64/pci/psycho.c Fri Jan 15 16:43:19 2010 (r202399) @@ -182,9 +182,9 @@ struct psycho_dma_sync { void *pds_arg; /* argument for the handler */ void *pds_cookie; /* parent bus int. cookie */ device_t pds_ppb; /* farest PCI-PCI bridge */ - uint8_t pds_bus; /* bus of farest PCI device */ - uint8_t pds_slot; /* slot of farest PCI device */ - uint8_t pds_func; /* func. of farest PCI device */ + uint8_t pds_bus; /* bus of farest PCI dev. */ + uint8_t pds_slot; /* slot of farest PCI dev. */ + uint8_t pds_func; /* func. of farest PCI dev. */ }; #define PSYCHO_READ8(sc, off) \ @@ -206,8 +206,8 @@ struct psycho_dma_sync { * "Hummingbird" is the UltraSPARC IIe onboard UPA to PCI bridge. It's * basically the same as Sabre but without an APB underneath it. * - * "Psycho" and "Psycho+" are dual UPA to PCI bridges. They sit on the UPA bus - * and manage two PCI buses. "Psycho" has two 64-bit 33MHz buses, while + * "Psycho" and "Psycho+" are dual UPA to PCI bridges. They sit on the UPA + * bus and manage two PCI buses. "Psycho" has two 64-bit 33MHz buses, while * "Psycho+" controls both a 64-bit 33Mhz and a 64-bit 66Mhz PCI bus. You * will usually find a "Psycho+" since I don't think the original "Psycho" * ever shipped, and if it did it would be in the U30. @@ -264,7 +264,8 @@ psycho_get_desc(device_t dev) rv = psycho_find_desc(psycho_models, ofw_bus_get_model(dev)); if (rv == NULL) - rv = psycho_find_desc(psycho_compats, ofw_bus_get_compat(dev)); + rv = psycho_find_desc(psycho_compats, + ofw_bus_get_compat(dev)); return (rv); } @@ -296,7 +297,7 @@ psycho_attach(device_t dev) uint32_t dvmabase, prop, prop_array[2]; int32_t rev; u_int rerun, ver; - int i, n; + int i, j; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -462,12 +463,12 @@ psycho_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, PSYCHO_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - n = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (n != PSYCHO_NRANGE) + if (i != PSYCHO_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -475,11 +476,12 @@ psycho_attach(device_t dev) * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (n = 0; n < PSYCHO_NRANGE; n++) { - i = OFW_PCI_RANGE_CS(&range[n]); - if (sc->sc_pci_bh[i] != 0) - panic("%s: duplicate range for space %d", __func__, i); - sc->sc_pci_bh[i] = OFW_PCI_RANGE_PHYS(&range[n]); + for (i = 0; i < PSYCHO_NRANGE; i++) { + j = OFW_PCI_RANGE_CS(&range[i]); + if (sc->sc_pci_bh[j] != 0) + panic("%s: duplicate range for space %d", + __func__, j); + sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -497,8 +499,8 @@ psycho_attach(device_t dev) * vectors. We do this early in order to be able to catch * stray interrupts. */ - for (n = 0; n <= PSYCHO_MAX_INO; n++) { - if (psycho_find_intrmap(sc, n, &intrmap, &intrclr, + for (i = 0; i <= PSYCHO_MAX_INO; i++) { + if (psycho_find_intrmap(sc, i, &intrmap, &intrclr, NULL) == 0) continue; pica = malloc(sizeof(*pica), M_DEVBUF, M_NOWAIT); @@ -516,21 +518,21 @@ psycho_attach(device_t dev) */ device_printf(dev, "intr map (INO %d, %s) %#lx: %#lx, clr: %#lx\n", - n, intrmap <= PSR_PCIB3_INT_MAP ? "PCI" : "OBIO", - (u_long)intrmap, (u_long)PSYCHO_READ8(sc, intrmap), - (u_long)intrclr); - PSYCHO_WRITE8(sc, intrmap, INTMAP_VEC(sc->sc_ign, n)); + i, intrmap <= PSR_PCIB3_INT_MAP ? "PCI" : "OBIO", + (u_long)intrmap, (u_long)PSYCHO_READ8(sc, + intrmap), (u_long)intrclr); + PSYCHO_WRITE8(sc, intrmap, INTMAP_VEC(sc->sc_ign, i)); PSYCHO_WRITE8(sc, intrclr, 0); PSYCHO_WRITE8(sc, intrmap, - INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, n), + INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, i), PCPU_GET(mid))); #endif - i = intr_controller_register(INTMAP_VEC(sc->sc_ign, n), - &psycho_ic, pica); - if (i != 0) + j = intr_controller_register(INTMAP_VEC(sc->sc_ign, + i), &psycho_ic, pica); + if (j != 0) device_printf(dev, "could not register " "interrupt controller for INO %d (%d)\n", - n, i); + i, j); } if (sc->sc_mode == PSYCHO_MODE_PSYCHO) @@ -584,12 +586,12 @@ psycho_attach(device_t dev) sc->sc_pci_dmat->dt_cookie = sc->sc_is; sc->sc_pci_dmat->dt_mt = &iommu_dma_methods; - n = OF_getprop(node, "bus-range", (void *)prop_array, + i = OF_getprop(node, "bus-range", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get bus-range", __func__); - if (n != sizeof(prop_array)) - panic("%s: broken bus-range (%d)", __func__, n); + if (i != sizeof(prop_array)) + panic("%s: broken bus-range (%d)", __func__, i); if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", prop_array[0], prop_array[1], prop_array[0]); @@ -658,15 +660,15 @@ psycho_attach(device_t dev) PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, PCIR_LATTIMER, OFW_PCI_LATENCY, 1); - for (n = PCIR_VENDOR; n < PCIR_STATUS; n += sizeof(uint16_t)) - le16enc(&sc->sc_pci_hpbcfg[n], bus_space_read_2( + for (i = PCIR_VENDOR; i < PCIR_STATUS; i += sizeof(uint16_t)) + le16enc(&sc->sc_pci_hpbcfg[i], bus_space_read_2( sc->sc_pci_cfgt, sc->sc_pci_bh[OFW_PCI_CS_CONFIG], PSYCHO_CONF_OFF(sc->sc_pci_secbus, PCS_DEVICE, - PCS_FUNC, n))); - for (n = PCIR_REVID; n <= PCIR_BIST; n += sizeof(uint8_t)) - sc->sc_pci_hpbcfg[n] = bus_space_read_1(sc->sc_pci_cfgt, + PCS_FUNC, i))); + for (i = PCIR_REVID; i <= PCIR_BIST; i += sizeof(uint8_t)) + sc->sc_pci_hpbcfg[i] = bus_space_read_1(sc->sc_pci_cfgt, sc->sc_pci_bh[OFW_PCI_CS_CONFIG], PSYCHO_CONF_OFF( - sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, n)); + sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, i)); ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(ofw_pci_intr_t)); /* @@ -695,8 +697,8 @@ psycho_set_intr(struct psycho_softc *sc, int rid; rid = index; - sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, - &rid, RF_ACTIVE); + sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_irq_res[index] == NULL && intrmap >= PSR_POWER_INT_MAP) { /* * These interrupts aren't mandatory and not available @@ -705,7 +707,8 @@ psycho_set_intr(struct psycho_softc *sc, return; } if (sc->sc_irq_res[index] == NULL || - INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || + INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != + sc->sc_ign || INTVEC(PSYCHO_READ8(sc, intrmap)) != vec || intr_vectors[vec].iv_ic != &psycho_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], @@ -715,8 +718,8 @@ psycho_set_intr(struct psycho_softc *sc, } static int -psycho_find_intrmap(struct psycho_softc *sc, u_int ino, bus_addr_t *intrmapptr, - bus_addr_t *intrclrptr, bus_addr_t *intrdiagptr) +psycho_find_intrmap(struct psycho_softc *sc, u_int ino, + bus_addr_t *intrmapptr, bus_addr_t *intrclrptr, bus_addr_t *intrdiagptr) { bus_addr_t intrclr, intrmap; uint64_t diag; @@ -876,7 +879,7 @@ psycho_wakeup(void *arg) { struct psycho_softc *sc = arg; - /* Gee, we don't really have a framework to deal with this properly. */ + /* We don't really have a framework to deal with this properly. */ device_printf(sc->sc_dev, "power management wakeup\n"); return (FILTER_HANDLED); } @@ -993,8 +996,8 @@ psycho_read_config(device_t dev, u_int b } static void -psycho_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, - uint32_t val, int width) +psycho_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int width) { struct psycho_softc *sc; bus_space_handle_t bh; @@ -1030,8 +1033,9 @@ psycho_route_interrupt(device_t bridge, sc = device_get_softc(bridge); pintr = pin; - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + maskbuf)) return (mintr); /* * If this is outside of the range for an intpin, it's likely a full @@ -1053,7 +1057,8 @@ psycho_route_interrupt(device_t bridge, intrmap = PSR_PCIA0_INT_MAP + 8 * (pci_get_slot(dev) - 1 + 3 * sc->sc_half); mintr = INTINO(PSYCHO_READ8(sc, intrmap)) + pin - 1; - device_printf(bridge, "guessing interrupt %d for device %d.%d pin %d\n", + device_printf(bridge, + "guessing interrupt %d for device %d.%d pin %d\n", (int)mintr, pci_get_slot(dev), pci_get_function(dev), pin); return (mintr); } @@ -1272,8 +1277,8 @@ psycho_alloc_resource(device_t bus, devi if (start != end) panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, - rid, start, end, count, flags)); + return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, + type, rid, start, end, count, flags)); } switch (type) { case SYS_RES_MEMORY: @@ -1388,7 +1393,8 @@ psycho_alloc_bus_tag(struct psycho_softc { bus_space_tag_t bt; - bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, + M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:42:39 2010 (r202398) +++ stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:43:19 2010 (r202399) @@ -181,9 +181,9 @@ struct schizo_dma_sync { void *sds_cookie; uint64_t sds_syncval; device_t sds_ppb; /* farest PCI-PCI bridge */ - uint8_t sds_bus; /* bus of farest PCI device */ - uint8_t sds_slot; /* slot of farest PCI device */ - uint8_t sds_func; /* func. of farest PCI device */ + uint8_t sds_bus; /* bus of farest PCI dev. */ + uint8_t sds_slot; /* slot of farest PCI dev. */ + uint8_t sds_func; /* func. of farest PCI dev. */ }; #define SCHIZO_PERF_CNT_QLTY 100 @@ -261,7 +261,7 @@ schizo_attach(device_t dev) uint64_t ino_bitmap, reg; phandle_t node; uint32_t prop, prop_array[2]; - int i, mode, n, nrange, rid, tsbsize; + int i, j, mode, rid, tsbsize; sc = device_get_softc(dev); node = ofw_bus_get_node(dev); @@ -290,18 +290,18 @@ schizo_attach(device_t dev) */ sc->sc_half = (bus_get_resource_start(dev, SYS_RES_MEMORY, STX_PCI) >> 20) & 1; - for (n = 0; n < (mode == SCHIZO_MODE_SCZ ? SCZ_NREG : TOM_NREG); - n++) { - rid = n; - sc->sc_mem_res[n] = bus_alloc_resource_any(dev, + for (i = 0; i < (mode == SCHIZO_MODE_SCZ ? SCZ_NREG : TOM_NREG); + i++) { + rid = i; + sc->sc_mem_res[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, (((mode == SCHIZO_MODE_SCZ && ((sc->sc_half == 1 && - n == STX_PCI) || n == STX_CTRL)) || + i == STX_PCI) || i == STX_CTRL)) || (mode == SCHIZO_MODE_TOM && sc->sc_half == 0 && - n == STX_CTRL)) ? RF_SHAREABLE : 0) | RF_ACTIVE); - if (sc->sc_mem_res[n] == NULL) + i == STX_CTRL)) ? RF_SHAREABLE : 0) | RF_ACTIVE); + if (sc->sc_mem_res[i] == NULL) panic("%s: could not allocate register bank %d", - __func__, n); + __func__, i); } /* @@ -334,7 +334,8 @@ schizo_attach(device_t dev) if (OF_getprop(node, "portid", &sc->sc_ign, sizeof(sc->sc_ign)) == -1) panic("%s: could not determine IGN", __func__); - if (OF_getprop(node, "version#", &sc->sc_ver, sizeof(sc->sc_ver)) == -1) + if (OF_getprop(node, "version#", &sc->sc_ver, sizeof(sc->sc_ver)) == + -1) panic("%s: could not determine version", __func__); if (OF_getprop(node, "clock-frequency", &prop, sizeof(prop)) == -1) prop = 33000000; @@ -398,21 +399,21 @@ schizo_attach(device_t dev) * This is complicated by the fact that a pair of Schizo PBMs * shares one IGN. */ - n = OF_getprop(node, "ino-bitmap", (void *)prop_array, + i = OF_getprop(node, "ino-bitmap", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get ino-bitmap", __func__); ino_bitmap = ((uint64_t)prop_array[1] << 32) | prop_array[0]; - for (n = 0; n <= STX_MAX_INO; n++) { - if ((ino_bitmap & (1ULL << n)) == 0) + for (i = 0; i <= STX_MAX_INO; i++) { + if ((ino_bitmap & (1ULL << i)) == 0) continue; - if (n == STX_FB0_INO || n == STX_FB1_INO) + if (i == STX_FB0_INO || i == STX_FB1_INO) /* Leave for upa(4). */ continue; - i = schizo_intr_register(sc, n); - if (i != 0) + j = schizo_intr_register(sc, i); + if (j != 0) device_printf(dev, "could not register interrupt " - "controller for INO %d (%d)\n", n, i); + "controller for INO %d (%d)\n", i, j); } /* @@ -465,9 +466,9 @@ schizo_attach(device_t dev) tsbsize = (x); \ break; \ - n = OF_getprop(node, "virtual-dma", (void *)prop_array, + i = OF_getprop(node, "virtual-dma", (void *)prop_array, sizeof(prop_array)); - if (n == -1 || n != sizeof(prop_array)) + if (i == -1 || i != sizeof(prop_array)) schizo_iommu_init(sc, 7, -1); else { switch (prop_array[1]) { @@ -501,13 +502,12 @@ schizo_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, STX_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), - (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (nrange != STX_NRANGE) + if (i != STX_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -515,11 +515,12 @@ schizo_attach(device_t dev) * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (n = 0; n < STX_NRANGE; n++) { - i = OFW_PCI_RANGE_CS(&range[n]); - if (sc->sc_pci_bh[i] != 0) - panic("%s: duplicate range for space %d", __func__, i); - sc->sc_pci_bh[i] = OFW_PCI_RANGE_PHYS(&range[n]); + for (i = 0; i < STX_NRANGE; i++) { + j = OFW_PCI_RANGE_CS(&range[i]); + if (sc->sc_pci_bh[j] != 0) + panic("%s: duplicate range for space %d", + __func__, j); + sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -542,12 +543,12 @@ schizo_attach(device_t dev) * Get the bus range from the firmware. * NB: Tomatillos don't support PCI bus reenumeration. */ - n = OF_getprop(node, "bus-range", (void *)prop_array, + i = OF_getprop(node, "bus-range", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get bus-range", __func__); - if (n != sizeof(prop_array)) - panic("%s: broken bus-range (%d)", __func__, n); + if (i != sizeof(prop_array)) + panic("%s: broken bus-range (%d)", __func__, i); if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", prop_array[0], prop_array[1], prop_array[0]); @@ -635,7 +636,8 @@ schizo_attach(device_t dev) * a block store after a write to TOMXMS_PCI_DMA_SYNC_PEND though. */ if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || - sc->sc_mode == SCHIZO_MODE_TOM || sc->sc_mode == SCHIZO_MODE_XMS) { + sc->sc_mode == SCHIZO_MODE_TOM || + sc->sc_mode == SCHIZO_MODE_XMS) { sc->sc_flags |= SCHIZO_FLAGS_CDMA; if (sc->sc_mode == SCHIZO_MODE_SCZ) { sc->sc_cdma_state = SCHIZO_CDMA_STATE_DONE; @@ -644,26 +646,26 @@ schizo_attach(device_t dev) * at RID 4 but most don't. With the latter we add * it ourselves at the spare RID 5. */ - n = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, + i = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, 4)); - if (n == STX_CDMA_A_INO || n == STX_CDMA_B_INO) { - (void)schizo_get_intrmap(sc, n, NULL, + if (i == STX_CDMA_A_INO || i == STX_CDMA_B_INO) { + (void)schizo_get_intrmap(sc, i, NULL, &sc->sc_cdma_clr); - schizo_set_intr(sc, 4, n, schizo_cdma); + schizo_set_intr(sc, 4, i, schizo_cdma); } else { - n = STX_CDMA_A_INO + sc->sc_half; + i = STX_CDMA_A_INO + sc->sc_half; if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, n), 1) != 0) + INTMAP_VEC(sc->sc_ign, i), 1) != 0) panic("%s: failed to add CDMA " "interrupt", __func__); - i = schizo_intr_register(sc, n); - if (i != 0) + j = schizo_intr_register(sc, i); + if (j != 0) panic("%s: could not register " "interrupt controller for CDMA " - "(%d)", __func__, i); - (void)schizo_get_intrmap(sc, n, NULL, + "(%d)", __func__, j); + (void)schizo_get_intrmap(sc, i, NULL, &sc->sc_cdma_clr); - schizo_set_intr(sc, 5, n, schizo_cdma); + schizo_set_intr(sc, 5, i, schizo_cdma); } } if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) @@ -691,11 +693,11 @@ schizo_set_intr(struct schizo_softc *sc, int rid; rid = index; - sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, - &rid, RF_ACTIVE); + sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_irq_res[index] == NULL || - INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || - INTINO(vec) != ino || + INTINO(vec = rman_get_start(sc->sc_irq_res[index])) != ino || + INTIGN(vec) != sc->sc_ign || intr_vectors[vec].iv_ic != &schizo_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], INTR_TYPE_MISC | INTR_FAST, handler, NULL, sc, @@ -731,8 +733,8 @@ schizo_intr_register(struct schizo_softc } static int -schizo_get_intrmap(struct schizo_softc *sc, u_int ino, bus_addr_t *intrmapptr, - bus_addr_t *intrclrptr) +schizo_get_intrmap(struct schizo_softc *sc, u_int ino, + bus_addr_t *intrmapptr, bus_addr_t *intrclrptr) { bus_addr_t intrclr, intrmap; uint64_t mr; @@ -966,8 +968,8 @@ schizo_read_config(device_t dev, u_int b } static void -schizo_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, - uint32_t val, int width) +schizo_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int width) { struct schizo_softc *sc; bus_space_handle_t bh; @@ -1002,8 +1004,9 @@ schizo_route_interrupt(device_t bridge, sc = device_get_softc(bridge); pintr = pin; - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + maskbuf)) return (mintr); device_printf(bridge, "could not route pin %d for device %d.%d\n", @@ -1038,8 +1041,8 @@ schizo_dma_sync_stub(void *arg) (void)PCIB_READ_CONFIG(sds->sds_ppb, sds->sds_bus, sds->sds_slot, sds->sds_func, PCIR_VENDOR, 2); - for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_DONE, - SCHIZO_CDMA_STATE_PENDING) == 0;) + for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, + SCHIZO_CDMA_STATE_DONE, SCHIZO_CDMA_STATE_PENDING) == 0;) ; SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, 1); microuptime(&cur); @@ -1296,8 +1299,8 @@ schizo_alloc_resource(device_t bus, devi if (start != end) panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, - rid, start, end, count, flags)); + return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, + type, rid, start, end, count, flags)); } switch (type) { case SYS_RES_MEMORY: @@ -1412,7 +1415,7 @@ schizo_alloc_bus_tag(struct schizo_softc { bus_space_tag_t bt; - bt = (bus_space_tag_t)malloc(sizeof(struct bus_space_tag), M_DEVBUF, + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:46:03 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D817F106566B; Fri, 15 Jan 2010 16:46:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5D6D8FC13; Fri, 15 Jan 2010 16:46: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 o0FGk3id031155; Fri, 15 Jan 2010 16:46:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGk3L4031150; Fri, 15 Jan 2010 16:46:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151646.o0FGk3L4031150@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:46: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: r202400 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:46:03 -0000 Author: marius Date: Fri Jan 15 16:46:03 2010 New Revision: 202400 URL: http://svn.freebsd.org/changeset/base/202400 Log: MFC: r201395 - Preserve the PROM IOMMU in order to allow OFW drivers to continue to work. - Sanity check the parameters passed to the implementations of the pcib_{read,write}_config() methods. Using illegal values can cause no real harm but it doesn't hurt to avoid unnecessary data error traps requiring to flush and re-enable the level 1 caches. Modified: stable/8/sys/sparc64/pci/psycho.c stable/8/sys/sparc64/pci/psychovar.h stable/8/sys/sparc64/pci/schizo.c stable/8/sys/sparc64/pci/schizovar.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) Modified: stable/8/sys/sparc64/pci/psycho.c ============================================================================== --- stable/8/sys/sparc64/pci/psycho.c Fri Jan 15 16:43:19 2010 (r202399) +++ stable/8/sys/sparc64/pci/psycho.c Fri Jan 15 16:46:03 2010 (r202400) @@ -554,6 +554,7 @@ psycho_attach(device_t dev) M_NOWAIT | M_ZERO); if (sc->sc_is == NULL) panic("%s: malloc iommu_state failed", __func__); + sc->sc_is->is_flags = IOMMU_PRESERVE_PROM; if (sc->sc_mode == PSYCHO_MODE_SABRE) sc->sc_is->is_pmaxaddr = IOMMU_MAXADDR(SABRE_IOMMU_BITS); @@ -591,10 +592,11 @@ psycho_attach(device_t dev) panic("%s: could not get bus-range", __func__); if (i != sizeof(prop_array)) panic("%s: broken bus-range (%d)", __func__, i); + sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_subbus = prop_array[1]; if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", - prop_array[0], prop_array[1], prop_array[0]); - sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_secbus, sc->sc_pci_subbus, sc->sc_pci_secbus); /* Clear any pending PCI error bits. */ PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, @@ -923,6 +925,10 @@ psycho_read_config(device_t dev, u_int b int i; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return (-1); + bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; /* @@ -1003,6 +1009,10 @@ psycho_write_config(device_t dev, u_int u_long offset = 0; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return; + offset = PSYCHO_CONF_OFF(bus, slot, func, reg); bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; switch (width) { Modified: stable/8/sys/sparc64/pci/psychovar.h ============================================================================== --- stable/8/sys/sparc64/pci/psychovar.h Fri Jan 15 16:43:19 2010 (r202399) +++ stable/8/sys/sparc64/pci/psychovar.h Fri Jan 15 16:46:03 2010 (r202400) @@ -75,6 +75,7 @@ struct psycho_softc { struct rman sc_pci_io_rman; uint8_t sc_pci_secbus; + uint8_t sc_pci_subbus; uint8_t sc_pci_hpbcfg[16]; Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Fri Jan 15 16:43:19 2010 (r202399) +++ stable/8/sys/sparc64/pci/schizo.c Fri Jan 15 16:46:03 2010 (r202400) @@ -454,6 +454,7 @@ schizo_attach(device_t dev) * buffer, in Schizo version < 5 (i.e. revision < 2.3) it's * affected by several errata and basically unusable though. */ + sc->sc_is.is_flags = IOMMU_PRESERVE_PROM; sc->sc_is.is_pmaxaddr = IOMMU_MAXADDR(STX_IOMMU_BITS); sc->sc_is.is_sb[0] = sc->sc_is.is_sb[1] = 0; if (OF_getproplen(node, "no-streaming-cache") < 0 && @@ -548,10 +549,11 @@ schizo_attach(device_t dev) panic("%s: could not get bus-range", __func__); if (i != sizeof(prop_array)) panic("%s: broken bus-range (%d)", __func__, i); + sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_subbus = prop_array[1]; if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", - prop_array[0], prop_array[1], prop_array[0]); - sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_secbus, sc->sc_pci_subbus, sc->sc_pci_secbus); /* Clear any pending PCI error bits. */ PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, STX_CS_DEVICE, STX_CS_FUNC, @@ -927,6 +929,9 @@ schizo_read_config(device_t dev, u_int b uint8_t byte; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return (-1); /* * The Schizo bridges contain a dupe of their header at 0x80. @@ -975,6 +980,10 @@ schizo_write_config(device_t dev, u_int u_long offset = 0; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return; + offset = STX_CONF_OFF(bus, slot, func, reg); bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; switch (width) { Modified: stable/8/sys/sparc64/pci/schizovar.h ============================================================================== --- stable/8/sys/sparc64/pci/schizovar.h Fri Jan 15 16:43:19 2010 (r202399) +++ stable/8/sys/sparc64/pci/schizovar.h Fri Jan 15 16:46:03 2010 (r202400) @@ -71,6 +71,7 @@ struct schizo_softc { bus_dma_tag_t sc_pci_dmat; uint8_t sc_pci_secbus; + uint8_t sc_pci_subbus; struct ofw_bus_iinfo sc_pci_iinfo; From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:46:06 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6AD4106566C; Fri, 15 Jan 2010 16:46:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9474B8FC15; Fri, 15 Jan 2010 16:46: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 o0FGk61B031192; Fri, 15 Jan 2010 16:46:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGk6S6031187; Fri, 15 Jan 2010 16:46:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151646.o0FGk6S6031187@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202401 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:46:06 -0000 Author: marius Date: Fri Jan 15 16:46:06 2010 New Revision: 202401 URL: http://svn.freebsd.org/changeset/base/202401 Log: MFC: r201395 - Preserve the PROM IOMMU in order to allow OFW drivers to continue to work. - Sanity check the parameters passed to the implementations of the pcib_{read,write}_config() methods. Using illegal values can cause no real harm but it doesn't hurt to avoid unnecessary data error traps requiring to flush and re-enable the level 1 caches. Modified: stable/7/sys/sparc64/pci/psycho.c stable/7/sys/sparc64/pci/psychovar.h stable/7/sys/sparc64/pci/schizo.c stable/7/sys/sparc64/pci/schizovar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/psycho.c ============================================================================== --- stable/7/sys/sparc64/pci/psycho.c Fri Jan 15 16:46:03 2010 (r202400) +++ stable/7/sys/sparc64/pci/psycho.c Fri Jan 15 16:46:06 2010 (r202401) @@ -555,6 +555,7 @@ psycho_attach(device_t dev) M_NOWAIT | M_ZERO); if (sc->sc_is == NULL) panic("%s: malloc iommu_state failed", __func__); + sc->sc_is->is_flags = IOMMU_PRESERVE_PROM; if (sc->sc_mode == PSYCHO_MODE_SABRE) sc->sc_is->is_pmaxaddr = IOMMU_MAXADDR(SABRE_IOMMU_BITS); @@ -592,10 +593,11 @@ psycho_attach(device_t dev) panic("%s: could not get bus-range", __func__); if (i != sizeof(prop_array)) panic("%s: broken bus-range (%d)", __func__, i); + sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_subbus = prop_array[1]; if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", - prop_array[0], prop_array[1], prop_array[0]); - sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_secbus, sc->sc_pci_subbus, sc->sc_pci_secbus); /* Clear any pending PCI error bits. */ PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, @@ -924,6 +926,10 @@ psycho_read_config(device_t dev, u_int b int i; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return (-1); + bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; /* @@ -1004,6 +1010,10 @@ psycho_write_config(device_t dev, u_int u_long offset = 0; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return; + offset = PSYCHO_CONF_OFF(bus, slot, func, reg); bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; switch (width) { Modified: stable/7/sys/sparc64/pci/psychovar.h ============================================================================== --- stable/7/sys/sparc64/pci/psychovar.h Fri Jan 15 16:46:03 2010 (r202400) +++ stable/7/sys/sparc64/pci/psychovar.h Fri Jan 15 16:46:06 2010 (r202401) @@ -75,6 +75,7 @@ struct psycho_softc { struct rman sc_pci_io_rman; uint8_t sc_pci_secbus; + uint8_t sc_pci_subbus; uint8_t sc_pci_hpbcfg[16]; Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:46:03 2010 (r202400) +++ stable/7/sys/sparc64/pci/schizo.c Fri Jan 15 16:46:06 2010 (r202401) @@ -455,6 +455,7 @@ schizo_attach(device_t dev) * buffer, in Schizo version < 5 (i.e. revision < 2.3) it's * affected by several errata and basically unusable though. */ + sc->sc_is.is_flags = IOMMU_PRESERVE_PROM; sc->sc_is.is_pmaxaddr = IOMMU_MAXADDR(STX_IOMMU_BITS); sc->sc_is.is_sb[0] = sc->sc_is.is_sb[1] = 0; if (OF_getproplen(node, "no-streaming-cache") < 0 && @@ -549,10 +550,11 @@ schizo_attach(device_t dev) panic("%s: could not get bus-range", __func__); if (i != sizeof(prop_array)) panic("%s: broken bus-range (%d)", __func__, i); + sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_subbus = prop_array[1]; if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", - prop_array[0], prop_array[1], prop_array[0]); - sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_secbus, sc->sc_pci_subbus, sc->sc_pci_secbus); /* Clear any pending PCI error bits. */ PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, STX_CS_DEVICE, STX_CS_FUNC, @@ -928,6 +930,9 @@ schizo_read_config(device_t dev, u_int b uint8_t byte; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return (-1); /* * The Schizo bridges contain a dupe of their header at 0x80. @@ -976,6 +981,10 @@ schizo_write_config(device_t dev, u_int u_long offset = 0; sc = device_get_softc(dev); + if (bus < sc->sc_pci_secbus || bus > sc->sc_pci_subbus || + slot > PCI_SLOTMAX || func > PCI_FUNCMAX || reg > PCI_REGMAX) + return; + offset = STX_CONF_OFF(bus, slot, func, reg); bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; switch (width) { Modified: stable/7/sys/sparc64/pci/schizovar.h ============================================================================== --- stable/7/sys/sparc64/pci/schizovar.h Fri Jan 15 16:46:03 2010 (r202400) +++ stable/7/sys/sparc64/pci/schizovar.h Fri Jan 15 16:46:06 2010 (r202401) @@ -71,6 +71,7 @@ struct schizo_softc { bus_dma_tag_t sc_pci_dmat; uint8_t sc_pci_secbus; + uint8_t sc_pci_subbus; struct ofw_bus_iinfo sc_pci_iinfo; From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:54:59 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB4531065670; Fri, 15 Jan 2010 16:54:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FDC68FC15; Fri, 15 Jan 2010 16:54:59 +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 o0FGsx2D033273; Fri, 15 Jan 2010 16:54:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGsxRs033270; Fri, 15 Jan 2010 16:54:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151654.o0FGsxRs033270@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:54: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: r202402 - in stable/8/sys/sparc64: conf sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:54:59 -0000 Author: marius Date: Fri Jan 15 16:54:59 2010 New Revision: 202402 URL: http://svn.freebsd.org/changeset/base/202402 Log: MFC: r201396, r201410 - Demapping unused kernel TLB slots has proven to work reliably so move the associated debugging under bootverbose. - Remove freebsd4_sigreturn(); given that FreeBSD 4 didn't supported sparc64 this only ever served as a transition aid prior to FreeBSD 5.0 and is unused by default since COMPAT_FREEBSD4 was removed from GENERIC in r143072 nearly 5 years ago. Modified: stable/8/sys/sparc64/conf/NOTES stable/8/sys/sparc64/sparc64/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) Modified: stable/8/sys/sparc64/conf/NOTES ============================================================================== --- stable/8/sys/sparc64/conf/NOTES Fri Jan 15 16:46:06 2010 (r202401) +++ stable/8/sys/sparc64/conf/NOTES Fri Jan 15 16:54:59 2010 (r202402) @@ -129,6 +129,7 @@ nodevice ex # Options we don't want to deal with nooption FDC_DEBUG +nooption COMPAT_FREEBSD4 nooption SC_RENDER_DEBUG nooption SC_DEBUG_LEVEL nooption PPC_DEBUG Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Fri Jan 15 16:46:06 2010 (r202401) +++ stable/8/sys/sparc64/sparc64/machdep.c Fri Jan 15 16:54:59 2010 (r202402) @@ -383,8 +383,9 @@ sparc64_init(caddr_t mdp, u_long o1, u_l */ for (va = KERNBASE + (kernel_tlb_slots - 1) * PAGE_SIZE_4M; va >= roundup2(end, PAGE_SIZE_4M); va -= PAGE_SIZE_4M) { - printf("demapping unused kernel TLB slot (va %#lx - %#lx)\n", - va, va + PAGE_SIZE_4M - 1); + if (bootverbose) + printf("demapping unused kernel TLB slot " + "(va %#lx - %#lx)\n", va, va + PAGE_SIZE_4M - 1); stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_DMMU_DEMAP, 0); stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, @@ -660,15 +661,6 @@ sigreturn(struct thread *td, struct sigr return (EJUSTRETURN); } -#ifdef COMPAT_FREEBSD4 -int -freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap) -{ - - return sigreturn(td, (struct sigreturn_args *)uap); -} -#endif - /* * Construct a PCB from a trapframe. This is called from kdb_trap() where * we want to start a backtrace from the function that caused us to enter From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:55:01 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8A291065679; Fri, 15 Jan 2010 16:55:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B93278FC0C; Fri, 15 Jan 2010 16:55: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 o0FGt06i033339; Fri, 15 Jan 2010 16:55:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGt0dh033336; Fri, 15 Jan 2010 16:55:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151655.o0FGt0dh033336@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202403 - in stable/7/sys/sparc64: conf sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:55:01 -0000 Author: marius Date: Fri Jan 15 16:55:00 2010 New Revision: 202403 URL: http://svn.freebsd.org/changeset/base/202403 Log: MFC: r201396, r201410 - Demapping unused kernel TLB slots has proven to work reliably so move the associated debugging under bootverbose. - Remove freebsd4_sigreturn(); given that FreeBSD 4 didn't supported sparc64 this only ever served as a transition aid prior to FreeBSD 5.0 and is unused by default since COMPAT_FREEBSD4 was removed from GENERIC in r143072 nearly 5 years ago. Modified: stable/7/sys/sparc64/conf/NOTES stable/7/sys/sparc64/sparc64/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/conf/NOTES ============================================================================== --- stable/7/sys/sparc64/conf/NOTES Fri Jan 15 16:54:59 2010 (r202402) +++ stable/7/sys/sparc64/conf/NOTES Fri Jan 15 16:55:00 2010 (r202403) @@ -131,6 +131,7 @@ nodevice ex # Options we don't want to deal with nooption FDC_DEBUG +nooption COMPAT_FREEBSD4 nooption SC_RENDER_DEBUG nooption SC_DEBUG_LEVEL nooption PPC_DEBUG Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Fri Jan 15 16:54:59 2010 (r202402) +++ stable/7/sys/sparc64/sparc64/machdep.c Fri Jan 15 16:55:00 2010 (r202403) @@ -375,8 +375,9 @@ sparc64_init(caddr_t mdp, u_long o1, u_l */ for (va = KERNBASE + (kernel_tlb_slots - 1) * PAGE_SIZE_4M; va >= roundup2(end, PAGE_SIZE_4M); va -= PAGE_SIZE_4M) { - printf("demapping unused kernel TLB slot (va %#lx - %#lx)\n", - va, va + PAGE_SIZE_4M - 1); + if (bootverbose) + printf("demapping unused kernel TLB slot " + "(va %#lx - %#lx)\n", va, va + PAGE_SIZE_4M - 1); stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_DMMU_DEMAP, 0); stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, @@ -663,15 +664,6 @@ sigreturn(struct thread *td, struct sigr return (EJUSTRETURN); } -#ifdef COMPAT_FREEBSD4 -int -freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap) -{ - - return sigreturn(td, (struct sigreturn_args *)uap); -} -#endif - /* * Construct a PCB from a trapframe. This is called from kdb_trap() where * we want to start a backtrace from the function that caused us to enter From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:57:50 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2457106566C; Fri, 15 Jan 2010 16:57:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E094C8FC17; Fri, 15 Jan 2010 16:57:49 +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 o0FGvnNd034010; Fri, 15 Jan 2010 16:57:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGvn7t034008; Fri, 15 Jan 2010 16:57:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151657.o0FGvn7t034008@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:57:49 +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: r202404 - stable/8/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:57:50 -0000 Author: marius Date: Fri Jan 15 16:57:49 2010 New Revision: 202404 URL: http://svn.freebsd.org/changeset/base/202404 Log: MFC: r201901 Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNF license FreeBSD had in sys/boot). Obtained from: NetBSD Modified: stable/8/sys/boot/common/dev_net.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) Modified: stable/8/sys/boot/common/dev_net.c ============================================================================== --- stable/8/sys/boot/common/dev_net.c Fri Jan 15 16:55:00 2010 (r202403) +++ stable/8/sys/boot/common/dev_net.c Fri Jan 15 16:57:49 2010 (r202404) @@ -1,6 +1,4 @@ -/* - * $NetBSD: dev_net.c,v 1.12 1997/12/10 20:38:37 gwr Exp $ - */ +/* $NetBSD: dev_net.c,v 1.23 2008/04/28 20:24:06 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -17,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 16:57:53 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E90D8106566B; Fri, 15 Jan 2010 16:57:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D78CE8FC1E; Fri, 15 Jan 2010 16:57: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 o0FGvr54034076; Fri, 15 Jan 2010 16:57:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FGvrLn034074; Fri, 15 Jan 2010 16:57:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151657.o0FGvrLn034074@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 16:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202405 - stable/7/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:57:54 -0000 Author: marius Date: Fri Jan 15 16:57:53 2010 New Revision: 202405 URL: http://svn.freebsd.org/changeset/base/202405 Log: MFC: r201901 Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNF license FreeBSD had in sys/boot). Obtained from: NetBSD Modified: stable/7/sys/boot/common/dev_net.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 16:57:49 2010 (r202404) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 16:57:53 2010 (r202405) @@ -1,6 +1,4 @@ -/* - * $NetBSD: dev_net.c,v 1.12 1997/12/10 20:38:37 gwr Exp $ - */ +/* $NetBSD: dev_net.c,v 1.23 2008/04/28 20:24:06 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -17,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 19:06:34 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 339E81065672; Fri, 15 Jan 2010 19:06:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2163B8FC13; Fri, 15 Jan 2010 19:06: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 o0FJ6YEC062713; Fri, 15 Jan 2010 19:06:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJ6YY6062710; Fri, 15 Jan 2010 19:06:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151906.o0FJ6YY6062710@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 19:06: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: r202408 - in stable/8/sys/boot: common sparc64/loader X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:06:34 -0000 Author: marius Date: Fri Jan 15 19:06:33 2010 New Revision: 202408 URL: http://svn.freebsd.org/changeset/base/202408 Log: MFC: r201932 - Add code allowing a network device to only be open and closed once by keeping it opened after the first open and closing it via the cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined in order to avoid the open-close-dance on every file access which with firmware that for example performs an auto-negotiation on every open causes netbooting to take horribly long. Basically the behavior with this knob enabled resembles the one employed between r60506 and r177108 (and for sparc64 also again since r182919) with the addition that the network device now is closed eventually before entering the kernel and before rebooting. Actually I think this should be the desired MI behavior, however the U-Boot loader actually requires net_close() to be called after every transaction in order for some local shutdown operations to be performed (and which I think thus will break on concurrent opens, i.e. when netdev_opens is > 1, like the loader does at least for disks when LOADER_GZIP_SUPPORT is enabled). - Use NETIF_OPEN_CLOSE_ONCE to replace the hack, which artificially increased netdev_opens for sparc64 in order to keep the network device opened forever, as at least some firmware versions require the network device to be closed eventually before entering the kernel or otherwise will DMA received packets to stale memory. The powerpc OFW loader probably wants NETIF_OPEN_CLOSE_ONCE to be set as well for the same reasons. Modified: stable/8/sys/boot/common/dev_net.c stable/8/sys/boot/sparc64/loader/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) Modified: stable/8/sys/boot/common/dev_net.c ============================================================================== --- stable/8/sys/boot/common/dev_net.c Fri Jan 15 18:31:44 2010 (r202407) +++ stable/8/sys/boot/common/dev_net.c Fri Jan 15 19:06:33 2010 (r202408) @@ -71,12 +71,14 @@ __FBSDID("$FreeBSD$"); int debug = 0; #endif +static char *netdev_name; static int netdev_sock = -1; static int netdev_opens; static int net_init(void); static int net_open(struct open_file *, ...); static int net_close(struct open_file *); +static void net_cleanup(void); static int net_strategy(); static void net_print(int); @@ -90,7 +92,8 @@ struct devsw netdev = { net_open, net_close, noioctl, - net_print + net_print, + net_cleanup }; static int @@ -116,6 +119,12 @@ net_open(struct open_file *f, ...) devname = va_arg(args, char*); va_end(args); +#ifdef NETIF_OPEN_CLOSE_ONCE + /* Before opening another interface, close the previous one first. */ + if (netdev_sock >= 0 && strcmp(devname, netdev_name) != 0) + net_cleanup(); +#endif + /* On first open, do netif open, mount, etc. */ if (netdev_opens == 0) { /* Find network interface. */ @@ -125,6 +134,7 @@ net_open(struct open_file *f, ...) printf("net_open: netif_open() failed\n"); return (ENXIO); } + netdev_name = strdup(devname); #ifdef NETIF_DEBUG if (debug) printf("net_open: netif_open() succeeded\n"); @@ -135,14 +145,12 @@ net_open(struct open_file *f, ...) error = net_getparams(netdev_sock); if (error) { /* getparams makes its own noise */ + free(netdev_name); netif_close(netdev_sock); netdev_sock = -1; return (error); } } -#if defined(__sparc64__) - netdev_opens++; -#endif } netdev_opens++; f->f_devdata = &netdev_sock; @@ -152,30 +160,46 @@ net_open(struct open_file *f, ...) static int net_close(struct open_file *f) { + #ifdef NETIF_DEBUG if (debug) printf("net_close: opens=%d\n", netdev_opens); #endif - /* On last close, do netif close, etc. */ f->f_devdata = NULL; + +#ifndef NETIF_OPEN_CLOSE_ONCE /* Extra close call? */ if (netdev_opens <= 0) return (0); netdev_opens--; /* Not last close? */ if (netdev_opens > 0) - return(0); - rootip.s_addr = 0; + return (0); + /* On last close, do netif close, etc. */ +#ifdef NETIF_DEBUG + if (debug) + printf("net_close: calling net_cleanup()\n"); +#endif + net_cleanup(); +#endif + return (0); +} + +static void +net_cleanup(void) +{ + if (netdev_sock >= 0) { #ifdef NETIF_DEBUG if (debug) - printf("net_close: calling netif_close()\n"); + printf("net_cleanup: calling netif_close()\n"); #endif + rootip.s_addr = 0; + free(netdev_name); netif_close(netdev_sock); netdev_sock = -1; } - return (0); } static int Modified: stable/8/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/8/sys/boot/sparc64/loader/Makefile Fri Jan 15 18:31:44 2010 (r202407) +++ stable/8/sys/boot/sparc64/loader/Makefile Fri Jan 15 19:06:33 2010 (r202408) @@ -51,11 +51,15 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../.. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. +# 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 CLEANFILES+= vers.c loader.help From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 19:06:47 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E8341065672; Fri, 15 Jan 2010 19:06:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C67D8FC12; Fri, 15 Jan 2010 19:06:47 +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 o0FJ6l1e062786; Fri, 15 Jan 2010 19:06:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJ6lJB062783; Fri, 15 Jan 2010 19:06:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151906.o0FJ6lJB062783@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 19:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202409 - in stable/7/sys/boot: common sparc64/loader X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:06:47 -0000 Author: marius Date: Fri Jan 15 19:06:47 2010 New Revision: 202409 URL: http://svn.freebsd.org/changeset/base/202409 Log: MFC: r201932 - Add code allowing a network device to only be open and closed once by keeping it opened after the first open and closing it via the cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined. Note that due to the fact that the part of r177108 which reverts r60506 and causes the open-close-dance on every file access as the remaining problems with powerpc should be sorted out first, in stable/7 the only difference in behavior between when NETIF_OPEN_CLOSE_ONCE is defined and not currently is that with that macro defined the network device is eventually closed before entering the kernel and before rebooting. - Define NETIF_OPEN_CLOSE_ONCE on sparc64 in order to not keep the network device opened forever, as at least with some firmware versions received packets are DMA'ed to stale memory otherwise. Modified: stable/7/sys/boot/common/dev_net.c stable/7/sys/boot/sparc64/loader/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 19:06:33 2010 (r202408) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 19:06:47 2010 (r202409) @@ -71,12 +71,14 @@ __FBSDID("$FreeBSD$"); int debug = 0; #endif +static char *netdev_name; static int netdev_sock = -1; static int netdev_opens; static int net_init(void); static int net_open(struct open_file *, ...); static int net_close(struct open_file *); +static void net_cleanup(void); static int net_strategy(); static void net_print(int); @@ -90,7 +92,8 @@ struct devsw netdev = { net_open, net_close, noioctl, - net_print + net_print, + net_cleanup }; static int @@ -116,6 +119,12 @@ net_open(struct open_file *f, ...) devname = va_arg(args, char*); va_end(args); +#ifdef NETIF_OPEN_CLOSE_ONCE + /* Before opening another interface, close the previous one first. */ + if (netdev_sock >= 0 && strcmp(devname, netdev_name) != 0) + net_cleanup(); +#endif + /* On first open, do netif open, mount, etc. */ if (netdev_opens == 0) { /* Find network interface. */ @@ -125,6 +134,7 @@ net_open(struct open_file *f, ...) printf("net_open: netif_open() failed\n"); return (ENXIO); } + netdev_name = strdup(devname); #ifdef NETIF_DEBUG if (debug) printf("net_open: netif_open() succeeded\n"); @@ -135,6 +145,7 @@ net_open(struct open_file *f, ...) error = net_getparams(netdev_sock); if (error) { /* getparams makes its own noise */ + free(netdev_name); netif_close(netdev_sock); netdev_sock = -1; return (error); @@ -150,30 +161,46 @@ net_open(struct open_file *f, ...) static int net_close(struct open_file *f) { + #ifdef NETIF_DEBUG if (debug) printf("net_close: opens=%d\n", netdev_opens); #endif - /* On last close, do netif close, etc. */ f->f_devdata = NULL; + +#ifndef NETIF_OPEN_CLOSE_ONCE /* Extra close call? */ if (netdev_opens <= 0) return (0); netdev_opens--; /* Not last close? */ if (netdev_opens > 0) - return(0); - rootip.s_addr = 0; + return (0); + /* On last close, do netif close, etc. */ +#ifdef NETIF_DEBUG + if (debug) + printf("net_close: calling net_cleanup()\n"); +#endif + net_cleanup(); +#endif + return (0); +} + +static void +net_cleanup(void) +{ + if (netdev_sock >= 0) { #ifdef NETIF_DEBUG if (debug) - printf("net_close: calling netif_close()\n"); + printf("net_cleanup: calling netif_close()\n"); #endif + rootip.s_addr = 0; + free(netdev_name); netif_close(netdev_sock); netdev_sock = -1; } - return (0); } static int Modified: stable/7/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/7/sys/boot/sparc64/loader/Makefile Fri Jan 15 19:06:33 2010 (r202408) +++ stable/7/sys/boot/sparc64/loader/Makefile Fri Jan 15 19:06:47 2010 (r202409) @@ -50,11 +50,15 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../.. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. +# 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 CLEANFILES+= vers.c loader.help From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 19:12:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A368E1065670; Fri, 15 Jan 2010 19:12:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FDD68FC18; Fri, 15 Jan 2010 19:12: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 o0FJCXge064161; Fri, 15 Jan 2010 19:12:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJCXwK064153; Fri, 15 Jan 2010 19:12:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151912.o0FJCXwK064153@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 19:12: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: r202410 - in stable/8/sys: conf modules modules/epic sparc64/conf sparc64/ebus X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:12:33 -0000 Author: marius Date: Fri Jan 15 19:12:33 2010 New Revision: 202410 URL: http://svn.freebsd.org/changeset/base/202410 Log: MFC: r202006 Add epic(4), a driver for the front panel LEDs in Sun Fire V215/V245. It's named after the driver doing the same job in OpenSolaris. Added: stable/8/sys/modules/epic/ - copied from r202006, head/sys/modules/epic/ stable/8/sys/sparc64/ebus/epic.c - copied unchanged from r202006, head/sys/sparc64/ebus/epic.c Modified: stable/8/sys/conf/files.sparc64 stable/8/sys/modules/Makefile stable/8/sys/sparc64/conf/GENERIC 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) Modified: stable/8/sys/conf/files.sparc64 ============================================================================== --- stable/8/sys/conf/files.sparc64 Fri Jan 15 19:06:47 2010 (r202409) +++ stable/8/sys/conf/files.sparc64 Fri Jan 15 19:12:33 2010 (r202410) @@ -68,6 +68,7 @@ libkern/flsl.c standard libkern/memmove.c standard sparc64/central/central.c optional central sparc64/ebus/ebus.c optional ebus +sparc64/ebus/epic.c optional epic ebus sparc64/fhc/clkbrd.c optional fhc sparc64/fhc/fhc.c optional fhc sparc64/isa/isa.c optional isa Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Fri Jan 15 19:06:47 2010 (r202409) +++ stable/8/sys/modules/Makefile Fri Jan 15 19:12:33 2010 (r202410) @@ -80,6 +80,7 @@ SUBDIR= ${_3dfx} \ ${_em} \ en \ ${_ep} \ + ${_epic} \ ${_et} \ ${_ex} \ ${_exca} \ @@ -593,6 +594,7 @@ _sound= sound .if ${MACHINE_ARCH} == "sparc64" _auxio= auxio _em= em +_epic= epic _i2c= i2c _igb= igb .if ${MK_CDDL} != "no" || defined(ALL_MODULES) Modified: stable/8/sys/sparc64/conf/GENERIC ============================================================================== --- stable/8/sys/sparc64/conf/GENERIC Fri Jan 15 19:06:47 2010 (r202409) +++ stable/8/sys/sparc64/conf/GENERIC Fri Jan 15 19:12:33 2010 (r202410) @@ -141,6 +141,7 @@ device eeprom # eeprom (really a front device mk48txx # Mostek MK48Txx clocks device rtc # rtc (really a front-end for the MC146818) device mc146818 # Motorola MC146818 and compatible clocks +device epic # Sun Fire V215/V245 LEDs # Serial (COM) ports device puc # Multi-channel uarts Copied: stable/8/sys/sparc64/ebus/epic.c (from r202006, head/sys/sparc64/ebus/epic.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/ebus/epic.c Fri Jan 15 19:12:33 2010 (r202410, copy of r202006, head/sys/sparc64/ebus/epic.c) @@ -0,0 +1,216 @@ +/*- + * Copyright (c) 2009 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#define EPIC_DELAY 10000 + +#define EPIC_NREG 1 +#define EPIC_FW_LED 0 + +#define EPIC_FW_LED_DATA 0x40 +#define EPIC_FW_LED_ADDR 0x41 +#define EPIC_FW_LED_WRITE_MASK 0x80 + +#define EPIC_FW_VERSION 0x05 +#define EPIC_LED_STATE0 0x06 + +#define EPIC_LED_ALERT_MASK 0x0c +#define EPIC_LED_ALERT_OFF 0x00 +#define EPIC_LED_ALERT_ON 0x04 + +#define EPIC_LED_POWER_MASK 0x30 +#define EPIC_LED_POWER_OFF 0x00 +#define EPIC_LED_POWER_ON 0x10 +#define EPIC_LED_POWER_SB_BLINK 0x20 +#define EPIC_LED_POWER_FAST_BLINK 0x30 + +static struct resource_spec epic_res_spec[] = { + { SYS_RES_MEMORY, EPIC_FW_LED, RF_ACTIVE }, + { -1, 0 } +}; + +struct epic_softc { + struct mtx sc_mtx; + struct resource *sc_res[EPIC_NREG]; + struct cdev *sc_led_dev_alert; + struct cdev *sc_led_dev_power; +}; + +#define EPIC_FW_LED_READ(sc, off) ({ \ + uint8_t __val; \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, (off));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + __val = bus_read_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA);\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, 1, \ + BUS_SPACE_BARRIER_READ); \ + DELAY(EPIC_DELAY); \ + __val; \ +}) + +#define EPIC_FW_LED_WRITE(sc, off, mask, val) do { \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, (off));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_WRITE_MASK, \ + (mask)); \ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_WRITE_MASK, \ + 1, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, (val));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ +} while (0) + +#define EPIC_LOCK_INIT(sc) \ + mtx_init(&(sc)->sc_mtx, "epic mtx", NULL, MTX_DEF) +#define EPIC_LOCK_DESTROY(sc) mtx_destroy(&(sc)->sc_mtx) +#define EPIC_LOCK(sc) mtx_lock(&(sc)->sc_mtx) +#define EPIC_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) + +static device_probe_t epic_probe; +static device_attach_t epic_attach; +static device_detach_t epic_detach; + +static void epic_led_alert(void *arg, int onoff); +static void epic_led_power(void *arg, int onoff); + +static device_method_t epic_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, epic_probe), + DEVMETHOD(device_attach, epic_attach), + DEVMETHOD(device_detach, epic_detach), + + KOBJMETHOD_END +}; + +static devclass_t epic_devclass; + +DEFINE_CLASS_0(epic, epic_driver, epic_methods, + sizeof(struct epic_softc)); +DRIVER_MODULE(epic, ebus, epic_driver, epic_devclass, 0, 0); + +static int +epic_probe(device_t dev) +{ + const char* compat; + + compat = ofw_bus_get_compat(dev); + if (compat != NULL && strcmp(ofw_bus_get_name(dev), + "env-monitor") == 0 && strcmp(compat, "epic") == 0) { + device_set_desc(dev, "Sun Fire V215/V245 LEDs"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +epic_attach(device_t dev) +{ + struct epic_softc *sc; + + sc = device_get_softc(dev); + if (bus_alloc_resources(dev, epic_res_spec, sc->sc_res)) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, epic_res_spec, sc->sc_res); + return (ENXIO); + } + + EPIC_LOCK_INIT(sc); + + if (bootverbose) + device_printf(dev, "version 0x%x\n", + EPIC_FW_LED_READ(sc, EPIC_FW_VERSION)); + + sc->sc_led_dev_alert = led_create(epic_led_alert, sc, "alert"); + sc->sc_led_dev_power = led_create(epic_led_power, sc, "power"); + + return (0); +} + +static int +epic_detach(device_t dev) +{ + struct epic_softc *sc; + + sc = device_get_softc(dev); + + led_destroy(sc->sc_led_dev_alert); + led_destroy(sc->sc_led_dev_power); + + bus_release_resources(dev, epic_res_spec, sc->sc_res); + + EPIC_LOCK_DESTROY(sc); + + return (0); +} + +static void +epic_led_alert(void *arg, int onoff) +{ + struct epic_softc *sc; + + sc = (struct epic_softc *)arg; + + EPIC_LOCK(sc); + EPIC_FW_LED_WRITE(sc, EPIC_LED_STATE0, EPIC_LED_ALERT_MASK, + onoff ? EPIC_LED_ALERT_ON : EPIC_LED_ALERT_OFF); + EPIC_UNLOCK(sc); +} + +static void +epic_led_power(void *arg, int onoff) +{ + struct epic_softc *sc; + + sc = (struct epic_softc *)arg; + + EPIC_LOCK(sc); + EPIC_FW_LED_WRITE(sc, EPIC_LED_STATE0, EPIC_LED_POWER_MASK, + onoff ? EPIC_LED_POWER_ON : EPIC_LED_POWER_OFF); + EPIC_UNLOCK(sc); +} From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 19:12:35 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28CFE1065676; Fri, 15 Jan 2010 19:12:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 157FF8FC19; Fri, 15 Jan 2010 19:12: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 o0FJCYMi064194; Fri, 15 Jan 2010 19:12:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJCYGE064189; Fri, 15 Jan 2010 19:12:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151912.o0FJCYGE064189@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 19:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202411 - in stable/7/sys: conf modules modules/epic sparc64/conf sparc64/ebus X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:12:35 -0000 Author: marius Date: Fri Jan 15 19:12:34 2010 New Revision: 202411 URL: http://svn.freebsd.org/changeset/base/202411 Log: MFC: r202006 Add epic(4), a driver for the front panel LEDs in Sun Fire V215/V245. It's named after the driver doing the same job in OpenSolaris. Added: stable/7/sys/modules/epic/ - copied from r202006, head/sys/modules/epic/ stable/7/sys/sparc64/ebus/epic.c - copied unchanged from r202006, head/sys/sparc64/ebus/epic.c Modified: stable/7/sys/conf/files.sparc64 stable/7/sys/modules/Makefile stable/7/sys/sparc64/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files.sparc64 ============================================================================== --- stable/7/sys/conf/files.sparc64 Fri Jan 15 19:12:33 2010 (r202410) +++ stable/7/sys/conf/files.sparc64 Fri Jan 15 19:12:34 2010 (r202411) @@ -64,6 +64,7 @@ libkern/fls.c standard libkern/flsl.c standard sparc64/central/central.c optional central sparc64/ebus/ebus.c optional ebus +sparc64/ebus/epic.c optional epic ebus sparc64/fhc/clkbrd.c optional clkbrd fhc sparc64/fhc/fhc.c optional fhc sparc64/isa/isa.c optional isa Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Fri Jan 15 19:12:33 2010 (r202410) +++ stable/7/sys/modules/Makefile Fri Jan 15 19:12:34 2010 (r202411) @@ -86,6 +86,7 @@ SUBDIR= ${_3dfx} \ ${_em} \ en \ ${_ep} \ + ${_epic} \ ${_et} \ ${_ex} \ ${_exca} \ @@ -636,6 +637,7 @@ _smbfs= smbfs .if ${MACHINE_ARCH} == "sparc64" _auxio= auxio _em= em +_epic= epic _i2c= i2c _igb= igb .if ${MK_CDDL} != "no" || defined(ALL_MODULES) Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Fri Jan 15 19:12:33 2010 (r202410) +++ stable/7/sys/sparc64/conf/GENERIC Fri Jan 15 19:12:34 2010 (r202411) @@ -137,6 +137,7 @@ device eeprom # eeprom (really a front device mk48txx # Mostek MK48Txx clocks device rtc # rtc (really a front-end for the MC146818) device mc146818 # Motorola MC146818 and compatible clocks +device epic # Sun Fire V215/V245 LEDs # Serial (COM) ports device puc # Multi-channel uarts Copied: stable/7/sys/sparc64/ebus/epic.c (from r202006, head/sys/sparc64/ebus/epic.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/ebus/epic.c Fri Jan 15 19:12:34 2010 (r202411, copy of r202006, head/sys/sparc64/ebus/epic.c) @@ -0,0 +1,216 @@ +/*- + * Copyright (c) 2009 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#define EPIC_DELAY 10000 + +#define EPIC_NREG 1 +#define EPIC_FW_LED 0 + +#define EPIC_FW_LED_DATA 0x40 +#define EPIC_FW_LED_ADDR 0x41 +#define EPIC_FW_LED_WRITE_MASK 0x80 + +#define EPIC_FW_VERSION 0x05 +#define EPIC_LED_STATE0 0x06 + +#define EPIC_LED_ALERT_MASK 0x0c +#define EPIC_LED_ALERT_OFF 0x00 +#define EPIC_LED_ALERT_ON 0x04 + +#define EPIC_LED_POWER_MASK 0x30 +#define EPIC_LED_POWER_OFF 0x00 +#define EPIC_LED_POWER_ON 0x10 +#define EPIC_LED_POWER_SB_BLINK 0x20 +#define EPIC_LED_POWER_FAST_BLINK 0x30 + +static struct resource_spec epic_res_spec[] = { + { SYS_RES_MEMORY, EPIC_FW_LED, RF_ACTIVE }, + { -1, 0 } +}; + +struct epic_softc { + struct mtx sc_mtx; + struct resource *sc_res[EPIC_NREG]; + struct cdev *sc_led_dev_alert; + struct cdev *sc_led_dev_power; +}; + +#define EPIC_FW_LED_READ(sc, off) ({ \ + uint8_t __val; \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, (off));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + __val = bus_read_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA);\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, 1, \ + BUS_SPACE_BARRIER_READ); \ + DELAY(EPIC_DELAY); \ + __val; \ +}) + +#define EPIC_FW_LED_WRITE(sc, off, mask, val) do { \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, (off));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_WRITE_MASK, \ + (mask)); \ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_WRITE_MASK, \ + 1, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, (val));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ +} while (0) + +#define EPIC_LOCK_INIT(sc) \ + mtx_init(&(sc)->sc_mtx, "epic mtx", NULL, MTX_DEF) +#define EPIC_LOCK_DESTROY(sc) mtx_destroy(&(sc)->sc_mtx) +#define EPIC_LOCK(sc) mtx_lock(&(sc)->sc_mtx) +#define EPIC_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) + +static device_probe_t epic_probe; +static device_attach_t epic_attach; +static device_detach_t epic_detach; + +static void epic_led_alert(void *arg, int onoff); +static void epic_led_power(void *arg, int onoff); + +static device_method_t epic_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, epic_probe), + DEVMETHOD(device_attach, epic_attach), + DEVMETHOD(device_detach, epic_detach), + + KOBJMETHOD_END +}; + +static devclass_t epic_devclass; + +DEFINE_CLASS_0(epic, epic_driver, epic_methods, + sizeof(struct epic_softc)); +DRIVER_MODULE(epic, ebus, epic_driver, epic_devclass, 0, 0); + +static int +epic_probe(device_t dev) +{ + const char* compat; + + compat = ofw_bus_get_compat(dev); + if (compat != NULL && strcmp(ofw_bus_get_name(dev), + "env-monitor") == 0 && strcmp(compat, "epic") == 0) { + device_set_desc(dev, "Sun Fire V215/V245 LEDs"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +epic_attach(device_t dev) +{ + struct epic_softc *sc; + + sc = device_get_softc(dev); + if (bus_alloc_resources(dev, epic_res_spec, sc->sc_res)) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, epic_res_spec, sc->sc_res); + return (ENXIO); + } + + EPIC_LOCK_INIT(sc); + + if (bootverbose) + device_printf(dev, "version 0x%x\n", + EPIC_FW_LED_READ(sc, EPIC_FW_VERSION)); + + sc->sc_led_dev_alert = led_create(epic_led_alert, sc, "alert"); + sc->sc_led_dev_power = led_create(epic_led_power, sc, "power"); + + return (0); +} + +static int +epic_detach(device_t dev) +{ + struct epic_softc *sc; + + sc = device_get_softc(dev); + + led_destroy(sc->sc_led_dev_alert); + led_destroy(sc->sc_led_dev_power); + + bus_release_resources(dev, epic_res_spec, sc->sc_res); + + EPIC_LOCK_DESTROY(sc); + + return (0); +} + +static void +epic_led_alert(void *arg, int onoff) +{ + struct epic_softc *sc; + + sc = (struct epic_softc *)arg; + + EPIC_LOCK(sc); + EPIC_FW_LED_WRITE(sc, EPIC_LED_STATE0, EPIC_LED_ALERT_MASK, + onoff ? EPIC_LED_ALERT_ON : EPIC_LED_ALERT_OFF); + EPIC_UNLOCK(sc); +} + +static void +epic_led_power(void *arg, int onoff) +{ + struct epic_softc *sc; + + sc = (struct epic_softc *)arg; + + EPIC_LOCK(sc); + EPIC_FW_LED_WRITE(sc, EPIC_LED_STATE0, EPIC_LED_POWER_MASK, + onoff ? EPIC_LED_POWER_ON : EPIC_LED_POWER_OFF); + EPIC_UNLOCK(sc); +} From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 19:42:09 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A86BB106566C; Fri, 15 Jan 2010 19:42:09 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96BBA8FC13; Fri, 15 Jan 2010 19:42: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 o0FJg9hH071048; Fri, 15 Jan 2010 19:42:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJg9SN071046; Fri, 15 Jan 2010 19:42:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001151942.o0FJg9SN071046@svn.freebsd.org> From: Christian Brueffer Date: Fri, 15 Jan 2010 19:42: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: r202413 - stable/8/lib/libc/stdio X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:42:09 -0000 Author: brueffer Date: Fri Jan 15 19:42:09 2010 New Revision: 202413 URL: http://svn.freebsd.org/changeset/base/202413 Log: MFC: r201836 Remove unnecessary quoting and markup, add missing punctuation. Modified: stable/8/lib/libc/stdio/getc.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/stdio/getc.3 ============================================================================== --- stable/8/lib/libc/stdio/getc.3 Fri Jan 15 19:34:40 2010 (r202412) +++ stable/8/lib/libc/stdio/getc.3 Fri Jan 15 19:42:09 2010 (r202413) @@ -56,7 +56,7 @@ .Ft int .Fn getchar void .Ft int -.Fn getchar_unlocked "void" +.Fn getchar_unlocked void .Ft int .Fn getw "FILE *stream" .Sh DESCRIPTION @@ -141,7 +141,7 @@ until the condition is cleared with .Sh STANDARDS The .Fn fgetc , -.Fn getc +.Fn getc , and .Fn getchar functions @@ -167,4 +167,3 @@ The size and byte order of an varies from one machine to another, and .Fn getw is not recommended for portable applications. -.Pp From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 19:44:40 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B1F7106566C; Fri, 15 Jan 2010 19:44:40 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 897C28FC1B; Fri, 15 Jan 2010 19:44:40 +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 o0FJie9h071665; Fri, 15 Jan 2010 19:44:40 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJieSV071663; Fri, 15 Jan 2010 19:44:40 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001151944.o0FJieSV071663@svn.freebsd.org> From: Christian Brueffer Date: Fri, 15 Jan 2010 19:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202414 - stable/7/lib/libc/stdio X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:44:40 -0000 Author: brueffer Date: Fri Jan 15 19:44:40 2010 New Revision: 202414 URL: http://svn.freebsd.org/changeset/base/202414 Log: MFC: r201836 Remove unnecessary quoting and markup, add missing punctuation. Modified: stable/7/lib/libc/stdio/getc.3 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdio/getc.3 ============================================================================== --- stable/7/lib/libc/stdio/getc.3 Fri Jan 15 19:42:09 2010 (r202413) +++ stable/7/lib/libc/stdio/getc.3 Fri Jan 15 19:44:40 2010 (r202414) @@ -56,7 +56,7 @@ .Ft int .Fn getchar void .Ft int -.Fn getchar_unlocked "void" +.Fn getchar_unlocked void .Ft int .Fn getw "FILE *stream" .Sh DESCRIPTION @@ -141,7 +141,7 @@ until the condition is cleared with .Sh STANDARDS The .Fn fgetc , -.Fn getc +.Fn getc , and .Fn getchar functions @@ -167,4 +167,3 @@ The size and byte order of an varies from one machine to another, and .Fn getw is not recommended for portable applications. -.Pp From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 19:48:14 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649CC106566B; Fri, 15 Jan 2010 19:48:14 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52DFB8FC16; Fri, 15 Jan 2010 19:48:14 +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 o0FJmEbf072517; Fri, 15 Jan 2010 19:48:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJmEOX072515; Fri, 15 Jan 2010 19:48:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001151948.o0FJmEOX072515@svn.freebsd.org> From: Christian Brueffer Date: Fri, 15 Jan 2010 19:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202415 - stable/6/lib/libc/stdio X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:48:14 -0000 Author: brueffer Date: Fri Jan 15 19:48:14 2010 New Revision: 202415 URL: http://svn.freebsd.org/changeset/base/202415 Log: MFC: r201836 Remove unnecessary quoting and markup, add missing punctuation. Modified: stable/6/lib/libc/stdio/getc.3 Directory Properties: stable/6/lib/libc/ (props changed) Modified: stable/6/lib/libc/stdio/getc.3 ============================================================================== --- stable/6/lib/libc/stdio/getc.3 Fri Jan 15 19:44:40 2010 (r202414) +++ stable/6/lib/libc/stdio/getc.3 Fri Jan 15 19:48:14 2010 (r202415) @@ -60,7 +60,7 @@ .Ft int .Fn getchar .Ft int -.Fn getchar_unlocked "void" +.Fn getchar_unlocked void .Ft int .Fn getw "FILE *stream" .Sh DESCRIPTION @@ -145,7 +145,7 @@ until the condition is cleared with .Sh STANDARDS The .Fn fgetc , -.Fn getc +.Fn getc , and .Fn getchar functions @@ -171,4 +171,3 @@ The size and byte order of an varies from one machine to another, and .Fn getw is not recommended for portable applications. -.Pp From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 19:53:36 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF5C6106566C; Fri, 15 Jan 2010 19:53:36 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDCD68FC17; Fri, 15 Jan 2010 19:53:36 +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 o0FJraQI073729; Fri, 15 Jan 2010 19:53:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJraT8073727; Fri, 15 Jan 2010 19:53:36 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001151953.o0FJraT8073727@svn.freebsd.org> From: Christian Brueffer Date: Fri, 15 Jan 2010 19:53:36 +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: r202416 - stable/8/lib/libelf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:53:37 -0000 Author: brueffer Date: Fri Jan 15 19:53:36 2010 New Revision: 202416 URL: http://svn.freebsd.org/changeset/base/202416 Log: MFC: r202159 Remove useless .TE groff macro. Modified: stable/8/lib/libelf/elf.3 Directory Properties: stable/8/lib/libelf/ (props changed) Modified: stable/8/lib/libelf/elf.3 ============================================================================== --- stable/8/lib/libelf/elf.3 Fri Jan 15 19:48:14 2010 (r202415) +++ stable/8/lib/libelf/elf.3 Fri Jan 15 19:53:36 2010 (r202416) @@ -379,7 +379,6 @@ See .It Dv SHT_SUNW_move Ta Dv ELF_T_MOVE Ta ELF move records. .It Dv SHT_SUNW_syminfo Ta Dv ELF_T_SYMINFO Ta Additional symbol flags. .El -.TE .Ss Functional Grouping This section contains a brief overview of the available functionality in the ELF library. From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 19:54:13 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 498BD1065693; Fri, 15 Jan 2010 19:54:13 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37EF88FC32; Fri, 15 Jan 2010 19:54: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 o0FJsDAd073908; Fri, 15 Jan 2010 19:54:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJsDn1073906; Fri, 15 Jan 2010 19:54:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001151954.o0FJsDn1073906@svn.freebsd.org> From: Christian Brueffer Date: Fri, 15 Jan 2010 19:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202417 - stable/7/lib/libelf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:54:13 -0000 Author: brueffer Date: Fri Jan 15 19:54:12 2010 New Revision: 202417 URL: http://svn.freebsd.org/changeset/base/202417 Log: MFC: r202159 Remove useless .TE groff macro. Modified: stable/7/lib/libelf/elf.3 Directory Properties: stable/7/lib/libelf/ (props changed) Modified: stable/7/lib/libelf/elf.3 ============================================================================== --- stable/7/lib/libelf/elf.3 Fri Jan 15 19:53:36 2010 (r202416) +++ stable/7/lib/libelf/elf.3 Fri Jan 15 19:54:12 2010 (r202417) @@ -379,7 +379,6 @@ See .It Dv SHT_SUNW_move Ta Dv ELF_T_MOVE Ta ELF move records. .It Dv SHT_SUNW_syminfo Ta Dv ELF_T_SYMINFO Ta Additional symbol flags. .El -.TE .Ss Functional Grouping This section contains a brief overview of the available functionality in the ELF library. From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 21:45:47 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 478BA106566B; Fri, 15 Jan 2010 21:45:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33F568FC16; Fri, 15 Jan 2010 21:45:47 +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 o0FLjlTv098532; Fri, 15 Jan 2010 21:45:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FLjlGI098526; Fri, 15 Jan 2010 21:45:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001152145.o0FLjlGI098526@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 21:45: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: r202419 - in stable/8/sys: conf sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 21:45:47 -0000 Author: marius Date: Fri Jan 15 21:45:46 2010 New Revision: 202419 URL: http://svn.freebsd.org/changeset/base/202419 Log: MFC: r201052, r201200, r202003, r202010, r202023 Add a driver for the `Fire' JBus to PCIe bridges found in at least the Sun Fire V215/V245 and Sun Ultra 25/45 machines. This driver also already includes all the code to support the `Oberon' Uranus to PCIe bridges found in the Fujitsu-Siemens based Mx000 machines but due to lack of access to such a system for testing, probing of these bridges is currently disabled. Unfortunately, the event queue mechanism of these bridges for MSIs/ MSI-Xs matches our current MD and MI interrupt frameworks like square pegs fit into round holes so for now we are generous and use one event queue per MSI, which limits us to 35 MSIs/MSI-Xs per Host-PCIe-bridge (we use one event queue for the PCIe error messages). This seems tolerable as long as most devices just use one MSI/MSI-X anyway. Adding knowledge about MSIs/MSI-Xs to the MD interrupt code should allow us to decouple the 1:1 mapping at the cost of no longer being able to bind MSIs/MSI-Xs to specific CPUs as we currently have no reliable way to quiesce a device during the transition of its MSIs/ MSI-Xs to another event queue. This would still require the problem of interrupt storms generated by devices which have no one-shot behavior or can't/don't mask interrupts while the filter/handler is executed (like the older PCIe NICs supported by bge(4)) to be solved though. Added: stable/8/sys/sparc64/pci/fire.c - copied, changed from r201052, head/sys/sparc64/pci/fire.c stable/8/sys/sparc64/pci/firereg.h - copied unchanged from r201052, head/sys/sparc64/pci/firereg.h stable/8/sys/sparc64/pci/firevar.h - copied unchanged from r201052, head/sys/sparc64/pci/firevar.h Modified: stable/8/sys/conf/files.sparc64 stable/8/sys/conf/options.sparc64 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) Modified: stable/8/sys/conf/files.sparc64 ============================================================================== --- stable/8/sys/conf/files.sparc64 Fri Jan 15 20:08:08 2010 (r202418) +++ stable/8/sys/conf/files.sparc64 Fri Jan 15 21:45:46 2010 (r202419) @@ -75,6 +75,7 @@ sparc64/isa/isa.c optional isa sparc64/isa/isa_dma.c optional isa sparc64/isa/ofw_isa.c optional ebus | isa sparc64/pci/apb.c optional pci +sparc64/pci/fire.c optional pci sparc64/pci/ofw_pcib.c optional pci sparc64/pci/ofw_pcib_subr.c optional pci sparc64/pci/ofw_pcibus.c optional pci Modified: stable/8/sys/conf/options.sparc64 ============================================================================== --- stable/8/sys/conf/options.sparc64 Fri Jan 15 20:08:08 2010 (r202418) +++ stable/8/sys/conf/options.sparc64 Fri Jan 15 21:45:46 2010 (r202419) @@ -8,6 +8,8 @@ SUN4U opt_global.h ATKBD_DFLT_KEYMAP opt_atkbd.h +FIRE_DEBUG opt_fire.h + # Debug IOMMU inserts/removes using diagnostic accesses. This is very loud. IOMMU_DIAG opt_iommu.h Copied and modified: stable/8/sys/sparc64/pci/fire.c (from r201052, head/sys/sparc64/pci/fire.c) ============================================================================== --- head/sys/sparc64/pci/fire.c Sun Dec 27 16:55:44 2009 (r201052, copy source) +++ stable/8/sys/sparc64/pci/fire.c Fri Jan 15 21:45:46 2010 (r202419) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +struct fire_msiqarg; + static bus_space_tag_t fire_alloc_bus_tag(struct fire_softc *sc, int type); static const struct fire_desc *fire_get_desc(device_t dev); static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, @@ -94,6 +96,9 @@ static void fire_intr_clear(void *arg); static void fire_intr_disable(void *arg); static void fire_intr_enable(void *arg); static int fire_intr_register(struct fire_softc *sc, u_int ino); +static inline void fire_msiq_common(struct intr_vector *iv, + struct fire_msiqarg *fmqa); +static void fire_msiq_filter(void *cookie); static void fire_msiq_handler(void *cookie); static void fire_set_intr(struct fire_softc *sc, u_int index, u_int ino, driver_filter_t handler, void *arg); @@ -184,6 +189,13 @@ struct fire_icarg { bus_addr_t fica_clr; }; +static const struct intr_controller fire_msiqc_filter = { + fire_intr_enable, + fire_intr_disable, + fire_intr_assign, + NULL +}; + struct fire_msiqarg { struct fire_icarg fmqa_fica; struct mtx fmqa_mtx; @@ -290,7 +302,7 @@ fire_attach(device_t dev) uint64_t ino_bitmap, val; phandle_t node; uint32_t prop, prop_array[2]; - int i, j, mode, nrange; + int i, j, mode; u_int lw; uint16_t mps; @@ -725,13 +737,12 @@ fire_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, FO_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), - (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (nrange != FIRE_NRANGE) + if (i != FIRE_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -743,7 +754,7 @@ fire_attach(device_t dev) j = OFW_PCI_RANGE_CS(&range[i]); if (sc->sc_pci_bh[j] != 0) panic("%s: duplicate range for space %d", - __func__, j); + __func__, j); sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -1612,7 +1623,7 @@ fire_intr_clear(void *arg) */ static int -fire_alloc_msi(device_t dev, device_t child, int count, int maxcount, +fire_alloc_msi(device_t dev, device_t child, int count, int maxcount __unused, int *irqs) { struct fire_softc *sc; @@ -1638,16 +1649,11 @@ fire_alloc_msi(device_t dev, device_t ch mtx_unlock(&sc->sc_msi_mtx); return (ENXIO); } - /* - * It's unclear whether we need to actually align the MSIs in the - * mapping table based on the maxcount or just the count. We use - * maxcount to be on the safe side. - */ - for (i = 0; i + maxcount < sc->sc_msi_count; i += maxcount) { - for (j = i; j < i + maxcount; j++) + for (i = 0; i + count < sc->sc_msi_count; i += count) { + for (j = i; j < i + count; j++) if (isclr(sc->sc_msi_bitmap, j) == 0) break; - if (j == i + maxcount) { + if (j == i + count) { for (j = 0; j < count; j++) { setbit(sc->sc_msiq_bitmap, msiqrun + j); setbit(sc->sc_msi_bitmap, i + j); @@ -1766,33 +1772,67 @@ fire_msiq_handler(void *cookie) { struct intr_vector *iv; struct fire_msiqarg *fmqa; - struct fire_softc *sc; - struct fo_msiq_record *qrec; - device_t dev; - uint64_t word0; - u_int head, msi, msiq; iv = cookie; fmqa = iv->iv_icarg; - sc = fmqa->fmqa_fica.fica_sc; - dev = sc->sc_dev; - msiq = fmqa->fmqa_msiq; /* * Note that since fire_intr_clear() will clear the event queue - * interrupt after the filter/handler associated with the MSI [sic] - * has been executed we have to protect the access to the event queue - * as otherwise nested event queue interrupts cause corruption of the + * interrupt after the handler associated with the MSI [sic] has + * been executed we have to protect the access to the event queue as + * otherwise nested event queue interrupts cause corruption of the * event queue on MP machines. Obviously especially when abandoning * the 1:1 mapping it would be better to not clear the event queue - * interrupt after each filter/handler invocation but only once when - * the outstanding MSIs have been processed but unfortunately that + * interrupt after each handler invocation but only once when the + * outstanding MSIs have been processed but unfortunately that * doesn't work well and leads to interrupt storms with controllers/ - * drivers which don't mask interrupts while the filter/handler is - * executed. Maybe delaying clearing the MSI until after the filter/ - * handler has been executed could be used to work around this but - * that's not the intended usage and might in turn cause lost MSIs. + * drivers which don't mask interrupts while the handler is executed. + * Maybe delaying clearing the MSI until after the handler has been + * executed could be used to work around this but that's not the + * intended usage and might in turn cause lost MSIs. */ mtx_lock_spin(&fmqa->fmqa_mtx); + fire_msiq_common(iv, fmqa); + mtx_unlock_spin(&fmqa->fmqa_mtx); +} + +static void +fire_msiq_filter(void *cookie) +{ + struct intr_vector *iv; + struct fire_msiqarg *fmqa; + + iv = cookie; + fmqa = iv->iv_icarg; + /* + * For filters we don't use fire_intr_clear() since it would clear + * the event queue interrupt while we're still processing the event + * queue as filters and associated post-filter handler are executed + * directly, which in turn would lead to lost MSIs. So we clear the + * event queue interrupt only once after processing the event queue. + * Given that this still guarantees the filters to not be executed + * concurrently and no other CPU can clear the event queue interrupt + * while the event queue is still processed, we don't even need to + * interlock the access to the event queue in this case. + */ + critical_enter(); + fire_msiq_common(iv, fmqa); + FIRE_PCI_WRITE_8(fmqa->fmqa_fica.fica_sc, fmqa->fmqa_fica.fica_clr, + INTCLR_IDLE); + critical_exit(); +} + +static inline void +fire_msiq_common(struct intr_vector *iv, struct fire_msiqarg *fmqa) +{ + struct fire_softc *sc; + struct fo_msiq_record *qrec; + device_t dev; + uint64_t word0; + u_int head, msi, msiq; + + sc = fmqa->fmqa_fica.fica_sc; + dev = sc->sc_dev; + msiq = fmqa->fmqa_msiq; head = (FIRE_PCI_READ_8(sc, fmqa->fmqa_head) & FO_PCI_EQ_HD_MASK) >> FO_PCI_EQ_HD_SHFT; qrec = &fmqa->fmqa_base[head]; @@ -1834,7 +1874,6 @@ fire_msiq_handler(void *cookie) FIRE_PCI_READ_8(sc, FO_PCI_EQ_CTRL_CLR_BASE + msiq) | FO_PCI_EQ_CTRL_CLR_COVERR); } - mtx_unlock_spin(&fmqa->fmqa_mtx); } static int @@ -1843,6 +1882,7 @@ fire_setup_intr(device_t dev, device_t c void **cookiep) { struct fire_softc *sc; + struct fire_msiqarg *fmqa; u_long vec; int error; u_int msi, msiq; @@ -1873,31 +1913,39 @@ fire_setup_intr(device_t dev, device_t c intr, arg, cookiep); rman_set_start(ires, msi); rman_set_end(ires, msi); - if (error == 0) { + if (error != 0) + return (error); + fmqa = intr_vectors[vec].iv_icarg; + /* + * XXX inject our event queue handler. + */ + if (filt != NULL) { + intr_vectors[vec].iv_func = fire_msiq_filter; + intr_vectors[vec].iv_ic = &fire_msiqc_filter; /* - * XXX inject our event queue handler. + * Ensure the event queue interrupt is cleared, it + * might have triggered before. Given we supply NULL + * as ic_clear, inthand_add() won't do this for us. */ + FIRE_PCI_WRITE_8(sc, fmqa->fmqa_fica.fica_clr, + INTCLR_IDLE); + } else intr_vectors[vec].iv_func = fire_msiq_handler; - /* - * Record the MSI/MSI-X as long as we we use a 1:1 - * mapping. - */ - ((struct fire_msiqarg *)intr_vectors[vec].iv_icarg)-> - fmqa_msi = msi; - FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + - (msiq << 3), FO_PCI_EQ_CTRL_SET_EN); - msi <<= 3; - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, - (FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) & - ~FO_PCI_MSI_MAP_EQNUM_MASK) | - ((msiq << FO_PCI_MSI_MAP_EQNUM_SHFT) & - FO_PCI_MSI_MAP_EQNUM_MASK)); - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_CLR_BASE + msi, - FO_PCI_MSI_CLR_EQWR_N); - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, - FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) | - FO_PCI_MSI_MAP_V); - } + /* Record the MSI/MSI-X as long as we we use a 1:1 mapping. */ + fmqa->fmqa_msi = msi; + FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + (msiq << 3), + FO_PCI_EQ_CTRL_SET_EN); + msi <<= 3; + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, + (FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) & + ~FO_PCI_MSI_MAP_EQNUM_MASK) | + ((msiq << FO_PCI_MSI_MAP_EQNUM_SHFT) & + FO_PCI_MSI_MAP_EQNUM_MASK)); + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_CLR_BASE + msi, + FO_PCI_MSI_CLR_EQWR_N); + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, + FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) | + FO_PCI_MSI_MAP_V); return (error); } @@ -1946,14 +1994,16 @@ fire_teardown_intr(device_t dev, device_ (0 << FO_PCI_EQ_TL_SHFT) & FO_PCI_EQ_TL_MASK); FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_HD_BASE + msiq, (0 << FO_PCI_EQ_HD_SHFT) & FO_PCI_EQ_HD_MASK); + intr_vectors[vec].iv_ic = &fire_ic; /* * The MD interrupt code needs the vector rather than the MSI. */ rman_set_start(ires, vec); rman_set_end(ires, vec); error = bus_generic_teardown_intr(dev, child, ires, cookie); + msi >>= 3; rman_set_start(ires, msi); - rman_set_end(ires, msi >> 3); + rman_set_end(ires, msi); return (error); } return (bus_generic_teardown_intr(dev, child, ires, cookie)); @@ -2101,7 +2151,7 @@ fire_alloc_bus_tag(struct fire_softc *sc { bus_space_tag_t bt; - bt = (bus_space_tag_t)malloc(sizeof(struct bus_space_tag), M_DEVBUF, + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); Copied: stable/8/sys/sparc64/pci/firereg.h (from r201052, head/sys/sparc64/pci/firereg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/pci/firereg.h Fri Jan 15 21:45:46 2010 (r202419, copy of r201052, head/sys/sparc64/pci/firereg.h) @@ -0,0 +1,1004 @@ +/*- + * Copyright (c) 2009 Marius Strobl + * 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$ + */ + +#ifndef _SPARC64_PCI_FIREREG_H_ +#define _SPARC64_PCI_FIREREG_H_ + +#define FIRE_NINTR 3 /* 2 OFW + 1 MSIq */ +#define FIRE_NRANGE 4 +#define FIRE_NREG 2 + +#define FIRE_PCI 0 +#define FIRE_CTRL 1 + +/* PCI configuration and status registers */ +#define FO_PCI_INT_MAP_BASE 0x01000 +#define FO_PCI_INT_CLR_BASE 0x01400 +#define FO_PCI_EQ_BASE_ADDR 0x10000 +#define FO_PCI_EQ_CTRL_SET_BASE 0x11000 +#define FO_PCI_EQ_CTRL_CLR_BASE 0x11200 +#define FO_PCI_EQ_TL_BASE 0x11600 +#define FO_PCI_EQ_HD_BASE 0x11800 +#define FO_PCI_MSI_MAP_BASE 0x20000 +#define FO_PCI_MSI_CLR_BASE 0x28000 +#define FO_PCI_ERR_COR 0x30000 +#define FO_PCI_ERR_NONFATAL 0x30008 +#define FO_PCI_ERR_FATAL 0x30010 +#define FO_PCI_PM_PME 0x30018 +#define FO_PCI_PME_TO_ACK 0x30020 +#define FO_PCI_IMU_INT_EN 0x31008 +#define FO_PCI_IMU_INT_STAT 0x31010 +#define FO_PCI_IMU_ERR_STAT_CLR 0x31018 +#define FO_PCI_IMU_RDS_ERR_LOG 0x31028 +#define FO_PCI_IMU_SCS_ERR_LOG 0x31030 +#define FO_PCI_IMU_EQS_ERR_LOG 0x31038 +#define FO_PCI_DMC_CORE_BLOCK_INT_EN 0x31800 +#define FO_PCI_DMC_CORE_BLOCK_ERR_STAT 0x31808 +#define FO_PCI_MULTI_CORE_ERR_STAT 0x31810 +#define FO_PCI_MSI_32_BIT_ADDR 0x34000 +#define FO_PCI_MSI_64_BIT_ADDR 0x34008 +#define FO_PCI_MMU 0x40000 +#define FO_PCI_MMU_INT_EN 0x41008 +#define FO_PCI_MMU_INT_STAT 0x41010 +#define FO_PCI_MMU_ERR_STAT_CLR 0x41018 +#define FO_PCI_MMU_TRANS_FAULT_ADDR 0x41028 +#define FO_PCI_MMU_TRANS_FAULT_STAT 0x41030 +#define FO_PCI_ILU_INT_EN 0x51008 +#define FO_PCI_ILU_INT_STAT 0x51010 +#define FO_PCI_ILU_ERR_STAT_CLR 0x51018 +#define FO_PCI_DMC_DBG_SEL_PORTA 0x53000 +#define FO_PCI_DMC_DBG_SEL_PORTB 0x53008 +#define FO_PCI_PEC_CORE_BLOCK_INT_EN 0x51800 +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT 0x51808 +#define FO_PCI_TLU_CTRL 0x80000 +#define FO_PCI_TLU_OEVENT_INT_EN 0x81008 +#define FO_PCI_TLU_OEVENT_INT_STAT 0x81010 +#define FO_PCI_TLU_OEVENT_STAT_CLR 0x81018 +#define FO_PCI_TLU_RX_OEVENT_HDR1_LOG 0x81028 +#define FO_PCI_TLU_RX_OEVENT_HDR2_LOG 0x81030 +#define FO_PCI_TLU_TX_OEVENT_HDR1_LOG 0x81038 +#define FO_PCI_TLU_TX_OEVENT_HDR2_LOG 0x81040 +#define FO_PCI_TLU_DEV_CTRL 0x90008 +#define FO_PCI_TLU_LNK_CTRL 0x90020 +#define FO_PCI_TLU_LNK_STAT 0x90028 +#define FO_PCI_TLU_UERR_INT_EN 0x91008 +#define FO_PCI_TLU_UERR_INT_STAT 0x91010 +#define FO_PCI_TLU_UERR_STAT_CLR 0x91018 +#define FO_PCI_TLU_RX_UERR_HDR1_LOG 0x91028 +#define FO_PCI_TLU_RX_UERR_HDR2_LOG 0x91030 +#define FO_PCI_TLU_TX_UERR_HDR1_LOG 0x91038 +#define FO_PCI_TLU_TX_UERR_HDR2_LOG 0x91040 +#define FO_PCI_TLU_CERR_INT_EN 0xa1008 +#define FO_PCI_TLU_CERR_INT_STAT 0xa1010 +#define FO_PCI_TLU_CERR_STAT_CLR 0xa1018 +#define FO_PCI_LPU_RST 0xe2008 +#define FO_PCI_LPU_INT_STAT 0xe2040 +#define FO_PCI_LPU_INT_MASK 0xe0248 +#define FO_PCI_LPU_LNK_LYR_CFG 0xe2200 +#define FO_PCI_LPU_LNK_LYR_INT_STAT 0xe2210 +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL 0xe2240 +#define FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS 0xe2400 +#define FO_PCI_LPU_TXLNK_RPLY_TMR_THRS 0xe2410 +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR 0xe2430 +#define FO_PCI_LPU_PHY_LYR_INT_STAT 0xe2610 +#define FO_PCI_LPU_LTSSM_CFG2 0xe2788 +#define FO_PCI_LPU_LTSSM_CFG3 0xe2790 +#define FO_PCI_LPU_LTSSM_CFG4 0xe2798 +#define FO_PCI_LPU_LTSSM_CFG5 0xe27a0 + +/* PCI interrupt mapping registers */ +#define FO_PCI_IMAP_MDO_MODE 0x8000000000000000ULL +#define FO_PCI_IMAP_V 0x0000000080000000ULL +#define FIRE_PCI_IMAP_T_JPID_MASK 0x000000007c000000ULL +#define FIRE_PCI_IMAP_T_JPID_SHFT 26 +#define OBERON_PCI_IMAP_T_DESTID_MASK 0x000000007fe00000ULL +#define OBERON_PCI_IMAP_T_DESTID_SHFT 21 +#define FO_PCI_IMAP_INT_CTRL_NUM_MASK 0x00000000000003c0ULL +#define FO_PCI_IMAP_INT_CTRL_NUM_SHFT 6 + +/* PCI interrupt clear registers - use INTCLR_* from */ + +/* PCI event queue base address register */ +#define FO_PCI_EQ_BASE_ADDR_BYPASS 0xfffc000000000000ULL +#define FO_PCI_EQ_BASE_ADDR_MASK 0xfffffffffff80000ULL +#define FO_PCI_EQ_BASE_ADDR_SHFT 19 + +/* PCI event queue control set registers */ +#define FO_PCI_EQ_CTRL_SET_ENOVERR 0x0200000000000000ULL +#define FO_PCI_EQ_CTRL_SET_EN 0x0000100000000000ULL + +/* PCI event queue control clear registers */ +#define FO_PCI_EQ_CTRL_CLR_COVERR 0x0200000000000000ULL +#define FO_PCI_EQ_CTRL_CLR_E2I 0x0000800000000000ULL +#define FO_PCI_EQ_CTRL_CLR_DIS 0x0000100000000000ULL + +/* PCI event queue tail registers */ +#define FO_PCI_EQ_TL_OVERR 0x0200000000000000ULL +#define FO_PCI_EQ_TL_MASK 0x000000000000007fULL +#define FO_PCI_EQ_TL_SHFT 0 + +/* PCI event queue head registers */ +#define FO_PCI_EQ_HD_MASK 0x000000000000007fULL +#define FO_PCI_EQ_HD_SHFT 0 + +/* PCI MSI mapping registers */ +#define FO_PCI_MSI_MAP_V 0x8000000000000000ULL +#define FO_PCI_MSI_MAP_EQWR_N 0x4000000000000000ULL +#define FO_PCI_MSI_MAP_EQNUM_MASK 0x000000000000003fULL +#define FO_PCI_MSI_MAP_EQNUM_SHFT 0 + +/* PCI MSI clear registers */ +#define FO_PCI_MSI_CLR_EQWR_N 0x4000000000000000ULL + +/* + * PCI IMU interrupt enable, interrupt status and error status clear + * registers + */ +#define FO_PCI_IMU_ERR_INT_SPARE_S_MASK 0x00007c0000000000ULL +#define FO_PCI_IMU_ERR_INT_SPARE_S_SHFT 42 +#define FO_PCI_IMU_ERR_INT_EQ_OVER_S 0x0000020000000000ULL +#define FO_PCI_IMU_ERR_INT_EQ_NOT_EN_S 0x0000010000000000ULL +#define FO_PCI_IMU_ERR_INT_MSI_MAL_ERR_S 0x0000008000000000ULL +#define FO_PCI_IMU_ERR_INT_MSI_PAR_ERR_S 0x0000004000000000ULL +#define FO_PCI_IMU_ERR_INT_PMEACK_MES_NOT_EN_S 0x0000002000000000ULL +#define FO_PCI_IMU_ERR_INT_PMPME_MES_NOT_EN_S 0x0000001000000000ULL +#define FO_PCI_IMU_ERR_INT_FATAL_MES_NOT_EN_S 0x0000000800000000ULL +#define FO_PCI_IMU_ERR_INT_NFATAL_MES_NOT_EN_S 0x0000000400000000ULL +#define FO_PCI_IMU_ERR_INT_COR_MES_NOT_EN_S 0x0000000200000000ULL +#define FO_PCI_IMU_ERR_INT_MSI_NOT_EN_S 0x0000000100000000ULL +#define FO_PCI_IMU_ERR_INT_SPARE_P_MASK 0x0000000000007c00ULL +#define FO_PCI_IMU_ERR_INT_SPARE_P_SHFT 10 +#define FO_PCI_IMU_ERR_INT_EQ_OVER_P 0x0000000000000200ULL +#define FO_PCI_IMU_ERR_INT_EQ_NOT_EN_P 0x0000000000000100ULL +#define FO_PCI_IMU_ERR_INT_MSI_MAL_ERR_P 0x0000000000000080ULL +#define FO_PCI_IMU_ERR_INT_MSI_PAR_ERR_P 0x0000000000000040ULL +#define FO_PCI_IMU_ERR_INT_PMEACK_MES_NOT_EN_P 0x0000000000000020ULL +#define FO_PCI_IMU_ERR_INT_PMPME_MES_NOT_EN_P 0x0000000000000010ULL +#define FO_PCI_IMU_ERR_INT_FATAL_MES_NOT_EN_P 0x0000000000000008ULL +#define FO_PCI_IMU_ERR_INT_NFATAL_MES_NOT_EN_P 0x0000000000000004ULL +#define FO_PCI_IMU_ERR_INT_COR_MES_NOT_EN_P 0x0000000000000002ULL +#define FO_PCI_IMU_ERR_INT_MSI_NOT_EN_P 0x0000000000000001ULL + +/* PCI IMU RDS error log register */ +#define FO_PCI_IMU_RDS_ERR_LOG_TYPE_MASK 0xfc00000000000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_TYPE_SHFT 58 +#define FO_PCI_IMU_RDS_ERR_LOG_LENGTH_MASK 0x03ff000000000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_LENGTH_SHFT 48 +#define FO_PCI_IMU_RDS_ERR_LOG_REQ_ID_MASK 0x0000ffff00000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_REQ_ID_SHFT 32 +#define FO_PCI_IMU_RDS_ERR_LOG_TLP_TAG_MASK 0x00000000ff000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_TLP_TAG_SHFT 24 +#define FO_PCI_IMU_RDS_ERR_LOG_BE_MCODE_MASK 0x0000000000ff0000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_BE_MCODE_SHFT 16 +#define FO_PCI_IMU_RDS_ERR_LOG_MSI_DATA_MASK 0x000000000000ffffULL +#define FO_PCI_IMU_RDS_ERR_LOG_MSI_DATA_SHFT 0 + +/* PCI IMU SCS error log register */ +#define FO_PCI_IMU_SCS_ERR_LOG_TYPE_MASK 0xfc00000000000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_TYPE_SHFT 58 +#define FO_PCI_IMU_SCS_ERR_LOG_LENGTH_MASK 0x03ff000000000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_LENGTH_SHFT 48 +#define FO_PCI_IMU_SCS_ERR_LOG_REQ_ID_MASK 0x0000ffff00000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_REQ_ID_SHFT 32 +#define FO_PCI_IMU_SCS_ERR_LOG_TLP_TAG_MASK 0x00000000ff000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_TLP_TAG_SHFT 24 +#define FO_PCI_IMU_SCS_ERR_LOG_BE_MODE_MASK 0x0000000000ff0000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_BE_MCODE_SHFT 16 +#define FO_PCI_IMU_SCS_ERR_LOG_EQ_NUM_MASK 0x000000000000003fULL +#define FO_PCI_IMU_SCS_ERR_LOG_EQ_NUM_SHFT 0 + +/* PCI IMU EQS error log register */ +#define FO_PCI_IMU_EQS_ERR_LOG_EQ_NUM_MASK 0x000000000000003fULL +#define FO_PCI_IMU_EQS_ERROR_LOG_EQ_NUM_SHFT 0 + +/* + * PCI ERR COR, ERR NONFATAL, ERR FATAL, PM PME and PME To ACK mapping + * registers + */ +#define FO_PCI_ERR_PME_V 0x8000000000000000ULL +#define FO_PCI_ERR_PME_EQNUM_MASK 0x000000000000003fULL +#define FO_PCI_ERR_PME_EQNUM_SHFT 0 + +/* PCI DMC core and block interrupt enable register */ +#define FO_PCI_DMC_CORE_BLOCK_INT_EN_DMC 0x8000000000000000ULL +#define FO_PCI_DMC_CORE_BLOCK_INT_EN_MMU 0x0000000000000002ULL +#define FO_PCI_DMC_CORE_BLOCK_INT_EN_IMU 0x0000000000000001ULL + +/* PCI DMC core and block error status register */ +#define FO_PCI_DMC_CORE_BLOCK_ERR_STAT_MMU 0x0000000000000002ULL +#define FO_PCI_DMC_CORE_BLOCK_ERR_STAT_IMU 0x0000000000000001ULL + +/* PCI multi core error status register */ +#define FO_PCI_MULTI_CORE_ERR_STAT_PEC 0x0000000000000002ULL +#define FO_PCI_MULTI_CORE_ERR_STAT_DMC 0x0000000000000001ULL + +/* PCI MSI 32-bit address register */ +#define FO_PCI_MSI_32_BIT_ADDR_MASK 0x00000000ffff0000ULL +#define FO_PCI_MSI_32_BIT_ADDR_SHFT 16 + +/* PCI MSI 64-bit address register */ +#define FO_PCI_MSI_64_BIT_ADDR_MASK 0x0000ffffffff0000ULL +#define FO_PCI_MSI_64_BIT_ADDR_SHFT 16 + +/* + * PCI MMU interrupt enable, interrupt status and error status clear + * registers + */ +#define FO_PCI_MMU_ERR_INT_S_MASK 0x0000ffff00000000ULL +#define FO_PCI_MMU_ERR_INT_S_SHFT 32 +#define FO_PCI_MMU_ERR_INT_TBW_DPE_S 0x0000800000000000ULL +#define FO_PCI_MMU_ERR_INT_TBW_ERR_S 0x0000400000000000ULL +#define FO_PCI_MMU_ERR_INT_TBW_UDE_S 0x0000200000000000ULL +#define FO_PCI_MMU_ERR_INT_TBW_DME_S 0x0000100000000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE3_S 0x0000080000000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE2_S 0x0000040000000000ULL +#define FO_PCI_MMU_ERR_INT_TTC_CAE_S 0x0000020000000000ULL +#define FIRE_PCI_MMU_ERR_INT_TTC_DPE_S 0x0000010000000000ULL +#define OBERON_PCI_MMU_ERR_INT_TTC_DUE_S 0x0000010000000000ULL +#define FO_PCI_MMU_ERR_INT_TTE_PRT_S 0x0000008000000000ULL +#define FO_PCI_MMU_ERR_INT_TTE_INV_S 0x0000004000000000ULL +#define FO_PCI_MMU_ERR_INT_TRN_OOR_S 0x0000002000000000ULL +#define FO_PCI_MMU_ERR_INT_TRN_ERR_S 0x0000001000000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE1_S 0x0000000800000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE0_S 0x0000000400000000ULL +#define FO_PCI_MMU_ERR_INT_BYP_OOR_S 0x0000000200000000ULL +#define FO_PCI_MMU_ERR_INT_BYP_ERR_S 0x0000000100000000ULL +#define FO_PCI_MMU_ERR_INT_P_MASK 0x000000000000ffffULL +#define FO_PCI_MMU_ERR_INT_P_SHFT 0 +#define FO_PCI_MMU_ERR_INT_TBW_DPE_P 0x0000000000008000ULL +#define FO_PCI_MMU_ERR_INT_TBW_ERR_P 0x0000000000004000ULL +#define FO_PCI_MMU_ERR_INT_TBW_UDE_P 0x0000000000002000ULL +#define FO_PCI_MMU_ERR_INT_TBW_DME_P 0x0000000000001000ULL +#define FO_PCI_MMU_ERR_INT_SPARE3_P 0x0000000000000800ULL +#define FO_PCI_MMU_ERR_INT_SPARE2_P 0x0000000000000400ULL +#define FO_PCI_MMU_ERR_INT_TTC_CAE_P 0x0000000000000200ULL +#define FIRE_PCI_MMU_ERR_INT_TTC_DPE_P 0x0000000000000100ULL +#define OBERON_PCI_MMU_ERR_INT_TTC_DUE_P 0x0000000000000100ULL +#define FO_PCI_MMU_ERR_INT_TTE_PRT_P 0x0000000000000080ULL +#define FO_PCI_MMU_ERR_INT_TTE_INV_P 0x0000000000000040ULL +#define FO_PCI_MMU_ERR_INT_TRN_OOR_P 0x0000000000000020ULL +#define FO_PCI_MMU_ERR_INT_TRN_ERR_P 0x0000000000000010ULL +#define FO_PCI_MMU_ERR_INT_SPARE1_P 0x0000000000000008ULL +#define FO_PCI_MMU_ERR_INT_SPARE0_P 0x0000000000000004ULL +#define FO_PCI_MMU_ERR_INT_BYP_OOR_P 0x0000000000000002ULL +#define FO_PCI_MMU_ERR_INT_BYP_ERR_P 0x0000000000000001ULL + +/* PCI MMU translation fault address register */ +#define FO_PCI_MMU_TRANS_FAULT_ADDR_VA_MASK 0xfffffffffffffffcULL +#define FO_PCI_MMU_TRANS_FAULT_ADDR_VA_SHFT 2 + +/* PCI MMU translation fault status register */ +#define FO_PCI_MMU_TRANS_FAULT_STAT_ENTRY_MASK 0x000001ff00000000ULL +#define FO_PCI_MMU_TRANS_FAULT_STAT_ENTRY_SHFT 32 +#define FO_PCI_MMU_TRANS_FAULT_STAT_TYPE_MASK 0x00000000007f0000ULL +#define FO_PCI_MMU_TRANS_FAULT_STAT_TYPE_SHFT 16 +#define FO_PCI_MMU_TRANS_FAULT_STAT_ID_MASK 0x000000000000ffffULL +#define FO_PCI_MMU_TRANS_FAULT_STAT_ID_SHFT 0 + +/* + * PCI ILU interrupt enable, interrupt status and error status clear + * registers + */ +#define FO_PCI_ILU_ERR_INT_SPARE3_S 0x0000008000000000ULL +#define FO_PCI_ILU_ERR_INT_SPARE2_S 0x0000004000000000ULL +#define FO_PCI_ILU_ERR_INT_SPARE1_S 0x0000002000000000ULL +#define FIRE_PCI_ILU_ERR_INT_IHB_PE_S 0x0000001000000000ULL +#define OBERON_PCI_ILU_ERR_INT_IHB_UE_S 0x0000001000000000ULL +#define FO_PCI_ILU_ERR_INT_SPARE3_P 0x0000000000000080ULL +#define FO_PCI_ILU_ERR_INT_SPARE2_P 0x0000000000000040ULL +#define FO_PCI_ILU_ERR_INT_SPARE1_P 0x0000000000000020ULL +#define FIRE_PCI_ILU_ERR_INT_IHB_PE_P 0x0000000000000010ULL +#define OBERON_PCI_ILU_ERR_INT_IHB_UE_P 0x0000000000000010ULL + +/* PCI DMC debug select registers for port a/b */ +#define FO_PCI_DMC_DBG_SEL_PORT_BLCK_MASK 0x00000000000003c0ULL +#define FO_PCI_DMC_DBG_SEL_PORT_BLCK_SHFT 6 +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_MASK 0x0000000000000038ULL +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_SHFT 3 +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_SGNL_MASK 0x0000000000000007ULL +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_SGNL_SHFT 0 + +/* PCI PEC core and block interrupt enable register */ +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_PEC 0x8000000000000000ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_ILU 0x0000000000000008ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_UERR 0x0000000000000004ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_CERR 0x0000000000000002ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_OEVENT 0x0000000000000001ULL + +/* PCI PEC core and block interrupt status register */ +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_ILU 0x0000000000000008ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_UERR 0x0000000000000004ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_CERR 0x0000000000000002ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_OEVENT 0x0000000000000001ULL + +/* PCI TLU control register */ +#define FO_PCI_TLU_CTRL_L0S_TIM_MASK 0x00000000ff000000ULL +#define FO_PCI_TLU_CTRL_L0S_TIM_SHFT 24 +#define FO_PCI_TLU_CTRL_NWPR_EN 0x0000000000100000ULL +#define FO_PCI_TLU_CTRL_CTO_SEL_MASK 0x0000000000070000ULL +#define FO_PCI_TLU_CTRL_CTO_SEL_SHFT 16 +#define FO_PCI_TLU_CTRL_CFG_MASK 0x000000000000ffffULL +#define FO_PCI_TLU_CTRL_CFG_SHFT 0 +#define FO_PCI_TLU_CTRL_CFG_REMAIN_DETECT_QUIET 0x0000000000000100ULL + +/* + * PCI TLU other event interrupt enable, interrupt status and status clear + * registers + */ +#define FO_PCI_TLU_OEVENT_S_MASK 0x00ffffff00000000ULL +#define FO_PCI_TLU_OEVENT_S_SHFT 32 +#define FO_PCI_TLU_OEVENT_SPARE_S 0x0080000000000000ULL +#define FO_PCI_TLU_OEVENT_MFC_S 0x0040000000000000ULL +#define FO_PCI_TLU_OEVENT_CTO_S 0x0020000000000000ULL +#define FO_PCI_TLU_OEVENT_NFP_S 0x0010000000000000ULL +#define FO_PCI_TLU_OEVENT_LWC_S 0x0008000000000000ULL +#define FO_PCI_TLU_OEVENT_MRC_S 0x0004000000000000ULL +#define FO_PCI_TLU_OEVENT_WUC_S 0x0002000000000000ULL +#define FO_PCI_TLU_OEVENT_RUC_S 0x0001000000000000ULL +#define FO_PCI_TLU_OEVENT_CRS_S 0x0000800000000000ULL +#define FO_PCI_TLU_OEVENT_IIP_S 0x0000400000000000ULL +#define FO_PCI_TLU_OEVENT_EDP_S 0x0000200000000000ULL +#define FIRE_PCI_TLU_OEVENT_EHP_S 0x0000100000000000ULL +#define OBERON_PCI_TLU_OEVENT_EHBUE_S 0x0000100000000000ULL +#define OBERON_PCI_TLU_OEVENT_EDBUE_S 0x0000100000000000ULL +#define FO_PCI_TLU_OEVENT_LIN_S 0x0000080000000000ULL +#define FO_PCI_TLU_OEVENT_LRS_S 0x0000040000000000ULL +#define FO_PCI_TLU_OEVENT_LDN_S 0x0000020000000000ULL +#define FO_PCI_TLU_OEVENT_LUP_S 0x0000010000000000ULL +#define FO_PCI_TLU_OEVENT_LPU_S_MASK 0x000000c000000000ULL +#define FO_PCI_TLU_OEVENT_LPU_S_SHFT 38 +#define OBERON_PCI_TLU_OEVENT_TLUEITMO_S 0x0000008000000000ULL +#define FO_PCI_TLU_OEVENT_ERU_S 0x0000002000000000ULL +#define FO_PCI_TLU_OEVENT_ERO_S 0x0000001000000000ULL +#define FO_PCI_TLU_OEVENT_EMP_S 0x0000000800000000ULL +#define FO_PCI_TLU_OEVENT_EPE_S 0x0000000400000000ULL +#define FIRE_PCI_TLU_OEVENT_ERP_S 0x0000000200000000ULL +#define OBERON_PCI_TLU_OEVENT_ERBU_S 0x0000000200000000ULL +#define FIRE_PCI_TLU_OEVENT_EIP_S 0x0000000100000000ULL +#define OBERON_PCI_TLU_OEVENT_EIUE_S 0x0000000100000000ULL +#define FO_PCI_TLU_OEVENT_P_MASK 0x0000000000ffffffULL +#define FO_PCI_TLU_OEVENT_P_SHFT 0 +#define FO_PCI_TLU_OEVENT_SPARE_P 0x0000000000800000ULL +#define FO_PCI_TLU_OEVENT_MFC_P 0x0000000000400000ULL +#define FO_PCI_TLU_OEVENT_CTO_P 0x0000000000200000ULL +#define FO_PCI_TLU_OEVENT_NFP_P 0x0000000000100000ULL +#define FO_PCI_TLU_OEVENT_LWC_P 0x0000000000080000ULL +#define FO_PCI_TLU_OEVENT_MRC_P 0x0000000000040000ULL +#define FO_PCI_TLU_OEVENT_WUC_P 0x0000000000020000ULL +#define FO_PCI_TLU_OEVENT_RUC_P 0x0000000000010000ULL +#define FO_PCI_TLU_OEVENT_CRS_P 0x0000000000008000ULL +#define FO_PCI_TLU_OEVENT_IIP_P 0x0000000000004000ULL +#define FO_PCI_TLU_OEVENT_EDP_P 0x0000000000002000ULL +#define FIRE_PCI_TLU_OEVENT_EHP_P 0x0000000000001000ULL +#define OBERON_PCI_TLU_OEVENT_EHBUE_P 0x0000000000001000ULL +#define OBERON_PCI_TLU_OEVENT_EDBUE_P 0x0000000000001000ULL +#define FO_PCI_TLU_OEVENT_LIN_P 0x0000000000000800ULL +#define FO_PCI_TLU_OEVENT_LRS_P 0x0000000000000400ULL +#define FO_PCI_TLU_OEVENT_LDN_P 0x0000000000000200ULL +#define FO_PCI_TLU_OEVENT_LUP_P 0x0000000000000100ULL +#define FO_PCI_TLU_OEVENT_LPU_P_MASK 0x00000000000000c0ULL +#define FO_PCI_TLU_OEVENT_LPU_P_SHFT 6 +#define OBERON_PCI_TLU_OEVENT_TLUEITMO_P 0x0000000000000080ULL +#define FO_PCI_TLU_OEVENT_ERU_P 0x0000000000000020ULL +#define FO_PCI_TLU_OEVENT_ERO_P 0x0000000000000010ULL +#define FO_PCI_TLU_OEVENT_EMP_P 0x0000000000000008ULL +#define FO_PCI_TLU_OEVENT_EPE_P 0x0000000000000004ULL +#define FIRE_PCI_TLU_OEVENT_ERP_P 0x0000000000000002ULL +#define OBERON_PCI_TLU_OEVENT_ERBU_P 0x0000000000000002ULL +#define FIRE_PCI_TLU_OEVENT_EIP_P 0x0000000000000001ULL +#define OBERON_PCI_TLU_OEVENT_EIUE_P 0x0000000000000001ULL + +/* PCI receive/transmit DLU/TLU other event header 1/2 log registers */ +#define FO_PCI_TLU_OEVENT_HDR_LOG_MASK 0xffffffffffffffffULL +#define FO_PCI_TLU_OEVENT_HDR_LOG_SHFT 0 + +/* PCI TLU device control register */ +#define FO_PCI_TLU_DEV_CTRL_MRRS_MASK 0x0000000000007000ULL +#define FO_PCI_TLU_DEV_CTRL_MRRS_SHFT 12 +#define FO_PCI_TLU_DEV_CTRL_MPS_MASK 0x00000000000000e0ULL +#define FO_PCI_TLU_DEV_CTRL_MPS_SHFT 5 + +/* + * PCI TLU uncorrectable error interrupt enable, interrupt status and + * status clear registers + */ +#define FO_PCI_TLU_UERR_INT_S_MASK 0x001fffff00000000ULL +#define FO_PCI_TLU_UERR_INT_S_SHFT 32 +#define FO_PCI_TLU_UERR_INT_UR_S 0x0010000000000000ULL +#define OBERON_PCI_TLU_UERR_INT_ECRC_S 0x0008000000000000ULL +#define FO_PCI_TLU_UERR_INT_MFP_S 0x0004000000000000ULL +#define FO_PCI_TLU_UERR_INT_ROF_S 0x0002000000000000ULL +#define FO_PCI_TLU_UERR_INT_UC_S 0x0001000000000000ULL +#define FO_PCI_TLU_UERR_INT_CA_S 0x0000800000000000ULL +#define FO_PCI_TLU_UERR_INT_CTO_S 0x0000400000000000ULL +#define FO_PCI_TLU_UERR_INT_FCP_S 0x0000200000000000ULL +#define FIRE_PCI_TLU_UERR_INT_PP_S 0x0000100000000000ULL +#define OBERON_PCI_TLU_UERR_INT_POIS_S 0x0000100000000000ULL +#define FO_PCI_TLU_UERR_INT_DLP_S 0x0000001000000000ULL +#define FO_PCI_TLU_UERR_INT_TE_S 0x0000000100000000ULL +#define FO_PCI_TLU_UERR_INT_P_MASK 0x00000000001fffffULL +#define FO_PCI_TLU_UERR_INT_P_SHFT 0 +#define FO_PCI_TLU_UERR_INT_UR_P 0x0000000000100000ULL +#define OBERON_PCI_TLU_UERR_INT_ECRC_P 0x0000000000080000ULL +#define FO_PCI_TLU_UERR_INT_MFP_P 0x0000000000040000ULL +#define FO_PCI_TLU_UERR_INT_ROF_P 0x0000000000020000ULL +#define FO_PCI_TLU_UERR_INT_UC_P 0x0000000000010000ULL +#define FO_PCI_TLU_UERR_INT_CA_P 0x0000000000008000ULL +#define FO_PCI_TLU_UERR_INT_CTO_P 0x0000000000004000ULL +#define FO_PCI_TLU_UERR_INT_FCP_P 0x0000000000002000ULL +#define FIRE_PCI_TLU_UERR_INT_PP_P 0x0000000000001000ULL +#define OBERON_PCI_TLU_UERR_INT_POIS_P 0x0000000000001000ULL +#define FO_PCI_TLU_UERR_INT_DLP_P 0x0000000000000010ULL +#define FO_PCI_TLU_UERR_INT_TE_P 0x0000000000000001ULL + +/* + * PCI TLU correctable error interrupt enable, interrupt status and + * status clear registers + */ +#define FO_PCI_TLU_CERR_INT_S_MASK 0x001fffff00000000ULL +#define FO_PCI_TLU_CERR_INT_S_SHFT 32 +#define FO_PCI_TLU_CERR_INT_RTO_S 0x0000100000000000ULL +#define FO_PCI_TLU_CERR_INT_RNR_S 0x0000010000000000ULL +#define FO_PCI_TLU_CERR_INT_BDP_S 0x0000008000000000ULL +#define FO_PCI_TLU_CERR_INT_BTP_S 0x0000004000000000ULL +#define FO_PCI_TLU_CERR_INT_RE_S 0x0000000100000000ULL +#define FO_PCI_TLU_CERR_INT_P_MASK 0x00000000001fffffULL +#define FO_PCI_TLU_CERR_INT_P_SHFT 0 +#define FO_PCI_TLU_CERR_INT_RTO_P 0x0000000000001000ULL +#define FO_PCI_TLU_CERR_INT_RNR_P 0x0000000000000100ULL +#define FO_PCI_TLU_CERR_INT_BDP_P 0x0000000000000080ULL +#define FO_PCI_TLU_CERR_INT_BTP_P 0x0000000000000040ULL +#define FO_PCI_TLU_CERR_INT_RE_P 0x0000000000000001ULL + +/* PCI TLU reset register */ +#define FO_PCI_LPU_RST_WE 0x0000000080000000ULL +#define FO_PCI_LPU_RST_UNUSED_MASK 0x0000000000000e00ULL +#define FO_PCI_LPU_RST_UNUSED_SHFT 9 +#define FO_PCI_LPU_RST_ERR 0x0000000000000100ULL +#define FO_PCI_LPU_RST_TXLINK 0x0000000000000080ULL +#define FO_PCI_LPU_RST_RXLINK 0x0000000000000040ULL +#define FO_PCI_LPU_RST_SMLINK 0x0000000000000020ULL +#define FO_PCI_LPU_RST_LTSSM 0x0000000000000010ULL +#define FO_PCI_LPU_RST_TXPHY 0x0000000000000008ULL +#define FO_PCI_LPU_RST_RXPHY 0x0000000000000004ULL +#define FO_PCI_LPU_RST_TXPCS 0x0000000000000002ULL +#define FO_PCI_LPU_RST_RXPCS 0x0000000000000001ULL + +/* PCI TLU link control register */ +#define FO_PCI_TLU_LNK_CTRL_EXTSYNC 0x0000000000000080ULL +#define FO_PCI_TLU_LNK_CTRL_CLK 0x0000000000000040ULL +#define FO_PCI_TLU_LNK_CTRL_RETRAIN 0x0000000000000020ULL +#define FO_PCI_TLU_LNK_CTRL_DIS 0x0000000000000010ULL +#define FO_PCI_TLU_LNK_CTRL_RCB 0x0000000000000008ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_L0S_L1S 0x0000000000000003ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_L1S 0x0000000000000002ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_L0S 0x0000000000000001ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_DIS 0x0000000000000000ULL + +/* PCI TLU link status register */ +#define FO_PCI_TLU_LNK_STAT_CLK 0x0000000000001000ULL +#define FO_PCI_TLU_LNK_STAT_TRAIN 0x0000000000000800ULL +#define FO_PCI_TLU_LNK_STAT_ERR 0x0000000000000400ULL +#define FO_PCI_TLU_LNK_STAT_WDTH_MASK 0x00000000000003f0ULL +#define FO_PCI_TLU_LNK_STAT_WDTH_SHFT 4 +#define FO_PCI_TLU_LNK_STAT_SPEED_MASK 0x000000000000000fULL +#define FO_PCI_TLU_LNK_STAT_SPEED_SHFT 0 + +/* + * PCI receive/transmit DLU/TLU uncorrectable error header 1/2 log + * registers + */ +#define FO_PCI_TLU_UERR_HDR_LOG_MASK 0xffffffffffffffffULL +#define FO_PCI_TLU_UERR_HDR_LOG_SHFT 0 + +/* PCI DLU/LPU interrupt status and mask registers */ +#define FO_PCI_LPU_INT_INT 0x0000000080000000ULL +#define FIRE_PCI_LPU_INT_PRF_CNT2_OFLW 0x0000000000000080ULL +#define FIRE_PCI_LPU_INT_PRF_CNT1_OFLW 0x0000000000000040ULL +#define FO_PCI_LPU_INT_LNK_LYR 0x0000000000000020ULL +#define FO_PCI_LPU_INT_PHY_ERR 0x0000000000000010ULL +#define FIRE_PCI_LPU_INT_LTSSM 0x0000000000000008ULL +#define FIRE_PCI_LPU_INT_PHY_TX 0x0000000000000004ULL +#define FIRE_PCI_LPU_INT_PHY_RX 0x0000000000000002ULL +#define FIRE_PCI_LPU_INT_PHY_GB 0x0000000000000001ULL + +/* PCI DLU/LPU link layer config register */ +#define FIRE_PCI_LPU_LNK_LYR_CFG_AUTO_UPDT_DIS 0x0000000000080000ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_FREQ_NAK_EN 0x0000000000040000ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_RPLY_AFTER_REQ 0x0000000000020000ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_LAT_THRS_WR_EN 0x0000000000010000ULL +#define FO_PCI_LPU_LNK_LYR_CFG_VC0_EN 0x0000000000000100ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_L0S_ADJ_FAC_EN 0x0000000000000010ULL +#define FIER_PCI_LPU_LNK_LYR_CFG_TLP_XMIT_FC_EN 0x0000000000000008ULL +#define FO_PCI_LPU_LNK_LYR_CFG_FREQ_ACK_EN 0x0000000000000004ULL +#define FO_PCI_LPU_LNK_LYR_CFG_RETRY_DIS 0x0000000000000002ULL + +/* PCI DLU/LPU link layer interrupt and status register */ +#define FO_PCI_LPU_LNK_LYR_INT_STAT_LNK_ERR_ACT 0x0000000080000000ULL +#define OBERON_PCI_LPU_LNK_LYR_INT_STAT_PBUS_PE 0x0000000000800000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_USPRTD_DLLP 0x0000000000400000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_DLLP_RX_ERR 0x0000000000200000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_BAD_DLLP 0x0000000000100000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_TLP_RX_ERR 0x0000000000040000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_SRC_ERR_TLP 0x0000000000020000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_BAD_TLP 0x0000000000010000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RBF_UDF_ERR 0x0000000000000200ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RBF_OVF_ERR 0x0000000000000100ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_EG_TLPM_ERR 0x0000000000000080ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_EG_TFRM_ERR 0x0000000000000040ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RBF_PE 0x0000000000000020ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_EGRESS_PE 0x0000000000000010ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RPLY_TMR_TO 0x0000000000000004ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RPLY_NUM_RO 0x0000000000000002ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_DLNK_PES 0x0000000000000001ULL + +/* PCI DLU/LPU flow control update control register */ +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_C_EN 0x0000000000000004ULL +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_NP_EN 0x0000000000000002ULL +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_P_EN 0x0000000000000001ULL + +/* PCI DLU/LPU txlink ACKNAK latency timer threshold register */ +#define FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS_MASK 0x000000000000ffffULL +#define FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS_SHFT 0 + +/* PCI DLU/LPU txlink replay timer threshold register */ +#define FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_MASK 0x00000000000fffffULL +#define FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_SHFT 0 + +/* PCI DLU/LPU txlink FIFO pointer register */ +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_TL_MASK 0x00000000ffff0000ULL +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_TL_SHFT 16 +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_HD_MASK 0x000000000000ffffULL +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_HD_SHFT 0 + +/* PCI DLU/LPU phy layer interrupt and status register */ +#define FO_PCI_LPU_PHY_LYR_INT_STAT_PHY_LYR_ERR 0x0000000080000000ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_KC_DLLP_ERR 0x0000000000000800ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_END_POS_ERR 0x0000000000000400ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_LNK_ERR 0x0000000000000200ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_TRN_ERR 0x0000000000000100ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_EDB_DET 0x0000000000000080ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_SDP_END 0x0000000000000040ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_STP_END_EDB 0x0000000000000020ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_INVC_ERR 0x0000000000000010ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_MULTI_SDP 0x0000000000000008ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_MULTI_STP 0x0000000000000004ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_ILL_SDP_POS 0x0000000000000002ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_ILL_STP_POS 0x0000000000000001ULL + +/* PCI DLU/LPU LTSSM config2 register */ +#define FO_PCI_LPU_LTSSM_CFG2_12_TO_MASK 0x00000000ffffffffULL +#define FO_PCI_LPU_LTSSM_CFG2_12_TO_SHFT 0 + +/* PCI DLU/LPU LTSSM config3 register */ +#define FO_PCI_LPU_LTSSM_CFG3_2_TO_MASK 0x00000000ffffffffULL +#define FO_PCI_LPU_LTSSM_CFG3_2_TO_SHFT 0 + +/* PCI DLU/LPU LTSSM config4 register */ +#define FO_PCI_LPU_LTSSM_CFG4_TRN_CTRL_MASK 0x00000000ff000000ULL +#define FO_PCI_LPU_LTSSM_CFG4_TRN_CTRL_SHFT 24 +#define FO_PCI_LPU_LTSSM_CFG4_DATA_RATE_MASK 0x0000000000ff0000ULL +#define FO_PCI_LPU_LTSSM_CFG4_DATA_RATE_SHFT 16 +#define FO_PCI_LPU_LTSSM_CFG4_N_FTS_MASK 0x000000000000ff00ULL +#define FO_PCI_LPU_LTSSM_CFG4_N_FTS_SHFT 8 +#define FO_PCI_LPU_LTSSM_CFG4_LNK_NUM_MASK 0x00000000000000ffULL +#define FO_PCI_LPU_LTSSM_CFG4_LNK_NUM_SHFT 0 + +/* PCI DLU/LPU LTSSM config5 register */ +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED0_MASK 0x00000000ffffe000ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED0_SHFT 13 +#define FO_PCI_LPU_LTSSM_CFG5_RCV_DET_TST_MODE 0x0000000000001000ULL +#define FO_PCI_LPU_LTSSM_CFG5_POLL_CMPLNC_DIS 0x0000000000000800ULL +#define FO_PCI_LPU_LTSSM_CFG5_TX_IDLE_TX_FTS 0x0000000000000400ULL +#define FO_PCI_LPU_LTSSM_CFG5_RX_FTS_RVR_LK 0x0000000000000200ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED1_MASK 0x0000000000000180ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED1_SHFT 7 +#define FO_PCI_LPU_LTSSM_CFG5_LPBK_NTRY_ACTIVE 0x0000000000000040ULL +#define FO_PCI_LPU_LTSSM_CFG5_LPBK_NTRY_EXIT 0x0000000000000020ULL +#define FO_PCI_LPU_LTSSM_CFG5_LPBK_ACTIVE_EXIT 0x0000000000000010ULL +#define FO_PCI_LPU_LTSSM_CFG5_L1_IDLE_RCVRY_LK 0x0000000000000008ULL +#define FO_PCI_LPU_LTSSM_CFG5_L0_TRN_CNTRL_RST 0x0000000000000004ULL +#define FO_PCI_LPU_LTSSM_CFG5_L0_LPBK 0x0000000000000002ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED2 0x0000000000000001ULL + +/* Controller configuration and status registers */ +#define FIRE_JBUS_PAR_CTRL 0x60010 +#define FO_XBC_ERR_LOG_EN 0x61000 +#define FO_XBC_INT_EN 0x61008 +#define FO_XBC_INT_STAT 0x61010 +#define FO_XBC_ERR_STAT_CLR 0x61018 +#define FIRE_JBC_FATAL_RST_EN 0x61028 +#define FIRE_JBCINT_ITRANS_ERR_LOG 0x61040 +#define FIRE_JBCINT_ITRANS_ERR_LOG2 0x61048 +#define FIRE_JBCINT_OTRANS_ERR_LOG 0x61040 +#define FIRE_JBCINT_OTRANS_ERR_LOG2 0x61048 +#define FIRE_FATAL_ERR_LOG 0x61050 +#define FIRE_FATAL_ERR_LOG2 0x61058 +#define FIRE_MERGE_TRANS_ERR_LOG 0x61060 +#define FIRE_DMCINT_ODCD_ERR_LOG 0x61068 +#define FIRE_DMCINT_IDC_ERR_LOG 0x61070 +#define FIRE_JBC_CSR_ERR_LOG 0x61078 +#define FIRE_JBC_CORE_BLOCK_INT_EN 0x61800 +#define FIRE_JBC_CORE_BLOCK_ERR_STAT 0x61808 +#define FO_XBC_PRF_CNT_SEL 0x62000 +#define FO_XBC_PRF_CNT0 0x62008 +#define FO_XBC_PRF_CNT1 0x62010 + +/* JBus parity control register */ +#define FIRE_JBUS_PAR_CTRL_P_EN 0x8000000000000000ULL +#define FIRE_JBUS_PAR_CTRL_INVRTD_PAR_MASK 0x000000000000003cULL +#define FIRE_JBUS_PAR_CTRL_INVRTD_PAR_SHFT 2 +#define FIRE_JBUS_PAR_CTRL_NEXT_DATA 0x0000000000000002ULL +#define FIRE_JBUS_PAR_CTRL_NEXT_ADDR 0x0000000000000001ULL + +/* JBC error log enable register - may also apply to UBC */ +#define FIRE_JBC_ERR_LOG_EN_SPARE_MASK 0x00000000e0000000ULL +#define FIRE_JBC_ERR_LOG_EN_SPARE_SHFT 29 +#define FIRE_JBC_ERR_LOG_EN_PIO_UNMAP_RD 0x0000000010000000ULL +#define FIRE_JBC_ERR_LOG_EN_ILL_ACC_RD 0x0000000008000000ULL +#define FIRE_JBC_ERR_LOG_EN_EBUS_TO 0x0000000004000000ULL +#define FIRE_JBC_ERR_LOG_EN_MB_PEA 0x0000000002000000ULL +#define FIRE_JBC_ERR_LOG_EN_MB_PER 0x0000000001000000ULL +#define FIRE_JBC_ERR_LOG_EN_MB_PEW 0x0000000000800000ULL +#define FIRE_JBC_ERR_LOG_EN_UE_ASYN 0x0000000000400000ULL +#define FIRE_JBC_ERR_LOG_EN_CE_ASYN 0x0000000000200000ULL +#define FIRE_JBC_ERR_LOG_EN_JTE 0x0000000000100000ULL +#define FIRE_JBC_ERR_LOG_EN_JBE 0x0000000000080000ULL +#define FIRE_JBC_ERR_LOG_EN_JUE 0x0000000000040000ULL +#define FIRE_JBC_ERR_LOG_EN_IJP 0x0000000000020000ULL +#define FIRE_JBC_ERR_LOG_EN_ICISE 0x0000000000010000ULL +#define FIRE_JBC_ERR_LOG_EN_CPE 0x0000000000008000ULL +#define FIRE_JBC_ERR_LOG_EN_APE 0x0000000000004000ULL +#define FIRE_JBC_ERR_LOG_EN_WR_DPE 0x0000000000002000ULL +#define FIRE_JBC_ERR_LOG_EN_RD_DPE 0x0000000000001000ULL +#define FIRE_JBC_ERR_LOG_EN_ILL_BMW 0x0000000000000800ULL +#define FIRE_JBC_ERR_LOG_EN_ILL_BMR 0x0000000000000400ULL +#define FIRE_JBC_ERR_LOG_EN_BJC 0x0000000000000200ULL +#define FIRE_JBC_ERR_LOG_EN_PIO_UNMAP 0x0000000000000100ULL +#define FIRE_JBC_ERR_LOG_EN_PIO_DPE 0x0000000000000080ULL +#define FIRE_JBC_ERR_LOG_EN_PIO_CPE 0x0000000000000040ULL +#define FIRE_JBC_ERR_LOG_EN_ILL_ACC 0x0000000000000020ULL +#define FIRE_JBC_ERR_LOG_EN_UNSOL_RD 0x0000000000000010ULL +#define FIRE_JBC_ERR_LOG_EN_UNSOL_INT 0x0000000000000008ULL +#define FIRE_JBC_ERR_LOG_EN_JTCEEW 0x0000000000000004ULL *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 21:45:56 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEE341065766; Fri, 15 Jan 2010 21:45:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2358FC1C; Fri, 15 Jan 2010 21:45:56 +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 o0FLjuBJ098605; Fri, 15 Jan 2010 21:45:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FLjuAc098599; Fri, 15 Jan 2010 21:45:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001152145.o0FLjuAc098599@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 21:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202420 - in stable/7/sys: conf sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 21:45:56 -0000 Author: marius Date: Fri Jan 15 21:45:55 2010 New Revision: 202420 URL: http://svn.freebsd.org/changeset/base/202420 Log: MFC: r201052, r201200, r202003, r202010, r202023 Add a driver for the `Fire' JBus to PCIe bridges found in at least the Sun Fire V215/V245 and Sun Ultra 25/45 machines. This driver also already includes all the code to support the `Oberon' Uranus to PCIe bridges found in the Fujitsu-Siemens based Mx000 machines but due to lack of access to such a system for testing, probing of these bridges is currently disabled. Unfortunately, the event queue mechanism of these bridges for MSIs/ MSI-Xs matches our current MD and MI interrupt frameworks like square pegs fit into round holes so for now we are generous and use one event queue per MSI, which limits us to 35 MSIs/MSI-Xs per Host-PCIe-bridge (we use one event queue for the PCIe error messages). This seems tolerable as long as most devices just use one MSI/MSI-X anyway. Adding knowledge about MSIs/MSI-Xs to the MD interrupt code should allow us to decouple the 1:1 mapping at the cost of no longer being able to bind MSIs/MSI-Xs to specific CPUs as we currently have no reliable way to quiesce a device during the transition of its MSIs/ MSI-Xs to another event queue. This would still require the problem of interrupt storms generated by devices which have no one-shot behavior or can't/don't mask interrupts while the filter/handler is executed (like the older PCIe NICs supported by bge(4)) to be solved though. Added: stable/7/sys/sparc64/pci/fire.c - copied, changed from r201052, head/sys/sparc64/pci/fire.c stable/7/sys/sparc64/pci/firereg.h - copied unchanged from r201052, head/sys/sparc64/pci/firereg.h stable/7/sys/sparc64/pci/firevar.h - copied unchanged from r201052, head/sys/sparc64/pci/firevar.h Modified: stable/7/sys/conf/files.sparc64 stable/7/sys/conf/options.sparc64 Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files.sparc64 ============================================================================== --- stable/7/sys/conf/files.sparc64 Fri Jan 15 21:45:46 2010 (r202419) +++ stable/7/sys/conf/files.sparc64 Fri Jan 15 21:45:55 2010 (r202420) @@ -71,6 +71,7 @@ sparc64/isa/isa.c optional isa sparc64/isa/isa_dma.c optional isa sparc64/isa/ofw_isa.c optional ebus | isa sparc64/pci/apb.c optional pci +sparc64/pci/fire.c optional pci sparc64/pci/ofw_pcib.c optional pci sparc64/pci/ofw_pcib_subr.c optional pci sparc64/pci/ofw_pcibus.c optional pci Modified: stable/7/sys/conf/options.sparc64 ============================================================================== --- stable/7/sys/conf/options.sparc64 Fri Jan 15 21:45:46 2010 (r202419) +++ stable/7/sys/conf/options.sparc64 Fri Jan 15 21:45:55 2010 (r202420) @@ -8,6 +8,8 @@ SUN4U opt_global.h ATKBD_DFLT_KEYMAP opt_atkbd.h +FIRE_DEBUG opt_fire.h + # Debug IOMMU inserts/removes using diagnostic accesses. This is very loud. IOMMU_DIAG opt_iommu.h Copied and modified: stable/7/sys/sparc64/pci/fire.c (from r201052, head/sys/sparc64/pci/fire.c) ============================================================================== --- head/sys/sparc64/pci/fire.c Sun Dec 27 16:55:44 2009 (r201052, copy source) +++ stable/7/sys/sparc64/pci/fire.c Fri Jan 15 21:45:55 2010 (r202420) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +struct fire_msiqarg; + static bus_space_tag_t fire_alloc_bus_tag(struct fire_softc *sc, int type); static const struct fire_desc *fire_get_desc(device_t dev); static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, @@ -94,6 +96,9 @@ static void fire_intr_clear(void *arg); static void fire_intr_disable(void *arg); static void fire_intr_enable(void *arg); static int fire_intr_register(struct fire_softc *sc, u_int ino); +static inline void fire_msiq_common(struct intr_vector *iv, + struct fire_msiqarg *fmqa); +static void fire_msiq_filter(void *cookie); static void fire_msiq_handler(void *cookie); static void fire_set_intr(struct fire_softc *sc, u_int index, u_int ino, driver_filter_t handler, void *arg); @@ -167,8 +172,7 @@ static device_method_t fire_methods[] = static devclass_t fire_devclass; DEFINE_CLASS_0(pcib, fire_driver, fire_methods, sizeof(struct fire_softc)); -EARLY_DRIVER_MODULE(fire, nexus, fire_driver, fire_devclass, 0, 0, - BUS_PASS_BUS); +DRIVER_MODULE(fire, nexus, fire_driver, fire_devclass, 0, 0); MODULE_DEPEND(fire, nexus, 1, 1, 1); static const struct intr_controller fire_ic = { @@ -184,6 +188,13 @@ struct fire_icarg { bus_addr_t fica_clr; }; +static const struct intr_controller fire_msiqc_filter = { + fire_intr_enable, + fire_intr_disable, + fire_intr_assign, + NULL +}; + struct fire_msiqarg { struct fire_icarg fmqa_fica; struct mtx fmqa_mtx; @@ -290,7 +301,7 @@ fire_attach(device_t dev) uint64_t ino_bitmap, val; phandle_t node; uint32_t prop, prop_array[2]; - int i, j, mode, nrange; + int i, j, mode; u_int lw; uint16_t mps; @@ -725,13 +736,12 @@ fire_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, FO_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), - (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (nrange != FIRE_NRANGE) + if (i != FIRE_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -743,7 +753,7 @@ fire_attach(device_t dev) j = OFW_PCI_RANGE_CS(&range[i]); if (sc->sc_pci_bh[j] != 0) panic("%s: duplicate range for space %d", - __func__, j); + __func__, j); sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -1612,7 +1622,7 @@ fire_intr_clear(void *arg) */ static int -fire_alloc_msi(device_t dev, device_t child, int count, int maxcount, +fire_alloc_msi(device_t dev, device_t child, int count, int maxcount __unused, int *irqs) { struct fire_softc *sc; @@ -1638,16 +1648,11 @@ fire_alloc_msi(device_t dev, device_t ch mtx_unlock(&sc->sc_msi_mtx); return (ENXIO); } - /* - * It's unclear whether we need to actually align the MSIs in the - * mapping table based on the maxcount or just the count. We use - * maxcount to be on the safe side. - */ - for (i = 0; i + maxcount < sc->sc_msi_count; i += maxcount) { - for (j = i; j < i + maxcount; j++) + for (i = 0; i + count < sc->sc_msi_count; i += count) { + for (j = i; j < i + count; j++) if (isclr(sc->sc_msi_bitmap, j) == 0) break; - if (j == i + maxcount) { + if (j == i + count) { for (j = 0; j < count; j++) { setbit(sc->sc_msiq_bitmap, msiqrun + j); setbit(sc->sc_msi_bitmap, i + j); @@ -1766,33 +1771,67 @@ fire_msiq_handler(void *cookie) { struct intr_vector *iv; struct fire_msiqarg *fmqa; - struct fire_softc *sc; - struct fo_msiq_record *qrec; - device_t dev; - uint64_t word0; - u_int head, msi, msiq; iv = cookie; fmqa = iv->iv_icarg; - sc = fmqa->fmqa_fica.fica_sc; - dev = sc->sc_dev; - msiq = fmqa->fmqa_msiq; /* * Note that since fire_intr_clear() will clear the event queue - * interrupt after the filter/handler associated with the MSI [sic] - * has been executed we have to protect the access to the event queue - * as otherwise nested event queue interrupts cause corruption of the + * interrupt after the handler associated with the MSI [sic] has + * been executed we have to protect the access to the event queue as + * otherwise nested event queue interrupts cause corruption of the * event queue on MP machines. Obviously especially when abandoning * the 1:1 mapping it would be better to not clear the event queue - * interrupt after each filter/handler invocation but only once when - * the outstanding MSIs have been processed but unfortunately that + * interrupt after each handler invocation but only once when the + * outstanding MSIs have been processed but unfortunately that * doesn't work well and leads to interrupt storms with controllers/ - * drivers which don't mask interrupts while the filter/handler is - * executed. Maybe delaying clearing the MSI until after the filter/ - * handler has been executed could be used to work around this but - * that's not the intended usage and might in turn cause lost MSIs. + * drivers which don't mask interrupts while the handler is executed. + * Maybe delaying clearing the MSI until after the handler has been + * executed could be used to work around this but that's not the + * intended usage and might in turn cause lost MSIs. */ mtx_lock_spin(&fmqa->fmqa_mtx); + fire_msiq_common(iv, fmqa); + mtx_unlock_spin(&fmqa->fmqa_mtx); +} + +static void +fire_msiq_filter(void *cookie) +{ + struct intr_vector *iv; + struct fire_msiqarg *fmqa; + + iv = cookie; + fmqa = iv->iv_icarg; + /* + * For filters we don't use fire_intr_clear() since it would clear + * the event queue interrupt while we're still processing the event + * queue as filters and associated post-filter handler are executed + * directly, which in turn would lead to lost MSIs. So we clear the + * event queue interrupt only once after processing the event queue. + * Given that this still guarantees the filters to not be executed + * concurrently and no other CPU can clear the event queue interrupt + * while the event queue is still processed, we don't even need to + * interlock the access to the event queue in this case. + */ + critical_enter(); + fire_msiq_common(iv, fmqa); + FIRE_PCI_WRITE_8(fmqa->fmqa_fica.fica_sc, fmqa->fmqa_fica.fica_clr, + INTCLR_IDLE); + critical_exit(); +} + +static inline void +fire_msiq_common(struct intr_vector *iv, struct fire_msiqarg *fmqa) +{ + struct fire_softc *sc; + struct fo_msiq_record *qrec; + device_t dev; + uint64_t word0; + u_int head, msi, msiq; + + sc = fmqa->fmqa_fica.fica_sc; + dev = sc->sc_dev; + msiq = fmqa->fmqa_msiq; head = (FIRE_PCI_READ_8(sc, fmqa->fmqa_head) & FO_PCI_EQ_HD_MASK) >> FO_PCI_EQ_HD_SHFT; qrec = &fmqa->fmqa_base[head]; @@ -1834,7 +1873,6 @@ fire_msiq_handler(void *cookie) FIRE_PCI_READ_8(sc, FO_PCI_EQ_CTRL_CLR_BASE + msiq) | FO_PCI_EQ_CTRL_CLR_COVERR); } - mtx_unlock_spin(&fmqa->fmqa_mtx); } static int @@ -1843,6 +1881,7 @@ fire_setup_intr(device_t dev, device_t c void **cookiep) { struct fire_softc *sc; + struct fire_msiqarg *fmqa; u_long vec; int error; u_int msi, msiq; @@ -1873,31 +1912,39 @@ fire_setup_intr(device_t dev, device_t c intr, arg, cookiep); rman_set_start(ires, msi); rman_set_end(ires, msi); - if (error == 0) { + if (error != 0) + return (error); + fmqa = intr_vectors[vec].iv_icarg; + /* + * XXX inject our event queue handler. + */ + if (filt != NULL) { + intr_vectors[vec].iv_func = fire_msiq_filter; + intr_vectors[vec].iv_ic = &fire_msiqc_filter; /* - * XXX inject our event queue handler. + * Ensure the event queue interrupt is cleared, it + * might have triggered before. Given we supply NULL + * as ic_clear, inthand_add() won't do this for us. */ + FIRE_PCI_WRITE_8(sc, fmqa->fmqa_fica.fica_clr, + INTCLR_IDLE); + } else intr_vectors[vec].iv_func = fire_msiq_handler; - /* - * Record the MSI/MSI-X as long as we we use a 1:1 - * mapping. - */ - ((struct fire_msiqarg *)intr_vectors[vec].iv_icarg)-> - fmqa_msi = msi; - FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + - (msiq << 3), FO_PCI_EQ_CTRL_SET_EN); - msi <<= 3; - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, - (FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) & - ~FO_PCI_MSI_MAP_EQNUM_MASK) | - ((msiq << FO_PCI_MSI_MAP_EQNUM_SHFT) & - FO_PCI_MSI_MAP_EQNUM_MASK)); - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_CLR_BASE + msi, - FO_PCI_MSI_CLR_EQWR_N); - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, - FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) | - FO_PCI_MSI_MAP_V); - } + /* Record the MSI/MSI-X as long as we we use a 1:1 mapping. */ + fmqa->fmqa_msi = msi; + FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + (msiq << 3), + FO_PCI_EQ_CTRL_SET_EN); + msi <<= 3; + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, + (FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) & + ~FO_PCI_MSI_MAP_EQNUM_MASK) | + ((msiq << FO_PCI_MSI_MAP_EQNUM_SHFT) & + FO_PCI_MSI_MAP_EQNUM_MASK)); + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_CLR_BASE + msi, + FO_PCI_MSI_CLR_EQWR_N); + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, + FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) | + FO_PCI_MSI_MAP_V); return (error); } @@ -1946,14 +1993,16 @@ fire_teardown_intr(device_t dev, device_ (0 << FO_PCI_EQ_TL_SHFT) & FO_PCI_EQ_TL_MASK); FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_HD_BASE + msiq, (0 << FO_PCI_EQ_HD_SHFT) & FO_PCI_EQ_HD_MASK); + intr_vectors[vec].iv_ic = &fire_ic; /* * The MD interrupt code needs the vector rather than the MSI. */ rman_set_start(ires, vec); rman_set_end(ires, vec); error = bus_generic_teardown_intr(dev, child, ires, cookie); + msi >>= 3; rman_set_start(ires, msi); - rman_set_end(ires, msi >> 3); + rman_set_end(ires, msi); return (error); } return (bus_generic_teardown_intr(dev, child, ires, cookie)); @@ -2101,7 +2150,7 @@ fire_alloc_bus_tag(struct fire_softc *sc { bus_space_tag_t bt; - bt = (bus_space_tag_t)malloc(sizeof(struct bus_space_tag), M_DEVBUF, + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); Copied: stable/7/sys/sparc64/pci/firereg.h (from r201052, head/sys/sparc64/pci/firereg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/pci/firereg.h Fri Jan 15 21:45:55 2010 (r202420, copy of r201052, head/sys/sparc64/pci/firereg.h) @@ -0,0 +1,1004 @@ +/*- + * Copyright (c) 2009 Marius Strobl + * 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$ + */ + +#ifndef _SPARC64_PCI_FIREREG_H_ +#define _SPARC64_PCI_FIREREG_H_ + +#define FIRE_NINTR 3 /* 2 OFW + 1 MSIq */ +#define FIRE_NRANGE 4 +#define FIRE_NREG 2 + +#define FIRE_PCI 0 +#define FIRE_CTRL 1 + +/* PCI configuration and status registers */ +#define FO_PCI_INT_MAP_BASE 0x01000 +#define FO_PCI_INT_CLR_BASE 0x01400 +#define FO_PCI_EQ_BASE_ADDR 0x10000 +#define FO_PCI_EQ_CTRL_SET_BASE 0x11000 +#define FO_PCI_EQ_CTRL_CLR_BASE 0x11200 +#define FO_PCI_EQ_TL_BASE 0x11600 +#define FO_PCI_EQ_HD_BASE 0x11800 +#define FO_PCI_MSI_MAP_BASE 0x20000 +#define FO_PCI_MSI_CLR_BASE 0x28000 +#define FO_PCI_ERR_COR 0x30000 +#define FO_PCI_ERR_NONFATAL 0x30008 +#define FO_PCI_ERR_FATAL 0x30010 +#define FO_PCI_PM_PME 0x30018 +#define FO_PCI_PME_TO_ACK 0x30020 +#define FO_PCI_IMU_INT_EN 0x31008 +#define FO_PCI_IMU_INT_STAT 0x31010 +#define FO_PCI_IMU_ERR_STAT_CLR 0x31018 +#define FO_PCI_IMU_RDS_ERR_LOG 0x31028 +#define FO_PCI_IMU_SCS_ERR_LOG 0x31030 +#define FO_PCI_IMU_EQS_ERR_LOG 0x31038 +#define FO_PCI_DMC_CORE_BLOCK_INT_EN 0x31800 +#define FO_PCI_DMC_CORE_BLOCK_ERR_STAT 0x31808 +#define FO_PCI_MULTI_CORE_ERR_STAT 0x31810 +#define FO_PCI_MSI_32_BIT_ADDR 0x34000 +#define FO_PCI_MSI_64_BIT_ADDR 0x34008 +#define FO_PCI_MMU 0x40000 +#define FO_PCI_MMU_INT_EN 0x41008 +#define FO_PCI_MMU_INT_STAT 0x41010 +#define FO_PCI_MMU_ERR_STAT_CLR 0x41018 +#define FO_PCI_MMU_TRANS_FAULT_ADDR 0x41028 +#define FO_PCI_MMU_TRANS_FAULT_STAT 0x41030 +#define FO_PCI_ILU_INT_EN 0x51008 +#define FO_PCI_ILU_INT_STAT 0x51010 +#define FO_PCI_ILU_ERR_STAT_CLR 0x51018 +#define FO_PCI_DMC_DBG_SEL_PORTA 0x53000 +#define FO_PCI_DMC_DBG_SEL_PORTB 0x53008 +#define FO_PCI_PEC_CORE_BLOCK_INT_EN 0x51800 +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT 0x51808 +#define FO_PCI_TLU_CTRL 0x80000 +#define FO_PCI_TLU_OEVENT_INT_EN 0x81008 +#define FO_PCI_TLU_OEVENT_INT_STAT 0x81010 +#define FO_PCI_TLU_OEVENT_STAT_CLR 0x81018 +#define FO_PCI_TLU_RX_OEVENT_HDR1_LOG 0x81028 +#define FO_PCI_TLU_RX_OEVENT_HDR2_LOG 0x81030 +#define FO_PCI_TLU_TX_OEVENT_HDR1_LOG 0x81038 +#define FO_PCI_TLU_TX_OEVENT_HDR2_LOG 0x81040 +#define FO_PCI_TLU_DEV_CTRL 0x90008 +#define FO_PCI_TLU_LNK_CTRL 0x90020 +#define FO_PCI_TLU_LNK_STAT 0x90028 +#define FO_PCI_TLU_UERR_INT_EN 0x91008 +#define FO_PCI_TLU_UERR_INT_STAT 0x91010 +#define FO_PCI_TLU_UERR_STAT_CLR 0x91018 +#define FO_PCI_TLU_RX_UERR_HDR1_LOG 0x91028 +#define FO_PCI_TLU_RX_UERR_HDR2_LOG 0x91030 +#define FO_PCI_TLU_TX_UERR_HDR1_LOG 0x91038 +#define FO_PCI_TLU_TX_UERR_HDR2_LOG 0x91040 +#define FO_PCI_TLU_CERR_INT_EN 0xa1008 +#define FO_PCI_TLU_CERR_INT_STAT 0xa1010 +#define FO_PCI_TLU_CERR_STAT_CLR 0xa1018 +#define FO_PCI_LPU_RST 0xe2008 +#define FO_PCI_LPU_INT_STAT 0xe2040 +#define FO_PCI_LPU_INT_MASK 0xe0248 +#define FO_PCI_LPU_LNK_LYR_CFG 0xe2200 +#define FO_PCI_LPU_LNK_LYR_INT_STAT 0xe2210 +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL 0xe2240 +#define FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS 0xe2400 +#define FO_PCI_LPU_TXLNK_RPLY_TMR_THRS 0xe2410 +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR 0xe2430 +#define FO_PCI_LPU_PHY_LYR_INT_STAT 0xe2610 +#define FO_PCI_LPU_LTSSM_CFG2 0xe2788 +#define FO_PCI_LPU_LTSSM_CFG3 0xe2790 +#define FO_PCI_LPU_LTSSM_CFG4 0xe2798 +#define FO_PCI_LPU_LTSSM_CFG5 0xe27a0 + +/* PCI interrupt mapping registers */ +#define FO_PCI_IMAP_MDO_MODE 0x8000000000000000ULL +#define FO_PCI_IMAP_V 0x0000000080000000ULL +#define FIRE_PCI_IMAP_T_JPID_MASK 0x000000007c000000ULL +#define FIRE_PCI_IMAP_T_JPID_SHFT 26 +#define OBERON_PCI_IMAP_T_DESTID_MASK 0x000000007fe00000ULL +#define OBERON_PCI_IMAP_T_DESTID_SHFT 21 +#define FO_PCI_IMAP_INT_CTRL_NUM_MASK 0x00000000000003c0ULL +#define FO_PCI_IMAP_INT_CTRL_NUM_SHFT 6 + +/* PCI interrupt clear registers - use INTCLR_* from */ + +/* PCI event queue base address register */ +#define FO_PCI_EQ_BASE_ADDR_BYPASS 0xfffc000000000000ULL +#define FO_PCI_EQ_BASE_ADDR_MASK 0xfffffffffff80000ULL +#define FO_PCI_EQ_BASE_ADDR_SHFT 19 + +/* PCI event queue control set registers */ +#define FO_PCI_EQ_CTRL_SET_ENOVERR 0x0200000000000000ULL +#define FO_PCI_EQ_CTRL_SET_EN 0x0000100000000000ULL + +/* PCI event queue control clear registers */ +#define FO_PCI_EQ_CTRL_CLR_COVERR 0x0200000000000000ULL +#define FO_PCI_EQ_CTRL_CLR_E2I 0x0000800000000000ULL +#define FO_PCI_EQ_CTRL_CLR_DIS 0x0000100000000000ULL + +/* PCI event queue tail registers */ +#define FO_PCI_EQ_TL_OVERR 0x0200000000000000ULL +#define FO_PCI_EQ_TL_MASK 0x000000000000007fULL +#define FO_PCI_EQ_TL_SHFT 0 + +/* PCI event queue head registers */ +#define FO_PCI_EQ_HD_MASK 0x000000000000007fULL +#define FO_PCI_EQ_HD_SHFT 0 + +/* PCI MSI mapping registers */ +#define FO_PCI_MSI_MAP_V 0x8000000000000000ULL +#define FO_PCI_MSI_MAP_EQWR_N 0x4000000000000000ULL +#define FO_PCI_MSI_MAP_EQNUM_MASK 0x000000000000003fULL +#define FO_PCI_MSI_MAP_EQNUM_SHFT 0 + +/* PCI MSI clear registers */ +#define FO_PCI_MSI_CLR_EQWR_N 0x4000000000000000ULL + +/* + * PCI IMU interrupt enable, interrupt status and error status clear + * registers + */ +#define FO_PCI_IMU_ERR_INT_SPARE_S_MASK 0x00007c0000000000ULL +#define FO_PCI_IMU_ERR_INT_SPARE_S_SHFT 42 +#define FO_PCI_IMU_ERR_INT_EQ_OVER_S 0x0000020000000000ULL +#define FO_PCI_IMU_ERR_INT_EQ_NOT_EN_S 0x0000010000000000ULL +#define FO_PCI_IMU_ERR_INT_MSI_MAL_ERR_S 0x0000008000000000ULL +#define FO_PCI_IMU_ERR_INT_MSI_PAR_ERR_S 0x0000004000000000ULL +#define FO_PCI_IMU_ERR_INT_PMEACK_MES_NOT_EN_S 0x0000002000000000ULL +#define FO_PCI_IMU_ERR_INT_PMPME_MES_NOT_EN_S 0x0000001000000000ULL +#define FO_PCI_IMU_ERR_INT_FATAL_MES_NOT_EN_S 0x0000000800000000ULL +#define FO_PCI_IMU_ERR_INT_NFATAL_MES_NOT_EN_S 0x0000000400000000ULL +#define FO_PCI_IMU_ERR_INT_COR_MES_NOT_EN_S 0x0000000200000000ULL +#define FO_PCI_IMU_ERR_INT_MSI_NOT_EN_S 0x0000000100000000ULL +#define FO_PCI_IMU_ERR_INT_SPARE_P_MASK 0x0000000000007c00ULL +#define FO_PCI_IMU_ERR_INT_SPARE_P_SHFT 10 +#define FO_PCI_IMU_ERR_INT_EQ_OVER_P 0x0000000000000200ULL +#define FO_PCI_IMU_ERR_INT_EQ_NOT_EN_P 0x0000000000000100ULL +#define FO_PCI_IMU_ERR_INT_MSI_MAL_ERR_P 0x0000000000000080ULL +#define FO_PCI_IMU_ERR_INT_MSI_PAR_ERR_P 0x0000000000000040ULL +#define FO_PCI_IMU_ERR_INT_PMEACK_MES_NOT_EN_P 0x0000000000000020ULL +#define FO_PCI_IMU_ERR_INT_PMPME_MES_NOT_EN_P 0x0000000000000010ULL +#define FO_PCI_IMU_ERR_INT_FATAL_MES_NOT_EN_P 0x0000000000000008ULL +#define FO_PCI_IMU_ERR_INT_NFATAL_MES_NOT_EN_P 0x0000000000000004ULL +#define FO_PCI_IMU_ERR_INT_COR_MES_NOT_EN_P 0x0000000000000002ULL +#define FO_PCI_IMU_ERR_INT_MSI_NOT_EN_P 0x0000000000000001ULL + +/* PCI IMU RDS error log register */ +#define FO_PCI_IMU_RDS_ERR_LOG_TYPE_MASK 0xfc00000000000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_TYPE_SHFT 58 +#define FO_PCI_IMU_RDS_ERR_LOG_LENGTH_MASK 0x03ff000000000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_LENGTH_SHFT 48 +#define FO_PCI_IMU_RDS_ERR_LOG_REQ_ID_MASK 0x0000ffff00000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_REQ_ID_SHFT 32 +#define FO_PCI_IMU_RDS_ERR_LOG_TLP_TAG_MASK 0x00000000ff000000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_TLP_TAG_SHFT 24 +#define FO_PCI_IMU_RDS_ERR_LOG_BE_MCODE_MASK 0x0000000000ff0000ULL +#define FO_PCI_IMU_RDS_ERR_LOG_BE_MCODE_SHFT 16 +#define FO_PCI_IMU_RDS_ERR_LOG_MSI_DATA_MASK 0x000000000000ffffULL +#define FO_PCI_IMU_RDS_ERR_LOG_MSI_DATA_SHFT 0 + +/* PCI IMU SCS error log register */ +#define FO_PCI_IMU_SCS_ERR_LOG_TYPE_MASK 0xfc00000000000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_TYPE_SHFT 58 +#define FO_PCI_IMU_SCS_ERR_LOG_LENGTH_MASK 0x03ff000000000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_LENGTH_SHFT 48 +#define FO_PCI_IMU_SCS_ERR_LOG_REQ_ID_MASK 0x0000ffff00000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_REQ_ID_SHFT 32 +#define FO_PCI_IMU_SCS_ERR_LOG_TLP_TAG_MASK 0x00000000ff000000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_TLP_TAG_SHFT 24 +#define FO_PCI_IMU_SCS_ERR_LOG_BE_MODE_MASK 0x0000000000ff0000ULL +#define FO_PCI_IMU_SCS_ERR_LOG_BE_MCODE_SHFT 16 +#define FO_PCI_IMU_SCS_ERR_LOG_EQ_NUM_MASK 0x000000000000003fULL +#define FO_PCI_IMU_SCS_ERR_LOG_EQ_NUM_SHFT 0 + +/* PCI IMU EQS error log register */ +#define FO_PCI_IMU_EQS_ERR_LOG_EQ_NUM_MASK 0x000000000000003fULL +#define FO_PCI_IMU_EQS_ERROR_LOG_EQ_NUM_SHFT 0 + +/* + * PCI ERR COR, ERR NONFATAL, ERR FATAL, PM PME and PME To ACK mapping + * registers + */ +#define FO_PCI_ERR_PME_V 0x8000000000000000ULL +#define FO_PCI_ERR_PME_EQNUM_MASK 0x000000000000003fULL +#define FO_PCI_ERR_PME_EQNUM_SHFT 0 + +/* PCI DMC core and block interrupt enable register */ +#define FO_PCI_DMC_CORE_BLOCK_INT_EN_DMC 0x8000000000000000ULL +#define FO_PCI_DMC_CORE_BLOCK_INT_EN_MMU 0x0000000000000002ULL +#define FO_PCI_DMC_CORE_BLOCK_INT_EN_IMU 0x0000000000000001ULL + +/* PCI DMC core and block error status register */ +#define FO_PCI_DMC_CORE_BLOCK_ERR_STAT_MMU 0x0000000000000002ULL +#define FO_PCI_DMC_CORE_BLOCK_ERR_STAT_IMU 0x0000000000000001ULL + +/* PCI multi core error status register */ +#define FO_PCI_MULTI_CORE_ERR_STAT_PEC 0x0000000000000002ULL +#define FO_PCI_MULTI_CORE_ERR_STAT_DMC 0x0000000000000001ULL + +/* PCI MSI 32-bit address register */ +#define FO_PCI_MSI_32_BIT_ADDR_MASK 0x00000000ffff0000ULL +#define FO_PCI_MSI_32_BIT_ADDR_SHFT 16 + +/* PCI MSI 64-bit address register */ +#define FO_PCI_MSI_64_BIT_ADDR_MASK 0x0000ffffffff0000ULL +#define FO_PCI_MSI_64_BIT_ADDR_SHFT 16 + +/* + * PCI MMU interrupt enable, interrupt status and error status clear + * registers + */ +#define FO_PCI_MMU_ERR_INT_S_MASK 0x0000ffff00000000ULL +#define FO_PCI_MMU_ERR_INT_S_SHFT 32 +#define FO_PCI_MMU_ERR_INT_TBW_DPE_S 0x0000800000000000ULL +#define FO_PCI_MMU_ERR_INT_TBW_ERR_S 0x0000400000000000ULL +#define FO_PCI_MMU_ERR_INT_TBW_UDE_S 0x0000200000000000ULL +#define FO_PCI_MMU_ERR_INT_TBW_DME_S 0x0000100000000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE3_S 0x0000080000000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE2_S 0x0000040000000000ULL +#define FO_PCI_MMU_ERR_INT_TTC_CAE_S 0x0000020000000000ULL +#define FIRE_PCI_MMU_ERR_INT_TTC_DPE_S 0x0000010000000000ULL +#define OBERON_PCI_MMU_ERR_INT_TTC_DUE_S 0x0000010000000000ULL +#define FO_PCI_MMU_ERR_INT_TTE_PRT_S 0x0000008000000000ULL +#define FO_PCI_MMU_ERR_INT_TTE_INV_S 0x0000004000000000ULL +#define FO_PCI_MMU_ERR_INT_TRN_OOR_S 0x0000002000000000ULL +#define FO_PCI_MMU_ERR_INT_TRN_ERR_S 0x0000001000000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE1_S 0x0000000800000000ULL +#define FO_PCI_MMU_ERR_INT_SPARE0_S 0x0000000400000000ULL +#define FO_PCI_MMU_ERR_INT_BYP_OOR_S 0x0000000200000000ULL +#define FO_PCI_MMU_ERR_INT_BYP_ERR_S 0x0000000100000000ULL +#define FO_PCI_MMU_ERR_INT_P_MASK 0x000000000000ffffULL +#define FO_PCI_MMU_ERR_INT_P_SHFT 0 +#define FO_PCI_MMU_ERR_INT_TBW_DPE_P 0x0000000000008000ULL +#define FO_PCI_MMU_ERR_INT_TBW_ERR_P 0x0000000000004000ULL +#define FO_PCI_MMU_ERR_INT_TBW_UDE_P 0x0000000000002000ULL +#define FO_PCI_MMU_ERR_INT_TBW_DME_P 0x0000000000001000ULL +#define FO_PCI_MMU_ERR_INT_SPARE3_P 0x0000000000000800ULL +#define FO_PCI_MMU_ERR_INT_SPARE2_P 0x0000000000000400ULL +#define FO_PCI_MMU_ERR_INT_TTC_CAE_P 0x0000000000000200ULL +#define FIRE_PCI_MMU_ERR_INT_TTC_DPE_P 0x0000000000000100ULL +#define OBERON_PCI_MMU_ERR_INT_TTC_DUE_P 0x0000000000000100ULL +#define FO_PCI_MMU_ERR_INT_TTE_PRT_P 0x0000000000000080ULL +#define FO_PCI_MMU_ERR_INT_TTE_INV_P 0x0000000000000040ULL +#define FO_PCI_MMU_ERR_INT_TRN_OOR_P 0x0000000000000020ULL +#define FO_PCI_MMU_ERR_INT_TRN_ERR_P 0x0000000000000010ULL +#define FO_PCI_MMU_ERR_INT_SPARE1_P 0x0000000000000008ULL +#define FO_PCI_MMU_ERR_INT_SPARE0_P 0x0000000000000004ULL +#define FO_PCI_MMU_ERR_INT_BYP_OOR_P 0x0000000000000002ULL +#define FO_PCI_MMU_ERR_INT_BYP_ERR_P 0x0000000000000001ULL + +/* PCI MMU translation fault address register */ +#define FO_PCI_MMU_TRANS_FAULT_ADDR_VA_MASK 0xfffffffffffffffcULL +#define FO_PCI_MMU_TRANS_FAULT_ADDR_VA_SHFT 2 + +/* PCI MMU translation fault status register */ +#define FO_PCI_MMU_TRANS_FAULT_STAT_ENTRY_MASK 0x000001ff00000000ULL +#define FO_PCI_MMU_TRANS_FAULT_STAT_ENTRY_SHFT 32 +#define FO_PCI_MMU_TRANS_FAULT_STAT_TYPE_MASK 0x00000000007f0000ULL +#define FO_PCI_MMU_TRANS_FAULT_STAT_TYPE_SHFT 16 +#define FO_PCI_MMU_TRANS_FAULT_STAT_ID_MASK 0x000000000000ffffULL +#define FO_PCI_MMU_TRANS_FAULT_STAT_ID_SHFT 0 + +/* + * PCI ILU interrupt enable, interrupt status and error status clear + * registers + */ +#define FO_PCI_ILU_ERR_INT_SPARE3_S 0x0000008000000000ULL +#define FO_PCI_ILU_ERR_INT_SPARE2_S 0x0000004000000000ULL +#define FO_PCI_ILU_ERR_INT_SPARE1_S 0x0000002000000000ULL +#define FIRE_PCI_ILU_ERR_INT_IHB_PE_S 0x0000001000000000ULL +#define OBERON_PCI_ILU_ERR_INT_IHB_UE_S 0x0000001000000000ULL +#define FO_PCI_ILU_ERR_INT_SPARE3_P 0x0000000000000080ULL +#define FO_PCI_ILU_ERR_INT_SPARE2_P 0x0000000000000040ULL +#define FO_PCI_ILU_ERR_INT_SPARE1_P 0x0000000000000020ULL +#define FIRE_PCI_ILU_ERR_INT_IHB_PE_P 0x0000000000000010ULL +#define OBERON_PCI_ILU_ERR_INT_IHB_UE_P 0x0000000000000010ULL + +/* PCI DMC debug select registers for port a/b */ +#define FO_PCI_DMC_DBG_SEL_PORT_BLCK_MASK 0x00000000000003c0ULL +#define FO_PCI_DMC_DBG_SEL_PORT_BLCK_SHFT 6 +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_MASK 0x0000000000000038ULL +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_SHFT 3 +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_SGNL_MASK 0x0000000000000007ULL +#define FO_PCI_DMC_DBG_SEL_PORT_SUB_SGNL_SHFT 0 + +/* PCI PEC core and block interrupt enable register */ +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_PEC 0x8000000000000000ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_ILU 0x0000000000000008ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_UERR 0x0000000000000004ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_CERR 0x0000000000000002ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_EN_OEVENT 0x0000000000000001ULL + +/* PCI PEC core and block interrupt status register */ +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_ILU 0x0000000000000008ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_UERR 0x0000000000000004ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_CERR 0x0000000000000002ULL +#define FO_PCI_PEC_CORE_BLOCK_INT_STAT_OEVENT 0x0000000000000001ULL + +/* PCI TLU control register */ +#define FO_PCI_TLU_CTRL_L0S_TIM_MASK 0x00000000ff000000ULL +#define FO_PCI_TLU_CTRL_L0S_TIM_SHFT 24 +#define FO_PCI_TLU_CTRL_NWPR_EN 0x0000000000100000ULL +#define FO_PCI_TLU_CTRL_CTO_SEL_MASK 0x0000000000070000ULL +#define FO_PCI_TLU_CTRL_CTO_SEL_SHFT 16 +#define FO_PCI_TLU_CTRL_CFG_MASK 0x000000000000ffffULL +#define FO_PCI_TLU_CTRL_CFG_SHFT 0 +#define FO_PCI_TLU_CTRL_CFG_REMAIN_DETECT_QUIET 0x0000000000000100ULL + +/* + * PCI TLU other event interrupt enable, interrupt status and status clear + * registers + */ +#define FO_PCI_TLU_OEVENT_S_MASK 0x00ffffff00000000ULL +#define FO_PCI_TLU_OEVENT_S_SHFT 32 +#define FO_PCI_TLU_OEVENT_SPARE_S 0x0080000000000000ULL +#define FO_PCI_TLU_OEVENT_MFC_S 0x0040000000000000ULL +#define FO_PCI_TLU_OEVENT_CTO_S 0x0020000000000000ULL +#define FO_PCI_TLU_OEVENT_NFP_S 0x0010000000000000ULL +#define FO_PCI_TLU_OEVENT_LWC_S 0x0008000000000000ULL +#define FO_PCI_TLU_OEVENT_MRC_S 0x0004000000000000ULL +#define FO_PCI_TLU_OEVENT_WUC_S 0x0002000000000000ULL +#define FO_PCI_TLU_OEVENT_RUC_S 0x0001000000000000ULL +#define FO_PCI_TLU_OEVENT_CRS_S 0x0000800000000000ULL +#define FO_PCI_TLU_OEVENT_IIP_S 0x0000400000000000ULL +#define FO_PCI_TLU_OEVENT_EDP_S 0x0000200000000000ULL +#define FIRE_PCI_TLU_OEVENT_EHP_S 0x0000100000000000ULL +#define OBERON_PCI_TLU_OEVENT_EHBUE_S 0x0000100000000000ULL +#define OBERON_PCI_TLU_OEVENT_EDBUE_S 0x0000100000000000ULL +#define FO_PCI_TLU_OEVENT_LIN_S 0x0000080000000000ULL +#define FO_PCI_TLU_OEVENT_LRS_S 0x0000040000000000ULL +#define FO_PCI_TLU_OEVENT_LDN_S 0x0000020000000000ULL +#define FO_PCI_TLU_OEVENT_LUP_S 0x0000010000000000ULL +#define FO_PCI_TLU_OEVENT_LPU_S_MASK 0x000000c000000000ULL +#define FO_PCI_TLU_OEVENT_LPU_S_SHFT 38 +#define OBERON_PCI_TLU_OEVENT_TLUEITMO_S 0x0000008000000000ULL +#define FO_PCI_TLU_OEVENT_ERU_S 0x0000002000000000ULL +#define FO_PCI_TLU_OEVENT_ERO_S 0x0000001000000000ULL +#define FO_PCI_TLU_OEVENT_EMP_S 0x0000000800000000ULL +#define FO_PCI_TLU_OEVENT_EPE_S 0x0000000400000000ULL +#define FIRE_PCI_TLU_OEVENT_ERP_S 0x0000000200000000ULL +#define OBERON_PCI_TLU_OEVENT_ERBU_S 0x0000000200000000ULL +#define FIRE_PCI_TLU_OEVENT_EIP_S 0x0000000100000000ULL +#define OBERON_PCI_TLU_OEVENT_EIUE_S 0x0000000100000000ULL +#define FO_PCI_TLU_OEVENT_P_MASK 0x0000000000ffffffULL +#define FO_PCI_TLU_OEVENT_P_SHFT 0 +#define FO_PCI_TLU_OEVENT_SPARE_P 0x0000000000800000ULL +#define FO_PCI_TLU_OEVENT_MFC_P 0x0000000000400000ULL +#define FO_PCI_TLU_OEVENT_CTO_P 0x0000000000200000ULL +#define FO_PCI_TLU_OEVENT_NFP_P 0x0000000000100000ULL +#define FO_PCI_TLU_OEVENT_LWC_P 0x0000000000080000ULL +#define FO_PCI_TLU_OEVENT_MRC_P 0x0000000000040000ULL +#define FO_PCI_TLU_OEVENT_WUC_P 0x0000000000020000ULL +#define FO_PCI_TLU_OEVENT_RUC_P 0x0000000000010000ULL +#define FO_PCI_TLU_OEVENT_CRS_P 0x0000000000008000ULL +#define FO_PCI_TLU_OEVENT_IIP_P 0x0000000000004000ULL +#define FO_PCI_TLU_OEVENT_EDP_P 0x0000000000002000ULL +#define FIRE_PCI_TLU_OEVENT_EHP_P 0x0000000000001000ULL +#define OBERON_PCI_TLU_OEVENT_EHBUE_P 0x0000000000001000ULL +#define OBERON_PCI_TLU_OEVENT_EDBUE_P 0x0000000000001000ULL +#define FO_PCI_TLU_OEVENT_LIN_P 0x0000000000000800ULL +#define FO_PCI_TLU_OEVENT_LRS_P 0x0000000000000400ULL +#define FO_PCI_TLU_OEVENT_LDN_P 0x0000000000000200ULL +#define FO_PCI_TLU_OEVENT_LUP_P 0x0000000000000100ULL +#define FO_PCI_TLU_OEVENT_LPU_P_MASK 0x00000000000000c0ULL +#define FO_PCI_TLU_OEVENT_LPU_P_SHFT 6 +#define OBERON_PCI_TLU_OEVENT_TLUEITMO_P 0x0000000000000080ULL +#define FO_PCI_TLU_OEVENT_ERU_P 0x0000000000000020ULL +#define FO_PCI_TLU_OEVENT_ERO_P 0x0000000000000010ULL +#define FO_PCI_TLU_OEVENT_EMP_P 0x0000000000000008ULL +#define FO_PCI_TLU_OEVENT_EPE_P 0x0000000000000004ULL +#define FIRE_PCI_TLU_OEVENT_ERP_P 0x0000000000000002ULL +#define OBERON_PCI_TLU_OEVENT_ERBU_P 0x0000000000000002ULL +#define FIRE_PCI_TLU_OEVENT_EIP_P 0x0000000000000001ULL +#define OBERON_PCI_TLU_OEVENT_EIUE_P 0x0000000000000001ULL + +/* PCI receive/transmit DLU/TLU other event header 1/2 log registers */ +#define FO_PCI_TLU_OEVENT_HDR_LOG_MASK 0xffffffffffffffffULL +#define FO_PCI_TLU_OEVENT_HDR_LOG_SHFT 0 + +/* PCI TLU device control register */ +#define FO_PCI_TLU_DEV_CTRL_MRRS_MASK 0x0000000000007000ULL +#define FO_PCI_TLU_DEV_CTRL_MRRS_SHFT 12 +#define FO_PCI_TLU_DEV_CTRL_MPS_MASK 0x00000000000000e0ULL +#define FO_PCI_TLU_DEV_CTRL_MPS_SHFT 5 + +/* + * PCI TLU uncorrectable error interrupt enable, interrupt status and + * status clear registers + */ +#define FO_PCI_TLU_UERR_INT_S_MASK 0x001fffff00000000ULL +#define FO_PCI_TLU_UERR_INT_S_SHFT 32 +#define FO_PCI_TLU_UERR_INT_UR_S 0x0010000000000000ULL +#define OBERON_PCI_TLU_UERR_INT_ECRC_S 0x0008000000000000ULL +#define FO_PCI_TLU_UERR_INT_MFP_S 0x0004000000000000ULL +#define FO_PCI_TLU_UERR_INT_ROF_S 0x0002000000000000ULL +#define FO_PCI_TLU_UERR_INT_UC_S 0x0001000000000000ULL +#define FO_PCI_TLU_UERR_INT_CA_S 0x0000800000000000ULL +#define FO_PCI_TLU_UERR_INT_CTO_S 0x0000400000000000ULL +#define FO_PCI_TLU_UERR_INT_FCP_S 0x0000200000000000ULL +#define FIRE_PCI_TLU_UERR_INT_PP_S 0x0000100000000000ULL +#define OBERON_PCI_TLU_UERR_INT_POIS_S 0x0000100000000000ULL +#define FO_PCI_TLU_UERR_INT_DLP_S 0x0000001000000000ULL +#define FO_PCI_TLU_UERR_INT_TE_S 0x0000000100000000ULL +#define FO_PCI_TLU_UERR_INT_P_MASK 0x00000000001fffffULL +#define FO_PCI_TLU_UERR_INT_P_SHFT 0 +#define FO_PCI_TLU_UERR_INT_UR_P 0x0000000000100000ULL +#define OBERON_PCI_TLU_UERR_INT_ECRC_P 0x0000000000080000ULL +#define FO_PCI_TLU_UERR_INT_MFP_P 0x0000000000040000ULL +#define FO_PCI_TLU_UERR_INT_ROF_P 0x0000000000020000ULL +#define FO_PCI_TLU_UERR_INT_UC_P 0x0000000000010000ULL +#define FO_PCI_TLU_UERR_INT_CA_P 0x0000000000008000ULL +#define FO_PCI_TLU_UERR_INT_CTO_P 0x0000000000004000ULL +#define FO_PCI_TLU_UERR_INT_FCP_P 0x0000000000002000ULL +#define FIRE_PCI_TLU_UERR_INT_PP_P 0x0000000000001000ULL +#define OBERON_PCI_TLU_UERR_INT_POIS_P 0x0000000000001000ULL +#define FO_PCI_TLU_UERR_INT_DLP_P 0x0000000000000010ULL +#define FO_PCI_TLU_UERR_INT_TE_P 0x0000000000000001ULL + +/* + * PCI TLU correctable error interrupt enable, interrupt status and + * status clear registers + */ +#define FO_PCI_TLU_CERR_INT_S_MASK 0x001fffff00000000ULL +#define FO_PCI_TLU_CERR_INT_S_SHFT 32 +#define FO_PCI_TLU_CERR_INT_RTO_S 0x0000100000000000ULL +#define FO_PCI_TLU_CERR_INT_RNR_S 0x0000010000000000ULL +#define FO_PCI_TLU_CERR_INT_BDP_S 0x0000008000000000ULL +#define FO_PCI_TLU_CERR_INT_BTP_S 0x0000004000000000ULL +#define FO_PCI_TLU_CERR_INT_RE_S 0x0000000100000000ULL +#define FO_PCI_TLU_CERR_INT_P_MASK 0x00000000001fffffULL +#define FO_PCI_TLU_CERR_INT_P_SHFT 0 +#define FO_PCI_TLU_CERR_INT_RTO_P 0x0000000000001000ULL +#define FO_PCI_TLU_CERR_INT_RNR_P 0x0000000000000100ULL +#define FO_PCI_TLU_CERR_INT_BDP_P 0x0000000000000080ULL +#define FO_PCI_TLU_CERR_INT_BTP_P 0x0000000000000040ULL +#define FO_PCI_TLU_CERR_INT_RE_P 0x0000000000000001ULL + +/* PCI TLU reset register */ +#define FO_PCI_LPU_RST_WE 0x0000000080000000ULL +#define FO_PCI_LPU_RST_UNUSED_MASK 0x0000000000000e00ULL +#define FO_PCI_LPU_RST_UNUSED_SHFT 9 +#define FO_PCI_LPU_RST_ERR 0x0000000000000100ULL +#define FO_PCI_LPU_RST_TXLINK 0x0000000000000080ULL +#define FO_PCI_LPU_RST_RXLINK 0x0000000000000040ULL +#define FO_PCI_LPU_RST_SMLINK 0x0000000000000020ULL +#define FO_PCI_LPU_RST_LTSSM 0x0000000000000010ULL +#define FO_PCI_LPU_RST_TXPHY 0x0000000000000008ULL +#define FO_PCI_LPU_RST_RXPHY 0x0000000000000004ULL +#define FO_PCI_LPU_RST_TXPCS 0x0000000000000002ULL +#define FO_PCI_LPU_RST_RXPCS 0x0000000000000001ULL + +/* PCI TLU link control register */ +#define FO_PCI_TLU_LNK_CTRL_EXTSYNC 0x0000000000000080ULL +#define FO_PCI_TLU_LNK_CTRL_CLK 0x0000000000000040ULL +#define FO_PCI_TLU_LNK_CTRL_RETRAIN 0x0000000000000020ULL +#define FO_PCI_TLU_LNK_CTRL_DIS 0x0000000000000010ULL +#define FO_PCI_TLU_LNK_CTRL_RCB 0x0000000000000008ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_L0S_L1S 0x0000000000000003ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_L1S 0x0000000000000002ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_L0S 0x0000000000000001ULL +#define FO_PCI_TLU_LNK_CTRL_ASPM_DIS 0x0000000000000000ULL + +/* PCI TLU link status register */ +#define FO_PCI_TLU_LNK_STAT_CLK 0x0000000000001000ULL +#define FO_PCI_TLU_LNK_STAT_TRAIN 0x0000000000000800ULL +#define FO_PCI_TLU_LNK_STAT_ERR 0x0000000000000400ULL +#define FO_PCI_TLU_LNK_STAT_WDTH_MASK 0x00000000000003f0ULL +#define FO_PCI_TLU_LNK_STAT_WDTH_SHFT 4 +#define FO_PCI_TLU_LNK_STAT_SPEED_MASK 0x000000000000000fULL +#define FO_PCI_TLU_LNK_STAT_SPEED_SHFT 0 + +/* + * PCI receive/transmit DLU/TLU uncorrectable error header 1/2 log + * registers + */ +#define FO_PCI_TLU_UERR_HDR_LOG_MASK 0xffffffffffffffffULL +#define FO_PCI_TLU_UERR_HDR_LOG_SHFT 0 + +/* PCI DLU/LPU interrupt status and mask registers */ +#define FO_PCI_LPU_INT_INT 0x0000000080000000ULL +#define FIRE_PCI_LPU_INT_PRF_CNT2_OFLW 0x0000000000000080ULL +#define FIRE_PCI_LPU_INT_PRF_CNT1_OFLW 0x0000000000000040ULL +#define FO_PCI_LPU_INT_LNK_LYR 0x0000000000000020ULL +#define FO_PCI_LPU_INT_PHY_ERR 0x0000000000000010ULL +#define FIRE_PCI_LPU_INT_LTSSM 0x0000000000000008ULL +#define FIRE_PCI_LPU_INT_PHY_TX 0x0000000000000004ULL +#define FIRE_PCI_LPU_INT_PHY_RX 0x0000000000000002ULL +#define FIRE_PCI_LPU_INT_PHY_GB 0x0000000000000001ULL + +/* PCI DLU/LPU link layer config register */ +#define FIRE_PCI_LPU_LNK_LYR_CFG_AUTO_UPDT_DIS 0x0000000000080000ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_FREQ_NAK_EN 0x0000000000040000ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_RPLY_AFTER_REQ 0x0000000000020000ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_LAT_THRS_WR_EN 0x0000000000010000ULL +#define FO_PCI_LPU_LNK_LYR_CFG_VC0_EN 0x0000000000000100ULL +#define FIRE_PCI_LPU_LNK_LYR_CFG_L0S_ADJ_FAC_EN 0x0000000000000010ULL +#define FIER_PCI_LPU_LNK_LYR_CFG_TLP_XMIT_FC_EN 0x0000000000000008ULL +#define FO_PCI_LPU_LNK_LYR_CFG_FREQ_ACK_EN 0x0000000000000004ULL +#define FO_PCI_LPU_LNK_LYR_CFG_RETRY_DIS 0x0000000000000002ULL + +/* PCI DLU/LPU link layer interrupt and status register */ +#define FO_PCI_LPU_LNK_LYR_INT_STAT_LNK_ERR_ACT 0x0000000080000000ULL +#define OBERON_PCI_LPU_LNK_LYR_INT_STAT_PBUS_PE 0x0000000000800000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_USPRTD_DLLP 0x0000000000400000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_DLLP_RX_ERR 0x0000000000200000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_BAD_DLLP 0x0000000000100000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_TLP_RX_ERR 0x0000000000040000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_SRC_ERR_TLP 0x0000000000020000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_BAD_TLP 0x0000000000010000ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RBF_UDF_ERR 0x0000000000000200ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RBF_OVF_ERR 0x0000000000000100ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_EG_TLPM_ERR 0x0000000000000080ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_EG_TFRM_ERR 0x0000000000000040ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RBF_PE 0x0000000000000020ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_EGRESS_PE 0x0000000000000010ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RPLY_TMR_TO 0x0000000000000004ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_RPLY_NUM_RO 0x0000000000000002ULL +#define FO_PCI_LPU_LNK_LYR_INT_STAT_DLNK_PES 0x0000000000000001ULL + +/* PCI DLU/LPU flow control update control register */ +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_C_EN 0x0000000000000004ULL +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_NP_EN 0x0000000000000002ULL +#define FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_P_EN 0x0000000000000001ULL + +/* PCI DLU/LPU txlink ACKNAK latency timer threshold register */ +#define FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS_MASK 0x000000000000ffffULL +#define FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS_SHFT 0 + +/* PCI DLU/LPU txlink replay timer threshold register */ +#define FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_MASK 0x00000000000fffffULL +#define FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_SHFT 0 + +/* PCI DLU/LPU txlink FIFO pointer register */ +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_TL_MASK 0x00000000ffff0000ULL +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_TL_SHFT 16 +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_HD_MASK 0x000000000000ffffULL +#define FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_HD_SHFT 0 + +/* PCI DLU/LPU phy layer interrupt and status register */ +#define FO_PCI_LPU_PHY_LYR_INT_STAT_PHY_LYR_ERR 0x0000000080000000ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_KC_DLLP_ERR 0x0000000000000800ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_END_POS_ERR 0x0000000000000400ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_LNK_ERR 0x0000000000000200ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_TRN_ERR 0x0000000000000100ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_EDB_DET 0x0000000000000080ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_SDP_END 0x0000000000000040ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_STP_END_EDB 0x0000000000000020ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_INVC_ERR 0x0000000000000010ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_MULTI_SDP 0x0000000000000008ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_MULTI_STP 0x0000000000000004ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_ILL_SDP_POS 0x0000000000000002ULL +#define FO_PCI_LPU_PHY_LYR_INT_STAT_ILL_STP_POS 0x0000000000000001ULL + +/* PCI DLU/LPU LTSSM config2 register */ +#define FO_PCI_LPU_LTSSM_CFG2_12_TO_MASK 0x00000000ffffffffULL +#define FO_PCI_LPU_LTSSM_CFG2_12_TO_SHFT 0 + +/* PCI DLU/LPU LTSSM config3 register */ +#define FO_PCI_LPU_LTSSM_CFG3_2_TO_MASK 0x00000000ffffffffULL +#define FO_PCI_LPU_LTSSM_CFG3_2_TO_SHFT 0 + +/* PCI DLU/LPU LTSSM config4 register */ +#define FO_PCI_LPU_LTSSM_CFG4_TRN_CTRL_MASK 0x00000000ff000000ULL +#define FO_PCI_LPU_LTSSM_CFG4_TRN_CTRL_SHFT 24 +#define FO_PCI_LPU_LTSSM_CFG4_DATA_RATE_MASK 0x0000000000ff0000ULL +#define FO_PCI_LPU_LTSSM_CFG4_DATA_RATE_SHFT 16 +#define FO_PCI_LPU_LTSSM_CFG4_N_FTS_MASK 0x000000000000ff00ULL +#define FO_PCI_LPU_LTSSM_CFG4_N_FTS_SHFT 8 +#define FO_PCI_LPU_LTSSM_CFG4_LNK_NUM_MASK 0x00000000000000ffULL +#define FO_PCI_LPU_LTSSM_CFG4_LNK_NUM_SHFT 0 + +/* PCI DLU/LPU LTSSM config5 register */ +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED0_MASK 0x00000000ffffe000ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED0_SHFT 13 +#define FO_PCI_LPU_LTSSM_CFG5_RCV_DET_TST_MODE 0x0000000000001000ULL +#define FO_PCI_LPU_LTSSM_CFG5_POLL_CMPLNC_DIS 0x0000000000000800ULL +#define FO_PCI_LPU_LTSSM_CFG5_TX_IDLE_TX_FTS 0x0000000000000400ULL +#define FO_PCI_LPU_LTSSM_CFG5_RX_FTS_RVR_LK 0x0000000000000200ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED1_MASK 0x0000000000000180ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED1_SHFT 7 +#define FO_PCI_LPU_LTSSM_CFG5_LPBK_NTRY_ACTIVE 0x0000000000000040ULL +#define FO_PCI_LPU_LTSSM_CFG5_LPBK_NTRY_EXIT 0x0000000000000020ULL +#define FO_PCI_LPU_LTSSM_CFG5_LPBK_ACTIVE_EXIT 0x0000000000000010ULL +#define FO_PCI_LPU_LTSSM_CFG5_L1_IDLE_RCVRY_LK 0x0000000000000008ULL +#define FO_PCI_LPU_LTSSM_CFG5_L0_TRN_CNTRL_RST 0x0000000000000004ULL +#define FO_PCI_LPU_LTSSM_CFG5_L0_LPBK 0x0000000000000002ULL +#define FO_PCI_LPU_LTSSM_CFG5_UNUSED2 0x0000000000000001ULL + +/* Controller configuration and status registers */ +#define FIRE_JBUS_PAR_CTRL 0x60010 +#define FO_XBC_ERR_LOG_EN 0x61000 +#define FO_XBC_INT_EN 0x61008 +#define FO_XBC_INT_STAT 0x61010 +#define FO_XBC_ERR_STAT_CLR 0x61018 +#define FIRE_JBC_FATAL_RST_EN 0x61028 +#define FIRE_JBCINT_ITRANS_ERR_LOG 0x61040 +#define FIRE_JBCINT_ITRANS_ERR_LOG2 0x61048 +#define FIRE_JBCINT_OTRANS_ERR_LOG 0x61040 +#define FIRE_JBCINT_OTRANS_ERR_LOG2 0x61048 +#define FIRE_FATAL_ERR_LOG 0x61050 +#define FIRE_FATAL_ERR_LOG2 0x61058 +#define FIRE_MERGE_TRANS_ERR_LOG 0x61060 +#define FIRE_DMCINT_ODCD_ERR_LOG 0x61068 +#define FIRE_DMCINT_IDC_ERR_LOG 0x61070 +#define FIRE_JBC_CSR_ERR_LOG 0x61078 +#define FIRE_JBC_CORE_BLOCK_INT_EN 0x61800 +#define FIRE_JBC_CORE_BLOCK_ERR_STAT 0x61808 +#define FO_XBC_PRF_CNT_SEL 0x62000 +#define FO_XBC_PRF_CNT0 0x62008 +#define FO_XBC_PRF_CNT1 0x62010 + +/* JBus parity control register */ +#define FIRE_JBUS_PAR_CTRL_P_EN 0x8000000000000000ULL +#define FIRE_JBUS_PAR_CTRL_INVRTD_PAR_MASK 0x000000000000003cULL +#define FIRE_JBUS_PAR_CTRL_INVRTD_PAR_SHFT 2 +#define FIRE_JBUS_PAR_CTRL_NEXT_DATA 0x0000000000000002ULL +#define FIRE_JBUS_PAR_CTRL_NEXT_ADDR 0x0000000000000001ULL + +/* JBC error log enable register - may also apply to UBC */ +#define FIRE_JBC_ERR_LOG_EN_SPARE_MASK 0x00000000e0000000ULL +#define FIRE_JBC_ERR_LOG_EN_SPARE_SHFT 29 +#define FIRE_JBC_ERR_LOG_EN_PIO_UNMAP_RD 0x0000000010000000ULL +#define FIRE_JBC_ERR_LOG_EN_ILL_ACC_RD 0x0000000008000000ULL +#define FIRE_JBC_ERR_LOG_EN_EBUS_TO 0x0000000004000000ULL +#define FIRE_JBC_ERR_LOG_EN_MB_PEA 0x0000000002000000ULL +#define FIRE_JBC_ERR_LOG_EN_MB_PER 0x0000000001000000ULL +#define FIRE_JBC_ERR_LOG_EN_MB_PEW 0x0000000000800000ULL +#define FIRE_JBC_ERR_LOG_EN_UE_ASYN 0x0000000000400000ULL +#define FIRE_JBC_ERR_LOG_EN_CE_ASYN 0x0000000000200000ULL +#define FIRE_JBC_ERR_LOG_EN_JTE 0x0000000000100000ULL +#define FIRE_JBC_ERR_LOG_EN_JBE 0x0000000000080000ULL +#define FIRE_JBC_ERR_LOG_EN_JUE 0x0000000000040000ULL +#define FIRE_JBC_ERR_LOG_EN_IJP 0x0000000000020000ULL +#define FIRE_JBC_ERR_LOG_EN_ICISE 0x0000000000010000ULL +#define FIRE_JBC_ERR_LOG_EN_CPE 0x0000000000008000ULL +#define FIRE_JBC_ERR_LOG_EN_APE 0x0000000000004000ULL +#define FIRE_JBC_ERR_LOG_EN_WR_DPE 0x0000000000002000ULL +#define FIRE_JBC_ERR_LOG_EN_RD_DPE 0x0000000000001000ULL *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 22:19:51 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57C481065672; Fri, 15 Jan 2010 22:19:51 +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 464078FC14; Fri, 15 Jan 2010 22:19: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 o0FMJpY2006197; Fri, 15 Jan 2010 22:19:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FMJppK006195; Fri, 15 Jan 2010 22:19:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001152219.o0FMJppK006195@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 15 Jan 2010 22:19:51 +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: r202421 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 22:19:51 -0000 Author: kib Date: Fri Jan 15 22:19:51 2010 New Revision: 202421 URL: http://svn.freebsd.org/changeset/base/202421 Log: MFC r201890: Set md_ldt after md_ldt_sd is populated. Modified: stable/8/sys/amd64/amd64/sys_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) Modified: stable/8/sys/amd64/amd64/sys_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/sys_machdep.c Fri Jan 15 21:45:55 2010 (r202420) +++ stable/8/sys/amd64/amd64/sys_machdep.c Fri Jan 15 22:19:51 2010 (r202421) @@ -420,13 +420,14 @@ user_ldt_alloc(struct proc *p, int force return (pldt); } - mdp->md_ldt = new_ldt; if (pldt != NULL) { bcopy(pldt->ldt_base, new_ldt->ldt_base, max_ldt_segment * sizeof(struct user_segment_descriptor)); user_ldt_derefl(pldt); } ssdtosyssd(&sldt, &p->p_md.md_ldt_sd); + atomic_store_rel_ptr((volatile uintptr_t *)&mdp->md_ldt, + (uintptr_t)new_ldt); if (p == curproc) set_user_ldt(mdp); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 23:52:31 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5AE510656B6; Fri, 15 Jan 2010 23:52:31 +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 D3AFB8FC1D; Fri, 15 Jan 2010 23:52: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 o0FNqVhA026796; Fri, 15 Jan 2010 23:52:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FNqVed026795; Fri, 15 Jan 2010 23:52:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001152352.o0FNqVed026795@svn.freebsd.org> From: Alexander Motin Date: Fri, 15 Jan 2010 23:52: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: r202425 - stable/8/sbin/geom/class/stripe X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 23:52:32 -0000 Author: mav Date: Fri Jan 15 23:52:31 2010 New Revision: 202425 URL: http://svn.freebsd.org/changeset/base/202425 Log: MFC r201658: Increase default block size from 4K to 64K. It was reduces 6 yeard ago, when trees were big and FAST mode was enabled by default. So small block size doesn't benefits linear I/O operations in FAST and significantly slowdowns in ECONOMIC (default) mode. For single stream random I/Os so small block doesn't give much benefits, as access time is usually bigger then transfer time there. Same time it requires all heads to seek together for every single request, reducing performance on parallel load. Modified: stable/8/sbin/geom/class/stripe/geom_stripe.c Directory Properties: stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/stripe/geom_stripe.c ============================================================================== --- stable/8/sbin/geom/class/stripe/geom_stripe.c Fri Jan 15 23:03:51 2010 (r202424) +++ stable/8/sbin/geom/class/stripe/geom_stripe.c Fri Jan 15 23:52:31 2010 (r202425) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_STRIPE_VERSION; -static intmax_t default_stripesize = 4096; +static intmax_t default_stripesize = 65536; static void stripe_main(struct gctl_req *req, unsigned flags); static void stripe_clear(struct gctl_req *req); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 23:54:14 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AB33106566B; Fri, 15 Jan 2010 23:54:14 +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 78CF98FC14; Fri, 15 Jan 2010 23:54:14 +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 o0FNsEwA027211; Fri, 15 Jan 2010 23:54:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FNsEkI027209; Fri, 15 Jan 2010 23:54:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001152354.o0FNsEkI027209@svn.freebsd.org> From: Alexander Motin Date: Fri, 15 Jan 2010 23:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202426 - stable/7/sbin/geom/class/stripe X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 23:54:14 -0000 Author: mav Date: Fri Jan 15 23:54:14 2010 New Revision: 202426 URL: http://svn.freebsd.org/changeset/base/202426 Log: MFC r201658: Increase default block size from 4K to 64K. It was reduces 6 yeard ago, when trees were big and FAST mode was enabled by default. So small block size doesn't benefits linear I/O operations in FAST and significantly slowdowns in ECONOMIC (default) mode. For single stream random I/Os so small block doesn't give much benefits, as access time is usually bigger then transfer time there. Same time it requires all heads to seek together for every single request, reducing performance on parallel load. Modified: stable/7/sbin/geom/class/stripe/geom_stripe.c Directory Properties: stable/7/sbin/geom/class/stripe/ (props changed) Modified: stable/7/sbin/geom/class/stripe/geom_stripe.c ============================================================================== --- stable/7/sbin/geom/class/stripe/geom_stripe.c Fri Jan 15 23:52:31 2010 (r202425) +++ stable/7/sbin/geom/class/stripe/geom_stripe.c Fri Jan 15 23:54:14 2010 (r202426) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_STRIPE_VERSION; -static intmax_t default_stripesize = 4096; +static intmax_t default_stripesize = 65536; static void stripe_main(struct gctl_req *req, unsigned flags); static void stripe_clear(struct gctl_req *req); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 23:56:20 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D7B81065693; Fri, 15 Jan 2010 23:56:20 +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 3B9548FC0A; Fri, 15 Jan 2010 23:56: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 o0FNuK52027732; Fri, 15 Jan 2010 23:56:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FNuK7V027728; Fri, 15 Jan 2010 23:56:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001152356.o0FNuK7V027728@svn.freebsd.org> From: Alexander Motin Date: Fri, 15 Jan 2010 23:56: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: r202427 - in stable/8/sys/geom: . part uzip X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 23:56:20 -0000 Author: mav Date: Fri Jan 15 23:56:19 2010 New Revision: 202427 URL: http://svn.freebsd.org/changeset/base/202427 Log: MFC r201645: Change the way in which zero stripesize is handled. Instead of reporting zero stripeoffset in such case (as if device has no stripes), report offset from the beginning of the media (as if device has single infinite stripe). This gives partitioning tools information, required to guess better partition alignment, in case if hardware doesn't report it's stripe size. For example, it should give disklabel info about odd offset made by fdisk. Modified: stable/8/sys/geom/geom_slice.c stable/8/sys/geom/part/g_part.c stable/8/sys/geom/uzip/g_uzip.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) Modified: stable/8/sys/geom/geom_slice.c ============================================================================== --- stable/8/sys/geom/geom_slice.c Fri Jan 15 23:54:14 2010 (r202426) +++ stable/8/sys/geom/geom_slice.c Fri Jan 15 23:56:19 2010 (r202427) @@ -393,10 +393,10 @@ g_slice_config(struct g_geom *gp, u_int pp = g_new_providerf(gp, sbuf_data(sb)); pp2 = LIST_FIRST(&gp->consumer)->provider; pp->flags = pp2->flags & G_PF_CANDELETE; - if (pp2->stripesize > 0) { - pp->stripesize = pp2->stripesize; - pp->stripeoffset = (pp2->stripeoffset + offset) % pp->stripesize; - } + pp->stripesize = pp2->stripesize; + pp->stripeoffset = pp2->stripeoffset + offset; + if (pp->stripesize > 0) + pp->stripeoffset %= pp->stripesize; if (0 && bootverbose) printf("GEOM: Configure %s, start %jd length %jd end %jd\n", pp->name, (intmax_t)offset, (intmax_t)length, Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Fri Jan 15 23:54:14 2010 (r202426) +++ stable/8/sys/geom/part/g_part.c Fri Jan 15 23:56:19 2010 (r202427) @@ -268,11 +268,10 @@ g_part_new_provider(struct g_geom *gp, s entry->gpe_pp->mediasize -= entry->gpe_offset - offset; entry->gpe_pp->sectorsize = pp->sectorsize; entry->gpe_pp->flags = pp->flags & G_PF_CANDELETE; - if (pp->stripesize > 0) { - entry->gpe_pp->stripesize = pp->stripesize; - entry->gpe_pp->stripeoffset = (pp->stripeoffset + - entry->gpe_offset) % pp->stripesize; - } + entry->gpe_pp->stripesize = pp->stripesize; + entry->gpe_pp->stripeoffset = pp->stripeoffset + entry->gpe_offset; + if (pp->stripesize > 0) + entry->gpe_pp->stripeoffset %= pp->stripesize; g_error_provider(entry->gpe_pp, 0); } Modified: stable/8/sys/geom/uzip/g_uzip.c ============================================================================== --- stable/8/sys/geom/uzip/g_uzip.c Fri Jan 15 23:54:14 2010 (r202426) +++ stable/8/sys/geom/uzip/g_uzip.c Fri Jan 15 23:56:19 2010 (r202427) @@ -467,10 +467,8 @@ g_uzip_taste(struct g_class *mp, struct pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; pp2->flags = pp->flags & G_PF_CANDELETE; - if (pp->stripesize > 0) { - pp2->stripesize = pp->stripesize; - pp2->stripeoffset = pp->stripeoffset; - } + pp2->stripesize = pp->stripesize; + pp2->stripeoffset = pp->stripeoffset; g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 15 23:58:37 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3B611065670; Fri, 15 Jan 2010 23:58:37 +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 C1E848FC14; Fri, 15 Jan 2010 23:58:37 +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 o0FNwbBH028267; Fri, 15 Jan 2010 23:58:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FNwbHH028265; Fri, 15 Jan 2010 23:58:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001152358.o0FNwbHH028265@svn.freebsd.org> From: Alexander Motin Date: Fri, 15 Jan 2010 23:58:37 +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: r202428 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 23:58:37 -0000 Author: mav Date: Fri Jan 15 23:58:37 2010 New Revision: 202428 URL: http://svn.freebsd.org/changeset/base/202428 Log: MFC r202011: While AHCI specification tells that multi-vector MSI doesn't use global IS register, nVidia chipsets have different oppinion, requiring every interrupt to be acknowledged there. While there, add interrupt descriptions in multi-vector MSI mode. Modified: stable/8/sys/dev/ahci/ahci.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) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Fri Jan 15 23:56:19 2010 (r202427) +++ stable/8/sys/dev/ahci/ahci.c Fri Jan 15 23:58:37 2010 (r202428) @@ -570,6 +570,12 @@ ahci_setup_interrupt(device_t dev) device_printf(dev, "unable to setup interrupt\n"); return ENXIO; } + if (ctlr->numirqs > 1) { + bus_describe_intr(dev, ctlr->irqs[i].r_irq, + ctlr->irqs[i].handle, + ctlr->irqs[i].mode == AHCI_IRQ_MODE_ONE ? + "ch%d" : "%d", i); + } } return (0); } @@ -624,8 +630,14 @@ ahci_intr_one(void *data) int unit; unit = irq->r_irq_rid - 1; + /* Some controllers have edge triggered IS. */ + if (ctlr->quirks & AHCI_Q_EDGEIS) + ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit); if ((arg = ctlr->interrupt[unit].argument)) ctlr->interrupt[unit].function(arg); + /* AHCI declares level triggered IS. */ + if (!(ctlr->quirks & AHCI_Q_EDGEIS)) + ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit); } static struct resource * From owner-svn-src-stable@FreeBSD.ORG Sat Jan 16 04:24:10 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C7A91065694; Sat, 16 Jan 2010 04:24:10 +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 522A28FC1E; Sat, 16 Jan 2010 04:24:10 +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 o0G4OARj086746; Sat, 16 Jan 2010 04:24:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0G4OAqO086744; Sat, 16 Jan 2010 04:24:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001160424.o0G4OAqO086744@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 16 Jan 2010 04:24:10 +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: r202429 - stable/8/lib/libstand X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 04:24:10 -0000 Author: marcel Date: Sat Jan 16 04:24:10 2010 New Revision: 202429 URL: http://svn.freebsd.org/changeset/base/202429 Log: MFC rev 201937: Implement the fo_readdir method. Modified: stable/8/lib/libstand/dosfs.c Directory Properties: stable/8/lib/libstand/ (props changed) Modified: stable/8/lib/libstand/dosfs.c ============================================================================== --- stable/8/lib/libstand/dosfs.c Fri Jan 15 23:58:37 2010 (r202428) +++ stable/8/lib/libstand/dosfs.c Sat Jan 16 04:24:10 2010 (r202429) @@ -47,6 +47,7 @@ static int dos_close(struct open_file *f static int dos_read(struct open_file *fd, void *buf, size_t size, size_t *resid); static off_t dos_seek(struct open_file *fd, off_t offset, int whence); static int dos_stat(struct open_file *fd, struct stat *sb); +static int dos_readdir(struct open_file *fd, struct dirent *d); struct fs_ops dosfs_fsops = { "dosfs", @@ -56,7 +57,7 @@ struct fs_ops dosfs_fsops = { null_write, dos_seek, dos_stat, - null_readdir + dos_readdir }; #define SECSIZ 512 /* sector size */ @@ -354,6 +355,72 @@ dos_stat(struct open_file *fd, struct st return (0); } +static int +dos_readdir(struct open_file *fd, struct dirent *d) +{ + DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; + u_char fn[261]; + DOS_DIR dd; + size_t res; + u_int chk, i, x, xdn; + int err; + + x = chk = 0; + while (1) { + xdn = x; + x = 0; + err = dos_read(fd, &dd, sizeof(dd), &res); + if (err) + return (err); + if (res == sizeof(dd)) + return (ENOENT); + if (dd.de.name[0] == 0) + return (ENOENT); + + /* Skip deleted entries */ + if (dd.de.name[0] == 0xe5) + continue; + + /* Skip volume labels */ + if (dd.de.attr & FA_LABEL) + continue; + + if ((dd.de.attr & FA_MASK) == FA_XDE) { + if (dd.xde.seq & 0x40) + chk = dd.xde.chk; + else if (dd.xde.seq != xdn - 1 || dd.xde.chk != chk) + continue; + x = dd.xde.seq & ~0x40; + if (x < 1 || x > 20) { + x = 0; + continue; + } + cp_xdnm(fn, &dd.xde); + } else { + if (xdn == 1) { + x = 0; + for (i = 0; i < 11; i++) { + x = ((x & 1) << 7) | (x >> 1); + x += dd.de.name[i]; + x &= 0xff; + } + if (x == chk) + break; + } else { + cp_sfn(fn, &dd.de); + break; + } + x = 0; + } + } + + d->d_fileno = dd.de.clus[1] << 8 + dd.de.clus[0]; + d->d_reclen = sizeof(*d); + d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG; + memcpy(d->d_name, fn, sizeof(d->d_name)); + return(0); +} + /* * Parse DOS boot sector */ From owner-svn-src-stable@FreeBSD.ORG Sat Jan 16 04:34:03 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74CA71065692; Sat, 16 Jan 2010 04:34:03 +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 61B128FC08; Sat, 16 Jan 2010 04:34: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 o0G4Y3oR088962; Sat, 16 Jan 2010 04:34:03 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0G4Y36f088954; Sat, 16 Jan 2010 04:34:03 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001160434.o0G4Y36f088954@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 16 Jan 2010 04:34: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: r202430 - in stable/8/sys/boot: common efi/include efi/libefi ia64/efi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 04:34:03 -0000 Author: marcel Date: Sat Jan 16 04:34:03 2010 New Revision: 202430 URL: http://svn.freebsd.org/changeset/base/202430 Log: MFC rev 201941: Remove file system support based on the simple file system protocol. MFC rev 201966: Remove debugging printf(). Added: stable/8/sys/boot/efi/libefi/efipart.c - copied unchanged from r201941, head/sys/boot/efi/libefi/efipart.c Deleted: stable/8/sys/boot/efi/libefi/efifs.c Modified: stable/8/sys/boot/common/bootstrap.h stable/8/sys/boot/efi/include/efilib.h stable/8/sys/boot/efi/libefi/Makefile stable/8/sys/boot/ia64/efi/conf.c stable/8/sys/boot/ia64/efi/main.c stable/8/sys/boot/ia64/efi/version 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) Modified: stable/8/sys/boot/common/bootstrap.h ============================================================================== --- stable/8/sys/boot/common/bootstrap.h Sat Jan 16 04:24:10 2010 (r202429) +++ stable/8/sys/boot/common/bootstrap.h Sat Jan 16 04:34:03 2010 (r202430) @@ -45,6 +45,7 @@ struct devdesc #define DEVT_CD 3 #define DEVT_ZFS 4 int d_unit; + void *d_opendata; }; /* Commands and return values; nonzero return sets command_errmsg != NULL */ Modified: stable/8/sys/boot/efi/include/efilib.h ============================================================================== --- stable/8/sys/boot/efi/include/efilib.h Sat Jan 16 04:24:10 2010 (r202429) +++ stable/8/sys/boot/efi/include/efilib.h Sat Jan 16 04:34:03 2010 (r202430) @@ -34,9 +34,7 @@ extern EFI_SYSTEM_TABLE *ST; extern EFI_BOOT_SERVICES *BS; extern EFI_RUNTIME_SERVICES *RS; -extern struct devsw efifs_dev; -extern struct fs_ops efifs_fsops; - +extern struct devsw efipart_dev; extern struct devsw efinet_dev; extern struct netif_driver efinetif; Modified: stable/8/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/8/sys/boot/efi/libefi/Makefile Sat Jan 16 04:24:10 2010 (r202429) +++ stable/8/sys/boot/efi/libefi/Makefile Sat Jan 16 04:34:03 2010 (r202430) @@ -3,8 +3,8 @@ LIB= efi INTERNALLIB= -SRCS= delay.c efi_console.c efifs.c efinet.c errno.c handles.c libefi.c \ - time.c +SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ + libefi.c time.c CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH:S/amd64/i386/} Copied: stable/8/sys/boot/efi/libefi/efipart.c (from r201941, head/sys/boot/efi/libefi/efipart.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/efi/libefi/efipart.c Sat Jan 16 04:34:03 2010 (r202430, copy of r201941, head/sys/boot/efi/libefi/efipart.c) @@ -0,0 +1,265 @@ +/*- + * Copyright (c) 2010 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#include +#include +#include + +static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL; + +static int efipart_init(void); +static int efipart_strategy(void *, int, daddr_t, size_t, char *, size_t *); +static int efipart_open(struct open_file *, ...); +static int efipart_close(struct open_file *); +static void efipart_print(int); + +struct devsw efipart_dev = { + .dv_name = "part", + .dv_type = DEVT_DISK, + .dv_init = efipart_init, + .dv_strategy = efipart_strategy, + .dv_open = efipart_open, + .dv_close = efipart_close, + .dv_ioctl = noioctl, + .dv_print = efipart_print, + .dv_cleanup = NULL +}; + +static int +efipart_init(void) +{ + EFI_BLOCK_IO *blkio; + EFI_HANDLE *hin, *hout; + EFI_STATUS status; + UINTN sz; + u_int n, nin, nout; + int err; + + sz = 0; + status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, 0); + if (status == EFI_BUFFER_TOO_SMALL) { + hin = (EFI_HANDLE *)malloc(sz * 2); + status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, + hin); + if (EFI_ERROR(status)) + free(hin); + } + if (EFI_ERROR(status)) + return (efi_status_to_errno(status)); + + /* Filter handles to only include FreeBSD partitions. */ + nin = sz / sizeof(EFI_HANDLE); + hout = hin + nin; + nout = 0; + + for (n = 0; n < nin; n++) { + status = BS->HandleProtocol(hin[n], &blkio_guid, &blkio); + if (EFI_ERROR(status)) + continue; + if (!blkio->Media->LogicalPartition) + continue; + hout[nout] = hin[n]; + nout++; + } + + err = efi_register_handles(&efipart_dev, hout, nout); + free(hin); + return (err); +} + +static void +efipart_print(int verbose) +{ + char line[80]; + EFI_BLOCK_IO *blkio; + EFI_HANDLE h; + EFI_STATUS status; + u_int unit; + + for (unit = 0, h = efi_find_handle(&efipart_dev, 0); + h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) { + sprintf(line, " %s%d:", efipart_dev.dv_name, unit); + pager_output(line); + + status = BS->HandleProtocol(h, &blkio_guid, &blkio); + if (!EFI_ERROR(status)) { + sprintf(line, " %llu blocks", + (unsigned long long)(blkio->Media->LastBlock + 1)); + pager_output(line); + if (blkio->Media->RemovableMedia) + pager_output(" (removable)"); + } + pager_output("\n"); + } +} + +static int +efipart_open(struct open_file *f, ...) +{ + va_list args; + struct devdesc *dev; + EFI_BLOCK_IO *blkio; + EFI_HANDLE h; + EFI_STATUS status; + + va_start(args, f); + dev = va_arg(args, struct devdesc*); + va_end(args); + + h = efi_find_handle(&efipart_dev, dev->d_unit); + if (h == NULL) + return (EINVAL); + + status = BS->HandleProtocol(h, &blkio_guid, &blkio); + if (EFI_ERROR(status)) + return (efi_status_to_errno(status)); + + if (!blkio->Media->MediaPresent) + return (EAGAIN); + + dev->d_opendata = blkio; + return (0); +} + +static int +efipart_close(struct open_file *f) +{ + struct devdesc *dev; + + dev = (struct devdesc *)(f->f_devdata); + if (dev->d_opendata == NULL) + return (EINVAL); + + dev->d_opendata = NULL; + return (0); +} + +/* + * efipart_readwrite() + * Internal equivalent of efipart_strategy(), which operates on the + * media-native block size. This function expects all I/O requests + * to be within the media size and returns an error if such is not + * the case. + */ +static int +efipart_readwrite(EFI_BLOCK_IO *blkio, int rw, daddr_t blk, daddr_t nblks, + char *buf) +{ + EFI_STATUS status; + + if (blkio == NULL) + return (ENXIO); + if (blk < 0 || blk > blkio->Media->LastBlock) + return (EIO); + if ((blk + nblks - 1) > blkio->Media->LastBlock) + return (EIO); + + switch (rw) { + case F_READ: + status = blkio->ReadBlocks(blkio, blkio->Media->MediaId, blk, + nblks * blkio->Media->BlockSize, buf); + break; + case F_WRITE: + if (blkio->Media->ReadOnly) + return (EROFS); + status = blkio->WriteBlocks(blkio, blkio->Media->MediaId, blk, + nblks * blkio->Media->BlockSize, buf); + break; + default: + return (ENOSYS); + } + + if (EFI_ERROR(status)) + printf("%s: rw=%d, status=%lu\n", __func__, rw, status); + return (efi_status_to_errno(status)); +} + +static int +efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, + size_t *rsize) +{ + struct devdesc *dev = (struct devdesc *)devdata; + EFI_BLOCK_IO *blkio; + off_t off; + char *blkbuf; + size_t blkoff, blksz; + int error; + + if (dev == NULL || blk < 0) + return (EINVAL); + + blkio = dev->d_opendata; + if (blkio == NULL) + return (ENXIO); + + if (size == 0 || (size % 512) != 0) + return (EIO); + + if (rsize != NULL) + *rsize = size; + + if (blkio->Media->BlockSize == 512) + return (efipart_readwrite(blkio, rw, blk, size / 512, buf)); + + /* + * The block size of the media is not 512B per sector. + */ + blkbuf = malloc(blkio->Media->BlockSize); + if (blkbuf == NULL) + return (ENOMEM); + + error = 0; + off = blk * 512; + blk = off / blkio->Media->BlockSize; + blkoff = off % blkio->Media->BlockSize; + blksz = blkio->Media->BlockSize - blkoff; + while (size > 0) { + error = efipart_readwrite(blkio, rw, blk, 1, blkbuf); + if (error) + break; + if (size < blksz) + blksz = size; + bcopy(blkbuf + blkoff, buf, blksz); + buf += blksz; + size -= blksz; + blk++; + blkoff = 0; + blksz = blkio->Media->BlockSize; + } + + free(blkbuf); + return (error); +} Modified: stable/8/sys/boot/ia64/efi/conf.c ============================================================================== --- stable/8/sys/boot/ia64/efi/conf.c Sat Jan 16 04:24:10 2010 (r202429) +++ stable/8/sys/boot/ia64/efi/conf.c Sat Jan 16 04:34:03 2010 (r202430) @@ -49,15 +49,16 @@ __FBSDID("$FreeBSD$"); /* Exported for libstand */ struct devsw *devsw[] = { - &efifs_dev, + &efipart_dev, &efinet_dev, NULL }; struct fs_ops *file_system[] = { - &efifs_fsops, - &nfs_fsops, + &dosfs_fsops, &ufs_fsops, + &cd9660_fsops, + &nfs_fsops, &gzipfs_fsops, NULL }; Modified: stable/8/sys/boot/ia64/efi/main.c ============================================================================== --- stable/8/sys/boot/ia64/efi/main.c Sat Jan 16 04:24:10 2010 (r202429) +++ stable/8/sys/boot/ia64/efi/main.c Sat Jan 16 04:34:03 2010 (r202430) @@ -127,8 +127,6 @@ main(int argc, CHAR16 *argv[]) /* Get our loaded image protocol interface structure. */ BS->HandleProtocol(IH, &imgid, (VOID**)&img); - printf("Image base: 0x%016lx\n", (u_long)img->ImageBase); - printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); Modified: stable/8/sys/boot/ia64/efi/version ============================================================================== --- stable/8/sys/boot/ia64/efi/version Sat Jan 16 04:24:10 2010 (r202429) +++ stable/8/sys/boot/ia64/efi/version Sat Jan 16 04:34:03 2010 (r202430) @@ -3,6 +3,9 @@ $FreeBSD$ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important. Make sure the current version number is on line 6. +2.0: Provide devices based on the block I/O protocol, rather than the + simple file services protocol. Use the FreeBSD file system code + on top of those devices to access files. 1.2: Restructured. Has some user visible differences. 1.1: Pass the HCDP table address to the kernel via bootinfo if one is present in the EFI system table. From owner-svn-src-stable@FreeBSD.ORG Sat Jan 16 07:55:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C693D1065679; Sat, 16 Jan 2010 07:55:46 +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 B4CDF8FC08; Sat, 16 Jan 2010 07:55: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 o0G7tkmW033289; Sat, 16 Jan 2010 07:55:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0G7tkUV033288; Sat, 16 Jan 2010 07:55:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001160755.o0G7tkUV033288@svn.freebsd.org> From: Alexander Motin Date: Sat, 16 Jan 2010 07:55: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: r202431 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 07:55:46 -0000 Author: mav Date: Sat Jan 16 07:55:46 2010 New Revision: 202431 URL: http://svn.freebsd.org/changeset/base/202431 Log: Partially revert r202428. There is no bus_describe_intr() on RELENG_8. Modified: stable/8/sys/dev/ahci/ahci.c Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Sat Jan 16 04:34:03 2010 (r202430) +++ stable/8/sys/dev/ahci/ahci.c Sat Jan 16 07:55:46 2010 (r202431) @@ -570,12 +570,6 @@ ahci_setup_interrupt(device_t dev) device_printf(dev, "unable to setup interrupt\n"); return ENXIO; } - if (ctlr->numirqs > 1) { - bus_describe_intr(dev, ctlr->irqs[i].r_irq, - ctlr->irqs[i].handle, - ctlr->irqs[i].mode == AHCI_IRQ_MODE_ONE ? - "ch%d" : "%d", i); - } } return (0); } From owner-svn-src-stable@FreeBSD.ORG Sat Jan 16 09:17:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A413D106566C; Sat, 16 Jan 2010 09:17:33 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 913D98FC0A; Sat, 16 Jan 2010 09:17: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 o0G9HX72051279; Sat, 16 Jan 2010 09:17:33 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0G9HXQZ051277; Sat, 16 Jan 2010 09:17:33 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001160917.o0G9HXQZ051277@svn.freebsd.org> From: Christian Brueffer Date: Sat, 16 Jan 2010 09:17: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: r202434 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 09:17:33 -0000 Author: brueffer Date: Sat Jan 16 09:17:33 2010 New Revision: 202434 URL: http://svn.freebsd.org/changeset/base/202434 Log: MFC: r201888 bridge(4) acts like a switch, not like a hub. Modified: stable/8/share/man/man4/bridge.4 Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (props changed) Modified: stable/8/share/man/man4/bridge.4 ============================================================================== --- stable/8/share/man/man4/bridge.4 Sat Jan 16 08:23:09 2010 (r202433) +++ stable/8/share/man/man4/bridge.4 Sat Jan 16 09:17:33 2010 (r202434) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd January 9, 2010 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -111,7 +111,7 @@ by-default. A bridge can be used to provide several services, such as a simple 802.11-to-Ethernet bridge for wireless hosts, and traffic isolation. .Pp -A bridge works like a hub, forwarding traffic from one interface +A bridge works like a switch, forwarding traffic from one interface to another. Multicast and broadcast packets are always forwarded to all interfaces that are part of the bridge. From owner-svn-src-stable@FreeBSD.ORG Sat Jan 16 09:24:12 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81B25106566C; Sat, 16 Jan 2010 09:24:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF658FC14; Sat, 16 Jan 2010 09:24: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 o0G9OCFV052841; Sat, 16 Jan 2010 09:24:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0G9OCJM052839; Sat, 16 Jan 2010 09:24:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001160924.o0G9OCJM052839@svn.freebsd.org> From: Christian Brueffer Date: Sat, 16 Jan 2010 09:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202435 - stable/7/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 09:24:12 -0000 Author: brueffer Date: Sat Jan 16 09:24:12 2010 New Revision: 202435 URL: http://svn.freebsd.org/changeset/base/202435 Log: MFC: r201888 bridge(4) acts like a switch, not like a hub. Modified: stable/7/share/man/man4/if_bridge.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/if_bridge.4 ============================================================================== --- stable/7/share/man/man4/if_bridge.4 Sat Jan 16 09:17:33 2010 (r202434) +++ stable/7/share/man/man4/if_bridge.4 Sat Jan 16 09:24:12 2010 (r202435) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd January 9, 2010 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -95,7 +95,7 @@ The address can be changed by assigning A bridge can be used to provide several services, such as a simple 802.11-to-Ethernet bridge for wireless hosts, and traffic isolation. .Pp -A bridge works like a hub, forwarding traffic from one interface +A bridge works like a switch, forwarding traffic from one interface to another. Multicast and broadcast packets are always forwarded to all interfaces that are part of the bridge. From owner-svn-src-stable@FreeBSD.ORG Sat Jan 16 09:25:25 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E4361065672; Sat, 16 Jan 2010 09:25:25 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFC058FC18; Sat, 16 Jan 2010 09:25: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 o0G9POta053158; Sat, 16 Jan 2010 09:25:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0G9PO8w053156; Sat, 16 Jan 2010 09:25:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001160925.o0G9PO8w053156@svn.freebsd.org> From: Christian Brueffer Date: Sat, 16 Jan 2010 09:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202436 - stable/6/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 09:25:25 -0000 Author: brueffer Date: Sat Jan 16 09:25:24 2010 New Revision: 202436 URL: http://svn.freebsd.org/changeset/base/202436 Log: MFC: r201888 bridge(4) acts like a switch, not like a hub. Modified: stable/6/share/man/man4/if_bridge.4 Directory Properties: stable/6/share/man/man4/ (props changed) Modified: stable/6/share/man/man4/if_bridge.4 ============================================================================== --- stable/6/share/man/man4/if_bridge.4 Sat Jan 16 09:24:12 2010 (r202435) +++ stable/6/share/man/man4/if_bridge.4 Sat Jan 16 09:25:24 2010 (r202436) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2007 +.Dd January 9, 2010 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -94,7 +94,7 @@ The address can be changed by assigning A bridge can be used to provide several services, such as a simple 802.11-to-Ethernet bridge for wireless hosts, and traffic isolation. .Pp -A bridge works like a hub, forwarding traffic from one interface +A bridge works like a switch, forwarding traffic from one interface to another. Multicast and broadcast packets are always forwarded to all interfaces that are part of the bridge. From owner-svn-src-stable@FreeBSD.ORG Sat Jan 16 12:16:38 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D62E21065672; Sat, 16 Jan 2010 12:16:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAE9E8FC19; Sat, 16 Jan 2010 12:16:38 +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 o0GCGc4C092553; Sat, 16 Jan 2010 12:16:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GCGcEj092549; Sat, 16 Jan 2010 12:16:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001161216.o0GCGcEj092549@svn.freebsd.org> From: Marius Strobl Date: Sat, 16 Jan 2010 12:16:38 +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: r202438 - stable/8/sys/nfsserver X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 12:16:38 -0000 Author: marius Date: Sat Jan 16 12:16:38 2010 New Revision: 202438 URL: http://svn.freebsd.org/changeset/base/202438 Log: MFC: r201896 As nfsm_srvmtofh_xx() assumes the 4-byte alignment required by XDR ensure the mbuf data is aligned accordingly by calling nfs_realign() in fha_extract_info(). This fix is orthogonal to the problem solved by r199274/r199284 (MFC'ed to stable/8 in r199733). PR: 142102 (second part) Modified: stable/8/sys/nfsserver/nfs.h stable/8/sys/nfsserver/nfs_fha.c stable/8/sys/nfsserver/nfs_srvkrpc.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) Modified: stable/8/sys/nfsserver/nfs.h ============================================================================== --- stable/8/sys/nfsserver/nfs.h Sat Jan 16 09:52:49 2010 (r202437) +++ stable/8/sys/nfsserver/nfs.h Sat Jan 16 12:16:38 2010 (r202438) @@ -240,6 +240,7 @@ extern int nfs_debug; #endif +void nfs_realign(struct mbuf **); struct mbuf *nfs_rephead(int, struct nfsrv_descript *, int, struct mbuf **, caddr_t *); void nfsm_srvfattr(struct nfsrv_descript *, struct vattr *, Modified: stable/8/sys/nfsserver/nfs_fha.c ============================================================================== --- stable/8/sys/nfsserver/nfs_fha.c Sat Jan 16 09:52:49 2010 (r202437) +++ stable/8/sys/nfsserver/nfs_fha.c Sat Jan 16 12:16:38 2010 (r202438) @@ -158,9 +158,9 @@ SYSUNINIT(nfs_fha, SI_SUB_ROOT_CONF, SI_ static void fha_extract_info(struct svc_req *req, struct fha_info *i) { - struct mbuf *md = req->rq_args; + struct mbuf *md; nfsfh_t fh; - caddr_t dpos = mtod(md, caddr_t); + caddr_t dpos; static u_int64_t random_fh = 0; int error; int v3 = (req->rq_vers == 3); @@ -201,6 +201,10 @@ fha_extract_info(struct svc_req *req, st procnum == NFSPROC_NULL) goto out; + nfs_realign(&req->rq_args); + md = req->rq_args; + dpos = mtod(md, caddr_t); + /* Grab the filehandle. */ error = nfsm_srvmtofh_xx(&fh.fh_generic, v3, &md, &dpos); if (error) Modified: stable/8/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- stable/8/sys/nfsserver/nfs_srvkrpc.c Sat Jan 16 09:52:49 2010 (r202437) +++ stable/8/sys/nfsserver/nfs_srvkrpc.c Sat Jan 16 12:16:38 2010 (r202438) @@ -266,7 +266,7 @@ nfs_rephead(int siz, struct nfsrv_descri * not occur with NFS/UDP and is supposed to only occassionally occur * with TCP. Use vfs.nfs.realign_count and realign_test to check this. */ -static void +void nfs_realign(struct mbuf **pm) /* XXX COMMON */ { struct mbuf *m; From owner-svn-src-stable@FreeBSD.ORG Sat Jan 16 12:18:44 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96EB5106566B; Sat, 16 Jan 2010 12:18:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83A438FC12; Sat, 16 Jan 2010 12:18: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 o0GCIi6H093067; Sat, 16 Jan 2010 12:18:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GCIiJm093063; Sat, 16 Jan 2010 12:18:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001161218.o0GCIiJm093063@svn.freebsd.org> From: Marius Strobl Date: Sat, 16 Jan 2010 12:18: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: r202439 - stable/8/sys/nfsserver X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 12:18:44 -0000 Author: marius Date: Sat Jan 16 12:18:44 2010 New Revision: 202439 URL: http://svn.freebsd.org/changeset/base/202439 Log: MFC: r201899 Some style(9) fixes Modified: stable/8/sys/nfsserver/nfs.h stable/8/sys/nfsserver/nfs_fha.c stable/8/sys/nfsserver/nfs_srvkrpc.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) Modified: stable/8/sys/nfsserver/nfs.h ============================================================================== --- stable/8/sys/nfsserver/nfs.h Sat Jan 16 12:16:38 2010 (r202438) +++ stable/8/sys/nfsserver/nfs.h Sat Jan 16 12:18:44 2010 (r202439) @@ -82,14 +82,13 @@ #define IO_METASYNC 0 #endif - /* NFS state flags XXX -Wunused */ #define NFSRV_SNDLOCK 0x01000000 /* Send socket lock */ #define NFSRV_WANTSND 0x02000000 /* Want above */ /* - * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs - * should ever try and use it. + * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and + * mount_nfs should ever try and use it. */ /* Modified: stable/8/sys/nfsserver/nfs_fha.c ============================================================================== --- stable/8/sys/nfsserver/nfs_fha.c Sat Jan 16 12:16:38 2010 (r202438) +++ stable/8/sys/nfsserver/nfs_fha.c Sat Jan 16 12:18:44 2010 (r202439) @@ -71,16 +71,17 @@ static struct fha_global { u_long hashmask; } g_fha; -/* - * These are the entries in the filehandle hash. They talk about a specific - * file, requests against which are being handled by one or more nfsds. We keep - * a chain of nfsds against the file. We only have more than one if reads are - * ongoing, and then only if the reads affect disparate regions of the file. +/* + * These are the entries in the filehandle hash. They talk about a specific + * file, requests against which are being handled by one or more nfsds. We + * keep a chain of nfsds against the file. We only have more than one if reads + * are ongoing, and then only if the reads affect disparate regions of the + * file. * - * In general, we want to assign a new request to an existing nfsd if it is - * going to contend with work happening already on that nfsd, or if the - * operation is a read and the nfsd is already handling a proximate read. We - * do this to avoid jumping around in the read stream unnecessarily, and to + * In general, we want to assign a new request to an existing nfsd if it is + * going to contend with work happening already on that nfsd, or if the + * operation is a read and the nfsd is already handling a proximate read. We + * do this to avoid jumping around in the read stream unnecessarily, and to * avoid contention between threads over single files. */ struct fha_hash_entry { @@ -101,7 +102,7 @@ struct fha_info { }; static int fhe_stats_sysctl(SYSCTL_HANDLER_ARGS); - + static void nfs_fha_init(void *foo) { @@ -136,7 +137,7 @@ nfs_fha_init(void *foo) &fha_ctls.max_reqs_per_nfsd, 0, "Maximum requests that " "single nfsd thread should be working on at any time"); - SYSCTL_ADD_OID(&fha_clist, SYSCTL_STATIC_CHILDREN(_vfs_nfsrv_fha), + SYSCTL_ADD_OID(&fha_clist, SYSCTL_STATIC_CHILDREN(_vfs_nfsrv_fha), OID_AUTO, "fhe_stats", CTLTYPE_STRING | CTLFLAG_RD, 0, 0, fhe_stats_sysctl, "A", ""); } @@ -151,7 +152,7 @@ nfs_fha_uninit(void *foo) SYSINIT(nfs_fha, SI_SUB_ROOT_CONF, SI_ORDER_ANY, nfs_fha_init, NULL); SYSUNINIT(nfs_fha, SI_SUB_ROOT_CONF, SI_ORDER_ANY, nfs_fha_uninit, NULL); -/* +/* * This just specifies that offsets should obey affinity when within * the same 1Mbyte (1<<20) chunk for the file (reads only for now). */ @@ -167,18 +168,18 @@ fha_extract_info(struct svc_req *req, st u_int32_t *tl; rpcproc_t procnum; - /* - * We start off with a random fh. If we get a reasonable - * procnum, we set the fh. If there's a concept of offset + /* + * We start off with a random fh. If we get a reasonable + * procnum, we set the fh. If there's a concept of offset * that we're interested in, we set that. */ i->fh = ++random_fh; i->offset = 0; i->locktype = LK_EXCLUSIVE; - + /* * Extract the procnum and convert to v3 form if necessary, - * taking care to deal with out-of-range procnums. Caller will + * taking care to deal with out-of-range procnums. Caller will * ensure that rq_vers is either 2 or 3. */ procnum = req->rq_proc; @@ -188,19 +189,19 @@ fha_extract_info(struct svc_req *req, st procnum = nfsrv_nfsv3_procid[procnum]; } - /* - * We do affinity for most. However, we divide a realm of affinity - * by file offset so as to allow for concurrent random access. We - * only do this for reads today, but this may change when IFS supports + /* + * We do affinity for most. However, we divide a realm of affinity + * by file offset so as to allow for concurrent random access. We + * only do this for reads today, but this may change when IFS supports * efficient concurrent writes. */ if (procnum == NFSPROC_FSSTAT || procnum == NFSPROC_FSINFO || procnum == NFSPROC_PATHCONF || - procnum == NFSPROC_NOOP || + procnum == NFSPROC_NOOP || procnum == NFSPROC_NULL) goto out; - + nfs_realign(&req->rq_args); md = req->rq_args; dpos = mtod(md, caddr_t); @@ -270,8 +271,8 @@ fha_hash_entry_new(u_int64_t fh) e->num_writes = 0; e->num_threads = 0; LIST_INIT(&e->threads); - - return e; + + return (e); } static void @@ -296,10 +297,9 @@ fha_hash_entry_lookup(SVCPOOL *pool, u_i { struct fha_hash_entry *fhe, *new_fhe; - LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) { + LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) if (fhe->fh == fh) break; - } if (!fhe) { /* Allocate a new entry. */ @@ -308,25 +308,24 @@ fha_hash_entry_lookup(SVCPOOL *pool, u_i mtx_lock(&pool->sp_lock); /* Double-check to make sure we still need the new entry. */ - LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) { + LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) if (fhe->fh == fh) break; - } if (!fhe) { fhe = new_fhe; LIST_INSERT_HEAD(&g_fha.hashtable[fh % g_fha.hashmask], fhe, link); - } else { + } else fha_hash_entry_destroy(new_fhe); - } } - return fhe; + return (fhe); } static void fha_hash_entry_add_thread(struct fha_hash_entry *fhe, SVCTHREAD *thread) { + LIST_INSERT_HEAD(&fhe->threads, thread, st_alink); fhe->num_threads++; } @@ -339,7 +338,7 @@ fha_hash_entry_remove_thread(struct fha_ fhe->num_threads--; } -/* +/* * Account for an ongoing operation associated with this file. */ static void @@ -365,7 +364,7 @@ get_idle_thread(SVCPOOL *pool) } -/* +/* * Get the service thread currently associated with the fhe that is * appropriate to handle this operation. */ @@ -387,15 +386,15 @@ fha_hash_entry_choose_thread(SVCPOOL *po /* If there are any writes in progress, use the first thread. */ if (fhe->num_writes) { #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)w", thread, req_count); #endif return (thread); } - /* - * Check for read locality, making sure that we won't - * exceed our per-thread load limit in the process. + /* + * Check for read locality, making sure that we won't + * exceed our per-thread load limit in the process. */ offset1 = i->offset >> fha_ctls.bin_shift; offset2 = STAILQ_FIRST(&thread->st_reqs)->rq_p3 @@ -404,21 +403,21 @@ fha_hash_entry_choose_thread(SVCPOOL *po if ((fha_ctls.max_reqs_per_nfsd == 0) || (req_count < fha_ctls.max_reqs_per_nfsd)) { #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)r", thread, req_count); #endif return (thread); } } - /* + /* * We don't have a locality match, so skip this thread, - * but keep track of the most attractive thread in case + * but keep track of the most attractive thread in case * we need to come back to it later. */ #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, - "fha: %p(%d)s off1 %llu off2 %llu", thread, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + "fha: %p(%d)s off1 %llu off2 %llu", thread, req_count, offset1, offset2); #endif if ((min_thread == NULL) || (req_count < min_count)) { @@ -427,38 +426,38 @@ fha_hash_entry_choose_thread(SVCPOOL *po } } - /* - * We didn't find a good match yet. See if we can add + /* + * We didn't find a good match yet. See if we can add * a new thread to this file handle entry's thread list. */ - if ((fha_ctls.max_nfsds_per_fh == 0) || + if ((fha_ctls.max_nfsds_per_fh == 0) || (fhe->num_threads < fha_ctls.max_nfsds_per_fh)) { - /* - * We can add a new thread, so try for an idle thread - * first, and fall back to this_thread if none are idle. + /* + * We can add a new thread, so try for an idle thread + * first, and fall back to this_thread if none are idle. */ if (STAILQ_EMPTY(&this_thread->st_reqs)) { thread = this_thread; #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)t", thread, thread->st_reqcount); #endif } else if ((thread = get_idle_thread(pool))) { #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)i", thread, thread->st_reqcount); #endif - } else { + } else { thread = this_thread; #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)b", thread, thread->st_reqcount); #endif } fha_hash_entry_add_thread(fhe, thread); } else { - /* - * We don't want to use any more threads for this file, so + /* + * We don't want to use any more threads for this file, so * go back to the most attractive nfsd we're already using. */ thread = min_thread; @@ -467,8 +466,8 @@ fha_hash_entry_choose_thread(SVCPOOL *po return (thread); } -/* - * After getting a request, try to assign it to some thread. Usually we +/* + * After getting a request, try to assign it to some thread. Usually we * handle it ourselves. */ SVCTHREAD * @@ -491,16 +490,16 @@ fha_assign(SVCTHREAD *this_thread, struc pool = req->rq_xprt->xp_pool; fha_extract_info(req, &i); - /* - * We save the offset associated with this request for later + /* + * We save the offset associated with this request for later * nfsd matching. */ fhe = fha_hash_entry_lookup(pool, i.fh); req->rq_p1 = fhe; req->rq_p2 = i.locktype; req->rq_p3 = i.offset; - - /* + + /* * Choose a thread, taking into consideration locality, thread load, * and the number of threads already working on this file. */ @@ -511,8 +510,8 @@ fha_assign(SVCTHREAD *this_thread, struc return (thread); } -/* - * Called when we're done with an operation. The request has already +/* + * Called when we're done with an operation. The request has already * been de-queued. */ void Modified: stable/8/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- stable/8/sys/nfsserver/nfs_srvkrpc.c Sat Jan 16 12:16:38 2010 (r202438) +++ stable/8/sys/nfsserver/nfs_srvkrpc.c Sat Jan 16 12:18:44 2010 (r202439) @@ -187,19 +187,18 @@ nfssvc_nfsserver(struct thread *td, stru } error = nfssvc_addsock(fp, td); fdrop(fp, td); - } else if (uap->flag & NFSSVC_OLDNFSD) { + } else if (uap->flag & NFSSVC_OLDNFSD) error = nfssvc_nfsd(td, NULL); - } else if (uap->flag & NFSSVC_NFSD) { - if (!uap->argp) + else if (uap->flag & NFSSVC_NFSD) { + if (!uap->argp) return (EINVAL); error = copyin(uap->argp, (caddr_t)&nfsdarg, sizeof(nfsdarg)); if (error) return (error); error = nfssvc_nfsd(td, &nfsdarg); - } else { + } else error = ENXIO; - } return (error); } @@ -447,9 +446,8 @@ nfssvc_addsock(struct file *fp, struct t siz = sb_max_adj; error = soreserve(so, siz, siz); - if (error) { + if (error) return (error); - } /* * Steal the socket from userland so that it doesn't close @@ -471,7 +469,7 @@ nfssvc_addsock(struct file *fp, struct t } /* - * Called by nfssvc() for nfsds. Just loops around servicing rpc requests + * Called by nfssvc() for nfsds. Just loops around servicing rpc requests * until it is killed by a signal. */ static int @@ -496,9 +494,9 @@ nfssvc_nfsd(struct thread *td, struct nf #endif /* - * Only the first nfsd actually does any work. The RPC code - * adds threads to it as needed. Any extra processes offered - * by nfsd just exit. If nfsd is new enough, it will call us + * Only the first nfsd actually does any work. The RPC code + * adds threads to it as needed. Any extra processes offered + * by nfsd just exit. If nfsd is new enough, it will call us * once with a structure that specifies how many threads to * use. */ @@ -522,7 +520,7 @@ nfssvc_nfsd(struct thread *td, struct nf nfsrv_pool->sp_minthreads = 4; nfsrv_pool->sp_maxthreads = 4; } - + svc_run(nfsrv_pool); #ifdef KGSSAPI @@ -541,7 +539,7 @@ nfssvc_nfsd(struct thread *td, struct nf /* * Size the NFS server's duplicate request cache at 1/2 the - * nmbclusters, floating within a (64, 2048) range. This is to + * nmbclusters, floating within a (64, 2048) range. This is to * prevent all mbuf clusters being tied up in the NFS dupreq * cache for small values of nmbclusters. */ From owner-svn-src-stable@FreeBSD.ORG Sat Jan 16 15:00:36 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FD291065694; Sat, 16 Jan 2010 15:00:36 +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 3F1598FC14; Sat, 16 Jan 2010 15:00:36 +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 o0GF0aNb028770; Sat, 16 Jan 2010 15:00:36 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GF0akx028768; Sat, 16 Jan 2010 15:00:36 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001161500.o0GF0akx028768@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 16 Jan 2010 15:00:36 +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: r202446 - stable/8/sbin/ifconfig X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 15:00:36 -0000 Author: gavin Date: Sat Jan 16 15:00:35 2010 New Revision: 202446 URL: http://svn.freebsd.org/changeset/base/202446 Log: MFC r200587: ifconfig(8) is documented to take a ISO 3166-1 country code to set the regulatory domain with the "country" parameter, but will also take a full country name. The man page warns that only the ISO code is unambiguous. In reality, however, the first match on either would be accepted, leading to "DE" being interpreted as the "DEBUG" country rather than Germany, and "MO" selecting Morocco rather than the correct country, Macau. Fix this by always checking for an ISO CC match first, and only search on the full country name if that fails. PR: bin/140571 Tested by: Dirk Meyer dirk.meyer dinoex.sub.org Reviewed by: sam Approved by: ed (mentor, implicit) Modified: stable/8/sbin/ifconfig/regdomain.c Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/regdomain.c ============================================================================== --- stable/8/sbin/ifconfig/regdomain.c Sat Jan 16 14:33:22 2010 (r202445) +++ stable/8/sbin/ifconfig/regdomain.c Sat Jan 16 15:00:35 2010 (r202446) @@ -694,8 +694,11 @@ lib80211_country_findbyname(const struct len = strlen(name); LIST_FOREACH(cp, &rdp->countries, next) { - if (strcasecmp(cp->isoname, name) == 0 || - strncasecmp(cp->name, name, len) == 0) + if (strcasecmp(cp->isoname, name) == 0) + return cp; + } + LIST_FOREACH(cp, &rdp->countries, next) { + if (strncasecmp(cp->name, name, len) == 0) return cp; } return NULL;