From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 10 07:08:11 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-8@FreeBSD.ORG Sun Jan 10 11:25:35 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-8@FreeBSD.ORG Sun Jan 10 16:00:01 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-8@FreeBSD.ORG Sun Jan 10 16:04:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-8@FreeBSD.ORG Sun Jan 10 16:08:14 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-8@FreeBSD.ORG Sun Jan 10 16:58:12 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-8@FreeBSD.ORG Sun Jan 10 23:51:03 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-8@FreeBSD.ORG Mon Jan 11 02:31:00 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-8@FreeBSD.ORG Mon Jan 11 03:03:54 2010 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-8@FreeBSD.ORG Mon Jan 11 05:19:52 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-8@FreeBSD.ORG Mon Jan 11 12:32:06 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-8@FreeBSD.ORG Mon Jan 11 12:35:17 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-8@FreeBSD.ORG Mon Jan 11 18:42:29 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-8@FreeBSD.ORG Mon Jan 11 19:30:24 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-8@FreeBSD.ORG Mon Jan 11 20:32:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-8@FreeBSD.ORG Tue Jan 12 00:04:14 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-8@FreeBSD.ORG Tue Jan 12 06:00:57 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-8@FreeBSD.ORG Tue Jan 12 06:09:56 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-8@FreeBSD.ORG Tue Jan 12 06:11:37 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-8@FreeBSD.ORG Tue Jan 12 06:14:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-8@FreeBSD.ORG Tue Jan 12 07:33:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-8@FreeBSD.ORG Tue Jan 12 18:47:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-8@FreeBSD.ORG Tue Jan 12 19:55:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-8@FreeBSD.ORG Wed Jan 13 18:12:22 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 19:55:52 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 19:59:13 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 20:03:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 20:05:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 20:07:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 20:32:54 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 20:35:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 20:40:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 20:51:21 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 20:59:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:03:04 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:04:56 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:08:58 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:12:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:13:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:16:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:17:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:19:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:21:29 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Wed Jan 13 21:23:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-8@FreeBSD.ORG Thu Jan 14 17:35:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 20:38:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 20:47:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 20:59:02 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 21:10:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 21:30:06 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 21:45:39 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 22:00:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 22:15:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 22:26:52 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 22:33:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Thu Jan 14 22:36:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-8@FreeBSD.ORG Fri Jan 15 02:18:09 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 02:55:19 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 03:03:02 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 03:04:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 03:28:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 11:26:21 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 12:02:22 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 12:07:30 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 12:27:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 14:20:02 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 14:24:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 15:27:17 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 15:28:57 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 15:36:13 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 15:38:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 15:40:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 15:42:15 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 15:47:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 16:21:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 16:25:17 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 16:27:58 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 16:29:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 16:42:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 16:46:03 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 16:54:59 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 16:57:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 19:06:34 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 19:12:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 19:42:09 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 19:53:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 21:45:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 22:19:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 23:52:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 23:56:20 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Fri Jan 15 23:58:37 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-8@FreeBSD.ORG Sat Jan 16 04:24:10 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-8@FreeBSD.ORG Sat Jan 16 04:34:03 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-8@FreeBSD.ORG Sat Jan 16 07:55:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-8@FreeBSD.ORG Sat Jan 16 09:17:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-8@FreeBSD.ORG Sat Jan 16 12:16:38 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-8@FreeBSD.ORG Sat Jan 16 12:18:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-8@FreeBSD.ORG Sat Jan 16 15:00:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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;